From 9b144330dfdd15975395ffdb3c325985663e073c Mon Sep 17 00:00:00 2001 From: Sree Revoori Date: Wed, 31 Jan 2024 21:40:57 +0000 Subject: [PATCH] Fix encoding of SubjectKeyIdentifier Subject key identifier is implicit, not explicit. --- dpe/src/x509.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dpe/src/x509.rs b/dpe/src/x509.rs index e05a7309..f8a6f49c 100644 --- a/dpe/src/x509.rs +++ b/dpe/src/x509.rs @@ -1552,9 +1552,8 @@ impl CertWriter<'_> { &mut self, subject_key_identifier: &[u8], ) -> Result { - // 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,