]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix acvp_test sig_gen
authorMatt Caswell <matt@openssl.org>
Mon, 11 Oct 2021 12:43:19 +0000 (13:43 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 22 Oct 2021 07:43:27 +0000 (08:43 +0100)
Ensure we set the size of the signature buffer before we call
EVP_DigestSign()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16789)

test/acvp_test.c

index 0e2d54dab6b1172f94a6e901d8f22ebde023507d..10621c3e48c862615f0d816b57f5dc83f568c9a0 100644 (file)
@@ -94,6 +94,7 @@ static int sig_gen(EVP_PKEY *pkey, OSSL_PARAM *params, const char *digest_name,
     size_t sig_len;
     size_t sz = EVP_PKEY_get_size(pkey);
 
+    sig_len = sz;
     if (!TEST_ptr(sig = OPENSSL_malloc(sz))
         || !TEST_ptr(md_ctx = EVP_MD_CTX_new())
         || !TEST_int_eq(EVP_DigestSignInit_ex(md_ctx, NULL, digest_name, libctx,