Merge pull request #21 from RetroShare/master

update to master
This commit is contained in:
defnax 2019-10-12 22:20:46 +02:00 committed by GitHub
commit 1ce3bd4f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 73 additions and 31 deletions

View File

@ -18,7 +18,7 @@ if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
:: Install needed things
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-libmicrohttpd mingw-w64-%RsMSYS2Architecture%-xapian-core"
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-libmicrohttpd mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson"
:: Plugins
if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg"

View File

@ -99,6 +99,7 @@ copy nul "%RsDeployPath%\portable" %Quite%
echo copy binaries
copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\RetroShare*.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
echo copy extensions
for /D %%D in ("%RsBuildPath%\plugins\*") do (
@ -127,6 +128,9 @@ if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" (
copy "%QtSharePath%\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite%
del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite%
for %%D in ("%RsDeployPath%\imageformats\*.dll") do (
call :copy_dependencies "%%D" "%RsDeployPath%"
)
echo copy qss
xcopy /S "%SourcePath%\retroshare-gui\src\qss" "%RsDeployPath%\qss" %Quite%

View File

@ -1074,26 +1074,22 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg
bool p3PeerMgrIMPL::addSslOnlyFriend(
const RsPeerId& sslId, const RsPgpId& pgp_id, const RsPeerDetails& dt )
{
if(sslId.isNull())
constexpr auto fname = __PRETTY_FUNCTION__;
const auto failure = [&](const std::string& err)
{
RsErr() << __PRETTY_FUNCTION__ << " Cannot add a null "
<< "ID as SSL-only friend " << std::endl;
RsErr() << fname << " " << err << std::endl;
return false;
}
};
if(sslId.isNull())
return failure("Cannot add a null ID as SSL-only friend");
if(pgp_id.isNull())
{
RsErr() << __PRETTY_FUNCTION__ << " Cannot add as SSL-only friend a "
<< "peer with null PGP" << std::endl;
return false;
}
return failure( " Cannot add as SSL-only friend a peer with null PGP");
if(sslId == getOwnId())
{
RsErr() << __PRETTY_FUNCTION__ << " Cannot add yourself as SSL-only "
<< "friend (id=" << sslId << ")" << std::endl;
return false;
}
return failure( "Cannot add yourself as SSL-only friend id:" +
sslId.toStdString() );
bool alreadySslFriend = false;
peerState pstate;
@ -1116,13 +1112,10 @@ bool p3PeerMgrIMPL::addSslOnlyFriend(
* 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;
}
return failure( "Cannot SSL-only friend for a pre-existing friend with "
"mismatching PGP-id known: " +
pstate.gpg_id.toStdString() + " new: " +
pgp_id.toStdString() );
/* It is very important to be expecially carefull setting
* pstate.skip_pgp_signature_validation to true because this effectively
@ -1137,8 +1130,11 @@ bool p3PeerMgrIMPL::addSslOnlyFriend(
* 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()->isPgpPubKeyAvailable(pgp_id))
* skipped and the attacker connection would be accepted.
* If the PGP key is available add it as full friend. */
if(AuthGPG::getAuthGPG()->isPgpPubKeyAvailable(pgp_id))
AuthGPG::getAuthGPG()->AllowConnection(pgp_id, true);
else
pstate.skip_pgp_signature_validation = true;
pstate.gpg_id = pgp_id;

View File

@ -2019,7 +2019,9 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
case RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION: // Chat lobby msgs are signed, so each time one comes, or a chat lobby event comes, a signature verificaiton happens.
{
ChatId id = ChatId(ChatLobbyId(u.mAdditionalId));
RetroShareLink l = RetroShareLink::createChatRoom(id, QString::fromStdString(id.toStdString()));
ChatLobbyInfo linfo ;
rsMsgs->getChatLobbyInfo(ChatLobbyId(u.mAdditionalId),linfo);
RetroShareLink l = RetroShareLink::createChatRoom(id, QString::fromUtf8(linfo.lobby_name.c_str()));
return tr("Message in chat room %1").arg(l.toHtml()) ;
}
case RsIdentityUsage::GLOBAL_ROUTER_SIGNATURE_CHECK: // Global router message validation

View File

@ -19,6 +19,7 @@
*******************************************************************************/
#include "gui/gxs/GxsCommentDialog.h"
#include "gui/gxs/GxsCommentTreeWidget.h"
#include "ui_GxsCommentDialog.h"
#include <iostream>
@ -50,6 +51,7 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, RsTokenService *token_servic
connect(ui->idChooser, SIGNAL(currentIndexChanged( int )), this, SLOT(voterSelectionChanged( int )));
connect(ui->idChooser, SIGNAL(idsLoaded()), this, SLOT(idChooserReady()));
connect(ui->commentButton, SIGNAL(clicked()), ui->treeWidget, SLOT(makeComment()));
connect(ui->sortBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sortComments(int)));
// default sort method "HOT".

View File

@ -40,6 +40,32 @@
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="toolBarHLayout">
<item>
<widget class="QToolButton" name="commentButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Comment</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/comment.png</normaloff>:/icons/png/comment.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="sortBox">
<property name="toolTip">

View File

@ -241,6 +241,11 @@ Rshare::Rshare(QStringList args, int &argc, char **argv, const QString &dir)
localServer= new QLocalServer();
QObject::connect(localServer, SIGNAL(newConnection()), this, SLOT(slotConnectionEstablished()));
updateLocalServer();
// clear out any old arguments (race condition?)
QSharedMemory newArgs;
newArgs.setKey(QString(TARGET) + "_newArgs");
if(newArgs.attach(QSharedMemory::ReadWrite))
newArgs.detach();
}
}
@ -325,20 +330,27 @@ Rshare::~Rshare()
*/
void Rshare::slotConnectionEstablished()
{
QLocalSocket *socket = localServer->nextPendingConnection();
socket->close();
delete socket;
QSharedMemory newArgs;
newArgs.setKey(QString(TARGET) + "_newArgs");
QLocalSocket *socket = localServer->nextPendingConnection();
if (!newArgs.attach())
{
std::cerr << "(EE) Rshare::slotConnectionEstablished() Unable to attach to shared memory segment."
<< newArgs.errorString().toStdString() << std::endl;
/* this is not an error. It just means we were notified to check
newArgs, but none had been set yet.
TODO: implement separate ping/take messages
std::cerr << "(EE) Rshare::slotConnectionEstablished() Unable to attach to shared memory segment."
<< newArgs.errorString().toStdString() << std::endl;
*/
socket->close();
delete socket;
return;
}
socket->close();
delete socket;
QBuffer buffer;
QDataStream in(&buffer);
QStringList args;