summaryrefslogtreecommitdiffstats
path: root/src/mbedTLS++/CryptoKey.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-07-27 22:34:14 +0200
committerGitHub <noreply@github.com>2021-07-27 22:34:14 +0200
commit6a4460383e98fbdbdf568c0cb154dafec833ed44 (patch)
treee8288a866ab335fee9e7d8f959c703916db3b6e4 /src/mbedTLS++/CryptoKey.cpp
parentUpdate Core (#5274) (diff)
downloadcuberite-6a4460383e98fbdbdf568c0cb154dafec833ed44.tar
cuberite-6a4460383e98fbdbdf568c0cb154dafec833ed44.tar.gz
cuberite-6a4460383e98fbdbdf568c0cb154dafec833ed44.tar.bz2
cuberite-6a4460383e98fbdbdf568c0cb154dafec833ed44.tar.lz
cuberite-6a4460383e98fbdbdf568c0cb154dafec833ed44.tar.xz
cuberite-6a4460383e98fbdbdf568c0cb154dafec833ed44.tar.zst
cuberite-6a4460383e98fbdbdf568c0cb154dafec833ed44.zip
Diffstat (limited to 'src/mbedTLS++/CryptoKey.cpp')
-rw-r--r--src/mbedTLS++/CryptoKey.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mbedTLS++/CryptoKey.cpp b/src/mbedTLS++/CryptoKey.cpp
index d9f04e20f..742d9c73c 100644
--- a/src/mbedTLS++/CryptoKey.cpp
+++ b/src/mbedTLS++/CryptoKey.cpp
@@ -124,14 +124,15 @@ int cCryptoKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AStri
if (a_Password.empty())
{
- return mbedtls_pk_parse_key(&m_Pk, reinterpret_cast<const unsigned char *>(keyData.data()), a_NumBytes + 1, nullptr, 0);
+ return mbedtls_pk_parse_key(&m_Pk, reinterpret_cast<const unsigned char *>(keyData.data()), a_NumBytes + 1, nullptr, 0, mbedtls_ctr_drbg_random, m_CtrDrbg.GetInternal());
}
else
{
return mbedtls_pk_parse_key(
&m_Pk,
reinterpret_cast<const unsigned char *>(keyData.data()), a_NumBytes + 1,
- reinterpret_cast<const unsigned char *>(a_Password.c_str()), a_Password.size()
+ reinterpret_cast<const unsigned char *>(a_Password.c_str()), a_Password.size(),
+ mbedtls_ctr_drbg_random, m_CtrDrbg.GetInternal()
);
}
}
@@ -144,7 +145,3 @@ bool cCryptoKey::IsValid(void) const
{
return (mbedtls_pk_get_type(&m_Pk) != MBEDTLS_PK_NONE);
}
-
-
-
-