aboutsummaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-08-23 14:03:09 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-08-23 14:03:09 -0500
commitfa7cdd642074adb5899362aefcced4505d75f681 (patch)
tree78381c86a73e46cc265d58dd9ff770fd56a1ec99 /src/device
parentMerge pull request #4249 (diff)
parentadd and use constant time 32 byte equality function (diff)
downloadmonero-fa7cdd642074adb5899362aefcced4505d75f681.tar.xz
Merge pull request #3999
d2e26c2 add and use constant time 32 byte equality function (moneromooo-monero)
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device_ledger.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp
index 7a34dad5e..c4e9e40b7 100644
--- a/src/device/device_ledger.cpp
+++ b/src/device/device_ledger.cpp
@@ -136,7 +136,8 @@ namespace hw {
}
bool operator==(const crypto::key_derivation &d0, const crypto::key_derivation &d1) {
- return !memcmp(&d0, &d1, sizeof(d0));
+ static_assert(sizeof(crypto::key_derivation) == 32, "key_derivation must be 32 bytes");
+ return !crypto_verify_32((const unsigned char*)&d0, (const unsigned char*)&d1);
}
/* ===================================================================== */