v3.31.2: the SCP81 TLS-PSK Python floor, documented and guarded
release / release (push) Waiting to run

ssl's TLS-PSK callbacks (PskTlsServer) exist only since Python 3.13 - the
first CI run on 3.12 errored in all 20 PSK tests, and the docs confirm
"Added in version 3.13".

- PskTlsServer._make_context raises a clear RuntimeError naming the
  requirement instead of AttributeError; a source pin keeps the guard.
- tests/test_scp81.py skips PskTlsServerTest where the callbacks are
  missing (it runs on 3.13+), so contributors on 3.9-3.12 no longer see
  20 failures.
- The READMEs state the requirement, and the Windows notes now strongly
  recommend Python 3.13: pyscard has wheels up to 3.13, and on 3.14
  pyscard and some pysim dependency wheels are unavailable and build
  from source (MSVC).  setup.bat and setup.sh print the same guidance.
- Version strings + the PWA cache bumped together (simple-v457).

998 Python + 953 frontend green.
This commit is contained in:
2026-10-20 23:47:10 +03:00
parent bccca45486
commit 2237a35db5
10 changed files with 43 additions and 13 deletions
+6
View File
@@ -18,6 +18,7 @@ DATA records to it.
import socket
import ssl
import sys
import threading
import time
@@ -252,6 +253,11 @@ class PskTlsServer:
# SSLV3_ALERT_UNEXPECTED_MESSAGE on the post-handshake
# NewSessionTicket record (verified live 2026-09-15).
ctx.options |= ssl.OP_NO_TICKET
if not hasattr(ctx, 'set_psk_server_callback'):
# ssl's TLS-PSK callbacks exist only since Python 3.13.
raise RuntimeError(
'TLS-PSK requires Python 3.13+ (ssl.SSLContext.set_psk_server_callback '
'is missing in %s)' % sys.version.split()[0])
ctx.set_psk_server_callback(self._psk_cb)
return ctx
+1 -1
View File
@@ -37,7 +37,7 @@ from osmocom.tlv import BER_TLV_IE
from osmocom.utils import rpad
VERSION = '3.31.1'
VERSION = '3.31.2'
MAX_ENVELOPE_SEGMENTS = 5 # max SMS segments for outgoing C-APDU in ENVELOPE