diff --git a/modules/remote-attestation/src/ias_utils.rs b/modules/remote-attestation/src/ias_utils.rs index bd3346e2..23bec347 100644 --- a/modules/remote-attestation/src/ias_utils.rs +++ b/modules/remote-attestation/src/ias_utils.rs @@ -415,6 +415,7 @@ pub(crate) fn decode_spid(spid_str: &str) -> Result { } }; let mut spid = sgx_spid_t::default(); - spid.id.copy_from_slice(&decoded_vec[..16]); + // the length of `decoded_vec` is 16 because each byte is represented by 2 characters + spid.id.copy_from_slice(&decoded_vec); Ok(spid) }