diff --git a/library/ssl_cli.c b/library/ssl_cli.c index a3e027e1d..223f582c4 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -1909,7 +1909,8 @@ static int ssl_parse_use_srtp_ext( mbedtls_ssl_context *ssl, */ for( i=0; i < ssl->conf->dtls_srtp_profile_list_len; i++) { - if( server_protection == ssl->conf->dtls_srtp_profile_list[i] ) { + if( server_protection == ssl->conf->dtls_srtp_profile_list[i] ) + { ssl->dtls_srtp_info.chosen_dtls_srtp_profile = ssl->conf->dtls_srtp_profile_list[i]; MBEDTLS_SSL_DEBUG_MSG( 3, ( "selected srtp profile: %s", mbedtls_ssl_get_srtp_profile_as_string( diff --git a/library/ssl_srv.c b/library/ssl_srv.c index 007d9e41a..60de57b1c 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -885,7 +885,7 @@ static int ssl_parse_use_srtp_ext( mbedtls_ssl_context *ssl, { ssl->dtls_srtp_info.mki_len = mki_length; - memcpy(ssl->dtls_srtp_info.mki_value, buf, mki_length); + memcpy( ssl->dtls_srtp_info.mki_value, buf, mki_length ); MBEDTLS_SSL_DEBUG_BUF( 3, "using mki", ssl->dtls_srtp_info.mki_value, ssl->dtls_srtp_info.mki_len ); @@ -2065,10 +2065,10 @@ read_record_header: case MBEDTLS_TLS_EXT_USE_SRTP: MBEDTLS_SSL_DEBUG_MSG( 3, ( "found use_srtp extension" ) ); - if ( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) + if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) { ret = ssl_parse_use_srtp_ext( ssl, ext + 4, ext_size ); - if ( ret != 0 ) + if( ret != 0 ) return( ret ); } break; @@ -2992,7 +2992,7 @@ static int ssl_write_server_hello( mbedtls_ssl_context *ssl ) #endif #if defined(MBEDTLS_SSL_DTLS_SRTP) - if ( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) + if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) { ssl_write_use_srtp_ext( ssl, p + 2 + ext_len, &olen ); ext_len += olen; diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 8dec7f10a..7cb5b8ccf 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -4700,7 +4700,7 @@ int mbedtls_ssl_dtls_srtp_set_mki_value( mbedtls_ssl_context *ssl, unsigned char *mki_value, uint16_t mki_len ) { - if ( mki_len > MBEDTLS_TLS_SRTP_MAX_MKI_LENGTH ) + if( mki_len > MBEDTLS_TLS_SRTP_MAX_MKI_LENGTH ) { return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA ); } @@ -4727,7 +4727,7 @@ int mbedtls_ssl_conf_dtls_srtp_protection_profiles( mbedtls_ssl_config *conf, list_size <= MBEDTLS_TLS_SRTP_MAX_PROFILE_LIST_LENGTH; p++ ) { - if ( mbedtls_ssl_check_srtp_profile_value( *p ) != MBEDTLS_TLS_SRTP_UNSET ) + if( mbedtls_ssl_check_srtp_profile_value( *p ) != MBEDTLS_TLS_SRTP_UNSET ) { list_size++; } @@ -4738,7 +4738,7 @@ int mbedtls_ssl_conf_dtls_srtp_protection_profiles( mbedtls_ssl_config *conf, } } - if ( list_size > MBEDTLS_TLS_SRTP_MAX_PROFILE_LIST_LENGTH ) + if( list_size > MBEDTLS_TLS_SRTP_MAX_PROFILE_LIST_LENGTH ) { conf->dtls_srtp_profile_list = NULL; conf->dtls_srtp_profile_list_len = 0; @@ -4751,18 +4751,20 @@ int mbedtls_ssl_conf_dtls_srtp_protection_profiles( mbedtls_ssl_config *conf, return( 0 ); } -void mbedtls_ssl_get_dtls_srtp_negotiation_result( const mbedtls_ssl_context *ssl, mbedtls_dtls_srtp_info *dtls_srtp_info ) +void mbedtls_ssl_get_dtls_srtp_negotiation_result( const mbedtls_ssl_context *ssl, + mbedtls_dtls_srtp_info *dtls_srtp_info ) { dtls_srtp_info->chosen_dtls_srtp_profile = ssl->dtls_srtp_info.chosen_dtls_srtp_profile; /* do not copy the mki value if there is no chosen profile */ - if ( dtls_srtp_info->chosen_dtls_srtp_profile == MBEDTLS_TLS_SRTP_UNSET ) + if( dtls_srtp_info->chosen_dtls_srtp_profile == MBEDTLS_TLS_SRTP_UNSET ) { dtls_srtp_info->mki_len = 0; } else { dtls_srtp_info->mki_len = ssl->dtls_srtp_info.mki_len; - memcpy( dtls_srtp_info->mki_value, ssl->dtls_srtp_info.mki_value, ssl->dtls_srtp_info.mki_len ); + memcpy( dtls_srtp_info->mki_value, ssl->dtls_srtp_info.mki_value, + ssl->dtls_srtp_info.mki_len ); } } #endif /* MBEDTLS_SSL_DTLS_SRTP */ diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index e78c087ff..dd274700c 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -2341,7 +2341,8 @@ int main( int argc, char *argv[] ) { if( opt.force_srtp_profile != 0 ) { - const mbedtls_ssl_srtp_profile forced_profile[] = { opt.force_srtp_profile, MBEDTLS_TLS_SRTP_UNSET }; + const mbedtls_ssl_srtp_profile forced_profile[] = + { opt.force_srtp_profile, MBEDTLS_TLS_SRTP_UNSET }; ret = mbedtls_ssl_conf_dtls_srtp_protection_profiles ( &conf, forced_profile ); } else @@ -2810,7 +2811,7 @@ int main( int argc, char *argv[] ) } else { - mbedtls_printf( " DTLS-SRTP no mki value negociated" ); + mbedtls_printf( " DTLS-SRTP no mki value negotiated" ); } mbedtls_printf( "\n" ); } diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 7383d8885..dcb215d4e 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -3921,7 +3921,7 @@ handshake: } else { - mbedtls_printf( " DTLS-SRTP no mki value negociated" ); + mbedtls_printf( " DTLS-SRTP no mki value negotiated" ); } mbedtls_printf( "\n" ); diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 210108df3..59e79744f 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -8875,14 +8875,14 @@ run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ -s "selected srtp profile" \ -s "server hello, adding use_srtp extension" \ -s "DTLS-SRTP key material is"\ - -s "DTLS-SRTP no mki value negociated"\ + -s "DTLS-SRTP no mki value negotiated"\ -S "dumping 'using mki' (8 bytes)" \ -c "client hello, adding use_srtp extension" \ -c "found use_srtp extension" \ -c "found srtp profile" \ -c "selected srtp profile" \ -c "DTLS-SRTP key material is"\ - -c "DTLS-SRTP no mki value negociated"\ + -c "DTLS-SRTP no mki value negotiated"\ -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ -c "dumping 'sending mki' (8 bytes)" \ -C "dumping 'received mki' (8 bytes)" \ @@ -9069,7 +9069,7 @@ run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl -c "found srtp profile" \ -c "selected srtp profile" \ -c "DTLS-SRTP key material is"\ - -c "DTLS-SRTP no mki value negociated"\ + -c "DTLS-SRTP no mki value negotiated"\ -c "dumping 'sending mki' (8 bytes)" \ -C "dumping 'received mki' (8 bytes)" \ -C "error"