From 892acd8ef8c787dff2a71d13c74f9b4f561216a5 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 27 Sep 2019 20:21:40 +0200 Subject: [PATCH 01/10] Home View changes for Retroshare ID Added Label for Retroshare ID (short invites) Show Optional the certificate with the Cert Button --- retroshare-gui/src/gui/HomePage.cpp | 72 ++- retroshare-gui/src/gui/HomePage.h | 3 + retroshare-gui/src/gui/HomePage.ui | 409 ++++++++++-------- .../src/gui/connect/ConnectFriendWizard.ui | 18 +- retroshare-gui/src/gui/icons.qrc | 1 + retroshare-gui/src/gui/icons/png/cert.png | Bin 0 -> 6924 bytes .../src/gui/qss/stylesheet/Standard.qss | 5 +- 7 files changed, 302 insertions(+), 206 deletions(-) create mode 100644 retroshare-gui/src/gui/icons/png/cert.png diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp index 385e6c075..eff1b395d 100644 --- a/retroshare-gui/src/gui/HomePage.cpp +++ b/retroshare-gui/src/gui/HomePage.cpp @@ -49,14 +49,15 @@ HomePage::HomePage(QWidget *parent) : MainPage(parent), ui(new Ui::HomePage), mIncludeAllIPs(false), - mUseShortFormat(true) + mUseShortFormat(false) { ui->setupUi(this); updateOwnCert(); + updateOwnId(); connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addFriend())); - //connect(ui->LoadCertFileButton, SIGNAL(clicked()), this, SLOT(loadCert())); + connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(doExpand())); QAction *WebMailAction = new QAction(QIcon(),tr("Invite via WebMail"), this); connect(WebMailAction, SIGNAL(triggered()), this, SLOT(webMail())); @@ -66,9 +67,24 @@ HomePage::HomePage(QWidget *parent) : QAction *SendAction = new QAction(QIcon(),tr("Send via Email"), this); connect(SendAction, SIGNAL(triggered()), this, SLOT(runEmailClient())); + + QAction *CopyIdAction = new QAction(QIcon(),tr("Copy your Retroshare ID to Clipboard"), this); + connect(CopyIdAction, SIGNAL(triggered()), this, SLOT(copyId())); QMenu *menu = new QMenu(); - menu->addAction(SendAction); + menu->addAction(CopyIdAction); + + if(!RsAccounts::isHiddenNode()) + { + QAction *includeIPsAct = new QAction(QIcon(), tr("Include all your known IPs"),this); + connect(includeIPsAct, SIGNAL(triggered()), this, SLOT(toggleIncludeAllIPs())); + includeIPsAct->setCheckable(true); + includeIPsAct->setChecked(mIncludeAllIPs); + + menu->addAction(includeIPsAct); + } + menu->addSeparator(); + menu->addAction(SendAction); menu->addAction(WebMailAction); menu->addAction(RecAction); @@ -78,7 +94,7 @@ HomePage::HomePage(QWidget *parent) : connect(ui->openwebhelp,SIGNAL(clicked()), this,SLOT(openWebHelp())) ; - //ui->LoadCertFileButton->hide(); // duplicates functionality => not good. + ui->userCertEdit->hide(); int S = QFontMetricsF(font()).height(); QString help_str = tr( @@ -137,6 +153,7 @@ void HomePage::toggleIncludeAllIPs() { mIncludeAllIPs = !mIncludeAllIPs; updateOwnCert(); + updateOwnId(); } HomePage::~HomePage() @@ -170,6 +187,28 @@ void HomePage::updateOwnCert() ui->userCertEdit->setToolTip(description); } +void HomePage::updateOwnId() +{ + bool include_extra_locators = mIncludeAllIPs; + + RsPeerDetails detail; + + if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) + { + std::cerr << "(EE) Cannot retrieve information about own certificate. That is a real problem!!" << std::endl; + return ; + } + + std::string invite ; + + rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,!mIncludeAllIPs); + + ui->retroshareid->setText(QString::fromUtf8(invite.c_str())); + + QString description = ConfCertDialog::getCertificateDescription(detail,false,mUseShortFormat,include_extra_locators); + + ui->retroshareid->setToolTip(description); +} static void sendMail(QString sAddress, QString sSubject, QString sBody) { #ifdef Q_OS_WIN @@ -212,7 +251,14 @@ void HomePage::copyCert() { QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(ui->userCertEdit->toPlainText()); - QMessageBox::information(this, "RetroShare", tr("Your Cert is copied to Clipboard, paste and send it to your friend via email or some other way")); + QMessageBox::information(this, "RetroShare", tr("Your Retroshare certificate is copied to Clipboard, paste and send it to your friend via email or some other way")); +} + +void HomePage::copyId() +{ + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(ui->retroshareid->text()); + QMessageBox::information(this, "RetroShare", tr("Your Retroshare ID is copied to Clipboard, paste and send it to your friend via email or some other way")); } void HomePage::saveCert() @@ -261,3 +307,19 @@ void HomePage::openWebHelp() { QDesktopServices::openUrl(QUrl(QString("https://retroshare.readthedocs.io"))); } + +void HomePage::doExpand() +{ + + if (ui->expandButton->isChecked()) + { + ui->userCertEdit->show(); + ui->expandButton->setToolTip(tr("Hide")); + } + else + { + ui->userCertEdit->hide(); + ui->expandButton->setToolTip(tr("Show Certificate")); + } + +} diff --git a/retroshare-gui/src/gui/HomePage.h b/retroshare-gui/src/gui/HomePage.h index 58a7c65b9..8345d0715 100644 --- a/retroshare-gui/src/gui/HomePage.h +++ b/retroshare-gui/src/gui/HomePage.h @@ -49,8 +49,10 @@ public: private slots: void certContextMenu(QPoint); void updateOwnCert(); + void updateOwnId(); void runEmailClient(); void copyCert(); + void copyId(); void saveCert(); void addFriend(); void webMail(); @@ -59,6 +61,7 @@ private slots: void recommendFriends(); void toggleIncludeAllIPs(); void toggleUseShortFormat(); + void doExpand(); private: Ui::HomePage *ui; diff --git a/retroshare-gui/src/gui/HomePage.ui b/retroshare-gui/src/gui/HomePage.ui index fea881a6f..c29bbeeff 100644 --- a/retroshare-gui/src/gui/HomePage.ui +++ b/retroshare-gui/src/gui/HomePage.ui @@ -6,14 +6,121 @@ 0 0 - 1334 - 867 + 800 + 600 Form + + + + + + + + + + + 11 + + + + + + + Did you receive a Retroshare id from a friend? + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add friend + + + + :/icons/png/invite.png:/icons/png/invite.png + + + + 24 + 24 + + + + Qt::ToolButtonTextBesideIcon + + + false + + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 11 + + + + Do you need help with Retroshare? + + + + + + + Open Web Help + + + + :/icons/settings/webinterface.svg:/icons/settings/webinterface.svg + + + + 24 + 24 + + + + Qt::ToolButtonTextBesideIcon + + + + + + @@ -33,7 +140,24 @@ - + + + + + 12 + + + + Open Source cross-platform, +private and secure decentralized communication platform. + + + + Qt::AlignCenter + + + + 9 @@ -44,27 +168,6 @@ 2 - - - - - 0 - 0 - - - - - 11 - - - - The text below is your own Retroshare certificate. Send it to your friends - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - @@ -77,10 +180,71 @@ true + + true + - + + + + + 0 + 0 + + + + Qt::NoFocus + + + <html><head/><body><p>Share your RetroShare ID</p></body></html> + + + + :/icons/svg/share.svg:/icons/svg/share.svg + + + + 24 + 24 + + + + QToolButton::InstantPopup + + + true + + + + + + + + 10 + 75 + true + + + + Qt::DefaultContextMenu + + + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + 0 + 0 + + Courier New @@ -109,23 +273,35 @@ - - + + - + 0 0 - - Qt::NoFocus + + + 11 + - - Share your RetroShare Key + + This is your Retroshare ID. Copy and share with your friends! + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + ... - :/icons/svg/share.svg:/icons/svg/share.svg + :/icons/png/cert.png:/icons/png/cert.png @@ -133,8 +309,8 @@ 24 - - QToolButton::InstantPopup + + true true @@ -143,165 +319,20 @@ - - - - - 12 - - - - Open Source cross-platform, -private and secure decentralized communication platform. - - - - Qt::AlignCenter - - - - - - + + + Qt::Vertical - - QFrame::StyledPanel + + + 20 + 40 + - - QFrame::Raised - - - - - - - 11 - - - - Do you need help with RetroShare? - - - - - - - Open Web Help - - - - :/icons/settings/webinterface.svg:/icons/settings/webinterface.svg - - - - 24 - 24 - - - - Qt::ToolButtonTextBesideIcon - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - 11 - - - - - - - Did you receive a certificate from a friend? - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Add friends certificate - - - - :/icons/png/invite.png:/icons/png/invite.png - - - - 24 - 24 - - - - Qt::ToolButtonTextBesideIcon - - - false - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - + - label - addFrame - label_2 - addframe - frame - helpframe diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui index 8aadc22db..1c097627e 100644 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui @@ -6,8 +6,8 @@ 0 0 - 1139 - 1171 + 600 + 500 @@ -19,10 +19,10 @@ - RetroShare certificate + RetroShare ID - Please paste below your friend's Retroshare certificate + Please paste below your friend's Retroshare ID ConnectFriendWizard::Page_Text @@ -207,7 +207,7 @@ - The text below is your Retroshare certificate. You have to provide it to your friend + The text below is your Retroshare ID. You have to provide it to your friend @@ -229,10 +229,10 @@ Qt::NoFocus - Paste Cert of your friend from Clipboard + Paste ID of your friend from Clipboard - Paste certificate + Paste @@ -267,7 +267,7 @@ Open Cert of your friend from File - Open certificate + Open @@ -314,7 +314,7 @@ QPlainTextEdit::NoWrap - Please, paste your friend's Retroshare certificate into the box below + Please, paste your friend's Retroshare ID into the box below diff --git a/retroshare-gui/src/gui/icons.qrc b/retroshare-gui/src/gui/icons.qrc index a1bdb46a5..d510544a8 100644 --- a/retroshare-gui/src/gui/icons.qrc +++ b/retroshare-gui/src/gui/icons.qrc @@ -71,6 +71,7 @@ icons/png/add.png icons/png/attach-image.png icons/png/attach.png + icons/png/cert.png icons/png/channels-notify.png icons/png/channels.png icons/png/chat-bubble-notify.png diff --git a/retroshare-gui/src/gui/icons/png/cert.png b/retroshare-gui/src/gui/icons/png/cert.png new file mode 100644 index 0000000000000000000000000000000000000000..39c9cb6bb54b2975a333bb670f6ed98a41677b80 GIT binary patch literal 6924 zcmV+n8}sCeP)>C=H8im?*u=8B{O&K`OVzlz2}_Y`Tl-K@NMVWZGF97&mbxEOevKN3C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ML z@RFv9|K_JT#nCpVgWlr+9W0cJI=JvEq<9cGKicNlK%;=?142B(oE*nf?yb`M9H0~4 z{GI3M=<|RZaCvh}8~8#>u|ikm3g+bYuHB+K(W@Qc1Wy+xsb2mag&9aLrx$H*(SUc_BujkZofX*!0o2sgQ_lgq@|U7f zsv;*NCC9qRkVv!-vPR^@BVzfjK z6N1x$EClI7k}e?~@B;BbM>1ZAUcEs=wSX!lM+EGbf)XLb-T-n(Z|=*(<^KUjW`oH; Sk2xd&0000 Date: Fri, 27 Sep 2019 14:15:55 +0200 Subject: [PATCH 02/10] Allow friend information update from short invite Add comments explaining security of addSslOnlyFriend --- libretroshare/src/pqi/p3peermgr.cc | 104 +++++++++++++++++++---------- 1 file changed, 69 insertions(+), 35 deletions(-) diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 1adf191d1..01f245a25 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -1071,45 +1071,81 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg } -bool p3PeerMgrIMPL::addSslOnlyFriend( const RsPeerId& sslId, const RsPgpId& pgp_id,const RsPeerDetails& dt ) +bool p3PeerMgrIMPL::addSslOnlyFriend( + const RsPeerId& sslId, const RsPgpId& pgp_id, const RsPeerDetails& dt ) { - if(sslId.isNull() || sslId == getOwnId()) - { - RsErr() <<"Attempt to add yourself or a null ID as SSL-only friend (id=" << sslId << ")" << std::endl; - return false; - } - - peerState pstate; - -// { -// RS_STACK_MUTEX(mPeerMtx); -// -// /* If in mOthersList -> move over */ -// auto it = mOthersList.find(sslId); -// if (it != mOthersList.end()) -// { -// pstate = it->second; -// mOthersList.erase(it); -// } -// -// -// } // RS_STACK_MUTEX(mPeerMtx); - - if(!pstate.gpg_id.isNull() && AuthGPG::getAuthGPG()->isGPGAccepted(pstate.gpg_id)) + if(sslId.isNull()) { - RsErr() << "Trying to add as SSL-only friend a peer which PGP id is already a friend. This means the code is inconsistent. Not doing this!" << std::endl; + RsErr() << __PRETTY_FUNCTION__ << " Cannot add a null " + << "ID as SSL-only friend " << std::endl; return false; } - if(pgp_id.isNull()) - { - RsErr() << "Null pgp id for friend added with skip_pgp_signature_validaiton flag. This is not allowed." << std::endl; - return false; - } + if(pgp_id.isNull()) + { + RsErr() << __PRETTY_FUNCTION__ << " Cannot add as SSL-only friend a " + << "peer with null PGP" << std::endl; + return false; + } + + if(sslId == getOwnId()) + { + RsErr() << __PRETTY_FUNCTION__ << " Cannot add yourself as SSL-only " + << "friend (id=" << sslId << ")" << std::endl; + return false; + } + + bool alreadySslFriend = false; + peerState pstate; + + { RS_STACK_MUTEX(mPeerMtx); + auto it = mFriendList.find(sslId); + if( it != mFriendList.end() ) + { + alreadySslFriend = true; + + /* If it is already friend override pstate so we don't loose already + * known information about the peer, in particular overriding + * pstate.skip_pgp_signature_validation is important for security. + */ + pstate = it->second; + } + } // RS_STACK_MUTEX(mPeerMtx); + + /* If it is already friend check if PGP id of the invite matches with the + * PGP id we already know, to avoid nasty tricks with malevolently forged + * short invites.*/ + if(alreadySslFriend && pstate.gpg_id != pgp_id) + { + RsErr() << __PRETTY_FUNCTION__ << " Cannot SSL-only friend for " + << "a pre-existing friend with mismatching PGP-id " + << "known: " << pstate.gpg_id << " new: " << pgp_id + << std::endl; + return false; + } + + /* It is very important to be expecially carefull setting + * pstate.skip_pgp_signature_validation to true because this effectively + * disables PGP signature verification on connection attempt. + * This check in particular avoid someone attempting to trick the user into + * accepting as SSL-only friend a malevolently forged short invite, with the + * PGP id of an already known friend but the SSL-id of a location generated + * by the attacker which doesn't have access to the legitimate PGP + * certificate. + * In that case being pstate.skip_pgp_signature_validation false on + * connection attempt the PGP signaure verification would fail and the + * connection closed. + * Instead if pstate.skip_pgp_signature_validation would have been + * superficially set to true the PGP signature verification would have been + * skipped and the attacker connection would be accepted. */ + if(!AuthGPG::getAuthGPG()->isGPGAccepted(pgp_id)) + pstate.skip_pgp_signature_validation = true; pstate.gpg_id = pgp_id; pstate.id = sslId; + /* At this point if we got info about the peer just update with the new + * values. */ if(!dt.name.empty()) pstate.name = dt.name; if(!dt.dyndns.empty()) pstate.dyndns = dt.dyndns; pstate.hiddenNode = dt.isHiddenNode; @@ -1119,19 +1155,17 @@ bool p3PeerMgrIMPL::addSslOnlyFriend( const RsPeerId& sslId, const RsPgpId& pgp_ if(dt.hiddenType) pstate.hiddenType = dt.hiddenType; if(!dt.location.empty()) pstate.location = dt.location; - pstate.skip_pgp_signature_validation = true; - { RS_STACK_MUTEX(mPeerMtx); - mFriendList[sslId] = pstate; mStatusChanged = true; - } // RS_STACK_MUTEX(mPeerMtx); IndicateConfigChanged(); mLinkMgr->addFriend(sslId, dt.vs_dht != RS_VS_DHT_OFF); - // To update IP addresses is much more confortable to use locators + /* To update IP addresses is much more confortable to use locators, beside + * of the easy to use another benefit is that this way we don't loose + * previously known IP addresses */ if(!dt.isHiddenNode) { for(const std::string& locator : dt.ipAddressList) From 7a48fee0bc3bd71e183d315b80134d154996b697 Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 28 Sep 2019 12:18:46 +0200 Subject: [PATCH 03/10] Added tooltip for Show Cert Button "Show full certificate (old format)" * Added tooltip for Show Cert Button "Show full certificate (old format)" * removed the tooltip for Retroshare ID --- retroshare-gui/src/gui/HomePage.cpp | 6 +----- retroshare-gui/src/gui/HomePage.ui | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp index eff1b395d..0cfacb041 100644 --- a/retroshare-gui/src/gui/HomePage.cpp +++ b/retroshare-gui/src/gui/HomePage.cpp @@ -204,10 +204,6 @@ void HomePage::updateOwnId() rsPeers->getShortInvite(invite,rsPeers->getOwnId(),true,!mIncludeAllIPs); ui->retroshareid->setText(QString::fromUtf8(invite.c_str())); - - QString description = ConfCertDialog::getCertificateDescription(detail,false,mUseShortFormat,include_extra_locators); - - ui->retroshareid->setToolTip(description); } static void sendMail(QString sAddress, QString sSubject, QString sBody) { @@ -319,7 +315,7 @@ void HomePage::doExpand() else { ui->userCertEdit->hide(); - ui->expandButton->setToolTip(tr("Show Certificate")); + ui->expandButton->setToolTip(tr("Show full certificate (old format)")); } } diff --git a/retroshare-gui/src/gui/HomePage.ui b/retroshare-gui/src/gui/HomePage.ui index c29bbeeff..3e303b4e9 100644 --- a/retroshare-gui/src/gui/HomePage.ui +++ b/retroshare-gui/src/gui/HomePage.ui @@ -296,6 +296,9 @@ private and secure decentralized communication platform. + + Show full certificate (old format) + ... From 4e3ac4a9f46b83ec306dc1b3bcf16fd4a798a90f Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 28 Sep 2019 14:15:12 +0200 Subject: [PATCH 04/10] Make SSL-only friend criteria stricter --- libretroshare/src/pgp/pgphandler.cc | 3 +++ libretroshare/src/pgp/pgphandler.h | 9 +++++++++ libretroshare/src/pqi/p3peermgr.cc | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index 48915aa85..d0e95bcb4 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -1667,6 +1667,9 @@ bool PGPHandler::getGPGFilteredList(std::list& list,bool (*filter)(cons return true ; } +bool PGPHandler::isPgpPubKeyAvailable(const RsPgpId &id) +{ return _public_keyring_map.find(id) != _public_keyring_map.end(); } + bool PGPHandler::isGPGId(const RsPgpId &id) { return _public_keyring_map.find(id) != _public_keyring_map.end() ; diff --git a/libretroshare/src/pgp/pgphandler.h b/libretroshare/src/pgp/pgphandler.h index fee240e6a..51c9dbfcd 100644 --- a/libretroshare/src/pgp/pgphandler.h +++ b/libretroshare/src/pgp/pgphandler.h @@ -148,6 +148,15 @@ class PGPHandler const PGPCertificateInfo *getCertificateInfo(const RsPgpId& id) const ; + /** + * @brief Check if a PGP publick key is available + * @param id id of the key to check + * @return true if the public key for the given id is available, + * false otherwise + */ + bool isPgpPubKeyAvailable(const RsPgpId& id); + + RS_DEPRECATED_FOR(isPgpPubKeyAvailable) bool isGPGId(const RsPgpId &id); bool isGPGSigned(const RsPgpId &id); bool isGPGAccepted(const RsPgpId &id); diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 01f245a25..e48576d90 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -1138,7 +1138,7 @@ bool p3PeerMgrIMPL::addSslOnlyFriend( * Instead if pstate.skip_pgp_signature_validation would have been * superficially set to true the PGP signature verification would have been * skipped and the attacker connection would be accepted. */ - if(!AuthGPG::getAuthGPG()->isGPGAccepted(pgp_id)) + if(!AuthGPG::getAuthGPG()->isPgpPubKeyAvailable(pgp_id)) pstate.skip_pgp_signature_validation = true; pstate.gpg_id = pgp_id; From 1e9adc1e23a15b22628975de86531cac1b90545f Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 28 Sep 2019 14:34:07 +0200 Subject: [PATCH 05/10] Add some documentation and fix some compiler warnings --- libretroshare/src/pgp/pgphandler.cc | 15 ++++++------ libretroshare/src/pgp/pgphandler.h | 36 ++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index d0e95bcb4..4ed342629 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -1581,24 +1581,25 @@ void PGPHandler::locked_updateOwnSignatureFlag(PGPCertificateInfo& cert,const Rs cert._flags &= ~PGPCertificateInfo::PGP_CERTIFICATE_FLAG_HAS_SIGNED_ME ; } -RsPgpId PGPHandler::pgpIdFromFingerprint(const PGPFingerprintType& f) +/*static*/ RsPgpId PGPHandler::pgpIdFromFingerprint(const RsPgpFingerprint& f) { - return RsPgpId(f.toByteArray() + _RsIdSize::PGP_FINGERPRINT - _RsIdSize::PGP_ID); + return RsPgpId::fromBufferUnsafe( + f.toByteArray() + + RsPgpFingerprint::SIZE_IN_BYTES - RsPgpId::SIZE_IN_BYTES ); } -bool PGPHandler::getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const +bool PGPHandler::getKeyFingerprint(const RsPgpId& id, RsPgpFingerprint& fp) const { - RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures. + RS_STACK_MUTEX(pgphandlerMtx); const ops_keydata_t *key = locked_getPublicKey(id,false) ; - if(key == NULL) - return false ; + if(!key) return false; ops_fingerprint_t f ; ops_fingerprint(&f,&key->key.pkey) ; - fp = PGPFingerprintType(f.fingerprint) ; + fp = RsPgpFingerprint::fromBufferUnsafe(f.fingerprint); return true ; } diff --git a/libretroshare/src/pgp/pgphandler.h b/libretroshare/src/pgp/pgphandler.h index 51c9dbfcd..0b785285a 100644 --- a/libretroshare/src/pgp/pgphandler.h +++ b/libretroshare/src/pgp/pgphandler.h @@ -79,7 +79,7 @@ class PGPCertificateInfo /// This class offer an abstract pgp handler to be used in RetroShare. class PGPHandler { - public: +public: PGPHandler( const std::string& path_to_public_keyring, const std::string& path_to_secret_keyring, const std::string& path_to_trust_database, @@ -124,7 +124,6 @@ class PGPHandler bool encryptTextToFile(const RsPgpId& key_id,const std::string& text,const std::string& outfile) ; bool decryptTextFromFile(const RsPgpId& key_id,std::string& text,const std::string& encrypted_inputfile) ; - bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const ; void setAcceptConnexion(const RsPgpId&,bool) ; void updateOwnSignatureFlag(const RsPgpId& ownId) ; @@ -148,14 +147,6 @@ class PGPHandler const PGPCertificateInfo *getCertificateInfo(const RsPgpId& id) const ; - /** - * @brief Check if a PGP publick key is available - * @param id id of the key to check - * @return true if the public key for the given id is available, - * false otherwise - */ - bool isPgpPubKeyAvailable(const RsPgpId& id); - RS_DEPRECATED_FOR(isPgpPubKeyAvailable) bool isGPGId(const RsPgpId &id); bool isGPGSigned(const RsPgpId &id); @@ -163,7 +154,30 @@ class PGPHandler static void setPassphraseCallback(PassphraseCallback cb) ; static PassphraseCallback passphraseCallback() { return _passphrase_callback ; } - static RsPgpId pgpIdFromFingerprint(const PGPFingerprintType& f) ; + + /** + * @brief Check if a PGP publick key is available + * @param id id of the key to check + * @return true if the public key for the given id is available, + * false otherwise + */ + bool isPgpPubKeyAvailable(const RsPgpId& id); + + /** + * @brief Convert PGP fingerprint to PGP 64bit id + * @param f PGP fingerprint to convert + * @return PGP 64bit id extracted from fingerprint + */ + static RsPgpId pgpIdFromFingerprint(const RsPgpFingerprint& f); + + /** + * @brief Get PGP fingerprint for the given key + * @param id PGP 64bit key id + * @param fp storage for the retrived key fingerpring, the contained value + * is meaningfull only if true is returned + * @return true if the key was found, false if not + */ + bool getKeyFingerprint(const RsPgpId& id, RsPgpFingerprint& fp) const; // Gets info about the key. Who are the signers, what's the owner's name, etc. // From 974102e3fcb5285c6ea00e416a77a8a6ec526c51 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 28 Sep 2019 17:29:24 +0200 Subject: [PATCH 06/10] fixed error handling when you enter your own certificate in connect friend wizard --- retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index f4d1ba6ed..e71750ac0 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -596,7 +596,7 @@ static void sendMail(QString sAddress, QString sSubject, QString sBody) bool ConnectFriendWizard::validateCurrentPage() { - error = true; + error = false; switch ((Page) currentId()) { case Page_WebMail: @@ -616,14 +616,14 @@ bool ConnectFriendWizard::validateCurrentPage() if(peerDetails.id == rsPeers->getOwnId()) { setField("errorMessage", tr("This is your own certificate! You would not want to make friend with yourself. Wouldn't you?") ) ; - error = false; + error = true; } break; } // error message setField("errorMessage", tr("Certificate Load Failed") + ": \n\n" + getErrorString(cert_load_error_code)) ; - error = false; + error = true; break; } case Page_ErrorMessage: @@ -638,7 +638,7 @@ bool ConnectFriendWizard::validateCurrentPage() int ConnectFriendWizard::nextId() const { switch ((Page) currentId()) { - case Page_Text: return Page_Conclusion; + case Page_Text: return error?Page_ErrorMessage:Page_Conclusion; case Page_WebMail: case Page_ErrorMessage: case Page_Conclusion: From 75dd928fbb9a3c6c2bb68fde5e2082f53124196d Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 28 Sep 2019 22:58:28 +0200 Subject: [PATCH 07/10] Removed the default stylsheets from titlebar frames Removed the default stylsheets from titlebar frames --- retroshare-gui/src/gui/ChatLobbyWidget.ui | 5 +- .../src/gui/FileTransfer/TransfersDialog.ui | 4 +- retroshare-gui/src/gui/FriendsDialog.ui | 2 +- retroshare-gui/src/gui/Identity/IdDialog.ui | 12 +++- retroshare-gui/src/gui/NewsFeed.ui | 2 +- .../src/gui/common/GroupTreeWidget.cpp | 2 +- .../src/gui/common/GroupTreeWidget.ui | 2 +- .../src/gui/gxs/GxsGroupFrameDialog.ui | 2 +- retroshare-gui/src/gui/msgs/MessagesDialog.ui | 60 +++++++++---------- .../src/gui/qss/stylesheet/Standard.qss | 2 +- 10 files changed, 51 insertions(+), 42 deletions(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.ui b/retroshare-gui/src/gui/ChatLobbyWidget.ui index 072006b40..bc8da9d6b 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.ui +++ b/retroshare-gui/src/gui/ChatLobbyWidget.ui @@ -32,7 +32,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Sunken @@ -116,6 +116,9 @@ + + 1 + diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.ui b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.ui index 5c25f5d1f..f1685a5d5 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.ui +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.ui @@ -32,7 +32,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Sunken @@ -176,7 +176,7 @@ - + diff --git a/retroshare-gui/src/gui/FriendsDialog.ui b/retroshare-gui/src/gui/FriendsDialog.ui index beb9a68e5..1ac4095cc 100644 --- a/retroshare-gui/src/gui/FriendsDialog.ui +++ b/retroshare-gui/src/gui/FriendsDialog.ui @@ -32,7 +32,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Sunken diff --git a/retroshare-gui/src/gui/Identity/IdDialog.ui b/retroshare-gui/src/gui/Identity/IdDialog.ui index c940f763f..d49782bd4 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.ui +++ b/retroshare-gui/src/gui/Identity/IdDialog.ui @@ -32,6 +32,9 @@ 0 + + 6 + @@ -41,7 +44,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Sunken @@ -138,6 +141,9 @@ + + 1 + @@ -283,8 +289,8 @@ 0 0 - 1372 - 999 + 1003 + 1094 diff --git a/retroshare-gui/src/gui/NewsFeed.ui b/retroshare-gui/src/gui/NewsFeed.ui index baf108650..43908f81a 100644 --- a/retroshare-gui/src/gui/NewsFeed.ui +++ b/retroshare-gui/src/gui/NewsFeed.ui @@ -32,7 +32,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Sunken diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 62c5f45fc..8a5516f6f 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -210,7 +210,7 @@ void GroupTreeWidget::addToolButton(QToolButton *toolButton) toolButton->setIconSize(ui->displayButton->iconSize()); toolButton->setFocusPolicy(ui->displayButton->focusPolicy()); - ui->titleBarFrame->layout()->addWidget(toolButton); + ui->toolBarFrame->layout()->addWidget(toolButton); } // Load and save settings (group must be started from the caller) diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.ui b/retroshare-gui/src/gui/common/GroupTreeWidget.ui index 26167dcd7..4f0eb977d 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.ui +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.ui @@ -27,7 +27,7 @@ 0 - + 0 diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui index 7431deb97..0a8fa4587 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.ui @@ -32,7 +32,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Sunken diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.ui b/retroshare-gui/src/gui/msgs/MessagesDialog.ui index 6d53864e6..134621e7e 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.ui +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.ui @@ -24,7 +24,7 @@ 0 - + 0 @@ -40,11 +40,11 @@ 16777215 - 36 + 28 - QFrame::Box + QFrame::NoFrame QFrame::Sunken @@ -96,7 +96,7 @@ Compose - + :/images/folder-draft24.png:/images/folder-draft24.png @@ -137,7 +137,7 @@ Delete - + :/images/deletemail24.png:/images/deletemail24.png @@ -201,7 +201,7 @@ Foward - + :/images/mailforward24-hover.png:/images/mailforward24-hover.png @@ -248,7 +248,7 @@ Print - + :/images/print24.png:/images/print24.png @@ -283,7 +283,7 @@ Display - + :/images/looknfeel.png:/images/looknfeel.png @@ -324,7 +324,7 @@ - :/icons/png/messages.png + :/icons/png/messages.png true @@ -343,7 +343,7 @@ Tags - + :/images/tag24.png:/images/tag24.png @@ -390,7 +390,7 @@ Reply - + :/images/replymail-pressed.png:/images/replymail-pressed.png @@ -431,7 +431,7 @@ Reply all - + :/images/replymailall24-hover.png:/images/replymailall24-hover.png @@ -454,7 +454,7 @@ Qt::NoFocus - + :/icons/help_64.png:/icons/help_64.png @@ -570,7 +570,7 @@ Inbox - + :/images/folder-inbox.png:/images/folder-inbox.png @@ -579,7 +579,7 @@ Outbox - + :/images/folder-outbox.png:/images/folder-outbox.png @@ -588,7 +588,7 @@ Draft - + :/images/folder-draft.png:/images/folder-draft.png @@ -597,7 +597,7 @@ Sent - + :/images/folder-sent.png:/images/folder-sent.png @@ -606,7 +606,7 @@ Trash - + :/images/folder-trash.png:/images/folder-trash.png @@ -662,7 +662,7 @@ - :/images/foldermail.png + :/images/foldermail.png @@ -703,7 +703,7 @@ - :/images/tag24.png + :/images/tag24.png true @@ -804,7 +804,7 @@ - + :/images/mail_reply.png:/images/mail_reply.png @@ -813,7 +813,7 @@ - + :/images/mail_replyall.png:/images/mail_replyall.png @@ -822,7 +822,7 @@ - + :/images/mail_forward.png:/images/mail_forward.png @@ -831,16 +831,16 @@ - - StyledLabel - QLabel -
gui/common/StyledLabel.h
-
LineEditClear QLineEdit
gui/common/LineEditClear.h
+ + StyledLabel + QLabel +
gui/common/StyledLabel.h
+
RSTabWidget QTabWidget @@ -853,8 +853,8 @@ listWidget - - + + diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index f1420a0a3..f13882fd4 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -2,7 +2,7 @@ /* Standard rules */ -QFrame#titleBarFrame, QFrame#toolBarFrame { +QFrame#toolBarFrame { background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FEFEFE, stop:1 #E8E8E8); border: 1px solid #CCCCCC; } From d1f245f5d65fcadc254c7f7fe7e935c71888f2ab Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 29 Sep 2019 16:48:31 +0200 Subject: [PATCH 08/10] improved look & feel on profile generation dialog --- retroshare-gui/src/gui/GenCertDialog.ui | 172 +++++++++++++----------- 1 file changed, 95 insertions(+), 77 deletions(-) diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui index c81306be2..96f09cae2 100644 --- a/retroshare-gui/src/gui/GenCertDialog.ui +++ b/retroshare-gui/src/gui/GenCertDialog.ui @@ -68,84 +68,102 @@ - - - - - - 75 - true - - - - Node type: - - - - - - - - 0 - 0 - - - - - Standard node - - - - - Hidden node (over Tor) - - - - - Hidden node (Tor/I2P - Manually configured) - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - advanced options - - - - 24 - 24 - - - - - - - - - - TextLabel - - - Qt::RichText - - - true + + + + + + 24 + + + 9 + + + 24 + + + + + TextLabel + + + Qt::RichText + + + true + + + + + + + + + + 75 + true + + + + Node type: + + + + + + + + 0 + 0 + + + + + Standard node + + + + + Hidden node (over Tor) + + + + + Hidden node (Tor/I2P - Manually configured) + + + + + + + + advanced options + + + + 24 + 24 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + From e41b64d938817b25650c4a483a3d5a30da8bfea3 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 29 Sep 2019 17:37:52 +0200 Subject: [PATCH 09/10] added checksum section to short certificate format --- libretroshare/src/rsserver/p3peers.cc | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 18d245663..1924b69dd 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -1148,6 +1148,7 @@ enum class RsShortInviteFieldType : uint8_t PEER_NAME = 0x01, LOCATOR = 0x02, PGP_FINGERPRINT = 0x03, + CHECKSUM = 0x04, /* The following will be deprecated, and ported to LOCATOR when generic * trasport layer will be implemented */ @@ -1266,6 +1267,17 @@ bool p3Peers::getShortInvite( offset += tLocator.size(); } } + uint32_t computed_crc = PGPKeyManagement::compute24bitsCRC(buf,offset) ; + + // handle endian issues. + unsigned char mem[3] ; + mem[0] = computed_crc & 0xff ; + mem[1] = (computed_crc >> 8 ) & 0xff ; + mem[2] = (computed_crc >> 16) & 0xff ; + + addPacketHeader( RsShortInviteFieldType::CHECKSUM,3,buf,offset,buf_size); + memcpy(&buf[offset],mem,3); + offset += 3; Radix64::encode(buf, static_cast(offset), invite); @@ -1299,6 +1311,7 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d unsigned char* buf = bf.data(); size_t total_s = 0; + bool CRC_ok = false ; // not checked yet while(total_s < size) { @@ -1373,6 +1386,25 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d details.hiddenNodeAddress = std::string((char*)&buf[6],s-6); break; + case RsShortInviteFieldType::CHECKSUM: + { + if(s != 3 || total_s+3 != size) // make sure the checksum is the last section + { + err_code = CERTIFICATE_PARSING_ERROR_INVALID_CHECKSUM_SECTION; + return false; + } + uint32_t computed_crc = PGPKeyManagement::compute24bitsCRC(bf.data(),size-5); + uint32_t certificate_crc = static_cast( buf[0] + (buf[1] << 8) + (buf[2] << 16) ); + + if(computed_crc != certificate_crc) + { + err_code = CERTIFICATE_PARSING_ERROR_CHECKSUM_ERROR; + return false; + } + CRC_ok = true; + break; + } + } buf = &buf[s]; @@ -1396,6 +1428,11 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d else details.skip_pgp_signature_validation = true; + if(!CRC_ok) + { + err_code = CERTIFICATE_PARSING_ERROR_CHECKSUM_ERROR; + return false; + } if(details.gpg_id.isNull()) { err_code = CERTIFICATE_PARSING_ERROR_MISSING_PGP_FINGERPRINT; From 6be6f7460218b745fe2ecdeff7c21e3b4f0d201c Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 30 Sep 2019 22:38:15 +0200 Subject: [PATCH 10/10] Rename text "Please choose a profile name and password..." --- retroshare-gui/src/gui/GenCertDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index 7581c4a2a..e81c3794d 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -341,7 +341,7 @@ void GenCertDialog::setupState() ui.genButton->setVisible(false) ; ui.generate_label->setVisible(false) ; - ui.info_label->setText("Please fill your profile name and password...") ; + ui.info_label->setText("Please choose a profile name and password...") ; ui.info_label->setVisible(true) ; } else if(!mEntropyOk)