diff options
| author | Marc Horowitz <marc@mit.edu> | 1998-10-30 02:56:35 +0000 |
|---|---|---|
| committer | Marc Horowitz <marc@mit.edu> | 1998-10-30 02:56:35 +0000 |
| commit | 1440ab035ba04550ddbbfbff1ee9b5571e3d95db (patch) | |
| tree | 9d5e8d2e151a930e044c7d0f7c64053d244577a0 /src/lib/rpc | |
| parent | 61ddbf948ba6ee70c1bc049268c3dfa73bc9983e (diff) | |
| download | krb5-1440ab035ba04550ddbbfbff1ee9b5571e3d95db.tar.gz krb5-1440ab035ba04550ddbbfbff1ee9b5571e3d95db.tar.xz krb5-1440ab035ba04550ddbbfbff1ee9b5571e3d95db.zip | |
pull up 3des implementation from the marc-3des branch
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11001 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/rpc')
| -rw-r--r-- | src/lib/rpc/ChangeLog | 9 | ||||
| -rw-r--r-- | src/lib/rpc/Makefile.in | 2 | ||||
| -rw-r--r-- | src/lib/rpc/auth_gssapi.h | 6 | ||||
| -rw-r--r-- | src/lib/rpc/svc_auth_gssapi.c | 43 |
4 files changed, 50 insertions, 10 deletions
diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 7db853923..50ec692cb 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,12 @@ +1998-10-27 Marc Horowitz <marc@mit.edu> + + * svc_auth_gssapi.c, auth_gssapi.h: fix the set_name prototype, + add a new unset_names function + +Sun Jul 26 18:13:39 1998 Sam Hartman <hartmans@utwig.mesas.com> + + * Makefile.in (LIBMAJOR): bump libmajor + Wed Apr 15 18:07:38 1998 Tom Yu <tlyu@mit.edu> * Makefile.in (SHLIB_EXPDEPS): diff --git a/src/lib/rpc/Makefile.in b/src/lib/rpc/Makefile.in index 1340d3ffd..a03ef026f 100644 --- a/src/lib/rpc/Makefile.in +++ b/src/lib/rpc/Makefile.in @@ -6,7 +6,7 @@ CFLAGS = $(CCOPTS) $(DEFS) -DGSSAPI_KRB5 -DDEBUG_GSSAPI=0 ##DOSLIBNAME=libgssrpc.lib LIB=gssrpc -LIBMAJOR=2 +LIBMAJOR=3 LIBMINOR=0 STOBJLISTS=OBJS.ST SHLIB_EXPDEPS= \ diff --git a/src/lib/rpc/auth_gssapi.h b/src/lib/rpc/auth_gssapi.h index 218b5cb9d..2cdd20f2f 100644 --- a/src/lib/rpc/auth_gssapi.h +++ b/src/lib/rpc/auth_gssapi.h @@ -111,8 +111,10 @@ PROTOTYPE((CLIENT *clnt, char *service_name)); void auth_gssapi_display_status PROTOTYPE((char *msg, OM_uint32 major, OM_uint32 minor)); -bool_t _svcauth_gssapi_set_name -PROTOTYPE((char *name, gss_OID name_type)); +bool_t _svcauth_gssapi_set_names +PROTOTYPE((auth_gssapi_name *names, int num)); +void _svcauth_gssapi_unset_names +PROTOTYPE(()); void _svcauth_set_log_badauth_func PROTOTYPE((auth_gssapi_log_badauth_func func, diff --git a/src/lib/rpc/svc_auth_gssapi.c b/src/lib/rpc/svc_auth_gssapi.c index 2a3233ee9..df59859f0 100644 --- a/src/lib/rpc/svc_auth_gssapi.c +++ b/src/lib/rpc/svc_auth_gssapi.c @@ -887,7 +887,7 @@ done: } /* - * Function: _svcauth_gssapi_set_name + * Function: _svcauth_gssapi_set_names * * Purpose: Sets the list of service names for which incoming * authentication requests should be honored. @@ -917,6 +917,13 @@ bool_t _svcauth_gssapi_set_names(names, num) goto fail; for (i = 0; i < num; i++) { + server_name_list[i] = 0; + server_creds_list[i] = 0; + } + + server_creds_count = num; + + for (i = 0; i < num; i++) { in_buf.value = names[i].name; in_buf.length = strlen(in_buf.value) + 1; @@ -939,19 +946,41 @@ bool_t _svcauth_gssapi_set_names(names, num) } } - server_creds_count = num; - return TRUE; fail: - /* memory leak: not releasing names/creds already acquired */ - if (server_creds_list) + _svcauth_gssapi_unset_names(); + + return FALSE; +} + +/* Function: _svcauth_gssapi_unset_names + * + * Purpose: releases the names and credentials allocated by + * _svcauth_gssapi_set_names + */ + +void _svcauth_gssapi_unset_names() +{ + int i; + OM_uint32 minor_stat; + + if (server_creds_list) { + for (i = 0; i < server_creds_count; i++) + if (server_creds_list[i]) + gss_release_cred(&minor_stat, &server_creds_list[i]); free(server_creds_list); - if (server_name_list) + } + + if (server_name_list) { + for (i = 0; i < server_creds_count; i++) + if (server_name_list[i]) + gss_release_name(&minor_stat, &server_name_list[i]); free(server_name_list); - return FALSE; + } } + /* * Function: _svcauth_gssapi_set_log_badauth_func * |
