mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-30 07:14:18 +01:00
Add macros to ASN.1 module to parse ASN.1 tags
The macros simply extract the component bits of an ASN.1 tag value
This commit is contained in:
parent
aed7188b2e
commit
45a556501c
@ -87,6 +87,22 @@
|
|||||||
#define MBEDTLS_ASN1_PRIMITIVE 0x00
|
#define MBEDTLS_ASN1_PRIMITIVE 0x00
|
||||||
#define MBEDTLS_ASN1_CONSTRUCTED 0x20
|
#define MBEDTLS_ASN1_CONSTRUCTED 0x20
|
||||||
#define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80
|
#define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bit masks for each of the components of an ASN.1 tag as specified in
|
||||||
|
* Information technnology - ASN.1 encoding rules: Specification of Basic
|
||||||
|
* Encoding Rules (BER), Canonical Encoding Rules (CER), and Distinguished
|
||||||
|
* encoding rules (DER) Section 8.1.2.2:
|
||||||
|
*
|
||||||
|
* Bit 8 7 6 5 1
|
||||||
|
* +-------+-----+------------+
|
||||||
|
* | Class | P/C | Tag number |
|
||||||
|
* +-------+-----+------------+
|
||||||
|
*/
|
||||||
|
#define MBEDTLS_ASN1_TAG_CLASS_MASK ( 0x03 << 6 )
|
||||||
|
#define MBEDTLS_ASN1_TAG_PC_MASK ( 0x01 << 5 )
|
||||||
|
#define MBEDTLS_ASN1_TAG_VALUE_MASK ( 0x1F << 0 )
|
||||||
|
|
||||||
/* \} name */
|
/* \} name */
|
||||||
/* \} addtogroup asn1_module */
|
/* \} addtogroup asn1_module */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user