Skip to content

Support libcryptsetup-rs 0.15 - #805

Open
musicinmybrain wants to merge 2 commits into
fdo-rs:mainfrom
musicinmybrain:libcryptsetup-rs-0.15
Open

Support libcryptsetup-rs 0.15#805
musicinmybrain wants to merge 2 commits into
fdo-rs:mainfrom
musicinmybrain:libcryptsetup-rs-0.15

Conversation

@musicinmybrain

Copy link
Copy Markdown
Contributor

First, I upgraded tss-api from 7.6 to 7.7. This was required in order to compile at all on Fedora 44, fixing a long list of errors similar to:

error[E0609]: no field `count` on type `TPML_DIGEST`
   --> /home/ben/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tss-esapi-7.6.0/src/abstraction/pcr/data.rs:131:33
    |
131 |                     tpml_digest.count += 1;
    |                                 ^^^^^ unknown field
    |
    = note: available field is: `_address`

Then, I upgraded libcryptsetup-rs from >= 0.11.2 to 0.15. Downstream in Fedora, the fido-device-onboard package built fine with 0.13, but fails to build from source with 0.15 due to

error[E0308]: mismatched types
  --> client-linuxapp/src/reencrypt/mod.rs:80:20
   |
80 |               luks2: libcryptsetup_rs::CryptParamsLuks2 {
   |  ____________________^
81 | |                 pbkdf: None,
82 | |                 integrity: None,
83 | |                 integrity_params: None,
...  |
88 | |                 subsystem: None,
89 | |             },
   | |_____________^ expected `Option<CryptParamsLuks2>`, found `CryptParamsLuks2`
   |
   = note: expected enum `Option<CryptParamsLuks2>`
            found struct `CryptParamsLuks2`
help: try wrapping the expression in `Some`
   |
80 ~             luks2: Some(libcryptsetup_rs::CryptParamsLuks2 {
81 |                 pbkdf: None,
...
88 |                 subsystem: None,
89 ~             }),
   |

For more information about this error, try `rustc --explain E0308`.
error: could not compile `fdo-client-linuxapp` (bin "fdo-client-linuxapp") due to 1 previous error

Looking at the relevant documentation, I confirm that the luks field in CryptParamsReencrypt was made optional between 0.13 and 0.15.

Considering that all of the fields of the CryptParamsLuks2 are zero or None, and that I don’t see any obvious evidence that LUKS is actually in use here, I made an educated guess that this semantically means “no LUKS2 options,” and it’s correct to replace the whole structure with None rather than wrapping it in Some.

luks2: libcryptsetup_rs::CryptParamsLuks2 {
pbkdf: None,
integrity: None,
integrity_params: None,
data_alignment: 0,
data_device: None,
sector_size: 0,
label: None,
subsystem: None,
},

After this PR, cargo test passes again, at least in the client-linuxapp subdirectory.

This is required for a git checkout to compile at all on Fedora 44.
Do not leave its version open-ended; SemVer-bound it instead.
@musicinmybrain
musicinmybrain force-pushed the libcryptsetup-rs-0.15 branch from 46f76dd to bbbd3fb Compare May 19, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant