From: Michihiro NAKAJIMA Date: Tue, 14 Oct 2014 11:41:51 +0000 (+0900) Subject: Fix build failure without cryptography library. X-Git-Tag: v3.1.900a~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6838f150f9168845a97e37a0bb640c2b15902d3a;p=thirdparty%2Flibarchive.git Fix build failure without cryptography library. --- diff --git a/libarchive/archive_cryptor.c b/libarchive/archive_cryptor.c index 94dce5ace..c4db96bc1 100644 --- a/libarchive/archive_cryptor.c +++ b/libarchive/archive_cryptor.c @@ -329,6 +329,7 @@ aes_ctr_release(archive_crypto_ctx *ctx) #else +#define ARCHIVE_CRYPTOR_STUB /* Stub */ static int aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len) @@ -355,6 +356,20 @@ aes_ctr_release(archive_crypto_ctx *ctx) #endif +#ifdef ARCHIVE_CRYPTOR_STUB +static int +aes_ctr_update(archive_crypto_ctx *ctx, const uint8_t * const in, + size_t in_len, uint8_t * const out, size_t *out_len) +{ + (void)ctx; /* UNUSED */ + (void)in; /* UNUSED */ + (void)in_len; /* UNUSED */ + (void)out; /* UNUSED */ + (void)out_len; /* UNUSED */ + return -1; +} + +#else static void aes_ctr_increase_counter(archive_crypto_ctx *ctx) { @@ -401,6 +416,7 @@ aes_ctr_update(archive_crypto_ctx *ctx, const uint8_t * const in, return 0; } +#endif /* ARCHIVE_CRYPTOR_STUB */ const struct archive_cryptor __archive_cryptor = diff --git a/libarchive/archive_cryptor_private.h b/libarchive/archive_cryptor_private.h index 88c208db6..e1118ff80 100644 --- a/libarchive/archive_cryptor_private.h +++ b/libarchive/archive_cryptor_private.h @@ -92,6 +92,8 @@ typedef struct { #else +#define AES_BLOCK_SIZE 16 +#define AES_MAX_KEY_SIZE 32 typedef int archive_crypto_ctx; #endif