summaryrefslogtreecommitdiff
path: root/debian/patches/gssapi.patch
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-10 00:27:24 +0000
committerColin Watson <cjwatson@debian.org>2014-02-10 02:40:28 +0000
commita2b8818c5d21cfcba443625251f691a2ea3a29c7 (patch)
tree8fe1fe448cde57eecf71a7bcd57186661b90313f /debian/patches/gssapi.patch
parentd399ecd8eb7d4aed3b7ba0d2727e619607fb901b (diff)
parentee8d8b97cc2c6081df3af453a228992b87309ec4 (diff)
Merge 6.5p1.
* New upstream release (http://www.openssh.com/txt/release-6.5, LP: #1275068): - ssh(1): Add support for client-side hostname canonicalisation using a set of DNS suffixes and rules in ssh_config(5). This allows unqualified names to be canonicalised to fully-qualified domain names to eliminate ambiguity when looking up keys in known_hosts or checking host certificate names (closes: #115286).
Diffstat (limited to 'debian/patches/gssapi.patch')
-rw-r--r--debian/patches/gssapi.patch220
1 files changed, 110 insertions, 110 deletions
diff --git a/debian/patches/gssapi.patch b/debian/patches/gssapi.patch
index 8a919382e..3f6fccfff 100644
--- a/debian/patches/gssapi.patch
+++ b/debian/patches/gssapi.patch
@@ -1,4 +1,4 @@
1From 950be7e1b1a01ee9b25e2a72726a6370b8acacb6 Mon Sep 17 00:00:00 2001 1From cd404114ded78fc51d5d9cbd458d55c9b2f67daa Mon Sep 17 00:00:00 2001
2From: Simon Wilkinson <simon@sxw.org.uk> 2From: Simon Wilkinson <simon@sxw.org.uk>
3Date: Sun, 9 Feb 2014 16:09:48 +0000 3Date: Sun, 9 Feb 2014 16:09:48 +0000
4Subject: GSSAPI key exchange support 4Subject: GSSAPI key exchange support
@@ -17,7 +17,7 @@ have it merged into the main openssh package rather than having separate
17security history. 17security history.
18 18
19Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1242 19Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1242
20Last-Updated: 2013-11-09 20Last-Updated: 2014-02-10
21 21
22Patch-Name: gssapi.patch 22Patch-Name: gssapi.patch
23--- 23---
@@ -179,7 +179,7 @@ index 0000000..f117a33
179+ (from jbasney AT ncsa.uiuc.edu) 179+ (from jbasney AT ncsa.uiuc.edu)
180+ <gssapi-with-mic support is Bugzilla #1008> 180+ <gssapi-with-mic support is Bugzilla #1008>
181diff --git a/Makefile.in b/Makefile.in 181diff --git a/Makefile.in b/Makefile.in
182index 92c95a9..f979926 100644 182index a8aa127..35c6fd6 100644
183--- a/Makefile.in 183--- a/Makefile.in
184+++ b/Makefile.in 184+++ b/Makefile.in
185@@ -72,6 +72,7 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o bufbn.o buffer.o \ 185@@ -72,6 +72,7 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o bufbn.o buffer.o \
@@ -188,22 +188,22 @@ index 92c95a9..f979926 100644
188 kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ 188 kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \
189+ kexgssc.o \ 189+ kexgssc.o \
190 msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ 190 msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \
191 jpake.o schnorr.o ssh-pkcs11.o krl.o 191 jpake.o schnorr.o ssh-pkcs11.o krl.o smult_curve25519_ref.o \
192 192 kexc25519.o kexc25519c.o poly1305.o chacha.o cipher-chachapoly.o \
193@@ -88,7 +89,7 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ 193@@ -91,7 +92,7 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \
194 auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ 194 auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \
195 monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o kexecdhs.o \ 195 monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o kexecdhs.o \
196 auth-krb5.o \ 196 kexc25519s.o auth-krb5.o \
197- auth2-gss.o gss-serv.o gss-serv-krb5.o \ 197- auth2-gss.o gss-serv.o gss-serv-krb5.o \
198+ auth2-gss.o gss-serv.o gss-serv-krb5.o kexgsss.o\ 198+ auth2-gss.o gss-serv.o gss-serv-krb5.o kexgsss.o \
199 loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ 199 loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \
200 sftp-server.o sftp-common.o \ 200 sftp-server.o sftp-common.o \
201 roaming_common.o roaming_serv.o \ 201 roaming_common.o roaming_serv.o \
202diff --git a/auth-krb5.c b/auth-krb5.c 202diff --git a/auth-krb5.c b/auth-krb5.c
203index 7c83f59..5613b57 100644 203index 6c62bdf..69a1a53 100644
204--- a/auth-krb5.c 204--- a/auth-krb5.c
205+++ b/auth-krb5.c 205+++ b/auth-krb5.c
206@@ -181,8 +181,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password) 206@@ -182,8 +182,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
207 207
208 len = strlen(authctxt->krb5_ticket_file) + 6; 208 len = strlen(authctxt->krb5_ticket_file) + 6;
209 authctxt->krb5_ccname = xmalloc(len); 209 authctxt->krb5_ccname = xmalloc(len);
@@ -217,7 +217,7 @@ index 7c83f59..5613b57 100644
217 217
218 #ifdef USE_PAM 218 #ifdef USE_PAM
219 if (options.use_pam) 219 if (options.use_pam)
220@@ -239,15 +244,22 @@ krb5_cleanup_proc(Authctxt *authctxt) 220@@ -240,15 +245,22 @@ krb5_cleanup_proc(Authctxt *authctxt)
221 #ifndef HEIMDAL 221 #ifndef HEIMDAL
222 krb5_error_code 222 krb5_error_code
223 ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { 223 ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
@@ -242,7 +242,7 @@ index 7c83f59..5613b57 100644
242 old_umask = umask(0177); 242 old_umask = umask(0177);
243 tmpfd = mkstemp(ccname + strlen("FILE:")); 243 tmpfd = mkstemp(ccname + strlen("FILE:"));
244 oerrno = errno; 244 oerrno = errno;
245@@ -264,6 +276,7 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { 245@@ -265,6 +277,7 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
246 return oerrno; 246 return oerrno;
247 } 247 }
248 close(tmpfd); 248 close(tmpfd);
@@ -358,7 +358,7 @@ index f0cab8c..6ed8f04 100644
358 #endif 358 #endif
359 #ifdef JPAKE 359 #ifdef JPAKE
360diff --git a/clientloop.c b/clientloop.c 360diff --git a/clientloop.c b/clientloop.c
361index 23c2f23..311dc13 100644 361index f30c8b6..6d02b0b 100644
362--- a/clientloop.c 362--- a/clientloop.c
363+++ b/clientloop.c 363+++ b/clientloop.c
364@@ -111,6 +111,10 @@ 364@@ -111,6 +111,10 @@
@@ -389,10 +389,10 @@ index 23c2f23..311dc13 100644
389 debug("need rekeying"); 389 debug("need rekeying");
390 xxx_kex->done = 0; 390 xxx_kex->done = 0;
391diff --git a/config.h.in b/config.h.in 391diff --git a/config.h.in b/config.h.in
392index b75e501..34f1c9c 100644 392index 075c619..906e549 100644
393--- a/config.h.in 393--- a/config.h.in
394+++ b/config.h.in 394+++ b/config.h.in
395@@ -1546,6 +1546,9 @@ 395@@ -1616,6 +1616,9 @@
396 /* Use btmp to log bad logins */ 396 /* Use btmp to log bad logins */
397 #undef USE_BTMP 397 #undef USE_BTMP
398 398
@@ -402,7 +402,7 @@ index b75e501..34f1c9c 100644
402 /* Use libedit for sftp */ 402 /* Use libedit for sftp */
403 #undef USE_LIBEDIT 403 #undef USE_LIBEDIT
404 404
405@@ -1561,6 +1564,9 @@ 405@@ -1631,6 +1634,9 @@
406 /* Use PIPES instead of a socketpair() */ 406 /* Use PIPES instead of a socketpair() */
407 #undef USE_PIPES 407 #undef USE_PIPES
408 408
@@ -413,10 +413,10 @@ index b75e501..34f1c9c 100644
413 #undef USE_SOLARIS_PROCESS_CONTRACTS 413 #undef USE_SOLARIS_PROCESS_CONTRACTS
414 414
415diff --git a/configure b/configure 415diff --git a/configure b/configure
416index 0d6fad5..ceb1b5d 100755 416index 2d714ac..5a9db2d 100755
417--- a/configure 417--- a/configure
418+++ b/configure 418+++ b/configure
419@@ -6780,6 +6780,63 @@ $as_echo "#define SSH_TUN_COMPAT_AF 1" >>confdefs.h 419@@ -7170,6 +7170,63 @@ $as_echo "#define SSH_TUN_COMPAT_AF 1" >>confdefs.h
420 420
421 $as_echo "#define SSH_TUN_PREPEND_AF 1" >>confdefs.h 421 $as_echo "#define SSH_TUN_PREPEND_AF 1" >>confdefs.h
422 422
@@ -481,10 +481,10 @@ index 0d6fad5..ceb1b5d 100755
481 ac_fn_c_check_decl "$LINENO" "AU_IPv4" "ac_cv_have_decl_AU_IPv4" "$ac_includes_default" 481 ac_fn_c_check_decl "$LINENO" "AU_IPv4" "ac_cv_have_decl_AU_IPv4" "$ac_includes_default"
482 if test "x$ac_cv_have_decl_AU_IPv4" = xyes; then : 482 if test "x$ac_cv_have_decl_AU_IPv4" = xyes; then :
483diff --git a/configure.ac b/configure.ac 483diff --git a/configure.ac b/configure.ac
484index 4a1b503..4c1a658 100644 484index dfd32cd..90eebf5 100644
485--- a/configure.ac 485--- a/configure.ac
486+++ b/configure.ac 486+++ b/configure.ac
487@@ -548,6 +548,30 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) 487@@ -584,6 +584,30 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
488 [Use tunnel device compatibility to OpenBSD]) 488 [Use tunnel device compatibility to OpenBSD])
489 AC_DEFINE([SSH_TUN_PREPEND_AF], [1], 489 AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
490 [Prepend the address family to IP tunnel traffic]) 490 [Prepend the address family to IP tunnel traffic])
@@ -867,7 +867,7 @@ index b39281b..b7d1b7d 100644
867+ 867+
868 #endif /* GSSAPI */ 868 #endif /* GSSAPI */
869diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c 869diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c
870index 87f2683..c55446a 100644 870index 759fa10..959a77e 100644
871--- a/gss-serv-krb5.c 871--- a/gss-serv-krb5.c
872+++ b/gss-serv-krb5.c 872+++ b/gss-serv-krb5.c
873@@ -1,7 +1,7 @@ 873@@ -1,7 +1,7 @@
@@ -887,7 +887,7 @@ index 87f2683..c55446a 100644
887 887
888 if (client->creds == NULL) { 888 if (client->creds == NULL) {
889 debug("No credentials stored"); 889 debug("No credentials stored");
890@@ -174,11 +175,16 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client) 890@@ -180,11 +181,16 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client)
891 return; 891 return;
892 } 892 }
893 893
@@ -908,7 +908,7 @@ index 87f2683..c55446a 100644
908 908
909 #ifdef USE_PAM 909 #ifdef USE_PAM
910 if (options.use_pam) 910 if (options.use_pam)
911@@ -190,6 +196,71 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client) 911@@ -196,6 +202,71 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client)
912 return; 912 return;
913 } 913 }
914 914
@@ -980,7 +980,7 @@ index 87f2683..c55446a 100644
980 ssh_gssapi_mech gssapi_kerberos_mech = { 980 ssh_gssapi_mech gssapi_kerberos_mech = {
981 "toWM5Slw5Ew8Mqkay+al2g==", 981 "toWM5Slw5Ew8Mqkay+al2g==",
982 "Kerberos", 982 "Kerberos",
983@@ -197,7 +268,8 @@ ssh_gssapi_mech gssapi_kerberos_mech = { 983@@ -203,7 +274,8 @@ ssh_gssapi_mech gssapi_kerberos_mech = {
984 NULL, 984 NULL,
985 &ssh_gssapi_krb5_userok, 985 &ssh_gssapi_krb5_userok,
986 NULL, 986 NULL,
@@ -1309,12 +1309,12 @@ index 95348e2..97f366f 100644
1309 1309
1310 #endif 1310 #endif
1311diff --git a/kex.c b/kex.c 1311diff --git a/kex.c b/kex.c
1312index 54bd1a4..1ec2782 100644 1312index 616484b..49d0fc8 100644
1313--- a/kex.c 1313--- a/kex.c
1314+++ b/kex.c 1314+++ b/kex.c
1315@@ -50,6 +50,10 @@ 1315@@ -51,6 +51,10 @@
1316 #include "monitor.h"
1317 #include "roaming.h" 1316 #include "roaming.h"
1317 #include "digest.h"
1318 1318
1319+#ifdef GSSAPI 1319+#ifdef GSSAPI
1320+#include "ssh-gss.h" 1320+#include "ssh-gss.h"
@@ -1323,22 +1323,22 @@ index 54bd1a4..1ec2782 100644
1323 #if OPENSSL_VERSION_NUMBER >= 0x00907000L 1323 #if OPENSSL_VERSION_NUMBER >= 0x00907000L
1324 # if defined(HAVE_EVP_SHA256) 1324 # if defined(HAVE_EVP_SHA256)
1325 # define evp_ssh_sha256 EVP_sha256 1325 # define evp_ssh_sha256 EVP_sha256
1326@@ -82,6 +86,14 @@ static const struct kexalg kexalgs[] = { 1326@@ -92,6 +96,14 @@ static const struct kexalg kexalgs[] = {
1327 #endif 1327 #endif
1328 { NULL, -1, -1, NULL}, 1328 { NULL, -1, -1, -1},
1329 }; 1329 };
1330+static const struct kexalg kexalg_prefixes[] = { 1330+static const struct kexalg kexalg_prefixes[] = {
1331+#ifdef GSSAPI 1331+#ifdef GSSAPI
1332+ { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, EVP_sha1 }, 1332+ { KEX_GSS_GEX_SHA1_ID, KEX_GSS_GEX_SHA1, 0, SSH_DIGEST_SHA1 },
1333+ { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, EVP_sha1 }, 1333+ { KEX_GSS_GRP1_SHA1_ID, KEX_GSS_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },
1334+ { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, EVP_sha1 }, 1334+ { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, SSH_DIGEST_SHA1 },
1335+#endif 1335+#endif
1336+ { NULL, -1, -1, NULL }, 1336+ { NULL, -1, -1, -1 },
1337+}; 1337+};
1338 1338
1339 char * 1339 char *
1340 kex_alg_list(void) 1340 kex_alg_list(char sep)
1341@@ -110,6 +122,10 @@ kex_alg_by_name(const char *name) 1341@@ -120,6 +132,10 @@ kex_alg_by_name(const char *name)
1342 if (strcmp(k->name, name) == 0) 1342 if (strcmp(k->name, name) == 0)
1343 return k; 1343 return k;
1344 } 1344 }
@@ -1350,22 +1350,22 @@ index 54bd1a4..1ec2782 100644
1350 } 1350 }
1351 1351
1352diff --git a/kex.h b/kex.h 1352diff --git a/kex.h b/kex.h
1353index 9f1e1ad..d5046c6 100644 1353index 1aa3ec2..8fbcb2b 100644
1354--- a/kex.h 1354--- a/kex.h
1355+++ b/kex.h 1355+++ b/kex.h
1356@@ -74,6 +74,9 @@ enum kex_exchange { 1356@@ -76,6 +76,9 @@ enum kex_exchange {
1357 KEX_DH_GEX_SHA1,
1358 KEX_DH_GEX_SHA256, 1357 KEX_DH_GEX_SHA256,
1359 KEX_ECDH_SHA2, 1358 KEX_ECDH_SHA2,
1359 KEX_C25519_SHA256,
1360+ KEX_GSS_GRP1_SHA1, 1360+ KEX_GSS_GRP1_SHA1,
1361+ KEX_GSS_GRP14_SHA1, 1361+ KEX_GSS_GRP14_SHA1,
1362+ KEX_GSS_GEX_SHA1, 1362+ KEX_GSS_GEX_SHA1,
1363 KEX_MAX 1363 KEX_MAX
1364 }; 1364 };
1365 1365
1366@@ -133,6 +136,12 @@ struct Kex { 1366@@ -136,6 +139,12 @@ struct Kex {
1367 int flags; 1367 int flags;
1368 const EVP_MD *evp_md; 1368 int hash_alg;
1369 int ec_nid; 1369 int ec_nid;
1370+#ifdef GSSAPI 1370+#ifdef GSSAPI
1371+ int gss_deleg_creds; 1371+ int gss_deleg_creds;
@@ -1376,9 +1376,9 @@ index 9f1e1ad..d5046c6 100644
1376 char *client_version_string; 1376 char *client_version_string;
1377 char *server_version_string; 1377 char *server_version_string;
1378 int (*verify_host_key)(Key *); 1378 int (*verify_host_key)(Key *);
1379@@ -162,6 +171,11 @@ void kexgex_server(Kex *); 1379@@ -168,6 +177,11 @@ void kexecdh_server(Kex *);
1380 void kexecdh_client(Kex *); 1380 void kexc25519_client(Kex *);
1381 void kexecdh_server(Kex *); 1381 void kexc25519_server(Kex *);
1382 1382
1383+#ifdef GSSAPI 1383+#ifdef GSSAPI
1384+void kexgss_client(Kex *); 1384+void kexgss_client(Kex *);
@@ -1390,7 +1390,7 @@ index 9f1e1ad..d5046c6 100644
1390 BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *); 1390 BIGNUM *, BIGNUM *, BIGNUM *, u_char **, u_int *);
1391diff --git a/kexgssc.c b/kexgssc.c 1391diff --git a/kexgssc.c b/kexgssc.c
1392new file mode 100644 1392new file mode 100644
1393index 0000000..616893c 1393index 0000000..14f5598
1394--- /dev/null 1394--- /dev/null
1395+++ b/kexgssc.c 1395+++ b/kexgssc.c
1396@@ -0,0 +1,333 @@ 1396@@ -0,0 +1,333 @@
@@ -1675,7 +1675,7 @@ index 0000000..616893c
1675+ break; 1675+ break;
1676+ case KEX_GSS_GEX_SHA1: 1676+ case KEX_GSS_GEX_SHA1:
1677+ kexgex_hash( 1677+ kexgex_hash(
1678+ kex->evp_md, 1678+ kex->hash_alg,
1679+ kex->client_version_string, 1679+ kex->client_version_string,
1680+ kex->server_version_string, 1680+ kex->server_version_string,
1681+ buffer_ptr(&kex->my), buffer_len(&kex->my), 1681+ buffer_ptr(&kex->my), buffer_len(&kex->my),
@@ -1721,7 +1721,7 @@ index 0000000..616893c
1721+ else 1721+ else
1722+ ssh_gssapi_delete_ctx(&ctxt); 1722+ ssh_gssapi_delete_ctx(&ctxt);
1723+ 1723+
1724+ kex_derive_keys(kex, hash, hashlen, shared_secret); 1724+ kex_derive_keys_bn(kex, hash, hashlen, shared_secret);
1725+ BN_clear_free(shared_secret); 1725+ BN_clear_free(shared_secret);
1726+ kex_finish(kex); 1726+ kex_finish(kex);
1727+} 1727+}
@@ -1729,7 +1729,7 @@ index 0000000..616893c
1729+#endif /* GSSAPI */ 1729+#endif /* GSSAPI */
1730diff --git a/kexgsss.c b/kexgsss.c 1730diff --git a/kexgsss.c b/kexgsss.c
1731new file mode 100644 1731new file mode 100644
1732index 0000000..18b065b 1732index 0000000..8095259
1733--- /dev/null 1733--- /dev/null
1734+++ b/kexgsss.c 1734+++ b/kexgsss.c
1735@@ -0,0 +1,289 @@ 1735@@ -0,0 +1,289 @@
@@ -1959,7 +1959,7 @@ index 0000000..18b065b
1959+ break; 1959+ break;
1960+ case KEX_GSS_GEX_SHA1: 1960+ case KEX_GSS_GEX_SHA1:
1961+ kexgex_hash( 1961+ kexgex_hash(
1962+ kex->evp_md, 1962+ kex->hash_alg,
1963+ kex->client_version_string, kex->server_version_string, 1963+ kex->client_version_string, kex->server_version_string,
1964+ buffer_ptr(&kex->peer), buffer_len(&kex->peer), 1964+ buffer_ptr(&kex->peer), buffer_len(&kex->peer),
1965+ buffer_ptr(&kex->my), buffer_len(&kex->my), 1965+ buffer_ptr(&kex->my), buffer_len(&kex->my),
@@ -2012,7 +2012,7 @@ index 0000000..18b065b
2012+ 2012+
2013+ DH_free(dh); 2013+ DH_free(dh);
2014+ 2014+
2015+ kex_derive_keys(kex, hash, hashlen, shared_secret); 2015+ kex_derive_keys_bn(kex, hash, hashlen, shared_secret);
2016+ BN_clear_free(shared_secret); 2016+ BN_clear_free(shared_secret);
2017+ kex_finish(kex); 2017+ kex_finish(kex);
2018+ 2018+
@@ -2023,23 +2023,23 @@ index 0000000..18b065b
2023+} 2023+}
2024+#endif /* GSSAPI */ 2024+#endif /* GSSAPI */
2025diff --git a/key.c b/key.c 2025diff --git a/key.c b/key.c
2026index 55ee789..2591635 100644 2026index 9142338..3867eb3 100644
2027--- a/key.c 2027--- a/key.c
2028+++ b/key.c 2028+++ b/key.c
2029@@ -933,6 +933,7 @@ static const struct keytype keytypes[] = { 2029@@ -985,6 +985,7 @@ static const struct keytype keytypes[] = {
2030 KEY_RSA_CERT_V00, 0, 1 },
2031 { "ssh-dss-cert-v00@openssh.com", "DSA-CERT-V00",
2032 KEY_DSA_CERT_V00, 0, 1 }, 2030 KEY_DSA_CERT_V00, 0, 1 },
2031 { "ssh-ed25519-cert-v01@openssh.com", "ED25519-CERT",
2032 KEY_ED25519_CERT, 0, 1 },
2033+ { "null", "null", KEY_NULL, 0, 0 }, 2033+ { "null", "null", KEY_NULL, 0, 0 },
2034 { NULL, NULL, -1, -1, 0 } 2034 { NULL, NULL, -1, -1, 0 }
2035 }; 2035 };
2036 2036
2037diff --git a/key.h b/key.h 2037diff --git a/key.h b/key.h
2038index 17358ae..b57d6a4 100644 2038index d8ad13d..c8aeba2 100644
2039--- a/key.h 2039--- a/key.h
2040+++ b/key.h 2040+++ b/key.h
2041@@ -44,6 +44,7 @@ enum types { 2041@@ -46,6 +46,7 @@ enum types {
2042 KEY_ECDSA_CERT, 2042 KEY_ED25519_CERT,
2043 KEY_RSA_CERT_V00, 2043 KEY_RSA_CERT_V00,
2044 KEY_DSA_CERT_V00, 2044 KEY_DSA_CERT_V00,
2045+ KEY_NULL, 2045+ KEY_NULL,
@@ -2047,7 +2047,7 @@ index 17358ae..b57d6a4 100644
2047 }; 2047 };
2048 enum fp_type { 2048 enum fp_type {
2049diff --git a/monitor.c b/monitor.c 2049diff --git a/monitor.c b/monitor.c
2050index 44dff98..9079c97 100644 2050index 03baf1e..a777c4c 100644
2051--- a/monitor.c 2051--- a/monitor.c
2052+++ b/monitor.c 2052+++ b/monitor.c
2053@@ -181,6 +181,8 @@ int mm_answer_gss_setup_ctx(int, Buffer *); 2053@@ -181,6 +181,8 @@ int mm_answer_gss_setup_ctx(int, Buffer *);
@@ -2102,10 +2102,10 @@ index 44dff98..9079c97 100644
2102 } else { 2102 } else {
2103 mon_dispatch = mon_dispatch_postauth15; 2103 mon_dispatch = mon_dispatch_postauth15;
2104 monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); 2104 monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1);
2105@@ -1855,6 +1872,13 @@ mm_get_kex(Buffer *m) 2105@@ -1856,6 +1873,13 @@ mm_get_kex(Buffer *m)
2106 kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
2107 kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; 2106 kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
2108 kex->kex[KEX_ECDH_SHA2] = kexecdh_server; 2107 kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
2108 kex->kex[KEX_C25519_SHA256] = kexc25519_server;
2109+#ifdef GSSAPI 2109+#ifdef GSSAPI
2110+ if (options.gss_keyex) { 2110+ if (options.gss_keyex) {
2111+ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server; 2111+ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server;
@@ -2116,7 +2116,7 @@ index 44dff98..9079c97 100644
2116 kex->server = 1; 2116 kex->server = 1;
2117 kex->hostkey_type = buffer_get_int(m); 2117 kex->hostkey_type = buffer_get_int(m);
2118 kex->kex_type = buffer_get_int(m); 2118 kex->kex_type = buffer_get_int(m);
2119@@ -2062,6 +2086,9 @@ mm_answer_gss_setup_ctx(int sock, Buffer *m) 2119@@ -2063,6 +2087,9 @@ mm_answer_gss_setup_ctx(int sock, Buffer *m)
2120 OM_uint32 major; 2120 OM_uint32 major;
2121 u_int len; 2121 u_int len;
2122 2122
@@ -2126,7 +2126,7 @@ index 44dff98..9079c97 100644
2126 goid.elements = buffer_get_string(m, &len); 2126 goid.elements = buffer_get_string(m, &len);
2127 goid.length = len; 2127 goid.length = len;
2128 2128
2129@@ -2089,6 +2116,9 @@ mm_answer_gss_accept_ctx(int sock, Buffer *m) 2129@@ -2090,6 +2117,9 @@ mm_answer_gss_accept_ctx(int sock, Buffer *m)
2130 OM_uint32 flags = 0; /* GSI needs this */ 2130 OM_uint32 flags = 0; /* GSI needs this */
2131 u_int len; 2131 u_int len;
2132 2132
@@ -2136,7 +2136,7 @@ index 44dff98..9079c97 100644
2136 in.value = buffer_get_string(m, &len); 2136 in.value = buffer_get_string(m, &len);
2137 in.length = len; 2137 in.length = len;
2138 major = ssh_gssapi_accept_ctx(gsscontext, &in, &out, &flags); 2138 major = ssh_gssapi_accept_ctx(gsscontext, &in, &out, &flags);
2139@@ -2106,6 +2136,7 @@ mm_answer_gss_accept_ctx(int sock, Buffer *m) 2139@@ -2107,6 +2137,7 @@ mm_answer_gss_accept_ctx(int sock, Buffer *m)
2140 monitor_permit(mon_dispatch, MONITOR_REQ_GSSSTEP, 0); 2140 monitor_permit(mon_dispatch, MONITOR_REQ_GSSSTEP, 0);
2141 monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1); 2141 monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1);
2142 monitor_permit(mon_dispatch, MONITOR_REQ_GSSCHECKMIC, 1); 2142 monitor_permit(mon_dispatch, MONITOR_REQ_GSSCHECKMIC, 1);
@@ -2144,7 +2144,7 @@ index 44dff98..9079c97 100644
2144 } 2144 }
2145 return (0); 2145 return (0);
2146 } 2146 }
2147@@ -2117,6 +2148,9 @@ mm_answer_gss_checkmic(int sock, Buffer *m) 2147@@ -2118,6 +2149,9 @@ mm_answer_gss_checkmic(int sock, Buffer *m)
2148 OM_uint32 ret; 2148 OM_uint32 ret;
2149 u_int len; 2149 u_int len;
2150 2150
@@ -2154,7 +2154,7 @@ index 44dff98..9079c97 100644
2154 gssbuf.value = buffer_get_string(m, &len); 2154 gssbuf.value = buffer_get_string(m, &len);
2155 gssbuf.length = len; 2155 gssbuf.length = len;
2156 mic.value = buffer_get_string(m, &len); 2156 mic.value = buffer_get_string(m, &len);
2157@@ -2143,7 +2177,11 @@ mm_answer_gss_userok(int sock, Buffer *m) 2157@@ -2144,7 +2178,11 @@ mm_answer_gss_userok(int sock, Buffer *m)
2158 { 2158 {
2159 int authenticated; 2159 int authenticated;
2160 2160
@@ -2167,7 +2167,7 @@ index 44dff98..9079c97 100644
2167 2167
2168 buffer_clear(m); 2168 buffer_clear(m);
2169 buffer_put_int(m, authenticated); 2169 buffer_put_int(m, authenticated);
2170@@ -2156,6 +2194,74 @@ mm_answer_gss_userok(int sock, Buffer *m) 2170@@ -2157,6 +2195,74 @@ mm_answer_gss_userok(int sock, Buffer *m)
2171 /* Monitor loop will terminate if authenticated */ 2171 /* Monitor loop will terminate if authenticated */
2172 return (authenticated); 2172 return (authenticated);
2173 } 2173 }
@@ -2338,10 +2338,10 @@ index 0c7f2e3..ec9b9b1 100644
2338 2338
2339 #ifdef USE_PAM 2339 #ifdef USE_PAM
2340diff --git a/readconf.c b/readconf.c 2340diff --git a/readconf.c b/readconf.c
2341index 1464430..2695fd6 100644 2341index 9c7e73d..cb8bcb2 100644
2342--- a/readconf.c 2342--- a/readconf.c
2343+++ b/readconf.c 2343+++ b/readconf.c
2344@@ -132,6 +132,8 @@ typedef enum { 2344@@ -140,6 +140,8 @@ typedef enum {
2345 oClearAllForwardings, oNoHostAuthenticationForLocalhost, 2345 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
2346 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, 2346 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
2347 oAddressFamily, oGssAuthentication, oGssDelegateCreds, 2347 oAddressFamily, oGssAuthentication, oGssDelegateCreds,
@@ -2350,7 +2350,7 @@ index 1464430..2695fd6 100644
2350 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, 2350 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
2351 oSendEnv, oControlPath, oControlMaster, oControlPersist, 2351 oSendEnv, oControlPath, oControlMaster, oControlPersist,
2352 oHashKnownHosts, 2352 oHashKnownHosts,
2353@@ -172,10 +174,19 @@ static struct { 2353@@ -182,10 +184,19 @@ static struct {
2354 { "afstokenpassing", oUnsupported }, 2354 { "afstokenpassing", oUnsupported },
2355 #if defined(GSSAPI) 2355 #if defined(GSSAPI)
2356 { "gssapiauthentication", oGssAuthentication }, 2356 { "gssapiauthentication", oGssAuthentication },
@@ -2370,7 +2370,7 @@ index 1464430..2695fd6 100644
2370 #endif 2370 #endif
2371 { "fallbacktorsh", oDeprecated }, 2371 { "fallbacktorsh", oDeprecated },
2372 { "usersh", oDeprecated }, 2372 { "usersh", oDeprecated },
2373@@ -516,10 +527,30 @@ parse_flag: 2373@@ -839,10 +850,30 @@ parse_time:
2374 intptr = &options->gss_authentication; 2374 intptr = &options->gss_authentication;
2375 goto parse_flag; 2375 goto parse_flag;
2376 2376
@@ -2401,7 +2401,7 @@ index 1464430..2695fd6 100644
2401 case oBatchMode: 2401 case oBatchMode:
2402 intptr = &options->batch_mode; 2402 intptr = &options->batch_mode;
2403 goto parse_flag; 2403 goto parse_flag;
2404@@ -1168,7 +1199,12 @@ initialize_options(Options * options) 2404@@ -1488,7 +1519,12 @@ initialize_options(Options * options)
2405 options->pubkey_authentication = -1; 2405 options->pubkey_authentication = -1;
2406 options->challenge_response_authentication = -1; 2406 options->challenge_response_authentication = -1;
2407 options->gss_authentication = -1; 2407 options->gss_authentication = -1;
@@ -2414,7 +2414,7 @@ index 1464430..2695fd6 100644
2414 options->password_authentication = -1; 2414 options->password_authentication = -1;
2415 options->kbd_interactive_authentication = -1; 2415 options->kbd_interactive_authentication = -1;
2416 options->kbd_interactive_devices = NULL; 2416 options->kbd_interactive_devices = NULL;
2417@@ -1268,8 +1304,14 @@ fill_default_options(Options * options) 2417@@ -1594,8 +1630,14 @@ fill_default_options(Options * options)
2418 options->challenge_response_authentication = 1; 2418 options->challenge_response_authentication = 1;
2419 if (options->gss_authentication == -1) 2419 if (options->gss_authentication == -1)
2420 options->gss_authentication = 0; 2420 options->gss_authentication = 0;
@@ -2430,10 +2430,10 @@ index 1464430..2695fd6 100644
2430 options->password_authentication = 1; 2430 options->password_authentication = 1;
2431 if (options->kbd_interactive_authentication == -1) 2431 if (options->kbd_interactive_authentication == -1)
2432diff --git a/readconf.h b/readconf.h 2432diff --git a/readconf.h b/readconf.h
2433index 23fc500..675b35d 100644 2433index 2d7ea9f..826c676 100644
2434--- a/readconf.h 2434--- a/readconf.h
2435+++ b/readconf.h 2435+++ b/readconf.h
2436@@ -48,7 +48,12 @@ typedef struct { 2436@@ -54,7 +54,12 @@ typedef struct {
2437 int challenge_response_authentication; 2437 int challenge_response_authentication;
2438 /* Try S/Key or TIS, authentication. */ 2438 /* Try S/Key or TIS, authentication. */
2439 int gss_authentication; /* Try GSS authentication */ 2439 int gss_authentication; /* Try GSS authentication */
@@ -2447,10 +2447,10 @@ index 23fc500..675b35d 100644
2447 * authentication. */ 2447 * authentication. */
2448 int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ 2448 int kbd_interactive_authentication; /* Try keyboard-interactive auth. */
2449diff --git a/servconf.c b/servconf.c 2449diff --git a/servconf.c b/servconf.c
2450index 747edde..c938ae3 100644 2450index 9bcd05b..29209e4 100644
2451--- a/servconf.c 2451--- a/servconf.c
2452+++ b/servconf.c 2452+++ b/servconf.c
2453@@ -107,7 +107,10 @@ initialize_server_options(ServerOptions *options) 2453@@ -108,7 +108,10 @@ initialize_server_options(ServerOptions *options)
2454 options->kerberos_ticket_cleanup = -1; 2454 options->kerberos_ticket_cleanup = -1;
2455 options->kerberos_get_afs_token = -1; 2455 options->kerberos_get_afs_token = -1;
2456 options->gss_authentication=-1; 2456 options->gss_authentication=-1;
@@ -2461,7 +2461,7 @@ index 747edde..c938ae3 100644
2461 options->password_authentication = -1; 2461 options->password_authentication = -1;
2462 options->kbd_interactive_authentication = -1; 2462 options->kbd_interactive_authentication = -1;
2463 options->challenge_response_authentication = -1; 2463 options->challenge_response_authentication = -1;
2464@@ -240,8 +243,14 @@ fill_default_server_options(ServerOptions *options) 2464@@ -245,8 +248,14 @@ fill_default_server_options(ServerOptions *options)
2465 options->kerberos_get_afs_token = 0; 2465 options->kerberos_get_afs_token = 0;
2466 if (options->gss_authentication == -1) 2466 if (options->gss_authentication == -1)
2467 options->gss_authentication = 0; 2467 options->gss_authentication = 0;
@@ -2476,7 +2476,7 @@ index 747edde..c938ae3 100644
2476 if (options->password_authentication == -1) 2476 if (options->password_authentication == -1)
2477 options->password_authentication = 1; 2477 options->password_authentication = 1;
2478 if (options->kbd_interactive_authentication == -1) 2478 if (options->kbd_interactive_authentication == -1)
2479@@ -338,7 +347,9 @@ typedef enum { 2479@@ -343,7 +352,9 @@ typedef enum {
2480 sBanner, sUseDNS, sHostbasedAuthentication, 2480 sBanner, sUseDNS, sHostbasedAuthentication,
2481 sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, 2481 sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
2482 sClientAliveCountMax, sAuthorizedKeysFile, 2482 sClientAliveCountMax, sAuthorizedKeysFile,
@@ -2487,7 +2487,7 @@ index 747edde..c938ae3 100644
2487 sMatch, sPermitOpen, sForceCommand, sChrootDirectory, 2487 sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
2488 sUsePrivilegeSeparation, sAllowAgentForwarding, 2488 sUsePrivilegeSeparation, sAllowAgentForwarding,
2489 sZeroKnowledgePasswordAuthentication, sHostCertificate, 2489 sZeroKnowledgePasswordAuthentication, sHostCertificate,
2490@@ -405,10 +416,20 @@ static struct { 2490@@ -410,10 +421,20 @@ static struct {
2491 #ifdef GSSAPI 2491 #ifdef GSSAPI
2492 { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL }, 2492 { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL },
2493 { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL }, 2493 { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL },
@@ -2508,7 +2508,7 @@ index 747edde..c938ae3 100644
2508 { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL }, 2508 { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL },
2509 { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL }, 2509 { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL },
2510 { "challengeresponseauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, 2510 { "challengeresponseauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL },
2511@@ -1073,10 +1094,22 @@ process_server_config_line(ServerOptions *options, char *line, 2511@@ -1094,10 +1115,22 @@ process_server_config_line(ServerOptions *options, char *line,
2512 intptr = &options->gss_authentication; 2512 intptr = &options->gss_authentication;
2513 goto parse_flag; 2513 goto parse_flag;
2514 2514
@@ -2531,7 +2531,7 @@ index 747edde..c938ae3 100644
2531 case sPasswordAuthentication: 2531 case sPasswordAuthentication:
2532 intptr = &options->password_authentication; 2532 intptr = &options->password_authentication;
2533 goto parse_flag; 2533 goto parse_flag;
2534@@ -1983,7 +2016,10 @@ dump_config(ServerOptions *o) 2534@@ -2008,7 +2041,10 @@ dump_config(ServerOptions *o)
2535 #endif 2535 #endif
2536 #ifdef GSSAPI 2536 #ifdef GSSAPI
2537 dump_cfg_fmtint(sGssAuthentication, o->gss_authentication); 2537 dump_cfg_fmtint(sGssAuthentication, o->gss_authentication);
@@ -2543,10 +2543,10 @@ index 747edde..c938ae3 100644
2543 #ifdef JPAKE 2543 #ifdef JPAKE
2544 dump_cfg_fmtint(sZeroKnowledgePasswordAuthentication, 2544 dump_cfg_fmtint(sZeroKnowledgePasswordAuthentication,
2545diff --git a/servconf.h b/servconf.h 2545diff --git a/servconf.h b/servconf.h
2546index 98aad8b..ab6e346 100644 2546index 8812c5a..eba76ee 100644
2547--- a/servconf.h 2547--- a/servconf.h
2548+++ b/servconf.h 2548+++ b/servconf.h
2549@@ -111,7 +111,10 @@ typedef struct { 2549@@ -112,7 +112,10 @@ typedef struct {
2550 int kerberos_get_afs_token; /* If true, try to get AFS token if 2550 int kerberos_get_afs_token; /* If true, try to get AFS token if
2551 * authenticated with Kerberos. */ 2551 * authenticated with Kerberos. */
2552 int gss_authentication; /* If true, permit GSSAPI authentication */ 2552 int gss_authentication; /* If true, permit GSSAPI authentication */
@@ -2659,7 +2659,7 @@ index 077e13c..bc6e8f9 100644
2659 2659
2660 #endif /* _SSH_GSS_H */ 2660 #endif /* _SSH_GSS_H */
2661diff --git a/ssh_config b/ssh_config 2661diff --git a/ssh_config b/ssh_config
2662index bb40819..3234321 100644 2662index 03a228f..228e5ab 100644
2663--- a/ssh_config 2663--- a/ssh_config
2664+++ b/ssh_config 2664+++ b/ssh_config
2665@@ -26,6 +26,8 @@ 2665@@ -26,6 +26,8 @@
@@ -2672,10 +2672,10 @@ index bb40819..3234321 100644
2672 # CheckHostIP yes 2672 # CheckHostIP yes
2673 # AddressFamily any 2673 # AddressFamily any
2674diff --git a/ssh_config.5 b/ssh_config.5 2674diff --git a/ssh_config.5 b/ssh_config.5
2675index 5d76c6d..e72919a 100644 2675index 3cadcd7..49505ae 100644
2676--- a/ssh_config.5 2676--- a/ssh_config.5
2677+++ b/ssh_config.5 2677+++ b/ssh_config.5
2678@@ -529,11 +529,43 @@ Specifies whether user authentication based on GSSAPI is allowed. 2678@@ -676,11 +676,43 @@ Specifies whether user authentication based on GSSAPI is allowed.
2679 The default is 2679 The default is
2680 .Dq no . 2680 .Dq no .
2681 Note that this option applies to protocol version 2 only. 2681 Note that this option applies to protocol version 2 only.
@@ -2721,7 +2721,7 @@ index 5d76c6d..e72919a 100644
2721 Indicates that 2721 Indicates that
2722 .Xr ssh 1 2722 .Xr ssh 1
2723diff --git a/sshconnect2.c b/sshconnect2.c 2723diff --git a/sshconnect2.c b/sshconnect2.c
2724index 70e3cd8..0b13530 100644 2724index 8acffc5..21a269d 100644
2725--- a/sshconnect2.c 2725--- a/sshconnect2.c
2726+++ b/sshconnect2.c 2726+++ b/sshconnect2.c
2727@@ -160,9 +160,34 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) 2727@@ -160,9 +160,34 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
@@ -2759,7 +2759,7 @@ index 70e3cd8..0b13530 100644
2759 if (options.ciphers == (char *)-1) { 2759 if (options.ciphers == (char *)-1) {
2760 logit("No valid ciphers for protocol version 2 given, using defaults."); 2760 logit("No valid ciphers for protocol version 2 given, using defaults.");
2761 options.ciphers = NULL; 2761 options.ciphers = NULL;
2762@@ -197,6 +222,17 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) 2762@@ -198,6 +223,17 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
2763 if (options.kex_algorithms != NULL) 2763 if (options.kex_algorithms != NULL)
2764 myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; 2764 myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms;
2765 2765
@@ -2777,10 +2777,10 @@ index 70e3cd8..0b13530 100644
2777 if (options.rekey_limit || options.rekey_interval) 2777 if (options.rekey_limit || options.rekey_interval)
2778 packet_set_rekey_limits((u_int32_t)options.rekey_limit, 2778 packet_set_rekey_limits((u_int32_t)options.rekey_limit,
2779 (time_t)options.rekey_interval); 2779 (time_t)options.rekey_interval);
2780@@ -208,10 +244,30 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) 2780@@ -210,10 +246,30 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
2781 kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
2782 kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; 2781 kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
2783 kex->kex[KEX_ECDH_SHA2] = kexecdh_client; 2782 kex->kex[KEX_ECDH_SHA2] = kexecdh_client;
2783 kex->kex[KEX_C25519_SHA256] = kexc25519_client;
2784+#ifdef GSSAPI 2784+#ifdef GSSAPI
2785+ if (options.gss_keyex) { 2785+ if (options.gss_keyex) {
2786+ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client; 2786+ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client;
@@ -2808,7 +2808,7 @@ index 70e3cd8..0b13530 100644
2808 xxx_kex = kex; 2808 xxx_kex = kex;
2809 2809
2810 dispatch_run(DISPATCH_BLOCK, &kex->done, kex); 2810 dispatch_run(DISPATCH_BLOCK, &kex->done, kex);
2811@@ -307,6 +363,7 @@ void input_gssapi_token(int type, u_int32_t, void *); 2811@@ -309,6 +365,7 @@ void input_gssapi_token(int type, u_int32_t, void *);
2812 void input_gssapi_hash(int type, u_int32_t, void *); 2812 void input_gssapi_hash(int type, u_int32_t, void *);
2813 void input_gssapi_error(int, u_int32_t, void *); 2813 void input_gssapi_error(int, u_int32_t, void *);
2814 void input_gssapi_errtok(int, u_int32_t, void *); 2814 void input_gssapi_errtok(int, u_int32_t, void *);
@@ -2816,7 +2816,7 @@ index 70e3cd8..0b13530 100644
2816 #endif 2816 #endif
2817 2817
2818 void userauth(Authctxt *, char *); 2818 void userauth(Authctxt *, char *);
2819@@ -322,6 +379,11 @@ static char *authmethods_get(void); 2819@@ -324,6 +381,11 @@ static char *authmethods_get(void);
2820 2820
2821 Authmethod authmethods[] = { 2821 Authmethod authmethods[] = {
2822 #ifdef GSSAPI 2822 #ifdef GSSAPI
@@ -2828,7 +2828,7 @@ index 70e3cd8..0b13530 100644
2828 {"gssapi-with-mic", 2828 {"gssapi-with-mic",
2829 userauth_gssapi, 2829 userauth_gssapi,
2830 NULL, 2830 NULL,
2831@@ -625,19 +687,31 @@ userauth_gssapi(Authctxt *authctxt) 2831@@ -627,19 +689,31 @@ userauth_gssapi(Authctxt *authctxt)
2832 static u_int mech = 0; 2832 static u_int mech = 0;
2833 OM_uint32 min; 2833 OM_uint32 min;
2834 int ok = 0; 2834 int ok = 0;
@@ -2862,7 +2862,7 @@ index 70e3cd8..0b13530 100644
2862 ok = 1; /* Mechanism works */ 2862 ok = 1; /* Mechanism works */
2863 } else { 2863 } else {
2864 mech++; 2864 mech++;
2865@@ -734,8 +808,8 @@ input_gssapi_response(int type, u_int32_t plen, void *ctxt) 2865@@ -736,8 +810,8 @@ input_gssapi_response(int type, u_int32_t plen, void *ctxt)
2866 { 2866 {
2867 Authctxt *authctxt = ctxt; 2867 Authctxt *authctxt = ctxt;
2868 Gssctxt *gssctxt; 2868 Gssctxt *gssctxt;
@@ -2873,7 +2873,7 @@ index 70e3cd8..0b13530 100644
2873 2873
2874 if (authctxt == NULL) 2874 if (authctxt == NULL)
2875 fatal("input_gssapi_response: no authentication context"); 2875 fatal("input_gssapi_response: no authentication context");
2876@@ -844,6 +918,48 @@ input_gssapi_error(int type, u_int32_t plen, void *ctxt) 2876@@ -846,6 +920,48 @@ input_gssapi_error(int type, u_int32_t plen, void *ctxt)
2877 free(msg); 2877 free(msg);
2878 free(lang); 2878 free(lang);
2879 } 2879 }
@@ -2923,7 +2923,7 @@ index 70e3cd8..0b13530 100644
2923 2923
2924 int 2924 int
2925diff --git a/sshd.c b/sshd.c 2925diff --git a/sshd.c b/sshd.c
2926index 174cc7a..4eddeb8 100644 2926index 25380c9..fe65132 100644
2927--- a/sshd.c 2927--- a/sshd.c
2928+++ b/sshd.c 2928+++ b/sshd.c
2929@@ -122,6 +122,10 @@ 2929@@ -122,6 +122,10 @@
@@ -2937,7 +2937,7 @@ index 174cc7a..4eddeb8 100644
2937 #ifdef LIBWRAP 2937 #ifdef LIBWRAP
2938 #include <tcpd.h> 2938 #include <tcpd.h>
2939 #include <syslog.h> 2939 #include <syslog.h>
2940@@ -1703,10 +1707,13 @@ main(int ac, char **av) 2940@@ -1721,10 +1725,13 @@ main(int ac, char **av)
2941 logit("Disabling protocol version 1. Could not load host key"); 2941 logit("Disabling protocol version 1. Could not load host key");
2942 options.protocol &= ~SSH_PROTO_1; 2942 options.protocol &= ~SSH_PROTO_1;
2943 } 2943 }
@@ -2951,9 +2951,9 @@ index 174cc7a..4eddeb8 100644
2951 if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) { 2951 if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) {
2952 logit("sshd: no hostkeys available -- exiting."); 2952 logit("sshd: no hostkeys available -- exiting.");
2953 exit(1); 2953 exit(1);
2954@@ -2035,6 +2042,60 @@ main(int ac, char **av) 2954@@ -2051,6 +2058,60 @@ main(int ac, char **av)
2955 /* Log the connection. */ 2955 remote_ip, remote_port,
2956 verbose("Connection from %.500s port %d", remote_ip, remote_port); 2956 get_local_ipaddr(sock_in), get_local_port());
2957 2957
2958+#ifdef USE_SECURITY_SESSION_API 2958+#ifdef USE_SECURITY_SESSION_API
2959+ /* 2959+ /*
@@ -3012,9 +3012,9 @@ index 174cc7a..4eddeb8 100644
3012 /* 3012 /*
3013 * We don't want to listen forever unless the other side 3013 * We don't want to listen forever unless the other side
3014 * successfully authenticates itself. So we set up an alarm which is 3014 * successfully authenticates itself. So we set up an alarm which is
3015@@ -2439,6 +2500,48 @@ do_ssh2_kex(void) 3015@@ -2456,6 +2517,48 @@ do_ssh2_kex(void)
3016 3016 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = compat_pkalg_proposal(
3017 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = list_hostkey_types(); 3017 list_hostkey_types());
3018 3018
3019+#ifdef GSSAPI 3019+#ifdef GSSAPI
3020+ { 3020+ {
@@ -3061,10 +3061,10 @@ index 174cc7a..4eddeb8 100644
3061 /* start key exchange */ 3061 /* start key exchange */
3062 kex = kex_setup(myproposal); 3062 kex = kex_setup(myproposal);
3063 kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server; 3063 kex->kex[KEX_DH_GRP1_SHA1] = kexdh_server;
3064@@ -2446,6 +2549,13 @@ do_ssh2_kex(void) 3064@@ -2464,6 +2567,13 @@ do_ssh2_kex(void)
3065 kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
3066 kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; 3065 kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
3067 kex->kex[KEX_ECDH_SHA2] = kexecdh_server; 3066 kex->kex[KEX_ECDH_SHA2] = kexecdh_server;
3067 kex->kex[KEX_C25519_SHA256] = kexc25519_server;
3068+#ifdef GSSAPI 3068+#ifdef GSSAPI
3069+ if (options.gss_keyex) { 3069+ if (options.gss_keyex) {
3070+ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server; 3070+ kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_server;
@@ -3076,23 +3076,23 @@ index 174cc7a..4eddeb8 100644
3076 kex->client_version_string=client_version_string; 3076 kex->client_version_string=client_version_string;
3077 kex->server_version_string=server_version_string; 3077 kex->server_version_string=server_version_string;
3078diff --git a/sshd_config b/sshd_config 3078diff --git a/sshd_config b/sshd_config
3079index b786361..9450141 100644 3079index e9045bc..d9b8594 100644
3080--- a/sshd_config 3080--- a/sshd_config
3081+++ b/sshd_config 3081+++ b/sshd_config
3082@@ -83,6 +83,8 @@ AuthorizedKeysFile .ssh/authorized_keys 3082@@ -84,6 +84,8 @@ AuthorizedKeysFile .ssh/authorized_keys
3083 # GSSAPI options 3083 # GSSAPI options
3084 #GSSAPIAuthentication no 3084 #GSSAPIAuthentication no
3085 #GSSAPICleanupCredentials yes 3085 #GSSAPICleanupCredentials yes
3086+#GSSAPIStrictAcceptorCheck yes 3086+#GSSAPIStrictAcceptorCheck yes
3087+#GSSAPIKeyExchange no 3087+#GSSAPIKeyExchange no
3088 3088
3089 # Set this to 'yes' to enable PAM authentication, account processing, 3089 # Set this to 'yes' to enable PAM authentication, account processing,
3090 # and session processing. If this is enabled, PAM authentication will 3090 # and session processing. If this is enabled, PAM authentication will
3091diff --git a/sshd_config.5 b/sshd_config.5 3091diff --git a/sshd_config.5 b/sshd_config.5
3092index 3abac6c..525d9c8 100644 3092index 3b21ea6..9aa9eba 100644
3093--- a/sshd_config.5 3093--- a/sshd_config.5
3094+++ b/sshd_config.5 3094+++ b/sshd_config.5
3095@@ -484,12 +484,40 @@ Specifies whether user authentication based on GSSAPI is allowed. 3095@@ -493,12 +493,40 @@ Specifies whether user authentication based on GSSAPI is allowed.
3096 The default is 3096 The default is
3097 .Dq no . 3097 .Dq no .
3098 Note that this option applies to protocol version 2 only. 3098 Note that this option applies to protocol version 2 only.