public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Peter Robinson <pbrobinson@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rust-tpm2-policy] f45: Upstream fix clevis TPM2 unlock
Date: Sun, 15 Nov 2026 14:10:45 GMT	[thread overview]
Message-ID: <179475184542.1.6444748358919096714.rpms-rust-tpm2-policy-e1378df6561a@fedoraproject.org> (raw)

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
+

                 reply	other threads:[~2026-11-15 14:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179475184542.1.6444748358919096714.rpms-rust-tpm2-policy-e1378df6561a@fedoraproject.org \
    --to=pbrobinson@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox