Exemplo n.º 1
0
static PRStatus
ssl_InitCngFunctions(void)
{
    SECStatus rv;

    ncrypt_library = PR_LoadLibrary("ncrypt.dll");
    if (ncrypt_library == NULL)
        goto loser;

    pNCryptFreeObject = (NCryptFreeObjectFunc)PR_FindFunctionSymbol(
        ncrypt_library, "NCryptFreeObject");
    if (pNCryptFreeObject == NULL)
        goto loser;

    pNCryptSignHash = (NCryptSignHashFunc)PR_FindFunctionSymbol(
        ncrypt_library, "NCryptSignHash");
    if (pNCryptSignHash == NULL)
        goto loser;

    rv = NSS_RegisterShutdown(ssl_ShutdownCngFunctions, NULL);
    if (rv != SECSuccess)
        goto loser;

    return PR_SUCCESS;

loser:
    pNCryptSignHash = NULL;
    pNCryptFreeObject = NULL;
    if (ncrypt_library) {
        PR_UnloadLibrary(ncrypt_library);
        ncrypt_library = NULL;
    }

    return PR_FAILURE;
}
Exemplo n.º 2
0
/* InitSessionCacheLocks is called, protected by lockOnce, to create the
 * session cache locks. */
static PRStatus
InitSessionCacheLocks(void)
{
    SECStatus rv;

    cacheLock = PZ_NewLock(nssILockCache);
    if (cacheLock == NULL) {
        return PR_FAILURE;
    }
    rv = ssl_InitSymWrapKeysLock();
    if (rv != SECSuccess) {
        PRErrorCode error = PORT_GetError();
        PZ_DestroyLock(cacheLock);
        cacheLock = NULL;
        PORT_SetError(error);
        return PR_FAILURE;
    }

    rv = NSS_RegisterShutdown(FreeSessionCacheLocks, NULL);
    PORT_Assert(SECSuccess == rv);
    if (SECSuccess != rv) {
        return PR_FAILURE;
    }
    return PR_SUCCESS;
}
Exemplo n.º 3
0
static PRStatus
tls13_AntiReplayInit(void)
{
    SECStatus rv = NSS_RegisterShutdown(tls13_AntiReplayReset, NULL);
    if (rv != SECSuccess) {
        return PR_FAILURE;
    }
    return PR_SUCCESS;
}
Exemplo n.º 4
0
static PRStatus serverCAListSetup(void *arg)
{
    CERTCertDBHandle *dbHandle = (CERTCertDBHandle *)arg;
    SECStatus rv = NSS_RegisterShutdown(serverCAListShutdown, NULL);
    PORT_Assert(SECSuccess == rv);
    if (SECSuccess == rv) {
	ssl3_server_ca_list = CERT_GetSSLCACerts(dbHandle);
	return PR_SUCCESS;
    }
    return PR_FAILURE;
}
Exemplo n.º 5
0
static PRStatus
ssl_ECRegister(void)
{
    SECStatus rv;
    PORT_Assert(PR_ARRAY_SIZE(gECDHEKeyPairs) == ssl_named_group_count);
    rv = NSS_RegisterShutdown(ssl_ShutdownECDHECurves, gECDHEKeyPairs);
    if (rv != SECSuccess) {
        gECDHEInitError = PORT_GetError();
    }
    return (PRStatus)rv;
}
Exemplo n.º 6
0
static PRStatus initSessionCacheLocksLazily(void)
{
    SECStatus rv = InitSessionCacheLocks();
    if (SECSuccess != rv) {
        return PR_FAILURE;
    }
    rv = NSS_RegisterShutdown(ssl_ShutdownLocks, NULL);
    PORT_Assert(SECSuccess == rv);
    if (SECSuccess != rv) {
        return PR_FAILURE;
    }
    return PR_SUCCESS;
}