Skip to content
Snippets Groups Projects
Commit 6293af8a authored by J.C. Jones's avatar J.C. Jones
Browse files

Bug 1399334 - Add more debugging to see why certificates aren't valid. r=ttaubert

There's an intermittent that is showing up now that test_register_sign.html
checks state.attestationCert.verify(); to ensure hte SoftToken's certificate
is valid. This patch prints the offending certificate when it's encountered,
to help diagnose the root cause.

MozReview-Commit-ID: 4QSobq9fBGK
parent d0cd12af
No related branches found
No related tags found
No related merge requests found
......@@ -104,17 +104,20 @@ async function doTests() {
var signedData = assembleRegistrationSignedData(state.appParam, state.challengeParam, state.keyHandleBytes, state.publicKeyBytes);
return verifySignature(attestationPublicKey, signedData, state.attestationSig);
}).then(function(verified) {
local_ok(verified, "Attestation Certificate signature verified")
local_ok(verified, "Attestation Certificate signature verified");
// Import the public key of the U2F token into WebCrypto
return importPublicKey(state.publicKeyBytes)
return importPublicKey(state.publicKeyBytes);
}).then(function(key) {
state.publicKey = key;
local_ok(true, "Imported public key")
local_ok(true, "Imported public key");
// Ensure the attestation certificate is properly self-signed
return state.attestationCert.verify()
return state.attestationCert.verify();
}).then(function(verified) {
local_ok(verified, "Register attestation signature verified")
if (!verified) {
local_ok(verified, "Cert problem: " + bytesToBase64UrlSafe(state.attestation));
}
local_ok(verified, "Register attestation signature verified");
});
state.regKey = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment