diff options
| author | Michael Paquier | 2020-09-28 03:47:13 +0000 |
|---|---|---|
| committer | Michael Paquier | 2020-09-28 03:47:13 +0000 |
| commit | e21cbb4b893b85b5f1cf203b9a77ca0d9ee671d1 (patch) | |
| tree | 324c72ead54fbb1b02e6a3678557214aef82916e /src/include/common | |
| parent | 9d299a492454f9ffdf0fd8fe1fd6303c8ddf805a (diff) | |
Change SHA2 implementation based on OpenSSL to use EVP digest routines
The use of low-level hash routines is not recommended by upstream
OpenSSL since 2000, and pgcrypto already switched to EVP as of 5ff4a67.
Note that this also fixes a failure with SCRAM authentication when using
FIPS in OpenSSL, but as there have been few complaints about this
problem and as this causes an ABI breakage, no backpatch is done.
Author: Michael Paquier, Alessandro Gherardi
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20200924025314.GE7405@paquier.xyz
Discussion: https://postgr.es/m/20180911030250.GA27115@paquier.xyz
Diffstat (limited to 'src/include/common')
| -rw-r--r-- | src/include/common/sha2.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/common/sha2.h b/src/include/common/sha2.h index 9c4abf777d4..2c528381615 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/sha.h> +#include <openssl/evp.h> #endif /*** SHA224/256/384/512 Various Length Definitions ***********************/ @@ -70,10 +70,10 @@ /* Context Structures for SHA224/256/384/512 */ #ifdef USE_OPENSSL -typedef SHA256_CTX pg_sha256_ctx; -typedef SHA512_CTX pg_sha512_ctx; -typedef SHA256_CTX pg_sha224_ctx; -typedef SHA512_CTX pg_sha384_ctx; +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; #else typedef struct pg_sha256_ctx { |
