Lines Matching defs:len

181 	const u8 *buf, size_t len,
194 if (asn1_get_next(buf, len, &hdr) < 0 ||
205 if (end > buf + len)
219 static int x509_parse_public_key(const u8 *buf, size_t len,
234 end = buf + len;
292 static int x509_parse_name(const u8 *buf, size_t len, struct x509_name *name,
312 if (asn1_get_next(buf, len, &hdr) < 0 ||
322 if (pos + hdr.length > buf + len)
378 if (oid.len == 4 &&
407 } else if (oid.len == 7 &&
422 } else if (oid.len == 7 &&
434 oid.len * sizeof(oid.oid[0]));
497 * @len: Maximum buffer length
499 void x509_name_string(struct x509_name *name, char *buf, size_t len)
505 if (len == 0)
509 end = buf + len;
540 static int x509_parse_time(const u8 *buf, size_t len, u8 asn1_tag,
560 if (len != 13 || buf[12] != 'Z') {
562 "UTCTime format", buf, len);
567 "UTCTime year", buf, len);
577 if (len != 15 || buf[14] != 'Z') {
579 "GeneralizedTime format", buf, len);
584 "GeneralizedTime year", buf, len);
597 "(month)", buf, len);
604 "(day)", buf, len);
611 "(hour)", buf, len);
618 "(min)", buf, len);
625 "(sec)", buf, len);
631 buf, len);
650 static int x509_parse_validity(const u8 *buf, size_t len,
669 if (asn1_get_next(buf, len, &hdr) < 0 ||
680 if (pos + plen > buf + len)
717 return oid->len >= 4 &&
725 const u8 *pos, size_t len)
742 if (asn1_get_next(pos, len, &hdr) < 0 ||
747 "KeyUsage; found %d tag 0x%x len %d",
762 const u8 *pos, size_t len)
774 if (asn1_get_next(pos, len, &hdr) < 0 ||
804 if (hdr.payload + hdr.length == pos + len) {
810 if (asn1_get_next(hdr.payload + hdr.length, len - hdr.length,
847 const u8 *pos, size_t len)
850 wpa_hexdump_ascii(MSG_MSGDUMP, "X509: altName - rfc822Name", pos, len);
852 name->alt_email = os_zalloc(len + 1);
855 os_memcpy(name->alt_email, pos, len);
856 if (os_strlen(name->alt_email) != len) {
869 const u8 *pos, size_t len)
872 wpa_hexdump_ascii(MSG_MSGDUMP, "X509: altName - dNSName", pos, len);
874 name->dns = os_zalloc(len + 1);
877 os_memcpy(name->dns, pos, len);
878 if (os_strlen(name->dns) != len) {
891 const u8 *pos, size_t len)
896 pos, len);
898 name->uri = os_zalloc(len + 1);
901 os_memcpy(name->uri, pos, len);
902 if (os_strlen(name->uri) != len) {
915 const u8 *pos, size_t len)
918 wpa_hexdump(MSG_MSGDUMP, "X509: altName - iPAddress", pos, len);
920 name->ip = os_malloc(len);
923 os_memcpy(name->ip, pos, len);
924 name->ip_len = len;
930 const u8 *pos, size_t len)
935 if (asn1_parse_oid(pos, len, &name->rid) < 0)
946 const u8 *pos, size_t len)
974 for (p = pos, end = pos + len; p < end; p = hdr.payload + hdr.length) {
1024 const u8 *pos, size_t len)
1030 if (asn1_get_next(pos, len, &hdr) < 0 ||
1051 const u8 *pos, size_t len)
1057 if (asn1_get_next(pos, len, &hdr) < 0 ||
1079 const u8 *pos, size_t len)
1093 return x509_parse_ext_key_usage(cert, pos, len);
1095 return x509_parse_ext_subject_alt_name(cert, pos, len);
1097 return x509_parse_ext_issuer_alt_name(cert, pos, len);
1099 return x509_parse_ext_basic_constraints(cert, pos, len);
1107 const u8 *pos, size_t len, const u8 **next)
1123 if (asn1_get_next(pos, len, &hdr) < 0 ||
1189 const u8 *pos, size_t len)
1196 if (asn1_get_next(pos, len, &hdr) < 0 ||
1218 static int x509_parse_tbs_certificate(const u8 *buf, size_t len,
1229 if (asn1_get_next(buf, len, &hdr) < 0 ||
1416 return oid->len >= 4 &&
1426 return oid->len >= 5 &&
1434 return oid->len >= 5 &&
1442 return oid->len == 6 &&
1454 return oid->len == 9 &&
1470 * @len: Buffer length
1476 struct x509_certificate * x509_certificate_parse(const u8 *buf, size_t len)
1482 cert = os_zalloc(sizeof(*cert) + len);
1485 os_memcpy(cert + 1, buf, len);
1487 cert->cert_len = len;
1490 end = buf + len;
1495 if (asn1_get_next(pos, len, &hdr) < 0 ||
1595 cert->signature.oid.len != 7 ||