summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-28 23:15:04 +0100
committermadmaxoft <github@xoft.cz>2014-01-28 23:53:53 +0100
commitf7cbb07b54e3cafdef7578693ea5340fcaf9ac3d (patch)
treed4c5d81e1b6e59558874984b668ddf32e452186f /src
parentMerge pull request #594 from mc-server/Villager_Update (diff)
downloadcuberite-f7cbb07b54e3cafdef7578693ea5340fcaf9ac3d.tar
cuberite-f7cbb07b54e3cafdef7578693ea5340fcaf9ac3d.tar.gz
cuberite-f7cbb07b54e3cafdef7578693ea5340fcaf9ac3d.tar.bz2
cuberite-f7cbb07b54e3cafdef7578693ea5340fcaf9ac3d.tar.lz
cuberite-f7cbb07b54e3cafdef7578693ea5340fcaf9ac3d.tar.xz
cuberite-f7cbb07b54e3cafdef7578693ea5340fcaf9ac3d.tar.zst
cuberite-f7cbb07b54e3cafdef7578693ea5340fcaf9ac3d.zip
Diffstat (limited to '')
-rw-r--r--src/Crypto.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Crypto.cpp b/src/Crypto.cpp
index 540b5cfde..6f7047ab0 100644
--- a/src/Crypto.cpp
+++ b/src/Crypto.cpp
@@ -206,7 +206,7 @@ int cRSAPrivateKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte
ASSERT(!"Invalid a_DecryptedMaxLength!");
return -1;
}
- if (a_PlainLength < m_Rsa.len)
+ if (a_EncryptedMaxLength < m_Rsa.len)
{
LOGD("%s: Invalid a_PlainLength: got %u, exp at least %u",
__FUNCTION__, (unsigned)a_PlainLength, (unsigned)(m_Rsa.len)
@@ -215,7 +215,7 @@ int cRSAPrivateKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte
return -1;
}
int res = rsa_pkcs1_encrypt(
- &m_Rsa, ctr_drbg_random, &m_Ctr_drbg, RSA_PUBLIC,
+ &m_Rsa, ctr_drbg_random, &m_Ctr_drbg, RSA_PRIVATE,
a_PlainLength, a_PlainData, a_EncryptedData
);
if (res != 0)