My mistake it was ASN1_TIME that is correct.

But any way, I don't see a reason why I should not be able to convert
it, if I don't care for milliseconds, time_t can represent times for
up to 2038, so It should be ok to convert it to the time_t.

Any ideas, the ASN1_cmp_time does much more than what I need, because
I will be comparing at least once a second (If I check the last time
to be at least one second earlier.) And because they are all in my
cache for hopefully lets say a year, why not convert it to time_t and
just check it with > current_gmt_time ?

Thanks

Joe



On 1/28/06, Dr. Stephen Henson wrote:
> On Sat, Jan 28, 2006, Joe Gluck wrote:
>
> > Thank you for all tour replies but the gettimeofday I already use, but
> > it was not what I was asking in the original message.
> >
> > What I asked is how can I get the ASN1_integer into a time_t to be
> > able to compare it with the current GMT time (which i can get with
> > some system functions, on linux gettimeofday)? (See first message in
> > thread)
> >

>
> Actually you asked how to convert an ASN1_TIME to time_t. The answer in
> general to that is "you can't" because an ASN1_TIME can express a wider r=

ange
> of dates than a typical 32 bit time_t.
>
> If you want to compare an ASN1_TIME to the current time that's a differen=

t
> thing entirely. What OpenSSL does is to convert the time_t into an ASN1_T=

IME
> and compares the two ASN1_TIME structures.
>
> There is a function called X509_cmp_time() that does the conversion and
> comparison. It can be fed either a pointer to a time_t with the time to
> compare against or NULL which uses the current time.
>
> Steve.
> --
> Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
> OpenSSL project core developer and freelance consultant.
> Funding needed! Details on homepage.
> Homepage: http://www.drh-consultancy.demon.co.uk
> __________________________________________________ ____________________
> OpenSSL Project http://www.openssl.org
> Development Mailing List openssl-dev@openssl.org
> Automated List Manager majordomo@openssl.org
>

__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org