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

Unified Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc

Issue 729803002: Easy Sign-in: Use TPM RSA key to sign nonce in sign-in protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
index aa24dae249c0d9906d624cf5ea502570b0b6fa16..16c26cad98f20872b09383e51dc8917e0724d152 100644
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
@@ -25,6 +25,8 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/chromeos_utils.h"
+#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.h"
+#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_factory.h"
#include "chrome/browser/ui/webui/options/chromeos/user_image_source.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
@@ -608,8 +610,20 @@ bool EasyUnlockPrivateGetSignInChallengeFunction::RunAsync() {
Profile* profile = Profile::FromBrowserContext(browser_context());
const std::string challenge =
EasyUnlockService::Get(profile)->GetChallenge();
- // TODO(tbarzic): Implement nonce signing.
- OnDone(challenge, std::string() /* signed_nonce */);
+ if (!challenge.empty() && !params->nonce.empty()) {
+ EasyUnlockTpmKeyManager* key_manager =
+ EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile);
+ if (!key_manager)
+ return false;
xiyuan 2014/12/02 23:15:58 nit: SetError('No EasyUnlockTpmKeyManager.') befor
tbarzic 2014/12/03 19:10:28 Done.
+ key_manager->SignUsingTpmKey(
+ EasyUnlockService::Get(profile)->GetUserEmail(),
+ params->nonce,
+ base::Bind(&EasyUnlockPrivateGetSignInChallengeFunction::OnDone,
+ this,
+ challenge));
+ } else {
+ OnDone(challenge, std::string());
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698