diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-04-06 20:51:39 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-04-06 20:57:59 +0200 |
commit | d50baba40f7a1ae1622ee2e37999bff686408a7c (patch) | |
tree | 3bf73eb9995d567211afd0220f7b57b5fcb33014 /lib/cipher.c | |
parent | 9f9b69de66ecbe56e61fd3fca6487f3721864a32 (diff) | |
download | gnutls-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/cipher.c')
-rw-r--r-- | lib/cipher.c | 8 |
1 files changed, 2 insertions, 6 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); |