utils: Read hybrid HKDs

* Add `HkdVersion` (classic or hybrid) and `HkdVersionSelection`.
* Add `get_verified_hkds_new` that returns a list of verified HKDs
  read according to the given `HkdVersionSelection`.

Co-Developed-by: Timo Keller <tkeller@linux.ibm.com>
Signed-off-by: Timo Keller <tkeller@linux.ibm.com>
Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2026-06-24 16:45:53 +02:00
committed by Steffen Eiden
parent cb9c2f993c
commit d6fc4921fb
5 changed files with 176 additions and 8 deletions
+6
View File
@@ -84,6 +84,9 @@ pub enum Error {
#[error("The provided host key document in {0} contains no certificate!")]
NoHkdInFile(String),
#[error("The provided host key document in {0} contains the wrong number of keys!")]
WrongNumberOfKeys(String),
#[error("Invalid input size ({0}) for boot hdr")]
InvBootHdrSize(usize),
@@ -135,6 +138,9 @@ pub enum Error {
#[error("Unsupported cipher: {:?}", .0.as_raw())]
UnsupportedCipher(Nid),
#[error("{}", .0)]
InvalidHkd(String),
}
// used in macros