public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-sevctl] rawhide: Update sev dependency to 7.1.0 and fix API incompatibilities
@ 2026-10-16  5:49 Attila Lakatos
  0 siblings, 0 replies; only message in thread
From: Attila Lakatos @ 2026-10-16  5:49 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rust-sevctl
            Branch : rawhide
            Commit : a6b58a8ec94e928c960cf85d7bdb8038dd1e1e45
            Author : Attila Lakatos <atttila.lakatos@gmail.com>
            Date   : 2026-10-13T10:58:42+02:00
            Stats  : +88/-0 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/rust-sevctl/c/a6b58a8ec94e928c960cf85d7bdb8038dd1e1e45?branch=rawhide

            Log:
            Update sev dependency to 7.1.0 and fix API incompatibilities

- Bump sev dependency from 6.0.0 to 7.1.0 in sevctl-fix-metadata.diff
- Enable serde feature for sev dependency (now gated behind feature flag)
- Add sevctl-sev-7x-compat.patch: replace codicon Decoder/Encoder trait
  imports with sev::parser equivalents, as sev 7.x moved these traits
  out of codicon into its own sev::parser module

Signed-off-by: Attila Lakatos <atttila.lakatos@gmail.com>

---
diff --git a/rust-sevctl.spec b/rust-sevctl.spec
index 745f888..c3d318d 100644
--- a/rust-sevctl.spec
+++ b/rust-sevctl.spec
@@ -14,7 +14,10 @@ Source:         %{crates_source}
 # Manually created patch for downstream crate metadata changes
 # * Drop vendored feature from openssl dependency
 # * Relax clap dependency
+# * Update sev dependency to 7.1.0 and enable serde feature
 Patch:          sevctl-fix-metadata.diff
+# Fix sev 7.x API incompatibility: replace codicon traits with sev::parser
+Patch:          sevctl-sev-7x-compat.patch
 
 # SEV is an AMD x86_64 CPU feature so doesn't make sense to
 # try to build on other arches

diff --git a/rust2rpm.toml b/rust2rpm.toml
index bf33844..11e2fa9 100644
--- a/rust2rpm.toml
+++ b/rust2rpm.toml
@@ -2,4 +2,5 @@
 cargo-toml-patch-comments = [
     "Drop vendored feature from openssl dependency",
     "Relax clap dependency",
+    "Update sev dependency to 7.1.0 and enable serde feature",
 ]

diff --git a/sevctl-fix-metadata.diff b/sevctl-fix-metadata.diff
index edfeb43..65739e9 100644
--- a/sevctl-fix-metadata.diff
+++ b/sevctl-fix-metadata.diff
@@ -17,3 +17,15 @@
  
  [dependencies.proc-macro2]
  version = "1.0.60"
+@@ -135,9 +134,10 @@
+ version = "1.0"
+
+ [dependencies.sev]
+-version = "6.0.0"
++version = "7.1.0"
+ features = [
+     "sev",
++    "serde",
+     "openssl",
+ ]
+ default-features = false

diff --git a/sevctl-sev-7x-compat.patch b/sevctl-sev-7x-compat.patch
new file mode 100644
index 0000000..6906d89
--- /dev/null
+++ b/sevctl-sev-7x-compat.patch
@@ -0,0 +1,72 @@
+diff --git a/src/main.rs b/src/main.rs
+index 5fa41b2..a2bfd59 100644
+--- a/src/main.rs
++++ b/src/main.rs
+@@ -31,7 +31,7 @@ use ::sev::{
+ 
+ use anyhow::{Context, Result};
+ use clap::{arg, Parser, Subcommand, ValueEnum};
+-use codicon::*;
++use ::sev::parser::{Decoder, Encoder};
+ 
+ #[derive(Parser)]
+ #[command(author, version, about, long_about = None)]
+@@ -171,8 +171,8 @@ async fn download(url: &str, usage: Usage) -> Result<Certificate> {
+             }
+             Ok(rsp) => match rsp.bytes().await {
+                 Ok(body) => {
+-                    let out = Cursor::new(body.into_iter().collect::<Vec<u8>>());
+-                    return Certificate::decode(out, ())
++                    let mut out = Cursor::new(body.into_iter().collect::<Vec<u8>>());
++                    return Certificate::decode(&mut out, ())
+                         .context(format!("failed to decode {} certificate", usage));
+                 }
+                 Err(e) => return Err(anyhow::Error::new(e).context("failed to read response body")),
+@@ -199,8 +199,8 @@ async fn download(url: &str, usage: Usage) -> Result<Certificate> {
+ 
+     match rsp.bytes().await {
+         Ok(body) => {
+-            let out = Cursor::new(body.into_iter().collect::<Vec<u8>>());
+-            Certificate::decode(out, ()).context(format!("failed to decode {} certificate", usage))
++            let mut out = Cursor::new(body.into_iter().collect::<Vec<u8>>());
++            Certificate::decode(&mut out, ()).context(format!("failed to decode {} certificate", usage))
+         }
+         Err(e) => Err(anyhow::Error::new(e).context("failed to read response body")),
+     }
+diff --git a/src/session.rs b/src/session.rs
+index 0f0c852..a01a6a9 100644
+--- a/src/session.rs
++++ b/src/session.rs
+@@ -13,7 +13,7 @@ use std::{
+ use ::sev::{certs::sev::sev::Certificate, launch::sev, session};
+ 
+ use anyhow::anyhow;
+-use codicon::{Decoder, Encoder};
++use ::sev::parser::{Decoder, Encoder};
+ 
+ pub fn cmd(name: Option<String>, pdh: PathBuf, policy: u32) -> super::Result<()> {
+     let (tik_fname, tek_fname, godh_fname, session_fname) = file_names(name);
+@@ -23,8 +23,8 @@ pub fn cmd(name: Option<String>, pdh: PathBuf, policy: u32) -> super::Result<()>
+     let tik = &session.tik;
+     let tek = &session.tek;
+ 
+-    let pdh_file = fs::File::open(pdh).context("couldn't open PDH file pointed to by path")?;
+-    let pdh = Certificate::decode(pdh_file, ()).unwrap();
++    let mut pdh_file = fs::File::open(pdh).context("couldn't open PDH file pointed to by path")?;
++    let pdh = Certificate::decode(&mut pdh_file, ()).unwrap();
+ 
+     let start = match session.start_pdh(pdh) {
+         Ok(s) => s,
+diff --git a/src/validate.rs b/src/validate.rs
+index 1b6251d..774f4b1 100644
+--- a/src/validate.rs
++++ b/src/validate.rs
+@@ -6,7 +6,7 @@ use sev::firmware::host::LegacyAttestationReport;
+ use anyhow::{Context, Result};
+ use std::{fs, path::PathBuf};
+ 
+-use codicon::*;
++use ::sev::parser::Decoder;
+ 
+ /// Validates the provided Platform Endorsement Key signed the specified Attestation Report.
+ pub fn cmd(chain_path: PathBuf, report: PathBuf) -> Result<(), anyhow::Error> {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-16  5:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16  5:49 [rpms/rust-sevctl] rawhide: Update sev dependency to 7.1.0 and fix API incompatibilities Attila Lakatos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox