ASN1_UTCTIME_print(bio_out,x->crl->lastUpdate);
ASN1_TIME_print(bio_out,x->crl->lastUpdate);
int MAIN(argc, argv)int argc;char **argv;	{	X509_CRL *x=NULL;	int ret=1,i,num,badops=0;	BIO *out=NULL;	int informat,outformat;	char *infile=NULL,*outfile=NULL;	int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0;	char **pp,buf[256];	apps_startup();	if (bio_err == NULL)		if ((bio_err=BIO_new(BIO_s_file())) != NULL)			BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);	if (bio_out == NULL)		if ((bio_out=BIO_new(BIO_s_file())) != NULL)			BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);	informat=FORMAT_PEM;	outformat=FORMAT_PEM;	argc--;	argv++;	num=0;	while (argc >= 1)		{#ifdef undef		if	(strcmp(*argv,"-p") == 0)			{			if (--argc < 1) goto bad;			if (!args_from_file(++argv,Nargc,Nargv)) { goto end; }*/			}#endif		if 	(strcmp(*argv,"-inform") == 0)			{			if (--argc < 1) goto bad;			informat=str2fmt(*(++argv));			}		else if (strcmp(*argv,"-outform") == 0)			{			if (--argc < 1) goto bad;			outformat=str2fmt(*(++argv));			}		else if (strcmp(*argv,"-text") == 0)			{			outformat=FORMAT_TEXT;			}		else if (strcmp(*argv,"-in") == 0)			{			if (--argc < 1) goto bad;			infile= *(++argv);			}		else if (strcmp(*argv,"-out") == 0)			{			if (--argc < 1) goto bad;			outfile= *(++argv);			}		else if (strcmp(*argv,"-hash") == 0)			hash= ++num;		else if (strcmp(*argv,"-issuer") == 0)			issuer= ++num;		else if (strcmp(*argv,"-lastupdate") == 0)			lastupdate= ++num;		else if (strcmp(*argv,"-nextupdate") == 0)			nextupdate= ++num;		else if (strcmp(*argv,"-noout") == 0)			noout= ++num;		else			{			BIO_printf(bio_err,"unknown option %s\n",*argv);			badops=1;			break;			}		argc--;		argv++;		}	if (outformat == FORMAT_TEXT)		{		num=0;		issuer= ++num;		lastupdate= ++num;		nextupdate= ++num;		}	if (badops)		{bad:		for (pp=crl_usage; (*pp != NULL); pp++)			BIO_printf(bio_err,*pp);		goto end;		}	ERR_load_crypto_strings();	x=load_crl(infile,informat);	if (x == NULL) { goto end; }	if (num)		{		for (i=1; i<=num; i++)			{			if (issuer == i)				{				X509_NAME_oneline(x->crl->issuer,buf,256);				fprintf(stdout,"issuer= %s\n",buf);				}			if (hash == i)				{				fprintf(stdout,"%08lx\n",					X509_NAME_hash(x->crl->issuer));				}			if (lastupdate == i)				{				fprintf(stdout,"lastUpdate=");				ASN1_UTCTIME_print(bio_out,x->crl->lastUpdate);				fprintf(stdout,"\n");				}			if (nextupdate == i)				{				fprintf(stdout,"nextUpdate=");				if (x->crl->nextUpdate != NULL)					ASN1_UTCTIME_print(bio_out,x->crl->nextUpdate);				else					fprintf(stdout,"NONE");				fprintf(stdout,"\n");				}			}		}	if (noout) goto end;	out=BIO_new(BIO_s_file());	if (out == NULL)		{		ERR_print_errors(bio_err);		goto end;		}	if (outfile == NULL)		BIO_set_fp(out,stdout,BIO_NOCLOSE);	else		{		if (BIO_write_filename(out,outfile) <= 0)			{			perror(outfile);			goto end;			}		}	if 	(outformat == FORMAT_ASN1)		i=(int)i2d_X509_CRL_bio(out,x);	else if (outformat == FORMAT_PEM)		i=PEM_write_bio_X509_CRL(out,x);	else if (outformat == FORMAT_TEXT)		{		X509_REVOKED *r;		STACK *sk;		sk=sk_dup(x->crl->revoked);		while ((r=(X509_REVOKED *)sk_pop(sk)) != NULL)			{			fprintf(stdout,"revoked: serialNumber=");			i2a_ASN1_INTEGER(out,r->serialNumber);			fprintf(stdout," revocationDate=");			ASN1_UTCTIME_print(bio_out,r->revocationDate);			fprintf(stdout,"\n");			}		sk_free(sk);		i=1;		}	else			{		BIO_printf(bio_err,"bad output format specified for outfile\n");		goto end;		}	if (!i) { BIO_printf(bio_err,"unable to write CRL\n"); goto end; }	ret=0;end:	if (out != NULL) BIO_free(out);	if (bio_out != NULL) BIO_free(bio_out);	if (x != NULL) X509_CRL_free(x);	EXIT(ret);	}