}
}
}
- if (vpninfo->cookie) {
- printf("WebVPN cookie is %s\n", vpninfo->cookie);
+ if (vpninfo->cookie)
return 0;
- }
+ fprintf(stderr, "Server claimed successful login, but no cookie!\n");
return -1;
}
{"verbose", 1, 0, 'v'},
{"cafile", 1, 0, '0'},
{"no-dtls", 0, 0, '1'},
+ {"cookieonly", 0, 0, '2'},
{"xmlconfig", 1, 0, 'x'},
};
printf(" -u, --user=NAME Set login username\n");
printf(" -v, --verbose More output\n");
printf(" -x, --xmlconfig=CONFIG XML config file\n");
+ printf(" --fetchcookie Fetch webvpn cookie only; don't connect\n");
printf(" --cafile=FILE Cert file for server verification\n");
printf(" --no-dtls Disable DTLS\n");
exit(1);
{
struct anyconnect_info *vpninfo;
struct utsname utsbuf;
+ int cookieonly;
int opt;
vpn_init_openssl();
case '1':
vpninfo->trydtls = 0;
break;
+ case '2':
+ cookieonly = 1;
+ break;
case 'C':
vpninfo->cookie = optarg;
break;
exit(1);
}
+ if (cookieonly) {
+ printf("%s\n", vpninfo->cookie);
+ exit(0);
+ }
+
if (make_ssl_connection(vpninfo)) {
fprintf(stderr, "Creating SSL connection failed\n");
exit(1);