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-10-07 14:26:43 +0100
commit1c1b6fa17982eb622e2c4e8f4a279f2113f57413 (patch)
treea67e7472f48242904e6a45732508822af63fd331 /kex.c
parent487bdb3a5ef6075887b830ccb8a0b14f6da78e93 (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-10-07 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 a173e70e3..891852b54 100644
--- a/kex.c
+++ b/kex.c
@@ -53,6 +53,10 @@
53#include "roaming.h" 53#include "roaming.h"
54#include "digest.h" 54#include "digest.h"
55 55
56#ifdef GSSAPI
57#include "ssh-gss.h"
58#endif
59
56#if OPENSSL_VERSION_NUMBER >= 0x00907000L 60#if OPENSSL_VERSION_NUMBER >= 0x00907000L
57# if defined(HAVE_EVP_SHA256) 61# if defined(HAVE_EVP_SHA256)
58# define evp_ssh_sha256 EVP_sha256 62# define evp_ssh_sha256 EVP_sha256
@@ -96,6 +100,14 @@ static const struct kexalg kexalgs[] = {
96#endif /* HAVE_EVP_SHA256 */ 100#endif /* HAVE_EVP_SHA256 */
97 { NULL, -1, -1, -1}, 101 { NULL, -1, -1, -1},
98}; 102};
103static const struct kexalg kexalg_prefixes[] = {
104#ifdef GSSAPI
105 { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, SSH_DIGEST_SHA1 },
106 { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },
107 { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, SSH_DIGEST_SHA1 },
108#endif
109 { NULL, -1, -1, -1 },
110};
99 111
100char * 112char *
101kex_alg_list(char sep) 113kex_alg_list(char sep)
@@ -124,6 +136,10 @@ kex_alg_by_name(const char *name)
124 if (strcmp(k->name, name) == 0) 136 if (strcmp(k->name, name) == 0)
125 return k; 137 return k;
126 } 138 }
139 for (k = kexalg_prefixes; k->name != NULL; k++) {
140 if (strncmp(k->name, name, strlen(k->name)) == 0)
141 return k;
142 }
127 return NULL; 143 return NULL;
128} 144}
129 145