diff --git a/der/src/tag.rs b/der/src/tag.rs index 54ff3012a..ac4c249de 100644 --- a/der/src/tag.rs +++ b/der/src/tag.rs @@ -7,7 +7,9 @@ mod number; pub use self::{class::Class, mode::TagMode, number::TagNumber}; -use crate::{Decode, DerOrd, Encode, Error, ErrorKind, Length, Reader, Result, Writer}; +use crate::{ + Decode, DerOrd, Encode, EncodingRules, Error, ErrorKind, Length, Reader, Result, Writer, +}; use core::{cmp::Ordering, fmt}; /// Indicator bit for constructed form encoding (i.e. vs primitive form) @@ -91,10 +93,10 @@ pub enum Tag { /// `UTF8String` tag: `12`. Utf8String, - /// `SEQUENCE` tag: `16`. + /// `SEQUENCE` tag: `16` (constructed). Sequence, - /// `SET` and `SET OF` tag: `17`. + /// `SET` and `SET OF` tag: `17` (constructed). Set, /// `NumericString` tag: `18`. @@ -343,6 +345,7 @@ impl<'a> Decode<'a> for Tag { 0x1A => Tag::VisibleString, 0x1B => Tag::GeneralString, 0x1E => Tag::BmpString, + 0x24 if reader.encoding_rules() == EncodingRules::Ber => Tag::OctetString, // constructed 0x30 => Tag::Sequence, // constructed 0x31 => Tag::Set, // constructed 0x40..=0x7F => {