From: Pauli Date: Wed, 16 Apr 2025 07:32:35 +0000 (+1000) Subject: gcm: use TRIE based param name decoder X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d969379cb22f62bb7d43ce83d43f2b8eb18b927;p=thirdparty%2Fopenssl.git gcm: use TRIE based param name decoder Reviewed-by: Dmitry Belyavskiy Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27392) --- diff --git a/providers/implementations/ciphers/ciphercommon_gcm.c b/providers/implementations/ciphers/ciphercommon_gcm.c index bd343d5b74f..84a8e7d6282 100644 --- a/providers/implementations/ciphers/ciphercommon_gcm.c +++ b/providers/implementations/ciphers/ciphercommon_gcm.c @@ -146,11 +146,9 @@ int ossl_gcm_get_ctx_params(void *vctx, OSSL_PARAM params[]) PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx; OSSL_PARAM *p; size_t sz; - int type; - for (p = params; p->key != NULL; p++) { - type = ossl_param_find_pidx(p->key); - switch (type) { + for (p = params; p->key != NULL; p++) + switch (ossl_cipher_aead_get_ctx_params_find_pidx(p->key)) { default: break; @@ -238,7 +236,6 @@ int ossl_gcm_get_ctx_params(void *vctx, OSSL_PARAM params[]) if (!OSSL_PARAM_set_uint(p, ctx->iv_gen_rand)) return 0; } - } return 1; } @@ -248,14 +245,12 @@ int ossl_gcm_set_ctx_params(void *vctx, const OSSL_PARAM params[]) const OSSL_PARAM *p; size_t sz; void *vp; - int type; if (ossl_param_is_empty(params)) return 1; - for (p = params; p->key != NULL; p++) { - type = ossl_param_find_pidx(p->key); - switch (type) { + for (p = params; p->key != NULL; p++) + switch (ossl_cipher_aead_set_ctx_params_find_pidx(p->key)) { default: break; @@ -320,8 +315,6 @@ int ossl_gcm_set_ctx_params(void *vctx, const OSSL_PARAM params[]) return 0; break; } - } - return 1; }