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 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