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

Unified Diff: base_policy/policy-utils.js

Issue 6821025: entd: move opencryptoki initialization out of entd (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/entd.git@master
Patch Set: switch to using a flag to expect cryptohome to init pkcs11 Created 9 years, 8 months 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
« no previous file with comments | « no previous file | bin/entdwife.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base_policy/policy-utils.js
diff --git a/base_policy/policy-utils.js b/base_policy/policy-utils.js
index 03d99640a9f980a18c1cd373831220f791867408..85b558725d3f8db724c9380562e0becf6af458bf 100644
--- a/base_policy/policy-utils.js
+++ b/base_policy/policy-utils.js
@@ -1241,7 +1241,7 @@ function PolicyCallbacks(policy) {
*/
Policy.Callbacks.prototype['cb:info'] =
function cb_info() {
- return Policy.CallbackSuccess({
+ var callback_data = {
description: this.policy.manifest.description,
version: this.policy.manifest.version,
username: entd.username,
@@ -1253,13 +1253,19 @@ function cb_info() {
isOwned: (entd.isLibcrosLoaded ? entd.tpm.isOwned : true),
isBeingOwned: (entd.isLibcrosLoaded ? entd.tpm.isBeingOwned : false),
statusString: (entd.isLibcrosLoaded ? entd.tpm.statusString :
- "libcros not loaded"),
+ "libcros not loaded")
},
pkcs11: {
state: this.policy.pkcs11.state,
log: this.policy.getLog(this.policy.pkcs11)
}
- });
+ }
+ if ('isTokenReady' in entd.tpm) {
+ callback_data.pkcs11.isTokenReady =
+ (entd.isLibcrosLoaded ? entd.tpm.isTokenReady : false);
+ }
+
+ return Policy.CallbackSuccess(callback_data);
};
/**
@@ -1281,6 +1287,7 @@ function cb_info() {
* if the operation completes successfully but the token is not ready due to
* some unexpected condition, it will become 'stop:user-pin'. On error it will
* become 'stop:error'.
+ * TODO(crosbug.com/14277): Remove SetPIN functions.
*/
Policy.Callbacks.prototype['cb:setUserPin'] =
function cb_setUserPin(arg) {
@@ -1413,6 +1420,7 @@ function cb_setPin_(arg) {
* initialization is in progress the token state will be 'start:init'. If the
* operation completes successfully the token state will become 'stop:init'.
* On error it will become 'stop:error'.
+ * TODO(crosbug.com/14277): Remove initToken function.
*/
Policy.Callbacks.prototype['cb:initToken'] =
function cb_initToken(arg) {
@@ -1668,6 +1676,8 @@ function CallbackSuccess(data) {
*/
Policy.CallbackError =
function CallbackError(data) {
+ // Log the error to syslogs for further diagnosis.
+ entd.syslog.error(data);
return { status: 'error', data: data };
};
« no previous file with comments | « no previous file | bin/entdwife.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698