isaacpittman-hitachi / rpms / openssl

Forked from rpms/openssl 2 years ago
Clone

Blame SOURCES/0035-speed-skip-unavailable-dgst.patch

6f4837
diff -up openssl-3.0.0/apps/speed.c.beldmit openssl-3.0.0/apps/speed.c
6f4837
--- openssl-3.0.0/apps/speed.c.beldmit	2021-12-21 15:14:04.210431584 +0100
6f4837
+++ openssl-3.0.0/apps/speed.c	2021-12-21 15:46:05.554085125 +0100
6f4837
@@ -547,6 +547,9 @@ static int EVP_MAC_loop(int algindex, vo
6f4837
     for (count = 0; COND(c[algindex][testnum]); count++) {
6f4837
         size_t outl;
6f4837
 
6f4837
+        if (mctx == NULL)
6f4837
+            return -1;
6f4837
+
6f4837
         if (!EVP_MAC_init(mctx, NULL, 0, NULL)
6f4837
             || !EVP_MAC_update(mctx, buf, lengths[testnum])
6f4837
             || !EVP_MAC_final(mctx, mac, &outl, sizeof(mac)))
6f4837
@@ -1922,8 +1925,10 @@ int speed_main(int argc, char **argv)
6f4837
             if (loopargs[i].mctx == NULL)
6f4837
                 goto end;
6f4837
 
6f4837
-            if (!EVP_MAC_CTX_set_params(loopargs[i].mctx, params))
6f4837
-                goto end;
6f4837
+            if (!EVP_MAC_CTX_set_params(loopargs[i].mctx, params)) {
6f4837
+                EVP_MAC_CTX_free(loopargs[i].mctx);
6f4837
+                loopargs[i].mctx = NULL;
6f4837
+            }
6f4837
         }
6f4837
         for (testnum = 0; testnum < size_num; testnum++) {
6f4837
             print_message(names[D_HMAC], c[D_HMAC][testnum], lengths[testnum],