summaryrefslogtreecommitdiffstats
path: root/src/kdc/dispatch.c
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1991-02-13 15:30:29 +0000
committerJohn Kohl <jtkohl@mit.edu>1991-02-13 15:30:29 +0000
commita824a8a9d62856e20241e4ae97433c85f1859a0e (patch)
tree088e626f62dd372b2ba98414890f831e31fc548a /src/kdc/dispatch.c
parent1375a86d2246968d01816497527b687dbebac2bd (diff)
downloadkrb5-a824a8a9d62856e20241e4ae97433c85f1859a0e.tar.gz
krb5-a824a8a9d62856e20241e4ae97433c85f1859a0e.tar.xz
krb5-a824a8a9d62856e20241e4ae97433c85f1859a0e.zip
add replay lookaside call-outs
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1683 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kdc/dispatch.c')
-rw-r--r--src/kdc/dispatch.c13
1 files changed, 12 insertions, 1 deletions
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 <krb5/krb5.h>
#include <krb5/asn1.h>
#include <krb5/kdb.h>
+#include <syslog.h>
#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;
}