From d47a694b385d8daa810b20d8801b60be8b623b85 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 7 Feb 2000 10:22:58 +0000 Subject: [PATCH] * kdc_preauth.c (get_preauth_hint_list): Log a message if preauth is required but no preauth types are available. (return_sam_data): Fix typo in figuring length of data to XOR when merging keys. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12011 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 7 +++++++ src/kdc/kdc_preauth.c | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index 0e85c758d..25b02d12f 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,10 @@ +2000-02-07 Ken Raeburn + + * kdc_preauth.c (get_preauth_hint_list): Log a message if preauth + is required but no preauth types are available. + (return_sam_data): Fix typo in figuring length of data to XOR when + merging keys. + 2000-02-06 Ken Raeburn * kdc_preauth.c: Include . diff --git a/src/kdc/kdc_preauth.c b/src/kdc/kdc_preauth.c index 12e1eec6c..27b4f846b 100644 --- a/src/kdc/kdc_preauth.c +++ b/src/kdc/kdc_preauth.c @@ -270,6 +270,11 @@ void get_preauth_hint_list(request, client, server, e_data) } pa++; } + if (pa_data[0] == 0) { + krb5_klog_syslog (LOG_INFO, + "%spreauth required but hint list is empty", + hw_only ? "hw" : ""); + } retval = encode_krb5_padata_sequence((const krb5_pa_data **) pa_data, &edat); if (retval) @@ -759,8 +764,11 @@ return_sam_data(context, in_padata, client, request, reply, client_key, { krb5_octet *p = encrypting_key->contents; krb5_octet *q = psr->sam_key.contents; + int length = ((encrypting_key->length < psr->sam_key.length) + ? encrypting_key->length + : psr->sam_key.length); - for (i = 0; i < encrypting_key->length, i < psr->sam_key.length; i++) + for (i = 0; i < length; i++) p[i] ^= q[i]; } @@ -939,6 +947,10 @@ get_sam_edata(context, request, client, server, pa_data) sc.sam_challenge.data = "12345"; sc.sam_challenge.length = strlen(sc.sam_challenge.data); +#if 0 /* Enable this to test "normal" (no flags set) mode. */ + psr.sam_flags = sc.sam_flags = 0; +#endif + psr.magic = KV5M_PREDICTED_SAM_RESPONSE; /* string2key on sc.sam_challenge goes in here */ /* eblock is just to set the enctype */ -- 2.26.2