From nobody Wed Nov 16 03:23:12 2022 X-Original-To: dev-commits-src-all@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 4NBpKF14Qxz4hNnh; Wed, 16 Nov 2022 03:23:13 +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 4NBpKF0Tz0z4MW3; Wed, 16 Nov 2022 03:23:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668568993; 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=YG6cxd9G0q5KW7nyyhqXwZfoNgGYypNAH/+B1VY/Pzc=; b=YwaLfXqnIrTGokk5EwI5pOFwSBIRm3F83PG084/duavAbCWO0xCcsDhb3HbG6Wg7ChnivS 8hYKuYjPY9ljmpNNjagiWad67GmUIVTgCzCFVhezbSKzP1q6xgknVTObhlHDg0ntvo4AIB RsYN36pG3R7156Rfew4lDH5ado4c+wFg6YACYEyUQg4Xz3UikToKfQrKJG9AXKM1kXi2Rk vePZDTtIMQZ7fk6DAbtMwxqyyVMIUw/Pna01IhxsbHdHQaUG/e2Wc6AKhjp3g1uOyRffx/ QJ7fff1RFMuqU/TIypuMBFC4mTDM6leOj2lpgp5y6vUefX4U7qqhige/HFBywQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668568993; 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=YG6cxd9G0q5KW7nyyhqXwZfoNgGYypNAH/+B1VY/Pzc=; b=ZSo5QR8WN3jEXYDTytDXbsnIfar7t2UDTVF1e5rdSN2uq1OsuFNZM9eE98f5PhAubKpeFN 6bViEHhuGxFAc72mMDgSSHQSaA3CTVfjMvHdxolE+2vlzSq0op/TXiwlVHPDXY3KrJdZNs gCq/aJYdoJrfQwROypy1pqLr2b8pWFb1zcNZjpwOw24WN1HrU3kTMQIY4eCjMxaOxwzUxx qZzrZJKMNvASGV/lIjuEdND/rJkwztCqYHWVrcm//lCJ+KQ+xL/loU3Ofayfgq9Gr7yAxs L8rbmkOHJyk5/urdi2IOxZFaGWTWH/jLbzdiu1FFZFkg2pN9dk6utaNfOcOV4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668568993; a=rsa-sha256; cv=none; b=uih8uAFGCfbfS8NCJg/j0EDucMNmON3kgYv4OLttMoAenVkf2crDHgCEuvSi4LPzgc1h+S /Y5wm5J4f6+dgSdMci2ZzJNo8C6OLrq4vsojqmja+695085YqlXMhUrPqKVrvh2pZyKagv oa2snEiyJfA/Y+4HWDEPPe4tdMsIcjowufxDh0J0FkDQVonojknPB7/Y5TdOD5dXsugyv5 mxgt6xbnsGuamyOVrPbVP9etVlWCunjAHmT9y2Vpu4qR2Oy964sN/KbfybPhFosupkuzOK lBE1L+unP5QQpgvoKKeaqQK1VruUiTHz7po15v+Nay6pPi1A2AJs7tWwKxMA+w== 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 4NBpKD6hkZzmjQ; Wed, 16 Nov 2022 03:23:12 +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 2AG3NC85055796; Wed, 16 Nov 2022 03:23:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AG3NCs7055795; Wed, 16 Nov 2022 03:23:12 GMT (envelope-from git) Date: Wed, 16 Nov 2022 03:23:12 GMT Message-Id: <202211160323.2AG3NCs7055795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 57fbafb8deac - main - libfetch: Pass a zeroed digest to DigestCalcResponse. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 57fbafb8deac75b924faf1fa6c2222a7719fdfec Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=57fbafb8deac75b924faf1fa6c2222a7719fdfec commit 57fbafb8deac75b924faf1fa6c2222a7719fdfec Author: John Baldwin AuthorDate: 2022-11-16 03:18:58 +0000 Commit: John Baldwin CommitDate: 2022-11-16 03:18:58 +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 --- 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\","