From 6fc480e3bd59fc00d78f222650d548c18f9c532c Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Tue, 6 Oct 2026 18:20:16 +0200 Subject: [PATCH] package/libesmtp: fix build with OpenSSL 4.0.0 Signed-off-by: Bernd Kuhls Signed-off-by: Thomas Petazzoni --- ...-with-OpenSSL-4.0-opaque-ASN1_STRING.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 package/libesmtp/0001-Fix-build-with-OpenSSL-4.0-opaque-ASN1_STRING.patch diff --git a/package/libesmtp/0001-Fix-build-with-OpenSSL-4.0-opaque-ASN1_STRING.patch b/package/libesmtp/0001-Fix-build-with-OpenSSL-4.0-opaque-ASN1_STRING.patch new file mode 100644 index 0000000000..f38435b68a --- /dev/null +++ b/package/libesmtp/0001-Fix-build-with-OpenSSL-4.0-opaque-ASN1_STRING.patch @@ -0,0 +1,36 @@ +From 0705423e2596a21e2d4e1f3fd492792956a4bad3 Mon Sep 17 00:00:00 2001 +From: Ravi Kant Sharma +Date: Tue, 28 Jul 2026 20:35:48 +0200 +Subject: [PATCH] Fix build with OpenSSL 4.0 opaque ASN1_STRING + +OpenSSL 4.0 made ASN1_STRING opaque, so direct access to ->data and +->length fields no longer compiles. Use ASN1_STRING_get0_data() and +ASN1_STRING_length() accessors which are available since OpenSSL 1.1.0. + +Fixes #33 + +Upstream: https://github.com/libesmtp/libESMTP/pull/34 + +Signed-off-by: Bernd Kuhls +--- + smtp-tls.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/smtp-tls.c b/smtp-tls.c +index 9f3e50e..981284e 100644 +--- a/smtp-tls.c ++++ b/smtp-tls.c +@@ -599,8 +599,8 @@ check_acceptable_security (smtp_session_t session, SSL *ssl) + + if (name->type == GEN_DNS) + { +- const char *ia5str = (const char *) name->d.ia5->data; +- size_t ia5len = name->d.ia5->length; ++ const char *ia5str = (const char *) ASN1_STRING_get0_data(name->d.ia5); ++ size_t ia5len = ASN1_STRING_length(name->d.ia5); + + hasaltname = 1; + if (strlen (ia5str) == ia5len && match_domain (host, ia5str)) +-- +2.47.3 +