From c047e21fecbfaafa70d80204f12ef5bb15579909 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Wed, 5 Sep 2018 15:04:12 +0200 Subject: [PATCH] Use plain OPENSSL_VERSION_NUMBER and also block LibreSSL crap. --- libarchive/archive_cryptor.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libarchive/archive_cryptor.c b/libarchive/archive_cryptor.c index ea8ca6a76..52712f77b 100644 --- a/libarchive/archive_cryptor.c +++ b/libarchive/archive_cryptor.c @@ -299,10 +299,6 @@ aes_ctr_release(archive_crypto_ctx *ctx) #elif defined(HAVE_LIBCRYPTO) -#ifndef OPENSSL_VERSION_AT_LEAST -#define OPENSSL_VERSION_AT_LEAST(n, m) 0 -#endif - static int aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len) { @@ -320,7 +316,7 @@ aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len) memcpy(ctx->key, key, key_len); memset(ctx->nonce, 0, sizeof(ctx->nonce)); ctx->encr_pos = AES_BLOCK_SIZE; -#if OPENSSL_VERSION_AT_LEAST(1, 1) +#if OPENSSL_VERSION_NUMBER >= 0x1010000L && !defined(LIBRESSL_VERSION_NUMBER) if (!EVP_CIPHER_CTX_reset(ctx->ctx)) { EVP_CIPHER_CTX_free(ctx->ctx); ctx->ctx = NULL; -- 2.47.2