Check-in [1c45a8940d]
Overview
SHA1:1c45a8940dc0cbef20747e45c9a639b224a97f52
Date: 2017-03-09 02:15:05
User: rkeene
Comment:ChromeOS: Fix debug
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2017-03-09
02:41
[fbed2df898] Updated to try more application IDs for CACs (user: rkeene, tags: trunk)
02:15
[1c45a8940d] ChromeOS: Fix debug (user: rkeene, tags: trunk)
01:19
[ecf15c25f8] Reverted [317e74ef9b], moving PIN dialog changes to a different branch (user: rkeene, tags: trunk)
Changes

Modified build/chrome/cackey.js from [db44d71906] to [b94f09a4f5].

   190    190   	var nextFunction = null;
   191    191   	var chromeCallback = null;
   192    192   
   193    193   	if (messageEvent.data.target != "cackey") {
   194    194   		return;
   195    195   	}
   196    196   
   197         -	if (GoogleSmartCard.IS_DEBUG_BUILD) {
          197  +	if (goog.DEBUG) {
   198    198   		console.log("START MESSAGE");
   199    199   		console.log(messageEvent.data);
   200    200   		console.log("END MESSAGE");
   201    201   	}
   202    202   
   203    203   	/*
   204    204   	 * If we failed for some reason and we have a certificate in the original
................................................................................
   209    209   			if (messageEvent.data.originalrequest.certificate) {
   210    210   				delete cackeyCertificateToPINMap[cackeyCertificateToPINID(messageEvent.data.originalrequest.certificate)];
   211    211   			}
   212    212   		}
   213    213   	}
   214    214   
   215    215   	if (messageEvent.data.command == "init" && messageEvent.data.status == "success") {
   216         -		if (GoogleSmartCard.IS_DEBUG_BUILD) {
          216  +		if (goog.DEBUG) {
   217    217   			console.log("[cackey] Initialization completed, resending any queued messages");
   218    218   		}
   219    219   
   220    220   		cackeyInitPCSCCompleted("success");
   221    221   	}
   222    222   
   223    223   	if (messageEvent.data.id == null) {
................................................................................
   302    302   
   303    303   					for (messageIdx = 0; messageIdx < cackeyMessagesToRetry.length; messageIdx++) {
   304    304   						var tmpMessageEvent;
   305    305   
   306    306   						tmpMessageEvent = cackeyMessagesToRetry[messageIdx];
   307    307   
   308    308   						if (pinWindowPINValue == "") {
   309         -							if (GoogleSmartCard.IS_DEBUG_BUILD) {
          309  +							if (goog.DEBUG) {
   310    310   								console.log("[cackey] The PIN dialog was closed without gathering a PIN, treating it as a failure.");
   311    311   							}
   312    312   
   313    313   							tmpMessageEvent.data.status = "error";
   314    314   							tmpMessageEvent.data.error = "PIN window closed without a PIN being provided";
   315    315   
   316    316   							cackeyMessageIncoming(tmpMessageEvent);
................................................................................
   403    403   
   404    404   /*
   405    405    * Handler for messages from Chrome related to listing certificates
   406    406    */
   407    407   function cackeyListCertificates(chromeCallback) {
   408    408   	var callbackId;
   409    409   
   410         -	if (GoogleSmartCard.IS_DEBUG_BUILD) {
          410  +	if (goog.DEBUG) {
   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    414   	callbackId = ++cackeyOutstandingCallbackCounter;
   415    415   
   416    416   	cackeyInitPCSC(function() {
   417    417   		cackeyHandle.postMessage(
................................................................................
   420    420   				'command': "listcertificates",
   421    421   				'id': callbackId
   422    422   			}
   423    423   		);
   424    424   
   425    425   		cackeyOutstandingCallbacks[callbackId] = chromeCallback;
   426    426   
   427         -		if (GoogleSmartCard.IS_DEBUG_BUILD) {
          427  +		if (goog.DEBUG) {
   428    428   			console.log("[cackey] Thrown.");
   429    429   		}
   430    430   	}, chromeCallback);
   431    431   
   432    432   	return;
   433    433   }
   434    434   
   435    435   /*
   436    436    * Handler for messages from Chrome related to listing readers
   437    437    */
   438    438   function cackeyListReaders(chromeCallback) {
   439    439   	var callbackId;
   440    440   
   441         -	if (GoogleSmartCard.IS_DEBUG_BUILD) {
          441  +	if (goog.DEBUG) {
   442    442   		console.log("[cackey] Asked to provide a list of readers -- throwing that request over to the NaCl side... ");
   443    443   	}
   444    444   
   445    445   	callbackId = ++cackeyOutstandingCallbackCounter;
   446    446   
   447    447   	cackeyInitPCSC(function() {
   448    448   		cackeyHandle.postMessage(
................................................................................
   451    451   				'command': "listreaders",
   452    452   				'id': callbackId
   453    453   			}
   454    454   		);
   455    455   
   456    456   		cackeyOutstandingCallbacks[callbackId] = chromeCallback;
   457    457   
   458         -		if (GoogleSmartCard.IS_DEBUG_BUILD) {
          458  +		if (goog.DEBUG) {
   459    459   			console.log("[cackey] Thrown.");
   460    460   		}
   461    461   	}, chromeCallback);
   462    462   
   463    463   	return;
   464    464   }
   465    465   
................................................................................
   495    495   
   496    496   	digest = new Uint8Array(digestHeader.length + signRequest.digest.byteLength);
   497    497   	digest.set(digestHeader, 0);
   498    498   	digest.set(new Uint8Array(signRequest.digest), digestHeader.length);
   499    499   
   500    500   	delete digestHeader;
   501    501   
   502         -	if (GoogleSmartCard.IS_DEBUG_BUILD) {
          502  +	if (goog.DEBUG) {
   503    503   		console.log("[cackey] Asked to sign a message -- throwing that request over to the NaCl side... ");
   504    504   	}
   505    505   
   506    506   	callbackId = ++cackeyOutstandingCallbackCounter;
   507    507   
   508    508   	command = {
   509    509   		'target': "cackey",
................................................................................
   522    522   	}
   523    523   
   524    524   	cackeyInitPCSC(function() {
   525    525   		cackeyHandle.postMessage(command);
   526    526   
   527    527   		cackeyOutstandingCallbacks[callbackId] = chromeCallback;
   528    528   
   529         -		if (GoogleSmartCard.IS_DEBUG_BUILD) {
          529  +		if (goog.DEBUG) {
   530    530   			console.log("[cackey] Thrown.");
   531    531   		}
   532    532   	}, chromeCallback);
   533    533   
   534    534   	return;
   535    535   }
   536    536   
................................................................................
   768    768   		console.log("[cackey] cackeyInit(): Already initialized.  Returning.");
   769    769   
   770    770   		return;
   771    771   	}
   772    772   
   773    773   	/* Verify that we can register callbacks */
   774    774   	if (!chrome.certificateProvider) {
   775         -		if (!GoogleSmartCard.IS_DEBUG_BUILD) {
          775  +		if (!goog.DEBUG) {
   776    776   			console.info("[cackey] This extension's primary functionality only works on ChromeOS!  You won't be able to do much with it.");
   777    777   		}
   778    778   	}
   779    779   
   780    780   	elementEmbed = document.createElement('embed');
   781    781   	elementEmbed.type = "application/x-pnacl";
   782    782   	elementEmbed.width = 0;