From nobody Mon Aug 28 15:07:49 2023 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 4RZDSj69jyz4rf2r; Mon, 28 Aug 2023 15:07:49 +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 4RZDSj5QrCz4WGQ; Mon, 28 Aug 2023 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693235269; 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=hechLCFA8tOJPriJQOKDC+N3psFrTf5y8+EmtyaOnTo=; b=iypicSsb0ogsl3NGmPIPJkXO4WpLAzpMeOK9WLJuhDJTUJ2YStP6LXlVF4SJaH2GXq2s7Z bF6ARgiGjtRCUnSFVoW6iWSfU0J7vHB45HM3eEq2r22U0m5JqnA+XTOXoBaQPiGNiQ2ezS 0OggjPatl/M4LAzP9kp4sDLyKdIwYxySBv44IoskWr7ads0Q3C0nlE7C58sI7K4u0jsvlJ eEwlTpssmoUu+mczX+HtuqnXIBWWvGh1HBLAeXgKU3LECWVsPwAFeQTks31up4WHejgemX 7i/ZWteRa0X8c4q0XeC2lbsBxmz7aNsAVokVsT9qVFtkKs2pglVTdjoDk6mGkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693235269; a=rsa-sha256; cv=none; b=PYbPygBshJKffGEJY9VH6F2gre3SuKpnQUg9Xvsy9ZLu0nq4Q9znCq0bg9LcE7lgvgYkH9 K9A0FCFKGTsLMeH37OYZnzVTG01rc+IDehFgGqT3ODfBICRp63YfGphReWhhWVRtRJCzAy NRqY7t5YlUJbLFqplNy453w409WHnI0cd6Ab41WQYFJfKQm0/4DY/JRqsRxi4RbcK0Zgoc UoTxQMgxZY3ei8TKuuL+U57gyADefSIKLaAVTwhc7wrWux0XqLGDA1vUit0JNDCobE2K2h tQMXz7o7DUpYG0lcOJx96xjM2iXd+Wf21xageOTYbdYLJNkCBkNeCPxiOr/KjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693235269; 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=hechLCFA8tOJPriJQOKDC+N3psFrTf5y8+EmtyaOnTo=; b=ah+Bpp7NwWX8zNDu0yUk7SR9Eas0PWppcxCGHeyM81NKHDgwQfiLBXfalNsvLnMH3xma4H lSgtTYWyfQ5j1VgjLhfXWs7U+3s3pqGlPKEsMrK0bhVktRbQ7OsVCWaeH9gJNbBgAc+Ibi qSywjG5xj57fR2zU4sLaqxUq81fWmIgbGqPqPhhFrLPvjwn2nMOag6Gcs1wRo89fjwkMLu LkfKikwFe+aMD+BA49iei/ynDdSINeMqwRmokw3oDh57LSaGyWPBRmsI63LLb7+EhgOHcT 1GMkyEmE09x9FPj9HaPsix+EGEe7Jao5eyLz3pKjXO7V4QBayX7cWjK0NkyIIg== 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 4RZDSj4V2Kz1CbK; Mon, 28 Aug 2023 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37SF7nZZ029029; Mon, 28 Aug 2023 15:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SF7nS9029026; Mon, 28 Aug 2023 15:07:49 GMT (envelope-from git) Date: Mon, 28 Aug 2023 15:07:49 GMT Message-Id: <202308281507.37SF7nS9029026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 88d13bf33754 - main - geli: Fix geli setkey -J for detached providers 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88d13bf33754bd4b0c5df92eef83d6fadb9b4944 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=88d13bf33754bd4b0c5df92eef83d6fadb9b4944 commit 88d13bf33754bd4b0c5df92eef83d6fadb9b4944 Author: Arjan de Vet AuthorDate: 2023-08-28 14:54:18 +0000 Commit: Mark Johnston CommitDate: 2023-08-28 15:03:55 +0000 geli: Fix geli setkey -J for detached providers Clear cached_passphrase before generating a new key, otherwise the operation nonsensically tries to reuse the old passphrase. PR: 254966 Pull Request: https://github.com/freebsd/freebsd-src/pull/780 MFC after: 1 week --- lib/geom/eli/geom_eli.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index 6cbb23230fa5..1efb760830c4 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -1421,6 +1421,12 @@ eli_setkey_detached(struct gctl_req *req, const char *prov, bcopy(mkey, mkeydst, sizeof(mkey)); explicit_bzero(mkey, sizeof(mkey)); + /* + * The previous eli_genkey() set cached_passphrase, we do not want to + * use that for the new passphrase so always prompt for it + */ + explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); + /* Generate key for Master Key encryption. */ if (eli_genkey_single(req, md, key, true) == NULL) { explicit_bzero(key, sizeof(key));