From: Paul Park Date: Thu, 27 Apr 1995 20:41:22 +0000 (+0000) Subject: Back out previous changes here, replace them with more correct change X-Git-Tag: krb5-1.0-beta5~182 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=868a314dcf98c3b776ba29518b1679dad5911035;p=krb5.git Back out previous changes here, replace them with more correct change of clearing the replaydata block before calling mk_priv_basic. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5570 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/mk_priv.c b/src/lib/krb5/krb/mk_priv.c index b29e886f3..9effca0e8 100644 --- a/src/lib/krb5/krb/mk_priv.c +++ b/src/lib/krb5/krb/mk_priv.c @@ -145,6 +145,9 @@ krb5_mk_priv(context, auth_context, userdata, outbuf, outdata) krb5_keyblock * keyblock; krb5_replay_data replaydata; + /* Clear replaydata block */ + memset((char *) &replaydata, 0, sizeof(krb5_replay_data)); + /* Get keyblock */ if ((keyblock = auth_context->local_subkey) == NULL) if ((keyblock = auth_context->remote_subkey) == NULL) @@ -161,14 +164,15 @@ krb5_mk_priv(context, auth_context, userdata, outbuf, outdata) /* Need a better error */ return KRB5_RC_REQUIRED; - /* Do the time, regardless */ - if (retval = krb5_us_timeofday(context, &replaydata.timestamp, - &replaydata.usec)) - return retval; - - if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_RET_TIME) { - outdata->timestamp = replaydata.timestamp; - outdata->usec = replaydata.usec; + if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) || + (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_RET_TIME)) { + if (retval = krb5_us_timeofday(context, &replaydata.timestamp, + &replaydata.usec)) + return retval; + if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_RET_TIME) { + outdata->timestamp = replaydata.timestamp; + outdata->usec = replaydata.usec; + } } if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) || (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_RET_SEQUENCE)) {