Blame SOURCES/nss-softokn-3.79-fix-freebl-crash.patch

5d145d
diff --git a/lib/freebl/shvfy.c b/lib/freebl/shvfy.c
5d145d
--- a/lib/freebl/shvfy.c
5d145d
+++ b/lib/freebl/shvfy.c
5d145d
@@ -508,29 +508,44 @@ loser:
5d145d
         PR_Close(shFD);
5d145d
     }
5d145d
     if (hashcx != NULL) {
5d145d
         if (hashObj) {
5d145d
             hashObj->destroy(hashcx, PR_TRUE);
5d145d
         }
5d145d
     }
5d145d
     if (signature.data != NULL) {
5d145d
-        SECITEM_ZfreeItem(&signature, PR_FALSE);
5d145d
+        /* can't use SECITEM_ZfreeItem on rhel7 because rhel7
5d145d
+         * supports util-free softoken for hash operations */
5d145d
+        PORT_Memset(signature.data, 0, signature.len);
5d145d
+        PORT_Free(signature.data);
5d145d
     }
5d145d
     if (key.params.prime.data != NULL) {
5d145d
-        SECITEM_ZfreeItem(&key.params.prime, PR_FALSE);
5d145d
+        /* can't use SECITEM_ZfreeItem on rhel7 because rhel7
5d145d
+         * supports util-free softoken for hash operations */
5d145d
+        PORT_Memset(key.params.prime.data, 0, key.params.prime.len);
5d145d
+        PORT_Free(key.params.prime.data);
5d145d
     }
5d145d
     if (key.params.subPrime.data != NULL) {
5d145d
-        SECITEM_ZfreeItem(&key.params.subPrime, PR_FALSE);
5d145d
+        /* can't use SECITEM_ZfreeItem on rhel7 because rhel7
5d145d
+         * supports util-free softoken for hash operations */
5d145d
+        PORT_Memset(key.params.subPrime.data, 0, key.params.subPrime.len);
5d145d
+        PORT_Free(key.params.subPrime.data);
5d145d
     }
5d145d
     if (key.params.base.data != NULL) {
5d145d
-        SECITEM_ZfreeItem(&key.params.base, PR_FALSE);
5d145d
+        /* can't use SECITEM_ZfreeItem on rhel7 because rhel7
5d145d
+         * supports util-free softoken for hash operations */
5d145d
+        PORT_Memset(key.params.base.data, 0, key.params.base.len);
5d145d
+        PORT_Free(key.params.base.data);
5d145d
     }
5d145d
     if (key.publicValue.data != NULL) {
5d145d
-        SECITEM_ZfreeItem(&key.publicValue, PR_FALSE);
5d145d
+        /* can't use SECITEM_ZfreeItem on rhel7 because rhel7
5d145d
+         * supports util-free softoken for hash operations */
5d145d
+        PORT_Memset(key.publicValue.data, 0, key.publicValue.len);
5d145d
+        PORT_Free(key.publicValue.data);
5d145d
     }
5d145d
 
5d145d
     return result;
5d145d
 }
5d145d
 
5d145d
 PRBool
5d145d
 BLAPI_VerifySelf(const char *name)
5d145d
 {