[openssl/openssl] 98642d: Propagate selection all the way on key export

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


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 98642df4ba886818900ab7e6b23703544e6addd4
      https://github.com/openssl/openssl/commit/98642df4ba886818900ab7e6b23703544e6addd4
  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)


  Commit: 504427eb5f32108dd64ff7858012863fe47b369b
      https://github.com/openssl/openssl/commit/504427eb5f32108dd64ff7858012863fe47b369b
  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)


  Commit: e5202fbd461cb6c067874987998e91c6093e5267
      https://github.com/openssl/openssl/commit/e5202fbd461cb6c067874987998e91c6093e5267
  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)


Compare: https://github.com/openssl/openssl/compare/93e1271eedfe...e5202fbd461c


More information about the openssl-commits mailing list