diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-08 03:50:42 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-08 03:50:42 +0200 |
commit | 87aad429d08b2a352f0f4345e45a03a0a7da2407 (patch) | |
tree | 2d1edba8fedbf8d6a77acb7223def7012437ce76 /src/Net | |
parent | 406510059972fdbfb14bc8985980f52c655d5946 (diff) | |
download | mad-87aad429d08b2a352f0f4345e45a03a0a7da2407.tar mad-87aad429d08b2a352f0f4345e45a03a0a7da2407.zip |
GSSAPI-Authentifikation fertig
Diffstat (limited to 'src/Net')
-rw-r--r-- | src/Net/Connection.cpp | 2 | ||||
-rw-r--r-- | src/Net/Connection.h | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp index 6a30d11..cfced4f 100644 --- a/src/Net/Connection.cpp +++ b/src/Net/Connection.cpp @@ -226,6 +226,8 @@ void Connection::doDisconnect() { delete peer; peer = 0; + authenticated = false; + state = DISCONNECTED; } diff --git a/src/Net/Connection.h b/src/Net/Connection.h index 21e8444..d733ee3 100644 --- a/src/Net/Connection.h +++ b/src/Net/Connection.h @@ -54,6 +54,8 @@ class Connection { sigc::signal<void,Connection*,const Packet&> signal; + bool authenticated; + void doHandshake(); void packetHeaderReceiveHandler(const void *data, unsigned long length); @@ -126,7 +128,7 @@ class Connection { } public: - Connection() : state(DISCONNECTED), peer(0) { + Connection() : state(DISCONNECTED), authenticated(false), peer(0) { transR.length = transR.transmitted = 0; transR.data = 0; @@ -157,6 +159,18 @@ class Connection { return (state == DISCONNECT || state == BYE); } + bool isAuthenticated() const {return authenticated;} + void setAuthenticated() {authenticated = true;} + + const gnutls_datum_t* getCertificate() { + return gnutls_certificate_get_ours(session); + } + + const gnutls_datum_t* getPeerCertificate() { + unsigned int n; + return gnutls_certificate_get_peers(session, &n); + } + const IPAddress* getPeer() {return peer;} int getSocket() const {return sock;} |