Allow clock skew in krb5 gss_context_time()
authorGreg Hudson <ghudson@mit.edu>
Sat, 22 Apr 2017 20:51:23 +0000 (16:51 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 24 Apr 2017 20:09:16 +0000 (16:09 -0400)
Commit b496ce4095133536e0ace36b74130e4b9ecb5e11 (ticket #8268) adds
the clock skew to krb5 acceptor context lifetimes for
gss_accept_sec_context() and gss_inquire_context(), but not for
gss_context_time().  Add the clock skew in gss_context_time() as well.

ticket: 8581 (new)
target_version: 1.14-next
target_version: 1.15-next
tags: pullup

src/lib/gssapi/krb5/context_time.c

index a18cfb05b743fbccf68dc52e203ebc050c7e6509..450593288cff51897a49a315dd0ac81f69ad3c05 100644 (file)
@@ -51,7 +51,10 @@ krb5_gss_context_time(minor_status, context_handle, time_rec)
         return(GSS_S_FAILURE);
     }
 
-    if ((lifetime = ctx->krb_times.endtime - now) <= 0) {
+    lifetime = ctx->krb_times.endtime - now;
+    if (!ctx->initiate)
+        lifetime += ctx->k5_context->clockskew;
+    if (lifetime <= 0) {
         *time_rec = 0;
         *minor_status = 0;
         return(GSS_S_CONTEXT_EXPIRED);