Bug 1464618 - null salt, r=mt
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Tue, 05 Jun 2018 11:08:43 +0200
changeset 14395 e36e5500f6534ea7e5b48b29215ab4d844ce7e70
parent 14386 20cb9179495d925c8a9c70ae051ac9635b2c89ce
child 14396 798e88281cef81baeb6a445aa8288b2fc752a30e
push id3120
push userfranziskuskiefer@gmail.com
push dateWed, 06 Jun 2018 08:24:53 +0000
reviewersmt
bugs1464618
Bug 1464618 - null salt, r=mt Differential Revision: https://phabricator.services.mozilla.com/D1553
lib/pkcs12/p12e.c
--- a/lib/pkcs12/p12e.c
+++ b/lib/pkcs12/p12e.c
@@ -1584,16 +1584,17 @@ sec_pkcs12_encoder_start_context(SEC_PKC
             /*
              * This code only works with PKCS #12 Mac using PKCS #5 v1
              * PBA keygens. PKCS #5 v2 support will require a change to
              * the PKCS #12 spec.
              */
             params = PK11_CreatePBEParams(salt, &pwd,
                                           NSS_PBE_DEFAULT_ITERATION_COUNT);
             SECITEM_ZfreeItem(salt, PR_TRUE);
+            salt = NULL;
             SECITEM_ZfreeItem(&pwd, PR_FALSE);
 
             /* get the PBA Mechanism to generate the key */
             switch (p12exp->integrityInfo.pwdInfo.algorithm) {
                 case SEC_OID_SHA1:
                     integrityMechType = CKM_PBA_SHA1_WITH_SHA1_HMAC;
                     break;
                 case SEC_OID_MD5: