]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - test/evp_test.c
evp_test: use correct size in memory clear
[thirdparty/openssl.git] / test / evp_test.c
index 16b1a50c2d9e035c3ee63d865f2f9a23c2f886da..0009cae4425772251e81b428bceff4de60210280 100644 (file)
@@ -486,7 +486,7 @@ static int digest_test_run(EVP_TEST *t)
             /* This should never fail but we need the returned pointer now */
             && !TEST_ptr(inbuf = sk_EVP_TEST_BUFFER_value(expected->input, 0))
             && !inbuf->count_set) {
-        OPENSSL_cleanse(got, sizeof(got));
+        OPENSSL_cleanse(got, got_len);
         if (!TEST_true(EVP_Q_digest(libctx,
                                     EVP_MD_get0_name(expected->fetched_digest),
                                     NULL, inbuf->buf, inbuf->buflen,
@@ -1543,7 +1543,7 @@ static int mac_test_run_mac(EVP_TEST *t)
 
     /* Test the EVP_Q_mac interface as well */
     if (!xof) {
-        OPENSSL_cleanse(got, sizeof(got));
+        OPENSSL_cleanse(got, got_len);
         if (!TEST_true(EVP_Q_mac(libctx, expected->mac_name, NULL,
                                  expected->alg, params,
                                  expected->key, expected->key_len,