Compare commits
	
		
			516 Commits
		
	
	
		
			OpenSSL_1_
			...
			OpenSSL_1_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					6b72417a00 | ||
| 
						 | 
					aabbe99fcb | ||
| 
						 | 
					8011cd56e3 | ||
| 
						 | 
					d3152655d5 | ||
| 
						 | 
					006cd7083f | ||
| 
						 | 
					bc8923b1ec | ||
| 
						 | 
					1632ef7448 | ||
| 
						 | 
					f1f4fbde2a | ||
| 
						 | 
					1854c48005 | ||
| 
						 | 
					ebda73f867 | ||
| 
						 | 
					bcc311668e | ||
| 
						 | 
					1dd26414df | ||
| 
						 | 
					056389eb1c | ||
| 
						 | 
					a07856a08d | ||
| 
						 | 
					19ce768c6b | ||
| 
						 | 
					aaed77c55e | ||
| 
						 | 
					49270d0431 | ||
| 
						 | 
					673c42b238 | ||
| 
						 | 
					5541b18ba8 | ||
| 
						 | 
					28e117f49f | ||
| 
						 | 
					46bfc05480 | ||
| 
						 | 
					427a37ca3f | ||
| 
						 | 
					39ae3b338f | ||
| 
						 | 
					48f5b3efce | ||
| 
						 | 
					f8dc000699 | ||
| 
						 | 
					bf8d6f9ab8 | ||
| 
						 | 
					17e844a450 | ||
| 
						 | 
					8ca7d12430 | ||
| 
						 | 
					67b9c82ea2 | ||
| 
						 | 
					a6f5b991eb | ||
| 
						 | 
					756587dcb9 | ||
| 
						 | 
					0a084f7b3a | ||
| 
						 | 
					da0a95b23a | ||
| 
						 | 
					599fe418a1 | ||
| 
						 | 
					4519e7b839 | ||
| 
						 | 
					4659b53e7d | ||
| 
						 | 
					dc22495d35 | ||
| 
						 | 
					ab0d964259 | ||
| 
						 | 
					dac3654e2d | ||
| 
						 | 
					989d87cb1a | ||
| 
						 | 
					d6934a02b5 | ||
| 
						 | 
					f9986e9abf | ||
| 
						 | 
					1f5e321ec1 | ||
| 
						 | 
					b6adb6ef58 | ||
| 
						 | 
					bfdaf45141 | ||
| 
						 | 
					69526a354d | ||
| 
						 | 
					778f2b648c | ||
| 
						 | 
					2223317bef | ||
| 
						 | 
					b107586c0c | ||
| 
						 | 
					d544755389 | ||
| 
						 | 
					88398e9ba3 | ||
| 
						 | 
					15c1ac03c8 | ||
| 
						 | 
					c3c6fc7855 | ||
| 
						 | 
					4d8cca8a7e | ||
| 
						 | 
					d61be85581 | ||
| 
						 | 
					9e456a8537 | ||
| 
						 | 
					f179e2b899 | ||
| 
						 | 
					6a60b41431 | ||
| 
						 | 
					c6a47f988c | ||
| 
						 | 
					d0666f289a | ||
| 
						 | 
					d8afda60a9 | ||
| 
						 | 
					804ab36df6 | ||
| 
						 | 
					a41d5174e2 | ||
| 
						 | 
					9c5d953a07 | ||
| 
						 | 
					7b7b18c57e | ||
| 
						 | 
					8eb094b946 | ||
| 
						 | 
					7fa18a63cb | ||
| 
						 | 
					90600a5e3b | ||
| 
						 | 
					23f5908ac7 | ||
| 
						 | 
					e622237d12 | ||
| 
						 | 
					f0816174d2 | ||
| 
						 | 
					057444f844 | ||
| 
						 | 
					725c5f1ad3 | ||
| 
						 | 
					9c8dc84ac1 | ||
| 
						 | 
					e3899ababb | ||
| 
						 | 
					3fc880ac5d | ||
| 
						 | 
					602b2790ca | ||
| 
						 | 
					b05a3ad765 | ||
| 
						 | 
					3d8f4f23af | ||
| 
						 | 
					a74bee5fc7 | ||
| 
						 | 
					55c9e24875 | ||
| 
						 | 
					ebe221948d | ||
| 
						 | 
					b2d951e423 | ||
| 
						 | 
					c5993d10a8 | ||
| 
						 | 
					5be1ae28ef | ||
| 
						 | 
					96db9023b8 | ||
| 
						 | 
					0d7717fc9c | ||
| 
						 | 
					aba7600029 | ||
| 
						 | 
					00acdfbf98 | ||
| 
						 | 
					51624dbdae | ||
| 
						 | 
					9e29df0027 | ||
| 
						 | 
					f54167d1dc | ||
| 
						 | 
					6042582b62 | ||
| 
						 | 
					50522642a0 | ||
| 
						 | 
					bfc3424d1f | ||
| 
						 | 
					1c65936882 | ||
| 
						 | 
					40acdb192e | ||
| 
						 | 
					4b7a4ba29c | ||
| 
						 | 
					e0660c6257 | ||
| 
						 | 
					b4ada742d1 | ||
| 
						 | 
					a93d952cd4 | ||
| 
						 | 
					5b56fec6f5 | ||
| 
						 | 
					32171e4e07 | ||
| 
						 | 
					48e6edabed | ||
| 
						 | 
					069607124d | ||
| 
						 | 
					caf55bfacf | ||
| 
						 | 
					ce3631015e | ||
| 
						 | 
					3ae1b53496 | ||
| 
						 | 
					79bb00534d | ||
| 
						 | 
					c4b16ddc8f | ||
| 
						 | 
					deb3b08ff2 | ||
| 
						 | 
					b45b3efd5d | ||
| 
						 | 
					e420060ac9 | ||
| 
						 | 
					d8ec8a4a65 | ||
| 
						 | 
					040ed7b4d0 | ||
| 
						 | 
					c76e5b08a1 | ||
| 
						 | 
					0071215832 | ||
| 
						 | 
					4a55631e4d | ||
| 
						 | 
					19a68574a9 | ||
| 
						 | 
					f21e6b6ecb | ||
| 
						 | 
					e1549a01c7 | ||
| 
						 | 
					765be74d24 | ||
| 
						 | 
					9614d2c676 | ||
| 
						 | 
					ad03c71ea1 | ||
| 
						 | 
					4eedf86a16 | ||
| 
						 | 
					eb85ee9a88 | ||
| 
						 | 
					fa2026dc88 | ||
| 
						 | 
					fe08007399 | ||
| 
						 | 
					e3ebdcff12 | ||
| 
						 | 
					cb10cf1224 | ||
| 
						 | 
					c0dd71c97c | ||
| 
						 | 
					51478be956 | ||
| 
						 | 
					a7304e4b98 | ||
| 
						 | 
					0d8776344c | ||
| 
						 | 
					197e0ea817 | ||
| 
						 | 
					c776a3f398 | ||
| 
						 | 
					25c9fa6026 | ||
| 
						 | 
					d2dc33d57c | ||
| 
						 | 
					f3dcc8411e | ||
| 
						 | 
					1c2c5e402a | ||
| 
						 | 
					34628967f1 | ||
| 
						 | 
					a6c62f0c25 | ||
| 
						 | 
					ca989269a2 | ||
| 
						 | 
					2ec4181ba9 | ||
| 
						 | 
					0294b2be5f | ||
| 
						 | 
					f1068a1ab7 | ||
| 
						 | 
					cadde467a8 | ||
| 
						 | 
					c2bdcba347 | ||
| 
						 | 
					60df657b3a | ||
| 
						 | 
					17a2d0801f | ||
| 
						 | 
					accb3007ac | ||
| 
						 | 
					b13dff6141 | ||
| 
						 | 
					4ade6a8ca4 | ||
| 
						 | 
					00fadef414 | ||
| 
						 | 
					7ed244a0b3 | ||
| 
						 | 
					e94a23876c | ||
| 
						 | 
					041f681943 | ||
| 
						 | 
					afec9f57da | ||
| 
						 | 
					0ec1a77891 | ||
| 
						 | 
					62c2b6d944 | ||
| 
						 | 
					5b98979712 | ||
| 
						 | 
					9abbf5cce7 | ||
| 
						 | 
					ddfe486e4c | ||
| 
						 | 
					834d30bc63 | ||
| 
						 | 
					e26faa9e0c | ||
| 
						 | 
					025f7dbdd1 | ||
| 
						 | 
					44f4934bde | ||
| 
						 | 
					453ca706cc | ||
| 
						 | 
					5e1ff664f9 | ||
| 
						 | 
					833a896681 | ||
| 
						 | 
					34e43b909f | ||
| 
						 | 
					62036c6fc3 | ||
| 
						 | 
					68dd8512b7 | ||
| 
						 | 
					bbf9f3c654 | ||
| 
						 | 
					2583270191 | ||
| 
						 | 
					3da721dac9 | ||
| 
						 | 
					eb22b7ec75 | ||
| 
						 | 
					b93916149d | ||
| 
						 | 
					82f42a1d2e | ||
| 
						 | 
					a4870de5aa | ||
| 
						 | 
					39aabe59c8 | ||
| 
						 | 
					f4c93b46ed | ||
| 
						 | 
					4af793036f | ||
| 
						 | 
					13bca90ac5 | ||
| 
						 | 
					c9a6ddafc5 | ||
| 
						 | 
					f4a51970d2 | ||
| 
						 | 
					937f125efc | ||
| 
						 | 
					4b61f6d2a6 | ||
| 
						 | 
					d5bff72615 | ||
| 
						 | 
					3b4be0018b | ||
| 
						 | 
					125c2ed8a3 | ||
| 
						 | 
					09da95542a | ||
| 
						 | 
					cc53b38574 | ||
| 
						 | 
					0aeeae0c9c | ||
| 
						 | 
					00c991f028 | ||
| 
						 | 
					55856a7b74 | ||
| 
						 | 
					83a3af9f4e | ||
| 
						 | 
					76bf0cf27c | ||
| 
						 | 
					7cf0529b52 | ||
| 
						 | 
					6c03af135b | ||
| 
						 | 
					5cd1aa4f15 | ||
| 
						 | 
					04b80f4003 | ||
| 
						 | 
					591c55a981 | ||
| 
						 | 
					cd2693862b | ||
| 
						 | 
					25370e93c6 | ||
| 
						 | 
					cdb6c48445 | ||
| 
						 | 
					04b727b4dd | ||
| 
						 | 
					cbd93a0636 | ||
| 
						 | 
					b9e84f007f | ||
| 
						 | 
					29a546720b | ||
| 
						 | 
					0e9dd387ea | ||
| 
						 | 
					79dabcc137 | ||
| 
						 | 
					944bc29f90 | ||
| 
						 | 
					03e1b3a153 | ||
| 
						 | 
					9c95ff968a | ||
| 
						 | 
					96b680f210 | ||
| 
						 | 
					9ab3ce1246 | ||
| 
						 | 
					3972dbe462 | ||
| 
						 | 
					85615e33e5 | ||
| 
						 | 
					f4cfc3444a | ||
| 
						 | 
					24f599af21 | ||
| 
						 | 
					bca0d7fdb5 | ||
| 
						 | 
					bc4ae2cb0b | ||
| 
						 | 
					ef4b9f001a | ||
| 
						 | 
					08f8933fa3 | ||
| 
						 | 
					41958376b5 | ||
| 
						 | 
					9fe4603b82 | ||
| 
						 | 
					147dbb2fe3 | ||
| 
						 | 
					cbf9b4aed3 | ||
| 
						 | 
					625a55324f | ||
| 
						 | 
					3151e328e0 | ||
| 
						 | 
					46ebd9e3bb | ||
| 
						 | 
					f66db68e1f | ||
| 
						 | 
					0c4b72e9c0 | ||
| 
						 | 
					f88dbb8385 | ||
| 
						 | 
					1113fc31ba | ||
| 
						 | 
					0898147090 | ||
| 
						 | 
					4d8da30fc1 | ||
| 
						 | 
					579f3a631e | ||
| 
						 | 
					47061af106 | ||
| 
						 | 
					13e225300f | ||
| 
						 | 
					26bc56d014 | ||
| 
						 | 
					496681cd51 | ||
| 
						 | 
					746c6f3a53 | ||
| 
						 | 
					8545f73b89 | ||
| 
						 | 
					32cc2479b4 | ||
| 
						 | 
					f306b87d76 | ||
| 
						 | 
					41cf07f0ec | ||
| 
						 | 
					62f4033381 | ||
| 
						 | 
					f9f6a8f96c | ||
| 
						 | 
					df0d93564e | ||
| 
						 | 
					0d589ac150 | ||
| 
						 | 
					35d732fc2e | ||
| 
						 | 
					896ddb9851 | ||
| 
						 | 
					e630b3c218 | ||
| 
						 | 
					f1ca56a69f | ||
| 
						 | 
					529d27ea47 | ||
| 
						 | 
					b2226c6c83 | ||
| 
						 | 
					024de2174b | ||
| 
						 | 
					125093b59f | ||
| 
						 | 
					f3e99ea072 | ||
| 
						 | 
					8bfd4c659f | ||
| 
						 | 
					ec07246a08 | ||
| 
						 | 
					04e45b52ee | ||
| 
						 | 
					d5371324d9 | ||
| 
						 | 
					36260233e7 | ||
| 
						 | 
					cab13fc847 | ||
| 
						 | 
					34ab3c8c71 | ||
| 
						 | 
					25c93fd240 | ||
| 
						 | 
					428c1064c3 | ||
| 
						 | 
					81ce0e14e7 | ||
| 
						 | 
					b908e88ec1 | ||
| 
						 | 
					62e4506a7d | ||
| 
						 | 
					014265eb02 | ||
| 
						 | 
					9f27de170d | ||
| 
						 | 
					6cb19b7681 | ||
| 
						 | 
					e130841bcc | ||
| 
						 | 
					2ee798880a | ||
| 
						 | 
					ffcf4c6164 | ||
| 
						 | 
					b286a96811 | ||
| 
						 | 
					2a2df2e9f2 | ||
| 
						 | 
					15481c5e42 | ||
| 
						 | 
					366b60b9da | ||
| 
						 | 
					4782444a35 | ||
| 
						 | 
					8a17e161d1 | ||
| 
						 | 
					72f27cd2df | ||
| 
						 | 
					3b3674ae58 | ||
| 
						 | 
					9d75e765bc | ||
| 
						 | 
					bf07bd4d61 | ||
| 
						 | 
					296cc7f4b8 | ||
| 
						 | 
					3d92984689 | ||
| 
						 | 
					51447d5db5 | ||
| 
						 | 
					1dcf520fe2 | ||
| 
						 | 
					fca84dabe6 | ||
| 
						 | 
					3ea1e13569 | ||
| 
						 | 
					dd6639bd3a | ||
| 
						 | 
					bee0550397 | ||
| 
						 | 
					fc57c58c81 | ||
| 
						 | 
					5bb6d96558 | ||
| 
						 | 
					28e1bd35bd | ||
| 
						 | 
					dd83cc298d | ||
| 
						 | 
					ea00598596 | ||
| 
						 | 
					a650314f72 | ||
| 
						 | 
					54fdc39a08 | ||
| 
						 | 
					7dc98a62b2 | ||
| 
						 | 
					f20ba1c9bb | ||
| 
						 | 
					7c3562947a | ||
| 
						 | 
					eb3a3911fc | ||
| 
						 | 
					540f7c75ef | ||
| 
						 | 
					d6342aab08 | ||
| 
						 | 
					e7b85bc402 | ||
| 
						 | 
					07eaaab2f6 | ||
| 
						 | 
					96f7fafa24 | ||
| 
						 | 
					487a0df700 | ||
| 
						 | 
					09ef5f6258 | ||
| 
						 | 
					bcc0e4ca7c | ||
| 
						 | 
					caac8fefdc | ||
| 
						 | 
					353e845120 | ||
| 
						 | 
					d1451f18d9 | ||
| 
						 | 
					c3a5b7b82a | ||
| 
						 | 
					70d91d60bc | ||
| 
						 | 
					bc78883017 | ||
| 
						 | 
					f929f201fb | ||
| 
						 | 
					554cf97f03 | ||
| 
						 | 
					48ccbeefda | ||
| 
						 | 
					7a217076d9 | ||
| 
						 | 
					0720bf7df1 | ||
| 
						 | 
					9d6727781d | ||
| 
						 | 
					12c1621523 | ||
| 
						 | 
					f9b48d60f2 | ||
| 
						 | 
					5c29127666 | ||
| 
						 | 
					78d767f5ec | ||
| 
						 | 
					c8b979e929 | ||
| 
						 | 
					2beaa91ca7 | ||
| 
						 | 
					efa288ceac | ||
| 
						 | 
					ad3bbd4a16 | ||
| 
						 | 
					73913443a5 | ||
| 
						 | 
					e133ff7190 | ||
| 
						 | 
					25da47c3c8 | ||
| 
						 | 
					4dc40f5eec | ||
| 
						 | 
					a1a37575f0 | ||
| 
						 | 
					c64c0e03d3 | ||
| 
						 | 
					e1e882a368 | ||
| 
						 | 
					36b0719793 | ||
| 
						 | 
					7655044dd3 | ||
| 
						 | 
					58fdd30664 | ||
| 
						 | 
					7175dbaeba | ||
| 
						 | 
					af454b5bb0 | ||
| 
						 | 
					5b2bbf37fa | ||
| 
						 | 
					6321ac9e15 | ||
| 
						 | 
					eeca72f71e | ||
| 
						 | 
					6e164e5c3d | ||
| 
						 | 
					1b452133ae | ||
| 
						 | 
					d9c34505e5 | ||
| 
						 | 
					f9885acc8c | ||
| 
						 | 
					fa9df48401 | ||
| 
						 | 
					d414a5a0f0 | ||
| 
						 | 
					9eb4460e68 | ||
| 
						 | 
					6984d16671 | ||
| 
						 | 
					5b9d0995a1 | ||
| 
						 | 
					7ad8e1fc4e | ||
| 
						 | 
					c9b31189a9 | ||
| 
						 | 
					c76b7a1a82 | ||
| 
						 | 
					c940e07014 | ||
| 
						 | 
					88be4ebfbc | ||
| 
						 | 
					effa47b80a | ||
| 
						 | 
					067400b16e | ||
| 
						 | 
					748628ced0 | ||
| 
						 | 
					6791060eae | ||
| 
						 | 
					502dfeb8de | ||
| 
						 | 
					5bbed29518 | ||
| 
						 | 
					2f2d33f470 | ||
| 
						 | 
					be60a3feaa | ||
| 
						 | 
					e504a829a0 | ||
| 
						 | 
					0d829f6681 | ||
| 
						 | 
					d9540579c5 | ||
| 
						 | 
					ecf963b80d | ||
| 
						 | 
					7fc6d35be0 | ||
| 
						 | 
					e7d2a37158 | ||
| 
						 | 
					531c6fc8f3 | ||
| 
						 | 
					e011d0a3c4 | ||
| 
						 | 
					8d5505d099 | ||
| 
						 | 
					d36e0ee460 | ||
| 
						 | 
					143619ccf6 | ||
| 
						 | 
					9f339d75b5 | ||
| 
						 | 
					28583660fb | ||
| 
						 | 
					dedfe959dd | ||
| 
						 | 
					4d936ace08 | ||
| 
						 | 
					89bd25eb26 | ||
| 
						 | 
					4a1cf50187 | ||
| 
						 | 
					32e12316e5 | ||
| 
						 | 
					ad7b24f145 | ||
| 
						 | 
					c2770c0e0e | ||
| 
						 | 
					371056f2b9 | ||
| 
						 | 
					2d613908e8 | ||
| 
						 | 
					18fb1fae08 | ||
| 
						 | 
					39ef161c72 | ||
| 
						 | 
					a7612c5066 | ||
| 
						 | 
					6cbae10b5e | ||
| 
						 | 
					ebe81134c0 | ||
| 
						 | 
					a1d573e282 | ||
| 
						 | 
					e959e24b47 | ||
| 
						 | 
					3f98d7c0b5 | ||
| 
						 | 
					d2f950c984 | ||
| 
						 | 
					63e8f16737 | ||
| 
						 | 
					9bf5fd894f | ||
| 
						 | 
					6296729fae | ||
| 
						 | 
					67d216801b | ||
| 
						 | 
					0a5575f3f6 | ||
| 
						 | 
					418044cbab | ||
| 
						 | 
					8c67b13407 | ||
| 
						 | 
					2a477ccf0b | ||
| 
						 | 
					c34137bef9 | ||
| 
						 | 
					914d91c5b3 | ||
| 
						 | 
					e733dea3ce | ||
| 
						 | 
					78c5d2a9bb | ||
| 
						 | 
					3bf4e14cc3 | ||
| 
						 | 
					d68d160cb7 | ||
| 
						 | 
					202cb42fbb | ||
| 
						 | 
					49f6cb968f | ||
| 
						 | 
					07e120b7da | ||
| 
						 | 
					f3dcae15ac | ||
| 
						 | 
					25ec498dc7 | ||
| 
						 | 
					9cc42cb091 | ||
| 
						 | 
					bcf9cf89e7 | ||
| 
						 | 
					f0729fc3e0 | ||
| 
						 | 
					8186c00ef3 | ||
| 
						 | 
					c0b31ccb87 | ||
| 
						 | 
					267c950c5f | ||
| 
						 | 
					ce1605b508 | ||
| 
						 | 
					66fdb1c0d4 | ||
| 
						 | 
					25bfdca16a | ||
| 
						 | 
					9c284f9651 | ||
| 
						 | 
					6d78c381f6 | ||
| 
						 | 
					784e2080df | ||
| 
						 | 
					70505bc334 | ||
| 
						 | 
					8e8b247341 | ||
| 
						 | 
					a8595879ec | ||
| 
						 | 
					33a688e806 | ||
| 
						 | 
					5c2bfad9b4 | ||
| 
						 | 
					250f979237 | ||
| 
						 | 
					b527b6e8ff | ||
| 
						 | 
					a54ce007e6 | ||
| 
						 | 
					4ed1f3490e | ||
| 
						 | 
					0a082e9b37 | ||
| 
						 | 
					236a99a409 | ||
| 
						 | 
					04b4363ec8 | ||
| 
						 | 
					37ebc20093 | ||
| 
						 | 
					cef781cc87 | ||
| 
						 | 
					08e4c7a967 | ||
| 
						 | 
					697e4edcad | ||
| 
						 | 
					b26297ca51 | ||
| 
						 | 
					6ca7dba0cf | ||
| 
						 | 
					f1fa05b407 | ||
| 
						 | 
					02e22c35fe | ||
| 
						 | 
					b935714237 | ||
| 
						 | 
					a8314df902 | ||
| 
						 | 
					0cd7a0325f | ||
| 
						 | 
					16b7c81d55 | ||
| 
						 | 
					424ba8b588 | ||
| 
						 | 
					bf493e8d62 | ||
| 
						 | 
					c714e43c8d | ||
| 
						 | 
					cdf9d6f6ed | ||
| 
						 | 
					cc4b48c27c | ||
| 
						 | 
					cac9c92cc0 | ||
| 
						 | 
					d40abf1689 | ||
| 
						 | 
					69e9c69e70 | ||
| 
						 | 
					c489ea7d01 | ||
| 
						 | 
					26c6857a59 | ||
| 
						 | 
					508bd3d1aa | ||
| 
						 | 
					8705846710 | ||
| 
						 | 
					c944a9696e | ||
| 
						 | 
					943cc09d8a | ||
| 
						 | 
					fc6800d19f | ||
| 
						 | 
					d06f047b04 | ||
| 
						 | 
					ddc899bada | ||
| 
						 | 
					bd479e25c7 | ||
| 
						 | 
					eaf5bd168e | ||
| 
						 | 
					d7ecc206ba | ||
| 
						 | 
					11ea212e8c | ||
| 
						 | 
					cb29d8c11f | ||
| 
						 | 
					adcea5a043 | ||
| 
						 | 
					f02f7c2c4a | ||
| 
						 | 
					a1e44cc14f | ||
| 
						 | 
					d2d09bf68c | ||
| 
						 | 
					e2dfb655f7 | ||
| 
						 | 
					463e76b63c | ||
| 
						 | 
					2dc4b0dbe8 | ||
| 
						 | 
					7b23c126e6 | ||
| 
						 | 
					25e3d2225a | ||
| 
						 | 
					c8e0b5d7b6 | ||
| 
						 | 
					4fb7e2b445 | ||
| 
						 | 
					9138e3c061 | ||
| 
						 | 
					9b2a29660b | ||
| 
						 | 
					b7b4a9fa57 | ||
| 
						 | 
					1fb07a7de8 | ||
| 
						 | 
					b9cbcaad58 | ||
| 
						 | 
					c6706a6f6c | ||
| 
						 | 
					958e6a75a1 | ||
| 
						 | 
					397977726c | ||
| 
						 | 
					285d9189c7 | ||
| 
						 | 
					767d3e0054 | ||
| 
						 | 
					409d2a1b71 | ||
| 
						 | 
					e0b9678d7f | ||
| 
						 | 
					166dea6ac8 | ||
| 
						 | 
					52bef4d677 | ||
| 
						 | 
					801e5ef840 | ||
| 
						 | 
					0044739ae5 | ||
| 
						 | 
					4e44bd3650 | ||
| 
						 | 
					0cffb0cd3e | ||
| 
						 | 
					aaa3850ccd | ||
| 
						 | 
					a17b5d5a4f | ||
| 
						 | 
					2f97765bc3 | ||
| 
						 | 
					3205ca8deb | ||
| 
						 | 
					1cb4d65b87 | ||
| 
						 | 
					7b2dd292bc | 
							
								
								
									
										77
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,77 @@
 | 
			
		||||
# Object files
 | 
			
		||||
*.o
 | 
			
		||||
 | 
			
		||||
# editor artefacts
 | 
			
		||||
*.swp
 | 
			
		||||
.#*
 | 
			
		||||
#*#
 | 
			
		||||
*~
 | 
			
		||||
 | 
			
		||||
# Top level excludes
 | 
			
		||||
/Makefile.bak
 | 
			
		||||
/Makefile
 | 
			
		||||
/*.a
 | 
			
		||||
/include
 | 
			
		||||
/*.pc
 | 
			
		||||
/rehash.time
 | 
			
		||||
 | 
			
		||||
# Most *.c files under test/ are symlinks
 | 
			
		||||
/test/*.c
 | 
			
		||||
# Apart from these
 | 
			
		||||
!/test/asn1test.c
 | 
			
		||||
!/test/methtest.c
 | 
			
		||||
!/test/dummytest.c
 | 
			
		||||
!/test/igetest.c
 | 
			
		||||
!/test/r160test.c
 | 
			
		||||
!/test/fips_algvs.c
 | 
			
		||||
 | 
			
		||||
/test/*.ss
 | 
			
		||||
/test/*.srl
 | 
			
		||||
/test/.rnd
 | 
			
		||||
/test/test*.pem
 | 
			
		||||
/test/newkey.pem
 | 
			
		||||
 | 
			
		||||
# Certificate symbolic links
 | 
			
		||||
*.0
 | 
			
		||||
 | 
			
		||||
# Links under apps
 | 
			
		||||
/apps/CA.pl
 | 
			
		||||
/apps/md4.c
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Auto generated headers
 | 
			
		||||
/crypto/buildinf.h
 | 
			
		||||
/crypto/opensslconf.h
 | 
			
		||||
 | 
			
		||||
# Auto generated assembly language source files
 | 
			
		||||
*.s
 | 
			
		||||
!/crypto/bn/asm/pa-risc2.s
 | 
			
		||||
!/crypto/bn/asm/pa-risc2W.s
 | 
			
		||||
 | 
			
		||||
# Executables
 | 
			
		||||
/apps/openssl
 | 
			
		||||
/test/sha256t
 | 
			
		||||
/test/sha512t
 | 
			
		||||
/test/*test
 | 
			
		||||
/test/fips_aesavs
 | 
			
		||||
/test/fips_desmovs
 | 
			
		||||
/test/fips_dhvs
 | 
			
		||||
/test/fips_drbgvs
 | 
			
		||||
/test/fips_dssvs
 | 
			
		||||
/test/fips_ecdhvs
 | 
			
		||||
/test/fips_ecdsavs
 | 
			
		||||
/test/fips_rngvs
 | 
			
		||||
/test/fips_test_suite
 | 
			
		||||
*.so*
 | 
			
		||||
*.dylib*
 | 
			
		||||
*.dll*
 | 
			
		||||
# Exceptions
 | 
			
		||||
!/test/bctest
 | 
			
		||||
!/crypto/des/times/486-50.sol
 | 
			
		||||
 | 
			
		||||
# Misc auto generated files
 | 
			
		||||
/tools/c_rehash
 | 
			
		||||
/test/evptests.txt
 | 
			
		||||
lib
 | 
			
		||||
Makefile.save
 | 
			
		||||
*.bak
 | 
			
		||||
@@ -10,13 +10,18 @@ OpenSSL project.
 | 
			
		||||
We would like to identify and thank the following such sponsors for their past
 | 
			
		||||
or current significant support of the OpenSSL project:
 | 
			
		||||
 | 
			
		||||
Major support:
 | 
			
		||||
 | 
			
		||||
	Qualys		http://www.qualys.com/
 | 
			
		||||
 | 
			
		||||
Very significant support:
 | 
			
		||||
 | 
			
		||||
	OpenGear: www.opengear.com
 | 
			
		||||
	OpenGear:	http://www.opengear.com/
 | 
			
		||||
 | 
			
		||||
Significant support:
 | 
			
		||||
 | 
			
		||||
	PSW Group: www.psw.net
 | 
			
		||||
	PSW Group:	http://www.psw.net/
 | 
			
		||||
	Acano Ltd.	http://acano.com/
 | 
			
		||||
 | 
			
		||||
Please note that we ask permission to identify sponsors and that some sponsors
 | 
			
		||||
we consider eligible for inclusion here have requested to remain anonymous.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										476
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										476
									
								
								CHANGES
									
									
									
									
									
								
							@@ -2,7 +2,239 @@
 | 
			
		||||
 OpenSSL CHANGES
 | 
			
		||||
 _______________
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0f and 1.0.1  [xx XXX xxxx]
 | 
			
		||||
 Changes between 1.0.1g and 1.0.1h [5 Jun 2014]
 | 
			
		||||
 | 
			
		||||
  *) Fix for SSL/TLS MITM flaw. An attacker using a carefully crafted
 | 
			
		||||
     handshake can force the use of weak keying material in OpenSSL
 | 
			
		||||
     SSL/TLS clients and servers.
 | 
			
		||||
 | 
			
		||||
     Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for discovering and
 | 
			
		||||
     researching this issue. (CVE-2014-0224)
 | 
			
		||||
     [KIKUCHI Masashi, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix DTLS recursion flaw. By sending an invalid DTLS handshake to an
 | 
			
		||||
     OpenSSL DTLS client the code can be made to recurse eventually crashing
 | 
			
		||||
     in a DoS attack.
 | 
			
		||||
 | 
			
		||||
     Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
 | 
			
		||||
     (CVE-2014-0221)
 | 
			
		||||
     [Imre Rad, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix DTLS invalid fragment vulnerability. A buffer overrun attack can
 | 
			
		||||
     be triggered by sending invalid DTLS fragments to an OpenSSL DTLS
 | 
			
		||||
     client or server. This is potentially exploitable to run arbitrary
 | 
			
		||||
     code on a vulnerable client or server.
 | 
			
		||||
 | 
			
		||||
     Thanks to J<>ri Aedla for reporting this issue. (CVE-2014-0195)
 | 
			
		||||
     [J<>ri Aedla, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites
 | 
			
		||||
     are subject to a denial of service attack.
 | 
			
		||||
 | 
			
		||||
     Thanks to Felix Gr<47>bert and Ivan Fratric at Google for discovering
 | 
			
		||||
     this issue. (CVE-2014-3470)
 | 
			
		||||
     [Felix Gr<47>bert, Ivan Fratric, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Harmonize version and its documentation. -f flag is used to display
 | 
			
		||||
     compilation flags.
 | 
			
		||||
     [mancha <mancha1@zoho.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix eckey_priv_encode so it immediately returns an error upon a failure
 | 
			
		||||
     in i2d_ECPrivateKey.
 | 
			
		||||
     [mancha <mancha1@zoho.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix some double frees. These are not thought to be exploitable.
 | 
			
		||||
     [mancha <mancha1@zoho.com>]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1f and 1.0.1g [7 Apr 2014]
 | 
			
		||||
 | 
			
		||||
  *) A missing bounds check in the handling of the TLS heartbeat extension
 | 
			
		||||
     can be used to reveal up to 64k of memory to a connected client or
 | 
			
		||||
     server.
 | 
			
		||||
 | 
			
		||||
     Thanks for Neel Mehta of Google Security for discovering this bug and to
 | 
			
		||||
     Adam Langley <agl@chromium.org> and Bodo Moeller <bmoeller@acm.org> for
 | 
			
		||||
     preparing the fix (CVE-2014-0160)
 | 
			
		||||
     [Adam Langley, Bodo Moeller]
 | 
			
		||||
 | 
			
		||||
  *) Fix for the attack described in the paper "Recovering OpenSSL
 | 
			
		||||
     ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
 | 
			
		||||
     by Yuval Yarom and Naomi Benger. Details can be obtained from:
 | 
			
		||||
     http://eprint.iacr.org/2014/140
 | 
			
		||||
 | 
			
		||||
     Thanks to Yuval Yarom and Naomi Benger for discovering this
 | 
			
		||||
     flaw and to Yuval Yarom for supplying a fix (CVE-2014-0076)
 | 
			
		||||
     [Yuval Yarom and Naomi Benger]
 | 
			
		||||
 | 
			
		||||
  *) TLS pad extension: draft-agl-tls-padding-03
 | 
			
		||||
 | 
			
		||||
     Workaround for the "TLS hang bug" (see FAQ and PR#2771): if the
 | 
			
		||||
     TLS client Hello record length value would otherwise be > 255 and
 | 
			
		||||
     less that 512 pad with a dummy extension containing zeroes so it
 | 
			
		||||
     is at least 512 bytes long.
 | 
			
		||||
 | 
			
		||||
     [Adam Langley, Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1e and 1.0.1f [6 Jan 2014]
 | 
			
		||||
 | 
			
		||||
  *) Fix for TLS record tampering bug. A carefully crafted invalid 
 | 
			
		||||
     handshake could crash OpenSSL with a NULL pointer exception.
 | 
			
		||||
     Thanks to Anton Johansson for reporting this issues.
 | 
			
		||||
     (CVE-2013-4353)
 | 
			
		||||
 | 
			
		||||
  *) Keep original DTLS digest and encryption contexts in retransmission
 | 
			
		||||
     structures so we can use the previous session parameters if they need
 | 
			
		||||
     to be resent. (CVE-2013-6450)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Add option SSL_OP_SAFARI_ECDHE_ECDSA_BUG (part of SSL_OP_ALL) which
 | 
			
		||||
     avoids preferring ECDHE-ECDSA ciphers when the client appears to be
 | 
			
		||||
     Safari on OS X.  Safari on OS X 10.8..10.8.3 advertises support for
 | 
			
		||||
     several ECDHE-ECDSA ciphers, but fails to negotiate them.  The bug
 | 
			
		||||
     is fixed in OS X 10.8.4, but Apple have ruled out both hot fixing
 | 
			
		||||
     10.8..10.8.3 and forcing users to upgrade to 10.8.4 or newer.
 | 
			
		||||
     [Rob Stradling, Adam Langley]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1d and 1.0.1e [11 Feb 2013]
 | 
			
		||||
 | 
			
		||||
  *) Correct fix for CVE-2013-0169. The original didn't work on AES-NI
 | 
			
		||||
     supporting platforms or when small records were transferred.
 | 
			
		||||
     [Andy Polyakov, Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1c and 1.0.1d [5 Feb 2013]
 | 
			
		||||
 | 
			
		||||
  *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
 | 
			
		||||
 | 
			
		||||
     This addresses the flaw in CBC record processing discovered by 
 | 
			
		||||
     Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
 | 
			
		||||
     at: http://www.isg.rhul.ac.uk/tls/     
 | 
			
		||||
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
 | 
			
		||||
     Emilia K<>sper for the initial patch.
 | 
			
		||||
     (CVE-2013-0169)
 | 
			
		||||
     [Emilia K<>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode
 | 
			
		||||
     ciphersuites which can be exploited in a denial of service attack.
 | 
			
		||||
     Thanks go to and to Adam Langley <agl@chromium.org> for discovering
 | 
			
		||||
     and detecting this bug and to Wolfgang Ettlinger
 | 
			
		||||
     <wolfgang.ettlinger@gmail.com> for independently discovering this issue.
 | 
			
		||||
     (CVE-2012-2686)
 | 
			
		||||
     [Adam Langley]
 | 
			
		||||
 | 
			
		||||
  *) Return an error when checking OCSP signatures when key is NULL.
 | 
			
		||||
     This fixes a DoS attack. (CVE-2013-0166)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Make openssl verify return errors.
 | 
			
		||||
     [Chris Palmer <palmer@google.com> and Ben Laurie]
 | 
			
		||||
 | 
			
		||||
  *) Call OCSP Stapling callback after ciphersuite has been chosen, so
 | 
			
		||||
     the right response is stapled. Also change SSL_get_certificate()
 | 
			
		||||
     so it returns the certificate actually sent.
 | 
			
		||||
     See http://rt.openssl.org/Ticket/Display.html?id=2836.
 | 
			
		||||
     [Rob Stradling <rob.stradling@comodo.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix possible deadlock when decoding public keys.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Don't use TLS 1.0 record version number in initial client hello
 | 
			
		||||
     if renegotiating.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1b and 1.0.1c [10 May 2012]
 | 
			
		||||
 | 
			
		||||
  *) Sanity check record length before skipping explicit IV in TLS
 | 
			
		||||
     1.2, 1.1 and DTLS to fix DoS attack.
 | 
			
		||||
 | 
			
		||||
     Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
 | 
			
		||||
     fuzzing as a service testing platform.
 | 
			
		||||
     (CVE-2012-2333)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Initialise tkeylen properly when encrypting CMS messages.
 | 
			
		||||
     Thanks to Solar Designer of Openwall for reporting this issue.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) In FIPS mode don't try to use composite ciphers as they are not
 | 
			
		||||
     approved.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1a and 1.0.1b [26 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) OpenSSL 1.0.0 sets SSL_OP_ALL to 0x80000FFFL and OpenSSL 1.0.1 and
 | 
			
		||||
     1.0.1a set SSL_OP_NO_TLSv1_1 to 0x00000400L which would unfortunately
 | 
			
		||||
     mean any application compiled against OpenSSL 1.0.0 headers setting
 | 
			
		||||
     SSL_OP_ALL would also set SSL_OP_NO_TLSv1_1, unintentionally disablng
 | 
			
		||||
     TLS 1.1 also. Fix this by changing the value of SSL_OP_NO_TLSv1_1 to
 | 
			
		||||
     0x10000000L Any application which was previously compiled against
 | 
			
		||||
     OpenSSL 1.0.1 or 1.0.1a headers and which cares about SSL_OP_NO_TLSv1_1
 | 
			
		||||
     will need to be recompiled as a result. Letting be results in
 | 
			
		||||
     inability to disable specifically TLS 1.1 and in client context,
 | 
			
		||||
     in unlike event, limit maximum offered version to TLS 1.0 [see below].
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) In order to ensure interoperabilty SSL_OP_NO_protocolX does not
 | 
			
		||||
     disable just protocol X, but all protocols above X *if* there are
 | 
			
		||||
     protocols *below* X still enabled. In more practical terms it means
 | 
			
		||||
     that if application wants to disable TLS1.0 in favor of TLS1.1 and
 | 
			
		||||
     above, it's not sufficient to pass SSL_OP_NO_TLSv1, one has to pass
 | 
			
		||||
     SSL_OP_NO_TLSv1|SSL_OP_NO_SSLv3|SSL_OP_NO_SSLv2. This applies to
 | 
			
		||||
     client side.
 | 
			
		||||
     [Andy Polyakov]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.1 and 1.0.1a [19 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) Check for potentially exploitable overflows in asn1_d2i_read_bio
 | 
			
		||||
     BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
 | 
			
		||||
     in CRYPTO_realloc_clean.
 | 
			
		||||
 | 
			
		||||
     Thanks to Tavis Ormandy, Google Security Team, for discovering this
 | 
			
		||||
     issue and to Adam Langley <agl@chromium.org> for fixing it.
 | 
			
		||||
     (CVE-2012-2110)
 | 
			
		||||
     [Adam Langley (Google), Tavis Ormandy, Google Security Team]
 | 
			
		||||
 | 
			
		||||
  *) Don't allow TLS 1.2 SHA-256 ciphersuites in TLS 1.0, 1.1 connections.
 | 
			
		||||
     [Adam Langley]
 | 
			
		||||
 | 
			
		||||
  *) Workarounds for some broken servers that "hang" if a client hello
 | 
			
		||||
     record length exceeds 255 bytes.
 | 
			
		||||
 | 
			
		||||
     1. Do not use record version number > TLS 1.0 in initial client
 | 
			
		||||
        hello: some (but not all) hanging servers will now work.
 | 
			
		||||
     2. If we set OPENSSL_MAX_TLS1_2_CIPHER_LENGTH this will truncate
 | 
			
		||||
	the number of ciphers sent in the client hello. This should be
 | 
			
		||||
        set to an even number, such as 50, for example by passing:
 | 
			
		||||
        -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 to config or Configure.
 | 
			
		||||
        Most broken servers should now work.
 | 
			
		||||
     3. If all else fails setting OPENSSL_NO_TLS1_2_CLIENT will disable
 | 
			
		||||
	TLS 1.2 client support entirely.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix SEGV in Vector Permutation AES module observed in OpenSSH.
 | 
			
		||||
     [Andy Polyakov]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0h and 1.0.1  [14 Mar 2012]
 | 
			
		||||
 | 
			
		||||
  *) Add compatibility with old MDC2 signatures which use an ASN1 OCTET
 | 
			
		||||
     STRING form instead of a DigestInfo.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) The format used for MDC2 RSA signatures is inconsistent between EVP
 | 
			
		||||
     and the RSA_sign/RSA_verify functions. This was made more apparent when
 | 
			
		||||
     OpenSSL used RSA_sign/RSA_verify for some RSA signatures in particular
 | 
			
		||||
     those which went through EVP_PKEY_METHOD in 1.0.0 and later. Detect 
 | 
			
		||||
     the correct format in RSA_verify so both forms transparently work.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Some servers which support TLS 1.0 can choke if we initially indicate
 | 
			
		||||
     support for TLS 1.2 and later renegotiate using TLS 1.0 in the RSA
 | 
			
		||||
     encrypted premaster secret. As a workaround use the maximum pemitted
 | 
			
		||||
     client version in client hello, this should keep such servers happy
 | 
			
		||||
     and still work with previous versions of OpenSSL.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Add support for TLS/DTLS heartbeats.
 | 
			
		||||
     [Robin Seggelmann <seggelmann@fh-muenster.de>]
 | 
			
		||||
@@ -267,7 +499,124 @@
 | 
			
		||||
       Add command line options to s_client/s_server.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0e and 1.0.0f [xx XXX xxxx]
 | 
			
		||||
 Changes between 1.0.0j and 1.0.0k [5 Feb 2013]
 | 
			
		||||
 | 
			
		||||
  *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
 | 
			
		||||
 | 
			
		||||
     This addresses the flaw in CBC record processing discovered by 
 | 
			
		||||
     Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
 | 
			
		||||
     at: http://www.isg.rhul.ac.uk/tls/     
 | 
			
		||||
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
 | 
			
		||||
     Emilia K<>sper for the initial patch.
 | 
			
		||||
     (CVE-2013-0169)
 | 
			
		||||
     [Emilia K<>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Return an error when checking OCSP signatures when key is NULL.
 | 
			
		||||
     This fixes a DoS attack. (CVE-2013-0166)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Call OCSP Stapling callback after ciphersuite has been chosen, so
 | 
			
		||||
     the right response is stapled. Also change SSL_get_certificate()
 | 
			
		||||
     so it returns the certificate actually sent.
 | 
			
		||||
     See http://rt.openssl.org/Ticket/Display.html?id=2836.
 | 
			
		||||
     (This is a backport)
 | 
			
		||||
     [Rob Stradling <rob.stradling@comodo.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix possible deadlock when decoding public keys.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0i and 1.0.0j [10 May 2012]
 | 
			
		||||
 | 
			
		||||
  [NB: OpenSSL 1.0.0i and later 1.0.0 patch levels were released after
 | 
			
		||||
  OpenSSL 1.0.1.]
 | 
			
		||||
 | 
			
		||||
  *) Sanity check record length before skipping explicit IV in DTLS
 | 
			
		||||
     to fix DoS attack.
 | 
			
		||||
 | 
			
		||||
     Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
 | 
			
		||||
     fuzzing as a service testing platform.
 | 
			
		||||
     (CVE-2012-2333)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Initialise tkeylen properly when encrypting CMS messages.
 | 
			
		||||
     Thanks to Solar Designer of Openwall for reporting this issue.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0h and 1.0.0i [19 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) Check for potentially exploitable overflows in asn1_d2i_read_bio
 | 
			
		||||
     BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
 | 
			
		||||
     in CRYPTO_realloc_clean.
 | 
			
		||||
 | 
			
		||||
     Thanks to Tavis Ormandy, Google Security Team, for discovering this
 | 
			
		||||
     issue and to Adam Langley <agl@chromium.org> for fixing it.
 | 
			
		||||
     (CVE-2012-2110)
 | 
			
		||||
     [Adam Langley (Google), Tavis Ormandy, Google Security Team]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0g and 1.0.0h [12 Mar 2012]
 | 
			
		||||
 | 
			
		||||
  *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness
 | 
			
		||||
     in CMS and PKCS7 code. When RSA decryption fails use a random key for
 | 
			
		||||
     content decryption and always return the same error. Note: this attack
 | 
			
		||||
     needs on average 2^20 messages so it only affects automated senders. The
 | 
			
		||||
     old behaviour can be reenabled in the CMS code by setting the
 | 
			
		||||
     CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where
 | 
			
		||||
     an MMA defence is not necessary.
 | 
			
		||||
     Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for discovering
 | 
			
		||||
     this issue. (CVE-2012-0884)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix CVE-2011-4619: make sure we really are receiving a 
 | 
			
		||||
     client hello before rejecting multiple SGC restarts. Thanks to
 | 
			
		||||
     Ivan Nestlerode <inestlerode@us.ibm.com> for discovering this bug.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0f and 1.0.0g [18 Jan 2012]
 | 
			
		||||
 | 
			
		||||
  *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109.
 | 
			
		||||
     Thanks to Antonio Martin, Enterprise Secure Access Research and
 | 
			
		||||
     Development, Cisco Systems, Inc. for discovering this bug and
 | 
			
		||||
     preparing a fix. (CVE-2012-0050)
 | 
			
		||||
     [Antonio Martin]
 | 
			
		||||
 | 
			
		||||
 Changes between 1.0.0e and 1.0.0f [4 Jan 2012]
 | 
			
		||||
 | 
			
		||||
  *) Nadhem Alfardan and Kenny Paterson have discovered an extension
 | 
			
		||||
     of the Vaudenay padding oracle attack on CBC mode encryption
 | 
			
		||||
     which enables an efficient plaintext recovery attack against
 | 
			
		||||
     the OpenSSL implementation of DTLS. Their attack exploits timing
 | 
			
		||||
     differences arising during decryption processing. A research
 | 
			
		||||
     paper describing this attack can be found at:
 | 
			
		||||
                  http://www.isg.rhul.ac.uk/~kp/dtls.pdf
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann
 | 
			
		||||
     <seggelmann@fh-muenster.de> and Michael Tuexen <tuexen@fh-muenster.de>
 | 
			
		||||
     for preparing the fix. (CVE-2011-4108)
 | 
			
		||||
     [Robin Seggelmann, Michael Tuexen]
 | 
			
		||||
 | 
			
		||||
  *) Clear bytes used for block padding of SSL 3.0 records.
 | 
			
		||||
     (CVE-2011-4576)
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George
 | 
			
		||||
     Kadianakis <desnacked@gmail.com> for discovering this issue and
 | 
			
		||||
     Adam Langley for preparing the fix. (CVE-2011-4619)
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Check parameters are not NULL in GOST ENGINE. (CVE-2012-0027)
 | 
			
		||||
     [Andrey Kulikov <amdeich@gmail.com>]
 | 
			
		||||
 | 
			
		||||
  *) Prevent malformed RFC3779 data triggering an assertion failure.
 | 
			
		||||
     Thanks to Andrew Chi, BBN Technologies, for discovering the flaw
 | 
			
		||||
     and Rob Austein <sra@hactrn.net> for fixing it. (CVE-2011-4577)
 | 
			
		||||
     [Rob Austein <sra@hactrn.net>]
 | 
			
		||||
 | 
			
		||||
  *) Improved PRNG seeding for VOS.
 | 
			
		||||
     [Paul Green <Paul.Green@stratus.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix ssl_ciph.c set-up race.
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
@@ -1196,8 +1545,127 @@
 | 
			
		||||
 | 
			
		||||
  *) Change 'Configure' script to enable Camellia by default.
 | 
			
		||||
     [NTT]
 | 
			
		||||
  
 | 
			
		||||
 Changes between 0.9.8r and 0.9.8s [xx XXX xxxx]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8x and 0.9.8y [5 Feb 2013]
 | 
			
		||||
 | 
			
		||||
  *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
 | 
			
		||||
 | 
			
		||||
     This addresses the flaw in CBC record processing discovered by 
 | 
			
		||||
     Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
 | 
			
		||||
     at: http://www.isg.rhul.ac.uk/tls/     
 | 
			
		||||
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
 | 
			
		||||
     Emilia K<>sper for the initial patch.
 | 
			
		||||
     (CVE-2013-0169)
 | 
			
		||||
     [Emilia K<>sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Return an error when checking OCSP signatures when key is NULL.
 | 
			
		||||
     This fixes a DoS attack. (CVE-2013-0166)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Call OCSP Stapling callback after ciphersuite has been chosen, so
 | 
			
		||||
     the right response is stapled. Also change SSL_get_certificate()
 | 
			
		||||
     so it returns the certificate actually sent.
 | 
			
		||||
     See http://rt.openssl.org/Ticket/Display.html?id=2836.
 | 
			
		||||
     (This is a backport)
 | 
			
		||||
     [Rob Stradling <rob.stradling@comodo.com>]
 | 
			
		||||
 | 
			
		||||
  *) Fix possible deadlock when decoding public keys.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8w and 0.9.8x [10 May 2012]
 | 
			
		||||
 | 
			
		||||
  *) Sanity check record length before skipping explicit IV in DTLS
 | 
			
		||||
     to fix DoS attack.
 | 
			
		||||
 | 
			
		||||
     Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
 | 
			
		||||
     fuzzing as a service testing platform.
 | 
			
		||||
     (CVE-2012-2333)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Initialise tkeylen properly when encrypting CMS messages.
 | 
			
		||||
     Thanks to Solar Designer of Openwall for reporting this issue.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8v and 0.9.8w [23 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) The fix for CVE-2012-2110 did not take into account that the 
 | 
			
		||||
     'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an
 | 
			
		||||
     int in OpenSSL 0.9.8, making it still vulnerable. Fix by 
 | 
			
		||||
     rejecting negative len parameter. (CVE-2012-2131)
 | 
			
		||||
     [Tomas Hoger <thoger@redhat.com>]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8u and 0.9.8v [19 Apr 2012]
 | 
			
		||||
 | 
			
		||||
  *) Check for potentially exploitable overflows in asn1_d2i_read_bio
 | 
			
		||||
     BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
 | 
			
		||||
     in CRYPTO_realloc_clean.
 | 
			
		||||
 | 
			
		||||
     Thanks to Tavis Ormandy, Google Security Team, for discovering this
 | 
			
		||||
     issue and to Adam Langley <agl@chromium.org> for fixing it.
 | 
			
		||||
     (CVE-2012-2110)
 | 
			
		||||
     [Adam Langley (Google), Tavis Ormandy, Google Security Team]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8t and 0.9.8u [12 Mar 2012]
 | 
			
		||||
 | 
			
		||||
  *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness
 | 
			
		||||
     in CMS and PKCS7 code. When RSA decryption fails use a random key for
 | 
			
		||||
     content decryption and always return the same error. Note: this attack
 | 
			
		||||
     needs on average 2^20 messages so it only affects automated senders. The
 | 
			
		||||
     old behaviour can be reenabled in the CMS code by setting the
 | 
			
		||||
     CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where
 | 
			
		||||
     an MMA defence is not necessary.
 | 
			
		||||
     Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for discovering
 | 
			
		||||
     this issue. (CVE-2012-0884)
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix CVE-2011-4619: make sure we really are receiving a 
 | 
			
		||||
     client hello before rejecting multiple SGC restarts. Thanks to
 | 
			
		||||
     Ivan Nestlerode <inestlerode@us.ibm.com> for discovering this bug.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8s and 0.9.8t [18 Jan 2012]
 | 
			
		||||
 | 
			
		||||
  *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109.
 | 
			
		||||
     Thanks to Antonio Martin, Enterprise Secure Access Research and
 | 
			
		||||
     Development, Cisco Systems, Inc. for discovering this bug and
 | 
			
		||||
     preparing a fix. (CVE-2012-0050)
 | 
			
		||||
     [Antonio Martin]
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8r and 0.9.8s [4 Jan 2012]
 | 
			
		||||
 | 
			
		||||
  *) Nadhem Alfardan and Kenny Paterson have discovered an extension
 | 
			
		||||
     of the Vaudenay padding oracle attack on CBC mode encryption
 | 
			
		||||
     which enables an efficient plaintext recovery attack against
 | 
			
		||||
     the OpenSSL implementation of DTLS. Their attack exploits timing
 | 
			
		||||
     differences arising during decryption processing. A research
 | 
			
		||||
     paper describing this attack can be found at:
 | 
			
		||||
                  http://www.isg.rhul.ac.uk/~kp/dtls.pdf
 | 
			
		||||
     Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
 | 
			
		||||
     Security Group at Royal Holloway, University of London
 | 
			
		||||
     (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann
 | 
			
		||||
     <seggelmann@fh-muenster.de> and Michael Tuexen <tuexen@fh-muenster.de>
 | 
			
		||||
     for preparing the fix. (CVE-2011-4108)
 | 
			
		||||
     [Robin Seggelmann, Michael Tuexen]
 | 
			
		||||
 | 
			
		||||
  *) Stop policy check failure freeing same buffer twice. (CVE-2011-4109)
 | 
			
		||||
     [Ben Laurie, Kasper <ekasper@google.com>]
 | 
			
		||||
 | 
			
		||||
  *) Clear bytes used for block padding of SSL 3.0 records.
 | 
			
		||||
     (CVE-2011-4576)
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 | 
			
		||||
  *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George
 | 
			
		||||
     Kadianakis <desnacked@gmail.com> for discovering this issue and
 | 
			
		||||
     Adam Langley for preparing the fix. (CVE-2011-4619)
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 
 | 
			
		||||
  *) Prevent malformed RFC3779 data triggering an assertion failure.
 | 
			
		||||
     Thanks to Andrew Chi, BBN Technologies, for discovering the flaw
 | 
			
		||||
     and Rob Austein <sra@hactrn.net> for fixing it. (CVE-2011-4577)
 | 
			
		||||
     [Rob Austein <sra@hactrn.net>]
 | 
			
		||||
 | 
			
		||||
  *) Fix ssl_ciph.c set-up race.
 | 
			
		||||
     [Adam Langley (Google)]
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										47
									
								
								Configure
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								Configure
									
									
									
									
									
								
							@@ -171,20 +171,22 @@ my %table=(
 | 
			
		||||
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
 | 
			
		||||
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
 | 
			
		||||
"debug-ben-debug",	"gcc44:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe::(unknown)::::::",
 | 
			
		||||
"debug-ben-debug-64",	"gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-ben-macos",	"cc:$gcc_devteam_warn -arch i386 -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::-Wl,-search_paths_first::::",
 | 
			
		||||
"debug-ben-macos-gcc46",	"gcc-mp-4.6:$gcc_devteam_warn -Wconversion -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::::::",
 | 
			
		||||
"debug-ben-darwin64","cc:$gcc_devteam_warn -Wno-language-extension-token -Wno-extended-offsetof -arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 | 
			
		||||
"debug-ben-no-opt",	"gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
 | 
			
		||||
"debug-ben-strict",	"gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
 | 
			
		||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
"debug-bodo",	"gcc:$gcc_devteam_warn -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"debug-bodo",	"gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 | 
			
		||||
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
 | 
			
		||||
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
 | 
			
		||||
@@ -243,7 +245,7 @@ my %table=(
 | 
			
		||||
"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:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.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:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs::/64",
 | 
			
		||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
 | 
			
		||||
####
 | 
			
		||||
"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:${sparcv8_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.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::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 
 | 
			
		||||
@@ -296,8 +298,8 @@ my %table=(
 | 
			
		||||
# 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::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc1_1-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${parisc11_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1::pa-risc2.o::::::::::::::void:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc1_1-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${parisc11_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1",
 | 
			
		||||
"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32",
 | 
			
		||||
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
 | 
			
		||||
 | 
			
		||||
# More attempts at unified 10.X and 11.X targets for HP C compiler.
 | 
			
		||||
@@ -306,7 +308,7 @@ my %table=(
 | 
			
		||||
# Kevin Steves <ks@hp.se>
 | 
			
		||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc1_1-cc","cc:+DA1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${parisc11_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1",
 | 
			
		||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2.o::::::::::::::void:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32",
 | 
			
		||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -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:${parisc20_asm}:dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
 | 
			
		||||
 | 
			
		||||
# HP/UX IA-64 targets
 | 
			
		||||
@@ -464,8 +466,8 @@ my %table=(
 | 
			
		||||
"aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64",
 | 
			
		||||
# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE
 | 
			
		||||
# at build time. $OBJECT_MODE is respected at ./config stage!
 | 
			
		||||
"aix-cc",   "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
 | 
			
		||||
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
 | 
			
		||||
"aix-cc",   "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR:${ppc32_asm}:aix32:dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
 | 
			
		||||
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded -D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:${ppc64_asm}:aix64:dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Cray T90 and similar (SDSC)
 | 
			
		||||
@@ -524,7 +526,7 @@ my %table=(
 | 
			
		||||
# 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
 | 
			
		||||
"VC-WIN32","cl:-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
 | 
			
		||||
# Unified CE target
 | 
			
		||||
"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
 | 
			
		||||
"debug-VC-WIN32","cl:-W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
 | 
			
		||||
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
 | 
			
		||||
 | 
			
		||||
# Borland C++ 4.5
 | 
			
		||||
@@ -904,11 +906,11 @@ PROCESS_ARGS:
 | 
			
		||||
				}
 | 
			
		||||
			elsif (/^--with-fipsdir=(.*)$/)
 | 
			
		||||
				{
 | 
			
		||||
				$fipsdir="$1/";
 | 
			
		||||
				$fipsdir="$1";
 | 
			
		||||
				}
 | 
			
		||||
			elsif (/^--with-fipslibdir=(.*)$/)
 | 
			
		||||
				{
 | 
			
		||||
				$fipslibdir="$1/";
 | 
			
		||||
				$fipslibdir="$1";
 | 
			
		||||
				}
 | 
			
		||||
			elsif (/^--with-baseaddr=(.*)$/)
 | 
			
		||||
				{
 | 
			
		||||
@@ -1019,10 +1021,11 @@ if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
 | 
			
		||||
	$disabled{"gost"} = "forced";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
# SRP requires TLSEXT
 | 
			
		||||
# SRP and HEARTBEATS require TLSEXT
 | 
			
		||||
if (defined($disabled{"tlsext"}))
 | 
			
		||||
	{
 | 
			
		||||
	$disabled{"srp"} = "forced";
 | 
			
		||||
	$disabled{"heartbeats"} = "forced";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
if ($target eq "TABLE") {
 | 
			
		||||
@@ -1094,6 +1097,8 @@ foreach (sort (keys %disabled))
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				push @skip, $algo;
 | 
			
		||||
				# fix-up crypto/directory name(s)
 | 
			
		||||
				@skip[$#skip]="whrlpool" if $algo eq "whirlpool";
 | 
			
		||||
				print " (skip dir)";
 | 
			
		||||
 | 
			
		||||
				$depflags .= " -DOPENSSL_NO_$ALGO";
 | 
			
		||||
@@ -1390,14 +1395,6 @@ if (!$IsMK1MF)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
if (!defined($disabled{"sctp"}))
 | 
			
		||||
	{
 | 
			
		||||
	if ($target =~ /^solaris/)
 | 
			
		||||
		{
 | 
			
		||||
		$cflags = "$cflags -D_XPG4_2 -D__EXTENSIONS__";
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
$cpuid_obj.=" uplink.o uplink-x86.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
@@ -1520,7 +1517,7 @@ else	{
 | 
			
		||||
	$aes_obj=$aes_enc;
 | 
			
		||||
	}
 | 
			
		||||
$wp_obj="" if ($wp_obj =~ /mmx/ && $processor eq "386");
 | 
			
		||||
if ($wp_obj =~ /\.o$/)
 | 
			
		||||
if ($wp_obj =~ /\.o$/ && !$disabled{"whirlpool"})
 | 
			
		||||
	{
 | 
			
		||||
	$cflags.=" -DWHIRLPOOL_ASM";
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								FAQ
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								FAQ
									
									
									
									
									
								
							@@ -10,6 +10,7 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* Why aren't tools like 'autoconf' and 'libtool' used?
 | 
			
		||||
* What is an 'engine' version?
 | 
			
		||||
* How do I check the authenticity of the OpenSSL distribution?
 | 
			
		||||
* How does the versioning scheme work?
 | 
			
		||||
 | 
			
		||||
[LEGAL] Legal questions
 | 
			
		||||
 | 
			
		||||
@@ -82,11 +83,11 @@ OpenSSL  -  Frequently Asked Questions
 | 
			
		||||
* Which is the current version of OpenSSL?
 | 
			
		||||
 | 
			
		||||
The current version is available from <URL: http://www.openssl.org>.
 | 
			
		||||
OpenSSL 1.0.0d was released on Feb 8th, 2011.
 | 
			
		||||
OpenSSL 1.0.1e was released on Feb 11th, 2013.
 | 
			
		||||
 | 
			
		||||
In addition to the current stable release, you can also access daily
 | 
			
		||||
snapshots of the OpenSSL development version at <URL:
 | 
			
		||||
ftp://ftp.openssl.org/snapshot/>, or get it by anonymous CVS access.
 | 
			
		||||
ftp://ftp.openssl.org/snapshot/>, or get it by anonymous Git access.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Where is the documentation?
 | 
			
		||||
@@ -108,7 +109,9 @@ In addition, you can read the most current versions at
 | 
			
		||||
<URL: http://www.openssl.org/docs/>. Note that the online documents refer
 | 
			
		||||
to the very latest development versions of OpenSSL and may include features
 | 
			
		||||
not present in released versions. If in doubt refer to the documentation
 | 
			
		||||
that came with the version of OpenSSL you are using.
 | 
			
		||||
that came with the version of OpenSSL you are using. The pod format
 | 
			
		||||
documentation is included in each OpenSSL distribution under the docs
 | 
			
		||||
directory.
 | 
			
		||||
 | 
			
		||||
For information on parts of libcrypto that are not yet documented, you
 | 
			
		||||
might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's
 | 
			
		||||
@@ -173,6 +176,19 @@ just do:
 | 
			
		||||
 | 
			
		||||
   pgp TARBALL.asc
 | 
			
		||||
 | 
			
		||||
* How does the versioning scheme work?
 | 
			
		||||
 | 
			
		||||
After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter 
 | 
			
		||||
releases (e.g. 1.0.1a) can only contain bug and security fixes and no
 | 
			
		||||
new features. Minor releases change the last number (e.g. 1.0.2) and 
 | 
			
		||||
can contain new features that retain binary compatibility. Changes to
 | 
			
		||||
the middle number are considered major releases and neither source nor
 | 
			
		||||
binary compatibility is guaranteed.
 | 
			
		||||
 | 
			
		||||
Therefore the answer to the common question "when will feature X be
 | 
			
		||||
backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear
 | 
			
		||||
in the next minor release.
 | 
			
		||||
 | 
			
		||||
[LEGAL] =======================================================================
 | 
			
		||||
 | 
			
		||||
* Do I need patent licenses to use OpenSSL?
 | 
			
		||||
@@ -284,7 +300,7 @@ current directory in this case, but this has changed with 0.9.6a.)
 | 
			
		||||
Check out the CA.pl(1) manual page. This provides a simple wrapper round
 | 
			
		||||
the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check
 | 
			
		||||
out the manual pages for the individual utilities and the certificate
 | 
			
		||||
extensions documentation (currently in doc/openssl.txt).
 | 
			
		||||
extensions documentation (in ca(1), req(1), x509v3_config(5) )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* Why can't I create certificate requests?
 | 
			
		||||
@@ -752,6 +768,9 @@ openssl-security@openssl.org if you don't get a prompt reply at least
 | 
			
		||||
acknowledging receipt then resend or mail it directly to one of the
 | 
			
		||||
more active team members (e.g. Steve).
 | 
			
		||||
 | 
			
		||||
Note that bugs only present in the openssl utility are not in general
 | 
			
		||||
considered to be security issues. 
 | 
			
		||||
 | 
			
		||||
[PROG] ========================================================================
 | 
			
		||||
 | 
			
		||||
* Is OpenSSL thread-safe?
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@
 | 
			
		||||
  is required if you intend to utilize assembler modules. Note that NASM
 | 
			
		||||
  is now the only supported assembler.
 | 
			
		||||
 | 
			
		||||
 If you are compiling from a tarball or a CVS snapshot then the Win32 files
 | 
			
		||||
 If you are compiling from a tarball or a Git snapshot then the Win32 files
 | 
			
		||||
 may well be not up to date. This may mean that some "tweaking" is required to
 | 
			
		||||
 get it all to work. See the trouble shooting section later on for if (when?)
 | 
			
		||||
 it goes wrong.
 | 
			
		||||
@@ -257,7 +257,7 @@
 | 
			
		||||
 | 
			
		||||
 then ms\do_XXX should not give a warning any more. However the numbers that
 | 
			
		||||
 get assigned by this technique may not match those that eventually get
 | 
			
		||||
 assigned in the CVS tree: so anything linked against this version of the
 | 
			
		||||
 assigned in the Git tree: so anything linked against this version of the
 | 
			
		||||
 library may need to be recompiled.
 | 
			
		||||
 | 
			
		||||
 If you get errors about unresolved symbols there are several possible
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								Makefile.org
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								Makefile.org
									
									
									
									
									
								
							@@ -69,7 +69,7 @@ RANLIB= ranlib
 | 
			
		||||
NM= nm
 | 
			
		||||
PERL= perl
 | 
			
		||||
TAR= tar
 | 
			
		||||
TARFLAGS= --no-recursion
 | 
			
		||||
TARFLAGS= --no-recursion --record-size=10240
 | 
			
		||||
MAKEDEPPROG=makedepend
 | 
			
		||||
LIBDIR=lib
 | 
			
		||||
 | 
			
		||||
@@ -198,7 +198,7 @@ CLEARENV=	TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}	\
 | 
			
		||||
		$${EXHEADER+EXHEADER} $${HEADER+HEADER}		\
 | 
			
		||||
		$${GENERAL+GENERAL} $${CFLAGS+CFLAGS}		\
 | 
			
		||||
		$${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}		\
 | 
			
		||||
		$${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS}		\
 | 
			
		||||
		$${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS}	\
 | 
			
		||||
		$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS}	\
 | 
			
		||||
		$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
 | 
			
		||||
 | 
			
		||||
@@ -302,7 +302,8 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT)
 | 
			
		||||
			FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \
 | 
			
		||||
			export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		$(MAKE) -e SHLIBDIRS=crypto build-shared; \
 | 
			
		||||
		$(MAKE) -e SHLIBDIRS=crypto  CC="$${CC:-$(CC)}" build-shared && \
 | 
			
		||||
		(touch -c fips_premain_dso$(EXE_EXT) || :); \
 | 
			
		||||
	else \
 | 
			
		||||
		echo "There's no support for shared libraries on this platform" >&2; \
 | 
			
		||||
		exit 1; \
 | 
			
		||||
@@ -364,7 +365,8 @@ libcrypto.pc: Makefile
 | 
			
		||||
	    echo 'Description: OpenSSL cryptography library'; \
 | 
			
		||||
	    echo 'Version: '$(VERSION); \
 | 
			
		||||
	    echo 'Requires: '; \
 | 
			
		||||
	    echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
 | 
			
		||||
	    echo 'Libs: -L$${libdir} -lcrypto'; \
 | 
			
		||||
	    echo 'Libs.private: $(EX_LIBS)'; \
 | 
			
		||||
	    echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
 | 
			
		||||
 | 
			
		||||
libssl.pc: Makefile
 | 
			
		||||
@@ -377,7 +379,8 @@ libssl.pc: Makefile
 | 
			
		||||
	    echo 'Description: Secure Sockets Layer and cryptography libraries'; \
 | 
			
		||||
	    echo 'Version: '$(VERSION); \
 | 
			
		||||
	    echo 'Requires: '; \
 | 
			
		||||
	    echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
 | 
			
		||||
	    echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
 | 
			
		||||
	    echo 'Libs.private: $(EX_LIBS)'; \
 | 
			
		||||
	    echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
 | 
			
		||||
 | 
			
		||||
openssl.pc: Makefile
 | 
			
		||||
@@ -390,7 +393,8 @@ openssl.pc: Makefile
 | 
			
		||||
	    echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
 | 
			
		||||
	    echo 'Version: '$(VERSION); \
 | 
			
		||||
	    echo 'Requires: '; \
 | 
			
		||||
	    echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
 | 
			
		||||
	    echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
 | 
			
		||||
	    echo 'Libs.private: $(EX_LIBS)'; \
 | 
			
		||||
	    echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
 | 
			
		||||
 | 
			
		||||
Makefile: Makefile.org Configure config
 | 
			
		||||
@@ -441,7 +445,7 @@ rehash.time: certs apps
 | 
			
		||||
		[ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
 | 
			
		||||
		OPENSSL_DEBUG_MEMORY=on; \
 | 
			
		||||
		export OPENSSL OPENSSL_DEBUG_MEMORY; \
 | 
			
		||||
		$(PERL) tools/c_rehash certs) && \
 | 
			
		||||
		$(PERL) tools/c_rehash certs/demo) && \
 | 
			
		||||
		touch rehash.time; \
 | 
			
		||||
	else :; fi
 | 
			
		||||
 | 
			
		||||
@@ -466,9 +470,9 @@ tags:
 | 
			
		||||
	find . -name '[^.]*.[ch]' | xargs etags -a
 | 
			
		||||
 | 
			
		||||
errors:
 | 
			
		||||
	$(PERL) util/ck_errf.pl -strict */*.c */*/*.c
 | 
			
		||||
	$(PERL) util/mkerr.pl -recurse -write
 | 
			
		||||
	(cd engines; $(MAKE) PERL=$(PERL) errors)
 | 
			
		||||
	$(PERL) util/ck_errf.pl -strict */*.c */*/*.c
 | 
			
		||||
 | 
			
		||||
stacks:
 | 
			
		||||
	$(PERL) util/mkstack.pl -write
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										230
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										230
									
								
								NEWS
									
									
									
									
									
								
							@@ -5,7 +5,57 @@
 | 
			
		||||
  This file gives a brief overview of the major changes between each OpenSSL
 | 
			
		||||
  release. For more details please read the CHANGES file.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.1:
 | 
			
		||||
  Major changes between OpenSSL 1.0.1g and OpenSSL 1.0.1h [5 Jun 2014]
 | 
			
		||||
 | 
			
		||||
      o Fix for CVE-2014-0224
 | 
			
		||||
      o Fix for CVE-2014-0221
 | 
			
		||||
      o Fix for CVE-2014-0195
 | 
			
		||||
      o Fix for CVE-2014-3470
 | 
			
		||||
      o Fix for CVE-2010-5298
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014]
 | 
			
		||||
 | 
			
		||||
      o Fix for CVE-2014-0160
 | 
			
		||||
      o Add TLS padding extension workaround for broken servers.
 | 
			
		||||
      o Fix for CVE-2014-0076
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1e and OpenSSL 1.0.1f [6 Jan 2014]
 | 
			
		||||
 | 
			
		||||
      o Don't include gmt_unix_time in TLS server and client random values
 | 
			
		||||
      o Fix for TLS record tampering bug CVE-2013-4353
 | 
			
		||||
      o Fix for TLS version checking bug CVE-2013-6449
 | 
			
		||||
      o Fix for DTLS retransmission bug CVE-2013-6450
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1d and OpenSSL 1.0.1e [11 Feb 2013]:
 | 
			
		||||
 | 
			
		||||
      o Corrected fix for CVE-2013-0169
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1c and OpenSSL 1.0.1d [4 Feb 2013]:
 | 
			
		||||
 | 
			
		||||
      o Fix renegotiation in TLS 1.1, 1.2 by using the correct TLS version.
 | 
			
		||||
      o Include the fips configuration module.
 | 
			
		||||
      o Fix OCSP bad key DoS attack CVE-2013-0166
 | 
			
		||||
      o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
 | 
			
		||||
      o Fix for TLS AESNI record handling flaw CVE-2012-2686
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1b and OpenSSL 1.0.1c [10 May 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix TLS/DTLS record length checking bug CVE-2012-2333
 | 
			
		||||
      o Don't attempt to use non-FIPS composite ciphers in FIPS mode.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1a and OpenSSL 1.0.1b [26 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix compilation error on non-x86 platforms.
 | 
			
		||||
      o Make FIPS capable OpenSSL ciphers work in non-FIPS mode.
 | 
			
		||||
      o Fix SSL_OP_NO_TLSv1_1 clash with SSL_OP_ALL in OpenSSL 1.0.0
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.1 and OpenSSL 1.0.1a [19 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for ASN1 overflow bug CVE-2012-2110
 | 
			
		||||
      o Workarounds for some servers that hang on long client hellos.
 | 
			
		||||
      o Fix SEGV in AES code.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1 [14 Mar 2012]:
 | 
			
		||||
 | 
			
		||||
      o TLS/DTLS heartbeat support.
 | 
			
		||||
      o SCTP support.
 | 
			
		||||
@@ -18,7 +68,38 @@
 | 
			
		||||
      o Preliminary FIPS capability for unvalidated 2.0 FIPS module.
 | 
			
		||||
      o SRP support.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e:
 | 
			
		||||
  Major changes between OpenSSL 1.0.0j and OpenSSL 1.0.0k [5 Feb 2013]:
 | 
			
		||||
 | 
			
		||||
      o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
 | 
			
		||||
      o Fix OCSP bad key DoS attack CVE-2013-0166
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0i and OpenSSL 1.0.0j [10 May 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix DTLS record length checking bug CVE-2012-2333
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.0i [19 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for ASN1 overflow bug CVE-2012-2110
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h [12 Mar 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for CMS/PKCS#7 MMA CVE-2012-0884
 | 
			
		||||
      o Corrected fix for CVE-2011-4619
 | 
			
		||||
      o Various DTLS fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0f and OpenSSL 1.0.0g [18 Jan 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for DTLS DoS issue CVE-2012-0050
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f [4 Jan 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for DTLS plaintext recovery attack CVE-2011-4108
 | 
			
		||||
      o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
 | 
			
		||||
      o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
 | 
			
		||||
      o Check parameters are not NULL in GOST ENGINE CVE-2012-0027
 | 
			
		||||
      o Check for malformed RFC3779 data CVE-2011-4577
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e [6 Sep 2011]:
 | 
			
		||||
 | 
			
		||||
      o Fix for CRL vulnerability issue CVE-2011-3207
 | 
			
		||||
      o Fix for ECDH crashes CVE-2011-3210
 | 
			
		||||
@@ -26,11 +107,11 @@
 | 
			
		||||
      o Support ECDH ciphersuites for certificates using SHA2 algorithms.
 | 
			
		||||
      o Various DTLS fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d:
 | 
			
		||||
  Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d [8 Feb 2011]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2011-0014
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c:
 | 
			
		||||
  Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c [2 Dec 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-4180
 | 
			
		||||
      o Fix for CVE-2010-4252
 | 
			
		||||
@@ -38,18 +119,18 @@
 | 
			
		||||
      o Fix various platform compilation issues.
 | 
			
		||||
      o Corrected fix for security issue CVE-2010-3864.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b:
 | 
			
		||||
  Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b [16 Nov 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-3864.
 | 
			
		||||
      o Fix for CVE-2010-2939
 | 
			
		||||
      o Fix WIN32 build system for GOST ENGINE.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a:
 | 
			
		||||
  Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a [1 Jun 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-1633.
 | 
			
		||||
      o GOST MAC and CFB fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0 [29 Mar 2010]:
 | 
			
		||||
 | 
			
		||||
      o RFC3280 path validation: sufficient to process PKITS tests.
 | 
			
		||||
      o Integrated support for PVK files and keyblobs.
 | 
			
		||||
@@ -72,20 +153,55 @@
 | 
			
		||||
      o Opaque PRF Input TLS extension support.
 | 
			
		||||
      o Updated time routines to avoid OS limitations.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y [5 Feb 2013]:
 | 
			
		||||
 | 
			
		||||
      o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
 | 
			
		||||
      o Fix OCSP bad key DoS attack CVE-2013-0166
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x [10 May 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix DTLS record length checking bug CVE-2012-2333
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w [23 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110)
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v [19 Apr 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for ASN1 overflow bug CVE-2012-2110
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u [12 Mar 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for CMS/PKCS#7 MMA CVE-2012-0884
 | 
			
		||||
      o Corrected fix for CVE-2011-4619
 | 
			
		||||
      o Various DTLS fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t [18 Jan 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for DTLS DoS issue CVE-2012-0050
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s [4 Jan 2012]:
 | 
			
		||||
 | 
			
		||||
      o Fix for DTLS plaintext recovery attack CVE-2011-4108
 | 
			
		||||
      o Fix policy check double free error CVE-2011-4109
 | 
			
		||||
      o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
 | 
			
		||||
      o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
 | 
			
		||||
      o Check for malformed RFC3779 data CVE-2011-4577
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r [8 Feb 2011]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2011-0014
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q [2 Dec 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-4180
 | 
			
		||||
      o Fix for CVE-2010-4252
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p [16 Nov 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-3864.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o [1 Jun 2010]:
 | 
			
		||||
 | 
			
		||||
      o Fix for security issue CVE-2010-0742.
 | 
			
		||||
      o Various DTLS fixes.
 | 
			
		||||
@@ -93,12 +209,12 @@
 | 
			
		||||
      o Fix for no-rc4 compilation.
 | 
			
		||||
      o Chil ENGINE unload workaround.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
 | 
			
		||||
 | 
			
		||||
      o CFB cipher definition fixes.
 | 
			
		||||
      o Fix security issues CVE-2010-0740 and CVE-2010-0433.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m [25 Feb 2010]:
 | 
			
		||||
 | 
			
		||||
      o Cipher definition fixes.
 | 
			
		||||
      o Workaround for slow RAND_poll() on some WIN32 versions.
 | 
			
		||||
@@ -110,33 +226,33 @@
 | 
			
		||||
      o Ticket and SNI coexistence fixes.
 | 
			
		||||
      o Many fixes to DTLS handling. 
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l [5 Nov 2009]:
 | 
			
		||||
 | 
			
		||||
      o Temporary work around for CVE-2009-3555: disable renegotiation.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k [25 Mar 2009]:
 | 
			
		||||
 | 
			
		||||
      o Fix various build issues.
 | 
			
		||||
      o Fix security issues (CVE-2009-0590, CVE-2009-0591, CVE-2009-0789)
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j [7 Jan 2009]:
 | 
			
		||||
 | 
			
		||||
      o Fix security issue (CVE-2008-5077)
 | 
			
		||||
      o Merge FIPS 140-2 branch code.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h [28 May 2008]:
 | 
			
		||||
 | 
			
		||||
      o CryptoAPI ENGINE support.
 | 
			
		||||
      o Various precautionary measures.
 | 
			
		||||
      o Fix for bugs affecting certificate request creation.
 | 
			
		||||
      o Support for local machine keyset attribute in PKCS#12 files.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g [19 Oct 2007]:
 | 
			
		||||
 | 
			
		||||
      o Backport of CMS functionality to 0.9.8.
 | 
			
		||||
      o Fixes for bugs introduced with 0.9.8f.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f [11 Oct 2007]:
 | 
			
		||||
 | 
			
		||||
      o Add gcc 4.2 support.
 | 
			
		||||
      o Add support for AES and SSE2 assembly lanugauge optimization
 | 
			
		||||
@@ -147,23 +263,23 @@
 | 
			
		||||
      o RFC4507bis support.
 | 
			
		||||
      o TLS Extensions support.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e [23 Feb 2007]:
 | 
			
		||||
 | 
			
		||||
      o Various ciphersuite selection fixes.
 | 
			
		||||
      o RFC3779 support.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d [28 Sep 2006]:
 | 
			
		||||
 | 
			
		||||
      o Introduce limits to prevent malicious key DoS  (CVE-2006-2940)
 | 
			
		||||
      o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
 | 
			
		||||
      o Changes to ciphersuite selection algorithm
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c [5 Sep 2006]:
 | 
			
		||||
 | 
			
		||||
      o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
 | 
			
		||||
      o New cipher Camellia
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b [4 May 2006]:
 | 
			
		||||
 | 
			
		||||
      o Cipher string fixes.
 | 
			
		||||
      o Fixes for VC++ 2005.
 | 
			
		||||
@@ -173,12 +289,12 @@
 | 
			
		||||
      o Built in dynamic engine compilation support on Win32.
 | 
			
		||||
      o Fixes auto dynamic engine loading in Win32.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a:
 | 
			
		||||
  Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a [11 Oct 2005]:
 | 
			
		||||
 | 
			
		||||
      o Fix potential SSL 2.0 rollback, CVE-2005-2969
 | 
			
		||||
      o Extended Windows CE support
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8 [5 Jul 2005]:
 | 
			
		||||
 | 
			
		||||
      o Major work on the BIGNUM library for higher efficiency and to
 | 
			
		||||
        make operations more streamlined and less contradictory.  This
 | 
			
		||||
@@ -252,36 +368,36 @@
 | 
			
		||||
      o Added initial support for Win64.
 | 
			
		||||
      o Added alternate pkg-config files.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m [23 Feb 2007]:
 | 
			
		||||
 | 
			
		||||
      o FIPS 1.1.1 module linking.
 | 
			
		||||
      o Various ciphersuite selection fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l [28 Sep 2006]:
 | 
			
		||||
 | 
			
		||||
      o Introduce limits to prevent malicious key DoS  (CVE-2006-2940)
 | 
			
		||||
      o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k [5 Sep 2006]:
 | 
			
		||||
 | 
			
		||||
      o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j [4 May 2006]:
 | 
			
		||||
 | 
			
		||||
      o Visual C++ 2005 fixes.
 | 
			
		||||
      o Update Windows build system for FIPS.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]:
 | 
			
		||||
 | 
			
		||||
      o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h [11 Oct 2005]:
 | 
			
		||||
 | 
			
		||||
      o Fix SSL 2.0 Rollback, CVE-2005-2969
 | 
			
		||||
      o Allow use of fixed-length exponent on DSA signing
 | 
			
		||||
      o Default fixed-window RSA, DSA, DH private-key operations
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g [11 Apr 2005]:
 | 
			
		||||
 | 
			
		||||
      o More compilation issues fixed.
 | 
			
		||||
      o Adaptation to more modern Kerberos API.
 | 
			
		||||
@@ -290,7 +406,7 @@
 | 
			
		||||
      o More constification.
 | 
			
		||||
      o Added processing of proxy certificates (RFC 3820).
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f [22 Mar 2005]:
 | 
			
		||||
 | 
			
		||||
      o Several compilation issues fixed.
 | 
			
		||||
      o Many memory allocation failure checks added.
 | 
			
		||||
@@ -298,12 +414,12 @@
 | 
			
		||||
      o Mandatory basic checks on certificates.
 | 
			
		||||
      o Performance improvements.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e [25 Oct 2004]:
 | 
			
		||||
 | 
			
		||||
      o Fix race condition in CRL checking code.
 | 
			
		||||
      o Fixes to PKCS#7 (S/MIME) code.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d [17 Mar 2004]:
 | 
			
		||||
 | 
			
		||||
      o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug
 | 
			
		||||
      o Security: Fix null-pointer assignment in do_change_cipher_spec()
 | 
			
		||||
@@ -311,14 +427,14 @@
 | 
			
		||||
      o Multiple X509 verification fixes
 | 
			
		||||
      o Speed up HMAC and other operations
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c [30 Sep 2003]:
 | 
			
		||||
 | 
			
		||||
      o Security: fix various ASN1 parsing bugs.
 | 
			
		||||
      o New -ignore_err option to OCSP utility.
 | 
			
		||||
      o Various interop and bug fixes in S/MIME code.
 | 
			
		||||
      o SSL/TLS protocol fix for unrequested client certificates.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b [10 Apr 2003]:
 | 
			
		||||
 | 
			
		||||
      o Security: counter the Klima-Pokorny-Rosa extension of
 | 
			
		||||
        Bleichbacher's attack 
 | 
			
		||||
@@ -329,7 +445,7 @@
 | 
			
		||||
      o ASN.1: treat domainComponent correctly.
 | 
			
		||||
      o Documentation: fixes and additions.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a:
 | 
			
		||||
  Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a [19 Feb 2003]:
 | 
			
		||||
 | 
			
		||||
      o Security: Important security related bugfixes.
 | 
			
		||||
      o Enhanced compatibility with MIT Kerberos.
 | 
			
		||||
@@ -340,7 +456,7 @@
 | 
			
		||||
      o SSL/TLS: now handles manual certificate chain building.
 | 
			
		||||
      o SSL/TLS: certain session ID malfunctions corrected.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7 [30 Dec 2002]:
 | 
			
		||||
 | 
			
		||||
      o New library section OCSP.
 | 
			
		||||
      o Complete rewrite of ASN1 code.
 | 
			
		||||
@@ -386,23 +502,23 @@
 | 
			
		||||
      o SSL/TLS: add callback to retrieve SSL/TLS messages.
 | 
			
		||||
      o SSL/TLS: support AES cipher suites (RFC3268).
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k [30 Sep 2003]:
 | 
			
		||||
 | 
			
		||||
      o Security: fix various ASN1 parsing bugs.
 | 
			
		||||
      o SSL/TLS protocol fix for unrequested client certificates.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j [10 Apr 2003]:
 | 
			
		||||
 | 
			
		||||
      o Security: counter the Klima-Pokorny-Rosa extension of
 | 
			
		||||
        Bleichbacher's attack 
 | 
			
		||||
      o Security: make RSA blinding default.
 | 
			
		||||
      o Build: shared library support fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i [19 Feb 2003]:
 | 
			
		||||
 | 
			
		||||
      o Important security related bugfixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h [5 Dec 2002]:
 | 
			
		||||
 | 
			
		||||
      o New configuration targets for Tandem OSS and A/UX.
 | 
			
		||||
      o New OIDs for Microsoft attributes.
 | 
			
		||||
@@ -416,25 +532,25 @@
 | 
			
		||||
      o Fixes for smaller building problems.
 | 
			
		||||
      o Updates of manuals, FAQ and other instructive documents.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g [9 Aug 2002]:
 | 
			
		||||
 | 
			
		||||
      o Important building fixes on Unix.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f [8 Aug 2002]:
 | 
			
		||||
 | 
			
		||||
      o Various important bugfixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e [30 Jul 2002]:
 | 
			
		||||
 | 
			
		||||
      o Important security related bugfixes.
 | 
			
		||||
      o Various SSL/TLS library bugfixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d [9 May 2002]:
 | 
			
		||||
 | 
			
		||||
      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:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c [21 Dec 2001]:
 | 
			
		||||
 | 
			
		||||
      o Various SSL/TLS library bugfixes.
 | 
			
		||||
      o BIGNUM library fixes.
 | 
			
		||||
@@ -447,7 +563,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:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b [9 Jul 2001]:
 | 
			
		||||
 | 
			
		||||
      o Security fix: PRNG improvements.
 | 
			
		||||
      o Security fix: RSA OAEP check.
 | 
			
		||||
@@ -464,7 +580,7 @@
 | 
			
		||||
      o Increase default size for BIO buffering filter.
 | 
			
		||||
      o Compatibility fixes in some scripts.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a:
 | 
			
		||||
  Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a [5 Apr 2001]:
 | 
			
		||||
 | 
			
		||||
      o Security fix: change behavior of OpenSSL to avoid using
 | 
			
		||||
        environment variables when running as root.
 | 
			
		||||
@@ -489,7 +605,7 @@
 | 
			
		||||
      o New function BN_rand_range().
 | 
			
		||||
      o Add "-rand" option to openssl s_client and s_server.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6:
 | 
			
		||||
  Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6 [10 Oct 2000]:
 | 
			
		||||
 | 
			
		||||
      o Some documentation for BIO and SSL libraries.
 | 
			
		||||
      o Enhanced chain verification using key identifiers.
 | 
			
		||||
@@ -504,7 +620,7 @@
 | 
			
		||||
    [1] The support for external crypto devices is currently a separate
 | 
			
		||||
        distribution.  See the file README.ENGINE.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a:
 | 
			
		||||
  Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a [1 Apr 2000]:
 | 
			
		||||
 | 
			
		||||
      o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8 
 | 
			
		||||
      o Shared library support for HPUX and Solaris-gcc
 | 
			
		||||
@@ -513,7 +629,7 @@
 | 
			
		||||
      o New 'rand' application
 | 
			
		||||
      o New way to check for existence of algorithms from scripts
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5:
 | 
			
		||||
  Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5 [25 May 2000]:
 | 
			
		||||
 | 
			
		||||
      o S/MIME support in new 'smime' command
 | 
			
		||||
      o Documentation for the OpenSSL command line application
 | 
			
		||||
@@ -549,7 +665,7 @@
 | 
			
		||||
      o Enhanced support for Alpha Linux
 | 
			
		||||
      o Experimental MacOS support
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4:
 | 
			
		||||
  Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4 [9 Aug 1999]:
 | 
			
		||||
 | 
			
		||||
      o Transparent support for PKCS#8 format private keys: these are used
 | 
			
		||||
        by several software packages and are more secure than the standard
 | 
			
		||||
@@ -560,7 +676,7 @@
 | 
			
		||||
      o New pipe-like BIO that allows using the SSL library when actual I/O
 | 
			
		||||
        must be handled by the application (BIO pair)
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3:
 | 
			
		||||
  Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3 [24 May 1999]:
 | 
			
		||||
      o Lots of enhancements and cleanups to the Configuration mechanism
 | 
			
		||||
      o RSA OEAP related fixes
 | 
			
		||||
      o Added `openssl ca -revoke' option for revoking a certificate
 | 
			
		||||
@@ -574,7 +690,7 @@
 | 
			
		||||
      o Sparc assembler bignum implementation, optimized hash functions
 | 
			
		||||
      o Option to disable selected ciphers
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b:
 | 
			
		||||
  Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b [22 Mar 1999]:
 | 
			
		||||
      o Fixed a security hole related to session resumption
 | 
			
		||||
      o Fixed RSA encryption routines for the p < q case
 | 
			
		||||
      o "ALL" in cipher lists now means "everything except NULL ciphers"
 | 
			
		||||
@@ -596,7 +712,7 @@
 | 
			
		||||
      o Lots of memory leak fixes.
 | 
			
		||||
      o Lots of bug fixes.
 | 
			
		||||
 | 
			
		||||
  Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c:
 | 
			
		||||
  Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c [23 Dec 1998]:
 | 
			
		||||
      o Integration of the popular NO_RSA/NO_DSA patches
 | 
			
		||||
      o Initial support for compression inside the SSL record layer
 | 
			
		||||
      o Added BIO proxy and filtering functionality
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								PROBLEMS
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								PROBLEMS
									
									
									
									
									
								
							@@ -197,3 +197,17 @@ reconfigure with additional no-sse2 [or 386] option passed to ./config.
 | 
			
		||||
We don't have framework to associate -ldl with no-dso, therefore the only
 | 
			
		||||
way is to edit Makefile right after ./config no-dso and remove -ldl from
 | 
			
		||||
EX_LIBS line.
 | 
			
		||||
 | 
			
		||||
* hpux-parisc2-cc no-asm build fails with SEGV in ECDSA/DH.
 | 
			
		||||
 | 
			
		||||
Compiler bug, presumably at particular patch level. Remaining
 | 
			
		||||
hpux*-parisc*-cc configurations can be affected too. Drop optimization
 | 
			
		||||
level to +O2 when compiling bn_nist.o.
 | 
			
		||||
 | 
			
		||||
* solaris64-sparcv9-cc link failure
 | 
			
		||||
 | 
			
		||||
Solaris 8 ar can fail to maintain symbol table in .a, which results in
 | 
			
		||||
link failures. Apply 109147-09 or later or modify Makefile generated
 | 
			
		||||
by ./Configure solaris64-sparcv9-cc and replace RANLIB assignment with
 | 
			
		||||
 | 
			
		||||
	RANLIB= /usr/ccs/bin/ar rs
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								README
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 1.0.1-beta1 3 Jan 2012
 | 
			
		||||
 OpenSSL 1.0.1h 5 Jun 2014
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2011 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
@@ -190,7 +190,7 @@
 | 
			
		||||
 reason as to why that feature isn't implemented.
 | 
			
		||||
 | 
			
		||||
 Patches should be as up to date as possible, preferably relative to the
 | 
			
		||||
 current CVS or the last snapshot. They should follow the coding style of
 | 
			
		||||
 current Git or the last snapshot. They should follow the coding style of
 | 
			
		||||
 OpenSSL and compile without warnings. Some of the core team developer targets
 | 
			
		||||
 can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
 | 
			
		||||
 compiles on many varied platforms: try to ensure you only use portable
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										148
									
								
								STATUS
									
									
									
									
									
								
							
							
						
						
									
										148
									
								
								STATUS
									
									
									
									
									
								
							@@ -1,148 +0,0 @@
 | 
			
		||||
 | 
			
		||||
  OpenSSL STATUS                           Last modified at
 | 
			
		||||
  ______________                           $Date: 2012/01/03 13:30:27 $
 | 
			
		||||
 | 
			
		||||
  DEVELOPMENT STATE
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL 1.1.0:  Under development...
 | 
			
		||||
    o  OpenSSL 1.0.1-beta1: Released on January 3rd, 2011
 | 
			
		||||
    o  OpenSSL 1.0.0d: Released on February   8nd, 2011
 | 
			
		||||
    o  OpenSSL 1.0.0c: Released on December   2nd, 2010
 | 
			
		||||
    o  OpenSSL 1.0.0b: Released on November  16th, 2010
 | 
			
		||||
    o  OpenSSL 1.0.0a: Released on June      1st,  2010
 | 
			
		||||
    o  OpenSSL 1.0.0:  Released on March     29th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8r: Released on February   8nd, 2011
 | 
			
		||||
    o  OpenSSL 0.9.8q: Released on December   2nd, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8p: Released on November  16th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8o: Released on June       1st, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8n: Released on March     24th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8m: Released on February  25th, 2010
 | 
			
		||||
    o  OpenSSL 0.9.8l: Released on November   5th, 2009
 | 
			
		||||
    o  OpenSSL 0.9.8k: Released on March     25th, 2009
 | 
			
		||||
    o  OpenSSL 0.9.8j: Released on January    7th, 2009
 | 
			
		||||
    o  OpenSSL 0.9.8i: Released on September 15th, 2008
 | 
			
		||||
    o  OpenSSL 0.9.8h: Released on May       28th, 2008
 | 
			
		||||
    o  OpenSSL 0.9.8g: Released on October   19th, 2007
 | 
			
		||||
    o  OpenSSL 0.9.8f: Released on October   11th, 2007
 | 
			
		||||
    o  OpenSSL 0.9.8e: Released on February  23rd, 2007
 | 
			
		||||
    o  OpenSSL 0.9.8d: Released on September 28th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.8c: Released on September  5th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.8b: Released on May        4th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.8a: Released on October   11th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.8:  Released on July       5th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7m: Released on February  23rd, 2007
 | 
			
		||||
    o  OpenSSL 0.9.7l: Released on September 28th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.7k: Released on September  5th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.7j: Released on May        4th, 2006
 | 
			
		||||
    o  OpenSSL 0.9.7i: Released on October   14th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7h: Released on October   11th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7g: Released on April     11th, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7f: Released on March     22nd, 2005
 | 
			
		||||
    o  OpenSSL 0.9.7e: Released on October   25th, 2004
 | 
			
		||||
    o  OpenSSL 0.9.7d: Released on March     17th, 2004
 | 
			
		||||
    o  OpenSSL 0.9.7c: Released on September 30th, 2003
 | 
			
		||||
    o  OpenSSL 0.9.7b: Released on April     10th, 2003
 | 
			
		||||
    o  OpenSSL 0.9.7a: Released on February  19th, 2003
 | 
			
		||||
    o  OpenSSL 0.9.7:  Released on December  31st, 2002
 | 
			
		||||
    o  OpenSSL 0.9.6m: Released on March     17th, 2004
 | 
			
		||||
    o  OpenSSL 0.9.6l: Released on November   4th, 2003
 | 
			
		||||
    o  OpenSSL 0.9.6k: Released on September 30th, 2003
 | 
			
		||||
    o  OpenSSL 0.9.6j: Released on April     10th, 2003
 | 
			
		||||
    o  OpenSSL 0.9.6i: Released on February  19th, 2003
 | 
			
		||||
    o  OpenSSL 0.9.6h: Released on December   5th, 2002
 | 
			
		||||
    o  OpenSSL 0.9.6g: Released on August     9th, 2002
 | 
			
		||||
    o  OpenSSL 0.9.6f: Released on August     8th, 2002
 | 
			
		||||
    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
 | 
			
		||||
    o  OpenSSL 0.9.5a: Released on April      1st, 2000
 | 
			
		||||
    o  OpenSSL 0.9.5:  Released on February  28th, 2000
 | 
			
		||||
    o  OpenSSL 0.9.4:  Released on August    09th, 1999
 | 
			
		||||
    o  OpenSSL 0.9.3a: Released on May       29th, 1999
 | 
			
		||||
    o  OpenSSL 0.9.3:  Released on May       25th, 1999
 | 
			
		||||
    o  OpenSSL 0.9.2b: Released on March     22th, 1999
 | 
			
		||||
    o  OpenSSL 0.9.1c: Released on December  23th, 1998
 | 
			
		||||
 | 
			
		||||
  [See also http://www.openssl.org/support/rt.html]
 | 
			
		||||
 | 
			
		||||
  RELEASE SHOWSTOPPERS
 | 
			
		||||
 | 
			
		||||
    o The Makefiles fail with some SysV makes.
 | 
			
		||||
    o 
 | 
			
		||||
 | 
			
		||||
  AVAILABLE PATCHES
 | 
			
		||||
 | 
			
		||||
    o 
 | 
			
		||||
 | 
			
		||||
  IN PROGRESS
 | 
			
		||||
 | 
			
		||||
    o Steve is currently working on (in no particular order):
 | 
			
		||||
        ASN1 code redesign, butchery, replacement.
 | 
			
		||||
        OCSP
 | 
			
		||||
        EVP cipher enhancement.
 | 
			
		||||
        Enhanced certificate chain verification.
 | 
			
		||||
	Private key, certificate and CRL API and implementation.
 | 
			
		||||
	Developing and bugfixing PKCS#7 (S/MIME code).
 | 
			
		||||
        Various X509 issues: character sets, certificate request extensions.
 | 
			
		||||
    o Richard is currently working on:
 | 
			
		||||
	Constification
 | 
			
		||||
	Attribute Certificate support
 | 
			
		||||
	Certificate Pair support
 | 
			
		||||
	Storage Engines (primarly an LDAP storage engine)
 | 
			
		||||
	Certificate chain validation with full RFC 3280 compatibility
 | 
			
		||||
 | 
			
		||||
  NEEDS PATCH
 | 
			
		||||
 | 
			
		||||
    o  0.9.8-dev: COMPLEMENTOFALL and COMPLEMENTOFDEFAULT do not
 | 
			
		||||
       handle ECCdraft cipher suites correctly.
 | 
			
		||||
 | 
			
		||||
    o  apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file
 | 
			
		||||
 | 
			
		||||
    o  "OpenSSL STATUS" is never up-to-date.
 | 
			
		||||
 | 
			
		||||
  OPEN ISSUES
 | 
			
		||||
 | 
			
		||||
    o  The Makefile hierarchy and build mechanism is still not a round thing:
 | 
			
		||||
 | 
			
		||||
       1. The config vs. Configure scripts
 | 
			
		||||
          It's the same nasty situation as for Apache with APACI vs.
 | 
			
		||||
          src/Configure. It confuses.
 | 
			
		||||
          Suggestion: Merge Configure and config into a single configure
 | 
			
		||||
                      script with a Autoconf style interface ;-) and remove
 | 
			
		||||
                      Configure and config. Or even let us use GNU Autoconf
 | 
			
		||||
                      itself. Then we can avoid a lot of those platform checks
 | 
			
		||||
                      which are currently in Configure.
 | 
			
		||||
 | 
			
		||||
    o  Support for Shared Libraries has to be added at least
 | 
			
		||||
       for the major Unix platforms. The details we can rip from the stuff
 | 
			
		||||
       Ralf has done for the Apache src/Configure script. Ben wants the
 | 
			
		||||
       solution to be really simple.
 | 
			
		||||
 | 
			
		||||
       Status: Ralf will look how we can easily incorporate the
 | 
			
		||||
               compiler PIC and linker DSO flags from Apache
 | 
			
		||||
               into the OpenSSL Configure script.
 | 
			
		||||
 | 
			
		||||
               Ulf: +1 for using GNU autoconf and libtool (but not automake,
 | 
			
		||||
                    which apparently is not flexible enough to generate
 | 
			
		||||
                    libcrypto)
 | 
			
		||||
 | 
			
		||||
  WISHES
 | 
			
		||||
 | 
			
		||||
    o  Add variants of DH_generate_parameters() and BN_generate_prime() [etc?]
 | 
			
		||||
       where the callback function can request that the function be aborted.
 | 
			
		||||
       [Gregory Stark <ghstark@pobox.com>, <rayyang2000@yahoo.com>]
 | 
			
		||||
 | 
			
		||||
    o  SRP in TLS.
 | 
			
		||||
       [wished by:
 | 
			
		||||
        Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
 | 
			
		||||
        Tom Holroyd <tomh@po.crl.go.jp>]
 | 
			
		||||
 | 
			
		||||
       See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
 | 
			
		||||
       as well as http://www-cs-students.stanford.edu/~tjw/srp/.
 | 
			
		||||
 | 
			
		||||
       Tom Holroyd tells us there is a SRP patch for OpenSSH at
 | 
			
		||||
       http://members.tripod.com/professor_tom/archives/, that could
 | 
			
		||||
       be useful.
 | 
			
		||||
							
								
								
									
										120
									
								
								TABLE
									
									
									
									
									
								
							
							
						
						
									
										120
									
								
								TABLE
									
									
									
									
									
								
							@@ -862,7 +862,7 @@ $multilib     =
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -qthreaded
 | 
			
		||||
$thread_cflag = -qthreaded -D_THREAD_SAFE
 | 
			
		||||
$sys_id       = AIX
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG RC4_CHAR
 | 
			
		||||
@@ -961,7 +961,7 @@ $multilib     =
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -qthreaded
 | 
			
		||||
$thread_cflag = -qthreaded -D_THREAD_SAFE
 | 
			
		||||
$sys_id       = AIX
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHAR
 | 
			
		||||
@@ -1586,7 +1586,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-VC-WIN32
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = -W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE
 | 
			
		||||
$cflags       = -W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = WIN32
 | 
			
		||||
@@ -1716,6 +1716,39 @@ $ranlib       =
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** debug-ben-darwin64
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -Wno-language-extension-token -Wno-extended-offsetof -arch x86_64 -O3 -DL_ENDIAN -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = MACOSX
 | 
			
		||||
$lflags       = -Wl,-search_paths_first%
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL
 | 
			
		||||
$cpuid_obj    = x86_64cpuid.o
 | 
			
		||||
$bn_obj       = x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = md5-x86_64.o
 | 
			
		||||
$sha1_obj     = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = wp-x86_64.o
 | 
			
		||||
$cmll_obj     = cmll-x86_64.o cmll_misc.o
 | 
			
		||||
$modes_obj    = ghash-x86_64.o
 | 
			
		||||
$engines_obj  = 
 | 
			
		||||
$perlasm_scheme = macosx
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= darwin-shared
 | 
			
		||||
$shared_cflag = -fPIC -fno-common
 | 
			
		||||
$shared_ldflag = -arch x86_64 -dynamiclib
 | 
			
		||||
$shared_extension = .$(SHLIB_MAJOR).$(SHLIB_MINOR).dylib
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** debug-ben-debug
 | 
			
		||||
$cc           = gcc44
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe
 | 
			
		||||
@@ -1749,6 +1782,39 @@ $ranlib       =
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** debug-ben-debug-64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -Wno-error=overlength-strings -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
 | 
			
		||||
$cpuid_obj    = x86_64cpuid.o
 | 
			
		||||
$bn_obj       = x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = md5-x86_64.o
 | 
			
		||||
$sha1_obj     = sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = rc4-x86_64.o rc4-md5-x86_64.o
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = wp-x86_64.o
 | 
			
		||||
$cmll_obj     = cmll-x86_64.o cmll_misc.o
 | 
			
		||||
$modes_obj    = ghash-x86_64.o
 | 
			
		||||
$engines_obj  = 
 | 
			
		||||
$perlasm_scheme = elf
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= bsd-gcc-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** debug-ben-macos
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -arch i386 -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe
 | 
			
		||||
@@ -1949,7 +2015,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-bodo
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2114,7 +2180,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-levitte-linux-elf
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2147,7 +2213,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-levitte-linux-elf-extreme
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2180,7 +2246,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-levitte-linux-noasm
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2213,7 +2279,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-levitte-linux-noasm-extreme
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$cflags       = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2741,7 +2807,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-steve64
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -3298,7 +3364,7 @@ $shared_ldflag = -shared
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
$multilib     = /pa1.1
 | 
			
		||||
 | 
			
		||||
*** hpux-parisc2-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
@@ -3308,22 +3374,22 @@ $thread_cflag =
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = -Wl,+s -ldld
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = pa-risc2.o
 | 
			
		||||
$cpuid_obj    = pariscid.o
 | 
			
		||||
$bn_obj       = pa-risc2.o parisc-mont.o
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$aes_obj      = aes_core.o aes_cbc.o aes-parisc.o
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$sha1_obj     = sha1-parisc.o sha256-parisc.o sha512-parisc.o
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rc4_obj      = rc4-parisc.o
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = 
 | 
			
		||||
$cmll_obj     = 
 | 
			
		||||
$modes_obj    = 
 | 
			
		||||
$modes_obj    = ghash-parisc.o
 | 
			
		||||
$engines_obj  = 
 | 
			
		||||
$perlasm_scheme = void
 | 
			
		||||
$perlasm_scheme = 32
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = +Z
 | 
			
		||||
@@ -3331,7 +3397,7 @@ $shared_ldflag = -b
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
$multilib     = /pa20_32
 | 
			
		||||
 | 
			
		||||
*** hpux-parisc2-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
@@ -3341,22 +3407,22 @@ $thread_cflag =
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = -Wl,+s -ldld
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = pa-risc2.o
 | 
			
		||||
$cpuid_obj    = pariscid.o
 | 
			
		||||
$bn_obj       = pa-risc2.o parisc-mont.o
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$aes_obj      = aes_core.o aes_cbc.o aes-parisc.o
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$sha1_obj     = sha1-parisc.o sha256-parisc.o sha512-parisc.o
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rc4_obj      = rc4-parisc.o
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = 
 | 
			
		||||
$cmll_obj     = 
 | 
			
		||||
$modes_obj    = 
 | 
			
		||||
$modes_obj    = ghash-parisc.o
 | 
			
		||||
$engines_obj  = 
 | 
			
		||||
$perlasm_scheme = void
 | 
			
		||||
$perlasm_scheme = 32
 | 
			
		||||
$dso_scheme   = dl
 | 
			
		||||
$shared_target= hpux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
@@ -3364,7 +3430,7 @@ $shared_ldflag = -shared
 | 
			
		||||
$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
$multilib     = /pa20_32
 | 
			
		||||
 | 
			
		||||
*** hpux64-ia64-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
@@ -5441,7 +5507,7 @@ $shared_target= solaris-shared
 | 
			
		||||
$shared_cflag = -KPIC
 | 
			
		||||
$shared_ldflag = -xarch=v9 -G -dy -z text
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = /usr/ccs/bin/ar rs
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = /64
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -577,14 +577,15 @@ openssl.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
 | 
			
		||||
openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
 | 
			
		||||
openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
 | 
			
		||||
openssl.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
 | 
			
		||||
openssl.o: ../include/openssl/sha.h ../include/openssl/srtp.h
 | 
			
		||||
openssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
 | 
			
		||||
openssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
 | 
			
		||||
openssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 | 
			
		||||
openssl.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
 | 
			
		||||
openssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
 | 
			
		||||
openssl.o: ../include/openssl/x509v3.h apps.h openssl.c progs.h s_apps.h
 | 
			
		||||
openssl.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
 | 
			
		||||
openssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 | 
			
		||||
openssl.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
 | 
			
		||||
openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
 | 
			
		||||
openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
 | 
			
		||||
openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
 | 
			
		||||
openssl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
 | 
			
		||||
openssl.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
 | 
			
		||||
openssl.o: openssl.c progs.h s_apps.h
 | 
			
		||||
passwd.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 | 
			
		||||
passwd.o: ../include/openssl/buffer.h ../include/openssl/conf.h
 | 
			
		||||
passwd.o: ../include/openssl/crypto.h ../include/openssl/des.h
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								apps/apps.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								apps/apps.c
									
									
									
									
									
								
							@@ -109,7 +109,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _POSIX_C_SOURCE
 | 
			
		||||
#if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS)
 | 
			
		||||
#define _POSIX_C_SOURCE 2	/* On VMS, you need to define this to get
 | 
			
		||||
				   the declaration of fileno().  The value
 | 
			
		||||
				   2 is to make sure no function defined
 | 
			
		||||
@@ -586,12 +586,12 @@ int password_callback(char *buf, int bufsiz, int verify,
 | 
			
		||||
 | 
			
		||||
		if (ok >= 0)
 | 
			
		||||
			ok = UI_add_input_string(ui,prompt,ui_flags,buf,
 | 
			
		||||
				PW_MIN_LENGTH,BUFSIZ-1);
 | 
			
		||||
				PW_MIN_LENGTH,bufsiz-1);
 | 
			
		||||
		if (ok >= 0 && verify)
 | 
			
		||||
			{
 | 
			
		||||
			buff = (char *)OPENSSL_malloc(bufsiz);
 | 
			
		||||
			ok = UI_add_verify_string(ui,prompt,ui_flags,buff,
 | 
			
		||||
				PW_MIN_LENGTH,BUFSIZ-1, buf);
 | 
			
		||||
				PW_MIN_LENGTH,bufsiz-1, buf);
 | 
			
		||||
			}
 | 
			
		||||
		if (ok >= 0)
 | 
			
		||||
			do
 | 
			
		||||
@@ -1215,7 +1215,8 @@ STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
 | 
			
		||||
	const char *pass, ENGINE *e, const char *desc)
 | 
			
		||||
	{
 | 
			
		||||
	STACK_OF(X509) *certs;
 | 
			
		||||
	load_certs_crls(err, file, format, pass, e, desc, &certs, NULL);
 | 
			
		||||
	if (!load_certs_crls(err, file, format, pass, e, desc, &certs, NULL))
 | 
			
		||||
		return NULL;
 | 
			
		||||
	return certs;
 | 
			
		||||
	}	
 | 
			
		||||
 | 
			
		||||
@@ -1223,7 +1224,8 @@ STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
 | 
			
		||||
	const char *pass, ENGINE *e, const char *desc)
 | 
			
		||||
	{
 | 
			
		||||
	STACK_OF(X509_CRL) *crls;
 | 
			
		||||
	load_certs_crls(err, file, format, pass, e, desc, NULL, &crls);
 | 
			
		||||
	if (!load_certs_crls(err, file, format, pass, e, desc, NULL, &crls))
 | 
			
		||||
		return NULL;
 | 
			
		||||
	return crls;
 | 
			
		||||
	}	
 | 
			
		||||
 | 
			
		||||
@@ -2130,7 +2132,7 @@ X509_NAME *parse_name(char *subject, long chtype, int multirdn)
 | 
			
		||||
	X509_NAME *n = NULL;
 | 
			
		||||
	int nid;
 | 
			
		||||
 | 
			
		||||
	if (!buf || !ne_types || !ne_values)
 | 
			
		||||
	if (!buf || !ne_types || !ne_values || !mval)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err, "malloc error\n");
 | 
			
		||||
		goto error;
 | 
			
		||||
@@ -2234,6 +2236,7 @@ X509_NAME *parse_name(char *subject, long chtype, int multirdn)
 | 
			
		||||
	OPENSSL_free(ne_values);
 | 
			
		||||
	OPENSSL_free(ne_types);
 | 
			
		||||
	OPENSSL_free(buf);
 | 
			
		||||
	OPENSSL_free(mval);
 | 
			
		||||
	return n;
 | 
			
		||||
 | 
			
		||||
error:
 | 
			
		||||
@@ -2242,6 +2245,8 @@ error:
 | 
			
		||||
		OPENSSL_free(ne_values);
 | 
			
		||||
	if (ne_types)
 | 
			
		||||
		OPENSSL_free(ne_types);
 | 
			
		||||
	if (mval)
 | 
			
		||||
		OPENSSL_free(mval);
 | 
			
		||||
	if (buf)
 | 
			
		||||
		OPENSSL_free(buf);
 | 
			
		||||
	return NULL;
 | 
			
		||||
@@ -2836,7 +2841,7 @@ double app_tminterval(int stop,int usertime)
 | 
			
		||||
 | 
			
		||||
	if (proc==NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if (GetVersion() < 0x80000000)
 | 
			
		||||
		if (check_winnt())
 | 
			
		||||
			proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,
 | 
			
		||||
						GetCurrentProcessId());
 | 
			
		||||
		if (proc==NULL) proc = (HANDLE)-1;
 | 
			
		||||
 
 | 
			
		||||
@@ -188,6 +188,7 @@ extern BIO *bio_err;
 | 
			
		||||
			do { CONF_modules_unload(1); destroy_ui_method(); \
 | 
			
		||||
			OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
 | 
			
		||||
			CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
 | 
			
		||||
			RAND_cleanup(); \
 | 
			
		||||
			ERR_free_strings(); zlib_cleanup();} while(0)
 | 
			
		||||
#  else
 | 
			
		||||
#    define apps_startup() \
 | 
			
		||||
@@ -198,6 +199,7 @@ extern BIO *bio_err;
 | 
			
		||||
			do { CONF_modules_unload(1); destroy_ui_method(); \
 | 
			
		||||
			OBJ_cleanup(); EVP_cleanup(); \
 | 
			
		||||
			CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
 | 
			
		||||
			RAND_cleanup(); \
 | 
			
		||||
			ERR_free_strings(); zlib_cleanup(); } while(0)
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -1408,6 +1408,7 @@ bad:
 | 
			
		||||
			if (!NCONF_get_number(conf,section,
 | 
			
		||||
				ENV_DEFAULT_CRL_HOURS, &crlhours))
 | 
			
		||||
				crlhours = 0;
 | 
			
		||||
			ERR_clear_error();
 | 
			
		||||
			}
 | 
			
		||||
		if ((crldays == 0) && (crlhours == 0) && (crlsec == 0))
 | 
			
		||||
			{
 | 
			
		||||
@@ -2560,7 +2561,7 @@ static int get_certificate_status(const char *serial, CA_DB *db)
 | 
			
		||||
			
 | 
			
		||||
	/* Make it Upper Case */
 | 
			
		||||
	for (i=0; row[DB_serial][i] != '\0'; i++)
 | 
			
		||||
		row[DB_serial][i] = toupper(row[DB_serial][i]);
 | 
			
		||||
		row[DB_serial][i] = toupper((unsigned char)row[DB_serial][i]);
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	ok=1;
 | 
			
		||||
 
 | 
			
		||||
@@ -233,6 +233,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		else if (!strcmp(*args,"-camellia256"))
 | 
			
		||||
				cipher = EVP_camellia_256_cbc();
 | 
			
		||||
#endif
 | 
			
		||||
		else if (!strcmp (*args, "-debug_decrypt")) 
 | 
			
		||||
				flags |= CMS_DEBUG_DECRYPT;
 | 
			
		||||
		else if (!strcmp (*args, "-text")) 
 | 
			
		||||
				flags |= CMS_TEXT;
 | 
			
		||||
		else if (!strcmp (*args, "-nointern")) 
 | 
			
		||||
@@ -626,7 +628,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf (bio_err, "-certsout file certificate output file\n");
 | 
			
		||||
		BIO_printf (bio_err, "-signer file   signer certificate file\n");
 | 
			
		||||
		BIO_printf (bio_err, "-recip  file   recipient certificate file for decryption\n");
 | 
			
		||||
		BIO_printf (bio_err, "-keyid        use subject key identifier\n");
 | 
			
		||||
		BIO_printf (bio_err, "-keyid         use subject key identifier\n");
 | 
			
		||||
		BIO_printf (bio_err, "-in file       input file\n");
 | 
			
		||||
		BIO_printf (bio_err, "-inform arg    input format SMIME (default), PEM or DER\n");
 | 
			
		||||
		BIO_printf (bio_err, "-inkey file    input private key (if not signer or recipient)\n");
 | 
			
		||||
@@ -1039,6 +1041,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	ret = 4;
 | 
			
		||||
	if (operation == SMIME_DECRYPT)
 | 
			
		||||
		{
 | 
			
		||||
		if (flags & CMS_DEBUG_DECRYPT)
 | 
			
		||||
			CMS_decrypt(cms, NULL, NULL, NULL, NULL, flags);
 | 
			
		||||
 | 
			
		||||
		if (secret_key)
 | 
			
		||||
			{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								apps/crl.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								apps/crl.c
									
									
									
									
									
								
							@@ -81,6 +81,9 @@ static const char *crl_usage[]={
 | 
			
		||||
" -in arg         - input file - default stdin\n",
 | 
			
		||||
" -out arg        - output file - default stdout\n",
 | 
			
		||||
" -hash           - print hash value\n",
 | 
			
		||||
#ifndef OPENSSL_NO_MD5
 | 
			
		||||
" -hash_old       - print old-style (MD5) hash value\n",
 | 
			
		||||
#endif
 | 
			
		||||
" -fingerprint    - print the crl fingerprint\n",
 | 
			
		||||
" -issuer         - print issuer DN\n",
 | 
			
		||||
" -lastupdate     - lastUpdate field\n",
 | 
			
		||||
@@ -108,6 +111,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	int informat,outformat;
 | 
			
		||||
	char *infile=NULL,*outfile=NULL;
 | 
			
		||||
	int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
 | 
			
		||||
#ifndef OPENSSL_NO_MD5
 | 
			
		||||
       int hash_old=0;
 | 
			
		||||
#endif
 | 
			
		||||
	int fingerprint = 0, crlnumber = 0;
 | 
			
		||||
	const char **pp;
 | 
			
		||||
	X509_STORE *store = NULL;
 | 
			
		||||
@@ -192,6 +198,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			text = 1;
 | 
			
		||||
		else if (strcmp(*argv,"-hash") == 0)
 | 
			
		||||
			hash= ++num;
 | 
			
		||||
#ifndef OPENSSL_NO_MD5
 | 
			
		||||
		else if (strcmp(*argv,"-hash_old") == 0)
 | 
			
		||||
			hash_old= ++num;
 | 
			
		||||
#endif
 | 
			
		||||
		else if (strcmp(*argv,"-nameopt") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -304,6 +314,14 @@ bad:
 | 
			
		||||
				BIO_printf(bio_out,"%08lx\n",
 | 
			
		||||
					X509_NAME_hash(X509_CRL_get_issuer(x)));
 | 
			
		||||
				}
 | 
			
		||||
#ifndef OPENSSL_NO_MD5
 | 
			
		||||
			if (hash_old == i)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_out,"%08lx\n",
 | 
			
		||||
					X509_NAME_hash_old(
 | 
			
		||||
						X509_CRL_get_issuer(x)));
 | 
			
		||||
				}
 | 
			
		||||
#endif
 | 
			
		||||
			if (lastupdate == i)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_out,"lastUpdate=");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								apps/dgst.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								apps/dgst.c
									
									
									
									
									
								
							@@ -127,6 +127,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
#endif
 | 
			
		||||
	char *hmac_key=NULL;
 | 
			
		||||
	char *mac_name=NULL;
 | 
			
		||||
	int non_fips_allow = 0;
 | 
			
		||||
	STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
@@ -215,6 +216,10 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			out_bin = 1;
 | 
			
		||||
		else if (strcmp(*argv,"-d") == 0)
 | 
			
		||||
			debug=1;
 | 
			
		||||
		else if (!strcmp(*argv,"-fips-fingerprint"))
 | 
			
		||||
			hmac_key = "etaonrishdlcupfm";
 | 
			
		||||
		else if (strcmp(*argv,"-non-fips-allow") == 0)
 | 
			
		||||
			non_fips_allow=1;
 | 
			
		||||
		else if (!strcmp(*argv,"-hmac"))
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1)
 | 
			
		||||
@@ -395,6 +400,13 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (non_fips_allow)
 | 
			
		||||
		{
 | 
			
		||||
		EVP_MD_CTX *md_ctx;
 | 
			
		||||
		BIO_get_md_ctx(bmd,&md_ctx);
 | 
			
		||||
		EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (hmac_key)
 | 
			
		||||
		{
 | 
			
		||||
		sigkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, e,
 | 
			
		||||
@@ -415,9 +427,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if (do_verify)
 | 
			
		||||
			r = EVP_DigestVerifyInit(mctx, &pctx, md, e, sigkey);
 | 
			
		||||
			r = EVP_DigestVerifyInit(mctx, &pctx, md, NULL, sigkey);
 | 
			
		||||
		else
 | 
			
		||||
			r = EVP_DigestSignInit(mctx, &pctx, md, e, sigkey);
 | 
			
		||||
			r = EVP_DigestSignInit(mctx, &pctx, md, NULL, sigkey);
 | 
			
		||||
		if (!r)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err, "Error setting context\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -332,7 +332,6 @@ bad:
 | 
			
		||||
			BIO_printf(bio_err,"This is going to take a long time\n");
 | 
			
		||||
			if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb))
 | 
			
		||||
				{
 | 
			
		||||
				if(dh) DH_free(dh);
 | 
			
		||||
				ERR_print_errors(bio_err);
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
 
 | 
			
		||||
@@ -326,6 +326,7 @@ bad:
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
#endif
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			BIO_printf(bio_err,"Error, DSA key generation failed\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
@@ -429,13 +430,19 @@ bad:
 | 
			
		||||
 | 
			
		||||
		assert(need_rand);
 | 
			
		||||
		if ((dsakey=DSAparams_dup(dsa)) == NULL) goto end;
 | 
			
		||||
		if (!DSA_generate_key(dsakey)) goto end;
 | 
			
		||||
		if (!DSA_generate_key(dsakey))
 | 
			
		||||
			{
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			DSA_free(dsakey);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		if 	(outformat == FORMAT_ASN1)
 | 
			
		||||
			i=i2d_DSAPrivateKey_bio(out,dsakey);
 | 
			
		||||
		else if (outformat == FORMAT_PEM)
 | 
			
		||||
			i=PEM_write_bio_DSAPrivateKey(out,dsakey,NULL,NULL,0,NULL,NULL);
 | 
			
		||||
		else	{
 | 
			
		||||
			BIO_printf(bio_err,"bad output format specified for outfile\n");
 | 
			
		||||
			DSA_free(dsakey);
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		DSA_free(dsakey);
 | 
			
		||||
 
 | 
			
		||||
@@ -105,7 +105,7 @@
 | 
			
		||||
 *                    in the asn1 der encoding
 | 
			
		||||
 *                    possible values: named_curve (default)
 | 
			
		||||
 *                                     explicit
 | 
			
		||||
 * -no_seed         - if 'explicit' parameters are choosen do not use the seed
 | 
			
		||||
 * -no_seed         - if 'explicit' parameters are chosen do not use the seed
 | 
			
		||||
 * -genkey          - generate ec key
 | 
			
		||||
 * -rand file       - files to use for random number input
 | 
			
		||||
 * -engine e        - use engine e, possibly a hardware device
 | 
			
		||||
@@ -286,7 +286,7 @@ bad:
 | 
			
		||||
		BIO_printf(bio_err, "                                   "
 | 
			
		||||
				" explicit\n");
 | 
			
		||||
		BIO_printf(bio_err, " -no_seed          if 'explicit'"
 | 
			
		||||
				" parameters are choosen do not"
 | 
			
		||||
				" parameters are chosen do not"
 | 
			
		||||
				" use the seed\n");
 | 
			
		||||
		BIO_printf(bio_err, " -genkey           generate ec"
 | 
			
		||||
				" key\n");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								apps/enc.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								apps/enc.c
									
									
									
									
									
								
							@@ -129,6 +129,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	char *engine = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
	const EVP_MD *dgst=NULL;
 | 
			
		||||
	int non_fips_allow = 0;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
 | 
			
		||||
@@ -281,6 +282,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			md= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-non-fips-allow") == 0)
 | 
			
		||||
			non_fips_allow = 1;
 | 
			
		||||
		else if	((argv[0][0] == '-') &&
 | 
			
		||||
			((c=EVP_get_cipherbyname(&(argv[0][1]))) != NULL))
 | 
			
		||||
			{
 | 
			
		||||
@@ -328,6 +331,12 @@ bad:
 | 
			
		||||
        setup_engine(bio_err, engine, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err, "AEAD ciphers not supported by the enc utility\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (md && (dgst=EVP_get_digestbyname(md)) == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err,"%s is an unsupported message digest type\n",md);
 | 
			
		||||
@@ -589,6 +598,11 @@ bad:
 | 
			
		||||
		 */
 | 
			
		||||
 | 
			
		||||
		BIO_get_cipher_ctx(benc, &ctx);
 | 
			
		||||
 | 
			
		||||
		if (non_fips_allow)
 | 
			
		||||
			EVP_CIPHER_CTX_set_flags(ctx,
 | 
			
		||||
				EVP_CIPH_FLAG_NON_FIPS_ALLOW);
 | 
			
		||||
 | 
			
		||||
		if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err, "Error setting cipher %s\n",
 | 
			
		||||
 
 | 
			
		||||
@@ -78,7 +78,7 @@
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
 | 
			
		||||
#define DEFBITS	512
 | 
			
		||||
#define DEFBITS	1024
 | 
			
		||||
#undef PROG
 | 
			
		||||
#define PROG genrsa_main
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								apps/ocsp.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								apps/ocsp.c
									
									
									
									
									
								
							@@ -127,6 +127,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	ENGINE *e = NULL;
 | 
			
		||||
	char **args;
 | 
			
		||||
	char *host = NULL, *port = NULL, *path = "/";
 | 
			
		||||
	char *thost = NULL, *tport = NULL, *tpath = NULL;
 | 
			
		||||
	char *reqin = NULL, *respin = NULL;
 | 
			
		||||
	char *reqout = NULL, *respout = NULL;
 | 
			
		||||
	char *signfile = NULL, *keyfile = NULL;
 | 
			
		||||
@@ -204,6 +205,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			}
 | 
			
		||||
		else if (!strcmp(*args, "-url"))
 | 
			
		||||
			{
 | 
			
		||||
			if (thost)
 | 
			
		||||
				OPENSSL_free(thost);
 | 
			
		||||
			if (tport)
 | 
			
		||||
				OPENSSL_free(tport);
 | 
			
		||||
			if (tpath)
 | 
			
		||||
				OPENSSL_free(tpath);
 | 
			
		||||
			if (args[1])
 | 
			
		||||
				{
 | 
			
		||||
				args++;
 | 
			
		||||
@@ -212,6 +219,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
					BIO_printf(bio_err, "Error parsing URL\n");
 | 
			
		||||
					badarg = 1;
 | 
			
		||||
					}
 | 
			
		||||
				thost = host;
 | 
			
		||||
				tport = port;
 | 
			
		||||
				tpath = path;
 | 
			
		||||
				}
 | 
			
		||||
			else badarg = 1;
 | 
			
		||||
			}
 | 
			
		||||
@@ -617,7 +627,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf (bio_err, "-ndays n	 	 number of days before next update\n");
 | 
			
		||||
		BIO_printf (bio_err, "-resp_key_id       identify reponse by signing certificate key ID\n");
 | 
			
		||||
		BIO_printf (bio_err, "-nrequest n        number of requests to accept (default unlimited)\n");
 | 
			
		||||
		BIO_printf (bio_err, "-<dgst alg>     use specified digest in the request");
 | 
			
		||||
		BIO_printf (bio_err, "-<dgst alg>     use specified digest in the request\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -920,12 +930,12 @@ end:
 | 
			
		||||
	sk_X509_pop_free(verify_other, X509_free);
 | 
			
		||||
	sk_CONF_VALUE_pop_free(headers, X509V3_conf_free);
 | 
			
		||||
 | 
			
		||||
	if (use_ssl != -1)
 | 
			
		||||
		{
 | 
			
		||||
		OPENSSL_free(host);
 | 
			
		||||
		OPENSSL_free(port);
 | 
			
		||||
		OPENSSL_free(path);
 | 
			
		||||
		}
 | 
			
		||||
	if (thost)
 | 
			
		||||
		OPENSSL_free(thost);
 | 
			
		||||
	if (tport)
 | 
			
		||||
		OPENSSL_free(tport);
 | 
			
		||||
	if (tpath)
 | 
			
		||||
		OPENSSL_free(tpath);
 | 
			
		||||
 | 
			
		||||
	OPENSSL_EXIT(ret);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -117,6 +117,7 @@
 | 
			
		||||
#include "apps.h"
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/lhash.h>
 | 
			
		||||
#include <openssl/conf.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -112,7 +112,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
    int maciter = PKCS12_DEFAULT_ITER;
 | 
			
		||||
    int twopass = 0;
 | 
			
		||||
    int keytype = 0;
 | 
			
		||||
    int cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
 | 
			
		||||
    int cert_pbe;
 | 
			
		||||
    int key_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
 | 
			
		||||
    int ret = 1;
 | 
			
		||||
    int macver = 1;
 | 
			
		||||
@@ -130,6 +130,13 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
    apps_startup();
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
    if (FIPS_mode())
 | 
			
		||||
	cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
 | 
			
		||||
    else
 | 
			
		||||
#endif
 | 
			
		||||
    cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
 | 
			
		||||
 | 
			
		||||
    enc = EVP_des_ede3_cbc();
 | 
			
		||||
    if (bio_err == NULL ) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,9 +44,9 @@ extern int smime_main(int argc,char *argv[]);
 | 
			
		||||
extern int rand_main(int argc,char *argv[]);
 | 
			
		||||
extern int engine_main(int argc,char *argv[]);
 | 
			
		||||
extern int ocsp_main(int argc,char *argv[]);
 | 
			
		||||
extern int srp_main(int argc,char *argv[]);
 | 
			
		||||
extern int prime_main(int argc,char *argv[]);
 | 
			
		||||
extern int ts_main(int argc,char *argv[]);
 | 
			
		||||
extern int srp_main(int argc,char *argv[]);
 | 
			
		||||
 | 
			
		||||
#define FUNC_TYPE_GENERAL	1
 | 
			
		||||
#define FUNC_TYPE_MD		2
 | 
			
		||||
@@ -146,11 +146,11 @@ FUNCTION functions[] = {
 | 
			
		||||
#ifndef OPENSSL_NO_OCSP
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
 | 
			
		||||
#endif
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"prime",prime_main},
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"ts",ts_main},
 | 
			
		||||
#ifndef OPENSSL_NO_SRP
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"srp",srp_main},
 | 
			
		||||
#endif
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"prime",prime_main},
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"ts",ts_main},
 | 
			
		||||
#ifndef OPENSSL_NO_MD2
 | 
			
		||||
	{FUNC_TYPE_MD,"md2",dgst_main},
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,8 @@ foreach (@ARGV)
 | 
			
		||||
		{ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
 | 
			
		||||
	elsif ( ($_ =~ /^ocsp$/))
 | 
			
		||||
		{ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
 | 
			
		||||
	elsif ( ($_ =~ /^srp$/))
 | 
			
		||||
		{ print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n"; }
 | 
			
		||||
	else
 | 
			
		||||
		{ print $str; }
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								apps/req.c
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								apps/req.c
									
									
									
									
									
								
							@@ -644,6 +644,11 @@ bad:
 | 
			
		||||
		if (inrand)
 | 
			
		||||
			app_RAND_load_files(inrand);
 | 
			
		||||
 | 
			
		||||
		if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey))
 | 
			
		||||
			{
 | 
			
		||||
			newkey=DEFAULT_KEY_LENGTH;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (keyalg)
 | 
			
		||||
			{
 | 
			
		||||
			genctx = set_keygen_ctx(bio_err, keyalg, &pkey_type, &newkey,
 | 
			
		||||
@@ -652,12 +657,6 @@ bad:
 | 
			
		||||
				goto end;
 | 
			
		||||
			}
 | 
			
		||||
	
 | 
			
		||||
		if (newkey <= 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey))
 | 
			
		||||
				newkey=DEFAULT_KEY_LENGTH;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (newkey < MIN_KEY_LENGTH && (pkey_type == EVP_PKEY_RSA || pkey_type == EVP_PKEY_DSA))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"private key length is too short,\n");
 | 
			
		||||
@@ -1490,7 +1489,13 @@ start:
 | 
			
		||||
#ifdef CHARSET_EBCDIC
 | 
			
		||||
	ebcdic2ascii(buf, buf, i);
 | 
			
		||||
#endif
 | 
			
		||||
	if(!req_check_len(i, n_min, n_max)) goto start;
 | 
			
		||||
	if(!req_check_len(i, n_min, n_max))
 | 
			
		||||
		{
 | 
			
		||||
		if (batch || value)
 | 
			
		||||
			return 0;
 | 
			
		||||
		goto start;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
 | 
			
		||||
				(unsigned char *) buf, -1,-1,mval)) goto err;
 | 
			
		||||
	ret=1;
 | 
			
		||||
@@ -1549,7 +1554,12 @@ start:
 | 
			
		||||
#ifdef CHARSET_EBCDIC
 | 
			
		||||
	ebcdic2ascii(buf, buf, i);
 | 
			
		||||
#endif
 | 
			
		||||
	if(!req_check_len(i, n_min, n_max)) goto start;
 | 
			
		||||
	if(!req_check_len(i, n_min, n_max))
 | 
			
		||||
		{
 | 
			
		||||
		if (batch || value)
 | 
			
		||||
			return 0;
 | 
			
		||||
		goto start;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if(!X509_REQ_add1_attr_by_NID(req, nid, chtype,
 | 
			
		||||
					(unsigned char *)buf, -1)) {
 | 
			
		||||
@@ -1649,6 +1659,8 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
 | 
			
		||||
				keylen = atol(p + 1);
 | 
			
		||||
				*pkeylen = keylen;
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				keylen = *pkeylen;
 | 
			
		||||
			}
 | 
			
		||||
		else if (p)
 | 
			
		||||
			paramfile = p + 1;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										61
									
								
								apps/s_cb.c
									
									
									
									
									
								
							
							
						
						
									
										61
									
								
								apps/s_cb.c
									
									
									
									
									
								
							@@ -237,8 +237,8 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
 | 
			
		||||
 | 
			
		||||
		/* If we are using DSA, we can copy the parameters from
 | 
			
		||||
		 * the private key */
 | 
			
		||||
		
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		/* Now we know that a key and cert have been set against
 | 
			
		||||
		 * the SSL context */
 | 
			
		||||
		if (!SSL_CTX_check_private_key(ctx))
 | 
			
		||||
@@ -357,6 +357,12 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
 | 
			
		||||
	case TLS1_VERSION:
 | 
			
		||||
		str_version = "TLS 1.0 ";
 | 
			
		||||
		break;
 | 
			
		||||
	case TLS1_1_VERSION:
 | 
			
		||||
		str_version = "TLS 1.1 ";
 | 
			
		||||
		break;
 | 
			
		||||
	case TLS1_2_VERSION:
 | 
			
		||||
		str_version = "TLS 1.2 ";
 | 
			
		||||
		break;
 | 
			
		||||
	case DTLS1_VERSION:
 | 
			
		||||
		str_version = "DTLS 1.0 ";
 | 
			
		||||
		break;
 | 
			
		||||
@@ -430,6 +436,8 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
 | 
			
		||||
 | 
			
		||||
	if (version == SSL3_VERSION ||
 | 
			
		||||
	    version == TLS1_VERSION ||
 | 
			
		||||
	    version == TLS1_1_VERSION ||
 | 
			
		||||
	    version == TLS1_2_VERSION ||
 | 
			
		||||
	    version == DTLS1_VERSION ||
 | 
			
		||||
	    version == DTLS1_BAD_VER)
 | 
			
		||||
		{
 | 
			
		||||
@@ -680,6 +688,22 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
 | 
			
		||||
		extname = "status request";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_user_mapping:
 | 
			
		||||
		extname = "user mapping";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_client_authz:
 | 
			
		||||
		extname = "client authz";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_server_authz:
 | 
			
		||||
		extname = "server authz";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_cert_type:
 | 
			
		||||
		extname = "cert type";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_elliptic_curves:
 | 
			
		||||
		extname = "elliptic curves";
 | 
			
		||||
		break;
 | 
			
		||||
@@ -688,23 +712,44 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
 | 
			
		||||
		extname = "EC point formats";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_session_ticket:
 | 
			
		||||
		extname = "server ticket";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_renegotiate:
 | 
			
		||||
		extname = "renegotiate";
 | 
			
		||||
		case TLSEXT_TYPE_srp:
 | 
			
		||||
		extname = "SRP";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_signature_algorithms:
 | 
			
		||||
		extname = "signature algorithms";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_use_srtp:
 | 
			
		||||
		extname = "use SRTP";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_heartbeat:
 | 
			
		||||
		extname = "heartbeat";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_session_ticket:
 | 
			
		||||
		extname = "session ticket";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_renegotiate: 
 | 
			
		||||
		extname = "renegotiation info";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
#ifdef TLSEXT_TYPE_opaque_prf_input
 | 
			
		||||
		case TLSEXT_TYPE_opaque_prf_input:
 | 
			
		||||
		extname = "opaque PRF input";
 | 
			
		||||
		break;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef TLSEXT_TYPE_next_proto_neg
 | 
			
		||||
		case TLSEXT_TYPE_next_proto_neg:
 | 
			
		||||
		extname = "next protocol";
 | 
			
		||||
		break;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		case TLSEXT_TYPE_padding:
 | 
			
		||||
		extname = "TLS padding";
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
		default:
 | 
			
		||||
		extname = "unknown";
 | 
			
		||||
 
 | 
			
		||||
@@ -357,12 +357,14 @@ static void sc_usage(void)
 | 
			
		||||
	BIO_printf(bio_err," -tlsextdebug      - hex dump of all TLS extensions received\n");
 | 
			
		||||
	BIO_printf(bio_err," -status           - request certificate status from server\n");
 | 
			
		||||
	BIO_printf(bio_err," -no_ticket        - disable use of RFC4507bis session tickets\n");
 | 
			
		||||
# if !defined(OPENSSL_NO_NEXTPROTONEG)
 | 
			
		||||
# ifndef OPENSSL_NO_NEXTPROTONEG
 | 
			
		||||
	BIO_printf(bio_err," -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n");
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
	BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
 | 
			
		||||
	BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list");
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
	BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
 | 
			
		||||
#endif
 | 
			
		||||
 	BIO_printf(bio_err," -keymatexport label   - Export keying material using label\n");
 | 
			
		||||
 	BIO_printf(bio_err," -keymatexportlen len  - Export len bytes of keying material (default 20)\n");
 | 
			
		||||
	}
 | 
			
		||||
@@ -502,7 +504,9 @@ static char * MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
	char *srtp_profiles = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
# ifndef OPENSSL_NO_NEXTPROTONEG
 | 
			
		||||
/* This the context that we pass to next_proto_cb */
 | 
			
		||||
@@ -536,7 +540,7 @@ static int next_proto_cb(SSL *s, unsigned char **out, unsigned char *outlen, con
 | 
			
		||||
	ctx->status = SSL_select_next_proto(out, outlen, in, inlen, ctx->data, ctx->len);
 | 
			
		||||
	return SSL_TLSEXT_ERR_OK;
 | 
			
		||||
	}
 | 
			
		||||
# endif
 | 
			
		||||
# endif  /* ndef OPENSSL_NO_NEXTPROTONEG */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
enum
 | 
			
		||||
@@ -622,13 +626,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	SRP_ARG srp_arg = {NULL,NULL,0,0,0,1024};
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
 | 
			
		||||
	meth=SSLv23_client_method();
 | 
			
		||||
#elif !defined(OPENSSL_NO_SSL3)
 | 
			
		||||
	meth=SSLv3_client_method();
 | 
			
		||||
#elif !defined(OPENSSL_NO_SSL2)
 | 
			
		||||
	meth=SSLv2_client_method();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
	c_Pause=0;
 | 
			
		||||
@@ -763,7 +761,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			psk_key=*(++argv);
 | 
			
		||||
			for (j = 0; j < strlen(psk_key); j++)
 | 
			
		||||
                                {
 | 
			
		||||
                                if (isxdigit((int)psk_key[j]))
 | 
			
		||||
                                if (isxdigit((unsigned char)psk_key[j]))
 | 
			
		||||
                                        continue;
 | 
			
		||||
                                BIO_printf(bio_err,"Not a hex number '%s'\n",*argv);
 | 
			
		||||
                                goto bad;
 | 
			
		||||
@@ -951,11 +949,13 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			jpake_secret = *++argv;
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
		else if (strcmp(*argv,"-use_srtp") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			srtp_profiles = *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
		else if (strcmp(*argv,"-keymatexport") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -993,14 +993,13 @@ bad:
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		psk_identity = "JPAKE";
 | 
			
		||||
		if (cipher)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err, "JPAKE sets cipher to PSK\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
		cipher = "PSK";
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (cipher)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err, "JPAKE sets cipher to PSK\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
	cipher = "PSK";
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	OpenSSL_add_ssl_algorithms();
 | 
			
		||||
@@ -1137,6 +1136,8 @@ bad:
 | 
			
		||||
			BIO_printf(bio_c_out, "PSK key given or JPAKE in use, setting client callback\n");
 | 
			
		||||
		SSL_CTX_set_psk_client_callback(ctx, psk_client_cb);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
	if (srtp_profiles != NULL)
 | 
			
		||||
		SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1897,6 +1898,10 @@ end:
 | 
			
		||||
			print_stuff(bio_c_out,con,1);
 | 
			
		||||
		SSL_free(con);
 | 
			
		||||
		}
 | 
			
		||||
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
 | 
			
		||||
	if (next_proto.data)
 | 
			
		||||
		OPENSSL_free(next_proto.data);
 | 
			
		||||
#endif
 | 
			
		||||
	if (ctx != NULL) SSL_CTX_free(ctx);
 | 
			
		||||
	if (cert)
 | 
			
		||||
		X509_free(cert);
 | 
			
		||||
@@ -1904,6 +1909,8 @@ end:
 | 
			
		||||
		EVP_PKEY_free(key);
 | 
			
		||||
	if (pass)
 | 
			
		||||
		OPENSSL_free(pass);
 | 
			
		||||
	if (vpm)
 | 
			
		||||
		X509_VERIFY_PARAM_free(vpm);
 | 
			
		||||
	if (cbuf != NULL) { OPENSSL_cleanse(cbuf,BUFSIZZ); OPENSSL_free(cbuf); }
 | 
			
		||||
	if (sbuf != NULL) { OPENSSL_cleanse(sbuf,BUFSIZZ); OPENSSL_free(sbuf); }
 | 
			
		||||
	if (mbuf != NULL) { OPENSSL_cleanse(mbuf,BUFSIZZ); OPENSSL_free(mbuf); }
 | 
			
		||||
@@ -2068,6 +2075,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
 	{
 | 
			
		||||
 	SRTP_PROTECTION_PROFILE *srtp_profile=SSL_get_selected_srtp_profile(s);
 | 
			
		||||
 
 | 
			
		||||
@@ -2075,32 +2083,36 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 | 
			
		||||
		BIO_printf(bio,"SRTP Extension negotiated, profile=%s\n",
 | 
			
		||||
			   srtp_profile->name);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
	SSL_SESSION_print(bio,SSL_get_session(s));
 | 
			
		||||
	if (keymatexportlabel != NULL) {
 | 
			
		||||
	if (keymatexportlabel != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio, "Keying material exporter:\n");
 | 
			
		||||
		BIO_printf(bio, "    Label: '%s'\n", keymatexportlabel);
 | 
			
		||||
		BIO_printf(bio, "    Length: %i bytes\n", keymatexportlen);
 | 
			
		||||
		exportedkeymat = OPENSSL_malloc(keymatexportlen);
 | 
			
		||||
		if (exportedkeymat != NULL) {
 | 
			
		||||
			i = SSL_export_keying_material(s, exportedkeymat,
 | 
			
		||||
						       keymatexportlen,
 | 
			
		||||
						       keymatexportlabel,
 | 
			
		||||
						     strlen(keymatexportlabel),
 | 
			
		||||
						       NULL, 0, 0);
 | 
			
		||||
			if (i != keymatexportlen) {
 | 
			
		||||
				BIO_printf(bio,
 | 
			
		||||
					   "    Error: return value %i\n", i);
 | 
			
		||||
			} else {
 | 
			
		||||
		if (exportedkeymat != NULL)
 | 
			
		||||
			{
 | 
			
		||||
			if (!SSL_export_keying_material(s, exportedkeymat,
 | 
			
		||||
						        keymatexportlen,
 | 
			
		||||
						        keymatexportlabel,
 | 
			
		||||
						        strlen(keymatexportlabel),
 | 
			
		||||
						        NULL, 0, 0))
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio, "    Error\n");
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio, "    Keying material: ");
 | 
			
		||||
				for (i=0; i<keymatexportlen; i++)
 | 
			
		||||
					BIO_printf(bio, "%02X",
 | 
			
		||||
						   exportedkeymat[i]);
 | 
			
		||||
				BIO_printf(bio, "\n");
 | 
			
		||||
			}
 | 
			
		||||
				}
 | 
			
		||||
			OPENSSL_free(exportedkeymat);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	BIO_printf(bio,"---\n");
 | 
			
		||||
	if (peer != NULL)
 | 
			
		||||
		X509_free(peer);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										135
									
								
								apps/s_server.c
									
									
									
									
									
								
							
							
						
						
									
										135
									
								
								apps/s_server.c
									
									
									
									
									
								
							@@ -556,7 +556,9 @@ static void sv_usage(void)
 | 
			
		||||
# ifndef OPENSSL_NO_NEXTPROTONEG
 | 
			
		||||
	BIO_printf(bio_err," -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n");
 | 
			
		||||
# endif
 | 
			
		||||
        BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list");
 | 
			
		||||
# ifndef OPENSSL_NO_SRTP
 | 
			
		||||
        BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
	BIO_printf(bio_err," -keymatexport label   - Export keying material using label\n");
 | 
			
		||||
	BIO_printf(bio_err," -keymatexportlen len  - Export len bytes of keying material (default 20)\n");
 | 
			
		||||
@@ -923,7 +925,9 @@ static char *jpake_secret = NULL;
 | 
			
		||||
#ifndef OPENSSL_NO_SRP
 | 
			
		||||
	static srpsrvparm srp_callback_parm;
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
static char *srtp_profiles = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char *argv[])
 | 
			
		||||
	{
 | 
			
		||||
@@ -969,17 +973,7 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
	char *srpuserseed = NULL;
 | 
			
		||||
	char *srp_verifier_file = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
 | 
			
		||||
	meth=SSLv23_server_method();
 | 
			
		||||
#elif !defined(OPENSSL_NO_SSL3)
 | 
			
		||||
	meth=SSLv3_server_method();
 | 
			
		||||
#elif !defined(OPENSSL_NO_SSL2)
 | 
			
		||||
	meth=SSLv2_server_method();
 | 
			
		||||
#elif !defined(OPENSSL_NO_TLS1)
 | 
			
		||||
	meth=TLSv1_server_method();
 | 
			
		||||
#else
 | 
			
		||||
  /*  #error no SSL version enabled */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	local_argc=argc;
 | 
			
		||||
	local_argv=argv;
 | 
			
		||||
@@ -1204,7 +1198,7 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
			psk_key=*(++argv);
 | 
			
		||||
			for (i=0; i<strlen(psk_key); i++)
 | 
			
		||||
				{
 | 
			
		||||
				if (isxdigit((int)psk_key[i]))
 | 
			
		||||
				if (isxdigit((unsigned char)psk_key[i]))
 | 
			
		||||
					continue;
 | 
			
		||||
				BIO_printf(bio_err,"Not a hex number '%s'\n",*argv);
 | 
			
		||||
				goto bad;
 | 
			
		||||
@@ -1216,13 +1210,13 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			srp_verifier_file = *(++argv);
 | 
			
		||||
			meth=TLSv1_server_method();
 | 
			
		||||
			meth = TLSv1_server_method();
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv, "-srpuserseed") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			srpuserseed = *(++argv);
 | 
			
		||||
			meth=TLSv1_server_method();
 | 
			
		||||
			meth = TLSv1_server_method();
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
		else if	(strcmp(*argv,"-www") == 0)
 | 
			
		||||
@@ -1329,11 +1323,13 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
			jpake_secret = *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
		else if (strcmp(*argv,"-use_srtp") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			srtp_profiles = *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
#endif
 | 
			
		||||
		else if (strcmp(*argv,"-keymatexport") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -1441,25 +1437,24 @@ bad:
 | 
			
		||||
				goto end;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
# ifndef OPENSSL_NO_NEXTPROTONEG
 | 
			
		||||
		if (next_proto_neg_in)
 | 
			
		||||
			{
 | 
			
		||||
			unsigned short len;
 | 
			
		||||
			next_proto.data = next_protos_parse(&len,
 | 
			
		||||
				next_proto_neg_in);
 | 
			
		||||
			if (next_proto.data == NULL)
 | 
			
		||||
				goto end;
 | 
			
		||||
			next_proto.len = len;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			next_proto.data = NULL;
 | 
			
		||||
			}
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) 
 | 
			
		||||
	if (next_proto_neg_in)
 | 
			
		||||
		{
 | 
			
		||||
		unsigned short len;
 | 
			
		||||
		next_proto.data = next_protos_parse(&len, next_proto_neg_in);
 | 
			
		||||
		if (next_proto.data == NULL)
 | 
			
		||||
			goto end;
 | 
			
		||||
		next_proto.len = len;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		next_proto.data = NULL;
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if (s_dcert_file)
 | 
			
		||||
		{
 | 
			
		||||
@@ -1560,8 +1555,10 @@ bad:
 | 
			
		||||
	else
 | 
			
		||||
		SSL_CTX_sess_set_cache_size(ctx,128);
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
	if (srtp_profiles != NULL)
 | 
			
		||||
		SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
	if (cipher == NULL) cipher=getenv("SSL_CIPHER");
 | 
			
		||||
@@ -1740,7 +1737,7 @@ bad:
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
	if (!set_cert_key_stuff(ctx,s_cert,s_key))
 | 
			
		||||
	if (!set_cert_key_stuff(ctx, s_cert, s_key))
 | 
			
		||||
		goto end;
 | 
			
		||||
#ifndef OPENSSL_NO_TLSEXT
 | 
			
		||||
	if (ctx2 && !set_cert_key_stuff(ctx2,s_cert2,s_key2))
 | 
			
		||||
@@ -1748,7 +1745,7 @@ bad:
 | 
			
		||||
#endif
 | 
			
		||||
	if (s_dcert != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		if (!set_cert_key_stuff(ctx,s_dcert,s_dkey))
 | 
			
		||||
		if (!set_cert_key_stuff(ctx, s_dcert, s_dkey))
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -1903,7 +1900,15 @@ end:
 | 
			
		||||
		OPENSSL_free(pass);
 | 
			
		||||
	if (dpass)
 | 
			
		||||
		OPENSSL_free(dpass);
 | 
			
		||||
	if (vpm)
 | 
			
		||||
		X509_VERIFY_PARAM_free(vpm);
 | 
			
		||||
#ifndef OPENSSL_NO_TLSEXT
 | 
			
		||||
	if (tlscstatp.host)
 | 
			
		||||
		OPENSSL_free(tlscstatp.host);
 | 
			
		||||
	if (tlscstatp.port)
 | 
			
		||||
		OPENSSL_free(tlscstatp.port);
 | 
			
		||||
	if (tlscstatp.path)
 | 
			
		||||
		OPENSSL_free(tlscstatp.path);
 | 
			
		||||
	if (ctx2 != NULL) SSL_CTX_free(ctx2);
 | 
			
		||||
	if (s_cert2)
 | 
			
		||||
		X509_free(s_cert2);
 | 
			
		||||
@@ -2245,6 +2250,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
{ static count=0; if (++count == 100) { count=0; SSL_renegotiate(con); } }
 | 
			
		||||
#endif
 | 
			
		||||
				k=SSL_write(con,&(buf[l]),(unsigned int)i);
 | 
			
		||||
#ifndef OPENSSL_NO_SRP
 | 
			
		||||
				while (SSL_get_error(con,k) == SSL_ERROR_WANT_X509_LOOKUP)
 | 
			
		||||
					{
 | 
			
		||||
					BIO_printf(bio_s_out,"LOOKUP renego during write\n");
 | 
			
		||||
@@ -2255,6 +2261,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
						BIO_printf(bio_s_out,"LOOKUP not successful\n");
 | 
			
		||||
						k=SSL_write(con,&(buf[l]),(unsigned int)i);
 | 
			
		||||
					}
 | 
			
		||||
#endif
 | 
			
		||||
				switch (SSL_get_error(con,k))
 | 
			
		||||
					{
 | 
			
		||||
				case SSL_ERROR_NONE:
 | 
			
		||||
@@ -2302,6 +2309,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
				{
 | 
			
		||||
again:	
 | 
			
		||||
				i=SSL_read(con,(char *)buf,bufsize);
 | 
			
		||||
#ifndef OPENSSL_NO_SRP
 | 
			
		||||
				while (SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP)
 | 
			
		||||
					{
 | 
			
		||||
					BIO_printf(bio_s_out,"LOOKUP renego during read\n");
 | 
			
		||||
@@ -2312,6 +2320,7 @@ again:
 | 
			
		||||
						BIO_printf(bio_s_out,"LOOKUP not successful\n");
 | 
			
		||||
					i=SSL_read(con,(char *)buf,bufsize);
 | 
			
		||||
					}
 | 
			
		||||
#endif
 | 
			
		||||
				switch (SSL_get_error(con,i))
 | 
			
		||||
					{
 | 
			
		||||
				case SSL_ERROR_NONE:
 | 
			
		||||
@@ -2389,6 +2398,7 @@ static int init_ssl_connection(SSL *con)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	i=SSL_accept(con);
 | 
			
		||||
#ifndef OPENSSL_NO_SRP
 | 
			
		||||
	while (i <= 0 &&  SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP) 
 | 
			
		||||
		{
 | 
			
		||||
			BIO_printf(bio_s_out,"LOOKUP during accept %s\n",srp_callback_parm.login);
 | 
			
		||||
@@ -2399,6 +2409,7 @@ static int init_ssl_connection(SSL *con)
 | 
			
		||||
				BIO_printf(bio_s_out,"LOOKUP not successful\n");
 | 
			
		||||
			i=SSL_accept(con);
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	if (i <= 0)
 | 
			
		||||
		{
 | 
			
		||||
		if (BIO_sock_should_retry(i))
 | 
			
		||||
@@ -2437,6 +2448,7 @@ static int init_ssl_connection(SSL *con)
 | 
			
		||||
		BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf);
 | 
			
		||||
	str=SSL_CIPHER_get_name(SSL_get_current_cipher(con));
 | 
			
		||||
	BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)");
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
 | 
			
		||||
	SSL_get0_next_proto_negotiated(con, &next_proto_neg, &next_proto_neg_len);
 | 
			
		||||
	if (next_proto_neg)
 | 
			
		||||
@@ -2446,6 +2458,7 @@ static int init_ssl_connection(SSL *con)
 | 
			
		||||
		BIO_printf(bio_s_out, "\n");
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SRTP
 | 
			
		||||
	{
 | 
			
		||||
	SRTP_PROTECTION_PROFILE *srtp_profile
 | 
			
		||||
	  = SSL_get_selected_srtp_profile(con);
 | 
			
		||||
@@ -2454,6 +2467,7 @@ static int init_ssl_connection(SSL *con)
 | 
			
		||||
		BIO_printf(bio_s_out,"SRTP Extension negotiated, profile=%s\n",
 | 
			
		||||
			   srtp_profile->name);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
	if (SSL_cache_hit(con)) BIO_printf(bio_s_out,"Reused session-id\n");
 | 
			
		||||
	if (SSL_ctrl(con,SSL_CTRL_GET_FLAGS,0,NULL) &
 | 
			
		||||
		TLS1_FLAGS_TLS_PADDING_BUG)
 | 
			
		||||
@@ -2469,31 +2483,34 @@ static int init_ssl_connection(SSL *con)
 | 
			
		||||
#endif /* OPENSSL_NO_KRB5 */
 | 
			
		||||
	BIO_printf(bio_s_out, "Secure Renegotiation IS%s supported\n",
 | 
			
		||||
		      SSL_get_secure_renegotiation_support(con) ? "" : " NOT");
 | 
			
		||||
 	if (keymatexportlabel != NULL) {
 | 
			
		||||
 		BIO_printf(bio_s_out, "Keying material exporter:\n");
 | 
			
		||||
 		BIO_printf(bio_s_out, "    Label: '%s'\n", keymatexportlabel);
 | 
			
		||||
 		BIO_printf(bio_s_out, "    Length: %i bytes\n",
 | 
			
		||||
	if (keymatexportlabel != NULL)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_s_out, "Keying material exporter:\n");
 | 
			
		||||
		BIO_printf(bio_s_out, "    Label: '%s'\n", keymatexportlabel);
 | 
			
		||||
		BIO_printf(bio_s_out, "    Length: %i bytes\n",
 | 
			
		||||
			   keymatexportlen);
 | 
			
		||||
 		exportedkeymat = OPENSSL_malloc(keymatexportlen);
 | 
			
		||||
 		if (exportedkeymat != NULL) {
 | 
			
		||||
 			i = SSL_export_keying_material(con, exportedkeymat,
 | 
			
		||||
						       keymatexportlen,
 | 
			
		||||
						       keymatexportlabel,
 | 
			
		||||
						     strlen(keymatexportlabel),
 | 
			
		||||
						       NULL, 0, 0);
 | 
			
		||||
 			if (i != keymatexportlen) {
 | 
			
		||||
 				BIO_printf(bio_s_out,
 | 
			
		||||
					   "    Error: return value %i\n", i);
 | 
			
		||||
 			} else {
 | 
			
		||||
 				BIO_printf(bio_s_out, "    Keying material: ");
 | 
			
		||||
 				for (i=0; i<keymatexportlen; i++)
 | 
			
		||||
 					BIO_printf(bio_s_out, "%02X",
 | 
			
		||||
		exportedkeymat = OPENSSL_malloc(keymatexportlen);
 | 
			
		||||
		if (exportedkeymat != NULL)
 | 
			
		||||
			{
 | 
			
		||||
			if (!SSL_export_keying_material(con, exportedkeymat,
 | 
			
		||||
						        keymatexportlen,
 | 
			
		||||
						        keymatexportlabel,
 | 
			
		||||
						        strlen(keymatexportlabel),
 | 
			
		||||
						        NULL, 0, 0))
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_s_out, "    Error\n");
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(bio_s_out, "    Keying material: ");
 | 
			
		||||
				for (i=0; i<keymatexportlen; i++)
 | 
			
		||||
					BIO_printf(bio_s_out, "%02X",
 | 
			
		||||
						   exportedkeymat[i]);
 | 
			
		||||
 				BIO_printf(bio_s_out, "\n");
 | 
			
		||||
 			}
 | 
			
		||||
 			OPENSSL_free(exportedkeymat);
 | 
			
		||||
 		}
 | 
			
		||||
 	}
 | 
			
		||||
				BIO_printf(bio_s_out, "\n");
 | 
			
		||||
				}
 | 
			
		||||
			OPENSSL_free(exportedkeymat);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
@@ -2623,6 +2640,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
		if (hack)
 | 
			
		||||
			{
 | 
			
		||||
			i=SSL_accept(con);
 | 
			
		||||
#ifndef OPENSSL_NO_SRP
 | 
			
		||||
			while (i <= 0 &&  SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP) 
 | 
			
		||||
		{
 | 
			
		||||
			BIO_printf(bio_s_out,"LOOKUP during accept %s\n",srp_callback_parm.login);
 | 
			
		||||
@@ -2633,7 +2651,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
				BIO_printf(bio_s_out,"LOOKUP not successful\n");
 | 
			
		||||
			i=SSL_accept(con);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
			switch (SSL_get_error(con,i))
 | 
			
		||||
				{
 | 
			
		||||
			case SSL_ERROR_NONE:
 | 
			
		||||
@@ -2701,6 +2719,11 @@ static int www_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
				}
 | 
			
		||||
			BIO_puts(io,"\n");
 | 
			
		||||
 | 
			
		||||
			BIO_printf(io,
 | 
			
		||||
				"Secure Renegotiation IS%s supported\n",
 | 
			
		||||
		      		SSL_get_secure_renegotiation_support(con) ?
 | 
			
		||||
							"" : " NOT");
 | 
			
		||||
 | 
			
		||||
			/* The following is evil and should not really
 | 
			
		||||
			 * be done */
 | 
			
		||||
			BIO_printf(io,"Ciphers supported in s_server binary\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -274,7 +274,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
 | 
			
		||||
		{
 | 
			
		||||
		i=0;
 | 
			
		||||
		i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
 | 
			
		||||
		if (i < 0) { perror("keepalive"); return(0); }
 | 
			
		||||
		if (i < 0) { closesocket(s); perror("keepalive"); return(0); }
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -450,6 +450,7 @@ redoit:
 | 
			
		||||
		if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			perror("OPENSSL_malloc");
 | 
			
		||||
			closesocket(ret);
 | 
			
		||||
			return(0);
 | 
			
		||||
			}
 | 
			
		||||
		BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
 | 
			
		||||
@@ -458,11 +459,13 @@ redoit:
 | 
			
		||||
		if (h2 == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"gethostbyname failure\n");
 | 
			
		||||
			closesocket(ret);
 | 
			
		||||
			return(0);
 | 
			
		||||
			}
 | 
			
		||||
		if (h2->h_addrtype != AF_INET)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
 | 
			
		||||
			closesocket(ret);
 | 
			
		||||
			return(0);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -541,8 +541,8 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		{
 | 
			
		||||
		if (!cipher)
 | 
			
		||||
			{
 | 
			
		||||
#ifndef OPENSSL_NO_RC2			
 | 
			
		||||
			cipher = EVP_rc2_40_cbc();
 | 
			
		||||
#ifndef OPENSSL_NO_DES			
 | 
			
		||||
			cipher = EVP_des_ede3_cbc();
 | 
			
		||||
#else
 | 
			
		||||
			BIO_printf(bio_err, "No cipher selected\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
 
 | 
			
		||||
@@ -254,7 +254,7 @@ static const char *names[ALGOR_NUM]={
 | 
			
		||||
  "aes-128 cbc","aes-192 cbc","aes-256 cbc",
 | 
			
		||||
  "camellia-128 cbc","camellia-192 cbc","camellia-256 cbc",
 | 
			
		||||
  "evp","sha256","sha512","whirlpool",
 | 
			
		||||
  "aes-128 ige","aes-192 ige","aes-256 ige","ghash"};
 | 
			
		||||
  "aes-128 ige","aes-192 ige","aes-256 ige","ghash" };
 | 
			
		||||
static double results[ALGOR_NUM][SIZE_NUM];
 | 
			
		||||
static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
 | 
			
		||||
#ifndef OPENSSL_NO_RSA
 | 
			
		||||
@@ -299,7 +299,7 @@ static SIGRETTYPE sig_done(int sig)
 | 
			
		||||
#if defined(_WIN32)
 | 
			
		||||
 | 
			
		||||
#if !defined(SIGALRM)
 | 
			
		||||
#define SIGALRM
 | 
			
		||||
# define SIGALRM
 | 
			
		||||
#endif
 | 
			
		||||
static unsigned int lapse,schlock;
 | 
			
		||||
static void alarm_win32(unsigned int secs) { lapse = secs*1000; }
 | 
			
		||||
@@ -2597,7 +2597,7 @@ static void pkey_print_message(const char *str, const char *str2, long num,
 | 
			
		||||
	BIO_printf(bio_err,mr ? "+DTP:%d:%s:%s:%d\n"
 | 
			
		||||
			   : "Doing %d bit %s %s's for %ds: ",bits,str,str2,tm);
 | 
			
		||||
	(void)BIO_flush(bio_err);
 | 
			
		||||
	alarm(RSA_SECONDS);
 | 
			
		||||
	alarm(tm);
 | 
			
		||||
#else
 | 
			
		||||
	BIO_printf(bio_err,mr ? "+DNP:%ld:%d:%s:%s\n"
 | 
			
		||||
			   : "Doing %ld %d bit %s %s's: ",num,bits,str,str2);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								apps/srp.c
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								apps/srp.c
									
									
									
									
									
								
							@@ -125,13 +125,13 @@ static int get_index(CA_DB *db, char* id, char type)
 | 
			
		||||
	if (type == DB_SRP_INDEX) 
 | 
			
		||||
	for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
 | 
			
		||||
		{
 | 
			
		||||
		pp = (char **)sk_OPENSSL_PSTRING_value(db->db->data, i);
 | 
			
		||||
		if (pp[DB_srptype][0] == DB_SRP_INDEX  && !strcmp(id, pp[DB_srpid])) 
 | 
			
		||||
		pp = sk_OPENSSL_PSTRING_value(db->db->data,i);
 | 
			
		||||
		if (pp[DB_srptype][0] == DB_SRP_INDEX  && !strcmp(id,pp[DB_srpid])) 
 | 
			
		||||
			return i;
 | 
			
		||||
		}
 | 
			
		||||
	else for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
 | 
			
		||||
		{
 | 
			
		||||
		pp = (char **)sk_OPENSSL_PSTRING_value(db->db->data, i);
 | 
			
		||||
		pp = sk_OPENSSL_PSTRING_value(db->db->data,i);
 | 
			
		||||
 | 
			
		||||
		if (pp[DB_srptype][0] != DB_SRP_INDEX && !strcmp(id,pp[DB_srpid])) 
 | 
			
		||||
			return i;
 | 
			
		||||
@@ -145,7 +145,7 @@ static void print_entry(CA_DB *db, BIO *bio, int indx, int verbose, char *s)
 | 
			
		||||
	if (indx >= 0 && verbose)
 | 
			
		||||
		{
 | 
			
		||||
		int j;
 | 
			
		||||
		char **pp = (char **)sk_OPENSSL_PSTRING_value(db->db->data, indx);
 | 
			
		||||
		char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);
 | 
			
		||||
		BIO_printf(bio, "%s \"%s\"\n", s, pp[DB_srpid]);
 | 
			
		||||
		for (j = 0; j < DB_NUMBER; j++)
 | 
			
		||||
			{
 | 
			
		||||
@@ -163,7 +163,7 @@ static void print_user(CA_DB *db, BIO *bio, int userindex, int verbose)
 | 
			
		||||
	{
 | 
			
		||||
	if (verbose > 0)
 | 
			
		||||
		{
 | 
			
		||||
		char **pp = (char **)sk_OPENSSL_PSTRING_value(db->db->data, userindex);
 | 
			
		||||
		char **pp = sk_OPENSSL_PSTRING_value(db->db->data,userindex);
 | 
			
		||||
 | 
			
		||||
		if (pp[DB_srptype][0] != 'I')
 | 
			
		||||
			{
 | 
			
		||||
@@ -517,7 +517,7 @@ bad:
 | 
			
		||||
	/* Lets check some fields */
 | 
			
		||||
	for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
 | 
			
		||||
		{
 | 
			
		||||
		pp = (char **)sk_OPENSSL_PSTRING_value(db->db->data, i);
 | 
			
		||||
		pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
 | 
			
		||||
	
 | 
			
		||||
		if (pp[DB_srptype][0] == DB_SRP_INDEX)
 | 
			
		||||
			{
 | 
			
		||||
@@ -533,8 +533,8 @@ bad:
 | 
			
		||||
 | 
			
		||||
	if (gNindex >= 0)
 | 
			
		||||
		{
 | 
			
		||||
		gNrow = (char **)sk_OPENSSL_PSTRING_value(db->db->data, gNindex);
 | 
			
		||||
		print_entry(db, bio_err, gNindex, verbose > 1, "Default g and N") ;
 | 
			
		||||
		gNrow = sk_OPENSSL_PSTRING_value(db->db->data,gNindex);
 | 
			
		||||
		print_entry(db, bio_err, gNindex, verbose > 1, "Default g and N");
 | 
			
		||||
		}
 | 
			
		||||
	else if (maxgN > 0 && !SRP_get_default_gN(gN))
 | 
			
		||||
		{
 | 
			
		||||
@@ -587,7 +587,7 @@ bad:
 | 
			
		||||
			if (userindex >= 0)
 | 
			
		||||
				{
 | 
			
		||||
				/* reactivation of a new user */
 | 
			
		||||
				char **row = (char **)sk_OPENSSL_PSTRING_value(db->db->data, userindex);
 | 
			
		||||
				char **row = sk_OPENSSL_PSTRING_value(db->db->data, userindex);
 | 
			
		||||
				BIO_printf(bio_err, "user \"%s\" reactivated.\n", user);
 | 
			
		||||
				row[DB_srptype][0] = 'V';
 | 
			
		||||
 | 
			
		||||
@@ -634,7 +634,7 @@ bad:
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
 | 
			
		||||
				char **row = (char **)sk_OPENSSL_PSTRING_value(db->db->data, userindex);
 | 
			
		||||
				char **row = sk_OPENSSL_PSTRING_value(db->db->data, userindex);
 | 
			
		||||
				char type = row[DB_srptype][0];
 | 
			
		||||
				if (type == 'v')
 | 
			
		||||
					{
 | 
			
		||||
@@ -664,9 +664,9 @@ bad:
 | 
			
		||||
 | 
			
		||||
					if (!(gNid=srp_create_user(user,&(row[DB_srpverifier]), &(row[DB_srpsalt]),gNrow?gNrow[DB_srpsalt]:NULL, gNrow?gNrow[DB_srpverifier]:NULL, passout, bio_err,verbose)))
 | 
			
		||||
						{
 | 
			
		||||
							BIO_printf(bio_err, "Cannot create srp verifier for user \"%s\", operation abandoned.\n", user);
 | 
			
		||||
							errors++;
 | 
			
		||||
							goto err;
 | 
			
		||||
						BIO_printf(bio_err, "Cannot create srp verifier for user \"%s\", operation abandoned.\n", user);
 | 
			
		||||
						errors++;
 | 
			
		||||
						goto err;
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
					row[DB_srptype][0] = 'v';
 | 
			
		||||
@@ -689,7 +689,7 @@ bad:
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				char **xpp = (char **)sk_OPENSSL_PSTRING_value(db->db->data, userindex);
 | 
			
		||||
				char **xpp = sk_OPENSSL_PSTRING_value(db->db->data,userindex);
 | 
			
		||||
				BIO_printf(bio_err, "user \"%s\" revoked. t\n", user);
 | 
			
		||||
 | 
			
		||||
				xpp[DB_srptype][0] = 'R';
 | 
			
		||||
@@ -714,7 +714,7 @@ bad:
 | 
			
		||||
		/* Lets check some fields */
 | 
			
		||||
		for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
 | 
			
		||||
			{
 | 
			
		||||
			pp = (char **)sk_OPENSSL_PSTRING_value(db->db->data, i);
 | 
			
		||||
			pp = sk_OPENSSL_PSTRING_value(db->db->data,i);
 | 
			
		||||
	
 | 
			
		||||
			if (pp[DB_srptype][0] == 'v')
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
@@ -222,11 +222,19 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, crls, e);
 | 
			
		||||
	ret = 0;
 | 
			
		||||
	if (argc < 1)
 | 
			
		||||
		{ 
 | 
			
		||||
		if (1 != check(cert_ctx, NULL, untrusted, trusted, crls, e))
 | 
			
		||||
			ret = -1;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		for (i=0; i<argc; i++)
 | 
			
		||||
			check(cert_ctx,argv[i], untrusted, trusted, crls, e);
 | 
			
		||||
	ret=0;
 | 
			
		||||
			if (1 != check(cert_ctx,argv[i], untrusted, trusted, crls, e))
 | 
			
		||||
				ret = -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
end:
 | 
			
		||||
	if (ret == 1) {
 | 
			
		||||
		BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
 | 
			
		||||
@@ -235,13 +243,16 @@ end:
 | 
			
		||||
		BIO_printf(bio_err," [-engine e]");
 | 
			
		||||
#endif
 | 
			
		||||
		BIO_printf(bio_err," cert1 cert2 ...\n");
 | 
			
		||||
 | 
			
		||||
		BIO_printf(bio_err,"recognized usages:\n");
 | 
			
		||||
		for(i = 0; i < X509_PURPOSE_get_count(); i++) {
 | 
			
		||||
		for(i = 0; i < X509_PURPOSE_get_count(); i++)
 | 
			
		||||
			{
 | 
			
		||||
			X509_PURPOSE *ptmp;
 | 
			
		||||
			ptmp = X509_PURPOSE_get0(i);
 | 
			
		||||
			BIO_printf(bio_err, "\t%-10s\t%s\n", X509_PURPOSE_get0_sname(ptmp),
 | 
			
		||||
								X509_PURPOSE_get0_name(ptmp));
 | 
			
		||||
		}
 | 
			
		||||
			BIO_printf(bio_err, "\t%-10s\t%s\n",
 | 
			
		||||
				   X509_PURPOSE_get0_sname(ptmp),
 | 
			
		||||
				   X509_PURPOSE_get0_name(ptmp));
 | 
			
		||||
			}
 | 
			
		||||
	}
 | 
			
		||||
	if (vpm) X509_VERIFY_PARAM_free(vpm);
 | 
			
		||||
	if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
 | 
			
		||||
@@ -249,7 +260,7 @@ end:
 | 
			
		||||
	sk_X509_pop_free(trusted, X509_free);
 | 
			
		||||
	sk_X509_CRL_pop_free(crls, X509_CRL_free);
 | 
			
		||||
	apps_shutdown();
 | 
			
		||||
	OPENSSL_EXIT(ret);
 | 
			
		||||
	OPENSSL_EXIT(ret < 0 ? 2 : ret);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int check(X509_STORE *ctx, char *file,
 | 
			
		||||
 
 | 
			
		||||
@@ -288,7 +288,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			days=atoi(*(++argv));
 | 
			
		||||
			if (days == 0)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(STDout,"bad number of days\n");
 | 
			
		||||
				BIO_printf(bio_err,"bad number of days\n");
 | 
			
		||||
				goto bad;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
@@ -912,7 +912,7 @@ bad:
 | 
			
		||||
				}
 | 
			
		||||
			else if (text == i)
 | 
			
		||||
				{
 | 
			
		||||
				X509_print_ex(out,x,nmflag, certflag);
 | 
			
		||||
				X509_print_ex(STDout,x,nmflag, certflag);
 | 
			
		||||
				}
 | 
			
		||||
			else if (startdate == i)
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								config
									
									
									
									
									
								
							@@ -739,7 +739,7 @@ case "$GUESSOS" in
 | 
			
		||||
			    libc=/usr/lib/libc.so
 | 
			
		||||
			else					# OpenBSD
 | 
			
		||||
			    # ld searches for highest libc.so.* and so do we
 | 
			
		||||
			    libc=`(ls /usr/lib/libc.so.* | tail -1) 2>/dev/null`
 | 
			
		||||
			    libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
 | 
			
		||||
			fi
 | 
			
		||||
			case "`(file -L $libc) 2>/dev/null`" in
 | 
			
		||||
			*ELF*)	OUT="BSD-x86-elf" ;;
 | 
			
		||||
 
 | 
			
		||||
@@ -77,7 +77,9 @@ ia64cpuid.s: ia64cpuid.S;	$(CC) $(CFLAGS) -E ia64cpuid.S > $@
 | 
			
		||||
ppccpuid.s:	ppccpuid.pl;	$(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
 | 
			
		||||
pariscid.s:	pariscid.pl;	$(PERL) pariscid.pl $(PERLASM_SCHEME) $@
 | 
			
		||||
alphacpuid.s:	alphacpuid.pl
 | 
			
		||||
	$(PERL) $< | $(CC) -E - | tee $@ > /dev/null
 | 
			
		||||
	(preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
 | 
			
		||||
	$(PERL) alphacpuid.pl > $$preproc && \
 | 
			
		||||
	$(CC) -E $$preproc > $@ && rm $$preproc)
 | 
			
		||||
 | 
			
		||||
testapps:
 | 
			
		||||
	[ -z "$(THIS)" ] || (	if echo $(SDIRS) | fgrep ' des '; \
 | 
			
		||||
 
 | 
			
		||||
@@ -408,6 +408,7 @@ _armv4_AES_encrypt:
 | 
			
		||||
.type   private_AES_set_encrypt_key,%function
 | 
			
		||||
.align	5
 | 
			
		||||
private_AES_set_encrypt_key:
 | 
			
		||||
_armv4_AES_set_encrypt_key:
 | 
			
		||||
	sub	r3,pc,#8		@ AES_set_encrypt_key
 | 
			
		||||
	teq	r0,#0
 | 
			
		||||
	moveq	r0,#-1
 | 
			
		||||
@@ -425,7 +426,7 @@ private_AES_set_encrypt_key:
 | 
			
		||||
	bne	.Labrt
 | 
			
		||||
 | 
			
		||||
.Lok:	stmdb   sp!,{r4-r12,lr}
 | 
			
		||||
	sub	$tbl,r3,#private_AES_set_encrypt_key-AES_Te-1024	@ Te4
 | 
			
		||||
	sub	$tbl,r3,#_armv4_AES_set_encrypt_key-AES_Te-1024	@ Te4
 | 
			
		||||
 | 
			
		||||
	mov	$rounds,r0		@ inp
 | 
			
		||||
	mov	lr,r1			@ bits
 | 
			
		||||
@@ -685,7 +686,7 @@ private_AES_set_encrypt_key:
 | 
			
		||||
.align	5
 | 
			
		||||
private_AES_set_decrypt_key:
 | 
			
		||||
	str	lr,[sp,#-4]!            @ push lr
 | 
			
		||||
	bl	private_AES_set_encrypt_key
 | 
			
		||||
	bl	_armv4_AES_set_encrypt_key
 | 
			
		||||
	teq	r0,#0
 | 
			
		||||
	ldrne	lr,[sp],#4              @ pop lr
 | 
			
		||||
	bne	.Labrt
 | 
			
		||||
 
 | 
			
		||||
@@ -1036,9 +1036,9 @@ _mips_AES_set_encrypt_key:
 | 
			
		||||
	nop
 | 
			
		||||
.end	_mips_AES_set_encrypt_key
 | 
			
		||||
 | 
			
		||||
.globl	AES_set_encrypt_key
 | 
			
		||||
.ent	AES_set_encrypt_key
 | 
			
		||||
AES_set_encrypt_key:
 | 
			
		||||
.globl	private_AES_set_encrypt_key
 | 
			
		||||
.ent	private_AES_set_encrypt_key
 | 
			
		||||
private_AES_set_encrypt_key:
 | 
			
		||||
	.frame	$sp,$FRAMESIZE,$ra
 | 
			
		||||
	.mask	$SAVED_REGS_MASK,-$SZREG
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
@@ -1060,7 +1060,7 @@ $code.=<<___ if ($flavour =~ /nubi/i);	# optimize non-nubi prologue
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___ if ($flavour !~ /o32/i);	# non-o32 PIC-ification
 | 
			
		||||
	.cplocal	$Tbl
 | 
			
		||||
	.cpsetup	$pf,$zero,AES_set_encrypt_key
 | 
			
		||||
	.cpsetup	$pf,$zero,private_AES_set_encrypt_key
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
@@ -1083,7 +1083,7 @@ ___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	jr	$ra
 | 
			
		||||
	$PTR_ADD $sp,$FRAMESIZE
 | 
			
		||||
.end	AES_set_encrypt_key
 | 
			
		||||
.end	private_AES_set_encrypt_key
 | 
			
		||||
___
 | 
			
		||||
 | 
			
		||||
my ($head,$tail)=($inp,$bits);
 | 
			
		||||
@@ -1091,9 +1091,9 @@ my ($tp1,$tp2,$tp4,$tp8,$tp9,$tpb,$tpd,$tpe)=($a4,$a5,$a6,$a7,$s0,$s1,$s2,$s3);
 | 
			
		||||
my ($m,$x80808080,$x7f7f7f7f,$x1b1b1b1b)=($at,$t0,$t1,$t2);
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
.align	5
 | 
			
		||||
.globl	AES_set_decrypt_key
 | 
			
		||||
.ent	AES_set_decrypt_key
 | 
			
		||||
AES_set_decrypt_key:
 | 
			
		||||
.globl	private_AES_set_decrypt_key
 | 
			
		||||
.ent	private_AES_set_decrypt_key
 | 
			
		||||
private_AES_set_decrypt_key:
 | 
			
		||||
	.frame	$sp,$FRAMESIZE,$ra
 | 
			
		||||
	.mask	$SAVED_REGS_MASK,-$SZREG
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
@@ -1115,7 +1115,7 @@ $code.=<<___ if ($flavour =~ /nubi/i);	# optimize non-nubi prologue
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___ if ($flavour !~ /o32/i);	# non-o32 PIC-ification
 | 
			
		||||
	.cplocal	$Tbl
 | 
			
		||||
	.cpsetup	$pf,$zero,AES_set_decrypt_key
 | 
			
		||||
	.cpsetup	$pf,$zero,private_AES_set_decrypt_key
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
@@ -1226,7 +1226,7 @@ ___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	jr	$ra
 | 
			
		||||
	$PTR_ADD $sp,$FRAMESIZE
 | 
			
		||||
.end	AES_set_decrypt_key
 | 
			
		||||
.end	private_AES_set_decrypt_key
 | 
			
		||||
___
 | 
			
		||||
}}}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1015,7 +1015,8 @@ foreach (split("\n",$code)) {
 | 
			
		||||
		$SIZE_T==4 ? sprintf("extru%s,%d,8,",$1,31-$2)
 | 
			
		||||
		:            sprintf("extrd,u%s,%d,8,",$1,63-$2)/e;
 | 
			
		||||
 | 
			
		||||
	s/,\*/,/ if ($SIZE_T==4);
 | 
			
		||||
	s/,\*/,/			if ($SIZE_T==4);
 | 
			
		||||
	s/\bbv\b(.*\(%r2\))/bve$1/	if ($SIZE_T==8);
 | 
			
		||||
	print $_,"\n";
 | 
			
		||||
}
 | 
			
		||||
close STDOUT;
 | 
			
		||||
 
 | 
			
		||||
@@ -783,6 +783,7 @@ $code.=<<___;
 | 
			
		||||
.type	private_AES_set_encrypt_key,\@function
 | 
			
		||||
.align	16
 | 
			
		||||
private_AES_set_encrypt_key:
 | 
			
		||||
_s390x_AES_set_encrypt_key:
 | 
			
		||||
	lghi	$t0,0
 | 
			
		||||
	cl${g}r	$inp,$t0
 | 
			
		||||
	je	.Lminus1
 | 
			
		||||
@@ -836,7 +837,8 @@ $code.=<<___ if (!$softonly);
 | 
			
		||||
	je	1f
 | 
			
		||||
	lg	%r1,24($inp)
 | 
			
		||||
	stg	%r1,24($key)
 | 
			
		||||
1:	st	$bits,236($key)	# save bits
 | 
			
		||||
1:	st	$bits,236($key)	# save bits [for debugging purposes]
 | 
			
		||||
	lgr	$t0,%r5
 | 
			
		||||
	st	%r5,240($key)	# save km code
 | 
			
		||||
	lghi	%r2,0
 | 
			
		||||
	br	%r14
 | 
			
		||||
@@ -844,7 +846,7 @@ ___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
.align	16
 | 
			
		||||
.Lekey_internal:
 | 
			
		||||
	stm${g}	%r6,%r13,6*$SIZE_T($sp)	# all non-volatile regs
 | 
			
		||||
	stm${g}	%r4,%r13,4*$SIZE_T($sp)	# all non-volatile regs and $key
 | 
			
		||||
 | 
			
		||||
	larl	$tbl,AES_Te+2048
 | 
			
		||||
 | 
			
		||||
@@ -904,8 +906,9 @@ $code.=<<___;
 | 
			
		||||
	la	$key,16($key)		# key+=4
 | 
			
		||||
	la	$t3,4($t3)		# i++
 | 
			
		||||
	brct	$rounds,.L128_loop
 | 
			
		||||
	lghi	$t0,10
 | 
			
		||||
	lghi	%r2,0
 | 
			
		||||
	lm${g}	%r6,%r13,6*$SIZE_T($sp)
 | 
			
		||||
	lm${g}	%r4,%r13,4*$SIZE_T($sp)
 | 
			
		||||
	br	$ra
 | 
			
		||||
 | 
			
		||||
.align	16
 | 
			
		||||
@@ -952,8 +955,9 @@ $code.=<<___;
 | 
			
		||||
	st	$s2,32($key)
 | 
			
		||||
	st	$s3,36($key)
 | 
			
		||||
	brct	$rounds,.L192_continue
 | 
			
		||||
	lghi	$t0,12
 | 
			
		||||
	lghi	%r2,0
 | 
			
		||||
	lm${g}	%r6,%r13,6*$SIZE_T($sp)
 | 
			
		||||
	lm${g}	%r4,%r13,4*$SIZE_T($sp)
 | 
			
		||||
	br	$ra
 | 
			
		||||
 | 
			
		||||
.align	16
 | 
			
		||||
@@ -1014,8 +1018,9 @@ $code.=<<___;
 | 
			
		||||
	st	$s2,40($key)
 | 
			
		||||
	st	$s3,44($key)
 | 
			
		||||
	brct	$rounds,.L256_continue
 | 
			
		||||
	lghi	$t0,14
 | 
			
		||||
	lghi	%r2,0
 | 
			
		||||
	lm${g}	%r6,%r13,6*$SIZE_T($sp)
 | 
			
		||||
	lm${g}	%r4,%r13,4*$SIZE_T($sp)
 | 
			
		||||
	br	$ra
 | 
			
		||||
 | 
			
		||||
.align	16
 | 
			
		||||
@@ -1066,34 +1071,26 @@ $code.=<<___;
 | 
			
		||||
.type	private_AES_set_decrypt_key,\@function
 | 
			
		||||
.align	16
 | 
			
		||||
private_AES_set_decrypt_key:
 | 
			
		||||
	st${g}	$key,4*$SIZE_T($sp)	# I rely on AES_set_encrypt_key to
 | 
			
		||||
	st${g}	$ra,14*$SIZE_T($sp)	# save non-volatile registers!
 | 
			
		||||
	bras	$ra,AES_set_encrypt_key
 | 
			
		||||
	l${g}	$key,4*$SIZE_T($sp)
 | 
			
		||||
	#st${g}	$key,4*$SIZE_T($sp)	# I rely on AES_set_encrypt_key to
 | 
			
		||||
	st${g}	$ra,14*$SIZE_T($sp)	# save non-volatile registers and $key!
 | 
			
		||||
	bras	$ra,_s390x_AES_set_encrypt_key
 | 
			
		||||
	#l${g}	$key,4*$SIZE_T($sp)
 | 
			
		||||
	l${g}	$ra,14*$SIZE_T($sp)
 | 
			
		||||
	ltgr	%r2,%r2
 | 
			
		||||
	bnzr	$ra
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___ if (!$softonly);
 | 
			
		||||
	l	$t0,240($key)
 | 
			
		||||
	#l	$t0,240($key)
 | 
			
		||||
	lhi	$t1,16
 | 
			
		||||
	cr	$t0,$t1
 | 
			
		||||
	jl	.Lgo
 | 
			
		||||
	oill	$t0,0x80	# set "decrypt" bit
 | 
			
		||||
	st	$t0,240($key)
 | 
			
		||||
	br	$ra
 | 
			
		||||
 | 
			
		||||
.align	16
 | 
			
		||||
.Ldkey_internal:
 | 
			
		||||
	st${g}	$key,4*$SIZE_T($sp)
 | 
			
		||||
	st${g}	$ra,14*$SIZE_T($sp)
 | 
			
		||||
	bras	$ra,.Lekey_internal
 | 
			
		||||
	l${g}	$key,4*$SIZE_T($sp)
 | 
			
		||||
	l${g}	$ra,14*$SIZE_T($sp)
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
 | 
			
		||||
.Lgo:	llgf	$rounds,240($key)
 | 
			
		||||
.align	16
 | 
			
		||||
.Lgo:	lgr	$rounds,$t0	#llgf	$rounds,240($key)
 | 
			
		||||
	la	$i1,0($key)
 | 
			
		||||
	sllg	$i2,$rounds,4
 | 
			
		||||
	la	$i2,0($i2,$key)
 | 
			
		||||
@@ -1601,11 +1598,11 @@ $code.=<<___ if(1);
 | 
			
		||||
	lghi	$s1,0x7f
 | 
			
		||||
	nr	$s1,%r0
 | 
			
		||||
	lghi	%r0,0			# query capability vector
 | 
			
		||||
	la	%r1,2*$SIZE_T($sp)
 | 
			
		||||
	la	%r1,$tweak-16($sp)
 | 
			
		||||
	.long	0xb92e0042		# km %r4,%r2
 | 
			
		||||
	llihh	%r1,0x8000
 | 
			
		||||
	srlg	%r1,%r1,32($s1)		# check for 32+function code
 | 
			
		||||
	ng	%r1,2*$SIZE_T($sp)
 | 
			
		||||
	ng	%r1,$tweak-16($sp)
 | 
			
		||||
	lgr	%r0,$s0			# restore the function code
 | 
			
		||||
	la	%r1,0($key1)		# restore $key1
 | 
			
		||||
	jz	.Lxts_km_vanilla
 | 
			
		||||
@@ -1631,7 +1628,7 @@ $code.=<<___ if(1);
 | 
			
		||||
 | 
			
		||||
	lrvg	$s0,$tweak+0($sp)	# load the last tweak
 | 
			
		||||
	lrvg	$s1,$tweak+8($sp)
 | 
			
		||||
	stmg	%r0,%r3,$tweak-32(%r1)	# wipe copy of the key
 | 
			
		||||
	stmg	%r0,%r3,$tweak-32($sp)	# wipe copy of the key
 | 
			
		||||
 | 
			
		||||
	nill	%r0,0xffdf		# switch back to original function code
 | 
			
		||||
	la	%r1,0($key1)		# restore pointer to $key1
 | 
			
		||||
@@ -1687,11 +1684,9 @@ $code.=<<___;
 | 
			
		||||
	lghi	$i1,0x87
 | 
			
		||||
	srag	$i2,$s1,63		# broadcast upper bit
 | 
			
		||||
	ngr	$i1,$i2			# rem
 | 
			
		||||
	srlg	$i2,$s0,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s0,$s0,1
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	algr	$s0,$s0
 | 
			
		||||
	alcgr	$s1,$s1
 | 
			
		||||
	xgr	$s0,$i1
 | 
			
		||||
	ogr	$s1,$i2
 | 
			
		||||
.Lxts_km_start:
 | 
			
		||||
	lrvgr	$i1,$s0			# flip byte order
 | 
			
		||||
	lrvgr	$i2,$s1
 | 
			
		||||
@@ -1748,11 +1743,9 @@ $code.=<<___;
 | 
			
		||||
	lghi	$i1,0x87
 | 
			
		||||
	srag	$i2,$s1,63		# broadcast upper bit
 | 
			
		||||
	ngr	$i1,$i2			# rem
 | 
			
		||||
	srlg	$i2,$s0,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s0,$s0,1
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	algr	$s0,$s0
 | 
			
		||||
	alcgr	$s1,$s1
 | 
			
		||||
	xgr	$s0,$i1
 | 
			
		||||
	ogr	$s1,$i2
 | 
			
		||||
 | 
			
		||||
	ltr	$len,$len		# clear zero flag
 | 
			
		||||
	br	$ra
 | 
			
		||||
@@ -1784,8 +1777,8 @@ $code.=<<___ if (!$softonly);
 | 
			
		||||
	clr	%r0,%r1
 | 
			
		||||
	jl	.Lxts_enc_software
 | 
			
		||||
 | 
			
		||||
	st${g}	$ra,5*$SIZE_T($sp)
 | 
			
		||||
	stm${g}	%r6,$s3,6*$SIZE_T($sp)
 | 
			
		||||
	st${g}	$ra,14*$SIZE_T($sp)
 | 
			
		||||
 | 
			
		||||
	sllg	$len,$len,4		# $len&=~15
 | 
			
		||||
	slgr	$out,$inp
 | 
			
		||||
@@ -1833,9 +1826,9 @@ $code.=<<___ if (!$softonly);
 | 
			
		||||
	stg	$i2,8($i3)
 | 
			
		||||
 | 
			
		||||
.Lxts_enc_km_done:
 | 
			
		||||
	l${g}	$ra,14*$SIZE_T($sp)
 | 
			
		||||
	st${g}	$sp,$tweak($sp)		# wipe tweak
 | 
			
		||||
	st${g}	$sp,$tweak($sp)
 | 
			
		||||
	stg	$sp,$tweak+0($sp)	# wipe tweak
 | 
			
		||||
	stg	$sp,$tweak+8($sp)
 | 
			
		||||
	l${g}	$ra,5*$SIZE_T($sp)
 | 
			
		||||
	lm${g}	%r6,$s3,6*$SIZE_T($sp)
 | 
			
		||||
	br	$ra
 | 
			
		||||
.align	16
 | 
			
		||||
@@ -1846,12 +1839,11 @@ $code.=<<___;
 | 
			
		||||
 | 
			
		||||
	slgr	$out,$inp
 | 
			
		||||
 | 
			
		||||
	xgr	$s0,$s0			# clear upper half
 | 
			
		||||
	xgr	$s1,$s1
 | 
			
		||||
	lrv	$s0,$stdframe+4($sp)	# load secno
 | 
			
		||||
	lrv	$s1,$stdframe+0($sp)
 | 
			
		||||
	xgr	$s2,$s2
 | 
			
		||||
	xgr	$s3,$s3
 | 
			
		||||
	l${g}	$s3,$stdframe($sp)	# ivp
 | 
			
		||||
	llgf	$s0,0($s3)		# load iv
 | 
			
		||||
	llgf	$s1,4($s3)
 | 
			
		||||
	llgf	$s2,8($s3)
 | 
			
		||||
	llgf	$s3,12($s3)
 | 
			
		||||
	stm${g}	%r2,%r5,2*$SIZE_T($sp)
 | 
			
		||||
	la	$key,0($key2)
 | 
			
		||||
	larl	$tbl,AES_Te
 | 
			
		||||
@@ -1867,11 +1859,9 @@ $code.=<<___;
 | 
			
		||||
	lghi	%r1,0x87
 | 
			
		||||
	srag	%r0,$s3,63		# broadcast upper bit
 | 
			
		||||
	ngr	%r1,%r0			# rem
 | 
			
		||||
	srlg	%r0,$s1,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	sllg	$s3,$s3,1
 | 
			
		||||
	algr	$s1,$s1
 | 
			
		||||
	alcgr	$s3,$s3
 | 
			
		||||
	xgr	$s1,%r1
 | 
			
		||||
	ogr	$s3,%r0
 | 
			
		||||
	lrvgr	$s1,$s1			# flip byte order
 | 
			
		||||
	lrvgr	$s3,$s3
 | 
			
		||||
	srlg	$s0,$s1,32		# smash the tweak to 4x32-bits 
 | 
			
		||||
@@ -1920,11 +1910,9 @@ $code.=<<___;
 | 
			
		||||
	lghi	%r1,0x87
 | 
			
		||||
	srag	%r0,$s3,63		# broadcast upper bit
 | 
			
		||||
	ngr	%r1,%r0			# rem
 | 
			
		||||
	srlg	%r0,$s1,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	sllg	$s3,$s3,1
 | 
			
		||||
	algr	$s1,$s1
 | 
			
		||||
	alcgr	$s3,$s3
 | 
			
		||||
	xgr	$s1,%r1
 | 
			
		||||
	ogr	$s3,%r0
 | 
			
		||||
	lrvgr	$s1,$s1			# flip byte order
 | 
			
		||||
	lrvgr	$s3,$s3
 | 
			
		||||
	srlg	$s0,$s1,32		# smash the tweak to 4x32-bits 
 | 
			
		||||
@@ -1959,7 +1947,8 @@ $code.=<<___;
 | 
			
		||||
.size	AES_xts_encrypt,.-AES_xts_encrypt
 | 
			
		||||
___
 | 
			
		||||
# void AES_xts_decrypt(const char *inp,char *out,size_t len,
 | 
			
		||||
#	const AES_KEY *key1, const AES_KEY *key2,u64 secno);
 | 
			
		||||
#	const AES_KEY *key1, const AES_KEY *key2,
 | 
			
		||||
#	const unsigned char iv[16]);
 | 
			
		||||
#
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
.globl	AES_xts_decrypt
 | 
			
		||||
@@ -1991,8 +1980,8 @@ $code.=<<___ if (!$softonly);
 | 
			
		||||
	clr	%r0,%r1
 | 
			
		||||
	jl	.Lxts_dec_software
 | 
			
		||||
 | 
			
		||||
	st${g}	$ra,5*$SIZE_T($sp)
 | 
			
		||||
	stm${g}	%r6,$s3,6*$SIZE_T($sp)
 | 
			
		||||
	st${g}	$ra,14*$SIZE_T($sp)
 | 
			
		||||
 | 
			
		||||
	nill	$len,0xfff0		# $len&=~15
 | 
			
		||||
	slgr	$out,$inp
 | 
			
		||||
@@ -2031,11 +2020,9 @@ $code.=<<___ if (!$softonly);
 | 
			
		||||
	lghi	$i1,0x87
 | 
			
		||||
	srag	$i2,$s1,63		# broadcast upper bit
 | 
			
		||||
	ngr	$i1,$i2			# rem
 | 
			
		||||
	srlg	$i2,$s0,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s0,$s0,1
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	algr	$s0,$s0
 | 
			
		||||
	alcgr	$s1,$s1
 | 
			
		||||
	xgr	$s0,$i1
 | 
			
		||||
	ogr	$s1,$i2
 | 
			
		||||
	lrvgr	$i1,$s0			# flip byte order
 | 
			
		||||
	lrvgr	$i2,$s1
 | 
			
		||||
 | 
			
		||||
@@ -2078,9 +2065,9 @@ $code.=<<___ if (!$softonly);
 | 
			
		||||
	stg	$s2,0($i3)
 | 
			
		||||
	stg	$s3,8($i3)
 | 
			
		||||
.Lxts_dec_km_done:
 | 
			
		||||
	l${g}	$ra,14*$SIZE_T($sp)
 | 
			
		||||
	st${g}	$sp,$tweak($sp)		# wipe tweak
 | 
			
		||||
	st${g}	$sp,$tweak($sp)
 | 
			
		||||
	stg	$sp,$tweak+0($sp)	# wipe tweak
 | 
			
		||||
	stg	$sp,$tweak+8($sp)
 | 
			
		||||
	l${g}	$ra,5*$SIZE_T($sp)
 | 
			
		||||
	lm${g}	%r6,$s3,6*$SIZE_T($sp)
 | 
			
		||||
	br	$ra
 | 
			
		||||
.align	16
 | 
			
		||||
@@ -2092,12 +2079,11 @@ $code.=<<___;
 | 
			
		||||
	srlg	$len,$len,4
 | 
			
		||||
	slgr	$out,$inp
 | 
			
		||||
 | 
			
		||||
	xgr	$s0,$s0			# clear upper half
 | 
			
		||||
	xgr	$s1,$s1
 | 
			
		||||
	lrv	$s0,$stdframe+4($sp)	# load secno
 | 
			
		||||
	lrv	$s1,$stdframe+0($sp)
 | 
			
		||||
	xgr	$s2,$s2
 | 
			
		||||
	xgr	$s3,$s3
 | 
			
		||||
	l${g}	$s3,$stdframe($sp)	# ivp
 | 
			
		||||
	llgf	$s0,0($s3)		# load iv
 | 
			
		||||
	llgf	$s1,4($s3)
 | 
			
		||||
	llgf	$s2,8($s3)
 | 
			
		||||
	llgf	$s3,12($s3)
 | 
			
		||||
	stm${g}	%r2,%r5,2*$SIZE_T($sp)
 | 
			
		||||
	la	$key,0($key2)
 | 
			
		||||
	larl	$tbl,AES_Te
 | 
			
		||||
@@ -2116,11 +2102,9 @@ $code.=<<___;
 | 
			
		||||
	lghi	%r1,0x87
 | 
			
		||||
	srag	%r0,$s3,63		# broadcast upper bit
 | 
			
		||||
	ngr	%r1,%r0			# rem
 | 
			
		||||
	srlg	%r0,$s1,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	sllg	$s3,$s3,1
 | 
			
		||||
	algr	$s1,$s1
 | 
			
		||||
	alcgr	$s3,$s3
 | 
			
		||||
	xgr	$s1,%r1
 | 
			
		||||
	ogr	$s3,%r0
 | 
			
		||||
	lrvgr	$s1,$s1			# flip byte order
 | 
			
		||||
	lrvgr	$s3,$s3
 | 
			
		||||
	srlg	$s0,$s1,32		# smash the tweak to 4x32-bits 
 | 
			
		||||
@@ -2159,11 +2143,9 @@ $code.=<<___;
 | 
			
		||||
	lghi	%r1,0x87
 | 
			
		||||
	srag	%r0,$s3,63		# broadcast upper bit
 | 
			
		||||
	ngr	%r1,%r0			# rem
 | 
			
		||||
	srlg	%r0,$s1,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	sllg	$s3,$s3,1
 | 
			
		||||
	algr	$s1,$s1
 | 
			
		||||
	alcgr	$s3,$s3
 | 
			
		||||
	xgr	$s1,%r1
 | 
			
		||||
	ogr	$s3,%r0
 | 
			
		||||
	lrvgr	$i2,$s1			# flip byte order
 | 
			
		||||
	lrvgr	$i3,$s3
 | 
			
		||||
	stmg	$i2,$i3,$tweak($sp)	# save the 1st tweak
 | 
			
		||||
@@ -2179,11 +2161,9 @@ $code.=<<___;
 | 
			
		||||
	lghi	%r1,0x87
 | 
			
		||||
	srag	%r0,$s3,63		# broadcast upper bit
 | 
			
		||||
	ngr	%r1,%r0			# rem
 | 
			
		||||
	srlg	%r0,$s1,63		# carry bit from lower half
 | 
			
		||||
	sllg	$s1,$s1,1
 | 
			
		||||
	sllg	$s3,$s3,1
 | 
			
		||||
	algr	$s1,$s1
 | 
			
		||||
	alcgr	$s3,$s3
 | 
			
		||||
	xgr	$s1,%r1
 | 
			
		||||
	ogr	$s3,%r0
 | 
			
		||||
	lrvgr	$s1,$s1			# flip byte order
 | 
			
		||||
	lrvgr	$s3,$s3
 | 
			
		||||
	srlg	$s0,$s1,32		# smash the tweak to 4x32-bits
 | 
			
		||||
 
 | 
			
		||||
@@ -1176,6 +1176,7 @@ ___
 | 
			
		||||
# As UltraSPARC T1, a.k.a. Niagara, has shared FPU, FP nops can have
 | 
			
		||||
# undesired effect, so just omit them and sacrifice some portion of
 | 
			
		||||
# percent in performance...
 | 
			
		||||
$code =~ s/fmovs.*$//gem;
 | 
			
		||||
$code =~ s/fmovs.*$//gm;
 | 
			
		||||
 | 
			
		||||
print $code;
 | 
			
		||||
close STDOUT;	# ensure flush
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
$verticalspin=1;	# unlike 32-bit version $verticalspin performs
 | 
			
		||||
			# ~15% better on both AMD and Intel cores
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,8 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
 | 
			
		||||
	   `ml64 2>&1` =~ /Version ([0-9]+)\./ &&
 | 
			
		||||
	   $1>=10);
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
# void aesni_cbc_sha1_enc(const void *inp,
 | 
			
		||||
#			void *out,
 | 
			
		||||
 
 | 
			
		||||
@@ -172,7 +172,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
$movkey = $PREFIX eq "aesni" ? "movups" : "movups";
 | 
			
		||||
@_4args=$win64?	("%rcx","%rdx","%r8", "%r9") :	# Win64 order
 | 
			
		||||
 
 | 
			
		||||
@@ -65,12 +65,12 @@
 | 
			
		||||
# function is:
 | 
			
		||||
#
 | 
			
		||||
# 		conversion	conversion/8x block
 | 
			
		||||
# Core 2	410		0.37
 | 
			
		||||
# Nehalem	310		0.35
 | 
			
		||||
# Atom		570		0.26
 | 
			
		||||
# Core 2	240		0.22
 | 
			
		||||
# Nehalem	180		0.20
 | 
			
		||||
# Atom		430		0.19
 | 
			
		||||
#
 | 
			
		||||
# The ratio values mean that 128-byte blocks will be processed
 | 
			
		||||
# 21-27% slower, 256-byte blocks - 12-16%, 384-byte blocks - 8-11%,
 | 
			
		||||
# 16-18% slower, 256-byte blocks - 9-10%, 384-byte blocks - 6-7%,
 | 
			
		||||
# etc. Then keep in mind that input sizes not divisible by 128 are
 | 
			
		||||
# *effectively* slower, especially shortest ones, e.g. consecutive
 | 
			
		||||
# 144-byte blocks are processed 44% slower than one would expect,
 | 
			
		||||
@@ -83,8 +83,9 @@
 | 
			
		||||
# Add decryption procedure. Performance in CPU cycles spent to decrypt
 | 
			
		||||
# one byte out of 4096-byte buffer with 128-bit key is:
 | 
			
		||||
#
 | 
			
		||||
# Core 2	11.0
 | 
			
		||||
# Nehalem	9.16
 | 
			
		||||
# Core 2	9.83
 | 
			
		||||
# Nehalem	7.74
 | 
			
		||||
# Atom		19.0
 | 
			
		||||
#
 | 
			
		||||
# November 2011.
 | 
			
		||||
#
 | 
			
		||||
@@ -104,7 +105,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
my ($inp,$out,$len,$key,$ivp)=("%rdi","%rsi","%rdx","%rcx");
 | 
			
		||||
my @XMM=map("%xmm$_",(15,0..14));	# best on Atom, +10% over (0..15)
 | 
			
		||||
@@ -454,6 +456,7 @@ sub MixColumns {
 | 
			
		||||
# modified to emit output in order suitable for feeding back to aesenc[last]
 | 
			
		||||
my @x=@_[0..7];
 | 
			
		||||
my @t=@_[8..15];
 | 
			
		||||
my $inv=@_[16];	# optional
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	pshufd	\$0x93, @x[0], @t[0]	# x0 <<< 32
 | 
			
		||||
	pshufd	\$0x93, @x[1], @t[1]
 | 
			
		||||
@@ -495,7 +498,8 @@ $code.=<<___;
 | 
			
		||||
	pxor	@t[4], @t[0]
 | 
			
		||||
	 pshufd	\$0x4E, @x[2], @x[6]
 | 
			
		||||
	pxor	@t[5], @t[1]
 | 
			
		||||
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___ if (!$inv);
 | 
			
		||||
	pxor	@t[3], @x[4]
 | 
			
		||||
	pxor	@t[7], @x[5]
 | 
			
		||||
	pxor	@t[6], @x[3]
 | 
			
		||||
@@ -503,9 +507,20 @@ $code.=<<___;
 | 
			
		||||
	pxor	@t[2], @x[6]
 | 
			
		||||
	 movdqa	@t[1], @x[7]
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___ if ($inv);
 | 
			
		||||
	pxor	@x[4], @t[3]
 | 
			
		||||
	pxor	@t[7], @x[5]
 | 
			
		||||
	pxor	@x[3], @t[6]
 | 
			
		||||
	 movdqa	@t[0], @x[3]
 | 
			
		||||
	pxor	@t[2], @x[6]
 | 
			
		||||
	 movdqa	@t[6], @x[2]
 | 
			
		||||
	 movdqa	@t[1], @x[7]
 | 
			
		||||
	 movdqa	@x[6], @x[4]
 | 
			
		||||
	 movdqa	@t[3], @x[6]
 | 
			
		||||
___
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub InvMixColumns {
 | 
			
		||||
sub InvMixColumns_orig {
 | 
			
		||||
my @x=@_[0..7];
 | 
			
		||||
my @t=@_[8..15];
 | 
			
		||||
 | 
			
		||||
@@ -659,6 +674,54 @@ $code.=<<___;
 | 
			
		||||
___
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub InvMixColumns {
 | 
			
		||||
my @x=@_[0..7];
 | 
			
		||||
my @t=@_[8..15];
 | 
			
		||||
 | 
			
		||||
# Thanks to Jussi Kivilinna for providing pointer to
 | 
			
		||||
#
 | 
			
		||||
# | 0e 0b 0d 09 |   | 02 03 01 01 |   | 05 00 04 00 |
 | 
			
		||||
# | 09 0e 0b 0d | = | 01 02 03 01 | x | 00 05 00 04 |
 | 
			
		||||
# | 0d 09 0e 0b |   | 01 01 02 03 |   | 04 00 05 00 |
 | 
			
		||||
# | 0b 0d 09 0e |   | 03 01 01 02 |   | 00 04 00 05 |
 | 
			
		||||
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	# multiplication by 0x05-0x00-0x04-0x00
 | 
			
		||||
	pshufd	\$0x4E, @x[0], @t[0]
 | 
			
		||||
	pshufd	\$0x4E, @x[6], @t[6]
 | 
			
		||||
	pxor	@x[0], @t[0]
 | 
			
		||||
	pshufd	\$0x4E, @x[7], @t[7]
 | 
			
		||||
	pxor	@x[6], @t[6]
 | 
			
		||||
	pshufd	\$0x4E, @x[1], @t[1]
 | 
			
		||||
	pxor	@x[7], @t[7]
 | 
			
		||||
	pshufd	\$0x4E, @x[2], @t[2]
 | 
			
		||||
	pxor	@x[1], @t[1]
 | 
			
		||||
	pshufd	\$0x4E, @x[3], @t[3]
 | 
			
		||||
	pxor	@x[2], @t[2]
 | 
			
		||||
	 pxor	@t[6], @x[0]
 | 
			
		||||
	 pxor	@t[6], @x[1]
 | 
			
		||||
	pshufd	\$0x4E, @x[4], @t[4]
 | 
			
		||||
	pxor	@x[3], @t[3]
 | 
			
		||||
	 pxor	@t[0], @x[2]
 | 
			
		||||
	 pxor	@t[1], @x[3]
 | 
			
		||||
	pshufd	\$0x4E, @x[5], @t[5]
 | 
			
		||||
	pxor	@x[4], @t[4]
 | 
			
		||||
	 pxor	@t[7], @x[1]
 | 
			
		||||
	 pxor	@t[2], @x[4]
 | 
			
		||||
	pxor	@x[5], @t[5]
 | 
			
		||||
 | 
			
		||||
	 pxor	@t[7], @x[2]
 | 
			
		||||
	 pxor	@t[6], @x[3]
 | 
			
		||||
	 pxor	@t[6], @x[4]
 | 
			
		||||
	 pxor	@t[3], @x[5]
 | 
			
		||||
	 pxor	@t[4], @x[6]
 | 
			
		||||
	 pxor	@t[7], @x[4]
 | 
			
		||||
	 pxor	@t[7], @x[5]
 | 
			
		||||
	 pxor	@t[5], @x[7]
 | 
			
		||||
___
 | 
			
		||||
	&MixColumns	(@x,@t,1);	# flipped 2<->3 and 4<->6
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub aesenc {				# not used
 | 
			
		||||
my @b=@_[0..7];
 | 
			
		||||
my @t=@_[8..15];
 | 
			
		||||
@@ -754,7 +817,7 @@ _bsaes_encrypt8:
 | 
			
		||||
 | 
			
		||||
	movdqa	($key), @XMM[9]		# round 0 key
 | 
			
		||||
	lea	0x10($key), $key
 | 
			
		||||
	movdqa	0x60($const), @XMM[8]	# .LM0SR
 | 
			
		||||
	movdqa	0x50($const), @XMM[8]	# .LM0SR
 | 
			
		||||
	pxor	@XMM[9], @XMM[0]	# xor with round0 key
 | 
			
		||||
	pxor	@XMM[9], @XMM[1]
 | 
			
		||||
	 pshufb	@XMM[8], @XMM[0]
 | 
			
		||||
@@ -905,46 +968,82 @@ $code.=<<___;
 | 
			
		||||
.type	_bsaes_key_convert,\@abi-omnipotent
 | 
			
		||||
.align	16
 | 
			
		||||
_bsaes_key_convert:
 | 
			
		||||
	lea	.LBS1(%rip), $const
 | 
			
		||||
	lea	.Lmasks(%rip), $const
 | 
			
		||||
	movdqu	($inp), %xmm7		# load round 0 key
 | 
			
		||||
	movdqa	-0x10($const), %xmm8	# .LBS0
 | 
			
		||||
	movdqa	0x00($const), %xmm9	# .LBS1
 | 
			
		||||
	movdqa	0x10($const), %xmm10	# .LBS2
 | 
			
		||||
	movdqa	0x40($const), %xmm13	# .LM0
 | 
			
		||||
	movdqa	0x60($const), %xmm14	# .LNOT
 | 
			
		||||
 | 
			
		||||
	movdqu	0x10($inp), %xmm6	# load round 1 key
 | 
			
		||||
	lea	0x10($inp), $inp
 | 
			
		||||
	movdqa	0x00($const), %xmm0	# 0x01...
 | 
			
		||||
	movdqa	0x10($const), %xmm1	# 0x02...
 | 
			
		||||
	movdqa	0x20($const), %xmm2	# 0x04...
 | 
			
		||||
	movdqa	0x30($const), %xmm3	# 0x08...
 | 
			
		||||
	movdqa	0x40($const), %xmm4	# .LM0
 | 
			
		||||
	pcmpeqd	%xmm5, %xmm5		# .LNOT
 | 
			
		||||
 | 
			
		||||
	movdqu	($inp), %xmm6		# load round 1 key
 | 
			
		||||
	movdqa	%xmm7, ($out)		# save round 0 key
 | 
			
		||||
	lea	0x10($out), $out
 | 
			
		||||
	dec	$rounds
 | 
			
		||||
	jmp	.Lkey_loop
 | 
			
		||||
.align	16
 | 
			
		||||
.Lkey_loop:
 | 
			
		||||
	pshufb	%xmm13, %xmm6		# .LM0
 | 
			
		||||
	movdqa	%xmm6, %xmm7
 | 
			
		||||
___
 | 
			
		||||
	&bitslice_key	(map("%xmm$_",(0..7, 8..12)));
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	pxor	%xmm14, %xmm5		# "pnot"
 | 
			
		||||
	pxor	%xmm14, %xmm6
 | 
			
		||||
	pxor	%xmm14, %xmm0
 | 
			
		||||
	pxor	%xmm14, %xmm1
 | 
			
		||||
	lea	0x10($inp), $inp
 | 
			
		||||
	movdqa	%xmm0, 0x00($out)	# write bit-sliced round key
 | 
			
		||||
	movdqa	%xmm1, 0x10($out)
 | 
			
		||||
	movdqa	%xmm2, 0x20($out)
 | 
			
		||||
	movdqa	%xmm3, 0x30($out)
 | 
			
		||||
	movdqa	%xmm4, 0x40($out)
 | 
			
		||||
	movdqa	%xmm5, 0x50($out)
 | 
			
		||||
	movdqa	%xmm6, 0x60($out)
 | 
			
		||||
	movdqa	%xmm7, 0x70($out)
 | 
			
		||||
	pshufb	%xmm4, %xmm6		# .LM0
 | 
			
		||||
 | 
			
		||||
	movdqa	%xmm0,	%xmm8
 | 
			
		||||
	movdqa	%xmm1,	%xmm9
 | 
			
		||||
 | 
			
		||||
	pand	%xmm6,	%xmm8
 | 
			
		||||
	pand	%xmm6,	%xmm9
 | 
			
		||||
	movdqa	%xmm2,	%xmm10
 | 
			
		||||
	pcmpeqb	%xmm0,	%xmm8
 | 
			
		||||
	psllq	\$4,	%xmm0		# 0x10...
 | 
			
		||||
	movdqa	%xmm3,	%xmm11
 | 
			
		||||
	pcmpeqb	%xmm1,	%xmm9
 | 
			
		||||
	psllq	\$4,	%xmm1		# 0x20...
 | 
			
		||||
 | 
			
		||||
	pand	%xmm6,	%xmm10
 | 
			
		||||
	pand	%xmm6,	%xmm11
 | 
			
		||||
	movdqa	%xmm0,	%xmm12
 | 
			
		||||
	pcmpeqb	%xmm2,	%xmm10
 | 
			
		||||
	psllq	\$4,	%xmm2		# 0x40...
 | 
			
		||||
	movdqa	%xmm1,	%xmm13
 | 
			
		||||
	pcmpeqb	%xmm3,	%xmm11
 | 
			
		||||
	psllq	\$4,	%xmm3		# 0x80...
 | 
			
		||||
 | 
			
		||||
	movdqa	%xmm2,	%xmm14
 | 
			
		||||
	movdqa	%xmm3,	%xmm15
 | 
			
		||||
	 pxor	%xmm5,	%xmm8		# "pnot"
 | 
			
		||||
	 pxor	%xmm5,	%xmm9
 | 
			
		||||
 | 
			
		||||
	pand	%xmm6,	%xmm12
 | 
			
		||||
	pand	%xmm6,	%xmm13
 | 
			
		||||
	 movdqa	%xmm8, 0x00($out)	# write bit-sliced round key
 | 
			
		||||
	pcmpeqb	%xmm0,	%xmm12
 | 
			
		||||
	psrlq	\$4,	%xmm0		# 0x01...
 | 
			
		||||
	 movdqa	%xmm9, 0x10($out)
 | 
			
		||||
	pcmpeqb	%xmm1,	%xmm13
 | 
			
		||||
	psrlq	\$4,	%xmm1		# 0x02...
 | 
			
		||||
	 lea	0x10($inp), $inp
 | 
			
		||||
 | 
			
		||||
	pand	%xmm6,	%xmm14
 | 
			
		||||
	pand	%xmm6,	%xmm15
 | 
			
		||||
	 movdqa	%xmm10, 0x20($out)
 | 
			
		||||
	pcmpeqb	%xmm2,	%xmm14
 | 
			
		||||
	psrlq	\$4,	%xmm2		# 0x04...
 | 
			
		||||
	 movdqa	%xmm11, 0x30($out)
 | 
			
		||||
	pcmpeqb	%xmm3,	%xmm15
 | 
			
		||||
	psrlq	\$4,	%xmm3		# 0x08...
 | 
			
		||||
	 movdqu	($inp), %xmm6		# load next round key
 | 
			
		||||
 | 
			
		||||
	pxor	%xmm5, %xmm13		# "pnot"
 | 
			
		||||
	pxor	%xmm5, %xmm14
 | 
			
		||||
	movdqa	%xmm12, 0x40($out)
 | 
			
		||||
	movdqa	%xmm13, 0x50($out)
 | 
			
		||||
	movdqa	%xmm14, 0x60($out)
 | 
			
		||||
	movdqa	%xmm15, 0x70($out)
 | 
			
		||||
	lea	0x80($out),$out
 | 
			
		||||
	movdqu	($inp), %xmm6		# load next round key
 | 
			
		||||
	dec	$rounds
 | 
			
		||||
	jnz	.Lkey_loop
 | 
			
		||||
 | 
			
		||||
	movdqa	0x70($const), %xmm7	# .L63
 | 
			
		||||
	movdqa	0x50($const), %xmm7	# .L63
 | 
			
		||||
	#movdqa	%xmm6, ($out)		# don't save last round key
 | 
			
		||||
	ret
 | 
			
		||||
.size	_bsaes_key_convert,.-_bsaes_key_convert
 | 
			
		||||
@@ -1990,6 +2089,8 @@ ___
 | 
			
		||||
#	const unsigned char iv[16]);
 | 
			
		||||
#
 | 
			
		||||
my ($twmask,$twres,$twtmp)=@XMM[13..15];
 | 
			
		||||
$arg6=~s/d$//;
 | 
			
		||||
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
.globl	bsaes_xts_encrypt
 | 
			
		||||
.type	bsaes_xts_encrypt,\@abi-omnipotent
 | 
			
		||||
@@ -2800,14 +2901,8 @@ _bsaes_const:
 | 
			
		||||
	.quad	0x0504070600030201, 0x0f0e0d0c0a09080b
 | 
			
		||||
.LSRM0:
 | 
			
		||||
	.quad	0x0304090e00050a0f, 0x01060b0c0207080d
 | 
			
		||||
.LM0:
 | 
			
		||||
	.quad	0x02060a0e03070b0f, 0x0004080c0105090d
 | 
			
		||||
.LM0SR:
 | 
			
		||||
	.quad	0x0a0e02060f03070b, 0x0004080c05090d01
 | 
			
		||||
.LNOT:		# magic constants
 | 
			
		||||
	.quad	0xffffffffffffffff, 0xffffffffffffffff
 | 
			
		||||
.L63:
 | 
			
		||||
	.quad	0x6363636363636363, 0x6363636363636363
 | 
			
		||||
.LSWPUP:	# byte-swap upper dword
 | 
			
		||||
	.quad	0x0706050403020100, 0x0c0d0e0f0b0a0908
 | 
			
		||||
.LSWPUPM0SR:
 | 
			
		||||
@@ -2830,6 +2925,15 @@ _bsaes_const:
 | 
			
		||||
	.quad	0x0000000000000000, 0x0000000800000000
 | 
			
		||||
.Lxts_magic:
 | 
			
		||||
	.long	0x87,0,1,0
 | 
			
		||||
.Lmasks:
 | 
			
		||||
	.quad	0x0101010101010101, 0x0101010101010101
 | 
			
		||||
	.quad	0x0202020202020202, 0x0202020202020202
 | 
			
		||||
	.quad	0x0404040404040404, 0x0404040404040404
 | 
			
		||||
	.quad	0x0808080808080808, 0x0808080808080808
 | 
			
		||||
.LM0:
 | 
			
		||||
	.quad	0x02060a0e03070b0f, 0x0004080c0105090d
 | 
			
		||||
.L63:
 | 
			
		||||
	.quad	0x6363636363636363, 0x6363636363636363
 | 
			
		||||
.asciz	"Bit-sliced AES for x86_64/SSSE3, Emilia Käsper, Peter Schwabe, Andy Polyakov"
 | 
			
		||||
.align	64
 | 
			
		||||
.size	_bsaes_const,.-_bsaes_const
 | 
			
		||||
 
 | 
			
		||||
@@ -843,6 +843,8 @@ $k_dsbo=0x2c0;		# decryption sbox final output
 | 
			
		||||
	&mov	($out,&wparam(1));		# out
 | 
			
		||||
	&mov	($round,&wparam(2));		# len
 | 
			
		||||
	&mov	($key,&wparam(3));		# key
 | 
			
		||||
	&sub	($round,16);
 | 
			
		||||
	&jc	(&label("cbc_abort"));
 | 
			
		||||
	&lea	($base,&DWP(-56,"esp"));
 | 
			
		||||
	&mov	($const,&wparam(4));		# ivp
 | 
			
		||||
	&and	($base,-16);
 | 
			
		||||
@@ -853,7 +855,6 @@ $k_dsbo=0x2c0;		# decryption sbox final output
 | 
			
		||||
	&mov	(&DWP(48,"esp"),$base);
 | 
			
		||||
 | 
			
		||||
	&mov	(&DWP(0,"esp"),$out);		# save out
 | 
			
		||||
	&sub	($round,16);
 | 
			
		||||
	&mov	(&DWP(4,"esp"),$key)		# save key
 | 
			
		||||
	&mov	(&DWP(8,"esp"),$const);		# save ivp
 | 
			
		||||
	&mov	($out,$round);			# $out works as $len
 | 
			
		||||
@@ -896,6 +897,7 @@ $k_dsbo=0x2c0;		# decryption sbox final output
 | 
			
		||||
	&mov	($base,&DWP(8,"esp"));		# restore ivp
 | 
			
		||||
	&mov	("esp",&DWP(48,"esp"));
 | 
			
		||||
	&movdqu	(&QWP(0,$base),"xmm1");		# write IV
 | 
			
		||||
&set_label("cbc_abort");
 | 
			
		||||
&function_end("${PREFIX}_cbc_encrypt");
 | 
			
		||||
 | 
			
		||||
&asm_finish();
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
$PREFIX="vpaes";
 | 
			
		||||
 | 
			
		||||
@@ -263,7 +264,7 @@ _vpaes_decrypt_core:
 | 
			
		||||
	pshufb  %xmm2,  %xmm4	# 4 = sbou
 | 
			
		||||
	pxor	%xmm0,  %xmm4	# 4 = sb1u + k
 | 
			
		||||
	movdqa	0x70(%r10), %xmm0	# 0 : sbot
 | 
			
		||||
	movdqa	.Lk_sr-.Lk_dsbd(%r11), %xmm2
 | 
			
		||||
	movdqa	-0x160(%r11), %xmm2	# .Lk_sr-.Lk_dsbd=-0x160
 | 
			
		||||
	pshufb  %xmm3,	%xmm0	# 0 = sb1t
 | 
			
		||||
	pxor	%xmm4,	%xmm0	# 0 = A
 | 
			
		||||
	pshufb	%xmm2,	%xmm0
 | 
			
		||||
@@ -869,6 +870,8 @@ ${PREFIX}_cbc_encrypt:
 | 
			
		||||
___
 | 
			
		||||
($len,$key)=($key,$len);
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	sub	\$16,$len
 | 
			
		||||
	jc	.Lcbc_abort
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___ if ($win64);
 | 
			
		||||
	lea	-0xb8(%rsp),%rsp
 | 
			
		||||
@@ -887,7 +890,6 @@ ___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	movdqu	($ivp),%xmm6		# load IV
 | 
			
		||||
	sub	$inp,$out
 | 
			
		||||
	sub	\$16,$len
 | 
			
		||||
	call	_vpaes_preheat
 | 
			
		||||
	cmp	\$0,${enc}d
 | 
			
		||||
	je	.Lcbc_dec_loop
 | 
			
		||||
@@ -932,6 +934,7 @@ $code.=<<___ if ($win64);
 | 
			
		||||
.Lcbc_epilogue:
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
.Lcbc_abort:
 | 
			
		||||
	ret
 | 
			
		||||
.size	${PREFIX}_cbc_encrypt,.-${PREFIX}_cbc_encrypt
 | 
			
		||||
___
 | 
			
		||||
@@ -1057,7 +1060,7 @@ _vpaes_consts:
 | 
			
		||||
.Lk_dsbo:	# decryption sbox final output
 | 
			
		||||
	.quad	0x1387EA537EF94000, 0xC7AA6DB9D4943E2D
 | 
			
		||||
	.quad	0x12D7560F93441D00, 0xCA4B8159D8C58E9C
 | 
			
		||||
.asciz	"Vector Permutaion AES for x86_64/SSSE3, Mike Hamburg (Stanford University)"
 | 
			
		||||
.asciz	"Vector Permutation AES for x86_64/SSSE3, Mike Hamburg (Stanford University)"
 | 
			
		||||
.align	64
 | 
			
		||||
.size	_vpaes_consts,.-_vpaes_consts
 | 
			
		||||
___
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ unsigned int _armv7_tick(void);
 | 
			
		||||
 | 
			
		||||
unsigned int OPENSSL_rdtsc(void)
 | 
			
		||||
	{
 | 
			
		||||
	if (OPENSSL_armcap_P|ARMV7_TICK)
 | 
			
		||||
	if (OPENSSL_armcap_P & ARMV7_TICK)
 | 
			
		||||
		return _armv7_tick();
 | 
			
		||||
	else
 | 
			
		||||
		return 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,7 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/buffer.h>
 | 
			
		||||
#include <openssl/asn1_mac.h>
 | 
			
		||||
@@ -143,17 +144,11 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
	BUF_MEM *b;
 | 
			
		||||
	unsigned char *p;
 | 
			
		||||
	int i;
 | 
			
		||||
	int ret=-1;
 | 
			
		||||
	ASN1_const_CTX c;
 | 
			
		||||
	int want=HEADER_SIZE;
 | 
			
		||||
	size_t want=HEADER_SIZE;
 | 
			
		||||
	int eos=0;
 | 
			
		||||
#if defined(__GNUC__) && defined(__ia64)
 | 
			
		||||
	/* pathetic compiler bug in all known versions as of Nov. 2002 */
 | 
			
		||||
	long off=0;
 | 
			
		||||
#else
 | 
			
		||||
	int off=0;
 | 
			
		||||
#endif
 | 
			
		||||
	int len=0;
 | 
			
		||||
	size_t off=0;
 | 
			
		||||
	size_t len=0;
 | 
			
		||||
 | 
			
		||||
	b=BUF_MEM_new();
 | 
			
		||||
	if (b == NULL)
 | 
			
		||||
@@ -169,7 +164,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
			{
 | 
			
		||||
			want-=(len-off);
 | 
			
		||||
 | 
			
		||||
			if (!BUF_MEM_grow_clean(b,len+want))
 | 
			
		||||
			if (len + want < len || !BUF_MEM_grow_clean(b,len+want))
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
				goto err;
 | 
			
		||||
@@ -181,7 +176,14 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			if (i > 0)
 | 
			
		||||
				{
 | 
			
		||||
				if (len+i < len)
 | 
			
		||||
					{
 | 
			
		||||
					ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
 | 
			
		||||
					goto err;
 | 
			
		||||
					}
 | 
			
		||||
				len+=i;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		/* else data already loaded */
 | 
			
		||||
 | 
			
		||||
@@ -206,6 +208,11 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
			{
 | 
			
		||||
			/* no data body so go round again */
 | 
			
		||||
			eos++;
 | 
			
		||||
			if (eos < 0)
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_HEADER_TOO_LONG);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			want=HEADER_SIZE;
 | 
			
		||||
			}
 | 
			
		||||
		else if (eos && (c.slen == 0) && (c.tag == V_ASN1_EOC))
 | 
			
		||||
@@ -220,10 +227,16 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
		else 
 | 
			
		||||
			{
 | 
			
		||||
			/* suck in c.slen bytes of data */
 | 
			
		||||
			want=(int)c.slen;
 | 
			
		||||
			want=c.slen;
 | 
			
		||||
			if (want > (len-off))
 | 
			
		||||
				{
 | 
			
		||||
				want-=(len-off);
 | 
			
		||||
				if (want > INT_MAX /* BIO_read takes an int length */ ||
 | 
			
		||||
					len+want < len)
 | 
			
		||||
						{
 | 
			
		||||
						ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
 | 
			
		||||
						goto err;
 | 
			
		||||
						}
 | 
			
		||||
				if (!BUF_MEM_grow_clean(b,len+want))
 | 
			
		||||
					{
 | 
			
		||||
					ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
@@ -238,11 +251,18 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
						    ASN1_R_NOT_ENOUGH_DATA);
 | 
			
		||||
						goto err;
 | 
			
		||||
						}
 | 
			
		||||
					/* This can't overflow because
 | 
			
		||||
					 * |len+want| didn't overflow. */
 | 
			
		||||
					len+=i;
 | 
			
		||||
					want -= i;
 | 
			
		||||
					want-=i;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			off+=(int)c.slen;
 | 
			
		||||
			if (off + c.slen < off)
 | 
			
		||||
				{
 | 
			
		||||
				ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			off+=c.slen;
 | 
			
		||||
			if (eos <= 0)
 | 
			
		||||
				{
 | 
			
		||||
				break;
 | 
			
		||||
@@ -252,9 +272,15 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (off > INT_MAX)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	*pb = b;
 | 
			
		||||
	return off;
 | 
			
		||||
err:
 | 
			
		||||
	if (b != NULL) BUF_MEM_free(b);
 | 
			
		||||
	return(ret);
 | 
			
		||||
	return -1;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -116,7 +116,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
 | 
			
		||||
	int pad=0,ret,i,neg;
 | 
			
		||||
	unsigned char *p,*n,pb=0;
 | 
			
		||||
 | 
			
		||||
	if ((a == NULL) || (a->data == NULL)) return(0);
 | 
			
		||||
	if (a == NULL) return(0);
 | 
			
		||||
	neg=a->type & V_ASN1_NEG;
 | 
			
		||||
	if (a->length == 0)
 | 
			
		||||
		ret=1;
 | 
			
		||||
@@ -386,8 +386,8 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a)
 | 
			
		||||
	
 | 
			
		||||
	if (a->length > (int)sizeof(long))
 | 
			
		||||
		{
 | 
			
		||||
		/* hmm... a bit ugly */
 | 
			
		||||
		return(0xffffffffL);
 | 
			
		||||
		/* hmm... a bit ugly, return all ones */
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
	if (a->data == NULL)
 | 
			
		||||
		return 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -567,6 +567,7 @@ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
 | 
			
		||||
	if(mbflag == -1) return -1;
 | 
			
		||||
	mbflag |= MBSTRING_FLAG;
 | 
			
		||||
	stmp.data = NULL;
 | 
			
		||||
	stmp.length = 0;
 | 
			
		||||
	ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING);
 | 
			
		||||
	if(ret < 0) return ret;
 | 
			
		||||
	*out = stmp.data;
 | 
			
		||||
 
 | 
			
		||||
@@ -74,7 +74,7 @@ static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
 | 
			
		||||
 * certain software (e.g. Netscape) has problems with them.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static unsigned long global_mask = 0xFFFFFFFFL;
 | 
			
		||||
static unsigned long global_mask = B_ASN1_UTF8STRING;
 | 
			
		||||
 | 
			
		||||
void ASN1_STRING_set_default_mask(unsigned long mask)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -140,6 +140,12 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
 | 
			
		||||
 | 
			
		||||
	int mdnid, pknid;
 | 
			
		||||
 | 
			
		||||
	if (!pkey)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_PASSED_NULL_PARAMETER);
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	EVP_MD_CTX_init(&ctx);
 | 
			
		||||
 | 
			
		||||
	/* Convert signature OID into digest and public key OIDs */
 | 
			
		||||
 
 | 
			
		||||
@@ -305,7 +305,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
 | 
			
		||||
{ERR_REASON(ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE),"unknown public key type"},
 | 
			
		||||
{ERR_REASON(ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM),"unknown signature algorithm"},
 | 
			
		||||
{ERR_REASON(ASN1_R_UNKNOWN_TAG)          ,"unknown tag"},
 | 
			
		||||
{ERR_REASON(ASN1_R_UNKOWN_FORMAT)        ,"unkown format"},
 | 
			
		||||
{ERR_REASON(ASN1_R_UNKOWN_FORMAT)        ,"unknown format"},
 | 
			
		||||
{ERR_REASON(ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE),"unsupported any defined by type"},
 | 
			
		||||
{ERR_REASON(ASN1_R_UNSUPPORTED_CIPHER)   ,"unsupported cipher"},
 | 
			
		||||
{ERR_REASON(ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM),"unsupported encryption algorithm"},
 | 
			
		||||
 
 | 
			
		||||
@@ -377,8 +377,12 @@ static int asn1_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
 | 
			
		||||
	BIO *tmpbio;
 | 
			
		||||
	const ASN1_AUX *aux = it->funcs;
 | 
			
		||||
	ASN1_STREAM_ARG sarg;
 | 
			
		||||
	int rv = 1;
 | 
			
		||||
 | 
			
		||||
	if (!(flags & SMIME_DETACHED))
 | 
			
		||||
	/* If data is not deteched or resigning then the output BIO is
 | 
			
		||||
	 * already set up to finalise when it is written through.
 | 
			
		||||
	 */
 | 
			
		||||
	if (!(flags & SMIME_DETACHED) || (flags & PKCS7_REUSE_DIGEST))
 | 
			
		||||
		{
 | 
			
		||||
		SMIME_crlf_copy(data, out, flags);
 | 
			
		||||
		return 1;
 | 
			
		||||
@@ -405,7 +409,7 @@ static int asn1_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
 | 
			
		||||
 | 
			
		||||
	/* Finalize structure */
 | 
			
		||||
	if (aux->asn1_cb(ASN1_OP_DETACHED_POST, &val, it, &sarg) <= 0)
 | 
			
		||||
		return 0;
 | 
			
		||||
		rv = 0;
 | 
			
		||||
 | 
			
		||||
	/* Now remove any digests prepended to the BIO */
 | 
			
		||||
 | 
			
		||||
@@ -416,7 +420,7 @@ static int asn1_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
 | 
			
		||||
		sarg.ndef_bio = tmpbio;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	return 1;
 | 
			
		||||
	return rv;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -486,9 +490,9 @@ ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it)
 | 
			
		||||
 | 
			
		||||
		if(strcmp(hdr->value, "application/x-pkcs7-signature") &&
 | 
			
		||||
			strcmp(hdr->value, "application/pkcs7-signature")) {
 | 
			
		||||
			sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
 | 
			
		||||
			ASN1err(ASN1_F_SMIME_READ_ASN1,ASN1_R_SIG_INVALID_MIME_TYPE);
 | 
			
		||||
			ERR_add_error_data(2, "type: ", hdr->value);
 | 
			
		||||
			sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
 | 
			
		||||
			sk_BIO_pop_free(parts, BIO_vfree);
 | 
			
		||||
			return NULL;
 | 
			
		||||
		}
 | 
			
		||||
@@ -801,7 +805,7 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
 | 
			
		||||
	if(name) {
 | 
			
		||||
		if(!(tmpname = BUF_strdup(name))) return NULL;
 | 
			
		||||
		for(p = tmpname ; *p; p++) {
 | 
			
		||||
			c = *p;
 | 
			
		||||
			c = (unsigned char)*p;
 | 
			
		||||
			if(isupper(c)) {
 | 
			
		||||
				c = tolower(c);
 | 
			
		||||
				*p = c;
 | 
			
		||||
@@ -811,7 +815,7 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
 | 
			
		||||
	if(value) {
 | 
			
		||||
		if(!(tmpval = BUF_strdup(value))) return NULL;
 | 
			
		||||
		for(p = tmpval ; *p; p++) {
 | 
			
		||||
			c = *p;
 | 
			
		||||
			c = (unsigned char)*p;
 | 
			
		||||
			if(isupper(c)) {
 | 
			
		||||
				c = tolower(c);
 | 
			
		||||
				*p = c;
 | 
			
		||||
@@ -835,7 +839,7 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
 | 
			
		||||
		tmpname = BUF_strdup(name);
 | 
			
		||||
		if(!tmpname) return 0;
 | 
			
		||||
		for(p = tmpname ; *p; p++) {
 | 
			
		||||
			c = *p;
 | 
			
		||||
			c = (unsigned char)*p;
 | 
			
		||||
			if(isupper(c)) {
 | 
			
		||||
				c = tolower(c);
 | 
			
		||||
				*p = c;
 | 
			
		||||
@@ -858,12 +862,17 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
 | 
			
		||||
static int mime_hdr_cmp(const MIME_HEADER * const *a,
 | 
			
		||||
			const MIME_HEADER * const *b)
 | 
			
		||||
{
 | 
			
		||||
	if (!(*a)->name || !(*b)->name)
 | 
			
		||||
		return !!(*a)->name - !!(*b)->name;
 | 
			
		||||
 | 
			
		||||
	return(strcmp((*a)->name, (*b)->name));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int mime_param_cmp(const MIME_PARAM * const *a,
 | 
			
		||||
			const MIME_PARAM * const *b)
 | 
			
		||||
{
 | 
			
		||||
	if (!(*a)->param_name || !(*b)->param_name)
 | 
			
		||||
		return !!(*a)->param_name - !!(*b)->param_name;
 | 
			
		||||
	return(strcmp((*a)->param_name, (*b)->param_name));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -138,10 +138,10 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
 | 
			
		||||
		if (BIO_write(bp,"        Serial Number:",22) <= 0) goto err;
 | 
			
		||||
 | 
			
		||||
		bs=X509_get_serialNumber(x);
 | 
			
		||||
		if (bs->length <= 4)
 | 
			
		||||
		if (bs->length <= (int)sizeof(long))
 | 
			
		||||
			{
 | 
			
		||||
			l=ASN1_INTEGER_get(bs);
 | 
			
		||||
			if (l < 0)
 | 
			
		||||
			if (bs->type == V_ASN1_NEG_INTEGER)
 | 
			
		||||
				{
 | 
			
		||||
				l= -l;
 | 
			
		||||
				neg="-";
 | 
			
		||||
 
 | 
			
		||||
@@ -446,11 +446,11 @@ static int asn1_print_fsname(BIO *out, int indent,
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int asn1_print_boolean_ctx(BIO *out, const int bool,
 | 
			
		||||
static int asn1_print_boolean_ctx(BIO *out, int boolval,
 | 
			
		||||
							const ASN1_PCTX *pctx)
 | 
			
		||||
	{
 | 
			
		||||
	const char *str;
 | 
			
		||||
	switch (bool)
 | 
			
		||||
	switch (boolval)
 | 
			
		||||
		{
 | 
			
		||||
		case -1:
 | 
			
		||||
		str = "BOOL ABSENT";
 | 
			
		||||
@@ -574,10 +574,10 @@ static int asn1_primitive_print(BIO *out, ASN1_VALUE **fld,
 | 
			
		||||
		{
 | 
			
		||||
		case V_ASN1_BOOLEAN:
 | 
			
		||||
			{
 | 
			
		||||
			int bool = *(int *)fld;
 | 
			
		||||
			if (bool == -1)
 | 
			
		||||
				bool = it->size;
 | 
			
		||||
			ret = asn1_print_boolean_ctx(out, bool, pctx);
 | 
			
		||||
			int boolval = *(int *)fld;
 | 
			
		||||
			if (boolval == -1)
 | 
			
		||||
				boolval = it->size;
 | 
			
		||||
			ret = asn1_print_boolean_ctx(out, boolval, pctx);
 | 
			
		||||
			}
 | 
			
		||||
		break;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -399,8 +399,7 @@ static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in)
 | 
			
		||||
	/* If type not in bitmask just copy string across */
 | 
			
		||||
	if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON))
 | 
			
		||||
		{
 | 
			
		||||
		out->type = in->type;
 | 
			
		||||
		if (!ASN1_STRING_set(out, in->data, in->length))
 | 
			
		||||
		if (!ASN1_STRING_copy(out, in))
 | 
			
		||||
			return 0;
 | 
			
		||||
		return 1;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -171,7 +171,19 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
 | 
			
		||||
		goto error;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	key->pkey = ret;
 | 
			
		||||
	/* Check to see if another thread set key->pkey first */
 | 
			
		||||
	CRYPTO_w_lock(CRYPTO_LOCK_EVP_PKEY);
 | 
			
		||||
	if (key->pkey)
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_EVP_PKEY);
 | 
			
		||||
		EVP_PKEY_free(ret);
 | 
			
		||||
		ret = key->pkey;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		key->pkey = ret;
 | 
			
		||||
		CRYPTO_w_unlock(CRYPTO_LOCK_EVP_PKEY);
 | 
			
		||||
		}
 | 
			
		||||
	CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY);
 | 
			
		||||
 | 
			
		||||
	return ret;
 | 
			
		||||
 
 | 
			
		||||
@@ -960,7 +960,6 @@ int BIO_set_tcp_ndelay(int s, int on)
 | 
			
		||||
#endif
 | 
			
		||||
	return(ret == 0);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int BIO_socket_nbio(int s, int mode)
 | 
			
		||||
	{
 | 
			
		||||
@@ -973,3 +972,4 @@ int BIO_socket_nbio(int s, int mode)
 | 
			
		||||
#endif
 | 
			
		||||
	return(ret == 0);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,11 @@
 | 
			
		||||
#include <openssl/crypto.h>
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_SCTP
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
# ifndef OPENSSL_SYS_VMS
 | 
			
		||||
# include <stdint.h>
 | 
			
		||||
# else
 | 
			
		||||
# include <inttypes.h>
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef  __cplusplus
 | 
			
		||||
@@ -153,6 +157,7 @@ extern "C" {
 | 
			
		||||
/* #endif */
 | 
			
		||||
 | 
			
		||||
#define BIO_CTRL_DGRAM_QUERY_MTU          40 /* as kernel for current MTU */
 | 
			
		||||
#define BIO_CTRL_DGRAM_GET_FALLBACK_MTU   47
 | 
			
		||||
#define BIO_CTRL_DGRAM_GET_MTU            41 /* get cached value for MTU */
 | 
			
		||||
#define BIO_CTRL_DGRAM_SET_MTU            42 /* set cached value for
 | 
			
		||||
					      * MTU. want to use this
 | 
			
		||||
 
 | 
			
		||||
@@ -521,40 +521,40 @@ void BIO_free_all(BIO *bio)
 | 
			
		||||
 | 
			
		||||
BIO *BIO_dup_chain(BIO *in)
 | 
			
		||||
	{
 | 
			
		||||
	BIO *ret=NULL,*eoc=NULL,*bio,*new;
 | 
			
		||||
	BIO *ret=NULL,*eoc=NULL,*bio,*new_bio;
 | 
			
		||||
 | 
			
		||||
	for (bio=in; bio != NULL; bio=bio->next_bio)
 | 
			
		||||
		{
 | 
			
		||||
		if ((new=BIO_new(bio->method)) == NULL) goto err;
 | 
			
		||||
		new->callback=bio->callback;
 | 
			
		||||
		new->cb_arg=bio->cb_arg;
 | 
			
		||||
		new->init=bio->init;
 | 
			
		||||
		new->shutdown=bio->shutdown;
 | 
			
		||||
		new->flags=bio->flags;
 | 
			
		||||
		if ((new_bio=BIO_new(bio->method)) == NULL) goto err;
 | 
			
		||||
		new_bio->callback=bio->callback;
 | 
			
		||||
		new_bio->cb_arg=bio->cb_arg;
 | 
			
		||||
		new_bio->init=bio->init;
 | 
			
		||||
		new_bio->shutdown=bio->shutdown;
 | 
			
		||||
		new_bio->flags=bio->flags;
 | 
			
		||||
 | 
			
		||||
		/* This will let SSL_s_sock() work with stdin/stdout */
 | 
			
		||||
		new->num=bio->num;
 | 
			
		||||
		new_bio->num=bio->num;
 | 
			
		||||
 | 
			
		||||
		if (!BIO_dup_state(bio,(char *)new))
 | 
			
		||||
		if (!BIO_dup_state(bio,(char *)new_bio))
 | 
			
		||||
			{
 | 
			
		||||
			BIO_free(new);
 | 
			
		||||
			BIO_free(new_bio);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		/* copy app data */
 | 
			
		||||
		if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new->ex_data,
 | 
			
		||||
		if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new_bio->ex_data,
 | 
			
		||||
					&bio->ex_data))
 | 
			
		||||
			goto err;
 | 
			
		||||
 | 
			
		||||
		if (ret == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			eoc=new;
 | 
			
		||||
			eoc=new_bio;
 | 
			
		||||
			ret=eoc;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			BIO_push(eoc,new);
 | 
			
		||||
			eoc=new;
 | 
			
		||||
			BIO_push(eoc,new_bio);
 | 
			
		||||
			eoc=new_bio;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	return(ret);
 | 
			
		||||
 
 | 
			
		||||
@@ -77,10 +77,20 @@
 | 
			
		||||
#define OPENSSL_SCTP_FORWARD_CUM_TSN_CHUNK_TYPE 0xc0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
#if defined(OPENSSL_SYS_LINUX) && !defined(IP_MTU)
 | 
			
		||||
#define IP_MTU      14 /* linux is lame */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(__FreeBSD__) && defined(IN6_IS_ADDR_V4MAPPED)
 | 
			
		||||
/* Standard definition causes type-punning problems. */
 | 
			
		||||
#undef IN6_IS_ADDR_V4MAPPED
 | 
			
		||||
#define s6_addr32 __u6_addr.__u6_addr32
 | 
			
		||||
#define IN6_IS_ADDR_V4MAPPED(a)               \
 | 
			
		||||
        (((a)->s6_addr32[0] == 0) &&          \
 | 
			
		||||
         ((a)->s6_addr32[1] == 0) &&          \
 | 
			
		||||
         ((a)->s6_addr32[2] == htonl(0x0000ffff)))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#define sock_write SockWrite  /* Watt-32 uses same names */
 | 
			
		||||
#define sock_read  SockRead
 | 
			
		||||
@@ -255,7 +265,7 @@ static void dgram_adjust_rcv_timeout(BIO *b)
 | 
			
		||||
	{
 | 
			
		||||
#if defined(SO_RCVTIMEO)
 | 
			
		||||
	bio_dgram_data *data = (bio_dgram_data *)b->ptr;
 | 
			
		||||
	int sz = sizeof(int);
 | 
			
		||||
	union { size_t s; int i; } sz = {0};
 | 
			
		||||
 | 
			
		||||
	/* Is a timer active? */
 | 
			
		||||
	if (data->next_timeout.tv_sec > 0 || data->next_timeout.tv_usec > 0)
 | 
			
		||||
@@ -265,8 +275,10 @@ static void dgram_adjust_rcv_timeout(BIO *b)
 | 
			
		||||
		/* Read current socket timeout */
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
		int timeout;
 | 
			
		||||
 | 
			
		||||
		sz.i = sizeof(timeout);
 | 
			
		||||
		if (getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
 | 
			
		||||
					   (void*)&timeout, &sz) < 0)
 | 
			
		||||
					   (void*)&timeout, &sz.i) < 0)
 | 
			
		||||
			{ perror("getsockopt"); }
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
@@ -274,9 +286,12 @@ static void dgram_adjust_rcv_timeout(BIO *b)
 | 
			
		||||
			data->socket_timeout.tv_usec = (timeout % 1000) * 1000;
 | 
			
		||||
			}
 | 
			
		||||
#else
 | 
			
		||||
		sz.i = sizeof(data->socket_timeout);
 | 
			
		||||
		if ( getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, 
 | 
			
		||||
						&(data->socket_timeout), (void *)&sz) < 0)
 | 
			
		||||
			{ perror("getsockopt"); }
 | 
			
		||||
		else if (sizeof(sz.s)!=sizeof(sz.i) && sz.i==0)
 | 
			
		||||
			OPENSSL_assert(sz.s<=sizeof(data->socket_timeout));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		/* Get current time */
 | 
			
		||||
@@ -445,11 +460,10 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
	int *ip;
 | 
			
		||||
	struct sockaddr *to = NULL;
 | 
			
		||||
	bio_dgram_data *data = NULL;
 | 
			
		||||
#if defined(IP_MTU_DISCOVER) || defined(IP_MTU)
 | 
			
		||||
	long sockopt_val = 0;
 | 
			
		||||
	unsigned int sockopt_len = 0;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
#if defined(OPENSSL_SYS_LINUX) && (defined(IP_MTU_DISCOVER) || defined(IP_MTU))
 | 
			
		||||
	int sockopt_val = 0;
 | 
			
		||||
	socklen_t sockopt_len;	/* assume that system supporting IP_MTU is
 | 
			
		||||
				 * modern enough to define socklen_t */
 | 
			
		||||
	socklen_t addr_len;
 | 
			
		||||
	union	{
 | 
			
		||||
		struct sockaddr	sa;
 | 
			
		||||
@@ -531,7 +545,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		break;
 | 
			
		||||
		/* (Linux)kernel sets DF bit on outgoing IP packets */
 | 
			
		||||
	case BIO_CTRL_DGRAM_MTU_DISCOVER:
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
#if defined(OPENSSL_SYS_LINUX) && defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DO)
 | 
			
		||||
		addr_len = (socklen_t)sizeof(addr);
 | 
			
		||||
		memset((void *)&addr, 0, sizeof(addr));
 | 
			
		||||
		if (getsockname(b->num, &addr.sa, &addr_len) < 0)
 | 
			
		||||
@@ -539,7 +553,6 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
			ret = 0;
 | 
			
		||||
			break;
 | 
			
		||||
			}
 | 
			
		||||
		sockopt_len = sizeof(sockopt_val);
 | 
			
		||||
		switch (addr.sa.sa_family)
 | 
			
		||||
			{
 | 
			
		||||
		case AF_INET:
 | 
			
		||||
@@ -548,7 +561,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
				&sockopt_val, sizeof(sockopt_val))) < 0)
 | 
			
		||||
				perror("setsockopt");
 | 
			
		||||
			break;
 | 
			
		||||
#if OPENSSL_USE_IPV6 && defined(IPV6_MTU_DISCOVER)
 | 
			
		||||
#if OPENSSL_USE_IPV6 && defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DO)
 | 
			
		||||
		case AF_INET6:
 | 
			
		||||
			sockopt_val = IPV6_PMTUDISC_DO;
 | 
			
		||||
			if ((ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_MTU_DISCOVER,
 | 
			
		||||
@@ -565,7 +578,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		break;
 | 
			
		||||
#endif
 | 
			
		||||
	case BIO_CTRL_DGRAM_QUERY_MTU:
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
#if defined(OPENSSL_SYS_LINUX) && defined(IP_MTU)
 | 
			
		||||
		addr_len = (socklen_t)sizeof(addr);
 | 
			
		||||
		memset((void *)&addr, 0, sizeof(addr));
 | 
			
		||||
		if (getsockname(b->num, &addr.sa, &addr_len) < 0)
 | 
			
		||||
@@ -616,6 +629,27 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		ret = 0;
 | 
			
		||||
#endif
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DGRAM_GET_FALLBACK_MTU:
 | 
			
		||||
		switch (data->peer.sa.sa_family)
 | 
			
		||||
			{
 | 
			
		||||
			case AF_INET:
 | 
			
		||||
				ret = 576 - 20 - 8;
 | 
			
		||||
				break;
 | 
			
		||||
#if OPENSSL_USE_IPV6
 | 
			
		||||
			case AF_INET6:
 | 
			
		||||
#ifdef IN6_IS_ADDR_V4MAPPED
 | 
			
		||||
				if (IN6_IS_ADDR_V4MAPPED(&data->peer.sa_in6.sin6_addr))
 | 
			
		||||
					ret = 576 - 20 - 8;
 | 
			
		||||
				else
 | 
			
		||||
#endif
 | 
			
		||||
					ret = 1280 - 40 - 8;
 | 
			
		||||
				break;
 | 
			
		||||
#endif
 | 
			
		||||
			default:
 | 
			
		||||
				ret = 576 - 20 - 8;
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DGRAM_GET_MTU:
 | 
			
		||||
		return data->mtu;
 | 
			
		||||
		break;
 | 
			
		||||
@@ -706,12 +740,15 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
#endif
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DGRAM_GET_RECV_TIMEOUT:
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
		{
 | 
			
		||||
		int timeout, sz = sizeof(timeout);
 | 
			
		||||
		union { size_t s; int i; } sz = {0};
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
		int timeout;
 | 
			
		||||
		struct timeval *tv = (struct timeval *)ptr;
 | 
			
		||||
 | 
			
		||||
		sz.i = sizeof(timeout);
 | 
			
		||||
		if (getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
 | 
			
		||||
			(void*)&timeout, &sz) < 0)
 | 
			
		||||
			(void*)&timeout, &sz.i) < 0)
 | 
			
		||||
			{ perror("getsockopt"); ret = -1; }
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
@@ -719,12 +756,20 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
			tv->tv_usec = (timeout % 1000) * 1000;
 | 
			
		||||
			ret = sizeof(*tv);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#else
 | 
			
		||||
		sz.i = sizeof(struct timeval);
 | 
			
		||||
		if ( getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, 
 | 
			
		||||
			ptr, (void *)&ret) < 0)
 | 
			
		||||
			ptr, (void *)&sz) < 0)
 | 
			
		||||
			{ perror("getsockopt"); ret = -1; }
 | 
			
		||||
		else if (sizeof(sz.s)!=sizeof(sz.i) && sz.i==0)
 | 
			
		||||
			{
 | 
			
		||||
			OPENSSL_assert(sz.s<=sizeof(struct timeval));
 | 
			
		||||
			ret = (int)sz.s;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			ret = sz.i;
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(SO_SNDTIMEO)
 | 
			
		||||
@@ -744,12 +789,15 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
#endif
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DGRAM_GET_SEND_TIMEOUT:
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
		{
 | 
			
		||||
		int timeout, sz = sizeof(timeout);
 | 
			
		||||
		union { size_t s; int i; } sz = {0};
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
		int timeout;
 | 
			
		||||
		struct timeval *tv = (struct timeval *)ptr;
 | 
			
		||||
 | 
			
		||||
		sz.i = sizeof(timeout);
 | 
			
		||||
		if (getsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO,
 | 
			
		||||
			(void*)&timeout, &sz) < 0)
 | 
			
		||||
			(void*)&timeout, &sz.i) < 0)
 | 
			
		||||
			{ perror("getsockopt"); ret = -1; }
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
@@ -757,12 +805,20 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
			tv->tv_usec = (timeout % 1000) * 1000;
 | 
			
		||||
			ret = sizeof(*tv);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#else
 | 
			
		||||
		sz.i = sizeof(struct timeval);
 | 
			
		||||
		if ( getsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO, 
 | 
			
		||||
			ptr, (void *)&ret) < 0)
 | 
			
		||||
			ptr, (void *)&sz) < 0)
 | 
			
		||||
			{ perror("getsockopt"); ret = -1; }
 | 
			
		||||
		else if (sizeof(sz.s)!=sizeof(sz.i) && sz.i==0)
 | 
			
		||||
			{
 | 
			
		||||
			OPENSSL_assert(sz.s<=sizeof(struct timeval));
 | 
			
		||||
			ret = (int)sz.s;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			ret = sz.i;
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
#endif
 | 
			
		||||
	case BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP:
 | 
			
		||||
@@ -850,8 +906,8 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag)
 | 
			
		||||
	memset(authchunks, 0, sizeof(sockopt_len));
 | 
			
		||||
	ret = getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks, &sockopt_len);
 | 
			
		||||
	OPENSSL_assert(ret >= 0);
 | 
			
		||||
	
 | 
			
		||||
	for (p = (unsigned char*) authchunks + sizeof(sctp_assoc_t);
 | 
			
		||||
 | 
			
		||||
	for (p = (unsigned char*) authchunks->gauth_chunks;
 | 
			
		||||
	     p < (unsigned char*) authchunks + sockopt_len;
 | 
			
		||||
	     p += sizeof(uint8_t))
 | 
			
		||||
		{
 | 
			
		||||
@@ -934,7 +990,6 @@ static int dgram_sctp_free(BIO *a)
 | 
			
		||||
#ifdef SCTP_AUTHENTICATION_EVENT
 | 
			
		||||
void dgram_sctp_handle_auth_free_key_event(BIO *b, union sctp_notification *snp)
 | 
			
		||||
	{
 | 
			
		||||
	unsigned int sockopt_len = 0;
 | 
			
		||||
	int ret;
 | 
			
		||||
	struct sctp_authkey_event* authkeyevent = &snp->sn_auth_event;
 | 
			
		||||
 | 
			
		||||
@@ -944,9 +999,8 @@ void dgram_sctp_handle_auth_free_key_event(BIO *b, union sctp_notification *snp)
 | 
			
		||||
 | 
			
		||||
		/* delete key */
 | 
			
		||||
		authkeyid.scact_keynumber = authkeyevent->auth_keynumber;
 | 
			
		||||
		sockopt_len = sizeof(struct sctp_authkeyid);
 | 
			
		||||
		ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_DELETE_KEY,
 | 
			
		||||
		      &authkeyid, sockopt_len);
 | 
			
		||||
		      &authkeyid, sizeof(struct sctp_authkeyid));
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1143,7 +1197,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl)
 | 
			
		||||
			ii = getsockopt(b->num, IPPROTO_SCTP, SCTP_PEER_AUTH_CHUNKS, authchunks, &optlen);
 | 
			
		||||
			OPENSSL_assert(ii >= 0);
 | 
			
		||||
 | 
			
		||||
			for (p = (unsigned char*) authchunks + sizeof(sctp_assoc_t);
 | 
			
		||||
			for (p = (unsigned char*) authchunks->gauth_chunks;
 | 
			
		||||
				 p < (unsigned char*) authchunks + optlen;
 | 
			
		||||
				 p += sizeof(uint8_t))
 | 
			
		||||
				{
 | 
			
		||||
@@ -1277,9 +1331,9 @@ static long dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
	{
 | 
			
		||||
	long ret=1;
 | 
			
		||||
	bio_dgram_sctp_data *data = NULL;
 | 
			
		||||
	unsigned int sockopt_len = 0;
 | 
			
		||||
	socklen_t sockopt_len = 0;
 | 
			
		||||
	struct sctp_authkeyid authkeyid;
 | 
			
		||||
	struct sctp_authkey *authkey;
 | 
			
		||||
	struct sctp_authkey *authkey = NULL;
 | 
			
		||||
 | 
			
		||||
	data = (bio_dgram_sctp_data *)b->ptr;
 | 
			
		||||
 | 
			
		||||
@@ -1334,6 +1388,11 @@ static long dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		/* Add new key */
 | 
			
		||||
		sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t);
 | 
			
		||||
		authkey = OPENSSL_malloc(sockopt_len);
 | 
			
		||||
		if (authkey == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			ret = -1;
 | 
			
		||||
			break;
 | 
			
		||||
			}
 | 
			
		||||
		memset(authkey, 0x00, sockopt_len);
 | 
			
		||||
		authkey->sca_keynumber = authkeyid.scact_keynumber + 1;
 | 
			
		||||
#ifndef __FreeBSD__
 | 
			
		||||
@@ -1345,6 +1404,8 @@ static long dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
		memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t));
 | 
			
		||||
 | 
			
		||||
		ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len);
 | 
			
		||||
		OPENSSL_free(authkey);
 | 
			
		||||
		authkey = NULL;
 | 
			
		||||
		if (ret < 0) break;
 | 
			
		||||
 | 
			
		||||
		/* Reset active key */
 | 
			
		||||
 
 | 
			
		||||
@@ -245,7 +245,7 @@ static int MS_CALLBACK slg_puts(BIO *bp, const char *str)
 | 
			
		||||
 | 
			
		||||
static void xopenlog(BIO* bp, char* name, int level)
 | 
			
		||||
{
 | 
			
		||||
	if (GetVersion() < 0x80000000)
 | 
			
		||||
	if (check_winnt())
 | 
			
		||||
		bp->ptr = RegisterEventSourceA(NULL,name);
 | 
			
		||||
	else
 | 
			
		||||
		bp->ptr = NULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -125,7 +125,9 @@ ppc-mont.s:	asm/ppc-mont.pl;$(PERL) asm/ppc-mont.pl $(PERLASM_SCHEME) $@
 | 
			
		||||
ppc64-mont.s:	asm/ppc64-mont.pl;$(PERL) asm/ppc64-mont.pl $(PERLASM_SCHEME) $@
 | 
			
		||||
 | 
			
		||||
alpha-mont.s:	asm/alpha-mont.pl
 | 
			
		||||
	$(PERL) $< | $(CC) -E - | tee $@ > /dev/null
 | 
			
		||||
	(preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
 | 
			
		||||
	$(PERL) asm/alpha-mont.pl > $$preproc && \
 | 
			
		||||
	$(CC) -E $$preproc > $@ && rm $$preproc)
 | 
			
		||||
 | 
			
		||||
# GNU make "catch all"
 | 
			
		||||
%-mont.s:	asm/%-mont.pl;	$(PERL) $< $(PERLASM_SCHEME) $@
 | 
			
		||||
 
 | 
			
		||||
@@ -133,7 +133,7 @@ $code.=<<___;
 | 
			
		||||
	bnez	$at,1f
 | 
			
		||||
	li	$t0,0
 | 
			
		||||
	slt	$at,$num,17	# on in-order CPU
 | 
			
		||||
	bnezl	$at,bn_mul_mont_internal
 | 
			
		||||
	bnez	$at,bn_mul_mont_internal
 | 
			
		||||
	nop
 | 
			
		||||
1:	jr	$ra
 | 
			
		||||
	li	$a0,0
 | 
			
		||||
 
 | 
			
		||||
@@ -140,10 +140,10 @@ $code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
	li	$minus4,-4
 | 
			
		||||
	and	$ta0,$a2,$minus4
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	beqz	$ta0,.L_bn_mul_add_words_tail
 | 
			
		||||
 | 
			
		||||
.L_bn_mul_add_words_loop:
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	$MULTU	$t0,$a3
 | 
			
		||||
	$LD	$t1,0($a0)
 | 
			
		||||
	$LD	$t2,$BNSZ($a1)
 | 
			
		||||
@@ -200,10 +200,9 @@ $code.=<<___;
 | 
			
		||||
	$ADDU	$v0,$ta2
 | 
			
		||||
	sltu	$at,$ta3,$at
 | 
			
		||||
	$ST	$ta3,-$BNSZ($a0)
 | 
			
		||||
	$ADDU	$v0,$at
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	bgtzl	$ta0,.L_bn_mul_add_words_loop
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	bgtz	$ta0,.L_bn_mul_add_words_loop
 | 
			
		||||
	$ADDU	$v0,$at
 | 
			
		||||
 | 
			
		||||
	beqz	$a2,.L_bn_mul_add_words_return
 | 
			
		||||
	nop
 | 
			
		||||
@@ -300,10 +299,10 @@ $code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
	li	$minus4,-4
 | 
			
		||||
	and	$ta0,$a2,$minus4
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	beqz	$ta0,.L_bn_mul_words_tail
 | 
			
		||||
 | 
			
		||||
.L_bn_mul_words_loop:
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	$MULTU	$t0,$a3
 | 
			
		||||
	$LD	$t2,$BNSZ($a1)
 | 
			
		||||
	$LD	$ta0,2*$BNSZ($a1)
 | 
			
		||||
@@ -341,10 +340,9 @@ $code.=<<___;
 | 
			
		||||
	$ADDU	$v0,$at
 | 
			
		||||
	sltu	$ta3,$v0,$at
 | 
			
		||||
	$ST	$v0,-$BNSZ($a0)
 | 
			
		||||
	$ADDU	$v0,$ta3,$ta2
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	bgtzl	$ta0,.L_bn_mul_words_loop
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	bgtz	$ta0,.L_bn_mul_words_loop
 | 
			
		||||
	$ADDU	$v0,$ta3,$ta2
 | 
			
		||||
 | 
			
		||||
	beqz	$a2,.L_bn_mul_words_return
 | 
			
		||||
	nop
 | 
			
		||||
@@ -429,10 +427,10 @@ $code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
	li	$minus4,-4
 | 
			
		||||
	and	$ta0,$a2,$minus4
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	beqz	$ta0,.L_bn_sqr_words_tail
 | 
			
		||||
 | 
			
		||||
.L_bn_sqr_words_loop:
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	$MULTU	$t0,$t0
 | 
			
		||||
	$LD	$t2,$BNSZ($a1)
 | 
			
		||||
	$LD	$ta0,2*$BNSZ($a1)
 | 
			
		||||
@@ -463,11 +461,10 @@ $code.=<<___;
 | 
			
		||||
	mflo	$ta3
 | 
			
		||||
	mfhi	$ta2
 | 
			
		||||
	$ST	$ta3,-2*$BNSZ($a0)
 | 
			
		||||
	$ST	$ta2,-$BNSZ($a0)
 | 
			
		||||
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	bgtzl	$ta0,.L_bn_sqr_words_loop
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	bgtz	$ta0,.L_bn_sqr_words_loop
 | 
			
		||||
	$ST	$ta2,-$BNSZ($a0)
 | 
			
		||||
 | 
			
		||||
	beqz	$a2,.L_bn_sqr_words_return
 | 
			
		||||
	nop
 | 
			
		||||
@@ -547,10 +544,10 @@ $code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
	li	$minus4,-4
 | 
			
		||||
	and	$at,$a3,$minus4
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	beqz	$at,.L_bn_add_words_tail
 | 
			
		||||
 | 
			
		||||
.L_bn_add_words_loop:
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	$LD	$ta0,0($a2)
 | 
			
		||||
	subu	$a3,4
 | 
			
		||||
	$LD	$t1,$BNSZ($a1)
 | 
			
		||||
@@ -589,11 +586,10 @@ $code.=<<___;
 | 
			
		||||
	$ADDU	$t3,$ta3,$v0
 | 
			
		||||
	sltu	$v0,$t3,$ta3
 | 
			
		||||
	$ST	$t3,-$BNSZ($a0)
 | 
			
		||||
	$ADDU	$v0,$t9
 | 
			
		||||
	
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	bgtzl	$at,.L_bn_add_words_loop
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	bgtz	$at,.L_bn_add_words_loop
 | 
			
		||||
	$ADDU	$v0,$t9
 | 
			
		||||
 | 
			
		||||
	beqz	$a3,.L_bn_add_words_return
 | 
			
		||||
	nop
 | 
			
		||||
@@ -679,10 +675,10 @@ $code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
	li	$minus4,-4
 | 
			
		||||
	and	$at,$a3,$minus4
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	beqz	$at,.L_bn_sub_words_tail
 | 
			
		||||
 | 
			
		||||
.L_bn_sub_words_loop:
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	$LD	$ta0,0($a2)
 | 
			
		||||
	subu	$a3,4
 | 
			
		||||
	$LD	$t1,$BNSZ($a1)
 | 
			
		||||
@@ -722,11 +718,10 @@ $code.=<<___;
 | 
			
		||||
	$SUBU	$t3,$ta3,$v0
 | 
			
		||||
	sgtu	$v0,$t3,$ta3
 | 
			
		||||
	$ST	$t3,-$BNSZ($a0)
 | 
			
		||||
	$ADDU	$v0,$t9
 | 
			
		||||
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	bgtzl	$at,.L_bn_sub_words_loop
 | 
			
		||||
	$LD	$t0,0($a1)
 | 
			
		||||
	bgtz	$at,.L_bn_sub_words_loop
 | 
			
		||||
	$ADDU	$v0,$t9
 | 
			
		||||
 | 
			
		||||
	beqz	$a3,.L_bn_sub_words_return
 | 
			
		||||
	nop
 | 
			
		||||
@@ -819,7 +814,7 @@ ___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
	.set	reorder
 | 
			
		||||
	move	$ta3,$ra
 | 
			
		||||
	bal	bn_div_words
 | 
			
		||||
	bal	bn_div_words_internal
 | 
			
		||||
	move	$ra,$ta3
 | 
			
		||||
	$MULTU	$ta2,$v0
 | 
			
		||||
	$LD	$t2,-2*$BNSZ($a3)
 | 
			
		||||
@@ -840,8 +835,9 @@ $code.=<<___;
 | 
			
		||||
	sltu	$ta0,$a1,$a2
 | 
			
		||||
	or	$t8,$ta0
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	beqzl	$at,.L_bn_div_3_words_inner_loop
 | 
			
		||||
	beqz	$at,.L_bn_div_3_words_inner_loop
 | 
			
		||||
	$SUBU	$v0,1
 | 
			
		||||
	$ADDU	$v0,1
 | 
			
		||||
	.set	reorder
 | 
			
		||||
.L_bn_div_3_words_inner_loop_done:
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
@@ -902,7 +898,8 @@ $code.=<<___;
 | 
			
		||||
	and	$t2,$a0
 | 
			
		||||
	$SRL	$at,$a1,$t1
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	bnezl	$t2,.+8
 | 
			
		||||
	beqz	$t2,.+12
 | 
			
		||||
	nop
 | 
			
		||||
	break	6		# signal overflow
 | 
			
		||||
	.set	reorder
 | 
			
		||||
	$SLL	$a0,$t9
 | 
			
		||||
@@ -917,7 +914,8 @@ $code.=<<___;
 | 
			
		||||
	$SRL	$DH,$a2,4*$BNSZ	# bits
 | 
			
		||||
	sgeu	$at,$a0,$a2
 | 
			
		||||
	.set	noreorder
 | 
			
		||||
	bnezl	$at,.+8
 | 
			
		||||
	beqz	$at,.+12
 | 
			
		||||
	nop
 | 
			
		||||
	$SUBU	$a0,$a2
 | 
			
		||||
	.set	reorder
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
use strict;
 | 
			
		||||
my $code=".text\n\n";
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@
 | 
			
		||||
# of arithmetic operations, most notably multiplications. It requires
 | 
			
		||||
# more memory references, most notably to tp[num], but this doesn't
 | 
			
		||||
# seem to exhaust memory port capacity. And indeed, dedicated PA-RISC
 | 
			
		||||
# 2.0 code path, provides virtually same performance as pa-risc2[W].s:
 | 
			
		||||
# 2.0 code path provides virtually same performance as pa-risc2[W].s:
 | 
			
		||||
# it's ~10% better for shortest key length and ~10% worse for longest
 | 
			
		||||
# one.
 | 
			
		||||
#
 | 
			
		||||
@@ -988,6 +988,8 @@ foreach (split("\n",$code)) {
 | 
			
		||||
	# assemble 2.0 instructions in 32-bit mode...
 | 
			
		||||
	s/^\s+([a-z]+)([\S]*)\s+([\S]*)/&assemble($1,$2,$3)/e if ($BN_SZ==4);
 | 
			
		||||
 | 
			
		||||
	s/\bbv\b/bve/gm	if ($SIZE_T==8);
 | 
			
		||||
 | 
			
		||||
	print $_,"\n";
 | 
			
		||||
}
 | 
			
		||||
close STDOUT;
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
($lo,$hi)=("%rax","%rdx");	$a=$lo;
 | 
			
		||||
($i0,$i1)=("%rsi","%rdi");
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
# int bn_mul_mont(
 | 
			
		||||
$rp="%rdi";	# BN_ULONG *rp,
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
# int bn_mul_mont_gather5(
 | 
			
		||||
$rp="%rdi";	# BN_ULONG *rp,
 | 
			
		||||
@@ -900,8 +901,8 @@ $code.=<<___;
 | 
			
		||||
	jnz	.Lgather
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___ if ($win64);
 | 
			
		||||
	movaps	%xmm6,(%rsp)
 | 
			
		||||
	movaps	%xmm7,0x10(%rsp)
 | 
			
		||||
	movaps	(%rsp),%xmm6
 | 
			
		||||
	movaps	0x10(%rsp),%xmm7
 | 
			
		||||
	lea	0x28(%rsp),%rsp
 | 
			
		||||
___
 | 
			
		||||
$code.=<<___;
 | 
			
		||||
 
 | 
			
		||||
@@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret,
 | 
			
		||||
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
 | 
			
		||||
	const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
 | 
			
		||||
 | 
			
		||||
void	BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
 | 
			
		||||
 | 
			
		||||
/* Deprecated versions */
 | 
			
		||||
#ifndef OPENSSL_NO_DEPRECATED
 | 
			
		||||
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
 | 
			
		||||
@@ -774,11 +776,20 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
 | 
			
		||||
 | 
			
		||||
#define bn_fix_top(a)		bn_check_top(a)
 | 
			
		||||
 | 
			
		||||
#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
 | 
			
		||||
#define bn_wcheck_size(bn, words) \
 | 
			
		||||
	do { \
 | 
			
		||||
		const BIGNUM *_bnum2 = (bn); \
 | 
			
		||||
		assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
 | 
			
		||||
	} while(0)
 | 
			
		||||
 | 
			
		||||
#else /* !BN_DEBUG */
 | 
			
		||||
 | 
			
		||||
#define bn_pollute(a)
 | 
			
		||||
#define bn_check_top(a)
 | 
			
		||||
#define bn_fix_top(a)		bn_correct_top(a)
 | 
			
		||||
#define bn_check_size(bn, bits)
 | 
			
		||||
#define bn_wcheck_size(bn, words)
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -141,6 +141,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
 | 
			
		||||
    *
 | 
			
		||||
    *					<appro@fy.chalmers.se>
 | 
			
		||||
    */
 | 
			
		||||
#undef bn_div_words
 | 
			
		||||
#  define bn_div_words(n0,n1,d0)		\
 | 
			
		||||
	({  asm volatile (			\
 | 
			
		||||
		"divl	%4"			\
 | 
			
		||||
@@ -155,6 +156,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
 | 
			
		||||
    * Same story here, but it's 128-bit by 64-bit division. Wow!
 | 
			
		||||
    *					<appro@fy.chalmers.se>
 | 
			
		||||
    */
 | 
			
		||||
#  undef bn_div_words
 | 
			
		||||
#  define bn_div_words(n0,n1,d0)		\
 | 
			
		||||
	({  asm volatile (			\
 | 
			
		||||
		"divq	%4"			\
 | 
			
		||||
 
 | 
			
		||||
@@ -205,6 +205,7 @@ err:
 | 
			
		||||
/* solves ax == 1 (mod n) */
 | 
			
		||||
static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
 | 
			
		||||
        const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
 | 
			
		||||
 | 
			
		||||
BIGNUM *BN_mod_inverse(BIGNUM *in,
 | 
			
		||||
	const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -628,8 +628,11 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
			}
 | 
			
		||||
		if (ubits==vbits)
 | 
			
		||||
			{
 | 
			
		||||
			bn_correct_top(u);
 | 
			
		||||
			ubits = BN_num_bits(u);
 | 
			
		||||
			BN_ULONG ul;
 | 
			
		||||
			int utop = (ubits-1)/BN_BITS2;
 | 
			
		||||
 | 
			
		||||
			while ((ul=udp[utop])==0 && utop) utop--;
 | 
			
		||||
			ubits = utop*BN_BITS2 + BN_num_bits_word(ul);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	bn_correct_top(b);
 | 
			
		||||
 
 | 
			
		||||
@@ -282,16 +282,23 @@ extern "C" {
 | 
			
		||||
#  endif
 | 
			
		||||
# elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG))
 | 
			
		||||
#  if defined(__GNUC__) && __GNUC__>=2
 | 
			
		||||
#   define BN_UMULT_HIGH(a,b)	({	\
 | 
			
		||||
#   if __GNUC__>=4 && __GNUC_MINOR__>=4 /* "h" constraint is no more since 4.4 */
 | 
			
		||||
#     define BN_UMULT_HIGH(a,b)		 (((__uint128_t)(a)*(b))>>64)
 | 
			
		||||
#     define BN_UMULT_LOHI(low,high,a,b) ({	\
 | 
			
		||||
	__uint128_t ret=(__uint128_t)(a)*(b);	\
 | 
			
		||||
	(high)=ret>>64; (low)=ret;	 })
 | 
			
		||||
#   else
 | 
			
		||||
#     define BN_UMULT_HIGH(a,b)	({	\
 | 
			
		||||
	register BN_ULONG ret;		\
 | 
			
		||||
	asm ("dmultu	%1,%2"		\
 | 
			
		||||
	     : "=h"(ret)		\
 | 
			
		||||
	     : "r"(a), "r"(b) : "l");	\
 | 
			
		||||
	ret;			})
 | 
			
		||||
#   define BN_UMULT_LOHI(low,high,a,b)	\
 | 
			
		||||
#     define BN_UMULT_LOHI(low,high,a,b)\
 | 
			
		||||
	asm ("dmultu	%2,%3"		\
 | 
			
		||||
	     : "=l"(low),"=h"(high)	\
 | 
			
		||||
	     : "r"(a), "r"(b));
 | 
			
		||||
#    endif
 | 
			
		||||
#  endif
 | 
			
		||||
# endif		/* cpu */
 | 
			
		||||
#endif		/* OPENSSL_NO_ASM */
 | 
			
		||||
@@ -472,6 +479,10 @@ extern "C" {
 | 
			
		||||
	}
 | 
			
		||||
#endif /* !BN_LLONG */
 | 
			
		||||
 | 
			
		||||
#if defined(OPENSSL_DOING_MAKEDEPEND) && defined(OPENSSL_FIPS)
 | 
			
		||||
#undef bn_div_words
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb);
 | 
			
		||||
void bn_mul_comba8(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b);
 | 
			
		||||
void bn_mul_comba4(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b);
 | 
			
		||||
 
 | 
			
		||||
@@ -824,3 +824,55 @@ int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
 | 
			
		||||
		}
 | 
			
		||||
	return bn_cmp_words(a,b,cl);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Constant-time conditional swap of a and b.  
 | 
			
		||||
 * a and b are swapped if condition is not 0.  The code assumes that at most one bit of condition is set.
 | 
			
		||||
 * nwords is the number of words to swap.  The code assumes that at least nwords are allocated in both a and b,
 | 
			
		||||
 * and that no more than nwords are used by either a or b.
 | 
			
		||||
 * a and b cannot be the same number
 | 
			
		||||
 */
 | 
			
		||||
void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
 | 
			
		||||
	{
 | 
			
		||||
	BN_ULONG t;
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	bn_wcheck_size(a, nwords);
 | 
			
		||||
	bn_wcheck_size(b, nwords);
 | 
			
		||||
 | 
			
		||||
	assert(a != b);
 | 
			
		||||
	assert((condition & (condition - 1)) == 0);
 | 
			
		||||
	assert(sizeof(BN_ULONG) >= sizeof(int));
 | 
			
		||||
 | 
			
		||||
	condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1;
 | 
			
		||||
 | 
			
		||||
	t = (a->top^b->top) & condition;
 | 
			
		||||
	a->top ^= t;
 | 
			
		||||
	b->top ^= t;
 | 
			
		||||
 | 
			
		||||
#define BN_CONSTTIME_SWAP(ind) \
 | 
			
		||||
	do { \
 | 
			
		||||
		t = (a->d[ind] ^ b->d[ind]) & condition; \
 | 
			
		||||
		a->d[ind] ^= t; \
 | 
			
		||||
		b->d[ind] ^= t; \
 | 
			
		||||
	} while (0)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	switch (nwords) {
 | 
			
		||||
	default:
 | 
			
		||||
		for (i = 10; i < nwords; i++) 
 | 
			
		||||
			BN_CONSTTIME_SWAP(i);
 | 
			
		||||
		/* Fallthrough */
 | 
			
		||||
	case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */
 | 
			
		||||
	case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */
 | 
			
		||||
	case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */
 | 
			
		||||
	case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */
 | 
			
		||||
	case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */
 | 
			
		||||
	case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */
 | 
			
		||||
	case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */
 | 
			
		||||
	case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */
 | 
			
		||||
	case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */
 | 
			
		||||
	case 1: BN_CONSTTIME_SWAP(0);
 | 
			
		||||
	}
 | 
			
		||||
#undef BN_CONSTTIME_SWAP
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -478,32 +478,38 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
 | 
			
		||||
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
 | 
			
		||||
					const BIGNUM *mod, BN_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	int got_write_lock = 0;
 | 
			
		||||
	BN_MONT_CTX *ret;
 | 
			
		||||
 | 
			
		||||
	CRYPTO_r_lock(lock);
 | 
			
		||||
	if (!*pmont)
 | 
			
		||||
		{
 | 
			
		||||
		CRYPTO_r_unlock(lock);
 | 
			
		||||
		CRYPTO_w_lock(lock);
 | 
			
		||||
		got_write_lock = 1;
 | 
			
		||||
 | 
			
		||||
		if (!*pmont)
 | 
			
		||||
			{
 | 
			
		||||
			ret = BN_MONT_CTX_new();
 | 
			
		||||
			if (ret && !BN_MONT_CTX_set(ret, mod, ctx))
 | 
			
		||||
				BN_MONT_CTX_free(ret);
 | 
			
		||||
			else
 | 
			
		||||
				*pmont = ret;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
	ret = *pmont;
 | 
			
		||||
	
 | 
			
		||||
	if (got_write_lock)
 | 
			
		||||
		CRYPTO_w_unlock(lock);
 | 
			
		||||
	CRYPTO_r_unlock(lock);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		return ret;
 | 
			
		||||
 | 
			
		||||
	/* We don't want to serialise globally while doing our lazy-init math in
 | 
			
		||||
	 * BN_MONT_CTX_set. That punishes threads that are doing independent
 | 
			
		||||
	 * things. Instead, punish the case where more than one thread tries to
 | 
			
		||||
	 * lazy-init the same 'pmont', by having each do the lazy-init math work
 | 
			
		||||
	 * independently and only use the one from the thread that wins the race
 | 
			
		||||
	 * (the losers throw away the work they've done). */
 | 
			
		||||
	ret = BN_MONT_CTX_new();
 | 
			
		||||
	if (!ret)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	if (!BN_MONT_CTX_set(ret, mod, ctx))
 | 
			
		||||
		{
 | 
			
		||||
		BN_MONT_CTX_free(ret);
 | 
			
		||||
		return NULL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/* The locked compare-and-set, after the local work is done. */
 | 
			
		||||
	CRYPTO_w_lock(lock);
 | 
			
		||||
	if (*pmont)
 | 
			
		||||
		{
 | 
			
		||||
		BN_MONT_CTX_free(ret);
 | 
			
		||||
		ret = *pmont;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		CRYPTO_r_unlock(lock);
 | 
			
		||||
		
 | 
			
		||||
		*pmont = ret;
 | 
			
		||||
	CRYPTO_w_unlock(lock);
 | 
			
		||||
	return ret;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -286,26 +286,25 @@ const BIGNUM *BN_get0_nist_prime_521(void)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void nist_cp_bn_0(BN_ULONG *buf, BN_ULONG *a, int top, int max)
 | 
			
		||||
static void nist_cp_bn_0(BN_ULONG *dst, const BN_ULONG *src, int top, int max)
 | 
			
		||||
	{
 | 
			
		||||
	int i;
 | 
			
		||||
	BN_ULONG *_tmp1 = (buf), *_tmp2 = (a);
 | 
			
		||||
 | 
			
		||||
#ifdef BN_DEBUG
 | 
			
		||||
	OPENSSL_assert(top <= max);
 | 
			
		||||
#endif
 | 
			
		||||
	for (i = (top); i != 0; i--)
 | 
			
		||||
		*_tmp1++ = *_tmp2++;
 | 
			
		||||
	for (i = (max) - (top); i != 0; i--)
 | 
			
		||||
		*_tmp1++ = (BN_ULONG) 0;
 | 
			
		||||
	for (i = 0; i < top; i++)
 | 
			
		||||
		dst[i] = src[i];
 | 
			
		||||
	for (; i < max; i++)
 | 
			
		||||
		dst[i] = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static void nist_cp_bn(BN_ULONG *buf, BN_ULONG *a, int top)
 | 
			
		||||
static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top)
 | 
			
		||||
	{ 
 | 
			
		||||
	int i;
 | 
			
		||||
	BN_ULONG *_tmp1 = (buf), *_tmp2 = (a);
 | 
			
		||||
	for (i = (top); i != 0; i--)
 | 
			
		||||
		*_tmp1++ = *_tmp2++;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < top; i++)
 | 
			
		||||
		dst[i] = src[i];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#if BN_BITS2 == 64
 | 
			
		||||
@@ -341,7 +340,7 @@ static void nist_cp_bn(BN_ULONG *buf, BN_ULONG *a, int top)
 | 
			
		||||
#define bn_32_set_0(to, n)		(to)[n] = (BN_ULONG)0;
 | 
			
		||||
# if defined(_WIN32) && !defined(__GNUC__)
 | 
			
		||||
#  define NIST_INT64 __int64
 | 
			
		||||
# else
 | 
			
		||||
# elif defined(BN_LLONG)
 | 
			
		||||
#  define NIST_INT64 long long
 | 
			
		||||
# endif
 | 
			
		||||
#endif /* BN_BITS2 != 64 */
 | 
			
		||||
@@ -451,8 +450,9 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
	 */
 | 
			
		||||
	mask  = 0-(PTR_SIZE_INT)bn_sub_words(c_d,r_d,_nist_p_192[0],BN_NIST_192_TOP);
 | 
			
		||||
	mask &= 0-(PTR_SIZE_INT)carry;
 | 
			
		||||
	res   = c_d;
 | 
			
		||||
	res   = (BN_ULONG *)
 | 
			
		||||
	 (((PTR_SIZE_INT)c_d&~mask) | ((PTR_SIZE_INT)r_d&mask));
 | 
			
		||||
	 (((PTR_SIZE_INT)res&~mask) | ((PTR_SIZE_INT)r_d&mask));
 | 
			
		||||
	nist_cp_bn(r_d, res, BN_NIST_192_TOP);
 | 
			
		||||
	r->top = BN_NIST_192_TOP;
 | 
			
		||||
	bn_correct_top(r);
 | 
			
		||||
@@ -479,8 +479,11 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
	int	top = a->top, i;
 | 
			
		||||
	int	carry;
 | 
			
		||||
	BN_ULONG *r_d, *a_d = a->d;
 | 
			
		||||
	BN_ULONG buf[BN_NIST_224_TOP],
 | 
			
		||||
		 c_d[BN_NIST_224_TOP],
 | 
			
		||||
	union	{
 | 
			
		||||
		BN_ULONG	bn[BN_NIST_224_TOP];
 | 
			
		||||
		unsigned int	ui[BN_NIST_224_TOP*sizeof(BN_ULONG)/sizeof(unsigned int)];
 | 
			
		||||
		} buf;
 | 
			
		||||
	BN_ULONG c_d[BN_NIST_224_TOP],
 | 
			
		||||
		*res;
 | 
			
		||||
	PTR_SIZE_INT mask;
 | 
			
		||||
	union { bn_addsub_f f; PTR_SIZE_INT p; } u;
 | 
			
		||||
@@ -519,18 +522,18 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
	/* copy upper 256 bits of 448 bit number ... */
 | 
			
		||||
	nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP-1), top - (BN_NIST_224_TOP-1), BN_NIST_224_TOP);
 | 
			
		||||
	/* ... and right shift by 32 to obtain upper 224 bits */
 | 
			
		||||
	nist_set_224(buf, c_d, 14, 13, 12, 11, 10, 9, 8);
 | 
			
		||||
	nist_set_224(buf.bn, c_d, 14, 13, 12, 11, 10, 9, 8);
 | 
			
		||||
	/* truncate lower part to 224 bits too */
 | 
			
		||||
	r_d[BN_NIST_224_TOP-1] &= BN_MASK2l;
 | 
			
		||||
#else
 | 
			
		||||
	nist_cp_bn_0(buf, a_d + BN_NIST_224_TOP, top - BN_NIST_224_TOP, BN_NIST_224_TOP);
 | 
			
		||||
	nist_cp_bn_0(buf.bn, a_d + BN_NIST_224_TOP, top - BN_NIST_224_TOP, BN_NIST_224_TOP);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(NIST_INT64) && BN_BITS2!=64
 | 
			
		||||
	{
 | 
			
		||||
	NIST_INT64		acc;	/* accumulator */
 | 
			
		||||
	unsigned int		*rp=(unsigned int *)r_d;
 | 
			
		||||
	const unsigned int	*bp=(const unsigned int *)buf;
 | 
			
		||||
	const unsigned int	*bp=(const unsigned int *)buf.ui;
 | 
			
		||||
 | 
			
		||||
	acc  = rp[0];	acc -= bp[7-7];
 | 
			
		||||
			acc -= bp[11-7]; rp[0] = (unsigned int)acc; acc >>= 32;
 | 
			
		||||
@@ -565,13 +568,13 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
	{
 | 
			
		||||
	BN_ULONG t_d[BN_NIST_224_TOP];
 | 
			
		||||
 | 
			
		||||
	nist_set_224(t_d, buf, 10, 9, 8, 7, 0, 0, 0);
 | 
			
		||||
	nist_set_224(t_d, buf.bn, 10, 9, 8, 7, 0, 0, 0);
 | 
			
		||||
	carry = (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
 | 
			
		||||
	nist_set_224(t_d, buf, 0, 13, 12, 11, 0, 0, 0);
 | 
			
		||||
	nist_set_224(t_d, buf.bn, 0, 13, 12, 11, 0, 0, 0);
 | 
			
		||||
	carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
 | 
			
		||||
	nist_set_224(t_d, buf, 13, 12, 11, 10, 9, 8, 7);
 | 
			
		||||
	nist_set_224(t_d, buf.bn, 13, 12, 11, 10, 9, 8, 7);
 | 
			
		||||
	carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
 | 
			
		||||
	nist_set_224(t_d, buf, 0, 0, 0, 0, 13, 12, 11);
 | 
			
		||||
	nist_set_224(t_d, buf.bn, 0, 0, 0, 0, 13, 12, 11);
 | 
			
		||||
	carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
 | 
			
		||||
 | 
			
		||||
#if BN_BITS2==64
 | 
			
		||||
@@ -606,7 +609,8 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
	/* otherwise it's effectively same as in BN_nist_mod_192... */
 | 
			
		||||
	mask  = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_224[0],BN_NIST_224_TOP);
 | 
			
		||||
	mask &= 0-(PTR_SIZE_INT)carry;
 | 
			
		||||
	res   = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) |
 | 
			
		||||
	res   = c_d;
 | 
			
		||||
	res   = (BN_ULONG *)(((PTR_SIZE_INT)res&~mask) |
 | 
			
		||||
	 ((PTR_SIZE_INT)r_d&mask));
 | 
			
		||||
	nist_cp_bn(r_d, res, BN_NIST_224_TOP);
 | 
			
		||||
	r->top = BN_NIST_224_TOP;
 | 
			
		||||
@@ -805,7 +809,8 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
 | 
			
		||||
	mask  = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_256[0],BN_NIST_256_TOP);
 | 
			
		||||
	mask &= 0-(PTR_SIZE_INT)carry;
 | 
			
		||||
	res   = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) |
 | 
			
		||||
	res   = c_d;
 | 
			
		||||
	res   = (BN_ULONG *)(((PTR_SIZE_INT)res&~mask) |
 | 
			
		||||
	 ((PTR_SIZE_INT)r_d&mask));
 | 
			
		||||
	nist_cp_bn(r_d, res, BN_NIST_256_TOP);
 | 
			
		||||
	r->top = BN_NIST_256_TOP;
 | 
			
		||||
@@ -1026,7 +1031,8 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
 | 
			
		||||
	mask  = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_384[0],BN_NIST_384_TOP);
 | 
			
		||||
	mask &= 0-(PTR_SIZE_INT)carry;
 | 
			
		||||
	res   = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) |
 | 
			
		||||
	res   = c_d;
 | 
			
		||||
	res   = (BN_ULONG *)(((PTR_SIZE_INT)res&~mask) |
 | 
			
		||||
	 ((PTR_SIZE_INT)r_d&mask));
 | 
			
		||||
	nist_cp_bn(r_d, res, BN_NIST_384_TOP);
 | 
			
		||||
	r->top = BN_NIST_384_TOP;
 | 
			
		||||
@@ -1092,7 +1098,8 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
 | 
			
		||||
 | 
			
		||||
	bn_add_words(r_d,r_d,t_d,BN_NIST_521_TOP);
 | 
			
		||||
	mask = 0-(PTR_SIZE_INT)bn_sub_words(t_d,r_d,_nist_p_521,BN_NIST_521_TOP);
 | 
			
		||||
	res  = (BN_ULONG *)(((PTR_SIZE_INT)t_d&~mask) |
 | 
			
		||||
	res  = t_d;
 | 
			
		||||
	res  = (BN_ULONG *)(((PTR_SIZE_INT)res&~mask) |
 | 
			
		||||
	 ((PTR_SIZE_INT)r_d&mask));
 | 
			
		||||
	nist_cp_bn(r_d,res,BN_NIST_521_TOP);
 | 
			
		||||
	r->top = BN_NIST_521_TOP;
 | 
			
		||||
 
 | 
			
		||||
@@ -144,26 +144,17 @@ int BN_add_word(BIGNUM *a, BN_ULONG w)
 | 
			
		||||
			a->neg=!(a->neg);
 | 
			
		||||
		return(i);
 | 
			
		||||
		}
 | 
			
		||||
	/* Only expand (and risk failing) if it's possibly necessary */
 | 
			
		||||
	if (((BN_ULONG)(a->d[a->top - 1] + 1) == 0) &&
 | 
			
		||||
			(bn_wexpand(a,a->top+1) == NULL))
 | 
			
		||||
		return(0);
 | 
			
		||||
	i=0;
 | 
			
		||||
	for (;;)
 | 
			
		||||
	for (i=0;w!=0 && i<a->top;i++)
 | 
			
		||||
		{
 | 
			
		||||
		if (i >= a->top)
 | 
			
		||||
			l=w;
 | 
			
		||||
		else
 | 
			
		||||
			l=(a->d[i]+w)&BN_MASK2;
 | 
			
		||||
		a->d[i]=l;
 | 
			
		||||
		if (w > l)
 | 
			
		||||
			w=1;
 | 
			
		||||
		else
 | 
			
		||||
			break;
 | 
			
		||||
		i++;
 | 
			
		||||
		a->d[i] = l = (a->d[i]+w)&BN_MASK2;
 | 
			
		||||
		w = (w>l)?1:0;
 | 
			
		||||
		}
 | 
			
		||||
	if (i >= a->top)
 | 
			
		||||
	if (w && i==a->top)
 | 
			
		||||
		{
 | 
			
		||||
		if (bn_wexpand(a,a->top+1) == NULL) return 0;
 | 
			
		||||
		a->top++;
 | 
			
		||||
		a->d[i]=w;
 | 
			
		||||
		}
 | 
			
		||||
	bn_check_top(a);
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -60,6 +60,11 @@
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/buffer.h>
 | 
			
		||||
 | 
			
		||||
/* LIMIT_BEFORE_EXPANSION is the maximum n such that (n+3)/3*4 < 2**31. That
 | 
			
		||||
 * function is applied in several functions in this file and this limit ensures
 | 
			
		||||
 * that the result fits in an int. */
 | 
			
		||||
#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
 | 
			
		||||
 | 
			
		||||
BUF_MEM *BUF_MEM_new(void)
 | 
			
		||||
	{
 | 
			
		||||
	BUF_MEM *ret;
 | 
			
		||||
@@ -105,6 +110,12 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len)
 | 
			
		||||
		str->length=len;
 | 
			
		||||
		return(len);
 | 
			
		||||
		}
 | 
			
		||||
	/* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
 | 
			
		||||
	if (len > LIMIT_BEFORE_EXPANSION)
 | 
			
		||||
		{
 | 
			
		||||
		BUFerr(BUF_F_BUF_MEM_GROW,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
	n=(len+3)/3*4;
 | 
			
		||||
	if (str->data == NULL)
 | 
			
		||||
		ret=OPENSSL_malloc(n);
 | 
			
		||||
@@ -142,6 +153,12 @@ int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
 | 
			
		||||
		str->length=len;
 | 
			
		||||
		return(len);
 | 
			
		||||
		}
 | 
			
		||||
	/* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
 | 
			
		||||
	if (len > LIMIT_BEFORE_EXPANSION)
 | 
			
		||||
		{
 | 
			
		||||
		BUFerr(BUF_F_BUF_MEM_GROW_CLEAN,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
	n=(len+3)/3*4;
 | 
			
		||||
	if (str->data == NULL)
 | 
			
		||||
		ret=OPENSSL_malloc(n);
 | 
			
		||||
@@ -162,14 +179,14 @@ int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
 | 
			
		||||
	return(len);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void BUF_reverse(unsigned char *out, unsigned char *in, size_t size)
 | 
			
		||||
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t size)
 | 
			
		||||
	{
 | 
			
		||||
	size_t i;
 | 
			
		||||
	if (in)
 | 
			
		||||
		{
 | 
			
		||||
		out += size - 1;
 | 
			
		||||
		for (i = 0; i < size; i++)
 | 
			
		||||
			*in++ = *out--;
 | 
			
		||||
			*out-- = *in++;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ int	BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
 | 
			
		||||
char *	BUF_strdup(const char *str);
 | 
			
		||||
char *	BUF_strndup(const char *str, size_t siz);
 | 
			
		||||
void *	BUF_memdup(const void *data, size_t siz);
 | 
			
		||||
void	BUF_reverse(unsigned char *out, unsigned char *in, size_t siz);
 | 
			
		||||
void	BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
 | 
			
		||||
 | 
			
		||||
/* safe string functions */
 | 
			
		||||
size_t BUF_strlcpy(char *dst,const char *src,size_t siz);
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 | 
			
		||||
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 | 
			
		||||
die "can't locate x86_64-xlate.pl";
 | 
			
		||||
 | 
			
		||||
open STDOUT,"| $^X $xlate $flavour $output";
 | 
			
		||||
open OUT,"| \"$^X\" $xlate $flavour $output";
 | 
			
		||||
*STDOUT=*OUT;
 | 
			
		||||
 | 
			
		||||
sub hi() { my $r=shift; $r =~ s/%[er]([a-d])x/%\1h/;    $r; }
 | 
			
		||||
sub lo() { my $r=shift; $r =~ s/%[er]([a-d])x/%\1l/;
 | 
			
		||||
 
 | 
			
		||||
@@ -179,6 +179,8 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
 | 
			
		||||
			return 0;
 | 
			
		||||
		if (!EVP_EncryptInit_ex(&ctx->cctx, NULL, NULL, NULL, zero_iv))
 | 
			
		||||
			return 0;
 | 
			
		||||
		memset(ctx->tbl, 0, EVP_CIPHER_CTX_block_size(&ctx->cctx));
 | 
			
		||||
		ctx->nlast_block = 0;
 | 
			
		||||
		return 1;
 | 
			
		||||
		}
 | 
			
		||||
	/* Initialiase context */
 | 
			
		||||
 
 | 
			
		||||
@@ -111,6 +111,7 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
 | 
			
		||||
#define CMS_PARTIAL			0x4000
 | 
			
		||||
#define CMS_REUSE_DIGEST		0x8000
 | 
			
		||||
#define CMS_USE_KEYID			0x10000
 | 
			
		||||
#define CMS_DEBUG_DECRYPT		0x20000
 | 
			
		||||
 | 
			
		||||
const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,9 @@
 | 
			
		||||
#include <openssl/err.h>
 | 
			
		||||
#include <openssl/cms.h>
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
#ifndef OPENSSL_NO_COMP
 | 
			
		||||
#include <openssl/comp.h>
 | 
			
		||||
#endif
 | 
			
		||||
#include "cms_lcl.h"
 | 
			
		||||
 | 
			
		||||
DECLARE_ASN1_ITEM(CMS_CompressedData)
 | 
			
		||||
 
 | 
			
		||||
@@ -73,6 +73,8 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
 | 
			
		||||
	const EVP_CIPHER *ciph;
 | 
			
		||||
	X509_ALGOR *calg = ec->contentEncryptionAlgorithm;
 | 
			
		||||
	unsigned char iv[EVP_MAX_IV_LENGTH], *piv = NULL;
 | 
			
		||||
	unsigned char *tkey = NULL;
 | 
			
		||||
	size_t tkeylen = 0;
 | 
			
		||||
 | 
			
		||||
	int ok = 0;
 | 
			
		||||
 | 
			
		||||
@@ -137,32 +139,57 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
 | 
			
		||||
				CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if (enc && !ec->key)
 | 
			
		||||
	tkeylen = EVP_CIPHER_CTX_key_length(ctx);
 | 
			
		||||
	/* Generate random session key */
 | 
			
		||||
	if (!enc || !ec->key)
 | 
			
		||||
		{
 | 
			
		||||
		/* Generate random key */
 | 
			
		||||
		if (!ec->keylen)
 | 
			
		||||
			ec->keylen = EVP_CIPHER_CTX_key_length(ctx);
 | 
			
		||||
		ec->key = OPENSSL_malloc(ec->keylen);
 | 
			
		||||
		if (!ec->key)
 | 
			
		||||
		tkey = OPENSSL_malloc(tkeylen);
 | 
			
		||||
		if (!tkey)
 | 
			
		||||
			{
 | 
			
		||||
			CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,
 | 
			
		||||
							ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			goto err;
 | 
			
		||||
			}
 | 
			
		||||
		if (EVP_CIPHER_CTX_rand_key(ctx, ec->key) <= 0)
 | 
			
		||||
		if (EVP_CIPHER_CTX_rand_key(ctx, tkey) <= 0)
 | 
			
		||||
			goto err;
 | 
			
		||||
		keep_key = 1;
 | 
			
		||||
		}
 | 
			
		||||
	else if (ec->keylen != (unsigned int)EVP_CIPHER_CTX_key_length(ctx))
 | 
			
		||||
 | 
			
		||||
	if (!ec->key)
 | 
			
		||||
		{
 | 
			
		||||
		ec->key = tkey;
 | 
			
		||||
		ec->keylen = tkeylen;
 | 
			
		||||
		tkey = NULL;
 | 
			
		||||
		if (enc)
 | 
			
		||||
			keep_key = 1;
 | 
			
		||||
		else
 | 
			
		||||
			ERR_clear_error();
 | 
			
		||||
		
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (ec->keylen != tkeylen)
 | 
			
		||||
		{
 | 
			
		||||
		/* If necessary set key length */
 | 
			
		||||
		if (EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen) <= 0)
 | 
			
		||||
			{
 | 
			
		||||
			CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,
 | 
			
		||||
				CMS_R_INVALID_KEY_LENGTH);
 | 
			
		||||
			goto err;
 | 
			
		||||
			/* Only reveal failure if debugging so we don't
 | 
			
		||||
			 * leak information which may be useful in MMA.
 | 
			
		||||
			 */
 | 
			
		||||
			if (enc || ec->debug)
 | 
			
		||||
				{
 | 
			
		||||
				CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,
 | 
			
		||||
						CMS_R_INVALID_KEY_LENGTH);
 | 
			
		||||
				goto err;
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				/* Use random key */
 | 
			
		||||
				OPENSSL_cleanse(ec->key, ec->keylen);
 | 
			
		||||
				OPENSSL_free(ec->key);
 | 
			
		||||
				ec->key = tkey;
 | 
			
		||||
				ec->keylen = tkeylen;
 | 
			
		||||
				tkey = NULL;
 | 
			
		||||
				ERR_clear_error();
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -198,6 +225,11 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
 | 
			
		||||
		OPENSSL_free(ec->key);
 | 
			
		||||
		ec->key = NULL;
 | 
			
		||||
		}
 | 
			
		||||
	if (tkey)
 | 
			
		||||
		{
 | 
			
		||||
		OPENSSL_cleanse(tkey, tkeylen);
 | 
			
		||||
		OPENSSL_free(tkey);
 | 
			
		||||
		}
 | 
			
		||||
	if (ok)
 | 
			
		||||
		return b;
 | 
			
		||||
	BIO_free(b);
 | 
			
		||||
 
 | 
			
		||||
@@ -185,6 +185,8 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
 | 
			
		||||
	if (flags & CMS_USE_KEYID)
 | 
			
		||||
		{
 | 
			
		||||
		ktri->version = 2;
 | 
			
		||||
		if (env->version < 2)
 | 
			
		||||
			env->version = 2;
 | 
			
		||||
		type = CMS_RECIPINFO_KEYIDENTIFIER;
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
@@ -370,6 +372,8 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms,
 | 
			
		||||
	unsigned char *ek = NULL;
 | 
			
		||||
	size_t eklen;
 | 
			
		||||
	int ret = 0;
 | 
			
		||||
	CMS_EncryptedContentInfo *ec;
 | 
			
		||||
	ec = cms->d.envelopedData->encryptedContentInfo;
 | 
			
		||||
 | 
			
		||||
	if (ktri->pkey == NULL)
 | 
			
		||||
		{
 | 
			
		||||
@@ -416,8 +420,14 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms,
 | 
			
		||||
 | 
			
		||||
	ret = 1;
 | 
			
		||||
 | 
			
		||||
	cms->d.envelopedData->encryptedContentInfo->key = ek;
 | 
			
		||||
	cms->d.envelopedData->encryptedContentInfo->keylen = eklen;
 | 
			
		||||
	if (ec->key)
 | 
			
		||||
		{
 | 
			
		||||
		OPENSSL_cleanse(ec->key, ec->keylen);
 | 
			
		||||
		OPENSSL_free(ec->key);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	ec->key = ek;
 | 
			
		||||
	ec->keylen = eklen;
 | 
			
		||||
 | 
			
		||||
	err:
 | 
			
		||||
	if (pctx)
 | 
			
		||||
 
 | 
			
		||||
@@ -175,6 +175,8 @@ struct CMS_EncryptedContentInfo_st
 | 
			
		||||
	const EVP_CIPHER *cipher;
 | 
			
		||||
	unsigned char *key;
 | 
			
		||||
	size_t keylen;
 | 
			
		||||
	/* Set to 1 if we are debugging decrypt and don't fake keys for MMA */
 | 
			
		||||
	int debug;
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
struct CMS_RecipientInfo_st
 | 
			
		||||
 
 | 
			
		||||
@@ -411,9 +411,7 @@ int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
 | 
			
		||||
		 * algorithm  OID instead of digest.
 | 
			
		||||
		 */
 | 
			
		||||
			|| EVP_MD_pkey_type(EVP_MD_CTX_md(mtmp)) == nid)
 | 
			
		||||
			{
 | 
			
		||||
			return EVP_MD_CTX_copy_ex(mctx, mtmp);
 | 
			
		||||
			}
 | 
			
		||||
		chain = BIO_next(chain);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -465,8 +463,6 @@ int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert)
 | 
			
		||||
	STACK_OF(CMS_CertificateChoices) **pcerts;
 | 
			
		||||
	int i;
 | 
			
		||||
	pcerts = cms_get0_certificate_choices(cms);
 | 
			
		||||
	if (!pcerts)
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (!pcerts)
 | 
			
		||||
		return 0;
 | 
			
		||||
	for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++)
 | 
			
		||||
 
 | 
			
		||||
@@ -158,8 +158,8 @@ static void cms_sd_set_version(CMS_SignedData *sd)
 | 
			
		||||
			if (sd->version < 3)
 | 
			
		||||
				sd->version = 3;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			sd->version = 1;
 | 
			
		||||
		else if (si->version < 1)
 | 
			
		||||
			si->version = 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (sd->version < 1)
 | 
			
		||||
 
 | 
			
		||||
@@ -611,12 +611,16 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert)
 | 
			
		||||
	STACK_OF(CMS_RecipientInfo) *ris;
 | 
			
		||||
	CMS_RecipientInfo *ri;
 | 
			
		||||
	int i, r;
 | 
			
		||||
	int debug = 0, ri_match = 0;
 | 
			
		||||
	ris = CMS_get0_RecipientInfos(cms);
 | 
			
		||||
	if (ris)
 | 
			
		||||
		debug = cms->d.envelopedData->encryptedContentInfo->debug;
 | 
			
		||||
	for (i = 0; i < sk_CMS_RecipientInfo_num(ris); i++)
 | 
			
		||||
		{
 | 
			
		||||
		ri = sk_CMS_RecipientInfo_value(ris, i);
 | 
			
		||||
		if (CMS_RecipientInfo_type(ri) != CMS_RECIPINFO_TRANS)
 | 
			
		||||
				continue;
 | 
			
		||||
		ri_match = 1;
 | 
			
		||||
		/* If we have a cert try matching RecipientInfo
 | 
			
		||||
		 * otherwise try them all.
 | 
			
		||||
		 */
 | 
			
		||||
@@ -625,17 +629,38 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert)
 | 
			
		||||
			CMS_RecipientInfo_set0_pkey(ri, pk);
 | 
			
		||||
			r = CMS_RecipientInfo_decrypt(cms, ri);
 | 
			
		||||
			CMS_RecipientInfo_set0_pkey(ri, NULL);
 | 
			
		||||
			if (r > 0)
 | 
			
		||||
				return 1;
 | 
			
		||||
			if (cert)
 | 
			
		||||
				{
 | 
			
		||||
				/* If not debugging clear any error and
 | 
			
		||||
				 * return success to avoid leaking of
 | 
			
		||||
				 * information useful to MMA
 | 
			
		||||
				 */
 | 
			
		||||
				if (!debug)
 | 
			
		||||
					{
 | 
			
		||||
					ERR_clear_error();
 | 
			
		||||
					return 1;
 | 
			
		||||
					}
 | 
			
		||||
				if (r > 0)
 | 
			
		||||
					return 1;
 | 
			
		||||
				CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY,
 | 
			
		||||
						CMS_R_DECRYPT_ERROR);
 | 
			
		||||
				return 0;
 | 
			
		||||
				}
 | 
			
		||||
			ERR_clear_error();
 | 
			
		||||
			/* If no cert and not debugging don't leave loop
 | 
			
		||||
			 * after first successful decrypt. Always attempt
 | 
			
		||||
			 * to decrypt all recipients to avoid leaking timing
 | 
			
		||||
			 * of a successful decrypt.
 | 
			
		||||
			 */
 | 
			
		||||
			else if (r > 0 && debug)
 | 
			
		||||
				return 1;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	/* If no cert and not debugging always return success */
 | 
			
		||||
	if (ri_match && !cert && !debug)
 | 
			
		||||
		{
 | 
			
		||||
		ERR_clear_error();
 | 
			
		||||
		return 1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	CMSerr(CMS_F_CMS_DECRYPT_SET1_PKEY, CMS_R_NO_MATCHING_RECIPIENT);
 | 
			
		||||
	return 0;
 | 
			
		||||
@@ -718,9 +743,14 @@ int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert,
 | 
			
		||||
		}
 | 
			
		||||
	if (!dcont && !check_content(cms))
 | 
			
		||||
		return 0;
 | 
			
		||||
	if (flags & CMS_DEBUG_DECRYPT)
 | 
			
		||||
		cms->d.envelopedData->encryptedContentInfo->debug = 1;
 | 
			
		||||
	else
 | 
			
		||||
		cms->d.envelopedData->encryptedContentInfo->debug = 0;
 | 
			
		||||
	if (!pk && !cert && !dcont && !out)
 | 
			
		||||
		return 1;
 | 
			
		||||
	if (pk && !CMS_decrypt_set1_pkey(cms, pk, cert))
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	cont = CMS_dataInit(cms, dcont);
 | 
			
		||||
	if (!cont)
 | 
			
		||||
		return 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -76,5 +76,6 @@ void OPENSSL_load_builtin_modules(void)
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	ENGINE_add_conf_module();
 | 
			
		||||
#endif
 | 
			
		||||
	EVP_add_alg_module();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -504,7 +504,7 @@ void CRYPTO_THREADID_current(CRYPTO_THREADID *id)
 | 
			
		||||
	CRYPTO_THREADID_set_numeric(id, (unsigned long)find_thread(NULL));
 | 
			
		||||
#else
 | 
			
		||||
	/* For everything else, default to using the address of 'errno' */
 | 
			
		||||
	CRYPTO_THREADID_set_pointer(id, &errno);
 | 
			
		||||
	CRYPTO_THREADID_set_pointer(id, (void*)&errno);
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -698,12 +698,13 @@ void OPENSSL_cpuid_setup(void)
 | 
			
		||||
#if defined(_WIN32)
 | 
			
		||||
	if (!sscanf(env+off,"%I64i",&vec)) vec = strtoul(env+off,NULL,0);
 | 
			
		||||
#else
 | 
			
		||||
	vec = strtoull(env+off,NULL,0);
 | 
			
		||||
	if (!sscanf(env+off,"%lli",(long long *)&vec)) vec = strtoul(env+off,NULL,0);
 | 
			
		||||
#endif
 | 
			
		||||
	if (off) vec = OPENSSL_ia32_cpuid()&~vec;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
	vec = OPENSSL_ia32_cpuid();
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * |(1<<10) sets a reserved bit to signal that variable
 | 
			
		||||
     * was initialized already... This is to avoid interference
 | 
			
		||||
@@ -888,7 +889,7 @@ void OPENSSL_showfatal (const char *fmta,...)
 | 
			
		||||
 | 
			
		||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
 | 
			
		||||
    /* this -------------v--- guards NT-specific calls */
 | 
			
		||||
    if (GetVersion() < 0x80000000 && OPENSSL_isservice() > 0)
 | 
			
		||||
    if (check_winnt() && OPENSSL_isservice() > 0)
 | 
			
		||||
    {	HANDLE h = RegisterEventSource(0,_T("OPENSSL"));
 | 
			
		||||
	const TCHAR *pmsg=buf;
 | 
			
		||||
	ReportEvent(h,EVENTLOG_ERROR_TYPE,0,0,0,1,0,&pmsg,0);
 | 
			
		||||
@@ -924,3 +925,16 @@ void OpenSSLDie(const char *file,int line,const char *assertion)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void *OPENSSL_stderr(void)	{ return stderr; }
 | 
			
		||||
 | 
			
		||||
int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
 | 
			
		||||
	{
 | 
			
		||||
	size_t i;
 | 
			
		||||
	const unsigned char *a = in_a;
 | 
			
		||||
	const unsigned char *b = in_b;
 | 
			
		||||
	unsigned char x = 0;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < len; i++)
 | 
			
		||||
		x |= a[i] ^ b[i];
 | 
			
		||||
 | 
			
		||||
	return x;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user