mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 07:36:36 +02:00
Add RSA error handling
This commit is contained in:
parent
e9c144892a
commit
d49e281fab
1 changed files with 6 additions and 0 deletions
|
@ -740,6 +740,7 @@ void Wallet::handleChallengeOwnershipPacket(QSharedPointer<ReceivedMessage> pack
|
||||||
RSA* rsa = readKeys(keyFilePath().toStdString().c_str());
|
RSA* rsa = readKeys(keyFilePath().toStdString().c_str());
|
||||||
|
|
||||||
if (rsa) {
|
if (rsa) {
|
||||||
|
ERR_clear_error();
|
||||||
const int decryptionStatus = RSA_private_decrypt(encryptedTextByteArraySize,
|
const int decryptionStatus = RSA_private_decrypt(encryptedTextByteArraySize,
|
||||||
reinterpret_cast<const unsigned char*>(encryptedText.constData()),
|
reinterpret_cast<const unsigned char*>(encryptedText.constData()),
|
||||||
decryptedText,
|
decryptedText,
|
||||||
|
@ -784,6 +785,11 @@ void Wallet::handleChallengeOwnershipPacket(QSharedPointer<ReceivedMessage> pack
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCDebug(commerce) << "During entity ownership challenge, decrypting the encrypted text failed.";
|
qCDebug(commerce) << "During entity ownership challenge, decrypting the encrypted text failed.";
|
||||||
|
long error = ERR_get_error();
|
||||||
|
if (error != 0) {
|
||||||
|
const char* error_str = ERR_error_string(error, NULL);
|
||||||
|
qCWarning(entities) << "RSA error:" << error_str;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCDebug(commerce) << "During entity ownership challenge, creating the RSA object failed.";
|
qCDebug(commerce) << "During entity ownership challenge, creating the RSA object failed.";
|
||||||
|
|
Loading…
Reference in a new issue