Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbedtls_pkcs12_derivation() can't exit when the input password length is 0. #5136

Closed
CindyZhouYH opened this issue Nov 8, 2021 · 0 comments · Fixed by #5155
Closed

mbedtls_pkcs12_derivation() can't exit when the input password length is 0. #5136

CindyZhouYH opened this issue Nov 8, 2021 · 0 comments · Fixed by #5155
Assignees
Labels
bug component-x509 size-m Estimated task size: medium (~1w)

Comments

@CindyZhouYH
Copy link

Summary

I am using mbedtls_pkcs12_derivation(). The testfile is as follows:

void PKCS12(){
    int keySize = 95;
    int iterations = 3;
    const uint8_t password[] = {} ;
    const uint8_t salt[] = {0xda, 0x22, 0x10, 0x3a, 0xce, 0x14, 0xda, 0xaa, 0x38};
    mbedtls_md_type_t md_type = MBEDTLS_MD_NONE;
    uint8_t* out = (uint8_t *)::malloc(keySize);
    md_type = MBEDTLS_MD_MD5;
    mbedtls_pkcs12_derivation(
                out,
                keySize,
                password,
                sizeof(password),
                salt,
                sizeof(salt),
                md_type,
                MBEDTLS_PKCS12_DERIVE_KEY,
                iterations);
    free(out);
}

The program keeps running that cannot exit. Neither result nor error is given.

Expected behavior

Exit with a result, or an error code if not supported.

Actual behavior

The function does not exit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-x509 size-m Estimated task size: medium (~1w)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants