[85] in Zephyr_Bugs

home help back first fref pref prev next nref lref last post

lwvanels: vax 7.1H: libzephyr.a: ZMakeAuthentication

daemon@ATHENA.MIT.EDU (Ezra Peisach)
Mon Aug 20 10:49:22 1990

To: bug-zephyr@ATHENA.MIT.EDU
Date: Mon, 20 Aug 90 10:49:07 EDT
From: Ezra Peisach <epeisach@ATHENA.MIT.EDU>


------- Forwarded Message

Received: by E40-PO.MIT.EDU (5.45/4.7) id AA00711; Mon, 20 Aug 90 05:23:33 EDT
Received: from MIT.MIT.EDU by ATHENA.MIT.EDU with SMTP
	id AA12024; Mon, 20 Aug 90 05:23:25 EDT
Received: from FIONAVAR.MIT.EDU by MIT.EDU with SMTP
	id AA23976; Mon, 20 Aug 90 05:24:03 EDT
From: lwvanels@MIT.EDU
Received: by FIONAVAR.MIT.EDU (5.61/4.7) id AA01889; Mon, 20 Aug 90 05:23:02 -0400
Date: Mon, 20 Aug 90 05:23:02 -0400
Message-Id: <9008200923.AA01889@FIONAVAR.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
Subject: vax 7.1H: libzephyr.a: ZMakeAuthentication

This is a fix to the authenticator re-use bug I reported in testers [1033]:
The main problem was that if last_authent_time was 0, now was never being
set, and so last_authent_time would end up being set to a bogus value upon
exit.

*** /tmp/,RCSt1001742	Mon Aug 20 05:02:06 1990
- --- ZMakeAuthentication.c	Mon Aug 20 04:02:53 1990
***************
*** 20,32 ****
  #include <zephyr/zephyr_internal.h>
  #ifdef KERBEROS
  #include "krb_err.h"
! static int last_authent_time = 0;
  static KTEXT_ST last_authent;
  #endif
  
  Code_t ZResetAuthentication () {
  #ifdef KERBEROS
!     last_authent_time = 0;
  #endif
      return ZERR_NONE;
  }
- --- 20,32 ----
  #include <zephyr/zephyr_internal.h>
  #ifdef KERBEROS
  #include "krb_err.h"
! static long last_authent_time = 0L;
  static KTEXT_ST last_authent;
  #endif
  
  Code_t ZResetAuthentication () {
  #ifdef KERBEROS
!     last_authent_time = 0L;
  #endif
      return ZERR_NONE;
  }
***************
*** 38,52 ****
      int *len;
  {
  #ifdef KERBEROS
!     int retval, result, now;
      KTEXT_ST authent;
  
!     if (last_authent_time == 0
! 	|| (now = time(0), now - last_authent_time > 120)) {
  	result = krb_mk_req(&authent, SERVER_SERVICE, 
  			    SERVER_INSTANCE, __Zephyr_realm, 0);
! 	if (result != MK_AP_OK)
  	    return (result+krb_err_base);
  	last_authent_time = now;
  	last_authent = authent;
      }
- --- 38,55 ----
      int *len;
  {
  #ifdef KERBEROS
!     int retval, result;
!     long now,time();
      KTEXT_ST authent;
  
!     now = time(0);
!     if (last_authent_time == 0 || (now - last_authent_time > 120)) {
  	result = krb_mk_req(&authent, SERVER_SERVICE, 
  			    SERVER_INSTANCE, __Zephyr_realm, 0);
! 	if (result != MK_AP_OK) {
! 	    last_authent_time = 0;
  	    return (result+krb_err_base);
+         }
  	last_authent_time = now;
  	last_authent = authent;
      }

------- End of Forwarded Message


home help back first fref pref prev next nref lref last post