@@ -9,10 +9,6 @@ pub const DEFAULT_CONTACT_PORT: u32 = 9002;
9
9
pub const DEFAULT_IMA_ML_DIRECTORY_PATH : & str = "/sys/kernel/security/ima" ;
10
10
pub static DEFAULT_IMA_ML_COUNT_FILE : Lazy < String > =
11
11
Lazy :: new ( || format ! ( "{}/measurements" , DEFAULT_IMA_ML_DIRECTORY_PATH ) ) ;
12
- pub const DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH : & str =
13
- "/sys/kernel/security/tpm0" ;
14
- pub static DEFAULT_MEASUREDBOOT_ML_COUNT_FILE : Lazy < String > =
15
- Lazy :: new ( || format ! ( "{}/count" , DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH ) ) ;
16
12
pub const DEFAULT_EK_HANDLE : & str = "" ;
17
13
pub const DEFAULT_ENABLE_IAK_IDEVID : bool = false ;
18
14
pub const DEFAULT_IP : & str = "127.0.0.1" ;
@@ -26,6 +22,16 @@ pub const DEFAULT_SERVER_KEY_PASSWORD: &str = "";
26
22
pub const DEFAULT_TPM_HASH_ALG : & str = "sha256" ;
27
23
pub const DEFAULT_TPM_ENCRYPTION_ALG : & str = "rsa" ;
28
24
pub const DEFAULT_TPM_SIGNING_ALG : & str = "rsassa" ;
25
+ pub const DEFAULT_UEFI_LOGS_BINARY_PATH : & str = "/sys/kernel/security/tpm0" ;
26
+ pub const DEFAULT_UEFI_LOGS_BINARY_FILE : & str = "binary_bios_measurements" ;
27
+ pub static DEFAULT_UEFI_LOGS_BINARY_FILE_PATH : Lazy < String > =
28
+ Lazy :: new ( || {
29
+ format ! (
30
+ "{}/{}" ,
31
+ DEFAULT_UEFI_LOGS_BINARY_PATH , DEFAULT_UEFI_LOGS_BINARY_FILE
32
+ )
33
+ } ) ;
34
+
29
35
pub const DEFAULT_UUID : & str = "b0acd25f-2205-4c37-932d-e8f99a8d39ef" ;
30
36
31
37
// IMA logs specific defaults
@@ -45,8 +51,6 @@ pub trait PushModelConfigTrait {
45
51
fn get_contact_port ( & self ) -> u32 ;
46
52
fn get_enable_iak_idevid ( & self ) -> bool ;
47
53
fn get_ek_handle ( & self ) -> String ;
48
- fn get_measuredboot_ml_directory_path ( & self ) -> String ;
49
- fn get_measuredboot_ml_count_file ( & self ) -> String ;
50
54
fn get_ima_logs_appendable ( & self ) -> bool ;
51
55
fn get_ima_logs_formats ( & self ) -> Vec < String > ;
52
56
fn get_ima_logs_supports_partial_access ( & self ) -> bool ;
@@ -63,6 +67,7 @@ pub trait PushModelConfigTrait {
63
67
fn get_registrar_api_versions ( & self ) -> Vec < String > ;
64
68
fn get_api_versions ( & self ) -> Vec < String > ;
65
69
fn get_uefi_logs_appendable ( & self ) -> bool ;
70
+ fn get_uefi_logs_binary_file_path ( & self ) -> String ;
66
71
fn get_uefi_logs_evidence_version ( & self ) -> String ;
67
72
fn get_uefi_logs_formats ( & self ) -> Vec < String > ;
68
73
fn get_uefi_logs_supports_partial_access ( & self ) -> bool ;
@@ -88,8 +93,6 @@ pub struct PushModelConfig {
88
93
ima_logs_supports_partial_access : bool ,
89
94
ima_ml_directory_path : String ,
90
95
ima_ml_count_file : String ,
91
- measuredboot_ml_directory_path : String ,
92
- measuredboot_ml_count_file : String ,
93
96
registrar_api_versions : Vec < String > ,
94
97
registrar_ip : String ,
95
98
registrar_port : u32 ,
@@ -99,10 +102,11 @@ pub struct PushModelConfig {
99
102
tpm_encryption_alg : String ,
100
103
tpm_hash_alg : String ,
101
104
tpm_signing_alg : String ,
102
- uefi_logs_evidence_version : String ,
103
- uefi_logs_supports_partial_access : bool ,
104
105
uefi_logs_appendable : bool ,
106
+ uefi_logs_binary_file_path : String ,
107
+ uefi_logs_evidence_version : String ,
105
108
uefi_logs_formats : Vec < String > ,
109
+ uefi_logs_supports_partial_access : bool ,
106
110
uuid : String ,
107
111
}
108
112
@@ -126,11 +130,6 @@ impl PushModelConfig {
126
130
. to_string ( )
127
131
. clone ( ) ,
128
132
ima_ml_count_file : DEFAULT_IMA_ML_COUNT_FILE . to_string ( ) . clone ( ) ,
129
- measuredboot_ml_directory_path :
130
- DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH . to_string ( ) . clone ( ) ,
131
- measuredboot_ml_count_file : DEFAULT_MEASUREDBOOT_ML_COUNT_FILE
132
- . to_string ( )
133
- . clone ( ) ,
134
133
registrar_ip : DEFAULT_REGISTRAR_IP . to_string ( ) ,
135
134
registrar_port : DEFAULT_REGISTRAR_PORT ,
136
135
registrar_api_versions : DEFAULT_REGISTRAR_API_VERSIONS
@@ -149,6 +148,8 @@ impl PushModelConfig {
149
148
. collect ( ) ,
150
149
uefi_logs_supports_partial_access :
151
150
DEFAULT_UEFI_LOGS_SUPPORTS_PARTIAL_ACCESS ,
151
+ uefi_logs_binary_file_path : DEFAULT_UEFI_LOGS_BINARY_FILE_PATH
152
+ . to_string ( ) ,
152
153
tpm_encryption_alg : DEFAULT_TPM_ENCRYPTION_ALG . to_string ( ) ,
153
154
tpm_hash_alg : DEFAULT_TPM_HASH_ALG . to_string ( ) ,
154
155
tpm_signing_alg : DEFAULT_TPM_SIGNING_ALG . to_string ( ) ,
@@ -186,14 +187,6 @@ impl PushModelConfigTrait for PushModelConfig {
186
187
self . ima_logs_appendable
187
188
}
188
189
189
- fn get_ima_logs_formats ( & self ) -> Vec < String > {
190
- self . ima_logs_formats . clone ( )
191
- }
192
-
193
- fn get_ima_logs_supports_partial_access ( & self ) -> bool {
194
- self . ima_logs_supports_partial_access
195
- }
196
-
197
190
fn get_ima_ml_count_file ( & self ) -> String {
198
191
self . ima_ml_count_file . clone ( )
199
192
}
@@ -202,12 +195,12 @@ impl PushModelConfigTrait for PushModelConfig {
202
195
self . ima_ml_directory_path . clone ( )
203
196
}
204
197
205
- fn get_measuredboot_ml_directory_path ( & self ) -> String {
206
- self . measuredboot_ml_directory_path . clone ( )
198
+ fn get_ima_logs_formats ( & self ) -> Vec < String > {
199
+ self . ima_logs_formats . clone ( )
207
200
}
208
201
209
- fn get_measuredboot_ml_count_file ( & self ) -> String {
210
- self . measuredboot_ml_count_file . clone ( )
202
+ fn get_ima_logs_supports_partial_access ( & self ) -> bool {
203
+ self . ima_logs_supports_partial_access
211
204
}
212
205
213
206
fn get_registrar_ip ( & self ) -> String {
@@ -238,6 +231,10 @@ impl PushModelConfigTrait for PushModelConfig {
238
231
self . uefi_logs_appendable
239
232
}
240
233
234
+ fn get_uefi_logs_binary_file_path ( & self ) -> String {
235
+ self . uefi_logs_binary_file_path . clone ( )
236
+ }
237
+
241
238
fn get_uefi_logs_evidence_version ( & self ) -> String {
242
239
self . uefi_logs_evidence_version . clone ( )
243
240
}
@@ -277,9 +274,9 @@ impl PushModelConfigTrait for PushModelConfig {
277
274
enable_iak_idevid: {}, ek_handle: {},
278
275
ima_logs_appendable: {}, ima_logs_formats: {:?}, ima_logs_supports_partial_access: {},
279
276
ima_ml_directory_path: {}, ima_ml_count_file: {},
280
- measuredboot_ml_directory_path: {}, measuredboot_ml_count_file: {},
281
277
registrar_ip: {}, registrar_port: {}, server_cert: {},
282
278
server_key: {}, server_key_password: {},
279
+ uefi_logs_binary_file_path: {},
283
280
uefi_logs_evidence_version: {}, uefi_logs_supports_partial_access: {},
284
281
uefi_logs_appendable: {}, uefi_logs_formats: {:?},
285
282
tpm_encryption_alg: {}, tpm_hash_alg: {}, tpm_signing_alg: {},
@@ -294,13 +291,12 @@ impl PushModelConfigTrait for PushModelConfig {
294
291
self . ima_logs_supports_partial_access,
295
292
self . ima_ml_directory_path,
296
293
self . ima_ml_count_file,
297
- self . measuredboot_ml_directory_path,
298
- self . measuredboot_ml_count_file,
299
294
self . registrar_ip,
300
295
self . registrar_port,
301
296
self . server_cert,
302
297
self . server_key,
303
298
self . server_key_password,
299
+ self . uefi_logs_binary_file_path,
304
300
self . uefi_logs_evidence_version,
305
301
self . uefi_logs_supports_partial_access,
306
302
self . uefi_logs_appendable,
@@ -355,14 +351,6 @@ mod tests {
355
351
pmc. get_ima_ml_count_file( )
356
352
== DEFAULT_IMA_ML_COUNT_FILE . to_string( )
357
353
) ;
358
- assert ! (
359
- pmc. get_measuredboot_ml_directory_path( )
360
- == DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH
361
- ) ;
362
- assert ! (
363
- pmc. get_measuredboot_ml_count_file( )
364
- == DEFAULT_MEASUREDBOOT_ML_COUNT_FILE . to_string( )
365
- ) ;
366
354
assert ! ( pmc. get_registrar_ip( ) == DEFAULT_REGISTRAR_IP ) ;
367
355
assert ! ( pmc. get_registrar_port( ) == DEFAULT_REGISTRAR_PORT ) ;
368
356
assert ! ( pmc. get_server_cert( ) == DEFAULT_SERVER_CERT ) ;
@@ -416,11 +404,6 @@ mod tests {
416
404
) ) ;
417
405
assert ! ( display_string. contains( & pmc. get_ima_ml_directory_path( ) ) ) ;
418
406
assert ! ( display_string. contains( & pmc. get_ima_ml_count_file( ) ) ) ;
419
- assert ! ( display_string
420
- . contains( & pmc. get_measuredboot_ml_directory_path( ) ) ) ;
421
- assert ! (
422
- display_string. contains( & pmc. get_measuredboot_ml_count_file( ) )
423
- ) ;
424
407
assert ! ( display_string. contains( & pmc. get_registrar_ip( ) ) ) ;
425
408
assert ! (
426
409
display_string. contains( & pmc. get_registrar_port( ) . to_string( ) )
0 commit comments