From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:56642) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFNP9-0002J8-7H for guix-patches@gnu.org; Fri, 20 Mar 2020 15:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFNP8-0006hV-0i for guix-patches@gnu.org; Fri, 20 Mar 2020 15:34:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFNP7-0006hN-Tc for guix-patches@gnu.org; Fri, 20 Mar 2020 15:34:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jFNP7-00082s-PZ for guix-patches@gnu.org; Fri, 20 Mar 2020 15:34:01 -0400 Subject: [bug#40154] [PATCH] gnu: Add hash-extender. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:56528) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFNOJ-0002Bo-0u for guix-patches@gnu.org; Fri, 20 Mar 2020 15:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFNOH-0006dd-Nk for guix-patches@gnu.org; Fri, 20 Mar 2020 15:33:10 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:45492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jFNOH-0006bn-EV for guix-patches@gnu.org; Fri, 20 Mar 2020 15:33:09 -0400 From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Date: Fri, 20 Mar 2020 20:32:49 +0100 Message-Id: <20200320193250.31290-1-kuba@kadziolka.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 40154@debbugs.gnu.org * gnu/packages/crypto.scm (hash-extender): New variable. --- gnu/packages/crypto.scm | 39 +++++++++++++++++++ .../patches/hash-extender-test-suite.patch | 12 ++++++ 2 files changed, 51 insertions(+) create mode 100644 gnu/packages/patches/hash-extender-test-suite.patch diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm index b808211b2d..9aa9a73503 100644 --- a/gnu/packages/crypto.scm +++ b/gnu/packages/crypto.scm @@ -1072,3 +1072,42 @@ cryptographic ratchet. It is written in C and C++11, and exposed as a C API.") (home-page "https://matrix.org/docs/projects/other/olm/") (license license:asl2.0))) + +(define-public hash-extender + (let ((commit "9ecef26809a1ceea2a455f6f591b004298df551b") + (revision "1")) + (package + (name "hash-extender") + (version (git-version "0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/iagox86/hash_extender") + (commit commit))) + (sha256 + (base32 + "0fqy3d559zgf71w39py0931d8na0ylils45r8zs6r79wgr6qn78c")) + (file-name (git-file-name name version)) + (patches + (search-patches "hash-extender-test-suite.patch")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'check + (lambda _ + (invoke "./hash_extender_test"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((outdir (assoc-ref outputs "out")) + (bindir (string-append outdir "/bin"))) + (install-file "hash_extender" bindir))))))) + (inputs + `(("openssl" ,openssl))) + (synopsis "Tool for hash length extension attacks") + (description "@command{hash_extender} is a utility for performing hash +length extension attacks supporting MD4, MD5, RIPEMD-160, SHA-0, SHA-1, +SHA-256, SHA-512, and WHIRLPOOL hashes.") + (home-page "https://github.com/iagox86/hash_extender") + (license license:bsd-3)))) diff --git a/gnu/packages/patches/hash-extender-test-suite.patch b/gnu/packages/patches/hash-extender-test-suite.patch new file mode 100644 index 0000000000..a3e6218944 --- /dev/null +++ b/gnu/packages/patches/hash-extender-test-suite.patch @@ -0,0 +1,12 @@ +Make the test suite exit with a non-zero exit code if some tests failed. +--- a/test.c ++++ b/test.c +@@ -79,5 +79,9 @@ void test_report(void) + printf("TESTS PASSED: %d / %d [%2.4f%%]\n", tests_passed, tests_run, 100 * (float)tests_passed / tests_run); + printf("--------------------------------------------------------------------------------\n"); + } ++ ++ if (tests_passed != tests_run) { ++ exit(1); ++ } + } -- 2.25.1