]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Prevent conflicts between Solaris SHA2 and OpenSSL.
authorDarren Tucker <dtucker@dtucker.net>
Tue, 28 Mar 2023 07:06:42 +0000 (18:06 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Tue, 28 Mar 2023 08:03:03 +0000 (19:03 +1100)
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

index 507f3f5689b5c9328bea756294117f0fb3a60b22..1235bea3087629003e7e3494cf252e9bde4909cd 100644 (file)
 #endif
 
 #ifdef WITH_OPENSSL
-/* We don't use sha2 from OpenSSL and they can conflict with system sha2.h */
+/*
+ * 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>