[1] | 1 | /** @file
|
---|
[34558] | 2 | * VirtualBox External Authentication Library Interface.
|
---|
[1] | 3 | */
|
---|
| 4 |
|
---|
| 5 | /*
|
---|
[69107] | 6 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
[1] | 7 | *
|
---|
| 8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
| 9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
| 10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
[5999] | 11 | * General Public License (GPL) as published by the Free Software
|
---|
| 12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
| 13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
| 14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
| 15 | *
|
---|
| 16 | * The contents of this file may alternatively be used under the terms
|
---|
| 17 | * of the Common Development and Distribution License Version 1.0
|
---|
| 18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
| 19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
| 20 | * CDDL are applicable instead of those of the GPL.
|
---|
| 21 | *
|
---|
| 22 | * You may elect to license modified versions of this file under the
|
---|
| 23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[1] | 24 | */
|
---|
| 25 |
|
---|
[34563] | 26 | #ifndef ___VBox_vboxauth_h
|
---|
| 27 | #define ___VBox_vboxauth_h
|
---|
[1] | 28 |
|
---|
[62784] | 29 | /** @defgroup grp_vboxauth VirtualBox External Authentication Library Interface
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
| 32 |
|
---|
[1] | 33 | /* The following 2 enums are 32 bits values.*/
|
---|
[34558] | 34 | typedef enum AuthResult
|
---|
[1] | 35 | {
|
---|
[34558] | 36 | AuthResultAccessDenied = 0,
|
---|
| 37 | AuthResultAccessGranted = 1,
|
---|
| 38 | AuthResultDelegateToGuest = 2,
|
---|
| 39 | AuthResultSizeHack = 0x7fffffff
|
---|
| 40 | } AuthResult;
|
---|
[1] | 41 |
|
---|
[34558] | 42 | typedef enum AuthGuestJudgement
|
---|
[1] | 43 | {
|
---|
[34558] | 44 | AuthGuestNotAsked = 0,
|
---|
| 45 | AuthGuestAccessDenied = 1,
|
---|
| 46 | AuthGuestNoJudgement = 2,
|
---|
| 47 | AuthGuestAccessGranted = 3,
|
---|
| 48 | AuthGuestNotReacted = 4,
|
---|
| 49 | AuthGuestSizeHack = 0x7fffffff
|
---|
| 50 | } AuthGuestJudgement;
|
---|
[1] | 51 |
|
---|
[62784] | 52 | /** UUID memory representation. Array of 16 bytes.
|
---|
| 53 | *
|
---|
| 54 | * @note VirtualBox uses a consistent binary representation of UUIDs on all platforms. For this reason
|
---|
| 55 | * the integer fields comprising the UUID are stored as little endian values. If you want to pass such
|
---|
| 56 | * UUIDs to code which assumes that the integer fields are big endian (often also called network byte
|
---|
| 57 | * order), you need to adjust the contents of the UUID to e.g. achieve the same string representation.
|
---|
| 58 | *
|
---|
| 59 | * The required changes are:
|
---|
| 60 | * - reverse the order of byte 0, 1, 2 and 3
|
---|
| 61 | * - reverse the order of byte 4 and 5
|
---|
| 62 | * - reverse the order of byte 6 and 7.
|
---|
| 63 | *
|
---|
| 64 | * Using this conversion you will get identical results when converting the binary UUID to the string
|
---|
| 65 | * representation.
|
---|
| 66 | */
|
---|
[34558] | 67 | typedef unsigned char AUTHUUID[16];
|
---|
| 68 | typedef AUTHUUID *PAUTHUUID;
|
---|
[1] | 69 |
|
---|
[62784] | 70 | /** The library entry point calling convention. */
|
---|
[1] | 71 | #ifdef _MSC_VER
|
---|
[34558] | 72 | # define AUTHCALL __cdecl
|
---|
[1] | 73 | #elif defined(__GNUC__)
|
---|
[34558] | 74 | # define AUTHCALL
|
---|
[1] | 75 | #else
|
---|
| 76 | # error "Unsupported compiler"
|
---|
| 77 | #endif
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | /**
|
---|
[34558] | 81 | * Authentication library entry point.
|
---|
[1] | 82 | *
|
---|
[62784] | 83 | * @param pUuid Pointer to the UUID of the accessed virtual machine. Can be NULL.
|
---|
| 84 | * @param guestJudgement Result of the guest authentication.
|
---|
[62858] | 85 | * @param pszUser User name passed in by the client (UTF8).
|
---|
| 86 | * @param pszPassword Password passed in by the client (UTF8).
|
---|
| 87 | * @param pszDomain Domain passed in by the client (UTF8).
|
---|
[1] | 88 | *
|
---|
| 89 | * Return code:
|
---|
| 90 | *
|
---|
[62784] | 91 | * @retval AuthAccessDenied Client access has been denied.
|
---|
| 92 | * @retval AuthAccessGranted Client has the right to use the virtual machine.
|
---|
| 93 | * @retval AuthDelegateToGuest Guest operating system must
|
---|
| 94 | * authenticate the client and the
|
---|
| 95 | * library must be called again with
|
---|
| 96 | * the result of the guest
|
---|
| 97 | * authentication.
|
---|
[1] | 98 | */
|
---|
[62784] | 99 | typedef AuthResult AUTHCALL FNAUTHENTRY(PAUTHUUID pUuid,
|
---|
| 100 | AuthGuestJudgement guestJudgement,
|
---|
[62858] | 101 | const char *pszUser,
|
---|
| 102 | const char *pszPassword,
|
---|
| 103 | const char *pszDomain);
|
---|
[62784] | 104 | /** Pointer to a FNAUTHENTRY function. */
|
---|
| 105 | typedef FNAUTHENTRY *PFNAUTHENTRY;
|
---|
| 106 | /** @deprecated */
|
---|
| 107 | typedef FNAUTHENTRY AUTHENTRY;
|
---|
| 108 | /** @deprecated */
|
---|
| 109 | typedef PFNAUTHENTRY PAUTHENTRY;
|
---|
| 110 | /** Name of the FNAUTHENTRY entry point. */
|
---|
[34558] | 111 | #define AUTHENTRY_NAME "VRDPAuth"
|
---|
| 112 |
|
---|
[2527] | 113 | /**
|
---|
[34558] | 114 | * Authentication library entry point version 2.
|
---|
[2527] | 115 | *
|
---|
[62784] | 116 | * @param pUuid Pointer to the UUID of the accessed virtual machine. Can be NULL.
|
---|
| 117 | * @param guestJudgement Result of the guest authentication.
|
---|
[62858] | 118 | * @param pszUser User name passed in by the client (UTF8).
|
---|
| 119 | * @param pszPassword Password passed in by the client (UTF8).
|
---|
| 120 | * @param pszDomain Domain passed in by the client (UTF8).
|
---|
[62784] | 121 | * @param fLogon Boolean flag. Indicates whether the entry point is
|
---|
| 122 | * called for a client logon or the client disconnect.
|
---|
| 123 | * @param clientId Server side unique identifier of the client.
|
---|
[2527] | 124 | *
|
---|
[62784] | 125 | * @retval AuthAccessDenied Client access has been denied.
|
---|
| 126 | * @retval AuthAccessGranted Client has the right to use the virtual machine.
|
---|
| 127 | * @retval AuthDelegateToGuest Guest operating system must
|
---|
| 128 | * authenticate the client and the
|
---|
| 129 | * library must be called again with
|
---|
| 130 | * the result of the guest authentication.
|
---|
[2527] | 131 | *
|
---|
[62784] | 132 | * @note When @a fLogon is 0, only @a pUuid and @a clientId are valid and the
|
---|
| 133 | * return code is ignored.
|
---|
[2527] | 134 | */
|
---|
[62784] | 135 | typedef AuthResult AUTHCALL FNAUTHENTRY2(PAUTHUUID pUuid,
|
---|
| 136 | AuthGuestJudgement guestJudgement,
|
---|
[62858] | 137 | const char *pszUser,
|
---|
| 138 | const char *pszPassword,
|
---|
| 139 | const char *pszDomain,
|
---|
[62784] | 140 | int fLogon,
|
---|
| 141 | unsigned clientId);
|
---|
| 142 | /** Pointer to a FNAUTHENTRY2 function. */
|
---|
| 143 | typedef FNAUTHENTRY2 *PFNAUTHENTRY2;
|
---|
| 144 | /** @deprecated */
|
---|
| 145 | typedef FNAUTHENTRY2 AUTHENTRY2;
|
---|
| 146 | /** @deprecated */
|
---|
| 147 | typedef PFNAUTHENTRY2 PAUTHENTRY2;
|
---|
| 148 | /** Name of the FNAUTHENTRY2 entry point. */
|
---|
[34558] | 149 | #define AUTHENTRY2_NAME "VRDPAuth2"
|
---|
| 150 |
|
---|
| 151 | /**
|
---|
| 152 | * Authentication library entry point version 3.
|
---|
| 153 | *
|
---|
[62858] | 154 | * @param pszCaller The name of the component which calls the library (UTF8).
|
---|
[62784] | 155 | * @param pUuid Pointer to the UUID of the accessed virtual machine. Can be NULL.
|
---|
| 156 | * @param guestJudgement Result of the guest authentication.
|
---|
[62858] | 157 | * @param pszUser User name passed in by the client (UTF8).
|
---|
| 158 | * @param pszPassword Password passed in by the client (UTF8).
|
---|
| 159 | * @param pszDomain Domain passed in by the client (UTF8).
|
---|
[62784] | 160 | * @param fLogon Boolean flag. Indicates whether the entry point is
|
---|
| 161 | * called for a client logon or the client disconnect.
|
---|
| 162 | * @param clientId Server side unique identifier of the client.
|
---|
[34558] | 163 | *
|
---|
[62784] | 164 | * @retval AuthResultAccessDenied Client access has been denied.
|
---|
| 165 | * @retval AuthResultAccessGranted Client has the right to use the
|
---|
| 166 | * virtual machine.
|
---|
| 167 | * @retval AuthResultDelegateToGuest Guest operating system must
|
---|
| 168 | * authenticate the client and the
|
---|
| 169 | * library must be called again with
|
---|
| 170 | * the result of the guest
|
---|
| 171 | * authentication.
|
---|
[34558] | 172 | *
|
---|
[62784] | 173 | * @note When @a fLogon is 0, only @a pszCaller, @a pUuid and @a clientId are
|
---|
| 174 | * valid and the return code is ignored.
|
---|
[34558] | 175 | */
|
---|
[62858] | 176 | typedef AuthResult AUTHCALL FNAUTHENTRY3(const char *pszCaller,
|
---|
[62784] | 177 | PAUTHUUID pUuid,
|
---|
| 178 | AuthGuestJudgement guestJudgement,
|
---|
[62858] | 179 | const char *pszUser,
|
---|
| 180 | const char *pszPassword,
|
---|
| 181 | const char *pszDomain,
|
---|
[62784] | 182 | int fLogon,
|
---|
| 183 | unsigned clientId);
|
---|
| 184 | /** Pointer to a FNAUTHENTRY3 function. */
|
---|
| 185 | typedef FNAUTHENTRY3 *PFNAUTHENTRY3;
|
---|
| 186 | /** @deprecated */
|
---|
| 187 | typedef FNAUTHENTRY3 AUTHENTRY3;
|
---|
| 188 | /** @deprecated */
|
---|
| 189 | typedef PFNAUTHENTRY3 PAUTHENTRY3;
|
---|
[34558] | 190 |
|
---|
[62784] | 191 | /** Name of the FNAUTHENTRY3 entry point. */
|
---|
| 192 | #define AUTHENTRY3_NAME "AuthEntry"
|
---|
[34558] | 193 |
|
---|
[62784] | 194 | /** @} */
|
---|
[34558] | 195 |
|
---|
[3633] | 196 | #endif
|
---|