diff options
Diffstat (limited to 'archivers/libarchive/files/libarchive/archive_cryptor.c')
-rw-r--r-- | archivers/libarchive/files/libarchive/archive_cryptor.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/archivers/libarchive/files/libarchive/archive_cryptor.c b/archivers/libarchive/files/libarchive/archive_cryptor.c index 71967c9d46f..74df5c405b0 100644 --- a/archivers/libarchive/files/libarchive/archive_cryptor.c +++ b/archivers/libarchive/files/libarchive/archive_cryptor.c @@ -316,7 +316,14 @@ 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_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + if (!EVP_CIPHER_CTX_reset(ctx->ctx)) { + EVP_CIPHER_CTX_free(ctx->ctx); + ctx->ctx = NULL; + } +#else EVP_CIPHER_CTX_init(ctx->ctx); +#endif return 0; } |