summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compat.c15
-rw-r--r--compat.h4
-rw-r--r--sshconnect.c4
-rw-r--r--sshd.c4
4 files changed, 15 insertions, 12 deletions
diff --git a/compat.c b/compat.c
index 8f0f10c8a..4852fb709 100644
--- a/compat.c
+++ b/compat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: compat.c,v 1.86 2014/10/08 22:15:27 djm Exp $ */ 1/* $OpenBSD: compat.c,v 1.87 2015/01/19 20:20:20 markus Exp $ */
2/* 2/*
3 * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -57,7 +57,7 @@ enable_compat13(void)
57 compat13 = 1; 57 compat13 = 1;
58} 58}
59/* datafellows bug compatibility */ 59/* datafellows bug compatibility */
60void 60u_int
61compat_datafellows(const char *version) 61compat_datafellows(const char *version)
62{ 62{
63 int i; 63 int i;
@@ -174,13 +174,14 @@ compat_datafellows(const char *version)
174 for (i = 0; check[i].pat; i++) { 174 for (i = 0; check[i].pat; i++) {
175 if (match_pattern_list(version, check[i].pat, 175 if (match_pattern_list(version, check[i].pat,
176 strlen(check[i].pat), 0) == 1) { 176 strlen(check[i].pat), 0) == 1) {
177 datafellows = check[i].bugs;
178 debug("match: %s pat %s compat 0x%08x", 177 debug("match: %s pat %s compat 0x%08x",
179 version, check[i].pat, datafellows); 178 version, check[i].pat, check[i].bugs);
180 return; 179 datafellows = check[i].bugs; /* XXX for now */
180 return check[i].bugs;
181 } 181 }
182 } 182 }
183 debug("no match: %s", version); 183 debug("no match: %s", version);
184 return 0;
184} 185}
185 186
186#define SEP "," 187#define SEP ","
@@ -192,7 +193,9 @@ proto_spec(const char *spec)
192 193
193 if (spec == NULL) 194 if (spec == NULL)
194 return ret; 195 return ret;
195 q = s = xstrdup(spec); 196 q = s = strdup(spec);
197 if (s == NULL)
198 return ret;
196 for ((p = strsep(&q, SEP)); p && *p != '\0'; (p = strsep(&q, SEP))) { 199 for ((p = strsep(&q, SEP)); p && *p != '\0'; (p = strsep(&q, SEP))) {
197 switch (atoi(p)) { 200 switch (atoi(p)) {
198 case 1: 201 case 1:
diff --git a/compat.h b/compat.h
index 2e25d5ba9..af2f0073f 100644
--- a/compat.h
+++ b/compat.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: compat.h,v 1.45 2014/04/18 23:52:25 djm Exp $ */ 1/* $OpenBSD: compat.h,v 1.46 2015/01/19 20:20:20 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved.
@@ -63,7 +63,7 @@
63 63
64void enable_compat13(void); 64void enable_compat13(void);
65void enable_compat20(void); 65void enable_compat20(void);
66void compat_datafellows(const char *); 66u_int compat_datafellows(const char *);
67int proto_spec(const char *); 67int proto_spec(const char *);
68char *compat_cipher_proposal(char *); 68char *compat_cipher_proposal(char *);
69char *compat_pkalg_proposal(char *); 69char *compat_pkalg_proposal(char *);
diff --git a/sshconnect.c b/sshconnect.c
index 176a20a87..1a633211a 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.254 2014/12/21 22:27:56 djm Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.255 2015/01/19 20:20:20 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -628,7 +628,7 @@ ssh_exchange_identification(int timeout_ms)
628 debug("Remote protocol version %d.%d, remote software version %.100s", 628 debug("Remote protocol version %d.%d, remote software version %.100s",
629 remote_major, remote_minor, remote_version); 629 remote_major, remote_minor, remote_version);
630 630
631 compat_datafellows(remote_version); 631 active_state->compat = compat_datafellows(remote_version);
632 mismatch = 0; 632 mismatch = 0;
633 633
634 switch (remote_major) { 634 switch (remote_major) {
diff --git a/sshd.c b/sshd.c
index 21d8dd699..3b6c10a83 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.435 2015/01/19 20:16:15 markus Exp $ */ 1/* $OpenBSD: sshd.c,v 1.436 2015/01/19 20:20:20 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -485,7 +485,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
485 debug("Client protocol version %d.%d; client software version %.100s", 485 debug("Client protocol version %d.%d; client software version %.100s",
486 remote_major, remote_minor, remote_version); 486 remote_major, remote_minor, remote_version);
487 487
488 compat_datafellows(remote_version); 488 active_state->compat = compat_datafellows(remote_version);
489 489
490 if ((datafellows & SSH_BUG_PROBE) != 0) { 490 if ((datafellows & SSH_BUG_PROBE) != 0) {
491 logit("probed from %s with %s. Don't panic.", 491 logit("probed from %s with %s. Don't panic.",