aboutsummaryrefslogtreecommitdiffstats
path: root/lib/gssapi/krb5/context_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gssapi/krb5/context_time.c')
-rw-r--r--lib/gssapi/krb5/context_time.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/gssapi/krb5/context_time.c b/lib/gssapi/krb5/context_time.c
index cb1550011cd7..58249cb5a311 100644
--- a/lib/gssapi/krb5/context_time.c
+++ b/lib/gssapi/krb5/context_time.c
@@ -36,27 +36,28 @@
OM_uint32
_gsskrb5_lifetime_left(OM_uint32 *minor_status,
krb5_context context,
- OM_uint32 lifetime,
+ OM_uint32 endtime,
OM_uint32 *lifetime_rec)
{
- krb5_timestamp timeret;
+ krb5_timestamp now;
krb5_error_code kret;
- if (lifetime == 0) {
+ if (endtime == 0) {
*lifetime_rec = GSS_C_INDEFINITE;
return GSS_S_COMPLETE;
}
- kret = krb5_timeofday(context, &timeret);
+ kret = krb5_timeofday(context, &now);
if (kret) {
+ *lifetime_rec = 0;
*minor_status = kret;
return GSS_S_FAILURE;
}
- if (lifetime < timeret)
+ if (endtime < now)
*lifetime_rec = 0;
else
- *lifetime_rec = lifetime - timeret;
+ *lifetime_rec = endtime - now;
return GSS_S_COMPLETE;
}
@@ -64,23 +65,23 @@ _gsskrb5_lifetime_left(OM_uint32 *minor_status,
OM_uint32 GSSAPI_CALLCONV _gsskrb5_context_time
(OM_uint32 * minor_status,
- const gss_ctx_id_t context_handle,
+ gss_const_ctx_id_t context_handle,
OM_uint32 * time_rec
)
{
krb5_context context;
- OM_uint32 lifetime;
+ OM_uint32 endtime;
OM_uint32 major_status;
const gsskrb5_ctx ctx = (const gsskrb5_ctx) context_handle;
GSSAPI_KRB5_INIT (&context);
HEIMDAL_MUTEX_lock(&ctx->ctx_id_mutex);
- lifetime = ctx->lifetime;
+ endtime = ctx->endtime;
HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex);
major_status = _gsskrb5_lifetime_left(minor_status, context,
- lifetime, time_rec);
+ endtime, time_rec);
if (major_status != GSS_S_COMPLETE)
return major_status;