From 64f849f439f5107c972c9dac9454d1284fd0ef48 Mon Sep 17 00:00:00 2001 From: "Dr. Matthias St. Pierre" Date: Tue, 14 Apr 2020 00:12:48 +0200 Subject: Fix an assertion (and a comment) of evp_method_id() Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11542) --- crypto/evp/evp_fetch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c index e808bf818f..954ddb685c 100644 --- a/crypto/evp/evp_fetch.c +++ b/crypto/evp/evp_fetch.c @@ -73,8 +73,8 @@ static OSSL_METHOD_STORE *get_evp_method_store(OPENSSL_CTX *libctx) } /* - * To identity the method in the EVP method store, we mix the name identity - * with the operation identity, with the assumption that we don't have more + * To identify the method in the EVP method store, we mix the name identity + * with the operation identity, under the assumption that we don't have more * than 2^24 names or more than 2^8 operation types. * * The resulting identity is a 32-bit integer, composed like this: @@ -85,8 +85,8 @@ static OSSL_METHOD_STORE *get_evp_method_store(OPENSSL_CTX *libctx) */ static uint32_t evp_method_id(unsigned int operation_id, int name_id) { - if (!ossl_assert(name_id < (1 << 24) || operation_id < (1 << 8)) - || !ossl_assert(name_id > 0 && operation_id > 0)) + if (!ossl_assert(name_id > 0 && name_id < (1 << 24)) + || !ossl_assert(operation_id > 0 && operation_id < (1 << 8))) return 0; return ((name_id << 8) & 0xFFFFFF00) | (operation_id & 0x000000FF); } -- cgit v1.2.3