ReactOS 0.4.16-dev-250-g3ecd236
auth_sspi.h
Go to the documentation of this file.
1/* NFSv4.1 client for Windows
2 * Copyright © 2012 The Regents of the University of Michigan
3 *
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
6 *
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or (at
10 * your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * without any warranty; without even the implied warranty of merchantability
14 * or fitness for a particular purpose. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 */
21
22#ifndef _TIRPC_AUTH_GSS_H
23#define _TIRPC_AUTH_GSS_H
24
25#include <rpc/clnt.h>
26#define SECURITY_WIN32
27#include <security.h>
28
29/* RPCSEC_SSPI control procedures. */
30typedef enum {
36
37/* RPCSEC_SSPI services. */
38typedef enum {
43
44#define RPCSEC_SSPI_VERSION 1
45
46#define sspi_name_t SEC_CHAR *
47#define sspi_qop_t uint32_t
48
49typedef struct _sspi_OID_desc {
50 int length;
51 void *elements;
53
54typedef struct _sspi_buffer_desc {
55 int length;
56 void *value;
58
59#define SSPI_C_NO_NAME ((sspi_name_t) NULL)
60#define SSPI_C_NO_BUFFER ((sspi_buffer_t) NULL)
61#define SSPI_C_NO_CONTEXT ((PCtxtHandle) NULL)
62
63/* RPCSEC_SSPI security triple. */
65 sspi_OID mech; /* mechanism */
66 uint32_t qop; /* quality of protection */
67 rpc_sspi_svc_t svc; /* service */
68 CredHandle cred; /* cred handle */
69 u_int req_flags; /* req flags for init_sec_context */
71};
72
73/* Credentials. */
75 u_int gc_v; /* version */
76 rpc_sspi_proc_t gc_proc; /* control procedure */
77 u_int gc_seq; /* sequence number */
78 rpc_sspi_svc_t gc_svc; /* service */
79 sspi_buffer_desc gc_ctx; /* server's returned context handle */
80};
81
82/* Context creation response. */
84 sspi_buffer_desc gr_ctx; /* context handle */
85 u_int gr_major; /* major status */
86 u_int gr_minor; /* minor status */
87 u_int gr_win; /* sequence window */
89};
90
91/* Prototypes. */
96bool_t xdr_rpc_sspi_data(XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr,
98 rpc_sspi_svc_t svc, u_int seq);
100AUTH *authsspi_create_default(CLIENT *, char *, int);
101bool_t authsspi_service(AUTH *auth, int svc);
103 sspi_buffer_desc *bufin, sspi_buffer_desc *bufout);
105 sspi_buffer_desc *bufout, u_int *qop_state);
107 sspi_buffer_desc *bufout, u_int *conf_state);
109 sspi_buffer_desc *bufout, u_int *conf_state,
110 u_int *qop_state);
113
114void log_debug(const char *fmt, ...);
116void log_hexdump(bool_t on, const u_char *title, const u_char *buf, int len, int offset);
117
119
120#endif /* !_TIRPC_AUTH_GSS_H */
bool_t authsspi_service(AUTH *auth, int svc)
Definition: auth_sspi.c:544
AUTH * authsspi_create(CLIENT *, sspi_name_t, struct rpc_sspi_sec *)
Definition: auth_sspi.c:74
void sspi_release_buffer(sspi_buffer_desc *buf)
Definition: auth_sspi.c:727
bool_t xdr_rpc_sspi_init_args(XDR *xdrs, sspi_buffer_desc *p)
Definition: authsspi_prot.c:56
rpc_sspi_proc_t
Definition: auth_sspi.h:30
@ RPCSEC_SSPI_DATA
Definition: auth_sspi.h:31
@ RPCSEC_SSPI_DESTROY
Definition: auth_sspi.h:34
@ RPCSEC_SSPI_INIT
Definition: auth_sspi.h:32
@ RPCSEC_SSPI_CONTINUE_INIT
Definition: auth_sspi.h:33
AUTH * authsspi_create_default(CLIENT *, char *, int)
Definition: auth_sspi.c:133
uint32_t sspi_verify_mic(void *ctx, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout, u_int *qop_state)
struct _sspi_OID_desc sspi_OID_desc
rpc_sspi_svc_t
Definition: auth_sspi.h:38
@ RPCSEC_SSPI_SVC_NONE
Definition: auth_sspi.h:39
@ RPCSEC_SSPI_SVC_INTEGRITY
Definition: auth_sspi.h:40
@ RPCSEC_SSPI_SVC_PRIVACY
Definition: auth_sspi.h:41
struct _sspi_buffer_desc sspi_buffer_desc
uint32_t sspi_unwrap(void *ctx, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout, u_int *conf_state, u_int *qop_state)
void log_hexdump(bool_t on, const u_char *title, const u_char *buf, int len, int offset)
Definition: auth_sspi.c:942
uint32_t sspi_import_name(sspi_buffer_desc *name_in, sspi_name_t *name_out)
Definition: auth_sspi.c:735
void log_status(char *m, uint32_t major, uint32_t minor)
bool_t xdr_rpc_sspi_init_res(XDR *xdrs, struct rpc_sspi_init_res *p)
Definition: authsspi_prot.c:72
uint32_t sspi_get_mic(void *ctx, u_int qop, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout)
bool_t xdr_rpc_sspi_data(XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr, PCtxtHandle ctx, sspi_qop_t qop, rpc_sspi_svc_t svc, u_int seq)
__BEGIN_DECLS bool_t xdr_rpc_sspi_cred(XDR *xdrs, struct rpc_sspi_cred *p)
Definition: authsspi_prot.c:34
#define sspi_name_t
Definition: auth_sspi.h:46
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
struct _sspi_buffer_desc * sspi_buffer_t
#define sspi_qop_t
Definition: auth_sspi.h:47
uint32_t sspi_wrap(void *ctx, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout, u_int *conf_state)
struct _sspi_OID_desc * sspi_OID
UINT32 u_int
Definition: types.h:82
int32_t bool_t
Definition: types.h:101
UCHAR u_char
Definition: types.h:80
UINT32 uint32_t
Definition: types.h:75
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLintptr offset
Definition: glext.h:5920
const GLfloat * m
Definition: glext.h:10848
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
static char title[]
Definition: ps.c:92
char * caddr_t
Definition: rosdhcp.h:36
Definition: auth.h:205
Definition: xdr.h:103
void * elements
Definition: auth_sspi.h:51
Definition: dsound.c:943
rpc_sspi_proc_t gc_proc
Definition: auth_sspi.h:76
rpc_sspi_svc_t gc_svc
Definition: auth_sspi.h:78
u_int gc_v
Definition: auth_sspi.h:75
sspi_buffer_desc gc_ctx
Definition: auth_sspi.h:79
u_int gc_seq
Definition: auth_sspi.h:77
sspi_buffer_desc gr_ctx
Definition: auth_sspi.h:84
sspi_buffer_desc gr_token
Definition: auth_sspi.h:88
TimeStamp expiry
Definition: auth_sspi.h:70
uint32_t qop
Definition: auth_sspi.h:66
rpc_sspi_svc_t svc
Definition: auth_sspi.h:67
sspi_OID mech
Definition: auth_sspi.h:65
u_int req_flags
Definition: auth_sspi.h:69
CredHandle cred
Definition: auth_sspi.h:68
#define __END_DECLS
Definition: wintirpc.h:63
#define __BEGIN_DECLS
Definition: wintirpc.h:62
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144