Diff

Differences From Artifact [76d1838f47]:

To Artifact [42af92888f]:


138
139
140
141
142
143
144








145
146
147
148
149
150
151
	if (messageEvent.data.status != "success") {
		if (messageEvent.data.originalrequest) {
			if (messageEvent.data.originalrequest.certificate) {
				delete cackeyCertificateToPINMap[cackeyCertificateToPINID(messageEvent.data.originalrequest.certificate)];
			}
		}
	}









	if (messageEvent.data.id == null) {
		return;
	}

	chromeCallback = cackeyOutstandingCallbacks[messageEvent.data.id];








>
>
>
>
>
>
>
>







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
	if (messageEvent.data.status != "success") {
		if (messageEvent.data.originalrequest) {
			if (messageEvent.data.originalrequest.certificate) {
				delete cackeyCertificateToPINMap[cackeyCertificateToPINID(messageEvent.data.originalrequest.certificate)];
			}
		}
	}

	if (messageEvent.data.command == "init" && messageEvent.data.status == "success") {
		if (GoogleSmartCard.IS_DEBUG_BUILD) {
			console.log("[cackey] Initialization completed, resending any queued messages");
		}

		cackeyInitPCSCCompleted();
	}

	if (messageEvent.data.id == null) {
		return;
	}

	chromeCallback = cackeyOutstandingCallbacks[messageEvent.data.id];

666
667
668
669
670
671
672






673
674
675
676
677
678
679
			"focused": true,
			"innerBounds": {
				"width": 350,
				"minWidth": 350,
				"height": 135,
				"minHeight": 135
			}






		});
	});

	/*
	 * Register a handler for dealing with the PCSC port being disconnected
	 */
	oldOnPortDisconnectedFunction = GoogleSmartCard.Pcsc.prototype.onPortDisconnected_;







>
>
>
>
>
>







674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
			"focused": true,
			"innerBounds": {
				"width": 350,
				"minWidth": 350,
				"height": 135,
				"minHeight": 135
			}
		}, function(uiWindow) {
			if (!uiWindow) {
				return;
			}

			uiWindow.contentWindow.parentWindow = window;
		});
	});

	/*
	 * Register a handler for dealing with the PCSC port being disconnected
	 */
	oldOnPortDisconnectedFunction = GoogleSmartCard.Pcsc.prototype.onPortDisconnected_;
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
	/*
	 * Register a handler for dealing with the PCSC port being available
	 */
	oldPCSCInitializationCallback = GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_;
	GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_ = function(requestId, instanceId, instance, error) {
		oldPCSCInitializationCallback.apply(this, [requestId, instanceId, instance, error]);

		cackeyInitPCSCCompleted();

		return;
	};

	/*
	 * Initialize global state
	 */
	cackeyInitGlobalState();







<
<







702
703
704
705
706
707
708


709
710
711
712
713
714
715
	/*
	 * Register a handler for dealing with the PCSC port being available
	 */
	oldPCSCInitializationCallback = GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_;
	GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_ = function(requestId, instanceId, instance, error) {
		oldPCSCInitializationCallback.apply(this, [requestId, instanceId, instance, error]);



		return;
	};

	/*
	 * Initialize global state
	 */
	cackeyInitGlobalState();