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

« back to all changes in this revision

Viewing changes to src/lib/gssapi/krb5/compare_name.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
21
22
 */
22
23
 
23
24
/*
24
 
 * $Id: compare_name.c 18015 2006-05-17 05:26:12Z raeburn $
 
25
 * $Id: compare_name.c 20876 2008-10-15 21:58:43Z tlyu $
25
26
 */
26
27
 
27
28
#include "gssapiP_krb5.h"
28
29
 
29
30
OM_uint32
30
31
krb5_gss_compare_name(minor_status, name1, name2, name_equal)
31
 
     OM_uint32 *minor_status;
32
 
     gss_name_t name1;
33
 
     gss_name_t name2;
34
 
     int *name_equal;
35
 
36
 
   krb5_context context;
37
 
   krb5_error_code code;
38
 
 
39
 
   if (! kg_validate_name(name1)) {
40
 
      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
41
 
      return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
42
 
   }
43
 
 
44
 
   if (! kg_validate_name(name2)) {
45
 
      *minor_status = (OM_uint32) G_VALIDATE_FAILED;
46
 
      return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
47
 
   }
48
 
 
49
 
   code = krb5_gss_init_context(&context);
50
 
   if (code) {
51
 
       *minor_status = code;
52
 
       return GSS_S_FAILURE;
53
 
   }
54
 
 
55
 
   *minor_status = 0;
56
 
   *name_equal = krb5_principal_compare(context, (krb5_principal) name1,
57
 
                                        (krb5_principal) name2);
58
 
   krb5_free_context(context);
59
 
   return(GSS_S_COMPLETE);
 
32
    OM_uint32 *minor_status;
 
33
    gss_name_t name1;
 
34
    gss_name_t name2;
 
35
    int *name_equal;
 
36
{
 
37
    krb5_context context;
 
38
    krb5_error_code code;
 
39
 
 
40
    if (! kg_validate_name(name1)) {
 
41
        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
 
42
        return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
 
43
    }
 
44
 
 
45
    if (! kg_validate_name(name2)) {
 
46
        *minor_status = (OM_uint32) G_VALIDATE_FAILED;
 
47
        return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
 
48
    }
 
49
 
 
50
    code = krb5_gss_init_context(&context);
 
51
    if (code) {
 
52
        *minor_status = code;
 
53
        return GSS_S_FAILURE;
 
54
    }
 
55
 
 
56
    *minor_status = 0;
 
57
    *name_equal = krb5_principal_compare(context, (krb5_principal) name1,
 
58
                                         (krb5_principal) name2);
 
59
    krb5_free_context(context);
 
60
    return(GSS_S_COMPLETE);
60
61
}