mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added one flag for requiring whitelist clearance before connect. Added GUI checkboxes to set it. Still needs the IP in connect wizard.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8339 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8e0be294ee
commit
ab62eaee32
@ -78,8 +78,9 @@ const uint32_t RS_PEER_STATE_UNREACHABLE= 0x0008;
|
|||||||
const ServicePermissionFlags RS_NODE_PERM_NONE ( 0x00000000 ) ;// 0x1, 0x2 and Ox4 are deprecated.
|
const ServicePermissionFlags RS_NODE_PERM_NONE ( 0x00000000 ) ;// 0x1, 0x2 and Ox4 are deprecated.
|
||||||
const ServicePermissionFlags RS_NODE_PERM_DIRECT_DL ( 0x00000008 ) ;// Accept to directly DL from this peer (breaks anonymity)
|
const ServicePermissionFlags RS_NODE_PERM_DIRECT_DL ( 0x00000008 ) ;// Accept to directly DL from this peer (breaks anonymity)
|
||||||
const ServicePermissionFlags RS_NODE_PERM_ALLOW_PUSH ( 0x00000010 ) ;// Auto-DL files recommended by this peer
|
const ServicePermissionFlags RS_NODE_PERM_ALLOW_PUSH ( 0x00000010 ) ;// Auto-DL files recommended by this peer
|
||||||
const ServicePermissionFlags RS_NODE_PERM_DEFAULT = RS_NODE_PERM_DIRECT_DL ;
|
const ServicePermissionFlags RS_NODE_PERM_REQUIRE_WL ( 0x00000020 ) ;// Require white list clearance for connection
|
||||||
const ServicePermissionFlags RS_NODE_PERM_ALL = RS_NODE_PERM_DIRECT_DL | RS_NODE_PERM_ALLOW_PUSH;
|
const ServicePermissionFlags RS_NODE_PERM_DEFAULT = RS_NODE_PERM_DIRECT_DL | RS_NODE_PERM_REQUIRE_WL;
|
||||||
|
const ServicePermissionFlags RS_NODE_PERM_ALL = RS_NODE_PERM_DIRECT_DL | RS_NODE_PERM_ALLOW_PUSH | RS_NODE_PERM_REQUIRE_WL;
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@ ServicePermissionDialog::ServicePermissionDialog() :
|
|||||||
mColumns[column] = RS_NODE_PERM_DIRECT_DL;
|
mColumns[column] = RS_NODE_PERM_DIRECT_DL;
|
||||||
column = ui->servicePermissionList->addColumn(tr("Auto-download recommended files"));
|
column = ui->servicePermissionList->addColumn(tr("Auto-download recommended files"));
|
||||||
mColumns[column] = RS_NODE_PERM_ALLOW_PUSH;
|
mColumns[column] = RS_NODE_PERM_ALLOW_PUSH;
|
||||||
|
column = ui->servicePermissionList->addColumn(tr("Require whitelist"));
|
||||||
|
mColumns[column] = RS_NODE_PERM_REQUIRE_WL;
|
||||||
|
|
||||||
ui->servicePermissionList->start();
|
ui->servicePermissionList->start();
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,7 @@ void ConfCertDialog::setServiceFlags()
|
|||||||
|
|
||||||
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_NODE_PERM_DIRECT_DL ;
|
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 ;
|
if( ui._allow_push_CB->isChecked()) flags = flags | RS_NODE_PERM_ALLOW_PUSH ;
|
||||||
|
if( ui._require_WL_CB->isChecked()) flags = flags | RS_NODE_PERM_REQUIRE_WL ;
|
||||||
|
|
||||||
rsPeers->setServicePermissionFlags(pgpId,flags) ;
|
rsPeers->setServicePermissionFlags(pgpId,flags) ;
|
||||||
}
|
}
|
||||||
@ -162,6 +163,7 @@ void ConfCertDialog::load()
|
|||||||
|
|
||||||
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ;
|
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._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
|
||||||
|
ui._require_WL_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_REQUIRE_WL) ;
|
||||||
|
|
||||||
//ui.pgpfingerprint->setText(QString::fromUtf8(detail.name.c_str()));
|
//ui.pgpfingerprint->setText(QString::fromUtf8(detail.name.c_str()));
|
||||||
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="stabWidget">
|
<widget class="QTabWidget" name="stabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
@ -445,7 +445,7 @@
|
|||||||
<string>Options</string>
|
<string>Options</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<spacer name="verticalSpacer_4">
|
<spacer name="verticalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -475,6 +475,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="_require_WL_CB">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by &quot;security feed items&quot; in the News Feed section. From there, you can whitelist/blacklist their IP.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Require white list clearance</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -258,6 +258,7 @@ void ConnectFriendWizard::initializePage(int id)
|
|||||||
|
|
||||||
ui->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_DIRECT_DL) ;
|
ui->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_DIRECT_DL) ;
|
||||||
ui->_allow_push_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
|
ui->_allow_push_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
|
||||||
|
ui->_require_WL_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_REQUIRE_WL) ;
|
||||||
|
|
||||||
RsPeerDetails tmp_det ;
|
RsPeerDetails tmp_det ;
|
||||||
bool already_in_keyring = rsPeers->getGPGDetails(peerDetails.gpg_id, tmp_det) ;
|
bool already_in_keyring = rsPeers->getGPGDetails(peerDetails.gpg_id, tmp_det) ;
|
||||||
@ -623,9 +624,11 @@ ServicePermissionFlags ConnectFriendWizard::serviceFlags() const
|
|||||||
{
|
{
|
||||||
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
|
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
|
||||||
if( ui->_allow_push_CB->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
|
if( ui->_allow_push_CB->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
|
||||||
|
if( ui->_require_WL_CB->isChecked()) flags |= RS_NODE_PERM_REQUIRE_WL ;
|
||||||
} else if (hasVisitedPage(Page_Conclusion)) {
|
} else if (hasVisitedPage(Page_Conclusion)) {
|
||||||
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
|
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
|
||||||
if( ui->_allow_push_CB_2->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
|
if( ui->_allow_push_CB_2->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
|
||||||
|
if( ui->_require_WL_CB_2->isChecked()) flags |= RS_NODE_PERM_REQUIRE_WL ;
|
||||||
}
|
}
|
||||||
return flags ;
|
return flags ;
|
||||||
}
|
}
|
||||||
|
@ -694,6 +694,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="_require_WL_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Require whitelist clearance to connect</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_5">
|
<spacer name="verticalSpacer_5">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -1020,6 +1027,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="_require_WL_CB_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Require whitelist clearance to connect</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user