Commit c7c0a1cd authored by Cole Brown's avatar Cole Brown

Add test for unknown elliptic curves

parent 23da4bd6
...@@ -145,3 +145,15 @@ func (pk testkey) Raw() ([]byte, error) { ...@@ -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")
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment