From nobody Mon Sep 04 14:11:44 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 4RfVtm6nTHz4rkmT; Mon, 4 Sep 2023 14:11:44 +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 4RfVtm6Kz4z4byl; Mon, 4 Sep 2023 14:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693836704; 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=Pevfb0Ge9R4E05vEXUwXRsldc2Jxdg2I8pShLV0CHCQ=; b=eu4Fe6Ey9u5EJjB7UEB5s0Uxs2woKH1enOAc7A1JHdFxAY4aK6PRdMgmlK4BMevuttKxPc 0KpyxN1zn5mUdpO9AC6kYKM/64Ez8aV3ClXytj5e/fZd8rQMRNvSGgrW0eJGhGl7rGCI+d 21vTtuojH9+I54EkHsjjCnasE4fNJ8X/KDzOrocYUefDJZCfFlsH2wD+hIxQHY8aC2Z2KC dCvB+8CtWANlJDu0FD1x6oJJa649o+fbu8yiQkkf2fP4hHNTXozdtBPLkhPjI+YdcKhnb8 bt4qlscLGWy1FDKDFayOVroqewmXYp4FvxUaI349STyTWLd8WKqN7LtX8bAM4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693836704; a=rsa-sha256; cv=none; b=tEmw5KQSRJGLWY36PPTSuA+19EGAlWAUUWra8qBtNwf3+kX5/vUhs6mD8m5SjezA+SkMPP qmsrQWjdAYpZ0KoxYPepABGq1QdRBJQy/zOskXw1At3G2QzfXoQk6Dn6sCE1ubwcreKrwK jFh8v4AL1lUFvir7En+wfB9pWnRVxuL0uX+7Qa2JA4paxg1/3c4eFxQ4c7d1pFu2h5gP2j nxF6ooQfsdP12wBJ7I84lHuB05QSILZJ0mOgzOigc7PLqzeyUrS6fA3Ev/D3TAKBfN9+R9 WN05+W5fxn3mTIrDPhTOtSCErwA4ysQ8wo4oSflIDommZcd1T8YH/vOk33ZCKg== 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=1693836704; 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=Pevfb0Ge9R4E05vEXUwXRsldc2Jxdg2I8pShLV0CHCQ=; b=u9keORqZSzWOul0sLR1gNyD3BP3oY2AQHdHAXkdBoee4TFLaV7Bp9Q8PoYcC8OoNPmKgMV pE2L+4nTUnhCM0ULmLIj/vh9V9Ah5nEl1xklIf8airzWZANwfjY7JRY39RTLbbYfAQWJ9K +wOSo28HSLwsE8eauIrztayUiYIIv45kEZgARBLpTSYu1MW6iM8lFijOWtjhv3uEoDL5fX NE8CY5F2YHeXtoHcSm93pJgkjjZ6ejlrhW4e0ZSDZUKXuvRh8/Ltc4PV+h/WUYp7QkvnDH b34tGglb9UHeASP8EVqESvSHp9zCftahgWZNgWEUOMy+ikqaidCF17DC3KjwTA== 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 4RfVtm5P0Sz18kY; Mon, 4 Sep 2023 14:11:44 +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 384EBiEe062868; Mon, 4 Sep 2023 14:11:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 384EBiCu062865; Mon, 4 Sep 2023 14:11:44 GMT (envelope-from git) Date: Mon, 4 Sep 2023 14:11:44 GMT Message-Id: <202309041411.384EBiCu062865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 134d36676e94 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 134d36676e94a42bb280a010bf36b31163fccc65 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=134d36676e94a42bb280a010bf36b31163fccc65 commit 134d36676e94a42bb280a010bf36b31163fccc65 Author: Arjan de Vet AuthorDate: 2023-08-28 14:54:18 +0000 Commit: Mark Johnston CommitDate: 2023-09-04 14:11:01 +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. Approved by: re (kib) PR: 254966 Pull Request: https://github.com/freebsd/freebsd-src/pull/780 MFC after: 1 week (cherry picked from commit 88d13bf33754bd4b0c5df92eef83d6fadb9b4944) --- 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));