diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index a5de6755f..70f3fb6be 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -37,6 +37,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent) ui.setupUi(this); connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup())); + connect(ui.hidden_checkbox, SIGNAL(clicked()), this, SLOT(hiddenUiSetup())); connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson())); connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity())); @@ -115,6 +116,7 @@ void GenCertDialog::init() ui.headerLabel2->setText(text); newGPGKeyGenUiSetup(); + hiddenUiSetup(); } void GenCertDialog::newGPGKeyGenUiSetup() { @@ -153,6 +155,28 @@ void GenCertDialog::newGPGKeyGenUiSetup() { } } + +void GenCertDialog::hiddenUiSetup() +{ + + if (ui.hidden_checkbox->isChecked()) + { + ui.hiddenaddr_input->show(); + ui.hiddenaddr_label->show(); + ui.label_hiddenaddr2->show(); + ui.hiddenport_label->show(); + ui.hiddenport_spinBox->show(); + } + else + { + ui.hiddenaddr_input->hide(); + ui.hiddenaddr_label->hide(); + ui.label_hiddenaddr2->hide(); + ui.hiddenport_label->hide(); + ui.hiddenport_spinBox->hide(); + } +} + void GenCertDialog::exportIdentity() { QString fname = QFileDialog::getSaveFileName(this,tr("Export Identity"), "",tr("RetroShare Identity files (*.asc)")) ; @@ -203,6 +227,21 @@ void GenCertDialog::genPerson() std::string genLoc = ui.location_input->text().toUtf8().constData(); std::string PGPId; + if (ui.hidden_checkbox->isChecked()) + { + std::string hl = ui.hiddenaddr_input->text().toStdString(); + uint16_t port = ui.hiddenport_spinBox->value(); + if (!RsInit::SetHiddenLocation(hl, port)) /* parses it */ + { + /* Message Dialog */ + QMessageBox::warning(this, + tr("Invalid Hidden Location"), + tr("Please put in a valid address of the form: 31769173498.onion:7800"), + QMessageBox::Ok); + return; + } + } + if (!genNewGPGKey) { if (genLoc.length() < 3) { /* Message Dialog */ diff --git a/retroshare-gui/src/gui/GenCertDialog.h b/retroshare-gui/src/gui/GenCertDialog.h index 0cb3e2194..7650d9c9a 100644 --- a/retroshare-gui/src/gui/GenCertDialog.h +++ b/retroshare-gui/src/gui/GenCertDialog.h @@ -37,6 +37,7 @@ private slots: void importIdentity(); void exportIdentity(); void newGPGKeyGenUiSetup(); + void hiddenUiSetup(); private: void init(); diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui index 2ed55871f..0500f2b99 100644 --- a/retroshare-gui/src/gui/GenCertDialog.ui +++ b/retroshare-gui/src/gui/GenCertDialog.ui @@ -6,8 +6,8 @@ 0 0 - 664 - 474 + 618 + 641 @@ -32,8 +32,8 @@ 30 - - + + @@ -48,23 +48,10 @@ - + - - - - - Qt::Vertical - - - - 1 - 1 - - - - - + + It looks like you don't own any profile (PGP keys). Please fill in the form below to create one, or import an existing profile. @@ -74,117 +61,7 @@ - - - - Your profile is associated with a PGP key. RetroShare currently ignores DSA keys. - - - - - - - Name - - - - - - - Enter your nickname here - - - 64 - - - - - - - This Password is for PGP - - - Password - - - - - - - Put a strong password here. This password protects your PGP key. - - - - - - 1024 - - - QLineEdit::Password - - - - - - - Location - - - - - - - 64 - - - - - - - - 0 - 30 - - - - 1 - - - Put a meaningful location. ex : home, laptop, etc. This field will be used to differentiate different installations with the same identity (PGP key). - - - false - - - true - - - - - - - - 16777215 - 26 - - - - Create new identity - - - - :/images/contact_new.png:/images/contact_new.png - - - - - - - Use identity - - - - + 6 @@ -253,6 +130,37 @@ + + + + Use identity + + + + + + + Your profile is associated with a PGP key. RetroShare currently ignores DSA keys. + + + + + + + Name + + + + + + + Enter your nickname here + + + 64 + + + @@ -260,7 +168,7 @@ - + Be careful: this email will be visible to your friends and friends @@ -272,6 +180,183 @@ anonymous, you can use a fake email. + + + + This Password is for PGP + + + Password + + + + + + + Put a strong password here. This password protects your PGP key. + + + + + + 1024 + + + QLineEdit::Password + + + + + + + Location + + + + + + + 64 + + + + + + + + 0 + 30 + + + + 1 + + + Put a meaningful location. ex : home, laptop, etc. This field will be used to differentiate different installations with the same identity (PGP key). + + + false + + + true + + + + + + + + 16777215 + 32 + + + + Your profile is associated with a PGP key + + + Create a Hidden Location. + + + + :/images/contact_new128.png:/images/contact_new128.png + + + + 32 + 32 + + + + false + + + + + + + Tor Address + + + + + + + 64 + + + + + + + Port + + + + + + + 1 + + + 65535 + + + 7812 + + + + + + + + 0 + 30 + + + + 1 + + + This is a TOR Onion address of the form: xa76giaf6ifda7ri63i263.onion and your selected port, you must first launch TOR and create a new hidden service to generate this address. + + + false + + + true + + + + + + + + 16777215 + 26 + + + + Create new identity + + + + :/images/contact_new.png:/images/contact_new.png + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index 593a609d6..aa5b41c2b 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -213,15 +213,29 @@ void ConfCertDialog::load() else ui.crypto_info->setText(tr("Not connected")) ; - /* set local address */ - ui.localAddress->setText(QString::fromStdString(detail.localAddr)); - ui.localPort -> setValue(detail.localPort); - /* set the server address */ - ui.extAddress->setText(QString::fromStdString(detail.extAddr)); - ui.extPort -> setValue(detail.extPort); - - ui.dynDNS->setText(QString::fromStdString(detail.dyndns)); + if (detail.isHiddenNode) + { + /* set local address */ + ui.localAddress->setText("hidden"); + ui.localPort -> setValue(0); + /* set the server address */ + ui.extAddress->setText("hidden"); + ui.extPort -> setValue(0); + ui.dynDNS->setText(QString::fromStdString(detail.hiddenNodeAddress)); + } + else + { + /* set local address */ + ui.localAddress->setText(QString::fromStdString(detail.localAddr)); + ui.localPort -> setValue(detail.localPort); + /* set the server address */ + ui.extAddress->setText(QString::fromStdString(detail.extAddr)); + ui.extPort -> setValue(detail.extPort); + + ui.dynDNS->setText(QString::fromStdString(detail.dyndns)); + } + ui.statusline->setText(StatusDefs::connectStateString(detail)); ui.ipAddressList->clear(); diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 35cd794b7..211be996f 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -621,23 +621,33 @@ void ConnectFriendWizard::accept() rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id,serviceFlags()) ; runProgressDialog = true; - //let's check if there is ip adresses in the wizard. - if (!peerDetails.extAddr.empty() && peerDetails.extPort) { - std::cerr << "ConnectFriendWizard::accept() : setting ip ext address." << std::endl; - rsPeers->setExtAddress(peerDetails.id, peerDetails.extAddr, peerDetails.extPort); - } - if (!peerDetails.localAddr.empty() && peerDetails.localPort) { - std::cerr << "ConnectFriendWizard::accept() : setting ip local address." << std::endl; - rsPeers->setLocalAddress(peerDetails.id, peerDetails.localAddr, peerDetails.localPort); - } - if (!peerDetails.dyndns.empty()) { - std::cerr << "ConnectFriendWizard::accept() : setting DynDNS." << std::endl; - rsPeers->setDynDNS(peerDetails.id, peerDetails.dyndns); - } if (!peerDetails.location.empty()) { std::cerr << "ConnectFriendWizard::accept() : setting peerLocation." << std::endl; rsPeers->setLocation(peerDetails.id, peerDetails.location); } + + if (peerDetails.isHiddenNode) + { + std::cerr << "ConnectFriendWizard::accept() : setting hidden node." << std::endl; + rsPeers->setHiddenNode(peerDetails.id, peerDetails.hiddenNodeAddress); + } + else + { + //let's check if there is ip adresses in the wizard. + if (!peerDetails.extAddr.empty() && peerDetails.extPort) { + std::cerr << "ConnectFriendWizard::accept() : setting ip ext address." << std::endl; + rsPeers->setExtAddress(peerDetails.id, peerDetails.extAddr, peerDetails.extPort); + } + if (!peerDetails.localAddr.empty() && peerDetails.localPort) { + std::cerr << "ConnectFriendWizard::accept() : setting ip local address." << std::endl; + rsPeers->setLocalAddress(peerDetails.id, peerDetails.localAddr, peerDetails.localPort); + } + if (!peerDetails.dyndns.empty()) { + std::cerr << "ConnectFriendWizard::accept() : setting DynDNS." << std::endl; + rsPeers->setDynDNS(peerDetails.id, peerDetails.dyndns); + } + } + } if (runProgressDialog) diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index 005e4137b..b26fcf176 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -147,6 +147,10 @@ void ServerPage::load() int netIndex = 0; switch(detail.netMode) { + case RS_NETMODE_HIDDEN: + netIndex = 3; + ui.netModeComboBox->setEnabled(false); + break; case RS_NETMODE_EXT: netIndex = 2; break; diff --git a/retroshare-gui/src/gui/settings/ServerPage.ui b/retroshare-gui/src/gui/settings/ServerPage.ui index 96d13bc59..c3ddbdd4a 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.ui +++ b/retroshare-gui/src/gui/settings/ServerPage.ui @@ -43,6 +43,11 @@ Manually Forwarded Port + + + Hidden Node + + @@ -369,8 +374,6 @@ behind a firewall or a VPN. showDiscStatusBar allowIpDeterminationCB IPServersLV - textlabel_ext - textlabel_netLimited ipAddressList label_7