#include "lib/util/asn1.h"
#include "lib/util/base64.h"
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_AUTH
+
#undef strcasecmp
_PUBLIC_ NTSTATUS gensec_spnego_init(TALLOC_CTX *ctx);
return n;
}
-static void gensec_spnego_update_sub_abort(struct spnego_state *spnego_state)
+static void gensec_spnego_reset_sub_sec(struct spnego_state *spnego_state)
{
spnego_state->sub_sec_ready = false;
TALLOC_FREE(spnego_state->sub_sec_security);
/*
* Pretend we never started it
*/
- gensec_spnego_update_sub_abort(spnego_state);
+ gensec_spnego_reset_sub_sec(spnego_state);
/*
* And try the next one...
status = gensec_start_mech_by_ops(spnego_state->sub_sec_security,
cur_sec->op);
if (!NT_STATUS_IS_OK(status)) {
- gensec_spnego_update_sub_abort(spnego_state);
+ gensec_spnego_reset_sub_sec(spnego_state);
continue;
}
/*
* Pretend we never started it.
*/
- gensec_spnego_update_sub_abort(spnego_state);
+ gensec_spnego_reset_sub_sec(spnego_state);
/*
* And try the next one...
status = gensec_start_mech_by_ops(spnego_state->sub_sec_security,
cur_sec->op);
if (!NT_STATUS_IS_OK(status)) {
- gensec_spnego_update_sub_abort(spnego_state);
+ gensec_spnego_reset_sub_sec(spnego_state);
continue;
}
client_mech, client_oid, server_mech, server_oid);
spnego_state->downgraded = true;
- gensec_spnego_update_sub_abort(spnego_state);
+ gensec_spnego_reset_sub_sec(spnego_state);
status = gensec_subcontext_start(spnego_state,
gensec_security,
/*
* Pretend we never started it
*/
- gensec_spnego_update_sub_abort(spnego_state);
+ gensec_spnego_reset_sub_sec(spnego_state);
/*
* And try the next one, based on the clients
/*
* Pretend we never started it
*/
- gensec_spnego_update_sub_abort(spnego_state);
+ gensec_spnego_reset_sub_sec(spnego_state);
continue;
}
return tevent_req_post(req, ev);
}
- /* fall through */
+ FALL_THROUGH;
case SPNEGO_CLIENT_START:
case SPNEGO_SERVER_START:
const DATA_BLOB in, TALLOC_CTX *mem_ctx,
DATA_BLOB *full_in)
{
- struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
+ struct spnego_state *spnego_state =
+ talloc_get_type_abort(gensec_security->private_data,
+ struct spnego_state);
size_t expected;
bool ok;
TALLOC_CTX *out_mem_ctx,
DATA_BLOB *_out)
{
- struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
+ struct spnego_state *spnego_state =
+ talloc_get_type_abort(gensec_security->private_data,
+ struct spnego_state);
DATA_BLOB out = data_blob_null;
bool ok;
.expire_time = gensec_child_expire_time,
.final_auth_type = gensec_child_final_auth_type,
.enabled = true,
- .priority = GENSEC_SPNEGO
+ .priority = GENSEC_SPNEGO,
+ .glue = true,
};
_PUBLIC_ NTSTATUS gensec_spnego_init(TALLOC_CTX *ctx)