~sircmpwn/himitsu-ssh

4a7730fb7d5e3bce5dd04b61da036c1bedc2c310 — Armin Preiml 1 year, 9 months ago c8cbc9e
agent: req_ident: support all hare-ssh key types
1 files changed, 10 insertions(+), 7 deletions(-)

M cmd/hissh-agent/main.ha
M cmd/hissh-agent/main.ha => cmd/hissh-agent/main.ha +10 -7
@@ 144,15 144,20 @@ fn handle_req_ident(agent: *agent::agent) (void | agent::error | net::error) = {
		};
		defer query::finish(&q);

		match (getkey(&q, "type")) {
		const keytype = match (getkey(&q, "type")) {
		case void => continue;
		case let keytype: str =>
			// TODO: More key types
			if (keytype != "ssh-ed25519") {
				continue;
			};
			yield keytype;
		};

		let key = match (ssh::newkey(keytype)) {
		case let k: *ssh::key =>
			yield k;
		case ssh::error =>
			continue;
		};
		defer ssh::key_free(key);

		const b64pkey = match (getkey(&q, "pkey")) {
		case let key: str =>
			yield key;


@@ 179,8 184,6 @@ fn handle_req_ident(agent: *agent::agent) (void | agent::error | net::error) = {
			yield "";
		};

		let key = ssh::newed25519key();
		defer ssh::key_free(key);
		let pkeybuf = bufio::fixed(pkey, io::mode::READ);
		match (ssh::key_decoderawpub(key, &pkeybuf)) {
		case ssh::error =>