[openssl] master update

Dr. Paul Dale pauli at openssl.org
Wed Jan 12 01:17:51 UTC 2022


The branch master has been updated
       via  b82fd89d8bae1445c89ec90d1a6145fe3216d2d7 (commit)
      from  f5e97b3702916e69873746108ac7c100a31d2241 (commit)


- Log -----------------------------------------------------------------
commit b82fd89d8bae1445c89ec90d1a6145fe3216d2d7
Author: Tomas Mraz <tomas at openssl.org>
Date:   Mon Jan 10 17:26:33 2022 +0100

    pkeyutl: Fix regression with -kdflen option
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17461)

-----------------------------------------------------------------------

Summary of changes:
 apps/pkeyutl.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index 9e18dfc0e9..01c4f064d2 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -463,23 +463,23 @@ int pkeyutl_main(int argc, char **argv)
         }
         goto end;
     }
-    if (kdflen != 0) {
-        buf_outlen = kdflen;
-        rv = 1;
+    if (rawin) {
+        /* rawin allocates the buffer in do_raw_keyop() */
+        rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, NULL, 0,
+                          &buf_out, (size_t *)&buf_outlen);
     } else {
-        if (rawin) {
-            /* rawin allocates the buffer in do_raw_keyop() */
-            rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, NULL, 0,
-                              &buf_out, (size_t *)&buf_outlen);
+        if (kdflen != 0) {
+            buf_outlen = kdflen;
+            rv = 1;
         } else {
             rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen,
                           buf_in, (size_t)buf_inlen);
-            if (rv > 0 && buf_outlen != 0) {
-                buf_out = app_malloc(buf_outlen, "buffer output");
-                rv = do_keyop(ctx, pkey_op,
-                              buf_out, (size_t *)&buf_outlen,
-                              buf_in, (size_t)buf_inlen);
-            }
+        }
+        if (rv > 0 && buf_outlen != 0) {
+            buf_out = app_malloc(buf_outlen, "buffer output");
+            rv = do_keyop(ctx, pkey_op,
+                          buf_out, (size_t *)&buf_outlen,
+                          buf_in, (size_t)buf_inlen);
         }
     }
     if (rv <= 0) {


More information about the openssl-commits mailing list