mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Only run SSL nsock tests if configured with OpenSSL
This commit is contained in:
@@ -76,7 +76,7 @@ cleanup_all() {
|
|||||||
main() {
|
main() {
|
||||||
setup_echo_udp $PORT_UDP
|
setup_echo_udp $PORT_UDP
|
||||||
setup_echo_tcp $PORT_TCP
|
setup_echo_tcp $PORT_TCP
|
||||||
setup_echo_tcpssl $PORT_TCPSSL
|
$EXEC_MAIN --ssl && setup_echo_tcpssl $PORT_TCPSSL
|
||||||
|
|
||||||
$TRACER $EXEC_MAIN
|
$TRACER $EXEC_MAIN
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "test-common.h"
|
#include "test-common.h"
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@@ -36,7 +37,9 @@ extern const struct test_case TestGHHeaps;
|
|||||||
extern const struct test_case TestHeapOrdering;
|
extern const struct test_case TestHeapOrdering;
|
||||||
extern const struct test_case TestCancelTCP;
|
extern const struct test_case TestCancelTCP;
|
||||||
extern const struct test_case TestCancelUDP;
|
extern const struct test_case TestCancelUDP;
|
||||||
|
#ifdef HAVE_OPENSSL
|
||||||
extern const struct test_case TestCancelSSL;
|
extern const struct test_case TestCancelSSL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static const struct test_case *TestCases[] = {
|
static const struct test_case *TestCases[] = {
|
||||||
@@ -58,7 +61,9 @@ static const struct test_case *TestCases[] = {
|
|||||||
/* ---- cancel.c */
|
/* ---- cancel.c */
|
||||||
&TestCancelTCP,
|
&TestCancelTCP,
|
||||||
&TestCancelUDP,
|
&TestCancelUDP,
|
||||||
|
#ifdef HAVE_OPENSSL
|
||||||
&TestCancelSSL,
|
&TestCancelSSL,
|
||||||
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -94,6 +99,15 @@ static int win_init(void) {
|
|||||||
int main(int ac, char **av) {
|
int main(int ac, char **av) {
|
||||||
int rc, i;
|
int rc, i;
|
||||||
|
|
||||||
|
/* simple "do we have ssl" check for run_tests.sh */
|
||||||
|
if (ac == 2 && !strncmp(av[1], "--ssl", 5)) {
|
||||||
|
#ifdef HAVE_SSL
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
win_init();
|
win_init();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user