Lines Matching refs:hdr
187 struct asn1_hdr hdr;
197 if (asn1_get_next(buf, len, &hdr) < 0 ||
198 hdr.class != ASN1_CLASS_UNIVERSAL ||
199 hdr.tag != ASN1_TAG_SEQUENCE) {
202 hdr.class, hdr.tag);
205 pos = hdr.payload;
206 end = pos + hdr.length;
226 struct asn1_hdr hdr;
239 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
240 hdr.class != ASN1_CLASS_UNIVERSAL ||
241 hdr.tag != ASN1_TAG_SEQUENCE) {
244 hdr.class, hdr.tag);
247 pos = hdr.payload;
249 if (pos + hdr.length > end)
251 end = pos + hdr.length;
258 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
259 hdr.class != ASN1_CLASS_UNIVERSAL ||
260 hdr.tag != ASN1_TAG_BITSTRING) {
263 hdr.class, hdr.tag);
266 if (hdr.length < 1)
268 pos = hdr.payload;
280 cert->public_key = os_malloc(hdr.length - 1);
286 os_memcpy(cert->public_key, pos + 1, hdr.length - 1);
287 cert->public_key_len = hdr.length - 1;
298 struct asn1_hdr hdr;
315 if (asn1_get_next(buf, len, &hdr) < 0 ||
316 hdr.class != ASN1_CLASS_UNIVERSAL ||
317 hdr.tag != ASN1_TAG_SEQUENCE) {
320 hdr.class, hdr.tag);
323 pos = hdr.payload;
325 if (pos + hdr.length > buf + len)
328 end = *next = pos + hdr.length;
331 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
332 hdr.class != ASN1_CLASS_UNIVERSAL ||
333 hdr.tag != ASN1_TAG_SET) {
336 "%d tag 0x%x", hdr.class, hdr.tag);
341 set_pos = hdr.payload;
342 pos = set_end = hdr.payload + hdr.length;
344 if (asn1_get_next(set_pos, set_end - set_pos, &hdr) < 0 ||
345 hdr.class != ASN1_CLASS_UNIVERSAL ||
346 hdr.tag != ASN1_TAG_SEQUENCE) {
349 "tag 0x%x", hdr.class, hdr.tag);
354 seq_pos = hdr.payload;
355 seq_end = hdr.payload + hdr.length;
362 if (asn1_get_next(seq_pos, seq_end - seq_pos, &hdr) < 0 ||
363 hdr.class != ASN1_CLASS_UNIVERSAL) {
422 hdr.payload, hdr.length);
427 *fieldp = os_malloc(hdr.length + 1);
432 os_memcpy(*fieldp, hdr.payload, hdr.length);
433 (*fieldp)[hdr.length] = '\0';
625 struct asn1_hdr hdr;
641 if (asn1_get_next(buf, len, &hdr) < 0 ||
642 hdr.class != ASN1_CLASS_UNIVERSAL ||
643 hdr.tag != ASN1_TAG_SEQUENCE) {
646 hdr.class, hdr.tag);
649 pos = hdr.payload;
650 plen = hdr.length;
657 if (asn1_get_next(pos, plen, &hdr) < 0 ||
658 hdr.class != ASN1_CLASS_UNIVERSAL ||
659 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
662 "Time", hdr.payload, hdr.length);
666 pos = hdr.payload + hdr.length;
669 if (asn1_get_next(pos, plen, &hdr) < 0 ||
670 hdr.class != ASN1_CLASS_UNIVERSAL ||
671 x509_parse_time(hdr.payload, hdr.length, hdr.tag,
674 "Time", hdr.payload, hdr.length);
699 struct asn1_hdr hdr;
714 if (asn1_get_next(pos, len, &hdr) < 0 ||
715 hdr.class != ASN1_CLASS_UNIVERSAL ||
716 hdr.tag != ASN1_TAG_BITSTRING ||
717 hdr.length < 1) {
720 hdr.class, hdr.tag, hdr.length);
725 cert->key_usage = asn1_bit_string_to_long(hdr.payload, hdr.length);
736 struct asn1_hdr hdr;
746 if (asn1_get_next(pos, len, &hdr) < 0 ||
747 hdr.class != ASN1_CLASS_UNIVERSAL ||
748 hdr.tag != ASN1_TAG_SEQUENCE) {
751 hdr.class, hdr.tag);
757 if (hdr.length == 0)
760 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 ||
761 hdr.class != ASN1_CLASS_UNIVERSAL) {
767 if (hdr.tag == ASN1_TAG_BOOLEAN) {
768 if (hdr.length != 1) {
771 hdr.length);
774 cert->ca = hdr.payload[0];
776 if (hdr.payload + hdr.length == pos + len) {
782 if (asn1_get_next(hdr.payload + hdr.length, len - hdr.length,
783 &hdr) < 0 ||
784 hdr.class != ASN1_CLASS_UNIVERSAL) {
791 if (hdr.tag != ASN1_TAG_INTEGER) {
794 hdr.class, hdr.tag);
798 pos = hdr.payload;
799 left = hdr.length;
848 struct asn1_hdr hdr;
861 if (asn1_get_next(pos, len, &hdr) < 0 ||
862 hdr.class != ASN1_CLASS_UNIVERSAL ||
863 hdr.tag != ASN1_TAG_SEQUENCE) {
866 hdr.class, hdr.tag);
869 pos = hdr.payload;
870 *next = end = pos + hdr.length;
878 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
879 hdr.class != ASN1_CLASS_UNIVERSAL ||
880 (hdr.tag != ASN1_TAG_BOOLEAN &&
881 hdr.tag != ASN1_TAG_OCTETSTRING)) {
884 "or OCTET STRING", hdr.class, hdr.tag);
888 if (hdr.tag == ASN1_TAG_BOOLEAN) {
889 if (hdr.length != 1) {
891 "Boolean length (%u)", hdr.length);
894 critical_ext = hdr.payload[0];
895 pos = hdr.payload;
896 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
897 (hdr.class != ASN1_CLASS_UNIVERSAL &&
898 hdr.class != ASN1_CLASS_PRIVATE) ||
899 hdr.tag != ASN1_TAG_OCTETSTRING) {
903 hdr.class, hdr.tag);
911 wpa_hexdump(MSG_MSGDUMP, "X509: extnValue", hdr.payload, hdr.length);
913 res = x509_parse_extension_data(cert, &oid, hdr.payload, hdr.length);
930 struct asn1_hdr hdr;
934 if (asn1_get_next(pos, len, &hdr) < 0 ||
935 hdr.class != ASN1_CLASS_UNIVERSAL ||
936 hdr.tag != ASN1_TAG_SEQUENCE) {
939 "expected SEQUENCE", hdr.class, hdr.tag);
943 pos = hdr.payload;
944 end = pos + hdr.length;
960 struct asn1_hdr hdr;
967 if (asn1_get_next(buf, len, &hdr) < 0 ||
968 hdr.class != ASN1_CLASS_UNIVERSAL ||
969 hdr.tag != ASN1_TAG_SEQUENCE) {
972 hdr.class, hdr.tag);
975 pos = hdr.payload;
976 end = *next = pos + hdr.length;
982 if (asn1_get_next(pos, end - pos, &hdr) < 0)
984 pos = hdr.payload;
986 if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC) {
987 if (asn1_get_next(pos, end - pos, &hdr) < 0)
990 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
991 hdr.tag != ASN1_TAG_INTEGER) {
994 hdr.class, hdr.tag);
997 if (hdr.length != 1) {
999 "length %u (expected 1)", hdr.length);
1002 pos = hdr.payload;
1003 left = hdr.length;
1020 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1027 if (hdr.class != ASN1_CLASS_UNIVERSAL ||
1028 hdr.tag != ASN1_TAG_INTEGER) {
1031 hdr.class, hdr.tag);
1035 pos = hdr.payload;
1036 left = hdr.length;
1075 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1076 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1080 hdr.class, hdr.tag);
1084 if (hdr.tag == 1) {
1089 if (hdr.payload + hdr.length == end)
1092 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1093 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1097 hdr.class, hdr.tag);
1102 if (hdr.tag == 2) {
1107 if (hdr.payload + hdr.length == end)
1110 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1111 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) {
1115 hdr.class, hdr.tag);
1120 if (hdr.tag != 3) {
1123 "tbsCertificate fields", hdr.tag);
1136 if (x509_parse_extensions(cert, hdr.payload, hdr.length) < 0)
1139 pos = hdr.payload + hdr.length;
1199 struct asn1_hdr hdr;
1216 if (asn1_get_next(pos, len, &hdr) < 0 ||
1217 hdr.class != ASN1_CLASS_UNIVERSAL ||
1218 hdr.tag != ASN1_TAG_SEQUENCE) {
1221 hdr.class, hdr.tag);
1225 pos = hdr.payload;
1227 if (pos + hdr.length > end) {
1232 if (pos + hdr.length < end) {
1235 pos + hdr.length, end - pos + hdr.length);
1236 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_BITSTRING) {
1260 hdr.class, hdr.tag);
1264 if (hdr.length < 1) {
1268 pos = hdr.payload;
1280 cert->sign_value = os_malloc(hdr.length - 1);
1287 os_memcpy(cert->sign_value, pos + 1, hdr.length - 1);
1288 cert->sign_value_len = hdr.length - 1;
1310 struct asn1_hdr hdr;
1360 if (asn1_get_next(data, data_len, &hdr) < 0 ||
1361 hdr.class != ASN1_CLASS_UNIVERSAL ||
1362 hdr.tag != ASN1_TAG_SEQUENCE) {
1365 hdr.class, hdr.tag);
1370 pos = hdr.payload;
1371 end = pos + hdr.length;
1381 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1382 hdr.class != ASN1_CLASS_UNIVERSAL ||
1383 hdr.tag != ASN1_TAG_SEQUENCE) {
1386 hdr.class, hdr.tag);
1390 da_end = hdr.payload + hdr.length;
1392 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
1442 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1443 hdr.class != ASN1_CLASS_UNIVERSAL ||
1444 hdr.tag != ASN1_TAG_OCTETSTRING) {
1447 hdr.class, hdr.tag);
1452 hdr.payload, hdr.length);
1480 if (hdr.length != hash_len ||
1481 os_memcmp(hdr.payload, hash, hdr.length) != 0) {