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

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

Issue 461403003: Add VID/PID pairs for known U2F devices. Interrim explicit listing until HID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/resources/cryptotoken/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18e20ede2899c078312a9e2c838c43dded68364b..1ffbc276cc71ef266ba103f0eaee71aa8be86da3 100644
--- a/chrome/browser/resources/cryptotoken/gnubby-u2f.js
+++ b/chrome/browser/resources/cryptotoken/gnubby-u2f.js
@@ -34,6 +34,12 @@ 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
@@ -43,11 +49,11 @@ Gnubby.prototype.enroll = function(challenge, appIdHash, cb) {
var apdu = new Uint8Array(
[0x00,
Gnubby.U2F_ENROLL,
- Gnubby.P1_TUP_REQUIRED | Gnubby.P1_TUP_CONSUME |
- Gnubby.P1_INDIVIDUAL_KEY,
+ Gnubby.P1_TUP_REQUIRED | Gnubby.P1_TUP_CONSUME,
0x00, 0x00, 0x00,
challenge.length + appIdHash.length]);
- // TODO: only use P1_INDIVIDUAL_KEY for corp appIdHashes.
+ 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 | « no previous file | chrome/browser/resources/cryptotoken/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698