]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
add secure_cookie protocol field to suppress other protocols' cookies from --dump...
authorDaniel Lenski <dlenski@gmail.com>
Fri, 15 May 2020 17:00:03 +0000 (10:00 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Wed, 11 Nov 2020 21:04:20 +0000 (13:04 -0800)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
http.c
library.c
openconnect-internal.h

diff --git a/http.c b/http.c
index 72db08fb028a0ecb1088cc726b038d83b985f9d2..c3b84d6318e5f045fadb3f67bce286c0cc9a2218 100644 (file)
--- a/http.c
+++ b/http.c
@@ -518,7 +518,7 @@ int process_http_response(struct openconnect_info *vpninfo, int connect,
                        print_equals = equals;
                        /* Don't print the webvpn cookie unless it's empty; we don't
                           want people posting it in public with debugging output */
-                       if (!strcmp(colon, "webvpn") && *equals)
+                       if (vpninfo->proto->secure_cookie && !strcmp(colon, vpninfo->proto->secure_cookie) && *equals)
                                print_equals = _("<elided>");
                        vpn_progress(vpninfo, PRG_DEBUG, "%s: %s=%s%s%s\n",
                                hdrline, colon, print_equals, semicolon ? ";" : "",
index f54afb96d120722b9fc0aaddbafabe8e5db4e49d..b888ff830e7c273c16ac84db5df34e2e81df7aad 100644 (file)
--- a/library.c
+++ b/library.c
@@ -121,6 +121,7 @@ static const struct vpn_proto openconnect_protos[] = {
                .tcp_mainloop = cstp_mainloop,
                .add_http_headers = cstp_common_headers,
                .obtain_cookie = cstp_obtain_cookie,
+               .secure_cookie = "webvpn",
                .udp_protocol = "DTLS",
 #ifdef HAVE_DTLS
                .udp_setup = dtls_setup,
@@ -138,6 +139,7 @@ static const struct vpn_proto openconnect_protos[] = {
                .tcp_mainloop = oncp_mainloop,
                .add_http_headers = oncp_common_headers,
                .obtain_cookie = oncp_obtain_cookie,
+               .secure_cookie = "DSID",
                .udp_protocol = "ESP",
 #ifdef HAVE_ESP
                .udp_setup = esp_setup,
index 1f30140e19e0341c58e47e61d3469b4b71c35535..51325f3271d2e7ea3581552fa2d87e5b084c4b54 100644 (file)
@@ -267,6 +267,7 @@ struct vpn_proto {
        const char *name;
        const char *pretty_name;
        const char *description;
+       const char *secure_cookie;
        const char *udp_protocol;
        unsigned int flags;
        int (*vpn_close_session)(struct openconnect_info *vpninfo, const char *reason);