Check-in [4ce30d9e04]
Overview
Comment:Work on getting an SSH agent UI going
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ssh-agent-ui
Files: files | file ages | folders
SHA1: 4ce30d9e04e10bac5027cdaceacc6f38eb85d541
User & Date: rkeene on 2019-06-05 18:12:58
Other Links: branch diff | manifest | tags
Context
2019-06-06
21:56
Merged in trunk Leaf check-in: 8a375324e9 user: rkeene tags: ssh-agent-ui
2019-06-05
18:12
Work on getting an SSH agent UI going check-in: 4ce30d9e04 user: rkeene tags: ssh-agent-ui
2019-02-04
23:17
Better matching of requested blob to one of our certificates check-in: fd3c997789 user: rkeene tags: trunk
Changes

Modified build/chrome/manifest.json.in from [5fb3c02ed9] to [6924f71c75].

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
	},

	"app": {
		"background": {
			"scripts": [
				"google-pcsc.js",
				"jsrsasign.js",

				"ssh-agent.js",
				"cackey.js"
			],
			"persistent": false
		}
	},

	"permissions": [
		"certificateProvider",

		"alwaysOnTopWindows"
	],

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







>









>


>







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
	},

	"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
<html>
	<head>
		<title>CACKey</title>
		<script type="text/javascript" src="jsrsasign.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>




>







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
var globalCerts = null;

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


	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)));















		html += "\t<li>";
		html += "\t\t" + certObj.getSubjectString() + ":" + certObj.getSerialNumberHex();
		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 (_) {};
		html += "\t\t</ol>";
		html += "\t</li>";
	}

	html += "</ol>";

	delete certObj;





|

>
















>
>
>
>
>
>
>
>
>
>
>
>
>
>

|




|







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, 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" + 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 (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
	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>';





}

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

}

setTimeout(function() {
	loadStatusInfo();

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







>
>
>
>
>






>







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();