Article View: linux.kernel.git
Article #2771Re: [PATCH v1] hash: handle invalid algorithms when formatting object IDs
From: "brian m. carlson"
Date: Mon, 09 Nov 2026 22:45
Date: Mon, 09 Nov 2026 22:45
55 lines
11327 bytes
11327 bytes
--Q5WZUlnk+C8FYX4l Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2026-11-07 at 20:22:01, Tanga Joris wrote: > Hi brian, Hey, > > This is not a valid configuration. I have a patch on my sha256-interop > > branch, 5b208e4a3d34ffba0fbeafe991643d6d47a5caa0, that should make the > > members not public. It depends partially on things other in that > > series, but it should be fine to drop those pieces if you want to pick > > that up and send it in. > > > > If you pass the structure from C, it's intended that it panics if algo > > is zero. That's because we don't want to rely on the behaviour of > > depending on a mutable global in Rust, since that's unsafe and leads to > > action at a distance. We really should just drop that fallback and fix > > all of the relevant callers at some point. >=20 > That makes sense. I didn't know algo 0 coming from C is meant to > panic in Rust, rather than depend on the default hash. >=20 > Since this is shrimech's thread, I think shrimech could pick up > 5b208e4a3d (making the ObjectID members private), and I'd be happy > to review it. >=20 > Could you also push 5b208e4a3d somewhere public? I could not fetch > it from https://github.com/bk2204/git, whose sha256-interop branch > seems to have an older version (c38d0c8475, "rust: don't expose the > internals of ObjectID"). That would make it easier for shrimech to > pick up. Yeah, it's in the history of the temp-sha256-interop branch there. --=20 brian m. carlson (they/them) Toronto, Ontario, CA Speaking for myself only --Q5WZUlnk+C8FYX4l Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- wr0EABYKAG8FgmryTR0JEHwMSWKIh6KBRxQAAAAAAB4AIHNhbHRAbm90YXRpb25z LnNlcXVvaWEtcGdwLm9yZ0MR33g2aciBEV/aANhrvsKBnP+aXGsTwdEXORlfklpI FiEECCzmip28ZfuD0cORfAxJYoiHooEAALC9AQDlNYSSSwBNaXk2SR/sEClopVcY 6NLJlaNfsBG7JEO72QD/XSGlI95FZPqjpLnJog1Wr6LjoU2ZsMBfk3Tnd0JU7A8= =ifLQ -----END PGP SIGNATURE----- --Q5WZUlnk+C8FYX4l--
Technical Details
Message-ID:
<avJNHSZLiZVffCjJ@fruit.crustytoothpaste.net>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-74996-linux-kernel-git=dewy.ruReferences:
<20261103043756.61627-1-eddinen77@gmail.com> <CAKrRMNrLvPck5psPpKX1eWe26To5srfFSLFObZ4zTX09RE551w@mail.gmail.com> <au0ZOsuyo0YYyZsa@fruit.crustytoothpaste.net> <CAKrRMNqBCiH06xsre-YafBJiqPTiBgPnNZ3xPrhjTQWU3czwHg@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-74996-linux-kernel-git=dewy.ru
From: sandals@crustytoothpaste.net ("brian m. carlson")
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v1] hash: handle invalid algorithms when formatting
object IDs
Date: Mon, 9 Nov 2026 22:45:49 +0000
Organization: Usenet Network
Message-ID: <avJNHSZLiZVffCjJ@fruit.crustytoothpaste.net>
References: <20261103043756.61627-1-eddinen77@gmail.com>
<CAKrRMNrLvPck5psPpKX1eWe26To5srfFSLFObZ4zTX09RE551w@mail.gmail.com>
<au0ZOsuyo0YYyZsa@fruit.crustytoothpaste.net>
<CAKrRMNqBCiH06xsre-YafBJiqPTiBgPnNZ3xPrhjTQWU3czwHg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="Q5WZUlnk+C8FYX4l"
Injection-Info: usenet.network;
logging-data="466840"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:PzsVhVPNzplbkYL4QXNJzKXD3BQ= sha256:yyW2E01AAR2mKLjX37uiltm9q8Tuqt/1JLjWcvGubEs=
sha1:xDvAZocnPIO/eYIvk8L5Pmw7uzw= sha256:KIrkAKGM852NfeaZSSt35pm4MGtxMak7a/RRBYfXj6Y=
Content-Disposition: inline
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 59D4711395E; Tue, 10 Nov 2026 01:46:21 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (3072-bit key)
header.d=crustytoothpaste.net
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id mZXi2MdYJELE;
Tue, 10 Nov 2026 01:46:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=git+bounces-74996-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=crustytoothpaste.net
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id 179A9113924; Tue, 10 Nov 2026 01:46:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id DF50A60EABA; Mon, 9 Nov 2026 22:45:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1794264353;
b=YVXXvfuTOtKfwlGSQY8btzke4RE72TQ0Yz6wQP0XdKmGi5m+Uk+eqw9iIoPMS4/2Yoer
/mELebNCFc52JG0ZjGh9xVaUbY4ZGnrx8mVDnMlQMbnefYw93OfmapxNZ2NDOEPrWISEJ
yRiVw7KakpwfJd7sGzP8Xy2T46UPKDFXlm2rNgGai6uQk+5EgTCd2++RXXx0AUiKWngne
TCruiRxNccwdLgNlSoJhlS5CY6VavXjbiluOBMKDh28yUmlvykAdesC2x8e7K43i2aA2C
zCFNWEFJWUKKa4YqUWDosz0173YRKVYD+H98JpZ7GTWDrsEmW1hv3T4avKu52OFX5+g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794264353;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To:User-Agent;
bh=6YpxPQLhC5GYhJMZVQU/EX0SwaFHozdIe3HLVp7Iy2A=;
b=l96svdGdQuVcjAWOIogryxuJ5ZQR43hyN0FAqy61tAcZrjdaxLGYqw+ft9IvExHQdxcf
OBCSA3taO9Vc9mYsta1S1GRZ481pLN3yJV9pYL+Mf/heWDs/QmZ2oylelhl9XYfHZHN2G
6embmRDHS+2YYzVEMpQujevYag9h5YoSOEFgodb+zjOBzYyDpz5hXoiCiH1j9SzuoxMyS
uSOcumlOumaE9Ag7gKc0QX2BH5d4ugeDpaywD9eROCp/+t8T9BcfJwGMZVfNtvPyc0/Z3
TiQbFsXQ3ESWLgpWebik49qhAn+jRnPhg/Hs93SeB6I0HDpmFeNh5Qm0vXmEj5jX00A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=ZBGKecxk;
dmarc=pass header.from=crustytoothpaste.net;
spf=pass smtp.mailfrom=crustytoothpaste.net;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id C2B6E606A336;
Mon, 9 Nov 2026 22:45:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=ZBGKecxk
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=172.105.7.114
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794264352;
b=0EN4HAzxsaQJ2Opxf/iHjRvqfbgBvY+hPDlBCV/NYptYFBojx9EXdOSSb7Z8397W+CQb
TY92eVC5td00qYiwz6P0jf1NB6yuTB/AOH3mAD9R0g0e6Wbggojirnj0x6pkQ5iZg99Gr
L5JQ7hL14eyP4AfLQzL/A4kiGt2eG83q/q70CGH4nIUzL5iDhyIXyNobeCX2KM6/Za6lG
X7lI9w4lznxgaHduHrPDFJbI7dtGC/eBpR6kfLPouG9BeZFY53K603ZOI4cW6ulma8s4j
wxCFW4BItTu6TucQwagmMAi6mbeixQCH7/1m/SqCRAyroRC5IHAqM73ENjZMgq0/row==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794264352;
h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To:User-Agent;
bh=6YpxPQLhC5GYhJMZVQU/EX0SwaFHozdIe3HLVp7Iy2A=;
b=YJIvnOlVYRvUx0iQCtvp3M83ub/NBnx4pWsA7FvAZH7wGITsDJpQ6QiAUDkF7ldeiptR
7ZPZ34fSh+gG4Z418fPK+uh4Na9Egg9OsuoO3I5KHQ5o/O53GtEQC5T/lDt8BlY27dUQM
MMx/cZqjOpnyiUG2yWi1GiM5AKF7OlWGcE09QociroEs8AxkE1vFYrCgQHylkkVmydl16
emV6Ra0DK0BihzyArIamZRY3Kkc6rZIUcX0RDywKwZlM3Bn4rJ7q/5orqqBQmyYauRqgI
BNrNx8mK3ShofGIXc6MT6ryvugOhcJ3btdTTpNTHJmLGApjmtY0T3mF6iqM0ZffeUdw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=crustytoothpaste.net;
spf=pass smtp.mailfrom=crustytoothpaste.net;
dkim=pass header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=ZBGKecxk;
arc=none smtp.remote-ip=172.105.7.114
X-Received: from complex.crustytoothpaste.net (complex.crustytoothpaste.net [172.105.7.114])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A831606A334
for <git@vger.kernel.org>; Mon, 9 Nov 2026 22:45:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2A831606A334
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=crustytoothpaste.net
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=crustytoothpaste.net
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net;
s=default; t=1794264351;
bh=Awo6HTO698LGlGLbafvjgDCnAcOv4d53ZzhLCxBTT5Y=;
h=Date:From:To:Cc:Subject:References:Content-Type:
Content-Disposition:In-Reply-To:From:Reply-To:Subject:Date:To:CC:
Resent-Date:Resent-From:Resent-To:Resent-Cc:In-Reply-To:References:
Content-Type:Content-Disposition;
b=ZBGKecxkeeTR7RGXcZaFDf09xXRNfIYElcT0NkNiR9Z8dh90+rUY9LRzFqC2oOgJm
83bVEmwoVP95TncRUt+jUUE3aWUFpuip8i6DshjdTx5AQ8CpOP8jm8Xv2K5rCHkP0h
wHqbMbglNC0BPw7pAjCEOpO006qoJyiKY5x5t//fIfqQfd28MdsKXSRwPJ+Hp8TK2S
Ppb0UPXwLpeqxxy87T8yPN3XZ/C2Brv/eie5LbSxwRKz6HQ/IBoQI9hk0wtdldeBAM
F24SfdcJbDViXtQQNhgdrIv2mceVuHb2rOEeg8ZwfT7wWDSbcDuLp0qrWhppceWkf/
5M6ExynV7ANy9TMXU/gRINVSANUDxrQxJkJQo01Tq4dwXyeL7OSpv/UR2Hl2ryJBpG
j9COoSiDe3k+LttGpG9e9i/KMD08KcULQ8z7dFXByExHLfldtps6pyJuWgVqdXPcLh
iZUmIxtgS4sekVj1Yyfck7GfQkuEWLKbcm4HzfUBILVnhAwiyUQ
X-Received: from fruit.crustytoothpaste.net (unknown [IPv6:2607:f2c0:f00f:f901:7f1c:2d92:cd33:5059])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by complex.crustytoothpaste.net (Postfix) with ESMTPSA id 01FC720069;
Mon, 9 Nov 2026 22:45:50 +0000 (UTC)
X-Cc: shrimech <eddinen77@gmail.com>, git@vger.kernel.org
X-Mail-Followup-To: "brian m. carlson" <sandals@crustytoothpaste.net>,
Tanga Joris <tangajoris@gmail.com>, shrimech <eddinen77@gmail.com>,
git@vger.kernel.org
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <CAKrRMNqBCiH06xsre-YafBJiqPTiBgPnNZ3xPrhjTQWU3czwHg@mail.gmail.com>
X-User-Agent: Mutt/2.4.1 (2026-07-04)