]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix build failure without cryptography library.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 14 Oct 2014 11:41:51 +0000 (20:41 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 14 Oct 2014 11:41:51 +0000 (20:41 +0900)
libarchive/archive_cryptor.c
libarchive/archive_cryptor_private.h

index 94dce5ace143092b9f7213cea6361be8dbe6a1f0..c4db96bc1efdd2e66a7b70a05648af803caf1159 100644 (file)
@@ -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 =
index 88c208db64de1c67bd23c2ee5e44a47bb6341119..e1118ff8064e6aad43ca4aa148c880b91f976a6a 100644 (file)
@@ -92,6 +92,8 @@ typedef struct {
 
 #else
 
+#define AES_BLOCK_SIZE 16
+#define AES_MAX_KEY_SIZE 32
 typedef int archive_crypto_ctx;
 
 #endif