mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 09:15:35 +00:00
Factor repeated condition to its own macro
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
7a8b1e6b71
commit
ed0e86428d
|
@ -154,6 +154,14 @@
|
|||
#define MBEDTLS_SSL_SOME_SUITES_USE_CBC
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC) && \
|
||||
( defined(MBEDTLS_SSL_PROTO_TLS1) || \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_2) )
|
||||
#define MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) || \
|
||||
defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC)
|
||||
#define MBEDTLS_SSL_SOME_MODES_USE_MAC
|
||||
|
|
|
@ -32,10 +32,7 @@
|
|||
#include "mbedtls/md.h"
|
||||
|
||||
#if defined(MBEDTLS_TEST_HOOKS) && \
|
||||
defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC) && \
|
||||
( defined(MBEDTLS_SSL_PROTO_TLS1) || \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_1) | \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_2) )
|
||||
defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC)
|
||||
/** \brief Compute the HMAC of variable-length data with constant flow.
|
||||
*
|
||||
* This function computes the HMAC of the concatenation of \p add_data and \p
|
||||
|
@ -74,6 +71,6 @@ int mbedtls_ssl_cf_hmac(
|
|||
const unsigned char *data, size_t data_len_secret,
|
||||
size_t min_data_len, size_t max_data_len,
|
||||
unsigned char *output );
|
||||
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_SSL_SOME_SUITES_USE_CBC && TLS 1.0-1.2 */
|
||||
#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
|
||||
|
||||
#endif /* MBEDTLS_SSL_INVASIVE_H */
|
||||
|
|
|
@ -1066,10 +1066,7 @@ int mbedtls_ssl_encrypt_buf( mbedtls_ssl_context *ssl,
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC) && \
|
||||
( defined(MBEDTLS_SSL_PROTO_TLS1) || \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_2) )
|
||||
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC)
|
||||
/*
|
||||
* Constant-flow conditional memcpy:
|
||||
* - if c1 == c2, equivalent to memcpy(dst, src, len),
|
||||
|
@ -1182,7 +1179,7 @@ MBEDTLS_STATIC_TESTABLE int mbedtls_ssl_cf_hmac(
|
|||
mbedtls_md_free( &aux );
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_CBC && TLS 1.0-1.2 */
|
||||
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
|
||||
|
||||
int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context const *ssl,
|
||||
mbedtls_ssl_transform *transform,
|
||||
|
|
|
@ -4055,16 +4055,12 @@ void resize_buffers_renegotiate_mfl( int mfl, int legacy_renegotiation,
|
|||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC:MBEDTLS_AES_C:MBEDTLS_SSL_PROTO_TLS1_2:MBEDTLS_TEST_HOOKS */
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC:MBEDTLS_TEST_HOOKS */
|
||||
void ssl_cf_hmac( int hash )
|
||||
{
|
||||
/*
|
||||
* Test the function mbedtls_ssl_cf_hmac() against a reference
|
||||
* implementation.
|
||||
*
|
||||
* Note: the dependency is actually on TLS 1.0-1.2 and (AES or ARIA or
|
||||
* Camellia or DES), but since the test framework doesn't support
|
||||
* alternation in dependencies, just depend on the most common.
|
||||
*/
|
||||
mbedtls_md_context_t ctx, ref_ctx;
|
||||
const mbedtls_md_info_t *md_info;
|
||||
|
|
Loading…
Reference in a new issue