Skip to content

Commit

Permalink
badkeys: handle nil specifically
Browse files Browse the repository at this point in the history
  • Loading branch information
hdm committed Dec 9, 2024
1 parent 98d2362 commit 49645b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions badkeys/badkeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func PrefixFromPublicKey(pub any) ([]byte, error) {
rawb = pub.Bytes() // Verify
case *dsa.PublicKey:
rawb = pub.Y.Bytes()
case nil:
return nil, fmt.Errorf("unsupported nil key")
default:
return nil, fmt.Errorf("unsupported key: %T", pub)
}
Expand Down

0 comments on commit 49645b8

Please sign in to comment.