Merge pull request 'vxtss library update and vxtss_symlist implementation' (#26) from vxtss_symlist into master

Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/26
Reviewed-by: Siddhant Singh <siddhant.singh@neominds.in>
This commit is contained in:
2026-07-30 19:35:30 +05:30
committed by neelimap
parent 87219deb19
commit d79b382c72
13 changed files with 556 additions and 80 deletions
@@ -21,6 +21,7 @@
#include <openssl/err.h>
#include "crypto/cryptlib.h"
#include <string.h>
#include <vxtss_symlist.h>
#define ASYNC_JOB_RUNNING 0
#define ASYNC_JOB_PAUSING 1
@@ -330,11 +331,17 @@ int async_init(void)
if (!CRYPTO_THREAD_init_local(&ctxkey, NULL))
return 0;
tss_symlist_add_new(taskIdSelf(), "ossl_init_async", "ctxkey",
&ctxkey, TSS_SYMLIST_STATE_ADDED);
if (!CRYPTO_THREAD_init_local(&poolkey, NULL)) {
CRYPTO_THREAD_cleanup_local(&ctxkey);
return 0;
}
tss_symlist_add_new(taskIdSelf(), "ossl_init_async", "poolkey",
&poolkey, TSS_SYMLIST_STATE_ADDED);
return async_local_init();
}
@@ -18,6 +18,8 @@
#include "internal/provider.h"
#include "crypto/decoder.h"
#include "crypto/context.h"
#include <openssl/crypto.h>
#include <vxtss_symlist.h>
struct ossl_lib_ctx_st {
CRYPTO_RWLOCK *lock;
@@ -95,6 +97,9 @@ static int context_init(OSSL_LIB_CTX *ctx)
if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
return 0;
tss_symlist_add_new(taskIdSelf(), "default_context_do_init", "ctx->rcu_local_key",
&ctx->rcu_local_key, TSS_SYMLIST_STATE_ADDED);
ctx->lock = CRYPTO_THREAD_lock_new();
if (ctx->lock == NULL)
goto err;
@@ -396,6 +401,8 @@ DEFINE_RUN_ONCE_STATIC(default_context_do_init)
if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
goto err;
tss_symlist_add_new(taskIdSelf(), "default_context_do_init", "default_context_thread_local",
&default_context_thread_local, TSS_SYMLIST_STATE_ADDED);
if (!context_init(&default_context_int))
goto deinit_thread;
@@ -25,6 +25,7 @@
#include "internal/constant_time.h"
#include "internal/e_os.h"
#include "err_local.h"
#include <vxtss_symlist.h>
/* Forward declaration in case it's not published because of configuration */
ERR_STATE *ERR_get_state(void);
@@ -666,7 +667,10 @@ void ERR_remove_state(unsigned long pid)
DEFINE_RUN_ONCE_STATIC(err_do_init)
{
set_err_thread_local = 1;
return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
int rc = CRYPTO_THREAD_init_local(&err_thread_local, NULL);
tss_symlist_add_new(taskIdSelf(), "err_do_init", "err_thread_local",
&err_thread_local, TSS_SYMLIST_STATE_ADDED);
return rc;
}
ERR_STATE *ossl_err_get_state_int(void)
@@ -40,6 +40,8 @@
#include <semLib.h>
#include <openssl/provider.h>
#include "ipcrypto_config.h"
#include <openssl/crypto.h>
#include <vxtss_symlist.h>
#endif
static int stopped = 0;
@@ -81,6 +83,9 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_base)
if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
goto err;
tss_symlist_add_new(taskIdSelf(), "ossl_init_base", "in_init_config_local",
&in_init_config_local, TSS_SYMLIST_STATE_ADDED);
base_inited = 1;
return 1;
@@ -13,6 +13,7 @@
#include "prov/providercommon.h"
#include "internal/thread_once.h"
#include "crypto/context.h"
#include <vxtss_symlist.h>
#ifdef FIPS_MODULE
#include "prov/provider_ctx.h"
@@ -207,6 +208,9 @@ int ossl_init_thread(void)
init_thread_destructor))
return 0;
tss_symlist_add_new(taskIdSelf(), "ossl_init_base", "destructor_key.value",
&destructor_key.value, TSS_SYMLIST_STATE_ADDED);
return 1;
}
@@ -270,6 +274,8 @@ void *ossl_thread_event_ctx_new(OSSL_LIB_CTX *libctx)
if (!CRYPTO_THREAD_init_local(tlocal, NULL))
goto deinit;
tss_symlist_add_new(taskIdSelf(),"default_context_do_init", "tlocal",
tlocal, TSS_SYMLIST_STATE_ADDED);
hands = OPENSSL_zalloc(sizeof(*hands));
if (hands == NULL)
@@ -22,6 +22,8 @@
#include "rand_local.h"
#include "crypto/context.h"
#include "internal/provider.h"
#include <openssl/crypto.h>
#include <vxtss_symlist.h>
#ifndef OPENSSL_DEFAULT_SEED_SRC
# define OPENSSL_DEFAULT_SEED_SRC SEED-SRC
@@ -112,6 +114,8 @@ static RAND_GLOBAL *rand_get_global(OSSL_LIB_CTX *libctx)
# include "prov/seeding.h"
# include "internal/e_os.h"
# include "internal/property.h"
#include <openssl/crypto.h>
#include <vxtss_symlist.h>
/*
* The default name for the random provider.
@@ -546,9 +550,15 @@ void *ossl_rand_ctx_new(OSSL_LIB_CTX *libctx)
if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
goto err1;
tss_symlist_add_new(taskIdSelf(), "default_context_do_init", "dgbl->private",
&dgbl->private, TSS_SYMLIST_STATE_ADDED);
if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
goto err2;
tss_symlist_add_new(taskIdSelf(), "default_context_do_init", "dgbl->public",
&dgbl->public, TSS_SYMLIST_STATE_ADDED);
return dgbl;
err2:
@@ -127,7 +127,8 @@
* (*) by convention, since the init function must return 1 on success.
*/
# define RUN_ONCE(once, init) \
(CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
(snprintf((once)->run_once_arg, sizeof((once)->run_once_arg), "%s", #init), \
CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
/*
* RUN_ONCE_ALT - use CRYPTO_THREAD_run_once, to run an alternative initialiser
@@ -56,13 +56,13 @@ use OpenSSL::stackhash qw(generate_stack_macros);
# if defined(OPENSSL_SYS_VXWORKS) && defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG)
#include <taskLib.h>
/* threads.h cannot be included from C++ files, so define these types */
#define MAX_STR_LEN 64
typedef unsigned int tss_t;
typedef struct {
BOOL done;
SEM_ID sem;
} once_flag;
typedef unsigned int tss_t;
# ifndef __cplusplus
# endif
BOOL done;
SEM_ID sem;
char run_once_arg[MAX_STR_LEN];
} once_flag;
# endif
#ifdef __cplusplus
@@ -520,13 +520,8 @@ typedef LONG CRYPTO_ONCE;
typedef once_flag CRYPTO_ONCE;
typedef tss_t CRYPTO_THREAD_LOCAL;
typedef TASK_ID CRYPTO_THREAD_ID;
typedef struct
{
int initialized;
SEM_ID sem;
}CRYPTO_ONCE_STATIC_INIT;
# define ONCE_FLAG_INIT {0, NULL}
#define ONCE_FLAG_INIT { 0, NULL, { '\0' } }
# define CRYPTO_ONCE_STATIC_INIT ONCE_FLAG_INIT
# else
# if defined(__TANDEM) && defined(_SPT_MODEL_)