]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
TNCC periodic host checking fix
authorNick Parrin <spam@coreworks.be>
Wed, 12 Dec 2018 17:19:06 +0000 (18:19 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Fri, 4 Jan 2019 00:30:01 +0000 (00:30 +0000)
Fix periodic host checking in check_cookie_success() by passing
dspreauth to TNCC instead of dsid

Signed-off-by: Nick Parrin <spam@coreworks.be>
auth-juniper.c

index 30ceb3aee80c5bf7c74df81a93bd5c2490d0fd62..b0eacafa1781d6988eed9f3ca0eb4e7ccd418f5f 100644 (file)
@@ -285,7 +285,7 @@ static xmlNodePtr find_form_node(xmlDocPtr doc)
 
 static int check_cookie_success(struct openconnect_info *vpninfo)
 {
-       const char *dslast = NULL, *dsfirst = NULL, *dsurl = NULL, *dsid = NULL;
+       const char *dslast = NULL, *dsfirst = NULL, *dsurl = NULL, *dsid = NULL, *dspreauth = NULL;
        struct oc_vpn_option *cookie;
        struct oc_text_buf *buf;
 
@@ -298,6 +298,8 @@ static int check_cookie_success(struct openconnect_info *vpninfo)
                        dsid = cookie->value;
                else if (!strcmp(cookie->option, "DSSignInUrl"))
                        dsurl = cookie->value;
+               else if (!strcmp(cookie->option, "DSPREAUTH"))
+                       dspreauth = cookie->value;
        }
        if (!dsid)
                return -ENOENT;
@@ -305,7 +307,7 @@ static int check_cookie_success(struct openconnect_info *vpninfo)
        buf = buf_alloc();
        if (vpninfo->tncc_fd != -1) {
                buf_append(buf, "setcookie\n");
-               buf_append(buf, "Cookie=%s\n", dsid);
+               buf_append(buf, "Cookie=%s\n", dspreauth);
                if (buf_error(buf))
                        return buf_free(buf);
                send(vpninfo->tncc_fd, buf->data, buf->pos, 0);