[openssl] master update

dev at ddvo.net dev at ddvo.net
Thu Aug 20 12:30:09 UTC 2020


The branch master has been updated
       via  ed4faae00cdab23244704660c099e41ec64f5dc0 (commit)
      from  5f2b7db09b6f9650ecf2b465ee9f737385623bd5 (commit)


- Log -----------------------------------------------------------------
commit ed4faae00cdab23244704660c099e41ec64f5dc0
Author: Dr. David von Oheimb <David.von.Oheimb at siemens.com>
Date:   Wed Aug 12 17:37:50 2020 +0200

    Fix mem leaks on PKCS#12 read error in PKCS12_key_gen_{asc,utf8}
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/12639)

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

Summary of changes:
 crypto/pkcs12/p12_key.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c
index a40ae4cbe8..bbe212d125 100644
--- a/crypto/pkcs12/p12_key.c
+++ b/crypto/pkcs12/p12_key.c
@@ -33,10 +33,8 @@ int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
     }
     ret = PKCS12_key_gen_uni(unipass, uniplen, salt, saltlen,
                              id, iter, n, out, md_type);
-    if (ret <= 0)
-        return 0;
     OPENSSL_clear_free(unipass, uniplen);
-    return ret;
+    return ret > 0;
 }
 
 int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt,
@@ -56,10 +54,8 @@ int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt,
     }
     ret = PKCS12_key_gen_uni(unipass, uniplen, salt, saltlen,
                              id, iter, n, out, md_type);
-    if (ret <= 0)
-        return 0;
     OPENSSL_clear_free(unipass, uniplen);
-    return ret;
+    return ret > 0;
 }
 
 int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,


More information about the openssl-commits mailing list