diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 83f2f425f..698334739 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -881,6 +881,13 @@ typedef enum } mbedtls_ssl_srtp_profile; +typedef struct +{ + const mbedtls_ssl_srtp_profile profile; + const char *name; +} +mbedtls_ssl_srtp_profile_info; + typedef struct mbedtls_dtls_srtp_info_t { mbedtls_ssl_srtp_profile chosen_dtls_srtp_profile; /*!< negotiated SRTP profile */ @@ -3233,6 +3240,15 @@ mbedtls_ssl_srtp_profile mbedtls_ssl_get_dtls_srtp_protection_profile( const mbe * \return 0 on succes, MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL if the key buffer is too small to hold the generated key */ int mbedtls_ssl_get_dtls_srtp_key_material( const mbedtls_ssl_context *ssl, unsigned char *key, size_t *key_len ); + +/** + * \brief Utility function to get information on dtls srtp profile. + * + * \param profile The dtls-srtp profile id to get info on. + * + * \return mbedtls_ssl_srtp_profile_info* on success, NULL if not found + */ +const mbedtls_ssl_srtp_profile_info *mbedtls_ssl_dtls_srtp_profile_info_from_id( mbedtls_ssl_srtp_profile profile ); #endif /* MBEDTLS_SSL_DTLS_SRTP */ /** diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index d9d5cad36..4ae740c63 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -151,7 +151,7 @@ int main( void ) #define DFL_SKIP_CLOSE_NOTIFY 0 #define DFL_QUERY_CONFIG_MODE 0 #define DFL_USE_SRTP 0 -#define DFL_SRTP_FORCE_PROFILE MBEDTLS_SRTP_UNSET_PROFILE +#define DFL_SRTP_FORCE_PROFILE 0 #define DFL_SRTP_MKI "" #define GET_REQUEST "GET %s HTTP/1.0\r\nExtra-header: " diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 2db5887d2..137838c77 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -184,7 +184,7 @@ int main( void ) #define DFL_NSS_KEYLOG_FILE NULL #define DFL_QUERY_CONFIG_MODE 0 #define DFL_USE_SRTP 0 -#define DFL_SRTP_FORCE_PROFILE MBEDTLS_SRTP_UNSET_PROFILE +#define DFL_SRTP_FORCE_PROFILE 0 #define DFL_SRTP_SUPPORT_MKI 0 #define LONG_RESPONSE "

01-blah-blah-blah-blah-blah-blah-blah-blah-blah\r\n" \