summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/cipher.c8
-rw-r--r--lib/constate.c4
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/cipher.c b/lib/cipher.c
index 949e830e63..205940ffbc 100644
--- a/lib/cipher.c
+++ b/lib/cipher.c
@@ -335,9 +335,7 @@ encrypt_packet(gnutls_session_t session,
if (params->cipher->xor_nonce == 0) {
/* Values in AEAD are pretty fixed in TLS 1.2 for 128-bit block
*/
- if (params->write.iv == NULL
- || params->write.iv_size !=
- imp_iv_size)
+ if (params->write.iv_size != imp_iv_size)
return
gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
@@ -622,9 +620,7 @@ decrypt_packet(gnutls_session_t session,
if (params->cipher->xor_nonce == 0) {
/* Values in AEAD are pretty fixed in TLS 1.2 for 128-bit block
*/
- if (unlikely
- (params->read.iv == NULL
- || params->read.iv_size != 4))
+ if (unlikely(params->read.iv_size != 4))
return
gnutls_assert_val(GNUTLS_E_DECRYPTION_FAILED);
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",