From nobody Sat Aug 5 19:17:02 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RJC4t6N1Bz4mQxg; Sat, 5 Aug 2023 19:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RJC4t58llz3BnF; Sat, 5 Aug 2023 19:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691263022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TqEEAXC+E/8cXTjUZaflbUgiotr4cYxhgaOVlejNf8k=; b=TkJmeZFnHYUBJnsI5eGqblysFg7tnK0vL44ZYYbwbenXyUi4e8+lmoJzWmuYv8dV96N0sF EFqVzPVEeKOm9Lyk87nw1X9d0wf3mAeoPxn3z0HtnoNv6bZ7XghrzbaQBmtm4Rk8o9QsgV kDYIaLvTSM5C2Iz4EHGBavlhwUOBgD0BfTjUkaPY2noWAJaWioOXYD0utlTpdTuOBwzSgp igiPxZZFCXpdD7Kp67BAV8jopqaQo9pXVO3cN40RM7E0UP+PTAFp13QLLrYLD8cw2rwCvr b61JQf0NCD/PXUsJzmfd/UHPCJ5WSGUG+oZGn7YyIFxEFX3M6FyIW+x0mZblEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691263022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TqEEAXC+E/8cXTjUZaflbUgiotr4cYxhgaOVlejNf8k=; b=RSy2QGryBgXwt40tzFvGgeaMcShUd6EJkkrVLe324+xge9L/KDGyE0cg/d9NZLPKq1W77u 0JKdqWkqZQIl8Zv+XvgVuHq86GN+E35OiOSeHzqMAwcrnJufsbUdWTaqI9fZAc89hShgJX M480XbtA3wZqZuTNwVHZIXDQE3lKq9dlTlB9mAtDs+Vv5rvZG/UW2Nc+/0ui+x+KR1z1ON 8qtmyrG3T0BIKL9PL5S8F5C83K/kVb2JS98s53xTPZ6A2pxBwjkoA2iN2htqwPOOSAdjvR 4o0wEznWnLcsGUSdO28rP7+eXh073E+q1mQScT2OMTjgRLsDEVpplTbUz91eWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691263022; a=rsa-sha256; cv=none; b=Emj1akqvwt0EayahXZbATArza+k6e8aiPjGWMSdzXPoBOgRaCwaG9+6Y6Bio0vIOW+Q/Fq zIH20eO74/bSgZQ6lFiRtmWd/LCe75JNCcIktrWalzW4x7g2qzio96qNax35JvzbIgWMLO ox0p42jZkws6erWT9Kx5IkNRoYzr3Nmeh/xlfW5jPnmlJ2VP3e6Ose/bHFqmwwu6wYKDE0 C22h0Zfu9RG2ZpciUJlFRPmunj0n8qUXgKHBs3c6b3LM/DcQDngT07FknxBReig4xKeJ8E 1ailYzG3QGwgS/tP6zzKeHP2QqXERtU6+GhzjV1EazgvtFVByQlZAAt58b6OiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RJC4t4C76zh2C; Sat, 5 Aug 2023 19:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 375JH2FD010604; Sat, 5 Aug 2023 19:17:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 375JH2pZ010603; Sat, 5 Aug 2023 19:17:02 GMT (envelope-from git) Date: Sat, 5 Aug 2023 19:17:02 GMT Message-Id: <202308051917.375JH2pZ010603@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Daniel Engberg Subject: git: 45c9ee77bf78 - main - security/fcrackzip: Switch to fork that utilizes libzip List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: diizzy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45c9ee77bf78aec4c4f078dffab74ae6555186ae Auto-Submitted: auto-generated The branch main has been updated by diizzy: URL: https://cgit.FreeBSD.org/ports/commit/?id=45c9ee77bf78aec4c4f078dffab74ae6555186ae commit 45c9ee77bf78aec4c4f078dffab74ae6555186ae Author: Daniel Engberg AuthorDate: 2023-08-05 19:12:30 +0000 Commit: Daniel Engberg CommitDate: 2023-08-05 19:16:15 +0000 security/fcrackzip: Switch to fork that utilizes libzip Instead of launching unzip external for each try utilize libzip for much better performance PR: 272700 Approved by: bofh (private conversation) --- security/fcrackzip/Makefile | 20 +++-- security/fcrackzip/distinfo | 5 +- security/fcrackzip/files/patch-crack.h | 10 --- security/fcrackzip/files/patch-fcrackzip.1 | 22 +++++ security/fcrackzip/files/patch-main.c | 134 ++++------------------------- 5 files changed, 58 insertions(+), 133 deletions(-) diff --git a/security/fcrackzip/Makefile b/security/fcrackzip/Makefile index c41f661c60d7..0f71e54f7748 100644 --- a/security/fcrackzip/Makefile +++ b/security/fcrackzip/Makefile @@ -1,20 +1,28 @@ PORTNAME= fcrackzip -PORTVERSION= 1.0 -PORTREVISION= 1 +DISTVERSION= 1.0 +PORTREVISION= 2 CATEGORIES= security archivers -MASTER_SITES= http://oldhome.schmorp.de/data/marc/ \ - http://distfiles.macports.org/${PORTNAME}/ MAINTAINER= bofh@FreeBSD.org COMMENT= Portable, fast, and featureful ZIP password cracker WWW= http://home.schmorp.de/marc/fcrackzip.html LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING -GNU_CONFIGURE= yes -USES= perl5 +LIB_DEPENDS= libzip.so:archivers/libzip + +USES= perl5 localbase:ldflags USE_PERL5= build +USE_GITHUB= yes +GH_ACCOUNT= hyc +GH_TAGNAME= c713631 + +GNU_CONFIGURE= yes + +LDFLAGS+= -lzip + PLIST_FILES= bin/fcrackzip bin/fcrackzipinfo man/man1/fcrackzip.1.gz post-patch: diff --git a/security/fcrackzip/distinfo b/security/fcrackzip/distinfo index aef6067f472c..4846a5c46a35 100644 --- a/security/fcrackzip/distinfo +++ b/security/fcrackzip/distinfo @@ -1,2 +1,3 @@ -SHA256 (fcrackzip-1.0.tar.gz) = 4a58c8cb98177514ba17ee30d28d4927918bf0bdc3c94d260adfee44d2d43850 -SIZE (fcrackzip-1.0.tar.gz) = 114786 +TIMESTAMP = 1690148443 +SHA256 (hyc-fcrackzip-1.0-c713631_GH0.tar.gz) = c416e8a112287d0c68c7edfb049d54a979ab9897b45d3647e0296406bf959765 +SIZE (hyc-fcrackzip-1.0-c713631_GH0.tar.gz) = 110021 diff --git a/security/fcrackzip/files/patch-crack.h b/security/fcrackzip/files/patch-crack.h deleted file mode 100644 index 9416816bcf4d..000000000000 --- a/security/fcrackzip/files/patch-crack.h +++ /dev/null @@ -1,10 +0,0 @@ ---- crack.h.orig 2000-06-18 23:19:07 UTC -+++ crack.h -@@ -24,7 +24,6 @@ extern u8 bf_next[256]; - extern u8 bf_last; - - extern int verbosity; --extern int use_unzip; - - #define FILE_SIZE 12 - #define CRC_SIZE 2 diff --git a/security/fcrackzip/files/patch-fcrackzip.1 b/security/fcrackzip/files/patch-fcrackzip.1 new file mode 100644 index 000000000000..f2b7403528eb --- /dev/null +++ b/security/fcrackzip/files/patch-fcrackzip.1 @@ -0,0 +1,22 @@ +--- fcrackzip.1.orig 2023-07-24 19:25:07 UTC ++++ fcrackzip.1 +@@ -6,7 +6,7 @@ + .B fcrackzip + [-bDBchVvplum2] [--brute-force] [--dictionary] [--benchmark] [--charset characterset] + [--help] [--validate] [--verbose] [--init-password string/path] [--length min-max] +-[--use-unzip] [--method name] [--modulo r/m] file... ++[--use-libzip] [--method name] [--modulo r/m] file... + .SH DESCRIPTION + .I fcrackzip + searches each zipfile given for encrypted files and tries to guess the +@@ -57,8 +57,8 @@ Use an initial password of length min, and check all p + upto passwords of length max (including). You can omit the max + parameter. + .TP +-.B \-u, \--use-unzip +-Try to decompress the first file by calling unzip with the guessed ++.B \-u, \--use-libzip ++Try to decompress the first file by calling libzip with the guessed + password. This weeds out false positives when not enough files have + been given. + .TP diff --git a/security/fcrackzip/files/patch-main.c b/security/fcrackzip/files/patch-main.c index b3b7e34f949d..c40fbf9eb508 100644 --- a/security/fcrackzip/files/patch-main.c +++ b/security/fcrackzip/files/patch-main.c @@ -1,116 +1,20 @@ ---- main.c.orig 2005-09-10 19:58:44 UTC +--- main.c.orig 2023-07-24 19:20:45 UTC +++ main.c -@@ -44,13 +44,112 @@ static int modul = 1; - - static FILE *dict_file; - -+char * -+path_for_shell (char *dest, const char *str) -+{ -+ /* backslash shell special charatcers */ -+ -+ char ch, *p = dest; -+ size_t len = strlen(str); -+ int i; -+ -+ for (i = 0; i < len; i++) -+ { -+ ch = str[i]; -+ -+ switch (ch) -+ { -+ /* ASCII table order */ -+ case 0x20: /* space */ -+ case '!': -+ case '"': -+ case '#': -+ case '$': -+ case '&': -+ case 0x27: /* single quote */ -+ case '(': -+ case ')': -+ case '*': -+ case '+': -+ case 0x2C: /* comma */ -+ case ':': -+ case ';': -+ case '<': -+ case '>': -+ case '?': -+ case '[': -+ case '\\': -+ case ']': -+ case '^': -+ case '`': -+ case '{': -+ case '|': -+ case '}': -+ case '~': -+ /* backslash special characters */ -+ *p++ = '\\'; -+ *p++ = ch; -+ break; -+ default: -+ *p++ = ch; -+ } -+ } -+ -+ /* terminate string */ -+ *p = '\0'; -+ -+ return dest; -+} -+ -+char * -+escape_pw (char *dest, const char *str) -+{ -+ /* backslash shell special charatcers */ -+ -+ char ch, *p = dest; -+ size_t len = strlen(str); -+ int i; -+ -+ for (i = 0; i < len; i++) -+ { -+ ch = str[i]; -+ -+ switch (ch) -+ { -+ /* ASCII table order */ -+ case '"': -+ case '$': -+ case 0x27: /* single quote */ -+ case '\\': -+ case '`': -+ /* backslash special characters */ -+ *p++ = '\\'; -+ *p++ = ch; -+ break; -+ default: -+ *p++ = ch; -+ } -+ } -+ -+ /* terminate string */ -+ *p = '\0'; -+ -+ return dest; -+} -+ - int REGPARAM - check_unzip (const char *pw) - { - char buff[1024]; -+ char path[1024]; -+ char escpw[256]; - int status; - -- sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, pw, file_path[0]); -+ escape_pw (escpw, pw); -+ path_for_shell (path, file_path[0]); -+ -+ sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, escpw, path); -+ - status = system (buff); - - #undef REDIR +@@ -351,7 +351,7 @@ usage (int ec) + " [-v|--verbose] be more verbose\n" + " [-p|--init-password string] use string as initial password/file\n" + " [-l|--length min-max] check password with length min to max\n" +- " [-u|--use-unzip] use unzip to weed out wrong passwords\n" ++ " [-u|--use-libzip] use libzip to weed out wrong passwords\n" + " [-m|--method num] use method number \"num\" (see below)\n" + " [-2|--modulo r/m] only calculcate 1/m of the password\n" + " file... the zipfiles to crack\n" +@@ -381,7 +381,7 @@ static struct option options[] = + {"verbose", no_argument, 0, 'v'}, + {"init-password", required_argument, 0, 'p'}, + {"length", required_argument, 0, 'l'}, +- {"use-unzip", no_argument, 0, 'u'}, ++ {"use-libzip", no_argument, 0, 'u'}, + {"method", required_argument, 0, 'm'}, + {"modulo", required_argument, 0, 2}, + {0, 0, 0, 0},