Fix handling of the sam-timestamp and sam-usec fields, which should
authorTheodore Tso <tytso@mit.edu>
Tue, 25 Mar 1997 05:48:10 +0000 (05:48 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 25 Mar 1997 05:48:10 +0000 (05:48 +0000)
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

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/preauth.c

index 2573b959cd5a83e747defd0971ce796bf2e6f5e2..4b8f21e8605ed92f23dc63f7c7d1b0cc59b8b7f8 100644 (file)
@@ -1,3 +1,10 @@
+Tue Mar 25 00:32:55 1997  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@rsts-11.mit.edu>
 
        * t_ser.c: Clean up error reporting for krb5_init_context().  Also
index a5f593bfea92aabd78462dadd5529ddf350f6893..586e1b94d07413812709b02c541796ca89df91ec 100644 (file)
@@ -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,