diff options
author | Greg Hudson <ghudson@mit.edu> | 2011-12-13 00:53:56 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2011-12-13 00:53:56 +0000 |
commit | b531f40581f6b871c08643a0e9ef11f632de0363 (patch) | |
tree | ba95068572f17bd749d46bbf37031d4c73b5279d | |
parent | ac77dcbfd828840112cd6a172a802835c4f917f4 (diff) | |
download | krb5-b531f40581f6b871c08643a0e9ef11f632de0363.tar.gz krb5-b531f40581f6b871c08643a0e9ef11f632de0363.tar.xz krb5-b531f40581f6b871c08643a0e9ef11f632de0363.zip |
krb5_server_decrypt_ticket_keytab wrongly succeeds
If krb5_server_decrypt_ticket_keytab doesn't find a key of the
appropriate enctype in an iterable keytab, it returns 0 (without
decrypting the ticket) due to a misplaced initialization of retval.
This bug causes kinit -k to claim "keytab entry valid" when it
shouldn't. Reported by mark@mproehl.net.
ticket: 7051
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25584 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/krb5/krb/srv_dec_tkt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/krb5/krb/srv_dec_tkt.c b/src/lib/krb5/krb/srv_dec_tkt.c index 645bc7552..094758ce2 100644 --- a/src/lib/krb5/krb/srv_dec_tkt.c +++ b/src/lib/krb5/krb/srv_dec_tkt.c @@ -79,8 +79,6 @@ krb5_server_decrypt_ticket_keytab(krb5_context context, krb5_error_code retval; krb5_keytab_entry ktent; - retval = KRB5_KT_NOTFOUND; - if (keytab->ops->start_seq_get == NULL) { retval = krb5_kt_get_entry(context, keytab, ticket->server, @@ -99,6 +97,7 @@ krb5_server_decrypt_ticket_keytab(krb5_context context, if (retval != 0) goto map_error; + retval = KRB5_KT_NOTFOUND; while ((code = krb5_kt_next_entry(context, keytab, &ktent, &cursor)) == 0) { if (ktent.key.enctype != ticket->enc_part.enctype) |