[openssh-commits] [openssh] 01/02: Prevent conflicts between Solaris SHA2 and OpenSSL.

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Jul 26 09:21:23 AEST 2023


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

dtucker pushed a commit to branch V_9_3
in repository openssh.

commit 9ab0f5af2c8628ad613a7c5551d3ab08aae50982
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Tue Mar 28 10:35:18 2023 +1100

    Prevent conflicts between Solaris SHA2 and OpenSSL.
    
    We used to prevent conflicts between native SHA2 headers and OpenSSL's
    by setting OPENSSL_NO_SHA but that was removed prior to OpenSSL 1.1.0
---
 regress/misc/sk-dummy/sk-dummy.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/regress/misc/sk-dummy/sk-dummy.c b/regress/misc/sk-dummy/sk-dummy.c
index ad5e4745..1235bea3 100644
--- a/regress/misc/sk-dummy/sk-dummy.c
+++ b/regress/misc/sk-dummy/sk-dummy.c
@@ -36,10 +36,31 @@
 #endif
 
 #ifdef WITH_OPENSSL
-/* We don't use sha2 from OpenSSL and they can conflict with system sha2.h */
-#define OPENSSL_NO_SHA
+/*
+ * We use native (or compat) SHA2, but some bits of OpenSSL conflict with
+ * some native sha2 implementations.  SHA2 is no longer optional in OpenSSL,
+ * so prevent conflicts as best we can.
+ */
 #define USE_LIBC_SHA2	/* NetBSD 9 */
+#define SHA256_CTX	openssl_SHA256_CTX
+#define SHA512_CTX	openssl_SHA512_CTX
+#ifdef SHA1
+# undef SHA1
+#endif
+#ifdef SHA224
+# undef SHA224
+#endif
+#ifdef SHA256
+# undef SHA256
+#endif
+#ifdef SHA384
+# undef SHA384
+#endif
+#ifdef SHA512
+# undef SHA512
+#endif
 #include <openssl/opensslv.h>
+#include <openssl/sha.h>
 #include <openssl/crypto.h>
 #include <openssl/evp.h>
 #include <openssl/bn.h>

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


More information about the openssh-commits mailing list