Compare commits
	
		
			481 Commits
		
	
	
		
			OpenSSL-en
			...
			OpenSSL_0_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					b2f570ecbb | ||
| 
						 | 
					988988807f | ||
| 
						 | 
					b1b62e7976 | ||
| 
						 | 
					069eb94607 | ||
| 
						 | 
					5dfaf1c437 | ||
| 
						 | 
					c6c5cf1754 | ||
| 
						 | 
					3d7b414c55 | ||
| 
						 | 
					863b1279f7 | ||
| 
						 | 
					24ceef033a | ||
| 
						 | 
					fe165e465b | ||
| 
						 | 
					3ece3605ac | ||
| 
						 | 
					b35ef576f4 | ||
| 
						 | 
					865ce8abcb | ||
| 
						 | 
					a69b3e94f3 | ||
| 
						 | 
					7f0f3f17b3 | ||
| 
						 | 
					0bc2e28295 | ||
| 
						 | 
					4b16376d51 | ||
| 
						 | 
					fe094cdfe3 | ||
| 
						 | 
					276753772e | ||
| 
						 | 
					16712ec35e | ||
| 
						 | 
					4e6c537141 | ||
| 
						 | 
					1b0613e313 | ||
| 
						 | 
					75140e8bc9 | ||
| 
						 | 
					f717e5460f | ||
| 
						 | 
					65129e1d57 | ||
| 
						 | 
					2a6db68797 | ||
| 
						 | 
					2b98d1ccb7 | ||
| 
						 | 
					ce8ac3dc00 | ||
| 
						 | 
					c156d5c9bd | ||
| 
						 | 
					54b293ec3c | ||
| 
						 | 
					5a8e7c5bec | ||
| 
						 | 
					75df0bb231 | ||
| 
						 | 
					22b540f5c2 | ||
| 
						 | 
					479275ef18 | ||
| 
						 | 
					6f3fa4b71d | ||
| 
						 | 
					2f4dca7052 | ||
| 
						 | 
					7b78aa0e8d | ||
| 
						 | 
					c37e7bf580 | ||
| 
						 | 
					926606deab | ||
| 
						 | 
					f98c9972a7 | ||
| 
						 | 
					df7cae352d | ||
| 
						 | 
					eda75c31e3 | ||
| 
						 | 
					2e689f6040 | ||
| 
						 | 
					ea494f7b88 | ||
| 
						 | 
					8250f6f1fc | ||
| 
						 | 
					eb0c85dec3 | ||
| 
						 | 
					9332b8c1c4 | ||
| 
						 | 
					7be09992c6 | ||
| 
						 | 
					ceea4c85b4 | ||
| 
						 | 
					d1ec197e49 | ||
| 
						 | 
					f4d9cdc531 | ||
| 
						 | 
					e3f47ba87f | ||
| 
						 | 
					ab665f4a7e | ||
| 
						 | 
					35ff595e19 | ||
| 
						 | 
					be2c37ef73 | ||
| 
						 | 
					888b8f32d7 | ||
| 
						 | 
					962c53c0cd | ||
| 
						 | 
					ce6f656e1b | ||
| 
						 | 
					9cb12c9d76 | ||
| 
						 | 
					f089efdfab | ||
| 
						 | 
					a236373435 | ||
| 
						 | 
					7d555c8615 | ||
| 
						 | 
					d63b1678b5 | ||
| 
						 | 
					beaa89def7 | ||
| 
						 | 
					b4bf34ce39 | ||
| 
						 | 
					f99ac98efb | ||
| 
						 | 
					c615cdd7cb | ||
| 
						 | 
					e7d339b678 | ||
| 
						 | 
					3f64d0bf3b | ||
| 
						 | 
					fab972b914 | ||
| 
						 | 
					a10b85d9e6 | ||
| 
						 | 
					44cc9715ec | ||
| 
						 | 
					a807f6460e | ||
| 
						 | 
					19c3f1c40d | ||
| 
						 | 
					b30504c61c | ||
| 
						 | 
					cbb5f1f025 | ||
| 
						 | 
					b8556ab14b | ||
| 
						 | 
					48c269ad7f | ||
| 
						 | 
					d6945e10b5 | ||
| 
						 | 
					70bed0ca2d | ||
| 
						 | 
					e20788700c | ||
| 
						 | 
					b60806a097 | ||
| 
						 | 
					0b9925be4f | ||
| 
						 | 
					3e9ae0c462 | ||
| 
						 | 
					96ec4ce0d2 | ||
| 
						 | 
					38b3e9edde | ||
| 
						 | 
					9ccadf1c6f | ||
| 
						 | 
					1e55e768c3 | ||
| 
						 | 
					b914a547e1 | ||
| 
						 | 
					03b148f4a9 | ||
| 
						 | 
					2dbdcd9734 | ||
| 
						 | 
					1147fa5a5f | ||
| 
						 | 
					a9eba3f3f5 | ||
| 
						 | 
					aa8a33c230 | ||
| 
						 | 
					46ff8e0d0a | ||
| 
						 | 
					3f9077278a | ||
| 
						 | 
					accb6063f3 | ||
| 
						 | 
					744301ccd8 | ||
| 
						 | 
					a295ca8cf9 | ||
| 
						 | 
					293c4d747c | ||
| 
						 | 
					09389cbef5 | ||
| 
						 | 
					594a3e5bd5 | ||
| 
						 | 
					ae9010abd5 | ||
| 
						 | 
					ae3a6640b7 | ||
| 
						 | 
					029dfa64d4 | ||
| 
						 | 
					f8845509b6 | ||
| 
						 | 
					3f98e1dd11 | ||
| 
						 | 
					e53afa9e9b | ||
| 
						 | 
					e41c5bd730 | ||
| 
						 | 
					10981a5c84 | ||
| 
						 | 
					9cf8888149 | ||
| 
						 | 
					491d390ec9 | ||
| 
						 | 
					87301baec9 | ||
| 
						 | 
					0cf4df488b | ||
| 
						 | 
					fde9626cff | ||
| 
						 | 
					fb9520c12d | ||
| 
						 | 
					62b0502750 | ||
| 
						 | 
					c77c4c9f1c | ||
| 
						 | 
					c5220abc6a | ||
| 
						 | 
					b90f36d240 | ||
| 
						 | 
					2712fe80be | ||
| 
						 | 
					13aab9cca4 | ||
| 
						 | 
					33c0e6f547 | ||
| 
						 | 
					d84f543ea6 | ||
| 
						 | 
					a7113d645f | ||
| 
						 | 
					3f345dc653 | ||
| 
						 | 
					0dd892848e | ||
| 
						 | 
					f4681b0864 | ||
| 
						 | 
					a04baf9b5c | ||
| 
						 | 
					029fb8aa26 | ||
| 
						 | 
					2cb95a153e | ||
| 
						 | 
					20d57547e6 | ||
| 
						 | 
					ea5b10a177 | ||
| 
						 | 
					dca598b911 | ||
| 
						 | 
					187ebb98ad | ||
| 
						 | 
					84712f4f9d | ||
| 
						 | 
					44366c3713 | ||
| 
						 | 
					feef7d2dc6 | ||
| 
						 | 
					7ac19add8f | ||
| 
						 | 
					e1c82386d1 | ||
| 
						 | 
					d9164abe69 | ||
| 
						 | 
					9347774449 | ||
| 
						 | 
					51db1db082 | ||
| 
						 | 
					3d11230259 | ||
| 
						 | 
					653cc07b51 | ||
| 
						 | 
					7a5b2bea86 | ||
| 
						 | 
					3eba9b0ebc | ||
| 
						 | 
					544346a6c8 | ||
| 
						 | 
					5f18f1b4c5 | ||
| 
						 | 
					1b061845d7 | ||
| 
						 | 
					3ad82e4707 | ||
| 
						 | 
					71cbb0f128 | ||
| 
						 | 
					b82030e90a | ||
| 
						 | 
					ce59bb8bd0 | ||
| 
						 | 
					deecc4bede | ||
| 
						 | 
					86cd2530db | ||
| 
						 | 
					3d85776a09 | ||
| 
						 | 
					ec578380c9 | ||
| 
						 | 
					8dccbdfc5b | ||
| 
						 | 
					904de6e4f5 | ||
| 
						 | 
					65ce21da9a | ||
| 
						 | 
					7ea0acc3ef | ||
| 
						 | 
					dd186f600d | ||
| 
						 | 
					01fc70323f | ||
| 
						 | 
					03a70bad4f | ||
| 
						 | 
					7146221bbe | ||
| 
						 | 
					80a8d1406b | ||
| 
						 | 
					1a76a85c93 | ||
| 
						 | 
					cf1b34ad34 | ||
| 
						 | 
					44d4b684f9 | ||
| 
						 | 
					746142d672 | ||
| 
						 | 
					475e21bc7b | ||
| 
						 | 
					5204726bfe | ||
| 
						 | 
					27f3a1bd9c | ||
| 
						 | 
					b1a810571c | ||
| 
						 | 
					c6719ffb77 | ||
| 
						 | 
					16fdf5b904 | ||
| 
						 | 
					d2cfefc892 | ||
| 
						 | 
					71ff177754 | ||
| 
						 | 
					5b6051067a | ||
| 
						 | 
					c0bee3c8d6 | ||
| 
						 | 
					79e29dca65 | ||
| 
						 | 
					04bdca29d7 | ||
| 
						 | 
					7ca6deef3f | ||
| 
						 | 
					026dad0f3b | ||
| 
						 | 
					6b99c692d0 | ||
| 
						 | 
					04d9784d17 | ||
| 
						 | 
					bcfca923d4 | ||
| 
						 | 
					0410b6c50b | ||
| 
						 | 
					483c4e0682 | ||
| 
						 | 
					de61328615 | ||
| 
						 | 
					731e14031c | ||
| 
						 | 
					93074b2509 | ||
| 
						 | 
					1498ad74bb | ||
| 
						 | 
					e319a89f84 | ||
| 
						 | 
					9fa5786340 | ||
| 
						 | 
					1b822decb8 | ||
| 
						 | 
					dab4c2824f | ||
| 
						 | 
					19352b794d | ||
| 
						 | 
					8746ee311e | ||
| 
						 | 
					e90323844f | ||
| 
						 | 
					630c1aedd2 | ||
| 
						 | 
					a650df440b | ||
| 
						 | 
					afd7b5affe | ||
| 
						 | 
					38c3436577 | ||
| 
						 | 
					7e9547e126 | ||
| 
						 | 
					83583e9479 | ||
| 
						 | 
					41d208db79 | ||
| 
						 | 
					9a1c40049e | ||
| 
						 | 
					39bed15e53 | ||
| 
						 | 
					4b04466f14 | ||
| 
						 | 
					2474b596ad | ||
| 
						 | 
					a890c4e9bb | ||
| 
						 | 
					c62ddfbb6e | ||
| 
						 | 
					8b9351cf61 | ||
| 
						 | 
					b23f1df65f | ||
| 
						 | 
					f05735c8c9 | ||
| 
						 | 
					42f310f596 | ||
| 
						 | 
					77c6edc1d1 | ||
| 
						 | 
					99bd4baa54 | ||
| 
						 | 
					c8913d8e8a | ||
| 
						 | 
					3c836ff0f8 | ||
| 
						 | 
					a956392145 | ||
| 
						 | 
					4760dc31c9 | ||
| 
						 | 
					5fde80cd56 | ||
| 
						 | 
					ecacb136c5 | ||
| 
						 | 
					db17ecdae3 | ||
| 
						 | 
					ee718b2c22 | ||
| 
						 | 
					514481f686 | ||
| 
						 | 
					b089e64654 | ||
| 
						 | 
					3c1f0ccbf4 | ||
| 
						 | 
					c5e00a3ee2 | ||
| 
						 | 
					26c329cd84 | ||
| 
						 | 
					d349c5f8fd | ||
| 
						 | 
					3a11466381 | ||
| 
						 | 
					5c4c4c2b90 | ||
| 
						 | 
					ec11fa2159 | ||
| 
						 | 
					c4365acc48 | ||
| 
						 | 
					c29dbb9562 | ||
| 
						 | 
					cb1c1555fa | ||
| 
						 | 
					fa528639e3 | ||
| 
						 | 
					092ab05aef | ||
| 
						 | 
					4f647957c5 | ||
| 
						 | 
					4424a12c43 | ||
| 
						 | 
					592f5c5797 | ||
| 
						 | 
					14ba311676 | ||
| 
						 | 
					b9a96c0134 | ||
| 
						 | 
					75c3c831db | ||
| 
						 | 
					385af2e9ec | ||
| 
						 | 
					3c43aa1b82 | ||
| 
						 | 
					dea0f7dd0d | ||
| 
						 | 
					9a22ce66c9 | ||
| 
						 | 
					72cd659df6 | ||
| 
						 | 
					58eef36b4d | ||
| 
						 | 
					79311176b2 | ||
| 
						 | 
					88f59f6152 | ||
| 
						 | 
					e32578847c | ||
| 
						 | 
					323fd27435 | ||
| 
						 | 
					fcc88e4915 | ||
| 
						 | 
					86cb01870c | ||
| 
						 | 
					19086ef67b | ||
| 
						 | 
					ce3fc3956d | ||
| 
						 | 
					787f25ab42 | ||
| 
						 | 
					85794e5556 | ||
| 
						 | 
					7f950bd8a2 | ||
| 
						 | 
					bf7b0d2d2b | ||
| 
						 | 
					83c4e75be9 | ||
| 
						 | 
					e5f3be2bbb | ||
| 
						 | 
					fbca4281c8 | ||
| 
						 | 
					a858b8036c | ||
| 
						 | 
					d2be2fb241 | ||
| 
						 | 
					4855eb75a7 | ||
| 
						 | 
					b1f88ec4e2 | ||
| 
						 | 
					44924fb2b4 | ||
| 
						 | 
					0e810cf6b0 | ||
| 
						 | 
					1777e3fd5e | ||
| 
						 | 
					509ca689b0 | ||
| 
						 | 
					3a1dbce19d | ||
| 
						 | 
					10f2bf6d81 | ||
| 
						 | 
					1714c07164 | ||
| 
						 | 
					4cc3d1728f | ||
| 
						 | 
					3ae82255a9 | ||
| 
						 | 
					9bcab53f49 | ||
| 
						 | 
					ae17135ab5 | ||
| 
						 | 
					1f6b757ae9 | ||
| 
						 | 
					a496f45f22 | ||
| 
						 | 
					3485cdb98e | ||
| 
						 | 
					3e3f04d4b7 | ||
| 
						 | 
					879d230da3 | ||
| 
						 | 
					2006dd12d6 | ||
| 
						 | 
					744b9066e2 | ||
| 
						 | 
					1e01dbfbb2 | ||
| 
						 | 
					6ebcd441d6 | ||
| 
						 | 
					ea09a504ef | ||
| 
						 | 
					2e3b3c7be5 | ||
| 
						 | 
					93389c86ca | ||
| 
						 | 
					8d82218269 | ||
| 
						 | 
					a8e738f9ad | ||
| 
						 | 
					bdcb9321ca | ||
| 
						 | 
					d239b734e1 | ||
| 
						 | 
					d91722f8e0 | ||
| 
						 | 
					b6282a2004 | ||
| 
						 | 
					f14aa30118 | ||
| 
						 | 
					a4c1a7e317 | ||
| 
						 | 
					b222cf0624 | ||
| 
						 | 
					68b08abb14 | ||
| 
						 | 
					cee3fffab5 | ||
| 
						 | 
					d1d8608464 | ||
| 
						 | 
					19d2a20a7f | ||
| 
						 | 
					0bf5d40787 | ||
| 
						 | 
					757d479536 | ||
| 
						 | 
					74c9ace6f0 | ||
| 
						 | 
					cfb8afc558 | ||
| 
						 | 
					e8acf5c6f8 | ||
| 
						 | 
					d5864a1dcb | ||
| 
						 | 
					9f56705f96 | ||
| 
						 | 
					7b5b22af5a | ||
| 
						 | 
					00ecca84a8 | ||
| 
						 | 
					38c3b405c8 | ||
| 
						 | 
					e486ec5e0e | ||
| 
						 | 
					9f06ce19dd | ||
| 
						 | 
					ba61b14f1d | ||
| 
						 | 
					5114966e00 | ||
| 
						 | 
					eed7dd8d75 | ||
| 
						 | 
					70bddeda24 | ||
| 
						 | 
					f66efab8f7 | ||
| 
						 | 
					0caa1c11f8 | ||
| 
						 | 
					c68f050647 | ||
| 
						 | 
					d58eb72f25 | ||
| 
						 | 
					11bfaf6cff | ||
| 
						 | 
					68a54ab591 | ||
| 
						 | 
					9693045170 | ||
| 
						 | 
					311e4e9253 | ||
| 
						 | 
					1874366208 | ||
| 
						 | 
					18c497dffb | ||
| 
						 | 
					15922ccdf6 | ||
| 
						 | 
					5098bc92f8 | ||
| 
						 | 
					a411eaa858 | ||
| 
						 | 
					42b848bcf1 | ||
| 
						 | 
					b670b1e3da | ||
| 
						 | 
					a1c769a5f6 | ||
| 
						 | 
					2c89d56a1d | ||
| 
						 | 
					142e22641e | ||
| 
						 | 
					b9cc6148f4 | ||
| 
						 | 
					c6a15854ee | ||
| 
						 | 
					ba41d8a556 | ||
| 
						 | 
					f46a878e3f | ||
| 
						 | 
					fac683684b | ||
| 
						 | 
					f51fee66ad | ||
| 
						 | 
					5fb0aa6487 | ||
| 
						 | 
					9c3cbe5d7f | ||
| 
						 | 
					3e0d891828 | ||
| 
						 | 
					1c85e93c7c | ||
| 
						 | 
					95d334f2db | ||
| 
						 | 
					98486a9310 | ||
| 
						 | 
					4910cbf6db | ||
| 
						 | 
					75090e0365 | ||
| 
						 | 
					6676457bba | ||
| 
						 | 
					ad45ed9f5c | ||
| 
						 | 
					32828e6ffd | ||
| 
						 | 
					a39ded513a | ||
| 
						 | 
					0069dbc4a5 | ||
| 
						 | 
					ac90362581 | ||
| 
						 | 
					6d82a20624 | ||
| 
						 | 
					6c66fcba5f | ||
| 
						 | 
					faa624f9f9 | ||
| 
						 | 
					15ed15d3e4 | ||
| 
						 | 
					54f7c8571f | ||
| 
						 | 
					b6fefec364 | ||
| 
						 | 
					2bf1c86d05 | ||
| 
						 | 
					2147cd3540 | ||
| 
						 | 
					6a0fb6083c | ||
| 
						 | 
					0dbfc1da4a | ||
| 
						 | 
					f945040633 | ||
| 
						 | 
					8b8e03dc66 | ||
| 
						 | 
					56ec43a0dd | ||
| 
						 | 
					74ac7455c5 | ||
| 
						 | 
					166850e315 | ||
| 
						 | 
					e15abbc69f | ||
| 
						 | 
					c6b523d3dd | ||
| 
						 | 
					1e376e41a2 | ||
| 
						 | 
					dc931b1fca | ||
| 
						 | 
					7fcb1de839 | ||
| 
						 | 
					49b02a2d77 | ||
| 
						 | 
					418a0d151e | ||
| 
						 | 
					7b0cb7f08d | ||
| 
						 | 
					1c08c320c5 | ||
| 
						 | 
					452b34a770 | ||
| 
						 | 
					6bdb723259 | ||
| 
						 | 
					31a74acfd3 | ||
| 
						 | 
					d82242169b | ||
| 
						 | 
					a0707e6170 | ||
| 
						 | 
					07fc72fea1 | ||
| 
						 | 
					813c7c415b | ||
| 
						 | 
					38b3a46ffa | ||
| 
						 | 
					60b3b2c9d0 | ||
| 
						 | 
					c7410f2693 | ||
| 
						 | 
					43a5e1409e | ||
| 
						 | 
					cd4fad5488 | ||
| 
						 | 
					28b1bceb2f | ||
| 
						 | 
					d4d76b9e83 | ||
| 
						 | 
					e1fee47759 | ||
| 
						 | 
					88e9984da5 | ||
| 
						 | 
					dac1169e82 | ||
| 
						 | 
					53ab745f7a | ||
| 
						 | 
					2bbe747045 | ||
| 
						 | 
					55cd47ffb4 | ||
| 
						 | 
					2e1d669cba | ||
| 
						 | 
					819d5cef08 | ||
| 
						 | 
					e9cba65a99 | ||
| 
						 | 
					3b1f393ae7 | ||
| 
						 | 
					61433519af | ||
| 
						 | 
					c032563a0a | ||
| 
						 | 
					943f8a46a4 | ||
| 
						 | 
					7a60df7dd3 | ||
| 
						 | 
					de0b3ab7fb | ||
| 
						 | 
					2b8d087ba1 | ||
| 
						 | 
					eec6e53851 | ||
| 
						 | 
					9cd9ae3e3e | ||
| 
						 | 
					c4fd88f519 | ||
| 
						 | 
					0a0a261d64 | ||
| 
						 | 
					6610d4f3b9 | ||
| 
						 | 
					70f74dd946 | ||
| 
						 | 
					92fdeb37a0 | ||
| 
						 | 
					ffac355834 | ||
| 
						 | 
					2e72fde15f | ||
| 
						 | 
					aa9be09088 | ||
| 
						 | 
					8bcceacf34 | ||
| 
						 | 
					a5a4b34a5a | ||
| 
						 | 
					f99267cffc | ||
| 
						 | 
					5860ecb8ec | ||
| 
						 | 
					799751bcff | ||
| 
						 | 
					beaea31a96 | ||
| 
						 | 
					a9c3dc60b9 | ||
| 
						 | 
					2fb0c899c6 | ||
| 
						 | 
					73bc0cfd93 | ||
| 
						 | 
					cbfa030de7 | ||
| 
						 | 
					bb617a9646 | ||
| 
						 | 
					7947f98b9b | ||
| 
						 | 
					fc4868cb47 | ||
| 
						 | 
					555a8493cd | ||
| 
						 | 
					2452e013aa | ||
| 
						 | 
					a29b1a3f0f | ||
| 
						 | 
					79370621ea | ||
| 
						 | 
					4c4f1ee4de | ||
| 
						 | 
					fe772376ec | ||
| 
						 | 
					99cf5acd5c | ||
| 
						 | 
					d2c38b1c73 | ||
| 
						 | 
					673d7ac121 | ||
| 
						 | 
					666d437538 | ||
| 
						 | 
					ddf72ed59f | ||
| 
						 | 
					6502735b9c | ||
| 
						 | 
					31a266cb93 | ||
| 
						 | 
					b703bce788 | ||
| 
						 | 
					0188a53d19 | ||
| 
						 | 
					e7ce15846d | ||
| 
						 | 
					1433ae4790 | ||
| 
						 | 
					a506153219 | ||
| 
						 | 
					bee4756251 | ||
| 
						 | 
					b3f4fb1f72 | ||
| 
						 | 
					38654b070d | ||
| 
						 | 
					82c31e1496 | ||
| 
						 | 
					4c3853abea | ||
| 
						 | 
					5b88fe121d | ||
| 
						 | 
					a46db6ecce | ||
| 
						 | 
					f4d52a896e | ||
| 
						 | 
					57b6a64eed | ||
| 
						 | 
					c0a86cd5dd | ||
| 
						 | 
					43cbb1e3dd | ||
| 
						 | 
					2cb3c3b2bf | ||
| 
						 | 
					24802a6d91 | ||
| 
						 | 
					c125ea2767 | ||
| 
						 | 
					df4fd356df | ||
| 
						 | 
					1f1f23a882 | ||
| 
						 | 
					ee4462d2b1 | ||
| 
						 | 
					41faea737a | ||
| 
						 | 
					7c69ce8bc0 | ||
| 
						 | 
					eb3633164e | ||
| 
						 | 
					a08d14fef4 | ||
| 
						 | 
					b73ff18078 | ||
| 
						 | 
					9beaae61ec | 
							
								
								
									
										173
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										173
									
								
								CHANGES
									
									
									
									
									
								
							@@ -2,179 +2,6 @@
 | 
			
		||||
 OpenSSL CHANGES
 | 
			
		||||
 _______________
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.6d and 0.9.6e  [30 Jul 2002]
 | 
			
		||||
 | 
			
		||||
  *) Fix cipher selection routines: ciphers without encryption had no flags
 | 
			
		||||
     for the cipher strength set and where therefore not handled correctly
 | 
			
		||||
     by the selection routines (PR #130).
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Fix EVP_dsa_sha macro.
 | 
			
		||||
     [Nils Larsch]
 | 
			
		||||
 | 
			
		||||
  *) New option
 | 
			
		||||
          SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
 | 
			
		||||
     for disabling the SSL 3.0/TLS 1.0 CBC vulnerability countermeasure
 | 
			
		||||
     that was added in OpenSSL 0.9.6d.
 | 
			
		||||
 | 
			
		||||
     As the countermeasure turned out to be incompatible with some
 | 
			
		||||
     broken SSL implementations, the new option is part of SSL_OP_ALL.
 | 
			
		||||
     SSL_OP_ALL is usually employed when compatibility with weird SSL
 | 
			
		||||
     implementations is desired (e.g. '-bugs' option to 's_client' and
 | 
			
		||||
     's_server'), so the new option is automatically set in many
 | 
			
		||||
     applications.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  *) Changes in security patch:
 | 
			
		||||
 | 
			
		||||
     Changes marked "(CHATS)" were sponsored by the Defense Advanced
 | 
			
		||||
     Research Projects Agency (DARPA) and Air Force Research Laboratory,
 | 
			
		||||
     Air Force Materiel Command, USAF, under agreement number
 | 
			
		||||
     F30602-01-2-0537.
 | 
			
		||||
 | 
			
		||||
  *) Add various sanity checks to asn1_get_length() to reject
 | 
			
		||||
     the ASN1 length bytes if they exceed sizeof(long), will appear
 | 
			
		||||
     negative or the content length exceeds the length of the
 | 
			
		||||
     supplied buffer.
 | 
			
		||||
     [Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
 | 
			
		||||
 | 
			
		||||
  *) Assertions for various potential buffer overflows, not known to
 | 
			
		||||
     happen in practice.
 | 
			
		||||
     [Ben Laurie (CHATS)]
 | 
			
		||||
 | 
			
		||||
  *) Various temporary buffers to hold ASCII versions of integers were
 | 
			
		||||
     too small for 64 bit platforms. (CAN-2002-0655)
 | 
			
		||||
     [Matthew Byng-Maddick <mbm@aldigital.co.uk> and Ben Laurie (CHATS)>
 | 
			
		||||
 | 
			
		||||
  *) Remote buffer overflow in SSL3 protocol - an attacker could
 | 
			
		||||
     supply an oversized session ID to a client. (CAN-2002-0656)
 | 
			
		||||
     [Ben Laurie (CHATS)]
 | 
			
		||||
 | 
			
		||||
  *) Remote buffer overflow in SSL2 protocol - an attacker could
 | 
			
		||||
     supply an oversized client master key. (CAN-2002-0656)
 | 
			
		||||
     [Ben Laurie (CHATS)]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.6c and 0.9.6d  [9 May 2002]
 | 
			
		||||
 | 
			
		||||
  *) Fix crypto/asn1/a_sign.c so that 'parameters' is omitted (not
 | 
			
		||||
     encoded as NULL) with id-dsa-with-sha1.
 | 
			
		||||
     [Nils Larsch <nla@trustcenter.de>; problem pointed out by Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Check various X509_...() return values in apps/req.c.
 | 
			
		||||
     [Nils Larsch <nla@trustcenter.de>]
 | 
			
		||||
 | 
			
		||||
  *) Fix BASE64 decode (EVP_DecodeUpdate) for data with CR/LF ended lines:
 | 
			
		||||
     an end-of-file condition would erronously be flagged, when the CRLF
 | 
			
		||||
     was just at the end of a processed block. The bug was discovered when
 | 
			
		||||
     processing data through a buffering memory BIO handing the data to a
 | 
			
		||||
     BASE64-decoding BIO. Bug fund and patch submitted by Pavel Tsekov
 | 
			
		||||
     <ptsekov@syntrex.com> and Nedelcho Stanev.
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Implement a countermeasure against a vulnerability recently found
 | 
			
		||||
     in CBC ciphersuites in SSL 3.0/TLS 1.0: Send an empty fragment
 | 
			
		||||
     before application data chunks to avoid the use of known IVs
 | 
			
		||||
     with data potentially chosen by the attacker.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix length checks in ssl3_get_client_hello().
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) TLS/SSL library bugfix: use s->s3->in_read_app_data differently
 | 
			
		||||
     to prevent ssl3_read_internal() from incorrectly assuming that
 | 
			
		||||
     ssl3_read_bytes() found application data while handshake
 | 
			
		||||
     processing was enabled when in fact s->s3->in_read_app_data was
 | 
			
		||||
     merely automatically cleared during the initial handshake.
 | 
			
		||||
     [Bodo Moeller; problem pointed out by Arne Ansper <arne@ats.cyber.ee>]
 | 
			
		||||
 | 
			
		||||
  *) Fix object definitions for Private and Enterprise: they were not
 | 
			
		||||
     recognized in their shortname (=lowercase) representation. Extend
 | 
			
		||||
     obj_dat.pl to issue an error when using undefined keywords instead
 | 
			
		||||
     of silently ignoring the problem (Svenning Sorensen
 | 
			
		||||
     <sss@sss.dnsalias.net>).
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Fix DH_generate_parameters() so that it works for 'non-standard'
 | 
			
		||||
     generators, i.e. generators other than 2 and 5.  (Previously, the
 | 
			
		||||
     code did not properly initialise the 'add' and 'rem' values to
 | 
			
		||||
     BN_generate_prime().)
 | 
			
		||||
 | 
			
		||||
     In the new general case, we do not insist that 'generator' is
 | 
			
		||||
     actually a primitive root: This requirement is rather pointless;
 | 
			
		||||
     a generator of the order-q subgroup is just as good, if not
 | 
			
		||||
     better.
 | 
			
		||||
     [Bodo Moeller]
 | 
			
		||||
 
 | 
			
		||||
  *) Map new X509 verification errors to alerts. Discovered and submitted by
 | 
			
		||||
     Tom Wu <tom@arcot.com>.
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Fix ssl3_pending() (ssl/s3_lib.c) to prevent SSL_pending() from
 | 
			
		||||
     returning non-zero before the data has been completely received
 | 
			
		||||
     when using non-blocking I/O.
 | 
			
		||||
     [Bodo Moeller; problem pointed out by John Hughes]
 | 
			
		||||
 | 
			
		||||
  *) Some of the ciphers missed the strength entry (SSL_LOW etc).
 | 
			
		||||
     [Ben Laurie, Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Fix bug in SSL_clear(): bad sessions were not removed (found by
 | 
			
		||||
     Yoram Zahavi <YoramZ@gilian.com>).
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Add information about CygWin 1.3 and on, and preserve proper
 | 
			
		||||
     configuration for the versions before that.
 | 
			
		||||
     [Corinna Vinschen <vinschen@redhat.com> and Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) Make removal from session cache (SSL_CTX_remove_session()) more robust:
 | 
			
		||||
     check whether we deal with a copy of a session and do not delete from
 | 
			
		||||
     the cache in this case. Problem reported by "Izhar Shoshani Levi"
 | 
			
		||||
     <izhar@checkpoint.com>.
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Do not store session data into the internal session cache, if it
 | 
			
		||||
     is never intended to be looked up (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
 | 
			
		||||
     flag is set). Proposed by Aslam <aslam@funk.com>.
 | 
			
		||||
     [Lutz Jaenicke]
 | 
			
		||||
 | 
			
		||||
  *) Have ASN1_BIT_STRING_set_bit() really clear a bit when the requested
 | 
			
		||||
     value is 0.
 | 
			
		||||
     [Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) [In 0.9.6c-engine release:]
 | 
			
		||||
     Fix a crashbug and a logic bug in hwcrhk_load_pubkey()
 | 
			
		||||
     [Toomas Kiisk <vix@cyber.ee> via Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) Add the configuration target linux-s390x.
 | 
			
		||||
     [Neale Ferguson <Neale.Ferguson@SoftwareAG-USA.com> via Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) The earlier bugfix for the SSL3_ST_SW_HELLO_REQ_C case of
 | 
			
		||||
     ssl3_accept (ssl/s3_srvr.c) incorrectly used a local flag
 | 
			
		||||
     variable as an indication that a ClientHello message has been
 | 
			
		||||
     received.  As the flag value will be lost between multiple
 | 
			
		||||
     invocations of ssl3_accept when using non-blocking I/O, the
 | 
			
		||||
     function may not be aware that a handshake has actually taken
 | 
			
		||||
     place, thus preventing a new session from being added to the
 | 
			
		||||
     session cache.
 | 
			
		||||
 | 
			
		||||
     To avoid this problem, we now set s->new_session to 2 instead of
 | 
			
		||||
     using a local variable.
 | 
			
		||||
     [Lutz Jaenicke, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Bugfix: Return -1 from ssl3_get_server_done (ssl3/s3_clnt.c)
 | 
			
		||||
     if the SSL_R_LENGTH_MISMATCH error is detected.
 | 
			
		||||
     [Geoff Thorpe, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) New 'shared_ldflag' column in Configure platform table.
 | 
			
		||||
     [Richard Levitte]
 | 
			
		||||
 | 
			
		||||
  *) Fix EVP_CIPHER_mode macro.
 | 
			
		||||
     ["Dan S. Camper" <dan@bti.net>]
 | 
			
		||||
 | 
			
		||||
  *) Fix ssl3_read_bytes (ssl/s3_pkt.c): To ignore messages of unknown
 | 
			
		||||
     type, we must throw them away by setting rr->length to 0.
 | 
			
		||||
     [D P Chang <dpc@qualys.com>]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.6b and 0.9.6c  [21 dec 2001]
 | 
			
		||||
 | 
			
		||||
  *) Fix BN_rand_range bug pointed out by Dominikus Scherkl
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										296
									
								
								Configure
									
									
									
									
									
								
							
							
						
						
									
										296
									
								
								Configure
									
									
									
									
									
								
							@@ -10,7 +10,7 @@ use strict;
 | 
			
		||||
 | 
			
		||||
# see INSTALL for instructions.
 | 
			
		||||
 | 
			
		||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--test-sanity] os/compiler[:flags]\n";
 | 
			
		||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no-threads] [no-asm] [no-dso] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] os/compiler[:flags]\n";
 | 
			
		||||
 | 
			
		||||
# Options:
 | 
			
		||||
#
 | 
			
		||||
@@ -23,24 +23,11 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
 | 
			
		||||
#               default).  This needn't be set in advance, you can
 | 
			
		||||
#               just as well use "make INSTALL_PREFIX=/whatever install".
 | 
			
		||||
#
 | 
			
		||||
# no-hw-xxx     do not compile support for specific crypto hardware.
 | 
			
		||||
#               Generic OpenSSL-style methods relating to this support
 | 
			
		||||
#               are always compiled but return NULL if the hardware
 | 
			
		||||
#               support isn't compiled.
 | 
			
		||||
# no-hw         do not compile support for any crypto hardware.
 | 
			
		||||
#
 | 
			
		||||
# --test-sanity Make a number of sanity checks on the data in this file.
 | 
			
		||||
#               This is a debugging tool for OpenSSL developers.
 | 
			
		||||
#
 | 
			
		||||
# rsaref        use RSAref
 | 
			
		||||
# [no-]threads  [don't] try to create a library that is suitable for
 | 
			
		||||
#               multithreaded applications (default is "threads" if we
 | 
			
		||||
#               know how to do it)
 | 
			
		||||
# [no-]shared	[don't] try to create shared libraries when supported.
 | 
			
		||||
#               IT IS NOT RECOMMENDED TO USE "shared"!  Since this is a
 | 
			
		||||
#               development branch, the positions of the ENGINE symbols
 | 
			
		||||
#               in the transfer vector are constantly moving, so binary
 | 
			
		||||
#               backward compatibility can't be guaranteed in any way.
 | 
			
		||||
# no-asm        do not use assembler
 | 
			
		||||
# no-dso        do not compile in any native shared-library methods. This
 | 
			
		||||
#               will ensure that all methods just return NULL.
 | 
			
		||||
@@ -110,7 +97,7 @@ my $alpha_asm="::::::::";
 | 
			
		||||
# -DB_ENDIAN slows things down on a sparc for md5, but helps sha1.
 | 
			
		||||
# So the md5_locl.h file has an undef B_ENDIAN if sun is defined
 | 
			
		||||
 | 
			
		||||
#config-string	$cc : $cflags : $unistd : $thread_cflag : $lflags : $bn_ops : $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_ldflag : $shared_extension : $ranlib
 | 
			
		||||
#config-string	$cc : $cflags : $unistd : $thread_cflag : $lflags : $bn_ops : $bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag
 | 
			
		||||
 | 
			
		||||
my %table=(
 | 
			
		||||
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
 | 
			
		||||
@@ -145,45 +132,44 @@ 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:solaris-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)",
 | 
			
		||||
"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: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)",
 | 
			
		||||
"solaris64-sparcv9-gcc31","gcc:-mcpu=ultrasparc -m64 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64:.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:solaris-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: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)",
 | 
			
		||||
"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
 | 
			
		||||
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-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)",
 | 
			
		||||
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-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)",
 | 
			
		||||
# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
 | 
			
		||||
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
 | 
			
		||||
# SC5.0 note: Compiler common patch 107357-01 or later is required!
 | 
			
		||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
 | 
			
		||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
 | 
			
		||||
####
 | 
			
		||||
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
#### SPARC Linux setups
 | 
			
		||||
"linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
 | 
			
		||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
 | 
			
		||||
# assisted with debugging of following two configs.
 | 
			
		||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o::::",
 | 
			
		||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
 | 
			
		||||
# -Wa,-Av8plus should do the trick no matter what.
 | 
			
		||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DULTRASPARC -DBN_DIV2W::-D_REENTRANT:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
 | 
			
		||||
# !!!Folowing can't be even tested yet!!!
 | 
			
		||||
#    We have to wait till 64-bit glibc for SPARC is operational!!!
 | 
			
		||||
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
 | 
			
		||||
@@ -194,17 +180,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::::::::::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-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}: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)",
 | 
			
		||||
"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}: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)",
 | 
			
		||||
"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:
 | 
			
		||||
@@ -236,45 +222,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-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)",
 | 
			
		||||
"hpux64-parisc-gcc","gcc:-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:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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-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-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-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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-shared:-fPIC::.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-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-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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:hpux-shared:-fPIC::.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: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:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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?
 | 
			
		||||
@@ -285,9 +270,6 @@ 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:::",
 | 
			
		||||
 | 
			
		||||
#### PARISC Linux setups
 | 
			
		||||
"linux-parisc","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
@@ -313,15 +295,15 @@ my %table=(
 | 
			
		||||
#
 | 
			
		||||
# 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: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",
 | 
			
		||||
"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)",
 | 
			
		||||
"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
 | 
			
		||||
# Special notes:
 | 
			
		||||
@@ -336,8 +318,8 @@ my %table=(
 | 
			
		||||
#
 | 
			
		||||
#					<appro@fy.chalmers.se>
 | 
			
		||||
#
 | 
			
		||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
 | 
			
		||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
 | 
			
		||||
 | 
			
		||||
@@ -346,24 +328,23 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the
 | 
			
		||||
# bn86-elf.o file file since it is hand tweaked assembler.
 | 
			
		||||
"linux-elf",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT:-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-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:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"linux-elf",	"gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT:-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-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-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-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-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::SIXTY_FOUR_BIT_LONG:::::::::::linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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::-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)",
 | 
			
		||||
"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::-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)",
 | 
			
		||||
"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)",
 | 
			
		||||
"nextstep",	"cc:-O -Wall:<libc.h>:(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
 | 
			
		||||
"nextstep3.3",	"cc:-O3 -Wall:<libc.h>:(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
 | 
			
		||||
# NCR MP-RAS UNIX ver 02.03.01
 | 
			
		||||
@@ -376,7 +357,7 @@ my %table=(
 | 
			
		||||
"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)",
 | 
			
		||||
"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)",
 | 
			
		||||
 | 
			
		||||
# UnixWare 2.0x fails destest with -O
 | 
			
		||||
"unixware-2.0","cc:-DFILIO_H::-Kthread:-lsocket -lnsl -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
 | 
			
		||||
@@ -391,7 +372,7 @@ 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)",
 | 
			
		||||
"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}::",
 | 
			
		||||
@@ -408,7 +389,7 @@ my %table=(
 | 
			
		||||
"aix43-gcc",  "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:",
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Cray T90 and similar (SDSC)
 | 
			
		||||
# Cray T90 (SDSC)
 | 
			
		||||
# It's Big-endian, but the algorithms work properly when B_ENDIAN is NOT
 | 
			
		||||
# defined.  The T90 ints and longs are 8 bytes long, and apparently the
 | 
			
		||||
# B_ENDIAN code assumes 4 byte ints.  Fortunately, the non-B_ENDIAN and
 | 
			
		||||
@@ -418,10 +399,7 @@ my %table=(
 | 
			
		||||
#'Taking the address of a bit field is not allowed. '
 | 
			
		||||
#'An expression with bit field exists as the operand of "sizeof" '
 | 
			
		||||
# (written by Wayne Schroeder <schroede@SDSC.EDU>)
 | 
			
		||||
#
 | 
			
		||||
# j90 is considered the base machine type for unicos machines,
 | 
			
		||||
# so this configuration is now called "cray-j90" ...
 | 
			
		||||
"cray-j90", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT:::",
 | 
			
		||||
"cray-t90-cc", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT:::",
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Cray T3E (Research Center Juelich, beckman@acl.lanl.gov)
 | 
			
		||||
@@ -443,11 +421,9 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the
 | 
			
		||||
# SCO cc.
 | 
			
		||||
"sco5-cc",  "cc:-belf::(unknown):-lsocket -lresolv:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
 | 
			
		||||
"sco5-cc",  "cc:::(unknown):-lsocket:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
 | 
			
		||||
"sco5-cc-pentium",  "cc:-Kpentium::(unknown):-lsocket:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
 | 
			
		||||
"sco5-gcc",  "gcc:-O3 -fomit-frame-pointer::(unknown):-lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
 | 
			
		||||
"sco5-cc-shared","cc:-belf:::-lsocket -lresolv -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr3-shared:-Kpic",
 | 
			
		||||
"sco5-gcc-shared","gcc:-O3 -fomit-frame-pointer:::-lsocket -lresolv -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:svr3-shared:-fPIC", # the SCO assembler doesn't seem to like our assembler files ...
 | 
			
		||||
 | 
			
		||||
# Sinix/ReliantUNIX RM400
 | 
			
		||||
# NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g  */
 | 
			
		||||
@@ -482,12 +458,8 @@ my %table=(
 | 
			
		||||
# and its library files in util/pl/*)
 | 
			
		||||
"Mingw32", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
 | 
			
		||||
 | 
			
		||||
# UWIN 
 | 
			
		||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
 | 
			
		||||
 | 
			
		||||
# Cygwin
 | 
			
		||||
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
 | 
			
		||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32:cygwin-shared:::.dll",
 | 
			
		||||
# CygWin32
 | 
			
		||||
"CygWin32", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
 | 
			
		||||
 | 
			
		||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
 | 
			
		||||
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown)::::::",
 | 
			
		||||
@@ -496,49 +468,23 @@ my %table=(
 | 
			
		||||
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown)::::::",
 | 
			
		||||
 | 
			
		||||
# Some OpenBSD from Bob Beck <beck@obtuse.com>
 | 
			
		||||
"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"OpenBSD-x86",  "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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)",
 | 
			
		||||
"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"OpenBSD-x86",  "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"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 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 -D_DARWIN -DB_ENDIAN -fno-common::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
"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::::",
 | 
			
		||||
 | 
			
		||||
##### VxWorks for various targets
 | 
			
		||||
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DVXWORKS -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::-r:::::",
 | 
			
		||||
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
 | 
			
		||||
	BC-16 Mingw32);
 | 
			
		||||
 | 
			
		||||
my $idx = 0;
 | 
			
		||||
my $idx_cc = $idx++;
 | 
			
		||||
my $idx_cflags = $idx++;
 | 
			
		||||
my $idx_unistd = $idx++;
 | 
			
		||||
my $idx_thread_cflag = $idx++;
 | 
			
		||||
my $idx_lflags = $idx++;
 | 
			
		||||
my $idx_bn_ops = $idx++;
 | 
			
		||||
my $idx_bn_obj = $idx++;
 | 
			
		||||
my $idx_des_obj = $idx++;
 | 
			
		||||
my $idx_bf_obj = $idx++;
 | 
			
		||||
my $idx_md5_obj = $idx++;
 | 
			
		||||
my $idx_sha1_obj = $idx++;
 | 
			
		||||
my $idx_cast_obj = $idx++;
 | 
			
		||||
my $idx_rc4_obj = $idx++;
 | 
			
		||||
my $idx_rmd160_obj = $idx++;
 | 
			
		||||
my $idx_rc5_obj = $idx++;
 | 
			
		||||
my $idx_dso_scheme = $idx++;
 | 
			
		||||
my $idx_shared_target = $idx++;
 | 
			
		||||
my $idx_shared_cflag = $idx++;
 | 
			
		||||
my $idx_shared_ldflag = $idx++;
 | 
			
		||||
my $idx_shared_extension = $idx++;
 | 
			
		||||
my $idx_ranlib = $idx++;
 | 
			
		||||
 | 
			
		||||
my $prefix="";
 | 
			
		||||
my $openssldir="";
 | 
			
		||||
my $exe_ext="";
 | 
			
		||||
@@ -611,28 +557,12 @@ PROCESS_ARGS:
 | 
			
		||||
	foreach (@argvcopy)
 | 
			
		||||
		{
 | 
			
		||||
		s /^-no-/no-/; # some people just can't read the instructions
 | 
			
		||||
		if (/^--test-sanity$/)
 | 
			
		||||
			{
 | 
			
		||||
			exit(&test_sanity());
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^no-asm$/)
 | 
			
		||||
		if (/^no-asm$/)
 | 
			
		||||
		 	{
 | 
			
		||||
			$no_asm=1;
 | 
			
		||||
			$flags .= "-DNO_ASM ";
 | 
			
		||||
			$openssl_other_defines .= "#define NO_ASM\n";
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^no-hw-(.+)$/)
 | 
			
		||||
			{
 | 
			
		||||
			my $hw=$1;
 | 
			
		||||
			$hw =~ tr/[a-z]/[A-Z]/;
 | 
			
		||||
			$flags .= "-DNO_HW_$hw ";
 | 
			
		||||
			$openssl_other_defines .= "#define NO_HW_$hw\n";
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^no-hw$/)
 | 
			
		||||
			{
 | 
			
		||||
			$flags .= "-DNO_HW ";
 | 
			
		||||
			$openssl_other_defines .= "#define NO_HW\n";
 | 
			
		||||
			}
 | 
			
		||||
		elsif (/^no-dso$/)
 | 
			
		||||
			{ $no_dso=1; }
 | 
			
		||||
		elsif (/^no-threads$/)
 | 
			
		||||
@@ -756,17 +686,13 @@ if ($target eq "LIST") {
 | 
			
		||||
	exit 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if ($target =~ m/^CygWin32(-.*)$/) {
 | 
			
		||||
	$target = "Cygwin".$1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
print "Configuring for $target\n";
 | 
			
		||||
 | 
			
		||||
&usage if (!defined($table{$target}));
 | 
			
		||||
 | 
			
		||||
my $IsWindows=scalar grep /^$target$/,@WinTargets;
 | 
			
		||||
 | 
			
		||||
$exe_ext=".exe" if ($target eq "Cygwin");
 | 
			
		||||
$exe_ext=".exe" if ($target eq "CygWin32");
 | 
			
		||||
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
 | 
			
		||||
$prefix=$openssldir if $prefix eq "";
 | 
			
		||||
 | 
			
		||||
@@ -779,29 +705,9 @@ $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /^\//;
 | 
			
		||||
 | 
			
		||||
print "IsWindows=$IsWindows\n";
 | 
			
		||||
 | 
			
		||||
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
 | 
			
		||||
my $cc = $fields[$idx_cc];
 | 
			
		||||
my $cflags = $fields[$idx_cflags];
 | 
			
		||||
my $unistd = $fields[$idx_unistd];
 | 
			
		||||
my $thread_cflag = $fields[$idx_thread_cflag];
 | 
			
		||||
my $lflags = $fields[$idx_lflags];
 | 
			
		||||
my $bn_ops = $fields[$idx_bn_ops];
 | 
			
		||||
my $bn_obj = $fields[$idx_bn_obj];
 | 
			
		||||
my $des_obj = $fields[$idx_des_obj];
 | 
			
		||||
my $bf_obj = $fields[$idx_bf_obj];
 | 
			
		||||
my $md5_obj = $fields[$idx_md5_obj];
 | 
			
		||||
my $sha1_obj = $fields[$idx_sha1_obj];
 | 
			
		||||
my $cast_obj = $fields[$idx_cast_obj];
 | 
			
		||||
my $rc4_obj = $fields[$idx_rc4_obj];
 | 
			
		||||
my $rmd160_obj = $fields[$idx_rmd160_obj];
 | 
			
		||||
my $rc5_obj = $fields[$idx_rc5_obj];
 | 
			
		||||
my $dso_scheme = $fields[$idx_dso_scheme];
 | 
			
		||||
my $shared_target = $fields[$idx_shared_target];
 | 
			
		||||
my $shared_cflag = $fields[$idx_shared_cflag];
 | 
			
		||||
my $shared_ldflag = $fields[$idx_shared_ldflag];
 | 
			
		||||
my $shared_extension = $fields[$idx_shared_extension];
 | 
			
		||||
my $ranlib = $fields[$idx_ranlib];
 | 
			
		||||
 | 
			
		||||
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $lflags,my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
 | 
			
		||||
 $md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,my $shared_extension,my $ranlib)=
 | 
			
		||||
	split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
 | 
			
		||||
$cflags="$flags$cflags" if ($flags ne "");
 | 
			
		||||
 | 
			
		||||
# The DSO code currently always implements all functions so that no
 | 
			
		||||
@@ -926,10 +832,6 @@ if ($rmd160_obj =~ /\.o$/)
 | 
			
		||||
	$cflags.=" -DRMD160_ASM";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
# "Stringify" the C flags string.  This permits it to be made part of a string
 | 
			
		||||
# and works as well on command lines.
 | 
			
		||||
$cflags =~ s/([\\\"])/\\\1/g;
 | 
			
		||||
 | 
			
		||||
my $version = "unknown";
 | 
			
		||||
my $major = "unknown";
 | 
			
		||||
my $minor = "unknown";
 | 
			
		||||
@@ -1012,22 +914,13 @@ while (<IN>)
 | 
			
		||||
	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 =~ /^\.[^\.]*\.dylib$/)
 | 
			
		||||
		{
 | 
			
		||||
		s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.dylib/;
 | 
			
		||||
		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/;
 | 
			
		||||
		}
 | 
			
		||||
	elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/)
 | 
			
		||||
		{
 | 
			
		||||
		s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.\$(SHLIB_MAJOR).dylib .dylib/;
 | 
			
		||||
		}
 | 
			
		||||
	s/^SHARED_LDFLAGS=.*/SHARED_LDFLAGS=$shared_ldflag/;
 | 
			
		||||
	print OUT $_."\n";
 | 
			
		||||
	}
 | 
			
		||||
close(IN);
 | 
			
		||||
@@ -1315,7 +1208,7 @@ sub print_table_entry
 | 
			
		||||
	my $bn_obj,my $des_obj,my $bf_obj,
 | 
			
		||||
	my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
 | 
			
		||||
	my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,
 | 
			
		||||
	my $shared_ldflag,my $shared_extension,my $ranlib)=
 | 
			
		||||
	my $shared_extension,my $ranlib)=
 | 
			
		||||
	split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
 | 
			
		||||
			
 | 
			
		||||
	print <<EOF
 | 
			
		||||
@@ -1339,44 +1232,7 @@ sub print_table_entry
 | 
			
		||||
\$dso_scheme   = $dso_scheme
 | 
			
		||||
\$shared_target= $shared_target
 | 
			
		||||
\$shared_cflag = $shared_cflag
 | 
			
		||||
\$shared_ldflag = $shared_ldflag
 | 
			
		||||
\$shared_extension = $shared_extension
 | 
			
		||||
\$ranlib       = $ranlib
 | 
			
		||||
EOF
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
sub test_sanity
 | 
			
		||||
	{
 | 
			
		||||
	my $errorcnt = 0;
 | 
			
		||||
 | 
			
		||||
	print STDERR "=" x 70, "\n";
 | 
			
		||||
	print STDERR "=== SANITY TESTING!\n";
 | 
			
		||||
	print STDERR "=== No configuration will be done, all other arguments will be ignored!\n";
 | 
			
		||||
	print STDERR "=" x 70, "\n";
 | 
			
		||||
 | 
			
		||||
	foreach $target (sort keys %table)
 | 
			
		||||
		{
 | 
			
		||||
		@fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
 | 
			
		||||
 | 
			
		||||
		if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/)
 | 
			
		||||
			{
 | 
			
		||||
			$errorcnt++;
 | 
			
		||||
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
 | 
			
		||||
			print STDERR "              in the previous field\n";
 | 
			
		||||
			}
 | 
			
		||||
		elsif ($fields[$idx_dso_scheme+1] =~ /^(dl|dlfcn|win32|vms)$/)
 | 
			
		||||
			{
 | 
			
		||||
			$errorcnt++;
 | 
			
		||||
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
 | 
			
		||||
			print STDERR "              in the following field\n";
 | 
			
		||||
			}
 | 
			
		||||
		elsif ($fields[$idx_dso_scheme] !~ /^(dl|dlfcn|win32|vms|)$/)
 | 
			
		||||
			{
 | 
			
		||||
			$errorcnt++;
 | 
			
		||||
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n";
 | 
			
		||||
			print STDERR "              valid values are 'dl', 'dlfcn', 'win32' and 'vms'\n";
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
 | 
			
		||||
	return $errorcnt;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										57
									
								
								FAQ
									
									
									
									
									
								
							
							
						
						
									
										57
									
								
								FAQ
									
									
									
									
									
								
							@@ -38,8 +38,6 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* 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++?
 | 
			
		||||
* What is special about OpenSSL on Redhat?
 | 
			
		||||
* Why does the OpenSSL test suite fail on MacOS X?
 | 
			
		||||
 | 
			
		||||
[PROG] Questions about programming with OpenSSL
 | 
			
		||||
 | 
			
		||||
@@ -61,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.6e was released on 30 May, 2002.
 | 
			
		||||
OpenSSL 0.9.6b 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:
 | 
			
		||||
@@ -217,11 +215,8 @@ For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
 | 
			
		||||
installing the SUNski package from Sun patch 105710-01 (Sparc) which
 | 
			
		||||
adds a /dev/random device and make sure it gets used, usually through
 | 
			
		||||
$RANDFILE.  There are probably similar patches for the other Solaris
 | 
			
		||||
versions.  An official statement from Sun with respect to /dev/random
 | 
			
		||||
support can be found at
 | 
			
		||||
  http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski
 | 
			
		||||
However, be warned that /dev/random is usually a blocking device, which
 | 
			
		||||
may have some effects on OpenSSL.
 | 
			
		||||
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?
 | 
			
		||||
@@ -456,52 +451,6 @@ under 'Program Files').  This needs to be done prior to running NMAKE,
 | 
			
		||||
and the changes are only valid for the current DOS session.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* What is special about OpenSSL on Redhat?
 | 
			
		||||
 | 
			
		||||
Red Hat Linux (release 7.0 and later) include a preinstalled limited
 | 
			
		||||
version of OpenSSL. For patent reasons, support for IDEA, RC5 and MDC2
 | 
			
		||||
is disabled in this version. The same may apply to other Linux distributions.
 | 
			
		||||
Users may therefore wish to install more or all of the features left out.
 | 
			
		||||
 | 
			
		||||
To do this you MUST ensure that you do not overwrite the openssl that is in
 | 
			
		||||
/usr/bin on your Red Hat machine. Several packages depend on this file,
 | 
			
		||||
including sendmail and ssh. /usr/local/bin is a good alternative choice. The
 | 
			
		||||
libraries that come with Red Hat 7.0 onwards have different names and so are
 | 
			
		||||
not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
 | 
			
		||||
/lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
 | 
			
		||||
/lib/libcrypto.so.2 respectively).
 | 
			
		||||
 | 
			
		||||
Please note that we have been advised by Red Hat attempting to recompile the
 | 
			
		||||
openssl rpm with all the cryptography enabled will not work. All other
 | 
			
		||||
packages depend on the original Red Hat supplied openssl package. It is also
 | 
			
		||||
worth noting that due to the way Red Hat supplies its packages, updates to
 | 
			
		||||
openssl on each distribution never change the package version, only the
 | 
			
		||||
build number. For example, on Red Hat 7.1, the latest openssl package has
 | 
			
		||||
version number 0.9.6 and build number 9 even though it contains all the
 | 
			
		||||
relevant updates in packages up to and including 0.9.6b.
 | 
			
		||||
 | 
			
		||||
A possible way around this is to persuade Red Hat to produce a non-US
 | 
			
		||||
version of Red Hat Linux.
 | 
			
		||||
 | 
			
		||||
FYI: Patent numbers and expiry dates of US patents:
 | 
			
		||||
MDC-2: 4,908,861 13/03/2007
 | 
			
		||||
IDEA:  5,214,703 25/05/2010
 | 
			
		||||
RC5:   5,724,428 03/03/2015
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Why does the OpenSSL test suite fail on MacOS X?
 | 
			
		||||
 | 
			
		||||
If the failure happens when running 'make test' and the RC4 test fails,
 | 
			
		||||
it's very probable that you have OpenSSL 0.9.6b delivered with the
 | 
			
		||||
operating system (you can find out by running '/usr/bin/openssl version')
 | 
			
		||||
and that you were trying to build OpenSSL 0.9.6d.  The problem is that
 | 
			
		||||
the loader ('ld') in MacOS X has a misfeature that's quite difficult to
 | 
			
		||||
go around and has linked the programs "openssl" and the test programs
 | 
			
		||||
with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the
 | 
			
		||||
libraries you just built.
 | 
			
		||||
Look in the file PROBLEMS for a more detailed explanation and for possible
 | 
			
		||||
solutions.
 | 
			
		||||
 | 
			
		||||
[PROG] ========================================================================
 | 
			
		||||
 | 
			
		||||
* Is OpenSSL thread-safe?
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								INSTALL
									
									
									
									
									
								
							@@ -57,10 +57,7 @@
 | 
			
		||||
 | 
			
		||||
  shared        In addition to the usual static libraries, create shared
 | 
			
		||||
                libraries on platforms where it's supported.  See "Note on
 | 
			
		||||
                shared libraries" below.  THIS IS NOT RECOMMENDED!  Since
 | 
			
		||||
                this is a development branch, the positions of the ENGINE
 | 
			
		||||
                symbols in the transfer vector are constantly moving, so
 | 
			
		||||
                binary backward compatibility can't be guaranteed in any way.
 | 
			
		||||
                shared libraries" below.
 | 
			
		||||
 | 
			
		||||
  no-asm        Do not use assembler code.
 | 
			
		||||
 | 
			
		||||
@@ -131,11 +128,8 @@
 | 
			
		||||
     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 recorded in the request tracker publicly readable
 | 
			
		||||
     via http://www.openssl.org/rt2.html and will be forwarded to a public
 | 
			
		||||
     mailing list). Include the output of "make report" in your message.
 | 
			
		||||
     Please check out the request tracker. Maybe the bug was already
 | 
			
		||||
     reported or has already been fixed.
 | 
			
		||||
     message will be forwarded to a public mailing list).  Include the
 | 
			
		||||
     output of "make report" in your message.
 | 
			
		||||
 | 
			
		||||
     [If you encounter assembler error messages, try the "no-asm"
 | 
			
		||||
     configuration option as an immediate fix.]
 | 
			
		||||
@@ -153,8 +147,7 @@
 | 
			
		||||
     try removing any compiler optimization flags from the CFLAGS line
 | 
			
		||||
     in Makefile.ssl and run "make clean; make". Please send a bug
 | 
			
		||||
     report to <openssl-bugs@openssl.org>, including the output of
 | 
			
		||||
     "make report" in order to be added to the request tracker at
 | 
			
		||||
     http://www.openssl.org/rt2.html.
 | 
			
		||||
     "make report".
 | 
			
		||||
 | 
			
		||||
  4. If everything tests ok, install OpenSSL with
 | 
			
		||||
 | 
			
		||||
@@ -276,11 +269,6 @@
 | 
			
		||||
 Note on shared libraries
 | 
			
		||||
 ------------------------
 | 
			
		||||
 | 
			
		||||
 Shared library is currently an experimental feature.  The only reason to
 | 
			
		||||
 have them would be to conserve memory on systems where several program
 | 
			
		||||
 are using OpenSSL.  Binary backward compatibility can't be guaranteed
 | 
			
		||||
 before OpenSSL version 1.0.
 | 
			
		||||
 | 
			
		||||
 For some systems, the OpenSSL Configure script knows what is needed to
 | 
			
		||||
 build shared libraries for libcrypto and libssl.  On these systems,
 | 
			
		||||
 the shared libraries are currently not created by default, but giving
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										62
									
								
								INSTALL.W32
									
									
									
									
									
								
							
							
						
						
									
										62
									
								
								INSTALL.W32
									
									
									
									
									
								
							@@ -2,19 +2,16 @@
 | 
			
		||||
 INSTALLATION ON THE WIN32 PLATFORM
 | 
			
		||||
 ----------------------------------
 | 
			
		||||
 | 
			
		||||
 Heres a few comments about building OpenSSL in Windows environments.  Most
 | 
			
		||||
 of this is tested on Win32 but it may also work in Win 3.1 with some
 | 
			
		||||
 Heres a few comments about building OpenSSL in Windows environments. Most of
 | 
			
		||||
 this is tested on Win32 but it may also work in Win 3.1 with some
 | 
			
		||||
 modification.
 | 
			
		||||
 | 
			
		||||
 You need Perl for Win32.  Unless you will build on Cygwin, you will need
 | 
			
		||||
 ActiveState Perl, available from http://www.activestate.com/ActivePerl.
 | 
			
		||||
 For Cygwin users, there's more info in the Cygwin section.
 | 
			
		||||
 | 
			
		||||
 You need Perl for Win32 (available from http://www.activestate.com/ActivePerl)
 | 
			
		||||
 and one of the following C compilers:
 | 
			
		||||
 | 
			
		||||
  * Visual C++
 | 
			
		||||
  * Borland C
 | 
			
		||||
  * GNU C (Mingw32 or Cygwin)
 | 
			
		||||
  * GNU C (Mingw32 or Cygwin32)
 | 
			
		||||
 | 
			
		||||
 If you want to compile in the assembly language routines with Visual C++ then
 | 
			
		||||
 you will need an assembler. This is worth doing because it will result in
 | 
			
		||||
@@ -81,7 +78,7 @@
 | 
			
		||||
 | 
			
		||||
 There are various changes you can make to the Win32 compile environment. By
 | 
			
		||||
 default the library is not compiled with debugging symbols. If you add 'debug'
 | 
			
		||||
 to the mk1mf.pl lines in the do_* batch file then debugging symbols will be
 | 
			
		||||
 to the mk1mk.pl lines in the do_* batch file then debugging symbols will be
 | 
			
		||||
 compiled in.
 | 
			
		||||
 | 
			
		||||
 The default Win32 environment is to leave out any Windows NT specific
 | 
			
		||||
@@ -94,18 +91,6 @@
 | 
			
		||||
 You can also build a static version of the library using the Makefile
 | 
			
		||||
 ms\nt.mak
 | 
			
		||||
 | 
			
		||||
 Borland C++ builder 5
 | 
			
		||||
 ---------------------
 | 
			
		||||
 | 
			
		||||
 * Configure for building with Borland Builder:
 | 
			
		||||
   > perl Configure BC-32
 | 
			
		||||
 | 
			
		||||
 * Create the appropriate makefile
 | 
			
		||||
   > ms\do_nasm
 | 
			
		||||
 | 
			
		||||
 * Build
 | 
			
		||||
   > make -f ms\bcb.mak
 | 
			
		||||
 | 
			
		||||
 Borland C++ builder 3 and 4
 | 
			
		||||
 ---------------------------
 | 
			
		||||
 | 
			
		||||
@@ -149,30 +134,28 @@
 | 
			
		||||
   > cd out
 | 
			
		||||
   > ..\ms\test
 | 
			
		||||
 | 
			
		||||
 GNU C (Cygwin)
 | 
			
		||||
 --------------
 | 
			
		||||
 GNU C (CygWin32)
 | 
			
		||||
 ---------------
 | 
			
		||||
 | 
			
		||||
 Cygwin provides a bash shell and GNU tools environment running on
 | 
			
		||||
 CygWin32 provides a bash shell and GNU tools environment running on
 | 
			
		||||
 NT 4.0, Windows 9x and Windows 2000. Consequently, a make of OpenSSL
 | 
			
		||||
 with Cygwin is closer to a GNU bash environment such as Linux rather
 | 
			
		||||
 with CygWin is closer to a GNU bash environment such as Linux rather
 | 
			
		||||
 than other W32 makes that are based on a single makefile approach.
 | 
			
		||||
 Cygwin implements Posix/Unix calls through cygwin1.dll, and is
 | 
			
		||||
 CygWin32 implements Posix/Unix calls through cygwin1.dll, and is
 | 
			
		||||
 contrasted to Mingw32 which links dynamically to msvcrt.dll or
 | 
			
		||||
 crtdll.dll.
 | 
			
		||||
 | 
			
		||||
 To build OpenSSL using Cygwin:
 | 
			
		||||
 To build OpenSSL using CygWin32:
 | 
			
		||||
 | 
			
		||||
 * Install Cygwin (see http://sourceware.cygnus.com/cygwin)
 | 
			
		||||
 * Install CygWin32 (see http://sourceware.cygnus.com/cygwin)
 | 
			
		||||
 | 
			
		||||
 * Install Perl and ensure it is in the path (recent Cygwin perl 
 | 
			
		||||
   (version 5.6.1-2 of the latter has been reported to work) or
 | 
			
		||||
   ActivePerl)
 | 
			
		||||
 * Install Perl and ensure it is in the path
 | 
			
		||||
 | 
			
		||||
 * Run the Cygwin bash shell
 | 
			
		||||
 * Run the CygWin bash shell
 | 
			
		||||
 | 
			
		||||
 * $ tar zxvf openssl-x.x.x.tar.gz
 | 
			
		||||
   $ cd openssl-x.x.x
 | 
			
		||||
   $ ./config
 | 
			
		||||
   $ ./Configure no-threads CygWin32
 | 
			
		||||
   [...]
 | 
			
		||||
   $ make
 | 
			
		||||
   [...]
 | 
			
		||||
@@ -181,28 +164,27 @@
 | 
			
		||||
 | 
			
		||||
 This will create a default install in /usr/local/ssl.
 | 
			
		||||
 | 
			
		||||
 Cygwin Notes:
 | 
			
		||||
 CygWin32 Notes:
 | 
			
		||||
 | 
			
		||||
 "make test" and normal file operations may fail in directories
 | 
			
		||||
 mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
 | 
			
		||||
 mounted as text (i.e. mount -t c:\somewhere /home) due to CygWin
 | 
			
		||||
 stripping of carriage returns. To avoid this ensure that a binary
 | 
			
		||||
 mount is used, e.g. mount -b c:\somewhere /home.
 | 
			
		||||
 | 
			
		||||
 As of version 1.1.1 Cygwin is relatively unstable in its handling
 | 
			
		||||
 As of version 1.1.1 CygWin32 is relatively unstable in its handling
 | 
			
		||||
 of cr/lf issues. These make procedures succeeded with versions 1.1 and
 | 
			
		||||
 the snapshot 20000524 (Slow!).
 | 
			
		||||
 | 
			
		||||
 "bc" is not provided in the Cygwin distribution.  This causes a
 | 
			
		||||
 "bc" is not provided in the CygWin32 distribution.  This causes a
 | 
			
		||||
 non-fatal error in "make test" but is otherwise harmless.  If
 | 
			
		||||
 desired, GNU bc can be built with Cygwin without change.
 | 
			
		||||
 desired, GNU bc can be built with CygWin32 without change.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 Installation
 | 
			
		||||
 ------------
 | 
			
		||||
 | 
			
		||||
 If you used the Cygwin procedure above, you have already installed and
 | 
			
		||||
 can skip this section.  For all other procedures, there's currently no real
 | 
			
		||||
 installation procedure for Win32.  There are, however, some suggestions:
 | 
			
		||||
 There's currently no real installation procedure for Win32.  There are,
 | 
			
		||||
 however, some suggestions:
 | 
			
		||||
 | 
			
		||||
    - do nothing.  The include files are found in the inc32/ subdirectory,
 | 
			
		||||
      all binaries are found in out32dll/ or out32/ depending if you built
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							@@ -12,7 +12,7 @@
 | 
			
		||||
  ---------------
 | 
			
		||||
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2002 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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										144
									
								
								Makefile.org
									
									
									
									
									
								
							
							
						
						
									
										144
									
								
								Makefile.org
									
									
									
									
									
								
							@@ -162,7 +162,7 @@ SHLIBDIRS= crypto ssl
 | 
			
		||||
SDIRS=  \
 | 
			
		||||
	md2 md4 md5 sha mdc2 hmac ripemd \
 | 
			
		||||
	des rc2 rc4 rc5 idea bf cast \
 | 
			
		||||
	bn rsa dsa dh dso engine \
 | 
			
		||||
	bn rsa dsa dh dso \
 | 
			
		||||
	buffer bio stack lhash rand err objects \
 | 
			
		||||
	evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
 | 
			
		||||
 | 
			
		||||
@@ -183,7 +183,6 @@ SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
 | 
			
		||||
SHARED_SSL=libssl$(SHLIB_EXT)
 | 
			
		||||
SHARED_LIBS=
 | 
			
		||||
SHARED_LIBS_LINK_EXTS=
 | 
			
		||||
SHARED_LDFLAGS=
 | 
			
		||||
 | 
			
		||||
GENERAL=        Makefile
 | 
			
		||||
BASENAME=       openssl
 | 
			
		||||
@@ -236,22 +235,19 @@ clean-shared:
 | 
			
		||||
			done; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
 | 
			
		||||
		if [ "$(PLATFORM)" = "Cygwin" ]; then \
 | 
			
		||||
			( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
 | 
			
		||||
		fi; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
link-shared:
 | 
			
		||||
	@if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
 | 
			
		||||
		tmp="$(SHARED_LIBS_LINK_EXTS)"; \
 | 
			
		||||
		for i in $(SHLIBDIRS); do \
 | 
			
		||||
			prev=lib$$i$(SHLIB_EXT); \
 | 
			
		||||
	@for i in $(SHLIBDIRS); do \
 | 
			
		||||
		prev=lib$$i$(SHLIB_EXT); \
 | 
			
		||||
		if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
 | 
			
		||||
			tmp="$(SHARED_LIBS_LINK_EXTS)"; \
 | 
			
		||||
			for j in $${tmp:-x}; do \
 | 
			
		||||
				( set -x; ln -f -s $$prev lib$$i$$j ); \
 | 
			
		||||
				prev=lib$$i$$j; \
 | 
			
		||||
			done; \
 | 
			
		||||
		done; \
 | 
			
		||||
	fi
 | 
			
		||||
		fi; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
build-shared: clean-shared do_$(SHLIB_TARGET) link-shared
 | 
			
		||||
 | 
			
		||||
@@ -259,10 +255,8 @@ do_bsd-gcc-shared: do_gnu-shared
 | 
			
		||||
do_linux-shared: do_gnu-shared
 | 
			
		||||
do_gnu-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; ${CC} ${SHARED_LDFLAGS} \
 | 
			
		||||
		-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
	( set -x; ${CC}  -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-Wl,-Bsymbolic \
 | 
			
		||||
		-Wl,--whole-archive lib$$i.a \
 | 
			
		||||
		-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
 | 
			
		||||
	libs="$$libs -l$$i"; \
 | 
			
		||||
@@ -275,35 +269,13 @@ DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
 | 
			
		||||
	[ -n "$$my_ld" ] && \
 | 
			
		||||
	$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
 | 
			
		||||
 | 
			
		||||
# For Darwin AKA Mac OS/X (dyld)
 | 
			
		||||
do_darwin-shared: 
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x ; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
 | 
			
		||||
		lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		-compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
 | 
			
		||||
		-install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
 | 
			
		||||
	libs="$$libs -l`basename $$i${SHLIB_EXT} .dylib`"; \
 | 
			
		||||
	echo "" ; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
do_cygwin-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; ${CC}  -shared -o cyg$$i.dll \
 | 
			
		||||
		-Wl,-Bsymbolic \
 | 
			
		||||
		-Wl,--whole-archive lib$$i.a \
 | 
			
		||||
		-Wl,--out-implib,lib$$i.dll.a \
 | 
			
		||||
		-Wl,--no-whole-archive $$libs ) || exit 1; \
 | 
			
		||||
	libs="$$libs -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
# 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_LDFLAGS} \
 | 
			
		||||
			-shared -o lib$$i.so \
 | 
			
		||||
		( 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"; \
 | 
			
		||||
@@ -318,8 +290,7 @@ do_tru64-shared:
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( set -x; ${CC} ${SHARED_LDFLAGS} \
 | 
			
		||||
			-shared -msym -o lib$$i.so \
 | 
			
		||||
		( 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"; \
 | 
			
		||||
@@ -334,8 +305,7 @@ do_tru64-shared-rpath:
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( set -x; ${CC} ${SHARED_LDFLAGS} \
 | 
			
		||||
			-shared -msym -o lib$$i.so \
 | 
			
		||||
		( 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; \
 | 
			
		||||
@@ -351,16 +321,15 @@ do_solaris-shared:
 | 
			
		||||
	else \
 | 
			
		||||
		libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
		( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
 | 
			
		||||
		  set -x; ${CC} ${SHARED_LDFLAGS} \
 | 
			
		||||
			-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		  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
 | 
			
		||||
 | 
			
		||||
# OpenServer 5 native compilers used
 | 
			
		||||
do_svr3-shared:
 | 
			
		||||
# UnixWare 7 and OpenUNIX 8 native compilers used
 | 
			
		||||
do_svr5-shared:
 | 
			
		||||
	if ${DETECT_GNU_LD}; then \
 | 
			
		||||
		$(MAKE) do_gnu-shared; \
 | 
			
		||||
	else \
 | 
			
		||||
@@ -378,34 +347,13 @@ do_svr3-shared:
 | 
			
		||||
		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} ${SHARED_LDFLAGS} \
 | 
			
		||||
			-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_LDFLAGS} \
 | 
			
		||||
			-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
		( 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"; \
 | 
			
		||||
@@ -414,24 +362,20 @@ do_irix-shared:
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
do_hpux-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
 | 
			
		||||
		+vnocompatwarnings \
 | 
			
		||||
	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; \
 | 
			
		||||
	chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} ; \
 | 
			
		||||
	libs="$$libs -L. -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
# This assumes that GNU utilities are *not* used
 | 
			
		||||
do_hpux64-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
	( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
 | 
			
		||||
		-b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
 | 
			
		||||
	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; \
 | 
			
		||||
	chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} ; \
 | 
			
		||||
	libs="$$libs -L. -l$$i"; \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
@@ -465,7 +409,7 @@ do_hpux64-shared:
 | 
			
		||||
#  HP/UX-64bit: /usr/ccs/bin/ld
 | 
			
		||||
#  AIX:		$(CC)
 | 
			
		||||
ALLSYMSFLAG=-bnogc
 | 
			
		||||
SHAREDFLAGS=${SHARED_LDFLAGS} -G -bE:lib$$i.exp -bM:SRE
 | 
			
		||||
SHAREDFLAGS=-G -bE:lib$$i.exp -bM:SRE
 | 
			
		||||
SHAREDCMD=$(CC)
 | 
			
		||||
do_aix-shared:
 | 
			
		||||
	libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
 | 
			
		||||
@@ -547,7 +491,7 @@ test:   tests
 | 
			
		||||
 | 
			
		||||
tests: rehash
 | 
			
		||||
	@(cd test && echo "testing..." && \
 | 
			
		||||
	$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' 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}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' OPENSSL_DEBUG_MEMORY=on 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:
 | 
			
		||||
@@ -558,7 +502,7 @@ depend:
 | 
			
		||||
	do \
 | 
			
		||||
	if [ -d "$$i" ]; then \
 | 
			
		||||
		(cd $$i && echo "making dependencies $$i..." && \
 | 
			
		||||
		$(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ) || exit 1; \
 | 
			
		||||
		$(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' depend ) || exit 1; \
 | 
			
		||||
	fi; \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
@@ -603,26 +547,20 @@ TABLE: Configure
 | 
			
		||||
 | 
			
		||||
update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
 | 
			
		||||
 | 
			
		||||
# Build distribution tar-file. As the list of files returned by "find" is
 | 
			
		||||
# pretty long, on several platforms a "too many arguments" error or similar
 | 
			
		||||
# would occur. Therefore the list of files is temporarily stored into a file
 | 
			
		||||
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
 | 
			
		||||
# tar does not support the --files-from option.
 | 
			
		||||
tar:
 | 
			
		||||
	find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
 | 
			
		||||
	$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
 | 
			
		||||
	@$(TAR) $(TARFLAGS) -cvf - \
 | 
			
		||||
		`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort` |\
 | 
			
		||||
	tardy --user_number=0  --user_name=openssl \
 | 
			
		||||
	      --group_number=0 --group_name=openssl \
 | 
			
		||||
	      --prefix=openssl-$(VERSION) - |\
 | 
			
		||||
	gzip --best >../$(TARFILE).gz; \
 | 
			
		||||
	rm -f ../$(TARFILE).list; \
 | 
			
		||||
	ls -l ../$(TARFILE).gz
 | 
			
		||||
 | 
			
		||||
dist:   
 | 
			
		||||
	$(PERL) Configure dist
 | 
			
		||||
	@$(MAKE) dist_pem_h
 | 
			
		||||
	@$(MAKE) SDIRS='${SDIRS}' clean
 | 
			
		||||
	@$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
 | 
			
		||||
	@$(MAKE) tar
 | 
			
		||||
 | 
			
		||||
dist_pem_h:
 | 
			
		||||
	(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
 | 
			
		||||
@@ -654,25 +592,17 @@ install: all install_docs
 | 
			
		||||
			cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
 | 
			
		||||
			$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
 | 
			
		||||
			chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
 | 
			
		||||
		fi; \
 | 
			
		||||
		fi \
 | 
			
		||||
	done
 | 
			
		||||
	@if [ -n "$(SHARED_LIBS)" ]; then \
 | 
			
		||||
		tmp="$(SHARED_LIBS)"; \
 | 
			
		||||
		for i in $${tmp:-x}; \
 | 
			
		||||
		do \
 | 
			
		||||
			if [ -f "$$i" -o -f "$$i.a" ]; then \
 | 
			
		||||
			if [ -f "$$i" ]; then \
 | 
			
		||||
			(       echo installing $$i; \
 | 
			
		||||
				if [ "$(PLATFORM)" != "Cygwin" ]; then \
 | 
			
		||||
					cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
 | 
			
		||||
					chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
 | 
			
		||||
				else \
 | 
			
		||||
					c=`echo $$i | sed 's/^lib/cyg/'`; \
 | 
			
		||||
					cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
 | 
			
		||||
					chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
 | 
			
		||||
					cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
 | 
			
		||||
					chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
 | 
			
		||||
				fi ); \
 | 
			
		||||
			fi; \
 | 
			
		||||
				cp -f $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
 | 
			
		||||
				chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
 | 
			
		||||
			fi \
 | 
			
		||||
		done; \
 | 
			
		||||
		(	here="`pwd`"; \
 | 
			
		||||
			cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
 | 
			
		||||
@@ -689,20 +619,18 @@ install_docs:
 | 
			
		||||
		fn=`basename $$i .pod`; \
 | 
			
		||||
		if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
 | 
			
		||||
		echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
 | 
			
		||||
		(cd `$(PERL) util/dirname.pl $$i`; \
 | 
			
		||||
		sh -c "$(PERL) `cd ../../util; ./pod2mantest ignore` \
 | 
			
		||||
			--section=$$sec --center=OpenSSL \
 | 
			
		||||
			--release=$(VERSION) `basename $$i`") \
 | 
			
		||||
		(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
 | 
			
		||||
	@for i in doc/crypto/*.pod doc/ssl/*.pod; do \
 | 
			
		||||
		fn=`basename $$i .pod`; \
 | 
			
		||||
		if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
 | 
			
		||||
		echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
 | 
			
		||||
		(cd `$(PERL) util/dirname.pl $$i`; \
 | 
			
		||||
		sh -c "$(PERL) `cd ../../util; ./pod2mantest ignore` \
 | 
			
		||||
			--section=$$sec --center=OpenSSL \
 | 
			
		||||
			--release=$(VERSION) `basename $$i`") \
 | 
			
		||||
		(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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								NEWS
									
									
									
									
									
								
							@@ -5,12 +5,7 @@
 | 
			
		||||
  This file gives a brief overview of the major changes between each OpenSSL
 | 
			
		||||
  release. For more details please read the CHANGES file.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
 | 
			
		||||
 | 
			
		||||
      o Various SSL/TLS library bugfixes.
 | 
			
		||||
      o Fix DH parameter generation for 'non-standard' generators.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
 | 
			
		||||
  Changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
 | 
			
		||||
 | 
			
		||||
      o Various SSL/TLS library bugfixes.
 | 
			
		||||
      o BIGNUM library fixes.
 | 
			
		||||
@@ -23,7 +18,7 @@
 | 
			
		||||
        Broadcom and Cryptographic Appliance's keyserver
 | 
			
		||||
        [in 0.9.6c-engine release].
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
 | 
			
		||||
  Changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
 | 
			
		||||
 | 
			
		||||
      o Security fix: PRNG improvements.
 | 
			
		||||
      o Security fix: RSA OAEP check.
 | 
			
		||||
@@ -56,7 +51,7 @@
 | 
			
		||||
      o Bug fixes for Win32, HP/UX and Irix.
 | 
			
		||||
      o Bug fixes in BIGNUM, SSL, PKCS#7, PKCS#12, X.509, CONF and
 | 
			
		||||
        memory checking routines.
 | 
			
		||||
      o Bug fixes for RSA operations in threaded environments.
 | 
			
		||||
      o Bug fixes for RSA operations in threaded enviroments.
 | 
			
		||||
      o Bug fixes in misc. openssl applications.
 | 
			
		||||
      o Remove a few potential memory leaks.
 | 
			
		||||
      o Add tighter checks of BIGNUM routines.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										34
									
								
								PROBLEMS
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								PROBLEMS
									
									
									
									
									
								
							@@ -1,34 +0,0 @@
 | 
			
		||||
* System libcrypto.dylib and libssl.dylib are used by system ld on MacOS X.
 | 
			
		||||
[NOTE: This is currently undergoing tests, and may be removed soon]
 | 
			
		||||
 | 
			
		||||
This is really a misfeature in ld, which seems to look for .dylib libraries
 | 
			
		||||
along the whole library path before it bothers looking for .a libraries.  This
 | 
			
		||||
means that -L switches won't matter unless OpenSSL is built with shared
 | 
			
		||||
library support.
 | 
			
		||||
 | 
			
		||||
The workaround may be to change the following lines in apps/Makefile.ssl and
 | 
			
		||||
test/Makefile.ssl:
 | 
			
		||||
 | 
			
		||||
  LIBCRYPTO=-L.. -lcrypto
 | 
			
		||||
  LIBSSL=-L.. -lssl
 | 
			
		||||
 | 
			
		||||
to:
 | 
			
		||||
 | 
			
		||||
  LIBCRYPTO=../libcrypto.a
 | 
			
		||||
  LIBSSL=../libssl.a
 | 
			
		||||
 | 
			
		||||
It's possible that something similar is needed for shared library support
 | 
			
		||||
as well.  That hasn't been well tested yet.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Another solution that many seem to recommend is to move the libraries
 | 
			
		||||
/usr/lib/libcrypto.0.9.dylib, /usr/lib/libssl.0.9.dylib to a different
 | 
			
		||||
directory, build and install OpenSSL and anything that depends on your
 | 
			
		||||
build, then move libcrypto.0.9.dylib and libssl.0.9.dylib back to their
 | 
			
		||||
original places.  Note that the version numbers on those two libraries
 | 
			
		||||
may differ on your machine.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
As long as Apple doesn't fix the problem with ld, this problem building
 | 
			
		||||
OpenSSL will remain as is.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										21
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								README
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 0.9.6e [engine] 30 July 2002
 | 
			
		||||
 OpenSSL 0.9.6c 21 dec 2001
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2002 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1998-2001 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 | 
			
		||||
@@ -122,13 +122,6 @@
 | 
			
		||||
 lists the functions; you will probably have to look at the code to work out
 | 
			
		||||
 how to use them. Look at the example programs.
 | 
			
		||||
 | 
			
		||||
 PROBLEMS
 | 
			
		||||
 --------
 | 
			
		||||
 | 
			
		||||
 For some platforms, there are some known problems that may affect the user
 | 
			
		||||
 or application author.  We try to collect those in doc/PROBLEMS, with current
 | 
			
		||||
 thoughts on how they should be solved in a future of OpenSSL.
 | 
			
		||||
 | 
			
		||||
 SUPPORT 
 | 
			
		||||
 -------
 | 
			
		||||
 | 
			
		||||
@@ -153,13 +146,11 @@
 | 
			
		||||
    - Problem Description (steps that will reproduce the problem, if known)
 | 
			
		||||
    - Stack Traceback (if the application dumps core)
 | 
			
		||||
 | 
			
		||||
 Report the bug to the OpenSSL project via the Request Tracker
 | 
			
		||||
 (http://www.openssl.org/rt2.html) by mail to:
 | 
			
		||||
 Report the bug to the OpenSSL project at:
 | 
			
		||||
 | 
			
		||||
    openssl-bugs@openssl.org
 | 
			
		||||
 | 
			
		||||
 Note that mail to openssl-bugs@openssl.org is recorded in the publicly
 | 
			
		||||
 readable request tracker database and is forwarded to a public
 | 
			
		||||
 Note that mail to openssl-bugs@openssl.org is forwarded to a public
 | 
			
		||||
 mailing list. Confidential mail may be sent to openssl-security@openssl.org
 | 
			
		||||
 (PGP key available from the key servers).
 | 
			
		||||
 | 
			
		||||
@@ -173,9 +164,7 @@
 | 
			
		||||
 textual explanation of what your patch does.
 | 
			
		||||
 | 
			
		||||
 Note: For legal reasons, contributions from the US can be accepted only
 | 
			
		||||
 if a TSA notification and a copy of the patch is sent to crypt@bis.doc.gov;
 | 
			
		||||
 see http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
 | 
			
		||||
 and http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e)).
 | 
			
		||||
 if a copy of the patch is sent to crypt@bxa.doc.gov
 | 
			
		||||
 | 
			
		||||
 The preferred format for changes is "diff -u" output. You might
 | 
			
		||||
 generate it like this:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								STATUS
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								STATUS
									
									
									
									
									
								
							@@ -1,13 +1,10 @@
 | 
			
		||||
 | 
			
		||||
  OpenSSL STATUS                           Last modified at
 | 
			
		||||
  ______________                           $Date: 2002/07/30 10:38:17 $
 | 
			
		||||
  ______________                           $Date: 2001/11/14 21:21:04 $
 | 
			
		||||
 | 
			
		||||
  DEVELOPMENT STATE
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL 0.9.7:  Under development...
 | 
			
		||||
    o  OpenSSL 0.9.6e: Released on July      30th, 2002
 | 
			
		||||
    o  OpenSSL 0.9.6d: Released on May        9th, 2002
 | 
			
		||||
    o  OpenSSL 0.9.6c: Released on December  21st, 2001
 | 
			
		||||
    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
 | 
			
		||||
@@ -50,6 +47,10 @@
 | 
			
		||||
 | 
			
		||||
    o  apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL_0_9_6-stable:
 | 
			
		||||
       #include <openssl/e_os.h> in exported header files is illegal since
 | 
			
		||||
       e_os.h is suitable only for library-internal use.
 | 
			
		||||
 | 
			
		||||
    o  Whenever strncpy is used, make sure the resulting string is NULL-terminated
 | 
			
		||||
       or an error is reported
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										22
									
								
								apps/apps.c
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								apps/apps.c
									
									
									
									
									
								
							@@ -170,8 +170,6 @@ int str2fmt(char *s)
 | 
			
		||||
		|| (strcmp(s,"PKCS12") == 0) || (strcmp(s,"pkcs12") == 0)
 | 
			
		||||
		|| (strcmp(s,"P12") == 0) || (strcmp(s,"p12") == 0))
 | 
			
		||||
		return(FORMAT_PKCS12);
 | 
			
		||||
	else if ((*s == 'E') || (*s == 'e'))
 | 
			
		||||
		return(FORMAT_ENGINE);
 | 
			
		||||
	else
 | 
			
		||||
		return(FORMAT_UNDEF);
 | 
			
		||||
	}
 | 
			
		||||
@@ -230,16 +228,9 @@ void program_name(char *in, char *out, int size)
 | 
			
		||||
 | 
			
		||||
	q=strrchr(p,'.');
 | 
			
		||||
	if (q == NULL)
 | 
			
		||||
		q = p + strlen(p);
 | 
			
		||||
	strncpy(out,p,size-1);
 | 
			
		||||
	if (q-p >= size)
 | 
			
		||||
		{
 | 
			
		||||
		out[size-1]='\0';
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		out[q-p]='\0';
 | 
			
		||||
		}
 | 
			
		||||
		q = in+size;
 | 
			
		||||
	strncpy(out,p,q-p);
 | 
			
		||||
	out[q-p]='\0';
 | 
			
		||||
	}
 | 
			
		||||
#else
 | 
			
		||||
void program_name(char *in, char *out, int size)
 | 
			
		||||
@@ -764,7 +755,7 @@ int set_name_ex(unsigned long *flags, const char *arg)
 | 
			
		||||
 | 
			
		||||
void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
 | 
			
		||||
{
 | 
			
		||||
	char *buf;
 | 
			
		||||
	char buf[256];
 | 
			
		||||
	char mline = 0;
 | 
			
		||||
	int indent = 0;
 | 
			
		||||
	if(title) BIO_puts(out, title);
 | 
			
		||||
@@ -773,10 +764,9 @@ void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags)
 | 
			
		||||
		indent = 4;
 | 
			
		||||
	}
 | 
			
		||||
	if(lflags == XN_FLAG_COMPAT) {
 | 
			
		||||
		buf = X509_NAME_oneline(nm, 0, 0);
 | 
			
		||||
		BIO_puts(out, buf);
 | 
			
		||||
		X509_NAME_oneline(nm,buf,256);
 | 
			
		||||
		BIO_puts(out,buf);
 | 
			
		||||
		BIO_puts(out, "\n");
 | 
			
		||||
		OPENSSL_free(buf);
 | 
			
		||||
	} else {
 | 
			
		||||
		if(mline) BIO_puts(out, "\n");
 | 
			
		||||
		X509_NAME_print_ex(out, nm, indent, lflags);
 | 
			
		||||
 
 | 
			
		||||
@@ -162,8 +162,6 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format);
 | 
			
		||||
#define FORMAT_NETSCAPE 4
 | 
			
		||||
#define FORMAT_PKCS12   5
 | 
			
		||||
#define FORMAT_SMIME    6
 | 
			
		||||
/* Since this is currently inofficial, let's give it a high number */
 | 
			
		||||
#define FORMAT_ENGINE   127
 | 
			
		||||
 | 
			
		||||
#define NETSCAPE_CERT_HDR	"certificate"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -181,7 +181,7 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err,"where options are\n");
 | 
			
		||||
		BIO_printf(bio_err," -inform arg   input format - one of DER TXT PEM\n");
 | 
			
		||||
		BIO_printf(bio_err," -in arg       input file\n");
 | 
			
		||||
		BIO_printf(bio_err," -out arg      output file (output format is always DER\n");
 | 
			
		||||
		BIO_printf(bio_err," -out arg      output file\n");
 | 
			
		||||
		BIO_printf(bio_err," -noout arg    don't produce any output\n");
 | 
			
		||||
		BIO_printf(bio_err," -offset arg   offset into file\n");
 | 
			
		||||
		BIO_printf(bio_err," -length arg   length of section in file\n");
 | 
			
		||||
@@ -192,6 +192,7 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -strparse offset\n");
 | 
			
		||||
		BIO_printf(bio_err,"               a series of these can be used to 'dig' into multiple\n");
 | 
			
		||||
		BIO_printf(bio_err,"               ASN1 blob wrappings\n");
 | 
			
		||||
		BIO_printf(bio_err," -out filename output DER encoding to file\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								apps/ca.c
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								apps/ca.c
									
									
									
									
									
								
							@@ -74,7 +74,6 @@
 | 
			
		||||
#include <openssl/x509v3.h>
 | 
			
		||||
#include <openssl/objects.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#ifndef W_OK
 | 
			
		||||
#  ifdef VMS
 | 
			
		||||
@@ -83,7 +82,7 @@
 | 
			
		||||
#    else
 | 
			
		||||
#      include <unixlib.h>
 | 
			
		||||
#    endif
 | 
			
		||||
#  elif !defined(VXWORKS)
 | 
			
		||||
#  else
 | 
			
		||||
#    include <sys/file.h>
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
@@ -168,7 +167,6 @@ static char *ca_usage[]={
 | 
			
		||||
" -revoke file    - Revoke a certificate (given in file)\n",
 | 
			
		||||
" -extensions ..  - Extension section (override value in config file)\n",
 | 
			
		||||
" -crlexts ..     - CRL extension section (override value in config file)\n",
 | 
			
		||||
" -engine e       - use engine e, possibly a hardware device.\n",
 | 
			
		||||
NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -218,7 +216,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	char *key=NULL,*passargin=NULL;
 | 
			
		||||
	int total=0;
 | 
			
		||||
	int total_done=0;
 | 
			
		||||
@@ -271,7 +268,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#define BSIZE 256
 | 
			
		||||
	MS_STATIC char buf[3][BSIZE];
 | 
			
		||||
	char *randfile=NULL;
 | 
			
		||||
	char *engine = NULL;
 | 
			
		||||
 | 
			
		||||
#ifdef EFENCE
 | 
			
		||||
EF_PROTECT_FREE=1;
 | 
			
		||||
@@ -423,11 +419,6 @@ EF_ALIGNMENT=0;
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			crl_ext= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
bad:
 | 
			
		||||
@@ -448,24 +439,6 @@ bad:
 | 
			
		||||
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/*****************************************************************/
 | 
			
		||||
	if (configfile == NULL) configfile = getenv("OPENSSL_CONF");
 | 
			
		||||
	if (configfile == NULL) configfile = getenv("SSLEAY_CONF");
 | 
			
		||||
@@ -1135,7 +1108,7 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
		if ((crldays == 0) && (crlhours == 0))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"cannot lookup how long until the next CRL is issued\n");
 | 
			
		||||
			BIO_printf(bio_err,"cannot lookup how long until the next CRL is issuer\n");
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								apps/dgst.c
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								apps/dgst.c
									
									
									
									
									
								
							@@ -66,7 +66,6 @@
 | 
			
		||||
#include <openssl/objects.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef BUFSIZE
 | 
			
		||||
#define BUFSIZE	1024*8
 | 
			
		||||
@@ -81,7 +80,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	unsigned char *buf=NULL;
 | 
			
		||||
	int i,err=0;
 | 
			
		||||
	const EVP_MD *md=NULL,*m;
 | 
			
		||||
@@ -89,8 +87,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	BIO *bmd=NULL;
 | 
			
		||||
	BIO *out = NULL;
 | 
			
		||||
	const char *name;
 | 
			
		||||
#define PROG_NAME_SIZE  39
 | 
			
		||||
	char pname[PROG_NAME_SIZE+1];
 | 
			
		||||
#define PROG_NAME_SIZE  16
 | 
			
		||||
	char pname[PROG_NAME_SIZE];
 | 
			
		||||
	int separator=0;
 | 
			
		||||
	int debug=0;
 | 
			
		||||
	const char *outfile = NULL, *keyfile = NULL;
 | 
			
		||||
@@ -99,7 +97,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	EVP_PKEY *sigkey = NULL;
 | 
			
		||||
	unsigned char *sigbuf = NULL;
 | 
			
		||||
	int siglen = 0;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -157,11 +154,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) break;
 | 
			
		||||
			sigfile=*(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) break;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-hex") == 0)
 | 
			
		||||
			out_bin = 0;
 | 
			
		||||
		else if (strcmp(*argv,"-binary") == 0)
 | 
			
		||||
@@ -198,7 +190,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf(bio_err,"-prverify file  verify a signature using private key in file\n");
 | 
			
		||||
		BIO_printf(bio_err,"-signature file signature to verify\n");
 | 
			
		||||
		BIO_printf(bio_err,"-binary         output in binary form\n");
 | 
			
		||||
		BIO_printf(bio_err,"-engine e       use engine e, possibly a hardware device.\n");
 | 
			
		||||
 | 
			
		||||
		BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
 | 
			
		||||
			LN_md5,LN_md5);
 | 
			
		||||
@@ -218,24 +209,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	in=BIO_new(BIO_s_file());
 | 
			
		||||
	bmd=BIO_new(BIO_f_md());
 | 
			
		||||
	if (debug)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								apps/dh.c
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								apps/dh.c
									
									
									
									
									
								
							@@ -69,7 +69,6 @@
 | 
			
		||||
#include <openssl/dh.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	dh_main
 | 
			
		||||
@@ -88,12 +87,11 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	DH *dh=NULL;
 | 
			
		||||
	int i,badops=0,text=0;
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
	int informat,outformat,check=0,noout=0,C=0,ret=1;
 | 
			
		||||
	char *infile,*outfile,*prog,*engine;
 | 
			
		||||
	char *infile,*outfile,*prog;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -101,7 +99,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		if ((bio_err=BIO_new(BIO_s_file())) != NULL)
 | 
			
		||||
			BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
 | 
			
		||||
 | 
			
		||||
	engine=NULL;
 | 
			
		||||
	infile=NULL;
 | 
			
		||||
	outfile=NULL;
 | 
			
		||||
	informat=FORMAT_PEM;
 | 
			
		||||
@@ -132,11 +129,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			outfile= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-check") == 0)
 | 
			
		||||
			check=1;
 | 
			
		||||
		else if (strcmp(*argv,"-text") == 0)
 | 
			
		||||
@@ -168,30 +160,11 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -text         print a text form of the DH parameters\n");
 | 
			
		||||
		BIO_printf(bio_err," -C            Output C code\n");
 | 
			
		||||
		BIO_printf(bio_err," -noout        no output\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e     use engine e, possibly a hardware device.\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	in=BIO_new(BIO_s_file());
 | 
			
		||||
	out=BIO_new(BIO_s_file());
 | 
			
		||||
	if ((in == NULL) || (out == NULL))
 | 
			
		||||
 
 | 
			
		||||
@@ -121,7 +121,6 @@
 | 
			
		||||
#include <openssl/dh.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#ifndef NO_DSA
 | 
			
		||||
#include <openssl/dsa.h>
 | 
			
		||||
@@ -149,7 +148,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	DH *dh=NULL;
 | 
			
		||||
	int i,badops=0,text=0;
 | 
			
		||||
#ifndef NO_DSA
 | 
			
		||||
@@ -158,7 +156,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
	int informat,outformat,check=0,noout=0,C=0,ret=1;
 | 
			
		||||
	char *infile,*outfile,*prog;
 | 
			
		||||
	char *inrand=NULL,*engine=NULL;
 | 
			
		||||
	char *inrand=NULL;
 | 
			
		||||
	int num = 0, g = 0;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
@@ -197,11 +195,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			outfile= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-check") == 0)
 | 
			
		||||
			check=1;
 | 
			
		||||
		else if (strcmp(*argv,"-text") == 0)
 | 
			
		||||
@@ -247,7 +240,6 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -2            generate parameters using  2 as the generator value\n");
 | 
			
		||||
		BIO_printf(bio_err," -5            generate parameters using  5 as the generator value\n");
 | 
			
		||||
		BIO_printf(bio_err," numbits       number of bits in to generate (default 512)\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e     use engine e, possibly a hardware device.\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");
 | 
			
		||||
@@ -257,24 +249,6 @@ bad:
 | 
			
		||||
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (g && !num)
 | 
			
		||||
		num = DEFBITS;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								apps/dsa.c
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								apps/dsa.c
									
									
									
									
									
								
							@@ -68,7 +68,6 @@
 | 
			
		||||
#include <openssl/evp.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	dsa_main
 | 
			
		||||
@@ -88,7 +87,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	DSA *dsa=NULL;
 | 
			
		||||
	int i,badops=0;
 | 
			
		||||
@@ -96,7 +94,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
	int informat,outformat,text=0,noout=0;
 | 
			
		||||
	int pubin = 0, pubout = 0;
 | 
			
		||||
	char *infile,*outfile,*prog,*engine;
 | 
			
		||||
	char *infile,*outfile,*prog;
 | 
			
		||||
	char *passargin = NULL, *passargout = NULL;
 | 
			
		||||
	char *passin = NULL, *passout = NULL;
 | 
			
		||||
	int modulus=0;
 | 
			
		||||
@@ -107,7 +105,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		if ((bio_err=BIO_new(BIO_s_file())) != NULL)
 | 
			
		||||
			BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
 | 
			
		||||
 | 
			
		||||
	engine=NULL;
 | 
			
		||||
	infile=NULL;
 | 
			
		||||
	outfile=NULL;
 | 
			
		||||
	informat=FORMAT_PEM;
 | 
			
		||||
@@ -148,11 +145,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			passargout= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-noout") == 0)
 | 
			
		||||
			noout=1;
 | 
			
		||||
		else if (strcmp(*argv,"-text") == 0)
 | 
			
		||||
@@ -184,7 +176,6 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -passin arg     input file pass phrase source\n");
 | 
			
		||||
		BIO_printf(bio_err," -out arg        output file\n");
 | 
			
		||||
		BIO_printf(bio_err," -passout arg    output file pass phrase source\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e       use engine e, possibly a hardware device.\n");
 | 
			
		||||
		BIO_printf(bio_err," -des            encrypt PEM output with cbc des\n");
 | 
			
		||||
		BIO_printf(bio_err," -des3           encrypt PEM output with ede cbc des using 168 bit key\n");
 | 
			
		||||
#ifndef NO_IDEA
 | 
			
		||||
@@ -198,24 +189,6 @@ bad:
 | 
			
		||||
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
 | 
			
		||||
		BIO_printf(bio_err, "Error getting passwords\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
 
 | 
			
		||||
@@ -176,7 +176,7 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -outform arg  output format - DER or PEM\n");
 | 
			
		||||
		BIO_printf(bio_err," -in arg       input file\n");
 | 
			
		||||
		BIO_printf(bio_err," -out arg      output file\n");
 | 
			
		||||
		BIO_printf(bio_err," -text         print as text\n");
 | 
			
		||||
		BIO_printf(bio_err," -text         print the key in text\n");
 | 
			
		||||
		BIO_printf(bio_err," -C            Output C code\n");
 | 
			
		||||
		BIO_printf(bio_err," -noout        no output\n");
 | 
			
		||||
		BIO_printf(bio_err," -rand         files to use for random number input\n");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								apps/enc.c
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								apps/enc.c
									
									
									
									
									
								
							@@ -70,7 +70,6 @@
 | 
			
		||||
#include <openssl/md5.h>
 | 
			
		||||
#endif
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
int set_hex(char *in,unsigned char *out,int size);
 | 
			
		||||
#undef SIZE
 | 
			
		||||
@@ -85,7 +84,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	static const char magic[]="Salted__";
 | 
			
		||||
	char mbuf[8];	/* should be 1 smaller than magic */
 | 
			
		||||
	char *strbuf=NULL;
 | 
			
		||||
@@ -101,9 +99,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	const EVP_CIPHER *cipher=NULL,*c;
 | 
			
		||||
	char *inf=NULL,*outf=NULL;
 | 
			
		||||
	BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
 | 
			
		||||
#define PROG_NAME_SIZE  39
 | 
			
		||||
	char pname[PROG_NAME_SIZE+1];
 | 
			
		||||
	char *engine = NULL;
 | 
			
		||||
#define PROG_NAME_SIZE  16
 | 
			
		||||
	char pname[PROG_NAME_SIZE];
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -144,11 +141,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			passarg= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if	(strcmp(*argv,"-d") == 0)
 | 
			
		||||
			enc=0;
 | 
			
		||||
		else if	(strcmp(*argv,"-p") == 0)
 | 
			
		||||
@@ -249,7 +241,6 @@ bad:
 | 
			
		||||
			BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv");
 | 
			
		||||
			BIO_printf(bio_err,"%-14s print the iv/key (then exit if -P)\n","-[pP]");
 | 
			
		||||
			BIO_printf(bio_err,"%-14s buffer size\n","-bufsize <n>");
 | 
			
		||||
			BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
 | 
			
		||||
 | 
			
		||||
			BIO_printf(bio_err,"Cipher Types\n");
 | 
			
		||||
			BIO_printf(bio_err,"des     : 56 bit key DES encryption\n");
 | 
			
		||||
@@ -323,24 +314,6 @@ bad:
 | 
			
		||||
		argv++;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (bufsize != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		unsigned long n;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										33
									
								
								apps/gendh.c
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								apps/gendh.c
									
									
									
									
									
								
							@@ -70,7 +70,6 @@
 | 
			
		||||
#include <openssl/dh.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#define DEFBITS	512
 | 
			
		||||
#undef PROG
 | 
			
		||||
@@ -82,13 +81,11 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	DH *dh=NULL;
 | 
			
		||||
	int ret=1,num=DEFBITS;
 | 
			
		||||
	int g=2;
 | 
			
		||||
	char *outfile=NULL;
 | 
			
		||||
	char *inrand=NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
	BIO *out=NULL;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
@@ -113,11 +110,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			g=3; */
 | 
			
		||||
		else if (strcmp(*argv,"-5") == 0)
 | 
			
		||||
			g=5;
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-rand") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -133,34 +125,15 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
bad:
 | 
			
		||||
		BIO_printf(bio_err,"usage: gendh [args] [numbits]\n");
 | 
			
		||||
		BIO_printf(bio_err," -out file - output the key to 'file\n");
 | 
			
		||||
		BIO_printf(bio_err," -2        - use 2 as the generator value\n");
 | 
			
		||||
	/*	BIO_printf(bio_err," -3        - use 3 as the generator value\n"); */
 | 
			
		||||
		BIO_printf(bio_err," -5        - use 5 as the generator value\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
 | 
			
		||||
		BIO_printf(bio_err," -2    use 2 as the generator value\n");
 | 
			
		||||
	/*	BIO_printf(bio_err," -3    use 3 as the generator value\n"); */
 | 
			
		||||
		BIO_printf(bio_err," -5    use 5 as the generator value\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");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	out=BIO_new(BIO_s_file());
 | 
			
		||||
	if (out == NULL)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,6 @@
 | 
			
		||||
#include <openssl/dsa.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#define DEFBITS	512
 | 
			
		||||
#undef PROG
 | 
			
		||||
@@ -78,7 +77,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	DSA *dsa=NULL;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	char *outfile=NULL;
 | 
			
		||||
@@ -86,7 +84,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	char *passargout = NULL, *passout = NULL;
 | 
			
		||||
	BIO *out=NULL,*in=NULL;
 | 
			
		||||
	EVP_CIPHER *enc=NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -109,11 +106,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			passargout= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-rand") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -153,7 +145,6 @@ bad:
 | 
			
		||||
#ifndef NO_IDEA
 | 
			
		||||
		BIO_printf(bio_err," -idea     - encrypt the generated key with IDEA in cbc mode\n");
 | 
			
		||||
#endif
 | 
			
		||||
		BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\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");
 | 
			
		||||
@@ -162,24 +153,6 @@ bad:
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
 | 
			
		||||
		BIO_printf(bio_err, "Error getting password\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,6 @@
 | 
			
		||||
#include <openssl/evp.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#define DEFBITS	512
 | 
			
		||||
#undef PROG
 | 
			
		||||
@@ -81,7 +80,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	RSA *rsa=NULL;
 | 
			
		||||
	int i,num=DEFBITS;
 | 
			
		||||
@@ -90,7 +88,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	unsigned long f4=RSA_F4;
 | 
			
		||||
	char *outfile=NULL;
 | 
			
		||||
	char *passargout = NULL, *passout = NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
	char *inrand=NULL;
 | 
			
		||||
	BIO *out=NULL;
 | 
			
		||||
 | 
			
		||||
@@ -119,11 +116,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			f4=3;
 | 
			
		||||
		else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
 | 
			
		||||
			f4=RSA_F4;
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-rand") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -162,7 +154,6 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -passout arg    output file pass phrase source\n");
 | 
			
		||||
		BIO_printf(bio_err," -f4             use F4 (0x10001) for the E value\n");
 | 
			
		||||
		BIO_printf(bio_err," -3              use 3 for the E value\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e       use engine e, possibly a hardware device.\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");
 | 
			
		||||
@@ -176,24 +167,6 @@ bad:
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (outfile == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_set_fp(out,stdout,BIO_NOCLOSE);
 | 
			
		||||
@@ -213,8 +186,7 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
 | 
			
		||||
		&& !RAND_status())
 | 
			
		||||
	if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -88,8 +88,8 @@ BIO *bio_err=NULL;
 | 
			
		||||
int main(int Argc, char *Argv[])
 | 
			
		||||
	{
 | 
			
		||||
	ARGS arg;
 | 
			
		||||
#define PROG_NAME_SIZE	39
 | 
			
		||||
	char pname[PROG_NAME_SIZE+1];
 | 
			
		||||
#define PROG_NAME_SIZE	16
 | 
			
		||||
	char pname[PROG_NAME_SIZE];
 | 
			
		||||
	FUNCTION f,*fp;
 | 
			
		||||
	MS_STATIC char *prompt,buf[1024],config_name[256];
 | 
			
		||||
	int n,i,ret=0;
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,6 @@
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/pkcs12.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#define PROG pkcs12_main
 | 
			
		||||
 | 
			
		||||
@@ -93,7 +92,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    ENGINE *e = NULL;
 | 
			
		||||
    char *infile=NULL, *outfile=NULL, *keyname = NULL;	
 | 
			
		||||
    char *certfile=NULL;
 | 
			
		||||
    BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL;
 | 
			
		||||
@@ -120,7 +118,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    char *passin = NULL, *passout = NULL;
 | 
			
		||||
    char *inrand = NULL;
 | 
			
		||||
    char *CApath = NULL, *CAfile = NULL;
 | 
			
		||||
    char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
    apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -239,11 +236,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			args++;	
 | 
			
		||||
			CAfile = *args;
 | 
			
		||||
		    } else badarg = 1;
 | 
			
		||||
		} else if (!strcmp(*args,"-engine")) {
 | 
			
		||||
		    if (args[1]) {
 | 
			
		||||
			args++;	
 | 
			
		||||
			engine = *args;
 | 
			
		||||
		    } else badarg = 1;
 | 
			
		||||
		} else badarg = 1;
 | 
			
		||||
 | 
			
		||||
	} else badarg = 1;
 | 
			
		||||
@@ -287,27 +279,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	BIO_printf (bio_err, "-password p   set import/export password source\n");
 | 
			
		||||
	BIO_printf (bio_err, "-passin p     input file pass phrase source\n");
 | 
			
		||||
	BIO_printf (bio_err, "-passout p    output file pass phrase source\n");
 | 
			
		||||
	BIO_printf (bio_err, "-engine e     use engine e, possibly a hardware device.\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");
 | 
			
		||||
    	goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (engine != NULL) {
 | 
			
		||||
	if((e = ENGINE_by_id(engine)) == NULL) {
 | 
			
		||||
	    BIO_printf(bio_err,"invalid engine \"%s\"\n", engine);
 | 
			
		||||
	    goto end;
 | 
			
		||||
	}
 | 
			
		||||
	if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
 | 
			
		||||
	    BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
	    goto end;
 | 
			
		||||
	}
 | 
			
		||||
	BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
	/* Free our "structural" reference. */
 | 
			
		||||
	ENGINE_free(e);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if(passarg) {
 | 
			
		||||
	if(export_cert) passargout = passarg;
 | 
			
		||||
	else passargin = passarg;
 | 
			
		||||
@@ -772,10 +749,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
 | 
			
		||||
		print_attribs (out, bag->attrib, "Bag Attributes");
 | 
			
		||||
		if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen)))
 | 
			
		||||
				return 0;
 | 
			
		||||
		if (!(pkey = EVP_PKCS82PKEY (p8))) {
 | 
			
		||||
			PKCS8_PRIV_KEY_INFO_free(p8);
 | 
			
		||||
			return 0;
 | 
			
		||||
		}
 | 
			
		||||
		if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
 | 
			
		||||
		print_attribs (out, p8->attributes, "Key Attributes");
 | 
			
		||||
		PKCS8_PRIV_KEY_INFO_free(p8);
 | 
			
		||||
		PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								apps/pkcs7.c
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								apps/pkcs7.c
									
									
									
									
									
								
							@@ -67,7 +67,6 @@
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pkcs7.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	pkcs7_main
 | 
			
		||||
@@ -83,15 +82,13 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	PKCS7 *p7=NULL;
 | 
			
		||||
	int i,badops=0;
 | 
			
		||||
	BIO *in=NULL,*out=NULL;
 | 
			
		||||
	int informat,outformat;
 | 
			
		||||
	char *infile,*outfile,*prog;
 | 
			
		||||
	int print_certs=0,text=0,noout=0;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -135,11 +132,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			text=1;
 | 
			
		||||
		else if (strcmp(*argv,"-print_certs") == 0)
 | 
			
		||||
			print_certs=1;
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"unknown option %s\n",*argv);
 | 
			
		||||
@@ -162,30 +154,11 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -print_certs  print any certs or crl in the input\n");
 | 
			
		||||
		BIO_printf(bio_err," -text         print full details of certificates\n");
 | 
			
		||||
		BIO_printf(bio_err," -noout        don't output encoded data\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e     use engine e, possibly a hardware device.\n");
 | 
			
		||||
		EXIT(1);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	in=BIO_new(BIO_s_file());
 | 
			
		||||
	out=BIO_new(BIO_s_file());
 | 
			
		||||
	if ((in == NULL) || (out == NULL))
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								apps/pkcs8.c
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								apps/pkcs8.c
									
									
									
									
									
								
							@@ -62,7 +62,6 @@
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/evp.h>
 | 
			
		||||
#include <openssl/pkcs12.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#include "apps.h"
 | 
			
		||||
#define PROG pkcs8_main
 | 
			
		||||
@@ -71,7 +70,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	char **args, *infile = NULL, *outfile = NULL;
 | 
			
		||||
	char *passargin = NULL, *passargout = NULL;
 | 
			
		||||
	BIO *in = NULL, *out = NULL;
 | 
			
		||||
@@ -87,13 +85,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	EVP_PKEY *pkey;
 | 
			
		||||
	char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
 | 
			
		||||
	int badarg = 0;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
 | 
			
		||||
 | 
			
		||||
	informat=FORMAT_PEM;
 | 
			
		||||
	outformat=FORMAT_PEM;
 | 
			
		||||
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
	OpenSSL_add_all_algorithms();
 | 
			
		||||
	args = argv + 1;
 | 
			
		||||
@@ -144,11 +138,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (!args[1]) goto bad;
 | 
			
		||||
			passargout= *(++args);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*args,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (!args[1]) goto bad;
 | 
			
		||||
			engine= *(++args);
 | 
			
		||||
			}
 | 
			
		||||
		else if (!strcmp (*args, "-in")) {
 | 
			
		||||
			if (args[1]) {
 | 
			
		||||
				args++;
 | 
			
		||||
@@ -181,28 +170,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf(bio_err, "-nocrypt        use or expect unencrypted private key\n");
 | 
			
		||||
		BIO_printf(bio_err, "-v2 alg         use PKCS#5 v2.0 and cipher \"alg\"\n");
 | 
			
		||||
		BIO_printf(bio_err, "-v1 obj         use PKCS#5 v1.5 and cipher \"alg\"\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e       use engine e, possibly a hardware device.\n");
 | 
			
		||||
		return (1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			return (1);
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			return (1);
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
 | 
			
		||||
		BIO_printf(bio_err, "Error getting passwords\n");
 | 
			
		||||
		return (1);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										35
									
								
								apps/rand.c
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								apps/rand.c
									
									
									
									
									
								
							@@ -9,7 +9,6 @@
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG rand_main
 | 
			
		||||
@@ -24,7 +23,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	int i, r, ret = 1;
 | 
			
		||||
	int badopt;
 | 
			
		||||
	char *outfile = NULL;
 | 
			
		||||
@@ -32,7 +30,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int base64 = 0;
 | 
			
		||||
	BIO *out = NULL;
 | 
			
		||||
	int num = -1;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -51,13 +48,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			else
 | 
			
		||||
				badopt = 1;
 | 
			
		||||
			}
 | 
			
		||||
		if (strcmp(argv[i], "-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if ((argv[i+1] != NULL) && (engine == NULL))
 | 
			
		||||
				engine = argv[++i];
 | 
			
		||||
			else
 | 
			
		||||
				badopt = 1;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(argv[i], "-rand") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if ((argv[i+1] != NULL) && (inrand == NULL))
 | 
			
		||||
@@ -94,31 +84,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err, "Usage: rand [options] num\n");
 | 
			
		||||
		BIO_printf(bio_err, "where options are\n");
 | 
			
		||||
		BIO_printf(bio_err, "-out file             - write to file\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e             - use engine e, possibly a hardware device.\n");
 | 
			
		||||
		BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
 | 
			
		||||
		BIO_printf(bio_err, "-base64               - encode output\n");
 | 
			
		||||
		BIO_printf(bio_err, "-out file            - write to file\n");
 | 
			
		||||
		BIO_printf(bio_err, "-rand file%cfile%c...  - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
 | 
			
		||||
		BIO_printf(bio_err, "-base64              - encode output\n");
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	app_RAND_load_file(NULL, bio_err, (inrand != NULL));
 | 
			
		||||
	if (inrand != NULL)
 | 
			
		||||
		BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										83
									
								
								apps/req.c
									
									
									
									
									
								
							
							
						
						
									
										83
									
								
								apps/req.c
									
									
									
									
									
								
							@@ -73,7 +73,6 @@
 | 
			
		||||
#include <openssl/x509v3.h>
 | 
			
		||||
#include <openssl/objects.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#define SECTION		"req"
 | 
			
		||||
 | 
			
		||||
@@ -141,7 +140,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
#ifndef NO_DSA
 | 
			
		||||
	DSA *dsa_params=NULL;
 | 
			
		||||
#endif
 | 
			
		||||
@@ -154,7 +152,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
 | 
			
		||||
	int nodes=0,kludge=0,newhdr=0;
 | 
			
		||||
	char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
	char *extensions = NULL;
 | 
			
		||||
	char *req_exts = NULL;
 | 
			
		||||
	EVP_CIPHER *cipher=NULL;
 | 
			
		||||
@@ -198,11 +195,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			outformat=str2fmt(*(++argv));
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-key") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -291,7 +283,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
						goto end;
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
					if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end;
 | 
			
		||||
					dtmp=X509_get_pubkey(xtmp);
 | 
			
		||||
					if (dtmp->type == EVP_PKEY_DSA)
 | 
			
		||||
						dsa_params=DSAparams_dup(dtmp->pkey.dsa);
 | 
			
		||||
					EVP_PKEY_free(dtmp);
 | 
			
		||||
@@ -383,7 +375,6 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -verify        verify signature on REQ\n");
 | 
			
		||||
		BIO_printf(bio_err," -modulus       RSA modulus\n");
 | 
			
		||||
		BIO_printf(bio_err," -nodes         don't encrypt the output key\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e      use engine e, possibly a hardware device.\n");
 | 
			
		||||
		BIO_printf(bio_err," -key file	use the private key contained in file\n");
 | 
			
		||||
		BIO_printf(bio_err," -keyform arg   key file format\n");
 | 
			
		||||
		BIO_printf(bio_err," -keyout arg    file to send the key to\n");
 | 
			
		||||
@@ -530,55 +521,24 @@ bad:
 | 
			
		||||
	if ((in == NULL) || (out == NULL))
 | 
			
		||||
		goto end;
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (keyfile != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if (keyform == FORMAT_ENGINE)
 | 
			
		||||
		if (BIO_read_filename(in,keyfile) <= 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (!e)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"no engine specified\n");
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			pkey = ENGINE_load_private_key(e, keyfile, NULL);
 | 
			
		||||
			perror(keyfile);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (keyform == FORMAT_ASN1)
 | 
			
		||||
			pkey=d2i_PrivateKey_bio(in,NULL);
 | 
			
		||||
		else if (keyform == FORMAT_PEM)
 | 
			
		||||
			{
 | 
			
		||||
			pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,passin);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			if (BIO_read_filename(in,keyfile) <= 0)
 | 
			
		||||
				{
 | 
			
		||||
				perror(keyfile);
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
			if (keyform == FORMAT_ASN1)
 | 
			
		||||
				pkey=d2i_PrivateKey_bio(in,NULL);
 | 
			
		||||
			else if (keyform == FORMAT_PEM)
 | 
			
		||||
				{
 | 
			
		||||
				pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,
 | 
			
		||||
					passin);
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"bad input format specified for X509 request\n");
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			BIO_printf(bio_err,"bad input format specified for X509 request\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (pkey == NULL)
 | 
			
		||||
@@ -758,14 +718,17 @@ loop:
 | 
			
		||||
 | 
			
		||||
			/* Set version to V3 */
 | 
			
		||||
			if(!X509_set_version(x509ss, 2)) goto end;
 | 
			
		||||
			if (!ASN1_INTEGER_set(X509_get_serialNumber(x509ss),0L)) goto end;
 | 
			
		||||
			ASN1_INTEGER_set(X509_get_serialNumber(x509ss),0L);
 | 
			
		||||
 | 
			
		||||
			if (!X509_set_issuer_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
 | 
			
		||||
			if (!X509_gmtime_adj(X509_get_notBefore(x509ss),0)) goto end;
 | 
			
		||||
			if (!X509_gmtime_adj(X509_get_notAfter(x509ss), (long)60*60*24*days)) goto end;
 | 
			
		||||
			if (!X509_set_subject_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
 | 
			
		||||
			X509_set_issuer_name(x509ss,
 | 
			
		||||
				X509_REQ_get_subject_name(req));
 | 
			
		||||
			X509_gmtime_adj(X509_get_notBefore(x509ss),0);
 | 
			
		||||
			X509_gmtime_adj(X509_get_notAfter(x509ss),
 | 
			
		||||
				(long)60*60*24*days);
 | 
			
		||||
			X509_set_subject_name(x509ss,
 | 
			
		||||
				X509_REQ_get_subject_name(req));
 | 
			
		||||
			tmppkey = X509_REQ_get_pubkey(req);
 | 
			
		||||
			if (!tmppkey || !X509_set_pubkey(x509ss,tmppkey)) goto end;
 | 
			
		||||
			X509_set_pubkey(x509ss,tmppkey);
 | 
			
		||||
			EVP_PKEY_free(tmppkey);
 | 
			
		||||
 | 
			
		||||
			/* Set up V3 context struct */
 | 
			
		||||
@@ -996,7 +959,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
 | 
			
		||||
	else i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs);
 | 
			
		||||
	if(!i) goto err;
 | 
			
		||||
 | 
			
		||||
	if (!X509_REQ_set_pubkey(req,pkey)) goto err;
 | 
			
		||||
	X509_REQ_set_pubkey(req,pkey);
 | 
			
		||||
 | 
			
		||||
	ret=1;
 | 
			
		||||
err:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								apps/rsa.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								apps/rsa.c
									
									
									
									
									
								
							@@ -68,7 +68,6 @@
 | 
			
		||||
#include <openssl/evp.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	rsa_main
 | 
			
		||||
@@ -91,7 +90,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *eng = NULL;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	RSA *rsa=NULL;
 | 
			
		||||
	int i,badops=0, sgckey=0;
 | 
			
		||||
@@ -102,7 +100,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	char *infile,*outfile,*prog;
 | 
			
		||||
	char *passargin = NULL, *passargout = NULL;
 | 
			
		||||
	char *passin = NULL, *passout = NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
	int modulus=0;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
@@ -151,11 +148,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			passargout= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-sgckey") == 0)
 | 
			
		||||
			sgckey=1;
 | 
			
		||||
		else if (strcmp(*argv,"-pubin") == 0)
 | 
			
		||||
@@ -203,30 +195,11 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -check          verify key consistency\n");
 | 
			
		||||
		BIO_printf(bio_err," -pubin          expect a public key in input file\n");
 | 
			
		||||
		BIO_printf(bio_err," -pubout         output a public key\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e       use engine e, possibly a hardware device.\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	ERR_load_crypto_strings();
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((eng = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(eng, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(eng);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
 | 
			
		||||
		BIO_printf(bio_err, "Error getting passwords\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,6 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#define RSA_SIGN 	1
 | 
			
		||||
#define RSA_VERIFY 	2
 | 
			
		||||
@@ -83,7 +82,6 @@ int MAIN(int argc, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	BIO *in = NULL, *out = NULL;
 | 
			
		||||
	char *infile = NULL, *outfile = NULL;
 | 
			
		||||
	char *keyfile = NULL;
 | 
			
		||||
@@ -97,7 +95,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
 | 
			
		||||
	int rsa_inlen, rsa_outlen = 0;
 | 
			
		||||
	int keysize;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	int ret = 1;
 | 
			
		||||
 | 
			
		||||
@@ -120,9 +117,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		} else if(!strcmp(*argv, "-inkey")) {
 | 
			
		||||
			if (--argc < 1) badarg = 1;
 | 
			
		||||
			keyfile = *(++argv);
 | 
			
		||||
		} else if(!strcmp(*argv, "-engine")) {
 | 
			
		||||
			if (--argc < 1) badarg = 1;
 | 
			
		||||
			engine = *(++argv);
 | 
			
		||||
		} else if(!strcmp(*argv, "-pubin")) {
 | 
			
		||||
			key_type = KEY_PUBKEY;
 | 
			
		||||
		} else if(!strcmp(*argv, "-certin")) {
 | 
			
		||||
@@ -157,24 +151,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		goto end;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
/* FIXME: seed PRNG only if needed */
 | 
			
		||||
	app_RAND_load_file(NULL, bio_err, 0);
 | 
			
		||||
	
 | 
			
		||||
@@ -304,7 +280,6 @@ static void usage()
 | 
			
		||||
	BIO_printf(bio_err, "-inkey file     input key\n");
 | 
			
		||||
	BIO_printf(bio_err, "-pubin          input is an RSA public\n");
 | 
			
		||||
	BIO_printf(bio_err, "-certin         input is a certificate carrying an RSA public key\n");
 | 
			
		||||
	BIO_printf(bio_err, "-engine e       use engine e, possibly a hardware device.\n");
 | 
			
		||||
	BIO_printf(bio_err, "-ssl            use SSL v2 padding\n");
 | 
			
		||||
	BIO_printf(bio_err, "-raw            use no padding\n");
 | 
			
		||||
	BIO_printf(bio_err, "-pkcs           use PKCS#1 v1.5 padding (default)\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,6 @@ typedef unsigned int u_int;
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
#include "s_apps.h"
 | 
			
		||||
 | 
			
		||||
#ifdef WINDOWS
 | 
			
		||||
@@ -155,7 +154,7 @@ static void sc_usage(void)
 | 
			
		||||
	BIO_printf(bio_err," -cipher       - preferred cipher to use, use the 'openssl ciphers'\n");
 | 
			
		||||
	BIO_printf(bio_err,"                 command to see what is available\n");
 | 
			
		||||
	BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
 | 
			
		||||
	BIO_printf(bio_err," -engine id    - Initialise and use the specified engine\n");
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int MAIN(int, char **);
 | 
			
		||||
@@ -183,8 +182,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	SSL_METHOD *meth=NULL;
 | 
			
		||||
	BIO *sbio;
 | 
			
		||||
	char *inrand=NULL;
 | 
			
		||||
	char *engine_id=NULL;
 | 
			
		||||
	ENGINE *e=NULL;
 | 
			
		||||
#ifdef WINDOWS
 | 
			
		||||
	struct timeval tv;
 | 
			
		||||
#endif
 | 
			
		||||
@@ -327,11 +324,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			inrand= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if	(strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine_id = *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"unknown option %s\n",*argv);
 | 
			
		||||
@@ -372,30 +364,6 @@ bad:
 | 
			
		||||
 | 
			
		||||
	OpenSSL_add_ssl_algorithms();
 | 
			
		||||
	SSL_load_error_strings();
 | 
			
		||||
 | 
			
		||||
	if (engine_id != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine_id)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine\n");
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if (c_debug)
 | 
			
		||||
			{
 | 
			
		||||
			ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
 | 
			
		||||
				0, bio_err, 0);
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine_id);
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	ctx=SSL_CTX_new(meth);
 | 
			
		||||
	if (ctx == NULL)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,6 @@ typedef unsigned int u_int;
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/ssl.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
#include "s_apps.h"
 | 
			
		||||
 | 
			
		||||
#ifdef WINDOWS
 | 
			
		||||
@@ -178,7 +177,6 @@ static int s_debug=0;
 | 
			
		||||
static int s_quiet=0;
 | 
			
		||||
 | 
			
		||||
static int hack=0;
 | 
			
		||||
static char *engine_id=NULL;
 | 
			
		||||
 | 
			
		||||
#ifdef MONOLITH
 | 
			
		||||
static void s_server_init(void)
 | 
			
		||||
@@ -201,7 +199,6 @@ static void s_server_init(void)
 | 
			
		||||
	s_debug=0;
 | 
			
		||||
	s_quiet=0;
 | 
			
		||||
	hack=0;
 | 
			
		||||
	engine_id=NULL;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -247,7 +244,6 @@ static void sv_usage(void)
 | 
			
		||||
	BIO_printf(bio_err," -www          - Respond to a 'GET /' with a status page\n");
 | 
			
		||||
	BIO_printf(bio_err," -WWW          - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
 | 
			
		||||
	BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
 | 
			
		||||
	BIO_printf(bio_err," -engine id    - Initialise and use the specified engine\n");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int local_argc=0;
 | 
			
		||||
@@ -418,8 +414,6 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
	int state=0;
 | 
			
		||||
	SSL_METHOD *meth=NULL;
 | 
			
		||||
	char *inrand=NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
	ENGINE *e=NULL;
 | 
			
		||||
#ifndef NO_DH
 | 
			
		||||
	DH *dh=NULL;
 | 
			
		||||
#endif
 | 
			
		||||
@@ -579,11 +573,6 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			inrand= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine = *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"unknown option %s\n",*argv);
 | 
			
		||||
@@ -635,29 +624,6 @@ bad:
 | 
			
		||||
	SSL_load_error_strings();
 | 
			
		||||
	OpenSSL_add_ssl_algorithms();
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine\n");
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if (s_debug)
 | 
			
		||||
			{
 | 
			
		||||
			ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
 | 
			
		||||
				0, bio_err, 0);
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	ctx=SSL_CTX_new(meth);
 | 
			
		||||
	if (ctx == NULL)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,7 @@
 | 
			
		||||
#include "wintext.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC)) || defined (_DARWIN)
 | 
			
		||||
#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
 | 
			
		||||
#define TIMES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -102,7 +102,7 @@
 | 
			
		||||
#undef TIMES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(TIMES) && !defined(VXWORKS)
 | 
			
		||||
#ifndef TIMES
 | 
			
		||||
#include <sys/timeb.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -139,8 +139,6 @@
 | 
			
		||||
#undef BUFSIZZ
 | 
			
		||||
#define BUFSIZZ 1024*10
 | 
			
		||||
 | 
			
		||||
#undef min
 | 
			
		||||
#undef max
 | 
			
		||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
 | 
			
		||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
 | 
			
		||||
 | 
			
		||||
@@ -370,22 +368,6 @@ static double tm_Time_F(int s)
 | 
			
		||||
		ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
 | 
			
		||||
		return((ret == 0.0)?1e-6:ret);
 | 
			
		||||
	}
 | 
			
		||||
#elif defined(VXWORKS)
 | 
			
		||||
        {
 | 
			
		||||
	static unsigned long tick_start, tick_end;
 | 
			
		||||
 | 
			
		||||
	if( s == START )
 | 
			
		||||
		{
 | 
			
		||||
		tick_start = tickGet();
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		tick_end = tickGet();
 | 
			
		||||
		ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
 | 
			
		||||
		return((ret == 0.0)?1e-6:ret);
 | 
			
		||||
		}
 | 
			
		||||
        }
 | 
			
		||||
#else /* !times() */
 | 
			
		||||
	static struct timeb tstart,tend;
 | 
			
		||||
	long i;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										38
									
								
								apps/smime.c
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								apps/smime.c
									
									
									
									
									
								
							@@ -64,7 +64,6 @@
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG smime_main
 | 
			
		||||
@@ -82,7 +81,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	int operation = 0;
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
	char **args;
 | 
			
		||||
@@ -105,9 +103,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	char *inrand = NULL;
 | 
			
		||||
	int need_rand = 0;
 | 
			
		||||
	int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	args = argv + 1;
 | 
			
		||||
 | 
			
		||||
	ret = 1;
 | 
			
		||||
 | 
			
		||||
	while (!badarg && *args && *args[0] == '-') {
 | 
			
		||||
@@ -156,11 +153,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				inrand = *args;
 | 
			
		||||
			} else badarg = 1;
 | 
			
		||||
			need_rand = 1;
 | 
			
		||||
		} else if (!strcmp(*args,"-engine")) {
 | 
			
		||||
			if (args[1]) {
 | 
			
		||||
				args++;
 | 
			
		||||
				engine = *args;
 | 
			
		||||
			} else badarg = 1;
 | 
			
		||||
		} else if (!strcmp(*args,"-passin")) {
 | 
			
		||||
			if (args[1]) {
 | 
			
		||||
				args++;
 | 
			
		||||
@@ -298,7 +290,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf (bio_err, "-text          include or delete text MIME headers\n");
 | 
			
		||||
		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");
 | 
			
		||||
@@ -307,24 +298,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		goto end;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
 | 
			
		||||
		BIO_printf(bio_err, "Error getting password\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
@@ -441,10 +414,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		p7 = PKCS7_encrypt(encerts, in, cipher, flags);
 | 
			
		||||
	} else if(operation == SMIME_SIGN) {
 | 
			
		||||
		p7 = PKCS7_sign(signer, key, other, in, flags);
 | 
			
		||||
		if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) {
 | 
			
		||||
		  BIO_printf(bio_err, "Can't rewind input file\n");
 | 
			
		||||
		  goto end;
 | 
			
		||||
		}
 | 
			
		||||
		BIO_reset(in);
 | 
			
		||||
	} else {
 | 
			
		||||
		if(informat == FORMAT_SMIME) 
 | 
			
		||||
			p7 = SMIME_read_PKCS7(in, &indata);
 | 
			
		||||
@@ -484,9 +454,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	} else if(operation == SMIME_VERIFY) {
 | 
			
		||||
		STACK_OF(X509) *signers;
 | 
			
		||||
		if(PKCS7_verify(p7, other, store, indata, out, flags)) {
 | 
			
		||||
			BIO_printf(bio_err, "Verification successful\n");
 | 
			
		||||
			BIO_printf(bio_err, "Verification Successful\n");
 | 
			
		||||
		} else {
 | 
			
		||||
			BIO_printf(bio_err, "Verification failure\n");
 | 
			
		||||
			BIO_printf(bio_err, "Verification Failure\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
		signers = PKCS7_get0_signers(p7, other, flags);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										72
									
								
								apps/speed.c
									
									
									
									
									
								
							
							
						
						
									
										72
									
								
								apps/speed.c
									
									
									
									
									
								
							@@ -81,14 +81,13 @@
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(_DARWIN)
 | 
			
		||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 | 
			
		||||
# define USE_TOD
 | 
			
		||||
#elif !defined(MSDOS) && !defined(VXWORKS) && (!defined(VMS) || defined(__DECC))
 | 
			
		||||
#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) && !defined(__NetBSD__) && !defined(_DARWIN) && !defined(VXWORKS)
 | 
			
		||||
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__NetBSD__)
 | 
			
		||||
# define TIMEB
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -116,7 +115,7 @@
 | 
			
		||||
#include <sys/timeb.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(VXWORKS)
 | 
			
		||||
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD)
 | 
			
		||||
#error "It seems neither struct tms nor struct timeb is supported in this platform!"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -225,7 +224,7 @@ static double Time_F(int s, int usertime)
 | 
			
		||||
 | 
			
		||||
#ifdef USE_TOD
 | 
			
		||||
	if(usertime)
 | 
			
		||||
		{
 | 
			
		||||
	    {
 | 
			
		||||
		static struct rusage tstart,tend;
 | 
			
		||||
 | 
			
		||||
		if (s == START)
 | 
			
		||||
@@ -285,23 +284,7 @@ static double Time_F(int s, int usertime)
 | 
			
		||||
# if defined(TIMES) && defined(TIMEB)
 | 
			
		||||
	else
 | 
			
		||||
# endif
 | 
			
		||||
# ifdef VXWORKS
 | 
			
		||||
		{
 | 
			
		||||
		static unsigned long tick_start, tick_end;
 | 
			
		||||
 | 
			
		||||
		if( s == START )
 | 
			
		||||
			{
 | 
			
		||||
			tick_start = tickGet();
 | 
			
		||||
			return 0;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			tick_end = tickGet();
 | 
			
		||||
			ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
 | 
			
		||||
			return((ret < 0.001)?0.001:ret);
 | 
			
		||||
			}
 | 
			
		||||
                }
 | 
			
		||||
# elif defined(TIMEB)
 | 
			
		||||
# ifdef TIMEB
 | 
			
		||||
		{
 | 
			
		||||
		static struct timeb tstart,tend;
 | 
			
		||||
		long i;
 | 
			
		||||
@@ -320,7 +303,6 @@ static double Time_F(int s, int usertime)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -328,7 +310,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e;
 | 
			
		||||
	unsigned char *buf=NULL,*buf2=NULL;
 | 
			
		||||
	int mret=1;
 | 
			
		||||
#define ALGOR_NUM	15
 | 
			
		||||
@@ -337,9 +318,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#define DSA_NUM		3
 | 
			
		||||
	long count,rsa_count;
 | 
			
		||||
	int i,j,k;
 | 
			
		||||
#ifndef NO_RSA
 | 
			
		||||
	unsigned rsa_num;
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef NO_MD2
 | 
			
		||||
	unsigned char md2[MD2_DIGEST_LENGTH];
 | 
			
		||||
#endif
 | 
			
		||||
@@ -491,37 +470,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		{
 | 
			
		||||
		if	((argc > 0) && (strcmp(*argv,"-elapsed") == 0))
 | 
			
		||||
			usertime = 0;
 | 
			
		||||
		else
 | 
			
		||||
		if	((argc > 0) && (strcmp(*argv,"-engine") == 0))
 | 
			
		||||
			{
 | 
			
		||||
			argc--;
 | 
			
		||||
			argv++;
 | 
			
		||||
			if(argc == 0)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"no engine given\n");
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			if((e = ENGINE_by_id(*argv)) == NULL)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
					*argv);
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			BIO_printf(bio_err,"engine \"%s\" set.\n", *argv);
 | 
			
		||||
			/* Free our "structural" reference. */
 | 
			
		||||
			ENGINE_free(e);
 | 
			
		||||
			/* It will be increased again further down.  We just
 | 
			
		||||
			   don't want speed to confuse an engine with an
 | 
			
		||||
			   algorithm, especially when none is given (which
 | 
			
		||||
			   means all of them should be run) */
 | 
			
		||||
			j--;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
#ifndef NO_MD2
 | 
			
		||||
		if	(strcmp(*argv,"md2") == 0) doit[D_MD2]=1;
 | 
			
		||||
		else
 | 
			
		||||
@@ -569,7 +517,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifdef RSAref
 | 
			
		||||
			if (strcmp(*argv,"rsaref") == 0) 
 | 
			
		||||
			{
 | 
			
		||||
			RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
 | 
			
		||||
			RSA_set_default_method(RSA_PKCS1_RSAref());
 | 
			
		||||
			j--;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
@@ -577,7 +525,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#ifndef RSA_NULL
 | 
			
		||||
			if (strcmp(*argv,"openssl") == 0) 
 | 
			
		||||
			{
 | 
			
		||||
			RSA_set_default_openssl_method(RSA_PKCS1_SSLeay());
 | 
			
		||||
			RSA_set_default_method(RSA_PKCS1_SSLeay());
 | 
			
		||||
			j--;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
@@ -722,12 +670,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			BIO_printf(bio_err,"\n");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef TIMES
 | 
			
		||||
			BIO_printf(bio_err,"\n");
 | 
			
		||||
			BIO_printf(bio_err,"Available options:\n");
 | 
			
		||||
#ifdef TIMES
 | 
			
		||||
			BIO_printf(bio_err,"-elapsed        measure time in real time instead of CPU user time.\n");
 | 
			
		||||
#endif
 | 
			
		||||
			BIO_printf(bio_err,"-engine e       use engine e, possibly a hardware device.\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		argc--;
 | 
			
		||||
@@ -1434,7 +1381,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#endif
 | 
			
		||||
	mret=0;
 | 
			
		||||
end:
 | 
			
		||||
	ERR_print_errors(bio_err);
 | 
			
		||||
	if (buf != NULL) OPENSSL_free(buf);
 | 
			
		||||
	if (buf2 != NULL) OPENSSL_free(buf2);
 | 
			
		||||
#ifndef NO_RSA
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								apps/spkac.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								apps/spkac.c
									
									
									
									
									
								
							@@ -69,7 +69,6 @@
 | 
			
		||||
#include <openssl/lhash.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	spkac_main
 | 
			
		||||
@@ -82,7 +81,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	int i,badops=0, ret = 1;
 | 
			
		||||
	BIO *in = NULL,*out = NULL, *key = NULL;
 | 
			
		||||
	int verify=0,noout=0,pubkey=0;
 | 
			
		||||
@@ -93,7 +91,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	LHASH *conf = NULL;
 | 
			
		||||
	NETSCAPE_SPKI *spki = NULL;
 | 
			
		||||
	EVP_PKEY *pkey = NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -139,11 +136,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			spksect= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-noout") == 0)
 | 
			
		||||
			noout=1;
 | 
			
		||||
		else if (strcmp(*argv,"-pubkey") == 0)
 | 
			
		||||
@@ -169,7 +161,6 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err," -noout         don't print SPKAC\n");
 | 
			
		||||
		BIO_printf(bio_err," -pubkey        output public key\n");
 | 
			
		||||
		BIO_printf(bio_err," -verify        verify SPKAC signature\n");
 | 
			
		||||
		BIO_printf(bio_err," -engine e      use engine e, possibly a hardware device.\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -179,24 +170,6 @@ bad:
 | 
			
		||||
		goto end;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(keyfile) {
 | 
			
		||||
		if(strcmp(keyfile, "-")) key = BIO_new_file(keyfile, "r");
 | 
			
		||||
		else key = BIO_new_fp(stdin, BIO_NOCLOSE);
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,6 @@
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/x509v3.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG	verify_main
 | 
			
		||||
@@ -79,7 +78,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	int i,ret=1;
 | 
			
		||||
	int purpose = -1;
 | 
			
		||||
	char *CApath=NULL,*CAfile=NULL;
 | 
			
		||||
@@ -87,7 +85,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
 | 
			
		||||
	X509_STORE *cert_ctx=NULL;
 | 
			
		||||
	X509_LOOKUP *lookup=NULL;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	cert_ctx=X509_STORE_new();
 | 
			
		||||
	if (cert_ctx == NULL) goto end;
 | 
			
		||||
@@ -140,11 +137,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
				if (argc-- < 1) goto end;
 | 
			
		||||
				trustfile= *(++argv);
 | 
			
		||||
				}
 | 
			
		||||
			else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
				{
 | 
			
		||||
				if (--argc < 1) goto end;
 | 
			
		||||
				engine= *(++argv);
 | 
			
		||||
				}
 | 
			
		||||
			else if (strcmp(*argv,"-help") == 0)
 | 
			
		||||
				goto end;
 | 
			
		||||
			else if (strcmp(*argv,"-issuer_checks") == 0)
 | 
			
		||||
@@ -162,24 +154,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
 | 
			
		||||
	if (lookup == NULL) abort();
 | 
			
		||||
	if (CAfile) {
 | 
			
		||||
@@ -227,7 +201,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	ret=0;
 | 
			
		||||
end:
 | 
			
		||||
	if (ret == 1) {
 | 
			
		||||
		BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-engine e] cert1 cert2 ...\n");
 | 
			
		||||
		BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] cert1 cert2 ...\n");
 | 
			
		||||
		BIO_printf(bio_err,"recognized usages:\n");
 | 
			
		||||
		for(i = 0; i < X509_PURPOSE_get_count(); i++) {
 | 
			
		||||
			X509_PURPOSE *ptmp;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								apps/x509.c
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								apps/x509.c
									
									
									
									
									
								
							@@ -73,7 +73,6 @@
 | 
			
		||||
#include <openssl/x509v3.h>
 | 
			
		||||
#include <openssl/objects.h>
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG x509_main
 | 
			
		||||
@@ -130,7 +129,6 @@ static char *x509_usage[]={
 | 
			
		||||
" -extensions     - section from config file with X509V3 extensions to add\n",
 | 
			
		||||
" -clrext         - delete extensions before signing and input certificate\n",
 | 
			
		||||
" -nameopt arg    - various certificate name options\n",
 | 
			
		||||
" -engine e       - use engine e, possibly a hardware device.\n",
 | 
			
		||||
NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -147,7 +145,6 @@ int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	int ret=1;
 | 
			
		||||
	X509_REQ *req=NULL;
 | 
			
		||||
	X509 *x=NULL,*xca=NULL;
 | 
			
		||||
@@ -178,7 +175,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int need_rand = 0;
 | 
			
		||||
	int checkend=0,checkoffset=0;
 | 
			
		||||
	unsigned long nmflag = 0;
 | 
			
		||||
	char *engine=NULL;
 | 
			
		||||
 | 
			
		||||
	reqfile=0;
 | 
			
		||||
 | 
			
		||||
@@ -237,7 +233,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		else if (strcmp(*argv,"-CAkeyform") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			CAkeyformat=str2fmt(*(++argv));
 | 
			
		||||
			CAformat=str2fmt(*(++argv));
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-days") == 0)
 | 
			
		||||
			{
 | 
			
		||||
@@ -341,11 +337,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			alias= *(++argv);
 | 
			
		||||
			trustout = 1;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-engine") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			engine= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-C") == 0)
 | 
			
		||||
			C= ++num;
 | 
			
		||||
		else if (strcmp(*argv,"-email") == 0)
 | 
			
		||||
@@ -429,24 +420,6 @@ bad:
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (engine != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if((e = ENGINE_by_id(engine)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"invalid engine \"%s\"\n",
 | 
			
		||||
				engine);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"can't use that engine\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
 | 
			
		||||
		/* Free our "structural" reference. */
 | 
			
		||||
		ENGINE_free(e);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (need_rand)
 | 
			
		||||
		app_RAND_load_file(NULL, bio_err, 0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										106
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										106
									
								
								config
									
									
									
									
									
								
							@@ -299,24 +299,9 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    CYGWIN*)
 | 
			
		||||
	case "$RELEASE" in
 | 
			
		||||
	    [bB]*|1.0|1.[12].*)
 | 
			
		||||
		echo "${MACHINE}-whatever-cygwin_pre1.3"
 | 
			
		||||
		;;
 | 
			
		||||
	    *)
 | 
			
		||||
		echo "${MACHINE}-whatever-cygwin"
 | 
			
		||||
		;;
 | 
			
		||||
	esac
 | 
			
		||||
	exit 0
 | 
			
		||||
	echo "${MACHINE}-whatever-cygwin32"; exit 0
 | 
			
		||||
	;;
 | 
			
		||||
 | 
			
		||||
    *"CRAY T3E")
 | 
			
		||||
       echo "t3e-cray-unicosmk"; exit 0;
 | 
			
		||||
       ;;
 | 
			
		||||
 | 
			
		||||
    *CRAY*)
 | 
			
		||||
       echo "j90-cray-unicos"; exit 0;
 | 
			
		||||
       ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
@@ -381,29 +366,17 @@ done
 | 
			
		||||
 | 
			
		||||
# figure out if gcc is available and if so we use it otherwise
 | 
			
		||||
# we fallback to whatever cc does on the system
 | 
			
		||||
GCCVER=`(gcc -dumpversion) 2>/dev/null`
 | 
			
		||||
GCCVER=`(gcc --version) 2>/dev/null`
 | 
			
		||||
if [ "$GCCVER" != "" ]; then
 | 
			
		||||
  CC=gcc
 | 
			
		||||
  # Since gcc 3.1 gcc --version behaviour has changed.  gcc -dumpversion
 | 
			
		||||
  # does give us what we want though, so we use that.  We just just the
 | 
			
		||||
  # major and minor version numbers.
 | 
			
		||||
  # then strip off whatever prefix Cygnus prepends the number with...
 | 
			
		||||
  GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'`
 | 
			
		||||
  # peak single digit before and after first dot, e.g. 2.95.1 gives 29
 | 
			
		||||
  GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
 | 
			
		||||
else
 | 
			
		||||
  CC=cc
 | 
			
		||||
fi
 | 
			
		||||
if [ "$SYSTEM" = "HP-UX" ];then
 | 
			
		||||
  # By default gcc is a ILP32 compiler (with long long == 64).
 | 
			
		||||
  GCC_BITS="32"
 | 
			
		||||
  if [ $GCCVER -ge 30 ]; then
 | 
			
		||||
    # PA64 support only came in with gcc 3.0.x.
 | 
			
		||||
    # We look for the preprocessor symbol __LP64__ indicating
 | 
			
		||||
    # 64bit bit long and pointer.  sizeof(int) == 32 on HPUX64.
 | 
			
		||||
    if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
 | 
			
		||||
      GCC_BITS="64"
 | 
			
		||||
    fi
 | 
			
		||||
  fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ "$SYSTEM" = "SunOS" ]; then
 | 
			
		||||
  # check for WorkShop C, expected output is "cc: blah-blah C x.x"
 | 
			
		||||
  CCVER=`(cc -V 2>&1) 2>/dev/null | \
 | 
			
		||||
@@ -509,10 +482,6 @@ EOF
 | 
			
		||||
	${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
 | 
			
		||||
	rm dummy dummy.c
 | 
			
		||||
	;;
 | 
			
		||||
  ppc64-*-linux2)
 | 
			
		||||
	#Use the standard target for PPC architecture until we create a
 | 
			
		||||
	#special one for the 64bit architecture.
 | 
			
		||||
	OUT="linux-ppc" ;;
 | 
			
		||||
  ppc-*-linux2) OUT="linux-ppc" ;;
 | 
			
		||||
  m68k-*-linux*) OUT="linux-m68k" ;;
 | 
			
		||||
  ia64-*-linux?) OUT="linux-ia64" ;;
 | 
			
		||||
@@ -534,29 +503,8 @@ EOF
 | 
			
		||||
	sun4d)	OUT="linux-sparcv8" ;;
 | 
			
		||||
	*)	OUT="linux-sparcv7" ;;
 | 
			
		||||
	esac ;;
 | 
			
		||||
  parisc-*-linux2)
 | 
			
		||||
        CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
 | 
			
		||||
	CPUSCHEDULE=`awk '/^cpu.[ 	]: PA/{print substr($3,3)}' /proc/cpuinfo`
 | 
			
		||||
 | 
			
		||||
	# ??TODO ??  Model transformations
 | 
			
		||||
	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
 | 
			
		||||
	#    assuming no further arch. identification will ever be used by GCC.
 | 
			
		||||
	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
 | 
			
		||||
	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
 | 
			
		||||
	#    for these chips in the future.
 | 
			
		||||
	#         PA7300LC -> 7100LC (1.1)
 | 
			
		||||
	#         PA8200   -> 8000   (2.0)
 | 
			
		||||
	#         PA8500   -> 8000   (2.0)
 | 
			
		||||
	#         PA8600   -> 8000   (2.0)
 | 
			
		||||
 | 
			
		||||
	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
 | 
			
		||||
	# Finish Model transformations
 | 
			
		||||
 | 
			
		||||
	options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
 | 
			
		||||
	OUT="linux-parisc" ;;
 | 
			
		||||
  arm*-*-linux2) OUT="linux-elf-arm" ;;
 | 
			
		||||
  s390-*-linux2) OUT="linux-s390" ;;
 | 
			
		||||
  s390x-*-linux?) OUT="linux-s390x" ;;
 | 
			
		||||
  *-*-linux2) OUT="linux-elf" ;;
 | 
			
		||||
  *-*-linux1) OUT="linux-aout" ;;
 | 
			
		||||
  sun4u*-*-solaris2)
 | 
			
		||||
@@ -605,51 +553,23 @@ EOF
 | 
			
		||||
  BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
 | 
			
		||||
  RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
 | 
			
		||||
  *-siemens-sysv4) OUT="SINIX" ;;
 | 
			
		||||
  *-hpux1*)
 | 
			
		||||
	if [ $CC = "gcc" ];
 | 
			
		||||
	then
 | 
			
		||||
	  if [ $GCC_BITS = "64" ]; then
 | 
			
		||||
	    OUT="hpux64-parisc-gcc"
 | 
			
		||||
	  else
 | 
			
		||||
	    OUT="hpux-parisc-gcc"
 | 
			
		||||
	  fi
 | 
			
		||||
	else
 | 
			
		||||
	  OUT="hpux-parisc-$CC"
 | 
			
		||||
	fi
 | 
			
		||||
	options="$options -D_REENTRANT" ;;
 | 
			
		||||
  *-hpux1*)	OUT="hpux-parisc-$CC"
 | 
			
		||||
		options="$options -D_REENTRANT" ;;
 | 
			
		||||
  *-hpux)	OUT="hpux-parisc-$CC" ;;
 | 
			
		||||
  # these are all covered by the catchall below
 | 
			
		||||
  # *-aix) OUT="aix-$CC" ;;
 | 
			
		||||
  # *-dgux) OUT="dgux" ;;
 | 
			
		||||
  mips-sony-newsos4) OUT="newsos4-gcc" ;;
 | 
			
		||||
  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
 | 
			
		||||
  *-*-cygwin) OUT="Cygwin" ;;
 | 
			
		||||
  t3e-cray-unicosmk) OUT="cray-t3e" ;;
 | 
			
		||||
  j90-cray-unicos) OUT="cray-j90" ;;
 | 
			
		||||
  *-*-cygwin32) OUT="CygWin32"
 | 
			
		||||
		options="$options no-threads no-asm" ;;
 | 
			
		||||
  *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
# NB: This atalla support has been superceded by the ENGINE support
 | 
			
		||||
# That contains its own header and definitions anyway. Support can
 | 
			
		||||
# be enabled or disabled on any supported platform without external
 | 
			
		||||
# headers, eg. by adding the "hw-atalla" switch to ./config or
 | 
			
		||||
# perl Configure
 | 
			
		||||
#
 | 
			
		||||
# See whether we can compile Atalla support
 | 
			
		||||
#if [ -f /usr/include/atasi.h ]
 | 
			
		||||
#then
 | 
			
		||||
#  options="$options -DATALLA"
 | 
			
		||||
#fi
 | 
			
		||||
 | 
			
		||||
#get some basic shared lib support (behnke@trustcenter.de)
 | 
			
		||||
case "$OUT" in
 | 
			
		||||
   solaris-*-gcc)
 | 
			
		||||
	if  [ "$SHARED" = "true" ] 
 | 
			
		||||
	 then
 | 
			
		||||
	  options="$options -DPIC -fPIC"
 | 
			
		||||
        fi
 | 
			
		||||
     ;;
 | 
			
		||||
esac
 | 
			
		||||
if [ -f /usr/include/atasi.h ]
 | 
			
		||||
then
 | 
			
		||||
  options="$options -DATALLA"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# gcc < 2.8 does not support -mcpu=ultrasparc
 | 
			
		||||
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ DIR=		crypto
 | 
			
		||||
TOP=		..
 | 
			
		||||
CC=		cc
 | 
			
		||||
INCLUDE=	-I. -I../include
 | 
			
		||||
INCLUDES=	-I.. -I../.. -I../../include
 | 
			
		||||
INCLUDES=	-I.. -I../../include
 | 
			
		||||
CFLAG=		-g
 | 
			
		||||
INSTALL_PREFIX=
 | 
			
		||||
OPENSSLDIR=     /usr/local/ssl
 | 
			
		||||
@@ -27,7 +27,7 @@ LIBS=
 | 
			
		||||
 | 
			
		||||
SDIRS=	md2 md5 sha mdc2 hmac ripemd \
 | 
			
		||||
	des rc2 rc4 rc5 idea bf cast \
 | 
			
		||||
	bn rsa dsa dh dso engine \
 | 
			
		||||
	bn rsa dsa dh dso \
 | 
			
		||||
	buffer bio stack lhash rand err objects \
 | 
			
		||||
	evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
 | 
			
		||||
 | 
			
		||||
@@ -51,11 +51,11 @@ all: buildinf.h lib subdirs
 | 
			
		||||
 | 
			
		||||
buildinf.h: ../Makefile.ssl
 | 
			
		||||
	( echo "#ifndef MK1MF_BUILD"; \
 | 
			
		||||
	echo '  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */'; \
 | 
			
		||||
	echo '  #define CFLAGS "$(CC) $(CFLAG)"'; \
 | 
			
		||||
	echo '  #define PLATFORM "$(PLATFORM)"'; \
 | 
			
		||||
	echo "  #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
 | 
			
		||||
	echo '#endif' ) >buildinf.h
 | 
			
		||||
	echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
 | 
			
		||||
	echo "  #define CFLAGS \"$(CC) $(CFLAG)\""; \
 | 
			
		||||
	echo "  #define PLATFORM \"$(PLATFORM)\""; \
 | 
			
		||||
	echo "  #define DATE \"`date`\""; \
 | 
			
		||||
	echo "#endif" ) >buildinf.h
 | 
			
		||||
 | 
			
		||||
testapps:
 | 
			
		||||
	if echo ${SDIRS} | fgrep ' des '; \
 | 
			
		||||
@@ -134,7 +134,7 @@ depend:
 | 
			
		||||
	@for i in $(SDIRS) ;\
 | 
			
		||||
	do \
 | 
			
		||||
	(cd $$i; echo "making depend in crypto/$$i..."; \
 | 
			
		||||
	$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ); \
 | 
			
		||||
	$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
 | 
			
		||||
	done;
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
 
 | 
			
		||||
@@ -936,40 +936,40 @@ t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_bitst.o: ../cryptlib.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h
 | 
			
		||||
t_crl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
t_crl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
t_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h
 | 
			
		||||
t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
t_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
t_crl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
t_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
t_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
t_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_crl.o: ../cryptlib.h
 | 
			
		||||
t_crl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
t_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
t_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
 | 
			
		||||
t_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
t_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h
 | 
			
		||||
t_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 | 
			
		||||
t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
@@ -985,20 +985,20 @@ t_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h
 | 
			
		||||
t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
t_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
t_req.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
t_req.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
t_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_req.o: ../cryptlib.h
 | 
			
		||||
t_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
t_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
t_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
 | 
			
		||||
t_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
t_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h
 | 
			
		||||
t_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
 | 
			
		||||
t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
 | 
			
		||||
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
@@ -1024,20 +1024,20 @@ t_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
 | 
			
		||||
t_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.h
 | 
			
		||||
t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
t_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
t_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
t_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
 | 
			
		||||
t_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
t_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
t_x509.o: ../cryptlib.h
 | 
			
		||||
t_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
t_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
t_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
t_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
 | 
			
		||||
t_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
t_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
 | 
			
		||||
t_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
@@ -1310,20 +1310,21 @@ x_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
x_x509.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
 | 
			
		||||
x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
x_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
x_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
x_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
x_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
x_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
 | 
			
		||||
x_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
x_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
x_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
x_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
x_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h
 | 
			
		||||
x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
 | 
			
		||||
x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
x_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
x_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
 | 
			
		||||
x_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
x_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
x_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
 | 
			
		||||
x_x509.o: ../cryptlib.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
 | 
			
		||||
x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
 
 | 
			
		||||
@@ -89,6 +89,8 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
 | 
			
		||||
	if (a == NULL) return(0);
 | 
			
		||||
 | 
			
		||||
	len=a->length;
 | 
			
		||||
	ret=1+len;
 | 
			
		||||
	if (pp == NULL) return(ret);
 | 
			
		||||
 | 
			
		||||
	if (len > 0)
 | 
			
		||||
		{
 | 
			
		||||
@@ -116,10 +118,6 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		bits=0;
 | 
			
		||||
 | 
			
		||||
	ret=1+len;
 | 
			
		||||
	if (pp == NULL) return(ret);
 | 
			
		||||
 | 
			
		||||
	p= *pp;
 | 
			
		||||
 | 
			
		||||
	*(p++)=(unsigned char)bits;
 | 
			
		||||
@@ -226,7 +224,6 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
 | 
			
		||||
	w=n/8;
 | 
			
		||||
	v=1<<(7-(n&0x07));
 | 
			
		||||
	iv= ~v;
 | 
			
		||||
	if (!value) v=0;
 | 
			
		||||
 | 
			
		||||
	a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -205,18 +205,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
 | 
			
		||||
	else ret->type=V_ASN1_ENUMERATED;
 | 
			
		||||
	j=BN_num_bits(bn);
 | 
			
		||||
	len=((j == 0)?0:((j/8)+1));
 | 
			
		||||
	if (ret->length < len+4)
 | 
			
		||||
		{
 | 
			
		||||
		unsigned char *new_data=
 | 
			
		||||
			OPENSSL_realloc(ret->data, len+4);
 | 
			
		||||
		if (!new_data)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		ret->data=new_data;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	ret->data=(unsigned char *)OPENSSL_malloc(len+4);
 | 
			
		||||
	ret->length=BN_bn2bin(bn,ret->data);
 | 
			
		||||
	return(ret);
 | 
			
		||||
err:
 | 
			
		||||
 
 | 
			
		||||
@@ -203,7 +203,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
 | 
			
		||||
	if (s == NULL)
 | 
			
		||||
		return(NULL);
 | 
			
		||||
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && ! defined(_DARWIN)
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32)
 | 
			
		||||
	gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
 | 
			
		||||
	ts=&data;
 | 
			
		||||
#else
 | 
			
		||||
 
 | 
			
		||||
@@ -451,16 +451,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
 | 
			
		||||
	else ret->type=V_ASN1_INTEGER;
 | 
			
		||||
	j=BN_num_bits(bn);
 | 
			
		||||
	len=((j == 0)?0:((j/8)+1));
 | 
			
		||||
	if (ret->length < len+4)
 | 
			
		||||
		{
 | 
			
		||||
		unsigned char *new_data= OPENSSL_realloc(ret->data, len+4);
 | 
			
		||||
		if (!new_data)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		ret->data=new_data;
 | 
			
		||||
		}
 | 
			
		||||
	ret->data=(unsigned char *)OPENSSL_malloc(len+4);
 | 
			
		||||
	ret->length=BN_bn2bin(bn,ret->data);
 | 
			
		||||
	return(ret);
 | 
			
		||||
err:
 | 
			
		||||
 
 | 
			
		||||
@@ -116,7 +116,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
        pStart  = p; /* Catch the beg of Setblobs*/
 | 
			
		||||
        if (!(rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)))) return 0; /* In this array
 | 
			
		||||
        rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
 | 
			
		||||
we will store the SET blobs */
 | 
			
		||||
 | 
			
		||||
        for (i=0; i<sk_num(a); i++)
 | 
			
		||||
@@ -133,7 +133,7 @@ SetBlob
 | 
			
		||||
 /* Now we have to sort the blobs. I am using a simple algo.
 | 
			
		||||
    *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
 | 
			
		||||
        qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp);
 | 
			
		||||
        if (!(pTempMem = OPENSSL_malloc(totSize))) return 0;
 | 
			
		||||
        pTempMem = OPENSSL_malloc(totSize);
 | 
			
		||||
 | 
			
		||||
/* Copy to temp mem */
 | 
			
		||||
        p = pTempMem;
 | 
			
		||||
 
 | 
			
		||||
@@ -55,59 +55,6 @@
 | 
			
		||||
 * copied and put under another distribution licence
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1998-2002 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>
 | 
			
		||||
@@ -140,14 +87,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
 | 
			
		||||
		else
 | 
			
		||||
			a=algor2;
 | 
			
		||||
		if (a == NULL) continue;
 | 
			
		||||
                if (type->pkey_type == NID_dsaWithSHA1)
 | 
			
		||||
			{
 | 
			
		||||
			/* special case: RFC 2459 tells us to omit 'parameters'
 | 
			
		||||
			 * with id-dsa-with-sha1 */
 | 
			
		||||
			ASN1_TYPE_free(a->parameter);
 | 
			
		||||
			a->parameter = NULL;
 | 
			
		||||
			}
 | 
			
		||||
		else if ((a->parameter == NULL) || 
 | 
			
		||||
		if (	(a->parameter == NULL) || 
 | 
			
		||||
			(a->parameter->type != V_ASN1_NULL))
 | 
			
		||||
			{
 | 
			
		||||
			ASN1_TYPE_free(a->parameter);
 | 
			
		||||
 
 | 
			
		||||
@@ -113,7 +113,7 @@ ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length)
 | 
			
		||||
ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
 | 
			
		||||
	{
 | 
			
		||||
	struct tm *ts;
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
 | 
			
		||||
	struct tm data;
 | 
			
		||||
 | 
			
		||||
	gmtime_r(&t,&data);
 | 
			
		||||
 
 | 
			
		||||
@@ -203,7 +203,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
 | 
			
		||||
	if (s == NULL)
 | 
			
		||||
		return(NULL);
 | 
			
		||||
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
 | 
			
		||||
	gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
 | 
			
		||||
	ts=&data;
 | 
			
		||||
#else
 | 
			
		||||
@@ -270,9 +270,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
 | 
			
		||||
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
 | 
			
		||||
	{
 | 
			
		||||
	struct tm *tm;
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
 | 
			
		||||
	struct tm data;
 | 
			
		||||
#endif
 | 
			
		||||
	int offset;
 | 
			
		||||
	int year;
 | 
			
		||||
 | 
			
		||||
@@ -289,9 +286,8 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
 | 
			
		||||
 | 
			
		||||
	t -= offset*60; /* FIXME: may overflow in extreme cases */
 | 
			
		||||
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(_DARWIN)
 | 
			
		||||
	gmtime_r(&t, &data);
 | 
			
		||||
	tm = &data;
 | 
			
		||||
#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
 | 
			
		||||
	{ struct tm data; gmtime_r(&t, &data); tm = &data; }
 | 
			
		||||
#else
 | 
			
		||||
	tm = gmtime(&t);
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -124,13 +124,15 @@ int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
 | 
			
		||||
		(int)(omax+ *pp));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
	if (*plength > (omax - (*pp - p)))
 | 
			
		||||
#if 0
 | 
			
		||||
	if ((p+ *plength) > (omax+ *pp))
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG);
 | 
			
		||||
		/* Set this so that even if things are not long enough
 | 
			
		||||
		 * the values are set correctly */
 | 
			
		||||
		ret|=0x80;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	*pp=p;
 | 
			
		||||
	return(ret|inf);
 | 
			
		||||
err:
 | 
			
		||||
@@ -157,8 +159,6 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
 | 
			
		||||
		i= *p&0x7f;
 | 
			
		||||
		if (*(p++) & 0x80)
 | 
			
		||||
			{
 | 
			
		||||
			if (i > sizeof(long))
 | 
			
		||||
				return 0;
 | 
			
		||||
			if (max-- == 0) return(0);
 | 
			
		||||
			while (i-- > 0)
 | 
			
		||||
				{
 | 
			
		||||
@@ -170,8 +170,6 @@ static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max)
 | 
			
		||||
		else
 | 
			
		||||
			ret=i;
 | 
			
		||||
		}
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
		return 0;
 | 
			
		||||
	*pp=p;
 | 
			
		||||
	*rl=ret;
 | 
			
		||||
	return(1);
 | 
			
		||||
@@ -409,7 +407,7 @@ int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b)
 | 
			
		||||
 | 
			
		||||
void asn1_add_error(unsigned char *address, int offset)
 | 
			
		||||
	{
 | 
			
		||||
	char buf1[DECIMAL_SIZE(address)+1],buf2[DECIMAL_SIZE(offset)+1];
 | 
			
		||||
	char buf1[16],buf2[16];
 | 
			
		||||
 | 
			
		||||
	sprintf(buf1,"%lu",(unsigned long)address);
 | 
			
		||||
	sprintf(buf2,"%d",offset);
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,6 @@ DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	M_ASN1_BIT_STRING_free(bs);
 | 
			
		||||
	bs = NULL;
 | 
			
		||||
 | 
			
		||||
	M_ASN1_D2I_Finish_2(a);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,6 @@ DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length)
 | 
			
		||||
	if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn;
 | 
			
		||||
 | 
			
		||||
	M_ASN1_BIT_STRING_free(bs);
 | 
			
		||||
	bs = NULL;
 | 
			
		||||
 | 
			
		||||
	M_ASN1_D2I_Finish_2(a);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -108,7 +108,6 @@ RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
 | 
			
		||||
		goto err_bn;
 | 
			
		||||
 | 
			
		||||
	M_ASN1_INTEGER_free(bs);
 | 
			
		||||
	bs = NULL;
 | 
			
		||||
 | 
			
		||||
	M_ASN1_D2I_Finish_2(a);
 | 
			
		||||
err_bn:
 | 
			
		||||
 
 | 
			
		||||
@@ -96,34 +96,10 @@ int RSA_print(BIO *bp, RSA *x, int off)
 | 
			
		||||
	char str[128];
 | 
			
		||||
	const char *s;
 | 
			
		||||
	unsigned char *m=NULL;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	size_t buf_len=0, i;
 | 
			
		||||
	int i,ret=0;
 | 
			
		||||
 | 
			
		||||
	if (x->n)
 | 
			
		||||
		buf_len = (size_t)BN_num_bytes(x->n);
 | 
			
		||||
	if (x->e)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->e)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->d)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->d)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->p)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->p)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->q)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->q)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->dmp1)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->dmp1)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->dmq1)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->dmq1)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->iqmp)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->iqmp)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc(buf_len+10);
 | 
			
		||||
	i=RSA_size(x);
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
 | 
			
		||||
	if (m == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		RSAerr(RSA_F_RSA_PRINT,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
@@ -185,25 +161,22 @@ int DSA_print(BIO *bp, DSA *x, int off)
 | 
			
		||||
	{
 | 
			
		||||
	char str[128];
 | 
			
		||||
	unsigned char *m=NULL;
 | 
			
		||||
	int ret=0;
 | 
			
		||||
	size_t buf_len=0,i;
 | 
			
		||||
	int i,ret=0;
 | 
			
		||||
	BIGNUM *bn=NULL;
 | 
			
		||||
 | 
			
		||||
	if (x->p)
 | 
			
		||||
		buf_len = (size_t)BN_num_bytes(x->p);
 | 
			
		||||
	if (x->q)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->q)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->g)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->g)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->priv_key)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->priv_key)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->pub_key)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->pub_key)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->p != NULL)
 | 
			
		||||
		bn=x->p;
 | 
			
		||||
	else if (x->priv_key != NULL)
 | 
			
		||||
		bn=x->priv_key;
 | 
			
		||||
	else if (x->pub_key != NULL)
 | 
			
		||||
		bn=x->pub_key;
 | 
			
		||||
		
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc(buf_len+10);
 | 
			
		||||
	/* larger than needed but what the hell :-) */
 | 
			
		||||
	if (bn != NULL)
 | 
			
		||||
		i=BN_num_bytes(bn)*2;
 | 
			
		||||
	else
 | 
			
		||||
		i=256;
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
 | 
			
		||||
	if (m == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		DSAerr(DSA_F_DSA_PRINT,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
@@ -308,15 +281,10 @@ int DHparams_print_fp(FILE *fp, DH *x)
 | 
			
		||||
int DHparams_print(BIO *bp, DH *x)
 | 
			
		||||
	{
 | 
			
		||||
	unsigned char *m=NULL;
 | 
			
		||||
	int reason=ERR_R_BUF_LIB,ret=0;
 | 
			
		||||
	size_t buf_len=0, i;
 | 
			
		||||
	int reason=ERR_R_BUF_LIB,i,ret=0;
 | 
			
		||||
 | 
			
		||||
	if (x->p)
 | 
			
		||||
		buf_len = (size_t)BN_num_bytes(x->p);
 | 
			
		||||
	if (x->g)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->g)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc(buf_len+10);
 | 
			
		||||
	i=BN_num_bytes(x->p);
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
 | 
			
		||||
	if (m == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		reason=ERR_R_MALLOC_FAILURE;
 | 
			
		||||
@@ -366,18 +334,10 @@ int DSAparams_print_fp(FILE *fp, DSA *x)
 | 
			
		||||
int DSAparams_print(BIO *bp, DSA *x)
 | 
			
		||||
	{
 | 
			
		||||
	unsigned char *m=NULL;
 | 
			
		||||
	int reason=ERR_R_BUF_LIB,ret=0;
 | 
			
		||||
	size_t buf_len=0, i;
 | 
			
		||||
	int reason=ERR_R_BUF_LIB,i,ret=0;
 | 
			
		||||
 | 
			
		||||
	if (x->p)
 | 
			
		||||
		buf_len = (size_t)BN_num_bytes(x->p);
 | 
			
		||||
	if (x->q)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->q)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	if (x->g)
 | 
			
		||||
		if (buf_len < (i = (size_t)BN_num_bytes(x->g)))
 | 
			
		||||
			buf_len = i;
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc(buf_len+10);
 | 
			
		||||
	i=BN_num_bytes(x->p);
 | 
			
		||||
	m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
 | 
			
		||||
	if (m == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		reason=ERR_R_MALLOC_FAILURE;
 | 
			
		||||
 
 | 
			
		||||
@@ -156,7 +156,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
 | 
			
		||||
		dsa->write_params=0;
 | 
			
		||||
		ASN1_TYPE_free(a->parameter);
 | 
			
		||||
		i=i2d_DSAparams(dsa,NULL);
 | 
			
		||||
		if ((p=(unsigned char *)OPENSSL_malloc(i)) == NULL) goto err;
 | 
			
		||||
		p=(unsigned char *)OPENSSL_malloc(i);
 | 
			
		||||
		pp=p;
 | 
			
		||||
		i2d_DSAparams(dsa,&pp);
 | 
			
		||||
		a->parameter=ASN1_TYPE_new();
 | 
			
		||||
 
 | 
			
		||||
@@ -56,13 +56,6 @@
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* disable assert() unless BIO_DEBUG has been defined */
 | 
			
		||||
#ifndef BIO_DEBUG
 | 
			
		||||
# ifndef NDEBUG
 | 
			
		||||
#  define NDEBUG
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Stolen from tjh's ssl/ssl_trc.c stuff.
 | 
			
		||||
 */
 | 
			
		||||
@@ -723,13 +716,12 @@ doapr_outch(
 | 
			
		||||
    if (buffer) {
 | 
			
		||||
	while (*currlen >= *maxlen) {
 | 
			
		||||
	    if (*buffer == NULL) {
 | 
			
		||||
		assert(*sbuffer != NULL);
 | 
			
		||||
		if (*maxlen == 0)
 | 
			
		||||
		    *maxlen = 1024;
 | 
			
		||||
		*buffer = OPENSSL_malloc(*maxlen);
 | 
			
		||||
		if (*currlen > 0) {
 | 
			
		||||
		    assert(*sbuffer != NULL);
 | 
			
		||||
		if (*currlen > 0)
 | 
			
		||||
		    memcpy(*buffer, *sbuffer, *currlen);
 | 
			
		||||
		}
 | 
			
		||||
		*sbuffer = NULL;
 | 
			
		||||
	    } else {
 | 
			
		||||
		*maxlen += 1024;
 | 
			
		||||
@@ -769,9 +761,7 @@ int BIO_vprintf (BIO *bio, const char *format, va_list args)
 | 
			
		||||
	{
 | 
			
		||||
	int ret;
 | 
			
		||||
	size_t retlen;
 | 
			
		||||
	char hugebuf[1024*2];	/* Was previously 10k, which is unreasonable
 | 
			
		||||
				   in small-stack environments, like threads
 | 
			
		||||
				   or DOS programs. */
 | 
			
		||||
	MS_STATIC char hugebuf[1024*10];
 | 
			
		||||
	char *hugebufp = hugebuf;
 | 
			
		||||
	size_t hugebufsize = sizeof(hugebuf);
 | 
			
		||||
	char *dynbuf = NULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -72,9 +72,9 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef SO_MAXCONN
 | 
			
		||||
#define MAX_LISTEN  SO_MAXCONN
 | 
			
		||||
#elif defined(SOMAXCONN)
 | 
			
		||||
#define MAX_LISTEN  SOMAXCONN
 | 
			
		||||
#elif defined(SO_MAXCONN)
 | 
			
		||||
#define MAX_LISTEN  SO_MAXCONN
 | 
			
		||||
#else
 | 
			
		||||
#define MAX_LISTEN  32
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -200,7 +200,7 @@ static int linebuffer_write(BIO *b, const char *in, int inl)
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
BIO_write(b->next_bio, "<*<", 3);
 | 
			
		||||
#endif
 | 
			
		||||
			i=BIO_write(b->next_bio,
 | 
			
		||||
@@ -210,13 +210,13 @@ BIO_write(b->next_bio, "<*<", 3);
 | 
			
		||||
				ctx->obuf_len = orig_olen;
 | 
			
		||||
				BIO_copy_next_retry(b);
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
BIO_write(b->next_bio, ">*>", 3);
 | 
			
		||||
#endif
 | 
			
		||||
				if (i < 0) return((num > 0)?num:i);
 | 
			
		||||
				if (i == 0) return(num);
 | 
			
		||||
				}
 | 
			
		||||
#if 0
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
BIO_write(b->next_bio, ">*>", 3);
 | 
			
		||||
#endif
 | 
			
		||||
			if (i < ctx->obuf_len)
 | 
			
		||||
@@ -229,20 +229,20 @@ BIO_write(b->next_bio, ">*>", 3);
 | 
			
		||||
		   buffer if a NL was found and there is anything to write. */
 | 
			
		||||
		if ((foundnl || p - in > ctx->obuf_size) && p - in > 0)
 | 
			
		||||
			{
 | 
			
		||||
#if 0
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
BIO_write(b->next_bio, "<*<", 3);
 | 
			
		||||
#endif
 | 
			
		||||
			i=BIO_write(b->next_bio,in,p - in);
 | 
			
		||||
			if (i <= 0)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_copy_next_retry(b);
 | 
			
		||||
#if 0
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
BIO_write(b->next_bio, ">*>", 3);
 | 
			
		||||
#endif
 | 
			
		||||
				if (i < 0) return((num > 0)?num:i);
 | 
			
		||||
				if (i == 0) return(num);
 | 
			
		||||
				}
 | 
			
		||||
#if 0
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
BIO_write(b->next_bio, ">*>", 3);
 | 
			
		||||
#endif
 | 
			
		||||
			num+=i;
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,7 @@ static int nbiof_new(BIO *bi)
 | 
			
		||||
	{
 | 
			
		||||
	NBIO_TEST *nt;
 | 
			
		||||
 | 
			
		||||
	if (!(nt=(NBIO_TEST *)OPENSSL_malloc(sizeof(NBIO_TEST)))) return(0);
 | 
			
		||||
	nt=(NBIO_TEST *)OPENSSL_malloc(sizeof(NBIO_TEST));
 | 
			
		||||
	nt->lrn= -1;
 | 
			
		||||
	nt->lwn= -1;
 | 
			
		||||
	bi->ptr=(char *)nt;
 | 
			
		||||
 
 | 
			
		||||
@@ -356,8 +356,8 @@ typedef struct bio_f_buffer_ctx_struct
 | 
			
		||||
#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
 | 
			
		||||
#define BIO_get_conn_hostname(b)  BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
 | 
			
		||||
#define BIO_get_conn_port(b)      BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
 | 
			
		||||
#define BIO_get_conn_ip(b) 		 BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
 | 
			
		||||
#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3)
 | 
			
		||||
#define BIO_get_conn_ip(b,ip) BIO_ptr_ctrl(b,BIO_C_SET_CONNECT,2)
 | 
			
		||||
#define BIO_get_conn_int_port(b,port) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,port)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define BIO_set_nbio(b,n)	BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
 | 
			
		||||
 
 | 
			
		||||
@@ -7,18 +7,9 @@
 | 
			
		||||
 * for which no specific BIO method is available.
 | 
			
		||||
 * See ssl/ssltest.c for some hints on how this can be used. */
 | 
			
		||||
 | 
			
		||||
/* BIO_DEBUG implies BIO_PAIR_DEBUG */
 | 
			
		||||
#ifdef BIO_DEBUG
 | 
			
		||||
# ifndef BIO_PAIR_DEBUG
 | 
			
		||||
#  define BIO_PAIR_DEBUG
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* disable assert() unless BIO_PAIR_DEBUG has been defined */
 | 
			
		||||
#ifndef BIO_PAIR_DEBUG
 | 
			
		||||
# ifndef NDEBUG
 | 
			
		||||
#  define NDEBUG
 | 
			
		||||
# endif
 | 
			
		||||
# undef NDEBUG /* avoid conflicting definitions */
 | 
			
		||||
# define NDEBUG
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
@@ -32,12 +23,7 @@
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
 | 
			
		||||
#include "openssl/e_os.h"
 | 
			
		||||
 | 
			
		||||
/* VxWorks defines SSiZE_MAX with an empty value causing compile errors */
 | 
			
		||||
#if defined(VXWORKS)
 | 
			
		||||
# undef SSIZE_MAX
 | 
			
		||||
# define SSIZE_MAX INT_MAX
 | 
			
		||||
#elif !defined(SSIZE_MAX)
 | 
			
		||||
#ifndef SSIZE_MAX
 | 
			
		||||
# define SSIZE_MAX INT_MAX
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -75,7 +75,7 @@
 | 
			
		||||
#  include <starlet.h>
 | 
			
		||||
#elif defined(__ultrix)
 | 
			
		||||
#  include <sys/syslog.h>
 | 
			
		||||
#elif !defined(MSDOS) && !defined(VXWORKS) /* Unix */
 | 
			
		||||
#elif !defined(MSDOS) /* Unix */
 | 
			
		||||
#  include <syslog.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -155,7 +155,7 @@ extern "C" {
 | 
			
		||||
#define BN_BYTES	4
 | 
			
		||||
#define BN_BITS2	32
 | 
			
		||||
#define BN_BITS4	16
 | 
			
		||||
#ifdef _MSC_VER
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
/* VC++ doesn't like the LL suffix */
 | 
			
		||||
#define BN_MASK		(0xffffffffffffffffL)
 | 
			
		||||
#else
 | 
			
		||||
 
 | 
			
		||||
@@ -190,10 +190,10 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
 | 
			
		||||
 | 
			
		||||
	/* First we normalise the numbers */
 | 
			
		||||
	norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2);
 | 
			
		||||
	if (!(BN_lshift(sdiv,divisor,norm_shift))) goto err;
 | 
			
		||||
	BN_lshift(sdiv,divisor,norm_shift);
 | 
			
		||||
	sdiv->neg=0;
 | 
			
		||||
	norm_shift+=BN_BITS2;
 | 
			
		||||
	if (!(BN_lshift(snum,num,norm_shift))) goto err;
 | 
			
		||||
	BN_lshift(snum,num,norm_shift);
 | 
			
		||||
	snum->neg=0;
 | 
			
		||||
	div_n=sdiv->top;
 | 
			
		||||
	num_n=snum->top;
 | 
			
		||||
@@ -315,7 +315,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
 | 
			
		||||
		tmp->top=j;
 | 
			
		||||
 | 
			
		||||
		j=wnum.top;
 | 
			
		||||
		if (!BN_sub(&wnum,&wnum,tmp)) goto err;
 | 
			
		||||
		BN_sub(&wnum,&wnum,tmp);
 | 
			
		||||
 | 
			
		||||
		snum->top=snum->top+wnum.top-j;
 | 
			
		||||
 | 
			
		||||
@@ -323,7 +323,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
 | 
			
		||||
			{
 | 
			
		||||
			q--;
 | 
			
		||||
			j=wnum.top;
 | 
			
		||||
			if (!BN_add(&wnum,&wnum,sdiv)) goto err;
 | 
			
		||||
			BN_add(&wnum,&wnum,sdiv);
 | 
			
		||||
			snum->top+=wnum.top-j;
 | 
			
		||||
			}
 | 
			
		||||
		*(resp--)=q;
 | 
			
		||||
 
 | 
			
		||||
@@ -113,6 +113,13 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include "bn_lcl.h"
 | 
			
		||||
#ifdef ATALLA
 | 
			
		||||
# include <alloca.h>
 | 
			
		||||
# include <atasi.h>
 | 
			
		||||
# include <assert.h>
 | 
			
		||||
# include <dlfcn.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define TABLE_SIZE	32
 | 
			
		||||
 | 
			
		||||
@@ -176,6 +183,174 @@ err:
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef ATALLA
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This routine will dynamically check for the existance of an Atalla AXL-200
 | 
			
		||||
 * SSL accelerator module.  If one is found, the variable
 | 
			
		||||
 * asi_accelerator_present is set to 1 and the function pointers
 | 
			
		||||
 * ptr_ASI_xxxxxx above will be initialized to corresponding ASI API calls.
 | 
			
		||||
 */
 | 
			
		||||
typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
 | 
			
		||||
					    unsigned int *ret_buf);
 | 
			
		||||
typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
 | 
			
		||||
typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
 | 
			
		||||
				     unsigned char *output,
 | 
			
		||||
				     unsigned char *input,
 | 
			
		||||
				     unsigned int modulus_len);
 | 
			
		||||
 | 
			
		||||
static tfnASI_GetHardwareConfig *ptr_ASI_GetHardwareConfig;
 | 
			
		||||
static tfnASI_RSAPrivateKeyOpFn *ptr_ASI_RSAPrivateKeyOpFn;
 | 
			
		||||
static tfnASI_GetPerformanceStatistics *ptr_ASI_GetPerformanceStatistics;
 | 
			
		||||
static int asi_accelerator_present;
 | 
			
		||||
static int tried_atalla;
 | 
			
		||||
 | 
			
		||||
void atalla_initialize_accelerator_handle(void)
 | 
			
		||||
	{
 | 
			
		||||
	void *dl_handle;
 | 
			
		||||
	int status;
 | 
			
		||||
	unsigned int config_buf[1024]; 
 | 
			
		||||
	static int tested;
 | 
			
		||||
 | 
			
		||||
	if(tested)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	tested=1;
 | 
			
		||||
 | 
			
		||||
	bzero((void *)config_buf, 1024);
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Check to see if the library is present on the system
 | 
			
		||||
	 */
 | 
			
		||||
	dl_handle = dlopen("atasi.so", RTLD_NOW);
 | 
			
		||||
	if (dl_handle == (void *) NULL)
 | 
			
		||||
		{
 | 
			
		||||
/*		printf("atasi.so library is not present on the system\n");
 | 
			
		||||
		printf("No HW acceleration available\n");*/
 | 
			
		||||
		return;
 | 
			
		||||
	        }
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * The library is present.  Now we'll check to insure that the
 | 
			
		||||
	 * LDM is up and running. First we'll get the address of the
 | 
			
		||||
	 * function in the atasi library that we need to see if the
 | 
			
		||||
	 * LDM is operating.
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	ptr_ASI_GetHardwareConfig =
 | 
			
		||||
	  (tfnASI_GetHardwareConfig *)dlsym(dl_handle,"ASI_GetHardwareConfig");
 | 
			
		||||
 | 
			
		||||
	if (ptr_ASI_GetHardwareConfig)
 | 
			
		||||
		{
 | 
			
		||||
		/*
 | 
			
		||||
		 * We found the call, now we'll get our config
 | 
			
		||||
		 * status.  If we get a non 0 result, the LDM is not
 | 
			
		||||
		 * running and we cannot use the Atalla ASI *
 | 
			
		||||
		 * library.
 | 
			
		||||
		 */
 | 
			
		||||
		status = (*ptr_ASI_GetHardwareConfig)(0L, config_buf);
 | 
			
		||||
		if (status != 0)
 | 
			
		||||
			{
 | 
			
		||||
			printf("atasi.so library is present but not initialized\n");
 | 
			
		||||
			printf("No HW acceleration available\n");
 | 
			
		||||
			return;
 | 
			
		||||
			}    
 | 
			
		||||
	        }
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
/*		printf("We found the library, but not the function. Very Strange!\n");*/
 | 
			
		||||
		return ;
 | 
			
		||||
	      	}
 | 
			
		||||
 | 
			
		||||
	/* 
 | 
			
		||||
	 * It looks like we have acceleration capabilities.  Load up the
 | 
			
		||||
	 * pointers to our ASI API calls.
 | 
			
		||||
	 */
 | 
			
		||||
	ptr_ASI_RSAPrivateKeyOpFn=
 | 
			
		||||
	  (tfnASI_RSAPrivateKeyOpFn *)dlsym(dl_handle, "ASI_RSAPrivateKeyOpFn");
 | 
			
		||||
	if (ptr_ASI_RSAPrivateKeyOpFn == NULL)
 | 
			
		||||
		{
 | 
			
		||||
/*		printf("We found the library, but no RSA function. Very Strange!\n");*/
 | 
			
		||||
		return;
 | 
			
		||||
	        }
 | 
			
		||||
 | 
			
		||||
	ptr_ASI_GetPerformanceStatistics =
 | 
			
		||||
	  (tfnASI_GetPerformanceStatistics *)dlsym(dl_handle, "ASI_GetPerformanceStatistics");
 | 
			
		||||
	if (ptr_ASI_GetPerformanceStatistics == NULL)
 | 
			
		||||
		{
 | 
			
		||||
/*		printf("We found the library, but no stat function. Very Strange!\n");*/
 | 
			
		||||
		return;
 | 
			
		||||
	      }
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Indicate that acceleration is available
 | 
			
		||||
	 */
 | 
			
		||||
	asi_accelerator_present = 1;
 | 
			
		||||
 | 
			
		||||
/*	printf("This system has acceleration!\n");*/
 | 
			
		||||
 | 
			
		||||
	return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* make sure this only gets called once when bn_mod_exp calls bn_mod_exp_mont */
 | 
			
		||||
int BN_mod_exp_atalla(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m)
 | 
			
		||||
	{
 | 
			
		||||
	unsigned char *abin;
 | 
			
		||||
	unsigned char *pbin;
 | 
			
		||||
	unsigned char *mbin;
 | 
			
		||||
	unsigned char *rbin;
 | 
			
		||||
	int an,pn,mn,ret;
 | 
			
		||||
	RSAPrivateKey keydata;
 | 
			
		||||
 | 
			
		||||
	atalla_initialize_accelerator_handle();
 | 
			
		||||
	if(!asi_accelerator_present)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* We should be able to run without size testing */
 | 
			
		||||
# define ASIZE	128
 | 
			
		||||
	an=BN_num_bytes(a);
 | 
			
		||||
	pn=BN_num_bytes(p);
 | 
			
		||||
	mn=BN_num_bytes(m);
 | 
			
		||||
 | 
			
		||||
	if(an <= ASIZE && pn <= ASIZE && mn <= ASIZE)
 | 
			
		||||
	    {
 | 
			
		||||
	    int size=mn;
 | 
			
		||||
 | 
			
		||||
	    assert(an <= mn);
 | 
			
		||||
	    abin=alloca(size);
 | 
			
		||||
	    memset(abin,'\0',mn);
 | 
			
		||||
	    BN_bn2bin(a,abin+size-an);
 | 
			
		||||
 | 
			
		||||
	    pbin=alloca(pn);
 | 
			
		||||
	    BN_bn2bin(p,pbin);
 | 
			
		||||
 | 
			
		||||
	    mbin=alloca(size);
 | 
			
		||||
	    memset(mbin,'\0',mn);
 | 
			
		||||
	    BN_bn2bin(m,mbin+size-mn);
 | 
			
		||||
 | 
			
		||||
	    rbin=alloca(size);
 | 
			
		||||
 | 
			
		||||
	    memset(&keydata,'\0',sizeof keydata);
 | 
			
		||||
	    keydata.privateExponent.data=pbin;
 | 
			
		||||
	    keydata.privateExponent.len=pn;
 | 
			
		||||
	    keydata.modulus.data=mbin;
 | 
			
		||||
	    keydata.modulus.len=size;
 | 
			
		||||
 | 
			
		||||
	    ret=(*ptr_ASI_RSAPrivateKeyOpFn)(&keydata,rbin,abin,keydata.modulus.len);
 | 
			
		||||
/*fprintf(stderr,"!%s\n",BN_bn2hex(a));*/
 | 
			
		||||
	    if(!ret)
 | 
			
		||||
	        {
 | 
			
		||||
		BN_bin2bn(rbin,keydata.modulus.len,r);
 | 
			
		||||
/*fprintf(stderr,"?%s\n",BN_bn2hex(r));*/
 | 
			
		||||
		return 1;
 | 
			
		||||
	        }
 | 
			
		||||
	    }
 | 
			
		||||
	return 0;
 | 
			
		||||
        }
 | 
			
		||||
#endif /* def ATALLA */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
 | 
			
		||||
	       BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
@@ -185,6 +360,13 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
 | 
			
		||||
	bn_check_top(p);
 | 
			
		||||
	bn_check_top(m);
 | 
			
		||||
 | 
			
		||||
#ifdef ATALLA
 | 
			
		||||
	if(BN_mod_exp_atalla(r,a,p,m))
 | 
			
		||||
	    return 1;
 | 
			
		||||
/* If it fails, try the other methods (but don't try atalla again) */
 | 
			
		||||
	tried_atalla=1;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef MONT_MUL_MOD
 | 
			
		||||
	/* I have finally been able to take out this pre-condition of
 | 
			
		||||
	 * the top bit being set.  It was caused by an error in BN_div
 | 
			
		||||
@@ -210,6 +392,10 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
 | 
			
		||||
		{ ret=BN_mod_exp_simple(r,a,p,m,ctx); }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef ATALLA
 | 
			
		||||
	tried_atalla=0;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	return(ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -339,6 +525,12 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
 | 
			
		||||
	bn_check_top(p);
 | 
			
		||||
	bn_check_top(m);
 | 
			
		||||
 | 
			
		||||
#ifdef ATALLA
 | 
			
		||||
	if(!tried_atalla && BN_mod_exp_atalla(rr,a,p,m))
 | 
			
		||||
	    return 1;
 | 
			
		||||
/* If it fails, try the other methods */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (!(m->d[0] & 1))
 | 
			
		||||
		{
 | 
			
		||||
		BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS);
 | 
			
		||||
@@ -501,6 +693,19 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
 | 
			
		||||
	t = BN_CTX_get(ctx);
 | 
			
		||||
	if (d == NULL || r == NULL || t == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
#ifdef ATALLA
 | 
			
		||||
	if (!tried_atalla)
 | 
			
		||||
		{
 | 
			
		||||
		BN_set_word(t, a);
 | 
			
		||||
		if (BN_mod_exp_atalla(rr, t, p, m))
 | 
			
		||||
			{
 | 
			
		||||
			BN_CTX_end(ctx);
 | 
			
		||||
			return 1;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
/* If it fails, try the other methods */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (in_mont != NULL)
 | 
			
		||||
		mont=in_mont;
 | 
			
		||||
	else
 | 
			
		||||
 
 | 
			
		||||
@@ -168,8 +168,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *in, BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
 | 
			
		||||
		R=in;
 | 
			
		||||
	if (R == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	if (!BN_zero(X)) goto err;
 | 
			
		||||
	if (!BN_one(Y)) goto err;
 | 
			
		||||
	BN_zero(X);
 | 
			
		||||
	BN_one(Y);
 | 
			
		||||
	if (BN_copy(A,a) == NULL) goto err;
 | 
			
		||||
	if (BN_copy(B,n) == NULL) goto err;
 | 
			
		||||
	sign=1;
 | 
			
		||||
 
 | 
			
		||||
@@ -224,7 +224,7 @@ int BN_from_montgomery(BIGNUM *ret, BIGNUM *a, BN_MONT_CTX *mont,
 | 
			
		||||
 | 
			
		||||
	if (!BN_mul(t1,t2,&mont->N,ctx)) goto err;
 | 
			
		||||
	if (!BN_add(t2,a,t1)) goto err;
 | 
			
		||||
	if (!BN_rshift(ret,t2,mont->ri)) goto err;
 | 
			
		||||
	BN_rshift(ret,t2,mont->ri);
 | 
			
		||||
#endif /* MONT_WORD */
 | 
			
		||||
 | 
			
		||||
	if (BN_ucmp(ret, &(mont->N)) >= 0)
 | 
			
		||||
@@ -284,8 +284,8 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
 | 
			
		||||
		BN_ULONG buf[2];
 | 
			
		||||
 | 
			
		||||
		mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2;
 | 
			
		||||
		if (!(BN_zero(R))) goto err;
 | 
			
		||||
		if (!(BN_set_bit(R,BN_BITS2))) goto err;	/* R */
 | 
			
		||||
		BN_zero(R);
 | 
			
		||||
		BN_set_bit(R,BN_BITS2);			/* R */
 | 
			
		||||
 | 
			
		||||
		buf[0]=mod->d[0]; /* tmod = N mod word size */
 | 
			
		||||
		buf[1]=0;
 | 
			
		||||
@@ -296,44 +296,36 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
 | 
			
		||||
							/* Ri = R^-1 mod N*/
 | 
			
		||||
		if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL)
 | 
			
		||||
			goto err;
 | 
			
		||||
		/* R*Ri */
 | 
			
		||||
		if (!(BN_lshift(&Ri,&Ri,BN_BITS2))) goto err;
 | 
			
		||||
		BN_lshift(&Ri,&Ri,BN_BITS2);		/* R*Ri */
 | 
			
		||||
		if (!BN_is_zero(&Ri))
 | 
			
		||||
			{
 | 
			
		||||
		   	if (!BN_sub_word(&Ri,1)) goto err;
 | 
			
		||||
			}
 | 
			
		||||
			BN_sub_word(&Ri,1);
 | 
			
		||||
		else /* if N mod word size == 1 */
 | 
			
		||||
		   	/* Ri-- (mod word size) */
 | 
			
		||||
			{
 | 
			
		||||
			if (!BN_set_word(&Ri,BN_MASK2)) goto err;
 | 
			
		||||
			}
 | 
			
		||||
		/* Ni = (R*Ri-1)/N, keep only least significant word: */
 | 
			
		||||
                if (!(BN_div(&Ri,NULL,&Ri,&tmod,ctx))) goto err;
 | 
			
		||||
			BN_set_word(&Ri,BN_MASK2);  /* Ri-- (mod word size) */
 | 
			
		||||
		BN_div(&Ri,NULL,&Ri,&tmod,ctx);	/* Ni = (R*Ri-1)/N,
 | 
			
		||||
		                                 * keep only least significant word: */
 | 
			
		||||
		mont->n0=Ri.d[0];
 | 
			
		||||
		BN_free(&Ri);
 | 
			
		||||
		}
 | 
			
		||||
#else /* !MONT_WORD */
 | 
			
		||||
		{ /* bignum version */
 | 
			
		||||
		mont->ri=BN_num_bits(mod);
 | 
			
		||||
		if (!(BN_zero(R))) goto err;
 | 
			
		||||
		/* R = 2^ri */
 | 
			
		||||
		if (!(BN_set_bit(R,mont->ri))) goto err;
 | 
			
		||||
		BN_zero(R);
 | 
			
		||||
		BN_set_bit(R,mont->ri);			/* R = 2^ri */
 | 
			
		||||
							/* Ri = R^-1 mod N*/
 | 
			
		||||
		if ((BN_mod_inverse(&Ri,R,mod,ctx)) == NULL)
 | 
			
		||||
			goto err;
 | 
			
		||||
		/* R*Ri */
 | 
			
		||||
		if (!(BN_lshift(&Ri,&Ri,mont->ri))) goto err;
 | 
			
		||||
		if (!(BN_sub_word(&Ri,1))) goto err;
 | 
			
		||||
		BN_lshift(&Ri,&Ri,mont->ri);		/* R*Ri */
 | 
			
		||||
		BN_sub_word(&Ri,1);
 | 
			
		||||
							/* Ni = (R*Ri-1) / N */
 | 
			
		||||
		if (!(BN_div(&(mont->Ni),NULL,&Ri,mod,ctx))) goto err;
 | 
			
		||||
		BN_div(&(mont->Ni),NULL,&Ri,mod,ctx);
 | 
			
		||||
		BN_free(&Ri);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	/* setup RR for conversions */
 | 
			
		||||
	if (!(BN_zero(&(mont->RR)))) goto err;
 | 
			
		||||
	if (!(BN_set_bit(&(mont->RR),mont->ri*2))) goto err;
 | 
			
		||||
	if (!(BN_mod(&(mont->RR),&(mont->RR),&(mont->N),ctx))) goto err;
 | 
			
		||||
	BN_zero(&(mont->RR));
 | 
			
		||||
	BN_set_bit(&(mont->RR),mont->ri*2);
 | 
			
		||||
	BN_mod(&(mont->RR),&(mont->RR),&(mont->N),ctx);
 | 
			
		||||
 | 
			
		||||
	return(1);
 | 
			
		||||
err:
 | 
			
		||||
@@ -344,9 +336,9 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
 | 
			
		||||
	{
 | 
			
		||||
	if (to == from) return(to);
 | 
			
		||||
 | 
			
		||||
	if (!(BN_copy(&(to->RR),&(from->RR)))) return NULL;
 | 
			
		||||
	if (!(BN_copy(&(to->N),&(from->N)))) return NULL;
 | 
			
		||||
	if (!(BN_copy(&(to->Ni),&(from->Ni)))) return NULL;
 | 
			
		||||
	BN_copy(&(to->RR),&(from->RR));
 | 
			
		||||
	BN_copy(&(to->N),&(from->N));
 | 
			
		||||
	BN_copy(&(to->Ni),&(from->Ni));
 | 
			
		||||
	to->ri=from->ri;
 | 
			
		||||
	to->n0=from->n0;
 | 
			
		||||
	return(to);
 | 
			
		||||
 
 | 
			
		||||
@@ -634,7 +634,7 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
 | 
			
		||||
 | 
			
		||||
	if ((al == 0) || (bl == 0))
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_zero(r)) goto err;
 | 
			
		||||
		BN_zero(r);
 | 
			
		||||
		return(1);
 | 
			
		||||
		}
 | 
			
		||||
	top=al+bl;
 | 
			
		||||
@@ -677,14 +677,14 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
 | 
			
		||||
		{
 | 
			
		||||
		if (i == 1 && !BN_get_flags(b,BN_FLG_STATIC_DATA))
 | 
			
		||||
			{
 | 
			
		||||
			if (bn_wexpand(b,al) == NULL) goto err;
 | 
			
		||||
			bn_wexpand(b,al);
 | 
			
		||||
			b->d[bl]=0;
 | 
			
		||||
			bl++;
 | 
			
		||||
			i--;
 | 
			
		||||
			}
 | 
			
		||||
		else if (i == -1 && !BN_get_flags(a,BN_FLG_STATIC_DATA))
 | 
			
		||||
			{
 | 
			
		||||
			if (bn_wexpand(a,bl) == NULL) goto err;
 | 
			
		||||
			bn_wexpand(a,bl);
 | 
			
		||||
			a->d[al]=0;
 | 
			
		||||
			al++;
 | 
			
		||||
			i++;
 | 
			
		||||
@@ -699,16 +699,16 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
 | 
			
		||||
			t = BN_CTX_get(ctx);
 | 
			
		||||
			if (al == j) /* exact multiple */
 | 
			
		||||
				{
 | 
			
		||||
				if (bn_wexpand(t,k*2) == NULL) goto err;
 | 
			
		||||
				if (bn_wexpand(rr,k*2) == NULL) goto err;
 | 
			
		||||
				bn_wexpand(t,k*2);
 | 
			
		||||
				bn_wexpand(rr,k*2);
 | 
			
		||||
				bn_mul_recursive(rr->d,a->d,b->d,al,t->d);
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				if (bn_wexpand(a,k) == NULL ) goto err;
 | 
			
		||||
				if (bn_wexpand(b,k) == NULL ) goto err;
 | 
			
		||||
				if (bn_wexpand(t,k*4) == NULL ) goto err;
 | 
			
		||||
				if (bn_wexpand(rr,k*4) == NULL ) goto err;
 | 
			
		||||
				bn_wexpand(a,k);
 | 
			
		||||
				bn_wexpand(b,k);
 | 
			
		||||
				bn_wexpand(t,k*4);
 | 
			
		||||
				bn_wexpand(rr,k*4);
 | 
			
		||||
				for (i=a->top; i<k; i++)
 | 
			
		||||
					a->d[i]=0;
 | 
			
		||||
				for (i=b->top; i<k; i++)
 | 
			
		||||
 
 | 
			
		||||
@@ -93,14 +93,17 @@ conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 | 
			
		||||
conf_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
conf_def.o: ../cryptlib.h conf_def.h
 | 
			
		||||
conf_def.o: conf_def.h
 | 
			
		||||
conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
 | 
			
		||||
conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
 | 
			
		||||
conf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
 | 
			
		||||
conf_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
conf_err.o: ../../include/openssl/symhacks.h
 | 
			
		||||
conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
 | 
			
		||||
conf_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
conf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 | 
			
		||||
conf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
conf_lib.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
 | 
			
		||||
conf_lib.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
 | 
			
		||||
conf_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
conf_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
 | 
			
		||||
conf_lib.o: ../../include/openssl/opensslconf.h
 | 
			
		||||
conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 | 
			
		||||
conf_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
 
 | 
			
		||||
@@ -56,13 +56,14 @@
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef HEADER_CONF_H
 | 
			
		||||
#ifndef  HEADER_CONF_H
 | 
			
		||||
#define HEADER_CONF_H
 | 
			
		||||
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
#include <openssl/lhash.h>
 | 
			
		||||
#include <openssl/stack.h>
 | 
			
		||||
#include <openssl/safestack.h>
 | 
			
		||||
#include <openssl/e_os.h>
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
@@ -85,14 +86,14 @@ typedef struct conf_method_st CONF_METHOD;
 | 
			
		||||
struct conf_method_st
 | 
			
		||||
	{
 | 
			
		||||
	const char *name;
 | 
			
		||||
	CONF *(*create)(CONF_METHOD *meth);
 | 
			
		||||
	int (*init)(CONF *conf);
 | 
			
		||||
	int (*destroy)(CONF *conf);
 | 
			
		||||
	int (*destroy_data)(CONF *conf);
 | 
			
		||||
	int (*load)(CONF *conf, BIO *bp, long *eline);
 | 
			
		||||
	int (*dump)(CONF *conf, BIO *bp);
 | 
			
		||||
	int (*is_number)(CONF *conf, char c);
 | 
			
		||||
	int (*to_int)(CONF *conf, char c);
 | 
			
		||||
	CONF *(MS_FAR *create)(CONF_METHOD *meth);
 | 
			
		||||
	int (MS_FAR *init)(CONF *conf);
 | 
			
		||||
	int (MS_FAR *destroy)(CONF *conf);
 | 
			
		||||
	int (MS_FAR *destroy_data)(CONF *conf);
 | 
			
		||||
	int (MS_FAR *load)(CONF *conf, BIO *bp, long *eline);
 | 
			
		||||
	int (MS_FAR *dump)(CONF *conf, BIO *bp);
 | 
			
		||||
	int (MS_FAR *is_number)(CONF *conf, char c);
 | 
			
		||||
	int (MS_FAR *to_int)(CONF *conf, char c);
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
int CONF_set_default_method(CONF_METHOD *meth);
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,6 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <openssl/conf.h>
 | 
			
		||||
#include <openssl/conf_api.h>
 | 
			
		||||
#include "openssl/e_os.h"
 | 
			
		||||
 | 
			
		||||
static void value_free_hash(CONF_VALUE *a, LHASH *conf);
 | 
			
		||||
static void value_free_stack(CONF_VALUE *a,LHASH *conf);
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,6 @@
 | 
			
		||||
#include "conf_def.h"
 | 
			
		||||
#include <openssl/buffer.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
 | 
			
		||||
static char *eat_ws(CONF *conf, char *p);
 | 
			
		||||
static char *eat_alpha_numeric(CONF *conf, char *p);
 | 
			
		||||
@@ -181,12 +180,12 @@ static int def_destroy_data(CONF *conf)
 | 
			
		||||
static int def_load(CONF *conf, BIO *in, long *line)
 | 
			
		||||
	{
 | 
			
		||||
#define BUFSIZE	512
 | 
			
		||||
	char btmp[16];
 | 
			
		||||
	int bufnum=0,i,ii;
 | 
			
		||||
	BUF_MEM *buff=NULL;
 | 
			
		||||
	char *s,*p,*end;
 | 
			
		||||
	int again,n;
 | 
			
		||||
	long eline=0;
 | 
			
		||||
	char btmp[DECIMAL_SIZE(eline)+1];
 | 
			
		||||
	CONF_VALUE *v=NULL,*tv;
 | 
			
		||||
	CONF_VALUE *sv=NULL;
 | 
			
		||||
	char *section=NULL,*buf;
 | 
			
		||||
 
 | 
			
		||||
@@ -71,7 +71,6 @@
 | 
			
		||||
#define CONF_COMMENT		128
 | 
			
		||||
#define CONF_FCOMMENT		2048
 | 
			
		||||
#define CONF_EOF		8
 | 
			
		||||
#define CONF_HIGHBIT		4096
 | 
			
		||||
#define CONF_ALPHA		(CONF_UPPER|CONF_LOWER)
 | 
			
		||||
#define CONF_ALPHA_NUMERIC	(CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
 | 
			
		||||
#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \
 | 
			
		||||
@@ -79,102 +78,68 @@
 | 
			
		||||
 | 
			
		||||
#define KEYTYPES(c)		((unsigned short *)((c)->meth_data))
 | 
			
		||||
#ifndef CHARSET_EBCDIC
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[(a)&0x7f]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \
 | 
			
		||||
				(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
 | 
			
		||||
#define IS_HIGHBIT(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
 | 
			
		||||
				(KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_DQUOTE)
 | 
			
		||||
 | 
			
		||||
#else /*CHARSET_EBCDIC*/
 | 
			
		||||
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \
 | 
			
		||||
				(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
 | 
			
		||||
#define IS_HIGHBIT(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
 | 
			
		||||
				(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_DQUOTE)
 | 
			
		||||
#endif /*CHARSET_EBCDIC*/
 | 
			
		||||
 | 
			
		||||
static unsigned short CONF_type_default[256]={
 | 
			
		||||
	0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 | 
			
		||||
	0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000,
 | 
			
		||||
	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 | 
			
		||||
	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 | 
			
		||||
	0x0010,0x0200,0x0040,0x0080,0x0000,0x0200,0x0200,0x0040,
 | 
			
		||||
	0x0000,0x0000,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,
 | 
			
		||||
	0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
 | 
			
		||||
	0x0001,0x0001,0x0000,0x0200,0x0000,0x0000,0x0000,0x0200,
 | 
			
		||||
	0x0200,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
 | 
			
		||||
	0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
 | 
			
		||||
	0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
 | 
			
		||||
	0x0002,0x0002,0x0002,0x0000,0x0020,0x0000,0x0200,0x0100,
 | 
			
		||||
	0x0040,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
 | 
			
		||||
	0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
 | 
			
		||||
	0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
 | 
			
		||||
	0x0004,0x0004,0x0004,0x0000,0x0200,0x0000,0x0200,0x0000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
static unsigned short CONF_type_default[128]={
 | 
			
		||||
	0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
 | 
			
		||||
	0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000,
 | 
			
		||||
	0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
 | 
			
		||||
	0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
 | 
			
		||||
	0x010,0x200,0x040,0x080,0x000,0x200,0x200,0x040,
 | 
			
		||||
	0x000,0x000,0x200,0x200,0x200,0x200,0x200,0x200,
 | 
			
		||||
	0x001,0x001,0x001,0x001,0x001,0x001,0x001,0x001,
 | 
			
		||||
	0x001,0x001,0x000,0x200,0x000,0x000,0x000,0x200,
 | 
			
		||||
	0x200,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
 | 
			
		||||
	0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
 | 
			
		||||
	0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
 | 
			
		||||
	0x002,0x002,0x002,0x000,0x020,0x000,0x200,0x100,
 | 
			
		||||
	0x040,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
 | 
			
		||||
	0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
 | 
			
		||||
	0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
 | 
			
		||||
	0x004,0x004,0x004,0x000,0x200,0x000,0x200,0x000,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
static unsigned short CONF_type_win32[256]={
 | 
			
		||||
	0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 | 
			
		||||
	0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000,
 | 
			
		||||
	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 | 
			
		||||
	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
 | 
			
		||||
	0x0010,0x0200,0x0400,0x0000,0x0000,0x0200,0x0200,0x0000,
 | 
			
		||||
	0x0000,0x0000,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,
 | 
			
		||||
	0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
 | 
			
		||||
	0x0001,0x0001,0x0000,0x0A00,0x0000,0x0000,0x0000,0x0200,
 | 
			
		||||
	0x0200,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
 | 
			
		||||
	0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
 | 
			
		||||
	0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,
 | 
			
		||||
	0x0002,0x0002,0x0002,0x0000,0x0000,0x0000,0x0200,0x0100,
 | 
			
		||||
	0x0000,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
 | 
			
		||||
	0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
 | 
			
		||||
	0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,
 | 
			
		||||
	0x0004,0x0004,0x0004,0x0000,0x0200,0x0000,0x0200,0x0000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
	0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
 | 
			
		||||
static unsigned short CONF_type_win32[128]={
 | 
			
		||||
	0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
 | 
			
		||||
	0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000,
 | 
			
		||||
	0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
 | 
			
		||||
	0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
 | 
			
		||||
	0x010,0x200,0x400,0x000,0x000,0x200,0x200,0x000,
 | 
			
		||||
	0x000,0x000,0x200,0x200,0x200,0x200,0x200,0x200,
 | 
			
		||||
	0x001,0x001,0x001,0x001,0x001,0x001,0x001,0x001,
 | 
			
		||||
	0x001,0x001,0x000,0xA00,0x000,0x000,0x000,0x200,
 | 
			
		||||
	0x200,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
 | 
			
		||||
	0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
 | 
			
		||||
	0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
 | 
			
		||||
	0x002,0x002,0x002,0x000,0x000,0x000,0x200,0x100,
 | 
			
		||||
	0x000,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
 | 
			
		||||
	0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
 | 
			
		||||
	0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
 | 
			
		||||
	0x004,0x004,0x004,0x000,0x200,0x000,0x200,0x000,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -12,9 +12,8 @@ $DQUOTE=0x400;
 | 
			
		||||
$COMMENT=0x80;
 | 
			
		||||
$FCOMMENT=0x800;
 | 
			
		||||
$EOF=0x08;
 | 
			
		||||
$HIGHBIT=0x1000;
 | 
			
		||||
 | 
			
		||||
foreach (0 .. 255)
 | 
			
		||||
foreach (0 .. 127)
 | 
			
		||||
	{
 | 
			
		||||
	$v=0;
 | 
			
		||||
	$c=sprintf("%c",$_);
 | 
			
		||||
@@ -28,12 +27,11 @@ foreach (0 .. 255)
 | 
			
		||||
	$v|=$QUOTE	if ($c =~ /['`"]/); # for emacs: "`'}/)
 | 
			
		||||
	$v|=$COMMENT	if ($c =~ /\#/);
 | 
			
		||||
	$v|=$EOF	if ($c =~ /\0/);
 | 
			
		||||
	$v|=$HIGHBIT	if ($c =~/[\x80-\xff]/);
 | 
			
		||||
 | 
			
		||||
	push(@V_def,$v);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
foreach (0 .. 255)
 | 
			
		||||
foreach (0 .. 127)
 | 
			
		||||
	{
 | 
			
		||||
	$v=0;
 | 
			
		||||
	$c=sprintf("%c",$_);
 | 
			
		||||
@@ -46,7 +44,6 @@ foreach (0 .. 255)
 | 
			
		||||
	$v|=$DQUOTE	if ($c =~ /["]/); # for emacs: "}/)
 | 
			
		||||
	$v|=$FCOMMENT	if ($c =~ /;/);
 | 
			
		||||
	$v|=$EOF	if ($c =~ /\0/);
 | 
			
		||||
	$v|=$HIGHBIT	if ($c =~/[\x80-\xff]/);
 | 
			
		||||
 | 
			
		||||
	push(@V_w32,$v);
 | 
			
		||||
	}
 | 
			
		||||
@@ -125,7 +122,6 @@ print <<"EOF";
 | 
			
		||||
#define CONF_COMMENT		$COMMENT
 | 
			
		||||
#define CONF_FCOMMENT		$FCOMMENT
 | 
			
		||||
#define CONF_EOF		$EOF
 | 
			
		||||
#define CONF_HIGHBIT		$HIGHBIT
 | 
			
		||||
#define CONF_ALPHA		(CONF_UPPER|CONF_LOWER)
 | 
			
		||||
#define CONF_ALPHA_NUMERIC	(CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
 | 
			
		||||
#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \\
 | 
			
		||||
@@ -133,53 +129,51 @@ print <<"EOF";
 | 
			
		||||
 | 
			
		||||
#define KEYTYPES(c)		((unsigned short *)((c)->meth_data))
 | 
			
		||||
#ifndef CHARSET_EBCDIC
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[(a)&0x7f]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
 | 
			
		||||
				(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
 | 
			
		||||
#define IS_HIGHBIT(c,a)		(KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
 | 
			
		||||
				(KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[(a)&0x7f]&CONF_DQUOTE)
 | 
			
		||||
 | 
			
		||||
#else /*CHARSET_EBCDIC*/
 | 
			
		||||
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_COMMENT(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_COMMENT)
 | 
			
		||||
#define IS_FCOMMENT(c,a)	(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_FCOMMENT)
 | 
			
		||||
#define IS_EOF(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_EOF)
 | 
			
		||||
#define IS_ESC(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ESC)
 | 
			
		||||
#define IS_NUMBER(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_NUMBER)
 | 
			
		||||
#define IS_WS(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_WS)
 | 
			
		||||
#define IS_ALPHA_NUMERIC(c,a)	(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC)
 | 
			
		||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
 | 
			
		||||
				(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
 | 
			
		||||
#define IS_HIGHBIT(c,a)		(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
 | 
			
		||||
				(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
 | 
			
		||||
#define IS_QUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_QUOTE)
 | 
			
		||||
#define IS_DQUOTE(c,a)		(KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_DQUOTE)
 | 
			
		||||
#endif /*CHARSET_EBCDIC*/
 | 
			
		||||
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
print "static unsigned short CONF_type_default[256]={";
 | 
			
		||||
print "static unsigned short CONF_type_default[128]={";
 | 
			
		||||
 | 
			
		||||
for ($i=0; $i<256; $i++)
 | 
			
		||||
for ($i=0; $i<128; $i++)
 | 
			
		||||
	{
 | 
			
		||||
	print "\n\t" if ($i % 8) == 0;
 | 
			
		||||
	printf "0x%04X,",$V_def[$i];
 | 
			
		||||
	printf "0x%03X,",$V_def[$i];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
print "\n\t};\n\n";
 | 
			
		||||
 | 
			
		||||
print "static unsigned short CONF_type_win32[256]={";
 | 
			
		||||
print "static unsigned short CONF_type_win32[128]={";
 | 
			
		||||
 | 
			
		||||
for ($i=0; $i<256; $i++)
 | 
			
		||||
for ($i=0; $i<128; $i++)
 | 
			
		||||
	{
 | 
			
		||||
	print "\n\t" if ($i % 8) == 0;
 | 
			
		||||
	printf "0x%04X,",$V_w32[$i];
 | 
			
		||||
	printf "0x%03X,",$V_w32[$i];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
print "\n\t};\n\n";
 | 
			
		||||
 
 | 
			
		||||
@@ -101,8 +101,7 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
 | 
			
		||||
	"debug_malloc2",
 | 
			
		||||
	"dso",
 | 
			
		||||
	"dynlock",
 | 
			
		||||
	"engine",
 | 
			
		||||
#if CRYPTO_NUM_LOCKS != 30
 | 
			
		||||
#if CRYPTO_NUM_LOCKS != 29
 | 
			
		||||
# error "Inconsistency between crypto.h and cryptlib.c"
 | 
			
		||||
#endif
 | 
			
		||||
	};
 | 
			
		||||
@@ -231,7 +230,7 @@ void CRYPTO_destroy_dynlockid(int i)
 | 
			
		||||
	if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 | 
			
		||||
 		return;
 | 
			
		||||
		return;
 | 
			
		||||
		}
 | 
			
		||||
	pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
 | 
			
		||||
	if (pointer != NULL)
 | 
			
		||||
@@ -400,15 +399,16 @@ 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(type);
 | 
			
		||||
			= CRYPTO_get_dynlock_value(i);
 | 
			
		||||
 | 
			
		||||
		if (pointer && dynlock_lock_callback)
 | 
			
		||||
			{
 | 
			
		||||
			dynlock_lock_callback(mode, pointer, file, line);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		CRYPTO_destroy_dynlockid(type);
 | 
			
		||||
		CRYPTO_destroy_dynlockid(i);
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		if (locking_callback != NULL)
 | 
			
		||||
@@ -491,11 +491,3 @@ BOOL WINAPI DLLEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason,
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void OpenSSLDie(const char *file,int line,const char *assertion)
 | 
			
		||||
    {
 | 
			
		||||
    fprintf(stderr,"%s(%d): OpenSSL internal error, assertion failed: %s\n",
 | 
			
		||||
	    file,line,assertion);
 | 
			
		||||
    abort();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -89,14 +89,6 @@ extern "C" {
 | 
			
		||||
#define X509_CERT_DIR_EVP        "SSL_CERT_DIR"
 | 
			
		||||
#define X509_CERT_FILE_EVP       "SSL_CERT_FILE"
 | 
			
		||||
 | 
			
		||||
/* size of string represenations */
 | 
			
		||||
#define DECIMAL_SIZE(type)     ((sizeof(type)*8+2)/3+1)
 | 
			
		||||
#define HEX_SIZE(type)         ((sizeof(type)*2)
 | 
			
		||||
 | 
			
		||||
/* die if we have to */
 | 
			
		||||
void OpenSSLDie(const char *file,int line,const char *assertion);
 | 
			
		||||
#define die(e)	((e) ? (void)0 : OpenSSLDie(__FILE__, __LINE__, #e))
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ $! Define The Different Encryption Types.
 | 
			
		||||
$!
 | 
			
		||||
$ ENCRYPT_TYPES = "Basic,MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ -
 | 
			
		||||
		  "DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ -
 | 
			
		||||
		  "BN,RSA,DSA,DH,DSO,ENGINE,"+ -
 | 
			
		||||
		  "BN,RSA,DSA,DH,DSO,"+ -
 | 
			
		||||
		  "BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,"+ -
 | 
			
		||||
		  "EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
 | 
			
		||||
		  "CONF,TXT_DB,PKCS7,PKCS12,COMP"
 | 
			
		||||
@@ -206,9 +206,6 @@ $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl"
 | 
			
		||||
$ 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_aep,hw_sureware,"+ -
 | 
			
		||||
	"hw_ubsec,hw_keyclient"
 | 
			
		||||
$ LIB_BUFFER = "buffer,buf_err"
 | 
			
		||||
$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
 | 
			
		||||
	"bss_mem,bss_null,bss_fd,"+ -
 | 
			
		||||
@@ -626,7 +623,6 @@ $   WRITE SYS$OUTPUT "	",APPLICATION,".exe"
 | 
			
		||||
$!
 | 
			
		||||
$! Link The Program, Check To See If We Need To Link With RSAREF Or Not.
 | 
			
		||||
$!
 | 
			
		||||
$   ON ERROR THEN GOTO NEXT_APPLICATION
 | 
			
		||||
$   IF (RSAREF.EQS."TRUE")
 | 
			
		||||
$   THEN
 | 
			
		||||
$!
 | 
			
		||||
@@ -1198,9 +1194,7 @@ $     CC = "CC"
 | 
			
		||||
$     IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
 | 
			
		||||
	 THEN CC = "CC/DECC"
 | 
			
		||||
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
 | 
			
		||||
           "/NOLIST/PREFIX=ALL" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
           "/NOLIST/PREFIX=ALL/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
@@ -1232,8 +1226,7 @@ $	WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
 | 
			
		||||
$	EXIT
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
 | 
			
		||||
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
 | 
			
		||||
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST/INCLUDE=SYS$DISK:[]" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
$     CCDEFS = """VAXC""," + CCDEFS
 | 
			
		||||
$!
 | 
			
		||||
@@ -1265,8 +1258,7 @@ $!
 | 
			
		||||
$!    Use GNU C...
 | 
			
		||||
$!
 | 
			
		||||
$     CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
	   "/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
 
 | 
			
		||||
@@ -123,8 +123,7 @@ extern "C" {
 | 
			
		||||
#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_NUM_LOCKS		29
 | 
			
		||||
 | 
			
		||||
#define CRYPTO_LOCK		1
 | 
			
		||||
#define CRYPTO_UNLOCK		2
 | 
			
		||||
 
 | 
			
		||||
@@ -189,7 +189,7 @@ int des_enc_write(int fd,const void *buf,int len,des_key_schedule sched,
 | 
			
		||||
		  des_cblock *iv);
 | 
			
		||||
char *des_fcrypt(const char *buf,const char *salt, char *ret);
 | 
			
		||||
char *des_crypt(const char *buf,const char *salt);
 | 
			
		||||
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(_UWIN)
 | 
			
		||||
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT)
 | 
			
		||||
char *crypt(const char *buf,const char *salt);
 | 
			
		||||
#endif
 | 
			
		||||
void des_ofb_encrypt(const unsigned char *in,unsigned char *out,int numbits,
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ static unsigned const char cov_2char[64]={
 | 
			
		||||
void fcrypt_body(DES_LONG *out,des_key_schedule ks,
 | 
			
		||||
	DES_LONG Eswap0, DES_LONG Eswap1);
 | 
			
		||||
 | 
			
		||||
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(_DARWIN)
 | 
			
		||||
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT)
 | 
			
		||||
char *crypt(const char *buf, const char *salt)
 | 
			
		||||
	{
 | 
			
		||||
	return(des_crypt(buf, salt));
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@
 | 
			
		||||
 * [including the GNU Public Licence.]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(VXWORKS)
 | 
			
		||||
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
 | 
			
		||||
#include <openssl/opensslconf.h>
 | 
			
		||||
#ifdef OPENSSL_UNISTD
 | 
			
		||||
# include OPENSSL_UNISTD
 | 
			
		||||
@@ -133,12 +133,6 @@
 | 
			
		||||
#define SGTTY
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(VXWORKS)
 | 
			
		||||
#undef TERMIOS
 | 
			
		||||
#undef TERMIO
 | 
			
		||||
#undef SGTTY
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef TERMIOS
 | 
			
		||||
#include <termios.h>
 | 
			
		||||
#define TTY_STRUCT		struct termios
 | 
			
		||||
@@ -246,7 +240,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
 | 
			
		||||
	long status;
 | 
			
		||||
	unsigned short channel = 0;
 | 
			
		||||
#else
 | 
			
		||||
#if !defined(MSDOS) && !defined(VXWORKS)
 | 
			
		||||
#ifndef MSDOS
 | 
			
		||||
	TTY_STRUCT tty_orig,tty_new;
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
@@ -274,7 +268,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
 | 
			
		||||
#ifdef MSDOS
 | 
			
		||||
	if ((tty=fopen("con","r")) == NULL)
 | 
			
		||||
		tty=stdin;
 | 
			
		||||
#elif defined(MAC_OS_pre_X) || defined(VXWORKS)
 | 
			
		||||
#elif defined(MAC_OS_pre_X)
 | 
			
		||||
	tty=stdin;
 | 
			
		||||
#else
 | 
			
		||||
#ifndef MPE
 | 
			
		||||
@@ -372,7 +366,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
 | 
			
		||||
 | 
			
		||||
error:
 | 
			
		||||
	fprintf(stderr,"\n");
 | 
			
		||||
#if 0
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
	perror("fgets(tty)");
 | 
			
		||||
#endif
 | 
			
		||||
	/* What can we do if there is an error? */
 | 
			
		||||
 
 | 
			
		||||
@@ -101,39 +101,19 @@ dh_gen.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dh_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 | 
			
		||||
dh_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
dh_gen.o: ../cryptlib.h
 | 
			
		||||
dh_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
dh_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
dh_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
dh_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
dh_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
dh_key.o: ../../include/openssl/engine.h ../../include/openssl/err.h
 | 
			
		||||
dh_key.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
dh_key.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
dh_key.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
dh_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dh_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 | 
			
		||||
dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
dh_key.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
 | 
			
		||||
dh_key.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dh_key.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
 | 
			
		||||
dh_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
dh_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
dh_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
dh_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 | 
			
		||||
dh_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
dh_lib.o: ../cryptlib.h
 | 
			
		||||
 
 | 
			
		||||
@@ -115,11 +115,7 @@ struct dh_st
 | 
			
		||||
 | 
			
		||||
	int references;
 | 
			
		||||
	CRYPTO_EX_DATA ex_data;
 | 
			
		||||
#if 0
 | 
			
		||||
	DH_METHOD *meth;
 | 
			
		||||
#else
 | 
			
		||||
	struct engine_st *engine;
 | 
			
		||||
#endif
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
#define DH_GENERATOR_2		2
 | 
			
		||||
@@ -154,15 +150,10 @@ struct dh_st
 | 
			
		||||
 | 
			
		||||
DH_METHOD *DH_OpenSSL(void);
 | 
			
		||||
 | 
			
		||||
void DH_set_default_openssl_method(DH_METHOD *meth);
 | 
			
		||||
DH_METHOD *DH_get_default_openssl_method(void);
 | 
			
		||||
#if 0
 | 
			
		||||
void DH_set_default_method(DH_METHOD *meth);
 | 
			
		||||
DH_METHOD *DH_get_default_method(void);
 | 
			
		||||
DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth);
 | 
			
		||||
DH *DH_new_method(DH_METHOD *meth);
 | 
			
		||||
#else
 | 
			
		||||
int DH_set_method(DH *dh, struct engine_st *engine);
 | 
			
		||||
DH *DH_new_method(struct engine_st *engine);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
DH *	DH_new(void);
 | 
			
		||||
void	DH_free(DH *dh);
 | 
			
		||||
@@ -204,7 +195,6 @@ void ERR_load_DH_strings(void);
 | 
			
		||||
#define DH_F_DH_NEW					 105
 | 
			
		||||
 | 
			
		||||
/* Reason codes. */
 | 
			
		||||
#define DH_R_BAD_GENERATOR				 101
 | 
			
		||||
#define DH_R_NO_PRIVATE_VALUE				 100
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/* crypto/dh/dh_err.c */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1999-2002 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * 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
 | 
			
		||||
@@ -77,7 +77,6 @@ static ERR_STRING_DATA DH_str_functs[]=
 | 
			
		||||
 | 
			
		||||
static ERR_STRING_DATA DH_str_reasons[]=
 | 
			
		||||
	{
 | 
			
		||||
{DH_R_BAD_GENERATOR                      ,"bad generator"},
 | 
			
		||||
{DH_R_NO_PRIVATE_VALUE                   ,"no private value"},
 | 
			
		||||
{0,NULL}
 | 
			
		||||
	};
 | 
			
		||||
 
 | 
			
		||||
@@ -82,10 +82,7 @@
 | 
			
		||||
 * Since DH should be using a safe prime (both p and q are prime),
 | 
			
		||||
 * this generator function can take a very very long time to run.
 | 
			
		||||
 */
 | 
			
		||||
/* Actually there is no reason to insist that 'generator' be a generator.
 | 
			
		||||
 * It's just as OK (and in some sense better) to use a generator of the
 | 
			
		||||
 * order-q subgroup.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DH *DH_generate_parameters(int prime_len, int generator,
 | 
			
		||||
	     void (*callback)(int,int,void *), void *cb_arg)
 | 
			
		||||
	{
 | 
			
		||||
@@ -103,43 +100,30 @@ DH *DH_generate_parameters(int prime_len, int generator,
 | 
			
		||||
	t2 = BN_CTX_get(ctx);
 | 
			
		||||
	if (t1 == NULL || t2 == NULL) goto err;
 | 
			
		||||
	
 | 
			
		||||
	if (generator <= 1)
 | 
			
		||||
		{
 | 
			
		||||
		DHerr(DH_F_DH_GENERATE_PARAMETERS, DH_R_BAD_GENERATOR);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
	if (generator == DH_GENERATOR_2)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_set_word(t1,24)) goto err;
 | 
			
		||||
		if (!BN_set_word(t2,11)) goto err;
 | 
			
		||||
		BN_set_word(t1,24);
 | 
			
		||||
		BN_set_word(t2,11);
 | 
			
		||||
		g=2;
 | 
			
		||||
		}
 | 
			
		||||
#if 0 /* does not work for safe primes */
 | 
			
		||||
#ifdef undef  /* does not work for safe primes */
 | 
			
		||||
	else if (generator == DH_GENERATOR_3)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_set_word(t1,12)) goto err;
 | 
			
		||||
		if (!BN_set_word(t2,5)) goto err;
 | 
			
		||||
		BN_set_word(t1,12);
 | 
			
		||||
		BN_set_word(t2,5);
 | 
			
		||||
		g=3;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	else if (generator == DH_GENERATOR_5)
 | 
			
		||||
		{
 | 
			
		||||
		if (!BN_set_word(t1,10)) goto err;
 | 
			
		||||
		if (!BN_set_word(t2,3)) goto err;
 | 
			
		||||
		BN_set_word(t1,10);
 | 
			
		||||
		BN_set_word(t2,3);
 | 
			
		||||
		/* BN_set_word(t3,7); just have to miss
 | 
			
		||||
		 * out on these ones :-( */
 | 
			
		||||
		g=5;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		/* in the general case, don't worry if 'generator' is a
 | 
			
		||||
		 * generator or not: since we are using safe primes,
 | 
			
		||||
		 * it will generate either an order-q or an order-2q group,
 | 
			
		||||
		 * which both is OK */
 | 
			
		||||
		if (!BN_set_word(t1,2)) goto err;
 | 
			
		||||
		if (!BN_set_word(t2,1)) goto err;
 | 
			
		||||
		g=generator;
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
	p=BN_generate_prime(NULL,prime_len,1,t1,t2,callback,cb_arg);
 | 
			
		||||
	if (p == NULL) goto err;
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,6 @@
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/dh.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
static int generate_key(DH *dh);
 | 
			
		||||
static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
 | 
			
		||||
@@ -73,12 +72,12 @@ static int dh_finish(DH *dh);
 | 
			
		||||
 | 
			
		||||
int DH_generate_key(DH *dh)
 | 
			
		||||
	{
 | 
			
		||||
	return ENGINE_get_DH(dh->engine)->generate_key(dh);
 | 
			
		||||
	return dh->meth->generate_key(dh);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
 | 
			
		||||
	{
 | 
			
		||||
	return ENGINE_get_DH(dh->engine)->compute_key(key, pub_key, dh);
 | 
			
		||||
	return dh->meth->compute_key(key, pub_key, dh);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static DH_METHOD dh_ossl = {
 | 
			
		||||
@@ -133,14 +132,12 @@ 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;
 | 
			
		||||
	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 (!dh->meth->bn_mod_exp(dh, pub_key,dh->g,priv_key,dh->p,&ctx,mont)) goto err;
 | 
			
		||||
		
 | 
			
		||||
	dh->pub_key=pub_key;
 | 
			
		||||
	dh->priv_key=priv_key;
 | 
			
		||||
@@ -179,8 +176,7 @@ static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	mont=(BN_MONT_CTX *)dh->method_mont_p;
 | 
			
		||||
	if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, tmp, pub_key,
 | 
			
		||||
				dh->priv_key,dh->p,&ctx,mont))
 | 
			
		||||
	if (!dh->meth->bn_mod_exp(dh, tmp,pub_key,dh->priv_key,dh->p,&ctx,mont))
 | 
			
		||||
		{
 | 
			
		||||
		DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);
 | 
			
		||||
		goto err;
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,6 @@
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
#include <openssl/dh.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
@@ -68,32 +67,17 @@ static DH_METHOD *default_DH_method = NULL;
 | 
			
		||||
static int dh_meth_num = 0;
 | 
			
		||||
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;
 | 
			
		||||
 | 
			
		||||
void DH_set_default_openssl_method(DH_METHOD *meth)
 | 
			
		||||
void DH_set_default_method(DH_METHOD *meth)
 | 
			
		||||
{
 | 
			
		||||
	ENGINE *e;
 | 
			
		||||
	/* We'll need to notify the "openssl" ENGINE of this
 | 
			
		||||
	 * change too. We won't bother locking things down at
 | 
			
		||||
	 * our end as there was never any locking in these
 | 
			
		||||
	 * functions! */
 | 
			
		||||
	if(default_DH_method != meth)
 | 
			
		||||
		{
 | 
			
		||||
		default_DH_method = meth;
 | 
			
		||||
		e = ENGINE_by_id("openssl");
 | 
			
		||||
		if(e)
 | 
			
		||||
			{
 | 
			
		||||
			ENGINE_set_DH(e, meth);
 | 
			
		||||
			ENGINE_free(e);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	default_DH_method = meth;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DH_METHOD *DH_get_default_openssl_method(void)
 | 
			
		||||
DH_METHOD *DH_get_default_method(void)
 | 
			
		||||
{
 | 
			
		||||
	if(!default_DH_method) default_DH_method = DH_OpenSSL();
 | 
			
		||||
	return default_DH_method;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
 | 
			
		||||
{
 | 
			
		||||
        DH_METHOD *mtmp;
 | 
			
		||||
@@ -103,37 +87,14 @@ DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
 | 
			
		||||
        if (meth->init) meth->init(dh);
 | 
			
		||||
        return mtmp;
 | 
			
		||||
}
 | 
			
		||||
#else
 | 
			
		||||
int DH_set_method(DH *dh, ENGINE *engine)
 | 
			
		||||
{
 | 
			
		||||
	ENGINE *mtmp;
 | 
			
		||||
	DH_METHOD *meth;
 | 
			
		||||
	mtmp = dh->engine;
 | 
			
		||||
	meth = ENGINE_get_DH(mtmp);
 | 
			
		||||
	if (!ENGINE_init(engine))
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (meth->finish) meth->finish(dh);
 | 
			
		||||
	dh->engine= engine;
 | 
			
		||||
	meth = ENGINE_get_DH(engine);
 | 
			
		||||
	if (meth->init) meth->init(dh);
 | 
			
		||||
	/* SHOULD ERROR CHECK THIS!!! */
 | 
			
		||||
	ENGINE_finish(mtmp);
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
DH *DH_new(void)
 | 
			
		||||
{
 | 
			
		||||
	return DH_new_method(NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
DH *DH_new_method(DH_METHOD *meth)
 | 
			
		||||
#else
 | 
			
		||||
DH *DH_new_method(ENGINE *engine)
 | 
			
		||||
#endif
 | 
			
		||||
	{
 | 
			
		||||
	DH_METHOD *meth;
 | 
			
		||||
	DH *ret;
 | 
			
		||||
	ret=(DH *)OPENSSL_malloc(sizeof(DH));
 | 
			
		||||
 | 
			
		||||
@@ -142,17 +103,8 @@ DH *DH_new_method(ENGINE *engine)
 | 
			
		||||
		DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
	if(engine)
 | 
			
		||||
		ret->engine = engine;
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if((ret->engine=ENGINE_get_default_DH()) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			OPENSSL_free(ret);
 | 
			
		||||
			return NULL;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	meth = ENGINE_get_DH(ret->engine);
 | 
			
		||||
	if(meth) ret->meth = meth;
 | 
			
		||||
	else ret->meth = DH_get_default_method();
 | 
			
		||||
	ret->pad=0;
 | 
			
		||||
	ret->version=0;
 | 
			
		||||
	ret->p=NULL;
 | 
			
		||||
@@ -167,9 +119,9 @@ DH *DH_new_method(ENGINE *engine)
 | 
			
		||||
	ret->counter = NULL;
 | 
			
		||||
	ret->method_mont_p=NULL;
 | 
			
		||||
	ret->references = 1;
 | 
			
		||||
	ret->flags=meth->flags;
 | 
			
		||||
	ret->flags=ret->meth->flags;
 | 
			
		||||
	CRYPTO_new_ex_data(dh_meth,ret,&ret->ex_data);
 | 
			
		||||
	if ((meth->init != NULL) && !meth->init(ret))
 | 
			
		||||
	if ((ret->meth->init != NULL) && !ret->meth->init(ret))
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_free_ex_data(dh_meth,ret,&ret->ex_data);
 | 
			
		||||
		OPENSSL_free(ret);
 | 
			
		||||
@@ -180,7 +132,6 @@ DH *DH_new_method(ENGINE *engine)
 | 
			
		||||
 | 
			
		||||
void DH_free(DH *r)
 | 
			
		||||
	{
 | 
			
		||||
	DH_METHOD *meth;
 | 
			
		||||
	int i;
 | 
			
		||||
	if(r == NULL) return;
 | 
			
		||||
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
 | 
			
		||||
@@ -196,9 +147,7 @@ void DH_free(DH *r)
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	meth = ENGINE_get_DH(r->engine);
 | 
			
		||||
	if(meth->finish) meth->finish(r);
 | 
			
		||||
	ENGINE_finish(r->engine);
 | 
			
		||||
	if(r->meth->finish) r->meth->finish(r);
 | 
			
		||||
 | 
			
		||||
	CRYPTO_free_ex_data(dh_meth, r, &r->ex_data);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,6 @@
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
 | 
			
		||||
#ifdef NO_DH
 | 
			
		||||
int main(int argc, char *argv[])
 | 
			
		||||
@@ -113,16 +112,6 @@ int main(int argc, char *argv[])
 | 
			
		||||
	a=DH_generate_parameters(64,DH_GENERATOR_5,cb,out);
 | 
			
		||||
	if (a == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	if (!DH_check(a, &i)) goto err;
 | 
			
		||||
	if (i & DH_CHECK_P_NOT_PRIME)
 | 
			
		||||
		BIO_puts(out, "p value is not prime\n");
 | 
			
		||||
	if (i & DH_CHECK_P_NOT_SAFE_PRIME)
 | 
			
		||||
		BIO_puts(out, "p value is not a safe prime\n");
 | 
			
		||||
	if (i & DH_UNABLE_TO_CHECK_GENERATOR)
 | 
			
		||||
		BIO_puts(out, "unable to check the generator value\n");
 | 
			
		||||
	if (i & DH_NOT_SUITABLE_GENERATOR)
 | 
			
		||||
		BIO_puts(out, "the g value is not a generator\n");
 | 
			
		||||
 | 
			
		||||
	BIO_puts(out,"\np    =");
 | 
			
		||||
	BN_print(out,a->p);
 | 
			
		||||
	BIO_puts(out,"\ng    =");
 | 
			
		||||
@@ -181,8 +170,6 @@ int main(int argc, char *argv[])
 | 
			
		||||
	else
 | 
			
		||||
		ret=0;
 | 
			
		||||
err:
 | 
			
		||||
	ERR_print_errors_fp(stderr);
 | 
			
		||||
 | 
			
		||||
	if (abuf != NULL) OPENSSL_free(abuf);
 | 
			
		||||
	if (bbuf != NULL) OPENSSL_free(bbuf);
 | 
			
		||||
	if(b != NULL) DH_free(b);
 | 
			
		||||
 
 | 
			
		||||
@@ -116,75 +116,39 @@ dsa_key.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
 | 
			
		||||
dsa_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
dsa_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
 | 
			
		||||
dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
dsa_lib.o: ../cryptlib.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
dsa_ossl.o: ../../include/openssl/symhacks.h ../cryptlib.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
dsa_sign.o: ../../include/openssl/symhacks.h ../cryptlib.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/des.h ../../include/openssl/dh.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
 | 
			
		||||
dsa_vrf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
dsa_vrf.o: ../cryptlib.h
 | 
			
		||||
 
 | 
			
		||||
@@ -133,11 +133,7 @@ struct dsa_st
 | 
			
		||||
	char *method_mont_p;
 | 
			
		||||
	int references;
 | 
			
		||||
	CRYPTO_EX_DATA ex_data;
 | 
			
		||||
#if 0
 | 
			
		||||
	DSA_METHOD *meth;
 | 
			
		||||
#else
 | 
			
		||||
	struct engine_st *engine;
 | 
			
		||||
#endif
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
#define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \
 | 
			
		||||
@@ -163,20 +159,12 @@ int	DSA_do_verify(const unsigned char *dgst,int dgst_len,
 | 
			
		||||
 | 
			
		||||
DSA_METHOD *DSA_OpenSSL(void);
 | 
			
		||||
 | 
			
		||||
void        DSA_set_default_openssl_method(DSA_METHOD *);
 | 
			
		||||
DSA_METHOD *DSA_get_default_openssl_method(void);
 | 
			
		||||
#if 0
 | 
			
		||||
void        DSA_set_default_method(DSA_METHOD *);
 | 
			
		||||
DSA_METHOD *DSA_get_default_method(void);
 | 
			
		||||
DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *);
 | 
			
		||||
#else
 | 
			
		||||
int DSA_set_method(DSA *dsa, struct engine_st *engine);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
DSA *	DSA_new(void);
 | 
			
		||||
#if 0
 | 
			
		||||
DSA *	DSA_new_method(DSA_METHOD *meth);
 | 
			
		||||
#else
 | 
			
		||||
DSA *	DSA_new_method(struct engine_st *engine);
 | 
			
		||||
#endif
 | 
			
		||||
int	DSA_size(DSA *);
 | 
			
		||||
	/* next 4 return -1 on error */
 | 
			
		||||
int	DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp);
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,6 @@ DSA_SIG *d2i_DSA_SIG(DSA_SIG **a, unsigned char **pp, long length)
 | 
			
		||||
	if ((ret->s=BN_bin2bn(bs->data,bs->length,ret->s)) == NULL)
 | 
			
		||||
		goto err_bn;
 | 
			
		||||
	M_ASN1_BIT_STRING_free(bs);
 | 
			
		||||
	bs = NULL;
 | 
			
		||||
	M_ASN1_D2I_Finish_2(a);
 | 
			
		||||
 | 
			
		||||
err_bn:
 | 
			
		||||
 
 | 
			
		||||
@@ -63,7 +63,6 @@
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
#include <openssl/dsa.h>
 | 
			
		||||
#include <openssl/asn1.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
 | 
			
		||||
 | 
			
		||||
@@ -71,26 +70,12 @@ static DSA_METHOD *default_DSA_method = NULL;
 | 
			
		||||
static int dsa_meth_num = 0;
 | 
			
		||||
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;
 | 
			
		||||
 | 
			
		||||
void DSA_set_default_openssl_method(DSA_METHOD *meth)
 | 
			
		||||
void DSA_set_default_method(DSA_METHOD *meth)
 | 
			
		||||
{
 | 
			
		||||
	ENGINE *e;
 | 
			
		||||
	/* We'll need to notify the "openssl" ENGINE of this
 | 
			
		||||
	 * change too. We won't bother locking things down at
 | 
			
		||||
	 * our end as there was never any locking in these
 | 
			
		||||
	 * functions! */
 | 
			
		||||
	if(default_DSA_method != meth)
 | 
			
		||||
		{
 | 
			
		||||
		default_DSA_method = meth;
 | 
			
		||||
		e = ENGINE_by_id("openssl");
 | 
			
		||||
		if(e)
 | 
			
		||||
			{
 | 
			
		||||
			ENGINE_set_DSA(e, meth);
 | 
			
		||||
			ENGINE_free(e);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	default_DSA_method = meth;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DSA_METHOD *DSA_get_default_openssl_method(void)
 | 
			
		||||
DSA_METHOD *DSA_get_default_method(void)
 | 
			
		||||
{
 | 
			
		||||
	if(!default_DSA_method) default_DSA_method = DSA_OpenSSL();
 | 
			
		||||
	return default_DSA_method;
 | 
			
		||||
@@ -101,7 +86,6 @@ DSA *DSA_new(void)
 | 
			
		||||
	return DSA_new_method(NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
 | 
			
		||||
{
 | 
			
		||||
        DSA_METHOD *mtmp;
 | 
			
		||||
@@ -111,33 +95,10 @@ DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
 | 
			
		||||
        if (meth->init) meth->init(dsa);
 | 
			
		||||
        return mtmp;
 | 
			
		||||
}
 | 
			
		||||
#else
 | 
			
		||||
int DSA_set_method(DSA *dsa, ENGINE *engine)
 | 
			
		||||
	{
 | 
			
		||||
	ENGINE *mtmp;
 | 
			
		||||
	DSA_METHOD *meth;
 | 
			
		||||
	mtmp = dsa->engine;
 | 
			
		||||
	meth = ENGINE_get_DSA(mtmp);
 | 
			
		||||
	if (!ENGINE_init(engine))
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (meth->finish) meth->finish(dsa);
 | 
			
		||||
	dsa->engine = engine;
 | 
			
		||||
	meth = ENGINE_get_DSA(engine);
 | 
			
		||||
	if (meth->init) meth->init(dsa);
 | 
			
		||||
	/* SHOULD ERROR CHECK THIS!!! */
 | 
			
		||||
	ENGINE_finish(mtmp);
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
DSA *DSA_new_method(DSA_METHOD *meth)
 | 
			
		||||
#else
 | 
			
		||||
DSA *DSA_new_method(ENGINE *engine)
 | 
			
		||||
#endif
 | 
			
		||||
	{
 | 
			
		||||
	DSA_METHOD *meth;
 | 
			
		||||
	DSA *ret;
 | 
			
		||||
 | 
			
		||||
	ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
 | 
			
		||||
@@ -146,17 +107,8 @@ DSA *DSA_new_method(ENGINE *engine)
 | 
			
		||||
		DSAerr(DSA_F_DSA_NEW,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return(NULL);
 | 
			
		||||
		}
 | 
			
		||||
	if(engine)
 | 
			
		||||
		ret->engine = engine;
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		if((ret->engine=ENGINE_get_default_DSA()) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			OPENSSL_free(ret);
 | 
			
		||||
			return NULL;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	meth = ENGINE_get_DSA(ret->engine);
 | 
			
		||||
	if(meth) ret->meth = meth;
 | 
			
		||||
	else ret->meth = DSA_get_default_method();
 | 
			
		||||
	ret->pad=0;
 | 
			
		||||
	ret->version=0;
 | 
			
		||||
	ret->write_params=1;
 | 
			
		||||
@@ -172,9 +124,9 @@ DSA *DSA_new_method(ENGINE *engine)
 | 
			
		||||
	ret->method_mont_p=NULL;
 | 
			
		||||
 | 
			
		||||
	ret->references=1;
 | 
			
		||||
	ret->flags=meth->flags;
 | 
			
		||||
	ret->flags=ret->meth->flags;
 | 
			
		||||
	CRYPTO_new_ex_data(dsa_meth,ret,&ret->ex_data);
 | 
			
		||||
	if ((meth->init != NULL) && !meth->init(ret))
 | 
			
		||||
	if ((ret->meth->init != NULL) && !ret->meth->init(ret))
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_free_ex_data(dsa_meth,ret,&ret->ex_data);
 | 
			
		||||
		OPENSSL_free(ret);
 | 
			
		||||
@@ -186,7 +138,6 @@ DSA *DSA_new_method(ENGINE *engine)
 | 
			
		||||
 | 
			
		||||
void DSA_free(DSA *r)
 | 
			
		||||
	{
 | 
			
		||||
	DSA_METHOD *meth;
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	if (r == NULL) return;
 | 
			
		||||
@@ -204,9 +155,7 @@ void DSA_free(DSA *r)
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	meth = ENGINE_get_DSA(r->engine);
 | 
			
		||||
	if(meth->finish) meth->finish(r);
 | 
			
		||||
	ENGINE_finish(r->engine);
 | 
			
		||||
	if(r->meth->finish) r->meth->finish(r);
 | 
			
		||||
 | 
			
		||||
	CRYPTO_free_ex_data(dsa_meth, r, &r->ex_data);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,6 @@
 | 
			
		||||
#include <openssl/dsa.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/asn1.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
 | 
			
		||||
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
 | 
			
		||||
@@ -202,7 +201,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/* Compute r = (g^k mod p) mod q */
 | 
			
		||||
	if (!ENGINE_get_DSA(dsa->engine)->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
 | 
			
		||||
	if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
 | 
			
		||||
		(BN_MONT_CTX *)dsa->method_mont_p)) goto err;
 | 
			
		||||
	if (!BN_mod(r,r,dsa->q,ctx)) goto err;
 | 
			
		||||
 | 
			
		||||
@@ -291,7 +290,7 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
 | 
			
		||||
	if (!BN_mod(&u1,&u1,dsa->q,ctx)) goto err;
 | 
			
		||||
#else
 | 
			
		||||
	{
 | 
			
		||||
	if (!ENGINE_get_DSA(dsa->engine)->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2,
 | 
			
		||||
	if (!dsa->meth->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2,
 | 
			
		||||
						dsa->p,ctx,mont)) goto err;
 | 
			
		||||
	/* BN_copy(&u1,&t1); */
 | 
			
		||||
	/* let u1 = u1 mod q */
 | 
			
		||||
 
 | 
			
		||||
@@ -64,11 +64,10 @@
 | 
			
		||||
#include <openssl/dsa.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/asn1.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
 | 
			
		||||
	{
 | 
			
		||||
	return ENGINE_get_DSA(dsa->engine)->dsa_do_sign(dgst, dlen, dsa);
 | 
			
		||||
	return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
 | 
			
		||||
@@ -88,6 +87,6 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
 | 
			
		||||
 | 
			
		||||
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 | 
			
		||||
	{
 | 
			
		||||
	return ENGINE_get_DSA(dsa->engine)->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
 | 
			
		||||
	return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -65,12 +65,11 @@
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/asn1.h>
 | 
			
		||||
#include <openssl/asn1_mac.h>
 | 
			
		||||
#include <openssl/engine.h>
 | 
			
		||||
 | 
			
		||||
int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
 | 
			
		||||
		  DSA *dsa)
 | 
			
		||||
	{
 | 
			
		||||
	return ENGINE_get_DSA(dsa->engine)->dsa_do_verify(dgst, dgst_len, sig, dsa);
 | 
			
		||||
	return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* data has already been hashed (probably with SHA or SHA-1). */
 | 
			
		||||
 
 | 
			
		||||
@@ -112,7 +112,7 @@ DSO_METHOD *DSO_METHOD_dlfcn(void)
 | 
			
		||||
 * as we don't have autoconf yet, I'm implementing a hack that could
 | 
			
		||||
 * be hacked further relatively easily to deal with cases as we find
 | 
			
		||||
 * them. Initially this is to cope with OpenBSD. */
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__NetBSD__)
 | 
			
		||||
#ifdef __OpenBSD__
 | 
			
		||||
#	ifdef DL_LAZY
 | 
			
		||||
#		define DLOPEN_FLAG DL_LAZY
 | 
			
		||||
#	else
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user