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

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

Issue 86913002: Make base::Base64Encode() return void (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: One more chromeos-specific fix. 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
« no previous file with comments | « sync/tools/null_invalidation_state_tracker.cc ('k') | 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 if (!base::Base64Encode(encrypted_token, token)) { 264 base::Base64Encode(encrypted_token, token);
265 NOTREACHED(); 265
266 return false;
267 }
268 return true; 266 return true;
269 } 267 }
270 268
271 std::string Cryptographer::UnpackBootstrapToken( 269 std::string Cryptographer::UnpackBootstrapToken(
272 const std::string& token) const { 270 const std::string& token) const {
273 if (token.empty()) 271 if (token.empty())
274 return std::string(); 272 return std::string();
275 273
276 std::string encrypted_data; 274 std::string encrypted_data;
277 if (!base::Base64Decode(token, &encrypted_data)) { 275 if (!base::Base64Decode(token, &encrypted_data)) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 NOTREACHED(); 352 NOTREACHED();
355 return false; 353 return false;
356 } 354 }
357 355
358 if (!AddKeyImpl(nigori.Pass(), true)) 356 if (!AddKeyImpl(nigori.Pass(), true))
359 return false; 357 return false;
360 return true; 358 return true;
361 } 359 }
362 360
363 } // namespace syncer 361 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/tools/null_invalidation_state_tracker.cc ('k') | sync/util/nigori.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698