summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--kex.c13
-rw-r--r--kex.h4
-rw-r--r--sshconnect2.c7
4 files changed, 26 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5935fa6ad..68f772b60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@
4 [roaming.h] 4 [roaming.h]
5 Declarations needed for upcoming changes. 5 Declarations needed for upcoming changes.
6 ok markus@ 6 ok markus@
7 - andreas@cvs.openbsd.org 2009/10/24 11:13:54
8 [sshconnect2.c kex.h kex.c]
9 Let the client detect if the server supports roaming by looking
10 for the resume@appgate.com kex algorithm.
11 ok markus@
7 12
820091226 1320091226
9 - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1 14 - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
diff --git a/kex.c b/kex.c
index f4f44f095..148cfee80 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.c,v 1.81 2009/05/27 06:34:36 andreas Exp $ */ 1/* $OpenBSD: kex.c,v 1.82 2009/10/24 11:13:54 andreas Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -48,6 +48,7 @@
48#include "match.h" 48#include "match.h"
49#include "dispatch.h" 49#include "dispatch.h"
50#include "monitor.h" 50#include "monitor.h"
51#include "roaming.h"
51 52
52#if OPENSSL_VERSION_NUMBER >= 0x00907000L 53#if OPENSSL_VERSION_NUMBER >= 0x00907000L
53# if defined(HAVE_EVP_SHA256) 54# if defined(HAVE_EVP_SHA256)
@@ -386,6 +387,16 @@ kex_choose_conf(Kex *kex)
386 sprop=peer; 387 sprop=peer;
387 } 388 }
388 389
390 /* Check whether server offers roaming */
391 if (!kex->server) {
392 char *roaming;
393 roaming = match_list(KEX_RESUME, peer[PROPOSAL_KEX_ALGS], NULL);
394 if (roaming) {
395 kex->roaming = 1;
396 xfree(roaming);
397 }
398 }
399
389 /* Algorithm Negotiation */ 400 /* Algorithm Negotiation */
390 for (mode = 0; mode < MODE_MAX; mode++) { 401 for (mode = 0; mode < MODE_MAX; mode++) {
391 newkeys = xcalloc(1, sizeof(*newkeys)); 402 newkeys = xcalloc(1, sizeof(*newkeys));
diff --git a/kex.h b/kex.h
index 68c80c5a9..1fa13799d 100644
--- a/kex.h
+++ b/kex.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: kex.h,v 1.47 2009/05/27 06:34:36 andreas Exp $ */ 1/* $OpenBSD: kex.h,v 1.48 2009/10/24 11:13:54 andreas Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -36,6 +36,7 @@
36#define KEX_DH14 "diffie-hellman-group14-sha1" 36#define KEX_DH14 "diffie-hellman-group14-sha1"
37#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1" 37#define KEX_DHGEX_SHA1 "diffie-hellman-group-exchange-sha1"
38#define KEX_DHGEX_SHA256 "diffie-hellman-group-exchange-sha256" 38#define KEX_DHGEX_SHA256 "diffie-hellman-group-exchange-sha256"
39#define KEX_RESUME "resume@appgate.com"
39 40
40#define COMP_NONE 0 41#define COMP_NONE 0
41#define COMP_ZLIB 1 42#define COMP_ZLIB 1
@@ -116,6 +117,7 @@ struct Kex {
116 char *name; 117 char *name;
117 int hostkey_type; 118 int hostkey_type;
118 int kex_type; 119 int kex_type;
120 int roaming;
119 Buffer my; 121 Buffer my;
120 Buffer peer; 122 Buffer peer;
121 sig_atomic_t done; 123 sig_atomic_t done;
diff --git a/sshconnect2.c b/sshconnect2.c
index 1e0e9d5e1..937bb773d 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.172 2009/10/23 01:57:11 djm Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.173 2009/10/24 11:13:54 andreas Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2008 Damien Miller. All rights reserved. 4 * Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -152,6 +152,11 @@ ssh_kex2(char *host, struct sockaddr *hostaddr)
152 152
153 dispatch_run(DISPATCH_BLOCK, &kex->done, kex); 153 dispatch_run(DISPATCH_BLOCK, &kex->done, kex);
154 154
155 if (options.use_roaming && !kex->roaming) {
156 debug("Roaming not allowed by server");
157 options.use_roaming = 0;
158 }
159
155 session_id2 = kex->session_id; 160 session_id2 = kex->session_id;
156 session_id2_len = kex->session_id_len; 161 session_id2_len = kex->session_id_len;
157 162