Commit Graph

58 Commits (master)

Author SHA1 Message Date
Kareem 2cbf28d9e3 Use GPLv3 rather than GPLv3+. 2026-07-20 13:28:19 -07:00
Kareem a69521afa4 Update license from GPLv2 to GPLv3. 2026-07-20 10:37:26 -07:00
Kareem cf2455e95e Prepare for v5.9.2 release 2026-07-15 15:43:54 -07:00
Juliusz Sosinowicz 0446e8c73f Harden WolfSSLX509 constructor type discrimination
Compare interned cffi type objects instead of rendered type name
strings and raise TypeError for anything that is not a WOLFSSL* or
WOLFSSL_X509*.
2026-07-13 17:35:04 +00:00
Juliusz Sosinowicz 93954c9430 Return None from getpeercert when peer has no certificate (F-5623)
get_peer_x509() checked only whether the session was NULL and then built
a WolfSSLX509, whose __init__ called wolfSSL_get_peer_certificate() and
raised SSLError on NULL. On a valid connection where the peer presented
no certificate (e.g. a server not requesting a client cert), this raised
instead of returning None as the stdlib ssl getpeercert() contract
requires. Fetch the certificate in get_peer_x509(), return None when it
is NULL, and have WolfSSLX509 wrap the already-obtained pointer.
2026-06-24 12:27:57 +00:00
Juliusz Sosinowicz 3dd1b902e1 Send bytes-like data verbatim in SSLSocket.write (F-5622)
write() converted data with t2b(), which str()-encodes anything that is
not already bytes. Valid bytes-like inputs such as bytearray and
memoryview were transmitted as their Python repr ("bytearray(b'...')",
"<memory at ...>") instead of their contents, corrupting the stream.
Convert via the buffer protocol (bytes(memoryview(data))) and raise
TypeError for objects that are not bytes-like, matching the stdlib ssl
module.
2026-06-24 12:27:28 +00:00
Juliusz Sosinowicz 99a4416771 Drive DTLS handshake only until complete in I/O methods (F-4136)
For DTLS, write()/read()/recv_into() called do_handshake() on every
call. do_handshake() runs wolfSSL_accept/connect, which on a
non-blocking socket can raise SSLWantReadError and abort an I/O long
after the handshake finished, and made DTLS write-side behaviour
inconsistent with TCP. Track completion with a _handshake_complete
flag set on a successful do_handshake(), and only drive the handshake
from I/O methods while that flag is False.
2026-06-23 11:33:22 +00:00
Juliusz Sosinowicz 65aaef9750 Map WANT_WRITE from SSLSocket.recv_into() to SSLWantWriteError (F-3907)
recv_into() shares read()'s error-mapping pattern and inherited the
same omission: wolfSSL_read returning WOLFSSL_ERROR_WANT_WRITE (during
a renegotiation needing a write) was reported as a generic SSLError
instead of SSLWantWriteError, breaking non-blocking callers that
distinguish readiness directions. Add the WANT_WRITE branch.
2026-06-23 11:25:08 +00:00
Juliusz Sosinowicz d0bb56e6f9 Map WANT_WRITE from SSLSocket.read() to SSLWantWriteError (F-3906)
wolfSSL_read can return WOLFSSL_ERROR_WANT_WRITE when the SSL layer
must flush a handshake record (e.g. renegotiation) before returning
data. read() only handled WANT_READ, raising a generic SSLError
otherwise, which stops non-blocking callers from select()-ing on
writability. Add a WANT_WRITE branch raising SSLWantWriteError.
2026-06-23 11:24:40 +00:00
Juliusz Sosinowicz 41561e7ba6 Map WANT_READ from SSLSocket.write() to SSLWantReadError (F-3905)
wolfSSL_write can return WOLFSSL_ERROR_WANT_READ (e.g. during a
renegotiation that must read a record before progressing; secure
renegotiation is enabled by default). write() only handled WANT_WRITE,
so WANT_READ fell through to a generic SSLError and non-blocking
callers tore the session down. Add a WANT_READ branch raising
SSLWantReadError, matching do_handshake().
2026-06-23 11:24:10 +00:00
Jeremiah Mackey 7a1c3b0885 Guard shutdowns and clean up code 2026-04-14 17:10:36 +00:00
Jeremiah Mackey 2c4ba3c8d7 Fix low-severity issues 2026-04-02 16:32:27 +00:00
Jeremiah Mackey e1ede238e4 Fix wolfSSL_Init return type and check 2026-04-02 16:00:08 +00:00
Jeremiah Mackey c81c839a24 Free peer address on set_peer failure 2026-04-02 15:59:15 +00:00
Jeremiah Mackey 760cb466a7 Shutdown and free SSL in unwrap 2026-04-02 15:58:52 +00:00
Jeremiah Mackey 89667f9f7a Add null checks to version/pending 2026-04-02 15:53:32 +00:00
Jeremiah Mackey 84bd6375a2 Copy DER buffer in get_der 2026-04-02 15:52:47 +00:00
Jeremiah Mackey a406dce6c3 Add DTLS handshake to recv_into 2026-04-02 15:47:36 +00:00
Jeremiah Mackey a86dac7917 Use shlex.split in build call() 2026-03-19 16:24:26 +00:00
Jeremiah Mackey 63b1ee8d17 Enforce CERT_REQUIRED for check_hostname 2026-03-19 16:02:17 +00:00
Jeremiah Mackey e15bf07408 Null native_object after CTX_free 2026-03-19 15:52:11 +00:00
Jeremiah Mackey 5e77b6cbcb Check wolfSSL_write return value 2026-03-19 15:51:03 +00:00
Jeremiah Mackey 40b35a4e36 Free X509 in WolfSSLX509.__del__ 2026-03-19 15:46:53 +00:00
Jeremiah Mackey c5ed261a4e Return None from get_peer_x509 2026-03-19 15:46:06 +00:00
Jeremiah Mackey ad2f7c6046 Fix wrong alert description function 2026-03-19 15:45:34 +00:00
Jeremiah Mackey 9a73852678 Check wolfSSL_check_domain_name return 2026-03-19 15:41:42 +00:00
Jeremiah Mackey 08737fab72 Fix wrap_socket server_side mismatch 2026-03-19 15:40:31 +00:00
Chris Conlon a6c28b9183 Fix USE_LOCAL_WOLFSSL with static-only builds and add .dylib support 2026-03-02 15:54:52 -07:00
Chris Conlon 8b3adf3023 Fix silent NameError when CFFI bindings are missing, adds _FFIPlaceholder that raises ImportError with instructions 2026-03-02 15:54:48 -07:00
Kareem 0073fec796 Prepare for v5.8.4 release 2025-12-29 16:37:31 -07:00
Kareem b4517dece7 Fix CERT_REQUIRED verify mode not setting SSL_VERIFY_FAIL_IF_NO_PEER_CERT and therefore failing to verify the client cert.
Thanks to Matan Radomski for the report.
2025-12-15 11:58:26 -07:00
Lealem Amedie 71742e399a Prepare for v5.8.2 release 2025-07-24 12:37:50 -06:00
Lealem Amedie e601a8bce4 Prepare for v5.7.4 2024-11-13 14:05:55 -07:00
Reda Chouk 4712cfba90 prepare for v5.7.2 release 2024-09-12 10:40:53 +02:00
Marco Oliverio ab486a32bd wolfssl-py: support disabling secure renegotiation
Use environment variable WOLFSSLPY_DISABLE_SCR to build with secure
renegotiation disabled.
2024-08-19 16:34:19 +00:00
Marco Oliverio 4064227489 SSLSocket: support version() method 2024-07-18 18:53:27 +00:00
Lealem Amedie 6ba654c216 Update to version 5.6.6 2024-01-23 18:39:54 +01:00
Anthony Hu 2da4d19d95 Rephrase error message. 2023-11-27 11:40:24 -05:00
ZackLabPC 2a19d75d79 segfault issue fix from urllib3 tests 2023-08-04 13:37:11 -06:00
Daniele Lacamera 0443855b1b Updating wolfSSL to v5.6.0 2023-05-02 12:38:28 +02:00
Daniele Lacamera 0976f9bde9 Prepare release 5.5.4 2022-12-30 17:27:39 +01:00
Daniele Lacamera 91f0e85445 Update to version 5.5.3 2022-11-03 14:37:54 +01:00
Hayden Roche 636fa9cc8d Fix alert history code.
Because we access the fields of WOLFSSL_ALERT_HISTORY and WOLFSSL_ALERT directly
in do_handshake, these structs can't be opaque, or an exception will be raised
by FFI.
2022-09-30 17:59:40 +02:00
Lealem Amedie 6e712f8164 Bump version to 5.5.0 2022-08-31 13:28:10 -07:00
Lealem Amedie 1f88948c51 Adding DTLS13 support 2022-08-29 23:00:52 -07:00
Lealem Amedie 7c436817e7 Removing deleted wolfSSL build macro 2022-08-29 23:00:52 -07:00
Lealem Amedie e26560bf55 Adding DTLS support 2022-08-29 23:00:52 -07:00
Lealem Amedie 8117569866 Adding CRL support 2022-08-29 23:00:52 -07:00
Andrew Hutchings aea5844a10 Add support for disable-oldtls
If wolfSSL is build with `--disable-oldtls` then we need to support
this. Otherwise link errors will occur.
2022-07-22 13:20:13 +01:00
Andrew Hutchings 9d22a85445 Fix TLSv1.3 support
There were some missing pieces to the TLSv1.3 support, this adds them in
along with tests.
2022-07-15 11:07:43 +01:00