Improve the implementation of X509_STORE_CTX_get1_issuer()
authorTomas Mraz <tomas@openssl.org>
Mon, 29 Mar 2021 10:41:18 +0000 (12:41 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 28 Apr 2021 09:19:34 +0000 (11:19 +0200)
commit5fd7eb5c8a45e8aba7a2610dfcfbcfb2eb6c1aec
tree7ca22c60cb7add699a18d8e6d78e97282a72db9c
parente1491a2f15a985e642043f234240953886d2f989
Improve the implementation of X509_STORE_CTX_get1_issuer()

It is possible for the stack of X509_OBJECTs held in an X509_STORE_CTX to
have a custom compare function associated with it. Normally (by default)
this uses X509_NAME_cmp(). The X509_STORE_CTX_get1_issuer() function
assumed that it would always be X509_NAME_cmp().

By implementing OPENSSL_sk_find_all() function we can avoid explicitly
using X509_NAME_cmp() in X509_STORE_CTX_get1_issuer().

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14728)
crypto/stack/stack.c
crypto/x509/x509_lu.c
doc/man3/DEFINE_STACK_OF.pod
include/openssl/safestack.h.in
include/openssl/stack.h
util/libcrypto.num
util/perl/OpenSSL/stackhash.pm