From fcdd8f6f67f6e8456b3e24e7b32e66dd1d3766fa Mon Sep 17 00:00:00 2001 From: Dennis Jackson Date: Fri, 3 Mar 2023 21:43:37 +0000 Subject: Bug 1820175 - Fix various compiler warnings in NSS. r=jschanck. Differential Revision: https://phabricator.services.mozilla.com/D171581 --- cmd/addbuiltin/addbuiltin.c | 1 - cmd/bltest/blapitest.c | 2 +- cmd/signtool/util.c | 42 ------------------------------------------ 3 files changed, 1 insertion(+), 44 deletions(-) (limited to 'cmd') diff --git a/cmd/addbuiltin/addbuiltin.c b/cmd/addbuiltin/addbuiltin.c index 23fd1fec8..da2533144 100644 --- a/cmd/addbuiltin/addbuiltin.c +++ b/cmd/addbuiltin/addbuiltin.c @@ -74,7 +74,6 @@ getTrustString(unsigned int trust) return "CKT_NSS_MUST_VERIFY_TRUST"; } } - return "CKT_NSS_TRUST_UNKNOWN"; /* not reached */ } static const SEC_ASN1Template serialTemplate[] = { diff --git a/cmd/bltest/blapitest.c b/cmd/bltest/blapitest.c index de7f0d9c7..f9a2f0221 100644 --- a/cmd/bltest/blapitest.c +++ b/cmd/bltest/blapitest.c @@ -2319,9 +2319,9 @@ cipherInit(bltestCipherInfo *cipherInfo, PRBool encrypt) case bltestRC5_CBC: SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf, cipherInfo->input.pBuf.len); -#endif return bltest_rc5_init(cipherInfo, encrypt); break; +#endif case bltestAES_ECB: case bltestAES_CBC: case bltestAES_CTS: diff --git a/cmd/signtool/util.c b/cmd/signtool/util.c index ecd22e39c..a2637a74e 100644 --- a/cmd/signtool/util.c +++ b/cmd/signtool/util.c @@ -430,51 +430,9 @@ out_of_memory(void) void VerifyCertDir(char *dir, char *keyName) { - char fn[FNSIZE]; - - /* don't try verifying if we don't have a local directory */ - if (strncmp(dir, "multiaccess:", sizeof("multiaccess:") - 1) == 0) { - return; - } /* this function is truly evil. Tools and applications should not have * any knowledge of actual cert databases! */ return; - - /* This code is really broken because it makes underlying assumptions about - * how the NSS profile directory is laid out, but these names can change - * from release to release. */ - sprintf(fn, "%s/cert8.db", dir); - - if (PR_Access(fn, PR_ACCESS_EXISTS)) { - PR_fprintf(errorFD, "%s: No certificate database in \"%s\"\n", - PROGRAM_NAME, dir); - PR_fprintf(errorFD, "%s: Check the -d arguments that you gave\n", - PROGRAM_NAME); - errorCount++; - exit(ERRX); - } - - if (verbosity >= 0) { - PR_fprintf(outputFD, "using certificate directory: %s\n", dir); - } - - if (keyName == NULL) - return; - - /* if the user gave the -k key argument, verify that - a key database already exists */ - - sprintf(fn, "%s/key3.db", dir); - - if (PR_Access(fn, PR_ACCESS_EXISTS)) { - PR_fprintf(errorFD, "%s: No private key database in \"%s\"\n", - PROGRAM_NAME, - dir); - PR_fprintf(errorFD, "%s: Check the -d arguments that you gave\n", - PROGRAM_NAME); - errorCount++; - exit(ERRX); - } } /* -- cgit v1.2.1