security: Temporarily disable security chatroom
Change-Id: I0e3a817a5bf65d07fc609084aaab8572a70e6784
diff --git a/src/chat-dialog.cpp b/src/chat-dialog.cpp
index 334f345..f2bdf86 100644
--- a/src/chat-dialog.cpp
+++ b/src/chat-dialog.cpp
@@ -26,6 +26,8 @@
#include "cryptopp.hpp"
#include <queue>
#include "logging.h"
+
+#define SECURITY_ENABLED false
#endif
@@ -102,7 +104,9 @@
m_identity =
IdentityCertificate::certificateNameToPublicKeyName(m_myCertificate.getName()).getPrefix(-1);
+
updatePrefix();
+
updateLabels();
m_scene->setCurrentPrefix(QString(m_localChatPrefix.toUri().c_str()));
@@ -169,11 +173,13 @@
ChatDialog::~ChatDialog()
{
- if (m_certListPrefixId)
- m_face->unsetInterestFilter(m_certListPrefixId);
+ if (SECURITY_ENABLED) {
+ if (m_certListPrefixId)
+ m_face->unsetInterestFilter(m_certListPrefixId);
- if (m_certSinglePrefixId)
- m_face->unsetInterestFilter(m_certSinglePrefixId);
+ if (m_certSinglePrefixId)
+ m_face->unsetInterestFilter(m_certSinglePrefixId);
+ }
if (m_sock != NULL) {
sendLeave();
@@ -286,22 +292,25 @@
m_certSinglePrefix.append(m_identity).append("CHRONOCHAT-CERT-SINGLE").append(m_chatroomName);
m_localChatPrefix.append(m_chatPrefix);
- if (m_certListPrefixId)
- m_face->unsetInterestFilter(m_certListPrefixId);
+ if (SECURITY_ENABLED) {
+ if (static_cast<bool>(m_certListPrefixId))
+ m_face->unsetInterestFilter(m_certListPrefixId);
- m_certListPrefixId = m_face->setInterestFilter(m_certListPrefix,
- bind(&ChatDialog::onCertListInterest,
- this, _1, _2),
- bind(&ChatDialog::onCertListRegisterFailed,
- this, _1, _2));
-
- if (m_certSinglePrefixId)
- m_face->unsetInterestFilter(m_certSinglePrefixId);
- m_certSinglePrefixId = m_face->setInterestFilter(m_certSinglePrefix,
- bind(&ChatDialog::onCertSingleInterest,
+ m_certListPrefixId = m_face->setInterestFilter(m_certListPrefix,
+ bind(&ChatDialog::onCertListInterest,
this, _1, _2),
- bind(&ChatDialog::onCertSingleRegisterFailed,
+ bind(&ChatDialog::onCertListRegisterFailed,
this, _1, _2));
+
+ if (static_cast<bool>(m_certSinglePrefixId))
+ m_face->unsetInterestFilter(m_certSinglePrefixId);
+
+ m_certSinglePrefixId = m_face->setInterestFilter(m_certSinglePrefix,
+ bind(&ChatDialog::onCertSingleInterest,
+ this, _1, _2),
+ bind(&ChatDialog::onCertSingleRegisterFailed,
+ this, _1, _2));
+ }
}
void
@@ -554,7 +563,7 @@
void
ChatDialog::onCertListRegisterFailed(const ndn::Name& prefix, const std::string& msg)
{
- // _LOG_DEBUG("ChatDialog::onCertListRegisterFailed failed: " + msg);
+ _LOG_DEBUG("ChatDialog::onCertListRegisterFailed failed: " + msg);
}
void
@@ -577,7 +586,7 @@
void
ChatDialog::onCertSingleRegisterFailed(const Name& prefix, const std::string& msg)
{
- // _LOG_DEBUG("ChatDialog::onCertListRegisterFailed failed: " + msg);
+ _LOG_DEBUG("ChatDialog::onCertListRegisterFailed failed: " + msg);
}
void
@@ -1123,7 +1132,7 @@
void
ChatDialog::onProcessTreeUpdate(const vector<Sync::MissingDataInfo>& v)
{
- // _LOG_DEBUG("<<< processing Tree Update");
+ _LOG_DEBUG("<<< processing Tree Update");
if (v.empty()) {
return;
@@ -1145,7 +1154,7 @@
if (totalMissingPackets < 4) {
for (Sync::SeqNo seq = v[i].low; seq <= v[i].high; ++seq) {
m_sock->fetchData(v[i].prefix, seq, bind(&ChatDialog::processDataWrapper, this, _1), 2);
- // _LOG_DEBUG("<<< Fetching " << v[i].prefix << "/" <<seq.getSession() <<"/" << seq.getSeq());
+ _LOG_DEBUG("<<< Fetching " << v[i].prefix << "/" <<seq.getSession() <<"/" << seq.getSeq());
}
}
else {
diff --git a/src/start-chat-dialog.cpp b/src/start-chat-dialog.cpp
index 1f4ace0..52ec3a1 100644
--- a/src/start-chat-dialog.cpp
+++ b/src/start-chat-dialog.cpp
@@ -40,7 +40,8 @@
StartChatDialog::onOkClicked()
{
QString chatroom = ui->chatroomInput->text();
- bool secured = ui->withSecurity->isChecked();
+ bool secured = false;
+ // bool secured = ui->withSecurity->isChecked();
emit startChatroom(chatroom, secured);
this->close();
}
diff --git a/src/start-chat-dialog.ui b/src/start-chat-dialog.ui
index ced5bf5..3df9786 100644
--- a/src/start-chat-dialog.ui
+++ b/src/start-chat-dialog.ui
@@ -13,20 +13,7 @@
<property name="windowTitle">
<string>Dialog</string>
</property>
- <widget class="QCheckBox" name="withSecurity">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>40</y>
- <width>480</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>with security</string>
- </property>
- </widget>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
@@ -54,7 +41,7 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>