Maxim Masiutin 62f27ab9dc TLS AEAD ciphers: more bytes for key_block than needed
Fixes #12007
The key_block length was not written to trace, thus it was not obvious
that extra key_bytes were generated for TLS AEAD.

The problem was that EVP_CIPHER_iv_length was called even for AEAD ciphers
to figure out how many bytes from the key_block were needed for the IV.
The correct way was to take cipher mode (GCM, CCM, etc) into
consideration rather than simply callin the general function
EVP_CIPHER_iv_length.

The new function tls_iv_length_within_key_block takes this into
consideration.

Besides that, the order of addendums was counter-intuitive MAC length
was second, but it have to be first to correspond the order given in the RFC.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13035)
2020-10-02 08:49:47 +02:00
..
2020-10-01 09:25:20 +01:00
2020-05-15 14:09:49 +01:00
2019-09-28 20:26:35 +02:00
2019-09-28 20:26:35 +02:00
2020-09-13 11:09:45 +01:00
2019-09-28 20:26:35 +02:00
2019-09-28 20:26:35 +02:00
2020-10-01 09:25:20 +01:00
2020-10-01 09:25:20 +01:00
2020-10-01 09:25:20 +01:00
2020-09-21 10:26:08 +02:00
2020-08-06 13:22:30 +01:00
2020-10-01 09:25:20 +01:00
2020-09-13 11:09:45 +01:00
2019-09-28 20:26:35 +02:00
2020-04-23 13:55:52 +01:00
2019-09-28 20:26:35 +02:00
2020-04-23 13:55:52 +01:00