From: Theodore Tso Date: Tue, 25 Mar 1997 05:48:10 +0000 (+0000) Subject: Fix handling of the sam-timestamp and sam-usec fields, which should X-Git-Tag: krb5-1.1-beta1~1173 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0b21febf6cc4f995b22e95a3d44431900a410f3f;p=krb5.git Fix handling of the sam-timestamp and sam-usec fields, which should always be set if the nonce is not available, not just SAM_USE_SAD_AS_KEY is being used. [krb5-libs/325] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10025 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 2573b959c..4b8f21e86 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,10 @@ +Tue Mar 25 00:32:55 1997 Theodore Y. Ts'o + + * preauth.c (obtain_sam_padata): Fix handling of the sam-timestamp + and sam-usec fields, which should always be set if the + nonce is not available, not just SAM_USE_SAD_AS_KEY is + being used. [krb5-libs/325] + Mon Mar 24 12:21:38 1997 Theodore Ts'o * t_ser.c: Clean up error reporting for krb5_init_context(). Also diff --git a/src/lib/krb5/krb/preauth.c b/src/lib/krb5/krb/preauth.c index a5f593bfe..586e1b94d 100644 --- a/src/lib/krb5/krb/preauth.c +++ b/src/lib/krb5/krb/preauth.c @@ -518,6 +518,14 @@ obtain_sam_padata(context, in_padata, etype_info, def_enc_key, } enc_sam_response_enc.sam_nonce = sam_challenge->sam_nonce; + if (!sam_challenge->sam_nonce) { + retval = krb5_us_timeofday(context, + &enc_sam_response_enc.sam_timestamp, + &enc_sam_response_enc.sam_usec); + sam_response.sam_patimestamp = enc_sam_response_enc.sam_timestamp; + } + if (retval) + return retval; if (sam_challenge->sam_flags & KRB5_SAM_SEND_ENCRYPTED_SAD) { /* encrypt passcode in key by stuffing it here */ int pcsize = 256; @@ -533,16 +541,6 @@ obtain_sam_padata(context, in_padata, etype_info, def_enc_key, enc_sam_response_enc.sam_passcode.data = passcode; enc_sam_response_enc.sam_passcode.length = pcsize; } else if (sam_challenge->sam_flags & KRB5_SAM_USE_SAD_AS_KEY) { - if (sam_challenge->sam_nonce) { - /* use nonce in the next AS request? */ - } else { - retval = krb5_us_timeofday(context, - &enc_sam_response_enc.sam_timestamp, - &enc_sam_response_enc.sam_usec); - sam_response.sam_patimestamp = enc_sam_response_enc.sam_timestamp; - } - if (retval) - return retval; prompt = handle_sam_labels(sam_challenge); retval = sam_get_pass_from_user(context, etype_info, key_proc, key_seed, request, &sam_use_key,