static void alloc_ec_key_ex_index() { if (ec_key_ex_index == 0) { while (ec_key_ex_index == 0) /* Workaround for OpenSSL RT3710 */ ec_key_ex_index = EC_KEY_get_ex_new_index(0, "libp11 ec_key", NULL, NULL, NULL); if (ec_key_ex_index < 0) ec_key_ex_index = 0; /* Fallback to app_data */ } }
/* NOTE: ECDH also uses ECDSA ex_data and *not* ECDH ex_data */ static void alloc_ec_ex_index() { if (ec_ex_index == 0) { while (ec_ex_index == 0) /* Workaround for OpenSSL RT3710 */ #if OPENSSL_VERSION_NUMBER >= 0x10100002L ec_ex_index = EC_KEY_get_ex_new_index(0, "libp11 ec_key", NULL, NULL, NULL); #else ec_ex_index = ECDSA_get_ex_new_index(0, "libp11 ecdsa", NULL, NULL, NULL); #endif if (ec_ex_index < 0) ec_ex_index = 0; /* Fallback to app_data */ } }