[openssl] openssl-3.0 update

Dr. Paul Dale pauli at openssl.org
Wed Jan 12 01:18:14 UTC 2022


The branch openssl-3.0 has been updated
       via  3755dc294d2e24b741e235550d063850464467cb (commit)
      from  b64b8e39cfb5e89c0af8b9127a414cf529192846 (commit)


- Log -----------------------------------------------------------------
commit 3755dc294d2e24b741e235550d063850464467cb
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)
    
    (cherry picked from commit b82fd89d8bae1445c89ec90d1a6145fe3216d2d7)

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

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 73012e3069..891f2280e3 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -464,23 +464,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