Skip to content

Commit

Permalink
MT#55283 add version test for X509_STORE_CTX_get0_cert
Browse files Browse the repository at this point in the history
Looks like this didn't exist prior to 1.1.1

Fix-up for 8fba68f

Change-Id: I1568ce6c583114659cc2e9997269f45043bd220a
(cherry picked from commit d6b09b5)
  • Loading branch information
rfuchs committed Mar 7, 2024
1 parent 20702cc commit c6e7a09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daemon/dtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,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);
Expand Down

0 comments on commit c6e7a09

Please sign in to comment.