| OLD | NEW |
| 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" |
| 6 |
| 5 #include <algorithm> | 7 #include <algorithm> |
| 6 | 8 |
| 7 #include "base/base64.h" | 9 #include "base/base64.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "chrome/browser/sync/util/cryptographer.h" | 11 #include "sync/util/encryptor.h" |
| 10 #include "chrome/browser/sync/util/encryptor.h" | |
| 11 | 12 |
| 12 namespace browser_sync { | 13 namespace browser_sync { |
| 13 | 14 |
| 14 const char kNigoriTag[] = "google_chrome_nigori"; | 15 const char kNigoriTag[] = "google_chrome_nigori"; |
| 15 | 16 |
| 16 // We name a particular Nigori instance (ie. a triplet consisting of a hostname, | 17 // We name a particular Nigori instance (ie. a triplet consisting of a hostname, |
| 17 // a username, and a password) by calling Permute on this string. Since the | 18 // a username, and a password) by calling Permute on this string. Since the |
| 18 // output of Permute is always the same for a given triplet, clients will always | 19 // output of Permute is always the same for a given triplet, clients will always |
| 19 // assign the same name to a particular triplet. | 20 // assign the same name to a particular triplet. |
| 20 const char kNigoriKeyName[] = "nigori-key"; | 21 const char kNigoriKeyName[] = "nigori-key"; |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 continue; | 438 continue; |
| 438 } | 439 } |
| 439 nigoris_[key.name()] = make_linked_ptr(new_nigori.release()); | 440 nigoris_[key.name()] = make_linked_ptr(new_nigori.release()); |
| 440 } | 441 } |
| 441 } | 442 } |
| 442 DCHECK(nigoris_.end() != nigoris_.find(default_key_name)); | 443 DCHECK(nigoris_.end() != nigoris_.find(default_key_name)); |
| 443 default_nigori_ = &*nigoris_.find(default_key_name); | 444 default_nigori_ = &*nigoris_.find(default_key_name); |
| 444 } | 445 } |
| 445 | 446 |
| 446 } // namespace browser_sync | 447 } // namespace browser_sync |
| OLD | NEW |