Lines Matching refs:ret
82 #define CHECK(code) if( ( ret = code ) != 0 ){ return( ret ); }
83 #define CHECK_RANGE(min, max, val) if( val < min || val > max ){ return( ret ); }
91 int ret; in mbedtls_x509_get_serial() local
104 if( ( ret = mbedtls_asn1_get_len( p, end, &serial->len ) ) != 0 ) in mbedtls_x509_get_serial()
105 return( MBEDTLS_ERR_X509_INVALID_SERIAL + ret ); in mbedtls_x509_get_serial()
122 int ret; in mbedtls_x509_get_alg_null() local
124 if( ( ret = mbedtls_asn1_get_alg_null( p, end, alg ) ) != 0 ) in mbedtls_x509_get_alg_null()
125 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_alg_null()
136 int ret; in mbedtls_x509_get_alg() local
138 if( ( ret = mbedtls_asn1_get_alg( p, end, alg, params ) ) != 0 ) in mbedtls_x509_get_alg()
139 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_alg()
156 int ret; in x509_get_hash_alg() local
177 if( ( ret = mbedtls_asn1_get_tag( &p, end, &md_oid.len, MBEDTLS_ASN1_OID ) ) != 0 ) in x509_get_hash_alg()
178 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in x509_get_hash_alg()
184 if( ( ret = mbedtls_oid_get_md_alg( &md_oid, md_alg ) ) != 0 ) in x509_get_hash_alg()
185 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in x509_get_hash_alg()
191 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_NULL ) ) != 0 || len != 0 ) in x509_get_hash_alg()
192 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in x509_get_hash_alg()
217 int ret; in mbedtls_x509_get_rsassa_pss_params() local
242 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
248 if( ( ret = mbedtls_x509_get_alg_null( &p, end2, &alg_id ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
249 return( ret ); in mbedtls_x509_get_rsassa_pss_params()
251 if( ( ret = mbedtls_oid_get_md_alg( &alg_id, md_alg ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
252 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_rsassa_pss_params()
258 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
259 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_rsassa_pss_params()
267 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
273 if( ( ret = mbedtls_x509_get_alg( &p, end2, &alg_id, &alg_params ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
274 return( ret ); in mbedtls_x509_get_rsassa_pss_params()
282 if( ( ret = x509_get_hash_alg( &alg_params, mgf_md ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
283 return( ret ); in mbedtls_x509_get_rsassa_pss_params()
289 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
290 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_rsassa_pss_params()
298 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
303 if( ( ret = mbedtls_asn1_get_int( &p, end2, salt_len ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
304 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_rsassa_pss_params()
310 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
311 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_rsassa_pss_params()
319 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
326 if( ( ret = mbedtls_asn1_get_int( &p, end2, &trailer_field ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
327 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_rsassa_pss_params()
336 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
337 return( MBEDTLS_ERR_X509_INVALID_ALG + ret ); in mbedtls_x509_get_rsassa_pss_params()
360 int ret; in x509_get_attr_type_value() local
365 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_attr_type_value()
367 return( MBEDTLS_ERR_X509_INVALID_NAME + ret ); in x509_get_attr_type_value()
376 if( ( ret = mbedtls_asn1_get_tag( p, end, &oid->len, MBEDTLS_ASN1_OID ) ) != 0 ) in x509_get_attr_type_value()
377 return( MBEDTLS_ERR_X509_INVALID_NAME + ret ); in x509_get_attr_type_value()
396 if( ( ret = mbedtls_asn1_get_len( p, end, &val->len ) ) != 0 ) in x509_get_attr_type_value()
397 return( MBEDTLS_ERR_X509_INVALID_NAME + ret ); in x509_get_attr_type_value()
433 int ret; in mbedtls_x509_get_name() local
443 if( ( ret = mbedtls_asn1_get_tag( p, end, &set_len, in mbedtls_x509_get_name()
445 return( MBEDTLS_ERR_X509_INVALID_NAME + ret ); in mbedtls_x509_get_name()
451 if( ( ret = x509_get_attr_type_value( p, end_set, cur ) ) != 0 ) in mbedtls_x509_get_name()
452 return( ret ); in mbedtls_x509_get_name()
495 int ret = MBEDTLS_ERR_X509_INVALID_DATE; in x509_date_is_valid() local
514 return( ret ); in x509_date_is_valid()
528 int ret; in mbedtls_x509_get_time() local
541 ret = mbedtls_asn1_get_len( p, end, &len ); in mbedtls_x509_get_time()
543 if( ret != 0 ) in mbedtls_x509_get_time()
544 return( MBEDTLS_ERR_X509_INVALID_DATE + ret ); in mbedtls_x509_get_time()
566 ret = mbedtls_asn1_get_len( p, end, &len ); in mbedtls_x509_get_time()
568 if( ret != 0 ) in mbedtls_x509_get_time()
569 return( MBEDTLS_ERR_X509_INVALID_DATE + ret ); in mbedtls_x509_get_time()
592 int ret; in mbedtls_x509_get_sig() local
602 if( ( ret = mbedtls_asn1_get_bitstring_null( p, end, &len ) ) != 0 ) in mbedtls_x509_get_sig()
603 return( MBEDTLS_ERR_X509_INVALID_SIGNATURE + ret ); in mbedtls_x509_get_sig()
621 int ret; in mbedtls_x509_get_sig_alg() local
626 if( ( ret = mbedtls_oid_get_sig_alg( sig_oid, md_alg, pk_alg ) ) != 0 ) in mbedtls_x509_get_sig_alg()
627 return( MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG + ret ); in mbedtls_x509_get_sig_alg()
638 ret = mbedtls_x509_get_rsassa_pss_params( sig_params, in mbedtls_x509_get_sig_alg()
642 if( ret != 0 ) in mbedtls_x509_get_sig_alg()
645 return( ret ); in mbedtls_x509_get_sig_alg()
669 int ret; in mbedtls_x509_get_ext() local
677 if( ( ret = mbedtls_asn1_get_tag( p, end, &ext->len, in mbedtls_x509_get_ext()
679 return( ret ); in mbedtls_x509_get_ext()
692 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in mbedtls_x509_get_ext()
694 return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS + ret ); in mbedtls_x509_get_ext()
709 int ret; in mbedtls_x509_dn_gets() local
732 ret = mbedtls_snprintf( p, n, merge ? " + " : ", " ); in mbedtls_x509_dn_gets()
736 ret = mbedtls_oid_get_attr_short_name( &name->oid, &short_name ); in mbedtls_x509_dn_gets()
738 if( ret == 0 ) in mbedtls_x509_dn_gets()
739 ret = mbedtls_snprintf( p, n, "%s=", short_name ); in mbedtls_x509_dn_gets()
741 ret = mbedtls_snprintf( p, n, "\?\?=" ); in mbedtls_x509_dn_gets()
755 ret = mbedtls_snprintf( p, n, "%s", s ); in mbedtls_x509_dn_gets()
771 int ret; in mbedtls_x509_serial_gets() local
786 ret = mbedtls_snprintf( p, n, "%02X%s", in mbedtls_x509_serial_gets()
793 ret = mbedtls_snprintf( p, n, "...." ); in mbedtls_x509_serial_gets()
807 int ret; in mbedtls_x509_sig_alg_gets() local
812 ret = mbedtls_oid_get_sig_alg_desc( sig_oid, &desc ); in mbedtls_x509_sig_alg_gets()
813 if( ret != 0 ) in mbedtls_x509_sig_alg_gets()
814 ret = mbedtls_snprintf( p, n, "???" ); in mbedtls_x509_sig_alg_gets()
816 ret = mbedtls_snprintf( p, n, "%s", desc ); in mbedtls_x509_sig_alg_gets()
830 ret = mbedtls_snprintf( p, n, " (%s, MGF1-%s, 0x%02X)", in mbedtls_x509_sig_alg_gets()
852 int ret; in mbedtls_x509_key_size_helper() local
854 ret = mbedtls_snprintf( p, n, "%s key size", name ); in mbedtls_x509_key_size_helper()
886 int ret = 0; in x509_get_current_time() local
897 ret = -1; in x509_get_current_time()
913 return( ret ); in x509_get_current_time()
1004 int ret; in mbedtls_x509_self_test() local
1014 ret = mbedtls_x509_crt_parse( &clicert, (const unsigned char *) mbedtls_test_cli_crt, in mbedtls_x509_self_test()
1016 if( ret != 0 ) in mbedtls_x509_self_test()
1021 return( ret ); in mbedtls_x509_self_test()
1026 ret = mbedtls_x509_crt_parse( &cacert, (const unsigned char *) mbedtls_test_ca_crt, in mbedtls_x509_self_test()
1028 if( ret != 0 ) in mbedtls_x509_self_test()
1033 return( ret ); in mbedtls_x509_self_test()
1039 ret = mbedtls_x509_crt_verify( &clicert, &cacert, NULL, NULL, &flags, NULL, NULL ); in mbedtls_x509_self_test()
1040 if( ret != 0 ) in mbedtls_x509_self_test()
1045 return( ret ); in mbedtls_x509_self_test()