Skip to content

Commit

Permalink
library: Add openconnect_set_xmlpost() to support different CSD modes
Browse files Browse the repository at this point in the history
In certain configurations, XML POST mode can impact the use of
CSD/Hostscan.  Some gateways are set up to refuse the CSD results if
XML POST is not being used; but in other cases supporting XML POST
on the client side can require a custom CSD wrapper script which isn't
needed for the non-XML-POST case.  So we'll allow the caller to decide
which mode to use.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
  • Loading branch information
cernekee committed Jan 15, 2014
1 parent 1c90e4d commit e1b4dfa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions libopenconnect.map.in
Expand Up @@ -50,6 +50,7 @@ OPENCONNECT_3.1 {
openconnect_get_ip_info;
openconnect_set_protect_socket_handler;
openconnect_set_mobile_info;
openconnect_set_xmlpost;
} OPENCONNECT_3.0;

OPENCONNECT_PRIVATE {
Expand Down
5 changes: 5 additions & 0 deletions library.c
Expand Up @@ -283,6 +283,11 @@ void openconnect_setup_csd(struct openconnect_info *vpninfo, uid_t uid, int sile
vpninfo->csd_wrapper = wrapper;
}

void openconnect_set_xmlpost(struct openconnect_info *vpninfo, int enable)
{
vpninfo->xmlpost = enable;
}

void openconnect_set_client_cert(struct openconnect_info *vpninfo, char *cert, char *sslkey)
{
vpninfo->cert = cert;
Expand Down
2 changes: 1 addition & 1 deletion main.c
Expand Up @@ -603,7 +603,7 @@ int main(int argc, char **argv)
vpninfo->nopasswd = 1;
break;
case OPT_NO_XMLPOST:
vpninfo->xmlpost = 0;
openconnect_set_xmlpost(vpninfo, 0);
break;
case OPT_NON_INTER:
non_inter = 1;
Expand Down
1 change: 1 addition & 0 deletions openconnect.h
Expand Up @@ -251,6 +251,7 @@ void openconnect_set_xmlsha1(struct openconnect_info *, const char *, int size);

void openconnect_set_cafile(struct openconnect_info *, char *);
void openconnect_setup_csd(struct openconnect_info *, uid_t, int silent, char *wrapper);
void openconnect_set_xmlpost(struct openconnect_info *, int enable);
int openconnect_set_reported_os(struct openconnect_info *, const char *os);
void openconnect_set_mobile_info(struct openconnect_info *vpninfo,
char *mobile_platform_version,
Expand Down

0 comments on commit e1b4dfa

Please sign in to comment.