package/socat: add support for OpenSSL 4.0.0

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Cc: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Bernd Kuhls
2026-10-06 18:20:27 +02:00
committed by Thomas Petazzoni
parent aac023e8ea
commit d1c4544f15

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Date: Thu, 13 Aug 2026 07:00:00 +0000
Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors
OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members
(->data, ->length) is no longer possible. Use the accessor functions
ASN1_STRING_get0_data() and ASN1_STRING_length() instead.
These accessors have been available since OpenSSL 1.1.0, so this change
is backward compatible.
Upstream: Submitted [socat@dest-unreach.org]
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Downloaded from https://github.com/openembedded/openembedded-core/commit/aa435ebaaf7446ec07a88586f2de4109e02a2d38
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
xio-openssl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/xio-openssl.c
+++ b/xio-openssl.c
@@ -1898,8 +1898,8 @@
case GEN_IPADD:
{
/* binary address format */
- const unsigned char *data = pName->d.iPAddress->data;
- size_t len = pName->d.iPAddress->length;
+ const unsigned char *data = ASN1_STRING_get0_data(pName->d.iPAddress);
+ size_t len = ASN1_STRING_length(pName->d.iPAddress);
char aBuffer[INET6_ADDRSTRLEN]; /* canonical peername */
struct in6_addr ip6bin;