Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133623: Add ssl.HAS_PSK_TLS13 to detect external TLS 1.3 PSK support#133624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
picnixz merged 9 commits intopython:mainfromWillChilds-Klein:has-psk-tls13
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletionsDoc/library/ssl.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -934,6 +934,13 @@ Constants

.. versionadded:: 3.13

.. data:: HAS_PSK_TLS13

Whether the OpenSSL library has built-in support for External PSKs in TLS
1.3 as described in :rfc:`9258`.

.. versionadded:: 3.15

.. data:: HAS_PHA

Whether the OpenSSL library has built-in support for TLS-PHA.
Expand Down
8 changes: 5 additions & 3 deletionsDoc/whatsnew/3.15.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,10 +86,12 @@ New modules
Improved modules
================

module_name
-----------
ssl
---

* TODO
* Indicate through :data:`ssl.HAS_PSK_TLS13` whether the :mod:`ssl` module supports
"External PSKs" in TLSv1.3, as described in RFC 9258.
(Contributed by Will Childs-Klein in :gh:`133624`.)

.. Add improved modules above alphabetically, not here at the end.

Expand Down
2 changes: 1 addition & 1 deletionLib/ssl.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -116,7 +116,7 @@

from _ssl import (
HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN, HAS_SSLv2, HAS_SSLv3, HAS_TLSv1,
HAS_TLSv1_1, HAS_TLSv1_2, HAS_TLSv1_3, HAS_PSK, HAS_PHA
HAS_TLSv1_1, HAS_TLSv1_2, HAS_TLSv1_3, HAS_PSK,HAS_PSK_TLS13,HAS_PHA
)
from _ssl import _DEFAULT_CIPHERS, _OPENSSL_API_VERSION

Expand Down
1 change: 1 addition & 0 deletionsLib/test/test_ssl.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4488,6 +4488,7 @@ def server_callback(identity):

@requires_tls_version('TLSv1_3')
@unittest.skipUnless(ssl.HAS_PSK, 'TLS-PSK disabled on this OpenSSL build')
@unittest.skipUnless(ssl.HAS_PSK_TLS13, 'TLS 1.3 PSK disabled on this OpenSSL build')
def test_psk_tls1_3(self):
psk = bytes.fromhex('deadbeef')
identity_hint = 'identity-hint'
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
Indicate through :data:`ssl.HAS_PSK_TLS13` whether the :mod:`ssl` module supports "External PSKs" in TLSv1.3, as described in RFC 9258. Patch by Will Childs-Klein.
6 changes: 6 additions & 0 deletionsModules/_ssl.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6626,6 +6626,12 @@ sslmodule_init_constants(PyObject *m)
addbool(m, "HAS_PSK", 1);
#endif

#ifdef OPENSSL_NO_EXTERNAL_PSK_TLS13
addbool(m, "HAS_PSK_TLS13", 0);
#else
addbool(m, "HAS_PSK_TLS13", 1);
#endif

#ifdef SSL_VERIFY_POST_HANDSHAKE
addbool(m, "HAS_PHA", 1);
#else
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp