Use AES256 for the default encryption algoritm for TLS session tickets
authorTJ Saunders <tj@castaglia.org>
Sat, 27 Feb 2016 18:37:34 +0000 (19:37 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Mon, 16 May 2016 18:43:06 +0000 (20:43 +0200)
This involves providing more session ticket key data, for both the cipher and
the digest

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
GH: #515, MR: #2153

ssl/ssl_locl.h
ssl/statem/statem_srvr.c
ssl/t1_lib.c

index 9bc9892e2cb95446c2da2e78565532428c5d252b..b39f387483f0803e58ebe5b03348b82ca4a7a8e3 100644 (file)
@@ -858,8 +858,8 @@ struct ssl_ctx_st {
     void *tlsext_servername_arg;
     /* RFC 4507 session ticket keys */
     unsigned char tlsext_tick_key_name[16];
-    unsigned char tlsext_tick_hmac_key[16];
-    unsigned char tlsext_tick_aes_key[16];
+    unsigned char tlsext_tick_hmac_key[32];
+    unsigned char tlsext_tick_aes_key[32];
     /* Callback to support customisation of ticket key setting */
     int (*tlsext_ticket_key_cb) (SSL *ssl,
                                  unsigned char *name, unsigned char *iv,
index c8c68dc07847f18b49505eca8ea893fb0ffedcd7..60f92e5fb9f4eec2e990401577fa14e7ff3b7862 100644 (file)
@@ -3048,7 +3048,7 @@ int tls_construct_new_session_ticket(SSL *s)
     } else {
         if (RAND_bytes(iv, 16) <= 0)
             goto err;
-        if (!EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL,
+        if (!EVP_EncryptInit_ex(ctx, EVP_aes_256_cbc(), NULL,
                                 tctx->tlsext_tick_aes_key, iv))
             goto err;
         if (!HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key,
index 996a1320779e04f3b7a993a5aff2c67773d8976e..ef8d0aeb76d6c06f19483d52ebd413299ba1f886 100644 (file)
@@ -3137,7 +3137,7 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
         if (HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key,
                          sizeof(tctx->tlsext_tick_hmac_key),
                          EVP_sha256(), NULL) <= 0
-                || EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL,
+                || EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(), NULL,
                                       tctx->tlsext_tick_aes_key,
                                       etick + sizeof(tctx->tlsext_tick_key_name)) <= 0) {
             goto err;