From patchwork Mon May 18 21:31:16 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: 22194 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 79FA827BBE3; Mon, 18 May 2020 22:32:20 +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 464F627BBE1 for ; Mon, 18 May 2020 22:32:20 +0100 (BST) Received: from localhost ([::1]:53044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1janMw-0007JO-OG for patchwork@mira.cbaines.net; Mon, 18 May 2020 17:32:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1janMg-0007Iy-6u for guix-patches@gnu.org; Mon, 18 May 2020 17:32:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1janMf-0000Lk-TU for guix-patches@gnu.org; Mon, 18 May 2020 17:32:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1janMf-0001Vq-QX for guix-patches@gnu.org; Mon, 18 May 2020 17:32:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41382] [PATCH 0/6] Allow for a cryptographic hash function migration Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 May 2020 21:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41382 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41382@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.15898374905775 (code B ref -1); Mon, 18 May 2020 21:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 May 2020 21:31:30 +0000 Received: from localhost ([127.0.0.1]:48448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1janMA-0001V5-7y for submit@debbugs.gnu.org; Mon, 18 May 2020 17:31:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:51708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1janM8-0001Uw-19 for submit@debbugs.gnu.org; Mon, 18 May 2020 17:31:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1janM7-00076f-QQ for guix-patches@gnu.org; Mon, 18 May 2020 17:31:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37535) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1janM7-0000HA-0d; Mon, 18 May 2020 17:31:27 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=50956 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1janM5-0003IX-WC; Mon, 18 May 2020 17:31:26 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 18 May 2020 23:31:16 +0200 Message-Id: <20200518213116.23978-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 Guix! This is a first stab at preparing for a possible migration to hash algorithms other than SHA256 (there’s no rush AFAIK, but it’s good to be prepared). The first bits just improve tests and adjust the tools, which doesn’t hurt. The last bit adds a ‘sha512’ field to , which we could eventually provide instead of or in addition to ‘sha256’, possibly as a base64-encoded string so that it’s not too large. Another option would be to create a data type that specifies its algorithm and its value. We’d replace the ‘sha256’ field with a ‘hash’ field of that type (in a backward-compatible way). Thinking about it, this is perhaps the better option. Other bits that would need to be adjusted include importer, updaters, and ‘guix publish’. Thoughts? Ludo’. Ludovic Courtès (6): tests: Test 'add-to-store' with several hash algorithms. tests: Test fixed-output derivations with several hash algorithms. guix hash, guix download: Add '--hash'. guix hash, guix download: Support base64 format. packages: Add 'sha512' optional field to . packages: Add 'base64' macro. doc/guix.texi | 25 +++++++++++++++-- guix/packages.scm | 56 +++++++++++++++++++++++---------------- guix/scripts/download.scm | 26 +++++++++++++----- guix/scripts/hash.scm | 35 +++++++++++++++++------- tests/derivations.scm | 39 ++++++++++++++++----------- tests/guix-hash.sh | 7 ++++- tests/packages.scm | 26 ++++++++++++++++++ tests/store.scm | 12 +++++++++ 8 files changed, 170 insertions(+), 56 deletions(-)