[openssl/openssl] 0feb90: asn1: sort stacks before using find

Pauli noreply at github.com
Mon May 1 07:16:38 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 0feb90ba6093a59dcea0279d699169f604600d49
      https://github.com/openssl/openssl/commit/0feb90ba6093a59dcea0279d699169f604600d49
  Author: Pauli <pauli at openssl.org>
  Date:   2023-05-01 (Mon, 01 May 2023)

  Changed paths:
    M crypto/asn1/a_strnid.c
    M crypto/asn1/asn_mime.c

  Log Message:
  -----------
  asn1: sort stacks before using find

a_strnid.c doesn't have a lock for the sort.  This is no worse than the
existing code which sorted silently without a lock.

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/20842)


  Commit: fb7a7f099ecbabbf65c42856ec9fb9d898b15907
      https://github.com/openssl/openssl/commit/fb7a7f099ecbabbf65c42856ec9fb9d898b15907
  Author: Pauli <pauli at openssl.org>
  Date:   2023-05-01 (Mon, 01 May 2023)

  Changed paths:
    M crypto/evp/evp_pbe.c

  Log Message:
  -----------
  pbe: sort stack before using find

There is no lock for the sort.  This is no worse than the
existing code which sorted silently without a lock.

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/20842)


  Commit: 07f9c81d20f2c972dd454e2343634586d3aa88a1
      https://github.com/openssl/openssl/commit/07f9c81d20f2c972dd454e2343634586d3aa88a1
  Author: Pauli <pauli at openssl.org>
  Date:   2023-05-01 (Mon, 01 May 2023)

  Changed paths:
    M crypto/provider_core.c

  Log Message:
  -----------
  provider_core: sort provider stack on find

Adding all providers is quadratic time because each provider is checked
for being in the stack before adding it.  However, this is an improvement
over the older O(n^2 log n) code where each find also sorted the stack.

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/20842)


  Commit: efe0222f5c9e07167aeac80d4d5e3d67aa8f1f36
      https://github.com/openssl/openssl/commit/efe0222f5c9e07167aeac80d4d5e3d67aa8f1f36
  Author: Pauli <pauli at openssl.org>
  Date:   2023-05-01 (Mon, 01 May 2023)

  Changed paths:
    M crypto/x509/by_dir.c
    M crypto/x509/pcy_cache.c
    M crypto/x509/pcy_tree.c
    M crypto/x509/v3_addr.c
    M crypto/x509/v3_lib.c
    M crypto/x509/x509_trust.c
    M crypto/x509/x509_vpm.c

  Log Message:
  -----------
  x509: sort stacks before finds

x509_trust.c, x509_vpm.c and v3_lib.c don't have a lock for their sorts.
This is no worse than the existing code which sorted silently without locks.

Addition is quadratic time in by_dir.c and v3_purp.c.  However, this
is an improvement over the older O(n^2 log n) code where each find also
sorted the stack.  Also note that v3_purp.c is limited to a maximum of
10 items, so quadratic behaviour isn't terrible.

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/20842)


  Commit: 1c35e39ac0e5845c5bc7ca7f802ee832ca95388d
      https://github.com/openssl/openssl/commit/1c35e39ac0e5845c5bc7ca7f802ee832ca95388d
  Author: Pauli <pauli at openssl.org>
  Date:   2023-05-01 (Mon, 01 May 2023)

  Changed paths:
    M doc/man3/DEFINE_STACK_OF.pod

  Log Message:
  -----------
  doc: note that the stack find functions no longer modify the stack

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Todd Short <todd.short at me.com>
(Merged from https://github.com/openssl/openssl/pull/20842)


Compare: https://github.com/openssl/openssl/compare/b5a635dc2113...1c35e39ac0e5


More information about the openssl-commits mailing list