Skip to content

Commit

Permalink
Fix encoding of SubjectKeyIdentifier
Browse files Browse the repository at this point in the history
Subject key identifier is implicit, not explicit.
  • Loading branch information
sree-revoori1 authored and jhand2 committed Jan 31, 2024
1 parent c1be779 commit 01128ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dpe/src/x509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1552,9 +1552,8 @@ impl CertWriter<'_> {
&mut self,
subject_key_identifier: &[u8],
) -> Result<usize, DpeErrorCode> {
// SubjectKeyIdentifier is EXPLICIT field number 0
let mut bytes_written =
self.encode_byte(Self::CONTEXT_SPECIFIC | Self::CONSTRUCTED | 0x0)?;
// SubjectKeyIdentifier is IMPLICIT field number 0
let mut bytes_written = self.encode_byte(Self::CONTEXT_SPECIFIC | 0x0)?;
bytes_written += self.encode_size_field(Self::get_subject_key_identifier_size(
subject_key_identifier,
/*tagged=*/ true,
Expand Down

0 comments on commit 01128ac

Please sign in to comment.