Skip to content

Commit

Permalink
Fix CSD trojan download
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Mar 7, 2013
1 parent 0e6f0ad commit b6ef1c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions http.c
Expand Up @@ -999,7 +999,7 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
vpn_progress(vpninfo, PRG_INFO, _("XML POST enabled\n"));

/* Step 4: Run the CSD trojan, if applicable */
if (vpninfo->csd_starturl) {
if (vpninfo->csd_starturl && vpninfo->csd_waiturl && vpninfo->csd_waiturl) {
char *form_path = NULL;

if (vpninfo->urlpath) {
Expand All @@ -1010,14 +1010,16 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
}
}

/* fetch the CSD program, if available */
if (vpninfo->csd_stuburl) {
/* fetch the CSD program */
vpninfo->redirect_url = vpninfo->csd_stuburl;
vpninfo->csd_stuburl = NULL;
handle_redirect(vpninfo);

buflen = do_https_request(vpninfo, "GET", NULL, NULL, &form_buf, 0);
if (buflen <= 0) {
result = -EINVAL;
goto out;
}
}

/* This is the CSD stub script, which we now need to run */
result = run_csd_script(vpninfo, form_buf, buflen);
Expand Down

0 comments on commit b6ef1c8

Please sign in to comment.