Compare commits
	
		
			128 Commits
		
	
	
		
			OpenSSL_0_
			...
			OpenSSL_0_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					957ebe98fb | ||
| 
						 | 
					9d09fc8485 | ||
| 
						 | 
					8ea4531718 | ||
| 
						 | 
					881611678e | ||
| 
						 | 
					a3dc628d86 | ||
| 
						 | 
					3c159fc1a5 | ||
| 
						 | 
					6056afd223 | ||
| 
						 | 
					54db796991 | ||
| 
						 | 
					119e912a83 | ||
| 
						 | 
					f4a4a0fdc7 | ||
| 
						 | 
					9ad765173f | ||
| 
						 | 
					c8e3c1a9b5 | ||
| 
						 | 
					ae378b769a | ||
| 
						 | 
					4de4e35459 | ||
| 
						 | 
					5537a83e56 | ||
| 
						 | 
					c850d322a6 | ||
| 
						 | 
					b8be571868 | ||
| 
						 | 
					acd43bf38c | ||
| 
						 | 
					5eaf173647 | ||
| 
						 | 
					7890b562bc | ||
| 
						 | 
					7258d33794 | ||
| 
						 | 
					263979a2a3 | ||
| 
						 | 
					2c6d83354d | ||
| 
						 | 
					a188fc01fe | ||
| 
						 | 
					1948f9e042 | ||
| 
						 | 
					f7ffc3a6c9 | ||
| 
						 | 
					4d6af5c5d2 | ||
| 
						 | 
					efed63d783 | ||
| 
						 | 
					7e351bb560 | ||
| 
						 | 
					0067580321 | ||
| 
						 | 
					82e0073624 | ||
| 
						 | 
					7e541b1a7f | ||
| 
						 | 
					2ae47ddbc2 | ||
| 
						 | 
					3e8b8b8990 | ||
| 
						 | 
					05bbbe9204 | ||
| 
						 | 
					a073129293 | ||
| 
						 | 
					93fc0e0e40 | ||
| 
						 | 
					84f1c14396 | ||
| 
						 | 
					f10986bab4 | ||
| 
						 | 
					6cb5746b65 | ||
| 
						 | 
					0061aa9f32 | ||
| 
						 | 
					3926bbcf6d | ||
| 
						 | 
					b5cee977c2 | ||
| 
						 | 
					ae3b60ba99 | ||
| 
						 | 
					d4ba6424a1 | ||
| 
						 | 
					92a97e52a0 | ||
| 
						 | 
					78dcaa0609 | ||
| 
						 | 
					65b4c34d86 | ||
| 
						 | 
					d8486c312c | ||
| 
						 | 
					8d4baaf2f0 | ||
| 
						 | 
					50fb940f05 | ||
| 
						 | 
					63e3676e68 | ||
| 
						 | 
					1dac2cae68 | ||
| 
						 | 
					d886975835 | ||
| 
						 | 
					22872a5363 | ||
| 
						 | 
					82b6b541b1 | ||
| 
						 | 
					60a989a76e | ||
| 
						 | 
					18394ed50f | ||
| 
						 | 
					3416d11926 | ||
| 
						 | 
					c1f1a03d0c | ||
| 
						 | 
					278a447ee8 | ||
| 
						 | 
					8ceee689c7 | ||
| 
						 | 
					356f164f52 | ||
| 
						 | 
					203ef9988c | ||
| 
						 | 
					9f51bdae00 | ||
| 
						 | 
					59c4f46f0f | ||
| 
						 | 
					f9ab6255e7 | ||
| 
						 | 
					a89b665b9b | ||
| 
						 | 
					a7949b8da3 | ||
| 
						 | 
					b0b4adc3af | ||
| 
						 | 
					6e19895972 | ||
| 
						 | 
					d24f1cbf35 | ||
| 
						 | 
					b8febed96a | ||
| 
						 | 
					82687bb4c3 | ||
| 
						 | 
					6506b7754a | ||
| 
						 | 
					2eb8e5e62a | ||
| 
						 | 
					c713a4c04d | ||
| 
						 | 
					0cefa0f942 | ||
| 
						 | 
					834c85ef0c | ||
| 
						 | 
					0c8c8eab58 | ||
| 
						 | 
					bc06baca76 | ||
| 
						 | 
					9eeb779e8f | ||
| 
						 | 
					fe171f9c3e | ||
| 
						 | 
					5e613d5411 | ||
| 
						 | 
					56e930eb03 | ||
| 
						 | 
					4a052f0bb9 | ||
| 
						 | 
					f34e79f27b | ||
| 
						 | 
					ef1fe9094c | ||
| 
						 | 
					c25e8ee9b3 | ||
| 
						 | 
					4525a048ec | ||
| 
						 | 
					f421a52f56 | ||
| 
						 | 
					17a79eec0c | ||
| 
						 | 
					1eda14b44f | ||
| 
						 | 
					aa9b502619 | ||
| 
						 | 
					aaf45e6464 | ||
| 
						 | 
					be83c31cdd | ||
| 
						 | 
					76a41eec2b | ||
| 
						 | 
					ab9c0ec9fc | ||
| 
						 | 
					cf6a1dea19 | ||
| 
						 | 
					ea5b3f5e62 | ||
| 
						 | 
					c3c658e1c0 | ||
| 
						 | 
					5d013b6b32 | ||
| 
						 | 
					ee91323f52 | ||
| 
						 | 
					4fae868811 | ||
| 
						 | 
					354f92d66a | ||
| 
						 | 
					c3484e0268 | ||
| 
						 | 
					6b0be9c73d | ||
| 
						 | 
					02312a91ca | ||
| 
						 | 
					744f6b648e | ||
| 
						 | 
					f1502a491e | ||
| 
						 | 
					b70871b675 | ||
| 
						 | 
					9de450b545 | ||
| 
						 | 
					cc53036744 | ||
| 
						 | 
					4610d8dc00 | ||
| 
						 | 
					5d7dfefe82 | ||
| 
						 | 
					5e8e7054f7 | ||
| 
						 | 
					9a542ea01d | ||
| 
						 | 
					1939f83709 | ||
| 
						 | 
					b7c114f044 | ||
| 
						 | 
					ede1351997 | ||
| 
						 | 
					7786ed6a64 | ||
| 
						 | 
					bdd08277b8 | ||
| 
						 | 
					2bf4faa7e4 | ||
| 
						 | 
					2e5e604b0c | ||
| 
						 | 
					ed4cd027f3 | ||
| 
						 | 
					bab19a2ac2 | ||
| 
						 | 
					582eb96d15 | ||
| 
						 | 
					2649ce1ebc | 
							
								
								
									
										25
									
								
								ACKNOWLEDGMENTS
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								ACKNOWLEDGMENTS
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
The OpenSSL project depends on volunteer efforts and financial support from
 | 
			
		||||
the end user community. That support comes in the form of donations and paid
 | 
			
		||||
sponsorships, software support contracts, paid consulting services
 | 
			
		||||
and commissioned software development.
 | 
			
		||||
 | 
			
		||||
Since all these activities support the continued development and improvement
 | 
			
		||||
of OpenSSL we consider all these clients and customers as sponsors of the
 | 
			
		||||
OpenSSL project.
 | 
			
		||||
 | 
			
		||||
We would like to identify and thank the following such sponsors for their past
 | 
			
		||||
or current significant support of the OpenSSL project:
 | 
			
		||||
 | 
			
		||||
Very significant support:
 | 
			
		||||
 | 
			
		||||
	OpenGear: www.opengear.com
 | 
			
		||||
 | 
			
		||||
Significant support:
 | 
			
		||||
 | 
			
		||||
	PSW Group: www.psw.net
 | 
			
		||||
 | 
			
		||||
Please note that we ask permission to identify sponsors and that some sponsors
 | 
			
		||||
we consider eligible for inclusion here have requested to remain anonymous.
 | 
			
		||||
 | 
			
		||||
Additional sponsorship or financial support is always welcome: for more
 | 
			
		||||
information please contact the OpenSSL Software Foundation.
 | 
			
		||||
							
								
								
									
										82
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										82
									
								
								CHANGES
									
									
									
									
									
								
							@@ -2,6 +2,88 @@
 | 
			
		||||
 OpenSSL CHANGES
 | 
			
		||||
 _______________
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8q and 0.9.8r [8 Feb 2011]
 | 
			
		||||
 | 
			
		||||
  *) Fix parsing of OCSP stapling ClientHello extension.  CVE-2011-0014
 | 
			
		||||
     [Neel Mehta, Adam Langley, Bodo Moeller (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Fix bug in string printing code: if *any* escaping is enabled we must
 | 
			
		||||
     escape the escape character (backslash) or the resulting string is
 | 
			
		||||
     ambiguous.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8p and 0.9.8q [2 Dec 2010]
 | 
			
		||||
 | 
			
		||||
  *) Disable code workaround for ancient and obsolete Netscape browsers
 | 
			
		||||
     and servers: an attacker can use it in a ciphersuite downgrade attack.
 | 
			
		||||
     Thanks to Martin Rex for discovering this bug. CVE-2010-4180
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fixed J-PAKE implementation error, originally discovered by
 | 
			
		||||
     Sebastien Martini, further info and confirmation from Stefan
 | 
			
		||||
     Arentz and Feng Hao. Note that this fix is a security fix. CVE-2010-4252
 | 
			
		||||
     [Ben Laurie]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8o and 0.9.8p [16 Nov 2010]
 | 
			
		||||
 | 
			
		||||
  *) Fix extension code to avoid race conditions which can result in a buffer
 | 
			
		||||
     overrun vulnerability: resumed sessions must not be modified as they can
 | 
			
		||||
     be shared by multiple threads. CVE-2010-3864
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix for double free bug in ssl/s3_clnt.c CVE-2010-2939
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Don't reencode certificate when calculating signature: cache and use
 | 
			
		||||
     the original encoding instead. This makes signature verification of
 | 
			
		||||
     some broken encodings work correctly.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) ec2_GF2m_simple_mul bugfix: compute correct result if the output EC_POINT
 | 
			
		||||
     is also one of the inputs.
 | 
			
		||||
     [Emilia K<>sper <emilia.kasper@esat.kuleuven.be> (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Don't repeatedly append PBE algorithms to table if they already exist.
 | 
			
		||||
     Sort table on each new add. This effectively makes the table read only
 | 
			
		||||
     after all algorithms are added and subsequent calls to PKCS12_pbe_add
 | 
			
		||||
     etc are non-op.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8n and 0.9.8o [01 Jun 2010]
 | 
			
		||||
 | 
			
		||||
  [NB: OpenSSL 0.9.8o and later 0.9.8 patch levels were released after
 | 
			
		||||
  OpenSSL 1.0.0.]
 | 
			
		||||
 | 
			
		||||
  *) Correct a typo in the CMS ASN1 module which can result in invalid memory
 | 
			
		||||
     access or freeing data twice (CVE-2010-0742)
 | 
			
		||||
     [Steve Henson, Ronald Moesbergen <intercommit@gmail.com>]
 | 
			
		||||
 | 
			
		||||
  *) Add SHA2 algorithms to SSL_library_init(). SHA2 is becoming far more
 | 
			
		||||
     common in certificates and some applications which only call
 | 
			
		||||
     SSL_library_init and not OpenSSL_add_all_algorithms() will fail.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) VMS fixes: 
 | 
			
		||||
     Reduce copying into .apps and .test in makevms.com
 | 
			
		||||
     Don't try to use blank CA certificate in CA.com
 | 
			
		||||
     Allow use of C files from original directories in maketests.com
 | 
			
		||||
     [Steven M. Schweda" <sms@antinode.info>]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8m and 0.9.8n [24 Mar 2010]
 | 
			
		||||
 | 
			
		||||
  *) When rejecting SSL/TLS records due to an incorrect version number, never
 | 
			
		||||
     update s->server with a new major version number.  As of
 | 
			
		||||
     - OpenSSL 0.9.8m if 'short' is a 16-bit type,
 | 
			
		||||
     - OpenSSL 0.9.8f if 'short' is longer than 16 bits,
 | 
			
		||||
     the previous behavior could result in a read attempt at NULL when
 | 
			
		||||
     receiving specific incorrect SSL/TLS records once record payload
 | 
			
		||||
     protection is active.  (CVE-2010-0740)
 | 
			
		||||
     [Bodo Moeller, Adam Langley <agl@chromium.org>]
 | 
			
		||||
 | 
			
		||||
  *) Fix for CVE-2010-0433 where some kerberos enabled versions of OpenSSL 
 | 
			
		||||
     could be crashed if the relevant tables were not present (e.g. chrooted).
 | 
			
		||||
     [Tomas Hoger <thoger@redhat.com>]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8l and 0.9.8m [25 Feb 2010]
 | 
			
		||||
 | 
			
		||||
  *) Always check bn_wexpend() return values for failure.  (CVE-2009-3245)
 | 
			
		||||
 
 | 
			
		||||
@@ -371,6 +371,9 @@ my %table=(
 | 
			
		||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}",
 | 
			
		||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}",
 | 
			
		||||
 | 
			
		||||
# Android: Linux but without -DTERMIO and pointers to headers and libs.
 | 
			
		||||
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### *BSD [do see comment about ${BSDthreads} above!]
 | 
			
		||||
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-x86",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
@@ -1812,11 +1815,11 @@ EOF
 | 
			
		||||
	(system $make_command.$make_targets) == 0 or exit $?
 | 
			
		||||
		if $make_targets ne "";
 | 
			
		||||
	if ( $perl =~ m@^/@) {
 | 
			
		||||
	    &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
 | 
			
		||||
	    &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
 | 
			
		||||
	    &dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
 | 
			
		||||
	} else {
 | 
			
		||||
	    # No path for Perl known ...
 | 
			
		||||
	    &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
 | 
			
		||||
	    &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";',  '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
 | 
			
		||||
	    &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
 | 
			
		||||
	}
 | 
			
		||||
	if ($depflags ne $default_depflags && !$make_depend) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										80
									
								
								FAQ
									
									
									
									
									
								
							
							
						
						
									
										80
									
								
								FAQ
									
									
									
									
									
								
							@@ -52,6 +52,9 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* Why does the OpenSSL test suite fail in sha512t on x86 CPU?
 | 
			
		||||
* Why does compiler fail to compile sha512.c?
 | 
			
		||||
* Test suite still fails, what to do?
 | 
			
		||||
* I think I've found a bug, what should I do?
 | 
			
		||||
* I'm SURE I've found a bug, how do I report it?
 | 
			
		||||
* I've found a security issue, how do I report it?
 | 
			
		||||
 | 
			
		||||
[PROG] Questions about programming with OpenSSL
 | 
			
		||||
 | 
			
		||||
@@ -70,6 +73,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* I think I've detected a memory leak, is this a bug?
 | 
			
		||||
* Why does Valgrind complain about the use of uninitialized data?
 | 
			
		||||
* Why doesn't a memory BIO work when a file does?
 | 
			
		||||
* Where are the declarations and implementations of d2i_X509() etc?
 | 
			
		||||
 | 
			
		||||
===============================================================================
 | 
			
		||||
 | 
			
		||||
@@ -78,7 +82,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* Which is the current version of OpenSSL?
 | 
			
		||||
 | 
			
		||||
The current version is available from <URL: http://www.openssl.org>.
 | 
			
		||||
OpenSSL 0.9.8m was released on Feb 25th, 2010.
 | 
			
		||||
OpenSSL 1.0.0d was released on Feb 8th, 2011.
 | 
			
		||||
 | 
			
		||||
In addition to the current stable release, you can also access daily
 | 
			
		||||
snapshots of the OpenSSL development version at <URL:
 | 
			
		||||
@@ -94,14 +98,17 @@ explains how to install this library.
 | 
			
		||||
 | 
			
		||||
OpenSSL includes a command line utility that can be used to perform a
 | 
			
		||||
variety of cryptographic functions.  It is described in the openssl(1)
 | 
			
		||||
manpage.  Documentation for developers is currently being written.  A
 | 
			
		||||
few manual pages already are available; overviews over libcrypto and
 | 
			
		||||
manpage.  Documentation for developers is currently being written. Many
 | 
			
		||||
manual pages are available; overviews over libcrypto and
 | 
			
		||||
libssl are given in the crypto(3) and ssl(3) manpages.
 | 
			
		||||
 | 
			
		||||
The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
 | 
			
		||||
different directory if you specified one as described in INSTALL).
 | 
			
		||||
In addition, you can read the most current versions at
 | 
			
		||||
<URL: http://www.openssl.org/docs/>.
 | 
			
		||||
<URL: http://www.openssl.org/docs/>. Note that the online documents refer
 | 
			
		||||
to the very latest development versions of OpenSSL and may include features
 | 
			
		||||
not present in released versions. If in doubt refer to the documentation
 | 
			
		||||
that came with the version of OpenSSL you are using.
 | 
			
		||||
 | 
			
		||||
For information on parts of libcrypto that are not yet documented, you
 | 
			
		||||
might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's
 | 
			
		||||
@@ -127,7 +134,7 @@ OpenSSL.  Information on the OpenSSL mailing lists is available from
 | 
			
		||||
* Where can I get a compiled version of OpenSSL?
 | 
			
		||||
 | 
			
		||||
You can finder pointers to binary distributions in
 | 
			
		||||
http://www.openssl.org/related/binaries.html .
 | 
			
		||||
<URL: http://www.openssl.org/related/binaries.html> .
 | 
			
		||||
 | 
			
		||||
Some applications that use OpenSSL are distributed in binary form.
 | 
			
		||||
When using such an application, you don't need to install OpenSSL
 | 
			
		||||
@@ -459,7 +466,7 @@ administrators.
 | 
			
		||||
Other projects do have other policies so you can for example extract the CA
 | 
			
		||||
bundle used by Mozilla and/or modssl as described in this article:
 | 
			
		||||
 | 
			
		||||
  http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html
 | 
			
		||||
  <URL: http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[BUILD] =======================================================================
 | 
			
		||||
@@ -501,7 +508,7 @@ when you run the test suite (using "make test").  The message returned is
 | 
			
		||||
"bc: 1 not implemented".
 | 
			
		||||
 | 
			
		||||
The best way to deal with this is to find another implementation of bc
 | 
			
		||||
and compile/install it.  GNU bc (see http://www.gnu.org/software/software.html
 | 
			
		||||
and compile/install it.  GNU bc (see <URL: http://www.gnu.org/software/software.html>
 | 
			
		||||
for download instructions) can be safely used, for example.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -512,7 +519,7 @@ that the OpenSSL bntest throws at it.  This gets triggered when you run the
 | 
			
		||||
test suite (using "make test").  The message returned is "bc: stack empty".
 | 
			
		||||
 | 
			
		||||
The best way to deal with this is to find another implementation of bc
 | 
			
		||||
and compile/install it.  GNU bc (see http://www.gnu.org/software/software.html
 | 
			
		||||
and compile/install it.  GNU bc (see <URL: http://www.gnu.org/software/software.html>
 | 
			
		||||
for download instructions) can be safely used, for example.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -705,6 +712,46 @@ never make sense, and tend to emerge when you least expect them. In order
 | 
			
		||||
to identify one, drop optimization level, e.g. by editing CFLAG line in
 | 
			
		||||
top-level Makefile, recompile and re-run the test.
 | 
			
		||||
 | 
			
		||||
* I think I've found a bug, what should I do?
 | 
			
		||||
 | 
			
		||||
If you are a new user then it is quite likely you haven't found a bug and
 | 
			
		||||
something is happening you aren't familiar with. Check this FAQ, the associated
 | 
			
		||||
documentation and the mailing lists for similar queries. If you are still
 | 
			
		||||
unsure whether it is a bug or not submit a query to the openssl-users mailing
 | 
			
		||||
list.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* I'm SURE I've found a bug, how do I report it?
 | 
			
		||||
 | 
			
		||||
Bug reports with no security implications should be sent to the request
 | 
			
		||||
tracker. This can be done by mailing the report to <rt@openssl.org> (or its
 | 
			
		||||
alias <openssl-bugs@openssl.org>), please note that messages sent to the
 | 
			
		||||
request tracker also appear in the public openssl-dev mailing list.
 | 
			
		||||
 | 
			
		||||
The report should be in plain text. Any patches should be sent as
 | 
			
		||||
plain text attachments because some mailers corrupt patches sent inline.
 | 
			
		||||
If your issue affects multiple versions of OpenSSL check any patches apply
 | 
			
		||||
cleanly and, if possible include patches to each affected version.
 | 
			
		||||
 | 
			
		||||
The report should be given a meaningful subject line briefly summarising the
 | 
			
		||||
issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful.
 | 
			
		||||
 | 
			
		||||
By sending reports to the request tracker the bug can then be given a priority
 | 
			
		||||
and assigned to the appropriate maintainer. The history of discussions can be
 | 
			
		||||
accessed and if the issue has been addressed or a reason why not. If patches
 | 
			
		||||
are only sent to openssl-dev they can be mislaid if a team member has to
 | 
			
		||||
wade through months of old messages to review the discussion.
 | 
			
		||||
 | 
			
		||||
See also <URL: http://www.openssl.org/support/rt.html>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* I've found a security issue, how do I report it?
 | 
			
		||||
 | 
			
		||||
If you think your bug has security implications then please send it to
 | 
			
		||||
openssl-security@openssl.org if you don't get a prompt reply at least 
 | 
			
		||||
acknowledging receipt then resend or mail it directly to one of the
 | 
			
		||||
more active team members (e.g. Steve).
 | 
			
		||||
 | 
			
		||||
[PROG] ========================================================================
 | 
			
		||||
 | 
			
		||||
* Is OpenSSL thread-safe?
 | 
			
		||||
@@ -717,8 +764,10 @@ file.
 | 
			
		||||
 | 
			
		||||
Multi-threaded applications must provide two callback functions to
 | 
			
		||||
OpenSSL by calling CRYPTO_set_locking_callback() and
 | 
			
		||||
CRYPTO_set_id_callback().  This is described in the threads(3)
 | 
			
		||||
manpage.
 | 
			
		||||
CRYPTO_set_id_callback(), for all versions of OpenSSL up to and
 | 
			
		||||
including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback()
 | 
			
		||||
and associated APIs are deprecated by CRYPTO_THREADID_set_callback()
 | 
			
		||||
and friends. This is described in the threads(3) manpage.
 | 
			
		||||
 | 
			
		||||
* I've compiled a program under Windows and it crashes: why?
 | 
			
		||||
 | 
			
		||||
@@ -962,4 +1011,15 @@ is needed. This must be done by calling:
 | 
			
		||||
See the manual pages for more details.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Where are the declarations and implementations of d2i_X509() etc?
 | 
			
		||||
 | 
			
		||||
These are defined and implemented by macros of the form:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 DECLARE_ASN1_FUNCTIONS(X509) and IMPLEMENT_ASN1_FUNCTIONS(X509)
 | 
			
		||||
 | 
			
		||||
The implementation passes an ASN1 "template" defining the structure into an
 | 
			
		||||
ASN1 interpreter using generalised functions such as ASN1_item_d2i().
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
===============================================================================
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							@@ -12,7 +12,7 @@
 | 
			
		||||
  ---------------
 | 
			
		||||
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2008 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1998-2011 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								NEWS
									
									
									
									
									
								
							@@ -5,6 +5,32 @@
 | 
			
		||||
  This file gives a brief overview of the major changes between each OpenSSL
 | 
			
		||||
  release. For more details please read the CHANGES file.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2011-0014
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-4180
 | 
			
		||||
      o Fix for CVE-2010-4252
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-3864.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-0742.
 | 
			
		||||
      o Various DTLS fixes.
 | 
			
		||||
      o Recognise SHA2 certificates if only SSL algorithms added.
 | 
			
		||||
      o Fix for no-rc4 compilation.
 | 
			
		||||
      o Chil ENGINE unload workaround.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n:
 | 
			
		||||
 | 
			
		||||
      o CFB cipher definition fixes.
 | 
			
		||||
      o Fix security issues CVE-2010-0740 and CVE-2010-0433.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m:
 | 
			
		||||
 | 
			
		||||
      o Cipher definition fixes.
 | 
			
		||||
@@ -159,6 +185,11 @@
 | 
			
		||||
      o Added initial support for Win64.
 | 
			
		||||
      o Added alternate pkg-config files.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m:
 | 
			
		||||
 | 
			
		||||
      o FIPS 1.1.1 module linking.
 | 
			
		||||
      o Various ciphersuite selection fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l:
 | 
			
		||||
 | 
			
		||||
      o Introduce limits to prevent malicious key DoS  (CVE-2006-2940)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								PROBLEMS
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								PROBLEMS
									
									
									
									
									
								
							@@ -36,7 +36,9 @@ may differ on your machine.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
As long as Apple doesn't fix the problem with ld, this problem building
 | 
			
		||||
OpenSSL will remain as is.
 | 
			
		||||
OpenSSL will remain as is. Well, the problem was addressed in 0.9.8f by
 | 
			
		||||
passing -Wl,-search_paths_first, but it's unknown if the flag was
 | 
			
		||||
supported from the initial MacOS X release.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Parallell make leads to errors
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								README
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 0.9.8m
 | 
			
		||||
 OpenSSL 0.9.8r
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2009 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1998-2011 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								STATUS
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								STATUS
									
									
									
									
									
								
							@@ -1,10 +1,21 @@
 | 
			
		||||
 | 
			
		||||
  OpenSSL STATUS                           Last modified at
 | 
			
		||||
  ______________                           $Date: 2010/02/25 17:18:22 $
 | 
			
		||||
  ______________                           $Date: 2011/02/08 17:10:45 $
 | 
			
		||||
 | 
			
		||||
  DEVELOPMENT STATE
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL 1.0.0:  Under development...
 | 
			
		||||
    o  OpenSSL 1.1.0:  Under development...
 | 
			
		||||
    o  OpenSSL 1.0.1:  Under development...
 | 
			
		||||
    o  OpenSSL 1.0.0d: Released on February   8nd, 2011
 | 
			
		||||
    o  OpenSSL 1.0.0c: Released on December   2nd, 2010
 | 
			
		||||
    o  OpenSSL 1.0.0b: Released on November  16th, 2010
 | 
			
		||||
    o  OpenSSL 1.0.0a: Released on June      1st,  2010
 | 
			
		||||
    o  OpenSSL 1.0.0:  Released on March     29th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8r: Released on February   8nd, 2011
 | 
			
		||||
    o  OpenSSL 0.9.8q: Released on December   2nd, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8p: Released on November  16th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8o: Released on June       1st, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8n: Released on March     24th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8m: Released on February  25th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8l: Released on November   5th, 2009
 | 
			
		||||
    o  OpenSSL 0.9.8k: Released on March     25th, 2009
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								TABLE
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								TABLE
									
									
									
									
									
								
							@@ -864,6 +864,33 @@ $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = -X64
 | 
			
		||||
 | 
			
		||||
*** android
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -mandroid -I$(ANDROID_DEV)/include -B$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = -ldl
 | 
			
		||||
$bn_ops       = BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= linux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** aux3-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O2 -DTERMIO
 | 
			
		||||
 
 | 
			
		||||
@@ -114,8 +114,8 @@ $!
 | 
			
		||||
$   IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. ""
 | 
			
		||||
$   THEN
 | 
			
		||||
$     READ '__INPUT' FILE -
 | 
			
		||||
	   /PROMT="CA certificate filename (or enter to create)"
 | 
			
		||||
$     IF F$SEARCH(FILE) .NES. ""
 | 
			
		||||
	   /PROMPT="CA certificate filename (or enter to create): "
 | 
			
		||||
$     IF (FILE .NES. "") .AND. (F$SEARCH(FILE) .NES. "")
 | 
			
		||||
$     THEN
 | 
			
		||||
$       COPY 'FILE' 'CATOP'.private'CAKEY'
 | 
			
		||||
$	RET=$STATUS
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								apps/apps.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								apps/apps.c
									
									
									
									
									
								
							@@ -351,13 +351,12 @@ void program_name(char *in, char *out, int size)
 | 
			
		||||
 | 
			
		||||
int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
 | 
			
		||||
	{
 | 
			
		||||
	int num,len,i;
 | 
			
		||||
	int num,i;
 | 
			
		||||
	char *p;
 | 
			
		||||
 | 
			
		||||
	*argc=0;
 | 
			
		||||
	*argv=NULL;
 | 
			
		||||
 | 
			
		||||
	len=strlen(buf);
 | 
			
		||||
	i=0;
 | 
			
		||||
	if (arg->count == 0)
 | 
			
		||||
		{
 | 
			
		||||
@@ -866,10 +865,17 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
 | 
			
		||||
	if (format == FORMAT_ENGINE)
 | 
			
		||||
		{
 | 
			
		||||
		if (!e)
 | 
			
		||||
			BIO_printf(bio_err,"no engine specified\n");
 | 
			
		||||
			BIO_printf(err,"no engine specified\n");
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			pkey = ENGINE_load_private_key(e, file,
 | 
			
		||||
				ui_method, &cb_data);
 | 
			
		||||
			if (!pkey) 
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(err,"cannot load %s from engine\n",key_descrip);
 | 
			
		||||
				ERR_print_errors(err);
 | 
			
		||||
				}	
 | 
			
		||||
			}
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
@@ -919,8 +925,11 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
 | 
			
		||||
		}
 | 
			
		||||
 end:
 | 
			
		||||
	if (key != NULL) BIO_free(key);
 | 
			
		||||
	if (pkey == NULL)
 | 
			
		||||
	if (pkey == NULL) 
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(err,"unable to load %s\n", key_descrip);
 | 
			
		||||
		ERR_print_errors(err);
 | 
			
		||||
		}	
 | 
			
		||||
	return(pkey);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -88,9 +88,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	DH *dh=NULL;
 | 
			
		||||
	int i,badops=0,text=0;
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
@@ -189,7 +186,7 @@ bad:
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	in=BIO_new(BIO_s_file());
 | 
			
		||||
 
 | 
			
		||||
@@ -149,9 +149,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	DH *dh=NULL;
 | 
			
		||||
	int i,badops=0,text=0;
 | 
			
		||||
#ifndef OPENSSL_NO_DSA
 | 
			
		||||
@@ -270,7 +267,7 @@ bad:
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (g && !num)
 | 
			
		||||
 
 | 
			
		||||
@@ -111,9 +111,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	DSA *dsa=NULL;
 | 
			
		||||
	int i,badops=0,text=0;
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
@@ -278,7 +275,7 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (need_rand)
 | 
			
		||||
@@ -357,12 +354,10 @@ bad:
 | 
			
		||||
	if (C)
 | 
			
		||||
		{
 | 
			
		||||
		unsigned char *data;
 | 
			
		||||
		int l,len,bits_p,bits_q,bits_g;
 | 
			
		||||
		int l,len,bits_p;
 | 
			
		||||
 | 
			
		||||
		len=BN_num_bytes(dsa->p);
 | 
			
		||||
		bits_p=BN_num_bits(dsa->p);
 | 
			
		||||
		bits_q=BN_num_bits(dsa->q);
 | 
			
		||||
		bits_g=BN_num_bits(dsa->g);
 | 
			
		||||
		data=(unsigned char *)OPENSSL_malloc(len+20);
 | 
			
		||||
		if (data == NULL)
 | 
			
		||||
			{
 | 
			
		||||
 
 | 
			
		||||
@@ -85,9 +85,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE 	*e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	int 	ret = 1;
 | 
			
		||||
	EC_KEY 	*eckey = NULL;
 | 
			
		||||
	const EC_GROUP *group;
 | 
			
		||||
@@ -254,7 +251,7 @@ bad:
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) 
 | 
			
		||||
 
 | 
			
		||||
@@ -129,9 +129,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	char	*infile = NULL, *outfile = NULL, *prog;
 | 
			
		||||
	BIO 	*in = NULL, *out = NULL;
 | 
			
		||||
	int 	informat, outformat, noout = 0, C = 0, ret = 1;
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE	*e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	char	*engine = NULL;
 | 
			
		||||
 | 
			
		||||
	BIGNUM	*ec_p = NULL, *ec_a = NULL, *ec_b = NULL,
 | 
			
		||||
@@ -340,7 +337,7 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
	setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (list_curves)
 | 
			
		||||
 
 | 
			
		||||
@@ -100,9 +100,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	static const char magic[]="Salted__";
 | 
			
		||||
	char mbuf[sizeof magic-1];
 | 
			
		||||
	char *strbuf=NULL;
 | 
			
		||||
@@ -311,7 +308,7 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (md && (dgst=EVP_get_digestbyname(md)) == NULL)
 | 
			
		||||
 
 | 
			
		||||
@@ -89,9 +89,6 @@ int MAIN(int, char **);
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	BN_GENCB cb;
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	DH *dh=NULL;
 | 
			
		||||
	int ret=1,num=DEFBITS;
 | 
			
		||||
	int g=2;
 | 
			
		||||
@@ -163,7 +160,7 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	out=BIO_new(BIO_s_file());
 | 
			
		||||
 
 | 
			
		||||
@@ -78,9 +78,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	DSA *dsa=NULL;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	char *outfile=NULL;
 | 
			
		||||
@@ -206,7 +203,7 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -89,9 +89,6 @@ int MAIN(int, char **);
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	BN_GENCB cb;
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	int i,num=DEFBITS;
 | 
			
		||||
	long l;
 | 
			
		||||
@@ -235,7 +232,7 @@ bad:
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
 
 | 
			
		||||
@@ -82,9 +82,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	PKCS7 *p7=NULL;
 | 
			
		||||
	int i,badops=0;
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
@@ -180,7 +177,7 @@ bad:
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	in=BIO_new(BIO_s_file());
 | 
			
		||||
 
 | 
			
		||||
@@ -77,9 +77,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	int i, r, ret = 1;
 | 
			
		||||
	int badopt;
 | 
			
		||||
	char *outfile = NULL;
 | 
			
		||||
@@ -178,7 +175,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        e = setup_engine(bio_err, engine, 0);
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	app_RAND_load_file(NULL, bio_err, (inrand != NULL));
 | 
			
		||||
 
 | 
			
		||||
@@ -1433,11 +1433,17 @@ start2:			for (;;)
 | 
			
		||||
 | 
			
		||||
				BIO_snprintf(buf,sizeof buf,"%s_min",type);
 | 
			
		||||
				if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
 | 
			
		||||
					{
 | 
			
		||||
					ERR_clear_error();
 | 
			
		||||
					n_min = -1;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				BIO_snprintf(buf,sizeof buf,"%s_max",type);
 | 
			
		||||
				if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
 | 
			
		||||
					{
 | 
			
		||||
					ERR_clear_error();
 | 
			
		||||
					n_max = -1;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				if (!add_attribute_object(req,
 | 
			
		||||
					v->value,def,value,nid,n_min,n_max, chtype))
 | 
			
		||||
 
 | 
			
		||||
@@ -2075,12 +2075,14 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
	{
 | 
			
		||||
	char *buf=NULL;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	int i,j,k,blank,dot;
 | 
			
		||||
	int i,j,k,dot;
 | 
			
		||||
	struct stat st_buf;
 | 
			
		||||
	SSL *con;
 | 
			
		||||
	SSL_CIPHER *c;
 | 
			
		||||
	BIO *io,*ssl_bio,*sbio;
 | 
			
		||||
#ifdef RENEG
 | 
			
		||||
	long total_bytes;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	buf=OPENSSL_malloc(bufsize);
 | 
			
		||||
	if (buf == NULL) return(0);
 | 
			
		||||
@@ -2151,7 +2153,6 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
		SSL_set_msg_callback_arg(con, bio_s_out);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	blank=0;
 | 
			
		||||
	for (;;)
 | 
			
		||||
		{
 | 
			
		||||
		if (hack)
 | 
			
		||||
@@ -2388,7 +2389,9 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
                                        BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n");
 | 
			
		||||
                                }
 | 
			
		||||
			/* send the file */
 | 
			
		||||
#ifdef RENEG
 | 
			
		||||
			total_bytes=0;
 | 
			
		||||
#endif
 | 
			
		||||
			for (;;)
 | 
			
		||||
				{
 | 
			
		||||
				i=BIO_read(file,buf,bufsize);
 | 
			
		||||
 
 | 
			
		||||
@@ -329,7 +329,7 @@ static int init_server_long(int *sock, int port, char *ip, int type)
 | 
			
		||||
	{
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	struct sockaddr_in server;
 | 
			
		||||
	int s= -1,i;
 | 
			
		||||
	int s= -1;
 | 
			
		||||
 | 
			
		||||
	if (!ssl_sock_init()) return(0);
 | 
			
		||||
 | 
			
		||||
@@ -368,7 +368,6 @@ static int init_server_long(int *sock, int port, char *ip, int type)
 | 
			
		||||
		}
 | 
			
		||||
	/* Make it 128 for linux */
 | 
			
		||||
	if (type==SOCK_STREAM && listen(s,128) == -1) goto err;
 | 
			
		||||
	i=0;
 | 
			
		||||
	*sock=s;
 | 
			
		||||
	ret=1;
 | 
			
		||||
err:
 | 
			
		||||
@@ -386,7 +385,7 @@ static int init_server(int *sock, int port, int type)
 | 
			
		||||
 | 
			
		||||
static int do_accept(int acc_sock, int *sock, char **host)
 | 
			
		||||
	{
 | 
			
		||||
	int ret,i;
 | 
			
		||||
	int ret;
 | 
			
		||||
	struct hostent *h1,*h2;
 | 
			
		||||
	static struct sockaddr_in from;
 | 
			
		||||
	int len;
 | 
			
		||||
@@ -409,6 +408,7 @@ redoit:
 | 
			
		||||
	if (ret == INVALID_SOCKET)
 | 
			
		||||
		{
 | 
			
		||||
#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
 | 
			
		||||
		int i;
 | 
			
		||||
		i=WSAGetLastError();
 | 
			
		||||
		BIO_printf(bio_err,"accept error %d\n",i);
 | 
			
		||||
#else
 | 
			
		||||
@@ -463,7 +463,6 @@ redoit:
 | 
			
		||||
			BIO_printf(bio_err,"gethostbyname failure\n");
 | 
			
		||||
			return(0);
 | 
			
		||||
			}
 | 
			
		||||
		i=0;
 | 
			
		||||
		if (h2->h_addrtype != AF_INET)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										26
									
								
								apps/speed.c
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								apps/speed.c
									
									
									
									
									
								
							@@ -254,12 +254,18 @@
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
 | 
			
		||||
# define NO_FORK 1
 | 
			
		||||
#elif HAVE_FORK
 | 
			
		||||
#ifndef HAVE_FORK
 | 
			
		||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
 | 
			
		||||
#  define HAVE_FORK 0
 | 
			
		||||
# else
 | 
			
		||||
#  define HAVE_FORK 1
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if HAVE_FORK
 | 
			
		||||
# undef NO_FORK
 | 
			
		||||
#else
 | 
			
		||||
# define NO_FORK 1
 | 
			
		||||
# define NO_FORK
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#undef BUFSIZE
 | 
			
		||||
@@ -494,9 +500,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	unsigned char *buf=NULL,*buf2=NULL;
 | 
			
		||||
	int mret=1;
 | 
			
		||||
	long count=0,save_count=0;
 | 
			
		||||
@@ -587,7 +590,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	unsigned char DES_iv[8];
 | 
			
		||||
	unsigned char iv[2*MAX_BLOCK_SIZE/8];
 | 
			
		||||
#ifndef OPENSSL_NO_DES
 | 
			
		||||
	DES_cblock *buf_as_des_cblock = NULL;
 | 
			
		||||
	static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
 | 
			
		||||
	static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
 | 
			
		||||
	static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
 | 
			
		||||
@@ -800,9 +802,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf(bio_err,"out of memory\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
#ifndef OPENSSL_NO_DES
 | 
			
		||||
	buf_as_des_cblock = (DES_cblock *)buf;
 | 
			
		||||
#endif
 | 
			
		||||
	if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err,"out of memory\n");
 | 
			
		||||
@@ -877,7 +876,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				BIO_printf(bio_err,"no engine given\n");
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
                        e = setup_engine(bio_err, *argv, 0);
 | 
			
		||||
                        setup_engine(bio_err, *argv, 0);
 | 
			
		||||
			/* j will be increased again further down.  We just
 | 
			
		||||
			   don't want speed to confuse an engine with an
 | 
			
		||||
			   algorithm, especially when none is given (which
 | 
			
		||||
@@ -1382,7 +1381,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		count*=2;
 | 
			
		||||
		Time_F(START);
 | 
			
		||||
		for (it=count; it; it--)
 | 
			
		||||
			DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock,
 | 
			
		||||
			DES_ecb_encrypt((DES_cblock *)buf,
 | 
			
		||||
				(DES_cblock *)buf,
 | 
			
		||||
				&sch,DES_ENCRYPT);
 | 
			
		||||
		d=Time_F(STOP);
 | 
			
		||||
		} while (d <3);
 | 
			
		||||
 
 | 
			
		||||
@@ -539,7 +539,6 @@ bad:
 | 
			
		||||
	if (reqfile)
 | 
			
		||||
		{
 | 
			
		||||
		EVP_PKEY *pkey;
 | 
			
		||||
		X509_CINF *ci;
 | 
			
		||||
		BIO *in;
 | 
			
		||||
 | 
			
		||||
		if (!sign_flag && !CA_flag)
 | 
			
		||||
@@ -607,7 +606,6 @@ bad:
 | 
			
		||||
		print_name(bio_err, "subject=", X509_REQ_get_subject_name(req), nmflag);
 | 
			
		||||
 | 
			
		||||
		if ((x=X509_new()) == NULL) goto end;
 | 
			
		||||
		ci=x->cert_info;
 | 
			
		||||
 | 
			
		||||
		if (sno == NULL)
 | 
			
		||||
			{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								config
									
									
									
									
									
								
							@@ -741,6 +741,10 @@ case "$GUESSOS" in
 | 
			
		||||
	OBJECT_MODE=${OBJECT_MODE:-32}
 | 
			
		||||
	if [ "$CC" = "gcc" ]; then
 | 
			
		||||
	    OUT="aix-gcc"
 | 
			
		||||
          if [ $OBJECT_MODE -eq 64 ]; then
 | 
			
		||||
            echo 'Your $OBJECT_MODE was found to be set to 64'
 | 
			
		||||
            OUT="aix64-gcc"
 | 
			
		||||
          fi
 | 
			
		||||
	elif [ $OBJECT_MODE -eq 64 ]; then
 | 
			
		||||
	    echo 'Your $OBJECT_MODE was found to be set to 64' 
 | 
			
		||||
	    OUT="aix64-cc"
 | 
			
		||||
 
 | 
			
		||||
@@ -85,9 +85,9 @@ int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
 | 
			
		||||
			A[7] ^= (unsigned char)(t & 0xff);
 | 
			
		||||
			if (t > 0xff)	
 | 
			
		||||
				{
 | 
			
		||||
				A[6] ^= (unsigned char)((t & 0xff) >> 8);
 | 
			
		||||
				A[5] ^= (unsigned char)((t & 0xff) >> 16);
 | 
			
		||||
				A[4] ^= (unsigned char)((t & 0xff) >> 24);
 | 
			
		||||
				A[6] ^= (unsigned char)((t >> 8) & 0xff);
 | 
			
		||||
				A[5] ^= (unsigned char)((t >> 16) & 0xff);
 | 
			
		||||
				A[4] ^= (unsigned char)((t >> 24) & 0xff);
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(R, B + 8, 8);
 | 
			
		||||
			}
 | 
			
		||||
@@ -119,9 +119,9 @@ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
 | 
			
		||||
			A[7] ^= (unsigned char)(t & 0xff);
 | 
			
		||||
			if (t > 0xff)	
 | 
			
		||||
				{
 | 
			
		||||
				A[6] ^= (unsigned char)((t & 0xff) >> 8);
 | 
			
		||||
				A[5] ^= (unsigned char)((t & 0xff) >> 16);
 | 
			
		||||
				A[4] ^= (unsigned char)((t & 0xff) >> 24);
 | 
			
		||||
				A[6] ^= (unsigned char)((t >> 8) & 0xff);
 | 
			
		||||
				A[5] ^= (unsigned char)((t >> 16) & 0xff);
 | 
			
		||||
				A[4] ^= (unsigned char)((t >> 24) & 0xff);
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(B + 8, R, 8);
 | 
			
		||||
			AES_decrypt(B, B, key);
 | 
			
		||||
 
 | 
			
		||||
@@ -751,7 +751,19 @@ $code.=<<___;
 | 
			
		||||
AES_set_encrypt_key:
 | 
			
		||||
	push	%rbx
 | 
			
		||||
	push	%rbp
 | 
			
		||||
	sub	\$8,%rsp
 | 
			
		||||
 | 
			
		||||
	call	_x86_64_AES_set_encrypt_key
 | 
			
		||||
 | 
			
		||||
	mov	8(%rsp),%rbp
 | 
			
		||||
	mov	16(%rsp),%rbx
 | 
			
		||||
	add	\$24,%rsp
 | 
			
		||||
	ret
 | 
			
		||||
.size	AES_set_encrypt_key,.-AES_set_encrypt_key
 | 
			
		||||
 | 
			
		||||
.type	_x86_64_AES_set_encrypt_key,\@abi-omnipotent
 | 
			
		||||
.align	16
 | 
			
		||||
_x86_64_AES_set_encrypt_key:
 | 
			
		||||
	mov	%esi,%ecx			# %ecx=bits
 | 
			
		||||
	mov	%rdi,%rsi			# %rsi=userKey
 | 
			
		||||
	mov	%rdx,%rdi			# %rdi=key
 | 
			
		||||
@@ -938,10 +950,8 @@ $code.=<<___;
 | 
			
		||||
.Lbadpointer:
 | 
			
		||||
	mov	\$-1,%rax
 | 
			
		||||
.Lexit:
 | 
			
		||||
	pop	%rbp
 | 
			
		||||
	pop	%rbx
 | 
			
		||||
	ret
 | 
			
		||||
.size	AES_set_encrypt_key,.-AES_set_encrypt_key
 | 
			
		||||
	.byte	0xf3,0xc3		# rep ret
 | 
			
		||||
.size	_x86_64_AES_set_encrypt_key,.-_x86_64_AES_set_encrypt_key
 | 
			
		||||
___
 | 
			
		||||
 | 
			
		||||
sub deckey()
 | 
			
		||||
@@ -973,15 +983,14 @@ $code.=<<___;
 | 
			
		||||
.type	AES_set_decrypt_key,\@function,3
 | 
			
		||||
.align	16
 | 
			
		||||
AES_set_decrypt_key:
 | 
			
		||||
	push	%rdx
 | 
			
		||||
	call	AES_set_encrypt_key
 | 
			
		||||
	cmp	\$0,%eax
 | 
			
		||||
	je	.Lproceed
 | 
			
		||||
	lea	24(%rsp),%rsp
 | 
			
		||||
	ret
 | 
			
		||||
.Lproceed:
 | 
			
		||||
	push	%rbx
 | 
			
		||||
	push	%rbp
 | 
			
		||||
	push	%rdx			# save key schedule
 | 
			
		||||
 | 
			
		||||
	call	_x86_64_AES_set_encrypt_key
 | 
			
		||||
	mov	(%rsp),%r8		# restore key schedule
 | 
			
		||||
	mov	%rbx,(%rsp)
 | 
			
		||||
	cmp	\$0,%eax
 | 
			
		||||
	jne	.Labort
 | 
			
		||||
 | 
			
		||||
	mov	240(%r8),%ecx		# pull number of rounds
 | 
			
		||||
	xor	%rdi,%rdi
 | 
			
		||||
@@ -1023,7 +1032,10 @@ $code.=<<___;
 | 
			
		||||
	jnz	.Lpermute
 | 
			
		||||
 | 
			
		||||
	xor	%rax,%rax
 | 
			
		||||
	pop	%rbx
 | 
			
		||||
.Labort:
 | 
			
		||||
	mov	8(%rsp),%rbp
 | 
			
		||||
	mov	16(%rsp),%rbx
 | 
			
		||||
	add	\$24,%rsp
 | 
			
		||||
	ret
 | 
			
		||||
.size	AES_set_decrypt_key,.-AES_set_decrypt_key
 | 
			
		||||
___
 | 
			
		||||
 
 | 
			
		||||
@@ -273,7 +273,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
 | 
			
		||||
	{
 | 
			
		||||
	ASN1_INTEGER *ret=NULL;
 | 
			
		||||
	const unsigned char *p;
 | 
			
		||||
	unsigned char *to,*s;
 | 
			
		||||
	unsigned char *s;
 | 
			
		||||
	long len;
 | 
			
		||||
	int inf,tag,xclass;
 | 
			
		||||
	int i;
 | 
			
		||||
@@ -308,7 +308,6 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
 | 
			
		||||
		i=ERR_R_MALLOC_FAILURE;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	to=s;
 | 
			
		||||
	ret->type=V_ASN1_INTEGER;
 | 
			
		||||
	if(len) {
 | 
			
		||||
		if ((*p == 0) && (len != 1))
 | 
			
		||||
 
 | 
			
		||||
@@ -291,12 +291,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
 | 
			
		||||
	ASN1_OBJECT *ret=NULL;
 | 
			
		||||
	const unsigned char *p;
 | 
			
		||||
	int i;
 | 
			
		||||
	/* Sanity check OID encoding: can't have 0x80 in subidentifiers, see:
 | 
			
		||||
	 * X.690 8.19.2
 | 
			
		||||
	/* Sanity check OID encoding: can't have leading 0x80 in
 | 
			
		||||
	 * subidentifiers, see: X.690 8.19.2
 | 
			
		||||
	 */
 | 
			
		||||
	for (i = 0, p = *pp + 1; i < len - 1; i++, p++)
 | 
			
		||||
		{
 | 
			
		||||
		if (*p == 0x80)
 | 
			
		||||
		if (*p == 0x80 && (!i || !(p[-1] & 0x80)))
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING);
 | 
			
		||||
			return NULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -74,6 +74,11 @@
 | 
			
		||||
 | 
			
		||||
#define CHARTYPE_BS_ESC		(ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253)
 | 
			
		||||
 | 
			
		||||
#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
 | 
			
		||||
		  ASN1_STRFLGS_ESC_QUOTE | \
 | 
			
		||||
		  ASN1_STRFLGS_ESC_CTRL | \
 | 
			
		||||
		  ASN1_STRFLGS_ESC_MSB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Three IO functions for sending data to memory, a BIO and
 | 
			
		||||
 * and a FILE pointer.
 | 
			
		||||
@@ -148,6 +153,13 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch
 | 
			
		||||
		if(!io_ch(arg, tmphex, 3)) return -1;
 | 
			
		||||
		return 3;
 | 
			
		||||
	}
 | 
			
		||||
	/* If we get this far and do any escaping at all must escape 
 | 
			
		||||
	 * the escape character itself: backslash.
 | 
			
		||||
	 */
 | 
			
		||||
	if (chtmp == '\\' && flags & ESC_FLAGS) {
 | 
			
		||||
		if(!io_ch(arg, "\\\\", 2)) return -1;
 | 
			
		||||
		return 2;
 | 
			
		||||
	}
 | 
			
		||||
	if(!io_ch(arg, &chtmp, 1)) return -1;
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
@@ -292,11 +304,6 @@ static const signed char tag2nbyte[] = {
 | 
			
		||||
	4, -1, 2		/* 28-30 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
 | 
			
		||||
		  ASN1_STRFLGS_ESC_QUOTE | \
 | 
			
		||||
		  ASN1_STRFLGS_ESC_CTRL | \
 | 
			
		||||
		  ASN1_STRFLGS_ESC_MSB)
 | 
			
		||||
 | 
			
		||||
/* This is the main function, print out an
 | 
			
		||||
 * ASN1_STRING taking note of various escape
 | 
			
		||||
 * and display options. Returns number of
 | 
			
		||||
 
 | 
			
		||||
@@ -96,7 +96,7 @@ unsigned long ASN1_STRING_get_default_mask(void)
 | 
			
		||||
 * default:   the default value, Printable, T61, BMP.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
int ASN1_STRING_set_default_mask_asc(char *p)
 | 
			
		||||
int ASN1_STRING_set_default_mask_asc(const char *p)
 | 
			
		||||
{
 | 
			
		||||
	unsigned long mask;
 | 
			
		||||
	char *end;
 | 
			
		||||
 
 | 
			
		||||
@@ -1051,7 +1051,7 @@ ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
 | 
			
		||||
ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
 | 
			
		||||
 | 
			
		||||
void ASN1_STRING_set_default_mask(unsigned long mask);
 | 
			
		||||
int ASN1_STRING_set_default_mask_asc(char *p);
 | 
			
		||||
int ASN1_STRING_set_default_mask_asc(const char *p);
 | 
			
		||||
unsigned long ASN1_STRING_get_default_mask(void);
 | 
			
		||||
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
					int inform, unsigned long mask);
 | 
			
		||||
 
 | 
			
		||||
@@ -242,7 +242,7 @@ RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
 | 
			
		||||
		 int sgckey)
 | 
			
		||||
	{
 | 
			
		||||
	RSA *ret=NULL;
 | 
			
		||||
	const unsigned char *p, *kp;
 | 
			
		||||
	const unsigned char *p;
 | 
			
		||||
	NETSCAPE_ENCRYPTED_PKEY *enckey = NULL;
 | 
			
		||||
 | 
			
		||||
	p = *pp;
 | 
			
		||||
@@ -265,7 +265,6 @@ RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
 | 
			
		||||
		ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	kp = enckey->enckey->digest->data;
 | 
			
		||||
	if (cb == NULL)
 | 
			
		||||
		cb=EVP_read_pw_string;
 | 
			
		||||
	if ((ret=d2i_RSA_NET_2(a, enckey->enckey->digest,cb, sgckey)) == NULL) goto err;
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,7 @@ int X509_CRL_print(BIO *out, X509_CRL *x)
 | 
			
		||||
	STACK_OF(X509_REVOKED) *rev;
 | 
			
		||||
	X509_REVOKED *r;
 | 
			
		||||
	long l;
 | 
			
		||||
	int i, n;
 | 
			
		||||
	int i;
 | 
			
		||||
	char *p;
 | 
			
		||||
 | 
			
		||||
	BIO_printf(out, "Certificate Revocation List (CRL):\n");
 | 
			
		||||
@@ -107,7 +107,6 @@ int X509_CRL_print(BIO *out, X509_CRL *x)
 | 
			
		||||
	else BIO_printf(out,"NONE");
 | 
			
		||||
	BIO_printf(out,"\n");
 | 
			
		||||
 | 
			
		||||
	n=X509_CRL_get_ext_count(x);
 | 
			
		||||
	X509V3_extensions_print(out, "CRL extensions",
 | 
			
		||||
						x->crl->extensions, 0, 8);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
 | 
			
		||||
	int i;
 | 
			
		||||
	int otag;
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
	ASN1_VALUE *pchval, **pchptr, *ptmpval;
 | 
			
		||||
	ASN1_VALUE **pchptr, *ptmpval;
 | 
			
		||||
	if (!pval)
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (aux && aux->asn1_cb)
 | 
			
		||||
@@ -317,7 +317,6 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		/* CHOICE type, try each possibility in turn */
 | 
			
		||||
		pchval = NULL;
 | 
			
		||||
		p = *in;
 | 
			
		||||
		for (i = 0, tt=it->templates; i < it->tcount; i++, tt++)
 | 
			
		||||
			{
 | 
			
		||||
 
 | 
			
		||||
@@ -63,7 +63,7 @@
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/x509v3.h>
 | 
			
		||||
 | 
			
		||||
ASN1_SEQUENCE(X509_CINF) = {
 | 
			
		||||
ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = {
 | 
			
		||||
	ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0),
 | 
			
		||||
	ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER),
 | 
			
		||||
	ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR),
 | 
			
		||||
@@ -74,7 +74,7 @@ ASN1_SEQUENCE(X509_CINF) = {
 | 
			
		||||
	ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1),
 | 
			
		||||
	ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2),
 | 
			
		||||
	ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3)
 | 
			
		||||
} ASN1_SEQUENCE_END(X509_CINF)
 | 
			
		||||
} ASN1_SEQUENCE_END_enc(X509_CINF, X509_CINF)
 | 
			
		||||
 | 
			
		||||
IMPLEMENT_ASN1_FUNCTIONS(X509_CINF)
 | 
			
		||||
/* X509 top level structure needs a bit of customisation */
 | 
			
		||||
 
 | 
			
		||||
@@ -659,7 +659,14 @@ again:
 | 
			
		||||
#ifdef SO_REUSEADDR
 | 
			
		||||
		err_num=get_last_socket_error();
 | 
			
		||||
		if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) &&
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
			/* Some versions of Windows define EADDRINUSE to
 | 
			
		||||
			 * a dummy value.
 | 
			
		||||
			 */
 | 
			
		||||
			(err_num == WSAEADDRINUSE))
 | 
			
		||||
#else
 | 
			
		||||
			(err_num == EADDRINUSE))
 | 
			
		||||
#endif
 | 
			
		||||
			{
 | 
			
		||||
			memcpy((char *)&client,(char *)&server,sizeof(server));
 | 
			
		||||
			if (strcmp(h,"*") == 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -125,7 +125,6 @@ static int nbiof_free(BIO *a)
 | 
			
		||||
	
 | 
			
		||||
static int nbiof_read(BIO *b, char *out, int outl)
 | 
			
		||||
	{
 | 
			
		||||
	NBIO_TEST *nt;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
#if 1
 | 
			
		||||
	int num;
 | 
			
		||||
@@ -134,7 +133,6 @@ static int nbiof_read(BIO *b, char *out, int outl)
 | 
			
		||||
 | 
			
		||||
	if (out == NULL) return(0);
 | 
			
		||||
	if (b->next_bio == NULL) return(0);
 | 
			
		||||
	nt=(NBIO_TEST *)b->ptr;
 | 
			
		||||
 | 
			
		||||
	BIO_clear_retry_flags(b);
 | 
			
		||||
#if 1
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@ int BIO_set(BIO *bio, BIO_METHOD *method)
 | 
			
		||||
 | 
			
		||||
int BIO_free(BIO *a)
 | 
			
		||||
	{
 | 
			
		||||
	int ret=0,i;
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	if (a == NULL) return(0);
 | 
			
		||||
 | 
			
		||||
@@ -133,7 +133,7 @@ int BIO_free(BIO *a)
 | 
			
		||||
	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
 | 
			
		||||
 | 
			
		||||
	if ((a->method == NULL) || (a->method->destroy == NULL)) return(1);
 | 
			
		||||
	ret=a->method->destroy(a);
 | 
			
		||||
	a->method->destroy(a);
 | 
			
		||||
	OPENSSL_free(a);
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -340,7 +340,6 @@ static int acpt_write(BIO *b, const char *in, int inl)
 | 
			
		||||
 | 
			
		||||
static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
	{
 | 
			
		||||
	BIO *dbio;
 | 
			
		||||
	int *ip;
 | 
			
		||||
	long ret=1;
 | 
			
		||||
	BIO_ACCEPT *data;
 | 
			
		||||
@@ -437,8 +436,8 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		ret=(long)data->bind_mode;
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DUP:
 | 
			
		||||
		dbio=(BIO *)ptr;
 | 
			
		||||
/*		if (data->param_port) EAY EAY
 | 
			
		||||
/*		dbio=(BIO *)ptr;
 | 
			
		||||
		if (data->param_port) EAY EAY
 | 
			
		||||
			BIO_set_port(dbio,data->param_port);
 | 
			
		||||
		if (data->param_hostname)
 | 
			
		||||
			BIO_set_hostname(dbio,data->param_hostname);
 | 
			
		||||
 
 | 
			
		||||
@@ -272,9 +272,9 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
			BIO_clear_flags(b,BIO_FLAGS_UPLINK);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef UP_fsetmode
 | 
			
		||||
#ifdef UP_fsetmod
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			UP_fsetmode(b->ptr,num&BIO_FP_TEXT?'t':'b');
 | 
			
		||||
			UP_fsetmod(b->ptr,(char)((num&BIO_FP_TEXT)?'t':'b'));
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -172,15 +172,6 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
 | 
			
		||||
	switch (cmd)
 | 
			
		||||
		{
 | 
			
		||||
	case BIO_CTRL_RESET:
 | 
			
		||||
		num=0;
 | 
			
		||||
	case BIO_C_FILE_SEEK:
 | 
			
		||||
		ret=0;
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_C_FILE_TELL:
 | 
			
		||||
	case BIO_CTRL_INFO:
 | 
			
		||||
		ret=0;
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_C_SET_FD:
 | 
			
		||||
		sock_free(b);
 | 
			
		||||
		b->num= *((int *)ptr);
 | 
			
		||||
@@ -203,10 +194,6 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
	case BIO_CTRL_SET_CLOSE:
 | 
			
		||||
		b->shutdown=(int)num;
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_PENDING:
 | 
			
		||||
	case BIO_CTRL_WPENDING:
 | 
			
		||||
		ret=0;
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DUP:
 | 
			
		||||
	case BIO_CTRL_FLUSH:
 | 
			
		||||
		ret=1;
 | 
			
		||||
 
 | 
			
		||||
@@ -2074,5 +2074,7 @@ EOF
 | 
			
		||||
	$data =~ s/^(\s*)cmplw(\s+)([^,]+),(.*)/$1cmpl$2$3,0,$4/gm;
 | 
			
		||||
	# assembler X doesn't accept li, load immediate value
 | 
			
		||||
	#$data =~ s/^(\s*)li(\s+)([^,]+),(.*)/$1addi$2$3,0,$4/gm;
 | 
			
		||||
	# assembler Y chokes on apostrophes in comments
 | 
			
		||||
	$data =~ s/'//gm;
 | 
			
		||||
	return($data);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,7 @@
 | 
			
		||||
 | 
			
		||||
#undef mul
 | 
			
		||||
#undef mul_add
 | 
			
		||||
#undef sqr
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * "m"(a), "+m"(r)	is the way to favor DirectPath <20>-code;
 | 
			
		||||
 
 | 
			
		||||
@@ -337,7 +337,10 @@ X) -> 0x%08X\n",
 | 
			
		||||
				t2 -= d1;
 | 
			
		||||
				}
 | 
			
		||||
#else /* !BN_LLONG */
 | 
			
		||||
			BN_ULONG t2l,t2h,ql,qh;
 | 
			
		||||
			BN_ULONG t2l,t2h;
 | 
			
		||||
#if !defined(BN_UMULT_LOHI) && !defined(BN_UMULT_HIGH)
 | 
			
		||||
			BN_ULONG ql,qh;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			q=bn_div_words(n0,n1,d0);
 | 
			
		||||
#ifdef BN_DEBUG_LEVITTE
 | 
			
		||||
@@ -561,7 +564,10 @@ X) -> 0x%08X\n",
 | 
			
		||||
				t2 -= d1;
 | 
			
		||||
				}
 | 
			
		||||
#else /* !BN_LLONG */
 | 
			
		||||
			BN_ULONG t2l,t2h,ql,qh;
 | 
			
		||||
			BN_ULONG t2l,t2h;
 | 
			
		||||
#if !defined(BN_UMULT_LOHI) && !defined(BN_UMULT_HIGH)
 | 
			
		||||
			BN_ULONG ql,qh;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			q=bn_div_words(n0,n1,d0);
 | 
			
		||||
#ifdef BN_DEBUG_LEVITTE
 | 
			
		||||
 
 | 
			
		||||
@@ -301,7 +301,8 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1,
 | 
			
		||||
			r_is_one = 0;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	BN_from_montgomery(rr,r,mont,ctx);
 | 
			
		||||
	if (!BN_from_montgomery(rr,r,mont,ctx))
 | 
			
		||||
		goto err;
 | 
			
		||||
	ret=1;
 | 
			
		||||
err:
 | 
			
		||||
	if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont);
 | 
			
		||||
 
 | 
			
		||||
@@ -551,7 +551,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
	     int tna, int tnb, BN_ULONG *t)
 | 
			
		||||
	{
 | 
			
		||||
	int i,j,n2=n*2;
 | 
			
		||||
	int c1,c2,neg,zero;
 | 
			
		||||
	int c1,c2,neg;
 | 
			
		||||
	BN_ULONG ln,lo,*p;
 | 
			
		||||
 | 
			
		||||
# ifdef BN_COUNT
 | 
			
		||||
@@ -567,7 +567,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
	/* r=(a[0]-a[1])*(b[1]-b[0]) */
 | 
			
		||||
	c1=bn_cmp_part_words(a,&(a[n]),tna,n-tna);
 | 
			
		||||
	c2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n);
 | 
			
		||||
	zero=neg=0;
 | 
			
		||||
	neg=0;
 | 
			
		||||
	switch (c1*3+c2)
 | 
			
		||||
		{
 | 
			
		||||
	case -4:
 | 
			
		||||
@@ -575,7 +575,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
		bn_sub_part_words(&(t[n]),b,      &(b[n]),tnb,n-tnb); /* - */
 | 
			
		||||
		break;
 | 
			
		||||
	case -3:
 | 
			
		||||
		zero=1;
 | 
			
		||||
		/* break; */
 | 
			
		||||
	case -2:
 | 
			
		||||
		bn_sub_part_words(t,      &(a[n]),a,      tna,tna-n); /* - */
 | 
			
		||||
@@ -585,7 +584,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
	case -1:
 | 
			
		||||
	case 0:
 | 
			
		||||
	case 1:
 | 
			
		||||
		zero=1;
 | 
			
		||||
		/* break; */
 | 
			
		||||
	case 2:
 | 
			
		||||
		bn_sub_part_words(t,      a,      &(a[n]),tna,n-tna); /* + */
 | 
			
		||||
@@ -593,7 +591,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
		neg=1;
 | 
			
		||||
		break;
 | 
			
		||||
	case 3:
 | 
			
		||||
		zero=1;
 | 
			
		||||
		/* break; */
 | 
			
		||||
	case 4:
 | 
			
		||||
		bn_sub_part_words(t,      a,      &(a[n]),tna,n-tna);
 | 
			
		||||
@@ -1012,7 +1009,6 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 | 
			
		||||
		{
 | 
			
		||||
		if (i >= -1 && i <= 1)
 | 
			
		||||
			{
 | 
			
		||||
			int sav_j =0;
 | 
			
		||||
			/* Find out the power of two lower or equal
 | 
			
		||||
			   to the longest of the two numbers */
 | 
			
		||||
			if (i >= 0)
 | 
			
		||||
@@ -1023,7 +1019,6 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 | 
			
		||||
				{
 | 
			
		||||
				j = BN_num_bits_word((BN_ULONG)bl);
 | 
			
		||||
				}
 | 
			
		||||
			sav_j = j;
 | 
			
		||||
			j = 1<<(j-1);
 | 
			
		||||
			assert(j <= al || j <= bl);
 | 
			
		||||
			k = j+j;
 | 
			
		||||
 
 | 
			
		||||
@@ -130,8 +130,8 @@ ASN1_NDEF_SEQUENCE(CMS_SignedData) = {
 | 
			
		||||
} ASN1_NDEF_SEQUENCE_END(CMS_SignedData)
 | 
			
		||||
 | 
			
		||||
ASN1_SEQUENCE(CMS_OriginatorInfo) = {
 | 
			
		||||
	ASN1_IMP_SET_OF_OPT(CMS_SignedData, certificates, CMS_CertificateChoices, 0),
 | 
			
		||||
	ASN1_IMP_SET_OF_OPT(CMS_SignedData, crls, CMS_RevocationInfoChoice, 1)
 | 
			
		||||
	ASN1_IMP_SET_OF_OPT(CMS_OriginatorInfo, certificates, CMS_CertificateChoices, 0),
 | 
			
		||||
	ASN1_IMP_SET_OF_OPT(CMS_OriginatorInfo, crls, CMS_RevocationInfoChoice, 1)
 | 
			
		||||
} ASN1_SEQUENCE_END(CMS_OriginatorInfo)
 | 
			
		||||
 | 
			
		||||
ASN1_NDEF_SEQUENCE(CMS_EncryptedContentInfo) = {
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
 | 
			
		||||
	{
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	if (olen < (ilen-1))
 | 
			
		||||
	if (ilen == 0 || olen < (ilen-1))
 | 
			
		||||
		{
 | 
			
		||||
		/* ZZZZZZZZZZZZZZZZZZZZZZ */
 | 
			
		||||
		return(-1);
 | 
			
		||||
@@ -59,4 +59,3 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
 | 
			
		||||
		}
 | 
			
		||||
	return(ilen-1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -213,13 +213,14 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
 | 
			
		||||
	int bufnum=0,i,ii;
 | 
			
		||||
	BUF_MEM *buff=NULL;
 | 
			
		||||
	char *s,*p,*end;
 | 
			
		||||
	int again,n;
 | 
			
		||||
	int again;
 | 
			
		||||
	long eline=0;
 | 
			
		||||
	char btmp[DECIMAL_SIZE(eline)+1];
 | 
			
		||||
	CONF_VALUE *v=NULL,*tv;
 | 
			
		||||
	CONF_VALUE *sv=NULL;
 | 
			
		||||
	char *section=NULL,*buf;
 | 
			
		||||
	STACK_OF(CONF_VALUE) *section_sk=NULL,*ts;
 | 
			
		||||
/*	STACK_OF(CONF_VALUE) *section_sk=NULL;*/
 | 
			
		||||
/*	STACK_OF(CONF_VALUE) *ts=NULL;*/
 | 
			
		||||
	char *start,*psection,*pname;
 | 
			
		||||
	void *h = (void *)(conf->data);
 | 
			
		||||
 | 
			
		||||
@@ -250,7 +251,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
 | 
			
		||||
					CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
 | 
			
		||||
/*	section_sk=(STACK_OF(CONF_VALUE) *)sv->value;*/
 | 
			
		||||
 | 
			
		||||
	bufnum=0;
 | 
			
		||||
	again=0;
 | 
			
		||||
@@ -309,7 +310,6 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
 | 
			
		||||
		buf=buff->data;
 | 
			
		||||
 | 
			
		||||
		clear_comments(conf, buf);
 | 
			
		||||
		n=strlen(buf);
 | 
			
		||||
		s=eat_ws(conf, buf);
 | 
			
		||||
		if (IS_EOF(conf,*s)) continue; /* blank line */
 | 
			
		||||
		if (*s == '[')
 | 
			
		||||
@@ -343,7 +343,7 @@ again:
 | 
			
		||||
					CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
 | 
			
		||||
/*			section_sk=(STACK_OF(CONF_VALUE) *)sv->value;*/
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
@@ -406,12 +406,12 @@ again:
 | 
			
		||||
					   CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
 | 
			
		||||
					goto err;
 | 
			
		||||
					}
 | 
			
		||||
				ts=(STACK_OF(CONF_VALUE) *)tv->value;
 | 
			
		||||
/*				ts=(STACK_OF(CONF_VALUE) *)tv->value;*/
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				tv=sv;
 | 
			
		||||
				ts=section_sk;
 | 
			
		||||
/*				ts=section_sk;*/
 | 
			
		||||
				}
 | 
			
		||||
#if 1
 | 
			
		||||
			if (_CONF_add_string(conf, tv, v) == 0)
 | 
			
		||||
@@ -465,9 +465,6 @@ err:
 | 
			
		||||
 | 
			
		||||
static void clear_comments(CONF *conf, char *p)
 | 
			
		||||
	{
 | 
			
		||||
	char *to;
 | 
			
		||||
 | 
			
		||||
	to=p;
 | 
			
		||||
	for (;;)
 | 
			
		||||
		{
 | 
			
		||||
		if (IS_FCOMMENT(conf,*p))
 | 
			
		||||
 
 | 
			
		||||
@@ -1026,7 +1026,7 @@ $     IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
 | 
			
		||||
	 THEN CC = "CC/DECC"
 | 
			
		||||
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
 | 
			
		||||
           "/NOLIST/PREFIX=ALL" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP])" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
@@ -1060,7 +1060,7 @@ $	EXIT
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
 | 
			
		||||
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
$     CCDEFS = """VAXC""," + CCDEFS
 | 
			
		||||
$!
 | 
			
		||||
@@ -1092,7 +1092,7 @@ $!
 | 
			
		||||
$!    Use GNU C...
 | 
			
		||||
$!
 | 
			
		||||
$     CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
 
 | 
			
		||||
@@ -122,10 +122,10 @@ struct desparams {
 | 
			
		||||
/*
 | 
			
		||||
 * Encrypt an arbitrary sized buffer
 | 
			
		||||
 */
 | 
			
		||||
#define	DESIOCBLOCK	_IOWR(d, 6, struct desparams)
 | 
			
		||||
#define	DESIOCBLOCK	_IOWR('d', 6, struct desparams)
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Encrypt of small amount of data, quickly
 | 
			
		||||
 */
 | 
			
		||||
#define DESIOCQUICK	_IOWR(d, 7, struct desparams) 
 | 
			
		||||
#define DESIOCQUICK	_IOWR('d', 7, struct desparams) 
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
 | 
			
		||||
	BIGNUM *r0,*W,*X,*c,*test;
 | 
			
		||||
	BIGNUM *g=NULL,*q=NULL,*p=NULL;
 | 
			
		||||
	BN_MONT_CTX *mont=NULL;
 | 
			
		||||
	int k,n=0,i,b,m=0;
 | 
			
		||||
	int k,n=0,i,m=0;
 | 
			
		||||
	int counter=0;
 | 
			
		||||
	int r=0;
 | 
			
		||||
	BN_CTX *ctx=NULL;
 | 
			
		||||
@@ -211,7 +211,6 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
 | 
			
		||||
		/* "offset = 2" */
 | 
			
		||||
 | 
			
		||||
		n=(bits-1)/160;
 | 
			
		||||
		b=(bits-1)-n*160;
 | 
			
		||||
 | 
			
		||||
		for (;;)
 | 
			
		||||
			{
 | 
			
		||||
 
 | 
			
		||||
@@ -178,7 +178,8 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
 | 
			
		||||
	if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */
 | 
			
		||||
	if (!BN_add(s, &xr, &m)) goto err;		/* s = m + xr */
 | 
			
		||||
	if (BN_cmp(s,dsa->q) > 0)
 | 
			
		||||
		BN_sub(s,s,dsa->q);
 | 
			
		||||
		if (!BN_sub(s,s,dsa->q))
 | 
			
		||||
			goto err;
 | 
			
		||||
	if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err;
 | 
			
		||||
 | 
			
		||||
	ret=DSA_SIG_new();
 | 
			
		||||
 
 | 
			
		||||
@@ -318,6 +318,7 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
	size_t i;
 | 
			
		||||
	EC_POINT *p=NULL;
 | 
			
		||||
	EC_POINT *acc = NULL;
 | 
			
		||||
 | 
			
		||||
	if (ctx == NULL)
 | 
			
		||||
		{
 | 
			
		||||
@@ -337,15 +338,16 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if ((p = EC_POINT_new(group)) == NULL) goto err;
 | 
			
		||||
	if ((acc = EC_POINT_new(group)) == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	if (!EC_POINT_set_to_infinity(group, r)) goto err;
 | 
			
		||||
	if (!EC_POINT_set_to_infinity(group, acc)) goto err;
 | 
			
		||||
 | 
			
		||||
	if (scalar)
 | 
			
		||||
		{
 | 
			
		||||
		if (!ec_GF2m_montgomery_point_multiply(group, p, scalar, group->generator, ctx)) goto err;
 | 
			
		||||
		if (BN_is_negative(scalar)) 
 | 
			
		||||
		if (BN_is_negative(scalar))
 | 
			
		||||
			if (!group->meth->invert(group, p, ctx)) goto err;
 | 
			
		||||
		if (!group->meth->add(group, r, r, p, ctx)) goto err;
 | 
			
		||||
		if (!group->meth->add(group, acc, acc, p, ctx)) goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < num; i++)
 | 
			
		||||
@@ -353,13 +355,16 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 | 
			
		||||
		if (!ec_GF2m_montgomery_point_multiply(group, p, scalars[i], points[i], ctx)) goto err;
 | 
			
		||||
		if (BN_is_negative(scalars[i]))
 | 
			
		||||
			if (!group->meth->invert(group, p, ctx)) goto err;
 | 
			
		||||
		if (!group->meth->add(group, r, r, p, ctx)) goto err;
 | 
			
		||||
		if (!group->meth->add(group, acc, acc, p, ctx)) goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!EC_POINT_copy(r, acc)) goto err;
 | 
			
		||||
 | 
			
		||||
	ret = 1;
 | 
			
		||||
 | 
			
		||||
  err:
 | 
			
		||||
	if (p) EC_POINT_free(p);
 | 
			
		||||
	if (acc) EC_POINT_free(acc);
 | 
			
		||||
	if (new_ctx != NULL)
 | 
			
		||||
		BN_CTX_free(new_ctx);
 | 
			
		||||
	return ret;
 | 
			
		||||
 
 | 
			
		||||
@@ -871,6 +871,9 @@ int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT
 | 
			
		||||
		{
 | 
			
		||||
		return EC_POINT_is_at_infinity(group, b) ? 0 : 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (EC_POINT_is_at_infinity(group, b))
 | 
			
		||||
		return 1;
 | 
			
		||||
	
 | 
			
		||||
	if (a->Z_is_one && b->Z_is_one)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -304,7 +304,13 @@ int EC_KEY_check_key(const EC_KEY *eckey)
 | 
			
		||||
		ECerr(EC_F_EC_KEY_CHECK_KEY, ERR_R_PASSED_NULL_PARAMETER);
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key))
 | 
			
		||||
		{
 | 
			
		||||
		ECerr(EC_F_EC_KEY_CHECK_KEY, EC_R_POINT_AT_INFINITY);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if ((ctx = BN_CTX_new()) == NULL)
 | 
			
		||||
		goto err;
 | 
			
		||||
	if ((point = EC_POINT_new(eckey->group)) == NULL)
 | 
			
		||||
 
 | 
			
		||||
@@ -169,11 +169,13 @@ static void ec_pre_comp_clear_free(void *pre_)
 | 
			
		||||
		EC_POINT **p;
 | 
			
		||||
 | 
			
		||||
		for (p = pre->points; *p != NULL; p++)
 | 
			
		||||
			{
 | 
			
		||||
			EC_POINT_clear_free(*p);
 | 
			
		||||
		OPENSSL_cleanse(pre->points, sizeof pre->points);
 | 
			
		||||
			OPENSSL_cleanse(p, sizeof *p);
 | 
			
		||||
			}
 | 
			
		||||
		OPENSSL_free(pre->points);
 | 
			
		||||
		}
 | 
			
		||||
	OPENSSL_cleanse(pre, sizeof pre);
 | 
			
		||||
	OPENSSL_cleanse(pre, sizeof *pre);
 | 
			
		||||
	OPENSSL_free(pre);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1406,6 +1406,9 @@ int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *
 | 
			
		||||
		{
 | 
			
		||||
		return EC_POINT_is_at_infinity(group, b) ? 0 : 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (EC_POINT_is_at_infinity(group, b))
 | 
			
		||||
		return 1;
 | 
			
		||||
	
 | 
			
		||||
	if (a->Z_is_one && b->Z_is_one)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -96,7 +96,6 @@ const ECDH_METHOD *ECDH_get_default_method(void)
 | 
			
		||||
 | 
			
		||||
int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth)
 | 
			
		||||
	{
 | 
			
		||||
	const ECDH_METHOD *mtmp;
 | 
			
		||||
	ECDH_DATA *ecdh;
 | 
			
		||||
 | 
			
		||||
	ecdh = ecdh_check(eckey);
 | 
			
		||||
@@ -104,11 +103,6 @@ int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth)
 | 
			
		||||
	if (ecdh == NULL)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
        mtmp = ecdh->meth;
 | 
			
		||||
#if 0
 | 
			
		||||
        if (mtmp->finish)
 | 
			
		||||
		mtmp->finish(eckey);
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	if (ecdh->engine)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,6 @@ const ECDSA_METHOD *ECDSA_get_default_method(void)
 | 
			
		||||
 | 
			
		||||
int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth)
 | 
			
		||||
{
 | 
			
		||||
        const ECDSA_METHOD *mtmp;
 | 
			
		||||
	ECDSA_DATA *ecdsa;
 | 
			
		||||
 | 
			
		||||
	ecdsa = ecdsa_check(eckey);
 | 
			
		||||
@@ -91,7 +90,6 @@ int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth)
 | 
			
		||||
	if (ecdsa == NULL)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
        mtmp = ecdsa->meth;
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	if (ecdsa->engine)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,7 @@ void ENGINE_load_builtin_engines(void)
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_HW
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__FreeBSD__)
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
 | 
			
		||||
	ENGINE_load_cryptodev();
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
 | 
			
		||||
 
 | 
			
		||||
@@ -755,10 +755,18 @@ cryptodev_bn_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
		goto err;
 | 
			
		||||
	kop.crk_iparams = 3;
 | 
			
		||||
 | 
			
		||||
	if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL) == -1) {
 | 
			
		||||
	if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL)) {
 | 
			
		||||
		const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
 | 
			
		||||
		printf("OCF asym process failed, Running in software\n");
 | 
			
		||||
		ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont);
 | 
			
		||||
 | 
			
		||||
	} else if (ECANCELED == kop.crk_status) {
 | 
			
		||||
		const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
 | 
			
		||||
		printf("OCF hardware operation cancelled. Running in Software\n");
 | 
			
		||||
		ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont);
 | 
			
		||||
	}
 | 
			
		||||
	/* else cryptodev operation worked ok ==> ret = 1*/
 | 
			
		||||
 | 
			
		||||
err:
 | 
			
		||||
	zapparams(&kop);
 | 
			
		||||
	return (ret);
 | 
			
		||||
@@ -801,10 +809,18 @@ cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
 | 
			
		||||
		goto err;
 | 
			
		||||
	kop.crk_iparams = 6;
 | 
			
		||||
 | 
			
		||||
	if (cryptodev_asym(&kop, BN_num_bytes(rsa->n), r0, 0, NULL) == -1) {
 | 
			
		||||
	if (cryptodev_asym(&kop, BN_num_bytes(rsa->n), r0, 0, NULL)) {
 | 
			
		||||
		const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
 | 
			
		||||
		printf("OCF asym process failed, running in Software\n");
 | 
			
		||||
		ret = (*meth->rsa_mod_exp)(r0, I, rsa, ctx);
 | 
			
		||||
 | 
			
		||||
	} else if (ECANCELED == kop.crk_status) {
 | 
			
		||||
		const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
 | 
			
		||||
		printf("OCF hardware operation cancelled. Running in Software\n");
 | 
			
		||||
		ret = (*meth->rsa_mod_exp)(r0, I, rsa, ctx);
 | 
			
		||||
	}
 | 
			
		||||
	/* else cryptodev operation worked ok ==> ret = 1*/
 | 
			
		||||
 | 
			
		||||
err:
 | 
			
		||||
	zapparams(&kop);
 | 
			
		||||
	return (ret);
 | 
			
		||||
@@ -940,7 +956,8 @@ cryptodev_dsa_verify(const unsigned char *dgst, int dlen,
 | 
			
		||||
	kop.crk_iparams = 7;
 | 
			
		||||
 | 
			
		||||
	if (cryptodev_asym(&kop, 0, NULL, 0, NULL) == 0) {
 | 
			
		||||
		dsaret = kop.crk_status;
 | 
			
		||||
/*OCF success value is 0, if not zero, change dsaret to fail*/
 | 
			
		||||
		if(0 != kop.crk_status) dsaret  = 0;
 | 
			
		||||
	} else {
 | 
			
		||||
		const DSA_METHOD *meth = DSA_OpenSSL();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -412,6 +412,7 @@ ENGINE *ENGINE_by_id(const char *id)
 | 
			
		||||
		return iterator;
 | 
			
		||||
		}
 | 
			
		||||
notfound:
 | 
			
		||||
	ENGINE_free(iterator);
 | 
			
		||||
	ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE);
 | 
			
		||||
	ERR_add_error_data(2, "id=", id);
 | 
			
		||||
	return NULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -79,14 +79,20 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
 | 
			
		||||
		ERR_error_string_n(l, buf, sizeof buf);
 | 
			
		||||
		BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
 | 
			
		||||
			file, line, (flags & ERR_TXT_STRING) ? data : "");
 | 
			
		||||
		cb(buf2, strlen(buf2), u);
 | 
			
		||||
		if (cb(buf2, strlen(buf2), u) <= 0)
 | 
			
		||||
			break; /* abort outputting the error report */
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_FP_API
 | 
			
		||||
static int print_fp(const char *str, size_t len, void *fp)
 | 
			
		||||
	{
 | 
			
		||||
	return fwrite(str, 1, len, fp);
 | 
			
		||||
	BIO bio;
 | 
			
		||||
 | 
			
		||||
	BIO_set(&bio,BIO_s_file());
 | 
			
		||||
	BIO_set_fp(&bio,fp,BIO_NOCLOSE);
 | 
			
		||||
 | 
			
		||||
	return BIO_printf(&bio, "%s", str);
 | 
			
		||||
	}
 | 
			
		||||
void ERR_print_errors_fp(FILE *fp)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@
 | 
			
		||||
 | 
			
		||||
static int b64_write(BIO *h, const char *buf, int num);
 | 
			
		||||
static int b64_read(BIO *h, char *buf, int size);
 | 
			
		||||
/*static int b64_puts(BIO *h, const char *str); */
 | 
			
		||||
static int b64_puts(BIO *h, const char *str);
 | 
			
		||||
/*static int b64_gets(BIO *h, char *str, int size); */
 | 
			
		||||
static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 | 
			
		||||
static int b64_new(BIO *h);
 | 
			
		||||
@@ -96,7 +96,7 @@ static BIO_METHOD methods_b64=
 | 
			
		||||
	BIO_TYPE_BASE64,"base64 encoding",
 | 
			
		||||
	b64_write,
 | 
			
		||||
	b64_read,
 | 
			
		||||
	NULL, /* b64_puts, */
 | 
			
		||||
	b64_puts,
 | 
			
		||||
	NULL, /* b64_gets, */
 | 
			
		||||
	b64_ctrl,
 | 
			
		||||
	b64_new,
 | 
			
		||||
@@ -127,6 +127,7 @@ static int b64_new(BIO *bi)
 | 
			
		||||
	bi->init=1;
 | 
			
		||||
	bi->ptr=(char *)ctx;
 | 
			
		||||
	bi->flags=0;
 | 
			
		||||
	bi->num = 0;
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -151,6 +152,8 @@ static int b64_read(BIO *b, char *out, int outl)
 | 
			
		||||
 | 
			
		||||
	if ((ctx == NULL) || (b->next_bio == NULL)) return(0);
 | 
			
		||||
 | 
			
		||||
	BIO_clear_retry_flags(b);
 | 
			
		||||
 | 
			
		||||
	if (ctx->encode != B64_DECODE)
 | 
			
		||||
		{
 | 
			
		||||
		ctx->encode=B64_DECODE;
 | 
			
		||||
@@ -163,6 +166,7 @@ static int b64_read(BIO *b, char *out, int outl)
 | 
			
		||||
	/* First check if there are bytes decoded/encoded */
 | 
			
		||||
	if (ctx->buf_len > 0)
 | 
			
		||||
		{
 | 
			
		||||
		OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
		i=ctx->buf_len-ctx->buf_off;
 | 
			
		||||
		if (i > outl) i=outl;
 | 
			
		||||
		OPENSSL_assert(ctx->buf_off+i < (int)sizeof(ctx->buf));
 | 
			
		||||
@@ -184,7 +188,6 @@ static int b64_read(BIO *b, char *out, int outl)
 | 
			
		||||
	ret_code=0;
 | 
			
		||||
	while (outl > 0)
 | 
			
		||||
		{
 | 
			
		||||
 | 
			
		||||
		if (ctx->cont <= 0)
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
@@ -195,7 +198,7 @@ static int b64_read(BIO *b, char *out, int outl)
 | 
			
		||||
			{
 | 
			
		||||
			ret_code=i;
 | 
			
		||||
 | 
			
		||||
			/* Should be continue next time we are called? */
 | 
			
		||||
			/* Should we continue next time we are called? */
 | 
			
		||||
			if (!BIO_should_retry(b->next_bio))
 | 
			
		||||
				{
 | 
			
		||||
				ctx->cont=i;
 | 
			
		||||
@@ -285,19 +288,27 @@ static int b64_read(BIO *b, char *out, int outl)
 | 
			
		||||
				continue;
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				ctx->tmp_len=0;
 | 
			
		||||
			}
 | 
			
		||||
		/* If buffer isn't full and we can retry then
 | 
			
		||||
		 * restart to read in more data.
 | 
			
		||||
		 */
 | 
			
		||||
		}
 | 
			
		||||
		else if ((i < B64_BLOCK_SIZE) && (ctx->cont > 0))
 | 
			
		||||
		{
 | 
			
		||||
			/* If buffer isn't full and we can retry then
 | 
			
		||||
			 * restart to read in more data.
 | 
			
		||||
			 */
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL)
 | 
			
		||||
			{
 | 
			
		||||
			int z,jj;
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
			jj=(i>>2)<<2;
 | 
			
		||||
#else
 | 
			
		||||
			jj = i & ~3; /* process per 4 */
 | 
			
		||||
#endif
 | 
			
		||||
			z=EVP_DecodeBlock((unsigned char *)ctx->buf,
 | 
			
		||||
				(unsigned char *)ctx->tmp,jj);
 | 
			
		||||
			if (jj > 2)
 | 
			
		||||
@@ -313,18 +324,15 @@ static int b64_read(BIO *b, char *out, int outl)
 | 
			
		||||
			 * number consumed */
 | 
			
		||||
			if (jj != i)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy((unsigned char *)ctx->tmp,
 | 
			
		||||
					(unsigned char *)&(ctx->tmp[jj]),i-jj);
 | 
			
		||||
				memmove(ctx->tmp, &ctx->tmp[jj], i-jj);
 | 
			
		||||
				ctx->tmp_len=i-jj;
 | 
			
		||||
				}
 | 
			
		||||
			ctx->buf_len=0;
 | 
			
		||||
			if (z > 0)
 | 
			
		||||
				{
 | 
			
		||||
				ctx->buf_len=z;
 | 
			
		||||
				i=1;
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				i=z;
 | 
			
		||||
			i=z;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
@@ -357,14 +365,16 @@ static int b64_read(BIO *b, char *out, int outl)
 | 
			
		||||
		outl-=i;
 | 
			
		||||
		out+=i;
 | 
			
		||||
		}
 | 
			
		||||
	BIO_clear_retry_flags(b);
 | 
			
		||||
	/* BIO_clear_retry_flags(b); */
 | 
			
		||||
	BIO_copy_next_retry(b);
 | 
			
		||||
	return((ret == 0)?ret_code:ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int b64_write(BIO *b, const char *in, int inl)
 | 
			
		||||
	{
 | 
			
		||||
	int ret=inl,n,i;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	int n;
 | 
			
		||||
	int i;
 | 
			
		||||
	BIO_B64_CTX *ctx;
 | 
			
		||||
 | 
			
		||||
	ctx=(BIO_B64_CTX *)b->ptr;
 | 
			
		||||
@@ -379,6 +389,9 @@ static int b64_write(BIO *b, const char *in, int inl)
 | 
			
		||||
		EVP_EncodeInit(&(ctx->base64));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	OPENSSL_assert(ctx->buf_off < (int)sizeof(ctx->buf));
 | 
			
		||||
	OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
 | 
			
		||||
	OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
	n=ctx->buf_len-ctx->buf_off;
 | 
			
		||||
	while (n > 0)
 | 
			
		||||
		{
 | 
			
		||||
@@ -388,7 +401,10 @@ static int b64_write(BIO *b, const char *in, int inl)
 | 
			
		||||
			BIO_copy_next_retry(b);
 | 
			
		||||
			return(i);
 | 
			
		||||
			}
 | 
			
		||||
		OPENSSL_assert(i <= n);
 | 
			
		||||
		ctx->buf_off+=i;
 | 
			
		||||
		OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
 | 
			
		||||
		OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
		n-=i;
 | 
			
		||||
		}
 | 
			
		||||
	/* at this point all pending data has been written */
 | 
			
		||||
@@ -405,18 +421,19 @@ static int b64_write(BIO *b, const char *in, int inl)
 | 
			
		||||
			{
 | 
			
		||||
			if (ctx->tmp_len > 0)
 | 
			
		||||
				{
 | 
			
		||||
				OPENSSL_assert(ctx->tmp_len <= 3);
 | 
			
		||||
				n=3-ctx->tmp_len;
 | 
			
		||||
				/* There's a teoretical possibility for this */
 | 
			
		||||
				/* There's a theoretical possibility for this */
 | 
			
		||||
				if (n > inl) 
 | 
			
		||||
					n=inl;
 | 
			
		||||
				memcpy(&(ctx->tmp[ctx->tmp_len]),in,n);
 | 
			
		||||
				ctx->tmp_len+=n;
 | 
			
		||||
				ret += n;
 | 
			
		||||
				if (ctx->tmp_len < 3)
 | 
			
		||||
					break;
 | 
			
		||||
				ctx->buf_len=EVP_EncodeBlock(
 | 
			
		||||
					(unsigned char *)ctx->buf,
 | 
			
		||||
					(unsigned char *)ctx->tmp,
 | 
			
		||||
					ctx->tmp_len);
 | 
			
		||||
				ctx->buf_len=EVP_EncodeBlock((unsigned char *)ctx->buf,(unsigned char *)ctx->tmp,ctx->tmp_len);
 | 
			
		||||
				OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
 | 
			
		||||
				OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
				/* Since we're now done using the temporary
 | 
			
		||||
				   buffer, the length should be 0'd */
 | 
			
		||||
				ctx->tmp_len=0;
 | 
			
		||||
@@ -425,14 +442,16 @@ static int b64_write(BIO *b, const char *in, int inl)
 | 
			
		||||
				{
 | 
			
		||||
				if (n < 3)
 | 
			
		||||
					{
 | 
			
		||||
					memcpy(&(ctx->tmp[0]),in,n);
 | 
			
		||||
					memcpy(ctx->tmp,in,n);
 | 
			
		||||
					ctx->tmp_len=n;
 | 
			
		||||
					ret += n;
 | 
			
		||||
					break;
 | 
			
		||||
					}
 | 
			
		||||
				n-=n%3;
 | 
			
		||||
				ctx->buf_len=EVP_EncodeBlock(
 | 
			
		||||
					(unsigned char *)ctx->buf,
 | 
			
		||||
					(unsigned char *)in,n);
 | 
			
		||||
				ctx->buf_len=EVP_EncodeBlock((unsigned char *)ctx->buf,(const unsigned char *)in,n);
 | 
			
		||||
				OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
 | 
			
		||||
				OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
				ret += n;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
@@ -440,6 +459,9 @@ static int b64_write(BIO *b, const char *in, int inl)
 | 
			
		||||
			EVP_EncodeUpdate(&(ctx->base64),
 | 
			
		||||
				(unsigned char *)ctx->buf,&ctx->buf_len,
 | 
			
		||||
				(unsigned char *)in,n);
 | 
			
		||||
			OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
 | 
			
		||||
			OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
			ret += n;
 | 
			
		||||
			}
 | 
			
		||||
		inl-=n;
 | 
			
		||||
		in+=n;
 | 
			
		||||
@@ -454,8 +476,11 @@ static int b64_write(BIO *b, const char *in, int inl)
 | 
			
		||||
				BIO_copy_next_retry(b);
 | 
			
		||||
				return((ret == 0)?i:ret);
 | 
			
		||||
				}
 | 
			
		||||
			OPENSSL_assert(i <= n);
 | 
			
		||||
			n-=i;
 | 
			
		||||
			ctx->buf_off+=i;
 | 
			
		||||
			OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
 | 
			
		||||
			OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
			}
 | 
			
		||||
		ctx->buf_len=0;
 | 
			
		||||
		ctx->buf_off=0;
 | 
			
		||||
@@ -486,6 +511,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
			ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_WPENDING: /* More to write in buffer */
 | 
			
		||||
		OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
		ret=ctx->buf_len-ctx->buf_off;
 | 
			
		||||
		if ((ret == 0) && (ctx->encode != B64_NONE)
 | 
			
		||||
			&& (ctx->base64.num != 0))
 | 
			
		||||
@@ -494,6 +520,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
			ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_PENDING: /* More to read in buffer */
 | 
			
		||||
		OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
 | 
			
		||||
		ret=ctx->buf_len-ctx->buf_off;
 | 
			
		||||
		if (ret <= 0)
 | 
			
		||||
			ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
 | 
			
		||||
@@ -565,3 +592,7 @@ static long b64_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int b64_puts(BIO *b, const char *str)
 | 
			
		||||
	{
 | 
			
		||||
	return b64_write(b,str,strlen(str));
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -235,6 +235,7 @@ static int do_evp_md_engine(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
 | 
			
		||||
				{
 | 
			
		||||
				/* Same comment from evp_enc.c */
 | 
			
		||||
				EVPerr(EVP_F_DO_EVP_MD_ENGINE,EVP_R_INITIALIZATION_ERROR);
 | 
			
		||||
				ENGINE_finish(impl);
 | 
			
		||||
				return 0;
 | 
			
		||||
				}
 | 
			
		||||
			/* We'll use the ENGINE's private digest definition */
 | 
			
		||||
 
 | 
			
		||||
@@ -279,6 +279,7 @@ skip_to_init:
 | 
			
		||||
			case EVP_CIPH_OFB_MODE:
 | 
			
		||||
 | 
			
		||||
			ctx->num = 0;
 | 
			
		||||
			/* fall-through */
 | 
			
		||||
 | 
			
		||||
			case EVP_CIPH_CBC_MODE:
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -235,7 +235,7 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
 | 
			
		||||
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
 | 
			
		||||
	     const unsigned char *in, int inl)
 | 
			
		||||
	{
 | 
			
		||||
	int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl;
 | 
			
		||||
	int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,exp_nl;
 | 
			
		||||
	unsigned char *d;
 | 
			
		||||
 | 
			
		||||
	n=ctx->num;
 | 
			
		||||
@@ -319,7 +319,6 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
 | 
			
		||||
			 * lines.  We process the line and then need to
 | 
			
		||||
			 * accept the '\n' */
 | 
			
		||||
			if ((v != B64_EOF) && (n >= 64)) exp_nl=1;
 | 
			
		||||
			tmp2=v;
 | 
			
		||||
			if (n > 0)
 | 
			
		||||
				{
 | 
			
		||||
				v=EVP_DecodeBlock(out,d,n);
 | 
			
		||||
 
 | 
			
		||||
@@ -127,9 +127,9 @@ BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
 | 
			
		||||
#define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, \
 | 
			
		||||
			     iv_len, cbits, flags, init_key, cleanup, \
 | 
			
		||||
			     set_asn1, get_asn1, ctrl) \
 | 
			
		||||
BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, \
 | 
			
		||||
			(cbits + 7)/8, key_len, iv_len, \
 | 
			
		||||
		flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 | 
			
		||||
BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, 1, \
 | 
			
		||||
		  key_len, iv_len, flags, init_key, cleanup, set_asn1, \
 | 
			
		||||
		  get_asn1, ctrl)
 | 
			
		||||
 | 
			
		||||
#define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, \
 | 
			
		||||
			     iv_len, cbits, flags, init_key, cleanup, \
 | 
			
		||||
 
 | 
			
		||||
@@ -116,17 +116,50 @@ static int pbe_cmp(const char * const *a, const char * const *b)
 | 
			
		||||
int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
 | 
			
		||||
	     EVP_PBE_KEYGEN *keygen)
 | 
			
		||||
{
 | 
			
		||||
	EVP_PBE_CTL *pbe_tmp;
 | 
			
		||||
	if (!pbe_algs) pbe_algs = sk_new(pbe_cmp);
 | 
			
		||||
	if (!(pbe_tmp = (EVP_PBE_CTL*) OPENSSL_malloc (sizeof(EVP_PBE_CTL)))) {
 | 
			
		||||
		EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
	pbe_tmp->pbe_nid = nid;
 | 
			
		||||
	EVP_PBE_CTL *pbe_tmp = NULL, pbelu;
 | 
			
		||||
	int i;
 | 
			
		||||
	if (!pbe_algs)
 | 
			
		||||
		{
 | 
			
		||||
		pbe_algs = sk_new(pbe_cmp);
 | 
			
		||||
		if (!pbe_algs)
 | 
			
		||||
			{
 | 
			
		||||
			EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return 0;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		/* Check if already present */
 | 
			
		||||
		pbelu.pbe_nid = nid;
 | 
			
		||||
		i = sk_find(pbe_algs, (char *)&pbelu);
 | 
			
		||||
		if (i >= 0)
 | 
			
		||||
			{
 | 
			
		||||
			pbe_tmp = (EVP_PBE_CTL *)sk_value(pbe_algs, i);
 | 
			
		||||
			/* If everything identical leave alone */
 | 
			
		||||
			if (pbe_tmp->cipher == cipher
 | 
			
		||||
				&& pbe_tmp->md == md
 | 
			
		||||
				&& pbe_tmp->keygen == keygen)
 | 
			
		||||
				return 1;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!pbe_tmp)
 | 
			
		||||
		{
 | 
			
		||||
		pbe_tmp = OPENSSL_malloc (sizeof(EVP_PBE_CTL));
 | 
			
		||||
		if (!pbe_tmp)
 | 
			
		||||
			{
 | 
			
		||||
			EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return 0;
 | 
			
		||||
			}
 | 
			
		||||
		/* If adding a new PBE, set nid, append and sort */
 | 
			
		||||
		pbe_tmp->pbe_nid = nid;
 | 
			
		||||
		sk_push (pbe_algs, (char *)pbe_tmp);
 | 
			
		||||
		sk_sort(pbe_algs);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
	pbe_tmp->cipher = cipher;
 | 
			
		||||
	pbe_tmp->md = md;
 | 
			
		||||
	pbe_tmp->keygen = keygen;
 | 
			
		||||
	sk_push (pbe_algs, (char *)pbe_tmp);
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -90,7 +90,7 @@ int EVP_add_digest(const EVP_MD *md)
 | 
			
		||||
	r=OBJ_NAME_add(OBJ_nid2ln(md->type),OBJ_NAME_TYPE_MD_METH,(const char *)md);
 | 
			
		||||
	if (r == 0) return(0);
 | 
			
		||||
 | 
			
		||||
	if (md->type != md->pkey_type)
 | 
			
		||||
	if (md->pkey_type && md->type != md->pkey_type)
 | 
			
		||||
		{
 | 
			
		||||
		r=OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
 | 
			
		||||
			OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name);
 | 
			
		||||
 
 | 
			
		||||
@@ -81,7 +81,7 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
 | 
			
		||||
	unsigned char m[EVP_MAX_MD_SIZE];
 | 
			
		||||
	unsigned int m_len;
 | 
			
		||||
	int i,ok=0,v;
 | 
			
		||||
	MS_STATIC EVP_MD_CTX tmp_ctx;
 | 
			
		||||
	EVP_MD_CTX tmp_ctx;
 | 
			
		||||
 | 
			
		||||
	*siglen=0;
 | 
			
		||||
	for (i=0; i<4; i++)
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
 | 
			
		||||
	unsigned char m[EVP_MAX_MD_SIZE];
 | 
			
		||||
	unsigned int m_len;
 | 
			
		||||
	int i,ok=0,v;
 | 
			
		||||
	MS_STATIC EVP_MD_CTX tmp_ctx;
 | 
			
		||||
	EVP_MD_CTX tmp_ctx;
 | 
			
		||||
 | 
			
		||||
	for (i=0; i<4; i++)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -130,12 +130,9 @@ void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len)
 | 
			
		||||
 | 
			
		||||
void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len)
 | 
			
		||||
	{
 | 
			
		||||
	int j;
 | 
			
		||||
	unsigned int i;
 | 
			
		||||
	unsigned char buf[EVP_MAX_MD_SIZE];
 | 
			
		||||
 | 
			
		||||
	j=EVP_MD_block_size(ctx->md);
 | 
			
		||||
 | 
			
		||||
	EVP_DigestFinal_ex(&ctx->md_ctx,buf,&i);
 | 
			
		||||
	EVP_MD_CTX_copy_ex(&ctx->md_ctx,&ctx->o_ctx);
 | 
			
		||||
	EVP_DigestUpdate(&ctx->md_ctx,buf,i);
 | 
			
		||||
 
 | 
			
		||||
@@ -283,23 +283,53 @@ int JPAKE_STEP1_generate(JPAKE_STEP1 *send, JPAKE_CTX *ctx)
 | 
			
		||||
    return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
/* g^x is a legal value */
 | 
			
		||||
static int is_legal(const BIGNUM *gx, const JPAKE_CTX *ctx)
 | 
			
		||||
    {
 | 
			
		||||
    BIGNUM *t;
 | 
			
		||||
    int res;
 | 
			
		||||
    
 | 
			
		||||
    if(BN_is_negative(gx) || BN_is_zero(gx) || BN_cmp(gx, ctx->p.p) >= 0)
 | 
			
		||||
	return 0;
 | 
			
		||||
 | 
			
		||||
    t = BN_new();
 | 
			
		||||
    BN_mod_exp(t, gx, ctx->p.q, ctx->p.p, ctx->ctx);
 | 
			
		||||
    res = BN_is_one(t);
 | 
			
		||||
    BN_free(t);
 | 
			
		||||
 | 
			
		||||
    return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
int JPAKE_STEP1_process(JPAKE_CTX *ctx, const JPAKE_STEP1 *received)
 | 
			
		||||
    {
 | 
			
		||||
   /* verify their ZKP(xc) */
 | 
			
		||||
    if(!is_legal(received->p1.gx, ctx))
 | 
			
		||||
	{
 | 
			
		||||
	JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_G_TO_THE_X3_IS_NOT_LEGAL);
 | 
			
		||||
	return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    if(!is_legal(received->p2.gx, ctx))
 | 
			
		||||
	{
 | 
			
		||||
	JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_G_TO_THE_X4_IS_NOT_LEGAL);
 | 
			
		||||
	return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /* verify their ZKP(xc) */
 | 
			
		||||
    if(!verify_zkp(&received->p1, ctx->p.g, ctx))
 | 
			
		||||
	{
 | 
			
		||||
	JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_VERIFY_X3_FAILED);
 | 
			
		||||
	return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
   /* verify their ZKP(xd) */
 | 
			
		||||
    /* verify their ZKP(xd) */
 | 
			
		||||
    if(!verify_zkp(&received->p2, ctx->p.g, ctx))
 | 
			
		||||
	{
 | 
			
		||||
	JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_VERIFY_X4_FAILED);
 | 
			
		||||
	return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
   /* g^xd != 1 */
 | 
			
		||||
    /* g^xd != 1 */
 | 
			
		||||
    if(BN_is_one(received->p2.gx))
 | 
			
		||||
	{
 | 
			
		||||
	JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_G_TO_THE_X4_IS_ONE);
 | 
			
		||||
 
 | 
			
		||||
@@ -115,6 +115,8 @@ void ERR_load_JPAKE_strings(void);
 | 
			
		||||
#define JPAKE_F_VERIFY_ZKP				 100
 | 
			
		||||
 | 
			
		||||
/* Reason codes. */
 | 
			
		||||
#define JPAKE_R_G_TO_THE_X3_IS_NOT_LEGAL		 108
 | 
			
		||||
#define JPAKE_R_G_TO_THE_X4_IS_NOT_LEGAL		 109
 | 
			
		||||
#define JPAKE_R_G_TO_THE_X4_IS_ONE			 105
 | 
			
		||||
#define JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH		 106
 | 
			
		||||
#define JPAKE_R_HASH_OF_KEY_MISMATCH			 107
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/* crypto/jpake/jpake_err.c */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1999-2008 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1999-2010 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
@@ -80,6 +80,8 @@ static ERR_STRING_DATA JPAKE_str_functs[]=
 | 
			
		||||
 | 
			
		||||
static ERR_STRING_DATA JPAKE_str_reasons[]=
 | 
			
		||||
	{
 | 
			
		||||
{ERR_REASON(JPAKE_R_G_TO_THE_X3_IS_NOT_LEGAL),"g to the x3 is not legal"},
 | 
			
		||||
{ERR_REASON(JPAKE_R_G_TO_THE_X4_IS_NOT_LEGAL),"g to the x4 is not legal"},
 | 
			
		||||
{ERR_REASON(JPAKE_R_G_TO_THE_X4_IS_ONE)  ,"g to the x4 is one"},
 | 
			
		||||
{ERR_REASON(JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH),"hash of hash of key mismatch"},
 | 
			
		||||
{ERR_REASON(JPAKE_R_HASH_OF_KEY_MISMATCH),"hash of key mismatch"},
 | 
			
		||||
 
 | 
			
		||||
@@ -241,11 +241,11 @@
 | 
			
		||||
#ifndef PEDANTIC
 | 
			
		||||
# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 | 
			
		||||
#  if defined(__s390x__)
 | 
			
		||||
#   define HOST_c2l(c,l)	({ asm ("lrv	%0,0(%1)"		\
 | 
			
		||||
					:"=r"(l) : "r"(c));		\
 | 
			
		||||
#   define HOST_c2l(c,l)	({ asm ("lrv	%0,%1"			\
 | 
			
		||||
				   :"=d"(l) :"m"(*(const unsigned int *)(c)));\
 | 
			
		||||
				   (c)+=4; (l);				})
 | 
			
		||||
#   define HOST_l2c(l,c)	({ asm ("strv	%0,0(%1)"		\
 | 
			
		||||
					: : "r"(l),"r"(c) : "memory");	\
 | 
			
		||||
#   define HOST_l2c(l,c)	({ asm ("strv	%1,%0"			\
 | 
			
		||||
				   :"=m"(*(unsigned int *)(c)) :"d"(l));\
 | 
			
		||||
				   (c)+=4; (l);				})
 | 
			
		||||
#  endif
 | 
			
		||||
# endif
 | 
			
		||||
 
 | 
			
		||||
@@ -58,11 +58,16 @@
 | 
			
		||||
 | 
			
		||||
#include <e_os.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
 | 
			
		||||
/* Internal only functions: only ever used here */
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
extern	void int_ERR_lib_init(void);
 | 
			
		||||
# ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
extern	void int_EVP_MD_init_engine_callbacks(void );
 | 
			
		||||
extern	void int_EVP_CIPHER_init_engine_callbacks(void );
 | 
			
		||||
extern	void int_RAND_init_engine_callbacks(void );
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Perform any essential OpenSSL initialization operations.
 | 
			
		||||
 * Currently only sets FIPS callbacks
 | 
			
		||||
 
 | 
			
		||||
@@ -371,11 +371,12 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		case OHS_ASN1_HEADER:
 | 
			
		||||
		/* Now reading ASN1 header: can read at least 6 bytes which
 | 
			
		||||
		 * is more than enough for any valid ASN1 SEQUENCE header
 | 
			
		||||
		/* Now reading ASN1 header: can read at least 2 bytes which
 | 
			
		||||
		 * is enough for ASN1 SEQUENCE header and either length field
 | 
			
		||||
		 * or at least the length of the length field.
 | 
			
		||||
		 */
 | 
			
		||||
		n = BIO_get_mem_data(rctx->mem, &p);
 | 
			
		||||
		if (n < 6)
 | 
			
		||||
		if (n < 2)
 | 
			
		||||
			goto next_io;
 | 
			
		||||
 | 
			
		||||
		/* Check it is an ASN1 SEQUENCE */
 | 
			
		||||
@@ -388,6 +389,11 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx)
 | 
			
		||||
		/* Check out length field */
 | 
			
		||||
		if (*p & 0x80)
 | 
			
		||||
			{
 | 
			
		||||
			/* If MSB set on initial length octet we can now
 | 
			
		||||
			 * always read 6 octets: make sure we have them.
 | 
			
		||||
			 */
 | 
			
		||||
			if (n < 6)
 | 
			
		||||
				goto next_io;
 | 
			
		||||
			n = *p & 0x7F;
 | 
			
		||||
			/* Not NDEF or excessive length */
 | 
			
		||||
			if (!n || (n > 4))
 | 
			
		||||
 
 | 
			
		||||
@@ -182,7 +182,6 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)
 | 
			
		||||
        {
 | 
			
		||||
	int i, ret = 0;
 | 
			
		||||
	long l;
 | 
			
		||||
	unsigned char *p;
 | 
			
		||||
	OCSP_CERTID *cid = NULL;
 | 
			
		||||
	OCSP_BASICRESP *br = NULL;
 | 
			
		||||
	OCSP_RESPID *rid = NULL;
 | 
			
		||||
@@ -207,7 +206,6 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)
 | 
			
		||||
		return 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	p = ASN1_STRING_data(rb->response);
 | 
			
		||||
	i = ASN1_STRING_length(rb->response);
 | 
			
		||||
	if (!(br = OCSP_response_get1_basic(o))) goto err;
 | 
			
		||||
	rd = br->tbsResponseData;
 | 
			
		||||
@@ -275,6 +273,7 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)
 | 
			
		||||
		}
 | 
			
		||||
	if (!X509V3_extensions_print(bp, "Response Extensions",
 | 
			
		||||
					rd->responseExtensions, flags, 4))
 | 
			
		||||
							goto err;
 | 
			
		||||
	if(X509_signature_print(bp, br->signatureAlgorithm, br->signature) <= 0)
 | 
			
		||||
							goto err;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,11 +25,11 @@
 | 
			
		||||
 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
 | 
			
		||||
 *  major minor fix final patch/beta)
 | 
			
		||||
 */
 | 
			
		||||
#define OPENSSL_VERSION_NUMBER	0x009080dfL
 | 
			
		||||
#define OPENSSL_VERSION_NUMBER	0x0090812fL
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.8m-fips 25 Feb 2010"
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.8r-fips 8 Feb 2011"
 | 
			
		||||
#else
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.8m 25 Feb 2010"
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.8r 8 Feb 2011"
 | 
			
		||||
#endif
 | 
			
		||||
#define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -434,7 +434,6 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen,
 | 
			
		||||
 | 
			
		||||
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
 | 
			
		||||
	{
 | 
			
		||||
	int o;
 | 
			
		||||
	const EVP_CIPHER *enc=NULL;
 | 
			
		||||
	char *p,c;
 | 
			
		||||
	char **header_pp = &header;
 | 
			
		||||
@@ -474,7 +473,6 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
 | 
			
		||||
		header++;
 | 
			
		||||
		}
 | 
			
		||||
	*header='\0';
 | 
			
		||||
	o=OBJ_sn2nid(p);
 | 
			
		||||
	cipher->cipher=enc=EVP_get_cipherbyname(p);
 | 
			
		||||
	*header=c;
 | 
			
		||||
	header++;
 | 
			
		||||
 
 | 
			
		||||
@@ -110,6 +110,7 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
 | 
			
		||||
	unsigned char *B, *D, *I, *p, *Ai;
 | 
			
		||||
	int Slen, Plen, Ilen, Ijlen;
 | 
			
		||||
	int i, j, u, v;
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
	BIGNUM *Ij, *Bpl1;	/* These hold Ij and B + 1 */
 | 
			
		||||
	EVP_MD_CTX ctx;
 | 
			
		||||
#ifdef  DEBUG_KEYGEN
 | 
			
		||||
@@ -145,10 +146,8 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
 | 
			
		||||
	I = OPENSSL_malloc (Ilen);
 | 
			
		||||
	Ij = BN_new();
 | 
			
		||||
	Bpl1 = BN_new();
 | 
			
		||||
	if (!D || !Ai || !B || !I || !Ij || !Bpl1) {
 | 
			
		||||
		PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
	if (!D || !Ai || !B || !I || !Ij || !Bpl1)
 | 
			
		||||
		goto err;
 | 
			
		||||
	for (i = 0; i < v; i++) D[i] = id;
 | 
			
		||||
	p = I;
 | 
			
		||||
	for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen];
 | 
			
		||||
@@ -165,28 +164,22 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
 | 
			
		||||
		}
 | 
			
		||||
		memcpy (out, Ai, min (n, u));
 | 
			
		||||
		if (u >= n) {
 | 
			
		||||
			OPENSSL_free (Ai);
 | 
			
		||||
			OPENSSL_free (B);
 | 
			
		||||
			OPENSSL_free (D);
 | 
			
		||||
			OPENSSL_free (I);
 | 
			
		||||
			BN_free (Ij);
 | 
			
		||||
			BN_free (Bpl1);
 | 
			
		||||
			EVP_MD_CTX_cleanup(&ctx);
 | 
			
		||||
#ifdef DEBUG_KEYGEN
 | 
			
		||||
			fprintf(stderr, "Output KEY (length %d)\n", tmpn);
 | 
			
		||||
			h__dump(tmpout, tmpn);
 | 
			
		||||
#endif
 | 
			
		||||
			return 1;	
 | 
			
		||||
			ret = 1;
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
		n -= u;
 | 
			
		||||
		out += u;
 | 
			
		||||
		for (j = 0; j < v; j++) B[j] = Ai[j % u];
 | 
			
		||||
		/* Work out B + 1 first then can use B as tmp space */
 | 
			
		||||
		BN_bin2bn (B, v, Bpl1);
 | 
			
		||||
		BN_add_word (Bpl1, 1);
 | 
			
		||||
		if (!BN_bin2bn (B, v, Bpl1)) goto err;
 | 
			
		||||
		if (!BN_add_word (Bpl1, 1)) goto err;
 | 
			
		||||
		for (j = 0; j < Ilen ; j+=v) {
 | 
			
		||||
			BN_bin2bn (I + j, v, Ij);
 | 
			
		||||
			BN_add (Ij, Ij, Bpl1);
 | 
			
		||||
			if (!BN_bin2bn (I + j, v, Ij)) goto err;
 | 
			
		||||
			if (!BN_add (Ij, Ij, Bpl1)) goto err;
 | 
			
		||||
			BN_bn2bin (Ij, B);
 | 
			
		||||
			Ijlen = BN_num_bytes (Ij);
 | 
			
		||||
			/* If more than 2^(v*8) - 1 cut off MSB */
 | 
			
		||||
@@ -202,6 +195,19 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
 | 
			
		||||
			} else BN_bn2bin (Ij, I + j);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
err:
 | 
			
		||||
	PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
 | 
			
		||||
end:
 | 
			
		||||
	OPENSSL_free (Ai);
 | 
			
		||||
	OPENSSL_free (B);
 | 
			
		||||
	OPENSSL_free (D);
 | 
			
		||||
	OPENSSL_free (I);
 | 
			
		||||
	BN_free (Ij);
 | 
			
		||||
	BN_free (Bpl1);
 | 
			
		||||
	EVP_MD_CTX_cleanup(&ctx);
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
#ifdef DEBUG_KEYGEN
 | 
			
		||||
void h__dump (unsigned char *p, int len)
 | 
			
		||||
 
 | 
			
		||||
@@ -120,8 +120,13 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
 | 
			
		||||
			bags = PKCS12_unpack_p7data(p7);
 | 
			
		||||
		} else if (bagnid == NID_pkcs7_encrypted) {
 | 
			
		||||
			bags = PKCS12_unpack_p7encdata(p7, oldpass, -1);
 | 
			
		||||
			alg_get(p7->d.encrypted->enc_data->algorithm,
 | 
			
		||||
				&pbe_nid, &pbe_iter, &pbe_saltlen);
 | 
			
		||||
			if (!alg_get(p7->d.encrypted->enc_data->algorithm,
 | 
			
		||||
				&pbe_nid, &pbe_iter, &pbe_saltlen))
 | 
			
		||||
				{
 | 
			
		||||
				sk_PKCS12_SAFEBAG_pop_free(bags,
 | 
			
		||||
						PKCS12_SAFEBAG_free);
 | 
			
		||||
				bags = NULL;
 | 
			
		||||
				}
 | 
			
		||||
		} else continue;
 | 
			
		||||
		if (!bags) {
 | 
			
		||||
			sk_PKCS7_pop_free(asafes, PKCS7_free);
 | 
			
		||||
@@ -193,7 +198,9 @@ static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass)
 | 
			
		||||
	if(M_PKCS12_bag_type(bag) != NID_pkcs8ShroudedKeyBag) return 1;
 | 
			
		||||
 | 
			
		||||
	if (!(p8 = PKCS8_decrypt(bag->value.shkeybag, oldpass, -1))) return 0;
 | 
			
		||||
	alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter, &p8_saltlen);
 | 
			
		||||
	if (!alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter,
 | 
			
		||||
							&p8_saltlen))
 | 
			
		||||
		return 0;
 | 
			
		||||
	if(!(p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen,
 | 
			
		||||
						     p8_iter, p8))) return 0;
 | 
			
		||||
	X509_SIG_free(bag->value.shkeybag);
 | 
			
		||||
@@ -208,9 +215,11 @@ static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen)
 | 
			
		||||
 | 
			
		||||
        p = alg->parameter->value.sequence->data;
 | 
			
		||||
        pbe = d2i_PBEPARAM(NULL, &p, alg->parameter->value.sequence->length);
 | 
			
		||||
	if (!pbe)
 | 
			
		||||
		return 0;
 | 
			
		||||
        *pnid = OBJ_obj2nid(alg->algorithm);
 | 
			
		||||
	*piter = ASN1_INTEGER_get(pbe->iter);
 | 
			
		||||
	*psaltlen = pbe->salt->length;
 | 
			
		||||
        PBEPARAM_free(pbe);
 | 
			
		||||
        return 0;
 | 
			
		||||
        return 1;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -342,7 +342,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
 | 
			
		||||
	X509_ALGOR *enc_alg=NULL;
 | 
			
		||||
	STACK_OF(X509_ALGOR) *md_sk=NULL;
 | 
			
		||||
	STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL;
 | 
			
		||||
	X509_ALGOR *xalg=NULL;
 | 
			
		||||
	PKCS7_RECIP_INFO *ri=NULL;
 | 
			
		||||
 | 
			
		||||
	i=OBJ_obj2nid(p7->type);
 | 
			
		||||
@@ -365,7 +364,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
 | 
			
		||||
			PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		xalg=p7->d.signed_and_enveloped->enc_data->algorithm;
 | 
			
		||||
		break;
 | 
			
		||||
	case NID_pkcs7_enveloped:
 | 
			
		||||
		rsk=p7->d.enveloped->recipientinfo;
 | 
			
		||||
@@ -377,7 +375,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
 | 
			
		||||
			PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		xalg=p7->d.enveloped->enc_data->algorithm;
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CONTENT_TYPE);
 | 
			
		||||
 
 | 
			
		||||
@@ -558,7 +558,6 @@ X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si)
 | 
			
		||||
int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
 | 
			
		||||
	{
 | 
			
		||||
	int i;
 | 
			
		||||
	ASN1_OBJECT *objtmp;
 | 
			
		||||
	PKCS7_ENC_CONTENT *ec;
 | 
			
		||||
 | 
			
		||||
	i=OBJ_obj2nid(p7->type);
 | 
			
		||||
@@ -581,7 +580,6 @@ int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
 | 
			
		||||
		PKCS7err(PKCS7_F_PKCS7_SET_CIPHER,PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
 | 
			
		||||
		return(0);
 | 
			
		||||
	}
 | 
			
		||||
	objtmp = OBJ_nid2obj(i);
 | 
			
		||||
 | 
			
		||||
	ec->cipher = cipher;
 | 
			
		||||
	return 1;
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,6 @@ static int pk7_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
 | 
			
		||||
	{
 | 
			
		||||
	PKCS7 *p7 = (PKCS7 *)val;
 | 
			
		||||
	BIO *tmpbio, *p7bio;
 | 
			
		||||
	int r = 0;
 | 
			
		||||
 | 
			
		||||
	if (!(flags & SMIME_DETACHED))
 | 
			
		||||
		{
 | 
			
		||||
@@ -95,8 +94,6 @@ static int pk7_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
 | 
			
		||||
	if (PKCS7_dataFinal(p7, p7bio) <= 0)
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	r = 1;
 | 
			
		||||
 | 
			
		||||
	err:
 | 
			
		||||
 | 
			
		||||
	/* Now remove any digests prepended to the BIO */
 | 
			
		||||
 
 | 
			
		||||
@@ -166,14 +166,13 @@ pqueue_pop(pqueue_s *pq)
 | 
			
		||||
pitem *
 | 
			
		||||
pqueue_find(pqueue_s *pq, PQ_64BIT priority)
 | 
			
		||||
	{
 | 
			
		||||
	pitem *next, *prev = NULL;
 | 
			
		||||
	pitem *next;
 | 
			
		||||
	pitem *found = NULL;
 | 
			
		||||
 | 
			
		||||
	if ( pq->items == NULL)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	for ( next = pq->items; next->next != NULL; 
 | 
			
		||||
		  prev = next, next = next->next)
 | 
			
		||||
	for ( next = pq->items; next->next != NULL; next = next->next)
 | 
			
		||||
		{
 | 
			
		||||
		if ( pq_64bit_eq(&(next->priority), &priority))
 | 
			
		||||
			{
 | 
			
		||||
@@ -189,13 +188,6 @@ pqueue_find(pqueue_s *pq, PQ_64BIT priority)
 | 
			
		||||
	if ( ! found)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
#if 0 /* find works in peek mode */
 | 
			
		||||
	if ( prev == NULL)
 | 
			
		||||
		pq->items = next->next;
 | 
			
		||||
	else
 | 
			
		||||
		prev->next = next->next;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	return found;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -160,8 +160,8 @@ int RAND_poll(void)
 | 
			
		||||
         rdtsc
 | 
			
		||||
         mov tsc, eax        
 | 
			
		||||
      }
 | 
			
		||||
#else
 | 
			
		||||
      asm volatile("rdtsc":"=A" (tsc));
 | 
			
		||||
#elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 | 
			
		||||
      asm volatile("rdtsc":"=a"(tsc)::"edx");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
      RAND_add(&tsc, sizeof(tsc), 1);
 | 
			
		||||
 
 | 
			
		||||
@@ -750,7 +750,7 @@ static void readscreen(void)
 | 
			
		||||
  int		y;		/* y-coordinate of screen lines to grab */
 | 
			
		||||
  int		n = 16;		/* number of screen lines to grab at a time */
 | 
			
		||||
 | 
			
		||||
  if (GetVersion() >= 0x80000000 || !OPENSSL_isservice())
 | 
			
		||||
  if (GetVersion() < 0x80000000 && OPENSSL_isservice()>0)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  /* Create a screen DC and a memory DC compatible to screen DC */
 | 
			
		||||
 
 | 
			
		||||
@@ -265,8 +265,8 @@ err:
 | 
			
		||||
const char *RAND_file_name(char *buf, size_t size)
 | 
			
		||||
	{
 | 
			
		||||
	char *s=NULL;
 | 
			
		||||
	int ok = 0;
 | 
			
		||||
#ifdef __OpenBSD__
 | 
			
		||||
	int ok = 0;
 | 
			
		||||
	struct stat sb;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -294,7 +294,9 @@ const char *RAND_file_name(char *buf, size_t size)
 | 
			
		||||
			BUF_strlcat(buf,"/",size);
 | 
			
		||||
#endif
 | 
			
		||||
			BUF_strlcat(buf,RFILE,size);
 | 
			
		||||
#ifdef __OpenBSD__
 | 
			
		||||
			ok = 1;
 | 
			
		||||
#endif
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
		  	buf[0] = '\0'; /* no file name */
 | 
			
		||||
 
 | 
			
		||||
@@ -167,7 +167,7 @@ $code.=<<___;
 | 
			
		||||
	movzb	($dat,$XX[0]),$TX[0]#d
 | 
			
		||||
	test	\$-8,$len
 | 
			
		||||
	jz	.Lcloop1
 | 
			
		||||
	cmp	\$0,260($dat)
 | 
			
		||||
	cmpl	\$0,260($dat)
 | 
			
		||||
	jnz	.Lcloop1
 | 
			
		||||
	push	%rbx
 | 
			
		||||
	jmp	.Lcloop8
 | 
			
		||||
 
 | 
			
		||||
@@ -673,7 +673,7 @@ static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
 | 
			
		||||
		rsa->_method_mod_n)) goto err;
 | 
			
		||||
 | 
			
		||||
	if ((padding == RSA_X931_PADDING) && ((ret->d[0] & 0xf) != 12))
 | 
			
		||||
		BN_sub(ret, rsa->n, ret);
 | 
			
		||||
		if (!BN_sub(ret, rsa->n, ret)) goto err;
 | 
			
		||||
 | 
			
		||||
	p=buf;
 | 
			
		||||
	i=BN_bn2bin(ret,p);
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +127,7 @@ STACK_OF(type) \
 | 
			
		||||
	sk_is_sorted(CHECKED_PTR_OF(STACK_OF(type), st))
 | 
			
		||||
 | 
			
		||||
#define	SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
 | 
			
		||||
	(STACK_OF(type) *)d2i_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), \
 | 
			
		||||
	(STACK_OF(type) *)d2i_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type)*, st), \
 | 
			
		||||
				pp, length, \
 | 
			
		||||
				CHECKED_D2I_OF(type, d2i_func), \
 | 
			
		||||
				CHECKED_SK_FREE_FUNC(type, free_func), \
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user