Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use correct XML tag for CSD script on Mac
Other operating systems still get the Linux version, and will need a
wrapper or something to make it cope.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jul 12, 2012
1 parent 06eff27 commit fdc62fe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion auth.c
Expand Up @@ -394,7 +394,7 @@ int parse_xml_response(struct openconnect_info *vpninfo, char *response,
if (!vpninfo->csd_ticket)
vpninfo->csd_ticket = (char *)xmlGetProp(xml_node,
(unsigned char *)"ticket");
} else if (!vpninfo->csd_scriptname && !strcmp((char *)xml_node->name, "csdLinux")) {
} else if (!vpninfo->csd_scriptname && !strcmp((char *)xml_node->name, vpninfo->csd_xmltag)) {
vpninfo->csd_stuburl = (char *)xmlGetProp(xml_node,
(unsigned char *)"stuburl");
vpninfo->csd_starturl = (char *)xmlGetProp(xml_node,
Expand Down
5 changes: 5 additions & 0 deletions library.c
Expand Up @@ -46,6 +46,11 @@ struct openconnect_info *openconnect_vpninfo_new (char *useragent,
vpninfo->progress = progress;
vpninfo->cbdata = privdata?:vpninfo;
vpninfo->cancel_fd = -1;
#ifdef __APPLE__
vpninfo->csd_xmltag = "csdMac";
#else
vpninfo->csd_xmltag = "csdLinux";
#endif

#ifdef ENABLE_NLS
bindtextdomain("openconnect", LOCALEDIR);
Expand Down
7 changes: 7 additions & 0 deletions main.c
Expand Up @@ -461,6 +461,13 @@ int main(int argc, char **argv)
vpninfo->max_qlen = 10;
vpninfo->reconnect_interval = RECONNECT_INTERVAL_MIN;
vpninfo->reconnect_timeout = 300;
vpninfo->uid_csd = 0;
/* We could let them override this on the command line some day, perhaps */
#ifdef __APPLE__
vpninfo->csd_xmltag = "csdMac";
#else
vpninfo->csd_xmltag = "csdLinux";
#endif
vpninfo->uid_csd = 0;
vpninfo->uid_csd_given = 0;
vpninfo->validate_peer_cert = validate_peer_cert;
Expand Down
1 change: 1 addition & 0 deletions openconnect-internal.h
Expand Up @@ -126,6 +126,7 @@ struct pin_cache {
struct openconnect_info {
char *redirect_url;

const char *csd_xmltag;
char *csd_token;
char *csd_ticket;
char *csd_stuburl;
Expand Down
1 change: 1 addition & 0 deletions www/changelog.xml
Expand Up @@ -17,6 +17,7 @@
<ul>
<li><b>OpenConnect HEAD</b>
<ul>
<li>Use correct CSD script for Mac OS X.</li>
<li>Fix endless loop in PIN cache handling with multiple PKCS#11 tokens.</li>
<li>Fix PKCS#11 URI handling to preserve all attributes.</li>
<li>Don't forget key password on GUI reconnect.</li>
Expand Down

0 comments on commit fdc62fe

Please sign in to comment.