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

Commit6801bd3

Browse files
gh-133623: Addssl.HAS_PSK_TLS13 to detect external TLS 1.3 PSK support (#133624)
1 parentf77dac6 commit6801bd3

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

‎Doc/library/ssl.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,13 @@ Constants
934934

935935
..versionadded::3.13
936936

937+
..data::HAS_PSK_TLS13
938+
939+
Whether the OpenSSL library has built-in support for External PSKs in TLS
940+
1.3 as described in:rfc:`9258`.
941+
942+
..versionadded::next
943+
937944
..data::HAS_PHA
938945

939946
Whether the OpenSSL library has built-in support for TLS-PHA.

‎Doc/whatsnew/3.15.rst‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,13 @@ New modules
8686
Improved modules
8787
================
8888

89-
module_name
90-
-----------
89+
ssl
90+
---
91+
92+
* Indicate through:data:`ssl.HAS_PSK_TLS13` whether the:mod:`ssl` module
93+
supports "External PSKs" in TLSv1.3, as described in RFC 9258.
94+
(Contributed by Will Childs-Klein in:gh:`133624`.)
9195

92-
* TODO
9396

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

‎Lib/ssl.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117
from_sslimport (
118118
HAS_SNI,HAS_ECDH,HAS_NPN,HAS_ALPN,HAS_SSLv2,HAS_SSLv3,HAS_TLSv1,
119-
HAS_TLSv1_1,HAS_TLSv1_2,HAS_TLSv1_3,HAS_PSK,HAS_PHA
119+
HAS_TLSv1_1,HAS_TLSv1_2,HAS_TLSv1_3,HAS_PSK,HAS_PSK_TLS13,HAS_PHA
120120
)
121121
from_sslimport_DEFAULT_CIPHERS,_OPENSSL_API_VERSION
122122

‎Lib/test/test_ssl.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4488,6 +4488,7 @@ def server_callback(identity):
44884488

44894489
@requires_tls_version('TLSv1_3')
44904490
@unittest.skipUnless(ssl.HAS_PSK,'TLS-PSK disabled on this OpenSSL build')
4491+
@unittest.skipUnless(ssl.HAS_PSK_TLS13,'TLS 1.3 PSK disabled on this OpenSSL build')
44914492
deftest_psk_tls1_3(self):
44924493
psk=bytes.fromhex('deadbeef')
44934494
identity_hint='identity-hint'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

‎Modules/_ssl.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6626,6 +6626,12 @@ sslmodule_init_constants(PyObject *m)
66266626
addbool(m,"HAS_PSK",1);
66276627
#endif
66286628

6629+
#ifdefOPENSSL_NO_EXTERNAL_PSK_TLS13
6630+
addbool(m,"HAS_PSK_TLS13",0);
6631+
#else
6632+
addbool(m,"HAS_PSK_TLS13",1);
6633+
#endif
6634+
66296635
#ifdefSSL_VERIFY_POST_HANDSHAKE
66306636
addbool(m,"HAS_PHA",1);
66316637
#else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp