From nobody Mon Apr 18 16:51:58 2022 X-Original-To: net@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 452AF11D9008 for ; Mon, 18 Apr 2022 16:51:58 +0000 (UTC) (envelope-from bugzilla-noreply@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 4KhtJG0Lb2z3G87 for ; Mon, 18 Apr 2022 16:51:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 E150516638 for ; Mon, 18 Apr 2022 16:51:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 23IGpv5B074176 for ; Mon, 18 Apr 2022 16:51:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 23IGpvvG074175 for net@FreeBSD.org; Mon, 18 Apr 2022 16:51:57 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 263379] [regression] [ipsec] compatibility broken between stable/12 and stable/13 opencrypto in AEAD mode Date: Mon, 18 Apr 2022 16:51:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jhb@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: jhb@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650300718; 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: in-reply-to:in-reply-to:references:references; bh=M7bBXIcRIXUd0XpZTU/qjbdtMtqru6AaYqikK1vAzuU=; b=WGBiKHCf2u+RM8z1OAozCCaco82ZM4wbDF4EI4GbRPA3Zzg2QKnlf0sJ1xHnDOL0rQvBkR SA64xuBqccS1ocy3GIS97PuwuJ5Gg2BW0/E15Wy8qYdMyTSucXDUteOMfhefn3Q5CsHK+M tk+hFNXrTcDeZGAyPLk9H4lJ7B0py8Zo7vV7ZvxMrCpho+ahclttM7YvBwPRYVLMyZxNdK I4YIRkRttL/OuKaBXeGOv4gli4LgPoPGkGPfAKm4PGMX9/SlXOlB58JPQxA7Uumy9K3kS1 FGm/Z7rP+8KHqa0huwpjlMFQ8IJ0yc/RG2bYdEQy/FSBfLx7B7XyxHWuaBshQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650300718; a=rsa-sha256; cv=none; b=R8f/ii8eRZQ0TiyWX87ALEad9e2P1zTFpP35U44ly6GkiMmQOrVPc5B3ujGhRPlwGku4xo w8j/QXT6voDfe1/GR2BvLSBC3fG2LgsP9Yo4r7xAOJvhx5eQfiGcr1hnoQAGkQb2Bna6Ps OgxtUd+tapOYcftujZukOgfRzHN79CrRBVoT3sidi7q9PFFMN4X4eJ42dFnTLPVJPje8jR nq5hOZ8v7eTZFfCPmEakE4PQwGbpUpXGll6gCB/IDX6b0YV91Mr6djFfATizcgBC8FYge1 PaoOLiDe7obI7OUK6ucTr9ebz92nK34QBvquOKzydYj1/JlQRgg5GwhJCnZLnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263379 --- Comment #1 from John Baldwin --- To be clear, what do you think using AES-GCM with a separate SHA-512 HMAC should do? From the RFCs I have read, there is no defined standard for usi= ng a separate MAC with an AEAD cipher. For example, in the combinations listed = in section 4 of RFC 8221, there is no defined method for combining a distinct = MAC with an AEAD cipher. About the best I could imagine is that perhaps you intend to use AES-GCM wi= th an ESP header and then a separate SHA-512 HMAC with an AH header? I can fi= nd no mention anywhere of such a construct for IPsec, and the closest thing I = can find (using a non-AEAD cipher with ESP and a separate MAC with AH) is deprecated in RFC 8221 (the recommended approach is to use the non-AEAD cip= her and MAC together as a combined ETA cipher with ESP, e.g. AES-CBC+SHA-512-HM= AC). I suspect the fact that stable/12 does not fail this is probably a weird bug due to lack of argument validation in stable/12, and it is probably putting packets on the wire that no other OS can handle (perhaps it is basically us= ing the AES-CTR side of AES-GCM but with the IV for AES-CTR constructed using AES-GCM rules and then generating the SHA-512 HMAC using ETA rules). That = is, I suspect what you kind of have is a broken, non-standard version of AES-CT= R + SHA-512 HMAC (which is a defined combined algorithm you can use). But real= ly you are better of just using stock AES-GCM anyway and using GMAC rather than SHA512-HMAC. Your changes to OCF are all incorrect. If you want to combine AES-GCM with= a separate HMAC, you would need to construct separate crypto sessions and cry= pto requests for a given buffer, the first to do AES-GCM and the second to deal with the HMAC. --=20 You are receiving this mail because: You are on the CC list for the bug.=