Commit ce9b6530 authored by johan's avatar johan

Add the mbedtls set mtu wrapper

parent 648db06f
......@@ -520,6 +520,8 @@ BCTBX_PUBLIC bctbx_dtls_srtp_profile_t bctbx_ssl_get_dtls_srtp_protection_profil
BCTBX_PUBLIC int32_t bctbx_ssl_config_set_dtls_srtp_protection_profiles(bctbx_ssl_config_t *ssl_config, const bctbx_dtls_srtp_profile_t *profiles, size_t profiles_number);
BCTBX_PUBLIC int32_t bctbx_ssl_get_dtls_srtp_key_material(bctbx_ssl_context_t *ssl_ctx, char *output, size_t *output_length);
BCTBX_PUBLIC uint8_t bctbx_dtls_srtp_supported(void);
BCTBX_PUBLIC void bctbx_ssl_set_mtu(bctbx_ssl_context_t *ssl_ctx, uint16_t mtu);
/*****************************************************************************/
/***** Key exchanges defined algorithms *****/
......
......@@ -991,6 +991,11 @@ uint8_t bctbx_dtls_srtp_supported(void) {
return 1;
}
void bctbx_ssl_set_mtu(bctbx_ssl_context_t *ssl_ctx, uint16_t mtu) {
// remove the record expansion to the given MTU
mbedtls_ssl_set_mtu(&(ssl_ctx->ssl_ctx), mtu - mbedtls_ssl_get_record_expansion(&(ssl_ctx->ssl_ctx)));
}
static bctbx_dtls_srtp_profile_t bctbx_srtp_profile_mbedtls2bctoolbox(mbedtls_ssl_srtp_profile mbedtls_profile) {
switch (mbedtls_profile) {
case MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_80:
......@@ -1051,6 +1056,8 @@ uint8_t bctbx_dtls_srtp_supported(void) {
return 0;
}
void bctbx_ssl_set_mtu(bctbx_ssl_context_t *ssl_ctx, uint16_t mtu) { }
bctbx_dtls_srtp_profile_t bctbx_ssl_get_dtls_srtp_protection_profile(bctbx_ssl_context_t *ssl_ctx) {
return BCTBX_SRTP_UNDEFINED;
}
......
......@@ -833,6 +833,9 @@ int32_t bctbx_ssl_set_hostname(bctbx_ssl_context_t *ssl_ctx, const char *hostnam
}
/** DTLS SRTP functions **/
/* used for DTLS SRTP but not implemented on polarssl, available on mbedtls only */
void bctbx_ssl_set_mtu(bctbx_ssl_context_t *ssl_ctx, uint16_t mtu) { };
#ifdef HAVE_DTLS_SRTP
uint8_t bctbx_dtls_srtp_supported(void) {
return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment