diff options
Diffstat (limited to 'kex.c')
-rw-r--r-- | kex.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -55,6 +55,10 @@ | |||
55 | #include "sshbuf.h" | 55 | #include "sshbuf.h" |
56 | #include "digest.h" | 56 | #include "digest.h" |
57 | 57 | ||
58 | #ifdef GSSAPI | ||
59 | #include "ssh-gss.h" | ||
60 | #endif | ||
61 | |||
58 | #if OPENSSL_VERSION_NUMBER >= 0x00907000L | 62 | #if OPENSSL_VERSION_NUMBER >= 0x00907000L |
59 | # if defined(HAVE_EVP_SHA256) | 63 | # if defined(HAVE_EVP_SHA256) |
60 | # define evp_ssh_sha256 EVP_sha256 | 64 | # define evp_ssh_sha256 EVP_sha256 |
@@ -97,6 +101,14 @@ static const struct kexalg kexalgs[] = { | |||
97 | #endif /* HAVE_EVP_SHA256 || !WITH_OPENSSL */ | 101 | #endif /* HAVE_EVP_SHA256 || !WITH_OPENSSL */ |
98 | { NULL, -1, -1, -1}, | 102 | { NULL, -1, -1, -1}, |
99 | }; | 103 | }; |
104 | static const struct kexalg kexalg_prefixes[] = { | ||
105 | #ifdef GSSAPI | ||
106 | { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, SSH_DIGEST_SHA1 }, | ||
107 | { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, SSH_DIGEST_SHA1 }, | ||
108 | { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, SSH_DIGEST_SHA1 }, | ||
109 | #endif | ||
110 | { NULL, -1, -1, -1 }, | ||
111 | }; | ||
100 | 112 | ||
101 | char * | 113 | char * |
102 | kex_alg_list(char sep) | 114 | kex_alg_list(char sep) |
@@ -129,6 +141,10 @@ kex_alg_by_name(const char *name) | |||
129 | if (strcmp(k->name, name) == 0) | 141 | if (strcmp(k->name, name) == 0) |
130 | return k; | 142 | return k; |
131 | } | 143 | } |
144 | for (k = kexalg_prefixes; k->name != NULL; k++) { | ||
145 | if (strncmp(k->name, name, strlen(k->name)) == 0) | ||
146 | return k; | ||
147 | } | ||
132 | return NULL; | 148 | return NULL; |
133 | } | 149 | } |
134 | 150 | ||