Example #1
0
static int test_provider(const char *name)
{
    OSSL_PROVIDER *prov = NULL;
    const char *greeting = NULL;
    char expected_greeting[256];

    BIO_snprintf(expected_greeting, sizeof(expected_greeting),
                 "Hello OpenSSL %.20s, greetings from %s!",
                 OPENSSL_VERSION_STR, name);

    return
        TEST_ptr(prov = OSSL_PROVIDER_load(NULL, name))
        && TEST_true(OSSL_PROVIDER_get_params(prov, greeting_request))
        && TEST_ptr(greeting = greeting_request[0].data)
        && TEST_size_t_gt(greeting_request[0].data_size, 0)
        && TEST_str_eq(greeting, expected_greeting)
        && TEST_true(OSSL_PROVIDER_unload(prov));
}
Example #2
0
void cleanup_tests(void)
{
    OSSL_PROVIDER_unload(prov);
}