Lines Matching refs:hdr
25 int asn1_get_next(const u8 *buf, size_t len, struct asn1_hdr *hdr) in asn1_get_next() argument
30 os_memset(hdr, 0, sizeof(*hdr)); in asn1_get_next()
34 hdr->identifier = *pos++; in asn1_get_next()
35 hdr->class = hdr->identifier >> 6; in asn1_get_next()
36 hdr->constructed = !!(hdr->identifier & (1 << 5)); in asn1_get_next()
38 if ((hdr->identifier & 0x1f) == 0x1f) { in asn1_get_next()
39 hdr->tag = 0; in asn1_get_next()
49 hdr->tag = (hdr->tag << 7) | (tmp & 0x7f); in asn1_get_next()
52 hdr->tag = hdr->identifier & 0x1f; in asn1_get_next()
62 hdr->length = 0; in asn1_get_next()
73 hdr->length = (hdr->length << 8) | *pos++; in asn1_get_next()
77 hdr->length = tmp; in asn1_get_next()
80 if (end < pos || hdr->length > (unsigned int) (end - pos)) { in asn1_get_next()
85 hdr->payload = pos; in asn1_get_next()
137 struct asn1_hdr hdr; in asn1_get_oid() local
139 if (asn1_get_next(buf, len, &hdr) < 0 || hdr.length == 0) in asn1_get_oid()
142 if (hdr.class != ASN1_CLASS_UNIVERSAL || hdr.tag != ASN1_TAG_OID) { in asn1_get_oid()
144 "tag 0x%x", hdr.class, hdr.tag); in asn1_get_oid()
148 *next = hdr.payload + hdr.length; in asn1_get_oid()
150 return asn1_parse_oid(hdr.payload, hdr.length, oid); in asn1_get_oid()