diff options
author | Treeki <treeki@gmail.com> | 2014-02-15 10:01:21 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2014-02-15 10:01:21 +0100 |
commit | 878a0c157b772a7ed04d4cc395059087f964b823 (patch) | |
tree | 623ad18853c846b6498ebbc56eb436a792f32ad3 /bouncer/client.cpp | |
parent | 04cf34e30aa6541568660dfe9e77b2b2c0a9db88 (diff) | |
download | bounce4-878a0c157b772a7ed04d4cc395059087f964b823.tar.gz bounce4-878a0c157b772a7ed04d4cc395059087f964b823.zip |
implement rudimentary password authentication
Diffstat (limited to '')
-rw-r--r-- | bouncer/client.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bouncer/client.cpp b/bouncer/client.cpp index 79e97a2..ab133b6 100644 --- a/bouncer/client.cpp +++ b/bouncer/client.cpp @@ -150,10 +150,14 @@ void Client::handlePacket(Packet::Type type, char *data, int size) { uint32_t lastReceivedByClient = pkt.readU32(); + char pwBuf[512] = ""; + pkt.readStr(pwBuf, sizeof(pwBuf)); + if (strcmp(pwBuf, netCore->bouncerPassword.c_str()) != 0) + error = 3; + if (!pkt.readRemains(SESSION_KEY_SIZE)) error = 2; - // Authentication goes here at some point, too if (error != 0) { |