From e2a8124fa6b4c44f50541faa6aa3553e0a87408c Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Sat, 22 Nov 2025 17:51:22 +0100 Subject: [PATCH] asn1.py: treat asn1_string_st as opaque OpenSSL 4 plans to make ASN1_STRING opaque [1]. Using a forward declaration rather than a redefinition avoids the build breakage in cryptography's cffi when it tries to validate the sizes of the members. [1]: https://github.com/openssl/openssl/issues/29117 --- src/_cffi_src/openssl/asn1.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/_cffi_src/openssl/asn1.py b/src/_cffi_src/openssl/asn1.py index 39e8fef82064..37029442c47b 100644 --- a/src/_cffi_src/openssl/asn1.py +++ b/src/_cffi_src/openssl/asn1.py @@ -12,19 +12,11 @@ typedef int... time_t; typedef ... ASN1_INTEGER; - -struct asn1_string_st { - int length; - int type; - unsigned char *data; - long flags; -}; - -typedef struct asn1_string_st ASN1_OCTET_STRING; -typedef struct asn1_string_st ASN1_IA5STRING; -typedef struct asn1_string_st ASN1_TIME; +typedef ... ASN1_OCTET_STRING; +typedef ... ASN1_IA5STRING; +typedef ... ASN1_TIME; typedef ... ASN1_OBJECT; -typedef struct asn1_string_st ASN1_STRING; +typedef ... ASN1_STRING; typedef ... ASN1_GENERALIZEDTIME; typedef ... ASN1_ENUMERATED;