Fix TLSv1.3 exporter
authorMatt Caswell <matt@openssl.org>
Fri, 30 Jun 2017 09:45:11 +0000 (10:45 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 3 Jul 2017 09:48:34 +0000 (10:48 +0100)
commit4d89bf448490e7c77743f53bfbefbaddee9b275e
treedb4c5753c8ec16613e0832c713d49e5adef27f2c
parent48feaceb53fa6ae924e298b8eba0e247019313e4
Fix TLSv1.3 exporter

We need to use the hashsize in generating the exportsecret not 0! Otherwise
we end up with random garbage for the secret.

It was pure chance that this passed the tests previously. It so happens
that, because we call SSL_export_keying_material() repeatedly for different
scenarios in the test, we end up in the tls13_export_keying_material() at
exactly the same position in the stack each time and therefore end up using
the same random garbage secret each time!

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3810)
ssl/tls13_enc.c