freebsd-ports/net/openldap24-server/files/patch-contrib_slapd-modules_passwd_sha2_sha2.h
Xin LI 078b145883 Add a patch to resolve symbol conflict between SHA2 module with OpenSSL's
SHA2 implementation.

Without this, e.g. SSHA512 scheme would result in a crash due to stack
corruption, which is a result of different SHA512 context size in the
contributed SHA2 implementation and the OpenSSL one, plus the allocation
is on stack.

PR:		197004
MFH:		2015Q2
2015-05-27 22:08:40 +00:00

24 lines
895 B
C

--- contrib/slapd-modules/passwd/sha2/sha2.h.orig 2014-09-19 01:48:49 UTC
+++ contrib/slapd-modules/passwd/sha2/sha2.h
@@ -142,6 +142,21 @@ typedef struct _SHA512_CTX {
typedef SHA512_CTX SHA384_CTX;
+#define SHA256_Init _sha2_SHA256_Init
+#define SHA256_Update _sha2_SHA256_Update
+#define SHA256_Final _sha2_SHA256_Final
+#define SHA256_End _sha2_SHA256_End
+#define SHA256_Data _sha2_SHA256_Data
+#define SHA384_Init _sha2_SHA384_Init
+#define SHA384_Update _sha2_SHA384_Update
+#define SHA384_Final _sha2_SHA384_Final
+#define SHA384_End _sha2_SHA384_End
+#define SHA384_Data _sha2_SHA384_Data
+#define SHA512_Init _sha2_SHA512_Init
+#define SHA512_Update _sha2_SHA512_Update
+#define SHA512_Final _sha2_SHA512_Final
+#define SHA512_End _sha2_SHA512_End
+#define SHA512_Data _sha2_SHA512_Data
/*** SHA-256/384/512 Function Prototypes ******************************/
#ifndef NOPROTO