(krb5_ret_creds): if the higher ticket flags are set, its a mit cache,

reverse the bits, bug pointed out by Sergio Gelato <Sergio.Gelato@astro.su.se>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13480 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2004-03-08 18:49:12 +00:00
parent 3fabe949fa
commit ac134c6bf0

View File

@@ -672,6 +672,20 @@ krb5_ret_creds(krb5_storage *sp, krb5_creds *creds)
if(ret) goto cleanup; if(ret) goto cleanup;
ret = krb5_ret_int32 (sp, &dummy32); ret = krb5_ret_int32 (sp, &dummy32);
if(ret) goto cleanup; if(ret) goto cleanup;
/*
* If the higher hits are set, its either a new ticket flag (and
* this code need to be removed), or its a MIT cache (or new
* Heimdal cache), lets change it to our current format.
*/
if (dummy32 & 0xffff0000) {
int32_t rdummy32 = 0;
int i;
for (i = 0; i < 32; i++) {
rdummy32 = rdummy32 << 1 | (dummy32 & 1);
dummy32 = dummy32 >> 1;
}
dummy32 = rdummy32;
}
creds->flags.i = dummy32; creds->flags.i = dummy32;
ret = krb5_ret_addrs (sp, &creds->addresses); ret = krb5_ret_addrs (sp, &creds->addresses);
if(ret) goto cleanup; if(ret) goto cleanup;