Fix an assertion (and a comment) of evp_method_id()
@@ -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);
}
