-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Description
IMPLICIT decoder requires Tagged
trait.
formats/der/src/asn1/context_specific.rs
Lines 58 to 63 in 937e611
pub fn decode_implicit<'a, R: Reader<'a>>( | |
reader: &mut R, | |
tag_number: TagNumber, | |
) -> Result<Option<Self>, T::Error> | |
where | |
T: DecodeValue<'a> + Tagged, |
IMPLICIT and EXPLICIT decoders check for constructed bit.
But IMPLICIT depends on value.tag()
in runtime:
formats/der/src/asn1/context_specific.rs
Lines 69 to 70 in 937e611
if header.tag.is_constructed() != value.tag().is_constructed() { | |
return Err(header.tag.non_canonical_error().into()); |
formats/der/src/asn1/context_specific.rs
Lines 161 to 164 in 937e611
fn tag(&self) -> Tag { | |
let constructed = match self.tag_mode { | |
TagMode::Explicit => true, | |
TagMode::Implicit => self.value.tag().is_constructed(), |
I think it should check constructed bit statically, like FixedTag
.
Metadata
Metadata
Assignees
Labels
No labels