From 7c3291ea87a9e7363874ab0372f24656ed9e44be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Sun, 27 Oct 2013 14:29:51 +0100 Subject: [PATCH] Check dependencies of protocol versions on hashes --- include/polarssl/config.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/include/polarssl/config.h b/include/polarssl/config.h index 32704de52..dc663c9b5 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -658,7 +658,7 @@ * * Enable support for TLS 1.2. * - * Requires: POLARSSL_SHA256_C or POLARSSL_SHA512_C + * Requires: POLARSSL_SHA1_C or POLARSSL_SHA256_C or POLARSSL_SHA512_C * (Depends on ciphersuites) * * Comment this macro to disable support for TLS 1.2 @@ -1845,6 +1845,26 @@ #error "POLARSSL_RSA_C defined, but not all prerequisites" #endif +#if defined(POLARSSL_SSL_PROTO_SSL3) && ( !defined(POLARSSL_MD5_C) || \ + !defined(POLARSSL_SHA1_C) ) +#error "POLARSSL_SSL_PROTO_SSL3 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_PROTO_TLS1) && ( !defined(POLARSSL_MD5_C) || \ + !defined(POLARSSL_SHA1_C) ) +#error "POLARSSL_SSL_PROTO_TLS1 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_PROTO_TLS1_1) && ( !defined(POLARSSL_MD5_C) || \ + !defined(POLARSSL_SHA1_C) ) +#error "POLARSSL_SSL_PROTO_TLS1_1 defined, but not all prerequisites" +#endif + +#if defined(POLARSSL_SSL_PROTO_TLS1_2) && ( !defined(POLARSSL_SHA1_C) && \ + !defined(POLARSSL_SHA256_C) && !defined(POLARSSL_SHA512_C) ) +#error "POLARSSL_SSL_PROTO_TLS1_2 defined, but not all prerequisites" +#endif + #if defined(POLARSSL_SSL_CLI_C) && !defined(POLARSSL_SSL_TLS_C) #error "POLARSSL_SSL_CLI_C defined, but not all prerequisites" #endif