From abdce769f16d60e657b47beb3ec855c5d4325bf5 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Wed, 10 Sep 2014 21:52:33 +0900 Subject: [PATCH] Document zip:encryption option. Use 'zipcrypt' insted of 'traditional' for zip:encryption option. --- libarchive/archive_write_set_format_zip.c | 4 +++- libarchive/test/test_write_format_zip.c | 2 +- tar/bsdtar.1 | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c index 607438329..88688cb7e 100644 --- a/libarchive/archive_write_set_format_zip.c +++ b/libarchive/archive_write_set_format_zip.c @@ -278,7 +278,9 @@ archive_write_zip_options(struct archive_write *a, const char *key, if (val == NULL) { zip->encryption_type = ENCRYPTION_NONE; ret = ARCHIVE_OK; - } else if (val[0] == '1' || strcmp(val, "traditional") == 0) { + } else if (val[0] == '1' || strcmp(val, "traditional") == 0 + || strcmp(val, "zipcrypt") == 0 + || strcmp(val, "ZipCrypt") == 0) { if (is_traditional_pkware_encryption_supported()) { zip->encryption_type = ENCRYPTION_TRADITIONAL; ret = ARCHIVE_OK; diff --git a/libarchive/test/test_write_format_zip.c b/libarchive/test/test_write_format_zip.c index c080f6bc8..002d18eec 100644 --- a/libarchive/test/test_write_format_zip.c +++ b/libarchive/test/test_write_format_zip.c @@ -682,7 +682,7 @@ DEFINE_TEST(test_write_format_zip_traditional_pkware_encryption) assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); if (ARCHIVE_OK != archive_write_set_options(a, - "zip:encryption=traditional")) { + "zip:encryption=zipcrypt")) { skipping("This system does not have cryptographic liberary"); archive_write_free(a); return; diff --git a/tar/bsdtar.1 b/tar/bsdtar.1 index 47162e641..4926245e9 100644 --- a/tar/bsdtar.1 +++ b/tar/bsdtar.1 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2014 +.Dd September 10, 2014 .Dt TAR 1 .Os .Sh NAME @@ -547,6 +547,14 @@ Use .Ar type as compression method. Supported values are store (uncompressed) and deflate (gzip algorithm). +.It Cm zip:encryption +Enable encryption using traditional zip encryption. +.It Cm zip:encryption Ns = Ns Ar type +Use +.Ar type +as encryption type. +Supported values are zipcrypt (traditional zip encryption), +aes128 (WinZip AES-128 encryption) and aes256 (WinZip AES-256 encryption). .It Cm read_concatenated_archives Ignore zeroed blocks in the archive, which occurs when multiple tar archives have been concatenated together. Without this option, only the contents of -- 2.47.2