summaryrefslogtreecommitdiffstats
path: root/src/Net/Connection.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-08 03:50:42 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-08 03:50:42 +0200
commit87aad429d08b2a352f0f4345e45a03a0a7da2407 (patch)
tree2d1edba8fedbf8d6a77acb7223def7012437ce76 /src/Net/Connection.h
parent406510059972fdbfb14bc8985980f52c655d5946 (diff)
downloadmad-87aad429d08b2a352f0f4345e45a03a0a7da2407.tar
mad-87aad429d08b2a352f0f4345e45a03a0a7da2407.zip
GSSAPI-Authentifikation fertig
Diffstat (limited to 'src/Net/Connection.h')
-rw-r--r--src/Net/Connection.h16
1 files changed, 15 insertions, 1 deletions
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;}