From 028b466a51af690ee0ddd84065104177c9d1dbb8 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Fri, 13 Dec 2024 16:27:39 +0100 Subject: [PATCH] add TestSupportsSignatureRSAPKCS1v15 --- rsa_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rsa_test.go b/rsa_test.go index 1b7d0b60..9e8c6673 100644 --- a/rsa_test.go +++ b/rsa_test.go @@ -193,6 +193,14 @@ func TestRSAEncryptDecryptOAEP_WrongLabel(t *testing.T) { } } +func TestSupportsSignatureRSAPKCS1v15(t *testing.T) { + // crypto.SHA256 should always be supported. + // Use it to test that the function works. + if !openssl.SupportsSignatureRSAPKCS1v15(crypto.SHA256) { + t.Error("crypto.SHA256 not supported") + } +} + func TestRSASignVerifyPKCS1v15(t *testing.T) { priv, pub := newRSAKey(t, 2048) // These are all the hashes supported by Go's crypto/rsa package