Bug 703178 - Fixing Wunused-but-set-variable warning in security/manager/ssl/src. r=kaie

--HG--
extra : rebase_source : a2fba6e6728fdc0381b6f5cd4d6d5df247307206
This commit is contained in:
Atul Aggarwal 2012-02-21 23:09:58 +05:30
parent 9239ec9192
commit 95b146cd0c
5 changed files with 13 additions and 26 deletions

View File

@ -173,7 +173,6 @@ SendMessage(const char *msg, const char *base64Cert, char ** _retval)
NSSCMSEnvelopedData *env;
NSSCMSContentInfo *cinfo;
NSSCMSRecipientInfo *rcpt;
SECItem item;
SECItem output;
PLArenaPool *arena = PORT_NewArena(1024);
SECStatus s;
@ -218,8 +217,6 @@ SendMessage(const char *msg, const char *base64Cert, char ** _retval)
}
cinfo = NSS_CMSEnvelopedData_GetContentInfo(env);
item.data = (unsigned char *)msg;
item.len = strlen(msg); /* XPCOM equiv?? */
s = NSS_CMSContentInfo_SetContent_Data(cmsMsg, cinfo, 0, false);
if (s != SECSuccess) {
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSSecureMessage::SendMessage - can't set content data\n"));

View File

@ -509,7 +509,6 @@ nsKeygenFormProcessor::GetPublicKey(nsAString& aValue, nsAString& aChallenge,
nsresult rv = NS_ERROR_FAILURE;
char *keystring = nsnull;
char *keyparamsString = nsnull, *str = nsnull;
KeyType type;
PRUint32 keyGenMechanism;
PRInt32 primeBits;
PK11SlotInfo *slot = nsnull;
@ -549,7 +548,6 @@ nsKeygenFormProcessor::GetPublicKey(nsAString& aValue, nsAString& aChallenge,
// Set the keygen mechanism
if (aKeyType.IsEmpty() || aKeyType.LowerCaseEqualsLiteral("rsa")) {
type = rsaKey;
keyGenMechanism = CKM_RSA_PKCS_KEY_PAIR_GEN;
} else if (aKeyType.LowerCaseEqualsLiteral("dsa")) {
char * end;
@ -559,7 +557,6 @@ nsKeygenFormProcessor::GetPublicKey(nsAString& aValue, nsAString& aChallenge,
goto loser;
}
type = dsaKey;
keyGenMechanism = CKM_DSA_KEY_PAIR_GEN;
if (strcmp(keyparamsString, "null") == 0)
goto loser;
@ -586,7 +583,6 @@ nsKeygenFormProcessor::GetPublicKey(nsAString& aValue, nsAString& aChallenge,
goto loser;
}
type = ecKey;
keyGenMechanism = CKM_EC_KEY_PAIR_GEN;
/* ecParams are initialized later */
} else {

View File

@ -100,7 +100,7 @@ nsNSSCertTrust::SetSSLTrust(bool peer, bool tPeer,
{
mTrust.sslFlags = 0;
if (peer || tPeer)
addTrust(&mTrust.sslFlags, CERTDB_VALID_PEER);
addTrust(&mTrust.sslFlags, CERTDB_TERMINAL_RECORD);
if (tPeer)
addTrust(&mTrust.sslFlags, CERTDB_TRUSTED);
if (ca || tCA)
@ -122,7 +122,7 @@ nsNSSCertTrust::SetEmailTrust(bool peer, bool tPeer,
{
mTrust.emailFlags = 0;
if (peer || tPeer)
addTrust(&mTrust.emailFlags, CERTDB_VALID_PEER);
addTrust(&mTrust.emailFlags, CERTDB_TERMINAL_RECORD);
if (tPeer)
addTrust(&mTrust.emailFlags, CERTDB_TRUSTED);
if (ca || tCA)
@ -144,7 +144,7 @@ nsNSSCertTrust::SetObjSignTrust(bool peer, bool tPeer,
{
mTrust.objectSigningFlags = 0;
if (peer || tPeer)
addTrust(&mTrust.objectSigningFlags, CERTDB_VALID_PEER);
addTrust(&mTrust.objectSigningFlags, CERTDB_TERMINAL_RECORD);
if (tPeer)
addTrust(&mTrust.objectSigningFlags, CERTDB_TRUSTED);
if (ca || tCA)
@ -286,11 +286,11 @@ nsNSSCertTrust::HasPeer(bool checkSSL,
bool checkEmail,
bool checkObjSign)
{
if (checkSSL && !hasTrust(mTrust.sslFlags, CERTDB_VALID_PEER))
if (checkSSL && !hasTrust(mTrust.sslFlags, CERTDB_TERMINAL_RECORD))
return false;
if (checkEmail && !hasTrust(mTrust.emailFlags, CERTDB_VALID_PEER))
if (checkEmail && !hasTrust(mTrust.emailFlags, CERTDB_TERMINAL_RECORD))
return false;
if (checkObjSign && !hasTrust(mTrust.objectSigningFlags, CERTDB_VALID_PEER))
if (checkObjSign && !hasTrust(mTrust.objectSigningFlags, CERTDB_TERMINAL_RECORD))
return false;
return true;
}

View File

@ -142,7 +142,7 @@ nsNSSCertificateDB::FindCertByDBKey(const char *aDBkey, nsISupports *aToken,
SECItem keyItem = {siBuffer, nsnull, 0};
SECItem *dummy;
CERTIssuerAndSN issuerSN;
unsigned long moduleID,slotID;
//unsigned long moduleID,slotID;
*_cert = nsnull;
if (!aDBkey || !*aDBkey)
return NS_ERROR_INVALID_ARG;
@ -156,8 +156,8 @@ nsNSSCertificateDB::FindCertByDBKey(const char *aDBkey, nsISupports *aToken,
CERTCertificate *cert;
// someday maybe we can speed up the search using the moduleID and slotID
moduleID = NS_NSS_GET_LONG(keyItem.data);
slotID = NS_NSS_GET_LONG(&keyItem.data[NS_NSS_LONG]);
// moduleID = NS_NSS_GET_LONG(keyItem.data);
// slotID = NS_NSS_GET_LONG(&keyItem.data[NS_NSS_LONG]);
// build the issuer/SN structure
issuerSN.serialNumber.len = NS_NSS_GET_LONG(&keyItem.data[NS_NSS_LONG*2]);
@ -1254,7 +1254,6 @@ GetOCSPResponders (CERTCertificate *aCert,
char *serviceURL = nsnull;
char *nickname = nsnull;
PRUint32 i, count;
nsresult rv;
// Are we interested in this cert //
if (!nsOCSPResponder::IncludeCert(aCert)) {
@ -1276,7 +1275,7 @@ GetOCSPResponders (CERTCertificate *aCert,
nsMemory::Free(url);
// Sort the items according to nickname //
rv = array->GetLength(&count);
array->GetLength(&count);
for (i=0; i < count; ++i) {
nsCOMPtr<nsIOCSPResponder> entry = do_QueryElementAt(array, i);
if (nsOCSPResponder::CompareEntries(new_entry, entry) < 0) {
@ -1340,7 +1339,6 @@ nsNSSCertificateDB::getCertNames(CERTCertList *certList,
PRUnichar ***_certNames)
{
nsNSSShutDownPreventionLock locker;
nsresult rv;
CERTCertListNode *node;
PRUint32 numcerts = 0, i=0;
PRUnichar **tmpArray = NULL;
@ -1364,7 +1362,7 @@ nsNSSCertificateDB::getCertNames(CERTCertList *certList,
char *dbkey = NULL;
char *namestr = NULL;
nsAutoString certstr;
rv = pipCert.GetDbKey(&dbkey);
pipCert.GetDbKey(&dbkey);
nsAutoString keystr = NS_ConvertASCIItoUTF16(dbkey);
PR_FREEIF(dbkey);
if (type == nsIX509Cert::EMAIL_CERT) {

View File

@ -1365,8 +1365,6 @@ nsresult nsNSSComponent::getParamsForNextCrlToDownload(nsAutoString *url, PRTime
NS_IMETHODIMP
nsNSSComponent::Notify(nsITimer *timer)
{
nsresult rv;
//Timer has fired. So set the flag accordingly
{
MutexAutoLock lock(mCrlTimerLock);
@ -1374,7 +1372,7 @@ nsNSSComponent::Notify(nsITimer *timer)
}
//First, handle this download
rv = DownloadCrlSilently();
DownloadCrlSilently();
//Dont Worry if successful or not
//Set the next timer
@ -2280,11 +2278,9 @@ nsNSSComponent::Observe(nsISupports *aSubject, const char *aTopic,
// Cleanup code that requires services, it's too late in destructor.
if (mPSMContentListener) {
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIURILoader> dispatcher(do_GetService(NS_URI_LOADER_CONTRACTID));
if (dispatcher) {
rv = dispatcher->UnRegisterContentListener(mPSMContentListener);
dispatcher->UnRegisterContentListener(mPSMContentListener);
}
mPSMContentListener = nsnull;
}