The AnyConnect client uses the redirection type (new host, or just a
new URL on the same host) to figure out whether to use XML POST or
the old urlencoded scheme. Preserve this information for future use.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
*/
static int handle_redirect(struct openconnect_info *vpninfo)
{
+ vpninfo->redirect_type = REDIR_TYPE_LOCAL;
+
if (!strncmp(vpninfo->redirect_url, "https://", 8)) {
/* New host. Tear down the existing connection and make a new one */
char *host;
vpninfo->peer_addr = NULL;
openconnect_close_https(vpninfo, 0);
clear_cookies(vpninfo);
+ vpninfo->redirect_type = REDIR_TYPE_NEWHOST;
} else
free(host);
int result, buflen;
retry:
+ vpninfo->redirect_type = REDIR_TYPE_NONE;
+
if (*form_buf) {
free(*form_buf);
*form_buf = NULL;
#define CERT_TYPE_PKCS12 2
#define CERT_TYPE_TPM 3
+#define REDIR_TYPE_NONE 0
+#define REDIR_TYPE_NEWHOST 1
+#define REDIR_TYPE_LOCAL 2
+
struct openconnect_info {
char *redirect_url;
+ int redirect_type;
const char *csd_xmltag;
const char *platname;