Lines Matching full:pos
110 const u8 *pos, *end; in tlsv1_add_cert() local
114 pos = search_tag(pem_cert_begin, buf, len); in tlsv1_add_cert()
115 if (!pos) { in tlsv1_add_cert()
124 while (pos) { in tlsv1_add_cert()
125 pos += os_strlen(pem_cert_begin); in tlsv1_add_cert()
126 end = search_tag(pem_cert_end, pos, buf + len - pos); in tlsv1_add_cert()
133 der = base64_decode((const char *) pos, end - pos, &der_len); in tlsv1_add_cert()
150 pos = search_tag(pem_cert_begin, end, buf + len - end); in tlsv1_add_cert()
199 const char *pos = cert + 7; in tlsv1_set_ca_cert() local
200 if (os_strncmp(pos, "server/sha256/", 14) != 0) { in tlsv1_set_ca_cert()
206 pos += 14; in tlsv1_set_ca_cert()
207 if (os_strlen(pos) != 32 * 2) { in tlsv1_set_ca_cert()
213 if (hexstr2bin(pos, cred->srv_cert_hash, 32) < 0) { in tlsv1_set_ca_cert()
268 const u8 *pos, *end; in tlsv1_set_key_pem() local
273 pos = search_tag(pem_key_begin, key, len); in tlsv1_set_key_pem()
274 if (!pos) { in tlsv1_set_key_pem()
275 pos = search_tag(pem_key2_begin, key, len); in tlsv1_set_key_pem()
276 if (!pos) in tlsv1_set_key_pem()
278 pos += os_strlen(pem_key2_begin); in tlsv1_set_key_pem()
279 end = search_tag(pem_key2_end, pos, key + len - pos); in tlsv1_set_key_pem()
284 pos += os_strlen(pem_key_begin); in tlsv1_set_key_pem()
285 end = search_tag(pem_key_end, pos, key + len - pos); in tlsv1_set_key_pem()
288 pos2 = search_tag("Proc-Type: 4,ENCRYPTED", pos, end - pos); in tlsv1_set_key_pem()
296 der = base64_decode((const char *) pos, end - pos, &der_len); in tlsv1_set_key_pem()
309 const u8 *pos, *end; in tlsv1_set_key_enc_pem() local
316 pos = search_tag(pem_key_enc_begin, key, len); in tlsv1_set_key_enc_pem()
317 if (!pos) in tlsv1_set_key_enc_pem()
319 pos += os_strlen(pem_key_enc_begin); in tlsv1_set_key_enc_pem()
320 end = search_tag(pem_key_enc_end, pos, key + len - pos); in tlsv1_set_key_enc_pem()
324 der = base64_decode((const char *) pos, end - pos, &der_len); in tlsv1_set_key_enc_pem()
449 const u8 *pos, *end; in pkcs12_certbag() local
463 pos = hdr.payload; in pkcs12_certbag()
466 if (asn1_get_oid(pos, end - pos, &oid, &pos)) { in pkcs12_certbag()
481 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in pkcs12_certbag()
515 static int pkcs12_parse_attr_friendly_name(const u8 *pos, const u8 *end) in pkcs12_parse_attr_friendly_name() argument
528 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse_attr_friendly_name()
540 static int pkcs12_parse_attr_local_key_id(const u8 *pos, const u8 *end) in pkcs12_parse_attr_local_key_id() argument
553 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse_attr_local_key_id()
565 static int pkcs12_parse_attr(const u8 *pos, size_t len) in pkcs12_parse_attr() argument
567 const u8 *end = pos + len; in pkcs12_parse_attr()
579 if (asn1_get_oid(pos, end - pos, &a_oid, &pos)) { in pkcs12_parse_attr()
587 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !asn1_is_set(&hdr)) { in pkcs12_parse_attr()
593 pos = hdr.payload; in pkcs12_parse_attr()
597 return pkcs12_parse_attr_friendly_name(pos, end); in pkcs12_parse_attr()
599 return pkcs12_parse_attr_local_key_id(pos, end); in pkcs12_parse_attr()
612 const u8 *pos = buf, *end = buf + len; in pkcs12_safebag() local
619 if (asn1_get_oid(pos, end - pos, &oid, &pos)) { in pkcs12_safebag()
628 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in pkcs12_safebag()
637 pos = hdr.payload + hdr.length; in pkcs12_safebag()
639 if (pos < end) { in pkcs12_safebag()
641 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_safebag()
650 pos = hdr.payload; in pkcs12_safebag()
652 while (pos < end) { in pkcs12_safebag()
654 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_safebag()
662 pos = hdr.payload + hdr.length; in pkcs12_safebag()
683 const u8 *pos, *end; in pkcs12_safecontents() local
691 pos = hdr.payload; in pkcs12_safecontents()
702 while (pos < end) { in pkcs12_safecontents()
703 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_safecontents()
711 pos = hdr.payload + hdr.length; in pkcs12_safecontents()
719 const u8 *pos, const u8 *end, in pkcs12_parse_content_data() argument
725 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse_content_data()
738 const u8 *pos, const u8 *end, in pkcs12_parse_content_enc_data() argument
754 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse_content_enc_data()
760 pos = hdr.payload; in pkcs12_parse_content_enc_data()
763 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !asn1_is_integer(&hdr)) { in pkcs12_parse_content_enc_data()
772 pos = hdr.payload + hdr.length; in pkcs12_parse_content_enc_data()
775 pos, end - pos); in pkcs12_parse_content_enc_data()
783 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse_content_enc_data()
790 pos = hdr.payload; in pkcs12_parse_content_enc_data()
791 end = pos + hdr.length; in pkcs12_parse_content_enc_data()
794 if (asn1_get_oid(pos, end - pos, &oid, &pos)) { in pkcs12_parse_content_enc_data()
811 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse_content_enc_data()
819 pos = hdr.payload + hdr.length; in pkcs12_parse_content_enc_data()
821 if (asn1_get_next(pos, end - pos, &hdr) < 0 || hdr.constructed || in pkcs12_parse_content_enc_data()
847 const u8 *pos = buf; in pkcs12_parse_content() local
855 if (asn1_get_oid(pos, end - pos, &oid, &pos)) { in pkcs12_parse_content()
864 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in pkcs12_parse_content()
870 pos = hdr.payload; in pkcs12_parse_content()
873 return pkcs12_parse_content_data(cred, pos, end, passwd); in pkcs12_parse_content()
875 return pkcs12_parse_content_enc_data(cred, pos, end, passwd); in pkcs12_parse_content()
888 const u8 *pos, *end; in pkcs12_parse() local
906 pos = hdr.payload; in pkcs12_parse()
907 end = pos + hdr.length; in pkcs12_parse()
909 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !asn1_is_integer(&hdr)) { in pkcs12_parse()
918 pos = hdr.payload + hdr.length; in pkcs12_parse()
926 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse()
933 pos = hdr.payload; in pkcs12_parse()
934 end = pos + hdr.length; in pkcs12_parse()
937 if (asn1_get_oid(pos, end - pos, &oid, &pos)) { in pkcs12_parse()
950 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in pkcs12_parse()
957 pos = hdr.payload; in pkcs12_parse()
960 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse()
983 pos = hdr.payload; in pkcs12_parse()
984 end = pos + hdr.length; in pkcs12_parse()
986 while (end > pos) { in pkcs12_parse()
987 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs12_parse()
997 pos = hdr.payload + hdr.length; in pkcs12_parse()
1075 const u8 *pos, *end; in tlsv1_set_dhparams_der() local
1077 pos = dh; in tlsv1_set_dhparams_der()
1088 if (asn1_get_next(pos, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in tlsv1_set_dhparams_der()
1093 pos = hdr.payload; in tlsv1_set_dhparams_der()
1096 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tlsv1_set_dhparams_der()
1110 pos = hdr.payload + hdr.length; in tlsv1_set_dhparams_der()
1113 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tlsv1_set_dhparams_der()
1139 const u8 *pos, *end; in tlsv1_set_dhparams_blob() local
1143 pos = search_tag(pem_dhparams_begin, buf, len); in tlsv1_set_dhparams_blob()
1144 if (!pos) { in tlsv1_set_dhparams_blob()
1153 pos += os_strlen(pem_dhparams_begin); in tlsv1_set_dhparams_blob()
1154 end = search_tag(pem_dhparams_end, pos, buf + len - pos); in tlsv1_set_dhparams_blob()
1161 der = base64_decode((const char *) pos, end - pos, &der_len); in tlsv1_set_dhparams_blob()