fi
AC_SUBST(SYMVER_JAVA, $symver_java)
+AC_ARG_ENABLE([insecure-debugging],
+ AS_HELP_STRING([--enable-insecure-debugging],
+ [Enable --no-cert-check option, and don't logout on SIGINT]),
+ [insecure_debugging=yes],[insecure_debugging=no])
+
+if test "$insecure_debugging" = "yes"; then
+ oldcflags="$CFLAGS"
+ CFLAGS="$CFLAGS -DINSECURE_DEBUGGING"
+fi
+
AC_CHECK_HEADER([if_tun.h],
[AC_DEFINE([IF_TUN_HDR], ["if_tun.h"], [if_tun.h include path])],
[AC_CHECK_HEADER([linux/if_tun.h],
SUMMARY([Build docs], [$build_www])
SUMMARY([Unit tests], [$have_cwrap])
SUMMARY([Net namespace tests], [$have_netns])
+SUMMARY([Insecure debugging], [$insecure_debugging])
if test "$ssl_library" = "OpenSSL"; then
AC_MSG_WARN([[
static int timestamp;
int background;
static int do_passphrase_from_fsid;
+#ifdef INSECURE_DEBUGGING
+static int nocertcheck;
+#endif
static int non_inter;
static int cookieonly;
static int allow_stdin_read;
switch (sig) {
case SIGTERM:
- case SIGINT:
cmd = OC_CMD_CANCEL;
break;
case SIGHUP:
cmd = OC_CMD_DETACH;
break;
+ case SIGINT:
+#ifdef INSECURE_DEBUGGING
+ cmd = OC_CMD_DETACH;
+#else
+ cmd = OC_CMD_CANCEL;
+#endif
+ break;
case SIGUSR2:
default:
cmd = OC_CMD_PAUSE;
openconnect_binary_version, openconnect_version_str);
}
+#ifdef INSECURE_DEBUGGING
+ fprintf(stderr,
+ _("WARNING: This build is intended only for debugging purposes and\n"
+ " may allow you to establish insecure connections.\n"));
+#endif
+
openconnect_init_ssl();
vpninfo = openconnect_vpninfo_new((char *)"Open AnyConnect VPN Agent",
vpninfo->no_http_keepalive = 1;
break;
case OPT_NO_CERT_CHECK:
+#ifdef INSECURE_DEBUGGING
+ nocertcheck = 1;
+#else
fprintf(stderr,
_("The --no-cert-check option was insecure and has been removed.\n"
"Fix your server's certificate or use --servercert to trust it.\n"));
exit(1);
+#endif
break;
case 's':
vpnc_script = dup_config_arg();
ret = 1;
break;
case -EINTR:
- vpn_progress(vpninfo, PRG_INFO, _("User cancelled (SIGINT/SIGTERM); exiting.\n"));
+ vpn_progress(vpninfo, PRG_INFO, _("User cancelled (SIGTERM%s); exiting.\n"),
+#ifdef INSECURE_DEBUGGING
+ ""
+#else
+ "/SIGINT"
+#endif
+ );
ret = 0;
break;
case -ECONNABORTED:
- vpn_progress(vpninfo, PRG_INFO, _("User detached from session (SIGHUP); exiting.\n"));
+ vpn_progress(vpninfo, PRG_INFO, _("User detached from session (SIGHUP%s); exiting.\n"),
+#ifdef INSECURE_DEBUGGING
+ "/SIGINT"
+#else
+ ""
+#endif
+ );
ret = 0;
break;
default:
return -EINVAL;
}
+#ifdef INSECURE_DEBUGGING
+ if (nocertcheck) {
+ vpn_progress(vpninfo, PRG_ERR,
+ _("Ignoring because you built with --enable-insecure-debugging and invoked with --no-cert-check"));
+ return 0;
+ }
+#endif
+
fingerprint = openconnect_get_peer_cert_hash(vpninfo);
for (this = accepted_certs; this; this = this->next) {