[openssl/openssl] 8865d7: Avoid exporting bogus (empty) data if empty select...

Tomáš Mráz noreply at github.com
Fri Aug 4 14:17:17 UTC 2023


  Branch: refs/heads/openssl-3.1
  Home:   https://github.com/openssl/openssl
  Commit: 8865d7c4e8f9afac969fc927f2b24ee6d03868bd
      https://github.com/openssl/openssl/commit/8865d7c4e8f9afac969fc927f2b24ee6d03868bd
  Author: Tomas Mraz <tomas at openssl.org>
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
    M providers/implementations/keymgmt/dh_kmgmt.c
    M providers/implementations/keymgmt/dsa_kmgmt.c
    M providers/implementations/keymgmt/ecx_kmgmt.c
    M providers/implementations/keymgmt/mac_legacy_kmgmt.c

  Log Message:
  -----------
  Avoid exporting bogus (empty) data if empty selection is used

This is already correct in the rsa_kmgmt.c but other
implementations are wrong.

Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/21519)

(cherry picked from commit 1ae4678cebaa13604c0f31bdf2c64cd28bdaf287)


  Commit: 137ba0567417441cd8b3d43cf23e27d73f7a7684
      https://github.com/openssl/openssl/commit/137ba0567417441cd8b3d43cf23e27d73f7a7684
  Author: Tomas Mraz <tomas at openssl.org>
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
    M crypto/encode_decode/decoder_pkey.c
    M providers/implementations/encode_decode/decode_der2key.c
    M providers/implementations/encode_decode/decode_msblob2key.c
    M providers/implementations/encode_decode/decode_pvk2key.c

  Log Message:
  -----------
  When exporting/importing decoded keys do not use 0 as selection

When decoding 0 as the selection means to decode anything
you get.

However when exporting and then importing the key data 0 as
selection is not meaningful.
So we set it to OSSL_KEYMGMT_SELECT_ALL to make the export/import
function export/import everything that we have decoded.

Fixes #21493

Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/21519)

(cherry picked from commit 2acb0d363c0032b5b97c4f6596609f40bd7d842f)


  Commit: 42f32b460646d8d4ef1e8927ec976716f02a093a
      https://github.com/openssl/openssl/commit/42f32b460646d8d4ef1e8927ec976716f02a093a
  Author: Tomas Mraz <tomas at openssl.org>
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
    M test/endecode_test.c

  Log Message:
  -----------
  endecode_test.c: Add tests for decoding with 0 selection

Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/21519)

(cherry picked from commit 4c50610bdadbcf7aa6bbd968df67b8874234677b)


Compare: https://github.com/openssl/openssl/compare/069ff058850a...42f32b460646


More information about the openssl-commits mailing list