diff --git a/dsa_test.go b/dsa_test.go index b570294b..6ba5eb9a 100644 --- a/dsa_test.go +++ b/dsa_test.go @@ -161,8 +161,15 @@ func TestNewPublicKeyDSAWithBadPublicKey(t *testing.T) { } Y := bbig.Enc(fromHex("32969E5780CFE1C849A1C276D7AEB4F38A23B591739AA2FE197349AEEBD31366AEE5EB7E6C6DDB7C57D02432B30DB5AA66D9884299FAA72568944E4EEDC92EA3FBC6F39F53412FBCC563208F7C15B737AC8910DBC2D9C9B8C001E72FDC40EB694AB1F06A5A2DBD18D9E36C66F31F566742F11EC0A52E9F7B89355C02FB5D32D2")) - _, err := openssl.NewPublicKeyDSA(params, Y) + pub, err := openssl.NewPublicKeyDSA(params, Y) if err == nil { + t.Fatal(err) + } + sig, err := asn1.Marshal(dsaSignature{fromHex("2"), fromHex("4")}) + if err != nil { + t.Fatal(err) + } + if openssl.VerifyDSA(pub, []byte("testing"), sig) { t.Errorf("Unexpected success with non-existent mod inverse of Q") } }