Lines Matching +full:system +full:- +full:auth
41 * The system is very weak. The client uses no encryption for its
55 #include <gssrpc/auth.h>
61 static void authunix_nextverf(AUTH *);
62 static bool_t authunix_marshal(AUTH *, XDR *);
63 static bool_t authunix_validate(AUTH *, struct opaque_auth *);
64 static bool_t authunix_refresh(AUTH *, struct rpc_msg *);
65 static void authunix_destroy(AUTH *);
66 static bool_t authunix_wrap(AUTH *, XDR *, xdrproc_t, caddr_t);
88 #define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private) argument
90 static void marshal_new_auth(AUTH *);
95 * Returns an auth handle with the given stuff in it.
97 AUTH *
109 AUTH *auth; in authunix_create() local
113 * Allocate and set up auth handle in authunix_create()
115 auth = (AUTH *)mem_alloc(sizeof(*auth)); in authunix_create()
117 if (auth == NULL) { in authunix_create()
129 auth->ah_ops = &auth_unix_ops; in authunix_create()
130 auth->ah_private = (caddr_t)au; in authunix_create()
131 auth->ah_verf = au->au_shcred = gssrpc__null_auth; in authunix_create()
132 au->au_shfaults = 0; in authunix_create()
151 au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs); in authunix_create()
152 au->au_origcred.oa_flavor = AUTH_UNIX; in authunix_create()
154 au->au_origcred.oa_base = mem_alloc((u_int) len); in authunix_create()
156 if ((au->au_origcred.oa_base = mem_alloc((u_int) len)) == NULL) { in authunix_create()
161 memmove(au->au_origcred.oa_base, mymem, (u_int)len); in authunix_create()
164 * set auth handle to reflect new cred. in authunix_create()
166 auth->ah_cred = au->au_origcred; in authunix_create()
167 marshal_new_auth(auth); in authunix_create()
168 return (auth); in authunix_create()
172 * Returns an auth handle with parameters determined by doing lots of
175 AUTH *
185 if (gethostname(machname, MAX_MACHINE_NAME) == -1) in authunix_create_default()
203 authunix_nextverf(AUTH *auth) in authunix_nextverf() argument
209 authunix_marshal(AUTH *auth, XDR *xdrs) in authunix_marshal() argument
211 struct audata *au = AUTH_PRIVATE(auth); in authunix_marshal()
213 return (XDR_PUTBYTES(xdrs, au->au_marshed, au->au_mpos)); in authunix_marshal()
217 authunix_validate(AUTH *auth, struct opaque_auth *verf) in authunix_validate() argument
222 if (verf->oa_flavor == AUTH_SHORT) { in authunix_validate()
223 au = AUTH_PRIVATE(auth); in authunix_validate()
224 xdrmem_create(&xdrs, verf->oa_base, verf->oa_length, XDR_DECODE); in authunix_validate()
226 if (au->au_shcred.oa_base != NULL) { in authunix_validate()
227 mem_free(au->au_shcred.oa_base, in authunix_validate()
228 au->au_shcred.oa_length); in authunix_validate()
229 au->au_shcred.oa_base = NULL; in authunix_validate()
231 if (xdr_opaque_auth(&xdrs, &au->au_shcred)) { in authunix_validate()
232 auth->ah_cred = au->au_shcred; in authunix_validate()
235 (void)xdr_opaque_auth(&xdrs, &au->au_shcred); in authunix_validate()
236 au->au_shcred.oa_base = NULL; in authunix_validate()
237 auth->ah_cred = au->au_origcred; in authunix_validate()
239 marshal_new_auth(auth); in authunix_validate()
245 authunix_refresh(AUTH *auth, struct rpc_msg *msg) in authunix_refresh() argument
247 struct audata *au = AUTH_PRIVATE(auth); in authunix_refresh()
253 if (auth->ah_cred.oa_base == au->au_origcred.oa_base) { in authunix_refresh()
257 au->au_shfaults ++; in authunix_refresh()
262 xdrmem_create(&xdrs, au->au_origcred.oa_base, in authunix_refresh()
263 au->au_origcred.oa_length, XDR_DECODE); in authunix_refresh()
276 auth->ah_cred = au->au_origcred; in authunix_refresh()
277 marshal_new_auth(auth); in authunix_refresh()
287 authunix_destroy(AUTH *auth) in authunix_destroy() argument
289 struct audata *au = AUTH_PRIVATE(auth); in authunix_destroy()
291 mem_free(au->au_origcred.oa_base, au->au_origcred.oa_length); in authunix_destroy()
293 if (au->au_shcred.oa_base != NULL) in authunix_destroy()
294 mem_free(au->au_shcred.oa_base, au->au_shcred.oa_length); in authunix_destroy()
296 mem_free(auth->ah_private, sizeof(struct audata)); in authunix_destroy()
298 if (auth->ah_verf.oa_base != NULL) in authunix_destroy()
299 mem_free(auth->ah_verf.oa_base, auth->ah_verf.oa_length); in authunix_destroy()
301 mem_free((caddr_t)auth, sizeof(*auth)); in authunix_destroy()
305 * Marshals (pre-serializes) an auth struct.
309 marshal_new_auth(AUTH *auth) in marshal_new_auth() argument
313 struct audata *au = AUTH_PRIVATE(auth); in marshal_new_auth()
315 xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE); in marshal_new_auth()
316 if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) || in marshal_new_auth()
317 (! xdr_opaque_auth(xdrs, &(auth->ah_verf)))) { in marshal_new_auth()
318 perror("auth_none.c - Fatal marshalling problem"); in marshal_new_auth()
320 au->au_mpos = XDR_GETPOS(xdrs); in marshal_new_auth()
326 authunix_wrap(AUTH *auth, XDR *xdrs, xdrproc_t xfunc, caddr_t xwhere) in authunix_wrap() argument