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:
parent
174cf3d3ce
commit
c2349bacd7
2 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue