Correct dangerous typo in include/polarssl/ssl.h
The definition of SSL_MAC_ADD depends on the presence of the
configuration option POLARSSL_ARC4_C, which was misspelled as
POLARSSL_RC4_C in ssl.h, leading to a too small buffer and
subsequently to a buffer overflow during record processing.
This commit fixes the typo.
diff --git a/ChangeLog b/ChangeLog
index f77278b..67777d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@
side.
Bugfix
+ * Fix typo in ssl.h leading to a too small value of SSL_MAC_ADD
+ in case CBC is disabled but ARC4 is enabled.
* Fix memory leak in ssl_set_hostname() when called multiple times.
Found by projectgus and jethrogb, #836.
* Fix usage help in ssl_server2 example. Found and fixed by Bei Lin.
diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h
index 9a3fb8a..32c07c2 100644
--- a/include/polarssl/ssl.h
+++ b/include/polarssl/ssl.h
@@ -303,7 +303,7 @@
#define SSL_COMPRESSION_ADD 0
#endif
-#if defined(POLARSSL_RC4_C) || defined(POLARSSL_CIPHER_MODE_CBC)
+#if defined(POLARSSL_ARC4_C) || defined(POLARSSL_CIPHER_MODE_CBC)
/* Ciphersuites using HMAC */
#if defined(POLARSSL_SHA512_C)
#define SSL_MAC_ADD 48 /* SHA-384 used for HMAC */