/* crypto/asn1/a_utctm.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
V_ASN1_UTCTIME,V_ASN1_UNIVERSAL);
if (ret == NULL)
{
- ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_ERROR_STACK);
+ ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ERR_R_NESTED_ASN1_ERROR);
return(NULL);
}
if (!ASN1_UTCTIME_check(ret))
return(0);
}
+int ASN1_UTCTIME_set_string(s,str)
+ASN1_UTCTIME *s;
+char *str;
+ {
+ ASN1_UTCTIME t;
+
+ t.type=V_ASN1_UTCTIME;
+ t.length=strlen(str);
+ t.data=(unsigned char *)str;
+ if (ASN1_UTCTIME_check(&t))
+ {
+ if (s != NULL)
+ {
+ ASN1_STRING_set((ASN1_STRING *)s,
+ (unsigned char *)str,t.length);
+ }
+ return(1);
+ }
+ else
+ return(0);
+ }
+
ASN1_UTCTIME *ASN1_UTCTIME_set(s, t)
ASN1_UTCTIME *s;
time_t t;
{
char *p;
struct tm *ts;
-#if defined(THREADS)
+#if defined(THREADS) && !defined(WIN32)
struct tm data;
#endif
if (s == NULL)
return(NULL);
-#if defined(THREADS)
+#if defined(THREADS) && !defined(WIN32)
ts=(struct tm *)gmtime_r(&t,&data);
#else
ts=(struct tm *)gmtime(&t);