Compare commits
	
		
			210 Commits
		
	
	
		
			OpenSSL_1_
			...
			OpenSSL_1_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					2a8c2799e1 | ||
| 
						 | 
					2ad310ffde | ||
| 
						 | 
					6cbc78906b | ||
| 
						 | 
					fffcf87a55 | ||
| 
						 | 
					3adca975dc | ||
| 
						 | 
					517899e6c8 | ||
| 
						 | 
					f61bbf8da5 | ||
| 
						 | 
					1f31458a77 | ||
| 
						 | 
					5fbc59cac6 | ||
| 
						 | 
					370ac32030 | ||
| 
						 | 
					dd90a91d87 | ||
| 
						 | 
					176b59d157 | ||
| 
						 | 
					907f04a303 | ||
| 
						 | 
					f3b355fec3 | ||
| 
						 | 
					c4ce10773f | ||
| 
						 | 
					d46de4ce48 | ||
| 
						 | 
					418df5ea23 | ||
| 
						 | 
					d163a2cc46 | ||
| 
						 | 
					72df35acf2 | ||
| 
						 | 
					f92b196723 | ||
| 
						 | 
					e94118ae2a | ||
| 
						 | 
					106a9a5d7e | ||
| 
						 | 
					cb972a4fe7 | ||
| 
						 | 
					ee2d14be94 | ||
| 
						 | 
					3d2c3fa5fc | ||
| 
						 | 
					ba5693686e | ||
| 
						 | 
					59b5ab4aa7 | ||
| 
						 | 
					c22ed559bb | ||
| 
						 | 
					4b6f33a5c2 | ||
| 
						 | 
					c36d3840ff | ||
| 
						 | 
					05bdebb6e0 | ||
| 
						 | 
					32b2ad7e07 | ||
| 
						 | 
					1977240204 | ||
| 
						 | 
					939b496027 | ||
| 
						 | 
					cce3e4adb7 | ||
| 
						 | 
					f3e85f4359 | ||
| 
						 | 
					cc74177e71 | ||
| 
						 | 
					e2cf18c635 | ||
| 
						 | 
					df00b6eb5e | ||
| 
						 | 
					1ee85aab75 | ||
| 
						 | 
					029e8f3ac9 | ||
| 
						 | 
					28ea6ad612 | ||
| 
						 | 
					4ae1c7771d | ||
| 
						 | 
					dbcf8e3319 | ||
| 
						 | 
					5fcfef49d9 | ||
| 
						 | 
					8af1319270 | ||
| 
						 | 
					38b7073328 | ||
| 
						 | 
					75077a2277 | ||
| 
						 | 
					c62592e52f | ||
| 
						 | 
					f460f050c2 | ||
| 
						 | 
					eb797fde3f | ||
| 
						 | 
					b484b040e3 | ||
| 
						 | 
					726b5e7132 | ||
| 
						 | 
					0a9f8e0621 | ||
| 
						 | 
					1c687ff4dd | ||
| 
						 | 
					c6a39046f5 | ||
| 
						 | 
					cf1bf3f032 | ||
| 
						 | 
					f7bf8e02df | ||
| 
						 | 
					3b509e8cdc | ||
| 
						 | 
					63830384e9 | ||
| 
						 | 
					ff4de7dde9 | ||
| 
						 | 
					3372aeed2c | ||
| 
						 | 
					8568170d77 | ||
| 
						 | 
					f1612746ec | ||
| 
						 | 
					5a1f055d91 | ||
| 
						 | 
					e96de9822e | ||
| 
						 | 
					2df0ba9b4f | ||
| 
						 | 
					76b49a8ad7 | ||
| 
						 | 
					5e0ec9012b | ||
| 
						 | 
					5c122908ab | ||
| 
						 | 
					1c70c783af | ||
| 
						 | 
					9dff24e43a | ||
| 
						 | 
					6865dea2d6 | ||
| 
						 | 
					76d0c6d48e | ||
| 
						 | 
					a329ae2268 | ||
| 
						 | 
					f3c4abb377 | ||
| 
						 | 
					189e20c68c | ||
| 
						 | 
					4b771121f2 | ||
| 
						 | 
					ee827adf04 | ||
| 
						 | 
					cd258a84db | ||
| 
						 | 
					017f695f2c | ||
| 
						 | 
					ee900ed1f7 | ||
| 
						 | 
					39b36cb438 | ||
| 
						 | 
					26800340db | ||
| 
						 | 
					592ac25342 | ||
| 
						 | 
					d889682208 | ||
| 
						 | 
					951ede2a06 | ||
| 
						 | 
					974d4d675c | ||
| 
						 | 
					3be5df2272 | ||
| 
						 | 
					80a06268ae | ||
| 
						 | 
					e3dd33c25c | ||
| 
						 | 
					d695a02254 | ||
| 
						 | 
					a209623fbb | ||
| 
						 | 
					92caee08d3 | ||
| 
						 | 
					0725acd071 | ||
| 
						 | 
					5fa7c10bc4 | ||
| 
						 | 
					96d9674646 | ||
| 
						 | 
					32d3b0f52f | ||
| 
						 | 
					31d085ca74 | ||
| 
						 | 
					c70908d247 | ||
| 
						 | 
					e963109fcd | ||
| 
						 | 
					da23637e8e | ||
| 
						 | 
					5c3fbbc875 | ||
| 
						 | 
					40f26ac782 | ||
| 
						 | 
					89c2720298 | ||
| 
						 | 
					047cdde7a5 | ||
| 
						 | 
					10473a5a2c | ||
| 
						 | 
					bd41063b11 | ||
| 
						 | 
					0186f7bf87 | ||
| 
						 | 
					10a612a9e4 | ||
| 
						 | 
					a20db08e77 | ||
| 
						 | 
					9da34ad6cb | ||
| 
						 | 
					a63d3ac012 | ||
| 
						 | 
					8a46e51ed8 | ||
| 
						 | 
					fe9b85c3cb | ||
| 
						 | 
					42c9c7103c | ||
| 
						 | 
					4ebc70cc51 | ||
| 
						 | 
					2674af2f79 | ||
| 
						 | 
					bae9b9915a | ||
| 
						 | 
					750190567a | ||
| 
						 | 
					23a9b24aa1 | ||
| 
						 | 
					5d74b4b4b3 | ||
| 
						 | 
					d635f4bb36 | ||
| 
						 | 
					117476ba30 | ||
| 
						 | 
					a6a704f448 | ||
| 
						 | 
					506c106880 | ||
| 
						 | 
					686d82a7a2 | ||
| 
						 | 
					8ca79fcbf4 | ||
| 
						 | 
					a4517be9e3 | ||
| 
						 | 
					6e24e1cdd2 | ||
| 
						 | 
					ffc69bd942 | ||
| 
						 | 
					82123b5e94 | ||
| 
						 | 
					cd56a08d4e | ||
| 
						 | 
					e2acb69c76 | ||
| 
						 | 
					c982285ab6 | ||
| 
						 | 
					b485d97634 | ||
| 
						 | 
					636c42d747 | ||
| 
						 | 
					28e4f659c5 | ||
| 
						 | 
					6a43243d1d | ||
| 
						 | 
					f08731cd82 | ||
| 
						 | 
					f4b8760056 | ||
| 
						 | 
					d3554bff69 | ||
| 
						 | 
					3f9117e161 | ||
| 
						 | 
					eadc81e7dd | ||
| 
						 | 
					a2fcab9978 | ||
| 
						 | 
					1a09816435 | ||
| 
						 | 
					0e978b9a5d | ||
| 
						 | 
					f06249f112 | ||
| 
						 | 
					2407241fb2 | ||
| 
						 | 
					3942e7d9eb | ||
| 
						 | 
					2679485e69 | ||
| 
						 | 
					e6dcb08984 | ||
| 
						 | 
					0c8f422999 | ||
| 
						 | 
					cc27bec2b4 | ||
| 
						 | 
					f5ee521307 | ||
| 
						 | 
					58d8a271ab | ||
| 
						 | 
					8b7e469d06 | ||
| 
						 | 
					93cb447df2 | ||
| 
						 | 
					521246e608 | ||
| 
						 | 
					ef6d3485ec | ||
| 
						 | 
					a67303954c | ||
| 
						 | 
					cb9d5b7b53 | ||
| 
						 | 
					876ed10574 | ||
| 
						 | 
					bc2e18a3c8 | ||
| 
						 | 
					0440d4ebe4 | ||
| 
						 | 
					183db9af80 | ||
| 
						 | 
					9f11421950 | ||
| 
						 | 
					51527f1e35 | ||
| 
						 | 
					1810b04728 | ||
| 
						 | 
					5c921f14cb | ||
| 
						 | 
					d58a852fbd | ||
| 
						 | 
					323a7e76e6 | ||
| 
						 | 
					059907771b | ||
| 
						 | 
					ea65e92b22 | ||
| 
						 | 
					f3cc3da447 | ||
| 
						 | 
					1aff39de76 | ||
| 
						 | 
					eafdbd8ec3 | ||
| 
						 | 
					1159e24d56 | ||
| 
						 | 
					b91058d222 | ||
| 
						 | 
					89117535f1 | ||
| 
						 | 
					08a2df480d | ||
| 
						 | 
					9cd061725b | ||
| 
						 | 
					e347d80287 | ||
| 
						 | 
					9e7a5464d7 | ||
| 
						 | 
					e224c45317 | ||
| 
						 | 
					e961fa4479 | ||
| 
						 | 
					aafdbbc469 | ||
| 
						 | 
					a9ea906654 | ||
| 
						 | 
					bb14c2c9ca | ||
| 
						 | 
					a1331af032 | ||
| 
						 | 
					e48e86232e | ||
| 
						 | 
					66aacf3872 | ||
| 
						 | 
					97ac0d8564 | ||
| 
						 | 
					f8e662e71c | ||
| 
						 | 
					468e04bf1f | ||
| 
						 | 
					ac7d33deec | ||
| 
						 | 
					6b7c68e038 | ||
| 
						 | 
					81ce20e6ac | ||
| 
						 | 
					324a977492 | ||
| 
						 | 
					69aeb99f32 | ||
| 
						 | 
					53e652ae44 | ||
| 
						 | 
					131d3fdfe2 | ||
| 
						 | 
					1895583835 | ||
| 
						 | 
					5226c62b76 | ||
| 
						 | 
					491f3e4e8e | ||
| 
						 | 
					184693f4af | ||
| 
						 | 
					925bfca5d3 | ||
| 
						 | 
					90a5adffc7 | ||
| 
						 | 
					73f8982017 | ||
| 
						 | 
					cda8845ded | 
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -95,8 +95,12 @@ tags
 | 
			
		||||
TAGS
 | 
			
		||||
 | 
			
		||||
# Windows
 | 
			
		||||
/tmp32
 | 
			
		||||
/tmp32.dbg
 | 
			
		||||
/tmp32dll
 | 
			
		||||
/tmp32dll.dbg
 | 
			
		||||
/out32
 | 
			
		||||
/out32.dbg
 | 
			
		||||
/out32dll
 | 
			
		||||
/out32dll.dbg
 | 
			
		||||
/inc32
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										433
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										433
									
								
								CHANGES
									
									
									
									
									
								
							@@ -2,9 +2,159 @@
 | 
			
		||||
 OpenSSL CHANGES
 | 
			
		||||
 _______________
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1l and 1.0.1m [xx XXX xxxx]
 | 
			
		||||
 Changes between 1.0.1n and 1.0.1o [12 Jun 2015]
 | 
			
		||||
 | 
			
		||||
  *)
 | 
			
		||||
  *) Fix HMAC ABI incompatibility. The previous version introduced an ABI
 | 
			
		||||
     incompatibility in the handling of HMAC. The previous ABI has now been
 | 
			
		||||
     restored.
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1m and 1.0.1n [11 Jun 2015]
 | 
			
		||||
 | 
			
		||||
  *) Malformed ECParameters causes infinite loop
 | 
			
		||||
 | 
			
		||||
     When processing an ECParameters structure OpenSSL enters an infinite loop
 | 
			
		||||
     if the curve specified is over a specially malformed binary polynomial
 | 
			
		||||
     field.
 | 
			
		||||
 | 
			
		||||
     This can be used to perform denial of service against any
 | 
			
		||||
     system which processes public keys, certificate requests or
 | 
			
		||||
     certificates.  This includes TLS clients and TLS servers with
 | 
			
		||||
     client authentication enabled.
 | 
			
		||||
 | 
			
		||||
     This issue was reported to OpenSSL by Joseph Barr-Pixton.
 | 
			
		||||
     (CVE-2015-1788)
 | 
			
		||||
     [Andy Polyakov]
 | 
			
		||||
 | 
			
		||||
  *) Exploitable out-of-bounds read in X509_cmp_time
 | 
			
		||||
 | 
			
		||||
     X509_cmp_time does not properly check the length of the ASN1_TIME
 | 
			
		||||
     string and can read a few bytes out of bounds. In addition,
 | 
			
		||||
     X509_cmp_time accepts an arbitrary number of fractional seconds in the
 | 
			
		||||
     time string.
 | 
			
		||||
 | 
			
		||||
     An attacker can use this to craft malformed certificates and CRLs of
 | 
			
		||||
     various sizes and potentially cause a segmentation fault, resulting in
 | 
			
		||||
     a DoS on applications that verify certificates or CRLs. TLS clients
 | 
			
		||||
     that verify CRLs are affected. TLS clients and servers with client
 | 
			
		||||
     authentication enabled may be affected if they use custom verification
 | 
			
		||||
     callbacks.
 | 
			
		||||
 | 
			
		||||
     This issue was reported to OpenSSL by Robert Swiecki (Google), and
 | 
			
		||||
     independently by Hanno B<>ck.
 | 
			
		||||
     (CVE-2015-1789)
 | 
			
		||||
     [Emilia K<>sper]
 | 
			
		||||
 | 
			
		||||
  *) PKCS7 crash with missing EnvelopedContent
 | 
			
		||||
 | 
			
		||||
     The PKCS#7 parsing code does not handle missing inner EncryptedContent
 | 
			
		||||
     correctly. An attacker can craft malformed ASN.1-encoded PKCS#7 blobs
 | 
			
		||||
     with missing content and trigger a NULL pointer dereference on parsing.
 | 
			
		||||
 | 
			
		||||
     Applications that decrypt PKCS#7 data or otherwise parse PKCS#7
 | 
			
		||||
     structures from untrusted sources are affected. OpenSSL clients and
 | 
			
		||||
     servers are not affected.
 | 
			
		||||
 | 
			
		||||
     This issue was reported to OpenSSL by Michal Zalewski (Google).
 | 
			
		||||
     (CVE-2015-1790)
 | 
			
		||||
     [Emilia K<>sper]
 | 
			
		||||
 | 
			
		||||
  *) CMS verify infinite loop with unknown hash function
 | 
			
		||||
 | 
			
		||||
     When verifying a signedData message the CMS code can enter an infinite loop
 | 
			
		||||
     if presented with an unknown hash function OID. This can be used to perform
 | 
			
		||||
     denial of service against any system which verifies signedData messages using
 | 
			
		||||
     the CMS code.
 | 
			
		||||
     This issue was reported to OpenSSL by Johannes Bauer.
 | 
			
		||||
     (CVE-2015-1792)
 | 
			
		||||
     [Stephen Henson]
 | 
			
		||||
 | 
			
		||||
  *) Race condition handling NewSessionTicket
 | 
			
		||||
 | 
			
		||||
     If a NewSessionTicket is received by a multi-threaded client when attempting to
 | 
			
		||||
     reuse a previous ticket then a race condition can occur potentially leading to
 | 
			
		||||
     a double free of the ticket data.
 | 
			
		||||
     (CVE-2015-1791)
 | 
			
		||||
     [Matt Caswell]
 | 
			
		||||
 | 
			
		||||
  *) Reject DH handshakes with parameters shorter than 768 bits.
 | 
			
		||||
     [Kurt Roeckx and Emilia Kasper]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1l and 1.0.1m [19 Mar 2015]
 | 
			
		||||
 | 
			
		||||
  *) Segmentation fault in ASN1_TYPE_cmp fix
 | 
			
		||||
 | 
			
		||||
     The function ASN1_TYPE_cmp will crash with an invalid read if an attempt is
 | 
			
		||||
     made to compare ASN.1 boolean types. Since ASN1_TYPE_cmp is used to check
 | 
			
		||||
     certificate signature algorithm consistency this can be used to crash any
 | 
			
		||||
     certificate verification operation and exploited in a DoS attack. Any
 | 
			
		||||
     application which performs certificate verification is vulnerable including
 | 
			
		||||
     OpenSSL clients and servers which enable client authentication.
 | 
			
		||||
     (CVE-2015-0286)
 | 
			
		||||
     [Stephen Henson]
 | 
			
		||||
 | 
			
		||||
  *) ASN.1 structure reuse memory corruption fix
 | 
			
		||||
 | 
			
		||||
     Reusing a structure in ASN.1 parsing may allow an attacker to cause
 | 
			
		||||
     memory corruption via an invalid write. Such reuse is and has been
 | 
			
		||||
     strongly discouraged and is believed to be rare.
 | 
			
		||||
 | 
			
		||||
     Applications that parse structures containing CHOICE or ANY DEFINED BY
 | 
			
		||||
     components may be affected. Certificate parsing (d2i_X509 and related
 | 
			
		||||
     functions) are however not affected. OpenSSL clients and servers are
 | 
			
		||||
     not affected.
 | 
			
		||||
     (CVE-2015-0287)
 | 
			
		||||
     [Stephen Henson]
 | 
			
		||||
 | 
			
		||||
  *) PKCS7 NULL pointer dereferences fix
 | 
			
		||||
 | 
			
		||||
     The PKCS#7 parsing code does not handle missing outer ContentInfo
 | 
			
		||||
     correctly. An attacker can craft malformed ASN.1-encoded PKCS#7 blobs with
 | 
			
		||||
     missing content and trigger a NULL pointer dereference on parsing.
 | 
			
		||||
 | 
			
		||||
     Applications that verify PKCS#7 signatures, decrypt PKCS#7 data or
 | 
			
		||||
     otherwise parse PKCS#7 structures from untrusted sources are
 | 
			
		||||
     affected. OpenSSL clients and servers are not affected.
 | 
			
		||||
 | 
			
		||||
     This issue was reported to OpenSSL by Michal Zalewski (Google).
 | 
			
		||||
     (CVE-2015-0289)
 | 
			
		||||
     [Emilia K<>sper]
 | 
			
		||||
 | 
			
		||||
  *) DoS via reachable assert in SSLv2 servers fix
 | 
			
		||||
 | 
			
		||||
     A malicious client can trigger an OPENSSL_assert (i.e., an abort) in
 | 
			
		||||
     servers that both support SSLv2 and enable export cipher suites by sending
 | 
			
		||||
     a specially crafted SSLv2 CLIENT-MASTER-KEY message.
 | 
			
		||||
 | 
			
		||||
     This issue was discovered by Sean Burford (Google) and Emilia K<>sper
 | 
			
		||||
     (OpenSSL development team).
 | 
			
		||||
     (CVE-2015-0293)
 | 
			
		||||
     [Emilia K<>sper]
 | 
			
		||||
 | 
			
		||||
  *) Use After Free following d2i_ECPrivatekey error fix
 | 
			
		||||
 | 
			
		||||
     A malformed EC private key file consumed via the d2i_ECPrivateKey function
 | 
			
		||||
     could cause a use after free condition. This, in turn, could cause a double
 | 
			
		||||
     free in several private key parsing functions (such as d2i_PrivateKey
 | 
			
		||||
     or EVP_PKCS82PKEY) and could lead to a DoS attack or memory corruption
 | 
			
		||||
     for applications that receive EC private keys from untrusted
 | 
			
		||||
     sources. This scenario is considered rare.
 | 
			
		||||
 | 
			
		||||
     This issue was discovered by the BoringSSL project and fixed in their
 | 
			
		||||
     commit 517073cd4b.
 | 
			
		||||
     (CVE-2015-0209)
 | 
			
		||||
     [Matt Caswell]
 | 
			
		||||
 | 
			
		||||
  *) X509_to_X509_REQ NULL pointer deref fix
 | 
			
		||||
 | 
			
		||||
     The function X509_to_X509_REQ will crash with a NULL pointer dereference if
 | 
			
		||||
     the certificate key is invalid. This function is rarely used in practice.
 | 
			
		||||
 | 
			
		||||
     This issue was discovered by Brian Carpenter.
 | 
			
		||||
     (CVE-2015-0288)
 | 
			
		||||
     [Stephen Henson]
 | 
			
		||||
 | 
			
		||||
  *) Removed the export ciphers from the DEFAULT ciphers
 | 
			
		||||
     [Kurt Roeckx]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1k and 1.0.1l [15 Jan 2015]
 | 
			
		||||
 | 
			
		||||
@@ -775,63 +925,6 @@
 | 
			
		||||
       Add command line options to s_client/s_server.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0j and 1.0.0k [5 Feb 2013]
 | 
			
		||||
 | 
			
		||||
  *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
 | 
			
		||||
 | 
			
		||||
     This addresses the flaw in CBC record processing discovered by 
 | 
			
		||||
     Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
 | 
			
		||||
     at: http://www.isg.rhul.ac.uk/tls/     
 | 
			
		||||
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
 | 
			
		||||
     Emilia K<>sper for the initial patch.
 | 
			
		||||
     (CVE-2013-0169)
 | 
			
		||||
     [Emilia K<>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Return an error when checking OCSP signatures when key is NULL.
 | 
			
		||||
     This fixes a DoS attack. (CVE-2013-0166)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Call OCSP Stapling callback after ciphersuite has been chosen, so
 | 
			
		||||
     the right response is stapled. Also change SSL_get_certificate()
 | 
			
		||||
     so it returns the certificate actually sent.
 | 
			
		||||
     See http://rt.openssl.org/Ticket/Display.html?id=2836.
 | 
			
		||||
     (This is a backport)
 | 
			
		||||
     [Rob Stradling <rob.stradling@comodo.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix possible deadlock when decoding public keys.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0i and 1.0.0j [10 May 2012]
 | 
			
		||||
 | 
			
		||||
  [NB: OpenSSL 1.0.0i and later 1.0.0 patch levels were released after
 | 
			
		||||
  OpenSSL 1.0.1.]
 | 
			
		||||
 | 
			
		||||
  *) Sanity check record length before skipping explicit IV in DTLS
 | 
			
		||||
     to fix DoS attack.
 | 
			
		||||
 | 
			
		||||
     Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
 | 
			
		||||
     fuzzing as a service testing platform.
 | 
			
		||||
     (CVE-2012-2333)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Initialise tkeylen properly when encrypting CMS messages.
 | 
			
		||||
     Thanks to Solar Designer of Openwall for reporting this issue.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0h and 1.0.0i [19 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) Check for potentially exploitable overflows in asn1_d2i_read_bio
 | 
			
		||||
     BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
 | 
			
		||||
     in CRYPTO_realloc_clean.
 | 
			
		||||
 | 
			
		||||
     Thanks to Tavis Ormandy, Google Security Team, for discovering this
 | 
			
		||||
     issue and to Adam Langley <agl@chromium.org> for fixing it.
 | 
			
		||||
     (CVE-2012-2110)
 | 
			
		||||
     [Adam Langley (Google), Tavis Ormandy, Google Security Team]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0g and 1.0.0h [12 Mar 2012]
 | 
			
		||||
 | 
			
		||||
  *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness
 | 
			
		||||
@@ -1822,228 +1915,6 @@
 | 
			
		||||
  *) Change 'Configure' script to enable Camellia by default.
 | 
			
		||||
     [NTT]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8x and 0.9.8y [5 Feb 2013]
 | 
			
		||||
 | 
			
		||||
  *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
 | 
			
		||||
 | 
			
		||||
     This addresses the flaw in CBC record processing discovered by 
 | 
			
		||||
     Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
 | 
			
		||||
     at: http://www.isg.rhul.ac.uk/tls/     
 | 
			
		||||
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
 | 
			
		||||
     Emilia K<>sper for the initial patch.
 | 
			
		||||
     (CVE-2013-0169)
 | 
			
		||||
     [Emilia K<>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Return an error when checking OCSP signatures when key is NULL.
 | 
			
		||||
     This fixes a DoS attack. (CVE-2013-0166)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Call OCSP Stapling callback after ciphersuite has been chosen, so
 | 
			
		||||
     the right response is stapled. Also change SSL_get_certificate()
 | 
			
		||||
     so it returns the certificate actually sent.
 | 
			
		||||
     See http://rt.openssl.org/Ticket/Display.html?id=2836.
 | 
			
		||||
     (This is a backport)
 | 
			
		||||
     [Rob Stradling <rob.stradling@comodo.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix possible deadlock when decoding public keys.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8w and 0.9.8x [10 May 2012]
 | 
			
		||||
 | 
			
		||||
  *) Sanity check record length before skipping explicit IV in DTLS
 | 
			
		||||
     to fix DoS attack.
 | 
			
		||||
 | 
			
		||||
     Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
 | 
			
		||||
     fuzzing as a service testing platform.
 | 
			
		||||
     (CVE-2012-2333)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Initialise tkeylen properly when encrypting CMS messages.
 | 
			
		||||
     Thanks to Solar Designer of Openwall for reporting this issue.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8v and 0.9.8w [23 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) The fix for CVE-2012-2110 did not take into account that the 
 | 
			
		||||
     'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an
 | 
			
		||||
     int in OpenSSL 0.9.8, making it still vulnerable. Fix by 
 | 
			
		||||
     rejecting negative len parameter. (CVE-2012-2131)
 | 
			
		||||
     [Tomas Hoger <thoger@redhat.com>]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8u and 0.9.8v [19 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) Check for potentially exploitable overflows in asn1_d2i_read_bio
 | 
			
		||||
     BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
 | 
			
		||||
     in CRYPTO_realloc_clean.
 | 
			
		||||
 | 
			
		||||
     Thanks to Tavis Ormandy, Google Security Team, for discovering this
 | 
			
		||||
     issue and to Adam Langley <agl@chromium.org> for fixing it.
 | 
			
		||||
     (CVE-2012-2110)
 | 
			
		||||
     [Adam Langley (Google), Tavis Ormandy, Google Security Team]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8t and 0.9.8u [12 Mar 2012]
 | 
			
		||||
 | 
			
		||||
  *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness
 | 
			
		||||
     in CMS and PKCS7 code. When RSA decryption fails use a random key for
 | 
			
		||||
     content decryption and always return the same error. Note: this attack
 | 
			
		||||
     needs on average 2^20 messages so it only affects automated senders. The
 | 
			
		||||
     old behaviour can be reenabled in the CMS code by setting the
 | 
			
		||||
     CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where
 | 
			
		||||
     an MMA defence is not necessary.
 | 
			
		||||
     Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for discovering
 | 
			
		||||
     this issue. (CVE-2012-0884)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix CVE-2011-4619: make sure we really are receiving a 
 | 
			
		||||
     client hello before rejecting multiple SGC restarts. Thanks to
 | 
			
		||||
     Ivan Nestlerode <inestlerode@us.ibm.com> for discovering this bug.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8s and 0.9.8t [18 Jan 2012]
 | 
			
		||||
 | 
			
		||||
  *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109.
 | 
			
		||||
     Thanks to Antonio Martin, Enterprise Secure Access Research and
 | 
			
		||||
     Development, Cisco Systems, Inc. for discovering this bug and
 | 
			
		||||
     preparing a fix. (CVE-2012-0050)
 | 
			
		||||
     [Antonio Martin]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8r and 0.9.8s [4 Jan 2012]
 | 
			
		||||
 | 
			
		||||
  *) Nadhem Alfardan and Kenny Paterson have discovered an extension
 | 
			
		||||
     of the Vaudenay padding oracle attack on CBC mode encryption
 | 
			
		||||
     which enables an efficient plaintext recovery attack against
 | 
			
		||||
     the OpenSSL implementation of DTLS. Their attack exploits timing
 | 
			
		||||
     differences arising during decryption processing. A research
 | 
			
		||||
     paper describing this attack can be found at:
 | 
			
		||||
                  http://www.isg.rhul.ac.uk/~kp/dtls.pdf
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann
 | 
			
		||||
     <seggelmann@fh-muenster.de> and Michael Tuexen <tuexen@fh-muenster.de>
 | 
			
		||||
     for preparing the fix. (CVE-2011-4108)
 | 
			
		||||
     [Robin Seggelmann, Michael Tuexen]
 | 
			
		||||
 | 
			
		||||
  *) Stop policy check failure freeing same buffer twice. (CVE-2011-4109)
 | 
			
		||||
     [Ben Laurie, Kasper <ekasper@google.com>]
 | 
			
		||||
 | 
			
		||||
  *) Clear bytes used for block padding of SSL 3.0 records.
 | 
			
		||||
     (CVE-2011-4576)
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George
 | 
			
		||||
     Kadianakis <desnacked@gmail.com> for discovering this issue and
 | 
			
		||||
     Adam Langley for preparing the fix. (CVE-2011-4619)
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 
 | 
			
		||||
  *) Prevent malformed RFC3779 data triggering an assertion failure.
 | 
			
		||||
     Thanks to Andrew Chi, BBN Technologies, for discovering the flaw
 | 
			
		||||
     and Rob Austein <sra@hactrn.net> for fixing it. (CVE-2011-4577)
 | 
			
		||||
     [Rob Austein <sra@hactrn.net>]
 | 
			
		||||
 | 
			
		||||
  *) Fix ssl_ciph.c set-up race.
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Fix spurious failures in ecdsatest.c.
 | 
			
		||||
     [Emilia K<>sper (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Fix the BIO_f_buffer() implementation (which was mixing different
 | 
			
		||||
     interpretations of the '..._len' fields).
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Fix handling of BN_BLINDING: now BN_BLINDING_invert_ex (rather than
 | 
			
		||||
     BN_BLINDING_invert_ex) calls BN_BLINDING_update, ensuring that concurrent
 | 
			
		||||
     threads won't reuse the same blinding coefficients.
 | 
			
		||||
 | 
			
		||||
     This also avoids the need to obtain the CRYPTO_LOCK_RSA_BLINDING
 | 
			
		||||
     lock to call BN_BLINDING_invert_ex, and avoids one use of
 | 
			
		||||
     BN_BLINDING_update for each BN_BLINDING structure (previously,
 | 
			
		||||
     the last update always remained unused).
 | 
			
		||||
     [Emilia K<>sper (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Fix SSL memory handling for (EC)DH ciphersuites, in particular
 | 
			
		||||
     for multi-threaded use of ECDH.
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Fix x509_name_ex_d2i memory leak on bad inputs.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Add protection against ECDSA timing attacks as mentioned in the paper
 | 
			
		||||
     by Billy Bob Brumley and Nicola Tuveri, see:
 | 
			
		||||
 | 
			
		||||
	http://eprint.iacr.org/2011/232.pdf
 | 
			
		||||
 | 
			
		||||
     [Billy Bob Brumley and Nicola Tuveri]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8q and 0.9.8r [8 Feb 2011]
 | 
			
		||||
 | 
			
		||||
  *) Fix parsing of OCSP stapling ClientHello extension. CVE-2011-0014
 | 
			
		||||
     [Neel Mehta, Adam Langley, Bodo Moeller (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Fix bug in string printing code: if *any* escaping is enabled we must
 | 
			
		||||
     escape the escape character (backslash) or the resulting string is
 | 
			
		||||
     ambiguous.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8p and 0.9.8q [2 Dec 2010]
 | 
			
		||||
 | 
			
		||||
  *) Disable code workaround for ancient and obsolete Netscape browsers
 | 
			
		||||
     and servers: an attacker can use it in a ciphersuite downgrade attack.
 | 
			
		||||
     Thanks to Martin Rex for discovering this bug. CVE-2010-4180
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fixed J-PAKE implementation error, originally discovered by
 | 
			
		||||
     Sebastien Martini, further info and confirmation from Stefan
 | 
			
		||||
     Arentz and Feng Hao. Note that this fix is a security fix. CVE-2010-4252
 | 
			
		||||
     [Ben Laurie]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8o and 0.9.8p [16 Nov 2010]
 | 
			
		||||
 | 
			
		||||
  *) Fix extension code to avoid race conditions which can result in a buffer
 | 
			
		||||
     overrun vulnerability: resumed sessions must not be modified as they can
 | 
			
		||||
     be shared by multiple threads. CVE-2010-3864
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix for double free bug in ssl/s3_clnt.c CVE-2010-2939
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Don't reencode certificate when calculating signature: cache and use
 | 
			
		||||
     the original encoding instead. This makes signature verification of
 | 
			
		||||
     some broken encodings work correctly.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) ec2_GF2m_simple_mul bugfix: compute correct result if the output EC_POINT
 | 
			
		||||
     is also one of the inputs.
 | 
			
		||||
     [Emilia K<>sper <emilia.kasper@esat.kuleuven.be> (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Don't repeatedly append PBE algorithms to table if they already exist.
 | 
			
		||||
     Sort table on each new add. This effectively makes the table read only
 | 
			
		||||
     after all algorithms are added and subsequent calls to PKCS12_pbe_add
 | 
			
		||||
     etc are non-op.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8n and 0.9.8o [01 Jun 2010]
 | 
			
		||||
 | 
			
		||||
  [NB: OpenSSL 0.9.8o and later 0.9.8 patch levels were released after
 | 
			
		||||
  OpenSSL 1.0.0.]
 | 
			
		||||
 | 
			
		||||
  *) Correct a typo in the CMS ASN1 module which can result in invalid memory
 | 
			
		||||
     access or freeing data twice (CVE-2010-0742)
 | 
			
		||||
     [Steve Henson, Ronald Moesbergen <intercommit@gmail.com>]
 | 
			
		||||
 | 
			
		||||
  *) Add SHA2 algorithms to SSL_library_init(). SHA2 is becoming far more
 | 
			
		||||
     common in certificates and some applications which only call
 | 
			
		||||
     SSL_library_init and not OpenSSL_add_all_algorithms() will fail.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) VMS fixes: 
 | 
			
		||||
     Reduce copying into .apps and .test in makevms.com
 | 
			
		||||
     Don't try to use blank CA certificate in CA.com
 | 
			
		||||
     Allow use of C files from original directories in maketests.com
 | 
			
		||||
     [Steven M. Schweda" <sms@antinode.info>]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8m and 0.9.8n [24 Mar 2010]
 | 
			
		||||
 | 
			
		||||
  *) When rejecting SSL/TLS records due to an incorrect version number, never
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										110
									
								
								Configure
									
									
									
									
									
								
							
							
						
						
									
										110
									
								
								Configure
									
									
									
									
									
								
							@@ -185,18 +185,18 @@ my %table=(
 | 
			
		||||
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
 | 
			
		||||
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
 | 
			
		||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
 | 
			
		||||
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
 | 
			
		||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"dist",		"cc:-O::(unknown)::::::",
 | 
			
		||||
 | 
			
		||||
# Basic configs that should work on any (32 and less bit) box
 | 
			
		||||
@@ -230,12 +230,12 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
#### SPARC Solaris with GNU C setups
 | 
			
		||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv8-gcc","gcc:-mcpu=v8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
 | 
			
		||||
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
 | 
			
		||||
####
 | 
			
		||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=v8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### SPARC Solaris with Sun C setups
 | 
			
		||||
@@ -252,20 +252,20 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
#### SunOS configs, assuming sparc for the gcc one.
 | 
			
		||||
#"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::",
 | 
			
		||||
"sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
 | 
			
		||||
"sunos-gcc","gcc:-O3 -mcpu=v8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
 | 
			
		||||
 | 
			
		||||
#### IRIX 5.x configs
 | 
			
		||||
# -mips2 flag is added by ./config when appropriate.
 | 
			
		||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"irix-gcc","gcc:-O3 -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"irix-cc", "cc:-O2 -use_readonly_const -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
#### IRIX 6.x configs
 | 
			
		||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
 | 
			
		||||
# './Configure irix-cc -o32' manually.
 | 
			
		||||
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
 | 
			
		||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
 | 
			
		||||
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
 | 
			
		||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
 | 
			
		||||
# N64 ABI builds.
 | 
			
		||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
 | 
			
		||||
#### Unified HP-UX ANSI C configs.
 | 
			
		||||
# Special notes:
 | 
			
		||||
@@ -345,23 +345,23 @@ my %table=(
 | 
			
		||||
####
 | 
			
		||||
# *-generic* is endian-neutral target, but ./config is free to
 | 
			
		||||
# throw in -D[BL]_ENDIAN, whichever appropriate...
 | 
			
		||||
"linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ppc",	"gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-generic32","gcc:-O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ppc",	"gcc:-DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# It's believed that majority of ARM toolchains predefine appropriate -march.
 | 
			
		||||
# If you compiler does not, do complement config command line with one!
 | 
			
		||||
"linux-armv4",	"gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-armv4",	"gcc:-O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
#### IA-32 targets...
 | 
			
		||||
"linux-ia32-icc",	"icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-elf",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-aout",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
 | 
			
		||||
"linux-ia32-icc",	"icc:-DL_ENDIAN -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-elf",	"gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-aout",	"gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
 | 
			
		||||
####
 | 
			
		||||
"linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ppc64",	"gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"linux-ia64",	"gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-x86_64",	"gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"linux64-s390x",	"gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"linux-generic64","gcc:-O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ppc64",	"gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"linux-ia64",	"gcc:-DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ia64-ecc","ecc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-x86_64",	"gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"linux64-s390x",	"gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
#### So called "highgprs" target for z/Architecture CPUs
 | 
			
		||||
# "Highgprs" is kernel feature first implemented in Linux 2.6.32, see
 | 
			
		||||
# /proc/cpuinfo. The idea is to preserve most significant bits of
 | 
			
		||||
@@ -375,16 +375,16 @@ my %table=(
 | 
			
		||||
# ldconfig and run-time linker to autodiscover. Unfortunately it
 | 
			
		||||
# doesn't work just yet, because of couple of bugs in glibc
 | 
			
		||||
# sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
 | 
			
		||||
"linux32-s390x",	"gcc:-m31 -Wa,-mzarch -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$s390x_asm;$asm=~s/bn\-s390x\.o/bn_asm.o/;$asm}.":31:dlfcn:linux-shared:-fPIC:-m31:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/highgprs",
 | 
			
		||||
"linux32-s390x",	"gcc:-m31 -Wa,-mzarch -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$s390x_asm;$asm=~s/bn\-s390x\.o/bn_asm.o/;$asm}.":31:dlfcn:linux-shared:-fPIC:-m31:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/highgprs",
 | 
			
		||||
#### SPARC Linux setups
 | 
			
		||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
 | 
			
		||||
# assisted with debugging of following two configs.
 | 
			
		||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-sparcv8","gcc:-mcpu=v8 -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
 | 
			
		||||
# -Wa,-Av8plus should do the trick no matter what.
 | 
			
		||||
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# GCC 3.1 is a requirement
 | 
			
		||||
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
#### Alpha Linux with GNU C and Compaq C setups
 | 
			
		||||
# Special notes:
 | 
			
		||||
# - linux-alpha+bwx-gcc is ment to be used from ./config only. If you
 | 
			
		||||
@@ -398,30 +398,30 @@ my %table=(
 | 
			
		||||
#
 | 
			
		||||
#					<appro@fy.chalmers.se>
 | 
			
		||||
#
 | 
			
		||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
 | 
			
		||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
 | 
			
		||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
 | 
			
		||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
 | 
			
		||||
 | 
			
		||||
# Android: linux-* but without -DTERMIO and pointers to headers and libs.
 | 
			
		||||
# Android: linux-* but without pointers to headers and libs.
 | 
			
		||||
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### *BSD [do see comment about ${BSDthreads} above!]
 | 
			
		||||
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-x86",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-x86-elf",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-BSD-x86-elf",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-sparcv8",	"gcc:-DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-generic32","gcc:-O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-x86",	"gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-x86-elf",	"gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-BSD-x86-elf",	"gcc:-DL_ENDIAN -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-sparcv8",	"gcc:-DB_ENDIAN -O3 -mcpu=v8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
"BSD-generic64","gcc:-DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-generic64","gcc:-O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
 | 
			
		||||
# simply *happens* to work around a compiler bug in gcc 3.3.3,
 | 
			
		||||
# triggered by RIPEMD160 code.
 | 
			
		||||
"BSD-sparc64",	"gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-ia64",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-x86_64",	"gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-sparc64",	"gcc:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-ia64",	"gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"BSD-x86_64",	"gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
"bsdi-elf-gcc",     "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
@@ -433,8 +433,8 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
# QNX
 | 
			
		||||
"qnx4",	"cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
 | 
			
		||||
"QNX6",       "gcc:-DTERMIOS::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"QNX6-i386",  "gcc:-DL_ENDIAN -DTERMIOS -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"QNX6",       "gcc:::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"QNX6-i386",  "gcc:-DL_ENDIAN -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
# BeOS
 | 
			
		||||
"beos-x86-r5",   "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so",
 | 
			
		||||
@@ -507,7 +507,7 @@ my %table=(
 | 
			
		||||
"SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::",
 | 
			
		||||
 | 
			
		||||
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
 | 
			
		||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
 | 
			
		||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
 | 
			
		||||
 | 
			
		||||
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
 | 
			
		||||
# You need to compile using the c89.sh wrapper in the tools directory, because the
 | 
			
		||||
@@ -567,7 +567,7 @@ my %table=(
 | 
			
		||||
"netware-libc-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::",
 | 
			
		||||
 | 
			
		||||
# DJGPP
 | 
			
		||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:",
 | 
			
		||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:",
 | 
			
		||||
 | 
			
		||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
 | 
			
		||||
"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
 | 
			
		||||
@@ -593,7 +593,7 @@ my %table=(
 | 
			
		||||
"newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
 | 
			
		||||
 | 
			
		||||
##### GNU Hurd
 | 
			
		||||
"hurd-x86",  "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC",
 | 
			
		||||
"hurd-x86",  "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC",
 | 
			
		||||
 | 
			
		||||
##### OS/2 EMX
 | 
			
		||||
"OS2-EMX", "gcc::::::::",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										26
									
								
								Makefile.org
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								Makefile.org
									
									
									
									
									
								
							@@ -184,7 +184,7 @@ WTARFILE=       $(NAME)-win.tar
 | 
			
		||||
EXHEADER=       e_os2.h
 | 
			
		||||
HEADER=         e_os.h
 | 
			
		||||
 | 
			
		||||
all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
 | 
			
		||||
all: Makefile build_all
 | 
			
		||||
 | 
			
		||||
# as we stick to -e, CLEARENV ensures that local variables in lower
 | 
			
		||||
# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
 | 
			
		||||
@@ -270,7 +270,10 @@ reflect:
 | 
			
		||||
sub_all: build_all
 | 
			
		||||
build_all: build_libs build_apps build_tests build_tools
 | 
			
		||||
 | 
			
		||||
build_libs: build_crypto build_ssl build_engines
 | 
			
		||||
build_libs: build_libcrypto build_libssl openssl.pc
 | 
			
		||||
 | 
			
		||||
build_libcrypto: build_crypto build_engines libcrypto.pc
 | 
			
		||||
build_libssl: build_ssl libssl.pc
 | 
			
		||||
 | 
			
		||||
build_crypto:
 | 
			
		||||
	@dir=crypto; target=all; $(BUILD_ONE_CMD)
 | 
			
		||||
@@ -459,6 +462,9 @@ tests: rehash
 | 
			
		||||
report:
 | 
			
		||||
	@$(PERL) util/selftest.pl
 | 
			
		||||
 | 
			
		||||
update: errors stacks util/libeay.num util/ssleay.num TABLE
 | 
			
		||||
	@set -e; target=update; $(RECURSIVE_BUILD_CMD)
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
 | 
			
		||||
 | 
			
		||||
@@ -483,26 +489,10 @@ util/libeay.num::
 | 
			
		||||
util/ssleay.num::
 | 
			
		||||
	$(PERL) util/mkdef.pl ssl update
 | 
			
		||||
 | 
			
		||||
crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
 | 
			
		||||
	$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
 | 
			
		||||
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
 | 
			
		||||
	$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
 | 
			
		||||
crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
 | 
			
		||||
	$(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
 | 
			
		||||
 | 
			
		||||
apps/openssl-vms.cnf: apps/openssl.cnf
 | 
			
		||||
	$(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
 | 
			
		||||
 | 
			
		||||
crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
 | 
			
		||||
	$(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TABLE: Configure
 | 
			
		||||
	(echo 'Output of `Configure TABLE'"':"; \
 | 
			
		||||
	$(PERL) Configure TABLE) > TABLE
 | 
			
		||||
 | 
			
		||||
update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
 | 
			
		||||
 | 
			
		||||
# Build distribution tar-file. As the list of files returned by "find" is
 | 
			
		||||
# pretty long, on several platforms a "too many arguments" error or similar
 | 
			
		||||
# would occur. Therefore the list of files is temporarily stored into a file
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										91
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										91
									
								
								NEWS
									
									
									
									
									
								
							@@ -5,9 +5,27 @@
 | 
			
		||||
  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 1.0.1l and OpenSSL 1.0.1m [under development]
 | 
			
		||||
  Major changes between OpenSSL 1.0.1n and OpenSSL 1.0.1o [12 Jun 2015]
 | 
			
		||||
 | 
			
		||||
      o
 | 
			
		||||
      o Fix HMAC ABI incompatibility
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1m and OpenSSL 1.0.1n [11 Jun 2015]
 | 
			
		||||
 | 
			
		||||
      o Malformed ECParameters causes infinite loop (CVE-2015-1788)
 | 
			
		||||
      o Exploitable out-of-bounds read in X509_cmp_time (CVE-2015-1789)
 | 
			
		||||
      o PKCS7 crash with missing EnvelopedContent (CVE-2015-1790)
 | 
			
		||||
      o CMS verify infinite loop with unknown hash function (CVE-2015-1792)
 | 
			
		||||
      o Race condition handling NewSessionTicket (CVE-2015-1791)
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1l and OpenSSL 1.0.1m [19 Mar 2015]
 | 
			
		||||
 | 
			
		||||
      o Segmentation fault in ASN1_TYPE_cmp fix (CVE-2015-0286)
 | 
			
		||||
      o ASN.1 structure reuse memory corruption fix (CVE-2015-0287)
 | 
			
		||||
      o PKCS7 NULL pointer dereferences fix (CVE-2015-0289)
 | 
			
		||||
      o DoS via reachable assert in SSLv2 servers fix (CVE-2015-0293)
 | 
			
		||||
      o Use After Free following d2i_ECPrivatekey error fix (CVE-2015-0209)
 | 
			
		||||
      o X509_to_X509_REQ NULL pointer deref fix (CVE-2015-0288)
 | 
			
		||||
      o Removed the export ciphers from the DEFAULT ciphers
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1k and OpenSSL 1.0.1l [15 Jan 2015]
 | 
			
		||||
 | 
			
		||||
@@ -107,19 +125,6 @@
 | 
			
		||||
      o Preliminary FIPS capability for unvalidated 2.0 FIPS module.
 | 
			
		||||
      o SRP support.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0j and OpenSSL 1.0.0k [5 Feb 2013]:
 | 
			
		||||
 | 
			
		||||
      o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
 | 
			
		||||
      o Fix OCSP bad key DoS attack CVE-2013-0166
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0i and OpenSSL 1.0.0j [10 May 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix DTLS record length checking bug CVE-2012-2333
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.0i [19 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for ASN1 overflow bug CVE-2012-2110
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h [12 Mar 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for CMS/PKCS#7 MMA CVE-2012-0884
 | 
			
		||||
@@ -192,62 +197,6 @@
 | 
			
		||||
      o Opaque PRF Input TLS extension support.
 | 
			
		||||
      o Updated time routines to avoid OS limitations.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y [5 Feb 2013]:
 | 
			
		||||
 | 
			
		||||
      o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
 | 
			
		||||
      o Fix OCSP bad key DoS attack CVE-2013-0166
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x [10 May 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix DTLS record length checking bug CVE-2012-2333
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w [23 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110)
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v [19 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for ASN1 overflow bug CVE-2012-2110
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u [12 Mar 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for CMS/PKCS#7 MMA CVE-2012-0884
 | 
			
		||||
      o Corrected fix for CVE-2011-4619
 | 
			
		||||
      o Various DTLS fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t [18 Jan 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for DTLS DoS issue CVE-2012-0050
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s [4 Jan 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for DTLS plaintext recovery attack CVE-2011-4108
 | 
			
		||||
      o Fix policy check double free error CVE-2011-4109
 | 
			
		||||
      o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
 | 
			
		||||
      o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
 | 
			
		||||
      o Check for malformed RFC3779 data CVE-2011-4577
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r [8 Feb 2011]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2011-0014
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q [2 Dec 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-4180
 | 
			
		||||
      o Fix for CVE-2010-4252
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p [16 Nov 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-3864.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o [1 Jun 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-0742.
 | 
			
		||||
      o Various DTLS fixes.
 | 
			
		||||
      o Recognise SHA2 certificates if only SSL algorithms added.
 | 
			
		||||
      o Fix for no-rc4 compilation.
 | 
			
		||||
      o Chil ENGINE unload workaround.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
 | 
			
		||||
 | 
			
		||||
      o CFB cipher definition fixes.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								README
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 1.0.1m-dev
 | 
			
		||||
 OpenSSL 1.0.1o 12 Jun 2015
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2011 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										108
									
								
								TABLE
									
									
									
									
									
								
							
							
						
						
									
										108
									
								
								TABLE
									
									
									
									
									
								
							@@ -35,7 +35,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BS2000-OSD
 | 
			
		||||
$cc           = c89
 | 
			
		||||
$cflags       = -O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC
 | 
			
		||||
$cflags       = -O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -68,7 +68,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-generic32
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIOS -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$cflags       = -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -101,7 +101,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-generic64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIOS -O3 -Wall
 | 
			
		||||
$cflags       = -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -134,7 +134,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-ia64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O3 -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -167,7 +167,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-sparc64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall
 | 
			
		||||
$cflags       = -DB_ENDIAN -O3 -DMD32_REG_T=int -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -200,7 +200,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-sparcv8
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall
 | 
			
		||||
$cflags       = -DB_ENDIAN -O3 -mcpu=v8 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -233,7 +233,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-x86
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -266,7 +266,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-x86-elf
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -299,7 +299,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** BSD-x86_64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O3 -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -398,7 +398,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** DJGPP
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall
 | 
			
		||||
$cflags       = -I/dev/env/WATT_ROOT/inc -DTERMIO -DL_ENDIAN -fomit-frame-pointer -O2 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = MSDOS
 | 
			
		||||
@@ -530,7 +530,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** QNX6
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIOS
 | 
			
		||||
$cflags       = 
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -563,7 +563,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** QNX6-i386
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O2 -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O2 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -1520,7 +1520,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-BSD-x86-elf
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O3 -Wall -g
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -Wall -g
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2213,7 +2213,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-levitte-linux-elf-extreme
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2279,7 +2279,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-levitte-linux-noasm-extreme
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2312,7 +2312,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-elf
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2345,7 +2345,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-elf-noefence
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2378,7 +2378,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-generic32
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2411,7 +2411,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-generic64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2444,7 +2444,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-ia32-aes
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$cflags       = -DAES_EXPERIMENTAL -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2477,7 +2477,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-pentium
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentium -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2510,7 +2510,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-ppro
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2543,7 +2543,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-linux-x86_64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2642,7 +2642,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-solaris-sparcv8-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=v8 -Wall -DB_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3566,7 +3566,7 @@ $multilib     = /pa20_64
 | 
			
		||||
 | 
			
		||||
*** hurd-x86
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3632,7 +3632,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** irix-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN
 | 
			
		||||
$cflags       = -O2 -use_readonly_const -DB_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3665,7 +3665,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** irix-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3 -DTERMIOS -DB_ENDIAN
 | 
			
		||||
$cflags       = -O3 -DB_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3698,7 +3698,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** irix-mips3-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$cflags       = -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_SGI_MP_SOURCE
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3731,7 +3731,7 @@ $multilib     = 32
 | 
			
		||||
 | 
			
		||||
*** irix-mips3-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$cflags       = -mabi=n32 -O3 -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_SGI_MP_SOURCE
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3764,7 +3764,7 @@ $multilib     = 32
 | 
			
		||||
 | 
			
		||||
*** irix64-mips4-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$cflags       = -64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_SGI_MP_SOURCE
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3797,7 +3797,7 @@ $multilib     = 64
 | 
			
		||||
 | 
			
		||||
*** irix64-mips4-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$cflags       = -mabi=64 -mips4 -O3 -DB_ENDIAN -DBN_DIV3W
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_SGI_MP_SOURCE
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3830,7 +3830,7 @@ $multilib     = 64
 | 
			
		||||
 | 
			
		||||
*** linux-alpha+bwx-ccc
 | 
			
		||||
$cc           = ccc
 | 
			
		||||
$cflags       = -fast -readonly_strings -DL_ENDIAN -DTERMIO
 | 
			
		||||
$cflags       = -fast -readonly_strings -DL_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3863,7 +3863,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-alpha+bwx-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3 -DL_ENDIAN -DTERMIO
 | 
			
		||||
$cflags       = -O3 -DL_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3896,7 +3896,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-alpha-ccc
 | 
			
		||||
$cc           = ccc
 | 
			
		||||
$cflags       = -fast -readonly_strings -DL_ENDIAN -DTERMIO
 | 
			
		||||
$cflags       = -fast -readonly_strings -DL_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3929,7 +3929,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-alpha-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3 -DL_ENDIAN -DTERMIO
 | 
			
		||||
$cflags       = -O3 -DL_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3962,7 +3962,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-aout
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3995,7 +3995,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-armv4
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4028,7 +4028,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-elf
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4061,7 +4061,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-generic32
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$cflags       = -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4094,7 +4094,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-generic64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4127,7 +4127,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-ia32-icc
 | 
			
		||||
$cc           = icc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O2 -no_cpprt
 | 
			
		||||
$cflags       = -DL_ENDIAN -O2 -no_cpprt
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4160,7 +4160,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-ia64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4193,7 +4193,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-ia64-ecc
 | 
			
		||||
$cc           = ecc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt
 | 
			
		||||
$cflags       = -DL_ENDIAN -O2 -Wall -no_cpprt
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4226,7 +4226,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-ia64-icc
 | 
			
		||||
$cc           = icc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt
 | 
			
		||||
$cflags       = -DL_ENDIAN -O2 -Wall -no_cpprt
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4259,7 +4259,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-ppc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DB_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -DB_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4292,7 +4292,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-ppc64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -m64 -DB_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -m64 -DB_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4325,7 +4325,7 @@ $multilib     = 64
 | 
			
		||||
 | 
			
		||||
*** linux-sparcv8
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W
 | 
			
		||||
$cflags       = -mcpu=v8 -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -DBN_DIV2W
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4358,7 +4358,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-sparcv9
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W
 | 
			
		||||
$cflags       = -m32 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = ULTRASPARC
 | 
			
		||||
@@ -4391,7 +4391,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** linux-x86_64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -m64 -DL_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -m64 -DL_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4424,7 +4424,7 @@ $multilib     = 64
 | 
			
		||||
 | 
			
		||||
*** linux32-s390x
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -m31 -Wa,-mzarch -DB_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -m31 -Wa,-mzarch -DB_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4457,7 +4457,7 @@ $multilib     = /highgprs
 | 
			
		||||
 | 
			
		||||
*** linux64-s390x
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -m64 -DB_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -m64 -DB_ENDIAN -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -4490,7 +4490,7 @@ $multilib     = 64
 | 
			
		||||
 | 
			
		||||
*** linux64-sparcv9
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$cflags       = -m64 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = ULTRASPARC
 | 
			
		||||
@@ -5315,7 +5315,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** solaris-sparcv8-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W
 | 
			
		||||
$cflags       = -mcpu=v8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -5612,7 +5612,7 @@ $multilib     = /64
 | 
			
		||||
 | 
			
		||||
*** sunos-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3 -mv8 -Dssize_t=int
 | 
			
		||||
$cflags       = -O3 -mcpu=v8 -Dssize_t=int
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = SUNOS
 | 
			
		||||
 
 | 
			
		||||
@@ -94,6 +94,9 @@ req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
 | 
			
		||||
sreq.o: req.c 
 | 
			
		||||
	$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
 | 
			
		||||
 | 
			
		||||
openssl-vms.cnf: openssl.cnf
 | 
			
		||||
	$(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf
 | 
			
		||||
 | 
			
		||||
files:
 | 
			
		||||
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
 | 
			
		||||
 | 
			
		||||
@@ -127,12 +130,12 @@ links:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then \
 | 
			
		||||
	    $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
 | 
			
		||||
	else \
 | 
			
		||||
	    $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
 | 
			
		||||
	fi
 | 
			
		||||
update: openssl-vms.cnf local_depend
 | 
			
		||||
 | 
			
		||||
depend: local_depend
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
 | 
			
		||||
local_depend:
 | 
			
		||||
	@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
 | 
			
		||||
 | 
			
		||||
dclean:
 | 
			
		||||
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
 | 
			
		||||
@@ -144,10 +147,10 @@ clean:
 | 
			
		||||
	rm -f req
 | 
			
		||||
 | 
			
		||||
$(DLIBSSL):
 | 
			
		||||
	(cd ..; $(MAKE) DIRS=ssl all)
 | 
			
		||||
	(cd ..; $(MAKE) build_libssl)
 | 
			
		||||
 | 
			
		||||
$(DLIBCRYPTO):
 | 
			
		||||
	(cd ..; $(MAKE) DIRS=crypto all)
 | 
			
		||||
	(cd ..; $(MAKE) build_libcrypto)
 | 
			
		||||
 | 
			
		||||
$(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
 | 
			
		||||
	$(RM) $(EXE)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								apps/apps.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								apps/apps.c
									
									
									
									
									
								
							@@ -572,6 +572,11 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
 | 
			
		||||
        char *prompt = NULL;
 | 
			
		||||
 | 
			
		||||
        prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
 | 
			
		||||
        if (!prompt) {
 | 
			
		||||
            BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
            UI_free(ui);
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ui_flags |= UI_INPUT_FLAG_DEFAULT_PWD;
 | 
			
		||||
        UI_ctrl(ui, UI_CTRL_PRINT_ERRORS, 1, 0, 0);
 | 
			
		||||
@@ -581,6 +586,12 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
 | 
			
		||||
                                     PW_MIN_LENGTH, bufsiz - 1);
 | 
			
		||||
        if (ok >= 0 && verify) {
 | 
			
		||||
            buff = (char *)OPENSSL_malloc(bufsiz);
 | 
			
		||||
            if (!buff) {
 | 
			
		||||
                BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
                UI_free(ui);
 | 
			
		||||
                OPENSSL_free(prompt);
 | 
			
		||||
                return 0;
 | 
			
		||||
            }
 | 
			
		||||
            ok = UI_add_verify_string(ui, prompt, ui_flags, buff,
 | 
			
		||||
                                      PW_MIN_LENGTH, bufsiz - 1, buf);
 | 
			
		||||
        }
 | 
			
		||||
@@ -2227,6 +2238,8 @@ int args_verify(char ***pargs, int *pargc,
 | 
			
		||||
        flags |= X509_V_FLAG_NOTIFY_POLICY;
 | 
			
		||||
    else if (!strcmp(arg, "-check_ss_sig"))
 | 
			
		||||
        flags |= X509_V_FLAG_CHECK_SS_SIGNATURE;
 | 
			
		||||
    else if (!strcmp(arg, "-no_alt_chains"))
 | 
			
		||||
        flags |= X509_V_FLAG_NO_ALT_CHAINS;
 | 
			
		||||
    else
 | 
			
		||||
        return 0;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -375,7 +375,7 @@ static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
 | 
			
		||||
{
 | 
			
		||||
    CONF *cnf = NULL;
 | 
			
		||||
    int len;
 | 
			
		||||
    long errline;
 | 
			
		||||
    long errline = 0;
 | 
			
		||||
    unsigned char *p;
 | 
			
		||||
    ASN1_TYPE *atyp = NULL;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								apps/ca.c
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								apps/ca.c
									
									
									
									
									
								
							@@ -558,10 +558,18 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifdef OPENSSL_SYS_VMS
 | 
			
		||||
        len = strlen(s) + sizeof(CONFIG_FILE);
 | 
			
		||||
        tofree = OPENSSL_malloc(len);
 | 
			
		||||
        if (!tofree) {
 | 
			
		||||
            BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
            goto err;
 | 
			
		||||
        }
 | 
			
		||||
        strcpy(tofree, s);
 | 
			
		||||
#else
 | 
			
		||||
        len = strlen(s) + sizeof(CONFIG_FILE) + 1;
 | 
			
		||||
        tofree = OPENSSL_malloc(len);
 | 
			
		||||
        if (!tofree) {
 | 
			
		||||
            BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
            goto err;
 | 
			
		||||
        }
 | 
			
		||||
        BUF_strlcpy(tofree, s, len);
 | 
			
		||||
        BUF_strlcat(tofree, "/", len);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -610,10 +618,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
            oid_bio = BIO_new_file(p, "r");
 | 
			
		||||
            if (oid_bio == NULL) {
 | 
			
		||||
                                /*-
 | 
			
		||||
                                BIO_printf(bio_err,"problems opening %s for extra oid's\n",p);
 | 
			
		||||
                                ERR_print_errors(bio_err);
 | 
			
		||||
                                */
 | 
			
		||||
                /*-
 | 
			
		||||
                BIO_printf(bio_err,"problems opening %s for extra oid's\n",p);
 | 
			
		||||
                ERR_print_errors(bio_err);
 | 
			
		||||
                */
 | 
			
		||||
                ERR_clear_error();
 | 
			
		||||
            } else {
 | 
			
		||||
                OBJ_create_objects(oid_bio);
 | 
			
		||||
@@ -2795,6 +2803,11 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
 | 
			
		||||
    ASN1_GENERALIZEDTIME *comp_time = NULL;
 | 
			
		||||
    tmp = BUF_strdup(str);
 | 
			
		||||
 | 
			
		||||
    if (!tmp) {
 | 
			
		||||
        BIO_printf(bio_err, "memory allocation failure\n");
 | 
			
		||||
        goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    p = strchr(tmp, ',');
 | 
			
		||||
 | 
			
		||||
    rtime_str = tmp;
 | 
			
		||||
@@ -2812,6 +2825,10 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
 | 
			
		||||
 | 
			
		||||
    if (prevtm) {
 | 
			
		||||
        *prevtm = ASN1_UTCTIME_new();
 | 
			
		||||
        if (!*prevtm) {
 | 
			
		||||
            BIO_printf(bio_err, "memory allocation failure\n");
 | 
			
		||||
            goto err;
 | 
			
		||||
        }
 | 
			
		||||
        if (!ASN1_UTCTIME_set_string(*prevtm, rtime_str)) {
 | 
			
		||||
            BIO_printf(bio_err, "invalid revocation date %s\n", rtime_str);
 | 
			
		||||
            goto err;
 | 
			
		||||
@@ -2852,6 +2869,10 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
 | 
			
		||||
                goto err;
 | 
			
		||||
            }
 | 
			
		||||
            comp_time = ASN1_GENERALIZEDTIME_new();
 | 
			
		||||
            if (!comp_time) {
 | 
			
		||||
                BIO_printf(bio_err, "memory allocation failure\n");
 | 
			
		||||
                goto err;
 | 
			
		||||
            }
 | 
			
		||||
            if (!ASN1_GENERALIZEDTIME_set_string(comp_time, arg_str)) {
 | 
			
		||||
                BIO_printf(bio_err, "invalid compromised time %s\n", arg_str);
 | 
			
		||||
                goto err;
 | 
			
		||||
 
 | 
			
		||||
@@ -580,6 +580,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-CApath dir    trusted certificates directory\n");
 | 
			
		||||
        BIO_printf(bio_err, "-CAfile file   trusted certificates file\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-no_alt_chains only ever use the first certificate chain found\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-crl_check     check revocation status of signer's certificate using CRLs\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								apps/dgst.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								apps/dgst.c
									
									
									
									
									
								
							@@ -287,6 +287,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
    in = BIO_new(BIO_s_file());
 | 
			
		||||
    bmd = BIO_new(BIO_f_md());
 | 
			
		||||
    if ((in == NULL) || (bmd == NULL)) {
 | 
			
		||||
        ERR_print_errors(bio_err);
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (debug) {
 | 
			
		||||
        BIO_set_callback(in, BIO_debug_callback);
 | 
			
		||||
        /* needed for windows 3.1 */
 | 
			
		||||
@@ -298,11 +303,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((in == NULL) || (bmd == NULL)) {
 | 
			
		||||
        ERR_print_errors(bio_err);
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (out_bin == -1) {
 | 
			
		||||
        if (keyfile)
 | 
			
		||||
            out_bin = 1;
 | 
			
		||||
@@ -448,6 +448,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
            ERR_print_errors(bio_err);
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
        if (!sigbuf) {
 | 
			
		||||
            BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
            ERR_print_errors(bio_err);
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
        siglen = BIO_read(sigbio, sigbuf, siglen);
 | 
			
		||||
        BIO_free(sigbio);
 | 
			
		||||
        if (siglen <= 0) {
 | 
			
		||||
 
 | 
			
		||||
@@ -130,7 +130,7 @@
 | 
			
		||||
# undef PROG
 | 
			
		||||
# define PROG    dhparam_main
 | 
			
		||||
 | 
			
		||||
# define DEFBITS 512
 | 
			
		||||
# define DEFBITS 2048
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * -inform arg  - input format - default PEM (DER or PEM)
 | 
			
		||||
@@ -254,7 +254,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   " -5            generate parameters using  5 as the generator value\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   " numbits       number of bits in to generate (default 512)\n");
 | 
			
		||||
                   " numbits       number of bits in to generate (default 2048)\n");
 | 
			
		||||
# ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   " -engine e     use engine e, possibly a hardware device.\n");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								apps/enc.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								apps/enc.c
									
									
									
									
									
								
							@@ -548,9 +548,14 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
            else
 | 
			
		||||
                OPENSSL_cleanse(str, strlen(str));
 | 
			
		||||
        }
 | 
			
		||||
        if ((hiv != NULL) && !set_hex(hiv, iv, sizeof iv)) {
 | 
			
		||||
            BIO_printf(bio_err, "invalid hex iv value\n");
 | 
			
		||||
            goto end;
 | 
			
		||||
        if (hiv != NULL) {
 | 
			
		||||
            int siz = EVP_CIPHER_iv_length(cipher);
 | 
			
		||||
            if (siz == 0) {
 | 
			
		||||
                BIO_printf(bio_err, "warning: iv not use by this cipher\n");
 | 
			
		||||
            } else if (!set_hex(hiv, iv, sizeof iv)) {
 | 
			
		||||
                BIO_printf(bio_err, "invalid hex iv value\n");
 | 
			
		||||
                goto end;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if ((hiv == NULL) && (str == NULL)
 | 
			
		||||
            && EVP_CIPHER_iv_length(cipher) != 0) {
 | 
			
		||||
@@ -562,7 +567,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
            BIO_printf(bio_err, "iv undefined\n");
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
        if ((hkey != NULL) && !set_hex(hkey, key, sizeof key)) {
 | 
			
		||||
        if ((hkey != NULL) && !set_hex(hkey, key, EVP_CIPHER_key_length(cipher))) {
 | 
			
		||||
            BIO_printf(bio_err, "invalid hex key value\n");
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,7 @@
 | 
			
		||||
# include <openssl/x509.h>
 | 
			
		||||
# include <openssl/pem.h>
 | 
			
		||||
 | 
			
		||||
# define DEFBITS 512
 | 
			
		||||
# define DEFBITS 2048
 | 
			
		||||
# undef PROG
 | 
			
		||||
# define PROG gendh_main
 | 
			
		||||
 | 
			
		||||
@@ -122,8 +122,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
            outfile = *(++argv);
 | 
			
		||||
        } else if (strcmp(*argv, "-2") == 0)
 | 
			
		||||
            g = 2;
 | 
			
		||||
        /*-     else if (strcmp(*argv,"-3") == 0)
 | 
			
		||||
                        g=3; */
 | 
			
		||||
/*-     else if (strcmp(*argv,"-3") == 0)
 | 
			
		||||
                g=3; */
 | 
			
		||||
        else if (strcmp(*argv, "-5") == 0)
 | 
			
		||||
            g = 5;
 | 
			
		||||
# ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
 
 | 
			
		||||
@@ -518,6 +518,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
                   "-CApath dir          trusted certificates directory\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-CAfile file         trusted certificates file\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-no_alt_chains       only ever use the first certificate chain found\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-VAfile file         validator certificates file\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
 
 | 
			
		||||
@@ -231,27 +231,27 @@ int main(int Argc, char *ARGV[])
 | 
			
		||||
    long errline;
 | 
			
		||||
 | 
			
		||||
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
 | 
			
		||||
        /*-
 | 
			
		||||
         * 2011-03-22 SMS.
 | 
			
		||||
         * If we have 32-bit pointers everywhere, then we're safe, and
 | 
			
		||||
         * we bypass this mess, as on non-VMS systems.  (See ARGV,
 | 
			
		||||
         * above.)
 | 
			
		||||
         * Problem 1: Compaq/HP C before V7.3 always used 32-bit
 | 
			
		||||
         * pointers for argv[].
 | 
			
		||||
         * Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
 | 
			
		||||
         * everywhere else, we always allocate and use a 64-bit
 | 
			
		||||
         * duplicate of argv[].
 | 
			
		||||
         * Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
 | 
			
		||||
         * to NULL-terminate a 64-bit argv[].  (As this was written, the
 | 
			
		||||
         * compiler ECO was available only on IA64.)
 | 
			
		||||
         * Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
 | 
			
		||||
         * 64-bit argv[argc] for NULL, and, if necessary, use a
 | 
			
		||||
         * (properly) NULL-terminated (64-bit) duplicate of argv[].
 | 
			
		||||
         * The same code is used in either case to duplicate argv[].
 | 
			
		||||
         * Some of these decisions could be handled in preprocessing,
 | 
			
		||||
         * but the code tends to get even uglier, and the penalty for
 | 
			
		||||
         * deciding at compile- or run-time is tiny.
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * 2011-03-22 SMS.
 | 
			
		||||
     * If we have 32-bit pointers everywhere, then we're safe, and
 | 
			
		||||
     * we bypass this mess, as on non-VMS systems.  (See ARGV,
 | 
			
		||||
     * above.)
 | 
			
		||||
     * Problem 1: Compaq/HP C before V7.3 always used 32-bit
 | 
			
		||||
     * pointers for argv[].
 | 
			
		||||
     * Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
 | 
			
		||||
     * everywhere else, we always allocate and use a 64-bit
 | 
			
		||||
     * duplicate of argv[].
 | 
			
		||||
     * Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
 | 
			
		||||
     * to NULL-terminate a 64-bit argv[].  (As this was written, the
 | 
			
		||||
     * compiler ECO was available only on IA64.)
 | 
			
		||||
     * Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
 | 
			
		||||
     * 64-bit argv[argc] for NULL, and, if necessary, use a
 | 
			
		||||
     * (properly) NULL-terminated (64-bit) duplicate of argv[].
 | 
			
		||||
     * The same code is used in either case to duplicate argv[].
 | 
			
		||||
     * Some of these decisions could be handled in preprocessing,
 | 
			
		||||
     * but the code tends to get even uglier, and the penalty for
 | 
			
		||||
     * deciding at compile- or run-time is tiny.
 | 
			
		||||
     */
 | 
			
		||||
    char **Argv = NULL;
 | 
			
		||||
    int free_Argv = 0;
 | 
			
		||||
 | 
			
		||||
@@ -428,10 +428,6 @@ int main(int Argc, char *ARGV[])
 | 
			
		||||
    if (arg.data != NULL)
 | 
			
		||||
        OPENSSL_free(arg.data);
 | 
			
		||||
 | 
			
		||||
    if (bio_err != NULL) {
 | 
			
		||||
        BIO_free(bio_err);
 | 
			
		||||
        bio_err = NULL;
 | 
			
		||||
    }
 | 
			
		||||
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
 | 
			
		||||
    /* Free any duplicate Argv[] storage. */
 | 
			
		||||
    if (free_Argv) {
 | 
			
		||||
@@ -440,6 +436,10 @@ int main(int Argc, char *ARGV[])
 | 
			
		||||
#endif
 | 
			
		||||
    apps_shutdown();
 | 
			
		||||
    CRYPTO_mem_leaks(bio_err);
 | 
			
		||||
    if (bio_err != NULL) {
 | 
			
		||||
        BIO_free(bio_err);
 | 
			
		||||
        bio_err = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    OPENSSL_EXIT(ret);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								apps/pkcs7.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								apps/pkcs7.c
									
									
									
									
									
								
							@@ -189,11 +189,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    if (infile == NULL)
 | 
			
		||||
        BIO_set_fp(in, stdin, BIO_NOCLOSE);
 | 
			
		||||
    else {
 | 
			
		||||
        if (BIO_read_filename(in, infile) <= 0)
 | 
			
		||||
            if (in == NULL) {
 | 
			
		||||
                perror(infile);
 | 
			
		||||
                goto end;
 | 
			
		||||
            }
 | 
			
		||||
        if (BIO_read_filename(in, infile) <= 0) {
 | 
			
		||||
            BIO_printf(bio_err, "unable to load input file\n");
 | 
			
		||||
            ERR_print_errors(bio_err);
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (informat == FORMAT_ASN1)
 | 
			
		||||
 
 | 
			
		||||
@@ -502,10 +502,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
            oid_bio = BIO_new_file(p, "r");
 | 
			
		||||
            if (oid_bio == NULL) {
 | 
			
		||||
                                /*-
 | 
			
		||||
                                BIO_printf(bio_err,"problems opening %s for extra oid's\n",p);
 | 
			
		||||
                                ERR_print_errors(bio_err);
 | 
			
		||||
                                */
 | 
			
		||||
                /*-
 | 
			
		||||
                BIO_printf(bio_err,"problems opening %s for extra oid's\n",p);
 | 
			
		||||
                ERR_print_errors(bio_err);
 | 
			
		||||
                */
 | 
			
		||||
            } else {
 | 
			
		||||
                OBJ_create_objects(oid_bio);
 | 
			
		||||
                BIO_free(oid_bio);
 | 
			
		||||
 
 | 
			
		||||
@@ -268,6 +268,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
    rsa_in = OPENSSL_malloc(keysize * 2);
 | 
			
		||||
    rsa_out = OPENSSL_malloc(keysize);
 | 
			
		||||
    if (!rsa_in || !rsa_out) {
 | 
			
		||||
        BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
        ERR_print_errors(bio_err);
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Read the input data */
 | 
			
		||||
    rsa_inlen = BIO_read(in, rsa_in, keysize * 2);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										37
									
								
								apps/s_cb.c
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								apps/s_cb.c
									
									
									
									
									
								
							@@ -111,6 +111,7 @@
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h> /* for memcpy() */
 | 
			
		||||
#define USE_SOCKETS
 | 
			
		||||
#define NON_MAIN
 | 
			
		||||
#include "apps.h"
 | 
			
		||||
@@ -191,10 +192,10 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
 | 
			
		||||
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
 | 
			
		||||
{
 | 
			
		||||
    if (cert_file != NULL) {
 | 
			
		||||
                /*-
 | 
			
		||||
                SSL *ssl;
 | 
			
		||||
                X509 *x509;
 | 
			
		||||
                */
 | 
			
		||||
        /*-
 | 
			
		||||
        SSL *ssl;
 | 
			
		||||
        X509 *x509;
 | 
			
		||||
        */
 | 
			
		||||
 | 
			
		||||
        if (SSL_CTX_use_certificate_file(ctx, cert_file,
 | 
			
		||||
                                         SSL_FILETYPE_PEM) <= 0) {
 | 
			
		||||
@@ -212,20 +213,20 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
 | 
			
		||||
            return (0);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
                /*-
 | 
			
		||||
                In theory this is no longer needed
 | 
			
		||||
                ssl=SSL_new(ctx);
 | 
			
		||||
                x509=SSL_get_certificate(ssl);
 | 
			
		||||
        /*-
 | 
			
		||||
        In theory this is no longer needed
 | 
			
		||||
        ssl=SSL_new(ctx);
 | 
			
		||||
        x509=SSL_get_certificate(ssl);
 | 
			
		||||
 | 
			
		||||
                if (x509 != NULL) {
 | 
			
		||||
                        EVP_PKEY *pktmp;
 | 
			
		||||
                        pktmp = X509_get_pubkey(x509);
 | 
			
		||||
                        EVP_PKEY_copy_parameters(pktmp,
 | 
			
		||||
                                                SSL_get_privatekey(ssl));
 | 
			
		||||
                        EVP_PKEY_free(pktmp);
 | 
			
		||||
                }
 | 
			
		||||
                SSL_free(ssl);
 | 
			
		||||
                */
 | 
			
		||||
        if (x509 != NULL) {
 | 
			
		||||
                EVP_PKEY *pktmp;
 | 
			
		||||
                pktmp = X509_get_pubkey(x509);
 | 
			
		||||
                EVP_PKEY_copy_parameters(pktmp,
 | 
			
		||||
                                        SSL_get_privatekey(ssl));
 | 
			
		||||
                EVP_PKEY_free(pktmp);
 | 
			
		||||
        }
 | 
			
		||||
        SSL_free(ssl);
 | 
			
		||||
        */
 | 
			
		||||
 | 
			
		||||
        /*
 | 
			
		||||
         * If we are using DSA, we can copy the parameters from the private
 | 
			
		||||
@@ -747,7 +748,7 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie,
 | 
			
		||||
 | 
			
		||||
    /* Initialize a random secret */
 | 
			
		||||
    if (!cookie_initialized) {
 | 
			
		||||
        if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH)) {
 | 
			
		||||
        if (RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH) <= 0) {
 | 
			
		||||
            BIO_printf(bio_err, "error setting random cookie secret\n");
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -322,6 +322,8 @@ static void sc_usage(void)
 | 
			
		||||
               " -pass arg     - private key file pass phrase source\n");
 | 
			
		||||
    BIO_printf(bio_err, " -CApath arg   - PEM format directory of CA's\n");
 | 
			
		||||
    BIO_printf(bio_err, " -CAfile arg   - PEM format file of CA's\n");
 | 
			
		||||
    BIO_printf(bio_err,
 | 
			
		||||
               " -no_alt_chains - only ever use the first certificate chain found\n");
 | 
			
		||||
    BIO_printf(bio_err,
 | 
			
		||||
               " -reconnect    - Drop and re-make the connection with the same Session-ID\n");
 | 
			
		||||
    BIO_printf(bio_err,
 | 
			
		||||
@@ -547,6 +549,11 @@ static char *MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
 | 
			
		||||
    PW_CB_DATA cb_tmp;
 | 
			
		||||
    int l;
 | 
			
		||||
 | 
			
		||||
    if (!pass) {
 | 
			
		||||
        BIO_printf(bio_err, "Malloc failure\n");
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    cb_tmp.password = (char *)srp_arg->srppassin;
 | 
			
		||||
    cb_tmp.prompt_info = "SRP user";
 | 
			
		||||
    if ((l = password_callback(pass, PWD_STRLEN, 0, &cb_tmp)) < 0) {
 | 
			
		||||
@@ -1149,12 +1156,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
    if (clr)
 | 
			
		||||
        SSL_CTX_clear_options(ctx, clr);
 | 
			
		||||
    /*
 | 
			
		||||
     * DTLS: partial reads end up discarding unread UDP bytes :-( Setting
 | 
			
		||||
     * read ahead solves this problem.
 | 
			
		||||
     */
 | 
			
		||||
    if (socket_type == SOCK_DGRAM)
 | 
			
		||||
        SSL_CTX_set_read_ahead(ctx, 1);
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
 | 
			
		||||
    if (next_proto.data)
 | 
			
		||||
@@ -1178,13 +1179,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    if (!set_cert_key_stuff(ctx, cert, key))
 | 
			
		||||
        goto end;
 | 
			
		||||
 | 
			
		||||
    if ((!SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) ||
 | 
			
		||||
        (!SSL_CTX_set_default_verify_paths(ctx))) {
 | 
			
		||||
        /*
 | 
			
		||||
         * BIO_printf(bio_err,"error setting default verify locations\n");
 | 
			
		||||
         */
 | 
			
		||||
    if ((CAfile || CApath)
 | 
			
		||||
        && !SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) {
 | 
			
		||||
        ERR_print_errors(bio_err);
 | 
			
		||||
    }
 | 
			
		||||
    if (!SSL_CTX_set_default_verify_paths(ctx)) {
 | 
			
		||||
        ERR_print_errors(bio_err);
 | 
			
		||||
        /* goto end; */
 | 
			
		||||
    }
 | 
			
		||||
#ifndef OPENSSL_NO_TLSEXT
 | 
			
		||||
    if (servername != NULL) {
 | 
			
		||||
@@ -1559,8 +1559,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
                    openssl_fdset(SSL_get_fd(con), &writefds);
 | 
			
		||||
            }
 | 
			
		||||
#endif
 | 
			
		||||
/*-                     printf("mode tty(%d %d%d) ssl(%d%d)\n",
 | 
			
		||||
                                tty_on,read_tty,write_tty,read_ssl,write_ssl);*/
 | 
			
		||||
/*-         printf("mode tty(%d %d%d) ssl(%d%d)\n",
 | 
			
		||||
                    tty_on,read_tty,write_tty,read_ssl,write_ssl);*/
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * Note: under VMS with SOCKETSHR the second parameter is
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										101
									
								
								apps/s_server.c
									
									
									
									
									
								
							
							
						
						
									
										101
									
								
								apps/s_server.c
									
									
									
									
									
								
							@@ -219,7 +219,7 @@ static int generate_session_id(const SSL *ssl, unsigned char *id,
 | 
			
		||||
                               unsigned int *id_len);
 | 
			
		||||
#ifndef OPENSSL_NO_DH
 | 
			
		||||
static DH *load_dh_param(const char *dhfile);
 | 
			
		||||
static DH *get_dh512(void);
 | 
			
		||||
static DH *get_dh2048(void);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef MONOLITH
 | 
			
		||||
@@ -227,30 +227,48 @@ static void s_server_init(void);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_DH
 | 
			
		||||
static unsigned char dh512_p[] = {
 | 
			
		||||
    0xDA, 0x58, 0x3C, 0x16, 0xD9, 0x85, 0x22, 0x89, 0xD0, 0xE4, 0xAF, 0x75,
 | 
			
		||||
    0x6F, 0x4C, 0xCA, 0x92, 0xDD, 0x4B, 0xE5, 0x33, 0xB8, 0x04, 0xFB, 0x0F,
 | 
			
		||||
    0xED, 0x94, 0xEF, 0x9C, 0x8A, 0x44, 0x03, 0xED, 0x57, 0x46, 0x50, 0xD3,
 | 
			
		||||
    0x69, 0x99, 0xDB, 0x29, 0xD7, 0x76, 0x27, 0x6B, 0xA2, 0xD3, 0xD4, 0x12,
 | 
			
		||||
    0xE2, 0x18, 0xF4, 0xDD, 0x1E, 0x08, 0x4C, 0xF6, 0xD8, 0x00, 0x3E, 0x7C,
 | 
			
		||||
    0x47, 0x74, 0xE8, 0x33,
 | 
			
		||||
static unsigned char dh2048_p[] = {
 | 
			
		||||
    0xF6,0x42,0x57,0xB7,0x08,0x7F,0x08,0x17,0x72,0xA2,0xBA,0xD6,
 | 
			
		||||
    0xA9,0x42,0xF3,0x05,0xE8,0xF9,0x53,0x11,0x39,0x4F,0xB6,0xF1,
 | 
			
		||||
    0x6E,0xB9,0x4B,0x38,0x20,0xDA,0x01,0xA7,0x56,0xA3,0x14,0xE9,
 | 
			
		||||
    0x8F,0x40,0x55,0xF3,0xD0,0x07,0xC6,0xCB,0x43,0xA9,0x94,0xAD,
 | 
			
		||||
    0xF7,0x4C,0x64,0x86,0x49,0xF8,0x0C,0x83,0xBD,0x65,0xE9,0x17,
 | 
			
		||||
    0xD4,0xA1,0xD3,0x50,0xF8,0xF5,0x59,0x5F,0xDC,0x76,0x52,0x4F,
 | 
			
		||||
    0x3D,0x3D,0x8D,0xDB,0xCE,0x99,0xE1,0x57,0x92,0x59,0xCD,0xFD,
 | 
			
		||||
    0xB8,0xAE,0x74,0x4F,0xC5,0xFC,0x76,0xBC,0x83,0xC5,0x47,0x30,
 | 
			
		||||
    0x61,0xCE,0x7C,0xC9,0x66,0xFF,0x15,0xF9,0xBB,0xFD,0x91,0x5E,
 | 
			
		||||
    0xC7,0x01,0xAA,0xD3,0x5B,0x9E,0x8D,0xA0,0xA5,0x72,0x3A,0xD4,
 | 
			
		||||
    0x1A,0xF0,0xBF,0x46,0x00,0x58,0x2B,0xE5,0xF4,0x88,0xFD,0x58,
 | 
			
		||||
    0x4E,0x49,0xDB,0xCD,0x20,0xB4,0x9D,0xE4,0x91,0x07,0x36,0x6B,
 | 
			
		||||
    0x33,0x6C,0x38,0x0D,0x45,0x1D,0x0F,0x7C,0x88,0xB3,0x1C,0x7C,
 | 
			
		||||
    0x5B,0x2D,0x8E,0xF6,0xF3,0xC9,0x23,0xC0,0x43,0xF0,0xA5,0x5B,
 | 
			
		||||
    0x18,0x8D,0x8E,0xBB,0x55,0x8C,0xB8,0x5D,0x38,0xD3,0x34,0xFD,
 | 
			
		||||
    0x7C,0x17,0x57,0x43,0xA3,0x1D,0x18,0x6C,0xDE,0x33,0x21,0x2C,
 | 
			
		||||
    0xB5,0x2A,0xFF,0x3C,0xE1,0xB1,0x29,0x40,0x18,0x11,0x8D,0x7C,
 | 
			
		||||
    0x84,0xA7,0x0A,0x72,0xD6,0x86,0xC4,0x03,0x19,0xC8,0x07,0x29,
 | 
			
		||||
    0x7A,0xCA,0x95,0x0C,0xD9,0x96,0x9F,0xAB,0xD0,0x0A,0x50,0x9B,
 | 
			
		||||
    0x02,0x46,0xD3,0x08,0x3D,0x66,0xA4,0x5D,0x41,0x9F,0x9C,0x7C,
 | 
			
		||||
    0xBD,0x89,0x4B,0x22,0x19,0x26,0xBA,0xAB,0xA2,0x5E,0xC3,0x55,
 | 
			
		||||
    0xE9,0x32,0x0B,0x3B,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static unsigned char dh512_g[] = {
 | 
			
		||||
static unsigned char dh2048_g[] = {
 | 
			
		||||
    0x02,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static DH *get_dh512(void)
 | 
			
		||||
DH *get_dh2048()
 | 
			
		||||
{
 | 
			
		||||
    DH *dh = NULL;
 | 
			
		||||
    DH *dh;
 | 
			
		||||
 | 
			
		||||
    if ((dh = DH_new()) == NULL)
 | 
			
		||||
        return (NULL);
 | 
			
		||||
    dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
 | 
			
		||||
    dh->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
 | 
			
		||||
    if ((dh->p == NULL) || (dh->g == NULL))
 | 
			
		||||
        return (NULL);
 | 
			
		||||
    return (dh);
 | 
			
		||||
        return NULL;
 | 
			
		||||
    dh->p=BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
 | 
			
		||||
    dh->g=BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
 | 
			
		||||
    if (dh->p == NULL || dh->g == NULL) {
 | 
			
		||||
        DH_free(dh);
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
    return dh;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -334,7 +352,7 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
 | 
			
		||||
    }
 | 
			
		||||
    if (s_debug)
 | 
			
		||||
        BIO_printf(bio_s_out, "identity_len=%d identity=%s\n",
 | 
			
		||||
                   identity ? (int)strlen(identity) : 0, identity);
 | 
			
		||||
                   (int)strlen(identity), identity);
 | 
			
		||||
 | 
			
		||||
    /* here we could lookup the given identity e.g. from a database */
 | 
			
		||||
    if (strcmp(identity, psk_identity) != 0) {
 | 
			
		||||
@@ -522,6 +540,8 @@ static void sv_usage(void)
 | 
			
		||||
    BIO_printf(bio_err, " -state        - Print the SSL states\n");
 | 
			
		||||
    BIO_printf(bio_err, " -CApath arg   - PEM format directory of CA's\n");
 | 
			
		||||
    BIO_printf(bio_err, " -CAfile arg   - PEM format file of CA's\n");
 | 
			
		||||
    BIO_printf(bio_err,
 | 
			
		||||
               " -no_alt_chains - only ever use the first certificate chain found\n");
 | 
			
		||||
    BIO_printf(bio_err,
 | 
			
		||||
               " -nocert       - Don't use any certificates (Anon-DH)\n");
 | 
			
		||||
    BIO_printf(bio_err,
 | 
			
		||||
@@ -662,6 +682,8 @@ static int ebcdic_new(BIO *bi)
 | 
			
		||||
    EBCDIC_OUTBUFF *wbuf;
 | 
			
		||||
 | 
			
		||||
    wbuf = (EBCDIC_OUTBUFF *) OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + 1024);
 | 
			
		||||
    if (!wbuf)
 | 
			
		||||
        return 0;
 | 
			
		||||
    wbuf->alloced = 1024;
 | 
			
		||||
    wbuf->buff[0] = '\0';
 | 
			
		||||
 | 
			
		||||
@@ -716,9 +738,11 @@ static int ebcdic_write(BIO *b, const char *in, int inl)
 | 
			
		||||
        num = num + num;        /* double the size */
 | 
			
		||||
        if (num < inl)
 | 
			
		||||
            num = inl;
 | 
			
		||||
        OPENSSL_free(wbuf);
 | 
			
		||||
        wbuf =
 | 
			
		||||
            (EBCDIC_OUTBUFF *) OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + num);
 | 
			
		||||
        if (!wbuf)
 | 
			
		||||
            return 0;
 | 
			
		||||
        OPENSSL_free(b->ptr);
 | 
			
		||||
 | 
			
		||||
        wbuf->alloced = num;
 | 
			
		||||
        wbuf->buff[0] = '\0';
 | 
			
		||||
@@ -992,7 +1016,10 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
    int badop = 0, bugs = 0;
 | 
			
		||||
    int ret = 1;
 | 
			
		||||
    int off = 0;
 | 
			
		||||
    int no_tmp_rsa = 0, no_dhe = 0, no_ecdhe = 0, nocert = 0;
 | 
			
		||||
    int no_tmp_rsa = 0, no_dhe = 0, nocert = 0;
 | 
			
		||||
#ifndef OPENSSL_NO_ECDH
 | 
			
		||||
    int no_ecdhe = 0;
 | 
			
		||||
#endif
 | 
			
		||||
    int state = 0;
 | 
			
		||||
    const SSL_METHOD *meth = NULL;
 | 
			
		||||
    int socket_type = SOCK_STREAM;
 | 
			
		||||
@@ -1207,9 +1234,12 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
            no_tmp_rsa = 1;
 | 
			
		||||
        } else if (strcmp(*argv, "-no_dhe") == 0) {
 | 
			
		||||
            no_dhe = 1;
 | 
			
		||||
        } else if (strcmp(*argv, "-no_ecdhe") == 0) {
 | 
			
		||||
        }
 | 
			
		||||
#ifndef OPENSSL_NO_ECDH
 | 
			
		||||
        else if (strcmp(*argv, "-no_ecdhe") == 0) {
 | 
			
		||||
            no_ecdhe = 1;
 | 
			
		||||
        }
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_PSK
 | 
			
		||||
        else if (strcmp(*argv, "-psk_hint") == 0) {
 | 
			
		||||
            if (--argc < 1)
 | 
			
		||||
@@ -1541,12 +1571,6 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
    if (hack)
 | 
			
		||||
        SSL_CTX_set_options(ctx, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
 | 
			
		||||
    SSL_CTX_set_options(ctx, off);
 | 
			
		||||
    /*
 | 
			
		||||
     * DTLS: partial reads end up discarding unread UDP bytes :-( Setting
 | 
			
		||||
     * read ahead solves this problem.
 | 
			
		||||
     */
 | 
			
		||||
    if (socket_type == SOCK_DGRAM)
 | 
			
		||||
        SSL_CTX_set_read_ahead(ctx, 1);
 | 
			
		||||
 | 
			
		||||
    if (state)
 | 
			
		||||
        SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
 | 
			
		||||
@@ -1614,12 +1638,6 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
        if (hack)
 | 
			
		||||
            SSL_CTX_set_options(ctx2, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
 | 
			
		||||
        SSL_CTX_set_options(ctx2, off);
 | 
			
		||||
        /*
 | 
			
		||||
         * DTLS: partial reads end up discarding unread UDP bytes :-(
 | 
			
		||||
         * Setting read ahead solves this problem.
 | 
			
		||||
         */
 | 
			
		||||
        if (socket_type == SOCK_DGRAM)
 | 
			
		||||
            SSL_CTX_set_read_ahead(ctx2, 1);
 | 
			
		||||
 | 
			
		||||
        if (state)
 | 
			
		||||
            SSL_CTX_set_info_callback(ctx2, apps_ssl_info_callback);
 | 
			
		||||
@@ -1656,7 +1674,11 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
            BIO_printf(bio_s_out, "Setting temp DH parameters\n");
 | 
			
		||||
        } else {
 | 
			
		||||
            BIO_printf(bio_s_out, "Using default temp DH parameters\n");
 | 
			
		||||
            dh = get_dh512();
 | 
			
		||||
            dh = get_dh2048();
 | 
			
		||||
            if (dh == NULL) {
 | 
			
		||||
                ERR_print_errors(bio_err);
 | 
			
		||||
                goto end;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        (void)BIO_flush(bio_s_out);
 | 
			
		||||
 | 
			
		||||
@@ -2253,8 +2275,10 @@ static int sv_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
                    ret = 1;
 | 
			
		||||
                    goto err;
 | 
			
		||||
                }
 | 
			
		||||
                l += k;
 | 
			
		||||
                i -= k;
 | 
			
		||||
                if (k > 0) {
 | 
			
		||||
                    l += k;
 | 
			
		||||
                    i -= k;
 | 
			
		||||
                }
 | 
			
		||||
                if (i <= 0)
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
@@ -2644,7 +2668,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
 | 
			
		||||
        /* else we have data */
 | 
			
		||||
        if (((www == 1) && (strncmp("GET ", buf, 4) == 0)) ||
 | 
			
		||||
            ((www == 2) && (strncmp("GET /stats ", buf, 10) == 0))) {
 | 
			
		||||
            ((www == 2) && (strncmp("GET /stats ", buf, 11) == 0))) {
 | 
			
		||||
            char *p;
 | 
			
		||||
            X509 *peer;
 | 
			
		||||
            STACK_OF(SSL_CIPHER) *sk;
 | 
			
		||||
@@ -2918,7 +2942,8 @@ static int generate_session_id(const SSL *ssl, unsigned char *id,
 | 
			
		||||
{
 | 
			
		||||
    unsigned int count = 0;
 | 
			
		||||
    do {
 | 
			
		||||
        RAND_pseudo_bytes(id, *id_len);
 | 
			
		||||
        if (RAND_pseudo_bytes(id, *id_len) < 0)
 | 
			
		||||
            return 0;
 | 
			
		||||
        /*
 | 
			
		||||
         * Prefix the session_id with the required prefix. NB: If our prefix
 | 
			
		||||
         * is too long, clip it - but there will be worse effects anyway, eg.
 | 
			
		||||
 
 | 
			
		||||
@@ -426,13 +426,13 @@ static int do_accept(int acc_sock, int *sock, char **host)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
        ling.l_onoff=1;
 | 
			
		||||
        ling.l_linger=0;
 | 
			
		||||
        i=setsockopt(ret,SOL_SOCKET,SO_LINGER,(char *)&ling,sizeof(ling));
 | 
			
		||||
        if (i < 0) { perror("linger"); return(0); }
 | 
			
		||||
        i=0;
 | 
			
		||||
        i=setsockopt(ret,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
 | 
			
		||||
        if (i < 0) { perror("keepalive"); return(0); }
 | 
			
		||||
    ling.l_onoff=1;
 | 
			
		||||
    ling.l_linger=0;
 | 
			
		||||
    i=setsockopt(ret,SOL_SOCKET,SO_LINGER,(char *)&ling,sizeof(ling));
 | 
			
		||||
    if (i < 0) { perror("linger"); return(0); }
 | 
			
		||||
    i=0;
 | 
			
		||||
    i=setsockopt(ret,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
 | 
			
		||||
    if (i < 0) { perror("keepalive"); return(0); }
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
    if (host == NULL)
 | 
			
		||||
 
 | 
			
		||||
@@ -302,6 +302,10 @@ static int parseArgs(int argc, char **argv)
 | 
			
		||||
            if (--argc < 1)
 | 
			
		||||
                goto bad;
 | 
			
		||||
            maxTime = atoi(*(++argv));
 | 
			
		||||
            if (maxTime <= 0) {
 | 
			
		||||
                BIO_printf(bio_err, "time must be > 0\n");
 | 
			
		||||
                badop = 1;
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            BIO_printf(bio_err, "unknown option %s\n", *argv);
 | 
			
		||||
            badop = 1;
 | 
			
		||||
@@ -550,7 +554,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
         nConn, totalTime, ((double)nConn / totalTime), bytes_read);
 | 
			
		||||
    printf
 | 
			
		||||
        ("%d connections in %ld real seconds, %ld bytes read per connection\n",
 | 
			
		||||
         nConn, (long)time(NULL) - finishtime + maxTime, bytes_read / nConn);
 | 
			
		||||
         nConn, (long)time(NULL) - finishtime + maxTime,
 | 
			
		||||
         bytes_read / (nConn?nConn:1));
 | 
			
		||||
 | 
			
		||||
    ret = 0;
 | 
			
		||||
 end:
 | 
			
		||||
 
 | 
			
		||||
@@ -441,6 +441,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-CApath dir    trusted certificates directory\n");
 | 
			
		||||
        BIO_printf(bio_err, "-CAfile file   trusted certificates file\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-no_alt_chains only ever use the first certificate chain found\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "-crl_check     check revocation status of signer's certificate using CRLs\n");
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
 
 | 
			
		||||
@@ -435,10 +435,18 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
# ifdef OPENSSL_SYS_VMS
 | 
			
		||||
            len = strlen(s) + sizeof(CONFIG_FILE);
 | 
			
		||||
            tofree = OPENSSL_malloc(len);
 | 
			
		||||
            if (!tofree) {
 | 
			
		||||
                BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
                goto err;
 | 
			
		||||
            }
 | 
			
		||||
            strcpy(tofree, s);
 | 
			
		||||
# else
 | 
			
		||||
            len = strlen(s) + sizeof(CONFIG_FILE) + 1;
 | 
			
		||||
            tofree = OPENSSL_malloc(len);
 | 
			
		||||
            if (!tofree) {
 | 
			
		||||
                BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
                goto err;
 | 
			
		||||
            }
 | 
			
		||||
            BUF_strlcpy(tofree, s, len);
 | 
			
		||||
            BUF_strlcat(tofree, "/", len);
 | 
			
		||||
# endif
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								apps/ts.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								apps/ts.c
									
									
									
									
									
								
							@@ -1101,19 +1101,19 @@ static X509_STORE *create_cert_store(char *ca_path, char *ca_file)
 | 
			
		||||
 | 
			
		||||
static int MS_CALLBACK verify_cb(int ok, X509_STORE_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
        /*-
 | 
			
		||||
        char buf[256];
 | 
			
		||||
    /*-
 | 
			
		||||
    char buf[256];
 | 
			
		||||
 | 
			
		||||
        if (!ok)
 | 
			
		||||
                {
 | 
			
		||||
                X509_NAME_oneline(X509_get_subject_name(ctx->current_cert),
 | 
			
		||||
                                  buf, sizeof(buf));
 | 
			
		||||
                printf("%s\n", buf);
 | 
			
		||||
                printf("error %d at %d depth lookup: %s\n",
 | 
			
		||||
                       ctx->error, ctx->error_depth,
 | 
			
		||||
                        X509_verify_cert_error_string(ctx->error));
 | 
			
		||||
                }
 | 
			
		||||
        */
 | 
			
		||||
    if (!ok)
 | 
			
		||||
            {
 | 
			
		||||
            X509_NAME_oneline(X509_get_subject_name(ctx->current_cert),
 | 
			
		||||
                              buf, sizeof(buf));
 | 
			
		||||
            printf("%s\n", buf);
 | 
			
		||||
            printf("error %d at %d depth lookup: %s\n",
 | 
			
		||||
                   ctx->error, ctx->error_depth,
 | 
			
		||||
                    X509_verify_cert_error_string(ctx->error));
 | 
			
		||||
            }
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
    return ok;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -227,7 +227,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    if (ret == 1) {
 | 
			
		||||
        BIO_printf(bio_err,
 | 
			
		||||
                   "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
 | 
			
		||||
        BIO_printf(bio_err, " [-attime timestamp]");
 | 
			
		||||
        BIO_printf(bio_err, " [-no_alt_chains] [-attime timestamp]");
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
        BIO_printf(bio_err, " [-engine e]");
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -783,6 +783,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
                z = i2d_X509(x, NULL);
 | 
			
		||||
                m = OPENSSL_malloc(z);
 | 
			
		||||
                if (!m) {
 | 
			
		||||
                    BIO_printf(bio_err, "Out of memory\n");
 | 
			
		||||
                    ERR_print_errors(bio_err);
 | 
			
		||||
                    goto end;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                d = (unsigned char *)m;
 | 
			
		||||
                z = i2d_X509_NAME(X509_get_subject_name(x), &d);
 | 
			
		||||
 
 | 
			
		||||
@@ -125,12 +125,17 @@ install:
 | 
			
		||||
lint:
 | 
			
		||||
	@target=lint; $(RECURSIVE_MAKE)
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
update: local_depend
 | 
			
		||||
	@[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
 | 
			
		||||
 | 
			
		||||
depend: local_depend
 | 
			
		||||
	@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
 | 
			
		||||
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
 | 
			
		||||
local_depend:
 | 
			
		||||
	@[ -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; target=depend; $(RECURSIVE_MAKE) )
 | 
			
		||||
	@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
 | 
			
		||||
 
 | 
			
		||||
@@ -106,6 +106,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -1130,31 +1130,31 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
     * map cipher state to byte array block:
 | 
			
		||||
     */
 | 
			
		||||
    s0 =
 | 
			
		||||
        (Td4[(t0 >> 24)       ] << 24) ^
 | 
			
		||||
        (Td4[(t3 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(t2 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(t1      ) & 0xff])       ^
 | 
			
		||||
        ((u32)Td4[(t0 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(t3 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(t2 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(t1      ) & 0xff])       ^
 | 
			
		||||
        rk[0];
 | 
			
		||||
    PUTU32(out     , s0);
 | 
			
		||||
    s1 =
 | 
			
		||||
        (Td4[(t1 >> 24)       ] << 24) ^
 | 
			
		||||
        (Td4[(t0 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(t3 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(t2      ) & 0xff])       ^
 | 
			
		||||
        ((u32)Td4[(t1 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(t0 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(t3 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(t2      ) & 0xff])       ^
 | 
			
		||||
        rk[1];
 | 
			
		||||
    PUTU32(out +  4, s1);
 | 
			
		||||
    s2 =
 | 
			
		||||
        (Td4[(t2 >> 24)       ] << 24) ^
 | 
			
		||||
        (Td4[(t1 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(t0 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(t3      ) & 0xff])       ^
 | 
			
		||||
        ((u32)Td4[(t2 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(t1 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(t0 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(t3      ) & 0xff])       ^
 | 
			
		||||
        rk[2];
 | 
			
		||||
    PUTU32(out +  8, s2);
 | 
			
		||||
    s3 =
 | 
			
		||||
        (Td4[(t3 >> 24)       ] << 24) ^
 | 
			
		||||
        (Td4[(t2 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(t1 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(t0      ) & 0xff])       ^
 | 
			
		||||
        ((u32)Td4[(t3 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(t2 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(t1 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(t0      ) & 0xff])       ^
 | 
			
		||||
        rk[3];
 | 
			
		||||
    PUTU32(out + 12, s3);
 | 
			
		||||
}
 | 
			
		||||
@@ -1233,10 +1233,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
        while (1) {
 | 
			
		||||
            temp  = rk[3];
 | 
			
		||||
            rk[4] = rk[0] ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] << 24) ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff] << 16) ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff] << 8) ^
 | 
			
		||||
                (Te4[(temp >> 24)       ]) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] << 24) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff] << 8) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ]) ^
 | 
			
		||||
                rcon[i];
 | 
			
		||||
            rk[5] = rk[1] ^ rk[4];
 | 
			
		||||
            rk[6] = rk[2] ^ rk[5];
 | 
			
		||||
@@ -1253,10 +1253,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
        while (1) {
 | 
			
		||||
            temp = rk[ 5];
 | 
			
		||||
            rk[ 6] = rk[ 0] ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] << 24) ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff] << 16) ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff] << 8) ^
 | 
			
		||||
                (Te4[(temp >> 24)       ]) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] << 24) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff] << 8) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ]) ^
 | 
			
		||||
                rcon[i];
 | 
			
		||||
            rk[ 7] = rk[ 1] ^ rk[ 6];
 | 
			
		||||
            rk[ 8] = rk[ 2] ^ rk[ 7];
 | 
			
		||||
@@ -1275,10 +1275,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
        while (1) {
 | 
			
		||||
            temp = rk[ 7];
 | 
			
		||||
            rk[ 8] = rk[ 0] ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] << 24) ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff] << 16) ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff] << 8) ^
 | 
			
		||||
                (Te4[(temp >> 24)       ]) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] << 24) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff] << 8) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ]) ^
 | 
			
		||||
                rcon[i];
 | 
			
		||||
            rk[ 9] = rk[ 1] ^ rk[ 8];
 | 
			
		||||
            rk[10] = rk[ 2] ^ rk[ 9];
 | 
			
		||||
@@ -1288,10 +1288,10 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
            }
 | 
			
		||||
            temp = rk[11];
 | 
			
		||||
            rk[12] = rk[ 4] ^
 | 
			
		||||
                (Te4[(temp >> 24)       ] << 24) ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] << 16) ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff] << 8) ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff]);
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ] << 24) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff] << 8) ^
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff]);
 | 
			
		||||
            rk[13] = rk[ 5] ^ rk[12];
 | 
			
		||||
            rk[14] = rk[ 6] ^ rk[13];
 | 
			
		||||
            rk[15] = rk[ 7] ^ rk[14];
 | 
			
		||||
 
 | 
			
		||||
@@ -497,10 +497,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
        while (1) {
 | 
			
		||||
            temp  = rk[3];
 | 
			
		||||
            rk[4] = rk[0] ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff]      ) ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] <<  8) ^
 | 
			
		||||
                (Te4[(temp >> 24)       ] << 16) ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff] << 24) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff]      ) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] <<  8) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff] << 24) ^
 | 
			
		||||
                rcon[i];
 | 
			
		||||
            rk[5] = rk[1] ^ rk[4];
 | 
			
		||||
            rk[6] = rk[2] ^ rk[5];
 | 
			
		||||
@@ -517,10 +517,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
        while (1) {
 | 
			
		||||
            temp = rk[ 5];
 | 
			
		||||
            rk[ 6] = rk[ 0] ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff]      ) ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] <<  8) ^
 | 
			
		||||
                (Te4[(temp >> 24)       ] << 16) ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff] << 24) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff]      ) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] <<  8) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff] << 24) ^
 | 
			
		||||
                rcon[i];
 | 
			
		||||
            rk[ 7] = rk[ 1] ^ rk[ 6];
 | 
			
		||||
            rk[ 8] = rk[ 2] ^ rk[ 7];
 | 
			
		||||
@@ -539,10 +539,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
        while (1) {
 | 
			
		||||
            temp = rk[ 7];
 | 
			
		||||
            rk[ 8] = rk[ 0] ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff]      ) ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] <<  8) ^
 | 
			
		||||
                (Te4[(temp >> 24)       ] << 16) ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff] << 24) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff]      ) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] <<  8) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff] << 24) ^
 | 
			
		||||
                rcon[i];
 | 
			
		||||
            rk[ 9] = rk[ 1] ^ rk[ 8];
 | 
			
		||||
            rk[10] = rk[ 2] ^ rk[ 9];
 | 
			
		||||
@@ -552,10 +552,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
            }
 | 
			
		||||
            temp = rk[11];
 | 
			
		||||
            rk[12] = rk[ 4] ^
 | 
			
		||||
                (Te4[(temp      ) & 0xff]      ) ^
 | 
			
		||||
                (Te4[(temp >>  8) & 0xff] <<  8) ^
 | 
			
		||||
                (Te4[(temp >> 16) & 0xff] << 16) ^
 | 
			
		||||
                (Te4[(temp >> 24)       ] << 24);
 | 
			
		||||
                ((u32)Te4[(temp      ) & 0xff]      ) ^
 | 
			
		||||
                ((u32)Te4[(temp >>  8) & 0xff] <<  8) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 16) & 0xff] << 16) ^
 | 
			
		||||
                ((u32)Te4[(temp >> 24)       ] << 24);
 | 
			
		||||
            rk[13] = rk[ 5] ^ rk[12];
 | 
			
		||||
            rk[14] = rk[ 6] ^ rk[13];
 | 
			
		||||
            rk[15] = rk[ 7] ^ rk[14];
 | 
			
		||||
@@ -674,22 +674,22 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
#if defined(AES_COMPACT_IN_OUTER_ROUNDS)
 | 
			
		||||
    prefetch256(Te4);
 | 
			
		||||
 | 
			
		||||
    t[0] =  Te4[(s0      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s3 >> 24)       ] << 24;
 | 
			
		||||
    t[1] =  Te4[(s1      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s0 >> 24)       ] << 24;
 | 
			
		||||
    t[2] =  Te4[(s2      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s1 >> 24)       ] << 24;
 | 
			
		||||
    t[3] =  Te4[(s3      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s2 >> 24)       ] << 24;
 | 
			
		||||
    t[0] = (u32)Te4[(s0      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s3 >> 24)       ] << 24;
 | 
			
		||||
    t[1] = (u32)Te4[(s1      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s0 >> 24)       ] << 24;
 | 
			
		||||
    t[2] = (u32)Te4[(s2      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s1 >> 24)       ] << 24;
 | 
			
		||||
    t[3] = (u32)Te4[(s3      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s2 >> 24)       ] << 24;
 | 
			
		||||
 | 
			
		||||
    /* now do the linear transform using words */
 | 
			
		||||
    {   int i;
 | 
			
		||||
@@ -740,22 +740,22 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
     */
 | 
			
		||||
    for (rk+=8,r=key->rounds-2; r>0; rk+=4,r--) {
 | 
			
		||||
#if defined(AES_COMPACT_IN_INNER_ROUNDS)
 | 
			
		||||
        t[0] =  Te4[(s0      ) & 0xff]       ^
 | 
			
		||||
            Te4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
            Te4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
            Te4[(s3 >> 24)       ] << 24;
 | 
			
		||||
        t[1] =  Te4[(s1      ) & 0xff]       ^
 | 
			
		||||
            Te4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
            Te4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
            Te4[(s0 >> 24)       ] << 24;
 | 
			
		||||
        t[2] =  Te4[(s2      ) & 0xff]       ^
 | 
			
		||||
            Te4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
            Te4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
            Te4[(s1 >> 24)       ] << 24;
 | 
			
		||||
        t[3] =  Te4[(s3      ) & 0xff]       ^
 | 
			
		||||
            Te4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
            Te4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
            Te4[(s2 >> 24)       ] << 24;
 | 
			
		||||
        t[0] = (u32)Te4[(s0      ) & 0xff]       ^
 | 
			
		||||
               (u32)Te4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Te4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Te4[(s3 >> 24)       ] << 24;
 | 
			
		||||
        t[1] = (u32)Te4[(s1      ) & 0xff]       ^
 | 
			
		||||
               (u32)Te4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Te4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Te4[(s0 >> 24)       ] << 24;
 | 
			
		||||
        t[2] = (u32)Te4[(s2      ) & 0xff]       ^
 | 
			
		||||
               (u32)Te4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Te4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Te4[(s1 >> 24)       ] << 24;
 | 
			
		||||
        t[3] = (u32)Te4[(s3      ) & 0xff]       ^
 | 
			
		||||
               (u32)Te4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Te4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Te4[(s2 >> 24)       ] << 24;
 | 
			
		||||
 | 
			
		||||
        /* now do the linear transform using words */
 | 
			
		||||
        {
 | 
			
		||||
@@ -810,28 +810,28 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
    prefetch256(Te4);
 | 
			
		||||
 | 
			
		||||
    *(u32*)(out+0) =
 | 
			
		||||
        Te4[(s0      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s3 >> 24)       ] << 24 ^
 | 
			
		||||
           (u32)Te4[(s0      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s3 >> 24)       ] << 24 ^
 | 
			
		||||
        rk[0];
 | 
			
		||||
    *(u32*)(out+4) =
 | 
			
		||||
        Te4[(s1      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s0 >> 24)       ] << 24 ^
 | 
			
		||||
           (u32)Te4[(s1      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s0 >> 24)       ] << 24 ^
 | 
			
		||||
        rk[1];
 | 
			
		||||
    *(u32*)(out+8) =
 | 
			
		||||
        Te4[(s2      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s1 >> 24)       ] << 24 ^
 | 
			
		||||
           (u32)Te4[(s2      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s1 >> 24)       ] << 24 ^
 | 
			
		||||
        rk[2];
 | 
			
		||||
    *(u32*)(out+12) =
 | 
			
		||||
        Te4[(s3      ) & 0xff]       ^
 | 
			
		||||
        Te4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Te4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Te4[(s2 >> 24)       ] << 24 ^
 | 
			
		||||
           (u32)Te4[(s3      ) & 0xff]       ^
 | 
			
		||||
           (u32)Te4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Te4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Te4[(s2 >> 24)       ] << 24 ^
 | 
			
		||||
        rk[3];
 | 
			
		||||
#else
 | 
			
		||||
    *(u32*)(out+0) =
 | 
			
		||||
@@ -888,22 +888,22 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
#if defined(AES_COMPACT_IN_OUTER_ROUNDS)
 | 
			
		||||
    prefetch256(Td4);
 | 
			
		||||
 | 
			
		||||
    t[0] =  Td4[(s0      ) & 0xff]       ^
 | 
			
		||||
    Td4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
    Td4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
    Td4[(s1 >> 24)       ] << 24;
 | 
			
		||||
    t[1] =  Td4[(s1      ) & 0xff]       ^
 | 
			
		||||
    Td4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
    Td4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
    Td4[(s2 >> 24)       ] << 24;
 | 
			
		||||
    t[2] =  Td4[(s2      ) & 0xff]       ^
 | 
			
		||||
    Td4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
    Td4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
    Td4[(s3 >> 24)       ] << 24;
 | 
			
		||||
    t[3] =  Td4[(s3      ) & 0xff]       ^
 | 
			
		||||
    Td4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
    Td4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
    Td4[(s0 >> 24)       ] << 24;
 | 
			
		||||
    t[0] = (u32)Td4[(s0      ) & 0xff]       ^
 | 
			
		||||
           (u32)Td4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Td4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Td4[(s1 >> 24)       ] << 24;
 | 
			
		||||
    t[1] = (u32)Td4[(s1      ) & 0xff]       ^
 | 
			
		||||
           (u32)Td4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Td4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Td4[(s2 >> 24)       ] << 24;
 | 
			
		||||
    t[2] = (u32)Td4[(s2      ) & 0xff]       ^
 | 
			
		||||
           (u32)Td4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Td4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Td4[(s3 >> 24)       ] << 24;
 | 
			
		||||
    t[3] = (u32)Td4[(s3      ) & 0xff]       ^
 | 
			
		||||
           (u32)Td4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
           (u32)Td4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
           (u32)Td4[(s0 >> 24)       ] << 24;
 | 
			
		||||
 | 
			
		||||
    /* now do the linear transform using words */ 
 | 
			
		||||
    {
 | 
			
		||||
@@ -965,22 +965,22 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
     */
 | 
			
		||||
    for (rk+=8,r=key->rounds-2; r>0; rk+=4,r--) {
 | 
			
		||||
#if defined(AES_COMPACT_IN_INNER_ROUNDS)
 | 
			
		||||
        t[0] =  Td4[(s0      ) & 0xff]       ^
 | 
			
		||||
        Td4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Td4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Td4[(s1 >> 24)       ] << 24;
 | 
			
		||||
        t[1] =  Td4[(s1      ) & 0xff]       ^
 | 
			
		||||
        Td4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Td4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Td4[(s2 >> 24)       ] << 24;
 | 
			
		||||
        t[2] =  Td4[(s2      ) & 0xff]       ^
 | 
			
		||||
        Td4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Td4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Td4[(s3 >> 24)       ] << 24;
 | 
			
		||||
        t[3] =  Td4[(s3      ) & 0xff]       ^
 | 
			
		||||
        Td4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
        Td4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
        Td4[(s0 >> 24)       ] << 24;
 | 
			
		||||
        t[0] = (u32)Td4[(s0      ) & 0xff]       ^
 | 
			
		||||
               (u32)Td4[(s3 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Td4[(s2 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Td4[(s1 >> 24)       ] << 24;
 | 
			
		||||
        t[1] = (u32)Td4[(s1      ) & 0xff]       ^
 | 
			
		||||
               (u32)Td4[(s0 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Td4[(s3 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Td4[(s2 >> 24)       ] << 24;
 | 
			
		||||
        t[2] = (u32)Td4[(s2      ) & 0xff]       ^
 | 
			
		||||
               (u32)Td4[(s1 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Td4[(s0 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Td4[(s3 >> 24)       ] << 24;
 | 
			
		||||
        t[3] = (u32)Td4[(s3      ) & 0xff]       ^
 | 
			
		||||
               (u32)Td4[(s2 >>  8) & 0xff] <<  8 ^
 | 
			
		||||
               (u32)Td4[(s1 >> 16) & 0xff] << 16 ^
 | 
			
		||||
               (u32)Td4[(s0 >> 24)       ] << 24;
 | 
			
		||||
 | 
			
		||||
    /* now do the linear transform using words */ 
 | 
			
		||||
    {
 | 
			
		||||
@@ -1044,27 +1044,27 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
    prefetch256(Td4);
 | 
			
		||||
 | 
			
		||||
    *(u32*)(out+0) =
 | 
			
		||||
        (Td4[(s0      ) & 0xff])    ^
 | 
			
		||||
        (Td4[(s3 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(s2 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(s1 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(s0      ) & 0xff])    ^
 | 
			
		||||
        ((u32)Td4[(s3 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(s2 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(s1 >> 24)       ] << 24) ^
 | 
			
		||||
        rk[0];
 | 
			
		||||
    *(u32*)(out+4) =
 | 
			
		||||
        (Td4[(s1      ) & 0xff])     ^
 | 
			
		||||
        (Td4[(s0 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(s3 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(s2 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(s1      ) & 0xff])     ^
 | 
			
		||||
        ((u32)Td4[(s0 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(s3 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(s2 >> 24)       ] << 24) ^
 | 
			
		||||
        rk[1];
 | 
			
		||||
    *(u32*)(out+8) =
 | 
			
		||||
        (Td4[(s2      ) & 0xff])     ^
 | 
			
		||||
        (Td4[(s1 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(s0 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(s3 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(s2      ) & 0xff])     ^
 | 
			
		||||
        ((u32)Td4[(s1 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(s0 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(s3 >> 24)       ] << 24) ^
 | 
			
		||||
        rk[2];
 | 
			
		||||
    *(u32*)(out+12) =
 | 
			
		||||
        (Td4[(s3      ) & 0xff])     ^
 | 
			
		||||
        (Td4[(s2 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        (Td4[(s1 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        (Td4[(s0 >> 24)       ] << 24) ^
 | 
			
		||||
        ((u32)Td4[(s3      ) & 0xff])     ^
 | 
			
		||||
        ((u32)Td4[(s2 >>  8) & 0xff] <<  8) ^
 | 
			
		||||
        ((u32)Td4[(s1 >> 16) & 0xff] << 16) ^
 | 
			
		||||
        ((u32)Td4[(s0 >> 24)       ] << 24) ^
 | 
			
		||||
        rk[3];
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -93,6 +93,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -124,6 +124,8 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
 | 
			
		||||
    else {
 | 
			
		||||
        ret = a->length;
 | 
			
		||||
        i = a->data[0];
 | 
			
		||||
        if (ret == 1 && i == 0)
 | 
			
		||||
            neg = 0;
 | 
			
		||||
        if (!neg && (i > 127)) {
 | 
			
		||||
            pad = 1;
 | 
			
		||||
            pb = 0;
 | 
			
		||||
@@ -162,7 +164,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
 | 
			
		||||
        p += a->length - 1;
 | 
			
		||||
        i = a->length;
 | 
			
		||||
        /* Copy zeros to destination as long as source is zero */
 | 
			
		||||
        while (!*n) {
 | 
			
		||||
        while (!*n && i > 1) {
 | 
			
		||||
            *(p--) = 0;
 | 
			
		||||
            n--;
 | 
			
		||||
            i--;
 | 
			
		||||
@@ -419,7 +421,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
 | 
			
		||||
        ASN1err(ASN1_F_BN_TO_ASN1_INTEGER, ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
        goto err;
 | 
			
		||||
    }
 | 
			
		||||
    if (BN_is_negative(bn))
 | 
			
		||||
    if (BN_is_negative(bn) && !BN_is_zero(bn))
 | 
			
		||||
        ret->type = V_ASN1_NEG_INTEGER;
 | 
			
		||||
    else
 | 
			
		||||
        ret->type = V_ASN1_INTEGER;
 | 
			
		||||
 
 | 
			
		||||
@@ -252,13 +252,13 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
 | 
			
		||||
        rv = pkey->ameth->item_sign(ctx, it, asn, algor1, algor2, signature);
 | 
			
		||||
        if (rv == 1)
 | 
			
		||||
            outl = signature->length;
 | 
			
		||||
                /*-
 | 
			
		||||
                 * Return value meanings:
 | 
			
		||||
                 * <=0: error.
 | 
			
		||||
                 *   1: method does everything.
 | 
			
		||||
                 *   2: carry on as normal.
 | 
			
		||||
                 *   3: ASN1 method sets algorithm identifiers: just sign.
 | 
			
		||||
                 */
 | 
			
		||||
        /*-
 | 
			
		||||
         * Return value meanings:
 | 
			
		||||
         * <=0: error.
 | 
			
		||||
         *   1: method does everything.
 | 
			
		||||
         *   2: carry on as normal.
 | 
			
		||||
         *   3: ASN1 method sets algorithm identifiers: just sign.
 | 
			
		||||
         */
 | 
			
		||||
        if (rv <= 0)
 | 
			
		||||
            ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_EVP_LIB);
 | 
			
		||||
        if (rv <= 1)
 | 
			
		||||
 
 | 
			
		||||
@@ -119,6 +119,9 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
 | 
			
		||||
    case V_ASN1_OBJECT:
 | 
			
		||||
        result = OBJ_cmp(a->value.object, b->value.object);
 | 
			
		||||
        break;
 | 
			
		||||
    case V_ASN1_BOOLEAN:
 | 
			
		||||
        result = a->value.boolean - b->value.boolean;
 | 
			
		||||
        break;
 | 
			
		||||
    case V_ASN1_NULL:
 | 
			
		||||
        result = 0;             /* They do not have content. */
 | 
			
		||||
        break;
 | 
			
		||||
 
 | 
			
		||||
@@ -795,6 +795,7 @@ DECLARE_ASN1_SET_OF(ASN1_OBJECT)
 | 
			
		||||
 | 
			
		||||
ASN1_STRING *ASN1_STRING_new(void);
 | 
			
		||||
void ASN1_STRING_free(ASN1_STRING *a);
 | 
			
		||||
void ASN1_STRING_clear_free(ASN1_STRING *a);
 | 
			
		||||
int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
 | 
			
		||||
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
 | 
			
		||||
ASN1_STRING *ASN1_STRING_type_new(int type);
 | 
			
		||||
 
 | 
			
		||||
@@ -74,6 +74,8 @@
 | 
			
		||||
#define ASN1_GEN_STR(str,val)   {str, sizeof(str) - 1, val}
 | 
			
		||||
 | 
			
		||||
#define ASN1_FLAG_EXP_MAX       20
 | 
			
		||||
/* Maximum number of nested sequences */
 | 
			
		||||
#define ASN1_GEN_SEQ_MAX_DEPTH  50
 | 
			
		||||
 | 
			
		||||
/* Input formats */
 | 
			
		||||
 | 
			
		||||
@@ -110,13 +112,16 @@ typedef struct {
 | 
			
		||||
    int exp_count;
 | 
			
		||||
} tag_exp_arg;
 | 
			
		||||
 | 
			
		||||
static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
 | 
			
		||||
                              int *perr);
 | 
			
		||||
static int bitstr_cb(const char *elem, int len, void *bitstr);
 | 
			
		||||
static int asn1_cb(const char *elem, int len, void *bitstr);
 | 
			
		||||
static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class,
 | 
			
		||||
                      int exp_constructed, int exp_pad, int imp_ok);
 | 
			
		||||
static int parse_tagging(const char *vstart, int vlen, int *ptag,
 | 
			
		||||
                         int *pclass);
 | 
			
		||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf);
 | 
			
		||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
 | 
			
		||||
                             int depth, int *perr);
 | 
			
		||||
static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype);
 | 
			
		||||
static int asn1_str2tag(const char *tagstr, int len);
 | 
			
		||||
 | 
			
		||||
@@ -132,6 +137,16 @@ ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
 | 
			
		||||
{
 | 
			
		||||
    int err = 0;
 | 
			
		||||
    ASN1_TYPE *ret = generate_v3(str, cnf, 0, &err);
 | 
			
		||||
    if (err)
 | 
			
		||||
        ASN1err(ASN1_F_ASN1_GENERATE_V3, err);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
 | 
			
		||||
                              int *perr)
 | 
			
		||||
{
 | 
			
		||||
    ASN1_TYPE *ret;
 | 
			
		||||
    tag_exp_arg asn1_tags;
 | 
			
		||||
@@ -152,17 +167,22 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
 | 
			
		||||
    asn1_tags.imp_class = -1;
 | 
			
		||||
    asn1_tags.format = ASN1_GEN_FORMAT_ASCII;
 | 
			
		||||
    asn1_tags.exp_count = 0;
 | 
			
		||||
    if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0)
 | 
			
		||||
    if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0) {
 | 
			
		||||
        *perr = ASN1_R_UNKNOWN_TAG;
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((asn1_tags.utype == V_ASN1_SEQUENCE)
 | 
			
		||||
        || (asn1_tags.utype == V_ASN1_SET)) {
 | 
			
		||||
        if (!cnf) {
 | 
			
		||||
            ASN1err(ASN1_F_ASN1_GENERATE_V3,
 | 
			
		||||
                    ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG);
 | 
			
		||||
            *perr = ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG;
 | 
			
		||||
            return NULL;
 | 
			
		||||
        }
 | 
			
		||||
        ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf);
 | 
			
		||||
        if (depth >= ASN1_GEN_SEQ_MAX_DEPTH) {
 | 
			
		||||
            *perr = ASN1_R_ILLEGAL_NESTED_TAGGING;
 | 
			
		||||
            return NULL;
 | 
			
		||||
        }
 | 
			
		||||
        ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf, depth, perr);
 | 
			
		||||
    } else
 | 
			
		||||
        ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype);
 | 
			
		||||
 | 
			
		||||
@@ -279,6 +299,9 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
 | 
			
		||||
 | 
			
		||||
    int tmp_tag, tmp_class;
 | 
			
		||||
 | 
			
		||||
    if (elem == NULL)
 | 
			
		||||
        return -1;
 | 
			
		||||
 | 
			
		||||
    for (i = 0, p = elem; i < len; p++, i++) {
 | 
			
		||||
        /* Look for the ':' in name value pairs */
 | 
			
		||||
        if (*p == ':') {
 | 
			
		||||
@@ -350,13 +373,17 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
    case ASN1_GEN_FLAG_FORMAT:
 | 
			
		||||
        if (!vstart) {
 | 
			
		||||
            ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
 | 
			
		||||
            return -1;
 | 
			
		||||
        }
 | 
			
		||||
        if (!strncmp(vstart, "ASCII", 5))
 | 
			
		||||
            arg->format = ASN1_GEN_FORMAT_ASCII;
 | 
			
		||||
        else if (!strncmp(vstart, "UTF8", 4))
 | 
			
		||||
            arg->format = ASN1_GEN_FORMAT_UTF8;
 | 
			
		||||
        else if (!strncmp(vstart, "HEX", 3))
 | 
			
		||||
            arg->format = ASN1_GEN_FORMAT_HEX;
 | 
			
		||||
        else if (!strncmp(vstart, "BITLIST", 3))
 | 
			
		||||
        else if (!strncmp(vstart, "BITLIST", 7))
 | 
			
		||||
            arg->format = ASN1_GEN_FORMAT_BITLIST;
 | 
			
		||||
        else {
 | 
			
		||||
            ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKOWN_FORMAT);
 | 
			
		||||
@@ -428,7 +455,8 @@ static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass)
 | 
			
		||||
 | 
			
		||||
/* Handle multiple types: SET and SEQUENCE */
 | 
			
		||||
 | 
			
		||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
 | 
			
		||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
 | 
			
		||||
                             int depth, int *perr)
 | 
			
		||||
{
 | 
			
		||||
    ASN1_TYPE *ret = NULL;
 | 
			
		||||
    STACK_OF(ASN1_TYPE) *sk = NULL;
 | 
			
		||||
@@ -447,7 +475,8 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
 | 
			
		||||
            goto bad;
 | 
			
		||||
        for (i = 0; i < sk_CONF_VALUE_num(sect); i++) {
 | 
			
		||||
            ASN1_TYPE *typ =
 | 
			
		||||
                ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);
 | 
			
		||||
                generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf,
 | 
			
		||||
                            depth + 1, perr);
 | 
			
		||||
            if (!typ)
 | 
			
		||||
                goto bad;
 | 
			
		||||
            if (!sk_ASN1_TYPE_push(sk, typ))
 | 
			
		||||
 
 | 
			
		||||
@@ -430,6 +430,13 @@ void ASN1_STRING_free(ASN1_STRING *a)
 | 
			
		||||
    OPENSSL_free(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ASN1_STRING_clear_free(ASN1_STRING *a)
 | 
			
		||||
{
 | 
			
		||||
    if (a && a->data && !(a->flags & ASN1_STRING_FLAG_NDEF))
 | 
			
		||||
        OPENSSL_cleanse(a->data, a->length);
 | 
			
		||||
    ASN1_STRING_free(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
 
 | 
			
		||||
@@ -337,7 +337,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
 | 
			
		||||
                            goto end;
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    if (BIO_write(bp, "BAD ENUMERATED", 11) <= 0)
 | 
			
		||||
                    if (BIO_write(bp, "BAD ENUMERATED", 14) <= 0)
 | 
			
		||||
                        goto end;
 | 
			
		||||
                }
 | 
			
		||||
                M_ASN1_ENUMERATED_free(bs);
 | 
			
		||||
 
 | 
			
		||||
@@ -289,7 +289,8 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
 | 
			
		||||
    if ((flags & SMIME_DETACHED) && data) {
 | 
			
		||||
        /* We want multipart/signed */
 | 
			
		||||
        /* Generate a random boundary */
 | 
			
		||||
        RAND_pseudo_bytes((unsigned char *)bound, 32);
 | 
			
		||||
        if (RAND_pseudo_bytes((unsigned char *)bound, 32) < 0)
 | 
			
		||||
            return 0;
 | 
			
		||||
        for (i = 0; i < 32; i++) {
 | 
			
		||||
            c = bound[i] & 0xf;
 | 
			
		||||
            if (c < 10)
 | 
			
		||||
 
 | 
			
		||||
@@ -162,6 +162,9 @@ static int ndef_prefix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
 | 
			
		||||
 | 
			
		||||
    derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it);
 | 
			
		||||
    p = OPENSSL_malloc(derlen);
 | 
			
		||||
    if (!p)
 | 
			
		||||
        return 0;
 | 
			
		||||
 | 
			
		||||
    ndef_aux->derbuf = p;
 | 
			
		||||
    *pbuf = p;
 | 
			
		||||
    derlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
 | 
			
		||||
@@ -229,6 +232,9 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
 | 
			
		||||
 | 
			
		||||
    derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it);
 | 
			
		||||
    p = OPENSSL_malloc(derlen);
 | 
			
		||||
    if (!p)
 | 
			
		||||
        return 0;
 | 
			
		||||
 | 
			
		||||
    ndef_aux->derbuf = p;
 | 
			
		||||
    *pbuf = p;
 | 
			
		||||
    derlen = ASN1_item_ndef_i2d(ndef_aux->val, &p, ndef_aux->it);
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,8 @@ static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
 | 
			
		||||
    /* Since the structure must still be valid use ASN1_OP_FREE_PRE */
 | 
			
		||||
    if (operation == ASN1_OP_FREE_PRE) {
 | 
			
		||||
        PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval;
 | 
			
		||||
        if (key->pkey->value.octet_string)
 | 
			
		||||
        if (key->pkey && key->pkey->type == V_ASN1_OCTET_STRING
 | 
			
		||||
            && key->pkey->value.octet_string != NULL)
 | 
			
		||||
            OPENSSL_cleanse(key->pkey->value.octet_string->data,
 | 
			
		||||
                            key->pkey->value.octet_string->length);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -164,7 +164,7 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(cflag & X509_FLAG_NO_SIGNAME)) {
 | 
			
		||||
        if (X509_signature_print(bp, x->sig_alg, NULL) <= 0)
 | 
			
		||||
        if (X509_signature_print(bp, ci->signature, NULL) <= 0)
 | 
			
		||||
            goto err;
 | 
			
		||||
#if 0
 | 
			
		||||
        if (BIO_printf(bp, "%8sSignature Algorithm: ", "") <= 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -304,9 +304,16 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
 | 
			
		||||
    case ASN1_ITYPE_CHOICE:
 | 
			
		||||
        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
 | 
			
		||||
            goto auxerr;
 | 
			
		||||
 | 
			
		||||
        /* Allocate structure */
 | 
			
		||||
        if (!*pval && !ASN1_item_ex_new(pval, it)) {
 | 
			
		||||
        if (*pval) {
 | 
			
		||||
            /* Free up and zero CHOICE value if initialised */
 | 
			
		||||
            i = asn1_get_choice_selector(pval, it);
 | 
			
		||||
            if ((i >= 0) && (i < it->tcount)) {
 | 
			
		||||
                tt = it->templates + i;
 | 
			
		||||
                pchptr = asn1_get_field_ptr(pval, tt);
 | 
			
		||||
                ASN1_template_free(pchptr, tt);
 | 
			
		||||
                asn1_set_choice_selector(pval, -1, it);
 | 
			
		||||
            }
 | 
			
		||||
        } else if (!ASN1_item_ex_new(pval, it)) {
 | 
			
		||||
            ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR);
 | 
			
		||||
            goto err;
 | 
			
		||||
        }
 | 
			
		||||
@@ -386,6 +393,17 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
 | 
			
		||||
        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
 | 
			
		||||
            goto auxerr;
 | 
			
		||||
 | 
			
		||||
        /* Free up and zero any ADB found */
 | 
			
		||||
        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
 | 
			
		||||
            if (tt->flags & ASN1_TFLG_ADB_MASK) {
 | 
			
		||||
                const ASN1_TEMPLATE *seqtt;
 | 
			
		||||
                ASN1_VALUE **pseqval;
 | 
			
		||||
                seqtt = asn1_do_adb(pval, tt, 1);
 | 
			
		||||
                pseqval = asn1_get_field_ptr(pval, seqtt);
 | 
			
		||||
                ASN1_template_free(pseqval, seqtt);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /* Get each field entry */
 | 
			
		||||
        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
 | 
			
		||||
            const ASN1_TEMPLATE *seqtt;
 | 
			
		||||
 
 | 
			
		||||
@@ -100,9 +100,6 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
 | 
			
		||||
    else
 | 
			
		||||
        asn1_cb = 0;
 | 
			
		||||
 | 
			
		||||
    if (!combine)
 | 
			
		||||
        *pval = NULL;
 | 
			
		||||
 | 
			
		||||
#ifdef CRYPTO_MDEBUG
 | 
			
		||||
    if (it->sname)
 | 
			
		||||
        CRYPTO_push_info(it->sname);
 | 
			
		||||
@@ -315,13 +312,16 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
 | 
			
		||||
    ASN1_STRING *str;
 | 
			
		||||
    int utype;
 | 
			
		||||
 | 
			
		||||
    if (it && it->funcs) {
 | 
			
		||||
    if (!it)
 | 
			
		||||
        return 0;
 | 
			
		||||
 | 
			
		||||
    if (it->funcs) {
 | 
			
		||||
        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
 | 
			
		||||
        if (pf->prim_new)
 | 
			
		||||
            return pf->prim_new(pval, it);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!it || (it->itype == ASN1_ITYPE_MSTRING))
 | 
			
		||||
    if (it->itype == ASN1_ITYPE_MSTRING)
 | 
			
		||||
        utype = -1;
 | 
			
		||||
    else
 | 
			
		||||
        utype = it->utype;
 | 
			
		||||
 
 | 
			
		||||
@@ -220,6 +220,7 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
 | 
			
		||||
            if (!asn1_template_print_ctx(out, fld, indent,
 | 
			
		||||
                                         it->templates, pctx))
 | 
			
		||||
                return 0;
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        /* fall thru */
 | 
			
		||||
    case ASN1_ITYPE_MSTRING:
 | 
			
		||||
@@ -289,6 +290,8 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
 | 
			
		||||
        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
 | 
			
		||||
            const ASN1_TEMPLATE *seqtt;
 | 
			
		||||
            seqtt = asn1_do_adb(fld, tt, 1);
 | 
			
		||||
            if (!seqtt)
 | 
			
		||||
                return 0;
 | 
			
		||||
            tmpfld = asn1_get_field_ptr(fld, seqtt);
 | 
			
		||||
            if (!asn1_template_print_ctx(out, tmpfld,
 | 
			
		||||
                                         indent + 2, seqtt, pctx))
 | 
			
		||||
 
 | 
			
		||||
@@ -98,46 +98,55 @@ ASN1_ITEM_end(CBIGNUM)
 | 
			
		||||
 | 
			
		||||
static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        *pval = (ASN1_VALUE *)BN_new();
 | 
			
		||||
        if(*pval) return 1;
 | 
			
		||||
        else return 0;
 | 
			
		||||
    *pval = (ASN1_VALUE *)BN_new();
 | 
			
		||||
    if (*pval)
 | 
			
		||||
        return 1;
 | 
			
		||||
    else
 | 
			
		||||
        return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        if(!*pval) return;
 | 
			
		||||
        if(it->size & BN_SENSITIVE) BN_clear_free((BIGNUM *)*pval);
 | 
			
		||||
        else BN_free((BIGNUM *)*pval);
 | 
			
		||||
        *pval = NULL;
 | 
			
		||||
    if (!*pval)
 | 
			
		||||
        return;
 | 
			
		||||
    if (it->size & BN_SENSITIVE)
 | 
			
		||||
        BN_clear_free((BIGNUM *)*pval);
 | 
			
		||||
    else
 | 
			
		||||
        BN_free((BIGNUM *)*pval);
 | 
			
		||||
    *pval = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it)
 | 
			
		||||
static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
 | 
			
		||||
                  const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        BIGNUM *bn;
 | 
			
		||||
        int pad;
 | 
			
		||||
        if(!*pval) return -1;
 | 
			
		||||
        bn = (BIGNUM *)*pval;
 | 
			
		||||
        /* If MSB set in an octet we need a padding byte */
 | 
			
		||||
        if(BN_num_bits(bn) & 0x7) pad = 0;
 | 
			
		||||
        else pad = 1;
 | 
			
		||||
        if(cont) {
 | 
			
		||||
                if(pad) *cont++ = 0;
 | 
			
		||||
                BN_bn2bin(bn, cont);
 | 
			
		||||
        }
 | 
			
		||||
        return pad + BN_num_bytes(bn);
 | 
			
		||||
    BIGNUM *bn;
 | 
			
		||||
    int pad;
 | 
			
		||||
    if (!*pval)
 | 
			
		||||
        return -1;
 | 
			
		||||
    bn = (BIGNUM *)*pval;
 | 
			
		||||
    /* If MSB set in an octet we need a padding byte */
 | 
			
		||||
    if (BN_num_bits(bn) & 0x7)
 | 
			
		||||
        pad = 0;
 | 
			
		||||
    else
 | 
			
		||||
        pad = 1;
 | 
			
		||||
    if (cont) {
 | 
			
		||||
        if (pad)
 | 
			
		||||
            *cont++ = 0;
 | 
			
		||||
        BN_bn2bin(bn, cont);
 | 
			
		||||
    }
 | 
			
		||||
    return pad + BN_num_bytes(bn);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
 | 
			
		||||
                  int utype, char *free_cont, const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        BIGNUM *bn;
 | 
			
		||||
        if(!*pval) bn_new(pval, it);
 | 
			
		||||
        bn  = (BIGNUM *)*pval;
 | 
			
		||||
        if(!BN_bin2bn(cont, len, bn)) {
 | 
			
		||||
                bn_free(pval, it);
 | 
			
		||||
                return 0;
 | 
			
		||||
        }
 | 
			
		||||
        return 1;
 | 
			
		||||
    BIGNUM *bn;
 | 
			
		||||
    if (!*pval)
 | 
			
		||||
        bn_new(pval, it);
 | 
			
		||||
    bn = (BIGNUM *)*pval;
 | 
			
		||||
    if (!BN_bin2bn(cont, len, bn)) {
 | 
			
		||||
        bn_free(pval, it);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -97,87 +97,100 @@ ASN1_ITEM_end(ZLONG)
 | 
			
		||||
 | 
			
		||||
static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        *(long *)pval = it->size;
 | 
			
		||||
        return 1;
 | 
			
		||||
    *(long *)pval = it->size;
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        *(long *)pval = it->size;
 | 
			
		||||
    *(long *)pval = it->size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it)
 | 
			
		||||
static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
 | 
			
		||||
                    const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        long ltmp;
 | 
			
		||||
        unsigned long utmp;
 | 
			
		||||
        int clen, pad, i;
 | 
			
		||||
        /* this exists to bypass broken gcc optimization */
 | 
			
		||||
        char *cp = (char *)pval;
 | 
			
		||||
    long ltmp;
 | 
			
		||||
    unsigned long utmp;
 | 
			
		||||
    int clen, pad, i;
 | 
			
		||||
    /* this exists to bypass broken gcc optimization */
 | 
			
		||||
    char *cp = (char *)pval;
 | 
			
		||||
 | 
			
		||||
        /* use memcpy, because we may not be long aligned */
 | 
			
		||||
        memcpy(<mp, cp, sizeof(long));
 | 
			
		||||
    /* use memcpy, because we may not be long aligned */
 | 
			
		||||
    memcpy(<mp, cp, sizeof(long));
 | 
			
		||||
 | 
			
		||||
        if(ltmp == it->size) return -1;
 | 
			
		||||
        /* Convert the long to positive: we subtract one if negative so
 | 
			
		||||
         * we can cleanly handle the padding if only the MSB of the leading
 | 
			
		||||
         * octet is set.
 | 
			
		||||
         */
 | 
			
		||||
        if(ltmp < 0) utmp = -ltmp - 1;
 | 
			
		||||
        else utmp = ltmp;
 | 
			
		||||
        clen = BN_num_bits_word(utmp);
 | 
			
		||||
        /* If MSB of leading octet set we need to pad */
 | 
			
		||||
        if(!(clen & 0x7)) pad = 1;
 | 
			
		||||
        else pad = 0;
 | 
			
		||||
    if (ltmp == it->size)
 | 
			
		||||
        return -1;
 | 
			
		||||
    /*
 | 
			
		||||
     * Convert the long to positive: we subtract one if negative so we can
 | 
			
		||||
     * cleanly handle the padding if only the MSB of the leading octet is
 | 
			
		||||
     * set.
 | 
			
		||||
     */
 | 
			
		||||
    if (ltmp < 0)
 | 
			
		||||
        utmp = -ltmp - 1;
 | 
			
		||||
    else
 | 
			
		||||
        utmp = ltmp;
 | 
			
		||||
    clen = BN_num_bits_word(utmp);
 | 
			
		||||
    /* If MSB of leading octet set we need to pad */
 | 
			
		||||
    if (!(clen & 0x7))
 | 
			
		||||
        pad = 1;
 | 
			
		||||
    else
 | 
			
		||||
        pad = 0;
 | 
			
		||||
 | 
			
		||||
        /* Convert number of bits to number of octets */
 | 
			
		||||
        clen = (clen + 7) >> 3;
 | 
			
		||||
    /* Convert number of bits to number of octets */
 | 
			
		||||
    clen = (clen + 7) >> 3;
 | 
			
		||||
 | 
			
		||||
        if(cont) {
 | 
			
		||||
                if(pad) *cont++ = (ltmp < 0) ? 0xff : 0;
 | 
			
		||||
                for(i = clen - 1; i >= 0; i--) {
 | 
			
		||||
                        cont[i] = (unsigned char)(utmp & 0xff);
 | 
			
		||||
                        if(ltmp < 0) cont[i] ^= 0xff;
 | 
			
		||||
                        utmp >>= 8;
 | 
			
		||||
                }
 | 
			
		||||
    if (cont) {
 | 
			
		||||
        if (pad)
 | 
			
		||||
            *cont++ = (ltmp < 0) ? 0xff : 0;
 | 
			
		||||
        for (i = clen - 1; i >= 0; i--) {
 | 
			
		||||
            cont[i] = (unsigned char)(utmp & 0xff);
 | 
			
		||||
            if (ltmp < 0)
 | 
			
		||||
                cont[i] ^= 0xff;
 | 
			
		||||
            utmp >>= 8;
 | 
			
		||||
        }
 | 
			
		||||
        return clen + pad;
 | 
			
		||||
    }
 | 
			
		||||
    return clen + pad;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
 | 
			
		||||
                    int utype, char *free_cont, const ASN1_ITEM *it)
 | 
			
		||||
{
 | 
			
		||||
        int neg, i;
 | 
			
		||||
        long ltmp;
 | 
			
		||||
        unsigned long utmp = 0;
 | 
			
		||||
        char *cp = (char *)pval;
 | 
			
		||||
        if(len > (int)sizeof(long)) {
 | 
			
		||||
                ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
 | 
			
		||||
                return 0;
 | 
			
		||||
        }
 | 
			
		||||
        /* Is it negative? */
 | 
			
		||||
        if(len && (cont[0] & 0x80)) neg = 1;
 | 
			
		||||
        else neg = 0;
 | 
			
		||||
        utmp = 0;
 | 
			
		||||
        for(i = 0; i < len; i++) {
 | 
			
		||||
                utmp <<= 8;
 | 
			
		||||
                if(neg) utmp |= cont[i] ^ 0xff;
 | 
			
		||||
                else utmp |= cont[i];
 | 
			
		||||
        }
 | 
			
		||||
        ltmp = (long)utmp;
 | 
			
		||||
        if(neg) {
 | 
			
		||||
                ltmp++;
 | 
			
		||||
                ltmp = -ltmp;
 | 
			
		||||
        }
 | 
			
		||||
        if(ltmp == it->size) {
 | 
			
		||||
                ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
 | 
			
		||||
                return 0;
 | 
			
		||||
        }
 | 
			
		||||
        memcpy(cp, <mp, sizeof(long));
 | 
			
		||||
        return 1;
 | 
			
		||||
    int neg, i;
 | 
			
		||||
    long ltmp;
 | 
			
		||||
    unsigned long utmp = 0;
 | 
			
		||||
    char *cp = (char *)pval;
 | 
			
		||||
    if (len > (int)sizeof(long)) {
 | 
			
		||||
        ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
    /* Is it negative? */
 | 
			
		||||
    if (len && (cont[0] & 0x80))
 | 
			
		||||
        neg = 1;
 | 
			
		||||
    else
 | 
			
		||||
        neg = 0;
 | 
			
		||||
    utmp = 0;
 | 
			
		||||
    for (i = 0; i < len; i++) {
 | 
			
		||||
        utmp <<= 8;
 | 
			
		||||
        if (neg)
 | 
			
		||||
            utmp |= cont[i] ^ 0xff;
 | 
			
		||||
        else
 | 
			
		||||
            utmp |= cont[i];
 | 
			
		||||
    }
 | 
			
		||||
    ltmp = (long)utmp;
 | 
			
		||||
    if (neg) {
 | 
			
		||||
        ltmp++;
 | 
			
		||||
        ltmp = -ltmp;
 | 
			
		||||
    }
 | 
			
		||||
    if (ltmp == it->size) {
 | 
			
		||||
        ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
    memcpy(cp, <mp, sizeof(long));
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it,
 | 
			
		||||
                        int indent, const ASN1_PCTX *pctx)
 | 
			
		||||
        {
 | 
			
		||||
        return BIO_printf(out, "%ld\n", *(long *)pval);
 | 
			
		||||
        }
 | 
			
		||||
                      int indent, const ASN1_PCTX *pctx)
 | 
			
		||||
{
 | 
			
		||||
    return BIO_printf(out, "%ld\n", *(long *)pval);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -172,8 +172,14 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
 | 
			
		||||
{
 | 
			
		||||
    const unsigned char *q;
 | 
			
		||||
    X509 *ret;
 | 
			
		||||
    int freeret = 0;
 | 
			
		||||
 | 
			
		||||
    /* Save start position */
 | 
			
		||||
    q = *pp;
 | 
			
		||||
 | 
			
		||||
    if (!a || *a == NULL) {
 | 
			
		||||
        freeret = 1;
 | 
			
		||||
    }
 | 
			
		||||
    ret = d2i_X509(a, pp, length);
 | 
			
		||||
    /* If certificate unreadable then forget it */
 | 
			
		||||
    if (!ret)
 | 
			
		||||
@@ -186,7 +192,11 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
 | 
			
		||||
        goto err;
 | 
			
		||||
    return ret;
 | 
			
		||||
 err:
 | 
			
		||||
    X509_free(ret);
 | 
			
		||||
    if (freeret) {
 | 
			
		||||
        X509_free(ret);
 | 
			
		||||
        if (a)
 | 
			
		||||
            *a = NULL;
 | 
			
		||||
    }
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -72,6 +72,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -73,6 +73,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -592,7 +592,6 @@ fmtfp(char **sbuffer,
 | 
			
		||||
    int fplace = 0;
 | 
			
		||||
    int padlen = 0;
 | 
			
		||||
    int zpadlen = 0;
 | 
			
		||||
    int caps = 0;
 | 
			
		||||
    long intpart;
 | 
			
		||||
    long fracpart;
 | 
			
		||||
    long max10;
 | 
			
		||||
@@ -630,8 +629,7 @@ fmtfp(char **sbuffer,
 | 
			
		||||
 | 
			
		||||
    /* convert integer part */
 | 
			
		||||
    do {
 | 
			
		||||
        iconvert[iplace++] =
 | 
			
		||||
            (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10];
 | 
			
		||||
        iconvert[iplace++] = "0123456789"[intpart % 10];
 | 
			
		||||
        intpart = (intpart / 10);
 | 
			
		||||
    } while (intpart && (iplace < (int)sizeof(iconvert)));
 | 
			
		||||
    if (iplace == sizeof iconvert)
 | 
			
		||||
@@ -640,8 +638,7 @@ fmtfp(char **sbuffer,
 | 
			
		||||
 | 
			
		||||
    /* convert fractional part */
 | 
			
		||||
    do {
 | 
			
		||||
        fconvert[fplace++] =
 | 
			
		||||
            (caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10];
 | 
			
		||||
        fconvert[fplace++] = "0123456789"[fracpart % 10];
 | 
			
		||||
        fracpart = (fracpart / 10);
 | 
			
		||||
    } while (fplace < max);
 | 
			
		||||
    if (fplace == sizeof fconvert)
 | 
			
		||||
@@ -707,24 +704,29 @@ doapr_outch(char **sbuffer,
 | 
			
		||||
    /* If we haven't at least one buffer, someone has doe a big booboo */
 | 
			
		||||
    assert(*sbuffer != NULL || buffer != NULL);
 | 
			
		||||
 | 
			
		||||
    if (buffer) {
 | 
			
		||||
        while (*currlen >= *maxlen) {
 | 
			
		||||
            if (*buffer == NULL) {
 | 
			
		||||
                if (*maxlen == 0)
 | 
			
		||||
                    *maxlen = 1024;
 | 
			
		||||
                *buffer = OPENSSL_malloc(*maxlen);
 | 
			
		||||
                if (*currlen > 0) {
 | 
			
		||||
                    assert(*sbuffer != NULL);
 | 
			
		||||
                    memcpy(*buffer, *sbuffer, *currlen);
 | 
			
		||||
                }
 | 
			
		||||
                *sbuffer = NULL;
 | 
			
		||||
            } else {
 | 
			
		||||
                *maxlen += 1024;
 | 
			
		||||
                *buffer = OPENSSL_realloc(*buffer, *maxlen);
 | 
			
		||||
    /* |currlen| must always be <= |*maxlen| */
 | 
			
		||||
    assert(*currlen <= *maxlen);
 | 
			
		||||
 | 
			
		||||
    if (buffer && *currlen == *maxlen) {
 | 
			
		||||
        *maxlen += 1024;
 | 
			
		||||
        if (*buffer == NULL) {
 | 
			
		||||
            *buffer = OPENSSL_malloc(*maxlen);
 | 
			
		||||
            if (!*buffer) {
 | 
			
		||||
                /* Panic! Can't really do anything sensible. Just return */
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            if (*currlen > 0) {
 | 
			
		||||
                assert(*sbuffer != NULL);
 | 
			
		||||
                memcpy(*buffer, *sbuffer, *currlen);
 | 
			
		||||
            }
 | 
			
		||||
            *sbuffer = NULL;
 | 
			
		||||
        } else {
 | 
			
		||||
            *buffer = OPENSSL_realloc(*buffer, *maxlen);
 | 
			
		||||
            if (!*buffer) {
 | 
			
		||||
                /* Panic! Can't really do anything sensible. Just return */
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        /* What to do if *buffer is NULL? */
 | 
			
		||||
        assert(*sbuffer != NULL || *buffer != NULL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (*currlen < *maxlen) {
 | 
			
		||||
 
 | 
			
		||||
@@ -530,13 +530,13 @@ int BIO_socket_ioctl(int fd, long type, void *arg)
 | 
			
		||||
    i = ioctlsocket(fd, type, (char *)arg);
 | 
			
		||||
#  else
 | 
			
		||||
#   if defined(OPENSSL_SYS_VMS)
 | 
			
		||||
        /*-
 | 
			
		||||
         * 2011-02-18 SMS.
 | 
			
		||||
         * VMS ioctl() can't tolerate a 64-bit "void *arg", but we
 | 
			
		||||
         * observe that all the consumers pass in an "unsigned long *",
 | 
			
		||||
         * so we arrange a local copy with a short pointer, and use
 | 
			
		||||
         * that, instead.
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * 2011-02-18 SMS.
 | 
			
		||||
     * VMS ioctl() can't tolerate a 64-bit "void *arg", but we
 | 
			
		||||
     * observe that all the consumers pass in an "unsigned long *",
 | 
			
		||||
     * so we arrange a local copy with a short pointer, and use
 | 
			
		||||
     * that, instead.
 | 
			
		||||
     */
 | 
			
		||||
#    if __INITIAL_POINTER_SIZE == 64
 | 
			
		||||
#     define ARG arg_32p
 | 
			
		||||
#     pragma pointer_size save
 | 
			
		||||
 
 | 
			
		||||
@@ -139,7 +139,8 @@ static int nbiof_read(BIO *b, char *out, int outl)
 | 
			
		||||
 | 
			
		||||
    BIO_clear_retry_flags(b);
 | 
			
		||||
#if 1
 | 
			
		||||
    RAND_pseudo_bytes(&n, 1);
 | 
			
		||||
    if (RAND_pseudo_bytes(&n, 1) < 0)
 | 
			
		||||
        return -1;
 | 
			
		||||
    num = (n & 0x07);
 | 
			
		||||
 | 
			
		||||
    if (outl > num)
 | 
			
		||||
@@ -178,7 +179,8 @@ static int nbiof_write(BIO *b, const char *in, int inl)
 | 
			
		||||
        num = nt->lwn;
 | 
			
		||||
        nt->lwn = 0;
 | 
			
		||||
    } else {
 | 
			
		||||
        RAND_pseudo_bytes(&n, 1);
 | 
			
		||||
        if (RAND_pseudo_bytes(&n, 1) < 0)
 | 
			
		||||
            return -1;
 | 
			
		||||
        num = (n & 7);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -103,11 +103,11 @@ static int nullf_free(BIO *a)
 | 
			
		||||
{
 | 
			
		||||
    if (a == NULL)
 | 
			
		||||
        return (0);
 | 
			
		||||
        /*-
 | 
			
		||||
        a->ptr=NULL;
 | 
			
		||||
        a->init=0;
 | 
			
		||||
        a->flags=0;
 | 
			
		||||
        */
 | 
			
		||||
    /*-
 | 
			
		||||
    a->ptr=NULL;
 | 
			
		||||
    a->init=0;
 | 
			
		||||
    a->flags=0;
 | 
			
		||||
    */
 | 
			
		||||
    return (1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -343,15 +343,15 @@ struct bio_st {
 | 
			
		||||
DECLARE_STACK_OF(BIO)
 | 
			
		||||
 | 
			
		||||
typedef struct bio_f_buffer_ctx_struct {
 | 
			
		||||
        /*-
 | 
			
		||||
         * Buffers are setup like this:
 | 
			
		||||
         *
 | 
			
		||||
         * <---------------------- size ----------------------->
 | 
			
		||||
         * +---------------------------------------------------+
 | 
			
		||||
         * | consumed | remaining          | free space        |
 | 
			
		||||
         * +---------------------------------------------------+
 | 
			
		||||
         * <-- off --><------- len ------->
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * Buffers are setup like this:
 | 
			
		||||
     *
 | 
			
		||||
     * <---------------------- size ----------------------->
 | 
			
		||||
     * +---------------------------------------------------+
 | 
			
		||||
     * | consumed | remaining          | free space        |
 | 
			
		||||
     * +---------------------------------------------------+
 | 
			
		||||
     * <-- off --><------- len ------->
 | 
			
		||||
     */
 | 
			
		||||
    /*- BIO *bio; *//*
 | 
			
		||||
     * this is now in the BIO struct
 | 
			
		||||
     */
 | 
			
		||||
@@ -829,6 +829,7 @@ void ERR_load_BIO_strings(void);
 | 
			
		||||
# define BIO_F_CONN_CTRL                                  127
 | 
			
		||||
# define BIO_F_CONN_STATE                                 115
 | 
			
		||||
# define BIO_F_DGRAM_SCTP_READ                            132
 | 
			
		||||
# define BIO_F_DGRAM_SCTP_WRITE                           133
 | 
			
		||||
# define BIO_F_FILE_CTRL                                  116
 | 
			
		||||
# define BIO_F_FILE_READ                                  130
 | 
			
		||||
# define BIO_F_LINEBUFFER_CTRL                            129
 | 
			
		||||
 
 | 
			
		||||
@@ -70,14 +70,17 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp,
 | 
			
		||||
    MS_STATIC char buf[256];
 | 
			
		||||
    char *p;
 | 
			
		||||
    long r = 1;
 | 
			
		||||
    int len;
 | 
			
		||||
    size_t p_maxlen;
 | 
			
		||||
 | 
			
		||||
    if (BIO_CB_RETURN & cmd)
 | 
			
		||||
        r = ret;
 | 
			
		||||
 | 
			
		||||
    BIO_snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
 | 
			
		||||
    p = &(buf[14]);
 | 
			
		||||
    p_maxlen = sizeof buf - 14;
 | 
			
		||||
    len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
 | 
			
		||||
 | 
			
		||||
    p = buf + len;
 | 
			
		||||
    p_maxlen = sizeof(buf) - len;
 | 
			
		||||
 | 
			
		||||
    switch (cmd) {
 | 
			
		||||
    case BIO_CB_FREE:
 | 
			
		||||
        BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
 | 
			
		||||
 
 | 
			
		||||
@@ -96,6 +96,7 @@ static ERR_STRING_DATA BIO_str_functs[] = {
 | 
			
		||||
    {ERR_FUNC(BIO_F_CONN_CTRL), "CONN_CTRL"},
 | 
			
		||||
    {ERR_FUNC(BIO_F_CONN_STATE), "CONN_STATE"},
 | 
			
		||||
    {ERR_FUNC(BIO_F_DGRAM_SCTP_READ), "DGRAM_SCTP_READ"},
 | 
			
		||||
    {ERR_FUNC(BIO_F_DGRAM_SCTP_WRITE), "DGRAM_SCTP_WRITE"},
 | 
			
		||||
    {ERR_FUNC(BIO_F_FILE_CTRL), "FILE_CTRL"},
 | 
			
		||||
    {ERR_FUNC(BIO_F_FILE_READ), "FILE_READ"},
 | 
			
		||||
    {ERR_FUNC(BIO_F_LINEBUFFER_CTRL), "LINEBUFFER_CTRL"},
 | 
			
		||||
 
 | 
			
		||||
@@ -536,8 +536,10 @@ BIO *BIO_dup_chain(BIO *in)
 | 
			
		||||
 | 
			
		||||
        /* copy app data */
 | 
			
		||||
        if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new_bio->ex_data,
 | 
			
		||||
                                &bio->ex_data))
 | 
			
		||||
                                &bio->ex_data)) {
 | 
			
		||||
            BIO_free(new_bio);
 | 
			
		||||
            goto err;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (ret == NULL) {
 | 
			
		||||
            eoc = new_bio;
 | 
			
		||||
@@ -549,8 +551,8 @@ BIO *BIO_dup_chain(BIO *in)
 | 
			
		||||
    }
 | 
			
		||||
    return (ret);
 | 
			
		||||
 err:
 | 
			
		||||
    if (ret != NULL)
 | 
			
		||||
        BIO_free(ret);
 | 
			
		||||
    BIO_free_all(ret);
 | 
			
		||||
 | 
			
		||||
    return (NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -421,12 +421,12 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
        ret = (long)data->bind_mode;
 | 
			
		||||
        break;
 | 
			
		||||
    case BIO_CTRL_DUP:
 | 
			
		||||
/*-             dbio=(BIO *)ptr;
 | 
			
		||||
                if (data->param_port) EAY EAY
 | 
			
		||||
                        BIO_set_port(dbio,data->param_port);
 | 
			
		||||
                if (data->param_hostname)
 | 
			
		||||
                        BIO_set_hostname(dbio,data->param_hostname);
 | 
			
		||||
                BIO_set_nbio(dbio,data->nbio); */
 | 
			
		||||
/*-     dbio=(BIO *)ptr;
 | 
			
		||||
        if (data->param_port) EAY EAY
 | 
			
		||||
                BIO_set_port(dbio,data->param_port);
 | 
			
		||||
        if (data->param_hostname)
 | 
			
		||||
                BIO_set_hostname(dbio,data->param_hostname);
 | 
			
		||||
        BIO_set_nbio(dbio,data->nbio); */
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
    default:
 | 
			
		||||
 
 | 
			
		||||
@@ -299,16 +299,17 @@ static void dgram_adjust_rcv_timeout(BIO *b)
 | 
			
		||||
 | 
			
		||||
        /* Calculate time left until timer expires */
 | 
			
		||||
        memcpy(&timeleft, &(data->next_timeout), sizeof(struct timeval));
 | 
			
		||||
        timeleft.tv_sec -= timenow.tv_sec;
 | 
			
		||||
        timeleft.tv_usec -= timenow.tv_usec;
 | 
			
		||||
        if (timeleft.tv_usec < 0) {
 | 
			
		||||
        if (timeleft.tv_usec < timenow.tv_usec) {
 | 
			
		||||
            timeleft.tv_usec = 1000000 - timenow.tv_usec + timeleft.tv_usec;
 | 
			
		||||
            timeleft.tv_sec--;
 | 
			
		||||
            timeleft.tv_usec += 1000000;
 | 
			
		||||
        } else {
 | 
			
		||||
            timeleft.tv_usec -= timenow.tv_usec;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (timeleft.tv_sec < 0) {
 | 
			
		||||
        if (timeleft.tv_sec < timenow.tv_sec) {
 | 
			
		||||
            timeleft.tv_sec = 0;
 | 
			
		||||
            timeleft.tv_usec = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            timeleft.tv_sec -= timenow.tv_sec;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /*
 | 
			
		||||
@@ -953,6 +954,10 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag)
 | 
			
		||||
     */
 | 
			
		||||
    sockopt_len = (socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
 | 
			
		||||
    authchunks = OPENSSL_malloc(sockopt_len);
 | 
			
		||||
    if (!authchunks) {
 | 
			
		||||
        BIO_vfree(bio);
 | 
			
		||||
        return (NULL);
 | 
			
		||||
    }
 | 
			
		||||
    memset(authchunks, 0, sizeof(sockopt_len));
 | 
			
		||||
    ret =
 | 
			
		||||
        getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks,
 | 
			
		||||
@@ -1288,6 +1293,10 @@ static int dgram_sctp_read(BIO *b, char *out, int outl)
 | 
			
		||||
            optlen =
 | 
			
		||||
                (socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
 | 
			
		||||
            authchunks = OPENSSL_malloc(optlen);
 | 
			
		||||
            if (!authchunks) {
 | 
			
		||||
                BIOerr(BIO_F_DGRAM_SCTP_READ, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
                return -1;
 | 
			
		||||
            }
 | 
			
		||||
            memset(authchunks, 0, sizeof(optlen));
 | 
			
		||||
            ii = getsockopt(b->num, IPPROTO_SCTP, SCTP_PEER_AUTH_CHUNKS,
 | 
			
		||||
                            authchunks, &optlen);
 | 
			
		||||
@@ -1354,10 +1363,15 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl)
 | 
			
		||||
     * yet, we have to save it and send it as soon as the socket gets dry.
 | 
			
		||||
     */
 | 
			
		||||
    if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) {
 | 
			
		||||
        char *tmp;
 | 
			
		||||
        data->saved_message.bio = b;
 | 
			
		||||
        if (!(tmp = OPENSSL_malloc(inl))) {
 | 
			
		||||
            BIOerr(BIO_F_DGRAM_SCTP_WRITE, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
            return -1;
 | 
			
		||||
        }
 | 
			
		||||
        if (data->saved_message.data)
 | 
			
		||||
            OPENSSL_free(data->saved_message.data);
 | 
			
		||||
        data->saved_message.data = OPENSSL_malloc(inl);
 | 
			
		||||
        data->saved_message.data = tmp;
 | 
			
		||||
        memcpy(data->saved_message.data, in, inl);
 | 
			
		||||
        data->saved_message.length = inl;
 | 
			
		||||
        return inl;
 | 
			
		||||
 
 | 
			
		||||
@@ -167,6 +167,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: bn_prime.h depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -797,6 +797,7 @@ int RAND_pseudo_bytes(unsigned char *buf, int num);
 | 
			
		||||
                         * wouldn't be constructed with top!=dmax. */ \
 | 
			
		||||
                        BN_ULONG *_not_const; \
 | 
			
		||||
                        memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
 | 
			
		||||
                        /* Debug only - safe to ignore error return */ \
 | 
			
		||||
                        RAND_pseudo_bytes(&_tmp_char, 1); \
 | 
			
		||||
                        memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
 | 
			
		||||
                                (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
 | 
			
		||||
@@ -910,6 +911,7 @@ void ERR_load_BN_strings(void);
 | 
			
		||||
# 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_LSHIFT                                   145
 | 
			
		||||
# 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
 | 
			
		||||
@@ -925,12 +927,14 @@ void ERR_load_BN_strings(void);
 | 
			
		||||
# define BN_F_BN_NEW                                      113
 | 
			
		||||
# define BN_F_BN_RAND                                     114
 | 
			
		||||
# define BN_F_BN_RAND_RANGE                               122
 | 
			
		||||
# define BN_F_BN_RSHIFT                                   146
 | 
			
		||||
# define BN_F_BN_USUB                                     115
 | 
			
		||||
 | 
			
		||||
/* Reason codes. */
 | 
			
		||||
# define BN_R_ARG2_LT_ARG3                                100
 | 
			
		||||
# define BN_R_BAD_RECIPROCAL                              101
 | 
			
		||||
# define BN_R_BIGNUM_TOO_LONG                             114
 | 
			
		||||
# define BN_R_BITS_TOO_SMALL                              118
 | 
			
		||||
# define BN_R_CALLED_WITH_EVEN_MODULUS                    102
 | 
			
		||||
# define BN_R_DIV_BY_ZERO                                 103
 | 
			
		||||
# define BN_R_ENCODING_ERROR                              104
 | 
			
		||||
@@ -938,6 +942,7 @@ void ERR_load_BN_strings(void);
 | 
			
		||||
# define BN_R_INPUT_NOT_REDUCED                           110
 | 
			
		||||
# define BN_R_INVALID_LENGTH                              106
 | 
			
		||||
# define BN_R_INVALID_RANGE                               115
 | 
			
		||||
# define BN_R_INVALID_SHIFT                               119
 | 
			
		||||
# define BN_R_NOT_A_SQUARE                                111
 | 
			
		||||
# define BN_R_NOT_INITIALIZED                             107
 | 
			
		||||
# define BN_R_NO_INVERSE                                  108
 | 
			
		||||
 
 | 
			
		||||
@@ -69,12 +69,12 @@ int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 | 
			
		||||
    bn_check_top(a);
 | 
			
		||||
    bn_check_top(b);
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         *  a +  b      a+b
 | 
			
		||||
         *  a + -b      a-b
 | 
			
		||||
         * -a +  b      b-a
 | 
			
		||||
         * -a + -b      -(a+b)
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     *  a +  b      a+b
 | 
			
		||||
     *  a + -b      a-b
 | 
			
		||||
     * -a +  b      b-a
 | 
			
		||||
     * -a + -b      -(a+b)
 | 
			
		||||
     */
 | 
			
		||||
    if (a_neg ^ b->neg) {
 | 
			
		||||
        /* only one is negative */
 | 
			
		||||
        if (a_neg) {
 | 
			
		||||
@@ -265,12 +265,12 @@ int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 | 
			
		||||
    bn_check_top(a);
 | 
			
		||||
    bn_check_top(b);
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         *  a -  b      a-b
 | 
			
		||||
         *  a - -b      a+b
 | 
			
		||||
         * -a -  b      -(a+b)
 | 
			
		||||
         * -a - -b      b-a
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     *  a -  b      a-b
 | 
			
		||||
     *  a - -b      a+b
 | 
			
		||||
     * -a -  b      -(a+b)
 | 
			
		||||
     * -a - -b      b-a
 | 
			
		||||
     */
 | 
			
		||||
    if (a->neg) {
 | 
			
		||||
        if (b->neg) {
 | 
			
		||||
            tmp = a;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/* crypto/bn/bn_err.c */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1999-2015 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
 | 
			
		||||
@@ -94,6 +94,7 @@ static ERR_STRING_DATA BN_str_functs[] = {
 | 
			
		||||
    {ERR_FUNC(BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR), "BN_GF2m_mod_solve_quad_arr"},
 | 
			
		||||
    {ERR_FUNC(BN_F_BN_GF2M_MOD_SQR), "BN_GF2m_mod_sqr"},
 | 
			
		||||
    {ERR_FUNC(BN_F_BN_GF2M_MOD_SQRT), "BN_GF2m_mod_sqrt"},
 | 
			
		||||
    {ERR_FUNC(BN_F_BN_LSHIFT), "BN_lshift"},
 | 
			
		||||
    {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"},
 | 
			
		||||
@@ -109,6 +110,7 @@ static ERR_STRING_DATA BN_str_functs[] = {
 | 
			
		||||
    {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_RSHIFT), "BN_rshift"},
 | 
			
		||||
    {ERR_FUNC(BN_F_BN_USUB), "BN_usub"},
 | 
			
		||||
    {0, NULL}
 | 
			
		||||
};
 | 
			
		||||
@@ -117,6 +119,7 @@ static ERR_STRING_DATA BN_str_reasons[] = {
 | 
			
		||||
    {ERR_REASON(BN_R_ARG2_LT_ARG3), "arg2 lt arg3"},
 | 
			
		||||
    {ERR_REASON(BN_R_BAD_RECIPROCAL), "bad reciprocal"},
 | 
			
		||||
    {ERR_REASON(BN_R_BIGNUM_TOO_LONG), "bignum too long"},
 | 
			
		||||
    {ERR_REASON(BN_R_BITS_TOO_SMALL), "bits too small"},
 | 
			
		||||
    {ERR_REASON(BN_R_CALLED_WITH_EVEN_MODULUS), "called with even modulus"},
 | 
			
		||||
    {ERR_REASON(BN_R_DIV_BY_ZERO), "div by zero"},
 | 
			
		||||
    {ERR_REASON(BN_R_ENCODING_ERROR), "encoding error"},
 | 
			
		||||
@@ -125,6 +128,7 @@ static ERR_STRING_DATA BN_str_reasons[] = {
 | 
			
		||||
    {ERR_REASON(BN_R_INPUT_NOT_REDUCED), "input not reduced"},
 | 
			
		||||
    {ERR_REASON(BN_R_INVALID_LENGTH), "invalid length"},
 | 
			
		||||
    {ERR_REASON(BN_R_INVALID_RANGE), "invalid range"},
 | 
			
		||||
    {ERR_REASON(BN_R_INVALID_SHIFT), "invalid shift"},
 | 
			
		||||
    {ERR_REASON(BN_R_NOT_A_SQUARE), "not a square"},
 | 
			
		||||
    {ERR_REASON(BN_R_NOT_INITIALIZED), "not initialized"},
 | 
			
		||||
    {ERR_REASON(BN_R_NO_INVERSE), "no inverse"},
 | 
			
		||||
 
 | 
			
		||||
@@ -168,10 +168,10 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
                goto err;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    ret = 1;
 | 
			
		||||
 err:
 | 
			
		||||
    if (r != rr)
 | 
			
		||||
        BN_copy(r, rr);
 | 
			
		||||
    ret = 1;
 | 
			
		||||
 err:
 | 
			
		||||
    BN_CTX_end(ctx);
 | 
			
		||||
    bn_check_top(r);
 | 
			
		||||
    return (ret);
 | 
			
		||||
@@ -186,36 +186,36 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
 | 
			
		||||
    bn_check_top(p);
 | 
			
		||||
    bn_check_top(m);
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * For even modulus  m = 2^k*m_odd,  it might make sense to compute
 | 
			
		||||
         * a^p mod m_odd  and  a^p mod 2^k  separately (with Montgomery
 | 
			
		||||
         * exponentiation for the odd part), using appropriate exponent
 | 
			
		||||
         * reductions, and combine the results using the CRT.
 | 
			
		||||
         *
 | 
			
		||||
         * For now, we use Montgomery only if the modulus is odd; otherwise,
 | 
			
		||||
         * exponentiation using the reciprocal-based quick remaindering
 | 
			
		||||
         * algorithm is used.
 | 
			
		||||
         *
 | 
			
		||||
         * (Timing obtained with expspeed.c [computations  a^p mod m
 | 
			
		||||
         * where  a, p, m  are of the same length: 256, 512, 1024, 2048,
 | 
			
		||||
         * 4096, 8192 bits], compared to the running time of the
 | 
			
		||||
         * standard algorithm:
 | 
			
		||||
         *
 | 
			
		||||
         *   BN_mod_exp_mont   33 .. 40 %  [AMD K6-2, Linux, debug configuration]
 | 
			
		||||
         *                     55 .. 77 %  [UltraSparc processor, but
 | 
			
		||||
         *                                  debug-solaris-sparcv8-gcc conf.]
 | 
			
		||||
         *
 | 
			
		||||
         *   BN_mod_exp_recp   50 .. 70 %  [AMD K6-2, Linux, debug configuration]
 | 
			
		||||
         *                     62 .. 118 % [UltraSparc, debug-solaris-sparcv8-gcc]
 | 
			
		||||
         *
 | 
			
		||||
         * On the Sparc, BN_mod_exp_recp was faster than BN_mod_exp_mont
 | 
			
		||||
         * at 2048 and more bits, but at 512 and 1024 bits, it was
 | 
			
		||||
         * slower even than the standard algorithm!
 | 
			
		||||
         *
 | 
			
		||||
         * "Real" timings [linux-elf, solaris-sparcv9-gcc configurations]
 | 
			
		||||
         * should be obtained when the new Montgomery reduction code
 | 
			
		||||
         * has been integrated into OpenSSL.)
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * For even modulus  m = 2^k*m_odd,  it might make sense to compute
 | 
			
		||||
     * a^p mod m_odd  and  a^p mod 2^k  separately (with Montgomery
 | 
			
		||||
     * exponentiation for the odd part), using appropriate exponent
 | 
			
		||||
     * reductions, and combine the results using the CRT.
 | 
			
		||||
     *
 | 
			
		||||
     * For now, we use Montgomery only if the modulus is odd; otherwise,
 | 
			
		||||
     * exponentiation using the reciprocal-based quick remaindering
 | 
			
		||||
     * algorithm is used.
 | 
			
		||||
     *
 | 
			
		||||
     * (Timing obtained with expspeed.c [computations  a^p mod m
 | 
			
		||||
     * where  a, p, m  are of the same length: 256, 512, 1024, 2048,
 | 
			
		||||
     * 4096, 8192 bits], compared to the running time of the
 | 
			
		||||
     * standard algorithm:
 | 
			
		||||
     *
 | 
			
		||||
     *   BN_mod_exp_mont   33 .. 40 %  [AMD K6-2, Linux, debug configuration]
 | 
			
		||||
     *                     55 .. 77 %  [UltraSparc processor, but
 | 
			
		||||
     *                                  debug-solaris-sparcv8-gcc conf.]
 | 
			
		||||
     *
 | 
			
		||||
     *   BN_mod_exp_recp   50 .. 70 %  [AMD K6-2, Linux, debug configuration]
 | 
			
		||||
     *                     62 .. 118 % [UltraSparc, debug-solaris-sparcv8-gcc]
 | 
			
		||||
     *
 | 
			
		||||
     * On the Sparc, BN_mod_exp_recp was faster than BN_mod_exp_mont
 | 
			
		||||
     * at 2048 and more bits, but at 512 and 1024 bits, it was
 | 
			
		||||
     * slower even than the standard algorithm!
 | 
			
		||||
     *
 | 
			
		||||
     * "Real" timings [linux-elf, solaris-sparcv9-gcc configurations]
 | 
			
		||||
     * should be obtained when the new Montgomery reduction code
 | 
			
		||||
     * has been integrated into OpenSSL.)
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
#define MONT_MUL_MOD
 | 
			
		||||
#define MONT_EXP_WORD
 | 
			
		||||
 
 | 
			
		||||
@@ -268,13 +268,13 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
            goto err;
 | 
			
		||||
    }
 | 
			
		||||
    sign = -1;
 | 
			
		||||
        /*-
 | 
			
		||||
         * From  B = a mod |n|,  A = |n|  it follows that
 | 
			
		||||
         *
 | 
			
		||||
         *      0 <= B < A,
 | 
			
		||||
         *     -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
         *      sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * From  B = a mod |n|,  A = |n|  it follows that
 | 
			
		||||
     *
 | 
			
		||||
     *      0 <= B < A,
 | 
			
		||||
     *     -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
     *      sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    if (BN_is_odd(n) && (BN_num_bits(n) <= (BN_BITS <= 32 ? 450 : 2048))) {
 | 
			
		||||
        /*
 | 
			
		||||
@@ -286,12 +286,12 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
        int shift;
 | 
			
		||||
 | 
			
		||||
        while (!BN_is_zero(B)) {
 | 
			
		||||
                        /*-
 | 
			
		||||
                         *      0 < B < |n|,
 | 
			
		||||
                         *      0 < A <= |n|,
 | 
			
		||||
                         * (1) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
                         * (2)  sign*Y*a  ==  A   (mod |n|)
 | 
			
		||||
                         */
 | 
			
		||||
            /*-
 | 
			
		||||
             *      0 < B < |n|,
 | 
			
		||||
             *      0 < A <= |n|,
 | 
			
		||||
             * (1) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
             * (2)  sign*Y*a  ==  A   (mod |n|)
 | 
			
		||||
             */
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * Now divide B by the maximum possible power of two in the
 | 
			
		||||
@@ -337,18 +337,18 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
                    goto err;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
                        /*-
 | 
			
		||||
                         * We still have (1) and (2).
 | 
			
		||||
                         * Both  A  and  B  are odd.
 | 
			
		||||
                         * The following computations ensure that
 | 
			
		||||
                         *
 | 
			
		||||
                         *     0 <= B < |n|,
 | 
			
		||||
                         *      0 < A < |n|,
 | 
			
		||||
                         * (1) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
                         * (2)  sign*Y*a  ==  A   (mod |n|),
 | 
			
		||||
                         *
 | 
			
		||||
                         * and that either  A  or  B  is even in the next iteration.
 | 
			
		||||
                         */
 | 
			
		||||
            /*-
 | 
			
		||||
             * We still have (1) and (2).
 | 
			
		||||
             * Both  A  and  B  are odd.
 | 
			
		||||
             * The following computations ensure that
 | 
			
		||||
             *
 | 
			
		||||
             *     0 <= B < |n|,
 | 
			
		||||
             *      0 < A < |n|,
 | 
			
		||||
             * (1) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
             * (2)  sign*Y*a  ==  A   (mod |n|),
 | 
			
		||||
             *
 | 
			
		||||
             * and that either  A  or  B  is even in the next iteration.
 | 
			
		||||
             */
 | 
			
		||||
            if (BN_ucmp(B, A) >= 0) {
 | 
			
		||||
                /* -sign*(X + Y)*a == B - A  (mod |n|) */
 | 
			
		||||
                if (!BN_uadd(X, X, Y))
 | 
			
		||||
@@ -377,11 +377,11 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
        while (!BN_is_zero(B)) {
 | 
			
		||||
            BIGNUM *tmp;
 | 
			
		||||
 | 
			
		||||
                        /*-
 | 
			
		||||
                         *      0 < B < A,
 | 
			
		||||
                         * (*) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
                         *      sign*Y*a  ==  A   (mod |n|)
 | 
			
		||||
                         */
 | 
			
		||||
            /*-
 | 
			
		||||
             *      0 < B < A,
 | 
			
		||||
             * (*) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
             *      sign*Y*a  ==  A   (mod |n|)
 | 
			
		||||
             */
 | 
			
		||||
 | 
			
		||||
            /* (D, M) := (A/B, A%B) ... */
 | 
			
		||||
            if (BN_num_bits(A) == BN_num_bits(B)) {
 | 
			
		||||
@@ -428,12 +428,12 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
                    goto err;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
                        /*-
 | 
			
		||||
                         * Now
 | 
			
		||||
                         *      A = D*B + M;
 | 
			
		||||
                         * thus we have
 | 
			
		||||
                         * (**)  sign*Y*a  ==  D*B + M   (mod |n|).
 | 
			
		||||
                         */
 | 
			
		||||
            /*-
 | 
			
		||||
             * Now
 | 
			
		||||
             *      A = D*B + M;
 | 
			
		||||
             * thus we have
 | 
			
		||||
             * (**)  sign*Y*a  ==  D*B + M   (mod |n|).
 | 
			
		||||
             */
 | 
			
		||||
 | 
			
		||||
            tmp = A;            /* keep the BIGNUM object, the value does not
 | 
			
		||||
                                 * matter */
 | 
			
		||||
@@ -443,25 +443,25 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
            B = M;
 | 
			
		||||
            /* ... so we have  0 <= B < A  again */
 | 
			
		||||
 | 
			
		||||
                        /*-
 | 
			
		||||
                         * Since the former  M  is now  B  and the former  B  is now  A,
 | 
			
		||||
                         * (**) translates into
 | 
			
		||||
                         *       sign*Y*a  ==  D*A + B    (mod |n|),
 | 
			
		||||
                         * i.e.
 | 
			
		||||
                         *       sign*Y*a - D*A  ==  B    (mod |n|).
 | 
			
		||||
                         * Similarly, (*) translates into
 | 
			
		||||
                         *      -sign*X*a  ==  A          (mod |n|).
 | 
			
		||||
                         *
 | 
			
		||||
                         * Thus,
 | 
			
		||||
                         *   sign*Y*a + D*sign*X*a  ==  B  (mod |n|),
 | 
			
		||||
                         * i.e.
 | 
			
		||||
                         *        sign*(Y + D*X)*a  ==  B  (mod |n|).
 | 
			
		||||
                         *
 | 
			
		||||
                         * So if we set  (X, Y, sign) := (Y + D*X, X, -sign),  we arrive back at
 | 
			
		||||
                         *      -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
                         *       sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
                         * Note that  X  and  Y  stay non-negative all the time.
 | 
			
		||||
                         */
 | 
			
		||||
            /*-
 | 
			
		||||
             * Since the former  M  is now  B  and the former  B  is now  A,
 | 
			
		||||
             * (**) translates into
 | 
			
		||||
             *       sign*Y*a  ==  D*A + B    (mod |n|),
 | 
			
		||||
             * i.e.
 | 
			
		||||
             *       sign*Y*a - D*A  ==  B    (mod |n|).
 | 
			
		||||
             * Similarly, (*) translates into
 | 
			
		||||
             *      -sign*X*a  ==  A          (mod |n|).
 | 
			
		||||
             *
 | 
			
		||||
             * Thus,
 | 
			
		||||
             *   sign*Y*a + D*sign*X*a  ==  B  (mod |n|),
 | 
			
		||||
             * i.e.
 | 
			
		||||
             *        sign*(Y + D*X)*a  ==  B  (mod |n|).
 | 
			
		||||
             *
 | 
			
		||||
             * So if we set  (X, Y, sign) := (Y + D*X, X, -sign),  we arrive back at
 | 
			
		||||
             *      -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
             *       sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
             * Note that  X  and  Y  stay non-negative all the time.
 | 
			
		||||
             */
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * most of the time D is very small, so we can optimize tmp :=
 | 
			
		||||
@@ -498,13 +498,13 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * The while loop (Euclid's algorithm) ends when
 | 
			
		||||
         *      A == gcd(a,n);
 | 
			
		||||
         * we have
 | 
			
		||||
         *       sign*Y*a  ==  A  (mod |n|),
 | 
			
		||||
         * where  Y  is non-negative.
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * The while loop (Euclid's algorithm) ends when
 | 
			
		||||
     *      A == gcd(a,n);
 | 
			
		||||
     * we have
 | 
			
		||||
     *       sign*Y*a  ==  A  (mod |n|),
 | 
			
		||||
     * where  Y  is non-negative.
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    if (sign < 0) {
 | 
			
		||||
        if (!BN_sub(Y, n, Y))
 | 
			
		||||
@@ -588,22 +588,22 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
 | 
			
		||||
            goto err;
 | 
			
		||||
    }
 | 
			
		||||
    sign = -1;
 | 
			
		||||
        /*-
 | 
			
		||||
         * From  B = a mod |n|,  A = |n|  it follows that
 | 
			
		||||
         *
 | 
			
		||||
         *      0 <= B < A,
 | 
			
		||||
         *     -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
         *      sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * From  B = a mod |n|,  A = |n|  it follows that
 | 
			
		||||
     *
 | 
			
		||||
     *      0 <= B < A,
 | 
			
		||||
     *     -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
     *      sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    while (!BN_is_zero(B)) {
 | 
			
		||||
        BIGNUM *tmp;
 | 
			
		||||
 | 
			
		||||
                /*-
 | 
			
		||||
                 *      0 < B < A,
 | 
			
		||||
                 * (*) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
                 *      sign*Y*a  ==  A   (mod |n|)
 | 
			
		||||
                 */
 | 
			
		||||
        /*-
 | 
			
		||||
         *      0 < B < A,
 | 
			
		||||
         * (*) -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
         *      sign*Y*a  ==  A   (mod |n|)
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        /*
 | 
			
		||||
         * Turn BN_FLG_CONSTTIME flag on, so that when BN_div is invoked,
 | 
			
		||||
@@ -616,12 +616,12 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
 | 
			
		||||
        if (!BN_div(D, M, pA, B, ctx))
 | 
			
		||||
            goto err;
 | 
			
		||||
 | 
			
		||||
                /*-
 | 
			
		||||
                 * Now
 | 
			
		||||
                 *      A = D*B + M;
 | 
			
		||||
                 * thus we have
 | 
			
		||||
                 * (**)  sign*Y*a  ==  D*B + M   (mod |n|).
 | 
			
		||||
                 */
 | 
			
		||||
        /*-
 | 
			
		||||
         * Now
 | 
			
		||||
         *      A = D*B + M;
 | 
			
		||||
         * thus we have
 | 
			
		||||
         * (**)  sign*Y*a  ==  D*B + M   (mod |n|).
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        tmp = A;                /* keep the BIGNUM object, the value does not
 | 
			
		||||
                                 * matter */
 | 
			
		||||
@@ -631,25 +631,25 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
 | 
			
		||||
        B = M;
 | 
			
		||||
        /* ... so we have  0 <= B < A  again */
 | 
			
		||||
 | 
			
		||||
                /*-
 | 
			
		||||
                 * Since the former  M  is now  B  and the former  B  is now  A,
 | 
			
		||||
                 * (**) translates into
 | 
			
		||||
                 *       sign*Y*a  ==  D*A + B    (mod |n|),
 | 
			
		||||
                 * i.e.
 | 
			
		||||
                 *       sign*Y*a - D*A  ==  B    (mod |n|).
 | 
			
		||||
                 * Similarly, (*) translates into
 | 
			
		||||
                 *      -sign*X*a  ==  A          (mod |n|).
 | 
			
		||||
                 *
 | 
			
		||||
                 * Thus,
 | 
			
		||||
                 *   sign*Y*a + D*sign*X*a  ==  B  (mod |n|),
 | 
			
		||||
                 * i.e.
 | 
			
		||||
                 *        sign*(Y + D*X)*a  ==  B  (mod |n|).
 | 
			
		||||
                 *
 | 
			
		||||
                 * So if we set  (X, Y, sign) := (Y + D*X, X, -sign),  we arrive back at
 | 
			
		||||
                 *      -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
                 *       sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
                 * Note that  X  and  Y  stay non-negative all the time.
 | 
			
		||||
                 */
 | 
			
		||||
        /*-
 | 
			
		||||
         * Since the former  M  is now  B  and the former  B  is now  A,
 | 
			
		||||
         * (**) translates into
 | 
			
		||||
         *       sign*Y*a  ==  D*A + B    (mod |n|),
 | 
			
		||||
         * i.e.
 | 
			
		||||
         *       sign*Y*a - D*A  ==  B    (mod |n|).
 | 
			
		||||
         * Similarly, (*) translates into
 | 
			
		||||
         *      -sign*X*a  ==  A          (mod |n|).
 | 
			
		||||
         *
 | 
			
		||||
         * Thus,
 | 
			
		||||
         *   sign*Y*a + D*sign*X*a  ==  B  (mod |n|),
 | 
			
		||||
         * i.e.
 | 
			
		||||
         *        sign*(Y + D*X)*a  ==  B  (mod |n|).
 | 
			
		||||
         *
 | 
			
		||||
         * So if we set  (X, Y, sign) := (Y + D*X, X, -sign),  we arrive back at
 | 
			
		||||
         *      -sign*X*a  ==  B   (mod |n|),
 | 
			
		||||
         *       sign*Y*a  ==  A   (mod |n|).
 | 
			
		||||
         * Note that  X  and  Y  stay non-negative all the time.
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        if (!BN_mul(tmp, D, X, ctx))
 | 
			
		||||
            goto err;
 | 
			
		||||
@@ -663,13 +663,13 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
 | 
			
		||||
        sign = -sign;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * The while loop (Euclid's algorithm) ends when
 | 
			
		||||
         *      A == gcd(a,n);
 | 
			
		||||
         * we have
 | 
			
		||||
         *       sign*Y*a  ==  A  (mod |n|),
 | 
			
		||||
         * where  Y  is non-negative.
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * The while loop (Euclid's algorithm) ends when
 | 
			
		||||
     *      A == gcd(a,n);
 | 
			
		||||
     * we have
 | 
			
		||||
     *       sign*Y*a  ==  A  (mod |n|),
 | 
			
		||||
     * where  Y  is non-negative.
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    if (sign < 0) {
 | 
			
		||||
        if (!BN_sub(Y, n, Y))
 | 
			
		||||
 
 | 
			
		||||
@@ -694,9 +694,10 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
    }
 | 
			
		||||
# else
 | 
			
		||||
    {
 | 
			
		||||
        int i, ubits = BN_num_bits(u), vbits = BN_num_bits(v), /* v is copy
 | 
			
		||||
                                                                * of p */
 | 
			
		||||
            top = p->top;
 | 
			
		||||
        int i;
 | 
			
		||||
        int ubits = BN_num_bits(u);
 | 
			
		||||
        int vbits = BN_num_bits(v); /* v is copy of p */
 | 
			
		||||
        int top = p->top;
 | 
			
		||||
        BN_ULONG *udp, *bdp, *vdp, *cdp;
 | 
			
		||||
 | 
			
		||||
        bn_wexpand(u, top);
 | 
			
		||||
@@ -740,8 +741,12 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
                ubits--;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (ubits <= BN_BITS2 && udp[0] == 1)
 | 
			
		||||
                break;
 | 
			
		||||
            if (ubits <= BN_BITS2) {
 | 
			
		||||
                if (udp[0] == 0) /* poly was reducible */
 | 
			
		||||
                    goto err;
 | 
			
		||||
                if (udp[0] == 1)
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (ubits < vbits) {
 | 
			
		||||
                i = ubits;
 | 
			
		||||
 
 | 
			
		||||
@@ -66,13 +66,13 @@ int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 | 
			
		||||
    int ret = -2;               /* avoid 'uninitialized' warning */
 | 
			
		||||
    int err = 0;
 | 
			
		||||
    BIGNUM *A, *B, *tmp;
 | 
			
		||||
        /*-
 | 
			
		||||
         * In 'tab', only odd-indexed entries are relevant:
 | 
			
		||||
         * For any odd BIGNUM n,
 | 
			
		||||
         *     tab[BN_lsw(n) & 7]
 | 
			
		||||
         * is $(-1)^{(n^2-1)/8}$ (using TeX notation).
 | 
			
		||||
         * Note that the sign of n does not matter.
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * In 'tab', only odd-indexed entries are relevant:
 | 
			
		||||
     * For any odd BIGNUM n,
 | 
			
		||||
     *     tab[BN_lsw(n) & 7]
 | 
			
		||||
     * is $(-1)^{(n^2-1)/8}$ (using TeX notation).
 | 
			
		||||
     * Note that the sign of n does not matter.
 | 
			
		||||
     */
 | 
			
		||||
    static const int tab[8] = { 0, 1, 0, -1, 0, -1, 0, 1 };
 | 
			
		||||
 | 
			
		||||
    bn_check_top(a);
 | 
			
		||||
 
 | 
			
		||||
@@ -276,7 +276,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
 | 
			
		||||
#   endif
 | 
			
		||||
#  elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG))
 | 
			
		||||
#   if defined(__GNUC__) && __GNUC__>=2
 | 
			
		||||
#    if __GNUC__>=4 && __GNUC_MINOR__>=4
 | 
			
		||||
#    if __GNUC__>4 || (__GNUC__>=4 && __GNUC_MINOR__>=4)
 | 
			
		||||
                                     /* "h" constraint is no more since 4.4 */
 | 
			
		||||
#     define BN_UMULT_HIGH(a,b)          (((__uint128_t)(a)*(b))>>64)
 | 
			
		||||
#     define BN_UMULT_LOHI(low,high,a,b) ({     \
 | 
			
		||||
 
 | 
			
		||||
@@ -527,11 +527,11 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
 | 
			
		||||
        bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]), n, dna, dnb, p);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
 | 
			
		||||
         * r[10] holds (a[0]*b[0])
 | 
			
		||||
         * r[32] holds (b[1]*b[1])
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
 | 
			
		||||
     * r[10] holds (a[0]*b[0])
 | 
			
		||||
     * r[32] holds (b[1]*b[1])
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
 | 
			
		||||
 | 
			
		||||
@@ -542,12 +542,12 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
 | 
			
		||||
        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
 | 
			
		||||
         * r[10] holds (a[0]*b[0])
 | 
			
		||||
         * r[32] holds (b[1]*b[1])
 | 
			
		||||
         * c1 holds the carry bits
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
 | 
			
		||||
     * r[10] holds (a[0]*b[0])
 | 
			
		||||
     * r[32] holds (b[1]*b[1])
 | 
			
		||||
     * c1 holds the carry bits
 | 
			
		||||
     */
 | 
			
		||||
    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
 | 
			
		||||
    if (c1) {
 | 
			
		||||
        p = &(r[n + n2]);
 | 
			
		||||
@@ -689,11 +689,11 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
 | 
			
		||||
         * r[10] holds (a[0]*b[0])
 | 
			
		||||
         * r[32] holds (b[1]*b[1])
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
 | 
			
		||||
     * r[10] holds (a[0]*b[0])
 | 
			
		||||
     * r[32] holds (b[1]*b[1])
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
 | 
			
		||||
 | 
			
		||||
@@ -704,12 +704,12 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
 | 
			
		||||
         * r[10] holds (a[0]*b[0])
 | 
			
		||||
         * r[32] holds (b[1]*b[1])
 | 
			
		||||
         * c1 holds the carry bits
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
 | 
			
		||||
     * r[10] holds (a[0]*b[0])
 | 
			
		||||
     * r[32] holds (b[1]*b[1])
 | 
			
		||||
     * c1 holds the carry bits
 | 
			
		||||
     */
 | 
			
		||||
    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
 | 
			
		||||
    if (c1) {
 | 
			
		||||
        p = &(r[n + n2]);
 | 
			
		||||
@@ -828,13 +828,13 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
 | 
			
		||||
        bn_mul_recursive(r, &(a[n]), &(b[n]), n, 0, 0, &(t[n2]));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * s0 == low(al*bl)
 | 
			
		||||
         * s1 == low(ah*bh)+low((al-ah)*(bh-bl))+low(al*bl)+high(al*bl)
 | 
			
		||||
         * We know s0 and s1 so the only unknown is high(al*bl)
 | 
			
		||||
         * high(al*bl) == s1 - low(ah*bh+s0+(al-ah)*(bh-bl))
 | 
			
		||||
         * high(al*bl) == s1 - (r[0]+l[0]+t[0])
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * s0 == low(al*bl)
 | 
			
		||||
     * s1 == low(ah*bh)+low((al-ah)*(bh-bl))+low(al*bl)+high(al*bl)
 | 
			
		||||
     * We know s0 and s1 so the only unknown is high(al*bl)
 | 
			
		||||
     * high(al*bl) == s1 - low(ah*bh+s0+(al-ah)*(bh-bl))
 | 
			
		||||
     * high(al*bl) == s1 - (r[0]+l[0]+t[0])
 | 
			
		||||
     */
 | 
			
		||||
    if (l != NULL) {
 | 
			
		||||
        lp = &(t[n2 + n]);
 | 
			
		||||
        c1 = (int)(bn_add_words(lp, &(r[0]), &(l[0]), n));
 | 
			
		||||
@@ -859,22 +859,22 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
 | 
			
		||||
            lp[i] = ((~mp[i]) + 1) & BN_MASK2;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * s[0] = low(al*bl)
 | 
			
		||||
         * t[3] = high(al*bl)
 | 
			
		||||
         * t[10] = (a[0]-a[1])*(b[1]-b[0]) neg is the sign
 | 
			
		||||
         * r[10] = (a[1]*b[1])
 | 
			
		||||
         */
 | 
			
		||||
        /*-
 | 
			
		||||
         * R[10] = al*bl
 | 
			
		||||
         * R[21] = al*bl + ah*bh + (a[0]-a[1])*(b[1]-b[0])
 | 
			
		||||
         * R[32] = ah*bh
 | 
			
		||||
         */
 | 
			
		||||
        /*-
 | 
			
		||||
         * R[1]=t[3]+l[0]+r[0](+-)t[0] (have carry/borrow)
 | 
			
		||||
         * R[2]=r[0]+t[3]+r[1](+-)t[1] (have carry/borrow)
 | 
			
		||||
         * R[3]=r[1]+(carry/borrow)
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * s[0] = low(al*bl)
 | 
			
		||||
     * t[3] = high(al*bl)
 | 
			
		||||
     * t[10] = (a[0]-a[1])*(b[1]-b[0]) neg is the sign
 | 
			
		||||
     * r[10] = (a[1]*b[1])
 | 
			
		||||
     */
 | 
			
		||||
    /*-
 | 
			
		||||
     * R[10] = al*bl
 | 
			
		||||
     * R[21] = al*bl + ah*bh + (a[0]-a[1])*(b[1]-b[0])
 | 
			
		||||
     * R[32] = ah*bh
 | 
			
		||||
     */
 | 
			
		||||
    /*-
 | 
			
		||||
     * R[1]=t[3]+l[0]+r[0](+-)t[0] (have carry/borrow)
 | 
			
		||||
     * R[2]=r[0]+t[3]+r[1](+-)t[1] (have carry/borrow)
 | 
			
		||||
     * R[3]=r[1]+(carry/borrow)
 | 
			
		||||
     */
 | 
			
		||||
    if (l != NULL) {
 | 
			
		||||
        lp = &(t[n2]);
 | 
			
		||||
        c1 = (int)(bn_add_words(lp, &(t[n2 + n]), &(l[0]), n));
 | 
			
		||||
 
 | 
			
		||||
@@ -71,7 +71,12 @@ char *BN_bn2hex(const BIGNUM *a)
 | 
			
		||||
    char *buf;
 | 
			
		||||
    char *p;
 | 
			
		||||
 | 
			
		||||
    buf = (char *)OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
 | 
			
		||||
    if (a->neg && BN_is_zero(a)) {
 | 
			
		||||
        /* "-0" == 3 bytes including NULL terminator */
 | 
			
		||||
        buf = OPENSSL_malloc(3);
 | 
			
		||||
    } else {
 | 
			
		||||
        buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
 | 
			
		||||
    }
 | 
			
		||||
    if (buf == NULL) {
 | 
			
		||||
        BNerr(BN_F_BN_BN2HEX, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
        goto err;
 | 
			
		||||
@@ -106,12 +111,12 @@ char *BN_bn2dec(const BIGNUM *a)
 | 
			
		||||
    BIGNUM *t = NULL;
 | 
			
		||||
    BN_ULONG *bn_data = NULL, *lp;
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * get an upper bound for the length of the decimal integer
 | 
			
		||||
         * num <= (BN_num_bits(a) + 1) * log(2)
 | 
			
		||||
         *     <= 3 * BN_num_bits(a) * 0.1001 + log(2) + 1     (rounding error)
 | 
			
		||||
         *     <= BN_num_bits(a)/10 + BN_num_bits/1000 + 1 + 1
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * get an upper bound for the length of the decimal integer
 | 
			
		||||
     * num <= (BN_num_bits(a) + 1) * log(2)
 | 
			
		||||
     *     <= 3 * BN_num_bits(a) * 0.1001 + log(2) + 1     (rounding error)
 | 
			
		||||
     *     <= BN_num_bits(a)/10 + BN_num_bits/1000 + 1 + 1
 | 
			
		||||
     */
 | 
			
		||||
    i = BN_num_bits(a) * 3;
 | 
			
		||||
    num = (i / 10 + i / 1000 + 1) + 1;
 | 
			
		||||
    bn_data =
 | 
			
		||||
 
 | 
			
		||||
@@ -121,6 +121,11 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
 | 
			
		||||
    int ret = 0, bit, bytes, mask;
 | 
			
		||||
    time_t tim;
 | 
			
		||||
 | 
			
		||||
    if (bits < 0 || (bits == 1 && top > 0)) {
 | 
			
		||||
        BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (bits == 0) {
 | 
			
		||||
        BN_zero(rnd);
 | 
			
		||||
        return 1;
 | 
			
		||||
@@ -157,7 +162,8 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
 | 
			
		||||
        unsigned char c;
 | 
			
		||||
 | 
			
		||||
        for (i = 0; i < bytes; i++) {
 | 
			
		||||
            RAND_pseudo_bytes(&c, 1);
 | 
			
		||||
            if (RAND_pseudo_bytes(&c, 1) < 0)
 | 
			
		||||
                goto err;
 | 
			
		||||
            if (c >= 128 && i > 0)
 | 
			
		||||
                buf[i] = buf[i - 1];
 | 
			
		||||
            else if (c < 42)
 | 
			
		||||
@@ -168,7 +174,7 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (top != -1) {
 | 
			
		||||
    if (top >= 0) {
 | 
			
		||||
        if (top) {
 | 
			
		||||
            if (bit == 0) {
 | 
			
		||||
                buf[0] = 1;
 | 
			
		||||
 
 | 
			
		||||
@@ -137,6 +137,11 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
 | 
			
		||||
    bn_check_top(r);
 | 
			
		||||
    bn_check_top(a);
 | 
			
		||||
 | 
			
		||||
    if (n < 0) {
 | 
			
		||||
        BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    r->neg = a->neg;
 | 
			
		||||
    nw = n / BN_BITS2;
 | 
			
		||||
    if (bn_wexpand(r, a->top + nw + 1) == NULL)
 | 
			
		||||
@@ -174,6 +179,11 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
 | 
			
		||||
    bn_check_top(r);
 | 
			
		||||
    bn_check_top(a);
 | 
			
		||||
 | 
			
		||||
    if (n < 0) {
 | 
			
		||||
        BNerr(BN_F_BN_RSHIFT, BN_R_INVALID_SHIFT);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    nw = n / BN_BITS2;
 | 
			
		||||
    rb = n % BN_BITS2;
 | 
			
		||||
    lb = BN_BITS2 - rb;
 | 
			
		||||
 
 | 
			
		||||
@@ -249,23 +249,23 @@ void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t)
 | 
			
		||||
    bn_sqr_recursive(r, a, n, p);
 | 
			
		||||
    bn_sqr_recursive(&(r[n2]), &(a[n]), n, p);
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * t[32] holds (a[0]-a[1])*(a[1]-a[0]), it is negative or zero
 | 
			
		||||
         * r[10] holds (a[0]*b[0])
 | 
			
		||||
         * r[32] holds (b[1]*b[1])
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * t[32] holds (a[0]-a[1])*(a[1]-a[0]), it is negative or zero
 | 
			
		||||
     * r[10] holds (a[0]*b[0])
 | 
			
		||||
     * r[32] holds (b[1]*b[1])
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
 | 
			
		||||
 | 
			
		||||
    /* t[32] is negative */
 | 
			
		||||
    c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * t[32] holds (a[0]-a[1])*(a[1]-a[0])+(a[0]*a[0])+(a[1]*a[1])
 | 
			
		||||
         * r[10] holds (a[0]*a[0])
 | 
			
		||||
         * r[32] holds (a[1]*a[1])
 | 
			
		||||
         * c1 holds the carry bits
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * t[32] holds (a[0]-a[1])*(a[1]-a[0])+(a[0]*a[0])+(a[1]*a[1])
 | 
			
		||||
     * r[10] holds (a[0]*a[0])
 | 
			
		||||
     * r[32] holds (a[1]*a[1])
 | 
			
		||||
     * c1 holds the carry bits
 | 
			
		||||
     */
 | 
			
		||||
    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
 | 
			
		||||
    if (c1) {
 | 
			
		||||
        p = &(r[n + n2]);
 | 
			
		||||
 
 | 
			
		||||
@@ -132,14 +132,14 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
    /* we'll set  q  later (if needed) */
 | 
			
		||||
 | 
			
		||||
    if (e == 1) {
 | 
			
		||||
                /*-
 | 
			
		||||
                 * The easy case:  (|p|-1)/2  is odd, so 2 has an inverse
 | 
			
		||||
                 * modulo  (|p|-1)/2,  and square roots can be computed
 | 
			
		||||
                 * directly by modular exponentiation.
 | 
			
		||||
                 * We have
 | 
			
		||||
                 *     2 * (|p|+1)/4 == 1   (mod (|p|-1)/2),
 | 
			
		||||
                 * so we can use exponent  (|p|+1)/4,  i.e.  (|p|-3)/4 + 1.
 | 
			
		||||
                 */
 | 
			
		||||
        /*-
 | 
			
		||||
         * The easy case:  (|p|-1)/2  is odd, so 2 has an inverse
 | 
			
		||||
         * modulo  (|p|-1)/2,  and square roots can be computed
 | 
			
		||||
         * directly by modular exponentiation.
 | 
			
		||||
         * We have
 | 
			
		||||
         *     2 * (|p|+1)/4 == 1   (mod (|p|-1)/2),
 | 
			
		||||
         * so we can use exponent  (|p|+1)/4,  i.e.  (|p|-3)/4 + 1.
 | 
			
		||||
         */
 | 
			
		||||
        if (!BN_rshift(q, p, 2))
 | 
			
		||||
            goto end;
 | 
			
		||||
        q->neg = 0;
 | 
			
		||||
@@ -152,32 +152,32 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (e == 2) {
 | 
			
		||||
                /*-
 | 
			
		||||
                 * |p| == 5  (mod 8)
 | 
			
		||||
                 *
 | 
			
		||||
                 * In this case  2  is always a non-square since
 | 
			
		||||
                 * Legendre(2,p) = (-1)^((p^2-1)/8)  for any odd prime.
 | 
			
		||||
                 * So if  a  really is a square, then  2*a  is a non-square.
 | 
			
		||||
                 * Thus for
 | 
			
		||||
                 *      b := (2*a)^((|p|-5)/8),
 | 
			
		||||
                 *      i := (2*a)*b^2
 | 
			
		||||
                 * we have
 | 
			
		||||
                 *     i^2 = (2*a)^((1 + (|p|-5)/4)*2)
 | 
			
		||||
                 *         = (2*a)^((p-1)/2)
 | 
			
		||||
                 *         = -1;
 | 
			
		||||
                 * so if we set
 | 
			
		||||
                 *      x := a*b*(i-1),
 | 
			
		||||
                 * then
 | 
			
		||||
                 *     x^2 = a^2 * b^2 * (i^2 - 2*i + 1)
 | 
			
		||||
                 *         = a^2 * b^2 * (-2*i)
 | 
			
		||||
                 *         = a*(-i)*(2*a*b^2)
 | 
			
		||||
                 *         = a*(-i)*i
 | 
			
		||||
                 *         = a.
 | 
			
		||||
                 *
 | 
			
		||||
                 * (This is due to A.O.L. Atkin,
 | 
			
		||||
                 * <URL: http://listserv.nodak.edu/scripts/wa.exe?A2=ind9211&L=nmbrthry&O=T&P=562>,
 | 
			
		||||
                 * November 1992.)
 | 
			
		||||
                 */
 | 
			
		||||
        /*-
 | 
			
		||||
         * |p| == 5  (mod 8)
 | 
			
		||||
         *
 | 
			
		||||
         * In this case  2  is always a non-square since
 | 
			
		||||
         * Legendre(2,p) = (-1)^((p^2-1)/8)  for any odd prime.
 | 
			
		||||
         * So if  a  really is a square, then  2*a  is a non-square.
 | 
			
		||||
         * Thus for
 | 
			
		||||
         *      b := (2*a)^((|p|-5)/8),
 | 
			
		||||
         *      i := (2*a)*b^2
 | 
			
		||||
         * we have
 | 
			
		||||
         *     i^2 = (2*a)^((1 + (|p|-5)/4)*2)
 | 
			
		||||
         *         = (2*a)^((p-1)/2)
 | 
			
		||||
         *         = -1;
 | 
			
		||||
         * so if we set
 | 
			
		||||
         *      x := a*b*(i-1),
 | 
			
		||||
         * then
 | 
			
		||||
         *     x^2 = a^2 * b^2 * (i^2 - 2*i + 1)
 | 
			
		||||
         *         = a^2 * b^2 * (-2*i)
 | 
			
		||||
         *         = a*(-i)*(2*a*b^2)
 | 
			
		||||
         *         = a*(-i)*i
 | 
			
		||||
         *         = a.
 | 
			
		||||
         *
 | 
			
		||||
         * (This is due to A.O.L. Atkin,
 | 
			
		||||
         * <URL: http://listserv.nodak.edu/scripts/wa.exe?A2=ind9211&L=nmbrthry&O=T&P=562>,
 | 
			
		||||
         * November 1992.)
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        /* t := 2*a */
 | 
			
		||||
        if (!BN_mod_lshift1_quick(t, A, p))
 | 
			
		||||
@@ -277,24 +277,24 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /*-
 | 
			
		||||
         * Now we know that (if  p  is indeed prime) there is an integer
 | 
			
		||||
         * k,  0 <= k < 2^e,  such that
 | 
			
		||||
         *
 | 
			
		||||
         *      a^q * y^k == 1   (mod p).
 | 
			
		||||
         *
 | 
			
		||||
         * As  a^q  is a square and  y  is not,  k  must be even.
 | 
			
		||||
         * q+1  is even, too, so there is an element
 | 
			
		||||
         *
 | 
			
		||||
         *     X := a^((q+1)/2) * y^(k/2),
 | 
			
		||||
         *
 | 
			
		||||
         * and it satisfies
 | 
			
		||||
         *
 | 
			
		||||
         *     X^2 = a^q * a     * y^k
 | 
			
		||||
         *         = a,
 | 
			
		||||
         *
 | 
			
		||||
         * so it is the square root that we are looking for.
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * Now we know that (if  p  is indeed prime) there is an integer
 | 
			
		||||
     * k,  0 <= k < 2^e,  such that
 | 
			
		||||
     *
 | 
			
		||||
     *      a^q * y^k == 1   (mod p).
 | 
			
		||||
     *
 | 
			
		||||
     * As  a^q  is a square and  y  is not,  k  must be even.
 | 
			
		||||
     * q+1  is even, too, so there is an element
 | 
			
		||||
     *
 | 
			
		||||
     *     X := a^((q+1)/2) * y^(k/2),
 | 
			
		||||
     *
 | 
			
		||||
     * and it satisfies
 | 
			
		||||
     *
 | 
			
		||||
     *     X^2 = a^q * a     * y^k
 | 
			
		||||
     *         = a,
 | 
			
		||||
     *
 | 
			
		||||
     * so it is the square root that we are looking for.
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    /* t := (q-1)/2  (note that  q  is odd) */
 | 
			
		||||
    if (!BN_rshift1(t, q))
 | 
			
		||||
@@ -333,15 +333,15 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
        goto end;
 | 
			
		||||
 | 
			
		||||
    while (1) {
 | 
			
		||||
                /*-
 | 
			
		||||
                 * Now  b  is  a^q * y^k  for some even  k  (0 <= k < 2^E
 | 
			
		||||
                 * where  E  refers to the original value of  e,  which we
 | 
			
		||||
                 * don't keep in a variable),  and  x  is  a^((q+1)/2) * y^(k/2).
 | 
			
		||||
                 *
 | 
			
		||||
                 * We have  a*b = x^2,
 | 
			
		||||
                 *    y^2^(e-1) = -1,
 | 
			
		||||
                 *    b^2^(e-1) = 1.
 | 
			
		||||
                 */
 | 
			
		||||
        /*-
 | 
			
		||||
         * Now  b  is  a^q * y^k  for some even  k  (0 <= k < 2^E
 | 
			
		||||
         * where  E  refers to the original value of  e,  which we
 | 
			
		||||
         * don't keep in a variable),  and  x  is  a^((q+1)/2) * y^(k/2).
 | 
			
		||||
         *
 | 
			
		||||
         * We have  a*b = x^2,
 | 
			
		||||
         *    y^2^(e-1) = -1,
 | 
			
		||||
         *    b^2^(e-1) = 1.
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        if (BN_is_one(b)) {
 | 
			
		||||
            if (!BN_copy(ret, x))
 | 
			
		||||
 
 | 
			
		||||
@@ -61,6 +61,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ void BUF_MEM_free(BUF_MEM *a)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    if (a->data != NULL) {
 | 
			
		||||
        memset(a->data, 0, (unsigned int)a->max);
 | 
			
		||||
        OPENSSL_cleanse(a->data, a->max);
 | 
			
		||||
        OPENSSL_free(a->data);
 | 
			
		||||
    }
 | 
			
		||||
    OPENSSL_free(a);
 | 
			
		||||
 
 | 
			
		||||
@@ -73,6 +73,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -69,6 +69,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -134,9 +134,9 @@ static unsigned char cfb_cipher64[CFB_TEST_SIZE] = {
 | 
			
		||||
    0x59, 0xD8, 0xE2, 0x65, 0x00, 0x58, 0x6C, 0x3F,
 | 
			
		||||
    0x2C, 0x17, 0x25, 0xD0, 0x1A, 0x38, 0xB7, 0x2A,
 | 
			
		||||
    0x39, 0x61, 0x37, 0xDC, 0x79, 0xFB, 0x9F, 0x45
 | 
			
		||||
/*-     0xF9,0x78,0x32,0xB5,0x42,0x1A,0x6B,0x38,
 | 
			
		||||
        0x9A,0x44,0xD6,0x04,0x19,0x43,0xC4,0xD9,
 | 
			
		||||
        0x3D,0x1E,0xAE,0x47,0xFC,0xCF,0x29,0x0B,*/
 | 
			
		||||
/*- 0xF9,0x78,0x32,0xB5,0x42,0x1A,0x6B,0x38,
 | 
			
		||||
    0x9A,0x44,0xD6,0x04,0x19,0x43,0xC4,0xD9,
 | 
			
		||||
    0x3D,0x1E,0xAE,0x47,0xFC,0xCF,0x29,0x0B,*/
 | 
			
		||||
};
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -61,6 +61,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -126,6 +126,8 @@ EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx)
 | 
			
		||||
 | 
			
		||||
void CMAC_CTX_free(CMAC_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
    if (!ctx)
 | 
			
		||||
        return;
 | 
			
		||||
    CMAC_CTX_cleanup(ctx);
 | 
			
		||||
    OPENSSL_free(ctx);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -67,6 +67,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -231,6 +231,8 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen,
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
    tmp = OPENSSL_malloc(inlen);
 | 
			
		||||
    if (!tmp)
 | 
			
		||||
        return 0;
 | 
			
		||||
    /* setup IV by decrypting last two blocks */
 | 
			
		||||
    EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
 | 
			
		||||
                      in + inlen - 2 * blocklen, blocklen * 2);
 | 
			
		||||
@@ -295,8 +297,9 @@ static int kek_wrap_key(unsigned char *out, size_t *outlen,
 | 
			
		||||
        out[3] = in[2] ^ 0xFF;
 | 
			
		||||
        memcpy(out + 4, in, inlen);
 | 
			
		||||
        /* Add random padding to end */
 | 
			
		||||
        if (olen > inlen + 4)
 | 
			
		||||
            RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen);
 | 
			
		||||
        if (olen > inlen + 4
 | 
			
		||||
            && RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen) < 0)
 | 
			
		||||
            return 0;
 | 
			
		||||
        /* Encrypt twice */
 | 
			
		||||
        EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
 | 
			
		||||
        EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
 | 
			
		||||
 
 | 
			
		||||
@@ -131,7 +131,7 @@ static void do_free_upto(BIO *f, BIO *upto)
 | 
			
		||||
            BIO_free(f);
 | 
			
		||||
            f = tbio;
 | 
			
		||||
        }
 | 
			
		||||
        while (f != upto);
 | 
			
		||||
        while (f && f != upto);
 | 
			
		||||
    } else
 | 
			
		||||
        BIO_free_all(f);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -64,6 +64,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -64,6 +64,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -567,16 +567,16 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
 | 
			
		||||
                }
 | 
			
		||||
                e++;
 | 
			
		||||
            }
 | 
			
		||||
                        /*-
 | 
			
		||||
                         * So at this point we have
 | 
			
		||||
                         * np which is the start of the name string which is
 | 
			
		||||
                         *   '\0' terminated.
 | 
			
		||||
                         * cp which is the start of the section string which is
 | 
			
		||||
                         *   '\0' terminated.
 | 
			
		||||
                         * e is the 'next point after'.
 | 
			
		||||
                         * r and rr are the chars replaced by the '\0'
 | 
			
		||||
                         * rp and rrp is where 'r' and 'rr' came from.
 | 
			
		||||
                         */
 | 
			
		||||
            /*-
 | 
			
		||||
             * So at this point we have
 | 
			
		||||
             * np which is the start of the name string which is
 | 
			
		||||
             *   '\0' terminated.
 | 
			
		||||
             * cp which is the start of the section string which is
 | 
			
		||||
             *   '\0' terminated.
 | 
			
		||||
             * e is the 'next point after'.
 | 
			
		||||
             * r and rr are the chars replaced by the '\0'
 | 
			
		||||
             * rp and rrp is where 'r' and 'rr' came from.
 | 
			
		||||
             */
 | 
			
		||||
            p = _CONF_get_string(conf, cp, np);
 | 
			
		||||
            if (rrp != NULL)
 | 
			
		||||
                *rrp = rr;
 | 
			
		||||
@@ -585,7 +585,11 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
 | 
			
		||||
                CONFerr(CONF_F_STR_COPY, CONF_R_VARIABLE_HAS_NO_VALUE);
 | 
			
		||||
                goto err;
 | 
			
		||||
            }
 | 
			
		||||
            BUF_MEM_grow_clean(buf, (strlen(p) + buf->length - (e - from)));
 | 
			
		||||
            if (!BUF_MEM_grow_clean(buf,
 | 
			
		||||
                        (strlen(p) + buf->length - (e - from)))) {
 | 
			
		||||
                CONFerr(CONF_F_STR_COPY, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
                goto err;
 | 
			
		||||
            }
 | 
			
		||||
            while (*p)
 | 
			
		||||
                buf->data[to++] = *(p++);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -86,23 +86,10 @@ void OPENSSL_config(const char *config_name)
 | 
			
		||||
    /* Need to load ENGINEs */
 | 
			
		||||
    ENGINE_load_builtin_engines();
 | 
			
		||||
#endif
 | 
			
		||||
    /* Add others here? */
 | 
			
		||||
 | 
			
		||||
    ERR_clear_error();
 | 
			
		||||
    if (CONF_modules_load_file(NULL, config_name,
 | 
			
		||||
    CONF_modules_load_file(NULL, config_name,
 | 
			
		||||
                               CONF_MFLAGS_DEFAULT_SECTION |
 | 
			
		||||
                               CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) {
 | 
			
		||||
        BIO *bio_err;
 | 
			
		||||
        ERR_load_crypto_strings();
 | 
			
		||||
        if ((bio_err = BIO_new_fp(stderr, BIO_NOCLOSE)) != NULL) {
 | 
			
		||||
            BIO_printf(bio_err, "Auto configuration failed\n");
 | 
			
		||||
            ERR_print_errors(bio_err);
 | 
			
		||||
            BIO_free(bio_err);
 | 
			
		||||
        }
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return;
 | 
			
		||||
                               CONF_MFLAGS_IGNORE_MISSING_FILE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OPENSSL_no_config()
 | 
			
		||||
 
 | 
			
		||||
@@ -806,8 +806,6 @@ int OPENSSL_isservice(void)
 | 
			
		||||
    if (_OPENSSL_isservice.p != (void *)-1)
 | 
			
		||||
        return (*_OPENSSL_isservice.f) ();
 | 
			
		||||
 | 
			
		||||
    (void)GetDesktopWindow();   /* return value is ignored */
 | 
			
		||||
 | 
			
		||||
    h = GetProcessWindowStation();
 | 
			
		||||
    if (h == NULL)
 | 
			
		||||
        return -1;
 | 
			
		||||
 
 | 
			
		||||
@@ -94,6 +94,8 @@ tests:
 | 
			
		||||
lint:
 | 
			
		||||
	lint -DLINT $(INCLUDES) $(SRC)>fluff
 | 
			
		||||
 | 
			
		||||
update: depend
 | 
			
		||||
 | 
			
		||||
depend:
 | 
			
		||||
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
 | 
			
		||||
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 | 
			
		||||
 
 | 
			
		||||
@@ -228,14 +228,14 @@ int main(int argc, char **argv)
 | 
			
		||||
    }
 | 
			
		||||
    if (error)
 | 
			
		||||
        usage();
 | 
			
		||||
        /*-
 | 
			
		||||
         * We either
 | 
			
		||||
         * do checksum or
 | 
			
		||||
         * do encrypt or
 | 
			
		||||
         * do decrypt or
 | 
			
		||||
         * do decrypt then ckecksum or
 | 
			
		||||
         * do checksum then encrypt
 | 
			
		||||
         */
 | 
			
		||||
    /*-
 | 
			
		||||
     * We either
 | 
			
		||||
     * do checksum or
 | 
			
		||||
     * do encrypt or
 | 
			
		||||
     * do decrypt or
 | 
			
		||||
     * do decrypt then ckecksum or
 | 
			
		||||
     * do checksum then encrypt
 | 
			
		||||
     */
 | 
			
		||||
    if (((eflag + dflag) == 1) || cflag) {
 | 
			
		||||
        if (eflag)
 | 
			
		||||
            do_encrypt = DES_ENCRYPT;
 | 
			
		||||
@@ -455,8 +455,10 @@ void doencryption(void)
 | 
			
		||||
            rem = l % 8;
 | 
			
		||||
            len = l - rem;
 | 
			
		||||
            if (feof(DES_IN)) {
 | 
			
		||||
                for (i = 7 - rem; i > 0; i--)
 | 
			
		||||
                    RAND_pseudo_bytes(buf + l++, 1);
 | 
			
		||||
                for (i = 7 - rem; i > 0; i--) {
 | 
			
		||||
                    if (RAND_pseudo_bytes(buf + l++, 1) < 0)
 | 
			
		||||
                        goto problems;
 | 
			
		||||
                }
 | 
			
		||||
                buf[l++] = rem;
 | 
			
		||||
                ex = 1;
 | 
			
		||||
                len += rem;
 | 
			
		||||
 
 | 
			
		||||
@@ -404,13 +404,13 @@ int main(int argc, char *argv[])
 | 
			
		||||
                          DES_ENCRYPT);
 | 
			
		||||
    DES_ede3_cbcm_encrypt(&cbc_data[16], &cbc_out[16], i - 16, &ks, &ks2,
 | 
			
		||||
                          &ks3, &iv3, &iv2, DES_ENCRYPT);
 | 
			
		||||
        /*-     if (memcmp(cbc_out,cbc3_ok,
 | 
			
		||||
                (unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0)
 | 
			
		||||
                {
 | 
			
		||||
                printf("des_ede3_cbc_encrypt encrypt error\n");
 | 
			
		||||
                err=1;
 | 
			
		||||
                }
 | 
			
		||||
        */
 | 
			
		||||
/*- if (memcmp(cbc_out,cbc3_ok,
 | 
			
		||||
        (unsigned int)(strlen((char *)cbc_data)+1+7)/8*8) != 0)
 | 
			
		||||
        {
 | 
			
		||||
        printf("des_ede3_cbc_encrypt encrypt error\n");
 | 
			
		||||
        err=1;
 | 
			
		||||
        }
 | 
			
		||||
*/
 | 
			
		||||
    memcpy(iv3, cbc_iv, sizeof(cbc_iv));
 | 
			
		||||
    memset(iv2, '\0', sizeof iv2);
 | 
			
		||||
    DES_ede3_cbcm_encrypt(cbc_out, cbc_in, i, &ks, &ks2, &ks3, &iv3, &iv2,
 | 
			
		||||
 
 | 
			
		||||
@@ -205,12 +205,12 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
 | 
			
		||||
         */
 | 
			
		||||
        num = len;
 | 
			
		||||
    } else {
 | 
			
		||||
                /*-
 | 
			
		||||
                 * >output is a multiple of 8 byes, if len < rnum
 | 
			
		||||
                 * >we must be careful.  The user must be aware that this
 | 
			
		||||
                 * >routine will write more bytes than he asked for.
 | 
			
		||||
                 * >The length of the buffer must be correct.
 | 
			
		||||
                 * FIXED - Should be ok now 18-9-90 - eay */
 | 
			
		||||
        /*-
 | 
			
		||||
         * >output is a multiple of 8 byes, if len < rnum
 | 
			
		||||
         * >we must be careful.  The user must be aware that this
 | 
			
		||||
         * >routine will write more bytes than he asked for.
 | 
			
		||||
         * >The length of the buffer must be correct.
 | 
			
		||||
         * FIXED - Should be ok now 18-9-90 - eay */
 | 
			
		||||
        if (len < rnum) {
 | 
			
		||||
 | 
			
		||||
            if (DES_rw_mode & DES_PCBC_MODE)
 | 
			
		||||
 
 | 
			
		||||
@@ -96,6 +96,9 @@ int DES_enc_write(int fd, const void *_buf, int len,
 | 
			
		||||
    const unsigned char *cp;
 | 
			
		||||
    static int start = 1;
 | 
			
		||||
 | 
			
		||||
    if (len < 0)
 | 
			
		||||
        return -1;
 | 
			
		||||
 | 
			
		||||
    if (outbuf == NULL) {
 | 
			
		||||
        outbuf = OPENSSL_malloc(BSIZE + HDRSIZE);
 | 
			
		||||
        if (outbuf == NULL)
 | 
			
		||||
@@ -132,7 +135,9 @@ int DES_enc_write(int fd, const void *_buf, int len,
 | 
			
		||||
    if (len < 8) {
 | 
			
		||||
        cp = shortbuf;
 | 
			
		||||
        memcpy(shortbuf, buf, len);
 | 
			
		||||
        RAND_pseudo_bytes(shortbuf + len, 8 - len);
 | 
			
		||||
        if (RAND_pseudo_bytes(shortbuf + len, 8 - len) < 0) {
 | 
			
		||||
            return -1;
 | 
			
		||||
        }
 | 
			
		||||
        rnum = 8;
 | 
			
		||||
    } else {
 | 
			
		||||
        cp = buf;
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user