Backport TLS 1.1/1.2 #defines
authorRob Stradling <rob@comodo.com>
Tue, 10 Sep 2013 11:42:46 +0000 (12:42 +0100)
committerBen Laurie <ben@links.org>
Fri, 4 Oct 2013 13:55:01 +0000 (14:55 +0100)
ssl/tls1.h

index afe4807fa9005475a9c0f5a3f0aa285065c6ada9..47f25afb1d04d34b3309a89b0f5024a6032c04cf 100644 (file)
@@ -80,10 +80,24 @@ extern "C" {
 
 #define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES   0
 
+#define TLS1_2_VERSION                 0x0303
+#define TLS1_2_VERSION_MAJOR           0x03
+#define TLS1_2_VERSION_MINOR           0x03
+
+#define TLS1_1_VERSION                 0x0302
+#define TLS1_1_VERSION_MAJOR           0x03
+#define TLS1_1_VERSION_MINOR           0x02
+
 #define TLS1_VERSION                   0x0301
 #define TLS1_VERSION_MAJOR             0x03
 #define TLS1_VERSION_MINOR             0x01
 
+#define TLS1_get_version(s) \
+               ((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0)
+
+#define TLS1_get_client_version(s) \
+               ((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0)
+
 #define TLS1_AD_DECRYPTION_FAILED      21
 #define TLS1_AD_RECORD_OVERFLOW                22
 #define TLS1_AD_UNKNOWN_CA             48      /* fatal */