From: John Kohl Date: Wed, 13 Feb 1991 15:30:29 +0000 (+0000) Subject: add replay lookaside call-outs X-Git-Tag: krb5-1.0-alpha4~289 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a824a8a9d62856e20241e4ae97433c85f1859a0e;p=krb5.git add replay lookaside call-outs git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1683 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/dispatch.c b/src/kdc/dispatch.c index 463504b14..394a5bae7 100644 --- a/src/kdc/dispatch.c +++ b/src/kdc/dispatch.c @@ -19,6 +19,7 @@ static char rcsid_dispatch_c[] = #include #include #include +#include #include "kdc_util.h" krb5_error_code @@ -33,6 +34,13 @@ krb5_data **response; krb5_kdc_req *tgs_req; /* decode incoming packet, and dispatch */ + + /* try the replay lookaside buffer */ + if (kdc_check_lookaside(pkt, response)) { + /* a hit! */ + syslog(LOG_INFO, "DISPATCH: replay found and re-transmitted"); + return 0; + } /* try TGS_REQ first; they are more common! */ if (krb5_is_tgs_req(pkt)) { @@ -48,9 +56,12 @@ krb5_data **response; } #ifdef KRB4 else if (pkt->data[0] == 4) /* XXX old version */ - return(process_v4(pkt, from, response)); + retval = process_v4(pkt, from, response); #endif else retval = KRB5KRB_AP_ERR_MSG_TYPE; + /* put the response into the lookaside buffer */ + kdc_insert_lookaside(pkt, *response); + return retval; }