From: Tomas Mraz Date: Wed, 1 May 2024 16:42:57 +0000 (+0200) Subject: Do not use bit fields for context data flag variables X-Git-Tag: openssl-3.4.0-alpha1~581 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0084946f5fae86170d0169bdf1e5cc121531c22;p=thirdparty%2Fopenssl.git Do not use bit fields for context data flag variables Reviewed-by: Paul Dale Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/24275) --- diff --git a/crypto/context.c b/crypto/context.c index fa46abab6b2..2fbb2fbf60e 100644 --- a/crypto/context.c +++ b/crypto/context.c @@ -49,8 +49,8 @@ struct ossl_lib_ctx_st { void *fips_prov; #endif - unsigned int ischild:1; - unsigned int conf_diagnostics:1; + int ischild; + int conf_diagnostics; }; int ossl_lib_ctx_write_lock(OSSL_LIB_CTX *ctx) @@ -676,10 +676,10 @@ int OSSL_LIB_CTX_get_conf_diagnostics(OSSL_LIB_CTX *libctx) return libctx->conf_diagnostics; } -void OSSL_LIB_CTX_set_conf_diagnostics(OSSL_LIB_CTX *libctx, unsigned int value) +void OSSL_LIB_CTX_set_conf_diagnostics(OSSL_LIB_CTX *libctx, int value) { libctx = ossl_lib_ctx_get_concrete(libctx); if (libctx == NULL) return; - libctx->conf_diagnostics = value != 0; + libctx->conf_diagnostics = value; } diff --git a/include/openssl/crypto.h.in b/include/openssl/crypto.h.in index 04d99e20923..034f150cb65 100644 --- a/include/openssl/crypto.h.in +++ b/include/openssl/crypto.h.in @@ -537,7 +537,7 @@ void OSSL_LIB_CTX_free(OSSL_LIB_CTX *); OSSL_LIB_CTX *OSSL_LIB_CTX_get0_global_default(void); OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *libctx); int OSSL_LIB_CTX_get_conf_diagnostics(OSSL_LIB_CTX *ctx); -void OSSL_LIB_CTX_set_conf_diagnostics(OSSL_LIB_CTX *ctx, unsigned int value); +void OSSL_LIB_CTX_set_conf_diagnostics(OSSL_LIB_CTX *ctx, int value); void OSSL_sleep(uint64_t millis);