From 87aad429d08b2a352f0f4345e45a03a0a7da2407 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Sep 2008 03:50:42 +0200 Subject: GSSAPI-Authentifikation fertig --- src/Net/Connection.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/Net/Connection.h') 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 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;} -- cgit v1.2.3