summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-10-11 12:08:29 +0100
committerMatt Caswell <matt@openssl.org>2021-10-22 08:44:59 +0100
commit60722c167cd3f26f1670d50a8638ee21979bea36 (patch)
treec1ca48d4ae752d860e626da667b6fef4e9a0888e /providers
parent60f5e48f44b0d4e4179960741e8b73e5c475d3e8 (diff)
Fix a bug in signature self tests in the FIPS module
When calling EVP_PKEY_sign(), the size of the signature buffer must be passed in *siglen. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16789) (cherry picked from commit 61adb6cf950b65a7bfce9a8d78a7744dfae9f978)
Diffstat (limited to 'providers')
-rw-r--r--providers/fips/self_test_kats.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/providers/fips/self_test_kats.c b/providers/fips/self_test_kats.c
index 81f7226ba1..94a0cf842c 100644
--- a/providers/fips/self_test_kats.c
+++ b/providers/fips/self_test_kats.c
@@ -446,7 +446,7 @@ static int self_test_sign(const ST_KAT_SIGN *t,
EVP_PKEY *pkey = NULL;
unsigned char sig[256];
BN_CTX *bnctx = NULL;
- size_t siglen = 0;
+ size_t siglen = sizeof(sig);
static const unsigned char dgst[] = {
0x7f, 0x83, 0xb1, 0x65, 0x7f, 0xf1, 0xfc, 0x53, 0xb9, 0x2d, 0xc1, 0x81,
0x48, 0xa1, 0xd6, 0x5d, 0xfc, 0x2d, 0x4b, 0x1f, 0xa3, 0xd6, 0x77, 0x28,