63 #ifndef OPENSSL_NO_RSA
66 #ifndef OPENSSL_NO_DSA
77 #ifndef OPENSSL_NO_FP_API
109 char *m=NULL,mlch =
' ';
127 if (
BIO_write(bp,
"Certificate:\n",13) <= 0)
goto err;
128 if (
BIO_write(bp,
" Data:\n",10) <= 0)
goto err;
133 if (
BIO_printf(bp,
"%8sVersion: %lu (0x%lx)\n",
"",l+1,l) <= 0)
goto err;
138 if (
BIO_write(bp,
" Serial Number:",22) <= 0)
goto err;
141 if (bs->
length <= (
int)
sizeof(
long))
151 if (
BIO_printf(bp,
" %s%lu (%s0x%lx)\n",neg,l,neg,l) <= 0)
157 if (
BIO_printf(bp,
"\n%12s%s",
"",neg) <= 0)
goto err;
159 for (i=0; i<bs->
length; i++)
162 ((i+1 == bs->
length)?
'\n':
':')) <= 0)
174 if (
BIO_printf(bp,
"%8sSignature Algorithm: ",
"") <= 0)
185 if (
BIO_printf(bp,
" Issuer:%c",mlch) <= 0)
goto err;
191 if (
BIO_write(bp,
" Validity\n",17) <= 0)
goto err;
192 if (
BIO_write(bp,
" Not Before: ",24) <= 0)
goto err;
194 if (
BIO_write(bp,
"\n Not After : ",25) <= 0)
goto err;
200 if (
BIO_printf(bp,
" Subject:%c",mlch) <= 0)
goto err;
206 if (
BIO_write(bp,
" Subject Public Key Info:\n",33) <= 0)
208 if (
BIO_printf(bp,
"%12sPublic Key Algorithm: ",
"") <= 0)
218 BIO_printf(bp,
"%12sUnable to load Public Key\n",
"");
230 ci->extensions, cflag, 8);
248 unsigned char *der=NULL ;
249 unsigned char *dertmp;
256 if (
BIO_printf(bp,
" Subject OCSP hash: ") <= 0)
259 if ((der = dertmp = (
unsigned char *)
OPENSSL_malloc (derlen)) == NULL)
267 if (
BIO_printf(bp,
"%02X",SHA1md[i]) <= 0)
goto err;
274 if (
BIO_printf(bp,
"\n Public key OCSP hash: ") <= 0)
296 const unsigned char *s;
306 if (
BIO_indent(bp, indent, indent) <= 0)
return 0;
309 ((i+1) == n)?
"":
":") <= 0)
return 0;
319 if (
BIO_puts(bp,
" Signature Algorithm: ") <= 0)
return 0;
325 int pkey_nid, dig_nid;
331 return ameth->
sig_print(bp, sigalg, sig, 9, 0);
347 if (v == NULL)
return(0);
349 p=(
const char *)v->
data;
350 for (i=0; i<v->
length; i++)
352 if ((p[i] >
'~') || ((p[i] <
' ') &&
353 (p[i] !=
'\n') && (p[i] !=
'\r')))
380 static const char *mon[12]=
382 "Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
383 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
391 int y=0,M=0,d=0,
h=0,m=0,s=0;
398 if (i < 12)
goto err;
399 if (v[i-1] ==
'Z') gmt=1;
401 if ((v[i] >
'9') || (v[i] <
'0'))
goto err;
402 y= (v[0]-
'0')*1000+(v[1]-
'0')*100 + (v[2]-
'0')*10+(v[3]-
'0');
403 M= (v[4]-
'0')*10+(v[5]-
'0');
404 if ((M > 12) || (M < 1))
goto err;
405 d= (v[6]-
'0')*10+(v[7]-
'0');
406 h= (v[8]-
'0')*10+(v[9]-
'0');
407 m= (v[10]-
'0')*10+(v[11]-
'0');
409 (v[12] >=
'0') && (v[12] <=
'9') &&
410 (v[13] >=
'0') && (v[13] <=
'9'))
412 s= (v[12]-
'0')*10+(v[13]-
'0');
414 if (tm->
length >= 15 && v[14] ==
'.')
419 while (14 + f_len < l && f[f_len] >=
'0' && f[f_len] <=
'9')
424 if (
BIO_printf(bp,
"%s %2d %02d:%02d:%02d%.*s %d%s",
425 mon[M-1],d,
h,m,s,f_len,f,y,(gmt)?
" GMT":
"") <= 0)
439 int y=0,M=0,d=0,
h=0,m=0,s=0;
442 v=(
const char *)tm->
data;
444 if (i < 10)
goto err;
445 if (v[i-1] ==
'Z') gmt=1;
447 if ((v[i] >
'9') || (v[i] <
'0'))
goto err;
448 y= (v[0]-
'0')*10+(v[1]-
'0');
450 M= (v[2]-
'0')*10+(v[3]-
'0');
451 if ((M > 12) || (M < 1))
goto err;
452 d= (v[4]-
'0')*10+(v[5]-
'0');
453 h= (v[6]-
'0')*10+(v[7]-
'0');
454 m= (v[8]-
'0')*10+(v[9]-
'0');
456 (v[10] >=
'0') && (v[10] <=
'9') &&
457 (v[11] >=
'0') && (v[11] <=
'9'))
458 s= (v[10]-
'0')*10+(v[11]-
'0');
460 if (
BIO_printf(bp,
"%s %2d %02d:%02d:%02d %d%s",
461 mon[M-1],d,
h,m,s,y+1900,(gmt)?
" GMT":
"") <= 0)
488 #ifndef CHARSET_EBCDIC
490 ((s[1] >=
'A') && (s[1] <=
'Z') && (
492 ((s[2] >=
'A') && (s[2] <=
'Z') &&
515 if (*s ==
'\0')
break;