summaryrefslogtreecommitdiff
path: root/kex.c
diff options
context:
space:
mode:
authorSimon Wilkinson <simon@sxw.org.uk>2014-02-09 16:09:48 +0000
committerColin Watson <cjwatson@debian.org>2014-03-19 16:39:52 +0000
commit429c595dbaff7f7c2b3a53fe4235211f6d788025 (patch)
tree085cf7273c133b74238c968c9c9f591f8fb0308e /kex.c
parent9a975a9faed7c4f334e8c8490db3e77e102f2b21 (diff)
GSSAPI key exchange support
This patch has been rejected upstream: "None of the OpenSSH developers are in favour of adding this, and this situation has not changed for several years. This is not a slight on Simon's patch, which is of fine quality, but just that a) we don't trust GSSAPI implementations that much and b) we don't like adding new KEX since they are pre-auth attack surface. This one is particularly scary, since it requires hooks out to typically root-owned system resources." However, quite a lot of people rely on this in Debian, and it's better to have it merged into the main openssh package rather than having separate -krb5 packages (as we used to have). It seems to have a generally good security history. Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1242 Last-Updated: 2014-03-19 Patch-Name: gssapi.patch
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kex.c b/kex.c
index 616484b85..49d0fc8fd 100644
--- a/kex.c
+++ b/kex.c
@@ -51,6 +51,10 @@
51#include "roaming.h" 51#include "roaming.h"
52#include "digest.h" 52#include "digest.h"
53 53
54#ifdef GSSAPI
55#include "ssh-gss.h"
56#endif
57
54#if OPENSSL_VERSION_NUMBER >= 0x00907000L 58#if OPENSSL_VERSION_NUMBER >= 0x00907000L
55# if defined(HAVE_EVP_SHA256) 59# if defined(HAVE_EVP_SHA256)
56# define evp_ssh_sha256 EVP_sha256 60# define evp_ssh_sha256 EVP_sha256
@@ -92,6 +96,14 @@ static const struct kexalg kexalgs[] = {
92#endif 96#endif
93 { NULL, -1, -1, -1}, 97 { NULL, -1, -1, -1},
94}; 98};
99static const struct kexalg kexalg_prefixes[] = {
100#ifdef GSSAPI
101 { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, SSH_DIGEST_SHA1 },
102 { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },
103 { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, SSH_DIGEST_SHA1 },
104#endif
105 { NULL, -1, -1, -1 },
106};
95 107
96char * 108char *
97kex_alg_list(char sep) 109kex_alg_list(char sep)
@@ -120,6 +132,10 @@ kex_alg_by_name(const char *name)
120 if (strcmp(k->name, name) == 0) 132 if (strcmp(k->name, name) == 0)
121 return k; 133 return k;
122 } 134 }
135 for (k = kexalg_prefixes; k->name != NULL; k++) {
136 if (strncmp(k->name, name, strlen(k->name)) == 0)
137 return k;
138 }
123 return NULL; 139 return NULL;
124} 140}
125 141