~apreiml/hare-ssh

1876cdf75424b355526c6a732fcde4e91436aeca — Armin Preiml 1 year, 10 months ago 3c8e427
fix cmd ssh-agent new key format
1 files changed, 4 insertions(+), 4 deletions(-)

M cmd/ssh-agent/main.ha
M cmd/ssh-agent/main.ha => cmd/ssh-agent/main.ha +4 -4
@@ 17,7 17,7 @@ let running: bool = true;

type identity = struct {
	comment: str,
	privkey: ssh::key,
	privkey: *ssh::key,
	pubkey: []u8,
};



@@ 57,7 57,7 @@ export fn main() void = {

	for (let i = 0z; i < len(state.identities); i += 1) {
		const ident = state.identities[i];
		ssh::key_finish(&ident.privkey);
		ssh::key_free(ident.privkey);
		free(ident.pubkey);
		free(ident.comment);
	};


@@ 121,7 121,7 @@ fn handle_add_ident(
	agent: *agent::agent,
) (void | agent::error) = {
	let sink = bufio::dynamic(io::mode::WRITE);
	ssh::encode_pubkey(&sink, &msg.key)!;
	ssh::encode_pubkey(&sink, msg.key)!;
	append(state.identities, identity {
		comment = strings::dup(msg.comment),
		privkey = msg.key,


@@ 156,7 156,7 @@ fn handle_sign_request(

	let buf = bufio::dynamic(io::mode::WRITE);
	defer io::close(&buf)!;
	ssh::sign(&buf, &key.privkey, msg.data)!;
	ssh::sign(&buf, key.privkey, msg.data)!;

	const answer: agent::message = agent::sign_response {
		signature = bufio::buffer(&buf),