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

Unified Diff: remoting/protocol/auth_token_utils.cc

Issue 7048020: Don't use letters in me2mom access code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 7 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
Index: remoting/protocol/auth_token_utils.cc
diff --git a/remoting/protocol/auth_token_utils.cc b/remoting/protocol/auth_token_utils.cc
index 29728f31c195a0c48abfa0c0225c349c4c192341..50edca3802261daba8f99c8e2920ff7d4b7e16bb 100644
--- a/remoting/protocol/auth_token_utils.cc
+++ b/remoting/protocol/auth_token_utils.cc
@@ -12,27 +12,6 @@
namespace remoting {
namespace protocol {
-namespace {
-
-// Normalizes access code. Must be applied on the access code entered
-// by the user before generating auth token. It (1)converts the string
-// to upper case, (2) replaces O with 0 and (3) replaces I with 1.
-std::string NormalizeAccessCode(const std::string& access_code) {
- std::string normalized = access_code;
- StringToUpperASCII(&normalized);
- for (std::string::iterator i = normalized.begin();
- i != normalized.end(); ++i) {
- if (*i == 'O') {
- *i = '0';
- } else if (*i == 'I') {
- *i = '1';
- }
- }
- return normalized;
-}
-
-} // namespace
-
std::string GenerateSupportAuthToken(const std::string& jid,
const std::string& access_code) {
std::string sha256 = crypto::SHA256HashString(jid + " " + access_code);
@@ -47,7 +26,7 @@ bool VerifySupportAuthToken(const std::string& jid,
const std::string& access_code,
const std::string& auth_token) {
std::string expected_token =
- GenerateSupportAuthToken(jid, NormalizeAccessCode(access_code));
+ GenerateSupportAuthToken(jid, access_code);
return expected_token == auth_token;
}

Powered by Google App Engine
This is Rietveld 408576698