update gssapi/ntlm for windows build
NTMakefile: replace ntlm/inquire_cred.c with ntlm/creds.c add ntlm/inquire_sec_context_by_oid.c add ntlm/iter_cred.c add missing GSSAPI_CALLCONV function descriptors conditionalize use of kcm functions with HAVE_KCM Change-Id: Ia693f67304405bd540c57db8858c13314cd60322
This commit is contained in:

committed by
Jeffrey Altman

parent
31de117576
commit
75959422e1
@@ -35,7 +35,8 @@
|
||||
|
||||
#include "ntlm.h"
|
||||
|
||||
OM_uint32 _gss_ntlm_inquire_cred
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_ntlm_inquire_cred
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
gss_name_t * name,
|
||||
@@ -85,26 +86,20 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
OM_uint32
|
||||
_gss_ntlm_destroy_cred(OM_uint32 *minor_status,
|
||||
gss_cred_id_t *cred_handle)
|
||||
#ifdef HAVE_KCM
|
||||
static OM_uint32
|
||||
_gss_ntlm_destroy_kcm_cred(gss_cred_id_t *cred_handle)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
krb5_storage *request, *response;
|
||||
krb5_data response_data;
|
||||
krb5_context context;
|
||||
ntlm_cred cred;
|
||||
|
||||
if (cred_handle == NULL || *cred_handle == GSS_C_NO_CREDENTIAL)
|
||||
return GSS_S_COMPLETE;
|
||||
|
||||
cred = (ntlm_cred)*cred_handle;
|
||||
|
||||
ret = krb5_init_context(&context);
|
||||
if (ret) {
|
||||
*minor_status = ret;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = krb5_kcm_storage_request(context, KCM_OP_DEL_NTLM_CRED, &request);
|
||||
if (ret)
|
||||
@@ -128,10 +123,29 @@ _gss_ntlm_destroy_cred(OM_uint32 *minor_status,
|
||||
|
||||
out:
|
||||
krb5_free_context(context);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* HAVE_KCM */
|
||||
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_ntlm_destroy_cred(OM_uint32 *minor_status,
|
||||
gss_cred_id_t *cred_handle)
|
||||
{
|
||||
#ifdef HAVE_KCM
|
||||
krb5_error_code ret;
|
||||
#endif
|
||||
|
||||
if (cred_handle == NULL || *cred_handle == GSS_C_NO_CREDENTIAL)
|
||||
return GSS_S_COMPLETE;
|
||||
|
||||
#ifdef HAVE_KCM
|
||||
ret = _gss_ntlm_destroy_kcm_cred(cred_handle);
|
||||
if (ret) {
|
||||
*minor_status = ret;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return _gss_ntlm_release_cred(minor_status, cred_handle);
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "ntlm.h"
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_ntlm_inquire_sec_context_by_oid(OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
const gss_OID desired_object,
|
||||
|
@@ -35,11 +35,12 @@
|
||||
|
||||
#include "ntlm.h"
|
||||
|
||||
void
|
||||
void GSSAPI_CALLCONV
|
||||
_gss_ntlm_iter_creds_f(OM_uint32 flags,
|
||||
void *userctx ,
|
||||
void (*cred_iter)(void *, gss_OID, gss_cred_id_t))
|
||||
{
|
||||
#ifdef HAVE_KCM
|
||||
krb5_error_code ret;
|
||||
krb5_context context = NULL;
|
||||
krb5_storage *request, *response;
|
||||
@@ -93,5 +94,6 @@ _gss_ntlm_iter_creds_f(OM_uint32 flags,
|
||||
done:
|
||||
if (context)
|
||||
krb5_free_context(context);
|
||||
#endif /* HAVE_KCM */
|
||||
(*cred_iter)(userctx, NULL, NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user