Compare commits
	
		
			134 Commits
		
	
	
		
			OpenSSL_FI
			...
			OpenSSL_0_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					ce8945f35c | ||
| 
						 | 
					dd890f0776 | ||
| 
						 | 
					af4ac437ab | ||
| 
						 | 
					607585fdaf | ||
| 
						 | 
					2f596aeef5 | ||
| 
						 | 
					69762c75fa | ||
| 
						 | 
					36b29660ce | ||
| 
						 | 
					4976983f30 | ||
| 
						 | 
					31e4ad25ba | ||
| 
						 | 
					225f4daf15 | ||
| 
						 | 
					b9927cfa2d | ||
| 
						 | 
					af6cafc603 | ||
| 
						 | 
					15da07d436 | ||
| 
						 | 
					886ed3544b | ||
| 
						 | 
					aff2922f9a | ||
| 
						 | 
					f32e0035a3 | ||
| 
						 | 
					7b1e7706d8 | ||
| 
						 | 
					cd74dda72a | ||
| 
						 | 
					032bb2a2c5 | ||
| 
						 | 
					fa96ed06d2 | ||
| 
						 | 
					43133041c9 | ||
| 
						 | 
					e0ee5ea962 | ||
| 
						 | 
					f5634286a3 | ||
| 
						 | 
					97d37c1c1e | ||
| 
						 | 
					739b139cb2 | ||
| 
						 | 
					0bc9920ad4 | ||
| 
						 | 
					3f516ce837 | ||
| 
						 | 
					9f197f9da5 | ||
| 
						 | 
					3dc2cc36e9 | ||
| 
						 | 
					ca3e683747 | ||
| 
						 | 
					38a1757168 | ||
| 
						 | 
					4104a57107 | ||
| 
						 | 
					b0c0f20071 | ||
| 
						 | 
					53d8996764 | ||
| 
						 | 
					32b1843ec6 | ||
| 
						 | 
					8712009778 | ||
| 
						 | 
					b8994f44e7 | ||
| 
						 | 
					f468e3824a | ||
| 
						 | 
					ea1b02db6a | ||
| 
						 | 
					2c4b354d32 | ||
| 
						 | 
					25a66ee3cb | ||
| 
						 | 
					0978dec131 | ||
| 
						 | 
					91b17fbad4 | ||
| 
						 | 
					ce92b6eb9c | ||
| 
						 | 
					7abbffc3fb | ||
| 
						 | 
					9dd8405341 | ||
| 
						 | 
					46a643763d | ||
| 
						 | 
					92c4468572 | ||
| 
						 | 
					10cde5010d | ||
| 
						 | 
					c4cd925cc0 | ||
| 
						 | 
					f210eb7b89 | ||
| 
						 | 
					734540f887 | ||
| 
						 | 
					804515425a | ||
| 
						 | 
					81a86fcf17 | ||
| 
						 | 
					a534bb09d3 | ||
| 
						 | 
					b6995add5c | ||
| 
						 | 
					8ccd06c66c | ||
| 
						 | 
					fe86616c72 | ||
| 
						 | 
					ba2ba27008 | ||
| 
						 | 
					f795123c4a | ||
| 
						 | 
					c596c795bf | ||
| 
						 | 
					3f19bbf4e3 | ||
| 
						 | 
					b874ce4dc2 | ||
| 
						 | 
					c6c2e3135d | ||
| 
						 | 
					4b26fe30de | ||
| 
						 | 
					4a8224b598 | ||
| 
						 | 
					8afca8d9c6 | ||
| 
						 | 
					35e8510e60 | ||
| 
						 | 
					8b15c74018 | ||
| 
						 | 
					3afa6cf866 | ||
| 
						 | 
					e19e549041 | ||
| 
						 | 
					d7561ac576 | ||
| 
						 | 
					7870774162 | ||
| 
						 | 
					fbeaa3c47d | ||
| 
						 | 
					ee2262b8d7 | ||
| 
						 | 
					b0ac0a8ef8 | ||
| 
						 | 
					0f4499360e | ||
| 
						 | 
					7dc17a6cf0 | ||
| 
						 | 
					b6223d2f70 | ||
| 
						 | 
					4213cdaf5d | ||
| 
						 | 
					39b4c974ee | ||
| 
						 | 
					256b5d5877 | ||
| 
						 | 
					508f56f17c | ||
| 
						 | 
					5d0d60e2f5 | ||
| 
						 | 
					57ee007035 | ||
| 
						 | 
					82e8cb403a | ||
| 
						 | 
					abee01c6f8 | ||
| 
						 | 
					48665b7c99 | ||
| 
						 | 
					2c288b2a7e | ||
| 
						 | 
					831721ef49 | ||
| 
						 | 
					51971f7293 | ||
| 
						 | 
					3d3addb252 | ||
| 
						 | 
					3f8bdd1fdb | ||
| 
						 | 
					6181fd949f | ||
| 
						 | 
					afd61c63c2 | ||
| 
						 | 
					9a2073b4cd | ||
| 
						 | 
					f28468188b | ||
| 
						 | 
					8871d87512 | ||
| 
						 | 
					a2b81188be | ||
| 
						 | 
					f91f6cd5e4 | ||
| 
						 | 
					bd923a7bac | ||
| 
						 | 
					373c88faef | ||
| 
						 | 
					14813d8123 | ||
| 
						 | 
					92f2437f48 | ||
| 
						 | 
					da959761ff | ||
| 
						 | 
					d8cd25aa0d | ||
| 
						 | 
					d63d4f46fc | ||
| 
						 | 
					52161e090d | ||
| 
						 | 
					9e55e06501 | ||
| 
						 | 
					0b6df67fb1 | ||
| 
						 | 
					bf087e1ea1 | ||
| 
						 | 
					885818fb7c | ||
| 
						 | 
					2f370048cb | ||
| 
						 | 
					28dc02a9d8 | ||
| 
						 | 
					54ebaca535 | ||
| 
						 | 
					4fedc91a4a | ||
| 
						 | 
					f734aaa413 | ||
| 
						 | 
					a575d4b9ee | ||
| 
						 | 
					77a87ded3a | ||
| 
						 | 
					b958d2c298 | ||
| 
						 | 
					dc72a195c2 | ||
| 
						 | 
					e2812ff61f | ||
| 
						 | 
					8c2e34e27f | ||
| 
						 | 
					31f3950fbf | ||
| 
						 | 
					75b3654d18 | ||
| 
						 | 
					418f9ac5e3 | ||
| 
						 | 
					ad4afe4edf | ||
| 
						 | 
					c844b971cb | ||
| 
						 | 
					ca9b1c47af | ||
| 
						 | 
					86039d2751 | ||
| 
						 | 
					420a692f04 | ||
| 
						 | 
					1d2a464fe0 | ||
| 
						 | 
					7735dd0750 | ||
| 
						 | 
					bf7b075f0c | 
							
								
								
									
										37
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								CHANGES
									
									
									
									
									
								
							@@ -2,7 +2,12 @@
 | 
			
		||||
 OpenSSL CHANGES
 | 
			
		||||
 _______________
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.7g and 0.9.8  [xx XXX xxxx]
 | 
			
		||||
 Changes between 0.9.7h and 0.9.8  [xx XXX xxxx]
 | 
			
		||||
 | 
			
		||||
  *) Add attribute functions to EVP_PKEY structure. Modify
 | 
			
		||||
     PKCS12_create() to recognize a CSP name attribute and
 | 
			
		||||
     use it. Make -CSP option work again in pkcs12 utility.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Add new functionality to the bn blinding code:
 | 
			
		||||
     - automatic re-creation of the BN_BLINDING parameters after
 | 
			
		||||
@@ -774,14 +779,14 @@
 | 
			
		||||
  *) Include some named elliptic curves, and add OIDs from X9.62,
 | 
			
		||||
     SECG, and WAP/WTLS.  Each curve can be obtained from the new
 | 
			
		||||
     function
 | 
			
		||||
          EC_GROUP_new_by_nid(),
 | 
			
		||||
          EC_GROUP_new_by_curve_name(),
 | 
			
		||||
     and the list of available named curves can be obtained with
 | 
			
		||||
          EC_get_builtin_curves().
 | 
			
		||||
     Also add a 'curve_name' member to EC_GROUP objects, which can be
 | 
			
		||||
     accessed via
 | 
			
		||||
         EC_GROUP_set_nid()
 | 
			
		||||
         EC_GROUP_get_nid()
 | 
			
		||||
     [Nils Larsch <nla@trustcenter.de, Bodo Moeller]
 | 
			
		||||
         EC_GROUP_set_curve_name()
 | 
			
		||||
         EC_GROUP_get_curve_name()
 | 
			
		||||
     [Nils Larsch <larsch@trustcenter.de, Bodo Moeller]
 | 
			
		||||
 
 | 
			
		||||
  *) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
 | 
			
		||||
     was actually never needed) and in BN_mul().  The removal in BN_mul()
 | 
			
		||||
@@ -794,6 +799,28 @@
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.7g and 0.9.7h  [XX xxx XXXX]
 | 
			
		||||
 | 
			
		||||
  *) Make a new fixed-window mod_exp implementation the default for
 | 
			
		||||
     RSA, DSA, and DH private-key operations so that the sequence of
 | 
			
		||||
     squares and multiplies and the memory access pattern are
 | 
			
		||||
     independent of the particular secret key.  This will mitigate
 | 
			
		||||
     cache-timing and potential related attacks.
 | 
			
		||||
 | 
			
		||||
     BN_mod_exp_mont_consttime() is the new exponentiation implementation,
 | 
			
		||||
     and this is automatically used by BN_mod_exp_mont() if the new flag
 | 
			
		||||
     BN_FLG_EXP_CONSTTIME is set for the exponent.  RSA, DSA, and DH
 | 
			
		||||
     will use this BN flag for private exponents unless the flag
 | 
			
		||||
     RSA_FLAG_NO_EXP_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME, or
 | 
			
		||||
     DH_FLAG_NO_EXP_CONSTTIME, respectively, is set.
 | 
			
		||||
 | 
			
		||||
     [Matthew D Wood (Intel Corp), with some changes by Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Change the client implementation for SSLv23_method() and
 | 
			
		||||
     SSLv23_client_method() so that is uses the SSL 3.0/TLS 1.0
 | 
			
		||||
     Client Hello message format if the SSL_OP_NO_SSLv2 option is set.
 | 
			
		||||
     (Previously, the SSL 2.0 backwards compatible Client Hello
 | 
			
		||||
     message format would be used even with SSL_OP_NO_SSLv2.)
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Add support for smime-type MIME parameter in S/MIME messages which some
 | 
			
		||||
     clients need.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 
 | 
			
		||||
@@ -133,14 +133,6 @@ be added to the end of this file.
 | 
			
		||||
 | 
			
		||||
	Whoops, forgot FIPS DES, also add EVPs for DES CFB1 and 8.
 | 
			
		||||
 | 
			
		||||
2003-07-31 23:30  levitte
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		Makefile.org (1.154.2.71), "Exp", lines: +2 -0
 | 
			
		||||
 | 
			
		||||
	If FDIRS is to be treated like SDIRS, let's not forget to
 | 
			
		||||
	initialize it in Makefile.org.
 | 
			
		||||
 | 
			
		||||
2003-08-01 12:25  ben
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
@@ -158,48 +150,6 @@ be added to the end of this file.
 | 
			
		||||
 | 
			
		||||
	DES CFB8 test.
 | 
			
		||||
 | 
			
		||||
2004-05-12 16:11  ben
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		crypto/rand/rand.h (1.26.2.8), "Exp", lines: +2 -0
 | 
			
		||||
		crypto/rand/rand_err.c (1.6.2.4), "Exp", lines: +2 -0
 | 
			
		||||
		fips/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1
 | 
			
		||||
		fips/fips.c (1.1.2.4), "Exp", lines: +5 -1
 | 
			
		||||
		fips/rand/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1
 | 
			
		||||
		fips/rand/fips_rand.c (1.1.2.5), "Exp", lines: +29 -0
 | 
			
		||||
 | 
			
		||||
	Blow up in people's faces if they don't reseed.
 | 
			
		||||
 | 
			
		||||
2004-06-21 20:05  levitte
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		Makefile.org (1.154.2.82), "Exp", lines: +3 -1
 | 
			
		||||
 | 
			
		||||
	Standard sh doesn't tolerate ! as part of the conditional command.
 | 
			
		||||
 | 
			
		||||
		PR: 900
 | 
			
		||||
 | 
			
		||||
2004-08-02 16:15  levitte [FIPS]
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		crypto/cryptlib.c (1.32.2.13), "Exp", lines: +4 -4
 | 
			
		||||
 | 
			
		||||
	Let's lock a write lock when changing values, shall we?
 | 
			
		||||
 | 
			
		||||
		Thanks to Dr Stephen Henson <shenson@drh-consultancy.co.uk>
 | 
			
		||||
	for making me aware of this error.
 | 
			
		||||
 | 
			
		||||
2005-03-15 10:46  appro [FIPS]
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		Makefile.org (1.154.2.96), "Exp", lines: +1 -1
 | 
			
		||||
		crypto/Makefile (1.1.4.6), "Exp", lines: +2 -3
 | 
			
		||||
		fips/Makefile (1.1.4.8), "Exp", lines: +4 -1
 | 
			
		||||
 | 
			
		||||
	Real Bourne shell doesn't accept ! as in "if ! grep ..." Fix this
 | 
			
		||||
	in crypto/Makefile and make Makefile.org and fips/Makefile more
 | 
			
		||||
	discreet.
 | 
			
		||||
 | 
			
		||||
2005-04-19 16:21  appro
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
 
 | 
			
		||||
@@ -141,6 +141,14 @@ This is the "FIPS"-related part.
 | 
			
		||||
 | 
			
		||||
	Missing files.
 | 
			
		||||
 | 
			
		||||
2003-07-31 23:30  levitte
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		Makefile.org (1.154.2.71), "Exp", lines: +2 -0
 | 
			
		||||
 | 
			
		||||
	If FDIRS is to be treated like SDIRS, let's not forget to
 | 
			
		||||
	initialize it in Makefile.org.
 | 
			
		||||
 | 
			
		||||
2003-07-31 23:41  levitte
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
@@ -580,6 +588,18 @@ This is the "FIPS"-related part.
 | 
			
		||||
 | 
			
		||||
	Ignore 'Makefile.save'
 | 
			
		||||
 | 
			
		||||
2004-05-12 16:11  ben
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		crypto/rand/rand.h (1.26.2.8), "Exp", lines: +2 -0
 | 
			
		||||
		crypto/rand/rand_err.c (1.6.2.4), "Exp", lines: +2 -0
 | 
			
		||||
		fips/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1
 | 
			
		||||
		fips/fips.c (1.1.2.4), "Exp", lines: +5 -1
 | 
			
		||||
		fips/rand/fingerprint.sha1 (1.1.2.5), "Exp", lines: +1 -1
 | 
			
		||||
		fips/rand/fips_rand.c (1.1.2.5), "Exp", lines: +29 -0
 | 
			
		||||
 | 
			
		||||
	Blow up in people's faces if they don't reseed.
 | 
			
		||||
 | 
			
		||||
2004-05-15 19:51  ben
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
@@ -746,6 +766,15 @@ This is the "FIPS"-related part.
 | 
			
		||||
 | 
			
		||||
		PR: 900
 | 
			
		||||
 | 
			
		||||
2004-06-21 20:05  levitte
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		Makefile.org (1.154.2.82), "Exp", lines: +3 -1
 | 
			
		||||
 | 
			
		||||
	Standard sh doesn't tolerate ! as part of the conditional command.
 | 
			
		||||
 | 
			
		||||
		PR: 900
 | 
			
		||||
 | 
			
		||||
2004-06-28 22:33  levitte
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
@@ -911,6 +940,16 @@ This is the "FIPS"-related part.
 | 
			
		||||
	rebuilt to use FIPS functionality will need to be recompiled in any
 | 
			
		||||
	case, thus not being a problem either.
 | 
			
		||||
 | 
			
		||||
2004-08-02 16:15  levitte
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		crypto/cryptlib.c (1.32.2.13), "Exp", lines: +4 -4
 | 
			
		||||
 | 
			
		||||
	Let's lock a write lock when changing values, shall we?
 | 
			
		||||
 | 
			
		||||
		Thanks to Dr Stephen Henson <shenson@drh-consultancy.co.uk>
 | 
			
		||||
	for making me aware of this error.
 | 
			
		||||
 | 
			
		||||
2004-08-05 20:11  steve
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
@@ -1240,6 +1279,17 @@ This is the "FIPS"-related part.
 | 
			
		||||
 | 
			
		||||
	In FIPS mode use SHA1 as default digest in x509 and req utilities.
 | 
			
		||||
 | 
			
		||||
2005-03-15 10:46  appro
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
		Makefile.org (1.154.2.96), "Exp", lines: +1 -1
 | 
			
		||||
		crypto/Makefile (1.1.4.6), "Exp", lines: +2 -3
 | 
			
		||||
		fips/Makefile (1.1.4.8), "Exp", lines: +4 -1
 | 
			
		||||
 | 
			
		||||
	Real Bourne shell doesn't accept ! as in "if ! grep ..." Fix this
 | 
			
		||||
	in crypto/Makefile and make Makefile.org and fips/Makefile more
 | 
			
		||||
	discreet.
 | 
			
		||||
 | 
			
		||||
2005-03-22 18:29  steve
 | 
			
		||||
 | 
			
		||||
	Changed:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								Configure
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								Configure
									
									
									
									
									
								
							@@ -304,19 +304,11 @@ my %table=(
 | 
			
		||||
#
 | 
			
		||||
# - William Shakespeare, "Romeo & Juliet", Act II, scene II.
 | 
			
		||||
#
 | 
			
		||||
# There's also an alternate target available (which `config' will never
 | 
			
		||||
# select) called alpha-cc-rpath.  This target builds an RPATH into the
 | 
			
		||||
# shared libraries, which is very convenient on Tru64 since binaries
 | 
			
		||||
# linked against that shared library will automatically inherit that RPATH,
 | 
			
		||||
# and hence know where to look for the openssl libraries, even if they're in
 | 
			
		||||
# an odd place.
 | 
			
		||||
#
 | 
			
		||||
# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version
 | 
			
		||||
#
 | 
			
		||||
"osf1-alpha-gcc", "gcc:-O3::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${no_asm}:dlfcn:alpha-osf1-shared:::.so",
 | 
			
		||||
"ofs1-alpha-cc",  "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared:::.so",
 | 
			
		||||
"tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:tru64-shared:::.so",
 | 
			
		||||
"alpha-cc-rpath", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:tru64-shared-rpath:::.so",
 | 
			
		||||
"tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared::-msym:.so",
 | 
			
		||||
 | 
			
		||||
####
 | 
			
		||||
#### Variety of LINUX:-)
 | 
			
		||||
@@ -475,17 +467,12 @@ my %table=(
 | 
			
		||||
"VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
 | 
			
		||||
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
 | 
			
		||||
"VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
 | 
			
		||||
"VC-WIN16","cl:::(unknown):WIN16::MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
 | 
			
		||||
"VC-W31-16","cl:::(unknown):WIN16::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
 | 
			
		||||
"VC-W31-32","cl::::WIN16::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
 | 
			
		||||
"VC-MSDOS","cl:::(unknown):MSDOS::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
 | 
			
		||||
 | 
			
		||||
# Borland C++ 4.5
 | 
			
		||||
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32",
 | 
			
		||||
"BC-16","bcc:::(unknown):WIN16::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",
 | 
			
		||||
 | 
			
		||||
# MinGW
 | 
			
		||||
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL:-mno-cygwin -shared:.dll.a",
 | 
			
		||||
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a",
 | 
			
		||||
 | 
			
		||||
# UWIN 
 | 
			
		||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
 | 
			
		||||
@@ -513,9 +500,9 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
 | 
			
		||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
 | 
			
		||||
"darwin-ppc-cc","cc:-O3 -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o:::::::::::darwin-shared:-fPIC -fno-common::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
"darwin-ppc-cc","cc:-O3 -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o:::::::::::darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::darwin-shared:-fPIC:-dunamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o:::::::::::darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
 | 
			
		||||
##### A/UX
 | 
			
		||||
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
 | 
			
		||||
@@ -543,8 +530,7 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A
 | 
			
		||||
		    VC-NT VC-CE VC-WIN32
 | 
			
		||||
		    VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS
 | 
			
		||||
		    BC-32 BC-16 OS2-EMX netware-clib netware-libc);
 | 
			
		||||
		    BC-32 OS2-EMX netware-clib netware-libc);
 | 
			
		||||
 | 
			
		||||
my $idx = 0;
 | 
			
		||||
my $idx_cc = $idx++;
 | 
			
		||||
@@ -1147,6 +1133,7 @@ else
 | 
			
		||||
	$openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
$cpuid_obj.=" uplink.o uplink-cof.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
 | 
			
		||||
# Compiler fix-ups
 | 
			
		||||
if ($target =~ /icc$/)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								FAQ
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								FAQ
									
									
									
									
									
								
							@@ -46,6 +46,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* Why does the OpenSSL test suite fail on MacOS X?
 | 
			
		||||
* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
 | 
			
		||||
* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
 | 
			
		||||
* Why does the OpenSSL test suite fail in sha512t on x86 CPU?
 | 
			
		||||
 | 
			
		||||
[PROG] Questions about programming with OpenSSL
 | 
			
		||||
 | 
			
		||||
@@ -598,6 +599,14 @@ Reportedly elder *BSD a.out platforms also suffer from this problem and
 | 
			
		||||
remedy should be same. Provided binary is statically linked and should be
 | 
			
		||||
working across wider range of *BSD branches, not just OpenBSD.
 | 
			
		||||
 | 
			
		||||
* Why does the OpenSSL test suite fail in sha512t on x86 CPU?
 | 
			
		||||
 | 
			
		||||
If the test program in question fails withs SIGILL, Illegal Instruction
 | 
			
		||||
exception, then you more than likely to run SSE2-capable CPU, such as
 | 
			
		||||
Intel P4, under control of kernel which does not support SSE2
 | 
			
		||||
instruction extentions. See accompanying INSTALL file and
 | 
			
		||||
OPENSSL_ia32cap(3) documentation page for further information.
 | 
			
		||||
 | 
			
		||||
[PROG] ========================================================================
 | 
			
		||||
 | 
			
		||||
* Is OpenSSL thread-safe?
 | 
			
		||||
@@ -652,6 +661,17 @@ by:
 | 
			
		||||
Note that debug and release libraries are NOT interchangeable.  If you
 | 
			
		||||
built OpenSSL with /MD your application must use /MD and cannot use /MDd.
 | 
			
		||||
 | 
			
		||||
As per 0.9.8 the above limitation is eliminated for .DLLs. OpenSSL
 | 
			
		||||
.DLLs compiled with some specific run-time option [we recommend the
 | 
			
		||||
default /MD] can be deployed with application compiled with different
 | 
			
		||||
option or even different compiler. But there is a catch! Instead of
 | 
			
		||||
re-compiling OpenSSL toolkit, as you would have to with prior versions,
 | 
			
		||||
you have to compile small C snippet with compiler and/or options of
 | 
			
		||||
your choice. The snippet gets installed as
 | 
			
		||||
<install-root>/include/openssl/applink.c and should be either added to
 | 
			
		||||
your project or simply #include-d in one [and only one] of your source
 | 
			
		||||
files. Failure to do either manifests itself as fatal "no
 | 
			
		||||
OPENSSL_Applink" error.
 | 
			
		||||
 | 
			
		||||
* How do I read or write a DER encoded buffer using the ASN1 functions?
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										37
									
								
								Makefile.org
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								Makefile.org
									
									
									
									
									
								
							@@ -147,11 +147,15 @@ HEADER=         e_os.h
 | 
			
		||||
all: Makefile build_all openssl.pc
 | 
			
		||||
 | 
			
		||||
BUILDENV=	PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
 | 
			
		||||
		SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}'	\
 | 
			
		||||
		CC='${CC}' CFLAG='${CFLAG}' 			\
 | 
			
		||||
		AS='${CC}' ASFLAG='${CFLAG} -c'			\
 | 
			
		||||
		AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}'	\
 | 
			
		||||
		LDFLAGS="$(LDFLAGS)" SHARED_LDFLAGS="$(SHARED_LDFLAGS)"	\
 | 
			
		||||
		SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/lib'		\
 | 
			
		||||
		INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}'	\
 | 
			
		||||
		MAKEDEPEND='$${TOP}/util/domd $${TOP} -MD ${MAKEDEPPROG}'\
 | 
			
		||||
		DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}'	\
 | 
			
		||||
		MAKEDEPPROG='${MAKEDEPPROG}'			\
 | 
			
		||||
		LDFLAGS='${LDFLAGS}' SHARED_LDFLAGS='${SHARED_LDFLAGS}'	\
 | 
			
		||||
		KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}'	\
 | 
			
		||||
		EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}'	\
 | 
			
		||||
		SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}'	\
 | 
			
		||||
@@ -163,16 +167,20 @@ BUILDENV=	PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
 | 
			
		||||
		RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}'	\
 | 
			
		||||
		SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'			\
 | 
			
		||||
		MD5_ASM_OBJ='${MD5_ASM_OBJ}'			\
 | 
			
		||||
		RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'
 | 
			
		||||
		RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'		\
 | 
			
		||||
		THIS=$${THIS:-$@}
 | 
			
		||||
 | 
			
		||||
BUILD_CMD=if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \
 | 
			
		||||
	if [ -d "$$dir" ]; then \
 | 
			
		||||
		(cd $$dir && echo "making $$target in $$dir..." && \
 | 
			
		||||
		$(MAKE) -e $(BUILDENV) $$target ) || exit 1; \
 | 
			
		||||
		$(MAKE) $(BUILDENV) BUILDENV="$(BUILDENV)" $$target ) || exit 1; \
 | 
			
		||||
	else \
 | 
			
		||||
		$(MAKE) $$dir; \
 | 
			
		||||
	fi; fi
 | 
			
		||||
 | 
			
		||||
reflect:
 | 
			
		||||
	@[ -n "$(THIS)" ] && $(MAKE) $(THIS) $(BUILDENV)
 | 
			
		||||
 | 
			
		||||
sub_all: build_all
 | 
			
		||||
build_all: build_libs build_apps build_tests build_tools
 | 
			
		||||
 | 
			
		||||
@@ -241,12 +249,10 @@ do_$(SHLIB_TARGET):
 | 
			
		||||
		if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
 | 
			
		||||
			libs="$(LIBKRB5) $$libs"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		$(MAKE) -f Makefile.shared \
 | 
			
		||||
			$(BUILDENV) \
 | 
			
		||||
		$(MAKE) -f Makefile.shared $(BUILDENV) \
 | 
			
		||||
			LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
			LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
 | 
			
		||||
			LIBDEPS="$$libs $(EX_LIBS)" \
 | 
			
		||||
			LIBRPATH="$(INSTALLTOP)/lib" \
 | 
			
		||||
			link_a.$(SHLIB_TARGET); \
 | 
			
		||||
		libs="-l$$i $$libs"; \
 | 
			
		||||
	done
 | 
			
		||||
@@ -270,7 +276,7 @@ Makefile: Makefile.org Configure config
 | 
			
		||||
	@false
 | 
			
		||||
 | 
			
		||||
libclean:
 | 
			
		||||
	rm -f *.map *.so *.so.* engines/*.so *.a */lib */*/lib
 | 
			
		||||
	rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
 | 
			
		||||
 | 
			
		||||
clean:	libclean
 | 
			
		||||
	rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
 | 
			
		||||
@@ -335,7 +341,7 @@ test:   tests
 | 
			
		||||
 | 
			
		||||
tests: rehash
 | 
			
		||||
	@(cd test && echo "testing..." && \
 | 
			
		||||
	$(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
 | 
			
		||||
	$(MAKE) $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
 | 
			
		||||
	util/opensslwrap.sh version -a
 | 
			
		||||
 | 
			
		||||
report:
 | 
			
		||||
@@ -346,7 +352,7 @@ depend:
 | 
			
		||||
	do \
 | 
			
		||||
	if [ -d "$$i" ]; then \
 | 
			
		||||
		(cd $$i && echo "making dependencies $$i..." && \
 | 
			
		||||
		$(MAKE) SDIRS='${SDIRS}' CFLAG='-DOPENSSL_NO_DEPRECATED ${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
 | 
			
		||||
		$(MAKE) $(BUILDENV) depend ) || exit 1; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
@@ -366,6 +372,7 @@ tags:
 | 
			
		||||
errors:
 | 
			
		||||
	$(PERL) util/mkerr.pl -recurse -write
 | 
			
		||||
	(cd engines; $(MAKE) PERL=$(PERL) errors)
 | 
			
		||||
	$(PERL) util/ck_errf.pl */*.c */*/*.c
 | 
			
		||||
 | 
			
		||||
stacks:
 | 
			
		||||
	$(PERL) util/mkstack.pl -write
 | 
			
		||||
@@ -445,7 +452,7 @@ install_sw:
 | 
			
		||||
	do \
 | 
			
		||||
	if [ -d "$$i" ]; then \
 | 
			
		||||
		(cd $$i; echo "installing $$i..."; \
 | 
			
		||||
		$(MAKE) $(BUILDENV) INSTALL_PREFIX='${INSTALL_PREFIX}' OPENSSLDIR='${OPENSSLDIR}' install ); \
 | 
			
		||||
		$(MAKE) $(BUILDENV) install ); \
 | 
			
		||||
	fi; \
 | 
			
		||||
	done
 | 
			
		||||
	@set -e; for i in $(LIBS) ;\
 | 
			
		||||
@@ -469,13 +476,13 @@ install_sw:
 | 
			
		||||
					chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
 | 
			
		||||
					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
 | 
			
		||||
				else \
 | 
			
		||||
					c=`echo $$i | sed 's/^lib/cyg/'`; \
 | 
			
		||||
					c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
 | 
			
		||||
					cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
 | 
			
		||||
					chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
 | 
			
		||||
					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
 | 
			
		||||
					cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
 | 
			
		||||
					chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
 | 
			
		||||
					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
 | 
			
		||||
					cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
 | 
			
		||||
					chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
 | 
			
		||||
					mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
 | 
			
		||||
				fi ); \
 | 
			
		||||
			fi; \
 | 
			
		||||
		done; \
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										302
									
								
								Makefile.shared
									
									
									
									
									
								
							
							
						
						
									
										302
									
								
								Makefile.shared
									
									
									
									
									
								
							@@ -7,6 +7,7 @@
 | 
			
		||||
 | 
			
		||||
# CC contains the current compiler.  This one MUST be defined
 | 
			
		||||
CC=cc
 | 
			
		||||
CFLAGS=$(CFLAG)
 | 
			
		||||
# LDFLAGS contains flags to be used when temporary object files (when building
 | 
			
		||||
# shared libraries) are created, or when an application is linked.
 | 
			
		||||
# SHARED_LDFLAGS contains flags to be used when the shared library is created.
 | 
			
		||||
@@ -88,20 +89,28 @@ CALC_VERSIONS=	\
 | 
			
		||||
 | 
			
		||||
LINK_APP=	\
 | 
			
		||||
  ( $(SET_X);   \
 | 
			
		||||
    LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
 | 
			
		||||
    LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
 | 
			
		||||
    LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
 | 
			
		||||
    LIBPATH=`for x in $(LIBDEPS); do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
 | 
			
		||||
    LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
 | 
			
		||||
    LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
 | 
			
		||||
    $$LDCMD $$LDFLAGS -o $$APPNAME $(OBJECTS) $$LIBDEPS )
 | 
			
		||||
    $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
 | 
			
		||||
 | 
			
		||||
LINK_SO=	\
 | 
			
		||||
  ( $(SET_X);   \
 | 
			
		||||
    LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
 | 
			
		||||
    SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
 | 
			
		||||
    SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
 | 
			
		||||
    nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
 | 
			
		||||
    LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
 | 
			
		||||
    LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
 | 
			
		||||
    LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
 | 
			
		||||
    $$SHAREDCMD $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
 | 
			
		||||
	$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
 | 
			
		||||
  $(SYMLINK_SO); ( $(SET_X); rm -f lib$(LIBNAME).exp )
 | 
			
		||||
    $${SHAREDCMD} $${SHAREDFLAGS} \
 | 
			
		||||
	-o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
 | 
			
		||||
	$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
 | 
			
		||||
  ) && $(SYMLINK_SO); \
 | 
			
		||||
  ( $(SET_X); rm -f lib$(LIBNAME).exp )
 | 
			
		||||
 | 
			
		||||
SYMLINK_SO=	\
 | 
			
		||||
	if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
 | 
			
		||||
		prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
 | 
			
		||||
@@ -120,12 +129,14 @@ SYMLINK_SO=	\
 | 
			
		||||
 | 
			
		||||
LINK_SO_A=	SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
 | 
			
		||||
LINK_SO_O=	SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
 | 
			
		||||
 | 
			
		||||
LINK_SO_A_VIA_O=	\
 | 
			
		||||
  SHOBJECTS=lib$(LIBNAME).o; \
 | 
			
		||||
  ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
 | 
			
		||||
  ( $(SET_X); \
 | 
			
		||||
    ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
 | 
			
		||||
  $(LINK_SO) && rm -f $(LIBNAME).o
 | 
			
		||||
 | 
			
		||||
LINK_SO_A_UNPACKED=	\
 | 
			
		||||
  UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
 | 
			
		||||
  (cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && \
 | 
			
		||||
@@ -138,15 +149,11 @@ DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
 | 
			
		||||
DO_GNU_SO=$(CALC_VERSIONS); \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS='-Wl,--whole-archive'; \
 | 
			
		||||
	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
 | 
			
		||||
	SHAREDCMD='$(CC)'
 | 
			
		||||
DO_GNU_APP=LDCMD=$(CC);\
 | 
			
		||||
	LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME=$(APPNAME)
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
 | 
			
		||||
 | 
			
		||||
DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
 | 
			
		||||
 | 
			
		||||
#This is rather special.  It's a special target with which one can link
 | 
			
		||||
#applications without bothering with any features that have anything to
 | 
			
		||||
@@ -154,10 +161,6 @@ DO_GNU_APP=LDCMD=$(CC);\
 | 
			
		||||
#libraries.  It's mostly here to avoid a lot of conditionals everywhere
 | 
			
		||||
#else...
 | 
			
		||||
link_app.:
 | 
			
		||||
	LDCMD=$(CC); \
 | 
			
		||||
	LDFLAGS="$(CFLAGS)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME="$(APPNAME)"; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
link_o.gnu:
 | 
			
		||||
@@ -172,29 +175,24 @@ link_o.bsd:
 | 
			
		||||
	$(CALC_VERSIONS); \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS=; \
 | 
			
		||||
	LIBDEPS=" "; \
 | 
			
		||||
	ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
 | 
			
		||||
	NOALLSYMSFLAGS=; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) -shared -nostdlib"; \
 | 
			
		||||
	SHAREDCMD=$(CC); \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
 | 
			
		||||
	fi; $(LINK_SO_O)
 | 
			
		||||
link_a.bsd:
 | 
			
		||||
	@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
 | 
			
		||||
	$(CALC_VERSIONS); \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS=; \
 | 
			
		||||
	LIBDEPS=" "; \
 | 
			
		||||
	ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
 | 
			
		||||
	NOALLSYMSFLAGS=; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) -shared -nostdlib"; \
 | 
			
		||||
	SHAREDCMD=$(CC); \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
 | 
			
		||||
	fi; $(LINK_SO_A)
 | 
			
		||||
link_app.bsd:
 | 
			
		||||
	@if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
 | 
			
		||||
	LDCMD=$(CC); \
 | 
			
		||||
	LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; $(LINK_APP)
 | 
			
		||||
 | 
			
		||||
# For Darwin AKA Mac OS/X (dyld)
 | 
			
		||||
@@ -202,11 +200,8 @@ link_o.darwin:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	SHLIB=lib$(LIBNAME); \
 | 
			
		||||
	SHLIB_SUFFIX=.dylib; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS='-all_load'; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) -dynamiclib"; \
 | 
			
		||||
	SHAREDCMD='$(CC)'; \
 | 
			
		||||
	if [ -n "$(LIBVERSION)" ]; then \
 | 
			
		||||
		SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
@@ -218,11 +213,8 @@ link_a.darwin:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	SHLIB=lib$(LIBNAME); \
 | 
			
		||||
	SHLIB_SUFFIX=.dylib; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS='-all_load'; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) -dynamiclib"; \
 | 
			
		||||
	SHAREDCMD='$(CC)'; \
 | 
			
		||||
	if [ -n "$(LIBVERSION)" ]; then \
 | 
			
		||||
		SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
@@ -230,11 +222,7 @@ link_a.darwin:
 | 
			
		||||
		SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A)
 | 
			
		||||
link_app.darwin:
 | 
			
		||||
	LDCMD=$(CC);\
 | 
			
		||||
	LDFLAGS="$(CFLAGS)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME="$(APPNAME)"; \
 | 
			
		||||
link_app.darwin:	# is there run-path on darwin?
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
link_o.cygwin:
 | 
			
		||||
@@ -243,12 +231,11 @@ link_o.cygwin:
 | 
			
		||||
	SHLIB=cyg$(LIBNAME); \
 | 
			
		||||
	expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME)eay32; \
 | 
			
		||||
	SHLIB_SUFFIX=.dll; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	SHLIB_SOVER=-$(LIBVERSION); \
 | 
			
		||||
	LIBVERSION="$(LIBVERSION)"; \
 | 
			
		||||
	SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
 | 
			
		||||
	ALLSYMSFLAGS='-Wl,--whole-archive'; \
 | 
			
		||||
	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
 | 
			
		||||
	SHAREDCMD='${CC}'; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.cygwin:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
@@ -256,23 +243,17 @@ link_a.cygwin:
 | 
			
		||||
	SHLIB=cyg$(LIBNAME); \
 | 
			
		||||
	expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME)eay32; \
 | 
			
		||||
	SHLIB_SUFFIX=.dll; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	SHLIB_SOVER=; \
 | 
			
		||||
	SHLIB_SOVER=-$(LIBVERSION); \
 | 
			
		||||
	ALLSYMSFLAGS='-Wl,--whole-archive'; \
 | 
			
		||||
	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
 | 
			
		||||
	base=;  [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x61200000; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
 | 
			
		||||
	SHAREDCMD='${CC}'; \
 | 
			
		||||
	base=;  [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
 | 
			
		||||
	[ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \
 | 
			
		||||
	[ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \
 | 
			
		||||
	$(LINK_SO_A) || exit 1; \
 | 
			
		||||
	cp -p $$SHLIB$$SHLIB_SUFFIX apps/; \
 | 
			
		||||
	cp -p $$SHLIB$$SHLIB_SUFFIX test/
 | 
			
		||||
	cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX apps/; \
 | 
			
		||||
	cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX test/
 | 
			
		||||
link_app.cygwin:
 | 
			
		||||
	LDCMD=$(CC);\
 | 
			
		||||
	LDFLAGS="$(CFLAGS)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME="$(APPNAME)"; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
link_o.alpha-osf1:
 | 
			
		||||
@@ -281,7 +262,6 @@ link_o.alpha-osf1:
 | 
			
		||||
	else \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
 | 
			
		||||
@@ -291,8 +271,7 @@ link_o.alpha-osf1:
 | 
			
		||||
		SHLIB_SOVER=; \
 | 
			
		||||
		ALLSYMSFLAGS='-all'; \
 | 
			
		||||
		NOALLSYMSFLAGS='-none'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared"; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
 | 
			
		||||
		fi; \
 | 
			
		||||
@@ -304,7 +283,6 @@ link_a.alpha-osf1:
 | 
			
		||||
	else \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
 | 
			
		||||
@@ -314,139 +292,17 @@ link_a.alpha-osf1:
 | 
			
		||||
		SHLIB_SOVER=; \
 | 
			
		||||
		ALLSYMSFLAGS='-all'; \
 | 
			
		||||
		NOALLSYMSFLAGS='-none'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared"; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A)
 | 
			
		||||
link_app.alpha-osf1:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
	@if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_APP); \
 | 
			
		||||
	else \
 | 
			
		||||
		LDCMD=$(CC);\
 | 
			
		||||
		LDFLAGS="$(CFLAGS)"; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		APPNAME="$(APPNAME)"
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
 | 
			
		||||
# option passed to the linker.
 | 
			
		||||
link_o.tru64:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_SO); \
 | 
			
		||||
	else \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
 | 
			
		||||
		else \
 | 
			
		||||
			SHLIB_HIST="$(LIBVERSION)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		SHLIB_SOVER=; \
 | 
			
		||||
		ALLSYMSFLAGS='-all'; \
 | 
			
		||||
		NOALLSYMSFLAGS='-none'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared -msym -rpath $(LIBRPATH)"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.tru64:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_SO); \
 | 
			
		||||
	else \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
 | 
			
		||||
		else \
 | 
			
		||||
			SHLIB_HIST="$(LIBVERSION)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		SHLIB_SOVER=; \
 | 
			
		||||
		ALLSYMSFLAGS='-all'; \
 | 
			
		||||
		NOALLSYMSFLAGS='-none'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared -msym -rpath $(LIBRPATH)"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A)
 | 
			
		||||
link_app.tru64:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_APP); \
 | 
			
		||||
	else \
 | 
			
		||||
		LDCMD=$(CC);\
 | 
			
		||||
		LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
# The difference between tru64-shared and tru64-shared-rpath is the
 | 
			
		||||
# -rpath ${LIBRPATH} passed to the linker.
 | 
			
		||||
link_o.tru64-rpath:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_SO); \
 | 
			
		||||
	else \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
 | 
			
		||||
		else \
 | 
			
		||||
			SHLIB_HIST="$(LIBVERSION)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		SHLIB_SOVER=; \
 | 
			
		||||
		ALLSYMSFLAGS='-all'; \
 | 
			
		||||
		NOALLSYMSFLAGS='-none'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared -msym -rpath $(LIBRPATH)"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.tru64-rpath:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_SO); \
 | 
			
		||||
	else \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
 | 
			
		||||
		else \
 | 
			
		||||
			SHLIB_HIST="$(LIBVERSION)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		SHLIB_SOVER=; \
 | 
			
		||||
		ALLSYMSFLAGS='-all'; \
 | 
			
		||||
		NOALLSYMSFLAGS='-none'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared -msym -rpath $(LIBRPATH)"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		if [ -n "$$SHLIB_HIST" ]; then \
 | 
			
		||||
			SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A)
 | 
			
		||||
link_app.tru64-rpath:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_APP); \
 | 
			
		||||
	else \
 | 
			
		||||
		LDCMD=$(CC);\
 | 
			
		||||
		LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
@@ -456,14 +312,12 @@ link_o.solaris:
 | 
			
		||||
	else \
 | 
			
		||||
		$(CALC_VERSIONS); \
 | 
			
		||||
		MINUSZ='-z '; \
 | 
			
		||||
		(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
 | 
			
		||||
		($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		ALLSYMSFLAGS="$${MINUSZ}allextract"; \
 | 
			
		||||
		NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH) -Wl,-Bsymbolic"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.solaris:
 | 
			
		||||
@@ -475,21 +329,16 @@ link_a.solaris:
 | 
			
		||||
		(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=;\
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		ALLSYMSFLAGS="$${MINUSZ}allextract"; \
 | 
			
		||||
		NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH) -Wl,-Bsymbolic"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-Bsymbolic"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A)
 | 
			
		||||
link_app.solaris:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_APP); \
 | 
			
		||||
	else \
 | 
			
		||||
		LDCMD=$(CC);\
 | 
			
		||||
		LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
@@ -501,11 +350,9 @@ link_o.svr3:
 | 
			
		||||
		$(CALC_VERSIONS); \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		ALLSYMSFLAGS=''; \
 | 
			
		||||
		NOALLSYMSFLAGS=''; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.svr3:
 | 
			
		||||
@@ -515,22 +362,13 @@ link_a.svr3:
 | 
			
		||||
		$(CALC_VERSIONS); \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		ALLSYMSFLAGS=''; \
 | 
			
		||||
		NOALLSYMSFLAGS=''; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A_UNPACKED)
 | 
			
		||||
link_app.svr3:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_APP); \
 | 
			
		||||
	else \
 | 
			
		||||
		LDCMD=$(CC);\
 | 
			
		||||
		LDFLAGS="$(CFLAGS)"; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	@${DETECT_GNU_LD} && $(DO_GNU_APP); \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
# UnixWare 7 and OpenUNIX 8 native compilers used
 | 
			
		||||
@@ -540,14 +378,12 @@ link_o.svr5:
 | 
			
		||||
	else \
 | 
			
		||||
		$(CALC_VERSIONS); \
 | 
			
		||||
		SHARE_FLAG='-G'; \
 | 
			
		||||
		(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
 | 
			
		||||
		($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		ALLSYMSFLAGS=''; \
 | 
			
		||||
		NOALLSYMSFLAGS=''; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.svr5:
 | 
			
		||||
@@ -559,22 +395,13 @@ link_a.svr5:
 | 
			
		||||
		(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		ALLSYMSFLAGS=''; \
 | 
			
		||||
		NOALLSYMSFLAGS=''; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A_UNPACKED)
 | 
			
		||||
link_app.svr5:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_APP); \
 | 
			
		||||
	else \
 | 
			
		||||
		LDCMD=$(CC);\
 | 
			
		||||
		LDFLAGS="$(CFLAGS)"; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	@${DETECT_GNU_LD} && $(DO_GNU_APP); \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
link_o.irix:
 | 
			
		||||
@@ -584,13 +411,11 @@ link_o.irix:
 | 
			
		||||
		$(CALC_VERSIONS); \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		MINUSWL=""; \
 | 
			
		||||
		($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
 | 
			
		||||
		ALLSYMSFLAGS="$${MINUSWL}-all"; \
 | 
			
		||||
		NOALLSYMSFLAGS="$${MINUSWL}-none"; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.irix:
 | 
			
		||||
@@ -600,24 +425,15 @@ link_a.irix:
 | 
			
		||||
		$(CALC_VERSIONS); \
 | 
			
		||||
		SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
		SHLIB_SUFFIX=; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		MINUSWL=""; \
 | 
			
		||||
		($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
 | 
			
		||||
		ALLSYMSFLAGS="$${MINUSWL}-all"; \
 | 
			
		||||
		NOALLSYMSFLAGS="$${MINUSWL}-none"; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
 | 
			
		||||
		SHAREDCMD='$(CC)'; \
 | 
			
		||||
		SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A)
 | 
			
		||||
link_app.irix:
 | 
			
		||||
	@ if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(DO_GNU_APP); \
 | 
			
		||||
	else \
 | 
			
		||||
		LDCMD=$(CC);\
 | 
			
		||||
		LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
 | 
			
		||||
		LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
		APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	@LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
# 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so
 | 
			
		||||
@@ -634,12 +450,10 @@ link_o.hpux:
 | 
			
		||||
	SHLIB=lib$(LIBNAME).sl; \
 | 
			
		||||
	expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS='-Wl,-Fl'; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \
 | 
			
		||||
	SHAREDCMD=$(CC); \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
 | 
			
		||||
link_a.hpux:
 | 
			
		||||
@@ -648,20 +462,15 @@ link_a.hpux:
 | 
			
		||||
	SHLIB=lib$(LIBNAME).sl; \
 | 
			
		||||
	expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS='-Wl,-Fl'; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX,+b,$(LIBRPATH)"; \
 | 
			
		||||
	SHAREDCMD='$(CC)'; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
 | 
			
		||||
link_app.hpux:
 | 
			
		||||
	@if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
 | 
			
		||||
	LDCMD=$(CC);\
 | 
			
		||||
	LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME="$(APPNAME)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
@@ -671,11 +480,9 @@ link_o.aix:
 | 
			
		||||
	OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS='-bnogc'; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
 | 
			
		||||
	SHAREDCMD='$(CC)'; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE'; \
 | 
			
		||||
	$(LINK_SO_O); rm -rf lib$(LIBNAME).exp
 | 
			
		||||
link_a.aix:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
@@ -683,44 +490,31 @@ link_a.aix:
 | 
			
		||||
	OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS='-bnogc'; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
 | 
			
		||||
	SHAREDCMD='$(CC)'; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE'; \
 | 
			
		||||
	$(LINK_SO_A_VIA_O)
 | 
			
		||||
link_app.aix:
 | 
			
		||||
	LDCMD=$(CC);\
 | 
			
		||||
	LDFLAGS="$(CFLAGS) -blibpath:$(LIBRPATH)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME="$(APPNAME)"
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
link_o.reliantunix:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS=; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) -G'; \
 | 
			
		||||
	SHAREDCMD='$(CC)'; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.reliantunix:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	ALLSYMSFLAGS=; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) -G'; \
 | 
			
		||||
	SHAREDCMD='$(CC)'; \
 | 
			
		||||
	$(LINK_SO_A_UNPACKED)
 | 
			
		||||
link_app.reliantunix:
 | 
			
		||||
	LDCMD=$(CC);\
 | 
			
		||||
	LDFLAGS="$(CFLAGS)"; \
 | 
			
		||||
	LIBDEPS="$(LIBDEPS)"; \
 | 
			
		||||
	APPNAME="$(APPNAME)"
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
# Targets to build symbolic links when needed
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										67
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										67
									
								
								NEWS
									
									
									
									
									
								
							@@ -5,6 +5,73 @@
 | 
			
		||||
  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.7g and OpenSSL 0.9.8:
 | 
			
		||||
 | 
			
		||||
      o Major work on the BIGNUM library for higher efficiency and to
 | 
			
		||||
        make operations more streamlined and less contradictory.  This
 | 
			
		||||
        is the result of a major audit of the BIGNUM library.
 | 
			
		||||
      o Addition of BIGNUM functions for fields GF(2^m) and NIST
 | 
			
		||||
        curves, to support the Elliptic Crypto functions.
 | 
			
		||||
      o Major work on Elliptic Crypto; ECDH and ECDSA added, including
 | 
			
		||||
        the use through EVP, X509 and ENGINE.
 | 
			
		||||
      o New ASN.1 mini-compiler that's usable through the OpenSSL
 | 
			
		||||
        configuration file.
 | 
			
		||||
      o Added support for ASN.1 indefinite length constructed encoding.
 | 
			
		||||
      o New PKCS#12 'medium level' API to manipulate PKCS#12 files.
 | 
			
		||||
      o Complete rework of shared library construction and linking
 | 
			
		||||
        programs with shared or static libraries, through a separate
 | 
			
		||||
        Makefile.shared.
 | 
			
		||||
      o Changed ENGINE framework to load dynamic engine modules
 | 
			
		||||
        automatically from specifically given directories.
 | 
			
		||||
      o New structure and ASN.1 functions for CertificatePair.
 | 
			
		||||
      o Changed the ZLIB compression method to be stateful.
 | 
			
		||||
      o Changed the key-generation and primality testing "progress"
 | 
			
		||||
        mechanism to take a structure that contains the ticker
 | 
			
		||||
        function and an argument.
 | 
			
		||||
      o New engine module: GMP (performs private key exponentiation).
 | 
			
		||||
      o New engine module: VIA PadLOck ACE extension in VIA C3
 | 
			
		||||
        Nehemiah processors.
 | 
			
		||||
      o Added support for IPv6 addresses in certificate extensions.
 | 
			
		||||
        See RFC 1884, section 2.2.
 | 
			
		||||
      o Added support for certificate policy mappings, policy
 | 
			
		||||
        constraints and name constraints.
 | 
			
		||||
      o Added support for multi-valued AVAs in the OpenSSL
 | 
			
		||||
        configuration file.
 | 
			
		||||
      o Added support for multiple certificates with the same subject
 | 
			
		||||
        in the 'openssl ca' index file.
 | 
			
		||||
      o Make it possible to create self-signed certificates using
 | 
			
		||||
        'openssl ca -selfsign'.
 | 
			
		||||
      o Make it possible to generate a serial number file with
 | 
			
		||||
        'openssl ca -create_serial'.
 | 
			
		||||
      o New binary search functions with extended functionality.
 | 
			
		||||
      o New BUF functions.
 | 
			
		||||
      o New STORE structure and library to provide an interface to all
 | 
			
		||||
        sorts of data repositories.  Supports storage of public and
 | 
			
		||||
        private keys, certificates, CRLs, numbers and arbitrary blobs.
 | 
			
		||||
	This library is unfortunately unfinished and unused withing
 | 
			
		||||
	OpenSSL.
 | 
			
		||||
      o New control functions for the error stack.
 | 
			
		||||
      o Changed the PKCS#7 library to support one-pass S/MIME
 | 
			
		||||
        processing.
 | 
			
		||||
      o Added the possibility to compile without old deprecated
 | 
			
		||||
        functionality with the OPENSSL_NO_DEPRECATED macro or the
 | 
			
		||||
        'no-deprecated' argument to the config and Configure scripts.
 | 
			
		||||
      o Constification of all ASN.1 conversion functions, and other
 | 
			
		||||
        affected functions.
 | 
			
		||||
      o Improved platform support for PowerPC.
 | 
			
		||||
      o New FIPS 180-2 algorithms (SHA-224, -256, -384 and -512).
 | 
			
		||||
      o New X509_VERIFY_PARAM structure to support parametrisation
 | 
			
		||||
        of X.509 path validation.
 | 
			
		||||
      o Major overhaul of RC4 performance on Intel P4, IA-64 and
 | 
			
		||||
        AMD64.
 | 
			
		||||
      o Changed the Configure script to have some algorithms disabled
 | 
			
		||||
        by default.  Those can be explicitely enabled with the new
 | 
			
		||||
        argument form 'enable-xxx'.
 | 
			
		||||
      o Change the default digest in 'openssl' commands from MD5 to
 | 
			
		||||
        SHA-1.
 | 
			
		||||
      o Added support for DTLS.  THIS IS STILL BEING WORKED ON!
 | 
			
		||||
      o New BIGNUM blinding.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g:
 | 
			
		||||
 | 
			
		||||
      o More compilation issues fixed.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								README
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 0.9.8-dev XX xxx XXXX
 | 
			
		||||
 OpenSSL 0.9.8-beta2 24 May 2005
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2005 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								STATUS
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								STATUS
									
									
									
									
									
								
							@@ -1,10 +1,12 @@
 | 
			
		||||
 | 
			
		||||
  OpenSSL STATUS                           Last modified at
 | 
			
		||||
  ______________                           $Date: 2005/04/25 21:42:14 $
 | 
			
		||||
  ______________                           $Date: 2005/05/24 03:42:48 $
 | 
			
		||||
 | 
			
		||||
  DEVELOPMENT STATE
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL 0.9.8:  Under development...
 | 
			
		||||
    o  OpenSSL 0.9.9:  Under development...
 | 
			
		||||
    o  OpenSSL 0.9.8-beta2:  Released on May 24th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.8-beta1:  Released on May 19th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7g: Released on April     11th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7f: Released on March     22nd, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7e: Released on October   25th, 2004
 | 
			
		||||
@@ -55,16 +57,8 @@
 | 
			
		||||
	Private key, certificate and CRL API and implementation.
 | 
			
		||||
	Developing and bugfixing PKCS#7 (S/MIME code).
 | 
			
		||||
        Various X509 issues: character sets, certificate request extensions.
 | 
			
		||||
    o Geoff and Richard are currently working on:
 | 
			
		||||
	ENGINE (the new code that gives hardware support among others).
 | 
			
		||||
    o Richard is currently working on:
 | 
			
		||||
	UI (User Interface)
 | 
			
		||||
	UTIL (a new set of library functions to support some higher level
 | 
			
		||||
	      functionality that is currently missing).
 | 
			
		||||
	Shared library support for VMS.
 | 
			
		||||
	Kerberos 5 authentication (Heimdal)
 | 
			
		||||
	Constification
 | 
			
		||||
	Compression
 | 
			
		||||
	Attribute Certificate support
 | 
			
		||||
	Certificate Pair support
 | 
			
		||||
	Storage Engines (primarly an LDAP storage engine)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										174
									
								
								TABLE
									
									
									
									
									
								
							
							
						
						
									
										174
									
								
								TABLE
									
									
									
									
									
								
							@@ -1,32 +1,5 @@
 | 
			
		||||
Output of `Configure TABLE':
 | 
			
		||||
 | 
			
		||||
*** BC-16
 | 
			
		||||
$cc           = bcc
 | 
			
		||||
$cflags       = 
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = WIN16
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** BC-32
 | 
			
		||||
$cc           = bcc32
 | 
			
		||||
$cflags       = 
 | 
			
		||||
@@ -648,33 +621,6 @@ $shared_extension =
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** VC-MSDOS
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = 
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = MSDOS
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** VC-NT
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = 
 | 
			
		||||
@@ -702,87 +648,6 @@ $shared_extension =
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** VC-W31-16
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = 
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = WIN16
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** VC-W31-32
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = 
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = WIN16
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** VC-WIN16
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = 
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = WIN16
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** VC-WIN32
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = 
 | 
			
		||||
@@ -972,33 +837,6 @@ $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = -X 64
 | 
			
		||||
 | 
			
		||||
*** alpha-cc-rpath
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -std1 -tune host -fast -readonly_strings
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK
 | 
			
		||||
$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= tru64-shared-rpath
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = .so
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 | 
			
		||||
*** aux3-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O2 -DTERMIO
 | 
			
		||||
@@ -1156,7 +994,7 @@ $rc5_obj      =
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= darwin-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_ldflag = -dunamiclib
 | 
			
		||||
$shared_extension = .$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
@@ -1183,7 +1021,7 @@ $rc5_obj      =
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= darwin-shared
 | 
			
		||||
$shared_cflag = -fPIC -fno-common
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_ldflag = -dynamiclib
 | 
			
		||||
$shared_extension = .$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
@@ -1453,7 +1291,7 @@ $rc5_obj      =
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= darwin-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_ldflag = -dynamiclib
 | 
			
		||||
$shared_extension = .$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
@@ -3153,7 +2991,7 @@ $rmd160_obj   = rm86-cof.o
 | 
			
		||||
$rc5_obj      = r586-cof.o
 | 
			
		||||
$dso_scheme   = win32
 | 
			
		||||
$shared_target= cygwin-shared
 | 
			
		||||
$shared_cflag = -D_WINDLL
 | 
			
		||||
$shared_cflag = -D_WINDLL -DOPENSSL_USE_APPLINK
 | 
			
		||||
$shared_ldflag = -mno-cygwin -shared
 | 
			
		||||
$shared_extension = .dll.a
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -3989,9 +3827,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= tru64-shared
 | 
			
		||||
$shared_target= alpha-osf1-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_ldflag = -msym
 | 
			
		||||
$shared_extension = .so
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 
 | 
			
		||||
@@ -7,11 +7,6 @@ TOP=		..
 | 
			
		||||
CC=		cc
 | 
			
		||||
INCLUDES=	-I$(TOP) -I../include $(KRB5_INCLUDES)
 | 
			
		||||
CFLAG=		-g -static
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
INSTALLTOP=	/usr/local/ssl
 | 
			
		||||
OPENSSLDIR=	/usr/local/ssl
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
PERL=		perl
 | 
			
		||||
RM=		rm -f
 | 
			
		||||
@@ -91,12 +86,9 @@ req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
 | 
			
		||||
	shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
 | 
			
		||||
		shlib_target="$(SHLIB_TARGET)"; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(MAKE) -f $(TOP)/Makefile.shared \
 | 
			
		||||
		APPNAME=req CC="$(CC)" CFLAGS="$(CFLAGS)" \
 | 
			
		||||
		LDFLAGS="$(LDFLAG)" SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
 | 
			
		||||
		OBJECTS="sreq.o $(A_OBJ) $(RAND_OBJ)" \
 | 
			
		||||
	$(MAKE) -f $(TOP)/Makefile.shared $(BUILDENV) \
 | 
			
		||||
		APPNAME=req OBJECTS="sreq.o $(A_OBJ) $(RAND_OBJ)" \
 | 
			
		||||
		LIBDEPS="$(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)" \
 | 
			
		||||
		LIBRPATH=$(INSTALLTOP)/lib \
 | 
			
		||||
		link_app.$${shlib_target}
 | 
			
		||||
 | 
			
		||||
sreq.o: req.c 
 | 
			
		||||
@@ -106,6 +98,7 @@ files:
 | 
			
		||||
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@set -e; for i in $(EXE); \
 | 
			
		||||
	do  \
 | 
			
		||||
	(echo installing $$i; \
 | 
			
		||||
@@ -135,7 +128,11 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC)
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then \
 | 
			
		||||
	    $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
 | 
			
		||||
	else \
 | 
			
		||||
	    $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
 | 
			
		||||
@@ -161,12 +158,9 @@ $(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
 | 
			
		||||
	else \
 | 
			
		||||
	  LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	$(MAKE) -f $(TOP)/Makefile.shared \
 | 
			
		||||
		APPNAME=$(EXE) CC="$(CC)" CFLAGS="$(CFLAG)" \
 | 
			
		||||
		LDFLAGS="$(LDFLAGS)" SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
 | 
			
		||||
		OBJECTS="$(PROGRAM).o $(E_OBJ)" \
 | 
			
		||||
	$(MAKE) -f $(TOP)/Makefile.shared $(BUILDENV) \
 | 
			
		||||
		APPNAME=$(EXE) OBJECTS="$(PROGRAM).o $(E_OBJ)" \
 | 
			
		||||
		LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
 | 
			
		||||
		LIBRPATH=$(INSTALLTOP)/lib \
 | 
			
		||||
		link_app.$${shlib_target}
 | 
			
		||||
	@case "../*.dll" in *\**) ;; *) cp -p ../*.dll .;; esac
 | 
			
		||||
	-(cd ..; \
 | 
			
		||||
@@ -600,6 +594,19 @@ pkcs8.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 | 
			
		||||
pkcs8.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 | 
			
		||||
pkcs8.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
 | 
			
		||||
pkcs8.o: ../include/openssl/x509_vfy.h apps.h pkcs8.c
 | 
			
		||||
prime.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 | 
			
		||||
prime.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 | 
			
		||||
prime.o: ../include/openssl/conf.h ../include/openssl/crypto.h
 | 
			
		||||
prime.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
 | 
			
		||||
prime.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
 | 
			
		||||
prime.o: ../include/openssl/engine.h ../include/openssl/evp.h
 | 
			
		||||
prime.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
 | 
			
		||||
prime.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
 | 
			
		||||
prime.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
 | 
			
		||||
prime.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
 | 
			
		||||
prime.o: ../include/openssl/sha.h ../include/openssl/stack.h
 | 
			
		||||
prime.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
 | 
			
		||||
prime.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h prime.c
 | 
			
		||||
rand.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 | 
			
		||||
rand.o: ../include/openssl/buffer.h ../include/openssl/conf.h
 | 
			
		||||
rand.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
 | 
			
		||||
@@ -614,25 +621,24 @@ rand.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 | 
			
		||||
rand.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 | 
			
		||||
rand.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
 | 
			
		||||
rand.o: ../include/openssl/x509_vfy.h apps.h rand.c
 | 
			
		||||
req.o: ../crypto/cryptlib.h ../e_os.h ../include/openssl/asn1.h
 | 
			
		||||
req.o: ../include/openssl/bio.h ../include/openssl/bn.h
 | 
			
		||||
req.o: ../include/openssl/buffer.h ../include/openssl/conf.h
 | 
			
		||||
req.o: ../include/openssl/crypto.h ../include/openssl/dh.h
 | 
			
		||||
req.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
 | 
			
		||||
req.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
 | 
			
		||||
req.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
 | 
			
		||||
req.o: ../include/openssl/err.h ../include/openssl/evp.h
 | 
			
		||||
req.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
 | 
			
		||||
req.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
 | 
			
		||||
req.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
 | 
			
		||||
req.o: ../include/openssl/pem.h ../include/openssl/pem2.h
 | 
			
		||||
req.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
 | 
			
		||||
req.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
 | 
			
		||||
req.o: ../include/openssl/sha.h ../include/openssl/stack.h
 | 
			
		||||
req.o: ../include/openssl/store.h ../include/openssl/symhacks.h
 | 
			
		||||
req.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
 | 
			
		||||
req.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
 | 
			
		||||
req.o: ../include/openssl/x509v3.h apps.h req.c
 | 
			
		||||
req.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 | 
			
		||||
req.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 | 
			
		||||
req.o: ../include/openssl/conf.h ../include/openssl/crypto.h
 | 
			
		||||
req.o: ../include/openssl/dh.h ../include/openssl/dsa.h
 | 
			
		||||
req.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
 | 
			
		||||
req.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
 | 
			
		||||
req.o: ../include/openssl/engine.h ../include/openssl/err.h
 | 
			
		||||
req.o: ../include/openssl/evp.h ../include/openssl/lhash.h
 | 
			
		||||
req.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
 | 
			
		||||
req.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
req.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
 | 
			
		||||
req.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
 | 
			
		||||
req.o: ../include/openssl/rand.h ../include/openssl/rsa.h
 | 
			
		||||
req.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 | 
			
		||||
req.o: ../include/openssl/stack.h ../include/openssl/store.h
 | 
			
		||||
req.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
 | 
			
		||||
req.o: ../include/openssl/ui.h ../include/openssl/x509.h
 | 
			
		||||
req.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h req.c
 | 
			
		||||
rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 | 
			
		||||
rsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 | 
			
		||||
rsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								apps/ec.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								apps/ec.c
									
									
									
									
									
								
							@@ -3,7 +3,7 @@
 | 
			
		||||
 * Written by Nils Larsch for the OpenSSL project.
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1998-2005 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
 | 
			
		||||
@@ -89,6 +89,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#endif
 | 
			
		||||
	int 	ret = 1;
 | 
			
		||||
	EC_KEY 	*eckey = NULL;
 | 
			
		||||
	const EC_GROUP *group;
 | 
			
		||||
	int 	i, badops = 0;
 | 
			
		||||
	const EVP_CIPHER *enc = NULL;
 | 
			
		||||
	BIO 	*in = NULL, *out = NULL;
 | 
			
		||||
@@ -328,14 +329,13 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	group = EC_KEY_get0_group(eckey);
 | 
			
		||||
 | 
			
		||||
	if (new_form)
 | 
			
		||||
		{
 | 
			
		||||
		EC_GROUP_set_point_conversion_form(eckey->group, form);
 | 
			
		||||
		eckey->conv_form = form;
 | 
			
		||||
		}
 | 
			
		||||
		EC_KEY_set_conv_form(eckey, form);
 | 
			
		||||
 | 
			
		||||
	if (new_asn1_flag)
 | 
			
		||||
		EC_GROUP_set_asn1_flag(eckey->group, asn1_flag);
 | 
			
		||||
		EC_KEY_set_asn1_flag(eckey, asn1_flag);
 | 
			
		||||
 | 
			
		||||
	if (text) 
 | 
			
		||||
		if (!EC_KEY_print(out, eckey, 0))
 | 
			
		||||
@@ -352,7 +352,7 @@ bad:
 | 
			
		||||
	if (outformat == FORMAT_ASN1) 
 | 
			
		||||
		{
 | 
			
		||||
		if (param_out)
 | 
			
		||||
			i = i2d_ECPKParameters_bio(out, eckey->group);
 | 
			
		||||
			i = i2d_ECPKParameters_bio(out, group);
 | 
			
		||||
		else if (pubin || pubout) 
 | 
			
		||||
			i = i2d_EC_PUBKEY_bio(out, eckey);
 | 
			
		||||
		else 
 | 
			
		||||
@@ -361,7 +361,7 @@ bad:
 | 
			
		||||
	else if (outformat == FORMAT_PEM) 
 | 
			
		||||
		{
 | 
			
		||||
		if (param_out)
 | 
			
		||||
			i = PEM_write_bio_ECPKParameters(out, eckey->group);
 | 
			
		||||
			i = PEM_write_bio_ECPKParameters(out, group);
 | 
			
		||||
		else if (pubin || pubout)
 | 
			
		||||
			i = PEM_write_bio_EC_PUBKEY(out, eckey);
 | 
			
		||||
		else 
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
 * Written by Nils Larsch for the OpenSSL project.
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1998-2005 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
 | 
			
		||||
@@ -411,7 +411,7 @@ bad:
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		group = EC_GROUP_new_by_nid(nid);
 | 
			
		||||
		group = EC_GROUP_new_by_curve_name(nid);
 | 
			
		||||
		if (group == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err, "unable to create curve (%s)\n", 
 | 
			
		||||
@@ -647,11 +647,11 @@ bad:
 | 
			
		||||
 | 
			
		||||
		assert(need_rand);
 | 
			
		||||
 | 
			
		||||
		eckey->group = group;
 | 
			
		||||
		if (EC_KEY_set_group(eckey, group) == 0)
 | 
			
		||||
			goto end;
 | 
			
		||||
		
 | 
			
		||||
		if (!EC_KEY_generate_key(eckey))
 | 
			
		||||
			{
 | 
			
		||||
			eckey->group = NULL;
 | 
			
		||||
			EC_KEY_free(eckey);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
@@ -664,11 +664,9 @@ bad:
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err, "bad output format specified "
 | 
			
		||||
				"for outfile\n");
 | 
			
		||||
			eckey->group = NULL;
 | 
			
		||||
			EC_KEY_free(eckey);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		eckey->group = NULL;
 | 
			
		||||
		EC_KEY_free(eckey);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -394,11 +394,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		else if (strcmp(*argv,"-pre") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			argc--; argv++;
 | 
			
		||||
			if (argc == 0)
 | 
			
		||||
				goto skip_arg_loop;
 | 
			
		||||
			sk_push(pre_cmds,*argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-post") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			argc--; argv++;
 | 
			
		||||
			if (argc == 0)
 | 
			
		||||
				goto skip_arg_loop;
 | 
			
		||||
			sk_push(post_cmds,*argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if ((strncmp(*argv,"-h",2) == 0) ||
 | 
			
		||||
 
 | 
			
		||||
@@ -538,6 +538,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		catmp = (unsigned char *)sk_value(canames, i);
 | 
			
		||||
		X509_alias_set1(sk_X509_value(certs, i), catmp, -1);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (csp_name && key)
 | 
			
		||||
		EVP_PKEY_add1_attr_by_NID(key, NID_ms_csp_name,
 | 
			
		||||
				MBSTRING_ASC, (unsigned char *)csp_name, -1);
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
#ifdef CRYPTO_MDEBUG
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								apps/req.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								apps/req.c
									
									
									
									
									
								
							@@ -79,7 +79,6 @@
 | 
			
		||||
#include <openssl/x509v3.h>
 | 
			
		||||
#include <openssl/objects.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include "../crypto/cryptlib.h"
 | 
			
		||||
 | 
			
		||||
#define SECTION		"req"
 | 
			
		||||
 | 
			
		||||
@@ -344,6 +343,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				{
 | 
			
		||||
				X509 *xtmp=NULL;
 | 
			
		||||
				EVP_PKEY *dtmp;
 | 
			
		||||
				EC_GROUP *group;
 | 
			
		||||
 | 
			
		||||
				pkey_type=TYPE_EC;
 | 
			
		||||
				p+=3;
 | 
			
		||||
@@ -354,10 +354,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
					}
 | 
			
		||||
				if ((ec_params = EC_KEY_new()) == NULL)
 | 
			
		||||
					goto end;
 | 
			
		||||
				if ((ec_params->group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL)) == NULL)
 | 
			
		||||
				group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
 | 
			
		||||
				if (group == NULL)
 | 
			
		||||
					{
 | 
			
		||||
					if (ec_params)
 | 
			
		||||
						EC_KEY_free(ec_params);
 | 
			
		||||
					EC_KEY_free(ec_params);
 | 
			
		||||
					ERR_clear_error();
 | 
			
		||||
					(void)BIO_reset(in);
 | 
			
		||||
					if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL)
 | 
			
		||||
@@ -369,7 +369,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
					if ((dtmp=X509_get_pubkey(xtmp))==NULL)
 | 
			
		||||
						goto end;
 | 
			
		||||
					if (dtmp->type == EVP_PKEY_EC)
 | 
			
		||||
						ec_params = ECParameters_dup(dtmp->pkey.eckey);
 | 
			
		||||
						ec_params = EC_KEY_dup(dtmp->pkey.ec);
 | 
			
		||||
					EVP_PKEY_free(dtmp);
 | 
			
		||||
					X509_free(xtmp);
 | 
			
		||||
					if (ec_params == NULL)
 | 
			
		||||
@@ -378,12 +378,16 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
						goto end;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				else
 | 
			
		||||
					{
 | 
			
		||||
					if (EC_KEY_set_group(ec_params, group) == 0)
 | 
			
		||||
						goto end;
 | 
			
		||||
					EC_GROUP_free(group);
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				BIO_free(in);
 | 
			
		||||
				in=NULL;
 | 
			
		||||
				
 | 
			
		||||
				newkey = EC_GROUP_get_degree(ec_params->group);
 | 
			
		||||
 | 
			
		||||
				newkey = EC_GROUP_get_degree(EC_KEY_get0_group(ec_params));
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -981,13 +981,6 @@ bad:
 | 
			
		||||
		{
 | 
			
		||||
		EC_KEY *ecdh=NULL;
 | 
			
		||||
 | 
			
		||||
		ecdh = EC_KEY_new();
 | 
			
		||||
		if (ecdh == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"Could not create ECDH struct.\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (named_curve)
 | 
			
		||||
			{
 | 
			
		||||
			int nid = OBJ_sn2nid(named_curve);
 | 
			
		||||
@@ -998,9 +991,8 @@ bad:
 | 
			
		||||
					named_curve);
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
			ecdh->group = EC_GROUP_new_by_nid(nid);
 | 
			
		||||
			if (ecdh->group == NULL)
 | 
			
		||||
			ecdh = EC_KEY_new_by_curve_name(nid);
 | 
			
		||||
			if (ecdh == NULL)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err, "unable to create curve (%s)\n", 
 | 
			
		||||
					named_curve);
 | 
			
		||||
@@ -1008,15 +1000,15 @@ bad:
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (ecdh->group != NULL)
 | 
			
		||||
		if (ecdh != NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_s_out,"Setting temp ECDH parameters\n");
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_s_out,"Using default temp ECDH parameters\n");
 | 
			
		||||
			ecdh->group=EC_GROUP_new_by_nid(NID_sect163r2);
 | 
			
		||||
			if (ecdh->group == NULL) 
 | 
			
		||||
			ecdh = EC_KEY_new_by_curve_name(NID_sect163r2);
 | 
			
		||||
			if (ecdh == NULL) 
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err, "unable to create curve (sect163r2)\n");
 | 
			
		||||
				goto end;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										312
									
								
								apps/speed.c
									
									
									
									
									
								
							
							
						
						
									
										312
									
								
								apps/speed.c
									
									
									
									
									
								
							@@ -496,9 +496,13 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA
 | 
			
		||||
	unsigned char sha[SHA_DIGEST_LENGTH];
 | 
			
		||||
#ifndef OPENSSL_NO_SHA256
 | 
			
		||||
	unsigned char sha256[SHA256_DIGEST_LENGTH];
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA512
 | 
			
		||||
	unsigned char sha512[SHA512_DIGEST_LENGTH];
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RIPEMD
 | 
			
		||||
	unsigned char rmd160[RIPEMD160_DIGEST_LENGTH];
 | 
			
		||||
#endif
 | 
			
		||||
@@ -878,11 +882,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
							doit[D_SHA256]=1,
 | 
			
		||||
							doit[D_SHA512]=1;
 | 
			
		||||
		else
 | 
			
		||||
#ifndef OPENSSL_NO_SHA256
 | 
			
		||||
			if (strcmp(*argv,"sha256") == 0) doit[D_SHA256]=1;
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA512
 | 
			
		||||
			if (strcmp(*argv,"sha512") == 0) doit[D_SHA512]=1;
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RIPEMD
 | 
			
		||||
			if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1;
 | 
			
		||||
		else
 | 
			
		||||
@@ -1064,8 +1072,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA1
 | 
			
		||||
			BIO_printf(bio_err,"sha1     ");
 | 
			
		||||
			BIO_printf(bio_err,"sha256  ");
 | 
			
		||||
			BIO_printf(bio_err,"sha512  ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA256
 | 
			
		||||
			BIO_printf(bio_err,"sha256   ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA512
 | 
			
		||||
			BIO_printf(bio_err,"sha512   ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RIPEMD160
 | 
			
		||||
			BIO_printf(bio_err,"rmd160");
 | 
			
		||||
@@ -2040,7 +2052,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		int ret;
 | 
			
		||||
 | 
			
		||||
		if (!ecdsa_doit[j]) continue; /* Ignore Curve */ 
 | 
			
		||||
		ecdsa[j] = EC_KEY_new();
 | 
			
		||||
		ecdsa[j] = EC_KEY_new_by_curve_name(test_curves[j]);
 | 
			
		||||
		if (ecdsa[j] == NULL) 
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"ECDSA failure.\n");
 | 
			
		||||
@@ -2049,100 +2061,89 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			} 
 | 
			
		||||
		else 
 | 
			
		||||
			{
 | 
			
		||||
			ecdsa[j]->group = EC_GROUP_new_by_nid(test_curves[j]);
 | 
			
		||||
			/* Could not obtain group information */
 | 
			
		||||
			if (ecdsa[j]->group == NULL) 
 | 
			
		||||
#if 1
 | 
			
		||||
			EC_KEY_precompute_mult(ecdsa[j], NULL);
 | 
			
		||||
#endif
 | 
			
		||||
			/* Perform ECDSA signature test */
 | 
			
		||||
			EC_KEY_generate_key(ecdsa[j]);
 | 
			
		||||
			ret = ECDSA_sign(0, buf, 20, ecdsasig, 
 | 
			
		||||
				&ecdsasiglen, ecdsa[j]);
 | 
			
		||||
			if (ret == 0) 
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"ECDSA failure.Could not obtain group information\n");
 | 
			
		||||
				BIO_printf(bio_err,"ECDSA sign failure.  No ECDSA sign will be done.\n");
 | 
			
		||||
				ERR_print_errors(bio_err);
 | 
			
		||||
				rsa_count=1;
 | 
			
		||||
				} 
 | 
			
		||||
			else 
 | 
			
		||||
				{
 | 
			
		||||
#if 1
 | 
			
		||||
				EC_GROUP_precompute_mult(ecdsa[j]->group, NULL);
 | 
			
		||||
#endif
 | 
			
		||||
				/* Perform ECDSA signature test */
 | 
			
		||||
				EC_KEY_generate_key(ecdsa[j]);
 | 
			
		||||
				ret = ECDSA_sign(0, buf, 20, ecdsasig, 
 | 
			
		||||
					&ecdsasiglen, ecdsa[j]);
 | 
			
		||||
				if (ret == 0) 
 | 
			
		||||
					{
 | 
			
		||||
					BIO_printf(bio_err,"ECDSA sign failure.  No ECDSA sign will be done.\n");
 | 
			
		||||
					ERR_print_errors(bio_err);
 | 
			
		||||
					rsa_count=1;
 | 
			
		||||
					} 
 | 
			
		||||
				else 
 | 
			
		||||
					{
 | 
			
		||||
					pkey_print_message("sign","ecdsa",
 | 
			
		||||
						ecdsa_c[j][0], 
 | 
			
		||||
						test_curves_bits[j],
 | 
			
		||||
						ECDSA_SECONDS);
 | 
			
		||||
 | 
			
		||||
					Time_F(START);
 | 
			
		||||
					for (count=0,run=1; COND(ecdsa_c[j][0]);
 | 
			
		||||
						count++) 
 | 
			
		||||
						{
 | 
			
		||||
						ret=ECDSA_sign(0, buf, 20, 
 | 
			
		||||
							ecdsasig, &ecdsasiglen,
 | 
			
		||||
							ecdsa[j]);
 | 
			
		||||
						if (ret == 0) 
 | 
			
		||||
							{
 | 
			
		||||
							BIO_printf(bio_err, "ECDSA sign failure\n");
 | 
			
		||||
							ERR_print_errors(bio_err);
 | 
			
		||||
							count=1;
 | 
			
		||||
							break;
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					d=Time_F(STOP);
 | 
			
		||||
 | 
			
		||||
					BIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\n" :
 | 
			
		||||
						"%ld %d bit ECDSA signs in %.2fs \n", 
 | 
			
		||||
						count, test_curves_bits[j], d);
 | 
			
		||||
					ecdsa_results[j][0]=d/(double)count;
 | 
			
		||||
					rsa_count=count;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				/* Perform ECDSA verification test */
 | 
			
		||||
				ret=ECDSA_verify(0, buf, 20, ecdsasig, 
 | 
			
		||||
					ecdsasiglen, ecdsa[j]);
 | 
			
		||||
				if (ret != 1) 
 | 
			
		||||
					{
 | 
			
		||||
					BIO_printf(bio_err,"ECDSA verify failure.  No ECDSA verify will be done.\n");
 | 
			
		||||
					ERR_print_errors(bio_err);
 | 
			
		||||
					ecdsa_doit[j] = 0;
 | 
			
		||||
					} 
 | 
			
		||||
				else 
 | 
			
		||||
					{
 | 
			
		||||
					pkey_print_message("verify","ecdsa",
 | 
			
		||||
					ecdsa_c[j][1],
 | 
			
		||||
				pkey_print_message("sign","ecdsa",
 | 
			
		||||
					ecdsa_c[j][0], 
 | 
			
		||||
					test_curves_bits[j],
 | 
			
		||||
					ECDSA_SECONDS);
 | 
			
		||||
					Time_F(START);
 | 
			
		||||
					for (count=0,run=1; COND(ecdsa_c[j][1]); count++) 
 | 
			
		||||
						{
 | 
			
		||||
						ret=ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]);
 | 
			
		||||
						if (ret != 1) 
 | 
			
		||||
							{
 | 
			
		||||
							BIO_printf(bio_err, "ECDSA verify failure\n");
 | 
			
		||||
							ERR_print_errors(bio_err);
 | 
			
		||||
							count=1;
 | 
			
		||||
							break;
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					d=Time_F(STOP);
 | 
			
		||||
					BIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\n"
 | 
			
		||||
							: "%ld %d bit ECDSA verify in %.2fs\n",
 | 
			
		||||
					count, test_curves_bits[j], d);
 | 
			
		||||
					ecdsa_results[j][1]=d/(double)count;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				if (rsa_count <= 1) 
 | 
			
		||||
				Time_F(START);
 | 
			
		||||
				for (count=0,run=1; COND(ecdsa_c[j][0]);
 | 
			
		||||
					count++) 
 | 
			
		||||
					{
 | 
			
		||||
					/* if longer than 10s, don't do any more */
 | 
			
		||||
					for (j++; j<EC_NUM; j++)
 | 
			
		||||
					ecdsa_doit[j]=0;
 | 
			
		||||
					ret=ECDSA_sign(0, buf, 20, 
 | 
			
		||||
						ecdsasig, &ecdsasiglen,
 | 
			
		||||
						ecdsa[j]);
 | 
			
		||||
					if (ret == 0) 
 | 
			
		||||
						{
 | 
			
		||||
						BIO_printf(bio_err, "ECDSA sign failure\n");
 | 
			
		||||
						ERR_print_errors(bio_err);
 | 
			
		||||
						count=1;
 | 
			
		||||
						break;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				d=Time_F(STOP);
 | 
			
		||||
 | 
			
		||||
				BIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\n" :
 | 
			
		||||
					"%ld %d bit ECDSA signs in %.2fs \n", 
 | 
			
		||||
					count, test_curves_bits[j], d);
 | 
			
		||||
				ecdsa_results[j][0]=d/(double)count;
 | 
			
		||||
				rsa_count=count;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
			/* Perform ECDSA verification test */
 | 
			
		||||
			ret=ECDSA_verify(0, buf, 20, ecdsasig, 
 | 
			
		||||
				ecdsasiglen, ecdsa[j]);
 | 
			
		||||
			if (ret != 1) 
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"ECDSA verify failure.  No ECDSA verify will be done.\n");
 | 
			
		||||
				ERR_print_errors(bio_err);
 | 
			
		||||
				ecdsa_doit[j] = 0;
 | 
			
		||||
				} 
 | 
			
		||||
			else 
 | 
			
		||||
				{
 | 
			
		||||
				pkey_print_message("verify","ecdsa",
 | 
			
		||||
				ecdsa_c[j][1],
 | 
			
		||||
				test_curves_bits[j],
 | 
			
		||||
				ECDSA_SECONDS);
 | 
			
		||||
				Time_F(START);
 | 
			
		||||
				for (count=0,run=1; COND(ecdsa_c[j][1]); count++) 
 | 
			
		||||
					{
 | 
			
		||||
					ret=ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]);
 | 
			
		||||
					if (ret != 1) 
 | 
			
		||||
						{
 | 
			
		||||
						BIO_printf(bio_err, "ECDSA verify failure\n");
 | 
			
		||||
						ERR_print_errors(bio_err);
 | 
			
		||||
						count=1;
 | 
			
		||||
						break;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				d=Time_F(STOP);
 | 
			
		||||
				BIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\n"
 | 
			
		||||
						: "%ld %d bit ECDSA verify in %.2fs\n",
 | 
			
		||||
				count, test_curves_bits[j], d);
 | 
			
		||||
				ecdsa_results[j][1]=d/(double)count;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
			if (rsa_count <= 1) 
 | 
			
		||||
				{
 | 
			
		||||
				/* if longer than 10s, don't do any more */
 | 
			
		||||
				for (j++; j<EC_NUM; j++)
 | 
			
		||||
				ecdsa_doit[j]=0;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -2158,8 +2159,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	for (j=0; j<EC_NUM; j++)
 | 
			
		||||
		{
 | 
			
		||||
		if (!ecdh_doit[j]) continue;
 | 
			
		||||
		ecdh_a[j] = EC_KEY_new();
 | 
			
		||||
		ecdh_b[j] = EC_KEY_new();
 | 
			
		||||
		ecdh_a[j] = EC_KEY_new_by_curve_name(test_curves[j]);
 | 
			
		||||
		ecdh_b[j] = EC_KEY_new_by_curve_name(test_curves[j]);
 | 
			
		||||
		if ((ecdh_a[j] == NULL) || (ecdh_b[j] == NULL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"ECDH failure.\n");
 | 
			
		||||
@@ -2168,90 +2169,79 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			ecdh_a[j]->group = EC_GROUP_new_by_nid(test_curves[j]);
 | 
			
		||||
			if (ecdh_a[j]->group == NULL)
 | 
			
		||||
			/* generate two ECDH key pairs */
 | 
			
		||||
			if (!EC_KEY_generate_key(ecdh_a[j]) ||
 | 
			
		||||
				!EC_KEY_generate_key(ecdh_b[j]))
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"ECDH failure.\n");
 | 
			
		||||
				BIO_printf(bio_err,"ECDH key generation failure.\n");
 | 
			
		||||
				ERR_print_errors(bio_err);
 | 
			
		||||
				rsa_count=1;
 | 
			
		||||
				rsa_count=1;		
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				ecdh_b[j]->group = EC_GROUP_dup(ecdh_a[j]->group);
 | 
			
		||||
 | 
			
		||||
				/* generate two ECDH key pairs */
 | 
			
		||||
				if (!EC_KEY_generate_key(ecdh_a[j]) ||
 | 
			
		||||
					!EC_KEY_generate_key(ecdh_b[j]))
 | 
			
		||||
				/* If field size is not more than 24 octets, then use SHA-1 hash of result;
 | 
			
		||||
				 * otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt).
 | 
			
		||||
				 */
 | 
			
		||||
				int field_size, outlen;
 | 
			
		||||
				void *(*kdf)(const void *in, size_t inlen, void *out, size_t *xoutlen);
 | 
			
		||||
				field_size = EC_GROUP_get_degree(EC_KEY_get0_group(ecdh_a[j]));
 | 
			
		||||
				if (field_size <= 24 * 8)
 | 
			
		||||
					{
 | 
			
		||||
					BIO_printf(bio_err,"ECDH key generation failure.\n");
 | 
			
		||||
					ERR_print_errors(bio_err);
 | 
			
		||||
					rsa_count=1;		
 | 
			
		||||
					outlen = KDF1_SHA1_len;
 | 
			
		||||
					kdf = KDF1_SHA1;
 | 
			
		||||
					}
 | 
			
		||||
				else
 | 
			
		||||
					{
 | 
			
		||||
					/* If field size is not more than 24 octets, then use SHA-1 hash of result;
 | 
			
		||||
					 * otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt).
 | 
			
		||||
					 */
 | 
			
		||||
					int field_size, outlen;
 | 
			
		||||
					void *(*kdf)(const void *in, size_t inlen, void *out, size_t *xoutlen);
 | 
			
		||||
					field_size = EC_GROUP_get_degree(ecdh_a[j]->group);
 | 
			
		||||
					if (field_size <= 24 * 8)
 | 
			
		||||
						{
 | 
			
		||||
						outlen = KDF1_SHA1_len;
 | 
			
		||||
						kdf = KDF1_SHA1;
 | 
			
		||||
						}
 | 
			
		||||
					else
 | 
			
		||||
						{
 | 
			
		||||
						outlen = (field_size+7)/8;
 | 
			
		||||
						kdf = NULL;
 | 
			
		||||
						}
 | 
			
		||||
					secret_size_a = ECDH_compute_key(secret_a, outlen,
 | 
			
		||||
						ecdh_b[j]->pub_key,
 | 
			
		||||
						ecdh_a[j], kdf);
 | 
			
		||||
					secret_size_b = ECDH_compute_key(secret_b, outlen,
 | 
			
		||||
						ecdh_a[j]->pub_key,
 | 
			
		||||
						ecdh_b[j], kdf);
 | 
			
		||||
					if (secret_size_a != secret_size_b) 
 | 
			
		||||
						ecdh_checks = 0;
 | 
			
		||||
					else
 | 
			
		||||
						ecdh_checks = 1;
 | 
			
		||||
 | 
			
		||||
					for (secret_idx = 0; 
 | 
			
		||||
					    (secret_idx < secret_size_a)
 | 
			
		||||
						&& (ecdh_checks == 1);
 | 
			
		||||
					    secret_idx++)
 | 
			
		||||
						{
 | 
			
		||||
						if (secret_a[secret_idx] != secret_b[secret_idx])
 | 
			
		||||
						ecdh_checks = 0;
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
					if (ecdh_checks == 0)
 | 
			
		||||
						{
 | 
			
		||||
						BIO_printf(bio_err,"ECDH computations don't match.\n");
 | 
			
		||||
						ERR_print_errors(bio_err);
 | 
			
		||||
						rsa_count=1;		
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
					pkey_print_message("","ecdh",
 | 
			
		||||
					ecdh_c[j][0], 
 | 
			
		||||
					test_curves_bits[j],
 | 
			
		||||
					ECDH_SECONDS);
 | 
			
		||||
					Time_F(START);
 | 
			
		||||
					for (count=0,run=1; COND(ecdh_c[j][0]); count++)
 | 
			
		||||
						{
 | 
			
		||||
						ECDH_compute_key(secret_a, outlen,
 | 
			
		||||
						ecdh_b[j]->pub_key,
 | 
			
		||||
						ecdh_a[j], kdf);
 | 
			
		||||
						}
 | 
			
		||||
					d=Time_F(STOP);
 | 
			
		||||
					BIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\n" :"%ld %d-bit ECDH ops in %.2fs\n",
 | 
			
		||||
					count, test_curves_bits[j], d);
 | 
			
		||||
					ecdh_results[j][0]=d/(double)count;
 | 
			
		||||
					rsa_count=count;
 | 
			
		||||
					outlen = (field_size+7)/8;
 | 
			
		||||
					kdf = NULL;
 | 
			
		||||
					}
 | 
			
		||||
				secret_size_a = ECDH_compute_key(secret_a, outlen,
 | 
			
		||||
					EC_KEY_get0_public_key(ecdh_b[j]),
 | 
			
		||||
					ecdh_a[j], kdf);
 | 
			
		||||
				secret_size_b = ECDH_compute_key(secret_b, outlen,
 | 
			
		||||
					EC_KEY_get0_public_key(ecdh_a[j]),
 | 
			
		||||
					ecdh_b[j], kdf);
 | 
			
		||||
				if (secret_size_a != secret_size_b) 
 | 
			
		||||
					ecdh_checks = 0;
 | 
			
		||||
				else
 | 
			
		||||
					ecdh_checks = 1;
 | 
			
		||||
 | 
			
		||||
				for (secret_idx = 0; 
 | 
			
		||||
				    (secret_idx < secret_size_a)
 | 
			
		||||
					&& (ecdh_checks == 1);
 | 
			
		||||
				    secret_idx++)
 | 
			
		||||
					{
 | 
			
		||||
					if (secret_a[secret_idx] != secret_b[secret_idx])
 | 
			
		||||
					ecdh_checks = 0;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				if (ecdh_checks == 0)
 | 
			
		||||
					{
 | 
			
		||||
					BIO_printf(bio_err,"ECDH computations don't match.\n");
 | 
			
		||||
					ERR_print_errors(bio_err);
 | 
			
		||||
					rsa_count=1;		
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				pkey_print_message("","ecdh",
 | 
			
		||||
				ecdh_c[j][0], 
 | 
			
		||||
				test_curves_bits[j],
 | 
			
		||||
				ECDH_SECONDS);
 | 
			
		||||
				Time_F(START);
 | 
			
		||||
				for (count=0,run=1; COND(ecdh_c[j][0]); count++)
 | 
			
		||||
					{
 | 
			
		||||
					ECDH_compute_key(secret_a, outlen,
 | 
			
		||||
					EC_KEY_get0_public_key(ecdh_b[j]),
 | 
			
		||||
					ecdh_a[j], kdf);
 | 
			
		||||
					}
 | 
			
		||||
				d=Time_F(STOP);
 | 
			
		||||
				BIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\n" :"%ld %d-bit ECDH ops in %.2fs\n",
 | 
			
		||||
				count, test_curves_bits[j], d);
 | 
			
		||||
				ecdh_results[j][0]=d/(double)count;
 | 
			
		||||
				rsa_count=count;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		if (rsa_count <= 1)
 | 
			
		||||
			{
 | 
			
		||||
			/* if longer than 10s, don't do any more */
 | 
			
		||||
@@ -2365,7 +2355,7 @@ show_res:
 | 
			
		||||
				k,rsa_bits[k],rsa_results[k][0],
 | 
			
		||||
				rsa_results[k][1]);
 | 
			
		||||
		else
 | 
			
		||||
			fprintf(stdout,"rsa %4u bits %8.4fs %8.4fs %8.1f %8.1f\n",
 | 
			
		||||
			fprintf(stdout,"rsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
 | 
			
		||||
				rsa_bits[k],rsa_results[k][0],rsa_results[k][1],
 | 
			
		||||
				1.0/rsa_results[k][0],1.0/rsa_results[k][1]);
 | 
			
		||||
		}
 | 
			
		||||
@@ -2384,7 +2374,7 @@ show_res:
 | 
			
		||||
			fprintf(stdout,"+F3:%u:%u:%f:%f\n",
 | 
			
		||||
				k,dsa_bits[k],dsa_results[k][0],dsa_results[k][1]);
 | 
			
		||||
		else
 | 
			
		||||
			fprintf(stdout,"dsa %4u bits %8.4fs %8.4fs %8.1f %8.1f\n",
 | 
			
		||||
			fprintf(stdout,"dsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
 | 
			
		||||
				dsa_bits[k],dsa_results[k][0],dsa_results[k][1],
 | 
			
		||||
				1.0/dsa_results[k][0],1.0/dsa_results[k][1]);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,18 +0,0 @@
 | 
			
		||||
Microsoft (R) C/C++ Optimizing Compiler Version 8.00c
 | 
			
		||||
 | 
			
		||||
Compile with /O2 chokes the compiler on these files
 | 
			
		||||
 | 
			
		||||
crypto\md\md5_dgst.c		warning '@(#)reg86.c:1.26', line 1110
 | 
			
		||||
crypto\des\ofb64ede.c		warning '@(#)grammar.c:1.147', line 168
 | 
			
		||||
crypto\des\ofb64enc.c		warning '@(#)grammar.c:1.147', line 168
 | 
			
		||||
crypto\des\qud_cksm.c		warning '@(#)grammar.c:1.147', line 168
 | 
			
		||||
crypto\rc2\rc2ofb64.c		warning '@(#)grammar.c:1.147', line 168
 | 
			
		||||
crypto\objects\obj_dat.c	warning	'@(#)grammar.c:1.147', line 168
 | 
			
		||||
				fatal	'@(#)grammar.c:1.147', line 168
 | 
			
		||||
crypto\objects\obj_lib.c	warning	'@(#)grammar.c:1.147', line 168
 | 
			
		||||
				fatal	'@(#)grammar.c:1.147', line 168
 | 
			
		||||
ssl\ssl_auth.c			warning	'@(#)grammar.c:1.147', line 168
 | 
			
		||||
				fatal	'@(#)grammar.c:1.147', line 168
 | 
			
		||||
 | 
			
		||||
Turning on /G3 with build flags that worked fine for /G2 came up with
 | 
			
		||||
divide by zero errors in 'normal' code in speed.c :-(
 | 
			
		||||
							
								
								
									
										7
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								config
									
									
									
									
									
								
							@@ -647,11 +647,14 @@ case "$GUESSOS" in
 | 
			
		||||
	    OUT="solaris64-x86_64-$CC"
 | 
			
		||||
	else
 | 
			
		||||
	    OUT="solaris-x86-$CC"
 | 
			
		||||
	    if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
 | 
			
		||||
		options="$options no-sse2"
 | 
			
		||||
	    fi
 | 
			
		||||
	fi
 | 
			
		||||
	;;
 | 
			
		||||
  *-*-sunos4)		OUT="sunos-$CC" ;;
 | 
			
		||||
 | 
			
		||||
  *86*-*-bsdi4)		OUT="bsdi-elf-gcc" ;;
 | 
			
		||||
  *86*-*-bsdi4)		OUT="bsdi-elf-gcc"; options="$options no-sse2" ;;
 | 
			
		||||
  alpha*-*-*bsd*)	OUT="BSD-generic64; options="$options -DL_ENDIAN" ;;
 | 
			
		||||
  powerpc64-*-*bsd*)	OUT="BSD-generic64; options="$options -DB_ENDIAN" ;;
 | 
			
		||||
  sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
 | 
			
		||||
@@ -659,7 +662,7 @@ case "$GUESSOS" in
 | 
			
		||||
  amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
 | 
			
		||||
  *86*-*-*bsd*)		case "`(file -L /usr/lib/libc.so.*) 2>/dev/null`" in
 | 
			
		||||
			*ELF*)	OUT="BSD-x86-elf" ;;
 | 
			
		||||
			*)	OUT="BSD-x86" ;;
 | 
			
		||||
			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
 | 
			
		||||
			esac ;;
 | 
			
		||||
  *-*-*bsd*)		OUT="BSD-generic32" ;;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,12 +6,9 @@ DIR=		crypto
 | 
			
		||||
TOP=		..
 | 
			
		||||
CC=		cc
 | 
			
		||||
INCLUDE=	-I. -I$(TOP) -I../include
 | 
			
		||||
# INCLUDES targets sudbirs!
 | 
			
		||||
INCLUDES=	-I.. -I../.. -I../../include
 | 
			
		||||
CFLAG=		-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=	/usr/local/ssl
 | 
			
		||||
MAKE=           make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=       Makefile
 | 
			
		||||
@@ -70,22 +67,28 @@ x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
 | 
			
		||||
x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
 | 
			
		||||
	$(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
 | 
			
		||||
 | 
			
		||||
uplink.o:	../ms/uplink.c
 | 
			
		||||
	$(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c
 | 
			
		||||
 | 
			
		||||
uplink-cof.s:	../ms/uplink.pl
 | 
			
		||||
	$(PERL) ../ms/uplink.pl coff > $@
 | 
			
		||||
 | 
			
		||||
x86_64cpuid.s: x86_64cpuid.pl
 | 
			
		||||
	$(PERL) x86_64cpuid.pl $@
 | 
			
		||||
ia64cpuid.s: ia64cpuid.S
 | 
			
		||||
	$(CC) $(CFLAGS) -E ia64cpuid.S > $@
 | 
			
		||||
 | 
			
		||||
testapps:
 | 
			
		||||
	if echo ${SDIRS} | fgrep ' des '; \
 | 
			
		||||
	then cd des && $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' des; fi
 | 
			
		||||
	if echo ${SDIRS} | fgrep ' pkcs7 '; \
 | 
			
		||||
	then cd pkcs7 && $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' testapps; fi
 | 
			
		||||
	[ -z "$(THIS)" ] || ( if echo ${SDIRS} | fgrep ' des '; \
 | 
			
		||||
	then cd des && $(MAKE) des; fi )
 | 
			
		||||
	[ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) testapps );
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
 | 
			
		||||
 | 
			
		||||
subdirs:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making all in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) -e INCLUDES='${INCLUDES}' all ) || exit 1; \
 | 
			
		||||
	$(MAKE) $(BUILDENV) INCLUDES='${INCLUDES}' all ) || exit 1; \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
files:
 | 
			
		||||
@@ -93,7 +96,7 @@ files:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making 'files' in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) PERL='${PERL}' files ); \
 | 
			
		||||
	$(MAKE) files ); \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
links:
 | 
			
		||||
@@ -101,8 +104,8 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
 | 
			
		||||
	@for i in $(SDIRS); do \
 | 
			
		||||
	(cd $$i && echo "making links in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
 | 
			
		||||
	    (cd $$i && echo "making links in crypto/$$i..." && \
 | 
			
		||||
	    $(MAKE) links ); \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
@@ -119,17 +122,19 @@ libs:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making libs in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
 | 
			
		||||
	$(MAKE) lib );
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
tests:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	@[ -z "$(THIS)" ] || (for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making tests in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
 | 
			
		||||
	done;
 | 
			
		||||
	$(MAKE) tests ); \
 | 
			
		||||
	done; )
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -138,32 +143,34 @@ install:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making install in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}'  INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
 | 
			
		||||
	$(MAKE) install ); \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
lint:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making lint in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
 | 
			
		||||
	$(MAKE) lint ); \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	if [ ! -f buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
	if [ ! -s buildinf.h ]; then rm buildinf.h; fi
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making depend in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ); \
 | 
			
		||||
	done;
 | 
			
		||||
	[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
 | 
			
		||||
	[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
	[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
 | 
			
		||||
	@[ -z "$(THIS)" ] || (set -e; \
 | 
			
		||||
	for i in $(SDIRS) ; do \
 | 
			
		||||
	    (	cd $$i && echo "making depend in crypto/$$i..." && \
 | 
			
		||||
		$(MAKE) INCLUDES='${INCLUDES}' depend \
 | 
			
		||||
	    ); \
 | 
			
		||||
	done; )
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making clean in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
 | 
			
		||||
	$(MAKE) clean ); \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
@@ -172,7 +179,7 @@ dclean:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i && echo "making dclean in crypto/$$i..." && \
 | 
			
		||||
	$(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
 | 
			
		||||
	$(MAKE) dclean ); \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,6 @@ CC=	cc
 | 
			
		||||
CPP=	$(CC) -E
 | 
			
		||||
INCLUDES=
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=	/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -69,9 +63,8 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install: installs
 | 
			
		||||
 | 
			
		||||
installs:
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -87,6 +80,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -426,7 +426,7 @@ sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
 | 
			
		||||
#rcon:
 | 
			
		||||
	&data_word(0x00000001, 0x00000002, 0x00000004, 0x00000008);
 | 
			
		||||
	&data_word(0x00000010, 0x00000020, 0x00000040, 0x00000080);
 | 
			
		||||
	&data_word(0x0000001b, 0x00000036);
 | 
			
		||||
	&data_word(0x0000001b, 0x00000036, 0, 0, 0, 0, 0, 0);
 | 
			
		||||
&function_end_B("_x86_AES_encrypt");
 | 
			
		||||
 | 
			
		||||
# void AES_encrypt (const void *inp,void *out,const AES_KEY *key);
 | 
			
		||||
@@ -826,7 +826,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
	&lea    ("ebp",&DWP(&label("AES_Te")."-".&label("pic_point"),"ebp"));
 | 
			
		||||
 | 
			
		||||
	# allocate aligned stack frame...
 | 
			
		||||
	&lea	($key,&DWP(-64-260,"esp"));
 | 
			
		||||
	&lea	($key,&DWP(-64-244,"esp"));
 | 
			
		||||
	&and	($key,-64);
 | 
			
		||||
 | 
			
		||||
	# ... and make sure it doesn't alias with AES_Te modulo 4096
 | 
			
		||||
@@ -845,7 +845,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
	&set_label("te_break_out");	# else %esp -= (p-s)&0xfff + framesz;
 | 
			
		||||
	&sub	($s3,$s0);
 | 
			
		||||
	&and	($s3,0xfff);
 | 
			
		||||
	&add	($s3,64+320);
 | 
			
		||||
	&add	($s3,64+256);
 | 
			
		||||
	&sub	($key,$s3);
 | 
			
		||||
	&align	(4);
 | 
			
		||||
	&set_label("te_ok");
 | 
			
		||||
@@ -870,7 +870,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
		&jb	(&label("skip_ecopy"));
 | 
			
		||||
	}
 | 
			
		||||
	# copy key schedule to stack
 | 
			
		||||
	&mov	("ecx",260/4);
 | 
			
		||||
	&mov	("ecx",244/4);
 | 
			
		||||
	&mov	("esi",$s3);
 | 
			
		||||
	&lea	("edi",$aes_key);
 | 
			
		||||
	&mov	($_key,"edi");
 | 
			
		||||
@@ -949,7 +949,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
		&jb	(&label("skip_ezero"));
 | 
			
		||||
	}
 | 
			
		||||
	# zero copy of key schedule
 | 
			
		||||
	&mov	("ecx",256/4);
 | 
			
		||||
	&mov	("ecx",240/4);
 | 
			
		||||
	&xor	("eax","eax");
 | 
			
		||||
	&align	(4);
 | 
			
		||||
	&data_word(0xF689ABF3);	# rep stosd
 | 
			
		||||
@@ -991,7 +991,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
	&lea    ("ebp",&DWP(&label("AES_Td")."-".&label("pic_point"),"ebp"));
 | 
			
		||||
 | 
			
		||||
	# allocate aligned stack frame...
 | 
			
		||||
	&lea	($key,&DWP(-64-260,"esp"));
 | 
			
		||||
	&lea	($key,&DWP(-64-244,"esp"));
 | 
			
		||||
	&and	($key,-64);
 | 
			
		||||
 | 
			
		||||
	# ... and make sure it doesn't alias with AES_Td modulo 4096
 | 
			
		||||
@@ -1010,7 +1010,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
	&set_label("td_break_out");	# else %esp -= (p-s)&0xfff + framesz;
 | 
			
		||||
	&sub	($s3,$s0);
 | 
			
		||||
	&and	($s3,0xfff);
 | 
			
		||||
	&add	($s3,64+320);
 | 
			
		||||
	&add	($s3,64+256);
 | 
			
		||||
	&sub	($key,$s3);
 | 
			
		||||
	&align	(4);
 | 
			
		||||
	&set_label("td_ok");
 | 
			
		||||
@@ -1035,7 +1035,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
		&jb	(&label("skip_dcopy"));
 | 
			
		||||
	}
 | 
			
		||||
	# copy key schedule to stack
 | 
			
		||||
	&mov	("ecx",260/4);
 | 
			
		||||
	&mov	("ecx",244/4);
 | 
			
		||||
	&mov	("esi",$s3);
 | 
			
		||||
	&lea	("edi",$aes_key);
 | 
			
		||||
	&mov	($_key,"edi");
 | 
			
		||||
@@ -1199,7 +1199,7 @@ my $aes_key=&DWP(60,"esp");	#copy of aes_key
 | 
			
		||||
	&jb	(&label("skip_dzero"));
 | 
			
		||||
    }
 | 
			
		||||
    # zero copy of key schedule
 | 
			
		||||
    &mov	("ecx",256/4);
 | 
			
		||||
    &mov	("ecx",240/4);
 | 
			
		||||
    &xor	("eax","eax");
 | 
			
		||||
    &align	(4);
 | 
			
		||||
    &data_word(0xF689ABF3);	# rep stosd
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -82,6 +76,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -97,6 +92,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +127,7 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x)
 | 
			
		||||
 | 
			
		||||
        if ((b=BIO_new(BIO_s_file())) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_D2I_FP,ERR_R_BUF_LIB);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_D2I_FP,ERR_R_BUF_LIB);
 | 
			
		||||
                return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
        BIO_set_fp(b,in,BIO_NOCLOSE);
 | 
			
		||||
@@ -158,7 +158,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
	b=BUF_MEM_new();
 | 
			
		||||
	if (b == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -171,13 +171,13 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
 | 
			
		||||
			if (!BUF_MEM_grow_clean(b,len+want))
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			i=BIO_read(in,&(b->data[len]),want);
 | 
			
		||||
			if ((i < 0) && ((len-off) == 0))
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_BIO,ASN1_R_NOT_ENOUGH_DATA);
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_NOT_ENOUGH_DATA);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			if (i > 0)
 | 
			
		||||
@@ -226,7 +226,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
				want-=(len-off);
 | 
			
		||||
				if (!BUF_MEM_grow_clean(b,len+want))
 | 
			
		||||
					{
 | 
			
		||||
					ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
					ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
					goto err;
 | 
			
		||||
					}
 | 
			
		||||
				while (want > 0)
 | 
			
		||||
@@ -234,7 +234,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
					i=BIO_read(in,&(b->data[len]),want);
 | 
			
		||||
					if (i <= 0)
 | 
			
		||||
						{
 | 
			
		||||
						ASN1err(ASN1_F_ASN1_D2I_BIO,
 | 
			
		||||
						ASN1err(ASN1_F_ASN1_D2I_READ_BIO,
 | 
			
		||||
						    ASN1_R_NOT_ENOUGH_DATA);
 | 
			
		||||
						goto err;
 | 
			
		||||
						}
 | 
			
		||||
 
 | 
			
		||||
@@ -101,7 +101,7 @@ void *ASN1_item_dup(const ASN1_ITEM *it, void *x)
 | 
			
		||||
 | 
			
		||||
	i=ASN1_item_i2d(x,&b,it);
 | 
			
		||||
	if (b == NULL)
 | 
			
		||||
		{ ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
 | 
			
		||||
		{ ASN1err(ASN1_F_ASN1_ITEM_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
 | 
			
		||||
	p= b;
 | 
			
		||||
	ret=ASN1_item_d2i(NULL,&p,i, it);
 | 
			
		||||
	OPENSSL_free(b);
 | 
			
		||||
 
 | 
			
		||||
@@ -124,7 +124,7 @@ int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x)
 | 
			
		||||
 | 
			
		||||
        if ((b=BIO_new(BIO_s_file())) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_I2D_FP,ERR_R_BUF_LIB);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_I2D_FP,ERR_R_BUF_LIB);
 | 
			
		||||
                return(0);
 | 
			
		||||
		}
 | 
			
		||||
        BIO_set_fp(b,out,BIO_NOCLOSE);
 | 
			
		||||
@@ -142,7 +142,7 @@ int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x)
 | 
			
		||||
	n = ASN1_item_i2d(x, &b, it);
 | 
			
		||||
	if (b == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_I2D_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_I2D_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -256,7 +256,7 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
 | 
			
		||||
	*pp=pend;
 | 
			
		||||
	return(ret);
 | 
			
		||||
err:
 | 
			
		||||
	ASN1err(ASN1_F_D2I_ASN1_INTEGER,i);
 | 
			
		||||
	ASN1err(ASN1_F_C2I_ASN1_INTEGER,i);
 | 
			
		||||
	if ((ret != NULL) && ((a == NULL) || (*a != ret)))
 | 
			
		||||
		M_ASN1_INTEGER_free(ret);
 | 
			
		||||
	return(NULL);
 | 
			
		||||
 
 | 
			
		||||
@@ -107,7 +107,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
 | 
			
		||||
		case MBSTRING_BMP:
 | 
			
		||||
		if(len & 1) {
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,
 | 
			
		||||
					 ASN1_R_INVALID_BMPSTRING_LENGTH);
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -116,7 +116,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
 | 
			
		||||
		case MBSTRING_UNIV:
 | 
			
		||||
		if(len & 3) {
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,
 | 
			
		||||
					 ASN1_R_INVALID_UNIVERSALSTRING_LENGTH);
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -128,7 +128,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
		/* This counts the characters and does utf8 syntax checking */
 | 
			
		||||
		ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar);
 | 
			
		||||
		if(ret < 0) {
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,
 | 
			
		||||
						 ASN1_R_INVALID_UTF8STRING);
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -139,19 +139,19 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		default:
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_UNKNOWN_FORMAT);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_UNKNOWN_FORMAT);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if((minsize > 0) && (nchar < minsize)) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_SHORT);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_SHORT);
 | 
			
		||||
		BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
 | 
			
		||||
		ERR_add_error_data(2, "minsize=", strbuf);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if((maxsize > 0) && (nchar > maxsize)) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_LONG);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_LONG);
 | 
			
		||||
		BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
 | 
			
		||||
		ERR_add_error_data(2, "maxsize=", strbuf);
 | 
			
		||||
		return -1;
 | 
			
		||||
@@ -159,7 +159,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
 | 
			
		||||
	/* Now work out minimal type (if any) */
 | 
			
		||||
	if(traverse_string(in, len, inform, type_str, &mask) < 0) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_ILLEGAL_CHARACTERS);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_ILLEGAL_CHARACTERS);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -193,7 +193,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
		free_out = 1;
 | 
			
		||||
		dest = ASN1_STRING_type_new(str_type);
 | 
			
		||||
		if(!dest) {
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,
 | 
			
		||||
							ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -202,7 +202,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
	/* If both the same type just copy across */
 | 
			
		||||
	if(inform == outform) {
 | 
			
		||||
		if(!ASN1_STRING_set(dest, in, len)) {
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_COPY,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return -1;
 | 
			
		||||
		}
 | 
			
		||||
		return str_type;
 | 
			
		||||
@@ -233,7 +233,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 | 
			
		||||
	}
 | 
			
		||||
	if(!(p = OPENSSL_malloc(outlen + 1))) {
 | 
			
		||||
		if(free_out) ASN1_STRING_free(dest);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_COPY,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
	dest->length = outlen;
 | 
			
		||||
 
 | 
			
		||||
@@ -255,7 +255,7 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
 | 
			
		||||
	*pp=p;
 | 
			
		||||
	return(ret);
 | 
			
		||||
err:
 | 
			
		||||
	ASN1err(ASN1_F_D2I_ASN1_OBJECT,i);
 | 
			
		||||
	ASN1err(ASN1_F_C2I_ASN1_OBJECT,i);
 | 
			
		||||
	if ((ret != NULL) && ((a == NULL) || (*a != ret)))
 | 
			
		||||
		ASN1_OBJECT_free(ret);
 | 
			
		||||
	return(NULL);
 | 
			
		||||
 
 | 
			
		||||
@@ -248,12 +248,12 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
 | 
			
		||||
		a->algorithm=OBJ_nid2obj(type->pkey_type);
 | 
			
		||||
		if (a->algorithm == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_UNKNOWN_OBJECT_TYPE);
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_ITEM_SIGN,ASN1_R_UNKNOWN_OBJECT_TYPE);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		if (a->algorithm->length == 0)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD);
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_ITEM_SIGN,ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -263,7 +263,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
 | 
			
		||||
	if ((buf_in == NULL) || (buf_out == NULL))
 | 
			
		||||
		{
 | 
			
		||||
		outl=0;
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_SIGN,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_SIGN,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -273,7 +273,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
 | 
			
		||||
			(unsigned int *)&outl,pkey))
 | 
			
		||||
		{
 | 
			
		||||
		outl=0;
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_SIGN,ERR_R_EVP_LIB);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	if (signature->data != NULL) OPENSSL_free(signature->data);
 | 
			
		||||
 
 | 
			
		||||
@@ -58,12 +58,12 @@
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/asn1.h>
 | 
			
		||||
 | 
			
		||||
#include "charmap.h"
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
 | 
			
		||||
/* ASN1_STRING_print_ex() and X509_NAME_print_ex().
 | 
			
		||||
 * Enhanced string and name printing routines handling
 | 
			
		||||
@@ -513,7 +513,7 @@ int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags)
 | 
			
		||||
	return do_name_ex(send_bio_chars, out, nm, indent, flags);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_FP_API
 | 
			
		||||
int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags)
 | 
			
		||||
{
 | 
			
		||||
	if(flags == XN_FLAG_COMPAT)
 | 
			
		||||
@@ -528,17 +528,19 @@ int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long fla
 | 
			
		||||
		}
 | 
			
		||||
	return do_name_ex(send_fp_chars, fp, nm, indent, flags);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags)
 | 
			
		||||
{
 | 
			
		||||
	return do_print_ex(send_bio_chars, out, flags, str);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_FP_API
 | 
			
		||||
int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags)
 | 
			
		||||
{
 | 
			
		||||
	return do_print_ex(send_fp_chars, fp, flags, str);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Utility function: convert any string type to UTF8, returns number of bytes
 | 
			
		||||
 * in output string or a negative error code
 | 
			
		||||
 
 | 
			
		||||
@@ -57,8 +57,8 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <openssl/asn1t.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/asn1t.h>
 | 
			
		||||
 | 
			
		||||
int ASN1_TYPE_get(ASN1_TYPE *a)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -138,13 +138,13 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat
 | 
			
		||||
	type=EVP_get_digestbyname(OBJ_nid2sn(i));
 | 
			
		||||
	if (type == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!EVP_VerifyInit_ex(&ctx,type, NULL))
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB);
 | 
			
		||||
		ret=0;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
@@ -153,7 +153,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat
 | 
			
		||||
	
 | 
			
		||||
	if (buf_in == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -165,7 +165,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat
 | 
			
		||||
	if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data,
 | 
			
		||||
			(unsigned int)signature->length,pkey) <= 0)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB);
 | 
			
		||||
		ret=0;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -901,22 +901,22 @@ int ASN1_object_size(int constructed, int length, int tag);
 | 
			
		||||
/* Used to implement other functions */
 | 
			
		||||
void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
 | 
			
		||||
#define ASN1_dup_of(type,i2d,d2i,x) \
 | 
			
		||||
	((type *(*)(I2D_OF(type),D2I_OF(type),type *))ASN1_dup)(i2d,d2i,x)
 | 
			
		||||
	((type *(*)(I2D_OF(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
 | 
			
		||||
#define ASN1_dup_of_const(type,i2d,d2i,x) \
 | 
			
		||||
	((type *(*)(I2D_OF_const(type),D2I_OF(type),type *))ASN1_dup)(i2d,d2i,x)
 | 
			
		||||
	((type *(*)(I2D_OF_const(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
 | 
			
		||||
 | 
			
		||||
void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_FP_API
 | 
			
		||||
void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x);
 | 
			
		||||
#define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
 | 
			
		||||
	((type *(*)(type *(*)(void),D2I_OF(type),FILE *,type **))ASN1_d2i_fp)(xnew,d2i,in,x)
 | 
			
		||||
	((type *(*)(type *(*)(void),D2I_OF(type),FILE *,type **))openssl_fcast(ASN1_d2i_fp))(xnew,d2i,in,x)
 | 
			
		||||
void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
 | 
			
		||||
int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x);
 | 
			
		||||
#define ASN1_i2d_fp_of(type,i2d,out,x) \
 | 
			
		||||
	((int (*)(I2D_OF(type),FILE *,type *))ASN1_i2d_fp)(i2d,out,x)
 | 
			
		||||
	((int (*)(I2D_OF(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
 | 
			
		||||
#define ASN1_i2d_fp_of_const(type,i2d,out,x) \
 | 
			
		||||
	((int (*)(I2D_OF_const(type),FILE *,type *))ASN1_i2d_fp)(i2d,out,x)
 | 
			
		||||
	((int (*)(I2D_OF_const(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
 | 
			
		||||
int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
 | 
			
		||||
int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -926,13 +926,13 @@ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
 | 
			
		||||
#ifndef OPENSSL_NO_BIO
 | 
			
		||||
void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x);
 | 
			
		||||
#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
 | 
			
		||||
	((type *(*)(type *(*)(void),D2I_OF(type),BIO *,type **))ASN1_d2i_bio)(xnew,d2i,in,x)
 | 
			
		||||
	((type *(*)(type *(*)(void),D2I_OF(type),BIO *,type **))openssl_fcast(ASN1_d2i_bio))(xnew,d2i,in,x)
 | 
			
		||||
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
 | 
			
		||||
int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x);
 | 
			
		||||
#define ASN1_i2d_bio_of(type,i2d,out,x) \
 | 
			
		||||
	((int (*)(I2D_OF(type),BIO *,type *))ASN1_i2d_bio)(i2d,out,x)
 | 
			
		||||
	((int (*)(I2D_OF(type),BIO *,type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
 | 
			
		||||
#define ASN1_i2d_bio_of_const(type,i2d,out,x) \
 | 
			
		||||
	((int (*)(I2D_OF_const(type),BIO *,type *))ASN1_i2d_bio)(i2d,out,x)
 | 
			
		||||
	((int (*)(I2D_OF_const(type),BIO *,const type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
 | 
			
		||||
int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
 | 
			
		||||
int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
 | 
			
		||||
int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
 | 
			
		||||
@@ -976,7 +976,7 @@ void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
 | 
			
		||||
ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
 | 
			
		||||
			      ASN1_OCTET_STRING **oct);
 | 
			
		||||
#define ASN1_pack_string_of(type,obj,i2d,oct) \
 | 
			
		||||
	((ASN1_STRING *(*)(type *,I2D_OF(type),ASN1_OCTET_STRING **))ASN1_pack_string)(obj,i2d,oct)
 | 
			
		||||
	((ASN1_STRING *(*)(type *,I2D_OF(type),ASN1_OCTET_STRING **))openssl_fcast(ASN1_pack_string))(obj,i2d,oct)
 | 
			
		||||
ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
 | 
			
		||||
 | 
			
		||||
void ASN1_STRING_set_default_mask(unsigned long mask);
 | 
			
		||||
@@ -1021,20 +1021,21 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_F_A2I_ASN1_ENUMERATED			 101
 | 
			
		||||
#define ASN1_F_A2I_ASN1_INTEGER				 102
 | 
			
		||||
#define ASN1_F_A2I_ASN1_STRING				 103
 | 
			
		||||
#define ASN1_F_APPEND_TAG				 176
 | 
			
		||||
#define ASN1_F_APPEND_EXP				 176
 | 
			
		||||
#define ASN1_F_ASN1_BIT_STRING_SET_BIT			 183
 | 
			
		||||
#define ASN1_F_ASN1_CB					 177
 | 
			
		||||
#define ASN1_F_ASN1_CHECK_TLEN				 104
 | 
			
		||||
#define ASN1_F_ASN1_COLLATE_PRIMITIVE			 105
 | 
			
		||||
#define ASN1_F_ASN1_COLLECT				 106
 | 
			
		||||
#define ASN1_F_ASN1_D2I_BIO				 107
 | 
			
		||||
#define ASN1_F_ASN1_D2I_EX_PRIMITIVE			 108
 | 
			
		||||
#define ASN1_F_ASN1_D2I_FP				 109
 | 
			
		||||
#define ASN1_F_ASN1_D2I_READ_BIO			 107
 | 
			
		||||
#define ASN1_F_ASN1_DIGEST				 184
 | 
			
		||||
#define ASN1_F_ASN1_DO_ADB				 110
 | 
			
		||||
#define ASN1_F_ASN1_DUP					 111
 | 
			
		||||
#define ASN1_F_ASN1_ENUMERATED_SET			 112
 | 
			
		||||
#define ASN1_F_ASN1_ENUMERATED_TO_BN			 113
 | 
			
		||||
#define ASN1_F_ASN1_EX_C2I				 204
 | 
			
		||||
#define ASN1_F_ASN1_FIND_END				 190
 | 
			
		||||
#define ASN1_F_ASN1_GENERALIZEDTIME_SET			 185
 | 
			
		||||
#define ASN1_F_ASN1_GENERATE_V3				 178
 | 
			
		||||
@@ -1044,12 +1045,20 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_F_ASN1_I2D_FP				 117
 | 
			
		||||
#define ASN1_F_ASN1_INTEGER_SET				 118
 | 
			
		||||
#define ASN1_F_ASN1_INTEGER_TO_BN			 119
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_D2I_FP				 190
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_DUP				 191
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW			 121
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_EX_D2I				 120
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_NEW				 121
 | 
			
		||||
#define ASN1_F_ASN1_MBSTRING_COPY			 122
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_I2D_BIO			 192
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_I2D_FP				 193
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_PACK				 198
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_SIGN				 195
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_UNPACK				 199
 | 
			
		||||
#define ASN1_F_ASN1_ITEM_VERIFY				 197
 | 
			
		||||
#define ASN1_F_ASN1_MBSTRING_NCOPY			 122
 | 
			
		||||
#define ASN1_F_ASN1_OBJECT_NEW				 123
 | 
			
		||||
#define ASN1_F_ASN1_PACK_STRING				 124
 | 
			
		||||
#define ASN1_F_ASN1_PBE_SET				 125
 | 
			
		||||
#define ASN1_F_ASN1_PKCS5_PBE_SET			 125
 | 
			
		||||
#define ASN1_F_ASN1_SEQ_PACK				 126
 | 
			
		||||
#define ASN1_F_ASN1_SEQ_UNPACK				 127
 | 
			
		||||
#define ASN1_F_ASN1_SIGN				 128
 | 
			
		||||
@@ -1057,9 +1066,9 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_F_ASN1_STRING_SET				 186
 | 
			
		||||
#define ASN1_F_ASN1_STRING_TABLE_ADD			 129
 | 
			
		||||
#define ASN1_F_ASN1_STRING_TYPE_NEW			 130
 | 
			
		||||
#define ASN1_F_ASN1_TEMPLATE_D2I			 131
 | 
			
		||||
#define ASN1_F_ASN1_TEMPLATE_EX_D2I			 132
 | 
			
		||||
#define ASN1_F_ASN1_TEMPLATE_NEW			 133
 | 
			
		||||
#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I			 131
 | 
			
		||||
#define ASN1_F_ASN1_TIME_SET				 175
 | 
			
		||||
#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING		 134
 | 
			
		||||
#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING		 135
 | 
			
		||||
@@ -1070,6 +1079,8 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_F_BN_TO_ASN1_ENUMERATED			 138
 | 
			
		||||
#define ASN1_F_BN_TO_ASN1_INTEGER			 139
 | 
			
		||||
#define ASN1_F_C2I_ASN1_BIT_STRING			 189
 | 
			
		||||
#define ASN1_F_C2I_ASN1_INTEGER				 194
 | 
			
		||||
#define ASN1_F_C2I_ASN1_OBJECT				 196
 | 
			
		||||
#define ASN1_F_COLLECT_DATA				 140
 | 
			
		||||
#define ASN1_F_D2I_ASN1_BIT_STRING			 141
 | 
			
		||||
#define ASN1_F_D2I_ASN1_BOOLEAN				 142
 | 
			
		||||
@@ -1086,26 +1097,30 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_F_D2I_NETSCAPE_RSA_2			 153
 | 
			
		||||
#define ASN1_F_D2I_PRIVATEKEY				 154
 | 
			
		||||
#define ASN1_F_D2I_PUBLICKEY				 155
 | 
			
		||||
#define ASN1_F_D2I_RSA_NET				 200
 | 
			
		||||
#define ASN1_F_D2I_RSA_NET_2				 201
 | 
			
		||||
#define ASN1_F_D2I_X509					 156
 | 
			
		||||
#define ASN1_F_D2I_X509_CINF				 157
 | 
			
		||||
#define ASN1_F_D2I_X509_NAME				 158
 | 
			
		||||
#define ASN1_F_D2I_X509_PKEY				 159
 | 
			
		||||
#define ASN1_F_I2D_ASN1_SET				 188
 | 
			
		||||
#define ASN1_F_I2D_ASN1_TIME				 160
 | 
			
		||||
#define ASN1_F_I2D_DSA_PUBKEY				 161
 | 
			
		||||
#define ASN1_F_I2D_EC_PUBKEY				 181
 | 
			
		||||
#define ASN1_F_I2D_NETSCAPE_RSA				 162
 | 
			
		||||
#define ASN1_F_I2D_PRIVATEKEY				 163
 | 
			
		||||
#define ASN1_F_I2D_PUBLICKEY				 164
 | 
			
		||||
#define ASN1_F_I2D_RSA_NET				 162
 | 
			
		||||
#define ASN1_F_I2D_RSA_PUBKEY				 165
 | 
			
		||||
#define ASN1_F_LONG_C2I					 166
 | 
			
		||||
#define ASN1_F_OID_MODULE_INIT				 174
 | 
			
		||||
#define ASN1_F_PARSE_TAGGING				 182
 | 
			
		||||
#define ASN1_F_PKCS5_PBE2_SET				 167
 | 
			
		||||
#define ASN1_F_PKCS5_PBE_SET				 202
 | 
			
		||||
#define ASN1_F_X509_CINF_NEW				 168
 | 
			
		||||
#define ASN1_F_X509_CRL_ADD0_REVOKED			 169
 | 
			
		||||
#define ASN1_F_X509_INFO_NEW				 170
 | 
			
		||||
#define ASN1_F_X509_NAME_NEW				 171
 | 
			
		||||
#define ASN1_F_X509_NAME_ENCODE				 203
 | 
			
		||||
#define ASN1_F_X509_NAME_EX_D2I				 158
 | 
			
		||||
#define ASN1_F_X509_NAME_EX_NEW				 171
 | 
			
		||||
#define ASN1_F_X509_NEW					 172
 | 
			
		||||
#define ASN1_F_X509_PKEY_NEW				 173
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -74,20 +74,21 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_A2I_ASN1_ENUMERATED),	"a2i_ASN1_ENUMERATED"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_A2I_ASN1_INTEGER),	"a2i_ASN1_INTEGER"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_A2I_ASN1_STRING),	"a2i_ASN1_STRING"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_APPEND_TAG),	"APPEND_TAG"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_APPEND_EXP),	"APPEND_EXP"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_BIT_STRING_SET_BIT),	"ASN1_BIT_STRING_set_bit"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_CB),	"ASN1_CB"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_CHECK_TLEN),	"ASN1_CHECK_TLEN"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_COLLATE_PRIMITIVE),	"ASN1_COLLATE_PRIMITIVE"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_COLLECT),	"ASN1_COLLECT"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_D2I_BIO),	"ASN1_d2i_bio"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_D2I_EX_PRIMITIVE),	"ASN1_D2I_EX_PRIMITIVE"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_D2I_FP),	"ASN1_d2i_fp"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_D2I_READ_BIO),	"ASN1_D2I_READ_BIO"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_DIGEST),	"ASN1_digest"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_DO_ADB),	"ASN1_DO_ADB"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_DUP),	"ASN1_dup"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ENUMERATED_SET),	"ASN1_ENUMERATED_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ENUMERATED_TO_BN),	"ASN1_ENUMERATED_to_BN"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_EX_C2I),	"ASN1_EX_C2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_FIND_END),	"ASN1_FIND_END"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_GENERALIZEDTIME_SET),	"ASN1_GENERALIZEDTIME_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_GENERATE_V3),	"ASN1_generate_v3"},
 | 
			
		||||
@@ -97,12 +98,20 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_I2D_FP),	"ASN1_i2d_fp"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_INTEGER_SET),	"ASN1_INTEGER_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_INTEGER_TO_BN),	"ASN1_INTEGER_to_BN"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_D2I_FP),	"ASN1_item_d2i_fp"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_DUP),	"ASN1_item_dup"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW),	"ASN1_ITEM_EX_COMBINE_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_EX_D2I),	"ASN1_ITEM_EX_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_NEW),	"ASN1_item_new"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_MBSTRING_COPY),	"ASN1_mbstring_copy"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_BIO),	"ASN1_item_i2d_bio"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_FP),	"ASN1_item_i2d_fp"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_PACK),	"ASN1_item_pack"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_SIGN),	"ASN1_item_sign"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_UNPACK),	"ASN1_item_unpack"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_VERIFY),	"ASN1_item_verify"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_MBSTRING_NCOPY),	"ASN1_mbstring_ncopy"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_OBJECT_NEW),	"ASN1_OBJECT_new"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_PACK_STRING),	"ASN1_pack_string"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_PBE_SET),	"ASN1_PBE_SET"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_PKCS5_PBE_SET),	"ASN1_PKCS5_PBE_SET"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_SEQ_PACK),	"ASN1_seq_pack"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_SEQ_UNPACK),	"ASN1_seq_unpack"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_SIGN),	"ASN1_sign"},
 | 
			
		||||
@@ -110,9 +119,9 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_STRING_SET),	"ASN1_STRING_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_STRING_TABLE_ADD),	"ASN1_STRING_TABLE_add"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_STRING_TYPE_NEW),	"ASN1_STRING_type_new"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_D2I),	"ASN1_TEMPLATE_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_EX_D2I),	"ASN1_TEMPLATE_EX_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NEW),	"ASN1_TEMPLATE_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I),	"ASN1_TEMPLATE_NOEXP_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TIME_SET),	"ASN1_TIME_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING),	"ASN1_TYPE_get_int_octetstring"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_OCTETSTRING),	"ASN1_TYPE_get_octetstring"},
 | 
			
		||||
@@ -123,6 +132,8 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_BN_TO_ASN1_ENUMERATED),	"BN_to_ASN1_ENUMERATED"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_BN_TO_ASN1_INTEGER),	"BN_to_ASN1_INTEGER"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_C2I_ASN1_BIT_STRING),	"c2i_ASN1_BIT_STRING"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_C2I_ASN1_INTEGER),	"c2i_ASN1_INTEGER"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_C2I_ASN1_OBJECT),	"c2i_ASN1_OBJECT"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_COLLECT_DATA),	"COLLECT_DATA"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_ASN1_BIT_STRING),	"D2I_ASN1_BIT_STRING"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_ASN1_BOOLEAN),	"d2i_ASN1_BOOLEAN"},
 | 
			
		||||
@@ -139,26 +150,30 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_NETSCAPE_RSA_2),	"D2I_NETSCAPE_RSA_2"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_PRIVATEKEY),	"d2i_PrivateKey"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_PUBLICKEY),	"d2i_PublicKey"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_RSA_NET),	"d2i_RSA_NET"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_RSA_NET_2),	"D2I_RSA_NET_2"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_X509),	"D2I_X509"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_X509_CINF),	"D2I_X509_CINF"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_X509_NAME),	"D2I_X509_NAME"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_D2I_X509_PKEY),	"d2i_X509_PKEY"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_ASN1_SET),	"i2d_ASN1_SET"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_ASN1_TIME),	"I2D_ASN1_TIME"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY),	"i2d_DSA_PUBKEY"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_EC_PUBKEY),	"i2d_EC_PUBKEY"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_NETSCAPE_RSA),	"i2d_Netscape_RSA"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_PRIVATEKEY),	"i2d_PrivateKey"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_PUBLICKEY),	"i2d_PublicKey"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_RSA_NET),	"i2d_RSA_NET"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_I2D_RSA_PUBKEY),	"i2d_RSA_PUBKEY"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_LONG_C2I),	"LONG_C2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_OID_MODULE_INIT),	"OID_MODULE_INIT"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PARSE_TAGGING),	"PARSE_TAGGING"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE2_SET),	"PKCS5_pbe2_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET),	"PKCS5_pbe_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_CINF_NEW),	"X509_CINF_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_CRL_ADD0_REVOKED),	"X509_CRL_add0_revoked"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_INFO_NEW),	"X509_INFO_new"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NAME_NEW),	"X509_NAME_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NAME_ENCODE),	"X509_NAME_ENCODE"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NAME_EX_D2I),	"X509_NAME_EX_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NAME_EX_NEW),	"X509_NAME_EX_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NEW),	"X509_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_PKEY_NEW),	"X509_PKEY_new"},
 | 
			
		||||
{0,NULL}
 | 
			
		||||
 
 | 
			
		||||
@@ -512,13 +512,13 @@ static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class, int exp_cons
 | 
			
		||||
	/* Can only have IMPLICIT if permitted */
 | 
			
		||||
	if ((arg->imp_tag != -1) && !imp_ok)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_APPEND_TAG, ASN1_R_ILLEGAL_IMPLICIT_TAG);
 | 
			
		||||
		ASN1err(ASN1_F_APPEND_EXP, ASN1_R_ILLEGAL_IMPLICIT_TAG);
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (arg->exp_count == ASN1_FLAG_EXP_MAX)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_APPEND_TAG, ASN1_R_DEPTH_EXCEEDED);
 | 
			
		||||
		ASN1err(ASN1_F_APPEND_EXP, ASN1_R_DEPTH_EXCEEDED);
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -106,7 +106,7 @@ unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d,
 | 
			
		||||
 | 
			
		||||
/* Extract an ASN1 object from an ASN1_STRING */
 | 
			
		||||
 | 
			
		||||
void *ASN1_unpack_string (ASN1_STRING *oct, d2i_of_void *d2i)
 | 
			
		||||
void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i)
 | 
			
		||||
{
 | 
			
		||||
	const unsigned char *p;
 | 
			
		||||
	char *ret;
 | 
			
		||||
@@ -155,7 +155,7 @@ ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
 | 
			
		||||
 | 
			
		||||
	if (!oct || !*oct) {
 | 
			
		||||
		if (!(octmp = ASN1_STRING_new ())) {
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_ITEM_PACK,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
		if (oct) *oct = octmp;
 | 
			
		||||
@@ -167,11 +167,11 @@ ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct)
 | 
			
		||||
	}
 | 
			
		||||
		
 | 
			
		||||
	if (!(octmp->length = ASN1_item_i2d(obj, &octmp->data, it))) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_PACK,ASN1_R_ENCODE_ERROR);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	if (!octmp->data) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_PACK,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	return octmp;
 | 
			
		||||
@@ -186,6 +186,6 @@ void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it)
 | 
			
		||||
 | 
			
		||||
	p = oct->data;
 | 
			
		||||
	if(!(ret = ASN1_item_d2i(NULL, &p, oct->length, it)))
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_UNPACK_STRING,ASN1_R_DECODE_ERROR);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_UNPACK,ASN1_R_DECODE_ERROR);
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -113,7 +113,7 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_EC
 | 
			
		||||
	case EVP_PKEY_EC:
 | 
			
		||||
		if ((ret->pkey.eckey = d2i_ECPrivateKey(NULL, 
 | 
			
		||||
		if ((ret->pkey.ec = d2i_ECPrivateKey(NULL, 
 | 
			
		||||
			(const unsigned char **)pp, length)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
 | 
			
		||||
 
 | 
			
		||||
@@ -113,7 +113,7 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_EC
 | 
			
		||||
	case EVP_PKEY_EC:
 | 
			
		||||
		if (!o2i_ECPublicKey(&(ret->pkey.eckey),
 | 
			
		||||
		if (!o2i_ECPublicKey(&(ret->pkey.ec),
 | 
			
		||||
				     (const unsigned char **)pp, length))
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB);
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,7 @@ int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
 | 
			
		||||
#ifndef OPENSSL_NO_EC
 | 
			
		||||
	if (a->type == EVP_PKEY_EC)
 | 
			
		||||
		{
 | 
			
		||||
		return(i2d_ECPrivateKey(a->pkey.eckey, pp));
 | 
			
		||||
		return(i2d_ECPrivateKey(a->pkey.ec, pp));
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -85,7 +85,7 @@ int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_EC
 | 
			
		||||
	case EVP_PKEY_EC:
 | 
			
		||||
		return(i2o_ECPublicKey(a->pkey.eckey, pp));
 | 
			
		||||
		return(i2o_ECPublicKey(a->pkey.ec, pp));
 | 
			
		||||
#endif
 | 
			
		||||
	default:
 | 
			
		||||
		ASN1err(ASN1_F_I2D_PUBLICKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
 | 
			
		||||
 
 | 
			
		||||
@@ -170,7 +170,7 @@ int i2d_RSA_NET(const RSA *a, unsigned char **pp,
 | 
			
		||||
	/* Since its RC4 encrypted length is actual length */
 | 
			
		||||
	if ((zz=(unsigned char *)OPENSSL_malloc(rsalen)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_I2D_RSA_NET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -180,13 +180,13 @@ int i2d_RSA_NET(const RSA *a, unsigned char **pp,
 | 
			
		||||
 | 
			
		||||
	if ((zz=OPENSSL_malloc(pkeylen)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_I2D_RSA_NET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!ASN1_STRING_set(enckey->os, "private-key", -1)) 
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_I2D_RSA_NET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	enckey->enckey->digest->data = zz;
 | 
			
		||||
@@ -200,7 +200,7 @@ int i2d_RSA_NET(const RSA *a, unsigned char **pp,
 | 
			
		||||
	i=cb((char *)buf,256,"Enter Private Key password:",1);
 | 
			
		||||
	if (i != 0)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ASN1_R_BAD_PASSWORD_READ);
 | 
			
		||||
		ASN1err(ASN1_F_I2D_RSA_NET,ASN1_R_BAD_PASSWORD_READ);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	i = strlen((char *)buf);
 | 
			
		||||
@@ -249,20 +249,20 @@ RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
 | 
			
		||||
 | 
			
		||||
	enckey = d2i_NETSCAPE_ENCRYPTED_PKEY(NULL, &p, length);
 | 
			
		||||
	if(!enckey) {
 | 
			
		||||
		ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_DECODING_ERROR);
 | 
			
		||||
		ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_DECODING_ERROR);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if ((enckey->os->length != 11) || (strncmp("private-key",
 | 
			
		||||
		(char *)enckey->os->data,11) != 0))
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_PRIVATE_KEY_HEADER_MISSING);
 | 
			
		||||
		ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_PRIVATE_KEY_HEADER_MISSING);
 | 
			
		||||
		NETSCAPE_ENCRYPTED_PKEY_free(enckey);
 | 
			
		||||
		return NULL;
 | 
			
		||||
		}
 | 
			
		||||
	if (OBJ_obj2nid(enckey->enckey->algor->algorithm) != NID_rc4)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM);
 | 
			
		||||
		ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	kp = enckey->enckey->digest->data;
 | 
			
		||||
@@ -293,7 +293,7 @@ static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os,
 | 
			
		||||
	i=cb((char *)buf,256,"Enter Private Key password:",0);
 | 
			
		||||
	if (i != 0)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_BAD_PASSWORD_READ);
 | 
			
		||||
		ASN1err(ASN1_F_D2I_RSA_NET_2,ASN1_R_BAD_PASSWORD_READ);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -318,14 +318,14 @@ static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os,
 | 
			
		||||
 | 
			
		||||
	if ((pkey=d2i_NETSCAPE_PKEY(NULL,&zz,os->length)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY);
 | 
			
		||||
		ASN1err(ASN1_F_D2I_RSA_NET_2,ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
	zz=pkey->private_key->data;
 | 
			
		||||
	if ((ret=d2i_RSAPrivateKey(a,&zz,pkey->private_key->length)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNABLE_TO_DECODE_RSA_KEY);
 | 
			
		||||
		ASN1err(ASN1_F_D2I_RSA_NET_2,ASN1_R_UNABLE_TO_DECODE_RSA_KEY);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
err:
 | 
			
		||||
 
 | 
			
		||||
@@ -82,17 +82,17 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt,
 | 
			
		||||
	ASN1_TYPE *astype=NULL;
 | 
			
		||||
 | 
			
		||||
	if (!(pbe = PBEPARAM_new ())) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_PKCS5_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	if(iter <= 0) iter = PKCS5_DEFAULT_ITER;
 | 
			
		||||
	if (!ASN1_INTEGER_set(pbe->iter, iter)) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_PKCS5_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	if (!saltlen) saltlen = PKCS5_SALT_LEN;
 | 
			
		||||
	if (!(pbe->salt->data = OPENSSL_malloc (saltlen))) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_PKCS5_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	pbe->salt->length = saltlen;
 | 
			
		||||
@@ -101,14 +101,14 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt,
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!(astype = ASN1_TYPE_new())) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_PKCS5_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	astype->type = V_ASN1_SEQUENCE;
 | 
			
		||||
	if(!ASN1_pack_string_of(PBEPARAM, pbe, i2d_PBEPARAM,
 | 
			
		||||
				&astype->value.sequence)) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_PKCS5_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	PBEPARAM_free (pbe);
 | 
			
		||||
@@ -116,7 +116,7 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt,
 | 
			
		||||
	
 | 
			
		||||
	al = OBJ_nid2obj(alg); /* never need to free al */
 | 
			
		||||
	if (!(algor = X509_ALGOR_new())) {
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		ASN1err(ASN1_F_PKCS5_PBE_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	ASN1_OBJECT_free(algor->algorithm);
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
 | 
			
		||||
 | 
			
		||||
        if ((b=BIO_new(BIO_s_file())) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		X509err(X509_F_X509_PRINT_FP,ERR_R_BUF_LIB);
 | 
			
		||||
		X509err(X509_F_X509_CRL_PRINT_FP,ERR_R_BUF_LIB);
 | 
			
		||||
                return(0);
 | 
			
		||||
		}
 | 
			
		||||
        BIO_set_fp(b,fp,BIO_NOCLOSE);
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@
 | 
			
		||||
#include <openssl/ec.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static int print(BIO *fp,const char *str,BIGNUM *num,
 | 
			
		||||
static int print(BIO *fp,const char *str, const BIGNUM *num,
 | 
			
		||||
		unsigned char *buf,int off);
 | 
			
		||||
static int print_bin(BIO *fp, const char *str, const unsigned char *num,
 | 
			
		||||
		size_t len, int off);
 | 
			
		||||
@@ -279,7 +279,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
 | 
			
		||||
	size_t	buf_len=0, i;
 | 
			
		||||
	int     ret=0, reason=ERR_R_BIO_LIB;
 | 
			
		||||
	BN_CTX  *ctx=NULL;
 | 
			
		||||
	EC_POINT *point=NULL;
 | 
			
		||||
	const EC_POINT *point=NULL;
 | 
			
		||||
	BIGNUM	*p=NULL, *a=NULL, *b=NULL, *gen=NULL,
 | 
			
		||||
		*order=NULL, *cofactor=NULL;
 | 
			
		||||
	const unsigned char *seed;
 | 
			
		||||
@@ -303,7 +303,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
 | 
			
		||||
		if (!BIO_indent(bp, off, 128))
 | 
			
		||||
			goto err;
 | 
			
		||||
 | 
			
		||||
		nid = EC_GROUP_get_nid(x);
 | 
			
		||||
		nid = EC_GROUP_get_curve_name(x);
 | 
			
		||||
		if (nid == 0)
 | 
			
		||||
			goto err;
 | 
			
		||||
 | 
			
		||||
@@ -481,24 +481,29 @@ int EC_KEY_print(BIO *bp, const EC_KEY *x, int off)
 | 
			
		||||
	int     ret=0, reason=ERR_R_BIO_LIB;
 | 
			
		||||
	BIGNUM  *pub_key=NULL, *order=NULL;
 | 
			
		||||
	BN_CTX  *ctx=NULL;
 | 
			
		||||
	const EC_GROUP *group;
 | 
			
		||||
	const EC_POINT *public_key;
 | 
			
		||||
	const BIGNUM *priv_key;
 | 
			
		||||
 
 | 
			
		||||
	if (!x || !x->group)
 | 
			
		||||
	if (x == NULL || (group = EC_KEY_get0_group(x)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		reason = ERR_R_PASSED_NULL_PARAMETER;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if ((pub_key = EC_POINT_point2bn(x->group, x->pub_key,
 | 
			
		||||
		x->conv_form, NULL, ctx)) == NULL)
 | 
			
		||||
	public_key = EC_KEY_get0_public_key(x);
 | 
			
		||||
	if ((pub_key = EC_POINT_point2bn(group, public_key,
 | 
			
		||||
		EC_KEY_get_conv_form(x), NULL, ctx)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		reason = ERR_R_EC_LIB;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	buf_len = (size_t)BN_num_bytes(pub_key);
 | 
			
		||||
	if (x->priv_key)
 | 
			
		||||
	priv_key = EC_KEY_get0_private_key(x);
 | 
			
		||||
	if (priv_key != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if ((i = (size_t)BN_num_bytes(x->priv_key)) > buf_len)
 | 
			
		||||
		if ((i = (size_t)BN_num_bytes(priv_key)) > buf_len)
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -509,25 +514,25 @@ int EC_KEY_print(BIO *bp, const EC_KEY *x, int off)
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (x->priv_key != NULL)
 | 
			
		||||
	if (priv_key != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BIO_indent(bp, off, 128))
 | 
			
		||||
			goto err;
 | 
			
		||||
		if ((order = BN_new()) == NULL)
 | 
			
		||||
			goto err;
 | 
			
		||||
		if (!EC_GROUP_get_order(x->group, order, NULL))
 | 
			
		||||
		if (!EC_GROUP_get_order(group, order, NULL))
 | 
			
		||||
			goto err;
 | 
			
		||||
		if (BIO_printf(bp, "Private-Key: (%d bit)\n", 
 | 
			
		||||
			BN_num_bits(order)) <= 0) goto err;
 | 
			
		||||
		}
 | 
			
		||||
  
 | 
			
		||||
	if ((x->priv_key != NULL) && !print(bp, "priv:", x->priv_key, 
 | 
			
		||||
	if ((priv_key != NULL) && !print(bp, "priv:", priv_key, 
 | 
			
		||||
		buffer, off))
 | 
			
		||||
		goto err;
 | 
			
		||||
	if ((pub_key != NULL) && !print(bp, "pub: ", pub_key,
 | 
			
		||||
		buffer, off))
 | 
			
		||||
		goto err;
 | 
			
		||||
	if (!ECPKParameters_print(bp, x->group, off))
 | 
			
		||||
	if (!ECPKParameters_print(bp, group, off))
 | 
			
		||||
		goto err;
 | 
			
		||||
	ret=1;
 | 
			
		||||
err:
 | 
			
		||||
@@ -545,7 +550,7 @@ err:
 | 
			
		||||
	}
 | 
			
		||||
#endif /* OPENSSL_NO_EC */
 | 
			
		||||
 | 
			
		||||
static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf,
 | 
			
		||||
static int print(BIO *bp, const char *number, const BIGNUM *num, unsigned char *buf,
 | 
			
		||||
	     int off)
 | 
			
		||||
	{
 | 
			
		||||
	int n,i;
 | 
			
		||||
@@ -770,8 +775,9 @@ int ECParameters_print(BIO *bp, const EC_KEY *x)
 | 
			
		||||
	{
 | 
			
		||||
	int     reason=ERR_R_EC_LIB, ret=0;
 | 
			
		||||
	BIGNUM	*order=NULL;
 | 
			
		||||
	const EC_GROUP *group;
 | 
			
		||||
 
 | 
			
		||||
	if (!x || !x->group)
 | 
			
		||||
	if (x == NULL || (group = EC_KEY_get0_group(x)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		reason = ERR_R_PASSED_NULL_PARAMETER;;
 | 
			
		||||
		goto err;
 | 
			
		||||
@@ -783,7 +789,7 @@ int ECParameters_print(BIO *bp, const EC_KEY *x)
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!EC_GROUP_get_order(x->group, order, NULL))
 | 
			
		||||
	if (!EC_GROUP_get_order(group, order, NULL))
 | 
			
		||||
		{
 | 
			
		||||
		reason = ERR_R_EC_LIB;
 | 
			
		||||
		goto err;
 | 
			
		||||
@@ -792,7 +798,7 @@ int ECParameters_print(BIO *bp, const EC_KEY *x)
 | 
			
		||||
	if (BIO_printf(bp, "ECDSA-Parameters: (%d bit)\n", 
 | 
			
		||||
		BN_num_bits(order)) <= 0)
 | 
			
		||||
		goto err;
 | 
			
		||||
	if (!ECPKParameters_print(bp, x->group, 4))
 | 
			
		||||
	if (!ECPKParameters_print(bp, group, 4))
 | 
			
		||||
		goto err;
 | 
			
		||||
	ret=1;
 | 
			
		||||
err:
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,7 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long
 | 
			
		||||
		if (pkey->type == EVP_PKEY_EC)
 | 
			
		||||
		{
 | 
			
		||||
			BIO_printf(bp, "%12sEC Public Key: \n","");
 | 
			
		||||
			EC_KEY_print(bp, pkey->pkey.eckey, 16);
 | 
			
		||||
			EC_KEY_print(bp, pkey->pkey.ec, 16);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
#endif
 | 
			
		||||
@@ -276,7 +276,7 @@ get_next:
 | 
			
		||||
 | 
			
		||||
	return(1);
 | 
			
		||||
err:
 | 
			
		||||
	X509err(X509_F_X509_REQ_PRINT,ERR_R_BUF_LIB);
 | 
			
		||||
	X509err(X509_F_X509_REQ_PRINT_EX,ERR_R_BUF_LIB);
 | 
			
		||||
	return(0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -100,7 +100,7 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki)
 | 
			
		||||
		if (pkey->type == EVP_PKEY_EC)
 | 
			
		||||
		{
 | 
			
		||||
			BIO_printf(out, "  EC Public Key:\n");
 | 
			
		||||
			EC_KEY_print(out, pkey->pkey.eckey,2);
 | 
			
		||||
			EC_KEY_print(out, pkey->pkey.ec,2);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,7 @@ int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cfla
 | 
			
		||||
 | 
			
		||||
        if ((b=BIO_new(BIO_s_file())) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		X509err(X509_F_X509_PRINT_FP,ERR_R_BUF_LIB);
 | 
			
		||||
		X509err(X509_F_X509_PRINT_EX_FP,ERR_R_BUF_LIB);
 | 
			
		||||
                return(0);
 | 
			
		||||
		}
 | 
			
		||||
        BIO_set_fp(b,fp,BIO_NOCLOSE);
 | 
			
		||||
@@ -236,7 +236,7 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
 | 
			
		||||
		if (pkey->type == EVP_PKEY_EC)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bp, "%12sEC Public Key:\n","");
 | 
			
		||||
			EC_KEY_print(bp, pkey->pkey.eckey, 16);
 | 
			
		||||
			EC_KEY_print(bp, pkey->pkey.ec, 16);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -579,7 +579,7 @@ static int asn1_template_ex_d2i(ASN1_VALUE **val,
 | 
			
		||||
			/* If NDEF we must have an EOC here */
 | 
			
		||||
			if (!asn1_check_eoc(&p, len))
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_D2I,
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I,
 | 
			
		||||
						ASN1_R_MISSING_EOC);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
@@ -590,7 +590,7 @@ static int asn1_template_ex_d2i(ASN1_VALUE **val,
 | 
			
		||||
			 * an error */
 | 
			
		||||
			if (len)
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_D2I,
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I,
 | 
			
		||||
					ASN1_R_EXPLICIT_LENGTH_MISMATCH);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
@@ -649,7 +649,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
 | 
			
		||||
					&p, len, sktag, skaclass, opt, ctx);
 | 
			
		||||
		if (!ret)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
 | 
			
		||||
						ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
			return 0;
 | 
			
		||||
			}
 | 
			
		||||
@@ -672,7 +672,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
 | 
			
		||||
				
 | 
			
		||||
		if (!*val)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
 | 
			
		||||
						ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
@@ -687,7 +687,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
 | 
			
		||||
				{
 | 
			
		||||
				if (!sk_eoc)
 | 
			
		||||
					{
 | 
			
		||||
					ASN1err(ASN1_F_ASN1_TEMPLATE_D2I,
 | 
			
		||||
					ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
 | 
			
		||||
							ASN1_R_UNEXPECTED_EOC);
 | 
			
		||||
					goto err;
 | 
			
		||||
					}
 | 
			
		||||
@@ -700,21 +700,21 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
 | 
			
		||||
						ASN1_ITEM_ptr(tt->item),
 | 
			
		||||
						-1, 0, 0, ctx))
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_D2I,
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
 | 
			
		||||
					ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			len -= p - q;
 | 
			
		||||
			if (!sk_push((STACK *)*val, (char *)skfield))
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_D2I,
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
 | 
			
		||||
						ERR_R_MALLOC_FAILURE);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		if (sk_eoc)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ASN1_R_MISSING_EOC);
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ASN1_R_MISSING_EOC);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -725,7 +725,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
 | 
			
		||||
			ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt, ctx);
 | 
			
		||||
		if (!ret)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_D2I,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
 | 
			
		||||
						ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
@@ -739,7 +739,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
 | 
			
		||||
							-1, 0, opt, ctx);
 | 
			
		||||
		if (!ret)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_D2I,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
 | 
			
		||||
					ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
@@ -944,7 +944,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
 | 
			
		||||
		case V_ASN1_NULL:
 | 
			
		||||
		if (len)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_EX_C2I,
 | 
			
		||||
						ASN1_R_NULL_IS_WRONG_LENGTH);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
@@ -954,7 +954,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
 | 
			
		||||
		case V_ASN1_BOOLEAN:
 | 
			
		||||
		if (len != 1)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_EX_C2I,
 | 
			
		||||
						ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
@@ -1006,7 +1006,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
 | 
			
		||||
			stmp = ASN1_STRING_type_new(utype);
 | 
			
		||||
			if (!stmp)
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE,
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_EX_C2I,
 | 
			
		||||
							ERR_R_MALLOC_FAILURE);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
@@ -1030,7 +1030,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
 | 
			
		||||
			{
 | 
			
		||||
			if (!ASN1_STRING_set(stmp, cont, len))
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE,
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_EX_C2I,
 | 
			
		||||
							ERR_R_MALLOC_FAILURE);
 | 
			
		||||
				ASN1_STRING_free(stmp);	
 | 
			
		||||
				*pval = NULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -211,14 +211,14 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
 | 
			
		||||
	return 1;
 | 
			
		||||
 | 
			
		||||
	memerr:
 | 
			
		||||
	ASN1err(ASN1_F_ASN1_ITEM_NEW, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
	ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
#ifdef CRYPTO_MDEBUG
 | 
			
		||||
	if (it->sname) CRYPTO_pop_info();
 | 
			
		||||
#endif
 | 
			
		||||
	return 0;
 | 
			
		||||
 | 
			
		||||
	auxerr:
 | 
			
		||||
	ASN1err(ASN1_F_ASN1_ITEM_NEW, ASN1_R_AUX_ERROR);
 | 
			
		||||
	ASN1err(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW, ASN1_R_AUX_ERROR);
 | 
			
		||||
	ASN1_item_ex_free(pval, it);
 | 
			
		||||
#ifdef CRYPTO_MDEBUG
 | 
			
		||||
	if (it->sname) CRYPTO_pop_info();
 | 
			
		||||
 
 | 
			
		||||
@@ -123,7 +123,7 @@ static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it)
 | 
			
		||||
	return 1;
 | 
			
		||||
 | 
			
		||||
 memerr:
 | 
			
		||||
	ASN1err(ASN1_F_X509_NAME_NEW, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
	ASN1err(ASN1_F_X509_NAME_EX_NEW, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		{
 | 
			
		||||
		if (ret->entries)
 | 
			
		||||
@@ -197,7 +197,7 @@ static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len
 | 
			
		||||
	*in = p;
 | 
			
		||||
	return ret;
 | 
			
		||||
	err:
 | 
			
		||||
	ASN1err(ASN1_F_D2I_X509_NAME, ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
	ASN1err(ASN1_F_X509_NAME_EX_D2I, ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -248,7 +248,7 @@ static int x509_name_encode(X509_NAME *a)
 | 
			
		||||
	return len;
 | 
			
		||||
	memerr:
 | 
			
		||||
	sk_pop_free(intname, sk_internal_free);
 | 
			
		||||
	ASN1err(ASN1_F_D2I_X509_NAME, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
	ASN1err(ASN1_F_X509_NAME_ENCODE, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
	return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -159,9 +159,10 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
 | 
			
		||||
		{
 | 
			
		||||
		int nid=0;
 | 
			
		||||
		unsigned char *pp;
 | 
			
		||||
		EC_KEY *eckey;
 | 
			
		||||
		EC_KEY *ec_key;
 | 
			
		||||
		const EC_GROUP *group;
 | 
			
		||||
		
 | 
			
		||||
		eckey = pkey->pkey.eckey;
 | 
			
		||||
		ec_key = pkey->pkey.ec;
 | 
			
		||||
		ASN1_TYPE_free(a->parameter);
 | 
			
		||||
 | 
			
		||||
		if ((a->parameter = ASN1_TYPE_new()) == NULL)
 | 
			
		||||
@@ -170,8 +171,9 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (EC_GROUP_get_asn1_flag(eckey->group)
 | 
			
		||||
                     && (nid = EC_GROUP_get_nid(eckey->group)))
 | 
			
		||||
		group = EC_KEY_get0_group(ec_key);
 | 
			
		||||
		if (EC_GROUP_get_asn1_flag(group)
 | 
			
		||||
                     && (nid = EC_GROUP_get_curve_name(group)))
 | 
			
		||||
			{
 | 
			
		||||
			/* just set the OID */
 | 
			
		||||
			a->parameter->type = V_ASN1_OBJECT;
 | 
			
		||||
@@ -179,7 +181,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
 | 
			
		||||
			}
 | 
			
		||||
		else /* explicit parameters */
 | 
			
		||||
			{
 | 
			
		||||
			if ((i = i2d_ECParameters(eckey, NULL)) == 0)
 | 
			
		||||
			if ((i = i2d_ECParameters(ec_key, NULL)) == 0)
 | 
			
		||||
				{
 | 
			
		||||
				X509err(X509_F_X509_PUBKEY_SET, ERR_R_EC_LIB);
 | 
			
		||||
				goto err;
 | 
			
		||||
@@ -190,7 +192,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
 | 
			
		||||
				goto err;
 | 
			
		||||
				}	
 | 
			
		||||
			pp = p;
 | 
			
		||||
			if (!i2d_ECParameters(eckey, &pp))
 | 
			
		||||
			if (!i2d_ECParameters(ec_key, &pp))
 | 
			
		||||
				{
 | 
			
		||||
				X509err(X509_F_X509_PUBKEY_SET, ERR_R_EC_LIB);
 | 
			
		||||
				OPENSSL_free(p);
 | 
			
		||||
@@ -313,7 +315,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
 | 
			
		||||
			/* type == V_ASN1_SEQUENCE => we have explicit parameters
 | 
			
		||||
                         * (e.g. parameters in the X9_62_EC_PARAMETERS-structure )
 | 
			
		||||
			 */
 | 
			
		||||
			if ((ret->pkey.eckey= EC_KEY_new()) == NULL)
 | 
			
		||||
			if ((ret->pkey.ec= EC_KEY_new()) == NULL)
 | 
			
		||||
				{
 | 
			
		||||
				X509err(X509_F_X509_PUBKEY_GET, 
 | 
			
		||||
					ERR_R_MALLOC_FAILURE);
 | 
			
		||||
@@ -321,7 +323,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
 | 
			
		||||
				}
 | 
			
		||||
			cp = p = a->parameter->value.sequence->data;
 | 
			
		||||
			j = a->parameter->value.sequence->length;
 | 
			
		||||
			if (!d2i_ECParameters(&ret->pkey.eckey, &cp, (long)j))
 | 
			
		||||
			if (!d2i_ECParameters(&ret->pkey.ec, &cp, (long)j))
 | 
			
		||||
				{
 | 
			
		||||
				X509err(X509_F_X509_PUBKEY_GET, ERR_R_EC_LIB);
 | 
			
		||||
				goto err;
 | 
			
		||||
@@ -332,17 +334,21 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
 | 
			
		||||
			/* type == V_ASN1_OBJECT => the parameters are given
 | 
			
		||||
			 * by an asn1 OID
 | 
			
		||||
			 */
 | 
			
		||||
			EC_KEY *eckey;
 | 
			
		||||
			if (ret->pkey.eckey == NULL)
 | 
			
		||||
				ret->pkey.eckey = EC_KEY_new();
 | 
			
		||||
			eckey = ret->pkey.eckey;
 | 
			
		||||
			if (eckey->group)
 | 
			
		||||
				EC_GROUP_free(eckey->group);
 | 
			
		||||
			if ((eckey->group = EC_GROUP_new_by_nid(
 | 
			
		||||
                             OBJ_obj2nid(a->parameter->value.object))) == NULL)
 | 
			
		||||
			EC_KEY   *ec_key;
 | 
			
		||||
			EC_GROUP *group;
 | 
			
		||||
 | 
			
		||||
			if (ret->pkey.ec == NULL)
 | 
			
		||||
				ret->pkey.ec = EC_KEY_new();
 | 
			
		||||
			ec_key = ret->pkey.ec;
 | 
			
		||||
			if (ec_key == NULL)
 | 
			
		||||
				goto err;
 | 
			
		||||
			EC_GROUP_set_asn1_flag(eckey->group, 
 | 
			
		||||
						OPENSSL_EC_NAMED_CURVE);
 | 
			
		||||
			group = EC_GROUP_new_by_curve_name(OBJ_obj2nid(a->parameter->value.object));
 | 
			
		||||
			if (group == NULL)
 | 
			
		||||
				goto err;
 | 
			
		||||
			EC_GROUP_set_asn1_flag(group, OPENSSL_EC_NAMED_CURVE);
 | 
			
		||||
			if (EC_KEY_set_group(ec_key, group) == 0)
 | 
			
		||||
				goto err;
 | 
			
		||||
			EC_GROUP_free(group);
 | 
			
		||||
			}
 | 
			
		||||
			/* the case implicitlyCA is currently not implemented */
 | 
			
		||||
		ret->save_parameters = 1;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,6 @@ CC=	cc
 | 
			
		||||
CPP=	$(CC) -E
 | 
			
		||||
INCLUDES=
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -68,9 +62,8 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install: installs
 | 
			
		||||
 | 
			
		||||
installs:
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -86,6 +79,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -41,7 +35,7 @@ LIBOBJ= bio_lib.o bio_cb.o bio_err.o \
 | 
			
		||||
SRC= $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
EXHEADER= bio.h
 | 
			
		||||
HEADER=	bss_file.c $(EXHEADER)
 | 
			
		||||
HEADER=	bio_lcl.h $(EXHEADER)
 | 
			
		||||
 | 
			
		||||
ALL=    $(GENERAL) $(SRC) $(HEADER)
 | 
			
		||||
 | 
			
		||||
@@ -64,6 +58,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -79,6 +74,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
@@ -96,7 +92,7 @@ b_dump.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
b_dump.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
b_dump.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
b_dump.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
b_dump.o: ../../include/openssl/symhacks.h ../cryptlib.h b_dump.c
 | 
			
		||||
b_dump.o: ../../include/openssl/symhacks.h ../cryptlib.h b_dump.c bio_lcl.h
 | 
			
		||||
b_print.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
 | 
			
		||||
b_print.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
b_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
@@ -187,14 +183,14 @@ bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
bss_fd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
bss_fd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
bss_fd.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
bss_fd.o: ../../include/openssl/symhacks.h ../cryptlib.h bss_fd.c
 | 
			
		||||
bss_fd.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_lcl.h bss_fd.c
 | 
			
		||||
bss_file.o: ../../e_os.h ../../include/openssl/bio.h
 | 
			
		||||
bss_file.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
bss_file.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
bss_file.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
bss_file.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
bss_file.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
bss_file.o: ../../include/openssl/symhacks.h ../cryptlib.h bss_file.c
 | 
			
		||||
bss_file.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_lcl.h bss_file.c
 | 
			
		||||
bss_log.o: ../../e_os.h ../../include/openssl/bio.h
 | 
			
		||||
bss_log.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
bss_log.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,7 @@
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
#include "bio_lcl.h"
 | 
			
		||||
 | 
			
		||||
#define TRUNCATE
 | 
			
		||||
#define DUMP_WIDTH	16
 | 
			
		||||
@@ -160,7 +160,7 @@ int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
 | 
			
		||||
#ifndef OPENSSL_NO_FP_API
 | 
			
		||||
static int write_fp(const void *data, size_t len, void *fp)
 | 
			
		||||
	{
 | 
			
		||||
	return fwrite(data, len, 1, (FILE *)fp);
 | 
			
		||||
	return UP_fwrite(data, len, 1, fp);
 | 
			
		||||
	}
 | 
			
		||||
int BIO_dump_fp(FILE *fp, const char *s, int len)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -576,7 +576,7 @@ abs_val(LDOUBLE value)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static LDOUBLE
 | 
			
		||||
pow10(int in_exp)
 | 
			
		||||
pow_10(int in_exp)
 | 
			
		||||
{
 | 
			
		||||
    LDOUBLE result = 1;
 | 
			
		||||
    while (in_exp) {
 | 
			
		||||
@@ -640,8 +640,8 @@ fmtfp(
 | 
			
		||||
 | 
			
		||||
    /* we "cheat" by converting the fractional part to integer by
 | 
			
		||||
       multiplying by a factor of 10 */
 | 
			
		||||
    max10 = roundv(pow10(max));
 | 
			
		||||
    fracpart = roundv(pow10(max) * (ufvalue - intpart));
 | 
			
		||||
    max10 = roundv(pow_10(max));
 | 
			
		||||
    fracpart = roundv(pow_10(max) * (ufvalue - intpart));
 | 
			
		||||
 | 
			
		||||
    if (fracpart >= max10) {
 | 
			
		||||
        intpart++;
 | 
			
		||||
 
 | 
			
		||||
@@ -169,6 +169,11 @@ extern "C" {
 | 
			
		||||
#define BIO_FLAGS_IO_SPECIAL	0x04
 | 
			
		||||
#define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
 | 
			
		||||
#define BIO_FLAGS_SHOULD_RETRY	0x08
 | 
			
		||||
#ifndef	BIO_FLAGS_UPLINK
 | 
			
		||||
/* "UPLINK" flag denotes file descriptors provided by application.
 | 
			
		||||
   It defaults to 0, as most platforms don't require UPLINK interface. */
 | 
			
		||||
#define	BIO_FLAGS_UPLINK	0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Used in BIO_gethostbyname() */
 | 
			
		||||
#define BIO_GHBN_CTRL_HITS		1
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								crypto/bio/bio_lcl.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								crypto/bio/bio_lcl.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
 | 
			
		||||
#if BIO_FLAGS_UPLINK==0
 | 
			
		||||
/* Shortcut UPLINK calls on most platforms... */
 | 
			
		||||
#define	UP_stdin	stdin
 | 
			
		||||
#define	UP_stdout	stdout
 | 
			
		||||
#define	UP_stderr	stderr
 | 
			
		||||
#define	UP_fprintf	fprintf
 | 
			
		||||
#define	UP_fgets	fgets
 | 
			
		||||
#define	UP_fread	fread
 | 
			
		||||
#define	UP_fwrite	fwrite
 | 
			
		||||
#undef	UP_fsetmod
 | 
			
		||||
#define	UP_feof		feof
 | 
			
		||||
#define	UP_fclose	fclose
 | 
			
		||||
 | 
			
		||||
#define	UP_fopen	fopen
 | 
			
		||||
#define	UP_fseek	fseek
 | 
			
		||||
#define	UP_ftell	ftell
 | 
			
		||||
#define	UP_fflush	fflush
 | 
			
		||||
#define	UP_ferror	ferror
 | 
			
		||||
#define	UP_fileno	fileno
 | 
			
		||||
 | 
			
		||||
#define	UP_open		open
 | 
			
		||||
#define	UP_read		read
 | 
			
		||||
#define	UP_write	write
 | 
			
		||||
#define	UP_lseek	lseek
 | 
			
		||||
#define	UP_close	close
 | 
			
		||||
#endif
 | 
			
		||||
@@ -60,7 +60,19 @@
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#define USE_SOCKETS
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
/*
 | 
			
		||||
 * As for unconditional usage of "UPLINK" interface in this module.
 | 
			
		||||
 * Trouble is that unlike Unix file descriptors [which are indexes
 | 
			
		||||
 * in kernel-side per-process table], corresponding descriptors on
 | 
			
		||||
 * platforms which require "UPLINK" interface seem to be indexes
 | 
			
		||||
 * in a user-land, non-global table. Well, in fact they are indexes
 | 
			
		||||
 * in stdio _iob[], and recall that _iob[] was the very reason why
 | 
			
		||||
 * "UPLINK" interface was introduced in first place. But one way on
 | 
			
		||||
 * another. Neither libcrypto or libssl use this BIO meaning that
 | 
			
		||||
 * file descriptors can only be provided by application. Therefore
 | 
			
		||||
 * "UPLINK" calls are due...
 | 
			
		||||
 */
 | 
			
		||||
#include "bio_lcl.h"
 | 
			
		||||
 | 
			
		||||
static int fd_write(BIO *h, const char *buf, int num);
 | 
			
		||||
static int fd_read(BIO *h, char *buf, int size);
 | 
			
		||||
@@ -100,9 +112,9 @@ BIO *BIO_new_fd(int fd,int close_flag)
 | 
			
		||||
static int fd_new(BIO *bi)
 | 
			
		||||
	{
 | 
			
		||||
	bi->init=0;
 | 
			
		||||
	bi->num=0;
 | 
			
		||||
	bi->num=-1;
 | 
			
		||||
	bi->ptr=NULL;
 | 
			
		||||
	bi->flags=0;
 | 
			
		||||
	bi->flags=BIO_FLAGS_UPLINK; /* essentially redundant */
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -113,10 +125,10 @@ static int fd_free(BIO *a)
 | 
			
		||||
		{
 | 
			
		||||
		if (a->init)
 | 
			
		||||
			{
 | 
			
		||||
			close(a->num);
 | 
			
		||||
			UP_close(a->num);
 | 
			
		||||
			}
 | 
			
		||||
		a->init=0;
 | 
			
		||||
		a->flags=0;
 | 
			
		||||
		a->flags=BIO_FLAGS_UPLINK;
 | 
			
		||||
		}
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
@@ -128,7 +140,7 @@ static int fd_read(BIO *b, char *out,int outl)
 | 
			
		||||
	if (out != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		clear_sys_error();
 | 
			
		||||
		ret=read(b->num,out,outl);
 | 
			
		||||
		ret=UP_read(b->num,out,outl);
 | 
			
		||||
		BIO_clear_retry_flags(b);
 | 
			
		||||
		if (ret <= 0)
 | 
			
		||||
			{
 | 
			
		||||
@@ -143,7 +155,7 @@ static int fd_write(BIO *b, const char *in, int inl)
 | 
			
		||||
	{
 | 
			
		||||
	int ret;
 | 
			
		||||
	clear_sys_error();
 | 
			
		||||
	ret=write(b->num,in,inl);
 | 
			
		||||
	ret=UP_write(b->num,in,inl);
 | 
			
		||||
	BIO_clear_retry_flags(b);
 | 
			
		||||
	if (ret <= 0)
 | 
			
		||||
		{
 | 
			
		||||
@@ -163,11 +175,11 @@ static long fd_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
	case BIO_CTRL_RESET:
 | 
			
		||||
		num=0;
 | 
			
		||||
	case BIO_C_FILE_SEEK:
 | 
			
		||||
		ret=(long)lseek(b->num,num,0);
 | 
			
		||||
		ret=(long)UP_lseek(b->num,num,0);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_C_FILE_TELL:
 | 
			
		||||
	case BIO_CTRL_INFO:
 | 
			
		||||
		ret=(long)lseek(b->num,0,1);
 | 
			
		||||
		ret=(long)UP_lseek(b->num,0,1);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_C_SET_FD:
 | 
			
		||||
		fd_free(b);
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
#include "bio_lcl.h"
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_NO_STDIO)
 | 
			
		||||
@@ -112,6 +112,7 @@ BIO *BIO_new_file(const char *filename, const char *mode)
 | 
			
		||||
	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
 | 
			
		||||
		return(NULL);
 | 
			
		||||
 | 
			
		||||
	BIO_clear_flags(ret,BIO_FLAGS_UPLINK); /* we did fopen -> we disengage UPLINK */
 | 
			
		||||
	BIO_set_fp(ret,file,BIO_CLOSE);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
@@ -123,6 +124,7 @@ BIO *BIO_new_fp(FILE *stream, int close_flag)
 | 
			
		||||
	if ((ret=BIO_new(BIO_s_file())) == NULL)
 | 
			
		||||
		return(NULL);
 | 
			
		||||
 | 
			
		||||
	BIO_set_flags(ret,BIO_FLAGS_UPLINK); /* redundant, left for documentation puposes */
 | 
			
		||||
	BIO_set_fp(ret,stream,close_flag);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
@@ -137,6 +139,7 @@ static int MS_CALLBACK file_new(BIO *bi)
 | 
			
		||||
	bi->init=0;
 | 
			
		||||
	bi->num=0;
 | 
			
		||||
	bi->ptr=NULL;
 | 
			
		||||
	bi->flags=BIO_FLAGS_UPLINK; /* default to UPLINK */
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -147,8 +150,12 @@ static int MS_CALLBACK file_free(BIO *a)
 | 
			
		||||
		{
 | 
			
		||||
		if ((a->init) && (a->ptr != NULL))
 | 
			
		||||
			{
 | 
			
		||||
			fclose((FILE *)a->ptr);
 | 
			
		||||
			if (a->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
				UP_fclose (a->ptr);
 | 
			
		||||
			else
 | 
			
		||||
				fclose (a->ptr);
 | 
			
		||||
			a->ptr=NULL;
 | 
			
		||||
			a->flags=BIO_FLAGS_UPLINK;
 | 
			
		||||
			}
 | 
			
		||||
		a->init=0;
 | 
			
		||||
		}
 | 
			
		||||
@@ -161,8 +168,11 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
 | 
			
		||||
 | 
			
		||||
	if (b->init && (out != NULL))
 | 
			
		||||
		{
 | 
			
		||||
		ret=fread(out,1,(int)outl,(FILE *)b->ptr);
 | 
			
		||||
		if(ret == 0 && ferror((FILE *)b->ptr))
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			ret=UP_fread(out,1,(int)outl,b->ptr);
 | 
			
		||||
		else
 | 
			
		||||
			ret=fread(out,1,(int)outl,(FILE *)b->ptr);
 | 
			
		||||
		if(ret == 0 && (b->flags&BIO_FLAGS_UPLINK)?UP_ferror((FILE *)b->ptr):ferror((FILE *)b->ptr))
 | 
			
		||||
			{
 | 
			
		||||
			SYSerr(SYS_F_FREAD,get_last_sys_error());
 | 
			
		||||
			BIOerr(BIO_F_FILE_READ,ERR_R_SYS_LIB);
 | 
			
		||||
@@ -178,7 +188,11 @@ static int MS_CALLBACK file_write(BIO *b, const char *in, int inl)
 | 
			
		||||
 | 
			
		||||
	if (b->init && (in != NULL))
 | 
			
		||||
		{
 | 
			
		||||
		if (fwrite(in,(int)inl,1,(FILE *)b->ptr))
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			ret=UP_fwrite(in,(int)inl,1,b->ptr);
 | 
			
		||||
		else
 | 
			
		||||
			ret=fwrite(in,(int)inl,1,(FILE *)b->ptr);
 | 
			
		||||
		if (ret)
 | 
			
		||||
			ret=inl;
 | 
			
		||||
		/* ret=fwrite(in,1,(int)inl,(FILE *)b->ptr); */
 | 
			
		||||
		/* according to Tim Hudson <tjh@cryptsoft.com>, the commented
 | 
			
		||||
@@ -199,20 +213,45 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		{
 | 
			
		||||
	case BIO_C_FILE_SEEK:
 | 
			
		||||
	case BIO_CTRL_RESET:
 | 
			
		||||
		ret=(long)fseek(fp,num,0);
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			ret=(long)UP_fseek(b->ptr,num,0);
 | 
			
		||||
		else
 | 
			
		||||
			ret=(long)fseek(fp,num,0);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_EOF:
 | 
			
		||||
		ret=(long)feof(fp);
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			ret=(long)UP_feof(fp);
 | 
			
		||||
		else
 | 
			
		||||
			ret=(long)feof(fp);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_C_FILE_TELL:
 | 
			
		||||
	case BIO_CTRL_INFO:
 | 
			
		||||
		ret=ftell(fp);
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			ret=UP_ftell(b->ptr);
 | 
			
		||||
		else
 | 
			
		||||
			ret=ftell(fp);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_C_SET_FILE_PTR:
 | 
			
		||||
		file_free(b);
 | 
			
		||||
		b->shutdown=(int)num&BIO_CLOSE;
 | 
			
		||||
		b->ptr=(char *)ptr;
 | 
			
		||||
		b->ptr=ptr;
 | 
			
		||||
		b->init=1;
 | 
			
		||||
#if BIO_FLAGS_UPLINK!=0
 | 
			
		||||
#if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES)
 | 
			
		||||
#define _IOB_ENTRIES 20
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(_IOB_ENTRIES)
 | 
			
		||||
		/* Safety net to catch purely internal BIO_set_fp calls */
 | 
			
		||||
		if ((size_t)ptr >= (size_t)stdin &&
 | 
			
		||||
		    (size_t)ptr <  (size_t)(stdin+_IOB_ENTRIES))
 | 
			
		||||
			BIO_clear_flags(b,BIO_FLAGS_UPLINK);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef UP_fsetmode
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			UP_fsetmode(b->ptr,num&BIO_FP_TEXT?'t':'b');
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
		{
 | 
			
		||||
#if defined(OPENSSL_SYS_WINDOWS)
 | 
			
		||||
		int fd = fileno((FILE*)ptr);
 | 
			
		||||
@@ -286,7 +325,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		else
 | 
			
		||||
			strcat(p,"t");
 | 
			
		||||
#endif
 | 
			
		||||
fp=fopen(ptr,p);
 | 
			
		||||
		fp=fopen(ptr,p);
 | 
			
		||||
		if (fp == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			SYSerr(SYS_F_FOPEN,get_last_sys_error());
 | 
			
		||||
@@ -295,8 +334,9 @@ fp=fopen(ptr,p);
 | 
			
		||||
			ret=0;
 | 
			
		||||
			break;
 | 
			
		||||
			}
 | 
			
		||||
		b->ptr=(char *)fp;
 | 
			
		||||
		b->ptr=fp;
 | 
			
		||||
		b->init=1;
 | 
			
		||||
		BIO_clear_flags(b,BIO_FLAGS_UPLINK); /* we did fopen -> we disengage UPLINK */
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_C_GET_FILE_PTR:
 | 
			
		||||
		/* the ptr parameter is actually a FILE ** in this case. */
 | 
			
		||||
@@ -313,7 +353,10 @@ fp=fopen(ptr,p);
 | 
			
		||||
		b->shutdown=(int)num;
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_FLUSH:
 | 
			
		||||
		fflush((FILE *)b->ptr);
 | 
			
		||||
		if (b->flags&BIO_FLAGS_UPLINK)
 | 
			
		||||
			UP_fflush(b->ptr);
 | 
			
		||||
		else
 | 
			
		||||
			fflush((FILE *)b->ptr);
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DUP:
 | 
			
		||||
		ret=1;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,6 @@ CC=	cc
 | 
			
		||||
CPP=    $(CC) -E
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -85,7 +79,10 @@ co86-out.s: asm/co-586.pl ../perlasm/x86asm.pl
 | 
			
		||||
	(cd asm; $(PERL) co-586.pl a.out $(CFLAGS) > ../$@)
 | 
			
		||||
 | 
			
		||||
sparcv8.o:	asm/sparcv8.S
 | 
			
		||||
 | 
			
		||||
sparcv8plus.o:	asm/sparcv8plus.S
 | 
			
		||||
	$(CC) $(CFLAGS) -c asm/sparcv8plus.S
 | 
			
		||||
 | 
			
		||||
mips3.o:	asm/mips3.s
 | 
			
		||||
 | 
			
		||||
x86_64-gcc.o:	asm/x86_64-gcc.c
 | 
			
		||||
@@ -117,6 +114,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -140,6 +138,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -94,10 +94,6 @@ extern "C" {
 | 
			
		||||
/* #define BN_DEBUG */
 | 
			
		||||
/* #define BN_DEBUG_RAND */
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_SYS_VMS
 | 
			
		||||
#undef BN_LLONG /* experimental, so far... */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define BN_MUL_COMBA
 | 
			
		||||
#define BN_SQR_COMBA
 | 
			
		||||
#define BN_RECURSION
 | 
			
		||||
@@ -169,10 +165,12 @@ extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef THIRTY_TWO_BIT
 | 
			
		||||
#if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__)
 | 
			
		||||
#define BN_ULLONG	unsigned _int64
 | 
			
		||||
#else
 | 
			
		||||
#define BN_ULLONG	unsigned long long
 | 
			
		||||
#ifdef BN_LLONG
 | 
			
		||||
# if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__)
 | 
			
		||||
#  define BN_ULLONG	unsigned _int64
 | 
			
		||||
# else
 | 
			
		||||
#  define BN_ULLONG	unsigned long long
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
#define BN_ULONG	unsigned long
 | 
			
		||||
#define BN_LONG		long
 | 
			
		||||
@@ -247,12 +245,23 @@ extern "C" {
 | 
			
		||||
 | 
			
		||||
#define BN_FLG_MALLOCED		0x01
 | 
			
		||||
#define BN_FLG_STATIC_DATA	0x02
 | 
			
		||||
#define BN_FLG_EXP_CONSTTIME	0x04 /* avoid leaking exponent information through timings
 | 
			
		||||
                            	      * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
 | 
			
		||||
#ifndef OPENSSL_NO_DEPRECATED
 | 
			
		||||
#define BN_FLG_FREE		0x8000	/* used for debuging */
 | 
			
		||||
#endif
 | 
			
		||||
#define BN_set_flags(b,n)	((b)->flags|=(n))
 | 
			
		||||
#define BN_get_flags(b,n)	((b)->flags&(n))
 | 
			
		||||
 | 
			
		||||
#define BN_with_flags(dest,b,n)  ((dest)->d=(b)->d, \
 | 
			
		||||
                                  (dest)->top=(b)->top, \
 | 
			
		||||
                                  (dest)->dmax=(b)->dmax, \
 | 
			
		||||
                                  (dest)->neg=(b)->neg, \
 | 
			
		||||
                                  (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \
 | 
			
		||||
                                                 |  ((b)->flags & ~BN_FLG_MALLOCED) \
 | 
			
		||||
                                                 |  BN_FLG_STATIC_DATA \
 | 
			
		||||
                                                 |  (n)))
 | 
			
		||||
 | 
			
		||||
/* Already declared in ossl_typ.h */
 | 
			
		||||
#if 0
 | 
			
		||||
typedef struct bignum_st BIGNUM;
 | 
			
		||||
@@ -441,6 +450,8 @@ int	BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	const BIGNUM *m,BN_CTX *ctx);
 | 
			
		||||
int	BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 | 
			
		||||
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont);
 | 
			
		||||
int	BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
 | 
			
		||||
	const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 | 
			
		||||
int	BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
 | 
			
		||||
@@ -730,38 +741,42 @@ void ERR_load_BN_strings(void);
 | 
			
		||||
/* Error codes for the BN functions. */
 | 
			
		||||
 | 
			
		||||
/* Function codes. */
 | 
			
		||||
#define BN_F_BNRAND					 114
 | 
			
		||||
#define BN_F_BN_BLINDING_CONVERT			 100
 | 
			
		||||
#define BN_F_BN_BLINDING_CREATE_PARAM			 133
 | 
			
		||||
#define BN_F_BN_BLINDING_INVERT				 101
 | 
			
		||||
#define BN_F_BNRAND					 127
 | 
			
		||||
#define BN_F_BN_BLINDING_CONVERT_EX			 100
 | 
			
		||||
#define BN_F_BN_BLINDING_CREATE_PARAM			 128
 | 
			
		||||
#define BN_F_BN_BLINDING_INVERT_EX			 101
 | 
			
		||||
#define BN_F_BN_BLINDING_NEW				 102
 | 
			
		||||
#define BN_F_BN_BLINDING_UPDATE				 103
 | 
			
		||||
#define BN_F_BN_BN2DEC					 104
 | 
			
		||||
#define BN_F_BN_BN2HEX					 105
 | 
			
		||||
#define BN_F_BN_CTX_GET					 116
 | 
			
		||||
#define BN_F_BN_CTX_NEW					 106
 | 
			
		||||
#define BN_F_BN_CTX_START				 130
 | 
			
		||||
#define BN_F_BN_CTX_START				 129
 | 
			
		||||
#define BN_F_BN_DIV					 107
 | 
			
		||||
#define BN_F_BN_DIV_RECP				 131
 | 
			
		||||
#define BN_F_BN_DIV_RECP				 130
 | 
			
		||||
#define BN_F_BN_EXP					 123
 | 
			
		||||
#define BN_F_BN_EXPAND2					 108
 | 
			
		||||
#define BN_F_BN_EXPAND_INTERNAL				 120
 | 
			
		||||
#define BN_F_BN_GF2M_MOD				 126
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_DIV				 123
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_EXP				 127
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_MUL				 124
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SOLVE_QUAD			 128
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR			 129
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SQR				 125
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SQRT				 132
 | 
			
		||||
#define BN_F_BN_GF2M_MOD				 131
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_EXP				 132
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_MUL				 133
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SOLVE_QUAD			 134
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR			 135
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SQR				 136
 | 
			
		||||
#define BN_F_BN_GF2M_MOD_SQRT				 137
 | 
			
		||||
#define BN_F_BN_MOD_EXP2_MONT				 118
 | 
			
		||||
#define BN_F_BN_MOD_EXP_MONT				 109
 | 
			
		||||
#define BN_F_BN_MOD_EXP_MONT_CONSTTIME			 124
 | 
			
		||||
#define BN_F_BN_MOD_EXP_MONT_WORD			 117
 | 
			
		||||
#define BN_F_BN_MOD_EXP_RECP				 125
 | 
			
		||||
#define BN_F_BN_MOD_EXP_SIMPLE				 126
 | 
			
		||||
#define BN_F_BN_MOD_INVERSE				 110
 | 
			
		||||
#define BN_F_BN_MOD_LSHIFT_QUICK			 119
 | 
			
		||||
#define BN_F_BN_MOD_MUL_RECIPROCAL			 111
 | 
			
		||||
#define BN_F_BN_MOD_SQRT				 121
 | 
			
		||||
#define BN_F_BN_MPI2BN					 112
 | 
			
		||||
#define BN_F_BN_NEW					 113
 | 
			
		||||
#define BN_F_BN_RAND					 114
 | 
			
		||||
#define BN_F_BN_RAND_RANGE				 122
 | 
			
		||||
#define BN_F_BN_USUB					 115
 | 
			
		||||
 | 
			
		||||
@@ -777,10 +792,9 @@ void ERR_load_BN_strings(void);
 | 
			
		||||
#define BN_R_INVALID_LENGTH				 106
 | 
			
		||||
#define BN_R_INVALID_RANGE				 115
 | 
			
		||||
#define BN_R_NOT_A_SQUARE				 111
 | 
			
		||||
#define BN_R_NOT_IMPLEMENTED				 116
 | 
			
		||||
#define BN_R_NOT_INITIALIZED				 107
 | 
			
		||||
#define BN_R_NO_INVERSE					 108
 | 
			
		||||
#define BN_R_NO_SOLUTION				 117
 | 
			
		||||
#define BN_R_NO_SOLUTION				 116
 | 
			
		||||
#define BN_R_P_IS_NOT_PRIME				 112
 | 
			
		||||
#define BN_R_TOO_MANY_ITERATIONS			 113
 | 
			
		||||
#define BN_R_TOO_MANY_TEMPORARY_VARIABLES		 109
 | 
			
		||||
 
 | 
			
		||||
@@ -211,7 +211,7 @@ int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
 | 
			
		||||
 | 
			
		||||
	if ((b->A == NULL) || (b->Ai == NULL))
 | 
			
		||||
		{
 | 
			
		||||
		BNerr(BN_F_BN_BLINDING_CONVERT,BN_R_NOT_INITIALIZED);
 | 
			
		||||
		BNerr(BN_F_BN_BLINDING_CONVERT_EX,BN_R_NOT_INITIALIZED);
 | 
			
		||||
		return(0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -233,7 +233,7 @@ int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ct
 | 
			
		||||
	bn_check_top(n);
 | 
			
		||||
	if ((b->A == NULL) || (b->Ai == NULL))
 | 
			
		||||
		{
 | 
			
		||||
		BNerr(BN_F_BN_BLINDING_INVERT,BN_R_NOT_INITIALIZED);
 | 
			
		||||
		BNerr(BN_F_BN_BLINDING_INVERT_EX,BN_R_NOT_INITIALIZED);
 | 
			
		||||
		return(0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -71,9 +71,9 @@
 | 
			
		||||
static ERR_STRING_DATA BN_str_functs[]=
 | 
			
		||||
	{
 | 
			
		||||
{ERR_FUNC(BN_F_BNRAND),	"BNRAND"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BLINDING_CONVERT),	"BN_BLINDING_convert"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BLINDING_CONVERT_EX),	"BN_BLINDING_convert_ex"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BLINDING_CREATE_PARAM),	"BN_BLINDING_create_param"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BLINDING_INVERT),	"BN_BLINDING_invert"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BLINDING_INVERT_EX),	"BN_BLINDING_invert_ex"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BLINDING_NEW),	"BN_BLINDING_new"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BLINDING_UPDATE),	"BN_BLINDING_update"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_BN2DEC),	"BN_bn2dec"},
 | 
			
		||||
@@ -83,10 +83,10 @@ static ERR_STRING_DATA BN_str_functs[]=
 | 
			
		||||
{ERR_FUNC(BN_F_BN_CTX_START),	"BN_CTX_start"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_DIV),	"BN_div"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_DIV_RECP),	"BN_div_recp"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_EXP),	"BN_exp"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_EXPAND2),	"bn_expand2"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_EXPAND_INTERNAL),	"BN_EXPAND_INTERNAL"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_GF2M_MOD),	"BN_GF2m_mod"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_DIV),	"BN_GF2m_mod_div"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_EXP),	"BN_GF2m_mod_exp"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_MUL),	"BN_GF2m_mod_mul"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_SOLVE_QUAD),	"BN_GF2m_mod_solve_quad"},
 | 
			
		||||
@@ -95,13 +95,17 @@ static ERR_STRING_DATA BN_str_functs[]=
 | 
			
		||||
{ERR_FUNC(BN_F_BN_GF2M_MOD_SQRT),	"BN_GF2m_mod_sqrt"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP2_MONT),	"BN_mod_exp2_mont"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT),	"BN_mod_exp_mont"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT_CONSTTIME),	"BN_mod_exp_mont_consttime"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT_WORD),	"BN_mod_exp_mont_word"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP_RECP),	"BN_mod_exp_recp"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP_SIMPLE),	"BN_mod_exp_simple"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_INVERSE),	"BN_mod_inverse"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_LSHIFT_QUICK),	"BN_mod_lshift_quick"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_MUL_RECIPROCAL),	"BN_mod_mul_reciprocal"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_SQRT),	"BN_mod_sqrt"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MPI2BN),	"BN_mpi2bn"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_NEW),	"BN_new"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_RAND),	"BN_rand"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_RAND_RANGE),	"BN_rand_range"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_USUB),	"BN_usub"},
 | 
			
		||||
{0,NULL}
 | 
			
		||||
@@ -120,7 +124,6 @@ static ERR_STRING_DATA BN_str_reasons[]=
 | 
			
		||||
{ERR_REASON(BN_R_INVALID_LENGTH)         ,"invalid length"},
 | 
			
		||||
{ERR_REASON(BN_R_INVALID_RANGE)          ,"invalid range"},
 | 
			
		||||
{ERR_REASON(BN_R_NOT_A_SQUARE)           ,"not a square"},
 | 
			
		||||
{ERR_REASON(BN_R_NOT_IMPLEMENTED)        ,"not implemented"},
 | 
			
		||||
{ERR_REASON(BN_R_NOT_INITIALIZED)        ,"not initialized"},
 | 
			
		||||
{ERR_REASON(BN_R_NO_INVERSE)             ,"no inverse"},
 | 
			
		||||
{ERR_REASON(BN_R_NO_SOLUTION)            ,"no solution"},
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1998-2005 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
 | 
			
		||||
@@ -113,6 +113,7 @@
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include "bn_lcl.h"
 | 
			
		||||
 | 
			
		||||
/* maximum precomputation table size for *variable* sliding windows */
 | 
			
		||||
#define TABLE_SIZE	32
 | 
			
		||||
 | 
			
		||||
/* this one works - simple but works */
 | 
			
		||||
@@ -121,6 +122,13 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
	int i,bits,ret=0;
 | 
			
		||||
	BIGNUM *v,*rr;
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	BN_CTX_start(ctx);
 | 
			
		||||
	if ((r == a) || (r == p))
 | 
			
		||||
		rr = BN_CTX_get(ctx);
 | 
			
		||||
@@ -205,7 +213,7 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
 | 
			
		||||
	if (BN_is_odd(m))
 | 
			
		||||
		{
 | 
			
		||||
#  ifdef MONT_EXP_WORD
 | 
			
		||||
		if (a->top == 1 && !a->neg)
 | 
			
		||||
		if (a->top == 1 && !a->neg && (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) == 0))
 | 
			
		||||
			{
 | 
			
		||||
			BN_ULONG A = a->d[0];
 | 
			
		||||
			ret=BN_mod_exp_mont_word(r,A,p,m,ctx,NULL);
 | 
			
		||||
@@ -237,6 +245,13 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	BIGNUM *val[TABLE_SIZE];
 | 
			
		||||
	BN_RECP_CTX recp;
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_RECP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	bits=BN_num_bits(p);
 | 
			
		||||
 | 
			
		||||
	if (bits == 0)
 | 
			
		||||
@@ -364,6 +379,11 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	BIGNUM *val[TABLE_SIZE];
 | 
			
		||||
	BN_MONT_CTX *mont=NULL;
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	bn_check_top(a);
 | 
			
		||||
	bn_check_top(p);
 | 
			
		||||
	bn_check_top(m);
 | 
			
		||||
@@ -495,6 +515,212 @@ err:
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific layout
 | 
			
		||||
 * so that accessing any of these table values shows the same access pattern as far
 | 
			
		||||
 * as cache lines are concerned.  The following functions are used to transfer a BIGNUM
 | 
			
		||||
 * from/to that table. */
 | 
			
		||||
 | 
			
		||||
static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width)
 | 
			
		||||
	{
 | 
			
		||||
	size_t i, j;
 | 
			
		||||
 | 
			
		||||
	if (bn_wexpand(b, top) == NULL)
 | 
			
		||||
		return 0;
 | 
			
		||||
	while (b->top < top)
 | 
			
		||||
		{
 | 
			
		||||
		b->d[b->top++] = 0;
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
	for (i = 0, j=idx; i < top * sizeof b->d[0]; i++, j+=width)
 | 
			
		||||
		{
 | 
			
		||||
		buf[j] = ((unsigned char*)b->d)[i];
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	bn_correct_top(b);
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width)
 | 
			
		||||
	{
 | 
			
		||||
	size_t i, j;
 | 
			
		||||
 | 
			
		||||
	if (bn_wexpand(b, top) == NULL)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	for (i=0, j=idx; i < top * sizeof b->d[0]; i++, j+=width)
 | 
			
		||||
		{
 | 
			
		||||
		((unsigned char*)b->d)[i] = buf[j];
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	b->top = top;
 | 
			
		||||
	bn_correct_top(b);
 | 
			
		||||
	return 1;
 | 
			
		||||
	}	
 | 
			
		||||
 | 
			
		||||
/* Given a pointer value, compute the next address that is a cache line multiple. */
 | 
			
		||||
#define MOD_EXP_CTIME_ALIGN(x_) \
 | 
			
		||||
	((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ULONG)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
 | 
			
		||||
 | 
			
		||||
/* This variant of BN_mod_exp_mont() uses fixed windows and the special
 | 
			
		||||
 * precomputation memory layout to limit data-dependency to a minimum
 | 
			
		||||
 * to protect secret exponents (cf. the hyper-threading timing attacks
 | 
			
		||||
 * pointed out by Colin Percival,
 | 
			
		||||
 * http://www.daemonology.net/hyperthreading-considered-harmful/)
 | 
			
		||||
 */
 | 
			
		||||
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
		    const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
 | 
			
		||||
	{
 | 
			
		||||
	int i,bits,ret=0,idx,window,wvalue;
 | 
			
		||||
	int top;
 | 
			
		||||
 	BIGNUM *r;
 | 
			
		||||
	const BIGNUM *aa;
 | 
			
		||||
	BN_MONT_CTX *mont=NULL;
 | 
			
		||||
 | 
			
		||||
	int numPowers;
 | 
			
		||||
	unsigned char *powerbufFree=NULL;
 | 
			
		||||
	int powerbufLen = 0;
 | 
			
		||||
	unsigned char *powerbuf=NULL;
 | 
			
		||||
	BIGNUM *computeTemp=NULL, *am=NULL;
 | 
			
		||||
 | 
			
		||||
	bn_check_top(a);
 | 
			
		||||
	bn_check_top(p);
 | 
			
		||||
	bn_check_top(m);
 | 
			
		||||
 | 
			
		||||
	top = m->top;
 | 
			
		||||
 | 
			
		||||
	if (!(m->d[0] & 1))
 | 
			
		||||
		{
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME,BN_R_CALLED_WITH_EVEN_MODULUS);
 | 
			
		||||
		return(0);
 | 
			
		||||
		}
 | 
			
		||||
	bits=BN_num_bits(p);
 | 
			
		||||
	if (bits == 0)
 | 
			
		||||
		{
 | 
			
		||||
		ret = BN_one(rr);
 | 
			
		||||
		return ret;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 	/* Initialize BIGNUM context and allocate intermediate result */
 | 
			
		||||
	BN_CTX_start(ctx);
 | 
			
		||||
	r = BN_CTX_get(ctx);
 | 
			
		||||
	if (r == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	/* Allocate a montgomery context if it was not supplied by the caller.
 | 
			
		||||
	 * If this is not done, things will break in the montgomery part.
 | 
			
		||||
 	 */
 | 
			
		||||
	if (in_mont != NULL)
 | 
			
		||||
		mont=in_mont;
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if ((mont=BN_MONT_CTX_new()) == NULL) goto err;
 | 
			
		||||
		if (!BN_MONT_CTX_set(mont,m,ctx)) goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/* Get the window size to use with size of p. */
 | 
			
		||||
	window = BN_window_bits_for_ctime_exponent_size(bits);
 | 
			
		||||
 | 
			
		||||
	/* Allocate a buffer large enough to hold all of the pre-computed
 | 
			
		||||
	 * powers of a.
 | 
			
		||||
	 */
 | 
			
		||||
	numPowers = 1 << window;
 | 
			
		||||
	powerbufLen = sizeof(m->d[0])*top*numPowers;
 | 
			
		||||
	if ((powerbufFree=(unsigned char*)OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL)
 | 
			
		||||
		goto err;
 | 
			
		||||
		
 | 
			
		||||
	powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
 | 
			
		||||
	memset(powerbuf, 0, powerbufLen);
 | 
			
		||||
 | 
			
		||||
 	/* Initialize the intermediate result. Do this early to save double conversion,
 | 
			
		||||
	 * once each for a^0 and intermediate result.
 | 
			
		||||
	 */
 | 
			
		||||
 	if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err;
 | 
			
		||||
	if (!MOD_EXP_CTIME_COPY_TO_PREBUF(r, top, powerbuf, 0, numPowers)) goto err;
 | 
			
		||||
 | 
			
		||||
	/* Initialize computeTemp as a^1 with montgomery precalcs */
 | 
			
		||||
	computeTemp = BN_CTX_get(ctx);
 | 
			
		||||
	am = BN_CTX_get(ctx);
 | 
			
		||||
	if (computeTemp==NULL || am==NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	if (a->neg || BN_ucmp(a,m) >= 0)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_mod(am,a,m,ctx))
 | 
			
		||||
			goto err;
 | 
			
		||||
		aa= am;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		aa=a;
 | 
			
		||||
	if (!BN_to_montgomery(am,aa,mont,ctx)) goto err;
 | 
			
		||||
	if (!BN_copy(computeTemp, am)) goto err;
 | 
			
		||||
	if (!MOD_EXP_CTIME_COPY_TO_PREBUF(am, top, powerbuf, 1, numPowers)) goto err;
 | 
			
		||||
 | 
			
		||||
	/* If the window size is greater than 1, then calculate
 | 
			
		||||
	 * val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1)
 | 
			
		||||
	 * (even powers could instead be computed as (a^(i/2))^2
 | 
			
		||||
	 * to use the slight performance advantage of sqr over mul).
 | 
			
		||||
	 */
 | 
			
		||||
	if (window > 1)
 | 
			
		||||
		{
 | 
			
		||||
		for (i=2; i<numPowers; i++)
 | 
			
		||||
			{
 | 
			
		||||
			/* Calculate a^i = a^(i-1) * a */
 | 
			
		||||
			if (!BN_mod_mul_montgomery(computeTemp,am,computeTemp,mont,ctx))
 | 
			
		||||
				goto err;
 | 
			
		||||
			if (!MOD_EXP_CTIME_COPY_TO_PREBUF(computeTemp, top, powerbuf, i, numPowers)) goto err;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 	/* Adjust the number of bits up to a multiple of the window size.
 | 
			
		||||
 	 * If the exponent length is not a multiple of the window size, then
 | 
			
		||||
 	 * this pads the most significant bits with zeros to normalize the
 | 
			
		||||
 	 * scanning loop to there's no special cases.
 | 
			
		||||
 	 *
 | 
			
		||||
 	 * * NOTE: Making the window size a power of two less than the native
 | 
			
		||||
	 * * word size ensures that the padded bits won't go past the last
 | 
			
		||||
 	 * * word in the internal BIGNUM structure. Going past the end will
 | 
			
		||||
 	 * * still produce the correct result, but causes a different branch
 | 
			
		||||
 	 * * to be taken in the BN_is_bit_set function.
 | 
			
		||||
 	 */
 | 
			
		||||
 	bits = ((bits+window-1)/window)*window;
 | 
			
		||||
 	idx=bits-1;	/* The top bit of the window */
 | 
			
		||||
 | 
			
		||||
 	/* Scan the exponent one window at a time starting from the most
 | 
			
		||||
 	 * significant bits.
 | 
			
		||||
 	 */
 | 
			
		||||
 	while (idx >= 0)
 | 
			
		||||
  		{
 | 
			
		||||
 		wvalue=0; /* The 'value' of the window */
 | 
			
		||||
 		
 | 
			
		||||
 		/* Scan the window, squaring the result as we go */
 | 
			
		||||
 		for (i=0; i<window; i++,idx--)
 | 
			
		||||
 			{
 | 
			
		||||
			if (!BN_mod_mul_montgomery(r,r,r,mont,ctx))	goto err;
 | 
			
		||||
			wvalue = (wvalue<<1)+BN_is_bit_set(p,idx);
 | 
			
		||||
  			}
 | 
			
		||||
 		
 | 
			
		||||
		/* Fetch the appropriate pre-computed value from the pre-buf */
 | 
			
		||||
		if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(computeTemp, top, powerbuf, wvalue, numPowers)) goto err;
 | 
			
		||||
 | 
			
		||||
 		/* Multiply the result into the intermediate result */
 | 
			
		||||
 		if (!BN_mod_mul_montgomery(r,r,computeTemp,mont,ctx)) goto err;
 | 
			
		||||
  		}
 | 
			
		||||
 | 
			
		||||
 	/* Convert the final result from montgomery to standard format */
 | 
			
		||||
	if (!BN_from_montgomery(rr,r,mont,ctx)) goto err;
 | 
			
		||||
	ret=1;
 | 
			
		||||
err:
 | 
			
		||||
	if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont);
 | 
			
		||||
	if (powerbuf!=NULL)
 | 
			
		||||
		{
 | 
			
		||||
		OPENSSL_cleanse(powerbuf,powerbufLen);
 | 
			
		||||
		OPENSSL_free(powerbufFree);
 | 
			
		||||
		}
 | 
			
		||||
 	if (am!=NULL) BN_clear(am);
 | 
			
		||||
 	if (computeTemp!=NULL) BN_clear(computeTemp);
 | 
			
		||||
	BN_CTX_end(ctx);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
 | 
			
		||||
                         const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
 | 
			
		||||
	{
 | 
			
		||||
@@ -519,6 +745,13 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
 | 
			
		||||
#define BN_TO_MONTGOMERY_WORD(r, w, mont) \
 | 
			
		||||
		(BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_MONT_WORD,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	bn_check_top(p);
 | 
			
		||||
	bn_check_top(m);
 | 
			
		||||
 | 
			
		||||
@@ -648,6 +881,13 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	/* Table of variables obtained from 'ctx' */
 | 
			
		||||
	BIGNUM *val[TABLE_SIZE];
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_SIMPLE,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	bits=BN_num_bits(p);
 | 
			
		||||
 | 
			
		||||
	if (bits == 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -163,6 +163,45 @@ extern "C" {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* BN_mod_exp_mont_conttime is based on the assumption that the
 | 
			
		||||
 * L1 data cache line width of the target processor is at least
 | 
			
		||||
 * the following value.
 | 
			
		||||
 */
 | 
			
		||||
#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH	( 64 )
 | 
			
		||||
#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK	(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)
 | 
			
		||||
 | 
			
		||||
/* Window sizes optimized for fixed window size modular exponentiation
 | 
			
		||||
 * algorithm (BN_mod_exp_mont_consttime).
 | 
			
		||||
 *
 | 
			
		||||
 * To achieve the security goals of BN_mode_exp_mont_consttime, the
 | 
			
		||||
 * maximum size of the window must not exceed
 | 
			
		||||
 * log_2(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH). 
 | 
			
		||||
 *
 | 
			
		||||
 * Window size thresholds are defined for cache line sizes of 32 and 64,
 | 
			
		||||
 * cache line sizes where log_2(32)=5 and log_2(64)=6 respectively. A
 | 
			
		||||
 * window size of 7 should only be used on processors that have a 128
 | 
			
		||||
 * byte or greater cache line size.
 | 
			
		||||
 */
 | 
			
		||||
#if MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 64
 | 
			
		||||
 | 
			
		||||
#  define BN_window_bits_for_ctime_exponent_size(b) \
 | 
			
		||||
		((b) > 937 ? 6 : \
 | 
			
		||||
		 (b) > 306 ? 5 : \
 | 
			
		||||
		 (b) >  89 ? 4 : \
 | 
			
		||||
		 (b) >  22 ? 3 : 1)
 | 
			
		||||
#  define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE	(6)
 | 
			
		||||
 | 
			
		||||
#elif MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH == 32
 | 
			
		||||
 | 
			
		||||
#  define BN_window_bits_for_ctime_exponent_size(b) \
 | 
			
		||||
		((b) > 306 ? 5 : \
 | 
			
		||||
		 (b) >  89 ? 4 : \
 | 
			
		||||
		 (b) >  22 ? 3 : 1)
 | 
			
		||||
#  define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE	(5)
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Pentium pro 16,16,16,32,64 */
 | 
			
		||||
/* Alpha       16,16,16,16.64 */
 | 
			
		||||
#define BN_MULL_SIZE_NORMAL			(16) /* 32 */
 | 
			
		||||
 
 | 
			
		||||
@@ -282,6 +282,11 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
 | 
			
		||||
	nist_cp_bn_0(buf, a_d + BN_NIST_192_TOP, top - BN_NIST_192_TOP, BN_NIST_192_TOP);
 | 
			
		||||
 | 
			
		||||
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
 | 
			
		||||
# pragma save
 | 
			
		||||
# pragma message disable BADSUBSCRIPT
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	nist_set_192(t_d, buf, 0, 3, 3);
 | 
			
		||||
	if (bn_add_words(r_d, r_d, t_d, BN_NIST_192_TOP))
 | 
			
		||||
		++carry;
 | 
			
		||||
@@ -290,6 +295,10 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
	if (bn_add_words(r_d, r_d, t_d, BN_NIST_192_TOP))
 | 
			
		||||
		++carry;
 | 
			
		||||
 | 
			
		||||
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
 | 
			
		||||
# pragma restore
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	nist_set_192(t_d, buf, 5, 5, 5)
 | 
			
		||||
	if (bn_add_words(r_d, r_d, t_d, BN_NIST_192_TOP))
 | 
			
		||||
		++carry;
 | 
			
		||||
 
 | 
			
		||||
@@ -106,6 +106,7 @@ int test_mont(BIO *bp,BN_CTX *ctx);
 | 
			
		||||
int test_mod(BIO *bp,BN_CTX *ctx);
 | 
			
		||||
int test_mod_mul(BIO *bp,BN_CTX *ctx);
 | 
			
		||||
int test_mod_exp(BIO *bp,BN_CTX *ctx);
 | 
			
		||||
int test_mod_exp_mont_consttime(BIO *bp,BN_CTX *ctx);
 | 
			
		||||
int test_exp(BIO *bp,BN_CTX *ctx);
 | 
			
		||||
int test_gf2m_add(BIO *bp);
 | 
			
		||||
int test_gf2m_mod(BIO *bp);
 | 
			
		||||
@@ -246,6 +247,10 @@ int main(int argc, char *argv[])
 | 
			
		||||
	if (!test_mod_exp(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mod_exp_mont_consttime");
 | 
			
		||||
	if (!test_mod_exp_mont_consttime(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_exp");
 | 
			
		||||
	if (!test_exp(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
@@ -954,6 +959,57 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	BIGNUM *a,*b,*c,*d,*e;
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	a=BN_new();
 | 
			
		||||
	b=BN_new();
 | 
			
		||||
	c=BN_new();
 | 
			
		||||
	d=BN_new();
 | 
			
		||||
	e=BN_new();
 | 
			
		||||
 | 
			
		||||
	BN_bntest_rand(c,30,0,1); /* must be odd for montgomery */
 | 
			
		||||
	for (i=0; i<num2; i++)
 | 
			
		||||
		{
 | 
			
		||||
		BN_bntest_rand(a,20+i*5,0,0); /**/
 | 
			
		||||
		BN_bntest_rand(b,2+i,0,0); /**/
 | 
			
		||||
 | 
			
		||||
		if (!BN_mod_exp_mont_consttime(d,a,b,c,ctx,NULL))
 | 
			
		||||
			return(00);
 | 
			
		||||
 | 
			
		||||
		if (bp != NULL)
 | 
			
		||||
			{
 | 
			
		||||
			if (!results)
 | 
			
		||||
				{
 | 
			
		||||
				BN_print(bp,a);
 | 
			
		||||
				BIO_puts(bp," ^ ");
 | 
			
		||||
				BN_print(bp,b);
 | 
			
		||||
				BIO_puts(bp," % ");
 | 
			
		||||
				BN_print(bp,c);
 | 
			
		||||
				BIO_puts(bp," - ");
 | 
			
		||||
				}
 | 
			
		||||
			BN_print(bp,d);
 | 
			
		||||
			BIO_puts(bp,"\n");
 | 
			
		||||
			}
 | 
			
		||||
		BN_exp(e,a,b,ctx);
 | 
			
		||||
		BN_sub(e,e,d);
 | 
			
		||||
		BN_div(a,b,e,c,ctx);
 | 
			
		||||
		if(!BN_is_zero(b))
 | 
			
		||||
		    {
 | 
			
		||||
		    fprintf(stderr,"Modulo exponentiation test failed!\n");
 | 
			
		||||
		    return 0;
 | 
			
		||||
		    }
 | 
			
		||||
		}
 | 
			
		||||
	BN_free(a);
 | 
			
		||||
	BN_free(b);
 | 
			
		||||
	BN_free(c);
 | 
			
		||||
	BN_free(d);
 | 
			
		||||
	BN_free(e);
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int test_exp(BIO *bp, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	BIGNUM *a,*b,*d,*e,*one;
 | 
			
		||||
 
 | 
			
		||||
@@ -321,7 +321,7 @@ void do_mul_exp(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *c, BN_CTX *ctx)
 | 
			
		||||
#else /* TEST_SQRT */
 | 
			
		||||
			"2*sqrt [prime == %d (mod 64)] %4d %4d mod %4d"
 | 
			
		||||
#endif
 | 
			
		||||
			" -> %8.3fms %5.1f (%ld)\n",
 | 
			
		||||
			" -> %8.6fms %5.1f (%ld)\n",
 | 
			
		||||
#ifdef TEST_SQRT
 | 
			
		||||
			P_MOD_64,
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
	BIO *out=NULL;
 | 
			
		||||
	int i,ret;
 | 
			
		||||
	unsigned char c;
 | 
			
		||||
	BIGNUM *r_mont,*r_recp,*r_simple,*a,*b,*m;
 | 
			
		||||
	BIGNUM *r_mont,*r_mont_const,*r_recp,*r_simple,*a,*b,*m;
 | 
			
		||||
 | 
			
		||||
	RAND_seed(rnd_seed, sizeof rnd_seed); /* or BN_rand may fail, and we don't
 | 
			
		||||
	                                       * even check its return value
 | 
			
		||||
@@ -88,6 +88,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
	ctx=BN_CTX_new();
 | 
			
		||||
	if (ctx == NULL) EXIT(1);
 | 
			
		||||
	r_mont=BN_new();
 | 
			
		||||
	r_mont_const=BN_new();
 | 
			
		||||
	r_recp=BN_new();
 | 
			
		||||
	r_simple=BN_new();
 | 
			
		||||
	a=BN_new();
 | 
			
		||||
@@ -143,8 +144,17 @@ int main(int argc, char *argv[])
 | 
			
		||||
			EXIT(1);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		ret=BN_mod_exp_mont_consttime(r_mont_const,a,b,m,ctx,NULL);
 | 
			
		||||
		if (ret <= 0)
 | 
			
		||||
			{
 | 
			
		||||
			printf("BN_mod_exp_mont_consttime() problems\n");
 | 
			
		||||
			ERR_print_errors(out);
 | 
			
		||||
			EXIT(1);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (BN_cmp(r_simple, r_mont) == 0
 | 
			
		||||
		    && BN_cmp(r_simple,r_recp) == 0)
 | 
			
		||||
		    && BN_cmp(r_simple,r_recp) == 0
 | 
			
		||||
			&& BN_cmp(r_simple,r_mont_const) == 0)
 | 
			
		||||
			{
 | 
			
		||||
			printf(".");
 | 
			
		||||
			fflush(stdout);
 | 
			
		||||
@@ -153,6 +163,8 @@ int main(int argc, char *argv[])
 | 
			
		||||
		  	{
 | 
			
		||||
			if (BN_cmp(r_simple,r_mont) != 0)
 | 
			
		||||
				printf("\nsimple and mont results differ\n");
 | 
			
		||||
			if (BN_cmp(r_simple,r_mont) != 0)
 | 
			
		||||
				printf("\nsimple and mont const time results differ\n");
 | 
			
		||||
			if (BN_cmp(r_simple,r_recp) != 0)
 | 
			
		||||
				printf("\nsimple and recp results differ\n");
 | 
			
		||||
 | 
			
		||||
@@ -162,11 +174,13 @@ int main(int argc, char *argv[])
 | 
			
		||||
			printf("\nsimple   =");	BN_print(out,r_simple);
 | 
			
		||||
			printf("\nrecp     =");	BN_print(out,r_recp);
 | 
			
		||||
			printf("\nmont     ="); BN_print(out,r_mont);
 | 
			
		||||
			printf("\nmont_ct  ="); BN_print(out,r_mont_const);
 | 
			
		||||
			printf("\n");
 | 
			
		||||
			EXIT(1);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	BN_free(r_mont);
 | 
			
		||||
	BN_free(r_mont_const);
 | 
			
		||||
	BN_free(r_recp);
 | 
			
		||||
	BN_free(r_simple);
 | 
			
		||||
	BN_free(a);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -52,6 +46,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -67,6 +62,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,6 @@ CC=	cc
 | 
			
		||||
CPP=	$(CC) -E
 | 
			
		||||
INCLUDES=
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -67,6 +61,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -82,6 +77,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -55,6 +49,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -70,6 +65,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -55,6 +49,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -70,6 +65,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -213,7 +213,6 @@ void ERR_load_CONF_strings(void);
 | 
			
		||||
#define CONF_F_CONF_LOAD_BIO				 102
 | 
			
		||||
#define CONF_F_CONF_LOAD_FP				 103
 | 
			
		||||
#define CONF_F_CONF_MODULES_LOAD			 116
 | 
			
		||||
#define CONF_F_CONF_MODULE_RUN				 119
 | 
			
		||||
#define CONF_F_DEF_LOAD					 120
 | 
			
		||||
#define CONF_F_DEF_LOAD_BIO				 121
 | 
			
		||||
#define CONF_F_MODULE_INIT				 115
 | 
			
		||||
 
 | 
			
		||||
@@ -60,6 +60,7 @@
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/stack.h>
 | 
			
		||||
#include <openssl/lhash.h>
 | 
			
		||||
#include <openssl/conf.h>
 | 
			
		||||
@@ -67,7 +68,6 @@
 | 
			
		||||
#include "conf_def.h"
 | 
			
		||||
#include <openssl/buffer.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
 | 
			
		||||
static char *eat_ws(CONF *conf, char *p);
 | 
			
		||||
static char *eat_alpha_numeric(CONF *conf, char *p);
 | 
			
		||||
 
 | 
			
		||||
@@ -75,7 +75,6 @@ static ERR_STRING_DATA CONF_str_functs[]=
 | 
			
		||||
{ERR_FUNC(CONF_F_CONF_LOAD_BIO),	"CONF_load_bio"},
 | 
			
		||||
{ERR_FUNC(CONF_F_CONF_LOAD_FP),	"CONF_load_fp"},
 | 
			
		||||
{ERR_FUNC(CONF_F_CONF_MODULES_LOAD),	"CONF_modules_load"},
 | 
			
		||||
{ERR_FUNC(CONF_F_CONF_MODULE_RUN),	"CONF_MODULE_RUN"},
 | 
			
		||||
{ERR_FUNC(CONF_F_DEF_LOAD),	"DEF_LOAD"},
 | 
			
		||||
{ERR_FUNC(CONF_F_DEF_LOAD_BIO),	"DEF_LOAD_BIO"},
 | 
			
		||||
{ERR_FUNC(CONF_F_MODULE_INIT),	"MODULE_INIT"},
 | 
			
		||||
 
 | 
			
		||||
@@ -231,7 +231,7 @@ static int module_run(const CONF *cnf, char *name, char *value,
 | 
			
		||||
		if (!(flags & CONF_MFLAGS_SILENT))
 | 
			
		||||
			{
 | 
			
		||||
			char rcode[DECIMAL_SIZE(ret)+1];
 | 
			
		||||
			CONFerr(CONF_F_CONF_MODULE_RUN, CONF_R_MODULE_INITIALIZATION_ERROR);
 | 
			
		||||
			CONFerr(CONF_F_MODULE_RUN, CONF_R_MODULE_INITIALIZATION_ERROR);
 | 
			
		||||
			BIO_snprintf(rcode, sizeof rcode, "%-8d", ret);
 | 
			
		||||
			ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -624,7 +624,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
 | 
			
		||||
#include <tchar.h>
 | 
			
		||||
 | 
			
		||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
 | 
			
		||||
static int IsService(void)
 | 
			
		||||
int OPENSSL_isservice(void)
 | 
			
		||||
{ HWINSTA h;
 | 
			
		||||
  DWORD len;
 | 
			
		||||
  WCHAR *name;
 | 
			
		||||
@@ -722,7 +722,7 @@ void OPENSSL_showfatal (const char *fmta,...)
 | 
			
		||||
 | 
			
		||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
 | 
			
		||||
    /* this -------------v--- guards NT-specific calls */
 | 
			
		||||
    if (GetVersion() < 0x80000000 && IsService())
 | 
			
		||||
    if (GetVersion() < 0x80000000 && OPENSSL_isservice())
 | 
			
		||||
    {	HANDLE h = RegisterEventSource(0,_T("OPENSSL"));
 | 
			
		||||
	const TCHAR *pmsg=buf;
 | 
			
		||||
	ReportEvent(h,EVENTLOG_ERROR_TYPE,0,0,0,1,0,&pmsg,0);
 | 
			
		||||
@@ -754,6 +754,7 @@ void OPENSSL_showfatal (const char *fmta,...)
 | 
			
		||||
    vfprintf (stderr,fmta,ap);
 | 
			
		||||
    va_end (ap);
 | 
			
		||||
}
 | 
			
		||||
int OPENSSL_isservice (void) { return 0; }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void OpenSSLDie(const char *file,int line,const char *assertion)
 | 
			
		||||
 
 | 
			
		||||
@@ -64,6 +64,11 @@
 | 
			
		||||
 | 
			
		||||
#include "e_os.h"
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_USE_APPLINK
 | 
			
		||||
#define BIO_FLAGS_UPLINK 0x8000
 | 
			
		||||
#include "ms/uplink.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/buffer.h> 
 | 
			
		||||
#include <openssl/bio.h> 
 | 
			
		||||
@@ -98,6 +103,7 @@ extern unsigned long OPENSSL_ia32cap_P;
 | 
			
		||||
void OPENSSL_showfatal(const char *,...);
 | 
			
		||||
void *OPENSSL_stderr(void);
 | 
			
		||||
extern int OPENSSL_NONPIC_relocated;
 | 
			
		||||
int OPENSSL_isservice(void);
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -517,7 +517,7 @@ void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb);
 | 
			
		||||
 | 
			
		||||
/* die if we have to */
 | 
			
		||||
void OpenSSLDie(const char *file,int line,const char *assertion);
 | 
			
		||||
#define OPENSSL_assert(e)	((e) ? (void)0 : OpenSSLDie(__FILE__, __LINE__, #e))
 | 
			
		||||
#define OPENSSL_assert(e)       (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
 | 
			
		||||
 | 
			
		||||
unsigned long *OPENSSL_ia32cap_loc(void);
 | 
			
		||||
#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,6 @@ CC=	cc
 | 
			
		||||
CPP=	$(CC) -E
 | 
			
		||||
INCLUDES=-I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
RANLIB=		ranlib
 | 
			
		||||
@@ -94,9 +88,8 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install: installs
 | 
			
		||||
 | 
			
		||||
installs:
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -112,6 +105,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -52,6 +46,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -67,6 +62,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,14 @@
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
#define DH_FLAG_CACHE_MONT_P	0x01
 | 
			
		||||
#define DH_FLAG_CACHE_MONT_P     0x01
 | 
			
		||||
#define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH
 | 
			
		||||
                                       * implementation now uses constant time
 | 
			
		||||
                                       * modular exponentiation for secret exponents
 | 
			
		||||
                                       * by default. This flag causes the
 | 
			
		||||
                                       * faster variable sliding window method to
 | 
			
		||||
                                       * be used for all exponents.
 | 
			
		||||
                                       */
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
 
 | 
			
		||||
@@ -141,8 +141,21 @@ static int generate_key(DH *dh)
 | 
			
		||||
		l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
 | 
			
		||||
		if (!BN_rand(priv_key, l, 0, 0)) goto err;
 | 
			
		||||
		}
 | 
			
		||||
	if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, priv_key,dh->p,ctx,mont))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	{
 | 
			
		||||
		BIGNUM local_prk;
 | 
			
		||||
		BIGNUM *prk;
 | 
			
		||||
 | 
			
		||||
		if ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) == 0)
 | 
			
		||||
			{
 | 
			
		||||
			prk = &local_prk;
 | 
			
		||||
			BN_with_flags(prk, priv_key, BN_FLG_EXP_CONSTTIME);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			prk = priv_key;
 | 
			
		||||
 | 
			
		||||
		if (!dh->meth->bn_mod_exp(dh, pub_key, dh->g, prk, dh->p, ctx, mont)) goto err;
 | 
			
		||||
	}
 | 
			
		||||
		
 | 
			
		||||
	dh->pub_key=pub_key;
 | 
			
		||||
	dh->priv_key=priv_key;
 | 
			
		||||
@@ -179,6 +192,11 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
 | 
			
		||||
		{
 | 
			
		||||
		mont = BN_MONT_CTX_set_locked(&dh->method_mont_p,
 | 
			
		||||
				CRYPTO_LOCK_DH, dh->p, ctx);
 | 
			
		||||
		if ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) == 0)
 | 
			
		||||
			{
 | 
			
		||||
			/* XXX */
 | 
			
		||||
			BN_set_flags(dh->priv_key, BN_FLG_EXP_CONSTTIME);
 | 
			
		||||
			}
 | 
			
		||||
		if (!mont)
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
@@ -201,7 +219,10 @@ static int dh_bn_mod_exp(const DH *dh, BIGNUM *r,
 | 
			
		||||
			const BIGNUM *m, BN_CTX *ctx,
 | 
			
		||||
			BN_MONT_CTX *m_ctx)
 | 
			
		||||
	{
 | 
			
		||||
	if (a->top == 1)
 | 
			
		||||
	/* If a is only one word long and constant time is false, use the faster
 | 
			
		||||
	 * exponenentiation function.
 | 
			
		||||
	 */
 | 
			
		||||
	if (a->top == 1 && ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) != 0))
 | 
			
		||||
		{
 | 
			
		||||
		BN_ULONG A = a->d[0];
 | 
			
		||||
		return BN_mod_exp_mont_word(r,A,p,m,ctx,m_ctx);
 | 
			
		||||
 
 | 
			
		||||
@@ -145,6 +145,10 @@ int main(int argc, char *argv[])
 | 
			
		||||
	b->g=BN_dup(a->g);
 | 
			
		||||
	if ((b->p == NULL) || (b->g == NULL)) goto err;
 | 
			
		||||
 | 
			
		||||
	/* Set a to run with normal modexp and b to use constant time */
 | 
			
		||||
	a->flags &= ~DH_FLAG_NO_EXP_CONSTTIME;
 | 
			
		||||
	b->flags |= DH_FLAG_NO_EXP_CONSTTIME;
 | 
			
		||||
 | 
			
		||||
	if (!DH_generate_key(a)) goto err;
 | 
			
		||||
	BIO_puts(out,"pri 1=");
 | 
			
		||||
	BN_print(out,a->priv_key);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -54,6 +48,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -69,6 +64,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -85,6 +85,13 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define DSA_FLAG_CACHE_MONT_P	0x01
 | 
			
		||||
#define DSA_FLAG_NO_EXP_CONSTTIME       0x02 /* new with 0.9.7h; the built-in DSA
 | 
			
		||||
                                              * implementation now uses constant time
 | 
			
		||||
                                              * modular exponentiation for secret exponents
 | 
			
		||||
                                              * by default. This flag causes the
 | 
			
		||||
                                              * faster variable sliding window method to
 | 
			
		||||
                                              * be used for all exponents.
 | 
			
		||||
                                              */
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
 
 | 
			
		||||
@@ -98,8 +98,21 @@ static int dsa_builtin_keygen(DSA *dsa)
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		pub_key=dsa->pub_key;
 | 
			
		||||
	
 | 
			
		||||
	{
 | 
			
		||||
		BIGNUM local_prk;
 | 
			
		||||
		BIGNUM *prk;
 | 
			
		||||
 | 
			
		||||
	if (!BN_mod_exp(pub_key,dsa->g,priv_key,dsa->p,ctx)) goto err;
 | 
			
		||||
		if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0)
 | 
			
		||||
			{
 | 
			
		||||
			prk = &local_prk;
 | 
			
		||||
			BN_with_flags(prk, priv_key, BN_FLG_EXP_CONSTTIME);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			prk = priv_key;
 | 
			
		||||
 | 
			
		||||
		if (!BN_mod_exp(pub_key,dsa->g,prk,dsa->p,ctx)) goto err;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	dsa->priv_key=priv_key;
 | 
			
		||||
	dsa->pub_key=pub_key;
 | 
			
		||||
 
 | 
			
		||||
@@ -227,6 +227,10 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 | 
			
		||||
	do
 | 
			
		||||
		if (!BN_rand_range(&k, dsa->q)) goto err;
 | 
			
		||||
	while (BN_is_zero(&k));
 | 
			
		||||
	if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0)
 | 
			
		||||
		{
 | 
			
		||||
		BN_set_flags(&k, BN_FLG_EXP_CONSTTIME);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (dsa->flags & DSA_FLAG_CACHE_MONT_P)
 | 
			
		||||
		{
 | 
			
		||||
@@ -328,7 +332,7 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
 | 
			
		||||
	ret=(BN_ucmp(&u1, sig->r) == 0);
 | 
			
		||||
 | 
			
		||||
	err:
 | 
			
		||||
	/* XXX: surely this is wrong - if ret is 0, it just didn't verify
 | 
			
		||||
	/* XXX: surely this is wrong - if ret is 0, it just didn't verify;
 | 
			
		||||
	   there is no error in BN. Test should be ret == -1 (Ben) */
 | 
			
		||||
	if (ret != 1) DSAerr(DSA_F_DSA_DO_VERIFY,ERR_R_BN_LIB);
 | 
			
		||||
	if (ctx != NULL) BN_CTX_free(ctx);
 | 
			
		||||
 
 | 
			
		||||
@@ -204,10 +204,19 @@ int main(int argc, char **argv)
 | 
			
		||||
		BIO_printf(bio_err,"g value is wrong\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	dsa->flags |= DSA_FLAG_NO_EXP_CONSTTIME;
 | 
			
		||||
	DSA_generate_key(dsa);
 | 
			
		||||
	DSA_sign(0, str1, 20, sig, &siglen, dsa);
 | 
			
		||||
	if (DSA_verify(0, str1, 20, sig, siglen, dsa) == 1)
 | 
			
		||||
		ret=1;
 | 
			
		||||
 | 
			
		||||
	dsa->flags &= ~DSA_FLAG_NO_EXP_CONSTTIME;
 | 
			
		||||
	DSA_generate_key(dsa);
 | 
			
		||||
	DSA_sign(0, str1, 20, sig, &siglen, dsa);
 | 
			
		||||
	if (DSA_verify(0, str1, 20, sig, siglen, dsa) == 1)
 | 
			
		||||
		ret=1;
 | 
			
		||||
 | 
			
		||||
end:
 | 
			
		||||
	if (!ret)
 | 
			
		||||
		ERR_print_errors(bio_err);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -54,6 +48,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -69,6 +64,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -336,9 +336,11 @@ void ERR_load_DSO_strings(void);
 | 
			
		||||
#define DSO_F_VMS_UNLOAD				 117
 | 
			
		||||
#define DSO_F_WIN32_BIND_FUNC				 118
 | 
			
		||||
#define DSO_F_WIN32_BIND_VAR				 119
 | 
			
		||||
#define DSO_F_WIN32_JOINER				 135
 | 
			
		||||
#define DSO_F_WIN32_LOAD				 120
 | 
			
		||||
#define DSO_F_WIN32_MERGER				 134
 | 
			
		||||
#define DSO_F_WIN32_NAME_CONVERTER			 125
 | 
			
		||||
#define DSO_F_WIN32_SPLITTER				 136
 | 
			
		||||
#define DSO_F_WIN32_UNLOAD				 121
 | 
			
		||||
 | 
			
		||||
/* Reason codes. */
 | 
			
		||||
 
 | 
			
		||||
@@ -237,7 +237,7 @@ static void *dlfcn_bind_var(DSO *dso, const char *symname)
 | 
			
		||||
static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
 | 
			
		||||
	{
 | 
			
		||||
	void *ptr;
 | 
			
		||||
	DSO_FUNC_TYPE sym;
 | 
			
		||||
	DSO_FUNC_TYPE sym, *tsym = &sym;
 | 
			
		||||
 | 
			
		||||
	if((dso == NULL) || (symname == NULL))
 | 
			
		||||
		{
 | 
			
		||||
@@ -255,7 +255,7 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
 | 
			
		||||
		DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_NULL_HANDLE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
	sym = (DSO_FUNC_TYPE)dlsym(ptr, symname);
 | 
			
		||||
	*(void **)(tsym) = dlsym(ptr, symname);
 | 
			
		||||
	if(sym == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_SYM_FAILURE);
 | 
			
		||||
 
 | 
			
		||||
@@ -101,9 +101,11 @@ static ERR_STRING_DATA DSO_str_functs[]=
 | 
			
		||||
{ERR_FUNC(DSO_F_VMS_UNLOAD),	"VMS_UNLOAD"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_BIND_FUNC),	"WIN32_BIND_FUNC"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_BIND_VAR),	"WIN32_BIND_VAR"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_JOINER),	"WIN32_JOINER"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_LOAD),	"WIN32_LOAD"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_MERGER),	"WIN32_MERGER"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_NAME_CONVERTER),	"WIN32_NAME_CONVERTER"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_SPLITTER),	"WIN32_SPLITTER"},
 | 
			
		||||
{ERR_FUNC(DSO_F_WIN32_UNLOAD),	"WIN32_UNLOAD"},
 | 
			
		||||
{0,NULL}
 | 
			
		||||
	};
 | 
			
		||||
 
 | 
			
		||||
@@ -271,7 +271,7 @@ static struct file_st *win32_splitter(DSO *dso, const char *filename,
 | 
			
		||||
 | 
			
		||||
	if (!filename)
 | 
			
		||||
		{
 | 
			
		||||
		DSOerr(DSO_F_WIN32_MERGER,DSO_R_NO_FILENAME);
 | 
			
		||||
		DSOerr(DSO_F_WIN32_SPLITTER,DSO_R_NO_FILENAME);
 | 
			
		||||
		/*goto err;*/
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
@@ -279,7 +279,7 @@ static struct file_st *win32_splitter(DSO *dso, const char *filename,
 | 
			
		||||
	result = OPENSSL_malloc(sizeof(struct file_st));
 | 
			
		||||
	if(result == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		DSOerr(DSO_F_WIN32_MERGER,
 | 
			
		||||
		DSOerr(DSO_F_WIN32_SPLITTER,
 | 
			
		||||
			ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
@@ -303,7 +303,7 @@ static struct file_st *win32_splitter(DSO *dso, const char *filename,
 | 
			
		||||
		case ':':
 | 
			
		||||
			if(position != IN_DEVICE)
 | 
			
		||||
				{
 | 
			
		||||
				DSOerr(DSO_F_WIN32_MERGER,
 | 
			
		||||
				DSOerr(DSO_F_WIN32_SPLITTER,
 | 
			
		||||
					DSO_R_INCORRECT_FILE_SYNTAX);
 | 
			
		||||
				/*goto err;*/
 | 
			
		||||
				return(NULL);
 | 
			
		||||
@@ -373,7 +373,7 @@ static char *win32_joiner(DSO *dso, const struct file_st *file_split)
 | 
			
		||||
 | 
			
		||||
	if(!file_split)
 | 
			
		||||
		{
 | 
			
		||||
		DSOerr(DSO_F_WIN32_MERGER,
 | 
			
		||||
		DSOerr(DSO_F_WIN32_JOINER,
 | 
			
		||||
				ERR_R_PASSED_NULL_PARAMETER);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
@@ -401,14 +401,14 @@ static char *win32_joiner(DSO *dso, const struct file_st *file_split)
 | 
			
		||||
 | 
			
		||||
	if(!len)
 | 
			
		||||
		{
 | 
			
		||||
		DSOerr(DSO_F_WIN32_MERGER, DSO_R_EMPTY_FILE_STRUCTURE);
 | 
			
		||||
		DSOerr(DSO_F_WIN32_JOINER, DSO_R_EMPTY_FILE_STRUCTURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	result = OPENSSL_malloc(len + 1);
 | 
			
		||||
	if (!result)
 | 
			
		||||
		{
 | 
			
		||||
		DSOerr(DSO_F_WIN32_MERGER,
 | 
			
		||||
		DSOerr(DSO_F_WIN32_JOINER,
 | 
			
		||||
			ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,6 @@ TOP=	../..
 | 
			
		||||
CC=	cc
 | 
			
		||||
INCLUDES= -I.. -I$(TOP) -I../../include
 | 
			
		||||
CFLAG=-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
INSTALLTOP=/usr/local/ssl
 | 
			
		||||
MAKE=		make
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
MAKEFILE=	Makefile
 | 
			
		||||
AR=		ar r
 | 
			
		||||
 | 
			
		||||
@@ -57,6 +51,7 @@ links:
 | 
			
		||||
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
 | 
			
		||||
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
 | 
			
		||||
	do  \
 | 
			
		||||
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
 | 
			
		||||
@@ -72,6 +67,7 @@ lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -139,12 +139,12 @@ const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *);
 | 
			
		||||
int EC_METHOD_get_field_type(const EC_METHOD *);
 | 
			
		||||
 | 
			
		||||
int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
 | 
			
		||||
EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *);
 | 
			
		||||
const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *);
 | 
			
		||||
int EC_GROUP_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *);
 | 
			
		||||
int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *);
 | 
			
		||||
 | 
			
		||||
void EC_GROUP_set_nid(EC_GROUP *, int); /* curve name */
 | 
			
		||||
int EC_GROUP_get_nid(const EC_GROUP *);
 | 
			
		||||
void EC_GROUP_set_curve_name(EC_GROUP *, int nid);
 | 
			
		||||
int EC_GROUP_get_curve_name(const EC_GROUP *);
 | 
			
		||||
 | 
			
		||||
void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag);
 | 
			
		||||
int EC_GROUP_get_asn1_flag(const EC_GROUP *);
 | 
			
		||||
@@ -178,8 +178,9 @@ int EC_GROUP_cmp(const EC_GROUP *, const EC_GROUP *, BN_CTX *);
 | 
			
		||||
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 | 
			
		||||
EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 | 
			
		||||
 | 
			
		||||
/* EC_GROUP_new_by_nid() creates a EC_GROUP structure specified by a NID */
 | 
			
		||||
EC_GROUP *EC_GROUP_new_by_nid(int nid);
 | 
			
		||||
/* EC_GROUP_new_by_curve_name() creates a EC_GROUP structure
 | 
			
		||||
 * specified by a curve name (in form of a NID) */
 | 
			
		||||
EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
 | 
			
		||||
/* handling of internal curves */
 | 
			
		||||
typedef struct { 
 | 
			
		||||
	int nid;
 | 
			
		||||
@@ -291,36 +292,37 @@ int     ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
 | 
			
		||||
/* the EC_KEY stuff */
 | 
			
		||||
typedef struct ec_key_st EC_KEY;
 | 
			
		||||
 | 
			
		||||
typedef struct ec_key_meth_data_st {
 | 
			
		||||
	int (*init)(EC_KEY *);
 | 
			
		||||
	void (*finish)(EC_KEY *);
 | 
			
		||||
	} EC_KEY_METH_DATA;
 | 
			
		||||
 | 
			
		||||
struct ec_key_st {
 | 
			
		||||
	int version;
 | 
			
		||||
 | 
			
		||||
	EC_GROUP *group;
 | 
			
		||||
 | 
			
		||||
	EC_POINT *pub_key;
 | 
			
		||||
	BIGNUM	 *priv_key;
 | 
			
		||||
 | 
			
		||||
	unsigned int enc_flag;
 | 
			
		||||
	point_conversion_form_t conv_form;
 | 
			
		||||
 | 
			
		||||
	int 	references;
 | 
			
		||||
 | 
			
		||||
	EC_KEY_METH_DATA *meth_data;
 | 
			
		||||
	}/* EC_KEY */;
 | 
			
		||||
/* some values for the encoding_flag */
 | 
			
		||||
#define EC_PKEY_NO_PARAMETERS	0x001
 | 
			
		||||
#define EC_PKEY_NO_PUBKEY	0x002
 | 
			
		||||
 | 
			
		||||
EC_KEY *EC_KEY_new(void);
 | 
			
		||||
EC_KEY *EC_KEY_new_by_curve_name(int nid);
 | 
			
		||||
void EC_KEY_free(EC_KEY *);
 | 
			
		||||
EC_KEY *EC_KEY_copy(EC_KEY *, const EC_KEY *);
 | 
			
		||||
EC_KEY *EC_KEY_dup(const EC_KEY *);
 | 
			
		||||
 | 
			
		||||
int EC_KEY_up_ref(EC_KEY *);
 | 
			
		||||
 | 
			
		||||
const EC_GROUP *EC_KEY_get0_group(const EC_KEY *);
 | 
			
		||||
int EC_KEY_set_group(EC_KEY *, const EC_GROUP *);
 | 
			
		||||
const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *);
 | 
			
		||||
int EC_KEY_set_private_key(EC_KEY *, const BIGNUM *);
 | 
			
		||||
const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *);
 | 
			
		||||
int EC_KEY_set_public_key(EC_KEY *, const EC_POINT *);
 | 
			
		||||
unsigned EC_KEY_get_enc_flags(const EC_KEY *);
 | 
			
		||||
void EC_KEY_set_enc_flags(EC_KEY *, unsigned int);
 | 
			
		||||
point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *);
 | 
			
		||||
void EC_KEY_set_conv_form(EC_KEY *, point_conversion_form_t);
 | 
			
		||||
/* functions to set/get method specific data  */
 | 
			
		||||
void *EC_KEY_get_key_method_data(EC_KEY *, 
 | 
			
		||||
	void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
 | 
			
		||||
void EC_KEY_insert_key_method_data(EC_KEY *, void *data,
 | 
			
		||||
	void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
 | 
			
		||||
/* wrapper functions for the underlying EC_GROUP object */
 | 
			
		||||
void EC_KEY_set_asn1_flag(EC_KEY *, int);
 | 
			
		||||
int EC_KEY_precompute_mult(EC_KEY *, BN_CTX *ctx);
 | 
			
		||||
 | 
			
		||||
/* EC_KEY_generate_key() creates a ec private (public) key */
 | 
			
		||||
int EC_KEY_generate_key(EC_KEY *);
 | 
			
		||||
/* EC_KEY_check_key() */
 | 
			
		||||
@@ -428,7 +430,7 @@ void ERR_load_EC_strings(void);
 | 
			
		||||
#define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS		 194
 | 
			
		||||
#define EC_F_EC_GROUP_GROUP2NID				 147
 | 
			
		||||
#define EC_F_EC_GROUP_NEW				 108
 | 
			
		||||
#define EC_F_EC_GROUP_NEW_BY_NID			 174
 | 
			
		||||
#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME			 174
 | 
			
		||||
#define EC_F_EC_GROUP_NEW_FROM_DATA			 175
 | 
			
		||||
#define EC_F_EC_GROUP_PRECOMPUTE_MULT			 142
 | 
			
		||||
#define EC_F_EC_GROUP_SET_CURVE_GF2M			 176
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user