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

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


  Branch: refs/heads/openssl-3.0
  Home:   https://github.com/openssl/openssl
  Commit: b5edc8d02ce0c11f39529b0fc95ae64c1c9f6c70
      https://github.com/openssl/openssl/commit/b5edc8d02ce0c11f39529b0fc95ae64c1c9f6c70
  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)
(cherry picked from commit 8865d7c4e8f9afac969fc927f2b24ee6d03868bd)


  Commit: 52080c8bafcfd445d0d388cc93ad5d1f0d51bf39
      https://github.com/openssl/openssl/commit/52080c8bafcfd445d0d388cc93ad5d1f0d51bf39
  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)
(cherry picked from commit 137ba0567417441cd8b3d43cf23e27d73f7a7684)


  Commit: 2d79662b5febe565d39861338a5d9067a2df641f
      https://github.com/openssl/openssl/commit/2d79662b5febe565d39861338a5d9067a2df641f
  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)
(cherry picked from commit 42f32b460646d8d4ef1e8927ec976716f02a093a)


Compare: https://github.com/openssl/openssl/compare/9f8dd6c265d5...2d79662b5feb


More information about the openssl-commits mailing list