2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
7 #include "gssapi_err_generic.h"
8 #include "gssapi_err_krb5.h"
9 #include "gssapiP_krb5.h"
11 #include "gss_libinit.h"
12 #include "k5-platform.h"
16 * Initialize the GSSAPI library.
19 MAKE_INIT_FUNCTION(gssint_lib_init
);
20 MAKE_FINI_FUNCTION(gssint_lib_fini
);
22 int gssint_lib_init(void)
26 #ifdef SHOW_INITFINI_FUNCS
27 printf("gssint_lib_init\n");
30 #if !USE_BUNDLE_ERROR_STRINGS
31 add_error_table(&et_k5g_error_table
);
32 add_error_table(&et_ggss_error_table
);
34 #if 0 /* SUNW15resync */
35 err
= gssint_mechglue_init();
39 err
= k5_mutex_finish_init(&gssint_krb5_keytab_lock
);
42 err
= k5_key_register(K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME
, free
);
45 err
= k5_key_register(K5_KEY_GSS_KRB5_CCACHE_NAME
, free
);
48 err
= k5_key_register(K5_KEY_GSS_KRB5_ERROR_MESSAGE
,
49 krb5_gss_delete_error_info
);
53 err
= k5_mutex_finish_init(&kg_kdc_flag_mutex
);
57 return k5_mutex_finish_init(&kg_vdb
.mutex
);
60 void gssint_lib_fini(void)
62 if (!INITIALIZER_RAN(gssint_lib_init
) || PROGRAM_EXITING()) {
63 #ifdef SHOW_INITFINI_FUNCS
64 printf("gssint_lib_fini: skipping\n");
68 #ifdef SHOW_INITFINI_FUNCS
69 printf("gssint_lib_fini\n");
71 #if !USE_BUNDLE_ERROR_STRINGS
72 remove_error_table(&et_k5g_error_table
);
73 remove_error_table(&et_ggss_error_table
);
75 k5_key_delete(K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME
);
76 k5_key_delete(K5_KEY_GSS_KRB5_CCACHE_NAME
);
77 k5_mutex_destroy(&kg_vdb
.mutex
);
79 k5_mutex_destroy(&kg_kdc_flag_mutex
);
81 k5_mutex_destroy(&gssint_krb5_keytab_lock
);
82 #if 0 /* SUNW15resync */
83 gssint_mechglue_fini();
87 OM_uint32
gssint_initialize_library (void)
89 return CALL_INIT_FUNCTION(gssint_lib_init
);