mirror of
https://github.com/openssl/openssl.git
synced 2025-03-01 19:28:10 +08:00
Fix external symbols for crypto_*
Partial fix for #12964 This adds ossl_ names for symbols related to crypto_* Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14473)
This commit is contained in:
parent
63b64f19c1
commit
e4bec86910
@ -60,13 +60,13 @@ static int context_init(OSSL_LIB_CTX *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* OSSL_LIB_CTX is built on top of ex_data so we initialise that directly */
|
/* OSSL_LIB_CTX is built on top of ex_data so we initialise that directly */
|
||||||
if (!do_ex_data_init(ctx))
|
if (!ossl_do_ex_data_init(ctx))
|
||||||
goto err;
|
goto err;
|
||||||
exdata_done = 1;
|
exdata_done = 1;
|
||||||
|
|
||||||
if (!crypto_new_ex_data_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL,
|
if (!ossl_crypto_new_ex_data_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL,
|
||||||
&ctx->data)) {
|
&ctx->data)) {
|
||||||
crypto_cleanup_all_ex_data_int(ctx);
|
ossl_crypto_cleanup_all_ex_data_int(ctx);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ static int context_init(OSSL_LIB_CTX *ctx)
|
|||||||
return 1;
|
return 1;
|
||||||
err:
|
err:
|
||||||
if (exdata_done)
|
if (exdata_done)
|
||||||
crypto_cleanup_all_ex_data_int(ctx);
|
ossl_crypto_cleanup_all_ex_data_int(ctx);
|
||||||
CRYPTO_THREAD_lock_free(ctx->oncelock);
|
CRYPTO_THREAD_lock_free(ctx->oncelock);
|
||||||
CRYPTO_THREAD_lock_free(ctx->lock);
|
CRYPTO_THREAD_lock_free(ctx->lock);
|
||||||
ctx->lock = NULL;
|
ctx->lock = NULL;
|
||||||
@ -102,7 +102,7 @@ static int context_deinit(OSSL_LIB_CTX *ctx)
|
|||||||
OPENSSL_free(tmp);
|
OPENSSL_free(tmp);
|
||||||
}
|
}
|
||||||
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL, &ctx->data);
|
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL, &ctx->data);
|
||||||
crypto_cleanup_all_ex_data_int(ctx);
|
ossl_crypto_cleanup_all_ex_data_int(ctx);
|
||||||
for (i = 0; i < OSSL_LIB_CTX_MAX_INDEXES; i++)
|
for (i = 0; i < OSSL_LIB_CTX_MAX_INDEXES; i++)
|
||||||
CRYPTO_THREAD_lock_free(ctx->index_locks[i]);
|
CRYPTO_THREAD_lock_free(ctx->index_locks[i]);
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ static void ossl_lib_ctx_generic_new(void *parent_ign, void *ptr_ign,
|
|||||||
long argl_ign, void *argp)
|
long argl_ign, void *argp)
|
||||||
{
|
{
|
||||||
const OSSL_LIB_CTX_METHOD *meth = argp;
|
const OSSL_LIB_CTX_METHOD *meth = argp;
|
||||||
OSSL_LIB_CTX *ctx = crypto_ex_data_get_ossl_lib_ctx(ad);
|
OSSL_LIB_CTX *ctx = ossl_crypto_ex_data_get_ossl_lib_ctx(ad);
|
||||||
void *ptr = meth->new_func(ctx);
|
void *ptr = meth->new_func(ctx);
|
||||||
|
|
||||||
if (ptr != NULL) {
|
if (ptr != NULL) {
|
||||||
@ -261,10 +261,10 @@ static int ossl_lib_ctx_init_index(OSSL_LIB_CTX *ctx, int static_index,
|
|||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
idx = crypto_get_ex_new_index_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, 0,
|
idx = ossl_crypto_get_ex_new_index_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, 0,
|
||||||
(void *)meth,
|
(void *)meth,
|
||||||
ossl_lib_ctx_generic_new,
|
ossl_lib_ctx_generic_new,
|
||||||
NULL, ossl_lib_ctx_generic_free);
|
NULL, ossl_lib_ctx_generic_free);
|
||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -169,7 +169,8 @@ static DSA *dsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
|
|||||||
ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
|
ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
|
||||||
|
|
||||||
#ifndef FIPS_MODULE
|
#ifndef FIPS_MODULE
|
||||||
if (!crypto_new_ex_data_ex(libctx, CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data))
|
if (!ossl_crypto_new_ex_data_ex(libctx, CRYPTO_EX_INDEX_DSA, ret,
|
||||||
|
&ret->ex_data))
|
||||||
goto err;
|
goto err;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "crypto/cryptlib.h"
|
#include "crypto/cryptlib.h"
|
||||||
#include "internal/thread_once.h"
|
#include "internal/thread_once.h"
|
||||||
|
|
||||||
int do_ex_data_init(OSSL_LIB_CTX *ctx)
|
int ossl_do_ex_data_init(OSSL_LIB_CTX *ctx)
|
||||||
{
|
{
|
||||||
OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
|
OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ static void cleanup_cb(EX_CALLBACK *funcs)
|
|||||||
* called under potential race-conditions anyway (it's for program shutdown
|
* called under potential race-conditions anyway (it's for program shutdown
|
||||||
* after all).
|
* after all).
|
||||||
*/
|
*/
|
||||||
void crypto_cleanup_all_ex_data_int(OSSL_LIB_CTX *ctx)
|
void ossl_crypto_cleanup_all_ex_data_int(OSSL_LIB_CTX *ctx)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
|
OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
|
||||||
@ -101,7 +101,7 @@ static int dummy_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int crypto_free_ex_index_ex(OSSL_LIB_CTX *ctx, int class_index, int idx)
|
int ossl_crypto_free_ex_index_ex(OSSL_LIB_CTX *ctx, int class_index, int idx)
|
||||||
{
|
{
|
||||||
EX_CALLBACKS *ip;
|
EX_CALLBACKS *ip;
|
||||||
EX_CALLBACK *a;
|
EX_CALLBACK *a;
|
||||||
@ -131,16 +131,17 @@ err:
|
|||||||
|
|
||||||
int CRYPTO_free_ex_index(int class_index, int idx)
|
int CRYPTO_free_ex_index(int class_index, int idx)
|
||||||
{
|
{
|
||||||
return crypto_free_ex_index_ex(NULL, class_index, idx);
|
return ossl_crypto_free_ex_index_ex(NULL, class_index, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register a new index.
|
* Register a new index.
|
||||||
*/
|
*/
|
||||||
int crypto_get_ex_new_index_ex(OSSL_LIB_CTX *ctx, int class_index, long argl,
|
int ossl_crypto_get_ex_new_index_ex(OSSL_LIB_CTX *ctx, int class_index,
|
||||||
void *argp, CRYPTO_EX_new *new_func,
|
long argl, void *argp,
|
||||||
CRYPTO_EX_dup *dup_func,
|
CRYPTO_EX_new *new_func,
|
||||||
CRYPTO_EX_free *free_func)
|
CRYPTO_EX_dup *dup_func,
|
||||||
|
CRYPTO_EX_free *free_func)
|
||||||
{
|
{
|
||||||
int toret = -1;
|
int toret = -1;
|
||||||
EX_CALLBACK *a;
|
EX_CALLBACK *a;
|
||||||
@ -193,8 +194,8 @@ int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
|
|||||||
CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
|
CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
|
||||||
CRYPTO_EX_free *free_func)
|
CRYPTO_EX_free *free_func)
|
||||||
{
|
{
|
||||||
return crypto_get_ex_new_index_ex(NULL, class_index, argl, argp, new_func,
|
return ossl_crypto_get_ex_new_index_ex(NULL, class_index, argl, argp,
|
||||||
dup_func, free_func);
|
new_func, dup_func, free_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -204,8 +205,8 @@ int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
|
|||||||
* in the lock, then using them outside the lock. Note this only applies
|
* in the lock, then using them outside the lock. Note this only applies
|
||||||
* to the global "ex_data" state (ie. class definitions), not 'ad' itself.
|
* to the global "ex_data" state (ie. class definitions), not 'ad' itself.
|
||||||
*/
|
*/
|
||||||
int crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
|
int ossl_crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
|
||||||
CRYPTO_EX_DATA *ad)
|
CRYPTO_EX_DATA *ad)
|
||||||
{
|
{
|
||||||
int mx, i;
|
int mx, i;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
@ -253,7 +254,7 @@ int crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
|
|||||||
|
|
||||||
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
|
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
|
||||||
{
|
{
|
||||||
return crypto_new_ex_data_ex(NULL, class_index, obj, ad);
|
return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -473,7 +474,7 @@ void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
|
|||||||
return sk_void_value(ad->sk, idx);
|
return sk_void_value(ad->sk, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
OSSL_LIB_CTX *crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad)
|
OSSL_LIB_CTX *ossl_crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad)
|
||||||
{
|
{
|
||||||
return ad->ctx;
|
return ad->ctx;
|
||||||
}
|
}
|
||||||
|
@ -92,8 +92,8 @@ void OPENSSL_cpuid_setup(void);
|
|||||||
extern unsigned int OPENSSL_ia32cap_P[];
|
extern unsigned int OPENSSL_ia32cap_P[];
|
||||||
#endif
|
#endif
|
||||||
void OPENSSL_showfatal(const char *fmta, ...);
|
void OPENSSL_showfatal(const char *fmta, ...);
|
||||||
int do_ex_data_init(OSSL_LIB_CTX *ctx);
|
int ossl_do_ex_data_init(OSSL_LIB_CTX *ctx);
|
||||||
void crypto_cleanup_all_ex_data_int(OSSL_LIB_CTX *ctx);
|
void ossl_crypto_cleanup_all_ex_data_int(OSSL_LIB_CTX *ctx);
|
||||||
int openssl_init_fork_handlers(void);
|
int openssl_init_fork_handlers(void);
|
||||||
int openssl_get_fork_id(void);
|
int openssl_get_fork_id(void);
|
||||||
|
|
||||||
@ -187,15 +187,15 @@ int ossl_lib_ctx_run_once(OSSL_LIB_CTX *ctx, unsigned int idx,
|
|||||||
int ossl_lib_ctx_onfree(OSSL_LIB_CTX *ctx, ossl_lib_ctx_onfree_fn onfreefn);
|
int ossl_lib_ctx_onfree(OSSL_LIB_CTX *ctx, ossl_lib_ctx_onfree_fn onfreefn);
|
||||||
const char *ossl_lib_ctx_get_descriptor(OSSL_LIB_CTX *libctx);
|
const char *ossl_lib_ctx_get_descriptor(OSSL_LIB_CTX *libctx);
|
||||||
|
|
||||||
OSSL_LIB_CTX *crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad);
|
OSSL_LIB_CTX *ossl_crypto_ex_data_get_ossl_lib_ctx(const CRYPTO_EX_DATA *ad);
|
||||||
int crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
|
int ossl_crypto_new_ex_data_ex(OSSL_LIB_CTX *ctx, int class_index, void *obj,
|
||||||
CRYPTO_EX_DATA *ad);
|
CRYPTO_EX_DATA *ad);
|
||||||
int crypto_get_ex_new_index_ex(OSSL_LIB_CTX *ctx, int class_index,
|
int ossl_crypto_get_ex_new_index_ex(OSSL_LIB_CTX *ctx, int class_index,
|
||||||
long argl, void *argp,
|
long argl, void *argp,
|
||||||
CRYPTO_EX_new *new_func,
|
CRYPTO_EX_new *new_func,
|
||||||
CRYPTO_EX_dup *dup_func,
|
CRYPTO_EX_dup *dup_func,
|
||||||
CRYPTO_EX_free *free_func);
|
CRYPTO_EX_free *free_func);
|
||||||
int crypto_free_ex_index_ex(OSSL_LIB_CTX *ctx, int class_index, int idx);
|
int ossl_crypto_free_ex_index_ex(OSSL_LIB_CTX *ctx, int class_index, int idx);
|
||||||
|
|
||||||
/* Function for simple binary search */
|
/* Function for simple binary search */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user