Home | History | Annotate | Download | only in tls

Lines Matching refs:hdr

190 	struct asn1_hdr hdr;
200 if (asn1_get_next(buf, len, &hdr) < 0 ||
201 hdr.class != ASN1_CLASS_UNIVERSAL ||
202 hdr.tag != ASN1_TAG_SEQUENCE) {
205 hdr.class, hdr.tag);
208 pos = hdr.payload;
209 end = pos + hdr.length;
229 struct asn1_hdr hdr;
242 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
243 hdr.class != ASN1_CLASS_UNIVERSAL ||
244 hdr.tag != ASN1_TAG_SEQUENCE) {
247 hdr.class, hdr.tag);
250 pos = hdr.payload;
252 if (pos + hdr.length > end)
254 end = pos + hdr.length;
261 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
262 hdr.class != ASN1_CLASS_UNIVERSAL ||
263 hdr.tag != ASN1_TAG_BITSTRING) {
266 hdr.class, hdr.tag);
269 if (hdr.length < 1)
271 pos = hdr.payload;
283 cert->public_key = os_malloc(hdr.length - 1);
289 os_memcpy(cert->public_key, pos + 1, hdr.length - 1);
290 cert->public_key_len = hdr.length - 1;
301 struct asn1_hdr hdr;
318 if (asn1_get_next(buf, len, &hdr) < 0 ||
319 hdr.class != ASN1_CLASS_UNIVERSAL ||
320 hdr.tag != ASN1_TAG_SEQUENCE) {
323 hdr.class, hdr.tag);
326 pos = hdr.payload;
328 if (pos + hdr.length > buf + len)
331 end = *next = pos + hdr.length;
336 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
337 hdr.class != ASN1_CLASS_UNIVERSAL ||
338 hdr.tag != ASN1_TAG_SET) {
341 "%d tag 0x%x", hdr.class, hdr.tag);
346 set_pos = hdr.payload;
347 pos = set_end = hdr.payload + hdr.length;
349 if (asn1_get_next(set_pos, set_end - set_pos, &hdr) < 0 ||
350 hdr.class != ASN1_CLASS_UNIVERSAL ||
351 hdr.tag != ASN1_TAG_SEQUENCE) {
354 "tag 0x%x", hdr.class, hdr.tag);
359 seq_pos = hdr.payload;
360 seq_end = hdr.payload + hdr.length;
367 if (asn1_get_next(seq_pos, seq_end - seq_pos, &hdr) < 0 ||
368 hdr.class != ASN1_CLASS_UNIVERSAL) {
420 name->email = os_malloc(hdr.length + 1);
425 os_memcpy(name->email, hdr.payload, hdr.length);
426 name->email[hdr.length] = '\0';
442 hdr.payload, hdr.length);
452 val = os_malloc(hdr.length + 1);
457 os_memcpy(val, hdr.payload, hdr.length);
458 val[hdr.length] = '\0';
459 if (os_strlen(val) != hdr.length) {
660 struct asn1_hdr hdr;
676 if (asn1_get_next(buf, len, &hdr) < 0 ||
677 hdr.class != ASN1_CLASS_UNIVERSAL ||
678 hdr.tag != ASN1_TAG_SEQUENCE) {
681 hdr.class, hdr.tag);
684 pos = hdr.payload;
685 plen = hdr.length;
692 if (asn1_get_next(pos, plen, &hdr) < 0 ||
693 hdr.class != ASN1_CLASS_UNIVERSAL ||
694 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
697 "Time", hdr.payload, hdr.length);
701 pos = hdr.payload + hdr.length;
704 if (asn1_get_next(pos, plen, &hdr) < 0 ||
705 hdr.class != ASN1_CLASS_UNIVERSAL ||
706 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
709 "Time", hdr.payload, hdr.length);
734 struct asn1_hdr hdr;
749 if (asn1_get_next(pos, len, &hdr) < 0 ||
750 hdr.class != ASN1_CLASS_UNIVERSAL ||
751 hdr.tag != ASN1_TAG_BITSTRING ||
752 hdr.length < 1) {
755 hdr.class, hdr.tag, hdr.length);
760 cert->key_usage = asn1_bit_string_to_long(hdr.payload, hdr.length);
771 struct asn1_hdr hdr;
781 if (asn1_get_next(pos, len, &hdr) < 0 ||
782 hdr.class != ASN1_CLASS_UNIVERSAL ||
783 hdr.tag != ASN1_TAG_SEQUENCE) {
786 hdr.class, hdr.tag);
792 if (hdr.length == 0)
795 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 ||
796 hdr.class != ASN1_CLASS_UNIVERSAL) {
802 if (hdr.tag == ASN1_TAG_BOOLEAN) {
803 if (hdr.length != 1) {
806 hdr.length);
809 cert->ca = hdr.payload[0];
811 if (hdr.payload + hdr.length == pos + len) {
817 if (asn1_get_next(hdr.payload + hdr.length, len - hdr.length,
818 &hdr) < 0 ||
819 hdr.class != ASN1_CLASS_UNIVERSAL) {
826 if (hdr.tag != ASN1_TAG_INTEGER) {
829 hdr.class, hdr.tag);
833 pos = hdr.payload;
834 left = hdr.length;
955 struct asn1_hdr hdr;
981 for (p = pos, end = pos + len; p < end; p = hdr.payload + hdr.length) {
984 if (asn1_get_next(p, end - p, &hdr) < 0) {
990 if (hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC)
993 switch (hdr.tag) {
995 res = x509_parse_alt_name_rfc8222(name, hdr.payload,
996 hdr.length);
999 res = x509_parse_alt_name_dns(name, hdr.payload,
1000 hdr.length);
1003 res = x509_parse_alt_name_uri(name, hdr.payload,
1004 hdr.length);
1007 res = x509_parse_alt_name_ip(name, hdr.payload,
1008 hdr.length);
1011 res = x509_parse_alt_name_rid(name, hdr.payload,
1012 hdr.length);
1033 struct asn1_hdr hdr;
1037 if (asn1_get_next(pos, len, &hdr) < 0 ||
1038 hdr.class != ASN1_CLASS_UNIVERSAL ||
1039 hdr.tag != ASN1_TAG_SEQUENCE) {
1042 hdr.class, hdr.tag);
1049 if (hdr.length == 0)
1052 return x509_parse_ext_alt_name(&cert->subject, hdr.payload,
1053 hdr.length);
1060 struct asn1_hdr hdr;
1064 if (asn1_get_next(pos, len, &hdr) < 0 ||
1065 hdr.class != ASN1_CLASS_UNIVERSAL ||
1066 hdr.tag != ASN1_TAG_SEQUENCE) {
1069 hdr.class, hdr.tag);
1076 if (hdr.length == 0)
1079 return x509_parse_ext_alt_name(&cert->issuer, hdr.payload,
1080 hdr.length);
1117 struct asn1_hdr hdr;
1130 if (asn1_get_next(pos, len, &hdr) < 0 ||
1131 hdr.class != ASN1_CLASS_UNIVERSAL ||
1132 hdr.tag != ASN1_TAG_SEQUENCE) {
1135 hdr.class, hdr.tag);
1138 pos = hdr.payload;
1139 *next = end = pos + hdr.length;
1147 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1148 hdr.class != ASN1_CLASS_UNIVERSAL ||
1149 (hdr.tag != ASN1_TAG_BOOLEAN &&
1150 hdr.tag != ASN1_TAG_OCTETSTRING)) {
1153 "or OCTET STRING", hdr.class, hdr.tag);
1157 if (hdr.tag == ASN1_TAG_BOOLEAN) {
1158 if (hdr.length != 1) {
1160 "Boolean length (%u)", hdr.length);
1163 critical_ext = hdr.payload[0];
1164 pos = hdr.payload;
1165 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1166 (hdr.class != ASN1_CLASS_UNIVERSAL &&
1167 hdr.class != ASN1_CLASS_PRIVATE) ||
1168 hdr.tag != ASN1_TAG_OCTETSTRING) {
1172 hdr.class, hdr.tag);
1180 wpa_hexdump(MSG_MSGDUMP, "X509: extnValue", hdr.payload, hdr.length);
1182 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length);
1199 struct asn1_hdr hdr;
1203 if (asn1_get_next(pos, len, &hdr) < 0 ||
1204 hdr.class != ASN1_CLASS_UNIVERSAL ||
1205 hdr.tag != ASN1_TAG_SEQUENCE) {
1208 "expected SEQUENCE", hdr.class, hdr.tag);
1212 pos = hdr.payload;
1213 end = pos + hdr.length;
1229 struct asn1_hdr hdr;
1236 if (asn1_get_next(buf, len, &hdr) < 0 ||
1237 hdr.class != ASN1_CLASS_UNIVERSAL ||
1238 hdr.tag != ASN1_TAG_SEQUENCE) {
1241 hdr.class, hdr.tag);
1244 pos = hdr.payload;
1245 end = *next = pos + hdr.length;
1251 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1253 pos = hdr.payload;
1255 if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC) {
1256 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1259 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1260 hdr.tag != ASN1_TAG_INTEGER) {
1263 hdr.class, hdr.tag);
1266 if (hdr.length != 1) {
1268 "length %u (expected 1)", hdr.length);
1271 pos = hdr.payload;
1272 left = hdr.length;
1289 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1296 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1297 hdr.tag != ASN1_TAG_INTEGER) {
1300 hdr.class, hdr.tag);
1304 pos = hdr.payload;
1305 left = hdr.length;
1344 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1345 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1349 hdr.class, hdr.tag);
1353 if (hdr.tag == 1) {
1358 if (hdr.payload + hdr.length == end)
1361 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1362 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1366 hdr.class, hdr.tag);
1371 if (hdr.tag == 2) {
1376 if (hdr.payload + hdr.length == end)
1379 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1380 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1384 hdr.class, hdr.tag);
1389 if (hdr.tag != 3) {
1392 "tbsCertificate fields", hdr.tag);
1405 if (x509_parse_extensions(cert, hdr.payload, hdr.length) < 0)
1408 pos = hdr.payload + hdr.length;
1483 struct asn1_hdr hdr;
1500 if (asn1_get_next(pos, len, &hdr) < 0 ||
1501 hdr.class != ASN1_CLASS_UNIVERSAL ||
1502 hdr.tag != ASN1_TAG_SEQUENCE) {
1505 hdr.class, hdr.tag);
1509 pos = hdr.payload;
1511 if (pos + hdr.length > end) {
1516 if (pos + hdr.length < end) {
1519 pos + hdr.length, end - pos + hdr.length);
1520 end = pos + hdr.length;
1539 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1540 hdr.class != ASN1_CLASS_UNIVERSAL ||
1541 hdr.tag != ASN1_TAG_BITSTRING) {
1544 hdr.class, hdr.tag);
1548 if (hdr.length < 1) {
1552 pos = hdr.payload;
1564 cert->sign_value = os_malloc(hdr.length - 1);
1571 os_memcpy(cert->sign_value, pos + 1, hdr.length - 1);
1572 cert->sign_value_len = hdr.length - 1;
1594 struct asn1_hdr hdr;
1644 if (asn1_get_next(data, data_len, &hdr) < 0 ||
1645 hdr.class != ASN1_CLASS_UNIVERSAL ||
1646 hdr.tag != ASN1_TAG_SEQUENCE) {
1649 hdr.class, hdr.tag);
1654 pos = hdr.payload;
1655 end = pos + hdr.length;
1665 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1666 hdr.class != ASN1_CLASS_UNIVERSAL ||
1667 hdr.tag != ASN1_TAG_SEQUENCE) {
1670 hdr.class, hdr.tag);
1674 da_end = hdr.payload + hdr.length;
1676 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
1739 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1740 hdr.class != ASN1_CLASS_UNIVERSAL ||
1741 hdr.tag != ASN1_TAG_OCTETSTRING) {
1744 hdr.class, hdr.tag);
1749 hdr.payload, hdr.length);
1783 if (hdr.length != hash_len ||
1784 os_memcmp(hdr.payload, hash, hdr.length) != 0) {