]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Use plain OPENSSL_VERSION_NUMBER and also block LibreSSL crap.
authorJoerg Sonnenberger <joerg@bec.de>
Wed, 5 Sep 2018 13:04:12 +0000 (15:04 +0200)
committerJoerg Sonnenberger <joerg@bec.de>
Wed, 5 Sep 2018 13:04:12 +0000 (15:04 +0200)
libarchive/archive_cryptor.c

index ea8ca6a76935570c4bc19be6e2c635e741d5337e..52712f77b93bcc2e021b5afae30bf05a4aceb2a3 100644 (file)
@@ -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;