Home | History | Annotate | Download | only in tls

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_malloc(hdr.length - 1);
283 os_memcpy(cert->public_key, pos + 1, hdr.length - 1);
284 cert->public_key_len = hdr.length - 1;
295 struct asn1_hdr hdr;
312 if (asn1_get_next(buf, len, &hdr) < 0 ||
313 hdr.class != ASN1_CLASS_UNIVERSAL ||
314 hdr.tag != ASN1_TAG_SEQUENCE) {
317 hdr.class, hdr.tag);
320 pos = hdr.payload;
322 if (hdr.length > buf + len - pos)
325 end = *next = pos + hdr.length;
330 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
331 hdr.class != ASN1_CLASS_UNIVERSAL ||
332 hdr.tag != ASN1_TAG_SET) {
335 "%d tag 0x%x", hdr.class, hdr.tag);
340 set_pos = hdr.payload;
341 pos = set_end = hdr.payload + hdr.length;
343 if (asn1_get_next(set_pos, set_end - set_pos, &hdr) < 0 ||
344 hdr.class != ASN1_CLASS_UNIVERSAL ||
345 hdr.tag != ASN1_TAG_SEQUENCE) {
348 "tag 0x%x", hdr.class, hdr.tag);
353 seq_pos = hdr.payload;
354 seq_end = hdr.payload + hdr.length;
361 if (asn1_get_next(seq_pos, seq_end - seq_pos, &hdr) < 0 ||
362 hdr.class != ASN1_CLASS_UNIVERSAL) {
414 name->email = os_malloc(hdr.length + 1);
419 os_memcpy(name->email, hdr.payload, hdr.length);
420 name->email[hdr.length] = '\0';
436 hdr.payload, hdr.length);
446 val = dup_binstr(hdr.payload, hdr.length);
451 if (os_strlen(val) != hdr.length) {
652 struct asn1_hdr hdr;
668 if (asn1_get_next(buf, len, &hdr) < 0 ||
669 hdr.class != ASN1_CLASS_UNIVERSAL ||
670 hdr.tag != ASN1_TAG_SEQUENCE) {
673 hdr.class, hdr.tag);
676 pos = hdr.payload;
677 plen = hdr.length;
684 if (asn1_get_next(pos, plen, &hdr) < 0 ||
685 hdr.class != ASN1_CLASS_UNIVERSAL ||
686 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
689 "Time", hdr.payload, hdr.length);
693 pos = hdr.payload + hdr.length;
696 if (asn1_get_next(pos, plen, &hdr) < 0 ||
697 hdr.class != ASN1_CLASS_UNIVERSAL ||
698 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
701 "Time", hdr.payload, hdr.length);
735 struct asn1_hdr hdr;
750 if (asn1_get_next(pos, len, &hdr) < 0 ||
751 hdr.class != ASN1_CLASS_UNIVERSAL ||
752 hdr.tag != ASN1_TAG_BITSTRING ||
753 hdr.length < 1) {
756 hdr.class, hdr.tag, hdr.length);
761 cert->key_usage = asn1_bit_string_to_long(hdr.payload, hdr.length);
772 struct asn1_hdr hdr;
782 if (asn1_get_next(pos, len, &hdr) < 0 ||
783 hdr.class != ASN1_CLASS_UNIVERSAL ||
784 hdr.tag != ASN1_TAG_SEQUENCE) {
787 hdr.class, hdr.tag);
793 if (hdr.length == 0)
796 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 ||
797 hdr.class != ASN1_CLASS_UNIVERSAL) {
803 if (hdr.tag == ASN1_TAG_BOOLEAN) {
804 if (hdr.length != 1) {
807 hdr.length);
810 cert->ca = hdr.payload[0];
812 if (hdr.length == pos + len - hdr.payload) {
818 if (asn1_get_next(hdr.payload + hdr.length, len - hdr.length,
819 &hdr) < 0 ||
820 hdr.class != ASN1_CLASS_UNIVERSAL) {
827 if (hdr.tag != ASN1_TAG_INTEGER) {
830 hdr.class, hdr.tag);
834 pos = hdr.payload;
835 left = hdr.length;
956 struct asn1_hdr hdr;
982 for (p = pos, end = pos + len; p < end; p = hdr.payload + hdr.length) {
985 if (asn1_get_next(p, end - p, &hdr) < 0) {
991 if (hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC)
994 switch (hdr.tag) {
996 res = x509_parse_alt_name_rfc8222(name, hdr.payload,
997 hdr.length);
1000 res = x509_parse_alt_name_dns(name, hdr.payload,
1001 hdr.length);
1004 res = x509_parse_alt_name_uri(name, hdr.payload,
1005 hdr.length);
1008 res = x509_parse_alt_name_ip(name, hdr.payload,
1009 hdr.length);
1012 res = x509_parse_alt_name_rid(name, hdr.payload,
1013 hdr.length);
1034 struct asn1_hdr hdr;
1038 if (asn1_get_next(pos, len, &hdr) < 0 ||
1039 hdr.class != ASN1_CLASS_UNIVERSAL ||
1040 hdr.tag != ASN1_TAG_SEQUENCE) {
1043 hdr.class, hdr.tag);
1050 if (hdr.length == 0)
1053 return x509_parse_ext_alt_name(&cert->subject, hdr.payload,
1054 hdr.length);
1061 struct asn1_hdr hdr;
1065 if (asn1_get_next(pos, len, &hdr) < 0 ||
1066 hdr.class != ASN1_CLASS_UNIVERSAL ||
1067 hdr.tag != ASN1_TAG_SEQUENCE) {
1070 hdr.class, hdr.tag);
1077 if (hdr.length == 0)
1080 return x509_parse_ext_alt_name(&cert->issuer, hdr.payload,
1081 hdr.length);
1137 struct asn1_hdr hdr;
1147 if (asn1_get_next(pos, len, &hdr) < 0 ||
1148 hdr.class != ASN1_CLASS_UNIVERSAL ||
1149 hdr.tag != ASN1_TAG_SEQUENCE) {
1152 hdr.class, hdr.tag);
1155 if (hdr.length > pos + len - hdr.payload)
1157 pos = hdr.payload;
1158 end = pos + hdr.length;
1225 struct asn1_hdr hdr;
1238 if (asn1_get_next(pos, len, &hdr) < 0 ||
1239 hdr.class != ASN1_CLASS_UNIVERSAL ||
1240 hdr.tag != ASN1_TAG_SEQUENCE) {
1243 hdr.class, hdr.tag);
1246 pos = hdr.payload;
1247 *next = end = pos + hdr.length;
1255 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1256 hdr.class != ASN1_CLASS_UNIVERSAL ||
1257 (hdr.tag != ASN1_TAG_BOOLEAN &&
1258 hdr.tag != ASN1_TAG_OCTETSTRING)) {
1261 "or OCTET STRING", hdr.class, hdr.tag);
1265 if (hdr.tag == ASN1_TAG_BOOLEAN) {
1266 if (hdr.length != 1) {
1268 "Boolean length (%u)", hdr.length);
1271 critical_ext = hdr.payload[0];
1272 pos = hdr.payload;
1273 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1274 (hdr.class != ASN1_CLASS_UNIVERSAL &&
1275 hdr.class != ASN1_CLASS_PRIVATE) ||
1276 hdr.tag != ASN1_TAG_OCTETSTRING) {
1280 hdr.class, hdr.tag);
1288 wpa_hexdump(MSG_MSGDUMP, "X509: extnValue", hdr.payload, hdr.length);
1290 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length);
1307 struct asn1_hdr hdr;
1311 if (asn1_get_next(pos, len, &hdr) < 0 ||
1312 hdr.class != ASN1_CLASS_UNIVERSAL ||
1313 hdr.tag != ASN1_TAG_SEQUENCE) {
1316 "expected SEQUENCE", hdr.class, hdr.tag);
1320 pos = hdr.payload;
1321 end = pos + hdr.length;
1337 struct asn1_hdr hdr;
1345 if (asn1_get_next(buf, len, &hdr) < 0 ||
1346 hdr.class != ASN1_CLASS_UNIVERSAL ||
1347 hdr.tag != ASN1_TAG_SEQUENCE) {
1350 hdr.class, hdr.tag);
1353 pos = hdr.payload;
1354 end = *next = pos + hdr.length;
1360 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1362 pos = hdr.payload;
1364 if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC) {
1365 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1368 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1369 hdr.tag != ASN1_TAG_INTEGER) {
1372 hdr.class, hdr.tag);
1375 if (hdr.length != 1) {
1377 "length %u (expected 1)", hdr.length);
1380 pos = hdr.payload;
1381 left = hdr.length;
1398 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1405 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1406 hdr.tag != ASN1_TAG_INTEGER ||
1407 hdr.length < 1 || hdr.length > X509_MAX_SERIAL_NUM_LEN) {
1410 hdr.class, hdr.tag, hdr.length);
1414 pos = hdr.payload + hdr.length;
1415 while (hdr.length > 0 && hdr.payload[0] == 0) {
1416 hdr.payload++;
1417 hdr.length--;
1419 os_memcpy(cert->serial_number, hdr.payload, hdr.length);
1420 cert->serial_number_len = hdr.length;
1461 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1462 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1466 hdr.class, hdr.tag);
1470 if (hdr.tag == 1) {
1475 pos = hdr.payload + hdr.length;
1479 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1480 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1484 hdr.class, hdr.tag);
1489 if (hdr.tag == 2) {
1494 pos = hdr.payload + hdr.length;
1498 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1499 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1503 hdr.class, hdr.tag);
1508 if (hdr.tag != 3) {
1511 "tbsCertificate fields", hdr.tag);
1524 if (x509_parse_extensions(cert, hdr.payload, hdr.length) < 0)
1527 pos = hdr.payload + hdr.length;
1622 struct asn1_hdr hdr;
1639 if (asn1_get_next(pos, len, &hdr) < 0 ||
1640 hdr.class != ASN1_CLASS_UNIVERSAL ||
1641 hdr.tag != ASN1_TAG_SEQUENCE) {
1644 hdr.class, hdr.tag);
1648 pos = hdr.payload;
1650 if (hdr.length > end - pos) {
1655 if (hdr.length < end - pos) {
1658 pos + hdr.length, end - (pos + hdr.length));
1659 end = pos + hdr.length;
1678 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1679 hdr.class != ASN1_CLASS_UNIVERSAL ||
1680 hdr.tag != ASN1_TAG_BITSTRING) {
1683 hdr.class, hdr.tag);
1687 if (hdr.length < 1) {
1691 pos = hdr.payload;
1703 cert->sign_value = os_malloc(hdr.length - 1);
1710 os_memcpy(cert->sign_value, pos + 1, hdr.length - 1);
1711 cert->sign_value_len = hdr.length - 1;
1744 struct asn1_hdr hdr;
1796 if (asn1_get_next(data, data_len, &hdr) < 0 ||
1797 hdr.class != ASN1_CLASS_UNIVERSAL ||
1798 hdr.tag != ASN1_TAG_SEQUENCE) {
1801 hdr.class, hdr.tag);
1806 pos = hdr.payload;
1807 end = pos + hdr.length;
1817 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1818 hdr.class != ASN1_CLASS_UNIVERSAL ||
1819 hdr.tag != ASN1_TAG_SEQUENCE) {
1822 hdr.class, hdr.tag);
1826 da_end = hdr.payload + hdr.length;
1828 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
1913 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1914 hdr.class != ASN1_CLASS_UNIVERSAL ||
1915 hdr.tag != ASN1_TAG_OCTETSTRING) {
1918 hdr.class, hdr.tag);
1923 hdr.payload, hdr.length);
1964 if (hdr.length != hash_len ||
1965 os_memcmp_const(hdr.payload, hash, hdr.length) != 0) {
1972 if (hdr.payload + hdr.length < data + data_len) {
1975 hdr.payload + hdr
1976 data + data_len - hdr.payload - hdr.length);