summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn M. Schanck <jschanck@mozilla.com>2022-09-08 17:13:44 +0000
committerJohn M. Schanck <jschanck@mozilla.com>2022-09-08 17:13:44 +0000
commitb7ec7e61d748e41dee6e9d9bef3c65b711e208bf (patch)
treeed820558ea6a7735633089843062a3039f1f14ce
parent775b3508090719d554640958ba5bce3baf74c654 (diff)
downloadnss-hg-b7ec7e61d748e41dee6e9d9bef3c65b711e208bf.tar.gz
Bug 1788875 - Remove set-but-unused variables from SEC_PKCS12DecoderValidateBags. r=nss-reviewers,bbeurdouche
Differential Revision: https://phabricator.services.mozilla.com/D156731
-rw-r--r--lib/pkcs12/p12d.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/pkcs12/p12d.c b/lib/pkcs12/p12d.c
index 676f33b31..f2a8fa350 100644
--- a/lib/pkcs12/p12d.c
+++ b/lib/pkcs12/p12d.c
@@ -2770,7 +2770,7 @@ SEC_PKCS12DecoderValidateBags(SEC_PKCS12DecoderContext *p12dcx,
SEC_PKCS12NicknameCollisionCallback nicknameCb)
{
SECStatus rv;
- int i, noInstallCnt, probCnt, bagCnt, errorVal = 0;
+ int i, probCnt, errorVal = 0;
if (!p12dcx || p12dcx->error || !p12dcx->safeBags) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
return SECFailure;
@@ -2781,12 +2781,9 @@ SEC_PKCS12DecoderValidateBags(SEC_PKCS12DecoderContext *p12dcx,
p12dcx->bagsVerified = PR_TRUE;
}
- noInstallCnt = probCnt = bagCnt = 0;
+ probCnt = 0;
i = 0;
while (p12dcx->safeBags[i]) {
- bagCnt++;
- if (p12dcx->safeBags[i]->noInstall)
- noInstallCnt++;
if (p12dcx->safeBags[i]->problem) {
probCnt++;
errorVal = p12dcx->safeBags[i]->error;
@@ -2794,15 +2791,6 @@ SEC_PKCS12DecoderValidateBags(SEC_PKCS12DecoderContext *p12dcx,
i++;
}
- /* formerly was erroneous code here that assumed that if all bags
- * failed to import, then the problem was duplicated data;
- * that is, it assume that the problem must be that the file had
- * previously been successfully imported. But importing a
- * previously imported file causes NO ERRORS at all, and this
- * false assumption caused real errors to be hidden behind false
- * errors about duplicated data.
- */
-
if (probCnt) {
PORT_SetError(errorVal);
return SECFailure;