pub unsafe extern "C" fn mbedtls_pkcs5_pbes2_ext(
pbe_params: *const mbedtls_asn1_buf,
mode: c_int,
pwd: *const c_uchar,
pwdlen: usize,
data: *const c_uchar,
datalen: usize,
output: *mut c_uchar,
output_size: usize,
output_len: *mut usize,
) -> c_intExpand description
\brief PKCS#5 PBES2 function
\warning When decrypting: - This function validates the CBC padding and returns #MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH if the padding is invalid. Note that this can help active adversaries attempting to brute-forcing the password. Note also that there is no guarantee that an invalid password will be detected (the chances of a valid padding with a random password are about 1/255).
\param pbe_params the ASN.1 algorithm parameters \param mode either #MBEDTLS_PKCS5_DECRYPT or #MBEDTLS_PKCS5_ENCRYPT \param pwd password to use when generating key \param pwdlen length of password \param data data to process \param datalen length of data \param output Output buffer. On success, it contains the decrypted data. On failure, the content is indetermidate. For decryption, there must be enough room for \p datalen bytes. For encryption, there must be enough room for \p datalen + 1 bytes, rounded up to the block size of the block cipher identified by \p pbe_params. \param output_size size of output buffer. This must be big enough to accommodate for output plus padding data. \param output_len On success, length of actual data written to the output buffer.
\returns 0 on success, or a MBEDTLS_ERR_XXX code if parsing or decryption fails.