]> git.ipfire.org Git - thirdparty/openssl.git/commit
fix: refactor the EVP_PKEY_OP checks
authorRichard Levitte <levitte@openssl.org>
Thu, 11 Jul 2024 07:03:49 +0000 (09:03 +0200)
committerTodd Short <todd.short@me.com>
Sun, 21 Jul 2024 16:04:49 +0000 (12:04 -0400)
commitb96e10b9f9bfaba3c373d3d5716fe0408eb0aa8c
tree7d7de0e45459f9a26d803e3c3ef1d27e12f72b00
parenta98870414773baa9e8983d98ce61ad46d60c00ff
fix: refactor the EVP_PKEY_OP checks

On the one hand, we have public macros that are collections of EVP_PKEY_OP
bits, like EVP_PKEY_OP_TYPE_SIG, obviously meant to be used like this:

    if ((ctx->operation & EVP_PKEY_OP_TYPE_SIG) == 0) ...

On the other hand, we also have internal test macros, like
EVP_PKEY_CTX_IS_SIGNATURE_OP(), obviously meant to be used like this:

    if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)) ...

Unfortunately, these two sets of macros were completely separate, forcing
developers to keep them both sync, manually.

This refactor makes the internal macros use the corresponding public macros,
and adds the missing public macros, for consistency.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/24854)
include/crypto/evp.h
include/openssl/evp.h