Skip to content

Commit

Permalink
gofmt -w -s; appease linter
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Mar 31, 2021
1 parent 1027e55 commit 9541892
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions jwk/jwk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ func TestRSA(t *testing.T) {
})
t.Run("New", func(t *testing.T) {
for _, raw := range []rsa.PublicKey{
rsa.PublicKey{},
{},
} {
_, err := jwk.New(raw)
if !assert.Error(t, err, `jwk.New should fail for invalid key`) {
Expand Down Expand Up @@ -1081,19 +1081,19 @@ func TestRSA(t *testing.T) {
})
t.Run("New", func(t *testing.T) {
for _, raw := range []rsa.PrivateKey{
rsa.PrivateKey{}, // Missing D
rsa.PrivateKey{ // Missing primes
{}, // Missing D
{ // Missing primes
D: &big.Int{},
},
rsa.PrivateKey{ // Missing Primes[0]
{ // Missing Primes[0]
D: &big.Int{},
Primes: []*big.Int{nil, {}},
},
rsa.PrivateKey{ // Missing Primes[1]
{ // Missing Primes[1]
D: &big.Int{},
Primes: []*big.Int{{}, nil},
},
rsa.PrivateKey{ // Missing PrivateKey.N
{ // Missing PrivateKey.N
D: &big.Int{},
Primes: []*big.Int{{}, {}},
},
Expand Down Expand Up @@ -1136,17 +1136,17 @@ func TestECDSA(t *testing.T) {
t.Run("PrivateKey", func(t *testing.T) {
t.Run("New", func(t *testing.T) {
for _, raw := range []ecdsa.PrivateKey{
ecdsa.PrivateKey{},
ecdsa.PrivateKey{ // Missing PublicKey
{},
{ // Missing PublicKey
D: &big.Int{},
},
ecdsa.PrivateKey{ // Missing PublicKey.X
{ // Missing PublicKey.X
D: &big.Int{},
PublicKey: ecdsa.PublicKey{
Y: &big.Int{},
},
},
ecdsa.PrivateKey{ // Missing PublicKey.Y
{ // Missing PublicKey.Y
D: &big.Int{},
PublicKey: ecdsa.PublicKey{
X: &big.Int{},
Expand Down Expand Up @@ -1185,11 +1185,11 @@ func TestECDSA(t *testing.T) {
t.Run("PublicKey", func(t *testing.T) {
t.Run("New", func(t *testing.T) {
for _, raw := range []ecdsa.PublicKey{
ecdsa.PublicKey{},
ecdsa.PublicKey{ // Missing X
{},
{ // Missing X
Y: &big.Int{},
},
ecdsa.PublicKey{ // Missing Y
{ // Missing Y
X: &big.Int{},
},
} {
Expand Down
2 changes: 1 addition & 1 deletion jwk/rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (k *rsaPrivateKey) FromRaw(rawKey *rsa.PrivateKey) error {
return errors.Wrap(err, `invalid rsa.PrivateKey`)
}
k.p = p

q, err := bigIntToBytes(rawKey.Primes[1])
if err != nil {
return errors.Wrap(err, `invalid rsa.PrivateKey`)
Expand Down

0 comments on commit 9541892

Please sign in to comment.