OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/internal_api/sync_encryption_handler_impl.h" | 5 #include "sync/internal_api/sync_encryption_handler_impl.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 return; | 337 return; |
338 } | 338 } |
339 | 339 |
340 Cryptographer* cryptographer = | 340 Cryptographer* cryptographer = |
341 &UnlockVaultMutable(trans.GetWrappedTrans())->cryptographer; | 341 &UnlockVaultMutable(trans.GetWrappedTrans())->cryptographer; |
342 | 342 |
343 // Once we've migrated to keystore, the only way to set a passphrase for | 343 // Once we've migrated to keystore, the only way to set a passphrase for |
344 // encryption is to set a custom passphrase. | 344 // encryption is to set a custom passphrase. |
345 if (IsNigoriMigratedToKeystore(node.GetNigoriSpecifics())) { | 345 if (IsNigoriMigratedToKeystore(node.GetNigoriSpecifics())) { |
346 if (!is_explicit) { | 346 if (!is_explicit) { |
347 DCHECK(cryptographer->is_ready()); | |
348 // The user is setting a new implicit passphrase. At this point we don't | 347 // The user is setting a new implicit passphrase. At this point we don't |
349 // care, so drop it on the floor. This is safe because if we have a | 348 // care, so drop it on the floor. This is safe because if we have a |
350 // migrated nigori node, then we don't need to create an initial | 349 // migrated nigori node, then we don't need to create an initial |
351 // encryption key. | 350 // encryption key. |
352 LOG(WARNING) << "Ignoring new implicit passphrase. Keystore migration " | 351 LOG(WARNING) << "Ignoring new implicit passphrase. Keystore migration " |
353 << "already performed."; | 352 << "already performed."; |
354 return; | 353 return; |
355 } | 354 } |
356 // Will fail if we already have an explicit passphrase or we have pending | 355 // Will fail if we already have an explicit passphrase or we have pending |
357 // keys. | 356 // keys. |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 | 1641 |
1643 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime() const { | 1642 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime() const { |
1644 if (passphrase_type_ == FROZEN_IMPLICIT_PASSPHRASE) | 1643 if (passphrase_type_ == FROZEN_IMPLICIT_PASSPHRASE) |
1645 return migration_time(); | 1644 return migration_time(); |
1646 else if (passphrase_type_ == CUSTOM_PASSPHRASE) | 1645 else if (passphrase_type_ == CUSTOM_PASSPHRASE) |
1647 return custom_passphrase_time(); | 1646 return custom_passphrase_time(); |
1648 return base::Time(); | 1647 return base::Time(); |
1649 } | 1648 } |
1650 | 1649 |
1651 } // namespace browser_sync | 1650 } // namespace browser_sync |
OLD | NEW |