| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| #ifndef GSSRPC_AUTH_H |
| #define GSSRPC_AUTH_H |
|
|
| #include <gssrpc/xdr.h> |
|
|
| GSSRPC__BEGIN_DECLS |
|
|
| #define MAX_AUTH_BYTES 400 |
| #define MAXNETNAMELEN 255 |
|
|
| |
| |
| |
| enum auth_stat { |
| AUTH_OK=0, |
| |
| |
| |
| AUTH_BADCRED=1, |
| AUTH_REJECTEDCRED=2, |
| AUTH_BADVERF=3, |
| AUTH_REJECTEDVERF=4, |
| AUTH_TOOWEAK=5, |
| |
| |
| |
| AUTH_INVALIDRESP=6, |
| AUTH_FAILED=7, |
| |
| |
| |
| RPCSEC_GSS_CREDPROBLEM = 13, |
| RPCSEC_GSS_CTXPROBLEM = 14 |
| }; |
|
|
| union des_block { |
| char c[8]; |
| }; |
| typedef union des_block des_block; |
| extern bool_t xdr_des_block(XDR *, des_block *); |
|
|
| |
| |
| |
| struct opaque_auth { |
| enum_t oa_flavor; |
| caddr_t oa_base; |
| u_int oa_length; |
| }; |
|
|
|
|
| |
| |
| |
| struct rpc_msg; |
|
|
| typedef struct AUTH { |
| struct opaque_auth ah_cred; |
| struct opaque_auth ah_verf; |
| union des_block ah_key; |
| struct auth_ops { |
| void (*ah_nextverf)(struct AUTH *); |
| |
| int (*ah_marshal)(struct AUTH *, XDR *); |
| |
| int (*ah_validate)(struct AUTH *, |
| struct opaque_auth *); |
| |
| int (*ah_refresh)(struct AUTH *, struct rpc_msg *); |
| |
| void (*ah_destroy)(struct AUTH *); |
| |
| int (*ah_wrap)(struct AUTH *, XDR *, |
| xdrproc_t, caddr_t); |
| |
| int (*ah_unwrap)(struct AUTH *, XDR *, |
| xdrproc_t, caddr_t); |
| } *ah_ops; |
| void *ah_private; |
| } AUTH; |
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| #define AUTH_NEXTVERF(auth) \ |
| ((*((auth)->ah_ops->ah_nextverf))(auth)) |
| #define auth_nextverf(auth) \ |
| ((*((auth)->ah_ops->ah_nextverf))(auth)) |
|
|
| #define AUTH_MARSHALL(auth, xdrs) \ |
| ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) |
| #define auth_marshall(auth, xdrs) \ |
| ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) |
|
|
| #define AUTH_VALIDATE(auth, verfp) \ |
| ((*((auth)->ah_ops->ah_validate))((auth), verfp)) |
| #define auth_validate(auth, verfp) \ |
| ((*((auth)->ah_ops->ah_validate))((auth), verfp)) |
|
|
| #define AUTH_REFRESH(auth, msg) \ |
| ((*((auth)->ah_ops->ah_refresh))(auth, msg)) |
| #define auth_refresh(auth, msg) \ |
| ((*((auth)->ah_ops->ah_refresh))(auth, msg)) |
|
|
| #define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \ |
| ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ |
| xfunc, xwhere)) |
| #define auth_wrap(auth, xdrs, xfunc, xwhere) \ |
| ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ |
| xfunc, xwhere)) |
| #define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ |
| ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ |
| xfunc, xwhere)) |
| #define auth_unwrap(auth, xdrs, xfunc, xwhere) \ |
| ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ |
| xfunc, xwhere)) |
|
|
| #define AUTH_DESTROY(auth) \ |
| ((*((auth)->ah_ops->ah_destroy))(auth)) |
| #define auth_destroy(auth) \ |
| ((*((auth)->ah_ops->ah_destroy))(auth)) |
|
|
|
|
| #ifdef GSSRPC__IMPL |
| |
| extern struct opaque_auth gssrpc__null_auth; |
| #endif |
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| extern AUTH *authunix_create(char *machname, int uid, int gid, int len, |
| int *aup_gids); |
| extern AUTH *authunix_create_default(void); |
| extern AUTH *authnone_create(void); |
| extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); |
|
|
| #define AUTH_NONE 0 |
| #define AUTH_NULL 0 |
| #define AUTH_UNIX 1 |
| #define AUTH_SHORT 2 |
| #define AUTH_DES 3 |
| #define AUTH_GSSAPI 300001 |
| #define RPCSEC_GSS 6 |
|
|
| GSSRPC__END_DECLS |
|
|
| #endif |
|
|