-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an enum with `Ber` and `Der` (default) variants which can be used to selectively allow a limited number of BER productions when decoding certain BER-based security-oriented formats, e.g. CMS, PKCS#8. Currently this doesn't actually do anything, however the goal is to address #779, where we can't decode CMS generated by Apple tooling. PR #810 is an example of how the rules could be relaxed to support `IndefiniteLength`s.
- Loading branch information
Showing
6 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// ASN.1 encoding rules. | ||
/// | ||
/// This enum identifies the specific encoding rules which are applied at the time a given document | ||
/// is decoded from a byte/octet serialization. | ||
/// | ||
/// In addition to the Distinguished Encoding Rules (DER), this crate also supports a strict subset | ||
/// of the Basic Encoding Rules (BER) which supports the minimum amount of additional productions | ||
/// beyond DER needed to interoperate with other implementations of cryptography-oriented formats | ||
/// which utilize BER, e.g. CMS, PKCS#8. | ||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, PartialOrd, Ord)] | ||
pub enum EncodingRules { | ||
/// Basic Encoding Rules. | ||
Ber, | ||
|
||
/// Distinguished Encoding Rules. | ||
#[default] | ||
Der, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters