Index: build/chrome/cackey.js ================================================================== --- build/chrome/cackey.js +++ build/chrome/cackey.js @@ -112,13 +112,15 @@ if (messageEvent.data.target != "cackey") { return; } - console.log("START MESSAGE"); - console.log(messageEvent.data); - console.log("END MESSAGE"); + if (!GoogleSmartCard.IS_DEBUG_BUILD) { + console.log("START MESSAGE"); + console.log(messageEvent.data); + console.log("END MESSAGE"); + } /* * If we failed for some reason and we have a certificate in the original * request then forget any PIN associated with that certificate */ @@ -133,11 +135,11 @@ } chromeCallback = cackeyOutstandingCallbacks[messageEvent.data.id]; if (chromeCallback == null) { - console.log("[cackey] Discarding outdated message"); + console.error("[cackey] Discarding outdated message"); return; } switch (messageEvent.data.status) { @@ -186,11 +188,11 @@ * Set the PIN value to blank */ pinWindowPINValue = ""; if (!pinWindow) { - console.log("[cackey] No window was provided for PIN entry, this will not go well."); + console.error("[cackey] No window was provided for PIN entry, this will not go well."); return; } pinWindowPreviousHandle = pinWindow; @@ -211,11 +213,13 @@ var tmpMessageEvent; tmpMessageEvent = cackeyMessagesToRetry[messageIdx]; if (pinWindowPINValue == "") { - console.log("[cackey] The PIN dialog was closed without gathering a PIN, treating it as a failure."); + if (!GoogleSmartCard.IS_DEBUG_BUILD) { + console.log("[cackey] The PIN dialog was closed without gathering a PIN, treating it as a failure."); + } tmpMessageEvent.data.status = "error"; tmpMessageEvent.data.error = "PIN window closed without a PIN being provided"; cackeyMessageIncoming(tmpMessageEvent); @@ -286,11 +290,13 @@ * Handler for messages from Chrome related to listing certificates */ function cackeyListCertificates(chromeCallback) { var callbackId; - console.log("[cackey] Asked to provide a list of certificates -- throwing that request over to the NaCl side... "); + if (!GoogleSmartCard.IS_DEBUG_BUILD) { + console.log("[cackey] Asked to provide a list of certificates -- throwing that request over to the NaCl side... "); + } callbackId = cackeyOutstandingCallbackCounter + 1; cackeyHandle.postMessage( { @@ -301,11 +307,13 @@ ); cackeyOutstandingCallbackCounter = callbackId; cackeyOutstandingCallbacks[callbackId] = chromeCallback; - console.log("[cackey] Thrown."); + if (!GoogleSmartCard.IS_DEBUG_BUILD) { + console.log("[cackey] Thrown."); + } return; } /* @@ -342,11 +350,13 @@ digest.set(digestHeader, 0); digest.set(new Uint8Array(signRequest.digest), digestHeader.length); delete digestHeader; - console.log("[cackey] Asked to sign a message -- throwing that request over to the NaCl side... "); + if (!GoogleSmartCard.IS_DEBUG_BUILD) { + console.log("[cackey] Asked to sign a message -- throwing that request over to the NaCl side... "); + } callbackId = cackeyOutstandingCallbackCounter + 1; command = { 'target': "cackey", @@ -365,11 +375,13 @@ cackeyHandle.postMessage(command); cackeyOutstandingCallbackCounter = callbackId; cackeyOutstandingCallbacks[callbackId] = chromeCallback; - console.log("[cackey] Thrown."); + if (!GoogleSmartCard.IS_DEBUG_BUILD) { + console.log("[cackey] Thrown."); + } return; } /* @@ -397,11 +409,10 @@ /* * Start the Google PCSC Interface */ new GoogleSmartCard.PcscNacl(cackeyHandle); - return; } /*