]> andersk Git - openssh.git/blobdiff - compat.c
- OpenBSD CVS updates:
[openssh.git] / compat.c
index e4abaa02a492140601f793d7ec6b29142de743db..05f6fe655e27302b7bb54a3e75b38d99aaf5bcfc 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -44,7 +44,6 @@ enable_compat20(void)
 {
        verbose("Enabling compatibility mode for protocol 2.0");
        compat20 = 1;
-       packet_set_ssh2_format();
 }
 void
 enable_compat13(void)
@@ -58,17 +57,21 @@ compat_datafellows(const char *version)
 {
        int i;
        size_t len;
-       static const char *check[] = {
-               "2.0.1",
-               "2.1.0",
-               NULL
+       struct {
+               char    *version;
+               int     bugs;
+       } check[] = {
+               {"2.2.0",       SSH_BUG_HMAC},
+               {"2.1.0",       SSH_BUG_SIGBLOB|SSH_BUG_HMAC},
+               {"2.0.1",       SSH_BUG_SIGBLOB|SSH_BUG_HMAC|SSH_BUG_PUBKEYAUTH|SSH_BUG_X11FWD},
+               {NULL,          0}
        };
-       for (i = 0; check[i]; i++) {
-               len = strlen(check[i]);
+       for (i = 0; check[i].version; i++) {
+               len = strlen(check[i].version);
                if (strlen(version) >= len &&
-                  (strncmp(version, check[i], len) == 0)) {
+                  (strncmp(version, check[i].version, len) == 0)) {
                        verbose("datafellows: %.200s", version);
-                       datafellows = 1;
+                       datafellows = check[i].bugs;
                        return;
                }
        }
@@ -78,10 +81,12 @@ compat_datafellows(const char *version)
 int
 proto_spec(const char *spec)
 {
-       char *s = xstrdup(spec);
-       char *p;
+       char *s, *p;
        int ret = SSH_PROTO_UNKNOWN;
 
+       if (spec == NULL)
+               return ret;
+       s = xstrdup(spec);
        for ((p = strtok(s, SEP)); p; (p = strtok(NULL, SEP))) {
                switch(atoi(p)) {
                case 1:
This page took 0.227156 seconds and 4 git commands to generate.