Lines Matching refs:hdr

185 	struct asn1_hdr hdr;
195 if (asn1_get_next(buf, len, &hdr) < 0 ||
196 hdr.class != ASN1_CLASS_UNIVERSAL ||
197 hdr.tag != ASN1_TAG_SEQUENCE) {
200 hdr.class, hdr.tag);
203 if (hdr.length > buf + len - hdr.payload)
205 pos = hdr.payload;
206 end = pos + hdr.length;
223 struct asn1_hdr hdr;
236 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
237 hdr.class != ASN1_CLASS_UNIVERSAL ||
238 hdr.tag != ASN1_TAG_SEQUENCE) {
241 hdr.class, hdr.tag);
244 pos = hdr.payload;
246 if (hdr.length > end - pos)
248 end = pos + hdr.length;
255 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
256 hdr.class != ASN1_CLASS_UNIVERSAL ||
257 hdr.tag != ASN1_TAG_BITSTRING) {
260 hdr.class, hdr.tag);
263 if (hdr.length < 1)
265 pos = hdr.payload;
277 cert->public_key = os_memdup(pos + 1, hdr.length - 1);
283 cert->public_key_len = hdr.length - 1;
294 struct asn1_hdr hdr;
311 if (asn1_get_next(buf, len, &hdr) < 0 ||
312 hdr.class != ASN1_CLASS_UNIVERSAL ||
313 hdr.tag != ASN1_TAG_SEQUENCE) {
316 hdr.class, hdr.tag);
319 pos = hdr.payload;
321 if (hdr.length > buf + len - pos)
324 end = *next = pos + hdr.length;
329 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
330 hdr.class != ASN1_CLASS_UNIVERSAL ||
331 hdr.tag != ASN1_TAG_SET) {
334 "%d tag 0x%x", hdr.class, hdr.tag);
339 set_pos = hdr.payload;
340 pos = set_end = hdr.payload + hdr.length;
342 if (asn1_get_next(set_pos, set_end - set_pos, &hdr) < 0 ||
343 hdr.class != ASN1_CLASS_UNIVERSAL ||
344 hdr.tag != ASN1_TAG_SEQUENCE) {
347 "tag 0x%x", hdr.class, hdr.tag);
352 seq_pos = hdr.payload;
353 seq_end = hdr.payload + hdr.length;
360 if (asn1_get_next(seq_pos, seq_end - seq_pos, &hdr) < 0 ||
361 hdr.class != ASN1_CLASS_UNIVERSAL) {
413 name->email = os_malloc(hdr.length + 1);
418 os_memcpy(name->email, hdr.payload, hdr.length);
419 name->email[hdr.length] = '\0';
435 hdr.payload, hdr.length);
445 val = dup_binstr(hdr.payload, hdr.length);
450 if (os_strlen(val) != hdr.length) {
695 struct asn1_hdr hdr;
711 if (asn1_get_next(buf, len, &hdr) < 0 ||
712 hdr.class != ASN1_CLASS_UNIVERSAL ||
713 hdr.tag != ASN1_TAG_SEQUENCE) {
716 hdr.class, hdr.tag);
719 pos = hdr.payload;
720 plen = hdr.length;
727 if (asn1_get_next(pos, plen, &hdr) < 0 ||
728 hdr.class != ASN1_CLASS_UNIVERSAL ||
729 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
732 "Time", hdr.payload, hdr.length);
736 pos = hdr.payload + hdr.length;
739 if (asn1_get_next(pos, plen, &hdr) < 0 ||
740 hdr.class != ASN1_CLASS_UNIVERSAL ||
741 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
744 "Time", hdr.payload, hdr.length);
778 struct asn1_hdr hdr;
793 if (asn1_get_next(pos, len, &hdr) < 0 ||
794 hdr.class != ASN1_CLASS_UNIVERSAL ||
795 hdr.tag != ASN1_TAG_BITSTRING ||
796 hdr.length < 1) {
799 hdr.class, hdr.tag, hdr.length);
804 cert->key_usage = asn1_bit_string_to_long(hdr.payload, hdr.length);
815 struct asn1_hdr hdr;
826 if (asn1_get_next(pos, len, &hdr) < 0 ||
827 hdr.class != ASN1_CLASS_UNIVERSAL ||
828 hdr.tag != ASN1_TAG_SEQUENCE) {
831 hdr.class, hdr.tag);
837 if (hdr.length == 0)
840 end_seq = hdr.payload + hdr.length;
841 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 ||
842 hdr.class != ASN1_CLASS_UNIVERSAL) {
848 if (hdr.tag == ASN1_TAG_BOOLEAN) {
849 cert->ca = hdr.payload[0];
851 pos = hdr.payload + hdr.length;
858 if (asn1_get_next(pos, end_seq - pos, &hdr) < 0 ||
859 hdr.class != ASN1_CLASS_UNIVERSAL) {
866 if (hdr.tag != ASN1_TAG_INTEGER) {
869 hdr.class, hdr.tag);
873 pos = hdr.payload;
874 left = hdr.length;
994 struct asn1_hdr hdr;
1020 for (p = pos, end = pos + len; p < end; p = hdr.payload + hdr.length) {
1023 if (asn1_get_next(p, end - p, &hdr) < 0) {
1029 if (hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC)
1032 switch (hdr.tag) {
1034 res = x509_parse_alt_name_rfc8222(name, hdr.payload,
1035 hdr.length);
1038 res = x509_parse_alt_name_dns(name, hdr.payload,
1039 hdr.length);
1042 res = x509_parse_alt_name_uri(name, hdr.payload,
1043 hdr.length);
1046 res = x509_parse_alt_name_ip(name, hdr.payload,
1047 hdr.length);
1050 res = x509_parse_alt_name_rid(name, hdr.payload,
1051 hdr.length);
1072 struct asn1_hdr hdr;
1076 if (asn1_get_next(pos, len, &hdr) < 0 ||
1077 hdr.class != ASN1_CLASS_UNIVERSAL ||
1078 hdr.tag != ASN1_TAG_SEQUENCE) {
1081 hdr.class, hdr.tag);
1088 if (hdr.length == 0)
1091 return x509_parse_ext_alt_name(&cert->subject, hdr.payload,
1092 hdr.length);
1099 struct asn1_hdr hdr;
1103 if (asn1_get_next(pos, len, &hdr) < 0 ||
1104 hdr.class != ASN1_CLASS_UNIVERSAL ||
1105 hdr.tag != ASN1_TAG_SEQUENCE) {
1108 hdr.class, hdr.tag);
1115 if (hdr.length == 0)
1118 return x509_parse_ext_alt_name(&cert->issuer, hdr.payload,
1119 hdr.length);
1175 struct asn1_hdr hdr;
1185 if (asn1_get_next(pos, len, &hdr) < 0 ||
1186 hdr.class != ASN1_CLASS_UNIVERSAL ||
1187 hdr.tag != ASN1_TAG_SEQUENCE) {
1190 hdr.class, hdr.tag);
1193 if (hdr.length > pos + len - hdr.payload)
1195 pos = hdr.payload;
1196 end = pos + hdr.length;
1263 struct asn1_hdr hdr;
1276 if (asn1_get_next(pos, len, &hdr) < 0 ||
1277 hdr.class != ASN1_CLASS_UNIVERSAL ||
1278 hdr.tag != ASN1_TAG_SEQUENCE) {
1281 hdr.class, hdr.tag);
1284 pos = hdr.payload;
1285 *next = end = pos + hdr.length;
1293 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1294 hdr.class != ASN1_CLASS_UNIVERSAL ||
1295 (hdr.tag != ASN1_TAG_BOOLEAN &&
1296 hdr.tag != ASN1_TAG_OCTETSTRING)) {
1299 "or OCTET STRING", hdr.class, hdr.tag);
1303 if (hdr.tag == ASN1_TAG_BOOLEAN) {
1304 critical_ext = hdr.payload[0];
1305 pos = hdr.payload;
1306 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1307 (hdr.class != ASN1_CLASS_UNIVERSAL &&
1308 hdr.class != ASN1_CLASS_PRIVATE) ||
1309 hdr.tag != ASN1_TAG_OCTETSTRING) {
1313 hdr.class, hdr.tag);
1321 wpa_hexdump(MSG_MSGDUMP, "X509: extnValue", hdr.payload, hdr.length);
1323 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length);
1340 struct asn1_hdr hdr;
1344 if (asn1_get_next(pos, len, &hdr) < 0 ||
1345 hdr.class != ASN1_CLASS_UNIVERSAL ||
1346 hdr.tag != ASN1_TAG_SEQUENCE) {
1349 "expected SEQUENCE", hdr.class, hdr.tag);
1353 pos = hdr.payload;
1354 end = pos + hdr.length;
1370 struct asn1_hdr hdr;
1378 if (asn1_get_next(buf, len, &hdr) < 0 ||
1379 hdr.class != ASN1_CLASS_UNIVERSAL ||
1380 hdr.tag != ASN1_TAG_SEQUENCE) {
1383 hdr.class, hdr.tag);
1386 pos = hdr.payload;
1387 end = *next = pos + hdr.length;
1393 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1395 pos = hdr.payload;
1397 if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC) {
1398 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1401 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1402 hdr.tag != ASN1_TAG_INTEGER) {
1405 hdr.class, hdr.tag);
1408 if (hdr.length != 1) {
1410 "length %u (expected 1)", hdr.length);
1413 pos = hdr.payload;
1414 left = hdr.length;
1431 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1438 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1439 hdr.tag != ASN1_TAG_INTEGER ||
1440 hdr.length < 1 || hdr.length > X509_MAX_SERIAL_NUM_LEN) {
1443 hdr.class, hdr.tag, hdr.length);
1447 pos = hdr.payload + hdr.length;
1448 while (hdr.length > 0 && hdr.payload[0] == 0) {
1449 hdr.payload++;
1450 hdr.length--;
1452 os_memcpy(cert->serial_number, hdr.payload, hdr.length);
1453 cert->serial_number_len = hdr.length;
1494 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1495 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1499 hdr.class, hdr.tag);
1503 if (hdr.tag == 1) {
1508 pos = hdr.payload + hdr.length;
1512 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1513 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1517 hdr.class, hdr.tag);
1522 if (hdr.tag == 2) {
1527 pos = hdr.payload + hdr.length;
1531 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1532 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1536 hdr.class, hdr.tag);
1541 if (hdr.tag != 3) {
1544 "tbsCertificate fields", hdr.tag);
1557 if (x509_parse_extensions(cert, hdr.payload, hdr.length) < 0)
1560 pos = hdr.payload + hdr.length;
1655 struct asn1_hdr hdr;
1672 if (asn1_get_next(pos, len, &hdr) < 0 ||
1673 hdr.class != ASN1_CLASS_UNIVERSAL ||
1674 hdr.tag != ASN1_TAG_SEQUENCE) {
1677 hdr.class, hdr.tag);
1681 pos = hdr.payload;
1683 if (hdr.length > end - pos) {
1688 if (hdr.length < end - pos) {
1691 pos + hdr.length, end - (pos + hdr.length));
1692 end = pos + hdr.length;
1711 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1712 hdr.class != ASN1_CLASS_UNIVERSAL ||
1713 hdr.tag != ASN1_TAG_BITSTRING) {
1716 hdr.class, hdr.tag);
1720 if (hdr.length < 1) {
1724 pos = hdr.payload;
1736 cert->sign_value = os_memdup(pos + 1, hdr.length - 1);
1743 cert->sign_value_len = hdr.length - 1;
1776 struct asn1_hdr hdr;
1828 if (asn1_get_next(data, data_len, &hdr) < 0 ||
1829 hdr.class != ASN1_CLASS_UNIVERSAL ||
1830 hdr.tag != ASN1_TAG_SEQUENCE) {
1833 hdr.class, hdr.tag);
1838 pos = hdr.payload;
1839 end = pos + hdr.length;
1849 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1850 hdr.class != ASN1_CLASS_UNIVERSAL ||
1851 hdr.tag != ASN1_TAG_SEQUENCE) {
1854 hdr.class, hdr.tag);
1858 da_end = hdr.payload + hdr.length;
1860 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
1945 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1946 hdr.class != ASN1_CLASS_UNIVERSAL ||
1947 hdr.tag != ASN1_TAG_OCTETSTRING) {
1950 hdr.class, hdr.tag);
1955 hdr.payload, hdr.length);
1996 if (hdr.length != hash_len ||
1997 os_memcmp_const(hdr.payload, hash, hdr.length) != 0) {
2004 if (hdr.payload + hdr.length < data + data_len) {
2007 hdr.payload + hdr.length,
2008 data + data_len - hdr.payload - hdr.length);