From: Joerg Sonnenberger Date: Wed, 5 Sep 2018 09:48:07 +0000 (+0200) Subject: Redo OPENSSL_VERSION_AT_LEAST check to deal with CPP idiosyncrasies X-Git-Tag: v3.4.0~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b605eb638e7f6f6a446bbeb1cc522b1b1299f70;p=thirdparty%2Flibarchive.git Redo OPENSSL_VERSION_AT_LEAST check to deal with CPP idiosyncrasies --- 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;