From e12e526537acd349d98cb6a6f7443c962e8ff6db Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 7 Mar 2024 08:39:38 -0500 Subject: [PATCH] MT#55283 add version test for X509_STORE_CTX_get0_cert Looks like this didn't exist prior to 1.1.1 Fix-up for 8fba68f2c9 Change-Id: I1568ce6c583114659cc2e9997269f45043bd220a (cherry picked from commit d6b09b53ead9f932378d147a59bf589987063046) --- daemon/dtls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/dtls.c b/daemon/dtls.c index 3d70ffd7f..04bf9418b 100644 --- a/daemon/dtls.c +++ b/daemon/dtls.c @@ -502,9 +502,13 @@ static int verify_callback(int ok, X509_STORE_CTX *store) { if (ps->dtls_cert) X509_free(ps->dtls_cert); ps->dtls_cert = NULL; +#if OPENSSL_VERSION_NUMBER >= 0x10100010L X509 *cert = X509_STORE_CTX_get0_cert(store); if (!cert) cert = X509_STORE_CTX_get_current_cert(store); +#else + X509 *cert = X509_STORE_CTX_get_current_cert(store); +#endif if (!cert) return 0; ps->dtls_cert = X509_dup(cert);