mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-27 01:24:16 +01:00
ASN.1: Add helper macro to detect string types
This commit is contained in:
parent
819799cfc6
commit
cba7122d74
@ -90,6 +90,18 @@
|
|||||||
#define MBEDTLS_ASN1_CONSTRUCTED 0x20
|
#define MBEDTLS_ASN1_CONSTRUCTED 0x20
|
||||||
#define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80
|
#define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80
|
||||||
|
|
||||||
|
/* Slightly smaller way to check if tag is a string tag
|
||||||
|
* compared to canonical implementation. */
|
||||||
|
#define MBEDTLS_ASN1_IS_STRING_TAG( tag ) \
|
||||||
|
( ( tag ) < 32u && ( \
|
||||||
|
( ( 1u << ( tag ) ) & ( ( 1u << MBEDTLS_ASN1_BMP_STRING ) | \
|
||||||
|
( 1u << MBEDTLS_ASN1_UTF8_STRING ) | \
|
||||||
|
( 1u << MBEDTLS_ASN1_T61_STRING ) | \
|
||||||
|
( 1u << MBEDTLS_ASN1_IA5_STRING ) | \
|
||||||
|
( 1u << MBEDTLS_ASN1_UNIVERSAL_STRING ) | \
|
||||||
|
( 1u << MBEDTLS_ASN1_PRINTABLE_STRING ) | \
|
||||||
|
( 1u << MBEDTLS_ASN1_BIT_STRING ) ) ) != 0 ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Bit masks for each of the components of an ASN.1 tag as specified in
|
* Bit masks for each of the components of an ASN.1 tag as specified in
|
||||||
* ITU X.690 (08/2015), section 8.1 "General rules for encoding",
|
* ITU X.690 (08/2015), section 8.1 "General rules for encoding",
|
||||||
|
Loading…
Reference in New Issue
Block a user