diff options
Diffstat (limited to 'src/Net/Connection.h')
-rw-r--r-- | src/Net/Connection.h | 16 |
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;} |