rust/pv: Remove internal BinGuestSecret struct

The BinGuestSecret type provides no benefits. The public GuestSecret
struct can handle everything. Therefore, move the two functions from bin
to the non-bin variant. While at it, use a struct to define the binary
structure instead of copy numbers to some positions in a Vec. This
simplifies the addition of further secret types.

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-16 13:05:28 +01:00
committed by Jan Höppner
parent c53dfa9754
commit 9eab43994b
3 changed files with 138 additions and 74 deletions
+5 -2
View File
@@ -291,10 +291,13 @@ pub enum ListableSecretType {
/// Unknown secret type
Unknown(u16),
}
impl ListableSecretType {
const RESERVED_0: u16 = 0x0000;
const NULL: u16 = 0x0001;
const ASSOCIATION: u16 = 0x0002;
/// UV type id for a null secret
pub const NULL: u16 = 0x0001;
/// UV type id for an association secret
pub const ASSOCIATION: u16 = 0x0002;
}
impl Display for ListableSecretType {