entd: Fix problem where a future date setting causes TPM token to be cleared often
Change-Id: Icd14783f08c6761c74a35cec10821e3e97ce74ae
BUG=chrome-os-partner:2227
TEST=gmerge to device, set file to future, see .tpm directory persist
Review URL: http://codereview.chromium.org/6312172
diff --git a/bin/fix_pkcs11_token.sh b/bin/fix_pkcs11_token.sh
index 31ccf22..2f080f4 100755
--- a/bin/fix_pkcs11_token.sh
+++ b/bin/fix_pkcs11_token.sh
@@ -31,14 +31,10 @@
return 0
fi
- if [ "/var/lib/.tpm_owned" -nt "$USER_TOKEN_DIR" ]; then
- log "PKCS#11 token for $USERNAME is from a previous TPM owner."
- return 0
- fi
-
if [ ! -e "$USER_TOKEN_DIR/PRIVATE_ROOT_KEY.pem" -o \
! -e "$USER_TOKEN_DIR/TOK_OBJ/70000000" ]; then
- log "PKCS#11 token for $USERNAME is missing some files."
+ log "PKCS#11 token for $USERNAME is missing some files. Possibly not yet"
+ log "initialized? TOK_OBJ contents were $(echo $USER_TOKEN_DIR/TOK_OBJ/*)."
return 0
fi