aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-21 10:09:54 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-21 10:09:57 +0200
commitc1c7daea00058fc20b85fd1628bb35ddd7bcef23 (patch)
treec467150f42c7760dbe364bee63edb17372f5a52d /include
parent2cce75647741093d99eee670b98042fdfa7608fa (diff)
Prevent malicious peer from replaying user ping
Diffstat (limited to 'include')
-rw-r--r--include/Channel.hpp4
-rw-r--r--include/User.hpp3
2 files changed, 3 insertions, 4 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp
index 28d174b..26b5286 100644
--- a/include/Channel.hpp
+++ b/include/Channel.hpp
@@ -63,12 +63,12 @@ namespace dchat
void update();
// Returns 0 if we are offline
- u64 getSyncedTimestampUtcCombined();
+ u32 getSyncedTimestampUtcInSec();
static void setCurrent(Channel *channel);
static Channel* getCurrent();
private:
- void sendPing(u32 pingCounter, u64 pingTimestamp);
+ void sendPing(u32 pingTimestampSec);
protected:
odhtdb::Database *database;
odhtdb::DatabaseNode databaseNodeInfo;
diff --git a/include/User.hpp b/include/User.hpp
index ac08e36..c2874c2 100644
--- a/include/User.hpp
+++ b/include/User.hpp
@@ -38,8 +38,7 @@ namespace dchat
bool isOnlineUser() const override { return true; }
std::string name;
- u32 pingCounter;
- u64 pingTimestamp;
+ u32 pingTimestampSec;
};
class OnlineRemoteUser : public OnlineUser