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 d371f47c4..913e92392 100644
--- a/kex.c
+++ b/kex.c
@@ -54,6 +54,10 @@
54#include "sshbuf.h" 54#include "sshbuf.h"
55#include "digest.h" 55#include "digest.h"
56 56
57#ifdef GSSAPI
58#include "ssh-gss.h"
59#endif
60
57#if OPENSSL_VERSION_NUMBER >= 0x00907000L 61#if OPENSSL_VERSION_NUMBER >= 0x00907000L
58# if defined(HAVE_EVP_SHA256) 62# if defined(HAVE_EVP_SHA256)
59# define evp_ssh_sha256 EVP_sha256 63# define evp_ssh_sha256 EVP_sha256
@@ -109,6 +113,14 @@ static const struct kexalg kexalgs[] = {
109#endif /* HAVE_EVP_SHA256 || !WITH_OPENSSL */ 113#endif /* HAVE_EVP_SHA256 || !WITH_OPENSSL */
110 { NULL, -1, -1, -1}, 114 { NULL, -1, -1, -1},
111}; 115};
116static const struct kexalg kexalg_prefixes[] = {
117#ifdef GSSAPI
118 { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, SSH_DIGEST_SHA1 },
119 { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },
120 { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, SSH_DIGEST_SHA1 },
121#endif
122 { NULL, -1, -1, -1 },
123};
112 124
113char * 125char *
114kex_alg_list(char sep) 126kex_alg_list(char sep)
@@ -141,6 +153,10 @@ kex_alg_by_name(const char *name)
141 if (strcmp(k->name, name) == 0) 153 if (strcmp(k->name, name) == 0)
142 return k; 154 return k;
143 } 155 }
156 for (k = kexalg_prefixes; k->name != NULL; k++) {
157 if (strncmp(k->name, name, strlen(k->name)) == 0)
158 return k;
159 }
144 return NULL; 160 return NULL;
145} 161}
146 162