1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Ask user to fallback to tox1 if needed

With a warning, tox1 is insecure

Fixes #907

Fixes #886
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2015-01-04 21:02:24 +01:00
parent 9991c38342
commit c3505d0939
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 13 additions and 0 deletions

View File

@ -219,6 +219,11 @@ fallbackOnTox1:
tox_dns3_kill(tox_dns3); tox_dns3_kill(tox_dns3);
#if TOX1_SILENT_FALLBACK #if TOX1_SILENT_FALLBACK
toxIdStr = queryTox1(record, silent); toxIdStr = queryTox1(record, silent);
#elif TOX1_ASK_FALLBACK
QMessageBox::StandardButton btn = QMessageBox::warning(nullptr, "qTox", tr("qTox needs to use the old tox1 protocol.\n\
But tox1 is insecure and doesn't protect metadata. Should we use it anyway ?"), QMessageBox::Ok|QMessageBox::No, QMessageBox::No);
if (btn == QMessageBox::Ok)
queryTox1(record, silent);
#endif #endif
return toxIdStr; return toxIdStr;
} }
@ -258,6 +263,11 @@ ToxID ToxDNS::resolveToxAddress(const QString &address, bool silent)
{ {
#if TOX1_SILENT_FALLBACK #if TOX1_SILENT_FALLBACK
toxId = ToxID::fromString(queryTox1(address, silent)); toxId = ToxID::fromString(queryTox1(address, silent));
#elif TOX1_ASK_FALLBACK
QMessageBox::StandardButton btn = QMessageBox::warning(nullptr, "qTox", tr("qTox needs to use the old tox1 protocol.\n\
But tox1 is insecure and doesn't protect metadata. Should we use it anyway ?"), QMessageBox::Ok|QMessageBox::No, QMessageBox::No);
if (btn == QMessageBox::Ok)
toxId = ToxID::fromString(queryTox1(address, silent));
#else #else
return toxId; return toxId;
#endif #endif

View File

@ -25,6 +25,9 @@
/// Tox1 is not encrypted, it's unsafe /// Tox1 is not encrypted, it's unsafe
#define TOX1_SILENT_FALLBACK 0 #define TOX1_SILENT_FALLBACK 0
/// That said if the user insists ...
#define TOX1_ASK_FALLBACK 1
/// Handles tox1 and tox3 DNS queries /// Handles tox1 and tox3 DNS queries
class ToxDNS : public QObject class ToxDNS : public QObject
{ {