pull up r23608 from trunk
authorTom Yu <tlyu@mit.edu>
Mon, 11 Jan 2010 21:44:13 +0000 (21:44 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 11 Jan 2010 21:44:13 +0000 (21:44 +0000)
commit4d1eee670235f6f2c41e3f9d542dfd58da69d9a1
treea4676ac809f8d18a3bbc8f94d29ca4ce28d2d187
parenta28650fb811ff8b562e870a513b99a96d1966bd6
pull up r23608 from trunk

 ------------------------------------------------------------------------
 r23608 | epeisach | 2010-01-07 20:51:19 -0500 (Thu, 07 Jan 2010) | 23 lines

 subject: krb5int_derive_key results in cache with uninitialized values

 krb5int_derive_key creates a temporary keyblock to add to the derived cache.
 krb5_k_free_key will iterate over the derived keys and for ones with cache will
 lookup the enctype for the key_cleanup handler.

 Unfortunatly, there isn't a keyblock init function that does not allocate the
 keyblock - as I suspect this problem will appear in other places.

 The valgrind log of this problem is:

 ==7281== Conditional jump or move depends on uninitialised value(s)
 ==7281==    at 0x40E9AE8: find_enctype (etypes.h:81)
 ==7281==    by 0x40E9C96: krb5_k_free_key (key.c:91)
 ==7281==    by 0x40E9C52: krb5_k_free_key (key.c:86)
 ==7281==    by 0x40EBB00: krb5_c_prf (prf.c:87)
 ==7281==    by 0x40E7B1B: prf_plus (cf2.c:77)
 ==7281==    by 0x40E7CE6: krb5_c_fx_cf2_simple (cf2.c:125)
 ==7281==    by 0x804899C: main (t_cf2.c:70)
 ==7281==

 with memory leaks.

ticket: 6629
version_fixed: 1.8
status: resolved

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23626 dc483132-0cff-0310-8789-dd5450dbe970
src/lib/crypto/krb/dk/derive.c