Check-in [40765d7728]
Overview
SHA1:40765d77283c64f16fe86ee3f84b194aaaa6072c
Date: 2016-03-09 04:40:03
User: rkeene
Comment:ChromeOS: Fix issue where multiple calls made close together may have used the same ID
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-03-09
04:48
[e0f544bc9b] ChromeOS: Added list of readers detected to smartcard UI (user: rkeene, tags: trunk)
04:40
[40765d7728] ChromeOS: Fix issue where multiple calls made close together may have used the same ID (user: rkeene, tags: trunk)
04:30
[64c4c68fa6] ChromeOS: Added support for listing smartcard readers (user: rkeene, tags: trunk)
Changes

Modified build/chrome/cackey.js from [acab99bc2a] to [cc6681845c].

   407    407   function cackeyListCertificates(chromeCallback) {
   408    408   	var callbackId;
   409    409   
   410    410   	if (GoogleSmartCard.IS_DEBUG_BUILD) {
   411    411   		console.log("[cackey] Asked to provide a list of certificates -- throwing that request over to the NaCl side... ");
   412    412   	}
   413    413   
   414         -	callbackId = cackeyOutstandingCallbackCounter + 1;
          414  +	callbackId = ++cackeyOutstandingCallbackCounter;
   415    415   
   416    416   	cackeyInitPCSC(function() {
   417    417   		cackeyHandle.postMessage(
   418    418   			{
   419    419   				'target': "cackey",
   420    420   				'command': "listcertificates",
   421    421   				'id': callbackId
   422    422   			}
   423    423   		);
   424    424   
   425         -		cackeyOutstandingCallbackCounter = callbackId;
   426    425   		cackeyOutstandingCallbacks[callbackId] = chromeCallback;
   427    426   
   428    427   		if (GoogleSmartCard.IS_DEBUG_BUILD) {
   429    428   			console.log("[cackey] Thrown.");
   430    429   		}
   431    430   	}, chromeCallback);
   432    431   
................................................................................
   439    438   function cackeyListReaders(chromeCallback) {
   440    439   	var callbackId;
   441    440   
   442    441   	if (GoogleSmartCard.IS_DEBUG_BUILD) {
   443    442   		console.log("[cackey] Asked to provide a list of readers -- throwing that request over to the NaCl side... ");
   444    443   	}
   445    444   
   446         -	callbackId = cackeyOutstandingCallbackCounter + 1;
          445  +	callbackId = ++cackeyOutstandingCallbackCounter;
   447    446   
   448    447   	cackeyInitPCSC(function() {
   449    448   		cackeyHandle.postMessage(
   450    449   			{
   451    450   				'target': "cackey",
   452    451   				'command': "listreaders",
   453    452   				'id': callbackId
   454    453   			}
   455    454   		);
   456    455   
   457         -		cackeyOutstandingCallbackCounter = callbackId;
   458    456   		cackeyOutstandingCallbacks[callbackId] = chromeCallback;
   459    457   
   460    458   		if (GoogleSmartCard.IS_DEBUG_BUILD) {
   461    459   			console.log("[cackey] Thrown.");
   462    460   		}
   463    461   	}, chromeCallback);
   464    462   
................................................................................
   501    499   
   502    500   	delete digestHeader;
   503    501   
   504    502   	if (GoogleSmartCard.IS_DEBUG_BUILD) {
   505    503   		console.log("[cackey] Asked to sign a message -- throwing that request over to the NaCl side... ");
   506    504   	}
   507    505   
   508         -	callbackId = cackeyOutstandingCallbackCounter + 1;
          506  +	callbackId = ++cackeyOutstandingCallbackCounter;
   509    507   
   510    508   	command = {
   511    509   		'target': "cackey",
   512    510   		'command': "sign",
   513    511   		'id': callbackId,
   514    512   		'certificate': signRequest.certificate,
   515    513   		'data': digest.buffer
................................................................................
   522    520   
   523    521   		cackeyCertificateToPINMapUpdateLastUsed(certificateId);
   524    522   	}
   525    523   
   526    524   	cackeyInitPCSC(function() {
   527    525   		cackeyHandle.postMessage(command);
   528    526   
   529         -		cackeyOutstandingCallbackCounter = callbackId;
   530    527   		cackeyOutstandingCallbacks[callbackId] = chromeCallback;
   531    528   
   532    529   		if (GoogleSmartCard.IS_DEBUG_BUILD) {
   533    530   			console.log("[cackey] Thrown.");
   534    531   		}
   535    532   	}, chromeCallback);
   536    533