From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C40DF1FEAA for ; Tue, 19 Jul 2016 17:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753386AbcGSRet (ORCPT ); Tue, 19 Jul 2016 13:34:49 -0400 Received: from lang.hm ([66.167.227.134]:39138 "EHLO bifrost.lang.hm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752951AbcGSRes (ORCPT ); Tue, 19 Jul 2016 13:34:48 -0400 Received: from asgard.lang.hm (asgard.lang.hm [10.0.0.100]) by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id u6JHYY8L011651; Tue, 19 Jul 2016 10:34:34 -0700 Date: Tue, 19 Jul 2016 10:34:34 -0700 (PDT) From: David Lang X-X-Sender: dlang@asgard.lang.hm To: Duy Nguyen cc: Johannes Schindelin , Herczeg Zsolt , "brian m. carlson" , "Theodore Ts'o" , Git Mailing List Subject: Re: Git and SHA-1 security (again) In-Reply-To: Message-ID: References: <20160716201313.GA298717@vauxhall.crustytoothpaste.net> <20160717142157.GA6644@vauxhall.crustytoothpaste.net> <20160717154234.GC6644@vauxhall.crustytoothpaste.net> <20160717162349.GB11276@thunk.org> <20160717220417.GE6644@vauxhall.crustytoothpaste.net> <1468804249.2037.0@smtp.gmail.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, 19 Jul 2016, Duy Nguyen wrote: > On Tue, Jul 19, 2016 at 9:18 AM, Johannes Schindelin > wrote: >>> But we can recreate SHA-1 from the same content and verify GPG, right? >>> I know it's super expensive, but it feels safer to not carry SHA-1 >>> around when it's not secure anymore (I recall something about >>> exploiting the weakest link when you have both sha1 and sha256 in the >>> object content). Rehashing would be done locally and is better >>> controlled. >> >> You could. But how would you determine whether to recreate the commit >> object from a SHA-1-ified version of the commit buffer? Fall back if the >> original did not match the signature? > > Any repo would have a cut point when they move to sha256 (or whatever > new hash), if we can record this somewhere (e.g. as a tag or a bunch > of tags, or some dummy commits to mark the heads of the repo) then we > only verify gpg signatures _in_ the repository before this point. remember that a repo doesn't have a single 'now', each branch has it's own head, and you can easily go back to prior points and branch off from there. Since timestamps in repos can't be trusted (different people's clocks may not be in sync), how would you define this cutoff point? David Lang