Bug 1142730 - Show client cert in WebIDE auth dialog. r=past

--HG--
extra : transplant_source : %B7Q%A2%40%CD%F13%88%E1%AD%8B%CD%3A%AFR%F8%D5%98E%0A
This commit is contained in:
J. Ryan Stinnett 2015-03-12 17:37:17 -05:00
parent b56c43ff6c
commit 420c734fb3
3 changed files with 13 additions and 0 deletions

View File

@ -9,6 +9,8 @@ const { Services } = Cu.import("resource://gre/modules/Services.jsm");
const { require } =
Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
const QR = require("devtools/toolkit/qrcode/index");
const PROPERTIES = "chrome://browser/locale/devtools/webide.properties";
const Strings = Services.strings.createBundle(PROPERTIES);
window.addEventListener("load", function onLoad() {
window.removeEventListener("load", onLoad);
@ -31,6 +33,10 @@ function createQR(oob) {
}
function createToken(oob) {
let spacedCert = oob.sha256.replace(/:/g, " ").toLowerCase();
let certText = Strings.formatStringFromName("wifi_auth_cert",
[spacedCert], 1);
document.querySelector("#cert").textContent = certText;
let token = oob.sha256.replace(/:/g, "").toLowerCase() + oob.k;
document.querySelector("#token pre").textContent = token;
}

View File

@ -24,6 +24,7 @@
<h3 id="header">&wifi_auth_header;</h3>
<div id="scan-request">&wifi_auth_scan_request;</div>
<div id="cert"></div>
<div id="qr-code">
<div id="qr-code-wrapper">

View File

@ -77,3 +77,9 @@ status_unknown=UNKNOWN
# Device preferences and settings
device_reset_default=Reset to default
# WiFi Auth
# LOCALIZATION NOTE (wifi_auth_cert): Part of the dialog that instructs the
# user to transfer an authentication token to the server.
# %1$S: The client's cert fingerprint
wifi_auth_cert=My Cert: %1$S