remove dependency on libkrb5

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17708 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-06-28 09:45:00 +00:00
parent 37d96eb8c0
commit 799057c5f0
3 changed files with 24 additions and 17 deletions

View File

@@ -760,32 +760,32 @@ gss_spnego_accept_sec_context
mic = initialToken ? ni.mechListMIC : na.mechListMIC; mic = initialToken ? ni.mechListMIC : na.mechListMIC;
if (mic != NULL) if (mic != NULL)
require_mic = TRUE; require_mic = 1;
if (ctx->open && require_mic) { if (ctx->open && require_mic) {
if (mech_input_token == GSS_C_NO_BUFFER) { /* Even/One */ if (mech_input_token == GSS_C_NO_BUFFER) { /* Even/One */
verify_mic = TRUE; verify_mic = 1;
get_mic = FALSE; get_mic = 0;
} else if (mech_output_token != GSS_C_NO_BUFFER && } else if (mech_output_token != GSS_C_NO_BUFFER &&
mech_output_token->length == 0) { /* Odd */ mech_output_token->length == 0) { /* Odd */
get_mic = verify_mic = TRUE; get_mic = verify_mic = 1;
} else { /* Even/One */ } else { /* Even/One */
verify_mic = FALSE; verify_mic = 0;
get_mic = TRUE; get_mic = 1;
} }
if (verify_mic || get_mic) { if (verify_mic || get_mic) {
krb5_error_code kret; int eret;
size_t buf_len; size_t buf_len;
ASN1_MALLOC_ENCODE(MechTypeList, mech_buf.value, mech_buf.length, ASN1_MALLOC_ENCODE(MechTypeList,
&ctx->initiator_mech_types, &buf_len, kret); mech_buf.value, mech_buf.length,
if (kret) { &ctx->initiator_mech_types, &buf_len, eret);
if (eret) {
ret2 = GSS_S_FAILURE; ret2 = GSS_S_FAILURE;
*minor_status = kret; *minor_status = eret;
goto out; goto out;
} }
if (mech_buf.length != buf_len) if (mech_buf.length != buf_len)
abort(); abort();
} }
@@ -801,7 +801,7 @@ gss_spnego_accept_sec_context
ctx->verified_mic = 1; ctx->verified_mic = 1;
} }
} else } else
verify_mic = get_mic = FALSE; verify_mic = get_mic = 0;
if (ctx->mech_flags & GSS_C_DCE_STYLE) if (ctx->mech_flags & GSS_C_DCE_STYLE)
require_response = (negResult != accept_completed); require_response = (negResult != accept_completed);

View File

@@ -451,7 +451,7 @@ spnego_reply
* used and a non-preferred mechanism was selected * used and a non-preferred mechanism was selected
*/ */
if (resp.mechListMIC != NULL) { if (resp.mechListMIC != NULL) {
require_mic = TRUE; require_mic = 1;
} else { } else {
ret = _gss_spnego_require_mechlist_mic(minor_status, ctx, ret = _gss_spnego_require_mechlist_mic(minor_status, ctx,
&require_mic); &require_mic);
@@ -463,7 +463,7 @@ spnego_reply
} }
} }
} else { } else {
require_mic = FALSE; require_mic = 0;
} }
if (require_mic) { if (require_mic) {

View File

@@ -43,15 +43,22 @@
#include <pthread.h> #include <pthread.h>
#endif #endif
#include <krb5_locl.h>
#include <gssapi_spnego.h> #include <gssapi_spnego.h>
#include <gssapi.h> #include <gssapi.h>
#include <assert.h> #include <assert.h>
#include <der.h> #include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <heim_threads.h>
#include "spnego_asn1.h" #include "spnego_asn1.h"
#include <der.h>
#include <asn1_err.h>
#include <gssapi_mech.h> #include <gssapi_mech.h>
#define ALLOC(X, N) (X) = calloc((N), sizeof(*(X)))
typedef struct { typedef struct {
gss_cred_id_t negotiated_cred_id; gss_cred_id_t negotiated_cred_id;
} *gssspnego_cred; } *gssspnego_cred;