]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
remove needless and misleading malloc failure error messages of PKCS12_SAFEBAG_create...
authorDavid von Oheimb <David.von.Oheimb@siemens.com>
Thu, 10 May 2018 19:10:03 +0000 (21:10 +0200)
committerMatt Caswell <matt@openssl.org>
Mon, 18 Jun 2018 09:44:32 +0000 (10:44 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6217)

crypto/pkcs12/p12_sbag.c

index 4a3d25993073060c1eb50cc2f0988173828b0768..2f1ce58739ec1a14009f2e93c9ca453ceb5c74fd 100644 (file)
@@ -146,25 +146,17 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
     X509_SIG *p8;
 
     pbe_ciph = EVP_get_cipherbynid(pbe_nid);
-
     if (pbe_ciph)
         pbe_nid = -1;
 
     p8 = PKCS8_encrypt(pbe_nid, pbe_ciph, pass, passlen, salt, saltlen, iter,
                        p8inf);
-
-    if (p8 == NULL) {
-        PKCS12err(PKCS12_F_PKCS12_SAFEBAG_CREATE_PKCS8_ENCRYPT, ERR_R_MALLOC_FAILURE);
+    if (p8 == NULL)
         return NULL;
-    }
 
     bag = PKCS12_SAFEBAG_create0_pkcs8(p8);
-
-    if (bag == NULL) {
-        PKCS12err(PKCS12_F_PKCS12_SAFEBAG_CREATE_PKCS8_ENCRYPT, ERR_R_MALLOC_FAILURE);
+    if (bag == NULL)
         X509_SIG_free(p8);
-        return NULL;
-    }
 
     return bag;
 }