Diff

Differences From Artifact [d68e90b355]:

To Artifact [f8ff078c88]:


    84     84   
    85     85   	return({
    86     86   		value: result,
    87     87   		output: input.slice(info.value)
    88     88   	});
    89     89   }
    90     90   
    91         -function cackeySSHAgentEncodeTLV(tag, array) {
    92         -	var result;
    93         -
    94         -	result = [];
    95         -
    96         -	result.push(tag & 0xff);
    97         -
    98         -	result = result.concat(cackeySSHAgentEncodeLV(array));
    99         -
   100         -	return(result);
   101         -}
   102         -
   103     91   function cackeySSHAgentEncodeToUTF8Array(str) {
   104     92   	var utf8 = [];
   105     93   
   106     94   	if (typeof(str) === "string") {
   107     95   		str = str.split("").map(function(c) {
   108     96   			return(c.charCodeAt(0));
   109     97   		});
................................................................................
   309    297   	 */
   310    298   	if ((flags & flagMeaning.SSH_AGENT_RSA_SHA2_512) == flagMeaning.SSH_AGENT_RSA_SHA2_512) {
   311    299   		hashMethod = "SHA512";
   312    300   		data = await crypto.subtle.digest("SHA-512", new Uint8Array(data));
   313    301   	} else if ((flags & flagMeaning.SSH_AGENT_RSA_SHA2_256) == flagMeaning.SSH_AGENT_RSA_SHA2_256) {
   314    302   		hashMethod = "SHA256";
   315    303   		data = await crypto.subtle.digest("SHA-256", new Uint8Array(data));
   316         -	} else if (flags == 1) {
          304  +	} else if (flags == 0) {
   317    305   		hashMethod = "SHA1";
   318    306   		data = await crypto.subtle.digest("SHA-1", new Uint8Array(data));
   319    307   	} else {
   320    308   		console.info("[cackeySSH] Sign request with flags set to", flags, "which is unsupported, failing the request.");
   321    309   
   322    310   		return(null);
   323    311   	}
................................................................................
   381    369   	sshRequest = {};
   382    370   	if (sshRequestID < cackeySSHAgentCommands.length) {
   383    371   		sshRequest = cackeySSHAgentCommands[sshRequestID];
   384    372   	}
   385    373   
   386    374   	response = null;
   387    375   	if (!sshRequest.name) {
   388         -		console.log("[cackeySSH] Unsupported request: ", request, "; from: ", socket.sender.id);
          376  +		if (goog.DEBUG) {
          377  +			console.log("[cackeySSH] Unsupported request: ", request, "; from: ", socket.sender.id);
          378  +		}
   389    379   	} else {
   390    380   		if (goog.DEBUG) {
   391    381   			console.log("[cackeySSH] Request: ", sshRequest.name, "; from: ", socket.sender.id);
   392    382   		}
   393    383   
   394    384   		try {
   395    385   			response = await sshRequest.handler(request.data);