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

« back to all changes in this revision

Viewing changes to src/lib/krb4/err_txt.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
 
/*
2
 
 * lib/krb4/err_txt.c
3
 
 *
4
 
 * Copyright 1988, 2002 by the Massachusetts Institute of Technology.
5
 
 * All Rights Reserved.
6
 
 *
7
 
 * Export of this software from the United States of America may
8
 
 *   require a specific license from the United States Government.
9
 
 *   It is the responsibility of any person or organization contemplating
10
 
 *   export to obtain such a license before exporting.
11
 
 * 
12
 
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13
 
 * distribute this software and its documentation for any purpose and
14
 
 * without fee is hereby granted, provided that the above copyright
15
 
 * notice appear in all copies and that both that copyright notice and
16
 
 * this permission notice appear in supporting documentation, and that
17
 
 * the name of M.I.T. not be used in advertising or publicity pertaining
18
 
 * to distribution of the software without specific, written prior
19
 
 * permission.  Furthermore if you modify this software you must label
20
 
 * your software as modified software and not distribute it in such a
21
 
 * fashion that it might be confused with the original M.I.T. software.
22
 
 * M.I.T. makes no representations about the suitability of
23
 
 * this software for any purpose.  It is provided "as is" without express
24
 
 * or implied warranty.
25
 
 */
26
 
 
27
 
#include "krb.h"
28
 
#include "krb4int.h"
29
 
 
30
 
/*
31
 
 * This is gross.  We want krb_err_txt to match the contents of the
32
 
 * com_err error table, but the text is static in krb_err.c.  We can't
33
 
 * alias it by making a pointer to it, either, so we have to suck in
34
 
 * another copy of it that is named differently.   */
35
 
#if TARGET_OS_MAC && !defined(DEPEND)
36
 
#undef initialize_krb_error_table
37
 
#define initialize_krb_error_table      krb4int_init_krb_err_tbl
38
 
void krb4int_init_krb_err_tbl(void);
39
 
#include "krb_err.c"
40
 
#undef initialize_krb_error_table
41
 
 
42
 
/*
43
 
 * Depends on the name of the static table generated by compile_et,
44
 
 * but since this is only on Darwin, where we will always use a
45
 
 * certain compile_et, it should be ok.
46
 
 */
47
 
const char * const * const krb_err_txt = text;
48
 
#else
49
 
#ifndef DEPEND
50
 
/* Don't put this in auto-generated dependencies. */
51
 
#include "krb_err_txt.c"
52
 
#endif
53
 
#endif
54
 
 
55
 
void initialize_krb_error_table(void);
56
 
 
57
 
static int inited = 0;
58
 
 
59
 
void
60
 
krb4int_et_init(void)
61
 
{
62
 
    if (inited)
63
 
        return;
64
 
    add_error_table(&et_krb_error_table);
65
 
    inited = 1;\
66
 
}
67
 
 
68
 
void
69
 
krb4int_et_fini(void)
70
 
{
71
 
    if (inited)
72
 
        remove_error_table(&et_krb_error_table);
73
 
}
74
 
 
75
 
const char * KRB5_CALLCONV
76
 
krb_get_err_text(code)
77
 
    int code;
78
 
{
79
 
    krb4int_et_init();
80
 
    /*
81
 
     * Shift krb error code into com_err number space.
82
 
     */
83
 
    if (code >= 0 && code < MAX_KRB_ERRORS)
84
 
        return error_message(ERROR_TABLE_BASE_krb + code);
85
 
    else
86
 
        return "Invalid Kerberos error code";
87
 
}