зеркало из https://github.com/mozilla/pjs.git
Function to return if any builtins have been loaded yet.
This commit is contained in:
Родитель
f4b110b8ac
Коммит
c8fcdeb68d
|
@ -521,6 +521,8 @@ SECStatus
|
|||
PK11_SaveSMimeProfile(PK11SlotInfo *slot, char *emailAddr, SECItem *derSubj,
|
||||
SECItem *emailProfile, SECItem *profileTime);
|
||||
|
||||
PRBool SECMOD_HasRootCerts(void);
|
||||
|
||||
SEC_END_PROTOS
|
||||
|
||||
#endif
|
||||
|
|
|
@ -519,6 +519,38 @@ PK11_ExitSlotMonitor(PK11SlotInfo *slot) {
|
|||
PZ_Unlock(slot->sessionLock);
|
||||
}
|
||||
|
||||
/***********************************************************
|
||||
* Functions to find specific slots.
|
||||
***********************************************************/
|
||||
PRBool
|
||||
SECMOD_HasRootCerts(void)
|
||||
{
|
||||
SECMODModuleList *mlp;
|
||||
SECMODModuleList *modules = SECMOD_GetDefaultModuleList();
|
||||
SECMODListLock *moduleLock = SECMOD_GetDefaultModuleListLock();
|
||||
int i;
|
||||
PK11SlotInfo *slot = NULL;
|
||||
PRBool found = PR_FALSE;
|
||||
|
||||
/* work through all the slots */
|
||||
SECMOD_GetReadLock(moduleLock);
|
||||
for(mlp = modules; mlp != NULL; mlp = mlp->next) {
|
||||
for (i=0; i < mlp->module->slotCount; i++) {
|
||||
PK11SlotInfo *tmpSlot = mlp->module->slots[i];
|
||||
if (PK11_IsPresent(tmpSlot)) {
|
||||
if (tmpSlot->hasRootCerts) {
|
||||
found = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
SECMOD_ReleaseReadLock(moduleLock);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
/***********************************************************
|
||||
* Functions to find specific slots.
|
||||
***********************************************************/
|
||||
|
|
Загрузка…
Ссылка в новой задаче