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

« back to all changes in this revision

Viewing changes to src/lib/krb5/ccache/cc_retr.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
2
 * lib/krb5/ccache/cc_retr.c
3
3
 *
4
 
 * Copyright 1990,1991,1999 by the Massachusetts Institute of Technology.
 
4
 * Copyright 1990,1991,1999,2007,2008 by the Massachusetts Institute of Technology.
5
5
 * All Rights Reserved.
6
6
 *
7
7
 * Export of this software from the United States of America may
33
33
 
34
34
#define set(bits) (whichfields & bits)
35
35
#define flags_match(a,b) (((a) & (b)) == (a))
36
 
#define times_match_exact(t1,t2) (memcmp((char *)(t1), (char *)(t2), sizeof(*(t1))) == 0)
 
36
 
 
37
static int
 
38
times_match_exact(const krb5_ticket_times *t1, const krb5_ticket_times *t2)
 
39
{
 
40
    return (t1->authtime == t2->authtime &&
 
41
            t1->starttime == t2->starttime &&
 
42
            t1->endtime == t2->endtime &&
 
43
            t1->renew_till == t2->renew_till);
 
44
}
37
45
 
38
46
static krb5_boolean
39
47
times_match(const krb5_ticket_times *t1, const krb5_ticket_times *t2)
114
122
    }
115
123
    if (!data2) return FALSE;
116
124
 
117
 
    if (data1->length != data2->length)
118
 
        return FALSE;
119
 
    else
120
 
        return memcmp(data1->data, data2->data, (unsigned) data1->length) 
121
 
          ? FALSE : TRUE;
 
125
    return data_eq(*data1, *data2) ? TRUE : FALSE;
122
126
}
123
127
 
124
128
static int
352
356
    }
353
357
    
354
358
    if (equal) {
355
 
        equal = (in_creds->ticket.length  == in_compare_creds->ticket.length &&
356
 
                 (!in_creds->ticket.length ||
357
 
                  !memcmp (in_creds->ticket.data, in_compare_creds->ticket.data,
358
 
                           in_creds->ticket.length)));
 
359
        equal = data_eq(in_creds->ticket, in_compare_creds->ticket);
359
360
    }
360
361
    
361
362
    if (equal) {
362
 
        equal = (in_creds->second_ticket.length  == in_compare_creds->second_ticket.length &&
363
 
                 (!in_creds->second_ticket.length ||
364
 
                  !memcmp (in_creds->second_ticket.data, in_compare_creds->second_ticket.data,
365
 
                           in_creds->second_ticket.length)));
 
363
        equal = data_eq(in_creds->second_ticket, in_compare_creds->second_ticket);
366
364
    }
367
365
    
368
366
    if (equal) {
372
370
        
373
371
        if (authdata && compare_authdata) { 
374
372
            for (i = 0; (equal && authdata[i] && compare_authdata[i]); i++) {
375
 
                equal = (authdata[i]->ad_type == compare_authdata[i]->ad_type &&
376
 
                         authdata[i]->length  == compare_authdata[i]->length &&
377
 
                         (!authdata[i]->length || 
378
 
                          !memcmp (authdata[i]->contents, compare_authdata[i]->contents,
379
 
                                   authdata[i]->length)));
 
373
                equal = authdata_eq(*authdata[i], *compare_authdata[i]);
380
374
            }
381
375
            if (equal) { equal = (!authdata[i] && !compare_authdata[i]); }
382
376
        } else {