From nobody Tue Jan 24 05:43:18 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P1G925pP7z3bN97; Tue, 24 Jan 2023 05:43:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1G923N2wz4THr; Tue, 24 Jan 2023 05:43:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674538998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tlxPbcYoNjUb9ARxs8At49ziapvJHYMOLkScpG3I5Mc=; b=HNhWRXaR0YAGkVoebjwfGN4jHwlZzX2yJCRL+NkhARXzW28PXsWCqXSkamDRKIWk7/oZ/v k7ACh+SmAfNnDJNhsKh60ibUD/eFZSmEBu4ozjZrZFc1MGeVa88xP5II+s240WnNd9QhDi zbToAd9bjfnWQ1TN/KKPGExFn3YTGvUa/RnAofaMvCV0+divb7X3Z3TFKmvw7HBor0MZLD lUbTym9Hwtkhn+W7KnbsOAUzXRcW6KNitNyRoxVN0ZBQp1dR8WoCOcTGTh2AOE+XJSUN3q ciDWpPXjJdKtwdRvTsePWP5+ffCML5skGICwZfBqQ/tkMt49mV3y8hS6xb8lvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674538998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tlxPbcYoNjUb9ARxs8At49ziapvJHYMOLkScpG3I5Mc=; b=tq28f9BrRLGKHdETBkHwXQVwh0ffzGz81Kt/UJOsmxhwqmRJYvm+I13AEOJLRSjjJo1ka9 IQO+qNhZs5NCKJM/W7Hf2/SPAeZ3BSqbU5NNoxAGyOOBSQrqOa9IcBNNPICN9ZS+4nUZF3 rr0qUZ0BDnitAx9G8t7jZKOEb/MQTDKTvV+J3M8MbqMd5DG3acwnhGDgELNX1m7/GmiYgl vKLII7U254Z/k9Vtf9zcu88Zjapquq0HHcuzLDL417iCcOAd9yIYkB4qXyvfCWGP6P6S1k VkEgCoI8uoBvhAKMCyC+DsQN5aoD71NWDXSqxNMv1Rc0S/dVnCIySWslx8X/Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674538998; a=rsa-sha256; cv=none; b=FvDaMY+PlG4y4Dte3kRAOl2pBeLEEWYJZrV6akJkqGOOaCCAng29ulIbwOy2ut8k3a1Cet 9zbpqU5Vl2BsJn4hpjv46en1yuVUeHK3TU5QEG/hRKohpTq/8cjO4IrCWXfx/t32G6F52H 4K3dZJgncpeCUMXu/MviepFbrs79dLg8kVGFA0bjwc2zQL9wrQCxE3W5ayYEgQG8mD5ljW xLLV1PWM88F5sC0OH1N/wQ5IWsQI+qr8VDLaWsfuHv0IW7A92XDD4/5G15ds42h0EAlb2j 0PIonr9T00QBLIInme9g597olNbpSYrRgzh4Mrc3IOb22VLxcl1CGIvgkxj+uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P1G922TydzyDy; Tue, 24 Jan 2023 05:43:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30O5hIwe061887; Tue, 24 Jan 2023 05:43:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30O5hICq061886; Tue, 24 Jan 2023 05:43:18 GMT (envelope-from git) Date: Tue, 24 Jan 2023 05:43:18 GMT Message-Id: <202301240543.30O5hICq061886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 13961b5a48d1 - stable/13 - libfetch: Pass a zeroed digest to DigestCalcResponse. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13961b5a48d10e3a045a54ce9a6639bce9416989 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=13961b5a48d10e3a045a54ce9a6639bce9416989 commit 13961b5a48d10e3a045a54ce9a6639bce9416989 Author: John Baldwin AuthorDate: 2022-11-16 03:18:58 +0000 Commit: John Baldwin CommitDate: 2023-01-24 05:13:19 +0000 libfetch: Pass a zeroed digest to DigestCalcResponse. GCC 12 warns that passing "" (a constant of char[1]) to a parameter of type char[33] could potentially overread. It is not clear from the context that c->qops can never be "auth-int" (and if it can't, then the "auth-int" handling in DigestCalcResponse is dead code that should be removed since this is the only place the function is called). Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D36825 (cherry picked from commit 57fbafb8deac75b924faf1fa6c2222a7719fdfec) --- lib/libfetch/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index c1d92d08b317..d4605aeccd9f 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1281,9 +1281,10 @@ http_digest_auth(conn_t *conn, const char *hdr, http_auth_challenge_t *c, DigestCalcHA1(c->algo, parms->user, c->realm, parms->password, c->nonce, cnonce, HA1); DEBUGF("HA1: [%s]\n", HA1); - HASHHEX digest; + HASHHEX digest, null; + memset(null, 0, sizeof(null)); DigestCalcResponse(HA1, c->nonce, noncecount, cnonce, c->qop, - "GET", url->doc, "", digest); + "GET", url->doc, null, digest); if (c->qop[0]) { r = http_cmd(conn, "%s: Digest username=\"%s\",realm=\"%s\","