[openssl/openssl] 7a7267: Updated `rsa_has()` for correct validation

afshinpir noreply at github.com
Tue Mar 14 21:31:29 UTC 2023


  Branch: refs/heads/openssl-3.0
  Home:   https://github.com/openssl/openssl
  Commit: 7a7267ab64f4b67dbf8665873cae1f0651e26e5b
      https://github.com/openssl/openssl/commit/7a7267ab64f4b67dbf8665873cae1f0651e26e5b
  Author: afshinpir <afshinpir at users.noreply.github.com>
  Date:   2023-03-15 (Wed, 15 Mar 2023)

  Changed paths:
    M providers/implementations/keymgmt/rsa_kmgmt.c

  Log Message:
  -----------
  Updated `rsa_has()` for correct validation

CLA: trivial
In RSA, `(n,e)` and `(n,d)` identify public key and private key.
Modulus `n` is the common part. So I updated `rsa_has()` to validate
these pairs correctly. `OSSL_KEYMGMT_SELECT_KEYPAIR` is common part
for both public and private key, so I changed it to check `n` of
RSA and for `OSSL_KEYMGMT_SELECT_PUBLIC_KEY`, `e` is checked. Before
this change, if `selection` was `OSSL_KEYMGMT_SELECT_PRIVATE_KEY` and
only `e` and `d` was in the RSA structure, the function returns 1
while it was incorrect.

Reviewed-by: Richard Levitte <levitte at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20455)

(cherry picked from commit a3207163ef3d30658a41a9c9e3750ca4c5b16677)




More information about the openssl-commits mailing list