From patchwork Tue Jun 23 15:36:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 22836 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BC3EB27BBE3; Tue, 23 Jun 2020 16:37:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 4C0FC27BBE1 for ; Tue, 23 Jun 2020 16:37:09 +0100 (BST) Received: from localhost ([::1]:43630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkyy-00015c-N1 for patchwork@mira.cbaines.net; Tue, 23 Jun 2020 11:37:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnkys-00013V-4L for guix-patches@gnu.org; Tue, 23 Jun 2020 11:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnkyr-0005Yt-QO for guix-patches@gnu.org; Tue, 23 Jun 2020 11:37:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jnkyr-0006pn-NR for guix-patches@gnu.org; Tue, 23 Jun 2020 11:37:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42020] [PATCH 0/4] Add daemon support for SHA3 and BLAKE2s Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Jun 2020 15:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42020 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42020@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159292661026250 (code B ref -1); Tue, 23 Jun 2020 15:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jun 2020 15:36:50 +0000 Received: from localhost ([127.0.0.1]:36970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnkyc-0006pE-5F for submit@debbugs.gnu.org; Tue, 23 Jun 2020 11:36:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:41520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnkyX-0006p2-EA for submit@debbugs.gnu.org; Tue, 23 Jun 2020 11:36:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnkyX-0000l3-6q for guix-patches@gnu.org; Tue, 23 Jun 2020 11:36:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35589) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnkyW-0005EV-5o; Tue, 23 Jun 2020 11:36:40 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57334 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jnkyV-0004ZF-Bd; Tue, 23 Jun 2020 11:36:39 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Tue, 23 Jun 2020 17:36:33 +0200 Message-Id: <20200623153633.15346-1-ludo@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello! This is a followup to: https://issues.guix.gnu.org/41382 This patch series adds daemon support for a few more cryptographic hash functions, for use by fixed-output derivations (origins) and the likes. We should wait for a year or so before using those algorithms in package definitions so we can assume that the new daemon is widespread. Note that there are still places where SHA256 is hard-coded. For instance, the ‘query-path-hash’ RPC always returns a SHA256 hash. Internally, the ‘ValidPaths’ table of the database can store any hash, but in practice it only ever contains a SHA256 hash (see ‘LocalStore::addValidPath’ and (guix store database)). Feedback welcome! Ludo’. Ludovic Courtès (4): daemon: Map directly to gcrypt hash functions. daemon: Remove OpenSSL hash compatibility wrappers. daemon: Recognize SHA3 and BLAKE2s. packages: Recognize SHA3 and BLAKE2s for 'content-hash'. guix/packages.scm | 5 ++- nix/libutil/gcrypt-hash.cc | 51 ----------------------------- nix/libutil/gcrypt-hash.hh | 50 ---------------------------- nix/libutil/hash.cc | 67 +++++++++++++++++++------------------- nix/libutil/hash.hh | 20 +++++++----- nix/libutil/md5.h | 35 -------------------- nix/libutil/sha1.h | 35 -------------------- nix/libutil/sha256.h | 35 -------------------- nix/libutil/sha512.h | 35 -------------------- nix/local.mk | 12 ++----- tests/packages.scm | 26 +++++++++++++++ tests/store.scm | 4 +-- 12 files changed, 80 insertions(+), 295 deletions(-) delete mode 100644 nix/libutil/gcrypt-hash.cc delete mode 100644 nix/libutil/gcrypt-hash.hh delete mode 100644 nix/libutil/md5.h delete mode 100644 nix/libutil/sha1.h delete mode 100644 nix/libutil/sha256.h delete mode 100644 nix/libutil/sha512.h