modify replay cache code to generalize it
authorJohn Kohl <jtkohl@mit.edu>
Tue, 8 Jan 1991 14:31:51 +0000 (14:31 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Tue, 8 Jan 1991 14:31:51 +0000 (14:31 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1620 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/rd_req_dec.c

index 0028ca7dd71f615d6853002c9b39f71b9742d96f..4d8c01e135f155733519dc72b4a2c0b9d1146668 100644 (file)
@@ -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;