Diff

Differences From Artifact [d68e90b355]:

To Artifact [f8ff078c88]:


84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

	return({
		value: result,
		output: input.slice(info.value)
	});
}

function cackeySSHAgentEncodeTLV(tag, array) {
	var result;

	result = [];

	result.push(tag & 0xff);

	result = result.concat(cackeySSHAgentEncodeLV(array));

	return(result);
}

function cackeySSHAgentEncodeToUTF8Array(str) {
	var utf8 = [];

	if (typeof(str) === "string") {
		str = str.split("").map(function(c) {
			return(c.charCodeAt(0));
		});







<
<
<
<
<
<
<
<
<
<
<
<







84
85
86
87
88
89
90












91
92
93
94
95
96
97

	return({
		value: result,
		output: input.slice(info.value)
	});
}













function cackeySSHAgentEncodeToUTF8Array(str) {
	var utf8 = [];

	if (typeof(str) === "string") {
		str = str.split("").map(function(c) {
			return(c.charCodeAt(0));
		});
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
	 */
	if ((flags & flagMeaning.SSH_AGENT_RSA_SHA2_512) == flagMeaning.SSH_AGENT_RSA_SHA2_512) {
		hashMethod = "SHA512";
		data = await crypto.subtle.digest("SHA-512", new Uint8Array(data));
	} else if ((flags & flagMeaning.SSH_AGENT_RSA_SHA2_256) == flagMeaning.SSH_AGENT_RSA_SHA2_256) {
		hashMethod = "SHA256";
		data = await crypto.subtle.digest("SHA-256", new Uint8Array(data));
	} else if (flags == 1) {
		hashMethod = "SHA1";
		data = await crypto.subtle.digest("SHA-1", new Uint8Array(data));
	} else {
		console.info("[cackeySSH] Sign request with flags set to", flags, "which is unsupported, failing the request.");

		return(null);
	}







|







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
	 */
	if ((flags & flagMeaning.SSH_AGENT_RSA_SHA2_512) == flagMeaning.SSH_AGENT_RSA_SHA2_512) {
		hashMethod = "SHA512";
		data = await crypto.subtle.digest("SHA-512", new Uint8Array(data));
	} else if ((flags & flagMeaning.SSH_AGENT_RSA_SHA2_256) == flagMeaning.SSH_AGENT_RSA_SHA2_256) {
		hashMethod = "SHA256";
		data = await crypto.subtle.digest("SHA-256", new Uint8Array(data));
	} else if (flags == 0) {
		hashMethod = "SHA1";
		data = await crypto.subtle.digest("SHA-1", new Uint8Array(data));
	} else {
		console.info("[cackeySSH] Sign request with flags set to", flags, "which is unsupported, failing the request.");

		return(null);
	}
381
382
383
384
385
386
387

388

389
390
391
392
393
394
395
	sshRequest = {};
	if (sshRequestID < cackeySSHAgentCommands.length) {
		sshRequest = cackeySSHAgentCommands[sshRequestID];
	}

	response = null;
	if (!sshRequest.name) {

		console.log("[cackeySSH] Unsupported request: ", request, "; from: ", socket.sender.id);

	} else {
		if (goog.DEBUG) {
			console.log("[cackeySSH] Request: ", sshRequest.name, "; from: ", socket.sender.id);
		}

		try {
			response = await sshRequest.handler(request.data);







>
|
>







369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
	sshRequest = {};
	if (sshRequestID < cackeySSHAgentCommands.length) {
		sshRequest = cackeySSHAgentCommands[sshRequestID];
	}

	response = null;
	if (!sshRequest.name) {
		if (goog.DEBUG) {
			console.log("[cackeySSH] Unsupported request: ", request, "; from: ", socket.sender.id);
		}
	} else {
		if (goog.DEBUG) {
			console.log("[cackeySSH] Request: ", sshRequest.name, "; from: ", socket.sender.id);
		}

		try {
			response = await sshRequest.handler(request.data);