summaryrefslogtreecommitdiff
path: root/kex.c
diff options
context:
space:
mode:
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 54bd1a438..1ec278245 100644
--- a/kex.c
+++ b/kex.c
@@ -50,6 +50,10 @@
50#include "monitor.h" 50#include "monitor.h"
51#include "roaming.h" 51#include "roaming.h"
52 52
53#ifdef GSSAPI
54#include "ssh-gss.h"
55#endif
56
53#if OPENSSL_VERSION_NUMBER >= 0x00907000L 57#if OPENSSL_VERSION_NUMBER >= 0x00907000L
54# if defined(HAVE_EVP_SHA256) 58# if defined(HAVE_EVP_SHA256)
55# define evp_ssh_sha256 EVP_sha256 59# define evp_ssh_sha256 EVP_sha256
@@ -82,6 +86,14 @@ static const struct kexalg kexalgs[] = {
82#endif 86#endif
83 { NULL, -1, -1, NULL}, 87 { NULL, -1, -1, NULL},
84}; 88};
89static const struct kexalg kexalg_prefixes[] = {
90#ifdef GSSAPI
91 { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, EVP_sha1 },
92 { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, EVP_sha1 },
93 { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, EVP_sha1 },
94#endif
95 { NULL, -1, -1, NULL },
96};
85 97
86char * 98char *
87kex_alg_list(void) 99kex_alg_list(void)
@@ -110,6 +122,10 @@ kex_alg_by_name(const char *name)
110 if (strcmp(k->name, name) == 0) 122 if (strcmp(k->name, name) == 0)
111 return k; 123 return k;
112 } 124 }
125 for (k = kexalg_prefixes; k->name != NULL; k++) {
126 if (strncmp(k->name, name, strlen(k->name)) == 0)
127 return k;
128 }
113 return NULL; 129 return NULL;
114} 130}
115 131