Removed conditional code for OWASP headers

This commit is contained in:
Russ Young
2021-05-12 11:56:09 -06:00
parent 065f51e6af
commit c4bc01766d
8 changed files with 1 additions and 30 deletions

View File

@@ -669,18 +669,6 @@ fi
AM_CONDITIONAL(ENABLE_OIDC_AUTH, test "x$enable_oidc_auth" = xyes)
AM_CONDITIONAL(ENABLE_OIDC_AUTH_TESTS, test "x$enable_oidc_auth" = xyes)
AC_ARG_ENABLE([owasp-headers],
[AS_HELP_STRING([--enable-owasp-headers],
[whether to add owasp.org http security headers (default is no)])],
[enable_owasp_headers=$enableval],
[enable_owasp_headers=no]
)
if test "x$enable_owasp_headers" = xyes; then
AC_DEFINE([ENABLE_OWASP_HEADERS], 1, [Add OWASP default http headers to responses])
fi
AM_CONDITIONAL(ENABLE_OWASP_HEADERS_TESTS, test "x$enable_owasp_headers" = xyes)
AC_CHECK_FILE(/proc/self/exe, AC_DEFINE([PROC_FS_SUPPORTED],[1], [procfs supported]), [])
uid=$(id -u)

View File

@@ -438,13 +438,11 @@ int get_auth_handler2(worker_st * ws, unsigned http_ver, const char *pmsg, unsig
goto cleanup;
}
#ifdef ENABLE_OWASP_HEADERS
ret = add_owasp_headers(ws);
if (ret < 0) {
ret = -1;
goto cleanup;
}
#endif
ret = cstp_puts(ws, "\r\n");
if (ret < 0) {
@@ -1097,12 +1095,10 @@ int post_common_handler(worker_st * ws, unsigned http_ver, const char *imsg)
if (ret < 0)
goto fail;
#ifdef ENABLE_OWASP_HEADERS
ret =
add_owasp_headers(ws);
if (ret < 0)
goto fail;
#endif
#ifdef ANYCONNECT_CLIENT_COMPAT

View File

@@ -58,9 +58,7 @@ static int send_headers(worker_st *ws, unsigned http_ver, const char *content_ty
cstp_printf(ws, "Content-Type: %s\r\n", content_type) < 0 ||
cstp_puts (ws, "X-Transcend-Version: 1\r\n") < 0 ||
cstp_printf(ws, "Content-Length: %u\r\n", content_length) < 0 ||
#ifdef ENABLE_OWASP_HEADERS
add_owasp_headers(ws) < 0 ||
#endif
cstp_puts (ws, "\r\n") < 0)
return -1;
return 0;

View File

@@ -863,7 +863,6 @@ void http_req_deinit(worker_st * ws)
ws->req.body = NULL;
}
#ifdef ENABLE_OWASP_HEADERS
/* add_owasp_headers:
* @ws: an initialized worker structure
*
@@ -889,4 +888,3 @@ int add_owasp_headers(worker_st * ws)
}
return 0;
}
#endif

View File

@@ -273,13 +273,10 @@ int post_kkdcp_handler(worker_st *ws, unsigned http_ver)
goto fail;
}
#ifdef ENABLE_OWASP_HEADERS
ret = add_owasp_headers(ws);
if (ret < 0) {
goto fail;
}
#endif
ret = cstp_puts(ws, "\r\n");
if (ret < 0) {

View File

@@ -1931,10 +1931,8 @@ static int connect_handler(worker_st * ws)
ret = cstp_puts(ws, "HTTP/1.1 200 CONNECTED\r\n");
SEND_ERR(ret);
#ifdef ENABLE_OWASP_HEADERS
ret = add_owasp_headers(ws);
SEND_ERR(ret);
#endif
ret = cstp_puts(ws, "X-CSTP-Version: 1\r\n");
SEND_ERR(ret);

View File

@@ -422,9 +422,7 @@ int parse_proxy_proto_header(struct worker_st *ws, int fd);
void cookie_authenticate_or_exit(worker_st *ws);
#ifdef ENABLE_OWASP_HEADERS
int add_owasp_headers(worker_st * ws);
#endif
/* after that time (secs) of inactivity in the UDP part, connection switches to
* TCP (if activity occurs there).

View File

@@ -180,9 +180,7 @@ check_PROGRAMS += gen_oidc_test_data
dist_check_SCRIPTS += test-oidc
endif
if ENABLE_OWASP_HEADERS_TESTS
dist_check_SCRIPTS += test-owasp-headers
endif
dist_check_SCRIPTS += test-replay