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

--enable-openssl-hash. [RT #45982]

(cherry picked from commit c75e9c7630)
This commit is contained in:
Mark Andrews 2017-09-12 14:19:10 +10:00
parent f39894c0b1
commit 22bed621ef
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]
4712. [bug] "dig +domain" and "dig +search" didn't retain the
search domain when retrying with TCP. [RT #45547]

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

@ -34,7 +34,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

@ -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

@ -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

@ -41,7 +41,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

@ -60,7 +60,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)
@ -1606,7 +1606,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);
@ -1647,7 +1647,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);
@ -1688,7 +1688,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);
@ -1729,7 +1729,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);