~apreiml/hare-ssh

0b08f7e296f44811cbaaedc38eba49f3480a680d — Armin Preiml 1 year, 10 months ago 804f683
net::ssh::agent::proto: fix format::ssh::key compability
2 files changed, 5 insertions(+), 4 deletions(-)

M net/ssh/agent/proto.ha
M net/ssh/agent/types.ha
M net/ssh/agent/proto.ha => net/ssh/agent/proto.ha +3 -2
@@ 75,9 75,9 @@ fn parse_sign_request(src: io::handle) (sign_request | invalid) = {
fn parse_add_identity(src: io::handle) (add_identity | invalid) = {
	const keytype = readstr(src)?;
	// TODO: Support more key types
	const key: ssh::key = switch (keytype) {
	const key = switch (keytype) {
	case "ssh-ed25519" =>
		let key = ssh::ed25519key { ... };
		let key = alloc(ssh::new_ed25519key());
		const npub = readu32(src)?;
		if (npub != len(key.pubkey)) {
			return invalid;


@@ 96,6 96,7 @@ fn parse_add_identity(src: io::handle) (add_identity | invalid) = {
		keytype = keytype,
		key = key,
		comment = readstr(src)?,
		...
	};
};


M net/ssh/agent/types.ha => net/ssh/agent/types.ha +2 -2
@@ 68,14 68,14 @@ export type extension_failure = void;
// The [[messagetype::ADD_IDENTITY]] message.
export type add_identity = struct {
	keytype: str,
	key: ssh::key,
	key: *ssh::key,
	comment: str,
};

// The [[messagetype::ADD_ID_CONSTRAINED]] message.
export type add_id_constrained = struct {
	keytype: str,
	key: ssh::key,
	key: *ssh::key,
	comment: str,
	constraint: []constraint,
};