BUG/MINOR: ssl: Fix OCSP_CERTID leak when same certificate is used multiple times

If a given certificate is used multiple times in a configuration, the
ocsp_cid field would have been overwritten during each
ssl_sock_load_ocsp call even if it was previously filled.

This patch does not need to be backported.
This commit is contained in:
Remi Tricot-Le Breton 2023-01-09 12:02:47 +01:00 committed by William Lallemand
parent fc92b8bda5
commit 2d1daa8095

View File

@ -1150,6 +1150,7 @@ static int ssl_sock_load_ocsp(SSL_CTX *ctx, struct ckch_data *data, STACK_OF(X50
if (!issuer)
goto out;
if (!data->ocsp_cid)
data->ocsp_cid = OCSP_cert_to_id(0, x, issuer);
if (!data->ocsp_cid)
goto out;