[openssh-commits] [openssh] 01/01: Wrap OpenSSL includes in unit tests in ifdef.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jan 14 13:48:16 AEDT 2022


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 976b9588b4b5babcaceec4767a241c11a67a5ccb
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Jan 14 13:46:35 2022 +1100

    Wrap OpenSSL includes in unit tests in ifdef.
    
    Fixes unit test on systems that do not have OpenSSL headers installed.
---
 regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c | 2 ++
 regress/unittests/sshkey/test_fuzz.c               | 2 ++
 regress/unittests/sshkey/test_sshkey.c             | 2 ++
 regress/unittests/sshsig/tests.c                   | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c b/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
index 5de8707c..3b489589 100644
--- a/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
+++ b/regress/unittests/sshbuf/test_sshbuf_getput_fuzz.c
@@ -15,11 +15,13 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef WITH_OPENSSL
 #include <openssl/bn.h>
 #include <openssl/objects.h>
 #ifdef OPENSSL_HAS_NISTP256
 # include <openssl/ec.h>
 #endif
+#endif
 
 #include "../test_helper/test_helper.h"
 #include "ssherr.h"
diff --git a/regress/unittests/sshkey/test_fuzz.c b/regress/unittests/sshkey/test_fuzz.c
index a583c4a5..2fae19dc 100644
--- a/regress/unittests/sshkey/test_fuzz.c
+++ b/regress/unittests/sshkey/test_fuzz.c
@@ -18,6 +18,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef WITH_OPENSSL
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
@@ -25,6 +26,7 @@
 #ifdef OPENSSL_HAS_NISTP256
 # include <openssl/ec.h>
 #endif
+#endif
 
 #include "../test_helper/test_helper.h"
 
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index 1f5da68b..982907ce 100644
--- a/regress/unittests/sshkey/test_sshkey.c
+++ b/regress/unittests/sshkey/test_sshkey.c
@@ -15,12 +15,14 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef WITH_OPENSSL
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
 #if defined(OPENSSL_HAS_ECC) && defined(OPENSSL_HAS_NISTP256)
 # include <openssl/ec.h>
 #endif
+#endif
 
 #include "../test_helper/test_helper.h"
 
diff --git a/regress/unittests/sshsig/tests.c b/regress/unittests/sshsig/tests.c
index c44a9807..fdc3baeb 100644
--- a/regress/unittests/sshsig/tests.c
+++ b/regress/unittests/sshsig/tests.c
@@ -18,8 +18,10 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef WITH_OPENSSL
 #include <openssl/evp.h>
 #include <openssl/crypto.h>
+#endif
 
 #include "ssherr.h"
 #include "authfile.h"

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list