Bugzilla Bug 53427: passed the correct 'zero' argument to PORT_FreeArena.

Removed dead code. r=nelsonb,relyea.
Modified Files:
	softoken/keydb.c softoken/lowpbe.c softoken/pkcs11c.c
	util/secdig.c
This commit is contained in:
wtchang%redhat.com 2006-08-15 01:34:38 +00:00
Родитель d9ed34634c
Коммит 97b9b2993d
4 изменённых файлов: 6 добавлений и 50 удалений

Просмотреть файл

@ -34,7 +34,7 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* $Id: keydb.c,v 1.46 2006-07-31 18:10:17 wtchang%redhat.com Exp $ */
/* $Id: keydb.c,v 1.47 2006-08-15 01:34:38 wtchang%redhat.com Exp $ */
#include "lowkeyi.h"
#include "seccomon.h"
@ -1425,50 +1425,6 @@ nsslowkey_DeriveKeyDBPassword(NSSLOWKEYDBHandle *keydb, char *pw)
return nsslowkey_HashPassword(pw, keydb->global_salt);
}
#if 0
/* Appears obsolete - TNH */
/* get the algorithm with which a private key
* is encrypted.
*/
SECOidTag
seckey_get_private_key_algorithm(NSSLOWKEYDBHandle *keydb, DBT *index)
{
NSSLOWKEYDBKey *dbkey = NULL;
SECOidTag algorithm = SEC_OID_UNKNOWN;
NSSLOWKEYEncryptedPrivateKeyInfo *epki = NULL;
PLArenaPool *poolp = NULL;
SECStatus rv;
poolp = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
if(poolp == NULL)
return (SECOidTag)SECFailure; /* TNH - this is bad */
dbkey = get_dbkey(keydb, index);
if(dbkey == NULL)
return (SECOidTag)SECFailure;
epki = (NSSLOWKEYEncryptedPrivateKeyInfo *)PORT_ArenaZAlloc(poolp,
sizeof(NSSLOWKEYEncryptedPrivateKeyInfo));
if(epki == NULL)
goto loser;
rv = SEC_ASN1DecodeItem(poolp, epki,
nsslowkey_EncryptedPrivateKeyInfoTemplate, &dbkey->derPK);
if(rv == SECFailure)
goto loser;
algorithm = SECOID_GetAlgorithmTag(&epki->algorithm);
/* let success fall through */
loser:
if(poolp != NULL)
PORT_FreeArena(poolp, PR_TRUE);\
if(dbkey != NULL)
sec_destroy_dbkey(dbkey);
return algorithm;
}
#endif
/*
* Derive an RC4 key from a password key and a salt. This
* was the method to used to encrypt keys in the version 2?

Просмотреть файл

@ -824,7 +824,7 @@ void
nsspkcs5_DestroyPBEParameter(NSSPKCS5PBEParameter *pbe_param)
{
if (pbe_param != NULL) {
PORT_FreeArena(pbe_param->poolp, PR_TRUE);
PORT_FreeArena(pbe_param->poolp, PR_FALSE);
}
}

Просмотреть файл

@ -4132,13 +4132,13 @@ sftk_unwrapPrivateKey(SFTKObject *key, SECItem *bpki)
pki = (NSSLOWKEYPrivateKeyInfo*)PORT_ArenaZAlloc(arena,
sizeof(NSSLOWKEYPrivateKeyInfo));
if(!pki) {
PORT_FreeArena(arena, PR_TRUE);
PORT_FreeArena(arena, PR_FALSE);
return SECFailure;
}
if(SEC_ASN1DecodeItem(arena, pki, nsslowkey_PrivateKeyInfoTemplate, bpki)
!= SECSuccess) {
PORT_FreeArena(arena, PR_FALSE);
PORT_FreeArena(arena, PR_TRUE);
return SECFailure;
}

Просмотреть файл

@ -33,7 +33,7 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* $Id: secdig.c,v 1.5 2004-04-27 23:04:40 gerv%gerv.net Exp $ */
/* $Id: secdig.c,v 1.6 2006-08-15 01:34:38 wtchang%redhat.com Exp $ */
#include "secdig.h"
#include "secoid.h"
@ -180,7 +180,7 @@ SGN_DecodeDigestInfo(SECItem *didata)
if((di == NULL) || (rv != SECSuccess))
{
PORT_FreeArena(arena, PR_TRUE);
PORT_FreeArena(arena, PR_FALSE);
di = NULL;
}