Skip to content

Commit

Permalink
Add test for unknown elliptic curves
Browse files Browse the repository at this point in the history
  • Loading branch information
bigs committed Jul 12, 2019
1 parent 3257399 commit a9b8c56
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/crypto/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,15 @@ func (pk testkey) Raw() ([]byte, error) {
func (pk testkey) Equals(k Key) bool {
return KeyEqual(pk, k)
}

func TestUnknownCurveErrors(t *testing.T) {
_, _, err := GenerateEKeyPair("P-256")
if err != nil {
t.Fatal(err)
}

_, _, err = GenerateEKeyPair("error-please")
if err == nil {
t.Fatal("expected invalid key type to error")
}
}

0 comments on commit a9b8c56

Please sign in to comment.