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

« back to all changes in this revision

Viewing changes to src/lib/krb5/krb/copy_athctr.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:
28
28
 */
29
29
 
30
30
#include "k5-int.h"
31
 
 
 
31
#ifndef LEAN_CLIENT
32
32
krb5_error_code KRB5_CALLCONV
33
33
krb5_copy_authenticator(krb5_context context, const krb5_authenticator *authfrom, krb5_authenticator **authto)
34
34
{
41
41
 
42
42
    retval = krb5_copy_principal(context, authfrom->client, &tempto->client);
43
43
    if (retval) {
44
 
        krb5_xfree(tempto);
 
44
        free(tempto);
45
45
        return retval;
46
46
    }
47
47
    
48
48
    if (authfrom->checksum &&
49
49
        (retval = krb5_copy_checksum(context, authfrom->checksum, &tempto->checksum))) {
50
50
            krb5_free_principal(context, tempto->client);    
51
 
            krb5_xfree(tempto);
 
51
            free(tempto);
52
52
            return retval;
53
53
    }
54
54
    
55
55
    if (authfrom->subkey) {
56
56
            retval = krb5_copy_keyblock(context, authfrom->subkey, &tempto->subkey);
57
57
            if (retval) {
58
 
                    krb5_xfree(tempto->subkey);
 
58
                    free(tempto->subkey);
59
59
                    krb5_free_checksum(context, tempto->checksum);
60
60
                    krb5_free_principal(context, tempto->client);    
61
 
                    krb5_xfree(tempto);
 
61
                    free(tempto);
62
62
                    return retval;
63
63
            }
64
64
    }
67
67
                retval = krb5_copy_authdata(context, authfrom->authorization_data,
68
68
                                    &tempto->authorization_data);
69
69
                if (retval) {
70
 
                    krb5_xfree(tempto->subkey);
 
70
                    free(tempto->subkey);
71
71
                    krb5_free_checksum(context, tempto->checksum);
72
72
                    krb5_free_principal(context, tempto->client);    
73
73
                    krb5_free_authdata(context, tempto->authorization_data);
74
 
                    krb5_xfree(tempto);
 
74
                    free(tempto);
75
75
                    return retval;
76
76
                }
77
77
    }
79
79
    *authto = tempto;
80
80
    return 0;
81
81
}
 
82
#endif
 
83