diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2013-10-08 11:11:37 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-01-20 12:15:42 +0100 |
commit | 7ff743c43141739286aabcf08f3aa37e8e333a49 (patch) | |
tree | ce4a760112c5755db1f8e86d8788279b16d710c1 /server/reds_stream.h | |
parent | 9feed6940ffda3171883a366a48693e8df6c5338 (diff) | |
download | spice-7ff743c43141739286aabcf08f3aa37e8e333a49.tar.gz spice-7ff743c43141739286aabcf08f3aa37e8e333a49.tar.xz spice-7ff743c43141739286aabcf08f3aa37e8e333a49.zip |
Move SASL authentication to reds_stream.h
SASL authentication mostly use members from RedsStream to do its work, so
it makes sense to have its code in reds_stream.c. This should allow to make
RedsStream::sasl private in the future.
Diffstat (limited to 'server/reds_stream.h')
-rw-r--r-- | server/reds_stream.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/reds_stream.h b/server/reds_stream.h index fa41cbbd..cae244b2 100644 --- a/server/reds_stream.h +++ b/server/reds_stream.h @@ -115,6 +115,7 @@ ssize_t reds_stream_writev(RedsStream *s, const struct iovec *iov, int iovcnt); bool reds_stream_write_all(RedsStream *stream, const void *in_buf, size_t n); bool reds_stream_write_u8(RedsStream *s, uint8_t n); bool reds_stream_write_u32(RedsStream *s, uint32_t n); +void reds_stream_disable_writev(RedsStream *stream); void reds_stream_free(RedsStream *s); void reds_stream_push_channel_event(RedsStream *s, int event); @@ -123,4 +124,21 @@ RedsStream *reds_stream_new(int socket); RedsStreamSslStatus reds_stream_ssl_accept(RedsStream *stream); int reds_stream_enable_ssl(RedsStream *stream, SSL_CTX *ctx); +typedef enum { + REDS_SASL_ERROR_OK, + REDS_SASL_ERROR_GENERIC, + REDS_SASL_ERROR_INVALID_DATA, + REDS_SASL_ERROR_RETRY, + REDS_SASL_ERROR_CONTINUE, + REDS_SASL_ERROR_AUTH_FAILED +} RedsSaslError; + +RedsSaslError reds_sasl_handle_auth_step(RedsStream *stream, AsyncReadDone read_cb, void *opaque); +RedsSaslError reds_sasl_handle_auth_steplen(RedsStream *stream, AsyncReadDone read_cb, void *opaque); +RedsSaslError reds_sasl_handle_auth_start(RedsStream *stream, AsyncReadDone read_cb, void *opaque); +RedsSaslError reds_sasl_handle_auth_startlen(RedsStream *stream, AsyncReadDone read_cb, void *opaque); +bool reds_sasl_handle_auth_mechname(RedsStream *stream, AsyncReadDone read_cb, void *opaque); +bool reds_sasl_handle_auth_mechlen(RedsStream *stream, AsyncReadDone read_cb, void *opaque); +bool reds_sasl_start_auth(RedsStream *stream, AsyncReadDone read_cb, void *opaque); + #endif |