Skip to content

Commit

Permalink
fix TestNewPublicKeyDSAWithBadPublicKey
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Jan 17, 2024
1 parent 1478f70 commit 925e14e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dsa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down

0 comments on commit 925e14e

Please sign in to comment.