diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-09-30 19:41:17 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-09-30 19:41:17 +0200 |
commit | 15253d1995ea49b114ef5c627e15b661dbd602b2 (patch) | |
tree | 1111441406a0b043f45ab19fe42e567be36d4d09 /distfoldd/serveragent.h | |
parent | c8f89279026af6bb03ef3d66e44e859fb7208925 (diff) | |
download | distfold-15253d1995ea49b114ef5c627e15b661dbd602b2.tar.gz distfold-15253d1995ea49b114ef5c627e15b661dbd602b2.zip |
add some trivial authentication
Diffstat (limited to 'distfoldd/serveragent.h')
-rw-r--r-- | distfoldd/serveragent.h | 10 |
1 files changed, 9 insertions, 1 deletions
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 |