1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:54:39 -07:00

Fix tests

This commit is contained in:
xzhang39 2024-06-05 17:02:33 -07:00
parent 55424acc64
commit c801e2ccc1
2 changed files with 3 additions and 3 deletions

View File

@ -214,7 +214,7 @@ func TestSignPKCS1v15(t *testing.T) {
}
}
func TestSignPKCS1v15WithPrivateKeySizeZero(t *testing.T) {
func TestSignPKCS1v15WithPublicKeySizeZero(t *testing.T) {
h := sha1.New()
h.Write([]byte("key"))
digest := h.Sum(nil)
@ -227,7 +227,7 @@ func TestSignPKCS1v15WithPrivateKeySizeZero(t *testing.T) {
if err == nil {
t.Error("expected error but got nil")
}
if err != nil && err.Error() != "crypto/rsa: private key size zero" {
if err != nil && err.Error() != "crypto/rsa: public key size zero" {
t.Errorf("unexpected error: %v", err)
}
}

View File

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