gss_inquire_context lifetime calculation was inverted
authorLuke Howard <lukeh@padl.com>
Fri, 15 May 2015 12:16:18 +0000 (14:16 +0200)
committerLuke Howard <lukeh@padl.com>
Fri, 15 May 2015 12:16:18 +0000 (14:16 +0200)
mech_eap/inquire_context.c

index 305145c..5d0e5b6 100644 (file)
@@ -74,20 +74,8 @@ gss_inquire_context(OM_uint32 *minor,
             *targ_name = GSS_C_NO_NAME;
     }
 
-    if (lifetime_rec != NULL) {
-        time_t now, lifetime;
-
-        if (ctx->expiryTime == 0) {
-            lifetime = GSS_C_INDEFINITE;
-        } else {
-            now = time(NULL);
-            lifetime = now - ctx->expiryTime;
-            if (lifetime < 0)
-                lifetime = 0;
-        }
-
-        *lifetime_rec = lifetime;
-    }
+    if (lifetime_rec != NULL)
+        gssEapContextTime(&tmpMinor, ctx, lifetime_rec);
 
     if (mech_type != NULL) {
         major = gssEapCanonicalizeOid(minor, ctx->mechanismUsed, 0, mech_type);