rust/pv: Use a SecretId struct instead of an array

This streamlines and unifies the use and (de)serialization of structs
using a secret id. As a bonus, the hidden `for_pv` module is not longer
needed.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Julian Ruess <julianr@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2024-02-15 17:06:04 +01:00
committed by Jan Höppner
parent 81a1e13f3b
commit c53dfa9754
6 changed files with 161 additions and 76 deletions
+2 -2
View File
@@ -528,8 +528,8 @@ mod tests {
fn make_assoc_secretentry(idx: u16, hexidstr: &str) -> SecretEntry {
let id = hexstring_to_u8(hexidstr);
let idlen: u32 = id.len().try_into().unwrap();
let idarray = <&[u8; 32]>::try_from(id.as_slice()).unwrap();
SecretEntry::new(idx, ListableSecretType::Association, *idarray, idlen)
let idarray: [u8; 32] = id.try_into().unwrap();
SecretEntry::new(idx, ListableSecretType::Association, idarray.into(), idlen)
}
fn make_test_secrets() -> Vec<SecretEntry> {