Skip to content

Commit

Permalink
use tls_deserialize_bytes instead of tls_deserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Nov 22, 2023
1 parent 41eae91 commit d4f9af8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x509-cert/src/ext/pkix/sct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl SignedCertificateTimestampList {
let mut bytes = tls_vec.as_slice();
let mut result = Vec::new();
while !bytes.is_empty() {
let (serialized_sct, rest) = SerializedSct::tls_deserialize(bytes)?;
let (serialized_sct, rest) = SerializedSct::tls_deserialize_bytes(bytes)?;
result.push(serialized_sct);
bytes = rest;
}
Expand Down Expand Up @@ -115,7 +115,7 @@ impl SerializedSct {
/// deserialized or if there are trailing bytes after a
/// [SignedCertificateTimestamp] has been deserialized.
pub fn parse_timestamp(&self) -> Result<SignedCertificateTimestamp, Error> {
let (sct, rest) = SignedCertificateTimestamp::tls_deserialize(self.data.as_slice())?;
let (sct, rest) = SignedCertificateTimestamp::tls_deserialize_bytes(self.data.as_slice())?;
if !rest.is_empty() {
return Err(tls_codec::Error::TrailingData)?;
}
Expand Down Expand Up @@ -264,7 +264,7 @@ mod tests {
bytes: &'a [u8],
expected_result: Result<(T, &[u8]), tls_codec::Error>,
) -> Result<(T, &'a [u8]), tls_codec::Error> {
let actual_result = T::tls_deserialize(&bytes);
let actual_result = T::tls_deserialize_bytes(&bytes);
assert_eq!(actual_result, expected_result);
actual_result
}
Expand Down

0 comments on commit d4f9af8

Please sign in to comment.