From e79c1e812147c95572a5abc887f10058ea88f4fc Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Tue, 22 Sep 2020 15:51:27 +0200 Subject: [PATCH] style Signed-off-by: Johan Pascal --- include/mbedtls/config.h | 4 ++-- include/mbedtls/ssl.h | 8 ++++---- library/ssl_cli.c | 11 +++++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index 7a1a2b1e5..2b123388e 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -1817,8 +1817,8 @@ * * Enable support for DTLS-SRTP, RFC5764, use_srtp extension. * \note Only the dtls-srtp key material negotiation is supported. - * Once negotiated, the key should be extracted, and data should be transmitted - * via an SRTP stack. + * Once negotiated, the key should be extracted using mbedtls_ssl_tls_prf() + * and data should be transmitted via an SRTP stack. * * Requires: MBEDTLS_SSL_PROTO_DTLS * diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index d0007fc9f..bae5348d3 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -3190,13 +3190,13 @@ static inline const char *mbedtls_ssl_get_srtp_profile_as_string ( mbedtls_ssl_s switch( profile ) { case MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80: - return "MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80"; + return( "MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" ); case MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32: - return "MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32"; + return( "MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" ); case MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80: - return "MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80"; + return( "MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" ); case MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32: - return "MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32"; + return( "MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" ); default: break; } return( "" ); diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 39547684e..0eaeefa10 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -800,9 +800,9 @@ static void ssl_write_use_srtp_ext( mbedtls_ssl_context *ssl, *p++ = (unsigned char)( ext_len & 0xFF ); /* protection profile length: 2*(ssl->conf->dtls_srtp_profile_list_len) */ - *p++ = (unsigned char)( ( ( 2 * (ssl->conf->dtls_srtp_profile_list_len) ) + *p++ = (unsigned char)( ( ( 2 * ssl->conf->dtls_srtp_profile_list_len ) >> 8 ) & 0xFF ); - *p++ = (unsigned char)( ( 2 * (ssl->conf->dtls_srtp_profile_list_len) ) + *p++ = (unsigned char)( ( 2 * ssl->conf->dtls_srtp_profile_list_len ) & 0xFF ); for( protection_profiles_index=0; @@ -824,8 +824,11 @@ static void ssl_write_use_srtp_ext( mbedtls_ssl_context *ssl, * Note: we shall never arrive here as protection profiles * is checked by ssl_set_dtls_srtp_protection_profiles function */ - MBEDTLS_SSL_DEBUG_MSG( 3, ( "client hello, ignore illegal DTLS-SRTP protection profile %d", - ssl->conf->dtls_srtp_profile_list[protection_profiles_index] ) ); + MBEDTLS_SSL_DEBUG_MSG( 3, + ( "client hello, " + "ignore illegal DTLS-SRTP protection profile %d", + ssl->conf->dtls_srtp_profile_list[protection_profiles_index] + ) ); } }