Bug 985070: SECKEY_ImportDERPublicKey cleanup: Update the comment
authorWan-Teh Chang <wtc@google.com>
Fri, 21 Mar 2014 14:06:41 -0700
changeset 11093 eb035f52f2ec67617f327e4515a9a6ca8fde33a2
parent 11092 d75c6f53426bc0c6b86341d5816e99fd5f702a7c
child 11094 aeb5967e0221989b2ec31abe506eff106962bc8c
push id342
push userwtc@google.com
push dateFri, 21 Mar 2014 21:07:00 +0000
bugs985070
Bug 985070: SECKEY_ImportDERPublicKey cleanup: Update the comment on key type support. Don't zero memory before it's freed on error. r=dkeeler.
lib/cryptohi/keyhi.h
lib/cryptohi/seckey.c
--- a/lib/cryptohi/keyhi.h
+++ b/lib/cryptohi/keyhi.h
@@ -193,17 +193,17 @@ SECKEY_CopyEncryptedPrivateKeyInfo(PLAre
 /*
  * Accessor functions for key type of public and private keys.
  */
 KeyType SECKEY_GetPrivateKeyType(const SECKEYPrivateKey *privKey);
 KeyType SECKEY_GetPublicKeyType(const SECKEYPublicKey *pubKey);
 
 /*
  * Creates a PublicKey from its DER encoding.
- * Currently only supports RSA and DSA keys.
+ * Currently only supports RSA, DSA, and DH keys.
  */
 SECKEYPublicKey*
 SECKEY_ImportDERPublicKey(const SECItem *derKey, CK_KEY_TYPE type);
 
 SECKEYPrivateKeyList*
 SECKEY_NewPrivateKeyList(void);
 
 void
--- a/lib/cryptohi/seckey.c
+++ b/lib/cryptohi/seckey.c
@@ -1690,17 +1690,17 @@ SECKEY_ImportDERPublicKey(const SECItem 
       default:
         rv = SECFailure;
         break;
     }
 
 finish:
     if (rv != SECSuccess) {
         if (arena != NULL) {
-            PORT_FreeArena(arena, PR_TRUE);
+            PORT_FreeArena(arena, PR_FALSE);
         }
         pubk = NULL;
     }
     return pubk;
 }
 
 SECKEYPrivateKeyList*
 SECKEY_NewPrivateKeyList(void)