From 5022e4b5da83cd9f2feed48d1888b29854b9369b Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Mon, 24 Jun 2002 19:48:40 +0000 Subject: [PATCH] * asn1_encode.c: Removed unused Mac OS 9 code * asn1_encode.c (asn1_encode_generaltime): Fixed the Mac code to use the correct epoch. * asn1_encode.c: Updated Utilities.h #include [pullups from 1-2-2-branch] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14561 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/ChangeLog | 14 ++++++++++++++ src/lib/krb5/asn.1/asn1_encode.c | 12 ++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index 8dace6e09..eb76b60fb 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,17 @@ +2002-06-24 Alexandra Ellwood + + * asn1_encode.c: Removed unused Mac OS 9 code + [pullup from 1-2-2-branch] + +2000-06-24 Miro Jurisic + + * asn1_encode.c (asn1_encode_generaltime): Fixed the Mac code to + use the correct epoch. + + * asn1_encode.c: Updated Utilities.h #include + + [pullups from 1-2-2-branch] + 2002-06-24 Tom Yu * asn1_get.c (asn1_get_length): Check for negative length. diff --git a/src/lib/krb5/asn.1/asn1_encode.c b/src/lib/krb5/asn.1/asn1_encode.c index 69d94f410..4ad3a7e64 100644 --- a/src/lib/krb5/asn.1/asn1_encode.c +++ b/src/lib/krb5/asn.1/asn1_encode.c @@ -188,12 +188,6 @@ asn1_error_code asn1_encode_ia5string(buf, len, val, retlen) return 0; } -#ifdef macintosh -#define EPOCH ((70 * 365 * 24 * 60 * 60) + (17 * 24 * 60 * 60) + (getTimeZoneOffset() * 60 * 60)) -#else -#define EPOCH (0) -#endif - asn1_error_code asn1_encode_generaltime(buf, val, retlen) asn1buf * buf; const time_t val; @@ -203,9 +197,11 @@ asn1_error_code asn1_encode_generaltime(buf, val, retlen) struct tm *gtime; char s[16]; unsigned int length, sum=0; - time_t gmt_time; + time_t gmt_time = val; - gmt_time = val + EPOCH; +#ifdef macintosh + unix_time_to_msl_time (&gmt_time); +#endif gtime = gmtime(&gmt_time); /* -- 2.26.2