Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't require all enctypes in a keytab to be valid #952

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

frozencemetery
Copy link
Contributor

When acquiring credentials using a keytab, krb5 examines each entry in
the keytab to check for a better match. Relax the check on enctypes so
that the presence of removed enctypes (like DES) in the keytab doesn't
cause failure in kinit.

@frozencemetery
Copy link
Contributor Author

(I think this was overlooked because an intermediate design had the enctypes still present in the list, but with no operator functions. Hard to know, though.)

@greghudson
Copy link
Member

We only needed krb5_c_enctype_compare() for single-DES enctypes, where we wanted to share key entries between des-cbc-crc, des-cbc-md4, and des-cbc-md5. Today even when we introduce a new enctype with the same encryption algorithm as an old one (like the aes-sha2 enctypes) we tweak the string-to-key so that we don't share keys.

So this fix can just simplify the code to do an equality test on the enctype, and remove the coercion. As the PR currently stands, I think it could leave kerror as non-zero if there is a DES key in the final entry of the keytab.

@frozencemetery
Copy link
Contributor Author

Ah, good catch. Updated.

@greghudson
Copy link
Member

I was suggesting to use the == operator instead of krb5_c_enctype_compare().

@frozencemetery
Copy link
Contributor Author

Ah, thanks, got confused by the mention of kerror.

@frozencemetery frozencemetery force-pushed the kt-enctypes branch 3 times, most recently from 1886113 to 1b0793d Compare July 11, 2019 19:21
krb5_ktfile_get_entry() used krb5_c_enctype_compare() to compare
enctypes, in order to share keys between single-DES enctypes.  As
key-sharing between enctypes is no longer done and single-DES support
has been removed, use a simple equality test to match the enctype.
This fixes a bug where krb5_kt_get_entry() would error out if the
keytab contained any entries with invalid enctypes (include single-DES
entries, after commit fb2dada) even
if a matching entry is found.

[ghudson@mit.edu: rewrote commit message]

ticket: 8808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants