← Commit list

76847b05e3

Stefan Eissing
Stefan Eissing
2026-09-08
SUCCESS Duration: 392s

Subject

mbedtls: fix ticket handling

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/vtls/mbedtls.c+18 -2
@@ -1275,6 +1275,9 @@ static CURLcode mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data,
int nwritten;
DEBUGASSERT(backend);
+#ifdef MBEDTLS_SSL_PROTO_TLS1_3
+do_send:
+#endif
*pnwritten = 0;
connssl->io_need = CURL_SSL_IO_NEED_NONE;
/* mbedTLS is picky when a mbedtls_ssl_write() was previously blocked.
@@ -1300,6 +1303,12 @@ static CURLcode mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data,
switch(nwritten) {
#ifdef MBEDTLS_SSL_PROTO_TLS1_3
case MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET:
+ result = mbed_new_session(cf, data);
+ /* This return code is not blocking. Having treated the new
+ * ticket, resume sending until we get a "real" result. */
+ if(!result)
+ goto do_send;
+ break;
#endif
case MBEDTLS_ERR_SSL_WANT_READ:
connssl->io_need = CURL_SSL_IO_NEED_RECV;
@@ -1448,6 +1457,9 @@ static CURLcode mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
int nread;
DEBUGASSERT(backend);
+#ifdef MBEDTLS_SSL_SESSION_TICKETS
+do_read:
+#endif
*pnread = 0;
connssl->io_need = CURL_SSL_IO_NEED_NONE;
@@ -1461,8 +1473,12 @@ static CURLcode mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
switch(nread) {
#ifdef MBEDTLS_SSL_SESSION_TICKETS
case MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET:
- mbed_new_session(cf, data);
- FALLTHROUGH();
+ result = mbed_new_session(cf, data);
+ /* This is not blocking anything. We can try again until a
+ * "real" result comes. */
+ if(!result)
+ goto do_read;
+ break;
#endif
case MBEDTLS_ERR_SSL_WANT_READ:
connssl->io_need = CURL_SSL_IO_NEED_RECV;