auth.h | auth.h | |||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
*/ | */ | |||
#ifndef _TIRPC_AUTH_H | #ifndef _TIRPC_AUTH_H | |||
#define _TIRPC_AUTH_H | #define _TIRPC_AUTH_H | |||
#include <rpc/xdr.h> | #include <rpc/xdr.h> | |||
#include <rpc/clnt_stat.h> | #include <rpc/clnt_stat.h> | |||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <stdio.h> | ||||
#define MAX_AUTH_BYTES 400 | #define MAX_AUTH_BYTES 400 | |||
#define MAXNETNAMELEN 255 /* maximum length of network user's name */ | #define MAXNETNAMELEN 255 /* maximum length of network user's name */ | |||
/* | /* | |||
* Client side authentication/security data | * Client side authentication/security data | |||
*/ | */ | |||
typedef struct sec_data { | typedef struct sec_data { | |||
u_int secmod; /* security mode number e.g. in nfssec.conf */ | u_int secmod; /* security mode number e.g. in nfssec.conf */ | |||
skipping to change at line 203 | skipping to change at line 204 | |||
int (*ah_refresh) (struct __auth *, void *); | int (*ah_refresh) (struct __auth *, void *); | |||
/* destroy this structure */ | /* destroy this structure */ | |||
void (*ah_destroy) (struct __auth *); | void (*ah_destroy) (struct __auth *); | |||
/* encode data for wire */ | /* encode data for wire */ | |||
int (*ah_wrap) (struct __auth *, XDR *, xdrproc_t, caddr _t); | int (*ah_wrap) (struct __auth *, XDR *, xdrproc_t, caddr _t); | |||
/* decode data for wire */ | /* decode data for wire */ | |||
int (*ah_unwrap) (struct __auth *, XDR *, xdrproc_t, cad dr_t); | int (*ah_unwrap) (struct __auth *, XDR *, xdrproc_t, cad dr_t); | |||
} *ah_ops; | } *ah_ops; | |||
void *ah_private; | void *ah_private; | |||
int ah_refcnt; | ||||
} AUTH; | } AUTH; | |||
static __inline int | ||||
auth_get(AUTH *auth) | ||||
{ | ||||
return __sync_add_and_fetch(&auth->ah_refcnt, 1); | ||||
} | ||||
static __inline int | ||||
auth_put(AUTH *auth) | ||||
{ | ||||
return __sync_sub_and_fetch(&auth->ah_refcnt, 1); | ||||
} | ||||
/* | /* | |||
* Authentication ops. | * Authentication ops. | |||
* The ops and the auth handle provide the interface to the authenticators. | * The ops and the auth handle provide the interface to the authenticators. | |||
* | * | |||
* AUTH *auth; | * AUTH *auth; | |||
* XDR *xdrs; | * XDR *xdrs; | |||
* struct opaque_auth verf; | * struct opaque_auth verf; | |||
*/ | */ | |||
#define AUTH_NEXTVERF(auth) \ | #define AUTH_NEXTVERF(auth) \ | |||
((*((auth)->ah_ops->ah_nextverf))(auth)) | ((*((auth)->ah_ops->ah_nextverf))(auth)) | |||
skipping to change at line 233 | skipping to change at line 247 | |||
#define AUTH_VALIDATE(auth, verfp) \ | #define AUTH_VALIDATE(auth, verfp) \ | |||
((*((auth)->ah_ops->ah_validate))((auth), verfp)) | ((*((auth)->ah_ops->ah_validate))((auth), verfp)) | |||
#define auth_validate(auth, verfp) \ | #define auth_validate(auth, verfp) \ | |||
((*((auth)->ah_ops->ah_validate))((auth), verfp)) | ((*((auth)->ah_ops->ah_validate))((auth), verfp)) | |||
#define AUTH_REFRESH(auth, msg) \ | #define AUTH_REFRESH(auth, msg) \ | |||
((*((auth)->ah_ops->ah_refresh))(auth, msg)) | ((*((auth)->ah_ops->ah_refresh))(auth, msg)) | |||
#define auth_refresh(auth, msg) \ | #define auth_refresh(auth, msg) \ | |||
((*((auth)->ah_ops->ah_refresh))(auth, msg)) | ((*((auth)->ah_ops->ah_refresh))(auth, msg)) | |||
#define AUTH_DESTROY(auth) \ | #if defined(__GNUC__) && defined(DEBUG) | |||
((*((auth)->ah_ops->ah_destroy))(auth)) | #define auth_log_debug(fmt,args...) printf(stderr, fmt, args) | |||
#define auth_destroy(auth) \ | #else | |||
((*((auth)->ah_ops->ah_destroy))(auth)) | #define auth_log_debug(fmt,args...) | |||
#endif | ||||
#define AUTH_DESTROY(auth) \ | ||||
do { \ | ||||
int refs; \ | ||||
if ((refs = auth_put((auth))) == 0) \ | ||||
((*((auth)->ah_ops->ah_destroy))(auth));\ | ||||
auth_log_debug("%s: auth_put(), refs %d\n", \ | ||||
__func__, refs); \ | ||||
} while (0) | ||||
#define auth_destroy(auth) \ | ||||
do { \ | ||||
int refs; \ | ||||
if ((refs = auth_put((auth))) == 0) \ | ||||
((*((auth)->ah_ops->ah_destroy))(auth));\ | ||||
auth_log_debug("%s: auth_put(), refs %d\n", \ | ||||
__func__, refs); \ | ||||
} while (0) | ||||
#define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \ | #define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \ | |||
((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ | ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ | |||
xfunc, xwhere)) | xfunc, xwhere)) | |||
#define auth_wrap(auth, xdrs, xfunc, xwhere) \ | #define auth_wrap(auth, xdrs, xfunc, xwhere) \ | |||
((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ | ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ | |||
xfunc, xwhere)) | xfunc, xwhere)) | |||
#define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ | #define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ | |||
((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ | ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ | |||
skipping to change at line 371 | skipping to change at line 404 | |||
*/ | */ | |||
__BEGIN_DECLS | __BEGIN_DECLS | |||
extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *, | extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *, | |||
short *, int * */); | short *, int * */); | |||
__END_DECLS | __END_DECLS | |||
#endif /* KERBEROS */ | #endif /* KERBEROS */ | |||
__BEGIN_DECLS | __BEGIN_DECLS | |||
struct svc_req; | struct svc_req; | |||
struct rpc_msg; | struct rpc_msg; | |||
enum auth_stat _svcauth_null (struct svc_req *, struct rpc_msg *); | enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *); | |||
enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); | enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); | |||
enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); | enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); | |||
__END_DECLS | __END_DECLS | |||
#define AUTH_NONE 0 /* no authentication */ | #define AUTH_NONE 0 /* no authentication */ | |||
#define AUTH_NULL 0 /* backward compatibility */ | #define AUTH_NULL 0 /* backward compatibility */ | |||
#define AUTH_SYS 1 /* unix style (uid, gids) */ | #define AUTH_SYS 1 /* unix style (uid, gids) */ | |||
#define AUTH_UNIX AUTH_SYS | #define AUTH_UNIX AUTH_SYS | |||
#define AUTH_SHORT 2 /* short hand unix style */ | #define AUTH_SHORT 2 /* short hand unix style */ | |||
#define AUTH_DH 3 /* for Diffie-Hellman mechan ism */ | #define AUTH_DH 3 /* for Diffie-Hellman mechan ism */ | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 38 lines changed or added | |||
auth_gss.h | auth_gss.h | |||
---|---|---|---|---|
skipping to change at line 122 | skipping to change at line 122 | |||
caddr_t xdr_ptr, gss_ctx_id_t ctx, | caddr_t xdr_ptr, gss_ctx_id_t ctx, | |||
gss_qop_t qop, rpc_gss_svc_t svc, | gss_qop_t qop, rpc_gss_svc_t svc, | |||
u_int seq)); | u_int seq)); | |||
AUTH *authgss_create __P((CLIENT *, gss_name_t, | AUTH *authgss_create __P((CLIENT *, gss_name_t, | |||
struct rpc_gss_sec *)); | struct rpc_gss_sec *)); | |||
AUTH *authgss_create_default __P((CLIENT *, char *, struct rpc_gss_sec *) ); | AUTH *authgss_create_default __P((CLIENT *, char *, struct rpc_gss_sec *) ); | |||
bool_t authgss_service __P((AUTH *auth, int svc)); | bool_t authgss_service __P((AUTH *auth, int svc)); | |||
bool_t authgss_get_private_data __P((AUTH *auth, | bool_t authgss_get_private_data __P((AUTH *auth, | |||
struct authgss_private_data *)); | struct authgss_private_data *)); | |||
bool_t authgss_free_private_data __P((struct authgss_private_data *)); | ||||
void log_debug __P((const char *fmt, ...)); | void gss_log_debug __P((const char *fmt, ...)); | |||
void log_status __P((char *m, OM_uint32 major, | void gss_log_status __P((char *m, OM_uint32 major, | |||
OM_uint32 minor)); | OM_uint32 minor)); | |||
void log_hexdump __P((const u_char *buf, int len, int offset) ); | void gss_log_hexdump __P((const u_char *buf, int len, int offset) ); | |||
__END_DECLS | __END_DECLS | |||
#endif /* !_TIRPC_AUTH_GSS_H */ | #endif /* !_TIRPC_AUTH_GSS_H */ | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added | |||
des.h | des.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF T HE | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF T HE | |||
* POSSIBILITY OF SUCH DAMAGE. | * POSSIBILITY OF SUCH DAMAGE. | |||
*/ | */ | |||
/* | /* | |||
* Generic DES driver interface | * Generic DES driver interface | |||
* Keep this file hardware independent! | * Keep this file hardware independent! | |||
* Copyright (c) 1986 by Sun Microsystems, Inc. | * Copyright (c) 1986 by Sun Microsystems, Inc. | |||
*/ | */ | |||
#ifndef _RPC_DES_H_ | ||||
#define _RPC_DES_H_ | ||||
#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */ | #define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */ | |||
#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */ | #define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */ | |||
enum desdir { ENCRYPT, DECRYPT }; | enum desdir { ENCRYPT, DECRYPT }; | |||
enum desmode { CBC, ECB }; | enum desmode { CBC, ECB }; | |||
/* | /* | |||
* parameters to ioctl call | * parameters to ioctl call | |||
*/ | */ | |||
struct desparams { | struct desparams { | |||
skipping to change at line 83 | skipping to change at line 86 | |||
* Encrypt of small amount of data, quickly | * Encrypt of small amount of data, quickly | |||
*/ | */ | |||
#define DESIOCQUICK _IOWR('d', 7, struct desparams) | #define DESIOCQUICK _IOWR('d', 7, struct desparams) | |||
#endif | #endif | |||
/* | /* | |||
* Software DES. | * Software DES. | |||
*/ | */ | |||
extern int _des_crypt( char *, int, struct desparams * ); | extern int _des_crypt( char *, int, struct desparams * ); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
rpcent.h | rpcent.h | |||
---|---|---|---|---|
skipping to change at line 57 | skipping to change at line 57 | |||
__BEGIN_DECLS | __BEGIN_DECLS | |||
/* These are defined in /usr/include/rpc/netdb.h */ | /* These are defined in /usr/include/rpc/netdb.h */ | |||
#if 0 | #if 0 | |||
struct rpcent { | struct rpcent { | |||
char *r_name; /* name of server for this rpc program */ | char *r_name; /* name of server for this rpc program */ | |||
char **r_aliases; /* alias list */ | char **r_aliases; /* alias list */ | |||
int r_number; /* rpc program number */ | int r_number; /* rpc program number */ | |||
}; | }; | |||
extern struct rpcent *getrpcbyname_r(const char *, struct rpcent *, | ||||
char *, int); | ||||
extern struct rpcent *getrpcbynumber_r(int, struct rpcent *, char *, int); | ||||
extern struct rpcent *getrpcent_r(struct rpcent *, char *, int); | ||||
/* Old interfaces that return a pointer to a static area; MT-unsafe */ | /* Old interfaces that return a pointer to a static area; MT-unsafe */ | |||
extern struct rpcent *getrpcbyname(char *); | extern struct rpcent *getrpcbyname(const char *); | |||
extern struct rpcent *getrpcbynumber(int); | extern struct rpcent *getrpcbynumber(int); | |||
extern struct rpcent *getrpcent(void); | extern struct rpcent *getrpcent(void); | |||
#endif | #endif | |||
extern void setrpcent(int) __THROW; | extern void setrpcent(int) __THROW; | |||
extern void endrpcent(void) __THROW; | extern void endrpcent(void) __THROW; | |||
__END_DECLS | __END_DECLS | |||
#endif /* !_RPC_CENT_H */ | #endif /* !_RPC_CENT_H */ | |||
End of changes. 2 change blocks. | ||||
6 lines changed or deleted | 1 lines changed or added | |||
svc_auth.h | svc_auth.h | |||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
* | * | |||
* Copyright (C) 1984, Sun Microsystems, Inc. | * Copyright (C) 1984, Sun Microsystems, Inc. | |||
*/ | */ | |||
#ifndef _RPC_SVC_AUTH_H | #ifndef _RPC_SVC_AUTH_H | |||
#define _RPC_SVC_AUTH_H | #define _RPC_SVC_AUTH_H | |||
/* | /* | |||
* Interface to server-side authentication flavors. | * Interface to server-side authentication flavors. | |||
*/ | */ | |||
typedef struct { | typedef struct SVCAUTH { | |||
struct svc_auth_ops { | struct svc_auth_ops { | |||
int (*svc_ah_wrap)(void); | int (*svc_ah_wrap)(struct SVCAUTH *, XDR *, xdrproc_t, | |||
int (*svc_ah_unwrap)(void); | caddr_t); | |||
int (*svc_ah_destroy)(void); | int (*svc_ah_unwrap)(struct SVCAUTH *, XDR *, xdrproc_t, | |||
caddr_t); | ||||
int (*svc_ah_destroy)(struct SVCAUTH *); | ||||
} *svc_ah_ops; | } *svc_ah_ops; | |||
caddr_t svc_ah_private; | caddr_t svc_ah_private; | |||
} SVCAUTH; | } SVCAUTH; | |||
#define SVCAUTH_DESTROY(cred) ((*(cred)->svc_ah_ops->svc_ah_destro | #define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ | |||
y)()) | ((*((auth)->svc_ah_ops->svc_ah_wrap))(auth, xdrs, xfunc, xwhere)) | |||
#define svcauth_destroy(cred) ((*(cred)->svc_ah_ops->svc_ah_destro | #define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ | |||
y)()) | ((*((auth)->svc_ah_ops->svc_ah_unwrap))(auth, xdrs, xfunc, xwhere)) | |||
#define SVCAUTH_DESTROY(auth) \ | ||||
((*((auth)->svc_ah_ops->svc_ah_destroy))(auth)) | ||||
/* | /* | |||
* Server side authenticator | * Server side authenticator | |||
*/ | */ | |||
__BEGIN_DECLS | __BEGIN_DECLS | |||
extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *); | extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *); | |||
extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *, | extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *, | |||
struct rpc_msg *)); | struct rpc_msg *)); | |||
__END_DECLS | __END_DECLS | |||
End of changes. 3 change blocks. | ||||
8 lines changed or deleted | 12 lines changed or added | |||