author J.C. Jones <>
Thu, 26 Jan 2017 15:18:50 -0700
changeset 380270 456d27bbbe7429efb8c7df47820353af7dabd424
child 395196 d38ae6ee4f4f14a439bbbb1694a7dab6191cb416
permissions -rw-r--r--
Bug 1333592 - Fix a regression with U2F sign() called with multiple keys r=keeler Add a test that U2F supports signing with multiple keys. Reorder the WaitGroupDone calls to ensure they always fire, even if there are multiple actions in flight. Also, change the status lanbda captures to capture by reference, and disable the copy constructor that would let the by-value work. Interestingly, the compiler is choosing by-reference by default -- at least logs show that the behavior is correct without this change, but still - this is the right thing to do. Updated: Fix the unit tests and write a README that explains why they have to use an iframe, while WebAuthn tests do not. MozReview-Commit-ID: AqSyxU5N4yu

<!DOCTYPE html>
<meta charset=utf-8>
  <title>Test for Multiple Keys for FIDO U2F</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="u2futil.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />

<h1>Test Multiple Keys for FIDO U2F</h1>
<a target="_blank" href="">Mozilla Bug 1333592</a>

<script class="testbody" type="text/javascript">
"use strict";

 /** Test for XBL scope behavior. **/

// Embed the real test. It will take care of everything else.
// This is necessary since the U2F object on window is hidden behind a preference
// and window won't pick up changes by pref without a reload.
SpecialPowers.pushPrefEnv({"set": [["security.webauth.u2f", true],
                                   ["security.webauth.u2f_enable_softtoken", true],
                                   ["security.webauth.u2f_enable_usbtoken", false]]},
function() {
  // listen for messages from the test harness
  window.addEventListener("message", handleEventMessage);
  document.getElementById('testing_frame').src = "frame_multiple_keys.html";

<div id="framediv">
  <iframe id="testing_frame"></iframe>