public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-tpm2-policy] f45: Upstream fix clevis TPM2 unlock
@ 2026-11-15 14:10 Peter Robinson
0 siblings, 0 replies; only message in thread
From: Peter Robinson @ 2026-11-15 14:10 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rust-tpm2-policy
Branch : f45
Commit : e1378df6561af021c88deb7a5c69fe3d92f69198
Author : Peter Robinson <pbrobinson@gmail.com>
Date : 2026-11-15T13:46:24+00:00
Stats : +49/-6 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rust-tpm2-policy/c/e1378df6561af021c88deb7a5c69fe3d92f69198?branch=f45
Log:
Upstream fix clevis TPM2 unlock
---
diff --git a/rust-tpm2-policy.spec b/rust-tpm2-policy.spec
index 7ec13f3..9af9ce4 100644
--- a/rust-tpm2-policy.spec
+++ b/rust-tpm2-policy.spec
@@ -5,18 +5,16 @@
Name: rust-%{crate}
Version: 0.6.0
-Release: 13%{?dist}
+Release: 14%{?dist}
Summary: Specify and send TPM2 policies to satisfy object authorization
-# Upstream license specification: EUPL-1.2
License: EUPL-1.2
URL: https://crates.io/crates/tpm2-policy
Source: %{crates_source}
Patch0: tpm2-policy-fix-metadata.diff
+Patch1: tpm2-policy-fix-do-not-set-decrypt-encrypt-session-attributes.patch
-ExclusiveArch: %{rust_arches}
-
-BuildRequires: rust-packaging >= 21
+BuildRequires: cargo-rpm-macros >= 24
%global _description %{expand:
Specify and send TPM2 policies to satisfy object authorization.}
@@ -49,7 +47,7 @@ use the "default" feature of the "%{crate}" crate.
%ghost %{crate_instdir}/Cargo.toml
%prep
-%autosetup -n %{crate}-%{version_no_tilde} -p1
+%autosetup -n %{crate}-%{version} -p1
%cargo_prep
%generate_buildrequires
@@ -67,6 +65,9 @@ use the "default" feature of the "%{crate}" crate.
%endif
%changelog
+* Sun Nov 15 2026 Peter Robinson <pbrobinson@fedoraproject.org> - 0.6.0-14
+- Upstream fix clevis TPM2 unlock
+
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
diff --git a/tpm2-policy-fix-do-not-set-decrypt-encrypt-session-attributes.patch b/tpm2-policy-fix-do-not-set-decrypt-encrypt-session-attributes.patch
new file mode 100644
index 0000000..c2478a7
--- /dev/null
+++ b/tpm2-policy-fix-do-not-set-decrypt-encrypt-session-attributes.patch
@@ -0,0 +1,42 @@
+From b55bad1f143ed6d255a7cfb284ba1701ce4543fa Mon Sep 17 00:00:00 2001
+From: Sergio Correia <scorreia@redhat.com>
+Date: Sun, 15 Nov 2026 08:28:42 +0000
+Subject: [PATCH] fix: do not set decrypt/encrypt session attributes
+
+The sessions created in create_tpm2session() are unsalted and
+unbound, so the parameter encryption key is derived from public
+plaintext nonces only and provides no confidentiality.
+
+They also break decryption with tpm2-tss >= 4.2.0: commit 9f1f612
+stops refreshing the cached nonceTPM for pure policy sessions, so
+the parameter decryption key is derived from a stale nonce and the
+unsealed data comes back as garbage.
+
+Stop setting the attributes, matching tpm2-tools behavior. Salted
+sessions would be required for parameter encryption to provide
+actual confidentiality.
+
+Signed-off-by: Sergio Correia <scorreia@redhat.com>
+---
+ src/lib.rs | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/src/lib.rs b/src/lib.rs
+index a85da48..c7ed2a6 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -46,10 +46,7 @@ fn create_tpm2_session(
+ HashingAlgorithm::Sha256,
+ )?
+ .unwrap();
+- let (session_attrs, session_attr_mask) = SessionAttributesBuilder::new()
+- .with_decrypt(true)
+- .with_encrypt(true)
+- .build();
++ let (session_attrs, session_attr_mask) = SessionAttributesBuilder::new().build();
+
+ ctx.tr_sess_set_attributes(session, session_attrs, session_attr_mask)?;
+
+--
+2.56.1
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-15 14:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-15 14:10 [rpms/rust-tpm2-policy] f45: Upstream fix clevis TPM2 unlock Peter Robinson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox