Commit 96719e52 authored by Michael Paquier's avatar Michael Paquier

Use OpenSSL-specific ifdefs in sha2.h

In order to separate OpenSSL's SHA symbols, this header has been using
USE_SSL, which is equivalent to USE_OPENSSL.  There is now only one SSL
implementation included in the tree, so this works fine, but when
adding a new SSL implementation this would run into failures.

Author: Daniel Gustafsson
Discussion: https://postgr.es/m/0DF29010-CE26-4F51-85A6-9C8ABF5536F9@yesql.se
parent d25ea012
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#ifndef _PG_SHA2_H_ #ifndef _PG_SHA2_H_
#define _PG_SHA2_H_ #define _PG_SHA2_H_
#ifdef USE_SSL #ifdef USE_OPENSSL
#include <openssl/sha.h> #include <openssl/sha.h>
#endif #endif
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#define PG_SHA512_DIGEST_STRING_LENGTH (PG_SHA512_DIGEST_LENGTH * 2 + 1) #define PG_SHA512_DIGEST_STRING_LENGTH (PG_SHA512_DIGEST_LENGTH * 2 + 1)
/* Context Structures for SHA-1/224/256/384/512 */ /* Context Structures for SHA-1/224/256/384/512 */
#ifdef USE_SSL #ifdef USE_OPENSSL
typedef SHA256_CTX pg_sha256_ctx; typedef SHA256_CTX pg_sha256_ctx;
typedef SHA512_CTX pg_sha512_ctx; typedef SHA512_CTX pg_sha512_ctx;
typedef SHA256_CTX pg_sha224_ctx; typedef SHA256_CTX pg_sha224_ctx;
...@@ -89,7 +89,7 @@ typedef struct pg_sha512_ctx ...@@ -89,7 +89,7 @@ typedef struct pg_sha512_ctx
} pg_sha512_ctx; } pg_sha512_ctx;
typedef struct pg_sha256_ctx pg_sha224_ctx; typedef struct pg_sha256_ctx pg_sha224_ctx;
typedef struct pg_sha512_ctx pg_sha384_ctx; typedef struct pg_sha512_ctx pg_sha384_ctx;
#endif /* USE_SSL */ #endif /* USE_OPENSSL */
/* Interface routines for SHA224/256/384/512 */ /* Interface routines for SHA224/256/384/512 */
extern void pg_sha224_init(pg_sha224_ctx *ctx); extern void pg_sha224_init(pg_sha224_ctx *ctx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment