diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-17 15:54:24 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-17 15:54:24 -0500 |
commit | 0e11c4ce6d21acd0139345c19b6341971e679b23 (patch) | |
tree | 361adc3f2312984ba2fbf2e3189e41a55d292648 /servers/auth_server_lin/src/auth_conn.h | |
parent | 2c6c71334b9a5a9ee9211e4b389a239273642313 (diff) | |
download | ulab-0e11c4ce6d21acd0139345c19b6341971e679b23.tar.gz ulab-0e11c4ce6d21acd0139345c19b6341971e679b23.zip |
Write initial SASL/GSSAPI Kerberos classes and server code
Diffstat (limited to 'servers/auth_server_lin/src/auth_conn.h')
-rw-r--r-- | servers/auth_server_lin/src/auth_conn.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/servers/auth_server_lin/src/auth_conn.h b/servers/auth_server_lin/src/auth_conn.h new file mode 100644 index 0000000..9b4e28e --- /dev/null +++ b/servers/auth_server_lin/src/auth_conn.h @@ -0,0 +1,89 @@ +/* + * Remote Laboratory Authentication Server + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (c) 2012 Timothy Pearson + * Raptor Engineering + * http://www.raptorengineeringinc.com + */ + +#include <tqsocket.h> +#include <tqserversocket.h> +#include <tqapplication.h> +#include <tqvbox.h> +#include <tqtextview.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtextstream.h> + +#include <sasl.h> +#include <saslplug.h> +#include <saslutil.h> + +class AuthSocket : public TQSocket +{ + Q_OBJECT + + public: + AuthSocket(int sock, TQObject *parent=0, const char *name=0); + ~AuthSocket(); + + public: + void close(); + int initiateKerberosHandshake(); + + private: + void free_conn(void); + void send_sasl_data_to_network(const char *buffer, unsigned length, int netfd); + unsigned int get_sasl_data_from_network(char *buf); + int write_data_to_client(int fd, const char* readbuf, int cc); + int receive_data_from_client(char *buf, int netfd); + int authenticate_connection_with_kerberos(int netfd); + + sasl_callback_t callbacks[]; + + private slots: + void connectionClosedHandler(); + + private: + char *iplocal; + char *ipremote; + char *searchpath; + const char *service; + char *localdomain; + char *userdomain; + sasl_conn_t *conn; + + private: + int line; + TQString m_remoteHost; + + friend class AuthServer; +}; + +class AuthServer : public TQServerSocket +{ + Q_OBJECT + public: + AuthServer(TQObject* parent=0); + ~AuthServer(); + + void newConnection(int socket); + + signals: + void newConnect(AuthSocket*); + +};
\ No newline at end of file |