Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: crypto/hmac.cc

Issue 8124011: Add constant-time comparison operators for cryptographic uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« crypto/hmac.h ('K') | « crypto/hmac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/hmac.cc
===================================================================
--- crypto/hmac.cc (revision 103793)
+++ crypto/hmac.cc (working copy)
@@ -20,7 +20,7 @@
// so as to not to reveal to the attacker where the difference(s) are.
// For an example attack, see
// http://groups.google.com/group/keyczar-discuss/browse_thread/thread/5571eca0948b2a13
-static bool SecureMemcmp(const void* s1, const void* s2, size_t n) {
+bool SecureMemcmp(const void* s1, const void* s2, size_t n) {
const unsigned char* s1_ptr = reinterpret_cast<const unsigned char*>(s1);
const unsigned char* s2_ptr = reinterpret_cast<const unsigned char*>(s2);
unsigned char tmp = 0;
« crypto/hmac.h ('K') | « crypto/hmac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698