Commit 9eacc664 authored by gab@chromium.org's avatar gab@chromium.org

Convert SID string to ASCII before taking md5

(otherwise only half (the common half...:( ) of the sid string would get encoded...)

this change is super trivial and only fixes the resulting suffix

R=grt@chromium.org
BUG=133810
TEST=Make sure Chrome gets the proper suffix


Review URL: https://chromiumcodereview.appspot.com/10703147

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146217 0039d316-1c4b-4281-b951-d872f2087c98
parent 48026231
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <limits> #include <limits>
#include <list> #include <list>
#include <string>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/file_path.h" #include "base/file_path.h"
...@@ -140,7 +141,8 @@ UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { ...@@ -140,7 +141,8 @@ UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() {
} }
COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_); COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_);
base::MD5Digest md5_digest; 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( const string16 base32_md5(
ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a)));
// The value returned by the base32 algorithm above must never change and // The value returned by the base32 algorithm above must never change and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment