Merge pull request #6374 from mprse/enc_types
Test TLS 1.2 builds with each encryption type
This commit is contained in:
commit
8fd3254cfc
12 changed files with 197 additions and 26 deletions
|
@ -0,0 +1,4 @@
|
||||||
|
Bugfix
|
||||||
|
* Fix bugs and missing dependencies when
|
||||||
|
building and testing configurations with
|
||||||
|
only one encryption type enabled in TLS 1.2.
|
|
@ -874,6 +874,11 @@
|
||||||
#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
|
#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_SSL_TICKET_C) && \
|
||||||
|
!( defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) )
|
||||||
|
#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH) && \
|
#if defined(MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH) && \
|
||||||
MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH >= 256
|
MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH >= 256
|
||||||
#error "MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH must be less than 256"
|
#error "MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH must be less than 256"
|
||||||
|
@ -962,7 +967,9 @@
|
||||||
#error "MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH defined, but not all prerequisites"
|
#error "MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH defined, but not all prerequisites"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) && !( defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) )
|
||||||
|
#error "MBEDTLS_SSL_CONTEXT_SERIALIZATION defined, but not all prerequisites"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Reject attempts to enable options that have been removed and that could
|
/* Reject attempts to enable options that have been removed and that could
|
||||||
* cause a build to succeed but with features removed. */
|
* cause a build to succeed but with features removed. */
|
||||||
|
|
|
@ -1380,6 +1380,8 @@
|
||||||
* saved after the handshake to allow for more efficient serialization, so if
|
* saved after the handshake to allow for more efficient serialization, so if
|
||||||
* you don't need this feature you'll save RAM by disabling it.
|
* you don't need this feature you'll save RAM by disabling it.
|
||||||
*
|
*
|
||||||
|
* Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C
|
||||||
|
*
|
||||||
* Comment to disable the context serialization APIs.
|
* Comment to disable the context serialization APIs.
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
||||||
|
@ -3052,7 +3054,8 @@
|
||||||
* Module: library/ssl_ticket.c
|
* Module: library/ssl_ticket.c
|
||||||
* Caller:
|
* Caller:
|
||||||
*
|
*
|
||||||
* Requires: MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO
|
* Requires: (MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO) &&
|
||||||
|
* (MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C)
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_SSL_TICKET_C
|
#define MBEDTLS_SSL_TICKET_C
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ unsigned mbedtls_ct_uint_mask( unsigned value )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC)
|
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_MAC)
|
||||||
|
|
||||||
size_t mbedtls_ct_size_mask( size_t value )
|
size_t mbedtls_ct_size_mask( size_t value )
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ size_t mbedtls_ct_size_mask( size_t value )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
|
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_MAC */
|
||||||
|
|
||||||
#if defined(MBEDTLS_BIGNUM_C)
|
#if defined(MBEDTLS_BIGNUM_C)
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ static void mbedtls_ct_mem_move_to_left( void *start,
|
||||||
|
|
||||||
#endif /* MBEDTLS_PKCS1_V15 && MBEDTLS_RSA_C && ! MBEDTLS_RSA_ALT */
|
#endif /* MBEDTLS_PKCS1_V15 && MBEDTLS_RSA_C && ! MBEDTLS_RSA_ALT */
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC)
|
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_MAC)
|
||||||
|
|
||||||
void mbedtls_ct_memcpy_if_eq( unsigned char *dest,
|
void mbedtls_ct_memcpy_if_eq( unsigned char *dest,
|
||||||
const unsigned char *src,
|
const unsigned char *src,
|
||||||
|
@ -654,7 +654,7 @@ cleanup:
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
|
|
||||||
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
|
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_MAC */
|
||||||
|
|
||||||
#if defined(MBEDTLS_BIGNUM_C)
|
#if defined(MBEDTLS_BIGNUM_C)
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ signed char mbedtls_ct_base64_dec_value( unsigned char c );
|
||||||
|
|
||||||
#endif /* MBEDTLS_BASE64_C */
|
#endif /* MBEDTLS_BASE64_C */
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC)
|
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_MAC)
|
||||||
|
|
||||||
/** Conditional memcpy without branches.
|
/** Conditional memcpy without branches.
|
||||||
*
|
*
|
||||||
|
@ -321,7 +321,7 @@ int mbedtls_ct_hmac( mbedtls_md_context_t *ctx,
|
||||||
unsigned char *output );
|
unsigned char *output );
|
||||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
|
|
||||||
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
|
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_MAC */
|
||||||
|
|
||||||
#if defined(MBEDTLS_PKCS1_V15) && defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_RSA_ALT)
|
#if defined(MBEDTLS_PKCS1_V15) && defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_RSA_ALT)
|
||||||
|
|
||||||
|
|
|
@ -3592,6 +3592,7 @@ static psa_status_t psa_aead_check_nonce_length( psa_algorithm_t alg,
|
||||||
break;
|
break;
|
||||||
#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */
|
#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */
|
||||||
default:
|
default:
|
||||||
|
(void) nonce_length;
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1124,7 +1124,9 @@ int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context const *ssl,
|
||||||
mbedtls_ssl_transform *transform,
|
mbedtls_ssl_transform *transform,
|
||||||
mbedtls_record *rec )
|
mbedtls_record *rec )
|
||||||
{
|
{
|
||||||
|
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC) || defined(MBEDTLS_CIPHER_MODE_AEAD)
|
||||||
size_t olen;
|
size_t olen;
|
||||||
|
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_CBC || MBEDTLS_CIPHER_MODE_AEAD */
|
||||||
mbedtls_ssl_mode_t ssl_mode;
|
mbedtls_ssl_mode_t ssl_mode;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
mbedtls_ssl_config conf;
|
mbedtls_ssl_config conf;
|
||||||
mbedtls_ctr_drbg_context ctr_drbg;
|
mbedtls_ctr_drbg_context ctr_drbg;
|
||||||
mbedtls_entropy_context entropy;
|
mbedtls_entropy_context entropy;
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
mbedtls_ssl_ticket_context ticket_ctx;
|
mbedtls_ssl_ticket_context ticket_ctx;
|
||||||
#endif
|
#endif
|
||||||
unsigned char buf[4096];
|
unsigned char buf[4096];
|
||||||
|
@ -89,7 +89,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
}
|
}
|
||||||
mbedtls_ssl_init( &ssl );
|
mbedtls_ssl_init( &ssl );
|
||||||
mbedtls_ssl_config_init( &conf );
|
mbedtls_ssl_config_init( &conf );
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
mbedtls_ssl_ticket_init( &ticket_ctx );
|
mbedtls_ssl_ticket_init( &ticket_ctx );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
mbedtls_ssl_conf_alpn_protocols( &conf, alpn_list );
|
mbedtls_ssl_conf_alpn_protocols( &conf, alpn_list );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
if( options & 0x4 )
|
if( options & 0x4 )
|
||||||
{
|
{
|
||||||
if( mbedtls_ssl_ticket_setup( &ticket_ctx,
|
if( mbedtls_ssl_ticket_setup( &ticket_ctx,
|
||||||
|
@ -173,7 +173,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
mbedtls_ssl_ticket_free( &ticket_ctx );
|
mbedtls_ssl_ticket_free( &ticket_ctx );
|
||||||
#endif
|
#endif
|
||||||
mbedtls_entropy_free( &entropy );
|
mbedtls_entropy_free( &entropy );
|
||||||
|
|
|
@ -49,7 +49,7 @@ int main( void )
|
||||||
#include "mbedtls/ssl_cache.h"
|
#include "mbedtls/ssl_cache.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_TICKET_C)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
#include "mbedtls/ssl_ticket.h"
|
#include "mbedtls/ssl_ticket.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ int main( void )
|
||||||
#else
|
#else
|
||||||
#define USAGE_CA_CALLBACK ""
|
#define USAGE_CA_CALLBACK ""
|
||||||
#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */
|
#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
#define USAGE_TICKETS \
|
#define USAGE_TICKETS \
|
||||||
" tickets=%%d default: 1 (enabled)\n" \
|
" tickets=%%d default: 1 (enabled)\n" \
|
||||||
" ticket_rotate=%%d default: 0 (disabled)\n" \
|
" ticket_rotate=%%d default: 0 (disabled)\n" \
|
||||||
|
@ -292,7 +292,7 @@ int main( void )
|
||||||
" ticket_aead=%%s default: \"AES-256-GCM\"\n"
|
" ticket_aead=%%s default: \"AES-256-GCM\"\n"
|
||||||
#else
|
#else
|
||||||
#define USAGE_TICKETS ""
|
#define USAGE_TICKETS ""
|
||||||
#endif /* MBEDTLS_SSL_SESSION_TICKETS */
|
#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_TICKET_C */
|
||||||
|
|
||||||
#define USAGE_EAP_TLS \
|
#define USAGE_EAP_TLS \
|
||||||
" eap_tls=%%d default: 0 (disabled)\n"
|
" eap_tls=%%d default: 0 (disabled)\n"
|
||||||
|
@ -1477,9 +1477,9 @@ int main( int argc, char *argv[] )
|
||||||
#if defined(MBEDTLS_SSL_CACHE_C)
|
#if defined(MBEDTLS_SSL_CACHE_C)
|
||||||
mbedtls_ssl_cache_context cache;
|
mbedtls_ssl_cache_context cache;
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
mbedtls_ssl_ticket_context ticket_ctx;
|
mbedtls_ssl_ticket_context ticket_ctx;
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_TICKET_C */
|
||||||
#if defined(SNI_OPTION)
|
#if defined(SNI_OPTION)
|
||||||
sni_entry *sni_info = NULL;
|
sni_entry *sni_info = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1568,7 +1568,7 @@ int main( int argc, char *argv[] )
|
||||||
#if defined(MBEDTLS_SSL_CACHE_C)
|
#if defined(MBEDTLS_SSL_CACHE_C)
|
||||||
mbedtls_ssl_cache_init( &cache );
|
mbedtls_ssl_cache_init( &cache );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
mbedtls_ssl_ticket_init( &ticket_ctx );
|
mbedtls_ssl_ticket_init( &ticket_ctx );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SSL_ALPN)
|
#if defined(MBEDTLS_SSL_ALPN)
|
||||||
|
@ -2994,7 +2994,7 @@ int main( int argc, char *argv[] )
|
||||||
mbedtls_ssl_cache_set );
|
mbedtls_ssl_cache_set );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
if( opt.tickets != MBEDTLS_SSL_SESSION_TICKETS_DISABLED )
|
if( opt.tickets != MBEDTLS_SSL_SESSION_TICKETS_DISABLED )
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_HAVE_TIME)
|
#if defined(MBEDTLS_HAVE_TIME)
|
||||||
|
@ -4305,7 +4305,7 @@ exit:
|
||||||
#if defined(MBEDTLS_SSL_CACHE_C)
|
#if defined(MBEDTLS_SSL_CACHE_C)
|
||||||
mbedtls_ssl_cache_free( &cache );
|
mbedtls_ssl_cache_free( &cache );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_TICKET_C)
|
||||||
mbedtls_ssl_ticket_free( &ticket_ctx );
|
mbedtls_ssl_ticket_free( &ticket_ctx );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SSL_COOKIE_C)
|
#if defined(MBEDTLS_SSL_COOKIE_C)
|
||||||
|
|
|
@ -1274,6 +1274,163 @@ component_test_crypto_full_no_cipher () {
|
||||||
make test
|
make test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component_test_tls1_2_default_stream_cipher_only () {
|
||||||
|
msg "build: default with only stream cipher"
|
||||||
|
|
||||||
|
# Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C
|
||||||
|
scripts/config.py unset MBEDTLS_GCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CHACHAPOLY_C
|
||||||
|
# Disable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES))
|
||||||
|
scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC
|
||||||
|
# Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC)
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
||||||
|
# Enable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER))
|
||||||
|
scripts/config.py set MBEDTLS_CIPHER_NULL_CIPHER
|
||||||
|
# Modules that depend on AEAD
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_TICKET_C
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
msg "test: default with only stream cipher"
|
||||||
|
make test
|
||||||
|
|
||||||
|
# Not running ssl-opt.sh because most tests require a non-NULL ciphersuite.
|
||||||
|
}
|
||||||
|
|
||||||
|
component_test_tls1_2_default_stream_cipher_only_use_psa () {
|
||||||
|
msg "build: default with only stream cipher use psa"
|
||||||
|
|
||||||
|
scripts/config.py set MBEDTLS_USE_PSA_CRYPTO
|
||||||
|
# Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C)
|
||||||
|
scripts/config.py unset MBEDTLS_GCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CHACHAPOLY_C
|
||||||
|
# Disable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES))
|
||||||
|
scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC
|
||||||
|
# Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC)
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
||||||
|
# Enable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER))
|
||||||
|
scripts/config.py set MBEDTLS_CIPHER_NULL_CIPHER
|
||||||
|
# Modules that depend on AEAD
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_TICKET_C
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
msg "test: default with only stream cipher use psa"
|
||||||
|
make test
|
||||||
|
|
||||||
|
# Not running ssl-opt.sh because most tests require a non-NULL ciphersuite.
|
||||||
|
}
|
||||||
|
|
||||||
|
component_test_tls1_2_default_cbc_legacy_cipher_only () {
|
||||||
|
msg "build: default with only CBC-legacy cipher"
|
||||||
|
|
||||||
|
# Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C)
|
||||||
|
scripts/config.py unset MBEDTLS_GCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CHACHAPOLY_C
|
||||||
|
# Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES))
|
||||||
|
scripts/config.py set MBEDTLS_CIPHER_MODE_CBC
|
||||||
|
# Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC)
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
||||||
|
# Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER))
|
||||||
|
scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER
|
||||||
|
# Modules that depend on AEAD
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_TICKET_C
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy cipher"
|
||||||
|
make test
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy cipher - ssl-opt.sh (subset)"
|
||||||
|
tests/ssl-opt.sh -f "TLS 1.2"
|
||||||
|
}
|
||||||
|
|
||||||
|
component_test_tls1_2_deafult_cbc_legacy_cipher_only_use_psa () {
|
||||||
|
msg "build: default with only CBC-legacy cipher use psa"
|
||||||
|
|
||||||
|
scripts/config.py set MBEDTLS_USE_PSA_CRYPTO
|
||||||
|
# Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C)
|
||||||
|
scripts/config.py unset MBEDTLS_GCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CHACHAPOLY_C
|
||||||
|
# Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES))
|
||||||
|
scripts/config.py set MBEDTLS_CIPHER_MODE_CBC
|
||||||
|
# Disable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC)
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
||||||
|
# Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER))
|
||||||
|
scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER
|
||||||
|
# Modules that depend on AEAD
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_TICKET_C
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy cipher use psa"
|
||||||
|
make test
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy cipher use psa - ssl-opt.sh (subset)"
|
||||||
|
tests/ssl-opt.sh -f "TLS 1.2"
|
||||||
|
}
|
||||||
|
|
||||||
|
component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only () {
|
||||||
|
msg "build: default with only CBC-legacy and CBC-EtM ciphers"
|
||||||
|
|
||||||
|
# Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C)
|
||||||
|
scripts/config.py unset MBEDTLS_GCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CHACHAPOLY_C
|
||||||
|
# Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES))
|
||||||
|
scripts/config.py set MBEDTLS_CIPHER_MODE_CBC
|
||||||
|
# Enable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC)
|
||||||
|
scripts/config.py set MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
||||||
|
# Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER))
|
||||||
|
scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER
|
||||||
|
# Modules that depend on AEAD
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_TICKET_C
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy and CBC-EtM ciphers"
|
||||||
|
make test
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy and CBC-EtM ciphers - ssl-opt.sh (subset)"
|
||||||
|
tests/ssl-opt.sh -f "TLS 1.2"
|
||||||
|
}
|
||||||
|
|
||||||
|
component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only_use_psa () {
|
||||||
|
msg "build: default with only CBC-legacy and CBC-EtM ciphers use psa"
|
||||||
|
|
||||||
|
scripts/config.py set MBEDTLS_USE_PSA_CRYPTO
|
||||||
|
# Disable AEAD (controlled by the presence of one of GCM_C, CCM_C, CHACHAPOLY_C)
|
||||||
|
scripts/config.py unset MBEDTLS_GCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CCM_C
|
||||||
|
scripts/config.py unset MBEDTLS_CHACHAPOLY_C
|
||||||
|
# Enable CBC-legacy (controlled by MBEDTLS_CIPHER_MODE_CBC plus at least one block cipher (AES, ARIA, Camellia, DES))
|
||||||
|
scripts/config.py set MBEDTLS_CIPHER_MODE_CBC
|
||||||
|
# Enable CBC-EtM (controlled by the same as CBC-legacy plus MBEDTLS_SSL_ENCRYPT_THEN_MAC)
|
||||||
|
scripts/config.py set MBEDTLS_SSL_ENCRYPT_THEN_MAC
|
||||||
|
# Disable stream (currently that's just the NULL pseudo-cipher (controlled by MBEDTLS_CIPHER_NULL_CIPHER))
|
||||||
|
scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER
|
||||||
|
# Modules that depend on AEAD
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_CONTEXT_SERIALIZATION
|
||||||
|
scripts/config.py unset MBEDTLS_SSL_TICKET_C
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy and CBC-EtM ciphers use psa"
|
||||||
|
make test
|
||||||
|
|
||||||
|
msg "test: default with only CBC-legacy and CBC-EtM ciphers use psa - ssl-opt.sh (subset)"
|
||||||
|
tests/ssl-opt.sh -f "TLS 1.2"
|
||||||
|
}
|
||||||
|
|
||||||
component_test_psa_external_rng_use_psa_crypto () {
|
component_test_psa_external_rng_use_psa_crypto () {
|
||||||
msg "build: full + PSA_CRYPTO_EXTERNAL_RNG + USE_PSA_CRYPTO minus CTR_DRBG"
|
msg "build: full + PSA_CRYPTO_EXTERNAL_RNG + USE_PSA_CRYPTO minus CTR_DRBG"
|
||||||
scripts/config.py full
|
scripts/config.py full
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
/* BEGIN_HEADER */
|
/* BEGIN_HEADER */
|
||||||
#include "mbedtls/cipher.h"
|
#include "mbedtls/cipher.h"
|
||||||
|
|
||||||
#if defined(MBEDTLS_AES_C)
|
|
||||||
#include "mbedtls/aes.h"
|
#include "mbedtls/aes.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_GCM_C)
|
#if defined(MBEDTLS_GCM_C)
|
||||||
#include "mbedtls/gcm.h"
|
#include "mbedtls/gcm.h"
|
||||||
|
|
|
@ -22,15 +22,15 @@ mbedtls_cmac_setkey:MBEDTLS_CIPHER_DES_EDE3_ECB:192:0
|
||||||
|
|
||||||
CMAC init #5 AES-224: bad key size
|
CMAC init #5 AES-224: bad key size
|
||||||
depends_on:MBEDTLS_AES_C
|
depends_on:MBEDTLS_AES_C
|
||||||
mbedtls_cmac_setkey:MBEDTLS_CIPHER_ID_AES:224:MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
|
mbedtls_cmac_setkey:MBEDTLS_CIPHER_AES_128_ECB:224:MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
|
||||||
|
|
||||||
CMAC init #6 AES-0: bad key size
|
CMAC init #6 AES-0: bad key size
|
||||||
depends_on:MBEDTLS_AES_C
|
depends_on:MBEDTLS_AES_C
|
||||||
mbedtls_cmac_setkey:MBEDTLS_CIPHER_ID_AES:0:MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
|
mbedtls_cmac_setkey:MBEDTLS_CIPHER_AES_128_ECB:0:MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
|
||||||
|
|
||||||
CMAC init #7 Camellia: wrong cipher
|
CMAC init #7 Camellia: wrong cipher
|
||||||
depends_on:MBEDTLS_CAMELLIA_C
|
depends_on:MBEDTLS_CAMELLIA_C
|
||||||
mbedtls_cmac_setkey:MBEDTLS_CIPHER_ID_CAMELLIA:128:MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
|
mbedtls_cmac_setkey:MBEDTLS_CIPHER_CAMELLIA_192_ECB:128:MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
|
||||||
|
|
||||||
CMAC Single Blocks #1 - Empty block, no updates
|
CMAC Single Blocks #1 - Empty block, no updates
|
||||||
mbedtls_cmac_multiple_blocks:MBEDTLS_CIPHER_AES_128_ECB:"2b7e151628aed2a6abf7158809cf4f3c":128:16:"":-1:"":-1:"":-1:"":-1:"bb1d6929e95937287fa37d129b756746"
|
mbedtls_cmac_multiple_blocks:MBEDTLS_CIPHER_AES_128_ECB:"2b7e151628aed2a6abf7158809cf4f3c":128:16:"":-1:"":-1:"":-1:"":-1:"bb1d6929e95937287fa37d129b756746"
|
||||||
|
|
Loading…
Reference in a new issue