- if (outfile) {
- if (!(out = BIO_new_file (outfile, "w"))) {
- BIO_printf (bio_err,
- "Can't open output file %s\n", outfile);
- goto end;
- }
- } else out = BIO_new_fp(stdout, BIO_NOCLOSE);
+ if (outfile) {
+ if (!(out = BIO_new_file(outfile, "w"))) {
+ BIO_printf(bio_err, "Can't open output file %s\n", outfile);
+ goto end;
+ }
+ } else {
+ out = BIO_new_fp(stdout, BIO_NOCLOSE);
+#ifdef OPENSSL_SYS_VMS
+ {
+ BIO *tmpbio = BIO_new(BIO_f_linebuffer());
+ out = BIO_push(tmpbio, out);
+ }
+#endif
+ }
+ if (toseq) {
+ seq = NETSCAPE_CERT_SEQUENCE_new();
+ seq->certs = sk_X509_new_null();
+ while ((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)))
+ sk_X509_push(seq->certs, x509);