Skip to content

Commit

Permalink
Make krb5_preauth_context a pointer type
Browse files Browse the repository at this point in the history
For consistency with krb5_context and krb5_init_creds_context, make
krb5_preauth_context a pointer type.  In preauth2.c, use the typedef
name rather than the structure tag except when defining the structure.
  • Loading branch information
greghudson committed Jan 26, 2017
1 parent 87d8d1c commit 459a081
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/include/k5-int.h
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ k5_plugin_free_context(krb5_context context);
struct _kdb5_dal_handle; /* private, in kdb5.h */
typedef struct _kdb5_dal_handle kdb5_dal_handle;
struct _kdb_log_context;
typedef struct krb5_preauth_context_st krb5_preauth_context;
typedef struct krb5_preauth_context_st *krb5_preauth_context;
struct ccselect_module_handle;
struct localauth_module_handle;
struct hostrealm_module_handle;
Expand Down Expand Up @@ -1231,7 +1231,7 @@ struct _krb5_context {
struct plugin_dir_handle libkrb5_plugins;

/* preauth module stuff */
krb5_preauth_context *preauth_context;
krb5_preauth_context preauth_context;

/* cache module stuff */
struct ccselect_module_handle **ccselect_handles;
Expand Down
22 changes: 11 additions & 11 deletions src/lib/krb5/krb/preauth2.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ k5_init_preauth_context(krb5_context context)
list[count] = NULL;

/* Place the constructed preauth context into the krb5 context. */
context->preauth_context = malloc(sizeof(struct krb5_preauth_context_st));
context->preauth_context = malloc(sizeof(*context->preauth_context));
if (context->preauth_context == NULL)
goto cleanup;
context->preauth_context->tried = NULL;
Expand All @@ -181,7 +181,7 @@ k5_init_preauth_context(krb5_context context)
void
k5_reset_preauth_types_tried(krb5_context context)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;

if (pctx == NULL)
return;
Expand All @@ -196,7 +196,7 @@ k5_reset_preauth_types_tried(krb5_context context)
void
k5_free_preauth_context(krb5_context context)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;

if (pctx == NULL)
return;
Expand All @@ -211,7 +211,7 @@ k5_free_preauth_context(krb5_context context)
void
k5_preauth_request_context_init(krb5_context context)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
clpreauth_handle *hp, h;

if (pctx == NULL) {
Expand All @@ -233,7 +233,7 @@ k5_preauth_request_context_init(krb5_context context)
void
k5_preauth_request_context_fini(krb5_context context)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
clpreauth_handle *hp, h;

if (pctx == NULL)
Expand Down Expand Up @@ -495,7 +495,7 @@ void
k5_preauth_prepare_request(krb5_context context, krb5_get_init_creds_opt *opt,
krb5_kdc_req *req)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
clpreauth_handle *hp, h;
krb5_enctype *ep;

Expand Down Expand Up @@ -556,7 +556,7 @@ pa_type_allowed(krb5_init_creds_context ctx, krb5_preauthtype pa_type)
static krb5_boolean
already_tried(krb5_context context, krb5_preauthtype pa_type)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
size_t count;
krb5_preauthtype *newptr;

Expand All @@ -580,7 +580,7 @@ process_pa_data(krb5_context context, krb5_init_creds_context ctx,
krb5_pa_data ***out_pa_list, int *out_pa_list_size,
krb5_preauthtype *out_type)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
struct errinfo save = EMPTY_ERRINFO;
krb5_pa_data *pa, **pa_ptr, **mod_pa;
krb5_error_code ret = 0;
Expand Down Expand Up @@ -858,7 +858,7 @@ krb5_error_code
k5_preauth_tryagain(krb5_context context, krb5_init_creds_context ctx,
krb5_pa_data **in_padata, krb5_pa_data ***padata_out)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
krb5_error_code ret;
krb5_pa_data **mod_pa;
clpreauth_handle h;
Expand Down Expand Up @@ -897,7 +897,7 @@ static krb5_error_code
fill_response_items(krb5_context context, krb5_init_creds_context ctx,
krb5_pa_data **in_padata)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
krb5_error_code ret;
krb5_pa_data *pa;
clpreauth_handle h;
Expand Down Expand Up @@ -1004,7 +1004,7 @@ krb5_preauth_supply_preauth_data(krb5_context context,
krb5_get_init_creds_opt *opt,
const char *attr, const char *value)
{
struct krb5_preauth_context_st *pctx = context->preauth_context;
krb5_preauth_context pctx = context->preauth_context;
clpreauth_handle *hp, h;
krb5_error_code ret;

Expand Down

0 comments on commit 459a081

Please sign in to comment.