OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview A multiple gnubby signer wraps the process of opening a number | 6 * @fileoverview A multiple gnubby signer wraps the process of opening a number |
7 * of gnubbies, signing each challenge in an array of challenges until a | 7 * of gnubbies, signing each challenge in an array of challenges until a |
8 * success condition is satisfied, and yielding each succeeding gnubby. | 8 * success condition is satisfied, and yielding each succeeding gnubby. |
9 * | 9 * |
10 */ | 10 */ |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 /** | 255 /** |
256 * Called by a SingleGnubbySigner upon completion. | 256 * Called by a SingleGnubbySigner upon completion. |
257 * @param {GnubbyTracker} tracker The tracker object of the gnubby whose result | 257 * @param {GnubbyTracker} tracker The tracker object of the gnubby whose result |
258 * this is. | 258 * this is. |
259 * @param {SingleSignerResult} result The result of the sign operation. | 259 * @param {SingleSignerResult} result The result of the sign operation. |
260 * @private | 260 * @private |
261 */ | 261 */ |
262 MultipleGnubbySigner.prototype.signCompletedCallback_ = | 262 MultipleGnubbySigner.prototype.signCompletedCallback_ = |
263 function(tracker, result) { | 263 function(tracker, result) { |
264 console.log( | 264 console.log( |
265 UTIL_fmt(result.code ? 'failure.' : 'success!' + | 265 UTIL_fmt((result.code ? 'failure.' : 'success!') + |
266 ' gnubby ' + tracker.index + | 266 ' gnubby ' + tracker.index + |
267 ' got code ' + result.code.toString(16))); | 267 ' got code ' + result.code.toString(16))); |
268 if (!tracker.stillGoing) { | 268 if (!tracker.stillGoing) { |
269 console.log(UTIL_fmt('gnubby ' + tracker.index + ' no longer running!')); | 269 console.log(UTIL_fmt('gnubby ' + tracker.index + ' no longer running!')); |
270 // Shouldn't ever happen? Disregard. | 270 // Shouldn't ever happen? Disregard. |
271 return; | 271 return; |
272 } | 272 } |
273 tracker.stillGoing = false; | 273 tracker.stillGoing = false; |
274 tracker.errorStatus = result.code; | 274 tracker.errorStatus = result.code; |
275 var moreExpected = this.tallyCompletedGnubby_(); | 275 var moreExpected = this.tallyCompletedGnubby_(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 'code': result.code, | 344 'code': result.code, |
345 'gnubby': result.gnubby, | 345 'gnubby': result.gnubby, |
346 'gnubbyId': tracker.signer.getDeviceId() | 346 'gnubbyId': tracker.signer.getDeviceId() |
347 }; | 347 }; |
348 if (result['challenge']) | 348 if (result['challenge']) |
349 signResult['challenge'] = result['challenge']; | 349 signResult['challenge'] = result['challenge']; |
350 if (result['info']) | 350 if (result['info']) |
351 signResult['info'] = result['info']; | 351 signResult['info'] = result['info']; |
352 this.gnubbyCompleteCb_(signResult, moreExpected); | 352 this.gnubbyCompleteCb_(signResult, moreExpected); |
353 }; | 353 }; |
OLD | NEW |