From 874255c0994fb909faaf632fcca56c245c4dc3a9 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Wed, 5 Sep 2018 11:48:07 +0200 Subject: [PATCH] Redo OPENSSL_VERSION_AT_LEAST check to deal with CPP idiosyncrasies --- libarchive/archive_cryptor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libarchive/archive_cryptor.c b/libarchive/archive_cryptor.c index 5d251f421..ea8ca6a76 100644 --- a/libarchive/archive_cryptor.c +++ b/libarchive/archive_cryptor.c @@ -299,6 +299,10 @@ 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) { @@ -316,7 +320,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 defined(OPENSSL_VERSION_AT_LEAST) && OPENSSL_VERSION_AT_LEAST(1, 1) +#if OPENSSL_VERSION_AT_LEAST(1, 1) if (!EVP_CIPHER_CTX_reset(ctx->ctx)) { EVP_CIPHER_CTX_free(ctx->ctx); ctx->ctx = NULL; -- 2.47.2