Fix tls1_generate_master_secret
authorAlexey Komnin <interfere.work@gmail.com>
Thu, 22 Jun 2017 06:45:17 +0000 (09:45 +0300)
committerRich Salz <rsalz@openssl.org>
Thu, 22 Jun 2017 15:54:19 +0000 (11:54 -0400)
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3751)

ssl/t1_enc.c

index 26ec877..ce7f14d 100644 (file)
@@ -460,7 +460,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
                  hash, hashlen,
                  NULL, 0,
                  NULL, 0,
-                 NULL, 0, p, len, s->session->master_key,
+                 NULL, 0, p, len, out,
                  SSL3_MASTER_SECRET_SIZE);
         OPENSSL_cleanse(hash, hashlen);
     } else {
@@ -470,7 +470,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
                  s->s3->client_random, SSL3_RANDOM_SIZE,
                  NULL, 0,
                  s->s3->server_random, SSL3_RANDOM_SIZE,
-                 NULL, 0, p, len, s->session->master_key,
+                 NULL, 0, p, len, out,
                  SSL3_MASTER_SECRET_SIZE);
     }
 #ifdef SSL_DEBUG