void vpn_init_openssl(void);
int ssl_mainloop(struct anyconnect_info *vpninfo, int *timeout);
int ssl_bye(struct anyconnect_info *vpninfo, char *reason);
-int obtain_cookie_cert(struct anyconnect_info *vpninfo);
int __attribute__ ((format (printf, 2, 3)))
my_SSL_printf(SSL *ssl, const char *fmt, ...);
int my_SSL_gets(SSL *ssl, char *buf, size_t len);
int queue_new_packet(struct pkt **q, int type, void *buf, int len);
void queue_packet(struct pkt **q, struct pkt *new);
-/* curl.c */
-static inline int obtain_cookie_login(struct anyconnect_info *vpninfo)
-{
- fprintf(stderr, "No login code yet. Hassle Marcel.\n");
- return -1;
-}
-
/* xml.c */
int config_lookup_host(struct anyconnect_info *vpninfo, const char *host);
int process_http_response(struct anyconnect_info *vpninfo, int *result,
int (*header_cb)(struct anyconnect_info *, char *, char *),
char *body, int buf_len);
+int obtain_cookie(struct anyconnect_info *vpninfo);
vpninfo->deflate_adler32 = 1;
vpninfo->inflate_adler32 = 1;
- if (!vpninfo->cookie && obtain_cookie_cert(vpninfo) &&
- obtain_cookie_login(vpninfo)) {
+ if (!vpninfo->cookie && obtain_cookie(vpninfo)) {
fprintf(stderr, "Failed to obtain WebVPN cookie\n");
exit(1);
}
return 0;
}
-int obtain_cookie_cert(struct anyconnect_info *vpninfo)
+int obtain_cookie(struct anyconnect_info *vpninfo)
{
struct vpn_option *opt, *next;
char buf[65536];
int result;
- if (!vpninfo->cert)
- return -ENOENT;
-
retry:
if (!vpninfo->https_ssl && open_https(vpninfo)) {
fprintf(stderr, "Failed to open HTTPS connection to %s\n",
}
}
}
- if (vpninfo->cookie)
+ if (vpninfo->cookie && vpninfo->cookie[0])
return 0;
return -1;