gss: expose gss_destroy_cred()

Build and export gss_destroy_cred(). This permanently destroys the credential,
rather than releasing a handle to it.
This commit is contained in:
Luke Howard
2019-12-29 00:15:49 +11:00
parent 8478dd1c88
commit e69c2a8111
4 changed files with 23 additions and 2 deletions

View File

@@ -99,6 +99,7 @@ mechsrc = \
mech/gss_decapsulate_token.c \
mech/gss_delete_name_attribute.c \
mech/gss_delete_sec_context.c \
mech/gss_destroy_cred.c \
mech/gss_display_name.c \
mech/gss_display_name_ext.c \
mech/gss_display_status.c \

View File

@@ -116,6 +116,7 @@ mechsrc = \
mech/gss_decapsulate_token.c \
mech/gss_delete_name_attribute.c \
mech/gss_delete_sec_context.c \
mech/gss_destroy_cred.c \
mech/gss_display_name.c \
mech/gss_display_name_ext.c \
mech/gss_display_status.c \
@@ -351,6 +352,7 @@ libgssapi_OBJs = \
$(OBJ)\mech/gss_decapsulate_token.obj \
$(OBJ)\mech/gss_delete_name_attribute.obj \
$(OBJ)\mech/gss_delete_sec_context.obj \
$(OBJ)\mech/gss_destroy_cred.obj \
$(OBJ)\mech/gss_display_name.obj \
$(OBJ)\mech/gss_display_name_ext.obj \
$(OBJ)\mech/gss_display_status.obj \

View File

@@ -1208,6 +1208,10 @@ gss_release_cred_by_mech(
GSSAPI_LIB_FUNCTION void GSSAPI_LIB_CALL
gss_set_log_function(void *ctx, void (*func)(void * ctx, int level, const char *fmt, va_list));
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_FUNCTION
gss_destroy_cred(OM_uint32 *minor_status,
gss_cred_id_t *cred_handle);
GSSAPI_CPP_END
#if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))

View File

@@ -29,8 +29,22 @@
#include "mech_locl.h"
#include <heim_threads.h>
OM_uint32 GSSAPI_LIB_FUNCTION
gss_destroy_cred(void *status,
/**
* Destroy a credential
*
* gss_release_cred() frees the memory, gss_destroy_cred() removes the credentials from memory/disk and then call gss_release_cred() on the credential.
*
* @param min_stat minor status code
* @param cred_handle credentail to destory
*
* @returns a gss_error code, see gss_display_status() about printing
* the error code.
*
* @ingroup gssapi
*/
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_FUNCTION
gss_destroy_cred(OM_uint32 *minor_status,
gss_cred_id_t *cred_handle)
{
struct _gss_cred *cred;