2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

4714. [port] openbsd/libressl: add support for building with

--enable-openssl-hash. [RT #45982]
This commit is contained in:
Mark Andrews
2017-09-12 14:19:10 +10:00
parent 9dd9d36efd
commit c75e9c7630
12 changed files with 26 additions and 19 deletions

View File

@@ -1,3 +1,6 @@
4714. [port] openbsd/libressl: add support for building with
--enable-openssl-hash. [RT #45982]
--- 9.12.0a1 released ---
4713. [func] Added support for the DNS Response Policy Service

View File

@@ -25,7 +25,7 @@
#include <openssl/opensslv.h>
#include <openssl/evp.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define EVP_CIPHER_CTX_new() &(_context), EVP_CIPHER_CTX_init(&_context)
#define EVP_CIPHER_CTX_free(c) RUNTIME_CHECK(EVP_CIPHER_CTX_cleanup(c) == 1)
#endif
@@ -34,7 +34,7 @@ void
isc_aes128_crypt(const unsigned char *key, const unsigned char *in,
unsigned char *out)
{
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_CIPHER_CTX _context;
#endif
EVP_CIPHER_CTX *c;
@@ -54,7 +54,7 @@ void
isc_aes192_crypt(const unsigned char *key, const unsigned char *in,
unsigned char *out)
{
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_CIPHER_CTX _context;
#endif
EVP_CIPHER_CTX *c;
@@ -74,7 +74,7 @@ void
isc_aes256_crypt(const unsigned char *key, const unsigned char *in,
unsigned char *out)
{
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_CIPHER_CTX _context;
#endif
EVP_CIPHER_CTX *c;

View File

@@ -32,7 +32,7 @@
#endif
#ifdef ISC_PLATFORM_OPENSSLHASH
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define HMAC_CTX_new() &(ctx->_ctx), HMAC_CTX_init(&(ctx->_ctx))
#define HMAC_CTX_free(ptr) HMAC_CTX_cleanup(ptr)
#endif

View File

@@ -30,7 +30,7 @@
#endif
#ifdef ISC_PLATFORM_OPENSSLHASH
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define HMAC_CTX_new() &(ctx->_ctx), HMAC_CTX_init(&(ctx->_ctx))
#define HMAC_CTX_free(ptr) HMAC_CTX_cleanup(ptr)
#endif

View File

@@ -33,7 +33,7 @@
typedef struct {
HMAC_CTX *ctx;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
HMAC_CTX _ctx;
#endif
} isc_hmacmd5_t;

View File

@@ -34,7 +34,7 @@
typedef struct {
HMAC_CTX *ctx;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
HMAC_CTX _ctx;
#endif
} isc_hmacsha_t;

View File

@@ -51,7 +51,7 @@
typedef struct {
EVP_MD_CTX *ctx;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX _ctx;
#endif
} isc_md5_t;

View File

@@ -32,7 +32,7 @@
typedef struct {
EVP_MD_CTX *ctx;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX _ctx;
#endif
} isc_sha1_t;

View File

@@ -70,13 +70,17 @@
/*** SHA-256/384/512 Context Structures *******************************/
#ifdef ISC_PLATFORM_OPENSSLHASH
#if defined(ISC_PLATFORM_OPENSSLHASH)
#include <openssl/opensslv.h>
#include <openssl/evp.h>
#endif
#if defined(ISC_PLATFORM_OPENSSLHASH) && !defined(LIBRESSL_VERSION_NUMBER)
typedef struct {
EVP_MD_CTX *ctx;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX _ctx;
#endif
} isc_sha2_t;

View File

@@ -45,7 +45,7 @@
#include <isc/util.h>
#ifdef ISC_PLATFORM_OPENSSLHASH
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define EVP_MD_CTX_new() &(ctx->_ctx)
#define EVP_MD_CTX_free(ptr) EVP_MD_CTX_cleanup(ptr)
#endif

View File

@@ -39,7 +39,7 @@
#endif
#ifdef ISC_PLATFORM_OPENSSLHASH
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define EVP_MD_CTX_new() &(context->_ctx)
#define EVP_MD_CTX_free(ptr) EVP_MD_CTX_cleanup(ptr)
#endif

View File

@@ -58,7 +58,7 @@
#include <pk11/pk11.h>
#endif
#ifdef ISC_PLATFORM_OPENSSLHASH
#if defined(ISC_PLATFORM_OPENSSLHASH) && !defined(LIBRESSL_VERSION_NUMBER)
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#define EVP_MD_CTX_new() &(context->_ctx)
#define EVP_MD_CTX_free(ptr) EVP_MD_CTX_cleanup(ptr)
@@ -1604,7 +1604,7 @@ isc_sha224_end(isc_sha224_t *context, char buffer[]) {
}
*buffer = (char)0;
} else {
#ifdef ISC_PLATFORM_OPENSSLHASH
#if defined(ISC_PLATFORM_OPENSSLHASH) && !defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX_reset(context->ctx);
#elif PKCS11CRYPTO
pk11_return_session(context);
@@ -1645,7 +1645,7 @@ isc_sha256_end(isc_sha256_t *context, char buffer[]) {
}
*buffer = (char)0;
} else {
#ifdef ISC_PLATFORM_OPENSSLHASH
#if defined(ISC_PLATFORM_OPENSSLHASH) && !defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX_reset(context->ctx);
#elif PKCS11CRYPTO
pk11_return_session(context);
@@ -1686,7 +1686,7 @@ isc_sha512_end(isc_sha512_t *context, char buffer[]) {
}
*buffer = (char)0;
} else {
#ifdef ISC_PLATFORM_OPENSSLHASH
#if defined(ISC_PLATFORM_OPENSSLHASH) && !defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX_reset(context->ctx);
#elif PKCS11CRYPTO
pk11_return_session(context);
@@ -1727,7 +1727,7 @@ isc_sha384_end(isc_sha384_t *context, char buffer[]) {
}
*buffer = (char)0;
} else {
#ifdef ISC_PLATFORM_OPENSSLHASH
#if defined(ISC_PLATFORM_OPENSSLHASH) && !defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX_reset(context->ctx);
#elif PKCS11CRYPTO
pk11_return_session(context);