@@ 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 =>