From nobody Tue Nov 23 23:12:49 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 CA87318A165B; Tue, 23 Nov 2021 23:12:52 +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 4HzKg61Yhpz3vVx; Tue, 23 Nov 2021 23:12:50 +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 C53521F59C; Tue, 23 Nov 2021 23:12:49 +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 1ANNCnNO037585; Tue, 23 Nov 2021 23:12:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCn4B037584; Tue, 23 Nov 2021 23:12:49 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:49 GMT Message-Id: <202111232312.1ANNCn4B037584@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: 5ce0850641a3 - stable/13 - ktls_ocf: Fix a few places to not hardcode the GMAC hash length. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ce0850641a3224e999c501030df08d8f1dd994d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709171; 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=sEgNu8rT9PuXXDZXykJQkU82XUTFPRvPVusC849BNnw=; b=ct0+VlnjUr5HgXbMuHCb094cx3OzDtS2Ml0GWKJIWza7AEDTKmzTwLjW027ZN1CORLFQJn Y3k2b01xkfLt7T4ZD4+NFzugrHYqnyVCNXNihIkskE+Y5oLvLTiJRVKSE1wdVszO1qgJfU 7nCA7d1HEb0WtKXA/W5NcngNeMKDNUFIhd9sx2IltTK7lunnwaBNr8wF089WZQD2JTdDiW uisGWd9n0a0/iRkjc47ByT/QPEhS5lAxVTLOq2T8rzQUdpbzioNfoIrP9xXj8TvO4PmdrU z4RNLJ2Gx1Jx6QmL4gYYSj8RzfWar7O7Q58JAVBrF1paGe83Wh4PLx14yzuFxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709171; a=rsa-sha256; cv=none; b=qLP3Fyfe/MRFS1dj5qWZnwtscKyyS2XfiGr937u/+Jin3ZMrM2rEDF0kpq9iIThCAn1ZXT OpQZZT1qbw0cFVRJzgMu8NUnQoSBV87PZBO7/IK94k3jMaGzmWOLWNxWa7KlGX09TFXIzE zjPoLcrvKVG02g6OfTgLtSqIz4qX9ligRW8Aegth1GVSVr5VWH2b1RowYDPoNHqPfZzpQj yZfgf1CEe4lraUs0KCdp/Z7q+JmeBwJHx1+PAjN+FOsuj/SRGMjTOz5SbPj2evvk0Hi6OU Fg58BLUqwtAknmVWlLGSMqOgYKknlbQqoJJFE+l3MaIElU2bCBTbmgHxYyQsHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5ce0850641a3224e999c501030df08d8f1dd994d commit 5ce0850641a3224e999c501030df08d8f1dd994d Author: John Baldwin AuthorDate: 2021-05-25 23:59:18 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 ktls_ocf: Fix a few places to not hardcode the GMAC hash length. This is not a functional change as the Poly1305 hash is the same length as the GMAC hash length. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30137 (cherry picked from commit 4a92afae7fcbb0a8453712dfec5de086aaf5cba4) --- sys/opencrypto/ktls_ocf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 1d5dce83b376..78331b76abd7 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -403,11 +403,11 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_session *tls, /* Duplicate iovec and append vector for tag. */ memcpy(iov, tag_uio->uio_iov, iovcnt * sizeof(struct iovec)); iov[iovcnt].iov_base = trailer; - iov[iovcnt].iov_len = AES_GMAC_HASH_LEN; + iov[iovcnt].iov_len = tls->params.tls_tlen; tag_uio->uio_iov = iov; tag_uio->uio_iovcnt++; crp.crp_digest_start = tag_uio->uio_resid; - tag_uio->uio_resid += AES_GMAC_HASH_LEN; + tag_uio->uio_resid += tls->params.tls_tlen; crp.crp_op = CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST; crp.crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; @@ -492,7 +492,7 @@ ktls_ocf_tls12_aead_decrypt(struct ktls_session *tls, error = ktls_ocf_dispatch(os, &crp); crypto_destroyreq(&crp); - *trailer_len = AES_GMAC_HASH_LEN; + *trailer_len = tls->params.tls_tlen; return (error); }