Compare commits
	
		
			318 Commits
		
	
	
		
			OpenSSL_0_
			...
			FIPS_098_T
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					0712210f03 | ||
| 
						 | 
					8431a6aaf5 | ||
| 
						 | 
					2b4a783f66 | ||
| 
						 | 
					25df4a81cc | ||
| 
						 | 
					23830280e4 | ||
| 
						 | 
					bfdfc67b01 | ||
| 
						 | 
					4764a0543d | ||
| 
						 | 
					d92b0efbb8 | ||
| 
						 | 
					b329cc2410 | ||
| 
						 | 
					ed31fe68ff | ||
| 
						 | 
					8fa41c6696 | ||
| 
						 | 
					707a028c8b | ||
| 
						 | 
					9593bc46bf | ||
| 
						 | 
					5c65d38219 | ||
| 
						 | 
					1b8b2d9300 | ||
| 
						 | 
					4e1778b0d8 | ||
| 
						 | 
					982c67fbaa | ||
| 
						 | 
					2ef2463643 | ||
| 
						 | 
					585eb117d4 | ||
| 
						 | 
					7c27ac1030 | ||
| 
						 | 
					475631c31a | ||
| 
						 | 
					218ba8cb9d | ||
| 
						 | 
					e881c00515 | ||
| 
						 | 
					6c3fca2b10 | ||
| 
						 | 
					0225c7a41e | ||
| 
						 | 
					a334b0436d | ||
| 
						 | 
					af13a3949d | ||
| 
						 | 
					ffc35e73b4 | ||
| 
						 | 
					a197212e0f | ||
| 
						 | 
					8944220221 | ||
| 
						 | 
					5fd76ba57a | ||
| 
						 | 
					df50ec372e | ||
| 
						 | 
					49fa74385d | ||
| 
						 | 
					899f528c1a | ||
| 
						 | 
					5faa5a9476 | ||
| 
						 | 
					ddb0cb5bfd | ||
| 
						 | 
					b2d65cbac7 | ||
| 
						 | 
					6be8288928 | ||
| 
						 | 
					9fe07b7cf0 | ||
| 
						 | 
					0c86c87c60 | ||
| 
						 | 
					e20d6ef3d6 | ||
| 
						 | 
					27f50994ff | ||
| 
						 | 
					53c381105a | ||
| 
						 | 
					33d0ef8fde | ||
| 
						 | 
					b2acf7a572 | ||
| 
						 | 
					e8d2d9478d | ||
| 
						 | 
					23b3b61921 | ||
| 
						 | 
					d265676989 | ||
| 
						 | 
					69fc3dff96 | ||
| 
						 | 
					667731b635 | ||
| 
						 | 
					a416ca47ac | ||
| 
						 | 
					2714e2ac89 | ||
| 
						 | 
					1139eeecbc | ||
| 
						 | 
					1b936a5e37 | ||
| 
						 | 
					0cca0fe0c2 | ||
| 
						 | 
					56474376dc | ||
| 
						 | 
					3e511f167e | ||
| 
						 | 
					282af42404 | ||
| 
						 | 
					a81f337331 | ||
| 
						 | 
					1729dca9a8 | ||
| 
						 | 
					9719193222 | ||
| 
						 | 
					e6fa7c1276 | ||
| 
						 | 
					cf7053430d | ||
| 
						 | 
					ff03c6bc97 | ||
| 
						 | 
					82c8b6b74d | ||
| 
						 | 
					cb6fdc3a49 | ||
| 
						 | 
					8c3b5d5f27 | ||
| 
						 | 
					dc83f2e312 | ||
| 
						 | 
					6693e26927 | ||
| 
						 | 
					793364457b | ||
| 
						 | 
					6b05350495 | ||
| 
						 | 
					daec9a56a0 | ||
| 
						 | 
					5c77786a55 | ||
| 
						 | 
					42bc3582a9 | ||
| 
						 | 
					2050f6514f | ||
| 
						 | 
					5068d7dda4 | ||
| 
						 | 
					55768cf773 | ||
| 
						 | 
					6c69dcd9f5 | ||
| 
						 | 
					ad4297dd9c | ||
| 
						 | 
					aeb9ccfaad | ||
| 
						 | 
					79b335a4b5 | ||
| 
						 | 
					6fd3f3260d | ||
| 
						 | 
					d9e262443c | ||
| 
						 | 
					51c3bb3b98 | ||
| 
						 | 
					7d608f9e32 | ||
| 
						 | 
					295de18c8a | ||
| 
						 | 
					3370b694b9 | ||
| 
						 | 
					3380c52f15 | ||
| 
						 | 
					1364e6f1ac | ||
| 
						 | 
					c5ac2aa62c | ||
| 
						 | 
					392a0345de | ||
| 
						 | 
					5c2fc73e7b | ||
| 
						 | 
					402b951804 | ||
| 
						 | 
					5848d13fed | ||
| 
						 | 
					5dd24ead57 | ||
| 
						 | 
					d2cb94952a | ||
| 
						 | 
					0615396d2d | ||
| 
						 | 
					82877ea449 | ||
| 
						 | 
					81fae49db9 | ||
| 
						 | 
					74ff8dc975 | ||
| 
						 | 
					ac319217d0 | ||
| 
						 | 
					cdb13ae8d0 | ||
| 
						 | 
					ab700807d9 | ||
| 
						 | 
					744b91bb9f | ||
| 
						 | 
					d69f85bf15 | ||
| 
						 | 
					52ee969e29 | ||
| 
						 | 
					55f0501201 | ||
| 
						 | 
					b2710ee19a | ||
| 
						 | 
					bbfcc4724d | ||
| 
						 | 
					c31cc72d79 | ||
| 
						 | 
					d1049ad93e | ||
| 
						 | 
					5f4cc234fb | ||
| 
						 | 
					d31a13953c | ||
| 
						 | 
					28f5873179 | ||
| 
						 | 
					8f813338f1 | ||
| 
						 | 
					6555dfa486 | ||
| 
						 | 
					5eee0253e5 | ||
| 
						 | 
					594c723f98 | ||
| 
						 | 
					f418265865 | ||
| 
						 | 
					53707e2eec | ||
| 
						 | 
					fde794e898 | ||
| 
						 | 
					082f19b42d | ||
| 
						 | 
					e31c620686 | ||
| 
						 | 
					dcc309548e | ||
| 
						 | 
					570253315f | ||
| 
						 | 
					8eae0ff0f7 | ||
| 
						 | 
					5dcdac6e4e | ||
| 
						 | 
					5c4a07551e | ||
| 
						 | 
					eea3fce854 | ||
| 
						 | 
					215c49d032 | ||
| 
						 | 
					923df53e25 | ||
| 
						 | 
					b443a0ea5d | ||
| 
						 | 
					1a684d0020 | ||
| 
						 | 
					1f4a5a3339 | ||
| 
						 | 
					dc3b721fa0 | ||
| 
						 | 
					4479ce9c1c | ||
| 
						 | 
					4a0d3530e0 | ||
| 
						 | 
					9907d2992d | ||
| 
						 | 
					20fb51b1a7 | ||
| 
						 | 
					551bfa60e0 | ||
| 
						 | 
					9d9224f184 | ||
| 
						 | 
					78d4d87e39 | ||
| 
						 | 
					6211633273 | ||
| 
						 | 
					3a4cf918bf | ||
| 
						 | 
					e25eb309ec | ||
| 
						 | 
					ffa2b2aa7d | ||
| 
						 | 
					a77a95584d | ||
| 
						 | 
					68bb98159f | ||
| 
						 | 
					8e6905d238 | ||
| 
						 | 
					1a8521ff24 | ||
| 
						 | 
					9d5460d72d | ||
| 
						 | 
					35e59297fc | ||
| 
						 | 
					9b945233b1 | ||
| 
						 | 
					b065dc2eee | ||
| 
						 | 
					66c4bb1a70 | ||
| 
						 | 
					36abe6fe61 | ||
| 
						 | 
					3c786aa6c8 | ||
| 
						 | 
					e5cce6d356 | ||
| 
						 | 
					723b7d81e4 | ||
| 
						 | 
					a3ddd7358b | ||
| 
						 | 
					45c027f31f | ||
| 
						 | 
					3b62e9eb0d | ||
| 
						 | 
					34a8c7ec87 | ||
| 
						 | 
					d4a6240005 | ||
| 
						 | 
					5c6f76da0a | ||
| 
						 | 
					4636341b05 | ||
| 
						 | 
					be3b770d8f | ||
| 
						 | 
					af32387b3f | ||
| 
						 | 
					115fc340cb | ||
| 
						 | 
					900f7a8776 | ||
| 
						 | 
					4877e30504 | ||
| 
						 | 
					4656ec3852 | ||
| 
						 | 
					e336441197 | ||
| 
						 | 
					20d6182f33 | ||
| 
						 | 
					aa145866f9 | ||
| 
						 | 
					fdff41e166 | ||
| 
						 | 
					07b4bc3979 | ||
| 
						 | 
					0c66d3ae37 | ||
| 
						 | 
					bd869183d5 | ||
| 
						 | 
					7e2bf83100 | ||
| 
						 | 
					25e52a78fb | ||
| 
						 | 
					ab50cf18db | ||
| 
						 | 
					31c0a38482 | ||
| 
						 | 
					91c88deafe | ||
| 
						 | 
					a91cb15daa | ||
| 
						 | 
					d2890f6223 | ||
| 
						 | 
					1ce5bb27e4 | ||
| 
						 | 
					04262cee42 | ||
| 
						 | 
					a5a1e71e86 | ||
| 
						 | 
					06d2a382c4 | ||
| 
						 | 
					4630a51537 | ||
| 
						 | 
					01f2ee2bc6 | ||
| 
						 | 
					def5aefa7f | ||
| 
						 | 
					5ba7d69c66 | ||
| 
						 | 
					cf81dc74bd | ||
| 
						 | 
					46c646225d | ||
| 
						 | 
					d18c4d09d1 | ||
| 
						 | 
					e5ad779b69 | ||
| 
						 | 
					cb36743161 | ||
| 
						 | 
					fb3eab3562 | ||
| 
						 | 
					2724bcac2f | ||
| 
						 | 
					3431c07a66 | ||
| 
						 | 
					9abf011643 | ||
| 
						 | 
					75cdb055e6 | ||
| 
						 | 
					f4207058b8 | ||
| 
						 | 
					900b1eb869 | ||
| 
						 | 
					e3b61b1e57 | ||
| 
						 | 
					750779da07 | ||
| 
						 | 
					157f01a8ef | ||
| 
						 | 
					491923fde1 | ||
| 
						 | 
					273f5726a5 | ||
| 
						 | 
					a37778046d | ||
| 
						 | 
					8a087e57d2 | ||
| 
						 | 
					e384fd9418 | ||
| 
						 | 
					f6e32f9db4 | ||
| 
						 | 
					66bb600b05 | ||
| 
						 | 
					c3b2d69945 | ||
| 
						 | 
					619991cc3e | ||
| 
						 | 
					3c410172b7 | ||
| 
						 | 
					56319ad00e | ||
| 
						 | 
					f7832889d3 | ||
| 
						 | 
					46fdad292a | ||
| 
						 | 
					da99684a8e | ||
| 
						 | 
					2130ee35d9 | ||
| 
						 | 
					15f239a4a3 | ||
| 
						 | 
					223ab84726 | ||
| 
						 | 
					94d66c3182 | ||
| 
						 | 
					a0dd62bdb7 | ||
| 
						 | 
					fd6d2e0754 | ||
| 
						 | 
					4a4d3c02f2 | ||
| 
						 | 
					7abd533793 | ||
| 
						 | 
					b1816f93e1 | ||
| 
						 | 
					e1904f9eec | ||
| 
						 | 
					9f3d5018c4 | ||
| 
						 | 
					768729afbe | ||
| 
						 | 
					0c96e35c42 | ||
| 
						 | 
					72e2934909 | ||
| 
						 | 
					26d96f26da | ||
| 
						 | 
					5fcc83ed1e | ||
| 
						 | 
					9ecb20f1de | ||
| 
						 | 
					b611ff350c | ||
| 
						 | 
					7f790e0575 | ||
| 
						 | 
					dccf15ee25 | ||
| 
						 | 
					89d8a20f22 | ||
| 
						 | 
					782f8600fa | ||
| 
						 | 
					f2008fe3fd | ||
| 
						 | 
					70b3786ffe | ||
| 
						 | 
					b48fb91edd | ||
| 
						 | 
					8a19891b2a | ||
| 
						 | 
					f35d0948eb | ||
| 
						 | 
					d0f2c1bb81 | ||
| 
						 | 
					7ba410f9a5 | ||
| 
						 | 
					36c2be5645 | ||
| 
						 | 
					0869cd2676 | ||
| 
						 | 
					4ac5596a86 | ||
| 
						 | 
					3df76b15ed | ||
| 
						 | 
					9b3cce3d00 | ||
| 
						 | 
					c8a2f669f3 | ||
| 
						 | 
					04a2a836f7 | ||
| 
						 | 
					d39e69c95a | ||
| 
						 | 
					69ffdb2d46 | ||
| 
						 | 
					e301a26ade | ||
| 
						 | 
					2ed0cf8eef | ||
| 
						 | 
					1c2cbe6fcc | ||
| 
						 | 
					023616e32d | ||
| 
						 | 
					b2703470e0 | ||
| 
						 | 
					452cd79114 | ||
| 
						 | 
					9eaca0079f | ||
| 
						 | 
					bbaf3c2b40 | ||
| 
						 | 
					ce147f8998 | ||
| 
						 | 
					4e99f848d8 | ||
| 
						 | 
					358cf2f6e8 | ||
| 
						 | 
					407c2c1106 | ||
| 
						 | 
					2e8aaf94c2 | ||
| 
						 | 
					3108a80b09 | ||
| 
						 | 
					bfa3933c8b | ||
| 
						 | 
					40b4a633a1 | ||
| 
						 | 
					fc784cbc5c | ||
| 
						 | 
					d20b5c2043 | ||
| 
						 | 
					fdf45c44be | ||
| 
						 | 
					68b08c56c2 | ||
| 
						 | 
					4416eec8ca | ||
| 
						 | 
					709af3877d | ||
| 
						 | 
					8651ba5d45 | ||
| 
						 | 
					efbb2cb4e5 | ||
| 
						 | 
					dec45d606f | ||
| 
						 | 
					6dfd1801fe | ||
| 
						 | 
					d8242c65b3 | ||
| 
						 | 
					ee42430cc8 | ||
| 
						 | 
					da3fe316cf | ||
| 
						 | 
					c8214d6c8b | ||
| 
						 | 
					063b216760 | ||
| 
						 | 
					65f0a05325 | ||
| 
						 | 
					952b6955c0 | ||
| 
						 | 
					6f74afaa57 | ||
| 
						 | 
					3edefe670a | ||
| 
						 | 
					a461d307f2 | ||
| 
						 | 
					89a4dad179 | ||
| 
						 | 
					1ea2fda9dc | ||
| 
						 | 
					f41dcf3d50 | ||
| 
						 | 
					1e6031eeb7 | ||
| 
						 | 
					d9e61666c9 | ||
| 
						 | 
					2f07e0d591 | ||
| 
						 | 
					b0a3d8dd27 | ||
| 
						 | 
					a7100590fe | ||
| 
						 | 
					7b1ef38609 | ||
| 
						 | 
					3f5602ce04 | ||
| 
						 | 
					be0dccdd9e | ||
| 
						 | 
					50a4d84e79 | ||
| 
						 | 
					0135aa9888 | ||
| 
						 | 
					692e644df6 | ||
| 
						 | 
					3b72341958 | ||
| 
						 | 
					3a0278b211 | ||
| 
						 | 
					304ba9fa78 | ||
| 
						 | 
					4484703f5e | ||
| 
						 | 
					6b7751ac2c | ||
| 
						 | 
					7af4688a8f | ||
| 
						 | 
					d8360c3a8a | 
							
								
								
									
										480
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										480
									
								
								CHANGES
									
									
									
									
									
								
							@@ -2,6 +2,414 @@
 | 
			
		||||
 OpenSSL CHANGES
 | 
			
		||||
 _______________
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8e and 0.9.8f-fips  [xx XXX xxxx]
 | 
			
		||||
 | 
			
		||||
  *) Add SSE2 instruction support to WIN32 build. These will be compiled
 | 
			
		||||
     by default and used if an appopriate CPU is detected. Some older versions
 | 
			
		||||
     of NASM or MASM which don't support SSE2 will need to be updated. 
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Tolerate DigestInfo structure with absent parameters in FIPS mode
 | 
			
		||||
     (as required by several standards).
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Enhance mkfipsscr.pl to cope with different directory layouts. It now
 | 
			
		||||
     relies on the filename and makes no assumptions about the pathname.
 | 
			
		||||
     In the case of PSS it scans the file to determine the salt length.
 | 
			
		||||
     Paths can be filtered. Also reports duplicate and missing files.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Updates to WIN32 build system. Make use of AES assembly language routines.
 | 
			
		||||
     Use assembly language routines in FIPS compilation.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Use standard implementations of SHAx, DES, AES under crypto/ in FIPS
 | 
			
		||||
     mode to avoid having to maintain two versions. This will also make use
 | 
			
		||||
     of appropriate assembly language optimizations.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Check for selftest status in all crypto operations and exit with a
 | 
			
		||||
     fatal error if selftest failed.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) New flag in EVP_CIPHER: EVP_CIPH_FLAG_DEFAULT_ASN1. This will
 | 
			
		||||
     automatically use EVP_CIPHER_{get,set}_asn1_iv and avoid the
 | 
			
		||||
     need for any ASN1 dependencies in FIPS library. Move AES and 3DES
 | 
			
		||||
     cipher definitions to fips library and modify AES and 3DES algorithm
 | 
			
		||||
     tests and self tests to use EVP.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Move EVP cipher code into enc_min.c to support a minimal implementation
 | 
			
		||||
     for use by FIPS applications.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Add algorithm config module. Currently just handles setting FIPS mode.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Rewrite self tests and pairwise tests to use EVP. Add more extensive
 | 
			
		||||
     self tests for RSA in all digests and modes.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) New flags RSA_FIPS_METHOD and DSA_FIPS_METHOD to indicate a method is
 | 
			
		||||
     allowed in FIPS mode. Disable direct low level RSA and DSA signature
 | 
			
		||||
     operations in FIPS mode so all operations have to be made via EVP.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) New flag EVP_MD_FLAG_SVCTX which passes EVP_MD_CTX and key to underlying
 | 
			
		||||
     sign/verify method. This permits the method to perform finalization
 | 
			
		||||
     and signing itself and have access to the EVP_MD_CTX structure in case
 | 
			
		||||
     additional parameters are needed. Modify fips_{dsa,rsa}_{sign,verify}
 | 
			
		||||
     to use EVP_MD_FLAG_SVCTX and support PSS and X9.31 RSA modes.
 | 
			
		||||
     Modify RSA algorithm test programs to use new parameters.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Add small standalone ASN1 encoder/decoder to handle DSA signature format.
 | 
			
		||||
     Modify test, algorithm test and selftest routines to use EVP for DSA.
 | 
			
		||||
     Move FIPS implementation of EVP_sha*() and EVP_dss1() under fips-1.0.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Modify VC++ build system to rename .text and .rdata segments in
 | 
			
		||||
     FIPS sources to .fipst${a,b,c}, and $fipsr${a,b,c} and place them
 | 
			
		||||
     in a static library fipscanister.lib using a perl script. These are
 | 
			
		||||
     then combined by the VC++ linker into a single segment in suffix
 | 
			
		||||
     order but without the suffix (i.e. .fipstx, .fipsrd and .fipsda).
 | 
			
		||||
     This serves the same purpose as fipscanister.o on other platforms
 | 
			
		||||
     but has the advantage that it can be created using only standard VC++
 | 
			
		||||
     utilities.
 | 
			
		||||
     [Steve Henson and Andy Polyakov]
 | 
			
		||||
 | 
			
		||||
  *) Modify WIN32 build system to forward references functions implemented
 | 
			
		||||
     in FIPS DLL. 
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Move error library so that all lhash dependencies are in a separate
 | 
			
		||||
     file. Include a simplified ERR_get_state() function for stand alone
 | 
			
		||||
     FIPS applications. Include a initialization function OPENSSL_init()
 | 
			
		||||
     to set all callbacks, automatically call OPENSSL_init() once when
 | 
			
		||||
     a cipher or digest is added. This should mean that almost all applications
 | 
			
		||||
     set the callbacks automatically. Exceptional cases can call OPENSSL_init()
 | 
			
		||||
     manually like this:
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_HAVE_INIT
 | 
			
		||||
    OPENSSL_init();
 | 
			
		||||
#endif
 | 
			
		||||
     before starting any threads.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Collect common functions into header file "fips_utl.h".
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Only enable dynamic lock functionality in CRYPTO_lock() when it is really
 | 
			
		||||
     needed. Move some lock functionality into new file dyn_lck.c .
 | 
			
		||||
     This further reduces FIPS dependencies allowing the complete removal
 | 
			
		||||
     of STACK and OBJ_bsearch().
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Reduce FIPS test program dependencies by providing stand alone
 | 
			
		||||
     versions of some existing functions in libcrypto. Avoid use
 | 
			
		||||
     of BIOs by converting to system stdio. Move some functions in FIPS
 | 
			
		||||
     files: e.g. all use of BIO_printf().
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Modify build of libcrypto in FIPS mode by using a perl 
 | 
			
		||||
     script "arx.pl" which calls the archiver specifically
 | 
			
		||||
     excluding any FIPS dependencies in libcrypto.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Port OpenSSL 0.9.7 FIPS code to 0.9.8. Convert to new
 | 
			
		||||
     Makefile form. Update Configure. Convert and update
 | 
			
		||||
     FIPS source files. Update libcrypto, libssl and apps
 | 
			
		||||
     with additional functionality from 0.9.7 FIPS code.
 | 
			
		||||
     Update Windows build system.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8e and 0.9.8f  [23 Feb 2007]
 | 
			
		||||
 | 
			
		||||
  *) Mitigate branch prediction attacks, which can be practical if a
 | 
			
		||||
     single processor is shared, allowing a spy process to extract
 | 
			
		||||
     information.  For detailed background information, see
 | 
			
		||||
     http://eprint.iacr.org/2007/039 (O. Aciicmez, S. Gueron,
 | 
			
		||||
     J.-P. Seifert, "New Branch Prediction Vulnerabilities in OpenSSL
 | 
			
		||||
     and Necessary Software Countermeasures").  The core of the change
 | 
			
		||||
     are new versions BN_div_no_branch() and
 | 
			
		||||
     BN_mod_inverse_no_branch() of BN_div() and BN_mod_inverse(),
 | 
			
		||||
     respectively, which are slower, but avoid the security-relevant
 | 
			
		||||
     conditional branches.  These are automatically called by BN_div()
 | 
			
		||||
     and BN_mod_inverse() if the flag BN_FLG_CONSTTIME is set for the
 | 
			
		||||
     modulus.  Also, BN_is_bit_set() has been changed to remove a
 | 
			
		||||
     conditional branch.
 | 
			
		||||
 | 
			
		||||
     BN_FLG_CONSTTIME is the new name for the previous
 | 
			
		||||
     BN_FLG_EXP_CONSTTIME flag, since it now affects more than just
 | 
			
		||||
     modular exponentiation.  (Since OpenSSL 0.9.7h, setting this flag
 | 
			
		||||
     in the exponent causes BN_mod_exp_mont() to use the alternative
 | 
			
		||||
     implementation in BN_mod_exp_mont_consttime().)  The old name
 | 
			
		||||
     remains as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     Similary, RSA_FLAG_NO_EXP_CONSTTIME is replaced by a more general
 | 
			
		||||
     RSA_FLAG_NO_CONSTTIME flag since the RSA implementation now uses
 | 
			
		||||
     constant-time implementations for more than just exponentiation.
 | 
			
		||||
     Here too the old name is kept as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     BN_BLINDING_new() will now use BN_dup() for the modulus so that
 | 
			
		||||
     the BN_BLINDING structure gets an independent copy of the
 | 
			
		||||
     modulus.  This means that the previous "BIGNUM *m" argument to
 | 
			
		||||
     BN_BLINDING_new() and to BN_BLINDING_create_param() now
 | 
			
		||||
     essentially becomes "const BIGNUM *m", although we can't actually
 | 
			
		||||
     change this in the header file before 0.9.9.  It allows
 | 
			
		||||
     RSA_setup_blinding() to use BN_with_flags() on the modulus to
 | 
			
		||||
     enable BN_FLG_CONSTTIME.
 | 
			
		||||
 | 
			
		||||
     [Matthew D Wood (Intel Corp)]
 | 
			
		||||
 | 
			
		||||
  *) Mitigate branch prediction attacks, which can be practical if a
 | 
			
		||||
     single processor is shared, allowing a spy process to extract
 | 
			
		||||
     information.  For detailed background information, see
 | 
			
		||||
     http://eprint.iacr.org/2007/039 (O. Aciicmez, S. Gueron,
 | 
			
		||||
     J.-P. Seifert, "New Branch Prediction Vulnerabilities in OpenSSL
 | 
			
		||||
     and Necessary Software Countermeasures").  The core of the change
 | 
			
		||||
     are new versions BN_div_no_branch() and
 | 
			
		||||
     BN_mod_inverse_no_branch() of BN_div() and BN_mod_inverse(),
 | 
			
		||||
     respectively, which are slower, but avoid the security-relevant
 | 
			
		||||
     conditional branches.  These are automatically called by BN_div()
 | 
			
		||||
     and BN_mod_inverse() if the flag BN_FLG_CONSTTIME is set for one
 | 
			
		||||
     of the input BIGNUMs.  Also, BN_is_bit_set() has been changed to
 | 
			
		||||
     remove a conditional branch.
 | 
			
		||||
 | 
			
		||||
     BN_FLG_CONSTTIME is the new name for the previous
 | 
			
		||||
     BN_FLG_EXP_CONSTTIME flag, since it now affects more than just
 | 
			
		||||
     modular exponentiation.  (Since OpenSSL 0.9.7h, setting this flag
 | 
			
		||||
     in the exponent causes BN_mod_exp_mont() to use the alternative
 | 
			
		||||
     implementation in BN_mod_exp_mont_consttime().)  The old name
 | 
			
		||||
     remains as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     Similary, RSA_FLAG_NO_EXP_CONSTTIME is replaced by a more general
 | 
			
		||||
     RSA_FLAG_NO_CONSTTIME flag since the RSA implementation now uses
 | 
			
		||||
     constant-time implementations for more than just exponentiation.
 | 
			
		||||
     Here too the old name is kept as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     BN_BLINDING_new() will now use BN_dup() for the modulus so that
 | 
			
		||||
     the BN_BLINDING structure gets an independent copy of the
 | 
			
		||||
     modulus.  This means that the previous "BIGNUM *m" argument to
 | 
			
		||||
     BN_BLINDING_new() and to BN_BLINDING_create_param() now
 | 
			
		||||
     essentially becomes "const BIGNUM *m", although we can't actually
 | 
			
		||||
     change this in the header file before 0.9.9.  It allows
 | 
			
		||||
     RSA_setup_blinding() to use BN_with_flags() on the modulus to
 | 
			
		||||
     enable BN_FLG_CONSTTIME.
 | 
			
		||||
 | 
			
		||||
     [Matthew D Wood (Intel Corp)]
 | 
			
		||||
 | 
			
		||||
  *) Add the Korean symmetric 128-bit cipher SEED (see
 | 
			
		||||
     http://www.kisa.or.kr/kisa/seed/jsp/seed_eng.jsp) and
 | 
			
		||||
     add SEED ciphersuites from RFC 4162:
 | 
			
		||||
 | 
			
		||||
        TLS_RSA_WITH_SEED_CBC_SHA      =  "SEED-SHA"
 | 
			
		||||
        TLS_DHE_DSS_WITH_SEED_CBC_SHA  =  "DHE-DSS-SEED-SHA"
 | 
			
		||||
        TLS_DHE_RSA_WITH_SEED_CBC_SHA  =  "DHE-RSA-SEED-SHA"
 | 
			
		||||
        TLS_DH_anon_WITH_SEED_CBC_SHA  =  "ADH-SEED-SHA"
 | 
			
		||||
 | 
			
		||||
     To minimize changes between patchlevels in the OpenSSL 0.9.8
 | 
			
		||||
     series, SEED remains excluded from compilation unless OpenSSL
 | 
			
		||||
     is configured with 'enable-seed'.
 | 
			
		||||
     [KISA, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Mitigate branch prediction attacks, which can be practical if a
 | 
			
		||||
     single processor is shared, allowing a spy process to extract
 | 
			
		||||
     information.  For detailed background information, see
 | 
			
		||||
     http://eprint.iacr.org/2007/039 (O. Aciicmez, S. Gueron,
 | 
			
		||||
     J.-P. Seifert, "New Branch Prediction Vulnerabilities in OpenSSL
 | 
			
		||||
     and Necessary Software Countermeasures").  The core of the change
 | 
			
		||||
     are new versions BN_div_no_branch() and
 | 
			
		||||
     BN_mod_inverse_no_branch() of BN_div() and BN_mod_inverse(),
 | 
			
		||||
     respectively, which are slower, but avoid the security-relevant
 | 
			
		||||
     conditional branches.  These are automatically called by BN_div()
 | 
			
		||||
     and BN_mod_inverse() if the flag BN_FLG_CONSTTIME is set for one
 | 
			
		||||
     of the input BIGNUMs.  Also, BN_is_bit_set() has been changed to
 | 
			
		||||
     remove a conditional branch.
 | 
			
		||||
 | 
			
		||||
     BN_FLG_CONSTTIME is the new name for the previous
 | 
			
		||||
     BN_FLG_EXP_CONSTTIME flag, since it now affects more than just
 | 
			
		||||
     modular exponentiation.  (Since OpenSSL 0.9.7h, setting this flag
 | 
			
		||||
     in the exponent causes BN_mod_exp_mont() to use the alternative
 | 
			
		||||
     implementation in BN_mod_exp_mont_consttime().)  The old name
 | 
			
		||||
     remains as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     Similary, RSA_FLAG_NO_EXP_CONSTTIME is replaced by a more general
 | 
			
		||||
     RSA_FLAG_NO_CONSTTIME flag since the RSA implementation now uses
 | 
			
		||||
     constant-time implementations for more than just exponentiation.
 | 
			
		||||
     Here too the old name is kept as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     BN_BLINDING_new() will now use BN_dup() for the modulus so that
 | 
			
		||||
     the BN_BLINDING structure gets an independent copy of the
 | 
			
		||||
     modulus.  This means that the previous "BIGNUM *m" argument to
 | 
			
		||||
     BN_BLINDING_new() and to BN_BLINDING_create_param() now
 | 
			
		||||
     essentially becomes "const BIGNUM *m", although we can't actually
 | 
			
		||||
     change this in the header file before 0.9.9.  It allows
 | 
			
		||||
     RSA_setup_blinding() to use BN_with_flags() on the modulus to
 | 
			
		||||
     enable BN_FLG_CONSTTIME.
 | 
			
		||||
 | 
			
		||||
     [Matthew D Wood (Intel Corp)]
 | 
			
		||||
 | 
			
		||||
  *) Add the Korean symmetric 128-bit cipher SEED (see
 | 
			
		||||
     http://www.kisa.or.kr/kisa/seed/jsp/seed_eng.jsp) and
 | 
			
		||||
     add SEED ciphersuites from RFC 4162:
 | 
			
		||||
 | 
			
		||||
        TLS_RSA_WITH_SEED_CBC_SHA      =  "SEED-SHA"
 | 
			
		||||
        TLS_DHE_DSS_WITH_SEED_CBC_SHA  =  "DHE-DSS-SEED-SHA"
 | 
			
		||||
        TLS_DHE_RSA_WITH_SEED_CBC_SHA  =  "DHE-RSA-SEED-SHA"
 | 
			
		||||
        TLS_DH_anon_WITH_SEED_CBC_SHA  =  "ADH-SEED-SHA"
 | 
			
		||||
 | 
			
		||||
     To minimize changes between patchlevels in the OpenSSL 0.9.8
 | 
			
		||||
     series, SEED remains excluded from compilation unless OpenSSL
 | 
			
		||||
     is configured with 'enable-seed'.
 | 
			
		||||
     [KISA, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Mitigate branch prediction attacks, which can be practical if a
 | 
			
		||||
     single processor is shared, allowing a spy process to extract
 | 
			
		||||
     information.  For detailed background information, see
 | 
			
		||||
     http://eprint.iacr.org/2007/039 (O. Aciicmez, S. Gueron,
 | 
			
		||||
     J.-P. Seifert, "New Branch Prediction Vulnerabilities in OpenSSL
 | 
			
		||||
     and Necessary Software Countermeasures").  The core of the change
 | 
			
		||||
     are new versions BN_div_no_branch() and
 | 
			
		||||
     BN_mod_inverse_no_branch() of BN_div() and BN_mod_inverse(),
 | 
			
		||||
     respectively, which are slower, but avoid the security-relevant
 | 
			
		||||
     conditional branches.  These are automatically called by BN_div()
 | 
			
		||||
     and BN_mod_inverse() if the flag BN_FLG_CONSTTIME is set for one
 | 
			
		||||
     of the input BIGNUMs.  Also, BN_is_bit_set() has been changed to
 | 
			
		||||
     remove a conditional branch.
 | 
			
		||||
 | 
			
		||||
     BN_FLG_CONSTTIME is the new name for the previous
 | 
			
		||||
     BN_FLG_EXP_CONSTTIME flag, since it now affects more than just
 | 
			
		||||
     modular exponentiation.  (Since OpenSSL 0.9.7h, setting this flag
 | 
			
		||||
     in the exponent causes BN_mod_exp_mont() to use the alternative
 | 
			
		||||
     implementation in BN_mod_exp_mont_consttime().)  The old name
 | 
			
		||||
     remains as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     Similary, RSA_FLAG_NO_EXP_CONSTTIME is replaced by a more general
 | 
			
		||||
     RSA_FLAG_NO_CONSTTIME flag since the RSA implementation now uses
 | 
			
		||||
     constant-time implementations for more than just exponentiation.
 | 
			
		||||
     Here too the old name is kept as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     BN_BLINDING_new() will now use BN_dup() for the modulus so that
 | 
			
		||||
     the BN_BLINDING structure gets an independent copy of the
 | 
			
		||||
     modulus.  This means that the previous "BIGNUM *m" argument to
 | 
			
		||||
     BN_BLINDING_new() and to BN_BLINDING_create_param() now
 | 
			
		||||
     essentially becomes "const BIGNUM *m", although we can't actually
 | 
			
		||||
     change this in the header file before 0.9.9.  It allows
 | 
			
		||||
     RSA_setup_blinding() to use BN_with_flags() on the modulus to
 | 
			
		||||
     enable BN_FLG_CONSTTIME.
 | 
			
		||||
 | 
			
		||||
     [Matthew D Wood (Intel Corp)]
 | 
			
		||||
 | 
			
		||||
  *) Squeeze another 10% out of IGE mode when in != out.
 | 
			
		||||
     [Ben Laurie]
 | 
			
		||||
 | 
			
		||||
  *) AES IGE mode speedup.
 | 
			
		||||
     [Dean Gaudet (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Add the Korean symmetric 128-bit cipher SEED (see
 | 
			
		||||
     http://www.kisa.or.kr/kisa/seed/jsp/seed_eng.jsp) and
 | 
			
		||||
     add SEED ciphersuites from RFC 4162:
 | 
			
		||||
 | 
			
		||||
        TLS_RSA_WITH_SEED_CBC_SHA      =  "SEED-SHA"
 | 
			
		||||
        TLS_DHE_DSS_WITH_SEED_CBC_SHA  =  "DHE-DSS-SEED-SHA"
 | 
			
		||||
        TLS_DHE_RSA_WITH_SEED_CBC_SHA  =  "DHE-RSA-SEED-SHA"
 | 
			
		||||
        TLS_DH_anon_WITH_SEED_CBC_SHA  =  "ADH-SEED-SHA"
 | 
			
		||||
 | 
			
		||||
     To minimize changes between patchlevels in the OpenSSL 0.9.8
 | 
			
		||||
     series, SEED remains excluded from compilation unless OpenSSL
 | 
			
		||||
     is configured with 'enable-seed'.
 | 
			
		||||
     [KISA, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Mitigate branch prediction attacks, which can be practical if a
 | 
			
		||||
     single processor is shared, allowing a spy process to extract
 | 
			
		||||
     information.  For detailed background information, see
 | 
			
		||||
     http://eprint.iacr.org/2007/039 (O. Aciicmez, S. Gueron,
 | 
			
		||||
     J.-P. Seifert, "New Branch Prediction Vulnerabilities in OpenSSL
 | 
			
		||||
     and Necessary Software Countermeasures").  The core of the change
 | 
			
		||||
     are new versions BN_div_no_branch() and
 | 
			
		||||
     BN_mod_inverse_no_branch() of BN_div() and BN_mod_inverse(),
 | 
			
		||||
     respectively, which are slower, but avoid the security-relevant
 | 
			
		||||
     conditional branches.  These are automatically called by BN_div()
 | 
			
		||||
     and BN_mod_inverse() if the flag BN_FLG_CONSTTIME is set for one
 | 
			
		||||
     of the input BIGNUMs.  Also, BN_is_bit_set() has been changed to
 | 
			
		||||
     remove a conditional branch.
 | 
			
		||||
 | 
			
		||||
     BN_FLG_CONSTTIME is the new name for the previous
 | 
			
		||||
     BN_FLG_EXP_CONSTTIME flag, since it now affects more than just
 | 
			
		||||
     modular exponentiation.  (Since OpenSSL 0.9.7h, setting this flag
 | 
			
		||||
     in the exponent causes BN_mod_exp_mont() to use the alternative
 | 
			
		||||
     implementation in BN_mod_exp_mont_consttime().)  The old name
 | 
			
		||||
     remains as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     Similary, RSA_FLAG_NO_EXP_CONSTTIME is replaced by a more general
 | 
			
		||||
     RSA_FLAG_NO_CONSTTIME flag since the RSA implementation now uses
 | 
			
		||||
     constant-time implementations for more than just exponentiation.
 | 
			
		||||
     Here too the old name is kept as a deprecated alias.
 | 
			
		||||
 | 
			
		||||
     BN_BLINDING_new() will now use BN_dup() for the modulus so that
 | 
			
		||||
     the BN_BLINDING structure gets an independent copy of the
 | 
			
		||||
     modulus.  This means that the previous "BIGNUM *m" argument to
 | 
			
		||||
     BN_BLINDING_new() and to BN_BLINDING_create_param() now
 | 
			
		||||
     essentially becomes "const BIGNUM *m", although we can't actually
 | 
			
		||||
     change this in the header file before 0.9.9.  It allows
 | 
			
		||||
     RSA_setup_blinding() to use BN_with_flags() on the modulus to
 | 
			
		||||
     enable BN_FLG_CONSTTIME.
 | 
			
		||||
 | 
			
		||||
     [Matthew D Wood (Intel Corp)]
 | 
			
		||||
 | 
			
		||||
  *) In the SSL/TLS server implementation, be strict about session ID
 | 
			
		||||
     context matching (which matters if an application uses a single
 | 
			
		||||
     external cache for different purposes).  Previously,
 | 
			
		||||
     out-of-context reuse was forbidden only if SSL_VERIFY_PEER was
 | 
			
		||||
     set.  This did ensure strict client verification, but meant that,
 | 
			
		||||
     with applications using a single external cache for quite
 | 
			
		||||
     different requirements, clients could circumvent ciphersuite
 | 
			
		||||
     restrictions for a given session ID context by starting a session
 | 
			
		||||
     in a different context.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Include "!eNULL" in SSL_DEFAULT_CIPHER_LIST to make sure that
 | 
			
		||||
     a ciphersuite string such as "DEFAULT:RSA" cannot enable
 | 
			
		||||
     authentication-only ciphersuites.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8d and 0.9.8e  [23 Feb 2007]
 | 
			
		||||
 | 
			
		||||
  *) Since AES128 and AES256 (and similarly Camellia128 and
 | 
			
		||||
     Camellia256) share a single mask bit in the logic of
 | 
			
		||||
     ssl/ssl_ciph.c, the code for masking out disabled ciphers needs a
 | 
			
		||||
     kludge to work properly if AES128 is available and AES256 isn't
 | 
			
		||||
     (or if Camellia128 is available and Camellia256 isn't).
 | 
			
		||||
     [Victor Duchovni]
 | 
			
		||||
 | 
			
		||||
  *) Fix the BIT STRING encoding generated by crypto/ec/ec_asn1.c
 | 
			
		||||
     (within i2d_ECPrivateKey, i2d_ECPKParameters, i2d_ECParameters):
 | 
			
		||||
     When a point or a seed is encoded in a BIT STRING, we need to
 | 
			
		||||
     prevent the removal of trailing zero bits to get the proper DER
 | 
			
		||||
     encoding.  (By default, crypto/asn1/a_bitstr.c assumes the case
 | 
			
		||||
     of a NamedBitList, for which trailing 0 bits need to be removed.)
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Have SSL/TLS server implementation tolerate "mismatched" record
 | 
			
		||||
     protocol version while receiving ClientHello even if the
 | 
			
		||||
     ClientHello is fragmented.  (The server can't insist on the
 | 
			
		||||
     particular protocol version it has chosen before the ServerHello
 | 
			
		||||
     message has informed the client about his choice.)
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Add RFC 3779 support.
 | 
			
		||||
     [Rob Austein for ARIN, Ben Laurie]
 | 
			
		||||
 | 
			
		||||
  *) Load error codes if they are not already present instead of using a
 | 
			
		||||
     static variable. This allows them to be cleanly unloaded and reloaded.
 | 
			
		||||
     Improve header file function name parsing.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) extend SMTP and IMAP protocol emulation in s_client to use EHLO
 | 
			
		||||
     or CAPABILITY handshake as required by RFCs.
 | 
			
		||||
     [Goetz Babin-Ebell]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8c and 0.9.8d  [28 Sep 2006]
 | 
			
		||||
 | 
			
		||||
  *) Introduce limits to prevent malicious keys being able to
 | 
			
		||||
@@ -77,7 +485,7 @@
 | 
			
		||||
     draft-ietf-tls-56-bit-ciphersuites-0[01].txt, but do not really
 | 
			
		||||
     appear there.
 | 
			
		||||
 | 
			
		||||
     Also deactive the remaining ciphersuites from
 | 
			
		||||
     Also deactivate the remaining ciphersuites from
 | 
			
		||||
     draft-ietf-tls-56-bit-ciphersuites-01.txt.  These are just as
 | 
			
		||||
     unofficial, and the ID has long expired.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
@@ -1006,7 +1414,75 @@
 | 
			
		||||
     differing sizes.
 | 
			
		||||
     [Richard Levitte]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.7k and 0.9.7l  [xx XXX xxxx]
 | 
			
		||||
 Changes between 0.9.7m and 0.9.7n  [xx XXX xxxx]
 | 
			
		||||
 | 
			
		||||
  *) In the SSL/TLS server implementation, be strict about session ID
 | 
			
		||||
     context matching (which matters if an application uses a single
 | 
			
		||||
     external cache for different purposes).  Previously,
 | 
			
		||||
     out-of-context reuse was forbidden only if SSL_VERIFY_PEER was
 | 
			
		||||
     set.  This did ensure strict client verification, but meant that,
 | 
			
		||||
     with applications using a single external cache for quite
 | 
			
		||||
     different requirements, clients could circumvent ciphersuite
 | 
			
		||||
     restrictions for a given session ID context by starting a session
 | 
			
		||||
     in a different context.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.7l and 0.9.7m  [23 Feb 2007]
 | 
			
		||||
 | 
			
		||||
  *) Cleanse PEM buffers before freeing them since they may contain 
 | 
			
		||||
     sensitive data.
 | 
			
		||||
     [Benjamin Bennett <ben@psc.edu>]
 | 
			
		||||
 | 
			
		||||
  *) Include "!eNULL" in SSL_DEFAULT_CIPHER_LIST to make sure that
 | 
			
		||||
     a ciphersuite string such as "DEFAULT:RSA" cannot enable
 | 
			
		||||
     authentication-only ciphersuites.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Since AES128 and AES256 share a single mask bit in the logic of
 | 
			
		||||
     ssl/ssl_ciph.c, the code for masking out disabled ciphers needs a
 | 
			
		||||
     kludge to work properly if AES128 is available and AES256 isn't.
 | 
			
		||||
     [Victor Duchovni]
 | 
			
		||||
 | 
			
		||||
  *) Expand security boundary to match 1.1.1 module.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Remove redundant features: hash file source, editing of test vectors
 | 
			
		||||
     modify fipsld to use external fips_premain.c signature.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) New perl script mkfipsscr.pl to create shell scripts or batch files to
 | 
			
		||||
     run algorithm test programs.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Make algorithm test programs more tolerant of whitespace.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Have SSL/TLS server implementation tolerate "mismatched" record
 | 
			
		||||
     protocol version while receiving ClientHello even if the
 | 
			
		||||
     ClientHello is fragmented.  (The server can't insist on the
 | 
			
		||||
     particular protocol version it has chosen before the ServerHello
 | 
			
		||||
     message has informed the client about his choice.)
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Load error codes if they are not already present instead of using a
 | 
			
		||||
     static variable. This allows them to be cleanly unloaded and reloaded.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.7k and 0.9.7l  [28 Sep 2006]
 | 
			
		||||
 | 
			
		||||
  *) Introduce limits to prevent malicious keys being able to
 | 
			
		||||
     cause a denial of service.  (CVE-2006-2940)
 | 
			
		||||
     [Steve Henson, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix ASN.1 parsing of certain invalid structures that can result
 | 
			
		||||
     in a denial of service.  (CVE-2006-2937)  [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix buffer overflow in SSL_get_shared_ciphers() function. 
 | 
			
		||||
     (CVE-2006-3738) [Tavis Ormandy and Will Drewry, Google Security Team]
 | 
			
		||||
 | 
			
		||||
  *) Fix SSL client code which could crash if connecting to a
 | 
			
		||||
     malicious SSLv2 server.  (CVE-2006-4343)
 | 
			
		||||
     [Tavis Ormandy and Will Drewry, Google Security Team]
 | 
			
		||||
 | 
			
		||||
  *) Change ciphersuite string processing so that an explicit
 | 
			
		||||
     ciphersuite selects this one ciphersuite (so that "AES256-SHA"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										108
									
								
								Configure
									
									
									
									
									
								
							
							
						
						
									
										108
									
								
								Configure
									
									
									
									
									
								
							@@ -6,7 +6,9 @@ eval 'exec perl -S $0 ${1+"$@"}'
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
require 5.000;
 | 
			
		||||
use strict;
 | 
			
		||||
eval 'use strict;';
 | 
			
		||||
 | 
			
		||||
print STDERR "Warning: perl module strict not found.\n" if ($@);
 | 
			
		||||
 | 
			
		||||
# see INSTALL for instructions.
 | 
			
		||||
 | 
			
		||||
@@ -155,7 +157,7 @@ my %table=(
 | 
			
		||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-bodo",	"gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
 | 
			
		||||
"debug-steve",	"gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -march=i486 -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared",
 | 
			
		||||
"debug-steve",	"gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -m32 -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared",
 | 
			
		||||
"debug-steve-linux-pseudo64",	"gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT:${no_asm}:dlfcn:linux-shared",
 | 
			
		||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -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","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -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)",
 | 
			
		||||
@@ -321,8 +323,7 @@ my %table=(
 | 
			
		||||
"linux-aout",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
 | 
			
		||||
####
 | 
			
		||||
"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)",
 | 
			
		||||
# -bpowerpc64-linux is transient option, -m64 should be the one to use...
 | 
			
		||||
"linux-ppc64",	"gcc:-bpowerpc64-linux -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-bpowerpc64-linux:.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::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-ia64",	"gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${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:${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:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
@@ -403,12 +404,12 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
#### IBM's AIX.
 | 
			
		||||
"aix3-cc",  "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::",
 | 
			
		||||
"aix-gcc",  "gcc:-O -DB_ENDIAN::-D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:",
 | 
			
		||||
"aix64-gcc","gcc:-O -DB_ENDIAN::-D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn::::::-X64",
 | 
			
		||||
"aix-gcc",  "gcc:-O -DB_ENDIAN::-D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
 | 
			
		||||
"aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-maix64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64",
 | 
			
		||||
# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE
 | 
			
		||||
# at build time. $OBJECT_MODE is respected at ./config stage!
 | 
			
		||||
"aix-cc",   "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
 | 
			
		||||
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
 | 
			
		||||
"aix-cc",   "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
 | 
			
		||||
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Cray T90 and similar (SDSC)
 | 
			
		||||
@@ -563,11 +564,17 @@ my $prefix="";
 | 
			
		||||
my $openssldir="";
 | 
			
		||||
my $exe_ext="";
 | 
			
		||||
my $install_prefix="";
 | 
			
		||||
my $fipslibdir="/usr/local/ssl/lib/";
 | 
			
		||||
my $nofipscanistercheck=0;
 | 
			
		||||
my $fipsdso=0;
 | 
			
		||||
my $fipscanisterinternal="n";
 | 
			
		||||
my $baseaddr="0xFB00000";
 | 
			
		||||
my $no_threads=0;
 | 
			
		||||
my $threads=0;
 | 
			
		||||
my $no_shared=0; # but "no-shared" is default
 | 
			
		||||
my $zlib=1;      # but "no-zlib" is default
 | 
			
		||||
my $no_krb5=0;   # but "no-krb5" is implied unless "--with-krb5-..." is used
 | 
			
		||||
my $no_rfc3779=1; # but "no-rfc3779" is default
 | 
			
		||||
my $no_asm=0;
 | 
			
		||||
my $no_dso=0;
 | 
			
		||||
my $no_gmp=0;
 | 
			
		||||
@@ -584,6 +591,7 @@ my $rc2	="crypto/rc2/rc2.h";
 | 
			
		||||
my $bf	="crypto/bf/bf_locl.h";
 | 
			
		||||
my $bn_asm	="bn_asm.o";
 | 
			
		||||
my $des_enc="des_enc.o fcrypt_b.o";
 | 
			
		||||
my $fips_des_enc="fips_des_enc.o";
 | 
			
		||||
my $aes_enc="aes_core.o aes_cbc.o";
 | 
			
		||||
my $bf_enc	="bf_enc.o";
 | 
			
		||||
my $cast_enc="c_enc.o";
 | 
			
		||||
@@ -595,15 +603,18 @@ my $rmd160_obj="";
 | 
			
		||||
my $processor="";
 | 
			
		||||
my $default_ranlib;
 | 
			
		||||
my $perl;
 | 
			
		||||
my $fips=0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# All of the following is disabled by default (RC5 was enabled before 0.9.8):
 | 
			
		||||
 | 
			
		||||
my %disabled = ( # "what"         => "comment"
 | 
			
		||||
		 "camellia"	  => "default",
 | 
			
		||||
		 "gmp"		  => "default",
 | 
			
		||||
                 "camellia"       => "default",
 | 
			
		||||
                 "gmp"            => "default",
 | 
			
		||||
                 "mdc2"           => "default",
 | 
			
		||||
                 "rc5"            => "default",
 | 
			
		||||
                 "rfc3779"        => "default",
 | 
			
		||||
                 "seed"           => "default",
 | 
			
		||||
                 "shared"         => "default",
 | 
			
		||||
                 "zlib"           => "default",
 | 
			
		||||
                 "zlib-dynamic"   => "default"
 | 
			
		||||
@@ -614,7 +625,7 @@ my %disabled = ( # "what"         => "comment"
 | 
			
		||||
# For symmetry, "disable-..." is a synonym for "no-...".
 | 
			
		||||
 | 
			
		||||
# This is what $depflags will look like with the above default:
 | 
			
		||||
my $default_depflags = "-DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 ";
 | 
			
		||||
my $default_depflags = "-DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED ";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
my $no_sse2=0;
 | 
			
		||||
@@ -717,12 +728,36 @@ PROCESS_ARGS:
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^386$/)
 | 
			
		||||
			{ $processor=386; }
 | 
			
		||||
		elsif (/^fips$/)
 | 
			
		||||
			{
 | 
			
		||||
			$fips=1;
 | 
			
		||||
		        }
 | 
			
		||||
		elsif (/^rsaref$/)
 | 
			
		||||
			{
 | 
			
		||||
			# No RSAref support any more since it's not needed.
 | 
			
		||||
			# The check for the option is there so scripts aren't
 | 
			
		||||
			# broken
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^nofipscanistercheck$/)
 | 
			
		||||
			{
 | 
			
		||||
			$fips = 1;
 | 
			
		||||
			$nofipscanistercheck = 1;
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^fipscanisterbuild$/)
 | 
			
		||||
			{
 | 
			
		||||
			$fips = 1;
 | 
			
		||||
			$nofipscanistercheck = 1;
 | 
			
		||||
			$fipslibdir="";
 | 
			
		||||
			$fipscanisterinternal="y";
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^fipsdso$/)
 | 
			
		||||
			{
 | 
			
		||||
			$fips = 1;
 | 
			
		||||
			$nofipscanistercheck = 1;
 | 
			
		||||
			$fipslibdir="";
 | 
			
		||||
			$fipscanisterinternal="y";
 | 
			
		||||
			$fipsdso = 1;
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^[-+]/)
 | 
			
		||||
			{
 | 
			
		||||
			if (/^-[lL](.*)$/)
 | 
			
		||||
@@ -921,6 +956,8 @@ my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
 | 
			
		||||
 | 
			
		||||
$IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin" && !is_msys());
 | 
			
		||||
 | 
			
		||||
$no_shared = 0 if ($fipsdso && !$IsMK1MF);
 | 
			
		||||
 | 
			
		||||
$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw");
 | 
			
		||||
$exe_ext=".pm"  if ($target =~ /vos/);
 | 
			
		||||
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
 | 
			
		||||
@@ -1186,6 +1223,11 @@ $bn_obj = $bn_asm unless $bn_obj ne "";
 | 
			
		||||
$cflags.=" -DOPENSSL_BN_ASM_PART_WORDS" if ($bn_obj =~ /bn86/);
 | 
			
		||||
$cflags.=" -DOPENSSL_IA32_SSE2" if (!$no_sse2 && $bn_obj =~ /bn86/);
 | 
			
		||||
 | 
			
		||||
if ($fips)
 | 
			
		||||
	{
 | 
			
		||||
	$openssl_other_defines.="#define OPENSSL_FIPS\n";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
$des_obj=$des_enc	unless ($des_obj =~ /\.o$/);
 | 
			
		||||
$bf_obj=$bf_enc		unless ($bf_obj =~ /\.o$/);
 | 
			
		||||
$cast_obj=$cast_enc	unless ($cast_obj =~ /\.o$/);
 | 
			
		||||
@@ -1313,9 +1355,24 @@ while (<IN>)
 | 
			
		||||
	s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
 | 
			
		||||
	s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/;
 | 
			
		||||
	s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/;
 | 
			
		||||
	s/^FIPSLIBDIR=.*/FIPSLIBDIR=$fipslibdir/;
 | 
			
		||||
	if ($fipsdso)
 | 
			
		||||
		{
 | 
			
		||||
		s/^FIPSCANLIB=.*/FIPSCANLIB=libfips/;
 | 
			
		||||
		s/^SHARED_FIPS=.*/SHARED_FIPS=libfips\$(SHLIB_EXT)/;
 | 
			
		||||
		s/^SHLIBDIRS=.*/SHLIBDIRS= crypto ssl fips/;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		s/^FIPSCANLIB=.*/FIPSCANLIB=libcrypto/ if $fips;
 | 
			
		||||
		s/^SHARED_FIPS=.*/SHARED_FIPS=/;
 | 
			
		||||
		s/^SHLIBDIRS=.*/SHLIBDIRS= crypto ssl/;
 | 
			
		||||
		}
 | 
			
		||||
	s/^FIPSCANISTERINTERNAL=.*/FIPSCANISTERINTERNAL=$fipscanisterinternal/;
 | 
			
		||||
	s/^BASEADDR=.*/BASEADDR=$baseaddr/;
 | 
			
		||||
	s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
 | 
			
		||||
	s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
 | 
			
		||||
	s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
 | 
			
		||||
	s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL) \$(SHARED_FIPS)/ if (!$no_shared);
 | 
			
		||||
	if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/)
 | 
			
		||||
		{
 | 
			
		||||
		my $sotmp = $1;
 | 
			
		||||
@@ -1610,9 +1667,16 @@ BEGIN
 | 
			
		||||
    BEGIN
 | 
			
		||||
	BLOCK "040904b0"
 | 
			
		||||
	BEGIN
 | 
			
		||||
#if defined(FIPS)
 | 
			
		||||
	    VALUE "Comments", "WARNING: TEST VERSION ONLY ***NOT*** FIPS 140-2 VALIDATED.\\0"
 | 
			
		||||
#endif
 | 
			
		||||
	    // Required:	    
 | 
			
		||||
	    VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0"
 | 
			
		||||
#if defined(FIPS)
 | 
			
		||||
	    VALUE "FileDescription", "TEST UNVALIDATED FIPS140-2 DLL\\0"
 | 
			
		||||
#else
 | 
			
		||||
	    VALUE "FileDescription", "OpenSSL Shared Library\\0"
 | 
			
		||||
#endif
 | 
			
		||||
	    VALUE "FileVersion", "$version\\0"
 | 
			
		||||
#if defined(CRYPTO)
 | 
			
		||||
	    VALUE "InternalName", "libeay32\\0"
 | 
			
		||||
@@ -1620,12 +1684,15 @@ BEGIN
 | 
			
		||||
#elif defined(SSL)
 | 
			
		||||
	    VALUE "InternalName", "ssleay32\\0"
 | 
			
		||||
	    VALUE "OriginalFilename", "ssleay32.dll\\0"
 | 
			
		||||
#elif defined(FIPS)
 | 
			
		||||
	    VALUE "InternalName", "libosslfips\\0"
 | 
			
		||||
	    VALUE "OriginalFilename", "libosslfips.dll\\0"
 | 
			
		||||
#endif
 | 
			
		||||
	    VALUE "ProductName", "The OpenSSL Toolkit\\0"
 | 
			
		||||
	    VALUE "ProductVersion", "$version\\0"
 | 
			
		||||
	    // Optional:
 | 
			
		||||
	    //VALUE "Comments", "\\0"
 | 
			
		||||
	    VALUE "LegalCopyright", "Copyright <20> 1998-2005 The OpenSSL Project. Copyright <20> 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
 | 
			
		||||
	    VALUE "LegalCopyright", "Copyright <20> 1998-2007 The OpenSSL Project. Copyright <20> 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
 | 
			
		||||
	    //VALUE "LegalTrademarks", "\\0"
 | 
			
		||||
	    //VALUE "PrivateBuild", "\\0"
 | 
			
		||||
	    //VALUE "SpecialBuild", "\\0"
 | 
			
		||||
@@ -1662,6 +1729,21 @@ libraries on this platform, they will at least look at it and try their best
 | 
			
		||||
(but please first make sure you have tried with a current version of OpenSSL).
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
print <<\EOF if ($fipscanisterinternal eq "y");
 | 
			
		||||
 | 
			
		||||
WARNING: OpenSSL has been configured using unsupported option(s) to internally
 | 
			
		||||
generate a fipscanister.o object module for TESTING PURPOSES ONLY; that
 | 
			
		||||
compiled module is NOT FIPS 140-2 validated and CANNOT be used to replace the
 | 
			
		||||
OpenSSL FIPS Object Module as identified by the CMVP
 | 
			
		||||
(http://csrc.nist.gov/cryptval/) in any application requiring the use of FIPS
 | 
			
		||||
140-2 validated software. 
 | 
			
		||||
 | 
			
		||||
This is an OpenSSL 0.9.8-fips test version.
 | 
			
		||||
 | 
			
		||||
See the file README.FIPS for details of how to build a test library.
 | 
			
		||||
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
exit(0);
 | 
			
		||||
 | 
			
		||||
sub usage
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								FAQ
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								FAQ
									
									
									
									
									
								
							@@ -74,7 +74,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* Which is the current version of OpenSSL?
 | 
			
		||||
 | 
			
		||||
The current version is available from <URL: http://www.openssl.org>.
 | 
			
		||||
OpenSSL 0.9.8d was released on September 28th, 2006.
 | 
			
		||||
OpenSSL 0.9.8e was released on February 23rd, 2007.
 | 
			
		||||
 | 
			
		||||
In addition to the current stable release, you can also access daily
 | 
			
		||||
snapshots of the OpenSSL development version at <URL:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								INSTALL
									
									
									
									
									
								
							@@ -302,10 +302,10 @@
 | 
			
		||||
 Note on shared libraries
 | 
			
		||||
 ------------------------
 | 
			
		||||
 | 
			
		||||
 Shared library is currently an experimental feature.  The only reason to
 | 
			
		||||
 have them would be to conserve memory on systems where several program
 | 
			
		||||
 are using OpenSSL.  Binary backward compatibility can't be guaranteed
 | 
			
		||||
 before OpenSSL version 1.0.
 | 
			
		||||
 Shared libraries have certain caveats.  Binary backward compatibility
 | 
			
		||||
 can't be guaranteed before OpenSSL version 1.0.  The only reason to
 | 
			
		||||
 use them would be to conserve memory on systems where several programs
 | 
			
		||||
 are using OpenSSL.
 | 
			
		||||
 | 
			
		||||
 For some systems, the OpenSSL Configure script knows what is needed to
 | 
			
		||||
 build shared libraries for libcrypto and libssl.  On these systems,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							@@ -12,7 +12,7 @@
 | 
			
		||||
  ---------------
 | 
			
		||||
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1998-2007 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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										145
									
								
								Makefile.org
									
									
									
									
									
								
							
							
						
						
									
										145
									
								
								Makefile.org
									
									
									
									
									
								
							@@ -65,6 +65,7 @@ EX_LIBS=
 | 
			
		||||
EXE_EXT= 
 | 
			
		||||
ARFLAGS=
 | 
			
		||||
AR=ar $(ARFLAGS) r
 | 
			
		||||
ARD=ar $(ARFLAGS) d
 | 
			
		||||
RANLIB= ranlib
 | 
			
		||||
PERL= perl
 | 
			
		||||
TAR= tar
 | 
			
		||||
@@ -104,14 +105,40 @@ LIBKRB5=
 | 
			
		||||
ZLIB_INCLUDE=
 | 
			
		||||
LIBZLIB=
 | 
			
		||||
 | 
			
		||||
DIRS=   crypto ssl engines apps test tools
 | 
			
		||||
SHLIBDIRS= crypto ssl
 | 
			
		||||
# This is the location of fipscanister.o and friends.
 | 
			
		||||
# The FIPS module build will place it $(INSTALLTOP)/lib
 | 
			
		||||
# but since $(INSTALLTOP) can only take the default value
 | 
			
		||||
# when the module is built it will be in /usr/local/ssl/lib
 | 
			
		||||
# $(INSTALLTOP) for this build make be different so hard
 | 
			
		||||
# code the path.
 | 
			
		||||
 | 
			
		||||
FIPSLIBDIR=/usr/local/ssl/lib/
 | 
			
		||||
 | 
			
		||||
# This is set to "y" if fipscanister.o is compiled internally as
 | 
			
		||||
# opposed to coming from an external validated location.
 | 
			
		||||
 | 
			
		||||
FIPSCANISTERINTERNAL=n
 | 
			
		||||
 | 
			
		||||
# The location of the library which contains fipscanister.o
 | 
			
		||||
# normally it will be libcrypto unless fipsdso is set in which
 | 
			
		||||
# case it will be libfips. If not compiling in FIPS mode at all
 | 
			
		||||
# this is empty making it a useful test for a FIPS compile.
 | 
			
		||||
 | 
			
		||||
FIPSCANLIB=
 | 
			
		||||
 | 
			
		||||
# Shared library base address. Currently only used on Windows.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
BASEADDR=
 | 
			
		||||
 | 
			
		||||
DIRS=   crypto fips-1.0 ssl engines apps test tools
 | 
			
		||||
SHLIBDIRS= crypto ssl fips
 | 
			
		||||
 | 
			
		||||
# dirs in crypto to build
 | 
			
		||||
SDIRS=  \
 | 
			
		||||
	objects \
 | 
			
		||||
	md2 md4 md5 sha mdc2 hmac ripemd \
 | 
			
		||||
	des aes rc2 rc4 rc5 idea bf cast camellia \
 | 
			
		||||
	des aes rc2 rc4 rc5 idea bf cast camellia seed \
 | 
			
		||||
	bn ec rsa dsa ecdsa dh ecdh dso engine \
 | 
			
		||||
	buffer bio stack lhash rand err \
 | 
			
		||||
	evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
 | 
			
		||||
@@ -138,13 +165,14 @@ WDIRS=  windows
 | 
			
		||||
LIBS=   libcrypto.a libssl.a
 | 
			
		||||
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
 | 
			
		||||
SHARED_SSL=libssl$(SHLIB_EXT)
 | 
			
		||||
SHARED_FIPS=
 | 
			
		||||
SHARED_LIBS=
 | 
			
		||||
SHARED_LIBS_LINK_EXTS=
 | 
			
		||||
SHARED_LDFLAGS=
 | 
			
		||||
 | 
			
		||||
GENERAL=        Makefile
 | 
			
		||||
BASENAME=       openssl
 | 
			
		||||
NAME=           $(BASENAME)-$(VERSION)
 | 
			
		||||
NAME=           $(BASENAME)-fips-$(VERSION)
 | 
			
		||||
TARFILE=        $(NAME).tar
 | 
			
		||||
WTARFILE=       $(NAME)-win.tar
 | 
			
		||||
EXHEADER=       e_os2.h
 | 
			
		||||
@@ -191,6 +219,9 @@ BUILDENV=	PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
 | 
			
		||||
		SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'			\
 | 
			
		||||
		MD5_ASM_OBJ='${MD5_ASM_OBJ}'			\
 | 
			
		||||
		RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'		\
 | 
			
		||||
		FIPSLIBDIR='${FIPSLIBDIR}' FIPSCANLIB='${FIPSCANLIB}' \
 | 
			
		||||
		FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}'	\
 | 
			
		||||
		FIPS_EX_OBJ='${FIPS_EX_OBJ}'	\
 | 
			
		||||
		THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
 | 
			
		||||
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
 | 
			
		||||
# which in turn eliminates ambiguities in variable treatment with -e.
 | 
			
		||||
@@ -222,13 +253,84 @@ BUILD_ONE_CMD=\
 | 
			
		||||
reflect:
 | 
			
		||||
	@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
 | 
			
		||||
 | 
			
		||||
FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
 | 
			
		||||
	../crypto/aes/aes_ecb.o \
 | 
			
		||||
	../crypto/aes/aes_ofb.o \
 | 
			
		||||
	../crypto/bn/bn_add.o \
 | 
			
		||||
	../crypto/bn/bn_blind.o \
 | 
			
		||||
	../crypto/bn/bn_ctx.o \
 | 
			
		||||
	../crypto/bn/bn_div.o \
 | 
			
		||||
	../crypto/bn/bn_exp2.o \
 | 
			
		||||
	../crypto/bn/bn_exp.o \
 | 
			
		||||
	../crypto/bn/bn_gcd.o \
 | 
			
		||||
	../crypto/bn/bn_lib.o \
 | 
			
		||||
	../crypto/bn/bn_mod.o \
 | 
			
		||||
	../crypto/bn/bn_mont.o \
 | 
			
		||||
	../crypto/bn/bn_mul.o \
 | 
			
		||||
	../crypto/bn/bn_prime.o \
 | 
			
		||||
	../crypto/bn/bn_rand.o \
 | 
			
		||||
	../crypto/bn/bn_recp.o \
 | 
			
		||||
	../crypto/bn/bn_shift.o \
 | 
			
		||||
	../crypto/bn/bn_sqr.o \
 | 
			
		||||
	../crypto/bn/bn_word.o \
 | 
			
		||||
	../crypto/bn/bn_x931p.o \
 | 
			
		||||
	../crypto/buffer/buf_str.o \
 | 
			
		||||
	../crypto/cryptlib.o \
 | 
			
		||||
	../crypto/des/cfb64ede.o \
 | 
			
		||||
	../crypto/des/cfb64enc.o \
 | 
			
		||||
	../crypto/des/cfb_enc.o \
 | 
			
		||||
	../crypto/des/ecb3_enc.o \
 | 
			
		||||
	../crypto/des/ecb_enc.o \
 | 
			
		||||
	../crypto/des/ofb64ede.o \
 | 
			
		||||
	../crypto/des/ofb64enc.o \
 | 
			
		||||
	../crypto/des/fcrypt.o \
 | 
			
		||||
	../crypto/des/set_key.o \
 | 
			
		||||
	../crypto/dsa/dsa_utl.o \
 | 
			
		||||
	../crypto/dsa/dsa_sign.o \
 | 
			
		||||
	../crypto/dsa/dsa_vrf.o \
 | 
			
		||||
	../crypto/err/err.o \
 | 
			
		||||
	../crypto/evp/digest.o \
 | 
			
		||||
	../crypto/evp/enc_min.o \
 | 
			
		||||
	../crypto/evp/e_aes.o \
 | 
			
		||||
	../crypto/evp/e_des3.o \
 | 
			
		||||
	../crypto/evp/p_sign.o \
 | 
			
		||||
	../crypto/evp/p_verify.o \
 | 
			
		||||
	../crypto/mem_clr.o \
 | 
			
		||||
	../crypto/mem.o \
 | 
			
		||||
	../crypto/rand/md_rand.o \
 | 
			
		||||
	../crypto/rand/rand_egd.o \
 | 
			
		||||
	../crypto/rand/randfile.o \
 | 
			
		||||
	../crypto/rand/rand_lib.o \
 | 
			
		||||
	../crypto/rand/rand_os2.o \
 | 
			
		||||
	../crypto/rand/rand_unix.o \
 | 
			
		||||
	../crypto/rand/rand_win.o \
 | 
			
		||||
	../crypto/rsa/rsa_lib.o \
 | 
			
		||||
	../crypto/rsa/rsa_none.o \
 | 
			
		||||
	../crypto/rsa/rsa_oaep.o \
 | 
			
		||||
	../crypto/rsa/rsa_pk1.o \
 | 
			
		||||
	../crypto/rsa/rsa_pss.o \
 | 
			
		||||
	../crypto/rsa/rsa_ssl.o \
 | 
			
		||||
	../crypto/rsa/rsa_x931.o \
 | 
			
		||||
	../crypto/sha/sha1dgst.o \
 | 
			
		||||
	../crypto/sha/sha256.o \
 | 
			
		||||
	../crypto/sha/sha512.o \
 | 
			
		||||
	../crypto/uid.o
 | 
			
		||||
 | 
			
		||||
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_crypto build_fips build_ssl build_engines
 | 
			
		||||
 | 
			
		||||
build_crypto:
 | 
			
		||||
	@dir=crypto; target=all; $(BUILD_ONE_CMD)
 | 
			
		||||
	if [ -n "$(FIPSCANLIB)" ]; then \
 | 
			
		||||
		EXCL_OBJ='$(AES_ASM_OBJ) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
 | 
			
		||||
		ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
 | 
			
		||||
	else \
 | 
			
		||||
		ARX='${AR}' ; \
 | 
			
		||||
	fi ; export ARX ; \
 | 
			
		||||
		dir=crypto; target=all; $(BUILD_ONE_CMD)
 | 
			
		||||
build_fips:
 | 
			
		||||
	@dir=fips-1.0; target=all; $(BUILD_ONE_CMD)
 | 
			
		||||
build_ssl:
 | 
			
		||||
	@dir=ssl; target=all; $(BUILD_ONE_CMD)
 | 
			
		||||
build_engines:
 | 
			
		||||
@@ -244,22 +346,43 @@ all_testapps: build_libs build_testapps
 | 
			
		||||
build_testapps:
 | 
			
		||||
	@dir=crypto; target=testapps; $(BUILD_ONE_CMD)
 | 
			
		||||
 | 
			
		||||
libcrypto$(SHLIB_EXT): libcrypto.a
 | 
			
		||||
libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS)
 | 
			
		||||
	@if [ "$(SHLIB_TARGET)" != "" ]; then \
 | 
			
		||||
		$(MAKE) SHLIBDIRS=crypto build-shared; \
 | 
			
		||||
		if [ "$(FIPSCANLIB)" = "libfips" ]; then \
 | 
			
		||||
			( dir=fips-1.0; target=all; $(BUILD_ONE_CMD) ) ; \
 | 
			
		||||
			$(ARD) libcrypto.a fipscanister.o ; \
 | 
			
		||||
			$(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
 | 
			
		||||
			$(AR) libcrypto.a fips-1.0/fipscanister.o ; \
 | 
			
		||||
		else \
 | 
			
		||||
			$(MAKE) SHLIBDIRS='crypto' build-shared; \
 | 
			
		||||
		fi \
 | 
			
		||||
	else \
 | 
			
		||||
		echo "There's no support for shared libraries on this platform" >&2; \
 | 
			
		||||
		exit 1; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
 | 
			
		||||
	@if [ "$(SHLIB_TARGET)" != "" ]; then \
 | 
			
		||||
		$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		echo "There's no support for shared libraries on this platform" >&2; \
 | 
			
		||||
		echo "There's no support for shared libraries on this platform" >&2 ; \
 | 
			
		||||
		exit 1; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
libfips$(SHLIB_EXT): libfips.a
 | 
			
		||||
	@if [ "$(SHLIB_TARGET)" != "" ]; then \
 | 
			
		||||
		if [ "$(FIPSCANLIB)" = "libfips" ]; then \
 | 
			
		||||
			FIPSLD_CC=$(CC); CC=fips-1.0/fipsld; FIPSLD_NPT="y"; \
 | 
			
		||||
			FIPSLD_LIBFIPS=y; \
 | 
			
		||||
			export CC FIPSLD_CC FIPSLD_NPT FIPSLD_LIBFIPS; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		$(MAKE) -e SHLIBDIRS=fips build-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		echo "There's no support for shared libraries on this platform" >&2; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
libfips.a:
 | 
			
		||||
	dir=fips-1.0; target=all; $(BUILD_ONE_CMD)
 | 
			
		||||
 | 
			
		||||
clean-shared:
 | 
			
		||||
	@set -e; for i in $(SHLIBDIRS); do \
 | 
			
		||||
		if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
 | 
			
		||||
@@ -451,7 +574,7 @@ tar:
 | 
			
		||||
	$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
 | 
			
		||||
	tardy --user_number=0  --user_name=openssl \
 | 
			
		||||
	      --group_number=0 --group_name=openssl \
 | 
			
		||||
	      --prefix=openssl-$(VERSION) - |\
 | 
			
		||||
	      --prefix=openssl-fips-$(VERSION) - |\
 | 
			
		||||
	gzip --best >../$(TARFILE).gz; \
 | 
			
		||||
	rm -f ../$(TARFILE).list; \
 | 
			
		||||
	ls -l ../$(TARFILE).gz
 | 
			
		||||
 
 | 
			
		||||
@@ -236,24 +236,30 @@ link_o.cygwin:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	INHIBIT_SYMLINKS=yes; \
 | 
			
		||||
	SHLIB=cyg$(LIBNAME); \
 | 
			
		||||
	expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME)eay32; \
 | 
			
		||||
	base=-Wl,--enable-auto-image-base; \
 | 
			
		||||
	if expr $(PLATFORM) : 'mingw' > /dev/null; then \
 | 
			
		||||
		SHLIB=$(LIBNAME)eay32; base=; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	SHLIB_SUFFIX=.dll; \
 | 
			
		||||
	LIBVERSION="$(LIBVERSION)"; \
 | 
			
		||||
	SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
 | 
			
		||||
	ALLSYMSFLAGS='-Wl,--whole-archive'; \
 | 
			
		||||
	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
 | 
			
		||||
	$(LINK_SO_O)
 | 
			
		||||
link_a.cygwin:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	INHIBIT_SYMLINKS=yes; \
 | 
			
		||||
	SHLIB=cyg$(LIBNAME); \
 | 
			
		||||
	expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME)eay32; \
 | 
			
		||||
	base=-Wl,--enable-auto-image-base; \
 | 
			
		||||
	if expr $(PLATFORM) : 'mingw' > /dev/null; then \
 | 
			
		||||
		SHLIB=$(LIBNAME)eay32; \
 | 
			
		||||
		base=;  [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	SHLIB_SUFFIX=.dll; \
 | 
			
		||||
	SHLIB_SOVER=-$(LIBVERSION); \
 | 
			
		||||
	ALLSYMSFLAGS='-Wl,--whole-archive'; \
 | 
			
		||||
	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
 | 
			
		||||
	base=;  [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
 | 
			
		||||
	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
 | 
			
		||||
	[ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \
 | 
			
		||||
	[ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \
 | 
			
		||||
@@ -485,26 +491,26 @@ link_app.hpux:
 | 
			
		||||
 | 
			
		||||
link_o.aix:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]\([0-9]*\)'`; \
 | 
			
		||||
	OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]*\(64\)'` || :; \
 | 
			
		||||
	OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	ALLSYMSFLAGS='-bnogc'; \
 | 
			
		||||
	ALLSYMSFLAGS=''; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE'; \
 | 
			
		||||
	$(LINK_SO_O); rm -rf lib$(LIBNAME).exp
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-G,-bexpall,-bnolibpath,-bM:SRE'; \
 | 
			
		||||
	$(LINK_SO_O);
 | 
			
		||||
link_a.aix:
 | 
			
		||||
	@ $(CALC_VERSIONS); \
 | 
			
		||||
	OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]\([0-9]*\)'`; \
 | 
			
		||||
	OBJECT_MODE=`expr x$(SHARED_LDFLAGS) : 'x\-[a-z]*\(64\)'` || : ; \
 | 
			
		||||
	OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
 | 
			
		||||
	SHLIB=lib$(LIBNAME).so; \
 | 
			
		||||
	SHLIB_SUFFIX=; \
 | 
			
		||||
	ALLSYMSFLAGS='-bnogc'; \
 | 
			
		||||
	NOALLSYMSFLAGS=''; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -G -bE:lib$(LIBNAME).exp -bM:SRE'; \
 | 
			
		||||
	SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-G,-bexpall,-bnolibpath,-bM:SRE'; \
 | 
			
		||||
	$(LINK_SO_A_VIA_O)
 | 
			
		||||
link_app.aix:
 | 
			
		||||
	LDFLAGS="$(CFLAGS) -blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
 | 
			
		||||
	LDFLAGS="$(CFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
 | 
			
		||||
	$(LINK_APP)
 | 
			
		||||
 | 
			
		||||
link_o.reliantunix:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								NEWS
									
									
									
									
									
								
							@@ -5,7 +5,12 @@
 | 
			
		||||
  This file gives a brief overview of the major changes between each OpenSSL
 | 
			
		||||
  release. For more details please read the CHANGES file.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.8d:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e:
 | 
			
		||||
 | 
			
		||||
      o Various ciphersuite selection fixes.
 | 
			
		||||
      o RFC3779 support.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d:
 | 
			
		||||
 | 
			
		||||
      o Introduce limits to prevent malicious key DoS  (CVE-2006-2940)
 | 
			
		||||
      o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
 | 
			
		||||
@@ -105,6 +110,11 @@
 | 
			
		||||
      o Added initial support for Win64.
 | 
			
		||||
      o Added alternate pkg-config files.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l:
 | 
			
		||||
 | 
			
		||||
      o Introduce limits to prevent malicious key DoS  (CVE-2006-2940)
 | 
			
		||||
      o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k:
 | 
			
		||||
 | 
			
		||||
      o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										23
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								README
									
									
									
									
									
								
							@@ -1,10 +1,16 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 0.9.8d 28 Sep 2006
 | 
			
		||||
 OpenSSL 0.9.8f-fips-dev test version
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2006 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1998-2007 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 | 
			
		||||
 WARNING
 | 
			
		||||
 -------
 | 
			
		||||
 | 
			
		||||
 This version of OpenSSL is an initial port of the FIPS 140-2 code to OpenSSL
 | 
			
		||||
 0.9.8. See the file README.FIPS for brief usage details.
 | 
			
		||||
 | 
			
		||||
 DESCRIPTION
 | 
			
		||||
 -----------
 | 
			
		||||
 | 
			
		||||
@@ -36,12 +42,13 @@
 | 
			
		||||
     actually logically part of it. It includes routines for the following:
 | 
			
		||||
 | 
			
		||||
     Ciphers
 | 
			
		||||
        libdes - EAY's libdes DES encryption package which has been floating
 | 
			
		||||
                 around the net for a few years.  It includes 15
 | 
			
		||||
                 'modes/variations' of DES (1, 2 and 3 key versions of ecb,
 | 
			
		||||
                 cbc, cfb and ofb; pcbc and a more general form of cfb and
 | 
			
		||||
                 ofb) including desx in cbc mode, a fast crypt(3), and
 | 
			
		||||
                 routines to read passwords from the keyboard.
 | 
			
		||||
        libdes - EAY's libdes DES encryption package which was floating
 | 
			
		||||
                 around the net for a few years, and was then relicensed by
 | 
			
		||||
                 him as part of SSLeay.  It includes 15 'modes/variations'
 | 
			
		||||
                 of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb;
 | 
			
		||||
                 pcbc and a more general form of cfb and ofb) including desx
 | 
			
		||||
                 in cbc mode, a fast crypt(3), and routines to read
 | 
			
		||||
                 passwords from the keyboard.
 | 
			
		||||
        RC4 encryption,
 | 
			
		||||
        RC2 encryption      - 4 different modes, ecb, cbc, cfb and ofb.
 | 
			
		||||
        Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										35
									
								
								README.FIPS
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								README.FIPS
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
 | 
			
		||||
Brief instructions on using OpenSSL 0.9.8 FIPS test branch.
 | 
			
		||||
 | 
			
		||||
To avoid any confusion that this might generate a validate library just
 | 
			
		||||
supplying "fips" on the command line wont work. Additional options are
 | 
			
		||||
needed...
 | 
			
		||||
 | 
			
		||||
To build fipscanister and produce a usable distribution the configuration
 | 
			
		||||
option "fipscanisterbuild" is used to either the config or Configure scripts.
 | 
			
		||||
For example:
 | 
			
		||||
 | 
			
		||||
./config fipscanisterbuild
 | 
			
		||||
 | 
			
		||||
This builds static libraries in a way similar to the FIPS 1.1.1 distro.
 | 
			
		||||
 | 
			
		||||
To build the shared library fipscanister version use the configuration
 | 
			
		||||
options "fipsdso".
 | 
			
		||||
 | 
			
		||||
Note that the fipscanister.o file is totally incompatible with the version
 | 
			
		||||
produced by the FIPS 1.1.1 distribution and cannot be made to work with
 | 
			
		||||
it.
 | 
			
		||||
 | 
			
		||||
Both options should also work under Windows and VC++. With this version the
 | 
			
		||||
use of MinGW is unnecessary and the normal VC++ build procedure can be
 | 
			
		||||
followed *except* the GNU linker "ld.exe" (for example from MinGW) must be
 | 
			
		||||
accessible somewhere on the PATH. For example:
 | 
			
		||||
 | 
			
		||||
perl Configure VC-WIN32 fipsdso
 | 
			
		||||
ms\do_masm
 | 
			
		||||
nmake -f ms\ntdll.mak
 | 
			
		||||
 | 
			
		||||
Note that any warnings from a Windows version of "tar" about being unable to
 | 
			
		||||
create symbolic links can be ignored.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								STATUS
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								STATUS
									
									
									
									
									
								
							@@ -1,15 +1,17 @@
 | 
			
		||||
 | 
			
		||||
  OpenSSL STATUS                           Last modified at
 | 
			
		||||
  ______________                           $Date: 2006/09/28 11:32:41 $
 | 
			
		||||
  ______________                           $Date: 2007/02/23 12:12:27 $
 | 
			
		||||
 | 
			
		||||
  DEVELOPMENT STATE
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL 0.9.9:  Under development...
 | 
			
		||||
    o  OpenSSL 0.9.8e: Released on February  23rd, 2007
 | 
			
		||||
    o  OpenSSL 0.9.8d: Released on September 28th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.8c: Released on September  5th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.8b: Released on May        4th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.8a: Released on October   11th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.8:  Released on July       5th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7m: Released on February  23rd, 2007
 | 
			
		||||
    o  OpenSSL 0.9.7l: Released on September 28th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.7k: Released on September  5th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.7j: Released on May        4th, 2006
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										26
									
								
								TABLE
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								TABLE
									
									
									
									
									
								
							@@ -677,7 +677,7 @@ $arflags      =
 | 
			
		||||
 | 
			
		||||
*** aix-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -q32 -O -DB_ENDIAN -qmaxmem=16384
 | 
			
		||||
$cflags       = -q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -qthreaded
 | 
			
		||||
$sys_id       = AIX
 | 
			
		||||
@@ -722,12 +722,12 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_target= aix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$arflags      = -X 32
 | 
			
		||||
 | 
			
		||||
*** aix3-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
@@ -758,9 +758,9 @@ $arflags      =
 | 
			
		||||
 | 
			
		||||
*** aix64-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -q64 -O -DB_ENDIAN -qmaxmem=16384
 | 
			
		||||
$cflags       = -q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$thread_cflag = -qthreaded
 | 
			
		||||
$sys_id       = AIX
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHAR
 | 
			
		||||
@@ -785,7 +785,7 @@ $arflags      = -X 64
 | 
			
		||||
 | 
			
		||||
*** aix64-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O -DB_ENDIAN
 | 
			
		||||
$cflags       = -maix64 -O -DB_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_THREAD_SAFE
 | 
			
		||||
$sys_id       = AIX
 | 
			
		||||
@@ -803,10 +803,10 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_target= aix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_ldflag = -maix64
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = -X64
 | 
			
		||||
 | 
			
		||||
@@ -1649,7 +1649,7 @@ $arflags      =
 | 
			
		||||
 | 
			
		||||
*** debug-steve
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -march=i486 -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe
 | 
			
		||||
$cflags       = -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -m32 -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2810,7 +2810,7 @@ $arflags      =
 | 
			
		||||
 | 
			
		||||
*** linux-ppc64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -bpowerpc64-linux -DB_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$cflags       = -m64 -DB_ENDIAN -DTERMIO -O3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2830,7 +2830,7 @@ $rc5_obj      =
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= linux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = -bpowerpc64-linux
 | 
			
		||||
$shared_ldflag = -m64
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										903
									
								
								apps/Makefile
									
									
									
									
									
								
							
							
						
						
									
										903
									
								
								apps/Makefile
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -146,9 +146,11 @@ int WIN32_rename(const char *oldname,const char *newname);
 | 
			
		||||
#ifndef NON_MAIN
 | 
			
		||||
CONF *config=NULL;
 | 
			
		||||
BIO *bio_err=NULL;
 | 
			
		||||
int in_FIPS_mode=0;
 | 
			
		||||
#else
 | 
			
		||||
extern CONF *config;
 | 
			
		||||
extern BIO *bio_err;
 | 
			
		||||
extern int in_FIPS_mode;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
@@ -157,6 +159,7 @@ extern BIO *bio_err;
 | 
			
		||||
extern CONF *config;
 | 
			
		||||
extern char *default_config_file;
 | 
			
		||||
extern BIO *bio_err;
 | 
			
		||||
extern int in_FIPS_mode;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1520,6 +1520,7 @@ err:
 | 
			
		||||
	if (x509) X509_free(x509);
 | 
			
		||||
	X509_CRL_free(crl);
 | 
			
		||||
	NCONF_free(conf);
 | 
			
		||||
	NCONF_free(extconf);
 | 
			
		||||
	OBJ_cleanup();
 | 
			
		||||
	apps_shutdown();
 | 
			
		||||
	OPENSSL_EXIT(ret);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										89
									
								
								apps/dgst.c
									
									
									
									
									
								
							
							
						
						
									
										89
									
								
								apps/dgst.c
									
									
									
									
									
								
							@@ -66,6 +66,7 @@
 | 
			
		||||
#include <openssl/objects.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/hmac.h>
 | 
			
		||||
 | 
			
		||||
#undef BUFSIZE
 | 
			
		||||
#define BUFSIZE	1024*8
 | 
			
		||||
@@ -75,7 +76,7 @@
 | 
			
		||||
 | 
			
		||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
	  EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
 | 
			
		||||
	  const char *file);
 | 
			
		||||
	  const char *file,BIO *bmd,const char *hmac_key, int non_fips_allow);
 | 
			
		||||
 | 
			
		||||
int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
@@ -100,13 +101,16 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	EVP_PKEY *sigkey = NULL;
 | 
			
		||||
	unsigned char *sigbuf = NULL;
 | 
			
		||||
	int siglen = 0;
 | 
			
		||||
	unsigned int sig_flags = 0;
 | 
			
		||||
	char *passargin = NULL, *passin = NULL;
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	char *hmac_key=NULL;
 | 
			
		||||
	int non_fips_allow = 0;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
ERR_load_crypto_strings();
 | 
			
		||||
	if ((buf=(unsigned char *)OPENSSL_malloc(BUFSIZE)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err,"out of memory\n");
 | 
			
		||||
@@ -165,6 +169,27 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			keyfile=*(++argv);
 | 
			
		||||
			do_verify = 1;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-x931") == 0)
 | 
			
		||||
			sig_flags = EVP_MD_CTX_FLAG_PAD_X931;
 | 
			
		||||
		else if (strcmp(*argv,"-pss_saltlen") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			int saltlen;
 | 
			
		||||
			if (--argc < 1) break;
 | 
			
		||||
			saltlen=atoi(*(++argv));
 | 
			
		||||
			if (saltlen == -1)
 | 
			
		||||
				sig_flags = EVP_MD_CTX_FLAG_PSS_MREC;
 | 
			
		||||
			else if (saltlen == -2)
 | 
			
		||||
				sig_flags = EVP_MD_CTX_FLAG_PSS_MDLEN;
 | 
			
		||||
			else if (saltlen < -2 || saltlen >= 0xFFFE)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err, "Invalid PSS salt length %d\n", saltlen);
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				sig_flags = saltlen;
 | 
			
		||||
			sig_flags <<= 16;
 | 
			
		||||
			sig_flags |= EVP_MD_CTX_FLAG_PAD_PSS;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-signature") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) break;
 | 
			
		||||
@@ -188,6 +213,14 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			out_bin = 1;
 | 
			
		||||
		else if (strcmp(*argv,"-d") == 0)
 | 
			
		||||
			debug=1;
 | 
			
		||||
		else if (strcmp(*argv,"-non-fips-allow") == 0)
 | 
			
		||||
			non_fips_allow=1;
 | 
			
		||||
		else if (!strcmp(*argv,"-hmac"))
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1)
 | 
			
		||||
				break;
 | 
			
		||||
			hmac_key=*++argv;
 | 
			
		||||
			}
 | 
			
		||||
		else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
 | 
			
		||||
			md=m;
 | 
			
		||||
		else
 | 
			
		||||
@@ -261,7 +294,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_callback(in,BIO_debug_callback);
 | 
			
		||||
		/* needed for windows 3.1 */
 | 
			
		||||
		BIO_set_callback_arg(in,bio_err);
 | 
			
		||||
		BIO_set_callback_arg(in,(char *)bio_err);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, passargin, NULL, &passin, NULL))
 | 
			
		||||
@@ -341,8 +374,20 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
	if (non_fips_allow)
 | 
			
		||||
		{
 | 
			
		||||
		EVP_MD_CTX *md_ctx;
 | 
			
		||||
		BIO_get_md_ctx(bmd,&md_ctx);
 | 
			
		||||
		EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (sig_flags)
 | 
			
		||||
		{
 | 
			
		||||
		EVP_MD_CTX *md_ctx;
 | 
			
		||||
		BIO_get_md_ctx(bmd,&md_ctx);
 | 
			
		||||
		EVP_MD_CTX_set_flags(md_ctx, sig_flags);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/* we use md as a filter, reading from 'in' */
 | 
			
		||||
	if (!BIO_set_md(bmd,md))
 | 
			
		||||
@@ -358,7 +403,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(in,stdin,BIO_NOCLOSE);
 | 
			
		||||
		err=do_fp(out, buf,inp,separator, out_bin, sigkey, sigbuf,
 | 
			
		||||
			  siglen,"","(stdin)");
 | 
			
		||||
			  siglen,"","(stdin)",bmd,hmac_key,non_fips_allow);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
@@ -376,14 +421,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				}
 | 
			
		||||
			if(!out_bin)
 | 
			
		||||
				{
 | 
			
		||||
				size_t len = strlen(name)+strlen(argv[i])+5;
 | 
			
		||||
				size_t len = strlen(name)+strlen(argv[i])+(hmac_key ? 5 : 0)+5;
 | 
			
		||||
				tmp=tofree=OPENSSL_malloc(len);
 | 
			
		||||
				BIO_snprintf(tmp,len,"%s(%s)= ",name,argv[i]);
 | 
			
		||||
				BIO_snprintf(tmp,len,"%s%s(%s)= ",
 | 
			
		||||
							 hmac_key ? "HMAC-" : "",name,argv[i]);
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				tmp="";
 | 
			
		||||
			r=do_fp(out,buf,inp,separator,out_bin,sigkey,sigbuf,
 | 
			
		||||
				siglen,tmp,argv[i]);
 | 
			
		||||
				siglen,tmp,argv[i],bmd,hmac_key,non_fips_allow);
 | 
			
		||||
			if(r)
 | 
			
		||||
			    err=r;
 | 
			
		||||
			if(tofree)
 | 
			
		||||
@@ -410,11 +456,23 @@ end:
 | 
			
		||||
 | 
			
		||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
	  EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
 | 
			
		||||
	  const char *file)
 | 
			
		||||
	  const char *file,BIO *bmd,const char *hmac_key,int non_fips_allow)
 | 
			
		||||
	{
 | 
			
		||||
	int len;
 | 
			
		||||
	unsigned int len;
 | 
			
		||||
	int i;
 | 
			
		||||
	EVP_MD_CTX *md_ctx;
 | 
			
		||||
	HMAC_CTX hmac_ctx;
 | 
			
		||||
 | 
			
		||||
	if (hmac_key)
 | 
			
		||||
		{
 | 
			
		||||
		EVP_MD *md;
 | 
			
		||||
 | 
			
		||||
		BIO_get_md(bmd,&md);
 | 
			
		||||
		HMAC_CTX_init(&hmac_ctx);
 | 
			
		||||
		HMAC_Init_ex(&hmac_ctx,hmac_key,strlen(hmac_key),md, NULL);
 | 
			
		||||
		BIO_get_md_ctx(bmd,&md_ctx);
 | 
			
		||||
		BIO_set_md_ctx(bmd,&hmac_ctx.md_ctx);
 | 
			
		||||
		}
 | 
			
		||||
	for (;;)
 | 
			
		||||
		{
 | 
			
		||||
		i=BIO_read(bp,(char *)buf,BUFSIZE);
 | 
			
		||||
@@ -457,6 +515,11 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
			return 1;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	else if(hmac_key)
 | 
			
		||||
		{
 | 
			
		||||
		HMAC_Final(&hmac_ctx,buf,&len);
 | 
			
		||||
		HMAC_CTX_cleanup(&hmac_ctx);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		len=BIO_gets(bp,(char *)buf,BUFSIZE);
 | 
			
		||||
 | 
			
		||||
@@ -464,7 +527,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
	else 
 | 
			
		||||
		{
 | 
			
		||||
		BIO_write(out,title,strlen(title));
 | 
			
		||||
		for (i=0; i<len; i++)
 | 
			
		||||
		for (i=0; i<(int)len; i++)
 | 
			
		||||
			{
 | 
			
		||||
			if (sep && (i != 0))
 | 
			
		||||
				BIO_printf(out, ":");
 | 
			
		||||
@@ -472,6 +535,10 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(out, "\n");
 | 
			
		||||
		}
 | 
			
		||||
	if (hmac_key)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_md_ctx(bmd,md_ctx);
 | 
			
		||||
		}
 | 
			
		||||
	return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -87,6 +87,7 @@
 | 
			
		||||
 * -camellia128 - encrypt output if PEM format
 | 
			
		||||
 * -camellia192 - encrypt output if PEM format
 | 
			
		||||
 * -camellia256 - encrypt output if PEM format
 | 
			
		||||
 * -seed        - encrypt output if PEM format
 | 
			
		||||
 * -text	- print a text version
 | 
			
		||||
 * -modulus	- print the DSA public key
 | 
			
		||||
 */
 | 
			
		||||
@@ -218,6 +219,9 @@ bad:
 | 
			
		||||
#ifndef OPENSSL_NO_CAMELLIA
 | 
			
		||||
		BIO_printf(bio_err," -camellia128, -camellia192, -camellia256\n");
 | 
			
		||||
		BIO_printf(bio_err,"                 encrypt PEM output with cbc camellia\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		BIO_printf(bio_err," -seed           encrypt PEM output with cbc seed\n");
 | 
			
		||||
#endif
 | 
			
		||||
		BIO_printf(bio_err," -text           print the key in text\n");
 | 
			
		||||
		BIO_printf(bio_err," -noout          don't print key out\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -347,7 +347,10 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
	if (noout) 
 | 
			
		||||
		{
 | 
			
		||||
		ret = 0;
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	BIO_printf(bio_err, "writing EC key\n");
 | 
			
		||||
	if (outformat == FORMAT_ASN1) 
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								apps/enc.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								apps/enc.c
									
									
									
									
									
								
							@@ -127,6 +127,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	char *engine = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	const EVP_MD *dgst=NULL;
 | 
			
		||||
	int non_fips_allow = 0;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -261,6 +262,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			md= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-non-fips-allow") == 0)
 | 
			
		||||
			non_fips_allow = 1;
 | 
			
		||||
		else if	((argv[0][0] == '-') &&
 | 
			
		||||
			((c=EVP_get_cipherbyname(&(argv[0][1]))) != NULL))
 | 
			
		||||
			{
 | 
			
		||||
@@ -314,7 +317,10 @@ bad:
 | 
			
		||||
 | 
			
		||||
	if (dgst == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		dgst = EVP_md5();
 | 
			
		||||
		if (in_FIPS_mode)
 | 
			
		||||
			dgst = EVP_sha1();
 | 
			
		||||
		else
 | 
			
		||||
			dgst = EVP_md5();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (bufsize != NULL)
 | 
			
		||||
@@ -365,8 +371,8 @@ bad:
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_callback(in,BIO_debug_callback);
 | 
			
		||||
		BIO_set_callback(out,BIO_debug_callback);
 | 
			
		||||
		BIO_set_callback_arg(in,bio_err);
 | 
			
		||||
		BIO_set_callback_arg(out,bio_err);
 | 
			
		||||
		BIO_set_callback_arg(in,(char *)bio_err);
 | 
			
		||||
		BIO_set_callback_arg(out,(char *)bio_err);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (inf == NULL)
 | 
			
		||||
@@ -453,7 +459,7 @@ bad:
 | 
			
		||||
		if (debug)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_set_callback(b64,BIO_debug_callback);
 | 
			
		||||
			BIO_set_callback_arg(b64,bio_err);
 | 
			
		||||
			BIO_set_callback_arg(b64,(char *)bio_err);
 | 
			
		||||
			}
 | 
			
		||||
		if (olb64)
 | 
			
		||||
			BIO_set_flags(b64,BIO_FLAGS_BASE64_NO_NL);
 | 
			
		||||
@@ -549,6 +555,11 @@ bad:
 | 
			
		||||
		 */
 | 
			
		||||
 | 
			
		||||
		BIO_get_cipher_ctx(benc, &ctx);
 | 
			
		||||
 | 
			
		||||
		if (non_fips_allow)
 | 
			
		||||
			EVP_CIPHER_CTX_set_flags(ctx,
 | 
			
		||||
				EVP_CIPH_FLAG_NON_FIPS_ALLOW);
 | 
			
		||||
 | 
			
		||||
		if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err, "Error setting cipher %s\n",
 | 
			
		||||
@@ -571,7 +582,7 @@ bad:
 | 
			
		||||
		if (debug)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_set_callback(benc,BIO_debug_callback);
 | 
			
		||||
			BIO_set_callback_arg(benc,bio_err);
 | 
			
		||||
			BIO_set_callback_arg(benc,(char *)bio_err);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (printkey)
 | 
			
		||||
 
 | 
			
		||||
@@ -140,6 +140,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		else if (strcmp(*argv,"-idea") == 0)
 | 
			
		||||
			enc=EVP_idea_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		else if (strcmp(*argv,"-seed") == 0)
 | 
			
		||||
			enc=EVP_seed_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
		else if (strcmp(*argv,"-aes128") == 0)
 | 
			
		||||
			enc=EVP_aes_128_cbc();
 | 
			
		||||
@@ -178,6 +182,10 @@ bad:
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
		BIO_printf(bio_err," -idea     - encrypt the generated key with IDEA in cbc mode\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		BIO_printf(bio_err," -seed\n");
 | 
			
		||||
		BIO_printf(bio_err,"                 encrypt PEM output with cbc seed\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
		BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
 | 
			
		||||
		BIO_printf(bio_err,"                 encrypt PEM output with cbc aes\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -95,6 +95,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	int i,num=DEFBITS;
 | 
			
		||||
	long l;
 | 
			
		||||
	int use_x931 = 0;
 | 
			
		||||
	const EVP_CIPHER *enc=NULL;
 | 
			
		||||
	unsigned long f4=RSA_F4;
 | 
			
		||||
	char *outfile=NULL;
 | 
			
		||||
@@ -138,6 +139,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			f4=3;
 | 
			
		||||
		else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
 | 
			
		||||
			f4=RSA_F4;
 | 
			
		||||
		else if (strcmp(*argv,"-x931") == 0)
 | 
			
		||||
			use_x931 = 1;
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
@@ -160,6 +163,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		else if (strcmp(*argv,"-idea") == 0)
 | 
			
		||||
			enc=EVP_idea_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		else if (strcmp(*argv,"-seed") == 0)
 | 
			
		||||
			enc=EVP_seed_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
		else if (strcmp(*argv,"-aes128") == 0)
 | 
			
		||||
			enc=EVP_aes_128_cbc();
 | 
			
		||||
@@ -195,6 +202,10 @@ bad:
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
		BIO_printf(bio_err," -idea           encrypt the generated key with IDEA in cbc mode\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		BIO_printf(bio_err," -seed\n");
 | 
			
		||||
		BIO_printf(bio_err,"                 encrypt PEM output with cbc seed\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
		BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
 | 
			
		||||
		BIO_printf(bio_err,"                 encrypt PEM output with cbc aes\n");
 | 
			
		||||
@@ -258,7 +269,17 @@ bad:
 | 
			
		||||
	BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
 | 
			
		||||
		num);
 | 
			
		||||
 | 
			
		||||
	if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
 | 
			
		||||
	if (use_x931)
 | 
			
		||||
		{
 | 
			
		||||
		BIGNUM *pubexp;
 | 
			
		||||
		pubexp = BN_new();
 | 
			
		||||
		if (!BN_set_word(pubexp, f4))
 | 
			
		||||
			goto err;
 | 
			
		||||
		if (!RSA_X931_generate_key_ex(rsa, num, pubexp, &cb))
 | 
			
		||||
			goto err;
 | 
			
		||||
		BN_free(pubexp);
 | 
			
		||||
		}
 | 
			
		||||
	else if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
 | 
			
		||||
		goto err;
 | 
			
		||||
		
 | 
			
		||||
	app_RAND_write_file(NULL, bio_err);
 | 
			
		||||
 
 | 
			
		||||
@@ -143,26 +143,9 @@ $ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;DHPARAM;ENC;PASSWD;GENDH;ERRSTR;"+-
 | 
			
		||||
	      "X509;GENRSA;GENDSA;S_SERVER;S_CLIENT;SPEED;"+-
 | 
			
		||||
	      "S_TIME;APPS;S_CB;S_SOCKET;APP_RAND;VERSION;SESS_ID;"+-
 | 
			
		||||
	      "CIPHERS;NSEQ;PKCS12;PKCS8;SPKAC;SMIME;RAND;ENGINE;OCSP;PRIME"
 | 
			
		||||
$ APP_FILES := OPENSSL,'OBJ_DIR'VERIFY.OBJ,ASN1PARS.OBJ,REQ.OBJ,DGST.OBJ,DH.OBJ,DHPARAM.OBJ,ENC.OBJ,PASSWD.OBJ,GENDH.OBJ,ERRSTR.OBJ,-
 | 
			
		||||
	       CA.OBJ,PKCS7.OBJ,CRL2P7.OBJ,CRL.OBJ,-
 | 
			
		||||
	       RSA.OBJ,RSAUTL.OBJ,DSA.OBJ,DSAPARAM.OBJ,EC.OBJ,ECPARAM.OBJ,-
 | 
			
		||||
	       X509.OBJ,GENRSA.OBJ,GENDSA.OBJ,S_SERVER.OBJ,S_CLIENT.OBJ,SPEED.OBJ,-
 | 
			
		||||
	       S_TIME.OBJ,APPS.OBJ,S_CB.OBJ,S_SOCKET.OBJ,APP_RAND.OBJ,VERSION.OBJ,SESS_ID.OBJ,-
 | 
			
		||||
	       CIPHERS.OBJ,NSEQ.OBJ,PKCS12.OBJ,PKCS8.OBJ,SPKAC.OBJ,SMIME.OBJ,RAND.OBJ,ENGINE.OBJ,OCSP.OBJ,PRIME.OBJ
 | 
			
		||||
$ TCPIP_PROGRAMS = ",,"
 | 
			
		||||
$ IF COMPILER .EQS. "VAXC" THEN -
 | 
			
		||||
     TCPIP_PROGRAMS = ",OPENSSL,"
 | 
			
		||||
$!$ APP_FILES := VERIFY;ASN1PARS;REQ;DGST;DH;ENC;GENDH;ERRSTR;CA;-
 | 
			
		||||
$!	       PKCS7;CRL2P7;CRL;-
 | 
			
		||||
$!	       RSA;DSA;DSAPARAM;-
 | 
			
		||||
$!	       X509;GENRSA;GENDSA;-
 | 
			
		||||
$!	       S_SERVER,'OBJ_DIR'S_SOCKET.OBJ,'OBJ_DIR'S_CB.OBJ;-
 | 
			
		||||
$!	       S_CLIENT,'OBJ_DIR'S_SOCKET.OBJ,'OBJ_DIR'S_CB.OBJ;-
 | 
			
		||||
$!	       SPEED;-
 | 
			
		||||
$!	       S_TIME,'OBJ_DIR'S_CB.OBJ;VERSION;SESS_ID;CIPHERS;NSEQ
 | 
			
		||||
$!$ TCPIP_PROGRAMS = ",,"
 | 
			
		||||
$!$ IF COMPILER .EQS. "VAXC" THEN -
 | 
			
		||||
$!     TCPIP_PROGRAMS = ",S_SERVER,S_CLIENT,SESS_ID,CIPHERS,S_TIME,"
 | 
			
		||||
$!
 | 
			
		||||
$! Setup exceptional compilations
 | 
			
		||||
$!
 | 
			
		||||
 
 | 
			
		||||
@@ -139,6 +139,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	if (!load_config(bio_err, NULL))
 | 
			
		||||
		goto end;
 | 
			
		||||
	SSL_load_error_strings();
 | 
			
		||||
	OpenSSL_add_ssl_algorithms();
 | 
			
		||||
	args = argv + 1;
 | 
			
		||||
	reqnames = sk_new_null();
 | 
			
		||||
	ids = sk_OCSP_CERTID_new_null();
 | 
			
		||||
@@ -726,6 +727,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			BIO_printf(bio_err, "SSL is disabled\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
#endif
 | 
			
		||||
			if (ctx == NULL)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err, "Error creating SSL context.\n");
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
 | 
			
		||||
			sbio = BIO_new_ssl(ctx, 1);
 | 
			
		||||
			cbio = BIO_push(sbio, cbio);
 | 
			
		||||
@@ -1221,7 +1227,7 @@ static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp)
 | 
			
		||||
		return 0;
 | 
			
		||||
	BIO_printf(cbio, http_resp, i2d_OCSP_RESPONSE(resp, NULL));
 | 
			
		||||
	i2d_OCSP_RESPONSE_bio(cbio, resp);
 | 
			
		||||
	BIO_flush(cbio);
 | 
			
		||||
	(void)BIO_flush(cbio);
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,8 @@
 | 
			
		||||
HOME			= .
 | 
			
		||||
RANDFILE		= $ENV::HOME/.rnd
 | 
			
		||||
 | 
			
		||||
# Extra OBJECT IDENTIFIER info:
 | 
			
		||||
#oid_file		= $ENV::HOME/.oid
 | 
			
		||||
oid_section		= new_oids
 | 
			
		||||
# Uncomment out to enable OpenSSL configuration see config(3)
 | 
			
		||||
# openssl_conf = openssl_init
 | 
			
		||||
 | 
			
		||||
# To use this configuration file with the "-extfile" option of the
 | 
			
		||||
# "openssl x509" utility, name here the section containing the
 | 
			
		||||
@@ -19,13 +18,22 @@ oid_section		= new_oids
 | 
			
		||||
# (Alternatively, use a configuration file that has only
 | 
			
		||||
# X.509v3 extensions in its main [= default] section.)
 | 
			
		||||
 | 
			
		||||
[openssl_init]
 | 
			
		||||
# Extra OBJECT IDENTIFIER info:
 | 
			
		||||
oid_section = new_oids
 | 
			
		||||
alg_section = algs
 | 
			
		||||
 | 
			
		||||
[ new_oids ]
 | 
			
		||||
 | 
			
		||||
# We can add new OIDs in here for use by 'ca' and 'req'.
 | 
			
		||||
# We can add new OIDs in here for use by any config aware application
 | 
			
		||||
# Add a simple OID like this:
 | 
			
		||||
# testoid1=1.2.3.4
 | 
			
		||||
# shortname=Long Object Identifier Name, 1.2.3.4
 | 
			
		||||
# Or use config file substitution like this:
 | 
			
		||||
# testoid2=${testoid1}.5.6
 | 
			
		||||
# testoid2=OID2 LONG NAME, ${testoid1}.5.6, OTHER OID
 | 
			
		||||
 | 
			
		||||
[ algs ]
 | 
			
		||||
# Algorithm configuration options. Currently just fips_mode
 | 
			
		||||
fips_mode = no
 | 
			
		||||
 | 
			
		||||
####################################################################
 | 
			
		||||
[ ca ]
 | 
			
		||||
 
 | 
			
		||||
@@ -147,6 +147,7 @@ char *default_config_file=NULL;
 | 
			
		||||
#ifdef MONOLITH
 | 
			
		||||
CONF *config=NULL;
 | 
			
		||||
BIO *bio_err=NULL;
 | 
			
		||||
int in_FIPS_mode=0;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -232,6 +233,19 @@ int main(int Argc, char *Argv[])
 | 
			
		||||
	arg.data=NULL;
 | 
			
		||||
	arg.count=0;
 | 
			
		||||
 | 
			
		||||
	in_FIPS_mode = 0;
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
	if(getenv("OPENSSL_FIPS")) {
 | 
			
		||||
		if (!FIPS_mode_set(1)) {
 | 
			
		||||
			ERR_load_crypto_strings();
 | 
			
		||||
			ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
 | 
			
		||||
			EXIT(1);
 | 
			
		||||
		}
 | 
			
		||||
		in_FIPS_mode = 1;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (bio_err == NULL)
 | 
			
		||||
		if ((bio_err=BIO_new(BIO_s_file())) != NULL)
 | 
			
		||||
			BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,8 @@
 | 
			
		||||
HOME			= .
 | 
			
		||||
RANDFILE		= $ENV::HOME/.rnd
 | 
			
		||||
 | 
			
		||||
# Extra OBJECT IDENTIFIER info:
 | 
			
		||||
#oid_file		= $ENV::HOME/.oid
 | 
			
		||||
oid_section		= new_oids
 | 
			
		||||
# Uncomment out to enable OpenSSL configuration see config(3)
 | 
			
		||||
# openssl_conf = openssl_init
 | 
			
		||||
 | 
			
		||||
# To use this configuration file with the "-extfile" option of the
 | 
			
		||||
# "openssl x509" utility, name here the section containing the
 | 
			
		||||
@@ -19,13 +18,22 @@ oid_section		= new_oids
 | 
			
		||||
# (Alternatively, use a configuration file that has only
 | 
			
		||||
# X.509v3 extensions in its main [= default] section.)
 | 
			
		||||
 | 
			
		||||
[openssl_init]
 | 
			
		||||
# Extra OBJECT IDENTIFIER info:
 | 
			
		||||
oid_section = new_oids
 | 
			
		||||
alg_section = algs
 | 
			
		||||
 | 
			
		||||
[ new_oids ]
 | 
			
		||||
 | 
			
		||||
# We can add new OIDs in here for use by 'ca' and 'req'.
 | 
			
		||||
# We can add new OIDs in here for use by any config aware application
 | 
			
		||||
# Add a simple OID like this:
 | 
			
		||||
# testoid1=1.2.3.4
 | 
			
		||||
# shortname=Long Object Identifier Name, 1.2.3.4
 | 
			
		||||
# Or use config file substitution like this:
 | 
			
		||||
# testoid2=${testoid1}.5.6
 | 
			
		||||
# testoid2=OID2 LONG NAME, ${testoid1}.5.6, OTHER OID
 | 
			
		||||
 | 
			
		||||
[ algs ]
 | 
			
		||||
# Algorithm configuration options. Currently just fips_mode
 | 
			
		||||
fips_mode = no
 | 
			
		||||
 | 
			
		||||
####################################################################
 | 
			
		||||
[ ca ]
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    int maciter = PKCS12_DEFAULT_ITER;
 | 
			
		||||
    int twopass = 0;
 | 
			
		||||
    int keytype = 0;
 | 
			
		||||
    int cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
 | 
			
		||||
    int cert_pbe;
 | 
			
		||||
    int key_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
 | 
			
		||||
    int ret = 1;
 | 
			
		||||
    int macver = 1;
 | 
			
		||||
@@ -127,6 +127,13 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
    apps_startup();
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
    if (FIPS_mode())
 | 
			
		||||
	cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
 | 
			
		||||
    else
 | 
			
		||||
#endif
 | 
			
		||||
    cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
 | 
			
		||||
 | 
			
		||||
    enc = EVP_des_ede3_cbc();
 | 
			
		||||
    if (bio_err == NULL ) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
 | 
			
		||||
 | 
			
		||||
@@ -153,10 +160,13 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    			cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
 | 
			
		||||
		else if (!strcmp (*args, "-export")) export_cert = 1;
 | 
			
		||||
		else if (!strcmp (*args, "-des")) enc=EVP_des_cbc();
 | 
			
		||||
		else if (!strcmp (*args, "-des3")) enc = EVP_des_ede3_cbc();
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
		else if (!strcmp (*args, "-idea")) enc=EVP_idea_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
		else if (!strcmp (*args, "-des3")) enc = EVP_des_ede3_cbc();
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		else if (!strcmp(*args, "-seed")) enc=EVP_seed_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
		else if (!strcmp(*args,"-aes128")) enc=EVP_aes_128_cbc();
 | 
			
		||||
		else if (!strcmp(*args,"-aes192")) enc=EVP_aes_192_cbc();
 | 
			
		||||
@@ -306,6 +316,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
	BIO_printf (bio_err, "-idea         encrypt private keys with idea\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	BIO_printf (bio_err, "-seed         encrypt private keys with seed\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
	BIO_printf (bio_err, "-aes128, -aes192, -aes256\n");
 | 
			
		||||
	BIO_printf (bio_err, "              encrypt PEM output with cbc aes\n");
 | 
			
		||||
@@ -536,8 +549,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		    X509_free(sk_X509_value(chain2, 0));
 | 
			
		||||
		    sk_X509_free(chain2);
 | 
			
		||||
		} else {
 | 
			
		||||
			BIO_printf (bio_err, "Error %s getting chain.\n",
 | 
			
		||||
			if (vret >= 0)
 | 
			
		||||
				BIO_printf (bio_err, "Error %s getting chain.\n",
 | 
			
		||||
					X509_verify_cert_error_string(vret));
 | 
			
		||||
			else
 | 
			
		||||
				ERR_print_errors(bio_err);
 | 
			
		||||
			goto export_end;
 | 
			
		||||
		}			
 | 
			
		||||
    	}
 | 
			
		||||
@@ -811,7 +827,7 @@ int get_cert_chain (X509 *cert, X509_STORE *store, STACK_OF(X509) **chain)
 | 
			
		||||
{
 | 
			
		||||
	X509_STORE_CTX store_ctx;
 | 
			
		||||
	STACK_OF(X509) *chn;
 | 
			
		||||
	int i;
 | 
			
		||||
	int i = 0;
 | 
			
		||||
 | 
			
		||||
	/* FIXME: Should really check the return status of X509_STORE_CTX_init
 | 
			
		||||
	 * for an error, but how that fits into the return value of this
 | 
			
		||||
@@ -819,13 +835,17 @@ int get_cert_chain (X509 *cert, X509_STORE *store, STACK_OF(X509) **chain)
 | 
			
		||||
	X509_STORE_CTX_init(&store_ctx, store, cert, NULL);
 | 
			
		||||
	if (X509_verify_cert(&store_ctx) <= 0) {
 | 
			
		||||
		i = X509_STORE_CTX_get_error (&store_ctx);
 | 
			
		||||
		if (i == 0)
 | 
			
		||||
			/* avoid returning 0 if X509_verify_cert() did not
 | 
			
		||||
			 * set an appropriate error value in the context */
 | 
			
		||||
			i = -1;
 | 
			
		||||
		chn = NULL;
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	chn =  X509_STORE_CTX_get1_chain(&store_ctx);
 | 
			
		||||
	i = 0;
 | 
			
		||||
	*chain = chn;
 | 
			
		||||
	} else
 | 
			
		||||
		chn = X509_STORE_CTX_get1_chain(&store_ctx);
 | 
			
		||||
err:
 | 
			
		||||
	X509_STORE_CTX_cleanup(&store_ctx);
 | 
			
		||||
	*chain = chn;
 | 
			
		||||
	
 | 
			
		||||
	return i;
 | 
			
		||||
}	
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								apps/progs.h
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								apps/progs.h
									
									
									
									
									
								
							@@ -197,6 +197,9 @@ FUNCTION functions[] = {
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"idea",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"seed",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC4
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"rc4",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
@@ -263,6 +266,18 @@ FUNCTION functions[] = {
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"idea-ofb",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"seed-cbc",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"seed-ecb",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"seed-cfb",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"seed-ofb",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC2
 | 
			
		||||
	{FUNC_TYPE_CIPHER,"rc2-cbc",enc_main},
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -61,13 +61,14 @@ foreach (
 | 
			
		||||
	"camellia-192-cbc", "camellia-192-ecb",
 | 
			
		||||
	"camellia-256-cbc", "camellia-256-ecb",
 | 
			
		||||
	"base64",
 | 
			
		||||
	"des", "des3", "desx", "idea", "rc4", "rc4-40",
 | 
			
		||||
	"des", "des3", "desx", "idea", "seed", "rc4", "rc4-40",
 | 
			
		||||
	"rc2", "bf", "cast", "rc5",
 | 
			
		||||
	"des-ecb", "des-ede",    "des-ede3",
 | 
			
		||||
	"des-cbc", "des-ede-cbc","des-ede3-cbc",
 | 
			
		||||
	"des-cfb", "des-ede-cfb","des-ede3-cfb",
 | 
			
		||||
	"des-ofb", "des-ede-ofb","des-ede3-ofb",
 | 
			
		||||
	"idea-cbc","idea-ecb",   "idea-cfb", "idea-ofb",
 | 
			
		||||
	"idea-cbc","idea-ecb",    "idea-cfb", "idea-ofb",
 | 
			
		||||
	"seed-cbc","seed-ecb",    "seed-cfb", "seed-ofb",
 | 
			
		||||
	"rc2-cbc", "rc2-ecb", "rc2-cfb","rc2-ofb", "rc2-64-cbc", "rc2-40-cbc",
 | 
			
		||||
	"bf-cbc",  "bf-ecb",     "bf-cfb",   "bf-ofb",
 | 
			
		||||
	"cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb",
 | 
			
		||||
@@ -80,6 +81,7 @@ foreach (
 | 
			
		||||
	elsif ($_ =~ /aes/)  { $t="#ifndef OPENSSL_NO_AES\n${t}#endif\n"; }
 | 
			
		||||
	elsif ($_ =~ /camellia/)  { $t="#ifndef OPENSSL_NO_CAMELLIA\n${t}#endif\n"; }
 | 
			
		||||
	elsif ($_ =~ /idea/) { $t="#ifndef OPENSSL_NO_IDEA\n${t}#endif\n"; }
 | 
			
		||||
	elsif ($_ =~ /seed/) { $t="#ifndef OPENSSL_NO_SEED\n${t}#endif\n"; }
 | 
			
		||||
	elsif ($_ =~ /rc4/)  { $t="#ifndef OPENSSL_NO_RC4\n${t}#endif\n"; }
 | 
			
		||||
	elsif ($_ =~ /rc2/)  { $t="#ifndef OPENSSL_NO_RC2\n${t}#endif\n"; }
 | 
			
		||||
	elsif ($_ =~ /bf/)   { $t="#ifndef OPENSSL_NO_BF\n${t}#endif\n"; }
 | 
			
		||||
 
 | 
			
		||||
@@ -213,7 +213,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_write(out, buf, chunk);
 | 
			
		||||
		num -= chunk;
 | 
			
		||||
		}
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	app_RAND_write_file(NULL, bio_err);
 | 
			
		||||
	ret = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -81,6 +81,7 @@
 | 
			
		||||
 * -des		- encrypt output if PEM format with DES in cbc mode
 | 
			
		||||
 * -des3	- encrypt output if PEM format
 | 
			
		||||
 * -idea	- encrypt output if PEM format
 | 
			
		||||
 * -seed	- encrypt output if PEM format
 | 
			
		||||
 * -aes128	- encrypt output if PEM format
 | 
			
		||||
 * -aes192	- encrypt output if PEM format
 | 
			
		||||
 * -aes256	- encrypt output if PEM format
 | 
			
		||||
@@ -211,6 +212,9 @@ bad:
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
		BIO_printf(bio_err," -idea           encrypt PEM output with cbc idea\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		BIO_printf(bio_err," -seed           encrypt PEM output with cbc seed\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
		BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
 | 
			
		||||
		BIO_printf(bio_err,"                 encrypt PEM output with cbc aes\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -573,5 +573,5 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
 | 
			
		||||
			BIO_printf(bio, " ...");
 | 
			
		||||
		BIO_printf(bio, "\n");
 | 
			
		||||
		}
 | 
			
		||||
	BIO_flush(bio);
 | 
			
		||||
	(void)BIO_flush(bio);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										111
									
								
								apps/s_client.c
									
									
									
									
									
								
							
							
						
						
									
										111
									
								
								apps/s_client.c
									
									
									
									
									
								
							@@ -226,7 +226,7 @@ static void sc_usage(void)
 | 
			
		||||
	BIO_printf(bio_err," -starttls prot - use the STARTTLS command before starting TLS\n");
 | 
			
		||||
	BIO_printf(bio_err,"                 for those protocols that support it, where\n");
 | 
			
		||||
	BIO_printf(bio_err,"                 'prot' defines which one to assume.  Currently,\n");
 | 
			
		||||
	BIO_printf(bio_err,"                 only \"smtp\" and \"pop3\" are supported.\n");
 | 
			
		||||
	BIO_printf(bio_err,"                 only \"smtp\", \"pop3\", \"imap\", and \"ftp\" are supported.\n");
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	BIO_printf(bio_err," -engine id    - Initialise and use the specified engine\n");
 | 
			
		||||
#endif
 | 
			
		||||
@@ -234,6 +234,15 @@ static void sc_usage(void)
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
enum
 | 
			
		||||
{
 | 
			
		||||
	PROTO_OFF	= 0,
 | 
			
		||||
	PROTO_SMTP,
 | 
			
		||||
	PROTO_POP3,
 | 
			
		||||
	PROTO_IMAP,
 | 
			
		||||
	PROTO_FTP
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
@@ -260,7 +269,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
 | 
			
		||||
	SSL_CTX *ctx=NULL;
 | 
			
		||||
	int ret=1,in_init=1,i,nbio_test=0;
 | 
			
		||||
	int starttls_proto = 0;
 | 
			
		||||
	int starttls_proto = PROTO_OFF;
 | 
			
		||||
	int prexit = 0, vflags = 0;
 | 
			
		||||
	SSL_METHOD *meth=NULL;
 | 
			
		||||
#ifdef sock_type
 | 
			
		||||
@@ -269,6 +278,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int sock_type=SOCK_STREAM;
 | 
			
		||||
	BIO *sbio;
 | 
			
		||||
	char *inrand=NULL;
 | 
			
		||||
	int mbuf_len=0;
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	char *engine_id=NULL;
 | 
			
		||||
	ENGINE *e=NULL;
 | 
			
		||||
@@ -466,9 +476,13 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			++argv;
 | 
			
		||||
			if (strcmp(*argv,"smtp") == 0)
 | 
			
		||||
				starttls_proto = 1;
 | 
			
		||||
				starttls_proto = PROTO_SMTP;
 | 
			
		||||
			else if (strcmp(*argv,"pop3") == 0)
 | 
			
		||||
				starttls_proto = 2;
 | 
			
		||||
				starttls_proto = PROTO_POP3;
 | 
			
		||||
			else if (strcmp(*argv,"imap") == 0)
 | 
			
		||||
				starttls_proto = PROTO_IMAP;
 | 
			
		||||
			else if (strcmp(*argv,"ftp") == 0)
 | 
			
		||||
				starttls_proto = PROTO_FTP;
 | 
			
		||||
			else
 | 
			
		||||
				goto bad;
 | 
			
		||||
			}
 | 
			
		||||
@@ -654,7 +668,7 @@ re_start:
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		BIO_ctrl_set_connected(sbio, 1, &peer);
 | 
			
		||||
		(void)BIO_ctrl_set_connected(sbio, 1, &peer);
 | 
			
		||||
 | 
			
		||||
		if ( enable_timeouts)
 | 
			
		||||
			{
 | 
			
		||||
@@ -693,7 +707,7 @@ re_start:
 | 
			
		||||
		{
 | 
			
		||||
		con->debug=1;
 | 
			
		||||
		BIO_set_callback(sbio,bio_dump_callback);
 | 
			
		||||
		BIO_set_callback_arg(sbio,bio_c_out);
 | 
			
		||||
		BIO_set_callback_arg(sbio,(char *)bio_c_out);
 | 
			
		||||
		}
 | 
			
		||||
	if (c_msg)
 | 
			
		||||
		{
 | 
			
		||||
@@ -719,18 +733,93 @@ re_start:
 | 
			
		||||
	sbuf_off=0;
 | 
			
		||||
 | 
			
		||||
	/* This is an ugly hack that does a lot of assumptions */
 | 
			
		||||
	if (starttls_proto == 1)
 | 
			
		||||
	/* We do have to handle multi-line responses which may come
 | 
			
		||||
 	   in a single packet or not. We therefore have to use
 | 
			
		||||
	   BIO_gets() which does need a buffering BIO. So during
 | 
			
		||||
	   the initial chitchat we do push a buffering BIO into the
 | 
			
		||||
	   chain that is removed again later on to not disturb the
 | 
			
		||||
	   rest of the s_client operation. */
 | 
			
		||||
	if (starttls_proto == PROTO_SMTP)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_read(sbio,mbuf,BUFSIZZ);
 | 
			
		||||
		int foundit=0;
 | 
			
		||||
		BIO *fbio = BIO_new(BIO_f_buffer());
 | 
			
		||||
		BIO_push(fbio, sbio);
 | 
			
		||||
		/* wait for multi-line response to end from SMTP */
 | 
			
		||||
		do
 | 
			
		||||
			{
 | 
			
		||||
			mbuf_len = BIO_gets(fbio,mbuf,BUFSIZZ);
 | 
			
		||||
			}
 | 
			
		||||
		while (mbuf_len>3 && mbuf[3]=='-');
 | 
			
		||||
		/* STARTTLS command requires EHLO... */
 | 
			
		||||
		BIO_printf(fbio,"EHLO openssl.client.net\r\n");
 | 
			
		||||
		(void)BIO_flush(fbio);
 | 
			
		||||
		/* wait for multi-line response to end EHLO SMTP response */
 | 
			
		||||
		do
 | 
			
		||||
			{
 | 
			
		||||
			mbuf_len = BIO_gets(fbio,mbuf,BUFSIZZ);
 | 
			
		||||
			if (strstr(mbuf,"STARTTLS"))
 | 
			
		||||
				foundit=1;
 | 
			
		||||
			}
 | 
			
		||||
		while (mbuf_len>3 && mbuf[3]=='-');
 | 
			
		||||
		(void)BIO_flush(fbio);
 | 
			
		||||
		BIO_pop(fbio);
 | 
			
		||||
		BIO_free(fbio);
 | 
			
		||||
		if (!foundit)
 | 
			
		||||
			BIO_printf(bio_err,
 | 
			
		||||
				   "didn't found starttls in server response,"
 | 
			
		||||
				   " try anyway...\n");
 | 
			
		||||
		BIO_printf(sbio,"STARTTLS\r\n");
 | 
			
		||||
		BIO_read(sbio,sbuf,BUFSIZZ);
 | 
			
		||||
		}
 | 
			
		||||
	if (starttls_proto == 2)
 | 
			
		||||
	else if (starttls_proto == PROTO_POP3)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_read(sbio,mbuf,BUFSIZZ);
 | 
			
		||||
		BIO_printf(sbio,"STLS\r\n");
 | 
			
		||||
		BIO_read(sbio,sbuf,BUFSIZZ);
 | 
			
		||||
		}
 | 
			
		||||
	else if (starttls_proto == PROTO_IMAP)
 | 
			
		||||
		{
 | 
			
		||||
		int foundit=0;
 | 
			
		||||
		BIO *fbio = BIO_new(BIO_f_buffer());
 | 
			
		||||
		BIO_push(fbio, sbio);
 | 
			
		||||
		BIO_gets(fbio,mbuf,BUFSIZZ);
 | 
			
		||||
		/* STARTTLS command requires CAPABILITY... */
 | 
			
		||||
		BIO_printf(fbio,". CAPABILITY\r\n");
 | 
			
		||||
		(void)BIO_flush(fbio);
 | 
			
		||||
		/* wait for multi-line CAPABILITY response */
 | 
			
		||||
		do
 | 
			
		||||
			{
 | 
			
		||||
			mbuf_len = BIO_gets(fbio,mbuf,BUFSIZZ);
 | 
			
		||||
			if (strstr(mbuf,"STARTTLS"))
 | 
			
		||||
				foundit=1;
 | 
			
		||||
			}
 | 
			
		||||
		while (mbuf_len>3 && mbuf[0]!='.');
 | 
			
		||||
		(void)BIO_flush(fbio);
 | 
			
		||||
		BIO_pop(fbio);
 | 
			
		||||
		BIO_free(fbio);
 | 
			
		||||
		if (!foundit)
 | 
			
		||||
			BIO_printf(bio_err,
 | 
			
		||||
				   "didn't found STARTTLS in server response,"
 | 
			
		||||
				   " try anyway...\n");
 | 
			
		||||
		BIO_printf(sbio,". STARTTLS\r\n");
 | 
			
		||||
		BIO_read(sbio,sbuf,BUFSIZZ);
 | 
			
		||||
		}
 | 
			
		||||
	else if (starttls_proto == PROTO_FTP)
 | 
			
		||||
		{
 | 
			
		||||
		BIO *fbio = BIO_new(BIO_f_buffer());
 | 
			
		||||
		BIO_push(fbio, sbio);
 | 
			
		||||
		/* wait for multi-line response to end from FTP */
 | 
			
		||||
		do
 | 
			
		||||
			{
 | 
			
		||||
			mbuf_len = BIO_gets(fbio,mbuf,BUFSIZZ);
 | 
			
		||||
			}
 | 
			
		||||
		while (mbuf_len>3 && mbuf[3]=='-');
 | 
			
		||||
		(void)BIO_flush(fbio);
 | 
			
		||||
		BIO_pop(fbio);
 | 
			
		||||
		BIO_free(fbio);
 | 
			
		||||
		BIO_printf(sbio,"AUTH TLS\r\n");
 | 
			
		||||
		BIO_read(sbio,sbuf,BUFSIZZ);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	for (;;)
 | 
			
		||||
		{
 | 
			
		||||
@@ -755,7 +844,7 @@ re_start:
 | 
			
		||||
					{
 | 
			
		||||
					BIO_printf(bio_err,"%s",mbuf);
 | 
			
		||||
					/* We don't need to know any more */
 | 
			
		||||
					starttls_proto = 0;
 | 
			
		||||
					starttls_proto = PROTO_OFF;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				if (reconnect)
 | 
			
		||||
@@ -1214,6 +1303,6 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 | 
			
		||||
	if (peer != NULL)
 | 
			
		||||
		X509_free(peer);
 | 
			
		||||
	/* flush, or debugging output gets mixed with http response */
 | 
			
		||||
	BIO_flush(bio);
 | 
			
		||||
	(void)BIO_flush(bio);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1234,7 +1234,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
		{
 | 
			
		||||
		con->debug=1;
 | 
			
		||||
		BIO_set_callback(SSL_get_rbio(con),bio_dump_callback);
 | 
			
		||||
		BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
 | 
			
		||||
		BIO_set_callback_arg(SSL_get_rbio(con),(char *)bio_s_out);
 | 
			
		||||
		}
 | 
			
		||||
	if (s_msg)
 | 
			
		||||
		{
 | 
			
		||||
@@ -1638,7 +1638,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
		{
 | 
			
		||||
		con->debug=1;
 | 
			
		||||
		BIO_set_callback(SSL_get_rbio(con),bio_dump_callback);
 | 
			
		||||
		BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
 | 
			
		||||
		BIO_set_callback_arg(SSL_get_rbio(con),(char *)bio_s_out);
 | 
			
		||||
		}
 | 
			
		||||
	if (s_msg)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -145,6 +145,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		else if (!strcmp (*args, "-des")) 
 | 
			
		||||
				cipher = EVP_des_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		else if (!strcmp (*args, "-seed")) 
 | 
			
		||||
				cipher = EVP_seed_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC2
 | 
			
		||||
		else if (!strcmp (*args, "-rc2-40")) 
 | 
			
		||||
				cipher = EVP_rc2_40_cbc();
 | 
			
		||||
@@ -423,6 +427,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf (bio_err, "-des3          encrypt with triple DES\n");
 | 
			
		||||
		BIO_printf (bio_err, "-des           encrypt with DES\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		BIO_printf (bio_err, "-seed          encrypt with SEED\n");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC2
 | 
			
		||||
		BIO_printf (bio_err, "-rc2-40        encrypt with RC2-40 (default)\n");
 | 
			
		||||
		BIO_printf (bio_err, "-rc2-64        encrypt with RC2-64\n");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										138
									
								
								apps/speed.c
									
									
									
									
									
								
							
							
						
						
									
										138
									
								
								apps/speed.c
									
									
									
									
									
								
							@@ -201,6 +201,9 @@
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
#include <openssl/idea.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
#include <openssl/seed.h>
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_BF
 | 
			
		||||
#include <openssl/blowfish.h>
 | 
			
		||||
#endif
 | 
			
		||||
@@ -272,7 +275,7 @@ static void print_result(int alg,int run_no,int count,double time_used);
 | 
			
		||||
static int do_multi(int multi);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define ALGOR_NUM	24
 | 
			
		||||
#define ALGOR_NUM	28
 | 
			
		||||
#define SIZE_NUM	5
 | 
			
		||||
#define RSA_NUM		4
 | 
			
		||||
#define DSA_NUM		3
 | 
			
		||||
@@ -282,11 +285,12 @@ static int do_multi(int multi);
 | 
			
		||||
 | 
			
		||||
static const char *names[ALGOR_NUM]={
 | 
			
		||||
  "md2","mdc2","md4","md5","hmac(md5)","sha1","rmd160","rc4",
 | 
			
		||||
  "des cbc","des ede3","idea cbc",
 | 
			
		||||
  "des cbc","des ede3","idea cbc","seed cbc",
 | 
			
		||||
  "rc2 cbc","rc5-32/12 cbc","blowfish cbc","cast cbc",
 | 
			
		||||
  "aes-128 cbc","aes-192 cbc","aes-256 cbc",
 | 
			
		||||
  "camellia-128 cbc","camellia-192 cbc","camellia-256 cbc",
 | 
			
		||||
  "evp","sha256","sha512"};
 | 
			
		||||
  "evp","sha256","sha512",
 | 
			
		||||
  "aes-128 ige","aes-192 ige","aes-256 ige"};
 | 
			
		||||
static double results[ALGOR_NUM][SIZE_NUM];
 | 
			
		||||
static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
 | 
			
		||||
static double rsa_results[RSA_NUM][2];
 | 
			
		||||
@@ -533,6 +537,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
	IDEA_KEY_SCHEDULE idea_ks;
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	SEED_KEY_SCHEDULE seed_ks;
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_BF
 | 
			
		||||
	BF_KEY bf_ks;
 | 
			
		||||
#endif
 | 
			
		||||
@@ -597,19 +604,23 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#define	D_CBC_DES	8
 | 
			
		||||
#define	D_EDE3_DES	9
 | 
			
		||||
#define	D_CBC_IDEA	10
 | 
			
		||||
#define	D_CBC_RC2	11
 | 
			
		||||
#define	D_CBC_RC5	12
 | 
			
		||||
#define	D_CBC_BF	13
 | 
			
		||||
#define	D_CBC_CAST	14
 | 
			
		||||
#define D_CBC_128_AES	15
 | 
			
		||||
#define D_CBC_192_AES	16
 | 
			
		||||
#define D_CBC_256_AES	17
 | 
			
		||||
#define D_CBC_128_CML   18 
 | 
			
		||||
#define D_CBC_192_CML   19
 | 
			
		||||
#define D_CBC_256_CML   20 
 | 
			
		||||
#define D_EVP		21
 | 
			
		||||
#define D_SHA256	22	
 | 
			
		||||
#define D_SHA512	23
 | 
			
		||||
#define	D_CBC_SEED	11
 | 
			
		||||
#define	D_CBC_RC2	12
 | 
			
		||||
#define	D_CBC_RC5	13
 | 
			
		||||
#define	D_CBC_BF	14
 | 
			
		||||
#define	D_CBC_CAST	15
 | 
			
		||||
#define D_CBC_128_AES	16
 | 
			
		||||
#define D_CBC_192_AES	17
 | 
			
		||||
#define D_CBC_256_AES	18
 | 
			
		||||
#define D_CBC_128_CML   19 
 | 
			
		||||
#define D_CBC_192_CML   20
 | 
			
		||||
#define D_CBC_256_CML   21 
 | 
			
		||||
#define D_EVP		22
 | 
			
		||||
#define D_SHA256	23	
 | 
			
		||||
#define D_SHA512	24
 | 
			
		||||
#define D_IGE_128_AES   25
 | 
			
		||||
#define D_IGE_192_AES   26
 | 
			
		||||
#define D_IGE_256_AES   27
 | 
			
		||||
	double d=0.0;
 | 
			
		||||
	long c[ALGOR_NUM][SIZE_NUM];
 | 
			
		||||
#define	R_DSA_512	0
 | 
			
		||||
@@ -950,7 +961,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (strcmp(*argv,"aes-128-cbc") == 0) doit[D_CBC_128_AES]=1;
 | 
			
		||||
		else	if (strcmp(*argv,"aes-192-cbc") == 0) doit[D_CBC_192_AES]=1;
 | 
			
		||||
		else	if (strcmp(*argv,"aes-256-cbc") == 0) doit[D_CBC_256_AES]=1;
 | 
			
		||||
		else
 | 
			
		||||
		else    if (strcmp(*argv,"aes-128-ige") == 0) doit[D_IGE_128_AES]=1;
 | 
			
		||||
		else	if (strcmp(*argv,"aes-192-ige") == 0) doit[D_IGE_192_AES]=1;
 | 
			
		||||
		else	if (strcmp(*argv,"aes-256-ige") == 0) doit[D_IGE_256_AES]=1;
 | 
			
		||||
                else
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_CAMELLIA
 | 
			
		||||
			if (strcmp(*argv,"camellia-128-cbc") == 0) doit[D_CBC_128_CML]=1;
 | 
			
		||||
@@ -999,6 +1013,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		else if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1;
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
		     if (strcmp(*argv,"seed-cbc") == 0) doit[D_CBC_SEED]=1;
 | 
			
		||||
		else if (strcmp(*argv,"seed") == 0) doit[D_CBC_SEED]=1;
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_BF
 | 
			
		||||
		     if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1;
 | 
			
		||||
		else if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1;
 | 
			
		||||
@@ -1144,6 +1163,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
			BIO_printf(bio_err,"idea-cbc ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
			BIO_printf(bio_err,"seed-cbc ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC2
 | 
			
		||||
			BIO_printf(bio_err,"rc2-cbc  ");
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1153,7 +1175,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef OPENSSL_NO_BF
 | 
			
		||||
			BIO_printf(bio_err,"bf-cbc");
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_RC2) || \
 | 
			
		||||
#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || !defined(OPENSSL_NO_RC2) || \
 | 
			
		||||
    !defined(OPENSSL_NO_BF) || !defined(OPENSSL_NO_RC5)
 | 
			
		||||
			BIO_printf(bio_err,"\n");
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1162,6 +1184,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_AES
 | 
			
		||||
			BIO_printf(bio_err,"aes-128-cbc aes-192-cbc aes-256-cbc ");
 | 
			
		||||
			BIO_printf(bio_err,"aes-128-ige aes-192-ige aes-256-ige ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_CAMELLIA
 | 
			
		||||
			BIO_printf(bio_err,"\n");
 | 
			
		||||
@@ -1195,6 +1218,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
			BIO_printf(bio_err,"idea     ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
			BIO_printf(bio_err,"seed     ");
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC2
 | 
			
		||||
			BIO_printf(bio_err,"rc2      ");
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1213,10 +1239,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef OPENSSL_NO_BF
 | 
			
		||||
			BIO_printf(bio_err,"blowfish");
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_RC2) || \
 | 
			
		||||
    !defined(OPENSSL_NO_DES) || !defined(OPENSSL_NO_RSA) || \
 | 
			
		||||
    !defined(OPENSSL_NO_BF) || !defined(OPENSSL_NO_AES) || \
 | 
			
		||||
    !defined(OPENSSL_NO_CAMELLIA) 
 | 
			
		||||
#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || \
 | 
			
		||||
    !defined(OPENSSL_NO_RC2) || !defined(OPENSSL_NO_DES) || \
 | 
			
		||||
    !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_BF) || \
 | 
			
		||||
    !defined(OPENSSL_NO_AES) || !defined(OPENSSL_NO_CAMELLIA)
 | 
			
		||||
			BIO_printf(bio_err,"\n");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -1318,6 +1344,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef OPENSSL_NO_IDEA
 | 
			
		||||
	idea_set_encrypt_key(key16,&idea_ks);
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	SEED_set_key(key16,&seed_ks);
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC4
 | 
			
		||||
	RC4_set_key(&rc4_ks,16,key16);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1361,6 +1390,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	c[D_CBC_DES][0]=count;
 | 
			
		||||
	c[D_EDE3_DES][0]=count/3;
 | 
			
		||||
	c[D_CBC_IDEA][0]=count;
 | 
			
		||||
	c[D_CBC_SEED][0]=count;
 | 
			
		||||
	c[D_CBC_RC2][0]=count;
 | 
			
		||||
	c[D_CBC_RC5][0]=count;
 | 
			
		||||
	c[D_CBC_BF][0]=count;
 | 
			
		||||
@@ -1373,6 +1403,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	c[D_CBC_256_CML][0]=count;
 | 
			
		||||
	c[D_SHA256][0]=count;
 | 
			
		||||
	c[D_SHA512][0]=count;
 | 
			
		||||
	c[D_IGE_128_AES][0]=count;
 | 
			
		||||
	c[D_IGE_192_AES][0]=count;
 | 
			
		||||
	c[D_IGE_256_AES][0]=count;
 | 
			
		||||
 | 
			
		||||
	for (i=1; i<SIZE_NUM; i++)
 | 
			
		||||
		{
 | 
			
		||||
@@ -1396,6 +1429,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		c[D_CBC_DES][i]=c[D_CBC_DES][i-1]*l0/l1;
 | 
			
		||||
		c[D_EDE3_DES][i]=c[D_EDE3_DES][i-1]*l0/l1;
 | 
			
		||||
		c[D_CBC_IDEA][i]=c[D_CBC_IDEA][i-1]*l0/l1;
 | 
			
		||||
		c[D_CBC_SEED][i]=c[D_CBC_SEED][i-1]*l0/l1;
 | 
			
		||||
		c[D_CBC_RC2][i]=c[D_CBC_RC2][i-1]*l0/l1;
 | 
			
		||||
		c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;
 | 
			
		||||
		c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
 | 
			
		||||
@@ -1406,6 +1440,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 		c[D_CBC_128_CML][i]=c[D_CBC_128_CML][i-1]*l0/l1;
 | 
			
		||||
		c[D_CBC_192_CML][i]=c[D_CBC_192_CML][i-1]*l0/l1;
 | 
			
		||||
		c[D_CBC_256_CML][i]=c[D_CBC_256_CML][i-1]*l0/l1;
 | 
			
		||||
		c[D_IGE_128_AES][i]=c[D_IGE_128_AES][i-1]*l0/l1;
 | 
			
		||||
		c[D_IGE_192_AES][i]=c[D_IGE_192_AES][i-1]*l0/l1;
 | 
			
		||||
		c[D_IGE_256_AES][i]=c[D_IGE_256_AES][i-1]*l0/l1;
 | 
			
		||||
		}
 | 
			
		||||
#ifndef OPENSSL_NO_RSA
 | 
			
		||||
	rsa_c[R_RSA_512][0]=count/2000;
 | 
			
		||||
@@ -1799,6 +1836,48 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (doit[D_IGE_128_AES])
 | 
			
		||||
		{
 | 
			
		||||
		for (j=0; j<SIZE_NUM; j++)
 | 
			
		||||
			{
 | 
			
		||||
			print_message(names[D_IGE_128_AES],c[D_IGE_128_AES][j],lengths[j]);
 | 
			
		||||
			Time_F(START);
 | 
			
		||||
			for (count=0,run=1; COND(c[D_IGE_128_AES][j]); count++)
 | 
			
		||||
				AES_ige_encrypt(buf,buf2,
 | 
			
		||||
					(unsigned long)lengths[j],&aes_ks1,
 | 
			
		||||
					iv,AES_ENCRYPT);
 | 
			
		||||
			d=Time_F(STOP);
 | 
			
		||||
			print_result(D_IGE_128_AES,j,count,d);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	if (doit[D_IGE_192_AES])
 | 
			
		||||
		{
 | 
			
		||||
		for (j=0; j<SIZE_NUM; j++)
 | 
			
		||||
			{
 | 
			
		||||
			print_message(names[D_IGE_192_AES],c[D_IGE_192_AES][j],lengths[j]);
 | 
			
		||||
			Time_F(START);
 | 
			
		||||
			for (count=0,run=1; COND(c[D_IGE_192_AES][j]); count++)
 | 
			
		||||
				AES_ige_encrypt(buf,buf2,
 | 
			
		||||
					(unsigned long)lengths[j],&aes_ks2,
 | 
			
		||||
					iv,AES_ENCRYPT);
 | 
			
		||||
			d=Time_F(STOP);
 | 
			
		||||
			print_result(D_IGE_192_AES,j,count,d);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	if (doit[D_IGE_256_AES])
 | 
			
		||||
		{
 | 
			
		||||
		for (j=0; j<SIZE_NUM; j++)
 | 
			
		||||
			{
 | 
			
		||||
			print_message(names[D_IGE_256_AES],c[D_IGE_256_AES][j],lengths[j]);
 | 
			
		||||
			Time_F(START);
 | 
			
		||||
			for (count=0,run=1; COND(c[D_IGE_256_AES][j]); count++)
 | 
			
		||||
				AES_ige_encrypt(buf,buf2,
 | 
			
		||||
					(unsigned long)lengths[j],&aes_ks3,
 | 
			
		||||
					iv,AES_ENCRYPT);
 | 
			
		||||
			d=Time_F(STOP);
 | 
			
		||||
			print_result(D_IGE_256_AES,j,count,d);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_CAMELLIA
 | 
			
		||||
	if (doit[D_CBC_128_CML])
 | 
			
		||||
@@ -1861,6 +1940,21 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SEED
 | 
			
		||||
	if (doit[D_CBC_SEED])
 | 
			
		||||
		{
 | 
			
		||||
		for (j=0; j<SIZE_NUM; j++)
 | 
			
		||||
			{
 | 
			
		||||
			print_message(names[D_CBC_SEED],c[D_CBC_SEED][j],lengths[j]);
 | 
			
		||||
			Time_F(START);
 | 
			
		||||
			for (count=0,run=1; COND(c[D_CBC_SEED][j]); count++)
 | 
			
		||||
				SEED_cbc_encrypt(buf,buf,
 | 
			
		||||
					(unsigned long)lengths[j],&seed_ks,iv,1);
 | 
			
		||||
			d=Time_F(STOP);
 | 
			
		||||
			print_result(D_CBC_SEED,j,count,d);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_RC2
 | 
			
		||||
	if (doit[D_CBC_RC2])
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										22
									
								
								certs/aol1.pem
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								certs/aol1.pem
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
-----BEGIN CERTIFICATE-----
 | 
			
		||||
MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc
 | 
			
		||||
MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP
 | 
			
		||||
bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2
 | 
			
		||||
MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft
 | 
			
		||||
ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg
 | 
			
		||||
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP
 | 
			
		||||
ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk
 | 
			
		||||
hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym
 | 
			
		||||
1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW
 | 
			
		||||
OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb
 | 
			
		||||
2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko
 | 
			
		||||
O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw
 | 
			
		||||
AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU
 | 
			
		||||
AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB
 | 
			
		||||
BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF
 | 
			
		||||
Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb
 | 
			
		||||
LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir
 | 
			
		||||
oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C
 | 
			
		||||
MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds
 | 
			
		||||
sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7
 | 
			
		||||
-----END CERTIFICATE-----
 | 
			
		||||
							
								
								
									
										33
									
								
								certs/aol2.pem
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								certs/aol2.pem
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
-----BEGIN CERTIFICATE-----
 | 
			
		||||
MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc
 | 
			
		||||
MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP
 | 
			
		||||
bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2
 | 
			
		||||
MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft
 | 
			
		||||
ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg
 | 
			
		||||
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP
 | 
			
		||||
ADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC
 | 
			
		||||
206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci
 | 
			
		||||
KtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2
 | 
			
		||||
JxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9
 | 
			
		||||
BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e
 | 
			
		||||
Xz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B
 | 
			
		||||
PeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67
 | 
			
		||||
Xnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq
 | 
			
		||||
Z8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ
 | 
			
		||||
o2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3
 | 
			
		||||
+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj
 | 
			
		||||
YzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj
 | 
			
		||||
FNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE
 | 
			
		||||
AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn
 | 
			
		||||
xPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2
 | 
			
		||||
LHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc
 | 
			
		||||
obGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8
 | 
			
		||||
CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe
 | 
			
		||||
IjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA
 | 
			
		||||
DjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F
 | 
			
		||||
AjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX
 | 
			
		||||
Om/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb
 | 
			
		||||
AZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl
 | 
			
		||||
Zvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw
 | 
			
		||||
RY8mkaKO/qk=
 | 
			
		||||
-----END CERTIFICATE-----
 | 
			
		||||
							
								
								
									
										23
									
								
								certs/aoltw1.pem
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								certs/aoltw1.pem
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
-----BEGIN CERTIFICATE-----
 | 
			
		||||
MIID5jCCAs6gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMx
 | 
			
		||||
HTAbBgNVBAoTFEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNh
 | 
			
		||||
IE9ubGluZSBJbmMuMTcwNQYDVQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0
 | 
			
		||||
aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyOTA2MDAwMFoXDTM3MTEyMDE1
 | 
			
		||||
MDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wgVGltZSBXYXJuZXIg
 | 
			
		||||
SW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMuQU9M
 | 
			
		||||
IFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIw
 | 
			
		||||
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnej8Mlo2k06AX3dLm/WpcZuS+U
 | 
			
		||||
0pPlLYnKhHw/EEMbjIt8hFj4JHxIzyr9wBXZGH6EGhfT257XyuTZ16pYUYfw8ItI
 | 
			
		||||
TuLCxFlpMGK2MKKMCxGZYTVtfu/FsRkGIBKOQuHfD5YQUqjPnF+VFNivO3ULMSAf
 | 
			
		||||
RC+iYkGzuxgh28pxPIzstrkNn+9R7017EvILDOGsQI93f7DKeHEMXRZxcKLXwjqF
 | 
			
		||||
zQ6axOAAsNUl6twr5JQtOJyJQVdkKGUZHLZEtMgxa44Be3ZZJX8VHIQIfHNlIAqh
 | 
			
		||||
BC4aMqiaILGcLCFZ5/vP7nAtCMpjPiybkxlqpMKX/7eGV4iFbJ4VFitNLLMCAwEA
 | 
			
		||||
AaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUoTYwFsuGkABFgFOxj8jY
 | 
			
		||||
PXy+XxIwHwYDVR0jBBgwFoAUoTYwFsuGkABFgFOxj8jYPXy+XxIwDgYDVR0PAQH/
 | 
			
		||||
BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQCKIBilvrMvtKaEAEAwKfq0FHNMeUWn
 | 
			
		||||
9nDg6H5kHgqVfGphwu9OH77/yZkfB2FK4V1Mza3u0FIy2VkyvNp5ctZ7CegCgTXT
 | 
			
		||||
Ct8RHcl5oIBN/lrXVtbtDyqvpxh1MwzqwWEFT2qaifKNuZ8u77BfWgDrvq2g+EQF
 | 
			
		||||
Z7zLBO+eZMXpyD8Fv8YvBxzDNnGGyjhmSs3WuEvGbKeXO/oTLW4jYYehY0KswsuX
 | 
			
		||||
n2Fozy1MBJ3XJU8KDk2QixhWqJNIV9xvrr2eZ1d3iVCzvhGbRWeDhhmH05i9CBoW
 | 
			
		||||
H1iCC+GWaQVLjuyDUTEH1dSf/1l7qG6Fz9NLqUmwX7A5KGgOc90lmt4S
 | 
			
		||||
-----END CERTIFICATE-----
 | 
			
		||||
							
								
								
									
										34
									
								
								certs/aoltw2.pem
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								certs/aoltw2.pem
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
-----BEGIN CERTIFICATE-----
 | 
			
		||||
MIIF5jCCA86gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMx
 | 
			
		||||
HTAbBgNVBAoTFEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNh
 | 
			
		||||
IE9ubGluZSBJbmMuMTcwNQYDVQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0
 | 
			
		||||
aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyOTA2MDAwMFoXDTM3MDkyODIz
 | 
			
		||||
NDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wgVGltZSBXYXJuZXIg
 | 
			
		||||
SW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMuQU9M
 | 
			
		||||
IFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIw
 | 
			
		||||
DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALQ3WggWmRToVbEbJGv8x4vmh6mJ
 | 
			
		||||
7ouZzU9AhqS2TcnZsdw8TQ2FTBVsRotSeJ/4I/1n9SQ6aF3Q92RhQVSji6UI0ilb
 | 
			
		||||
m2BPJoPRYxJWSXakFsKlnUWsi4SVqBax7J/qJBrvuVdcmiQhLE0OcR+mrF1FdAOY
 | 
			
		||||
xFSMFkpBd4aVdQxHAWZg/BXxD+r1FHjHDtdugRxev17nOirYlxcwfACtCJ0zr7iZ
 | 
			
		||||
YYCLqJV+FNwSbKTQ2O9ASQI2+W6p1h2WVgSysy0WVoaP2SBXgM1nEG2wTPDaRrbq
 | 
			
		||||
JS5Gr42whTg0ixQmgiusrpkLjhTXUr2eacOGAgvqdnUxCc4zGSGFQ+aJLZ8lN2fx
 | 
			
		||||
I2rSAG2X+Z/nKcrdH9cG6rjJuQkhn8g/BsXS6RJGAE57COtCPStIbp1n3UsC5ETz
 | 
			
		||||
kxmlJ85per5n0/xQpCyrw2u544BMzwVhSyvcG7mm0tCq9Stz+86QNZ8MUhy/XCFh
 | 
			
		||||
EVsVS6kkUfykXPcXnbDS+gfpj1bkGoxoigTTfFrjnqKhynFbotSg5ymFXQNoKk/S
 | 
			
		||||
Btc9+cMDLz9l+WceR0DTYw/j1Y75hauXTLPXJuuWCpTehTacyH+BCQJJKg71ZDIM
 | 
			
		||||
gtG6aoIbs0t0EfOMd9afv9w3pKdVBC/UMejTRrkDfNoSTllkt1ExMVCgyhwn2RAu
 | 
			
		||||
rda9EGYrw7AiShJbAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
 | 
			
		||||
FE9pbQN+nZ8HGEO8txBO1b+pxCAoMB8GA1UdIwQYMBaAFE9pbQN+nZ8HGEO8txBO
 | 
			
		||||
1b+pxCAoMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAO/Ouyugu
 | 
			
		||||
h4X7ZVnnrREUpVe8WJ8kEle7+z802u6teio0cnAxa8cZmIDJgt43d15Ui47y6mdP
 | 
			
		||||
yXSEkVYJ1eV6moG2gcKtNuTxVBFT8zRFASbI5Rq8NEQh3q0l/HYWdyGQgJhXnU7q
 | 
			
		||||
7C+qPBR7V8F+GBRn7iTGvboVsNIYvbdVgaxTwOjdaRITQrcCtQVBynlQboIOcXKT
 | 
			
		||||
RuidDV29rs4prWPVVRaAMCf/drr3uNZK49m1+VLQTkCpx+XCMseqdiThawVQ68W/
 | 
			
		||||
ClTluUI8JPu3B5wwn3la5uBAUhX0/Kr0VvlEl4ftDmVyXr4m+02kLQgH3thcoNyB
 | 
			
		||||
M5kYJRF3p+v9WAksmWsbivNSPxpNSGDxoPYzAlOL7SUJuA0t7Zdz7NeWH45gDtoQ
 | 
			
		||||
my8YJPamTQr5O8t1wswvziRpyQoijlmn94IM19drNZxDAGrElWe6nEXLuA4399xO
 | 
			
		||||
AU++CrYD062KRffaJ00psUjf5BHklka9bAI+1lHIlRcBFanyqqryvy9lG2/QuRqT
 | 
			
		||||
9Y41xICHPpQvZuTpqP9BnHAqTyo5GJUefvthATxRCC4oGKQWDzH9OmwjkyB24f0H
 | 
			
		||||
hdFbP9IcczLd+rn4jM8Ch3qaluTtT4mNU0OrDhPAARW0eTjb/G49nlG2uBOLZ8/5
 | 
			
		||||
fNkiHfZdxRwBL5joeiQYvITX+txyW/fBOmg=
 | 
			
		||||
-----END CERTIFICATE-----
 | 
			
		||||
							
								
								
									
										20
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								config
									
									
									
									
									
								
							@@ -585,23 +585,27 @@ case "$GUESSOS" in
 | 
			
		||||
	OUT="linux-generic32" ;;
 | 
			
		||||
  arm*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
 | 
			
		||||
  arm*l-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
 | 
			
		||||
  s390*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
 | 
			
		||||
  sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
 | 
			
		||||
  sh*-*-linux2)  OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
 | 
			
		||||
  m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
 | 
			
		||||
  s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
 | 
			
		||||
  s390x-*-linux2) OUT="linux-generic64"; options="$options -DB_ENDIAN" ;;
 | 
			
		||||
  x86_64-*-linux?) OUT="linux-x86_64" ;;
 | 
			
		||||
  *86-*-linux2) OUT="linux-elf"
 | 
			
		||||
	if [ "$GCCVER" -gt 28 ]; then
 | 
			
		||||
          if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
 | 
			
		||||
	    options="$options -mcpu=pentium"
 | 
			
		||||
	    options="$options -march=pentium"
 | 
			
		||||
          fi
 | 
			
		||||
          if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
 | 
			
		||||
	    options="$options -mcpu=pentiumpro"
 | 
			
		||||
	    options="$options -march=pentiumpro"
 | 
			
		||||
          fi
 | 
			
		||||
          if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
 | 
			
		||||
	    options="$options -mcpu=k6"
 | 
			
		||||
	    options="$options -march=k6"
 | 
			
		||||
          fi
 | 
			
		||||
        fi ;;
 | 
			
		||||
  *-*-linux1) OUT="linux-aout" ;;
 | 
			
		||||
  *-*-linux2) OUT="linux-generic32" ;;
 | 
			
		||||
  sun4u*-*-solaris2)
 | 
			
		||||
  sun4[uv]*-*-solaris2)
 | 
			
		||||
	OUT="solaris-sparcv9-$CC"
 | 
			
		||||
	ISA64=`(isalist) 2>/dev/null | grep sparcv9`
 | 
			
		||||
	if [ "$ISA64" != "" ]; then
 | 
			
		||||
@@ -745,7 +749,7 @@ case "$GUESSOS" in
 | 
			
		||||
		fi
 | 
			
		||||
	    fi
 | 
			
		||||
	fi
 | 
			
		||||
	if (lsattr -E -O -l proc0 | grep -i powerpc) >/dev/null 2>&1; then
 | 
			
		||||
	if (lsattr -E -O -l `lsdev -c processor|awk '{print$1;exit}'` | grep -i powerpc) >/dev/null 2>&1; then
 | 
			
		||||
	    :	# this applies even to Power3 and later, as they return PowerPC_POWER[345]
 | 
			
		||||
	else
 | 
			
		||||
	    options="$options no-asm"
 | 
			
		||||
@@ -774,7 +778,7 @@ esac
 | 
			
		||||
#  options="$options -DATALLA"
 | 
			
		||||
#fi
 | 
			
		||||
 | 
			
		||||
# gcc < 2.8 does not support -mcpu=ultrasparc
 | 
			
		||||
# gcc < 2.8 does not support -march=ultrasparc
 | 
			
		||||
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
 | 
			
		||||
then
 | 
			
		||||
  echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
 | 
			
		||||
@@ -794,7 +798,7 @@ case "$GUESSOS" in
 | 
			
		||||
  i386-*) options="$options 386" ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
 | 
			
		||||
for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
 | 
			
		||||
do
 | 
			
		||||
  if [ ! -d crypto/$i ]
 | 
			
		||||
  then
 | 
			
		||||
 
 | 
			
		||||
@@ -33,8 +33,8 @@ GENERAL=Makefile README crypto-lib.com install.com
 | 
			
		||||
 | 
			
		||||
LIB= $(TOP)/libcrypto.a
 | 
			
		||||
SHARED_LIB= libcrypto$(SHLIB_EXT)
 | 
			
		||||
LIBSRC=	cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c
 | 
			
		||||
LIBOBJ= cryptlib.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ)
 | 
			
		||||
LIBSRC=	cryptlib.c dyn_lck.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c o_init.c fips_err.c 
 | 
			
		||||
LIBOBJ= cryptlib.o dyn_lck.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_init.o fips_err.o $(CPUID_OBJ)
 | 
			
		||||
 | 
			
		||||
SRC= $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
@@ -98,7 +98,7 @@ links:
 | 
			
		||||
lib:	$(LIB)
 | 
			
		||||
	@touch lib
 | 
			
		||||
$(LIB):	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
 | 
			
		||||
shared: buildinf.h lib subdirs
 | 
			
		||||
@@ -159,6 +159,13 @@ cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
 | 
			
		||||
cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
 | 
			
		||||
cversion.o: cryptlib.h cversion.c
 | 
			
		||||
dyn_lck.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
 | 
			
		||||
dyn_lck.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
 | 
			
		||||
dyn_lck.o: ../include/openssl/err.h ../include/openssl/lhash.h
 | 
			
		||||
dyn_lck.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
dyn_lck.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
 | 
			
		||||
dyn_lck.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
 | 
			
		||||
dyn_lck.o: dyn_lck.c
 | 
			
		||||
ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
 | 
			
		||||
ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
 | 
			
		||||
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
 | 
			
		||||
@@ -167,6 +174,13 @@ ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
 | 
			
		||||
ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
 | 
			
		||||
ex_data.o: ex_data.c
 | 
			
		||||
fips_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
 | 
			
		||||
fips_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
 | 
			
		||||
fips_err.o: ../include/openssl/fips.h ../include/openssl/lhash.h
 | 
			
		||||
fips_err.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
fips_err.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
 | 
			
		||||
fips_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h fips_err.c
 | 
			
		||||
fips_err.o: fips_err.h
 | 
			
		||||
mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
 | 
			
		||||
mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
 | 
			
		||||
mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
 | 
			
		||||
@@ -187,6 +201,12 @@ mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
 | 
			
		||||
mem_dbg.o: mem_dbg.c
 | 
			
		||||
o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
 | 
			
		||||
o_dir.o: LPdir_unix.c o_dir.c o_dir.h
 | 
			
		||||
o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
 | 
			
		||||
o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
 | 
			
		||||
o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
 | 
			
		||||
o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
 | 
			
		||||
o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
 | 
			
		||||
o_init.o: ../include/openssl/symhacks.h o_init.c
 | 
			
		||||
o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
 | 
			
		||||
o_str.o: o_str.c o_str.h
 | 
			
		||||
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -105,6 +105,13 @@ aes_ctr.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
 | 
			
		||||
aes_ctr.o: ../../include/openssl/opensslconf.h aes_ctr.c aes_locl.h
 | 
			
		||||
aes_ecb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
 | 
			
		||||
aes_ecb.o: ../../include/openssl/opensslconf.h aes_ecb.c aes_locl.h
 | 
			
		||||
aes_ige.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/bio.h
 | 
			
		||||
aes_ige.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
aes_ige.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
aes_ige.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
aes_ige.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
aes_ige.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h
 | 
			
		||||
aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
 | 
			
		||||
aes_misc.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c
 | 
			
		||||
 
 | 
			
		||||
@@ -66,6 +66,10 @@
 | 
			
		||||
#define AES_MAXNR 14
 | 
			
		||||
#define AES_BLOCK_SIZE 16
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
#define FIPS_AES_SIZE_T	int
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,7 @@
 | 
			
		||||
#include <openssl/aes.h>
 | 
			
		||||
#include "aes_locl.h"
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_FIPS_AES_ASM)
 | 
			
		||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
		     const unsigned long length, const AES_KEY *key,
 | 
			
		||||
		     unsigned char *ivec, const int enc) {
 | 
			
		||||
@@ -129,3 +130,4 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,7 @@
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <openssl/aes.h>
 | 
			
		||||
#include <openssl/fips.h>
 | 
			
		||||
#include "aes_locl.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -631,6 +632,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
   	int i = 0;
 | 
			
		||||
	u32 temp;
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
	FIPS_selftest_check();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (!userKey || !key)
 | 
			
		||||
		return -1;
 | 
			
		||||
	if (bits != 128 && bits != 192 && bits != 256)
 | 
			
		||||
 
 | 
			
		||||
@@ -54,21 +54,23 @@
 | 
			
		||||
#include <openssl/aes.h>
 | 
			
		||||
#include "aes_locl.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
static void hexdump(FILE *f,const char *title,const unsigned char *s,int l)
 | 
			
		||||
    {
 | 
			
		||||
    int n=0;
 | 
			
		||||
#define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long))
 | 
			
		||||
typedef struct {
 | 
			
		||||
        unsigned long data[N_WORDS];
 | 
			
		||||
} aes_block_t;
 | 
			
		||||
 | 
			
		||||
    fprintf(f,"%s",title);
 | 
			
		||||
    for( ; n < l ; ++n)
 | 
			
		||||
		{
 | 
			
		||||
		if((n%16) == 0)
 | 
			
		||||
			fprintf(f,"\n%04x",n);
 | 
			
		||||
		fprintf(f," %02x",s[n]);
 | 
			
		||||
		}
 | 
			
		||||
    fprintf(f,"\n");
 | 
			
		||||
    }
 | 
			
		||||
*/
 | 
			
		||||
/* XXX: probably some better way to do this */
 | 
			
		||||
#if defined(__i386__) || defined(__x86_64__)
 | 
			
		||||
#define UNALIGNED_MEMOPS_ARE_FAST 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef UNALIGNED_MEMOPS_ARE_FAST
 | 
			
		||||
#define load_block(d, s)        (d) = *(const aes_block_t *)(s)
 | 
			
		||||
#define store_block(d, s)       *(aes_block_t *)(d) = (s)
 | 
			
		||||
#else
 | 
			
		||||
#define load_block(d, s)        memcpy((d).data, (s), AES_BLOCK_SIZE)
 | 
			
		||||
#define store_block(d, s)       memcpy((d), (s).data, AES_BLOCK_SIZE)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* N.B. The IV for this mode is _twice_ the block size */
 | 
			
		||||
 | 
			
		||||
@@ -77,68 +79,123 @@ void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
					 unsigned char *ivec, const int enc)
 | 
			
		||||
	{
 | 
			
		||||
	unsigned long n;
 | 
			
		||||
	unsigned long len = length;
 | 
			
		||||
	unsigned char tmp[AES_BLOCK_SIZE];
 | 
			
		||||
	unsigned char tmp2[AES_BLOCK_SIZE];
 | 
			
		||||
	unsigned char prev[AES_BLOCK_SIZE];
 | 
			
		||||
	const unsigned char *iv = ivec;
 | 
			
		||||
	const unsigned char *iv2 = ivec + AES_BLOCK_SIZE;
 | 
			
		||||
	unsigned long len;
 | 
			
		||||
 | 
			
		||||
	OPENSSL_assert(in && out && key && ivec);
 | 
			
		||||
	OPENSSL_assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
 | 
			
		||||
	OPENSSL_assert((length%AES_BLOCK_SIZE) == 0);
 | 
			
		||||
 | 
			
		||||
	len = length / AES_BLOCK_SIZE;
 | 
			
		||||
 | 
			
		||||
	if (AES_ENCRYPT == enc)
 | 
			
		||||
		{
 | 
			
		||||
		/* XXX: Do a separate case for when in != out (strictly should
 | 
			
		||||
		   check for overlap, too) */
 | 
			
		||||
		while (len >= AES_BLOCK_SIZE)
 | 
			
		||||
		if (in != out)
 | 
			
		||||
			{
 | 
			
		||||
			/*			hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				out[n] = in[n] ^ iv[n];
 | 
			
		||||
			/*			hexdump(stdout, "in ^ iv", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			AES_encrypt(out, out, key);
 | 
			
		||||
			/*			hexdump(stdout,"enc", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				out[n] ^= iv2[n];
 | 
			
		||||
			/*			hexdump(stdout,"out", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			iv = out;
 | 
			
		||||
			memcpy(prev, in, AES_BLOCK_SIZE);
 | 
			
		||||
			iv2 = prev;
 | 
			
		||||
			len -= AES_BLOCK_SIZE;
 | 
			
		||||
			in += AES_BLOCK_SIZE;
 | 
			
		||||
			out += AES_BLOCK_SIZE;
 | 
			
		||||
			aes_block_t *ivp = (aes_block_t *)ivec;
 | 
			
		||||
			aes_block_t *iv2p = (aes_block_t *)(ivec + AES_BLOCK_SIZE);
 | 
			
		||||
 | 
			
		||||
			while (len)
 | 
			
		||||
				{
 | 
			
		||||
				aes_block_t *inp = (aes_block_t *)in;
 | 
			
		||||
				aes_block_t *outp = (aes_block_t *)out;
 | 
			
		||||
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					outp->data[n] = inp->data[n] ^ ivp->data[n];
 | 
			
		||||
				AES_encrypt((unsigned char *)outp->data, (unsigned char *)outp->data, key);
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					outp->data[n] ^= iv2p->data[n];
 | 
			
		||||
				ivp = outp;
 | 
			
		||||
				iv2p = inp;
 | 
			
		||||
				--len;
 | 
			
		||||
				in += AES_BLOCK_SIZE;
 | 
			
		||||
				out += AES_BLOCK_SIZE;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec, ivp->data, AES_BLOCK_SIZE);
 | 
			
		||||
			memcpy(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			aes_block_t tmp, tmp2;
 | 
			
		||||
			aes_block_t iv;
 | 
			
		||||
			aes_block_t iv2;
 | 
			
		||||
 | 
			
		||||
			load_block(iv, ivec);
 | 
			
		||||
			load_block(iv2, ivec + AES_BLOCK_SIZE);
 | 
			
		||||
 | 
			
		||||
			while (len)
 | 
			
		||||
				{
 | 
			
		||||
				load_block(tmp, in);
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					tmp2.data[n] = tmp.data[n] ^ iv.data[n];
 | 
			
		||||
				AES_encrypt((unsigned char *)tmp2.data, (unsigned char *)tmp2.data, key);
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					tmp2.data[n] ^= iv2.data[n];
 | 
			
		||||
				store_block(out, tmp2);
 | 
			
		||||
				iv = tmp2;
 | 
			
		||||
				iv2 = tmp;
 | 
			
		||||
				--len;
 | 
			
		||||
				in += AES_BLOCK_SIZE;
 | 
			
		||||
				out += AES_BLOCK_SIZE;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec, iv.data, AES_BLOCK_SIZE);
 | 
			
		||||
			memcpy(ivec + AES_BLOCK_SIZE, iv2.data, AES_BLOCK_SIZE);
 | 
			
		||||
			}
 | 
			
		||||
		memcpy(ivec, iv, AES_BLOCK_SIZE);
 | 
			
		||||
		memcpy(ivec + AES_BLOCK_SIZE, iv2, AES_BLOCK_SIZE);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		while (len >= AES_BLOCK_SIZE)
 | 
			
		||||
		if(in != out)
 | 
			
		||||
			{
 | 
			
		||||
			memcpy(tmp, in, AES_BLOCK_SIZE);
 | 
			
		||||
			memcpy(tmp2, in, AES_BLOCK_SIZE);
 | 
			
		||||
			/*			hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				tmp[n] ^= iv2[n];
 | 
			
		||||
			/*			hexdump(stdout, "in ^ iv2", tmp, AES_BLOCK_SIZE); */
 | 
			
		||||
			AES_decrypt(tmp, out, key);
 | 
			
		||||
			/*			hexdump(stdout, "dec", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv", ivec, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				out[n] ^= ivec[n];
 | 
			
		||||
			/*			hexdump(stdout, "out", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			memcpy(ivec, tmp2, AES_BLOCK_SIZE);
 | 
			
		||||
			iv2 = out;
 | 
			
		||||
			len -= AES_BLOCK_SIZE;
 | 
			
		||||
			in += AES_BLOCK_SIZE;
 | 
			
		||||
			out += AES_BLOCK_SIZE;
 | 
			
		||||
			aes_block_t *ivp = (aes_block_t *)ivec;
 | 
			
		||||
			aes_block_t *iv2p = (aes_block_t *)(ivec + AES_BLOCK_SIZE);
 | 
			
		||||
 | 
			
		||||
			while (len)
 | 
			
		||||
				{
 | 
			
		||||
				aes_block_t tmp;
 | 
			
		||||
				aes_block_t *inp = (aes_block_t *)in;
 | 
			
		||||
				aes_block_t *outp = (aes_block_t *)out;
 | 
			
		||||
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					tmp.data[n] = inp->data[n] ^ iv2p->data[n];
 | 
			
		||||
				AES_decrypt((unsigned char *)tmp.data, (unsigned char *)outp->data, key);
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					outp->data[n] ^= ivp->data[n];
 | 
			
		||||
				ivp = inp;
 | 
			
		||||
				iv2p = outp;
 | 
			
		||||
				--len;
 | 
			
		||||
				in += AES_BLOCK_SIZE;
 | 
			
		||||
				out += AES_BLOCK_SIZE;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec, ivp->data, AES_BLOCK_SIZE);
 | 
			
		||||
			memcpy(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			aes_block_t tmp, tmp2;
 | 
			
		||||
			aes_block_t iv;
 | 
			
		||||
			aes_block_t iv2;
 | 
			
		||||
 | 
			
		||||
			load_block(iv, ivec);
 | 
			
		||||
			load_block(iv2, ivec + AES_BLOCK_SIZE);
 | 
			
		||||
 | 
			
		||||
			while (len)
 | 
			
		||||
				{
 | 
			
		||||
				load_block(tmp, in);
 | 
			
		||||
				tmp2 = tmp;
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					tmp.data[n] ^= iv2.data[n];
 | 
			
		||||
				AES_decrypt((unsigned char *)tmp.data, (unsigned char *)tmp.data, key);
 | 
			
		||||
				for(n=0 ; n < N_WORDS; ++n)
 | 
			
		||||
					tmp.data[n] ^= iv.data[n];
 | 
			
		||||
				store_block(out, tmp);
 | 
			
		||||
				iv = tmp2;
 | 
			
		||||
				iv2 = tmp;
 | 
			
		||||
				--len;
 | 
			
		||||
				in += AES_BLOCK_SIZE;
 | 
			
		||||
				out += AES_BLOCK_SIZE;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec, iv.data, AES_BLOCK_SIZE);
 | 
			
		||||
			memcpy(ivec + AES_BLOCK_SIZE, iv2.data, AES_BLOCK_SIZE);
 | 
			
		||||
			}
 | 
			
		||||
		memcpy(ivec + AES_BLOCK_SIZE, iv2, AES_BLOCK_SIZE);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -177,17 +234,11 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
		iv2 = ivec + AES_BLOCK_SIZE;
 | 
			
		||||
		while (len >= AES_BLOCK_SIZE)
 | 
			
		||||
			{
 | 
			
		||||
			/*			hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				out[n] = in[n] ^ iv[n];
 | 
			
		||||
			/*			hexdump(stdout, "in ^ iv", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			AES_encrypt(out, out, key);
 | 
			
		||||
			/*			hexdump(stdout,"enc", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				out[n] ^= iv2[n];
 | 
			
		||||
			/*			hexdump(stdout,"out", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			iv = out;
 | 
			
		||||
			memcpy(prev, in, AES_BLOCK_SIZE);
 | 
			
		||||
			iv2 = prev;
 | 
			
		||||
@@ -203,8 +254,6 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
		while(len >= AES_BLOCK_SIZE)
 | 
			
		||||
			{
 | 
			
		||||
			out -= AES_BLOCK_SIZE;
 | 
			
		||||
			/*			hexdump(stdout, "intermediate", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
 | 
			
		||||
			/* XXX: reduce copies by alternating between buffers */
 | 
			
		||||
			memcpy(tmp, out, AES_BLOCK_SIZE);
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
@@ -235,17 +284,11 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			out -= AES_BLOCK_SIZE;
 | 
			
		||||
			memcpy(tmp, in, AES_BLOCK_SIZE);
 | 
			
		||||
			memcpy(tmp2, in, AES_BLOCK_SIZE);
 | 
			
		||||
			/*			hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				tmp[n] ^= iv2[n];
 | 
			
		||||
			/*			hexdump(stdout, "in ^ iv2", tmp, AES_BLOCK_SIZE); */
 | 
			
		||||
			AES_decrypt(tmp, out, key);
 | 
			
		||||
			/*			hexdump(stdout, "dec", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				out[n] ^= iv[n];
 | 
			
		||||
			/*			hexdump(stdout, "out", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			memcpy(tmp3, tmp2, AES_BLOCK_SIZE);
 | 
			
		||||
			iv = tmp3;
 | 
			
		||||
			iv2 = out;
 | 
			
		||||
@@ -260,17 +303,11 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			{
 | 
			
		||||
			memcpy(tmp, out, AES_BLOCK_SIZE);
 | 
			
		||||
			memcpy(tmp2, out, AES_BLOCK_SIZE);
 | 
			
		||||
			/*			hexdump(stdout, "intermediate", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				tmp[n] ^= iv2[n];
 | 
			
		||||
			/*			hexdump(stdout, "out ^ iv2", tmp, AES_BLOCK_SIZE); */
 | 
			
		||||
			AES_decrypt(tmp, out, key);
 | 
			
		||||
			/*			hexdump(stdout, "dec", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			/*			hexdump(stdout, "iv", ivec, AES_BLOCK_SIZE); */
 | 
			
		||||
			for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
 | 
			
		||||
				out[n] ^= iv[n];
 | 
			
		||||
			/*			hexdump(stdout, "out", out, AES_BLOCK_SIZE); */
 | 
			
		||||
			memcpy(tmp3, tmp2, AES_BLOCK_SIZE);
 | 
			
		||||
			iv = tmp3;
 | 
			
		||||
			iv2 = out;
 | 
			
		||||
@@ -278,6 +315,5 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			in += AES_BLOCK_SIZE;
 | 
			
		||||
			out += AES_BLOCK_SIZE;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@
 | 
			
		||||
#include <openssl/aes.h>
 | 
			
		||||
#include "aes_locl.h"
 | 
			
		||||
 | 
			
		||||
const char *AES_version="AES" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
const char AES_version[]="AES" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
const char *AES_options(void) {
 | 
			
		||||
#ifdef FULL_UNROLL
 | 
			
		||||
 
 | 
			
		||||
@@ -512,11 +512,11 @@ sub declast()
 | 
			
		||||
	if($i==3)   {	&mov	($key,&DWP(12,"esp"));		}
 | 
			
		||||
	else        {	&mov	($out,$s[0]);			}
 | 
			
		||||
			&and	($out,0xFF);
 | 
			
		||||
			&movz	($out,&DWP(2048,$td,$out,1));
 | 
			
		||||
			&movz	($out,&BP(2048,$td,$out,1));
 | 
			
		||||
 | 
			
		||||
	if ($i==3)  {	$tmp=$s[1];				}
 | 
			
		||||
			&movz	($tmp,&HB($s[1]));
 | 
			
		||||
			&movz	($tmp,&DWP(2048,$td,$tmp,1));
 | 
			
		||||
			&movz	($tmp,&BP(2048,$td,$tmp,1));
 | 
			
		||||
			&shl	($tmp,8);
 | 
			
		||||
			&xor	($out,$tmp);
 | 
			
		||||
 | 
			
		||||
@@ -524,14 +524,14 @@ sub declast()
 | 
			
		||||
	else        {	mov	($tmp,$s[2]);			}
 | 
			
		||||
			&shr	($tmp,16);
 | 
			
		||||
			&and	($tmp,0xFF);
 | 
			
		||||
			&movz	($tmp,&DWP(2048,$td,$tmp,1));
 | 
			
		||||
			&movz	($tmp,&BP(2048,$td,$tmp,1));
 | 
			
		||||
			&shl	($tmp,16);
 | 
			
		||||
			&xor	($out,$tmp);
 | 
			
		||||
 | 
			
		||||
	if ($i==3)  {	$tmp=$s[3]; &mov ($s[2],&DWP(8,"esp"));	}
 | 
			
		||||
	else        {	&mov	($tmp,$s[3]);			}
 | 
			
		||||
			&shr	($tmp,24);
 | 
			
		||||
			&movz	($tmp,&DWP(2048,$td,$tmp,1));
 | 
			
		||||
			&movz	($tmp,&BP(2048,$td,$tmp,1));
 | 
			
		||||
			&shl	($tmp,24);
 | 
			
		||||
			&xor	($out,$tmp);
 | 
			
		||||
	if ($i<2)   {	&mov	(&DWP(4+4*$i,"esp"),$out);	}
 | 
			
		||||
@@ -940,7 +940,6 @@ my $mark=&DWP(60+240,"esp");	#copy of aes_key->rounds
 | 
			
		||||
 | 
			
		||||
	&cmp	($mark,0);		# was the key schedule copied?
 | 
			
		||||
	&mov	("edi",$_key);
 | 
			
		||||
	&mov	("esp",$_esp);
 | 
			
		||||
	&je	(&label("skip_ezero"));
 | 
			
		||||
	# zero copy of key schedule
 | 
			
		||||
	&mov	("ecx",240/4);
 | 
			
		||||
@@ -948,6 +947,7 @@ my $mark=&DWP(60+240,"esp");	#copy of aes_key->rounds
 | 
			
		||||
	&align	(4);
 | 
			
		||||
	&data_word(0xABF3F689);	# rep stosd
 | 
			
		||||
	&set_label("skip_ezero")
 | 
			
		||||
	&mov	("esp",$_esp);
 | 
			
		||||
	&popf	();
 | 
			
		||||
    &set_label("enc_out");
 | 
			
		||||
	&function_end_A();
 | 
			
		||||
@@ -1197,7 +1197,6 @@ my $mark=&DWP(60+240,"esp");	#copy of aes_key->rounds
 | 
			
		||||
    &set_label("dec_out");
 | 
			
		||||
    &cmp	($mark,0);		# was the key schedule copied?
 | 
			
		||||
    &mov	("edi",$_key);
 | 
			
		||||
    &mov	("esp",$_esp);
 | 
			
		||||
    &je		(&label("skip_dzero"));
 | 
			
		||||
    # zero copy of key schedule
 | 
			
		||||
    &mov	("ecx",240/4);
 | 
			
		||||
@@ -1205,6 +1204,7 @@ my $mark=&DWP(60+240,"esp");	#copy of aes_key->rounds
 | 
			
		||||
    &align	(4);
 | 
			
		||||
    &data_word(0xABF3F689);	# rep stosd
 | 
			
		||||
    &set_label("skip_dzero")
 | 
			
		||||
    &mov	("esp",$_esp);
 | 
			
		||||
    &popf	();
 | 
			
		||||
&function_end("AES_cbc_encrypt");
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -63,7 +63,7 @@ pk:	pk.c
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -142,9 +142,9 @@ a_digest.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
a_digest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
a_digest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
a_digest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
a_digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
a_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
a_digest.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
a_digest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
a_digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
a_digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
a_digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
a_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
@@ -250,27 +250,27 @@ a_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
a_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
a_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
a_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
a_sign.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
a_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
a_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
a_sign.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
a_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
a_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
a_sign.o: ../cryptlib.h a_sign.c
 | 
			
		||||
a_sign.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
a_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
a_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
a_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
a_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
a_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
a_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
a_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_sign.c
 | 
			
		||||
a_strex.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
a_strex.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
a_strex.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
a_strex.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
a_strex.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
a_strex.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
a_strex.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
a_strex.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
a_strex.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
a_strex.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
a_strex.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
a_strex.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
a_strex.o: ../cryptlib.h a_strex.c charmap.h
 | 
			
		||||
a_strex.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
a_strex.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
a_strex.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
a_strex.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
a_strex.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
a_strex.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
a_strex.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
a_strex.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_strex.c charmap.h
 | 
			
		||||
a_strnid.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
a_strnid.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
a_strnid.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
@@ -317,8 +317,9 @@ a_verify.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
a_verify.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
a_verify.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
a_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
a_verify.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
a_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
a_verify.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
a_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
a_verify.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
a_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
a_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
@@ -337,8 +338,9 @@ asn1_gen.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
asn1_gen.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
@@ -368,9 +370,9 @@ asn_moid.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
asn_moid.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
@@ -389,23 +391,23 @@ d2i_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
d2i_pr.o: ../cryptlib.h d2i_pr.c
 | 
			
		||||
d2i_pr.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
d2i_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h d2i_pr.c
 | 
			
		||||
d2i_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
d2i_pu.o: ../cryptlib.h d2i_pu.c
 | 
			
		||||
d2i_pu.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
d2i_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h d2i_pu.c
 | 
			
		||||
evp_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
evp_asn1.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
 | 
			
		||||
evp_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
@@ -441,71 +443,73 @@ i2d_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
i2d_pr.o: ../cryptlib.h i2d_pr.c
 | 
			
		||||
i2d_pr.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
i2d_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h i2d_pr.c
 | 
			
		||||
i2d_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
i2d_pu.o: ../cryptlib.h i2d_pu.c
 | 
			
		||||
i2d_pu.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
i2d_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h i2d_pu.c
 | 
			
		||||
n_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/asn1t.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h n_pkey.c
 | 
			
		||||
n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
n_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
n_pkey.o: ../cryptlib.h n_pkey.c
 | 
			
		||||
nsseq.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
 | 
			
		||||
nsseq.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
nsseq.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
nsseq.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
nsseq.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
 | 
			
		||||
nsseq.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
nsseq.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
nsseq.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
nsseq.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
nsseq.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
nsseq.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
nsseq.o: ../../include/openssl/x509_vfy.h nsseq.c
 | 
			
		||||
nsseq.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
nsseq.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
nsseq.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
nsseq.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
nsseq.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
nsseq.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
nsseq.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h nsseq.c
 | 
			
		||||
p5_pbe.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
p5_pbe.o: ../cryptlib.h p5_pbe.c
 | 
			
		||||
p5_pbe.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
p5_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_pbe.c
 | 
			
		||||
p5_pbev2.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
 | 
			
		||||
p5_pbev2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
@@ -518,41 +522,42 @@ p8_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p8_pkey.c
 | 
			
		||||
p8_pkey.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
p8_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
p8_pkey.o: ../cryptlib.h p8_pkey.c
 | 
			
		||||
t_bitst.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_bitst.o: ../cryptlib.h t_bitst.c
 | 
			
		||||
t_bitst.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h t_bitst.c
 | 
			
		||||
t_crl.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
t_crl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
t_crl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_crl.o: ../cryptlib.h t_crl.c
 | 
			
		||||
t_crl.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h t_crl.c
 | 
			
		||||
t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
t_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
 | 
			
		||||
@@ -570,57 +575,57 @@ t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
 | 
			
		||||
t_req.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
t_req.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
t_req.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_req.o: ../cryptlib.h t_req.c
 | 
			
		||||
t_req.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
 | 
			
		||||
t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h t_req.c
 | 
			
		||||
t_spki.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
t_spki.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
 | 
			
		||||
t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
t_spki.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
t_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
t_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
t_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
 | 
			
		||||
t_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_spki.o: ../cryptlib.h t_spki.c
 | 
			
		||||
t_spki.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
t_spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_spki.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
t_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_spki.c
 | 
			
		||||
t_x509.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
t_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
 | 
			
		||||
t_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
t_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_x509.o: ../cryptlib.h t_x509.c
 | 
			
		||||
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
 | 
			
		||||
t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h t_x509.c
 | 
			
		||||
t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_x509a.o: ../cryptlib.h t_x509a.c
 | 
			
		||||
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_x509a.c
 | 
			
		||||
tasn_dec.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
 | 
			
		||||
tasn_dec.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
tasn_dec.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
@@ -673,21 +678,23 @@ x_algor.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
x_algor.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
x_algor.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
x_algor.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
 | 
			
		||||
x_algor.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_algor.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_algor.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_algor.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_algor.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_algor.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_algor.o: ../../include/openssl/x509_vfy.h x_algor.c
 | 
			
		||||
x_algor.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_algor.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_algor.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_algor.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_algor.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_algor.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_algor.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_algor.o: x_algor.c
 | 
			
		||||
x_attrib.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_attrib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
@@ -708,37 +715,40 @@ x_crl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_crl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_crl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_crl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_crl.c
 | 
			
		||||
x_crl.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_crl.o: ../cryptlib.h x_crl.c
 | 
			
		||||
x_exten.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
 | 
			
		||||
x_exten.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 | 
			
		||||
x_exten.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
x_exten.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
x_exten.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
 | 
			
		||||
x_exten.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_exten.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_exten.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_exten.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_exten.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_exten.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_exten.o: ../../include/openssl/x509_vfy.h x_exten.c
 | 
			
		||||
x_exten.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_exten.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_exten.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_exten.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_exten.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_exten.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_exten.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_exten.o: x_exten.c
 | 
			
		||||
x_info.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
x_info.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_info.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_info.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_info.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_info.c
 | 
			
		||||
x_info.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_info.o: ../cryptlib.h x_info.c
 | 
			
		||||
x_long.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_long.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_long.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
@@ -754,35 +764,37 @@ x_name.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_name.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_name.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_name.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_name.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_name.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_name.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_name.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_name.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_name.c
 | 
			
		||||
x_name.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_name.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_name.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_name.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_name.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_name.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_name.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_name.o: ../cryptlib.h x_name.c
 | 
			
		||||
x_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_pkey.c
 | 
			
		||||
x_pkey.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_pkey.o: ../cryptlib.h x_pkey.c
 | 
			
		||||
x_pubkey.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
 | 
			
		||||
x_pubkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
@@ -795,76 +807,82 @@ x_req.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_req.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_req.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_req.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_req.c
 | 
			
		||||
x_req.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_req.o: ../cryptlib.h x_req.c
 | 
			
		||||
x_sig.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_sig.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_sig.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_sig.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_sig.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_sig.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_sig.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_sig.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_sig.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_sig.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_sig.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_sig.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_sig.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_sig.c
 | 
			
		||||
x_sig.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_sig.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_sig.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_sig.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_sig.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_sig.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_sig.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_sig.o: ../cryptlib.h x_sig.c
 | 
			
		||||
x_spki.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_spki.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_spki.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_spki.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_spki.c
 | 
			
		||||
x_spki.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_spki.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_spki.o: ../cryptlib.h x_spki.c
 | 
			
		||||
x_val.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_val.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_val.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_val.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_val.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_val.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_val.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_val.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_val.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_val.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_val.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_val.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_val.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_val.c
 | 
			
		||||
x_val.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_val.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_val.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_val.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_val.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_val.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_val.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_val.o: ../cryptlib.h x_val.c
 | 
			
		||||
x_x509.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_x509.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_x509.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
 | 
			
		||||
x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
x_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
x_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h x_x509.c
 | 
			
		||||
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
x_x509.o: ../cryptlib.h x_x509.c
 | 
			
		||||
x_x509a.o: ../../e_os.h ../../include/openssl/asn1.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_x509a.c
 | 
			
		||||
x_x509a.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_x509a.o: ../cryptlib.h x_x509a.c
 | 
			
		||||
 
 | 
			
		||||
@@ -170,7 +170,7 @@ static int do_buf(unsigned char *buf, int buflen,
 | 
			
		||||
	q = buf + buflen;
 | 
			
		||||
	outlen = 0;
 | 
			
		||||
	while(p != q) {
 | 
			
		||||
		if(p == buf) orflags = CHARTYPE_FIRST_ESC_2253;
 | 
			
		||||
		if(p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253;
 | 
			
		||||
		else orflags = 0;
 | 
			
		||||
		switch(type & BUF_TYPE_WIDTH_MASK) {
 | 
			
		||||
			case 4:
 | 
			
		||||
@@ -197,7 +197,7 @@ static int do_buf(unsigned char *buf, int buflen,
 | 
			
		||||
			default:
 | 
			
		||||
			return -1;	/* invalid width */
 | 
			
		||||
		}
 | 
			
		||||
		if (p == q) orflags = CHARTYPE_LAST_ESC_2253;
 | 
			
		||||
		if (p == q && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_LAST_ESC_2253;
 | 
			
		||||
		if(type & BUF_TYPE_CONVUTF8) {
 | 
			
		||||
			unsigned char utfbuf[6];
 | 
			
		||||
			int utflen;
 | 
			
		||||
 
 | 
			
		||||
@@ -123,7 +123,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_EX_D2I),	"ASN1_TEMPLATE_EX_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NEW),	"ASN1_TEMPLATE_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I),	"ASN1_TEMPLATE_NOEXP_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TIME_SET),	"ASN1_TIME_SET"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TIME_SET),	"ASN1_TIME_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING),	"ASN1_TYPE_get_int_octetstring"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_OCTETSTRING),	"ASN1_TYPE_get_octetstring"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_UNPACK_STRING),	"ASN1_unpack_string"},
 | 
			
		||||
@@ -168,10 +168,10 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_OID_MODULE_INIT),	"OID_MODULE_INIT"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PARSE_TAGGING),	"PARSE_TAGGING"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE2_SET),	"PKCS5_pbe2_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET),	"PKCS5_PBE_SET"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET),	"PKCS5_pbe_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_CINF_NEW),	"X509_CINF_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_CRL_ADD0_REVOKED),	"X509_CRL_ADD0_REVOKED"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_INFO_NEW),	"X509_INFO_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_CRL_ADD0_REVOKED),	"X509_CRL_add0_revoked"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_INFO_NEW),	"X509_INFO_new"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NAME_ENCODE),	"X509_NAME_ENCODE"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NAME_EX_D2I),	"X509_NAME_EX_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_NAME_EX_NEW),	"X509_NAME_EX_NEW"},
 | 
			
		||||
@@ -287,15 +287,12 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
 | 
			
		||||
 | 
			
		||||
void ERR_load_ASN1_strings(void)
 | 
			
		||||
	{
 | 
			
		||||
	static int init=1;
 | 
			
		||||
 | 
			
		||||
	if (init)
 | 
			
		||||
		{
 | 
			
		||||
		init=0;
 | 
			
		||||
#ifndef OPENSSL_NO_ERR
 | 
			
		||||
 | 
			
		||||
	if (ERR_func_error_string(ASN1_str_functs[0].error) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ERR_load_strings(0,ASN1_str_functs);
 | 
			
		||||
		ERR_load_strings(0,ASN1_str_reasons);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@
 | 
			
		||||
 | 
			
		||||
static int asn1_get_length(const unsigned char **pp,int *inf,long *rl,int max);
 | 
			
		||||
static void asn1_put_length(unsigned char **pp, int length);
 | 
			
		||||
const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
const char ASN1_version[]="ASN.1" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
static int _asn1_check_infinite_end(const unsigned char **p, long len)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,7 @@ extern "C" {
 | 
			
		||||
#define ASN1_ITEM_start(itname) \
 | 
			
		||||
	const ASN1_ITEM * itname##_it(void) \
 | 
			
		||||
	{ \
 | 
			
		||||
		static const ASN1_ITEM local_it = { \
 | 
			
		||||
		static const ASN1_ITEM local_it = { 
 | 
			
		||||
 | 
			
		||||
#define ASN1_ITEM_end(itname) \
 | 
			
		||||
		}; \
 | 
			
		||||
 
 | 
			
		||||
@@ -149,7 +149,7 @@ static int do_create(char *value, char *name)
 | 
			
		||||
		if (lntmp == NULL)
 | 
			
		||||
			return 0;
 | 
			
		||||
		memcpy(lntmp, ln, p - ln);
 | 
			
		||||
		lntmp[p - ln + 1] = 0;
 | 
			
		||||
		lntmp[p - ln] = 0;
 | 
			
		||||
		oid = OBJ_nid2obj(nid);
 | 
			
		||||
		oid->ln = lntmp;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -445,9 +445,9 @@ err:
 | 
			
		||||
int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
 | 
			
		||||
	{
 | 
			
		||||
	char *s,*c,*b;
 | 
			
		||||
	int ret=0,l,ll,i,first=1;
 | 
			
		||||
	int ret=0,l,i;
 | 
			
		||||
 | 
			
		||||
	ll=80-2-obase;
 | 
			
		||||
	l=80-2-obase;
 | 
			
		||||
 | 
			
		||||
	b=s=X509_NAME_oneline(name,NULL,0);
 | 
			
		||||
	if (!*s)
 | 
			
		||||
@@ -457,7 +457,6 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
 | 
			
		||||
		}
 | 
			
		||||
	s++; /* skip the first slash */
 | 
			
		||||
 | 
			
		||||
	l=ll;
 | 
			
		||||
	c=s;
 | 
			
		||||
	for (;;)
 | 
			
		||||
		{
 | 
			
		||||
@@ -479,16 +478,6 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
 | 
			
		||||
			(*s == '\0'))
 | 
			
		||||
#endif
 | 
			
		||||
			{
 | 
			
		||||
			if ((l <= 0) && !first)
 | 
			
		||||
				{
 | 
			
		||||
				first=0;
 | 
			
		||||
				if (BIO_write(bp,"\n",1) != 1) goto err;
 | 
			
		||||
				for (i=0; i<obase; i++)
 | 
			
		||||
					{
 | 
			
		||||
					if (BIO_write(bp," ",1) != 1) goto err;
 | 
			
		||||
					}
 | 
			
		||||
				l=ll;
 | 
			
		||||
				}
 | 
			
		||||
			i=s-c;
 | 
			
		||||
			if (BIO_write(bp,c,i) != i) goto err;
 | 
			
		||||
			c+=i;
 | 
			
		||||
 
 | 
			
		||||
@@ -93,7 +93,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
 | 
			
		||||
				int tag, int aclass, char opt, ASN1_TLC *ctx);
 | 
			
		||||
 | 
			
		||||
/* Table to convert tags to bit values, used for MSTRING type */
 | 
			
		||||
static unsigned long tag2bit[32] = {
 | 
			
		||||
static const unsigned long tag2bit[32] = {
 | 
			
		||||
0,	0,	0,	B_ASN1_BIT_STRING,	/* tags  0 -  3 */
 | 
			
		||||
B_ASN1_OCTET_STRING,	0,	0,		B_ASN1_UNKNOWN,/* tags  4- 7 */
 | 
			
		||||
B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,	B_ASN1_UNKNOWN,/* tags  8-11 */
 | 
			
		||||
 
 | 
			
		||||
@@ -94,6 +94,10 @@ static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it)
 | 
			
		||||
		ret->ex_pathlen = -1;
 | 
			
		||||
		ret->skid = NULL;
 | 
			
		||||
		ret->akid = NULL;
 | 
			
		||||
#ifndef OPENSSL_NO_RFC3779
 | 
			
		||||
		ret->rfc3779_addr = NULL;
 | 
			
		||||
		ret->rfc3779_asid = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
		ret->aux = NULL;
 | 
			
		||||
		CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
 | 
			
		||||
		break;
 | 
			
		||||
@@ -109,6 +113,10 @@ static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it)
 | 
			
		||||
		ASN1_OCTET_STRING_free(ret->skid);
 | 
			
		||||
		AUTHORITY_KEYID_free(ret->akid);
 | 
			
		||||
		policy_cache_free(ret->policy_cache);
 | 
			
		||||
#ifndef OPENSSL_NO_RFC3779
 | 
			
		||||
		sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
 | 
			
		||||
		ASIdentifiers_free(ret->rfc3779_asid);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		if (ret->name != NULL) OPENSSL_free(ret->name);
 | 
			
		||||
		break;
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -103,5 +103,9 @@ bf_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h
 | 
			
		||||
bf_enc.o: ../../include/openssl/opensslconf.h bf_enc.c bf_locl.h
 | 
			
		||||
bf_ofb64.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h
 | 
			
		||||
bf_ofb64.o: ../../include/openssl/opensslconf.h bf_locl.h bf_ofb64.c
 | 
			
		||||
bf_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h
 | 
			
		||||
bf_skey.o: ../../include/openssl/opensslconf.h bf_locl.h bf_pi.h bf_skey.c
 | 
			
		||||
bf_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/crypto.h
 | 
			
		||||
bf_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/fips.h
 | 
			
		||||
bf_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
bf_skey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
 | 
			
		||||
bf_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
bf_skey.o: bf_locl.h bf_pi.h bf_skey.c
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,7 @@
 | 
			
		||||
 * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
const char *BF_version="Blowfish" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
const char BF_version[]="Blowfish" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
const char *BF_options(void)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -59,10 +59,12 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <openssl/blowfish.h>
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/fips.h>
 | 
			
		||||
#include "bf_locl.h"
 | 
			
		||||
#include "bf_pi.h"
 | 
			
		||||
 | 
			
		||||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data)
 | 
			
		||||
FIPS_NON_FIPS_VCIPHER_Init(BF)
 | 
			
		||||
	{
 | 
			
		||||
	int i;
 | 
			
		||||
	BF_LONG *p,ri,in[2];
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,9 @@ typedef struct bf_key_st
 | 
			
		||||
	BF_LONG S[4*256];
 | 
			
		||||
	} BF_KEY;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
#ifdef OPENSSL_FIPS 
 | 
			
		||||
void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
 | 
			
		||||
#endif
 | 
			
		||||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
 | 
			
		||||
 | 
			
		||||
void BF_encrypt(BF_LONG *data,const BF_KEY *key);
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -196,28 +196,32 @@ extern "C" {
 | 
			
		||||
 */
 | 
			
		||||
#define BIO_FLAGS_MEM_RDONLY	0x200
 | 
			
		||||
 | 
			
		||||
#define BIO_set_flags(b,f) ((b)->flags|=(f))
 | 
			
		||||
#define BIO_get_flags(b) ((b)->flags)
 | 
			
		||||
typedef struct bio_st BIO;
 | 
			
		||||
 | 
			
		||||
void BIO_set_flags(BIO *b, int flags);
 | 
			
		||||
int  BIO_test_flags(const BIO *b, int flags);
 | 
			
		||||
void BIO_clear_flags(BIO *b, int flags);
 | 
			
		||||
 | 
			
		||||
#define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
 | 
			
		||||
#define BIO_set_retry_special(b) \
 | 
			
		||||
		((b)->flags|=(BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
		BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
#define BIO_set_retry_read(b) \
 | 
			
		||||
		((b)->flags|=(BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
		BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
#define BIO_set_retry_write(b) \
 | 
			
		||||
		((b)->flags|=(BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
		BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
 | 
			
		||||
/* These are normally used internally in BIOs */
 | 
			
		||||
#define BIO_clear_flags(b,f) ((b)->flags&= ~(f))
 | 
			
		||||
#define BIO_clear_retry_flags(b) \
 | 
			
		||||
		((b)->flags&= ~(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
		BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
#define BIO_get_retry_flags(b) \
 | 
			
		||||
		((b)->flags&(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
		BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
 | 
			
		||||
 | 
			
		||||
/* These should be used by the application to tell why we should retry */
 | 
			
		||||
#define BIO_should_read(a)		((a)->flags & BIO_FLAGS_READ)
 | 
			
		||||
#define BIO_should_write(a)		((a)->flags & BIO_FLAGS_WRITE)
 | 
			
		||||
#define BIO_should_io_special(a)	((a)->flags & BIO_FLAGS_IO_SPECIAL)
 | 
			
		||||
#define BIO_retry_type(a)		((a)->flags & BIO_FLAGS_RWS)
 | 
			
		||||
#define BIO_should_retry(a)		((a)->flags & BIO_FLAGS_SHOULD_RETRY)
 | 
			
		||||
#define BIO_should_read(a)		BIO_test_flags(a, BIO_FLAGS_READ)
 | 
			
		||||
#define BIO_should_write(a)		BIO_test_flags(a, BIO_FLAGS_WRITE)
 | 
			
		||||
#define BIO_should_io_special(a)	BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
 | 
			
		||||
#define BIO_retry_type(a)		BIO_test_flags(a, BIO_FLAGS_RWS)
 | 
			
		||||
#define BIO_should_retry(a)		BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
 | 
			
		||||
 | 
			
		||||
/* The next three are used in conjunction with the
 | 
			
		||||
 * BIO_should_io_special() condition.  After this returns true,
 | 
			
		||||
@@ -246,14 +250,14 @@ extern "C" {
 | 
			
		||||
#define BIO_cb_pre(a)	(!((a)&BIO_CB_RETURN))
 | 
			
		||||
#define BIO_cb_post(a)	((a)&BIO_CB_RETURN)
 | 
			
		||||
 | 
			
		||||
#define BIO_set_callback(b,cb)		((b)->callback=(cb))
 | 
			
		||||
#define BIO_set_callback_arg(b,arg)	((b)->cb_arg=(char *)(arg))
 | 
			
		||||
#define BIO_get_callback_arg(b)		((b)->cb_arg)
 | 
			
		||||
#define BIO_get_callback(b)		((b)->callback)
 | 
			
		||||
#define BIO_method_name(b)		((b)->method->name)
 | 
			
		||||
#define BIO_method_type(b)		((b)->method->type)
 | 
			
		||||
long (*BIO_get_callback(const BIO *b)) (struct bio_st *,int,const char *,int, long,long);
 | 
			
		||||
void BIO_set_callback(BIO *b, 
 | 
			
		||||
	long (*callback)(struct bio_st *,int,const char *,int, long,long));
 | 
			
		||||
char *BIO_get_callback_arg(const BIO *b);
 | 
			
		||||
void BIO_set_callback_arg(BIO *b, char *arg);
 | 
			
		||||
 | 
			
		||||
typedef struct bio_st BIO;
 | 
			
		||||
const char * BIO_method_name(const BIO *b);
 | 
			
		||||
int BIO_method_type(const BIO *b);
 | 
			
		||||
 | 
			
		||||
typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
 | 
			
		||||
 | 
			
		||||
@@ -386,6 +390,7 @@ typedef struct bio_f_buffer_ctx_struct
 | 
			
		||||
#define BIO_C_NWRITE0				145
 | 
			
		||||
#define BIO_C_NWRITE				146
 | 
			
		||||
#define BIO_C_RESET_READ_REQUEST		147
 | 
			
		||||
#define BIO_C_SET_MD_CTX			148
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define BIO_set_app_data(s,arg)		BIO_set_ex_data(s,0,arg)
 | 
			
		||||
 
 | 
			
		||||
@@ -143,15 +143,12 @@ static ERR_STRING_DATA BIO_str_reasons[]=
 | 
			
		||||
 | 
			
		||||
void ERR_load_BIO_strings(void)
 | 
			
		||||
	{
 | 
			
		||||
	static int init=1;
 | 
			
		||||
 | 
			
		||||
	if (init)
 | 
			
		||||
		{
 | 
			
		||||
		init=0;
 | 
			
		||||
#ifndef OPENSSL_NO_ERR
 | 
			
		||||
 | 
			
		||||
	if (ERR_func_error_string(BIO_str_functs[0].error) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ERR_load_strings(0,BIO_str_functs);
 | 
			
		||||
		ERR_load_strings(0,BIO_str_reasons);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -141,6 +141,52 @@ int BIO_free(BIO *a)
 | 
			
		||||
void BIO_vfree(BIO *a)
 | 
			
		||||
    { BIO_free(a); }
 | 
			
		||||
 | 
			
		||||
void BIO_clear_flags(BIO *b, int flags)
 | 
			
		||||
	{
 | 
			
		||||
	b->flags &= ~flags;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int	BIO_test_flags(const BIO *b, int flags)
 | 
			
		||||
	{
 | 
			
		||||
	return (b->flags & flags);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void	BIO_set_flags(BIO *b, int flags)
 | 
			
		||||
	{
 | 
			
		||||
	b->flags |= flags;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
long (*BIO_get_callback(const BIO *b))(struct bio_st *,int,const char *,int, long,long)
 | 
			
		||||
	{
 | 
			
		||||
	return b->callback;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void BIO_set_callback(BIO *b, long (*cb)(struct bio_st *,int,const char *,int, long,long))
 | 
			
		||||
	{
 | 
			
		||||
	b->callback = cb;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void BIO_set_callback_arg(BIO *b, char *arg)
 | 
			
		||||
	{
 | 
			
		||||
	b->cb_arg = arg;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
char * BIO_get_callback_arg(const BIO *b)
 | 
			
		||||
	{
 | 
			
		||||
	return b->cb_arg;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
const char * BIO_method_name(const BIO *b)
 | 
			
		||||
	{
 | 
			
		||||
	return b->method->name;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int BIO_method_type(const BIO *b)
 | 
			
		||||
	{
 | 
			
		||||
	return b->method->type;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int BIO_read(BIO *b, void *out, int outl)
 | 
			
		||||
	{
 | 
			
		||||
	int i;
 | 
			
		||||
 
 | 
			
		||||
@@ -28,13 +28,13 @@ LIBSRC=	bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c bn_mod.c \
 | 
			
		||||
	bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \
 | 
			
		||||
	bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_asm.c \
 | 
			
		||||
	bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \
 | 
			
		||||
	bn_depr.c bn_const.c
 | 
			
		||||
	bn_depr.c bn_const.c bn_x931p.c bn_opt.c
 | 
			
		||||
 | 
			
		||||
LIBOBJ=	bn_add.o bn_div.o bn_exp.o bn_lib.o bn_ctx.o bn_mul.o bn_mod.o \
 | 
			
		||||
	bn_print.o bn_rand.o bn_shift.o bn_word.o bn_blind.o \
 | 
			
		||||
	bn_kron.o bn_sqrt.o bn_gcd.o bn_prime.o bn_err.o bn_sqr.o $(BN_ASM) \
 | 
			
		||||
	bn_recp.o bn_mont.o bn_mpi.o bn_exp2.o bn_gf2m.o bn_nist.o \
 | 
			
		||||
	bn_depr.o bn_const.o
 | 
			
		||||
	bn_depr.o bn_const.o bn_x931p.o bn_opt.o
 | 
			
		||||
 | 
			
		||||
SRC= $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
@@ -58,7 +58,7 @@ bnbug: bnbug.c ../../libcrypto.a top
 | 
			
		||||
	cc -g -I../../include bnbug.c -o bnbug ../../libcrypto.a
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -283,6 +283,13 @@ bn_nist.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
bn_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
bn_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
bn_nist.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_nist.c
 | 
			
		||||
bn_opt.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
 | 
			
		||||
bn_opt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
bn_opt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
bn_opt.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
bn_opt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
bn_opt.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
bn_opt.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_opt.c
 | 
			
		||||
bn_prime.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
 | 
			
		||||
bn_prime.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
bn_prime.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
@@ -341,3 +348,6 @@ bn_word.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
bn_word.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
bn_word.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_word.c
 | 
			
		||||
bn_x931p.o: ../../include/openssl/bn.h ../../include/openssl/e_os2.h
 | 
			
		||||
bn_x931p.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
bn_x931p.o: ../../include/openssl/ossl_typ.h bn_x931p.c
 | 
			
		||||
 
 | 
			
		||||
@@ -245,8 +245,18 @@ extern "C" {
 | 
			
		||||
 | 
			
		||||
#define BN_FLG_MALLOCED		0x01
 | 
			
		||||
#define BN_FLG_STATIC_DATA	0x02
 | 
			
		||||
#define BN_FLG_EXP_CONSTTIME	0x04 /* avoid leaking exponent information through timings
 | 
			
		||||
                            	      * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
 | 
			
		||||
#define BN_FLG_CONSTTIME	0x04 /* avoid leaking exponent information through timing,
 | 
			
		||||
                                      * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,
 | 
			
		||||
                                      * BN_div() will call BN_div_no_branch,
 | 
			
		||||
                                      * BN_mod_inverse() will call BN_mod_inverse_no_branch.
 | 
			
		||||
                                      */
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_DEPRECATED
 | 
			
		||||
#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME /* deprecated name for the flag */
 | 
			
		||||
                                      /* avoid leaking exponent information through timings
 | 
			
		||||
                                      * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_DEPRECATED
 | 
			
		||||
#define BN_FLG_FREE		0x8000	/* used for debuging */
 | 
			
		||||
#endif
 | 
			
		||||
@@ -516,6 +526,26 @@ int	BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
 | 
			
		||||
int	BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
 | 
			
		||||
		int do_trial_division, BN_GENCB *cb);
 | 
			
		||||
 | 
			
		||||
int BN_X931_derive_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			void (*cb)(int, int, void *), void *cb_arg,
 | 
			
		||||
			const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx);
 | 
			
		||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
 | 
			
		||||
int BN_X931_generate_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			BIGNUM *Xp1, BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *Xp,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx,
 | 
			
		||||
			void (*cb)(int, int, void *), void *cb_arg);
 | 
			
		||||
 | 
			
		||||
int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb);
 | 
			
		||||
int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			BIGNUM *Xp1, BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *Xp,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx,
 | 
			
		||||
			BN_GENCB *cb);
 | 
			
		||||
 | 
			
		||||
BN_MONT_CTX *BN_MONT_CTX_new(void );
 | 
			
		||||
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
 | 
			
		||||
int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,
 | 
			
		||||
@@ -534,7 +564,7 @@ BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
 | 
			
		||||
#define	BN_BLINDING_NO_UPDATE	0x00000001
 | 
			
		||||
#define	BN_BLINDING_NO_RECREATE	0x00000002
 | 
			
		||||
 | 
			
		||||
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
 | 
			
		||||
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, /* const */ BIGNUM *mod);
 | 
			
		||||
void BN_BLINDING_free(BN_BLINDING *b);
 | 
			
		||||
int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx);
 | 
			
		||||
int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
 | 
			
		||||
@@ -546,7 +576,7 @@ void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
 | 
			
		||||
unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
 | 
			
		||||
void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
 | 
			
		||||
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
 | 
			
		||||
	const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
 | 
			
		||||
	const BIGNUM *e, /* const */ BIGNUM *m, BN_CTX *ctx,
 | 
			
		||||
	int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
			  const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
 | 
			
		||||
	BN_MONT_CTX *m_ctx);
 | 
			
		||||
@@ -775,6 +805,7 @@ void ERR_load_BN_strings(void);
 | 
			
		||||
#define BN_F_BN_CTX_NEW					 106
 | 
			
		||||
#define BN_F_BN_CTX_START				 129
 | 
			
		||||
#define BN_F_BN_DIV					 107
 | 
			
		||||
#define BN_F_BN_DIV_NO_BRANCH				 138
 | 
			
		||||
#define BN_F_BN_DIV_RECP				 130
 | 
			
		||||
#define BN_F_BN_EXP					 123
 | 
			
		||||
#define BN_F_BN_EXPAND2					 108
 | 
			
		||||
@@ -793,6 +824,7 @@ void ERR_load_BN_strings(void);
 | 
			
		||||
#define BN_F_BN_MOD_EXP_RECP				 125
 | 
			
		||||
#define BN_F_BN_MOD_EXP_SIMPLE				 126
 | 
			
		||||
#define BN_F_BN_MOD_INVERSE				 110
 | 
			
		||||
#define BN_F_BN_MOD_INVERSE_NO_BRANCH			 139
 | 
			
		||||
#define BN_F_BN_MOD_LSHIFT_QUICK			 119
 | 
			
		||||
#define BN_F_BN_MOD_MUL_RECIPROCAL			 111
 | 
			
		||||
#define BN_F_BN_MOD_SQRT				 121
 | 
			
		||||
 
 | 
			
		||||
@@ -131,7 +131,7 @@ struct bn_blinding_st
 | 
			
		||||
			  BN_MONT_CTX *m_ctx);
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
 | 
			
		||||
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, /* const */ BIGNUM *mod)
 | 
			
		||||
	{
 | 
			
		||||
	BN_BLINDING *ret=NULL;
 | 
			
		||||
 | 
			
		||||
@@ -151,7 +151,12 @@ BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
 | 
			
		||||
		{
 | 
			
		||||
		if ((ret->Ai = BN_dup(Ai)) == NULL) goto err;
 | 
			
		||||
		}
 | 
			
		||||
	ret->mod = mod;
 | 
			
		||||
 | 
			
		||||
	/* save a copy of mod in the BN_BLINDING structure */
 | 
			
		||||
	if ((ret->mod = BN_dup(mod)) == NULL) goto err;
 | 
			
		||||
	if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
 | 
			
		||||
		BN_set_flags(ret->mod, BN_FLG_CONSTTIME);
 | 
			
		||||
 | 
			
		||||
	ret->counter = BN_BLINDING_COUNTER;
 | 
			
		||||
	return(ret);
 | 
			
		||||
err:
 | 
			
		||||
@@ -167,6 +172,7 @@ void BN_BLINDING_free(BN_BLINDING *r)
 | 
			
		||||
	if (r->A  != NULL) BN_free(r->A );
 | 
			
		||||
	if (r->Ai != NULL) BN_free(r->Ai);
 | 
			
		||||
	if (r->e  != NULL) BN_free(r->e );
 | 
			
		||||
	if (r->mod != NULL) BN_free(r->mod); 
 | 
			
		||||
	OPENSSL_free(r);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -278,7 +284,7 @@ void BN_BLINDING_set_flags(BN_BLINDING *b, unsigned long flags)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
 | 
			
		||||
	const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
 | 
			
		||||
	const BIGNUM *e, /* const */ BIGNUM *m, BN_CTX *ctx,
 | 
			
		||||
	int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
			  const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
 | 
			
		||||
	BN_MONT_CTX *m_ctx)
 | 
			
		||||
 
 | 
			
		||||
@@ -109,4 +109,26 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
 | 
			
		||||
	return BN_is_prime_fasttest_ex(a, checks, ctx_passed,
 | 
			
		||||
				do_trial_division, &cb);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int BN_X931_derive_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			void (*callback)(int, int, void *), void *cb_arg,
 | 
			
		||||
			const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	BN_GENCB cb;
 | 
			
		||||
	BN_GENCB_set_old(&cb, callback, cb_arg);
 | 
			
		||||
	return BN_X931_derive_prime_ex(p, p1, p2, Xp, Xp1, Xp2, e, ctx, &cb);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int BN_X931_generate_prime(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			BIGNUM *Xp1, BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *Xp,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx,
 | 
			
		||||
			void (*callback)(int, int, void *), void *cb_arg)
 | 
			
		||||
	{
 | 
			
		||||
	BN_GENCB cb;
 | 
			
		||||
	BN_GENCB_set_old(&cb, callback, cb_arg);
 | 
			
		||||
	return BN_X931_generate_prime_ex(p, p1, p2, Xp1, Xp2, Xp, e, ctx, &cb);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -169,13 +169,15 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
 | 
			
		||||
#endif /* OPENSSL_NO_ASM */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* BN_div computes  dv := num / divisor,  rounding towards zero, and sets up
 | 
			
		||||
 * rm  such that  dv*divisor + rm = num  holds.
 | 
			
		||||
/* BN_div[_no_branch] computes  dv := num / divisor,  rounding towards
 | 
			
		||||
 * zero, and sets up rm  such that  dv*divisor + rm = num  holds.
 | 
			
		||||
 * Thus:
 | 
			
		||||
 *     dv->neg == num->neg ^ divisor->neg  (unless the result is zero)
 | 
			
		||||
 *     rm->neg == num->neg                 (unless the remainder is zero)
 | 
			
		||||
 * If 'dv' or 'rm' is NULL, the respective value is not returned.
 | 
			
		||||
 */
 | 
			
		||||
static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
 | 
			
		||||
        const BIGNUM *divisor, BN_CTX *ctx);
 | 
			
		||||
int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
 | 
			
		||||
	   BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
@@ -185,6 +187,11 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
 | 
			
		||||
	BN_ULONG d0,d1;
 | 
			
		||||
	int num_n,div_n;
 | 
			
		||||
 | 
			
		||||
	if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0))
 | 
			
		||||
		{
 | 
			
		||||
		return BN_div_no_branch(dv, rm, num, divisor, ctx);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	bn_check_top(dv);
 | 
			
		||||
	bn_check_top(rm);
 | 
			
		||||
	bn_check_top(num);
 | 
			
		||||
@@ -397,4 +404,229 @@ err:
 | 
			
		||||
	return(0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* BN_div_no_branch is a special version of BN_div. It does not contain
 | 
			
		||||
 * branches that may leak sensitive information.
 | 
			
		||||
 */
 | 
			
		||||
static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 
 | 
			
		||||
	const BIGNUM *divisor, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	int norm_shift,i,loop;
 | 
			
		||||
	BIGNUM *tmp,wnum,*snum,*sdiv,*res;
 | 
			
		||||
	BN_ULONG *resp,*wnump;
 | 
			
		||||
	BN_ULONG d0,d1;
 | 
			
		||||
	int num_n,div_n;
 | 
			
		||||
 | 
			
		||||
	bn_check_top(dv);
 | 
			
		||||
	bn_check_top(rm);
 | 
			
		||||
	bn_check_top(num);
 | 
			
		||||
	bn_check_top(divisor);
 | 
			
		||||
 | 
			
		||||
	if (BN_is_zero(divisor))
 | 
			
		||||
		{
 | 
			
		||||
		BNerr(BN_F_BN_DIV_NO_BRANCH,BN_R_DIV_BY_ZERO);
 | 
			
		||||
		return(0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	BN_CTX_start(ctx);
 | 
			
		||||
	tmp=BN_CTX_get(ctx);
 | 
			
		||||
	snum=BN_CTX_get(ctx);
 | 
			
		||||
	sdiv=BN_CTX_get(ctx);
 | 
			
		||||
	if (dv == NULL)
 | 
			
		||||
		res=BN_CTX_get(ctx);
 | 
			
		||||
	else	res=dv;
 | 
			
		||||
	if (sdiv == NULL || res == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	/* First we normalise the numbers */
 | 
			
		||||
	norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2);
 | 
			
		||||
	if (!(BN_lshift(sdiv,divisor,norm_shift))) goto err;
 | 
			
		||||
	sdiv->neg=0;
 | 
			
		||||
	norm_shift+=BN_BITS2;
 | 
			
		||||
	if (!(BN_lshift(snum,num,norm_shift))) goto err;
 | 
			
		||||
	snum->neg=0;
 | 
			
		||||
 | 
			
		||||
	/* Since we don't know whether snum is larger than sdiv,
 | 
			
		||||
	 * we pad snum with enough zeroes without changing its
 | 
			
		||||
	 * value. 
 | 
			
		||||
	 */
 | 
			
		||||
	if (snum->top <= sdiv->top+1) 
 | 
			
		||||
		{
 | 
			
		||||
		if (bn_wexpand(snum, sdiv->top + 2) == NULL) goto err;
 | 
			
		||||
		for (i = snum->top; i < sdiv->top + 2; i++) snum->d[i] = 0;
 | 
			
		||||
		snum->top = sdiv->top + 2;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if (bn_wexpand(snum, snum->top + 1) == NULL) goto err;
 | 
			
		||||
		snum->d[snum->top] = 0;
 | 
			
		||||
		snum->top ++;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	div_n=sdiv->top;
 | 
			
		||||
	num_n=snum->top;
 | 
			
		||||
	loop=num_n-div_n;
 | 
			
		||||
	/* Lets setup a 'window' into snum
 | 
			
		||||
	 * This is the part that corresponds to the current
 | 
			
		||||
	 * 'area' being divided */
 | 
			
		||||
	wnum.neg   = 0;
 | 
			
		||||
	wnum.d     = &(snum->d[loop]);
 | 
			
		||||
	wnum.top   = div_n;
 | 
			
		||||
	/* only needed when BN_ucmp messes up the values between top and max */
 | 
			
		||||
	wnum.dmax  = snum->dmax - loop; /* so we don't step out of bounds */
 | 
			
		||||
 | 
			
		||||
	/* Get the top 2 words of sdiv */
 | 
			
		||||
	/* div_n=sdiv->top; */
 | 
			
		||||
	d0=sdiv->d[div_n-1];
 | 
			
		||||
	d1=(div_n == 1)?0:sdiv->d[div_n-2];
 | 
			
		||||
 | 
			
		||||
	/* pointer to the 'top' of snum */
 | 
			
		||||
	wnump= &(snum->d[num_n-1]);
 | 
			
		||||
 | 
			
		||||
	/* Setup to 'res' */
 | 
			
		||||
	res->neg= (num->neg^divisor->neg);
 | 
			
		||||
	if (!bn_wexpand(res,(loop+1))) goto err;
 | 
			
		||||
	res->top=loop-1;
 | 
			
		||||
	resp= &(res->d[loop-1]);
 | 
			
		||||
 | 
			
		||||
	/* space for temp */
 | 
			
		||||
	if (!bn_wexpand(tmp,(div_n+1))) goto err;
 | 
			
		||||
 | 
			
		||||
	/* if res->top == 0 then clear the neg value otherwise decrease
 | 
			
		||||
	 * the resp pointer */
 | 
			
		||||
	if (res->top == 0)
 | 
			
		||||
		res->neg = 0;
 | 
			
		||||
	else
 | 
			
		||||
		resp--;
 | 
			
		||||
 | 
			
		||||
	for (i=0; i<loop-1; i++, wnump--, resp--)
 | 
			
		||||
		{
 | 
			
		||||
		BN_ULONG q,l0;
 | 
			
		||||
		/* the first part of the loop uses the top two words of
 | 
			
		||||
		 * snum and sdiv to calculate a BN_ULONG q such that
 | 
			
		||||
		 * | wnum - sdiv * q | < sdiv */
 | 
			
		||||
#if defined(BN_DIV3W) && !defined(OPENSSL_NO_ASM)
 | 
			
		||||
		BN_ULONG bn_div_3_words(BN_ULONG*,BN_ULONG,BN_ULONG);
 | 
			
		||||
		q=bn_div_3_words(wnump,d1,d0);
 | 
			
		||||
#else
 | 
			
		||||
		BN_ULONG n0,n1,rem=0;
 | 
			
		||||
 | 
			
		||||
		n0=wnump[0];
 | 
			
		||||
		n1=wnump[-1];
 | 
			
		||||
		if (n0 == d0)
 | 
			
		||||
			q=BN_MASK2;
 | 
			
		||||
		else 			/* n0 < d0 */
 | 
			
		||||
			{
 | 
			
		||||
#ifdef BN_LLONG
 | 
			
		||||
			BN_ULLONG t2;
 | 
			
		||||
 | 
			
		||||
#if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words)
 | 
			
		||||
			q=(BN_ULONG)(((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0);
 | 
			
		||||
#else
 | 
			
		||||
			q=bn_div_words(n0,n1,d0);
 | 
			
		||||
#ifdef BN_DEBUG_LEVITTE
 | 
			
		||||
			fprintf(stderr,"DEBUG: bn_div_words(0x%08X,0x%08X,0x%08\
 | 
			
		||||
X) -> 0x%08X\n",
 | 
			
		||||
				n0, n1, d0, q);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef REMAINDER_IS_ALREADY_CALCULATED
 | 
			
		||||
			/*
 | 
			
		||||
			 * rem doesn't have to be BN_ULLONG. The least we
 | 
			
		||||
			 * know it's less that d0, isn't it?
 | 
			
		||||
			 */
 | 
			
		||||
			rem=(n1-q*d0)&BN_MASK2;
 | 
			
		||||
#endif
 | 
			
		||||
			t2=(BN_ULLONG)d1*q;
 | 
			
		||||
 | 
			
		||||
			for (;;)
 | 
			
		||||
				{
 | 
			
		||||
				if (t2 <= ((((BN_ULLONG)rem)<<BN_BITS2)|wnump[-2]))
 | 
			
		||||
					break;
 | 
			
		||||
				q--;
 | 
			
		||||
				rem += d0;
 | 
			
		||||
				if (rem < d0) break; /* don't let rem overflow */
 | 
			
		||||
				t2 -= d1;
 | 
			
		||||
				}
 | 
			
		||||
#else /* !BN_LLONG */
 | 
			
		||||
			BN_ULONG t2l,t2h,ql,qh;
 | 
			
		||||
 | 
			
		||||
			q=bn_div_words(n0,n1,d0);
 | 
			
		||||
#ifdef BN_DEBUG_LEVITTE
 | 
			
		||||
			fprintf(stderr,"DEBUG: bn_div_words(0x%08X,0x%08X,0x%08\
 | 
			
		||||
X) -> 0x%08X\n",
 | 
			
		||||
				n0, n1, d0, q);
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef REMAINDER_IS_ALREADY_CALCULATED
 | 
			
		||||
			rem=(n1-q*d0)&BN_MASK2;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(BN_UMULT_LOHI)
 | 
			
		||||
			BN_UMULT_LOHI(t2l,t2h,d1,q);
 | 
			
		||||
#elif defined(BN_UMULT_HIGH)
 | 
			
		||||
			t2l = d1 * q;
 | 
			
		||||
			t2h = BN_UMULT_HIGH(d1,q);
 | 
			
		||||
#else
 | 
			
		||||
			t2l=LBITS(d1); t2h=HBITS(d1);
 | 
			
		||||
			ql =LBITS(q);  qh =HBITS(q);
 | 
			
		||||
			mul64(t2l,t2h,ql,qh); /* t2=(BN_ULLONG)d1*q; */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			for (;;)
 | 
			
		||||
				{
 | 
			
		||||
				if ((t2h < rem) ||
 | 
			
		||||
					((t2h == rem) && (t2l <= wnump[-2])))
 | 
			
		||||
					break;
 | 
			
		||||
				q--;
 | 
			
		||||
				rem += d0;
 | 
			
		||||
				if (rem < d0) break; /* don't let rem overflow */
 | 
			
		||||
				if (t2l < d1) t2h--; t2l -= d1;
 | 
			
		||||
				}
 | 
			
		||||
#endif /* !BN_LLONG */
 | 
			
		||||
			}
 | 
			
		||||
#endif /* !BN_DIV3W */
 | 
			
		||||
 | 
			
		||||
		l0=bn_mul_words(tmp->d,sdiv->d,div_n,q);
 | 
			
		||||
		tmp->d[div_n]=l0;
 | 
			
		||||
		wnum.d--;
 | 
			
		||||
		/* ingore top values of the bignums just sub the two 
 | 
			
		||||
		 * BN_ULONG arrays with bn_sub_words */
 | 
			
		||||
		if (bn_sub_words(wnum.d, wnum.d, tmp->d, div_n+1))
 | 
			
		||||
			{
 | 
			
		||||
			/* Note: As we have considered only the leading
 | 
			
		||||
			 * two BN_ULONGs in the calculation of q, sdiv * q
 | 
			
		||||
			 * might be greater than wnum (but then (q-1) * sdiv
 | 
			
		||||
			 * is less or equal than wnum)
 | 
			
		||||
			 */
 | 
			
		||||
			q--;
 | 
			
		||||
			if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n))
 | 
			
		||||
				/* we can't have an overflow here (assuming
 | 
			
		||||
				 * that q != 0, but if q == 0 then tmp is
 | 
			
		||||
				 * zero anyway) */
 | 
			
		||||
				(*wnump)++;
 | 
			
		||||
			}
 | 
			
		||||
		/* store part of the result */
 | 
			
		||||
		*resp = q;
 | 
			
		||||
		}
 | 
			
		||||
	bn_correct_top(snum);
 | 
			
		||||
	if (rm != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		/* Keep a copy of the neg flag in num because if rm==num
 | 
			
		||||
		 * BN_rshift() will overwrite it.
 | 
			
		||||
		 */
 | 
			
		||||
		int neg = num->neg;
 | 
			
		||||
		BN_rshift(rm,snum,norm_shift);
 | 
			
		||||
		if (!BN_is_zero(rm))
 | 
			
		||||
			rm->neg = neg;
 | 
			
		||||
		bn_check_top(rm);
 | 
			
		||||
		}
 | 
			
		||||
	bn_correct_top(res);
 | 
			
		||||
	BN_CTX_end(ctx);
 | 
			
		||||
	return(1);
 | 
			
		||||
err:
 | 
			
		||||
	bn_check_top(rm);
 | 
			
		||||
	BN_CTX_end(ctx);
 | 
			
		||||
	return(0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/* crypto/bn/bn_err.c */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1999-2007 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
 | 
			
		||||
@@ -82,6 +82,7 @@ static ERR_STRING_DATA BN_str_functs[]=
 | 
			
		||||
{ERR_FUNC(BN_F_BN_CTX_NEW),	"BN_CTX_new"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_CTX_START),	"BN_CTX_start"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_DIV),	"BN_div"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_DIV_NO_BRANCH),	"BN_div_no_branch"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_DIV_RECP),	"BN_div_recp"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_EXP),	"BN_exp"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_EXPAND2),	"bn_expand2"},
 | 
			
		||||
@@ -100,6 +101,7 @@ static ERR_STRING_DATA BN_str_functs[]=
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP_RECP),	"BN_mod_exp_recp"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_EXP_SIMPLE),	"BN_mod_exp_simple"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_INVERSE),	"BN_mod_inverse"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_INVERSE_NO_BRANCH),	"BN_mod_inverse_no_branch"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_LSHIFT_QUICK),	"BN_mod_lshift_quick"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_MUL_RECIPROCAL),	"BN_mod_mul_reciprocal"},
 | 
			
		||||
{ERR_FUNC(BN_F_BN_MOD_SQRT),	"BN_mod_sqrt"},
 | 
			
		||||
@@ -137,15 +139,12 @@ static ERR_STRING_DATA BN_str_reasons[]=
 | 
			
		||||
 | 
			
		||||
void ERR_load_BN_strings(void)
 | 
			
		||||
	{
 | 
			
		||||
	static int init=1;
 | 
			
		||||
 | 
			
		||||
	if (init)
 | 
			
		||||
		{
 | 
			
		||||
		init=0;
 | 
			
		||||
#ifndef OPENSSL_NO_ERR
 | 
			
		||||
 | 
			
		||||
	if (ERR_func_error_string(BN_str_functs[0].error) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ERR_load_strings(0,BN_str_functs);
 | 
			
		||||
		ERR_load_strings(0,BN_str_reasons);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -122,9 +122,9 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
	int i,bits,ret=0;
 | 
			
		||||
	BIGNUM *v,*rr;
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -213,7 +213,7 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
 | 
			
		||||
	if (BN_is_odd(m))
 | 
			
		||||
		{
 | 
			
		||||
#  ifdef MONT_EXP_WORD
 | 
			
		||||
		if (a->top == 1 && !a->neg && (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) == 0))
 | 
			
		||||
		if (a->top == 1 && !a->neg && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0))
 | 
			
		||||
			{
 | 
			
		||||
			BN_ULONG A = a->d[0];
 | 
			
		||||
			ret=BN_mod_exp_mont_word(r,A,p,m,ctx,NULL);
 | 
			
		||||
@@ -245,9 +245,9 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	BIGNUM *val[TABLE_SIZE];
 | 
			
		||||
	BN_RECP_CTX recp;
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_RECP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -379,7 +379,7 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	BIGNUM *val[TABLE_SIZE];
 | 
			
		||||
	BN_MONT_CTX *mont=NULL;
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
 | 
			
		||||
		}
 | 
			
		||||
@@ -745,9 +745,9 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
 | 
			
		||||
#define BN_TO_MONTGOMERY_WORD(r, w, mont) \
 | 
			
		||||
		(BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_MONT_WORD,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
@@ -881,9 +881,9 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	/* Table of variables obtained from 'ctx' */
 | 
			
		||||
	BIGNUM *val[TABLE_SIZE];
 | 
			
		||||
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
 | 
			
		||||
	if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_SIMPLE,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -203,6 +203,8 @@ err:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* solves ax == 1 (mod n) */
 | 
			
		||||
static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
 | 
			
		||||
        const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
 | 
			
		||||
BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
	const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
@@ -210,6 +212,11 @@ BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
	BIGNUM *ret=NULL;
 | 
			
		||||
	int sign;
 | 
			
		||||
 | 
			
		||||
	if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0))
 | 
			
		||||
		{
 | 
			
		||||
		return BN_mod_inverse_no_branch(in, a, n, ctx);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	bn_check_top(a);
 | 
			
		||||
	bn_check_top(n);
 | 
			
		||||
 | 
			
		||||
@@ -491,3 +498,157 @@ err:
 | 
			
		||||
	bn_check_top(ret);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* BN_mod_inverse_no_branch is a special version of BN_mod_inverse. 
 | 
			
		||||
 * It does not contain branches that may leak sensitive information.
 | 
			
		||||
 */
 | 
			
		||||
static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
 | 
			
		||||
	const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	BIGNUM *A,*B,*X,*Y,*M,*D,*T,*R=NULL;
 | 
			
		||||
	BIGNUM local_A, local_B;
 | 
			
		||||
	BIGNUM *pA, *pB;
 | 
			
		||||
	BIGNUM *ret=NULL;
 | 
			
		||||
	int sign;
 | 
			
		||||
 | 
			
		||||
	bn_check_top(a);
 | 
			
		||||
	bn_check_top(n);
 | 
			
		||||
 | 
			
		||||
	BN_CTX_start(ctx);
 | 
			
		||||
	A = BN_CTX_get(ctx);
 | 
			
		||||
	B = BN_CTX_get(ctx);
 | 
			
		||||
	X = BN_CTX_get(ctx);
 | 
			
		||||
	D = BN_CTX_get(ctx);
 | 
			
		||||
	M = BN_CTX_get(ctx);
 | 
			
		||||
	Y = BN_CTX_get(ctx);
 | 
			
		||||
	T = BN_CTX_get(ctx);
 | 
			
		||||
	if (T == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	if (in == NULL)
 | 
			
		||||
		R=BN_new();
 | 
			
		||||
	else
 | 
			
		||||
		R=in;
 | 
			
		||||
	if (R == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	BN_one(X);
 | 
			
		||||
	BN_zero(Y);
 | 
			
		||||
	if (BN_copy(B,a) == NULL) goto err;
 | 
			
		||||
	if (BN_copy(A,n) == NULL) goto err;
 | 
			
		||||
	A->neg = 0;
 | 
			
		||||
 | 
			
		||||
	if (B->neg || (BN_ucmp(B, A) >= 0))
 | 
			
		||||
		{
 | 
			
		||||
		/* Turn BN_FLG_CONSTTIME flag on, so that when BN_div is invoked,
 | 
			
		||||
	 	 * BN_div_no_branch will be called eventually.
 | 
			
		||||
	 	 */
 | 
			
		||||
		pB = &local_B;
 | 
			
		||||
		BN_with_flags(pB, B, BN_FLG_CONSTTIME);	
 | 
			
		||||
		if (!BN_nnmod(B, pB, A, ctx)) 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|).
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	while (!BN_is_zero(B))
 | 
			
		||||
		{
 | 
			
		||||
		BIGNUM *tmp;
 | 
			
		||||
		
 | 
			
		||||
		/*
 | 
			
		||||
		 *      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,
 | 
			
		||||
	 	 * BN_div_no_branch will be called eventually.
 | 
			
		||||
	 	 */
 | 
			
		||||
		pA = &local_A;
 | 
			
		||||
		BN_with_flags(pA, A, BN_FLG_CONSTTIME);	
 | 
			
		||||
		
 | 
			
		||||
		/* (D, M) := (A/B, A%B) ... */		
 | 
			
		||||
		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|).
 | 
			
		||||
		 */
 | 
			
		||||
		
 | 
			
		||||
		tmp=A; /* keep the BIGNUM object, the value does not matter */
 | 
			
		||||
		
 | 
			
		||||
		/* (A, B) := (B, A mod B) ... */
 | 
			
		||||
		A=B;
 | 
			
		||||
		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.
 | 
			
		||||
		 */
 | 
			
		||||
			
 | 
			
		||||
		if (!BN_mul(tmp,D,X,ctx)) goto err;
 | 
			
		||||
		if (!BN_add(tmp,tmp,Y)) goto err;
 | 
			
		||||
 | 
			
		||||
		M=Y; /* keep the BIGNUM object, the value does not matter */
 | 
			
		||||
		Y=X;
 | 
			
		||||
		X=tmp;
 | 
			
		||||
		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.
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	if (sign < 0)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_sub(Y,n,Y)) goto err;
 | 
			
		||||
		}
 | 
			
		||||
	/* Now  Y*a  ==  A  (mod |n|).  */
 | 
			
		||||
 | 
			
		||||
	if (BN_is_one(A))
 | 
			
		||||
		{
 | 
			
		||||
		/* Y*a == 1  (mod |n|) */
 | 
			
		||||
		if (!Y->neg && BN_ucmp(Y,n) < 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (!BN_copy(R,Y)) goto err;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			if (!BN_nnmod(R,Y,n,ctx)) goto err;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		BNerr(BN_F_BN_MOD_INVERSE_NO_BRANCH,BN_R_NO_INVERSE);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	ret=R;
 | 
			
		||||
err:
 | 
			
		||||
	if ((ret == NULL) && (in == NULL)) BN_free(R);
 | 
			
		||||
	BN_CTX_end(ctx);
 | 
			
		||||
	bn_check_top(ret);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include "bn_lcl.h"
 | 
			
		||||
 | 
			
		||||
const char *BN_version="Big Number" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
const char BN_version[]="Big Number" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
/* This stuff appears to be completely unused, so is deprecated */
 | 
			
		||||
#ifndef OPENSSL_NO_DEPRECATED
 | 
			
		||||
@@ -139,25 +139,6 @@ const BIGNUM *BN_value_one(void)
 | 
			
		||||
	return(&const_one);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
char *BN_options(void)
 | 
			
		||||
	{
 | 
			
		||||
	static int init=0;
 | 
			
		||||
	static char data[16];
 | 
			
		||||
 | 
			
		||||
	if (!init)
 | 
			
		||||
		{
 | 
			
		||||
		init++;
 | 
			
		||||
#ifdef BN_LLONG
 | 
			
		||||
		BIO_snprintf(data,sizeof data,"bn(%d,%d)",
 | 
			
		||||
			     (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
 | 
			
		||||
#else
 | 
			
		||||
		BIO_snprintf(data,sizeof data,"bn(%d,%d)",
 | 
			
		||||
			     (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	return(data);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int BN_num_bits_word(BN_ULONG l)
 | 
			
		||||
	{
 | 
			
		||||
	static const char bits[256]={
 | 
			
		||||
@@ -763,7 +744,7 @@ int BN_is_bit_set(const BIGNUM *a, int n)
 | 
			
		||||
	i=n/BN_BITS2;
 | 
			
		||||
	j=n%BN_BITS2;
 | 
			
		||||
	if (a->top <= i) return 0;
 | 
			
		||||
	return((a->d[i]&(((BN_ULONG)1)<<j))?1:0);
 | 
			
		||||
	return(((a->d[i])>>j)&((BN_ULONG)1));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int BN_mask_bits(BIGNUM *a, int n)
 | 
			
		||||
 
 | 
			
		||||
@@ -176,7 +176,6 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
 | 
			
		||||
 | 
			
		||||
	max=(nl+al+1); /* allow for overflow (no?) XXX */
 | 
			
		||||
	if (bn_wexpand(r,max) == NULL) goto err;
 | 
			
		||||
	if (bn_wexpand(ret,max) == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	r->neg=a->neg^n->neg;
 | 
			
		||||
	np=n->d;
 | 
			
		||||
@@ -228,19 +227,70 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
 | 
			
		||||
		}
 | 
			
		||||
	bn_correct_top(r);
 | 
			
		||||
	
 | 
			
		||||
	/* mont->ri will be a multiple of the word size */
 | 
			
		||||
#if 0
 | 
			
		||||
	BN_rshift(ret,r,mont->ri);
 | 
			
		||||
#else
 | 
			
		||||
	ret->neg = r->neg;
 | 
			
		||||
	x=ri;
 | 
			
		||||
	/* mont->ri will be a multiple of the word size and below code
 | 
			
		||||
	 * is kind of BN_rshift(ret,r,mont->ri) equivalent */
 | 
			
		||||
	if (r->top <= ri)
 | 
			
		||||
		{
 | 
			
		||||
		ret->top=0;
 | 
			
		||||
		retn=1;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	al=r->top-ri;
 | 
			
		||||
 | 
			
		||||
# define BRANCH_FREE 1
 | 
			
		||||
# if BRANCH_FREE
 | 
			
		||||
	if (bn_wexpand(ret,ri) == NULL) goto err;
 | 
			
		||||
	x=0-(((al-ri)>>(sizeof(al)*8-1))&1);
 | 
			
		||||
	ret->top=x=(ri&~x)|(al&x);	/* min(ri,al) */
 | 
			
		||||
	ret->neg=r->neg;
 | 
			
		||||
 | 
			
		||||
	rp=ret->d;
 | 
			
		||||
	ap= &(r->d[x]);
 | 
			
		||||
	if (r->top < x)
 | 
			
		||||
		al=0;
 | 
			
		||||
	else
 | 
			
		||||
		al=r->top-x;
 | 
			
		||||
	ap=&(r->d[ri]);
 | 
			
		||||
 | 
			
		||||
	{
 | 
			
		||||
	size_t m1,m2;
 | 
			
		||||
 | 
			
		||||
	v=bn_sub_words(rp,ap,np,ri);
 | 
			
		||||
	/* this ----------------^^ works even in al<ri case
 | 
			
		||||
	 * thanks to zealous zeroing of top of the vector in the
 | 
			
		||||
	 * beginning. */
 | 
			
		||||
 | 
			
		||||
	/* if (al==ri && !v) || al>ri) nrp=rp; else nrp=ap; */
 | 
			
		||||
	/* in other words if subtraction result is real, then
 | 
			
		||||
	 * trick unconditional memcpy below to perform in-place
 | 
			
		||||
	 * "refresh" instead of actual copy. */
 | 
			
		||||
	m1=0-(size_t)(((al-ri)>>(sizeof(al)*8-1))&1);	/* al<ri */
 | 
			
		||||
	m2=0-(size_t)(((ri-al)>>(sizeof(al)*8-1))&1);	/* al>ri */
 | 
			
		||||
	m1|=m2;			/* (al!=ri) */
 | 
			
		||||
	m1|=(0-(size_t)v);	/* (al!=ri || v) */
 | 
			
		||||
	m1&=~m2;		/* (al!=ri || v) && !al>ri */
 | 
			
		||||
	nrp=(BN_ULONG *)(((size_t)rp&~m1)|((size_t)ap&m1));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* 'i<ri' is chosen to eliminate dependency on input data, even
 | 
			
		||||
	 * though it results in redundant copy in al<ri case. */
 | 
			
		||||
	for (i=0,ri-=4; i<ri; i+=4)
 | 
			
		||||
		{
 | 
			
		||||
		BN_ULONG t1,t2,t3,t4;
 | 
			
		||||
		
 | 
			
		||||
		t1=nrp[i+0];
 | 
			
		||||
		t2=nrp[i+1];
 | 
			
		||||
		t3=nrp[i+2];	ap[i+0]=0;
 | 
			
		||||
		t4=nrp[i+3];	ap[i+1]=0;
 | 
			
		||||
		rp[i+0]=t1;	ap[i+2]=0;
 | 
			
		||||
		rp[i+1]=t2;	ap[i+3]=0;
 | 
			
		||||
		rp[i+2]=t3;
 | 
			
		||||
		rp[i+3]=t4;
 | 
			
		||||
		}
 | 
			
		||||
	for (ri+=4; i<ri; i++)
 | 
			
		||||
		rp[i]=nrp[i], ap[i]=0;
 | 
			
		||||
# else
 | 
			
		||||
	if (bn_wexpand(ret,al) == NULL) goto err;
 | 
			
		||||
	ret->top=al;
 | 
			
		||||
	ret->neg=r->neg;
 | 
			
		||||
 | 
			
		||||
	rp=ret->d;
 | 
			
		||||
	ap=&(r->d[ri]);
 | 
			
		||||
	al-=4;
 | 
			
		||||
	for (i=0; i<al; i+=4)
 | 
			
		||||
		{
 | 
			
		||||
@@ -258,7 +308,7 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
 | 
			
		||||
	al+=4;
 | 
			
		||||
	for (; i<al; i++)
 | 
			
		||||
		rp[i]=ap[i];
 | 
			
		||||
#endif
 | 
			
		||||
# endif
 | 
			
		||||
#else /* !MONT_WORD */ 
 | 
			
		||||
	BIGNUM *t1,*t2;
 | 
			
		||||
 | 
			
		||||
@@ -278,10 +328,12 @@ int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
 | 
			
		||||
	if (!BN_rshift(ret,t2,mont->ri)) goto err;
 | 
			
		||||
#endif /* MONT_WORD */
 | 
			
		||||
 | 
			
		||||
#if !defined(BRANCH_FREE) || BRANCH_FREE==0
 | 
			
		||||
	if (BN_ucmp(ret, &(mont->N)) >= 0)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_usub(ret,ret,&(mont->N))) goto err;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	retn=1;
 | 
			
		||||
	bn_check_top(ret);
 | 
			
		||||
 err:
 | 
			
		||||
 
 | 
			
		||||
@@ -655,16 +655,16 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
 | 
			
		||||
				for (;;)
 | 
			
		||||
					{
 | 
			
		||||
					i/=2;
 | 
			
		||||
					if (i < tna && i < tnb)
 | 
			
		||||
					if (i <= tna && tna == tnb)
 | 
			
		||||
						{
 | 
			
		||||
						bn_mul_part_recursive(&(r[n2]),
 | 
			
		||||
						bn_mul_recursive(&(r[n2]),
 | 
			
		||||
							&(a[n]),&(b[n]),
 | 
			
		||||
							i,tna-i,tnb-i,p);
 | 
			
		||||
						break;
 | 
			
		||||
						}
 | 
			
		||||
					else if (i <= tna && i <= tnb)
 | 
			
		||||
					else if (i < tna || i < tnb)
 | 
			
		||||
						{
 | 
			
		||||
						bn_mul_recursive(&(r[n2]),
 | 
			
		||||
						bn_mul_part_recursive(&(r[n2]),
 | 
			
		||||
							&(a[n]),&(b[n]),
 | 
			
		||||
							i,tna-i,tnb-i,p);
 | 
			
		||||
						break;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										87
									
								
								crypto/bn/bn_opt.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								crypto/bn/bn_opt.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,87 @@
 | 
			
		||||
/* crypto/bn/bn_opt.c */
 | 
			
		||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This package is an SSL implementation written
 | 
			
		||||
 * by Eric Young (eay@cryptsoft.com).
 | 
			
		||||
 * The implementation was written so as to conform with Netscapes SSL.
 | 
			
		||||
 * 
 | 
			
		||||
 * This library is free for commercial and non-commercial use as long as
 | 
			
		||||
 * the following conditions are aheared to.  The following conditions
 | 
			
		||||
 * apply to all code found in this distribution, be it the RC4, RSA,
 | 
			
		||||
 * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
 | 
			
		||||
 * included with this distribution is covered by the same copyright terms
 | 
			
		||||
 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright remains Eric Young's, and as such any Copyright notices in
 | 
			
		||||
 * the code are not to be removed.
 | 
			
		||||
 * If this package is used in a product, Eric Young should be given attribution
 | 
			
		||||
 * as the author of the parts of the library used.
 | 
			
		||||
 * This can be in the form of a textual message at program startup or
 | 
			
		||||
 * in documentation (online or textual) provided with the package.
 | 
			
		||||
 * 
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *    "This product includes cryptographic software written by
 | 
			
		||||
 *     Eric Young (eay@cryptsoft.com)"
 | 
			
		||||
 *    The word 'cryptographic' can be left out if the rouines from the library
 | 
			
		||||
 *    being used are not cryptographic related :-).
 | 
			
		||||
 * 4. If you include any Windows specific code (or a derivative thereof) from 
 | 
			
		||||
 *    the apps directory (application code) you must include an acknowledgement:
 | 
			
		||||
 *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
 | 
			
		||||
 * 
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 * 
 | 
			
		||||
 * The licence and distribution terms for any publically available version or
 | 
			
		||||
 * derivative of this code cannot be changed.  i.e. this code cannot simply be
 | 
			
		||||
 * copied and put under another distribution licence
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef BN_DEBUG
 | 
			
		||||
# undef NDEBUG /* avoid conflicting definitions */
 | 
			
		||||
# define NDEBUG
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include "bn_lcl.h"
 | 
			
		||||
 | 
			
		||||
char *BN_options(void)
 | 
			
		||||
	{
 | 
			
		||||
	static int init=0;
 | 
			
		||||
	static char data[16];
 | 
			
		||||
 | 
			
		||||
	if (!init)
 | 
			
		||||
		{
 | 
			
		||||
		init++;
 | 
			
		||||
#ifdef BN_LLONG
 | 
			
		||||
		BIO_snprintf(data,sizeof data,"bn(%d,%d)",
 | 
			
		||||
			     (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
 | 
			
		||||
#else
 | 
			
		||||
		BIO_snprintf(data,sizeof data,"bn(%d,%d)",
 | 
			
		||||
			     (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	return(data);
 | 
			
		||||
	}
 | 
			
		||||
@@ -62,7 +62,7 @@
 | 
			
		||||
#include <openssl/buffer.h>
 | 
			
		||||
#include "bn_lcl.h"
 | 
			
		||||
 | 
			
		||||
static const char *Hex="0123456789ABCDEF";
 | 
			
		||||
static const char Hex[]="0123456789ABCDEF";
 | 
			
		||||
 | 
			
		||||
/* Must 'OPENSSL_free' the returned data */
 | 
			
		||||
char *BN_bn2hex(const BIGNUM *a)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										272
									
								
								crypto/bn/bn_x931p.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										272
									
								
								crypto/bn/bn_x931p.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,272 @@
 | 
			
		||||
/* bn_x931p.c */
 | 
			
		||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
 | 
			
		||||
 * project 2005.
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 2005 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer. 
 | 
			
		||||
 *
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in
 | 
			
		||||
 *    the documentation and/or other materials provided with the
 | 
			
		||||
 *    distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this
 | 
			
		||||
 *    software must display the following acknowledgment:
 | 
			
		||||
 *    "This product includes software developed by the OpenSSL Project
 | 
			
		||||
 *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
 | 
			
		||||
 *
 | 
			
		||||
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 | 
			
		||||
 *    endorse or promote products derived from this software without
 | 
			
		||||
 *    prior written permission. For written permission, please contact
 | 
			
		||||
 *    licensing@OpenSSL.org.
 | 
			
		||||
 *
 | 
			
		||||
 * 5. Products derived from this software may not be called "OpenSSL"
 | 
			
		||||
 *    nor may "OpenSSL" appear in their names without prior written
 | 
			
		||||
 *    permission of the OpenSSL Project.
 | 
			
		||||
 *
 | 
			
		||||
 * 6. Redistributions of any form whatsoever must retain the following
 | 
			
		||||
 *    acknowledgment:
 | 
			
		||||
 *    "This product includes software developed by the OpenSSL Project
 | 
			
		||||
 *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 | 
			
		||||
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 | 
			
		||||
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 | 
			
		||||
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 | 
			
		||||
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 | 
			
		||||
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 | 
			
		||||
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 * ====================================================================
 | 
			
		||||
 *
 | 
			
		||||
 * This product includes cryptographic software written by Eric Young
 | 
			
		||||
 * (eay@cryptsoft.com).  This product includes software written by Tim
 | 
			
		||||
 * Hudson (tjh@cryptsoft.com).
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
 | 
			
		||||
/* X9.31 routines for prime derivation */
 | 
			
		||||
 | 
			
		||||
/* X9.31 prime derivation. This is used to generate the primes pi
 | 
			
		||||
 * (p1, p2, q1, q2) from a parameter Xpi by checking successive odd
 | 
			
		||||
 * integers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static int bn_x931_derive_pi(BIGNUM *pi, const BIGNUM *Xpi, BN_CTX *ctx,
 | 
			
		||||
			BN_GENCB *cb)
 | 
			
		||||
	{
 | 
			
		||||
	int i = 0;
 | 
			
		||||
	if (!BN_copy(pi, Xpi))
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (!BN_is_odd(pi) && !BN_add_word(pi, 1))
 | 
			
		||||
		return 0;
 | 
			
		||||
	for(;;)
 | 
			
		||||
		{
 | 
			
		||||
		i++;
 | 
			
		||||
		BN_GENCB_call(cb, 0, i);
 | 
			
		||||
		/* NB 27 MR is specificed in X9.31 */
 | 
			
		||||
		if (BN_is_prime_fasttest_ex(pi, 27, ctx, 1, cb))
 | 
			
		||||
			break;
 | 
			
		||||
		if (!BN_add_word(pi, 2))
 | 
			
		||||
			return 0;
 | 
			
		||||
		}
 | 
			
		||||
	BN_GENCB_call(cb, 2, i);
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* This is the main X9.31 prime derivation function. From parameters
 | 
			
		||||
 * Xp1, Xp2 and Xp derive the prime p. If the parameters p1 or p2 are
 | 
			
		||||
 * not NULL they will be returned too: this is needed for testing.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb)
 | 
			
		||||
	{
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
 | 
			
		||||
	BIGNUM *t, *p1p2, *pm1;
 | 
			
		||||
 | 
			
		||||
	/* Only even e supported */
 | 
			
		||||
	if (!BN_is_odd(e))
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	BN_CTX_start(ctx);
 | 
			
		||||
	if (!p1)
 | 
			
		||||
		p1 = BN_CTX_get(ctx);
 | 
			
		||||
 | 
			
		||||
	if (!p2)
 | 
			
		||||
		p2 = BN_CTX_get(ctx);
 | 
			
		||||
 | 
			
		||||
	t = BN_CTX_get(ctx);
 | 
			
		||||
 | 
			
		||||
	p1p2 = BN_CTX_get(ctx);
 | 
			
		||||
 | 
			
		||||
	pm1 = BN_CTX_get(ctx);
 | 
			
		||||
 | 
			
		||||
	if (!bn_x931_derive_pi(p1, Xp1, ctx, cb))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!bn_x931_derive_pi(p2, Xp2, ctx, cb))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!BN_mul(p1p2, p1, p2, ctx))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	/* First set p to value of Rp */
 | 
			
		||||
 | 
			
		||||
	if (!BN_mod_inverse(p, p2, p1, ctx))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!BN_mul(p, p, p2, ctx))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!BN_mod_inverse(t, p1, p2, ctx))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!BN_mul(t, t, p1, ctx))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!BN_sub(p, p, t))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (p->neg && !BN_add(p, p, p1p2))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	/* p now equals Rp */
 | 
			
		||||
 | 
			
		||||
	if (!BN_mod_sub(p, p, Xp, p1p2, ctx))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if (!BN_add(p, p, Xp))
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	/* p now equals Yp0 */
 | 
			
		||||
 | 
			
		||||
	for (;;)
 | 
			
		||||
		{
 | 
			
		||||
		int i = 1;
 | 
			
		||||
		BN_GENCB_call(cb, 0, i++);
 | 
			
		||||
		if (!BN_copy(pm1, p))
 | 
			
		||||
			goto err;
 | 
			
		||||
		if (!BN_sub_word(pm1, 1))
 | 
			
		||||
			goto err;
 | 
			
		||||
		if (!BN_gcd(t, pm1, e, ctx))
 | 
			
		||||
			goto err;
 | 
			
		||||
		if (BN_is_one(t)
 | 
			
		||||
		/* X9.31 specifies 8 MR and 1 Lucas test or any prime test
 | 
			
		||||
		 * offering similar or better guarantees 50 MR is considerably 
 | 
			
		||||
		 * better.
 | 
			
		||||
		 */
 | 
			
		||||
			&& BN_is_prime_fasttest_ex(p, 50, ctx, 1, cb))
 | 
			
		||||
			break;
 | 
			
		||||
		if (!BN_add(p, p, p1p2))
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	BN_GENCB_call(cb, 3, 0);
 | 
			
		||||
 | 
			
		||||
	ret = 1;
 | 
			
		||||
 | 
			
		||||
	err:
 | 
			
		||||
 | 
			
		||||
	BN_CTX_end(ctx);
 | 
			
		||||
 | 
			
		||||
	return ret;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* Generate pair of paramters Xp, Xq for X9.31 prime generation.
 | 
			
		||||
 * Note: nbits paramter is sum of number of bits in both.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	BIGNUM *t;
 | 
			
		||||
	int i;
 | 
			
		||||
	/* Number of bits for each prime is of the form
 | 
			
		||||
	 * 512+128s for s = 0, 1, ...
 | 
			
		||||
	 */
 | 
			
		||||
	if ((nbits < 1024) || (nbits & 0xff))
 | 
			
		||||
		return 0;
 | 
			
		||||
	nbits >>= 1;
 | 
			
		||||
	/* The random value Xp must be between sqrt(2) * 2^(nbits-1) and
 | 
			
		||||
	 * 2^nbits - 1. By setting the top two bits we ensure that the lower
 | 
			
		||||
	 * bound is exceeded.
 | 
			
		||||
	 */
 | 
			
		||||
	if (!BN_rand(Xp, nbits, 1, 0))
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	BN_CTX_start(ctx);
 | 
			
		||||
	t = BN_CTX_get(ctx);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < 1000; i++)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_rand(Xq, nbits, 1, 0))
 | 
			
		||||
			return 0;
 | 
			
		||||
		/* Check that |Xp - Xq| > 2^(nbits - 100) */
 | 
			
		||||
		BN_sub(t, Xp, Xq);
 | 
			
		||||
		if (BN_num_bits(t) > (nbits - 100))
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	BN_CTX_end(ctx);
 | 
			
		||||
 | 
			
		||||
	if (i < 1000)
 | 
			
		||||
		return 1;
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* Generate primes using X9.31 algorithm. Of the values p, p1, p2, Xp1
 | 
			
		||||
 * and Xp2 only 'p' needs to be non-NULL. If any of the others are not NULL
 | 
			
		||||
 * the relevant parameter will be stored in it.
 | 
			
		||||
 *
 | 
			
		||||
 * Due to the fact that |Xp - Xq| > 2^(nbits - 100) must be satisfied Xp and Xq
 | 
			
		||||
 * are generated using the previous function and supplied as input.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
 | 
			
		||||
			BIGNUM *Xp1, BIGNUM *Xp2,
 | 
			
		||||
			const BIGNUM *Xp,
 | 
			
		||||
			const BIGNUM *e, BN_CTX *ctx,
 | 
			
		||||
			BN_GENCB *cb)
 | 
			
		||||
	{
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
 | 
			
		||||
	BN_CTX_start(ctx);
 | 
			
		||||
	if (!Xp1)
 | 
			
		||||
		Xp1 = BN_CTX_get(ctx);
 | 
			
		||||
	if (!Xp2)
 | 
			
		||||
		Xp2 = BN_CTX_get(ctx);
 | 
			
		||||
 | 
			
		||||
	if (!BN_rand(Xp1, 101, 0, 0))
 | 
			
		||||
		goto error;
 | 
			
		||||
	if (!BN_rand(Xp2, 101, 0, 0))
 | 
			
		||||
		goto error;
 | 
			
		||||
	if (!BN_X931_derive_prime_ex(p, p1, p2, Xp, Xp1, Xp2, e, ctx, cb))
 | 
			
		||||
		goto error;
 | 
			
		||||
 | 
			
		||||
	ret = 1;
 | 
			
		||||
 | 
			
		||||
	error:
 | 
			
		||||
	BN_CTX_end(ctx);
 | 
			
		||||
 | 
			
		||||
	return ret;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -184,120 +184,120 @@ int main(int argc, char *argv[])
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_add");
 | 
			
		||||
	if (!test_add(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_sub");
 | 
			
		||||
	if (!test_sub(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_lshift1");
 | 
			
		||||
	if (!test_lshift1(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_lshift (fixed)");
 | 
			
		||||
	if (!test_lshift(out,ctx,BN_bin2bn(lst,sizeof(lst)-1,NULL)))
 | 
			
		||||
	    goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_lshift");
 | 
			
		||||
	if (!test_lshift(out,ctx,NULL)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_rshift1");
 | 
			
		||||
	if (!test_rshift1(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_rshift");
 | 
			
		||||
	if (!test_rshift(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_sqr");
 | 
			
		||||
	if (!test_sqr(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mul");
 | 
			
		||||
	if (!test_mul(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_div");
 | 
			
		||||
	if (!test_div(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_div_word");
 | 
			
		||||
	if (!test_div_word(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_div_recp");
 | 
			
		||||
	if (!test_div_recp(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mod");
 | 
			
		||||
	if (!test_mod(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mod_mul");
 | 
			
		||||
	if (!test_mod_mul(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mont");
 | 
			
		||||
	if (!test_mont(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mod_exp");
 | 
			
		||||
	if (!test_mod_exp(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mod_exp_mont_consttime");
 | 
			
		||||
	if (!test_mod_exp_mont_consttime(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_exp");
 | 
			
		||||
	if (!test_exp(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_kronecker");
 | 
			
		||||
	if (!test_kron(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_mod_sqrt");
 | 
			
		||||
	if (!test_sqrt(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_add");
 | 
			
		||||
	if (!test_gf2m_add(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod");
 | 
			
		||||
	if (!test_gf2m_mod(out)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod_mul");
 | 
			
		||||
	if (!test_gf2m_mod_mul(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod_sqr");
 | 
			
		||||
	if (!test_gf2m_mod_sqr(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod_inv");
 | 
			
		||||
	if (!test_gf2m_mod_inv(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod_div");
 | 
			
		||||
	if (!test_gf2m_mod_div(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod_exp");
 | 
			
		||||
	if (!test_gf2m_mod_exp(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod_sqrt");
 | 
			
		||||
	if (!test_gf2m_mod_sqrt(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	message(out,"BN_GF2m_mod_solve_quad");
 | 
			
		||||
	if (!test_gf2m_mod_solve_quad(out,ctx)) goto err;
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
 | 
			
		||||
	BN_CTX_free(ctx);
 | 
			
		||||
	BIO_free(out);
 | 
			
		||||
@@ -307,7 +307,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
err:
 | 
			
		||||
	BIO_puts(out,"1\n"); /* make sure the Perl script fed by bc notices
 | 
			
		||||
	                      * the failure, see test_bn in test/Makefile.ssl*/
 | 
			
		||||
	BIO_flush(out);
 | 
			
		||||
	(void)BIO_flush(out);
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
	ERR_print_errors_fp(stderr);
 | 
			
		||||
	EXIT(1);
 | 
			
		||||
 
 | 
			
		||||
@@ -17,8 +17,8 @@ TEST=
 | 
			
		||||
APPS=
 | 
			
		||||
 | 
			
		||||
LIB=$(TOP)/libcrypto.a
 | 
			
		||||
LIBSRC= buffer.c buf_err.c
 | 
			
		||||
LIBOBJ= buffer.o buf_err.o
 | 
			
		||||
LIBSRC= buffer.c buf_str.c buf_err.c
 | 
			
		||||
LIBOBJ= buffer.o buf_str.o buf_err.o
 | 
			
		||||
 | 
			
		||||
SRC= $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
@@ -33,7 +33,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -81,6 +81,13 @@ buf_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
buf_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
 | 
			
		||||
buf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
buf_err.o: buf_err.c
 | 
			
		||||
buf_str.o: ../../e_os.h ../../include/openssl/bio.h
 | 
			
		||||
buf_str.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
buf_str.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
buf_str.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
buf_str.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
buf_str.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
buf_str.o: ../../include/openssl/symhacks.h ../cryptlib.h buf_str.c
 | 
			
		||||
buffer.o: ../../e_os.h ../../include/openssl/bio.h
 | 
			
		||||
buffer.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
 
 | 
			
		||||
@@ -88,15 +88,12 @@ static ERR_STRING_DATA BUF_str_reasons[]=
 | 
			
		||||
 | 
			
		||||
void ERR_load_BUF_strings(void)
 | 
			
		||||
	{
 | 
			
		||||
	static int init=1;
 | 
			
		||||
 | 
			
		||||
	if (init)
 | 
			
		||||
		{
 | 
			
		||||
		init=0;
 | 
			
		||||
#ifndef OPENSSL_NO_ERR
 | 
			
		||||
 | 
			
		||||
	if (ERR_func_error_string(BUF_str_functs[0].error) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ERR_load_strings(0,BUF_str_functs);
 | 
			
		||||
		ERR_load_strings(0,BUF_str_reasons);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										116
									
								
								crypto/buffer/buf_str.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										116
									
								
								crypto/buffer/buf_str.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,116 @@
 | 
			
		||||
/* crypto/buffer/buf_str.c */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 2007 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
 | 
			
		||||
 * are met:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer. 
 | 
			
		||||
 *
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in
 | 
			
		||||
 *    the documentation and/or other materials provided with the
 | 
			
		||||
 *    distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this
 | 
			
		||||
 *    software must display the following acknowledgment:
 | 
			
		||||
 *    "This product includes software developed by the OpenSSL Project
 | 
			
		||||
 *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
 | 
			
		||||
 *
 | 
			
		||||
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 | 
			
		||||
 *    endorse or promote products derived from this software without
 | 
			
		||||
 *    prior written permission. For written permission, please contact
 | 
			
		||||
 *    licensing@OpenSSL.org.
 | 
			
		||||
 *
 | 
			
		||||
 * 5. Products derived from this software may not be called "OpenSSL"
 | 
			
		||||
 *    nor may "OpenSSL" appear in their names without prior written
 | 
			
		||||
 *    permission of the OpenSSL Project.
 | 
			
		||||
 *
 | 
			
		||||
 * 6. Redistributions of any form whatsoever must retain the following
 | 
			
		||||
 *    acknowledgment:
 | 
			
		||||
 *    "This product includes software developed by the OpenSSL Project
 | 
			
		||||
 *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 | 
			
		||||
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 | 
			
		||||
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 | 
			
		||||
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 | 
			
		||||
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 | 
			
		||||
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 | 
			
		||||
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 * ====================================================================
 | 
			
		||||
 *
 | 
			
		||||
 * This product includes cryptographic software written by Eric Young
 | 
			
		||||
 * (eay@cryptsoft.com).  This product includes software written by Tim
 | 
			
		||||
 * Hudson (tjh@cryptsoft.com).
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/buffer.h>
 | 
			
		||||
 | 
			
		||||
char *BUF_strdup(const char *str)
 | 
			
		||||
	{
 | 
			
		||||
	if (str == NULL) return(NULL);
 | 
			
		||||
	return BUF_strndup(str, strlen(str));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
char *BUF_strndup(const char *str, size_t siz)
 | 
			
		||||
	{
 | 
			
		||||
	char *ret;
 | 
			
		||||
 | 
			
		||||
	if (str == NULL) return(NULL);
 | 
			
		||||
 | 
			
		||||
	ret=OPENSSL_malloc(siz+1);
 | 
			
		||||
	if (ret == NULL) 
 | 
			
		||||
		{
 | 
			
		||||
		BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
	BUF_strlcpy(ret,str,siz+1);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void *BUF_memdup(const void *data, size_t siz)
 | 
			
		||||
	{
 | 
			
		||||
	void *ret;
 | 
			
		||||
 | 
			
		||||
	if (data == NULL) return(NULL);
 | 
			
		||||
 | 
			
		||||
	ret=OPENSSL_malloc(siz);
 | 
			
		||||
	if (ret == NULL) 
 | 
			
		||||
		{
 | 
			
		||||
		BUFerr(BUF_F_BUF_MEMDUP,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
	return memcpy(ret, data, siz);
 | 
			
		||||
	}	
 | 
			
		||||
 | 
			
		||||
size_t BUF_strlcpy(char *dst, const char *src, size_t size)
 | 
			
		||||
	{
 | 
			
		||||
	size_t l = 0;
 | 
			
		||||
	for(; size > 1 && *src; size--)
 | 
			
		||||
		{
 | 
			
		||||
		*dst++ = *src++;
 | 
			
		||||
		l++;
 | 
			
		||||
		}
 | 
			
		||||
	if (size)
 | 
			
		||||
		*dst = '\0';
 | 
			
		||||
	return l + strlen(src);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
size_t BUF_strlcat(char *dst, const char *src, size_t size)
 | 
			
		||||
	{
 | 
			
		||||
	size_t l = 0;
 | 
			
		||||
	for(; size > 0 && *dst; size--, dst++)
 | 
			
		||||
		l++;
 | 
			
		||||
	return l + BUF_strlcpy(dst, src, size);
 | 
			
		||||
	}
 | 
			
		||||
@@ -161,61 +161,3 @@ int BUF_MEM_grow_clean(BUF_MEM *str, int len)
 | 
			
		||||
		}
 | 
			
		||||
	return(len);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
char *BUF_strdup(const char *str)
 | 
			
		||||
	{
 | 
			
		||||
	if (str == NULL) return(NULL);
 | 
			
		||||
	return BUF_strndup(str, strlen(str));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
char *BUF_strndup(const char *str, size_t siz)
 | 
			
		||||
	{
 | 
			
		||||
	char *ret;
 | 
			
		||||
 | 
			
		||||
	if (str == NULL) return(NULL);
 | 
			
		||||
 | 
			
		||||
	ret=OPENSSL_malloc(siz+1);
 | 
			
		||||
	if (ret == NULL) 
 | 
			
		||||
		{
 | 
			
		||||
		BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
	BUF_strlcpy(ret,str,siz+1);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void *BUF_memdup(const void *data, size_t siz)
 | 
			
		||||
	{
 | 
			
		||||
	void *ret;
 | 
			
		||||
 | 
			
		||||
	if (data == NULL) return(NULL);
 | 
			
		||||
 | 
			
		||||
	ret=OPENSSL_malloc(siz);
 | 
			
		||||
	if (ret == NULL) 
 | 
			
		||||
		{
 | 
			
		||||
		BUFerr(BUF_F_BUF_MEMDUP,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
	return memcpy(ret, data, siz);
 | 
			
		||||
	}	
 | 
			
		||||
 | 
			
		||||
size_t BUF_strlcpy(char *dst, const char *src, size_t size)
 | 
			
		||||
	{
 | 
			
		||||
	size_t l = 0;
 | 
			
		||||
	for(; size > 1 && *src; size--)
 | 
			
		||||
		{
 | 
			
		||||
		*dst++ = *src++;
 | 
			
		||||
		l++;
 | 
			
		||||
		}
 | 
			
		||||
	if (size)
 | 
			
		||||
		*dst = '\0';
 | 
			
		||||
	return l + strlen(src);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
size_t BUF_strlcat(char *dst, const char *src, size_t size)
 | 
			
		||||
	{
 | 
			
		||||
	size_t l = 0;
 | 
			
		||||
	for(; size > 0 && *dst; size--, dst++)
 | 
			
		||||
		l++;
 | 
			
		||||
	return l + BUF_strlcpy(dst, src, size);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -85,19 +85,19 @@ clean:
 | 
			
		||||
 | 
			
		||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
 | 
			
		||||
 | 
			
		||||
camellia.o: ../../include/openssl/opensslconf.h camellia.c camellia.h
 | 
			
		||||
camellia.o: cmll_locl.h
 | 
			
		||||
cmll_cbc.o: ../../include/openssl/camellia.h
 | 
			
		||||
camellia.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
 | 
			
		||||
camellia.o: camellia.c camellia.h cmll_locl.h
 | 
			
		||||
cmll_cbc.o: ../../include/openssl/camellia.h ../../include/openssl/e_os2.h
 | 
			
		||||
cmll_cbc.o: ../../include/openssl/opensslconf.h cmll_cbc.c cmll_locl.h
 | 
			
		||||
cmll_cfb.o: ../../e_os.h ../../include/openssl/camellia.h
 | 
			
		||||
cmll_cfb.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
 | 
			
		||||
cmll_cfb.o: cmll_cfb.c cmll_locl.h
 | 
			
		||||
cmll_ctr.o: ../../include/openssl/camellia.h
 | 
			
		||||
cmll_ctr.o: ../../include/openssl/camellia.h ../../include/openssl/e_os2.h
 | 
			
		||||
cmll_ctr.o: ../../include/openssl/opensslconf.h cmll_ctr.c cmll_locl.h
 | 
			
		||||
cmll_ecb.o: ../../include/openssl/camellia.h
 | 
			
		||||
cmll_ecb.o: ../../include/openssl/camellia.h ../../include/openssl/e_os2.h
 | 
			
		||||
cmll_ecb.o: ../../include/openssl/opensslconf.h cmll_ecb.c cmll_locl.h
 | 
			
		||||
cmll_misc.o: ../../include/openssl/camellia.h
 | 
			
		||||
cmll_misc.o: ../../include/openssl/camellia.h ../../include/openssl/e_os2.h
 | 
			
		||||
cmll_misc.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
cmll_misc.o: ../../include/openssl/opensslv.h cmll_locl.h cmll_misc.c
 | 
			
		||||
cmll_ofb.o: ../../include/openssl/camellia.h
 | 
			
		||||
cmll_ofb.o: ../../include/openssl/camellia.h ../../include/openssl/e_os2.h
 | 
			
		||||
cmll_ofb.o: ../../include/openssl/opensslconf.h cmll_locl.h cmll_ofb.c
 | 
			
		||||
 
 | 
			
		||||
@@ -76,12 +76,7 @@
 | 
			
		||||
#include "camellia.h"
 | 
			
		||||
#include "cmll_locl.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * must be defined uint32_t
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* key constants */
 | 
			
		||||
 | 
			
		||||
#define CAMELLIA_SIGMA1L (0xA09E667FL)
 | 
			
		||||
#define CAMELLIA_SIGMA1R (0x3BCC908BL)
 | 
			
		||||
#define CAMELLIA_SIGMA2L (0xB67AE858L)
 | 
			
		||||
@@ -100,18 +95,9 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* e is pointer of subkey */
 | 
			
		||||
#ifdef L_ENDIAN
 | 
			
		||||
 | 
			
		||||
#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2 + 1])
 | 
			
		||||
#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2])
 | 
			
		||||
 | 
			
		||||
#else /* big endian */
 | 
			
		||||
 | 
			
		||||
#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
 | 
			
		||||
#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
 | 
			
		||||
 | 
			
		||||
#endif /* IS_LITTLE_ENDIAN */
 | 
			
		||||
 | 
			
		||||
/* rotation right shift 1byte */
 | 
			
		||||
#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
 | 
			
		||||
/* rotation left shift 1bit */
 | 
			
		||||
@@ -170,44 +156,6 @@ do									\
 | 
			
		||||
 * for speed up
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
#if !defined(_MSC_VER)
 | 
			
		||||
 | 
			
		||||
#define CAMELLIA_FLS(ll, lr, rl, rr, kll, klr, krl, krr, t0, t1, t2, t3) \
 | 
			
		||||
do									\
 | 
			
		||||
	{								\
 | 
			
		||||
	t0 = kll;							\
 | 
			
		||||
	t2 = krr;							\
 | 
			
		||||
	t0 &= ll;							\
 | 
			
		||||
	t2 |= rr;							\
 | 
			
		||||
	rl ^= t2;							\
 | 
			
		||||
	lr ^= CAMELLIA_RL1(t0);						\
 | 
			
		||||
	t3 = krl;							\
 | 
			
		||||
	t1 = klr;							\
 | 
			
		||||
	t3 &= rl;							\
 | 
			
		||||
	t1 |= lr;							\
 | 
			
		||||
	ll ^= t1;							\
 | 
			
		||||
	rr ^= CAMELLIA_RL1(t3);						\
 | 
			
		||||
	} while(0)
 | 
			
		||||
 | 
			
		||||
#define CAMELLIA_ROUNDSM(xl, xr, kl, kr, yl, yr, il, ir, t0, t1)	\
 | 
			
		||||
do									\
 | 
			
		||||
	{								\
 | 
			
		||||
	ir =  CAMELLIA_SP1110(xr & 0xff);				\
 | 
			
		||||
	il =  CAMELLIA_SP1110((xl>>24) & 0xff);				\
 | 
			
		||||
	ir ^= CAMELLIA_SP0222((xr>>24) & 0xff);				\
 | 
			
		||||
	il ^= CAMELLIA_SP0222((xl>>16) & 0xff);				\
 | 
			
		||||
	ir ^= CAMELLIA_SP3033((xr>>16) & 0xff);				\
 | 
			
		||||
	il ^= CAMELLIA_SP3033((xl>>8) & 0xff);				\
 | 
			
		||||
	ir ^= CAMELLIA_SP4404((xr>>8) & 0xff);				\
 | 
			
		||||
	il ^= CAMELLIA_SP4404(xl & 0xff);				\
 | 
			
		||||
	il ^= kl;							\
 | 
			
		||||
	ir ^= il ^ kr;							\
 | 
			
		||||
	yl ^= ir;							\
 | 
			
		||||
	yr ^= CAMELLIA_RR8(il) ^ ir;					\
 | 
			
		||||
	} while(0)
 | 
			
		||||
 | 
			
		||||
#else /* for MS-VC */
 | 
			
		||||
 | 
			
		||||
#define CAMELLIA_FLS(ll, lr, rl, rr, kll, klr, krl, krr, t0, t1, t2, t3) \
 | 
			
		||||
do									\
 | 
			
		||||
	{								\
 | 
			
		||||
@@ -249,9 +197,8 @@ do									\
 | 
			
		||||
	yl ^= ir;							\
 | 
			
		||||
	yr ^= il;							\
 | 
			
		||||
	} while(0)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static const uint32_t camellia_sp1110[256] =
 | 
			
		||||
static const u32 camellia_sp1110[256] =
 | 
			
		||||
	{
 | 
			
		||||
	0x70707000,0x82828200,0x2c2c2c00,0xececec00,
 | 
			
		||||
	0xb3b3b300,0x27272700,0xc0c0c000,0xe5e5e500,
 | 
			
		||||
@@ -319,7 +266,7 @@ static const uint32_t camellia_sp1110[256] =
 | 
			
		||||
	0x77777700,0xc7c7c700,0x80808000,0x9e9e9e00,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
static const uint32_t camellia_sp0222[256] =
 | 
			
		||||
static const u32 camellia_sp0222[256] =
 | 
			
		||||
	{
 | 
			
		||||
	0x00e0e0e0,0x00050505,0x00585858,0x00d9d9d9,
 | 
			
		||||
	0x00676767,0x004e4e4e,0x00818181,0x00cbcbcb,
 | 
			
		||||
@@ -387,7 +334,7 @@ static const uint32_t camellia_sp0222[256] =
 | 
			
		||||
	0x00eeeeee,0x008f8f8f,0x00010101,0x003d3d3d,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
static const uint32_t camellia_sp3033[256] =
 | 
			
		||||
static const u32 camellia_sp3033[256] =
 | 
			
		||||
	{
 | 
			
		||||
	0x38003838,0x41004141,0x16001616,0x76007676,
 | 
			
		||||
	0xd900d9d9,0x93009393,0x60006060,0xf200f2f2,
 | 
			
		||||
@@ -455,7 +402,7 @@ static const uint32_t camellia_sp3033[256] =
 | 
			
		||||
	0xbb00bbbb,0xe300e3e3,0x40004040,0x4f004f4f,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
static const uint32_t camellia_sp4404[256] =
 | 
			
		||||
static const u32 camellia_sp4404[256] =
 | 
			
		||||
	{
 | 
			
		||||
	0x70700070,0x2c2c002c,0xb3b300b3,0xc0c000c0,
 | 
			
		||||
	0xe4e400e4,0x57570057,0xeaea00ea,0xaeae00ae,
 | 
			
		||||
@@ -523,20 +470,19 @@ static const uint32_t camellia_sp4404[256] =
 | 
			
		||||
	0xe3e300e3,0xf4f400f4,0xc7c700c7,0x9e9e009e,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Stuff related to the Camellia key schedule
 | 
			
		||||
 */
 | 
			
		||||
#define subl(x) subL[(x)]
 | 
			
		||||
#define subr(x) subR[(x)]
 | 
			
		||||
 | 
			
		||||
void camellia_setup128(const unsigned char *key, uint32_t *subkey)
 | 
			
		||||
void camellia_setup128(const u8 *key, u32 *subkey)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t kll, klr, krl, krr;
 | 
			
		||||
	uint32_t il, ir, t0, t1, w0, w1;
 | 
			
		||||
	uint32_t kw4l, kw4r, dw, tl, tr;
 | 
			
		||||
	uint32_t subL[26];
 | 
			
		||||
	uint32_t subR[26];
 | 
			
		||||
	u32 kll, klr, krl, krr;
 | 
			
		||||
	u32 il, ir, t0, t1, w0, w1;
 | 
			
		||||
	u32 kw4l, kw4r, dw, tl, tr;
 | 
			
		||||
	u32 subL[26];
 | 
			
		||||
	u32 subR[26];
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 *  k == kll || klr || krl || krr (|| is concatination)
 | 
			
		||||
@@ -833,14 +779,14 @@ void camellia_setup128(const unsigned char *key, uint32_t *subkey)
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void camellia_setup256(const unsigned char *key, uint32_t *subkey)
 | 
			
		||||
void camellia_setup256(const u8 *key, u32 *subkey)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t kll,klr,krl,krr;           /* left half of key */
 | 
			
		||||
	uint32_t krll,krlr,krrl,krrr;       /* right half of key */
 | 
			
		||||
	uint32_t il, ir, t0, t1, w0, w1;    /* temporary variables */
 | 
			
		||||
	uint32_t kw4l, kw4r, dw, tl, tr;
 | 
			
		||||
	uint32_t subL[34];
 | 
			
		||||
	uint32_t subR[34];
 | 
			
		||||
	u32 kll,klr,krl,krr;           /* left half of key */
 | 
			
		||||
	u32 krll,krlr,krrl,krrr;       /* right half of key */
 | 
			
		||||
	u32 il, ir, t0, t1, w0, w1;    /* temporary variables */
 | 
			
		||||
	u32 kw4l, kw4r, dw, tl, tr;
 | 
			
		||||
	u32 subL[34];
 | 
			
		||||
	u32 subR[34];
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 *  key = (kll || klr || krl || krr || krll || krlr || krrl || krrr)
 | 
			
		||||
@@ -1245,18 +1191,18 @@ void camellia_setup256(const unsigned char *key, uint32_t *subkey)
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void camellia_setup192(const unsigned char *key, uint32_t *subkey)
 | 
			
		||||
void camellia_setup192(const u8 *key, u32 *subkey)
 | 
			
		||||
	{
 | 
			
		||||
	unsigned char kk[32];
 | 
			
		||||
	uint32_t krll, krlr, krrl,krrr;
 | 
			
		||||
	u8 kk[32];
 | 
			
		||||
	u32 krll, krlr, krrl,krrr;
 | 
			
		||||
 | 
			
		||||
	memcpy(kk, key, 24);
 | 
			
		||||
	memcpy((unsigned char *)&krll, key+16,4);
 | 
			
		||||
	memcpy((unsigned char *)&krlr, key+20,4);
 | 
			
		||||
	memcpy((u8 *)&krll, key+16,4);
 | 
			
		||||
	memcpy((u8 *)&krlr, key+20,4);
 | 
			
		||||
	krrl = ~krll;
 | 
			
		||||
	krrr = ~krlr;
 | 
			
		||||
	memcpy(kk+24, (unsigned char *)&krrl, 4);
 | 
			
		||||
	memcpy(kk+28, (unsigned char *)&krrr, 4);
 | 
			
		||||
	memcpy(kk+24, (u8 *)&krrl, 4);
 | 
			
		||||
	memcpy(kk+28, (u8 *)&krrr, 4);
 | 
			
		||||
	camellia_setup256(kk, subkey);
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1265,11 +1211,10 @@ void camellia_setup192(const unsigned char *key, uint32_t *subkey)
 | 
			
		||||
/**
 | 
			
		||||
 * Stuff related to camellia encryption/decryption
 | 
			
		||||
 */
 | 
			
		||||
void camellia_encrypt128(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
void camellia_encrypt128(const u32 *subkey, u32 *io)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t il, ir, t0, t1;
 | 
			
		||||
	u32 il, ir, t0, t1;
 | 
			
		||||
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
	/* pre whitening but absorb kw2*/
 | 
			
		||||
	io[0] ^= CamelliaSubkeyL(0);
 | 
			
		||||
	io[1] ^= CamelliaSubkeyR(0);
 | 
			
		||||
@@ -1352,16 +1297,13 @@ void camellia_encrypt128(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
	io[1] = io[3];
 | 
			
		||||
	io[2] = t0;
 | 
			
		||||
	io[3] = t1;
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void camellia_decrypt128(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
void camellia_decrypt128(const u32 *subkey, u32 *io)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t il,ir,t0,t1;               /* temporary valiables */
 | 
			
		||||
    
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
	u32 il,ir,t0,t1;               /* temporary valiables */
 | 
			
		||||
 | 
			
		||||
	/* pre whitening but absorb kw2*/
 | 
			
		||||
	io[0] ^= CamelliaSubkeyL(24);
 | 
			
		||||
@@ -1445,7 +1387,6 @@ void camellia_decrypt128(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
	io[1] = io[3];
 | 
			
		||||
	io[2] = t0;
 | 
			
		||||
	io[3] = t1;
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1453,11 +1394,9 @@ void camellia_decrypt128(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
/**
 | 
			
		||||
 * stuff for 192 and 256bit encryption/decryption
 | 
			
		||||
 */
 | 
			
		||||
void camellia_encrypt256(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
void camellia_encrypt256(const u32 *subkey, u32 *io)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t il,ir,t0,t1;           /* temporary valiables */
 | 
			
		||||
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
	u32 il,ir,t0,t1;           /* temporary valiables */
 | 
			
		||||
 | 
			
		||||
	/* pre whitening but absorb kw2*/
 | 
			
		||||
	io[0] ^= CamelliaSubkeyL(0);
 | 
			
		||||
@@ -1565,16 +1504,14 @@ void camellia_encrypt256(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
	io[1] = io[3];
 | 
			
		||||
	io[2] = t0;
 | 
			
		||||
	io[3] = t1;
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void camellia_decrypt256(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
void camellia_decrypt256(const u32 *subkey, u32 *io)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t il,ir,t0,t1;           /* temporary valiables */
 | 
			
		||||
	u32 il,ir,t0,t1;           /* temporary valiables */
 | 
			
		||||
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
	/* pre whitening but absorb kw2*/
 | 
			
		||||
	io[0] ^= CamelliaSubkeyL(32);
 | 
			
		||||
	io[1] ^= CamelliaSubkeyR(32);
 | 
			
		||||
@@ -1681,7 +1618,6 @@ void camellia_decrypt256(const uint32_t *subkey, uint32_t *io)
 | 
			
		||||
	io[1] = io[3];
 | 
			
		||||
	io[2] = t0;
 | 
			
		||||
	io[3] = t1;
 | 
			
		||||
	SWAP4WORD(io);
 | 
			
		||||
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -67,25 +67,28 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
 | 
			
		||||
	unsigned long n;
 | 
			
		||||
	unsigned long len = length;
 | 
			
		||||
	unsigned char tmp[CAMELLIA_BLOCK_SIZE];
 | 
			
		||||
	const unsigned char *iv = ivec;
 | 
			
		||||
	uint32_t t32[UNITSIZE];
 | 
			
		||||
	union {	u32 t32[CAMELLIA_BLOCK_SIZE/sizeof(u32)];
 | 
			
		||||
		u8  t8 [CAMELLIA_BLOCK_SIZE]; } tmp;
 | 
			
		||||
	const union { long one; char little; } camellia_endian = {1};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	assert(in && out && key && ivec);
 | 
			
		||||
	assert((CAMELLIA_ENCRYPT == enc)||(CAMELLIA_DECRYPT == enc));
 | 
			
		||||
 | 
			
		||||
	if(((size_t)in) % ALIGN == 0
 | 
			
		||||
		&& ((size_t)out) % ALIGN == 0
 | 
			
		||||
		&& ((size_t)ivec) % ALIGN == 0)
 | 
			
		||||
	if(((size_t)in|(size_t)out|(size_t)ivec) % sizeof(u32) == 0)
 | 
			
		||||
		{
 | 
			
		||||
		if (CAMELLIA_ENCRYPT == enc)
 | 
			
		||||
			{
 | 
			
		||||
			while (len >= CAMELLIA_BLOCK_SIZE)
 | 
			
		||||
				{
 | 
			
		||||
				XOR4WORD2((uint32_t *)out,
 | 
			
		||||
					(uint32_t *)in, (uint32_t *)iv);
 | 
			
		||||
				key->enc(key->rd_key, (uint32_t *)out);
 | 
			
		||||
				XOR4WORD2((u32 *)out,
 | 
			
		||||
					(u32 *)in, (u32 *)iv);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				key->enc(key->rd_key, (u32 *)out);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				iv = out;
 | 
			
		||||
				len -= CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				in += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
@@ -97,7 +100,11 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
					out[n] = in[n] ^ iv[n];
 | 
			
		||||
				for(n=len; n < CAMELLIA_BLOCK_SIZE; ++n)
 | 
			
		||||
					out[n] = iv[n];
 | 
			
		||||
				key->enc(key->rd_key, (uint32_t *)out);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				key->enc(key->rd_key, (u32 *)out);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				iv = out;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec,iv,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
@@ -107,8 +114,12 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			while (len >= CAMELLIA_BLOCK_SIZE)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(out,in,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key,(uint32_t *)out);
 | 
			
		||||
				XOR4WORD((uint32_t *)out, (uint32_t *)iv);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				key->dec(key->rd_key,(u32 *)out);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				XOR4WORD((u32 *)out, (u32 *)iv);
 | 
			
		||||
				iv = in;
 | 
			
		||||
				len -= CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				in  += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
@@ -116,10 +127,14 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
				}
 | 
			
		||||
			if (len)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key, (uint32_t *)tmp);
 | 
			
		||||
				memcpy(tmp.t8, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				key->dec(key->rd_key, tmp.t32);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				for(n=0; n < len; ++n)
 | 
			
		||||
					out[n] = tmp[n] ^ iv[n];
 | 
			
		||||
					out[n] = tmp.t8[n] ^ iv[n];
 | 
			
		||||
				iv = in;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec,iv,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
@@ -128,23 +143,31 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			{
 | 
			
		||||
			while (len >= CAMELLIA_BLOCK_SIZE)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key, (uint32_t *)out);
 | 
			
		||||
				XOR4WORD((uint32_t *)out, (uint32_t *)ivec);
 | 
			
		||||
				memcpy(ivec, tmp, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(tmp.t8, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				key->dec(key->rd_key, (u32 *)out);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				XOR4WORD((u32 *)out, (u32 *)ivec);
 | 
			
		||||
				memcpy(ivec, tmp.t8, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				len -= CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				in += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				out += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				}
 | 
			
		||||
			if (len)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key,(uint32_t *)out);
 | 
			
		||||
				memcpy(tmp.t8, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				key->dec(key->rd_key,(u32 *)out);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD((u32 *)out);
 | 
			
		||||
				for(n=0; n < len; ++n)
 | 
			
		||||
					out[n] ^= ivec[n];
 | 
			
		||||
				for(n=len; n < CAMELLIA_BLOCK_SIZE; ++n)
 | 
			
		||||
					out[n] = tmp[n];
 | 
			
		||||
				memcpy(ivec, tmp, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
					out[n] = tmp.t8[n];
 | 
			
		||||
				memcpy(ivec, tmp.t8, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -155,10 +178,13 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			while (len >= CAMELLIA_BLOCK_SIZE)
 | 
			
		||||
				{
 | 
			
		||||
				for(n=0; n < CAMELLIA_BLOCK_SIZE; ++n)
 | 
			
		||||
					out[n] = in[n] ^ iv[n];
 | 
			
		||||
				memcpy(t32, out, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->enc(key->rd_key, t32);
 | 
			
		||||
				memcpy(out, t32, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
					tmp.t8[n] = in[n] ^ iv[n];
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				key->enc(key->rd_key, tmp.t32);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				memcpy(out, tmp.t8, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				iv = out;
 | 
			
		||||
				len -= CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				in += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
@@ -167,10 +193,15 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			if (len)
 | 
			
		||||
				{
 | 
			
		||||
				for(n=0; n < len; ++n)
 | 
			
		||||
					out[n] = in[n] ^ iv[n];
 | 
			
		||||
					tmp.t8[n] = in[n] ^ iv[n];
 | 
			
		||||
				for(n=len; n < CAMELLIA_BLOCK_SIZE; ++n)
 | 
			
		||||
					out[n] = iv[n];
 | 
			
		||||
				key->enc(key->rd_key, (uint32_t *)out);
 | 
			
		||||
					tmp.t8[n] = iv[n];
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				key->enc(key->rd_key, tmp.t32);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				memcpy(out, tmp.t8, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				iv = out;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec,iv,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
@@ -179,11 +210,14 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			{
 | 
			
		||||
			while (len >= CAMELLIA_BLOCK_SIZE)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(t32,in,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key,t32);
 | 
			
		||||
				memcpy(out,t32,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(tmp.t8,in,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				key->dec(key->rd_key,tmp.t32);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				for(n=0; n < CAMELLIA_BLOCK_SIZE; ++n)
 | 
			
		||||
					out[n] ^= iv[n];
 | 
			
		||||
					out[n] = tmp.t8[n] ^ iv[n];
 | 
			
		||||
				iv = in;
 | 
			
		||||
				len -= CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				in  += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
@@ -191,12 +225,14 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
				}
 | 
			
		||||
			if (len)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(t32, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key, t32);
 | 
			
		||||
				memcpy(out, t32, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(tmp.t8, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				key->dec(key->rd_key, tmp.t32);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				for(n=0; n < len; ++n)
 | 
			
		||||
					out[n] = tmp[n] ^ iv[n];
 | 
			
		||||
					out[n] = tmp.t8[n] ^ iv[n];
 | 
			
		||||
				iv = in;
 | 
			
		||||
				}
 | 
			
		||||
			memcpy(ivec,iv,CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
@@ -205,30 +241,33 @@ void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
			{
 | 
			
		||||
			while (len >= CAMELLIA_BLOCK_SIZE)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(t32, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key, t32);
 | 
			
		||||
				memcpy(out, t32, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(tmp.t8, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				key->dec(key->rd_key, tmp.t32);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				for(n=0; n < CAMELLIA_BLOCK_SIZE; ++n)
 | 
			
		||||
					out[n] ^= ivec[n];
 | 
			
		||||
				memcpy(ivec, tmp, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
					tmp.t8[n] ^= ivec[n];
 | 
			
		||||
				memcpy(ivec, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(out, tmp.t8, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				len -= CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				in += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				out += CAMELLIA_BLOCK_SIZE;
 | 
			
		||||
				}
 | 
			
		||||
			if (len)
 | 
			
		||||
				{
 | 
			
		||||
				memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(t32, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				key->dec(key->rd_key,t32);
 | 
			
		||||
				memcpy(out, t32, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(tmp.t8, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				key->dec(key->rd_key,tmp.t32);
 | 
			
		||||
				if (camellia_endian.little)
 | 
			
		||||
					SWAP4WORD(tmp.t32);
 | 
			
		||||
				for(n=0; n < len; ++n)
 | 
			
		||||
					out[n] ^= ivec[n];
 | 
			
		||||
				for(n=len; n < CAMELLIA_BLOCK_SIZE; ++n)
 | 
			
		||||
					out[n] = tmp[n];
 | 
			
		||||
				memcpy(ivec, tmp, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
					tmp.t8[n] ^= ivec[n];
 | 
			
		||||
				memcpy(ivec, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
				memcpy(out,tmp.t8,len);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -73,55 +73,42 @@
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER)
 | 
			
		||||
typedef unsigned char uint8_t;
 | 
			
		||||
typedef unsigned int uint32_t;
 | 
			
		||||
typedef unsigned __int64 uint64_t;
 | 
			
		||||
#else
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#endif
 | 
			
		||||
typedef unsigned char u8;
 | 
			
		||||
typedef unsigned int u32;
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define ALIGN 4
 | 
			
		||||
#define UNITSIZE 4
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
 | 
			
		||||
# define SWAP(x) ( _lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00 )
 | 
			
		||||
# define GETU32(p) SWAP(*((uint32_t *)(p)))
 | 
			
		||||
# define PUTU32(ct, st) { *((uint32_t *)(ct)) = SWAP((st)); }
 | 
			
		||||
# define GETU32(p) SWAP(*((u32 *)(p)))
 | 
			
		||||
# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }
 | 
			
		||||
# define CAMELLIA_SWAP4(x) (x = ( _lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#else /* not windows */
 | 
			
		||||
# define GETU32(pt) (((uint32_t)(pt)[0] << 24) \
 | 
			
		||||
	^ ((uint32_t)(pt)[1] << 16) \
 | 
			
		||||
	^ ((uint32_t)(pt)[2] <<  8) \
 | 
			
		||||
	^ ((uint32_t)(pt)[3]))
 | 
			
		||||
# define GETU32(pt) (((u32)(pt)[0] << 24) \
 | 
			
		||||
	^ ((u32)(pt)[1] << 16) \
 | 
			
		||||
	^ ((u32)(pt)[2] <<  8) \
 | 
			
		||||
	^ ((u32)(pt)[3]))
 | 
			
		||||
 | 
			
		||||
# define PUTU32(ct, st) { (ct)[0] = (uint8_t)((st) >> 24); \
 | 
			
		||||
	(ct)[1] = (uint8_t)((st) >> 16); \
 | 
			
		||||
	(ct)[2] = (uint8_t)((st) >>  8); \
 | 
			
		||||
	(ct)[3] = (uint8_t)(st); }
 | 
			
		||||
# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); \
 | 
			
		||||
	(ct)[1] = (u8)((st) >> 16); \
 | 
			
		||||
	(ct)[2] = (u8)((st) >>  8); \
 | 
			
		||||
	(ct)[3] = (u8)(st); }
 | 
			
		||||
 | 
			
		||||
#ifdef L_ENDIAN
 | 
			
		||||
#if (defined (__GNUC__) && !defined(i386))
 | 
			
		||||
#if (defined (__GNUC__) && (defined(__x86_64__) || defined(__x86_64)))
 | 
			
		||||
#define CAMELLIA_SWAP4(x) \
 | 
			
		||||
  do{\
 | 
			
		||||
    asm("bswap %1" : "+r" (x));\
 | 
			
		||||
  }while(0)
 | 
			
		||||
#else /* not gcc */
 | 
			
		||||
#else
 | 
			
		||||
#define CAMELLIA_SWAP4(x) \
 | 
			
		||||
   do{\
 | 
			
		||||
     x = ((uint32_t)x << 16) + ((uint32_t)x >> 16);\
 | 
			
		||||
     x = (((uint32_t)x & 0xff00ff) << 8) + (((uint32_t)x >> 8) & 0xff00ff);\
 | 
			
		||||
     x = ((u32)x << 16) + ((u32)x >> 16);\
 | 
			
		||||
     x = (((u32)x & 0xff00ff) << 8) + (((u32)x >> 8) & 0xff00ff);\
 | 
			
		||||
   } while(0)
 | 
			
		||||
#endif /* not gcc */
 | 
			
		||||
#else /* big endian */
 | 
			
		||||
#define CAMELLIA_SWAP4(x)
 | 
			
		||||
#endif /* L_ENDIAN */
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define COPY4WORD(dst, src)	 \
 | 
			
		||||
@@ -161,14 +148,14 @@ extern "C" {
 | 
			
		||||
	}while(0)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void camellia_setup128(const unsigned char *key, uint32_t *subkey);
 | 
			
		||||
void camellia_setup192(const unsigned char *key, uint32_t *subkey);
 | 
			
		||||
void camellia_setup256(const unsigned char *key, uint32_t *subkey);
 | 
			
		||||
void camellia_setup128(const u8 *key, u32 *subkey);
 | 
			
		||||
void camellia_setup192(const u8 *key, u32 *subkey);
 | 
			
		||||
void camellia_setup256(const u8 *key, u32 *subkey);
 | 
			
		||||
 | 
			
		||||
void camellia_encrypt128(const uint32_t *subkey, uint32_t *io);
 | 
			
		||||
void camellia_decrypt128(const uint32_t *subkey, uint32_t *io);
 | 
			
		||||
void camellia_encrypt256(const uint32_t *subkey, uint32_t *io);
 | 
			
		||||
void camellia_decrypt256(const uint32_t *subkey, uint32_t *io);
 | 
			
		||||
void camellia_encrypt128(const u32 *subkey, u32 *io);
 | 
			
		||||
void camellia_decrypt128(const u32 *subkey, u32 *io);
 | 
			
		||||
void camellia_encrypt256(const u32 *subkey, u32 *io);
 | 
			
		||||
void camellia_decrypt256(const u32 *subkey, u32 *io);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@
 | 
			
		||||
#include <openssl/camellia.h>
 | 
			
		||||
#include "cmll_locl.h"
 | 
			
		||||
 | 
			
		||||
const char *CAMELLIA_version="CAMELLIA" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
const char CAMELLIA_version[]="CAMELLIA" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
int Camellia_set_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
	CAMELLIA_KEY *key)
 | 
			
		||||
@@ -91,20 +91,26 @@ int Camellia_set_key(const unsigned char *userKey, const int bits,
 | 
			
		||||
void Camellia_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
	const CAMELLIA_KEY *key)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t tmp[UNITSIZE];
 | 
			
		||||
	u32 tmp[CAMELLIA_BLOCK_SIZE/sizeof(u32)];
 | 
			
		||||
	const union { long one; char little; } camellia_endian = {1};
 | 
			
		||||
 | 
			
		||||
	memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
	if (camellia_endian.little) SWAP4WORD(tmp);
 | 
			
		||||
	key->enc(key->rd_key, tmp);
 | 
			
		||||
	if (camellia_endian.little) SWAP4WORD(tmp);
 | 
			
		||||
	memcpy(out, tmp, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void Camellia_decrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
	const CAMELLIA_KEY *key)
 | 
			
		||||
	{
 | 
			
		||||
	uint32_t tmp[UNITSIZE];
 | 
			
		||||
	u32 tmp[CAMELLIA_BLOCK_SIZE/sizeof(u32)];
 | 
			
		||||
	const union { long one; char little; } camellia_endian = {1};
 | 
			
		||||
 | 
			
		||||
	memcpy(tmp, in, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
	if (camellia_endian.little) SWAP4WORD(tmp);
 | 
			
		||||
	key->dec(key->rd_key, tmp);
 | 
			
		||||
	if (camellia_endian.little) SWAP4WORD(tmp);
 | 
			
		||||
	memcpy(out, tmp, CAMELLIA_BLOCK_SIZE);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -38,7 +38,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -102,5 +102,8 @@ c_ofb64.o: ../../e_os.h ../../include/openssl/cast.h
 | 
			
		||||
c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
 | 
			
		||||
c_ofb64.o: c_ofb64.c cast_lcl.h
 | 
			
		||||
c_skey.o: ../../e_os.h ../../include/openssl/cast.h
 | 
			
		||||
c_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
 | 
			
		||||
c_skey.o: c_skey.c cast_lcl.h cast_s.h
 | 
			
		||||
c_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
 | 
			
		||||
c_skey.o: ../../include/openssl/fips.h ../../include/openssl/opensslconf.h
 | 
			
		||||
c_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
c_skey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
c_skey.o: ../../include/openssl/symhacks.h c_skey.c cast_lcl.h cast_s.h
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,7 @@
 | 
			
		||||
#include "cast_lcl.h"
 | 
			
		||||
#include <openssl/opensslv.h>
 | 
			
		||||
 | 
			
		||||
const char *CAST_version="CAST" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
const char CAST_version[]="CAST" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
 | 
			
		||||
		      CAST_KEY *ks, int enc)
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,8 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <openssl/cast.h>
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/fips.h>
 | 
			
		||||
#include "cast_lcl.h"
 | 
			
		||||
#include "cast_s.h"
 | 
			
		||||
 | 
			
		||||
@@ -72,7 +74,7 @@
 | 
			
		||||
#define S6 CAST_S_table6
 | 
			
		||||
#define S7 CAST_S_table7
 | 
			
		||||
 | 
			
		||||
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data)
 | 
			
		||||
FIPS_NON_FIPS_VCIPHER_Init(CAST)
 | 
			
		||||
	{
 | 
			
		||||
	CAST_LONG x[16];
 | 
			
		||||
	CAST_LONG z[16];
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,9 @@ typedef struct cast_key_st
 | 
			
		||||
	int short_key;	/* Use reduced rounds for short key */
 | 
			
		||||
	} CAST_KEY;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
#ifdef OPENSSL_FIPS 
 | 
			
		||||
void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
 | 
			
		||||
#endif
 | 
			
		||||
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
 | 
			
		||||
void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key,
 | 
			
		||||
		      int enc);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,24 @@ static int zlib_stateful_compress_block(COMP_CTX *ctx, unsigned char *out,
 | 
			
		||||
static int zlib_stateful_expand_block(COMP_CTX *ctx, unsigned char *out,
 | 
			
		||||
	unsigned int olen, unsigned char *in, unsigned int ilen);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* memory allocations functions for zlib intialization */
 | 
			
		||||
static void* zlib_zalloc(void* opaque, unsigned int no, unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
	void *p;
 | 
			
		||||
	
 | 
			
		||||
	p=OPENSSL_malloc(no*size);
 | 
			
		||||
	if (p)
 | 
			
		||||
		memset(p, 0, no*size);
 | 
			
		||||
	return p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void zlib_zfree(void* opaque, void* address)
 | 
			
		||||
{
 | 
			
		||||
	OPENSSL_free(address);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
static int zlib_compress_block(COMP_CTX *ctx, unsigned char *out,
 | 
			
		||||
	unsigned int olen, unsigned char *in, unsigned int ilen);
 | 
			
		||||
@@ -133,8 +151,8 @@ static int zlib_stateful_init(COMP_CTX *ctx)
 | 
			
		||||
	if (state == NULL)
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	state->istream.zalloc = Z_NULL;
 | 
			
		||||
	state->istream.zfree = Z_NULL;
 | 
			
		||||
	state->istream.zalloc = zlib_zalloc;
 | 
			
		||||
	state->istream.zfree = zlib_zfree;
 | 
			
		||||
	state->istream.opaque = Z_NULL;
 | 
			
		||||
	state->istream.next_in = Z_NULL;
 | 
			
		||||
	state->istream.next_out = Z_NULL;
 | 
			
		||||
@@ -145,8 +163,8 @@ static int zlib_stateful_init(COMP_CTX *ctx)
 | 
			
		||||
	if (err != Z_OK)
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	state->ostream.zalloc = Z_NULL;
 | 
			
		||||
	state->ostream.zfree = Z_NULL;
 | 
			
		||||
	state->ostream.zalloc = zlib_zalloc;
 | 
			
		||||
	state->ostream.zfree = zlib_zfree;
 | 
			
		||||
	state->ostream.opaque = Z_NULL;
 | 
			
		||||
	state->ostream.next_in = Z_NULL;
 | 
			
		||||
	state->ostream.next_out = Z_NULL;
 | 
			
		||||
@@ -158,17 +176,6 @@ static int zlib_stateful_init(COMP_CTX *ctx)
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	CRYPTO_new_ex_data(CRYPTO_EX_INDEX_COMP,ctx,&ctx->ex_data);
 | 
			
		||||
	if (zlib_stateful_ex_idx == -1)
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_w_lock(CRYPTO_LOCK_COMP);
 | 
			
		||||
		if (zlib_stateful_ex_idx == -1)
 | 
			
		||||
			zlib_stateful_ex_idx =
 | 
			
		||||
				CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_COMP,
 | 
			
		||||
					0,NULL,NULL,NULL,zlib_stateful_free_ex_data);
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_COMP);
 | 
			
		||||
		if (zlib_stateful_ex_idx == -1)
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
	CRYPTO_set_ex_data(&ctx->ex_data,zlib_stateful_ex_idx,state);
 | 
			
		||||
	return 1;
 | 
			
		||||
 err:
 | 
			
		||||
@@ -379,7 +386,25 @@ COMP_METHOD *COMP_zlib(void)
 | 
			
		||||
	if (zlib_loaded)
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(ZLIB) || defined(ZLIB_SHARED)
 | 
			
		||||
		{
 | 
			
		||||
		/* init zlib_stateful_ex_idx here so that in a multi-process
 | 
			
		||||
		 * application it's enough to intialize openssl before forking
 | 
			
		||||
		 * (idx will be inherited in all the children) */
 | 
			
		||||
		if (zlib_stateful_ex_idx == -1)
 | 
			
		||||
			{
 | 
			
		||||
			CRYPTO_w_lock(CRYPTO_LOCK_COMP);
 | 
			
		||||
			if (zlib_stateful_ex_idx == -1)
 | 
			
		||||
				zlib_stateful_ex_idx =
 | 
			
		||||
					CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_COMP,
 | 
			
		||||
						0,NULL,NULL,NULL,zlib_stateful_free_ex_data);
 | 
			
		||||
			CRYPTO_w_unlock(CRYPTO_LOCK_COMP);
 | 
			
		||||
			if (zlib_stateful_ex_idx == -1)
 | 
			
		||||
				goto err;
 | 
			
		||||
			}
 | 
			
		||||
		
 | 
			
		||||
		meth = &zlib_stateful_method;
 | 
			
		||||
		}
 | 
			
		||||
err:	
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	return(meth);
 | 
			
		||||
 
 | 
			
		||||
@@ -82,15 +82,12 @@ static ERR_STRING_DATA COMP_str_reasons[]=
 | 
			
		||||
 | 
			
		||||
void ERR_load_COMP_strings(void)
 | 
			
		||||
	{
 | 
			
		||||
	static int init=1;
 | 
			
		||||
 | 
			
		||||
	if (init)
 | 
			
		||||
		{
 | 
			
		||||
		init=0;
 | 
			
		||||
#ifndef OPENSSL_NO_ERR
 | 
			
		||||
 | 
			
		||||
	if (ERR_func_error_string(COMP_str_functs[0].error) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ERR_load_strings(0,COMP_str_functs);
 | 
			
		||||
		ERR_load_strings(0,COMP_str_reasons);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ top:
 | 
			
		||||
all:	lib
 | 
			
		||||
 | 
			
		||||
lib:	$(LIBOBJ)
 | 
			
		||||
	$(AR) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(ARX) $(LIB) $(LIBOBJ)
 | 
			
		||||
	$(RANLIB) $(LIB) || echo Never mind.
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
@@ -114,8 +114,8 @@ conf_mall.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/objects.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
conf_mall.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
@@ -128,9 +128,9 @@ conf_mod.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
conf_mod.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
@@ -143,8 +143,9 @@ conf_sap.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
conf_sap.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
 
 | 
			
		||||
@@ -114,6 +114,7 @@ typedef void conf_finish_func(CONF_IMODULE *md);
 | 
			
		||||
#define CONF_MFLAGS_SILENT		0x4
 | 
			
		||||
#define CONF_MFLAGS_NO_DSO		0x8
 | 
			
		||||
#define CONF_MFLAGS_IGNORE_MISSING_FILE	0x10
 | 
			
		||||
#define CONF_MFLAGS_DEFAULT_SECTION	0x20
 | 
			
		||||
 | 
			
		||||
int CONF_set_default_method(CONF_METHOD *meth);
 | 
			
		||||
void CONF_set_nconf(CONF *conf,LHASH *hash);
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ static int def_dump(const CONF *conf, BIO *bp);
 | 
			
		||||
static int def_is_number(const CONF *conf, char c);
 | 
			
		||||
static int def_to_int(const CONF *conf, char c);
 | 
			
		||||
 | 
			
		||||
const char *CONF_def_version="CONF_def" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
static CONF_METHOD default_method = {
 | 
			
		||||
	"OpenSSL default",
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user