From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 7CF361FA12 for ; Mon, 23 Nov 2020 21:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731224AbgKWVgq (ORCPT ); Mon, 23 Nov 2020 16:36:46 -0500 Received: from cloud.peff.net ([104.130.231.41]:39056 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730902AbgKWVgq (ORCPT ); Mon, 23 Nov 2020 16:36:46 -0500 Received: (qmail 28928 invoked by uid 109); 23 Nov 2020 21:36:46 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Mon, 23 Nov 2020 21:36:46 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 7732 invoked by uid 111); 23 Nov 2020 21:36:45 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Mon, 23 Nov 2020 16:36:45 -0500 Authentication-Results: peff.net; auth=none Date: Mon, 23 Nov 2020 16:36:44 -0500 From: Jeff King To: Junio C Hamano Cc: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , git@vger.kernel.org, "brian m . carlson" , Eric Sunshine , Johannes Schindelin Subject: Re: [PATCH] mktag: don't check SHA-1 object length under SHA-256 Message-ID: References: <20190826014344.16008-11-sandals@crustytoothpaste.net> <20201123120111.13567-1-avarab@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Nov 23, 2020 at 11:01:57AM -0800, Junio C Hamano wrote: > > @@ -58,7 +68,7 @@ static int verify_tag(char *buffer, unsigned long size) > > return error("char%d: does not start with \"object \"", 0); > > > > if (parse_oid_hex(object + 7, &oid, &p)) > > - return error("char%d: could not get SHA1 hash", 7); > > + return error("char%d: expected object ID, got garbage", 7); > > Here you say object ID, which is better than or . Let's > be consistent (I'd say "object name" if I were choosing which to > use). It might just be me, but "object name" makes me think we'd take any name (e.g., a refname that resolves to an object), whereas "object id" would mean the object's hash specifically. And in this instance we only allow the latter. I agree very much with your other comments that if we are changing these, we should get away from completely. -Peff