| 1 |
Description: Use accessors on ASN1_STRING for OpenSSL 4 compatibility |
| 2 |
In OpenSSL 4, ASN1_STRING is an opaque type. The members `data` and |
| 3 |
`length` are no longer publicly visible, so accessor functions must |
| 4 |
be used instead. |
| 5 |
Author: Brent Kerby <[email protected]> |
| 6 |
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=180181 |
| 7 |
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libpoe-filter-ssl-perl/+bug/2154857 |
| 8 |
Bug-Debian: http://bugs.debian.org/1138310 |
| 9 |
Last-Update: 2026-07-21 |
| 10 |
=================================================================== |
| 11 |
--- a/SSL.xs |
| 12 |
+++ b/SSL.xs |
| 13 |
@@ -55,7 +55,7 @@ |
| 14 |
CODE: |
| 15 |
RETVAL = X509_get_serialNumber(cert); |
| 16 |
ST(0) = sv_newmortal(); /* Undefined to start with */ |
| 17 |
- sv_setpvn( ST(0), RETVAL->data, RETVAL->length); |
| 18 |
+ sv_setpvn( ST(0), ASN1_STRING_get0_data(RETVAL), ASN1_STRING_length(RETVAL)); |
| 19 |
|
| 20 |
ASN1_INTEGER * |
| 21 |
POE_FILTER_verify_serial_against_crl_file(crlfile, serial) |
| 22 |
@@ -101,10 +101,10 @@ |
| 23 |
|
| 24 |
revoked = sk_X509_REVOKED_value(revokes, i); |
| 25 |
asn_ser = X509_REVOKED_get0_serialNumber(revoked); |
| 26 |
- if ( (asn_ser->length > 0) && |
| 27 |
- (asn_ser->length == lenser) && |
| 28 |
- (strncmp(asn_ser->data, serial, lenser) == 0)) { |
| 29 |
- sv_setpvn( ST(0), asn_ser->data, asn_ser->length); |
| 30 |
+ if ( (ASN1_STRING_length(asn_ser) > 0) && |
| 31 |
+ (ASN1_STRING_length(asn_ser) == lenser) && |
| 32 |
+ (strncmp(ASN1_STRING_get0_data(asn_ser), serial, lenser) == 0)) { |
| 33 |
+ sv_setpvn( ST(0), ASN1_STRING_get0_data(asn_ser), ASN1_STRING_length(asn_ser)); |
| 34 |
goto end; |
| 35 |
} |
| 36 |
} |