ReactOS  0.4.14-dev-317-g96040ec
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. */
30 typedef enum {
36 
37 /* RPCSEC_SSPI services. */
38 typedef enum {
43 
44 #define RPCSEC_SSPI_VERSION 1
45 
46 #define sspi_name_t SEC_CHAR *
47 #define sspi_qop_t uint32_t
48 
49 typedef struct _sspi_OID_desc {
50  int length;
51  void *elements;
53 
54 typedef 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. */
64 struct rpc_sspi_sec {
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. */
74 struct rpc_sspi_cred {
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. */
96 bool_t xdr_rpc_sspi_data(XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr,
97  PCtxtHandle ctx, sspi_qop_t qop,
98  rpc_sspi_svc_t svc, u_int seq);
100 AUTH *authsspi_create_default(CLIENT *, char *, int);
101 bool_t authsspi_service(AUTH *auth, int svc);
102 uint32_t sspi_get_mic(void *ctx, u_int qop, u_int seq,
103  sspi_buffer_desc *bufin, sspi_buffer_desc *bufout);
104 uint32_t sspi_verify_mic(void *ctx, u_int seq, sspi_buffer_desc *bufin,
105  sspi_buffer_desc *bufout, u_int *qop_state);
106 uint32_t sspi_wrap(void *ctx, u_int seq, sspi_buffer_desc *bufin,
107  sspi_buffer_desc *bufout, u_int *conf_state);
108 uint32_t sspi_unwrap(void *ctx, u_int seq, sspi_buffer_desc *bufin,
109  sspi_buffer_desc *bufout, u_int *conf_state,
110  u_int *qop_state);
113 
114 void log_debug(const char *fmt, ...);
115 void log_status(char *m, uint32_t major, uint32_t minor);
116 void 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 */
uint32_t sspi_get_mic(void *ctx, u_int qop, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout)
u_int req_flags
Definition: auth_sspi.h:69
uint32_t qop
Definition: auth_sspi.h:66
u_int gc_v
Definition: auth_sspi.h:75
uint32_t sspi_import_name(sspi_buffer_desc *name_in, sspi_name_t *name_out)
Definition: auth_sspi.c:735
struct _sspi_OID_desc * sspi_OID
rpc_sspi_svc_t svc
Definition: auth_sspi.h:67
#define sspi_qop_t
Definition: auth_sspi.h:47
rpc_sspi_svc_t gc_svc
Definition: auth_sspi.h:78
CredHandle cred
Definition: auth_sspi.h:68
uint32_t sspi_wrap(void *ctx, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout, u_int *conf_state)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int32_t bool_t
Definition: types.h:101
GLintptr offset
Definition: glext.h:5920
Definition: auth.h:205
struct _sspi_buffer_desc * sspi_buffer_t
AUTH * authsspi_create_default(CLIENT *, char *, int)
Definition: auth_sspi.c:133
char * caddr_t
Definition: rosdhcp.h:36
Definition: xdr.h:103
const GLfloat * m
Definition: glext.h:10848
rpc_sspi_svc_t
Definition: auth_sspi.h:38
struct _sspi_OID_desc sspi_OID_desc
void * elements
Definition: auth_sspi.h:51
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
void sspi_release_buffer(sspi_buffer_desc *buf)
Definition: auth_sspi.c:727
#define __END_DECLS
Definition: wintirpc.h:63
rpc_sspi_proc_t
Definition: auth_sspi.h:30
bool_t authsspi_service(AUTH *auth, int svc)
Definition: auth_sspi.c:544
u_int gc_seq
Definition: auth_sspi.h:77
#define sspi_name_t
Definition: auth_sspi.h:46
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
sspi_buffer_desc gc_ctx
Definition: auth_sspi.h:79
__BEGIN_DECLS bool_t xdr_rpc_sspi_cred(XDR *xdrs, struct rpc_sspi_cred *p)
Definition: authsspi_prot.c:34
GLenum GLsizei len
Definition: glext.h:6722
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)
AUTH * authsspi_create(CLIENT *, sspi_name_t, struct rpc_sspi_sec *)
Definition: auth_sspi.c:74
bool_t xdr_rpc_sspi_init_args(XDR *xdrs, sspi_buffer_desc *p)
Definition: authsspi_prot.c:56
UINT32 u_int
Definition: types.h:82
#define major(rdev)
Definition: propsheet.cpp:916
UINT32 uint32_t
Definition: types.h:75
#define __BEGIN_DECLS
Definition: wintirpc.h:62
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_verify_mic(void *ctx, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout, u_int *qop_state)
sspi_OID mech
Definition: auth_sspi.h:65
rpc_sspi_proc_t gc_proc
Definition: auth_sspi.h:76
#define minor(rdev)
Definition: propsheet.cpp:917
bool_t xdr_rpc_sspi_init_res(XDR *xdrs, struct rpc_sspi_init_res *p)
Definition: authsspi_prot.c:72
GLfloat GLfloat p
Definition: glext.h:8902
UCHAR u_char
Definition: types.h:80
TimeStamp expiry
Definition: auth_sspi.h:70
sspi_buffer_desc gr_ctx
Definition: auth_sspi.h:84
static char title[]
Definition: ps.c:92
Definition: dsound.c:943
void log_status(char *m, uint32_t major, uint32_t minor)
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)
sspi_buffer_desc gr_token
Definition: auth_sspi.h:88
struct _sspi_buffer_desc sspi_buffer_desc