Add test for unknown elliptic curves

This commit is contained in:
Cole Brown 2019-07-12 17:09:27 -04:00
parent 23da4bd6da
commit c7c0a1cdf0

View File

@ -145,3 +145,15 @@ func (pk testkey) Raw() ([]byte, error) {
func (pk testkey) Equals(k Key) bool { func (pk testkey) Equals(k Key) bool {
return KeyEqual(pk, k) 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")
}
}