From nobody Wed Dec 15 21:33:32 2021 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 219FC18D5DAE; Wed, 15 Dec 2021 21:33:33 +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 4JDpQN60Kmz4bSr; Wed, 15 Dec 2021 21:33:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 AD71723CF4; Wed, 15 Dec 2021 21:33:32 +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 1BFLXWWJ014005; Wed, 15 Dec 2021 21:33:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BFLXWnT014004; Wed, 15 Dec 2021 21:33:32 GMT (envelope-from git) Date: Wed, 15 Dec 2021 21:33:32 GMT Message-Id: <202112152133.1BFLXWnT014004@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: aa2681752d0d - main - cryptosoft: Don't treat CRYPTO_NULL_HMAC as an hmac algorithm. 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: aa2681752d0d4f8829f3b1ff8de137980b838bd0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639604012; 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=6nf0hBaNuwe1cyeQiAE0opDdSXwh4iyFwMDiP+y59fI=; b=CtxOwA5jUVoEuYre60JsVmYwXFc+NK1/sEfyY3mFY46LCDs/Q4Yaso7NvzRAY66BsPzQVn iKoz9KYuxawyaC9/UgdDk9mr2Uo7OMz5AzVbytbfrUxrw9qI8b+GhD5tVG2zZgUlY8vXmm c4nWMBcwpGKWTUrl2HdrWv19/ula145I9mjmzEo1XjAb7m8RbzrDwaVIuYKfgyQ1RtyG0P YCW26ee5eIhy88IhnwQGZCb6IMrilfLy/f+e3rKjfNI9RvySjYr7ZhhX8Ob8L226SdNDku QWH0ozZC6l65R0GixMDR49RPo7MOqlMOBqDLcdQkv3pjEynahQHsmh7uAgz41A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639604012; a=rsa-sha256; cv=none; b=RJB4j0nzQI7xBz4D30tfl+6OMl7LukRgCBL2K/LLuCm/mHHkQVDql9NJYGWIKsrWuErgrx ksRYps1G/Q4iqoRq+W2h3PzaIsEZmgN3hNwKtQ+1IOYpZvxHsOYqhpFGNboTOBbhdLqCzm Ft/utzBhyWywtLVaautvFPWngdDeQBigdgAard2spYizB1oafSRQD6B/p7HKaQ2kEplQBp 7J9MJY7inM17xcfz3bbUhCiEQZtGlo6k1XgGbWx+FVlBjUQz+4lzYvSII4RuAzMIX2dUB0 ShyYG886sCNcqErxNon5MhBoNrereH6ACekoBRy1XSWu3hNdkVfiSLczhFVfFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aa2681752d0d4f8829f3b1ff8de137980b838bd0 commit aa2681752d0d4f8829f3b1ff8de137980b838bd0 Author: John Baldwin AuthorDate: 2021-12-15 21:28:30 +0000 Commit: John Baldwin CommitDate: 2021-12-15 21:33:15 +0000 cryptosoft: Don't treat CRYPTO_NULL_HMAC as an hmac algorithm. Despite it's name, CRYPTO_NULL_HMAC is actually an unkeyed digest similar to plain SHA-1 rather than a keyed HMAC algorithm. Reported by: syzbot+17d7c656f1a797b0faae@syzkaller.appspotmail.com Discussed with: markj Fixes: 6113a08b98e4 cryptosoft: Fully support per-operation keys for auth algorithms. Sponsored by: The FreeBSD Foundation --- sys/opencrypto/cryptosoft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 54a44592b1f2..ebbc90aac05b 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -1219,7 +1219,6 @@ swcr_setup_auth(struct swcr_session *ses, case CRYPTO_SHA2_256_HMAC: case CRYPTO_SHA2_384_HMAC: case CRYPTO_SHA2_512_HMAC: - case CRYPTO_NULL_HMAC: case CRYPTO_RIPEMD160_HMAC: swa->sw_hmac = true; if (csp->csp_auth_key != NULL) { @@ -1238,6 +1237,7 @@ swcr_setup_auth(struct swcr_session *ses, case CRYPTO_SHA2_256: case CRYPTO_SHA2_384: case CRYPTO_SHA2_512: + case CRYPTO_NULL_HMAC: axf->Init(swa->sw_ictx); break; case CRYPTO_AES_NIST_GMAC: