svn rev #24021: trunk/src/lib/krb5/ccache/

ghudson@MIT.EDU ghudson at MIT.EDU
Thu May 13 14:58:43 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24021
Commit By: ghudson
Log Message:
ticket: 6723
subject: Negative enctypes improperly read from ccaches

When reading enctypes from ccaches, we need to sign-extend the 16-bit
value we read in order to properly read negative enctypes.



Changed Files:
U   trunk/src/lib/krb5/ccache/cc_file.c
Modified: trunk/src/lib/krb5/ccache/cc_file.c
===================================================================
--- trunk/src/lib/krb5/ccache/cc_file.c	2010-05-13 18:49:20 UTC (rev 24020)
+++ trunk/src/lib/krb5/ccache/cc_file.c	2010-05-13 18:58:43 UTC (rev 24021)
@@ -595,8 +595,9 @@
     keyblock->magic = KV5M_KEYBLOCK;
     keyblock->contents = 0;
 
+    /* Enctype is signed, so sign-extend the 16-bit value we read. */
     kret = krb5_fcc_read_ui_2(context, id, &ui2);
-    keyblock->enctype = ui2;
+    keyblock->enctype = (krb5_int16) ui2;
     CHECK(kret);
     if (data->version == KRB5_FCC_FVNO_3) {
         /* This works because the old etype is the same as the new enctype. */




More information about the cvs-krb5 mailing list