From: Simon Waterman <watermansrdev@gmail.com>
To: xen-devel@lists.xen.org
Cc: dunlapg@umich.edu, ian.jackson@eu.citrix.com,
Simon Waterman <watermansrdev@gmail.com>
Subject: [PATCH RFC 2/6] qemu-xen-trad: sasl: define SASL auth API
Date: Tue, 16 May 2017 00:03:39 +0100 [thread overview]
Message-ID: <1494889423-4212-3-git-send-email-watermansrdev@gmail.com> (raw)
In-Reply-To: <1494889423-4212-1-git-send-email-watermansrdev@gmail.com>
Add the SASL auth API to hook into vnc.c. Taken from upstream
with minor changes to remove ACL support, which isn't in
qemu-xen-traditional yet.
Signed-off-by: Simon Waterman <watermansrdev@gmail.com>
---
vnc-auth-sasl.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 vnc-auth-sasl.h
diff --git a/vnc-auth-sasl.h b/vnc-auth-sasl.h
new file mode 100644
index 0000000..42a049f
--- /dev/null
+++ b/vnc-auth-sasl.h
@@ -0,0 +1,67 @@
+/*
+ * QEMU VNC display driver: SASL auth protocol
+ *
+ * Copyright (C) 2009 Red Hat, Inc
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+
+#ifndef __QEMU_VNC_AUTH_SASL_H__
+#define __QEMU_VNC_AUTH_SASL_H__
+
+
+#include <sasl/sasl.h>
+
+typedef struct VncStateSASL VncStateSASL;
+
+struct VncStateSASL {
+ sasl_conn_t *conn;
+ /* If we want to negotiate an SSF layer with client */
+ bool wantSSF;
+ /* If we are now running the SSF layer */
+ bool runSSF;
+ /*
+ * If this is non-zero, then wait for that many bytes
+ * to be written plain, before switching to SSF encoding
+ * This allows the VNC auth result to finish being
+ * written in plain.
+ */
+ unsigned int waitWriteSSF;
+
+ /*
+ * 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;
+ char *username;
+ char *mechlist;
+};
+
+void vnc_sasl_client_cleanup(VncState *vs);
+
+long vnc_client_read_sasl(VncState *vs);
+long vnc_client_write_sasl(VncState *vs);
+
+void start_auth_sasl(VncState *vs);
+
+#endif /* __QEMU_VNC_AUTH_SASL_H__ */
+
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-05-15 23:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 23:03 [PATCH RFC 0/6] qemu-xen-trad: sasl: add SASL support to VNC Simon Waterman
2017-05-15 23:03 ` [PATCH RFC 1/6] qemu-xen-trad: sasl: expose vnc API to SASL auth Simon Waterman
2017-05-15 23:03 ` Simon Waterman [this message]
2017-05-15 23:03 ` [PATCH RFC 3/6] qemu-xen-trad: sasl: implement " Simon Waterman
2017-05-15 23:03 ` [PATCH RFC 4/6] qemu-xen-trad: sasl: compatibility with vnc.h Simon Waterman
2017-05-15 23:03 ` [PATCH RFC 5/6] qemu-xen-trad: sasl: introduce SASL authentication and encryption layer Simon Waterman
2017-05-15 23:03 ` [PATCH RFC 6/6] qemu-xen-trad: sasl: add SASL option at build time Simon Waterman
2017-05-16 13:11 ` [PATCH RFC 0/6] qemu-xen-trad: sasl: add SASL support to VNC George Dunlap
2017-05-16 13:16 ` Ian Jackson
2017-05-16 13:19 ` George Dunlap
2017-05-16 13:28 ` Ian Jackson
2017-05-17 18:49 ` Simon Waterman
2017-05-18 14:43 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494889423-4212-3-git-send-email-watermansrdev@gmail.com \
--to=watermansrdev@gmail.com \
--cc=dunlapg@umich.edu \
--cc=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).