tgs_make_reply: fix temp weak enctype exception
commit1bed48b75cdebebfb1a3ce1e8c6962ca43848e32
authorRagnar Sundblad <ragge@csc.kth.se>
Tue, 30 Jul 2013 16:21:54 +0000 (30 12:21 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 30 Jul 2013 18:16:20 +0000 (30 14:16 -0400)
tree49edddb68d0932f1305297138c8bf18b5fd8fbfd
parentc4aa2f90674da250af99f4afbb199d653d27b1af
tgs_make_reply: fix temp weak enctype exception

The default heimdal KDC chokes when trying to encrypt a ticket with a weak
server key that has a different type than the session key. The problem
happens in the krb5_crypto_init function called from the _kdc_encode_reply
function.

The existing work-around of the problem temporarily enabled the weak
enctype in case it was disabled but the principal was on the (hard-coded)
exception list.

Unfortunately the code used the keytype of the key encoded in the ticked
(the session key) instead of the keytype of the key used to encrypt the ticket
(the serverkey) thus enabling the incorrect encryption type if those two
are different, for instance des-cbc-md5 and des-cbc-crc.

Change-Id: Ia55dc344e3e5fc9ec1eb93c9e8ebb0a58c673d57
kdc/krb5tgs.c