diff options
author | Jack Lloyd <[email protected]> | 2016-09-22 00:16:52 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-09-22 00:16:52 -0400 |
commit | 0a1e8467ea361a0cbd4abfff0302cef2a8cabfa6 (patch) | |
tree | 9bdb2c7b1ffe4ebe6ea5f179f92b33984925de6e /src | |
parent | 1b8b2ff798d2cad874eadc524a26a8e7f931a664 (diff) |
Move this to avoid ASan trigger
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/tls/tls_record.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/tls/tls_record.cpp b/src/lib/tls/tls_record.cpp index 6be18491c..512552e74 100644 --- a/src/lib/tls/tls_record.cpp +++ b/src/lib/tls/tls_record.cpp @@ -273,10 +273,6 @@ void write_record(secure_vector<byte>& output, const size_t header_size = output.size(); - // EtM also uses ciphertext size instead of plaintext size for AEAD input - const byte* mac_input = (cs->uses_encrypt_then_mac() ? &output[header_size] : msg.get_data()); - const size_t mac_input_len = (cs->uses_encrypt_then_mac() ? enc_size : msg.get_size()); - if(iv_size) { output.resize(output.size() + iv_size); @@ -285,6 +281,10 @@ void write_record(secure_vector<byte>& output, output.insert(output.end(), msg.get_data(), msg.get_data() + msg.get_size()); + // EtM also uses ciphertext size instead of plaintext size for AEAD input + const byte* mac_input = (cs->uses_encrypt_then_mac() ? &output[header_size] : msg.get_data()); + const size_t mac_input_len = (cs->uses_encrypt_then_mac() ? enc_size : msg.get_size()); + if(cs->uses_encrypt_then_mac()) { for(size_t i = 0; i != pad_val + 1; ++i) |