diff options
author | Damien Miller <djm@mindrot.org> | 2000-05-30 13:44:51 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-05-30 13:44:51 +1000 |
commit | b1715dc0cf5ea91707b437310f63b17bed2dc7a6 (patch) | |
tree | f7fe557697d12b37c6be6a97c6ce083d23fd07de /key.c | |
parent | 9448c002db7427058ecca76760f3a75e379bf0a1 (diff) |
- OpenBSD CVS updates:
- markus@cvs.openbsd.org
[session.c]
make x11-fwd work w/ localhost (xauth add host/unix:11)
[cipher.c compat.c readconf.c servconf.c]
check strtok() != NULL; ok niels@
[key.c]
fix key_read() for uuencoded keys w/o '='
[serverloop.c]
group ssh1 vs. ssh2 in serverloop
[kex.c kex.h myproposal.h sshconnect2.c sshd.c]
split kexinit/kexdh, factor out common code
[readconf.c ssh.1 ssh.c]
forwardagent defaults to no, add ssh -A
- theo@cvs.openbsd.org
[session.c]
just some line shortening
Diffstat (limited to 'key.c')
-rw-r--r-- | key.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -256,12 +256,14 @@ key_read(Key *ret, char **cpp) blob = xmalloc(len); n = uudecode(cp, blob, len); if (n < 0) { - error("uudecode %s failed", cp); + error("key_read: uudecode %s failed", cp); return 0; } k = dsa_key_from_blob(blob, n); - if (k == NULL) - return 0; + if (k == NULL) { + error("key_read: dsa_key_from_blob %s failed", cp); + return 0; + } xfree(blob); if (ret->dsa != NULL) DSA_free(ret->dsa); @@ -269,10 +271,12 @@ key_read(Key *ret, char **cpp) k->dsa = NULL; key_free(k); bits = BN_num_bits(ret->dsa->p); - cp = strchr(cp, '='); - if (cp == NULL) - return 0; - *cpp = cp + 1; + /* advance cp: skip whitespace and data */ + while (*cp == ' ' || *cp == '\t') + cp++; + while (*cp != '\0' && *cp != ' ' && *cp != '\t') + cp++; + *cpp = cp; break; default: fatal("key_read: bad key type: %d", ret->type); |