diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index a337fd7ee..e39f79ca4 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -522,13 +522,6 @@ struct options } opt; #if defined(MBEDTLS_SSL_EXPORT_KEYS) -typedef struct eap_tls_keys -{ - unsigned char master_secret[48]; - unsigned char randbytes[64]; - mbedtls_tls_prf_types tls_prf_type; -} eap_tls_keys; - int eap_tls_key_derivation( void *p_expkey, const unsigned char *ms, const unsigned char *kb, @@ -633,19 +626,6 @@ exit: } #if defined( MBEDTLS_SSL_DTLS_SRTP ) -/* Supported SRTP mode needs a maximum of : - * - 16 bytes for key (AES-128) - * - 14 bytes SALT - * One for sender, one for receiver context - */ -#define MBEDTLS_TLS_SRTP_MAX_KEY_MATERIAL_LENGTH 60 -typedef struct dtls_srtp_keys -{ - unsigned char master_secret[48]; - unsigned char randbytes[64]; - mbedtls_tls_prf_types tls_prf_type; -} dtls_srtp_keys; - int dtls_srtp_key_derivation( void *p_expkey, const unsigned char *ms, const unsigned char *kb, @@ -807,12 +787,6 @@ int delayed_send( void *ctx, const unsigned char *buf, size_t len ) return( ret ); } -typedef struct -{ - mbedtls_ssl_context *ssl; - mbedtls_net_context *net; -} io_ctx_t; - #if defined(MBEDTLS_SSL_RECORD_CHECKING) int ssl_check_record( mbedtls_ssl_context const *ssl, unsigned char const *buf, size_t len ) diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 37eb39f8a..12c5c5068 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -625,13 +625,6 @@ struct options } opt; #if defined(MBEDTLS_SSL_EXPORT_KEYS) -typedef struct eap_tls_keys -{ - unsigned char master_secret[48]; - unsigned char randbytes[64]; - mbedtls_tls_prf_types tls_prf_type; -} eap_tls_keys; - int eap_tls_key_derivation( void *p_expkey, const unsigned char *ms, const unsigned char *kb, @@ -736,19 +729,6 @@ exit: } #if defined( MBEDTLS_SSL_DTLS_SRTP ) -/* Supported SRTP mode needs a maximum of : - * - 16 bytes for key (AES-128) - * - 14 bytes SALT - * One for sender, one for receiver context - */ -#define MBEDTLS_TLS_SRTP_MAX_KEY_MATERIAL_LENGTH 60 -typedef struct dtls_srtp_keys -{ - unsigned char master_secret[48]; - unsigned char randbytes[64]; - mbedtls_tls_prf_types tls_prf_type; -} dtls_srtp_keys; - int dtls_srtp_key_derivation( void *p_expkey, const unsigned char *ms, const unsigned char *kb, @@ -910,12 +890,6 @@ int delayed_send( void *ctx, const unsigned char *buf, size_t len ) return( ret ); } -typedef struct -{ - mbedtls_ssl_context *ssl; - mbedtls_net_context *net; -} io_ctx_t; - #if defined(MBEDTLS_SSL_RECORD_CHECKING) int ssl_check_record( mbedtls_ssl_context const *ssl, unsigned char const *buf, size_t len ) diff --git a/programs/ssl/ssl_test_lib.h b/programs/ssl/ssl_test_lib.h index dc8edce3e..88dd3ec7c 100644 --- a/programs/ssl/ssl_test_lib.h +++ b/programs/ssl/ssl_test_lib.h @@ -96,6 +96,43 @@ */ int query_config( const char *config ); + + +#if defined(MBEDTLS_SSL_EXPORT_KEYS) + +typedef struct eap_tls_keys +{ + unsigned char master_secret[48]; + unsigned char randbytes[64]; + mbedtls_tls_prf_types tls_prf_type; +} eap_tls_keys; + +#if defined( MBEDTLS_SSL_DTLS_SRTP ) + +/* Supported SRTP mode needs a maximum of : + * - 16 bytes for key (AES-128) + * - 14 bytes SALT + * One for sender, one for receiver context + */ +#define MBEDTLS_TLS_SRTP_MAX_KEY_MATERIAL_LENGTH 60 + +typedef struct dtls_srtp_keys +{ + unsigned char master_secret[48]; + unsigned char randbytes[64]; + mbedtls_tls_prf_types tls_prf_type; +} dtls_srtp_keys; + +#endif /* MBEDTLS_SSL_DTLS_SRTP */ + +#endif /* MBEDTLS_SSL_EXPORT_KEYS */ + +typedef struct +{ + mbedtls_ssl_context *ssl; + mbedtls_net_context *net; +} io_ctx_t; + #endif /* MBEDTLS_SSL_TEST_IMPOSSIBLE conditions: else */ #endif /* MBEDTLS_PROGRAMS_SSL_SSL_TEST_LIB_H */