summaryrefslogtreecommitdiff
path: root/lib/constate.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-04-06 20:51:39 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-04-06 20:57:59 +0200
commitd50baba40f7a1ae1622ee2e37999bff686408a7c (patch)
tree3bf73eb9995d567211afd0220f7b57b5fcb33014 /lib/constate.c
parent9f9b69de66ecbe56e61fd3fca6487f3721864a32 (diff)
downloadgnutls-d50baba40f7a1ae1622ee2e37999bff686408a7c.tar.gz
constate: fixed key generation for TLS1.3
This amends 62ea232f180b980a0d4b6462c468706db6cc4700, and removes invalid NULL checks, as well as corrects the key set for server side. This is verified against openssl master, but does not include automated test suite; it will be tested as part of #328 Resolves #419 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'lib/constate.c')
-rw-r--r--lib/constate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/constate.c b/lib/constate.c
index a773d55ecf..bdafe91b5f 100644
--- a/lib/constate.c
+++ b/lib/constate.c
@@ -414,7 +414,7 @@ _tls13_set_keys(gnutls_session_t session, hs_stage_t stage,
_gnutls_bin2hex(ckey_block, key_size,
buf, sizeof(buf), NULL));
- memcpy(server_write->key, ckey_block, key_size);
+ memcpy(server_write->key, skey_block, key_size);
server_write->key_size = key_size;
_gnutls_hard_log("INT: SERVER WRITE KEY [%d]: %s\n",
@@ -432,7 +432,7 @@ _tls13_set_keys(gnutls_session_t session, hs_stage_t stage,
_gnutls_bin2hex(civ_block, iv_size,
buf, sizeof(buf), NULL));
- memcpy(server_write->iv, civ_block, iv_size);
+ memcpy(server_write->iv, siv_block, iv_size);
server_write->iv_size = iv_size;
_gnutls_hard_log("INT: SERVER WRITE IV [%d]: %s\n",