mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
Bell catchup
This commit is contained in:
@@ -135,14 +135,20 @@ std::vector<uint8_t> CryptoMbedTLS::pbkdf2HmacSha1(
|
||||
int iterations, int digestSize) {
|
||||
auto digest = std::vector<uint8_t>(digestSize);
|
||||
|
||||
#if MBEDTLS_VERSION_NUMBER < 0x03030000
|
||||
// Init sha context
|
||||
sha1Init();
|
||||
mbedtls_pkcs5_pbkdf2_hmac(&sha1Context, password.data(), password.size(),
|
||||
salt.data(), salt.size(), iterations, digestSize,
|
||||
digest.data());
|
||||
|
||||
|
||||
// Free sha context
|
||||
mbedtls_md_free(&sha1Context);
|
||||
#else
|
||||
mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, password.data(), password.size(),
|
||||
salt.data(), salt.size(), iterations, digestSize,
|
||||
digest.data());
|
||||
#endif
|
||||
|
||||
return digest;
|
||||
}
|
||||
@@ -230,4 +236,4 @@ std::vector<uint8_t> CryptoMbedTLS::generateVectorWithRandomData(
|
||||
mbedtls_ctr_drbg_free(&ctrDrbg);
|
||||
|
||||
return randomVector;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user