diff options
author | Pauli <pauli@openssl.org> | 2023-04-27 10:55:48 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-05-01 17:14:42 +1000 |
commit | fb7a7f099ecbabbf65c42856ec9fb9d898b15907 (patch) | |
tree | b39909014aa96897d66ad9d0a2f3388602e3d7cf /crypto/evp/evp_pbe.c | |
parent | 0feb90ba6093a59dcea0279d699169f604600d49 (diff) | |
download | openssl-new-fb7a7f099ecbabbf65c42856ec9fb9d898b15907.tar.gz |
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@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20842)
Diffstat (limited to 'crypto/evp/evp_pbe.c')
-rw-r--r-- | crypto/evp/evp_pbe.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c index d943dfeadd..9901d66a77 100644 --- a/crypto/evp/evp_pbe.c +++ b/crypto/evp/evp_pbe.c @@ -259,6 +259,8 @@ int EVP_PBE_find_ex(int type, int pbe_nid, int *pcnid, int *pmnid, pbelu.pbe_nid = pbe_nid; if (pbe_algs != NULL) { + /* Ideally, this would be done under lock */ + sk_EVP_PBE_CTL_sort(pbe_algs); i = sk_EVP_PBE_CTL_find(pbe_algs, &pbelu); pbetmp = sk_EVP_PBE_CTL_value(pbe_algs, i); } |