Move MAC removal responsibility to the various protocol "enc" functions
authorMatt Caswell <matt@openssl.org>
Wed, 3 Jun 2020 16:42:01 +0000 (17:42 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 6 Jul 2020 08:26:00 +0000 (09:26 +0100)
commitec27e619e86c6ce4dfa905044eb4737eeba28a9d
tree463fa1af1ce6d48b1c20f62c06fbacfbed92b68b
parent1b726e9b91a032298dc96ad117b23e18e1583246
Move MAC removal responsibility to the various protocol "enc" functions

For CBC ciphersuites using Mac-then-encrypt we have to be careful about
removing the MAC from the record in constant time. Currently that happens
immediately before MAC verification. Instead we move this responsibility
to the various protocol "enc" functions so that MAC removal is handled at
the same time as padding removal.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12288)
ssl/record/rec_layer_d1.c
ssl/record/rec_layer_s3.c
ssl/record/record.h
ssl/record/record_local.h
ssl/record/ssl3_record.c
ssl/record/ssl3_record_tls13.c
ssl/ssl_lib.c
ssl/ssl_local.h
test/tls13encryptiontest.c