ReactOS  0.4.14-dev-317-g96040ec
auth_sspi.h File Reference
#include <rpc/clnt.h>
#include <security.h>
Include dependency graph for auth_sspi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _sspi_OID_desc
 
struct  _sspi_buffer_desc
 
struct  rpc_sspi_sec
 
struct  rpc_sspi_cred
 
struct  rpc_sspi_init_res
 

Macros

#define SECURITY_WIN32
 
#define RPCSEC_SSPI_VERSION   1
 
#define sspi_name_t   SEC_CHAR *
 
#define sspi_qop_t   uint32_t
 
#define SSPI_C_NO_NAME   ((sspi_name_t) NULL)
 
#define SSPI_C_NO_BUFFER   ((sspi_buffer_t) NULL)
 
#define SSPI_C_NO_CONTEXT   ((PCtxtHandle) NULL)
 

Typedefs

typedef struct _sspi_OID_desc sspi_OID_desc
 
typedef struct _sspi_OID_descsspi_OID
 
typedef struct _sspi_buffer_desc sspi_buffer_desc
 
typedef struct _sspi_buffer_descsspi_buffer_t
 

Enumerations

enum  rpc_sspi_proc_t { RPCSEC_SSPI_DATA = 0, RPCSEC_SSPI_INIT = 1, RPCSEC_SSPI_CONTINUE_INIT = 2, RPCSEC_SSPI_DESTROY = 3 }
 
enum  rpc_sspi_svc_t { RPCSEC_SSPI_SVC_NONE = 1, RPCSEC_SSPI_SVC_INTEGRITY = 2, RPCSEC_SSPI_SVC_PRIVACY = 3 }
 

Functions

__BEGIN_DECLS bool_t xdr_rpc_sspi_cred (XDR *xdrs, struct rpc_sspi_cred *p)
 
bool_t xdr_rpc_sspi_init_args (XDR *xdrs, sspi_buffer_desc *p)
 
bool_t xdr_rpc_sspi_init_res (XDR *xdrs, struct rpc_sspi_init_res *p)
 
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)
 
AUTHauthsspi_create (CLIENT *, sspi_name_t, struct rpc_sspi_sec *)
 
AUTHauthsspi_create_default (CLIENT *, char *, int)
 
bool_t authsspi_service (AUTH *auth, int svc)
 
uint32_t sspi_get_mic (void *ctx, u_int qop, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout)
 
uint32_t sspi_verify_mic (void *ctx, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout, u_int *qop_state)
 
uint32_t sspi_wrap (void *ctx, u_int seq, sspi_buffer_desc *bufin, sspi_buffer_desc *bufout, u_int *conf_state)
 
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 sspi_release_buffer (sspi_buffer_desc *buf)
 
uint32_t sspi_import_name (sspi_buffer_desc *name_in, sspi_name_t *name_out)
 
void log_debug (const char *fmt,...)
 
void log_status (char *m, uint32_t major, uint32_t minor)
 
void log_hexdump (bool_t on, const u_char *title, const u_char *buf, int len, int offset)
 

Macro Definition Documentation

◆ RPCSEC_SSPI_VERSION

#define RPCSEC_SSPI_VERSION   1

Definition at line 44 of file auth_sspi.h.

◆ SECURITY_WIN32

#define SECURITY_WIN32

Definition at line 26 of file auth_sspi.h.

◆ SSPI_C_NO_BUFFER

#define SSPI_C_NO_BUFFER   ((sspi_buffer_t) NULL)

Definition at line 60 of file auth_sspi.h.

◆ SSPI_C_NO_CONTEXT

#define SSPI_C_NO_CONTEXT   ((PCtxtHandle) NULL)

Definition at line 61 of file auth_sspi.h.

◆ SSPI_C_NO_NAME

#define SSPI_C_NO_NAME   ((sspi_name_t) NULL)

Definition at line 59 of file auth_sspi.h.

◆ sspi_name_t

#define sspi_name_t   SEC_CHAR *

Definition at line 46 of file auth_sspi.h.

◆ sspi_qop_t

#define sspi_qop_t   uint32_t

Definition at line 47 of file auth_sspi.h.

Typedef Documentation

◆ sspi_buffer_desc

◆ sspi_buffer_t

◆ sspi_OID

◆ sspi_OID_desc

Enumeration Type Documentation

◆ rpc_sspi_proc_t

Enumerator
RPCSEC_SSPI_DATA 
RPCSEC_SSPI_INIT 
RPCSEC_SSPI_CONTINUE_INIT 
RPCSEC_SSPI_DESTROY 

Definition at line 30 of file auth_sspi.h.

◆ rpc_sspi_svc_t

Enumerator
RPCSEC_SSPI_SVC_NONE 
RPCSEC_SSPI_SVC_INTEGRITY 
RPCSEC_SSPI_SVC_PRIVACY 

Definition at line 38 of file auth_sspi.h.

Function Documentation

◆ authsspi_create()

AUTH* authsspi_create ( CLIENT ,
sspi_name_t  ,
struct rpc_sspi_sec  
)

Definition at line 74 of file auth_sspi.c.

75 {
76  AUTH *auth, *save_auth;
77  struct rpc_sspi_data *gd;
78 
79  log_debug("in authgss_create()");
80 
81  memset(&rpc_createerr, 0, sizeof(rpc_createerr));
82 
83  if ((auth = calloc(sizeof(*auth), 1)) == NULL) {
85  rpc_createerr.cf_error.re_errno = ENOMEM;
86  return (NULL);
87  }
88  if ((gd = calloc(sizeof(*gd), 1)) == NULL) {
90  rpc_createerr.cf_error.re_errno = ENOMEM;
91  free(auth);
92  return (NULL);
93  }
94 
95 #if 0
96  if (name != SSPI_C_NO_NAME) {
97  if (gss_duplicate_name(&min_stat, name, &gd->name)
98  != GSS_S_COMPLETE) {
100  rpc_createerr.cf_error.re_errno = ENOMEM;
101  free(auth);
102  return (NULL);
103  }
104  }
105  else
106 #else
107  gd->name = strdup(name);
108 #endif
109 
110  gd->clnt = clnt;
111  SecInvalidateHandle(&gd->ctx);
112  gd->sec = sec;
113 
114  gd->gc.gc_v = RPCSEC_SSPI_VERSION;
115  gd->gc.gc_proc = RPCSEC_SSPI_INIT;
116  gd->gc.gc_svc = gd->sec->svc;
117 
118  auth->ah_ops = &authsspi_ops;
119  auth->ah_private = (caddr_t)gd;
120 
121  save_auth = clnt->cl_auth;
122  clnt->cl_auth = auth;
123 
124  if (!authsspi_refresh(auth, NULL))
125  auth = NULL;
126 
127  clnt->cl_auth = save_auth;
128 
129  return (auth);
130 }
static struct auth_ops authsspi_ops
Definition: auth_sspi.c:43
#define free
Definition: debug_ros.c:5
Definition: auth.h:205
CLIENT * clnt
Definition: auth_sspi.c:58
#define SSPI_C_NO_NAME
Definition: auth_sspi.h:59
Definition: arc.h:48
struct rpc_sspi_cred gc
Definition: auth_sspi.c:62
#define SecInvalidateHandle(x)
Definition: sspi.h:58
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
smooth NULL
Definition: ftsmooth.c:416
sspi_name_t name
Definition: auth_sspi.c:59
void * ah_private
Definition: auth.h:225
AUTH * cl_auth
Definition: clnt.h:122
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
enum clnt_stat cf_stat
Definition: clnt.h:496
CtxtHandle ctx
Definition: auth_sspi.c:61
static bool_t authsspi_refresh(AUTH *auth, void *)
Definition: auth_sspi.c:343
#define RPCSEC_SSPI_VERSION
Definition: auth_sspi.h:44
#define caddr_t
Definition: ftp.c:24
struct rpc_sspi_sec * sec
Definition: auth_sspi.c:60
struct __auth::auth_ops * ah_ops
struct rpc_err cf_error
Definition: clnt.h:497
Definition: name.c:36
#define calloc
Definition: rosglue.h:14
#define memset(x, y, z)
Definition: compat.h:39

Referenced by authsspi_create_default().

◆ authsspi_create_default()

AUTH* authsspi_create_default ( CLIENT ,
char ,
int   
)

Definition at line 133 of file auth_sspi.c.

134 {
135  AUTH *auth = NULL;
136  uint32_t maj_stat = 0;
137  sspi_buffer_desc sname;
139  unsigned char sec_pkg_name[] = "Kerberos";
140  struct rpc_sspi_sec *sec;
141 
142  log_debug("in authgss_create_default() for %s", service);
143 
144  sname.value = service;
145  sname.length = (int)strlen(service);
146 #if 0
147  maj_stat = gss_import_name(&min_stat, &sname,
148  (gss_OID)GSS_C_NT_HOSTBASED_SERVICE,
149  &name);
150 #else
151  maj_stat = sspi_import_name(&sname, &name);
152 #endif
153  if (maj_stat != SEC_E_OK) {
154  log_debug("authgss_create_default: sspi_import_name failed with %x", maj_stat);
155  return (NULL);
156  }
157  sec = calloc(1, sizeof(struct rpc_sspi_sec));
158  if (sec == NULL)
159  goto out_err;
160  sec->svc = svc;
161  // Let's acquire creds here for now
163  NULL, NULL, NULL, NULL, &sec->cred, &sec->expiry);
164  if (maj_stat != SEC_E_OK) {
165  log_debug("authgss_create_default: AcquireCredentialsHandleA failed with %x", maj_stat);
166  free(sec);
167  goto out;
168  }
169 
170  auth = authsspi_create(clnt, name, sec);
171  if (auth == NULL)
172  goto out_free_sec;
173 
174 out:
175  if (name != SSPI_C_NO_NAME) {
176 #if 0
177  gss_release_name(&min_stat, &name);
178 #else
179  free(name);
180 #endif
181  }
182 
183  return (auth);
184 out_free_sec:
185  if (rpc_createerr.cf_error.re_errno == ENOMEM) {
187  free(sec);
188  }
189 out_err:
191  rpc_createerr.cf_error.re_errno = ENOMEM;
192  goto out;
193 }
rpc_sspi_svc_t svc
Definition: auth_sspi.h:67
CredHandle cred
Definition: auth_sspi.h:68
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define free
Definition: debug_ros.c:5
Definition: auth.h:205
#define SSPI_C_NO_NAME
Definition: auth_sspi.h:59
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
Definition: wrapper.c:151
Definition: arc.h:48
static char sec_pkg_name[]
Definition: ntlm.c:180
AUTH * authsspi_create(CLIENT *clnt, sspi_name_t name, struct rpc_sspi_sec *sec)
Definition: auth_sspi.c:74
smooth NULL
Definition: ftsmooth.c:416
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
#define sspi_name_t
Definition: auth_sspi.h:46
SECURITY_STATUS WINAPI AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: wrapper.c:59
uint32_t sspi_import_name(sspi_buffer_desc *name_in, sspi_name_t *name_out)
Definition: auth_sspi.c:735
enum clnt_stat cf_stat
Definition: clnt.h:496
static FILE * out
Definition: regtests2xml.c:44
#define SEC_E_OK
Definition: winerror.h:2356
#define SECPKG_CRED_BOTH
Definition: sspi.h:278
UINT32 uint32_t
Definition: types.h:75
struct rpc_err cf_error
Definition: clnt.h:497
Definition: name.c:36
#define calloc
Definition: rosglue.h:14
TimeStamp expiry
Definition: auth_sspi.h:70
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by create_new_rpc_auth(), and create_rpcsec_auth_client().

◆ authsspi_service()

bool_t authsspi_service ( AUTH auth,
int  svc 
)

Definition at line 544 of file auth_sspi.c.

545 {
546  struct rpc_sspi_data *gd;
547 
548  log_debug("in authgss_service()");
549 
550  if (!auth)
551  return(FALSE);
552  gd = AUTH_PRIVATE(auth);
553  if (!gd || !gd->established)
554  return (FALSE);
555  gd->sec->svc = svc;
556  gd->gc.gc_svc = svc;
557  return (TRUE);
558 }
#define AUTH_PRIVATE(auth)
Definition: auth_sspi.c:67
#define TRUE
Definition: types.h:120
struct rpc_sspi_cred gc
Definition: auth_sspi.c:62
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
bool_t established
Definition: auth_sspi.c:54
struct rpc_sspi_sec * sec
Definition: auth_sspi.c:60

◆ log_debug()

void log_debug ( const char fmt,
  ... 
)

Definition at line 977 of file auth_sspi.c.

978 {
979  va_list ap;
980 
981  va_start(ap, fmt);
982  fprintf(fd_out, "%04x: rpcsec_gss: ", GetCurrentThreadId());
983  vfprintf(fd_out, fmt, ap);
984  fprintf(fd_out, "\n");
985  fflush(fd_out);
986  va_end(ap);
987 }
#define va_end(ap)
Definition: acmsvcex.h:90
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
char * va_list
Definition: acmsvcex.h:78
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define fd_out
Definition: auth_sspi.c:858
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
Definition: dsound.c:943

Referenced by _svcauth_gss(), authgss_create(), authgss_create_default(), authgss_destroy(), authgss_destroy_context(), authgss_get_private_data(), authgss_marshal(), authgss_nextverf(), authgss_refresh(), authgss_service(), authgss_unwrap(), authgss_validate(), authgss_wrap(), authsspi_create(), authsspi_create_default(), authsspi_destroy(), authsspi_destroy_context(), authsspi_marshal(), authsspi_nextverf(), authsspi_refresh(), authsspi_service(), authsspi_unwrap(), authsspi_validate(), authsspi_wrap(), print_negotiated_attrs(), sspi_import_name(), svcauth_gss_accept_sec_context(), svcauth_gss_acquire_cred(), svcauth_gss_destroy(), svcauth_gss_import_name(), svcauth_gss_nextverf(), svcauth_gss_release_cred(), svcauth_gss_set_svc_name(), svcauth_gss_unwrap(), svcauth_gss_validate(), svcauth_gss_wrap(), xdr_rpc_gss_cred(), xdr_rpc_gss_init_args(), xdr_rpc_gss_init_res(), xdr_rpc_gss_unwrap_data(), xdr_rpc_gss_wrap_data(), xdr_rpc_sspi_cred(), xdr_rpc_sspi_init_args(), xdr_rpc_sspi_init_res(), xdr_rpc_sspi_unwrap_data(), and xdr_rpc_sspi_wrap_data().

◆ log_hexdump()

void log_hexdump ( bool_t  on,
const u_char title,
const u_char buf,
int  len,
int  offset 
)

Definition at line 942 of file auth_sspi.c.

944 {
945  int i, j, jm, c;
946 
947  if (!on) return;
948 
949  fprintf(fd_out, "%04x: %s (len=%d)\n", GetCurrentThreadId(), title, len);
950  for (i = 0; i < len; i += 0x10) {
951  fprintf(fd_out, " %04x: ", (u_int)(i + offset));
952  jm = len - i;
953  jm = jm > 16 ? 16 : jm;
954 
955  for (j = 0; j < jm; j++) {
956  if ((j % 2) == 1)
957  fprintf(fd_out, "%02x ", (u_int) buf[i+j]);
958  else
959  fprintf(fd_out, "%02x", (u_int) buf[i+j]);
960  }
961  for (; j < 16; j++) {
962  if ((j % 2) == 1) fprintf(fd_out, " ");
963  else fprintf(fd_out, " ");
964  }
965  fprintf(fd_out, " ");
966 
967  for (j = 0; j < jm; j++) {
968  c = buf[i+j];
969  c = isprint(c) ? c : '.';
970  fprintf(fd_out, "%c", c);
971  }
972  fprintf(fd_out, "\n");
973  }
974  fflush(fd_out);
975 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
const GLubyte * c
Definition: glext.h:8905
GLenum GLsizei len
Definition: glext.h:6722
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
UINT32 u_int
Definition: types.h:82
#define fd_out
Definition: auth_sspi.c:858
#define isprint(c)
Definition: acclib.h:73
#define c
Definition: ke_i.h:80
static char title[]
Definition: ps.c:92

Referenced by authgss_refresh(), authsspi_refresh(), sspi_get_mic(), sspi_unwrap(), sspi_verify_mic(), and sspi_wrap().

◆ log_status()

void log_status ( char m,
uint32_t  major,
uint32_t  minor 
)

◆ sspi_get_mic()

uint32_t sspi_get_mic ( void ctx,
u_int  qop,
u_int  seq,
sspi_buffer_desc bufin,
sspi_buffer_desc bufout 
)

◆ sspi_import_name()

uint32_t sspi_import_name ( sspi_buffer_desc name_in,
sspi_name_t name_out 
)

Definition at line 735 of file auth_sspi.c.

736 {
737  *name_out = calloc(name_in->length + 5, sizeof(char));
738  if (*name_out == NULL)
740 
741  strcpy(*name_out, "nfs/");
742  strncat(*name_out, name_in->value, name_in->length);
743 
744  log_debug("imported service name is: %s\n", *name_out);
745 
746  return SEC_E_OK;
747 }
char * strncat(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:605
#define SEC_E_INSUFFICIENT_MEMORY
Definition: winerror.h:2909
smooth NULL
Definition: ftsmooth.c:416
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
#define SEC_E_OK
Definition: winerror.h:2356
#define calloc
Definition: rosglue.h:14
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by authsspi_create_default().

◆ sspi_release_buffer()

void sspi_release_buffer ( sspi_buffer_desc buf)

Definition at line 727 of file auth_sspi.c.

728 {
729  if (buf->value)
730  free(buf->value);
731  buf->value = NULL;
732  buf->length = 0;
733 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define free
Definition: debug_ros.c:5
smooth NULL
Definition: ftsmooth.c:416

Referenced by authsspi_destroy_context(), authsspi_marshal(), authsspi_refresh(), xdr_rpc_sspi_unwrap_data(), and xdr_rpc_sspi_wrap_data().

◆ sspi_unwrap()

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_verify_mic()

uint32_t sspi_verify_mic ( void ctx,
u_int  seq,
sspi_buffer_desc bufin,
sspi_buffer_desc bufout,
u_int qop_state 
)

◆ sspi_wrap()

uint32_t sspi_wrap ( void ctx,
u_int  seq,
sspi_buffer_desc bufin,
sspi_buffer_desc bufout,
u_int conf_state 
)

◆ xdr_rpc_sspi_cred()

__BEGIN_DECLS bool_t xdr_rpc_sspi_cred ( XDR xdrs,
struct rpc_sspi_cred p 
)

Definition at line 34 of file authsspi_prot.c.

35 {
36  bool_t xdr_stat;
37 
38  xdr_stat = (xdr_u_int(xdrs, &p->gc_v) &&
39  xdr_enum(xdrs, (enum_t *)&p->gc_proc) &&
40  xdr_u_int(xdrs, &p->gc_seq) &&
41  xdr_enum(xdrs, (enum_t *)&p->gc_svc) &&
42  xdr_bytes(xdrs, (char **)&p->gc_ctx.value,
43  (u_int *)&p->gc_ctx.length, MAX_AUTH_BYTES));
44 
45  log_debug("xdr_rpc_gss_cred: %s %s "
46  "(v %d, proc %d, seq %d, svc %d, ctx %p:%d)",
47  (xdrs->x_op == XDR_ENCODE) ? "encode" : "decode",
48  (xdr_stat == TRUE) ? "success" : "failure",
49  p->gc_v, p->gc_proc, p->gc_seq, p->gc_svc,
50  p->gc_ctx.value, p->gc_ctx.length);
51 
52  return (xdr_stat);
53 }
#define MAX_AUTH_BYTES
Definition: auth.h:77
#define TRUE
Definition: types.h:120
int32_t bool_t
Definition: types.h:101
bool_t xdr_u_int(XDR *xdrs, u_int *up)
Definition: xdr.c:133
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
enum xdr_op x_op
Definition: xdr.h:104
int32_t enum_t
Definition: types.h:102
Definition: xdr.h:85
UINT32 u_int
Definition: types.h:82
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by authsspi_marshal().

◆ xdr_rpc_sspi_data()

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 
)

Definition at line 288 of file authsspi_prot.c.

291 {
292  switch (xdrs->x_op) {
293 
294  case XDR_ENCODE:
295  return (xdr_rpc_sspi_wrap_data(xdrs, xdr_func, xdr_ptr,
296  ctx, qop, svc, seq));
297  case XDR_DECODE:
298  return (xdr_rpc_sspi_unwrap_data(xdrs, xdr_func, xdr_ptr,
299  ctx, qop, svc, seq));
300  case XDR_FREE:
301  return (TRUE);
302  }
303  return (FALSE);
304 }
#define TRUE
Definition: types.h:120
bool_t xdr_rpc_sspi_wrap_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)
Definition: authsspi_prot.c:96
bool_t xdr_rpc_sspi_unwrap_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)
enum xdr_op x_op
Definition: xdr.h:104
CtxtHandle ctx
Definition: auth_sspi.c:61
Definition: xdr.h:85
Definition: xdr.h:87
Definition: xdr.h:86

Referenced by authsspi_unwrap(), and authsspi_wrap().

◆ xdr_rpc_sspi_init_args()

bool_t xdr_rpc_sspi_init_args ( XDR xdrs,
sspi_buffer_desc p 
)

Definition at line 56 of file authsspi_prot.c.

57 {
58  bool_t xdr_stat;
59 
60  xdr_stat = xdr_bytes(xdrs, (char **)&p->value,
61  (u_int *)&p->length, (u_int)(-1));
62 
63  log_debug("xdr_rpc_gss_init_args: %s %s (token %p:%d)",
64  (xdrs->x_op == XDR_ENCODE) ? "encode" : "decode",
65  (xdr_stat == TRUE) ? "success" : "failure",
66  p->value, p->length);
67 
68  return (xdr_stat);
69 }
#define TRUE
Definition: types.h:120
int32_t bool_t
Definition: types.h:101
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
enum xdr_op x_op
Definition: xdr.h:104
Definition: xdr.h:85
UINT32 u_int
Definition: types.h:82
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by authsspi_refresh().

◆ xdr_rpc_sspi_init_res()

bool_t xdr_rpc_sspi_init_res ( XDR xdrs,
struct rpc_sspi_init_res p 
)

Definition at line 72 of file authsspi_prot.c.

73 {
74  bool_t xdr_stat;
75 
76  xdr_stat = (xdr_bytes(xdrs, (char **)&p->gr_ctx.value,
77  (u_int *)&p->gr_ctx.length, MAX_NETOBJ_SZ) &&
78  xdr_u_int(xdrs, &p->gr_major) &&
79  xdr_u_int(xdrs, &p->gr_minor) &&
80  xdr_u_int(xdrs, &p->gr_win) &&
81  xdr_bytes(xdrs, (char **)&p->gr_token.value,
82  (u_int *)&p->gr_token.length, (u_int)(-1)));
83 
84  log_debug("xdr_rpc_gss_init_res %s %s "
85  "(ctx %p:%d, maj %d, min %d, win %d, token %p:%d)",
86  (xdrs->x_op == XDR_ENCODE) ? "encode" : "decode",
87  (xdr_stat == TRUE) ? "success" : "failure",
88  p->gr_ctx.value, p->gr_ctx.length,
89  p->gr_major, p->gr_minor, p->gr_win,
90  p->gr_token.value, p->gr_token.length);
91 
92  return (xdr_stat);
93 }
#define TRUE
Definition: types.h:120
int32_t bool_t
Definition: types.h:101
bool_t xdr_u_int(XDR *xdrs, u_int *up)
Definition: xdr.c:133
void log_debug(const char *fmt,...)
Definition: auth_sspi.c:977
enum xdr_op x_op
Definition: xdr.h:104
#define MAX_NETOBJ_SZ
Definition: xdr.h:331
Definition: xdr.h:85
UINT32 u_int
Definition: types.h:82
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by authsspi_refresh().