1
0

Fixed a slight bug in RSA encryption code.

This commit is contained in:
madmaxoft 2014-01-28 09:50:48 +01:00
parent 5f9228bac8
commit 81837edb22

View File

@ -214,7 +214,6 @@ int cRSAPrivateKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte
ASSERT(!"Invalid a_PlainLength!"); ASSERT(!"Invalid a_PlainLength!");
return -1; return -1;
} }
size_t DecryptedLength;
int res = rsa_pkcs1_encrypt( int res = rsa_pkcs1_encrypt(
&m_Rsa, ctr_drbg_random, &m_Ctr_drbg, RSA_PUBLIC, &m_Rsa, ctr_drbg_random, &m_Ctr_drbg, RSA_PUBLIC,
a_PlainLength, a_PlainData, a_EncryptedData a_PlainLength, a_PlainData, a_EncryptedData
@ -223,7 +222,7 @@ int cRSAPrivateKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte
{ {
return -1; return -1;
} }
return (int)DecryptedLength; return (int)m_Rsa.len;
} }