summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/ccache
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2010-05-13 18:58:43 +0000
committerGreg Hudson <ghudson@mit.edu>2010-05-13 18:58:43 +0000
commitc0cd63413841b3b85e0f70c6949322cc6299afb5 (patch)
tree207bf4d474470fae6d458e14019fc43260eef462 /src/lib/krb5/ccache
parent202383a7defa65fc1bc430343e3bc4dd0da04efd (diff)
downloadkrb5-c0cd63413841b3b85e0f70c6949322cc6299afb5.tar.gz
krb5-c0cd63413841b3b85e0f70c6949322cc6299afb5.tar.xz
krb5-c0cd63413841b3b85e0f70c6949322cc6299afb5.zip
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. ticket: 6723 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24021 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/ccache')
-rw-r--r--src/lib/krb5/ccache/cc_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/krb5/ccache/cc_file.c b/src/lib/krb5/ccache/cc_file.c
index 6af5afcd0..0dce7686e 100644
--- a/src/lib/krb5/ccache/cc_file.c
+++ b/src/lib/krb5/ccache/cc_file.c
@@ -595,8 +595,9 @@ krb5_fcc_read_keyblock(krb5_context context, krb5_ccache id, krb5_keyblock *keyb
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. */