+2001-06-27 Ezra Peisach <epeisach@mit.edu>
+
+ * bindresvport.c: Include gssrpc/rpc.h for prototype.
+
+ * auth_unix.h: Expand prototype for xdr_authunix_params to include
+ arguments.
+
+ * auth_gssapi.h: Give full prototypes for xdr_gss_buf,
+ xdr_authgssapi_creds, xdr_authgssapi_init_arg and
+ xdr_authgssapi_init_res.
+
+ * auth_gssapi.c, auth_none.c, auth_unix.c: For struct AUTH
+ disptach functions, provide full prototypes and ensure consistant
+ usage in functions
+
+ * auth.h: Provide prototypes dispatch functions in struct
+ AUTH. Give a forward declaration of struct rpc_msg. Change
+ duplicate definitions of AUTH_WRAP and AUTH_UNWRAP into auth_wrap
+ and auth_unwrap. Give full prototype for authany_wrap.
+
2001-06-21 Ezra Peisach <epeisach@mit.edu>
* svc_simple.c (universal): Change transp to s_transp to not
/*
* Auth handle, interface to client side authenticators.
*/
-typedef struct {
+struct rpc_msg;
+
+typedef struct __rpc_auth {
struct opaque_auth ah_cred;
struct opaque_auth ah_verf;
union des_block ah_key;
struct auth_ops {
- void (*ah_nextverf)();
- int (*ah_marshal)(); /* nextverf & serialize */
- int (*ah_validate)(); /* validate varifier */
- int (*ah_refresh)(); /* refresh credentials */
- void (*ah_destroy)(); /* destroy this structure */
- int (*ah_wrap)(); /* encode data for wire */
- int (*ah_unwrap)(); /* decode data from wire */
+ void (*ah_nextverf)(struct __rpc_auth *);
+ /* nextverf & serialize */
+ int (*ah_marshal)(struct __rpc_auth *, XDR *);
+ /* validate varifier */
+ int (*ah_validate)(struct __rpc_auth *,
+ struct opaque_auth *);
+ /* refresh credentials */
+ int (*ah_refresh)(struct __rpc_auth *, struct rpc_msg *);
+ /* destroy this structure */
+ void (*ah_destroy)(struct __rpc_auth *);
+ /* encode data for wire */
+ int (*ah_wrap)(struct __rpc_auth *, XDR *,
+ xdrproc_t, caddr_t);
+ /* decode data from wire */
+ int (*ah_unwrap)(struct __rpc_auth *, XDR *,
+ xdrproc_t, caddr_t);
} *ah_ops;
caddr_t ah_private;
} AUTH;
#define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \
((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \
xfunc, xwhere))
-#define AUTH_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) \
+#define AUTH_unwrap(auth, xdrs, xfunc, xwhere) \
((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \
xfunc, xwhere))
#define authany_wrap gssrpc_authany_wrap
#define authany_unwrap gssrpc_authany_unwrap
-int authany_wrap(), authany_unwrap();
+int authany_wrap(AUTH *, XDR *, xdrproc_t, caddr_t), authany_unwrap();
/*
* Unix style authentication
#define AUTH_GSSAPI_DISPLAY_STATUS(args)
#endif
-static void auth_gssapi_nextverf();
-static bool_t auth_gssapi_marshall();
-static bool_t auth_gssapi_validate();
-static bool_t auth_gssapi_refresh();
-static bool_t auth_gssapi_wrap();
-static bool_t auth_gssapi_unwrap();
-static void auth_gssapi_destroy();
+static void auth_gssapi_nextverf(AUTH *);
+static bool_t auth_gssapi_marshall(AUTH *, XDR *);
+static bool_t auth_gssapi_validate(AUTH *, struct opaque_auth *);
+static bool_t auth_gssapi_refresh(AUTH *, struct rpc_msg *);
+static bool_t auth_gssapi_wrap(AUTH *, XDR *, xdrproc_t, caddr_t);
+static bool_t auth_gssapi_unwrap(AUTH *, XDR *, xdrproc_t, caddr_t);
+static void auth_gssapi_destroy(AUTH *);
-static bool_t marshall_new_creds();
+static bool_t marshall_new_creds(AUTH *, bool_t, gss_buffer_t);
static struct auth_ops auth_gssapi_ops = {
auth_gssapi_nextverf,
*
* Effects: None. Never called.
*/
-static void auth_gssapi_nextverf(/*auth*/)
- /*AUTH *auth;*/
+static void auth_gssapi_nextverf(auth)
+ AUTH *auth;
{
}
char *error,
caddr_t data));
-bool_t xdr_authgssapi_creds();
-bool_t xdr_authgssapi_init_arg();
-bool_t xdr_authgssapi_init_res();
+bool_t xdr_gss_buf(XDR *, gss_buffer_t);
+bool_t xdr_authgssapi_creds(XDR *, auth_gssapi_creds *);
+bool_t xdr_authgssapi_init_arg(XDR *, auth_gssapi_init_arg *);
+bool_t xdr_authgssapi_init_res(XDR *, auth_gssapi_init_res *);
bool_t auth_gssapi_wrap_data
PROTOTYPE((OM_uint32 *major, OM_uint32 *minor,
/*
* Authenticator operations routines
*/
-static void authnone_verf();
-static void authnone_destroy();
-static bool_t authnone_marshal();
-static bool_t authnone_validate();
-static bool_t authnone_refresh();
+static void authnone_verf(AUTH *);
+static void authnone_destroy(AUTH *);
+static bool_t authnone_marshal(AUTH *, XDR *);
+static bool_t authnone_validate(AUTH *, struct opaque_auth *);
+static bool_t authnone_refresh(AUTH *, struct rpc_msg *);
static struct auth_ops ops = {
authnone_verf,
ap->marshalled_client, ap->mcnt));
}
+/*ARGSUSED*/
static void
-authnone_verf()
+authnone_verf(auth)
+ AUTH *auth;
{
}
+/*ARGSUSED*/
static bool_t
-authnone_validate()
+authnone_validate(auth, verf)
+ AUTH *auth;
+ struct opaque_auth *verf;
{
return (TRUE);
}
+/*ARGSUSED*/
static bool_t
-authnone_refresh()
+authnone_refresh(auth, msg)
+ AUTH *auth;
+ struct rpc_msg *msg;
{
return (FALSE);
}
+/*ARGSUSED*/
static void
-authnone_destroy()
+authnone_destroy(auth)
+ AUTH *auth;
{
}
/*
* Unix authenticator operations vector
*/
-static void authunix_nextverf();
-static bool_t authunix_marshal();
-static bool_t authunix_validate();
-static bool_t authunix_refresh();
-static void authunix_destroy();
+static void authunix_nextverf(AUTH *);
+static bool_t authunix_marshal(AUTH *, XDR *);
+static bool_t authunix_validate(AUTH *, struct opaque_auth *);
+static bool_t authunix_refresh(AUTH *, struct rpc_msg *);
+static void authunix_destroy(AUTH *);
static struct auth_ops auth_unix_ops = {
authunix_nextverf,
};
#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
-static void marshal_new_auth();
+static void marshal_new_auth(AUTH *);
/*
static bool_t
authunix_validate(auth, verf)
register AUTH *auth;
- struct opaque_auth verf;
+ struct opaque_auth *verf;
{
register struct audata *au;
XDR xdrs;
- if (verf.oa_flavor == AUTH_SHORT) {
+ if (verf->oa_flavor == AUTH_SHORT) {
au = AUTH_PRIVATE(auth);
- xdrmem_create(&xdrs, verf.oa_base, verf.oa_length, XDR_DECODE);
+ xdrmem_create(&xdrs, verf->oa_base, verf->oa_length, XDR_DECODE);
if (au->au_shcred.oa_base != NULL) {
mem_free(au->au_shcred.oa_base,
}
static bool_t
-authunix_refresh(auth)
+authunix_refresh(auth, msg)
register AUTH *auth;
+ struct rpc_msg *msg;
{
register struct audata *au = AUTH_PRIVATE(auth);
struct authunix_parms aup;
};
#define xdr_authunix_parms gssrpc_xdr_authunix_parms
-extern bool_t xdr_authunix_parms();
+extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
/*
* If a response verifier has flavor AUTH_SHORT,
#include <sys/errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <gssrpc/rpc.h>
/*
* Bind a socket to a privileged IP port