Changes On Branch 8a375324e966de01

Changes In Branch ssh-agent-ui Excluding Merge-Ins

This is equivalent to a diff from 2a4f67952b to 8a375324e9

2019-06-08
22:17
Use indexOf() instead of includes for backwards compatibility support check-in: 8b2206f04e user: rkeene tags: trunk
2019-06-06
21:56
Merged in trunk Leaf check-in: 8a375324e9 user: rkeene tags: ssh-agent-ui
2019-06-05
21:38
Added a toggle for disabling the Chrome PIN dialog check-in: 2a4f67952b user: rkeene tags: trunk
21:35
Potentially better PIN handling check-in: e5a1e29b79 user: rkeene tags: trunk
18:12
Work on getting an SSH agent UI going check-in: 4ce30d9e04 user: rkeene tags: ssh-agent-ui

Modified build/chrome/manifest.json.in from [7fc12f1eb8] to [49dbf65404].

8
9
10
11
12
13
14

15
16
17
18
19
20
21
22

23
24

25
26
27
28
29
30
31
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34







+








+


+







		"128": "icon.png"
	},
	"app": {
		"background": {
			"scripts": [
				"google-pcsc.js",
				"jsrsasign.js",
				"options.js",
				"ssh-agent.js",
				"cackey.js"
			],
			"persistent": false
		}
	},
	"permissions": [
		"certificateProvider",
		"storage",
		"alwaysOnTopWindows"
	],

	"externally_connectable": {
		"ids": [
			"pnhechapfaindjhompbnflcldabbghjo",
			"okddffdblfhhnmhodogpojmfkjmhinfp"
		]
	}
}

Added build/chrome/options.js version [96c52a5607].


























































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
function backendNameToObject(name) {
	var backend;

	switch (name) {
		case "local":
			backend = chrome.storage.local;
			break;
		case "sync":
			backend = chrome.storage.sync;
			break;
		default:
			throw(new Error("Invalid backend selected:" + name));
			break;
	}

	return(backend);
}

function optionValue(optionName, optionValue) {
	var backend;
	var retrievePromise;

	switch (optionName) {
		case "backend":
			backend = backendNameToObject("local");
			break;
		default:
			backend = backendNameToObject(optionValue("backend"));
			break;
	}

	/*
	 * If a value has been specified, set the parameter -- otherwise retrieve
	 */
	if (optionValue) {
		var setObject = {};
		var previousBackendName, previousBackend;

		/*
		 * If we are changing the backend, migrate settings
		 */
		if (optionName === "backend") {
			previousBackendName = optionValue("backend");
			if (previousBackendName !== optionValue) {
				previousBackend = backendNameToObject(previousBackendName);
			}
		}

		setObject[optionName] = optionValue;

		backend.set(setObject);

		return;
	} else {
		
	}
}

Modified build/chrome/ui.html from [646f12701f] to [a24ccf52c0].

1
2
3
4

5
6
7
8
9
10
11
1
2
3
4
5
6
7
8
9
10
11
12




+







<html>
	<head>
		<title>CACKey</title>
		<script type="text/javascript" src="jsrsasign.js"></script>
		<script type="text/javascript" src="options.js"></script>
		<script type="text/javascript" src="ui.js"></script>
	</head>
	<body>
		<h1>CACKey for Chrome</h1>
		<div>Certificate Provider: <span id="certificate_provider"></span></div>
		<div>Smartcard Readers: <span id="smartcard_readers"></span></div>
		<div>Certificates: <span id="certificates"></span></div>

Modified build/chrome/ui.js from [8a4e675e00] to [153c088fd4].

1
2
3
4
5
6

7

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23














24
25

26
27
28
29
30

31
32
33
34
35
36
37
1
2
3
4
5

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44

45
46
47
48
49
50
51
52





-
+

+
















+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
+




-
+







var globalCerts = null;

function displayCerts(htmlObject, certs) {
	var html = "";
	var idx;
	var cert;
	var cert, certTitle;
	var certObj;
	var ignoredException;

	if (certs.length == 0) {
		htmlObject.innerHTML = "<b>No certificates found</b>";

		return;
	}

	certObj = new X509;

	html += "<ol type=\"1\">";

	for (idx = 0; idx < certs.length; idx++) {
		cert = certs[idx];

		certObj.readCertHex(BAtohex(new Uint8Array(cert.certificate)));

		certTitle = certObj.getSubjectString();
		try {
			certObj.getExtSubjectAltName2().forEach(function(itemPair) {
				var itemName, itemValue;

				itemName = itemPair[0];
				itemValue = itemPair[1];

				if (itemName === "MAIL") {
					certTitle = itemValue;
				}
			});
		} catch (ignoredException) {};

		html += "\t<li>";
		html += "\t\t" + certObj.getSubjectString() + ":" + certObj.getSerialNumberHex();
		html += "\t\t" + certTitle;
		html += "\t\t<ol type=\"a\">";
		html += "\t\t\t<li>Serial Number: " + certObj.getSerialNumberHex() + "</li>";
		try {
			html += "\t\t\t<li>Usage: " + certObj.getExtKeyUsageString() + "</li>";
		} catch (_) {};
		} catch (ignoredException) {};
		html += "\t\t</ol>";
		html += "\t</li>";
	}

	html += "</ol>";

	delete certObj;
118
119
120
121
122
123
124





125
126
127
128
129
130

131
132
133
134
135
136
137
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158







+
+
+
+
+






+







	return;
}

function clearStatusInfo() {
	document.getElementById('certificates').innerHTML = '<i>Loading...</i>';
	document.getElementById('smartcard_readers').innerHTML = '<i>Loading...</i>';
	document.getElementById('certificate_provider').innerHTML = '<i>Loading...</i>';
	document.getElementById('pin_caching_timeout').value = '';
	document.getElementById('ssh_agent_enabled').checked = false;
	document.getElementById('ssh_agent_keys').checked = false;
	document.getElementById('ssh_agent_certs').checked = false;
	document.getElementById('ssh_agent_certs_legacy').checked = false;
}

function loadStatusInfo() {
	updateCertificates(document.getElementById('certificates'));
	updateSmartcardReaders(document.getElementById('smartcard_readers'));
	updateCertificateProvider(document.getElementById('certificate_provider'));
	// updateOptions(getOptions());
}

setTimeout(function() {
	loadStatusInfo();

	document.getElementById('reload').onclick = function() {
		clearStatusInfo();