From 2d16a40826cf8eba37a3b7048ef782d5c49e9d87 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Tue, 8 Jan 1991 14:31:51 +0000 Subject: [PATCH] modify replay cache code to generalize it git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1620 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/rd_req_dec.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/rd_req_dec.c b/src/lib/krb5/krb/rd_req_dec.c index 0028ca7dd..4d8c01e13 100644 --- a/src/lib/krb5/krb/rd_req_dec.c +++ b/src/lib/krb5/krb/rd_req_dec.c @@ -155,10 +155,23 @@ krb5_tkt_authent *tktauthent; /* only check rcache if sender has provided one---some services may not be able to use replay caches (such as datagram servers) */ - if (rcache && (retval = krb5_rc_store(rcache, tktauthent))) { - tktauthent->ticket = 0; - clean_authenticator(); - return retval; + if (rcache) { + krb5_donot_replay rep; + + if (retval = krb5_auth_to_rep(tktauthent, &rep)) { + tktauthent->ticket = 0; + clean_authenticator(); + return retval; + } + if (retval = krb5_rc_store(rcache, &rep)) { + xfree(rep.server); + xfree(rep.client); + tktauthent->ticket = 0; + clean_authenticator(); + return retval; + } + xfree(rep.server); + xfree(rep.client); } tktauthent->ticket = 0; -- 2.26.2