tpm2_protocol/message/
attached.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2// Copyright (c) 2025 Opinsys Oy
3// Copyright (c) 2024-2025 Jarkko Sakkinen
4
5//! 32 Attached Components
6
7use crate::{
8    data::{Tpm2bMaxBuffer, Tpm2bName, TpmAt, TpmCc, TpmiYesNo, TpmlAcCapabilities, TpmsAcOutput},
9    tpm_struct,
10};
11use core::fmt::Debug;
12
13tpm_struct! {
14    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
15    kind: Command,
16    name: TpmAcGetCapabilityCommand,
17    cc: TpmCc::AcGetCapability,
18    handles: {
19        pub ac: u32,
20    },
21    parameters: {
22        pub capability: TpmAt,
23        pub count: u32,
24    }
25}
26
27tpm_struct! {
28    #[derive(Debug, PartialEq, Eq, Clone)]
29    kind: Response,
30    name: TpmAcGetCapabilityResponse,
31    cc: TpmCc::AcGetCapability,
32    handles: {},
33    parameters: {
34        pub more_data: TpmiYesNo,
35        pub capabilities_data: TpmlAcCapabilities,
36    }
37}
38
39tpm_struct! {
40    #[derive(Debug, PartialEq, Eq, Clone)]
41    kind: Command,
42    name: TpmAcSendCommand,
43    cc: TpmCc::AcSend,
44    handles: {
45        pub send_object: crate::data::TpmiDhObject,
46        pub auth_handle: crate::data::TpmiDhObject,
47        pub ac: u32,
48    },
49    parameters: {
50        pub ac_data_in: Tpm2bMaxBuffer,
51    }
52}
53
54tpm_struct! {
55    #[derive(Debug, PartialEq, Eq, Clone)]
56    kind: Response,
57    name: TpmAcSendResponse,
58    cc: TpmCc::AcSend,
59    handles: {},
60    parameters: {
61        pub ac_data_out: TpmsAcOutput,
62    }
63}
64
65tpm_struct! {
66    #[derive(Debug, PartialEq, Eq, Clone)]
67    kind: Command,
68    name: TpmPolicyAcSendSelectCommand,
69    cc: TpmCc::PolicyAcSendSelect,
70    handles: {
71        pub policy_session: crate::data::TpmiShAuthSession,
72    },
73    parameters: {
74        pub object_name: Tpm2bName,
75        pub auth_handle_name: Tpm2bName,
76        pub ac_name: Tpm2bName,
77        pub include_object: TpmiYesNo,
78    }
79}
80
81tpm_struct! {
82    #[derive(Debug, Default, PartialEq, Eq, Clone, Copy)]
83    kind: Response,
84    name: TpmPolicyAcSendSelectResponse,
85    cc: TpmCc::PolicyAcSendSelect,
86    handles: {},
87    parameters: {}
88}
89
90tpm_struct! {
91    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
92    kind: Command,
93    name: TpmActSetTimeoutCommand,
94    cc: TpmCc::ActSetTimeout,
95    handles: {
96        pub act_handle: u32,
97    },
98    parameters: {
99        pub start_timeout: u32,
100    }
101}
102
103tpm_struct! {
104    #[derive(Debug, Default, PartialEq, Eq, Clone, Copy)]
105    kind: Response,
106    name: TpmActSetTimeoutResponse,
107    cc: TpmCc::ActSetTimeout,
108    handles: {},
109    parameters: {}
110}