Home | History | Annotate | Download | only in tls

Lines Matching refs:pos

185 	const u8 *pos, *end;
202 pos = hdr.payload;
203 end = pos + hdr.length;
210 if (asn1_get_oid(pos, end - pos, &id->oid, &pos))
224 const u8 *pos, *end;
233 pos = buf;
236 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
244 pos = hdr.payload;
246 if (pos + hdr.length > end)
248 end = pos + hdr.length;
251 if (x509_parse_algorithm_identifier(pos, end - pos,
252 &cert->public_key_alg, &pos))
255 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
265 pos = hdr.payload;
266 if (*pos) {
268 *pos);
283 os_memcpy(cert->public_key, pos + 1, hdr.length - 1);
296 const u8 *pos, *end, *set_pos, *set_end, *seq_pos, *seq_end;
320 pos = hdr.payload;
322 if (pos + hdr.length > buf + len)
325 end = *next = pos + hdr.length;
327 while (pos < end) {
330 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
341 pos = set_end = hdr.payload + hdr.length;
501 char *pos, *end;
508 pos = buf;
512 ret = os_snprintf(pos, end - pos, "%s=%s, ",
515 if (ret < 0 || ret >= end - pos)
517 pos += ret;
520 if (pos > buf + 1 && pos[-1] == ' ' && pos[-2] == ',') {
521 pos--;
522 *pos = '\0';
523 pos--;
524 *pos = '\0';
528 ret = os_snprintf(pos, end - pos, "/emailAddress=%s",
530 if (ret < 0 || ret >= end - pos)
532 pos += ret;
543 const char *pos;
556 pos = (const char *) buf;
565 if (sscanf(pos, "%02d", &year) != 1) {
574 pos += 2;
582 if (sscanf(pos, "%04d", &year) != 1) {
587 pos += 4;
595 if (sscanf(pos, "%02d", &month) != 1) {
600 pos += 2;
602 if (sscanf(pos, "%02d", &day) != 1) {
607 pos += 2;
609 if (sscanf(pos, "%02d", &hour) != 1) {
614 pos += 2;
616 if (sscanf(pos, "%02d", &min) != 1) {
621 pos += 2;
623 if (sscanf(pos, "%02d", &sec) != 1) {
654 const u8 *pos;
677 pos = hdr.payload;
680 if (pos + plen > buf + len)
683 *next = pos + plen;
685 if (asn1_get_next(pos, plen, &hdr) < 0 ||
694 pos = hdr.payload + hdr.length;
695 plen = *next - pos;
697 if (asn1_get_next(pos, plen, &hdr) < 0 ||
725 const u8 *pos, size_t len)
742 if (asn1_get_next(pos, len, &hdr) < 0 ||
762 const u8 *pos, size_t len)
774 if (asn1_get_next(pos, len, &hdr) < 0 ||
804 if (hdr.payload + hdr.length == pos + len) {
826 pos = hdr.payload;
831 value |= *pos++;
847 const u8 *pos, size_t len)
850 wpa_hexdump_ascii(MSG_MSGDUMP, "X509: altName - rfc822Name", pos, len);
855 os_memcpy(name->alt_email, pos, len);
869 const u8 *pos, size_t len)
872 wpa_hexdump_ascii(MSG_MSGDUMP, "X509: altName - dNSName", pos, len);
877 os_memcpy(name->dns, pos, len);
891 const u8 *pos, size_t len)
896 pos, len);
901 os_memcpy(name->uri, pos, len);
915 const u8 *pos, size_t len)
918 wpa_hexdump(MSG_MSGDUMP, "X509: altName - iPAddress", pos, len);
923 os_memcpy(name->ip, pos, 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 ||
1131 pos = hdr.payload;
1132 *next = end = pos + hdr.length;
1134 if (asn1_get_oid(pos, end - pos, &oid, &pos) < 0) {
1140 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1157 pos = hdr.payload;
1158 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1189 const u8 *pos, size_t len)
1196 if (asn1_get_next(pos, len, &hdr) < 0 ||
1205 pos = hdr.payload;
1206 end = pos + hdr.length;
1208 while (pos < end) {
1209 if (x509_parse_extension(cert, pos, end - pos, &pos)
1223 const u8 *pos, *end;
1237 pos = hdr.payload;
1238 end = *next = pos + hdr.length;
1244 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1246 pos = hdr.payload;
1249 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1264 pos = hdr.payload;
1269 value |= *pos++;
1282 if (asn1_get_next(pos, end - pos, &hdr) < 0)
1297 pos = hdr.payload;
1301 cert->serial_number |= *pos++;
1307 if (x509_parse_algorithm_identifier(pos, end - pos, &cert->signature,
1308 &pos))
1312 if (x509_parse_name(pos, end - pos, &cert->issuer, &pos))
1318 if (x509_parse_validity(pos, end - pos, cert, &pos))
1322 if (x509_parse_name(pos, end - pos, &cert->subject, &pos))
1328 if (x509_parse_public_key(pos, end - pos, cert, &pos))
1331 if (pos == end)
1337 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1354 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1372 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1401 pos = hdr.payload + hdr.length;
1402 if (pos < end) {
1405 pos, end - pos);
1477 const u8 *pos, *end, *hash_start;
1487 pos = buf;
1493 if (asn1_get_next(pos, len, &hdr) < 0 ||
1502 pos = hdr.payload;
1504 if (pos + hdr.length > end) {
1509 if (pos + hdr.length < end) {
1512 pos + hdr.length, end - pos + hdr.length);
1513 end = pos + hdr.length;
1516 hash_start = pos;
1518 if (x509_parse_tbs_certificate(pos, end - pos, cert, &pos)) {
1522 cert->tbs_cert_len = pos - hash_start;
1525 if (x509_parse_algorithm_identifier(pos, end - pos,
1526 &cert->signature_alg, &pos)) {
1532 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1545 pos = hdr.payload;
1546 if (*pos) {
1548 *pos);
1564 os_memcpy(cert->sign_value, pos + 1, hdr.length - 1);
1585 const u8 *pos, *end, *next, *da_end;
1647 pos = hdr.payload;
1648 end = pos + hdr.length;
1658 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||
1729 pos = da_end;
1732 if (asn1_get_next(pos, end - pos, &hdr) < 0 ||