Merge of main trunk, all conflicts resolved.
This commit is contained in:
		
							
								
								
									
										16
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								CHANGES
									
									
									
									
									
								
							@@ -4,6 +4,22 @@
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.5a and 0.9.6  [xx XXX 2000]
 | 
			
		||||
 | 
			
		||||
  *) On VMS, stdout may very well lead to a file that is written to
 | 
			
		||||
     in a record-oriented fashion.  That means that every write() will
 | 
			
		||||
     write a separate record, which will be read separately by the
 | 
			
		||||
     programs trying to read from it.  This can be very confusing.
 | 
			
		||||
 | 
			
		||||
     The solution is to put a BIO filter in the way that will buffer
 | 
			
		||||
     text until a linefeed is reached, and then write everything a
 | 
			
		||||
     line at a time, so every record written will be an actual line,
 | 
			
		||||
     not chunks of lines and not (usually doesn't happen, but I've
 | 
			
		||||
     seen it once) several lines in one record.  BIO_f_linebuffer() is
 | 
			
		||||
     the answer.
 | 
			
		||||
 | 
			
		||||
     Currently, it's a VMS-only method, because that's where it has
 | 
			
		||||
     been tested well enough.
 | 
			
		||||
     [Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) Remove 'optimized' squaring variant in BN_mod_mul_montgomery,
 | 
			
		||||
     it can return incorrect results.
 | 
			
		||||
     (Note: The buggy variant was not enabled in OpenSSL 0.9.5a,
 | 
			
		||||
 
 | 
			
		||||
@@ -206,6 +206,12 @@ bad:
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
	BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
	{
 | 
			
		||||
	BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
	out = BIO_push(tmpbio, out);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (oidfile != NULL)
 | 
			
		||||
		{
 | 
			
		||||
@@ -315,7 +321,7 @@ bad:
 | 
			
		||||
end:
 | 
			
		||||
	BIO_free(derout);
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (b64 != NULL) BIO_free(b64);
 | 
			
		||||
	if (ret != 0)
 | 
			
		||||
		ERR_print_errors(bio_err);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								apps/ca.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								apps/ca.c
									
									
									
									
									
								
							@@ -717,6 +717,12 @@ bad:
 | 
			
		||||
	if (verbose)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT); /* cannot fail */
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		TXT_DB_write(out,db);
 | 
			
		||||
		BIO_printf(bio_err,"%d entries loaded from the database\n",
 | 
			
		||||
			db->data->num);
 | 
			
		||||
@@ -751,7 +757,15 @@ bad:
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			BIO_set_fp(Sout,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
			{
 | 
			
		||||
			BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			Sout = BIO_push(tmpbio, Sout);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (req)
 | 
			
		||||
@@ -1047,7 +1061,7 @@ bad:
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			BIO_free(in);
 | 
			
		||||
			BIO_free(out);
 | 
			
		||||
			BIO_free_all(out);
 | 
			
		||||
			in=NULL;
 | 
			
		||||
			out=NULL;
 | 
			
		||||
			if (rename(serialfile,buf[2]) < 0)
 | 
			
		||||
@@ -1264,9 +1278,9 @@ bad:
 | 
			
		||||
	ret=0;
 | 
			
		||||
err:
 | 
			
		||||
	BIO_free(hex);
 | 
			
		||||
	BIO_free(Cout);
 | 
			
		||||
	BIO_free(Sout);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(Cout);
 | 
			
		||||
	BIO_free_all(Sout);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	BIO_free(in);
 | 
			
		||||
 | 
			
		||||
	sk_X509_pop_free(cert_sk,X509_free);
 | 
			
		||||
@@ -1381,7 +1395,7 @@ static int save_serial(char *serialfile, BIGNUM *serial)
 | 
			
		||||
	BIO_puts(out,"\n");
 | 
			
		||||
	ret=1;
 | 
			
		||||
err:
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (ai != NULL) ASN1_INTEGER_free(ai);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -108,6 +108,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	if (bio_err == NULL)
 | 
			
		||||
		bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 | 
			
		||||
	STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
	{
 | 
			
		||||
	BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
	STDout = BIO_push(tmpbio, STDout);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	argc--;
 | 
			
		||||
	argv++;
 | 
			
		||||
@@ -195,7 +201,7 @@ err:
 | 
			
		||||
end:
 | 
			
		||||
	if (ctx != NULL) SSL_CTX_free(ctx);
 | 
			
		||||
	if (ssl != NULL) SSL_free(ssl);
 | 
			
		||||
	if (STDout != NULL) BIO_free(STDout);
 | 
			
		||||
	if (STDout != NULL) BIO_free_all(STDout);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								apps/crl.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								apps/crl.c
									
									
									
									
									
								
							@@ -122,7 +122,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
	if (bio_out == NULL)
 | 
			
		||||
		if ((bio_out=BIO_new(BIO_s_file())) != NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
			{
 | 
			
		||||
			BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			bio_out = BIO_push(tmpbio, bio_out);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
	informat=FORMAT_PEM;
 | 
			
		||||
	outformat=FORMAT_PEM;
 | 
			
		||||
@@ -314,7 +322,15 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -340,8 +356,8 @@ bad:
 | 
			
		||||
	if (!i) { BIO_printf(bio_err,"unable to write CRL\n"); goto end; }
 | 
			
		||||
	ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free(bio_out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	BIO_free_all(bio_out);
 | 
			
		||||
	bio_out=NULL;
 | 
			
		||||
	X509_CRL_free(x);
 | 
			
		||||
	if(store) {
 | 
			
		||||
 
 | 
			
		||||
@@ -239,7 +239,15 @@ bad:
 | 
			
		||||
	sk_free(certflst);
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -266,7 +274,7 @@ bad:
 | 
			
		||||
	ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (p7 != NULL) PKCS7_free(p7);
 | 
			
		||||
	if (crl != NULL) X509_CRL_free(crl);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								apps/dgst.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								apps/dgst.c
									
									
									
									
									
								
							@@ -263,7 +263,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		if(out_bin)
 | 
			
		||||
			out = BIO_new_file(outfile, "wb");
 | 
			
		||||
		else    out = BIO_new_file(outfile, "w");
 | 
			
		||||
	} else out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
	} else {
 | 
			
		||||
		out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if(!out) {
 | 
			
		||||
		BIO_printf(bio_err, "Error opening output file %s\n", 
 | 
			
		||||
@@ -350,7 +358,7 @@ end:
 | 
			
		||||
		OPENSSL_free(buf);
 | 
			
		||||
		}
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	EVP_PKEY_free(sigkey);
 | 
			
		||||
	if(sigbuf) OPENSSL_free(sigbuf);
 | 
			
		||||
	if (bmd != NULL) BIO_free(bmd);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								apps/dh.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								apps/dh.c
									
									
									
									
									
								
							@@ -211,7 +211,15 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -336,7 +344,7 @@ bad:
 | 
			
		||||
	ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (dh != NULL) DH_free(dh);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -417,7 +417,15 @@ bad:
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -522,7 +530,7 @@ bad:
 | 
			
		||||
	ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (dh != NULL) DH_free(dh);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								apps/dsa.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								apps/dsa.c
									
									
									
									
									
								
							@@ -260,7 +260,15 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -308,7 +316,7 @@ bad:
 | 
			
		||||
		ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if(in != NULL) BIO_free(in);
 | 
			
		||||
	if(out != NULL) BIO_free(out);
 | 
			
		||||
	if(out != NULL) BIO_free_all(out);
 | 
			
		||||
	if(dsa != NULL) DSA_free(dsa);
 | 
			
		||||
	if(passin) OPENSSL_free(passin);
 | 
			
		||||
	if(passout) OPENSSL_free(passout);
 | 
			
		||||
 
 | 
			
		||||
@@ -207,7 +207,15 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -349,7 +357,7 @@ bad:
 | 
			
		||||
	ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (dsa != NULL) DSA_free(dsa);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								apps/enc.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								apps/enc.c
									
									
									
									
									
								
							@@ -443,7 +443,15 @@ bad:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if (outf == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outf) <= 0)
 | 
			
		||||
@@ -611,7 +619,7 @@ end:
 | 
			
		||||
	if (strbuf != NULL) OPENSSL_free(strbuf);
 | 
			
		||||
	if (buff != NULL) OPENSSL_free(buff);
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (benc != NULL) BIO_free(benc);
 | 
			
		||||
	if (b64 != NULL) BIO_free(b64);
 | 
			
		||||
	if(pass) OPENSSL_free(pass);
 | 
			
		||||
 
 | 
			
		||||
@@ -91,12 +91,18 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		out=BIO_new(BIO_s_file());
 | 
			
		||||
		if ((out != NULL) && BIO_set_fp(out,stdout,BIO_NOCLOSE))
 | 
			
		||||
			{
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
			{
 | 
			
		||||
			BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			out = BIO_push(tmpbio, out);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
			lh_node_stats_bio((LHASH *)ERR_get_string_table(),out);
 | 
			
		||||
			lh_stats_bio((LHASH *)ERR_get_string_table(),out);
 | 
			
		||||
			lh_node_usage_stats_bio((LHASH *)
 | 
			
		||||
				ERR_get_string_table(),out);
 | 
			
		||||
			}
 | 
			
		||||
		if (out != NULL) BIO_free(out);
 | 
			
		||||
		if (out != NULL) BIO_free_all(out);
 | 
			
		||||
		argc--;
 | 
			
		||||
		argv++;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								apps/gendh.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								apps/gendh.c
									
									
									
									
									
								
							@@ -169,7 +169,15 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -201,7 +209,7 @@ bad:
 | 
			
		||||
end:
 | 
			
		||||
	if (ret != 0)
 | 
			
		||||
		ERR_print_errors(bio_err);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (dh != NULL) DH_free(dh);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -205,7 +205,15 @@ bad:
 | 
			
		||||
	if (out == NULL) goto end;
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -236,7 +244,7 @@ end:
 | 
			
		||||
	if (ret != 0)
 | 
			
		||||
		ERR_print_errors(bio_err);
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (dsa != NULL) DSA_free(dsa);
 | 
			
		||||
	if(passout) OPENSSL_free(passout);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
 
 | 
			
		||||
@@ -195,7 +195,15 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -240,7 +248,7 @@ bad:
 | 
			
		||||
	ret=0;
 | 
			
		||||
err:
 | 
			
		||||
	if (rsa != NULL) RSA_free(rsa);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if(passout) OPENSSL_free(passout);
 | 
			
		||||
	if (ret != 0)
 | 
			
		||||
		ERR_print_errors(bio_err);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								apps/nseq.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								apps/nseq.c
									
									
									
									
									
								
							@@ -119,8 +119,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				 "Can't open output file %s\n", outfile);
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
	} else out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
 | 
			
		||||
	} else {
 | 
			
		||||
		out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef 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();
 | 
			
		||||
@@ -152,7 +159,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	ret = 0;
 | 
			
		||||
end:
 | 
			
		||||
	BIO_free(in);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	NETSCAPE_CERT_SEQUENCE_free(seq);
 | 
			
		||||
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
 
 | 
			
		||||
@@ -238,13 +238,19 @@ static int do_cmd(LHASH *prog, int argc, char *argv[])
 | 
			
		||||
	else if ((strncmp(argv[0],"no-",3)) == 0)
 | 
			
		||||
		{
 | 
			
		||||
		BIO *bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		bio_stdout = BIO_push(tmpbio, bio_stdout);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		f.name=argv[0]+3;
 | 
			
		||||
		ret = (lh_retrieve(prog,&f) != NULL);
 | 
			
		||||
		if (!ret)
 | 
			
		||||
			BIO_printf(bio_stdout, "%s\n", argv[0]);
 | 
			
		||||
		else
 | 
			
		||||
			BIO_printf(bio_stdout, "%s\n", argv[0]+3);
 | 
			
		||||
		BIO_free(bio_stdout);
 | 
			
		||||
		BIO_free_all(bio_stdout);
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
	else if ((strcmp(argv[0],"quit") == 0) ||
 | 
			
		||||
@@ -269,11 +275,17 @@ static int do_cmd(LHASH *prog, int argc, char *argv[])
 | 
			
		||||
		else /* strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0 */
 | 
			
		||||
			list_type = FUNC_TYPE_CIPHER;
 | 
			
		||||
		bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		bio_stdout = BIO_push(tmpbio, bio_stdout);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		
 | 
			
		||||
		for (fp=functions; fp->name != NULL; fp++)
 | 
			
		||||
			if (fp->type == list_type)
 | 
			
		||||
				BIO_printf(bio_stdout, "%s\n", fp->name);
 | 
			
		||||
		BIO_free(bio_stdout);
 | 
			
		||||
		BIO_free_all(bio_stdout);
 | 
			
		||||
		ret=0;
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -81,6 +81,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	if (out == NULL)
 | 
			
		||||
		goto err;
 | 
			
		||||
	BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
	{
 | 
			
		||||
	BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
	out = BIO_push(tmpbio, out);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	badopt = 0, opt_done = 0;
 | 
			
		||||
	i = 0;
 | 
			
		||||
@@ -276,7 +282,7 @@ err:
 | 
			
		||||
	if (in)
 | 
			
		||||
		BIO_free(in);
 | 
			
		||||
	if (out)
 | 
			
		||||
		BIO_free(out);
 | 
			
		||||
		BIO_free_all(out);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -373,8 +373,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    CRYPTO_push_info("write files");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (!outfile) out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
    else out = BIO_new_file(outfile, "wb");
 | 
			
		||||
    if (!outfile) {
 | 
			
		||||
	out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
	{
 | 
			
		||||
	    BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
	    out = BIO_push(tmpbio, out);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
    } else out = BIO_new_file(outfile, "wb");
 | 
			
		||||
    if (!out) {
 | 
			
		||||
	BIO_printf(bio_err, "Error opening output file %s\n",
 | 
			
		||||
						outfile ? outfile : "<stdout>");
 | 
			
		||||
@@ -680,7 +687,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    CRYPTO_remove_all_info();
 | 
			
		||||
#endif
 | 
			
		||||
    BIO_free(in);
 | 
			
		||||
    BIO_free(out);
 | 
			
		||||
    BIO_free_all(out);
 | 
			
		||||
    if (canames) sk_free(canames);
 | 
			
		||||
    if(passin) OPENSSL_free(passin);
 | 
			
		||||
    if(passout) OPENSSL_free(passout);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								apps/pkcs7.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								apps/pkcs7.c
									
									
									
									
									
								
							@@ -223,7 +223,15 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -307,6 +315,6 @@ bad:
 | 
			
		||||
end:
 | 
			
		||||
	if (p7 != NULL) PKCS7_free(p7);
 | 
			
		||||
	if (in != NULL) BIO_free(in);
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								apps/pkcs8.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								apps/pkcs8.c
									
									
									
									
									
								
							@@ -224,8 +224,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				 "Can't open output file %s\n", outfile);
 | 
			
		||||
			return (1);
 | 
			
		||||
		}
 | 
			
		||||
	} else out = BIO_new_fp (stdout, BIO_NOCLOSE);
 | 
			
		||||
 | 
			
		||||
	} else {
 | 
			
		||||
		out = BIO_new_fp (stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
			BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
	if (topk8) {
 | 
			
		||||
		if(informat == FORMAT_PEM)
 | 
			
		||||
			pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, passin);
 | 
			
		||||
@@ -283,7 +290,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		}
 | 
			
		||||
		PKCS8_PRIV_KEY_INFO_free (p8inf);
 | 
			
		||||
		EVP_PKEY_free(pkey);
 | 
			
		||||
		BIO_free(out);
 | 
			
		||||
		BIO_free_all(out);
 | 
			
		||||
		if(passin) OPENSSL_free(passin);
 | 
			
		||||
		if(passout) OPENSSL_free(passout);
 | 
			
		||||
		return (0);
 | 
			
		||||
@@ -366,7 +373,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	EVP_PKEY_free(pkey);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	BIO_free(in);
 | 
			
		||||
	if(passin) OPENSSL_free(passin);
 | 
			
		||||
	if(passout) OPENSSL_free(passout);
 | 
			
		||||
 
 | 
			
		||||
@@ -130,7 +130,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	if (outfile != NULL)
 | 
			
		||||
		r = BIO_write_filename(out, outfile);
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		r = BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	if (r <= 0)
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								apps/req.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								apps/req.c
									
									
									
									
									
								
							@@ -649,6 +649,12 @@ bad:
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"writing new private key to stdout\n");
 | 
			
		||||
			BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
			{
 | 
			
		||||
			BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			out = BIO_push(tmpbio, out);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
@@ -844,7 +850,15 @@ loop:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if ((keyout != NULL) && (strcmp(outfile,keyout) == 0))
 | 
			
		||||
@@ -930,7 +944,7 @@ end:
 | 
			
		||||
		}
 | 
			
		||||
	if ((req_conf != NULL) && (req_conf != config)) CONF_free(req_conf);
 | 
			
		||||
	BIO_free(in);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	EVP_PKEY_free(pkey);
 | 
			
		||||
	X509_REQ_free(req);
 | 
			
		||||
	X509_free(x509ss);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								apps/rsa.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								apps/rsa.c
									
									
									
									
									
								
							@@ -305,7 +305,15 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -404,7 +412,7 @@ bad:
 | 
			
		||||
		ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if(in != NULL) BIO_free(in);
 | 
			
		||||
	if(out != NULL) BIO_free(out);
 | 
			
		||||
	if(out != NULL) BIO_free_all(out);
 | 
			
		||||
	if(rsa != NULL) RSA_free(rsa);
 | 
			
		||||
	if(passin) OPENSSL_free(passin);
 | 
			
		||||
	if(passout) OPENSSL_free(passout);
 | 
			
		||||
 
 | 
			
		||||
@@ -222,7 +222,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			ERR_print_errors(bio_err);	
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
	} else out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
	} else {
 | 
			
		||||
		out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		    BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		    out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	keysize = RSA_size(rsa);
 | 
			
		||||
 | 
			
		||||
@@ -279,7 +287,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	end:
 | 
			
		||||
	RSA_free(rsa);
 | 
			
		||||
	BIO_free(in);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	if(rsa_in) OPENSSL_free(rsa_in);
 | 
			
		||||
	if(rsa_out) OPENSSL_free(rsa_out);
 | 
			
		||||
	return ret;
 | 
			
		||||
 
 | 
			
		||||
@@ -206,7 +206,15 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (outfile == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
			{
 | 
			
		||||
			BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			out = BIO_push(tmpbio, out);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -262,7 +270,7 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
	ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if (out != NULL) BIO_free(out);
 | 
			
		||||
	if (out != NULL) BIO_free_all(out);
 | 
			
		||||
	if (x != NULL) SSL_SESSION_free(x);
 | 
			
		||||
	EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								apps/smime.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								apps/smime.c
									
									
									
									
									
								
							@@ -420,7 +420,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				 "Can't open output file %s\n", outfile);
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
	} else out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
	} else {
 | 
			
		||||
		out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		    BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		    out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if(operation == SMIME_VERIFY) {
 | 
			
		||||
		if(!(store = setup_verify(CAfile, CApath))) goto end;
 | 
			
		||||
@@ -517,7 +525,7 @@ end:
 | 
			
		||||
	PKCS7_free(p7);
 | 
			
		||||
	BIO_free(in);
 | 
			
		||||
	BIO_free(indata);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	if(passin) OPENSSL_free(passin);
 | 
			
		||||
	return (ret);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										22
									
								
								apps/spkac.c
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								apps/spkac.c
									
									
									
									
									
								
							@@ -219,7 +219,15 @@ bad:
 | 
			
		||||
		spkstr = NETSCAPE_SPKI_b64_encode(spki);
 | 
			
		||||
 | 
			
		||||
		if (outfile) out = BIO_new_file(outfile, "w");
 | 
			
		||||
		else out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
		else {
 | 
			
		||||
			out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
			{
 | 
			
		||||
			    BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			    out = BIO_push(tmpbio, out);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if(!out) {
 | 
			
		||||
			BIO_printf(bio_err, "Error opening output file\n");
 | 
			
		||||
@@ -268,7 +276,15 @@ bad:
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (outfile) out = BIO_new_file(outfile, "w");
 | 
			
		||||
	else out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
	else {
 | 
			
		||||
		out = BIO_new_fp(stdout, BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
		{
 | 
			
		||||
		    BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
		    out = BIO_push(tmpbio, out);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if(!out) {
 | 
			
		||||
		BIO_printf(bio_err, "Error opening output file\n");
 | 
			
		||||
@@ -295,7 +311,7 @@ end:
 | 
			
		||||
	CONF_free(conf);
 | 
			
		||||
	NETSCAPE_SPKI_free(spki);
 | 
			
		||||
	BIO_free(in);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	BIO_free(key);
 | 
			
		||||
	EVP_PKEY_free(pkey);
 | 
			
		||||
	if(passin) OPENSSL_free(passin);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								apps/x509.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								apps/x509.c
									
									
									
									
									
								
							@@ -187,6 +187,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	if (bio_err == NULL)
 | 
			
		||||
		bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 | 
			
		||||
	STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
	{
 | 
			
		||||
	BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
	STDout = BIO_push(tmpbio, STDout);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	informat=FORMAT_PEM;
 | 
			
		||||
	outformat=FORMAT_PEM;
 | 
			
		||||
@@ -603,7 +609,15 @@ bad:
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if (outfile == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
			{
 | 
			
		||||
			BIO *tmpbio = BIO_new(BIO_f_linebuffer());
 | 
			
		||||
			out = BIO_push(tmpbio, out);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			if (BIO_write_filename(out,outfile) <= 0)
 | 
			
		||||
@@ -960,8 +974,8 @@ end:
 | 
			
		||||
		app_RAND_write_file(NULL, bio_err);
 | 
			
		||||
	OBJ_cleanup();
 | 
			
		||||
	CONF_free(extconf);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
	BIO_free(STDout);
 | 
			
		||||
	BIO_free_all(out);
 | 
			
		||||
	BIO_free_all(STDout);
 | 
			
		||||
	X509_STORE_free(ctx);
 | 
			
		||||
	X509_REQ_free(req);
 | 
			
		||||
	X509_free(x);
 | 
			
		||||
 
 | 
			
		||||
@@ -27,11 +27,13 @@ LIBSRC= bio_lib.c bio_cb.c bio_err.c \
 | 
			
		||||
	bss_file.c bss_sock.c bss_conn.c \
 | 
			
		||||
	bf_null.c bf_buff.c b_print.c b_dump.c \
 | 
			
		||||
	b_sock.c bss_acpt.c bf_nbio.c bss_log.c bss_bio.c
 | 
			
		||||
#	bf_lbuf.c
 | 
			
		||||
LIBOBJ= bio_lib.o bio_cb.o bio_err.o \
 | 
			
		||||
	bss_mem.o bss_null.o bss_fd.o \
 | 
			
		||||
	bss_file.o bss_sock.o bss_conn.o \
 | 
			
		||||
	bf_null.o bf_buff.o b_print.o b_dump.o \
 | 
			
		||||
	b_sock.o bss_acpt.o bf_nbio.o bss_log.o bss_bio.o
 | 
			
		||||
#	bf_lbuf.o
 | 
			
		||||
 | 
			
		||||
SRC= $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -91,6 +91,7 @@ extern "C" {
 | 
			
		||||
#define BIO_TYPE_NULL_FILTER	(17|0x0200)
 | 
			
		||||
#define BIO_TYPE_BER		(18|0x0200)		/* BER -> bin filter */
 | 
			
		||||
#define BIO_TYPE_BIO		(19|0x0400)		/* (half a) BIO pair */
 | 
			
		||||
#define BIO_TYPE_LINEBUFFER	(20|0x0200)		/* filter */
 | 
			
		||||
 | 
			
		||||
#define BIO_TYPE_DESCRIPTOR	0x0100	/* socket, fd, connect or accept */
 | 
			
		||||
#define BIO_TYPE_FILTER		0x0200
 | 
			
		||||
@@ -554,6 +555,9 @@ BIO_METHOD *BIO_s_bio(void);
 | 
			
		||||
BIO_METHOD *BIO_s_null(void);
 | 
			
		||||
BIO_METHOD *BIO_f_null(void);
 | 
			
		||||
BIO_METHOD *BIO_f_buffer(void);
 | 
			
		||||
#ifdef VMS
 | 
			
		||||
BIO_METHOD *BIO_f_linebuffer(void);
 | 
			
		||||
#endif
 | 
			
		||||
BIO_METHOD *BIO_f_nbio_test(void);
 | 
			
		||||
/* BIO_METHOD *BIO_f_ber(void); */
 | 
			
		||||
 | 
			
		||||
@@ -640,6 +644,7 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
 | 
			
		||||
#define BIO_F_CONN_CTRL					 127
 | 
			
		||||
#define BIO_F_CONN_STATE				 115
 | 
			
		||||
#define BIO_F_FILE_CTRL					 116
 | 
			
		||||
#define BIO_F_LINEBUFFER_CTRL				 129
 | 
			
		||||
#define BIO_F_MEM_READ					 128
 | 
			
		||||
#define BIO_F_MEM_WRITE					 117
 | 
			
		||||
#define BIO_F_SSL_NEW					 118
 | 
			
		||||
 
 | 
			
		||||
@@ -91,6 +91,7 @@ static ERR_STRING_DATA BIO_str_functs[]=
 | 
			
		||||
{ERR_PACK(0,BIO_F_CONN_CTRL,0),	"CONN_CTRL"},
 | 
			
		||||
{ERR_PACK(0,BIO_F_CONN_STATE,0),	"CONN_STATE"},
 | 
			
		||||
{ERR_PACK(0,BIO_F_FILE_CTRL,0),	"FILE_CTRL"},
 | 
			
		||||
{ERR_PACK(0,BIO_F_LINEBUFFER_CTRL,0),	"LINEBUFFER_CTRL"},
 | 
			
		||||
{ERR_PACK(0,BIO_F_MEM_READ,0),	"MEM_READ"},
 | 
			
		||||
{ERR_PACK(0,BIO_F_MEM_WRITE,0),	"MEM_WRITE"},
 | 
			
		||||
{ERR_PACK(0,BIO_F_SSL_NEW,0),	"SSL_new"},
 | 
			
		||||
 
 | 
			
		||||
@@ -213,7 +213,8 @@ $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
 | 
			
		||||
	"bss_mem,bss_null,bss_fd,"+ -
 | 
			
		||||
	"bss_file,bss_sock,bss_conn,"+ -
 | 
			
		||||
	"bf_null,bf_buff,b_print,b_dump,"+ -
 | 
			
		||||
	"b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log"
 | 
			
		||||
	"b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log,"+ -
 | 
			
		||||
	"bf_lbuf"
 | 
			
		||||
$ LIB_STACK = "stack"
 | 
			
		||||
$ LIB_LHASH = "lhash,lh_stats"
 | 
			
		||||
$ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,rand_win"
 | 
			
		||||
 
 | 
			
		||||
@@ -138,8 +138,8 @@
 | 
			
		||||
#define SSL_CTX_set_default_passwd_cb_userdata  SSL_CTX_set_def_passwd_cb_ud
 | 
			
		||||
 | 
			
		||||
/* Hack some long ENGINE names */
 | 
			
		||||
#define ENGINE_get_default_BN_mod_exp_crt	ENGINE_get_def_BN_mod_exp_crt
 | 
			
		||||
#define ENGINE_set_default_BN_mod_exp_crt	ENGINE_set_def_BN_mod_exp_crt
 | 
			
		||||
#define ENGINE_get_default_BN_mod_exp_crt       ENGINE_get_def_BN_mod_exp_crt
 | 
			
		||||
#define ENGINE_set_default_BN_mod_exp_crt       ENGINE_set_def_BN_mod_exp_crt
 | 
			
		||||
 | 
			
		||||
#endif /* defined VMS */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										117
									
								
								util/libeay.num
									
									
									
									
									
								
							
							
						
						
									
										117
									
								
								util/libeay.num
									
									
									
									
									
								
							@@ -1869,61 +1869,62 @@ RSA_PKCS1_RSAref                        2459	EXIST:RSAREF:FUNCTION:RSA
 | 
			
		||||
X509_keyid_set1                         2460	EXIST::FUNCTION:
 | 
			
		||||
BIO_next                                2461	EXIST::FUNCTION:
 | 
			
		||||
DSO_METHOD_vms                          2462	EXIST::FUNCTION:
 | 
			
		||||
ERR_load_ENGINE_strings                 2463	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_DSA                          2464	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_finish_function              2465	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_RSA                  2466	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_BN_mod_exp                   2467	EXIST::FUNCTION:
 | 
			
		||||
DSA_get_default_openssl_method          2468	EXIST::FUNCTION:DSA
 | 
			
		||||
ENGINE_set_DH                           2469	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_BN_mod_exp_crt       2470	EXIST:!VMS:FUNCTION:
 | 
			
		||||
ENGINE_set_def_BN_mod_exp_crt           2470	EXIST:VMS:FUNCTION:
 | 
			
		||||
ENGINE_init                             2471	EXIST::FUNCTION:
 | 
			
		||||
DH_get_default_openssl_method           2472	EXIST::FUNCTION:DH
 | 
			
		||||
RSA_set_default_openssl_method          2473	EXIST::FUNCTION:RSA
 | 
			
		||||
ENGINE_finish                           2474	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_load_public_key                  2475	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_DH                           2476	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_ctrl                             2477	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_init_function                2478	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_init_function                2479	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_DSA                  2480	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_name                         2481	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_last                         2482	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_prev                         2483	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_DH                   2484	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_RSA                          2485	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default                      2486	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_RAND                         2487	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_first                        2488	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_by_id                            2489	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_finish_function              2490	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_BN_mod_exp_crt       2491	EXIST:!VMS:FUNCTION:
 | 
			
		||||
ENGINE_get_def_BN_mod_exp_crt           2491	EXIST:VMS:FUNCTION:
 | 
			
		||||
RSA_get_default_openssl_method          2492	EXIST::FUNCTION:RSA
 | 
			
		||||
ENGINE_set_RSA                          2493	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_load_private_key                 2494	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_RAND                 2495	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_BN_mod_exp                   2496	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_remove                           2497	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_free                             2498	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_BN_mod_exp_crt               2499	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_next                         2500	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_name                         2501	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_DSA                  2502	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_BN_mod_exp           2503	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_RSA                  2504	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_RAND                 2505	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_BN_mod_exp           2506	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_RAND                         2507	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_id                           2508	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_BN_mod_exp_crt               2509	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_DH                   2510	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_new                              2511	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_id                           2512	EXIST::FUNCTION:
 | 
			
		||||
DSA_set_default_openssl_method          2513	EXIST::FUNCTION:DSA
 | 
			
		||||
ENGINE_add                              2514	EXIST::FUNCTION:
 | 
			
		||||
DH_set_default_openssl_method           2515	EXIST::FUNCTION:DH
 | 
			
		||||
ENGINE_get_DSA                          2516	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_ctrl_function                2517	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_ctrl_function                2518	EXIST::FUNCTION:
 | 
			
		||||
BIO_f_linebuffer                        2463	EXIST:VMS:FUNCTION:
 | 
			
		||||
ERR_load_ENGINE_strings                 2464	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_DSA                          2465	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_finish_function              2466	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_RSA                  2467	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_BN_mod_exp                   2468	EXIST::FUNCTION:
 | 
			
		||||
DSA_get_default_openssl_method          2469	EXIST::FUNCTION:DSA
 | 
			
		||||
ENGINE_set_DH                           2470	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_BN_mod_exp_crt       2471	EXIST:!VMS:FUNCTION:
 | 
			
		||||
ENGINE_set_def_BN_mod_exp_crt           2471	EXIST:VMS:FUNCTION:
 | 
			
		||||
ENGINE_init                             2472	EXIST::FUNCTION:
 | 
			
		||||
DH_get_default_openssl_method           2473	EXIST::FUNCTION:DH
 | 
			
		||||
RSA_set_default_openssl_method          2474	EXIST::FUNCTION:RSA
 | 
			
		||||
ENGINE_finish                           2475	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_load_public_key                  2476	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_DH                           2477	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_ctrl                             2478	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_init_function                2479	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_init_function                2480	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_DSA                  2481	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_name                         2482	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_last                         2483	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_prev                         2484	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_DH                   2485	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_RSA                          2486	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default                      2487	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_RAND                         2488	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_first                        2489	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_by_id                            2490	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_finish_function              2491	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_BN_mod_exp_crt       2492	EXIST:!VMS:FUNCTION:
 | 
			
		||||
ENGINE_get_def_BN_mod_exp_crt           2492	EXIST:VMS:FUNCTION:
 | 
			
		||||
RSA_get_default_openssl_method          2493	EXIST::FUNCTION:RSA
 | 
			
		||||
ENGINE_set_RSA                          2494	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_load_private_key                 2495	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_RAND                 2496	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_BN_mod_exp                   2497	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_remove                           2498	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_free                             2499	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_BN_mod_exp_crt               2500	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_next                         2501	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_name                         2502	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_DSA                  2503	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_BN_mod_exp           2504	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_RSA                  2505	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_RAND                 2506	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_default_BN_mod_exp           2507	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_RAND                         2508	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_id                           2509	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_BN_mod_exp_crt               2510	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_default_DH                   2511	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_new                              2512	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_id                           2513	EXIST::FUNCTION:
 | 
			
		||||
DSA_set_default_openssl_method          2514	EXIST::FUNCTION:DSA
 | 
			
		||||
ENGINE_add                              2515	EXIST::FUNCTION:
 | 
			
		||||
DH_set_default_openssl_method           2516	EXIST::FUNCTION:DH
 | 
			
		||||
ENGINE_get_DSA                          2517	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_get_ctrl_function                2518	EXIST::FUNCTION:
 | 
			
		||||
ENGINE_set_ctrl_function                2519	EXIST::FUNCTION:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user