net/poco: fix build with opaque ASN1_STRING

This commit is contained in:
tb
2026-03-12 19:48:28 +00:00
parent 1e3cc77eb0
commit 6be2dc0e89
2 changed files with 28 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ COMMENT = POCO C++ libraries for network based applications
VERSION = 1.4.6p1
DISTNAME = poco-${VERSION}-all
PKGNAME = poco-${VERSION:S/p/pl/}
REVISION = 8
REVISION = 9
CATEGORIES = net devel
SHLIB_VERSION = 1.0
@@ -10,3 +10,30 @@ Index: Crypto/src/X509Certificate.cpp
}
init();
@@ -254,7 +254,7 @@ void X509Certificate::extractNames(std::string& cmnNam
const GENERAL_NAME* name = sk_GENERAL_NAME_value(names, i);
if (name->type == GEN_DNS)
{
- const char* data = reinterpret_cast<char*>(ASN1_STRING_data(name->d.ia5));
+ const char* data = reinterpret_cast<const char*>(ASN1_STRING_get0_data(name->d.ia5));
std::size_t len = ASN1_STRING_length(name->d.ia5);
domainNames.insert(std::string(data, len));
}
@@ -273,7 +273,7 @@ void X509Certificate::extractNames(std::string& cmnNam
Poco::DateTime X509Certificate::validFrom() const
{
ASN1_TIME* certTime = X509_get_notBefore(_pCert);
- std::string dateTime(reinterpret_cast<char*>(certTime->data));
+ std::string dateTime(reinterpret_cast<const char*>(ASN1_STRING_get0_data(certTime)));
int tzd;
return DateTimeParser::parse("%y%m%d%H%M%S", dateTime, tzd);
}
@@ -282,7 +282,7 @@ Poco::DateTime X509Certificate::validFrom() const
Poco::DateTime X509Certificate::expiresOn() const
{
ASN1_TIME* certTime = X509_get_notAfter(_pCert);
- std::string dateTime(reinterpret_cast<char*>(certTime->data));
+ std::string dateTime(reinterpret_cast<const char*>(ASN1_STRING_get0_data(certTime)));
int tzd;
return DateTimeParser::parse("%y%m%d%H%M%S", dateTime, tzd);
}