mirror of
https://github.com/golang/go
synced 2024-11-22 03:54:39 -07:00
Fix tests
This commit is contained in:
parent
55424acc64
commit
c801e2ccc1
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user