Esempio n. 1
0
void cleanup (void)
{
#ifndef DISABLE_PTHREADS
    int i;

    /*
     * Tear down the mutexes used by OpenSSL
     */
    CRYPTO_set_locking_callback(NULL);
    for (i = 0; i < CRYPTO_num_locks(); i++) {
        pthread_mutex_destroy(&ssl_mutexes[i]);
    }
    CRYPTO_set_locking_callback(NULL);
    CRYPTO_set_id_callback(NULL);
    free(ssl_mutexes);
#endif

    est_proxy_stop(ectx);
    est_destroy(ectx);
    if (srp_db) {
	SRP_VBASE_free(srp_db);
    }
    if (cacerts_raw)
	free(cacerts_raw);
    if (trustcerts)
	free(trustcerts);
    est_apps_shutdown();
}
Esempio n. 2
0
/*
 * This routine destroys the EST context and frees
 * up other resources to prevent a memory leak.
 */
void cleanup (void)
{
    int i;

    est_server_stop(ectx);
    est_destroy(ectx);

    if (srp_db) {
        SRP_VBASE_free(srp_db);
    }

    /*
     * Tear down the mutexes used by OpenSSL
     */
    if (!mutex_buf)
        return;
    CRYPTO_set_id_callback(NULL);
    CRYPTO_set_locking_callback(NULL);
    for (i = 0; i < CRYPTO_num_locks(); i++)
        MUTEX_CLEANUP(mutex_buf[i]);
    free(mutex_buf);
    mutex_buf = NULL;

    BIO_free(bio_err);
    free(cacerts_raw);
    free(trustcerts);
    est_apps_shutdown();
#ifndef WIN32
    pthread_mutex_destroy(&m);
#else
    DeleteCriticalSection(&enrollment_critical_section);
#endif
}
Esempio n. 3
0
/*
 * This routine is called when CUnit uninitializes this test
 * suite.  This can be used to deallocate data or close any
 * resources that were used for the test cases.
 */
static int us1060c_destroy_suite (void)
{
    if (srpdb) {
	SRP_VBASE_free(srpdb);
    }

    st_stop();
    free(cacerts);
    return 0;
}