SSH v2 known-hosts problem.

Markus Friedl markus.friedl at informatik.uni-erlangen.de
Mon May 22 18:39:11 EST 2000


Berend De Schouwer wrote:
> However, if I disconnect and connect again, it still says:
> The authenticity of host 'B' can't be established.
> DSA key fingerprint is blah-blah-blah
> Are you sure you want to continue connecting (yes/no)?

key_read() ignores some valid keys. please 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 07:32:04
@@ -269,10 +269,7 @@
 		k->dsa = NULL;
 		key_free(k);
 		bits = BN_num_bits(ret->dsa->p);
-		cp = strchr(cp, '=');
-		if (cp == NULL)
-			return 0;
-		*cpp = cp + 1;
+		*cpp = cp + n;
 		break;
 	default:
 		fatal("key_read: bad key type: %d", ret->type);
Index: uuencode.c
===================================================================
RCS file: /home/markus/cvs/ssh/uuencode.c,v
retrieving revision 1.5
diff -u -r1.5 uuencode.c
--- uuencode.c	2000/05/05 18:53:42	1.5
+++ uuencode.c	2000/05/22 07:50:01
@@ -13,10 +13,11 @@
 	return __b64_ntop(src, srclength, target, targsize);
 }
 
+/* return #bytes consumed from src[], < 0 on error */
 int
 uudecode(const char *src, unsigned char *target, size_t targsize)
 {
-	int len;
+	int ret;
 	char *encoded, *p;
 
 	/* copy the 'readonly' source */
@@ -28,9 +29,15 @@
 		;
 	/* and remote trailing whitespace because __b64_pton needs this */
 	*p = '\0';
-	len = __b64_pton(encoded, target, targsize);
+	/*
+	 * __b64_pton() returns #bytes stored at target[],
+	 * we need #bytes consumed from src[]
+	 */
+	ret = __b64_pton(encoded, target, targsize);
+	if (ret >= 0)
+		ret = strlen(encoded);
 	xfree(encoded);
-	return len;
+	return ret;
 }
 
 void





More information about the openssh-unix-dev mailing list