From 735764d84272cb46f8fd4c3ddfe0cacbda0d9323 Mon Sep 17 00:00:00 2001 From: Ravi Kant Sharma Date: Mon, 6 Jul 2026 13:15:01 +0200 Subject: [PATCH] Fix OpenSSL 4.0 compatibility in anchor-internal.c Replace direct ASN1_BIT_STRING member access (->data, ->length) with ASN1_STRING_get0_data() and ASN1_STRING_length() accessors. --- src/tls/anchor-internal.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tls/anchor-internal.c b/src/tls/anchor-internal.c index b045eac1e..f54f4e528 100644 --- a/src/tls/anchor-internal.c +++ b/src/tls/anchor-internal.c @@ -60,10 +60,12 @@ _getdns_get_usage_of_ex(X509* cert) ASN1_BIT_STRING* s; if((s=X509_get_ext_d2i(cert, NID_key_usage, NULL, NULL))) { - if(s->length > 0) { - val = s->data[0]; - if(s->length > 1) - val |= s->data[1] << 8; + const unsigned char *data = ASN1_STRING_get0_data(s); + int len = ASN1_STRING_length(s); + if(len > 0) { + val = data[0]; + if(len > 1) + val |= data[1] << 8; } ASN1_BIT_STRING_free(s); }