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

Side by Side Diff: trunk/src/sync/util/cryptographer.cc

Issue 101113004: Revert 239759 "The comment in base64.h implies that base::Base64..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/sync/tools/null_invalidation_state_tracker.cc ('k') | trunk/src/sync/util/nigori.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/util/cryptographer.h" 5 #include "sync/util/cryptographer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 std::string unencrypted_token = GetDefaultNigoriKey(); 254 std::string unencrypted_token = GetDefaultNigoriKey();
255 if (unencrypted_token.empty()) 255 if (unencrypted_token.empty())
256 return false; 256 return false;
257 257
258 std::string encrypted_token; 258 std::string encrypted_token;
259 if (!encryptor_->EncryptString(unencrypted_token, &encrypted_token)) { 259 if (!encryptor_->EncryptString(unencrypted_token, &encrypted_token)) {
260 NOTREACHED(); 260 NOTREACHED();
261 return false; 261 return false;
262 } 262 }
263 263
264 base::Base64Encode(encrypted_token, token); 264 if (!base::Base64Encode(encrypted_token, token)) {
265 265 NOTREACHED();
266 return false;
267 }
266 return true; 268 return true;
267 } 269 }
268 270
269 std::string Cryptographer::UnpackBootstrapToken( 271 std::string Cryptographer::UnpackBootstrapToken(
270 const std::string& token) const { 272 const std::string& token) const {
271 if (token.empty()) 273 if (token.empty())
272 return std::string(); 274 return std::string();
273 275
274 std::string encrypted_data; 276 std::string encrypted_data;
275 if (!base::Base64Decode(token, &encrypted_data)) { 277 if (!base::Base64Decode(token, &encrypted_data)) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 NOTREACHED(); 354 NOTREACHED();
353 return false; 355 return false;
354 } 356 }
355 357
356 if (!AddKeyImpl(nigori.Pass(), true)) 358 if (!AddKeyImpl(nigori.Pass(), true))
357 return false; 359 return false;
358 return true; 360 return true;
359 } 361 }
360 362
361 } // namespace syncer 363 } // namespace syncer
OLDNEW
« no previous file with comments | « trunk/src/sync/tools/null_invalidation_state_tracker.cc ('k') | trunk/src/sync/util/nigori.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698