aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_cryptor_private.h
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2020-01-05 01:30:41 +0000
committerMartin Matuska <mm@FreeBSD.org>2020-01-05 01:30:41 +0000
commitcbda686f2407316625c3baf89f5071f0118f030b (patch)
tree5a88a6e999fa83c9d6d22bf940b1483e6f99cd4f /libarchive/archive_cryptor_private.h
parentba770b4e70af88f6bd27e13d9966e865400ebd1a (diff)
downloadsrc-cbda686f2407316625c3baf89f5071f0118f030b.tar.gz
src-cbda686f2407316625c3baf89f5071f0118f030b.zip
Update vendor/libarchive/dist to git 5e270715b51d199467195b56f77e21cb8bb1d642
Relevant vendor changes: Issue #1302: Plug memory leak on failure of archive_write_client_open()
Notes
Notes: svn path=/vendor/libarchive/dist/; revision=356365
Diffstat (limited to 'libarchive/archive_cryptor_private.h')
-rw-r--r--libarchive/archive_cryptor_private.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libarchive/archive_cryptor_private.h b/libarchive/archive_cryptor_private.h
index b9759220df69..0063f3e00149 100644
--- a/libarchive/archive_cryptor_private.h
+++ b/libarchive/archive_cryptor_private.h
@@ -83,6 +83,23 @@ typedef struct {
unsigned encr_pos;
} archive_crypto_ctx;
+#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_AES_H)
+#include <mbedtls/aes.h>
+#include <mbedtls/md.h>
+#include <mbedtls/pkcs5.h>
+
+#define AES_MAX_KEY_SIZE 32
+#define AES_BLOCK_SIZE 16
+
+typedef struct {
+ mbedtls_aes_context ctx;
+ uint8_t key[AES_MAX_KEY_SIZE];
+ unsigned key_len;
+ uint8_t nonce[AES_BLOCK_SIZE];
+ uint8_t encr_buf[AES_BLOCK_SIZE];
+ unsigned encr_pos;
+} archive_crypto_ctx;
+
#elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_AES_H)
#if defined(HAVE_NETTLE_PBKDF2_H)
#include <nettle/pbkdf2.h>