krb5 commit: Remove unused GSS code
ghudson at mit.edu
ghudson at mit.edu
Mon Jul 8 19:34:24 EDT 2024
https://github.com/krb5/krb5/commit/354f176ba6d6cc544e1c15712a13f9c006ca605d
commit 354f176ba6d6cc544e1c15712a13f9c006ca605d
Author: Greg Hudson <ghudson at mit.edu>
Date: Mon Jul 1 22:58:45 2024 -0400
Remove unused GSS code
Commit b0031448502561da31fb8c2543c8b01d7df9a872 removed the only
consumers of util_set.c. Also remove declarations for g_strdup() and
g_local_host_name(), which were unused as far back as krb5-1.0.
src/lib/gssapi/generic/Makefile.in | 3 --
src/lib/gssapi/generic/gssapiP_generic.h | 37 -------------
src/lib/gssapi/generic/util_set.c | 91 --------------------------------
src/lib/gssapi/krb5/gssapiP_krb5.h | 2 -
src/lib/gssapi/krb5/gssapi_krb5.c | 6 ---
5 files changed, 139 deletions(-)
diff --git a/src/lib/gssapi/generic/Makefile.in b/src/lib/gssapi/generic/Makefile.in
index 1a95a7d3b..2eb4857fb 100644
--- a/src/lib/gssapi/generic/Makefile.in
+++ b/src/lib/gssapi/generic/Makefile.in
@@ -66,7 +66,6 @@ SRCS = \
$(srcdir)/util_buffer.c \
$(srcdir)/util_buffer_set.c \
$(srcdir)/util_errmap.c \
- $(srcdir)/util_set.c \
$(srcdir)/util_seqstate.c \
$(srcdir)/util_token.c \
gssapi_err_generic.c
@@ -83,7 +82,6 @@ OBJS = \
$(OUTPRE)util_buffer.$(OBJEXT) \
$(OUTPRE)util_buffer_set.$(OBJEXT) \
$(OUTPRE)util_errmap.$(OBJEXT) \
- $(OUTPRE)util_set.$(OBJEXT) \
$(OUTPRE)util_seqstate.$(OBJEXT) \
$(OUTPRE)util_token.$(OBJEXT) \
$(OUTPRE)gssapi_err_generic.$(OBJEXT)
@@ -98,7 +96,6 @@ STLIBOBJS = \
util_buffer.o \
util_buffer_set.o \
util_errmap.o \
- util_set.o \
util_seqstate.o \
util_token.o \
gssapi_err_generic.o
diff --git a/src/lib/gssapi/generic/gssapiP_generic.h b/src/lib/gssapi/generic/gssapiP_generic.h
index 3c6bfa53d..7201f2ad5 100644
--- a/src/lib/gssapi/generic/gssapiP_generic.h
+++ b/src/lib/gssapi/generic/gssapiP_generic.h
@@ -66,11 +66,6 @@
/** helper functions **/
/* hide names from applications, especially glib applications */
-#define g_set_init gssint_g_set_init
-#define g_set_destroy gssint_g_set_destroy
-#define g_set_entry_add gssint_g_set_entry_add
-#define g_set_entry_delete gssint_g_set_entry_delete
-#define g_set_entry_get gssint_g_set_entry_get
#define g_make_string_buffer gssint_g_make_string_buffer
#define g_token_size gssint_g_token_size
#define g_make_token_header gssint_g_make_token_header
@@ -84,39 +79,9 @@
#define g_seqstate_externalize gssint_g_seqstate_externalize
#define g_seqstate_internalize gssint_g_seqstate_internalize
#define g_canonicalize_host gssint_g_canonicalize_host
-#define g_local_host_name gssint_g_local_host_name
-#define g_strdup gssint_g_strdup
-
-typedef struct _g_set_elt *g_set_elt;
-typedef struct {
- k5_mutex_t mutex;
- void *data;
-} g_set;
-#define G_SET_INIT { K5_MUTEX_PARTIAL_INITIALIZER, 0 }
typedef struct g_seqnum_state_st *g_seqnum_state;
-int g_set_init (g_set_elt *s);
-int g_set_destroy (g_set_elt *s);
-int g_set_entry_add (g_set_elt *s, void *key, void *value);
-int g_set_entry_delete (g_set_elt *s, void *key);
-int g_set_entry_get (g_set_elt *s, void *key, void **value);
-
-int g_save_name (g_set *vdb, gss_name_t name);
-int g_save_cred_id (g_set *vdb, gss_cred_id_t cred);
-int g_save_ctx_id (g_set *vdb, gss_ctx_id_t ctx);
-int g_save_lucidctx_id (g_set *vdb, void *lctx);
-
-int g_validate_name (g_set *vdb, gss_name_t name);
-int g_validate_cred_id (g_set *vdb, gss_cred_id_t cred);
-int g_validate_ctx_id (g_set *vdb, gss_ctx_id_t ctx);
-int g_validate_lucidctx_id (g_set *vdb, void *lctx);
-
-int g_delete_name (g_set *vdb, gss_name_t name);
-int g_delete_cred_id (g_set *vdb, gss_cred_id_t cred);
-int g_delete_ctx_id (g_set *vdb, gss_ctx_id_t ctx);
-int g_delete_lucidctx_id (g_set *vdb, void *lctx);
-
int g_make_string_buffer (const char *str, gss_buffer_t buffer);
unsigned int g_token_size (const gss_OID_desc * mech, unsigned int body_size);
@@ -152,8 +117,6 @@ long g_seqstate_externalize(g_seqnum_state state, unsigned char **buf,
long g_seqstate_internalize(g_seqnum_state *state_out, unsigned char **buf,
size_t *lenremain);
-char *g_strdup (char *str);
-
/** declarations of internal name mechanism functions **/
OM_uint32
diff --git a/src/lib/gssapi/generic/util_set.c b/src/lib/gssapi/generic/util_set.c
deleted file mode 100644
index 432a9ee0d..000000000
--- a/src/lib/gssapi/generic/util_set.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-/*
- * Copyright 1995 by OpenVision Technologies, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of OpenVision not be used
- * in advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. OpenVision makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * $Id$
- */
-
-#include "gssapiP_generic.h"
-
-struct _g_set_elt {
- void *key;
- void *value;
- struct _g_set_elt *next;
-};
-
-int g_set_init(g_set_elt *s)
-{
- *s = NULL;
-
- return(0);
-}
-
-int g_set_entry_add(g_set_elt *s, void *key, void *value)
-{
- g_set_elt first;
-
- if ((first = (struct _g_set_elt *) malloc(sizeof(struct _g_set_elt))) == NULL)
- return(ENOMEM);
-
- first->key = key;
- first->value = value;
- first->next = *s;
-
- *s = first;
-
- return(0);
-}
-
-int g_set_entry_delete(g_set_elt *s, void *key)
-{
- g_set_elt *p;
-
- for (p=s; *p; p = &((*p)->next)) {
- if ((*p)->key == key) {
- g_set_elt next = (*p)->next;
- free(*p);
- *p = next;
-
- return(0);
- }
- }
-
- return(-1);
-}
-
-int g_set_entry_get(g_set_elt *s, void *key, void **value)
-{
- g_set_elt p;
-
- for (p = *s; p; p = p->next) {
- if (p->key == key) {
- *value = p->value;
-
- return(0);
- }
- }
-
- *value = NULL;
-
- return(-1);
-}
diff --git a/src/lib/gssapi/krb5/gssapiP_krb5.h b/src/lib/gssapi/krb5/gssapiP_krb5.h
index 0ebe3a63c..3d6aaccf7 100644
--- a/src/lib/gssapi/krb5/gssapiP_krb5.h
+++ b/src/lib/gssapi/krb5/gssapiP_krb5.h
@@ -247,8 +247,6 @@ typedef struct _krb5_gss_ctx_id_rec {
krb5_authdata **authdata;
} krb5_gss_ctx_id_rec, *krb5_gss_ctx_id_t;
-extern g_set kg_vdb;
-
#ifndef LEAN_CLIENT
extern k5_mutex_t gssint_krb5_keytab_lock;
#endif /* LEAN_CLIENT */
diff --git a/src/lib/gssapi/krb5/gssapi_krb5.c b/src/lib/gssapi/krb5/gssapi_krb5.c
index 370b7d152..6c7cf2344 100644
--- a/src/lib/gssapi/krb5/gssapi_krb5.c
+++ b/src/lib/gssapi/krb5/gssapi_krb5.c
@@ -188,8 +188,6 @@ const gss_OID_set gss_mech_set_krb5_old = &kg_oidsets[1];
const gss_OID_set gss_mech_set_krb5_both = &kg_oidsets[2];
const gss_OID_set kg_all_mechs = &kg_oidsets[3];
-g_set kg_vdb = G_SET_INIT;
-
/** default credential support */
/*
@@ -1073,9 +1071,6 @@ int gss_krb5int_lib_init(void)
err = k5_mutex_finish_init(&kg_kdc_flag_mutex);
if (err)
return err;
- err = k5_mutex_finish_init(&kg_vdb.mutex);
- if (err)
- return err;
#endif
#ifdef _GSS_STATIC_LINK
err = gss_krb5mechglue_init();
@@ -1107,7 +1102,6 @@ void gss_krb5int_lib_fini(void)
k5_key_delete(K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME);
k5_key_delete(K5_KEY_GSS_KRB5_CCACHE_NAME);
k5_key_delete(K5_KEY_GSS_KRB5_ERROR_MESSAGE);
- k5_mutex_destroy(&kg_vdb.mutex);
#ifndef _WIN32
k5_mutex_destroy(&kg_kdc_flag_mutex);
#endif
More information about the cvs-krb5
mailing list