From d97551aa3b9358a1a6aa1ecb890fb7200276b9b0 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 20 Oct 2018 17:31:52 +0200 Subject: [PATCH 1/4] added option to not include external IPs in preferences->node->certificate --- .../src/gui/settings/CryptoPage.cpp | 12 +++++-- retroshare-gui/src/gui/settings/CryptoPage.ui | 33 +++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/retroshare-gui/src/gui/settings/CryptoPage.cpp b/retroshare-gui/src/gui/settings/CryptoPage.cpp index 15419369b..1dcb069ac 100755 --- a/retroshare-gui/src/gui/settings/CryptoPage.cpp +++ b/retroshare-gui/src/gui/settings/CryptoPage.cpp @@ -31,6 +31,7 @@ #include "util/misc.h" #include "util/DateTime.h" #include +#include #include #include @@ -47,6 +48,7 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WindowFlags flags) // connect(ui.copykeyButton, SIGNAL(clicked()), this, SLOT(copyPublicKey())); connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(fileSaveAs())); connect(ui._includeSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(load())); + connect(ui._includeAllIPs_CB, SIGNAL(toggled(bool)), this, SLOT(load())); connect(ui._copyLink_PB, SIGNAL(clicked()), this, SLOT(copyRSLink())); connect(ui.showStats_PB, SIGNAL(clicked()), this, SLOT(showStats())); @@ -98,9 +100,13 @@ CryptoPage::load() { ui.certplainTextEdit->setPlainText( QString::fromUtf8( - rsPeers->GetRetroshareInvite( - rsPeers->getOwnId(), - ui._includeSignatures_CB->isChecked() ).c_str() ) ); + rsPeers->GetRetroshareInvite( rsPeers->getOwnId(), ui._includeSignatures_CB->isChecked(), ui._includeAllIPs_CB->isChecked() ).c_str() + ) ); + + RsPeerDetails detail; + rsPeers->getPeerDetails(rsPeers->getOwnId(),detail); + + ui.certplainTextEdit->setToolTip(ConfCertDialog::getCertificateDescription(detail, ui._includeSignatures_CB->isChecked(), ui._includeAllIPs_CB->isChecked() )); } void CryptoPage::copyRSLink() diff --git a/retroshare-gui/src/gui/settings/CryptoPage.ui b/retroshare-gui/src/gui/settings/CryptoPage.ui index 68527ab3d..f96b3935a 100755 --- a/retroshare-gui/src/gui/settings/CryptoPage.ui +++ b/retroshare-gui/src/gui/settings/CryptoPage.ui @@ -6,15 +6,15 @@ 0 0 - 650 - 566 + 989 + 678 - 0 + 1 @@ -426,6 +426,12 @@ + + + 0 + 0 + + Courier New @@ -455,22 +461,15 @@ - - - Qt::Horizontal + + + <html><head/><body><p>IP history is the list of IP you used accross time. Including this might help your friends reach you. This is optional for privacy reasons.</p></body></html> - - - 40 - 20 - + + Include IP history - + - - - - @@ -496,7 +495,7 @@ - + Qt::Horizontal From 259264897e0359f38b9cc248a848f50546a6a0bf Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 20 Oct 2018 17:34:57 +0200 Subject: [PATCH 2/4] changed lobby for "chat rooms" in settings --- retroshare-gui/src/gui/settings/ChatPage.ui | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui index 14d1cc6f8..1d18eb42f 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.ui +++ b/retroshare-gui/src/gui/settings/ChatPage.ui @@ -7,7 +7,7 @@ 0 0 1216 - 1107 + 1127 @@ -231,7 +231,7 @@ - Chat Lobby + Chat Rooms @@ -244,7 +244,7 @@ - Default identity for chat lobbies: + Default identity for chat rooms: @@ -866,11 +866,11 @@ QTabWidget::North - 0 + 2 - Group chat + Chat rooms From 7d21e74b291e1f1b672458e5ca3663dd61ac3034 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 20 Oct 2018 17:48:36 +0200 Subject: [PATCH 3/4] added explicit options to including IP history and removed iP history from RS Links as it leaks information without users consent --- retroshare-gui/src/gui/GetStartedDialog.cpp | 2 +- retroshare-gui/src/gui/RetroShareLink.cpp | 2 +- retroshare-gui/src/gui/common/FriendList.cpp | 2 +- .../src/gui/connect/ConfCertDialog.cpp | 10 ++++++-- .../src/gui/connect/ConfCertDialog.ui | 23 ++++++++++++------- .../src/gui/profile/ProfileWidget.cpp | 2 +- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/retroshare-gui/src/gui/GetStartedDialog.cpp b/retroshare-gui/src/gui/GetStartedDialog.cpp index be6a86fbb..46e718315 100644 --- a/retroshare-gui/src/gui/GetStartedDialog.cpp +++ b/retroshare-gui/src/gui/GetStartedDialog.cpp @@ -236,7 +236,7 @@ void GetStartedDialog::inviteFriends() { RsAutoUpdatePage::lockAllEvents(); - cert = rsPeers->GetRetroshareInvite(); + cert = rsPeers->GetRetroshareInvite(RsPeerId(),false,false); RsAutoUpdatePage::unlockAllEvents() ; } diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index 744826bbb..84d765dfb 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -562,7 +562,7 @@ RetroShareLink RetroShareLink::createCertificate(const RsPeerId& ssl_id) } else { link._type = TYPE_CERTIFICATE; - link._radix = QString::fromUtf8(rsPeers->GetRetroshareInvite(ssl_id,false).c_str()); + link._radix = QString::fromUtf8(rsPeers->GetRetroshareInvite(ssl_id,false,false).c_str()); link._name = QString::fromUtf8(detail.name.c_str()); link._location = QString::fromUtf8(detail.location.c_str()); link._radix.replace("\n",""); diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 640327b7a..3347e2911 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -1903,7 +1903,7 @@ bool FriendList::exportFriendlist(QString &fileName) if (!rsPeers->getPeerDetails(*list_iter, detailSSL)) continue; - std::string certificate = rsPeers->GetRetroshareInvite(detailSSL.id, true); + std::string certificate = rsPeers->GetRetroshareInvite(detailSSL.id, true,true); // remove \n from certificate certificate.erase(std::remove(certificate.begin(), certificate.end(), '\n'), certificate.end()); diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index c6c86a0b1..e302cf02c 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -94,6 +94,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(applyDialog())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(ui._shouldAddSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); + connect(ui._includeIPHistory_CB, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); ui.avatar->setFrameType(AvatarWidget::NORMAL_FRAME); @@ -270,9 +271,14 @@ void ConfCertDialog::loadInvitePage() // ui.userCertificateText_2->setFont(font); // ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str())); - std::string invite = rsPeers->GetRetroshareInvite(detail.id,ui._shouldAddSignatures_CB->isChecked()) ; // this needs to be a SSL id + std::string invite = rsPeers->GetRetroshareInvite(detail.id, + ui._shouldAddSignatures_CB->isChecked(), + ui._includeIPHistory_CB->isChecked() + ) ; - QString infotext = getCertificateDescription(detail,ui._shouldAddSignatures_CB->isChecked(),true); // true, because default parameter in GetRetroshareInvite is true + QString infotext = getCertificateDescription(detail,ui._shouldAddSignatures_CB->isChecked(), + ui._includeIPHistory_CB->isChecked() + ); ui.userCertificateText->setToolTip(infotext) ; diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.ui b/retroshare-gui/src/gui/connect/ConfCertDialog.ui index fec736831..6a7082e17 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.ui +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.ui @@ -7,7 +7,7 @@ 0 0 1104 - 1086 + 1120 @@ -69,7 +69,7 @@ - 0 + 1 @@ -389,6 +389,13 @@ + + + + Include IP history + + + @@ -414,12 +421,6 @@ - - HeaderFrame - QFrame -
gui/common/HeaderFrame.h
- 1 -
RSTextBrowser QTextBrowser @@ -431,6 +432,12 @@
gui/common/AvatarWidget.h
1
+ + HeaderFrame + QFrame +
gui/common/HeaderFrame.h
+ 1 +
diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.cpp b/retroshare-gui/src/gui/profile/ProfileWidget.cpp index 81a86bc69..9151f90d3 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.cpp +++ b/retroshare-gui/src/gui/profile/ProfileWidget.cpp @@ -92,7 +92,7 @@ void ProfileWidget::statusmessagedlg() void ProfileWidget::copyCert() { - std::string cert = rsPeers->GetRetroshareInvite(); + std::string cert = rsPeers->GetRetroshareInvite(RsPeerId(),false,false); if (cert.empty()) { QMessageBox::information(this, tr("RetroShare"), tr("Sorry, create certificate failed"), From d711e09b685e906f4a7e845f4148fdd1c43a988e Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 3 Nov 2018 20:24:24 +0100 Subject: [PATCH 4/4] fixed bug causing IdChooser to reset the current id --- retroshare-gui/src/gui/gxs/GxsIdChooser.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp index e72da2c81..77d2b3621 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp @@ -127,10 +127,13 @@ void GxsIdChooser::setDefaultId(const RsGxsId &defId) static void loadPrivateIdsCallback(GxsIdDetailsType type, const RsIdentityDetails &details, QObject *object, const QVariant &/*data*/) { GxsIdChooser *chooser = dynamic_cast(object); - if (!chooser) { + + if (!chooser) return; - } - + + int current_index = chooser->currentIndex(); + + QString current_id = (current_index >= 0)? chooser->itemData(current_index).toString() : "" ; // this prevents the objects that depend on what's in the combo-box to activate and // perform any change.Only user-changes should cause this. @@ -186,6 +189,16 @@ static void loadPrivateIdsCallback(GxsIdDetailsType type, const RsIdentityDetail chooser->model()->sort(0); + // now restore the current item. Problem is, we cannot use the ID position because it may have changed. + + if(!current_id.isNull()) + for(int indx=0;indxcount();++indx) + if(chooser->itemData(indx).toString() == current_id) + { + chooser->setCurrentIndex(indx); + break; + } + chooser->blockSignals(false) ; }