svn rev #24936: trunk/src/ include/ kdc/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri May 20 11:21:28 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=24936
Commit By: ghudson
Log Message:
Revert r5233 and mark get_age as deprecated in the DAL documentation.
We do not need to check reply retransmissions for staleness any more
than TCP needs to.  A genuinely new request will have a different
nonce.



Changed Files:
U   trunk/src/include/kdb.h
U   trunk/src/kdc/replay.c
Modified: trunk/src/include/kdb.h
===================================================================
--- trunk/src/include/kdb.h	2011-05-19 14:14:54 UTC (rev 24935)
+++ trunk/src/include/kdb.h	2011-05-20 15:21:28 UTC (rev 24936)
@@ -831,13 +831,8 @@
                                char **db_args);
 
     /*
-     * Optional: Set *age to the last modification time of the database.  Used
-     * by the KDC lookaside cache to ensure that lookaside entries are not used
-     * if the database has changed since the entry was recorded.
-     *
-     * If this function is unimplemented, lookaside cache entries will
-     * effectively expire immediately.  Another option is to supply the current
-     * time, which will cause lookaside cache entries to last for one second.
+     * Deprecated: No longer used as of krb5 1.10; can be removed in the next
+     * DAL revision.  Modules should leave as NULL.
      */
     krb5_error_code (*get_age)(krb5_context kcontext, char *db_name,
                                time_t *age);

Modified: trunk/src/kdc/replay.c
===================================================================
--- trunk/src/kdc/replay.c	2011-05-19 14:14:54 UTC (rev 24935)
+++ trunk/src/kdc/replay.c	2011-05-20 15:21:28 UTC (rev 24936)
@@ -34,7 +34,6 @@
     struct _krb5_kdc_replay_ent *next;
     int num_hits;
     krb5_int32 timein;
-    time_t db_age;
     krb5_data *req_packet;
     krb5_data *reply_packet;
 } krb5_kdc_replay_ent;
@@ -47,13 +46,11 @@
 static int num_entries = 0;
 
 #define STALE_TIME      2*60            /* two minutes */
-#define STALE(ptr) ((abs((ptr)->timein - timenow) >= STALE_TIME) ||     \
-                    ((ptr)->db_age != db_age))
+#define STALE(ptr) (abs((ptr)->timein - timenow) >= STALE_TIME)
 
 #define MATCH(ptr) (((ptr)->req_packet->length == inpkt->length) &&     \
                     !memcmp((ptr)->req_packet->data, inpkt->data,       \
-                            inpkt->length) &&                           \
-                    ((ptr)->db_age == db_age))
+                            inpkt->length))
 /* XXX
    Todo:  quench the size of the queue...
 */
@@ -66,10 +63,8 @@
 {
     krb5_int32 timenow;
     register krb5_kdc_replay_ent *eptr, *last, *hold;
-    time_t db_age;
 
-    if (krb5_timeofday(kdc_context, &timenow) ||
-        krb5_db_get_age(kdc_context, 0, &db_age))
+    if (krb5_timeofday(kdc_context, &timenow))
         return FALSE;
 
     calls++;
@@ -118,10 +113,8 @@
 {
     register krb5_kdc_replay_ent *eptr;
     krb5_int32 timenow;
-    time_t db_age;
 
-    if (krb5_timeofday(kdc_context, &timenow) ||
-        krb5_db_get_age(kdc_context, 0, &db_age))
+    if (krb5_timeofday(kdc_context, &timenow))
         return;
 
     /* this is a new entry */
@@ -129,7 +122,6 @@
     if (!eptr)
         return;
     eptr->timein = timenow;
-    eptr->db_age = db_age;
     /*
      * This is going to hurt a lot malloc()-wise due to the need to
      * allocate memory for the krb5_data and krb5_address elements.




More information about the cvs-krb5 mailing list