mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 20:44:14 +02:00
Be a bit more thorough
This commit is contained in:
parent
b56a38ca15
commit
1400c66506
3 changed files with 16 additions and 14 deletions
|
@ -459,6 +459,7 @@ void EntityServer::startDynamicDomainVerification() {
|
|||
<< "static certificate verification.";
|
||||
// Delete the entity if it doesn't pass static certificate verification
|
||||
tree->deleteEntity(i.value(), true);
|
||||
tree->insertRecentlyDeletedEntityIDs(i.value());
|
||||
} else {
|
||||
|
||||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||
|
@ -483,12 +484,14 @@ void EntityServer::startDynamicDomainVerification() {
|
|||
qCDebug(entities) << "Entity's cert's place name" << jsonObject["place_name"].toString()
|
||||
<< "isn't the current place name" << thisPlaceName << "; deleting entity" << i.value();
|
||||
tree->deleteEntity(i.value(), true);
|
||||
tree->insertRecentlyDeletedEntityIDs(i.value());
|
||||
} else {
|
||||
qCDebug(entities) << "Entity passed dynamic domain verification:" << i.value();
|
||||
}
|
||||
} else {
|
||||
qCDebug(entities) << "Call to proof_of_purchase_status endpoint failed; deleting entity" << i.value();
|
||||
tree->deleteEntity(i.value(), true);
|
||||
tree->insertRecentlyDeletedEntityIDs(i.value());
|
||||
}
|
||||
|
||||
networkReply->deleteLater();
|
||||
|
|
|
@ -1139,8 +1139,7 @@ void EntityTree::startChallengeOwnershipTimer(const EntityItemID& entityItemID)
|
|||
connect(_challengeOwnershipTimeoutTimer, &QTimer::timeout, this, [=]() {
|
||||
qCDebug(entities) << "Ownership challenge timed out, deleting entity" << entityItemID;
|
||||
deleteEntity(entityItemID, true);
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), entityItemID);
|
||||
insertRecentlyDeletedEntityIDs(entityItemID);
|
||||
if (_challengeOwnershipTimeoutTimer) {
|
||||
_challengeOwnershipTimeoutTimer->stop();
|
||||
_challengeOwnershipTimeoutTimer->deleteLater();
|
||||
|
@ -1202,8 +1201,7 @@ bool EntityTree::verifyDecryptedNonce(const QString& certID, const QString& decr
|
|||
qCDebug(entities) << "Ownership challenge for Cert ID" << certID << "failed; deleting entity" << id
|
||||
<< "\nActual nonce:" << actualNonce << "\nDecrypted nonce:" << decryptedNonce;
|
||||
deleteEntity(id, true);
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), id);
|
||||
insertRecentlyDeletedEntityIDs(id);
|
||||
}
|
||||
} else {
|
||||
qCDebug(entities) << "Ownership challenge for Cert ID" << certID << "succeeded; keeping entity" << id;
|
||||
|
@ -1237,19 +1235,16 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt
|
|||
if (!jsonObject["invalid_reason"].toString().isEmpty()) {
|
||||
qCDebug(entities) << "invalid_reason not empty, deleting entity" << entityItemID;
|
||||
deleteEntity(entityItemID, true);
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), entityItemID);
|
||||
insertRecentlyDeletedEntityIDs(entityItemID);
|
||||
} else if (jsonObject["transfer_status"].toArray().first().toString() == "failed") {
|
||||
qCDebug(entities) << "'transfer_status' is 'failed', deleting entity" << entityItemID;
|
||||
deleteEntity(entityItemID, true);
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), entityItemID);
|
||||
insertRecentlyDeletedEntityIDs(entityItemID);
|
||||
} else if (jsonObject["transfer_status"].toArray().first().toString() == "pending") {
|
||||
if (isRetryingValidation) {
|
||||
qCDebug(entities) << "'transfer_status' is 'pending' after retry, deleting entity" << entityItemID;
|
||||
deleteEntity(entityItemID, true);
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), entityItemID);
|
||||
insertRecentlyDeletedEntityIDs(entityItemID);
|
||||
} else {
|
||||
if (thread() != QThread::currentThread()) {
|
||||
QMetaObject::invokeMethod(this, "startPendingTransferStatusTimer",
|
||||
|
@ -1269,6 +1264,7 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt
|
|||
if (encryptedText == "") {
|
||||
qCDebug(entities) << "CRITICAL ERROR: Couldn't compute encrypted nonce. Deleting entity...";
|
||||
deleteEntity(entityItemID, true);
|
||||
insertRecentlyDeletedEntityIDs(entityItemID);
|
||||
} else {
|
||||
// 2. Send the encrypted text to the rezzing avatar's node
|
||||
QByteArray certIDByteArray = certID.toUtf8();
|
||||
|
@ -1294,8 +1290,7 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt
|
|||
} else {
|
||||
qCDebug(entities) << "Call to proof_of_purchase_status endpoint failed; deleting entity" << entityItemID;
|
||||
deleteEntity(entityItemID, true);
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), entityItemID);
|
||||
insertRecentlyDeletedEntityIDs(entityItemID);
|
||||
}
|
||||
|
||||
networkReply->deleteLater();
|
||||
|
@ -1521,8 +1516,7 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c
|
|||
<< "static certificate verification.";
|
||||
// Delete the entity we just added if it doesn't pass static certificate verification
|
||||
deleteEntity(entityItemID, true);
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), entityItemID);
|
||||
insertRecentlyDeletedEntityIDs(entityItemID);
|
||||
} else {
|
||||
validatePop(properties.getCertificateID(), entityItemID, senderNode, false);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,11 @@ public:
|
|||
return _recentlyDeletedEntityItemIDs;
|
||||
}
|
||||
|
||||
void insertRecentlyDeletedEntityIDs(const EntityItemID& id) {
|
||||
QWriteLocker locker(&_recentlyDeletedEntitiesLock);
|
||||
_recentlyDeletedEntityItemIDs.insert(usecTimestampNow(), id);
|
||||
}
|
||||
|
||||
QHash<QString, EntityItemID> getEntityCertificateIDMap() const {
|
||||
QReadLocker locker(&_entityCertificateIDMapLock);
|
||||
return _entityCertificateIDMap;
|
||||
|
|
Loading…
Reference in a new issue