summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/os/timeofday.c
diff options
context:
space:
mode:
authorZhanna Tsitkov <tsitkova@mit.edu>2009-12-09 16:52:41 +0000
committerZhanna Tsitkov <tsitkova@mit.edu>2009-12-09 16:52:41 +0000
commit009463e22f989a287835228459487c64dcb0b8b3 (patch)
treee458335dfad71ddca83d144bbe5852b9955123df /src/lib/krb5/os/timeofday.c
parente8fb3e469ce9f7b7ecf0d49e24cfcfac2fb95f1e (diff)
downloadkrb5-009463e22f989a287835228459487c64dcb0b8b3.tar.gz
krb5-009463e22f989a287835228459487c64dcb0b8b3.tar.xz
krb5-009463e22f989a287835228459487c64dcb0b8b3.zip
Change file holder for krb5int_check_clockskew. Minor Style changes per code practices
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23460 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/os/timeofday.c')
-rw-r--r--src/lib/krb5/os/timeofday.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/krb5/os/timeofday.c b/src/lib/krb5/os/timeofday.c
index a711b0493..7c4534e42 100644
--- a/src/lib/krb5/os/timeofday.c
+++ b/src/lib/krb5/os/timeofday.c
@@ -55,3 +55,18 @@ krb5_timeofday(krb5_context context, register krb5_timestamp *timeret)
*timeret = tval;
return 0;
}
+
+krb5_error_code
+krb5int_check_clockskew(krb5_context context, krb5_timestamp date)
+{
+ krb5_timestamp currenttime;
+ krb5_error_code retval;
+
+ retval = krb5_timeofday(context, &currenttime);
+ if (retval)
+ return retval;
+ if (!(labs((date)-currenttime) < context->clockskew))
+ return KRB5KRB_AP_ERR_SKEW;
+
+ return 0;
+}