From c7c0a1cdf0be0e5489ad97ff9a8ed2a4e2605021 Mon Sep 17 00:00:00 2001 From: Cole Brown Date: Fri, 12 Jul 2019 17:09:27 -0400 Subject: [PATCH] Add test for unknown elliptic curves --- crypto/key_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crypto/key_test.go b/crypto/key_test.go index 2a5e89a..0b25432 100644 --- a/crypto/key_test.go +++ b/crypto/key_test.go @@ -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") + } +}