summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2001-06-27 21:16:13 +0000
committerEzra Peisach <epeisach@mit.edu>2001-06-27 21:16:13 +0000
commit8a1635f11d8d10708a16865011c213b923a4baaa (patch)
treec765c1fa7ce0f7129858acaa94fb6ffe2744aa25
parentc8e13d295727448b483a0b5f0f809af8a52ccbfe (diff)
downloadkrb5-8a1635f11d8d10708a16865011c213b923a4baaa.tar.gz
krb5-8a1635f11d8d10708a16865011c213b923a4baaa.tar.xz
krb5-8a1635f11d8d10708a16865011c213b923a4baaa.zip
*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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13521 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/rpc/ChangeLog20
-rw-r--r--src/lib/rpc/auth.h33
-rw-r--r--src/lib/rpc/auth_gssapi.c20
-rw-r--r--src/lib/rpc/auth_gssapi.h7
-rw-r--r--src/lib/rpc/auth_none.c28
-rw-r--r--src/lib/rpc/auth_unix.c21
-rw-r--r--src/lib/rpc/auth_unix.h2
-rw-r--r--src/lib/rpc/bindresvport.c1
8 files changed, 88 insertions, 44 deletions
diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog
index 540a0ca10..050630fd3 100644
--- a/src/lib/rpc/ChangeLog
+++ b/src/lib/rpc/ChangeLog
@@ -1,3 +1,23 @@
+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
diff --git a/src/lib/rpc/auth.h b/src/lib/rpc/auth.h
index 5f221c0a6..e47a3881e 100644
--- a/src/lib/rpc/auth.h
+++ b/src/lib/rpc/auth.h
@@ -90,18 +90,29 @@ struct opaque_auth {
/*
* 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;
@@ -138,13 +149,13 @@ typedef struct {
#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))
@@ -170,7 +181,7 @@ extern struct opaque_auth _null_auth;
#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
diff --git a/src/lib/rpc/auth_gssapi.c b/src/lib/rpc/auth_gssapi.c
index 2a4bcb245..e16fe686b 100644
--- a/src/lib/rpc/auth_gssapi.c
+++ b/src/lib/rpc/auth_gssapi.c
@@ -32,15 +32,15 @@ int auth_debug_gssapi = DEBUG_GSSAPI;
#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,
@@ -537,8 +537,8 @@ static bool_t marshall_new_creds(auth, auth_msg, client_handle)
*
* Effects: None. Never called.
*/
-static void auth_gssapi_nextverf(/*auth*/)
- /*AUTH *auth;*/
+static void auth_gssapi_nextverf(auth)
+ AUTH *auth;
{
}
diff --git a/src/lib/rpc/auth_gssapi.h b/src/lib/rpc/auth_gssapi.h
index 56b6631f4..bd6ea173c 100644
--- a/src/lib/rpc/auth_gssapi.h
+++ b/src/lib/rpc/auth_gssapi.h
@@ -77,9 +77,10 @@ typedef void (*auth_gssapi_log_miscerr_func)
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,
diff --git a/src/lib/rpc/auth_none.c b/src/lib/rpc/auth_none.c
index 5e97405c0..115286865 100644
--- a/src/lib/rpc/auth_none.c
+++ b/src/lib/rpc/auth_none.c
@@ -48,11 +48,11 @@ static char sccsid[] = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
/*
* 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,
@@ -111,26 +111,36 @@ authnone_marshal(client, xdrs)
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;
{
}
diff --git a/src/lib/rpc/auth_unix.c b/src/lib/rpc/auth_unix.c
index 789b3695b..696bb1f1e 100644
--- a/src/lib/rpc/auth_unix.c
+++ b/src/lib/rpc/auth_unix.c
@@ -56,11 +56,11 @@ static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";
/*
* 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,
@@ -84,7 +84,7 @@ struct audata {
};
#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
-static void marshal_new_auth();
+static void marshal_new_auth(AUTH *);
/*
@@ -212,14 +212,14 @@ authunix_marshal(auth, xdrs)
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,
@@ -240,8 +240,9 @@ authunix_validate(auth, verf)
}
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;
diff --git a/src/lib/rpc/auth_unix.h b/src/lib/rpc/auth_unix.h
index e4ee994d8..e4e58a22a 100644
--- a/src/lib/rpc/auth_unix.h
+++ b/src/lib/rpc/auth_unix.h
@@ -61,7 +61,7 @@ struct authunix_parms {
};
#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,
diff --git a/src/lib/rpc/bindresvport.c b/src/lib/rpc/bindresvport.c
index b23b8e625..36b3ed533 100644
--- a/src/lib/rpc/bindresvport.c
+++ b/src/lib/rpc/bindresvport.c
@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC 1.8 88/02/08
#include <sys/errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <gssrpc/rpc.h>
/*
* Bind a socket to a privileged IP port