Lines Matching refs:ret
55 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in x509_crl_get_version() local
57 if ((ret = mbedtls_asn1_get_int(p, end, ver)) != 0) { in x509_crl_get_version()
58 if (ret == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG) { in x509_crl_get_version()
63 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_VERSION, ret); in x509_crl_get_version()
80 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in x509_get_crl_ext() local
90 if ((ret = mbedtls_x509_get_ext(p, end, ext, 0)) != 0) { in x509_get_crl_ext()
91 return ret; in x509_get_crl_ext()
108 if ((ret = mbedtls_asn1_get_tag(p, end, &len, in x509_get_crl_ext()
110 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret); in x509_get_crl_ext()
116 if ((ret = mbedtls_asn1_get_tag(p, end_ext_data, &len, in x509_get_crl_ext()
118 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret); in x509_get_crl_ext()
123 if ((ret = mbedtls_asn1_get_bool(p, end_ext_data, in x509_get_crl_ext()
125 (ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG)) { in x509_get_crl_ext()
126 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret); in x509_get_crl_ext()
130 if ((ret = mbedtls_asn1_get_tag(p, end_ext_data, &len, in x509_get_crl_ext()
132 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret); in x509_get_crl_ext()
164 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in x509_get_crl_entry_ext() local
179 if ((ret = mbedtls_asn1_get_tag(p, end, &ext->len, in x509_get_crl_entry_ext()
181 if (ret == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG) { in x509_get_crl_entry_ext()
185 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret); in x509_get_crl_entry_ext()
196 if ((ret = mbedtls_asn1_get_tag(p, end, &len, in x509_get_crl_entry_ext()
198 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret); in x509_get_crl_entry_ext()
219 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in x509_get_entries() local
227 if ((ret = mbedtls_asn1_get_tag(p, end, &entry_len, in x509_get_entries()
229 if (ret == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG) { in x509_get_entries()
233 return ret; in x509_get_entries()
243 if ((ret = mbedtls_asn1_get_tag(p, end, &len2, in x509_get_entries()
245 return ret; in x509_get_entries()
252 if ((ret = mbedtls_x509_get_serial(p, end2, &cur_entry->serial)) != 0) { in x509_get_entries()
253 return ret; in x509_get_entries()
256 if ((ret = mbedtls_x509_get_time(p, end2, in x509_get_entries()
258 return ret; in x509_get_entries()
261 if ((ret = x509_get_crl_entry_ext(p, end2, in x509_get_entries()
263 return ret; in x509_get_entries()
286 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_crl_parse_der() local
347 if ((ret = mbedtls_asn1_get_tag(&p, end, &len, in mbedtls_x509_crl_parse_der()
364 if ((ret = mbedtls_asn1_get_tag(&p, end, &len, in mbedtls_x509_crl_parse_der()
367 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret); in mbedtls_x509_crl_parse_der()
379 if ((ret = x509_crl_get_version(&p, end, &crl->version)) != 0 || in mbedtls_x509_crl_parse_der()
380 (ret = mbedtls_x509_get_alg(&p, end, &crl->sig_oid, &sig_params1)) != 0) { in mbedtls_x509_crl_parse_der()
382 return ret; in mbedtls_x509_crl_parse_der()
392 if ((ret = mbedtls_x509_get_sig_alg(&crl->sig_oid, &sig_params1, in mbedtls_x509_crl_parse_der()
404 if ((ret = mbedtls_asn1_get_tag(&p, end, &len, in mbedtls_x509_crl_parse_der()
407 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret); in mbedtls_x509_crl_parse_der()
410 if ((ret = mbedtls_x509_get_name(&p, p + len, &crl->issuer)) != 0) { in mbedtls_x509_crl_parse_der()
412 return ret; in mbedtls_x509_crl_parse_der()
421 if ((ret = mbedtls_x509_get_time(&p, end, &crl->this_update)) != 0) { in mbedtls_x509_crl_parse_der()
423 return ret; in mbedtls_x509_crl_parse_der()
426 if ((ret = mbedtls_x509_get_time(&p, end, &crl->next_update)) != 0) { in mbedtls_x509_crl_parse_der()
427 if (ret != (MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_DATE, in mbedtls_x509_crl_parse_der()
429 ret != (MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_DATE, in mbedtls_x509_crl_parse_der()
432 return ret; in mbedtls_x509_crl_parse_der()
444 if ((ret = x509_get_entries(&p, end, &crl->entry)) != 0) { in mbedtls_x509_crl_parse_der()
446 return ret; in mbedtls_x509_crl_parse_der()
454 ret = x509_get_crl_ext(&p, end, &crl->crl_ext); in mbedtls_x509_crl_parse_der()
456 if (ret != 0) { in mbedtls_x509_crl_parse_der()
458 return ret; in mbedtls_x509_crl_parse_der()
474 if ((ret = mbedtls_x509_get_alg(&p, end, &sig_oid2, &sig_params2)) != 0) { in mbedtls_x509_crl_parse_der()
476 return ret; in mbedtls_x509_crl_parse_der()
488 if ((ret = mbedtls_x509_get_sig(&p, end, &crl->sig)) != 0) { in mbedtls_x509_crl_parse_der()
490 return ret; in mbedtls_x509_crl_parse_der()
508 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_crl_parse() local
523 ret = MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT; in mbedtls_x509_crl_parse()
525 ret = mbedtls_pem_read_buffer(&pem, in mbedtls_x509_crl_parse()
531 if (ret == 0) { in mbedtls_x509_crl_parse()
540 if ((ret = mbedtls_x509_crl_parse_der(chain, in mbedtls_x509_crl_parse()
543 return ret; in mbedtls_x509_crl_parse()
547 return ret; in mbedtls_x509_crl_parse()
569 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_crl_parse_file() local
573 if ((ret = mbedtls_pk_load_file(path, &buf, &n)) != 0) { in mbedtls_x509_crl_parse_file()
574 return ret; in mbedtls_x509_crl_parse_file()
577 ret = mbedtls_x509_crl_parse(chain, buf, n); in mbedtls_x509_crl_parse_file()
581 return ret; in mbedtls_x509_crl_parse_file()
597 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_crl_info() local
605 ret = mbedtls_snprintf(p, n, "%sCRL version : %d", in mbedtls_x509_crl_info()
609 ret = mbedtls_snprintf(p, n, "\n%sissuer name : ", prefix); in mbedtls_x509_crl_info()
611 ret = mbedtls_x509_dn_gets(p, n, &crl->issuer); in mbedtls_x509_crl_info()
614 ret = mbedtls_snprintf(p, n, "\n%sthis update : " \ in mbedtls_x509_crl_info()
621 ret = mbedtls_snprintf(p, n, "\n%snext update : " \ in mbedtls_x509_crl_info()
630 ret = mbedtls_snprintf(p, n, "\n%sRevoked certificates:", in mbedtls_x509_crl_info()
635 ret = mbedtls_snprintf(p, n, "\n%sserial number: ", in mbedtls_x509_crl_info()
639 ret = mbedtls_x509_serial_gets(p, n, &entry->serial); in mbedtls_x509_crl_info()
642 ret = mbedtls_snprintf(p, n, " revocation date: " \ in mbedtls_x509_crl_info()
652 ret = mbedtls_snprintf(p, n, "\n%ssigned using : ", prefix); in mbedtls_x509_crl_info()
655 ret = mbedtls_x509_sig_alg_gets(p, n, &crl->sig_oid, crl->sig_pk, crl->sig_md, in mbedtls_x509_crl_info()
659 ret = mbedtls_snprintf(p, n, "\n"); in mbedtls_x509_crl_info()