Home | History | Annotate | Download | only in tls

Lines Matching refs:hdr

184 	struct asn1_hdr hdr;
194 if (asn1_get_next(buf, len, &hdr) < 0 ||
195 hdr.class != ASN1_CLASS_UNIVERSAL ||
196 hdr.tag != ASN1_TAG_SEQUENCE) {
199 hdr.class, hdr.tag);
202 pos = hdr.payload;
203 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 (pos + hdr.length > end)
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 (pos + hdr.length > buf + len)
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 = os_malloc(hdr.length + 1);
451 os_memcpy(val, hdr.payload, hdr.length);
452 val[hdr.length] = '\0';
453 if (os_strlen(val) != hdr.length) {
654 struct asn1_hdr hdr;
670 if (asn1_get_next(buf, len, &hdr) < 0 ||
671 hdr.class != ASN1_CLASS_UNIVERSAL ||
672 hdr.tag != ASN1_TAG_SEQUENCE) {
675 hdr.class, hdr.tag);
678 pos = hdr.payload;
679 plen = hdr.length;
686 if (asn1_get_next(pos, plen, &hdr) < 0 ||
687 hdr.class != ASN1_CLASS_UNIVERSAL ||
688 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
691 "Time", hdr.payload, hdr.length);
695 pos = hdr.payload + hdr.length;
698 if (asn1_get_next(pos, plen, &hdr) < 0 ||
699 hdr.class != ASN1_CLASS_UNIVERSAL ||
700 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
703 "Time", hdr.payload, hdr.length);
728 struct asn1_hdr hdr;
743 if (asn1_get_next(pos, len, &hdr) < 0 ||
744 hdr.class != ASN1_CLASS_UNIVERSAL ||
745 hdr.tag != ASN1_TAG_BITSTRING ||
746 hdr.length < 1) {
749 hdr.class, hdr.tag, hdr.length);
754 cert->key_usage = asn1_bit_string_to_long(hdr.payload, hdr.length);
765 struct asn1_hdr hdr;
775 if (asn1_get_next(pos, len, &hdr) < 0 ||
776 hdr.class != ASN1_CLASS_UNIVERSAL ||
777 hdr.tag != ASN1_TAG_SEQUENCE) {
780 hdr.class, hdr.tag);
786 if (hdr.length == 0)
789 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 ||
790 hdr.class != ASN1_CLASS_UNIVERSAL) {
796 if (hdr.tag == ASN1_TAG_BOOLEAN) {
797 if (hdr.length != 1) {
800 hdr.length);
803 cert->ca = hdr.payload[0];
805 if (hdr.payload + hdr.length == pos + len) {
811 if (asn1_get_next(hdr.payload + hdr.length, len - hdr.length,
812 &hdr) < 0 ||
813 hdr.class != ASN1_CLASS_UNIVERSAL) {
820 if (hdr.tag != ASN1_TAG_INTEGER) {
823 hdr.class, hdr.tag);
827 pos = hdr.payload;
828 left = hdr.length;
949 struct asn1_hdr hdr;
975 for (p = pos, end = pos + len; p < end; p = hdr.payload + hdr.length) {
978 if (asn1_get_next(p, end - p, &hdr) < 0) {
984 if (hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC)
987 switch (hdr.tag) {
989 res = x509_parse_alt_name_rfc8222(name, hdr.payload,
990 hdr.length);
993 res = x509_parse_alt_name_dns(name, hdr.payload,
994 hdr.length);
997 res = x509_parse_alt_name_uri(name, hdr.payload,
998 hdr.length);
1001 res = x509_parse_alt_name_ip(name, hdr.payload,
1002 hdr.length);
1005 res = x509_parse_alt_name_rid(name, hdr.payload,
1006 hdr.length);
1027 struct asn1_hdr hdr;
1031 if (asn1_get_next(pos, len, &hdr) < 0 ||
1032 hdr.class != ASN1_CLASS_UNIVERSAL ||
1033 hdr.tag != ASN1_TAG_SEQUENCE) {
1036 hdr.class, hdr.tag);
1043 if (hdr.length == 0)
1046 return x509_parse_ext_alt_name(&cert->subject, hdr.payload,
1047 hdr.length);
1054 struct asn1_hdr hdr;
1058 if (asn1_get_next(pos, len, &hdr) < 0 ||
1059 hdr.class != ASN1_CLASS_UNIVERSAL ||
1060 hdr.tag != ASN1_TAG_SEQUENCE) {
1063 hdr.class, hdr.tag);
1070 if (hdr.length == 0)
1073 return x509_parse_ext_alt_name(&cert->issuer, hdr.payload,
1074 hdr.length);
1111 struct asn1_hdr hdr;
1124 if (asn1_get_next(pos, len, &hdr) < 0 ||
1125 hdr.class != ASN1_CLASS_UNIVERSAL ||
1126 hdr.tag != ASN1_TAG_SEQUENCE) {
1129 hdr.class, hdr.tag);
1132 pos = hdr.payload;
1133 *next = end = pos + hdr.length;
1141 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1142 hdr.class != ASN1_CLASS_UNIVERSAL ||
1143 (hdr.tag != ASN1_TAG_BOOLEAN &&
1144 hdr.tag != ASN1_TAG_OCTETSTRING)) {
1147 "or OCTET STRING", hdr.class, hdr.tag);
1151 if (hdr.tag == ASN1_TAG_BOOLEAN) {
1152 if (hdr.length != 1) {
1154 "Boolean length (%u)", hdr.length);
1157 critical_ext = hdr.payload[0];
1158 pos = hdr.payload;
1159 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1160 (hdr.class != ASN1_CLASS_UNIVERSAL &&
1161 hdr.class != ASN1_CLASS_PRIVATE) ||
1162 hdr.tag != ASN1_TAG_OCTETSTRING) {
1166 hdr.class, hdr.tag);
1174 wpa_hexdump(MSG_MSGDUMP, "X509: extnValue", hdr.payload, hdr.length);
1176 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length);
1193 struct asn1_hdr hdr;
1197 if (asn1_get_next(pos, len, &hdr) < 0 ||
1198 hdr.class != ASN1_CLASS_UNIVERSAL ||
1199 hdr.tag != ASN1_TAG_SEQUENCE) {
1202 "expected SEQUENCE", hdr.class, hdr.tag);
1206 pos = hdr.payload;
1207 end = pos + hdr.length;
1223 struct asn1_hdr hdr;
1230 if (asn1_get_next(buf, len, &hdr) < 0 ||
1231 hdr.class != ASN1_CLASS_UNIVERSAL ||
1232 hdr.tag != ASN1_TAG_SEQUENCE) {
1235 hdr.class, hdr.tag);
1238 pos = hdr.payload;
1239 end = *next = pos + hdr.length;
1245 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1247 pos = hdr.payload;
1249 if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC) {
1250 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1253 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1254 hdr.tag != ASN1_TAG_INTEGER) {
1257 hdr.class, hdr.tag);
1260 if (hdr.length != 1) {
1262 "length %u (expected 1)", hdr.length);
1265 pos = hdr.payload;
1266 left = hdr.length;
1283 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1290 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1291 hdr.tag != ASN1_TAG_INTEGER) {
1294 hdr.class, hdr.tag);
1298 pos = hdr.payload;
1299 left = hdr.length;
1338 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1339 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1343 hdr.class, hdr.tag);
1347 if (hdr.tag == 1) {
1352 if (hdr.payload + hdr.length == end)
1355 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1356 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1360 hdr.class, hdr.tag);
1365 if (hdr.tag == 2) {
1370 if (hdr.payload + hdr.length == end)
1373 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1374 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1378 hdr.class, hdr.tag);
1383 if (hdr.tag != 3) {
1386 "tbsCertificate fields", hdr.tag);
1399 if (x509_parse_extensions(cert, hdr.payload, hdr.length) < 0)
1402 pos = hdr.payload + hdr.length;
1477 struct asn1_hdr hdr;
1494 if (asn1_get_next(pos, len, &hdr) < 0 ||
1495 hdr.class != ASN1_CLASS_UNIVERSAL ||
1496 hdr.tag != ASN1_TAG_SEQUENCE) {
1499 hdr.class, hdr.tag);
1503 pos = hdr.payload;
1505 if (pos + hdr.length > end) {
1510 if (pos + hdr.length < end) {
1513 pos + hdr.length, end - pos + hdr.length);
1514 end = pos + hdr.length;
1533 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1534 hdr.class != ASN1_CLASS_UNIVERSAL ||
1535 hdr.tag != ASN1_TAG_BITSTRING) {
1538 hdr.class, hdr.tag);
1542 if (hdr.length < 1) {
1546 pos = hdr.payload;
1558 cert->sign_value = os_malloc(hdr.length - 1);
1565 os_memcpy(cert->sign_value, pos + 1, hdr.length - 1);
1566 cert->sign_value_len = hdr.length - 1;
1588 struct asn1_hdr hdr;
1638 if (asn1_get_next(data, data_len, &hdr) < 0 ||
1639 hdr.class != ASN1_CLASS_UNIVERSAL ||
1640 hdr.tag != ASN1_TAG_SEQUENCE) {
1643 hdr.class, hdr.tag);
1648 pos = hdr.payload;
1649 end = pos + hdr.length;
1659 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1660 hdr.class != ASN1_CLASS_UNIVERSAL ||
1661 hdr.tag != ASN1_TAG_SEQUENCE) {
1664 hdr.class, hdr.tag);
1668 da_end = hdr.payload + hdr.length;
1670 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
1733 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1734 hdr.class != ASN1_CLASS_UNIVERSAL ||
1735 hdr.tag != ASN1_TAG_OCTETSTRING) {
1738 hdr.class, hdr.tag);
1743 hdr.payload, hdr.length);
1777 if (hdr.length != hash_len ||
1778 os_memcmp(hdr.payload, hash, hdr.length) != 0) {