summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/pk11wrap/pk11util.c
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-12-23 19:02:52 +0000
committerMoonchild <moonchild@palemoon.org>2020-12-23 19:02:52 +0000
commit029bcfe189eae5eebbaf58ccff4e1200dd78b228 (patch)
tree1c226a334ea1a88e2d1c6f949c9320eb0c3bff59 /security/nss/lib/pk11wrap/pk11util.c
parent149d2ffa779826cb48a381099858e76e4624d471 (diff)
downloadUXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar.gz
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar.lz
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.tar.xz
UXP-029bcfe189eae5eebbaf58ccff4e1200dd78b228.zip
Issue #1693 - Update NSS to 3.59.1.1
This updates to MoonchildProductions/NSS@bd49b2b88 in the repo created for our consumption of the library.
Diffstat (limited to 'security/nss/lib/pk11wrap/pk11util.c')
-rw-r--r--security/nss/lib/pk11wrap/pk11util.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/security/nss/lib/pk11wrap/pk11util.c b/security/nss/lib/pk11wrap/pk11util.c
index 502c4d00c..08c793bf3 100644
--- a/security/nss/lib/pk11wrap/pk11util.c
+++ b/security/nss/lib/pk11wrap/pk11util.c
@@ -95,29 +95,31 @@ SECMOD_Shutdown()
return SECSuccess;
}
-int
-secmod_GetSystemFIPSEnabled(void)
+PRBool
+SECMOD_GetSystemFIPSEnabled(void)
{
#ifdef LINUX
+#ifndef NSS_FIPS_DISABLED
FILE *f;
char d;
size_t size;
f = fopen("/proc/sys/crypto/fips_enabled", "r");
if (!f) {
- return 0;
+ return PR_FALSE;
}
size = fread(&d, 1, sizeof(d), f);
fclose(f);
if (size != sizeof(d)) {
- return 0;
+ return PR_FALSE;
}
if (d == '1') {
- return 1;
+ return PR_TRUE;
}
#endif
- return 0;
+#endif
+ return PR_FALSE;
}
/*
@@ -453,7 +455,7 @@ SECMOD_DeleteInternalModule(const char *name)
SECMODModuleList **mlpp;
SECStatus rv = SECFailure;
- if (secmod_GetSystemFIPSEnabled() || pendingModule) {
+ if (SECMOD_GetSystemFIPSEnabled() || pendingModule) {
PORT_SetError(SEC_ERROR_MODULE_STUCK);
return rv;
}
@@ -988,7 +990,7 @@ SECMOD_CanDeleteInternalModule(void)
#ifdef NSS_FIPS_DISABLED
return PR_FALSE;
#else
- return (PRBool)((pendingModule == NULL) && !secmod_GetSystemFIPSEnabled());
+ return (PRBool)((pendingModule == NULL) && !SECMOD_GetSystemFIPSEnabled());
#endif
}
@@ -1373,7 +1375,7 @@ secmod_UserDBOp(PK11SlotInfo *slot, CK_OBJECT_CLASS objClass,
PK11_SETATTRS(attrs, CKA_CLASS, &objClass, sizeof(objClass));
attrs++;
- PK11_SETATTRS(attrs, CKA_NETSCAPE_MODULE_SPEC, (unsigned char *)sendSpec,
+ PK11_SETATTRS(attrs, CKA_NSS_MODULE_SPEC, (unsigned char *)sendSpec,
strlen(sendSpec) + 1);
attrs++;
@@ -1487,7 +1489,7 @@ SECMOD_OpenNewSlot(SECMODModule *mod, const char *moduleSpec)
PORT_SetError(SEC_ERROR_NO_MEMORY);
return NULL;
}
- rv = secmod_UserDBOp(slot, CKO_NETSCAPE_NEWSLOT, sendSpec);
+ rv = secmod_UserDBOp(slot, CKO_NSS_NEWSLOT, sendSpec);
PR_smprintf_free(sendSpec);
PK11_FreeSlot(slot);
if (rv != SECSuccess) {
@@ -1625,7 +1627,7 @@ SECMOD_CloseUserDB(PK11SlotInfo *slot)
PORT_SetError(SEC_ERROR_NO_MEMORY);
return SECFailure;
}
- rv = secmod_UserDBOp(slot, CKO_NETSCAPE_DELSLOT, sendSpec);
+ rv = secmod_UserDBOp(slot, CKO_NSS_DELSLOT, sendSpec);
PR_smprintf_free(sendSpec);
/* if we are in the delay period for the "isPresent" call, reset
* the delay since we know things have probably changed... */