package/gloox: fix build with OpenSSL 4.0.0

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Bernd Kuhls
2026-09-27 12:42:23 +02:00
committed by Thomas Petazzoni
parent 061a33b36a
commit 79e1d59d27

View File

@@ -0,0 +1,43 @@
From 69c49c945aa3847eb12a995f949d97a2a99642f6 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Wed, 9 Sep 2026 23:27:07 +0200
Subject: [PATCH] Fix build with OpenSSL 4.x
Upstream: dead
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
src/tlsopensslbase.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/tlsopensslbase.cpp b/src/tlsopensslbase.cpp
index bfa1fd9..a71ff11 100644
--- a/src/tlsopensslbase.cpp
+++ b/src/tlsopensslbase.cpp
@@ -224,12 +224,12 @@ namespace gloox
int OpenSSLBase::ASN1Time2UnixTime( ASN1_TIME* time )
{
struct tm t;
- const char* str = reinterpret_cast<const char*>( time->data );
+ const char* str = reinterpret_cast<const char*>( ASN1_STRING_get0_data(time) );
size_t i = 0;
memset( &t, 0, sizeof(t) );
- if( time->type == V_ASN1_UTCTIME ) /* two digit year */
+ if( ASN1_STRING_type(time) == V_ASN1_UTCTIME ) /* two digit year */
{
t.tm_year = ( str[i++] - '0' ) * 10;
t.tm_year += ( str[i++] - '0' );
@@ -237,7 +237,7 @@ namespace gloox
if( t.tm_year < 70 )
t.tm_year += 100;
}
- else if( time->type == V_ASN1_GENERALIZEDTIME ) /* four digit year */
+ else if( ASN1_STRING_type(time) == V_ASN1_GENERALIZEDTIME ) /* four digit year */
{
t.tm_year = ( str[i++] - '0' ) * 1000;
t.tm_year += ( str[i++] - '0' ) * 100;
--
2.47.3