root / vnc-auth-sasl.h @ bc578fe0
History | View | Annotate | Download (2.3 kB)
1 | 2f9606b3 | aliguori | /*
|
---|---|---|---|
2 | 2f9606b3 | aliguori | * QEMU VNC display driver: SASL auth protocol
|
3 | 2f9606b3 | aliguori | *
|
4 | 2f9606b3 | aliguori | * Copyright (C) 2009 Red Hat, Inc
|
5 | 2f9606b3 | aliguori | *
|
6 | 2f9606b3 | aliguori | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 2f9606b3 | aliguori | * of this software and associated documentation files (the "Software"), to deal
|
8 | 2f9606b3 | aliguori | * in the Software without restriction, including without limitation the rights
|
9 | 2f9606b3 | aliguori | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | 2f9606b3 | aliguori | * copies of the Software, and to permit persons to whom the Software is
|
11 | 2f9606b3 | aliguori | * furnished to do so, subject to the following conditions:
|
12 | 2f9606b3 | aliguori | *
|
13 | 2f9606b3 | aliguori | * The above copyright notice and this permission notice shall be included in
|
14 | 2f9606b3 | aliguori | * all copies or substantial portions of the Software.
|
15 | 2f9606b3 | aliguori | *
|
16 | 2f9606b3 | aliguori | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | 2f9606b3 | aliguori | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | 2f9606b3 | aliguori | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | 2f9606b3 | aliguori | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | 2f9606b3 | aliguori | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | 2f9606b3 | aliguori | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 2f9606b3 | aliguori | * THE SOFTWARE.
|
23 | 2f9606b3 | aliguori | */
|
24 | 2f9606b3 | aliguori | |
25 | 2f9606b3 | aliguori | |
26 | 2f9606b3 | aliguori | #ifndef __QEMU_VNC_AUTH_SASL_H__
|
27 | 2f9606b3 | aliguori | #define __QEMU_VNC_AUTH_SASL_H__
|
28 | 2f9606b3 | aliguori | |
29 | 2f9606b3 | aliguori | |
30 | 2f9606b3 | aliguori | #include <sasl/sasl.h> |
31 | 2f9606b3 | aliguori | |
32 | 2f9606b3 | aliguori | typedef struct VncStateSASL VncStateSASL; |
33 | 76655d6d | aliguori | typedef struct VncDisplaySASL VncDisplaySASL; |
34 | 76655d6d | aliguori | |
35 | 76655d6d | aliguori | #include "acl.h" |
36 | 2f9606b3 | aliguori | |
37 | 2f9606b3 | aliguori | struct VncStateSASL {
|
38 | 2f9606b3 | aliguori | sasl_conn_t *conn; |
39 | 2f9606b3 | aliguori | /* If we want to negotiate an SSF layer with client */
|
40 | 2f9606b3 | aliguori | int wantSSF :1; |
41 | 2f9606b3 | aliguori | /* If we are now running the SSF layer */
|
42 | 2f9606b3 | aliguori | int runSSF :1; |
43 | 2f9606b3 | aliguori | /*
|
44 | 2f9606b3 | aliguori | * If this is non-zero, then wait for that many bytes
|
45 | 2f9606b3 | aliguori | * to be written plain, before switching to SSF encoding
|
46 | 2f9606b3 | aliguori | * This allows the VNC auth result to finish being
|
47 | 2f9606b3 | aliguori | * written in plain.
|
48 | 2f9606b3 | aliguori | */
|
49 | 2f9606b3 | aliguori | unsigned int waitWriteSSF; |
50 | 2f9606b3 | aliguori | |
51 | 2f9606b3 | aliguori | /*
|
52 | 2f9606b3 | aliguori | * Buffering encoded data to allow more clear data
|
53 | 2f9606b3 | aliguori | * to be stuffed onto the output buffer
|
54 | 2f9606b3 | aliguori | */
|
55 | 2f9606b3 | aliguori | const uint8_t *encoded;
|
56 | 2f9606b3 | aliguori | unsigned int encodedLength; |
57 | 2f9606b3 | aliguori | unsigned int encodedOffset; |
58 | 2f9606b3 | aliguori | char *username;
|
59 | 2f9606b3 | aliguori | char *mechlist;
|
60 | 2f9606b3 | aliguori | }; |
61 | 2f9606b3 | aliguori | |
62 | 76655d6d | aliguori | struct VncDisplaySASL {
|
63 | 76655d6d | aliguori | qemu_acl *acl; |
64 | 76655d6d | aliguori | }; |
65 | 76655d6d | aliguori | |
66 | 2f9606b3 | aliguori | void vnc_sasl_client_cleanup(VncState *vs);
|
67 | 2f9606b3 | aliguori | |
68 | 2f9606b3 | aliguori | long vnc_client_read_sasl(VncState *vs);
|
69 | 2f9606b3 | aliguori | long vnc_client_write_sasl(VncState *vs);
|
70 | 2f9606b3 | aliguori | |
71 | 2f9606b3 | aliguori | void start_auth_sasl(VncState *vs);
|
72 | 2f9606b3 | aliguori | |
73 | 2f9606b3 | aliguori | #endif /* __QEMU_VNC_AUTH_SASL_H__ */ |