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

« back to all changes in this revision

Viewing changes to src/util/ss/error.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
1
/*
 
2
 * Copyright 2007 Massachusetts Institute of Technology.
 
3
 * All Rights Reserved.
 
4
 *
 
5
 * Export of this software from the United States of America may
 
6
 *   require a specific license from the United States Government.
 
7
 *   It is the responsibility of any person or organization contemplating
 
8
 *   export to obtain such a license before exporting.
 
9
 * 
 
10
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
 
11
 * distribute this software and its documentation for any purpose and
 
12
 * without fee is hereby granted, provided that the above copyright
 
13
 * notice appear in all copies and that both that copyright notice and
 
14
 * this permission notice appear in supporting documentation, and that
 
15
 * the name of M.I.T. not be used in advertising or publicity pertaining
 
16
 * to distribution of the software without specific, written prior
 
17
 * permission.  Furthermore if you modify this software you must label
 
18
 * your software as modified software and not distribute it in such a
 
19
 * fashion that it might be confused with the original M.I.T. software.
 
20
 * M.I.T. makes no representations about the suitability of
 
21
 * this software for any purpose.  It is provided "as is" without express
 
22
 * or implied warranty.
 
23
 */
 
24
/*
2
25
 * Copyright 1987, 1988, 1989 by MIT Student Information Processing
3
26
 * Board
4
27
 *
14
37
char * ss_name(sci_idx)
15
38
    int sci_idx;
16
39
{
17
 
    register char *ret_val;
18
40
    register ss_data *infop;
19
41
    
20
42
    infop = ss_info(sci_idx);
21
43
    if (infop->current_request == (char const *)NULL) {
22
 
        ret_val = malloc((unsigned)
23
 
                         (strlen(infop->subsystem_name)+1)
24
 
                         * sizeof(char));
25
 
        if (ret_val == (char *)NULL)
26
 
            return((char *)NULL);
27
 
        strcpy(ret_val, infop->subsystem_name);
28
 
        return(ret_val);
29
 
    }
30
 
    else {
31
 
        register char *cp;
32
 
        register char const *cp1;
33
 
        ret_val = malloc((unsigned)sizeof(char) * 
34
 
                         (strlen(infop->subsystem_name)+
35
 
                          strlen(infop->current_request)+
36
 
                          4));
37
 
        cp = ret_val;
38
 
        cp1 = infop->subsystem_name;
39
 
        while (*cp1)
40
 
            *cp++ = *cp1++;
41
 
        *cp++ = ' ';
42
 
        *cp++ = '(';
43
 
        cp1 = infop->current_request;
44
 
        while (*cp1)
45
 
            *cp++ = *cp1++;
46
 
        *cp++ = ')';
47
 
        *cp = '\0';
48
 
        return(ret_val);
 
44
        return strdup(infop->subsystem_name);
 
45
    } else {
 
46
        char *ret_val;
 
47
        if (asprintf(&ret_val, "%s (%s)",
 
48
                     infop->subsystem_name, infop->current_request) < 0)
 
49
            return NULL;
 
50
        return ret_val;
49
51
    }
50
52
}
51
53