summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_about_handler.cc
diff options
context:
space:
mode:
authorstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 18:41:06 +0000
committerstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 18:41:06 +0000
commit009078018f3ce8d3645f3ee5a98c88f2811ad216 (patch)
tree58e2b277fce6bdff922b7f259e9f2189fcf19cb9 /chrome/browser/browser_about_handler.cc
parenteee2b3ff7ab374128c1fb5337f988b651468583e (diff)
downloadchromium_src-009078018f3ce8d3645f3ee5a98c88f2811ad216.zip
chromium_src-009078018f3ce8d3645f3ee5a98c88f2811ad216.tar.gz
chromium_src-009078018f3ce8d3645f3ee5a98c88f2811ad216.tar.bz2
Additional about:cryptohome info
BUG=chromium-os:16577 TEST=Test about:cryptohome; should now have a 'crypto:' section. Review URL: http://codereview.chromium.org/7230014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_about_handler.cc')
-rw-r--r--chrome/browser/browser_about_handler.cc26
1 files changed, 23 insertions, 3 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index cd86b8b..328a22a 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -49,6 +49,7 @@
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/common/gpu/gpu_messages.h"
+#include "crypto/nss_util.h"
#include "googleurl/src/gurl.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
@@ -575,6 +576,13 @@ std::string AddBoolRow(const std::string& name, bool value) {
return WrapWithTR(row);
}
+std::string AddStringRow(const std::string& name, const std::string& value) {
+ std::string row;
+ row.append(WrapWithTD(name));
+ row.append(WrapWithTD(value));
+ return WrapWithTR(row);
+}
+
std::string GetCryptohomeHtmlInfo(int refresh) {
chromeos::CryptohomeLibrary* cryptohome =
chromeos::CrosLibrary::Get()->GetCryptohomeLibrary();
@@ -584,7 +592,8 @@ std::string GetCryptohomeHtmlInfo(int refresh) {
output.append("<body>");
output.append(AboutRefresh(refresh, "cryptohome"));
- output.append("<h3>CryptohomeLibrary:</h3><table>");
+ output.append("<h3>CryptohomeLibrary:</h3>");
+ output.append("<table>");
output.append(AddBoolRow("IsMounted", cryptohome->IsMounted()));
output.append(AddBoolRow("TpmIsReady", cryptohome->TpmIsReady()));
output.append(AddBoolRow("TpmIsEnabled", cryptohome->TpmIsEnabled()));
@@ -592,8 +601,19 @@ std::string GetCryptohomeHtmlInfo(int refresh) {
output.append(AddBoolRow("TpmIsBeingOwned", cryptohome->TpmIsBeingOwned()));
output.append(AddBoolRow("Pkcs11IsTpmTokenReady",
cryptohome->Pkcs11IsTpmTokenReady()));
-
- output.append("</table></body></html>");
+ output.append("</table>");
+
+ std::string token_name, user_pin;
+ crypto::GetTPMTokenInfo(&token_name, &user_pin);
+ output.append("<h3>crypto:</h3>");
+ output.append("<table>");
+ output.append(AddBoolRow("IsTPMTokenReady", crypto::IsTPMTokenReady()));
+ output.append(AddStringRow("token_name", token_name));
+ output.append(AddStringRow("user_pin", std::string(user_pin.length(), '*')));
+ output.append("</table>");
+
+ output.append("</body>");
+ output.append("</html>");
return output;
}