Skip to content

Commit

Permalink
Move cleanup_ntlm_auth() out of http.c
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 Jun 20, 2014
1 parent 9e50ba4 commit f6dd645
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 1 addition & 6 deletions http.c
Expand Up @@ -1854,7 +1854,6 @@ int process_proxy(struct openconnect_info *vpninfo, int ssl_sock)
{
int ret;

vpninfo->ntlm_helper_fd = -1;
vpninfo->proxy_fd = ssl_sock;
vpninfo->ssl_read = proxy_read;
vpninfo->ssl_write = proxy_write;
Expand All @@ -1871,13 +1870,9 @@ int process_proxy(struct openconnect_info *vpninfo, int ssl_sock)
ret = -EIO;
}

if (vpninfo->ntlm_helper_fd != -1) {
close(vpninfo->ntlm_helper_fd);
vpninfo->ntlm_helper_fd = -1;
}

vpninfo->proxy_fd = -1;
clear_auth_state(&vpninfo->basic_auth, 1);
cleanup_ntlm_auth(vpninfo);
clear_auth_state(&vpninfo->ntlm_auth, 1);
#ifdef HAVE_GSSAPI
cleanup_gssapi_auth(vpninfo);
Expand Down
7 changes: 7 additions & 0 deletions ntlm.c
Expand Up @@ -962,3 +962,10 @@ int ntlm_authorization(struct openconnect_info *vpninfo, struct oc_text_buf *buf
vpninfo->ntlm_auth.state = AUTH_FAILED;
return -EAGAIN;
}

void cleanup_ntlm_auth(struct openconnect_info *vpninfo)
{
if (vpninfo->ntlm_auth.state == NTLM_SSO_REQ) {
close(vpninfo->ntlm_helper_fd);
vpninfo->ntlm_helper_fd = -1;}
}
1 change: 1 addition & 0 deletions openconnect-internal.h
Expand Up @@ -590,6 +590,7 @@ int internal_parse_url(char *url, char **res_proto, char **res_host,

/* ntlm.c */
int ntlm_authorization(struct openconnect_info *vpninfo, struct oc_text_buf *buf);
void cleanup_ntlm_auth(struct openconnect_info *vpninfo);

/* gssapi.c */
int gssapi_authorization(struct openconnect_info *vpninfo, struct oc_text_buf *buf);
Expand Down

0 comments on commit f6dd645

Please sign in to comment.