MEDIUM: ssl: implement a workaround for the OpenSSL heartbleed attack

Using the previous callback, it's trivial to block the heartbeat attack,
first we control the message length, then we emit an SSL error if it is
out of bounds. A special log is emitted, indicating that a heartbleed
attack was stopped so that they are not confused with other failures.

That way, haproxy can protect itself even when running on an unpatched
SSL stack. Tests performed with openssl-1.0.1c indicate a total success.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index dde9b8c..10bc4d8 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -582,6 +582,7 @@
 	case CO_ER_SSL_CRT_FAIL:  return "SSL client certificate not trusted";
 	case CO_ER_SSL_HANDSHAKE: return "SSL handshake failure";
 	case CO_ER_SSL_HANDSHAKE_HB: return "SSL handshake failure after heartbeat";
+	case CO_ER_SSL_KILLED_HB: return "Stopped a TLSv1 heartbeat attack (CVE-2014-0160)";
 	case CO_ER_SSL_NO_TARGET: return "Attempt to use SSL on an unknown target (internal error)";
 	}
 	return NULL;
diff --git a/include/types/connection.h b/include/types/connection.h
index 84248c9..83ac432 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -163,7 +163,8 @@
 	CO_ER_SSL_CRT_FAIL,     /* client cert verification failed on the certificate */
 	CO_ER_SSL_HANDSHAKE,    /* SSL error during handshake */
 	CO_ER_SSL_HANDSHAKE_HB, /* SSL error during handshake with heartbeat present */
-	CO_ER_SSL_NO_TARGET,    /* unkonwn target (not client nor server) */
+	CO_ER_SSL_KILLED_HB,    /* Stopped a TLSv1 heartbeat attack (CVE-2014-0160) */
+	CO_ER_SSL_NO_TARGET,    /* unknown target (not client nor server) */
 };
 
 /* source address settings for outgoing connections */