diff options
author | Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com> | 2020-04-14 00:12:48 +0200 |
---|---|---|
committer | Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com> | 2020-04-20 07:30:25 +0200 |
commit | 64f849f439f5107c972c9dac9454d1284fd0ef48 (patch) | |
tree | b4e579b36ed37b452f10b300c7b3a22b195fbd47 /crypto | |
parent | 738ee1819e3bb94723701fb505ce2971afe47a9b (diff) |
Fix an assertion (and a comment) of evp_method_id()
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11542)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/evp/evp_fetch.c | 8 |
1 files 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); } |