diff --git a/src/asn1_types/tagged/implicit.rs b/src/asn1_types/tagged/implicit.rs index ed98b63..5594e49 100644 --- a/src/asn1_types/tagged/implicit.rs +++ b/src/asn1_types/tagged/implicit.rs @@ -124,7 +124,7 @@ where let inner_len = self.inner.write_der_content(&mut sink)?; // XXX X.690 section 8.14.3: if implicing tagging was used [...]: // XXX a) the encoding shall be constructed if the base encoding is constructed, and shall be primitive otherwise - let constructed = matches!(TAG, 16 | 17); + let constructed = matches!(self.inner.tag(), Tag::Sequence | Tag::Set); let header = Header::new(class, constructed, self.tag(), Length::Definite(inner_len)); header.write_der_header(writer).map_err(Into::into) }