Compare commits
	
		
			1033 Commits
		
	
	
		
			OpenSSL-en
			...
			OpenSSL-en
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					02a473eeb9 | ||
| 
						 | 
					5ec27eacf0 | ||
| 
						 | 
					f0d6ee6be8 | ||
| 
						 | 
					e65991f977 | ||
| 
						 | 
					3e83e686ba | ||
| 
						 | 
					8f06b00373 | ||
| 
						 | 
					1dea1f4509 | ||
| 
						 | 
					44411db8e0 | ||
| 
						 | 
					23ac7a1407 | ||
| 
						 | 
					30b5ce14d8 | ||
| 
						 | 
					dda640835f | ||
| 
						 | 
					6cc3700314 | ||
| 
						 | 
					cc1489d2f2 | ||
| 
						 | 
					016029c69f | ||
| 
						 | 
					516b848286 | ||
| 
						 | 
					c4202285ef | ||
| 
						 | 
					49e045482a | ||
| 
						 | 
					d8309efc72 | ||
| 
						 | 
					f43acc8a50 | ||
| 
						 | 
					ba47f5c9b0 | ||
| 
						 | 
					4d94ae00d5 | ||
| 
						 | 
					60d8bae30d | ||
| 
						 | 
					0caec9e8f8 | ||
| 
						 | 
					4f85a2e21e | ||
| 
						 | 
					945e15a253 | ||
| 
						 | 
					1fe198b6f9 | ||
| 
						 | 
					78d6603aad | ||
| 
						 | 
					7241ae1a0a | ||
| 
						 | 
					5f58d6a5e0 | ||
| 
						 | 
					acfe628b6e | ||
| 
						 | 
					182d8435f0 | ||
| 
						 | 
					4de920c91d | ||
| 
						 | 
					3cd039dd8f | ||
| 
						 | 
					ed2f196afe | ||
| 
						 | 
					81269a81ee | ||
| 
						 | 
					3537525e00 | ||
| 
						 | 
					d38f3ad1ee | ||
| 
						 | 
					e083f91497 | ||
| 
						 | 
					ba2cad19cf | ||
| 
						 | 
					db0a1efcc9 | ||
| 
						 | 
					9074521458 | ||
| 
						 | 
					f924200e1b | ||
| 
						 | 
					de2f6e4dae | ||
| 
						 | 
					44bdb056d4 | ||
| 
						 | 
					c31bbf1e68 | ||
| 
						 | 
					5e68f8ce15 | ||
| 
						 | 
					b9a3ef4c6e | ||
| 
						 | 
					1955b87423 | ||
| 
						 | 
					b860878edc | ||
| 
						 | 
					362771f880 | ||
| 
						 | 
					866eedb936 | ||
| 
						 | 
					f701551f36 | ||
| 
						 | 
					adc4df3616 | ||
| 
						 | 
					1199e2d8cf | ||
| 
						 | 
					0f180d1d1d | ||
| 
						 | 
					072569e0f1 | ||
| 
						 | 
					88e89f9022 | ||
| 
						 | 
					ba9786e4b8 | ||
| 
						 | 
					613599ffff | ||
| 
						 | 
					c9c21d3b89 | ||
| 
						 | 
					d0d046eca2 | ||
| 
						 | 
					2a81428489 | ||
| 
						 | 
					7073e9e2a0 | ||
| 
						 | 
					d866df33a1 | ||
| 
						 | 
					b77fcddb6b | ||
| 
						 | 
					f6fbd470e3 | ||
| 
						 | 
					63810d8566 | ||
| 
						 | 
					123c401967 | ||
| 
						 | 
					a3fffd648b | ||
| 
						 | 
					41aad62a78 | ||
| 
						 | 
					2d57b73a50 | ||
| 
						 | 
					f14845d999 | ||
| 
						 | 
					80bb905d3d | ||
| 
						 | 
					3964db29c4 | ||
| 
						 | 
					e4f165e71e | ||
| 
						 | 
					a297985f42 | ||
| 
						 | 
					404dcc5e8e | ||
| 
						 | 
					8242a6a9fc | ||
| 
						 | 
					17bcb8d465 | ||
| 
						 | 
					72165799a8 | ||
| 
						 | 
					f1c2a9de45 | ||
| 
						 | 
					52b66a622d | ||
| 
						 | 
					273db408a8 | ||
| 
						 | 
					957b6db3b1 | ||
| 
						 | 
					a14e2d9dfe | ||
| 
						 | 
					a8b94d6409 | ||
| 
						 | 
					fe19c448f0 | ||
| 
						 | 
					fcf6473199 | ||
| 
						 | 
					1285221370 | ||
| 
						 | 
					5dcf517d84 | ||
| 
						 | 
					9b2f486c9e | ||
| 
						 | 
					24995f3a10 | ||
| 
						 | 
					0fc5cf0870 | ||
| 
						 | 
					f78d4a35f8 | ||
| 
						 | 
					df5eaa8a52 | ||
| 
						 | 
					6ce46d69f5 | ||
| 
						 | 
					575e664a7c | ||
| 
						 | 
					7389c848d4 | ||
| 
						 | 
					4d393410f3 | ||
| 
						 | 
					bd69750360 | ||
| 
						 | 
					c9501c223f | ||
| 
						 | 
					9dd5ae6553 | ||
| 
						 | 
					e1e876072d | ||
| 
						 | 
					dd2589494f | ||
| 
						 | 
					1cfa8a397f | ||
| 
						 | 
					bdae099862 | ||
| 
						 | 
					cca28b291c | ||
| 
						 | 
					062d3e39e7 | ||
| 
						 | 
					e29f478a7a | ||
| 
						 | 
					1b58b616e3 | ||
| 
						 | 
					c70d381775 | ||
| 
						 | 
					508d8b1617 | ||
| 
						 | 
					8c74b5e56c | ||
| 
						 | 
					c59ba5b528 | ||
| 
						 | 
					45d87a1ffe | ||
| 
						 | 
					a3feb21bbe | ||
| 
						 | 
					37530362fa | ||
| 
						 | 
					fd69886aed | ||
| 
						 | 
					fd795679bb | ||
| 
						 | 
					e523f5f389 | ||
| 
						 | 
					e4dd79bbc8 | ||
| 
						 | 
					bc37d996fc | ||
| 
						 | 
					31cafe53c9 | ||
| 
						 | 
					dc4ddcd2bb | ||
| 
						 | 
					5256b021f3 | ||
| 
						 | 
					1bb68d62ab | ||
| 
						 | 
					4ab1e7ceaf | ||
| 
						 | 
					06623ff028 | ||
| 
						 | 
					67d48c8cc8 | ||
| 
						 | 
					d59fb0dd2f | ||
| 
						 | 
					245f44e2ab | ||
| 
						 | 
					e5d6528a12 | ||
| 
						 | 
					980afccf98 | ||
| 
						 | 
					9bd2cd745f | ||
| 
						 | 
					015fbde807 | ||
| 
						 | 
					ba1b888384 | ||
| 
						 | 
					6f9079fd50 | ||
| 
						 | 
					c938563a81 | ||
| 
						 | 
					40928698bb | ||
| 
						 | 
					138d8ab0c7 | ||
| 
						 | 
					47cc5525a2 | ||
| 
						 | 
					67fec850e1 | ||
| 
						 | 
					82db6e1646 | ||
| 
						 | 
					e7227322b3 | ||
| 
						 | 
					a5595fde9a | ||
| 
						 | 
					95f8c7195c | ||
| 
						 | 
					dcbbf83dba | ||
| 
						 | 
					3c89d78dba | ||
| 
						 | 
					60a9cbdf28 | ||
| 
						 | 
					84fcd6f83e | ||
| 
						 | 
					d3948ca262 | ||
| 
						 | 
					85939d5dd7 | ||
| 
						 | 
					532fd8ee1c | ||
| 
						 | 
					a92ae07091 | ||
| 
						 | 
					fb3af5c813 | ||
| 
						 | 
					68809d3969 | ||
| 
						 | 
					6d6846417f | ||
| 
						 | 
					47892635ad | ||
| 
						 | 
					d6a89fcf88 | ||
| 
						 | 
					5b9b38f0c9 | ||
| 
						 | 
					ef5f6a08ff | ||
| 
						 | 
					d8e2daf1e0 | ||
| 
						 | 
					7c517a04b1 | ||
| 
						 | 
					be29c93cf4 | ||
| 
						 | 
					6e19a04080 | ||
| 
						 | 
					d78e52987e | ||
| 
						 | 
					755cc53a6e | ||
| 
						 | 
					1226c472b7 | ||
| 
						 | 
					4d7072f4b5 | ||
| 
						 | 
					b5348a095d | ||
| 
						 | 
					66df02fd98 | ||
| 
						 | 
					206eb6a11d | ||
| 
						 | 
					f11fd3f4e1 | ||
| 
						 | 
					29b108f939 | ||
| 
						 | 
					91102def2e | ||
| 
						 | 
					35933d170d | ||
| 
						 | 
					31106cc750 | ||
| 
						 | 
					ff3fa48fc7 | ||
| 
						 | 
					87166e1fb6 | ||
| 
						 | 
					f3e24baddf | ||
| 
						 | 
					a6977ee73d | ||
| 
						 | 
					d4704d5245 | ||
| 
						 | 
					8f0edcb3d2 | ||
| 
						 | 
					35e25255e0 | ||
| 
						 | 
					c3fbf5d9a8 | ||
| 
						 | 
					55e42c93a8 | ||
| 
						 | 
					6a0dec9584 | ||
| 
						 | 
					21a85f1977 | ||
| 
						 | 
					322de0c8c1 | ||
| 
						 | 
					6a9af68b56 | ||
| 
						 | 
					270c75c2b1 | ||
| 
						 | 
					b6e4dac217 | ||
| 
						 | 
					8a0a9392ab | ||
| 
						 | 
					bcbe4e5254 | ||
| 
						 | 
					9f44f4a081 | ||
| 
						 | 
					47ff5c6279 | ||
| 
						 | 
					37749c8872 | ||
| 
						 | 
					898f856c44 | ||
| 
						 | 
					883b0c2274 | ||
| 
						 | 
					dae0b520a0 | ||
| 
						 | 
					4f94d1a8b1 | ||
| 
						 | 
					1d4581c2dd | ||
| 
						 | 
					c05940edc7 | ||
| 
						 | 
					c507a16e49 | ||
| 
						 | 
					308f028e28 | ||
| 
						 | 
					e4a6cf421a | ||
| 
						 | 
					329636d6e3 | ||
| 
						 | 
					9163b8fb23 | ||
| 
						 | 
					f1a185a04a | ||
| 
						 | 
					60f3f6ac2e | ||
| 
						 | 
					595241e17f | ||
| 
						 | 
					c6d14d26fd | ||
| 
						 | 
					832e09cd23 | ||
| 
						 | 
					879d789a42 | ||
| 
						 | 
					a542db90c6 | ||
| 
						 | 
					a7ce69dbd7 | ||
| 
						 | 
					07ad3257fc | ||
| 
						 | 
					c02efd954d | ||
| 
						 | 
					b26f6ee5f2 | ||
| 
						 | 
					b5719e9673 | ||
| 
						 | 
					f56412e895 | ||
| 
						 | 
					26e922fc7f | ||
| 
						 | 
					9d93ce246c | ||
| 
						 | 
					76c4336c43 | ||
| 
						 | 
					e71adb85c5 | ||
| 
						 | 
					033c51f0a3 | ||
| 
						 | 
					452d1595a6 | ||
| 
						 | 
					0d197a833c | ||
| 
						 | 
					e0031b80ee | ||
| 
						 | 
					b19941ab05 | ||
| 
						 | 
					752938daab | ||
| 
						 | 
					c78515f55e | ||
| 
						 | 
					3ba1f11147 | ||
| 
						 | 
					bbc206fdf7 | ||
| 
						 | 
					2bd065dfbe | ||
| 
						 | 
					6d7dbc12f2 | ||
| 
						 | 
					83c40e7fc0 | ||
| 
						 | 
					b5fe234588 | ||
| 
						 | 
					e1a00d7d1d | ||
| 
						 | 
					acf60ef707 | ||
| 
						 | 
					c85a157854 | ||
| 
						 | 
					0c5d16e4f5 | ||
| 
						 | 
					bd2af5e707 | ||
| 
						 | 
					58d55afa6f | ||
| 
						 | 
					6343e2fac3 | ||
| 
						 | 
					edcace97a8 | ||
| 
						 | 
					b476df64a1 | ||
| 
						 | 
					8d5c834b34 | ||
| 
						 | 
					b0eda65f1c | ||
| 
						 | 
					2395368e7f | ||
| 
						 | 
					1d46b6b3b9 | ||
| 
						 | 
					bbb35447c4 | ||
| 
						 | 
					6276f1e100 | ||
| 
						 | 
					5b8a57ecae | ||
| 
						 | 
					817dfc18a3 | ||
| 
						 | 
					0b0b2a8087 | ||
| 
						 | 
					c23d16ac19 | ||
| 
						 | 
					1b28ed575b | ||
| 
						 | 
					135c0af1bb | ||
| 
						 | 
					475918410b | ||
| 
						 | 
					3102792161 | ||
| 
						 | 
					a291182757 | ||
| 
						 | 
					95c0f198a7 | ||
| 
						 | 
					947a85d022 | ||
| 
						 | 
					b26ca3408c | ||
| 
						 | 
					da904c9cef | ||
| 
						 | 
					83978bd37a | ||
| 
						 | 
					a3790c0d01 | ||
| 
						 | 
					c3970428ac | ||
| 
						 | 
					63b6090f7c | ||
| 
						 | 
					c5571db0c2 | ||
| 
						 | 
					b1d9279a41 | ||
| 
						 | 
					c7d827fc90 | ||
| 
						 | 
					e0457d5f7c | ||
| 
						 | 
					ae52ec9869 | ||
| 
						 | 
					37fe697597 | ||
| 
						 | 
					0b33bc6b72 | ||
| 
						 | 
					7aa983c6db | ||
| 
						 | 
					2b90b1f344 | ||
| 
						 | 
					d8616888ee | ||
| 
						 | 
					65123f8064 | ||
| 
						 | 
					1d8634b110 | ||
| 
						 | 
					29e0c30c2a | ||
| 
						 | 
					cf82191d77 | ||
| 
						 | 
					3a8a0a3945 | ||
| 
						 | 
					c5d4ab7e35 | ||
| 
						 | 
					b955dbd325 | ||
| 
						 | 
					45582d1e2b | ||
| 
						 | 
					60c50cbf9c | ||
| 
						 | 
					3a3619b46a | ||
| 
						 | 
					b83eddc578 | ||
| 
						 | 
					7f558334ad | ||
| 
						 | 
					6229a5607c | ||
| 
						 | 
					6acc3b9689 | ||
| 
						 | 
					66aa856698 | ||
| 
						 | 
					f559f31bef | ||
| 
						 | 
					3210b4fd14 | ||
| 
						 | 
					a7b42009c4 | ||
| 
						 | 
					7b5ffd6834 | ||
| 
						 | 
					9b55da73ca | ||
| 
						 | 
					e7156ff2e8 | ||
| 
						 | 
					437db75b94 | ||
| 
						 | 
					1586365835 | ||
| 
						 | 
					7d5b04db4e | ||
| 
						 | 
					48b0cf8b10 | ||
| 
						 | 
					b693f941fd | ||
| 
						 | 
					c602e7f4e8 | ||
| 
						 | 
					1fc6d41bf6 | ||
| 
						 | 
					a41477f92e | ||
| 
						 | 
					5f68c5feef | ||
| 
						 | 
					ee84a5a7fb | ||
| 
						 | 
					66d3e7481e | ||
| 
						 | 
					0e21156333 | ||
| 
						 | 
					f533b7780e | ||
| 
						 | 
					cc2f5a8022 | ||
| 
						 | 
					b441bf9226 | ||
| 
						 | 
					2a9aca32dc | ||
| 
						 | 
					89da653fa6 | ||
| 
						 | 
					af50b58c3f | ||
| 
						 | 
					4d635a7001 | ||
| 
						 | 
					ce15d5a9dc | ||
| 
						 | 
					ba1c602281 | ||
| 
						 | 
					cfc781be6e | ||
| 
						 | 
					84acc3c2bc | ||
| 
						 | 
					c2e4f17c1a | ||
| 
						 | 
					979689aa5c | ||
| 
						 | 
					a3faebd104 | ||
| 
						 | 
					025c7737b2 | ||
| 
						 | 
					513d4b4c16 | ||
| 
						 | 
					7ef701519b | ||
| 
						 | 
					50d194af4d | ||
| 
						 | 
					287973746e | ||
| 
						 | 
					f1558bb424 | ||
| 
						 | 
					6ca487992b | ||
| 
						 | 
					cf3a5cebd7 | ||
| 
						 | 
					a661b65357 | ||
| 
						 | 
					98e6654938 | ||
| 
						 | 
					cecd263878 | ||
| 
						 | 
					31fe950d2b | ||
| 
						 | 
					db6a87d8cc | ||
| 
						 | 
					7beb408771 | ||
| 
						 | 
					51008ffce1 | ||
| 
						 | 
					3811eed8d5 | ||
| 
						 | 
					581f1c8494 | ||
| 
						 | 
					41ebed27fa | ||
| 
						 | 
					bf21446a2a | ||
| 
						 | 
					e72d734d5f | ||
| 
						 | 
					20d2186c87 | ||
| 
						 | 
					9ba3ec9176 | ||
| 
						 | 
					8f71fb8d98 | ||
| 
						 | 
					48948d53b6 | ||
| 
						 | 
					dbec19622e | ||
| 
						 | 
					2ce15df528 | ||
| 
						 | 
					681bfae499 | ||
| 
						 | 
					5dd955dcd2 | ||
| 
						 | 
					56fa8e69cf | ||
| 
						 | 
					67d0738aba | ||
| 
						 | 
					b8a61e7362 | ||
| 
						 | 
					dd5e774664 | ||
| 
						 | 
					6b86bad5ef | ||
| 
						 | 
					712557128b | ||
| 
						 | 
					3009e9f9ef | ||
| 
						 | 
					b30245dae0 | ||
| 
						 | 
					116daf4c2f | ||
| 
						 | 
					cb40bdaf57 | ||
| 
						 | 
					4b12506891 | ||
| 
						 | 
					cf98440178 | ||
| 
						 | 
					c500d44735 | ||
| 
						 | 
					18eda73234 | ||
| 
						 | 
					7526e2c043 | ||
| 
						 | 
					6d52f260bf | ||
| 
						 | 
					752f2b6785 | ||
| 
						 | 
					e1c279b63d | ||
| 
						 | 
					467889703a | ||
| 
						 | 
					3a457cca86 | ||
| 
						 | 
					285046ec51 | ||
| 
						 | 
					f8000b9345 | ||
| 
						 | 
					77a8eb352f | ||
| 
						 | 
					114697bef3 | ||
| 
						 | 
					2aa9043ad3 | ||
| 
						 | 
					1a095560f7 | ||
| 
						 | 
					f329b8d73b | ||
| 
						 | 
					3d90a32429 | ||
| 
						 | 
					e3a7463c5d | ||
| 
						 | 
					796c6eadcb | ||
| 
						 | 
					b485e5b7e3 | ||
| 
						 | 
					d1cc7b8f22 | ||
| 
						 | 
					1cf9d58cb4 | ||
| 
						 | 
					0cff933416 | ||
| 
						 | 
					c41b29e5db | ||
| 
						 | 
					65fb3fa630 | ||
| 
						 | 
					0b0f08dbc7 | ||
| 
						 | 
					5c32657c80 | ||
| 
						 | 
					07cee70258 | ||
| 
						 | 
					4ba163cbf9 | ||
| 
						 | 
					2bfb2398e3 | ||
| 
						 | 
					a4a8f7b3ef | ||
| 
						 | 
					34c66925aa | ||
| 
						 | 
					cb7fd76f57 | ||
| 
						 | 
					de822715b2 | ||
| 
						 | 
					89f534e1d3 | ||
| 
						 | 
					d46c1a8126 | ||
| 
						 | 
					e32587d5a6 | ||
| 
						 | 
					7876e4488f | ||
| 
						 | 
					1a19f83d4c | ||
| 
						 | 
					db8c838c6a | ||
| 
						 | 
					37da54b10e | ||
| 
						 | 
					0fea7ed4a4 | ||
| 
						 | 
					dbeac560aa | ||
| 
						 | 
					89eeccacde | ||
| 
						 | 
					c9fc143972 | ||
| 
						 | 
					004aa803a9 | ||
| 
						 | 
					c921a5e1d4 | ||
| 
						 | 
					0b4b9a11f5 | ||
| 
						 | 
					d7e0299792 | ||
| 
						 | 
					9dfdf0ad1d | ||
| 
						 | 
					3b04cdd706 | ||
| 
						 | 
					11a57c7be5 | ||
| 
						 | 
					b370230b78 | ||
| 
						 | 
					50a381b789 | ||
| 
						 | 
					534aaf3731 | ||
| 
						 | 
					6dc5d570d0 | ||
| 
						 | 
					cb78486d97 | ||
| 
						 | 
					9c9aa4f145 | ||
| 
						 | 
					b6d1e52d45 | ||
| 
						 | 
					f185e725a0 | ||
| 
						 | 
					591ccf586d | ||
| 
						 | 
					b7061c61b0 | ||
| 
						 | 
					8a428200a6 | ||
| 
						 | 
					10b2328fea | ||
| 
						 | 
					98c2a26ea6 | ||
| 
						 | 
					965b6dad44 | ||
| 
						 | 
					a3d8c0fc5d | ||
| 
						 | 
					a32d795aae | ||
| 
						 | 
					ef3dc028ef | ||
| 
						 | 
					2413a3975f | ||
| 
						 | 
					3b0b5abae3 | ||
| 
						 | 
					b49124f6d9 | ||
| 
						 | 
					2260ad21fb | ||
| 
						 | 
					6b0e9facf4 | ||
| 
						 | 
					c404ff7955 | ||
| 
						 | 
					8e2f6b79ea | ||
| 
						 | 
					ee60d9fb28 | ||
| 
						 | 
					be6d77005f | ||
| 
						 | 
					b263b66746 | ||
| 
						 | 
					5294dd705d | ||
| 
						 | 
					2b67158673 | ||
| 
						 | 
					db744f8950 | ||
| 
						 | 
					e059b19ddb | ||
| 
						 | 
					997a54c981 | ||
| 
						 | 
					b78e502104 | ||
| 
						 | 
					b6d0054a52 | ||
| 
						 | 
					117df10db4 | ||
| 
						 | 
					d300bcca7f | ||
| 
						 | 
					d59c3e5046 | ||
| 
						 | 
					6d8566f2eb | ||
| 
						 | 
					4e1b0d8904 | ||
| 
						 | 
					8ce2912fbc | ||
| 
						 | 
					1372965e2e | ||
| 
						 | 
					1a1422643b | ||
| 
						 | 
					409960491d | ||
| 
						 | 
					96bd6f730a | ||
| 
						 | 
					c0f5dd070b | ||
| 
						 | 
					9d7a8d3578 | ||
| 
						 | 
					4dec4f646d | ||
| 
						 | 
					2cb924b052 | ||
| 
						 | 
					51ac0cfe44 | ||
| 
						 | 
					16e819e1d8 | ||
| 
						 | 
					1023cfe70d | ||
| 
						 | 
					8e0a2d8461 | ||
| 
						 | 
					e13ae96d7c | ||
| 
						 | 
					9f29ec4721 | ||
| 
						 | 
					b9a20b5057 | ||
| 
						 | 
					c2222c2ea2 | ||
| 
						 | 
					336da5642d | ||
| 
						 | 
					8573fa1806 | ||
| 
						 | 
					a52c2fb296 | ||
| 
						 | 
					41450b27f2 | ||
| 
						 | 
					e72d5983f2 | ||
| 
						 | 
					5a85385387 | ||
| 
						 | 
					5e54b4f364 | ||
| 
						 | 
					5ba372b17c | ||
| 
						 | 
					f9b0f47c0c | ||
| 
						 | 
					4deeadf7dc | ||
| 
						 | 
					384eff877c | ||
| 
						 | 
					68dbba9817 | ||
| 
						 | 
					ea7150b070 | ||
| 
						 | 
					cb42ce0b67 | ||
| 
						 | 
					e8330cf5ac | ||
| 
						 | 
					7d34470458 | ||
| 
						 | 
					f1047cebea | ||
| 
						 | 
					da8a2e6f90 | ||
| 
						 | 
					546ec5a9b3 | ||
| 
						 | 
					e3fefbfd56 | ||
| 
						 | 
					3b80e3aa9e | ||
| 
						 | 
					14cfde9c83 | ||
| 
						 | 
					9cabef963c | ||
| 
						 | 
					ce9eab79a7 | ||
| 
						 | 
					e9e202cfa8 | ||
| 
						 | 
					d83ae69455 | ||
| 
						 | 
					bb4f7a8d52 | ||
| 
						 | 
					619b2c03dc | ||
| 
						 | 
					aa4c2de10e | ||
| 
						 | 
					6c36f7a9f2 | ||
| 
						 | 
					78f7923580 | ||
| 
						 | 
					978ebf0141 | ||
| 
						 | 
					a9ed4da8eb | ||
| 
						 | 
					e1a4814cd4 | ||
| 
						 | 
					3cad81f6fe | ||
| 
						 | 
					4450107afb | ||
| 
						 | 
					908efd3b73 | ||
| 
						 | 
					1a7691c059 | ||
| 
						 | 
					f524ddbe04 | ||
| 
						 | 
					541814c403 | ||
| 
						 | 
					5013540224 | ||
| 
						 | 
					94cb5ee63c | ||
| 
						 | 
					fc9c61bc3b | ||
| 
						 | 
					e815d3015e | ||
| 
						 | 
					dc2a33d680 | ||
| 
						 | 
					7ba45bf133 | ||
| 
						 | 
					d98a4b7366 | ||
| 
						 | 
					889a54c467 | ||
| 
						 | 
					9d07fd03e3 | ||
| 
						 | 
					a8a1878256 | ||
| 
						 | 
					5b46eee0f5 | ||
| 
						 | 
					e5e6a94fbf | ||
| 
						 | 
					d9ff889073 | ||
| 
						 | 
					e4decc418a | ||
| 
						 | 
					cf5bfbfc21 | ||
| 
						 | 
					567fef894e | ||
| 
						 | 
					6ee2a1365e | ||
| 
						 | 
					435037d4e4 | ||
| 
						 | 
					c5de8996cc | ||
| 
						 | 
					2dc5383a20 | ||
| 
						 | 
					9391f97715 | ||
| 
						 | 
					5b16639538 | ||
| 
						 | 
					1738bb61e1 | ||
| 
						 | 
					91b3f0e691 | ||
| 
						 | 
					6ac4e8bd6e | ||
| 
						 | 
					983495c4b2 | ||
| 
						 | 
					931a23a5a5 | ||
| 
						 | 
					72849dce81 | ||
| 
						 | 
					2618893114 | ||
| 
						 | 
					36026dfc01 | ||
| 
						 | 
					79aa04ef27 | ||
| 
						 | 
					3a0799977b | ||
| 
						 | 
					e19ea55783 | ||
| 
						 | 
					8716dbea40 | ||
| 
						 | 
					e9bc66c84f | ||
| 
						 | 
					c078798c60 | ||
| 
						 | 
					de73cca923 | ||
| 
						 | 
					b1051789d6 | ||
| 
						 | 
					4db73c1bb8 | ||
| 
						 | 
					3ae34e3a8c | ||
| 
						 | 
					1f3b65801b | ||
| 
						 | 
					5e2c4e23f4 | ||
| 
						 | 
					35780c2139 | ||
| 
						 | 
					ceff5fec5a | ||
| 
						 | 
					4897dc4056 | ||
| 
						 | 
					35e33f0e52 | ||
| 
						 | 
					a844e27baa | ||
| 
						 | 
					0783bf151c | ||
| 
						 | 
					566bdf2bda | ||
| 
						 | 
					eb6dc02b23 | ||
| 
						 | 
					78435364ec | ||
| 
						 | 
					5cbc2e8bc1 | ||
| 
						 | 
					e7cf7fcd21 | ||
| 
						 | 
					bb8aab0211 | ||
| 
						 | 
					0fbf5f7102 | ||
| 
						 | 
					f1b2807478 | ||
| 
						 | 
					faacb092f8 | ||
| 
						 | 
					b439a74620 | ||
| 
						 | 
					3132ab8ce6 | ||
| 
						 | 
					bfd7bb3eb6 | ||
| 
						 | 
					11c8f0b79d | ||
| 
						 | 
					c4068186ac | ||
| 
						 | 
					0a93a68020 | ||
| 
						 | 
					f2ab7d1392 | ||
| 
						 | 
					c41ab9ade5 | ||
| 
						 | 
					141e584998 | ||
| 
						 | 
					336736ef35 | ||
| 
						 | 
					df7cb13525 | ||
| 
						 | 
					d93eb21c7c | ||
| 
						 | 
					a403188f92 | ||
| 
						 | 
					82b2230527 | ||
| 
						 | 
					a8a004987c | ||
| 
						 | 
					0e36019977 | ||
| 
						 | 
					354c3ace73 | ||
| 
						 | 
					52129c0b0b | ||
| 
						 | 
					a52877a2f1 | ||
| 
						 | 
					cdd7c3ce92 | ||
| 
						 | 
					c1497b4d19 | ||
| 
						 | 
					b2ed462934 | ||
| 
						 | 
					bb766a0ad6 | ||
| 
						 | 
					b65f851318 | ||
| 
						 | 
					35bf35411c | ||
| 
						 | 
					54fbc77dc8 | ||
| 
						 | 
					9e09eebf94 | ||
| 
						 | 
					45a2f93906 | ||
| 
						 | 
					6982c0da4e | ||
| 
						 | 
					b7727ee616 | ||
| 
						 | 
					f0446ca8d7 | ||
| 
						 | 
					6bc847e49e | ||
| 
						 | 
					3f1c4e49a3 | ||
| 
						 | 
					37a7cd1a11 | ||
| 
						 | 
					3a2d9c4dd0 | ||
| 
						 | 
					e51d1321fc | ||
| 
						 | 
					b9fdb3eb99 | ||
| 
						 | 
					d66ace9da5 | ||
| 
						 | 
					db75357110 | ||
| 
						 | 
					0713f8abe6 | ||
| 
						 | 
					93d9121a77 | ||
| 
						 | 
					92dad6cc84 | ||
| 
						 | 
					61454a9f8c | ||
| 
						 | 
					bb2297a41d | ||
| 
						 | 
					75e98d0563 | ||
| 
						 | 
					e9eb000c53 | ||
| 
						 | 
					1ba01caaa3 | ||
| 
						 | 
					5cd6571fae | ||
| 
						 | 
					6383bbe525 | ||
| 
						 | 
					06da6e4977 | ||
| 
						 | 
					b72faddc47 | ||
| 
						 | 
					d92f0bb6e9 | ||
| 
						 | 
					710e5d5639 | ||
| 
						 | 
					6da980e2b5 | ||
| 
						 | 
					37f599bcec | ||
| 
						 | 
					8408f4fbc7 | ||
| 
						 | 
					534164ef90 | ||
| 
						 | 
					e32c852e1e | ||
| 
						 | 
					dbfc0f8c2b | ||
| 
						 | 
					3728974460 | ||
| 
						 | 
					fdc2bbcacb | ||
| 
						 | 
					c2a3358b60 | ||
| 
						 | 
					882e891284 | ||
| 
						 | 
					05bbf78afd | ||
| 
						 | 
					99ecb90a99 | ||
| 
						 | 
					dbad169019 | ||
| 
						 | 
					3ba5d1cf2e | ||
| 
						 | 
					be2e2c3297 | ||
| 
						 | 
					ed0015284b | ||
| 
						 | 
					6d03b73e35 | ||
| 
						 | 
					622d3d3592 | ||
| 
						 | 
					0e06354402 | ||
| 
						 | 
					62c271610b | ||
| 
						 | 
					db089ad60d | ||
| 
						 | 
					1f0c9ad7e1 | ||
| 
						 | 
					06efc222f9 | ||
| 
						 | 
					de3333bae4 | ||
| 
						 | 
					924875e53b | ||
| 
						 | 
					3a64458217 | ||
| 
						 | 
					ea71c22731 | ||
| 
						 | 
					dc706cd35f | ||
| 
						 | 
					1241126adf | ||
| 
						 | 
					19da130053 | ||
| 
						 | 
					a75b191502 | ||
| 
						 | 
					e5cb260365 | ||
| 
						 | 
					6aecef815c | ||
| 
						 | 
					daba492c3a | ||
| 
						 | 
					24cff6ced5 | ||
| 
						 | 
					ac7b42610f | ||
| 
						 | 
					7abe76e1bd | ||
| 
						 | 
					7bc03ded12 | ||
| 
						 | 
					ea3b8af50a | ||
| 
						 | 
					badb910f3c | ||
| 
						 | 
					3866752e7e | ||
| 
						 | 
					3e3dac9f97 | ||
| 
						 | 
					397ba0f08a | ||
| 
						 | 
					07ad8f5d17 | ||
| 
						 | 
					47c3448a97 | ||
| 
						 | 
					4db48ec0bd | ||
| 
						 | 
					c518ade1fd | ||
| 
						 | 
					acdf4afb91 | ||
| 
						 | 
					6d3dec92fb | ||
| 
						 | 
					2d3b6a5be7 | ||
| 
						 | 
					81d1998e09 | ||
| 
						 | 
					6b46ca135a | ||
| 
						 | 
					fa293e4e4b | ||
| 
						 | 
					24cbf3efc6 | ||
| 
						 | 
					534a1ed0cb | ||
| 
						 | 
					ee306a1332 | ||
| 
						 | 
					45442167b0 | ||
| 
						 | 
					131645ecce | ||
| 
						 | 
					f1ca5f5b89 | ||
| 
						 | 
					e452de9d87 | ||
| 
						 | 
					a0256f462a | ||
| 
						 | 
					82d5d46c14 | ||
| 
						 | 
					0665dd6852 | ||
| 
						 | 
					98fc09b18a | ||
| 
						 | 
					192ebef8cf | ||
| 
						 | 
					b01ab14338 | ||
| 
						 | 
					2a96235bf7 | ||
| 
						 | 
					1cf9bf00f4 | ||
| 
						 | 
					a5224c3420 | ||
| 
						 | 
					af436bc158 | ||
| 
						 | 
					ab603c6987 | ||
| 
						 | 
					9c11a0e541 | ||
| 
						 | 
					8de83bf876 | ||
| 
						 | 
					679df234b7 | ||
| 
						 | 
					26eaab0990 | ||
| 
						 | 
					7be96d7c9f | ||
| 
						 | 
					d11493934c | ||
| 
						 | 
					c62da732a4 | ||
| 
						 | 
					a1a63a4239 | ||
| 
						 | 
					103a434386 | ||
| 
						 | 
					567671e291 | ||
| 
						 | 
					d8a750ee7f | ||
| 
						 | 
					9c10b2c8d3 | ||
| 
						 | 
					56a106115f | ||
| 
						 | 
					e9ad0d2c31 | ||
| 
						 | 
					97639f0d73 | ||
| 
						 | 
					e3a4f8b84c | ||
| 
						 | 
					7e99812432 | ||
| 
						 | 
					2a1ef75435 | ||
| 
						 | 
					c148d70978 | ||
| 
						 | 
					5aa14f636f | ||
| 
						 | 
					7b24a1a33b | ||
| 
						 | 
					7b6055d1af | ||
| 
						 | 
					f31b12503e | ||
| 
						 | 
					f82197ad75 | ||
| 
						 | 
					3f37e73bae | ||
| 
						 | 
					0774f470d9 | ||
| 
						 | 
					d7a9e91688 | ||
| 
						 | 
					601cb9be20 | ||
| 
						 | 
					393a9b68cf | ||
| 
						 | 
					f3229ee19a | ||
| 
						 | 
					219a3580b7 | ||
| 
						 | 
					d63c6bd397 | ||
| 
						 | 
					fdb61e583a | ||
| 
						 | 
					b8e2f83ae6 | ||
| 
						 | 
					93dbd83570 | ||
| 
						 | 
					5be022712a | ||
| 
						 | 
					43f9391bcc | ||
| 
						 | 
					c1c971654b | ||
| 
						 | 
					72b1072fbd | ||
| 
						 | 
					3bfd99bfbb | ||
| 
						 | 
					a169e82065 | ||
| 
						 | 
					c80410c50c | ||
| 
						 | 
					dc01b6b1f2 | ||
| 
						 | 
					b7a26e6daf | ||
| 
						 | 
					ce16450a89 | ||
| 
						 | 
					9d2e51c199 | ||
| 
						 | 
					1e325f6149 | ||
| 
						 | 
					c458a33196 | ||
| 
						 | 
					7953b8ff1b | ||
| 
						 | 
					b1460627f3 | ||
| 
						 | 
					5abc8ae6f9 | ||
| 
						 | 
					6a184a6098 | ||
| 
						 | 
					3d5e97f560 | ||
| 
						 | 
					54c7559a7e | ||
| 
						 | 
					0c9de428ae | ||
| 
						 | 
					f13def508c | ||
| 
						 | 
					1ae6ddac91 | ||
| 
						 | 
					55dcfa421c | ||
| 
						 | 
					c04f8cf44a | ||
| 
						 | 
					870d986131 | ||
| 
						 | 
					4f272c17f5 | ||
| 
						 | 
					fd3e027faa | ||
| 
						 | 
					235dd0a22a | ||
| 
						 | 
					b589977b9e | ||
| 
						 | 
					291e4a6ebe | ||
| 
						 | 
					2d2ed9dffd | ||
| 
						 | 
					8ada6e7705 | ||
| 
						 | 
					7f657f342a | ||
| 
						 | 
					20e8f0ee27 | ||
| 
						 | 
					429266b7e4 | ||
| 
						 | 
					2c7bc88d78 | ||
| 
						 | 
					54f7ebe789 | ||
| 
						 | 
					dd499e74de | ||
| 
						 | 
					19a6e8b32c | ||
| 
						 | 
					ed5538dc2b | ||
| 
						 | 
					b8ffcf49ed | ||
| 
						 | 
					eb929eef14 | ||
| 
						 | 
					2cd3ad9bdd | ||
| 
						 | 
					323f289c48 | ||
| 
						 | 
					a45e4a5537 | ||
| 
						 | 
					b7fe2f9675 | ||
| 
						 | 
					6dcd1c9109 | ||
| 
						 | 
					2fe5adc36c | ||
| 
						 | 
					839590f576 | ||
| 
						 | 
					e0a8d1f94e | ||
| 
						 | 
					9ad0f6812f | ||
| 
						 | 
					a3376fe8fc | ||
| 
						 | 
					3cc1f498a1 | ||
| 
						 | 
					c6c0035ea5 | ||
| 
						 | 
					531d630b5c | ||
| 
						 | 
					853b1eb424 | ||
| 
						 | 
					09a2615fb2 | ||
| 
						 | 
					285b42756a | ||
| 
						 | 
					508f15cdab | ||
| 
						 | 
					52c0d30078 | ||
| 
						 | 
					10997ee8ab | ||
| 
						 | 
					8a774dc9a6 | ||
| 
						 | 
					200bc9e3e8 | ||
| 
						 | 
					7dd0ee0495 | ||
| 
						 | 
					76569fc662 | ||
| 
						 | 
					f2a253e0dd | ||
| 
						 | 
					0ad0eaf61c | ||
| 
						 | 
					47b0f48dd9 | ||
| 
						 | 
					44e48abc44 | ||
| 
						 | 
					f420de027f | ||
| 
						 | 
					ecf186065c | ||
| 
						 | 
					20e021bf41 | ||
| 
						 | 
					8ca2ae775d | ||
| 
						 | 
					ee8aa8217a | ||
| 
						 | 
					2b49dd1e8f | ||
| 
						 | 
					30a54b9085 | ||
| 
						 | 
					1e7e62f8cd | ||
| 
						 | 
					4ae5099856 | ||
| 
						 | 
					5352823fbf | ||
| 
						 | 
					20251f01ea | ||
| 
						 | 
					528f6b81db | ||
| 
						 | 
					27bfba299e | ||
| 
						 | 
					1690863acc | ||
| 
						 | 
					397211323c | ||
| 
						 | 
					5c36f01000 | ||
| 
						 | 
					a87f50fb5a | ||
| 
						 | 
					31bc51c8cf | ||
| 
						 | 
					be487c429e | ||
| 
						 | 
					80340f1fe9 | ||
| 
						 | 
					d918f85146 | ||
| 
						 | 
					a95541d61e | ||
| 
						 | 
					30b4c2724e | ||
| 
						 | 
					2adc929367 | ||
| 
						 | 
					7e97837274 | ||
| 
						 | 
					4cb73bf8e4 | ||
| 
						 | 
					79bb8d0077 | ||
| 
						 | 
					6c1a3e4f58 | ||
| 
						 | 
					76c919c1a3 | ||
| 
						 | 
					98405f240b | ||
| 
						 | 
					181355616e | ||
| 
						 | 
					b49a5b2dc0 | ||
| 
						 | 
					713f226114 | ||
| 
						 | 
					d57d85ff35 | ||
| 
						 | 
					74daa124c2 | ||
| 
						 | 
					b8e35bd66e | ||
| 
						 | 
					e8734731d3 | ||
| 
						 | 
					9e0fcabeca | ||
| 
						 | 
					6482dec1bb | ||
| 
						 | 
					81b5eeed6a | ||
| 
						 | 
					365359dd79 | ||
| 
						 | 
					2757be06de | ||
| 
						 | 
					d0afe49d3e | ||
| 
						 | 
					81b31b7087 | ||
| 
						 | 
					2643b122fc | ||
| 
						 | 
					88db657ac2 | ||
| 
						 | 
					1f0af2c073 | ||
| 
						 | 
					2ed2d1515e | ||
| 
						 | 
					bb5b16a36c | ||
| 
						 | 
					5892855c5f | ||
| 
						 | 
					a6e859e9ec | ||
| 
						 | 
					99c65cef0f | ||
| 
						 | 
					496da8b918 | ||
| 
						 | 
					739862384c | ||
| 
						 | 
					0a647c2b8b | ||
| 
						 | 
					429e4f0de8 | ||
| 
						 | 
					2d10c7156c | ||
| 
						 | 
					299053becd | ||
| 
						 | 
					1449bda052 | ||
| 
						 | 
					56bb1a7c83 | ||
| 
						 | 
					96aaf806d8 | ||
| 
						 | 
					d70e5100c0 | ||
| 
						 | 
					4831e626aa | ||
| 
						 | 
					33ab4699ba | ||
| 
						 | 
					595cc5b4b8 | ||
| 
						 | 
					29fb08c2de | ||
| 
						 | 
					7babdf2029 | ||
| 
						 | 
					4b3270f78e | ||
| 
						 | 
					3351b8d007 | ||
| 
						 | 
					4b49bf6a93 | ||
| 
						 | 
					926a56bfe3 | ||
| 
						 | 
					d6f188be71 | ||
| 
						 | 
					016cadfb54 | ||
| 
						 | 
					bdee69f718 | ||
| 
						 | 
					ff43e2e155 | ||
| 
						 | 
					f53948856e | ||
| 
						 | 
					14056ee2ee | ||
| 
						 | 
					b545dc6775 | ||
| 
						 | 
					027902999e | ||
| 
						 | 
					9a310a5d4e | ||
| 
						 | 
					a63d5eaab2 | ||
| 
						 | 
					6af59bc095 | ||
| 
						 | 
					24cc290b85 | ||
| 
						 | 
					8e264a933f | ||
| 
						 | 
					f0b54fefe9 | ||
| 
						 | 
					cf2d9e09b3 | ||
| 
						 | 
					6ef9d8328b | ||
| 
						 | 
					d02408ad8a | ||
| 
						 | 
					7ae551fd03 | ||
| 
						 | 
					c2e45f6ddf | ||
| 
						 | 
					f9a4ad4fa6 | ||
| 
						 | 
					10645a4f13 | ||
| 
						 | 
					06cb0353e5 | ||
| 
						 | 
					b41f836e5f | ||
| 
						 | 
					26a81abffc | ||
| 
						 | 
					ab03b0df4c | ||
| 
						 | 
					e5a77633cf | ||
| 
						 | 
					6f8a82c7af | ||
| 
						 | 
					7a7f47ea80 | ||
| 
						 | 
					0ce5f3e4f5 | ||
| 
						 | 
					21023745e2 | ||
| 
						 | 
					a679116f6f | ||
| 
						 | 
					3988bb34aa | ||
| 
						 | 
					9e78e6c3f8 | ||
| 
						 | 
					3caff6092a | ||
| 
						 | 
					0d96bf8950 | ||
| 
						 | 
					91dc71f98d | ||
| 
						 | 
					b7b6c047ca | ||
| 
						 | 
					0ea659475c | ||
| 
						 | 
					1e20bb0648 | ||
| 
						 | 
					c962479bdf | ||
| 
						 | 
					b31ccc362c | ||
| 
						 | 
					0cd5866726 | ||
| 
						 | 
					2a8a10eda6 | ||
| 
						 | 
					f11bc84080 | ||
| 
						 | 
					e2f3ae1252 | ||
| 
						 | 
					40fcda292f | ||
| 
						 | 
					59bc3126c5 | ||
| 
						 | 
					4d6115a5cc | ||
| 
						 | 
					3a25b96caf | ||
| 
						 | 
					6e6d04e29a | ||
| 
						 | 
					48ff225300 | ||
| 
						 | 
					a4a9d97a3e | ||
| 
						 | 
					404f952aa3 | ||
| 
						 | 
					dcd87618ab | ||
| 
						 | 
					d54bf14559 | ||
| 
						 | 
					ea3a429efe | ||
| 
						 | 
					e3f1223fe4 | ||
| 
						 | 
					7ef6e3fe2f | ||
| 
						 | 
					197322455d | ||
| 
						 | 
					4f19a0672b | ||
| 
						 | 
					854e076df8 | ||
| 
						 | 
					cb2a0e1319 | ||
| 
						 | 
					638b0d4277 | ||
| 
						 | 
					f2346808de | ||
| 
						 | 
					d7818facb9 | ||
| 
						 | 
					bcf95a2183 | ||
| 
						 | 
					f7181a9179 | ||
| 
						 | 
					9237ba8b66 | ||
| 
						 | 
					95874603b0 | ||
| 
						 | 
					ed2e24d564 | ||
| 
						 | 
					c9fd77e9dd | ||
| 
						 | 
					a9d2bc4902 | ||
| 
						 | 
					c3bdbcf639 | ||
| 
						 | 
					d9a770e6ea | ||
| 
						 | 
					35feed50f0 | ||
| 
						 | 
					a116afa42e | ||
| 
						 | 
					b4542fb307 | ||
| 
						 | 
					1f224bf029 | ||
| 
						 | 
					4d231b4359 | ||
| 
						 | 
					ac0f1d0b14 | ||
| 
						 | 
					124d8cf701 | ||
| 
						 | 
					7d0d0996aa | ||
| 
						 | 
					9cddbf14db | ||
| 
						 | 
					5f1fddbbe7 | ||
| 
						 | 
					027e257b1d | ||
| 
						 | 
					93f117003e | ||
| 
						 | 
					42748c084e | ||
| 
						 | 
					77dd9c1850 | ||
| 
						 | 
					83d968df60 | ||
| 
						 | 
					4ac881ede3 | ||
| 
						 | 
					ccd2cd3e64 | ||
| 
						 | 
					6186ef9338 | ||
| 
						 | 
					6bcac6e578 | ||
| 
						 | 
					967d95f096 | ||
| 
						 | 
					26c7750827 | ||
| 
						 | 
					5a16d270ab | ||
| 
						 | 
					3a465d5ec9 | ||
| 
						 | 
					413a4a0461 | ||
| 
						 | 
					a95d2c5133 | ||
| 
						 | 
					1876cc32ae | ||
| 
						 | 
					4e2a08ddd4 | ||
| 
						 | 
					61e2c34a10 | ||
| 
						 | 
					e56b54a376 | ||
| 
						 | 
					0da945bb20 | ||
| 
						 | 
					69443d0da0 | ||
| 
						 | 
					e4dc18d7e5 | ||
| 
						 | 
					3f86a2b147 | ||
| 
						 | 
					fd664b9fc6 | ||
| 
						 | 
					722ca2781c | ||
| 
						 | 
					1c72eebf89 | ||
| 
						 | 
					69ce8bb952 | ||
| 
						 | 
					50b8ba0201 | ||
| 
						 | 
					c9fd9152bd | ||
| 
						 | 
					f891abccf2 | ||
| 
						 | 
					e2effdbc6b | ||
| 
						 | 
					b10ae320f7 | ||
| 
						 | 
					5d3ab9b096 | ||
| 
						 | 
					4fea8145e2 | ||
| 
						 | 
					884e26080f | ||
| 
						 | 
					9946491fcc | ||
| 
						 | 
					ae6dfff5bf | ||
| 
						 | 
					307bf4dae2 | ||
| 
						 | 
					96d65fc022 | ||
| 
						 | 
					080b8cadfa | ||
| 
						 | 
					7cdd2aa128 | ||
| 
						 | 
					7d7672f119 | ||
| 
						 | 
					6a5b52efa0 | ||
| 
						 | 
					6d864b7030 | ||
| 
						 | 
					71a39dd4be | ||
| 
						 | 
					500230ee94 | ||
| 
						 | 
					347177e052 | ||
| 
						 | 
					b7883fbb6e | ||
| 
						 | 
					a77e023ab4 | ||
| 
						 | 
					812cb5638c | ||
| 
						 | 
					77a0f1d727 | ||
| 
						 | 
					b9a18f3b8d | ||
| 
						 | 
					73aeb61c3f | ||
| 
						 | 
					3041903844 | ||
| 
						 | 
					ad8ee98617 | ||
| 
						 | 
					bc29d0e5d4 | ||
| 
						 | 
					f89aebb1c4 | ||
| 
						 | 
					1d7fb4f0c5 | ||
| 
						 | 
					81a6c7817f | ||
| 
						 | 
					5238fccc15 | ||
| 
						 | 
					fba9046490 | ||
| 
						 | 
					8a2908a24a | ||
| 
						 | 
					e8b12f7a6f | ||
| 
						 | 
					271da5a2e0 | ||
| 
						 | 
					26fbabf3d1 | ||
| 
						 | 
					37cdcb4d8a | ||
| 
						 | 
					57b6534e53 | ||
| 
						 | 
					8bf49ea170 | ||
| 
						 | 
					02ee8626fb | ||
| 
						 | 
					6276e5b41b | ||
| 
						 | 
					51740b12ae | ||
| 
						 | 
					6e6783056e | ||
| 
						 | 
					791bd0cd2b | ||
| 
						 | 
					e890dcdb19 | ||
| 
						 | 
					5ddcb8664a | ||
| 
						 | 
					09c4b4e0b7 | ||
| 
						 | 
					368101778e | ||
| 
						 | 
					535d79da63 | ||
| 
						 | 
					4f69172d25 | 
							
								
								
									
										356
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										356
									
								
								CHANGES
									
									
									
									
									
								
							@@ -2,6 +2,358 @@
 | 
			
		||||
 OpenSSL CHANGES
 | 
			
		||||
 _______________
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.6b and 0.9.6c  [21 dec 2001]
 | 
			
		||||
 | 
			
		||||
  *) Fix BN_rand_range bug pointed out by Dominikus Scherkl
 | 
			
		||||
     <Dominikus.Scherkl@biodata.com>.  (The previous implementation
 | 
			
		||||
     worked incorrectly for those cases where  range = 10..._2  and
 | 
			
		||||
     3*range  is two bits longer than  range.)
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Only add signing time to PKCS7 structures if it is not already
 | 
			
		||||
     present.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix crypto/objects/objects.h: "ld-ce" should be "id-ce",
 | 
			
		||||
     OBJ_ld_ce should be OBJ_id_ce.
 | 
			
		||||
     Also some ip-pda OIDs in crypto/objects/objects.txt were
 | 
			
		||||
     incorrect (cf. RFC 3039).
 | 
			
		||||
     [Matt Cooper, Frederic Giudicelli, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Release CRYPTO_LOCK_DYNLOCK when CRYPTO_destroy_dynlockid()
 | 
			
		||||
     returns early because it has nothing to do.
 | 
			
		||||
     [Andy Schneider <andy.schneider@bjss.co.uk>]
 | 
			
		||||
 | 
			
		||||
  *) [In 0.9.6c-engine release:]
 | 
			
		||||
     Fix mutex callback return values in crypto/engine/hw_ncipher.c.
 | 
			
		||||
     [Andy Schneider <andy.schneider@bjss.co.uk>]
 | 
			
		||||
 | 
			
		||||
  *) [In 0.9.6c-engine release:]
 | 
			
		||||
     Add support for Cryptographic Appliance's keyserver technology.
 | 
			
		||||
     (Use engine 'keyclient')
 | 
			
		||||
     [Cryptographic Appliances and Geoff Thorpe]
 | 
			
		||||
 | 
			
		||||
  *) Add a configuration entry for OS/390 Unix.  The C compiler 'c89'
 | 
			
		||||
     is called via tools/c89.sh because arguments have to be
 | 
			
		||||
     rearranged (all '-L' options must appear before the first object
 | 
			
		||||
     modules).
 | 
			
		||||
     [Richard Shapiro <rshapiro@abinitio.com>]
 | 
			
		||||
 | 
			
		||||
  *) [In 0.9.6c-engine release:]
 | 
			
		||||
     Add support for Broadcom crypto accelerator cards, backported
 | 
			
		||||
     from 0.9.7.
 | 
			
		||||
     [Broadcom, Nalin Dahyabhai <nalin@redhat.com>, Mark Cox]
 | 
			
		||||
 | 
			
		||||
  *) [In 0.9.6c-engine release:]
 | 
			
		||||
     Add support for SureWare crypto accelerator cards from 
 | 
			
		||||
     Baltimore Technologies.  (Use engine 'sureware')
 | 
			
		||||
     [Baltimore Technologies and Mark Cox]
 | 
			
		||||
 | 
			
		||||
  *) [In 0.9.6c-engine release:]
 | 
			
		||||
     Add support for crypto accelerator cards from Accelerated
 | 
			
		||||
     Encryption Processing, www.aep.ie.  (Use engine 'aep')
 | 
			
		||||
     [AEP Inc. and Mark Cox]
 | 
			
		||||
 | 
			
		||||
  *) Add a configuration entry for gcc on UnixWare.
 | 
			
		||||
     [Gary Benson <gbenson@redhat.com>]
 | 
			
		||||
 | 
			
		||||
  *) Change ssl/s2_clnt.c and ssl/s2_srvr.c so that received handshake
 | 
			
		||||
     messages are stored in a single piece (fixed-length part and
 | 
			
		||||
     variable-length part combined) and fix various bugs found on the way.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Disable caching in BIO_gethostbyname(), directly use gethostbyname()
 | 
			
		||||
     instead.  BIO_gethostbyname() does not know what timeouts are
 | 
			
		||||
     appropriate, so entries would stay in cache even when they have
 | 
			
		||||
     become invalid.
 | 
			
		||||
     [Bodo Moeller; problem pointed out by Rich Salz <rsalz@zolera.com>
 | 
			
		||||
 | 
			
		||||
  *) Change ssl23_get_client_hello (ssl/s23_srvr.c) behaviour when
 | 
			
		||||
     faced with a pathologically small ClientHello fragment that does
 | 
			
		||||
     not contain client_version: Instead of aborting with an error,
 | 
			
		||||
     simply choose the highest available protocol version (i.e.,
 | 
			
		||||
     TLS 1.0 unless it is disabled).  In practice, ClientHello
 | 
			
		||||
     messages are never sent like this, but this change gives us
 | 
			
		||||
     strictly correct behaviour at least for TLS.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix SSL handshake functions and SSL_clear() such that SSL_clear()
 | 
			
		||||
     never resets s->method to s->ctx->method when called from within
 | 
			
		||||
     one of the SSL handshake functions.
 | 
			
		||||
     [Bodo Moeller; problem pointed out by Niko Baric]
 | 
			
		||||
 | 
			
		||||
  *) In ssl3_get_client_hello (ssl/s3_srvr.c), generate a fatal alert
 | 
			
		||||
     (sent using the client's version number) if client_version is
 | 
			
		||||
     smaller than the protocol version in use.  Also change
 | 
			
		||||
     ssl23_get_client_hello (ssl/s23_srvr.c) to select TLS 1.0 if
 | 
			
		||||
     the client demanded SSL 3.0 but only TLS 1.0 is enabled; then
 | 
			
		||||
     the client will at least see that alert.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix ssl3_get_message (ssl/s3_both.c) to handle message fragmentation
 | 
			
		||||
     correctly.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Avoid infinite loop in ssl3_get_message (ssl/s3_both.c) if a
 | 
			
		||||
     client receives HelloRequest while in a handshake.
 | 
			
		||||
     [Bodo Moeller; bug noticed by Andy Schneider <andy.schneider@bjss.co.uk>]
 | 
			
		||||
 | 
			
		||||
  *) Bugfix in ssl3_accept (ssl/s3_srvr.c): Case SSL3_ST_SW_HELLO_REQ_C
 | 
			
		||||
     should end in 'break', not 'goto end' which circuments various
 | 
			
		||||
     cleanups done in state SSL_ST_OK.   But session related stuff
 | 
			
		||||
     must be disabled for SSL_ST_OK in the case that we just sent a
 | 
			
		||||
     HelloRequest.
 | 
			
		||||
 | 
			
		||||
     Also avoid some overhead by not calling ssl_init_wbio_buffer()
 | 
			
		||||
     before just sending a HelloRequest.
 | 
			
		||||
     [Bodo Moeller, Eric Rescorla <ekr@rtfm.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix ssl/s3_enc.c, ssl/t1_enc.c and ssl/s3_pkt.c so that we don't
 | 
			
		||||
     reveal whether illegal block cipher padding was found or a MAC
 | 
			
		||||
     verification error occured.  (Neither SSLerr() codes nor alerts
 | 
			
		||||
     are directly visible to potential attackers, but the information
 | 
			
		||||
     may leak via logfiles.)
 | 
			
		||||
 | 
			
		||||
     Similar changes are not required for the SSL 2.0 implementation
 | 
			
		||||
     because the number of padding bytes is sent in clear for SSL 2.0,
 | 
			
		||||
     and the extra bytes are just ignored.  However ssl/s2_pkt.c
 | 
			
		||||
     failed to verify that the purported number of padding bytes is in
 | 
			
		||||
     the legal range.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Add OpenUNIX-8 support including shared libraries
 | 
			
		||||
     (Boyd Lynn Gerber <gerberb@zenez.com>).
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Improve RSA_padding_check_PKCS1_OAEP() check again to avoid
 | 
			
		||||
     'wristwatch attack' using huge encoding parameters (cf.
 | 
			
		||||
     James H. Manger's CRYPTO 2001 paper).  Note that the
 | 
			
		||||
     RSA_PKCS1_OAEP_PADDING case of RSA_private_decrypt() does not use
 | 
			
		||||
     encoding parameters and hence was not vulnerable.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) BN_sqr() bug fix.
 | 
			
		||||
     [Ulf M<>ller, reported by Jim Ellis <jim.ellis@cavium.com>]
 | 
			
		||||
 | 
			
		||||
  *) Rabin-Miller test analyses assume uniformly distributed witnesses,
 | 
			
		||||
     so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
 | 
			
		||||
     followed by modular reduction.
 | 
			
		||||
     [Bodo Moeller; pointed out by Adam Young <AYoung1@NCSUS.JNJ.COM>]
 | 
			
		||||
 | 
			
		||||
  *) Add BN_pseudo_rand_range() with obvious functionality: BN_rand_range()
 | 
			
		||||
     equivalent based on BN_pseudo_rand() instead of BN_rand().
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) s3_srvr.c: allow sending of large client certificate lists (> 16 kB).
 | 
			
		||||
     This function was broken, as the check for a new client hello message
 | 
			
		||||
     to handle SGC did not allow these large messages.
 | 
			
		||||
     (Tracked down by "Douglas E. Engert" <deengert@anl.gov>.)
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Add alert descriptions for TLSv1 to SSL_alert_desc_string[_long]().
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Fix buggy behaviour of BIO_get_num_renegotiates() and BIO_ctrl()
 | 
			
		||||
     for BIO_C_GET_WRITE_BUF_SIZE ("Stephen Hinton" <shinton@netopia.com>).
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Rework the configuration and shared library support for Tru64 Unix.
 | 
			
		||||
     The configuration part makes use of modern compiler features and
 | 
			
		||||
     still retains old compiler behavior for those that run older versions
 | 
			
		||||
     of the OS.  The shared library support part includes a variant that
 | 
			
		||||
     uses the RPATH feature, and is available through the special
 | 
			
		||||
     configuration target "alpha-cc-rpath", which will never be selected
 | 
			
		||||
     automatically.
 | 
			
		||||
     [Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> via Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) In ssl3_get_key_exchange (ssl/s3_clnt.c), call ssl3_get_message()
 | 
			
		||||
     with the same message size as in ssl3_get_certificate_request().
 | 
			
		||||
     Otherwise, if no ServerKeyExchange message occurs, CertificateRequest
 | 
			
		||||
     messages might inadvertently be reject as too long.
 | 
			
		||||
     [Petr Lampa <lampa@fee.vutbr.cz>]
 | 
			
		||||
 | 
			
		||||
  *) Enhanced support for IA-64 Unix platforms (well, Linux and HP-UX).
 | 
			
		||||
     [Andy Polyakov]
 | 
			
		||||
 | 
			
		||||
  *) Modified SSL library such that the verify_callback that has been set
 | 
			
		||||
     specificly for an SSL object with SSL_set_verify() is actually being
 | 
			
		||||
     used. Before the change, a verify_callback set with this function was
 | 
			
		||||
     ignored and the verify_callback() set in the SSL_CTX at the time of
 | 
			
		||||
     the call was used. New function X509_STORE_CTX_set_verify_cb() introduced
 | 
			
		||||
     to allow the necessary settings.
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Initialize static variable in crypto/dsa/dsa_lib.c and crypto/dh/dh_lib.c
 | 
			
		||||
     explicitly to NULL, as at least on Solaris 8 this seems not always to be
 | 
			
		||||
     done automatically (in contradiction to the requirements of the C
 | 
			
		||||
     standard). This made problems when used from OpenSSH.
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) In OpenSSL 0.9.6a and 0.9.6b, crypto/dh/dh_key.c ignored
 | 
			
		||||
     dh->length and always used
 | 
			
		||||
 | 
			
		||||
          BN_rand_range(priv_key, dh->p).
 | 
			
		||||
 | 
			
		||||
     BN_rand_range() is not necessary for Diffie-Hellman, and this
 | 
			
		||||
     specific range makes Diffie-Hellman unnecessarily inefficient if
 | 
			
		||||
     dh->length (recommended exponent length) is much smaller than the
 | 
			
		||||
     length of dh->p.  We could use BN_rand_range() if the order of
 | 
			
		||||
     the subgroup was stored in the DH structure, but we only have
 | 
			
		||||
     dh->length.
 | 
			
		||||
 | 
			
		||||
     So switch back to
 | 
			
		||||
 | 
			
		||||
          BN_rand(priv_key, l, ...)
 | 
			
		||||
 | 
			
		||||
     where 'l' is dh->length if this is defined, or BN_num_bits(dh->p)-1
 | 
			
		||||
     otherwise.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) In
 | 
			
		||||
 | 
			
		||||
          RSA_eay_public_encrypt
 | 
			
		||||
          RSA_eay_private_decrypt
 | 
			
		||||
          RSA_eay_private_encrypt (signing)
 | 
			
		||||
          RSA_eay_public_decrypt (signature verification)
 | 
			
		||||
 | 
			
		||||
     (default implementations for RSA_public_encrypt,
 | 
			
		||||
     RSA_private_decrypt, RSA_private_encrypt, RSA_public_decrypt),
 | 
			
		||||
     always reject numbers >= n.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) In crypto/rand/md_rand.c, use a new short-time lock CRYPTO_LOCK_RAND2
 | 
			
		||||
     to synchronize access to 'locking_thread'.  This is necessary on
 | 
			
		||||
     systems where access to 'locking_thread' (an 'unsigned long'
 | 
			
		||||
     variable) is not atomic.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) In crypto/rand/md_rand.c, set 'locking_thread' to current thread's ID
 | 
			
		||||
     *before* setting the 'crypto_lock_rand' flag.  The previous code had
 | 
			
		||||
     a race condition if 0 is a valid thread ID.
 | 
			
		||||
     [Travis Vitek <vitek@roguewave.com>]
 | 
			
		||||
 | 
			
		||||
  *) Add support for shared libraries under Irix.
 | 
			
		||||
     [Albert Chin-A-Young <china@thewrittenword.com>]
 | 
			
		||||
 | 
			
		||||
  *) Add configuration option to build on Linux on both big-endian and
 | 
			
		||||
     little-endian MIPS.
 | 
			
		||||
     [Ralf Baechle <ralf@uni-koblenz.de>]
 | 
			
		||||
 | 
			
		||||
  *) Add the possibility to create shared libraries on HP-UX.
 | 
			
		||||
     [Richard Levitte]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.6a and 0.9.6b  [9 Jul 2001]
 | 
			
		||||
 | 
			
		||||
  *) Change ssleay_rand_bytes (crypto/rand/md_rand.c)
 | 
			
		||||
     to avoid a SSLeay/OpenSSL PRNG weakness pointed out by
 | 
			
		||||
     Markku-Juhani O. Saarinen <markku-juhani.saarinen@nokia.com>:
 | 
			
		||||
     PRNG state recovery was possible based on the output of
 | 
			
		||||
     one PRNG request appropriately sized to gain knowledge on
 | 
			
		||||
     'md' followed by enough consecutive 1-byte PRNG requests
 | 
			
		||||
     to traverse all of 'state'.
 | 
			
		||||
 | 
			
		||||
     1. When updating 'md_local' (the current thread's copy of 'md')
 | 
			
		||||
        during PRNG output generation, hash all of the previous
 | 
			
		||||
        'md_local' value, not just the half used for PRNG output.
 | 
			
		||||
 | 
			
		||||
     2. Make the number of bytes from 'state' included into the hash
 | 
			
		||||
        independent from the number of PRNG bytes requested.
 | 
			
		||||
 | 
			
		||||
     The first measure alone would be sufficient to avoid
 | 
			
		||||
     Markku-Juhani's attack.  (Actually it had never occurred
 | 
			
		||||
     to me that the half of 'md_local' used for chaining was the
 | 
			
		||||
     half from which PRNG output bytes were taken -- I had always
 | 
			
		||||
     assumed that the secret half would be used.)  The second
 | 
			
		||||
     measure makes sure that additional data from 'state' is never
 | 
			
		||||
     mixed into 'md_local' in small portions; this heuristically
 | 
			
		||||
     further strengthens the PRNG.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix crypto/bn/asm/mips3.s.
 | 
			
		||||
     [Andy Polyakov]
 | 
			
		||||
 | 
			
		||||
  *) When only the key is given to "enc", the IV is undefined. Print out
 | 
			
		||||
     an error message in this case.
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Handle special case when X509_NAME is empty in X509 printing routines.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) In dsa_do_verify (crypto/dsa/dsa_ossl.c), verify that r and s are
 | 
			
		||||
     positive and less than q.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Don't change *pointer in CRYPTO_add_lock() is add_lock_callback is
 | 
			
		||||
     used: it isn't thread safe and the add_lock_callback should handle
 | 
			
		||||
     that itself.
 | 
			
		||||
     [Paul Rose <Paul.Rose@bridge.com>]
 | 
			
		||||
 | 
			
		||||
  *) Verify that incoming data obeys the block size in
 | 
			
		||||
     ssl3_enc (ssl/s3_enc.c) and tls1_enc (ssl/t1_enc.c).
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix OAEP check.
 | 
			
		||||
     [Ulf M<>ller, Bodo M<>ller]
 | 
			
		||||
 | 
			
		||||
  *) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
 | 
			
		||||
     RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
 | 
			
		||||
     when fixing the server behaviour for backwards-compatible 'client
 | 
			
		||||
     hello' messages.  (Note that the attack is impractical against
 | 
			
		||||
     SSL 3.0 and TLS 1.0 anyway because length and version checking
 | 
			
		||||
     means that the probability of guessing a valid ciphertext is
 | 
			
		||||
     around 2^-40; see section 5 in Bleichenbacher's CRYPTO '98
 | 
			
		||||
     paper.)
 | 
			
		||||
 | 
			
		||||
     Before 0.9.5, the countermeasure (hide the error by generating a
 | 
			
		||||
     random 'decryption result') did not work properly because
 | 
			
		||||
     ERR_clear_error() was missing, meaning that SSL_get_error() would
 | 
			
		||||
     detect the supposedly ignored error.
 | 
			
		||||
 | 
			
		||||
     Both problems are now fixed.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) In crypto/bio/bf_buff.c, increase DEFAULT_BUFFER_SIZE to 4096
 | 
			
		||||
     (previously it was 1024).
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix for compatibility mode trust settings: ignore trust settings
 | 
			
		||||
     unless some valid trust or reject settings are present.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix for blowfish EVP: its a variable length cipher.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix various bugs related to DSA S/MIME verification. Handle missing
 | 
			
		||||
     parameters in DSA public key structures and return an error in the
 | 
			
		||||
     DSA routines if parameters are absent.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) In versions up to 0.9.6, RAND_file_name() resorted to file ".rnd"
 | 
			
		||||
     in the current directory if neither $RANDFILE nor $HOME was set.
 | 
			
		||||
     RAND_file_name() in 0.9.6a returned NULL in this case.  This has
 | 
			
		||||
     caused some confusion to Windows users who haven't defined $HOME.
 | 
			
		||||
     Thus RAND_file_name() is changed again: e_os.h can define a
 | 
			
		||||
     DEFAULT_HOME, which will be used if $HOME is not set.
 | 
			
		||||
     For Windows, we use "C:"; on other platforms, we still require
 | 
			
		||||
     environment variables.
 | 
			
		||||
 | 
			
		||||
  *) Move 'if (!initialized) RAND_poll()' into regions protected by
 | 
			
		||||
     CRYPTO_LOCK_RAND.  This is not strictly necessary, but avoids
 | 
			
		||||
     having multiple threads call RAND_poll() concurrently.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) In crypto/rand/md_rand.c, replace 'add_do_not_lock' flag by a
 | 
			
		||||
     combination of a flag and a thread ID variable.
 | 
			
		||||
     Otherwise while one thread is in ssleay_rand_bytes (which sets the
 | 
			
		||||
     flag), *other* threads can enter ssleay_add_bytes without obeying
 | 
			
		||||
     the CRYPTO_LOCK_RAND lock (and may even illegally release the lock
 | 
			
		||||
     that they do not hold after the first thread unsets add_do_not_lock).
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Change bctest again: '-x' expressions are not available in all
 | 
			
		||||
     versions of 'test'.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.6 and 0.9.6a  [5 Apr 2001]
 | 
			
		||||
 | 
			
		||||
  *) Fix a couple of memory leaks in PKCS7_dataDecode()
 | 
			
		||||
@@ -636,7 +988,7 @@
 | 
			
		||||
     default is static libraries only, and the OpenSSL programs
 | 
			
		||||
     are always statically linked for now, but there are
 | 
			
		||||
     preparations for dynamic linking in place.
 | 
			
		||||
     This has been tested on Linux and True64.
 | 
			
		||||
     This has been tested on Linux and Tru64.
 | 
			
		||||
     [Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) Randomness polling function for Win9x, as described in:
 | 
			
		||||
@@ -2363,7 +2715,7 @@
 | 
			
		||||
                                     copied!)
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Bugfix: SSL_set_mode ignored its parameter, only SSL_CTX_set_mode
 | 
			
		||||
  *) Bugfix: SSL_set_options ignored its parameter, only SSL_CTX_set_options
 | 
			
		||||
     worked.
 | 
			
		||||
 | 
			
		||||
  *) Fix problems with no-hmac etc.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										146
									
								
								Configure
									
									
									
									
									
								
							
							
						
						
									
										146
									
								
								Configure
									
									
									
									
									
								
							@@ -125,10 +125,10 @@ my %table=(
 | 
			
		||||
"debug-ben-debug",	"gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
 | 
			
		||||
"debug-ben-strict",	"gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown):::::",
 | 
			
		||||
"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 -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-ulf",	"gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-bodo",	"gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-ulf",	"gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-steve",	"gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn",
 | 
			
		||||
"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn",
 | 
			
		||||
"dist",		"cc:-O::(unknown):::::",
 | 
			
		||||
 | 
			
		||||
# Basic configs that should work on any (32 and less bit) box
 | 
			
		||||
@@ -141,18 +141,21 @@ my %table=(
 | 
			
		||||
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
 | 
			
		||||
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
 | 
			
		||||
# error message.
 | 
			
		||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### Solaris x86 with Sun C setups
 | 
			
		||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### SPARC Solaris with GNU C setups
 | 
			
		||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
 | 
			
		||||
# but keep the assembler modules.
 | 
			
		||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
####
 | 
			
		||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### SPARC Solaris with Sun C setups
 | 
			
		||||
# DO NOT use /xO[34] on sparc with SC3.0.  It is broken, and will not pass the tests
 | 
			
		||||
@@ -186,17 +189,17 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
#### IRIX 5.x configs
 | 
			
		||||
# -mips2 flag is added by ./config when appropriate.
 | 
			
		||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::",
 | 
			
		||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:::",
 | 
			
		||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR::::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
#### IRIX 6.x configs
 | 
			
		||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
 | 
			
		||||
# './Configure irix-[g]cc' manually.
 | 
			
		||||
# -mips4 flag is added by ./config when appropriate.
 | 
			
		||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}",
 | 
			
		||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}",
 | 
			
		||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# N64 ABI builds.
 | 
			
		||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}",
 | 
			
		||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}",
 | 
			
		||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### Unified HP-UX ANSI C configs.
 | 
			
		||||
# Special notes:
 | 
			
		||||
@@ -228,41 +231,44 @@ my %table=(
 | 
			
		||||
#
 | 
			
		||||
#!#"hpux-parisc-cc","cc:-Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
# Since there is mention of this in shlib/hpux10-cc.sh
 | 
			
		||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn",
 | 
			
		||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
# More attempts at unified 10.X and 11.X targets for HP C compiler.
 | 
			
		||||
#
 | 
			
		||||
# Chris Ruemmler <ruemmler@cup.hp.com>
 | 
			
		||||
# Kevin Steves <ks@hp.se>
 | 
			
		||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
 | 
			
		||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl",
 | 
			
		||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn",
 | 
			
		||||
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
 | 
			
		||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
# HPUX 9.X config.
 | 
			
		||||
# Don't use the bundled cc.  It is broken.  Use HP ANSI C if possible, or
 | 
			
		||||
# egcs.  gcc 2.8.1 is also broken.
 | 
			
		||||
 | 
			
		||||
"hpux-cc",	"cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux-cc",	"cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# If hpux-cc fails (e.g. during "make test"), try the next one; otherwise,
 | 
			
		||||
# please report your OS and compiler version to the openssl-bugs@openssl.org
 | 
			
		||||
# mailing list.
 | 
			
		||||
"hpux-brokencc",	"cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux-brokencc",	"cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
"hpux-gcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux-gcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# If hpux-gcc fails, try this one:
 | 
			
		||||
"hpux-brokengcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux-brokengcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
# HPUX 9.X on Motorola 68k platforms with gcc
 | 
			
		||||
"hpux-m68k-gcc",  "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::BN_LLONG DES_PTR DES_UNROLL:::",
 | 
			
		||||
 | 
			
		||||
# HPUX 10.X config.  Supports threads.
 | 
			
		||||
"hpux10-cc",	"cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux10-cc",	"cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# If hpux10-cc fails, try this one (if still fails, try deleting BN_LLONG):
 | 
			
		||||
"hpux10-brokencc",	"cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux10-brokencc",	"cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
"hpux10-gcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux10-gcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
# If hpux10-gcc fails, try this one:
 | 
			
		||||
"hpux10-brokengcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 | 
			
		||||
"hpux10-brokengcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
# HPUX 11.X from www.globus.org.
 | 
			
		||||
# Only works on PA-RISC 2.0 cpus, and not optimized.  Why?
 | 
			
		||||
@@ -273,12 +279,39 @@ my %table=(
 | 
			
		||||
#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
 | 
			
		||||
"MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
 | 
			
		||||
 | 
			
		||||
# Dec Alpha, OSF/1 - the alpha164-cc is the flags for a 21164A with
 | 
			
		||||
# the new compiler
 | 
			
		||||
# Dec Alpha, OSF/1 - the alpha164-cc is historical, for the conversion
 | 
			
		||||
# from the older DEC C Compiler to the newer compiler.  It's now the
 | 
			
		||||
# same as the preferred entry, alpha-cc.  If you are still using the
 | 
			
		||||
# older compiler (you're at 3.x or earlier, or perhaps very early 4.x)
 | 
			
		||||
# you should use `alphaold-cc'.
 | 
			
		||||
#
 | 
			
		||||
#	"What's in a name? That which we call a rose
 | 
			
		||||
#	 By any other word would smell as sweet."
 | 
			
		||||
#
 | 
			
		||||
# - William Shakespeare, "Romeo & Juliet", Act II, scene II.
 | 
			
		||||
#
 | 
			
		||||
# For OSF/1 3.2b and earlier, and Digital UNIX 3.2c - 3.2g, with the
 | 
			
		||||
# vendor compiler, use alphaold-cc.
 | 
			
		||||
# For Digital UNIX 4.0 - 4.0e, with the vendor compiler, use alpha-cc.
 | 
			
		||||
# For Tru64 UNIX 4.f - current, with the vendor compiler, use alpha-cc.
 | 
			
		||||
#
 | 
			
		||||
# There's also an alternate target available (which `config' will never
 | 
			
		||||
# select) called alpha-cc-rpath.  This target builds an RPATH into the
 | 
			
		||||
# shared libraries, which is very convenient on Tru64 since binaries
 | 
			
		||||
# linked against that shared library will automatically inherit that RPATH,
 | 
			
		||||
# and hence know where to look for the openssl libraries, even if they're in
 | 
			
		||||
# an odd place.
 | 
			
		||||
#
 | 
			
		||||
# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version
 | 
			
		||||
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:tru64-shared::.so",
 | 
			
		||||
"alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
 | 
			
		||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
 | 
			
		||||
#
 | 
			
		||||
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:alpha-osf1-shared::.so",
 | 
			
		||||
"alphaold-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared::.so",
 | 
			
		||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
 | 
			
		||||
"alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared::.so",
 | 
			
		||||
"alpha-cc-rpath", "cc:-std1 -tune host -fast -readonly_strings::-pthread::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared-rpath::.so",
 | 
			
		||||
#
 | 
			
		||||
# This probably belongs in a different section.
 | 
			
		||||
#
 | 
			
		||||
"FreeBSD-alpha","gcc:-DTERMIOS -O -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### Alpha Linux with GNU C and Compaq C setups
 | 
			
		||||
@@ -308,15 +341,16 @@ my %table=(
 | 
			
		||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT:-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
 | 
			
		||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT:-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
 | 
			
		||||
"linux-aout",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
 | 
			
		||||
"linux-mips",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
 | 
			
		||||
"linux-ppc",    "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
 | 
			
		||||
"linux-mipsel",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
 | 
			
		||||
"linux-mips",   "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
 | 
			
		||||
"linux-ppc",	"gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-m68k",   "gcc:-DB_ENDIAN -DTERMIO -O2 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
 | 
			
		||||
"linux-s390",	"gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
 | 
			
		||||
"linux-ia64",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::SIXTY_FOUR_BIT_LONG::",
 | 
			
		||||
"linux-ia64",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"NetBSD-sparc",	"gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"NetBSD-m68",	"gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"NetBSD-x86",	"gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"FreeBSD-elf",  "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"FreeBSD-elf",  "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"FreeBSD",      "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
 | 
			
		||||
"bsdi-gcc",     "gcc:-O3 -ffast-math -DL_ENDIAN -DPERL5 -m486::(unknown)::RSA_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_bsdi_asm}",
 | 
			
		||||
"bsdi-elf-gcc",     "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
@@ -328,6 +362,9 @@ my %table=(
 | 
			
		||||
# QNX 4
 | 
			
		||||
"qnx4",	"cc:-DL_ENDIAN -DTERMIO::(unknown)::${x86_gcc_des} ${x86_gcc_opts}:",
 | 
			
		||||
 | 
			
		||||
# QNX 6
 | 
			
		||||
"qnx6",	"cc:-DL_ENDIAN -DTERMIOS::(unknown):-lsocket:${x86_gcc_des} ${x86_gcc_opts}:",
 | 
			
		||||
 | 
			
		||||
# Linux on ARM
 | 
			
		||||
"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
@@ -344,6 +381,15 @@ my %table=(
 | 
			
		||||
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
 | 
			
		||||
"unixware-7-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
 | 
			
		||||
"unixware-7-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
 | 
			
		||||
"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT:-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:gnu-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
# OpenUNIX 8
 | 
			
		||||
"OpenUNIX-8","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
 | 
			
		||||
"OpenUNIX-8-gcc","gcc:-O -DFILIO_H -fomit-frame-pointer::-pthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
 | 
			
		||||
"OpenUNIX-8-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
 | 
			
		||||
"OpenUNIX-8-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread:-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
 | 
			
		||||
"OpenUNIX-8-shared","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic",
 | 
			
		||||
"OpenUNIX-8-gcc-shared","gcc:-O3 -DFILIO_H -fomit-frame-pointer::-pthread:-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr5-shared:-fPIC",
 | 
			
		||||
 | 
			
		||||
# IBM's AIX.
 | 
			
		||||
"aix-cc",   "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR:::",
 | 
			
		||||
@@ -397,6 +443,12 @@ my %table=(
 | 
			
		||||
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
 | 
			
		||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown):-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
 | 
			
		||||
 | 
			
		||||
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
 | 
			
		||||
# You need to compile using the c89.sh wrapper in the tools directory, because the
 | 
			
		||||
# IBM compiler does not like the -L switch after any object modules.
 | 
			
		||||
#
 | 
			
		||||
"OS390-Unix","c89.sh:-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H  -D_ALL_SOURCE::(unknown)::THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
 | 
			
		||||
 | 
			
		||||
# Windows NT, Microsoft Visual C++ 4.0
 | 
			
		||||
 | 
			
		||||
"VC-NT","cl:::::BN_LLONG RC4_INDEX ${x86_gcc_opts}::::::::::win32",
 | 
			
		||||
@@ -430,8 +482,9 @@ my %table=(
 | 
			
		||||
"OpenBSD",      "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"OpenBSD-mips","gcc:-O2 -DL_ENDIAN::(unknown):BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
##### MacOS X (a.k.a. Rhapsody) setup
 | 
			
		||||
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
 | 
			
		||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
 | 
			
		||||
"darwin-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
 | 
			
		||||
 | 
			
		||||
##### Sony NEWS-OS 4.x
 | 
			
		||||
"newsos4-gcc","gcc:-O -DB_ENDIAN -DNEWS4::(unknown):-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
 | 
			
		||||
@@ -879,7 +932,16 @@ while (<IN>)
 | 
			
		||||
	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_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.so.\$(SHLIB_MAJOR) .so/ if ($shared_extension ne "" && $shared_extension !~ /^\.s[ol]$/);
 | 
			
		||||
	if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/)
 | 
			
		||||
		{
 | 
			
		||||
		my $sotmp = $1;
 | 
			
		||||
		s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/
 | 
			
		||||
		}
 | 
			
		||||
	elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
 | 
			
		||||
		{
 | 
			
		||||
		my $sotmp = $1;
 | 
			
		||||
		s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
 | 
			
		||||
		}
 | 
			
		||||
	print OUT $_."\n";
 | 
			
		||||
	}
 | 
			
		||||
close(IN);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										187
									
								
								FAQ
									
									
									
									
									
								
							
							
						
						
									
										187
									
								
								FAQ
									
									
									
									
									
								
							@@ -8,6 +8,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* How can I contact the OpenSSL developers?
 | 
			
		||||
* Where can I get a compiled version of OpenSSL?
 | 
			
		||||
* Why aren't tools like 'autoconf' and 'libtool' used?
 | 
			
		||||
* What is an 'engine' version?
 | 
			
		||||
 | 
			
		||||
[LEGAL] Legal questions
 | 
			
		||||
 | 
			
		||||
@@ -17,6 +18,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
[USER] Questions on using the OpenSSL applications
 | 
			
		||||
 | 
			
		||||
* Why do I get a "PRNG not seeded" error message?
 | 
			
		||||
* Why do I get an "unable to write 'random state'" error message?
 | 
			
		||||
* How do I create certificates or certificate requests?
 | 
			
		||||
* Why can't I create certificate requests?
 | 
			
		||||
* Why does <SSL program> fail with a certificate verify error?
 | 
			
		||||
@@ -26,13 +28,14 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* How can I remove the passphrase on a private key?
 | 
			
		||||
* Why can't I use OpenSSL certificates with SSL client authentication?
 | 
			
		||||
* Why does my browser give a warning about a mismatched hostname?
 | 
			
		||||
* How do I install a CA certificate into a browser?
 | 
			
		||||
 | 
			
		||||
[BUILD] Questions about building and testing OpenSSL
 | 
			
		||||
 | 
			
		||||
* Why does the linker complain about undefined symbols?
 | 
			
		||||
* Why does the OpenSSL test fail with "bc: command not found"?
 | 
			
		||||
* Why does the OpenSSL test fail with "bc: 1 no implemented"?
 | 
			
		||||
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
 | 
			
		||||
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
 | 
			
		||||
* Why does the OpenSSL compilation fail with "ar: command not found"?
 | 
			
		||||
* Why does the OpenSSL compilation fail on Win32 with VC++?
 | 
			
		||||
 | 
			
		||||
@@ -47,6 +50,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* Why do I get errors about unknown algorithms?
 | 
			
		||||
* Why can't the OpenSSH configure script detect OpenSSL?
 | 
			
		||||
* Can I use OpenSSL's SSL library with non-blocking I/O?
 | 
			
		||||
* Why doesn't my server application receive a client certificate?
 | 
			
		||||
 | 
			
		||||
===============================================================================
 | 
			
		||||
 | 
			
		||||
@@ -55,7 +59,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.6a was released on April 5th, 2001.
 | 
			
		||||
OpenSSL 0.9.6c was released on December 21st, 2001.
 | 
			
		||||
 | 
			
		||||
In addition to the current stable release, you can also access daily
 | 
			
		||||
snapshots of the OpenSSL development version at <URL:
 | 
			
		||||
@@ -119,6 +123,12 @@ A number of Linux and *BSD distributions include OpenSSL.
 | 
			
		||||
autoconf will probably be used in future OpenSSL versions. If it was
 | 
			
		||||
less Unix-centric, it might have been used much earlier.
 | 
			
		||||
 | 
			
		||||
* What is an 'engine' version?
 | 
			
		||||
 | 
			
		||||
With version 0.9.6 OpenSSL was extended to interface to external crypto
 | 
			
		||||
hardware. This was realized in a special release '0.9.6-engine'. With
 | 
			
		||||
version 0.9.7 (not yet released) the changes were merged into the main
 | 
			
		||||
development line, so that the special release is no longer necessary.
 | 
			
		||||
 | 
			
		||||
[LEGAL] =======================================================================
 | 
			
		||||
 | 
			
		||||
@@ -144,7 +154,7 @@ holders claim that you infringe on their rights if you use OpenSSL with
 | 
			
		||||
their software on operating systems that don't normally include OpenSSL.
 | 
			
		||||
 | 
			
		||||
If you develop open source software that uses OpenSSL, you may find it
 | 
			
		||||
useful to choose an other license than the GPL, or state explicitely that
 | 
			
		||||
useful to choose an other license than the GPL, or state explicitly that
 | 
			
		||||
"This program is released under the GPL with the additional exemption that
 | 
			
		||||
compiling, linking, and/or using OpenSSL is allowed."  If you are using
 | 
			
		||||
GPL software developed by others, you may want to ask the copyright holder
 | 
			
		||||
@@ -160,6 +170,7 @@ correctly.  Many open source operating systems provide a "randomness
 | 
			
		||||
device" that serves this purpose.  On other systems, applications have
 | 
			
		||||
to call the RAND_add() or RAND_seed() function with appropriate data
 | 
			
		||||
before generating keys or performing public key encryption.
 | 
			
		||||
(These functions initialize the pseudo-random number generator, PRNG.)
 | 
			
		||||
 | 
			
		||||
Some broken applications do not do this.  As of version 0.9.5, the
 | 
			
		||||
OpenSSL functions that need randomness report an error if the random
 | 
			
		||||
@@ -169,18 +180,36 @@ application you are using.  It is likely that it never worked
 | 
			
		||||
correctly.  OpenSSL 0.9.5 and later make the error visible by refusing
 | 
			
		||||
to perform potentially insecure encryption.
 | 
			
		||||
 | 
			
		||||
On systems without /dev/urandom, it is a good idea to use the Entropy
 | 
			
		||||
Gathering Demon; see the RAND_egd() manpage for details.
 | 
			
		||||
On systems without /dev/urandom and /dev/random, it is a good idea to
 | 
			
		||||
use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
 | 
			
		||||
details.  Starting with version 0.9.7, OpenSSL will automatically look
 | 
			
		||||
for an EGD socket at /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool and
 | 
			
		||||
/etc/entropy.
 | 
			
		||||
 | 
			
		||||
Most components of the openssl command line tool try to use the
 | 
			
		||||
file $HOME/.rnd (or $RANDFILE, if this environment variable is set)
 | 
			
		||||
for seeding the PRNG.  If this file does not exist or is too short,
 | 
			
		||||
the "PRNG not seeded" error message may occur.
 | 
			
		||||
Most components of the openssl command line utility automatically try
 | 
			
		||||
to seed the random number generator from a file.  The name of the
 | 
			
		||||
default seeding file is determined as follows: If environment variable
 | 
			
		||||
RANDFILE is set, then it names the seeding file.  Otherwise if
 | 
			
		||||
environment variable HOME is set, then the seeding file is $HOME/.rnd.
 | 
			
		||||
If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
 | 
			
		||||
use file .rnd in the current directory while OpenSSL 0.9.6a uses no
 | 
			
		||||
default seeding file at all.  OpenSSL 0.9.6b and later will behave
 | 
			
		||||
similarly to 0.9.6a, but will use a default of "C:\" for HOME on
 | 
			
		||||
Windows systems if the environment variable has not been set.
 | 
			
		||||
 | 
			
		||||
[Note to OpenSSL 0.9.5 users: The command "openssl rsa" in version
 | 
			
		||||
0.9.5 does not do this and will fail on systems without /dev/urandom
 | 
			
		||||
when trying to password-encrypt an RSA key!  This is a bug in the
 | 
			
		||||
library; try a later version instead.]
 | 
			
		||||
If the default seeding file does not exist or is too short, the "PRNG
 | 
			
		||||
not seeded" error message may occur.
 | 
			
		||||
 | 
			
		||||
The openssl command line utility will write back a new state to the
 | 
			
		||||
default seeding file (and create this file if necessary) unless
 | 
			
		||||
there was no sufficient seeding.
 | 
			
		||||
 | 
			
		||||
Pointing $RANDFILE to an Entropy Gathering Daemon socket does not work.
 | 
			
		||||
Use the "-rand" option of the OpenSSL command line tools instead.
 | 
			
		||||
The $RANDFILE environment variable and $HOME/.rnd are only used by the
 | 
			
		||||
OpenSSL command line tools. Applications using the OpenSSL library
 | 
			
		||||
provide their own configuration options to specify the entropy source,
 | 
			
		||||
please check out the documentation coming the with application.
 | 
			
		||||
 | 
			
		||||
For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
 | 
			
		||||
installing the SUNski package from Sun patch 105710-01 (Sparc) which
 | 
			
		||||
@@ -190,6 +219,18 @@ versions.  However, be warned that /dev/random is usually a blocking
 | 
			
		||||
device, which may have some effects on OpenSSL.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Why do I get an "unable to write 'random state'" error message?
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Sometimes the openssl command line utility does not abort with
 | 
			
		||||
a "PRNG not seeded" error message, but complains that it is
 | 
			
		||||
"unable to write 'random state'".  This message refers to the
 | 
			
		||||
default seeding file (see previous answer).  A possible reason
 | 
			
		||||
is that no default filename is known because neither RANDFILE
 | 
			
		||||
nor HOME is set.  (Versions up to 0.9.6 used file ".rnd" in the
 | 
			
		||||
current directory in this case, but this has changed with 0.9.6a.)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* How do I create certificates or certificate requests?
 | 
			
		||||
 | 
			
		||||
Check out the CA.pl(1) manual page. This provides a simple wrapper round
 | 
			
		||||
@@ -264,7 +305,7 @@ there is little point presenting a certificate which the server will
 | 
			
		||||
reject.
 | 
			
		||||
 | 
			
		||||
The solution is to add the relevant CA certificate to your servers "trusted
 | 
			
		||||
CA list". How you do this depends on the server sofware in uses. You can
 | 
			
		||||
CA list". How you do this depends on the server software in uses. You can
 | 
			
		||||
print out the servers list of acceptable CAs using the OpenSSL s_client tool:
 | 
			
		||||
 | 
			
		||||
openssl s_client -connect www.some.host:443 -prexit
 | 
			
		||||
@@ -283,6 +324,26 @@ Browsers expect the server's hostname to match the value in the commonName
 | 
			
		||||
(CN) field of the certificate. If it does not then you get a warning.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* How do I install a CA certificate into a browser?
 | 
			
		||||
 | 
			
		||||
The usual way is to send the DER encoded certificate to the browser as
 | 
			
		||||
MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
 | 
			
		||||
link. On MSIE certain extensions such as .der or .cacert may also work, or you
 | 
			
		||||
can import the certificate using the certificate import wizard.
 | 
			
		||||
 | 
			
		||||
You can convert a certificate to DER form using the command:
 | 
			
		||||
 | 
			
		||||
openssl x509 -in ca.pem -outform DER -out ca.der
 | 
			
		||||
 | 
			
		||||
Occasionally someone suggests using a command such as:
 | 
			
		||||
 | 
			
		||||
openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
 | 
			
		||||
 | 
			
		||||
DO NOT DO THIS! This command will give away your CAs private key and
 | 
			
		||||
reduces its security to zero: allowing anyone to forge certificates in
 | 
			
		||||
whatever name they choose.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[BUILD] =======================================================================
 | 
			
		||||
 | 
			
		||||
* Why does the linker complain about undefined symbols?
 | 
			
		||||
@@ -326,9 +387,9 @@ and compile/install it.  GNU bc (see http://www.gnu.org/software/software.html
 | 
			
		||||
for download instructions) can be safely used, for example.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
 | 
			
		||||
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
 | 
			
		||||
 | 
			
		||||
On some Alpha installations running True64 Unix and Compaq C, the compilation
 | 
			
		||||
On some Alpha installations running Tru64 Unix and Compaq C, the compilation
 | 
			
		||||
of crypto/sha/sha_dgst.c fails with the message 'Fatal:  Insufficient virtual
 | 
			
		||||
memory to continue compilation.'  As far as the tests have shown, this may be
 | 
			
		||||
a compiler bug.  What happens is that it eats up a lot of resident memory
 | 
			
		||||
@@ -406,10 +467,43 @@ OpenSSL.  This is described in the threads(3) manpage.
 | 
			
		||||
 | 
			
		||||
* I've compiled a program under Windows and it crashes: why?
 | 
			
		||||
 | 
			
		||||
This is usually because you've missed the comment in INSTALL.W32. You
 | 
			
		||||
must link with the multithreaded DLL version of the VC++ runtime library
 | 
			
		||||
otherwise the conflict will cause a program to crash: typically on the
 | 
			
		||||
first BIO related read or write operation.
 | 
			
		||||
This is usually because you've missed the comment in INSTALL.W32.
 | 
			
		||||
Your application must link against the same version of the Win32
 | 
			
		||||
C-Runtime against which your openssl libraries were linked.  The
 | 
			
		||||
default version for OpenSSL is /MD - "Multithreaded DLL".
 | 
			
		||||
 | 
			
		||||
If you are using Microsoft Visual C++'s IDE (Visual Studio), in
 | 
			
		||||
many cases, your new project most likely defaulted to "Debug
 | 
			
		||||
Singlethreaded" - /ML.  This is NOT interchangeable with /MD and your
 | 
			
		||||
program will crash, typically on the first BIO related read or write
 | 
			
		||||
operation.
 | 
			
		||||
 | 
			
		||||
For each of the six possible link stage configurations within Win32,
 | 
			
		||||
your application must link  against the same by which OpenSSL was
 | 
			
		||||
built.  If you are using MS Visual C++ (Studio) this can be changed
 | 
			
		||||
by:
 | 
			
		||||
 | 
			
		||||
1.  Select Settings... from the Project Menu.
 | 
			
		||||
2.  Select the C/C++ Tab.
 | 
			
		||||
3.  Select "Code Generation from the "Category" drop down list box
 | 
			
		||||
4.  Select the Appropriate library (see table below) from the "Use
 | 
			
		||||
    run-time library" drop down list box.  Perform this step for both
 | 
			
		||||
    your debug and release versions of your application (look at the
 | 
			
		||||
    top left of the settings panel to change between the two)
 | 
			
		||||
 | 
			
		||||
    Single Threaded           /ML        -  MS VC++ often defaults to
 | 
			
		||||
                                            this for the release
 | 
			
		||||
                                            version of a new project.
 | 
			
		||||
    Debug Single Threaded     /MLd       -  MS VC++ often defaults to
 | 
			
		||||
                                            this for the debug version
 | 
			
		||||
                                            of a new project.
 | 
			
		||||
    Multithreaded             /MT
 | 
			
		||||
    Debug Multithreaded       /MTd
 | 
			
		||||
    Multithreaded DLL         /MD        -  OpenSSL defaults to this.
 | 
			
		||||
    Debug Multithreaded DLL   /MDd
 | 
			
		||||
 | 
			
		||||
Note that debug and release libraries are NOT interchangeable.  If you
 | 
			
		||||
built OpenSSL with /MD your application must use /MD and cannot use /MDd.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* How do I read or write a DER encoded buffer using the ASN1 functions?
 | 
			
		||||
@@ -490,44 +584,16 @@ OpenSSL_add_all_algorithms(). See the manual page for more information.
 | 
			
		||||
 | 
			
		||||
* Why can't the OpenSSH configure script detect OpenSSL?
 | 
			
		||||
 | 
			
		||||
There is a problem with OpenSSH 1.2.2p1, in that the configure script
 | 
			
		||||
can't find the installed OpenSSL libraries.  The problem is actually
 | 
			
		||||
a small glitch that is easily solved with the following patch to be
 | 
			
		||||
applied to the OpenSSH distribution:
 | 
			
		||||
 | 
			
		||||
----- snip:start -----
 | 
			
		||||
--- openssh-1.2.2p1/configure.in.orig	Thu Mar 23 18:56:58 2000
 | 
			
		||||
+++ openssh-1.2.2p1/configure.in	Thu Mar 23 18:55:05 2000
 | 
			
		||||
@@ -152,10 +152,10 @@
 | 
			
		||||
 AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
 | 
			
		||||
 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
 | 
			
		||||
 	if test ! -z "$ssldir" ; then
 | 
			
		||||
-		LIBS="$saved_LIBS -L$ssldir"
 | 
			
		||||
+		LIBS="$saved_LIBS -L$ssldir/lib"
 | 
			
		||||
 		CFLAGS="$CFLAGS -I$ssldir/include"
 | 
			
		||||
 		if test "x$need_dash_r" = "x1" ; then
 | 
			
		||||
-			LIBS="$LIBS -R$ssldir"
 | 
			
		||||
+			LIBS="$LIBS -R$ssldir/lib"
 | 
			
		||||
 		fi
 | 
			
		||||
 	fi
 | 
			
		||||
 	LIBS="$LIBS -lcrypto"
 | 
			
		||||
--- openssh-1.2.2p1/configure.orig	Thu Mar 23 18:55:02 2000
 | 
			
		||||
+++ openssh-1.2.2p1/configure	Thu Mar 23 18:57:08 2000
 | 
			
		||||
@@ -1890,10 +1890,10 @@
 | 
			
		||||
 echo "configure:1891: checking for OpenSSL/SSLeay directory" >&5
 | 
			
		||||
 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
 | 
			
		||||
 	if test ! -z "$ssldir" ; then
 | 
			
		||||
-		LIBS="$saved_LIBS -L$ssldir"
 | 
			
		||||
+		LIBS="$saved_LIBS -L$ssldir/lib"
 | 
			
		||||
 		CFLAGS="$CFLAGS -I$ssldir/include"
 | 
			
		||||
 		if test "x$need_dash_r" = "x1" ; then
 | 
			
		||||
-			LIBS="$LIBS -R$ssldir"
 | 
			
		||||
+			LIBS="$LIBS -R$ssldir/lib"
 | 
			
		||||
 		fi
 | 
			
		||||
 	fi
 | 
			
		||||
 	LIBS="$LIBS -lcrypto"
 | 
			
		||||
----- snip:end -----
 | 
			
		||||
Several reasons for problems with the automatic detection exist.
 | 
			
		||||
OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
 | 
			
		||||
Sometimes the distribution has installed an older version in the system
 | 
			
		||||
locations that is detected instead of a new one installed. The OpenSSL
 | 
			
		||||
library might have been compiled for another CPU or another mode (32/64 bits).
 | 
			
		||||
Permissions might be wrong.
 | 
			
		||||
 | 
			
		||||
The general answer is to check the config.log file generated when running
 | 
			
		||||
the OpenSSH configure script. It should contain the detailed information
 | 
			
		||||
on why the OpenSSL library was not detected or considered incompatible.
 | 
			
		||||
 | 
			
		||||
* Can I use OpenSSL's SSL library with non-blocking I/O?
 | 
			
		||||
 | 
			
		||||
@@ -543,5 +609,12 @@ requiring a bi-directional message exchange; both SSL_read() and
 | 
			
		||||
SSL_write() will try to continue any pending handshake.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Why doesn't my server application receive a client certificate?
 | 
			
		||||
 | 
			
		||||
Due to the TLS protocol definition, a client will only send a certificate,
 | 
			
		||||
if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
 | 
			
		||||
SSL_CTX_set_verify() function to enable the use of client certificates.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
===============================================================================
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								INSTALL
									
									
									
									
									
								
							@@ -7,8 +7,11 @@
 | 
			
		||||
 | 
			
		||||
 To install OpenSSL, you will need:
 | 
			
		||||
 | 
			
		||||
  * make
 | 
			
		||||
  * Perl 5
 | 
			
		||||
  * an ANSI C compiler
 | 
			
		||||
  * a development environment in form of development libraries and C
 | 
			
		||||
    header files
 | 
			
		||||
  * a supported Unix operating system
 | 
			
		||||
 | 
			
		||||
 Quick Start
 | 
			
		||||
@@ -43,9 +46,6 @@
 | 
			
		||||
  --openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
 | 
			
		||||
                the library files and binaries are also installed there.
 | 
			
		||||
 | 
			
		||||
  rsaref        Build with RSADSI's RSAREF toolkit (this assumes that
 | 
			
		||||
                librsaref.a is in the library search path).
 | 
			
		||||
 | 
			
		||||
  no-threads    Don't try to build with support for multi-threaded
 | 
			
		||||
                applications.
 | 
			
		||||
 | 
			
		||||
@@ -128,7 +128,7 @@
 | 
			
		||||
     directory, and the binary will be in the "apps" directory.
 | 
			
		||||
 | 
			
		||||
     If "make" fails, look at the output.  There may be reasons for
 | 
			
		||||
     the failure that isn't a problem in OpenSSL itself (like missing
 | 
			
		||||
     the failure that aren't problems in OpenSSL itself (like missing
 | 
			
		||||
     standard headers).  If it is a problem with OpenSSL itself, please
 | 
			
		||||
     report the problem to <openssl-bugs@openssl.org> (note that your
 | 
			
		||||
     message will be forwarded to a public mailing list).  Include the
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
OpenSSL - Port To The Macintosh
 | 
			
		||||
===============================
 | 
			
		||||
OpenSSL - Port To The Macintosh OS 9 or Earlier
 | 
			
		||||
===============================================
 | 
			
		||||
 | 
			
		||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for MacOS (pre
 | 
			
		||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for Mac OS (pre
 | 
			
		||||
X) is now provided. "Initial" means that unlike other platforms where you
 | 
			
		||||
get an SDK and a "swiss army" openssl application, on Macintosh you only
 | 
			
		||||
get one sample application which fetches a page over HTTPS(*) and dumps it
 | 
			
		||||
@@ -42,7 +42,7 @@ Installation procedure:
 | 
			
		||||
	BSD sockets and some other POSIX APIs. The GUSI distribution is
 | 
			
		||||
	expected to be found in the same directory as openssl source tree,
 | 
			
		||||
	i.e. in the parent directory to the one where this very file,
 | 
			
		||||
	namely INSTALL.MacOS. For more informations about GUSI, see
 | 
			
		||||
	namely INSTALL.MacOS. For more information about GUSI, see
 | 
			
		||||
	http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
 | 
			
		||||
 | 
			
		||||
Finally some essential comments from our generous contributor:-)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								INSTALL.VMS
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								INSTALL.VMS
									
									
									
									
									
								
							@@ -8,6 +8,7 @@ Intro:
 | 
			
		||||
 | 
			
		||||
This file is divided in the following parts:
 | 
			
		||||
 | 
			
		||||
  Requirements			- Mandatory reading.
 | 
			
		||||
  Checking the distribution	- Mandatory reading.
 | 
			
		||||
  Compilation			- Mandatory reading.
 | 
			
		||||
  Logical names			- Mandatory reading.
 | 
			
		||||
@@ -19,6 +20,15 @@ This file is divided in the following parts:
 | 
			
		||||
  TODO				- Things that are to come.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Requirements:
 | 
			
		||||
=============
 | 
			
		||||
 | 
			
		||||
To build and install OpenSSL, you will need:
 | 
			
		||||
 | 
			
		||||
 * DEC C or some other ANSI C compiler.  VAX C is *not* supported.
 | 
			
		||||
   [Note: OpenSSL has only been tested with DEC C.  Compiling with 
 | 
			
		||||
    a different ANSI C compiler may require some work]
 | 
			
		||||
 | 
			
		||||
Checking the distribution:
 | 
			
		||||
==========================
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										191
									
								
								Makefile.org
									
									
									
									
									
								
							
							
						
						
									
										191
									
								
								Makefile.org
									
									
									
									
									
								
							@@ -256,28 +256,169 @@ do_linux-shared: do_gnu-shared
 | 
			
		||||
do_gnu-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; ${CC}  -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-Wl,-S,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-Wl,--whole-archive lib$$i.a \
 | 
			
		||||
		-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
	libs="$$libs -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
 | 
			
		||||
	collect2=`gcc -print-prog-name=collect2 2>&1` && \
 | 
			
		||||
	[ -n "$$collect2" ] && \
 | 
			
		||||
	my_ld=`$$collect2 --help 2>&1 | grep Usage: | sed 's/^Usage: *\([^ ][^ ]*\).*/\1/'` && \
 | 
			
		||||
	[ -n "$$my_ld" ] && \
 | 
			
		||||
	$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
do_alpha-osf1-shared:
 | 
			
		||||
	if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( set -x; ${CC}  -shared -o lib$$i.so \
 | 
			
		||||
			-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
 | 
			
		||||
			-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
		libs="$$libs -l$$i"; \
 | 
			
		||||
		done; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
 | 
			
		||||
# option passed to the linker.
 | 
			
		||||
do_tru64-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; ${CC}  -shared -no_archive -o lib$$i.so \
 | 
			
		||||
		-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
 | 
			
		||||
		-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
	libs="$$libs -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
	if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( set -x; ${CC}  -shared -msym -o lib$$i.so \
 | 
			
		||||
			-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
 | 
			
		||||
			-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
		libs="$$libs -l$$i"; \
 | 
			
		||||
		done; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
# The difference between tru64-shared and tru64-shared-rpath is the
 | 
			
		||||
# -rpath ${INSTALLTOP}/lib passed to the linker.
 | 
			
		||||
do_tru64-shared-rpath:
 | 
			
		||||
	if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( set -x; ${CC}  -shared -msym -o lib$$i.so \
 | 
			
		||||
			-rpath  ${INSTALLTOP}/lib \
 | 
			
		||||
			-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
 | 
			
		||||
			-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
		libs="$$libs -l$$i"; \
 | 
			
		||||
		done; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
do_solaris-shared:
 | 
			
		||||
	if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
 | 
			
		||||
		  set -x; ${CC}  -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
			-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
			-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
		libs="$$libs -l$$i"; \
 | 
			
		||||
		done; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
# UnixWare 7 and OpenUNIX 8 native compilers used
 | 
			
		||||
do_svr5-shared:
 | 
			
		||||
	if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
 | 
			
		||||
		  find . -name "*.o" -print > allobjs ; \
 | 
			
		||||
		  OBJS= ; export OBJS ; \
 | 
			
		||||
		  for obj in `ar t lib$$i.a` ; do \
 | 
			
		||||
		    OBJS="$${OBJS} `grep $$obj allobjs`" ; \
 | 
			
		||||
		  done ; \
 | 
			
		||||
		  set -x; ${CC}  -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
			-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
			$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
 | 
			
		||||
		libs="$$libs -l$$i"; \
 | 
			
		||||
		done; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
do_irix-shared:
 | 
			
		||||
	if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
			-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
			-all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
 | 
			
		||||
		libs="$$libs -l$$i"; \
 | 
			
		||||
		done; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
do_hpux-shared:
 | 
			
		||||
	libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; /usr/ccs/bin/ld +vnocompatwarnings \
 | 
			
		||||
		-b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-Fl lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
	libs="$$libs -L. -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
do_hpux64-shared:
 | 
			
		||||
	libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; /usr/ccs/bin/ld -b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		+forceload lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
	libs="$$libs -L. -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
# The following method is said to work on all platforms.  Tests will
 | 
			
		||||
# determine if that's how it's gong to be used.
 | 
			
		||||
# This assumes that for all but GNU systems, GNU utilities are *not* used.
 | 
			
		||||
# ALLSYMSFLAGS would be:
 | 
			
		||||
#  GNU systems: --whole-archive
 | 
			
		||||
#  Tru64 Unix:  -all
 | 
			
		||||
#  Solaris:     -z allextract
 | 
			
		||||
#  Irix:        -all
 | 
			
		||||
#  HP/UX-32bit: -Fl
 | 
			
		||||
#  HP/UX-64bit: +forceload
 | 
			
		||||
#  AIX:		-bnogc
 | 
			
		||||
# SHAREDFLAGS would be:
 | 
			
		||||
#  GNU systems: -shared -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
 | 
			
		||||
#  Tru64 Unix:  -shared \
 | 
			
		||||
#		-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}"
 | 
			
		||||
#  Solaris:     -G -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
 | 
			
		||||
#  Irix:        -shared -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
 | 
			
		||||
#  HP/UX-32bit: +vnocompatwarnings -b -z +s \
 | 
			
		||||
#		+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
 | 
			
		||||
#  HP/UX-64bit: -b -z +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
 | 
			
		||||
#  AIX:		-G -bE:lib$$i.exp -bM:SRE
 | 
			
		||||
# SHAREDCMD would be:
 | 
			
		||||
#  GNU systems: $(CC)
 | 
			
		||||
#  Tru64 Unix:  $(CC)
 | 
			
		||||
#  Solaris:     $(CC)
 | 
			
		||||
#  Irix:        $(CC)
 | 
			
		||||
#  HP/UX-32bit: /usr/ccs/bin/ld
 | 
			
		||||
#  HP/UX-64bit: /usr/ccs/bin/ld
 | 
			
		||||
#  AIX:		$(CC)
 | 
			
		||||
ALLSYMSFLAG=-bnogc
 | 
			
		||||
SHAREDFLAGS=-G -bE:lib$$i.exp -bM:SRE
 | 
			
		||||
SHAREDCMD=$(CC)
 | 
			
		||||
do_aix-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
 | 
			
		||||
	  set -x; ${CC}  -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
	( set -x; \
 | 
			
		||||
	  ld -r -o $$i.o $(ALLSYMSFLAG) lib$$i.a && \
 | 
			
		||||
	  ( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
 | 
			
		||||
	    $(SHAREDCMD) $(SHAREDFLAG) -o lib$$i.so lib$$i.o \
 | 
			
		||||
		$$libs ${EX_LIBS} ) ) \
 | 
			
		||||
	|| exit 1; \
 | 
			
		||||
	libs="$$libs -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
@@ -350,7 +491,7 @@ test:   tests
 | 
			
		||||
 | 
			
		||||
tests: rehash
 | 
			
		||||
	@(cd test && echo "testing..." && \
 | 
			
		||||
	$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' EXE_EXT='${EXE_EXT}' tests );
 | 
			
		||||
	$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' EXE_EXT='${EXE_EXT}' tests );
 | 
			
		||||
	@apps/openssl version -a
 | 
			
		||||
 | 
			
		||||
report:
 | 
			
		||||
@@ -384,25 +525,25 @@ tags:
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
errors:
 | 
			
		||||
	perl util/mkerr.pl -recurse -write
 | 
			
		||||
	$(PERL) util/mkerr.pl -recurse -write
 | 
			
		||||
 | 
			
		||||
stacks:
 | 
			
		||||
	perl util/mkstack.pl -write
 | 
			
		||||
	$(PERL) util/mkstack.pl -write
 | 
			
		||||
 | 
			
		||||
util/libeay.num::
 | 
			
		||||
	perl util/mkdef.pl crypto update
 | 
			
		||||
	$(PERL) util/mkdef.pl crypto update
 | 
			
		||||
 | 
			
		||||
util/ssleay.num::
 | 
			
		||||
	perl util/mkdef.pl ssl update
 | 
			
		||||
	$(PERL) util/mkdef.pl ssl update
 | 
			
		||||
 | 
			
		||||
crypto/objects/obj_dat.h: crypto/objects/obj_mac.h crypto/objects/obj_dat.pl
 | 
			
		||||
	perl crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
 | 
			
		||||
	$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
 | 
			
		||||
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt 
 | 
			
		||||
	perl crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
 | 
			
		||||
	$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
 | 
			
		||||
 | 
			
		||||
TABLE: Configure
 | 
			
		||||
	(echo 'Output of `Configure TABLE'"':"; \
 | 
			
		||||
	perl Configure TABLE) > TABLE
 | 
			
		||||
	$(PERL) Configure TABLE) > TABLE
 | 
			
		||||
 | 
			
		||||
update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
 | 
			
		||||
 | 
			
		||||
@@ -459,8 +600,8 @@ install: all install_docs
 | 
			
		||||
		do \
 | 
			
		||||
			if [ -f "$$i" ]; then \
 | 
			
		||||
			(       echo installing $$i; \
 | 
			
		||||
				cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
 | 
			
		||||
				chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
 | 
			
		||||
				cp -f $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
 | 
			
		||||
				chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
 | 
			
		||||
			fi \
 | 
			
		||||
		done; \
 | 
			
		||||
		(	here="`pwd`"; \
 | 
			
		||||
@@ -474,19 +615,19 @@ install_docs:
 | 
			
		||||
		$(INSTALL_PREFIX)$(MANDIR)/man3 \
 | 
			
		||||
		$(INSTALL_PREFIX)$(MANDIR)/man5 \
 | 
			
		||||
		$(INSTALL_PREFIX)$(MANDIR)/man7
 | 
			
		||||
	@echo installing man 1 and man 5
 | 
			
		||||
	@for i in doc/apps/*.pod; do \
 | 
			
		||||
		fn=`basename $$i .pod`; \
 | 
			
		||||
		sec=`[ "$$fn" = "config" ] && echo 5 || echo 1`; \
 | 
			
		||||
		if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
 | 
			
		||||
		echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
 | 
			
		||||
		(cd `dirname $$i`; \
 | 
			
		||||
		$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
 | 
			
		||||
			 --release=$(VERSION) `basename $$i`) \
 | 
			
		||||
			>  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo installing man 3 and man 7
 | 
			
		||||
	@for i in doc/crypto/*.pod doc/ssl/*.pod; do \
 | 
			
		||||
		fn=`basename $$i .pod`; \
 | 
			
		||||
		sec=`[ "$$fn" = "des_modes" ] && echo 7 || echo 3`; \
 | 
			
		||||
		if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
 | 
			
		||||
		echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
 | 
			
		||||
		(cd `dirname $$i`; \
 | 
			
		||||
		$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
 | 
			
		||||
			--release=$(VERSION) `basename $$i`) \
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								NEWS
									
									
									
									
									
								
							@@ -5,6 +5,36 @@
 | 
			
		||||
  This file gives a brief overview of the major changes between each OpenSSL
 | 
			
		||||
  release. For more details please read the CHANGES file.
 | 
			
		||||
 | 
			
		||||
  Changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
 | 
			
		||||
 | 
			
		||||
      o Various SSL/TLS library bugfixes.
 | 
			
		||||
      o BIGNUM library fixes.
 | 
			
		||||
      o RSA OAEP and random number generation fixes.
 | 
			
		||||
      o Object identifiers corrected and added.
 | 
			
		||||
      o Add assembler BN routines for IA64.
 | 
			
		||||
      o Add support for OS/390 Unix, UnixWare with gcc, OpenUNIX 8,
 | 
			
		||||
        MIPS Linux; shared library support for Irix, HP-UX.
 | 
			
		||||
      o Add crypto accelerator support for AEP, Baltimore SureWare,
 | 
			
		||||
        Broadcom and Cryptographic Appliance's keyserver
 | 
			
		||||
        [in 0.9.6c-engine release].
 | 
			
		||||
 | 
			
		||||
  Changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
 | 
			
		||||
 | 
			
		||||
      o Security fix: PRNG improvements.
 | 
			
		||||
      o Security fix: RSA OAEP check.
 | 
			
		||||
      o Security fix: Reinsert and fix countermeasure to Bleichbacher's
 | 
			
		||||
        attack.
 | 
			
		||||
      o MIPS bug fix in BIGNUM.
 | 
			
		||||
      o Bug fix in "openssl enc".
 | 
			
		||||
      o Bug fix in X.509 printing routine.
 | 
			
		||||
      o Bug fix in DSA verification routine and DSA S/MIME verification.
 | 
			
		||||
      o Bug fix to make PRNG thread-safe.
 | 
			
		||||
      o Bug fix in RAND_file_name().
 | 
			
		||||
      o Bug fix in compatibility mode trust settings.
 | 
			
		||||
      o Bug fix in blowfish EVP.
 | 
			
		||||
      o Increase default size for BIO buffering filter.
 | 
			
		||||
      o Compatibility fixes in some scripts.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a:
 | 
			
		||||
 | 
			
		||||
      o Security fix: change behavior of OpenSSL to avoid using
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 0.9.6a [engine] 5 Apr 2001
 | 
			
		||||
 OpenSSL 0.9.6c [engine] 21 dec 2001
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2000 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1998-2001 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 | 
			
		||||
@@ -62,7 +62,7 @@
 | 
			
		||||
 | 
			
		||||
     X.509v3 certificates
 | 
			
		||||
        X509 encoding/decoding into/from binary ASN1 and a PEM
 | 
			
		||||
             based ascii-binary encoding which supports encryption with a
 | 
			
		||||
             based ASCII-binary encoding which supports encryption with a
 | 
			
		||||
             private key.  Program to generate RSA and DSA certificate
 | 
			
		||||
             requests and to generate RSA and DSA certificates.
 | 
			
		||||
 | 
			
		||||
@@ -97,7 +97,7 @@
 | 
			
		||||
 locations around the world. _YOU_ are responsible for ensuring that your use
 | 
			
		||||
 of any algorithms is legal by checking if there are any patents in your
 | 
			
		||||
 country.  The file contains some of the patents that we know about or are
 | 
			
		||||
 rumoured to exist. This is not a definitive list.
 | 
			
		||||
 rumored to exist. This is not a definitive list.
 | 
			
		||||
 | 
			
		||||
 RSA Security holds software patents on the RC5 algorithm.  If you
 | 
			
		||||
 intend to use this cipher, you must contact RSA Security for
 | 
			
		||||
@@ -107,8 +107,8 @@
 | 
			
		||||
 only be used with RSA Security's permission. 
 | 
			
		||||
 | 
			
		||||
 The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
 | 
			
		||||
 Japan, Netherlands, Spain, Sweden, Switzerland, UK and the USA.  They should
 | 
			
		||||
 be contacted if that algorithm is to be used, their web page is
 | 
			
		||||
 Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA.  They
 | 
			
		||||
 should be contacted if that algorithm is to be used; their web page is
 | 
			
		||||
 http://www.ascom.ch/.
 | 
			
		||||
 | 
			
		||||
 INSTALLATION
 | 
			
		||||
@@ -119,8 +119,8 @@
 | 
			
		||||
 INSTALL.VMS.
 | 
			
		||||
 | 
			
		||||
 Read the documentation in the doc/ directory.  It is quite rough, but it
 | 
			
		||||
 lists the functions, you will probably have to look at the code to work out
 | 
			
		||||
 how to used them. Look at the example programs.
 | 
			
		||||
 lists the functions; you will probably have to look at the code to work out
 | 
			
		||||
 how to use them. Look at the example programs.
 | 
			
		||||
 | 
			
		||||
 SUPPORT 
 | 
			
		||||
 -------
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
  With OpenSSL 0.9.6, a new component has been added to support external 
 | 
			
		||||
  crypto devices, for example accelerator cards.  The component is called
 | 
			
		||||
  ENGINE, and has still a pretty experimental status and almost no
 | 
			
		||||
  documentation.  It's designed to be faily easily extensible by the
 | 
			
		||||
  documentation.  It's designed to be fairly easily extensible by the
 | 
			
		||||
  calling programs.
 | 
			
		||||
 | 
			
		||||
  There's currently built-in support for the following crypto devices:
 | 
			
		||||
@@ -48,7 +48,7 @@
 | 
			
		||||
  No external crypto device is chosen unless you say so.  You have actively
 | 
			
		||||
  tell the openssl utility commands to use it through a new command line
 | 
			
		||||
  switch called "-engine".  And if you want to use the ENGINE library to
 | 
			
		||||
  do something similar, you must also explicitely choose an external crypto
 | 
			
		||||
  do something similar, you must also explicitly choose an external crypto
 | 
			
		||||
  device, or the built-in crypto routines will be used, just as in the
 | 
			
		||||
  default OpenSSL distribution.
 | 
			
		||||
 | 
			
		||||
@@ -56,7 +56,7 @@
 | 
			
		||||
  PROBLEMS
 | 
			
		||||
  ========
 | 
			
		||||
 | 
			
		||||
  It seems like the ENGINE part doesn't work too well with Cryptoswift on
 | 
			
		||||
  It seems like the ENGINE part doesn't work too well with CryptoSwift on
 | 
			
		||||
  Win32.  A quick test done right before the release showed that trying
 | 
			
		||||
  "openssl speed -engine cswift" generated errors.  If the DSO gets enabled,
 | 
			
		||||
  an attempt is made to write at memory address 0x00000002.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								STATUS
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								STATUS
									
									
									
									
									
								
							@@ -1,9 +1,11 @@
 | 
			
		||||
 | 
			
		||||
  OpenSSL STATUS                           Last modified at
 | 
			
		||||
  ______________                           $Date: 2001/04/05 17:48:02 $
 | 
			
		||||
  ______________                           $Date: 2001/11/15 08:15:00 $
 | 
			
		||||
 | 
			
		||||
  DEVELOPMENT STATE
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL 0.9.7:  Under development...
 | 
			
		||||
    o  OpenSSL 0.9.6b: Released on July       9th, 2001
 | 
			
		||||
    o  OpenSSL 0.9.6a: Released on April      5th, 2001
 | 
			
		||||
    o  OpenSSL 0.9.6:  Released on September 24th, 2000
 | 
			
		||||
    o  OpenSSL 0.9.5a: Released on April      1st, 2000
 | 
			
		||||
@@ -18,6 +20,8 @@
 | 
			
		||||
 | 
			
		||||
  AVAILABLE PATCHES
 | 
			
		||||
 | 
			
		||||
    o 
 | 
			
		||||
 | 
			
		||||
  IN PROGRESS
 | 
			
		||||
 | 
			
		||||
    o Steve is currently working on (in no particular order):
 | 
			
		||||
@@ -31,12 +35,13 @@
 | 
			
		||||
    o Geoff and Richard are currently working on:
 | 
			
		||||
	ENGINE (the new code that gives hardware support among others).
 | 
			
		||||
    o Richard is currently working on:
 | 
			
		||||
	UI (User Interface)
 | 
			
		||||
	UTIL (a new set of library functions to support some higher level
 | 
			
		||||
	      functionality that is currently missing).
 | 
			
		||||
	Shared library support for VMS.
 | 
			
		||||
	OCSP
 | 
			
		||||
	Kerberos 5 authentication
 | 
			
		||||
	Constification
 | 
			
		||||
	OCSP
 | 
			
		||||
 | 
			
		||||
  NEEDS PATCH
 | 
			
		||||
 | 
			
		||||
@@ -49,13 +54,9 @@
 | 
			
		||||
    o  Whenever strncpy is used, make sure the resulting string is NULL-terminated
 | 
			
		||||
       or an error is reported
 | 
			
		||||
 | 
			
		||||
  OPEN ISSUES
 | 
			
		||||
    o  "OpenSSL STATUS" is never up-to-date.
 | 
			
		||||
 | 
			
		||||
    o  crypto/ex_data.c is not really thread-safe and so must be used
 | 
			
		||||
       with care (e.g., extra locking where necessary, or don't call
 | 
			
		||||
       CRYPTO_get_ex_new_index once multiple threads exist).
 | 
			
		||||
       The current API is not suitable for everything that it pretends
 | 
			
		||||
       to offer.
 | 
			
		||||
  OPEN ISSUES
 | 
			
		||||
 | 
			
		||||
    o  The Makefile hierarchy and build mechanism is still not a round thing:
 | 
			
		||||
 | 
			
		||||
@@ -99,4 +100,14 @@
 | 
			
		||||
 | 
			
		||||
  WISHES
 | 
			
		||||
 | 
			
		||||
    o 
 | 
			
		||||
    o  SRP in TLS.
 | 
			
		||||
       [wished by:
 | 
			
		||||
        Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
 | 
			
		||||
        Tom Holroyd <tomh@po.crl.go.jp>]
 | 
			
		||||
 | 
			
		||||
       See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
 | 
			
		||||
       as well as http://www-cs-students.stanford.edu/~tjw/srp/.
 | 
			
		||||
 | 
			
		||||
       Tom Holroyd tells us there is a SRP patch for OpenSSH at
 | 
			
		||||
       http://members.tripod.com/professor_tom/archives/, that could
 | 
			
		||||
       be useful.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										509
									
								
								TABLE
									
									
									
									
									
								
							
							
						
						
									
										509
									
								
								TABLE
									
									
									
									
									
								
							@@ -1,4 +1,3 @@
 | 
			
		||||
Output of `Configure TABLE':
 | 
			
		||||
 | 
			
		||||
*** BC-16
 | 
			
		||||
$cc           = bcc
 | 
			
		||||
@@ -136,7 +135,7 @@ $ranlib       =
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$thread_cflag = -pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
 | 
			
		||||
$bn_obj       = asm/bn86-elf.o asm/co86-elf.o
 | 
			
		||||
@@ -264,6 +263,28 @@ $shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OS390-Unix
 | 
			
		||||
$cc           = c89.sh
 | 
			
		||||
$cflags       = -O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H  -D_ALL_SOURCE
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OpenBSD
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIOS -O3 -fomit-frame-pointer
 | 
			
		||||
@@ -352,6 +373,138 @@ $shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OpenUNIX-8
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O -DFILIO_H -Kalloca
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -Kthread
 | 
			
		||||
$lflags       = -lsocket -lnsl
 | 
			
		||||
$bn_ops       = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OpenUNIX-8-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O -DFILIO_H -fomit-frame-pointer
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread
 | 
			
		||||
$lflags       = -lsocket -lnsl
 | 
			
		||||
$bn_ops       = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OpenUNIX-8-gcc-shared
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3 -DFILIO_H -fomit-frame-pointer
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread
 | 
			
		||||
$lflags       = -lsocket -lnsl
 | 
			
		||||
$bn_ops       = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
 | 
			
		||||
$bn_obj       = asm/bn86-elf.o asm/co86-elf.o
 | 
			
		||||
$des_obj      = asm/dx86-elf.o asm/yx86-elf.o
 | 
			
		||||
$bf_obj       = asm/bx86-elf.o
 | 
			
		||||
$md5_obj      = asm/mx86-elf.o
 | 
			
		||||
$sha1_obj     = asm/sx86-elf.o
 | 
			
		||||
$cast_obj     = asm/cx86-elf.o
 | 
			
		||||
$rc4_obj      = asm/rx86-elf.o
 | 
			
		||||
$rmd160_obj   = asm/rm86-elf.o
 | 
			
		||||
$rc5_obj      = asm/r586-elf.o
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= svr5-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OpenUNIX-8-pentium
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O -DFILIO_H -Kalloca -Kpentium
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -Kthread
 | 
			
		||||
$lflags       = -lsocket -lnsl
 | 
			
		||||
$bn_ops       = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OpenUNIX-8-pentium_pro
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O -DFILIO_H -Kalloca -Kpentium_pro
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -Kthread
 | 
			
		||||
$lflags       = -lsocket -lnsl
 | 
			
		||||
$bn_ops       = BN_LLONG MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** OpenUNIX-8-shared
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O -DFILIO_H -Kalloca
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -Kthread
 | 
			
		||||
$lflags       = -lsocket -lnsl
 | 
			
		||||
$bn_ops       = MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= svr5-shared
 | 
			
		||||
$shared_cflag = -Kpic
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** ReliantUNIX
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -KPIC -g -DSNI -DTERMIOS -DB_ENDIAN
 | 
			
		||||
@@ -640,9 +793,9 @@ $ranlib       =
 | 
			
		||||
 | 
			
		||||
*** alpha-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -std1 -tune host -O4 -readonly_strings
 | 
			
		||||
$cflags       = -std1 -tune host -fast -readonly_strings
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$thread_cflag = -pthread
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
@@ -660,6 +813,28 @@ $shared_cflag =
 | 
			
		||||
$shared_extension = .so
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** alpha-cc-rpath
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -std1 -tune host -fast -readonly_strings
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= tru64-shared-rpath
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = .so
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** alpha-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3
 | 
			
		||||
@@ -677,7 +852,7 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= tru64-shared
 | 
			
		||||
$shared_target= alpha-osf1-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = .so
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -686,6 +861,28 @@ $ranlib       =
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -std1 -tune host -fast -readonly_strings
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= tru64-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = .so
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** alphaold-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -std1 -tune host -O4 -readonly_strings
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK
 | 
			
		||||
@@ -699,7 +896,7 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= tru64-shared
 | 
			
		||||
$shared_target= alpha-osf1-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = .so
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -814,6 +1011,28 @@ $shared_cflag =
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** darwin-ppc-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O3 -DB_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** debug
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror
 | 
			
		||||
@@ -904,7 +1123,7 @@ $ranlib       =
 | 
			
		||||
 | 
			
		||||
*** debug-bodo
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall
 | 
			
		||||
$cflags       = -DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$lflags       = 
 | 
			
		||||
@@ -926,7 +1145,7 @@ $ranlib       =
 | 
			
		||||
 | 
			
		||||
*** debug-levitte-linux-elf
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe
 | 
			
		||||
$cflags       = -DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$lflags       = -ldl
 | 
			
		||||
@@ -1051,7 +1270,7 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -1095,7 +1314,7 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -1124,7 +1343,7 @@ $ranlib       =
 | 
			
		||||
 | 
			
		||||
*** debug-ulf
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe
 | 
			
		||||
$cflags       = -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -Wall -Werror -Wshadow -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$lflags       = 
 | 
			
		||||
@@ -1271,9 +1490,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-brokengcc
 | 
			
		||||
@@ -1293,9 +1512,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-cc
 | 
			
		||||
@@ -1315,9 +1534,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-gcc
 | 
			
		||||
@@ -1337,6 +1556,28 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-m68k-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DB_ENDIAN -DBN_DIV2W -O3
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG DES_PTR DES_UNROLL
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
@@ -1359,9 +1600,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-parisc-cc-o4
 | 
			
		||||
@@ -1381,9 +1622,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-parisc-gcc
 | 
			
		||||
@@ -1403,9 +1644,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-parisc1_1-cc
 | 
			
		||||
@@ -1425,9 +1666,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux-parisc2-cc
 | 
			
		||||
@@ -1447,9 +1688,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux10-brokencc
 | 
			
		||||
@@ -1469,9 +1710,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux10-brokengcc
 | 
			
		||||
@@ -1491,9 +1732,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux10-cc
 | 
			
		||||
@@ -1513,9 +1754,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux10-gcc
 | 
			
		||||
@@ -1535,9 +1776,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux64-parisc-cc
 | 
			
		||||
@@ -1557,9 +1798,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux64-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** hpux64-parisc2-cc
 | 
			
		||||
@@ -1579,9 +1820,9 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_target= hpux64-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** irix-cc
 | 
			
		||||
@@ -1600,10 +1841,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= irix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** irix-gcc
 | 
			
		||||
@@ -1622,10 +1863,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= irix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** irix-mips3-cc
 | 
			
		||||
@@ -1644,10 +1885,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= irix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** irix-mips3-gcc
 | 
			
		||||
@@ -1666,10 +1907,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= irix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** irix64-mips4-cc
 | 
			
		||||
@@ -1688,10 +1929,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= irix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** irix64-mips4-gcc
 | 
			
		||||
@@ -1710,10 +1951,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= irix-shared
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** linux-alpha+bwx-ccc
 | 
			
		||||
@@ -1874,10 +2115,10 @@ $ranlib       =
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$lflags       = -ldl
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR
 | 
			
		||||
$bn_obj       = asm/ia64.o
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
@@ -1886,10 +2127,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= linux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** linux-m68k
 | 
			
		||||
@@ -1916,6 +2157,28 @@ $ranlib       =
 | 
			
		||||
 | 
			
		||||
*** linux-mips
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** linux-mipsel
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
@@ -1941,8 +2204,8 @@ $cc           = gcc
 | 
			
		||||
$cflags       = -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG
 | 
			
		||||
$lflags       = -ldl
 | 
			
		||||
$bn_ops       = BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
@@ -1952,10 +2215,10 @@ $cast_obj     =
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= linux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** linux-s390
 | 
			
		||||
@@ -2178,6 +2441,28 @@ $shared_cflag =
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** qnx6
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$lflags       = -lsocket
 | 
			
		||||
$bn_ops       = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** rhapsody-ppc-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O3 -DB_ENDIAN
 | 
			
		||||
@@ -2349,7 +2634,7 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -2393,7 +2678,7 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -2437,7 +2722,7 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -2459,11 +2744,33 @@ $rc4_obj      =
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** solaris-x86-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -fast -O -Xa
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$lflags       = -lsocket -lnsl -ldl
 | 
			
		||||
$bn_ops       = BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -KPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** solaris-x86-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM
 | 
			
		||||
@@ -2481,7 +2788,7 @@ $rc4_obj      = asm/rx86-sol.o
 | 
			
		||||
$rmd160_obj   = asm/rm86-sol.o
 | 
			
		||||
$rc5_obj      = asm/r586-sol.o
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
@@ -2706,6 +3013,28 @@ $shared_cflag =
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** unixware-7-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -m486 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$lflags       = -lsocket -lnsl
 | 
			
		||||
$bn_ops       = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= gnu-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
 | 
			
		||||
*** unixware-7-pentium
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O -DFILIO_H -Kalloca -Kpentium
 | 
			
		||||
 
 | 
			
		||||
@@ -360,15 +360,14 @@ dsaparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h
 | 
			
		||||
dsaparam.o: ../include/openssl/des.h ../include/openssl/dh.h
 | 
			
		||||
dsaparam.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
 | 
			
		||||
dsaparam.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
 | 
			
		||||
dsaparam.o: ../include/openssl/engine.h ../include/openssl/err.h
 | 
			
		||||
dsaparam.o: ../include/openssl/evp.h ../include/openssl/idea.h
 | 
			
		||||
dsaparam.o: ../include/openssl/lhash.h ../include/openssl/md2.h
 | 
			
		||||
dsaparam.o: ../include/openssl/md4.h ../include/openssl/md5.h
 | 
			
		||||
dsaparam.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h
 | 
			
		||||
dsaparam.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
 | 
			
		||||
dsaparam.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
 | 
			
		||||
dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
 | 
			
		||||
dsaparam.o: ../include/openssl/rand.h ../include/openssl/rc2.h
 | 
			
		||||
dsaparam.o: ../include/openssl/err.h ../include/openssl/evp.h
 | 
			
		||||
dsaparam.o: ../include/openssl/idea.h ../include/openssl/lhash.h
 | 
			
		||||
dsaparam.o: ../include/openssl/md2.h ../include/openssl/md4.h
 | 
			
		||||
dsaparam.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
 | 
			
		||||
dsaparam.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
 | 
			
		||||
dsaparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
dsaparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h
 | 
			
		||||
dsaparam.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
 | 
			
		||||
dsaparam.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
 | 
			
		||||
dsaparam.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
 | 
			
		||||
dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 | 
			
		||||
 
 | 
			
		||||
@@ -1247,7 +1247,11 @@ bad:
 | 
			
		||||
			X509_free(revcert);
 | 
			
		||||
 | 
			
		||||
			strncpy(buf[0],dbfile,BSIZE-4);
 | 
			
		||||
#ifndef VMS
 | 
			
		||||
			strcat(buf[0],".new");
 | 
			
		||||
#else
 | 
			
		||||
			strcat(buf[0],"-new");
 | 
			
		||||
#endif
 | 
			
		||||
			if (BIO_write_filename(out,buf[0]) <= 0)
 | 
			
		||||
				{
 | 
			
		||||
				perror(dbfile);
 | 
			
		||||
@@ -1257,7 +1261,11 @@ bad:
 | 
			
		||||
			j=TXT_DB_write(out,db);
 | 
			
		||||
			if (j <= 0) goto err;
 | 
			
		||||
			strncpy(buf[1],dbfile,BSIZE-4);
 | 
			
		||||
#ifndef VMS
 | 
			
		||||
			strcat(buf[1],".old");
 | 
			
		||||
#else
 | 
			
		||||
			strcat(buf[1],"-old");
 | 
			
		||||
#endif
 | 
			
		||||
			if (rename(dbfile,buf[1]) < 0)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]);
 | 
			
		||||
 
 | 
			
		||||
@@ -74,7 +74,7 @@
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	dgst_main
 | 
			
		||||
 | 
			
		||||
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, char binout,
 | 
			
		||||
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
		EVP_PKEY *key, unsigned char *sigin, int siglen);
 | 
			
		||||
 | 
			
		||||
int MAIN(int, char **);
 | 
			
		||||
@@ -95,7 +95,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int debug=0;
 | 
			
		||||
	const char *outfile = NULL, *keyfile = NULL;
 | 
			
		||||
	const char *sigfile = NULL, *randfile = NULL;
 | 
			
		||||
	char out_bin = -1, want_pub = 0, do_verify = 0;
 | 
			
		||||
	int out_bin = -1, want_pub = 0, do_verify = 0;
 | 
			
		||||
	EVP_PKEY *sigkey = NULL;
 | 
			
		||||
	unsigned char *sigbuf = NULL;
 | 
			
		||||
	int siglen = 0;
 | 
			
		||||
@@ -365,7 +365,7 @@ end:
 | 
			
		||||
	EXIT(err);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, char binout,
 | 
			
		||||
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
			EVP_PKEY *key, unsigned char *sigin, int siglen)
 | 
			
		||||
	{
 | 
			
		||||
	int len;
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,6 @@
 | 
			
		||||
#include <openssl/dsa.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	dsaparam_main
 | 
			
		||||
@@ -91,12 +90,11 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	DSA *dsa=NULL;
 | 
			
		||||
	int i,badops=0,text=0;
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
	int informat,outformat,noout=0,C=0,ret=1;
 | 
			
		||||
	char *infile,*outfile,*prog,*inrand=NULL,*engine=NULL;
 | 
			
		||||
	char *infile,*outfile,*prog,*inrand=NULL;
 | 
			
		||||
	int numbits= -1,num,genkey=0;
 | 
			
		||||
	int need_rand=0;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -542,6 +542,14 @@ bad:
 | 
			
		||||
			BIO_printf(bio_err,"invalid hex iv value\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if ((hiv == NULL) && (str == NULL))
 | 
			
		||||
			{
 | 
			
		||||
			/* No IV was explicitly set and no IV was generated
 | 
			
		||||
			 * during EVP_BytesToKey. Hence the IV is undefined,
 | 
			
		||||
			 * making correct decryption impossible. */
 | 
			
		||||
			BIO_printf(bio_err, "iv undefined\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if ((hkey != NULL) && !set_hex(hkey,key,24))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid hex key value\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -1133,6 +1133,7 @@ $!
 | 
			
		||||
$! Save directory information
 | 
			
		||||
$!
 | 
			
		||||
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
 | 
			
		||||
$ __HERE = F$EDIT(__HERE,"UPCASE")
 | 
			
		||||
$ __TOP = __HERE - "APPS]"
 | 
			
		||||
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
 | 
			
		||||
$!
 | 
			
		||||
 
 | 
			
		||||
@@ -392,8 +392,7 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err,"                the random number generator\n");
 | 
			
		||||
		BIO_printf(bio_err," -newkey rsa:bits generate a new RSA key of 'bits' in size\n");
 | 
			
		||||
		BIO_printf(bio_err," -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n");
 | 
			
		||||
 | 
			
		||||
		BIO_printf(bio_err," -[digest]      Digest to sign with (md5, sha1, md2, mdc2)\n");
 | 
			
		||||
		BIO_printf(bio_err," -[digest]      Digest to sign with (md5, sha1, md2, mdc2, md4)\n");
 | 
			
		||||
		BIO_printf(bio_err," -config file   request template file.\n");
 | 
			
		||||
		BIO_printf(bio_err," -new           new request.\n");
 | 
			
		||||
		BIO_printf(bio_err," -x509          output a x509 structure instead of a cert. req.\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -928,5 +928,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 | 
			
		||||
	BIO_printf(bio,"---\n");
 | 
			
		||||
	if (peer != NULL)
 | 
			
		||||
		X509_free(peer);
 | 
			
		||||
	/* flush, or debugging output gets mixed with http response */
 | 
			
		||||
	BIO_flush(bio);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -299,6 +299,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf (bio_err, "-CApath dir    trusted certificates directory\n");
 | 
			
		||||
		BIO_printf (bio_err, "-CAfile file   trusted certificates file\n");
 | 
			
		||||
		BIO_printf (bio_err, "-engine e      use engine e, possibly a hardware device.\n");
 | 
			
		||||
		BIO_printf (bio_err, "-passin arg    input file pass phrase source\n");
 | 
			
		||||
		BIO_printf(bio_err,  "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
 | 
			
		||||
		BIO_printf(bio_err,  "               load the file (or the files in the directory) into\n");
 | 
			
		||||
		BIO_printf(bio_err,  "               the random number generator\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -83,12 +83,12 @@
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#if defined(__FreeBSD__)
 | 
			
		||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 | 
			
		||||
# define USE_TOD
 | 
			
		||||
#elif !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
 | 
			
		||||
# define TIMES
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE)
 | 
			
		||||
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__)
 | 
			
		||||
# define TIMEB
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										67
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										67
									
								
								config
									
									
									
									
									
								
							@@ -68,6 +68,11 @@ if [ "x$XREL" != "x" ]; then
 | 
			
		||||
	    4.2)
 | 
			
		||||
		echo "whatever-whatever-unixware1"; exit 0
 | 
			
		||||
		;;
 | 
			
		||||
     OpenUNIX)
 | 
			
		||||
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
 | 
			
		||||
		    echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
 | 
			
		||||
		fi
 | 
			
		||||
		;;
 | 
			
		||||
	    5)
 | 
			
		||||
		if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
 | 
			
		||||
		    echo "${MACHINE}-sco-unixware7"; exit 0
 | 
			
		||||
@@ -195,15 +200,33 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
 | 
			
		||||
	echo "${MACHINE}-whatever-openbsd"; exit 0
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    OpenUNIX:*)
 | 
			
		||||
	echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    OSF1:*:*:*alpha*)
 | 
			
		||||
	echo "${MACHINE}-dec-osf"; exit 0
 | 
			
		||||
	OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
 | 
			
		||||
	case "$OSFMAJOR" in
 | 
			
		||||
	    4|5)
 | 
			
		||||
		echo "${MACHINE}-dec-tru64"; exit 0
 | 
			
		||||
		;;
 | 
			
		||||
	    1|2|3)
 | 
			
		||||
		echo "${MACHINE}-dec-osf"; exit 0
 | 
			
		||||
		;;
 | 
			
		||||
	    *)
 | 
			
		||||
		echo "${MACHINE}-dec-osf"; exit 0
 | 
			
		||||
		;;
 | 
			
		||||
	esac
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    QNX:*)
 | 
			
		||||
	case "$VERSION" in
 | 
			
		||||
	case "$RELEASE" in
 | 
			
		||||
	    4*)
 | 
			
		||||
		echo "${MACHINE}-whatever-qnx4"
 | 
			
		||||
		;;
 | 
			
		||||
	    6*)
 | 
			
		||||
		echo "${MACHINE}-whatever-qnx6"
 | 
			
		||||
		;;
 | 
			
		||||
	    *)
 | 
			
		||||
		echo "${MACHINE}-whatever-qnx"
 | 
			
		||||
		;;
 | 
			
		||||
@@ -219,6 +242,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
 | 
			
		||||
	echo "ppc-apple-rhapsody"; exit 0
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    Darwin:*)
 | 
			
		||||
	echo "ppc-apple-darwin"; exit 0
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    SunOS:5.*)
 | 
			
		||||
	echo "${MACHINE}-whatever-solaris2"; exit 0
 | 
			
		||||
	;;
 | 
			
		||||
@@ -271,6 +298,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
 | 
			
		||||
	echo "mips-sony-newsos4"; exit 0;
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    CYGWIN*)
 | 
			
		||||
	echo "${MACHINE}-whatever-cygwin32"; exit 0
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
@@ -435,11 +466,27 @@ case "$GUESSOS" in
 | 
			
		||||
	    esac
 | 
			
		||||
	fi
 | 
			
		||||
	;;
 | 
			
		||||
  mips-*-linux?) OUT="linux-mips" ;;
 | 
			
		||||
  mips-*-linux?)
 | 
			
		||||
          cat >dummy.c <<EOF
 | 
			
		||||
#include <stdio.h>  /* for printf() prototype */
 | 
			
		||||
        int main (argc, argv) int argc; char *argv[]; {
 | 
			
		||||
#ifdef __MIPSEB__
 | 
			
		||||
  printf ("linux-%s\n", argv[1]);
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef __MIPSEL__
 | 
			
		||||
  printf ("linux-%sel\n", argv[1]);
 | 
			
		||||
#endif
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
EOF
 | 
			
		||||
	${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
 | 
			
		||||
	rm dummy dummy.c
 | 
			
		||||
	;;
 | 
			
		||||
  ppc-*-linux2) OUT="linux-ppc" ;;
 | 
			
		||||
  m68k-*-linux*) OUT="linux-m68k" ;;
 | 
			
		||||
  ia64-*-linux?) OUT="linux-ia64" ;;
 | 
			
		||||
  ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
 | 
			
		||||
  ppc-apple-darwin) OUT="darwin-ppc-cc" ;;
 | 
			
		||||
  sparc64-*-linux2)
 | 
			
		||||
	#Before we can uncomment following lines we have to wait at least
 | 
			
		||||
	#till 64-bit glibc for SPARC is operational:-(
 | 
			
		||||
@@ -485,7 +532,15 @@ case "$GUESSOS" in
 | 
			
		||||
  pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
 | 
			
		||||
  *-*-openbsd) OUT="OpenBSD" ;;
 | 
			
		||||
  *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
 | 
			
		||||
  *-*-osf) OUT="alpha-cc" ;;
 | 
			
		||||
  *-*-osf) OUT="alphaold-cc" ;;
 | 
			
		||||
  *-*-tru64) OUT="alpha-cc" ;;
 | 
			
		||||
  *-*-OpenUNIX*)
 | 
			
		||||
	if [ "$CC" = "gcc" ]; then
 | 
			
		||||
	  OUT="OpenUNIX-8-gcc" 
 | 
			
		||||
	else    
 | 
			
		||||
	  OUT="OpenUNIX-8" 
 | 
			
		||||
	fi
 | 
			
		||||
	;;
 | 
			
		||||
  *-*-unixware7) OUT="unixware-7" ;;
 | 
			
		||||
  *-*-UnixWare7) OUT="unixware-7" ;;
 | 
			
		||||
  *-*-Unixware7) OUT="unixware-7" ;;
 | 
			
		||||
@@ -505,6 +560,8 @@ case "$GUESSOS" in
 | 
			
		||||
  # *-aix) OUT="aix-$CC" ;;
 | 
			
		||||
  # *-dgux) OUT="dgux" ;;
 | 
			
		||||
  mips-sony-newsos4) OUT="newsos4-gcc" ;;
 | 
			
		||||
  *-*-cygwin32) OUT="CygWin32"
 | 
			
		||||
		options="$options no-threads no-asm" ;;
 | 
			
		||||
  *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
@@ -549,7 +606,7 @@ case "$GUESSOS" in
 | 
			
		||||
  i386-*) options="$options 386" ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
for i in bf cast des dh dsa hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
 | 
			
		||||
for i in bf cast des dh dsa hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
 | 
			
		||||
do
 | 
			
		||||
  if [ ! -d crypto/$i ]
 | 
			
		||||
  then
 | 
			
		||||
 
 | 
			
		||||
@@ -105,9 +105,9 @@ int ASN1_STRING_set_default_mask_asc(char *p)
 | 
			
		||||
		mask = strtoul(p + 5, &end, 0);
 | 
			
		||||
		if(*end) return 0;
 | 
			
		||||
	} else if(!strcmp(p, "nombstr"))
 | 
			
		||||
			 mask = ~(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING);
 | 
			
		||||
		mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING));
 | 
			
		||||
	else if(!strcmp(p, "pkix"))
 | 
			
		||||
			mask = ~B_ASN1_T61STRING;
 | 
			
		||||
			mask = ~((unsigned long)B_ASN1_T61STRING);
 | 
			
		||||
	else if(!strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING;
 | 
			
		||||
	else if(!strcmp(p, "default"))
 | 
			
		||||
	    mask = 0xFFFFFFFFL;
 | 
			
		||||
 
 | 
			
		||||
@@ -834,8 +834,6 @@ void ASN1_HEADER_free(ASN1_HEADER *a);
 | 
			
		||||
 | 
			
		||||
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
 | 
			
		||||
 | 
			
		||||
void ERR_load_ASN1_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Not used that much at this point, except for the first two */
 | 
			
		||||
ASN1_METHOD *X509_asn1_meth(void);
 | 
			
		||||
ASN1_METHOD *RSAPrivateKey_asn1_meth(void);
 | 
			
		||||
@@ -877,6 +875,7 @@ void ASN1_STRING_TABLE_cleanup(void);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_ASN1_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the ASN1 functions. */
 | 
			
		||||
 | 
			
		||||
@@ -1148,4 +1147,3 @@ void ASN1_STRING_TABLE_cleanup(void);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -349,6 +349,8 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
 | 
			
		||||
	ll=80-2-obase;
 | 
			
		||||
 | 
			
		||||
	s=X509_NAME_oneline(name,buf,256);
 | 
			
		||||
	if (!*s)
 | 
			
		||||
		return 1;
 | 
			
		||||
	s++; /* skip the first slash */
 | 
			
		||||
 | 
			
		||||
	l=ll;
 | 
			
		||||
 
 | 
			
		||||
@@ -234,7 +234,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
 | 
			
		||||
	a=key->algor;
 | 
			
		||||
	if (ret->type == EVP_PKEY_DSA)
 | 
			
		||||
		{
 | 
			
		||||
		if (a->parameter->type == V_ASN1_SEQUENCE)
 | 
			
		||||
		if (a->parameter && (a->parameter->type == V_ASN1_SEQUENCE))
 | 
			
		||||
			{
 | 
			
		||||
			ret->pkey.dsa->write_params=0;
 | 
			
		||||
			p=a->parameter->value.sequence->data;
 | 
			
		||||
 
 | 
			
		||||
@@ -109,7 +109,11 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if HAVE_LONG_LONG
 | 
			
		||||
#define LLONG long long
 | 
			
		||||
# if defined(WIN32) && !defined(__GNUC__)
 | 
			
		||||
# define LLONG _int64
 | 
			
		||||
# else
 | 
			
		||||
# define LLONG long long
 | 
			
		||||
# endif
 | 
			
		||||
#else
 | 
			
		||||
#define LLONG long
 | 
			
		||||
#endif
 | 
			
		||||
@@ -152,7 +156,7 @@ static void _dopr(char **sbuffer, char **buffer,
 | 
			
		||||
 | 
			
		||||
/* some handy macros */
 | 
			
		||||
#define char_to_int(p) (p - '0')
 | 
			
		||||
#define MAX(p,q) ((p >= q) ? p : q)
 | 
			
		||||
#define OSSL_MAX(p,q) ((p >= q) ? p : q)
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
_dopr(
 | 
			
		||||
@@ -503,13 +507,13 @@ fmtint(
 | 
			
		||||
    convert[place] = 0;
 | 
			
		||||
 | 
			
		||||
    zpadlen = max - place;
 | 
			
		||||
    spadlen = min - MAX(max, place) - (signvalue ? 1 : 0);
 | 
			
		||||
    spadlen = min - OSSL_MAX(max, place) - (signvalue ? 1 : 0);
 | 
			
		||||
    if (zpadlen < 0)
 | 
			
		||||
        zpadlen = 0;
 | 
			
		||||
    if (spadlen < 0)
 | 
			
		||||
        spadlen = 0;
 | 
			
		||||
    if (flags & DP_F_ZERO) {
 | 
			
		||||
        zpadlen = MAX(zpadlen, spadlen);
 | 
			
		||||
        zpadlen = OSSL_MAX(zpadlen, spadlen);
 | 
			
		||||
        spadlen = 0;
 | 
			
		||||
    }
 | 
			
		||||
    if (flags & DP_F_MINUS)
 | 
			
		||||
@@ -565,7 +569,7 @@ pow10(int exp)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static long
 | 
			
		||||
round(LDOUBLE value)
 | 
			
		||||
roundv(LDOUBLE value)
 | 
			
		||||
{
 | 
			
		||||
    long intpart;
 | 
			
		||||
    intpart = (long) value;
 | 
			
		||||
@@ -617,7 +621,7 @@ fmtfp(
 | 
			
		||||
 | 
			
		||||
    /* we "cheat" by converting the fractional part to integer by
 | 
			
		||||
       multiplying by a factor of 10 */
 | 
			
		||||
    fracpart = round((pow10(max)) * (ufvalue - intpart));
 | 
			
		||||
    fracpart = roundv((pow10(max)) * (ufvalue - intpart));
 | 
			
		||||
 | 
			
		||||
    if (fracpart >= pow10(max)) {
 | 
			
		||||
        intpart++;
 | 
			
		||||
@@ -641,7 +645,7 @@ fmtfp(
 | 
			
		||||
            (caps ? "0123456789ABCDEF"
 | 
			
		||||
              : "0123456789abcdef")[fracpart % 10];
 | 
			
		||||
        fracpart = (fracpart / 10);
 | 
			
		||||
    } while (fracpart && (fplace < 20));
 | 
			
		||||
    } while (fplace < max);
 | 
			
		||||
    if (fplace == 20)
 | 
			
		||||
        fplace--;
 | 
			
		||||
    fconvert[fplace] = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -95,8 +95,10 @@ static struct ghbn_cache_st
 | 
			
		||||
	} ghbn_cache[GHBN_NUM];
 | 
			
		||||
 | 
			
		||||
static int get_ip(const char *str,unsigned char *ip);
 | 
			
		||||
#if 0
 | 
			
		||||
static void ghbn_free(struct hostent *a);
 | 
			
		||||
static struct hostent *ghbn_dup(struct hostent *a);
 | 
			
		||||
#endif
 | 
			
		||||
int BIO_get_host_ip(const char *str, unsigned char *ip)
 | 
			
		||||
	{
 | 
			
		||||
	int i;
 | 
			
		||||
@@ -266,6 +268,7 @@ long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
static struct hostent *ghbn_dup(struct hostent *a)
 | 
			
		||||
	{
 | 
			
		||||
	struct hostent *ret;
 | 
			
		||||
@@ -342,21 +345,27 @@ static void ghbn_free(struct hostent *a)
 | 
			
		||||
	if (a->h_name != NULL) OPENSSL_free(a->h_name);
 | 
			
		||||
	OPENSSL_free(a);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct hostent *BIO_gethostbyname(const char *name)
 | 
			
		||||
	{
 | 
			
		||||
#if 1
 | 
			
		||||
	/* Caching gethostbyname() results forever is wrong,
 | 
			
		||||
	 * so we have to let the true gethostbyname() worry about this */
 | 
			
		||||
	return gethostbyname(name);
 | 
			
		||||
#else
 | 
			
		||||
	struct hostent *ret;
 | 
			
		||||
	int i,lowi=0,j;
 | 
			
		||||
	unsigned long low= (unsigned long)-1;
 | 
			
		||||
 | 
			
		||||
/*	return(gethostbyname(name)); */
 | 
			
		||||
 | 
			
		||||
#if 0 /* It doesn't make sense to use locking here: The function interface
 | 
			
		||||
	   * is not thread-safe, because threads can never be sure when
 | 
			
		||||
	   * some other thread destroys the data they were given a pointer to.
 | 
			
		||||
	   */
 | 
			
		||||
#  if 0
 | 
			
		||||
	/* It doesn't make sense to use locking here: The function interface
 | 
			
		||||
	 * is not thread-safe, because threads can never be sure when
 | 
			
		||||
	 * some other thread destroys the data they were given a pointer to.
 | 
			
		||||
	 */
 | 
			
		||||
	CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);
 | 
			
		||||
#endif
 | 
			
		||||
#  endif
 | 
			
		||||
	j=strlen(name);
 | 
			
		||||
	if (j < 128)
 | 
			
		||||
		{
 | 
			
		||||
@@ -384,20 +393,21 @@ struct hostent *BIO_gethostbyname(const char *name)
 | 
			
		||||
		 * parameter is 'char *', instead of 'const char *'
 | 
			
		||||
		 */
 | 
			
		||||
		ret=gethostbyname(
 | 
			
		||||
#ifndef CONST_STRICT
 | 
			
		||||
#  ifndef CONST_STRICT
 | 
			
		||||
		    (char *)
 | 
			
		||||
#endif
 | 
			
		||||
#  endif
 | 
			
		||||
		    name);
 | 
			
		||||
 | 
			
		||||
		if (ret == NULL)
 | 
			
		||||
			goto end;
 | 
			
		||||
		if (j > 128) /* too big to cache */
 | 
			
		||||
			{
 | 
			
		||||
#if 0 /* If we were trying to make this function thread-safe (which
 | 
			
		||||
	   * is bound to fail), we'd have to give up in this case
 | 
			
		||||
	   * (or allocate more memory). */
 | 
			
		||||
#  if 0
 | 
			
		||||
			/* If we were trying to make this function thread-safe (which
 | 
			
		||||
			 * is bound to fail), we'd have to give up in this case
 | 
			
		||||
			 * (or allocate more memory). */
 | 
			
		||||
			ret = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
#  endif
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -421,12 +431,14 @@ struct hostent *BIO_gethostbyname(const char *name)
 | 
			
		||||
		ghbn_cache[i].order=BIO_ghbn_miss+BIO_ghbn_hits;
 | 
			
		||||
		}
 | 
			
		||||
end:
 | 
			
		||||
#if 0
 | 
			
		||||
#  if 0
 | 
			
		||||
	CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME);
 | 
			
		||||
#endif
 | 
			
		||||
#  endif
 | 
			
		||||
	return(ret);
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int BIO_sock_init(void)
 | 
			
		||||
	{
 | 
			
		||||
#ifdef WINDOWS
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 | 
			
		||||
static int buffer_new(BIO *h);
 | 
			
		||||
static int buffer_free(BIO *data);
 | 
			
		||||
static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
 | 
			
		||||
#define DEFAULT_BUFFER_SIZE	1024
 | 
			
		||||
#define DEFAULT_BUFFER_SIZE	4096
 | 
			
		||||
 | 
			
		||||
static BIO_METHOD methods_buffer=
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -431,7 +431,7 @@ int BIO_read_filename(BIO *b,const char *name);
 | 
			
		||||
#define BIO_set_ssl_renegotiate_bytes(b,num) \
 | 
			
		||||
	BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
 | 
			
		||||
#define BIO_get_num_renegotiates(b) \
 | 
			
		||||
	BIO_ctrl(b,BIO_C_SET_SSL_NUM_RENEGOTIATES,0,NULL);
 | 
			
		||||
	BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
 | 
			
		||||
#define BIO_set_ssl_renegotiate_timeout(b,seconds) \
 | 
			
		||||
	BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
 | 
			
		||||
 | 
			
		||||
@@ -588,8 +588,6 @@ int BIO_sock_init(void );
 | 
			
		||||
void BIO_sock_cleanup(void);
 | 
			
		||||
int BIO_set_tcp_ndelay(int sock,int turn_on);
 | 
			
		||||
 | 
			
		||||
void ERR_load_BIO_strings(void );
 | 
			
		||||
 | 
			
		||||
BIO *BIO_new_socket(int sock, int close_flag);
 | 
			
		||||
BIO *BIO_new_fd(int fd, int close_flag);
 | 
			
		||||
BIO *BIO_new_connect(char *host_port);
 | 
			
		||||
@@ -615,6 +613,7 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_BIO_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the BIO functions. */
 | 
			
		||||
 | 
			
		||||
@@ -684,4 +683,3 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -474,7 +474,8 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	case BIO_C_GET_WRITE_BUF_SIZE:
 | 
			
		||||
		num = (long) b->size;
 | 
			
		||||
		ret = (long) b->size;
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	case BIO_C_MAKE_BIO_PAIR:
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -124,6 +124,8 @@ asm/sparcv8plus-gcc27.o: asm/sparcv8plus.S
 | 
			
		||||
	$(CC) $(ASFLAGS) -E asm/sparcv8plus.S | \
 | 
			
		||||
		/usr/ccs/bin/as -xarch=v8plus - -o asm/sparcv8plus-gcc27.o
 | 
			
		||||
 | 
			
		||||
asm/ia64.o: asm/ia64.S
 | 
			
		||||
 | 
			
		||||
files:
 | 
			
		||||
	$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1498
									
								
								crypto/bn/asm/ia64.S
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1498
									
								
								crypto/bn/asm/ia64.S
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
.rdata
 | 
			
		||||
.asciiz "mips3.s, Version 1.0"
 | 
			
		||||
.asciiz	"mips3.s, Version 1.1"
 | 
			
		||||
.asciiz	"MIPS III/IV ISA artwork by Andy Polyakov <appro@fy.chalmers.se>"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -849,6 +849,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	dmultu	a_1,b_2		/* mul_add_c(a[1],b[2],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -856,7 +857,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_2,b_1		/* mul_add_c(a[2],b[1],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -884,6 +886,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	dmultu	a_3,b_1		/* mul_add_c(a[3],b[1],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -891,7 +894,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_2,b_2		/* mul_add_c(a[2],b[2],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -928,6 +932,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	dmultu	a_1,b_4		/* mul_add_c(a[1],b[4],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -935,7 +940,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_2,b_3		/* mul_add_c(a[2],b[3],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -981,6 +987,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	dmultu	a_5,b_1		/* mul_add_c(a[5],b[1],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -988,7 +995,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_4,b_2		/* mul_add_c(a[4],b[2],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1043,6 +1051,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	dmultu	a_1,b_6		/* mul_add_c(a[1],b[6],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1050,7 +1059,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_2,b_5		/* mul_add_c(a[2],b[5],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1114,6 +1124,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	dmultu	a_6,b_2		/* mul_add_c(a[6],b[2],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1121,7 +1132,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_5,b_3		/* mul_add_c(a[5],b[3],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1176,6 +1188,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	dmultu	a_3,b_6		/* mul_add_c(a[3],b[6],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1183,7 +1196,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_4,b_5		/* mul_add_c(a[4],b[5],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1229,6 +1243,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	dmultu	a_6,b_4		/* mul_add_c(a[6],b[4],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1236,7 +1251,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_5,b_5		/* mul_add_c(a[5],b[5],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1273,6 +1289,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	dmultu	a_5,b_6		/* mul_add_c(a[5],b[6],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1280,7 +1297,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_6,b_5		/* mul_add_c(a[6],b[5],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1308,6 +1326,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	dmultu	a_6,b_6		/* mul_add_c(a[6],b[6],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1315,7 +1334,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_5,b_7		/* mul_add_c(a[5],b[7],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1334,6 +1354,7 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	dmultu	a_7,b_6		/* mul_add_c(a[7],b[6],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1341,7 +1362,8 @@ LEAF(bn_mul_comba8)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	sd	c_2,104(a0)	/* r[13]=c2; */
 | 
			
		||||
 | 
			
		||||
	dmultu	a_7,b_7		/* mul_add_c(a[7],b[7],c3,c1,c2); */
 | 
			
		||||
@@ -1430,6 +1452,7 @@ LEAF(bn_mul_comba4)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	dmultu	a_1,b_2		/* mul_add_c(a[1],b[2],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1437,7 +1460,8 @@ LEAF(bn_mul_comba4)
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_2,b_1		/* mul_add_c(a[2],b[1],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1465,6 +1489,7 @@ LEAF(bn_mul_comba4)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	dmultu	a_2,b_2		/* mul_add_c(a[2],b[2],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1472,7 +1497,8 @@ LEAF(bn_mul_comba4)
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_1,b_3		/* mul_add_c(a[1],b[3],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1491,6 +1517,7 @@ LEAF(bn_mul_comba4)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	dmultu	a_3,b_2		/* mul_add_c(a[3],b[2],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1498,7 +1525,8 @@ LEAF(bn_mul_comba4)
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	sd	c_3,40(a0)
 | 
			
		||||
 | 
			
		||||
	dmultu	a_3,b_3		/* mul_add_c(a[3],b[3],c1,c2,c3); */
 | 
			
		||||
@@ -1543,28 +1571,30 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_0,a_1		/* mul_add_c2(a[0],b[1],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	slt	c_1,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	c_3,t_2,AT
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sd	c_2,8(a0)
 | 
			
		||||
 | 
			
		||||
	dmultu	a_2,a_0		/* mul_add_c2(a[2],b[0],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	slt	c_2,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_1,a_1		/* mul_add_c(a[1],b[1],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1579,24 +1609,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_0,a_3		/* mul_add_c2(a[0],b[3],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	slt	c_3,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_1,a_2		/* mul_add_c2(a[1],b[2],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	sltu	AT,c_2,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1608,24 +1640,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_4,a_0		/* mul_add_c2(a[4],b[0],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	slt	c_1,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_3,a_1		/* mul_add_c2(a[3],b[1],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	sltu	AT,c_3,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1646,24 +1680,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_0,a_5		/* mul_add_c2(a[0],b[5],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	slt	c_2,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_1,a_4		/* mul_add_c2(a[1],b[4],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	sltu	AT,c_1,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1673,12 +1709,12 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_2,a_3		/* mul_add_c2(a[2],b[3],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	sltu	AT,c_1,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1690,24 +1726,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_6,a_0		/* mul_add_c2(a[6],b[0],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	slt	c_3,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_5,a_1		/* mul_add_c2(a[5],b[1],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	sltu	AT,c_2,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1717,12 +1755,12 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_4,a_2		/* mul_add_c2(a[4],b[2],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	sltu	AT,c_2,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1743,24 +1781,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_0,a_7		/* mul_add_c2(a[0],b[7],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	slt	c_1,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_1,a_6		/* mul_add_c2(a[1],b[6],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	sltu	AT,c_3,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1770,12 +1810,12 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_2,a_5		/* mul_add_c2(a[2],b[5],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	sltu	AT,c_3,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1785,12 +1825,12 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_3,a_4		/* mul_add_c2(a[3],b[4],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	sltu	AT,c_3,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1802,24 +1842,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_7,a_1		/* mul_add_c2(a[7],b[1],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	slt	c_2,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_6,a_2		/* mul_add_c2(a[6],b[2],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	sltu	AT,c_1,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1829,12 +1871,12 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_5,a_3		/* mul_add_c2(a[5],b[3],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	sltu	AT,c_1,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1855,24 +1897,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_2,a_7		/* mul_add_c2(a[2],b[7],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	slt	c_3,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_3,a_6		/* mul_add_c2(a[3],b[6],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	sltu	AT,c_2,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1882,12 +1926,12 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_4,a_5		/* mul_add_c2(a[4],b[5],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	sltu	AT,c_2,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1899,24 +1943,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_7,a_3		/* mul_add_c2(a[7],b[3],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	slt	c_1,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_6,a_4		/* mul_add_c2(a[6],b[4],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	sltu	AT,c_3,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1937,24 +1983,26 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_4,a_7		/* mul_add_c2(a[4],b[7],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	slt	c_2,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_5,a_6		/* mul_add_c2(a[5],b[6],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	sltu	AT,c_1,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -1966,15 +2014,17 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_7,a_5		/* mul_add_c2(a[7],b[5],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	slt	c_3,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_6,a_6		/* mul_add_c(a[6],b[6],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -1989,15 +2039,17 @@ LEAF(bn_sqr_comba8)
 | 
			
		||||
	dmultu	a_6,a_7		/* mul_add_c2(a[6],b[7],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	slt	c_1,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	sd	c_2,104(a0)
 | 
			
		||||
 | 
			
		||||
	dmultu	a_7,a_7		/* mul_add_c(a[7],b[7],c3,c1,c2); */
 | 
			
		||||
@@ -2028,28 +2080,30 @@ LEAF(bn_sqr_comba4)
 | 
			
		||||
	dmultu	a_0,a_1		/* mul_add_c2(a[0],b[1],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	slt	c_1,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	c_3,t_2,AT
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sd	c_2,8(a0)
 | 
			
		||||
 | 
			
		||||
	dmultu	a_2,a_0		/* mul_add_c2(a[2],b[0],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	slt	c_2,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	dmultu	a_1,a_1		/* mul_add_c(a[1],b[1],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -2064,24 +2118,26 @@ LEAF(bn_sqr_comba4)
 | 
			
		||||
	dmultu	a_0,a_3		/* mul_add_c2(a[0],b[3],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	slt	c_3,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_2,t_2
 | 
			
		||||
	sltu	c_3,c_2,t_2
 | 
			
		||||
	sltu	AT,c_2,t_2
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dmultu	a_1,a_2		/* mul_add_c(a2[1],b[2],c1,c2,c3); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_2,a2
 | 
			
		||||
	sltu	AT,c_2,a2
 | 
			
		||||
	slt	AT,t_2,zero
 | 
			
		||||
	daddu	c_3,AT
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_1,t_1
 | 
			
		||||
	sltu	AT,c_1,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
@@ -2093,15 +2149,17 @@ LEAF(bn_sqr_comba4)
 | 
			
		||||
	dmultu	a_3,a_1		/* mul_add_c2(a[3],b[1],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_3,a2
 | 
			
		||||
	slt	c_1,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_2,t_1
 | 
			
		||||
	sltu	AT,c_2,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_3,t_2
 | 
			
		||||
	sltu	c_1,c_3,t_2
 | 
			
		||||
	sltu	AT,c_3,t_2
 | 
			
		||||
	daddu	c_1,AT
 | 
			
		||||
	dmultu	a_2,a_2		/* mul_add_c(a[2],b[2],c2,c3,c1); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
@@ -2116,15 +2174,17 @@ LEAF(bn_sqr_comba4)
 | 
			
		||||
	dmultu	a_2,a_3		/* mul_add_c2(a[2],b[3],c3,c1,c2); */
 | 
			
		||||
	mflo	t_1
 | 
			
		||||
	mfhi	t_2
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	a2,t_2,AT
 | 
			
		||||
	daddu	c_1,a2
 | 
			
		||||
	slt	c_2,t_2,zero
 | 
			
		||||
	dsll	t_2,1
 | 
			
		||||
	slt	a2,t_1,zero
 | 
			
		||||
	daddu	t_2,a2
 | 
			
		||||
	dsll	t_1,1
 | 
			
		||||
	daddu	c_3,t_1
 | 
			
		||||
	sltu	AT,c_3,t_1
 | 
			
		||||
	daddu	t_2,AT
 | 
			
		||||
	daddu	c_1,t_2
 | 
			
		||||
	sltu	c_2,c_1,t_2
 | 
			
		||||
	sltu	AT,c_1,t_2
 | 
			
		||||
	daddu	c_2,AT
 | 
			
		||||
	sd	c_3,40(a0)
 | 
			
		||||
 | 
			
		||||
	dmultu	a_3,a_3		/* mul_add_c(a[3],b[3],c1,c2,c3); */
 | 
			
		||||
 
 | 
			
		||||
@@ -90,7 +90,9 @@ extern "C" {
 | 
			
		||||
 * be on.  Again this in only really a problem on machines
 | 
			
		||||
 * using "long long's", are 32bit, and are not using my assembler code. */
 | 
			
		||||
#if defined(MSDOS) || defined(WINDOWS) || defined(WIN32) || defined(linux)
 | 
			
		||||
#define BN_DIV2W
 | 
			
		||||
# ifndef BN_DIV2W
 | 
			
		||||
#  define BN_DIV2W
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* assuming long is 64bit - this is the DEC Alpha
 | 
			
		||||
@@ -329,6 +331,7 @@ void	BN_CTX_end(BN_CTX *ctx);
 | 
			
		||||
int     BN_rand(BIGNUM *rnd, int bits, int top,int bottom);
 | 
			
		||||
int     BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
 | 
			
		||||
int	BN_rand_range(BIGNUM *rnd, BIGNUM *range);
 | 
			
		||||
int	BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
 | 
			
		||||
int	BN_num_bits(const BIGNUM *a);
 | 
			
		||||
int	BN_num_bits_word(BN_ULONG);
 | 
			
		||||
BIGNUM *BN_new(void);
 | 
			
		||||
@@ -403,7 +406,6 @@ int	BN_is_prime(const BIGNUM *p,int nchecks,
 | 
			
		||||
int	BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
 | 
			
		||||
		void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
 | 
			
		||||
		int do_trial_division);
 | 
			
		||||
void	ERR_load_BN_strings(void );
 | 
			
		||||
 | 
			
		||||
BN_MONT_CTX *BN_MONT_CTX_new(void );
 | 
			
		||||
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
 | 
			
		||||
@@ -474,6 +476,7 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_BN_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the BN functions. */
 | 
			
		||||
 | 
			
		||||
@@ -517,4 +520,3 @@ int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -128,7 +128,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
 | 
			
		||||
 | 
			
		||||
#if !defined(NO_ASM) && !defined(NO_INLINE_ASM) && !defined(PEDANTIC) && !defined(BN_DIV3W)
 | 
			
		||||
# if defined(__GNUC__) && __GNUC__>=2
 | 
			
		||||
#  if defined(__i386)
 | 
			
		||||
#  if defined(__i386) || defined (__i386__)
 | 
			
		||||
   /*
 | 
			
		||||
    * There were two reasons for implementing this template:
 | 
			
		||||
    * - GNU C generates a call to a function (__udivdi3 to be exact)
 | 
			
		||||
 
 | 
			
		||||
@@ -225,12 +225,15 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
 | 
			
		||||
	BN_MONT_CTX *mont = NULL;
 | 
			
		||||
	const BIGNUM *A = NULL;
 | 
			
		||||
 | 
			
		||||
	if (BN_cmp(a, BN_value_one()) <= 0)
 | 
			
		||||
		return 0;
 | 
			
		||||
	
 | 
			
		||||
	if (checks == BN_prime_checks)
 | 
			
		||||
		checks = BN_prime_checks_for_size(BN_num_bits(a));
 | 
			
		||||
 | 
			
		||||
	/* first look for small factors */
 | 
			
		||||
	if (!BN_is_odd(a))
 | 
			
		||||
		return(0);
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (do_trial_division)
 | 
			
		||||
		{
 | 
			
		||||
		for (i = 1; i < NUMPRIMES; i++)
 | 
			
		||||
@@ -289,11 +292,8 @@ int BN_is_prime_fasttest(const BIGNUM *a, int checks,
 | 
			
		||||
	
 | 
			
		||||
	for (i = 0; i < checks; i++)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_pseudo_rand(check, BN_num_bits(A1), 0, 0))
 | 
			
		||||
		if (!BN_pseudo_rand_range(check, A1))
 | 
			
		||||
			goto err;
 | 
			
		||||
		if (BN_cmp(check, A1) >= 0)
 | 
			
		||||
			if (!BN_sub(check, check, A1))
 | 
			
		||||
				goto err;
 | 
			
		||||
		if (!BN_add_word(check, 1))
 | 
			
		||||
			goto err;
 | 
			
		||||
		/* now 1 <= check < A */
 | 
			
		||||
 
 | 
			
		||||
@@ -55,6 +55,59 @@
 | 
			
		||||
 * copied and put under another distribution licence
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2001 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
 | 
			
		||||
 *    openssl-core@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 <time.h>
 | 
			
		||||
@@ -172,8 +225,9 @@ int     BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* random number r:  0 <= r < range */
 | 
			
		||||
int	BN_rand_range(BIGNUM *r, BIGNUM *range)
 | 
			
		||||
static int bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
 | 
			
		||||
	{
 | 
			
		||||
	int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand;
 | 
			
		||||
	int n;
 | 
			
		||||
 | 
			
		||||
	if (range->neg || BN_is_zero(range))
 | 
			
		||||
@@ -184,26 +238,19 @@ int	BN_rand_range(BIGNUM *r, BIGNUM *range)
 | 
			
		||||
 | 
			
		||||
	n = BN_num_bits(range); /* n > 0 */
 | 
			
		||||
 | 
			
		||||
	/* BN_is_bit_set(range, n - 1) always holds */
 | 
			
		||||
 | 
			
		||||
	if (n == 1)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_zero(r)) return 0;
 | 
			
		||||
		}
 | 
			
		||||
	else if (BN_is_bit_set(range, n - 2))
 | 
			
		||||
	else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3))
 | 
			
		||||
		{
 | 
			
		||||
		do
 | 
			
		||||
			{
 | 
			
		||||
			/* range = 11..._2, so each iteration succeeds with probability >= .75 */
 | 
			
		||||
			if (!BN_rand(r, n, -1, 0)) return 0;
 | 
			
		||||
			}
 | 
			
		||||
		while (BN_cmp(r, range) >= 0);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		/* range = 10..._2,
 | 
			
		||||
		/* range = 100..._2,
 | 
			
		||||
		 * so  3*range (= 11..._2)  is exactly one bit longer than  range */
 | 
			
		||||
		do
 | 
			
		||||
			{
 | 
			
		||||
			if (!BN_rand(r, n + 1, -1, 0)) return 0;
 | 
			
		||||
			if (!bn_rand(r, n + 1, -1, 0)) return 0;
 | 
			
		||||
			/* If  r < 3*range,  use  r := r MOD range
 | 
			
		||||
			 * (which is either  r, r - range,  or  r - 2*range).
 | 
			
		||||
			 * Otherwise, iterate once more.
 | 
			
		||||
@@ -218,6 +265,26 @@ int	BN_rand_range(BIGNUM *r, BIGNUM *range)
 | 
			
		||||
			}
 | 
			
		||||
		while (BN_cmp(r, range) >= 0);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		do
 | 
			
		||||
			{
 | 
			
		||||
			/* range = 11..._2  or  range = 101..._2 */
 | 
			
		||||
			if (!bn_rand(r, n, -1, 0)) return 0;
 | 
			
		||||
			}
 | 
			
		||||
		while (BN_cmp(r, range) >= 0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int	BN_rand_range(BIGNUM *r, BIGNUM *range)
 | 
			
		||||
	{
 | 
			
		||||
	return bn_rand_range(0, r, range);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int	BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range)
 | 
			
		||||
	{
 | 
			
		||||
	return bn_rand_range(1, r, range);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -245,7 +245,7 @@ printf(" bn_sqr_recursive %d * %d\n",n2,n2);
 | 
			
		||||
	if (!zero)
 | 
			
		||||
		bn_sqr_recursive(&(t[n2]),t,n,p);
 | 
			
		||||
	else
 | 
			
		||||
		memset(&(t[n2]),0,n*sizeof(BN_ULONG));
 | 
			
		||||
		memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
 | 
			
		||||
	bn_sqr_recursive(r,a,n,p);
 | 
			
		||||
	bn_sqr_recursive(&(r[n2]),&(a[n]),n,p);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -75,12 +75,11 @@ void	BUF_MEM_free(BUF_MEM *a);
 | 
			
		||||
int	BUF_MEM_grow(BUF_MEM *str, int len);
 | 
			
		||||
char *	BUF_strdup(const char *str);
 | 
			
		||||
 | 
			
		||||
void ERR_load_BUF_strings(void );
 | 
			
		||||
 | 
			
		||||
/* BEGIN ERROR CODES */
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_BUF_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the BUF functions. */
 | 
			
		||||
 | 
			
		||||
@@ -95,4 +94,3 @@ void ERR_load_BUF_strings(void );
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,10 +22,10 @@ TEST=
 | 
			
		||||
APPS=
 | 
			
		||||
 | 
			
		||||
LIB=$(TOP)/libcrypto.a
 | 
			
		||||
LIBSRC= comp_lib.c \
 | 
			
		||||
LIBSRC= comp_lib.c comp_err.c \
 | 
			
		||||
	c_rle.c c_zlib.c
 | 
			
		||||
 | 
			
		||||
LIBOBJ=	comp_lib.o \
 | 
			
		||||
LIBOBJ=	comp_lib.o comp_err.o \
 | 
			
		||||
	c_rle.o c_zlib.o
 | 
			
		||||
 | 
			
		||||
SRC= $(LIBSRC)
 | 
			
		||||
@@ -94,6 +94,11 @@ c_zlib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
 | 
			
		||||
c_zlib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
c_zlib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 | 
			
		||||
c_zlib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
comp_err.o: ../../include/openssl/bio.h ../../include/openssl/comp.h
 | 
			
		||||
comp_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
 | 
			
		||||
comp_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
 | 
			
		||||
comp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
comp_err.o: ../../include/openssl/symhacks.h
 | 
			
		||||
comp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
comp_lib.o: ../../include/openssl/bn.h ../../include/openssl/comp.h
 | 
			
		||||
comp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
 | 
			
		||||
 
 | 
			
		||||
@@ -47,6 +47,7 @@ COMP_METHOD *COMP_zlib(void );
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_COMP_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the COMP functions. */
 | 
			
		||||
 | 
			
		||||
@@ -58,4 +59,3 @@ COMP_METHOD *COMP_zlib(void );
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -108,7 +108,6 @@ long CONF_get_number(LHASH *conf,char *group,char *name);
 | 
			
		||||
void CONF_free(LHASH *conf);
 | 
			
		||||
int CONF_dump_fp(LHASH *conf, FILE *out);
 | 
			
		||||
int CONF_dump_bio(LHASH *conf, BIO *out);
 | 
			
		||||
void ERR_load_CONF_strings(void );
 | 
			
		||||
 | 
			
		||||
/* New conf code.  The semantics are different from the functions above.
 | 
			
		||||
   If that wasn't the case, the above functions would have been replaced */
 | 
			
		||||
@@ -145,6 +144,7 @@ int NCONF_dump_bio(CONF *conf, BIO *out);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_CONF_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the CONF functions. */
 | 
			
		||||
 | 
			
		||||
@@ -176,4 +176,3 @@ int NCONF_dump_bio(CONF *conf, BIO *out);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -90,6 +90,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
 | 
			
		||||
	"ssl_sess_cert",
 | 
			
		||||
	"ssl",
 | 
			
		||||
	"rand",
 | 
			
		||||
	"rand2",
 | 
			
		||||
	"debug_malloc",
 | 
			
		||||
	"BIO",
 | 
			
		||||
	"gethostbyname",
 | 
			
		||||
@@ -101,7 +102,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
 | 
			
		||||
	"dso",
 | 
			
		||||
	"dynlock",
 | 
			
		||||
	"engine",
 | 
			
		||||
#if CRYPTO_NUM_LOCKS != 29
 | 
			
		||||
#if CRYPTO_NUM_LOCKS != 30
 | 
			
		||||
# error "Inconsistency between crypto.h and cryptlib.c"
 | 
			
		||||
#endif
 | 
			
		||||
	};
 | 
			
		||||
@@ -228,7 +229,10 @@ void CRYPTO_destroy_dynlockid(int i)
 | 
			
		||||
	CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
 | 
			
		||||
	if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
 | 
			
		||||
		return;
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
 		return;
 | 
			
		||||
		}
 | 
			
		||||
	pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
 | 
			
		||||
	if (pointer != NULL)
 | 
			
		||||
		{
 | 
			
		||||
@@ -241,7 +245,7 @@ void CRYPTO_destroy_dynlockid(int i)
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
			if (--(pointer->references) <= 0)
 | 
			
		||||
			if (pointer->references <= 0)
 | 
			
		||||
				{
 | 
			
		||||
				sk_CRYPTO_dynlock_set(dyn_locks, i, NULL);
 | 
			
		||||
				}
 | 
			
		||||
@@ -396,16 +400,15 @@ void CRYPTO_lock(int mode, int type, const char *file, int line)
 | 
			
		||||
#endif
 | 
			
		||||
	if (type < 0)
 | 
			
		||||
		{
 | 
			
		||||
		int i = -type - 1;
 | 
			
		||||
		struct CRYPTO_dynlock_value *pointer
 | 
			
		||||
			= CRYPTO_get_dynlock_value(i);
 | 
			
		||||
			= CRYPTO_get_dynlock_value(type);
 | 
			
		||||
 | 
			
		||||
		if (pointer)
 | 
			
		||||
		if (pointer && dynlock_lock_callback)
 | 
			
		||||
			{
 | 
			
		||||
			dynlock_lock_callback(mode, pointer, file, line);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		CRYPTO_destroy_dynlockid(i);
 | 
			
		||||
		CRYPTO_destroy_dynlockid(type);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		if (locking_callback != NULL)
 | 
			
		||||
@@ -431,7 +434,6 @@ int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
 | 
			
		||||
			CRYPTO_get_lock_name(type),
 | 
			
		||||
			file,line);
 | 
			
		||||
#endif
 | 
			
		||||
		*pointer=ret;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -207,7 +207,8 @@ $ LIB_DH = "dh_gen,dh_key,dh_lib,dh_check,dh_err"
 | 
			
		||||
$ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
 | 
			
		||||
	"dso_openssl,dso_win32,dso_vms"
 | 
			
		||||
$ LIB_ENGINE = "engine_err,engine_lib,engine_list,engine_openssl,"+ -
 | 
			
		||||
	"hw_atalla,hw_cswift,hw_ncipher"
 | 
			
		||||
	"hw_atalla,hw_cswift,hw_ncipher,hw_aep,hw_sureware,"+ -
 | 
			
		||||
	"hw_ubsec"
 | 
			
		||||
$ LIB_BUFFER = "buffer,buf_err"
 | 
			
		||||
$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
 | 
			
		||||
	"bss_mem,bss_null,bss_fd,"+ -
 | 
			
		||||
@@ -1462,6 +1463,7 @@ $!
 | 
			
		||||
$! Save directory information
 | 
			
		||||
$!
 | 
			
		||||
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
 | 
			
		||||
$ __HERE = F$EDIT(__HERE,"UPCASE")
 | 
			
		||||
$ __TOP = __HERE - "CRYPTO]"
 | 
			
		||||
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
 | 
			
		||||
$!
 | 
			
		||||
 
 | 
			
		||||
@@ -112,18 +112,19 @@ extern "C" {
 | 
			
		||||
#define	CRYPTO_LOCK_SSL_SESS_CERT	15
 | 
			
		||||
#define	CRYPTO_LOCK_SSL			16
 | 
			
		||||
#define	CRYPTO_LOCK_RAND		17
 | 
			
		||||
#define	CRYPTO_LOCK_MALLOC		18
 | 
			
		||||
#define	CRYPTO_LOCK_BIO			19
 | 
			
		||||
#define	CRYPTO_LOCK_GETHOSTBYNAME	20
 | 
			
		||||
#define	CRYPTO_LOCK_GETSERVBYNAME	21
 | 
			
		||||
#define	CRYPTO_LOCK_READDIR		22
 | 
			
		||||
#define	CRYPTO_LOCK_RSA_BLINDING	23
 | 
			
		||||
#define	CRYPTO_LOCK_DH			24
 | 
			
		||||
#define	CRYPTO_LOCK_MALLOC2		25
 | 
			
		||||
#define	CRYPTO_LOCK_DSO			26
 | 
			
		||||
#define	CRYPTO_LOCK_DYNLOCK		27
 | 
			
		||||
#define	CRYPTO_LOCK_ENGINE		28
 | 
			
		||||
#define	CRYPTO_NUM_LOCKS		29
 | 
			
		||||
#define	CRYPTO_LOCK_RAND2		18
 | 
			
		||||
#define	CRYPTO_LOCK_MALLOC		19
 | 
			
		||||
#define	CRYPTO_LOCK_BIO			20
 | 
			
		||||
#define	CRYPTO_LOCK_GETHOSTBYNAME	21
 | 
			
		||||
#define	CRYPTO_LOCK_GETSERVBYNAME	22
 | 
			
		||||
#define	CRYPTO_LOCK_READDIR		23
 | 
			
		||||
#define	CRYPTO_LOCK_RSA_BLINDING	24
 | 
			
		||||
#define	CRYPTO_LOCK_DH			25
 | 
			
		||||
#define	CRYPTO_LOCK_MALLOC2		26
 | 
			
		||||
#define	CRYPTO_LOCK_DSO			27
 | 
			
		||||
#define	CRYPTO_LOCK_DYNLOCK		28
 | 
			
		||||
#define	CRYPTO_LOCK_ENGINE		29
 | 
			
		||||
#define	CRYPTO_NUM_LOCKS		30
 | 
			
		||||
 | 
			
		||||
#define CRYPTO_LOCK		1
 | 
			
		||||
#define CRYPTO_UNLOCK		2
 | 
			
		||||
@@ -351,6 +352,9 @@ int CRYPTO_push_info_(const char *info, const char *file, int line);
 | 
			
		||||
int CRYPTO_pop_info(void);
 | 
			
		||||
int CRYPTO_remove_all_info(void);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro;
 | 
			
		||||
 * used as default in CRYPTO_MDEBUG compilations): */
 | 
			
		||||
/* The last argument has the following significance:
 | 
			
		||||
 *
 | 
			
		||||
 * 0:	called before the actual memory allocation has taken place
 | 
			
		||||
@@ -359,18 +363,18 @@ int CRYPTO_remove_all_info(void);
 | 
			
		||||
void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p);
 | 
			
		||||
void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p);
 | 
			
		||||
void CRYPTO_dbg_free(void *addr,int before_p);
 | 
			
		||||
 | 
			
		||||
/* Tell the debugging code about options.  By default, the following values
 | 
			
		||||
 * apply:
 | 
			
		||||
 *
 | 
			
		||||
 * 0:	Clear all options.
 | 
			
		||||
 * 1:	Set the "Show Time" option.
 | 
			
		||||
 * 2:	Set the "Show Thread Number" option.
 | 
			
		||||
 * 3:	1 + 2
 | 
			
		||||
 * 0:                           Clear all options.
 | 
			
		||||
 * V_CRYPTO_MDEBUG_TIME (1):    Set the "Show Time" option.
 | 
			
		||||
 * V_CRYPTO_MDEBUG_THREAD (2):  Set the "Show Thread Number" option.
 | 
			
		||||
 * V_CRYPTO_MDEBUG_ALL (3):     1 + 2
 | 
			
		||||
 */
 | 
			
		||||
void CRYPTO_dbg_set_options(long bits);
 | 
			
		||||
long CRYPTO_dbg_get_options(void);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef NO_FP_API
 | 
			
		||||
void CRYPTO_mem_leaks_fp(FILE *);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -378,12 +382,11 @@ void CRYPTO_mem_leaks(struct bio_st *bio);
 | 
			
		||||
/* unsigned long order, char *file, int line, int num_bytes, char *addr */
 | 
			
		||||
void CRYPTO_mem_leaks_cb(void (*cb)(unsigned long, const char *, int, int, void *));
 | 
			
		||||
 | 
			
		||||
void ERR_load_CRYPTO_strings(void);
 | 
			
		||||
 | 
			
		||||
/* BEGIN ERROR CODES */
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_CRYPTO_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the CRYPTO functions. */
 | 
			
		||||
 | 
			
		||||
@@ -400,4 +403,3 @@ void ERR_load_CRYPTO_strings(void);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -186,12 +186,12 @@ int	DHparams_print(BIO *bp, DH *x);
 | 
			
		||||
#else
 | 
			
		||||
int	DHparams_print(char *bp, DH *x);
 | 
			
		||||
#endif
 | 
			
		||||
void	ERR_load_DH_strings(void );
 | 
			
		||||
 | 
			
		||||
/* BEGIN ERROR CODES */
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_DH_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the DH functions. */
 | 
			
		||||
 | 
			
		||||
@@ -210,4 +210,3 @@ void	ERR_load_DH_strings(void );
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -100,6 +100,8 @@ DH_METHOD *DH_OpenSSL(void)
 | 
			
		||||
static int generate_key(DH *dh)
 | 
			
		||||
	{
 | 
			
		||||
	int ok=0;
 | 
			
		||||
	int generate_new_key=0;
 | 
			
		||||
	unsigned l;
 | 
			
		||||
	BN_CTX ctx;
 | 
			
		||||
	BN_MONT_CTX *mont;
 | 
			
		||||
	BIGNUM *pub_key=NULL,*priv_key=NULL;
 | 
			
		||||
@@ -110,9 +112,7 @@ static int generate_key(DH *dh)
 | 
			
		||||
		{
 | 
			
		||||
		priv_key=BN_new();
 | 
			
		||||
		if (priv_key == NULL) goto err;
 | 
			
		||||
		do
 | 
			
		||||
			if (!BN_rand_range(priv_key, dh->p)) goto err;
 | 
			
		||||
		while (BN_is_zero(priv_key));
 | 
			
		||||
		generate_new_key=1;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		priv_key=dh->priv_key;
 | 
			
		||||
@@ -133,6 +133,11 @@ static int generate_key(DH *dh)
 | 
			
		||||
		}
 | 
			
		||||
	mont=(BN_MONT_CTX *)dh->method_mont_p;
 | 
			
		||||
 | 
			
		||||
 	if (generate_new_key)
 | 
			
		||||
 		{
 | 
			
		||||
 		l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */
 | 
			
		||||
 		if (!BN_rand(priv_key, l, 0, 0)) goto err;
 | 
			
		||||
 		}
 | 
			
		||||
	if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, pub_key, dh->g,
 | 
			
		||||
				priv_key,dh->p,&ctx,mont))
 | 
			
		||||
		goto err;
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@
 | 
			
		||||
 | 
			
		||||
const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
static DH_METHOD *default_DH_method;
 | 
			
		||||
static DH_METHOD *default_DH_method = NULL;
 | 
			
		||||
static int dh_meth_num = 0;
 | 
			
		||||
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -190,8 +190,6 @@ int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
 | 
			
		||||
int DSA_set_ex_data(DSA *d, int idx, void *arg);
 | 
			
		||||
void *DSA_get_ex_data(DSA *d, int idx);
 | 
			
		||||
 | 
			
		||||
void	ERR_load_DSA_strings(void );
 | 
			
		||||
 | 
			
		||||
DSA *	d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length);
 | 
			
		||||
DSA *	d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
 | 
			
		||||
DSA * 	d2i_DSAparams(DSA **a, unsigned char **pp, long length);
 | 
			
		||||
@@ -228,6 +226,7 @@ DH *DSA_dup_DH(DSA *r);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_DSA_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the DSA functions. */
 | 
			
		||||
 | 
			
		||||
@@ -248,9 +247,9 @@ DH *DSA_dup_DH(DSA *r);
 | 
			
		||||
 | 
			
		||||
/* Reason codes. */
 | 
			
		||||
#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE		 100
 | 
			
		||||
#define DSA_R_MISSING_PARAMETERS			 101
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -85,6 +85,7 @@ static ERR_STRING_DATA DSA_str_functs[]=
 | 
			
		||||
static ERR_STRING_DATA DSA_str_reasons[]=
 | 
			
		||||
	{
 | 
			
		||||
{DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE       ,"data too large for key size"},
 | 
			
		||||
{DSA_R_MISSING_PARAMETERS                ,"missing parameters"},
 | 
			
		||||
{0,NULL}
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@
 | 
			
		||||
 | 
			
		||||
const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
static DSA_METHOD *default_DSA_method;
 | 
			
		||||
static DSA_METHOD *default_DSA_method = NULL;
 | 
			
		||||
static int dsa_meth_num = 0;
 | 
			
		||||
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -106,6 +106,11 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
 | 
			
		||||
	int i,reason=ERR_R_BN_LIB;
 | 
			
		||||
	DSA_SIG *ret=NULL;
 | 
			
		||||
 | 
			
		||||
	if (!dsa->p || !dsa->q || !dsa->g)
 | 
			
		||||
		{
 | 
			
		||||
		reason=DSA_R_MISSING_PARAMETERS;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	BN_init(&m);
 | 
			
		||||
	BN_init(&xr);
 | 
			
		||||
	s=BN_new();
 | 
			
		||||
@@ -168,6 +173,11 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 | 
			
		||||
	BIGNUM k,*kinv=NULL,*r=NULL;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
 | 
			
		||||
	if (!dsa->p || !dsa->q || !dsa->g)
 | 
			
		||||
		{
 | 
			
		||||
		DSAerr(DSA_F_DSA_SIGN_SETUP,DSA_R_MISSING_PARAMETERS);
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
	if (ctx_in == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if ((ctx=BN_CTX_new()) == NULL) goto err;
 | 
			
		||||
@@ -231,6 +241,17 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
 | 
			
		||||
	BN_init(&u2);
 | 
			
		||||
	BN_init(&t1);
 | 
			
		||||
 | 
			
		||||
	if (BN_is_zero(sig->r) || sig->r->neg || BN_ucmp(sig->r, dsa->q) >= 0)
 | 
			
		||||
		{
 | 
			
		||||
		ret = 0;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	if (BN_is_zero(sig->s) || sig->s->neg || BN_ucmp(sig->s, dsa->q) >= 0)
 | 
			
		||||
		{
 | 
			
		||||
		ret = 0;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/* Calculate W = inv(S) mod Q
 | 
			
		||||
	 * save W in u2 */
 | 
			
		||||
	if ((BN_mod_inverse(&u2,sig->s,dsa->q,ctx)) == NULL) goto err;
 | 
			
		||||
 
 | 
			
		||||
@@ -194,12 +194,11 @@ DSO_METHOD *DSO_METHOD_win32(void);
 | 
			
		||||
/* If VMS is defined, use shared images. If not, return NULL. */
 | 
			
		||||
DSO_METHOD *DSO_METHOD_vms(void);
 | 
			
		||||
 | 
			
		||||
void ERR_load_DSO_strings(void);
 | 
			
		||||
 | 
			
		||||
/* BEGIN ERROR CODES */
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_DSO_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the DSO functions. */
 | 
			
		||||
 | 
			
		||||
@@ -247,4 +246,3 @@ void ERR_load_DSO_strings(void);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -259,8 +259,12 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym)
 | 
			
		||||
	{
 | 
			
		||||
	DSO_VMS_INTERNAL *ptr;
 | 
			
		||||
	int status;
 | 
			
		||||
#if 0
 | 
			
		||||
	int flags = (1<<4); /* LIB$M_FIS_MIXEDCASE, but this symbol isn't
 | 
			
		||||
                               defined in VMS older than 7.0 or so */
 | 
			
		||||
#else
 | 
			
		||||
	int flags = 0;
 | 
			
		||||
#endif
 | 
			
		||||
	struct dsc$descriptor_s symname_dsc;
 | 
			
		||||
	*sym = NULL;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -23,9 +23,11 @@ APPS=
 | 
			
		||||
 | 
			
		||||
LIB=$(TOP)/libcrypto.a
 | 
			
		||||
LIBSRC= engine_err.c engine_lib.c engine_list.c engine_openssl.c \
 | 
			
		||||
	hw_atalla.c hw_cswift.c hw_ncipher.c
 | 
			
		||||
	hw_atalla.c hw_cswift.c hw_ncipher.c hw_aep.c hw_sureware.c \
 | 
			
		||||
	hw_ubsec.c hw_keyclient.c
 | 
			
		||||
LIBOBJ= engine_err.o engine_lib.o engine_list.o engine_openssl.o \
 | 
			
		||||
	hw_atalla.o hw_cswift.o hw_ncipher.o
 | 
			
		||||
	hw_atalla.o hw_cswift.o hw_ncipher.o hw_aep.o hw_sureware.o \
 | 
			
		||||
	hw_ubsec.o hw_keyclient.o
 | 
			
		||||
 | 
			
		||||
SRC= $(LIBSRC)
 | 
			
		||||
 | 
			
		||||
@@ -156,6 +158,25 @@ engine_openssl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
engine_openssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
engine_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
engine_openssl.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
hw_aep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
hw_aep.o: ../cryptlib.h engine_int.h vendor_defns/aep.h
 | 
			
		||||
hw_atalla.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
hw_atalla.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
hw_atalla.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
@@ -196,6 +217,26 @@ hw_cswift.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
hw_cswift.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
hw_cswift.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
 | 
			
		||||
hw_cswift.o: vendor_defns/cswift.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
hw_keyclient.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
 | 
			
		||||
hw_keyclient.o: vendor_defns/keyclient.h
 | 
			
		||||
hw_ncipher.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
hw_ncipher.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
hw_ncipher.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
@@ -218,3 +259,45 @@ hw_ncipher.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
hw_ncipher.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
hw_ncipher.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
hw_ncipher.o: ../cryptlib.h engine_int.h vendor_defns/hwcryptohook.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
hw_sureware.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
hw_sureware.o: ../cryptlib.h engine.h engine_int.h vendor_defns/sureware.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
hw_ubsec.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
 | 
			
		||||
hw_ubsec.o: vendor_defns/hw_ubsec.h
 | 
			
		||||
 
 | 
			
		||||
@@ -276,9 +276,6 @@ int ENGINE_set_default_BN_mod_exp_crt(ENGINE *e);
 | 
			
		||||
 * ENGINE_METHOD_*** defines above. */
 | 
			
		||||
int ENGINE_set_default(ENGINE *e, unsigned int flags);
 | 
			
		||||
 | 
			
		||||
/* Obligatory error function. */
 | 
			
		||||
void ERR_load_ENGINE_strings(void);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Error codes for all engine functions. NB: We use "generic"
 | 
			
		||||
 * function names instead of per-implementation ones because this
 | 
			
		||||
@@ -293,10 +290,17 @@ void ERR_load_ENGINE_strings(void);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_ENGINE_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the ENGINE functions. */
 | 
			
		||||
 | 
			
		||||
/* Function codes. */
 | 
			
		||||
#define ENGINE_F_AEP_FINISH				 156
 | 
			
		||||
#define ENGINE_F_AEP_INIT				 157
 | 
			
		||||
#define ENGINE_F_AEP_MOD_EXP				 158
 | 
			
		||||
#define ENGINE_F_AEP_MOD_EXP_CRT			 160
 | 
			
		||||
#define ENGINE_F_AEP_RAND				 161
 | 
			
		||||
#define ENGINE_F_AEP_RSA_MOD_EXP			 159
 | 
			
		||||
#define ENGINE_F_ATALLA_FINISH				 135
 | 
			
		||||
#define ENGINE_F_ATALLA_INIT				 136
 | 
			
		||||
#define ENGINE_F_ATALLA_MOD_EXP				 137
 | 
			
		||||
@@ -356,9 +360,55 @@ void ERR_load_ENGINE_strings(void);
 | 
			
		||||
#define ENGINE_F_HWCRHK_MOD_EXP_CRT			 138
 | 
			
		||||
#define ENGINE_F_HWCRHK_RAND_BYTES			 139
 | 
			
		||||
#define ENGINE_F_HWCRHK_RSA_MOD_EXP			 140
 | 
			
		||||
#define ENGINE_F_KC_INT_DSA_PRIV			 213
 | 
			
		||||
#define ENGINE_F_KC_INT_DSA_VERIFY			 214
 | 
			
		||||
#define ENGINE_F_KC_INT_RSA_PRIV			 215
 | 
			
		||||
#define ENGINE_F_KC_INT_RSA_PUB				 216
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_CHECK_GLOBAL			 217
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_DSA_FINISH			 218
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_DSA_INIT			 219
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_DSA_SIGN			 220
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_DSA_VERIFY			 221
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_FINISH			 222
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_GET_DSA_CTX			 223
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_GET_RSA_CTX			 224
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_INIT				 225
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_PADDING			 226
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_RSA_FINISH			 227
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_RSA_INIT			 228
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_RSA_PRIV_DEC			 229
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_RSA_PRIV_ENC			 230
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_RSA_PUB_DEC			 231
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_RSA_PUB_ENC			 232
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_SET_DSA_CTX			 233
 | 
			
		||||
#define ENGINE_F_KEYCLIENT_SET_RSA_CTX			 234
 | 
			
		||||
#define ENGINE_F_LOG_MESSAGE				 141
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_CTRL			 209
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_DH_GEN_KEY			 210
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_DSA_DO_SIGN			 211
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_EX_FREE			 206
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_FINISH			 201
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_INIT			 200
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY		 204
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY		 205
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_MOD_EXP			 212
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_RAND_BYTES			 202
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_RAND_SEED			 203
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_RSA_PRIV_DEC		 207
 | 
			
		||||
#define ENGINE_F_SUREWAREHK_RSA_PRIV_ENC		 208
 | 
			
		||||
#define ENGINE_F_UBSEC_CTRL				 176
 | 
			
		||||
#define ENGINE_F_UBSEC_DH_COMPUTE_KEY			 171
 | 
			
		||||
#define ENGINE_F_UBSEC_DSA_SIGN				 163
 | 
			
		||||
#define ENGINE_F_UBSEC_DSA_VERIFY			 164
 | 
			
		||||
#define ENGINE_F_UBSEC_FINISH				 165
 | 
			
		||||
#define ENGINE_F_UBSEC_INIT				 166
 | 
			
		||||
#define ENGINE_F_UBSEC_MOD_EXP				 167
 | 
			
		||||
#define ENGINE_F_UBSEC_RNG_BYTES			 172
 | 
			
		||||
#define ENGINE_F_UBSEC_RSA_MOD_EXP			 168
 | 
			
		||||
#define ENGINE_F_UBSEC_RSA_MOD_EXP_CRT			 169
 | 
			
		||||
 | 
			
		||||
/* Reason codes. */
 | 
			
		||||
#define ENGINE_R_AEP_INIT_FAILURE			 132
 | 
			
		||||
#define ENGINE_R_ALREADY_LOADED				 100
 | 
			
		||||
#define ENGINE_R_BIO_WAS_FREED				 121
 | 
			
		||||
#define ENGINE_R_BN_CTX_FULL				 101
 | 
			
		||||
@@ -372,14 +422,20 @@ void ERR_load_ENGINE_strings(void);
 | 
			
		||||
#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY		 129
 | 
			
		||||
#define ENGINE_R_FINISH_FAILED				 106
 | 
			
		||||
#define ENGINE_R_GET_HANDLE_FAILED			 107
 | 
			
		||||
#define ENGINE_R_GET_RANDOM_FAILED			 133
 | 
			
		||||
#define ENGINE_R_ID_OR_NAME_MISSING			 108
 | 
			
		||||
#define ENGINE_R_INIT_FAILED				 109
 | 
			
		||||
#define ENGINE_R_INTERNAL_LIST_ERROR			 110
 | 
			
		||||
#define ENGINE_R_INVALID_PADDING			 137
 | 
			
		||||
#define ENGINE_R_KEY_TOO_LARGE				 138
 | 
			
		||||
#define ENGINE_R_MISSING_KEY_COMPONENTS			 111
 | 
			
		||||
#define ENGINE_R_MOD_EXP_CRT_FAILED			 134
 | 
			
		||||
#define ENGINE_R_MOD_EXP_FAILED				 131
 | 
			
		||||
#define ENGINE_R_NOT_INITIALISED			 117
 | 
			
		||||
#define ENGINE_R_NOT_LOADED				 112
 | 
			
		||||
#define ENGINE_R_NO_CALLBACK				 127
 | 
			
		||||
#define ENGINE_R_NO_CONTROL_FUNCTION			 120
 | 
			
		||||
#define ENGINE_R_NO_INDEX				 139
 | 
			
		||||
#define ENGINE_R_NO_KEY					 124
 | 
			
		||||
#define ENGINE_R_NO_LOAD_FUNCTION			 125
 | 
			
		||||
#define ENGINE_R_NO_REFERENCE				 130
 | 
			
		||||
@@ -388,6 +444,8 @@ void ERR_load_ENGINE_strings(void);
 | 
			
		||||
#define ENGINE_R_PROVIDE_PARAMETERS			 113
 | 
			
		||||
#define ENGINE_R_REQUEST_FAILED				 114
 | 
			
		||||
#define ENGINE_R_REQUEST_FALLBACK			 118
 | 
			
		||||
#define ENGINE_R_RETURN_CONNECTION_FAILED		 135
 | 
			
		||||
#define ENGINE_R_SETBNCALLBACK_FAILURE			 136
 | 
			
		||||
#define ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL		 122
 | 
			
		||||
#define ENGINE_R_UNIT_FAILURE				 115
 | 
			
		||||
 | 
			
		||||
@@ -395,4 +453,3 @@ void ERR_load_ENGINE_strings(void);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -66,6 +66,12 @@
 | 
			
		||||
#ifndef NO_ERR
 | 
			
		||||
static ERR_STRING_DATA ENGINE_str_functs[]=
 | 
			
		||||
	{
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_AEP_FINISH,0),	"AEP_FINISH"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_AEP_INIT,0),	"AEP_INIT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_AEP_MOD_EXP,0),	"AEP_MOD_EXP"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_AEP_MOD_EXP_CRT,0),	"AEP_MOD_EXP_CRT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_AEP_RAND,0),	"AEP_RAND"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_AEP_RSA_MOD_EXP,0),	"AEP_RSA_MOD_EXP"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_ATALLA_FINISH,0),	"ATALLA_FINISH"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_ATALLA_INIT,0),	"ATALLA_INIT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_ATALLA_MOD_EXP,0),	"ATALLA_MOD_EXP"},
 | 
			
		||||
@@ -125,12 +131,58 @@ static ERR_STRING_DATA ENGINE_str_functs[]=
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP_CRT,0),	"HWCRHK_MOD_EXP_CRT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_HWCRHK_RAND_BYTES,0),	"HWCRHK_RAND_BYTES"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_HWCRHK_RSA_MOD_EXP,0),	"HWCRHK_RSA_MOD_EXP"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KC_INT_DSA_PRIV,0),	"KC_INT_DSA_PRIV"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KC_INT_DSA_VERIFY,0),	"KC_INT_DSA_VERIFY"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KC_INT_RSA_PRIV,0),	"KC_INT_RSA_PRIV"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KC_INT_RSA_PUB,0),	"KC_INT_RSA_PUB"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_CHECK_GLOBAL,0),	"KEYCLIENT_CHECK_GLOBAL"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_FINISH,0),	"KEYCLIENT_DSA_FINISH"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_INIT,0),	"KEYCLIENT_DSA_INIT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_SIGN,0),	"KEYCLIENT_DSA_SIGN"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_DSA_VERIFY,0),	"KEYCLIENT_DSA_VERIFY"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_FINISH,0),	"KEYCLIENT_FINISH"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_GET_DSA_CTX,0),	"KEYCLIENT_GET_DSA_CTX"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_GET_RSA_CTX,0),	"KEYCLIENT_GET_RSA_CTX"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_INIT,0),	"KEYCLIENT_INIT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_PADDING,0),	"KEYCLIENT_PADDING"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_FINISH,0),	"KEYCLIENT_RSA_FINISH"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_INIT,0),	"KEYCLIENT_RSA_INIT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PRIV_DEC,0),	"KEYCLIENT_RSA_PRIV_DEC"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PRIV_ENC,0),	"KEYCLIENT_RSA_PRIV_ENC"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PUB_DEC,0),	"KEYCLIENT_RSA_PUB_DEC"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_RSA_PUB_ENC,0),	"KEYCLIENT_RSA_PUB_ENC"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_SET_DSA_CTX,0),	"KEYCLIENT_SET_DSA_CTX"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_KEYCLIENT_SET_RSA_CTX,0),	"KEYCLIENT_SET_RSA_CTX"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_LOG_MESSAGE,0),	"LOG_MESSAGE"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_CTRL,0),	"SUREWAREHK_CTRL"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_DH_GEN_KEY,0),	"SUREWAREHK_DH_GEN_KEY"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_DSA_DO_SIGN,0),	"SUREWAREHK_DSA_DO_SIGN"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_EX_FREE,0),	"SUREWAREHK_EX_FREE"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_FINISH,0),	"SUREWAREHK_FINISH"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_INIT,0),	"SUREWAREHK_INIT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,0),	"SUREWAREHK_LOAD_PRIVATE_KEY"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,0),	"SUREWAREHK_LOAD_PUBLIC_KEY"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_MOD_EXP,0),	"SUREWAREHK_MOD_EXP"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RAND_BYTES,0),	"SUREWAREHK_RAND_BYTES"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RAND_SEED,0),	"SUREWAREHK_RAND_SEED"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,0),	"SUREWAREHK_RSA_PRIV_DEC"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,0),	"SUREWAREHK_RSA_PRIV_ENC"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_CTRL,0),	"UBSEC_CTRL"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_DH_COMPUTE_KEY,0),	"UBSEC_DH_COMPUTE_KEY"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_DSA_SIGN,0),	"UBSEC_DSA_SIGN"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_DSA_VERIFY,0),	"UBSEC_DSA_VERIFY"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_FINISH,0),	"UBSEC_FINISH"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_INIT,0),	"UBSEC_INIT"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_MOD_EXP,0),	"UBSEC_MOD_EXP"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_RNG_BYTES,0),	"UBSEC_RNG_BYTES"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_RSA_MOD_EXP,0),	"UBSEC_RSA_MOD_EXP"},
 | 
			
		||||
{ERR_PACK(0,ENGINE_F_UBSEC_RSA_MOD_EXP_CRT,0),	"UBSEC_RSA_MOD_EXP_CRT"},
 | 
			
		||||
{0,NULL}
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
static ERR_STRING_DATA ENGINE_str_reasons[]=
 | 
			
		||||
	{
 | 
			
		||||
{ENGINE_R_AEP_INIT_FAILURE               ,"aep init failure"},
 | 
			
		||||
{ENGINE_R_ALREADY_LOADED                 ,"already loaded"},
 | 
			
		||||
{ENGINE_R_BIO_WAS_FREED                  ,"bio was freed"},
 | 
			
		||||
{ENGINE_R_BN_CTX_FULL                    ,"BN_CTX full"},
 | 
			
		||||
@@ -144,22 +196,30 @@ static ERR_STRING_DATA ENGINE_str_reasons[]=
 | 
			
		||||
{ENGINE_R_FAILED_LOADING_PUBLIC_KEY      ,"failed loading public key"},
 | 
			
		||||
{ENGINE_R_FINISH_FAILED                  ,"finish failed"},
 | 
			
		||||
{ENGINE_R_GET_HANDLE_FAILED              ,"could not obtain hardware handle"},
 | 
			
		||||
{ENGINE_R_GET_RANDOM_FAILED              ,"get random failed"},
 | 
			
		||||
{ENGINE_R_ID_OR_NAME_MISSING             ,"'id' or 'name' missing"},
 | 
			
		||||
{ENGINE_R_INIT_FAILED                    ,"init failed"},
 | 
			
		||||
{ENGINE_R_INTERNAL_LIST_ERROR            ,"internal list error"},
 | 
			
		||||
{ENGINE_R_INVALID_PADDING                ,"invalid padding"},
 | 
			
		||||
{ENGINE_R_KEY_TOO_LARGE                  ,"key too large"},
 | 
			
		||||
{ENGINE_R_MISSING_KEY_COMPONENTS         ,"missing key components"},
 | 
			
		||||
{ENGINE_R_MOD_EXP_CRT_FAILED             ,"mod exp crt failed"},
 | 
			
		||||
{ENGINE_R_MOD_EXP_FAILED                 ,"mod exp failed"},
 | 
			
		||||
{ENGINE_R_NOT_INITIALISED                ,"not initialised"},
 | 
			
		||||
{ENGINE_R_NOT_LOADED                     ,"not loaded"},
 | 
			
		||||
{ENGINE_R_NO_CALLBACK                    ,"no callback"},
 | 
			
		||||
{ENGINE_R_NO_CONTROL_FUNCTION            ,"no control function"},
 | 
			
		||||
{ENGINE_R_NO_INDEX                       ,"no index"},
 | 
			
		||||
{ENGINE_R_NO_KEY                         ,"no key"},
 | 
			
		||||
{ENGINE_R_NO_LOAD_FUNCTION               ,"no load function"},
 | 
			
		||||
{ENGINE_R_NO_REFERENCE			 ,"no reference"},
 | 
			
		||||
{ENGINE_R_NO_REFERENCE                   ,"no reference"},
 | 
			
		||||
{ENGINE_R_NO_SUCH_ENGINE                 ,"no such engine"},
 | 
			
		||||
{ENGINE_R_NO_UNLOAD_FUNCTION             ,"no unload function"},
 | 
			
		||||
{ENGINE_R_PROVIDE_PARAMETERS             ,"provide parameters"},
 | 
			
		||||
{ENGINE_R_REQUEST_FAILED                 ,"request failed"},
 | 
			
		||||
{ENGINE_R_REQUEST_FALLBACK               ,"request fallback"},
 | 
			
		||||
{ENGINE_R_RETURN_CONNECTION_FAILED       ,"return connection failed"},
 | 
			
		||||
{ENGINE_R_SETBNCALLBACK_FAILURE          ,"setbncallback failure"},
 | 
			
		||||
{ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL    ,"size too large or too small"},
 | 
			
		||||
{ENGINE_R_UNIT_FAILURE                   ,"unit failure"},
 | 
			
		||||
{0,NULL}
 | 
			
		||||
 
 | 
			
		||||
@@ -151,6 +151,25 @@ ENGINE *ENGINE_ncipher();
 | 
			
		||||
ENGINE *ENGINE_atalla();
 | 
			
		||||
#endif /* !NO_HW_ATALLA */
 | 
			
		||||
 | 
			
		||||
#ifndef NO_HW_AEP
 | 
			
		||||
/* Returns a structure of AEP methods. */
 | 
			
		||||
ENGINE *ENGINE_aep();
 | 
			
		||||
#endif /* !NO_HW_AEP */
 | 
			
		||||
 | 
			
		||||
#ifndef NO_HW_SUREWARE
 | 
			
		||||
/* Returns a structure of atalla methods. */
 | 
			
		||||
ENGINE *ENGINE_sureware();
 | 
			
		||||
#endif /* !NO_HW_SUREWARE */
 | 
			
		||||
 | 
			
		||||
#ifndef NO_HW_UBSEC
 | 
			
		||||
/* Returns a structure of ubsec methods. */
 | 
			
		||||
ENGINE *ENGINE_ubsec();
 | 
			
		||||
#endif /* !NO_HW_UBSEC */
 | 
			
		||||
 | 
			
		||||
#ifndef NO_HW_KEYCLIENT
 | 
			
		||||
/* Returns a structure of keyclient methods. */
 | 
			
		||||
ENGINE *ENGINE_keyclient();
 | 
			
		||||
#endif /* !NO_HW_KEYCLIENT */
 | 
			
		||||
#endif /* !NO_HW */
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
 
 | 
			
		||||
@@ -198,6 +198,22 @@ static int engine_internal_check(void)
 | 
			
		||||
	if(!engine_list_add(ENGINE_atalla()))
 | 
			
		||||
		return 0;
 | 
			
		||||
#endif /* !NO_HW_ATALLA */
 | 
			
		||||
#ifndef NO_HW_AEP
 | 
			
		||||
	if(!engine_list_add(ENGINE_aep()))
 | 
			
		||||
		return 0;
 | 
			
		||||
#endif /* !NO_HW_AEP */
 | 
			
		||||
#ifndef NO_HW_SUREWARE
 | 
			
		||||
       if(!engine_list_add(ENGINE_sureware()))
 | 
			
		||||
                return 0;
 | 
			
		||||
#endif /* !NO_HW_SUREWARE */
 | 
			
		||||
#ifndef NO_HW_UBSEC
 | 
			
		||||
	if(!engine_list_add(ENGINE_ubsec()))
 | 
			
		||||
		return 0;
 | 
			
		||||
#endif /* !NO_HW_UBSEC */
 | 
			
		||||
#ifndef NO_HW_KEYCLIENT
 | 
			
		||||
	if(!engine_list_add(ENGINE_keyclient()))
 | 
			
		||||
		return 0;
 | 
			
		||||
#endif /* !NO_HW_KEYCLIENT */
 | 
			
		||||
#endif /* !NO_HW */
 | 
			
		||||
	engine_list_flag = 1;
 | 
			
		||||
	return 1;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										840
									
								
								crypto/engine/hw_aep.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										840
									
								
								crypto/engine/hw_aep.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,840 @@
 | 
			
		||||
/* crypto/engine/hw_aep.c */
 | 
			
		||||
/*
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1999 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>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/dso.h>
 | 
			
		||||
#include "engine_int.h"
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#ifndef NO_HW
 | 
			
		||||
#ifndef NO_HW_AEP
 | 
			
		||||
#ifdef FLAT_INC
 | 
			
		||||
#include "aep.h"
 | 
			
		||||
#else
 | 
			
		||||
#include "vendor_defns/aep.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int aep_init(void);
 | 
			
		||||
static int aep_finish(void);
 | 
			
		||||
static int aep_get_connection(unsigned int *hConnection);
 | 
			
		||||
static int aep_return_connection(unsigned int hConnection);
 | 
			
		||||
 | 
			
		||||
/* BIGNUM stuff */
 | 
			
		||||
static int aep_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
		       const BIGNUM *m, BN_CTX *ctx);
 | 
			
		||||
 | 
			
		||||
/* RSA stuff */
 | 
			
		||||
static int aep_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa);
 | 
			
		||||
/* This function is aliased to mod_exp (with the mont stuff dropped). */
 | 
			
		||||
static int aep_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
			    const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 | 
			
		||||
 | 
			
		||||
/* DSA stuff */
 | 
			
		||||
static int aep_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
 | 
			
		||||
			   BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
 | 
			
		||||
			   BN_CTX *ctx, BN_MONT_CTX *in_mont);
 | 
			
		||||
 | 
			
		||||
static int aep_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
 | 
			
		||||
			   const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
 | 
			
		||||
			   BN_MONT_CTX *m_ctx);
 | 
			
		||||
 | 
			
		||||
/* DH stuff */
 | 
			
		||||
/* This function is aliased to mod_exp (with the DH and mont dropped). */
 | 
			
		||||
static int aep_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
			  const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 | 
			
		||||
		
 | 
			
		||||
/* rand stuff   */
 | 
			
		||||
static int aep_rand(unsigned char *buf, int num);
 | 
			
		||||
 | 
			
		||||
/* Our internal RSA_METHOD that we provide pointers to */
 | 
			
		||||
static RSA_METHOD aep_rsa =
 | 
			
		||||
{
 | 
			
		||||
  "Aep RSA method",
 | 
			
		||||
  NULL,                /*rsa_pub_encrypt*/
 | 
			
		||||
  NULL,                /*rsa_pub_decrypt*/
 | 
			
		||||
  NULL,                /*rsa_priv_encrypt*/
 | 
			
		||||
  NULL,                /*rsa_priv_encrypt*/
 | 
			
		||||
  aep_rsa_mod_exp,     /*rsa_mod_exp*/
 | 
			
		||||
  aep_mod_exp_mont,    /*bn_mod_exp*/
 | 
			
		||||
  NULL,                /*init*/
 | 
			
		||||
  NULL,                /*finish*/
 | 
			
		||||
  0,                   /*flags*/
 | 
			
		||||
  NULL,                /*app_data*/
 | 
			
		||||
  NULL,                /*rsa_sign*/
 | 
			
		||||
  NULL                 /*rsa_verify*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Our internal DSA_METHOD that we provide pointers to */
 | 
			
		||||
static DSA_METHOD aep_dsa =
 | 
			
		||||
{
 | 
			
		||||
  "Aep DSA method",
 | 
			
		||||
  NULL,                /* dsa_do_sign */
 | 
			
		||||
  NULL,                /* dsa_sign_setup */
 | 
			
		||||
  NULL,                /* dsa_do_verify */
 | 
			
		||||
  aep_dsa_mod_exp,     /* dsa_mod_exp */
 | 
			
		||||
  aep_mod_exp_dsa,     /* bn_mod_exp */
 | 
			
		||||
  NULL,                /* init */
 | 
			
		||||
  NULL,                /* finish */
 | 
			
		||||
  0,                   /* flags */
 | 
			
		||||
  NULL                 /* app_data */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Our internal DH_METHOD that we provide pointers to */
 | 
			
		||||
static DH_METHOD aep_dh =
 | 
			
		||||
{
 | 
			
		||||
  "Aep DH method",
 | 
			
		||||
  NULL,
 | 
			
		||||
  NULL,
 | 
			
		||||
  aep_mod_exp_dh,
 | 
			
		||||
  NULL,
 | 
			
		||||
  NULL,
 | 
			
		||||
  0,
 | 
			
		||||
  NULL
 | 
			
		||||
};
 | 
			
		||||
/* our internal RAND_method that we provide pointers to  */
 | 
			
		||||
static RAND_METHOD aep_random =
 | 
			
		||||
{
 | 
			
		||||
  /*"AEP RAND method", */
 | 
			
		||||
  NULL,
 | 
			
		||||
  aep_rand,
 | 
			
		||||
  NULL,
 | 
			
		||||
  NULL,
 | 
			
		||||
  aep_rand,
 | 
			
		||||
  NULL,
 | 
			
		||||
};
 | 
			
		||||
	
 | 
			
		||||
/* Our ENGINE structure. */
 | 
			
		||||
static ENGINE engine_aep =
 | 
			
		||||
{
 | 
			
		||||
  "aep",
 | 
			
		||||
  "Aep hardware engine support",
 | 
			
		||||
  &aep_rsa,
 | 
			
		||||
  &aep_dsa,
 | 
			
		||||
  &aep_dh,
 | 
			
		||||
  &aep_random,
 | 
			
		||||
  aep_mod_exp,
 | 
			
		||||
  NULL,
 | 
			
		||||
  aep_init,
 | 
			
		||||
  aep_finish,
 | 
			
		||||
  NULL, /* no ctrl() */
 | 
			
		||||
  NULL, /* no load_privkey() */
 | 
			
		||||
  NULL, /* no load_pubkey() */
 | 
			
		||||
  0, /* no flags */
 | 
			
		||||
  0, 0, /* no references */
 | 
			
		||||
  NULL, NULL /* unlinked */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*Define an array of structures to hold connections*/
 | 
			
		||||
static AEP_CONNECTION_ENTRY aep_app_conn_table[MAX_PROCESS_CONNECTIONS];
 | 
			
		||||
 | 
			
		||||
/*Used to determine if this is a new process*/
 | 
			
		||||
static pid_t    recorded_pid = 0;
 | 
			
		||||
 | 
			
		||||
static int rnd_reference;
 | 
			
		||||
 | 
			
		||||
static AEP_U8   rand_block[RAND_BLK_SIZE];
 | 
			
		||||
static AEP_U32  rand_block_bytes = 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* As this is only ever called once, there's no need for locking
 | 
			
		||||
 * (indeed - the lock will already be held by our caller!!!) */
 | 
			
		||||
ENGINE *ENGINE_aep()
 | 
			
		||||
{
 | 
			
		||||
  RSA_METHOD  *meth1;
 | 
			
		||||
  DSA_METHOD  *meth2;
 | 
			
		||||
  DH_METHOD   *meth3;
 | 
			
		||||
 | 
			
		||||
  /* We know that the "PKCS1_SSLeay()" functions hook properly
 | 
			
		||||
   * to the aep-specific mod_exp and mod_exp_crt so we use
 | 
			
		||||
   * those functions. NB: We don't use ENGINE_openssl() or
 | 
			
		||||
   * anything "more generic" because something like the RSAref
 | 
			
		||||
   * code may not hook properly, and if you own one of these
 | 
			
		||||
   * cards then you have the right to do RSA operations on it
 | 
			
		||||
   * anyway! */
 | 
			
		||||
  meth1 = RSA_PKCS1_SSLeay();
 | 
			
		||||
  aep_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
 | 
			
		||||
  aep_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
 | 
			
		||||
  aep_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
 | 
			
		||||
  aep_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /* Use the DSA_OpenSSL() method and just hook the mod_exp-ish
 | 
			
		||||
   * bits. */
 | 
			
		||||
  meth2 = DSA_OpenSSL();
 | 
			
		||||
  aep_dsa.dsa_do_sign    = meth2->dsa_do_sign;
 | 
			
		||||
  aep_dsa.dsa_sign_setup = meth2->dsa_sign_setup;
 | 
			
		||||
  aep_dsa.dsa_do_verify  = meth2->dsa_do_verify;
 | 
			
		||||
 | 
			
		||||
  aep_dsa = *DSA_get_default_openssl_method(); 
 | 
			
		||||
  aep_dsa.dsa_mod_exp = aep_dsa_mod_exp; 
 | 
			
		||||
  aep_dsa.bn_mod_exp = aep_mod_exp_dsa;      
 | 
			
		||||
 | 
			
		||||
  /* Much the same for Diffie-Hellman */
 | 
			
		||||
  meth3 = DH_OpenSSL();
 | 
			
		||||
  aep_dh.generate_key = meth3->generate_key;
 | 
			
		||||
  aep_dh.compute_key  = meth3->compute_key;
 | 
			
		||||
  aep_dh.bn_mod_exp   = meth3->bn_mod_exp;
 | 
			
		||||
 | 
			
		||||
  return &engine_aep;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This is a process-global DSO handle used for loading and unloading
 | 
			
		||||
 * the Aep library. NB: This is only set (or unset) during an
 | 
			
		||||
 * init() or finish() call (reference counts permitting) and they're
 | 
			
		||||
 * operating with global locks, so this should be thread-safe
 | 
			
		||||
 * implicitly. */
 | 
			
		||||
static DSO *aep_dso = NULL;
 | 
			
		||||
 | 
			
		||||
/* These are the function pointers that are (un)set when the library has
 | 
			
		||||
 * successfully (un)loaded. */
 | 
			
		||||
static t_AEP_OpenConnection    *p_AEP_OpenConnection  = NULL;
 | 
			
		||||
static t_AEP_ModExp            *p_AEP_ModExp          = NULL;
 | 
			
		||||
static t_AEP_ModExpCrt         *p_AEP_ModExpCrt       = NULL;
 | 
			
		||||
static t_AEP_GenRandom         *p_AEP_GenRandom       = NULL;
 | 
			
		||||
static t_AEP_Initialize        *p_AEP_Initialize      = NULL;
 | 
			
		||||
static t_AEP_Finalize          *p_AEP_Finalize        = NULL;
 | 
			
		||||
static t_AEP_SetBNCallBacks    *p_AEP_SetBNCallBacks  = NULL;
 | 
			
		||||
 | 
			
		||||
/* (de)initialisation functions. */
 | 
			
		||||
static int aep_init()
 | 
			
		||||
{
 | 
			
		||||
  t_AEP_ModExp          *p1;
 | 
			
		||||
  t_AEP_ModExpCrt       *p2;
 | 
			
		||||
  t_AEP_GenRandom       *p3;
 | 
			
		||||
  t_AEP_Finalize        *p4;
 | 
			
		||||
  t_AEP_Initialize      *p5;
 | 
			
		||||
  t_AEP_OpenConnection  *p6;
 | 
			
		||||
  t_AEP_SetBNCallBacks  *p7;
 | 
			
		||||
 | 
			
		||||
  unsigned int hConnection,rv;
 | 
			
		||||
 | 
			
		||||
  int to_return = 0;
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
  if(aep_dso != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_ALREADY_LOADED);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
  /* Attempt to load libaep.so. */
 | 
			
		||||
 | 
			
		||||
  aep_dso = DSO_load(NULL, AEP_LIBNAME, NULL,
 | 
			
		||||
		     DSO_FLAG_NAME_TRANSLATION);
 | 
			
		||||
  
 | 
			
		||||
  if(aep_dso == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_DSO_FAILURE);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if(!(p1 = (t_AEP_ModExp *)         DSO_bind_func( aep_dso,AEP_F1))  ||
 | 
			
		||||
     !(p2 = (t_AEP_ModExpCrt*)       DSO_bind_func( aep_dso,AEP_F2))  ||
 | 
			
		||||
     !(p3 = (t_AEP_GenRandom*)       DSO_bind_func( aep_dso,AEP_F3))  ||
 | 
			
		||||
     !(p4 = (t_AEP_Finalize*)        DSO_bind_func( aep_dso,AEP_F4))  ||
 | 
			
		||||
     !(p5 = (t_AEP_Initialize*)      DSO_bind_func( aep_dso,AEP_F5))  ||
 | 
			
		||||
     !(p6 = (t_AEP_OpenConnection*)  DSO_bind_func( aep_dso,AEP_F6))  ||
 | 
			
		||||
     !(p7 = (t_AEP_SetBNCallBacks*)  DSO_bind_func( aep_dso,AEP_F7)))
 | 
			
		||||
    {
 | 
			
		||||
     
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_DSO_FAILURE);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Copy the pointers */
 | 
			
		||||
  
 | 
			
		||||
  p_AEP_ModExp           = p1;
 | 
			
		||||
  p_AEP_ModExpCrt        = p2;
 | 
			
		||||
  p_AEP_GenRandom        = p3;
 | 
			
		||||
  p_AEP_Finalize         = p4;
 | 
			
		||||
  p_AEP_Initialize       = p5;
 | 
			
		||||
  p_AEP_OpenConnection   = p6;
 | 
			
		||||
  p_AEP_SetBNCallBacks   = p7;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /* Perform a basic test to see if there's actually any unit
 | 
			
		||||
   * running. */
 | 
			
		||||
	
 | 
			
		||||
  CRYPTO_add(&rnd_reference, 1, CRYPTO_LOCK_DYNLOCK); 
 | 
			
		||||
  
 | 
			
		||||
  rv = aep_get_connection(&hConnection);
 | 
			
		||||
     
 | 
			
		||||
  if (rv != AEP_R_OK)     
 | 
			
		||||
       goto err;
 | 
			
		||||
   
 | 
			
		||||
  /* Everything's fine. */
 | 
			
		||||
 
 | 
			
		||||
  rv = aep_return_connection(hConnection);
 | 
			
		||||
 
 | 
			
		||||
  to_return = 1;
 | 
			
		||||
 
 | 
			
		||||
  return to_return;
 | 
			
		||||
 | 
			
		||||
 err: 
 | 
			
		||||
 | 
			
		||||
  if(aep_dso)
 | 
			
		||||
    DSO_free(aep_dso);
 | 
			
		||||
		
 | 
			
		||||
  p_AEP_OpenConnection    = NULL;
 | 
			
		||||
  p_AEP_ModExp            = NULL;
 | 
			
		||||
  p_AEP_ModExpCrt         = NULL;
 | 
			
		||||
  p_AEP_GenRandom         = NULL;
 | 
			
		||||
  p_AEP_Initialize        = NULL;
 | 
			
		||||
  p_AEP_Finalize          = NULL;
 | 
			
		||||
  p_AEP_SetBNCallBacks    = NULL;
 | 
			
		||||
 | 
			
		||||
  return to_return;
 | 
			
		||||
 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int aep_finish()
 | 
			
		||||
{
 | 
			
		||||
  int to_return = 0;
 | 
			
		||||
 | 
			
		||||
  if(aep_dso == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_FINISH,ENGINE_R_NOT_LOADED);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
  if(!DSO_free(aep_dso))
 | 
			
		||||
    {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_FINISH,ENGINE_R_DSO_FAILURE);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  aep_dso = NULL;
 | 
			
		||||
  p_AEP_OpenConnection    = NULL;
 | 
			
		||||
  p_AEP_ModExp            = NULL;
 | 
			
		||||
  p_AEP_ModExpCrt         = NULL;
 | 
			
		||||
  p_AEP_GenRandom         = NULL;
 | 
			
		||||
  p_AEP_Initialize        = NULL;
 | 
			
		||||
  p_AEP_Finalize          = NULL;
 | 
			
		||||
  p_AEP_SetBNCallBacks    = NULL;
 | 
			
		||||
 | 
			
		||||
  CRYPTO_add(&rnd_reference, -1, CRYPTO_LOCK_DYNLOCK);    
 | 
			
		||||
 | 
			
		||||
  to_return = 1;
 | 
			
		||||
 err:
 | 
			
		||||
  return to_return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int aep_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
		       const BIGNUM *m, BN_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
  int to_return = 0;
 | 
			
		||||
 | 
			
		||||
  unsigned int hConnection, rv;
 | 
			
		||||
 | 
			
		||||
  /*Grab a connection from the pool*/
 | 
			
		||||
  rv = aep_get_connection(&hConnection);
 | 
			
		||||
  if (rv != AEP_R_OK)
 | 
			
		||||
    {     
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_MOD_EXP,ENGINE_R_GET_HANDLE_FAILED);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /*To the card with the mod exp*/
 | 
			
		||||
  rv = p_AEP_ModExp(hConnection,(void*)a, (void*)p,(void*)m, (void*)r,NULL);
 | 
			
		||||
                            
 | 
			
		||||
  if (rv !=  AEP_R_OK)
 | 
			
		||||
    {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_MOD_EXP,ENGINE_R_MOD_EXP_FAILED);
 | 
			
		||||
      rv = aep_return_connection(hConnection);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /*Return the connection to the pool*/
 | 
			
		||||
  rv = aep_return_connection(hConnection);
 | 
			
		||||
  if (rv != AEP_R_OK)
 | 
			
		||||
  {
 | 
			
		||||
    ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_RETURN_CONNECTION_FAILED); 
 | 
			
		||||
	goto err;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  to_return = 1;
 | 
			
		||||
 err:
 | 
			
		||||
  return to_return;
 | 
			
		||||
}
 | 
			
		||||
	
 | 
			
		||||
static int aep_mod_exp_crt(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *q ,
 | 
			
		||||
			   const BIGNUM *dmp1,const BIGNUM *dmq1,const BIGNUM *iqmp, BN_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
  AEP_RV rv = AEP_R_OK;
 | 
			
		||||
  unsigned int hConnection;
 | 
			
		||||
 | 
			
		||||
  /*Grab a connection from the pool*/
 | 
			
		||||
  rv = aep_get_connection(&hConnection);
 | 
			
		||||
  if (rv != AEP_R_OK)
 | 
			
		||||
    {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_MOD_EXP_CRT,ENGINE_R_GET_HANDLE_FAILED);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /*To the card with the mod exp*/
 | 
			
		||||
  rv = p_AEP_ModExpCrt(hConnection,(void*)a, (void*)p, (void*)q, (void*)dmp1,(void*)dmq1,
 | 
			
		||||
		       (void*)iqmp,(void*)r,NULL);
 | 
			
		||||
  if (rv != AEP_R_OK)
 | 
			
		||||
  {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_MOD_EXP_CRT,ENGINE_R_MOD_EXP_CRT_FAILED);
 | 
			
		||||
      rv = aep_return_connection(hConnection);
 | 
			
		||||
      goto err;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /*Return the connection to the pool*/
 | 
			
		||||
  rv = aep_return_connection(hConnection);
 | 
			
		||||
  if (rv != AEP_R_OK)
 | 
			
		||||
  {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_RETURN_CONNECTION_FAILED); 
 | 
			
		||||
 	goto err;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
 err:
 | 
			
		||||
  return rv;
 | 
			
		||||
}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
static int aep_rand(unsigned char *buf,int len )
 | 
			
		||||
{
 | 
			
		||||
  AEP_RV rv = AEP_R_OK;
 | 
			
		||||
  unsigned int hConnection;
 | 
			
		||||
 | 
			
		||||
  int to_return = 0;
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
  CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
 | 
			
		||||
  /*Can the request be serviced with what's already in the buffer?*/
 | 
			
		||||
  if (len <= rand_block_bytes)
 | 
			
		||||
    {
 | 
			
		||||
      memcpy(buf, &rand_block[RAND_BLK_SIZE - rand_block_bytes], len);
 | 
			
		||||
      rand_block_bytes -= len;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
  /*If not the get another block of random bytes*/
 | 
			
		||||
    {
 | 
			
		||||
      rv = aep_get_connection(&hConnection);
 | 
			
		||||
      if (rv !=  AEP_R_OK)
 | 
			
		||||
	  { 
 | 
			
		||||
          ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_GET_HANDLE_FAILED);             
 | 
			
		||||
          CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
	  goto err;
 | 
			
		||||
	  }
 | 
			
		||||
 | 
			
		||||
      if (len > RAND_BLK_SIZE)
 | 
			
		||||
	  {
 | 
			
		||||
		rv = p_AEP_GenRandom(hConnection, len, 2, buf, NULL);
 | 
			
		||||
		if (rv !=  AEP_R_OK)
 | 
			
		||||
	    {  
 | 
			
		||||
              ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_GET_RANDOM_FAILED); 
 | 
			
		||||
	      CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
	      goto err;
 | 
			
		||||
	    }
 | 
			
		||||
	  }
 | 
			
		||||
      else
 | 
			
		||||
	  {
 | 
			
		||||
		rv = p_AEP_GenRandom(hConnection, RAND_BLK_SIZE, 2, &rand_block[0], NULL);
 | 
			
		||||
		if (rv !=  AEP_R_OK)
 | 
			
		||||
	    {       
 | 
			
		||||
              ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_GET_RANDOM_FAILED); 
 | 
			
		||||
	      
 | 
			
		||||
              CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
	      goto err;
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
		rand_block_bytes = RAND_BLK_SIZE;
 | 
			
		||||
 | 
			
		||||
		memcpy(buf, &rand_block[RAND_BLK_SIZE - rand_block_bytes], len);
 | 
			
		||||
		rand_block_bytes -= len;
 | 
			
		||||
	  }
 | 
			
		||||
 | 
			
		||||
      rv = aep_return_connection(hConnection);
 | 
			
		||||
      if (rv != AEP_R_OK)
 | 
			
		||||
	  {
 | 
			
		||||
          ENGINEerr(ENGINE_F_AEP_RAND,ENGINE_R_RETURN_CONNECTION_FAILED); 
 | 
			
		||||
	  
 | 
			
		||||
          CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
	  goto err;
 | 
			
		||||
	  }
 | 
			
		||||
    }
 | 
			
		||||
  
 | 
			
		||||
     CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
  to_return = 1;
 | 
			
		||||
 err:
 | 
			
		||||
  return to_return;
 | 
			
		||||
}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
static int aep_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
 | 
			
		||||
{
 | 
			
		||||
  BN_CTX *ctx = NULL;
 | 
			
		||||
 
 | 
			
		||||
  int to_return = 0;
 | 
			
		||||
 
 | 
			
		||||
  AEP_RV rv = AEP_R_OK;
 | 
			
		||||
 | 
			
		||||
  if (!aep_dso)
 | 
			
		||||
    {
 | 
			
		||||
      ENGINEerr(ENGINE_F_AEP_RSA_MOD_EXP,ENGINE_R_NOT_LOADED);
 | 
			
		||||
      goto err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /*See if we have all the necessary bits for a crt*/
 | 
			
		||||
  if (rsa->q && rsa->dmp1 && rsa->dmq1 && rsa->iqmp)
 | 
			
		||||
    {
 | 
			
		||||
      rv =  aep_mod_exp_crt(r0,I,rsa->p,rsa->q, rsa->dmp1,rsa->dmq1,rsa->iqmp,ctx);
 | 
			
		||||
      if (rv != AEP_R_OK)
 | 
			
		||||
       goto err;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
       if (!rsa->d || !rsa->n)
 | 
			
		||||
	{
 | 
			
		||||
	  ENGINEerr(ENGINE_F_AEP_RSA_MOD_EXP,ENGINE_R_MISSING_KEY_COMPONENTS);
 | 
			
		||||
	  goto err;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
       rv = aep_mod_exp(r0,I,rsa->d,rsa->n,ctx);
 | 
			
		||||
       if  (rv != AEP_R_OK)
 | 
			
		||||
             goto err;
 | 
			
		||||
	
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
   to_return = 1;
 | 
			
		||||
 | 
			
		||||
 err:
 | 
			
		||||
  if(ctx)
 | 
			
		||||
    BN_CTX_free(ctx);
 | 
			
		||||
  return to_return;
 | 
			
		||||
}
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
static int aep_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
 | 
			
		||||
			   BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
 | 
			
		||||
			   BN_CTX *ctx, BN_MONT_CTX *in_mont)
 | 
			
		||||
{
 | 
			
		||||
  BIGNUM t;
 | 
			
		||||
  int to_return = 0;
 | 
			
		||||
  BN_init(&t);
 | 
			
		||||
 | 
			
		||||
  /* let rr = a1 ^ p1 mod m */
 | 
			
		||||
  if (!aep_mod_exp(rr,a1,p1,m,ctx)) goto end;
 | 
			
		||||
  /* let t = a2 ^ p2 mod m */
 | 
			
		||||
  if (!aep_mod_exp(&t,a2,p2,m,ctx)) goto end;
 | 
			
		||||
  /* let rr = rr * t mod m */
 | 
			
		||||
  if (!BN_mod_mul(rr,rr,&t,m,ctx)) goto end;
 | 
			
		||||
  to_return = 1;
 | 
			
		||||
 end: 
 | 
			
		||||
  BN_free(&t);
 | 
			
		||||
  return to_return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int aep_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
 | 
			
		||||
			   const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
 | 
			
		||||
			   BN_MONT_CTX *m_ctx)
 | 
			
		||||
{  
 | 
			
		||||
  return aep_mod_exp(r, a, p, m, ctx); 
 | 
			
		||||
 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This function is aliased to mod_exp (with the mont stuff dropped). */
 | 
			
		||||
static int aep_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
			    const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
 | 
			
		||||
{
 | 
			
		||||
     return aep_mod_exp(r, a, p, m, ctx);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This function is aliased to mod_exp (with the dh and mont dropped). */
 | 
			
		||||
static int aep_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
			  const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
 | 
			
		||||
{
 | 
			
		||||
    return aep_mod_exp(r, a, p, m, ctx);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int aep_get_connection(unsigned int *hConnection)
 | 
			
		||||
{
 | 
			
		||||
  int count;
 | 
			
		||||
  AEP_RV rv = AEP_R_OK;
 | 
			
		||||
 | 
			
		||||
  /*Get the current process id*/
 | 
			
		||||
  pid_t curr_pid;
 | 
			
		||||
 | 
			
		||||
  CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
 | 
			
		||||
  curr_pid = getpid();
 | 
			
		||||
 | 
			
		||||
  /*Check if this is the first time this is being called from the current
 | 
			
		||||
    process*/
 | 
			
		||||
  if (recorded_pid != curr_pid)
 | 
			
		||||
    {
 | 
			
		||||
      recorded_pid = curr_pid;
 | 
			
		||||
 | 
			
		||||
      /*Call Finalize to make sure we have not inherited some data from a parent
 | 
			
		||||
	process*/
 | 
			
		||||
      p_AEP_Finalize();
 | 
			
		||||
     
 | 
			
		||||
      /*Initialise the AEP API*/
 | 
			
		||||
      rv = p_AEP_Initialize(NULL);
 | 
			
		||||
 | 
			
		||||
      if (rv != AEP_R_OK)
 | 
			
		||||
	{
 | 
			
		||||
	  ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_AEP_INIT_FAILURE);
 | 
			
		||||
	  recorded_pid = 0;
 | 
			
		||||
	  CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);	 
 | 
			
		||||
	  return rv;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
      /*Set the AEP big num call back functions*/
 | 
			
		||||
      rv = p_AEP_SetBNCallBacks(&GetBigNumSize, &MakeAEPBigNum, &ConvertAEPBigNum);
 | 
			
		||||
 | 
			
		||||
      if (rv != AEP_R_OK)
 | 
			
		||||
	{
 | 
			
		||||
	 
 | 
			
		||||
        ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_SETBNCALLBACK_FAILURE);
 | 
			
		||||
		recorded_pid = 0;
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
		return rv;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
      /*Reset the rand byte count*/
 | 
			
		||||
      rand_block_bytes = 0;
 | 
			
		||||
 | 
			
		||||
      /*Init the structures*/
 | 
			
		||||
      for (count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
 | 
			
		||||
	{
 | 
			
		||||
	  aep_app_conn_table[count].conn_state = NotConnected;
 | 
			
		||||
	  aep_app_conn_table[count].conn_hndl  = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
      /*Open a connection*/
 | 
			
		||||
      rv = p_AEP_OpenConnection(hConnection);
 | 
			
		||||
 | 
			
		||||
      if (rv != AEP_R_OK)
 | 
			
		||||
	{
 | 
			
		||||
          ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_UNIT_FAILURE);
 | 
			
		||||
		  recorded_pid = 0;
 | 
			
		||||
          CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
	  return rv;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
      aep_app_conn_table[0].conn_state = InUse;
 | 
			
		||||
 | 
			
		||||
      aep_app_conn_table[0].conn_hndl = *hConnection;
 | 
			
		||||
      CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
     
 | 
			
		||||
      return (rv);
 | 
			
		||||
    }
 | 
			
		||||
  /*Check the existing connections to see if we can find a free one*/
 | 
			
		||||
  for (count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
 | 
			
		||||
    {
 | 
			
		||||
      
 | 
			
		||||
      if (aep_app_conn_table[count].conn_state == Connected)
 | 
			
		||||
	{
 | 
			
		||||
	  aep_app_conn_table[count].conn_state = InUse;
 | 
			
		||||
	  *hConnection = aep_app_conn_table[count].conn_hndl;
 | 
			
		||||
          CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); 
 | 
			
		||||
	  return rv;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
  /*If no connections available, we're going to have to try to open a new one*/
 | 
			
		||||
  for (count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
 | 
			
		||||
    {
 | 
			
		||||
        if (aep_app_conn_table[count].conn_state == NotConnected)
 | 
			
		||||
	{
 | 
			
		||||
	  /*Open a connection*/
 | 
			
		||||
	  rv = p_AEP_OpenConnection(hConnection);
 | 
			
		||||
 | 
			
		||||
	  if (rv != AEP_R_OK)
 | 
			
		||||
	    {	      
 | 
			
		||||
               ENGINEerr(ENGINE_F_AEP_INIT,ENGINE_R_UNIT_FAILURE);
 | 
			
		||||
               CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
	       return rv;
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
	  aep_app_conn_table[count].conn_state = InUse;
 | 
			
		||||
 | 
			
		||||
	  aep_app_conn_table[count].conn_hndl = *hConnection;
 | 
			
		||||
          CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
	   return rv;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
  
 | 
			
		||||
  CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
  return AEP_R_GENERAL_ERROR;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int aep_return_connection(unsigned int hConnection)
 | 
			
		||||
{
 | 
			
		||||
  int count;
 | 
			
		||||
 | 
			
		||||
   CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
 | 
			
		||||
  /*Find the connection item that matches this connection handle*/
 | 
			
		||||
  for(count = 0;count < MAX_PROCESS_CONNECTIONS;count ++)
 | 
			
		||||
    {
 | 
			
		||||
     
 | 
			
		||||
      if (aep_app_conn_table[count].conn_hndl == hConnection)
 | 
			
		||||
	{
 | 
			
		||||
	  aep_app_conn_table[count].conn_state = Connected;
 | 
			
		||||
	  break;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
   CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
 | 
			
		||||
  return AEP_R_OK;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*BigNum call back functions, used to convert OpenSSL bignums into AEP bignums.
 | 
			
		||||
Note only 32bit Openssl build support*/
 | 
			
		||||
 | 
			
		||||
AEP_RV GetBigNumSize(void* ArbBigNum, AEP_U32* BigNumSize)
 | 
			
		||||
{
 | 
			
		||||
  BIGNUM* bn;
 | 
			
		||||
 | 
			
		||||
  /*Cast the ArbBigNum pointer to our BIGNUM struct*/
 | 
			
		||||
  bn = (BIGNUM*) ArbBigNum;
 | 
			
		||||
 | 
			
		||||
#ifdef SIXTY_FOUR_BIT_LONG
 | 
			
		||||
  *BigNumSize = bn->top << 3;
 | 
			
		||||
#else
 | 
			
		||||
  /*Size of the bignum in bytes is equal to the bn->top (no of 32 bit words) multiplies by 4*/
 | 
			
		||||
  *BigNumSize = bn->top << 2;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  return AEP_R_OK;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AEP_RV MakeAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum)
 | 
			
		||||
{
 | 
			
		||||
  BIGNUM* bn;
 | 
			
		||||
 | 
			
		||||
#ifndef SIXTY_FOUR_BIT_LONG
 | 
			
		||||
  unsigned char* buf;
 | 
			
		||||
  int i;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  /*Cast the ArbBigNum pointer to our BIGNUM struct*/
 | 
			
		||||
  bn = (BIGNUM*) ArbBigNum;
 | 
			
		||||
 | 
			
		||||
#ifdef SIXTY_FOUR_BIT_LONG
 | 
			
		||||
  	memcpy(AEP_BigNum, bn->d, BigNumSize);
 | 
			
		||||
#else
 | 
			
		||||
  /*Must copy data into a (monotone) least significant byte first format
 | 
			
		||||
	performing endian conversion if necessary*/
 | 
			
		||||
  for(i=0;i<bn->top;i++)
 | 
			
		||||
    {
 | 
			
		||||
      buf = (unsigned char*)&bn->d[i];
 | 
			
		||||
 | 
			
		||||
      *((AEP_U32*)AEP_BigNum) = (AEP_U32) ((unsigned) buf[1] << 8 | buf[0]) |
 | 
			
		||||
	((unsigned) buf[3] << 8 | buf[2])  << 16;
 | 
			
		||||
 | 
			
		||||
      AEP_BigNum += 4;
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  return AEP_R_OK;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*Turn an AEP Big Num back to a user big num*/
 | 
			
		||||
AEP_RV ConvertAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum)
 | 
			
		||||
{
 | 
			
		||||
  BIGNUM* bn;
 | 
			
		||||
#ifndef SIXTY_FOUR_BIT_LONG
 | 
			
		||||
  int i;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  bn = (BIGNUM*)ArbBigNum;
 | 
			
		||||
 | 
			
		||||
  /*Expand the result bn so that it can hold our big num.  Size is in bits*/
 | 
			
		||||
  bn_expand(bn, (int)(BigNumSize << 3));
 | 
			
		||||
 | 
			
		||||
#ifdef SIXTY_FOUR_BIT_LONG
 | 
			
		||||
  bn->top = BigNumSize >> 3;
 | 
			
		||||
	
 | 
			
		||||
  if((BigNumSize & 7) != 0)
 | 
			
		||||
  	bn->top++;
 | 
			
		||||
 | 
			
		||||
  memset(bn->d, 0, bn->top << 3);	
 | 
			
		||||
 | 
			
		||||
  memcpy(bn->d, AEP_BigNum, BigNumSize);
 | 
			
		||||
#else
 | 
			
		||||
  bn->top = BigNumSize >> 2;
 | 
			
		||||
 
 | 
			
		||||
  for(i=0;i<bn->top;i++)
 | 
			
		||||
    {
 | 
			
		||||
      bn->d[i] = (AEP_U32) ((unsigned) AEP_BigNum[3] << 8 | AEP_BigNum[2]) << 16 |
 | 
			
		||||
	((unsigned) AEP_BigNum[1] << 8 | AEP_BigNum[0]);
 | 
			
		||||
      AEP_BigNum += 4;
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  return AEP_R_OK;
 | 
			
		||||
}	
 | 
			
		||||
	
 | 
			
		||||
#endif /* !NO_HW_AEP */
 | 
			
		||||
#endif /* !NO_HW */
 | 
			
		||||
							
								
								
									
										1014
									
								
								crypto/engine/hw_keyclient.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1014
									
								
								crypto/engine/hw_keyclient.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -939,14 +939,14 @@ static int hwcrhk_mutex_init(HWCryptoHook_Mutex* mt,
 | 
			
		||||
	{
 | 
			
		||||
	mt->lockid = CRYPTO_get_new_dynlockid();
 | 
			
		||||
	if (mt->lockid == 0)
 | 
			
		||||
		return 0;
 | 
			
		||||
	return 1;
 | 
			
		||||
		return 1; /* failure */
 | 
			
		||||
	return 0; /* success */
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int hwcrhk_mutex_lock(HWCryptoHook_Mutex *mt)
 | 
			
		||||
	{
 | 
			
		||||
	CRYPTO_w_lock(mt->lockid);
 | 
			
		||||
	return 1;
 | 
			
		||||
	return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void hwcrhk_mutex_unlock(HWCryptoHook_Mutex * mt)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										908
									
								
								crypto/engine/hw_sureware.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										908
									
								
								crypto/engine/hw_sureware.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,908 @@
 | 
			
		||||
/* Written by Corinne Dive-Reclus(cdive@baltimore.com)
 | 
			
		||||
* 
 | 
			
		||||
*
 | 
			
		||||
* 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/)"
 | 
			
		||||
*
 | 
			
		||||
* Written by Corinne Dive-Reclus(cdive@baltimore.com)
 | 
			
		||||
*
 | 
			
		||||
* Copyright@2001 Baltimore Technologies Ltd.
 | 
			
		||||
* All right Reserved.
 | 
			
		||||
*																								*	
 | 
			
		||||
*		THIS FILE IS PROVIDED BY BALTIMORE TECHNOLOGIES ``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 BALTIMORE TECHNOLOGIES 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.																			*
 | 
			
		||||
====================================================================*/
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/dso.h>
 | 
			
		||||
#include "engine_int.h"
 | 
			
		||||
#include "engine.h"
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#ifndef NO_HW
 | 
			
		||||
#ifndef NO_HW_SUREWARE
 | 
			
		||||
 | 
			
		||||
#ifdef FLAT_INC
 | 
			
		||||
#include "sureware.h"
 | 
			
		||||
#else
 | 
			
		||||
#include "vendor_defns/sureware.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static int surewarehk_ctrl(int cmd, long i, void *p, void (*f)());
 | 
			
		||||
static int surewarehk_init(void);
 | 
			
		||||
static int surewarehk_finish(void);
 | 
			
		||||
static int surewarehk_modexp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
							const BIGNUM *m, BN_CTX *ctx);
 | 
			
		||||
 | 
			
		||||
/* RSA stuff */
 | 
			
		||||
static int surewarehk_rsa_priv_dec(int flen,unsigned char *from,unsigned char *to,
 | 
			
		||||
			RSA *rsa,int padding);
 | 
			
		||||
static int surewarehk_rsa_sign(int flen,unsigned char *from,unsigned char *to,
 | 
			
		||||
			    RSA *rsa,int padding);
 | 
			
		||||
 | 
			
		||||
/* RAND stuff */
 | 
			
		||||
static int surewarehk_rand_bytes(unsigned char *buf, int num);
 | 
			
		||||
static void surewarehk_rand_seed(const void *buf, int num);
 | 
			
		||||
static void surewarehk_rand_add(const void *buf, int num, double entropy);
 | 
			
		||||
 | 
			
		||||
/* KM stuff */
 | 
			
		||||
static EVP_PKEY *surewarehk_load_privkey(const char *key_id,
 | 
			
		||||
	const char *passphrase);
 | 
			
		||||
static EVP_PKEY *surewarehk_load_pubkey(const char *key_id,
 | 
			
		||||
	const char *passphrase);
 | 
			
		||||
static void surewarehk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
 | 
			
		||||
	int index,long argl, void *argp);
 | 
			
		||||
static void surewarehk_dh_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
 | 
			
		||||
	int index,long argl, void *argp);
 | 
			
		||||
 | 
			
		||||
/* This function is aliased to mod_exp (with the mont stuff dropped). */
 | 
			
		||||
static int surewarehk_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
		const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
 | 
			
		||||
{
 | 
			
		||||
	return surewarehk_modexp(r, a, p, m, ctx);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Our internal RSA_METHOD that we provide pointers to */
 | 
			
		||||
static RSA_METHOD surewarehk_rsa =
 | 
			
		||||
	{
 | 
			
		||||
	"SureWare RSA method",
 | 
			
		||||
	NULL, /* pub_enc*/
 | 
			
		||||
	NULL, /* pub_dec*/
 | 
			
		||||
	surewarehk_rsa_sign, /* our rsa_sign is OpenSSL priv_enc*/
 | 
			
		||||
	surewarehk_rsa_priv_dec, /* priv_dec*/
 | 
			
		||||
	NULL, /*mod_exp*/
 | 
			
		||||
	surewarehk_mod_exp_mont, /*mod_exp_mongomery*/
 | 
			
		||||
	NULL, /* init*/
 | 
			
		||||
	NULL, /* finish*/
 | 
			
		||||
	0,	/* RSA flag*/
 | 
			
		||||
	NULL, 
 | 
			
		||||
	NULL, /* OpenSSL sign*/
 | 
			
		||||
	NULL  /* OpenSSL verify*/
 | 
			
		||||
	};
 | 
			
		||||
/* Our internal DH_METHOD that we provide pointers to */
 | 
			
		||||
/* This function is aliased to mod_exp (with the dh and mont dropped). */
 | 
			
		||||
static int surewarehk_modexp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
		const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
 | 
			
		||||
{
 | 
			
		||||
	return surewarehk_modexp(r, a, p, m, ctx);
 | 
			
		||||
}
 | 
			
		||||
static DH_METHOD surewarehk_dh =
 | 
			
		||||
	{
 | 
			
		||||
	"SureWare DH method",
 | 
			
		||||
	NULL,/*gen_key*/
 | 
			
		||||
	NULL,/*agree,*/
 | 
			
		||||
	surewarehk_modexp_dh, /*dh mod exp*/
 | 
			
		||||
	NULL, /* init*/
 | 
			
		||||
	NULL, /* finish*/
 | 
			
		||||
	0,    /* flags*/
 | 
			
		||||
	NULL 
 | 
			
		||||
	};
 | 
			
		||||
static RAND_METHOD surewarehk_rand =
 | 
			
		||||
	{
 | 
			
		||||
	/* "SureWare RAND method", */
 | 
			
		||||
	surewarehk_rand_seed,
 | 
			
		||||
	surewarehk_rand_bytes,
 | 
			
		||||
	NULL,/*cleanup*/
 | 
			
		||||
	surewarehk_rand_add,
 | 
			
		||||
	surewarehk_rand_bytes,
 | 
			
		||||
	NULL,/*rand_status*/
 | 
			
		||||
	};
 | 
			
		||||
/* DSA stuff */
 | 
			
		||||
static	DSA_SIG * surewarehk_dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
 | 
			
		||||
static int surewarehk_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
 | 
			
		||||
		BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
 | 
			
		||||
		BN_CTX *ctx, BN_MONT_CTX *in_mont)
 | 
			
		||||
{
 | 
			
		||||
	BIGNUM t;
 | 
			
		||||
	int to_return = 0;
 | 
			
		||||
	BN_init(&t);
 | 
			
		||||
	/* let rr = a1 ^ p1 mod m */
 | 
			
		||||
	if (!surewarehk_modexp(rr,a1,p1,m,ctx)) goto end;
 | 
			
		||||
	/* let t = a2 ^ p2 mod m */
 | 
			
		||||
	if (!surewarehk_modexp(&t,a2,p2,m,ctx)) goto end;
 | 
			
		||||
	/* let rr = rr * t mod m */
 | 
			
		||||
	if (!BN_mod_mul(rr,rr,&t,m,ctx)) goto end;
 | 
			
		||||
	to_return = 1;
 | 
			
		||||
end:
 | 
			
		||||
	BN_free(&t);
 | 
			
		||||
	return to_return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static DSA_METHOD surewarehk_dsa =
 | 
			
		||||
	{
 | 
			
		||||
	 "SureWare DSA method", 
 | 
			
		||||
	surewarehk_dsa_do_sign,
 | 
			
		||||
	NULL,/*sign setup*/
 | 
			
		||||
	NULL,/*verify,*/
 | 
			
		||||
	surewarehk_dsa_mod_exp,/*mod exp*/
 | 
			
		||||
	NULL,/*bn mod exp*/
 | 
			
		||||
	NULL, /*init*/
 | 
			
		||||
	NULL,/*finish*/
 | 
			
		||||
	0,
 | 
			
		||||
	NULL,
 | 
			
		||||
	};
 | 
			
		||||
/* Our ENGINE structure. */
 | 
			
		||||
static ENGINE engine_surewarehk =
 | 
			
		||||
        {
 | 
			
		||||
	"sureware",
 | 
			
		||||
	"SureWare hardware engine support",
 | 
			
		||||
	&surewarehk_rsa,
 | 
			
		||||
	&surewarehk_dsa,
 | 
			
		||||
	&surewarehk_dh,
 | 
			
		||||
	&surewarehk_rand,
 | 
			
		||||
	&surewarehk_modexp,
 | 
			
		||||
	NULL,/* mod exp CRT*/
 | 
			
		||||
	surewarehk_init,
 | 
			
		||||
	surewarehk_finish,
 | 
			
		||||
	surewarehk_ctrl, /* crtl*/
 | 
			
		||||
	surewarehk_load_privkey,
 | 
			
		||||
	surewarehk_load_pubkey,
 | 
			
		||||
	0, /* no flags */
 | 
			
		||||
	0, 0, /* no references */
 | 
			
		||||
	NULL, /*unlinked */
 | 
			
		||||
        };
 | 
			
		||||
/* Now, to our own code */
 | 
			
		||||
 | 
			
		||||
/* As this is only ever called once, there's no need for locking
 | 
			
		||||
 * (indeed - the lock will already be held by our caller!!!) */
 | 
			
		||||
ENGINE *ENGINE_sureware()
 | 
			
		||||
{
 | 
			
		||||
	RSA_METHOD *meth1;
 | 
			
		||||
	DSA_METHOD *meth2;
 | 
			
		||||
	DH_METHOD *meth3;
 | 
			
		||||
 | 
			
		||||
	/* We know that the "PKCS1_SSLeay()" functions hook properly
 | 
			
		||||
	 * to the cswift-specific mod_exp and mod_exp_crt so we use
 | 
			
		||||
	 * those functions. NB: We don't use ENGINE_openssl() or
 | 
			
		||||
	 * anything "more generic" because something like the RSAref
 | 
			
		||||
	 * code may not hook properly, and if you own one of these
 | 
			
		||||
	 * cards then you have the right to do RSA operations on it
 | 
			
		||||
	 * anyway! */ 
 | 
			
		||||
	meth1 = RSA_PKCS1_SSLeay();
 | 
			
		||||
	if (meth1)
 | 
			
		||||
	{
 | 
			
		||||
		surewarehk_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
 | 
			
		||||
		surewarehk_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
 | 
			
		||||
	}
 | 
			
		||||
	/* Use the DSA_OpenSSL() method and just hook the mod_exp-ish
 | 
			
		||||
	 * bits. */
 | 
			
		||||
	meth2 = DSA_OpenSSL();
 | 
			
		||||
	if (meth2)
 | 
			
		||||
	{
 | 
			
		||||
		surewarehk_dsa.dsa_do_verify = meth2->dsa_do_verify;
 | 
			
		||||
	}
 | 
			
		||||
	/* Much the same for Diffie-Hellman */
 | 
			
		||||
	meth3 = DH_OpenSSL();
 | 
			
		||||
	if (meth3)
 | 
			
		||||
	{
 | 
			
		||||
		surewarehk_dh.generate_key = meth3->generate_key;
 | 
			
		||||
		surewarehk_dh.compute_key = meth3->compute_key;
 | 
			
		||||
	}
 | 
			
		||||
	return &engine_surewarehk;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This is a process-global DSO handle used for loading and unloading
 | 
			
		||||
 * the SureWareHook library. NB: This is only set (or unset) during an
 | 
			
		||||
 * init() or finish() call (reference counts permitting) and they're
 | 
			
		||||
 * operating with global locks, so this should be thread-safe
 | 
			
		||||
 * implicitly. */
 | 
			
		||||
static DSO *surewarehk_dso = NULL;
 | 
			
		||||
static int rsaHndidx = -1;	/* Index for KM handle.  Not really used yet. */
 | 
			
		||||
static int dsaHndidx = -1;	/* Index for KM handle.  Not really used yet. */
 | 
			
		||||
 | 
			
		||||
/* These are the function pointers that are (un)set when the library has
 | 
			
		||||
 * successfully (un)loaded. */
 | 
			
		||||
static SureWareHook_Init_t *p_surewarehk_Init = NULL;
 | 
			
		||||
static SureWareHook_Finish_t *p_surewarehk_Finish = NULL;
 | 
			
		||||
static SureWareHook_Rand_Bytes_t *p_surewarehk_Rand_Bytes = NULL;
 | 
			
		||||
static SureWareHook_Rand_Seed_t *p_surewarehk_Rand_Seed = NULL;
 | 
			
		||||
static SureWareHook_Load_Privkey_t *p_surewarehk_Load_Privkey = NULL;
 | 
			
		||||
static SureWareHook_Info_Pubkey_t *p_surewarehk_Info_Pubkey = NULL;
 | 
			
		||||
static SureWareHook_Load_Rsa_Pubkey_t *p_surewarehk_Load_Rsa_Pubkey = NULL;
 | 
			
		||||
static SureWareHook_Load_Dsa_Pubkey_t *p_surewarehk_Load_Dsa_Pubkey = NULL;
 | 
			
		||||
static SureWareHook_Free_t *p_surewarehk_Free=NULL;
 | 
			
		||||
static SureWareHook_Rsa_Priv_Dec_t *p_surewarehk_Rsa_Priv_Dec=NULL;
 | 
			
		||||
static SureWareHook_Rsa_Sign_t *p_surewarehk_Rsa_Sign=NULL;
 | 
			
		||||
static SureWareHook_Dsa_Sign_t *p_surewarehk_Dsa_Sign=NULL;
 | 
			
		||||
static SureWareHook_Mod_Exp_t *p_surewarehk_Mod_Exp=NULL;
 | 
			
		||||
 | 
			
		||||
/* Used in the DSO operations. */
 | 
			
		||||
static const char *surewarehk_LIBNAME = "SureWareHook";
 | 
			
		||||
static const char *n_surewarehk_Init = "SureWareHook_Init";
 | 
			
		||||
static const char *n_surewarehk_Finish = "SureWareHook_Finish";
 | 
			
		||||
static const char *n_surewarehk_Rand_Bytes="SureWareHook_Rand_Bytes";
 | 
			
		||||
static const char *n_surewarehk_Rand_Seed="SureWareHook_Rand_Seed";
 | 
			
		||||
static const char *n_surewarehk_Load_Privkey="SureWareHook_Load_Privkey";
 | 
			
		||||
static const char *n_surewarehk_Info_Pubkey="SureWareHook_Info_Pubkey";
 | 
			
		||||
static const char *n_surewarehk_Load_Rsa_Pubkey="SureWareHook_Load_Rsa_Pubkey";
 | 
			
		||||
static const char *n_surewarehk_Load_Dsa_Pubkey="SureWareHook_Load_Dsa_Pubkey";
 | 
			
		||||
static const char *n_surewarehk_Free="SureWareHook_Free";
 | 
			
		||||
static const char *n_surewarehk_Rsa_Priv_Dec="SureWareHook_Rsa_Priv_Dec";
 | 
			
		||||
static const char *n_surewarehk_Rsa_Sign="SureWareHook_Rsa_Sign";
 | 
			
		||||
static const char *n_surewarehk_Dsa_Sign="SureWareHook_Dsa_Sign";
 | 
			
		||||
static const char *n_surewarehk_Mod_Exp="SureWareHook_Mod_Exp";
 | 
			
		||||
static BIO *logstream = NULL;
 | 
			
		||||
 | 
			
		||||
/* SureWareHook library functions and mechanics - these are used by the
 | 
			
		||||
 * higher-level functions further down. NB: As and where there's no
 | 
			
		||||
 * error checking, take a look lower down where these functions are
 | 
			
		||||
 * called, the checking and error handling is probably down there. 
 | 
			
		||||
*/
 | 
			
		||||
static int threadsafe=1;
 | 
			
		||||
static int surewarehk_ctrl(int cmd, long i, void *p, void (*f)())
 | 
			
		||||
{
 | 
			
		||||
	int to_return = 1;
 | 
			
		||||
 | 
			
		||||
	switch(cmd)
 | 
			
		||||
	{
 | 
			
		||||
		case ENGINE_CTRL_SET_LOGSTREAM:
 | 
			
		||||
		{
 | 
			
		||||
			BIO *bio = (BIO *)p;
 | 
			
		||||
			CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
			if (logstream)
 | 
			
		||||
			{
 | 
			
		||||
				BIO_free(logstream);
 | 
			
		||||
				logstream = NULL;
 | 
			
		||||
			}
 | 
			
		||||
			if (CRYPTO_add(&bio->references,1,CRYPTO_LOCK_BIO) > 1)
 | 
			
		||||
				logstream = bio;
 | 
			
		||||
			else
 | 
			
		||||
				ENGINEerr(ENGINE_F_SUREWAREHK_CTRL,ENGINE_R_BIO_WAS_FREED);
 | 
			
		||||
		}
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
		break;
 | 
			
		||||
	/* This will prevent the initialisation function from "installing"
 | 
			
		||||
	 * the mutex-handling callbacks, even if they are available from
 | 
			
		||||
	 * within the library (or were provided to the library from the
 | 
			
		||||
	 * calling application). This is to remove any baggage for
 | 
			
		||||
	 * applications not using multithreading. */
 | 
			
		||||
	case ENGINE_CTRL_CHIL_NO_LOCKING:
 | 
			
		||||
		CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
		threadsafe = 0;
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
	/* The command isn't understood by this engine */
 | 
			
		||||
	default:
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_CTRL,
 | 
			
		||||
			ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED);
 | 
			
		||||
		to_return = 0;
 | 
			
		||||
		break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	return to_return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* (de)initialisation functions. */
 | 
			
		||||
static int surewarehk_init()
 | 
			
		||||
{
 | 
			
		||||
	char msg[64]="ENGINE_init";
 | 
			
		||||
	SureWareHook_Init_t *p1=NULL;
 | 
			
		||||
	SureWareHook_Finish_t *p2=NULL;
 | 
			
		||||
	SureWareHook_Rand_Bytes_t *p3=NULL;
 | 
			
		||||
	SureWareHook_Rand_Seed_t *p4=NULL;
 | 
			
		||||
	SureWareHook_Load_Privkey_t *p5=NULL;
 | 
			
		||||
	SureWareHook_Load_Rsa_Pubkey_t *p6=NULL;
 | 
			
		||||
	SureWareHook_Free_t *p7=NULL;
 | 
			
		||||
	SureWareHook_Rsa_Priv_Dec_t *p8=NULL;
 | 
			
		||||
	SureWareHook_Rsa_Sign_t *p9=NULL;
 | 
			
		||||
	SureWareHook_Dsa_Sign_t *p12=NULL;
 | 
			
		||||
	SureWareHook_Info_Pubkey_t *p13=NULL;
 | 
			
		||||
	SureWareHook_Load_Dsa_Pubkey_t *p14=NULL;
 | 
			
		||||
	SureWareHook_Mod_Exp_t *p15=NULL;
 | 
			
		||||
 | 
			
		||||
	if(surewarehk_dso != NULL)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_ALREADY_LOADED);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	/* Attempt to load libsurewarehk.so/surewarehk.dll/whatever. */
 | 
			
		||||
	surewarehk_dso = DSO_load(NULL, surewarehk_LIBNAME, NULL,
 | 
			
		||||
		DSO_FLAG_NAME_TRANSLATION);
 | 
			
		||||
	if(surewarehk_dso == NULL)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_DSO_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	if(!(p1=(SureWareHook_Init_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Init)) ||
 | 
			
		||||
	   !(p2=(SureWareHook_Finish_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Finish)) ||
 | 
			
		||||
	   !(p3=(SureWareHook_Rand_Bytes_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rand_Bytes)) ||
 | 
			
		||||
	   !(p4=(SureWareHook_Rand_Seed_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rand_Seed)) ||
 | 
			
		||||
	   !(p5=(SureWareHook_Load_Privkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Load_Privkey)) ||
 | 
			
		||||
	   !(p6=(SureWareHook_Load_Rsa_Pubkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Load_Rsa_Pubkey)) ||
 | 
			
		||||
	   !(p7=(SureWareHook_Free_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Free)) ||
 | 
			
		||||
	   !(p8=(SureWareHook_Rsa_Priv_Dec_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rsa_Priv_Dec)) ||
 | 
			
		||||
	   !(p9=(SureWareHook_Rsa_Sign_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Rsa_Sign)) ||
 | 
			
		||||
	   !(p12=(SureWareHook_Dsa_Sign_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Dsa_Sign)) ||
 | 
			
		||||
	   !(p13=(SureWareHook_Info_Pubkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Info_Pubkey)) ||
 | 
			
		||||
	   !(p14=(SureWareHook_Load_Dsa_Pubkey_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Load_Dsa_Pubkey)) ||
 | 
			
		||||
	   !(p15=(SureWareHook_Mod_Exp_t*)DSO_bind_func(surewarehk_dso, n_surewarehk_Mod_Exp)))
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_DSO_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	/* Copy the pointers */
 | 
			
		||||
	p_surewarehk_Init = p1;
 | 
			
		||||
	p_surewarehk_Finish = p2;
 | 
			
		||||
	p_surewarehk_Rand_Bytes = p3;
 | 
			
		||||
	p_surewarehk_Rand_Seed = p4;
 | 
			
		||||
	p_surewarehk_Load_Privkey = p5;
 | 
			
		||||
	p_surewarehk_Load_Rsa_Pubkey = p6;
 | 
			
		||||
	p_surewarehk_Free = p7;
 | 
			
		||||
	p_surewarehk_Rsa_Priv_Dec = p8;
 | 
			
		||||
	p_surewarehk_Rsa_Sign = p9;
 | 
			
		||||
	p_surewarehk_Dsa_Sign = p12;
 | 
			
		||||
	p_surewarehk_Info_Pubkey = p13;
 | 
			
		||||
	p_surewarehk_Load_Dsa_Pubkey = p14;
 | 
			
		||||
	p_surewarehk_Mod_Exp = p15;
 | 
			
		||||
	/* Contact the hardware and initialises it. */
 | 
			
		||||
	if(p_surewarehk_Init(msg,threadsafe)==SUREWAREHOOK_ERROR_UNIT_FAILURE)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_UNIT_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	if(p_surewarehk_Init(msg,threadsafe)==SUREWAREHOOK_ERROR_UNIT_FAILURE)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_INIT,ENGINE_R_UNIT_FAILURE);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	/* try to load the default private key, if failed does not return a failure but
 | 
			
		||||
           wait for an explicit ENGINE_load_privakey */
 | 
			
		||||
	surewarehk_load_privkey(NULL,NULL);
 | 
			
		||||
 | 
			
		||||
	/* Everything's fine. */
 | 
			
		||||
	if (rsaHndidx == -1)
 | 
			
		||||
		rsaHndidx = RSA_get_ex_new_index(0,
 | 
			
		||||
						"SureWareHook RSA key handle",
 | 
			
		||||
						NULL, NULL, surewarehk_ex_free);
 | 
			
		||||
	if (dsaHndidx == -1)
 | 
			
		||||
		dsaHndidx = DSA_get_ex_new_index(0,
 | 
			
		||||
						"SureWareHook DSA key handle",
 | 
			
		||||
						NULL, NULL, surewarehk_ex_free);
 | 
			
		||||
	return 1;
 | 
			
		||||
err:
 | 
			
		||||
	if(surewarehk_dso)
 | 
			
		||||
		DSO_free(surewarehk_dso);
 | 
			
		||||
	surewarehk_dso = NULL;
 | 
			
		||||
	p_surewarehk_Init = NULL;
 | 
			
		||||
	p_surewarehk_Finish = NULL;
 | 
			
		||||
	p_surewarehk_Rand_Bytes = NULL;
 | 
			
		||||
	p_surewarehk_Rand_Seed = NULL;
 | 
			
		||||
	p_surewarehk_Load_Privkey = NULL;
 | 
			
		||||
	p_surewarehk_Load_Rsa_Pubkey = NULL;
 | 
			
		||||
	p_surewarehk_Free = NULL;
 | 
			
		||||
	p_surewarehk_Rsa_Priv_Dec = NULL;
 | 
			
		||||
	p_surewarehk_Rsa_Sign = NULL;
 | 
			
		||||
	p_surewarehk_Dsa_Sign = NULL;
 | 
			
		||||
	p_surewarehk_Info_Pubkey = NULL;
 | 
			
		||||
	p_surewarehk_Load_Dsa_Pubkey = NULL;
 | 
			
		||||
	p_surewarehk_Mod_Exp = NULL;
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int surewarehk_finish()
 | 
			
		||||
{
 | 
			
		||||
	int to_return = 1;
 | 
			
		||||
	if(surewarehk_dso == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_FINISH,ENGINE_R_NOT_LOADED);
 | 
			
		||||
		to_return = 0;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	p_surewarehk_Finish();
 | 
			
		||||
	if(!DSO_free(surewarehk_dso))
 | 
			
		||||
		{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_FINISH,ENGINE_R_DSO_FAILURE);
 | 
			
		||||
		to_return = 0;
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 err:
 | 
			
		||||
	if (logstream)
 | 
			
		||||
		BIO_free(logstream);
 | 
			
		||||
	surewarehk_dso = NULL;
 | 
			
		||||
	p_surewarehk_Init = NULL;
 | 
			
		||||
	p_surewarehk_Finish = NULL;
 | 
			
		||||
	p_surewarehk_Rand_Bytes = NULL;
 | 
			
		||||
	p_surewarehk_Rand_Seed = NULL;
 | 
			
		||||
	p_surewarehk_Load_Privkey = NULL;
 | 
			
		||||
	p_surewarehk_Load_Rsa_Pubkey = NULL;
 | 
			
		||||
	p_surewarehk_Free = NULL;
 | 
			
		||||
	p_surewarehk_Rsa_Priv_Dec = NULL;
 | 
			
		||||
	p_surewarehk_Rsa_Sign = NULL;
 | 
			
		||||
	p_surewarehk_Dsa_Sign = NULL;
 | 
			
		||||
	p_surewarehk_Info_Pubkey = NULL;
 | 
			
		||||
	p_surewarehk_Load_Dsa_Pubkey = NULL;
 | 
			
		||||
	p_surewarehk_Mod_Exp = NULL;
 | 
			
		||||
	return to_return;
 | 
			
		||||
}
 | 
			
		||||
static void surewarehk_error_handling(char *const msg,int func,int ret)
 | 
			
		||||
{
 | 
			
		||||
	switch (ret)
 | 
			
		||||
	{
 | 
			
		||||
		case SUREWAREHOOK_ERROR_UNIT_FAILURE:
 | 
			
		||||
			ENGINEerr(func,ENGINE_R_UNIT_FAILURE);
 | 
			
		||||
			break;
 | 
			
		||||
		case SUREWAREHOOK_ERROR_FALLBACK:
 | 
			
		||||
			ENGINEerr(func,ENGINE_R_REQUEST_FALLBACK);
 | 
			
		||||
			break;
 | 
			
		||||
		case SUREWAREHOOK_ERROR_DATA_SIZE:
 | 
			
		||||
			ENGINEerr(func,ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
 | 
			
		||||
			break;
 | 
			
		||||
		case SUREWAREHOOK_ERROR_INVALID_PAD:
 | 
			
		||||
			ENGINEerr(func,RSA_R_PADDING_CHECK_FAILED);
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			ENGINEerr(func,ENGINE_R_REQUEST_FAILED);
 | 
			
		||||
			break;
 | 
			
		||||
		case 1:/*nothing*/
 | 
			
		||||
			msg[0]='\0';
 | 
			
		||||
	}
 | 
			
		||||
	if (*msg)
 | 
			
		||||
	{
 | 
			
		||||
		ERR_add_error_data(1,msg);
 | 
			
		||||
		if (logstream)
 | 
			
		||||
		{
 | 
			
		||||
			CRYPTO_w_lock(CRYPTO_LOCK_BIO);
 | 
			
		||||
			BIO_write(logstream, msg, strlen(msg));
 | 
			
		||||
			CRYPTO_w_unlock(CRYPTO_LOCK_BIO);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
static int surewarehk_rand_bytes(unsigned char *buf, int num)
 | 
			
		||||
{
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	char msg[64]="ENGINE_rand_bytes";
 | 
			
		||||
	if(!p_surewarehk_Rand_Bytes)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_RAND_BYTES,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		ret = p_surewarehk_Rand_Bytes(msg,buf, num);
 | 
			
		||||
		surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RAND_BYTES,ret);
 | 
			
		||||
	}
 | 
			
		||||
	return ret==1 ? 1 : 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void surewarehk_rand_seed(const void *buf, int num)
 | 
			
		||||
{
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	char msg[64]="ENGINE_rand_seed";
 | 
			
		||||
	if(!p_surewarehk_Rand_Seed)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_RAND_SEED,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		ret = p_surewarehk_Rand_Seed(msg,buf, num);
 | 
			
		||||
		surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RAND_SEED,ret);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
static void surewarehk_rand_add(const void *buf, int num, double entropy)
 | 
			
		||||
{
 | 
			
		||||
	surewarehk_rand_seed(buf,num);
 | 
			
		||||
}
 | 
			
		||||
static EVP_PKEY* sureware_load_public(const char *key_id,char *hptr,unsigned long el,char keytype)
 | 
			
		||||
{
 | 
			
		||||
	EVP_PKEY *res = NULL;
 | 
			
		||||
	RSA *rsatmp = NULL;
 | 
			
		||||
	DSA *dsatmp=NULL;
 | 
			
		||||
	char msg[64]="sureware_load_public";
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	switch (keytype)
 | 
			
		||||
	{
 | 
			
		||||
	case 1: /*RSA*/
 | 
			
		||||
		/* set private external reference */
 | 
			
		||||
		rsatmp = RSA_new_method(&engine_surewarehk);
 | 
			
		||||
		RSA_set_ex_data(rsatmp,rsaHndidx,hptr);
 | 
			
		||||
		rsatmp->flags |= RSA_FLAG_EXT_PKEY;
 | 
			
		||||
 | 
			
		||||
		/* set public big nums*/
 | 
			
		||||
		rsatmp->e = BN_new();
 | 
			
		||||
		rsatmp->n = BN_new();
 | 
			
		||||
		bn_expand2(rsatmp->e, el/sizeof(BN_ULONG));
 | 
			
		||||
		bn_expand2(rsatmp->n, el/sizeof(BN_ULONG));
 | 
			
		||||
		if (!rsatmp->e || rsatmp->e->dmax!=(int)(el/sizeof(BN_ULONG))|| 
 | 
			
		||||
			!rsatmp->n || rsatmp->n->dmax!=(int)(el/sizeof(BN_ULONG)))
 | 
			
		||||
			goto err;
 | 
			
		||||
		ret=p_surewarehk_Load_Rsa_Pubkey(msg,key_id,el,rsatmp->n->d, rsatmp->e->d);
 | 
			
		||||
		surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);
 | 
			
		||||
		if (ret!=1)
 | 
			
		||||
		{
 | 
			
		||||
			ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
		/* normalise pub e and pub n */
 | 
			
		||||
		rsatmp->e->top=el/sizeof(BN_ULONG);
 | 
			
		||||
		bn_fix_top(rsatmp->e);
 | 
			
		||||
		rsatmp->n->top=el/sizeof(BN_ULONG);
 | 
			
		||||
		bn_fix_top(rsatmp->n);
 | 
			
		||||
		/* create an EVP object: engine + rsa key */
 | 
			
		||||
		res = EVP_PKEY_new();
 | 
			
		||||
		EVP_PKEY_assign_RSA(res, rsatmp);
 | 
			
		||||
		break;
 | 
			
		||||
	case 2:/*DSA*/
 | 
			
		||||
		/* set private/public external reference */
 | 
			
		||||
		dsatmp = DSA_new_method(&engine_surewarehk);
 | 
			
		||||
		DSA_set_ex_data(dsatmp,dsaHndidx,hptr);
 | 
			
		||||
		/*dsatmp->flags |= DSA_FLAG_EXT_PKEY;*/
 | 
			
		||||
 | 
			
		||||
		/* set public key*/
 | 
			
		||||
		dsatmp->pub_key = BN_new();
 | 
			
		||||
		dsatmp->p = BN_new();
 | 
			
		||||
		dsatmp->q = BN_new();
 | 
			
		||||
		dsatmp->g = BN_new();
 | 
			
		||||
		bn_expand2(dsatmp->pub_key, el/sizeof(BN_ULONG));
 | 
			
		||||
		bn_expand2(dsatmp->p, el/sizeof(BN_ULONG));
 | 
			
		||||
		bn_expand2(dsatmp->q, 20/sizeof(BN_ULONG));
 | 
			
		||||
		bn_expand2(dsatmp->g, el/sizeof(BN_ULONG));
 | 
			
		||||
		if (!dsatmp->pub_key || dsatmp->pub_key->dmax!=(int)(el/sizeof(BN_ULONG))|| 
 | 
			
		||||
			!dsatmp->p || dsatmp->p->dmax!=(int)(el/sizeof(BN_ULONG)) ||
 | 
			
		||||
			!dsatmp->q || dsatmp->q->dmax!=20/sizeof(BN_ULONG) ||
 | 
			
		||||
			!dsatmp->g || dsatmp->g->dmax!=(int)(el/sizeof(BN_ULONG)))
 | 
			
		||||
			goto err;
 | 
			
		||||
 | 
			
		||||
		ret=p_surewarehk_Load_Dsa_Pubkey(msg,key_id,el,
 | 
			
		||||
										dsatmp->pub_key->d, 
 | 
			
		||||
										dsatmp->p->d,
 | 
			
		||||
										dsatmp->q->d,
 | 
			
		||||
										dsatmp->g->d);
 | 
			
		||||
		surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);
 | 
			
		||||
		if (ret!=1)
 | 
			
		||||
		{
 | 
			
		||||
			ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
		/* set parameters */
 | 
			
		||||
		/* normalise pubkey and parameters in case of */
 | 
			
		||||
		dsatmp->pub_key->top=el/sizeof(BN_ULONG);
 | 
			
		||||
		bn_fix_top(dsatmp->pub_key);
 | 
			
		||||
		dsatmp->p->top=el/sizeof(BN_ULONG);
 | 
			
		||||
		bn_fix_top(dsatmp->p);
 | 
			
		||||
		dsatmp->q->top=20/sizeof(BN_ULONG);
 | 
			
		||||
		bn_fix_top(dsatmp->q);
 | 
			
		||||
		dsatmp->g->top=el/sizeof(BN_ULONG);
 | 
			
		||||
		bn_fix_top(dsatmp->g);
 | 
			
		||||
 | 
			
		||||
		/* create an EVP object: engine + rsa key */
 | 
			
		||||
		res = EVP_PKEY_new();
 | 
			
		||||
		EVP_PKEY_assign_DSA(res, dsatmp);
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	return res;
 | 
			
		||||
 err:
 | 
			
		||||
	if (res)
 | 
			
		||||
		EVP_PKEY_free(res);
 | 
			
		||||
	if (rsatmp)
 | 
			
		||||
		RSA_free(rsatmp);
 | 
			
		||||
	if (dsatmp)
 | 
			
		||||
		DSA_free(dsatmp);
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
static EVP_PKEY *surewarehk_load_privkey(const char *key_id,
 | 
			
		||||
										const char *passphrase)
 | 
			
		||||
{
 | 
			
		||||
	EVP_PKEY *res = NULL;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	unsigned long el=0;
 | 
			
		||||
	char *hptr=NULL;
 | 
			
		||||
	char keytype=0;
 | 
			
		||||
	char msg[64]="ENGINE_load_privkey";
 | 
			
		||||
 | 
			
		||||
	if(!p_surewarehk_Load_Privkey)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		ret=p_surewarehk_Load_Privkey(msg,key_id,&hptr,&el,&keytype);
 | 
			
		||||
		if (ret!=1)
 | 
			
		||||
		{
 | 
			
		||||
			ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
 | 
			
		||||
			ERR_add_error_data(1,msg);		
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
			res=sureware_load_public(key_id,hptr,el,keytype);
 | 
			
		||||
	}
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
static EVP_PKEY *surewarehk_load_pubkey(const char *key_id,
 | 
			
		||||
	const char *passphrase)
 | 
			
		||||
{
 | 
			
		||||
	EVP_PKEY *res = NULL;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	unsigned long el=0;
 | 
			
		||||
	char *hptr=NULL;
 | 
			
		||||
	char keytype=0;
 | 
			
		||||
	char msg[64]="ENGINE_load_pubkey";
 | 
			
		||||
 | 
			
		||||
	if(!p_surewarehk_Info_Pubkey)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		/* call once to identify if DSA or RSA */
 | 
			
		||||
		ret=p_surewarehk_Info_Pubkey(msg,key_id,&el,&keytype);
 | 
			
		||||
		if (ret!=1)
 | 
			
		||||
		{
 | 
			
		||||
			ENGINEerr(ENGINE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
 | 
			
		||||
			ERR_add_error_data(1,msg);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
			res=sureware_load_public(key_id,hptr,el,keytype);
 | 
			
		||||
	}
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This cleans up an RSA/DSA KM key(do not destroy the key into the hardware)
 | 
			
		||||
, called when ex_data is freed */
 | 
			
		||||
static void surewarehk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
 | 
			
		||||
	int index,long argl, void *argp)
 | 
			
		||||
{
 | 
			
		||||
	if(!p_surewarehk_Free)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_EX_FREE,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		p_surewarehk_Free((char *)item,0);
 | 
			
		||||
}
 | 
			
		||||
/* This cleans up an DH KM key (destroys the key into hardware), 
 | 
			
		||||
called when ex_data is freed */
 | 
			
		||||
static void surewarehk_dh_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
 | 
			
		||||
	int index,long argl, void *argp)
 | 
			
		||||
{
 | 
			
		||||
	if(!p_surewarehk_Free)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_EX_FREE,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
		p_surewarehk_Free((char *)item,1);
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
* return number of decrypted bytes
 | 
			
		||||
*/
 | 
			
		||||
static int surewarehk_rsa_priv_dec(int flen,unsigned char *from,unsigned char *to,
 | 
			
		||||
			RSA *rsa,int padding)
 | 
			
		||||
{
 | 
			
		||||
	int ret=0,tlen;
 | 
			
		||||
	char *buf=NULL,*hptr=NULL;
 | 
			
		||||
	char msg[64]="ENGINE_rsa_priv_dec";
 | 
			
		||||
	if (!p_surewarehk_Rsa_Priv_Dec)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	/* extract ref to private key */
 | 
			
		||||
	else if (!(hptr=RSA_get_ex_data(rsa, rsaHndidx)))
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ENGINE_R_MISSING_KEY_COMPONENTS);
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
	/* analyse what padding we can do into the hardware */
 | 
			
		||||
	if (padding==RSA_PKCS1_PADDING)
 | 
			
		||||
	{
 | 
			
		||||
		/* do it one shot */
 | 
			
		||||
		ret=p_surewarehk_Rsa_Priv_Dec(msg,flen,from,&tlen,to,hptr,SUREWARE_PKCS1_PAD);
 | 
			
		||||
		surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ret);
 | 
			
		||||
		if (ret!=1)
 | 
			
		||||
			goto err;
 | 
			
		||||
		ret=tlen;
 | 
			
		||||
	}
 | 
			
		||||
	else /* do with no padding into hardware */
 | 
			
		||||
	{
 | 
			
		||||
		ret=p_surewarehk_Rsa_Priv_Dec(msg,flen,from,&tlen,to,hptr,SUREWARE_NO_PAD);
 | 
			
		||||
		surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ret);
 | 
			
		||||
		if (ret!=1)
 | 
			
		||||
			goto err;
 | 
			
		||||
		/* intermediate buffer for padding */
 | 
			
		||||
		if ((buf=OPENSSL_malloc(tlen)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
			RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
		memcpy(buf,to,tlen);/* transfert to into buf */
 | 
			
		||||
		switch (padding) /* check padding in software */
 | 
			
		||||
		{
 | 
			
		||||
#ifndef NO_SHA
 | 
			
		||||
		case RSA_PKCS1_OAEP_PADDING:
 | 
			
		||||
			ret=RSA_padding_check_PKCS1_OAEP(to,tlen,(unsigned char *)buf,tlen,tlen,NULL,0);
 | 
			
		||||
			break;
 | 
			
		||||
#endif
 | 
			
		||||
 		case RSA_SSLV23_PADDING:
 | 
			
		||||
			ret=RSA_padding_check_SSLv23(to,tlen,(unsigned char *)buf,flen,tlen);
 | 
			
		||||
			break;
 | 
			
		||||
		case RSA_NO_PADDING:
 | 
			
		||||
			ret=RSA_padding_check_none(to,tlen,(unsigned char *)buf,flen,tlen);
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,RSA_R_UNKNOWN_PADDING_TYPE);
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
		if (ret < 0)
 | 
			
		||||
			RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_DEC,RSA_R_PADDING_CHECK_FAILED);
 | 
			
		||||
	}
 | 
			
		||||
err:
 | 
			
		||||
	if (buf)
 | 
			
		||||
	{
 | 
			
		||||
		memset(buf,0,tlen);
 | 
			
		||||
		OPENSSL_free(buf);
 | 
			
		||||
	}
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
* Does what OpenSSL rsa_priv_enc does.
 | 
			
		||||
*/
 | 
			
		||||
static int surewarehk_rsa_sign(int flen,unsigned char *from,unsigned char *to,
 | 
			
		||||
			    RSA *rsa,int padding)
 | 
			
		||||
{
 | 
			
		||||
	int ret=0,tlen;
 | 
			
		||||
	char *hptr=NULL;
 | 
			
		||||
	char msg[64]="ENGINE_rsa_sign";
 | 
			
		||||
	if (!p_surewarehk_Rsa_Sign)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	/* extract ref to private key */
 | 
			
		||||
	else if (!(hptr=RSA_get_ex_data(rsa, rsaHndidx)))
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,ENGINE_R_MISSING_KEY_COMPONENTS);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		switch (padding)
 | 
			
		||||
		{
 | 
			
		||||
		case RSA_PKCS1_PADDING: /* do it in one shot */
 | 
			
		||||
			ret=p_surewarehk_Rsa_Sign(msg,flen,from,&tlen,to,hptr,SUREWARE_PKCS1_PAD);
 | 
			
		||||
			surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,ret);
 | 
			
		||||
			break;
 | 
			
		||||
		case RSA_NO_PADDING:
 | 
			
		||||
		default:
 | 
			
		||||
			RSAerr(ENGINE_F_SUREWAREHK_RSA_PRIV_ENC,RSA_R_UNKNOWN_PADDING_TYPE);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return ret==1 ? tlen : ret;
 | 
			
		||||
}
 | 
			
		||||
/* DSA sign and verify */
 | 
			
		||||
static	DSA_SIG * surewarehk_dsa_do_sign(const unsigned char *from, int flen, DSA *dsa)
 | 
			
		||||
{
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	char *hptr=NULL;
 | 
			
		||||
	DSA_SIG *psign=NULL;
 | 
			
		||||
	char msg[64]="ENGINE_dsa_do_sign";
 | 
			
		||||
	if (!p_surewarehk_Dsa_Sign)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	/* extract ref to private key */
 | 
			
		||||
	else if (!(hptr=DSA_get_ex_data(dsa, dsaHndidx)))
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ENGINE_R_MISSING_KEY_COMPONENTS);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		if((psign = DSA_SIG_new()) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
			ENGINEerr(ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			goto err;
 | 
			
		||||
		}
 | 
			
		||||
		psign->r=BN_new();
 | 
			
		||||
		psign->s=BN_new();
 | 
			
		||||
		bn_expand2(psign->r, 20/sizeof(BN_ULONG));
 | 
			
		||||
		bn_expand2(psign->s, 20/sizeof(BN_ULONG));
 | 
			
		||||
		if (!psign->r || psign->r->dmax!=20/sizeof(BN_ULONG) ||
 | 
			
		||||
			!psign->s || psign->s->dmax!=20/sizeof(BN_ULONG))
 | 
			
		||||
			goto err;
 | 
			
		||||
		ret=p_surewarehk_Dsa_Sign(msg,flen,from,psign->r->d,psign->s->d,hptr);
 | 
			
		||||
		surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_DSA_DO_SIGN,ret);
 | 
			
		||||
	}
 | 
			
		||||
	psign->r->top=20/sizeof(BN_ULONG);
 | 
			
		||||
	bn_fix_top(psign->r);
 | 
			
		||||
	psign->s->top=20/sizeof(BN_ULONG);
 | 
			
		||||
	bn_fix_top(psign->s);
 | 
			
		||||
 | 
			
		||||
err:	
 | 
			
		||||
	if (psign)
 | 
			
		||||
	{
 | 
			
		||||
		DSA_SIG_free(psign);
 | 
			
		||||
		psign=NULL;
 | 
			
		||||
	}
 | 
			
		||||
	return psign;
 | 
			
		||||
}
 | 
			
		||||
static int surewarehk_modexp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
							const BIGNUM *m, BN_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	char msg[64]="ENGINE_modexp";
 | 
			
		||||
	if (!p_surewarehk_Mod_Exp)
 | 
			
		||||
	{
 | 
			
		||||
		ENGINEerr(ENGINE_F_SUREWAREHK_MOD_EXP,ENGINE_R_NOT_INITIALISED);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		bn_expand2(r,m->top);
 | 
			
		||||
		if (r && r->dmax==m->top)
 | 
			
		||||
		{
 | 
			
		||||
			/* do it*/
 | 
			
		||||
			ret=p_surewarehk_Mod_Exp(msg,m->top*sizeof(BN_ULONG),m->d,p->top*sizeof(BN_ULONG),
 | 
			
		||||
									p->d,a->top*sizeof(BN_ULONG),a->d,r->d);
 | 
			
		||||
			surewarehk_error_handling(msg,ENGINE_F_SUREWAREHK_MOD_EXP,ret);
 | 
			
		||||
			if (ret==1)
 | 
			
		||||
			{
 | 
			
		||||
				/* normalise result */
 | 
			
		||||
				r->top=m->top;
 | 
			
		||||
				bn_fix_top(r);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
#endif /* !NO_HW_SureWare */
 | 
			
		||||
#endif /* !NO_HW */
 | 
			
		||||
							
								
								
									
										1057
									
								
								crypto/engine/hw_ubsec.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1057
									
								
								crypto/engine/hw_ubsec.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										191
									
								
								crypto/engine/vendor_defns/aep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										191
									
								
								crypto/engine/vendor_defns/aep.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,191 @@
 | 
			
		||||
/* This header declares the necessary definitions for using the exponentiation
 | 
			
		||||
 * acceleration capabilities, and rnd number generation of the AEP card. 
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *
 | 
			
		||||
 * Some AEP defines
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*Successful return value*/
 | 
			
		||||
#define AEP_R_OK                                0x00000000
 | 
			
		||||
 | 
			
		||||
/*Miscelleanous unsuccessful return value*/
 | 
			
		||||
#define AEP_R_GENERAL_ERROR                     0x10000001
 | 
			
		||||
 | 
			
		||||
/*Insufficient host memory*/
 | 
			
		||||
#define AEP_R_HOST_MEMORY                       0x10000002
 | 
			
		||||
 | 
			
		||||
#define AEP_R_FUNCTION_FAILED                   0x10000006
 | 
			
		||||
 | 
			
		||||
/*Invalid arguments in function call*/
 | 
			
		||||
#define AEP_R_ARGUMENTS_BAD                     0x10020000
 | 
			
		||||
 | 
			
		||||
#define AEP_R_NO_TARGET_RESOURCES				0x10030000
 | 
			
		||||
 | 
			
		||||
/*Error occuring on socket operation*/
 | 
			
		||||
#define AEP_R_SOCKERROR							0x10000010
 | 
			
		||||
 | 
			
		||||
/*Socket has been closed from the other end*/
 | 
			
		||||
#define AEP_R_SOCKEOF							0x10000011
 | 
			
		||||
 | 
			
		||||
/*Invalid handles*/
 | 
			
		||||
#define AEP_R_CONNECTION_HANDLE_INVALID         0x100000B3
 | 
			
		||||
 | 
			
		||||
#define AEP_R_TRANSACTION_HANDLE_INVALID		0x10040000
 | 
			
		||||
 | 
			
		||||
/*Transaction has not yet returned from accelerator*/
 | 
			
		||||
#define AEP_R_TRANSACTION_NOT_READY				0x00010000
 | 
			
		||||
 | 
			
		||||
/*There is already a thread waiting on this transaction*/
 | 
			
		||||
#define AEP_R_TRANSACTION_CLAIMED				0x10050000
 | 
			
		||||
 | 
			
		||||
/*The transaction timed out*/
 | 
			
		||||
#define AEP_R_TIMED_OUT							0x10060000
 | 
			
		||||
 | 
			
		||||
#define AEP_R_FXN_NOT_IMPLEMENTED				0x10070000
 | 
			
		||||
 | 
			
		||||
#define AEP_R_TARGET_ERROR						0x10080000
 | 
			
		||||
 | 
			
		||||
/*Error in the AEP daemon process*/
 | 
			
		||||
#define AEP_R_DAEMON_ERROR						0x10090000
 | 
			
		||||
 | 
			
		||||
/*Invalid ctx id*/
 | 
			
		||||
#define AEP_R_INVALID_CTX_ID					0x10009000
 | 
			
		||||
 | 
			
		||||
#define AEP_R_NO_KEY_MANAGER					0x1000a000
 | 
			
		||||
 | 
			
		||||
/*Error obtaining a mutex*/
 | 
			
		||||
#define AEP_R_MUTEX_BAD                         0x000001A0
 | 
			
		||||
 | 
			
		||||
/*Fxn call before AEP_Initialise ot after AEP_Finialise*/
 | 
			
		||||
#define AEP_R_AEPAPI_NOT_INITIALIZED			0x10000190
 | 
			
		||||
 | 
			
		||||
/*AEP_Initialise has already been called*/
 | 
			
		||||
#define AEP_R_AEPAPI_ALREADY_INITIALIZED		0x10000191
 | 
			
		||||
 | 
			
		||||
/*Maximum number of connections to daemon reached*/
 | 
			
		||||
#define AEP_R_NO_MORE_CONNECTION_HNDLS			0x10000200
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *
 | 
			
		||||
 * Some AEP Type definitions
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* an unsigned 8-bit value */
 | 
			
		||||
typedef unsigned char				AEP_U8;
 | 
			
		||||
 | 
			
		||||
/* an unsigned 8-bit character */
 | 
			
		||||
typedef char					AEP_CHAR;
 | 
			
		||||
 | 
			
		||||
/* a BYTE-sized Boolean flag */
 | 
			
		||||
typedef AEP_U8					AEP_BBOOL;
 | 
			
		||||
 | 
			
		||||
/*Unsigned value, at least 16 bits long*/
 | 
			
		||||
typedef unsigned short				AEP_U16;
 | 
			
		||||
 | 
			
		||||
/* an unsigned value, at least 32 bits long */
 | 
			
		||||
#ifdef SIXTY_FOUR_BIT_LONG
 | 
			
		||||
typedef unsigned int				AEP_U32;
 | 
			
		||||
#else
 | 
			
		||||
typedef unsigned long				AEP_U32;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef SIXTY_FOUR_BIT_LONG
 | 
			
		||||
typedef unsigned long				AEP_U64;
 | 
			
		||||
#else
 | 
			
		||||
typedef struct { unsigned long l1, l2; }	AEP_U64;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* at least 32 bits; each bit is a Boolean flag */
 | 
			
		||||
typedef AEP_U32			AEP_FLAGS;
 | 
			
		||||
 | 
			
		||||
typedef AEP_U8	    	*AEP_U8_PTR;
 | 
			
		||||
typedef AEP_CHAR    	*AEP_CHAR_PTR;
 | 
			
		||||
typedef AEP_U32			*AEP_U32_PTR;
 | 
			
		||||
typedef AEP_U64			*AEP_U64_PTR;
 | 
			
		||||
typedef void        	*AEP_VOID_PTR;
 | 
			
		||||
 | 
			
		||||
/* Pointer to a AEP_VOID_PTR-- i.e., pointer to pointer to void */
 | 
			
		||||
typedef AEP_VOID_PTR 	*AEP_VOID_PTR_PTR;
 | 
			
		||||
 | 
			
		||||
/*Used to identify an AEP connection handle*/
 | 
			
		||||
typedef AEP_U32					AEP_CONNECTION_HNDL;
 | 
			
		||||
 | 
			
		||||
/*Pointer to an AEP connection handle*/
 | 
			
		||||
typedef AEP_CONNECTION_HNDL 	*AEP_CONNECTION_HNDL_PTR;
 | 
			
		||||
 | 
			
		||||
/*Used by an application (in conjunction with the apps process id) to 
 | 
			
		||||
identify an individual transaction*/
 | 
			
		||||
typedef AEP_U32					AEP_TRANSACTION_ID;
 | 
			
		||||
 | 
			
		||||
/*Pointer to an applications transaction identifier*/
 | 
			
		||||
typedef AEP_TRANSACTION_ID 		*AEP_TRANSACTION_ID_PTR;
 | 
			
		||||
 | 
			
		||||
/*Return value type*/
 | 
			
		||||
typedef AEP_U32					AEP_RV;
 | 
			
		||||
 | 
			
		||||
#define MAX_PROCESS_CONNECTIONS 5
 | 
			
		||||
 | 
			
		||||
#define RAND_BLK_SIZE 1024
 | 
			
		||||
 | 
			
		||||
typedef enum{
 | 
			
		||||
        NotConnected=   0,
 | 
			
		||||
        Connected=              1,
 | 
			
		||||
        InUse=                  2
 | 
			
		||||
} AEP_CONNECTION_STATE;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct AEP_CONNECTION_ENTRY{
 | 
			
		||||
        AEP_CONNECTION_STATE    conn_state;
 | 
			
		||||
        AEP_CONNECTION_HNDL     conn_hndl;
 | 
			
		||||
} AEP_CONNECTION_ENTRY;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
AEP_RV GetBigNumSize(void* ArbBigNum, AEP_U32* BigNumSize);
 | 
			
		||||
AEP_RV MakeAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum);
 | 
			
		||||
AEP_RV ConvertAEPBigNum(void* ArbBigNum, AEP_U32 BigNumSize, unsigned char* AEP_BigNum);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef unsigned int t_AEP_OpenConnection(unsigned int *phConnection);
 | 
			
		||||
 | 
			
		||||
typedef unsigned int t_AEP_ModExp(unsigned int hConnection, void *a, void *p,
 | 
			
		||||
                                  void *n, void *r,AEP_U64 *tranid);
 | 
			
		||||
 | 
			
		||||
typedef unsigned int t_AEP_ModExpCrt(unsigned int hConnection,void *a, void *p,
 | 
			
		||||
                                  void *q, void *dmp1, void *dmq1,void *iqmp,
 | 
			
		||||
						  void *r,AEP_U64 *tranid);
 | 
			
		||||
 | 
			
		||||
typedef unsigned int t_AEP_GenRandom(AEP_CONNECTION_HNDL             hConnection,
 | 
			
		||||
                AEP_U32                                 Len,
 | 
			
		||||
                AEP_U32                                 Type,
 | 
			
		||||
                AEP_VOID_PTR                    pResult,
 | 
			
		||||
                AEP_TRANSACTION_ID*             pidTransID
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef unsigned int t_AEP_Initialize(AEP_VOID_PTR pInitArgs);
 | 
			
		||||
typedef unsigned int t_AEP_Finalize();
 | 
			
		||||
typedef unsigned int t_AEP_SetBNCallBacks(
 | 
			
		||||
                AEP_RV (*GetBigNumSizeFunc)(),
 | 
			
		||||
                AEP_RV (*MakeAEPBigNumFunc)(),
 | 
			
		||||
                AEP_RV (*ConverAEPBigNumFunc)()
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
/* These are the static string constants for the DSO file name and the function
 | 
			
		||||
 * symbol names to bind to. 
 | 
			
		||||
*/
 | 
			
		||||
static const char *AEP_LIBNAME = "aep";
 | 
			
		||||
 | 
			
		||||
static const char *AEP_F1    = "AEP_ModExp";
 | 
			
		||||
static const char *AEP_F2    = "AEP_ModExpCrt";
 | 
			
		||||
static const char *AEP_F3    = "AEP_GenRandom";
 | 
			
		||||
static const char *AEP_F4    = "AEP_Finalize";
 | 
			
		||||
static const char *AEP_F5    = "AEP_Initialize";
 | 
			
		||||
static const char *AEP_F6    = "AEP_OpenConnection";
 | 
			
		||||
static const char *AEP_F7    = "AEP_SetBNCallBacks";
 | 
			
		||||
							
								
								
									
										105
									
								
								crypto/engine/vendor_defns/hw_ubsec.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								crypto/engine/vendor_defns/hw_ubsec.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,105 @@
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright 2000
 | 
			
		||||
 *  Broadcom Corporation
 | 
			
		||||
 *  16215 Alton Parkway
 | 
			
		||||
 *  PO Box 57013
 | 
			
		||||
 *  Irvine CA 92619-7013
 | 
			
		||||
 *
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
/* 
 | 
			
		||||
 * Broadcom Corporation uBSec SDK 
 | 
			
		||||
 */
 | 
			
		||||
/*
 | 
			
		||||
 * Character device header file.
 | 
			
		||||
 */
 | 
			
		||||
/*
 | 
			
		||||
 * Revision History:
 | 
			
		||||
 *
 | 
			
		||||
 * October 2000 JTT Created.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define MAX_PUBLIC_KEY_BITS (1024)
 | 
			
		||||
#define MAX_PUBLIC_KEY_BYTES (1024/8)
 | 
			
		||||
#define SHA_BIT_SIZE  (160)
 | 
			
		||||
#define MAX_CRYPTO_KEY_LENGTH 24
 | 
			
		||||
#define MAX_MAC_KEY_LENGTH 64
 | 
			
		||||
#define UBSEC_CRYPTO_DEVICE_NAME ((unsigned char *)"/dev/ubscrypt")
 | 
			
		||||
#define UBSEC_KEY_DEVICE_NAME ((unsigned char *)"/dev/ubskey")
 | 
			
		||||
 | 
			
		||||
/* Math command types. */
 | 
			
		||||
#define UBSEC_MATH_MODADD 0x0001
 | 
			
		||||
#define UBSEC_MATH_MODSUB 0x0002
 | 
			
		||||
#define UBSEC_MATH_MODMUL 0x0004
 | 
			
		||||
#define UBSEC_MATH_MODEXP 0x0008
 | 
			
		||||
#define UBSEC_MATH_MODREM 0x0010
 | 
			
		||||
#define UBSEC_MATH_MODINV 0x0020
 | 
			
		||||
 | 
			
		||||
/* RNG command types. */
 | 
			
		||||
#define UBSEC_RNG_DIRECT  0x0001
 | 
			
		||||
#define UBSEC_RNG_SHA1    0x0002
 | 
			
		||||
 | 
			
		||||
typedef long ubsec_MathCommand_t;
 | 
			
		||||
typedef long ubsec_RNGCommand_t;
 | 
			
		||||
 | 
			
		||||
typedef struct ubsec_crypto_context_s {
 | 
			
		||||
	unsigned int	flags;
 | 
			
		||||
	unsigned char	crypto[MAX_CRYPTO_KEY_LENGTH];
 | 
			
		||||
	unsigned char 	auth[MAX_MAC_KEY_LENGTH];
 | 
			
		||||
} ubsec_crypto_context_t, *ubsec_crypto_context_p;
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Predeclare the function pointer types that we dynamically load from the DSO.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_ubsec_bytes_to_bits(unsigned char *n, int bytes);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_ubsec_bits_to_bytes(int bits);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_ubsec_open(unsigned char *device);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_ubsec_close(int fd);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_diffie_hellman_generate_ioctl (int fd,
 | 
			
		||||
	unsigned char *x, int *x_len, unsigned char *y, int *y_len, 
 | 
			
		||||
	unsigned char *g, int g_len, unsigned char *m, int m_len,
 | 
			
		||||
	unsigned char *userX, int userX_len, int random_bits);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_diffie_hellman_agree_ioctl (int fd,
 | 
			
		||||
	unsigned char *x, int x_len, unsigned char *y, int y_len, 
 | 
			
		||||
	unsigned char *m, int m_len, unsigned char *k, int *k_len);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_rsa_mod_exp_ioctl (int fd,
 | 
			
		||||
	unsigned char *x, int x_len, unsigned char *m, int m_len,
 | 
			
		||||
	unsigned char *e, int e_len, unsigned char *y, int *y_len);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_rsa_mod_exp_crt_ioctl (int fd,
 | 
			
		||||
	unsigned char *x, int x_len, unsigned char *qinv, int qinv_len,
 | 
			
		||||
	unsigned char *edq, int edq_len, unsigned char *q, int q_len,
 | 
			
		||||
	unsigned char *edp, int edp_len, unsigned char *p, int p_len,
 | 
			
		||||
	unsigned char *y, int *y_len);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_dsa_sign_ioctl (int fd,
 | 
			
		||||
	int hash, unsigned char *data, int data_len, 
 | 
			
		||||
	unsigned char *rndom, int random_len, 
 | 
			
		||||
	unsigned char *p, int p_len, unsigned char *q, int q_len,
 | 
			
		||||
	unsigned char *g, int g_len, unsigned char *key, int key_len,
 | 
			
		||||
	unsigned char *r, int *r_len, unsigned char *s, int *s_len);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_dsa_verify_ioctl (int fd,
 | 
			
		||||
	int hash, unsigned char *data, int data_len,
 | 
			
		||||
	unsigned char *p, int p_len, unsigned char *q, int q_len,
 | 
			
		||||
	unsigned char *g, int g_len, unsigned char *key, int key_len,
 | 
			
		||||
	unsigned char *r, int r_len, unsigned char *s, int s_len,
 | 
			
		||||
	unsigned char *v, int *v_len);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_math_accelerate_ioctl(int fd, ubsec_MathCommand_t command,
 | 
			
		||||
	unsigned char *ModN, int *ModN_len, unsigned char *ExpE, int *ExpE_len, 
 | 
			
		||||
	unsigned char *ParamA, int *ParamA_len, unsigned char *ParamB, int *ParamB_len,
 | 
			
		||||
	unsigned char *Result, int *Result_len);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_rng_ioctl(int fd, ubsec_RNGCommand_t command,
 | 
			
		||||
	unsigned char *Result, int *Result_len);
 | 
			
		||||
 | 
			
		||||
typedef int t_UBSEC_max_key_len_ioctl(int fd, int *max_key_len);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										214
									
								
								crypto/engine/vendor_defns/keyclient.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										214
									
								
								crypto/engine/vendor_defns/keyclient.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,214 @@
 | 
			
		||||
#ifndef HEADER_KEYCLIENT_H
 | 
			
		||||
#define HEADER_KEYCLIENT_H
 | 
			
		||||
 | 
			
		||||
/* Stop name-munging before it begins */
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* This header is consistent with the "libclient" header but has been modified
 | 
			
		||||
 * and pruned (esp. virtually all explanations and comments have gone) for
 | 
			
		||||
 * inclusion in openssl. */
 | 
			
		||||
 | 
			
		||||
#if 0 /* Not used in openssl */
 | 
			
		||||
/* The obligatory nonsense associated with porting shared libraries to win32 */
 | 
			
		||||
#if defined(KSCLIENT_BUILD)
 | 
			
		||||
#define KC_INTERFACE __declspec(dllexport)
 | 
			
		||||
#elif defined(KSCLIENT_USE)
 | 
			
		||||
#define KC_INTERFACE __declspec(dllimport)
 | 
			
		||||
#else
 | 
			
		||||
#define KC_INTERFACE
 | 
			
		||||
#endif
 | 
			
		||||
#else
 | 
			
		||||
#define KC_INTERFACE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * TYPES
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct _keyclient_ctx	keyclient_ctx;
 | 
			
		||||
 | 
			
		||||
typedef struct _ctx_locking_table {
 | 
			
		||||
	/* These functions return zero for failure. */
 | 
			
		||||
	int (*ctx_lock)(const void *, unsigned int);
 | 
			
		||||
	int (*ctx_unlock)(const void *, unsigned int);
 | 
			
		||||
} ctx_locking_table;
 | 
			
		||||
 | 
			
		||||
typedef struct _global_locking_table {
 | 
			
		||||
	void (*lock)(void);
 | 
			
		||||
	void (*unlock)(void);
 | 
			
		||||
} global_locking_table;
 | 
			
		||||
 | 
			
		||||
#define KC_MAX_PUBKEY_ASN 512	/* If the key doesn't fit, don't try */
 | 
			
		||||
typedef struct _keyclient_key_t {
 | 
			
		||||
	enum {
 | 
			
		||||
		KC_KEY_RSA = 0,
 | 
			
		||||
		KC_KEY_DSA = 1
 | 
			
		||||
	} key_type;
 | 
			
		||||
	unsigned int der_len;
 | 
			
		||||
	unsigned char der[KC_MAX_PUBKEY_ASN];
 | 
			
		||||
} keyclient_key_t;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ENUMS
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Different "operation" types */
 | 
			
		||||
typedef enum {
 | 
			
		||||
	KC_FIRST_OP_INDEX = 0,
 | 
			
		||||
	/* RSA operations */
 | 
			
		||||
	KC_RSA_FIRST_OP = KC_FIRST_OP_INDEX,
 | 
			
		||||
	KC_RSA_PUB_ENCRYPT = KC_RSA_FIRST_OP,
 | 
			
		||||
	KC_RSA_PUB_DECRYPT,
 | 
			
		||||
	KC_RSA_PRIV_ENCRYPT,
 | 
			
		||||
	KC_RSA_PRIV_DECRYPT,
 | 
			
		||||
	KC_RSA_SIGN,
 | 
			
		||||
	KC_RSA_VERIFY,
 | 
			
		||||
	KC_RSA_LAST_OP = KC_RSA_VERIFY,
 | 
			
		||||
	/* DSA operations */
 | 
			
		||||
	KC_DSA_FIRST_OP,
 | 
			
		||||
	KC_DSA_SIGN = KC_DSA_FIRST_OP,
 | 
			
		||||
	KC_DSA_VERIFY,
 | 
			
		||||
	KC_DSA_LAST_OP = KC_DSA_VERIFY,
 | 
			
		||||
	/* Round it out */
 | 
			
		||||
	KC_LAST_OP_INDEX = KC_DSA_LAST_OP
 | 
			
		||||
} keyclient_op_t;
 | 
			
		||||
 | 
			
		||||
/* Different "padding" types */
 | 
			
		||||
typedef enum {
 | 
			
		||||
	KC_FIRST_PAD_INDEX = 0,
 | 
			
		||||
	/* No padding (works for RSA and DSA) */
 | 
			
		||||
	KC_PADDING_NONE = KC_FIRST_PAD_INDEX,
 | 
			
		||||
	KC_PADDING_DSA = KC_PADDING_NONE,
 | 
			
		||||
	/* RSA padding schemes */
 | 
			
		||||
	KC_PADDING_RSA_PKCS1,
 | 
			
		||||
	KC_PADDING_RSA_SSLV23,
 | 
			
		||||
	KC_PADDING_RSA_PKCS1_OAEP,
 | 
			
		||||
	/* Round it out */
 | 
			
		||||
	KC_LAST_PAD_INDEX = KC_PADDING_RSA_PKCS1_OAEP
 | 
			
		||||
} keyclient_pad_t;
 | 
			
		||||
 | 
			
		||||
/* Different "return" types */
 | 
			
		||||
typedef enum {
 | 
			
		||||
	KC_RET_OK = 0,
 | 
			
		||||
	KC_RET_ERR_INTERNAL, /* Bug */
 | 
			
		||||
	KC_RET_ERR_BAD_ADDRESS, /* Bad address string */
 | 
			
		||||
	KC_RET_ERR_NO_CONNECT, /* Can not connect to the address */
 | 
			
		||||
	KC_RET_ERR_MEM, /* Memory error, insufficient space or some such */
 | 
			
		||||
	KC_RET_ERR_REF_MISUSE, /* Reference count corruption */
 | 
			
		||||
	KC_RET_ERR_INVALID_LOCKS, /* Caller provided inconsistent callbacks */
 | 
			
		||||
	KC_RET_ERR_REQUEST_ENCODING, /* Error encoding the request */
 | 
			
		||||
	KC_RET_ERR_RESPONSE_DECODING, /* Error decoding the response */
 | 
			
		||||
	KC_RET_ERR_SELECT, /* Error in underlying select() call */
 | 
			
		||||
	KC_RET_ERR_NETWORK_IO, /* Error in network I/O calls */
 | 
			
		||||
	KC_RET_ERR_CTX_LOCK, /* lock() callback returned failure! */
 | 
			
		||||
	KC_RET_ERR_CTX_UNLOCK, /* unlock() callback returned failure! */
 | 
			
		||||
	KC_RET_ERR_REQUEST_SPACE, /* The request can not fit in the provided space */
 | 
			
		||||
	KC_RET_ERR_RESULT_SPACE, /* The response can not fit in the provided space */
 | 
			
		||||
	KC_RET_ERR_RESPONSE_MISMATCH, /* We received someone else's response? */
 | 
			
		||||
	KC_RET_ERR_PRIVATE_EMBED, /* Cannot embed private keys in requests */
 | 
			
		||||
	KC_RET_ERR_FLAG_COMBO, /* A bad combination of bitwise flags was used */
 | 
			
		||||
	KC_RET_ERR_NULL1, /* Parameter 1 was NULL */
 | 
			
		||||
	KC_RET_ERR_NULL2, /* Parameter 2 was NULL */
 | 
			
		||||
	KC_RET_ERR_NULL3, /* Parameter 3 was NULL */
 | 
			
		||||
	KC_RET_ERR_NULL4, /* Parameter 4 was NULL */
 | 
			
		||||
	KC_RET_ERR_NULL5, /* Parameter 5 was NULL */
 | 
			
		||||
	KC_RET_ERR_NULL6, /* Parameter 6 was NULL */
 | 
			
		||||
	KC_RET_ERR_NULL7, /* Parameter 7 was NULL */
 | 
			
		||||
	KC_RET_ERR_NULL8, /* Parameter 8 was NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL1, /* Parameter 1 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL2, /* Parameter 2 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL3, /* Parameter 3 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL4, /* Parameter 4 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL5, /* Parameter 5 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL6, /* Parameter 6 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL7, /* Parameter 7 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_NON_NULL8, /* Parameter 8 was *not* NULL */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE1, /* Parameter 1 was out of range */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE2, /* Parameter 2 was out of range */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE3, /* Parameter 3 was out of range */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE4, /* Parameter 4 was out of range */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE5, /* Parameter 5 was out of range */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE6, /* Parameter 6 was out of range */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE7, /* Parameter 7 was out of range */
 | 
			
		||||
	KC_RET_ERR_BAD_RANGE8, /* Parameter 8 was out of range */
 | 
			
		||||
	/* These errors are all "soft" - if keyclient_keyop() returns one of
 | 
			
		||||
	 * these values, then the operation completed successfully but the
 | 
			
		||||
	 * underlying payload of the response had its internal "error" value set
 | 
			
		||||
	 * to something other than KS_OP_ERR_OK. */
 | 
			
		||||
	KC_RET_SOFT_UNKNOWN_OPERATION = 200, /* The keyserver doesn't support that */
 | 
			
		||||
	KC_RET_SOFT_NO_SUCH_KEY, /* The keyserver doesn't have that key */
 | 
			
		||||
	KC_RET_SOFT_NO_DATA, /* Data was required but was not supplied */
 | 
			
		||||
	KC_RET_SOFT_OP_FAILED, /* The key operation on the server did not work */
 | 
			
		||||
	KC_RET_SOFT_MISC /* An error that is not currently aliased was received */
 | 
			
		||||
} KC_RET;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Context flags (used in keyclient_create) */
 | 
			
		||||
 | 
			
		||||
#define KC_FLAG_USE_LOCKING		0x01
 | 
			
		||||
#define KC_FLAG_NO_LOCKING		0x02
 | 
			
		||||
#define KC_FLAG_PERSISTENT_CONN		0x04
 | 
			
		||||
#define KC_FLAG_PID_CHECK		0x08
 | 
			
		||||
#define KC_FLAG_PERSISTENT_RETRY	0x10
 | 
			
		||||
#define KC_FLAG_PERSISTENT_LATE		0x20
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * FUNCTIONS
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE KC_RET keyclient_set_global_locks(const global_locking_table *locking);
 | 
			
		||||
typedef KC_RET t_keyclient_set_global_locks(const global_locking_table *locking);
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE KC_RET keyclient_create(keyclient_ctx **ctx, const char *target_string,
 | 
			
		||||
		unsigned int flags, const ctx_locking_table *locking);
 | 
			
		||||
typedef KC_RET t_keyclient_create(keyclient_ctx **ctx, const char *target_string,
 | 
			
		||||
		unsigned int flags, const ctx_locking_table *locking);
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE KC_RET keyclient_release(keyclient_ctx *ctx);
 | 
			
		||||
typedef KC_RET t_keyclient_release(keyclient_ctx *ctx);
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE KC_RET keyclient_dup(keyclient_ctx *ctx);
 | 
			
		||||
typedef KC_RET t_keyclient_dup(keyclient_ctx *ctx);
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE KC_RET keyclient_get_uid(const keyclient_ctx *ctx, unsigned int *uid);
 | 
			
		||||
typedef KC_RET t_keyclient_get_uid(const keyclient_ctx *ctx, unsigned int *uid);
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE KC_RET keyclient_keyop(keyclient_ctx *ctx, keyclient_op_t operation,
 | 
			
		||||
		const unsigned char *data, unsigned int data_len,
 | 
			
		||||
		unsigned char *result, unsigned int *result_len,
 | 
			
		||||
		keyclient_pad_t padding, const unsigned char *keyhash);
 | 
			
		||||
typedef KC_RET t_keyclient_keyop(keyclient_ctx *ctx, keyclient_op_t operation,
 | 
			
		||||
		const unsigned char *data, unsigned int data_len,
 | 
			
		||||
		unsigned char *result, unsigned int *result_len,
 | 
			
		||||
		keyclient_pad_t padding, const unsigned char *keyhash);
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE KC_RET keyclient_pubkeyop(keyclient_ctx *ctx, keyclient_op_t operation,
 | 
			
		||||
		const unsigned char *data, unsigned int data_len,
 | 
			
		||||
		unsigned char *result, unsigned int *result_len,
 | 
			
		||||
		keyclient_pad_t padding, const keyclient_key_t *pubkey);
 | 
			
		||||
typedef KC_RET t_keyclient_pubkeyop(keyclient_ctx *ctx, keyclient_op_t operation,
 | 
			
		||||
		const unsigned char *data, unsigned int data_len,
 | 
			
		||||
		unsigned char *result, unsigned int *result_len,
 | 
			
		||||
		keyclient_pad_t padding, const keyclient_key_t *pubkey);
 | 
			
		||||
 | 
			
		||||
typedef struct _keyclient_symbol_table {
 | 
			
		||||
	t_keyclient_set_global_locks *keyclient_set_global_locks;
 | 
			
		||||
	t_keyclient_create *keyclient_create;
 | 
			
		||||
	t_keyclient_release *keyclient_release;
 | 
			
		||||
	t_keyclient_dup *keyclient_dup;
 | 
			
		||||
	t_keyclient_get_uid *keyclient_get_uid;
 | 
			
		||||
	t_keyclient_keyop *keyclient_keyop;
 | 
			
		||||
	t_keyclient_pubkeyop *keyclient_pubkeyop;
 | 
			
		||||
} keyclient_symbol_table;
 | 
			
		||||
 | 
			
		||||
KC_INTERFACE void keyclient_bind_symbols(keyclient_symbol_table *funcs);
 | 
			
		||||
typedef void t_keyclient_bind_symbols(keyclient_symbol_table *funcs);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										239
									
								
								crypto/engine/vendor_defns/sureware.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										239
									
								
								crypto/engine/vendor_defns/sureware.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,239 @@
 | 
			
		||||
/*
 | 
			
		||||
* Written by Corinne Dive-Reclus(cdive@baltimore.com)
 | 
			
		||||
*
 | 
			
		||||
* Copyright@2001 Baltimore Technologies Ltd.
 | 
			
		||||
*																								*	
 | 
			
		||||
*		THIS FILE IS PROVIDED BY BALTIMORE TECHNOLOGIES ``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 BALTIMORE TECHNOLOGIES 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.																			*
 | 
			
		||||
*
 | 
			
		||||
* 
 | 
			
		||||
*/
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
#define SW_EXPORT	__declspec ( dllexport )
 | 
			
		||||
#else
 | 
			
		||||
#define SW_EXPORT
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	List of exposed SureWare errors
 | 
			
		||||
*/
 | 
			
		||||
#define SUREWAREHOOK_ERROR_FAILED		-1
 | 
			
		||||
#define SUREWAREHOOK_ERROR_FALLBACK		-2
 | 
			
		||||
#define SUREWAREHOOK_ERROR_UNIT_FAILURE -3
 | 
			
		||||
#define SUREWAREHOOK_ERROR_DATA_SIZE -4
 | 
			
		||||
#define SUREWAREHOOK_ERROR_INVALID_PAD -5
 | 
			
		||||
/*
 | 
			
		||||
* -----------------WARNING-----------------------------------
 | 
			
		||||
* In all the following functions:
 | 
			
		||||
* msg is a string with at least 24 bytes free.
 | 
			
		||||
* A 24 bytes string will be concatenated to the existing content of msg. 
 | 
			
		||||
*/
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare Initialisation function
 | 
			
		||||
*	in param threadsafe, if !=0, thread safe enabled
 | 
			
		||||
*	return SureWareHOOK_ERROR_UNIT_FAILURE if failure, 1 if success
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Init_t(char*const msg,int threadsafe);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Init_t SureWareHook_Init;
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare Finish function
 | 
			
		||||
*/
 | 
			
		||||
typedef void SureWareHook_Finish_t();
 | 
			
		||||
extern SW_EXPORT SureWareHook_Finish_t SureWareHook_Finish;
 | 
			
		||||
/*
 | 
			
		||||
*	 PRE_CONDITION:
 | 
			
		||||
*		DO NOT CALL ANY OF THE FOLLOWING FUNCTIONS IN CASE OF INIT FAILURE
 | 
			
		||||
*/
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare RAND Bytes function
 | 
			
		||||
*	In case of failure, the content of buf is unpredictable.
 | 
			
		||||
*	return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FALLBACK if function not available in hardware
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*			SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
 | 
			
		||||
*			SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
 | 
			
		||||
*
 | 
			
		||||
*	in/out param buf : a num bytes long buffer where random bytes will be put
 | 
			
		||||
*	in param num : the number of bytes into buf
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Rand_Bytes_t(char*const msg,unsigned char *buf, int num);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Rand_Bytes_t SureWareHook_Rand_Bytes;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare RAND Seed function
 | 
			
		||||
*	Adds some seed to the Hardware Random Number Generator
 | 
			
		||||
*	return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FALLBACK if function not available in hardware
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*			SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
 | 
			
		||||
*			SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
 | 
			
		||||
*
 | 
			
		||||
*	in param buf : the seed to add into the HRNG
 | 
			
		||||
*	in param num : the number of bytes into buf
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Rand_Seed_t(char*const msg,const void *buf, int num);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Rand_Seed_t SureWareHook_Rand_Seed;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare Load Private Key function
 | 
			
		||||
*	return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*	No hardware is contact for this function.
 | 
			
		||||
*
 | 
			
		||||
*	in param key_id :the name of the private protected key file without the extension
 | 
			
		||||
						".sws"
 | 
			
		||||
*	out param hptr : a pointer to a buffer allocated by SureWare_Hook
 | 
			
		||||
*	out param num: the effective key length in bytes
 | 
			
		||||
*	out param keytype: 1 if RSA 2 if DSA
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Load_Privkey_t(char*const msg,const char *key_id,char **hptr,unsigned long *num,char *keytype);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Load_Privkey_t SureWareHook_Load_Privkey;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare Info Public Key function
 | 
			
		||||
*	return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*	No hardware is contact for this function.
 | 
			
		||||
*
 | 
			
		||||
*	in param key_id :the name of the private protected key file without the extension
 | 
			
		||||
						".swp"
 | 
			
		||||
*	out param hptr : a pointer to a buffer allocated by SureWare_Hook
 | 
			
		||||
*	out param num: the effective key length in bytes
 | 
			
		||||
*	out param keytype: 1 if RSA 2 if DSA
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Info_Pubkey_t(char*const msg,const char *key_id,unsigned long *num,
 | 
			
		||||
										char *keytype);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Info_Pubkey_t SureWareHook_Info_Pubkey;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare Load Public Key function
 | 
			
		||||
*	return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*	No hardware is contact for this function.
 | 
			
		||||
*
 | 
			
		||||
*	in param key_id :the name of the public protected key file without the extension
 | 
			
		||||
						".swp"
 | 
			
		||||
*	in param num : the bytes size of n and e
 | 
			
		||||
*	out param n: where to write modulus in bn format
 | 
			
		||||
*	out param e: where to write exponent in bn format
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Load_Rsa_Pubkey_t(char*const msg,const char *key_id,unsigned long num,
 | 
			
		||||
										unsigned long *n, unsigned long *e);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Load_Rsa_Pubkey_t SureWareHook_Load_Rsa_Pubkey;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare Load DSA Public Key function
 | 
			
		||||
*	return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*	No hardware is contact for this function.
 | 
			
		||||
*
 | 
			
		||||
*	in param key_id :the name of the public protected key file without the extension
 | 
			
		||||
						".swp"
 | 
			
		||||
*	in param num : the bytes size of n and e
 | 
			
		||||
*	out param pub: where to write pub key in bn format
 | 
			
		||||
*	out param p: where to write prime in bn format
 | 
			
		||||
*	out param q: where to write sunprime (length 20 bytes) in bn format
 | 
			
		||||
*	out param g: where to write base in bn format
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Load_Dsa_Pubkey_t(char*const msg,const char *key_id,unsigned long num,
 | 
			
		||||
										unsigned long *pub, unsigned long *p,unsigned long*q,
 | 
			
		||||
										unsigned long *g);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Load_Dsa_Pubkey_t SureWareHook_Load_Dsa_Pubkey;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	SureWare Free function
 | 
			
		||||
*	Destroy the key into the hardware if destroy==1
 | 
			
		||||
*/
 | 
			
		||||
typedef void SureWareHook_Free_t(char *p,int destroy);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Free_t SureWareHook_Free;
 | 
			
		||||
 | 
			
		||||
#define SUREWARE_PKCS1_PAD 1
 | 
			
		||||
#define SUREWARE_ISO9796_PAD 2
 | 
			
		||||
#define SUREWARE_NO_PAD 0
 | 
			
		||||
/*
 | 
			
		||||
* SureWare RSA Private Decryption
 | 
			
		||||
* return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*			SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
 | 
			
		||||
*			SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
 | 
			
		||||
*
 | 
			
		||||
*	in param flen : byte size of from and to
 | 
			
		||||
*	in param from : encrypted data buffer, should be a not-null valid pointer
 | 
			
		||||
*	out param tlen: byte size of decrypted data, if error, unexpected value
 | 
			
		||||
*	out param to : decrypted data buffer, should be a not-null valid pointer
 | 
			
		||||
*   in param prsa: a protected key pointer, should be a not-null valid pointer
 | 
			
		||||
*   int padding: padding id as follow
 | 
			
		||||
*					SUREWARE_PKCS1_PAD
 | 
			
		||||
*					SUREWARE_NO_PAD
 | 
			
		||||
*
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Rsa_Priv_Dec_t(char*const msg,int flen,unsigned char *from,
 | 
			
		||||
										int *tlen,unsigned char *to,
 | 
			
		||||
										char *prsa,int padding);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Rsa_Priv_Dec_t SureWareHook_Rsa_Priv_Dec;
 | 
			
		||||
/*
 | 
			
		||||
* SureWare RSA Signature
 | 
			
		||||
* return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*			SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
 | 
			
		||||
*			SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
 | 
			
		||||
*
 | 
			
		||||
*	in param flen : byte size of from and to
 | 
			
		||||
*	in param from : encrypted data buffer, should be a not-null valid pointer
 | 
			
		||||
*	out param tlen: byte size of decrypted data, if error, unexpected value
 | 
			
		||||
*	out param to : decrypted data buffer, should be a not-null valid pointer
 | 
			
		||||
*   in param prsa: a protected key pointer, should be a not-null valid pointer
 | 
			
		||||
*   int padding: padding id as follow
 | 
			
		||||
*					SUREWARE_PKCS1_PAD
 | 
			
		||||
*					SUREWARE_ISO9796_PAD
 | 
			
		||||
*
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Rsa_Sign_t(char*const msg,int flen,unsigned char *from,
 | 
			
		||||
										int *tlen,unsigned char *to,
 | 
			
		||||
										char *prsa,int padding);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Rsa_Sign_t SureWareHook_Rsa_Sign;
 | 
			
		||||
/*
 | 
			
		||||
* SureWare DSA Signature
 | 
			
		||||
* return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*			SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
 | 
			
		||||
*			SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
 | 
			
		||||
*
 | 
			
		||||
*	in param flen : byte size of from and to
 | 
			
		||||
*	in param from : encrypted data buffer, should be a not-null valid pointer
 | 
			
		||||
*	out param to : decrypted data buffer, should be a 40bytes valid pointer
 | 
			
		||||
*   in param pdsa: a protected key pointer, should be a not-null valid pointer
 | 
			
		||||
*
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Dsa_Sign_t(char*const msg,int flen,const unsigned char *from,
 | 
			
		||||
										unsigned long *r,unsigned long *s,char *pdsa);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Dsa_Sign_t SureWareHook_Dsa_Sign;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
* SureWare Mod Exp
 | 
			
		||||
* return 1 if success
 | 
			
		||||
*			SureWareHOOK_ERROR_FAILED if error while processing
 | 
			
		||||
*			SureWareHOOK_ERROR_UNIT_FAILURE if hardware failure
 | 
			
		||||
*			SUREWAREHOOK_ERROR_DATA_SIZE wrong size for buf
 | 
			
		||||
*
 | 
			
		||||
*	mod and res are mlen bytes long.
 | 
			
		||||
*	exp is elen bytes long
 | 
			
		||||
*	data is dlen bytes long
 | 
			
		||||
*	mlen,elen and dlen are all multiple of sizeof(unsigned long)
 | 
			
		||||
*/
 | 
			
		||||
typedef int SureWareHook_Mod_Exp_t(char*const msg,int mlen,const unsigned long *mod,
 | 
			
		||||
									int elen,const unsigned long *exp,
 | 
			
		||||
									int dlen,unsigned long *data,
 | 
			
		||||
									unsigned long *res);
 | 
			
		||||
extern SW_EXPORT SureWareHook_Mod_Exp_t SureWareHook_Mod_Exp;
 | 
			
		||||
 | 
			
		||||
@@ -786,7 +786,7 @@ void ERR_add_error_data(int num, ...)
 | 
			
		||||
				if (p == NULL)
 | 
			
		||||
					{
 | 
			
		||||
					OPENSSL_free(str);
 | 
			
		||||
					return;
 | 
			
		||||
					goto err;
 | 
			
		||||
					}
 | 
			
		||||
				else
 | 
			
		||||
					str=p;
 | 
			
		||||
@@ -796,6 +796,7 @@ void ERR_add_error_data(int num, ...)
 | 
			
		||||
		}
 | 
			
		||||
	ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
 | 
			
		||||
 | 
			
		||||
err:
 | 
			
		||||
	va_end(args);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -133,6 +133,7 @@ typedef struct err_state_st
 | 
			
		||||
#define ERR_LIB_RAND		36
 | 
			
		||||
#define ERR_LIB_DSO		37
 | 
			
		||||
#define ERR_LIB_ENGINE		38
 | 
			
		||||
#define ERR_LIB_COMP		41
 | 
			
		||||
 | 
			
		||||
#define ERR_LIB_USER		128
 | 
			
		||||
 | 
			
		||||
@@ -163,6 +164,7 @@ typedef struct err_state_st
 | 
			
		||||
#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),ERR_file_name,__LINE__)
 | 
			
		||||
#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),ERR_file_name,__LINE__)
 | 
			
		||||
#define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),ERR_file_name,__LINE__)
 | 
			
		||||
#define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),ERR_file_name,__LINE__)
 | 
			
		||||
 | 
			
		||||
/* Borland C seems too stupid to be able to shift and do longs in
 | 
			
		||||
 * the pre-processor :-( */
 | 
			
		||||
@@ -213,6 +215,7 @@ typedef struct err_state_st
 | 
			
		||||
#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12
 | 
			
		||||
#define ERR_R_DSO_LIB	ERR_LIB_DSO
 | 
			
		||||
#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE
 | 
			
		||||
#define ERR_R_COMP_LIB	ERR_LIB_COMP
 | 
			
		||||
 | 
			
		||||
/* fatal error */
 | 
			
		||||
#define	ERR_R_MALLOC_FAILURE			(1|ERR_R_FATAL)
 | 
			
		||||
 
 | 
			
		||||
@@ -465,7 +465,8 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_WPENDING: /* More to write in buffer */
 | 
			
		||||
		ret=ctx->buf_len-ctx->buf_off;
 | 
			
		||||
		if ((ret == 0) && (ctx->base64.num != 0))
 | 
			
		||||
		if ((ret == 0) && (ctx->encode != B64_NONE)
 | 
			
		||||
			&& (ctx->base64.num != 0))
 | 
			
		||||
			ret=1;
 | 
			
		||||
		else if (ret <= 0)
 | 
			
		||||
			ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
 | 
			
		||||
@@ -500,7 +501,7 @@ again:
 | 
			
		||||
				goto again;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		else if (ctx->base64.num != 0)
 | 
			
		||||
		else if (ctx->encode != B64_NONE && ctx->base64.num != 0)
 | 
			
		||||
			{
 | 
			
		||||
			ctx->buf_off=0;
 | 
			
		||||
			EVP_EncodeFinal(&(ctx->base64),
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@ static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 | 
			
		||||
		       const unsigned char *iv, int enc);
 | 
			
		||||
 | 
			
		||||
IMPLEMENT_BLOCK_CIPHER(bf, bf_ks, BF, bf_ks, NID_bf, 8, 16, 8,
 | 
			
		||||
			0, bf_init_key, NULL, 
 | 
			
		||||
			EVP_CIPH_VARIABLE_LENGTH, bf_init_key, NULL, 
 | 
			
		||||
			EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
 | 
			
		||||
	
 | 
			
		||||
static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 | 
			
		||||
 
 | 
			
		||||
@@ -554,9 +554,9 @@ int	EVP_read_pw_string(char *buf,int length,const char *prompt,int verify);
 | 
			
		||||
void	EVP_set_pw_prompt(char *prompt);
 | 
			
		||||
char *	EVP_get_pw_prompt(void);
 | 
			
		||||
 | 
			
		||||
int	EVP_BytesToKey(const EVP_CIPHER *type,EVP_MD *md,unsigned char *salt,
 | 
			
		||||
		unsigned char *data, int datal, int count,
 | 
			
		||||
		unsigned char *key,unsigned char *iv);
 | 
			
		||||
int     EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md,
 | 
			
		||||
		const unsigned char *salt, const unsigned char *data, int datal,
 | 
			
		||||
       		int count, unsigned char *key, unsigned char *iv);
 | 
			
		||||
 | 
			
		||||
int	EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
 | 
			
		||||
		unsigned char *key, unsigned char *iv);
 | 
			
		||||
@@ -603,8 +603,6 @@ int	EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
 | 
			
		||||
		char *out, int *outl);
 | 
			
		||||
int	EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
 | 
			
		||||
 | 
			
		||||
void	ERR_load_EVP_strings(void );
 | 
			
		||||
 | 
			
		||||
void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
 | 
			
		||||
int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
 | 
			
		||||
int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
 | 
			
		||||
@@ -777,6 +775,7 @@ void EVP_PBE_cleanup(void);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_EVP_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the EVP functions. */
 | 
			
		||||
 | 
			
		||||
@@ -849,4 +848,3 @@ void EVP_PBE_cleanup(void);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -95,9 +95,9 @@ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, unsigned char *salt,
 | 
			
		||||
	     unsigned char *data, int datal, int count, unsigned char *key,
 | 
			
		||||
	     unsigned char *iv)
 | 
			
		||||
int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, 
 | 
			
		||||
             const unsigned char *salt, const unsigned char *data, int datal, 
 | 
			
		||||
             int count, unsigned char *key, unsigned char *iv)
 | 
			
		||||
	{
 | 
			
		||||
	EVP_MD_CTX c;
 | 
			
		||||
	unsigned char md_buf[EVP_MAX_MD_SIZE];
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@
 | 
			
		||||
static EVP_MD md4_md=
 | 
			
		||||
	{
 | 
			
		||||
	NID_md4,
 | 
			
		||||
	0,
 | 
			
		||||
	NID_md4WithRSAEncryption,
 | 
			
		||||
	MD4_DIGEST_LENGTH,
 | 
			
		||||
	MD4_Init,
 | 
			
		||||
	MD4_Update,
 | 
			
		||||
 
 | 
			
		||||
@@ -198,7 +198,7 @@
 | 
			
		||||
   *
 | 
			
		||||
   * 					<appro@fy.chalmers.se>
 | 
			
		||||
   */
 | 
			
		||||
#  if defined(__i386)
 | 
			
		||||
#  if defined(__i386) || defined(__i386__)
 | 
			
		||||
#   define ROTATE(a,n)	({ register unsigned int ret;	\
 | 
			
		||||
				asm (			\
 | 
			
		||||
				"roll %1,%0"		\
 | 
			
		||||
@@ -224,7 +224,7 @@
 | 
			
		||||
 */
 | 
			
		||||
# if defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM) && !defined(NO_INLINE_ASM)
 | 
			
		||||
  /* some GNU C inline assembler templates by <appro@fy.chalmers.se> */
 | 
			
		||||
#  if defined(__i386) && !defined(I386_ONLY)
 | 
			
		||||
#  if (defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)
 | 
			
		||||
#   define BE_FETCH32(a)	({ register unsigned int l=(a);\
 | 
			
		||||
				asm (			\
 | 
			
		||||
				"bswapl %0"		\
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@
 | 
			
		||||
void md4_block_host_order (MD4_CTX *c, const void *p,int num);
 | 
			
		||||
void md4_block_data_order (MD4_CTX *c, const void *p,int num);
 | 
			
		||||
 | 
			
		||||
#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
/*
 | 
			
		||||
 * *_block_host_order is expected to handle aligned data while
 | 
			
		||||
 * *_block_data_order - unaligned. As algorithm and host (x86)
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef MD5_ASM
 | 
			
		||||
# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
#  define md5_block_host_order md5_block_asm_host_order
 | 
			
		||||
# elif defined(__sparc) && defined(ULTRASPARC)
 | 
			
		||||
   void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,int num);
 | 
			
		||||
@@ -77,7 +77,7 @@
 | 
			
		||||
void md5_block_host_order (MD5_CTX *c, const void *p,int num);
 | 
			
		||||
void md5_block_data_order (MD5_CTX *c, const void *p,int num);
 | 
			
		||||
 | 
			
		||||
#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
/*
 | 
			
		||||
 * *_block_host_order is expected to handle aligned data while
 | 
			
		||||
 * *_block_data_order - unaligned. As algorithm and host (x86)
 | 
			
		||||
 
 | 
			
		||||
@@ -43,6 +43,13 @@ lib:	$(LIBOBJ)
 | 
			
		||||
	- $(RANLIB) $(LIB)
 | 
			
		||||
	@touch lib
 | 
			
		||||
 | 
			
		||||
obj_dat.h: obj_dat.pl obj_mac.h
 | 
			
		||||
	perl obj_dat.pl obj_mac.h obj_dat.h
 | 
			
		||||
 | 
			
		||||
# objects.pl both reads and writes obj_mac.num
 | 
			
		||||
obj_mac.h: objects.pl objects.txt obj_mac.num
 | 
			
		||||
	perl objects.pl objects.txt obj_mac.num obj_mac.h
 | 
			
		||||
 | 
			
		||||
files:
 | 
			
		||||
	$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,10 @@
 | 
			
		||||
/* lib/obj/obj_dat.h */
 | 
			
		||||
/* crypto/objects/obj_dat.h */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl obj_dat.pl objects.h obj_dat.h
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
@@ -56,17 +62,12 @@
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM Objects.h by obj_dat.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl obj_dat.pl objects.h obj_dat.h
 | 
			
		||||
 */
 | 
			
		||||
#define NUM_NID 404
 | 
			
		||||
#define NUM_SN 403
 | 
			
		||||
#define NUM_LN 403
 | 
			
		||||
#define NUM_OBJ 377
 | 
			
		||||
 | 
			
		||||
#define NUM_NID 393
 | 
			
		||||
#define NUM_SN 392
 | 
			
		||||
#define NUM_LN 392
 | 
			
		||||
#define NUM_OBJ 366
 | 
			
		||||
 | 
			
		||||
static unsigned char lvalues[2896]={
 | 
			
		||||
static unsigned char lvalues[2949]={
 | 
			
		||||
0x00,                                        /* [  0] OBJ_undef */
 | 
			
		||||
0x2A,0x86,0x48,0x86,0xF7,0x0D,               /* [  1] OBJ_rsadsi */
 | 
			
		||||
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,          /* [  7] OBJ_pkcs */
 | 
			
		||||
@@ -433,6 +434,17 @@ static unsigned char lvalues[2896]={
 | 
			
		||||
0xBA,0x82,0x58,                              /* [2872] OBJ_dcObject */
 | 
			
		||||
0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x19,/* [2875] OBJ_domainComponent */
 | 
			
		||||
0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0D,/* [2885] OBJ_Domain */
 | 
			
		||||
0x50,                                        /* [2895] OBJ_joint_iso_ccitt */
 | 
			
		||||
0x55,0x01,0x05,                              /* [2896] OBJ_selected_attribute_types */
 | 
			
		||||
0x55,0x01,0x05,0x37,                         /* [2899] OBJ_clearance */
 | 
			
		||||
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x03,/* [2903] OBJ_md4WithRSAEncryption */
 | 
			
		||||
0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0A,     /* [2912] OBJ_ac_proxying */
 | 
			
		||||
0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0B,     /* [2920] OBJ_sinfo_access */
 | 
			
		||||
0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x06,     /* [2928] OBJ_id_aca_encAttrs */
 | 
			
		||||
0x55,0x04,0x48,                              /* [2936] OBJ_role */
 | 
			
		||||
0x55,0x1D,0x24,                              /* [2939] OBJ_policy_constraints */
 | 
			
		||||
0x55,0x1D,0x37,                              /* [2942] OBJ_target_information */
 | 
			
		||||
0x55,0x1D,0x38,                              /* [2945] OBJ_no_rev_avail */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static ASN1_OBJECT nid_objs[NUM_NID]={
 | 
			
		||||
@@ -576,7 +588,8 @@ static ASN1_OBJECT nid_objs[NUM_NID]={
 | 
			
		||||
{"G","givenName",NID_givenName,3,&(lvalues[535]),0},
 | 
			
		||||
{"S","surname",NID_surname,3,&(lvalues[538]),0},
 | 
			
		||||
{"I","initials",NID_initials,3,&(lvalues[541]),0},
 | 
			
		||||
{"UID","uniqueIdentifier",NID_uniqueIdentifier,3,&(lvalues[544]),0},
 | 
			
		||||
{"uniqueIdentifier","uniqueIdentifier",NID_uniqueIdentifier,3,
 | 
			
		||||
	&(lvalues[544]),0},
 | 
			
		||||
{"crlDistributionPoints","X509v3 CRL Distribution Points",
 | 
			
		||||
	NID_crl_distribution_points,3,&(lvalues[547]),0},
 | 
			
		||||
{"RSA-NP-MD5","md5WithRSA",NID_md5WithRSA,5,&(lvalues[550]),0},
 | 
			
		||||
@@ -1045,6 +1058,25 @@ static ASN1_OBJECT nid_objs[NUM_NID]={
 | 
			
		||||
{"dcobject","dcObject",NID_dcObject,3,&(lvalues[2872]),0},
 | 
			
		||||
{"DC","domainComponent",NID_domainComponent,10,&(lvalues[2875]),0},
 | 
			
		||||
{"domain","Domain",NID_Domain,10,&(lvalues[2885]),0},
 | 
			
		||||
{"JOINT-ISO-CCITT","joint-iso-ccitt",NID_joint_iso_ccitt,1,
 | 
			
		||||
	&(lvalues[2895]),0},
 | 
			
		||||
{"selected-attribute-types","Selected Attribute Types",
 | 
			
		||||
	NID_selected_attribute_types,3,&(lvalues[2896]),0},
 | 
			
		||||
{"clearance","clearance",NID_clearance,4,&(lvalues[2899]),0},
 | 
			
		||||
{"RSA-MD4","md4WithRSAEncryption",NID_md4WithRSAEncryption,9,
 | 
			
		||||
	&(lvalues[2903]),0},
 | 
			
		||||
{"ac-proxying","ac-proxying",NID_ac_proxying,8,&(lvalues[2912]),0},
 | 
			
		||||
{"subjectInfoAccess","Subject Information Access",NID_sinfo_access,8,
 | 
			
		||||
	&(lvalues[2920]),0},
 | 
			
		||||
{"id-aca-encAttrs","id-aca-encAttrs",NID_id_aca_encAttrs,8,
 | 
			
		||||
	&(lvalues[2928]),0},
 | 
			
		||||
{"role","role",NID_role,3,&(lvalues[2936]),0},
 | 
			
		||||
{"policyConstraints","X509v3 Policy Constraints",
 | 
			
		||||
	NID_policy_constraints,3,&(lvalues[2939]),0},
 | 
			
		||||
{"targetInformation","X509v3 AC Targeting",NID_target_information,3,
 | 
			
		||||
	&(lvalues[2942]),0},
 | 
			
		||||
{"noRevAvail","X509v3 No Revocation Available",NID_no_rev_avail,3,
 | 
			
		||||
	&(lvalues[2945]),0},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
@@ -1093,6 +1125,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[46]),/* "IDEA-OFB" */
 | 
			
		||||
&(nid_objs[181]),/* "ISO" */
 | 
			
		||||
&(nid_objs[183]),/* "ISO-US" */
 | 
			
		||||
&(nid_objs[393]),/* "JOINT-ISO-CCITT" */
 | 
			
		||||
&(nid_objs[15]),/* "L" */
 | 
			
		||||
&(nid_objs[ 3]),/* "MD2" */
 | 
			
		||||
&(nid_objs[257]),/* "MD4" */
 | 
			
		||||
@@ -1138,6 +1171,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[124]),/* "RLE" */
 | 
			
		||||
&(nid_objs[19]),/* "RSA" */
 | 
			
		||||
&(nid_objs[ 7]),/* "RSA-MD2" */
 | 
			
		||||
&(nid_objs[396]),/* "RSA-MD4" */
 | 
			
		||||
&(nid_objs[ 8]),/* "RSA-MD5" */
 | 
			
		||||
&(nid_objs[96]),/* "RSA-MDC2" */
 | 
			
		||||
&(nid_objs[104]),/* "RSA-NP-MD5" */
 | 
			
		||||
@@ -1154,7 +1188,6 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[16]),/* "ST" */
 | 
			
		||||
&(nid_objs[143]),/* "SXNetID" */
 | 
			
		||||
&(nid_objs[106]),/* "T" */
 | 
			
		||||
&(nid_objs[102]),/* "UID" */
 | 
			
		||||
&(nid_objs[ 0]),/* "UNDEF" */
 | 
			
		||||
&(nid_objs[11]),/* "X500" */
 | 
			
		||||
&(nid_objs[378]),/* "X500algorithms" */
 | 
			
		||||
@@ -1164,6 +1197,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[125]),/* "ZLIB" */
 | 
			
		||||
&(nid_objs[289]),/* "aaControls" */
 | 
			
		||||
&(nid_objs[287]),/* "ac-auditEntity" */
 | 
			
		||||
&(nid_objs[397]),/* "ac-proxying" */
 | 
			
		||||
&(nid_objs[288]),/* "ac-targeting" */
 | 
			
		||||
&(nid_objs[368]),/* "acceptableResponses" */
 | 
			
		||||
&(nid_objs[363]),/* "ad_timestamping" */
 | 
			
		||||
@@ -1178,6 +1212,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[152]),/* "certBag" */
 | 
			
		||||
&(nid_objs[89]),/* "certificatePolicies" */
 | 
			
		||||
&(nid_objs[54]),/* "challengePassword" */
 | 
			
		||||
&(nid_objs[395]),/* "clearance" */
 | 
			
		||||
&(nid_objs[130]),/* "clientAuth" */
 | 
			
		||||
&(nid_objs[131]),/* "codeSigning" */
 | 
			
		||||
&(nid_objs[50]),/* "contentType" */
 | 
			
		||||
@@ -1204,6 +1239,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[355]),/* "id-aca-accessIdentity" */
 | 
			
		||||
&(nid_objs[354]),/* "id-aca-authenticationInfo" */
 | 
			
		||||
&(nid_objs[356]),/* "id-aca-chargingIdentity" */
 | 
			
		||||
&(nid_objs[399]),/* "id-aca-encAttrs" */
 | 
			
		||||
&(nid_objs[357]),/* "id-aca-group" */
 | 
			
		||||
&(nid_objs[358]),/* "id-aca-role" */
 | 
			
		||||
&(nid_objs[176]),/* "id-ad" */
 | 
			
		||||
@@ -1386,6 +1422,7 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[137]),/* "msSGC" */
 | 
			
		||||
&(nid_objs[173]),/* "name" */
 | 
			
		||||
&(nid_objs[369]),/* "noCheck" */
 | 
			
		||||
&(nid_objs[403]),/* "noRevAvail" */
 | 
			
		||||
&(nid_objs[72]),/* "nsBaseUrl" */
 | 
			
		||||
&(nid_objs[76]),/* "nsCaPolicyUrl" */
 | 
			
		||||
&(nid_objs[74]),/* "nsCaRevocationUrl" */
 | 
			
		||||
@@ -1413,9 +1450,11 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[22]),/* "pkcs7-signedData" */
 | 
			
		||||
&(nid_objs[151]),/* "pkcs8ShroudedKeyBag" */
 | 
			
		||||
&(nid_objs[47]),/* "pkcs9" */
 | 
			
		||||
&(nid_objs[401]),/* "policyConstraints" */
 | 
			
		||||
&(nid_objs[385]),/* "private" */
 | 
			
		||||
&(nid_objs[84]),/* "privateKeyUsagePeriod" */
 | 
			
		||||
&(nid_objs[286]),/* "qcStatements" */
 | 
			
		||||
&(nid_objs[400]),/* "role" */
 | 
			
		||||
&(nid_objs[ 6]),/* "rsaEncryption" */
 | 
			
		||||
&(nid_objs[377]),/* "rsaSignature" */
 | 
			
		||||
&(nid_objs[ 1]),/* "rsadsi" */
 | 
			
		||||
@@ -1426,15 +1465,19 @@ static ASN1_OBJECT *sn_objs[NUM_SN]={
 | 
			
		||||
&(nid_objs[159]),/* "sdsiCertificate" */
 | 
			
		||||
&(nid_objs[154]),/* "secretBag" */
 | 
			
		||||
&(nid_objs[386]),/* "security" */
 | 
			
		||||
&(nid_objs[394]),/* "selected-attribute-types" */
 | 
			
		||||
&(nid_objs[129]),/* "serverAuth" */
 | 
			
		||||
&(nid_objs[371]),/* "serviceLocator" */
 | 
			
		||||
&(nid_objs[52]),/* "signingTime" */
 | 
			
		||||
&(nid_objs[387]),/* "snmpv2" */
 | 
			
		||||
&(nid_objs[85]),/* "subjectAltName" */
 | 
			
		||||
&(nid_objs[398]),/* "subjectInfoAccess" */
 | 
			
		||||
&(nid_objs[82]),/* "subjectKeyIdentifier" */
 | 
			
		||||
&(nid_objs[402]),/* "targetInformation" */
 | 
			
		||||
&(nid_objs[293]),/* "textNotice" */
 | 
			
		||||
&(nid_objs[133]),/* "timeStamping" */
 | 
			
		||||
&(nid_objs[375]),/* "trustRoot" */
 | 
			
		||||
&(nid_objs[102]),/* "uniqueIdentifier" */
 | 
			
		||||
&(nid_objs[55]),/* "unstructuredAddress" */
 | 
			
		||||
&(nid_objs[49]),/* "unstructuredName" */
 | 
			
		||||
&(nid_objs[373]),/* "valid" */
 | 
			
		||||
@@ -1503,12 +1546,15 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
 | 
			
		||||
&(nid_objs[167]),/* "S/MIME Capabilities" */
 | 
			
		||||
&(nid_objs[387]),/* "SNMPv2" */
 | 
			
		||||
&(nid_objs[386]),/* "Security" */
 | 
			
		||||
&(nid_objs[394]),/* "Selected Attribute Types" */
 | 
			
		||||
&(nid_objs[143]),/* "Strong Extranet ID" */
 | 
			
		||||
&(nid_objs[398]),/* "Subject Information Access" */
 | 
			
		||||
&(nid_objs[130]),/* "TLS Web Client Authentication" */
 | 
			
		||||
&(nid_objs[129]),/* "TLS Web Server Authentication" */
 | 
			
		||||
&(nid_objs[133]),/* "Time Stamping" */
 | 
			
		||||
&(nid_objs[375]),/* "Trust Root" */
 | 
			
		||||
&(nid_objs[12]),/* "X509" */
 | 
			
		||||
&(nid_objs[402]),/* "X509v3 AC Targeting" */
 | 
			
		||||
&(nid_objs[90]),/* "X509v3 Authority Key Identifier" */
 | 
			
		||||
&(nid_objs[87]),/* "X509v3 Basic Constraints" */
 | 
			
		||||
&(nid_objs[103]),/* "X509v3 CRL Distribution Points" */
 | 
			
		||||
@@ -1519,6 +1565,8 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
 | 
			
		||||
&(nid_objs[126]),/* "X509v3 Extended Key Usage" */
 | 
			
		||||
&(nid_objs[86]),/* "X509v3 Issuer Alternative Name" */
 | 
			
		||||
&(nid_objs[83]),/* "X509v3 Key Usage" */
 | 
			
		||||
&(nid_objs[403]),/* "X509v3 No Revocation Available" */
 | 
			
		||||
&(nid_objs[401]),/* "X509v3 Policy Constraints" */
 | 
			
		||||
&(nid_objs[84]),/* "X509v3 Private Key Usage Period" */
 | 
			
		||||
&(nid_objs[85]),/* "X509v3 Subject Alternative Name" */
 | 
			
		||||
&(nid_objs[82]),/* "X509v3 Subject Key Identifier" */
 | 
			
		||||
@@ -1526,6 +1574,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
 | 
			
		||||
&(nid_objs[185]),/* "X9.57 CM ?" */
 | 
			
		||||
&(nid_objs[289]),/* "aaControls" */
 | 
			
		||||
&(nid_objs[287]),/* "ac-auditEntity" */
 | 
			
		||||
&(nid_objs[397]),/* "ac-proxying" */
 | 
			
		||||
&(nid_objs[288]),/* "ac-targeting" */
 | 
			
		||||
&(nid_objs[364]),/* "ad dvcs" */
 | 
			
		||||
&(nid_objs[376]),/* "algorithm" */
 | 
			
		||||
@@ -1539,6 +1588,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
 | 
			
		||||
&(nid_objs[111]),/* "cast5-ofb" */
 | 
			
		||||
&(nid_objs[152]),/* "certBag" */
 | 
			
		||||
&(nid_objs[54]),/* "challengePassword" */
 | 
			
		||||
&(nid_objs[395]),/* "clearance" */
 | 
			
		||||
&(nid_objs[13]),/* "commonName" */
 | 
			
		||||
&(nid_objs[50]),/* "contentType" */
 | 
			
		||||
&(nid_objs[53]),/* "countersignature" */
 | 
			
		||||
@@ -1581,6 +1631,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
 | 
			
		||||
&(nid_objs[355]),/* "id-aca-accessIdentity" */
 | 
			
		||||
&(nid_objs[354]),/* "id-aca-authenticationInfo" */
 | 
			
		||||
&(nid_objs[356]),/* "id-aca-chargingIdentity" */
 | 
			
		||||
&(nid_objs[399]),/* "id-aca-encAttrs" */
 | 
			
		||||
&(nid_objs[357]),/* "id-aca-group" */
 | 
			
		||||
&(nid_objs[358]),/* "id-aca-role" */
 | 
			
		||||
&(nid_objs[176]),/* "id-ad" */
 | 
			
		||||
@@ -1747,12 +1798,14 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
 | 
			
		||||
&(nid_objs[46]),/* "idea-ofb" */
 | 
			
		||||
&(nid_objs[101]),/* "initials" */
 | 
			
		||||
&(nid_objs[181]),/* "iso" */
 | 
			
		||||
&(nid_objs[393]),/* "joint-iso-ccitt" */
 | 
			
		||||
&(nid_objs[150]),/* "keyBag" */
 | 
			
		||||
&(nid_objs[157]),/* "localKeyID" */
 | 
			
		||||
&(nid_objs[15]),/* "localityName" */
 | 
			
		||||
&(nid_objs[ 3]),/* "md2" */
 | 
			
		||||
&(nid_objs[ 7]),/* "md2WithRSAEncryption" */
 | 
			
		||||
&(nid_objs[257]),/* "md4" */
 | 
			
		||||
&(nid_objs[396]),/* "md4WithRSAEncryption" */
 | 
			
		||||
&(nid_objs[ 4]),/* "md5" */
 | 
			
		||||
&(nid_objs[114]),/* "md5-sha1" */
 | 
			
		||||
&(nid_objs[104]),/* "md5WithRSA" */
 | 
			
		||||
@@ -1806,6 +1859,7 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={
 | 
			
		||||
&(nid_objs[123]),/* "rc5-ofb" */
 | 
			
		||||
&(nid_objs[117]),/* "ripemd160" */
 | 
			
		||||
&(nid_objs[119]),/* "ripemd160WithRSA" */
 | 
			
		||||
&(nid_objs[400]),/* "role" */
 | 
			
		||||
&(nid_objs[19]),/* "rsa" */
 | 
			
		||||
&(nid_objs[ 6]),/* "rsaEncryption" */
 | 
			
		||||
&(nid_objs[377]),/* "rsaSignature" */
 | 
			
		||||
@@ -1843,6 +1897,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[181]),/* OBJ_iso                          1 */
 | 
			
		||||
&(nid_objs[182]),/* OBJ_member_body                  1 2 */
 | 
			
		||||
&(nid_objs[379]),/* OBJ_org                          1 3 */
 | 
			
		||||
&(nid_objs[393]),/* OBJ_joint_iso_ccitt              2 */
 | 
			
		||||
&(nid_objs[11]),/* OBJ_X500                         2 5 */
 | 
			
		||||
&(nid_objs[380]),/* OBJ_dod                          1 3 6 */
 | 
			
		||||
&(nid_objs[12]),/* OBJ_X509                         2 5 4 */
 | 
			
		||||
@@ -1850,6 +1905,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[81]),/* OBJ_id_ce                        2 5 29 */
 | 
			
		||||
&(nid_objs[183]),/* OBJ_ISO_US                       1 2 840 */
 | 
			
		||||
&(nid_objs[381]),/* OBJ_iana                         1 3 6 1 */
 | 
			
		||||
&(nid_objs[394]),/* OBJ_selected_attribute_types     2 5 1 5 */
 | 
			
		||||
&(nid_objs[13]),/* OBJ_commonName                   2 5 4 3 */
 | 
			
		||||
&(nid_objs[100]),/* OBJ_surname                      2 5 4 4 */
 | 
			
		||||
&(nid_objs[105]),/* OBJ_serialNumber                 2 5 4 5 */
 | 
			
		||||
@@ -1865,6 +1921,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[101]),/* OBJ_initials                     2 5 4 43 */
 | 
			
		||||
&(nid_objs[102]),/* OBJ_uniqueIdentifier             2 5 4 45 */
 | 
			
		||||
&(nid_objs[174]),/* OBJ_dnQualifier                  2 5 4 46 */
 | 
			
		||||
&(nid_objs[400]),/* OBJ_role                         2 5 4 72 */
 | 
			
		||||
&(nid_objs[82]),/* OBJ_subject_key_identifier       2 5 29 14 */
 | 
			
		||||
&(nid_objs[83]),/* OBJ_key_usage                    2 5 29 15 */
 | 
			
		||||
&(nid_objs[84]),/* OBJ_private_key_usage_period     2 5 29 16 */
 | 
			
		||||
@@ -1878,7 +1935,10 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[103]),/* OBJ_crl_distribution_points      2 5 29 31 */
 | 
			
		||||
&(nid_objs[89]),/* OBJ_certificate_policies         2 5 29 32 */
 | 
			
		||||
&(nid_objs[90]),/* OBJ_authority_key_identifier     2 5 29 35 */
 | 
			
		||||
&(nid_objs[401]),/* OBJ_policy_constraints           2 5 29 36 */
 | 
			
		||||
&(nid_objs[126]),/* OBJ_ext_key_usage                2 5 29 37 */
 | 
			
		||||
&(nid_objs[402]),/* OBJ_target_information           2 5 29 55 */
 | 
			
		||||
&(nid_objs[403]),/* OBJ_no_rev_avail                 2 5 29 56 */
 | 
			
		||||
&(nid_objs[390]),/* OBJ_dcObject                      1466 344 */
 | 
			
		||||
&(nid_objs[382]),/* OBJ_Directory                    1 3 6 1 1 */
 | 
			
		||||
&(nid_objs[383]),/* OBJ_Management                   1 3 6 1 2 */
 | 
			
		||||
@@ -1888,6 +1948,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[387]),/* OBJ_SNMPv2                       1 3 6 1 6 */
 | 
			
		||||
&(nid_objs[388]),/* OBJ_Mail                         1 3 6 1 7 */
 | 
			
		||||
&(nid_objs[376]),/* OBJ_algorithm                    1 3 14 3 2 */
 | 
			
		||||
&(nid_objs[395]),/* OBJ_clearance                    2 5 1 5 55 */
 | 
			
		||||
&(nid_objs[19]),/* OBJ_rsa                          2 5 8 1 1 */
 | 
			
		||||
&(nid_objs[96]),/* OBJ_mdc2WithRSA                  2 5 8 3 100 */
 | 
			
		||||
&(nid_objs[95]),/* OBJ_mdc2                         2 5 8 3 101 */
 | 
			
		||||
@@ -1970,6 +2031,8 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[290]),/* OBJ_sbqp_ipAddrBlock             1 3 6 1 5 5 7 1 7 */
 | 
			
		||||
&(nid_objs[291]),/* OBJ_sbqp_autonomousSysNum        1 3 6 1 5 5 7 1 8 */
 | 
			
		||||
&(nid_objs[292]),/* OBJ_sbqp_routerIdentifier        1 3 6 1 5 5 7 1 9 */
 | 
			
		||||
&(nid_objs[397]),/* OBJ_ac_proxying                  1 3 6 1 5 5 7 1 10 */
 | 
			
		||||
&(nid_objs[398]),/* OBJ_sinfo_access                 1 3 6 1 5 5 7 1 11 */
 | 
			
		||||
&(nid_objs[164]),/* OBJ_id_qt_cps                    1 3 6 1 5 5 7 2 1 */
 | 
			
		||||
&(nid_objs[165]),/* OBJ_id_qt_unotice                1 3 6 1 5 5 7 2 2 */
 | 
			
		||||
&(nid_objs[293]),/* OBJ_textNotice                   1 3 6 1 5 5 7 2 3 */
 | 
			
		||||
@@ -2036,6 +2099,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[356]),/* OBJ_id_aca_chargingIdentity      1 3 6 1 5 5 7 10 3 */
 | 
			
		||||
&(nid_objs[357]),/* OBJ_id_aca_group                 1 3 6 1 5 5 7 10 4 */
 | 
			
		||||
&(nid_objs[358]),/* OBJ_id_aca_role                  1 3 6 1 5 5 7 10 5 */
 | 
			
		||||
&(nid_objs[399]),/* OBJ_id_aca_encAttrs              1 3 6 1 5 5 7 10 6 */
 | 
			
		||||
&(nid_objs[359]),/* OBJ_id_qcs_pkixQCSyntax_v1       1 3 6 1 5 5 7 11 1 */
 | 
			
		||||
&(nid_objs[360]),/* OBJ_id_cct_crs                   1 3 6 1 5 5 7 12 1 */
 | 
			
		||||
&(nid_objs[361]),/* OBJ_id_cct_PKIData               1 3 6 1 5 5 7 12 2 */
 | 
			
		||||
@@ -2050,6 +2114,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
 | 
			
		||||
&(nid_objs[112]),/* OBJ_pbeWithMD5AndCast5_CBC       1 2 840 113533 7 66 12 */
 | 
			
		||||
&(nid_objs[ 6]),/* OBJ_rsaEncryption                1 2 840 113549 1 1 1 */
 | 
			
		||||
&(nid_objs[ 7]),/* OBJ_md2WithRSAEncryption         1 2 840 113549 1 1 2 */
 | 
			
		||||
&(nid_objs[396]),/* OBJ_md4WithRSAEncryption         1 2 840 113549 1 1 3 */
 | 
			
		||||
&(nid_objs[ 8]),/* OBJ_md5WithRSAEncryption         1 2 840 113549 1 1 4 */
 | 
			
		||||
&(nid_objs[65]),/* OBJ_sha1WithRSAEncryption        1 2 840 113549 1 1 5 */
 | 
			
		||||
&(nid_objs[28]),/* OBJ_dhKeyAgreement               1 2 840 113549 1 3 1 */
 | 
			
		||||
 
 | 
			
		||||
@@ -164,7 +164,13 @@ foreach (sort obj_cmp @a)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
print OUT <<'EOF';
 | 
			
		||||
/* lib/obj/obj_dat.h */
 | 
			
		||||
/* crypto/objects/obj_dat.h */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl obj_dat.pl objects.h obj_dat.h
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
@@ -222,11 +228,6 @@ print OUT <<'EOF';
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM Objects.h by obj_dat.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl obj_dat.pl objects.h obj_dat.h
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
printf OUT "#define NUM_NID %d\n",$n;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,10 @@
 | 
			
		||||
/* lib/obj/obj_mac.h */
 | 
			
		||||
/* crypto/objects/obj_mac.h */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl objects.pl objects.txt obj_mac.num obj_mac.h
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
@@ -56,11 +62,6 @@
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl objects.pl objects.txt obj_mac.num obj_mac.h
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define SN_undef			"UNDEF"
 | 
			
		||||
#define LN_undef			"undefined"
 | 
			
		||||
#define NID_undef			0
 | 
			
		||||
@@ -71,11 +72,25 @@
 | 
			
		||||
#define NID_iso		181
 | 
			
		||||
#define OBJ_iso		1L
 | 
			
		||||
 | 
			
		||||
#define SN_joint_iso_ccitt		"JOINT-ISO-CCITT"
 | 
			
		||||
#define LN_joint_iso_ccitt		"joint-iso-ccitt"
 | 
			
		||||
#define NID_joint_iso_ccitt		393
 | 
			
		||||
#define OBJ_joint_iso_ccitt		2L
 | 
			
		||||
 | 
			
		||||
#define SN_member_body		"member-body"
 | 
			
		||||
#define LN_member_body		"ISO Member Body"
 | 
			
		||||
#define NID_member_body		182
 | 
			
		||||
#define OBJ_member_body		OBJ_iso,2L
 | 
			
		||||
 | 
			
		||||
#define SN_selected_attribute_types		"selected-attribute-types"
 | 
			
		||||
#define LN_selected_attribute_types		"Selected Attribute Types"
 | 
			
		||||
#define NID_selected_attribute_types		394
 | 
			
		||||
#define OBJ_selected_attribute_types		OBJ_joint_iso_ccitt,5L,1L,5L
 | 
			
		||||
 | 
			
		||||
#define SN_clearance		"clearance"
 | 
			
		||||
#define NID_clearance		395
 | 
			
		||||
#define OBJ_clearance		OBJ_selected_attribute_types,55L
 | 
			
		||||
 | 
			
		||||
#define SN_ISO_US		"ISO-US"
 | 
			
		||||
#define LN_ISO_US		"ISO US Member Body"
 | 
			
		||||
#define NID_ISO_US		183
 | 
			
		||||
@@ -145,6 +160,11 @@
 | 
			
		||||
#define NID_md2WithRSAEncryption		7
 | 
			
		||||
#define OBJ_md2WithRSAEncryption		OBJ_pkcs1,2L
 | 
			
		||||
 | 
			
		||||
#define SN_md4WithRSAEncryption		"RSA-MD4"
 | 
			
		||||
#define LN_md4WithRSAEncryption		"md4WithRSAEncryption"
 | 
			
		||||
#define NID_md4WithRSAEncryption		396
 | 
			
		||||
#define OBJ_md4WithRSAEncryption		OBJ_pkcs1,3L
 | 
			
		||||
 | 
			
		||||
#define SN_md5WithRSAEncryption		"RSA-MD5"
 | 
			
		||||
#define LN_md5WithRSAEncryption		"md5WithRSAEncryption"
 | 
			
		||||
#define NID_md5WithRSAEncryption		8
 | 
			
		||||
@@ -956,6 +976,15 @@
 | 
			
		||||
#define NID_sbqp_routerIdentifier		292
 | 
			
		||||
#define OBJ_sbqp_routerIdentifier		OBJ_id_pe,9L
 | 
			
		||||
 | 
			
		||||
#define SN_ac_proxying		"ac-proxying"
 | 
			
		||||
#define NID_ac_proxying		397
 | 
			
		||||
#define OBJ_ac_proxying		OBJ_id_pe,10L
 | 
			
		||||
 | 
			
		||||
#define SN_sinfo_access		"subjectInfoAccess"
 | 
			
		||||
#define LN_sinfo_access		"Subject Information Access"
 | 
			
		||||
#define NID_sinfo_access		398
 | 
			
		||||
#define OBJ_sinfo_access		OBJ_id_pe,11L
 | 
			
		||||
 | 
			
		||||
#define SN_id_qt_cps		"id-qt-cps"
 | 
			
		||||
#define LN_id_qt_cps		"Policy Qualifier CPS"
 | 
			
		||||
#define NID_id_qt_cps		164
 | 
			
		||||
@@ -1264,6 +1293,10 @@
 | 
			
		||||
#define NID_id_aca_role		358
 | 
			
		||||
#define OBJ_id_aca_role		OBJ_id_aca,5L
 | 
			
		||||
 | 
			
		||||
#define SN_id_aca_encAttrs		"id-aca-encAttrs"
 | 
			
		||||
#define NID_id_aca_encAttrs		399
 | 
			
		||||
#define OBJ_id_aca_encAttrs		OBJ_id_aca,6L
 | 
			
		||||
 | 
			
		||||
#define SN_id_qcs_pkixQCSyntax_v1		"id-qcs-pkixQCSyntax-v1"
 | 
			
		||||
#define NID_id_qcs_pkixQCSyntax_v1		359
 | 
			
		||||
#define OBJ_id_qcs_pkixQCSyntax_v1		OBJ_id_qcs,1L
 | 
			
		||||
@@ -1545,7 +1578,6 @@
 | 
			
		||||
#define NID_initials		101
 | 
			
		||||
#define OBJ_initials		OBJ_X509,43L
 | 
			
		||||
 | 
			
		||||
#define SN_uniqueIdentifier		"UID"
 | 
			
		||||
#define LN_uniqueIdentifier		"uniqueIdentifier"
 | 
			
		||||
#define NID_uniqueIdentifier		102
 | 
			
		||||
#define OBJ_uniqueIdentifier		OBJ_X509,45L
 | 
			
		||||
@@ -1555,6 +1587,11 @@
 | 
			
		||||
#define NID_dnQualifier		174
 | 
			
		||||
#define OBJ_dnQualifier		OBJ_X509,46L
 | 
			
		||||
 | 
			
		||||
#define SN_role		"role"
 | 
			
		||||
#define LN_role		"role"
 | 
			
		||||
#define NID_role		400
 | 
			
		||||
#define OBJ_role		OBJ_X509,72L
 | 
			
		||||
 | 
			
		||||
#define SN_X500algorithms		"X500algorithms"
 | 
			
		||||
#define LN_X500algorithms		"directory services - algorithms"
 | 
			
		||||
#define NID_X500algorithms		378
 | 
			
		||||
@@ -1644,11 +1681,26 @@
 | 
			
		||||
#define NID_authority_key_identifier		90
 | 
			
		||||
#define OBJ_authority_key_identifier		OBJ_id_ce,35L
 | 
			
		||||
 | 
			
		||||
#define SN_policy_constraints		"policyConstraints"
 | 
			
		||||
#define LN_policy_constraints		"X509v3 Policy Constraints"
 | 
			
		||||
#define NID_policy_constraints		401
 | 
			
		||||
#define OBJ_policy_constraints		OBJ_id_ce,36L
 | 
			
		||||
 | 
			
		||||
#define SN_ext_key_usage		"extendedKeyUsage"
 | 
			
		||||
#define LN_ext_key_usage		"X509v3 Extended Key Usage"
 | 
			
		||||
#define NID_ext_key_usage		126
 | 
			
		||||
#define OBJ_ext_key_usage		OBJ_id_ce,37L
 | 
			
		||||
 | 
			
		||||
#define SN_target_information		"targetInformation"
 | 
			
		||||
#define LN_target_information		"X509v3 AC Targeting"
 | 
			
		||||
#define NID_target_information		402
 | 
			
		||||
#define OBJ_target_information		OBJ_id_ce,55L
 | 
			
		||||
 | 
			
		||||
#define SN_no_rev_avail		"noRevAvail"
 | 
			
		||||
#define LN_no_rev_avail		"X509v3 No Revocation Available"
 | 
			
		||||
#define NID_no_rev_avail		403
 | 
			
		||||
#define OBJ_no_rev_avail		OBJ_id_ce,56L
 | 
			
		||||
 | 
			
		||||
#define SN_netscape		"Netscape"
 | 
			
		||||
#define LN_netscape		"Netscape Communications Corp."
 | 
			
		||||
#define NID_netscape		57
 | 
			
		||||
 
 | 
			
		||||
@@ -390,3 +390,14 @@ Enterprises		389
 | 
			
		||||
dcObject		390
 | 
			
		||||
domainComponent		391
 | 
			
		||||
Domain		392
 | 
			
		||||
joint_iso_ccitt		393
 | 
			
		||||
selected_attribute_types		394
 | 
			
		||||
clearance		395
 | 
			
		||||
md4WithRSAEncryption		396
 | 
			
		||||
ac_proxying		397
 | 
			
		||||
sinfo_access		398
 | 
			
		||||
id_aca_encAttrs		399
 | 
			
		||||
role		400
 | 
			
		||||
policy_constraints		401
 | 
			
		||||
target_information		402
 | 
			
		||||
no_rev_avail		403
 | 
			
		||||
 
 | 
			
		||||
@@ -452,54 +452,54 @@
 | 
			
		||||
#define LN_desx_cbc			"desx-cbc"
 | 
			
		||||
#define NID_desx_cbc			80
 | 
			
		||||
 | 
			
		||||
#define SN_ld_ce			"ld-ce"
 | 
			
		||||
#define NID_ld_ce			81
 | 
			
		||||
#define OBJ_ld_ce			2L,5L,29L
 | 
			
		||||
#define SN_id_ce			"id-ce"
 | 
			
		||||
#define NID_id_ce			81
 | 
			
		||||
#define OBJ_id_ce			2L,5L,29L
 | 
			
		||||
 | 
			
		||||
#define SN_subject_key_identifier	"subjectKeyIdentifier"
 | 
			
		||||
#define LN_subject_key_identifier	"X509v3 Subject Key Identifier"
 | 
			
		||||
#define NID_subject_key_identifier	82
 | 
			
		||||
#define OBJ_subject_key_identifier	OBJ_ld_ce,14L
 | 
			
		||||
#define OBJ_subject_key_identifier	OBJ_id_ce,14L
 | 
			
		||||
 | 
			
		||||
#define SN_key_usage			"keyUsage"
 | 
			
		||||
#define LN_key_usage			"X509v3 Key Usage"
 | 
			
		||||
#define NID_key_usage			83
 | 
			
		||||
#define OBJ_key_usage			OBJ_ld_ce,15L
 | 
			
		||||
#define OBJ_key_usage			OBJ_id_ce,15L
 | 
			
		||||
 | 
			
		||||
#define SN_private_key_usage_period	"privateKeyUsagePeriod"
 | 
			
		||||
#define LN_private_key_usage_period	"X509v3 Private Key Usage Period"
 | 
			
		||||
#define NID_private_key_usage_period	84
 | 
			
		||||
#define OBJ_private_key_usage_period	OBJ_ld_ce,16L
 | 
			
		||||
#define OBJ_private_key_usage_period	OBJ_id_ce,16L
 | 
			
		||||
 | 
			
		||||
#define SN_subject_alt_name		"subjectAltName"
 | 
			
		||||
#define LN_subject_alt_name		"X509v3 Subject Alternative Name"
 | 
			
		||||
#define NID_subject_alt_name		85
 | 
			
		||||
#define OBJ_subject_alt_name		OBJ_ld_ce,17L
 | 
			
		||||
#define OBJ_subject_alt_name		OBJ_id_ce,17L
 | 
			
		||||
 | 
			
		||||
#define SN_issuer_alt_name		"issuerAltName"
 | 
			
		||||
#define LN_issuer_alt_name		"X509v3 Issuer Alternative Name"
 | 
			
		||||
#define NID_issuer_alt_name		86
 | 
			
		||||
#define OBJ_issuer_alt_name		OBJ_ld_ce,18L
 | 
			
		||||
#define OBJ_issuer_alt_name		OBJ_id_ce,18L
 | 
			
		||||
 | 
			
		||||
#define SN_basic_constraints		"basicConstraints"
 | 
			
		||||
#define LN_basic_constraints		"X509v3 Basic Constraints"
 | 
			
		||||
#define NID_basic_constraints		87
 | 
			
		||||
#define OBJ_basic_constraints		OBJ_ld_ce,19L
 | 
			
		||||
#define OBJ_basic_constraints		OBJ_id_ce,19L
 | 
			
		||||
 | 
			
		||||
#define SN_crl_number			"crlNumber"
 | 
			
		||||
#define LN_crl_number			"X509v3 CRL Number"
 | 
			
		||||
#define NID_crl_number			88
 | 
			
		||||
#define OBJ_crl_number			OBJ_ld_ce,20L
 | 
			
		||||
#define OBJ_crl_number			OBJ_id_ce,20L
 | 
			
		||||
 | 
			
		||||
#define SN_certificate_policies		"certificatePolicies"
 | 
			
		||||
#define LN_certificate_policies		"X509v3 Certificate Policies"
 | 
			
		||||
#define NID_certificate_policies	89
 | 
			
		||||
#define OBJ_certificate_policies	OBJ_ld_ce,32L
 | 
			
		||||
#define OBJ_certificate_policies	OBJ_id_ce,32L
 | 
			
		||||
 | 
			
		||||
#define SN_authority_key_identifier	"authorityKeyIdentifier"
 | 
			
		||||
#define LN_authority_key_identifier	"X509v3 Authority Key Identifier"
 | 
			
		||||
#define NID_authority_key_identifier	90
 | 
			
		||||
#define OBJ_authority_key_identifier	OBJ_ld_ce,35L
 | 
			
		||||
#define OBJ_authority_key_identifier	OBJ_id_ce,35L
 | 
			
		||||
 | 
			
		||||
#define SN_bf_cbc			"BF-CBC"
 | 
			
		||||
#define LN_bf_cbc			"bf-cbc"
 | 
			
		||||
@@ -560,7 +560,7 @@
 | 
			
		||||
#define SN_crl_distribution_points	"crlDistributionPoints"
 | 
			
		||||
#define LN_crl_distribution_points	"X509v3 CRL Distribution Points"
 | 
			
		||||
#define NID_crl_distribution_points	103
 | 
			
		||||
#define OBJ_crl_distribution_points	OBJ_ld_ce,31L
 | 
			
		||||
#define OBJ_crl_distribution_points	OBJ_id_ce,31L
 | 
			
		||||
 | 
			
		||||
#define SN_md5WithRSA			"RSA-NP-MD5"
 | 
			
		||||
#define LN_md5WithRSA			"md5WithRSA"
 | 
			
		||||
@@ -677,7 +677,7 @@
 | 
			
		||||
#define SN_ext_key_usage		"extendedKeyUsage"
 | 
			
		||||
#define LN_ext_key_usage		"X509v3 Extended Key Usage"
 | 
			
		||||
#define NID_ext_key_usage		126
 | 
			
		||||
#define OBJ_ext_key_usage		OBJ_ld_ce,37
 | 
			
		||||
#define OBJ_ext_key_usage		OBJ_id_ce,37
 | 
			
		||||
 | 
			
		||||
#define SN_id_pkix			"PKIX"
 | 
			
		||||
#define NID_id_pkix			127
 | 
			
		||||
@@ -751,17 +751,17 @@
 | 
			
		||||
#define SN_delta_crl			"deltaCRL"
 | 
			
		||||
#define LN_delta_crl			"X509v3 Delta CRL Indicator"
 | 
			
		||||
#define NID_delta_crl			140
 | 
			
		||||
#define OBJ_delta_crl			OBJ_ld_ce,27L
 | 
			
		||||
#define OBJ_delta_crl			OBJ_id_ce,27L
 | 
			
		||||
 | 
			
		||||
#define SN_crl_reason			"CRLReason"
 | 
			
		||||
#define LN_crl_reason			"CRL Reason Code"
 | 
			
		||||
#define NID_crl_reason			141
 | 
			
		||||
#define OBJ_crl_reason			OBJ_ld_ce,21L
 | 
			
		||||
#define OBJ_crl_reason			OBJ_id_ce,21L
 | 
			
		||||
 | 
			
		||||
#define SN_invalidity_date		"invalidityDate"
 | 
			
		||||
#define LN_invalidity_date		"Invalidity Date"
 | 
			
		||||
#define NID_invalidity_date		142
 | 
			
		||||
#define OBJ_invalidity_date		OBJ_ld_ce,24L
 | 
			
		||||
#define OBJ_invalidity_date		OBJ_id_ce,24L
 | 
			
		||||
 | 
			
		||||
#define SN_sxnet			"SXNetID"
 | 
			
		||||
#define LN_sxnet			"Strong Extranet ID"
 | 
			
		||||
@@ -1005,8 +1005,6 @@ int		OBJ_sn2nid(const char *s);
 | 
			
		||||
int		OBJ_cmp(ASN1_OBJECT *a,ASN1_OBJECT *b);
 | 
			
		||||
char *		OBJ_bsearch(char *key,char *base,int num,int size,int (*cmp)(const void *, const void *));
 | 
			
		||||
 | 
			
		||||
void		ERR_load_OBJ_strings(void );
 | 
			
		||||
 | 
			
		||||
int		OBJ_new_nid(int num);
 | 
			
		||||
int		OBJ_add_object(ASN1_OBJECT *obj);
 | 
			
		||||
int		OBJ_create(char *oid,char *sn,char *ln);
 | 
			
		||||
@@ -1017,6 +1015,7 @@ int		OBJ_create_objects(BIO *in);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_OBJ_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the OBJ functions. */
 | 
			
		||||
 | 
			
		||||
@@ -1035,4 +1034,3 @@ int		OBJ_create_objects(BIO *in);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -114,7 +114,13 @@ close NUMOUT;
 | 
			
		||||
 | 
			
		||||
open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
 | 
			
		||||
print OUT <<'EOF';
 | 
			
		||||
/* lib/obj/obj_mac.h */
 | 
			
		||||
/* crypto/objects/obj_mac.h */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl objects.pl objects.txt obj_mac.num obj_mac.h
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
@@ -172,11 +178,6 @@ print OUT <<'EOF';
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
 | 
			
		||||
 * following command:
 | 
			
		||||
 * perl objects.pl objects.txt obj_mac.num obj_mac.h
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define SN_undef			"UNDEF"
 | 
			
		||||
#define LN_undef			"undefined"
 | 
			
		||||
#define NID_undef			0
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,13 @@
 | 
			
		||||
1			: ISO			: iso
 | 
			
		||||
 | 
			
		||||
2			: JOINT-ISO-CCITT	: joint-iso-ccitt
 | 
			
		||||
 | 
			
		||||
iso 2			: member-body		: ISO Member Body
 | 
			
		||||
 | 
			
		||||
joint-iso-ccitt 5 1 5	: selected-attribute-types	: Selected Attribute Types
 | 
			
		||||
 | 
			
		||||
selected-attribute-types 55	: clearance
 | 
			
		||||
 | 
			
		||||
member-body 840		: ISO-US		: ISO US Member Body
 | 
			
		||||
ISO-US 10040		: X9-57			: X9.57
 | 
			
		||||
X9-57 4			: X9cm			: X9.57 CM ?
 | 
			
		||||
@@ -26,6 +32,7 @@ rsadsi 1		: pkcs			: RSA Data Security, Inc. PKCS
 | 
			
		||||
pkcs 1			: pkcs1
 | 
			
		||||
pkcs1 1			:			: rsaEncryption
 | 
			
		||||
pkcs1 2			: RSA-MD2		: md2WithRSAEncryption
 | 
			
		||||
pkcs1 3			: RSA-MD4		: md4WithRSAEncryption
 | 
			
		||||
pkcs1 4			: RSA-MD5		: md5WithRSAEncryption
 | 
			
		||||
pkcs1 5			: RSA-SHA1		: sha1WithRSAEncryption
 | 
			
		||||
 | 
			
		||||
@@ -302,6 +309,9 @@ id-pe 6			: aaControls
 | 
			
		||||
id-pe 7			: sbqp-ipAddrBlock
 | 
			
		||||
id-pe 8			: sbqp-autonomousSysNum
 | 
			
		||||
id-pe 9			: sbqp-routerIdentifier
 | 
			
		||||
id-pe 10		: ac-proxying
 | 
			
		||||
!Cname sinfo-access
 | 
			
		||||
id-pe 11		: subjectInfoAccess	: Subject Information Access
 | 
			
		||||
 | 
			
		||||
# PKIX policyQualifiers for Internet policy qualifiers
 | 
			
		||||
id-qt 1			: id-qt-cps		: Policy Qualifier CPS
 | 
			
		||||
@@ -406,7 +416,9 @@ id-aca 1		: id-aca-authenticationInfo
 | 
			
		||||
id-aca 2		: id-aca-accessIdentity
 | 
			
		||||
id-aca 3		: id-aca-chargingIdentity
 | 
			
		||||
id-aca 4		: id-aca-group
 | 
			
		||||
# attention : the following seems to be obsolete, replace by 'role'
 | 
			
		||||
id-aca 5		: id-aca-role
 | 
			
		||||
id-aca 6		: id-aca-encAttrs
 | 
			
		||||
 | 
			
		||||
# qualified certificate statements
 | 
			
		||||
id-qcs 1		: id-qcs-pkixQCSyntax-v1
 | 
			
		||||
@@ -496,8 +508,9 @@ X509 13			: D			: description
 | 
			
		||||
X509 41			: name			: name
 | 
			
		||||
X509 42			: G			: givenName
 | 
			
		||||
X509 43			: I			: initials
 | 
			
		||||
X509 45			: UID			: uniqueIdentifier
 | 
			
		||||
X509 45			: 			: uniqueIdentifier
 | 
			
		||||
X509 46			: dnQualifier		: dnQualifier
 | 
			
		||||
X509 72			: role			: role
 | 
			
		||||
 | 
			
		||||
X500 8			: X500algorithms	: directory services - algorithms
 | 
			
		||||
X500algorithms 1 1	: RSA			: rsa
 | 
			
		||||
@@ -531,8 +544,14 @@ id-ce 31		: crlDistributionPoints	: X509v3 CRL Distribution Points
 | 
			
		||||
id-ce 32		: certificatePolicies	: X509v3 Certificate Policies
 | 
			
		||||
!Cname authority-key-identifier
 | 
			
		||||
id-ce 35		: authorityKeyIdentifier : X509v3 Authority Key Identifier
 | 
			
		||||
!Cname policy-constraints
 | 
			
		||||
id-ce 36		: policyConstraints	: X509v3 Policy Constraints
 | 
			
		||||
!Cname ext-key-usage
 | 
			
		||||
id-ce 37		: extendedKeyUsage	: X509v3 Extended Key Usage
 | 
			
		||||
!Cname target-information
 | 
			
		||||
id-ce 55		: targetInformation	: X509v3 AC Targeting
 | 
			
		||||
!Cname no-rev-avail
 | 
			
		||||
id-ce 56		: noRevAvail		: X509v3 No Revocation Available
 | 
			
		||||
 | 
			
		||||
!Cname netscape
 | 
			
		||||
2 16 840 1 113730	: Netscape		: Netscape Communications Corp.
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
#define HEADER_OPENSSLV_H
 | 
			
		||||
 | 
			
		||||
/* Numeric release version identifier:
 | 
			
		||||
 * MMNNFFPPS: major minor fix patch status
 | 
			
		||||
 * MNNFFPPS: major minor fix patch status
 | 
			
		||||
 * The status nibble has one of the values 0 for development, 1 to e for betas
 | 
			
		||||
 * 1 to 14, and f for release.  The patch level is exactly that.
 | 
			
		||||
 * For example:
 | 
			
		||||
@@ -25,8 +25,8 @@
 | 
			
		||||
 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
 | 
			
		||||
 *  major minor fix final patch/beta)
 | 
			
		||||
 */
 | 
			
		||||
#define OPENSSL_VERSION_NUMBER	0x0090601fL
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.6a [engine] 5 Apr 2001"
 | 
			
		||||
#define OPENSSL_VERSION_NUMBER	0x0090603fL
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.6c [engine] 21 dec 2001"
 | 
			
		||||
#define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -44,13 +44,13 @@
 | 
			
		||||
 *
 | 
			
		||||
 *	libcrypto.so.0
 | 
			
		||||
 *
 | 
			
		||||
 * On True64 it works a little bit differently.  There, the shared library
 | 
			
		||||
 * version is stored in the file, and is actually a series of versions,
 | 
			
		||||
 * separated by colons.  The rightmost version present in the library when
 | 
			
		||||
 * linking an application is stored in the application to be matched at
 | 
			
		||||
 * run time.  When the application is run, a check is done to see if the
 | 
			
		||||
 * library version stored in the application matches any of the versions
 | 
			
		||||
 * in the version string of the library itself.
 | 
			
		||||
 * On Tru64 and IRIX 6.x it works a little bit differently.  There, the
 | 
			
		||||
 * shared library version is stored in the file, and is actually a series
 | 
			
		||||
 * of versions, separated by colons.  The rightmost version present in the
 | 
			
		||||
 * library when linking an application is stored in the application to be
 | 
			
		||||
 * matched at run time.  When the application is run, a check is done to
 | 
			
		||||
 * see if the library version stored in the application matches any of the
 | 
			
		||||
 * versions in the version string of the library itself.
 | 
			
		||||
 * This version string can be constructed in any way, depending on what
 | 
			
		||||
 * kind of matching is desired.  However, to implement the same scheme as
 | 
			
		||||
 * the one used in the other unixen, all compatible versions, from lowest
 | 
			
		||||
@@ -73,7 +73,7 @@
 | 
			
		||||
 * However, it's nice and more understandable if it actually does.
 | 
			
		||||
 * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
 | 
			
		||||
 * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
 | 
			
		||||
 * For the sake of True64 and any other OS that behaves in similar ways,
 | 
			
		||||
 * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
 | 
			
		||||
 * we need to keep a history of version numbers, which is done in the
 | 
			
		||||
 * macro SHLIB_VERSION_HISTORY.  The numbers are separated by colons and
 | 
			
		||||
 * should only keep the versions that are binary compatible with the current.
 | 
			
		||||
 
 | 
			
		||||
@@ -524,8 +524,6 @@ void    PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt);
 | 
			
		||||
int	PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
 | 
			
		||||
		unsigned int *siglen, EVP_PKEY *pkey);
 | 
			
		||||
 | 
			
		||||
void	ERR_load_PEM_strings(void);
 | 
			
		||||
 | 
			
		||||
void	PEM_proc_type(char *buf, int type);
 | 
			
		||||
void	PEM_dek_info(char *buf, const char *type, int len, char *str);
 | 
			
		||||
 | 
			
		||||
@@ -614,6 +612,7 @@ int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_PEM_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the PEM functions. */
 | 
			
		||||
 | 
			
		||||
@@ -664,4 +663,3 @@ int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ sub main'DWP
 | 
			
		||||
	local($addr,$reg1,$reg2,$idx)=@_;
 | 
			
		||||
 | 
			
		||||
	$ret="";
 | 
			
		||||
	$addr =~ s/(^|[+ \t])([A-Za-z_]+)($|[+ \t])/$1$under$2$3/;
 | 
			
		||||
	$addr =~ s/(^|[+ \t])([A-Za-z_]+[A-Za-z0-9_]+)($|[+ \t])/$1$under$2$3/;
 | 
			
		||||
	$reg1="$regs{$reg1}" if defined($regs{$reg1});
 | 
			
		||||
	$reg2="$regs{$reg2}" if defined($regs{$reg2});
 | 
			
		||||
	$ret.=$addr if ($addr ne "") && ($addr ne 0);
 | 
			
		||||
 
 | 
			
		||||
@@ -267,7 +267,6 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void);
 | 
			
		||||
PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp,
 | 
			
		||||
								 long length);
 | 
			
		||||
void PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a);
 | 
			
		||||
void ERR_load_PKCS12_strings(void);
 | 
			
		||||
void PKCS12_PBE_add(void);
 | 
			
		||||
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
 | 
			
		||||
		 STACK_OF(X509) **ca);
 | 
			
		||||
@@ -284,6 +283,7 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_PKCS12_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the PKCS12 functions. */
 | 
			
		||||
 | 
			
		||||
@@ -342,4 +342,3 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,59 @@
 | 
			
		||||
/* pk7_attr.c */
 | 
			
		||||
/* S/MIME code.
 | 
			
		||||
 * Copyright (C) 1997-8 Dr S N Henson (shenson@bigfoot.com) 
 | 
			
		||||
 * All Rights Reserved. 
 | 
			
		||||
 * Redistribution of this code without the authors permission is expressly
 | 
			
		||||
 * prohibited.
 | 
			
		||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
 | 
			
		||||
 * project 2001.
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 2001 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>
 | 
			
		||||
 
 | 
			
		||||
@@ -558,11 +558,15 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
 | 
			
		||||
				ASN1_UTCTIME *sign_time;
 | 
			
		||||
				const EVP_MD *md_tmp;
 | 
			
		||||
 | 
			
		||||
				/* Add signing time */
 | 
			
		||||
				sign_time=X509_gmtime_adj(NULL,0);
 | 
			
		||||
				PKCS7_add_signed_attribute(si,
 | 
			
		||||
					NID_pkcs9_signingTime,
 | 
			
		||||
					V_ASN1_UTCTIME,sign_time);
 | 
			
		||||
				/* Add signing time if not already present */
 | 
			
		||||
				if (!PKCS7_get_signed_attribute(si,
 | 
			
		||||
							NID_pkcs9_signingTime))
 | 
			
		||||
					{
 | 
			
		||||
					sign_time=X509_gmtime_adj(NULL,0);
 | 
			
		||||
					PKCS7_add_signed_attribute(si,
 | 
			
		||||
						NID_pkcs9_signingTime,
 | 
			
		||||
						V_ASN1_UTCTIME,sign_time);
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				/* Add digest */
 | 
			
		||||
				md_tmp=EVP_MD_CTX_md(&ctx_tmp);
 | 
			
		||||
 
 | 
			
		||||
@@ -353,8 +353,6 @@ int 			i2d_PKCS7(PKCS7 *a,
 | 
			
		||||
PKCS7			*d2i_PKCS7(PKCS7 **a,
 | 
			
		||||
				unsigned char **pp,long length);
 | 
			
		||||
 | 
			
		||||
void ERR_load_PKCS7_strings(void);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
 | 
			
		||||
 | 
			
		||||
@@ -422,6 +420,7 @@ int SMIME_text(BIO *in, BIO *out);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_PKCS7_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the PKCS7 functions. */
 | 
			
		||||
 | 
			
		||||
@@ -502,4 +501,3 @@ int SMIME_text(BIO *in, BIO *out);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1998-2001 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
 | 
			
		||||
@@ -141,10 +141,12 @@ static long md_count[2]={0,0};
 | 
			
		||||
static double entropy=0;
 | 
			
		||||
static int initialized=0;
 | 
			
		||||
 | 
			
		||||
/* This should be set to 1 only when ssleay_rand_add() is called inside
 | 
			
		||||
   an already locked state, so it doesn't try to lock and thereby cause
 | 
			
		||||
   a hang.  And it should always be reset back to 0 before unlocking. */
 | 
			
		||||
static int add_do_not_lock=0;
 | 
			
		||||
static unsigned int crypto_lock_rand = 0; /* may be set only when a thread
 | 
			
		||||
                                           * holds CRYPTO_LOCK_RAND
 | 
			
		||||
                                           * (to prevent double locking) */
 | 
			
		||||
/* access to lockin_thread is synchronized by CRYPTO_LOCK_RAND2 */
 | 
			
		||||
static unsigned long locking_thread = 0; /* valid iff crypto_lock_rand is set */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef PREDICT
 | 
			
		||||
int rand_predictable=0;
 | 
			
		||||
@@ -191,6 +193,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
 | 
			
		||||
	long md_c[2];
 | 
			
		||||
	unsigned char local_md[MD_DIGEST_LENGTH];
 | 
			
		||||
	MD_CTX m;
 | 
			
		||||
	int do_not_lock;
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (Based on the rand(3) manpage)
 | 
			
		||||
@@ -207,7 +210,17 @@ static void ssleay_rand_add(const void *buf, int num, double add)
 | 
			
		||||
         * hash function.
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	if (!add_do_not_lock) CRYPTO_w_lock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	/* check if we already have the lock */
 | 
			
		||||
	if (crypto_lock_rand)
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_r_lock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
		do_not_lock = (locking_thread == CRYPTO_thread_id());
 | 
			
		||||
		CRYPTO_r_unlock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		do_not_lock = 0;
 | 
			
		||||
 | 
			
		||||
	if (!do_not_lock) CRYPTO_w_lock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	st_idx=state_index;
 | 
			
		||||
 | 
			
		||||
	/* use our own copies of the counters so that even
 | 
			
		||||
@@ -239,7 +252,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
 | 
			
		||||
 | 
			
		||||
	md_count[1] += (num / MD_DIGEST_LENGTH) + (num % MD_DIGEST_LENGTH > 0);
 | 
			
		||||
 | 
			
		||||
	if (!add_do_not_lock) CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	if (!do_not_lock) CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 | 
			
		||||
 | 
			
		||||
	for (i=0; i<num; i+=MD_DIGEST_LENGTH)
 | 
			
		||||
		{
 | 
			
		||||
@@ -281,7 +294,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
 | 
			
		||||
		}
 | 
			
		||||
	memset((char *)&m,0,sizeof(m));
 | 
			
		||||
 | 
			
		||||
	if (!add_do_not_lock) CRYPTO_w_lock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	if (!do_not_lock) CRYPTO_w_lock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	/* Don't just copy back local_md into md -- this could mean that
 | 
			
		||||
	 * other thread's seeding remains without effect (except for
 | 
			
		||||
	 * the incremented counter).  By XORing it we keep at least as
 | 
			
		||||
@@ -292,7 +305,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
 | 
			
		||||
		}
 | 
			
		||||
	if (entropy < ENTROPY_NEEDED) /* stop counting when we have enough */
 | 
			
		||||
	    entropy += add;
 | 
			
		||||
	if (!add_do_not_lock) CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	if (!do_not_lock) CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	
 | 
			
		||||
#if !defined(THREADS) && !defined(WIN32)
 | 
			
		||||
	assert(md_c[1] == md_count[1]);
 | 
			
		||||
@@ -308,6 +321,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
 | 
			
		||||
	{
 | 
			
		||||
	static volatile int stirred_pool = 0;
 | 
			
		||||
	int i,j,k,st_num,st_idx;
 | 
			
		||||
	int num_ceil;
 | 
			
		||||
	int ok;
 | 
			
		||||
	long md_c[2];
 | 
			
		||||
	unsigned char local_md[MD_DIGEST_LENGTH];
 | 
			
		||||
@@ -328,33 +342,44 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (num <= 0)
 | 
			
		||||
		return 1;
 | 
			
		||||
	
 | 
			
		||||
	/* round upwards to multiple of MD_DIGEST_LENGTH/2 */
 | 
			
		||||
	num_ceil = (1 + (num-1)/(MD_DIGEST_LENGTH/2)) * (MD_DIGEST_LENGTH/2);
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (Based on the rand(3) manpage:)
 | 
			
		||||
	 *
 | 
			
		||||
	 * For each group of 10 bytes (or less), we do the following:
 | 
			
		||||
	 *
 | 
			
		||||
	 * Input into the hash function the top 10 bytes from the
 | 
			
		||||
	 * local 'md' (which is initialized from the global 'md'
 | 
			
		||||
	 * before any bytes are generated), the bytes that are
 | 
			
		||||
	 * to be overwritten by the random bytes, and bytes from the
 | 
			
		||||
	 * 'state' (incrementing looping index).  From this digest output
 | 
			
		||||
	 * (which is kept in 'md'), the top (up to) 10 bytes are
 | 
			
		||||
	 * returned to the caller and the bottom (up to) 10 bytes are xored
 | 
			
		||||
	 * into the 'state'.
 | 
			
		||||
	 * Input into the hash function the local 'md' (which is initialized from
 | 
			
		||||
	 * the global 'md' before any bytes are generated), the bytes that are to
 | 
			
		||||
	 * be overwritten by the random bytes, and bytes from the 'state'
 | 
			
		||||
	 * (incrementing looping index). From this digest output (which is kept
 | 
			
		||||
	 * in 'md'), the top (up to) 10 bytes are returned to the caller and the
 | 
			
		||||
	 * bottom 10 bytes are xored into the 'state'.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * Finally, after we have finished 'num' random bytes for the
 | 
			
		||||
	 * caller, 'count' (which is incremented) and the local and global 'md'
 | 
			
		||||
	 * are fed into the hash function and the results are kept in the
 | 
			
		||||
	 * global 'md'.
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	if (!initialized)
 | 
			
		||||
		RAND_poll();
 | 
			
		||||
 | 
			
		||||
	CRYPTO_w_lock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	add_do_not_lock = 1;	/* Since we call ssleay_rand_add while in
 | 
			
		||||
				   this locked state. */
 | 
			
		||||
 | 
			
		||||
	initialized = 1;
 | 
			
		||||
	/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
 | 
			
		||||
	CRYPTO_w_lock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
	locking_thread = CRYPTO_thread_id();
 | 
			
		||||
	CRYPTO_w_unlock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
	crypto_lock_rand = 1;
 | 
			
		||||
 | 
			
		||||
	if (!initialized)
 | 
			
		||||
		{
 | 
			
		||||
		RAND_poll();
 | 
			
		||||
		initialized = 1;
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
	if (!stirred_pool)
 | 
			
		||||
		do_stir_pool = 1;
 | 
			
		||||
	
 | 
			
		||||
@@ -380,11 +405,11 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
 | 
			
		||||
 | 
			
		||||
	if (do_stir_pool)
 | 
			
		||||
		{
 | 
			
		||||
		/* Our output function chains only half of 'md', so we better
 | 
			
		||||
		 * make sure that the required entropy gets 'evenly distributed'
 | 
			
		||||
		 * through 'state', our randomness pool.  The input function
 | 
			
		||||
		 * (ssleay_rand_add) chains all of 'md', which makes it more
 | 
			
		||||
		 * suitable for this purpose.
 | 
			
		||||
		/* In the output function only half of 'md' remains secret,
 | 
			
		||||
		 * so we better make sure that the required entropy gets
 | 
			
		||||
		 * 'evenly distributed' through 'state', our randomness pool.
 | 
			
		||||
		 * The input function (ssleay_rand_add) chains all of 'md',
 | 
			
		||||
		 * which makes it more suitable for this purpose.
 | 
			
		||||
		 */
 | 
			
		||||
 | 
			
		||||
		int n = STATE_SIZE; /* so that the complete pool gets accessed */
 | 
			
		||||
@@ -409,21 +434,22 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
 | 
			
		||||
	md_c[1] = md_count[1];
 | 
			
		||||
	memcpy(local_md, md, sizeof md);
 | 
			
		||||
 | 
			
		||||
	state_index+=num;
 | 
			
		||||
	state_index+=num_ceil;
 | 
			
		||||
	if (state_index > state_num)
 | 
			
		||||
		state_index %= state_num;
 | 
			
		||||
 | 
			
		||||
	/* state[st_idx], ..., state[(st_idx + num - 1) % st_num]
 | 
			
		||||
	/* state[st_idx], ..., state[(st_idx + num_ceil - 1) % st_num]
 | 
			
		||||
	 * are now ours (but other threads may use them too) */
 | 
			
		||||
 | 
			
		||||
	md_count[0] += 1;
 | 
			
		||||
 | 
			
		||||
	add_do_not_lock = 0;	/* If this would ever be forgotten, we can
 | 
			
		||||
				   expect any evil god to eat our souls. */
 | 
			
		||||
	/* before unlocking, we must clear 'crypto_lock_rand' */
 | 
			
		||||
	crypto_lock_rand = 0;
 | 
			
		||||
	CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 | 
			
		||||
 | 
			
		||||
	while (num > 0)
 | 
			
		||||
		{
 | 
			
		||||
		/* num_ceil -= MD_DIGEST_LENGTH/2 */
 | 
			
		||||
		j=(num >= MD_DIGEST_LENGTH/2)?MD_DIGEST_LENGTH/2:num;
 | 
			
		||||
		num-=j;
 | 
			
		||||
		MD_Init(&m);
 | 
			
		||||
@@ -434,27 +460,28 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
 | 
			
		||||
			curr_pid = 0;
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
		MD_Update(&m,&(local_md[MD_DIGEST_LENGTH/2]),MD_DIGEST_LENGTH/2);
 | 
			
		||||
		MD_Update(&m,local_md,MD_DIGEST_LENGTH);
 | 
			
		||||
		MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c));
 | 
			
		||||
#ifndef PURIFY
 | 
			
		||||
		MD_Update(&m,buf,j); /* purify complains */
 | 
			
		||||
#endif
 | 
			
		||||
		k=(st_idx+j)-st_num;
 | 
			
		||||
		k=(st_idx+MD_DIGEST_LENGTH/2)-st_num;
 | 
			
		||||
		if (k > 0)
 | 
			
		||||
			{
 | 
			
		||||
			MD_Update(&m,&(state[st_idx]),j-k);
 | 
			
		||||
			MD_Update(&m,&(state[st_idx]),MD_DIGEST_LENGTH/2-k);
 | 
			
		||||
			MD_Update(&m,&(state[0]),k);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			MD_Update(&m,&(state[st_idx]),j);
 | 
			
		||||
			MD_Update(&m,&(state[st_idx]),MD_DIGEST_LENGTH/2);
 | 
			
		||||
		MD_Final(local_md,&m);
 | 
			
		||||
 | 
			
		||||
		for (i=0; i<j; i++)
 | 
			
		||||
		for (i=0; i<MD_DIGEST_LENGTH/2; i++)
 | 
			
		||||
			{
 | 
			
		||||
			state[st_idx++]^=local_md[i]; /* may compete with other threads */
 | 
			
		||||
			*(buf++)=local_md[i+MD_DIGEST_LENGTH/2];
 | 
			
		||||
			if (st_idx >= st_num)
 | 
			
		||||
				st_idx=0;
 | 
			
		||||
			if (i < j)
 | 
			
		||||
				*(buf++)=local_md[i+MD_DIGEST_LENGTH/2];
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -483,11 +510,12 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
 | 
			
		||||
static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) 
 | 
			
		||||
	{
 | 
			
		||||
	int ret;
 | 
			
		||||
	unsigned long err;
 | 
			
		||||
 | 
			
		||||
	ret = RAND_bytes(buf, num);
 | 
			
		||||
	if (ret == 0)
 | 
			
		||||
		{
 | 
			
		||||
		long err = ERR_peek_error();
 | 
			
		||||
		err = ERR_peek_error();
 | 
			
		||||
		if (ERR_GET_LIB(err) == ERR_LIB_RAND &&
 | 
			
		||||
		    ERR_GET_REASON(err) == RAND_R_PRNG_NOT_SEEDED)
 | 
			
		||||
			(void)ERR_get_error();
 | 
			
		||||
@@ -498,14 +526,45 @@ static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num)
 | 
			
		||||
static int ssleay_rand_status(void)
 | 
			
		||||
	{
 | 
			
		||||
	int ret;
 | 
			
		||||
	int do_not_lock;
 | 
			
		||||
 | 
			
		||||
	/* check if we already have the lock
 | 
			
		||||
	 * (could happen if a RAND_poll() implementation calls RAND_status()) */
 | 
			
		||||
	if (crypto_lock_rand)
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_r_lock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
		do_not_lock = (locking_thread == CRYPTO_thread_id());
 | 
			
		||||
		CRYPTO_r_unlock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		do_not_lock = 0;
 | 
			
		||||
	
 | 
			
		||||
	if (!do_not_lock)
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_w_lock(CRYPTO_LOCK_RAND);
 | 
			
		||||
		
 | 
			
		||||
		/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
 | 
			
		||||
		CRYPTO_w_lock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
		locking_thread = CRYPTO_thread_id();
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_RAND2);
 | 
			
		||||
		crypto_lock_rand = 1;
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
	if (!initialized)
 | 
			
		||||
		{
 | 
			
		||||
		RAND_poll();
 | 
			
		||||
		initialized = 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	CRYPTO_w_lock(CRYPTO_LOCK_RAND);
 | 
			
		||||
	initialized = 1;
 | 
			
		||||
	ret = entropy >= ENTROPY_NEEDED;
 | 
			
		||||
	CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 | 
			
		||||
 | 
			
		||||
	if (!do_not_lock)
 | 
			
		||||
		{
 | 
			
		||||
		/* before unlocking, we must clear 'crypto_lock_rand' */
 | 
			
		||||
		crypto_lock_rand = 0;
 | 
			
		||||
		
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
	return ret;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -95,7 +95,6 @@ const char *RAND_file_name(char *file,size_t num);
 | 
			
		||||
int RAND_status(void);
 | 
			
		||||
int RAND_egd(const char *path);
 | 
			
		||||
int RAND_egd_bytes(const char *path,int bytes);
 | 
			
		||||
void ERR_load_RAND_strings(void);
 | 
			
		||||
int RAND_poll(void);
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
@@ -117,10 +116,15 @@ int RAND_event(UINT, WPARAM, LPARAM);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* BEGIN ERROR CODES */
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_RAND_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the RAND functions. */
 | 
			
		||||
 | 
			
		||||
@@ -130,5 +134,7 @@ int RAND_event(UINT, WPARAM, LPARAM);
 | 
			
		||||
/* Reason codes. */
 | 
			
		||||
#define RAND_R_PRNG_NOT_SEEDED				 100
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -211,6 +211,12 @@ const char *RAND_file_name(char *buf, size_t size)
 | 
			
		||||
		{
 | 
			
		||||
		if (OPENSSL_issetugid() == 0)
 | 
			
		||||
			s=getenv("HOME");
 | 
			
		||||
#ifdef DEFAULT_HOME
 | 
			
		||||
		if (s == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			s = DEFAULT_HOME;
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
		if (s != NULL && (strlen(s)+strlen(RFILE)+2 < size))
 | 
			
		||||
			{
 | 
			
		||||
			strcpy(buf,s);
 | 
			
		||||
@@ -220,7 +226,7 @@ const char *RAND_file_name(char *buf, size_t size)
 | 
			
		||||
			strcat(buf,RFILE);
 | 
			
		||||
			ret=buf;
 | 
			
		||||
			}
 | 
			
		||||
		  else
 | 
			
		||||
		else
 | 
			
		||||
		  	buf[0] = '\0'; /* no file name */
 | 
			
		||||
		}
 | 
			
		||||
	return(ret);
 | 
			
		||||
 
 | 
			
		||||
@@ -71,7 +71,7 @@
 | 
			
		||||
 *					<appro@fy.chalmers.se>
 | 
			
		||||
 */
 | 
			
		||||
#ifdef RMD160_ASM
 | 
			
		||||
# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
#  define ripemd160_block_host_order ripemd160_block_asm_host_order
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
@@ -79,7 +79,7 @@
 | 
			
		||||
void ripemd160_block_host_order (RIPEMD160_CTX *c, const void *p,int num);
 | 
			
		||||
void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,int num);
 | 
			
		||||
 | 
			
		||||
#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
 | 
			
		||||
#define ripemd160_block_data_order ripemd160_block_host_order
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -214,8 +214,6 @@ RSA_METHOD *RSA_PKCS1_SSLeay(void);
 | 
			
		||||
 | 
			
		||||
RSA_METHOD *RSA_null_method(void);
 | 
			
		||||
 | 
			
		||||
void	ERR_load_RSA_strings(void );
 | 
			
		||||
 | 
			
		||||
RSA *	d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length);
 | 
			
		||||
int	i2d_RSAPublicKey(RSA *a, unsigned char **pp);
 | 
			
		||||
RSA *	d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length);
 | 
			
		||||
@@ -287,6 +285,7 @@ void *RSA_get_ex_data(RSA *r, int idx);
 | 
			
		||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
 | 
			
		||||
 * made after this point may be overwritten when the script is next run.
 | 
			
		||||
 */
 | 
			
		||||
void ERR_load_RSA_strings(void);
 | 
			
		||||
 | 
			
		||||
/* Error codes for the RSA functions. */
 | 
			
		||||
 | 
			
		||||
@@ -328,6 +327,7 @@ void *RSA_get_ex_data(RSA *r, int idx);
 | 
			
		||||
#define RSA_R_DATA_GREATER_THAN_MOD_LEN			 108
 | 
			
		||||
#define RSA_R_DATA_TOO_LARGE				 109
 | 
			
		||||
#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE		 110
 | 
			
		||||
#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS		 132
 | 
			
		||||
#define RSA_R_DATA_TOO_SMALL				 111
 | 
			
		||||
#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE		 122
 | 
			
		||||
#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY		 112
 | 
			
		||||
@@ -354,4 +354,3 @@ void *RSA_get_ex_data(RSA *r, int idx);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user