mirror of
https://github.com/openssl/openssl.git
synced 2024-12-03 05:41:46 +08:00
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)
This commit is contained in:
parent
0feb90ba60
commit
fb7a7f099e
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user