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

Unified Diff: chrome/installer/util/shell_util.cc

Issue 10703147: Convert SID string to ASCII before taking md5 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index ae69767c8cd37ce0712bd4dbc8b9d2c2fecb18b6..ad8ace3261ac290daa3197b91e34a8e213a3af77 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -14,6 +14,7 @@
#include <limits>
#include <list>
+#include <string>
#include "base/command_line.h"
#include "base/file_path.h"
@@ -140,7 +141,8 @@ UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() {
}
COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_);
base::MD5Digest md5_digest;
- base::MD5Sum(user_sid.c_str(), user_sid.length(), &md5_digest);
+ std::string user_sid_ascii(UTF16ToASCII(user_sid));
+ base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest);
const string16 base32_md5(
ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a)));
// The value returned by the base32 algorithm above must never change and
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698