diff --git a/core/device.cpp b/core/device.cpp index e4d584e95..3c60952a5 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -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 diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp index d521b4a96..3d434f925 100644 --- a/core/networkpackage.cpp +++ b/core/networkpackage.cpp @@ -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()) {