From 15253d1995ea49b114ef5c627e15b661dbd602b2 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 30 Sep 2012 19:41:17 +0200 Subject: add some trivial authentication --- distfoldd/serveragent.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'distfoldd/serveragent.h') diff --git a/distfoldd/serveragent.h b/distfoldd/serveragent.h index c692e60..b5fd380 100644 --- a/distfoldd/serveragent.h +++ b/distfoldd/serveragent.h @@ -7,17 +7,25 @@ class ServerAgent : public Agent { Q_OBJECT public: - explicit ServerAgent(QSslSocket *socket, const QDir& local_dir, SyncFlags flags, QObject *parent = 0); + explicit ServerAgent(QSslSocket *socket, const QDir& local_dir, const QString& passwd, SyncFlags flags, QObject *parent = 0); protected: void handleMessage(MessageType msg, const QByteArray& data); private: + bool checkAuth(); + void handleAuth(const QByteArray& response); void handleClientFileList(const RemoteFileInfoList& list); void handlePullFile(const QString& path); void handlePushedFile(const QByteArray& data); void handlePushedMetadata(const RemoteFileInfoList& list); void handleDeleteFile(const QString& path); + +private: + QByteArray _challenge; + QByteArray _clientChallenge; + bool _authAttempted; + bool _authOk; }; #endif // SERVERAGENT_H -- cgit v1.2.3