@@ -519,6 +519,7 @@ global:
l_tls_set_version_range;
l_tls_set_domain_mask;
l_tls_set_session_cache;
+ l_tls_get_session_resumed;
l_tls_alert_to_str;
l_tls_set_debug;
l_tls_set_cert_dump_path;
@@ -266,6 +266,7 @@ struct l_tls {
uint8_t session_cipher_suite_id[2];
uint8_t session_compression_method_id;
char *session_peer_identity;
+ bool session_resumed;
struct {
bool secure_renegotiation;
@@ -213,6 +213,7 @@ static void tls_reset_handshake(struct l_tls *tls)
tls->session_id_size_replaced = 0;
tls->session_id_new = false;
l_free(l_steal_ptr(tls->session_peer_identity));
+ tls->session_resumed = false;
}
static void tls_cleanup_handshake(struct l_tls *tls)
@@ -3058,6 +3059,7 @@ static void tls_finished(struct l_tls *tls)
TLS_SET_STATE(TLS_HANDSHAKE_DONE);
tls->ready = true;
+ tls->session_resumed = resuming;
if (session_update && tls->session_update_cb) {
tls->in_callback = true;
@@ -3841,6 +3843,14 @@ LIB_EXPORT void l_tls_set_session_cache(struct l_tls *tls,
tls->session_prefix = l_strdup(group_prefix);
}
+LIB_EXPORT bool l_tls_get_session_resumed(struct l_tls *tls)
+{
+ if (unlikely(!tls || !tls->ready))
+ return false;
+
+ return tls->session_resumed;
+}
+
LIB_EXPORT const char *l_tls_alert_to_str(enum l_tls_alert_desc desc)
{
switch (desc) {
@@ -134,6 +134,7 @@ void l_tls_set_session_cache(struct l_tls *tls, struct l_settings *settings,
unsigned int max_sessions,
l_tls_session_update_cb_t update_cb,
void *user_data);
+bool l_tls_get_session_resumed(struct l_tls *tls);
const char *l_tls_alert_to_str(enum l_tls_alert_desc desc);