return rc;
}
-static int
-tlsm_init_tokens( tlsm_ctx *ctx )
-{
- PK11SlotList *slotList;
- PK11SlotListElement *listEntry;
- int rc = 0;
-
- slotList = PK11_GetAllTokens( CKM_INVALID_MECHANISM, PR_FALSE, PR_TRUE, NULL );
-
- for ( listEntry = PK11_GetFirstSafe( slotList ); !rc && listEntry;
- listEntry = PK11_GetNextSafe( slotList, listEntry, PR_FALSE ) ) {
- PK11SlotInfo *slot = listEntry->slot;
- rc = tlsm_authenticate_to_slot( ctx, slot );
- }
-
- PK11_FreeSlotList( slotList );
-
- return rc;
-}
-
static SECStatus
tlsm_nss_shutdown_cb( void *appData, void *nssData )
{
PK11_SetPasswordFunc( tlsm_pin_prompt );
- if ( tlsm_init_tokens( ctx ) ) {
- return -1;
- }
-
/* register cleanup function */
/* delete the old one, if any */
NSS_UnregisterShutdown( tlsm_nss_shutdown_cb, NULL );