@@ -22,19 +22,23 @@ pub const DEFAULT_UEFI_LOGS_APPENDABLE: bool = true;
22
22
pub const DEFAULT_UEFI_LOGS_EVIDENCE_VERSION : & str = "2.1" ;
23
23
pub const DEFAULT_UEFI_LOGS_FORMATS : & [ & str ] = & [ "application/octet-stream" ] ;
24
24
pub const DEFAULT_UEFI_LOGS_SUPPORTS_PARTIAL_ACCESS : bool = true ;
25
- pub const DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH : & str =
26
- "/sys/kernel/security/tpm0" ;
27
- pub static DEFAULT_MEASUREDBOOT_ML_COUNT_FILE : Lazy < String > =
28
- Lazy :: new ( || format ! ( "{}/count" , DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH ) ) ;
25
+
26
+ pub const DEFAULT_UEFI_LOGS_BINARY_PATH : & str = "/sys/kernel/security/tpm0" ;
27
+ pub const DEFAULT_UEFI_LOGS_BINARY_FILE : & str = "binary_bios_measurements" ;
28
+ pub static DEFAULT_UEFI_LOGS_BINARY_FILE_PATH : Lazy < String > =
29
+ Lazy :: new ( || {
30
+ format ! (
31
+ "{}/{}" ,
32
+ DEFAULT_UEFI_LOGS_BINARY_PATH , DEFAULT_UEFI_LOGS_BINARY_FILE
33
+ )
34
+ } ) ;
29
35
30
36
pub trait PushModelConfigTrait {
31
37
fn get_certification_keys_server_identifier ( & self ) -> String ;
32
38
fn get_contact_ip ( & self ) -> String ;
33
39
fn get_contact_port ( & self ) -> u32 ;
34
40
fn get_enable_iak_idevid ( & self ) -> bool ;
35
41
fn get_ek_handle ( & self ) -> String ;
36
- fn get_measuredboot_ml_directory_path ( & self ) -> String ;
37
- fn get_measuredboot_ml_count_file ( & self ) -> String ;
38
42
fn get_ima_logs_appendable ( & self ) -> bool ;
39
43
fn get_ima_logs_formats ( & self ) -> Vec < String > ;
40
44
fn get_ima_logs_supports_partial_access ( & self ) -> bool ;
@@ -51,6 +55,7 @@ pub trait PushModelConfigTrait {
51
55
fn get_registrar_api_versions ( & self ) -> Vec < String > ;
52
56
fn get_api_versions ( & self ) -> Vec < String > ;
53
57
fn get_uefi_logs_appendable ( & self ) -> bool ;
58
+ fn get_uefi_logs_binary_file_path ( & self ) -> String ;
54
59
fn get_uefi_logs_evidence_version ( & self ) -> String ;
55
60
fn get_uefi_logs_formats ( & self ) -> Vec < String > ;
56
61
fn get_uefi_logs_supports_partial_access ( & self ) -> bool ;
@@ -78,11 +83,6 @@ impl Default for PushModelConfig {
78
83
. to_string ( )
79
84
. clone ( ) ,
80
85
ima_ml_count_file : DEFAULT_IMA_ML_COUNT_FILE . to_string ( ) . clone ( ) ,
81
- measuredboot_ml_directory_path :
82
- DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH . to_string ( ) . clone ( ) ,
83
- measuredboot_ml_count_file : DEFAULT_MEASUREDBOOT_ML_COUNT_FILE
84
- . to_string ( )
85
- . clone ( ) ,
86
86
registrar_ip : DEFAULT_REGISTRAR_IP . to_string ( ) ,
87
87
registrar_port : DEFAULT_REGISTRAR_PORT ,
88
88
registrar_api_versions : DEFAULT_REGISTRAR_API_VERSIONS
@@ -93,6 +93,8 @@ impl Default for PushModelConfig {
93
93
server_key : DEFAULT_SERVER_KEY . to_string ( ) ,
94
94
server_key_password : DEFAULT_SERVER_KEY_PASSWORD . to_string ( ) ,
95
95
uefi_logs_appendable : DEFAULT_UEFI_LOGS_APPENDABLE ,
96
+ uefi_logs_binary_file_path : DEFAULT_UEFI_LOGS_BINARY_FILE_PATH
97
+ . to_string ( ) ,
96
98
uefi_logs_evidence_version : DEFAULT_UEFI_LOGS_EVIDENCE_VERSION
97
99
. to_string ( ) ,
98
100
uefi_logs_formats : DEFAULT_UEFI_LOGS_FORMATS
@@ -125,8 +127,6 @@ pub struct PushModelConfig {
125
127
ima_logs_supports_partial_access : bool ,
126
128
ima_ml_directory_path : String ,
127
129
ima_ml_count_file : String ,
128
- measuredboot_ml_directory_path : String ,
129
- measuredboot_ml_count_file : String ,
130
130
registrar_api_versions : Vec < String > ,
131
131
registrar_ip : String ,
132
132
registrar_port : u32 ,
@@ -136,6 +136,7 @@ pub struct PushModelConfig {
136
136
tpm_encryption_alg : String ,
137
137
tpm_hash_alg : String ,
138
138
tpm_signing_alg : String ,
139
+ uefi_logs_binary_file_path : String ,
139
140
uefi_logs_evidence_version : String ,
140
141
uefi_logs_supports_partial_access : bool ,
141
142
uefi_logs_appendable : bool ,
@@ -190,14 +191,6 @@ impl PushModelConfigTrait for PushModelConfig {
190
191
self . ima_ml_directory_path . clone ( )
191
192
}
192
193
193
- fn get_measuredboot_ml_directory_path ( & self ) -> String {
194
- self . measuredboot_ml_directory_path . clone ( )
195
- }
196
-
197
- fn get_measuredboot_ml_count_file ( & self ) -> String {
198
- self . measuredboot_ml_count_file . clone ( )
199
- }
200
-
201
194
fn get_registrar_ip ( & self ) -> String {
202
195
self . registrar_ip . clone ( )
203
196
}
@@ -226,6 +219,10 @@ impl PushModelConfigTrait for PushModelConfig {
226
219
self . uefi_logs_appendable
227
220
}
228
221
222
+ fn get_uefi_logs_binary_file_path ( & self ) -> String {
223
+ self . uefi_logs_binary_file_path . clone ( )
224
+ }
225
+
229
226
fn get_uefi_logs_evidence_version ( & self ) -> String {
230
227
self . uefi_logs_evidence_version . clone ( )
231
228
}
@@ -265,9 +262,9 @@ impl PushModelConfigTrait for PushModelConfig {
265
262
enable_iak_idevid: {}, ek_handle: {},
266
263
ima_logs_appendable: {}, ima_logs_formats: {:?}, ima_logs_supports_partial_access: {},
267
264
ima_ml_directory_path: {}, ima_ml_count_file: {},
268
- measuredboot_ml_directory_path: {}, measuredboot_ml_count_file: {},
269
265
registrar_ip: {}, registrar_port: {}, server_cert: {},
270
266
server_key: {}, server_key_password: {},
267
+ uefi_logs_binary_file_path: {},
271
268
uefi_logs_evidence_version: {}, uefi_logs_supports_partial_access: {},
272
269
uefi_logs_appendable: {}, uefi_logs_formats: {:?},
273
270
tpm_encryption_alg: {}, tpm_hash_alg: {}, tpm_signing_alg: {},
@@ -282,13 +279,12 @@ impl PushModelConfigTrait for PushModelConfig {
282
279
self . ima_logs_supports_partial_access,
283
280
self . ima_ml_directory_path,
284
281
self . ima_ml_count_file,
285
- self . measuredboot_ml_directory_path,
286
- self . measuredboot_ml_count_file,
287
282
self . registrar_ip,
288
283
self . registrar_port,
289
284
self . server_cert,
290
285
self . server_key,
291
286
self . server_key_password,
287
+ self . uefi_logs_binary_file_path,
292
288
self . uefi_logs_evidence_version,
293
289
self . uefi_logs_supports_partial_access,
294
290
self . uefi_logs_appendable,
@@ -343,19 +339,18 @@ mod tests {
343
339
pmc. get_ima_ml_count_file( )
344
340
== DEFAULT_IMA_ML_COUNT_FILE . to_string( )
345
341
) ;
346
- assert ! (
347
- pmc. get_measuredboot_ml_directory_path( )
348
- == DEFAULT_MEASUREDBOOT_ML_DIRECTORY_PATH
349
- ) ;
350
- assert ! (
351
- pmc. get_measuredboot_ml_count_file( )
352
- == DEFAULT_MEASUREDBOOT_ML_COUNT_FILE . to_string( )
353
- ) ;
354
342
assert ! ( pmc. get_registrar_ip( ) == DEFAULT_REGISTRAR_IP ) ;
355
343
assert ! ( pmc. get_registrar_port( ) == DEFAULT_REGISTRAR_PORT ) ;
356
344
assert ! ( pmc. get_server_cert( ) == DEFAULT_SERVER_CERT ) ;
357
345
assert ! ( pmc. get_server_key( ) == DEFAULT_SERVER_KEY ) ;
358
346
assert ! ( pmc. get_server_key_password( ) == DEFAULT_SERVER_KEY_PASSWORD ) ;
347
+ assert ! (
348
+ pmc. get_uefi_logs_appendable( ) == DEFAULT_UEFI_LOGS_APPENDABLE
349
+ ) ;
350
+ assert ! (
351
+ pmc. get_uefi_logs_binary_file_path( )
352
+ == DEFAULT_UEFI_LOGS_BINARY_FILE_PATH . to_string( )
353
+ ) ;
359
354
assert ! (
360
355
pmc. get_uefi_logs_evidence_version( )
361
356
== DEFAULT_UEFI_LOGS_EVIDENCE_VERSION
@@ -384,7 +379,7 @@ mod tests {
384
379
385
380
#[ test]
386
381
fn test_display_config ( ) {
387
- let pmc = PushModelConfig :: default ( ) ;
382
+ let pmc = PushModelConfig :: new ( ) ;
388
383
let display_string = pmc. to_string ( ) ;
389
384
assert ! ( display_string
390
385
. contains( & pmc. get_certification_keys_server_identifier( ) ) ) ;
@@ -404,11 +399,6 @@ mod tests {
404
399
) ) ;
405
400
assert ! ( display_string. contains( & pmc. get_ima_ml_directory_path( ) ) ) ;
406
401
assert ! ( display_string. contains( & pmc. get_ima_ml_count_file( ) ) ) ;
407
- assert ! ( display_string
408
- . contains( & pmc. get_measuredboot_ml_directory_path( ) ) ) ;
409
- assert ! (
410
- display_string. contains( & pmc. get_measuredboot_ml_count_file( ) )
411
- ) ;
412
402
assert ! ( display_string. contains( & pmc. get_registrar_ip( ) ) ) ;
413
403
assert ! (
414
404
display_string. contains( & pmc. get_registrar_port( ) . to_string( ) )
0 commit comments