aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_cbc/tls_cbc.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-17 03:39:24 -0400
committerJack Lloyd <[email protected]>2016-10-17 03:39:24 -0400
commit8f1ecd838eb05ad71bcfeb8cc59873c6f4f903ba (patch)
tree93a6185d5b97fa6533b338031191ab3f1a2d6efa /src/lib/tls/tls_cbc/tls_cbc.cpp
parent1fbb61c3f212f180066b5bffb28e68808df1ad2e (diff)
Maintainer mode fixes
Diffstat (limited to 'src/lib/tls/tls_cbc/tls_cbc.cpp')
-rw-r--r--src/lib/tls/tls_cbc/tls_cbc.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/tls/tls_cbc/tls_cbc.cpp b/src/lib/tls/tls_cbc/tls_cbc.cpp
index c7203003b..0318eb1b1 100644
--- a/src/lib/tls/tls_cbc/tls_cbc.cpp
+++ b/src/lib/tls/tls_cbc/tls_cbc.cpp
@@ -130,12 +130,11 @@ void TLS_CBC_HMAC_AEAD_Encryption::set_associated_data(const byte ad[], size_t a
if(use_encrypt_then_mac())
{
- std::vector<byte>& ad = assoc_data();
// AAD hack for EtM
- size_t pt_size = make_u16bit(ad[11], ad[12]);
+ size_t pt_size = make_u16bit(assoc_data()[11], assoc_data()[12]);
size_t enc_size = round_up(iv_size() + pt_size + 1, block_size());
- ad[11] = get_byte<uint16_t>(0, enc_size);
- ad[12] = get_byte<uint16_t>(1, enc_size);
+ assoc_data()[11] = get_byte<uint16_t>(0, enc_size);
+ assoc_data()[12] = get_byte<uint16_t>(1, enc_size);
}
}
@@ -341,9 +340,6 @@ void TLS_CBC_HMAC_AEAD_Decryption::finish(secure_vector<byte>& buffer, size_t of
}
else
{
- uint8_t* record_contents = msg().data();
- const size_t record_len = msg().size();
-
CT::poison(record_contents, record_len);
cbc_decrypt_record(record_contents, record_len);