summaryrefslogtreecommitdiffstats
path: root/compat.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-24 00:35:19 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-24 00:35:19 +0000
commitc8530c7f5c6775443a1c4818f5edb8a74e59c0e6 (patch)
tree3ce46d0fc1f607164822bff616b0890a4b3758c8 /compat.c
parentb94f8b2bcb41e3ecb345bcbd710ff8725f5f0e1e (diff)
- djm@cvs.openbsd.org 2001/03/23 11:04:07
[compat.c compat.h sshconnect2.c sshd.c] Compat for OpenSSH with broken Rijndael/AES. ok markus@
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/compat.c b/compat.c
index 4fb2b441..705121c3 100644
--- a/compat.c
+++ b/compat.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: compat.c,v 1.39 2001/03/18 23:30:55 deraadt Exp $");
+RCSID("$OpenBSD: compat.c,v 1.40 2001/03/23 11:04:06 djm Exp $");
#ifdef HAVE_LIBPCRE
# include <pcreposix.h>
@@ -69,7 +69,9 @@ compat_datafellows(const char *version)
} check[] = {
{ "^OpenSSH[-_]2\\.[012]",
SSH_OLD_SESSIONID|SSH_BUG_BANNER },
- { "^OpenSSH_2\\.3\\.0", SSH_BUG_BANNER },
+ { "^OpenSSH_2\\.3\\.0", SSH_BUG_BANNER|SSH_BUG_BIGENDIANAES },
+ { "^OpenSSH_2\\.5\\.[01]p1",
+ SSH_BUG_BIGENDIANAES },
{ "^OpenSSH", 0 },
{ "MindTerm", 0 },
{ "^2\\.1\\.0", SSH_BUG_SIGBLOB|SSH_BUG_HMAC|
@@ -149,3 +151,33 @@ proto_spec(const char *spec)
xfree(s);
return ret;
}
+
+char *
+compat_cipher_proposal(char *cipher_prop)
+{
+ char *orig_prop, *fix_ciphers;
+ char *cp, *tmp;
+ size_t len;
+
+ if (!(datafellows & SSH_BUG_BIGENDIANAES))
+ return(cipher_prop);
+
+ len = strlen(cipher_prop) + 1;
+ fix_ciphers = xmalloc(len);
+ *fix_ciphers = '\0';
+ tmp = orig_prop = xstrdup(cipher_prop);
+ while((cp = strsep(&tmp, ",")) != NULL) {
+ if (strncmp(cp, "aes", 3) && strncmp(cp, "rijndael", 8)) {
+ if (*fix_ciphers)
+ strlcat(fix_ciphers, ",", len);
+ strlcat(fix_ciphers, cp, len);
+ }
+ }
+ xfree(orig_prop);
+ debug2("Original cipher proposal: %s", cipher_prop);
+ debug2("Compat cipher proposal: %s", fix_ciphers);
+ if (!*fix_ciphers)
+ fatal("No available ciphers found.");
+
+ return(fix_ciphers);
+}