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

« back to all changes in this revision

Viewing changes to src/lib/gssapi/krb5/get_tkt_flags.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:
 
1
/* -*- mode: c; indent-tabs-mode: nil -*- */
1
2
/*
2
3
 * Copyright 1993 by OpenVision Technologies, Inc.
3
 
 * 
 
4
 *
4
5
 * Permission to use, copy, modify, distribute, and sell this software
5
6
 * and its documentation for any purpose is hereby granted without fee,
6
7
 * provided that the above copyright notice appears in all copies and
10
11
 * without specific, written prior permission. OpenVision makes no
11
12
 * representations about the suitability of this software for any
12
13
 * purpose.  It is provided "as is" without express or implied warranty.
13
 
 * 
 
14
 *
14
15
 * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15
16
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16
17
 * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
23
24
#include "gssapiP_krb5.h"
24
25
 
25
26
/*
26
 
 * $Id: get_tkt_flags.c 18131 2006-06-14 22:27:54Z tlyu $
 
27
 * $Id: get_tkt_flags.c 21778 2009-01-22 23:21:11Z tlyu $
27
28
 */
28
29
 
29
 
OM_uint32 KRB5_CALLCONV 
30
 
gss_krb5int_get_tkt_flags(minor_status, context_handle, ticket_flags)
31
 
     OM_uint32 *minor_status;
32
 
     gss_ctx_id_t context_handle;
33
 
     krb5_flags *ticket_flags;
 
30
OM_uint32 KRB5_CALLCONV
 
31
gss_krb5int_get_tkt_flags(OM_uint32 *minor_status,
 
32
                          const gss_ctx_id_t context_handle,
 
33
                          const gss_OID desired_object,
 
34
                          gss_buffer_set_t *data_set)
34
35
{
35
 
   krb5_gss_ctx_id_rec *ctx;
36
 
 
37
 
   /* validate the context handle */
38
 
   if (! kg_validate_ctx_id(context_handle)) {
39
 
      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
40
 
      return(GSS_S_NO_CONTEXT);
41
 
   }
42
 
 
43
 
   ctx = (krb5_gss_ctx_id_rec *) context_handle;
44
 
 
45
 
   if (! ctx->established) {
46
 
      *minor_status = KG_CTX_INCOMPLETE;
47
 
      return(GSS_S_NO_CONTEXT);
48
 
   }
49
 
 
50
 
   if (ticket_flags)
51
 
      *ticket_flags = ctx->krb_flags;
52
 
 
53
 
   *minor_status = 0;
54
 
   return(GSS_S_COMPLETE);
 
36
    krb5_gss_ctx_id_rec *ctx;
 
37
    gss_buffer_desc rep;
 
38
 
 
39
    ctx = (krb5_gss_ctx_id_rec *) context_handle;
 
40
 
 
41
    rep.value = &ctx->krb_flags;
 
42
    rep.length = sizeof(ctx->krb_flags);
 
43
 
 
44
    return generic_gss_add_buffer_set_member(minor_status, &rep, data_set);
55
45
}