]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Check for OPENSSL_VERSION_AT_LEAST before using it.
authorJoerg Sonnenberger <joerg@bec.de>
Tue, 4 Sep 2018 17:56:58 +0000 (19:56 +0200)
committerGrzegorz Antoniak <ga@anadoxin.org>
Sat, 8 Sep 2018 05:22:39 +0000 (07:22 +0200)
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.

libarchive/archive_cryptor.c

index 302cf712ab7883f47c3089cb068a8ab2bf742f7c..5d251f4215c224025570a1b784cd67b94582a9a5 100644 (file)
@@ -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;