diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/PolarSSL++/RsaPrivateKey.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/PolarSSL++/RsaPrivateKey.cpp b/src/PolarSSL++/RsaPrivateKey.cpp index d042139cf..2d5a2a4b1 100644 --- a/src/PolarSSL++/RsaPrivateKey.cpp +++ b/src/PolarSSL++/RsaPrivateKey.cpp @@ -14,6 +14,7 @@ cRsaPrivateKey::cRsaPrivateKey(void) { rsa_init(&m_Rsa, RSA_PKCS_V15, 0); + m_CtrDrbg.Initialize("RSA", 3); } @@ -24,6 +25,7 @@ cRsaPrivateKey::cRsaPrivateKey(const cRsaPrivateKey & a_Other) { rsa_init(&m_Rsa, RSA_PKCS_V15, 0); rsa_copy(&m_Rsa, &a_Other.m_Rsa); + m_CtrDrbg.Initialize("RSA", 3); } @@ -41,9 +43,10 @@ cRsaPrivateKey::~cRsaPrivateKey() bool cRsaPrivateKey::Generate(unsigned a_KeySizeBits) { - if (rsa_gen_key(&m_Rsa, ctr_drbg_random, m_CtrDrbg.GetInternal(), a_KeySizeBits, 65537) != 0) + int res = rsa_gen_key(&m_Rsa, ctr_drbg_random, m_CtrDrbg.GetInternal(), a_KeySizeBits, 65537); + if (res != 0) { - // Key generation failed + LOG("RSA key generation failed: -0x%x", -res); return false; } |