From nobody Sat Dec 18 00:48:41 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 BD3B118F2105; Sat, 18 Dec 2021 00:48:42 +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 4JG6ff1hFSz4gR0; Sat, 18 Dec 2021 00:48:42 +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 15FBA25FD2; Sat, 18 Dec 2021 00:48:42 +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 1BI0mfXe029066; Sat, 18 Dec 2021 00:48:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BI0mfkf029065; Sat, 18 Dec 2021 00:48:41 GMT (envelope-from git) Date: Sat, 18 Dec 2021 00:48:41 GMT Message-Id: <202112180048.1BI0mfkf029065@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: 33d56e57ece8 - main - crypto: Encrypt the XORed input block for Camellia-CBC. 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: 33d56e57ece8fd270ed98e5979b4e19b23891329 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639788522; 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=qe4VjZ0U1/BDi7wKptEoAJ0EHgm9Fdu4pFsbv3aOQNs=; b=PYreQ10MHRLtE/4P4Kqg3yKlZ4mqDSHFCfsdeVp6lTibRwHusk2cLoaYIKSavN+iACncVP c/oHFZQXxxbBkG/6oax8rIGKrkKvs79iOc/twvQGrCTftGoGX8VKVkRJ83Cgxhvus4hFxr ptezCrZIgXwBE5G0KrhoOM8hB2QcWxJf+41J1UTmdnDgxC0ByVG7RGj3ZlFqszC5AsQmM+ ovjDdUG7lkwmJN8HiFkyFdAyUowm1Y6KGPvyU/iurtga1KBgKDaU2xAIxEi0gs535HdYC2 KCZFRMBgHjoab+CXz5LNzGHRg5NS4zVswTHru2L7WzxQvKr0vkoZVtCMw3nUuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639788522; a=rsa-sha256; cv=none; b=OTTwpzvs2UUa6V3o6R4OaNfFxIlypegGI6P+I9qYJiMLRHqbTvCzj/d261qR5QeOFHbdf2 XkOiydaUn/PsSunZXNeg5toidA6pDDqxBJSBFo02QncSgpedJqQGEbaTENR/yiaAqSs6Os djiv6tKkcc6UyRtSh6yiPoXK2iFfyfkgqg3uYaBCp2fWUoCqMOeJz+07yGl0LUJbVsXFH/ kxNvNHZbpwdfMvrEVFQa+hloWW15m30F0HisBjWDLnO3b94smJlr8JJl9y3f2IQCxM4Nrt uTNsgp44GspE1m4tNff8Y/J99/MCdl4I+YuqgjSwYS+42pP4WNskEol2wX5sQA== 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=33d56e57ece8fd270ed98e5979b4e19b23891329 commit 33d56e57ece8fd270ed98e5979b4e19b23891329 Author: John Baldwin AuthorDate: 2021-12-18 00:46:09 +0000 Commit: John Baldwin CommitDate: 2021-12-18 00:46:09 +0000 crypto: Encrypt the XORed input block for Camellia-CBC. This fixes a regression in the previous change to move CBC chaining into enc_xform_camellia which passed the raw input into the encrypt function (thus not actually doing the chaining). This still works when using the same buffer for input and output which is why my initial testing with cryptocheck didn't catch it. Fixes: f84d708b484b crypto: Move CBC handling into enc_xform_camellia. Sponsored by: The FreeBSD Foundation --- sys/opencrypto/xform_cml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/opencrypto/xform_cml.c b/sys/opencrypto/xform_cml.c index 8ab18142489c..af8ad22f9b18 100644 --- a/sys/opencrypto/xform_cml.c +++ b/sys/opencrypto/xform_cml.c @@ -88,7 +88,7 @@ cml_encrypt(void *vctx, const uint8_t *in, uint8_t *out) for (u_int i = 0; i < CAMELLIA_BLOCK_LEN; i++) out[i] = in[i] ^ ctx->iv[i]; - camellia_encrypt(&ctx->state, in, out); + camellia_encrypt(&ctx->state, out, out); memcpy(ctx->iv, out, CAMELLIA_BLOCK_LEN); }