dom/u2f/tests/frame_no_token.html
author ffxbld <ffxbld@mozilla.com>
Mon, 03 Aug 2020 10:13:16 +0000
changeset 605813 0e0faa02ce530adccb4b358a56bca24d26548853
parent 432277 dd315914f198f74605f6f3bb5311a12e66a1787f
permissions -rw-r--r--
No Bug, mozilla-release repo-update remote-settings - a=repo-update r=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D85739

<!DOCTYPE html>
<meta charset=utf-8>
<head>
  <script type="text/javascript" src="frame_utils.js"></script>
  <script type="text/javascript" src="u2futil.js"></script>
</head>
<body>
<p>No token check (because of how prefs work)</p>
<script class="testbody" type="text/javascript">
"use strict";

async function doTests() {
  var challenge = new Uint8Array(16);
  window.crypto.getRandomValues(challenge);

  var regRequest = {
    version: "U2F_V2",
    challenge: bytesToBase64UrlSafe(challenge),
  };

  await promiseU2FRegister(window.location.origin, [regRequest], [], function (res) {
    local_isnot(res.errorCode, 0, "The registration should be rejected.");
  })

  local_finished();
};

doTests();
</script>
</body>
</html>