diff options
Diffstat (limited to 'sshconnect2.c')
-rw-r--r-- | sshconnect2.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/sshconnect2.c b/sshconnect2.c index 63e9369b1..72d328692 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect2.c,v 1.162 2006/08/30 00:06:51 dtucker Exp $ */ | 1 | /* $OpenBSD: sshconnect2.c,v 1.164 2007/05/17 23:53:41 jolan Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -31,6 +31,7 @@ | |||
31 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
32 | 32 | ||
33 | #include <errno.h> | 33 | #include <errno.h> |
34 | #include <netdb.h> | ||
34 | #include <pwd.h> | 35 | #include <pwd.h> |
35 | #include <signal.h> | 36 | #include <signal.h> |
36 | #include <stdarg.h> | 37 | #include <stdarg.h> |
@@ -173,11 +174,9 @@ ssh_kex2(char *host, struct sockaddr *hostaddr) | |||
173 | kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; | 174 | kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; |
174 | kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; | 175 | kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; |
175 | #ifdef GSSAPI | 176 | #ifdef GSSAPI |
176 | if (options.gss_keyex) { | 177 | kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client; |
177 | kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client; | 178 | kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_client; |
178 | kex->kex[KEX_GSS_GRP14_SHA1] = kexgss_client; | 179 | kex->kex[KEX_GSS_GEX_SHA1] = kexgss_client; |
179 | kex->kex[KEX_GSS_GEX_SHA1] = kexgss_client; | ||
180 | } | ||
181 | #endif | 180 | #endif |
182 | kex->client_version_string=client_version_string; | 181 | kex->client_version_string=client_version_string; |
183 | kex->server_version_string=server_version_string; | 182 | kex->server_version_string=server_version_string; |
@@ -687,7 +686,7 @@ input_gssapi_response(int type, u_int32_t plen, void *ctxt) | |||
687 | Authctxt *authctxt = ctxt; | 686 | Authctxt *authctxt = ctxt; |
688 | Gssctxt *gssctxt; | 687 | Gssctxt *gssctxt; |
689 | u_int oidlen; | 688 | u_int oidlen; |
690 | u_char *oidv, *oidv_free; | 689 | u_char *oidv; |
691 | 690 | ||
692 | if (authctxt == NULL) | 691 | if (authctxt == NULL) |
693 | fatal("input_gssapi_response: no authentication context"); | 692 | fatal("input_gssapi_response: no authentication context"); |
@@ -1433,7 +1432,7 @@ userauth_hostbased(Authctxt *authctxt) | |||
1433 | Sensitive *sensitive = authctxt->sensitive; | 1432 | Sensitive *sensitive = authctxt->sensitive; |
1434 | Buffer b; | 1433 | Buffer b; |
1435 | u_char *signature, *blob; | 1434 | u_char *signature, *blob; |
1436 | char *chost, *pkalg, *p; | 1435 | char *chost, *pkalg, *p, myname[NI_MAXHOST]; |
1437 | const char *service; | 1436 | const char *service; |
1438 | u_int blen, slen; | 1437 | u_int blen, slen; |
1439 | int ok, i, len, found = 0; | 1438 | int ok, i, len, found = 0; |
@@ -1457,7 +1456,16 @@ userauth_hostbased(Authctxt *authctxt) | |||
1457 | return 0; | 1456 | return 0; |
1458 | } | 1457 | } |
1459 | /* figure out a name for the client host */ | 1458 | /* figure out a name for the client host */ |
1460 | p = get_local_name(packet_get_connection_in()); | 1459 | p = NULL; |
1460 | if (packet_connection_is_on_socket()) | ||
1461 | p = get_local_name(packet_get_connection_in()); | ||
1462 | if (p == NULL) { | ||
1463 | if (gethostname(myname, sizeof(myname)) == -1) { | ||
1464 | verbose("userauth_hostbased: gethostname: %s", | ||
1465 | strerror(errno)); | ||
1466 | } else | ||
1467 | p = xstrdup(myname); | ||
1468 | } | ||
1461 | if (p == NULL) { | 1469 | if (p == NULL) { |
1462 | error("userauth_hostbased: cannot get local ipaddr/name"); | 1470 | error("userauth_hostbased: cannot get local ipaddr/name"); |
1463 | key_free(private); | 1471 | key_free(private); |