fix(shim-kvm): correct ASN.1 encoding for SNP attestation
The wrong sub-chunk length was used to calculate size of the combined
report + vcek chunk length.
This manifested in the rare case, where the vcek download failed and was
of size 0. This will be fixed in another PR.
@@ -130,7 +130,7 @@ pub fn asn1_encode_report_vcek(chunks: &mut [u8], report: &[u8], vcek: &[u8]) ->
let report_chunk_len = report_chunk_len_f()?;
let vcek_len = vcek.len();
let len = report_chunk_len
- .checked_add(calc_asn_header_len(vcek_len)?)?
+ .checked_add(calc_asn_header_len(report_chunk_len)?)?
.checked_add(vcek_len)?;
Some(len)
};
