From 7894d15929745227705438c90a40c40d6bb3b3e1 Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Sat, 21 Oct 2023 07:59:44 +0200 Subject: [PATCH] Stop reaching into X509_ALGOR While the struct is still public in all versions of OpenSSL and its forks, this may well change in the future. Prepare for that case and use the X509_ALGOR_get0() accessor which has been available with this signature since OpenSSL 1.1. --- src/tls_openssl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tls_openssl.c b/src/tls_openssl.c index 8691197e..929e5f01 100644 --- a/src/tls_openssl.c +++ b/src/tls_openssl.c @@ -412,8 +412,10 @@ _get_alg(const xmpp_ctx_t *ctx, X509 *err_cert, xmpp_cert_element_t el) alg_nid = OBJ_obj2nid(err_cert->sig_alg->algorithm); #else const X509_ALGOR *palg; + const ASN1_OBJECT *obj; X509_get0_signature(NULL, &palg, err_cert); - alg_nid = OBJ_obj2nid(palg->algorithm); + X509_ALGOR_get0(&obj, NULL, NULL, palg); + alg_nid = OBJ_obj2nid(obj); #endif } break; default: