diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 3261081ff..2c115b6e2 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -155,7 +155,7 @@ QList sizes; // add self nick and Avatar to Friends. RsPeerDetails pd ; if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) { - ui.nicknameLabel->setText(QString::fromUtf8(pd.name.c_str())); + ui.nicknameLabel->setText(QString::fromUtf8(pd.name.c_str()) + " (" + QString::fromUtf8(pd.location.c_str())+")"); } QString hlp_str = tr( diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index 76a863206..77c67b7a8 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -39,7 +39,7 @@ //#include "TrustView.h" #include "NetworkView.h" #include "GenCertDialog.h" -#include "connect/ConfCertDialog.h" +#include "connect/PGPKeyDialog.h" #include "settings/rsharesettings.h" #include "RetroShareLink.h" #include "util/QtVersion.h" @@ -204,13 +204,13 @@ void NetworkDialog::connectTreeWidgetCostumPopupMenu( QPoint /*point*/ ) if(!rsPeers->getGPGDetails(peer_id, detail)) // that is not suppose to fail. return ; - if(peer_id != rsPeers->getGPGOwnId()) - { - if(detail.accept_connection) - contextMnu->addAction(QIcon(IMAGE_DENIED), tr("Deny friend"), this, SLOT(denyFriend())); - else // not a friend - contextMnu->addAction(QIcon(IMAGE_MAKEFRIEND), tr("Make friend"), this, SLOT(makeFriend())); - } + if(peer_id != rsPeers->getGPGOwnId()) + { + if(detail.accept_connection) + contextMnu->addAction(QIcon(IMAGE_DENIED), tr("Deny friend"), this, SLOT(denyFriend())); + else // not a friend + contextMnu->addAction(QIcon(IMAGE_MAKEFRIEND), tr("Make friend..."), this, SLOT(makeFriend())); + } if(peer_id == rsPeers->getGPGOwnId()) contextMnu->addAction(QIcon(IMAGE_EXPORT), tr("Export/create a new node"), this, SLOT(on_actionExportKey_activated())); @@ -315,7 +315,7 @@ void NetworkDialog::denyFriend() void NetworkDialog::makeFriend() { - ConfCertDialog::showIt(RsPgpId(getCurrentNeighbour()->text(COLUMN_PEERID).toStdString()), ConfCertDialog::PageTrust); + PGPKeyDialog::showIt(RsPgpId(getCurrentNeighbour()->text(COLUMN_PEERID).toStdString()), PGPKeyDialog::PageDetails); } /** Shows Peer Information/Auth Dialog */ @@ -325,7 +325,7 @@ void NetworkDialog::peerdetails() if (item == NULL) { return; } - ConfCertDialog::showIt(RsPgpId(item->text(COLUMN_PEERID).toStdString()), ConfCertDialog::PageDetails); + PGPKeyDialog::showIt(RsPgpId(item->text(COLUMN_PEERID).toStdString()), PGPKeyDialog::PageDetails); } void NetworkDialog::copyLink() diff --git a/retroshare-gui/src/gui/NetworkDialog.ui b/retroshare-gui/src/gui/NetworkDialog.ui index e13990be9..7aed3c001 100644 --- a/retroshare-gui/src/gui/NetworkDialog.ui +++ b/retroshare-gui/src/gui/NetworkDialog.ui @@ -30,7 +30,7 @@ - Only show people you trusted + Trusted keys only diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index 52f7be075..4da365b33 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -45,6 +45,7 @@ #include "common/RsCollectionFile.h" #include "gui/connect/ConnectFriendWizard.h" #include "gui/connect/ConfCertDialog.h" +#include "gui/connect/PGPKeyDialog.h" #include #include @@ -973,9 +974,9 @@ static void processList(const QStringList &list, const QString &textSingular, co processList(fileAdd, QObject::tr("Add file"), QObject::tr("Add files"), content); } - if (personAdd.size()) { - processList(personAdd, QObject::tr("Add friend"), QObject::tr("Add friends"), content); - } + //if (personAdd.size()) { + // processList(personAdd, QObject::tr("Add friend"), QObject::tr("Add friends"), content); + //} if (content.isEmpty() == false) { QString question = ""; @@ -1147,34 +1148,41 @@ static void processList(const QStringList &list, const QString &textSingular, co std::cerr << " RetroShareLink::process FriendRequest : name : " << link.name().toStdString() << ". id : " << link.hash().toStdString() << std::endl; #endif - needNotifySuccess = true; + RsPeerDetails detail; + if (rsPeers->getGPGDetails(RsPgpId(link.hash().toStdString()), detail)) + PGPKeyDialog::showIt(detail.gpg_id,PGPKeyDialog::PageDetails) ; + else + personNotFound.append(PeerDefs::rsid(link.name().toUtf8().constData(), RsPgpId(link.hash().toStdString()))); - RsPeerDetails detail; - if (rsPeers->getGPGDetails(RsPgpId(link.hash().toStdString()), detail)) - { - if (RsPgpId(detail.gpg_id) == rsPeers->getGPGOwnId()) { - // it's me, do nothing - break; - } + break; +// needNotifySuccess = true; - if (detail.accept_connection) { - // peer connection is already accepted - personExist.append(PeerDefs::rsid(detail)); - break; - } - - if (rsPeers->addFriend(RsPeerId(), RsPgpId(link.hash().toStdString()))) { - ConfCertDialog::loadAll(); - personAdded.append(PeerDefs::rsid(detail)); - break; - } - - personFailed.append(PeerDefs::rsid(link.name().toUtf8().constData(), RsPgpId(link.hash().toStdString()))); - break; - } - - personNotFound.append(PeerDefs::rsid(link.name().toUtf8().constData(), RsPgpId(link.hash().toStdString()))); - break; +// RsPeerDetails detail; +// if (rsPeers->getGPGDetails(RsPgpId(link.hash().toStdString()), detail)) +// { +// if (RsPgpId(detail.gpg_id) == rsPeers->getGPGOwnId()) { +// // it's me, do nothing +// break; +// } +// +// if (detail.accept_connection) { +// // peer connection is already accepted +// personExist.append(PeerDefs::rsid(detail)); +// break; +// } +// +// if (rsPeers->addFriend(RsPeerId(), RsPgpId(link.hash().toStdString()))) { +// ConfCertDialog::loadAll(); +// personAdded.append(PeerDefs::rsid(detail)); +// break; +// } +// +// personFailed.append(PeerDefs::rsid(link.name().toUtf8().constData(), RsPgpId(link.hash().toStdString()))); +// break; +// } +// +// personNotFound.append(PeerDefs::rsid(link.name().toUtf8().constData(), RsPgpId(link.hash().toStdString()))); +// break; } diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 3052bba9c..fe88e70d8 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -35,6 +35,7 @@ #include "gui/common/AvatarDefs.h" #include "gui/connect/ConfCertDialog.h" +#include "gui/connect/PGPKeyDialog.h" #include "gui/connect/ConnectFriendWizard.h" #include "gui/groups/CreateGroup.h" #include "gui/msgs/MessageComposer.h" @@ -379,6 +380,7 @@ void FriendList::peerTreeWidgetCustomPopupMenu() break; case TYPE_GPG: { + contextMnu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Details"), this, SLOT(configurefriend())); contextMnu.addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny"), this, SLOT(removefriend())); if(mShowGroups) @@ -1499,7 +1501,7 @@ void FriendList::configurefriend() if(!RsPeerId(getRsId(getCurrentPeer())).isNull()) ConfCertDialog::showIt(RsPeerId(getRsId(getCurrentPeer())), ConfCertDialog::PageDetails); else if(!RsPgpId(getRsId(getCurrentPeer())).isNull()) - ConfCertDialog::showIt(RsPgpId(getRsId(getCurrentPeer())), ConfCertDialog::PageDetails); + PGPKeyDialog::showIt(RsPgpId(getRsId(getCurrentPeer())), PGPKeyDialog::PageDetails); else std::cerr << "FriendList::configurefriend: id is not an SSL nor a PGP id." << std::endl; } diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index de2379ee5..dbdbde7f2 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -93,7 +93,7 @@ ConfCertDialog::ConfCertDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidge // } ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png")); - ui.headerFrame->setHeaderText(tr("Friend Details")); + ui.headerFrame->setHeaderText(tr("Friend node details")); //ui._chat_CB->hide() ; @@ -101,12 +101,10 @@ 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.make_friend_button, SIGNAL(clicked()), this, SLOT(makeFriend())); - connect(ui.denyFriendButton, SIGNAL(clicked()), this, SLOT(denyFriend())); - connect(ui.signKeyButton, SIGNAL(clicked()), this, SLOT(signGPGKey())); - connect(ui.trusthelpButton, SIGNAL(clicked()), this, SLOT(showHelpDialog())); connect(ui._shouldAddSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); - connect(ui._shouldAddSignatures_CB_2, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); + + //connect(ui.denyFriendButton, SIGNAL(clicked()), this, SLOT(denyFriend())); + //connect(ui._shouldAddSignatures_CB_2, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); ui.avatar->setFrameType(AvatarWidget::NORMAL_FRAME); @@ -153,7 +151,7 @@ void ConfCertDialog::load() { RsPeerDetails detail; - if(!(rsPeers->getPeerDetails(peerId, detail) || rsPeers->getGPGDetails(pgpId, detail))) + if(!rsPeers->getPeerDetails(peerId, detail)) { QMessageBox::information(this, tr("RetroShare"), @@ -162,33 +160,18 @@ void ConfCertDialog::load() return; } - if(detail.isOnlyGPGdetail && !rsPeers->isKeySupported(pgpId)) - { - ui.make_friend_button->setEnabled(false) ; - ui.make_friend_button->setToolTip(tr("The supplied key algorithm is not supported by RetroShare\n(Only RSA keys are supported at the moment)")) ; - } - else - { - ui.make_friend_button->setEnabled(true) ; - ui.make_friend_button->setToolTip("") ; - } + ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ; + ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ; - - ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ; - ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ; - - ui.name->setText(QString::fromUtf8(detail.name.c_str())); + //ui.pgpfingerprint->setText(QString::fromUtf8(detail.name.c_str())); ui.peerid->setText(QString::fromStdString(detail.id.toStdString())); RetroShareLink link; link.createPerson(detail.gpg_id); - ui.rsid->setText(link.toHtml()); - ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString()))); - ui.rsid->setToolTip(link.title()); + ui.pgpfingerprint->setText(link.toHtml()); + ui.pgpfingerprint->setToolTip(link.title()); - if (!detail.isOnlyGPGdetail) - { ui.avatar->setId(ChatId(peerId)); ui.loc->setText(QString::fromUtf8(detail.location.c_str())); @@ -278,165 +261,23 @@ void ConfCertDialog::load() ui.groupBox->show(); ui.groupBox_4->show(); ui.tabWidget->show(); - ui.rsid->hide(); - ui.label_rsid->hide(); + //ui.rsid->hide(); + //ui.label_rsid->hide(); ui.pgpfingerprint->show(); - ui.pgpfingerprint_label->show(); + //ui.pgpfingerprint_label->show(); ui.stabWidget->setTabEnabled(2,true) ; ui.stabWidget->setTabEnabled(3,true) ; ui.stabWidget->setTabEnabled(4,true) ; - } - else - { - //ui.avatar->setId(pgpId.toStdString(), true); - ui.rsid->show(); - ui.peerid->hide(); - ui.label_id->hide(); - ui.label_rsid->show(); - ui.pgpfingerprint->show(); - ui.pgpfingerprint_label->show(); - ui.loc->hide(); - ui.label_loc->hide(); - ui.statusline->hide(); - ui.label_status->hide(); - ui.lastcontact->hide(); - ui.label_last_contact->hide(); - ui.version->hide(); - ui.label_version->hide(); - ui.groupBox_4->hide(); - ui.crypto_info->hide(); - ui.crypto_label->hide(); - - ui.groupBox->hide(); - ui.tabWidget->hide(); - - ui.stabWidget->setTabEnabled(2,true) ; - ui.stabWidget->setTabEnabled(3,false) ; - ui.stabWidget->setTabEnabled(4,false) ; - //ui._useOldFormat_CB->setEnabled(false) ; - } - - if (detail.gpg_id == rsPeers->getGPGOwnId()) { - ui.make_friend_button->hide(); - ui.signGPGKeyCheckBox->hide(); - ui.signKeyButton->hide(); - ui.denyFriendButton->hide(); - - ui.web_of_trust_label->hide(); - ui.radioButton_trust_fully->hide(); - ui.radioButton_trust_marginnaly->hide(); - ui.radioButton_trust_never->hide(); - - ui.is_signing_me->hide(); - ui.signersBox->setTitle(tr("My key is signed by : ")); - - } else { - ui.web_of_trust_label->show(); - ui.radioButton_trust_fully->show(); - ui.radioButton_trust_marginnaly->show(); - ui.radioButton_trust_never->show(); - - ui.is_signing_me->show(); - ui.signersBox->setTitle(tr("Peer key is signed by : ")); - - if (detail.accept_connection) { - ui.make_friend_button->hide(); - ui.denyFriendButton->show(); - ui.signGPGKeyCheckBox->hide(); - //connection already accepted, propose to sign gpg key - if (!detail.ownsign) { - ui.signKeyButton->show(); - } else { - ui.signKeyButton->hide(); - } - } else { - ui.make_friend_button->show(); - ui.denyFriendButton->hide(); - ui.signKeyButton->hide(); - if (!detail.ownsign) { - ui.signGPGKeyCheckBox->show(); - ui.signGPGKeyCheckBox->setChecked(false); - } else { - ui.signGPGKeyCheckBox->hide(); - } - } - - //web of trust - if (detail.trustLvl == RS_TRUST_LVL_ULTIMATE) { - //trust is ultimate, it means it's one of our own keys - ui.web_of_trust_label->setText(tr("Your trust in this peer is ultimate, it's probably a key you own.")); - ui.radioButton_trust_fully->hide(); - ui.radioButton_trust_marginnaly->hide(); - ui.radioButton_trust_never->hide(); - } else { - ui.radioButton_trust_fully->show(); - ui.radioButton_trust_marginnaly->show(); - ui.radioButton_trust_never->show(); - if (detail.trustLvl == RS_TRUST_LVL_FULL) { - ui.web_of_trust_label->setText(tr("Your trust in this peer is full.")); - ui.radioButton_trust_fully->setChecked(true); - ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-48.png")); - ui.radioButton_trust_marginnaly->setIcon(QIcon(":/images/security-medium-off-48.png")); - ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-off-48.png")); - } else if (detail.trustLvl == RS_TRUST_LVL_MARGINAL) { - ui.web_of_trust_label->setText(tr("Your trust in this peer is marginal.")); - ui.radioButton_trust_marginnaly->setChecked(true); - ui.radioButton_trust_marginnaly->setIcon(QIcon(":/images/security-medium-48.png")); - ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-off-48.png")); - ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-off-48.png")); - } else if (detail.trustLvl == RS_TRUST_LVL_NEVER) { - ui.web_of_trust_label->setText(tr("Your trust in this peer is none.")); - ui.radioButton_trust_never->setChecked(true); - ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-48.png")); - ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-off-48.png")); - ui.radioButton_trust_marginnaly->setIcon(QIcon(":/images/security-medium-off-48.png")); - } else { - ui.web_of_trust_label->setText(tr("Your trust in this peer is not set.")); - - //we have to set up the set exclusive to false in order to uncheck it all - ui.radioButton_trust_fully->setAutoExclusive(false); - ui.radioButton_trust_marginnaly->setAutoExclusive(false); - ui.radioButton_trust_never->setAutoExclusive(false); - - ui.radioButton_trust_fully->setChecked(false); - ui.radioButton_trust_marginnaly->setChecked(false); - ui.radioButton_trust_never->setChecked(false); - - ui.radioButton_trust_fully->setAutoExclusive(true); - ui.radioButton_trust_marginnaly->setAutoExclusive(true); - ui.radioButton_trust_never->setAutoExclusive(true); - - ui.radioButton_trust_never->setIcon(QIcon(":/images/security-low-off-48.png")); - ui.radioButton_trust_fully->setIcon(QIcon(":/images/security-high-off-48.png")); - ui.radioButton_trust_marginnaly->setIcon(QIcon(":/images/security-medium-off-48.png")); - } - } - - if (detail.hasSignedMe) { - ui.is_signing_me->setText(tr("Peer has authenticated me as a friend and did sign my PGP key")); - } else { - ui.is_signing_me->setText(tr("Peer has not authenticated me as a friend and did not sign my PGP key")); - } - } - - QString text; - for(std::list::const_iterator it(detail.gpgSigners.begin());it!=detail.gpgSigners.end();++it) { - link.createPerson(*it); - if (link.valid()) { - text += link.toHtml() + "
"; - } - } - ui.signers->setHtml(text); - - loadInvitePage() ; + loadInvitePage() ; } void ConfCertDialog::loadInvitePage() { - RsPeerDetails detail; - if (!rsPeers->getPeerDetails(peerId, detail) && !rsPeers->getGPGDetails(pgpId,detail)) + RsPeerDetails detail; + + if (!rsPeers->getPeerDetails(peerId, detail)) { QMessageBox::information(this, tr("RetroShare"), @@ -444,31 +285,56 @@ void ConfCertDialog::loadInvitePage() close(); return; } - std::string pgp_key = rsPeers->getPGPKey(detail.gpg_id,ui._shouldAddSignatures_CB_2->isChecked()) ; // this needs to be a SSL id + // std::string pgp_key = rsPeers->getPGPKey(detail.gpg_id,ui._shouldAddSignatures_CB_2->isChecked()) ; // this needs to be a SSL id - ui.userCertificateText_2->setReadOnly(true); - ui.userCertificateText_2->setMinimumHeight(200); - ui.userCertificateText_2->setMinimumWidth(530); - QFont font("Courier New",10,50,false); - font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); - font.setStyle(QFont::StyleNormal); - ui.userCertificateText_2->setFont(font); - ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str())); +// ui.userCertificateText_2->setReadOnly(true); +// ui.userCertificateText_2->setMinimumHeight(200); +// ui.userCertificateText_2->setMinimumWidth(530); +// QFont font("Courier New",10,50,false); +// font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); +// font.setStyle(QFont::StyleNormal); +// ui.userCertificateText_2->setFont(font); +// ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str())); - if(!detail.isOnlyGPGdetail) - { - 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()) ; // this needs to be a SSL id - ui.userCertificateText->setReadOnly(true); - ui.userCertificateText->setMinimumHeight(200); - ui.userCertificateText->setMinimumWidth(530); - QFont font("Courier New",10,50,false); - font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); - font.setStyle(QFont::StyleNormal); - ui.userCertificateText->setFont(font); - ui.userCertificateText->setText(QString::fromUtf8(invite.c_str())); - } + QString infotext ; + //infotext += tr("

Use this certificate to make new friends. Send it by email, or give it hand to hand.

") ; + infotext += tr("

This certificate contains:") ; + infotext += "

    " ; + infotext += "
  • a PGP public key"; + infotext += " (" + QString::fromUtf8(detail.name.c_str()) + "@" + detail.gpg_id.toStdString().c_str()+")" ; + if(ui._shouldAddSignatures_CB->isChecked()) + infotext += tr(" with ")+QString::number(detail.gpgSigners.size()-1)+" external signatures
  • " ; + else + infotext += tr(" ") ; + + infotext += tr("
  • a node ID and name") +" (" + detail.id.toStdString().c_str() + ", " + QString::fromUtf8(detail.location.c_str()) +")" ; + infotext += "
  • " ; + + infotext += "
  • " ; + if(detail.isHiddenNode) + infotext += tr("an onion address and port") +" (" + detail.hiddenNodeAddress.c_str() + ":" + QString::number(detail.hiddenNodePort)+ ")"; + else + infotext += tr("an IP address and port") +" (" + detail.connectAddr.c_str() + ":" + QString::number(detail.connectPort)+ ")"; + infotext += "
  • " ; + + infotext += QString("

    ") ; + + if(rsPeers->getOwnId() == detail.id) + infotext += tr("

    You can use this certificate to make new friends. Send it by email, or give it hand to hand.

    ") ; + + ui.userCertificateText->setToolTip(infotext) ; + + ui.userCertificateText->setReadOnly(true); + ui.userCertificateText->setMinimumHeight(200); + ui.userCertificateText->setMinimumWidth(530); + QFont font("Courier New",10,50,false); + font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); + font.setStyle(QFont::StyleNormal); + ui.userCertificateText->setFont(font); + ui.userCertificateText->setText(QString::fromUtf8(invite.c_str())); } @@ -487,18 +353,8 @@ void ConfCertDialog::applyDialog() } } - //check the GPG trustlvl - if (ui.radioButton_trust_fully->isChecked() && detail.trustLvl != RS_TRUST_LVL_FULL) { - //trust has changed to fully - rsPeers->trustGPGCertificate(pgpId, RS_TRUST_LVL_FULL); - } else if (ui.radioButton_trust_marginnaly->isChecked() && detail.trustLvl != RS_TRUST_LVL_MARGINAL) { - rsPeers->trustGPGCertificate(pgpId, RS_TRUST_LVL_MARGINAL); - } else if (ui.radioButton_trust_never->isChecked() && detail.trustLvl != RS_TRUST_LVL_NEVER) { - rsPeers->trustGPGCertificate(pgpId, RS_TRUST_LVL_NEVER); - } - - if (!detail.isOnlyGPGdetail) { - if(!detail.isHiddenNode) { + if(!detail.isHiddenNode) + { /* check if the data is the same */ bool localChanged = false; bool extChanged = false; @@ -526,13 +382,15 @@ void ConfCertDialog::applyDialog() if(localChanged || extChanged || dnsChanged) emit configChanged(); - } else { - if((detail.hiddenNodeAddress != ui.localAddress->text().toStdString()) || (detail.hiddenNodePort != ui.localPort->value())) { + } + else + { + if((detail.hiddenNodeAddress != ui.localAddress->text().toStdString()) || (detail.hiddenNodePort != ui.localPort->value())) + { rsPeers->setHiddenNode(peerId,ui.localAddress->text().toStdString(), ui.localPort->value()); emit configChanged(); } } - } setServiceFlags() ; @@ -540,42 +398,6 @@ void ConfCertDialog::applyDialog() close(); } -void ConfCertDialog::makeFriend() -{ - if (ui.signGPGKeyCheckBox->isChecked()) { - rsPeers->signGPGCertificate(pgpId); - } - - rsPeers->addFriend(peerId, pgpId); - setServiceFlags() ; - loadAll(); - - emit configChanged(); -} - -void ConfCertDialog::denyFriend() -{ - rsPeers->removeFriend(pgpId); - loadAll(); - - emit configChanged(); -} - -void ConfCertDialog::signGPGKey() -{ - if (!rsPeers->signGPGCertificate(pgpId)) { - QMessageBox::warning ( NULL, - tr("Signature Failure"), - tr("Maybe password is wrong"), - QMessageBox::Ok); - } - loadAll(); - - emit configChanged(); -} - -/** Displays the help browser and displays the most recently viewed help - * topic. */ void ConfCertDialog::showHelpDialog() { showHelpDialog("trust"); diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.h b/retroshare-gui/src/gui/connect/ConfCertDialog.h index 90a3d7260..d9ae24a9c 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.h +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.h @@ -76,9 +76,9 @@ private: private slots: void applyDialog(); - void makeFriend(); - void denyFriend(); - void signGPGKey(); + //void makeFriend(); + //void denyFriend(); + //void signGPGKey(); void loadInvitePage(); void setServiceFlags(); diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.ui b/retroshare-gui/src/gui/connect/ConfCertDialog.ui index b48b1b190..1dd6df3d9 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.ui +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.ui @@ -7,11 +7,11 @@ 0 0 635 - 669 + 634 - Friend Details + Retroshare node details @@ -60,7 +60,7 @@ - 2 + 0 @@ -70,206 +70,180 @@ Details - - - - + + + + + + + Location info + + + + + + + 0 + 0 + + + + + 16777215 + 27 + + + + + + + + Node name : + + + + + + + true + + + + + + + Status : + + + + + + + true + + + + + + + Last Contact : + + + + + + + true + + + + + + + Retroshare version : + + + + + + + true + + + + + + + Node ID : + + + + + + + <html><head/><body><p>This is the ID of the node's <span style=" font-weight:600;">SSL</span> certifcate, that is signed by the above <span style=" font-weight:600;">PGP</span> key. </p></body></html> + + + true + + + + + + + Encryption + + + + + + + <html><head/><body><p>The encryption string is given by <span style=" font-weight:600;">SSL</span>. The connection to friend nodes</p><p>is always heavily encrypted, but If DHE is present, the connection further uses</p><p>&quot;perfect forward secrecy&quot;.</p></body></html> + + + true + + + + + + + PGP key : + + + + + + + + + + + + + 96 + 96 + + + + + 96 + 96 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Vertical + + - 96 - 96 + 20 + 40 - - - 96 - 96 - - - + - - - - Peer Info - - - - - - Name - - - - - - - true - - - - - - - Location ID - - - - - - - true - - - - - - - RetroShare ID - - - - - - - true - - - - 0 - 0 - - - - - 16777215 - 20 - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - true - - - - - - - PGP fingerprint - - - - - - - true - - - - 0 - 0 - - - - - 16777215 - 20 - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - true - - - - - - - Encryption - - - - - - - - - - - - - Other info - - - - - - Loc - - - - - - - true - - - - - - - Status - - - - - - - true - - - - - - - Last Contact - - - - - - - true - - - - - - - Version - - - - - - - true - - - - - - - + 0 @@ -467,343 +441,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - :/images/security-high-16.png:/images/security-high-16.png - - - Trust - - - - - - Your trust in this peer is: - - - true - - - - - - - - - - 125 - 16777215 - - - - None - - - - :/images/security-low-48.png:/images/security-low-48.png - - - - 48 - 48 - - - - - - - - - 140 - 16777215 - - - - Marginal - - - - :/images/security-medium-48.png:/images/security-medium-48.png - - - - 48 - 48 - - - - - - - - - 130 - 16777215 - - - - Full - - - - :/images/security-high-48.png:/images/security-high-48.png - - - - 48 - 48 - - - - - - - - - - - 50 - false - - - - PGP Key - - - false - - - false - - - - - - - 75 - true - - - - Peer has signed my PGP key - - - - - - - Show Help for Trust Settings and Signing - - - - - - - :/images/informations_24x24.png:/images/informations_24x24.png - - - - 24 - 24 - - - - - - - - Peer key is signed by : - - - - - - - - - - - - - - - 6 - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Signing a friend's key is a way to express your trust into this friend, to your other friends. Besides, only signed peers will receive information about your other trusted friends.</p> -<p align="justify" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Signing a key cannot be undone, so do it wisely.</p></body></html> - - - Sign PGP key - - - - :/images/view-certificate-sign-32.png:/images/view-certificate-sign-32.png - - - - 32 - 32 - - - - false - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Signing a friend's key is a way to express your trust into this friend, to your other friends. Besides, only signed peers will receive information about your other trusted friends.</p> -<p align="justify" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Signing a key cannot be undone, so do it wisely.</p></body></html> - - - Sign PGP key - - - - :/images/view-certificate-sign-48.png:/images/view-certificate-sign-48.png - - - - 48 - 48 - - - - Qt::ToolButtonTextUnderIcon - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Deny Friend - - - - :/images/user/deny_user48.png:/images/user/deny_user48.png - - - - 48 - 48 - - - - Qt::ToolButtonTextUnderIcon - - - - - - - Make Friend - - - - :/images/user/add_user48.png:/images/user/add_user48.png - - - - 48 - 48 - - - - false - - - false - - - Qt::ToolButtonTextUnderIcon - - - false - - - Qt::NoArrow - - - - - - - - - - PGP Key - - - - - - - - - - - Include signatures - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - @@ -812,7 +449,7 @@ p, li { white-space: pre-wrap; } :/images/view-certificate-sign-32.png:/images/view-certificate-sign-32.png - Certificate + Retroshare Certificate diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp new file mode 100644 index 000000000..95af18a16 --- /dev/null +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -0,0 +1,395 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006, crypton + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + +#include "PGPKeyDialog.h" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "gui/help/browser/helpbrowser.h" +#include "gui/common/PeerDefs.h" +#include "gui/common/StatusDefs.h" +#include "gui/RetroShareLink.h" +#include "gui/notifyqt.h" +#include "gui/common/AvatarDefs.h" +#include "gui/MainWindow.h" +#include "mainpage.h" +#include "util/DateTime.h" +#include "util/misc.h" + +static QMap instances_pgp; + +PGPKeyDialog *PGPKeyDialog::instance(const RsPgpId& pgp_id) +{ + + PGPKeyDialog *d = instances_pgp[pgp_id]; + if (d) { + return d; + } + + d = new PGPKeyDialog(RsPeerId(),pgp_id); + instances_pgp[pgp_id] = d; + + return d; +} +/** Default constructor */ +PGPKeyDialog::PGPKeyDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidget *parent, Qt::WindowFlags flags) + : QDialog(parent, flags), peerId(id), pgpId(pgp_id) +{ + /* Invoke Qt Designer generated QObject setup routine */ + ui.setupUi(this); + +// if(id.isNull()) +// ui._useOldFormat_CB->setChecked(true) ; +// else +// { +// ui._useOldFormat_CB->setChecked(false) ; +// ui._useOldFormat_CB->setEnabled(false) ; +// } + + ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png")); + ui.headerFrame->setHeaderText(tr("PGP Key details")); + + //ui._chat_CB->hide() ; + + setAttribute(Qt::WA_DeleteOnClose, true); + + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(applyDialog())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close())); + connect(ui.make_friend_button, SIGNAL(clicked()), this, SLOT(makeFriend())); + connect(ui.denyFriendButton, SIGNAL(clicked()), this, SLOT(denyFriend())); + connect(ui.signKeyButton, SIGNAL(clicked()), this, SLOT(signGPGKey())); + //connect(ui.trusthelpButton, SIGNAL(clicked()), this, SLOT(showHelpDialog())); + //connect(ui._shouldAddSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(loadInvitePage())); + connect(ui._shouldAddSignatures_CB_2, SIGNAL(toggled(bool)), this, SLOT(loadKeyPage())); + + //ui.avatar->setFrameType(AvatarWidget::NORMAL_FRAME); + + MainWindow *w = MainWindow::getInstance(); + if (w) { + connect(this, SIGNAL(configChanged()), w->getPage(MainWindow::Network), SLOT(insertConnect())); + } +} + +PGPKeyDialog::~PGPKeyDialog() +{ + QMap::iterator it = instances_pgp.find(pgpId); + if (it != instances_pgp.end()) + instances_pgp.erase(it); +} + + +//void PGPKeyDialog::setServiceFlags() +//{ +// ServicePermissionFlags flags(0) ; +// +// if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_NODE_PERM_DIRECT_DL ; +// if( ui._allow_push_CB->isChecked()) flags = flags | RS_NODE_PERM_ALLOW_PUSH ; +// +// rsPeers->setServicePermissionFlags(pgpId,flags) ; +//} + +void PGPKeyDialog::loadAll() +{ + for(QMap::iterator it = instances_pgp.begin(); it != instances_pgp.end(); ++it) it.value()->load(); +} + +void PGPKeyDialog::load() +{ + RsPeerDetails detail; + + if(!rsPeers->getGPGDetails(pgpId, detail)) + { + QMessageBox::information(this, + tr("RetroShare"), + tr("Error : cannot get peer details.")); + close(); + return; + } + + if(!rsPeers->isKeySupported(pgpId)) + { + ui.make_friend_button->setEnabled(false) ; + ui.make_friend_button->setToolTip(tr("The supplied key algorithm is not supported by RetroShare\n(Only RSA keys are supported at the moment)")) ; + } + else + { + ui.make_friend_button->setEnabled(true) ; + ui.make_friend_button->setToolTip("") ; + } + + + //ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ; + //ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ; + + ui.name->setText(QString::fromUtf8(detail.name.c_str())); + //ui.peerid->setText(QString::fromStdString(detail.id.toStdString())); + + //RetroShareLink link; + //link.createPerson(detail.gpg_id); + + //ui.rsid->setText(QString::fromStdString(detail.gpg_id.toStdString())) ; + ui.pgpfingerprint->setText(misc::fingerPrintStyleSplit(QString::fromStdString(detail.fpr.toStdString()))); + //ui.rsid->setToolTip(link.title()); + + //ui.avatar->setId(pgpId.toStdString(), true); + + // ui.rsid->show(); + // ui.peerid->hide(); + // ui.label_id->hide(); + // ui.label_rsid->show(); + + ui.pgpfingerprint->show(); + ui.pgpfingerprint_label->show(); + + // ui.loc->hide(); + // ui.label_loc->hide(); + // ui.statusline->hide(); + // ui.label_status->hide(); + // ui.lastcontact->hide(); + // ui.label_last_contact->hide(); + // ui.version->hide(); + // ui.label_version->hide(); + // ui.groupBox_4->hide(); + // ui.crypto_info->hide(); + // ui.crypto_label->hide(); + + // ui.groupBox->hide(); + // ui.tabWidget->hide(); + + if (detail.gpg_id == rsPeers->getGPGOwnId()) + { + ui.make_friend_button->hide(); + ui.signGPGKeyCheckBox->hide(); + ui.signKeyButton->hide(); + ui.denyFriendButton->hide(); + + ui.web_of_trust_label->hide(); + ui.trustlevel_CB->hide(); + + ui.is_signing_me->hide(); + ui.signersBox->setTitle(tr("This is your own PGP key, and it is signed by : ")); + + } + else + { + ui.web_of_trust_label->show(); + ui.trustlevel_CB->show(); + ui.is_signing_me->show(); + ui.signersBox->setTitle(tr("This key is signed by : ")); + + if (detail.accept_connection) + { + ui.make_friend_button->hide(); + ui.denyFriendButton->show(); + ui.signGPGKeyCheckBox->hide(); + //connection already accepted, propose to sign gpg key + if (!detail.ownsign) { + ui.signKeyButton->show(); + } else { + ui.signKeyButton->hide(); + } + } + else + { + ui.make_friend_button->show(); + ui.denyFriendButton->hide(); + ui.signKeyButton->hide(); + if (!detail.ownsign) { + ui.signGPGKeyCheckBox->show(); + ui.signGPGKeyCheckBox->setChecked(false); + } else { + ui.signGPGKeyCheckBox->hide(); + } + } + + //web of trust + + ui.trustlevel_CB->setCurrentIndex(detail.trustLvl) ; + + + QString truststring = "

    " ; + truststring += tr("The trust level is a way to express your own trust in this key. It is not used by the software nor shared, but can be useful to you in order to remember good/bad keys.") ; + truststring += "

    " ; + truststring += "

    " ; + switch(detail.trustLvl) + { + case RS_TRUST_LVL_ULTIMATE: + //trust is ultimate, it means it's one of our own keys + truststring += tr("Your trust in this peer is ultimate"); + break ; + case RS_TRUST_LVL_FULL: + truststring += tr("Your trust in this peer is full."); + break ; + case RS_TRUST_LVL_MARGINAL: + truststring += tr("Your trust in this peer is marginal."); + break ; + case RS_TRUST_LVL_NEVER: + truststring += tr("Your trust in this peer is none."); + break ; + + default: + truststring += tr("You havn't set a trust level for this key."); + break ; + } + truststring += "

    " ; + ui.trustlevel_CB->setToolTip(truststring) ; + + if (detail.hasSignedMe) { + ui.is_signing_me->setText(tr("This key has signed your own PGP key")); + ui.is_signing_me->show() ; + } else { + ui.is_signing_me->hide() ; + } + } + + QString text; + RetroShareLink link ; + + for(std::list::const_iterator it(detail.gpgSigners.begin());it!=detail.gpgSigners.end();++it) { + link.createPerson(*it); + if (link.valid()) { + text += link.toHtml() + "
    "; + } + } + ui.signers->setHtml(text); + + loadKeyPage() ; +} + +void PGPKeyDialog::loadKeyPage() +{ + RsPeerDetails detail; + + if (!rsPeers->getGPGDetails(pgpId,detail)) + { + QMessageBox::information(this, + tr("RetroShare"), + tr("Error : cannot get peer details.")); + close(); + return; + } + std::string pgp_key = rsPeers->getPGPKey(detail.gpg_id,ui._shouldAddSignatures_CB_2->isChecked()) ; // this needs to be a SSL id + + ui.userCertificateText_2->setReadOnly(true); + ui.userCertificateText_2->setMinimumHeight(200); + ui.userCertificateText_2->setMinimumWidth(530); + QFont font("Courier New",10,50,false); + font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch); + font.setStyle(QFont::StyleNormal); + ui.userCertificateText_2->setFont(font); + ui.userCertificateText_2->setText(QString::fromUtf8(pgp_key.c_str())); + + QString helptext ; + helptext += tr("

    This PGP key (ID=")+detail.gpg_id.toStdString().c_str()+")" + " authenticates one or more retroshare nodes.

    "; + + helptext += "

    " ; + if(detail.accept_connection) + helptext += tr("You have chosen to accept connections from Retroshare nodes signed by this key.") ; + else + helptext += tr("You are currently not allowing connections from Retroshare nodes signed by this key.") ; + + helptext += "

    " ; + + ui.userCertificateText_2->setToolTip(helptext) ; +} + + +void PGPKeyDialog::applyDialog() +{ + std::cerr << "PGPKeyDialog::applyDialog() called" << std::endl ; + RsPeerDetails detail; + if (!rsPeers->getPeerDetails(peerId, detail)) + { + if (!rsPeers->getGPGDetails(pgpId, detail)) { + QMessageBox::information(this, + tr("RetroShare"), + tr("Error : cannot get peer details.")); + close(); + return; + } + } + + //check the GPG trustlvl + if(ui.trustlevel_CB->currentIndex() != detail.trustLvl) + rsPeers->trustGPGCertificate(pgpId, ui.trustlevel_CB->currentIndex()); + + //setServiceFlags() ; + + loadAll(); + close(); +} + +void PGPKeyDialog::makeFriend() +{ + if (ui.signGPGKeyCheckBox->isChecked()) { + rsPeers->signGPGCertificate(pgpId); + } + + rsPeers->addFriend(peerId, pgpId); +// setServiceFlags() ; + loadAll(); + + emit configChanged(); +} + +void PGPKeyDialog::denyFriend() +{ + rsPeers->removeFriend(pgpId); + loadAll(); + + emit configChanged(); +} + +void PGPKeyDialog::signGPGKey() +{ + if (!rsPeers->signGPGCertificate(pgpId)) { + QMessageBox::warning ( NULL, + tr("Signature Failure"), + tr("Maybe password is wrong"), + QMessageBox::Ok); + } + loadAll(); + + emit configChanged(); +} + +/** Displays the help browser and displays the most recently viewed help + * topic. */ +void PGPKeyDialog::showHelpDialog() +{ + showHelpDialog("trust"); +} + +/**< Shows the help browser and displays the given help topic. */ +void PGPKeyDialog::showHelpDialog(const QString &topic) +{ + HelpBrowser::showWindow(topic); +} diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.h b/retroshare-gui/src/gui/connect/PGPKeyDialog.h new file mode 100644 index 000000000..b9188c6c5 --- /dev/null +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.h @@ -0,0 +1,88 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006, crypton + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + + +#pragma once + +#include + +#include "ui_PGPKeyDialog.h" +#include + +class PGPKeyDialog : public QDialog +{ + Q_OBJECT + +public: + enum enumPage { PageDetails=0x0 }; + + template static void showIt(const ID_CLASS& id, enumPage page) + { + PGPKeyDialog *confdialog = instance(id); + + switch (page) { + case PageDetails: + confdialog->ui.stabWidget->setCurrentIndex(0); + break; + } + + confdialog->load(); + confdialog->show(); + confdialog->raise(); + confdialog->activateWindow(); + + /* window will destroy itself! */ + } + static void loadAll(); + +signals: + void configChanged(); + +private: + /** Default constructor */ + PGPKeyDialog(const RsPeerId &id,const RsPgpId& pgp_id, QWidget *parent = 0, Qt::WindowFlags flags = 0); + /** Default destructor */ + ~PGPKeyDialog(); + + static PGPKeyDialog *instance(const RsPgpId &pgp_id); + + void load(); + +private slots: + void applyDialog(); + void makeFriend(); + void denyFriend(); + void signGPGKey(); + void loadKeyPage(); + //void setServiceFlags(); + + void showHelpDialog(); + /** Called when a child window requests the given help topic. */ + void showHelpDialog(const QString &topic); + +private: + RsPeerId peerId; + RsPgpId pgpId; + + /** Qt Designer generated object */ + Ui::PGPKeyDialog ui; +}; + diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.ui b/retroshare-gui/src/gui/connect/PGPKeyDialog.ui new file mode 100644 index 000000000..c05e63a63 --- /dev/null +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.ui @@ -0,0 +1,368 @@ + + + PGPKeyDialog + + + + 0 + 0 + 861 + 668 + + + + Dialog + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + + 0 + + + + PGP Key info + + + + + + + + + + PGP name : + + + + + + + true + + + + + + + Fingerprint : + + + + + + + true + + + + + + + Trust level: + + + true + + + + + + + + Unset + + + + :/images/security-low-off-48.png:/images/security-low-off-48.png + + + + + Unknown + + + + :/images/security-low-off-48.png:/images/security-low-off-48.png + + + + + No trust + + + + :/images/security-low-48.png:/images/security-low-48.png + + + + + Marginal + + + + :/images/security-medium-48.png:/images/security-medium-48.png + + + + + Full + + + + :/images/security-high-48.png:/images/security-high-48.png + + + + + Ultimate + + + + :/images/security-high-48.png:/images/security-high-48.png + + + + + + + + + + + + + 75 + true + + + + This key has signed my own PGP key + + + + + + + Key signatures : + + + + + + + + + + + + 6 + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Signing a friend's key is a way to express your trust into this friend, to your other friends. Besides, only signed peers will receive information about your other trusted friends.</p> +<p align="justify" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Signing a key cannot be undone, so do it wisely.</p></body></html> + + + Sign this PGP key + + + + :/images/view-certificate-sign-48.png:/images/view-certificate-sign-48.png + + + + 48 + 48 + + + + Qt::ToolButtonTextUnderIcon + + + + + + + Sign PGP key + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Deny connections + + + + :/images/user/deny_user48.png:/images/user/deny_user48.png + + + + 48 + 48 + + + + Qt::ToolButtonTextUnderIcon + + + + + + + Accept connections + + + + :/images/user/add_user48.png:/images/user/add_user48.png + + + + 48 + 48 + + + + false + + + false + + + Qt::ToolButtonTextUnderIcon + + + false + + + Qt::NoArrow + + + + + + + + + + ASCII format + + + + + + + 0 + 0 + + + + + + + + + + Include signatures + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + HeaderFrame + QFrame +
    gui/common/HeaderFrame.h
    + 1 +
    + + RSTextBrowser + QTextBrowser +
    gui/common/RSTextBrowser.h
    +
    +
    + + + + + + buttonBox + accepted() + PGPKeyDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + PGPKeyDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
    diff --git a/retroshare-gui/src/gui/elastic/node.cpp b/retroshare-gui/src/gui/elastic/node.cpp index 42e23e257..aabdab33c 100644 --- a/retroshare-gui/src/gui/elastic/node.cpp +++ b/retroshare-gui/src/gui/elastic/node.cpp @@ -50,7 +50,7 @@ #include #include -#include +#include #include #include "edge.h" @@ -354,15 +354,15 @@ void Node::peerDetails() #ifdef DEBUG_ELASTIC std::cerr << "Calling peer details" << std::endl; #endif - ConfCertDialog::showIt(_gpg_id, ConfCertDialog::PageDetails); + PGPKeyDialog::showIt(_gpg_id, PGPKeyDialog::PageDetails); } void Node::makeFriend() { - ConfCertDialog::showIt(_gpg_id, ConfCertDialog::PageTrust); + PGPKeyDialog::showIt(_gpg_id, PGPKeyDialog::PageDetails); } void Node::denyFriend() { - ConfCertDialog::showIt(_gpg_id, ConfCertDialog::PageTrust); + PGPKeyDialog::showIt(_gpg_id, PGPKeyDialog::PageDetails); } void Node::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index c90b9448c..512da5a74 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -29,6 +29,7 @@ #include "gui/msgs/MessageComposer.h" #include "gui/common/StatusDefs.h" #include "gui/connect/ConfCertDialog.h" +#include "gui/connect/PGPKeyDialog.h" #include "gui/connect/ConnectFriendWizard.h" #include "gui/common/AvatarDefs.h" #include "util/DateTime.h" @@ -374,7 +375,7 @@ void SecurityItem::peerDetails() /* then gpgid */ if (rsPeers->getGPGDetails(mGpgId, details)) { - ConfCertDialog::showIt(mGpgId, ConfCertDialog::PageDetails); + PGPKeyDialog::showIt(mGpgId, PGPKeyDialog::PageDetails); } } diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 86eb86c1d..72bf35fb2 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -406,6 +406,7 @@ HEADERS += rshare.h \ gui/chat/ChatUserNotify.h \ gui/chat/ChatLobbyUserNotify.h \ gui/connect/ConfCertDialog.h \ + gui/connect/PGPKeyDialog.h \ gui/msgs/MessageInterface.h \ gui/msgs/MessageComposer.h \ gui/msgs/MessageWindow.h \ @@ -590,6 +591,7 @@ FORMS += gui/StartDialog.ui \ gui/chat/CreateLobbyDialog.ui \ gui/ChatLobbyWidget.ui \ gui/connect/ConfCertDialog.ui \ + gui/connect/PGPKeyDialog.ui \ gui/connect/ConnectFriendWizard.ui \ gui/connect/ConnectProgressDialog.ui \ gui/msgs/MessageComposer.ui \ @@ -746,6 +748,7 @@ SOURCES += main.cpp \ gui/chat/ChatUserNotify.cpp \ gui/chat/ChatLobbyUserNotify.cpp \ gui/connect/ConfCertDialog.cpp \ + gui/connect/PGPKeyDialog.cpp \ gui/msgs/MessageComposer.cpp \ gui/msgs/MessageWidget.cpp \ gui/msgs/MessageWindow.cpp \