Jaeden Amero 2de07f1dd1 ssl: Don't access non-existent encrypt_then_mac field
When MBEDTLS_SSL_ENCRYPT_THEN_MAC is enabled, but not
MBEDTLS_SSL_SOME_MODES_USE_MAC, mbedtls_ssl_derive_keys() and
build_transforms() will attempt to use a non-existent `encrypt_then_mac`
field in the ssl_transform.

    Compile [ 93.7%]: ssl_tls.c
    [Error] ssl_tls.c@865,14: 'mbedtls_ssl_transform {aka struct mbedtls_ssl_transform}' ha
s no member named 'encrypt_then_mac'
    [ERROR] ./mbed-os/features/mbedtls/src/ssl_tls.c: In function 'mbedtls_ssl_derive_keys'
:
    ./mbed-os/features/mbedtls/src/ssl_tls.c:865:14: error: 'mbedtls_ssl_transform {aka str
uct mbedtls_ssl_transform}' has no member named 'encrypt_then_mac'
         transform->encrypt_then_mac = session->encrypt_then_mac;
                  ^~

Change mbedtls_ssl_derive_keys() and build_transforms() to only access
`encrypt_then_mac` if `encrypt_then_mac` is actually present.

Add a regression test to detect when we have regressions with
configurations that do not include any MAC ciphersuites.

Fixes d56ed2491be9 ("Reduce size of `ssl_transform` if no MAC ciphersuite is enabled")
2019-06-05 14:09:29 +01:00
..
.gitignore
aes.c
aesni.c
arc4.c
aria.c
asn1parse.c
asn1write.c
base64.c
bignum.c
blowfish.c
camellia.c
ccm.c
certs.c
chacha20.c
chachapoly.c
cipher_wrap.c
cipher.c
cmac.c
CMakeLists.txt
ctr_drbg.c
debug.c
des.c
dhm.c
ecdh.c
ecdsa.c
ecjpake.c
ecp_curves.c
ecp.c
entropy_poll.c
entropy.c
error.c
gcm.c
havege.c
hkdf.c
hmac_drbg.c
Makefile
md2.c
md4.c
md5.c
md_wrap.c
md.c
memory_buffer_alloc.c
net_sockets.c
nist_kw.c
oid.c
padlock.c
pem.c
pk_wrap.c
pk.c
pkcs5.c
pkcs11.c
pkcs12.c
pkparse.c
pkwrite.c
platform_util.c
platform.c
poly1305.c
ripemd160.c
rsa_internal.c
rsa.c
sha1.c
sha256.c
sha512.c
ssl_cache.c
ssl_ciphersuites.c
ssl_cli.c
ssl_cookie.c
ssl_srv.c
ssl_ticket.c
ssl_tls.c
threading.c
timing.c
version_features.c
version.c
x509_create.c
x509_crl.c
x509_crt.c
x509_csr.c
x509.c
x509write_crt.c
x509write_csr.c
xtea.c