|
|
8f2528 |
diff -up openssh-7.4p1/gss-genr.c.gsskexalg openssh-7.4p1/gss-genr.c
|
|
|
8f2528 |
--- openssh-7.4p1/gss-genr.c.gsskexalg 2017-02-09 10:46:50.417893132 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/gss-genr.c 2017-02-09 10:46:50.448893107 +0100
|
|
|
8f2528 |
@@ -77,7 +77,8 @@ ssh_gssapi_oid_table_ok() {
|
|
|
8f2528 |
*/
|
|
|
8f2528 |
|
|
|
8f2528 |
char *
|
|
|
8f2528 |
-ssh_gssapi_client_mechanisms(const char *host, const char *client) {
|
|
|
8f2528 |
+ssh_gssapi_client_mechanisms(const char *host, const char *client,
|
|
|
8f2528 |
+ const char *kex) {
|
|
|
8f2528 |
gss_OID_set gss_supported;
|
|
|
8f2528 |
OM_uint32 min_status;
|
|
|
8f2528 |
|
|
|
8f2528 |
@@ -85,12 +86,12 @@ ssh_gssapi_client_mechanisms(const char
|
|
|
8f2528 |
return NULL;
|
|
|
8f2528 |
|
|
|
8f2528 |
return(ssh_gssapi_kex_mechs(gss_supported, ssh_gssapi_check_mechanism,
|
|
|
8f2528 |
- host, client));
|
|
|
8f2528 |
+ host, client, kex));
|
|
|
8f2528 |
}
|
|
|
8f2528 |
|
|
|
8f2528 |
char *
|
|
|
8f2528 |
ssh_gssapi_kex_mechs(gss_OID_set gss_supported, ssh_gssapi_check_fn *check,
|
|
|
8f2528 |
- const char *host, const char *client) {
|
|
|
8f2528 |
+ const char *host, const char *client, const char *kex) {
|
|
|
8f2528 |
Buffer buf;
|
|
|
8f2528 |
size_t i;
|
|
|
8f2528 |
int oidpos, enclen;
|
|
|
8f2528 |
@@ -99,6 +100,7 @@ ssh_gssapi_kex_mechs(gss_OID_set gss_sup
|
|
|
8f2528 |
char deroid[2];
|
|
|
8f2528 |
const EVP_MD *evp_md = EVP_md5();
|
|
|
8f2528 |
EVP_MD_CTX md;
|
|
|
8f2528 |
+ char *s, *cp, *p;
|
|
|
8f2528 |
|
|
|
8f2528 |
if (gss_enc2oid != NULL) {
|
|
|
8f2528 |
for (i = 0; gss_enc2oid[i].encoded != NULL; i++)
|
|
|
8f2528 |
@@ -112,6 +114,7 @@ ssh_gssapi_kex_mechs(gss_OID_set gss_sup
|
|
|
8f2528 |
buffer_init(&buf;;
|
|
|
8f2528 |
|
|
|
8f2528 |
oidpos = 0;
|
|
|
8f2528 |
+ s = cp = strdup(kex);
|
|
|
8f2528 |
for (i = 0; i < gss_supported->count; i++) {
|
|
|
8f2528 |
if (gss_supported->elements[i].length < 128 &&
|
|
|
8f2528 |
(*check)(NULL, &(gss_supported->elements[i]), host, client)) {
|
|
|
8f2528 |
@@ -130,26 +133,22 @@ ssh_gssapi_kex_mechs(gss_OID_set gss_sup
|
|
|
8f2528 |
enclen = __b64_ntop(digest, EVP_MD_size(evp_md),
|
|
|
8f2528 |
encoded, EVP_MD_size(evp_md) * 2);
|
|
|
8f2528 |
|
|
|
8f2528 |
- if (oidpos != 0)
|
|
|
8f2528 |
- buffer_put_char(&buf, ',');
|
|
|
8f2528 |
-
|
|
|
8f2528 |
- buffer_append(&buf, KEX_GSS_GEX_SHA1_ID,
|
|
|
8f2528 |
- sizeof(KEX_GSS_GEX_SHA1_ID) - 1);
|
|
|
8f2528 |
- buffer_append(&buf, encoded, enclen);
|
|
|
8f2528 |
- buffer_put_char(&buf, ',');
|
|
|
8f2528 |
- buffer_append(&buf, KEX_GSS_GRP1_SHA1_ID,
|
|
|
8f2528 |
- sizeof(KEX_GSS_GRP1_SHA1_ID) - 1);
|
|
|
8f2528 |
- buffer_append(&buf, encoded, enclen);
|
|
|
8f2528 |
- buffer_put_char(&buf, ',');
|
|
|
8f2528 |
- buffer_append(&buf, KEX_GSS_GRP14_SHA1_ID,
|
|
|
8f2528 |
- sizeof(KEX_GSS_GRP14_SHA1_ID) - 1);
|
|
|
8f2528 |
- buffer_append(&buf, encoded, enclen);
|
|
|
8f2528 |
+ cp = strncpy(s, kex, strlen(kex));
|
|
|
8f2528 |
+ for ((p = strsep(&cp, ",")); p && *p != '\0';
|
|
|
8f2528 |
+ (p = strsep(&cp, ","))) {
|
|
|
8f2528 |
+ if (buffer_len(&buf) != 0)
|
|
|
8f2528 |
+ buffer_put_char(&buf, ',');
|
|
|
8f2528 |
+ buffer_append(&buf, p,
|
|
|
8f2528 |
+ strlen(p));
|
|
|
8f2528 |
+ buffer_append(&buf, encoded, enclen);
|
|
|
8f2528 |
+ }
|
|
|
8f2528 |
|
|
|
8f2528 |
gss_enc2oid[oidpos].oid = &(gss_supported->elements[i]);
|
|
|
8f2528 |
gss_enc2oid[oidpos].encoded = encoded;
|
|
|
8f2528 |
oidpos++;
|
|
|
8f2528 |
}
|
|
|
8f2528 |
}
|
|
|
8f2528 |
+ free(s);
|
|
|
8f2528 |
gss_enc2oid[oidpos].oid = NULL;
|
|
|
8f2528 |
gss_enc2oid[oidpos].encoded = NULL;
|
|
|
8f2528 |
|
|
|
8f2528 |
diff -up openssh-7.4p1/gss-serv.c.gsskexalg openssh-7.4p1/gss-serv.c
|
|
|
8f2528 |
--- openssh-7.4p1/gss-serv.c.gsskexalg 2017-02-09 10:46:50.449893106 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/gss-serv.c 2017-02-09 10:55:12.189422901 +0100
|
|
|
8f2528 |
@@ -149,7 +149,7 @@ ssh_gssapi_server_mechanisms() {
|
|
|
8f2528 |
if (supported_oids == NULL)
|
|
|
8f2528 |
ssh_gssapi_prepare_supported_oids();
|
|
|
8f2528 |
return (ssh_gssapi_kex_mechs(supported_oids,
|
|
|
8f2528 |
- &ssh_gssapi_server_check_mech, NULL, NULL));
|
|
|
8f2528 |
+ &ssh_gssapi_server_check_mech, NULL, NULL, options.gss_kex_algorithms));
|
|
|
8f2528 |
}
|
|
|
8f2528 |
|
|
|
8f2528 |
/* Unprivileged */
|
|
|
8f2528 |
diff -up openssh-7.4p1/kex.c.gsskexalg openssh-7.4p1/kex.c
|
|
|
8f2528 |
--- openssh-7.4p1/kex.c.gsskexalg 2017-02-09 10:46:50.449893106 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/kex.c 2017-02-09 10:55:44.008393539 +0100
|
|
|
8f2528 |
@@ -248,6 +248,29 @@ kex_assemble_names(const char *def, char
|
|
|
8f2528 |
return 0;
|
|
|
8f2528 |
}
|
|
|
8f2528 |
|
|
|
8f2528 |
+/* Validate GSS KEX method name list */
|
|
|
8f2528 |
+int
|
|
|
8f2528 |
+gss_kex_names_valid(const char *names)
|
|
|
8f2528 |
+{
|
|
|
8f2528 |
+ char *s, *cp, *p;
|
|
|
8f2528 |
+
|
|
|
8f2528 |
+ if (names == NULL || *names == '\0')
|
|
|
8f2528 |
+ return 0;
|
|
|
8f2528 |
+ s = cp = strdup(names);
|
|
|
8f2528 |
+ for ((p = strsep(&cp, ",")); p && *p != '\0';
|
|
|
8f2528 |
+ (p = strsep(&cp, ","))) {
|
|
|
8f2528 |
+ if (strncmp(p, "gss-", 4) != 0
|
|
|
8f2528 |
+ || kex_alg_by_name(p) == NULL) {
|
|
|
8f2528 |
+ error("Unsupported KEX algorithm \"%.100s\"", p);
|
|
|
8f2528 |
+ free(s);
|
|
|
8f2528 |
+ return 0;
|
|
|
8f2528 |
+ }
|
|
|
8f2528 |
+ }
|
|
|
8f2528 |
+ debug3("gss kex names ok: [%s]", names);
|
|
|
8f2528 |
+ free(s);
|
|
|
8f2528 |
+ return 1;
|
|
|
8f2528 |
+}
|
|
|
8f2528 |
+
|
|
|
8f2528 |
/* put algorithm proposal into buffer */
|
|
|
8f2528 |
int
|
|
|
8f2528 |
kex_prop2buf(struct sshbuf *b, char *proposal[PROPOSAL_MAX])
|
|
|
8f2528 |
diff -up openssh-7.4p1/kex.h.gsskexalg openssh-7.4p1/kex.h
|
|
|
8f2528 |
--- openssh-7.4p1/kex.h.gsskexalg 2017-02-09 10:46:50.452893104 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/kex.h 2017-02-09 11:02:35.313012903 +0100
|
|
|
8f2528 |
@@ -179,6 +179,7 @@ struct kex {
|
|
|
8f2528 |
char *kex_alg_list(char);
|
|
|
8f2528 |
char *kex_names_cat(const char *, const char *);
|
|
|
8f2528 |
int kex_assemble_names(const char *, char **);
|
|
|
8f2528 |
+int gss_kex_names_valid(const char *);
|
|
|
8f2528 |
|
|
|
8f2528 |
int kex_new(struct ssh *, char *[PROPOSAL_MAX], struct kex **);
|
|
|
8f2528 |
int kex_setup(struct ssh *, char *[PROPOSAL_MAX]);
|
|
|
8f2528 |
diff -up openssh-7.4p1/readconf.c.gsskexalg openssh-7.4p1/readconf.c
|
|
|
8f2528 |
--- openssh-7.4p1/readconf.c.gsskexalg 2017-02-09 10:46:50.420893129 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/readconf.c 2017-02-09 10:56:06.759372540 +0100
|
|
|
8f2528 |
@@ -64,6 +64,7 @@
|
|
|
8f2528 |
#include "uidswap.h"
|
|
|
8f2528 |
#include "myproposal.h"
|
|
|
8f2528 |
#include "digest.h"
|
|
|
8f2528 |
+#include "ssh-gss.h"
|
|
|
8f2528 |
|
|
|
8f2528 |
/* Format of the configuration file:
|
|
|
8f2528 |
|
|
|
8f2528 |
@@ -161,7 +162,7 @@ typedef enum {
|
|
|
8f2528 |
oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
|
|
|
8f2528 |
oAddressFamily, oGssAuthentication, oGssDelegateCreds,
|
|
|
8f2528 |
oGssTrustDns, oGssKeyEx, oGssClientIdentity, oGssRenewalRekey,
|
|
|
8f2528 |
- oGssServerIdentity,
|
|
|
8f2528 |
+ oGssServerIdentity, oGssKexAlgorithms,
|
|
|
8f2528 |
oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
|
|
|
8f2528 |
oSendEnv, oControlPath, oControlMaster, oControlPersist,
|
|
|
8f2528 |
oHashKnownHosts,
|
|
|
8f2528 |
@@ -213,6 +214,7 @@ static struct {
|
|
|
8f2528 |
{ "gssapiclientidentity", oGssClientIdentity },
|
|
|
8f2528 |
{ "gssapiserveridentity", oGssServerIdentity },
|
|
|
8f2528 |
{ "gssapirenewalforcesrekey", oGssRenewalRekey },
|
|
|
8f2528 |
+ { "gssapikexalgorithms", oGssKexAlgorithms },
|
|
|
8f2528 |
#else
|
|
|
8f2528 |
{ "gssapiauthentication", oUnsupported },
|
|
|
8f2528 |
{ "gssapikeyexchange", oUnsupported },
|
|
|
8f2528 |
@@ -220,6 +222,7 @@ static struct {
|
|
|
8f2528 |
{ "gssapitrustdns", oUnsupported },
|
|
|
8f2528 |
{ "gssapiclientidentity", oUnsupported },
|
|
|
8f2528 |
{ "gssapirenewalforcesrekey", oUnsupported },
|
|
|
8f2528 |
+ { "gssapikexalgorithms", oUnsupported },
|
|
|
8f2528 |
#endif
|
|
|
8f2528 |
{ "fallbacktorsh", oDeprecated },
|
|
|
8f2528 |
{ "usersh", oDeprecated },
|
|
|
8f2528 |
@@ -996,6 +999,18 @@ parse_time:
|
|
|
8f2528 |
intptr = &options->gss_renewal_rekey;
|
|
|
8f2528 |
goto parse_flag;
|
|
|
8f2528 |
|
|
|
8f2528 |
+ case oGssKexAlgorithms:
|
|
|
8f2528 |
+ arg = strdelim(&s);
|
|
|
8f2528 |
+ if (!arg || *arg == '\0')
|
|
|
8f2528 |
+ fatal("%.200s line %d: Missing argument.",
|
|
|
8f2528 |
+ filename, linenum);
|
|
|
8f2528 |
+ if (!gss_kex_names_valid(arg))
|
|
|
8f2528 |
+ fatal("%.200s line %d: Bad GSSAPI KexAlgorithms '%s'.",
|
|
|
8f2528 |
+ filename, linenum, arg ? arg : "<NONE>");
|
|
|
8f2528 |
+ if (*activep && options->gss_kex_algorithms == NULL)
|
|
|
8f2528 |
+ options->gss_kex_algorithms = strdup(arg);
|
|
|
8f2528 |
+ break;
|
|
|
8f2528 |
+
|
|
|
8f2528 |
case oBatchMode:
|
|
|
8f2528 |
intptr = &options->batch_mode;
|
|
|
8f2528 |
goto parse_flag;
|
|
|
8f2528 |
@@ -1813,6 +1828,7 @@ initialize_options(Options * options)
|
|
|
8f2528 |
options->gss_renewal_rekey = -1;
|
|
|
8f2528 |
options->gss_client_identity = NULL;
|
|
|
8f2528 |
options->gss_server_identity = NULL;
|
|
|
8f2528 |
+ options->gss_kex_algorithms = NULL;
|
|
|
8f2528 |
options->password_authentication = -1;
|
|
|
8f2528 |
options->kbd_interactive_authentication = -1;
|
|
|
8f2528 |
options->kbd_interactive_devices = NULL;
|
|
|
8f2528 |
@@ -1964,6 +1980,10 @@ fill_default_options(Options * options)
|
|
|
8f2528 |
options->gss_trust_dns = 0;
|
|
|
8f2528 |
if (options->gss_renewal_rekey == -1)
|
|
|
8f2528 |
options->gss_renewal_rekey = 0;
|
|
|
8f2528 |
+#ifdef GSSAPI
|
|
|
8f2528 |
+ if (options->gss_kex_algorithms == NULL)
|
|
|
8f2528 |
+ options->gss_kex_algorithms = strdup(GSS_KEX_DEFAULT_KEX);
|
|
|
8f2528 |
+#endif
|
|
|
8f2528 |
if (options->password_authentication == -1)
|
|
|
8f2528 |
options->password_authentication = 1;
|
|
|
8f2528 |
if (options->kbd_interactive_authentication == -1)
|
|
|
8f2528 |
diff -up openssh-7.4p1/readconf.h.gsskexalg openssh-7.4p1/readconf.h
|
|
|
8f2528 |
--- openssh-7.4p1/readconf.h.gsskexalg 2017-02-09 10:46:50.420893129 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/readconf.h 2017-02-09 10:46:50.450893106 +0100
|
|
|
8f2528 |
@@ -51,6 +51,7 @@ typedef struct {
|
|
|
8f2528 |
int gss_renewal_rekey; /* Credential renewal forces rekey */
|
|
|
8f2528 |
char *gss_client_identity; /* Principal to initiate GSSAPI with */
|
|
|
8f2528 |
char *gss_server_identity; /* GSSAPI target principal */
|
|
|
8f2528 |
+ char *gss_kex_algorithms; /* GSSAPI kex methods to be offered by client. */
|
|
|
8f2528 |
int password_authentication; /* Try password
|
|
|
8f2528 |
* authentication. */
|
|
|
8f2528 |
int kbd_interactive_authentication; /* Try keyboard-interactive auth. */
|
|
|
8f2528 |
diff -up openssh-7.4p1/servconf.c.gsskexalg openssh-7.4p1/servconf.c
|
|
|
8f2528 |
--- openssh-7.4p1/servconf.c.gsskexalg 2017-02-09 10:46:50.446893109 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/servconf.c 2017-02-09 10:57:15.784309297 +0100
|
|
|
8f2528 |
@@ -57,6 +57,7 @@
|
|
|
8f2528 |
#include "auth.h"
|
|
|
8f2528 |
#include "myproposal.h"
|
|
|
8f2528 |
#include "digest.h"
|
|
|
8f2528 |
+#include "ssh-gss.h"
|
|
|
8f2528 |
|
|
|
8f2528 |
static void add_listen_addr(ServerOptions *, char *, int);
|
|
|
8f2528 |
static void add_one_listen_addr(ServerOptions *, char *, int);
|
|
|
8f2528 |
@@ -117,6 +117,7 @@ initialize_server_options(ServerOptions
|
|
|
8f2528 |
options->gss_cleanup_creds = -1;
|
|
|
8f2528 |
options->gss_strict_acceptor = -1;
|
|
|
8f2528 |
options->gss_store_rekey = -1;
|
|
|
8f2528 |
+ options->gss_kex_algorithms = NULL;
|
|
|
8f2528 |
options->password_authentication = -1;
|
|
|
8f2528 |
options->kbd_interactive_authentication = -1;
|
|
|
8f2528 |
options->challenge_response_authentication = -1;
|
|
|
8f2528 |
@@ -280,6 +281,10 @@ fill_default_server_options(ServerOption
|
|
|
8f2528 |
options->gss_strict_acceptor = 1;
|
|
|
8f2528 |
if (options->gss_store_rekey == -1)
|
|
|
8f2528 |
options->gss_store_rekey = 0;
|
|
|
8f2528 |
+#ifdef GSSAPI
|
|
|
8f2528 |
+ if (options->gss_kex_algorithms == NULL)
|
|
|
8f2528 |
+ options->gss_kex_algorithms = strdup(GSS_KEX_DEFAULT_KEX);
|
|
|
8f2528 |
+#endif
|
|
|
8f2528 |
if (options->password_authentication == -1)
|
|
|
8f2528 |
options->password_authentication = 1;
|
|
|
8f2528 |
if (options->kbd_interactive_authentication == -1)
|
|
|
8f2528 |
@@ -422,7 +425,7 @@ typedef enum {
|
|
|
8f2528 |
sHostKeyAlgorithms,
|
|
|
8f2528 |
sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile,
|
|
|
8f2528 |
sGssAuthentication, sGssCleanupCreds, sGssEnablek5users, sGssStrictAcceptor,
|
|
|
8f2528 |
- sGssKeyEx, sGssStoreRekey, sAcceptEnv, sPermitTunnel,
|
|
|
8f2528 |
+ sGssKeyEx, sGssStoreRekey, sGssKexAlgorithms, sAcceptEnv, sPermitTunnel,
|
|
|
8f2528 |
sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
|
|
|
8f2528 |
sUsePrivilegeSeparation, sAllowAgentForwarding,
|
|
|
8f2528 |
sHostCertificate,
|
|
|
8f2528 |
@@ -501,6 +504,7 @@ static struct {
|
|
|
8f2528 |
{ "gssapikeyexchange", sGssKeyEx, SSHCFG_GLOBAL },
|
|
|
8f2528 |
{ "gssapistorecredentialsonrekey", sGssStoreRekey, SSHCFG_GLOBAL },
|
|
|
8f2528 |
{ "gssapienablek5users", sGssEnablek5users, SSHCFG_ALL },
|
|
|
8f2528 |
+ { "gssapikexalgorithms", sGssKexAlgorithms, SSHCFG_GLOBAL },
|
|
|
8f2528 |
#else
|
|
|
8f2528 |
{ "gssapiauthentication", sUnsupported, SSHCFG_ALL },
|
|
|
8f2528 |
{ "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL },
|
|
|
8f2528 |
@@ -508,6 +512,7 @@ static struct {
|
|
|
8f2528 |
{ "gssapikeyexchange", sUnsupported, SSHCFG_GLOBAL },
|
|
|
8f2528 |
{ "gssapistorecredentialsonrekey", sUnsupported, SSHCFG_GLOBAL },
|
|
|
8f2528 |
{ "gssapienablek5users", sUnsupported, SSHCFG_ALL },
|
|
|
8f2528 |
+ { "gssapikexalgorithms", sUnsupported, SSHCFG_GLOBAL },
|
|
|
8f2528 |
#endif
|
|
|
8f2528 |
{ "gssusesessionccache", sUnsupported, SSHCFG_GLOBAL },
|
|
|
8f2528 |
{ "gssapiusesessioncredcache", sUnsupported, SSHCFG_GLOBAL },
|
|
|
8f2528 |
@@ -1249,6 +1254,18 @@ process_server_config_line(ServerOptions
|
|
|
8f2528 |
intptr = &options->gss_store_rekey;
|
|
|
8f2528 |
goto parse_flag;
|
|
|
8f2528 |
|
|
|
8f2528 |
+ case sGssKexAlgorithms:
|
|
|
8f2528 |
+ arg = strdelim(&cp;;
|
|
|
8f2528 |
+ if (!arg || *arg == '\0')
|
|
|
8f2528 |
+ fatal("%.200s line %d: Missing argument.",
|
|
|
8f2528 |
+ filename, linenum);
|
|
|
8f2528 |
+ if (!gss_kex_names_valid(arg))
|
|
|
8f2528 |
+ fatal("%.200s line %d: Bad GSSAPI KexAlgorithms '%s'.",
|
|
|
8f2528 |
+ filename, linenum, arg ? arg : "<NONE>");
|
|
|
8f2528 |
+ if (*activep && options->gss_kex_algorithms == NULL)
|
|
|
8f2528 |
+ options->gss_kex_algorithms = strdup(arg);
|
|
|
8f2528 |
+ break;
|
|
|
8f2528 |
+
|
|
|
8f2528 |
case sPasswordAuthentication:
|
|
|
8f2528 |
intptr = &options->password_authentication;
|
|
|
8f2528 |
goto parse_flag;
|
|
|
8f2528 |
@@ -2304,6 +2321,7 @@ dump_config(ServerOptions *o)
|
|
|
8f2528 |
dump_cfg_fmtint(sGssKeyEx, o->gss_keyex);
|
|
|
8f2528 |
dump_cfg_fmtint(sGssStrictAcceptor, o->gss_strict_acceptor);
|
|
|
8f2528 |
dump_cfg_fmtint(sGssStoreRekey, o->gss_store_rekey);
|
|
|
8f2528 |
+ dump_cfg_string(sGssKexAlgorithms, o->gss_kex_algorithms);
|
|
|
8f2528 |
#endif
|
|
|
8f2528 |
dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication);
|
|
|
8f2528 |
dump_cfg_fmtint(sKbdInteractiveAuthentication,
|
|
|
8f2528 |
diff -up openssh-7.4p1/servconf.h.gsskexalg openssh-7.4p1/servconf.h
|
|
|
8f2528 |
--- openssh-7.4p1/servconf.h.gsskexalg 2017-02-09 10:46:50.450893106 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/servconf.h 2017-02-09 10:57:33.717292870 +0100
|
|
|
8f2528 |
@@ -116,6 +116,7 @@ typedef struct {
|
|
|
8f2528 |
int gss_cleanup_creds; /* If true, destroy cred cache on logout */
|
|
|
8f2528 |
int gss_strict_acceptor; /* If true, restrict the GSSAPI acceptor name */
|
|
|
8f2528 |
int gss_store_rekey;
|
|
|
8f2528 |
+ char *gss_kex_algorithms; /* GSSAPI kex methods to be offered by client. */
|
|
|
8f2528 |
int password_authentication; /* If true, permit password
|
|
|
8f2528 |
* authentication. */
|
|
|
8f2528 |
int kbd_interactive_authentication; /* If true, permit */
|
|
|
8f2528 |
diff -up openssh-7.4p1/ssh.1.gsskexalg openssh-7.4p1/ssh.1
|
|
|
8f2528 |
--- openssh-7.4p1/ssh.1.gsskexalg 2017-02-09 10:46:50.443893111 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/ssh.1 2017-02-09 10:46:50.451893105 +0100
|
|
|
8f2528 |
@@ -517,6 +517,7 @@ For full details of the options listed b
|
|
|
8f2528 |
.It GSSAPIDelegateCredentials
|
|
|
8f2528 |
.It GSSAPIRenewalForcesRekey
|
|
|
8f2528 |
.It GSSAPITrustDns
|
|
|
8f2528 |
+.It GSSAPIKexAlgorithms
|
|
|
8f2528 |
.It HashKnownHosts
|
|
|
8f2528 |
.It Host
|
|
|
8f2528 |
.It HostbasedAuthentication
|
|
|
8f2528 |
diff -up openssh-7.4p1/ssh_config.5.gsskexalg openssh-7.4p1/ssh_config.5
|
|
|
8f2528 |
--- openssh-7.4p1/ssh_config.5.gsskexalg 2017-02-09 10:46:50.452893104 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/ssh_config.5 2017-02-09 11:00:39.053122745 +0100
|
|
|
8f2528 |
@@ -782,6 +782,18 @@ the name of the host being connected to.
|
|
|
8f2528 |
command line will be passed untouched to the GSSAPI library.
|
|
|
8f2528 |
The default is
|
|
|
8f2528 |
.Dq no .
|
|
|
8f2528 |
+.It Cm GSSAPIKexAlgorithms
|
|
|
8f2528 |
+The list of key exchange algorithms that are offered for GSSAPI
|
|
|
8f2528 |
+key exchange. Possible values are
|
|
|
8f2528 |
+.Bd -literal -offset 3n
|
|
|
8f2528 |
+gss-gex-sha1-,
|
|
|
8f2528 |
+gss-group1-sha1-,
|
|
|
8f2528 |
+gss-group14-sha1-
|
|
|
8f2528 |
+.Ed
|
|
|
8f2528 |
+.Pp
|
|
|
8f2528 |
+The default is
|
|
|
8f2528 |
+.Dq gss-gex-sha1-,gss-group1-sha1-,gss-group14-sha1- .
|
|
|
8f2528 |
+This option only applies to protocol version 2 connections using GSSAPI.
|
|
|
8f2528 |
.It Cm HashKnownHosts
|
|
|
8f2528 |
Indicates that
|
|
|
8f2528 |
.Xr ssh 1
|
|
|
8f2528 |
diff -up openssh-7.4p1/sshconnect2.c.gsskexalg openssh-7.4p1/sshconnect2.c
|
|
|
8f2528 |
--- openssh-7.4p1/sshconnect2.c.gsskexalg 2017-02-09 10:46:50.451893105 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/sshconnect2.c 2017-02-09 10:58:08.533260973 +0100
|
|
|
8f2528 |
@@ -181,7 +181,8 @@ ssh_kex2(char *host, struct sockaddr *ho
|
|
|
8f2528 |
else
|
|
|
8f2528 |
gss_host = host;
|
|
|
8f2528 |
|
|
|
8f2528 |
- gss = ssh_gssapi_client_mechanisms(gss_host, options.gss_client_identity);
|
|
|
8f2528 |
+ gss = ssh_gssapi_client_mechanisms(gss_host,
|
|
|
8f2528 |
+ options.gss_client_identity, options.gss_kex_algorithms);
|
|
|
8f2528 |
if (gss) {
|
|
|
8f2528 |
debug("Offering GSSAPI proposal: %s", gss);
|
|
|
8f2528 |
xasprintf(&options.kex_algorithms,
|
|
|
8f2528 |
diff -up openssh-7.4p1/sshd_config.5.gsskexalg openssh-7.4p1/sshd_config.5
|
|
|
8f2528 |
--- openssh-7.4p1/sshd_config.5.gsskexalg 2017-02-09 10:46:50.452893104 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/sshd_config.5 2017-02-09 11:01:55.141050861 +0100
|
|
|
8f2528 |
@@ -666,6 +666,18 @@ Controls whether the user's GSSAPI crede
|
|
|
8f2528 |
successful connection rekeying. This option can be used to accepted renewed
|
|
|
8f2528 |
or updated credentials from a compatible client. The default is
|
|
|
8f2528 |
.Dq no .
|
|
|
8f2528 |
+.It Cm GSSAPIKexAlgorithms
|
|
|
8f2528 |
+The list of key exchange algorithms that are accepted by GSSAPI
|
|
|
8f2528 |
+key exchange. Possible values are
|
|
|
8f2528 |
+.Bd -literal -offset 3n
|
|
|
8f2528 |
+gss-gex-sha1-,
|
|
|
8f2528 |
+gss-group1-sha1-,
|
|
|
8f2528 |
+gss-group14-sha1-
|
|
|
8f2528 |
+.Ed
|
|
|
8f2528 |
+.Pp
|
|
|
8f2528 |
+The default is
|
|
|
8f2528 |
+.Dq gss-gex-sha1-,gss-group1-sha1-,gss-group14-sha1- .
|
|
|
8f2528 |
+This option only applies to protocol version 2 connections using GSSAPI.
|
|
|
8f2528 |
.It Cm HostbasedAcceptedKeyTypes
|
|
|
8f2528 |
Specifies the key types that will be accepted for hostbased authentication
|
|
|
8f2528 |
as a comma-separated pattern list.
|
|
|
8f2528 |
diff -up openssh-7.4p1/ssh-gss.h.gsskexalg openssh-7.4p1/ssh-gss.h
|
|
|
8f2528 |
--- openssh-7.4p1/ssh-gss.h.gsskexalg 2017-02-09 10:46:50.425893125 +0100
|
|
|
8f2528 |
+++ openssh-7.4p1/ssh-gss.h 2017-02-09 10:46:50.451893105 +0100
|
|
|
8f2528 |
@@ -76,6 +76,11 @@ extern char **k5users_allowed_cmds;
|
|
|
8f2528 |
#define KEX_GSS_GRP14_SHA1_ID "gss-group14-sha1-"
|
|
|
8f2528 |
#define KEX_GSS_GEX_SHA1_ID "gss-gex-sha1-"
|
|
|
8f2528 |
|
|
|
8f2528 |
+#define GSS_KEX_DEFAULT_KEX \
|
|
|
8f2528 |
+ KEX_GSS_GEX_SHA1_ID "," \
|
|
|
8f2528 |
+ KEX_GSS_GRP1_SHA1_ID "," \
|
|
|
8f2528 |
+ KEX_GSS_GRP14_SHA1_ID
|
|
|
8f2528 |
+
|
|
|
8f2528 |
typedef struct {
|
|
|
8f2528 |
char *filename;
|
|
|
8f2528 |
char *envvar;
|
|
|
8f2528 |
@@ -147,9 +152,9 @@ int ssh_gssapi_credentials_updated(Gssct
|
|
|
8f2528 |
/* In the server */
|
|
|
8f2528 |
typedef int ssh_gssapi_check_fn(Gssctxt **, gss_OID, const char *,
|
|
|
8f2528 |
const char *);
|
|
|
8f2528 |
-char *ssh_gssapi_client_mechanisms(const char *, const char *);
|
|
|
8f2528 |
+char *ssh_gssapi_client_mechanisms(const char *, const char *, const char *);
|
|
|
8f2528 |
char *ssh_gssapi_kex_mechs(gss_OID_set, ssh_gssapi_check_fn *, const char *,
|
|
|
8f2528 |
- const char *);
|
|
|
8f2528 |
+ const char *, const char *);
|
|
|
8f2528 |
gss_OID ssh_gssapi_id_kex(Gssctxt *, char *, int);
|
|
|
8f2528 |
int ssh_gssapi_server_check_mech(Gssctxt **,gss_OID, const char *,
|
|
|
8f2528 |
const char *);
|