Lines Matching refs:ret

65 #define CHECK(code) if( ( ret = ( code ) ) != 0 ){ return( ret ); }
71 return( ret ); \
81 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_serial() local
94 if( ( ret = mbedtls_asn1_get_len( p, end, &serial->len ) ) != 0 ) in mbedtls_x509_get_serial()
95 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_SERIAL, ret ) ); in mbedtls_x509_get_serial()
112 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_alg_null() local
114 if( ( ret = mbedtls_asn1_get_alg_null( p, end, alg ) ) != 0 ) in mbedtls_x509_get_alg_null()
115 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_alg_null()
126 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_alg() local
128 if( ( ret = mbedtls_asn1_get_alg( p, end, alg, params ) ) != 0 ) in mbedtls_x509_get_alg()
129 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_alg()
146 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in x509_get_hash_alg() local
167 if( ( ret = mbedtls_asn1_get_tag( &p, end, &md_oid.len, MBEDTLS_ASN1_OID ) ) != 0 ) in x509_get_hash_alg()
168 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in x509_get_hash_alg()
174 if( ( ret = mbedtls_oid_get_md_alg( &md_oid, md_alg ) ) != 0 ) in x509_get_hash_alg()
175 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in x509_get_hash_alg()
181 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_NULL ) ) != 0 || len != 0 ) in x509_get_hash_alg()
182 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in x509_get_hash_alg()
207 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_rsassa_pss_params() local
232 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
238 if( ( ret = mbedtls_x509_get_alg_null( &p, end2, &alg_id ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
239 return( ret ); in mbedtls_x509_get_rsassa_pss_params()
241 if( ( ret = mbedtls_oid_get_md_alg( &alg_id, md_alg ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
242 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_rsassa_pss_params()
248 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
249 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_rsassa_pss_params()
257 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
263 if( ( ret = mbedtls_x509_get_alg( &p, end2, &alg_id, &alg_params ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
264 return( ret ); in mbedtls_x509_get_rsassa_pss_params()
272 if( ( ret = x509_get_hash_alg( &alg_params, mgf_md ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
273 return( ret ); in mbedtls_x509_get_rsassa_pss_params()
279 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
280 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_rsassa_pss_params()
288 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
293 if( ( ret = mbedtls_asn1_get_int( &p, end2, salt_len ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
294 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_rsassa_pss_params()
300 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
301 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_rsassa_pss_params()
309 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
316 if( ( ret = mbedtls_asn1_get_int( &p, end2, &trailer_field ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
317 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_rsassa_pss_params()
326 else if( ret != MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) in mbedtls_x509_get_rsassa_pss_params()
327 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_ALG, ret ) ); in mbedtls_x509_get_rsassa_pss_params()
350 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in x509_get_attr_type_value() local
355 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_attr_type_value()
357 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_NAME, ret ) ); in x509_get_attr_type_value()
368 if( ( ret = mbedtls_asn1_get_tag( p, end, &oid->len, MBEDTLS_ASN1_OID ) ) != 0 ) in x509_get_attr_type_value()
369 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_NAME, ret ) ); in x509_get_attr_type_value()
388 if( ( ret = mbedtls_asn1_get_len( p, end, &val->len ) ) != 0 ) in x509_get_attr_type_value()
389 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_NAME, ret ) ); in x509_get_attr_type_value()
431 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_name() local
441 if( ( ret = mbedtls_asn1_get_tag( p, end, &set_len, in mbedtls_x509_get_name()
443 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_NAME, ret ) ); in mbedtls_x509_get_name()
449 if( ( ret = x509_get_attr_type_value( p, end_set, cur ) ) != 0 ) in mbedtls_x509_get_name()
450 return( ret ); in mbedtls_x509_get_name()
499 int ret = MBEDTLS_ERR_X509_INVALID_DATE; in x509_date_is_valid() local
523 return( ret ); in x509_date_is_valid()
537 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in x509_parse_time() local
602 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_time() local
621 ret = mbedtls_asn1_get_len( p, end, &len ); in mbedtls_x509_get_time()
623 if( ret != 0 ) in mbedtls_x509_get_time()
624 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_DATE, ret ) ); in mbedtls_x509_get_time()
631 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_sig() local
641 if( ( ret = mbedtls_asn1_get_bitstring_null( p, end, &len ) ) != 0 ) in mbedtls_x509_get_sig()
642 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_SIGNATURE, ret ) ); in mbedtls_x509_get_sig()
660 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_sig_alg() local
665 if( ( ret = mbedtls_oid_get_sig_alg( sig_oid, md_alg, pk_alg ) ) != 0 ) in mbedtls_x509_get_sig_alg()
666 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG, ret ) ); in mbedtls_x509_get_sig_alg()
677 ret = mbedtls_x509_get_rsassa_pss_params( sig_params, in mbedtls_x509_get_sig_alg()
681 if( ret != 0 ) in mbedtls_x509_get_sig_alg()
684 return( ret ); in mbedtls_x509_get_sig_alg()
708 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_get_ext() local
714 ret = mbedtls_asn1_get_tag( p, end, &ext->len, in mbedtls_x509_get_ext()
716 if( ret != 0 ) in mbedtls_x509_get_ext()
717 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret ) ); in mbedtls_x509_get_ext()
726 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in mbedtls_x509_get_ext()
728 return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_EXTENSIONS, ret ) ); in mbedtls_x509_get_ext()
743 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_dn_gets() local
766 ret = mbedtls_snprintf( p, n, merge ? " + " : ", " ); in mbedtls_x509_dn_gets()
770 ret = mbedtls_oid_get_attr_short_name( &name->oid, &short_name ); in mbedtls_x509_dn_gets()
772 if( ret == 0 ) in mbedtls_x509_dn_gets()
773 ret = mbedtls_snprintf( p, n, "%s=", short_name ); in mbedtls_x509_dn_gets()
775 ret = mbedtls_snprintf( p, n, "\?\?=" ); in mbedtls_x509_dn_gets()
796 ret = mbedtls_snprintf( p, n, "%s", s ); in mbedtls_x509_dn_gets()
812 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_serial_gets() local
827 ret = mbedtls_snprintf( p, n, "%02X%s", in mbedtls_x509_serial_gets()
834 ret = mbedtls_snprintf( p, n, "...." ); in mbedtls_x509_serial_gets()
848 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_sig_alg_gets() local
853 ret = mbedtls_oid_get_sig_alg_desc( sig_oid, &desc ); in mbedtls_x509_sig_alg_gets()
854 if( ret != 0 ) in mbedtls_x509_sig_alg_gets()
855 ret = mbedtls_snprintf( p, n, "???" ); in mbedtls_x509_sig_alg_gets()
857 ret = mbedtls_snprintf( p, n, "%s", desc ); in mbedtls_x509_sig_alg_gets()
871 ret = mbedtls_snprintf( p, n, " (%s, MGF1-%s, 0x%02X)", in mbedtls_x509_sig_alg_gets()
893 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_x509_key_size_helper() local
895 ret = mbedtls_snprintf( p, n, "%s key size", name ); in mbedtls_x509_key_size_helper()
910 int ret = 0; in x509_get_current_time() local
916 ret = -1; in x509_get_current_time()
927 return( ret ); in x509_get_current_time()
1016 int ret = 0; in mbedtls_x509_self_test() local
1028 ret = mbedtls_x509_crt_parse( &clicert, (const unsigned char *) mbedtls_test_cli_crt, in mbedtls_x509_self_test()
1030 if( ret != 0 ) in mbedtls_x509_self_test()
1038 ret = mbedtls_x509_crt_parse( &cacert, (const unsigned char *) mbedtls_test_ca_crt, in mbedtls_x509_self_test()
1040 if( ret != 0 ) in mbedtls_x509_self_test()
1051 ret = mbedtls_x509_crt_verify( &clicert, &cacert, NULL, NULL, &flags, NULL, NULL ); in mbedtls_x509_self_test()
1052 if( ret != 0 ) in mbedtls_x509_self_test()
1069 return( ret ); in mbedtls_x509_self_test()