X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=apps%2Fpkcs7.c;h=0e1427cc315513ac91a7ed82396828b1f8591f82;hp=47bd7564a97722aab5830cfae1f55bad7f789c6c;hb=37b7185b5dafec8c1798b2f7ebb3e5c22bf74fa4;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86 diff --git a/apps/pkcs7.c b/apps/pkcs7.c index 47bd7564a9..0e1427cc31 100644 --- a/apps/pkcs7.c +++ b/apps/pkcs7.c @@ -1,5 +1,5 @@ /* apps/pkcs7.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 @@ -61,12 +61,12 @@ #include #include #include "apps.h" -#include "err.h" -#include "objects.h" -#include "evp.h" -#include "x509.h" -#include "pkcs7.h" -#include "pem.h" +#include +#include +#include +#include +#include +#include #undef PROG #define PROG pkcs7_main @@ -81,13 +81,13 @@ * -print_certs */ -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { PKCS7 *p7=NULL; int i,badops=0; +#if !defined(NO_DES) || !defined(NO_IDEA) EVP_CIPHER *enc=NULL; +#endif BIO *in=NULL,*out=NULL; int informat,outformat; char *infile,*outfile,*prog,buf[256]; @@ -98,7 +98,7 @@ char **argv; if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) - BIO_set_fp(bio_err,stderr,BIO_NOCLOSE); + BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); infile=NULL; outfile=NULL; @@ -159,7 +159,7 @@ bad: BIO_printf(bio_err,"where options are\n"); BIO_printf(bio_err," -inform arg input format - one of DER TXT PEM\n"); BIO_printf(bio_err," -outform arg output format - one of DER TXT PEM\n"); - BIO_printf(bio_err," -in arg inout file\n"); + BIO_printf(bio_err," -in arg input file\n"); BIO_printf(bio_err," -out arg output file\n"); BIO_printf(bio_err," -print_certs print any certs or crl in the input\n"); BIO_printf(bio_err," -des encrypt PEM output with cbc des\n"); @@ -195,7 +195,7 @@ bad: if (informat == FORMAT_ASN1) p7=d2i_PKCS7_bio(in,NULL); else if (informat == FORMAT_PEM) - p7=PEM_read_bio_PKCS7(in,NULL,NULL); + p7=PEM_read_bio_PKCS7(in,NULL,NULL,NULL); else { BIO_printf(bio_err,"bad input format specified for pkcs7 object\n"); @@ -221,8 +221,8 @@ bad: if (print_certs) { - STACK *certs=NULL; - STACK *crls=NULL; + STACK_OF(X509) *certs=NULL; + STACK_OF(X509_CRL) *crls=NULL; i=OBJ_obj2nid(p7->type); switch (i) @@ -243,9 +243,9 @@ bad: { X509 *x; - for (i=0; icrl->issuer,buf,256); BIO_puts(out,"issuer= "); BIO_puts(out,buf); BIO_puts(out,"\nlast update="); - ASN1_UTCTIME_print(out,crl->crl->lastUpdate); + ASN1_TIME_print(out,crl->crl->lastUpdate); BIO_puts(out,"\nnext update="); - ASN1_UTCTIME_print(out,crl->crl->nextUpdate); + ASN1_TIME_print(out,crl->crl->nextUpdate); BIO_puts(out,"\n"); PEM_write_bio_X509_CRL(out,crl);