Lines Matching refs:hdr
14 int asn1_get_next(const u8 *buf, size_t len, struct asn1_hdr *hdr) in asn1_get_next() argument
19 os_memset(hdr, 0, sizeof(*hdr)); in asn1_get_next()
23 hdr->identifier = *pos++; in asn1_get_next()
24 hdr->class = hdr->identifier >> 6; in asn1_get_next()
25 hdr->constructed = !!(hdr->identifier & (1 << 5)); in asn1_get_next()
27 if ((hdr->identifier & 0x1f) == 0x1f) { in asn1_get_next()
28 hdr->tag = 0; in asn1_get_next()
38 hdr->tag = (hdr->tag << 7) | (tmp & 0x7f); in asn1_get_next()
41 hdr->tag = hdr->identifier & 0x1f; in asn1_get_next()
51 hdr->length = 0; in asn1_get_next()
62 hdr->length = (hdr->length << 8) | *pos++; in asn1_get_next()
66 hdr->length = tmp; in asn1_get_next()
69 if (end < pos || hdr->length > (unsigned int) (end - pos)) { in asn1_get_next()
74 hdr->payload = pos; in asn1_get_next()
126 struct asn1_hdr hdr; in asn1_get_oid() local
128 if (asn1_get_next(buf, len, &hdr) < 0 || hdr.length == 0) in asn1_get_oid()
131 if (hdr.class != ASN1_CLASS_UNIVERSAL || hdr.tag != ASN1_TAG_OID) { in asn1_get_oid()
133 "tag 0x%x", hdr.class, hdr.tag); in asn1_get_oid()
137 *next = hdr.payload + hdr.length; in asn1_get_oid()
139 return asn1_parse_oid(hdr.payload, hdr.length, oid); in asn1_get_oid()