From: Joerg Sonnenberger Date: Wed, 5 Sep 2018 13:04:12 +0000 (+0200) Subject: Use plain OPENSSL_VERSION_NUMBER and also block LibreSSL crap. X-Git-Tag: v3.4.0~185 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c047e21fecbfaafa70d80204f12ef5bb15579909;p=thirdparty%2Flibarchive.git Use plain OPENSSL_VERSION_NUMBER and also block LibreSSL crap. --- 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;