Skip to content

Commit

Permalink
Check for keys in encrypted timestamp/challenge
Browse files Browse the repository at this point in the history
Encrypted timestamp and encrypted challenge cannot succeed if the
client has no long-term key matching the request enctypes, so do not
offer them in that case.

ticket: 7630
  • Loading branch information
greghudson committed May 3, 2013
1 parent e504827 commit 9593d13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/kdc/kdc_preauth_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ ec_edata(krb5_context context, krb5_kdc_req *request,
krb5_kdcpreauth_edata_respond_fn respond, void *arg)
{
krb5_keyblock *armor_key = cb->fast_armor(context, rock);
(*respond)(arg, (armor_key == NULL) ? ENOENT : 0, NULL);

/* Encrypted challenge only works with FAST, and requires a client key. */
if (armor_key == NULL || !cb->have_client_keys(context, rock))
(*respond)(arg, ENOENT, NULL);
else
(*respond)(arg, 0, NULL);
}

static void
Expand Down
6 changes: 5 additions & 1 deletion src/kdc/kdc_preauth_encts.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ enc_ts_get(krb5_context context, krb5_kdc_req *request,
{
krb5_keyblock *armor_key = cb->fast_armor(context, rock);

(*respond)(arg, (armor_key != NULL) ? ENOENT : 0, NULL);
/* Encrypted timestamp must not be used with FAST, and requires a key. */
if (armor_key != NULL || !cb->have_client_keys(context, rock))
(*respond)(arg, ENOENT, NULL);
else
(*respond)(arg, 0, NULL);
}

static void
Expand Down

0 comments on commit 9593d13

Please sign in to comment.