Lines Matching full:hdr

62 int asn1_get_next(const u8 *buf, size_t len, struct asn1_hdr *hdr);
63 void asn1_print_hdr(const struct asn1_hdr *hdr, const char *title);
64 void asn1_unexpected(const struct asn1_hdr *hdr, const char *title);
72 int asn1_get_sequence(const u8 *buf, size_t len, struct asn1_hdr *hdr,
88 static inline bool asn1_is_oid(const struct asn1_hdr *hdr) in asn1_is_oid() argument
90 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_oid()
91 hdr->tag == ASN1_TAG_OID; in asn1_is_oid()
94 static inline bool asn1_is_boolean(const struct asn1_hdr *hdr) in asn1_is_boolean() argument
96 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_boolean()
97 hdr->tag == ASN1_TAG_BOOLEAN; in asn1_is_boolean()
100 static inline bool asn1_is_integer(const struct asn1_hdr *hdr) in asn1_is_integer() argument
102 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_integer()
103 hdr->tag == ASN1_TAG_INTEGER; in asn1_is_integer()
106 static inline bool asn1_is_enumerated(const struct asn1_hdr *hdr) in asn1_is_enumerated() argument
108 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_enumerated()
109 hdr->tag == ASN1_TAG_ENUMERATED; in asn1_is_enumerated()
112 static inline bool asn1_is_sequence(const struct asn1_hdr *hdr) in asn1_is_sequence() argument
114 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_sequence()
115 hdr->tag == ASN1_TAG_SEQUENCE; in asn1_is_sequence()
118 static inline bool asn1_is_set(const struct asn1_hdr *hdr) in asn1_is_set() argument
120 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_set()
121 hdr->tag == ASN1_TAG_SET; in asn1_is_set()
124 static inline bool asn1_is_octetstring(const struct asn1_hdr *hdr) in asn1_is_octetstring() argument
126 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_octetstring()
127 hdr->tag == ASN1_TAG_OCTETSTRING; in asn1_is_octetstring()
130 static inline bool asn1_is_bitstring(const struct asn1_hdr *hdr) in asn1_is_bitstring() argument
132 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_bitstring()
133 hdr->tag == ASN1_TAG_BITSTRING; in asn1_is_bitstring()
136 static inline bool asn1_is_utctime(const struct asn1_hdr *hdr) in asn1_is_utctime() argument
138 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_utctime()
139 hdr->tag == ASN1_TAG_UTCTIME; in asn1_is_utctime()
142 static inline bool asn1_is_generalizedtime(const struct asn1_hdr *hdr) in asn1_is_generalizedtime() argument
144 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_generalizedtime()
145 hdr->tag == ASN1_TAG_GENERALIZEDTIME; in asn1_is_generalizedtime()
148 static inline bool asn1_is_string_type(const struct asn1_hdr *hdr) in asn1_is_string_type() argument
150 if (hdr->class != ASN1_CLASS_UNIVERSAL || hdr->constructed) in asn1_is_string_type()
152 return hdr->tag == ASN1_TAG_UTF8STRING || in asn1_is_string_type()
153 hdr->tag == ASN1_TAG_NUMERICSTRING || in asn1_is_string_type()
154 hdr->tag == ASN1_TAG_PRINTABLESTRING || in asn1_is_string_type()
155 hdr->tag == ASN1_TAG_T61STRING || in asn1_is_string_type()
156 hdr->tag == ASN1_TAG_VIDEOTEXSTRING || in asn1_is_string_type()
157 hdr->tag == ASN1_TAG_IA5STRING || in asn1_is_string_type()
158 hdr->tag == ASN1_TAG_GRAPHICSTRING || in asn1_is_string_type()
159 hdr->tag == ASN1_TAG_VISIBLESTRING || in asn1_is_string_type()
160 hdr->tag == ASN1_TAG_GENERALSTRING || in asn1_is_string_type()
161 hdr->tag == ASN1_TAG_UNIVERSALSTRING || in asn1_is_string_type()
162 hdr->tag == ASN1_TAG_CHARACTERSTRING || in asn1_is_string_type()
163 hdr->tag == ASN1_TAG_BMPSTRING; in asn1_is_string_type()
166 static inline bool asn1_is_bmpstring(const struct asn1_hdr *hdr) in asn1_is_bmpstring() argument
168 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_bmpstring()
169 hdr->tag == ASN1_TAG_BMPSTRING; in asn1_is_bmpstring()
172 static inline bool asn1_is_utf8string(const struct asn1_hdr *hdr) in asn1_is_utf8string() argument
174 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_utf8string()
175 hdr->tag == ASN1_TAG_UTF8STRING; in asn1_is_utf8string()
178 static inline bool asn1_is_null(const struct asn1_hdr *hdr) in asn1_is_null() argument
180 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_null()
181 hdr->tag == ASN1_TAG_NULL; in asn1_is_null()
184 static inline bool asn1_is_cs_tag(const struct asn1_hdr *hdr, unsigned int tag) in asn1_is_cs_tag() argument
186 return hdr->class == ASN1_CLASS_CONTEXT_SPECIFIC && in asn1_is_cs_tag()
187 hdr->tag == tag; in asn1_is_cs_tag()