[openssl/openssl] 2c2726: Propagate selection all the way on key export

Simo Sorce noreply at github.com
Tue Nov 15 11:09:05 UTC 2022


  Branch: refs/heads/openssl-3.1
  Home:   https://github.com/openssl/openssl
  Commit: 2c2726cd99a8e692c461aff64c20790ab4dbdebb
      https://github.com/openssl/openssl/commit/2c2726cd99a8e692c461aff64c20790ab4dbdebb
  Author: Simo Sorce <simo at redhat.com>
  Date:   2022-11-15 (Tue, 15 Nov 2022)

  Changed paths:
    M crypto/evp/keymgmt_lib.c
    M crypto/evp/p_lib.c
    M include/crypto/evp.h

  Log Message:
  -----------
  Propagate selection all the way on key export

EVP_PKEY_eq() is used to check, among other things, if a certificate
public key corresponds to a private key. When the private key belongs to
a provider that does not allow to export private keys this currently
fails as the internal functions used to import/export keys ignored the
selection given (which specifies that only the public key needs to be
considered) and instead tries to export everything.

This patch allows to propagate the selection all the way down including
adding it in the cache so that a following operation actually looking
for other selection parameters does not mistakenly pick up an export
containing only partial information.

Signed-off-by: Simo Sorce <simo at redhat.com>

Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19648)

(cherry picked from commit 98642df4ba886818900ab7e6b23703544e6addd4)


  Commit: d619035d034cfecb257474b243d732d6f2d249f9
      https://github.com/openssl/openssl/commit/d619035d034cfecb257474b243d732d6f2d249f9
  Author: Simo Sorce <simo at redhat.com>
  Date:   2022-11-15 (Tue, 15 Nov 2022)

  Changed paths:
    M doc/internal/man3/evp_keymgmt_util_export_to_provider.pod

  Log Message:
  -----------
  Update documentation for keymgmt export utils

Change function prototypes and explain how to use the selection
argument.

Signed-off-by: Simo Sorce <simo at redhat.com>

Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19648)

(cherry picked from commit 504427eb5f32108dd64ff7858012863fe47b369b)


  Commit: 08715aaa249fd9b3e6cf848ae452b6bce77dadcb
      https://github.com/openssl/openssl/commit/08715aaa249fd9b3e6cf848ae452b6bce77dadcb
  Author: Simo Sorce <simo at redhat.com>
  Date:   2022-11-15 (Tue, 15 Nov 2022)

  Changed paths:
    M test/fake_rsaprov.c
    M test/fake_rsaprov.h
    M test/provider_pkey_test.c

  Log Message:
  -----------
  Add test for EVP_PKEY_eq

This tests that the comparison work even if a provider can only return
a public key.

Signed-off-by: Simo Sorce <simo at redhat.com>

Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19648)

(cherry picked from commit e5202fbd461cb6c067874987998e91c6093e5267)


Compare: https://github.com/openssl/openssl/compare/2f3f0b0c4202...08715aaa249f


More information about the openssl-commits mailing list