зеркало из 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)
|
pk11_DeletePermDB(SECMODModule *module)
|
||||||
{
|
{
|
||||||
SECMODModuleDBFunc func;
|
SECMODModuleDBFunc func;
|
||||||
|
char *moduleSpec;
|
||||||
char **retString;
|
char **retString;
|
||||||
|
|
||||||
if (module->parent == NULL) return SECFailure;
|
if (module->parent == NULL) return SECFailure;
|
||||||
|
|
||||||
func = (SECMODModuleDBFunc) module->parent->moduleDBFunc;
|
func = (SECMODModuleDBFunc) module->parent->moduleDBFunc;
|
||||||
if (func) {
|
if (func) {
|
||||||
|
moduleSpec = pk11_mkModuleSpec(module);
|
||||||
retString = (*func)(SECMOD_MODULE_DB_FUNCTION_DEL,
|
retString = (*func)(SECMOD_MODULE_DB_FUNCTION_DEL,
|
||||||
module->parent->libraryParams,module->commonName);
|
module->parent->libraryParams,moduleSpec);
|
||||||
|
PORT_Free(moduleSpec);
|
||||||
if (retString != NULL) return SECSuccess;
|
if (retString != NULL) return SECSuccess;
|
||||||
}
|
}
|
||||||
return SECFailure;
|
return SECFailure;
|
||||||
|
@ -205,7 +208,7 @@ pk11_freeModuleSpecList(char **moduleSpecList)
|
||||||
}
|
}
|
||||||
|
|
||||||
SECStatus
|
SECStatus
|
||||||
PK11_LoadPKCS11Module(char *modulespec,SECMODModule *parent)
|
PK11_LoadPKCS11Module(char *modulespec,SECMODModule *parent, PRBool recurse)
|
||||||
{
|
{
|
||||||
char *library = NULL, *moduleName = NULL, *parameters = NULL, *nss= NULL;
|
char *library = NULL, *moduleName = NULL, *parameters = NULL, *nss= NULL;
|
||||||
SECStatus status;
|
SECStatus status;
|
||||||
|
@ -233,14 +236,14 @@ PK11_LoadPKCS11Module(char *modulespec,SECMODModule *parent)
|
||||||
goto loser;
|
goto loser;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module->isModuleDB) {
|
if (recurse && module->isModuleDB) {
|
||||||
char ** moduleSpecList;
|
char ** moduleSpecList;
|
||||||
char **index;
|
char **index;
|
||||||
|
|
||||||
moduleSpecList = pk11_getModuleSpecList(module);
|
moduleSpecList = pk11_getModuleSpecList(module);
|
||||||
|
|
||||||
for (index = moduleSpecList; index && *index; index++) {
|
for (index = moduleSpecList; index && *index; index++) {
|
||||||
rv = PK11_LoadPKCS11Module(*index,module);
|
rv = PK11_LoadPKCS11Module(*index,module,PR_TRUE);
|
||||||
if (rv != SECSuccess) break;
|
if (rv != SECSuccess) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,12 @@ SECMOD_AddModuleToDBOnlyList(SECMODModule *newModule) {
|
||||||
return secmod_AddModuleToList(&modulesDB,newModule);
|
return secmod_AddModuleToList(&modulesDB,newModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECMODModule *
|
||||||
|
SECMOD_GetDefaultDBModule(void)
|
||||||
|
{
|
||||||
|
return SECMOD_ReferenceModule(defaultDBModule);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get the list of PKCS11 modules that are available.
|
* get the list of PKCS11 modules that are available.
|
||||||
*/
|
*/
|
||||||
|
@ -416,7 +422,7 @@ SECMOD_DeleteInternalModule(char *name) {
|
||||||
internalModule = SECMOD_ReferenceModule(newModule);
|
internalModule = SECMOD_ReferenceModule(newModule);
|
||||||
SECMOD_AddModule(internalModule);
|
SECMOD_AddModule(internalModule);
|
||||||
SECMOD_DestroyModule(oldModule);
|
SECMOD_DestroyModule(oldModule);
|
||||||
SECMOD_DeletePermDB(mlp->module);
|
pk11_DeletePermDB(mlp->module);
|
||||||
SECMOD_DestroyModuleListElement(mlp);
|
SECMOD_DestroyModuleListElement(mlp);
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче