diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-02-11 04:04:28 +0100 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2011-07-21 15:09:27 +0300 |
commit | f42e261aa689af04b2af10a493b03242ff9cc873 (patch) | |
tree | ad59f6dde07cf5513817ce5a9cf3dfe0245b7d56 /server/reds.h | |
parent | 6101cb805ac1fc524f74a311e6cafafc0abc1982 (diff) | |
download | spice-f42e261aa689af04b2af10a493b03242ff9cc873.tar.gz spice-f42e261aa689af04b2af10a493b03242ff9cc873.tar.xz spice-f42e261aa689af04b2af10a493b03242ff9cc873.zip |
server: add SASL support
We introduce 2 public functions to integrate with the library user.
spice_server_set_sasl() - turn on SASL
spice_server_set_sasl_appname() - specify the name of the app (It is
used for where to find the default configuration file)
The patch for QEMU is on its way.
https://bugs.freedesktop.org/show_bug.cgi?id=34795
Conflicts:
server/reds.c
server/reds.h
Diffstat (limited to 'server/reds.h')
-rw-r--r-- | server/reds.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/server/reds.h b/server/reds.h index 3b2795d7..61ad6914 100644 --- a/server/reds.h +++ b/server/reds.h @@ -18,14 +18,49 @@ #ifndef _H_REDS #define _H_REDS +#include "mem.h" + #include <stdint.h> #include <openssl/ssl.h> #include <sys/uio.h> +#if HAVE_SASL +#include <sasl/sasl.h> +#endif + #define __visible__ __attribute__ ((visibility ("default"))) typedef struct RedsStream RedsStream; +#if HAVE_SASL +typedef struct RedsSASL { + sasl_conn_t *conn; + + /* If we want to negotiate an SSF layer with client */ + int wantSSF :1; + /* If we are now running the SSF layer */ + int runSSF :1; + + /* + * Buffering encoded data to allow more clear data + * to be stuffed onto the output buffer + */ + const uint8_t *encoded; + unsigned int encodedLength; + unsigned int encodedOffset; + + SpiceBuffer inbuffer; + + char *username; + char *mechlist; + char *mechname; + + /* temporary data during authentication */ + unsigned int len; + char *data; +} RedsSASL; +#endif + struct RedsStream { int socket; SpiceWatch *watch; @@ -35,6 +70,10 @@ struct RedsStream { int shutdown; SSL *ssl; +#if HAVE_SASL + RedsSASL sasl; +#endif + SpiceChannelEventInfo info; /* private */ |