Clean up configure check for htp_tx_get_response_headers_raw. Misc changes.

remotes/origin/master-1.2.x
Victor Julien 14 years ago
parent 4acd5a04e6
commit 1ac6054c23

@ -845,10 +845,8 @@ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
AC_CHECK_LIB([htp], [htp_config_register_request_uri_normalize],AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Found htp_config_register_request_uri_normalize function in libhtp]) ,,[-lhtp]) AC_CHECK_LIB([htp], [htp_config_register_request_uri_normalize],AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Found htp_config_register_request_uri_normalize function in libhtp]) ,,[-lhtp])
]) ])
AC_CHECK_LIB([htp], [htp_tx_get_response_headers_raw],[libhtp_raw_response_header_buffer_support_enabled="yes"],[libhtp_raw_response_header_buffer_support_enabled="no"]) # check for htp_tx_get_response_headers_raw
if test "$libhtp_raw_response_header_buffer_support_enabled" = "yes"; then AC_CHECK_LIB([htp], [htp_tx_get_response_headers_raw],AC_DEFINE_UNQUOTED([HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW],[1],[Found htp_tx_get_response_headers_raw in libhtp]) ,,[-lhtp])
CFLAGS="${CFLAGS} -D__LIBHTP_026GT_RESPONSE_HEADER_SUPPORT__"
fi
#even if we are using an installed htp lib we still need to gen Makefiles inside of htp #even if we are using an installed htp lib we still need to gen Makefiles inside of htp
AC_CONFIG_SUBDIRS([libhtp]) AC_CONFIG_SUBDIRS([libhtp])

@ -346,14 +346,14 @@ int DetectEngineRunHttpRawHeaderMpm(DetectEngineThreadCtx *det_ctx, Flow *f,
(uint8_t *)bstr_ptr(raw_headers), (uint8_t *)bstr_ptr(raw_headers),
bstr_len(raw_headers)); bstr_len(raw_headers));
} }
#ifdef __LIBHTP_026GT_RESPONSE_HEADER_SUPPORT__ #ifdef HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW
raw_headers = htp_tx_get_response_headers_raw(tx); raw_headers = htp_tx_get_response_headers_raw(tx);
if (raw_headers != NULL) { if (raw_headers != NULL) {
cnt += HttpRawHeaderPatternSearch(det_ctx, cnt += HttpRawHeaderPatternSearch(det_ctx,
(uint8_t *)bstr_ptr(raw_headers), (uint8_t *)bstr_ptr(raw_headers),
bstr_len(raw_headers)); bstr_len(raw_headers));
} }
#endif #endif /* HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW */
} }
end: end:
@ -3013,6 +3013,7 @@ end:
static int DetectEngineHttpRawHeaderTest28(void) static int DetectEngineHttpRawHeaderTest28(void)
{ {
#ifdef HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW
TcpSession ssn; TcpSession ssn;
Packet *p1 = NULL; Packet *p1 = NULL;
Packet *p2 = NULL; Packet *p2 = NULL;
@ -3128,6 +3129,9 @@ end:
UTHFreePackets(&p1, 1); UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1); UTHFreePackets(&p2, 1);
return result; return result;
#else
return 1;
#endif
} }
static int DetectEngineHttpRawHeaderTest29(void) static int DetectEngineHttpRawHeaderTest29(void)

@ -529,6 +529,9 @@ void SCPrintBuildInfo(void) {
#ifdef HAVE_HTP_URI_NORMALIZE_HOOK #ifdef HAVE_HTP_URI_NORMALIZE_HOOK
strlcat(features, "HAVE_HTP_URI_NORMALIZE_HOOK ", sizeof(features)); strlcat(features, "HAVE_HTP_URI_NORMALIZE_HOOK ", sizeof(features));
#endif #endif
#ifdef HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW
strlcat(features, "HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW ", sizeof(features));
#endif
#ifdef PCRE_HAVE_JIT #ifdef PCRE_HAVE_JIT
strlcat(features, "PCRE_JIT ", sizeof(features)); strlcat(features, "PCRE_JIT ", sizeof(features));
#endif #endif

Loading…
Cancel
Save