Skip to content

Commit 20b2b73

Browse files
butler54claude
andcommitted
feat: store raw SHA-256 hash alongside PCR8 hash in initdata ConfigMaps
Adds RAW_HASH field to both initdata and debug-initdata ConfigMaps. PCR8_HASH = SHA256(zeros || SHA256(toml)) — used by Azure vTPM attestation RAW_HASH = SHA256(toml) — used by baremetal TDX/SNP attestation Both are needed because Azure and baremetal present initdata differently in their attestation evidence. A single Trustee attestation server must accept both formats to support multi-platform deployments. Future: integrate veritas for comprehensive reference value generation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e462936 commit 20b2b73

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

ansible/init-data-gzipper.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,33 @@
114114
register: debug_initdata_encoded
115115
changed_when: false
116116

117+
- name: Compute raw SHA-256 hash of default initdata
118+
ansible.builtin.shell: |
119+
set -o pipefail
120+
sha256sum "{{ rendered_path }}" | cut -d' ' -f1
121+
register: raw_hash
122+
changed_when: false
123+
124+
- name: Compute raw SHA-256 hash of debug initdata
125+
ansible.builtin.shell: |
126+
set -o pipefail
127+
sha256sum "{{ debug_rendered_path }}" | cut -d' ' -f1
128+
register: debug_raw_hash
129+
changed_when: false
130+
117131
- name: Register init data pcr into a var
118132
ansible.builtin.shell: |
119133
set -o pipefail
120-
hash=$(sha256sum "{{ rendered_path }}" | cut -d' ' -f1)
121134
initial_pcr=0000000000000000000000000000000000000000000000000000000000000000
122-
PCR8_HASH=$(echo -n "$initial_pcr$hash" | xxd -r -p | sha256sum | cut -d' ' -f1) && echo $PCR8_HASH
135+
PCR8_HASH=$(echo -n "$initial_pcr{{ raw_hash.stdout }}" | xxd -r -p | sha256sum | cut -d' ' -f1) && echo $PCR8_HASH
123136
register: pcr8_hash
124137
changed_when: false
125138

126139
- name: Register debug init data pcr into a var
127140
ansible.builtin.shell: |
128141
set -o pipefail
129-
hash=$(sha256sum "{{ debug_rendered_path }}" | cut -d' ' -f1)
130142
initial_pcr=0000000000000000000000000000000000000000000000000000000000000000
131-
PCR8_HASH=$(echo -n "$initial_pcr$hash" | xxd -r -p | sha256sum | cut -d' ' -f1) && echo $PCR8_HASH
143+
PCR8_HASH=$(echo -n "$initial_pcr{{ debug_raw_hash.stdout }}" | xxd -r -p | sha256sum | cut -d' ' -f1) && echo $PCR8_HASH
132144
register: debug_pcr8_hash
133145
changed_when: false
134146

@@ -147,6 +159,7 @@
147159
data:
148160
INITDATA: "{{ initdata_encoded.stdout }}"
149161
PCR8_HASH: "{{ pcr8_hash.stdout }}"
162+
RAW_HASH: "{{ raw_hash.stdout }}"
150163
version: "0.1.0"
151164
algorithm: "sha256"
152165
aa.toml: "{{ raw_aa_toml.stdout }}"
@@ -168,6 +181,7 @@
168181
data:
169182
INITDATA: "{{ debug_initdata_encoded.stdout }}"
170183
PCR8_HASH: "{{ debug_pcr8_hash.stdout }}"
184+
RAW_HASH: "{{ debug_raw_hash.stdout }}"
171185
version: "0.1.0"
172186
algorithm: "sha256"
173187
aa.toml: "{{ raw_aa_toml.stdout }}"

0 commit comments

Comments
 (0)