summaryrefslogtreecommitdiff
path: root/debian/patches/gssapi.patch
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2016-01-04 15:07:07 +0000
committerColin Watson <cjwatson@debian.org>2016-01-04 15:08:38 +0000
commit9297bf097752cc017a899325704dfde9afb7817e (patch)
treed6b7aa0f2b270157ed58e8e3b6f1ba718e3e7033 /debian/patches/gssapi.patch
parent3782b4ad3e4eae51a99fd3cc4a6e401d117636a2 (diff)
parent31cc76b587fe2305eab8f7788c5dc6c876aff60e (diff)
Shuffle PROPOSAL_KEX_ALGS mangling for GSSAPI key exchange a little later in ssh_kex2 so that it's actually effective (closes: #809696).
Diffstat (limited to 'debian/patches/gssapi.patch')
-rw-r--r--debian/patches/gssapi.patch53
1 files changed, 23 insertions, 30 deletions
diff --git a/debian/patches/gssapi.patch b/debian/patches/gssapi.patch
index 2c8d04268..8c96afbb0 100644
--- a/debian/patches/gssapi.patch
+++ b/debian/patches/gssapi.patch
@@ -1,4 +1,4 @@
1From d6cfd64ea0a567d88152270a94be6bb2a78daeb9 Mon Sep 17 00:00:00 2001 1From 48424483cbf2232ba849038e02675b2db1ea3a88 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
@@ -48,13 +48,13 @@ Patch-Name: gssapi.patch
48 ssh-gss.h | 41 ++++++- 48 ssh-gss.h | 41 ++++++-
49 ssh_config | 2 + 49 ssh_config | 2 +
50 ssh_config.5 | 36 +++++- 50 ssh_config.5 | 36 +++++-
51 sshconnect2.c | 124 +++++++++++++++++++- 51 sshconnect2.c | 120 +++++++++++++++++++-
52 sshd.c | 110 ++++++++++++++++++ 52 sshd.c | 110 ++++++++++++++++++
53 sshd_config | 2 + 53 sshd_config | 2 +
54 sshd_config.5 | 11 ++ 54 sshd_config.5 | 11 ++
55 sshkey.c | 3 +- 55 sshkey.c | 3 +-
56 sshkey.h | 1 + 56 sshkey.h | 1 +
57 33 files changed, 1959 insertions(+), 47 deletions(-) 57 33 files changed, 1955 insertions(+), 47 deletions(-)
58 create mode 100644 ChangeLog.gssapi 58 create mode 100644 ChangeLog.gssapi
59 create mode 100644 kexgssc.c 59 create mode 100644 kexgssc.c
60 create mode 100644 kexgsss.c 60 create mode 100644 kexgsss.c
@@ -2606,10 +2606,10 @@ index a47f3ca..cac8cda 100644
2606 Indicates that 2606 Indicates that
2607 .Xr ssh 1 2607 .Xr ssh 1
2608diff --git a/sshconnect2.c b/sshconnect2.c 2608diff --git a/sshconnect2.c b/sshconnect2.c
2609index 7751031..e2ea826 100644 2609index 7751031..32e9b0d 100644
2610--- a/sshconnect2.c 2610--- a/sshconnect2.c
2611+++ b/sshconnect2.c 2611+++ b/sshconnect2.c
2612@@ -160,9 +160,34 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) 2612@@ -160,6 +160,11 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
2613 struct kex *kex; 2613 struct kex *kex;
2614 int r; 2614 int r;
2615 2615
@@ -2621,9 +2621,13 @@ index 7751031..e2ea826 100644
2621 xxx_host = host; 2621 xxx_host = host;
2622 xxx_hostaddr = hostaddr; 2622 xxx_hostaddr = hostaddr;
2623 2623
2624@@ -193,6 +198,33 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
2625 order_hostkeyalgs(host, hostaddr, port));
2626 }
2627
2624+#ifdef GSSAPI 2628+#ifdef GSSAPI
2625+ if (options.gss_keyex) { 2629+ if (options.gss_keyex) {
2626+ /* Add the GSSAPI mechanisms currently supported on this 2630+ /* Add the GSSAPI mechanisms currently supported on this
2627+ * client to the key exchange algorithm proposal */ 2631+ * client to the key exchange algorithm proposal */
2628+ orig = myproposal[PROPOSAL_KEX_ALGS]; 2632+ orig = myproposal[PROPOSAL_KEX_ALGS];
2629+ 2633+
@@ -2637,32 +2641,21 @@ index 7751031..e2ea826 100644
2637+ debug("Offering GSSAPI proposal: %s", gss); 2641+ debug("Offering GSSAPI proposal: %s", gss);
2638+ xasprintf(&myproposal[PROPOSAL_KEX_ALGS], 2642+ xasprintf(&myproposal[PROPOSAL_KEX_ALGS],
2639+ "%s,%s", gss, orig); 2643+ "%s,%s", gss, orig);
2640+ }
2641+ }
2642+#endif
2643+ 2644+
2644 myproposal[PROPOSAL_KEX_ALGS] = compat_kex_proposal( 2645+ /* If we've got GSSAPI algorithms, then we also
2645 options.kex_algorithms); 2646+ * support the 'null' hostkey, as a last resort */
2646 myproposal[PROPOSAL_ENC_ALGS_CTOS] = 2647+ orig = myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS];
2647@@ -193,6 +218,17 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) 2648+ xasprintf(&myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS],
2648 order_hostkeyalgs(host, hostaddr, port)); 2649+ "%s,null", orig);
2649 } 2650+ free(gss);
2650 2651+ }
2651+#ifdef GSSAPI
2652+ /* If we've got GSSAPI algorithms, then we also support the
2653+ * 'null' hostkey, as a last resort */
2654+ if (options.gss_keyex && gss) {
2655+ orig = myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS];
2656+ xasprintf(&myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS],
2657+ "%s,null", orig);
2658+ free(gss);
2659+ } 2652+ }
2660+#endif 2653+#endif
2661+ 2654+
2662 if (options.rekey_limit || options.rekey_interval) 2655 if (options.rekey_limit || options.rekey_interval)
2663 packet_set_rekey_limits((u_int32_t)options.rekey_limit, 2656 packet_set_rekey_limits((u_int32_t)options.rekey_limit,
2664 (time_t)options.rekey_interval); 2657 (time_t)options.rekey_interval);
2665@@ -211,10 +247,30 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) 2658@@ -211,10 +243,30 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
2666 # endif 2659 # endif
2667 #endif 2660 #endif
2668 kex->kex[KEX_C25519_SHA256] = kexc25519_client; 2661 kex->kex[KEX_C25519_SHA256] = kexc25519_client;
@@ -2693,7 +2686,7 @@ index 7751031..e2ea826 100644
2693 dispatch_run(DISPATCH_BLOCK, &kex->done, active_state); 2686 dispatch_run(DISPATCH_BLOCK, &kex->done, active_state);
2694 2687
2695 if (options.use_roaming && !kex->roaming) { 2688 if (options.use_roaming && !kex->roaming) {
2696@@ -306,6 +362,7 @@ int input_gssapi_token(int type, u_int32_t, void *); 2689@@ -306,6 +358,7 @@ int input_gssapi_token(int type, u_int32_t, void *);
2697 int input_gssapi_hash(int type, u_int32_t, void *); 2690 int input_gssapi_hash(int type, u_int32_t, void *);
2698 int input_gssapi_error(int, u_int32_t, void *); 2691 int input_gssapi_error(int, u_int32_t, void *);
2699 int input_gssapi_errtok(int, u_int32_t, void *); 2692 int input_gssapi_errtok(int, u_int32_t, void *);
@@ -2701,7 +2694,7 @@ index 7751031..e2ea826 100644
2701 #endif 2694 #endif
2702 2695
2703 void userauth(Authctxt *, char *); 2696 void userauth(Authctxt *, char *);
2704@@ -321,6 +378,11 @@ static char *authmethods_get(void); 2697@@ -321,6 +374,11 @@ static char *authmethods_get(void);
2705 2698
2706 Authmethod authmethods[] = { 2699 Authmethod authmethods[] = {
2707 #ifdef GSSAPI 2700 #ifdef GSSAPI
@@ -2713,7 +2706,7 @@ index 7751031..e2ea826 100644
2713 {"gssapi-with-mic", 2706 {"gssapi-with-mic",
2714 userauth_gssapi, 2707 userauth_gssapi,
2715 NULL, 2708 NULL,
2716@@ -627,19 +689,31 @@ userauth_gssapi(Authctxt *authctxt) 2709@@ -627,19 +685,31 @@ userauth_gssapi(Authctxt *authctxt)
2717 static u_int mech = 0; 2710 static u_int mech = 0;
2718 OM_uint32 min; 2711 OM_uint32 min;
2719 int ok = 0; 2712 int ok = 0;
@@ -2747,7 +2740,7 @@ index 7751031..e2ea826 100644
2747 ok = 1; /* Mechanism works */ 2740 ok = 1; /* Mechanism works */
2748 } else { 2741 } else {
2749 mech++; 2742 mech++;
2750@@ -736,8 +810,8 @@ input_gssapi_response(int type, u_int32_t plen, void *ctxt) 2743@@ -736,8 +806,8 @@ input_gssapi_response(int type, u_int32_t plen, void *ctxt)
2751 { 2744 {
2752 Authctxt *authctxt = ctxt; 2745 Authctxt *authctxt = ctxt;
2753 Gssctxt *gssctxt; 2746 Gssctxt *gssctxt;
@@ -2758,7 +2751,7 @@ index 7751031..e2ea826 100644
2758 2751
2759 if (authctxt == NULL) 2752 if (authctxt == NULL)
2760 fatal("input_gssapi_response: no authentication context"); 2753 fatal("input_gssapi_response: no authentication context");
2761@@ -850,6 +924,48 @@ input_gssapi_error(int type, u_int32_t plen, void *ctxt) 2754@@ -850,6 +920,48 @@ input_gssapi_error(int type, u_int32_t plen, void *ctxt)
2762 free(lang); 2755 free(lang);
2763 return 0; 2756 return 0;
2764 } 2757 }