control: tags -1 patch
Sebastian
Description: Fix build with OpenSSL4 OpenSSL4 has made ASN1_STRING opaque, so its length cannot be accessed directly anymore. . Co-Authored by Copilot Opus 4.8 Author: Andreas Hasenack <[email protected]> Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/2161810 Last-Update: 2026-07-25 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ diff --git a/lib/iolog/hostcheck.c b/lib/iolog/hostcheck.c index efb016ce..fab66fcd 100644 --- a/lib/iolog/hostcheck.c +++ b/lib/iolog/hostcheck.c @@ -316,6 +316,7 @@ matches_subject_alternative_name(const char *hostname, const char *ipaddr, const } } else if (current_name->type == GEN_IPADD) { const unsigned char *san_ip = ASN1_STRING_get0_data(current_name->d.iPAddress); + const int san_ip_length = ASN1_STRING_length(current_name->d.iPAddress); #if defined(HAVE_STRUCT_IN6_ADDR) char san_ip_str[INET6_ADDRSTRLEN]; #else @@ -323,14 +324,14 @@ matches_subject_alternative_name(const char *hostname, const char *ipaddr, const #endif /* IPV4 address */ - if(current_name->d.iPAddress->length == 4) { + if(san_ip_length == 4) { if (inet_ntop(AF_INET, san_ip, san_ip_str, INET_ADDRSTRLEN) == NULL) { result = MalformedCertificate; break; } #if defined(HAVE_STRUCT_IN6_ADDR) /* IPV6 address */ - } else if (current_name->d.iPAddress->length == 16) { + } else if (san_ip_length == 16) { if (inet_ntop(AF_INET6, san_ip, san_ip_str, INET6_ADDRSTRLEN) == NULL) { result = MalformedCertificate; break;

