]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Allow using implicit IV for stream ciphers with TLS
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fri, 2 Dec 2016 05:28:34 +0000 (08:28 +0300)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Thu, 17 Oct 2019 13:47:44 +0000 (16:47 +0300)
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
lib/constate.c

index 4c6ca0fd0f646e98a29a53fbac29a67892edaa04..fc307debc3e3b383c8295ba72868e226c6d641bb 100644 (file)
@@ -538,8 +538,12 @@ _gnutls_init_record_state(record_parameters_st * params,
        mac.data = state->mac_key;
        mac.size = state->mac_key_size;
 
-       if (!_gnutls_version_has_explicit_iv(ver)) {
-               if (_gnutls_cipher_type(params->cipher) == CIPHER_BLOCK)
+       if (_gnutls_cipher_type(params->cipher) == CIPHER_BLOCK) {
+               if (!_gnutls_version_has_explicit_iv(ver))
+                       iv = &_iv;
+       } else if (_gnutls_cipher_type(params->cipher) == CIPHER_STREAM) {
+               /* To handle GOST ciphersuites */
+               if (_gnutls_cipher_get_implicit_iv_size(params->cipher))
                        iv = &_iv;
        }