2017-01-06 13:35:27 +00:00
|
|
|
diff -up nss/lib/pk11wrap/pk11pars.c.check_policy_file nss/lib/pk11wrap/pk11pars.c
|
|
|
|
--- nss/lib/pk11wrap/pk11pars.c.check_policy_file 2017-01-06 13:21:47.002952050 +0100
|
|
|
|
+++ nss/lib/pk11wrap/pk11pars.c 2017-01-06 13:28:18.972536334 +0100
|
|
|
|
@@ -109,6 +109,7 @@ secmod_NewModule(void)
|
|
|
|
*other flags are set */
|
|
|
|
#define SECMOD_FLAG_MODULE_DB_SKIP_FIRST 0x02
|
2016-03-24 22:18:49 +00:00
|
|
|
#define SECMOD_FLAG_MODULE_DB_DEFAULT_MODDB 0x04
|
2017-01-06 13:35:27 +00:00
|
|
|
+#define SECMOD_FLAG_MODULE_DB_POLICY_ONLY 0x08
|
2016-03-24 22:18:49 +00:00
|
|
|
|
|
|
|
/* private flags for internal (field in SECMODModule). */
|
2016-04-20 15:49:00 +00:00
|
|
|
/* The meaing of these flags is as follows:
|
2017-01-06 13:35:27 +00:00
|
|
|
@@ -704,6 +705,9 @@ SECMOD_CreateModuleEx(const char *librar
|
|
|
|
if (NSSUTIL_ArgHasFlag("flags", "defaultModDB", nssc)) {
|
|
|
|
flags |= SECMOD_FLAG_MODULE_DB_DEFAULT_MODDB;
|
|
|
|
}
|
2016-04-20 15:49:00 +00:00
|
|
|
+ if (NSSUTIL_ArgHasFlag("flags", "policyOnly", nssc)) {
|
2016-03-24 22:18:49 +00:00
|
|
|
+ flags |= SECMOD_FLAG_MODULE_DB_POLICY_ONLY;
|
|
|
|
+ }
|
2017-01-06 13:35:27 +00:00
|
|
|
/* additional moduleDB flags could be added here in the future */
|
|
|
|
mod->isModuleDB = (PRBool)flags;
|
2016-03-24 22:18:49 +00:00
|
|
|
}
|
2017-01-06 13:35:27 +00:00
|
|
|
@@ -744,6 +748,14 @@ SECMOD_GetDefaultModDBFlag(SECMODModule
|
2016-03-24 22:18:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
+secmod_PolicyOnly(SECMODModule *mod)
|
|
|
|
+{
|
|
|
|
+ char flags = (char) mod->isModuleDB;
|
|
|
|
+
|
|
|
|
+ return (flags & SECMOD_FLAG_MODULE_DB_POLICY_ONLY) ? PR_TRUE : PR_FALSE;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+PRBool
|
|
|
|
secmod_IsInternalKeySlot(SECMODModule *mod)
|
|
|
|
{
|
2017-01-06 13:35:27 +00:00
|
|
|
char flags = (char)mod->internal;
|
|
|
|
@@ -1661,6 +1673,12 @@ SECMOD_LoadModule(char *modulespec, SECM
|
2016-03-24 22:18:49 +00:00
|
|
|
if (!module) {
|
2017-01-06 13:35:27 +00:00
|
|
|
goto loser;
|
2016-03-24 22:18:49 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ /* a policy only stanza doesn't actually get 'loaded'. policy has already
|
|
|
|
+ * been parsed as a side effect of the CreateModuleEx call */
|
|
|
|
+ if (secmod_PolicyOnly(module)) {
|
|
|
|
+ return module;
|
|
|
|
+ }
|
|
|
|
if (parent) {
|
2017-01-06 13:35:27 +00:00
|
|
|
module->parent = SECMOD_ReferenceModule(parent);
|
|
|
|
if (module->internal && secmod_IsInternalKeySlot(parent)) {
|