diff options
author | Jack Lloyd <[email protected]> | 2017-09-16 14:45:52 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-16 14:45:52 -0400 |
commit | 83932f30ff02d285c8a7e2a363601f460d55d268 (patch) | |
tree | 4bb4a54d89c8584bea8fa19774e9e22ae77278cf /src/lib/tls/tls_cbc | |
parent | f39aa7bb4e43e27b10d3f890da7ba1acba9f14ca (diff) |
Use constant_time_compare instead of same_mem
New name, same great operation
Diffstat (limited to 'src/lib/tls/tls_cbc')
-rw-r--r-- | src/lib/tls/tls_cbc/tls_cbc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/tls/tls_cbc/tls_cbc.cpp b/src/lib/tls/tls_cbc/tls_cbc.cpp index e63893d75..244ddfb99 100644 --- a/src/lib/tls/tls_cbc/tls_cbc.cpp +++ b/src/lib/tls/tls_cbc/tls_cbc.cpp @@ -397,7 +397,7 @@ void TLS_CBC_HMAC_AEAD_Decryption::finish(secure_vector<uint8_t>& buffer, size_t const size_t mac_offset = enc_size; - const bool mac_ok = same_mem(&record_contents[mac_offset], mac_buf.data(), tag_size()); + const bool mac_ok = constant_time_compare(&record_contents[mac_offset], mac_buf.data(), tag_size()); if(!mac_ok) { @@ -459,7 +459,7 @@ void TLS_CBC_HMAC_AEAD_Decryption::finish(secure_vector<uint8_t>& buffer, size_t const size_t mac_offset = record_len - (tag_size() + pad_size); - const bool mac_ok = same_mem(&record_contents[mac_offset], mac_buf.data(), tag_size()); + const bool mac_ok = constant_time_compare(&record_contents[mac_offset], mac_buf.data(), tag_size()); const uint16_t ok_mask = size_ok_mask & CT::expand_mask<uint16_t>(mac_ok) & CT::expand_mask<uint16_t>(pad_size); |