Stop assuming the IV is 8 bytes long, use the real size instead.
[oweals/openssl.git] / crypto / asn1 / a_utctm.c
index 0a5a8d27536034d86d67b0a83812a6d0b4371c4a..3ae7432cb20aef77a7c4ecebb37ea2dcdd2215ba 100644 (file)
@@ -58,7 +58,7 @@
 
 #include <stdio.h>
 #include <time.h>
-#ifdef OPENSSL_SYS_VMS
+#ifdef VMS
 #include <descrip.h>
 #include <lnmdef.h>
 #include <starlet.h>
 #include "cryptlib.h"
 #include <openssl/asn1.h>
 
-#if 0
+ASN1_UTCTIME *ASN1_UTCTIME_new(void)
+{ return M_ASN1_UTCTIME_new(); }
+
+void ASN1_UTCTIME_free(ASN1_UTCTIME *x)
+{ M_ASN1_UTCTIME_free(x); }
+
 int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
        {
 #ifndef CHARSET_EBCDIC
@@ -114,8 +119,6 @@ err:
        return(NULL);
        }
 
-#endif
-
 int ASN1_UTCTIME_check(ASN1_UTCTIME *d)
        {
        static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0};
@@ -179,7 +182,6 @@ int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str)
                        {
                        ASN1_STRING_set((ASN1_STRING *)s,
                                (unsigned char *)str,t.length);
-                       s->type = V_ASN1_UTCTIME;
                        }
                return(1);
                }
@@ -191,7 +193,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
        {
        char *p;
        struct tm *ts;
-#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)
+#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
 
        struct tm data;
 #endif
@@ -201,13 +203,13 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
        if (s == NULL)
                return(NULL);
 
-#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)
+#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
        gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
        ts=&data;
 #else
        ts=gmtime(&t);
 #endif
-#ifdef OPENSSL_SYS_VMS
+#ifdef VMS
        if (ts == NULL)
                {
                static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL");
@@ -284,7 +286,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
 
        t -= offset*60; /* FIXME: may overflow in extreme cases */
 
-#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)
+#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
        { struct tm data; gmtime_r(&t, &data); tm = &data; }
 #else
        tm = gmtime(&t);