Skip to content

Conversation

@davidben
Copy link
Contributor

@davidben davidben commented Nov 20, 2025

While ASN1_STRING is currently exposed, it is better to use the accessors. See openssl/openssl#29117 where, if the type were opaque, OpenSSL's X509 objects could be much more memory-efficient.

While ASN1_STRING is currently exposed, it is better to use the
accessors. See openssl/openssl#29117 where, if
the type were opaque, OpenSSL's X509 objects could be much more
memory-efficient.
@davidben
Copy link
Contributor Author

Don't think this needs a NEWS entry, but happy to add one if you all prefer:

strictly internal changes with no user-visible effects

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When were those macros added? and are they available on alternative implementations of libssl?

davidben and others added 2 commits November 22, 2025 16:54
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@davidben
Copy link
Contributor Author

When were those macros added? and are they available on alternative implementations of libssl?

1.1.0 I believe. And yes, they're in BoringSSL and LibreSSL.

@picnixz
Copy link
Member

picnixz commented Nov 22, 2025

Considering AWS-LC tests are fine, I think we can make that change.

@gpshead gpshead added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Nov 22, 2025
@gpshead gpshead merged commit c41fce0 into python:main Nov 22, 2025
52 checks passed
@miss-islington-app
Copy link

Thanks @davidben for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 22, 2025
…onGH-141802)

* pythongh-141801: Use accessors for ASN1_STRING fields

While ASN1_STRING is currently exposed, it is better to use the
accessors. See openssl/openssl#29117 where, if
the type were opaque, OpenSSL's X509 objects could be much more
memory-efficient.

* Update Modules/_ssl.c

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Update Modules/_ssl.c

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

---------
(cherry picked from commit c41fce0)

Co-authored-by: David Benjamin <davidben@davidben.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 22, 2025

GH-141847 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Nov 22, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 22, 2025
…onGH-141802)

* pythongh-141801: Use accessors for ASN1_STRING fields

While ASN1_STRING is currently exposed, it is better to use the
accessors. See openssl/openssl#29117 where, if
the type were opaque, OpenSSL's X509 objects could be much more
memory-efficient.

* Update Modules/_ssl.c

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Update Modules/_ssl.c

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

---------
(cherry picked from commit c41fce0)

Co-authored-by: David Benjamin <davidben@davidben.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 22, 2025

GH-141848 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 22, 2025
gpshead pushed a commit that referenced this pull request Nov 22, 2025
…141802) (#141847)

gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802)

* gh-141801: Use accessors for ASN1_STRING fields

While ASN1_STRING is currently exposed, it is better to use the
accessors. See openssl/openssl#29117 where, if
the type were opaque, OpenSSL's X509 objects could be much more
memory-efficient.

* Update Modules/_ssl.c



* Update Modules/_ssl.c



---------
(cherry picked from commit c41fce0)

Co-authored-by: David Benjamin <davidben@davidben.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gpshead pushed a commit that referenced this pull request Nov 22, 2025
…141802) (#141848)

gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802)

* gh-141801: Use accessors for ASN1_STRING fields

While ASN1_STRING is currently exposed, it is better to use the
accessors. See openssl/openssl#29117 where, if
the type were opaque, OpenSSL's X509 objects could be much more
memory-efficient.

* Update Modules/_ssl.c



* Update Modules/_ssl.c



---------
(cherry picked from commit c41fce0)

Co-authored-by: David Benjamin <davidben@davidben.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants