1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:24:45 -07:00

Init E in tests

This commit is contained in:
xzhang39 2024-06-06 15:42:33 -07:00
parent c801e2ccc1
commit 9fcd1039d8
2 changed files with 2 additions and 1 deletions

View File

@ -222,6 +222,7 @@ func TestSignPKCS1v15WithPublicKeySizeZero(t *testing.T) {
&PrivateKey{ &PrivateKey{
PublicKey: PublicKey{ PublicKey: PublicKey{
N: big.NewInt(0), N: big.NewInt(0),
E: 65537,
}, },
}, crypto.SHA1, digest) }, crypto.SHA1, digest)
if err == nil { if err == nil {

View File

@ -656,7 +656,7 @@ func TestEncryptOAEP(t *testing.T) {
func TestEncryptOAEPWithPublicKeySizeZero(t *testing.T) { func TestEncryptOAEPWithPublicKeySizeZero(t *testing.T) {
sha1 := sha1.New() sha1 := sha1.New()
_, err := EncryptOAEP(sha1, nil, &PublicKey{N: big.NewInt(0)}, nil, nil) _, err := EncryptOAEP(sha1, nil, &PublicKey{N: big.NewInt(0), E: 65537}, nil, nil)
if err == nil { if err == nil {
t.Error("expected error but got nil") t.Error("expected error but got nil")
} }