~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/lib/gssapi/mechglue/g_delete_sec_context.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
{
74
74
    OM_uint32           status;
75
75
    gss_union_ctx_id_t  ctx;
76
 
    gss_mechanism       mech;
77
76
 
78
77
    status = val_del_sec_ctx_args(minor_status, context_handle, output_token);
79
78
    if (status != GSS_S_COMPLETE)
87
86
    ctx = (gss_union_ctx_id_t) *context_handle;
88
87
    if (GSSINT_CHK_LOOP(ctx))
89
88
        return (GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CONTEXT);
90
 
    mech = gssint_get_mechanism (ctx->mech_type);
91
 
    
92
 
    if (mech) {
93
 
 
94
 
        if (mech->gss_delete_sec_context)
95
 
            status = mech->gss_delete_sec_context(
96
 
                                                  mech->context,
97
 
                                                  minor_status,
98
 
                                                  &ctx->internal_ctx_id,
99
 
                                                  output_token);
100
 
        else
101
 
            status = GSS_S_UNAVAILABLE;
102
 
 
103
 
        /* now free up the space for the union context structure */
104
 
        free(ctx->mech_type->elements);
105
 
        free(ctx->mech_type);
106
 
        free(*context_handle);
107
 
        *context_handle = NULL;
108
 
 
109
 
        return(status);
110
 
    }
111
 
 
112
 
    return (GSS_S_BAD_MECH);
 
89
   
 
90
    status = gssint_delete_internal_sec_context(minor_status,
 
91
                                                ctx->mech_type,
 
92
                                                &ctx->internal_ctx_id,
 
93
                                                output_token);
 
94
    if (status)
 
95
        return status;
 
96
 
 
97
    /* now free up the space for the union context structure */
 
98
    free(ctx->mech_type->elements);
 
99
    free(ctx->mech_type);
 
100
    free(*context_handle);
 
101
    *context_handle = GSS_C_NO_CONTEXT;
 
102
 
 
103
    return (GSS_S_COMPLETE);
113
104
}