static SECStatus
FreeSessionCacheLocks()
{
    SECStatus rv1, rv2;
    rv1 = ssl_FreeSymWrapKeysLock();
    rv2 = ssl_FreeClientSessionCacheLock();
    if ( (SECSuccess == rv1) && (SECSuccess == rv2) ) {
        return SECSuccess;
    }
    return SECFailure;
}
Exemple #2
0
/* FreeSessionCacheLocks is a callback from NSS_RegisterShutdown which destroys
 * the session cache locks on shutdown and resets them to their initial
 * state. */
static SECStatus
FreeSessionCacheLocks(void* appData, void* nssData)
{
    static const PRCallOnceType pristineCallOnce;
    SECStatus rv;

    if (!cacheLock) {
        PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
        return SECFailure;
    }

    PZ_DestroyLock(cacheLock);
    cacheLock = NULL;

    rv = ssl_FreeSymWrapKeysLock();
    if (rv != SECSuccess) {
        return rv;
    }

    lockOnce = pristineCallOnce;
    return SECSuccess;
}