diff options
author | DLL125 <134442578+DLL125@users.noreply.github.com> | 2023-07-17 14:11:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 14:11:12 +0200 |
commit | 65765798d85258c0358b28b90aac68ed1851f49b (patch) | |
tree | 22f573edc4e16790d9be208fce95db1134fe2ba4 /src/Common/libzip/zip_crypto_mbedtls.c | |
parent | 6267b91931af87db2b95172389a6fbaac206e42e (diff) | |
download | VeraCrypt-65765798d85258c0358b28b90aac68ed1851f49b.tar.gz VeraCrypt-65765798d85258c0358b28b90aac68ed1851f49b.zip |
Libzip (#1152)
* Update LZMA to latest
* Update Libzip
Libzip updated to latest.
Diffstat (limited to 'src/Common/libzip/zip_crypto_mbedtls.c')
-rw-r--r-- | src/Common/libzip/zip_crypto_mbedtls.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Common/libzip/zip_crypto_mbedtls.c b/src/Common/libzip/zip_crypto_mbedtls.c index 95ac8990..84544a82 100644 --- a/src/Common/libzip/zip_crypto_mbedtls.c +++ b/src/Common/libzip/zip_crypto_mbedtls.c @@ -117,6 +117,8 @@ _zip_crypto_pbkdf2(const zip_uint8_t *key, zip_uint64_t key_length, const zip_ui mbedtls_md_context_t sha1_ctx; bool ok = true; +#if MBEDTLS_VERSION_NUMBER < 0x03030000 + mbedtls_md_init(&sha1_ctx); if (mbedtls_md_setup(&sha1_ctx, mbedtls_md_info_from_type(MBEDTLS_MD_SHA1), 1) != 0) { @@ -128,6 +130,13 @@ _zip_crypto_pbkdf2(const zip_uint8_t *key, zip_uint64_t key_length, const zip_ui } mbedtls_md_free(&sha1_ctx); + +#else + + ok = mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, (const unsigned char *)key, (size_t)key_length, (const unsigned char *)salt, (size_t)salt_length, (unsigned int)iterations, (uint32_t)output_length, (unsigned char *)output) == 0; + +#endif // !defined(MBEDTLS_DEPRECATED_REMOVED) || MBEDTLS_VERSION_NUMBER < 0x03030000 + return ok; } |