diff options
Diffstat (limited to 'kex.c')
-rw-r--r-- | kex.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 | /* prototype */ | 61 | /* prototype */ |
58 | static int kex_choose_conf(struct ssh *); | 62 | static int kex_choose_conf(struct ssh *); |
59 | static int kex_input_newkeys(int, u_int32_t, struct ssh *); | 63 | static int kex_input_newkeys(int, u_int32_t, struct ssh *); |
@@ -105,6 +109,14 @@ static const struct kexalg kexalgs[] = { | |||
105 | #endif /* HAVE_EVP_SHA256 || !WITH_OPENSSL */ | 109 | #endif /* HAVE_EVP_SHA256 || !WITH_OPENSSL */ |
106 | { NULL, -1, -1, -1}, | 110 | { NULL, -1, -1, -1}, |
107 | }; | 111 | }; |
112 | static const struct kexalg kexalg_prefixes[] = { | ||
113 | #ifdef GSSAPI | ||
114 | { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, SSH_DIGEST_SHA1 }, | ||
115 | { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, SSH_DIGEST_SHA1 }, | ||
116 | { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, SSH_DIGEST_SHA1 }, | ||
117 | #endif | ||
118 | { NULL, -1, -1, -1 }, | ||
119 | }; | ||
108 | 120 | ||
109 | char * | 121 | char * |
110 | kex_alg_list(char sep) | 122 | kex_alg_list(char sep) |
@@ -137,6 +149,10 @@ kex_alg_by_name(const char *name) | |||
137 | if (strcmp(k->name, name) == 0) | 149 | if (strcmp(k->name, name) == 0) |
138 | return k; | 150 | return k; |
139 | } | 151 | } |
152 | for (k = kexalg_prefixes; k->name != NULL; k++) { | ||
153 | if (strncmp(k->name, name, strlen(k->name)) == 0) | ||
154 | return k; | ||
155 | } | ||
140 | return NULL; | 156 | return NULL; |
141 | } | 157 | } |
142 | 158 | ||
@@ -599,6 +615,9 @@ kex_free(struct kex *kex) | |||
599 | sshbuf_free(kex->peer); | 615 | sshbuf_free(kex->peer); |
600 | sshbuf_free(kex->my); | 616 | sshbuf_free(kex->my); |
601 | free(kex->session_id); | 617 | free(kex->session_id); |
618 | #ifdef GSSAPI | ||
619 | free(kex->gss_host); | ||
620 | #endif /* GSSAPI */ | ||
602 | free(kex->client_version_string); | 621 | free(kex->client_version_string); |
603 | free(kex->server_version_string); | 622 | free(kex->server_version_string); |
604 | free(kex->failed_choice); | 623 | free(kex->failed_choice); |