Lines Matching refs:ret
39 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
55 if ((ret = mbedtls_asn1_get_tag(p, end, &salt->len, MBEDTLS_ASN1_OCTET_STRING)) != 0) {
56 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT, ret);
62 if ((ret = mbedtls_asn1_get_int(p, end, iterations)) != 0) {
63 return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT, ret);
81 int ret, iterations = 0;
93 if ((ret = pkcs12_parse_pbe_params(pbe_params, &salt,
95 return ret;
102 if ((ret = mbedtls_pkcs12_derivation(key, keylen, unipwd, pwdlen * 2 + 2,
105 return ret;
112 if ((ret = mbedtls_pkcs12_derivation(iv, ivlen, unipwd, pwdlen * 2 + 2,
115 return ret;
157 int ret, keylen = 0;
191 if ((ret = pkcs12_pbe_derive_key_iv(pbe_params, md_type, pwd, pwdlen,
194 return ret;
199 if ((ret = mbedtls_cipher_setup(&cipher_ctx, cipher_info)) != 0) {
203 if ((ret = mbedtls_cipher_setkey(&cipher_ctx, key, 8 * keylen,
222 if ((ret = mbedtls_cipher_set_padding_mode(&cipher_ctx, padding)) != 0) {
228 ret = mbedtls_cipher_crypt(&cipher_ctx, iv, iv_len, data, len, output, &finish_olen);
229 if (ret == MBEDTLS_ERR_CIPHER_INVALID_PADDING) {
230 ret = MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH;
240 return ret;
273 int ret = -1;
284 if ((ret = mbedtls_md_setup(&md_ctx, md_info, 0)) != 0) {
285 return ret;
288 if ((ret = mbedtls_md_starts(&md_ctx)) != 0) {
292 if ((ret = mbedtls_md_update(&md_ctx, diversifier, v)) != 0) {
297 if ((ret = mbedtls_md_update(&md_ctx, salt_block, v)) != 0) {
303 if ((ret = mbedtls_md_update(&md_ctx, pwd_block, v)) != 0) {
308 if ((ret = mbedtls_md_finish(&md_ctx, hash_output)) != 0) {
314 if ((ret = mbedtls_md(md_info, hash_output, hlen, hash_output))
322 return ret;
331 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
426 ret = 0;
434 return ret;