Make sure we don't eat all system memory

I had wrong configuration files, the encription algorithm definitely
doesn't take it into account.
This commit is contained in:
Aleix Pol 2016-05-05 17:45:49 +02:00
parent 174cf3d3ce
commit c2349bacd7
2 changed files with 2 additions and 0 deletions

View file

@ -57,6 +57,7 @@ Device::Device(QObject* parent, const QString& id)
m_deviceName = info.deviceName;
m_deviceType = str2type(info.deviceType);
m_publicKey = QCA::RSAPublicKey::fromPEM(info.publicKey);
Q_ASSERT(m_publicKey.maximumEncryptSize(NetworkPackage::EncryptionAlgorithm)>0);
m_pairingTimeut.setSingleShot(true);
m_pairingTimeut.setInterval(30 * 1000); //30 seconds of timeout

View file

@ -166,6 +166,7 @@ void NetworkPackage::encrypt(QCA::PublicKey& key)
QByteArray serialized = serialize();
int chunkSize = key.maximumEncryptSize(NetworkPackage::EncryptionAlgorithm);
Q_ASSERT(chunkSize>0);
QStringList chunks;
while (!serialized.isEmpty()) {