Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing setter for conf->new_session_tickets_count #313

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

Kazurin-775
Copy link

The file include/mbedtls/ssl.h in MbedTLS contains a setter for conf->new_session_tickets_count, which determines the number of new TLS session tickets generated for each session:

#if defined(MBEDTLS_SSL_SESSION_TICKETS) && \
    defined(MBEDTLS_SSL_SRV_C) && \
    defined(MBEDTLS_SSL_PROTO_TLS1_3)
void mbedtls_ssl_conf_new_session_tickets(mbedtls_ssl_config *conf,
                                          uint16_t num_tickets);
#endif

However, the correspoding Rust wrapper is missing, potentially due to this function being available only when MBEDTLS_SSL_PROTO_TLS1_3 is defined (which is not the case for the default configuration).

We should add this setter back when the tls13 feature is enabled:

  #[cfg(feature = "tls13")]
  setter!(
      set_new_session_tickets_count(cnt: u16) = ssl_conf_new_session_tickets
  );

This option determines the number of new session tickets generated for
each session, and is only present when `MBEDTLS_SSL_PROTO_TLS1_3` is set.

We should add a setter for this option when the `tls13` feature is
enabled.
@Taowyoo
Copy link
Collaborator

Taowyoo commented Sep 8, 2023

Thank you for creating this PR.
I also need to inform that: the TLS 1.3 in C mbedtls 3.X is not thread safe, so it's not recommend to use rust-mbedtls 0.10 and 0.11 for TLS 1.3.
Since some other user may need to just use crypto part of mbedtls, we did not yank the rust-mbedtls versions based on mbedtls 3.X.
Will update above in the README.

@Taowyoo Taowyoo merged commit 261150d into fortanix:master Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants