Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4050)

Unified Diff: chrome/browser/resources/cryptotoken/gnubby-u2f.js

Issue 596083002: Update cryptotoken to 0.8.63 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove a deprecated line Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/cryptotoken/gnubby-u2f.js
diff --git a/chrome/browser/resources/cryptotoken/gnubby-u2f.js b/chrome/browser/resources/cryptotoken/gnubby-u2f.js
index 1ffbc276cc71ef266ba103f0eaee71aa8be86da3..9dd84fd075c6572e485197cc594b1c9e7c6a43a2 100644
--- a/chrome/browser/resources/cryptotoken/gnubby-u2f.js
+++ b/chrome/browser/resources/cryptotoken/gnubby-u2f.js
@@ -34,26 +34,25 @@ Gnubby.U2F_V1 = 'U2F_V1';
/** V2 of the applet. */
Gnubby.U2F_V2 = 'U2F_V2';
-/**
- * Google corporate appId hash
- * @private
- */
-Gnubby.GOOGLE_CORP_APP_ID_HASH_ = 'ZEZHL99u7Xvzwzcg8jZnbDbhtF6-BIXbiaPN_dJL1p8';
-
/** Perform enrollment
* @param {ArrayBuffer|Uint8Array} challenge Enrollment challenge
* @param {ArrayBuffer|Uint8Array} appIdHash Hashed application id
* @param {function(...)} cb Result callback
+ * @param {boolean=} opt_individualAttestation Request the individual
+ * attestation cert rather than the batch one.
*/
-Gnubby.prototype.enroll = function(challenge, appIdHash, cb) {
+Gnubby.prototype.enroll = function(challenge, appIdHash, cb,
+ opt_individualAttestation) {
+ var p1 = Gnubby.P1_TUP_REQUIRED | Gnubby.P1_TUP_CONSUME;
+ if (opt_individualAttestation) {
+ p1 |= Gnubby.P1_INDIVIDUAL_KEY;
+ }
var apdu = new Uint8Array(
[0x00,
Gnubby.U2F_ENROLL,
- Gnubby.P1_TUP_REQUIRED | Gnubby.P1_TUP_CONSUME,
+ p1,
0x00, 0x00, 0x00,
challenge.length + appIdHash.length]);
- if (B64_encode(appIdHash) == Gnubby.GOOGLE_CORP_APP_ID_HASH_)
- apdu[2] |= Gnubby.P1_INDIVIDUAL_KEY;
var u8 = new Uint8Array(apdu.length + challenge.length +
appIdHash.length + 2);
for (var i = 0; i < apdu.length; ++i) u8[i] = apdu[i];
« no previous file with comments | « chrome/browser/resources/cryptotoken/enroller.js ('k') | chrome/browser/resources/cryptotoken/googlecorpindividualattest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698