diff options
Diffstat (limited to 'crypto/property')
-rw-r--r-- | crypto/property/defn_cache.c | 18 | ||||
-rw-r--r-- | crypto/property/property.c | 16 | ||||
-rw-r--r-- | crypto/property/property_local.h | 8 | ||||
-rw-r--r-- | crypto/property/property_parse.c | 16 | ||||
-rw-r--r-- | crypto/property/property_string.c | 16 |
5 files changed, 38 insertions, 36 deletions
diff --git a/crypto/property/defn_cache.c b/crypto/property/defn_cache.c index 9bfbd13144..ea44476213 100644 --- a/crypto/property/defn_cache.c +++ b/crypto/property/defn_cache.c @@ -57,22 +57,23 @@ static void property_defns_free(void *vproperty_defns) } } -static void *property_defns_new(OPENSSL_CTX *ctx) { +static void *property_defns_new(OSSL_LIB_CTX *ctx) { return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp); } -static const OPENSSL_CTX_METHOD property_defns_method = { +static const OSSL_LIB_CTX_METHOD property_defns_method = { property_defns_new, property_defns_free, }; -OSSL_PROPERTY_LIST *ossl_prop_defn_get(OPENSSL_CTX *ctx, const char *prop) +OSSL_PROPERTY_LIST *ossl_prop_defn_get(OSSL_LIB_CTX *ctx, const char *prop) { PROPERTY_DEFN_ELEM elem, *r; LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns; - property_defns = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_DEFN_INDEX, - &property_defns_method); + property_defns = ossl_lib_ctx_get_data(ctx, + OSSL_LIB_CTX_PROPERTY_DEFN_INDEX, + &property_defns_method); if (property_defns == NULL) return NULL; @@ -81,15 +82,16 @@ OSSL_PROPERTY_LIST *ossl_prop_defn_get(OPENSSL_CTX *ctx, const char *prop) return r != NULL ? r->defn : NULL; } -int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop, +int ossl_prop_defn_set(OSSL_LIB_CTX *ctx, const char *prop, OSSL_PROPERTY_LIST *pl) { PROPERTY_DEFN_ELEM elem, *old, *p = NULL; size_t len; LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns; - property_defns = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_DEFN_INDEX, - &property_defns_method); + property_defns = ossl_lib_ctx_get_data(ctx, + OSSL_LIB_CTX_PROPERTY_DEFN_INDEX, + &property_defns_method); if (property_defns == NULL) return 0; diff --git a/crypto/property/property.c b/crypto/property/property.c index c2238ac63d..9cfca81190 100644 --- a/crypto/property/property.c +++ b/crypto/property/property.c @@ -57,7 +57,7 @@ typedef struct { } ALGORITHM; struct ossl_method_store_st { - OPENSSL_CTX *ctx; + OSSL_LIB_CTX *ctx; size_t nelem; SPARSE_ARRAY_OF(ALGORITHM) *algs; int need_flush; @@ -85,26 +85,26 @@ static void ossl_ctx_global_properties_free(void *vstore) } } -static void *ossl_ctx_global_properties_new(OPENSSL_CTX *ctx) +static void *ossl_ctx_global_properties_new(OSSL_LIB_CTX *ctx) { return OPENSSL_zalloc(sizeof(OSSL_PROPERTY_LIST **)); } -static const OPENSSL_CTX_METHOD ossl_ctx_global_properties_method = { +static const OSSL_LIB_CTX_METHOD ossl_ctx_global_properties_method = { ossl_ctx_global_properties_new, ossl_ctx_global_properties_free, }; -OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OPENSSL_CTX *libctx, +OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OSSL_LIB_CTX *libctx, int loadconfig) { #ifndef FIPS_MODULE if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL)) return NULL; #endif - return openssl_ctx_get_data(libctx, OPENSSL_CTX_GLOBAL_PROPERTIES, - &ossl_ctx_global_properties_method); + return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES, + &ossl_ctx_global_properties_method); } static int ossl_method_up_ref(METHOD *method) @@ -169,10 +169,10 @@ static void alg_cleanup(ossl_uintmax_t idx, ALGORITHM *a) } /* - * The OPENSSL_CTX param here allows access to underlying property data needed + * The OSSL_LIB_CTX param here allows access to underlying property data needed * for computation */ -OSSL_METHOD_STORE *ossl_method_store_new(OPENSSL_CTX *ctx) +OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx) { OSSL_METHOD_STORE *res; diff --git a/crypto/property/property_local.h b/crypto/property/property_local.h index 639af5591d..89020e606e 100644 --- a/crypto/property/property_local.h +++ b/crypto/property/property_local.h @@ -14,9 +14,9 @@ typedef int OSSL_PROPERTY_IDX; /* Property string functions */ -OSSL_PROPERTY_IDX ossl_property_name(OPENSSL_CTX *ctx, const char *s, +OSSL_PROPERTY_IDX ossl_property_name(OSSL_LIB_CTX *ctx, const char *s, int create); -OSSL_PROPERTY_IDX ossl_property_value(OPENSSL_CTX *ctx, const char *s, +OSSL_PROPERTY_IDX ossl_property_value(OSSL_LIB_CTX *ctx, const char *s, int create); /* Property list functions */ @@ -24,8 +24,8 @@ void ossl_property_free(OSSL_PROPERTY_LIST *p); int ossl_property_has_optional(const OSSL_PROPERTY_LIST *query); /* Property definition cache functions */ -OSSL_PROPERTY_LIST *ossl_prop_defn_get(OPENSSL_CTX *ctx, const char *prop); -int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop, +OSSL_PROPERTY_LIST *ossl_prop_defn_get(OSSL_LIB_CTX *ctx, const char *prop); +int ossl_prop_defn_set(OSSL_LIB_CTX *ctx, const char *prop, OSSL_PROPERTY_LIST *pl); /* Property cache lock / unlock */ diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c index d53961daea..9bc89f4d42 100644 --- a/crypto/property/property_parse.c +++ b/crypto/property/property_parse.c @@ -80,7 +80,7 @@ static int match(const char *t[], const char m[], size_t m_len) return 0; } -static int parse_name(OPENSSL_CTX *ctx, const char *t[], int create, +static int parse_name(OSSL_LIB_CTX *ctx, const char *t[], int create, OSSL_PROPERTY_IDX *idx) { char name[100]; @@ -187,7 +187,7 @@ static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) return 1; } -static int parse_string(OPENSSL_CTX *ctx, const char *t[], char delim, +static int parse_string(OSSL_LIB_CTX *ctx, const char *t[], char delim, PROPERTY_DEFINITION *res, const int create) { char v[1000]; @@ -218,7 +218,7 @@ static int parse_string(OPENSSL_CTX *ctx, const char *t[], char delim, return !err; } -static int parse_unquoted(OPENSSL_CTX *ctx, const char *t[], +static int parse_unquoted(OSSL_LIB_CTX *ctx, const char *t[], PROPERTY_DEFINITION *res, const int create) { char v[1000]; @@ -251,7 +251,7 @@ static int parse_unquoted(OPENSSL_CTX *ctx, const char *t[], return !err; } -static int parse_value(OPENSSL_CTX *ctx, const char *t[], +static int parse_value(OSSL_LIB_CTX *ctx, const char *t[], PROPERTY_DEFINITION *res, int create) { const char *s = *t; @@ -326,7 +326,7 @@ static OSSL_PROPERTY_LIST *stack_to_property_list(STACK_OF(PROPERTY_DEFINITION) return r; } -OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn) +OSSL_PROPERTY_LIST *ossl_parse_property(OSSL_LIB_CTX *ctx, const char *defn) { PROPERTY_DEFINITION *prop = NULL; OSSL_PROPERTY_LIST *res = NULL; @@ -385,7 +385,7 @@ err: return res; } -OSSL_PROPERTY_LIST *ossl_parse_query(OPENSSL_CTX *ctx, const char *s) +OSSL_PROPERTY_LIST *ossl_parse_query(OSSL_LIB_CTX *ctx, const char *s) { STACK_OF(PROPERTY_DEFINITION) *sk; OSSL_PROPERTY_LIST *res = NULL; @@ -453,7 +453,7 @@ int ossl_property_has_optional(const OSSL_PROPERTY_LIST *query) return query->has_optional ? 1 : 0; } -int ossl_property_is_enabled(OPENSSL_CTX *ctx, const char *property_name, +int ossl_property_is_enabled(OSSL_LIB_CTX *ctx, const char *property_name, const OSSL_PROPERTY_LIST *prop_list) { int i; @@ -590,7 +590,7 @@ OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a, return r; } -int ossl_property_parse_init(OPENSSL_CTX *ctx) +int ossl_property_parse_init(OSSL_LIB_CTX *ctx) { static const char *const predefined_names[] = { "provider", /* Name of provider (default, legacy, fips) */ diff --git a/crypto/property/property_string.c b/crypto/property/property_string.c index 55d34688db..17b930b439 100644 --- a/crypto/property/property_string.c +++ b/crypto/property/property_string.c @@ -81,7 +81,7 @@ static void property_string_data_free(void *vpropdata) OPENSSL_free(propdata); } -static void *property_string_data_new(OPENSSL_CTX *ctx) { +static void *property_string_data_new(OSSL_LIB_CTX *ctx) { PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata)); if (propdata == NULL) @@ -104,7 +104,7 @@ err: return NULL; } -static const OPENSSL_CTX_METHOD property_string_data_method = { +static const OSSL_LIB_CTX_METHOD property_string_data_method = { property_string_data_new, property_string_data_free, }; @@ -147,12 +147,12 @@ static OSSL_PROPERTY_IDX ossl_property_string(PROP_TABLE *t, return ps != NULL ? ps->idx : 0; } -OSSL_PROPERTY_IDX ossl_property_name(OPENSSL_CTX *ctx, const char *s, +OSSL_PROPERTY_IDX ossl_property_name(OSSL_LIB_CTX *ctx, const char *s, int create) { PROPERTY_STRING_DATA *propdata - = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_STRING_INDEX, - &property_string_data_method); + = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX, + &property_string_data_method); if (propdata == NULL) return 0; @@ -161,12 +161,12 @@ OSSL_PROPERTY_IDX ossl_property_name(OPENSSL_CTX *ctx, const char *s, s); } -OSSL_PROPERTY_IDX ossl_property_value(OPENSSL_CTX *ctx, const char *s, +OSSL_PROPERTY_IDX ossl_property_value(OSSL_LIB_CTX *ctx, const char *s, int create) { PROPERTY_STRING_DATA *propdata - = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_STRING_INDEX, - &property_string_data_method); + = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX, + &property_string_data_method); if (propdata == NULL) return 0; |