diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2009-11-02 16:13:26 +0100 |
|---|---|---|
| committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2009-11-02 16:13:26 +0100 |
| commit | f49a292783407c14869d811c05c2bbd009af27f7 (patch) | |
| tree | 5cf5e9544f6762bb67e94e195b882120a40bcf3f /libvncclient/tls.h | |
| parent | 67223b7c4d3411dbc5a311c7b66770f2ac9b7b83 (diff) | |
| parent | 29990f0090754c722653aafd3fc6800cebc1584c (diff) | |
| download | libtdevnc-f49a292783407c14869d811c05c2bbd009af27f7.tar.gz libtdevnc-f49a292783407c14869d811c05c2bbd009af27f7.zip | |
Merge branch 'VeNCrypt'
Diffstat (limited to 'libvncclient/tls.h')
| -rw-r--r-- | libvncclient/tls.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/libvncclient/tls.h b/libvncclient/tls.h new file mode 100644 index 0000000..48d159b --- /dev/null +++ b/libvncclient/tls.h @@ -0,0 +1,51 @@ +#ifndef TLS_H +#define TLS_H + +/* + * Copyright (C) 2009 Vic Lee. + * + * This 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 2 of the License, or + * (at your option) any later version. + * + * This software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +/* Handle Anonymous TLS Authentication (18) with the server. + * After authentication, client->tlsSession will be set. + */ +rfbBool HandleAnonTLSAuth(rfbClient* client); + +/* Handle VeNCrypt Authentication (19) with the server. + * The callback function GetX509Credential will be called. + * After authentication, client->tlsSession will be set. + */ +rfbBool HandleVeNCryptAuth(rfbClient* client); + +/* Read desired bytes from TLS session. + * It's a wrapper function over gnutls_record_recv() and return values + * are same as read(), that is, >0 for actual bytes read, 0 for EOF, + * or EAGAIN, EINTR. + * This should be a non-blocking call. Blocking is handled in sockets.c. + */ +int ReadFromTLS(rfbClient* client, char *out, unsigned int n); + +/* Write desired bytes to TLS session. + * It's a wrapper function over gnutls_record_send() and it will be + * blocking call, until all bytes are written or error returned. + */ +int WriteToTLS(rfbClient* client, char *buf, unsigned int n); + +/* Free TLS resources */ +void FreeTLS(rfbClient* client); + +#endif /* TLS_H */ |
