Hello,

I am trying to test a device’s conformance to IEC62351-3 which defines some rules about TLS implementations, in particular im wondering if it’s possible to:

Use mbedtls on a TLS server to accept a session resumption when a client sends a ClientHello message with a session ID in an ongoing TLS session.


Also RFC 5246 says this about resumption for tls v1.2:

The ClientHello message includes a variable-length session
identifier. If not empty, the value identifies a session between the
same client and server whose security parameters the client wishes to
reuse. The session identifier MAY be from an earlier connection,
this connection, or from another currently active connection.


so it should be possible to resume in an ongoing session but:

I already have a working implementation of a TLS 1.2 server using mbedtls 2.28, but if a client sends a clienthello with a session ID in an ongoing session, the server always responds with a renegotiation by default.


Taking a look at the library code i tried to change the function:

static void ssl_handle_id_based_session_resumption(mbedtls_ssl_context *ssl)

found in the file ssl_srv.c in mbedtls 2.28,


and removed a check which skipped resumption if a client hello was received during a session, this does not work properly however because the server closes the connection after sending the finished message due to a MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR.


Im wondering if there is anyway to allow resumption in this manner using mbedtls or if im doing something wrong? If you require further information please let me know and i will try to add as much as i can!






1741361442716
Tommaso Mancini
SEL S.p.A.
R&D Software and Test Engineer
Via Amendola 9,11,13,15,17
51035 Lamporecchio (PT) 
Tel. +39 0573 80051
Fax +39 0573 803110
                                                               e-mailtommaso.mancini@sel-electric.it
Questo è un messaggio di posta elettronica proveniente da SEL s.p.a. Le informazioni contenut in questa comunicazione sono altamente riservate e possono essere utilizzate solo dalla persona o dall’ente cui sono destinate. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente. Grazie. This communication is intended only for use by the addressee. It may contain confidential or privileged information. Transmission cannot be guaranteed to be secure or error-free. If you receive this communication unintentionally, please inform us immediately. Thank you.
Per favore, pensa all’ambiente prima di stampare. Please, consider the environment before you print.