~sircmpwn/hare-ssh

76644828c55f803ae14aee6319fa603888dcdf67 — Armin Preiml 1 year, 11 months ago 6813779
export ssh::format::newkey
1 files changed, 4 insertions(+), 2 deletions(-)

M format/ssh/key.ha
M format/ssh/key.ha => format/ssh/key.ha +4 -2
@@ 68,14 68,16 @@ export fn decodeprivate(src: *sshprivkey) (*key | error) = {
	return key;
};

fn newkey(keytype: const str) (*key | error) = {
// Allocates a new key of given 'keytype'. Will return [[invalid]], if the
// key type is not supported.
export fn newkey(keytype: const str) (*key | error) = {
	switch (keytype) {
	case "ssh-ed25519" =>
		return newed25519key();
	case "ssh-rsa" =>
		return newrsakey();
	case =>
		return badcipher;
		return invalid;
	};
};