From: Joerg Sonnenberger Date: Tue, 4 Sep 2018 17:56:58 +0000 (+0200) Subject: Check for OPENSSL_VERSION_AT_LEAST before using it. X-Git-Tag: v3.4.0~175^2~6^2^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61d258321a2c15f023dab782df9a2f677e56e23f;p=thirdparty%2Flibarchive.git Check for OPENSSL_VERSION_AT_LEAST before using it. As all useful things in the OpenSSL API, it is too new to be used unconditionally. Ignore OpenSSL 1.1.0 compat for now until someone complains. --- diff --git a/libarchive/archive_cryptor.c b/libarchive/archive_cryptor.c index 302cf712a..5d251f421 100644 --- a/libarchive/archive_cryptor.c +++ b/libarchive/archive_cryptor.c @@ -316,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 defined(OPENSSL_VERSION_AT_LEAST) && OPENSSL_VERSION_AT_LEAST(1, 1) if (!EVP_CIPHER_CTX_reset(ctx->ctx)) { EVP_CIPHER_CTX_free(ctx->ctx); ctx->ctx = NULL;