зеркало из https://github.com/mozilla/pjs.git
1) fix bug in module deletion.
2) Add new function in modutil to desplay the raw PKCS #11 module strings
This commit is contained in:
Родитель
a4eccb3cef
Коммит
b7c21d553d
|
@ -181,14 +181,17 @@ SECStatus
|
|||
pk11_DeletePermDB(SECMODModule *module)
|
||||
{
|
||||
SECMODModuleDBFunc func;
|
||||
char *moduleSpec;
|
||||
char **retString;
|
||||
|
||||
if (module->parent == NULL) return SECFailure;
|
||||
|
||||
func = (SECMODModuleDBFunc) module->parent->moduleDBFunc;
|
||||
if (func) {
|
||||
moduleSpec = pk11_mkModuleSpec(module);
|
||||
retString = (*func)(SECMOD_MODULE_DB_FUNCTION_DEL,
|
||||
module->parent->libraryParams,module->commonName);
|
||||
module->parent->libraryParams,moduleSpec);
|
||||
PORT_Free(moduleSpec);
|
||||
if (retString != NULL) return SECSuccess;
|
||||
}
|
||||
return SECFailure;
|
||||
|
@ -205,7 +208,7 @@ pk11_freeModuleSpecList(char **moduleSpecList)
|
|||
}
|
||||
|
||||
SECStatus
|
||||
PK11_LoadPKCS11Module(char *modulespec,SECMODModule *parent)
|
||||
PK11_LoadPKCS11Module(char *modulespec,SECMODModule *parent, PRBool recurse)
|
||||
{
|
||||
char *library = NULL, *moduleName = NULL, *parameters = NULL, *nss= NULL;
|
||||
SECStatus status;
|
||||
|
@ -233,14 +236,14 @@ PK11_LoadPKCS11Module(char *modulespec,SECMODModule *parent)
|
|||
goto loser;
|
||||
}
|
||||
|
||||
if (module->isModuleDB) {
|
||||
if (recurse && module->isModuleDB) {
|
||||
char ** moduleSpecList;
|
||||
char **index;
|
||||
|
||||
moduleSpecList = pk11_getModuleSpecList(module);
|
||||
|
||||
for (index = moduleSpecList; index && *index; index++) {
|
||||
rv = PK11_LoadPKCS11Module(*index,module);
|
||||
rv = PK11_LoadPKCS11Module(*index,module,PR_TRUE);
|
||||
if (rv != SECSuccess) break;
|
||||
}
|
||||
|
||||
|
|
|
@ -249,6 +249,12 @@ SECMOD_AddModuleToDBOnlyList(SECMODModule *newModule) {
|
|||
return secmod_AddModuleToList(&modulesDB,newModule);
|
||||
}
|
||||
|
||||
SECMODModule *
|
||||
SECMOD_GetDefaultDBModule(void)
|
||||
{
|
||||
return SECMOD_ReferenceModule(defaultDBModule);
|
||||
}
|
||||
|
||||
/*
|
||||
* get the list of PKCS11 modules that are available.
|
||||
*/
|
||||
|
@ -416,7 +422,7 @@ SECMOD_DeleteInternalModule(char *name) {
|
|||
internalModule = SECMOD_ReferenceModule(newModule);
|
||||
SECMOD_AddModule(internalModule);
|
||||
SECMOD_DestroyModule(oldModule);
|
||||
SECMOD_DeletePermDB(mlp->module);
|
||||
pk11_DeletePermDB(mlp->module);
|
||||
SECMOD_DestroyModuleListElement(mlp);
|
||||
}
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче