Fixed time magic.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@311 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
7
d.c
7
d.c
@@ -174,8 +174,7 @@ der_get_generalizedtime (Buffer *b, void *val)
|
|||||||
time_t *t = (time_t *)val;
|
time_t *t = (time_t *)val;
|
||||||
int len;
|
int len;
|
||||||
krb5_data str;
|
krb5_data str;
|
||||||
struct tm tm;
|
struct tm tm, *tm2;
|
||||||
extern long timezone;
|
|
||||||
|
|
||||||
len = der_get_octetstring (b, &str);
|
len = der_get_octetstring (b, &str);
|
||||||
sscanf (str.data, "%04d%02d%02d%02d%02d%02dZ",
|
sscanf (str.data, "%04d%02d%02d%02d%02d%02dZ",
|
||||||
@@ -186,8 +185,10 @@ der_get_generalizedtime (Buffer *b, void *val)
|
|||||||
tm.tm_isdst = 0;
|
tm.tm_isdst = 0;
|
||||||
|
|
||||||
*t = mktime (&tm);
|
*t = mktime (&tm);
|
||||||
*t -= timezone;
|
|
||||||
|
|
||||||
|
tm2 = gmtime (t);
|
||||||
|
|
||||||
|
*t += *t - mktime (tm2);
|
||||||
string_free (str);
|
string_free (str);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user