aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-09-29 09:25:51 +0900
committerMichael Paquier <michael@paquier.xyz>2020-09-29 09:25:51 +0900
commitfe0a1dc52c7332a65b44db8e8408a5fd1d8fc8fb (patch)
tree4a0813aeaa0b3f7f7ee3cf5515b071d6cbb1fa5a /src/include
parent042d8017ec7bca244db4a53bc3d72d218495136d (diff)
downloadpostgresql-fe0a1dc52c7332a65b44db8e8408a5fd1d8fc8fb.tar.gz
postgresql-fe0a1dc52c7332a65b44db8e8408a5fd1d8fc8fb.zip
Revert "Change SHA2 implementation based on OpenSSL to use EVP digest routines"
This reverts commit e21cbb4, as the switch to EVP routines requires a more careful design where we would need to have at least our wrapper routines return a status instead of issuing an error by themselves to let the caller do the error handling. The memory handling was also incorrect and could cause leaks in the backend if a failure happened, requiring most likely a callback to do the necessary cleanup as the only clean way to be able to allocate an EVP context requires the use of an allocation within OpenSSL. The potential rework of the wrappers also impacts the fallback implementation when not building with OpenSSL. Originally, prairiedog has reported a compilation failure, but after discussion with Tom Lane this needs a better design. Discussion: https://postgr.es/m/20200928073330.GC2316@paquier.xyz
Diffstat (limited to 'src/include')
-rw-r--r--src/include/common/sha2.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/common/sha2.h b/src/include/common/sha2.h
index 2c528381615..9c4abf777d4 100644
--- a/src/include/common/sha2.h
+++ b/src/include/common/sha2.h
@@ -51,7 +51,7 @@
#define _PG_SHA2_H_
#ifdef USE_OPENSSL
-#include <openssl/evp.h>
+#include <openssl/sha.h>
#endif
/*** SHA224/256/384/512 Various Length Definitions ***********************/
@@ -70,10 +70,10 @@
/* Context Structures for SHA224/256/384/512 */
#ifdef USE_OPENSSL
-typedef EVP_MD_CTX *pg_sha256_ctx;
-typedef EVP_MD_CTX *pg_sha512_ctx;
-typedef EVP_MD_CTX *pg_sha224_ctx;
-typedef EVP_MD_CTX *pg_sha384_ctx;
+typedef SHA256_CTX pg_sha256_ctx;
+typedef SHA512_CTX pg_sha512_ctx;
+typedef SHA256_CTX pg_sha224_ctx;
+typedef SHA512_CTX pg_sha384_ctx;
#else
typedef struct pg_sha256_ctx
{