Skip to content

Commit 3d2f7f7

Browse files
committed
fde: change content of load_config aael from a json object to hex hash value
Signed-off-by: Kun Lai <[email protected]>
1 parent f3d1db1 commit 3d2f7f7

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ After entering the system, you can check the EventLog recorded by CryptPilot via
9898
```txt
9999
# cat /run/attestation-agent/eventlog
100100
INIT sha384/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
101-
cryptpilot.alibabacloud.com load_config {"alg":"sha384","value":"b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877"}
101+
cryptpilot.alibabacloud.com load_config b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877
102102
cryptpilot.alibabacloud.com fde_rootfs_hash a3f73f5b995e7d8915c998d9f1e56b0e063a6e20c2bbb512e88e8fbc4e8f2965
103103
cryptpilot.alibabacloud.com initrd_switch_root {}
104104
```
@@ -107,7 +107,7 @@ As shown above, three EventLogs will be recorded during the CryptPilot startup p
107107

108108
| Domain | Operation | Example Value | Description |
109109
| --- | --- | --- | --- |
110-
| cryptpilot.alibabacloud.com | load_config | `{"alg":"sha384","value":"b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877"}` | The hash value of the configuration file used by CryptPilot |
110+
| cryptpilot.alibabacloud.com | load_config | `b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877` | The SHA384 hash value of the configuration file used by CryptPilot |
111111
| cryptpilot.alibabacloud.com | fde_rootfs_hash | `a3f73f5b995e7d8915c998d9f1e56b0e063a6e20c2bbb512e88e8fbc4e8f2965` | The measurement value of the decrypted rootfs volume |
112112
| cryptpilot.alibabacloud.com | initrd_switch_root | `{}` | An event record indicating that the system has switched from the initrd phase to the real system. The value of this item is always `{}` |
113113

docs/configuration_zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ CryptPilot使用远程证明(Remote Attestation)技术来实现对根文件
9898
```txt
9999
# cat /run/attestation-agent/eventlog
100100
INIT sha384/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
101-
cryptpilot.alibabacloud.com load_config {"alg":"sha384","value":"b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877"}
101+
cryptpilot.alibabacloud.com load_config b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877
102102
cryptpilot.alibabacloud.com fde_rootfs_hash a3f73f5b995e7d8915c998d9f1e56b0e063a6e20c2bbb512e88e8fbc4e8f2965
103103
cryptpilot.alibabacloud.com initrd_switch_root {}
104104
```
@@ -107,7 +107,7 @@ cryptpilot.alibabacloud.com initrd_switch_root {}
107107

108108
| Domain | Operation | 示例值 | 描述 |
109109
| --- | --- | --- | --- |
110-
| cryptpilot.alibabacloud.com | load_config | `{"alg":"sha384","value":"b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877"}` | CryptPilot所使用的配置文件的hash值 |
110+
| cryptpilot.alibabacloud.com | load_config | `b8635580d85cb0a2b5896664eb795cadb99a589783817c81e263f6752f2a735d2705b4638947de3d947231b76b5a1877` | CryptPilot所使用的配置文件的SHA384值 |
111111
| cryptpilot.alibabacloud.com | fde_rootfs_hash | `a3f73f5b995e7d8915c998d9f1e56b0e063a6e20c2bbb512e88e8fbc4e8f2965` | 解密后启动的rootfs卷的度量值 |
112112
| cryptpilot.alibabacloud.com | initrd_switch_root | `{}` | 一个事件记录,用于标识系统当前已经从initrd阶段切换到真实的系统中,该项的值始终为`{}` |
113113

src/measure/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
pub mod attestation_agent;
33

44
use anyhow::Result;
5-
use serde_json::json;
65
use sha2::Digest;
76

87
pub const OPERATION_NAME_LOAD_CONFIG: &str = "load_config";
@@ -29,12 +28,7 @@ pub trait Measure {
2928
.finalize()
3029
.to_vec();
3130

32-
let hash = json! ({
33-
"alg": "sha384",
34-
"value": hex::encode(hash),
35-
});
36-
37-
Ok(hash.to_string())
31+
Ok(hex::encode(hash))
3832
}
3933
}
4034

0 commit comments

Comments
 (0)