Made support for the truncated_hmac extension configurable
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 1281bc8..039b536 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -516,6 +516,7 @@
transform->maclen = md_get_size( md_info );
+#if defined(POLARSSL_SSL_TRUNCATED_HMAC)
/*
* If HMAC is to be truncated, we shall keep the leftmost bytes,
* (rfc 6066 page 13 or rfc 2104 section 4),
@@ -523,6 +524,7 @@
*/
if( session->trunc_hmac == SSL_TRUNC_HMAC_ENABLED )
transform->maclen = SSL_TRUNCATED_HMAC_LEN;
+#endif /* POLARSSL_SSL_TRUNCATED_HMAC */
}
transform->keylen = cipher_info->key_length;
@@ -3255,6 +3257,7 @@
}
#endif /* POLARSSL_SSL_MAX_FRAGMENT_LENGTH */
+#if defined(POLARSSL_SSL_TRUNCATED_HMAC)
int ssl_set_truncated_hmac( ssl_context *ssl, int truncate )
{
if( ssl->endpoint != SSL_IS_CLIENT )
@@ -3264,6 +3267,7 @@
return( 0 );
}
+#endif /* POLARSSL_SSL_TRUNCATED_HMAC */
void ssl_set_renegotiation( ssl_context *ssl, int renegotiation )
{