Skip to content

Commit

Permalink
add TestSignPKCS1v15_Empty
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Nov 25, 2024
1 parent 37b15dc commit cf24d96
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cng/rsa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ func TestVerifyPKCS1v15_NotHashed(t *testing.T) {
}
}

func TestSignPKCS1v15_Empty(t *testing.T) {
priv, _ := newRSAKey(t, 2048)
_, err := cng.SignRSAPKCS1v15(priv, crypto.SHA256, nil)
if err == nil {
t.Fatal("error expected")
} else if err.Error() != "crypto/rsa: input must be hashed message" {
t.Fatalf("unexpected error: %v", err)
}
}

func TestSignVerifyPKCS1v15_Invalid(t *testing.T) {
sha256 := cng.NewSHA256()
msg := []byte("hi!")
Expand Down

0 comments on commit cf24d96

Please sign in to comment.