mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-15 17:59:18 +02:00
Merge pull request #438 from kasenvr/fix/prevent-cert-auto-remove
Disable Certified Entity Auto Deletion
This commit is contained in:
commit
c7bcb03132
1 changed files with 50 additions and 29 deletions
|
@ -1446,14 +1446,17 @@ void EntityTree::addCertifiedEntityOnServer(EntityItemPointer entity) {
|
||||||
entityList << entityItemID; // adds to list within hash because entityList is a reference.
|
entityList << entityItemID; // adds to list within hash because entityList is a reference.
|
||||||
qCDebug(entities) << "Certificate ID" << certID << "belongs to" << entityItemID << "total" << entityList.size() << "entities.";
|
qCDebug(entities) << "Certificate ID" << certID << "belongs to" << entityItemID << "total" << entityList.size() << "entities.";
|
||||||
}
|
}
|
||||||
// Delete an already-existing entity from the tree if it has the same
|
// Handle an already-existing entity from the tree if it has the same
|
||||||
// CertificateID as the entity we're trying to add.
|
// CertificateID as the entity we're trying to add.
|
||||||
if (!existingEntityItemID.isNull()) {
|
if (!existingEntityItemID.isNull()) {
|
||||||
qCDebug(entities) << "Certificate ID" << certID << "already exists on entity with ID"
|
qCDebug(entities) << "Certificate ID" << certID << "already exists on entity with ID"
|
||||||
<< existingEntityItemID << ". Deleting existing entity.";
|
<< existingEntityItemID << ". No action will be taken to remove it.";
|
||||||
withWriteLock([&] {
|
// FIXME: All certificate checking needs to be moved to its own files,
|
||||||
deleteEntity(existingEntityItemID, true);
|
// then the deletion settings need to have a toggle for domain owners
|
||||||
});
|
// and a setting to change the verification service provider.
|
||||||
|
// withWriteLock([&] {
|
||||||
|
// deleteEntity(existingEntityItemID, true);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1527,10 +1530,13 @@ void EntityTree::startDynamicDomainVerificationOnServer(float minimumAgeToRemove
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
qCDebug(entities) << "Entity's cert's domain ID" << jsonObject["domain_id"].toString()
|
qCDebug(entities) << "Entity's cert's domain ID" << jsonObject["domain_id"].toString()
|
||||||
<< "doesn't match the current Domain ID" << thisDomainID << "; deleting entity" << entityID;
|
<< "doesn't match the current Domain ID" << thisDomainID << ". No action will be taken to remove it: " << entityID;
|
||||||
withWriteLock([&] {
|
// FIXME: All certificate checking needs to be moved to its own files,
|
||||||
deleteEntity(entityID, true);
|
// then the deletion settings need to have a toggle for domain owners
|
||||||
});
|
// and a setting to change the verification service provider.
|
||||||
|
// withWriteLock([&] {
|
||||||
|
// deleteEntity(entityID, true);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
QWriteLocker entityCertificateIDMapLocker(&_entityCertificateIDMapLock);
|
QWriteLocker entityCertificateIDMapLocker(&_entityCertificateIDMapLock);
|
||||||
|
@ -1555,10 +1561,13 @@ void EntityTree::startChallengeOwnershipTimer(const EntityItemID& entityItemID)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(_challengeOwnershipTimeoutTimer, &QTimer::timeout, this, [=]() {
|
connect(_challengeOwnershipTimeoutTimer, &QTimer::timeout, this, [=]() {
|
||||||
qCDebug(entities) << "Ownership challenge timed out, deleting entity" << entityItemID;
|
qCDebug(entities) << "Ownership challenge timed out for entity " << entityItemID << ". No action will be taken to remove it.";
|
||||||
withWriteLock([&] {
|
// FIXME: All certificate checking needs to be moved to its own files,
|
||||||
deleteEntity(entityItemID, true);
|
// then the deletion settings need to have a toggle for domain owners
|
||||||
});
|
// and a setting to change the verification service provider.
|
||||||
|
// withWriteLock([&] {
|
||||||
|
// deleteEntity(entityItemID, true);
|
||||||
|
// });
|
||||||
if (_challengeOwnershipTimeoutTimer) {
|
if (_challengeOwnershipTimeoutTimer) {
|
||||||
_challengeOwnershipTimeoutTimer->stop();
|
_challengeOwnershipTimeoutTimer->stop();
|
||||||
_challengeOwnershipTimeoutTimer->deleteLater();
|
_challengeOwnershipTimeoutTimer->deleteLater();
|
||||||
|
@ -1650,10 +1659,13 @@ void EntityTree::sendChallengeOwnershipPacket(const QString& certID, const QStri
|
||||||
QByteArray text = computeNonce(entityItemID, ownerKey);
|
QByteArray text = computeNonce(entityItemID, ownerKey);
|
||||||
|
|
||||||
if (text == "") {
|
if (text == "") {
|
||||||
qCDebug(entities) << "CRITICAL ERROR: Couldn't compute nonce. Deleting entity...";
|
qCDebug(entities) << "CRITICAL ERROR: Couldn't compute nonce. No action will be taken to remove this entity.";
|
||||||
withWriteLock([&] {
|
// FIXME: All certificate checking needs to be moved to its own files,
|
||||||
deleteEntity(entityItemID, true);
|
// then the deletion settings need to have a toggle for domain owners
|
||||||
});
|
// and a setting to change the verification service provider.
|
||||||
|
// withWriteLock([&] {
|
||||||
|
// deleteEntity(entityItemID, true);
|
||||||
|
// });
|
||||||
} else {
|
} else {
|
||||||
qCDebug(entities) << "Challenging ownership of Cert ID" << certID;
|
qCDebug(entities) << "Challenging ownership of Cert ID" << certID;
|
||||||
// 2. Send the nonce to the rezzing avatar's node
|
// 2. Send the nonce to the rezzing avatar's node
|
||||||
|
@ -1724,15 +1736,21 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt
|
||||||
|
|
||||||
if (networkReply->error() == QNetworkReply::NoError) {
|
if (networkReply->error() == QNetworkReply::NoError) {
|
||||||
if (!jsonObject["invalid_reason"].toString().isEmpty()) {
|
if (!jsonObject["invalid_reason"].toString().isEmpty()) {
|
||||||
qCDebug(entities) << "invalid_reason not empty, deleting entity" << entityItemID;
|
qCDebug(entities) << "invalid_reason not empty, no action will be taken to delete entity" << entityItemID;
|
||||||
withWriteLock([&] {
|
// FIXME: All certificate checking needs to be moved to its own files,
|
||||||
deleteEntity(entityItemID, true);
|
// then the deletion settings need to have a toggle for domain owners
|
||||||
});
|
// and a setting to change the verification service provider.
|
||||||
|
// withWriteLock([&] {
|
||||||
|
// deleteEntity(entityItemID, true);
|
||||||
|
// });
|
||||||
} else if (jsonObject["transfer_status"].toArray().first().toString() == "failed") {
|
} else if (jsonObject["transfer_status"].toArray().first().toString() == "failed") {
|
||||||
qCDebug(entities) << "'transfer_status' is 'failed', deleting entity" << entityItemID;
|
qCDebug(entities) << "'transfer_status' is 'failed', no action will be taken to delete entity" << entityItemID;
|
||||||
withWriteLock([&] {
|
// FIXME: All certificate checking needs to be moved to its own files,
|
||||||
deleteEntity(entityItemID, true);
|
// then the deletion settings need to have a toggle for domain owners
|
||||||
});
|
// and a setting to change the verification service provider.
|
||||||
|
// withWriteLock([&] {
|
||||||
|
// deleteEntity(entityItemID, true);
|
||||||
|
// });
|
||||||
} else {
|
} else {
|
||||||
// Second, challenge ownership of the PoP cert
|
// Second, challenge ownership of the PoP cert
|
||||||
// (ignore pending status; a failure will be cleaned up during DDV)
|
// (ignore pending status; a failure will be cleaned up during DDV)
|
||||||
|
@ -1742,11 +1760,14 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt
|
||||||
senderNode);
|
senderNode);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCDebug(entities) << "Call to" << networkReply->url() << "failed with error" << networkReply->error() << "; deleting entity" << entityItemID
|
qCDebug(entities) << "Call to" << networkReply->url() << "failed with error" << networkReply->error() << "; no action will be taken to delete entity" << entityItemID
|
||||||
<< "More info:" << jsonObject;
|
<< "More info:" << jsonObject;
|
||||||
withWriteLock([&] {
|
// FIXME: All certificate checking needs to be moved to its own files,
|
||||||
deleteEntity(entityItemID, true);
|
// then the deletion settings need to have a toggle for domain owners
|
||||||
});
|
// and a setting to change the verification service provider.
|
||||||
|
// withWriteLock([&] {
|
||||||
|
// deleteEntity(entityItemID, true);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
networkReply->deleteLater();
|
networkReply->deleteLater();
|
||||||
|
|
Loading…
Reference in a new issue