SSH v2 known-hosts problem.
Markus Friedl
markus.friedl at informatik.uni-erlangen.de
Thu May 25 16:20:44 EST 2000
On Wed, May 24, 2000 at 11:54:36PM +0200, Christian Weisgerber wrote:
> Markus Friedl <markus.friedl at informatik.uni-erlangen.de> wrote:
>
> > key_read() ignores some valid keys. please try this:
>
> Seems to fix the problem, but now I get this:
> dsa_key_from_blob: remaining bytes in key blob 147
>
> Is this informational? A warning?
the patch was broken. try this.
Index: key.c
===================================================================
RCS file: /home/markus/cvs/ssh/key.c,v
retrieving revision 1.6
diff -u -r1.6 key.c
--- key.c 2000/05/05 18:53:42 1.6
+++ key.c 2000/05/22 17:29:24
@@ -256,12 +256,14 @@
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 @@
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);
More information about the openssh-unix-dev
mailing list