[openssl/openssl] b96e10: fix: refactor the EVP_PKEY_OP checks

Richard Levitte noreply at github.com
Sun Jul 21 16:08:56 UTC 2024


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: b96e10b9f9bfaba3c373d3d5716fe0408eb0aa8c
      https://github.com/openssl/openssl/commit/b96e10b9f9bfaba3c373d3d5716fe0408eb0aa8c
  Author: Richard Levitte <levitte at openssl.org>
  Date:   2024-07-21 (Sun, 21 Jul 2024)

  Changed paths:
    M include/crypto/evp.h
    M include/openssl/evp.h

  Log Message:
  -----------
  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 at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/24854)


  Commit: 787e1dd941b695c957df2e2d587730a6de3df9ab
      https://github.com/openssl/openssl/commit/787e1dd941b695c957df2e2d587730a6de3df9ab
  Author: Richard Levitte <levitte at openssl.org>
  Date:   2024-07-21 (Sun, 21 Jul 2024)

  Changed paths:
    M include/crypto/evp.h
    M include/openssl/evp.h

  Log Message:
  -----------
  fix: style nits

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


Compare: https://github.com/openssl/openssl/compare/a98870414773...787e1dd941b6

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications


More information about the openssl-commits mailing list