68 #ifndef CHARSET_EBCDIC
108 if ((ret != NULL) && ((a == NULL) || (*a != ret)))
117 static const int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0};
118 static const int max[8]={99,12,31,23,59,59,12,59};
122 if (d->
type != V_ASN1_UTCTIME)
return(0);
127 if (l < 11)
goto err;
130 if ((i == 5) && ((a[o] ==
'Z') ||
131 (a[o] ==
'+') || (a[o] ==
'-')))
133 if ((a[o] <
'0') || (a[o] >
'9'))
goto err;
135 if (++o > l)
goto err;
137 if ((a[o] <
'0') || (a[o] >
'9'))
goto err;
139 if (++o > l)
goto err;
141 if ((n < min[i]) || (n > max[i]))
goto err;
145 else if ((a[o] ==
'+') || (a[o] ==
'-'))
148 if (o+4 > l)
goto err;
151 if ((a[o] <
'0') || (a[o] >
'9'))
goto err;
154 if ((a[o] <
'0') || (a[o] >
'9'))
goto err;
156 if ((n < min[i]) || (n > max[i]))
goto err;
171 t.
data=(
unsigned char *)str;
177 (
unsigned char *)str,t.
length))
193 int offset_day,
long offset_sec)
209 if (offset_day || offset_sec)
215 if((ts->tm_year < 50) || (ts->tm_year >= 150))
219 if ((p == NULL) || ((size_t)s->
length < len))
229 s->
data=(
unsigned char *)p;
232 BIO_snprintf(p,len,
"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
233 ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
236 #ifdef CHARSET_EBCDIC_not
250 #define g2(p) (((p)[0]-'0')*10+(p)[1]-'0')
252 if (s->
data[12] ==
'Z')
257 if (s->
data[12] ==
'-')
265 #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
288 memset(&tm,
'\0',
sizeof tm);
290 #define g2(p) (((p)[0]-'0')*10+(p)[1]-'0')
294 tm.tm_mon=
g2(s->
data+2)-1;
299 if(s->
data[12] ==
'Z')
304 if(s->
data[12] ==
'-')
309 return mktime(&tm)-offset*60;