Compare commits
1994 Commits
OpenSSL_1_
...
OpenSSL_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba442a7e1b | ||
|
|
e8ccaee31c | ||
|
|
60431d0db3 | ||
|
|
346a46f074 | ||
|
|
56abaa14e0 | ||
|
|
8b8a48d099 | ||
|
|
09caf4ffcd | ||
|
|
9793a0713f | ||
|
|
aa9296e331 | ||
|
|
bc253b0902 | ||
|
|
b873409efe | ||
|
|
f89250f2f2 | ||
|
|
1dc6a5441a | ||
|
|
a4aa188799 | ||
|
|
50befdb659 | ||
|
|
46bf0ba876 | ||
|
|
4b4c0a1921 | ||
|
|
df70302441 | ||
|
|
9c6c664041 | ||
|
|
11f719da38 | ||
|
|
72f1815391 | ||
|
|
e42a2abadc | ||
|
|
ec2fede946 | ||
|
|
63f3c9e715 | ||
|
|
c22e2dd6e5 | ||
|
|
7fae32f6d6 | ||
|
|
5260f1a483 | ||
|
|
1cb10d9c7d | ||
|
|
62abc80540 | ||
|
|
722fa14271 | ||
|
|
a2ca66f37c | ||
|
|
6a04b0d5a4 | ||
|
|
1acca28263 | ||
|
|
d510c6489e | ||
|
|
b82924741b | ||
|
|
cbb6ccabb0 | ||
|
|
e369af3600 | ||
|
|
15b7f5bf88 | ||
|
|
9880f63038 | ||
|
|
af32df0a8e | ||
|
|
bfb7bf1a28 | ||
|
|
f33636faf7 | ||
|
|
94f735cade | ||
|
|
36216218ca | ||
|
|
115eaf4886 | ||
|
|
53ce5647d4 | ||
|
|
4d2efa29f6 | ||
|
|
cd332a0750 | ||
|
|
2ed80d14d7 | ||
|
|
d286606301 | ||
|
|
3f4d81e88b | ||
|
|
dc5dfe431c | ||
|
|
c6a876473c | ||
|
|
5a7fc89394 | ||
|
|
116fd3732a | ||
|
|
1bb01b1b5f | ||
|
|
699d78ce98 | ||
|
|
43d613ec18 | ||
|
|
96e1015eec | ||
|
|
cf4b01a766 | ||
|
|
45d129511f | ||
|
|
0976adac8f | ||
|
|
db5b0d9309 | ||
|
|
aeeedc8acc | ||
|
|
c903866420 | ||
|
|
9b208659aa | ||
|
|
f54fab0fef | ||
|
|
b30aaafbe5 | ||
|
|
fee8d86d7a | ||
|
|
bf3e53a7fa | ||
|
|
44a8fced97 | ||
|
|
4ff07f4c71 | ||
|
|
1c5f396d36 | ||
|
|
9fcaaef34f | ||
|
|
b9a73f5481 | ||
|
|
bff5319d90 | ||
|
|
fc4bd2f287 | ||
|
|
4c836c96c4 | ||
|
|
6e14e7fc19 | ||
|
|
fc15c44049 | ||
|
|
445598b35e | ||
|
|
338a5e7e54 | ||
|
|
6a431cd293 | ||
|
|
1b7024fb69 | ||
|
|
5021f6314e | ||
|
|
21d24dd38a | ||
|
|
681d11b6fd | ||
|
|
8c387e62b2 | ||
|
|
a117329c5a | ||
|
|
f39dbff498 | ||
|
|
f6fefb0cb6 | ||
|
|
febfaa53f4 | ||
|
|
cfed221c2d | ||
|
|
c2014ae252 | ||
|
|
c3d317b4de | ||
|
|
a214feb26b | ||
|
|
7a3a82dbbd | ||
|
|
02fef91630 | ||
|
|
0b8cd5acd6 | ||
|
|
97f4e235a1 | ||
|
|
cfd2aeeb7c | ||
|
|
a0fdc4c6d6 | ||
|
|
b5def0243e | ||
|
|
357f6d8add | ||
|
|
19a71e8c16 | ||
|
|
7faa66433f | ||
|
|
1a0498769f | ||
|
|
a4dde82423 | ||
|
|
eba0aa995d | ||
|
|
c9e6fffa53 | ||
|
|
85dcce7c63 | ||
|
|
2ed29615cb | ||
|
|
d7080d624b | ||
|
|
5d7c8a48db | ||
|
|
00e86a74bd | ||
|
|
9e6857a358 | ||
|
|
715258486c | ||
|
|
2daec41e25 | ||
|
|
8519635923 | ||
|
|
d0bdfdd830 | ||
|
|
4b98488eb0 | ||
|
|
0e2458e187 | ||
|
|
326de18955 | ||
|
|
1fcfd61ee7 | ||
|
|
121f386ec7 | ||
|
|
9fb10cfe6b | ||
|
|
a20a6366c8 | ||
|
|
54985b5061 | ||
|
|
b09db677d5 | ||
|
|
cdc596567d | ||
|
|
70d923fb03 | ||
|
|
def1490717 | ||
|
|
7697d9b587 | ||
|
|
0345354fe0 | ||
|
|
90aef4431b | ||
|
|
602689074a | ||
|
|
810d2c7f6e | ||
|
|
0a9b8dd1b4 | ||
|
|
bfce4e5d6e | ||
|
|
4a1190beca | ||
|
|
047ec5d196 | ||
|
|
bb59889305 | ||
|
|
141a5482fd | ||
|
|
de2422affb | ||
|
|
897169fdf0 | ||
|
|
410a49a4fa | ||
|
|
82ba68c42d | ||
|
|
4b258e73ae | ||
|
|
6ac2f67882 | ||
|
|
bea1d1cbd8 | ||
|
|
61e6e80fe5 | ||
|
|
2ce540743e | ||
|
|
8e928aab02 | ||
|
|
105e52bf23 | ||
|
|
492a5010a4 | ||
|
|
53b0b0a330 | ||
|
|
677c117419 | ||
|
|
bb50d30f35 | ||
|
|
8323996d99 | ||
|
|
ee14e33c35 | ||
|
|
1bcb94a721 | ||
|
|
9658c634a2 | ||
|
|
7ee8b27267 | ||
|
|
e4ea6f0c76 | ||
|
|
a2c00fb210 | ||
|
|
d06ae0fff7 | ||
|
|
afa2ea204e | ||
|
|
0b6394c738 | ||
|
|
70ddf8ecca | ||
|
|
9febee0272 | ||
|
|
a721216f0f | ||
|
|
47f689ac09 | ||
|
|
f51f374199 | ||
|
|
3c1128f43f | ||
|
|
8185c9457e | ||
|
|
c61f0cbffb | ||
|
|
d90605dd00 | ||
|
|
e56334998c | ||
|
|
9ad5c5e4f9 | ||
|
|
4bc24cf01d | ||
|
|
79f57768ff | ||
|
|
d79eb9299a | ||
|
|
fff69a7d8c | ||
|
|
a375025e4d | ||
|
|
d471adf351 | ||
|
|
2fb8642eea | ||
|
|
c44d95c1a7 | ||
|
|
0da40f0ffc | ||
|
|
7f722c95f8 | ||
|
|
4268216005 | ||
|
|
17540b77e0 | ||
|
|
b70e4d3e90 | ||
|
|
d9519a4032 | ||
|
|
5ac9786807 | ||
|
|
0b05204c4e | ||
|
|
a4bfeff254 | ||
|
|
43433b3852 | ||
|
|
020a4782bd | ||
|
|
cadbbd51c8 | ||
|
|
ff7b021040 | ||
|
|
e7e4d506d6 | ||
|
|
9204e7ef0d | ||
|
|
257df40f00 | ||
|
|
a44c9b9c33 | ||
|
|
1cbd7456aa | ||
|
|
e1e39a2451 | ||
|
|
01de6e21cc | ||
|
|
05689a132c | ||
|
|
1643edc63c | ||
|
|
1546fb780b | ||
|
|
b7d222c519 | ||
|
|
a93cc7c573 | ||
|
|
8988407a0b | ||
|
|
b2afc0a9dc | ||
|
|
a8655eb21a | ||
|
|
f751dc4759 | ||
|
|
fbe621d08f | ||
|
|
2e9fd4301f | ||
|
|
1638ce7212 | ||
|
|
7ecd974f5f | ||
|
|
db731da802 | ||
|
|
5864fd2061 | ||
|
|
ff58eaa4b6 | ||
|
|
76c61a5d1a | ||
|
|
4ea7019165 | ||
|
|
59b1129e0a | ||
|
|
fb092ef4fc | ||
|
|
6351adecb4 | ||
|
|
8964efc413 | ||
|
|
430b637bd5 | ||
|
|
ca3b81c858 | ||
|
|
031cbecf86 | ||
|
|
1213e6c3c2 | ||
|
|
32619893b4 | ||
|
|
40e0de0395 | ||
|
|
5f9345a2f0 | ||
|
|
33ccde59a1 | ||
|
|
1909df070f | ||
|
|
c23a745820 | ||
|
|
924b117422 | ||
|
|
24b2806097 | ||
|
|
99f5093347 | ||
|
|
be88529753 | ||
|
|
b3a959a337 | ||
|
|
2928cb4c82 | ||
|
|
a33e6702a0 | ||
|
|
35a65e814b | ||
|
|
7ad132b133 | ||
|
|
2708813166 | ||
|
|
affe98998a | ||
|
|
66e8211c0b | ||
|
|
dd2dee60f3 | ||
|
|
6495179af6 | ||
|
|
61b8c79d15 | ||
|
|
42aa3ec4f2 | ||
|
|
bb152dae8f | ||
|
|
c42ab44087 | ||
|
|
42e10c3fd6 | ||
|
|
c571a3e984 | ||
|
|
e55988bb60 | ||
|
|
34b5ba3b60 | ||
|
|
629ac4b4ca | ||
|
|
75f0bc4f44 | ||
|
|
71a2440ee5 | ||
|
|
04e40739f7 | ||
|
|
48bcdad0d5 | ||
|
|
f7d2402cab | ||
|
|
808f55351a | ||
|
|
c06271bc35 | ||
|
|
92e5882aca | ||
|
|
afa0580cd5 | ||
|
|
4baee3031c | ||
|
|
db7a72b224 | ||
|
|
b71e69ad8e | ||
|
|
f856173c43 | ||
|
|
d742f9ebbd | ||
|
|
36dd4cba3d | ||
|
|
3978429ad5 | ||
|
|
885945d6e1 | ||
|
|
e22e770147 | ||
|
|
e0c0203341 | ||
|
|
e1eec61e26 | ||
|
|
296fa128c9 | ||
|
|
6dde222aae | ||
|
|
391ac37018 | ||
|
|
8d038a08fb | ||
|
|
747c6ffda4 | ||
|
|
d4cddc54f0 | ||
|
|
eb7112c18e | ||
|
|
fef9e07930 | ||
|
|
8ab27e6ef7 | ||
|
|
6415055590 | ||
|
|
556e27b14f | ||
|
|
af0c009d70 | ||
|
|
0b1cf4a139 | ||
|
|
a9101cdcaa | ||
|
|
e351e2a7cf | ||
|
|
215276243d | ||
|
|
ddb7832852 | ||
|
|
2fad41d155 | ||
|
|
b9c3d9168f | ||
|
|
4f2fc3c2dd | ||
|
|
48819f4d54 | ||
|
|
b0cbdd3eba | ||
|
|
5016107550 | ||
|
|
25d5d15fd5 | ||
|
|
725713f74a | ||
|
|
73eb0972cf | ||
|
|
6720779c7e | ||
|
|
b2a2c6af2a | ||
|
|
272993bac4 | ||
|
|
58532ae047 | ||
|
|
4e7f6d380d | ||
|
|
f0be325f88 | ||
|
|
b66af23aa9 | ||
|
|
29d0c13e97 | ||
|
|
8a4e81a269 | ||
|
|
843fc7b681 | ||
|
|
6dcb6bf1c1 | ||
|
|
1061c3cb3c | ||
|
|
0d0f15d8d1 | ||
|
|
a72ce94213 | ||
|
|
f71d59c70e | ||
|
|
3309f8313c | ||
|
|
6cc5f194a7 | ||
|
|
096327a99a | ||
|
|
cc10bcf25e | ||
|
|
875ac0ec00 | ||
|
|
bf240f063a | ||
|
|
dd016b0570 | ||
|
|
244788464a | ||
|
|
a95808334e | ||
|
|
b3cebd5acf | ||
|
|
7b775145e4 | ||
|
|
7183aa6b9d | ||
|
|
eebefe35e7 | ||
|
|
1db0bbdc76 | ||
|
|
e643112dd8 | ||
|
|
21c4b25959 | ||
|
|
41cf2c3aef | ||
|
|
0e3a930fb4 | ||
|
|
0c214e0153 | ||
|
|
6c61cfbe03 | ||
|
|
2ee77d36a0 | ||
|
|
24f441e0bb | ||
|
|
740da44f20 | ||
|
|
72033fde7b | ||
|
|
9adf3fcf9a | ||
|
|
65f7456652 | ||
|
|
8794569a08 | ||
|
|
f8731bc2fd | ||
|
|
195d6bf760 | ||
|
|
dacd94b9c8 | ||
|
|
8070cb5f87 | ||
|
|
f7d514f449 | ||
|
|
6d50bce79f | ||
|
|
3cf0a38b3e | ||
|
|
91a1d08a4c | ||
|
|
85e776885b | ||
|
|
fc4015329f | ||
|
|
6ec9ff83f3 | ||
|
|
db45308477 | ||
|
|
1c7c69a8a5 | ||
|
|
24ad061037 | ||
|
|
92f96fa721 | ||
|
|
0d1e362363 | ||
|
|
a0bf2c86ab | ||
|
|
6a662a45f3 | ||
|
|
24d0524f31 | ||
|
|
c081817c95 | ||
|
|
46a1f2487e | ||
|
|
ac02a4b68a | ||
|
|
4ba063d3c5 | ||
|
|
e0e0818e4b | ||
|
|
82a5049f6a | ||
|
|
d027b75b73 | ||
|
|
87421d3fc5 | ||
|
|
87d14a3625 | ||
|
|
cc0931e36b | ||
|
|
22152d6885 | ||
|
|
102bcbce8d | ||
|
|
8655de423d | ||
|
|
c4b2eb24b3 | ||
|
|
03e3fbb702 | ||
|
|
bc7ee385f5 | ||
|
|
1e368ab08f | ||
|
|
2c77c5c8db | ||
|
|
1eb38c563f | ||
|
|
fa657871ed | ||
|
|
09dac71a45 | ||
|
|
be70b3adce | ||
|
|
6d12b1f82b | ||
|
|
7116a41129 | ||
|
|
7143acab25 | ||
|
|
11d4086d8e | ||
|
|
32cd1da62e | ||
|
|
d430f56de6 | ||
|
|
957ebe98fb | ||
|
|
9d09fc8485 | ||
|
|
8ea4531718 | ||
|
|
881611678e | ||
|
|
a3dc628d86 | ||
|
|
3c159fc1a5 | ||
|
|
6056afd223 | ||
|
|
54db796991 | ||
|
|
119e912a83 | ||
|
|
f4a4a0fdc7 | ||
|
|
9ad765173f | ||
|
|
c8e3c1a9b5 | ||
|
|
ae378b769a | ||
|
|
4de4e35459 | ||
|
|
5537a83e56 | ||
|
|
c850d322a6 | ||
|
|
b8be571868 | ||
|
|
acd43bf38c | ||
|
|
5eaf173647 | ||
|
|
7890b562bc | ||
|
|
7258d33794 | ||
|
|
263979a2a3 | ||
|
|
2c6d83354d | ||
|
|
a188fc01fe | ||
|
|
1948f9e042 | ||
|
|
f7ffc3a6c9 | ||
|
|
4d6af5c5d2 | ||
|
|
efed63d783 | ||
|
|
7e351bb560 | ||
|
|
0067580321 | ||
|
|
82e0073624 | ||
|
|
7e541b1a7f | ||
|
|
2ae47ddbc2 | ||
|
|
3e8b8b8990 | ||
|
|
05bbbe9204 | ||
|
|
a073129293 | ||
|
|
93fc0e0e40 | ||
|
|
84f1c14396 | ||
|
|
f10986bab4 | ||
|
|
6cb5746b65 | ||
|
|
0061aa9f32 | ||
|
|
3926bbcf6d | ||
|
|
b5cee977c2 | ||
|
|
ae3b60ba99 | ||
|
|
d4ba6424a1 | ||
|
|
92a97e52a0 | ||
|
|
78dcaa0609 | ||
|
|
65b4c34d86 | ||
|
|
d8486c312c | ||
|
|
8d4baaf2f0 | ||
|
|
50fb940f05 | ||
|
|
63e3676e68 | ||
|
|
1dac2cae68 | ||
|
|
d886975835 | ||
|
|
22872a5363 | ||
|
|
82b6b541b1 | ||
|
|
60a989a76e | ||
|
|
18394ed50f | ||
|
|
3416d11926 | ||
|
|
c1f1a03d0c | ||
|
|
278a447ee8 | ||
|
|
8ceee689c7 | ||
|
|
356f164f52 | ||
|
|
203ef9988c | ||
|
|
9f51bdae00 | ||
|
|
59c4f46f0f | ||
|
|
f9ab6255e7 | ||
|
|
a89b665b9b | ||
|
|
a7949b8da3 | ||
|
|
b0b4adc3af | ||
|
|
6e19895972 | ||
|
|
d24f1cbf35 | ||
|
|
b8febed96a | ||
|
|
82687bb4c3 | ||
|
|
6506b7754a | ||
|
|
2eb8e5e62a | ||
|
|
c713a4c04d | ||
|
|
0cefa0f942 | ||
|
|
834c85ef0c | ||
|
|
0c8c8eab58 | ||
|
|
bc06baca76 | ||
|
|
9eeb779e8f | ||
|
|
fe171f9c3e | ||
|
|
5e613d5411 | ||
|
|
56e930eb03 | ||
|
|
4a052f0bb9 | ||
|
|
f34e79f27b | ||
|
|
ef1fe9094c | ||
|
|
c25e8ee9b3 | ||
|
|
4525a048ec | ||
|
|
f421a52f56 | ||
|
|
17a79eec0c | ||
|
|
1eda14b44f | ||
|
|
aa9b502619 | ||
|
|
aaf45e6464 | ||
|
|
be83c31cdd | ||
|
|
76a41eec2b | ||
|
|
ab9c0ec9fc | ||
|
|
cf6a1dea19 | ||
|
|
ea5b3f5e62 | ||
|
|
c3c658e1c0 | ||
|
|
5d013b6b32 | ||
|
|
ee91323f52 | ||
|
|
4fae868811 | ||
|
|
354f92d66a | ||
|
|
c3484e0268 | ||
|
|
6b0be9c73d | ||
|
|
02312a91ca | ||
|
|
744f6b648e | ||
|
|
f1502a491e | ||
|
|
b70871b675 | ||
|
|
9de450b545 | ||
|
|
cc53036744 | ||
|
|
4610d8dc00 | ||
|
|
5d7dfefe82 | ||
|
|
5e8e7054f7 | ||
|
|
9a542ea01d | ||
|
|
1939f83709 | ||
|
|
b7c114f044 | ||
|
|
ede1351997 | ||
|
|
7786ed6a64 | ||
|
|
bdd08277b8 | ||
|
|
2bf4faa7e4 | ||
|
|
2e5e604b0c | ||
|
|
ed4cd027f3 | ||
|
|
bab19a2ac2 | ||
|
|
582eb96d15 | ||
|
|
2649ce1ebc | ||
|
|
7070cdba4e | ||
|
|
e885de28b1 | ||
|
|
3038649ab2 | ||
|
|
3e4da3f7cb | ||
|
|
53b5d04715 | ||
|
|
defede6080 | ||
|
|
1472f1427e | ||
|
|
00d1ecb1da | ||
|
|
739e0e934a | ||
|
|
6ae9770d34 | ||
|
|
bec7184768 | ||
|
|
442ac8d259 | ||
|
|
657b02d0cf | ||
|
|
b50ef8b216 | ||
|
|
1b690c1a8b | ||
|
|
2873a53f5f | ||
|
|
04a781e844 | ||
|
|
68be98d1a6 | ||
|
|
0bbbadf3f5 | ||
|
|
c0c1ce125a | ||
|
|
105861186f | ||
|
|
4a9d335bb4 | ||
|
|
162f1e08f8 | ||
|
|
0484ff5ec1 | ||
|
|
4acc2fed6c | ||
|
|
0369804ffa | ||
|
|
33d7b5ec07 | ||
|
|
4b38f35e72 | ||
|
|
82c2773423 | ||
|
|
ded27f709c | ||
|
|
30dc3e112b | ||
|
|
371b262f96 | ||
|
|
b3fb2492d5 | ||
|
|
93b810637b | ||
|
|
cc62974182 | ||
|
|
9413788571 | ||
|
|
e8387db0c4 | ||
|
|
81f28ca567 | ||
|
|
1b32943215 | ||
|
|
a231d99d4c | ||
|
|
714044cc03 | ||
|
|
5598b99fb3 | ||
|
|
6899d9bbf6 | ||
|
|
cf876a9893 | ||
|
|
8b8a2928af | ||
|
|
031774468c | ||
|
|
dd28d12add | ||
|
|
6c61ee8fe3 | ||
|
|
b86ebb55ff | ||
|
|
66956eaba3 | ||
|
|
444ff35029 | ||
|
|
ff2549be1d | ||
|
|
2557c6a812 | ||
|
|
aae48de0f7 | ||
|
|
766708f24b | ||
|
|
fbeb4a9d15 | ||
|
|
24fc4f656c | ||
|
|
c3c3b28818 | ||
|
|
06e2670a57 | ||
|
|
3798a4d059 | ||
|
|
5b8246d6eb | ||
|
|
2e24bc421d | ||
|
|
f244ed3ed2 | ||
|
|
50a095ed16 | ||
|
|
37aff2199e | ||
|
|
309aa5fbf3 | ||
|
|
5f40948714 | ||
|
|
c22050be29 | ||
|
|
54ca55fd81 | ||
|
|
d0e79d7e2c | ||
|
|
c1003dfd15 | ||
|
|
98809a1458 | ||
|
|
ccc3df8c33 | ||
|
|
593a6dbe19 | ||
|
|
efbe446f1a | ||
|
|
725745d105 | ||
|
|
c0e94f8292 | ||
|
|
ef4bd0167c | ||
|
|
7a8a3ef4f6 | ||
|
|
98c7b0367d | ||
|
|
9e5dea0ffd | ||
|
|
cb4823fdd6 | ||
|
|
17bb051628 | ||
|
|
59f44e810b | ||
|
|
7a014dceb6 | ||
|
|
1ff44a99a4 | ||
|
|
6cf61614e4 | ||
|
|
82e448b92b | ||
|
|
b172352b52 | ||
|
|
95b14fd803 | ||
|
|
553d2e3280 | ||
|
|
82fb4ee89d | ||
|
|
389fef6c9c | ||
|
|
b6622f9623 | ||
|
|
7f5448e3a8 | ||
|
|
5d965f0783 | ||
|
|
b14713c231 | ||
|
|
637e0ba420 | ||
|
|
9ac37cb018 | ||
|
|
fb7751b44f | ||
|
|
e333a8d673 | ||
|
|
89a6daac00 | ||
|
|
7e42945918 | ||
|
|
b61a87b26c | ||
|
|
2c6b141931 | ||
|
|
af13c50d51 | ||
|
|
65c2397fce | ||
|
|
16e7efe3c8 | ||
|
|
c2b78c31d6 | ||
|
|
a1dc0336dd | ||
|
|
d99a35f275 | ||
|
|
949fbf073a | ||
|
|
6156be4da3 | ||
|
|
d7d4325655 | ||
|
|
9f81ffe433 | ||
|
|
8164930816 | ||
|
|
2a8834cf89 | ||
|
|
e6e11f4ec3 | ||
|
|
452e41562c | ||
|
|
8c6dd96aed | ||
|
|
23a4ccd178 | ||
|
|
2b4d877a27 | ||
|
|
d916f92d6f | ||
|
|
b9b5134e19 | ||
|
|
9ef6fdab63 | ||
|
|
3a0b6de4d0 | ||
|
|
08896dc0bd | ||
|
|
ef62799783 | ||
|
|
8196257f00 | ||
|
|
ac923d3377 | ||
|
|
0ec529ac82 | ||
|
|
d5b0c872d8 | ||
|
|
2e8026b65a | ||
|
|
381a9f04a0 | ||
|
|
d7050b4424 | ||
|
|
91ca332058 | ||
|
|
ff095a8ac8 | ||
|
|
ae37f9f3a2 | ||
|
|
95d66bd867 | ||
|
|
6d73e9d8e8 | ||
|
|
fb5a4bbaa7 | ||
|
|
d402f6b66f | ||
|
|
36a38a7a27 | ||
|
|
2a4dc7e505 | ||
|
|
4e92353d23 | ||
|
|
0badc909ae | ||
|
|
3cc52ee97a | ||
|
|
822da9ccc3 | ||
|
|
96e20179e4 | ||
|
|
1dfa26bd84 | ||
|
|
9e6c97703c | ||
|
|
a0f6e0c1e7 | ||
|
|
edaa7a599a | ||
|
|
3b95629db1 | ||
|
|
afff063a14 | ||
|
|
e1246e1ad7 | ||
|
|
df0b451d91 | ||
|
|
07cb0a82d1 | ||
|
|
f2671f8ac4 | ||
|
|
43e9e1a160 | ||
|
|
d0969d24cf | ||
|
|
cf51a0dccb | ||
|
|
48b30bf0e2 | ||
|
|
17b08b6a64 | ||
|
|
197ab47bdd | ||
|
|
e8cce0babe | ||
|
|
11d655ef40 | ||
|
|
1da61e8051 | ||
|
|
da6ce18279 | ||
|
|
98f43a173b | ||
|
|
c202eda634 | ||
|
|
f78bcb8945 | ||
|
|
2a918d4cc0 | ||
|
|
2c83b24cad | ||
|
|
e75445f688 | ||
|
|
df51d79ec4 | ||
|
|
c21a427a14 | ||
|
|
c6e4ef2c6e | ||
|
|
6450908a35 | ||
|
|
a91cb2103d | ||
|
|
3acd3158e9 | ||
|
|
8a04c6f894 | ||
|
|
745565c69f | ||
|
|
fbc4a24633 | ||
|
|
4775a89760 | ||
|
|
3008a7d819 | ||
|
|
233f758523 | ||
|
|
3af16cf694 | ||
|
|
985b5ee735 | ||
|
|
4df7ade829 | ||
|
|
932858d5f9 | ||
|
|
c4b3503b4b | ||
|
|
f871545f7f | ||
|
|
136b5dc7c7 | ||
|
|
759b287f15 | ||
|
|
5fffb5b3d9 | ||
|
|
17620eec4c | ||
|
|
059230b320 | ||
|
|
19dac35e5f | ||
|
|
f5fe2a9f6c | ||
|
|
d36e9d160b | ||
|
|
e58e78cab2 | ||
|
|
b0080e3817 | ||
|
|
4d67d79273 | ||
|
|
83ece9f028 | ||
|
|
cec136c30d | ||
|
|
ded8aff2c8 | ||
|
|
76a268a43f | ||
|
|
6563b02980 | ||
|
|
32d4496c1e | ||
|
|
0b26e53c59 | ||
|
|
7cf69ed544 | ||
|
|
8b634ba029 | ||
|
|
526228b78e | ||
|
|
34d01a3b20 | ||
|
|
856f3005de | ||
|
|
6e2a14002e | ||
|
|
7852c6b075 | ||
|
|
2c5f3606d1 | ||
|
|
1649489834 | ||
|
|
b51291cba8 | ||
|
|
b29b576957 | ||
|
|
abe389fd28 | ||
|
|
e7e7f5de4b | ||
|
|
3dfa7416cd | ||
|
|
d733ef7a69 | ||
|
|
17e01d24bb | ||
|
|
f67f815624 | ||
|
|
ab8fe43fa2 | ||
|
|
5e4c2225ed | ||
|
|
167d2a1411 | ||
|
|
3f4802a14e | ||
|
|
9aecc3e5ff | ||
|
|
b8a4a5bcba | ||
|
|
6daac534d7 | ||
|
|
79649d380e | ||
|
|
51ebaa9f82 | ||
|
|
efaa569c3b | ||
|
|
15684f58c2 | ||
|
|
0e6c24ae4b | ||
|
|
0dc1b3c1fb | ||
|
|
1e53b797f6 | ||
|
|
1ddf691244 | ||
|
|
78074baadd | ||
|
|
7457642b8c | ||
|
|
d1e107702b | ||
|
|
19503ca653 | ||
|
|
14089b1d0f | ||
|
|
0b8eca58b9 | ||
|
|
c2f425a06a | ||
|
|
4930f8bbd9 | ||
|
|
a5668db68b | ||
|
|
996b80f990 | ||
|
|
1998f60546 | ||
|
|
13a4808ca4 | ||
|
|
a176be48a2 | ||
|
|
f47bce27e3 | ||
|
|
f86d65110d | ||
|
|
4730ea8a38 | ||
|
|
3e82dfdf2d | ||
|
|
b7d0d35a13 | ||
|
|
e12ceb2c92 | ||
|
|
e8d23950a0 | ||
|
|
d7c86198d9 | ||
|
|
76428da729 | ||
|
|
6bf4ca0840 | ||
|
|
efa59b8d59 | ||
|
|
e1a2bfaaa6 | ||
|
|
48f48d96ce | ||
|
|
085cb7cac0 | ||
|
|
9874ff33c3 | ||
|
|
73cfd9cce9 | ||
|
|
3166d16f06 | ||
|
|
26b82246b1 | ||
|
|
277ba3ebd2 | ||
|
|
3e9b2042d9 | ||
|
|
5d577d7eb0 | ||
|
|
05ee0523c1 | ||
|
|
43f392c9a1 | ||
|
|
01cb2049e3 | ||
|
|
a224fe14e9 | ||
|
|
00d5a5ff55 | ||
|
|
420312cec5 | ||
|
|
3c17fa3325 | ||
|
|
e3424084a0 | ||
|
|
d9a55422c7 | ||
|
|
374941f727 | ||
|
|
caeb429055 | ||
|
|
b00c36e366 | ||
|
|
1f9a128519 | ||
|
|
18df6b30b1 | ||
|
|
0d399f97dd | ||
|
|
3fdc2c906d | ||
|
|
a78ded0b61 | ||
|
|
0a629ddbd6 | ||
|
|
353cb367e4 | ||
|
|
6252f3bc7c | ||
|
|
4e319926d7 | ||
|
|
e4f456918f | ||
|
|
c342341ea1 | ||
|
|
9d396bee8e | ||
|
|
a9427c2536 | ||
|
|
7a746ecf3e | ||
|
|
aca8bf43ce | ||
|
|
7de0df694f | ||
|
|
15d3cd4680 | ||
|
|
da4fb3cb39 | ||
|
|
e10051ef3f | ||
|
|
c60dca1f95 | ||
|
|
188abf7e2a | ||
|
|
f021b7cca6 | ||
|
|
c126b73a4a | ||
|
|
3f03b3569d | ||
|
|
07dd3bfcd4 | ||
|
|
37afdc953e | ||
|
|
044855e146 | ||
|
|
12379c82ba | ||
|
|
be98d6b9ad | ||
|
|
910b484975 | ||
|
|
1fde5b65c6 | ||
|
|
c40bc0b11f | ||
|
|
7a0c01b41a | ||
|
|
6fe9c925d2 | ||
|
|
1ebdc48d5a | ||
|
|
395a6c69bd | ||
|
|
0d658ddf25 | ||
|
|
cefa7ce284 | ||
|
|
ee4041b8bd | ||
|
|
a17f351b56 | ||
|
|
4fcf8d8b07 | ||
|
|
b7650eb21e | ||
|
|
69120ad199 | ||
|
|
1eee8a4226 | ||
|
|
98448a53c8 | ||
|
|
241d088156 | ||
|
|
a22a8dd7dd | ||
|
|
e26ad0c4fd | ||
|
|
6e7559ac7f | ||
|
|
9feda63955 | ||
|
|
1ed81ff731 | ||
|
|
b2dc2e6dac | ||
|
|
1b787fc04c | ||
|
|
9a6401acdf | ||
|
|
c40fcc1e40 | ||
|
|
f908ca4db4 | ||
|
|
72f6453c48 | ||
|
|
eca7b90771 | ||
|
|
7eb90ccefb | ||
|
|
6ed534782f | ||
|
|
1ee27238f7 | ||
|
|
59689735a6 | ||
|
|
1be16287ee | ||
|
|
9fe4b73d97 | ||
|
|
73cb37295d | ||
|
|
1f35508ae6 | ||
|
|
3e2a74c294 | ||
|
|
a34922c476 | ||
|
|
84be7091fd | ||
|
|
f82c1f0dd8 | ||
|
|
dc0cb7e74f | ||
|
|
ab31dbc482 | ||
|
|
36e9d3ee91 | ||
|
|
cc8c0f6b46 | ||
|
|
3eac70a356 | ||
|
|
5f3ad8f82c | ||
|
|
367316c723 | ||
|
|
d34353cc91 | ||
|
|
6287fa5396 | ||
|
|
a00c3c4019 | ||
|
|
f4677b7960 | ||
|
|
92308905dd | ||
|
|
6f32fc5c4e | ||
|
|
e607e731eb | ||
|
|
f17c45611e | ||
|
|
1ff7b6492b | ||
|
|
20900d6801 | ||
|
|
4b253d904d | ||
|
|
a51c8c64e0 | ||
|
|
c153422388 | ||
|
|
7f065cfdbd | ||
|
|
667fbc0847 | ||
|
|
6ba7bd5697 | ||
|
|
2cad035c01 | ||
|
|
2a76c68842 | ||
|
|
1b00f4bc37 | ||
|
|
be62eb6d93 | ||
|
|
5f3878f1e3 | ||
|
|
a523e997d3 | ||
|
|
fe43caa4a4 | ||
|
|
792e614144 | ||
|
|
ce2b87d88a | ||
|
|
f092a073a7 | ||
|
|
6fa4cd7136 | ||
|
|
505ed2b076 | ||
|
|
cef3e62d2b | ||
|
|
40ea9ff9e8 | ||
|
|
a97a6b03bc | ||
|
|
516f76fd2c | ||
|
|
5a02ac6e5b | ||
|
|
14d4074ee1 | ||
|
|
d9f16c405c | ||
|
|
bfc6482a7a | ||
|
|
5aa032033e | ||
|
|
2d59f9938f | ||
|
|
c0ce8fe755 | ||
|
|
55eff40084 | ||
|
|
e5a251843d | ||
|
|
fe46b0de29 | ||
|
|
a581439bb1 | ||
|
|
a43337e8c4 | ||
|
|
33c51ec143 | ||
|
|
448da15fbf | ||
|
|
a1bb2d6c2f | ||
|
|
81dde5e8fe | ||
|
|
b84e441861 | ||
|
|
08e012bbec | ||
|
|
b46acc392b | ||
|
|
28af6367b8 | ||
|
|
2c17b493b1 | ||
|
|
ea725a66c9 | ||
|
|
1532493dab | ||
|
|
3795297af8 | ||
|
|
33fd33d423 | ||
|
|
4e98f8863f | ||
|
|
582ef3dbdb | ||
|
|
6a933782fa | ||
|
|
d1c2778e93 | ||
|
|
8d64abacc6 | ||
|
|
9af6802943 | ||
|
|
c10f53a897 | ||
|
|
2124e869a8 | ||
|
|
3b668eedda | ||
|
|
7471431322 | ||
|
|
1542de4eed | ||
|
|
b6c2bffbdf | ||
|
|
ff09931e22 | ||
|
|
155c70b882 | ||
|
|
7c49452973 | ||
|
|
312539ae9f | ||
|
|
cc40dcce58 | ||
|
|
5790921aea | ||
|
|
df84c11407 | ||
|
|
b76306c983 | ||
|
|
cdffc716c9 | ||
|
|
5dffc13f55 | ||
|
|
a5873a8d3d | ||
|
|
4db3e88459 | ||
|
|
ab073bad4f | ||
|
|
cfe04f607d | ||
|
|
c0e9f540e0 | ||
|
|
7c97aacbe8 | ||
|
|
36b8f87566 | ||
|
|
d875413a0b | ||
|
|
155ad6d219 | ||
|
|
138f20433e | ||
|
|
7747c67861 | ||
|
|
237a6f06b6 | ||
|
|
fe99beb82a | ||
|
|
736a77f275 | ||
|
|
94539213a1 | ||
|
|
c5c4246319 | ||
|
|
2e6d8a8991 | ||
|
|
e852835da6 | ||
|
|
d245c32529 | ||
|
|
964d58bcb0 | ||
|
|
52702f6f92 | ||
|
|
05794d983f | ||
|
|
364f36f851 | ||
|
|
9b809d6278 | ||
|
|
bbefea3387 | ||
|
|
d83dde6180 | ||
|
|
63e1319d0f | ||
|
|
8067d34b3a | ||
|
|
e3f2860e73 | ||
|
|
92eb44d238 | ||
|
|
f4179bead4 | ||
|
|
fced277486 | ||
|
|
3d1be455ce | ||
|
|
dee4d129cb | ||
|
|
0067bd77a8 | ||
|
|
d98904e5a7 | ||
|
|
96a259e81e | ||
|
|
59f3477b82 | ||
|
|
f947b818bf | ||
|
|
3fa1a444ce | ||
|
|
a2dc9b6be2 | ||
|
|
16349eeceb | ||
|
|
aecf1c1f96 | ||
|
|
4ea574fdf3 | ||
|
|
cf8115deb0 | ||
|
|
d25cbda074 | ||
|
|
5d582fd516 | ||
|
|
8ec86dcf04 | ||
|
|
6d3b70c8da | ||
|
|
0a4fda742b | ||
|
|
3745e57bf9 | ||
|
|
b7e7aa00de | ||
|
|
1098fd48ce | ||
|
|
393906d9be | ||
|
|
446881468c | ||
|
|
cfb95ba9f6 | ||
|
|
c198c26226 | ||
|
|
54d6ddba69 | ||
|
|
1af12ff1d1 | ||
|
|
bd72b8eca6 | ||
|
|
200d00c854 | ||
|
|
669b912dea | ||
|
|
36a4a67b2b | ||
|
|
3413424f01 | ||
|
|
80fc840d89 | ||
|
|
6455100f7a | ||
|
|
b7c8b4fc95 | ||
|
|
f58d0f70b6 | ||
|
|
8f59c61d1d | ||
|
|
fd43ae3fe4 | ||
|
|
cdd0f3b328 | ||
|
|
f9f6f0e9f0 | ||
|
|
405f382144 | ||
|
|
a750273546 | ||
|
|
ddc5f6f328 | ||
|
|
4231b356aa | ||
|
|
df1f7b4b02 | ||
|
|
0b7545b239 | ||
|
|
3a72137211 | ||
|
|
e5d289cc03 | ||
|
|
0ff3766b0e | ||
|
|
3562202306 | ||
|
|
2bf4b96aef | ||
|
|
811e08a2c5 | ||
|
|
dd6e90465d | ||
|
|
a86c626802 | ||
|
|
705c3dec2c | ||
|
|
4afcee8b4b | ||
|
|
9627017f9c | ||
|
|
e0f6c15418 | ||
|
|
ecc20b75f8 | ||
|
|
540e455e3a | ||
|
|
14748adb09 | ||
|
|
ff2ab9e6bb | ||
|
|
cc5cc3bb8f | ||
|
|
1f3206216b | ||
|
|
f113bb9f4e | ||
|
|
4681147bb3 | ||
|
|
52c3f232e4 | ||
|
|
3dc466424e | ||
|
|
353415cc81 | ||
|
|
1a12ce8ea5 | ||
|
|
0278e15fa3 | ||
|
|
f01f085cb9 | ||
|
|
bca68e90cc | ||
|
|
a3f67ec18d | ||
|
|
56ef1cbc40 | ||
|
|
a1411093f0 | ||
|
|
f35f7d9fbb | ||
|
|
dfbf646ac4 | ||
|
|
591371566e | ||
|
|
5799b72178 | ||
|
|
1cfe6842d5 | ||
|
|
f4c98a6a3d | ||
|
|
4aefb1dd98 | ||
|
|
aa03989791 | ||
|
|
a865b2c320 | ||
|
|
694ce314a8 | ||
|
|
94299a36a6 | ||
|
|
3aaeb5c1e5 | ||
|
|
80ec6cc806 | ||
|
|
3d83320279 | ||
|
|
4ab252d198 | ||
|
|
058ffd7623 | ||
|
|
0330a13aea | ||
|
|
467325b81d | ||
|
|
00f716bbe6 | ||
|
|
2f2f032497 | ||
|
|
feb200bbb3 | ||
|
|
3894667036 | ||
|
|
203ac694e3 | ||
|
|
bb592c75e7 | ||
|
|
777d717c40 | ||
|
|
143d84590f | ||
|
|
a29669d78d | ||
|
|
e5be1e1696 | ||
|
|
9e47c34729 | ||
|
|
cb896f8923 | ||
|
|
cec9bce126 | ||
|
|
3f79793b7e | ||
|
|
0d01d8a735 | ||
|
|
2c0fa03dc6 | ||
|
|
d3b3a6d389 | ||
|
|
fc260b09a1 | ||
|
|
b3c79a8a27 | ||
|
|
f0ecefc0c0 | ||
|
|
b0118409a9 | ||
|
|
5f23288692 | ||
|
|
45c58c7d10 | ||
|
|
112591be76 | ||
|
|
1b8daa3693 | ||
|
|
1cdbc755ee | ||
|
|
aa9c7e4b8c | ||
|
|
6be69a168f | ||
|
|
eaf76feeb6 | ||
|
|
03e79ed05e | ||
|
|
56bef2df4f | ||
|
|
10d3886c51 | ||
|
|
f1c0cf5b70 | ||
|
|
2a7ac69ee4 | ||
|
|
d13ea8e184 | ||
|
|
1820b04bb2 | ||
|
|
439b7ef463 | ||
|
|
a25fb95bd6 | ||
|
|
6168067160 | ||
|
|
c3031a4610 | ||
|
|
1099a94063 | ||
|
|
812d8a176c | ||
|
|
db533c96e3 | ||
|
|
8831eb7624 | ||
|
|
3c8f315021 | ||
|
|
0f2e636602 | ||
|
|
98bd148b1a | ||
|
|
292248b8c2 | ||
|
|
d3eef3e5af | ||
|
|
c5fbf8c1ba | ||
|
|
1ed2d8f512 | ||
|
|
d140890259 | ||
|
|
eb492df2bb | ||
|
|
2c16e78400 | ||
|
|
bf2b87aea3 | ||
|
|
1dff425999 | ||
|
|
501af5ba89 | ||
|
|
31d6e7b7ba | ||
|
|
b983322bfb | ||
|
|
339654e163 | ||
|
|
5ca48cc853 | ||
|
|
79996e3335 | ||
|
|
173acc185c | ||
|
|
a985ecdd17 | ||
|
|
fb4c24b6e7 | ||
|
|
1366f6b9bd | ||
|
|
e13546f739 | ||
|
|
d6c813daff | ||
|
|
e3818a4c4b | ||
|
|
415fe2abe9 | ||
|
|
5bbdaaf4b7 | ||
|
|
bf1f1a5759 | ||
|
|
8e42429c9d | ||
|
|
c43c2285f6 | ||
|
|
94b2c29f9d | ||
|
|
090f931a35 | ||
|
|
6b8be6da76 | ||
|
|
7ec2d392e7 | ||
|
|
e88f66bb49 | ||
|
|
28a2759ab8 | ||
|
|
3edad44d6e | ||
|
|
9e7459fc5d | ||
|
|
b98f5ef42b | ||
|
|
a6d4f79f24 | ||
|
|
efcb7a75fc | ||
|
|
30aa23fea2 | ||
|
|
c9e045041e | ||
|
|
fd6fa9c0b2 | ||
|
|
9f70d09275 | ||
|
|
3fb0f01001 | ||
|
|
216ac24bd3 | ||
|
|
2035af2091 | ||
|
|
19398a175a | ||
|
|
fa369ddbe7 | ||
|
|
294ba3c282 | ||
|
|
2923e91a98 | ||
|
|
7c52b7706f | ||
|
|
ddec587581 | ||
|
|
4f466f8e81 | ||
|
|
1502cda142 | ||
|
|
ce2b5d7574 | ||
|
|
f1c65db80b | ||
|
|
496970b233 | ||
|
|
3b0e61a812 | ||
|
|
e84b0d709b | ||
|
|
16241f0ea4 | ||
|
|
518af4e3ae | ||
|
|
fe01f90a1c | ||
|
|
99a376df16 | ||
|
|
831ffcb705 | ||
|
|
5f297c4504 | ||
|
|
d7623ff9f3 | ||
|
|
df9b5405e8 | ||
|
|
180eb5b3c2 | ||
|
|
af7d49aaff | ||
|
|
187b655bc2 | ||
|
|
8612cb9239 | ||
|
|
b2f3fafa6a | ||
|
|
483dab147d | ||
|
|
f39b8e697c | ||
|
|
7d610299c9 | ||
|
|
25550b2dd4 | ||
|
|
5c676c47cd | ||
|
|
e77f9d5e78 | ||
|
|
9c04747623 | ||
|
|
e66deb6817 | ||
|
|
cc9a645a02 | ||
|
|
18fb9d807e | ||
|
|
a1cc568288 | ||
|
|
2ea3cd8abc | ||
|
|
095db72024 | ||
|
|
11eb172b6e | ||
|
|
4b60f4b175 | ||
|
|
0794f3a798 | ||
|
|
2b8e7b5061 | ||
|
|
6f57311da0 | ||
|
|
98b09d3949 | ||
|
|
231a737a82 | ||
|
|
236860735e | ||
|
|
ac1ef7ec72 | ||
|
|
5f761514e1 | ||
|
|
32f1f622f6 | ||
|
|
5f95651316 | ||
|
|
ccac657556 | ||
|
|
a9c23ea079 | ||
|
|
33ffe2a7f7 | ||
|
|
7c717aafc6 | ||
|
|
225aeb171e | ||
|
|
ffe181c366 | ||
|
|
fd4e79a9ed | ||
|
|
299e174d2d | ||
|
|
ce62fc6eae | ||
|
|
43490dfb89 | ||
|
|
a523276786 | ||
|
|
074471ab0c | ||
|
|
d761421e1d | ||
|
|
2339c5d722 | ||
|
|
dd00266757 | ||
|
|
bb99ce5f80 | ||
|
|
49f42ec0f6 | ||
|
|
91d509f0d9 | ||
|
|
d5e858c55f | ||
|
|
fb8fcce2ac | ||
|
|
d4736ae701 | ||
|
|
3e1158522a | ||
|
|
57191f86d9 | ||
|
|
0a89c575de | ||
|
|
4c860910df | ||
|
|
0fc3d51b7d | ||
|
|
c4b0d7879e | ||
|
|
aab1ec3f36 | ||
|
|
fbfa11fb29 | ||
|
|
284498fcef | ||
|
|
07d9808496 | ||
|
|
4ab0088bfe | ||
|
|
3bd1690bfb | ||
|
|
29f4b05954 | ||
|
|
48ca0c99b2 | ||
|
|
015052cf7b | ||
|
|
9ce3ee47ba | ||
|
|
2e3fd54337 | ||
|
|
625782f7ee | ||
|
|
1c90899eef | ||
|
|
4f2b7d48b1 | ||
|
|
458c3900e1 | ||
|
|
ba75b4e750 | ||
|
|
ab011d51be | ||
|
|
898d9b1a87 | ||
|
|
4f9a9d2b79 | ||
|
|
346f2f93e1 | ||
|
|
25b0e072dd | ||
|
|
dc13c882fb | ||
|
|
12a52467c8 | ||
|
|
22e6c73dcc | ||
|
|
53b9696f3f | ||
|
|
7e4fe4662b | ||
|
|
18fd413f37 | ||
|
|
80ed5f84de | ||
|
|
b48111df7c | ||
|
|
73e3edd70d | ||
|
|
d4cfbdf2c0 | ||
|
|
294f03a812 | ||
|
|
272f9f3d27 | ||
|
|
927a28ba3b | ||
|
|
a938c4284e | ||
|
|
7a44a0cee7 | ||
|
|
82430309ac | ||
|
|
c2079de880 | ||
|
|
967ead7269 | ||
|
|
c9255df519 | ||
|
|
27c824a1c9 | ||
|
|
5b96d1ccf9 | ||
|
|
29c0866b38 | ||
|
|
0214ea0dfe | ||
|
|
80355002a1 | ||
|
|
0e36825228 | ||
|
|
95a8f1469f | ||
|
|
afdbadc704 | ||
|
|
004cc26abf | ||
|
|
35a924c576 | ||
|
|
99279ac97a | ||
|
|
87605ca1e2 | ||
|
|
7cc586f117 | ||
|
|
c263a6092c | ||
|
|
f92fd85400 | ||
|
|
e71520ddd6 | ||
|
|
275f34b5d2 | ||
|
|
50fbb6ed36 | ||
|
|
34fdacbd35 | ||
|
|
77f2d20dbc | ||
|
|
0dbfbf26cb | ||
|
|
2863a6878f | ||
|
|
ae46e91e4d | ||
|
|
865a90eb4f | ||
|
|
0269c4507c | ||
|
|
a5d3574984 | ||
|
|
1040deb0c5 | ||
|
|
05ea800faf | ||
|
|
341f87862c | ||
|
|
f805d30769 | ||
|
|
4fb9472cc2 | ||
|
|
a8098740c6 | ||
|
|
e3af0d041e | ||
|
|
28cfda9f30 | ||
|
|
a313e23fff | ||
|
|
4d2a292e8a | ||
|
|
5a84b7fc2d | ||
|
|
d8e660a6dc | ||
|
|
761f3b403b | ||
|
|
4570d29404 | ||
|
|
14346b3456 | ||
|
|
769f58aaaa | ||
|
|
a166e96d16 | ||
|
|
8dd8ce1dc3 | ||
|
|
4c5979a107 | ||
|
|
649ab2dcfa | ||
|
|
71fc9b37ae | ||
|
|
283aedf498 | ||
|
|
1a56614af2 | ||
|
|
693c33e407 | ||
|
|
d9a9aa027d | ||
|
|
b22250bb67 | ||
|
|
d446120527 | ||
|
|
bb9d68489c | ||
|
|
affaea59fe | ||
|
|
81fc4c93ef | ||
|
|
8957121c14 | ||
|
|
50241bc84e | ||
|
|
e7f077f1ba | ||
|
|
c3b82c7610 | ||
|
|
2c12e7f6f5 | ||
|
|
8db10d9ac4 | ||
|
|
c3cc4662af | ||
|
|
22892f9803 | ||
|
|
27eb115fb6 | ||
|
|
51a596ef4f | ||
|
|
97de8bd1e0 | ||
|
|
1cb7e5be5b | ||
|
|
84dd04e761 | ||
|
|
2ac061e487 | ||
|
|
7cdb81582c | ||
|
|
8f33b40302 | ||
|
|
e600614ef5 | ||
|
|
02581dea1f | ||
|
|
40ad08bcc2 | ||
|
|
9c4456a13f | ||
|
|
f4d0392faa | ||
|
|
45ba6cfe03 | ||
|
|
4f23a0c797 | ||
|
|
f6c32bbf2b | ||
|
|
d040c951f0 | ||
|
|
69abfb0e33 | ||
|
|
9a1daf8482 | ||
|
|
9de6dc3af3 | ||
|
|
248834dcaa | ||
|
|
11a7da7c9f | ||
|
|
9fea0b9937 | ||
|
|
6fd3f3260d | ||
|
|
d9e262443c | ||
|
|
51c3bb3b98 | ||
|
|
7d608f9e32 | ||
|
|
295de18c8a | ||
|
|
3370b694b9 | ||
|
|
3380c52f15 | ||
|
|
1364e6f1ac | ||
|
|
c5ac2aa62c | ||
|
|
392a0345de | ||
|
|
5c2fc73e7b | ||
|
|
402b951804 | ||
|
|
5848d13fed | ||
|
|
5dd24ead57 | ||
|
|
d2cb94952a | ||
|
|
0615396d2d | ||
|
|
82877ea449 | ||
|
|
81fae49db9 | ||
|
|
74ff8dc975 | ||
|
|
ac319217d0 | ||
|
|
cdb13ae8d0 | ||
|
|
ab700807d9 | ||
|
|
744b91bb9f | ||
|
|
d69f85bf15 | ||
|
|
52ee969e29 | ||
|
|
55f0501201 | ||
|
|
b2710ee19a | ||
|
|
bbfcc4724d | ||
|
|
c31cc72d79 | ||
|
|
d1049ad93e | ||
|
|
5f4cc234fb | ||
|
|
d31a13953c | ||
|
|
28f5873179 | ||
|
|
8f813338f1 | ||
|
|
6555dfa486 | ||
|
|
5eee0253e5 | ||
|
|
594c723f98 | ||
|
|
f418265865 | ||
|
|
53707e2eec | ||
|
|
fde794e898 | ||
|
|
082f19b42d | ||
|
|
e31c620686 | ||
|
|
570253315f | ||
|
|
5dcdac6e4e | ||
|
|
eea3fce854 | ||
|
|
215c49d032 | ||
|
|
923df53e25 | ||
|
|
1a684d0020 | ||
|
|
dc3b721fa0 | ||
|
|
4479ce9c1c | ||
|
|
4a0d3530e0 | ||
|
|
9907d2992d | ||
|
|
9d9224f184 | ||
|
|
78d4d87e39 | ||
|
|
6211633273 | ||
|
|
3a4cf918bf | ||
|
|
e25eb309ec | ||
|
|
ffa2b2aa7d | ||
|
|
a77a95584d | ||
|
|
68bb98159f | ||
|
|
8e6905d238 | ||
|
|
1a8521ff24 | ||
|
|
9d5460d72d | ||
|
|
35e59297fc | ||
|
|
9b945233b1 | ||
|
|
b065dc2eee | ||
|
|
66c4bb1a70 | ||
|
|
36abe6fe61 | ||
|
|
3c786aa6c8 | ||
|
|
e5cce6d356 | ||
|
|
723b7d81e4 | ||
|
|
a3ddd7358b | ||
|
|
45c027f31f | ||
|
|
3b62e9eb0d | ||
|
|
34a8c7ec87 | ||
|
|
d4a6240005 | ||
|
|
5c6f76da0a | ||
|
|
4636341b05 | ||
|
|
be3b770d8f | ||
|
|
af32387b3f | ||
|
|
115fc340cb | ||
|
|
900f7a8776 | ||
|
|
4877e30504 | ||
|
|
4656ec3852 | ||
|
|
e336441197 | ||
|
|
20d6182f33 | ||
|
|
aa145866f9 | ||
|
|
fdff41e166 | ||
|
|
07b4bc3979 | ||
|
|
0c66d3ae37 | ||
|
|
bd869183d5 | ||
|
|
7e2bf83100 | ||
|
|
25e52a78fb | ||
|
|
47c4bb2ddf | ||
|
|
951dfbb13a | ||
|
|
81780a3b62 | ||
|
|
c574d0cdf2 | ||
|
|
c987c3f999 | ||
|
|
1a5e414863 | ||
|
|
ec3639385e | ||
|
|
f01cfca6a4 | ||
|
|
7d5af5e0fa | ||
|
|
8fdb296cbd | ||
|
|
879b30aaa3 | ||
|
|
40ddcb717a | ||
|
|
da1841a075 | ||
|
|
0a0a10d127 | ||
|
|
df20b6e79b | ||
|
|
f4f1dc39e0 | ||
|
|
340b4dd7df | ||
|
|
4b9dcd821f | ||
|
|
669c5c9380 | ||
|
|
7f9aa6c59b | ||
|
|
d9c06b56ca | ||
|
|
d045e1d77e | ||
|
|
6d14cc7ec1 | ||
|
|
eb499b2854 | ||
|
|
65a82ef6d7 | ||
|
|
616f581650 | ||
|
|
57e802656f | ||
|
|
5d7f15daf8 | ||
|
|
ec67e3b7e4 | ||
|
|
0d3ff3c073 | ||
|
|
325e48867c | ||
|
|
8de95bc05b | ||
|
|
5e3003bb52 | ||
|
|
e6e3f38bfa | ||
|
|
aa17ab7e57 | ||
|
|
35908bd040 | ||
|
|
4a9cfd763e | ||
|
|
0e73294e26 | ||
|
|
b610f46bae | ||
|
|
1921a1adb2 | ||
|
|
6d2cd23f40 | ||
|
|
14fb67f28a | ||
|
|
c552680473 | ||
|
|
edbf9f878d | ||
|
|
2745ddfc33 | ||
|
|
808606034a | ||
|
|
e18eef3d7a | ||
|
|
e78fc11a95 | ||
|
|
83231cb376 | ||
|
|
986ad56124 | ||
|
|
b723a7b11b | ||
|
|
1b6b67b17e | ||
|
|
1ee3236f72 | ||
|
|
b03a4917be | ||
|
|
84971b39f5 | ||
|
|
5ab3e743f3 | ||
|
|
1c5dc844e7 | ||
|
|
f871949efd | ||
|
|
eb2ec6bee9 | ||
|
|
df22f59f6e | ||
|
|
db0edc3273 | ||
|
|
6300c14248 | ||
|
|
d4426e79a7 | ||
|
|
b095418d20 | ||
|
|
d6fd880481 | ||
|
|
cbb0b734c7 | ||
|
|
f4bcd70f27 | ||
|
|
6e16b45d9d | ||
|
|
e09e7ab362 | ||
|
|
d5cc2f19cd | ||
|
|
b7a80146f4 | ||
|
|
5586a71a6e | ||
|
|
81418b7c77 | ||
|
|
8bd0c77ae3 | ||
|
|
e2217e7ed5 | ||
|
|
51b75ea7ef | ||
|
|
41d4d6721c | ||
|
|
9d01d50459 | ||
|
|
e27c67c5c5 | ||
|
|
e7decd5f4d | ||
|
|
38a3178185 | ||
|
|
58828ae573 | ||
|
|
6b5f5e3508 | ||
|
|
f0ec771933 | ||
|
|
22d1087e16 | ||
|
|
9f85fcefdc | ||
|
|
269d2575cd | ||
|
|
0b8ed5de2d | ||
|
|
c22684eac9 | ||
|
|
c42cd4b831 | ||
|
|
4d018f7067 | ||
|
|
46eaf3b0cc | ||
|
|
9df2a00b94 | ||
|
|
fbcf4bc1f2 | ||
|
|
ca08c064bb | ||
|
|
02df47d349 | ||
|
|
41c39e3366 | ||
|
|
45803988ce | ||
|
|
28251e7ff9 | ||
|
|
217382d584 | ||
|
|
82a2cb6f51 | ||
|
|
611ed5f312 | ||
|
|
27fbb5dbf4 | ||
|
|
db8d9b7cf1 | ||
|
|
60ec950517 | ||
|
|
2cd4ebc01f | ||
|
|
5f4dcaf781 | ||
|
|
c55d882fab | ||
|
|
8dc7450068 | ||
|
|
2e885232c2 | ||
|
|
970d9b3795 | ||
|
|
2f58af0d85 | ||
|
|
0ae50f19da | ||
|
|
c4ac37361e | ||
|
|
3152861e81 | ||
|
|
a14afd0804 | ||
|
|
25d5d1a60d | ||
|
|
6ff58b9240 | ||
|
|
99237262d4 | ||
|
|
29982dfd15 | ||
|
|
6c4da94687 | ||
|
|
6986d0e6eb | ||
|
|
bc9320452c | ||
|
|
23d43aae27 | ||
|
|
de71735e7c | ||
|
|
05decf3638 | ||
|
|
95bffa1a1f | ||
|
|
974d52fdb8 | ||
|
|
7614f0e55e | ||
|
|
0632284f79 | ||
|
|
ad4a89f070 | ||
|
|
6104c49f31 | ||
|
|
07fc760999 | ||
|
|
cf6bc84148 | ||
|
|
36d51bea93 | ||
|
|
fc12885b1b | ||
|
|
ec7033745e | ||
|
|
9e31e63147 | ||
|
|
feef17fd88 | ||
|
|
817f011191 | ||
|
|
98c045cf3a | ||
|
|
8860f3a82a | ||
|
|
43e9f4ca2f | ||
|
|
586f843c76 | ||
|
|
7cfc9e6d8c | ||
|
|
4952ed0fa4 | ||
|
|
a084185d76 | ||
|
|
914b80d276 | ||
|
|
282557da52 | ||
|
|
5f649d583c | ||
|
|
b98225ebf5 | ||
|
|
abb0c2bba4 | ||
|
|
b3bdb474a9 | ||
|
|
d796e6acb7 | ||
|
|
d3afc92bc9 | ||
|
|
35a97b4b7b | ||
|
|
f59463aad3 | ||
|
|
ed656499c4 | ||
|
|
63533e9a22 | ||
|
|
20f7053254 | ||
|
|
8b8ef74d39 | ||
|
|
3bfe024d8d | ||
|
|
063333e03d | ||
|
|
0a0918ff38 | ||
|
|
802c014656 | ||
|
|
860841794d | ||
|
|
2a87c31237 | ||
|
|
da5f7fdcee | ||
|
|
d8b408b1de | ||
|
|
64932f9e4a | ||
|
|
5a20efcf17 | ||
|
|
2a2857bbc8 | ||
|
|
1bef284ab1 | ||
|
|
d8d0b6434f | ||
|
|
416b6fd115 | ||
|
|
f685cf920b | ||
|
|
54f51116b2 | ||
|
|
b0d90958fc | ||
|
|
049ced2c2f | ||
|
|
844b0e603b | ||
|
|
75ef751e23 | ||
|
|
c4f6e56fca | ||
|
|
ff86d3d894 | ||
|
|
85b4c03e33 | ||
|
|
efaf159af6 | ||
|
|
daa657fb78 | ||
|
|
4685663d73 | ||
|
|
ed1f716022 | ||
|
|
d3205a4898 | ||
|
|
86731ce2c6 | ||
|
|
1399309624 | ||
|
|
cb59297438 | ||
|
|
5824f6bc06 | ||
|
|
5ce7090d54 | ||
|
|
7306ab29bc | ||
|
|
3a8b42f291 | ||
|
|
e4c25383f2 | ||
|
|
e734dcc2c7 | ||
|
|
0fce007b8e | ||
|
|
5a053a3a07 | ||
|
|
3b2ba5f7fb | ||
|
|
7f622f6c04 | ||
|
|
801136bcc2 | ||
|
|
3c0e39c539 | ||
|
|
19fddebf0e | ||
|
|
9eaf7e14c7 | ||
|
|
0e441bc103 | ||
|
|
cd9911fdf8 | ||
|
|
6086422193 | ||
|
|
9ddb11f11c | ||
|
|
7a20cabd03 | ||
|
|
9dc4ca4507 | ||
|
|
62fea98b4f | ||
|
|
7ae4eac5b6 | ||
|
|
fcf8ae5e2b | ||
|
|
55b9a7938b | ||
|
|
cf1546a60e | ||
|
|
e7eec05af0 | ||
|
|
98e986141b | ||
|
|
d7e35e0371 | ||
|
|
222f224664 | ||
|
|
62b6cd007f | ||
|
|
1682e8fb12 | ||
|
|
984aefe0e8 | ||
|
|
2d54cc69c9 | ||
|
|
2dd8278de8 | ||
|
|
e0d8ac972e | ||
|
|
ec03812fb0 | ||
|
|
93cf2b17bf | ||
|
|
77ef1a989d | ||
|
|
423c7ac6c6 | ||
|
|
2c368ef148 | ||
|
|
b3c7162fd0 | ||
|
|
67865069eb | ||
|
|
1896a9be60 | ||
|
|
b5b2c037c1 | ||
|
|
1957924d51 | ||
|
|
104a66f256 | ||
|
|
3de6d65ea3 | ||
|
|
fdb0a6e004 | ||
|
|
87b857b6bf | ||
|
|
b18165301d | ||
|
|
097e65944a | ||
|
|
0cdd29ea78 | ||
|
|
7dec24688f | ||
|
|
e62fa54811 | ||
|
|
1614174e79 | ||
|
|
f95d097359 | ||
|
|
3c6ab9aad9 | ||
|
|
4913b88f70 | ||
|
|
273157153c | ||
|
|
fb5156ff38 | ||
|
|
2a824402f3 | ||
|
|
86a249fe4f | ||
|
|
6cae8221c9 | ||
|
|
750cb3d248 | ||
|
|
f254b540b8 | ||
|
|
11024f252e | ||
|
|
9d5cba17ba | ||
|
|
1d01c9d43d | ||
|
|
e32ea81876 | ||
|
|
ef8a18f49b | ||
|
|
b914049c53 | ||
|
|
dabaea8048 | ||
|
|
09c1a425a9 | ||
|
|
8c6fed007f | ||
|
|
2e39604021 | ||
|
|
fbfb947b21 | ||
|
|
8b963f4ba4 | ||
|
|
9152f07eaf | ||
|
|
35f70c09f5 | ||
|
|
cc4cba7b5d | ||
|
|
6b695fefd0 | ||
|
|
910d193029 | ||
|
|
f18dd687c8 | ||
|
|
50d5376698 | ||
|
|
5b9b62a7db | ||
|
|
c0e29e5b01 | ||
|
|
2f03129d46 | ||
|
|
b44e2d3416 | ||
|
|
564915681c | ||
|
|
a24b7eeb87 | ||
|
|
0215c01861 | ||
|
|
beae6324e5 | ||
|
|
71a61c573e | ||
|
|
6b3b632767 | ||
|
|
2a2fa04b7b | ||
|
|
79b81d194b | ||
|
|
ef04c9aff8 | ||
|
|
7f85197c10 | ||
|
|
ff0bfe64af | ||
|
|
44b3a3a5e6 | ||
|
|
7e3033aa93 | ||
|
|
8bdbf50772 | ||
|
|
ec33a76641 | ||
|
|
00ce9376c7 | ||
|
|
46e7a9797e | ||
|
|
7006c4ac88 | ||
|
|
a50a2126cf | ||
|
|
07f7b4b470 | ||
|
|
7e726e42f4 | ||
|
|
40ba0257de | ||
|
|
3fbd5f9fea | ||
|
|
57b2246d35 | ||
|
|
2a5b22d6f9 | ||
|
|
f247dc7522 | ||
|
|
e6531253e2 | ||
|
|
c938babf00 | ||
|
|
bf3900020f | ||
|
|
586df3bb7f | ||
|
|
c4b13b0268 | ||
|
|
daef72316f | ||
|
|
1f93c96e63 | ||
|
|
8aa9c79276 | ||
|
|
09a7f2e734 | ||
|
|
b2d27e376d | ||
|
|
644c4af11e | ||
|
|
ca3dc3a0a0 | ||
|
|
2b975dfd5b | ||
|
|
0932892278 | ||
|
|
fe0b3d98c2 | ||
|
|
8d56c8b51c | ||
|
|
d8e6409336 | ||
|
|
a4ae746656 | ||
|
|
331a0a7b9b | ||
|
|
c630a3e8d6 | ||
|
|
7435d89edf | ||
|
|
14557c8be4 | ||
|
|
98b4995bad | ||
|
|
3000bdcc3a | ||
|
|
cbe77a6753 | ||
|
|
c58a1f76f8 | ||
|
|
ecf2875ebf | ||
|
|
ce2c19e357 | ||
|
|
1b1081a3ed | ||
|
|
37b200389a | ||
|
|
6b5a8f3a22 | ||
|
|
0b18d8b0c7 | ||
|
|
3d187ede47 | ||
|
|
f3b9c34515 | ||
|
|
c923394924 | ||
|
|
d9dbd24db5 | ||
|
|
b135819d71 | ||
|
|
cbcbd07da2 | ||
|
|
24f6ab73a7 | ||
|
|
5e88347e1b | ||
|
|
cac0d4ee6f | ||
|
|
428759b3d4 | ||
|
|
898d3ecce0 | ||
|
|
004f16f6c4 | ||
|
|
4e2a0e58f2 | ||
|
|
39d29195a7 | ||
|
|
727c9b8027 | ||
|
|
bd4e9b0512 | ||
|
|
7844ff735f | ||
|
|
49e96badcf | ||
|
|
eb6a81bacc | ||
|
|
6687f12988 | ||
|
|
fcd12fc0f1 | ||
|
|
0fb4d54068 | ||
|
|
830a468a23 | ||
|
|
af3ca7b4a9 | ||
|
|
7a6bb17255 | ||
|
|
bc6d459a6e | ||
|
|
ff7f34e353 | ||
|
|
2e3d79aaec | ||
|
|
8a41bcc934 | ||
|
|
e2414b41ad | ||
|
|
266958bce7 | ||
|
|
bc5354cbf0 | ||
|
|
cc4997843e | ||
|
|
ab95eac286 | ||
|
|
1cd76233d1 | ||
|
|
3d5afc8b83 | ||
|
|
d28b7799dd | ||
|
|
b0fb889c29 | ||
|
|
460e80bd1d | ||
|
|
bc1e96e942 | ||
|
|
7ea61df414 | ||
|
|
431712293d | ||
|
|
335ed97263 | ||
|
|
e00b165e9b | ||
|
|
5467ddf0e1 | ||
|
|
7a37dd92ed | ||
|
|
d0c11e9d72 | ||
|
|
5ec52fee2c | ||
|
|
5026bc13bb | ||
|
|
c7d27e5247 | ||
|
|
b7d7af7ea9 | ||
|
|
39663d2c40 | ||
|
|
000299a0e6 | ||
|
|
0a47d82b9b | ||
|
|
198bcece58 | ||
|
|
053677d124 | ||
|
|
804072f014 | ||
|
|
e9429b43ce | ||
|
|
3d37d5e24a | ||
|
|
2728a1b4f3 | ||
|
|
adb040d4cb | ||
|
|
479d7934c0 | ||
|
|
22d1acd5ac | ||
|
|
b257c152c6 | ||
|
|
77b97ee0d7 | ||
|
|
e2ac4732cd | ||
|
|
e8f665b495 | ||
|
|
55f3ef29ea | ||
|
|
c2d78c9623 | ||
|
|
a4578a5413 | ||
|
|
e884fcf785 | ||
|
|
e96025755d | ||
|
|
c9028b0ab5 | ||
|
|
b4d2858f95 | ||
|
|
dea446d995 | ||
|
|
5cd94f9e9d | ||
|
|
cad811fc41 | ||
|
|
69f6a9f007 | ||
|
|
4eeee0c59f | ||
|
|
a5afa6c95f | ||
|
|
625dacb93d | ||
|
|
62e9c2e091 | ||
|
|
e4106a4e24 | ||
|
|
a506b8c7dd | ||
|
|
e5cd536894 | ||
|
|
629ea39a88 | ||
|
|
7d9e1321c7 | ||
|
|
83af7422a0 | ||
|
|
ce8945f35c | ||
|
|
dd890f0776 | ||
|
|
af4ac437ab | ||
|
|
607585fdaf | ||
|
|
2f596aeef5 | ||
|
|
69762c75fa | ||
|
|
36b29660ce | ||
|
|
4976983f30 | ||
|
|
31e4ad25ba | ||
|
|
225f4daf15 | ||
|
|
b9927cfa2d | ||
|
|
af6cafc603 | ||
|
|
15da07d436 | ||
|
|
886ed3544b | ||
|
|
aff2922f9a | ||
|
|
f32e0035a3 | ||
|
|
7b1e7706d8 | ||
|
|
cd74dda72a | ||
|
|
032bb2a2c5 | ||
|
|
fa96ed06d2 | ||
|
|
43133041c9 | ||
|
|
e0ee5ea962 | ||
|
|
f5634286a3 | ||
|
|
97d37c1c1e | ||
|
|
739b139cb2 | ||
|
|
0bc9920ad4 | ||
|
|
3f516ce837 | ||
|
|
9f197f9da5 | ||
|
|
3dc2cc36e9 | ||
|
|
ca3e683747 | ||
|
|
38a1757168 | ||
|
|
4104a57107 | ||
|
|
b0c0f20071 | ||
|
|
7870774162 | ||
|
|
4213cdaf5d | ||
|
|
39b4c974ee | ||
|
|
508f56f17c | ||
|
|
48665b7c99 | ||
|
|
51971f7293 | ||
|
|
3d3addb252 | ||
|
|
3f8bdd1fdb | ||
|
|
6181fd949f | ||
|
|
afd61c63c2 | ||
|
|
9a2073b4cd | ||
|
|
f28468188b | ||
|
|
8871d87512 | ||
|
|
a2b81188be | ||
|
|
f91f6cd5e4 | ||
|
|
bd923a7bac | ||
|
|
373c88faef | ||
|
|
14813d8123 | ||
|
|
92f2437f48 | ||
|
|
da959761ff | ||
|
|
d8cd25aa0d | ||
|
|
d63d4f46fc | ||
|
|
52161e090d | ||
|
|
9e55e06501 | ||
|
|
0b6df67fb1 | ||
|
|
bf087e1ea1 | ||
|
|
885818fb7c | ||
|
|
2f370048cb | ||
|
|
28dc02a9d8 | ||
|
|
54ebaca535 | ||
|
|
4fedc91a4a | ||
|
|
f734aaa413 | ||
|
|
a575d4b9ee | ||
|
|
77a87ded3a | ||
|
|
b958d2c298 | ||
|
|
dc72a195c2 | ||
|
|
e2812ff61f | ||
|
|
8c2e34e27f | ||
|
|
31f3950fbf | ||
|
|
75b3654d18 | ||
|
|
418f9ac5e3 | ||
|
|
ad4afe4edf | ||
|
|
c844b971cb | ||
|
|
ca9b1c47af | ||
|
|
86039d2751 | ||
|
|
420a692f04 | ||
|
|
1d2a464fe0 | ||
|
|
7735dd0750 | ||
|
|
bf7b075f0c |
@@ -1,6 +1,4 @@
|
||||
openssl.pc
|
||||
libcrypto.pc
|
||||
libssl.pc
|
||||
MINFO
|
||||
makefile.one
|
||||
tmp
|
||||
@@ -16,7 +14,7 @@ cctest.a
|
||||
*.flc
|
||||
semantic.cache
|
||||
Makefile
|
||||
*.dll*
|
||||
*.so*
|
||||
*.dll*
|
||||
*.sl*
|
||||
*.dylib*
|
||||
|
||||
107
.gitignore
vendored
Normal file
107
.gitignore
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
# Object files
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# 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
|
||||
crypto/aes/asm/a_win32.asm
|
||||
crypto/bf/asm/b_win32.asm
|
||||
crypto/bn/asm/bn_win32.asm
|
||||
crypto/bn/asm/co_win32.asm
|
||||
crypto/bn/asm/mt_win32.asm
|
||||
crypto/cast/asm/c_win32.asm
|
||||
crypto/cpu_win32.asm
|
||||
crypto/des/asm/d_win32.asm
|
||||
crypto/des/asm/y_win32.asm
|
||||
crypto/md5/asm/m5_win32.asm
|
||||
crypto/rc4/asm/r4_win32.asm
|
||||
crypto/rc5/asm/r5_win32.asm
|
||||
crypto/ripemd/asm/rm_win32.asm
|
||||
crypto/sha/asm/s1_win32.asm
|
||||
crypto/sha/asm/sha512-sse2.asm
|
||||
|
||||
# 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
|
||||
|
||||
# Windows
|
||||
/tmp32dll
|
||||
/tmp32dll.dbg
|
||||
/out32dll
|
||||
/out32dll.dbg
|
||||
/inc32
|
||||
/MINFO
|
||||
ms/bcb.mak
|
||||
ms/libeay32.def
|
||||
ms/nt.mak
|
||||
ms/ntdll.mak
|
||||
ms/ssleay32.def
|
||||
ms/version32.rc
|
||||
30
ACKNOWLEDGMENTS
Normal file
30
ACKNOWLEDGMENTS
Normal file
@@ -0,0 +1,30 @@
|
||||
The OpenSSL project depends on volunteer efforts and financial support from
|
||||
the end user community. That support comes in the form of donations and paid
|
||||
sponsorships, software support contracts, paid consulting services
|
||||
and commissioned software development.
|
||||
|
||||
Since all these activities support the continued development and improvement
|
||||
of OpenSSL we consider all these clients and customers as sponsors of the
|
||||
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: http://www.opengear.com/
|
||||
|
||||
Significant support:
|
||||
|
||||
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.
|
||||
|
||||
Additional sponsorship or financial support is always welcome: for more
|
||||
information please contact the OpenSSL Software Foundation.
|
||||
@@ -148,7 +148,7 @@ eric (about to go bushwalking for the 4 day easter break :-)
|
||||
This would tend to cause memory overwrites since SSLv3 has
|
||||
a maximum packet size of 16k. If your program uses
|
||||
buffers <= 16k, you would probably never see this problem.
|
||||
- Fixed a few errors that were cause by malloc() not returning
|
||||
- Fixed a new errors that were cause by malloc() not returning
|
||||
0 initialised memory..
|
||||
- SSL_OP_NETSCAPE_CA_DN_BUG was being switched on when using
|
||||
SSL_CTX_set_options(ssl_ctx,SSL_OP_ALL); which was a bad thing
|
||||
|
||||
104
FAQ
104
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
|
||||
|
||||
@@ -52,6 +53,9 @@ OpenSSL - Frequently Asked Questions
|
||||
* Why does the OpenSSL test suite fail in sha512t on x86 CPU?
|
||||
* Why does compiler fail to compile sha512.c?
|
||||
* Test suite still fails, what to do?
|
||||
* I think I've found a bug, what should I do?
|
||||
* I'm SURE I've found a bug, how do I report it?
|
||||
* I've found a security issue, how do I report it?
|
||||
|
||||
[PROG] Questions about programming with OpenSSL
|
||||
|
||||
@@ -70,6 +74,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* I think I've detected a memory leak, is this a bug?
|
||||
* Why does Valgrind complain about the use of uninitialized data?
|
||||
* Why doesn't a memory BIO work when a file does?
|
||||
* Where are the declarations and implementations of d2i_X509() etc?
|
||||
|
||||
===============================================================================
|
||||
|
||||
@@ -78,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 0.9.8k was released on Mar 25th, 2009.
|
||||
OpenSSL 1.0.1d was released on Feb 5th, 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?
|
||||
@@ -94,19 +99,19 @@ explains how to install this library.
|
||||
|
||||
OpenSSL includes a command line utility that can be used to perform a
|
||||
variety of cryptographic functions. It is described in the openssl(1)
|
||||
manpage. Documentation for developers is currently being written. A
|
||||
few manual pages already are available; overviews over libcrypto and
|
||||
manpage. Documentation for developers is currently being written. Many
|
||||
manual pages are available; overviews over libcrypto and
|
||||
libssl are given in the crypto(3) and ssl(3) manpages.
|
||||
|
||||
The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
|
||||
different directory if you specified one as described in INSTALL).
|
||||
In addition, you can read the most current versions at
|
||||
<URL: http://www.openssl.org/docs/>.
|
||||
|
||||
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
|
||||
predecessor, at <URL: http://www.columbia.edu/~ariel/ssleay/>. Much
|
||||
of this still applies to OpenSSL.
|
||||
<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. The pod format
|
||||
documentation is included in each OpenSSL distribution under the docs
|
||||
directory.
|
||||
|
||||
There is some documentation about certificate extensions and PKCS#12
|
||||
in doc/openssl.txt
|
||||
@@ -127,7 +132,7 @@ OpenSSL. Information on the OpenSSL mailing lists is available from
|
||||
* Where can I get a compiled version of OpenSSL?
|
||||
|
||||
You can finder pointers to binary distributions in
|
||||
http://www.openssl.org/related/binaries.html .
|
||||
<URL: http://www.openssl.org/related/binaries.html> .
|
||||
|
||||
Some applications that use OpenSSL are distributed in binary form.
|
||||
When using such an application, you don't need to install OpenSSL
|
||||
@@ -166,6 +171,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?
|
||||
@@ -277,7 +295,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?
|
||||
@@ -459,7 +477,7 @@ administrators.
|
||||
Other projects do have other policies so you can for example extract the CA
|
||||
bundle used by Mozilla and/or modssl as described in this article:
|
||||
|
||||
http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html
|
||||
<URL: http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html>
|
||||
|
||||
|
||||
[BUILD] =======================================================================
|
||||
@@ -501,7 +519,7 @@ when you run the test suite (using "make test"). The message returned is
|
||||
"bc: 1 not implemented".
|
||||
|
||||
The best way to deal with this is to find another implementation of bc
|
||||
and compile/install it. GNU bc (see http://www.gnu.org/software/software.html
|
||||
and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
|
||||
for download instructions) can be safely used, for example.
|
||||
|
||||
|
||||
@@ -512,7 +530,7 @@ that the OpenSSL bntest throws at it. This gets triggered when you run the
|
||||
test suite (using "make test"). The message returned is "bc: stack empty".
|
||||
|
||||
The best way to deal with this is to find another implementation of bc
|
||||
and compile/install it. GNU bc (see http://www.gnu.org/software/software.html
|
||||
and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
|
||||
for download instructions) can be safely used, for example.
|
||||
|
||||
|
||||
@@ -705,6 +723,49 @@ never make sense, and tend to emerge when you least expect them. In order
|
||||
to identify one, drop optimization level, e.g. by editing CFLAG line in
|
||||
top-level Makefile, recompile and re-run the test.
|
||||
|
||||
* I think I've found a bug, what should I do?
|
||||
|
||||
If you are a new user then it is quite likely you haven't found a bug and
|
||||
something is happening you aren't familiar with. Check this FAQ, the associated
|
||||
documentation and the mailing lists for similar queries. If you are still
|
||||
unsure whether it is a bug or not submit a query to the openssl-users mailing
|
||||
list.
|
||||
|
||||
|
||||
* I'm SURE I've found a bug, how do I report it?
|
||||
|
||||
Bug reports with no security implications should be sent to the request
|
||||
tracker. This can be done by mailing the report to <rt@openssl.org> (or its
|
||||
alias <openssl-bugs@openssl.org>), please note that messages sent to the
|
||||
request tracker also appear in the public openssl-dev mailing list.
|
||||
|
||||
The report should be in plain text. Any patches should be sent as
|
||||
plain text attachments because some mailers corrupt patches sent inline.
|
||||
If your issue affects multiple versions of OpenSSL check any patches apply
|
||||
cleanly and, if possible include patches to each affected version.
|
||||
|
||||
The report should be given a meaningful subject line briefly summarising the
|
||||
issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful.
|
||||
|
||||
By sending reports to the request tracker the bug can then be given a priority
|
||||
and assigned to the appropriate maintainer. The history of discussions can be
|
||||
accessed and if the issue has been addressed or a reason why not. If patches
|
||||
are only sent to openssl-dev they can be mislaid if a team member has to
|
||||
wade through months of old messages to review the discussion.
|
||||
|
||||
See also <URL: http://www.openssl.org/support/rt.html>
|
||||
|
||||
|
||||
* I've found a security issue, how do I report it?
|
||||
|
||||
If you think your bug has security implications then please send it to
|
||||
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?
|
||||
@@ -718,7 +779,7 @@ file.
|
||||
Multi-threaded applications must provide two callback functions to
|
||||
OpenSSL by calling CRYPTO_set_locking_callback() and
|
||||
CRYPTO_set_id_callback(), for all versions of OpenSSL up to and
|
||||
including 0.9.8[abc...]. As of version 0.9.9, CRYPTO_set_id_callback()
|
||||
including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback()
|
||||
and associated APIs are deprecated by CRYPTO_THREADID_set_callback()
|
||||
and friends. This is described in the threads(3) manpage.
|
||||
|
||||
@@ -964,4 +1025,15 @@ is needed. This must be done by calling:
|
||||
See the manual pages for more details.
|
||||
|
||||
|
||||
* Where are the declarations and implementations of d2i_X509() etc?
|
||||
|
||||
These are defined and implemented by macros of the form:
|
||||
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(X509) and IMPLEMENT_ASN1_FUNCTIONS(X509)
|
||||
|
||||
The implementation passes an ASN1 "template" defining the structure into an
|
||||
ASN1 interpreter using generalised functions such as ASN1_item_d2i().
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
||||
12
INSTALL
12
INSTALL
@@ -98,17 +98,11 @@
|
||||
The crypto/<cipher> directory can be removed after running
|
||||
"make depend".
|
||||
|
||||
-Dxxx, -lxxx, -Lxxx, -fxxx, -mXXX, -Kxxx These system specific options will
|
||||
-Dxxx, -lxxx, -Lxxx, -fxxx, -mxxx, -Kxxx These system specific options will
|
||||
be passed through to the compiler to allow you to
|
||||
define preprocessor symbols, specify additional libraries,
|
||||
library directories or other compiler options.
|
||||
|
||||
-DHAVE_CRYPTODEV Enable the BSD cryptodev engine even if we are not using
|
||||
BSD. Useful if you are running ocf-linux or something
|
||||
similar. Once enabled you can also enable the use of
|
||||
cryptodev digests, which is usually slower unless you have
|
||||
large amounts data. Use -DUSE_CRYPTODEV_DIGESTS to force
|
||||
it.
|
||||
|
||||
Installation in Detail
|
||||
----------------------
|
||||
@@ -212,10 +206,6 @@
|
||||
compile programs with libcrypto or libssl.
|
||||
lib Contains the OpenSSL library files themselves.
|
||||
|
||||
Use "make install_sw" to install the software without documentation,
|
||||
and "install_docs_html" to install HTML renditions of the manual
|
||||
pages.
|
||||
|
||||
Package builders who want to configure the library for standard
|
||||
locations, but have the package installed somewhere else so that
|
||||
it can easily be packaged, can use
|
||||
|
||||
164
INSTALL.W32
164
INSTALL.W32
@@ -5,31 +5,20 @@
|
||||
[Instructions for building for Windows CE can be found in INSTALL.WCE]
|
||||
[Instructions for building for Win64 can be found in INSTALL.W64]
|
||||
|
||||
Here are a few comments about building OpenSSL for Win32 environments,
|
||||
such as Windows NT and Windows 9x. It should be noted though that
|
||||
Windows 9x are not ordinarily tested. Its mention merely means that we
|
||||
attempt to maintain certain programming discipline and pay attention
|
||||
to backward compatibility issues, in other words it's kind of expected
|
||||
to work on Windows 9x, but no regression tests are actually performed.
|
||||
Heres a few comments about building OpenSSL in Windows environments. Most
|
||||
of this is tested on Win32 but it may also work in Win 3.1 with some
|
||||
modification.
|
||||
|
||||
On additional note newer OpenSSL versions are compiled and linked with
|
||||
Winsock 2. This means that minimum OS requirement was elevated to NT 4
|
||||
and Windows 98 [there is Winsock 2 update for Windows 95 though].
|
||||
You need Perl for Win32. Unless you will build on Cygwin, you will need
|
||||
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
|
||||
|
||||
- you need Perl for Win32. Unless you will build on Cygwin, you will need
|
||||
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
|
||||
|
||||
- one of the following C compilers:
|
||||
and one of the following C compilers:
|
||||
|
||||
* Visual C++
|
||||
* Borland C
|
||||
* GNU C (Cygwin or MinGW)
|
||||
|
||||
- Netwide Assembler, a.k.a. NASM, available from http://nasm.sourceforge.net/
|
||||
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.
|
||||
@@ -37,18 +26,39 @@
|
||||
Visual C++
|
||||
----------
|
||||
|
||||
If you want to compile in the assembly language routines with Visual
|
||||
C++, then you will need already mentioned Netwide Assembler binary,
|
||||
nasmw.exe or nasm.exe, to be available on your %PATH%.
|
||||
If you want to compile in the assembly language routines with Visual C++ then
|
||||
you will need an assembler. This is worth doing because it will result in
|
||||
faster code: for example it will typically result in a 2 times speedup in the
|
||||
RSA routines. Currently the following assemblers are supported:
|
||||
|
||||
Firstly you should run Configure with platform VC-WIN32:
|
||||
* Microsoft MASM (aka "ml")
|
||||
* Free Netwide Assembler NASM.
|
||||
|
||||
> perl Configure VC-WIN32 --prefix=c:\some\openssl\dir
|
||||
MASM is distributed with most versions of VC++. For the versions where it is
|
||||
not included in VC++, it is also distributed with some Microsoft DDKs, for
|
||||
example the Windows NT 4.0 DDK and the Windows 98 DDK. If you do not have
|
||||
either of these DDKs then you can just download the binaries for the Windows
|
||||
98 DDK and extract and rename the two files XXXXXml.exe and XXXXXml.err, to
|
||||
ml.exe and ml.err and install somewhere on your PATH. Both DDKs can be
|
||||
downloaded from the Microsoft developers site www.msdn.com.
|
||||
|
||||
Where the prefix argument specifies where OpenSSL will be installed to.
|
||||
NASM is freely available. Version 0.98 was used during testing: other versions
|
||||
may also work. It is available from many places, see for example:
|
||||
http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
|
||||
The NASM binary nasmw.exe needs to be installed anywhere on your PATH.
|
||||
|
||||
Next you need to build the Makefiles and optionally the assembly
|
||||
language files:
|
||||
Firstly you should run Configure:
|
||||
|
||||
> perl Configure VC-WIN32 --prefix=c:/some/openssl/dir
|
||||
|
||||
Where the prefix argument specifies where OpenSSL will be installed to.
|
||||
|
||||
Next you need to build the Makefiles and optionally the assembly language
|
||||
files:
|
||||
|
||||
- If you are using MASM then run:
|
||||
|
||||
> ms\do_masm
|
||||
|
||||
- If you are using NASM then run:
|
||||
|
||||
@@ -56,7 +66,6 @@
|
||||
|
||||
- If you don't want to use the assembly language files at all then run:
|
||||
|
||||
> perl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir
|
||||
> ms\do_ms
|
||||
|
||||
If you get errors about things not having numbers assigned then check the
|
||||
@@ -67,39 +76,42 @@
|
||||
|
||||
> nmake -f ms\ntdll.mak
|
||||
|
||||
If all is well it should compile and you will have some DLLs and
|
||||
executables in out32dll. If you want to try the tests then do:
|
||||
If all is well it should compile and you will have some DLLs and executables
|
||||
in out32dll. If you want to try the tests then do:
|
||||
|
||||
> nmake -f ms\ntdll.mak test
|
||||
|
||||
|
||||
To install OpenSSL to the specified location do:
|
||||
To install OpenSSL to the specified location do:
|
||||
|
||||
> nmake -f ms\ntdll.mak install
|
||||
> nmake -f ms\ntdll.mak install
|
||||
|
||||
Tweaks:
|
||||
|
||||
There are various changes you can make to the Win32 compile
|
||||
environment. By default the library is not compiled with debugging
|
||||
symbols. If you use the platform debug-VC-WIN32 instead of VC-WIN32
|
||||
then debugging symbols will be compiled in.
|
||||
There are various changes you can make to the Win32 compile environment. By
|
||||
default the library is not compiled with debugging symbols. If you add 'debug'
|
||||
to the mk1mf.pl lines in the do_* batch file then debugging symbols will be
|
||||
compiled in. Note that mk1mf.pl expects the platform to be the last argument
|
||||
on the command line, so 'debug' must appear before that, as all other options.
|
||||
|
||||
By default in 1.0.0 OpenSSL will compile builtin ENGINES into the
|
||||
separate shared librariesy. If you specify the "enable-static-engine"
|
||||
option on the command line to Configure the shared library build
|
||||
(ms\ntdll.mak) will compile the engines into libeay32.dll instead.
|
||||
|
||||
By default in 0.9.8 OpenSSL will compile builtin ENGINES into the libeay32.dll
|
||||
shared library. If you specify the "no-static-engine" option on the command
|
||||
line to Configure the shared library build (ms\ntdll.mak) will compile the
|
||||
engines as separate DLLs.
|
||||
|
||||
The default Win32 environment is to leave out any Windows NT specific
|
||||
features.
|
||||
|
||||
If you want to enable the NT specific features of OpenSSL (currently
|
||||
only the logging BIO) follow the instructions above but call the batch
|
||||
file do_nt.bat instead of do_ms.bat.
|
||||
If you want to enable the NT specific features of OpenSSL (currently only the
|
||||
logging BIO) follow the instructions above but call the batch file do_nt.bat
|
||||
instead of do_ms.bat.
|
||||
|
||||
You can also build a static version of the library using the Makefile
|
||||
ms\nt.mak
|
||||
|
||||
|
||||
|
||||
Borland C++ builder 5
|
||||
---------------------
|
||||
|
||||
@@ -125,13 +137,17 @@
|
||||
GNU C (Cygwin)
|
||||
--------------
|
||||
|
||||
Cygwin implements a Posix/Unix runtime system (cygwin1.dll) on top of
|
||||
Win32 subsystem and provides a bash shell and GNU tools environment.
|
||||
Consequently, a make of OpenSSL with Cygwin is virtually identical to
|
||||
Unix procedure. It is also possible to create Win32 binaries that only
|
||||
use the Microsoft C runtime system (msvcrt.dll or crtdll.dll) using
|
||||
MinGW. MinGW can be used in the Cygwin development environment or in a
|
||||
standalone setup as described in the following section.
|
||||
Cygwin provides a bash shell and GNU tools environment running
|
||||
on NT 4.0, Windows 9x, Windows ME, Windows 2000, and Windows XP.
|
||||
Consequently, a make of OpenSSL with Cygwin is closer to a GNU
|
||||
bash environment such as Linux than to other the other Win32
|
||||
makes.
|
||||
|
||||
Cygwin implements a Posix/Unix runtime system (cygwin1.dll).
|
||||
It is also possible to create Win32 binaries that only use the
|
||||
Microsoft C runtime system (msvcrt.dll or crtdll.dll) using
|
||||
MinGW. MinGW can be used in the Cygwin development environment
|
||||
or in a standalone setup as described in the following section.
|
||||
|
||||
To build OpenSSL using Cygwin:
|
||||
|
||||
@@ -176,35 +192,35 @@
|
||||
non-fatal error in "make test" but is otherwise harmless. If
|
||||
desired and needed, GNU bc can be built with Cygwin without change.
|
||||
|
||||
GNU C (MinGW/MSYS)
|
||||
GNU C (MinGW)
|
||||
-------------
|
||||
|
||||
* Compiler and shell environment installation:
|
||||
* Compiler installation:
|
||||
|
||||
MinGW and MSYS are available from http://www.mingw.org/, both are
|
||||
required. Run the installers and do whatever magic they say it takes
|
||||
to start MSYS bash shell with GNU tools on its PATH.
|
||||
MinGW is available from http://www.mingw.org. Run the installer and
|
||||
set the MinGW bin directory to the PATH in "System Properties" or
|
||||
autoexec.bat.
|
||||
|
||||
* Compile OpenSSL:
|
||||
|
||||
$ ./config
|
||||
[...]
|
||||
$ make
|
||||
[...]
|
||||
$ make test
|
||||
> ms\mingw32
|
||||
|
||||
This will create the library and binaries in root source directory
|
||||
and openssl.exe application in apps directory.
|
||||
|
||||
It is also possible to cross-compile it on Linux by configuring
|
||||
with './Configure --cross-compile-prefix=i386-mingw32- mingw ...'.
|
||||
'make test' is naturally not applicable then.
|
||||
This will create the library and binaries in out. In case any problems
|
||||
occur, try
|
||||
> ms\mingw32 no-asm
|
||||
instead.
|
||||
|
||||
libcrypto.a and libssl.a are the static libraries. To use the DLLs,
|
||||
link with libeay32.a and libssl32.a instead.
|
||||
|
||||
See troubleshooting if you get error messages about functions not
|
||||
having a number assigned.
|
||||
See troubleshooting if you get error messages about functions not having
|
||||
a number assigned.
|
||||
|
||||
* You can now try the tests:
|
||||
|
||||
> cd out
|
||||
> ..\ms\test
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
@@ -248,7 +264,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
|
||||
@@ -291,13 +307,13 @@
|
||||
|
||||
If you link with static OpenSSL libraries [those built with ms/nt.mak],
|
||||
then you're expected to additionally link your application with
|
||||
WS2_32.LIB, ADVAPI32.LIB, GDI32.LIB and USER32.LIB. Those developing
|
||||
WSOCK32.LIB, ADVAPI32.LIB, GDI32.LIB and USER32.LIB. Those developing
|
||||
non-interactive service applications might feel concerned about linking
|
||||
with the latter two, as they are justly associated with interactive
|
||||
desktop, which is not available to service processes. The toolkit is
|
||||
designed to detect in which context it's currently executed, GUI,
|
||||
console app or service, and act accordingly, namely whether or not to
|
||||
actually make GUI calls.
|
||||
with latter two, as they are justly associated with interactive desktop,
|
||||
which is not available to service processes. The toolkit is designed
|
||||
to detect in which context it's currently executed, GUI, console app
|
||||
or service, and act accordingly, namely whether or not to actually make
|
||||
GUI calls.
|
||||
|
||||
If you link with OpenSSL .DLLs, then you're expected to include into
|
||||
your application code small "shim" snippet, which provides glue between
|
||||
|
||||
77
INSTALL.WCE
77
INSTALL.WCE
@@ -4,36 +4,27 @@
|
||||
|
||||
Building OpenSSL for Windows CE requires the following external tools:
|
||||
|
||||
* Microsoft eMbedded Visual C++ 3.0 or later
|
||||
* Appropriate SDK might be required
|
||||
* Perl for Win32 [commonly recommended ActiveState Perl is available
|
||||
from http://www.activestate.com/Products/ActivePerl/]
|
||||
* Microsoft eMbedded Visual C++ 3.0
|
||||
* wcecompat compatibility library (www.essemer.com.au)
|
||||
* Optionally ceutils for running automated tests (www.essemer.com.au)
|
||||
|
||||
* wcecompat compatibility library available at
|
||||
http://www.essemer.com.au/windowsce/
|
||||
* Optionally ceutils for running automated tests (same location)
|
||||
You also need Perl for Win32. You will need ActiveState Perl, available
|
||||
from http://www.activestate.com/ActivePerl.
|
||||
|
||||
_or_
|
||||
Windows CE support in OpenSSL relies on wcecompat and therefore it's
|
||||
appropriate to check http://www.essemer.com.au/windowsce/ for updates in
|
||||
case of compilation problems. As for the moment of this writing version
|
||||
1.1 is available and actually required for WCE 4.2 and newer platforms.
|
||||
All Windows CE specific issues should be directed to www.essemer.com.au.
|
||||
|
||||
* PocketConsole driver and PortSDK available at
|
||||
http://www.symbolictools.de/public/pocketconsole/
|
||||
* CMD command interpreter (same location)
|
||||
|
||||
As Windows CE support in OpenSSL relies on 3rd party compatibility
|
||||
library, it's appropriate to check corresponding URL for updates. For
|
||||
example if you choose wcecompat, note that as for the moment of this
|
||||
writing version 1.2 is available and actually required for WCE 4.2
|
||||
and newer platforms. All wcecompat issues should be directed to
|
||||
www.essemer.com.au.
|
||||
|
||||
Why compatibility library at all? The C Runtime Library implementation
|
||||
for Windows CE that is included with Microsoft eMbedded Visual C++ is
|
||||
incomplete and in some places incorrect. Compatibility library plugs
|
||||
the holes and tries to bring the Windows CE CRT to [more] usable level.
|
||||
Most gaping hole in CRT is support for stdin/stdout/stderr IO, which
|
||||
proposed compatibility libraries solve in two different ways: wcecompat
|
||||
redirects IO to active sync link, while PortSDK - to NT-like console
|
||||
driver on the handheld itself.
|
||||
The C Runtime Library implementation for Windows CE that is included with
|
||||
Microsoft eMbedded Visual C++ 3.0 is incomplete and in some places
|
||||
incorrect. wcecompat plugs the holes and tries to bring the Windows CE
|
||||
CRT to a level that is more compatible with ANSI C. wcecompat goes further
|
||||
and provides low-level IO and stream IO support for stdin/stdout/stderr
|
||||
(which Windows CE does not provide). This IO functionality is not needed
|
||||
by the OpenSSL library itself but is used for the tests and openssl.exe.
|
||||
More information is available at www.essemer.com.au.
|
||||
|
||||
Building
|
||||
--------
|
||||
@@ -43,21 +34,9 @@
|
||||
|
||||
> "C:\Program Files\Microsoft eMbedded Tools\EVC\WCE300\BIN\WCEARM.BAT"
|
||||
|
||||
Next pick compatibility library according to your preferences.
|
||||
Next indicate where wcecompat is located:
|
||||
|
||||
1. To choose wcecompat set up WCECOMPAT environment variable pointing
|
||||
at the location of wcecompat tree "root":
|
||||
|
||||
> set WCECOMPAT=C:\wcecompat
|
||||
> set PORTSDK_LIBPATH=
|
||||
|
||||
2. To choose PortSDK set up PORTSDK_LIBPATH to point at hardware-
|
||||
specific location where your portlib.lib is installed:
|
||||
|
||||
> set PORTSDK_LIBPATH=C:\PortSDK\lib\ARM
|
||||
> set WCECOMPAT=
|
||||
|
||||
Note that you may not set both variables.
|
||||
> set WCECOMPAT=C:\wcecompat
|
||||
|
||||
Next you should run Configure:
|
||||
|
||||
@@ -73,16 +52,16 @@
|
||||
|
||||
Then from the VC++ environment at a prompt do:
|
||||
|
||||
- to build static libraries:
|
||||
|
||||
> nmake -f ms\ce.mak
|
||||
|
||||
- or to build DLLs:
|
||||
|
||||
> nmake -f ms\cedll.mak
|
||||
|
||||
[note that static builds are not supported under CE]
|
||||
|
||||
If all is well it should compile and you will have some DLLs and executables
|
||||
in out32dll*.
|
||||
|
||||
<<< everyting below needs revision in respect to wcecompat vs. PortSDK >>>
|
||||
|
||||
If you want
|
||||
If all is well it should compile and you will have some static libraries and
|
||||
executables in out32, or some DLLs and executables in out32dll. If you want
|
||||
to try the tests then make sure the ceutils are in the path and do:
|
||||
|
||||
> cd out32
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
354
Makefile.org
354
Makefile.org
@@ -65,12 +65,13 @@ EX_LIBS=
|
||||
EXE_EXT=
|
||||
ARFLAGS=
|
||||
AR=ar $(ARFLAGS) r
|
||||
ARD=ar $(ARFLAGS) d
|
||||
RANLIB= ranlib
|
||||
NM= nm
|
||||
PERL= perl
|
||||
TAR= tar
|
||||
TARFLAGS= --no-recursion
|
||||
TARFLAGS= --no-recursion --record-size=10240
|
||||
MAKEDEPPROG=makedepend
|
||||
LIBDIR=lib
|
||||
|
||||
# We let the C compiler driver to take care of .s files. This is done in
|
||||
# order to be excused from maintaining a separate set of architecture
|
||||
@@ -88,7 +89,7 @@ PROCESSOR=
|
||||
CPUID_OBJ=
|
||||
BN_ASM= bn_asm.o
|
||||
DES_ENC= des_enc.o fcrypt_b.o
|
||||
AES_ENC= aes_core.o aes_cbc.o
|
||||
AES_ASM_OBJ=aes_core.o aes_cbc.o
|
||||
BF_ENC= bf_enc.o
|
||||
CAST_ENC= c_enc.o
|
||||
RC4_ENC= rc4_enc.o
|
||||
@@ -96,9 +97,6 @@ RC5_ENC= rc5_enc.o
|
||||
MD5_ASM_OBJ=
|
||||
SHA1_ASM_OBJ=
|
||||
RMD160_ASM_OBJ=
|
||||
WP_ASM_OBJ=
|
||||
CMLL_ENC=
|
||||
PERLASM_SCHEME=
|
||||
|
||||
# KRB5 stuff
|
||||
KRB5_INCLUDES=
|
||||
@@ -108,19 +106,44 @@ LIBKRB5=
|
||||
ZLIB_INCLUDE=
|
||||
LIBZLIB=
|
||||
|
||||
DIRS= crypto ssl engines apps test tools
|
||||
ENGDIRS= ccgost
|
||||
SHLIBDIRS= crypto ssl
|
||||
# This is the location of fipscanister.o and friends.
|
||||
# The FIPS module build will place it $(INSTALLTOP)/lib
|
||||
# but since $(INSTALLTOP) can only take the default value
|
||||
# when the module is built it will be in /usr/local/ssl/lib
|
||||
# $(INSTALLTOP) for this build make be different so hard
|
||||
# code the path.
|
||||
|
||||
FIPSLIBDIR=/usr/local/ssl/$(LIBDIR)/
|
||||
|
||||
# This is set to "y" if fipscanister.o is compiled internally as
|
||||
# opposed to coming from an external validated location.
|
||||
|
||||
FIPSCANISTERINTERNAL=n
|
||||
|
||||
# The location of the library which contains fipscanister.o
|
||||
# normally it will be libcrypto unless fipsdso is set in which
|
||||
# case it will be libfips. If not compiling in FIPS mode at all
|
||||
# this is empty making it a useful test for a FIPS compile.
|
||||
|
||||
FIPSCANLIB=
|
||||
|
||||
# Shared library base address. Currently only used on Windows.
|
||||
#
|
||||
|
||||
BASEADDR=
|
||||
|
||||
DIRS= crypto fips ssl engines apps test tools
|
||||
SHLIBDIRS= crypto ssl fips
|
||||
|
||||
# dirs in crypto to build
|
||||
SDIRS= \
|
||||
objects \
|
||||
md2 md4 md5 sha mdc2 hmac ripemd whrlpool \
|
||||
des aes rc2 rc4 rc5 idea bf cast camellia seed modes \
|
||||
md2 md4 md5 sha mdc2 hmac ripemd \
|
||||
des aes rc2 rc4 rc5 idea bf cast camellia seed \
|
||||
bn ec rsa dsa ecdsa dh ecdh dso engine \
|
||||
buffer bio stack lhash rand err \
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
|
||||
cms pqueue ts jpake store
|
||||
store cms pqueue jpake
|
||||
# keep in mind that the above list is adjusted by ./Configure
|
||||
# according to no-xxx arguments...
|
||||
|
||||
@@ -134,8 +157,6 @@ MANDIR=$(OPENSSLDIR)/man
|
||||
MAN1=1
|
||||
MAN3=3
|
||||
MANSUFFIX=
|
||||
HTMLSUFFIX=html
|
||||
HTMLDIR=$(OPENSSLDIR)/html
|
||||
SHELL=/bin/sh
|
||||
|
||||
TOP= .
|
||||
@@ -145,6 +166,7 @@ WDIRS= windows
|
||||
LIBS= libcrypto.a libssl.a
|
||||
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
|
||||
SHARED_SSL=libssl$(SHLIB_EXT)
|
||||
SHARED_FIPS=
|
||||
SHARED_LIBS=
|
||||
SHARED_LIBS_LINK_EXTS=
|
||||
SHARED_LDFLAGS=
|
||||
@@ -175,34 +197,34 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
|
||||
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
|
||||
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
|
||||
|
||||
BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
|
||||
CC='$(CC)' CFLAG='$(CFLAG)' \
|
||||
AS='$(CC)' ASFLAG='$(CFLAG) -c' \
|
||||
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
|
||||
CROSS_COMPILE_PREFIX='$(CROSS_COMPILE_PREFIX)' \
|
||||
PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
|
||||
SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/lib' \
|
||||
INSTALL_PREFIX='$(INSTALL_PREFIX)' \
|
||||
INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
|
||||
MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
|
||||
DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \
|
||||
MAKEDEPPROG='$(MAKEDEPPROG)' \
|
||||
SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
|
||||
KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \
|
||||
ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
|
||||
EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
|
||||
SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
|
||||
PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
|
||||
CPUID_OBJ='$(CPUID_OBJ)' \
|
||||
BN_ASM='$(BN_ASM)' DES_ENC='$(DES_ENC)' \
|
||||
AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
|
||||
BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
|
||||
RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
|
||||
SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
|
||||
MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
|
||||
RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
|
||||
WP_ASM_OBJ='$(WP_ASM_OBJ)' \
|
||||
PERLASM_SCHEME='$(PERLASM_SCHEME)' \
|
||||
BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
|
||||
CC='${CC}' CFLAG='${CFLAG}' \
|
||||
AS='${CC}' ASFLAG='${CFLAG} -c' \
|
||||
AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}' \
|
||||
SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/$(LIBDIR)' \
|
||||
INSTALL_PREFIX='${INSTALL_PREFIX}' \
|
||||
INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' \
|
||||
LIBDIR='${LIBDIR}' \
|
||||
MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD ${MAKEDEPPROG}' \
|
||||
DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}' \
|
||||
MAKEDEPPROG='${MAKEDEPPROG}' \
|
||||
SHARED_LDFLAGS='${SHARED_LDFLAGS}' \
|
||||
KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' \
|
||||
EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' \
|
||||
SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \
|
||||
PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' \
|
||||
CPUID_OBJ='${CPUID_OBJ}' \
|
||||
BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' \
|
||||
AES_ASM_OBJ='${AES_ASM_OBJ}' \
|
||||
BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' \
|
||||
RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' \
|
||||
SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' \
|
||||
MD5_ASM_OBJ='${MD5_ASM_OBJ}' \
|
||||
RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' \
|
||||
FIPSLIBDIR='${FIPSLIBDIR}' \
|
||||
FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
|
||||
FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}' \
|
||||
FIPS_EX_OBJ='${FIPS_EX_OBJ}' \
|
||||
THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
|
||||
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
|
||||
# which in turn eliminates ambiguities in variable treatment with -e.
|
||||
@@ -221,44 +243,127 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
|
||||
# subdirectories defined in $(DIRS). It requires that the target
|
||||
# is given through the shell variable `target'.
|
||||
BUILD_CMD= if [ -d "$$dir" ]; then \
|
||||
( cd $$dir && echo "making $$target in $$dir..." && \
|
||||
( [ $$target != all -a -z "$(FIPSCANLIB)" ] && FIPSCANLIB=/dev/null; \
|
||||
cd $$dir && echo "making $$target in $$dir..." && \
|
||||
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
|
||||
) || exit 1; \
|
||||
fi
|
||||
RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
|
||||
BUILD_ONE_CMD=\
|
||||
if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
|
||||
if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \
|
||||
$(BUILD_CMD); \
|
||||
fi
|
||||
|
||||
reflect:
|
||||
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
|
||||
|
||||
FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
|
||||
../crypto/aes/aes_ecb.o \
|
||||
../crypto/aes/aes_ofb.o \
|
||||
../crypto/bn/bn_add.o \
|
||||
../crypto/bn/bn_blind.o \
|
||||
../crypto/bn/bn_ctx.o \
|
||||
../crypto/bn/bn_div.o \
|
||||
../crypto/bn/bn_exp2.o \
|
||||
../crypto/bn/bn_exp.o \
|
||||
../crypto/bn/bn_gcd.o \
|
||||
../crypto/bn/bn_lib.o \
|
||||
../crypto/bn/bn_mod.o \
|
||||
../crypto/bn/bn_mont.o \
|
||||
../crypto/bn/bn_mul.o \
|
||||
../crypto/bn/bn_prime.o \
|
||||
../crypto/bn/bn_rand.o \
|
||||
../crypto/bn/bn_recp.o \
|
||||
../crypto/bn/bn_shift.o \
|
||||
../crypto/bn/bn_sqr.o \
|
||||
../crypto/bn/bn_word.o \
|
||||
../crypto/bn/bn_x931p.o \
|
||||
../crypto/buffer/buf_str.o \
|
||||
../crypto/cryptlib.o \
|
||||
../crypto/des/cfb64ede.o \
|
||||
../crypto/des/cfb64enc.o \
|
||||
../crypto/des/cfb_enc.o \
|
||||
../crypto/des/ecb3_enc.o \
|
||||
../crypto/des/ecb_enc.o \
|
||||
../crypto/des/ofb64ede.o \
|
||||
../crypto/des/ofb64enc.o \
|
||||
../crypto/des/fcrypt.o \
|
||||
../crypto/des/set_key.o \
|
||||
../crypto/dsa/dsa_utl.o \
|
||||
../crypto/dsa/dsa_sign.o \
|
||||
../crypto/dsa/dsa_vrf.o \
|
||||
../crypto/err/err.o \
|
||||
../crypto/evp/digest.o \
|
||||
../crypto/evp/enc_min.o \
|
||||
../crypto/evp/e_aes.o \
|
||||
../crypto/evp/e_des3.o \
|
||||
../crypto/evp/p_sign.o \
|
||||
../crypto/evp/p_verify.o \
|
||||
../crypto/mem_clr.o \
|
||||
../crypto/mem.o \
|
||||
../crypto/rand/md_rand.o \
|
||||
../crypto/rand/rand_egd.o \
|
||||
../crypto/rand/randfile.o \
|
||||
../crypto/rand/rand_lib.o \
|
||||
../crypto/rand/rand_os2.o \
|
||||
../crypto/rand/rand_unix.o \
|
||||
../crypto/rand/rand_win.o \
|
||||
../crypto/rsa/rsa_lib.o \
|
||||
../crypto/rsa/rsa_none.o \
|
||||
../crypto/rsa/rsa_oaep.o \
|
||||
../crypto/rsa/rsa_pk1.o \
|
||||
../crypto/rsa/rsa_pss.o \
|
||||
../crypto/rsa/rsa_ssl.o \
|
||||
../crypto/rsa/rsa_x931.o \
|
||||
../crypto/sha/sha1dgst.o \
|
||||
../crypto/sha/sha256.o \
|
||||
../crypto/sha/sha512.o \
|
||||
../crypto/uid.o
|
||||
|
||||
sub_all: build_all
|
||||
build_all: build_libs build_apps build_tests build_tools
|
||||
|
||||
build_libs: build_crypto build_ssl build_engines
|
||||
build_libs: build_crypto build_fips build_ssl build_shared build_engines
|
||||
|
||||
build_crypto:
|
||||
@dir=crypto; target=all; $(BUILD_ONE_CMD)
|
||||
build_ssl:
|
||||
if [ -n "$(FIPSCANLIB)" ]; then \
|
||||
EXCL_OBJ='$(AES_ASM_OBJ) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA1_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
|
||||
ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
|
||||
else \
|
||||
ARX='${AR}' ; \
|
||||
fi ; export ARX ; \
|
||||
dir=crypto; target=all; $(BUILD_ONE_CMD)
|
||||
build_fips:
|
||||
@dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
|
||||
build_ssl: build_crypto
|
||||
@dir=ssl; target=all; $(BUILD_ONE_CMD)
|
||||
build_engines:
|
||||
build_engines: build_crypto
|
||||
@dir=engines; target=all; $(BUILD_ONE_CMD)
|
||||
build_apps:
|
||||
build_apps: build_libs
|
||||
@dir=apps; target=all; $(BUILD_ONE_CMD)
|
||||
build_tests:
|
||||
build_tests: build_libs
|
||||
@dir=test; target=all; $(BUILD_ONE_CMD)
|
||||
build_tools:
|
||||
build_tools: build_libs
|
||||
@dir=tools; target=all; $(BUILD_ONE_CMD)
|
||||
|
||||
all_testapps: build_libs build_testapps
|
||||
build_testapps:
|
||||
@dir=crypto; target=testapps; $(BUILD_ONE_CMD)
|
||||
|
||||
libcrypto$(SHLIB_EXT): libcrypto.a
|
||||
build_shared: $(SHARED_LIBS)
|
||||
libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS)
|
||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||
$(MAKE) SHLIBDIRS=crypto build-shared; \
|
||||
if [ "$(FIPSCANLIB)" = "libfips" ]; then \
|
||||
$(ARD) libcrypto.a fipscanister.o ; \
|
||||
$(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
|
||||
$(AR) libcrypto.a fips/fipscanister.o ; \
|
||||
else \
|
||||
if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
|
||||
FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
|
||||
export CC FIPSLD_CC; \
|
||||
fi; \
|
||||
$(MAKE) -e SHLIBDIRS='crypto' build-shared; \
|
||||
fi \
|
||||
else \
|
||||
echo "There's no support for shared libraries on this platform" >&2; \
|
||||
exit 1; \
|
||||
@@ -266,12 +371,32 @@ libcrypto$(SHLIB_EXT): libcrypto.a
|
||||
|
||||
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
|
||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||
$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
|
||||
shlibdeps=-lcrypto; \
|
||||
[ "$(FIPSCANLIB)" = "libfips" ] && shlibdeps="$$shlibdeps -lfips"; \
|
||||
$(MAKE) SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \
|
||||
else \
|
||||
echo "There's no support for shared libraries on this platform" >&2 ; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
fips/fipscanister.o: build_fips
|
||||
libfips$(SHLIB_EXT): fips/fipscanister.o
|
||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||
FIPSLD_CC="$(CC)"; CC=fips/fipsld; export CC FIPSLD_CC; \
|
||||
$(MAKE) -f Makefile.shared -e $(BUILDENV) \
|
||||
CC=$${CC} LIBNAME=fips THIS=$@ \
|
||||
LIBEXTRAS=fips/fipscanister.o \
|
||||
LIBDEPS="$(EX_LIBS)" \
|
||||
LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
link_o.$(SHLIB_TARGET) || { rm -f $@; exit 1; } \
|
||||
else \
|
||||
echo "There's no support for shared libraries on this platform" >&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
libfips.a:
|
||||
dir=fips; target=all; $(BUILD_ONE_CMD)
|
||||
|
||||
clean-shared:
|
||||
@set -e; for i in $(SHLIBDIRS); do \
|
||||
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
||||
@@ -287,10 +412,10 @@ clean-shared:
|
||||
done
|
||||
|
||||
link-shared:
|
||||
@ set -e; for i in $(SHLIBDIRS); do \
|
||||
@ set -e; for i in ${SHLIBDIRS}; do \
|
||||
$(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
|
||||
LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
|
||||
LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
|
||||
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
||||
symlink.$(SHLIB_TARGET); \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
@@ -298,13 +423,13 @@ link-shared:
|
||||
build-shared: do_$(SHLIB_TARGET) link-shared
|
||||
|
||||
do_$(SHLIB_TARGET):
|
||||
@ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
|
||||
if [ "$(SHLIBDIRS)" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
@ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||
libs="$(LIBKRB5) $$libs"; \
|
||||
fi; \
|
||||
$(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
|
||||
LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
|
||||
LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
|
||||
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
||||
LIBDEPS="$$libs $(EX_LIBS)" \
|
||||
link_a.$(SHLIB_TARGET); \
|
||||
libs="-l$$i $$libs"; \
|
||||
@@ -313,7 +438,7 @@ do_$(SHLIB_TARGET):
|
||||
libcrypto.pc: Makefile
|
||||
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
||||
echo 'exec_prefix=$${prefix}'; \
|
||||
echo 'libdir=$${exec_prefix}/lib'; \
|
||||
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
|
||||
echo 'includedir=$${prefix}/include'; \
|
||||
echo ''; \
|
||||
echo 'Name: OpenSSL-libcrypto'; \
|
||||
@@ -326,7 +451,7 @@ libcrypto.pc: Makefile
|
||||
libssl.pc: Makefile
|
||||
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
||||
echo 'exec_prefix=$${prefix}'; \
|
||||
echo 'libdir=$${exec_prefix}/lib'; \
|
||||
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
|
||||
echo 'includedir=$${prefix}/include'; \
|
||||
echo ''; \
|
||||
echo 'Name: OpenSSL'; \
|
||||
@@ -339,7 +464,7 @@ libssl.pc: Makefile
|
||||
openssl.pc: Makefile
|
||||
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
||||
echo 'exec_prefix=$${prefix}'; \
|
||||
echo 'libdir=$${exec_prefix}/lib'; \
|
||||
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
|
||||
echo 'includedir=$${prefix}/include'; \
|
||||
echo ''; \
|
||||
echo 'Name: OpenSSL'; \
|
||||
@@ -381,32 +506,34 @@ links:
|
||||
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
||||
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
||||
@set -e; target=links; $(RECURSIVE_BUILD_CMD)
|
||||
@if [ -z "$(FIPSCANLIB)" ]; then \
|
||||
set -e; target=links; dir=fips ; $(BUILD_CMD) ; \
|
||||
fi
|
||||
|
||||
gentests:
|
||||
@(cd test && echo "generating dummy tests (if needed)..." && \
|
||||
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
|
||||
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
|
||||
|
||||
dclean:
|
||||
rm -rf *.bak include/openssl certs/.0
|
||||
rm -f *.bak
|
||||
@set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
|
||||
|
||||
rehash: rehash.time
|
||||
rehash.time: certs apps
|
||||
@if [ -z "$(CROSS_COMPILE_PREFIX)" ]; then \
|
||||
@if [ -z "$(CROSS_COMPILE)" ]; then \
|
||||
(OPENSSL="`pwd`/util/opensslwrap.sh"; \
|
||||
[ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
|
||||
OPENSSL_DEBUG_MEMORY=on; \
|
||||
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
||||
$(PERL) tools/c_rehash certs) && \
|
||||
touch rehash.time; \
|
||||
else :; fi
|
||||
fi
|
||||
|
||||
test: tests
|
||||
|
||||
tests: rehash
|
||||
@(cd test && echo "testing..." && \
|
||||
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
|
||||
OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
|
||||
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
|
||||
util/opensslwrap.sh version -a
|
||||
|
||||
report:
|
||||
@$(PERL) util/selftest.pl
|
||||
@@ -439,8 +566,6 @@ crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
|
||||
$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
|
||||
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
|
||||
$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
|
||||
crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
|
||||
$(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
|
||||
|
||||
apps/openssl-vms.cnf: apps/openssl.cnf
|
||||
$(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
|
||||
@@ -453,7 +578,7 @@ TABLE: Configure
|
||||
(echo 'Output of `Configure TABLE'"':"; \
|
||||
$(PERL) Configure TABLE) > TABLE
|
||||
|
||||
update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
|
||||
update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
|
||||
|
||||
# Build distribution tar-file. As the list of files returned by "find" is
|
||||
# pretty long, on several platforms a "too many arguments" error or similar
|
||||
@@ -484,8 +609,8 @@ tar-snap:
|
||||
dist:
|
||||
$(PERL) Configure dist
|
||||
@$(MAKE) dist_pem_h
|
||||
@$(MAKE) SDIRS='$(SDIRS)' clean
|
||||
@$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
|
||||
@$(MAKE) SDIRS='${SDIRS}' clean
|
||||
@$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
|
||||
|
||||
dist_pem_h:
|
||||
(cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
|
||||
@@ -494,9 +619,9 @@ install: all install_docs install_sw
|
||||
|
||||
install_sw:
|
||||
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
|
||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
|
||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
|
||||
@@ -511,10 +636,10 @@ install_sw:
|
||||
do \
|
||||
if [ -f "$$i" ]; then \
|
||||
( echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
|
||||
fi; \
|
||||
done;
|
||||
@set -e; if [ -n "$(SHARED_LIBS)" ]; then \
|
||||
@@ -524,32 +649,22 @@ install_sw:
|
||||
if [ -f "$$i" -o -f "$$i.a" ]; then \
|
||||
( echo installing $$i; \
|
||||
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
|
||||
else \
|
||||
c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
|
||||
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
|
||||
fi ); \
|
||||
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
|
||||
( case $$i in \
|
||||
*crypto*) i=libeay32.dll;; \
|
||||
*ssl*) i=ssleay32.dll;; \
|
||||
esac; \
|
||||
echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
( here="`pwd`"; \
|
||||
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||
cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
|
||||
$(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
|
||||
if [ "$(INSTALLTOP)" != "/usr" ]; then \
|
||||
echo 'OpenSSL shared libraries have been installed in:'; \
|
||||
@@ -558,33 +673,12 @@ install_sw:
|
||||
sed -e '1,/^$$/d' doc/openssl-shared.txt; \
|
||||
fi; \
|
||||
fi
|
||||
cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libcrypto.pc
|
||||
cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libssl.pc
|
||||
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
|
||||
|
||||
install_html_docs:
|
||||
here="`pwd`"; \
|
||||
for subdir in apps crypto ssl; do \
|
||||
mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
|
||||
for i in doc/$$subdir/*.pod; do \
|
||||
fn=`basename $$i .pod`; \
|
||||
echo "installing html/$$fn.$(HTMLSUFFIX)"; \
|
||||
cat $$i \
|
||||
| sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
|
||||
| pod2html --podroot=doc --htmlroot=.. --podpath=apps:crypto:ssl \
|
||||
| sed -r 's/<!DOCTYPE.*//g' \
|
||||
> $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
|
||||
$(PERL) util/extract-names.pl < $$i | \
|
||||
grep -v $$filecase "^$$fn\$$" | \
|
||||
(cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
|
||||
while read n; do \
|
||||
PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
|
||||
done); \
|
||||
done; \
|
||||
done
|
||||
cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
|
||||
cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
|
||||
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
|
||||
|
||||
install_docs:
|
||||
@$(PERL) $(TOP)/util/mkdir-p.pl \
|
||||
@@ -592,7 +686,7 @@ install_docs:
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man3 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man7
|
||||
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
|
||||
@pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
|
||||
here="`pwd`"; \
|
||||
filecase=; \
|
||||
if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
|
||||
@@ -612,7 +706,7 @@ install_docs:
|
||||
(grep -v "[ ]"; true) | \
|
||||
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||
while read n; do \
|
||||
PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||
done); \
|
||||
done; \
|
||||
set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
||||
@@ -629,7 +723,7 @@ install_docs:
|
||||
(grep -v "[ ]"; true) | \
|
||||
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||
while read n; do \
|
||||
PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||
done); \
|
||||
done
|
||||
|
||||
|
||||
118
Makefile.shared
118
Makefile.shared
@@ -14,8 +14,6 @@ CFLAGS=$(CFLAG)
|
||||
LDFLAGS=
|
||||
SHARED_LDFLAGS=
|
||||
|
||||
NM=nm
|
||||
|
||||
# LIBNAME contains just the name of the library, without prefix ("lib"
|
||||
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
|
||||
# .dll, ...). This one MUST have a value when using this makefile to
|
||||
@@ -93,7 +91,7 @@ LINK_APP= \
|
||||
( $(SET_X); \
|
||||
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
|
||||
LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
|
||||
LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
|
||||
LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
|
||||
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
||||
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
||||
$${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
|
||||
@@ -103,7 +101,7 @@ LINK_SO= \
|
||||
LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
|
||||
SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
|
||||
SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
|
||||
LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
|
||||
LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
|
||||
LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
|
||||
LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
|
||||
$${SHAREDCMD} $${SHAREDFLAGS} \
|
||||
@@ -144,7 +142,7 @@ LINK_SO_A_UNPACKED= \
|
||||
SHOBJECTS=$$UNPACKDIR/*.o; \
|
||||
$(LINK_SO) && rm -rf $$UNPACKDIR
|
||||
|
||||
DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
||||
DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
||||
|
||||
DO_GNU_SO=$(CALC_VERSIONS); \
|
||||
SHLIB=lib$(LIBNAME).so; \
|
||||
@@ -170,19 +168,8 @@ link_a.gnu:
|
||||
link_app.gnu:
|
||||
@ $(DO_GNU_APP); $(LINK_APP)
|
||||
|
||||
DO_BEOS_SO= SHLIB=lib$(LIBNAME).so; \
|
||||
SHLIB_SUFFIX=; \
|
||||
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
||||
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SUFFIX"
|
||||
|
||||
link_o.beos:
|
||||
@ $(DO_BEOS_SO); $(LINK_SO_O)
|
||||
link_a.beos:
|
||||
@ $(DO_BEOS_SO); $(LINK_SO_A)
|
||||
|
||||
link_o.bsd:
|
||||
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
||||
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
||||
$(CALC_VERSIONS); \
|
||||
SHLIB=lib$(LIBNAME).so; \
|
||||
SHLIB_SUFFIX=; \
|
||||
@@ -192,7 +179,7 @@ link_o.bsd:
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
|
||||
fi; $(LINK_SO_O)
|
||||
link_a.bsd:
|
||||
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
||||
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
||||
$(CALC_VERSIONS); \
|
||||
SHLIB=lib$(LIBNAME).so; \
|
||||
SHLIB_SUFFIX=; \
|
||||
@@ -202,7 +189,7 @@ link_a.bsd:
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
|
||||
fi; $(LINK_SO_A)
|
||||
link_app.bsd:
|
||||
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
|
||||
@if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
|
||||
LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \
|
||||
fi; $(LINK_APP)
|
||||
|
||||
@@ -213,8 +200,10 @@ link_app.bsd:
|
||||
# to use native NSModule(3) API and refers to dlfcn as termporary hack.
|
||||
link_o.darwin:
|
||||
@ $(CALC_VERSIONS); \
|
||||
SHLIB=lib$(LIBNAME); \
|
||||
SHLIB_SUFFIX=.so; \
|
||||
SHLIB=`expr "$$THIS" : '.*/\([^/\.]*\)\.'`; \
|
||||
SHLIB=$${SHLIB:-lib$(LIBNAME)}; \
|
||||
SHLIB_SUFFIX=`expr "$$THIS" : '.*\(\.[^\.]*\)$$'`; \
|
||||
SHLIB_SUFFIX=$${SHLIB_SUFFIX:-.so}; \
|
||||
ALLSYMSFLAGS='-all_load'; \
|
||||
NOALLSYMSFLAGS=''; \
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS)"; \
|
||||
@@ -238,7 +227,7 @@ link_a.darwin:
|
||||
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
||||
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
||||
fi; \
|
||||
SHAREDFLAGS="$$SHAREDFLAGS -install_name $(INSTALLTOP)/lib/$$SHLIB$(SHLIB_EXT)"; \
|
||||
SHAREDFLAGS="$$SHAREDFLAGS -install_name ${INSTALLTOP}/lib/$$SHLIB${SHLIB_EXT}"; \
|
||||
$(LINK_SO_A)
|
||||
link_app.darwin: # is there run-path on darwin?
|
||||
$(LINK_APP)
|
||||
@@ -248,59 +237,40 @@ link_o.cygwin:
|
||||
INHIBIT_SYMLINKS=yes; \
|
||||
SHLIB=cyg$(LIBNAME); \
|
||||
base=-Wl,--enable-auto-image-base; \
|
||||
deffile=; \
|
||||
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
|
||||
SHLIB=$(LIBNAME)eay32; base=; \
|
||||
if test -f $(LIBNAME)eay32.def; then \
|
||||
deffile=$(LIBNAME)eay32.def; \
|
||||
fi; \
|
||||
fi; \
|
||||
SHLIB_SUFFIX=.dll; \
|
||||
LIBVERSION="$(LIBVERSION)"; \
|
||||
SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \
|
||||
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
||||
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
|
||||
$(LINK_SO_O)
|
||||
#for mingw target if def-file is in use dll-name should match library-name
|
||||
link_a.cygwin:
|
||||
@ $(CALC_VERSIONS); \
|
||||
INHIBIT_SYMLINKS=yes; \
|
||||
SHLIB=cyg$(LIBNAME); SHLIB_SOVER=-$(LIBVERSION); SHLIB_SUFFIX=.dll; \
|
||||
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; extras=; \
|
||||
SHLIB=cyg$(LIBNAME); \
|
||||
base=-Wl,--enable-auto-image-base; \
|
||||
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
|
||||
case $(LIBNAME) in \
|
||||
crypto) SHLIB=libeay;; \
|
||||
ssl) SHLIB=ssleay;; \
|
||||
esac; \
|
||||
SHLIB_SOVER=32; \
|
||||
extras="$(LIBNAME).def"; \
|
||||
$(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \
|
||||
base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
|
||||
SHLIB=$(LIBNAME)eay32; \
|
||||
base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
|
||||
fi; \
|
||||
dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
|
||||
$(PERL) util/mkrc.pl $$dll_name | \
|
||||
$(CROSS_COMPILE_PREFIX)windres -o rc.o; \
|
||||
extras="$$extras rc.o"; \
|
||||
SHLIB_SUFFIX=.dll; \
|
||||
SHLIB_SOVER=-$(LIBVERSION); \
|
||||
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
||||
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \
|
||||
[ -f apps/$$dll_name ] && rm apps/$$dll_name; \
|
||||
[ -f test/$$dll_name ] && rm test/$$dll_name; \
|
||||
SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
|
||||
[ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \
|
||||
[ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \
|
||||
$(LINK_SO_A) || exit 1; \
|
||||
rm $$extras; \
|
||||
cp -p $$dll_name apps/; \
|
||||
cp -p $$dll_name test/
|
||||
cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX apps/; \
|
||||
cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX test/
|
||||
link_app.cygwin:
|
||||
@if expr "$(CFLAGS)" : '.*OPENSSL_USE_APPLINK' > /dev/null; then \
|
||||
LIBDEPS="$(TOP)/crypto/applink.o $${LIBDEPS:-$(LIBDEPS)}"; \
|
||||
export LIBDEPS; \
|
||||
fi; \
|
||||
$(LINK_APP)
|
||||
|
||||
link_o.alpha-osf1:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
SHLIB=lib$(LIBNAME).so; \
|
||||
@@ -321,7 +291,7 @@ link_o.alpha-osf1:
|
||||
fi; \
|
||||
$(LINK_SO_O)
|
||||
link_a.alpha-osf1:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
SHLIB=lib$(LIBNAME).so; \
|
||||
@@ -342,7 +312,7 @@ link_a.alpha-osf1:
|
||||
fi; \
|
||||
$(LINK_SO_A)
|
||||
link_app.alpha-osf1:
|
||||
@if $(DETECT_GNU_LD); then \
|
||||
@if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_APP); \
|
||||
else \
|
||||
LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
|
||||
@@ -350,7 +320,7 @@ link_app.alpha-osf1:
|
||||
$(LINK_APP)
|
||||
|
||||
link_o.solaris:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
@@ -364,12 +334,12 @@ link_o.solaris:
|
||||
fi; \
|
||||
$(LINK_SO_O)
|
||||
link_a.solaris:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
MINUSZ='-z '; \
|
||||
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
||||
SHLIB=lib$(LIBNAME).so; \
|
||||
SHLIB_SUFFIX=;\
|
||||
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
|
||||
@@ -378,7 +348,7 @@ link_a.solaris:
|
||||
fi; \
|
||||
$(LINK_SO_A)
|
||||
link_app.solaris:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_APP); \
|
||||
else \
|
||||
LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \
|
||||
@@ -387,7 +357,7 @@ link_app.solaris:
|
||||
|
||||
# OpenServer 5 native compilers used
|
||||
link_o.svr3:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
@@ -399,7 +369,7 @@ link_o.svr3:
|
||||
fi; \
|
||||
$(LINK_SO_O)
|
||||
link_a.svr3:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
@@ -411,12 +381,12 @@ link_a.svr3:
|
||||
fi; \
|
||||
$(LINK_SO_A_UNPACKED)
|
||||
link_app.svr3:
|
||||
@$(DETECT_GNU_LD) && $(DO_GNU_APP); \
|
||||
@${DETECT_GNU_LD} && $(DO_GNU_APP); \
|
||||
$(LINK_APP)
|
||||
|
||||
# UnixWare 7 and OpenUNIX 8 native compilers used
|
||||
link_o.svr5:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
@@ -430,12 +400,12 @@ link_o.svr5:
|
||||
fi; \
|
||||
$(LINK_SO_O)
|
||||
link_a.svr5:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
SHARE_FLAG='-G'; \
|
||||
($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
|
||||
SHLIB=lib$(LIBNAME).so; \
|
||||
SHLIB_SUFFIX=; \
|
||||
ALLSYMSFLAGS=''; \
|
||||
@@ -444,11 +414,11 @@ link_a.svr5:
|
||||
fi; \
|
||||
$(LINK_SO_A_UNPACKED)
|
||||
link_app.svr5:
|
||||
@$(DETECT_GNU_LD) && $(DO_GNU_APP); \
|
||||
@${DETECT_GNU_LD} && $(DO_GNU_APP); \
|
||||
$(LINK_APP)
|
||||
|
||||
link_o.irix:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
@@ -462,7 +432,7 @@ link_o.irix:
|
||||
fi; \
|
||||
$(LINK_SO_O)
|
||||
link_a.irix:
|
||||
@ if $(DETECT_GNU_LD); then \
|
||||
@ if ${DETECT_GNU_LD}; then \
|
||||
$(DO_GNU_SO); \
|
||||
else \
|
||||
$(CALC_VERSIONS); \
|
||||
@@ -488,7 +458,7 @@ link_app.irix:
|
||||
# ELFs by the way].
|
||||
#
|
||||
link_o.hpux:
|
||||
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
||||
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
||||
$(CALC_VERSIONS); \
|
||||
SHLIB=lib$(LIBNAME).sl; \
|
||||
expr "$(CFLAGS)" : '.*DSO_DLFCN' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
||||
@@ -501,7 +471,7 @@ link_o.hpux:
|
||||
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
|
||||
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||
link_a.hpux:
|
||||
@if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
|
||||
@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
|
||||
$(CALC_VERSIONS); \
|
||||
SHLIB=lib$(LIBNAME).sl; \
|
||||
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
||||
@@ -514,7 +484,7 @@ link_a.hpux:
|
||||
rm -f $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX || :; \
|
||||
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||
link_app.hpux:
|
||||
@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
|
||||
@if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
|
||||
LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
|
||||
fi; \
|
||||
$(LINK_APP)
|
||||
@@ -579,7 +549,7 @@ symlink.hpux:
|
||||
expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \
|
||||
$(SYMLINK_SO)
|
||||
# The following lines means those specific architectures do no symlinks
|
||||
symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos:
|
||||
symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
|
||||
|
||||
# Compatibility targets
|
||||
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
|
||||
@@ -637,7 +607,3 @@ link_o.reliantunix-shared: link_o.reliantunix
|
||||
link_a.reliantunix-shared: link_a.reliantunix
|
||||
link_app.reliantunix-shared: link_app.reliantunix
|
||||
symlink.reliantunix-shared: symlink.reliantunix
|
||||
link_o.beos-shared: link_o.beos
|
||||
link_a.beos-shared: link_a.beos
|
||||
link_app.beos-shared: link_app.gnu
|
||||
symlink.beos-shared: symlink.beos
|
||||
|
||||
231
NEWS
231
NEWS
@@ -5,53 +5,156 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 0.9.8k and OpenSSL 1.0:
|
||||
Major changes between OpenSSL 0.9.8ze and OpenSSL 0.9.8zf [under development]
|
||||
|
||||
o
|
||||
|
||||
o RFC3280 path validation: sufficient to process PKITS tests.
|
||||
o Integrated support for PVK files and keyblobs.
|
||||
o Change default private key format to PKCS#8.
|
||||
o CMS support: able to process all examples in RFC4134
|
||||
o Streaming ASN1 encode support for PKCS#7 and CMS.
|
||||
o Multiple signer and signer add support for PKCS#7 and CMS.
|
||||
o ASN1 printing support.
|
||||
o Whirlpool hash algorithm added.
|
||||
o RFC3161 time stamp support.
|
||||
o New generalised public key API supporting ENGINE based algorithms.
|
||||
o New generalised public key API utilities.
|
||||
o New ENGINE supporting GOST algorithms.
|
||||
o SSL/TLS GOST ciphersuite support.
|
||||
o PKCS#7 and CMS GOST support.
|
||||
o RFC4279 PSK ciphersuite support.
|
||||
o Supported points format extension for ECC ciphersuites.
|
||||
o ecdsa-with-SHA224/256/384/512 signature types.
|
||||
o dsa-with-SHA224 and dsa-with-SHA256 signature types.
|
||||
o Opaque PRF Input TLS extension support.
|
||||
o Updated time routines to avoid OS limitations.
|
||||
Major changes between OpenSSL 0.9.8zd and OpenSSL 0.9.8ze [15 Jan 2015]
|
||||
|
||||
Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k:
|
||||
o Build fixes for the Windows and OpenVMS platforms
|
||||
|
||||
Major changes between OpenSSL 0.9.8zc and OpenSSL 0.9.8zd [8 Jan 2015]
|
||||
|
||||
o Fix for CVE-2014-3571
|
||||
o Fix for CVE-2014-3569
|
||||
o Fix for CVE-2014-3572
|
||||
o Fix for CVE-2015-0204
|
||||
o Fix for CVE-2014-8275
|
||||
o Fix for CVE-2014-3570
|
||||
|
||||
Major changes between OpenSSL 0.9.8zb and OpenSSL 0.9.8zc [15 Oct 2014]:
|
||||
|
||||
o Fix for CVE-2014-3513
|
||||
o Fix for CVE-2014-3567
|
||||
o Mitigation for CVE-2014-3566 (SSL protocol vulnerability)
|
||||
o Fix for CVE-2014-3568
|
||||
|
||||
Major changes between OpenSSL 0.9.8za and OpenSSL 0.9.8zb [6 Aug 2014]:
|
||||
|
||||
o Fix for CVE-2014-3510
|
||||
o Fix for CVE-2014-3507
|
||||
o Fix for CVE-2014-3506
|
||||
o Fix for CVE-2014-3505
|
||||
o Fix for CVE-2014-3508
|
||||
|
||||
Known issues in OpenSSL 0.9.8za:
|
||||
|
||||
o Compilation failure of s3_pkt.c on some platforms due to missing
|
||||
<limits.h> include. Fixed in 0.9.8zb-dev.
|
||||
o FIPS capable link failure with missing symbol BN_consttime_swap.
|
||||
Fixed in 0.9.8zb-dev. Workaround is to compile with no-ec: the EC
|
||||
algorithms are not FIPS approved in OpenSSL 0.9.8 anyway.
|
||||
|
||||
Major changes between OpenSSL 0.9.8y and OpenSSL 0.9.8za [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-2014-0076
|
||||
o Fix for CVE-2010-5298
|
||||
o Fix to TLS alert handling.
|
||||
|
||||
Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y [5 Feb 2013]:
|
||||
|
||||
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
|
||||
o Fix OCSP bad key DoS attack CVE-2013-0166
|
||||
|
||||
Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x [10 May 2012]:
|
||||
|
||||
o Fix DTLS record length checking bug CVE-2012-2333
|
||||
|
||||
Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w [23 Apr 2012]:
|
||||
|
||||
o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110)
|
||||
|
||||
Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v [19 Apr 2012]:
|
||||
|
||||
o Fix for ASN1 overflow bug CVE-2012-2110
|
||||
|
||||
Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u [12 Mar 2012]:
|
||||
|
||||
o Fix for CMS/PKCS#7 MMA CVE-2012-0884
|
||||
o Corrected fix for CVE-2011-4619
|
||||
o Various DTLS fixes.
|
||||
|
||||
Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t [18 Jan 2012]:
|
||||
|
||||
o Fix for DTLS DoS issue CVE-2012-0050
|
||||
|
||||
Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s [4 Jan 2012]:
|
||||
|
||||
o Fix for DTLS plaintext recovery attack CVE-2011-4108
|
||||
o Fix policy check double free error CVE-2011-4109
|
||||
o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
|
||||
o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
|
||||
o Check for malformed RFC3779 data CVE-2011-4577
|
||||
|
||||
Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r [8 Feb 2011]:
|
||||
|
||||
o Fix for security issue CVE-2011-0014
|
||||
|
||||
Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q [2 Dec 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-4180
|
||||
o Fix for CVE-2010-4252
|
||||
|
||||
Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p [16 Nov 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-3864.
|
||||
|
||||
Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o [1 Jun 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-0742.
|
||||
o Various DTLS fixes.
|
||||
o Recognise SHA2 certificates if only SSL algorithms added.
|
||||
o Fix for no-rc4 compilation.
|
||||
o Chil ENGINE unload workaround.
|
||||
|
||||
Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
|
||||
|
||||
o CFB cipher definition fixes.
|
||||
o Fix security issues CVE-2010-0740 and CVE-2010-0433.
|
||||
|
||||
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.
|
||||
o Remove MD2 from algorithm tables.
|
||||
o SPKAC handling fixes.
|
||||
o Support for RFC5746 TLS renegotiation extension.
|
||||
o Compression memory leak fixed.
|
||||
o Compression session resumption fixed.
|
||||
o Ticket and SNI coexistence fixes.
|
||||
o Many fixes to DTLS handling.
|
||||
|
||||
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 [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
|
||||
@@ -62,23 +165,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.
|
||||
@@ -88,12 +191,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
|
||||
@@ -167,36 +270,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.
|
||||
@@ -205,7 +308,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.
|
||||
@@ -213,12 +316,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()
|
||||
@@ -226,14 +329,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
|
||||
@@ -244,7 +347,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.
|
||||
@@ -255,7 +358,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.
|
||||
@@ -301,23 +404,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.
|
||||
@@ -331,25 +434,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.
|
||||
@@ -362,7 +465,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.
|
||||
@@ -379,7 +482,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.
|
||||
@@ -404,7 +507,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.
|
||||
@@ -419,7 +522,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
|
||||
@@ -428,7 +531,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
|
||||
@@ -464,7 +567,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
|
||||
@@ -475,7 +578,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
|
||||
@@ -489,7 +592,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"
|
||||
@@ -511,7 +614,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
|
||||
|
||||
@@ -159,8 +159,6 @@ cd ..\..\..
|
||||
echo SHA1
|
||||
cd crypto\sha\asm
|
||||
perl sha1-586.pl %ASM_MODE% > s1-nw.asm
|
||||
perl sha256-586.pl %ASM_MODE% > sha256-nw.asm
|
||||
perl sha512-586.pl %ASM_MODE% > sha512-nw.asm
|
||||
cd ..\..\..
|
||||
|
||||
echo RIPEMD160
|
||||
@@ -173,11 +171,6 @@ cd crypto\rc5\asm
|
||||
perl rc5-586.pl %ASM_MODE% > r5-nw.asm
|
||||
cd ..\..\..
|
||||
|
||||
echo WHIRLPOOL
|
||||
cd crypto\whrlpool\asm
|
||||
perl wp-mmx.pl %ASM_MODE% > wp-nw.asm
|
||||
cd ..\..\..
|
||||
|
||||
echo CPUID
|
||||
cd crypto
|
||||
perl x86cpuid.pl %ASM_MODE% > x86cpuid-nw.asm
|
||||
|
||||
4
PROBLEMS
4
PROBLEMS
@@ -36,7 +36,9 @@ may differ on your machine.
|
||||
|
||||
|
||||
As long as Apple doesn't fix the problem with ld, this problem building
|
||||
OpenSSL will remain as is.
|
||||
OpenSSL will remain as is. Well, the problem was addressed in 0.9.8f by
|
||||
passing -Wl,-search_paths_first, but it's unknown if the flag was
|
||||
supported from the initial MacOS X release.
|
||||
|
||||
|
||||
* Parallell make leads to errors
|
||||
|
||||
27
README
27
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 1.0.0-beta3 15 Jul 2009
|
||||
OpenSSL 0.9.8zf-dev
|
||||
|
||||
Copyright (c) 1998-2008 The OpenSSL Project
|
||||
Copyright (c) 1998-2011 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
@@ -112,8 +112,6 @@
|
||||
should be contacted if that algorithm is to be used; their web page is
|
||||
http://www.ascom.ch/.
|
||||
|
||||
The MDC2 algorithm is patented by IBM.
|
||||
|
||||
NTT and Mitsubishi have patents and pending patents on the Camellia
|
||||
algorithm, but allow use at no charge without requiring an explicit
|
||||
licensing agreement: http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html
|
||||
@@ -139,6 +137,9 @@
|
||||
SUPPORT
|
||||
-------
|
||||
|
||||
See the OpenSSL website www.openssl.org for details of how to obtain
|
||||
commercial technical support.
|
||||
|
||||
If you have any problems with OpenSSL then please take the following steps
|
||||
first:
|
||||
|
||||
@@ -165,6 +166,10 @@
|
||||
|
||||
openssl-bugs@openssl.org
|
||||
|
||||
Note that the request tracker should NOT be used for general assistance
|
||||
or support queries. Just because something doesn't work the way you expect
|
||||
does not mean it is necessarily a bug in OpenSSL.
|
||||
|
||||
Note that mail to openssl-bugs@openssl.org is recorded in the publicly
|
||||
readable request tracker database and is forwarded to a public
|
||||
mailing list. Confidential mail may be sent to openssl-security@openssl.org
|
||||
@@ -175,10 +180,22 @@
|
||||
|
||||
Development is coordinated on the openssl-dev mailing list (see
|
||||
http://www.openssl.org for information on subscribing). If you
|
||||
would like to submit a patch, send it to openssl-dev@openssl.org with
|
||||
would like to submit a patch, send it to openssl-bugs@openssl.org with
|
||||
the string "[PATCH]" in the subject. Please be sure to include a
|
||||
textual explanation of what your patch does.
|
||||
|
||||
If you are unsure as to whether a feature will be useful for the general
|
||||
OpenSSL community please discuss it on the openssl-dev mailing list first.
|
||||
Someone may be already working on the same thing or there may be a good
|
||||
reason as to why that feature isn't implemented.
|
||||
|
||||
Patches should be as up to date as possible, preferably relative to the
|
||||
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
|
||||
features.
|
||||
|
||||
Note: For legal reasons, contributions from the US can be accepted only
|
||||
if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
|
||||
(formerly BXA) with a copy to the ENC Encryption Request Coordinator;
|
||||
|
||||
134
STATUS
134
STATUS
@@ -1,134 +0,0 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2009/07/15 11:37:45 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 1.0.0-beta3: Released on July 15th, 2009
|
||||
o OpenSSL 1.0.0-beta2: Released on April 21st, 2009
|
||||
o OpenSSL 1.0.0-beta1: Released on April 1st, 2009
|
||||
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.
|
||||
@@ -5,4 +5,3 @@ der_chop.bak
|
||||
CA.pl
|
||||
*.flc
|
||||
semantic.cache
|
||||
*.dll
|
||||
|
||||
@@ -114,8 +114,8 @@ $!
|
||||
$ IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. ""
|
||||
$ THEN
|
||||
$ READ '__INPUT' FILE -
|
||||
/PROMT="CA certificate filename (or enter to create)"
|
||||
$ IF F$SEARCH(FILE) .NES. ""
|
||||
/PROMPT="CA certificate filename (or enter to create): "
|
||||
$ IF (FILE .NES. "") .AND. (F$SEARCH(FILE) .NES. "")
|
||||
$ THEN
|
||||
$ COPY 'FILE' 'CATOP'.private'CAKEY'
|
||||
$ RET=$STATUS
|
||||
|
||||
121
apps/CA.sh
121
apps/CA.sh
@@ -5,10 +5,10 @@
|
||||
# things easier between now and when Eric is convinced to fix it :-)
|
||||
#
|
||||
# CA -newca ... will setup the right stuff
|
||||
# CA -newreq ... will generate a certificate request
|
||||
# CA -sign ... will sign the generated request and output
|
||||
# CA -newreq ... will generate a certificate request
|
||||
# CA -sign ... will sign the generated request and output
|
||||
#
|
||||
# At the end of that grab newreq.pem and newcert.pem (one has the key
|
||||
# At the end of that grab newreq.pem and newcert.pem (one has the key
|
||||
# and the other the certificate) and cat them together and that is what
|
||||
# you want/need ... I'll make even this a little cleaner later.
|
||||
#
|
||||
@@ -16,8 +16,8 @@
|
||||
# 12-Jan-96 tjh Added more things ... including CA -signcert which
|
||||
# converts a certificate to a request and then signs it.
|
||||
# 10-Jan-96 eay Fixed a few more bugs and added the SSLEAY_CONFIG
|
||||
# environment variable so this can be driven from
|
||||
# a script.
|
||||
# environment variable so this can be driven from
|
||||
# a script.
|
||||
# 25-Jul-96 eay Cleaned up filenames some more.
|
||||
# 11-Jun-96 eay Fixed a few filename missmatches.
|
||||
# 03-May-96 eay Modified to use 'ssleay cmd' instead of 'cmd'.
|
||||
@@ -29,52 +29,87 @@
|
||||
|
||||
# default openssl.cnf file has setup as per the following
|
||||
# demoCA ... where everything is stored
|
||||
cp_pem() {
|
||||
infile=$1
|
||||
outfile=$2
|
||||
bound=$3
|
||||
flag=0
|
||||
exec <$infile;
|
||||
while read line; do
|
||||
if [ $flag -eq 1 ]; then
|
||||
echo $line|grep "^-----END.*$bound" 2>/dev/null 1>/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
echo $line >>$outfile
|
||||
break
|
||||
else
|
||||
echo $line >>$outfile
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $line|grep "^-----BEGIN.*$bound" 2>/dev/null 1>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo $line >$outfile
|
||||
flag=1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify" >&2
|
||||
}
|
||||
|
||||
if [ -z "$OPENSSL" ]; then OPENSSL=openssl; fi
|
||||
|
||||
DAYS="-days 365" # 1 year
|
||||
if [ -z "$DAYS" ] ; then DAYS="-days 365" ; fi # 1 year
|
||||
CADAYS="-days 1095" # 3 years
|
||||
REQ="$OPENSSL req $SSLEAY_CONFIG"
|
||||
CA="$OPENSSL ca $SSLEAY_CONFIG"
|
||||
VERIFY="$OPENSSL verify"
|
||||
X509="$OPENSSL x509"
|
||||
PKCS12="openssl pkcs12"
|
||||
|
||||
CATOP=./demoCA
|
||||
if [ -z "$CATOP" ] ; then CATOP=./demoCA ; fi
|
||||
CAKEY=./cakey.pem
|
||||
CAREQ=./careq.pem
|
||||
CACERT=./cacert.pem
|
||||
|
||||
for i
|
||||
do
|
||||
case $i in
|
||||
RET=0
|
||||
|
||||
while [ "$1" != "" ] ; do
|
||||
case $1 in
|
||||
-\?|-h|-help)
|
||||
echo "usage: CA -newcert|-newreq|-newca|-sign|-verify" >&2
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-newcert)
|
||||
-newcert)
|
||||
# create a certificate
|
||||
$REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS
|
||||
RET=$?
|
||||
echo "Certificate is in newcert.pem, private key is in newkey.pem"
|
||||
;;
|
||||
-newreq)
|
||||
-newreq)
|
||||
# create a certificate request
|
||||
$REQ -new -keyout newkey.pem -out newreq.pem $DAYS
|
||||
RET=$?
|
||||
echo "Request is in newreq.pem, private key is in newkey.pem"
|
||||
;;
|
||||
-newca)
|
||||
-newreq-nodes)
|
||||
# create a certificate request
|
||||
$REQ -new -nodes -keyout newreq.pem -out newreq.pem $DAYS
|
||||
RET=$?
|
||||
echo "Request (and private key) is in newreq.pem"
|
||||
;;
|
||||
-newca)
|
||||
# if explicitly asked for or it doesn't exist then setup the directory
|
||||
# structure that Eric likes to manage things
|
||||
# structure that Eric likes to manage things
|
||||
NEW="1"
|
||||
if [ "$NEW" -o ! -f ${CATOP}/serial ]; then
|
||||
# create the directory hierarchy
|
||||
mkdir ${CATOP}
|
||||
mkdir ${CATOP}/certs
|
||||
mkdir ${CATOP}/crl
|
||||
mkdir ${CATOP}/newcerts
|
||||
mkdir ${CATOP}/private
|
||||
echo "00" > ${CATOP}/serial
|
||||
mkdir -p ${CATOP}
|
||||
mkdir -p ${CATOP}/certs
|
||||
mkdir -p ${CATOP}/crl
|
||||
mkdir -p ${CATOP}/newcerts
|
||||
mkdir -p ${CATOP}/private
|
||||
touch ${CATOP}/index.txt
|
||||
fi
|
||||
if [ ! -f ${CATOP}/private/$CAKEY ]; then
|
||||
@@ -83,37 +118,60 @@ case $i in
|
||||
|
||||
# ask user for existing CA certificate
|
||||
if [ "$FILE" ]; then
|
||||
cp $FILE ${CATOP}/private/$CAKEY
|
||||
cp_pem $FILE ${CATOP}/private/$CAKEY PRIVATE
|
||||
cp_pem $FILE ${CATOP}/$CACERT CERTIFICATE
|
||||
RET=$?
|
||||
if [ ! -f "${CATOP}/serial" ]; then
|
||||
$X509 -in ${CATOP}/$CACERT -noout -next_serial \
|
||||
-out ${CATOP}/serial
|
||||
fi
|
||||
else
|
||||
echo "Making CA certificate ..."
|
||||
$REQ -new -keyout ${CATOP}/private/$CAKEY \
|
||||
-out ${CATOP}/$CAREQ
|
||||
$CA -out ${CATOP}/$CACERT $CADAYS -batch \
|
||||
$CA -create_serial -out ${CATOP}/$CACERT $CADAYS -batch \
|
||||
-keyfile ${CATOP}/private/$CAKEY -selfsign \
|
||||
-infiles ${CATOP}/$CAREQ
|
||||
-extensions v3_ca \
|
||||
-infiles ${CATOP}/$CAREQ
|
||||
RET=$?
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
-xsign)
|
||||
$CA -policy policy_anything -infiles newreq.pem
|
||||
$CA -policy policy_anything -infiles newreq.pem
|
||||
RET=$?
|
||||
;;
|
||||
-sign|-signreq)
|
||||
-pkcs12)
|
||||
if [ -z "$2" ] ; then
|
||||
CNAME="My Certificate"
|
||||
else
|
||||
CNAME="$2"
|
||||
fi
|
||||
$PKCS12 -in newcert.pem -inkey newreq.pem -certfile ${CATOP}/$CACERT \
|
||||
-out newcert.p12 -export -name "$CNAME"
|
||||
RET=$?
|
||||
exit $RET
|
||||
;;
|
||||
-sign|-signreq)
|
||||
$CA -policy policy_anything -out newcert.pem -infiles newreq.pem
|
||||
RET=$?
|
||||
cat newcert.pem
|
||||
echo "Signed certificate is in newcert.pem"
|
||||
;;
|
||||
-signcert)
|
||||
-signCA)
|
||||
$CA -policy policy_anything -out newcert.pem -extensions v3_ca -infiles newreq.pem
|
||||
RET=$?
|
||||
echo "Signed CA certificate is in newcert.pem"
|
||||
;;
|
||||
-signcert)
|
||||
echo "Cert passphrase will be requested twice - bug?"
|
||||
$X509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem
|
||||
$CA -policy policy_anything -out newcert.pem -infiles tmp.pem
|
||||
RET=$?
|
||||
cat newcert.pem
|
||||
echo "Signed certificate is in newcert.pem"
|
||||
;;
|
||||
-verify)
|
||||
-verify)
|
||||
shift
|
||||
if [ -z "$1" ]; then
|
||||
$VERIFY -CAfile $CATOP/$CACERT newcert.pem
|
||||
@@ -127,13 +185,14 @@ case $i in
|
||||
fi
|
||||
done
|
||||
fi
|
||||
exit 0
|
||||
exit $RET
|
||||
;;
|
||||
*)
|
||||
echo "Unknown arg $i";
|
||||
echo "Unknown arg $i" >&2
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
exit $RET
|
||||
|
||||
|
||||
1028
apps/Makefile
1028
apps/Makefile
File diff suppressed because it is too large
Load Diff
764
apps/apps.c
764
apps/apps.c
File diff suppressed because it is too large
Load Diff
80
apps/apps.h
80
apps/apps.h
@@ -137,6 +137,11 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
||||
* (see e_os.h). The string is
|
||||
* destroyed! */
|
||||
|
||||
#ifdef OPENSSL_SYS_WIN32
|
||||
#define rename(from,to) WIN32_rename((from),(to))
|
||||
int WIN32_rename(const char *oldname,const char *newname);
|
||||
#endif
|
||||
|
||||
#ifndef MONOLITH
|
||||
|
||||
#define MAIN(a,v) main(a,v)
|
||||
@@ -144,9 +149,11 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
||||
#ifndef NON_MAIN
|
||||
CONF *config=NULL;
|
||||
BIO *bio_err=NULL;
|
||||
int in_FIPS_mode=0;
|
||||
#else
|
||||
extern CONF *config;
|
||||
extern BIO *bio_err;
|
||||
extern int in_FIPS_mode;
|
||||
#endif
|
||||
|
||||
#else
|
||||
@@ -155,6 +162,7 @@ extern BIO *bio_err;
|
||||
extern CONF *config;
|
||||
extern char *default_config_file;
|
||||
extern BIO *bio_err;
|
||||
extern int in_FIPS_mode;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -174,24 +182,54 @@ extern BIO *bio_err;
|
||||
# define apps_shutdown()
|
||||
#else
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
# define apps_startup() \
|
||||
do { do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
|
||||
defined(OPENSSL_SYS_WIN32)
|
||||
# ifdef _O_BINARY
|
||||
# define apps_startup() \
|
||||
do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
||||
# else
|
||||
# define apps_startup() \
|
||||
do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
||||
# endif
|
||||
# else
|
||||
# define apps_startup() \
|
||||
do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
|
||||
ERR_load_crypto_strings(); ENGINE_load_builtin_engines(); \
|
||||
setup_ui_method(); } while(0)
|
||||
# endif
|
||||
# define apps_shutdown() \
|
||||
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||
OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
|
||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
||||
ERR_free_strings(); COMP_zlib_cleanup();} while(0)
|
||||
EVP_cleanup(); ENGINE_cleanup(); \
|
||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
|
||||
ERR_free_strings(); } while(0)
|
||||
# else
|
||||
# define apps_startup() \
|
||||
do { do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
|
||||
defined(OPENSSL_SYS_WIN32)
|
||||
# ifdef _O_BINARY
|
||||
# define apps_startup() \
|
||||
do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||
setup_ui_method(); } while(0)
|
||||
# else
|
||||
# define apps_startup() \
|
||||
do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||
setup_ui_method(); } while(0)
|
||||
# endif
|
||||
# else
|
||||
# define apps_startup() \
|
||||
do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
|
||||
ERR_load_crypto_strings(); \
|
||||
setup_ui_method(); } while(0)
|
||||
# endif
|
||||
# define apps_shutdown() \
|
||||
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||
OBJ_cleanup(); EVP_cleanup(); \
|
||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
||||
EVP_cleanup(); \
|
||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
|
||||
ERR_free_strings(); } while(0)
|
||||
# endif
|
||||
#endif
|
||||
@@ -202,7 +240,6 @@ extern BIO *bio_err;
|
||||
# define openssl_fdset(a,b) FD_SET(a, b)
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct args_st
|
||||
{
|
||||
char **data;
|
||||
@@ -294,23 +331,13 @@ int index_index(CA_DB *db);
|
||||
int save_index(const char *dbfile, const char *suffix, CA_DB *db);
|
||||
int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix);
|
||||
void free_index(CA_DB *db);
|
||||
#define index_name_cmp_noconst(a, b) \
|
||||
index_name_cmp((const CSTRING *)CHECKED_PTR_OF(STRING, a), \
|
||||
(const CSTRING *)CHECKED_PTR_OF(STRING, b))
|
||||
int index_name_cmp(const CSTRING *a, const CSTRING *b);
|
||||
int index_name_cmp(const char **a, const char **b);
|
||||
int parse_yesno(const char *str, int def);
|
||||
|
||||
X509_NAME *parse_name(char *str, long chtype, int multirdn);
|
||||
int args_verify(char ***pargs, int *pargc,
|
||||
int *badarg, BIO *err, X509_VERIFY_PARAM **pm);
|
||||
void policies_print(BIO *out, X509_STORE_CTX *ctx);
|
||||
int bio_to_mem(unsigned char **out, int maxlen, BIO *in);
|
||||
int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value);
|
||||
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
|
||||
const char *algname, ENGINE *e, int do_param);
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
extern char *psk_key;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_JPAKE
|
||||
void jpake_client_auth(BIO *out, BIO *conn, const char *secret);
|
||||
void jpake_server_auth(BIO *out, BIO *conn, const char *secret);
|
||||
@@ -326,10 +353,6 @@ void jpake_server_auth(BIO *out, BIO *conn, const char *secret);
|
||||
#define FORMAT_ENGINE 7
|
||||
#define FORMAT_IISSGC 8 /* XXX this stupid macro helps us to avoid
|
||||
* adding yet another param to load_*key() */
|
||||
#define FORMAT_PEMRSA 9 /* PEM RSAPubicKey format */
|
||||
#define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
|
||||
#define FORMAT_MSBLOB 11 /* MS Key blob format */
|
||||
#define FORMAT_PVK 12 /* MS PVK file format */
|
||||
|
||||
#define EXT_COPY_NONE 0
|
||||
#define EXT_COPY_ADD 1
|
||||
@@ -341,11 +364,4 @@ void jpake_server_auth(BIO *out, BIO *conn, const char *secret);
|
||||
|
||||
#define SERIAL_RAND_BITS 64
|
||||
|
||||
int app_isdir(const char *);
|
||||
int raw_read_stdin(void *,int);
|
||||
int raw_write_stdout(const void *,int);
|
||||
|
||||
#define TM_START 0
|
||||
#define TM_STOP 1
|
||||
double app_tminterval (int stop,int usertime);
|
||||
#endif
|
||||
|
||||
@@ -96,7 +96,7 @@ int MAIN(int argc, char **argv)
|
||||
unsigned char *tmpbuf;
|
||||
const unsigned char *ctmpbuf;
|
||||
BUF_MEM *buf=NULL;
|
||||
STACK_OF(STRING) *osk=NULL;
|
||||
STACK *osk=NULL;
|
||||
ASN1_TYPE *at=NULL;
|
||||
|
||||
informat=FORMAT_PEM;
|
||||
@@ -113,7 +113,7 @@ int MAIN(int argc, char **argv)
|
||||
prog=argv[0];
|
||||
argc--;
|
||||
argv++;
|
||||
if ((osk=sk_STRING_new_null()) == NULL)
|
||||
if ((osk=sk_new_null()) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Memory allocation failure\n");
|
||||
goto end;
|
||||
@@ -169,7 +169,7 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-strparse") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
sk_STRING_push(osk,*(++argv));
|
||||
sk_push(osk,*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-genstr") == 0)
|
||||
{
|
||||
@@ -302,18 +302,18 @@ bad:
|
||||
|
||||
/* If any structs to parse go through in sequence */
|
||||
|
||||
if (sk_STRING_num(osk))
|
||||
if (sk_num(osk))
|
||||
{
|
||||
tmpbuf=(unsigned char *)str;
|
||||
tmplen=num;
|
||||
for (i=0; i<sk_STRING_num(osk); i++)
|
||||
for (i=0; i<sk_num(osk); i++)
|
||||
{
|
||||
ASN1_TYPE *atmp;
|
||||
int typ;
|
||||
j=atoi(sk_STRING_value(osk,i));
|
||||
j=atoi(sk_value(osk,i));
|
||||
if (j == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_STRING_value(osk,i));
|
||||
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_value(osk,i));
|
||||
continue;
|
||||
}
|
||||
tmpbuf+=j;
|
||||
@@ -378,7 +378,7 @@ end:
|
||||
ERR_print_errors(bio_err);
|
||||
if (buf != NULL) BUF_MEM_free(buf);
|
||||
if (at != NULL) ASN1_TYPE_free(at);
|
||||
if (osk != NULL) sk_STRING_free(osk);
|
||||
if (osk != NULL) sk_free(osk);
|
||||
OBJ_cleanup();
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
@@ -408,6 +408,7 @@ static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
|
||||
|
||||
atyp = ASN1_generate_nconf(genstr, cnf);
|
||||
NCONF_free(cnf);
|
||||
cnf = NULL;
|
||||
|
||||
if (!atyp)
|
||||
return -1;
|
||||
|
||||
198
apps/ca.c
198
apps/ca.c
@@ -63,6 +63,7 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
@@ -82,7 +83,7 @@
|
||||
# else
|
||||
# include <unixlib.h>
|
||||
# endif
|
||||
# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_NETWARE)
|
||||
# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_NETWARE) && !defined(__TANDEM)
|
||||
# include <sys/file.h>
|
||||
# endif
|
||||
#endif
|
||||
@@ -215,7 +216,6 @@ static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
|
||||
char *startdate, char *enddate, long days, char *ext_sect,
|
||||
CONF *conf, int verbose, unsigned long certopt,
|
||||
unsigned long nameopt, int default_op, int ext_copy);
|
||||
static int fix_data(int nid, int *type);
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext);
|
||||
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,char *subj,unsigned long chtype, int multirdn,
|
||||
@@ -258,7 +258,6 @@ int MAIN(int argc, char **argv)
|
||||
int doupdatedb=0;
|
||||
long crldays=0;
|
||||
long crlhours=0;
|
||||
long crlsec=0;
|
||||
long errorline= -1;
|
||||
char *configfile=NULL;
|
||||
char *md=NULL;
|
||||
@@ -306,8 +305,7 @@ int MAIN(int argc, char **argv)
|
||||
ASN1_TIME *tmptm;
|
||||
ASN1_INTEGER *tmpser;
|
||||
char *f;
|
||||
const char *p;
|
||||
char * const *pp;
|
||||
const char *p, **pp;
|
||||
int i,j;
|
||||
const EVP_MD *dgst=NULL;
|
||||
STACK_OF(CONF_VALUE) *attribs=NULL;
|
||||
@@ -458,11 +456,6 @@ EF_ALIGNMENT=0;
|
||||
if (--argc < 1) goto bad;
|
||||
crlhours= atol(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-crlsec") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
crlsec = atol(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-infiles") == 0)
|
||||
{
|
||||
argc--;
|
||||
@@ -556,10 +549,8 @@ bad:
|
||||
|
||||
if (badops)
|
||||
{
|
||||
const char **pp2;
|
||||
|
||||
for (pp2=ca_usage; (*pp2 != NULL); pp2++)
|
||||
BIO_printf(bio_err,"%s",*pp2);
|
||||
for (pp=ca_usage; (*pp != NULL); pp++)
|
||||
BIO_printf(bio_err,"%s",*pp);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -834,6 +825,7 @@ bad:
|
||||
/* lookup where to write new certificates */
|
||||
if ((outdir == NULL) && (req))
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
if ((outdir=NCONF_get_string(conf,section,ENV_NEW_CERTS_DIR))
|
||||
== NULL)
|
||||
@@ -852,23 +844,27 @@ bad:
|
||||
that to access(). However, time's too short to do that just
|
||||
now.
|
||||
*/
|
||||
#ifndef _WIN32
|
||||
if (access(outdir,R_OK|W_OK|X_OK) != 0)
|
||||
#else
|
||||
if (_access(outdir,R_OK|W_OK|X_OK) != 0)
|
||||
#endif
|
||||
{
|
||||
BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir);
|
||||
perror(outdir);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (app_isdir(outdir)<=0)
|
||||
if (stat(outdir,&sb) != 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to stat(%s)\n",outdir);
|
||||
perror(outdir);
|
||||
goto err;
|
||||
}
|
||||
#ifdef S_ISDIR
|
||||
if (!S_ISDIR(sb.st_mode))
|
||||
{
|
||||
BIO_printf(bio_err,"%s need to be a directory\n",outdir);
|
||||
perror(outdir);
|
||||
goto err;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -883,9 +879,9 @@ bad:
|
||||
if (db == NULL) goto err;
|
||||
|
||||
/* Lets check some fields */
|
||||
for (i=0; i<sk_PSTRING_num(db->db->data); i++)
|
||||
for (i=0; i<sk_num(db->db->data); i++)
|
||||
{
|
||||
pp=sk_PSTRING_value(db->db->data,i);
|
||||
pp=(const char **)sk_value(db->db->data,i);
|
||||
if ((pp[DB_type][0] != DB_TYPE_REV) &&
|
||||
(pp[DB_rev_date][0] != '\0'))
|
||||
{
|
||||
@@ -898,7 +894,7 @@ bad:
|
||||
BIO_printf(bio_err," in entry %d\n", i+1);
|
||||
goto err;
|
||||
}
|
||||
if (!check_time_format((char *)pp[DB_exp_date]))
|
||||
if (!check_time_format(pp[DB_exp_date]))
|
||||
{
|
||||
BIO_printf(bio_err,"entry %d: invalid expiry date\n",i+1);
|
||||
goto err;
|
||||
@@ -938,7 +934,7 @@ bad:
|
||||
#endif
|
||||
TXT_DB_write(out,db->db);
|
||||
BIO_printf(bio_err,"%d entries loaded from the database\n",
|
||||
sk_PSTRING_num(db->db->data));
|
||||
db->db->data->num);
|
||||
BIO_printf(bio_err,"generating index\n");
|
||||
}
|
||||
|
||||
@@ -1029,17 +1025,6 @@ bad:
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!strcmp(md, "default"))
|
||||
{
|
||||
int def_nid;
|
||||
if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) <= 0)
|
||||
{
|
||||
BIO_puts(bio_err,"no default digest\n");
|
||||
goto err;
|
||||
}
|
||||
md = (char *)OBJ_nid2sn(def_nid);
|
||||
}
|
||||
|
||||
if ((dgst=EVP_get_digestbyname(md)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"%s is an unsupported message digest type\n",md);
|
||||
@@ -1109,9 +1094,9 @@ bad:
|
||||
if (startdate == NULL)
|
||||
ERR_clear_error();
|
||||
}
|
||||
if (startdate && !ASN1_TIME_set_string(NULL, startdate))
|
||||
if (startdate && !ASN1_UTCTIME_set_string(NULL,startdate))
|
||||
{
|
||||
BIO_printf(bio_err,"start date is invalid, it should be YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ\n");
|
||||
BIO_printf(bio_err,"start date is invalid, it should be YYMMDDHHMMSSZ\n");
|
||||
goto err;
|
||||
}
|
||||
if (startdate == NULL) startdate="today";
|
||||
@@ -1123,9 +1108,9 @@ bad:
|
||||
if (enddate == NULL)
|
||||
ERR_clear_error();
|
||||
}
|
||||
if (enddate && !ASN1_TIME_set_string(NULL, enddate))
|
||||
if (enddate && !ASN1_UTCTIME_set_string(NULL,enddate))
|
||||
{
|
||||
BIO_printf(bio_err,"end date is invalid, it should be YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ\n");
|
||||
BIO_printf(bio_err,"end date is invalid, it should be YYMMDDHHMMSSZ\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1263,7 +1248,12 @@ bad:
|
||||
BIO_printf(bio_err,"\n%d out of %d certificate requests certified, commit? [y/n]",total_done,total);
|
||||
(void)BIO_flush(bio_err);
|
||||
buf[0][0]='\0';
|
||||
fgets(buf[0],10,stdin);
|
||||
if (!fgets(buf[0],10,stdin))
|
||||
{
|
||||
BIO_printf(bio_err,"CERTIFICATION CANCELED: I/O error\n");
|
||||
ret=0;
|
||||
goto err;
|
||||
}
|
||||
if ((buf[0][0] != 'y') && (buf[0][0] != 'Y'))
|
||||
{
|
||||
BIO_printf(bio_err,"CERTIFICATION CANCELED\n");
|
||||
@@ -1380,7 +1370,7 @@ bad:
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!crldays && !crlhours && !crlsec)
|
||||
if (!crldays && !crlhours)
|
||||
{
|
||||
if (!NCONF_get_number(conf,section,
|
||||
ENV_DEFAULT_CRL_DAYS, &crldays))
|
||||
@@ -1389,7 +1379,7 @@ bad:
|
||||
ENV_DEFAULT_CRL_HOURS, &crlhours))
|
||||
crlhours = 0;
|
||||
}
|
||||
if ((crldays == 0) && (crlhours == 0) && (crlsec == 0))
|
||||
if ((crldays == 0) && (crlhours == 0))
|
||||
{
|
||||
BIO_printf(bio_err,"cannot lookup how long until the next CRL is issued\n");
|
||||
goto err;
|
||||
@@ -1403,14 +1393,14 @@ bad:
|
||||
if (!tmptm) goto err;
|
||||
X509_gmtime_adj(tmptm,0);
|
||||
X509_CRL_set_lastUpdate(crl, tmptm);
|
||||
X509_time_adj_ex(tmptm, crldays, crlhours*60*60 + crlsec, NULL);
|
||||
X509_gmtime_adj(tmptm,(crldays*24+crlhours)*60*60);
|
||||
X509_CRL_set_nextUpdate(crl, tmptm);
|
||||
|
||||
ASN1_TIME_free(tmptm);
|
||||
|
||||
for (i=0; i<sk_PSTRING_num(db->db->data); i++)
|
||||
for (i=0; i<sk_num(db->db->data); i++)
|
||||
{
|
||||
pp=sk_PSTRING_value(db->db->data,i);
|
||||
pp=(const char **)sk_value(db->db->data,i);
|
||||
if (pp[DB_type][0] == DB_TYPE_REV)
|
||||
{
|
||||
if ((r=X509_REVOKED_new()) == NULL) goto err;
|
||||
@@ -1436,6 +1426,15 @@ bad:
|
||||
|
||||
/* we now have a CRL */
|
||||
if (verbose) BIO_printf(bio_err,"signing CRL\n");
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (pkey->type == EVP_PKEY_DSA)
|
||||
dgst=EVP_dss1();
|
||||
else
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (pkey->type == EVP_PKEY_EC)
|
||||
dgst=EVP_ecdsa();
|
||||
#endif
|
||||
|
||||
/* Add any extensions asked for */
|
||||
|
||||
@@ -1468,12 +1467,6 @@ bad:
|
||||
if (crlnumberfile != NULL) /* we have a CRL number that need updating */
|
||||
if (!save_serial(crlnumberfile,"new",crlnumber,NULL)) goto err;
|
||||
|
||||
if (crlnumber)
|
||||
{
|
||||
BN_free(crlnumber);
|
||||
crlnumber = NULL;
|
||||
}
|
||||
|
||||
if (!X509_CRL_sign(crl,pkey,dgst)) goto err;
|
||||
|
||||
PEM_write_bio_X509_CRL(Sout,crl);
|
||||
@@ -1526,7 +1519,6 @@ err:
|
||||
if (free_key && key)
|
||||
OPENSSL_free(key);
|
||||
BN_free(serial);
|
||||
BN_free(crlnumber);
|
||||
free_index(db);
|
||||
EVP_PKEY_free(pkey);
|
||||
if (x509) X509_free(x509);
|
||||
@@ -1590,12 +1582,14 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
{
|
||||
ok=0;
|
||||
BIO_printf(bio_err,"Signature verification problems....\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
ok=0;
|
||||
BIO_printf(bio_err,"Signature did not match the certificate request\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
@@ -1685,9 +1679,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
|
||||
int ok= -1,i,j,last,nid;
|
||||
const char *p;
|
||||
CONF_VALUE *cv;
|
||||
STRING row[DB_NUMBER];
|
||||
STRING *irow=NULL;
|
||||
STRING *rrow=NULL;
|
||||
char *row[DB_NUMBER],**rrow=NULL,**irow=NULL;
|
||||
char buf[25];
|
||||
|
||||
tmptm=ASN1_UTCTIME_new();
|
||||
@@ -1929,9 +1921,7 @@ again2:
|
||||
|
||||
if (db->attributes.unique_subject)
|
||||
{
|
||||
STRING *crow=row;
|
||||
|
||||
rrow=TXT_DB_get_by_index(db->db,DB_name,crow);
|
||||
rrow=TXT_DB_get_by_index(db->db,DB_name,row);
|
||||
if (rrow != NULL)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
@@ -2007,11 +1997,11 @@ again2:
|
||||
|
||||
if (strcmp(startdate,"today") == 0)
|
||||
X509_gmtime_adj(X509_get_notBefore(ret),0);
|
||||
else ASN1_TIME_set_string(X509_get_notBefore(ret),startdate);
|
||||
else ASN1_UTCTIME_set_string(X509_get_notBefore(ret),startdate);
|
||||
|
||||
if (enddate == NULL)
|
||||
X509_time_adj_ex(X509_get_notAfter(ret),days, 0, NULL);
|
||||
else ASN1_TIME_set_string(X509_get_notAfter(ret),enddate);
|
||||
X509_gmtime_adj(X509_get_notAfter(ret),(long)60*60*24*days);
|
||||
else ASN1_UTCTIME_set_string(X509_get_notAfter(ret),enddate);
|
||||
|
||||
if (!X509_set_subject_name(ret,subject)) goto err;
|
||||
|
||||
@@ -2117,7 +2107,12 @@ again2:
|
||||
BIO_printf(bio_err,"Sign the certificate? [y/n]:");
|
||||
(void)BIO_flush(bio_err);
|
||||
buf[0]='\0';
|
||||
fgets(buf,sizeof(buf)-1,stdin);
|
||||
if (!fgets(buf,sizeof(buf)-1,stdin))
|
||||
{
|
||||
BIO_printf(bio_err,"CERTIFICATE WILL NOT BE CERTIFIED: I/O error\n");
|
||||
ok=0;
|
||||
goto err;
|
||||
}
|
||||
if (!((buf[0] == 'y') || (buf[0] == 'Y')))
|
||||
{
|
||||
BIO_printf(bio_err,"CERTIFICATE WILL NOT BE CERTIFIED\n");
|
||||
@@ -2126,11 +2121,25 @@ again2:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (pkey->type == EVP_PKEY_DSA) dgst=EVP_dss1();
|
||||
pktmp=X509_get_pubkey(ret);
|
||||
if (EVP_PKEY_missing_parameters(pktmp) &&
|
||||
!EVP_PKEY_missing_parameters(pkey))
|
||||
EVP_PKEY_copy_parameters(pktmp,pkey);
|
||||
EVP_PKEY_free(pktmp);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (pkey->type == EVP_PKEY_EC)
|
||||
dgst = EVP_ecdsa();
|
||||
pktmp = X509_get_pubkey(ret);
|
||||
if (EVP_PKEY_missing_parameters(pktmp) &&
|
||||
!EVP_PKEY_missing_parameters(pkey))
|
||||
EVP_PKEY_copy_parameters(pktmp, pkey);
|
||||
EVP_PKEY_free(pktmp);
|
||||
#endif
|
||||
|
||||
|
||||
if (!X509_sign(ret,pkey,dgst))
|
||||
goto err;
|
||||
@@ -2232,7 +2241,7 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
unsigned long nameopt, int default_op, int ext_copy)
|
||||
{
|
||||
STACK_OF(CONF_VALUE) *sk=NULL;
|
||||
LHASH_OF(CONF_VALUE) *parms=NULL;
|
||||
LHASH *parms=NULL;
|
||||
X509_REQ *req=NULL;
|
||||
CONF_VALUE *cv=NULL;
|
||||
NETSCAPE_SPKI *spki = NULL;
|
||||
@@ -2319,25 +2328,9 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
if ((nid == NID_pkcs9_emailAddress) && (email_dn == 0))
|
||||
continue;
|
||||
*/
|
||||
|
||||
j=ASN1_PRINTABLE_type((unsigned char *)buf,-1);
|
||||
if (fix_data(nid, &j) == 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"invalid characters in string %s\n",buf);
|
||||
if (!X509_NAME_add_entry_by_NID(n, nid, chtype,
|
||||
(unsigned char *)buf, -1, -1, 0))
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((ne=X509_NAME_ENTRY_create_by_NID(&ne,nid,j,
|
||||
(unsigned char *)buf,
|
||||
strlen(buf))) == NULL)
|
||||
goto err;
|
||||
|
||||
if (!X509_NAME_add_entry(n,ne,-1, 0)) goto err;
|
||||
}
|
||||
if (spki == NULL)
|
||||
{
|
||||
@@ -2380,24 +2373,17 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static int fix_data(int nid, int *type)
|
||||
{
|
||||
if (nid == NID_pkcs9_emailAddress)
|
||||
*type=V_ASN1_IA5STRING;
|
||||
if ((nid == NID_commonName) && (*type == V_ASN1_IA5STRING))
|
||||
*type=V_ASN1_T61STRING;
|
||||
if ((nid == NID_pkcs9_challengePassword) && (*type == V_ASN1_IA5STRING))
|
||||
*type=V_ASN1_T61STRING;
|
||||
if ((nid == NID_pkcs9_unstructuredName) && (*type == V_ASN1_T61STRING))
|
||||
return(0);
|
||||
if (nid == NID_pkcs9_unstructuredName)
|
||||
*type=V_ASN1_IA5STRING;
|
||||
return(1);
|
||||
}
|
||||
|
||||
static int check_time_format(const char *str)
|
||||
{
|
||||
return ASN1_TIME_set_string(NULL, str);
|
||||
ASN1_TIME tm;
|
||||
|
||||
tm.data=(unsigned char *)str;
|
||||
tm.length=strlen(str);
|
||||
tm.type=V_ASN1_UTCTIME;
|
||||
if (ASN1_TIME_check(&tm))
|
||||
return 1;
|
||||
tm.type=V_ASN1_GENERALIZEDTIME;
|
||||
return ASN1_TIME_check(&tm);
|
||||
}
|
||||
|
||||
static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
|
||||
@@ -2412,8 +2398,6 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
|
||||
row[i]=NULL;
|
||||
row[DB_name]=X509_NAME_oneline(X509_get_subject_name(x509),NULL,0);
|
||||
bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(x509),NULL);
|
||||
if (!bn)
|
||||
goto err;
|
||||
if (BN_is_zero(bn))
|
||||
row[DB_serial]=BUF_strdup("00");
|
||||
else
|
||||
@@ -2483,7 +2467,7 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
|
||||
goto err;
|
||||
|
||||
}
|
||||
else if (index_name_cmp_noconst(row, rrow))
|
||||
else if (index_name_cmp((const char **)row,(const char **)rrow))
|
||||
{
|
||||
BIO_printf(bio_err,"ERROR:name does not match %s\n",
|
||||
row[DB_name]);
|
||||
@@ -2632,9 +2616,9 @@ static int do_updatedb (CA_DB *db)
|
||||
else
|
||||
a_y2k = 0;
|
||||
|
||||
for (i = 0; i < sk_PSTRING_num(db->db->data); i++)
|
||||
for (i = 0; i < sk_num(db->db->data); i++)
|
||||
{
|
||||
rrow = sk_PSTRING_value(db->db->data, i);
|
||||
rrow = (char **) sk_value(db->db->data, i);
|
||||
|
||||
if (rrow[DB_type][0] == 'V')
|
||||
{
|
||||
@@ -2769,6 +2753,9 @@ char *make_revocation_str(int rev_type, char *rev_arg)
|
||||
|
||||
revtm = X509_gmtime_adj(NULL, 0);
|
||||
|
||||
if (!revtm)
|
||||
return NULL;
|
||||
|
||||
i = revtm->length + 1;
|
||||
|
||||
if (reason) i += strlen(reason) + 1;
|
||||
@@ -2881,13 +2868,22 @@ int old_entry_print(BIO *bp, ASN1_OBJECT *obj, ASN1_STRING *str)
|
||||
p=(char *)str->data;
|
||||
for (j=str->length; j>0; j--)
|
||||
{
|
||||
#ifdef CHARSET_EBCDIC
|
||||
if ((*p >= 0x20) && (*p <= 0x7e))
|
||||
BIO_printf(bp,"%c",os_toebcdic[*p]);
|
||||
#else
|
||||
if ((*p >= ' ') && (*p <= '~'))
|
||||
BIO_printf(bp,"%c",*p);
|
||||
#endif
|
||||
else if (*p & 0x80)
|
||||
BIO_printf(bp,"\\0x%02X",*p);
|
||||
else if ((unsigned char)*p == 0xf7)
|
||||
BIO_printf(bp,"^?");
|
||||
#ifdef CHARSET_EBCDIC
|
||||
else BIO_printf(bp,"^%c",os_toebcdic[*p+0x40]);
|
||||
#else
|
||||
else BIO_printf(bp,"^%c",*p+'@');
|
||||
#endif
|
||||
p++;
|
||||
}
|
||||
BIO_printf(bp,"'\n");
|
||||
|
||||
@@ -71,8 +71,7 @@
|
||||
|
||||
static const char *ciphers_usage[]={
|
||||
"usage: ciphers args\n",
|
||||
" -v - verbose mode, a textual listing of the SSL/TLS ciphers in OpenSSL\n",
|
||||
" -V - even more verbose\n",
|
||||
" -v - verbose mode, a textual listing of the ciphers in SSLeay\n",
|
||||
" -ssl2 - SSL2 mode\n",
|
||||
" -ssl3 - SSL3 mode\n",
|
||||
" -tls1 - TLS1 mode\n",
|
||||
@@ -84,14 +83,14 @@ int MAIN(int, char **);
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1,i;
|
||||
int verbose=0,Verbose=0;
|
||||
int verbose=0;
|
||||
const char **pp;
|
||||
const char *p;
|
||||
int badops=0;
|
||||
SSL_CTX *ctx=NULL;
|
||||
SSL *ssl=NULL;
|
||||
char *ciphers=NULL;
|
||||
const SSL_METHOD *meth=NULL;
|
||||
SSL_METHOD *meth=NULL;
|
||||
STACK_OF(SSL_CIPHER) *sk;
|
||||
char buf[512];
|
||||
BIO *STDout=NULL;
|
||||
@@ -115,8 +114,6 @@ int MAIN(int argc, char **argv)
|
||||
STDout = BIO_push(tmpbio, STDout);
|
||||
}
|
||||
#endif
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
@@ -124,8 +121,6 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
if (strcmp(*argv,"-v") == 0)
|
||||
verbose=1;
|
||||
else if (strcmp(*argv,"-V") == 0)
|
||||
verbose=Verbose=1;
|
||||
#ifndef OPENSSL_NO_SSL2
|
||||
else if (strcmp(*argv,"-ssl2") == 0)
|
||||
meth=SSLv2_client_method();
|
||||
@@ -184,33 +179,15 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
BIO_printf(STDout,"\n");
|
||||
}
|
||||
else /* verbose */
|
||||
else
|
||||
{
|
||||
sk=SSL_get_ciphers(ssl);
|
||||
|
||||
for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
|
||||
{
|
||||
SSL_CIPHER *c;
|
||||
|
||||
c = sk_SSL_CIPHER_value(sk,i);
|
||||
|
||||
if (Verbose)
|
||||
{
|
||||
unsigned long id = c->id;
|
||||
int id0 = (int)(id >> 24);
|
||||
int id1 = (int)((id >> 16) & 0xffL);
|
||||
int id2 = (int)((id >> 8) & 0xffL);
|
||||
int id3 = (int)(id & 0xffL);
|
||||
|
||||
if ((id & 0xff000000L) == 0x02000000L)
|
||||
BIO_printf(STDout, " 0x%02X,0x%02X,0x%02X - ", id1, id2, id3); /* SSL2 cipher */
|
||||
else if ((id & 0xff000000L) == 0x03000000L)
|
||||
BIO_printf(STDout, " 0x%02X,0x%02X - ", id2, id3); /* SSL3 cipher */
|
||||
else
|
||||
BIO_printf(STDout, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0, id1, id2, id3); /* whatever */
|
||||
}
|
||||
|
||||
BIO_puts(STDout,SSL_CIPHER_description(c,buf,sizeof buf));
|
||||
BIO_puts(STDout,SSL_CIPHER_description(
|
||||
sk_SSL_CIPHER_value(sk,i),
|
||||
buf,sizeof buf));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
117
apps/cms.c
117
apps/cms.c
@@ -71,9 +71,8 @@
|
||||
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
||||
static int cms_cb(int ok, X509_STORE_CTX *ctx);
|
||||
static void receipt_request_print(BIO *out, CMS_ContentInfo *cms);
|
||||
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
|
||||
int rr_allorfirst,
|
||||
STACK_OF(STRING) *rr_from);
|
||||
static CMS_ReceiptRequest *make_receipt_request(STACK *rr_to, int rr_allorfirst,
|
||||
STACK *rr_from);
|
||||
|
||||
#define SMIME_OP 0x10
|
||||
#define SMIME_IP 0x20
|
||||
@@ -95,8 +94,6 @@ static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
|
||||
#define SMIME_SIGN_RECEIPT (15 | SMIME_IP | SMIME_OP)
|
||||
#define SMIME_VERIFY_RECEIPT (16 | SMIME_IP)
|
||||
|
||||
int verify_err = 0;
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
@@ -108,7 +105,7 @@ int MAIN(int argc, char **argv)
|
||||
const char *inmode = "r", *outmode = "w";
|
||||
char *infile = NULL, *outfile = NULL, *rctfile = NULL;
|
||||
char *signerfile = NULL, *recipfile = NULL;
|
||||
STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL;
|
||||
STACK *sksigners = NULL, *skkeys = NULL;
|
||||
char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
|
||||
char *certsoutfile = NULL;
|
||||
const EVP_CIPHER *cipher = NULL;
|
||||
@@ -119,10 +116,9 @@ int MAIN(int argc, char **argv)
|
||||
STACK_OF(X509) *encerts = NULL, *other = NULL;
|
||||
BIO *in = NULL, *out = NULL, *indata = NULL, *rctin = NULL;
|
||||
int badarg = 0;
|
||||
int flags = CMS_DETACHED, noout = 0, print = 0;
|
||||
int verify_retcode = 0;
|
||||
int flags = CMS_DETACHED;
|
||||
int rr_print = 0, rr_allorfirst = -1;
|
||||
STACK_OF(STRING) *rr_to = NULL, *rr_from = NULL;
|
||||
STACK *rr_to = NULL, *rr_from = NULL;
|
||||
CMS_ReceiptRequest *rr = NULL;
|
||||
char *to = NULL, *from = NULL, *subject = NULL;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
@@ -170,8 +166,6 @@ int MAIN(int argc, char **argv)
|
||||
operation = SMIME_RESIGN;
|
||||
else if (!strcmp (*args, "-verify"))
|
||||
operation = SMIME_VERIFY;
|
||||
else if (!strcmp (*args, "-verify_retcode"))
|
||||
verify_retcode = 1;
|
||||
else if (!strcmp(*args,"-verify_receipt"))
|
||||
{
|
||||
operation = SMIME_VERIFY_RECEIPT;
|
||||
@@ -232,6 +226,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"))
|
||||
@@ -258,17 +254,21 @@ int MAIN(int argc, char **argv)
|
||||
else if (!strcmp (*args, "-no_attr_verify"))
|
||||
flags |= CMS_NO_ATTR_VERIFY;
|
||||
else if (!strcmp (*args, "-stream"))
|
||||
flags |= CMS_STREAM;
|
||||
{
|
||||
args++;
|
||||
continue;
|
||||
}
|
||||
else if (!strcmp (*args, "-indef"))
|
||||
flags |= CMS_STREAM;
|
||||
{
|
||||
args++;
|
||||
continue;
|
||||
}
|
||||
else if (!strcmp (*args, "-noindef"))
|
||||
flags &= ~CMS_STREAM;
|
||||
else if (!strcmp (*args, "-nooldmime"))
|
||||
flags |= CMS_NOOLDMIMETYPE;
|
||||
else if (!strcmp (*args, "-crlfeol"))
|
||||
flags |= CMS_CRLFEOL;
|
||||
else if (!strcmp (*args, "-noout"))
|
||||
noout = 1;
|
||||
else if (!strcmp (*args, "-receipt_request_print"))
|
||||
rr_print = 1;
|
||||
else if (!strcmp (*args, "-receipt_request_all"))
|
||||
@@ -281,8 +281,8 @@ int MAIN(int argc, char **argv)
|
||||
goto argerr;
|
||||
args++;
|
||||
if (!rr_from)
|
||||
rr_from = sk_STRING_new_null();
|
||||
sk_STRING_push(rr_from, *args);
|
||||
rr_from = sk_new_null();
|
||||
sk_push(rr_from, *args);
|
||||
}
|
||||
else if (!strcmp(*args,"-receipt_request_to"))
|
||||
{
|
||||
@@ -290,14 +290,9 @@ int MAIN(int argc, char **argv)
|
||||
goto argerr;
|
||||
args++;
|
||||
if (!rr_to)
|
||||
rr_to = sk_STRING_new_null();
|
||||
sk_STRING_push(rr_to, *args);
|
||||
rr_to = sk_new_null();
|
||||
sk_push(rr_to, *args);
|
||||
}
|
||||
else if (!strcmp (*args, "-print"))
|
||||
{
|
||||
noout = 1;
|
||||
print = 1;
|
||||
}
|
||||
else if (!strcmp(*args,"-secretkey"))
|
||||
{
|
||||
long ltmp;
|
||||
@@ -387,13 +382,13 @@ int MAIN(int argc, char **argv)
|
||||
if (signerfile)
|
||||
{
|
||||
if (!sksigners)
|
||||
sksigners = sk_STRING_new_null();
|
||||
sk_STRING_push(sksigners, signerfile);
|
||||
sksigners = sk_new_null();
|
||||
sk_push(sksigners, signerfile);
|
||||
if (!keyfile)
|
||||
keyfile = signerfile;
|
||||
if (!skkeys)
|
||||
skkeys = sk_STRING_new_null();
|
||||
sk_STRING_push(skkeys, keyfile);
|
||||
skkeys = sk_new_null();
|
||||
sk_push(skkeys, keyfile);
|
||||
keyfile = NULL;
|
||||
}
|
||||
signerfile = *++args;
|
||||
@@ -435,12 +430,12 @@ int MAIN(int argc, char **argv)
|
||||
goto argerr;
|
||||
}
|
||||
if (!sksigners)
|
||||
sksigners = sk_STRING_new_null();
|
||||
sk_STRING_push(sksigners, signerfile);
|
||||
sksigners = sk_new_null();
|
||||
sk_push(sksigners, signerfile);
|
||||
signerfile = NULL;
|
||||
if (!skkeys)
|
||||
skkeys = sk_STRING_new_null();
|
||||
sk_STRING_push(skkeys, keyfile);
|
||||
skkeys = sk_new_null();
|
||||
sk_push(skkeys, keyfile);
|
||||
}
|
||||
keyfile = *++args;
|
||||
}
|
||||
@@ -539,13 +534,13 @@ int MAIN(int argc, char **argv)
|
||||
if (signerfile)
|
||||
{
|
||||
if (!sksigners)
|
||||
sksigners = sk_STRING_new_null();
|
||||
sk_STRING_push(sksigners, signerfile);
|
||||
sksigners = sk_new_null();
|
||||
sk_push(sksigners, signerfile);
|
||||
if (!skkeys)
|
||||
skkeys = sk_STRING_new_null();
|
||||
skkeys = sk_new_null();
|
||||
if (!keyfile)
|
||||
keyfile = signerfile;
|
||||
sk_STRING_push(skkeys, keyfile);
|
||||
sk_push(skkeys, keyfile);
|
||||
}
|
||||
if (!sksigners)
|
||||
{
|
||||
@@ -618,7 +613,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, "-skeyid 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");
|
||||
@@ -704,7 +699,7 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (secret_key && !secret_keyid)
|
||||
{
|
||||
BIO_printf(bio_err, "No secret key id\n");
|
||||
BIO_printf(bio_err, "No sectre key id\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -980,11 +975,11 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
flags |= CMS_REUSE_DIGEST;
|
||||
for (i = 0; i < sk_STRING_num(sksigners); i++)
|
||||
for (i = 0; i < sk_num(sksigners); i++)
|
||||
{
|
||||
CMS_SignerInfo *si;
|
||||
signerfile = sk_STRING_value(sksigners, i);
|
||||
keyfile = sk_STRING_value(skkeys, i);
|
||||
signerfile = sk_value(sksigners, i);
|
||||
keyfile = sk_value(skkeys, i);
|
||||
signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
|
||||
e, "signer certificate");
|
||||
if (!signer)
|
||||
@@ -1020,6 +1015,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)
|
||||
{
|
||||
@@ -1082,8 +1079,6 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Verification failure\n");
|
||||
if (verify_retcode)
|
||||
ret = verify_err + 32;
|
||||
goto end;
|
||||
}
|
||||
if (signerfile)
|
||||
@@ -1116,12 +1111,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (noout)
|
||||
{
|
||||
if (print)
|
||||
CMS_ContentInfo_print_ctx(out, cms, 0, NULL);
|
||||
}
|
||||
else if (outformat == FORMAT_SMIME)
|
||||
if (outformat == FORMAT_SMIME)
|
||||
{
|
||||
if (to)
|
||||
BIO_printf(out, "To: %s\n", to);
|
||||
@@ -1135,9 +1125,9 @@ int MAIN(int argc, char **argv)
|
||||
ret = SMIME_write_CMS(out, cms, in, flags);
|
||||
}
|
||||
else if (outformat == FORMAT_PEM)
|
||||
ret = PEM_write_bio_CMS_stream(out, cms, in, flags);
|
||||
ret = PEM_write_bio_CMS(out, cms);
|
||||
else if (outformat == FORMAT_ASN1)
|
||||
ret = i2d_CMS_bio_stream(out,cms, in, flags);
|
||||
ret = i2d_CMS_bio(out,cms);
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad output format for CMS file\n");
|
||||
@@ -1160,9 +1150,9 @@ end:
|
||||
if (vpm)
|
||||
X509_VERIFY_PARAM_free(vpm);
|
||||
if (sksigners)
|
||||
sk_STRING_free(sksigners);
|
||||
sk_free(sksigners);
|
||||
if (skkeys)
|
||||
sk_STRING_free(skkeys);
|
||||
sk_free(skkeys);
|
||||
if (secret_key)
|
||||
OPENSSL_free(secret_key);
|
||||
if (secret_keyid)
|
||||
@@ -1172,9 +1162,9 @@ end:
|
||||
if (rr)
|
||||
CMS_ReceiptRequest_free(rr);
|
||||
if (rr_to)
|
||||
sk_STRING_free(rr_to);
|
||||
sk_free(rr_to);
|
||||
if (rr_from)
|
||||
sk_STRING_free(rr_from);
|
||||
sk_free(rr_from);
|
||||
X509_STORE_free(store);
|
||||
X509_free(cert);
|
||||
X509_free(recip);
|
||||
@@ -1213,8 +1203,6 @@ static int cms_cb(int ok, X509_STORE_CTX *ctx)
|
||||
|
||||
error = X509_STORE_CTX_get_error(ctx);
|
||||
|
||||
verify_err = error;
|
||||
|
||||
if ((error != X509_V_ERR_NO_EXPLICIT_POLICY)
|
||||
&& ((error != X509_V_OK) || (ok != 2)))
|
||||
return ok;
|
||||
@@ -1296,7 +1284,7 @@ static void receipt_request_print(BIO *out, CMS_ContentInfo *cms)
|
||||
}
|
||||
}
|
||||
|
||||
static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
|
||||
static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK *ns)
|
||||
{
|
||||
int i;
|
||||
STACK_OF(GENERAL_NAMES) *ret;
|
||||
@@ -1305,10 +1293,12 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
|
||||
ret = sk_GENERAL_NAMES_new_null();
|
||||
if (!ret)
|
||||
goto err;
|
||||
for (i = 0; i < sk_STRING_num(ns); i++)
|
||||
for (i = 0; i < sk_num(ns); i++)
|
||||
{
|
||||
char *str = sk_STRING_value(ns, i);
|
||||
gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0);
|
||||
CONF_VALUE cnf;
|
||||
cnf.name = "email";
|
||||
cnf.value = sk_value(ns, i);
|
||||
gen = v2i_GENERAL_NAME(NULL, NULL, &cnf);
|
||||
if (!gen)
|
||||
goto err;
|
||||
gens = GENERAL_NAMES_new();
|
||||
@@ -1335,9 +1325,8 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
|
||||
}
|
||||
|
||||
|
||||
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
|
||||
int rr_allorfirst,
|
||||
STACK_OF(STRING) *rr_from)
|
||||
static CMS_ReceiptRequest *make_receipt_request(STACK *rr_to, int rr_allorfirst,
|
||||
STACK *rr_from)
|
||||
{
|
||||
STACK_OF(GENERAL_NAMES) *rct_to, *rct_from;
|
||||
CMS_ReceiptRequest *rr;
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
@@ -92,7 +93,7 @@ int MAIN(int argc, char **argv)
|
||||
PKCS7 *p7 = NULL;
|
||||
PKCS7_SIGNED *p7s = NULL;
|
||||
X509_CRL *crl=NULL;
|
||||
STACK_OF(STRING) *certflst=NULL;
|
||||
STACK *certflst=NULL;
|
||||
STACK_OF(X509_CRL) *crl_stack=NULL;
|
||||
STACK_OF(X509) *cert_stack=NULL;
|
||||
int ret=1,nocrl=0;
|
||||
@@ -140,8 +141,14 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-certfile") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
if(!certflst) certflst = sk_STRING_new_null();
|
||||
sk_STRING_push(certflst,*(++argv));
|
||||
if(!certflst) certflst = sk_new_null();
|
||||
if (!certflst)
|
||||
goto end;
|
||||
if (!sk_push(certflst,*(++argv)))
|
||||
{
|
||||
sk_free(certflst);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -226,8 +233,8 @@ bad:
|
||||
if ((cert_stack=sk_X509_new_null()) == NULL) goto end;
|
||||
p7s->cert=cert_stack;
|
||||
|
||||
if(certflst) for(i = 0; i < sk_STRING_num(certflst); i++) {
|
||||
certfile = sk_STRING_value(certflst, i);
|
||||
if(certflst) for(i = 0; i < sk_num(certflst); i++) {
|
||||
certfile = sk_value(certflst, i);
|
||||
if (add_certs_from_file(cert_stack,certfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err, "error loading certificates\n");
|
||||
@@ -236,7 +243,7 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
sk_STRING_free(certflst);
|
||||
sk_free(certflst);
|
||||
|
||||
if (outfile == NULL)
|
||||
{
|
||||
@@ -294,12 +301,19 @@ end:
|
||||
*/
|
||||
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
|
||||
{
|
||||
struct stat st;
|
||||
BIO *in=NULL;
|
||||
int count=0;
|
||||
int ret= -1;
|
||||
STACK_OF(X509_INFO) *sk=NULL;
|
||||
X509_INFO *xi;
|
||||
|
||||
if ((stat(certfile,&st) != 0))
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load the file, %s\n",certfile);
|
||||
goto end;
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (BIO_read_filename(in,certfile) <= 0))
|
||||
{
|
||||
|
||||
337
apps/dgst.c
337
apps/dgst.c
@@ -75,29 +75,8 @@
|
||||
#define PROG dgst_main
|
||||
|
||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen,
|
||||
const char *sig_name, const char *md_name,
|
||||
const char *file,BIO *bmd);
|
||||
|
||||
static void list_md_fn(const EVP_MD *m,
|
||||
const char *from, const char *to, void *arg)
|
||||
{
|
||||
const char *mname;
|
||||
/* Skip aliases */
|
||||
if (!m)
|
||||
return;
|
||||
mname = OBJ_nid2ln(EVP_MD_type(m));
|
||||
/* Skip shortnames */
|
||||
if (strcmp(from, mname))
|
||||
return;
|
||||
/* Skip clones */
|
||||
if (EVP_MD_flags(m) & EVP_MD_FLAG_PKEY_DIGEST)
|
||||
return;
|
||||
if (strchr(mname, ' '))
|
||||
mname= EVP_MD_name(m);
|
||||
BIO_printf(arg, "-%-14s to use the %s message digest algorithm\n",
|
||||
mname, mname);
|
||||
}
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||
const char *file,BIO *bmd,const char *hmac_key, int non_fips_allow);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -110,6 +89,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO *in=NULL,*inp;
|
||||
BIO *bmd=NULL;
|
||||
BIO *out = NULL;
|
||||
const char *name;
|
||||
#define PROG_NAME_SIZE 39
|
||||
char pname[PROG_NAME_SIZE+1];
|
||||
int separator=0;
|
||||
@@ -121,16 +101,16 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY *sigkey = NULL;
|
||||
unsigned char *sigbuf = NULL;
|
||||
int siglen = 0;
|
||||
unsigned int sig_flags = 0;
|
||||
char *passargin = NULL, *passin = NULL;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine=NULL;
|
||||
#endif
|
||||
char *hmac_key=NULL;
|
||||
char *mac_name=NULL;
|
||||
STACK_OF(STRING) *sigopts = NULL, *macopts = NULL;
|
||||
int non_fips_allow = 0;
|
||||
|
||||
apps_startup();
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
if ((buf=(unsigned char *)OPENSSL_malloc(BUFSIZE)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
@@ -189,6 +169,27 @@ int MAIN(int argc, char **argv)
|
||||
keyfile=*(++argv);
|
||||
do_verify = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-x931") == 0)
|
||||
sig_flags = EVP_MD_CTX_FLAG_PAD_X931;
|
||||
else if (strcmp(*argv,"-pss_saltlen") == 0)
|
||||
{
|
||||
int saltlen;
|
||||
if (--argc < 1) break;
|
||||
saltlen=atoi(*(++argv));
|
||||
if (saltlen == -1)
|
||||
sig_flags = EVP_MD_CTX_FLAG_PSS_MREC;
|
||||
else if (saltlen == -2)
|
||||
sig_flags = EVP_MD_CTX_FLAG_PSS_MDLEN;
|
||||
else if (saltlen < -2 || saltlen >= 0xFFFE)
|
||||
{
|
||||
BIO_printf(bio_err, "Invalid PSS salt length %d\n", saltlen);
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
sig_flags = saltlen;
|
||||
sig_flags <<= 16;
|
||||
sig_flags |= EVP_MD_CTX_FLAG_PAD_PSS;
|
||||
}
|
||||
else if (strcmp(*argv,"-signature") == 0)
|
||||
{
|
||||
if (--argc < 1) break;
|
||||
@@ -204,7 +205,6 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
if (--argc < 1) break;
|
||||
engine= *(++argv);
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(*argv,"-hex") == 0)
|
||||
@@ -213,36 +213,16 @@ int MAIN(int argc, char **argv)
|
||||
out_bin = 1;
|
||||
else if (strcmp(*argv,"-d") == 0)
|
||||
debug=1;
|
||||
else if (strcmp(*argv,"-non-fips-allow") == 0)
|
||||
non_fips_allow=1;
|
||||
else if (!strcmp(*argv,"-fips-fingerprint"))
|
||||
hmac_key = "etaonrishdlcupfm";
|
||||
else if (!strcmp(*argv,"-hmac"))
|
||||
{
|
||||
if (--argc < 1)
|
||||
break;
|
||||
hmac_key=*++argv;
|
||||
}
|
||||
else if (!strcmp(*argv,"-mac"))
|
||||
{
|
||||
if (--argc < 1)
|
||||
break;
|
||||
mac_name=*++argv;
|
||||
}
|
||||
else if (strcmp(*argv,"-sigopt") == 0)
|
||||
{
|
||||
if (--argc < 1)
|
||||
break;
|
||||
if (!sigopts)
|
||||
sigopts = sk_STRING_new_null();
|
||||
if (!sigopts || !sk_STRING_push(sigopts, *(++argv)))
|
||||
break;
|
||||
}
|
||||
else if (strcmp(*argv,"-macopt") == 0)
|
||||
{
|
||||
if (--argc < 1)
|
||||
break;
|
||||
if (!macopts)
|
||||
macopts = sk_STRING_new_null();
|
||||
if (!macopts || !sk_STRING_push(macopts, *(++argv)))
|
||||
break;
|
||||
}
|
||||
else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
|
||||
md=m;
|
||||
else
|
||||
@@ -251,9 +231,12 @@ int MAIN(int argc, char **argv)
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (md == NULL)
|
||||
md=EVP_md5();
|
||||
|
||||
if(do_verify && !sigfile) {
|
||||
BIO_printf(bio_err, "No signature to verify: use the -signature option\n");
|
||||
err = 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -269,20 +252,49 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,"-verify file verify a signature using public key in file\n");
|
||||
BIO_printf(bio_err,"-prverify file verify a signature using private key in file\n");
|
||||
BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\n");
|
||||
BIO_printf(bio_err,"-out filename output to filename rather than stdout\n");
|
||||
BIO_printf(bio_err,"-signature file signature to verify\n");
|
||||
BIO_printf(bio_err,"-sigopt nm:v signature parameter\n");
|
||||
BIO_printf(bio_err,"-binary output in binary form\n");
|
||||
BIO_printf(bio_err,"-hmac key create hashed MAC with key\n");
|
||||
BIO_printf(bio_err,"-mac algorithm create MAC (not neccessarily HMAC)\n");
|
||||
BIO_printf(bio_err,"-macopt nm:v MAC algorithm parameters or key\n");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
||||
#endif
|
||||
|
||||
EVP_MD_do_all_sorted(list_md_fn, bio_err);
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm (default)\n",
|
||||
LN_md5,LN_md5);
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_md4,LN_md4);
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_md2,LN_md2);
|
||||
#ifndef OPENSSL_NO_SHA
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_sha1,LN_sha1);
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_sha,LN_sha);
|
||||
#ifndef OPENSSL_NO_SHA256
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_sha224,LN_sha224);
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_sha256,LN_sha256);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SHA512
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_sha384,LN_sha384);
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_sha512,LN_sha512);
|
||||
#endif
|
||||
#endif
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_mdc2,LN_mdc2);
|
||||
BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
|
||||
LN_ripemd160,LN_ripemd160);
|
||||
err=1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
bmd=BIO_new(BIO_f_md());
|
||||
if (debug)
|
||||
@@ -305,10 +317,8 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
if(out_bin == -1) {
|
||||
if(keyfile)
|
||||
out_bin = 1;
|
||||
else
|
||||
out_bin = 0;
|
||||
if(keyfile) out_bin = 1;
|
||||
else out_bin = 0;
|
||||
}
|
||||
|
||||
if(randfile)
|
||||
@@ -334,11 +344,6 @@ int MAIN(int argc, char **argv)
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if ((!!mac_name + !!keyfile + !!hmac_key) > 1)
|
||||
{
|
||||
BIO_printf(bio_err, "MAC and Signing key cannot both be specified\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(keyfile)
|
||||
{
|
||||
@@ -356,101 +361,6 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (mac_name)
|
||||
{
|
||||
EVP_PKEY_CTX *mac_ctx = NULL;
|
||||
int r = 0;
|
||||
if (!init_gen_str(bio_err, &mac_ctx, mac_name,e, 0))
|
||||
goto mac_end;
|
||||
if (macopts)
|
||||
{
|
||||
char *macopt;
|
||||
for (i = 0; i < sk_STRING_num(macopts); i++)
|
||||
{
|
||||
macopt = sk_STRING_value(macopts, i);
|
||||
if (pkey_ctrl_string(mac_ctx, macopt) <= 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"MAC parameter error \"%s\"\n",
|
||||
macopt);
|
||||
ERR_print_errors(bio_err);
|
||||
goto mac_end;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (EVP_PKEY_keygen(mac_ctx, &sigkey) <= 0)
|
||||
{
|
||||
BIO_puts(bio_err, "Error generating key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto mac_end;
|
||||
}
|
||||
r = 1;
|
||||
mac_end:
|
||||
if (mac_ctx)
|
||||
EVP_PKEY_CTX_free(mac_ctx);
|
||||
if (r == 0)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (hmac_key)
|
||||
{
|
||||
sigkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, e,
|
||||
(unsigned char *)hmac_key, -1);
|
||||
if (!sigkey)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (sigkey)
|
||||
{
|
||||
EVP_MD_CTX *mctx = NULL;
|
||||
EVP_PKEY_CTX *pctx = NULL;
|
||||
int r;
|
||||
if (!BIO_get_md_ctx(bmd, &mctx))
|
||||
{
|
||||
BIO_printf(bio_err, "Error getting context\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (do_verify)
|
||||
r = EVP_DigestVerifyInit(mctx, &pctx, md, e, sigkey);
|
||||
else
|
||||
r = EVP_DigestSignInit(mctx, &pctx, md, e, sigkey);
|
||||
if (!r)
|
||||
{
|
||||
BIO_printf(bio_err, "Error setting context\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (sigopts)
|
||||
{
|
||||
char *sigopt;
|
||||
for (i = 0; i < sk_STRING_num(sigopts); i++)
|
||||
{
|
||||
sigopt = sk_STRING_value(sigopts, i);
|
||||
if (pkey_ctrl_string(pctx, sigopt) <= 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"parameter error \"%s\"\n",
|
||||
sigopt);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* we use md as a filter, reading from 'in' */
|
||||
else
|
||||
{
|
||||
if (md == NULL)
|
||||
md = EVP_md5();
|
||||
if (!BIO_set_md(bmd,md))
|
||||
{
|
||||
BIO_printf(bio_err, "Error setting digest %s\n", pname);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if(sigfile && sigkey) {
|
||||
BIO *sigbio;
|
||||
sigbio = BIO_new_file(sigfile, "rb");
|
||||
@@ -471,51 +381,67 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
inp=BIO_push(bmd,in);
|
||||
|
||||
if (md == NULL)
|
||||
if (non_fips_allow)
|
||||
{
|
||||
EVP_MD_CTX *tctx;
|
||||
BIO_get_md_ctx(bmd, &tctx);
|
||||
md = EVP_MD_CTX_md(tctx);
|
||||
EVP_MD_CTX *md_ctx;
|
||||
BIO_get_md_ctx(bmd,&md_ctx);
|
||||
EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
|
||||
}
|
||||
|
||||
if (sig_flags)
|
||||
{
|
||||
EVP_MD_CTX *md_ctx;
|
||||
BIO_get_md_ctx(bmd,&md_ctx);
|
||||
EVP_MD_CTX_set_flags(md_ctx, sig_flags);
|
||||
}
|
||||
|
||||
/* we use md as a filter, reading from 'in' */
|
||||
if (!BIO_set_md(bmd,md))
|
||||
{
|
||||
BIO_printf(bio_err, "Error setting digest %s\n", pname);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
inp=BIO_push(bmd,in);
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
err=do_fp(out, buf,inp,separator, out_bin, sigkey, sigbuf,
|
||||
siglen,NULL,NULL,"stdin",bmd);
|
||||
siglen,"","(stdin)",bmd,hmac_key,non_fips_allow);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *md_name = NULL, *sig_name = NULL;
|
||||
if(!out_bin)
|
||||
{
|
||||
if (sigkey)
|
||||
{
|
||||
const EVP_PKEY_ASN1_METHOD *ameth;
|
||||
ameth = EVP_PKEY_get0_asn1(sigkey);
|
||||
if (ameth)
|
||||
EVP_PKEY_asn1_get0_info(NULL, NULL,
|
||||
NULL, NULL, &sig_name, ameth);
|
||||
}
|
||||
md_name = EVP_MD_name(md);
|
||||
}
|
||||
name=OBJ_nid2sn(md->type);
|
||||
err = 0;
|
||||
for (i=0; i<argc; i++)
|
||||
{
|
||||
char *tmp,*tofree=NULL;
|
||||
int r;
|
||||
|
||||
if (BIO_read_filename(in,argv[i]) <= 0)
|
||||
{
|
||||
perror(argv[i]);
|
||||
err++;
|
||||
continue;
|
||||
}
|
||||
if(!out_bin)
|
||||
{
|
||||
size_t len = strlen(name)+strlen(argv[i])+(hmac_key ? 5 : 0)+5;
|
||||
tmp=tofree=OPENSSL_malloc(len);
|
||||
BIO_snprintf(tmp,len,"%s%s(%s)= ",
|
||||
hmac_key ? "HMAC-" : "",name,argv[i]);
|
||||
}
|
||||
else
|
||||
tmp="";
|
||||
r=do_fp(out,buf,inp,separator,out_bin,sigkey,sigbuf,
|
||||
siglen,sig_name,md_name, argv[i],bmd);
|
||||
siglen,tmp,argv[i],bmd,hmac_key,non_fips_allow);
|
||||
if(r)
|
||||
err=r;
|
||||
if(tofree)
|
||||
OPENSSL_free(tofree);
|
||||
(void)BIO_reset(bmd);
|
||||
}
|
||||
}
|
||||
@@ -530,10 +456,6 @@ end:
|
||||
OPENSSL_free(passin);
|
||||
BIO_free_all(out);
|
||||
EVP_PKEY_free(sigkey);
|
||||
if (sigopts)
|
||||
sk_STRING_free(sigopts);
|
||||
if (macopts)
|
||||
sk_STRING_free(macopts);
|
||||
if(sigbuf) OPENSSL_free(sigbuf);
|
||||
if (bmd != NULL) BIO_free(bmd);
|
||||
apps_shutdown();
|
||||
@@ -541,13 +463,24 @@ end:
|
||||
}
|
||||
|
||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen,
|
||||
const char *sig_name, const char *md_name,
|
||||
const char *file,BIO *bmd)
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||
const char *file,BIO *bmd,const char *hmac_key,int non_fips_allow)
|
||||
{
|
||||
size_t len;
|
||||
unsigned int len;
|
||||
int i;
|
||||
EVP_MD_CTX *md_ctx;
|
||||
HMAC_CTX hmac_ctx;
|
||||
|
||||
if (hmac_key)
|
||||
{
|
||||
EVP_MD *md;
|
||||
|
||||
BIO_get_md(bmd,&md);
|
||||
HMAC_CTX_init(&hmac_ctx);
|
||||
HMAC_Init_ex(&hmac_ctx,hmac_key,strlen(hmac_key),md, NULL);
|
||||
BIO_get_md_ctx(bmd,&md_ctx);
|
||||
BIO_set_md_ctx(bmd,&hmac_ctx.md_ctx);
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
i=BIO_read(bp,(char *)buf,BUFSIZE);
|
||||
@@ -563,7 +496,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
{
|
||||
EVP_MD_CTX *ctx;
|
||||
BIO_get_md_ctx(bp, &ctx);
|
||||
i = EVP_DigestVerifyFinal(ctx, sigin, (unsigned int)siglen);
|
||||
i = EVP_VerifyFinal(ctx, sigin, (unsigned int)siglen, key);
|
||||
if(i > 0)
|
||||
BIO_printf(out, "Verified OK\n");
|
||||
else if(i == 0)
|
||||
@@ -583,33 +516,25 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
{
|
||||
EVP_MD_CTX *ctx;
|
||||
BIO_get_md_ctx(bp, &ctx);
|
||||
len = BUFSIZE;
|
||||
if(!EVP_DigestSignFinal(ctx, buf, &len))
|
||||
if(!EVP_SignFinal(ctx, buf, (unsigned int *)&len, key))
|
||||
{
|
||||
BIO_printf(bio_err, "Error Signing Data\n");
|
||||
ERR_print_errors(bio_err);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(hmac_key)
|
||||
{
|
||||
len=BIO_gets(bp,(char *)buf,BUFSIZE);
|
||||
if ((int)len <0)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
return 1;
|
||||
}
|
||||
HMAC_Final(&hmac_ctx,buf,&len);
|
||||
HMAC_CTX_cleanup(&hmac_ctx);
|
||||
}
|
||||
else
|
||||
len=BIO_gets(bp,(char *)buf,BUFSIZE);
|
||||
|
||||
if(binout) BIO_write(out, buf, len);
|
||||
else
|
||||
{
|
||||
if (sig_name)
|
||||
BIO_printf(out, "%s-%s(%s)= ", sig_name, md_name, file);
|
||||
else if (md_name)
|
||||
BIO_printf(out, "%s(%s)= ", md_name, file);
|
||||
else
|
||||
BIO_printf(out, "(%s)= ", file);
|
||||
BIO_write(out,title,strlen(title));
|
||||
for (i=0; i<(int)len; i++)
|
||||
{
|
||||
if (sep && (i != 0))
|
||||
@@ -618,6 +543,10 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
}
|
||||
BIO_printf(out, "\n");
|
||||
}
|
||||
if (hmac_key)
|
||||
{
|
||||
BIO_set_md_ctx(bmd,md_ctx);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
11
apps/dh.c
11
apps/dh.c
@@ -88,9 +88,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
DH *dh=NULL;
|
||||
int i,badops=0,text=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
@@ -189,7 +186,7 @@ bad:
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
@@ -349,10 +346,4 @@ end:
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
#else /* !OPENSSL_NO_DH */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -149,9 +149,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
DH *dh=NULL;
|
||||
int i,badops=0,text=0;
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
@@ -270,7 +267,7 @@ bad:
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (g && !num)
|
||||
@@ -335,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;
|
||||
}
|
||||
@@ -554,10 +550,4 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else /* !OPENSSL_NO_DH */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
57
apps/dsa.c
57
apps/dsa.c
@@ -65,11 +65,11 @@
|
||||
#include "apps.h"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dsa.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dsa_main
|
||||
@@ -112,8 +112,6 @@ int MAIN(int argc, char **argv)
|
||||
char *passin = NULL, *passout = NULL;
|
||||
int modulus=0;
|
||||
|
||||
int pvk_encr = 2;
|
||||
|
||||
apps_startup();
|
||||
|
||||
if (bio_err == NULL)
|
||||
@@ -173,12 +171,6 @@ int MAIN(int argc, char **argv)
|
||||
engine= *(++argv);
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(*argv,"-pvk-strong") == 0)
|
||||
pvk_encr=2;
|
||||
else if (strcmp(*argv,"-pvk-weak") == 0)
|
||||
pvk_encr=1;
|
||||
else if (strcmp(*argv,"-pvk-none") == 0)
|
||||
pvk_encr=0;
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
@@ -246,30 +238,16 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
if (out == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (infile == NULL)
|
||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
else
|
||||
{
|
||||
if (BIO_read_filename(in,infile) <= 0)
|
||||
{
|
||||
perror(infile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
BIO_printf(bio_err,"read DSA key\n");
|
||||
|
||||
{
|
||||
{
|
||||
EVP_PKEY *pkey;
|
||||
|
||||
if (pubin)
|
||||
pkey = load_pubkey(bio_err, infile, informat, 1,
|
||||
passin, e, "Public Key");
|
||||
@@ -277,12 +255,10 @@ bad:
|
||||
pkey = load_key(bio_err, infile, informat, 1,
|
||||
passin, e, "Private Key");
|
||||
|
||||
if (pkey)
|
||||
{
|
||||
dsa = EVP_PKEY_get1_DSA(pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
}
|
||||
if (pkey != NULL)
|
||||
dsa = pkey == NULL ? NULL : EVP_PKEY_get1_DSA(pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
if (dsa == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load Key\n");
|
||||
@@ -334,19 +310,6 @@ bad:
|
||||
i=PEM_write_bio_DSA_PUBKEY(out,dsa);
|
||||
else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
|
||||
NULL,0,NULL, passout);
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
||||
EVP_PKEY *pk;
|
||||
pk = EVP_PKEY_new();
|
||||
EVP_PKEY_set1_DSA(pk, dsa);
|
||||
if (outformat == FORMAT_PVK)
|
||||
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
|
||||
else if (pubin || pubout)
|
||||
i = i2b_PublicKey_bio(out, pk);
|
||||
else
|
||||
i = i2b_PrivateKey_bio(out, pk);
|
||||
EVP_PKEY_free(pk);
|
||||
#endif
|
||||
} else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
@@ -367,10 +330,4 @@ end:
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
#else /* !OPENSSL_NO_DSA */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -111,9 +111,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
DSA *dsa=NULL;
|
||||
int i,badops=0,text=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
@@ -278,7 +275,7 @@ bad:
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (need_rand)
|
||||
@@ -357,12 +354,10 @@ bad:
|
||||
if (C)
|
||||
{
|
||||
unsigned char *data;
|
||||
int l,len,bits_p,bits_q,bits_g;
|
||||
int l,len,bits_p;
|
||||
|
||||
len=BN_num_bytes(dsa->p);
|
||||
bits_p=BN_num_bits(dsa->p);
|
||||
bits_q=BN_num_bits(dsa->q);
|
||||
bits_g=BN_num_bits(dsa->g);
|
||||
data=(unsigned char *)OPENSSL_malloc(len+20);
|
||||
if (data == NULL)
|
||||
{
|
||||
|
||||
11
apps/ec.c
11
apps/ec.c
@@ -85,9 +85,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
int ret = 1;
|
||||
EC_KEY *eckey = NULL;
|
||||
const EC_GROUP *group;
|
||||
@@ -254,7 +251,7 @@ bad:
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout))
|
||||
@@ -400,10 +397,4 @@ end:
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
#else /* !OPENSSL_NO_EC */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -129,9 +129,6 @@ int MAIN(int argc, char **argv)
|
||||
char *infile = NULL, *outfile = NULL, *prog;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
int informat, outformat, noout = 0, C = 0, ret = 1;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
char *engine = NULL;
|
||||
|
||||
BIGNUM *ec_p = NULL, *ec_a = NULL, *ec_b = NULL,
|
||||
@@ -340,7 +337,7 @@ bad:
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (list_curves)
|
||||
@@ -725,10 +722,4 @@ static int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
|
||||
BIO_printf(out, "\n\t};\n\n");
|
||||
return 1;
|
||||
}
|
||||
#else /* !OPENSSL_NO_EC */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
61
apps/enc.c
61
apps/enc.c
@@ -67,7 +67,6 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/comp.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int set_hex(char *in,unsigned char *out,int size);
|
||||
@@ -101,9 +100,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
static const char magic[]="Salted__";
|
||||
char mbuf[sizeof magic-1];
|
||||
char *strbuf=NULL;
|
||||
@@ -117,10 +113,6 @@ int MAIN(int argc, char **argv)
|
||||
char *hkey=NULL,*hiv=NULL,*hsalt = NULL;
|
||||
char *md=NULL;
|
||||
int enc=1,printkey=0,i,base64=0;
|
||||
#ifdef ZLIB
|
||||
int do_zlib=0;
|
||||
BIO *bzl = NULL;
|
||||
#endif
|
||||
int debug=0,olb64=0,nosalt=0;
|
||||
const EVP_CIPHER *cipher=NULL,*c;
|
||||
EVP_CIPHER_CTX *ctx = NULL;
|
||||
@@ -132,6 +124,7 @@ int MAIN(int argc, char **argv)
|
||||
char *engine = NULL;
|
||||
#endif
|
||||
const EVP_MD *dgst=NULL;
|
||||
int non_fips_allow = 0;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -146,18 +139,9 @@ int MAIN(int argc, char **argv)
|
||||
program_name(argv[0],pname,sizeof pname);
|
||||
if (strcmp(pname,"base64") == 0)
|
||||
base64=1;
|
||||
#ifdef ZLIB
|
||||
if (strcmp(pname,"zlib") == 0)
|
||||
do_zlib=1;
|
||||
#endif
|
||||
|
||||
cipher=EVP_get_cipherbyname(pname);
|
||||
#ifdef ZLIB
|
||||
if (!do_zlib && !base64 && (cipher == NULL)
|
||||
&& (strcmp(pname,"enc") != 0))
|
||||
#else
|
||||
if (!base64 && (cipher == NULL) && (strcmp(pname,"enc") != 0))
|
||||
#endif
|
||||
{
|
||||
BIO_printf(bio_err,"%s is an unknown cipher\n",pname);
|
||||
goto bad;
|
||||
@@ -213,10 +197,6 @@ int MAIN(int argc, char **argv)
|
||||
base64=1;
|
||||
else if (strcmp(*argv,"-base64") == 0)
|
||||
base64=1;
|
||||
#ifdef ZLIB
|
||||
else if (strcmp(*argv,"-z") == 0)
|
||||
do_zlib=1;
|
||||
#endif
|
||||
else if (strcmp(*argv,"-bufsize") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -243,7 +223,12 @@ int MAIN(int argc, char **argv)
|
||||
goto bad;
|
||||
}
|
||||
buf[0]='\0';
|
||||
fgets(buf,sizeof buf,infile);
|
||||
if (!fgets(buf,sizeof buf,infile))
|
||||
{
|
||||
BIO_printf(bio_err,"unable to read key from '%s'\n",
|
||||
file);
|
||||
goto bad;
|
||||
}
|
||||
fclose(infile);
|
||||
i=strlen(buf);
|
||||
if ((i > 0) &&
|
||||
@@ -279,6 +264,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))
|
||||
{
|
||||
@@ -301,11 +288,9 @@ bad:
|
||||
BIO_printf(bio_err,"%-14s passphrase is the first line of the file argument\n","-kfile");
|
||||
BIO_printf(bio_err,"%-14s the next argument is the md to use to create a key\n","-md");
|
||||
BIO_printf(bio_err,"%-14s from a passphrase. One of md2, md5, sha or sha1\n","");
|
||||
BIO_printf(bio_err,"%-14s salt in hex is the next argument\n","-S");
|
||||
BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv");
|
||||
BIO_printf(bio_err,"%-14s print the iv/key (then exit if -P)\n","-[pP]");
|
||||
BIO_printf(bio_err,"%-14s buffer size\n","-bufsize <n>");
|
||||
BIO_printf(bio_err,"%-14s disable standard block padding\n","-nopad");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
|
||||
#endif
|
||||
@@ -323,7 +308,7 @@ bad:
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (md && (dgst=EVP_get_digestbyname(md)) == NULL)
|
||||
@@ -334,7 +319,10 @@ bad:
|
||||
|
||||
if (dgst == NULL)
|
||||
{
|
||||
dgst = EVP_md5();
|
||||
if (in_FIPS_mode)
|
||||
dgst = EVP_sha1();
|
||||
else
|
||||
dgst = EVP_md5();
|
||||
}
|
||||
|
||||
if (bufsize != NULL)
|
||||
@@ -466,19 +454,6 @@ bad:
|
||||
rbio=in;
|
||||
wbio=out;
|
||||
|
||||
#ifdef ZLIB
|
||||
|
||||
if (do_zlib)
|
||||
{
|
||||
if ((bzl=BIO_new(BIO_f_zlib())) == NULL)
|
||||
goto end;
|
||||
if (enc)
|
||||
wbio=BIO_push(bzl,wbio);
|
||||
else
|
||||
rbio=BIO_push(bzl,rbio);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (base64)
|
||||
{
|
||||
if ((b64=BIO_new(BIO_f_base64())) == NULL)
|
||||
@@ -583,6 +558,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",
|
||||
@@ -673,9 +653,6 @@ end:
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (benc != NULL) BIO_free(benc);
|
||||
if (b64 != NULL) BIO_free(b64);
|
||||
#ifdef ZLIB
|
||||
if (bzl != NULL) BIO_free(bzl);
|
||||
#endif
|
||||
if(pass) OPENSSL_free(pass);
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
|
||||
@@ -92,7 +92,7 @@ static const char *engine_usage[]={
|
||||
NULL
|
||||
};
|
||||
|
||||
static void identity(char *ptr)
|
||||
static void identity(void *ptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -148,6 +148,11 @@ static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
|
||||
|
||||
if(flags & ENGINE_CMD_FLAG_NUMERIC)
|
||||
{
|
||||
if(started)
|
||||
{
|
||||
BIO_printf(bio_out, "|");
|
||||
err = 1;
|
||||
}
|
||||
BIO_printf(bio_out, "NUMERIC");
|
||||
started = 1;
|
||||
}
|
||||
@@ -200,7 +205,7 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
|
||||
char *desc = NULL;
|
||||
int flags;
|
||||
int xpos = 0;
|
||||
STACK_OF(STRING) *cmds = NULL;
|
||||
STACK *cmds = NULL;
|
||||
if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
|
||||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
|
||||
0, NULL, NULL)) <= 0))
|
||||
@@ -211,7 +216,7 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmds = sk_STRING_new_null();
|
||||
cmds = sk_new_null();
|
||||
|
||||
if(!cmds)
|
||||
goto err;
|
||||
@@ -284,17 +289,15 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
|
||||
BIO_printf(bio_out, "\n");
|
||||
ret = 1;
|
||||
err:
|
||||
if(cmds) sk_STRING_pop_free(cmds, identity);
|
||||
if(cmds) sk_pop_free(cmds, identity);
|
||||
if(name) OPENSSL_free(name);
|
||||
if(desc) OPENSSL_free(desc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void util_do_cmds(ENGINE *e, STACK_OF(STRING) *cmds, BIO *bio_out,
|
||||
const char *indent)
|
||||
static void util_do_cmds(ENGINE *e, STACK *cmds, BIO *bio_out, const char *indent)
|
||||
{
|
||||
int loop, res, num = sk_STRING_num(cmds);
|
||||
|
||||
int loop, res, num = sk_num(cmds);
|
||||
if(num < 0)
|
||||
{
|
||||
BIO_printf(bio_out, "[Error]: internal stack error\n");
|
||||
@@ -304,7 +307,7 @@ static void util_do_cmds(ENGINE *e, STACK_OF(STRING) *cmds, BIO *bio_out,
|
||||
{
|
||||
char buf[256];
|
||||
const char *cmd, *arg;
|
||||
cmd = sk_STRING_value(cmds, loop);
|
||||
cmd = sk_value(cmds, loop);
|
||||
res = 1; /* assume success */
|
||||
/* Check if this command has no ":arg" */
|
||||
if((arg = strstr(cmd, ":")) == NULL)
|
||||
@@ -344,9 +347,9 @@ int MAIN(int argc, char **argv)
|
||||
const char **pp;
|
||||
int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0;
|
||||
ENGINE *e;
|
||||
STACK_OF(STRING) *engines = sk_STRING_new_null();
|
||||
STACK_OF(STRING) *pre_cmds = sk_STRING_new_null();
|
||||
STACK_OF(STRING) *post_cmds = sk_STRING_new_null();
|
||||
STACK *engines = sk_new_null();
|
||||
STACK *pre_cmds = sk_new_null();
|
||||
STACK *post_cmds = sk_new_null();
|
||||
int badops=1;
|
||||
BIO *bio_out=NULL;
|
||||
const char *indent = " ";
|
||||
@@ -393,20 +396,20 @@ int MAIN(int argc, char **argv)
|
||||
argc--; argv++;
|
||||
if (argc == 0)
|
||||
goto skip_arg_loop;
|
||||
sk_STRING_push(pre_cmds,*argv);
|
||||
sk_push(pre_cmds,*argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-post") == 0)
|
||||
{
|
||||
argc--; argv++;
|
||||
if (argc == 0)
|
||||
goto skip_arg_loop;
|
||||
sk_STRING_push(post_cmds,*argv);
|
||||
sk_push(post_cmds,*argv);
|
||||
}
|
||||
else if ((strncmp(*argv,"-h",2) == 0) ||
|
||||
(strcmp(*argv,"-?") == 0))
|
||||
goto skip_arg_loop;
|
||||
else
|
||||
sk_STRING_push(engines,*argv);
|
||||
sk_push(engines,*argv);
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
@@ -421,17 +424,17 @@ skip_arg_loop:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (sk_STRING_num(engines) == 0)
|
||||
if (sk_num(engines) == 0)
|
||||
{
|
||||
for(e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e))
|
||||
{
|
||||
sk_STRING_push(engines,(char *)ENGINE_get_id(e));
|
||||
sk_push(engines,(char *)ENGINE_get_id(e));
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<sk_STRING_num(engines); i++)
|
||||
for (i=0; i<sk_num(engines); i++)
|
||||
{
|
||||
const char *id = sk_STRING_value(engines,i);
|
||||
const char *id = sk_value(engines,i);
|
||||
if ((e = ENGINE_by_id(id)) != NULL)
|
||||
{
|
||||
const char *name = ENGINE_get_name(e);
|
||||
@@ -451,7 +454,6 @@ skip_arg_loop:
|
||||
const int *nids;
|
||||
ENGINE_CIPHERS_PTR fn_c;
|
||||
ENGINE_DIGESTS_PTR fn_d;
|
||||
ENGINE_PKEY_METHS_PTR fn_pk;
|
||||
|
||||
if (ENGINE_get_RSA(e) != NULL
|
||||
&& !append_buf(&cap_buf, "RSA",
|
||||
@@ -490,15 +492,6 @@ skip_ciphers:
|
||||
goto end;
|
||||
|
||||
skip_digests:
|
||||
fn_pk = ENGINE_get_pkey_meths(e);
|
||||
if(!fn_pk) goto skip_pmeths;
|
||||
n = fn_pk(e, NULL, &nids, 0);
|
||||
for(k=0 ; k < n ; ++k)
|
||||
if(!append_buf(&cap_buf,
|
||||
OBJ_nid2sn(nids[k]),
|
||||
&cap_size, 256))
|
||||
goto end;
|
||||
skip_pmeths:
|
||||
if (cap_buf && (*cap_buf != '\0'))
|
||||
BIO_printf(bio_out, " [%s]\n", cap_buf);
|
||||
|
||||
@@ -533,9 +526,9 @@ skip_pmeths:
|
||||
end:
|
||||
|
||||
ERR_print_errors(bio_err);
|
||||
sk_STRING_pop_free(engines, identity);
|
||||
sk_STRING_pop_free(pre_cmds, identity);
|
||||
sk_STRING_pop_free(post_cmds, identity);
|
||||
sk_pop_free(engines, identity);
|
||||
sk_pop_free(pre_cmds, identity);
|
||||
sk_pop_free(post_cmds, identity);
|
||||
if (bio_out != NULL) BIO_free_all(bio_out);
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
|
||||
@@ -97,12 +97,10 @@ int MAIN(int argc, char **argv)
|
||||
out = BIO_push(tmpbio, out);
|
||||
}
|
||||
#endif
|
||||
lh_ERR_STRING_DATA_node_stats_bio(
|
||||
ERR_get_string_table(), out);
|
||||
lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(),
|
||||
out);
|
||||
lh_ERR_STRING_DATA_node_usage_stats_bio(
|
||||
ERR_get_string_table(),out);
|
||||
lh_node_stats_bio((LHASH *)ERR_get_string_table(),out);
|
||||
lh_stats_bio((LHASH *)ERR_get_string_table(),out);
|
||||
lh_node_usage_stats_bio((LHASH *)
|
||||
ERR_get_string_table(),out);
|
||||
}
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
argc--;
|
||||
|
||||
11
apps/gendh.c
11
apps/gendh.c
@@ -89,9 +89,6 @@ int MAIN(int, char **);
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
BN_GENCB cb;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
DH *dh=NULL;
|
||||
int ret=1,num=DEFBITS;
|
||||
int g=2;
|
||||
@@ -163,7 +160,7 @@ bad:
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
out=BIO_new(BIO_s_file());
|
||||
@@ -235,10 +232,4 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
#else /* !OPENSSL_NO_DH */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -78,9 +78,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
DSA *dsa=NULL;
|
||||
int ret=1;
|
||||
char *outfile=NULL;
|
||||
@@ -206,7 +203,7 @@ bad:
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||
|
||||
440
apps/genpkey.c
440
apps/genpkey.c
@@ -1,440 +0,0 @@
|
||||
/* apps/genpkey.c */
|
||||
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||
* project 2006
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
#include <openssl/engine.h>
|
||||
#endif
|
||||
|
||||
static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx,
|
||||
const char *file, ENGINE *e);
|
||||
static int genpkey_cb(EVP_PKEY_CTX *ctx);
|
||||
|
||||
#define PROG genpkey_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
char **args, *outfile = NULL;
|
||||
char *passarg = NULL;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
const EVP_CIPHER *cipher = NULL;
|
||||
int outformat;
|
||||
int text = 0;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
EVP_PKEY_CTX *ctx = NULL;
|
||||
char *pass = NULL;
|
||||
int badarg = 0;
|
||||
int ret = 1, rv;
|
||||
|
||||
int do_param = 0;
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
outformat=FORMAT_PEM;
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
OpenSSL_add_all_algorithms();
|
||||
args = argv + 1;
|
||||
while (!badarg && *args && *args[0] == '-')
|
||||
{
|
||||
if (!strcmp(*args,"-outform"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
outformat=str2fmt(*args);
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args,"-pass"))
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
passarg= *(++args);
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if (strcmp(*args,"-engine") == 0)
|
||||
{
|
||||
if (!args[1])
|
||||
goto bad;
|
||||
e = setup_engine(bio_err, *(++args), 0);
|
||||
}
|
||||
#endif
|
||||
else if (!strcmp (*args, "-paramfile"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto bad;
|
||||
args++;
|
||||
if (do_param == 1)
|
||||
goto bad;
|
||||
if (!init_keygen_file(bio_err, &ctx, *args, e))
|
||||
goto end;
|
||||
}
|
||||
else if (!strcmp (*args, "-out"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
outfile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (strcmp(*args,"-algorithm") == 0)
|
||||
{
|
||||
if (!args[1])
|
||||
goto bad;
|
||||
if (!init_gen_str(bio_err, &ctx, *(++args),e, do_param))
|
||||
goto end;
|
||||
}
|
||||
else if (strcmp(*args,"-pkeyopt") == 0)
|
||||
{
|
||||
if (!args[1])
|
||||
goto bad;
|
||||
if (!ctx)
|
||||
{
|
||||
BIO_puts(bio_err, "No keytype specified\n");
|
||||
goto bad;
|
||||
}
|
||||
else if (pkey_ctrl_string(ctx, *(++args)) <= 0)
|
||||
{
|
||||
BIO_puts(bio_err, "parameter setting error\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else if (strcmp(*args,"-genparam") == 0)
|
||||
{
|
||||
if (ctx)
|
||||
goto bad;
|
||||
do_param = 1;
|
||||
}
|
||||
else if (strcmp(*args,"-text") == 0)
|
||||
text=1;
|
||||
else
|
||||
{
|
||||
cipher = EVP_get_cipherbyname(*args + 1);
|
||||
if (!cipher)
|
||||
{
|
||||
BIO_printf(bio_err, "Unknown cipher %s\n",
|
||||
*args + 1);
|
||||
badarg = 1;
|
||||
}
|
||||
if (do_param == 1)
|
||||
badarg = 1;
|
||||
}
|
||||
args++;
|
||||
}
|
||||
|
||||
if (!ctx)
|
||||
badarg = 1;
|
||||
|
||||
if (badarg)
|
||||
{
|
||||
bad:
|
||||
BIO_printf(bio_err, "Usage: genpkey [options]\n");
|
||||
BIO_printf(bio_err, "where options may be\n");
|
||||
BIO_printf(bio_err, "-out file output file\n");
|
||||
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
||||
BIO_printf(bio_err, "-pass arg output file pass phrase source\n");
|
||||
BIO_printf(bio_err, "-<cipher> use cipher <cipher> to encrypt the key\n");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
#endif
|
||||
BIO_printf(bio_err, "-paramfile file parameters file\n");
|
||||
BIO_printf(bio_err, "-algorithm alg the public key algorithm\n");
|
||||
BIO_printf(bio_err, "-pkeyopt opt:value set the public key algorithm option <opt>\n"
|
||||
" to value <value>\n");
|
||||
BIO_printf(bio_err, "-genparam generate parameters, not key\n");
|
||||
BIO_printf(bio_err, "-text print the in text\n");
|
||||
BIO_printf(bio_err, "NB: options order may be important! See the manual page.\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!app_passwd(bio_err, passarg, NULL, &pass, NULL))
|
||||
{
|
||||
BIO_puts(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (outfile)
|
||||
{
|
||||
if (!(out = BIO_new_file (outfile, "wb")))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't open output file %s\n", outfile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
{
|
||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||
out = BIO_push(tmpbio, out);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
EVP_PKEY_CTX_set_cb(ctx, genpkey_cb);
|
||||
EVP_PKEY_CTX_set_app_data(ctx, bio_err);
|
||||
|
||||
if (do_param)
|
||||
{
|
||||
if (EVP_PKEY_paramgen(ctx, &pkey) <= 0)
|
||||
{
|
||||
BIO_puts(bio_err, "Error generating parameters\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EVP_PKEY_keygen(ctx, &pkey) <= 0)
|
||||
{
|
||||
BIO_puts(bio_err, "Error generating key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (do_param)
|
||||
rv = PEM_write_bio_Parameters(out, pkey);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
rv = PEM_write_bio_PrivateKey(out, pkey, cipher, NULL, 0,
|
||||
NULL, pass);
|
||||
else if (outformat == FORMAT_ASN1)
|
||||
rv = i2d_PrivateKey_bio(out, pkey);
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (rv <= 0)
|
||||
{
|
||||
BIO_puts(bio_err, "Error writing key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
|
||||
if (text)
|
||||
{
|
||||
if (do_param)
|
||||
rv = EVP_PKEY_print_params(out, pkey, 0, NULL);
|
||||
else
|
||||
rv = EVP_PKEY_print_private(out, pkey, 0, NULL);
|
||||
|
||||
if (rv <= 0)
|
||||
{
|
||||
BIO_puts(bio_err, "Error printing key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
if (pkey)
|
||||
EVP_PKEY_free(pkey);
|
||||
if (ctx)
|
||||
EVP_PKEY_CTX_free(ctx);
|
||||
if (out)
|
||||
BIO_free_all(out);
|
||||
BIO_free(in);
|
||||
if (pass)
|
||||
OPENSSL_free(pass);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int init_keygen_file(BIO *err, EVP_PKEY_CTX **pctx,
|
||||
const char *file, ENGINE *e)
|
||||
{
|
||||
BIO *pbio;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
EVP_PKEY_CTX *ctx = NULL;
|
||||
if (*pctx)
|
||||
{
|
||||
BIO_puts(err, "Parameters already set!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pbio = BIO_new_file(file, "r");
|
||||
if (!pbio)
|
||||
{
|
||||
BIO_printf(err, "Can't open parameter file %s\n", file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pkey = PEM_read_bio_Parameters(pbio, NULL);
|
||||
BIO_free(pbio);
|
||||
|
||||
if (!pkey)
|
||||
{
|
||||
BIO_printf(bio_err, "Error reading parameter file %s\n", file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctx = EVP_PKEY_CTX_new(pkey, e);
|
||||
if (!ctx)
|
||||
goto err;
|
||||
if (EVP_PKEY_keygen_init(ctx) <= 0)
|
||||
goto err;
|
||||
EVP_PKEY_free(pkey);
|
||||
*pctx = ctx;
|
||||
return 1;
|
||||
|
||||
err:
|
||||
BIO_puts(err, "Error initializing context\n");
|
||||
ERR_print_errors(err);
|
||||
if (ctx)
|
||||
EVP_PKEY_CTX_free(ctx);
|
||||
if (pkey)
|
||||
EVP_PKEY_free(pkey);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
|
||||
const char *algname, ENGINE *e, int do_param)
|
||||
{
|
||||
EVP_PKEY_CTX *ctx = NULL;
|
||||
const EVP_PKEY_ASN1_METHOD *ameth;
|
||||
ENGINE *tmpeng = NULL;
|
||||
int pkey_id;
|
||||
|
||||
if (*pctx)
|
||||
{
|
||||
BIO_puts(err, "Algorithm already set!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ameth = EVP_PKEY_asn1_find_str(&tmpeng, algname, -1);
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (!ameth && e)
|
||||
ameth = ENGINE_get_pkey_asn1_meth_str(e, algname, -1);
|
||||
#endif
|
||||
|
||||
if (!ameth)
|
||||
{
|
||||
BIO_printf(bio_err, "Algorithm %s not found\n", algname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ERR_clear_error();
|
||||
|
||||
EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (tmpeng)
|
||||
ENGINE_finish(tmpeng);
|
||||
#endif
|
||||
ctx = EVP_PKEY_CTX_new_id(pkey_id, e);
|
||||
|
||||
if (!ctx)
|
||||
goto err;
|
||||
if (do_param)
|
||||
{
|
||||
if (EVP_PKEY_paramgen_init(ctx) <= 0)
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EVP_PKEY_keygen_init(ctx) <= 0)
|
||||
goto err;
|
||||
}
|
||||
|
||||
*pctx = ctx;
|
||||
return 1;
|
||||
|
||||
err:
|
||||
BIO_printf(err, "Error initializing %s context\n", algname);
|
||||
ERR_print_errors(err);
|
||||
if (ctx)
|
||||
EVP_PKEY_CTX_free(ctx);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static int genpkey_cb(EVP_PKEY_CTX *ctx)
|
||||
{
|
||||
char c='*';
|
||||
BIO *b = EVP_PKEY_CTX_get_app_data(ctx);
|
||||
int p;
|
||||
p = EVP_PKEY_CTX_get_keygen_info(ctx, 0);
|
||||
if (p == 0) c='.';
|
||||
if (p == 1) c='+';
|
||||
if (p == 2) c='*';
|
||||
if (p == 3) c='\n';
|
||||
BIO_write(b,&c,1);
|
||||
(void)BIO_flush(b);
|
||||
#ifdef LINT
|
||||
p=n;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
@@ -89,12 +89,10 @@ int MAIN(int, char **);
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
BN_GENCB cb;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
int ret=1;
|
||||
int i,num=DEFBITS;
|
||||
long l;
|
||||
int use_x931 = 0;
|
||||
const EVP_CIPHER *enc=NULL;
|
||||
unsigned long f4=RSA_F4;
|
||||
char *outfile=NULL;
|
||||
@@ -138,6 +136,8 @@ int MAIN(int argc, char **argv)
|
||||
f4=3;
|
||||
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
|
||||
f4=RSA_F4;
|
||||
else if (strcmp(*argv,"-x931") == 0)
|
||||
use_x931 = 1;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
@@ -232,7 +232,7 @@ bad:
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (outfile == NULL)
|
||||
@@ -270,7 +270,17 @@ bad:
|
||||
if (!rsa)
|
||||
goto err;
|
||||
|
||||
if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
|
||||
if (use_x931)
|
||||
{
|
||||
BIGNUM *pubexp;
|
||||
pubexp = BN_new();
|
||||
if (!BN_set_word(pubexp, f4))
|
||||
goto err;
|
||||
if (!RSA_X931_generate_key_ex(rsa, num, pubexp, &cb))
|
||||
goto err;
|
||||
BN_free(pubexp);
|
||||
}
|
||||
else if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
|
||||
goto err;
|
||||
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
|
||||
@@ -57,7 +57,7 @@ $ LOOP_EXE_END:
|
||||
$
|
||||
$ SET NOON
|
||||
$ COPY CA.COM WRK_SSLEXE:CA.COM/LOG
|
||||
$ SET FILE/PROT=W:RE WRK_SSLVEXE:CA.COM
|
||||
$ SET FILE/PROT=W:RE WRK_SSLEXE:CA.COM
|
||||
$ COPY OPENSSL-VMS.CNF WRK_SSLROOT:[000000]OPENSSL.CNF/LOG
|
||||
$ SET FILE/PROT=W:R WRK_SSLROOT:[000000]OPENSSL.CNF
|
||||
$ SET ON
|
||||
|
||||
@@ -6,6 +6,7 @@ $! A-Com Computing, Inc.
|
||||
$! byer@mail.all-net.net
|
||||
$!
|
||||
$! Changes by Richard Levitte <richard@levitte.org>
|
||||
$! Zoltan Arpadffy <zoli@polarhome.com>
|
||||
$!
|
||||
$! This command files compiles and creates all the various different
|
||||
$! "application" programs for the different types of encryption for OpenSSL.
|
||||
@@ -138,19 +139,19 @@ $! reflect the E_OBJ variable in Makefile as closely as possible, thereby
|
||||
$! making it fairly easy to verify that the lists are the same.
|
||||
$!
|
||||
$ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
|
||||
"CA,PKCS7,CRL2P7,CRL,"+-
|
||||
"RSA,RSAUTL,DSA,DSAPARAM,EC,ECPARAM,"+-
|
||||
"X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+-
|
||||
"S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
|
||||
"CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ -
|
||||
"SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS"
|
||||
"CA,PKCS7,CRL2P7,CRL,"+-
|
||||
"RSA,RSAUTL,DSA,DSAPARAM,EC,ECPARAM,"+-
|
||||
"X509,GENRSA,GENDSA,S_SERVER,S_CLIENT,SPEED,"+-
|
||||
"S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
|
||||
"CIPHERS,NSEQ,PKCS12,PKCS8,SPKAC,SMIME,RAND,ENGINE,"+-
|
||||
"OCSP,PRIME,CMS"
|
||||
$ TCPIP_PROGRAMS = ",,"
|
||||
$ IF COMPILER .EQS. "VAXC" THEN -
|
||||
TCPIP_PROGRAMS = ",OPENSSL,"
|
||||
$!
|
||||
$! Setup exceptional compilations
|
||||
$!
|
||||
$ COMPILEWITH_CC2 = ",S_SERVER,S_CLIENT,"
|
||||
$ COMPILEWITH_CC2 = ",S_SOCKET,S_SERVER,S_CLIENT,"
|
||||
$!
|
||||
$ PHASE := LIB
|
||||
$!
|
||||
@@ -168,6 +169,10 @@ $! Make The Application File Name
|
||||
$!
|
||||
$ CURRENT_APP = F$EDIT(F$ELEMENT(APP_COUNTER,",",PROGRAMS),"TRIM")
|
||||
$!
|
||||
$! Create The Executable File Name.
|
||||
$!
|
||||
$ EXE_FILE = EXE_DIR + CURRENT_APP + ".EXE"
|
||||
$!
|
||||
$! Check To See If We Are At The End Of The File List.
|
||||
$!
|
||||
$ IF (CURRENT_APP.EQS.",")
|
||||
@@ -231,10 +236,6 @@ $!
|
||||
$! Create The Object File Name.
|
||||
$!
|
||||
$ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ"
|
||||
$!
|
||||
$! Create The Executable File Name.
|
||||
$!
|
||||
$ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE"
|
||||
$ ON WARNING THEN GOTO NEXT_LIB
|
||||
$!
|
||||
$! Check To See If The File We Want To Compile Actually Exists.
|
||||
|
||||
125
apps/ocsp.c
125
apps/ocsp.c
@@ -56,52 +56,25 @@
|
||||
*
|
||||
*/
|
||||
#ifndef OPENSSL_NO_OCSP
|
||||
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
#define _XOPEN_SOURCE_EXTENDED /* So fd_set and friends get properly defined
|
||||
on OpenVMS */
|
||||
#endif
|
||||
|
||||
#define USE_SOCKETS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "apps.h" /* needs to be included before the openssl headers! */
|
||||
#include <openssl/e_os2.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
#if defined(NETWARE_CLIB)
|
||||
# ifdef NETWARE_BSDSOCK
|
||||
# include <sys/socket.h>
|
||||
# include <sys/bsdskt.h>
|
||||
# else
|
||||
# include <novsock2.h>
|
||||
# endif
|
||||
#elif defined(NETWARE_LIBC)
|
||||
# ifdef NETWARE_BSDSOCK
|
||||
# include <sys/select.h>
|
||||
# else
|
||||
# include <novsock2.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Maximum leeway in validity period: default 5 minutes */
|
||||
#define MAX_VALIDITY_PERIOD (5 * 60)
|
||||
|
||||
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_md, X509 *issuer,
|
||||
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
|
||||
STACK_OF(OCSP_CERTID) *ids);
|
||||
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, const EVP_MD * cert_id_md, X509 *issuer,
|
||||
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer,
|
||||
STACK_OF(OCSP_CERTID) *ids);
|
||||
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
STACK_OF(STRING) *names,
|
||||
STACK_OF(OCSP_CERTID) *ids, long nsec,
|
||||
long maxage);
|
||||
STACK *names, STACK_OF(OCSP_CERTID) *ids,
|
||||
long nsec, long maxage);
|
||||
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
|
||||
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
||||
@@ -125,6 +98,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;
|
||||
@@ -153,7 +127,7 @@ int MAIN(int argc, char **argv)
|
||||
int badarg = 0;
|
||||
int i;
|
||||
int ignore_err = 0;
|
||||
STACK_OF(STRING) *reqnames = NULL;
|
||||
STACK *reqnames = NULL;
|
||||
STACK_OF(OCSP_CERTID) *ids = NULL;
|
||||
|
||||
X509 *rca_cert = NULL;
|
||||
@@ -161,7 +135,6 @@ int MAIN(int argc, char **argv)
|
||||
char *rca_filename = NULL;
|
||||
CA_DB *rdb = NULL;
|
||||
int nmin = 0, ndays = -1;
|
||||
const EVP_MD *cert_id_md = NULL;
|
||||
|
||||
if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
@@ -170,7 +143,7 @@ int MAIN(int argc, char **argv)
|
||||
SSL_load_error_strings();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
args = argv + 1;
|
||||
reqnames = sk_STRING_new_null();
|
||||
reqnames = sk_new_null();
|
||||
ids = sk_OCSP_CERTID_new_null();
|
||||
while (!badarg && *args && *args[0] == '-')
|
||||
{
|
||||
@@ -201,6 +174,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++;
|
||||
@@ -209,6 +188,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;
|
||||
}
|
||||
@@ -429,10 +411,9 @@ int MAIN(int argc, char **argv)
|
||||
cert = load_cert(bio_err, *args, FORMAT_PEM,
|
||||
NULL, e, "certificate");
|
||||
if(!cert) goto end;
|
||||
if (!cert_id_md) cert_id_md = EVP_sha1();
|
||||
if(!add_ocsp_cert(&req, cert, cert_id_md, issuer, ids))
|
||||
if(!add_ocsp_cert(&req, cert, issuer, ids))
|
||||
goto end;
|
||||
if(!sk_STRING_push(reqnames, *args))
|
||||
if(!sk_push(reqnames, *args))
|
||||
goto end;
|
||||
}
|
||||
else badarg = 1;
|
||||
@@ -442,10 +423,9 @@ int MAIN(int argc, char **argv)
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
if (!cert_id_md) cert_id_md = EVP_sha1();
|
||||
if(!add_ocsp_serial(&req, *args, cert_id_md, issuer, ids))
|
||||
if(!add_ocsp_serial(&req, *args, issuer, ids))
|
||||
goto end;
|
||||
if(!sk_STRING_push(reqnames, *args))
|
||||
if(!sk_push(reqnames, *args))
|
||||
goto end;
|
||||
}
|
||||
else badarg = 1;
|
||||
@@ -545,10 +525,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if ((cert_id_md = EVP_get_digestbyname((*args)+1))==NULL)
|
||||
{
|
||||
badarg = 1;
|
||||
}
|
||||
else badarg = 1;
|
||||
args++;
|
||||
}
|
||||
|
||||
@@ -604,7 +581,6 @@ 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");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -711,8 +687,7 @@ int MAIN(int argc, char **argv)
|
||||
"signer private key");
|
||||
if (!key)
|
||||
goto end;
|
||||
|
||||
if (!OCSP_request_sign(req, signer, key, NULL, sign_other, sign_flags))
|
||||
if (!OCSP_request_sign(req, signer, key, EVP_sha1(), sign_other, sign_flags))
|
||||
{
|
||||
BIO_printf(bio_err, "Error signing OCSP request\n");
|
||||
goto end;
|
||||
@@ -901,22 +876,22 @@ end:
|
||||
OCSP_REQUEST_free(req);
|
||||
OCSP_RESPONSE_free(resp);
|
||||
OCSP_BASICRESP_free(bs);
|
||||
sk_STRING_free(reqnames);
|
||||
sk_free(reqnames);
|
||||
sk_OCSP_CERTID_free(ids);
|
||||
sk_X509_pop_free(sign_other, X509_free);
|
||||
sk_X509_pop_free(verify_other, X509_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);
|
||||
}
|
||||
|
||||
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_md,X509 *issuer,
|
||||
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
|
||||
STACK_OF(OCSP_CERTID) *ids)
|
||||
{
|
||||
OCSP_CERTID *id;
|
||||
@@ -927,7 +902,7 @@ static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_m
|
||||
}
|
||||
if(!*req) *req = OCSP_REQUEST_new();
|
||||
if(!*req) goto err;
|
||||
id = OCSP_cert_to_id(cert_id_md, cert, issuer);
|
||||
id = OCSP_cert_to_id(NULL, cert, issuer);
|
||||
if(!id || !sk_OCSP_CERTID_push(ids, id)) goto err;
|
||||
if(!OCSP_request_add0_id(*req, id)) goto err;
|
||||
return 1;
|
||||
@@ -937,7 +912,7 @@ static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_m
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,const EVP_MD *cert_id_md, X509 *issuer,
|
||||
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer,
|
||||
STACK_OF(OCSP_CERTID) *ids)
|
||||
{
|
||||
OCSP_CERTID *id;
|
||||
@@ -959,7 +934,7 @@ static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,const EVP_MD *cert_i
|
||||
BIO_printf(bio_err, "Error converting serial number %s\n", serial);
|
||||
return 0;
|
||||
}
|
||||
id = OCSP_cert_id_new(cert_id_md, iname, ikey, sno);
|
||||
id = OCSP_cert_id_new(EVP_sha1(), iname, ikey, sno);
|
||||
ASN1_INTEGER_free(sno);
|
||||
if(!id || !sk_OCSP_CERTID_push(ids, id)) goto err;
|
||||
if(!OCSP_request_add0_id(*req, id)) goto err;
|
||||
@@ -971,9 +946,8 @@ static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,const EVP_MD *cert_i
|
||||
}
|
||||
|
||||
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
STACK_OF(STRING) *names,
|
||||
STACK_OF(OCSP_CERTID) *ids, long nsec,
|
||||
long maxage)
|
||||
STACK *names, STACK_OF(OCSP_CERTID) *ids,
|
||||
long nsec, long maxage)
|
||||
{
|
||||
OCSP_CERTID *id;
|
||||
char *name;
|
||||
@@ -983,13 +957,13 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
|
||||
ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;
|
||||
|
||||
if (!bs || !req || !sk_STRING_num(names) || !sk_OCSP_CERTID_num(ids))
|
||||
if (!bs || !req || !sk_num(names) || !sk_OCSP_CERTID_num(ids))
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < sk_OCSP_CERTID_num(ids); i++)
|
||||
{
|
||||
id = sk_OCSP_CERTID_value(ids, i);
|
||||
name = sk_STRING_value(names, i);
|
||||
name = sk_value(names, i);
|
||||
BIO_printf(out, "%s: ", name);
|
||||
|
||||
if(!OCSP_resp_find_status(bs, id, &status, &reason,
|
||||
@@ -1046,6 +1020,7 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db
|
||||
OCSP_BASICRESP *bs = NULL;
|
||||
int i, id_count, ret = 1;
|
||||
|
||||
|
||||
id_count = OCSP_request_onereq_count(req);
|
||||
|
||||
if (id_count <= 0)
|
||||
@@ -1054,6 +1029,7 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db
|
||||
goto end;
|
||||
}
|
||||
|
||||
ca_id = OCSP_cert_to_id(EVP_sha1(), NULL, ca);
|
||||
|
||||
bs = OCSP_BASICRESP_new();
|
||||
thisupd = X509_gmtime_adj(NULL, 0);
|
||||
@@ -1066,23 +1042,8 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db
|
||||
OCSP_ONEREQ *one;
|
||||
ASN1_INTEGER *serial;
|
||||
char **inf;
|
||||
ASN1_OBJECT *cert_id_md_oid;
|
||||
const EVP_MD *cert_id_md;
|
||||
one = OCSP_request_onereq_get0(req, i);
|
||||
cid = OCSP_onereq_get0_id(one);
|
||||
|
||||
OCSP_id_get0_info(NULL,&cert_id_md_oid, NULL,NULL, cid);
|
||||
|
||||
cert_id_md = EVP_get_digestbyobj(cert_id_md_oid);
|
||||
if (! cert_id_md)
|
||||
{
|
||||
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR,
|
||||
NULL);
|
||||
goto end;
|
||||
}
|
||||
if (ca_id) OCSP_CERTID_free(ca_id);
|
||||
ca_id = OCSP_cert_to_id(cert_id_md, NULL, ca);
|
||||
|
||||
/* Is this request about our CA? */
|
||||
if (OCSP_id_issuer_cmp(ca_id, cid))
|
||||
{
|
||||
@@ -1127,8 +1088,8 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db
|
||||
}
|
||||
|
||||
OCSP_copy_nonce(bs, req);
|
||||
|
||||
OCSP_basic_sign(bs, rcert, rkey, NULL, rother, flags);
|
||||
|
||||
OCSP_basic_sign(bs, rcert, rkey, EVP_sha1(), rother, flags);
|
||||
|
||||
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs);
|
||||
|
||||
@@ -1383,7 +1344,7 @@ OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
|
||||
}
|
||||
resp = query_responder(err, cbio, path, req, req_timeout);
|
||||
if (!resp)
|
||||
BIO_printf(bio_err, "Error querying OCSP responsder\n");
|
||||
BIO_printf(bio_err, "Error querying OCSP responder\n");
|
||||
end:
|
||||
if (ctx)
|
||||
SSL_CTX_free(ctx);
|
||||
|
||||
@@ -21,17 +21,12 @@ oid_section = new_oids
|
||||
|
||||
[ new_oids ]
|
||||
|
||||
# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
|
||||
# We can add new OIDs in here for use by 'ca' and 'req'.
|
||||
# Add a simple OID like this:
|
||||
# testoid1=1.2.3.4
|
||||
# Or use config file substitution like this:
|
||||
# testoid2=${testoid1}.5.6
|
||||
|
||||
# Policies used by the TSA examples.
|
||||
tsa_policy1 = 1.2.3.4.1
|
||||
tsa_policy2 = 1.2.3.4.5.6
|
||||
tsa_policy3 = 1.2.3.4.5.7
|
||||
|
||||
####################################################################
|
||||
[ ca ]
|
||||
default_ca = CA_default # The default ca section
|
||||
@@ -72,7 +67,7 @@ cert_opt = ca_default # Certificate field options
|
||||
|
||||
default_days = 365 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = default # use public key default MD
|
||||
default_md = sha1 # which md to use.
|
||||
preserve = no # keep passed DN ordering
|
||||
|
||||
# A few difference way of specifying how similar the request should look
|
||||
@@ -115,12 +110,13 @@ x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString (PKIX recommendation before 2004)
|
||||
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
|
||||
# pkix : PrintableString, BMPString.
|
||||
# utf8only: only UTF8Strings.
|
||||
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
|
||||
# MASK:XXXX a literal mask value.
|
||||
# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
|
||||
string_mask = utf8only
|
||||
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
|
||||
# so use this option with caution!
|
||||
string_mask = nombstr
|
||||
|
||||
# req_extensions = v3_req # The extensions to add to a certificate request
|
||||
|
||||
@@ -145,7 +141,7 @@ localityName = Locality Name (eg, city)
|
||||
organizationalUnitName = Organizational Unit Name (eg, section)
|
||||
#organizationalUnitName_default =
|
||||
|
||||
commonName = Common Name (eg, YOUR name)
|
||||
commonName = Common Name (e.g. server FQDN or YOUR name)
|
||||
commonName_max = 64
|
||||
|
||||
emailAddress = Email Address
|
||||
@@ -211,9 +207,6 @@ authorityKeyIdentifier=keyid,issuer
|
||||
#nsCaPolicyUrl
|
||||
#nsSslServerName
|
||||
|
||||
# This is required for TSA certificates.
|
||||
# extendedKeyUsage = critical,timeStamping
|
||||
|
||||
[ v3_req ]
|
||||
|
||||
# Extensions to add to a certificate request
|
||||
@@ -231,7 +224,7 @@ keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
|
||||
subjectKeyIdentifier=hash
|
||||
|
||||
authorityKeyIdentifier=keyid:always,issuer
|
||||
authorityKeyIdentifier=keyid:always,issuer:always
|
||||
|
||||
# This is what PKIX recommends but some broken software chokes on critical
|
||||
# extensions.
|
||||
@@ -264,7 +257,7 @@ basicConstraints = CA:true
|
||||
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
|
||||
|
||||
# issuerAltName=issuer:copy
|
||||
authorityKeyIdentifier=keyid:always
|
||||
authorityKeyIdentifier=keyid:always,issuer:always
|
||||
|
||||
[ proxy_cert_ext ]
|
||||
# These extensions should be added when creating a proxy certificate
|
||||
@@ -297,7 +290,7 @@ nsComment = "OpenSSL Generated Certificate"
|
||||
|
||||
# PKIX recommendations harmless if included in all certificates.
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid,issuer
|
||||
authorityKeyIdentifier=keyid,issuer:always
|
||||
|
||||
# This stuff is for subjectAltName and issuerAltname.
|
||||
# Import the email address.
|
||||
@@ -318,33 +311,3 @@ authorityKeyIdentifier=keyid,issuer
|
||||
|
||||
# This really needs to be in place for it to be a proxy certificate.
|
||||
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
|
||||
|
||||
####################################################################
|
||||
[ tsa ]
|
||||
|
||||
default_tsa = tsa_config1 # the default TSA section
|
||||
|
||||
[ tsa_config1 ]
|
||||
|
||||
# These are used by the TSA reply generation only.
|
||||
dir = sys\$disk:[.demoCA # TSA root directory
|
||||
serial = $dir]tsaserial. # The current serial number (mandatory)
|
||||
crypto_device = builtin # OpenSSL engine to use for signing
|
||||
signer_cert = $dir/tsacert.pem # The TSA signing certificate
|
||||
# (optional)
|
||||
certs = $dir.cacert.pem] # Certificate chain to include in reply
|
||||
# (optional)
|
||||
signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
|
||||
|
||||
default_policy = tsa_policy1 # Policy if request did not specify it
|
||||
# (optional)
|
||||
other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)
|
||||
digests = md5, sha1 # Acceptable message digests (mandatory)
|
||||
accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
|
||||
clock_precision_digits = 0 # number of digits after dot. (optional)
|
||||
ordering = yes # Is ordering defined for timestamps?
|
||||
# (optional, default: no)
|
||||
tsa_name = yes # Must the TSA name be included in the reply?
|
||||
# (optional, default: no)
|
||||
ess_cert_id_chain = no # Must the ESS cert id chain be included?
|
||||
# (optional, default: no)
|
||||
|
||||
217
apps/openssl.c
217
apps/openssl.c
@@ -135,17 +135,19 @@
|
||||
* type of "FUNCTION*"). This removes the necessity for macro-generated wrapper
|
||||
* functions. */
|
||||
|
||||
static LHASH_OF(FUNCTION) *prog_init(void );
|
||||
static int do_cmd(LHASH_OF(FUNCTION) *prog,int argc,char *argv[]);
|
||||
static void list_pkey(BIO *out);
|
||||
static void list_cipher(BIO *out);
|
||||
static void list_md(BIO *out);
|
||||
/* static unsigned long MS_CALLBACK hash(FUNCTION *a); */
|
||||
static unsigned long MS_CALLBACK hash(const void *a_void);
|
||||
/* static int MS_CALLBACK cmp(FUNCTION *a,FUNCTION *b); */
|
||||
static int MS_CALLBACK cmp(const void *a_void,const void *b_void);
|
||||
static LHASH *prog_init(void );
|
||||
static int do_cmd(LHASH *prog,int argc,char *argv[]);
|
||||
char *default_config_file=NULL;
|
||||
|
||||
/* Make sure there is only one when MONOLITH is defined */
|
||||
#ifdef MONOLITH
|
||||
CONF *config=NULL;
|
||||
BIO *bio_err=NULL;
|
||||
int in_FIPS_mode=0;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -225,12 +227,28 @@ int main(int Argc, char *Argv[])
|
||||
int n,i,ret=0;
|
||||
int argc;
|
||||
char **argv,*p;
|
||||
LHASH_OF(FUNCTION) *prog=NULL;
|
||||
LHASH *prog=NULL;
|
||||
long errline;
|
||||
|
||||
arg.data=NULL;
|
||||
arg.count=0;
|
||||
|
||||
in_FIPS_mode = 0;
|
||||
|
||||
if(getenv("OPENSSL_FIPS")) {
|
||||
#ifdef OPENSSL_FIPS
|
||||
if (!FIPS_mode_set(1)) {
|
||||
ERR_load_crypto_strings();
|
||||
ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
|
||||
EXIT(1);
|
||||
}
|
||||
in_FIPS_mode = 1;
|
||||
#else
|
||||
fprintf(stderr, "FIPS mode not supported.\n");
|
||||
EXIT(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (bio_err == NULL)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
@@ -272,21 +290,9 @@ int main(int Argc, char *Argv[])
|
||||
i=NCONF_load(config,p,&errline);
|
||||
if (i == 0)
|
||||
{
|
||||
if (ERR_GET_REASON(ERR_peek_last_error())
|
||||
== CONF_R_NO_SUCH_FILE)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"WARNING: can't open config file: %s\n",p);
|
||||
ERR_clear_error();
|
||||
NCONF_free(config);
|
||||
config = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
NCONF_free(config);
|
||||
exit(1);
|
||||
}
|
||||
NCONF_free(config);
|
||||
config = NULL;
|
||||
ERR_clear_error();
|
||||
}
|
||||
|
||||
prog=prog_init();
|
||||
@@ -295,7 +301,7 @@ int main(int Argc, char *Argv[])
|
||||
program_name(Argv[0],pname,sizeof pname);
|
||||
|
||||
f.name=pname;
|
||||
fp=lh_FUNCTION_retrieve(prog,&f);
|
||||
fp=(FUNCTION *)lh_retrieve(prog,&f);
|
||||
if (fp != NULL)
|
||||
{
|
||||
Argv[0]=pname;
|
||||
@@ -330,7 +336,8 @@ int main(int Argc, char *Argv[])
|
||||
else prompt="OpenSSL> ";
|
||||
fputs(prompt,stdout);
|
||||
fflush(stdout);
|
||||
fgets(p,n,stdin);
|
||||
if (!fgets(p,n,stdin))
|
||||
goto end;
|
||||
if (p[0] == '\0') goto end;
|
||||
i=strlen(p);
|
||||
if (i <= 1) break;
|
||||
@@ -361,7 +368,7 @@ end:
|
||||
NCONF_free(config);
|
||||
config=NULL;
|
||||
}
|
||||
if (prog != NULL) lh_FUNCTION_free(prog);
|
||||
if (prog != NULL) lh_free(prog);
|
||||
if (arg.data != NULL) OPENSSL_free(arg.data);
|
||||
|
||||
apps_shutdown();
|
||||
@@ -377,13 +384,9 @@ end:
|
||||
|
||||
#define LIST_STANDARD_COMMANDS "list-standard-commands"
|
||||
#define LIST_MESSAGE_DIGEST_COMMANDS "list-message-digest-commands"
|
||||
#define LIST_MESSAGE_DIGEST_ALGORITHMS "list-message-digest-algorithms"
|
||||
#define LIST_CIPHER_COMMANDS "list-cipher-commands"
|
||||
#define LIST_CIPHER_ALGORITHMS "list-cipher-algorithms"
|
||||
#define LIST_PUBLIC_KEY_ALGORITHMS "list-public-key-algorithms"
|
||||
|
||||
|
||||
static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
|
||||
static int do_cmd(LHASH *prog, int argc, char *argv[])
|
||||
{
|
||||
FUNCTION f,*fp;
|
||||
int i,ret=1,tp,nl;
|
||||
@@ -391,22 +394,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
|
||||
if ((argc <= 0) || (argv[0] == NULL))
|
||||
{ ret=0; goto end; }
|
||||
f.name=argv[0];
|
||||
fp=lh_FUNCTION_retrieve(prog,&f);
|
||||
if (fp == NULL)
|
||||
{
|
||||
if (EVP_get_digestbyname(argv[0]))
|
||||
{
|
||||
f.type = FUNC_TYPE_MD;
|
||||
f.func = dgst_main;
|
||||
fp = &f;
|
||||
}
|
||||
else if (EVP_get_cipherbyname(argv[0]))
|
||||
{
|
||||
f.type = FUNC_TYPE_CIPHER;
|
||||
f.func = enc_main;
|
||||
fp = &f;
|
||||
}
|
||||
}
|
||||
fp=(FUNCTION *)lh_retrieve(prog,&f);
|
||||
if (fp != NULL)
|
||||
{
|
||||
ret=fp->func(argc,argv);
|
||||
@@ -421,7 +409,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
|
||||
}
|
||||
#endif
|
||||
f.name=argv[0]+3;
|
||||
ret = (lh_FUNCTION_retrieve(prog,&f) != NULL);
|
||||
ret = (lh_retrieve(prog,&f) != NULL);
|
||||
if (!ret)
|
||||
BIO_printf(bio_stdout, "%s\n", argv[0]);
|
||||
else
|
||||
@@ -439,10 +427,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
|
||||
}
|
||||
else if ((strcmp(argv[0],LIST_STANDARD_COMMANDS) == 0) ||
|
||||
(strcmp(argv[0],LIST_MESSAGE_DIGEST_COMMANDS) == 0) ||
|
||||
(strcmp(argv[0],LIST_MESSAGE_DIGEST_ALGORITHMS) == 0) ||
|
||||
(strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0) ||
|
||||
(strcmp(argv[0],LIST_CIPHER_ALGORITHMS) == 0) ||
|
||||
(strcmp(argv[0],LIST_PUBLIC_KEY_ALGORITHMS) == 0))
|
||||
(strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0))
|
||||
{
|
||||
int list_type;
|
||||
BIO *bio_stdout;
|
||||
@@ -451,12 +436,6 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
|
||||
list_type = FUNC_TYPE_GENERAL;
|
||||
else if (strcmp(argv[0],LIST_MESSAGE_DIGEST_COMMANDS) == 0)
|
||||
list_type = FUNC_TYPE_MD;
|
||||
else if (strcmp(argv[0],LIST_MESSAGE_DIGEST_ALGORITHMS) == 0)
|
||||
list_type = FUNC_TYPE_MD_ALG;
|
||||
else if (strcmp(argv[0],LIST_PUBLIC_KEY_ALGORITHMS) == 0)
|
||||
list_type = FUNC_TYPE_PKEY;
|
||||
else if (strcmp(argv[0],LIST_CIPHER_ALGORITHMS) == 0)
|
||||
list_type = FUNC_TYPE_CIPHER_ALG;
|
||||
else /* strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0 */
|
||||
list_type = FUNC_TYPE_CIPHER;
|
||||
bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||
@@ -466,23 +445,10 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
|
||||
bio_stdout = BIO_push(tmpbio, bio_stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
if (list_type == FUNC_TYPE_PKEY)
|
||||
list_pkey(bio_stdout);
|
||||
if (list_type == FUNC_TYPE_MD_ALG)
|
||||
list_md(bio_stdout);
|
||||
if (list_type == FUNC_TYPE_CIPHER_ALG)
|
||||
list_cipher(bio_stdout);
|
||||
else
|
||||
{
|
||||
for (fp=functions; fp->name != NULL; fp++)
|
||||
if (fp->type == list_type)
|
||||
BIO_printf(bio_stdout, "%s\n",
|
||||
fp->name);
|
||||
}
|
||||
|
||||
for (fp=functions; fp->name != NULL; fp++)
|
||||
if (fp->type == list_type)
|
||||
BIO_printf(bio_stdout, "%s\n", fp->name);
|
||||
BIO_free_all(bio_stdout);
|
||||
ret=0;
|
||||
goto end;
|
||||
@@ -545,94 +511,9 @@ static int SortFnByName(const void *_f1,const void *_f2)
|
||||
return strcmp(f1->name,f2->name);
|
||||
}
|
||||
|
||||
static void list_pkey(BIO *out)
|
||||
static LHASH *prog_init(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < EVP_PKEY_asn1_get_count(); i++)
|
||||
{
|
||||
const EVP_PKEY_ASN1_METHOD *ameth;
|
||||
int pkey_id, pkey_base_id, pkey_flags;
|
||||
const char *pinfo, *pem_str;
|
||||
ameth = EVP_PKEY_asn1_get0(i);
|
||||
EVP_PKEY_asn1_get0_info(&pkey_id, &pkey_base_id, &pkey_flags,
|
||||
&pinfo, &pem_str, ameth);
|
||||
if (pkey_flags & ASN1_PKEY_ALIAS)
|
||||
{
|
||||
BIO_printf(out, "Name: %s\n",
|
||||
OBJ_nid2ln(pkey_id));
|
||||
BIO_printf(out, "\tType: Alias to %s\n",
|
||||
OBJ_nid2ln(pkey_base_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(out, "Name: %s\n", pinfo);
|
||||
BIO_printf(out, "\tType: %s Algorithm\n",
|
||||
pkey_flags & ASN1_PKEY_DYNAMIC ?
|
||||
"External" : "Builtin");
|
||||
BIO_printf(out, "\tOID: %s\n", OBJ_nid2ln(pkey_id));
|
||||
if (pem_str == NULL)
|
||||
pem_str = "(none)";
|
||||
BIO_printf(out, "\tPEM string: %s\n", pem_str);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void list_cipher_fn(const EVP_CIPHER *c,
|
||||
const char *from, const char *to, void *arg)
|
||||
{
|
||||
if (c)
|
||||
BIO_printf(arg, "%s\n", EVP_CIPHER_name(c));
|
||||
else
|
||||
{
|
||||
if (!from)
|
||||
from = "<undefined>";
|
||||
if (!to)
|
||||
to = "<undefined>";
|
||||
BIO_printf(arg, "%s => %s\n", from, to);
|
||||
}
|
||||
}
|
||||
|
||||
static void list_cipher(BIO *out)
|
||||
{
|
||||
EVP_CIPHER_do_all_sorted(list_cipher_fn, out);
|
||||
}
|
||||
|
||||
static void list_md_fn(const EVP_MD *m,
|
||||
const char *from, const char *to, void *arg)
|
||||
{
|
||||
if (m)
|
||||
BIO_printf(arg, "%s\n", EVP_MD_name(m));
|
||||
else
|
||||
{
|
||||
if (!from)
|
||||
from = "<undefined>";
|
||||
if (!to)
|
||||
to = "<undefined>";
|
||||
BIO_printf(arg, "%s => %s\n", from, to);
|
||||
}
|
||||
}
|
||||
|
||||
static void list_md(BIO *out)
|
||||
{
|
||||
EVP_MD_do_all_sorted(list_md_fn, out);
|
||||
}
|
||||
|
||||
static int MS_CALLBACK function_cmp(const FUNCTION *a, const FUNCTION *b)
|
||||
{
|
||||
return strncmp(a->name,b->name,8);
|
||||
}
|
||||
static IMPLEMENT_LHASH_COMP_FN(function, FUNCTION)
|
||||
|
||||
static unsigned long MS_CALLBACK function_hash(const FUNCTION *a)
|
||||
{
|
||||
return lh_strhash(a->name);
|
||||
}
|
||||
static IMPLEMENT_LHASH_HASH_FN(function, FUNCTION)
|
||||
|
||||
static LHASH_OF(FUNCTION) *prog_init(void)
|
||||
{
|
||||
LHASH_OF(FUNCTION) *ret;
|
||||
LHASH *ret;
|
||||
FUNCTION *f;
|
||||
size_t i;
|
||||
|
||||
@@ -641,11 +522,23 @@ static LHASH_OF(FUNCTION) *prog_init(void)
|
||||
;
|
||||
qsort(functions,i,sizeof *functions,SortFnByName);
|
||||
|
||||
if ((ret=lh_FUNCTION_new()) == NULL)
|
||||
if ((ret=lh_new(hash, cmp)) == NULL)
|
||||
return(NULL);
|
||||
|
||||
for (f=functions; f->name != NULL; f++)
|
||||
(void)lh_FUNCTION_insert(ret,f);
|
||||
lh_insert(ret,f);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b) */
|
||||
static int MS_CALLBACK cmp(const void *a_void, const void *b_void)
|
||||
{
|
||||
return(strncmp(((const FUNCTION *)a_void)->name,
|
||||
((const FUNCTION *)b_void)->name,8));
|
||||
}
|
||||
|
||||
/* static unsigned long MS_CALLBACK hash(FUNCTION *a) */
|
||||
static unsigned long MS_CALLBACK hash(const void *a_void)
|
||||
{
|
||||
return(lh_strhash(((const FUNCTION *)a_void)->name));
|
||||
}
|
||||
|
||||
@@ -21,17 +21,12 @@ oid_section = new_oids
|
||||
|
||||
[ new_oids ]
|
||||
|
||||
# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
|
||||
# We can add new OIDs in here for use by 'ca' and 'req'.
|
||||
# Add a simple OID like this:
|
||||
# testoid1=1.2.3.4
|
||||
# Or use config file substitution like this:
|
||||
# testoid2=${testoid1}.5.6
|
||||
|
||||
# Policies used by the TSA examples.
|
||||
tsa_policy1 = 1.2.3.4.1
|
||||
tsa_policy2 = 1.2.3.4.5.6
|
||||
tsa_policy3 = 1.2.3.4.5.7
|
||||
|
||||
####################################################################
|
||||
[ ca ]
|
||||
default_ca = CA_default # The default ca section
|
||||
@@ -72,7 +67,7 @@ cert_opt = ca_default # Certificate field options
|
||||
|
||||
default_days = 365 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = default # use public key default MD
|
||||
default_md = sha1 # which md to use.
|
||||
preserve = no # keep passed DN ordering
|
||||
|
||||
# A few difference way of specifying how similar the request should look
|
||||
@@ -115,12 +110,13 @@ x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString (PKIX recommendation before 2004)
|
||||
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
|
||||
# pkix : PrintableString, BMPString.
|
||||
# utf8only: only UTF8Strings.
|
||||
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
|
||||
# MASK:XXXX a literal mask value.
|
||||
# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
|
||||
string_mask = utf8only
|
||||
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
|
||||
# so use this option with caution!
|
||||
string_mask = nombstr
|
||||
|
||||
# req_extensions = v3_req # The extensions to add to a certificate request
|
||||
|
||||
@@ -145,7 +141,7 @@ localityName = Locality Name (eg, city)
|
||||
organizationalUnitName = Organizational Unit Name (eg, section)
|
||||
#organizationalUnitName_default =
|
||||
|
||||
commonName = Common Name (eg, YOUR name)
|
||||
commonName = Common Name (e.g. server FQDN or YOUR name)
|
||||
commonName_max = 64
|
||||
|
||||
emailAddress = Email Address
|
||||
@@ -211,9 +207,6 @@ authorityKeyIdentifier=keyid,issuer
|
||||
#nsCaPolicyUrl
|
||||
#nsSslServerName
|
||||
|
||||
# This is required for TSA certificates.
|
||||
# extendedKeyUsage = critical,timeStamping
|
||||
|
||||
[ v3_req ]
|
||||
|
||||
# Extensions to add to a certificate request
|
||||
@@ -231,7 +224,7 @@ keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
|
||||
subjectKeyIdentifier=hash
|
||||
|
||||
authorityKeyIdentifier=keyid:always,issuer
|
||||
authorityKeyIdentifier=keyid:always,issuer:always
|
||||
|
||||
# This is what PKIX recommends but some broken software chokes on critical
|
||||
# extensions.
|
||||
@@ -264,7 +257,7 @@ basicConstraints = CA:true
|
||||
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
|
||||
|
||||
# issuerAltName=issuer:copy
|
||||
authorityKeyIdentifier=keyid:always
|
||||
authorityKeyIdentifier=keyid:always,issuer:always
|
||||
|
||||
[ proxy_cert_ext ]
|
||||
# These extensions should be added when creating a proxy certificate
|
||||
@@ -297,7 +290,7 @@ nsComment = "OpenSSL Generated Certificate"
|
||||
|
||||
# PKIX recommendations harmless if included in all certificates.
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid,issuer
|
||||
authorityKeyIdentifier=keyid,issuer:always
|
||||
|
||||
# This stuff is for subjectAltName and issuerAltname.
|
||||
# Import the email address.
|
||||
@@ -318,33 +311,3 @@ authorityKeyIdentifier=keyid,issuer
|
||||
|
||||
# This really needs to be in place for it to be a proxy certificate.
|
||||
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
|
||||
|
||||
####################################################################
|
||||
[ tsa ]
|
||||
|
||||
default_tsa = tsa_config1 # the default TSA section
|
||||
|
||||
[ tsa_config1 ]
|
||||
|
||||
# These are used by the TSA reply generation only.
|
||||
dir = ./demoCA # TSA root directory
|
||||
serial = $dir/tsaserial # The current serial number (mandatory)
|
||||
crypto_device = builtin # OpenSSL engine to use for signing
|
||||
signer_cert = $dir/tsacert.pem # The TSA signing certificate
|
||||
# (optional)
|
||||
certs = $dir/cacert.pem # Certificate chain to include in reply
|
||||
# (optional)
|
||||
signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
|
||||
|
||||
default_policy = tsa_policy1 # Policy if request did not specify it
|
||||
# (optional)
|
||||
other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)
|
||||
digests = md5, sha1 # Acceptable message digests (mandatory)
|
||||
accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
|
||||
clock_precision_digits = 0 # number of digits after dot. (optional)
|
||||
ordering = yes # Is ordering defined for timestamps?
|
||||
# (optional, default: no)
|
||||
tsa_name = yes # Must the TSA name be included in the reply?
|
||||
# (optional, default: no)
|
||||
ess_cert_id_chain = no # Must the ESS cert id chain be included?
|
||||
# (optional, default: no)
|
||||
|
||||
104
apps/pkcs12.c
104
apps/pkcs12.c
@@ -68,6 +68,12 @@
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
#ifdef OPENSSL_SYS_NETWARE
|
||||
/* Rename these functions to avoid name clashes on NetWare OS */
|
||||
#define uni2asc OPENSSL_uni2asc
|
||||
#define asc2uni OPENSSL_asc2uni
|
||||
#endif
|
||||
|
||||
#define PROG pkcs12_main
|
||||
|
||||
const EVP_CIPHER *enc;
|
||||
@@ -88,7 +94,6 @@ int print_attribs(BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst,const char *name);
|
||||
void hex_prin(BIO *out, unsigned char *buf, int len);
|
||||
int alg_print(BIO *x, X509_ALGOR *alg);
|
||||
int cert_load(BIO *in, STACK_OF(X509) *sk);
|
||||
static int set_pbe(BIO *err, int *ppbe, const char *str);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -112,17 +117,16 @@ 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;
|
||||
int noprompt = 0;
|
||||
STACK_OF(STRING) *canames = NULL;
|
||||
STACK *canames = NULL;
|
||||
char *cpass = NULL, *mpass = NULL;
|
||||
char *passargin = NULL, *passargout = NULL, *passarg = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
char *inrand = NULL;
|
||||
char *macalg = NULL;
|
||||
char *CApath = NULL, *CAfile = NULL;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine=NULL;
|
||||
@@ -130,6 +134,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);
|
||||
|
||||
@@ -180,18 +191,33 @@ int MAIN(int argc, char **argv)
|
||||
maciter = 1;
|
||||
else if (!strcmp (*args, "-nomac"))
|
||||
maciter = -1;
|
||||
else if (!strcmp (*args, "-macalg"))
|
||||
if (args[1]) {
|
||||
args++;
|
||||
macalg = *args;
|
||||
} else badarg = 1;
|
||||
else if (!strcmp (*args, "-nodes")) enc=NULL;
|
||||
else if (!strcmp (*args, "-certpbe")) {
|
||||
if (!set_pbe(bio_err, &cert_pbe, *++args))
|
||||
badarg = 1;
|
||||
if (args[1]) {
|
||||
args++;
|
||||
if (!strcmp(*args, "NONE"))
|
||||
cert_pbe = -1;
|
||||
else
|
||||
cert_pbe=OBJ_txt2nid(*args);
|
||||
if(cert_pbe == NID_undef) {
|
||||
BIO_printf(bio_err,
|
||||
"Unknown PBE algorithm %s\n", *args);
|
||||
badarg = 1;
|
||||
}
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-keypbe")) {
|
||||
if (!set_pbe(bio_err, &key_pbe, *++args))
|
||||
badarg = 1;
|
||||
if (args[1]) {
|
||||
args++;
|
||||
if (!strcmp(*args, "NONE"))
|
||||
key_pbe = -1;
|
||||
else
|
||||
key_pbe=OBJ_txt2nid(*args);
|
||||
if(key_pbe == NID_undef) {
|
||||
BIO_printf(bio_err,
|
||||
"Unknown PBE algorithm %s\n", *args);
|
||||
badarg = 1;
|
||||
}
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-rand")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -222,8 +248,8 @@ int MAIN(int argc, char **argv)
|
||||
} else if (!strcmp (*args, "-caname")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
if (!canames) canames = sk_STRING_new_null();
|
||||
sk_STRING_push(canames, *args);
|
||||
if (!canames) canames = sk_new_null();
|
||||
sk_push(canames, *args);
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-in")) {
|
||||
if (args[1]) {
|
||||
@@ -312,14 +338,11 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
BIO_printf (bio_err, "-nodes don't encrypt private keys\n");
|
||||
BIO_printf (bio_err, "-noiter don't use encryption iteration\n");
|
||||
BIO_printf (bio_err, "-nomaciter don't use MAC iteration\n");
|
||||
BIO_printf (bio_err, "-maciter use MAC iteration\n");
|
||||
BIO_printf (bio_err, "-nomac don't generate MAC\n");
|
||||
BIO_printf (bio_err, "-twopass separate MAC, encryption passwords\n");
|
||||
BIO_printf (bio_err, "-descert encrypt PKCS#12 certificates with triple DES (default RC2-40)\n");
|
||||
BIO_printf (bio_err, "-certpbe alg specify certificate PBE algorithm (default RC2-40)\n");
|
||||
BIO_printf (bio_err, "-keypbe alg specify private key PBE algorithm (default 3DES)\n");
|
||||
BIO_printf (bio_err, "-macalg alg digest algorithm used in MAC (default SHA1)\n");
|
||||
BIO_printf (bio_err, "-keyex set MS key exchange type\n");
|
||||
BIO_printf (bio_err, "-keysig set MS key signature type\n");
|
||||
BIO_printf (bio_err, "-password p set import/export password source\n");
|
||||
@@ -331,8 +354,8 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err, " the random number generator\n");
|
||||
BIO_printf(bio_err, "-CSP name Microsoft CSP name\n");
|
||||
BIO_printf(bio_err, "-LMK Add local machine keyset attribute to private key\n");
|
||||
BIO_printf(bio_err, "-CSP name Microsoft CSP name\n");
|
||||
BIO_printf(bio_err, "-LMK Add local machine keyset attribute to private key\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -422,7 +445,6 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY *key = NULL;
|
||||
X509 *ucert = NULL, *x = NULL;
|
||||
STACK_OF(X509) *certs=NULL;
|
||||
const EVP_MD *macmd = NULL;
|
||||
unsigned char *catmp = NULL;
|
||||
int i;
|
||||
|
||||
@@ -549,9 +571,9 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
/* Add any CA names */
|
||||
|
||||
for (i = 0; i < sk_STRING_num(canames); i++)
|
||||
for (i = 0; i < sk_num(canames); i++)
|
||||
{
|
||||
catmp = (unsigned char *)sk_STRING_value(canames, i);
|
||||
catmp = (unsigned char *)sk_value(canames, i);
|
||||
X509_alias_set1(sk_X509_value(certs, i), catmp, -1);
|
||||
}
|
||||
|
||||
@@ -589,18 +611,8 @@ int MAIN(int argc, char **argv)
|
||||
goto export_end;
|
||||
}
|
||||
|
||||
if (macalg)
|
||||
{
|
||||
macmd = EVP_get_digestbyname(macalg);
|
||||
if (!macmd)
|
||||
{
|
||||
BIO_printf(bio_err, "Unknown digest algorithm %s\n",
|
||||
macalg);
|
||||
}
|
||||
}
|
||||
|
||||
if (maciter != -1)
|
||||
PKCS12_set_mac(p12, mpass, -1, NULL, 0, maciter, macmd);
|
||||
PKCS12_set_mac(p12, mpass, -1, NULL, 0, maciter, NULL);
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
@@ -647,7 +659,7 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass);
|
||||
|
||||
if (options & INFO) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1);
|
||||
if ((options & INFO) && p12->mac) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1);
|
||||
if(macver) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("verify MAC");
|
||||
@@ -687,7 +699,7 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
BIO_free(in);
|
||||
BIO_free_all(out);
|
||||
if (canames) sk_STRING_free(canames);
|
||||
if (canames) sk_free(canames);
|
||||
if(passin) OPENSSL_free(passin);
|
||||
if(passout) OPENSSL_free(passout);
|
||||
apps_shutdown();
|
||||
@@ -923,7 +935,7 @@ int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst,const char *name)
|
||||
av = sk_ASN1_TYPE_value(attr->value.set, 0);
|
||||
switch(av->type) {
|
||||
case V_ASN1_BMPSTRING:
|
||||
value = OPENSSL_uni2asc(av->value.bmpstring->data,
|
||||
value = uni2asc(av->value.bmpstring->data,
|
||||
av->value.bmpstring->length);
|
||||
BIO_printf(out, "%s\n", value);
|
||||
OPENSSL_free(value);
|
||||
@@ -956,22 +968,4 @@ void hex_prin(BIO *out, unsigned char *buf, int len)
|
||||
for (i = 0; i < len; i++) BIO_printf (out, "%02X ", buf[i]);
|
||||
}
|
||||
|
||||
static int set_pbe(BIO *err, int *ppbe, const char *str)
|
||||
{
|
||||
if (!str)
|
||||
return 0;
|
||||
if (!strcmp(str, "NONE"))
|
||||
{
|
||||
*ppbe = -1;
|
||||
return 1;
|
||||
}
|
||||
*ppbe=OBJ_txt2nid(str);
|
||||
if (*ppbe == NID_undef)
|
||||
{
|
||||
BIO_printf(bio_err, "Unknown PBE algorithm %s\n", str);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
12
apps/pkcs7.c
12
apps/pkcs7.c
@@ -82,15 +82,12 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
PKCS7 *p7=NULL;
|
||||
int i,badops=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat;
|
||||
char *infile,*outfile,*prog;
|
||||
int print_certs=0,text=0,noout=0,p7_print=0;
|
||||
int print_certs=0,text=0,noout=0;
|
||||
int ret=1;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine=NULL;
|
||||
@@ -139,8 +136,6 @@ int MAIN(int argc, char **argv)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
text=1;
|
||||
else if (strcmp(*argv,"-print") == 0)
|
||||
p7_print=1;
|
||||
else if (strcmp(*argv,"-print_certs") == 0)
|
||||
print_certs=1;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
@@ -182,7 +177,7 @@ bad:
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
@@ -240,9 +235,6 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if (p7_print)
|
||||
PKCS7_print_ctx(out, p7, 0, NULL);
|
||||
|
||||
if (print_certs)
|
||||
{
|
||||
STACK_OF(X509) *certs=NULL;
|
||||
|
||||
74
apps/pkcs8.c
74
apps/pkcs8.c
@@ -80,12 +80,11 @@ int MAIN(int argc, char **argv)
|
||||
int informat, outformat;
|
||||
int p8_broken = PKCS8_OK;
|
||||
int nocrypt = 0;
|
||||
X509_SIG *p8 = NULL;
|
||||
PKCS8_PRIV_KEY_INFO *p8inf = NULL;
|
||||
X509_SIG *p8;
|
||||
PKCS8_PRIV_KEY_INFO *p8inf;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
||||
int badarg = 0;
|
||||
int ret = 1;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine=NULL;
|
||||
#endif
|
||||
@@ -226,7 +225,7 @@ int MAIN(int argc, char **argv)
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
#endif
|
||||
goto end;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
@@ -236,7 +235,7 @@ int MAIN(int argc, char **argv)
|
||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout))
|
||||
{
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((pbe_nid == -1) && !cipher)
|
||||
@@ -248,7 +247,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't open input file %s\n", infile);
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -260,7 +259,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't open output file %s\n", outfile);
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -279,12 +278,17 @@ int MAIN(int argc, char **argv)
|
||||
pkey = load_key(bio_err, infile, informat, 1,
|
||||
passin, e, "key");
|
||||
if (!pkey)
|
||||
goto end;
|
||||
{
|
||||
BIO_free_all(out);
|
||||
return 1;
|
||||
}
|
||||
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken)))
|
||||
{
|
||||
BIO_printf(bio_err, "Error converting key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
return 1;
|
||||
}
|
||||
if (nocrypt)
|
||||
{
|
||||
@@ -295,7 +299,10 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
goto end;
|
||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -306,7 +313,12 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
p8pass = pass;
|
||||
if (EVP_read_pw_string(pass, sizeof pass, "Enter Encryption Password:", 1))
|
||||
goto end;
|
||||
{
|
||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
||||
@@ -315,7 +327,10 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
BIO_printf(bio_err, "Error encrypting key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
return (1);
|
||||
}
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
if (outformat == FORMAT_PEM)
|
||||
@@ -325,12 +340,22 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
goto end;
|
||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
return (1);
|
||||
}
|
||||
X509_SIG_free(p8);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
goto end;
|
||||
PKCS8_PRIV_KEY_INFO_free (p8inf);
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
if (passin)
|
||||
OPENSSL_free(passin);
|
||||
if (passout)
|
||||
OPENSSL_free(passout);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (nocrypt)
|
||||
@@ -342,7 +367,7 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -354,14 +379,14 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (!p8)
|
||||
{
|
||||
BIO_printf (bio_err, "Error reading key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
if (passin)
|
||||
p8pass = passin;
|
||||
@@ -371,20 +396,21 @@ int MAIN(int argc, char **argv)
|
||||
EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0);
|
||||
}
|
||||
p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
|
||||
X509_SIG_free(p8);
|
||||
}
|
||||
|
||||
if (!p8inf)
|
||||
{
|
||||
BIO_printf(bio_err, "Error decrypting key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (!(pkey = EVP_PKCS82PKEY(p8inf)))
|
||||
{
|
||||
BIO_printf(bio_err, "Error converting key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (p8inf->broken)
|
||||
@@ -410,6 +436,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
if (outformat == FORMAT_PEM)
|
||||
PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, passout);
|
||||
else if (outformat == FORMAT_ASN1)
|
||||
@@ -417,13 +444,10 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
goto end;
|
||||
return (1);
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
X509_SIG_free(p8);
|
||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
BIO_free(in);
|
||||
@@ -432,5 +456,5 @@ int MAIN(int argc, char **argv)
|
||||
if (passout)
|
||||
OPENSSL_free(passout);
|
||||
|
||||
return ret;
|
||||
return (0);
|
||||
}
|
||||
|
||||
284
apps/pkey.c
284
apps/pkey.c
@@ -1,284 +0,0 @@
|
||||
/* apps/pkey.c */
|
||||
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||
* project 2006
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#define PROG pkey_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
char **args, *infile = NULL, *outfile = NULL;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
const EVP_CIPHER *cipher = NULL;
|
||||
int informat, outformat;
|
||||
int pubin = 0, pubout = 0, pubtext = 0, text = 0, noout = 0;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
int badarg = 0;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine=NULL;
|
||||
#endif
|
||||
int ret = 1;
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
informat=FORMAT_PEM;
|
||||
outformat=FORMAT_PEM;
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
OpenSSL_add_all_algorithms();
|
||||
args = argv + 1;
|
||||
while (!badarg && *args && *args[0] == '-')
|
||||
{
|
||||
if (!strcmp(*args,"-inform"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
informat=str2fmt(*args);
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args,"-outform"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
outformat=str2fmt(*args);
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args,"-passin"))
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
passargin= *(++args);
|
||||
}
|
||||
else if (!strcmp(*args,"-passout"))
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
passargout= *(++args);
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if (strcmp(*args,"-engine") == 0)
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
engine= *(++args);
|
||||
}
|
||||
#endif
|
||||
else if (!strcmp (*args, "-in"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
infile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-out"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
outfile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (strcmp(*args,"-pubin") == 0)
|
||||
{
|
||||
pubin=1;
|
||||
pubout=1;
|
||||
pubtext=1;
|
||||
}
|
||||
else if (strcmp(*args,"-pubout") == 0)
|
||||
pubout=1;
|
||||
else if (strcmp(*args,"-text_pub") == 0)
|
||||
{
|
||||
pubtext=1;
|
||||
text=1;
|
||||
}
|
||||
else if (strcmp(*args,"-text") == 0)
|
||||
text=1;
|
||||
else if (strcmp(*args,"-noout") == 0)
|
||||
noout=1;
|
||||
else
|
||||
{
|
||||
cipher = EVP_get_cipherbyname(*args + 1);
|
||||
if (!cipher)
|
||||
{
|
||||
BIO_printf(bio_err, "Unknown cipher %s\n",
|
||||
*args + 1);
|
||||
badarg = 1;
|
||||
}
|
||||
}
|
||||
args++;
|
||||
}
|
||||
|
||||
if (badarg)
|
||||
{
|
||||
bad:
|
||||
BIO_printf(bio_err, "Usage pkey [options]\n");
|
||||
BIO_printf(bio_err, "where options are\n");
|
||||
BIO_printf(bio_err, "-in file input file\n");
|
||||
BIO_printf(bio_err, "-inform X input format (DER or PEM)\n");
|
||||
BIO_printf(bio_err, "-passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
||||
BIO_printf(bio_err, "-out file output file\n");
|
||||
BIO_printf(bio_err, "-passout arg output file pass phrase source\n");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout))
|
||||
{
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (outfile)
|
||||
{
|
||||
if (!(out = BIO_new_file (outfile, "wb")))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't open output file %s\n", outfile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
{
|
||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||
out = BIO_push(tmpbio, out);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (pubin)
|
||||
pkey = load_pubkey(bio_err, infile, informat, 1,
|
||||
passin, e, "Public Key");
|
||||
else
|
||||
pkey = load_key(bio_err, infile, informat, 1,
|
||||
passin, e, "key");
|
||||
if (!pkey)
|
||||
goto end;
|
||||
|
||||
if (!noout)
|
||||
{
|
||||
if (outformat == FORMAT_PEM)
|
||||
{
|
||||
if (pubout)
|
||||
PEM_write_bio_PUBKEY(out,pkey);
|
||||
else
|
||||
PEM_write_bio_PrivateKey(out, pkey, cipher,
|
||||
NULL, 0, NULL, passout);
|
||||
}
|
||||
else if (outformat == FORMAT_ASN1)
|
||||
{
|
||||
if (pubout)
|
||||
i2d_PUBKEY_bio(out, pkey);
|
||||
else
|
||||
i2d_PrivateKey_bio(out, pkey);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (text)
|
||||
{
|
||||
if (pubtext)
|
||||
EVP_PKEY_print_public(out, pkey, 0, NULL);
|
||||
else
|
||||
EVP_PKEY_print_private(out, pkey, 0, NULL);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
BIO_free(in);
|
||||
if (passin)
|
||||
OPENSSL_free(passin);
|
||||
if (passout)
|
||||
OPENSSL_free(passout);
|
||||
|
||||
return ret;
|
||||
}
|
||||
201
apps/pkeyparam.c
201
apps/pkeyparam.c
@@ -1,201 +0,0 @@
|
||||
/* apps/pkeyparam.c */
|
||||
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||
* project 2006
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#define PROG pkeyparam_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char **args, *infile = NULL, *outfile = NULL;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
int text = 0, noout = 0;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
int badarg = 0;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
char *engine=NULL;
|
||||
#endif
|
||||
int ret = 1;
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
OpenSSL_add_all_algorithms();
|
||||
args = argv + 1;
|
||||
while (!badarg && *args && *args[0] == '-')
|
||||
{
|
||||
if (!strcmp (*args, "-in"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
infile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-out"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
outfile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if (strcmp(*args,"-engine") == 0)
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
engine= *(++args);
|
||||
}
|
||||
#endif
|
||||
|
||||
else if (strcmp(*args,"-text") == 0)
|
||||
text=1;
|
||||
else if (strcmp(*args,"-noout") == 0)
|
||||
noout=1;
|
||||
args++;
|
||||
}
|
||||
|
||||
if (badarg)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
bad:
|
||||
#endif
|
||||
BIO_printf(bio_err, "Usage pkeyparam [options]\n");
|
||||
BIO_printf(bio_err, "where options are\n");
|
||||
BIO_printf(bio_err, "-in file input file\n");
|
||||
BIO_printf(bio_err, "-out file output file\n");
|
||||
BIO_printf(bio_err, "-text print parameters as text\n");
|
||||
BIO_printf(bio_err, "-noout don't output encoded parameters\n");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (infile)
|
||||
{
|
||||
if (!(in = BIO_new_file (infile, "r")))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't open input file %s\n", infile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
in = BIO_new_fp (stdin, BIO_NOCLOSE);
|
||||
|
||||
if (outfile)
|
||||
{
|
||||
if (!(out = BIO_new_file (outfile, "w")))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't open output file %s\n", outfile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
{
|
||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||
out = BIO_push(tmpbio, out);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
pkey = PEM_read_bio_Parameters(in, NULL);
|
||||
if (!pkey)
|
||||
{
|
||||
BIO_printf(bio_err, "Error reading parameters\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!noout)
|
||||
PEM_write_bio_Parameters(out,pkey);
|
||||
|
||||
if (text)
|
||||
EVP_PKEY_print_params(out, pkey, 0, NULL);
|
||||
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
BIO_free(in);
|
||||
|
||||
return ret;
|
||||
}
|
||||
570
apps/pkeyutl.c
570
apps/pkeyutl.c
@@ -1,570 +0,0 @@
|
||||
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
||||
* project 2006.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "apps.h"
|
||||
#include <string.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#define KEY_PRIVKEY 1
|
||||
#define KEY_PUBKEY 2
|
||||
#define KEY_CERT 3
|
||||
|
||||
static void usage(void);
|
||||
|
||||
#undef PROG
|
||||
|
||||
#define PROG pkeyutl_main
|
||||
|
||||
static EVP_PKEY_CTX *init_ctx(int *pkeysize,
|
||||
char *keyfile, int keyform, int key_type,
|
||||
char *passargin, int pkey_op, ENGINE *e);
|
||||
|
||||
static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
|
||||
const char *file);
|
||||
|
||||
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
|
||||
unsigned char *out, size_t *poutlen,
|
||||
unsigned char *in, size_t inlen);
|
||||
|
||||
int MAIN(int argc, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
BIO *in = NULL, *out = NULL;
|
||||
char *infile = NULL, *outfile = NULL, *sigfile = NULL;
|
||||
ENGINE *e = NULL;
|
||||
int pkey_op = EVP_PKEY_OP_SIGN, key_type = KEY_PRIVKEY;
|
||||
int keyform = FORMAT_PEM, peerform = FORMAT_PEM;
|
||||
char badarg = 0, rev = 0;
|
||||
char hexdump = 0, asn1parse = 0;
|
||||
EVP_PKEY_CTX *ctx = NULL;
|
||||
char *passargin = NULL;
|
||||
int keysize = -1;
|
||||
|
||||
unsigned char *buf_in = NULL, *buf_out = NULL, *sig = NULL;
|
||||
size_t buf_outlen;
|
||||
int buf_inlen = 0, siglen = -1;
|
||||
|
||||
int ret = 1, rv = -1;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
if(!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
ERR_load_crypto_strings();
|
||||
OpenSSL_add_all_algorithms();
|
||||
|
||||
while(argc >= 1)
|
||||
{
|
||||
if (!strcmp(*argv,"-in"))
|
||||
{
|
||||
if (--argc < 1) badarg = 1;
|
||||
infile= *(++argv);
|
||||
}
|
||||
else if (!strcmp(*argv,"-out"))
|
||||
{
|
||||
if (--argc < 1) badarg = 1;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (!strcmp(*argv,"-sigfile"))
|
||||
{
|
||||
if (--argc < 1) badarg = 1;
|
||||
sigfile= *(++argv);
|
||||
}
|
||||
else if(!strcmp(*argv, "-inkey"))
|
||||
{
|
||||
if (--argc < 1)
|
||||
badarg = 1;
|
||||
else
|
||||
{
|
||||
ctx = init_ctx(&keysize,
|
||||
*(++argv), keyform, key_type,
|
||||
passargin, pkey_op, e);
|
||||
if (!ctx)
|
||||
{
|
||||
BIO_puts(bio_err,
|
||||
"Error initializing context\n");
|
||||
ERR_print_errors(bio_err);
|
||||
badarg = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!strcmp(*argv,"-peerkey"))
|
||||
{
|
||||
if (--argc < 1)
|
||||
badarg = 1;
|
||||
else if (!setup_peer(bio_err, ctx, peerform, *(++argv)))
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*argv,"-passin"))
|
||||
{
|
||||
if (--argc < 1) badarg = 1;
|
||||
passargin= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-peerform") == 0)
|
||||
{
|
||||
if (--argc < 1) badarg = 1;
|
||||
peerform=str2fmt(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-keyform") == 0)
|
||||
{
|
||||
if (--argc < 1) badarg = 1;
|
||||
keyform=str2fmt(*(++argv));
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if(!strcmp(*argv, "-engine"))
|
||||
{
|
||||
if (--argc < 1)
|
||||
badarg = 1;
|
||||
else
|
||||
e = setup_engine(bio_err, *(++argv), 0);
|
||||
}
|
||||
#endif
|
||||
else if(!strcmp(*argv, "-pubin"))
|
||||
key_type = KEY_PUBKEY;
|
||||
else if(!strcmp(*argv, "-certin"))
|
||||
key_type = KEY_CERT;
|
||||
else if(!strcmp(*argv, "-asn1parse"))
|
||||
asn1parse = 1;
|
||||
else if(!strcmp(*argv, "-hexdump"))
|
||||
hexdump = 1;
|
||||
else if(!strcmp(*argv, "-sign"))
|
||||
pkey_op = EVP_PKEY_OP_SIGN;
|
||||
else if(!strcmp(*argv, "-verify"))
|
||||
pkey_op = EVP_PKEY_OP_VERIFY;
|
||||
else if(!strcmp(*argv, "-verifyrecover"))
|
||||
pkey_op = EVP_PKEY_OP_VERIFYRECOVER;
|
||||
else if(!strcmp(*argv, "-rev"))
|
||||
rev = 1;
|
||||
else if(!strcmp(*argv, "-encrypt"))
|
||||
pkey_op = EVP_PKEY_OP_ENCRYPT;
|
||||
else if(!strcmp(*argv, "-decrypt"))
|
||||
pkey_op = EVP_PKEY_OP_DECRYPT;
|
||||
else if(!strcmp(*argv, "-derive"))
|
||||
pkey_op = EVP_PKEY_OP_DERIVE;
|
||||
else if (strcmp(*argv,"-pkeyopt") == 0)
|
||||
{
|
||||
if (--argc < 1)
|
||||
badarg = 1;
|
||||
else if (!ctx)
|
||||
{
|
||||
BIO_puts(bio_err,
|
||||
"-pkeyopt command before -inkey\n");
|
||||
badarg = 1;
|
||||
}
|
||||
else if (pkey_ctrl_string(ctx, *(++argv)) <= 0)
|
||||
{
|
||||
BIO_puts(bio_err, "parameter setting error\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else badarg = 1;
|
||||
if(badarg)
|
||||
{
|
||||
usage();
|
||||
goto end;
|
||||
}
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (!ctx)
|
||||
{
|
||||
usage();
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (sigfile && (pkey_op != EVP_PKEY_OP_VERIFY))
|
||||
{
|
||||
BIO_puts(bio_err, "Signature file specified for non verify\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!sigfile && (pkey_op == EVP_PKEY_OP_VERIFY))
|
||||
{
|
||||
BIO_puts(bio_err, "No signature file specified for verify\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* FIXME: seed PRNG only if needed */
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
|
||||
if (pkey_op != EVP_PKEY_OP_DERIVE)
|
||||
{
|
||||
if(infile)
|
||||
{
|
||||
if(!(in = BIO_new_file(infile, "rb")))
|
||||
{
|
||||
BIO_puts(bio_err,
|
||||
"Error Opening Input File\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
}
|
||||
|
||||
if(outfile)
|
||||
{
|
||||
if(!(out = BIO_new_file(outfile, "wb")))
|
||||
{
|
||||
BIO_printf(bio_err, "Error Creating Output File\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
{
|
||||
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||
out = BIO_push(tmpbio, out);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (sigfile)
|
||||
{
|
||||
BIO *sigbio = BIO_new_file(sigfile, "rb");
|
||||
if (!sigbio)
|
||||
{
|
||||
BIO_printf(bio_err, "Can't open signature file %s\n",
|
||||
sigfile);
|
||||
goto end;
|
||||
}
|
||||
siglen = bio_to_mem(&sig, keysize * 10, sigbio);
|
||||
BIO_free(sigbio);
|
||||
if (siglen <= 0)
|
||||
{
|
||||
BIO_printf(bio_err, "Error reading signature data\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (in)
|
||||
{
|
||||
/* Read the input data */
|
||||
buf_inlen = bio_to_mem(&buf_in, keysize * 10, in);
|
||||
if(buf_inlen <= 0)
|
||||
{
|
||||
BIO_printf(bio_err, "Error reading input Data\n");
|
||||
exit(1);
|
||||
}
|
||||
if(rev)
|
||||
{
|
||||
size_t i;
|
||||
unsigned char ctmp;
|
||||
size_t l = (size_t)buf_inlen;
|
||||
for(i = 0; i < l/2; i++)
|
||||
{
|
||||
ctmp = buf_in[i];
|
||||
buf_in[i] = buf_in[l - 1 - i];
|
||||
buf_in[l - 1 - i] = ctmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(pkey_op == EVP_PKEY_OP_VERIFY)
|
||||
{
|
||||
rv = EVP_PKEY_verify(ctx, sig, (size_t)siglen,
|
||||
buf_in, (size_t)buf_inlen);
|
||||
if (rv == 0)
|
||||
BIO_puts(out, "Signature Verification Failure\n");
|
||||
else if (rv == 1)
|
||||
BIO_puts(out, "Signature Verified Successfully\n");
|
||||
if (rv >= 0)
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen,
|
||||
buf_in, (size_t)buf_inlen);
|
||||
if (rv > 0)
|
||||
{
|
||||
buf_out = OPENSSL_malloc(buf_outlen);
|
||||
if (!buf_out)
|
||||
rv = -1;
|
||||
else
|
||||
rv = do_keyop(ctx, pkey_op,
|
||||
buf_out, (size_t *)&buf_outlen,
|
||||
buf_in, (size_t)buf_inlen);
|
||||
}
|
||||
}
|
||||
|
||||
if(rv <= 0)
|
||||
{
|
||||
BIO_printf(bio_err, "Public Key operation error\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
ret = 0;
|
||||
if(asn1parse)
|
||||
{
|
||||
if(!ASN1_parse_dump(out, buf_out, buf_outlen, 1, -1))
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
else if(hexdump)
|
||||
BIO_dump(out, (char *)buf_out, buf_outlen);
|
||||
else
|
||||
BIO_write(out, buf_out, buf_outlen);
|
||||
|
||||
end:
|
||||
if (ctx)
|
||||
EVP_PKEY_CTX_free(ctx);
|
||||
BIO_free(in);
|
||||
BIO_free_all(out);
|
||||
if (buf_in)
|
||||
OPENSSL_free(buf_in);
|
||||
if (buf_out)
|
||||
OPENSSL_free(buf_out);
|
||||
if (sig)
|
||||
OPENSSL_free(sig);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void usage()
|
||||
{
|
||||
BIO_printf(bio_err, "Usage: pkeyutl [options]\n");
|
||||
BIO_printf(bio_err, "-in file input file\n");
|
||||
BIO_printf(bio_err, "-out file output file\n");
|
||||
BIO_printf(bio_err, "-sigfile file signature file (verify operation only)\n");
|
||||
BIO_printf(bio_err, "-inkey file input key\n");
|
||||
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
|
||||
BIO_printf(bio_err, "-pubin input is a public key\n");
|
||||
BIO_printf(bio_err, "-certin input is a certificate carrying a public key\n");
|
||||
BIO_printf(bio_err, "-pkeyopt X:Y public key options\n");
|
||||
BIO_printf(bio_err, "-sign sign with private key\n");
|
||||
BIO_printf(bio_err, "-verify verify with public key\n");
|
||||
BIO_printf(bio_err, "-verifyrecover verify with public key, recover original data\n");
|
||||
BIO_printf(bio_err, "-encrypt encrypt with public key\n");
|
||||
BIO_printf(bio_err, "-decrypt decrypt with private key\n");
|
||||
BIO_printf(bio_err, "-derive derive shared secret\n");
|
||||
BIO_printf(bio_err, "-hexdump hex dump output\n");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||
#endif
|
||||
BIO_printf(bio_err, "-passin arg pass phrase source\n");
|
||||
|
||||
}
|
||||
|
||||
static EVP_PKEY_CTX *init_ctx(int *pkeysize,
|
||||
char *keyfile, int keyform, int key_type,
|
||||
char *passargin, int pkey_op, ENGINE *e)
|
||||
{
|
||||
EVP_PKEY *pkey = NULL;
|
||||
EVP_PKEY_CTX *ctx = NULL;
|
||||
char *passin = NULL;
|
||||
int rv = -1;
|
||||
X509 *x;
|
||||
if(((pkey_op == EVP_PKEY_OP_SIGN) || (pkey_op == EVP_PKEY_OP_DECRYPT)
|
||||
|| (pkey_op == EVP_PKEY_OP_DERIVE))
|
||||
&& (key_type != KEY_PRIVKEY))
|
||||
{
|
||||
BIO_printf(bio_err, "A private key is needed for this operation\n");
|
||||
goto end;
|
||||
}
|
||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL))
|
||||
{
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
switch(key_type)
|
||||
{
|
||||
case KEY_PRIVKEY:
|
||||
pkey = load_key(bio_err, keyfile, keyform, 0,
|
||||
passin, e, "Private Key");
|
||||
break;
|
||||
|
||||
case KEY_PUBKEY:
|
||||
pkey = load_pubkey(bio_err, keyfile, keyform, 0,
|
||||
NULL, e, "Public Key");
|
||||
break;
|
||||
|
||||
case KEY_CERT:
|
||||
x = load_cert(bio_err, keyfile, keyform,
|
||||
NULL, e, "Certificate");
|
||||
if(x)
|
||||
{
|
||||
pkey = X509_get_pubkey(x);
|
||||
X509_free(x);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
*pkeysize = EVP_PKEY_size(pkey);
|
||||
|
||||
if (!pkey)
|
||||
goto end;
|
||||
|
||||
ctx = EVP_PKEY_CTX_new(pkey, e);
|
||||
|
||||
EVP_PKEY_free(pkey);
|
||||
|
||||
if (!ctx)
|
||||
goto end;
|
||||
|
||||
switch(pkey_op)
|
||||
{
|
||||
case EVP_PKEY_OP_SIGN:
|
||||
rv = EVP_PKEY_sign_init(ctx);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_VERIFY:
|
||||
rv = EVP_PKEY_verify_init(ctx);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_VERIFYRECOVER:
|
||||
rv = EVP_PKEY_verify_recover_init(ctx);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_ENCRYPT:
|
||||
rv = EVP_PKEY_encrypt_init(ctx);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_DECRYPT:
|
||||
rv = EVP_PKEY_decrypt_init(ctx);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_DERIVE:
|
||||
rv = EVP_PKEY_derive_init(ctx);
|
||||
break;
|
||||
}
|
||||
|
||||
if (rv <= 0)
|
||||
{
|
||||
EVP_PKEY_CTX_free(ctx);
|
||||
ctx = NULL;
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
if (passin)
|
||||
OPENSSL_free(passin);
|
||||
|
||||
return ctx;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
|
||||
const char *file)
|
||||
{
|
||||
EVP_PKEY *peer = NULL;
|
||||
int ret;
|
||||
if (!ctx)
|
||||
{
|
||||
BIO_puts(err, "-peerkey command before -inkey\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
peer = load_pubkey(bio_err, file, peerform, 0, NULL, NULL, "Peer Key");
|
||||
|
||||
if (!peer)
|
||||
{
|
||||
BIO_printf(bio_err, "Error reading peer key %s\n", file);
|
||||
ERR_print_errors(err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = EVP_PKEY_derive_set_peer(ctx, peer);
|
||||
|
||||
EVP_PKEY_free(peer);
|
||||
if (ret <= 0)
|
||||
ERR_print_errors(err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
|
||||
unsigned char *out, size_t *poutlen,
|
||||
unsigned char *in, size_t inlen)
|
||||
{
|
||||
int rv = 0;
|
||||
switch(pkey_op)
|
||||
{
|
||||
case EVP_PKEY_OP_VERIFYRECOVER:
|
||||
rv = EVP_PKEY_verify_recover(ctx, out, poutlen, in, inlen);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_SIGN:
|
||||
rv = EVP_PKEY_sign(ctx, out, poutlen, in, inlen);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_ENCRYPT:
|
||||
rv = EVP_PKEY_encrypt(ctx, out, poutlen, in, inlen);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_DECRYPT:
|
||||
rv = EVP_PKEY_decrypt(ctx, out, poutlen, in, inlen);
|
||||
break;
|
||||
|
||||
case EVP_PKEY_OP_DERIVE:
|
||||
rv = EVP_PKEY_derive(ctx, out, poutlen);
|
||||
break;
|
||||
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
46
apps/prime.c
46
apps/prime.c
@@ -62,9 +62,6 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
int hex=0;
|
||||
int checks=20;
|
||||
int generate=0;
|
||||
int bits=0;
|
||||
int safe=0;
|
||||
BIGNUM *bn=NULL;
|
||||
BIO *bio_out;
|
||||
|
||||
@@ -80,15 +77,6 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
if(!strcmp(*argv,"-hex"))
|
||||
hex=1;
|
||||
else if(!strcmp(*argv,"-generate"))
|
||||
generate=1;
|
||||
else if(!strcmp(*argv,"-bits"))
|
||||
if(--argc < 1)
|
||||
goto bad;
|
||||
else
|
||||
bits=atoi(*++argv);
|
||||
else if(!strcmp(*argv,"-safe"))
|
||||
safe=1;
|
||||
else if(!strcmp(*argv,"-checks"))
|
||||
if(--argc < 1)
|
||||
goto bad;
|
||||
@@ -103,13 +91,13 @@ int MAIN(int argc, char **argv)
|
||||
++argv;
|
||||
}
|
||||
|
||||
if (argv[0] == NULL && !generate)
|
||||
if (argv[0] == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"No prime specified\n");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
|
||||
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
|
||||
{
|
||||
BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
@@ -120,32 +108,14 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
}
|
||||
|
||||
if(generate)
|
||||
{
|
||||
char *s;
|
||||
|
||||
if(!bits)
|
||||
{
|
||||
BIO_printf(bio_err,"Specifiy the number of bits.\n");
|
||||
return 1;
|
||||
}
|
||||
bn=BN_new();
|
||||
BN_generate_prime_ex(bn,bits,safe,NULL,NULL,NULL);
|
||||
s=hex ? BN_bn2hex(bn) : BN_bn2dec(bn);
|
||||
BIO_printf(bio_out,"%s\n",s);
|
||||
OPENSSL_free(s);
|
||||
}
|
||||
if(hex)
|
||||
BN_hex2bn(&bn,argv[0]);
|
||||
else
|
||||
{
|
||||
if(hex)
|
||||
BN_hex2bn(&bn,argv[0]);
|
||||
else
|
||||
BN_dec2bn(&bn,argv[0]);
|
||||
BN_dec2bn(&bn,argv[0]);
|
||||
|
||||
BN_print(bio_out,bn);
|
||||
BIO_printf(bio_out," is %sprime\n",
|
||||
BN_is_prime_ex(bn,checks,NULL,NULL) ? "" : "not ");
|
||||
}
|
||||
BN_print(bio_out,bn);
|
||||
BIO_printf(bio_out," is %sprime\n",
|
||||
BN_is_prime_ex(bn,checks,NULL,NULL) ? "" : "not ");
|
||||
|
||||
BN_free(bn);
|
||||
BIO_free_all(bio_out);
|
||||
|
||||
19
apps/progs.h
19
apps/progs.h
@@ -22,7 +22,6 @@ extern int ecparam_main(int argc,char *argv[]);
|
||||
extern int x509_main(int argc,char *argv[]);
|
||||
extern int genrsa_main(int argc,char *argv[]);
|
||||
extern int gendsa_main(int argc,char *argv[]);
|
||||
extern int genpkey_main(int argc,char *argv[]);
|
||||
extern int s_server_main(int argc,char *argv[]);
|
||||
extern int s_client_main(int argc,char *argv[]);
|
||||
extern int speed_main(int argc,char *argv[]);
|
||||
@@ -36,30 +35,22 @@ extern int ciphers_main(int argc,char *argv[]);
|
||||
extern int nseq_main(int argc,char *argv[]);
|
||||
extern int pkcs12_main(int argc,char *argv[]);
|
||||
extern int pkcs8_main(int argc,char *argv[]);
|
||||
extern int pkey_main(int argc,char *argv[]);
|
||||
extern int pkeyparam_main(int argc,char *argv[]);
|
||||
extern int pkeyutl_main(int argc,char *argv[]);
|
||||
extern int spkac_main(int argc,char *argv[]);
|
||||
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 prime_main(int argc,char *argv[]);
|
||||
extern int ts_main(int argc,char *argv[]);
|
||||
|
||||
#define FUNC_TYPE_GENERAL 1
|
||||
#define FUNC_TYPE_MD 2
|
||||
#define FUNC_TYPE_CIPHER 3
|
||||
#define FUNC_TYPE_PKEY 4
|
||||
#define FUNC_TYPE_MD_ALG 5
|
||||
#define FUNC_TYPE_CIPHER_ALG 6
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
const char *name;
|
||||
int (*func)(int argc,char *argv[]);
|
||||
} FUNCTION;
|
||||
DECLARE_LHASH_OF(FUNCTION);
|
||||
|
||||
FUNCTION functions[] = {
|
||||
{FUNC_TYPE_GENERAL,"verify",verify_main},
|
||||
@@ -105,7 +96,6 @@ FUNCTION functions[] = {
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
{FUNC_TYPE_GENERAL,"gendsa",gendsa_main},
|
||||
#endif
|
||||
{FUNC_TYPE_GENERAL,"genpkey",genpkey_main},
|
||||
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||
{FUNC_TYPE_GENERAL,"s_server",s_server_main},
|
||||
#endif
|
||||
@@ -133,20 +123,14 @@ FUNCTION functions[] = {
|
||||
{FUNC_TYPE_GENERAL,"pkcs12",pkcs12_main},
|
||||
#endif
|
||||
{FUNC_TYPE_GENERAL,"pkcs8",pkcs8_main},
|
||||
{FUNC_TYPE_GENERAL,"pkey",pkey_main},
|
||||
{FUNC_TYPE_GENERAL,"pkeyparam",pkeyparam_main},
|
||||
{FUNC_TYPE_GENERAL,"pkeyutl",pkeyutl_main},
|
||||
{FUNC_TYPE_GENERAL,"spkac",spkac_main},
|
||||
{FUNC_TYPE_GENERAL,"smime",smime_main},
|
||||
{FUNC_TYPE_GENERAL,"rand",rand_main},
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
{FUNC_TYPE_GENERAL,"engine",engine_main},
|
||||
#endif
|
||||
#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_MD2
|
||||
{FUNC_TYPE_MD,"md2",dgst_main},
|
||||
#endif
|
||||
@@ -205,9 +189,6 @@ FUNCTION functions[] = {
|
||||
{FUNC_TYPE_CIPHER,"camellia-256-ecb",enc_main},
|
||||
#endif
|
||||
{FUNC_TYPE_CIPHER,"base64",enc_main},
|
||||
#ifdef ZLIB
|
||||
{FUNC_TYPE_CIPHER,"zlib",enc_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DES
|
||||
{FUNC_TYPE_CIPHER,"des",enc_main},
|
||||
#endif
|
||||
|
||||
@@ -13,16 +13,12 @@ print <<'EOF';
|
||||
#define FUNC_TYPE_GENERAL 1
|
||||
#define FUNC_TYPE_MD 2
|
||||
#define FUNC_TYPE_CIPHER 3
|
||||
#define FUNC_TYPE_PKEY 4
|
||||
#define FUNC_TYPE_MD_ALG 5
|
||||
#define FUNC_TYPE_CIPHER_ALG 6
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
const char *name;
|
||||
int (*func)(int argc,char *argv[]);
|
||||
} FUNCTION;
|
||||
DECLARE_LHASH_OF(FUNCTION);
|
||||
|
||||
FUNCTION functions[] = {
|
||||
EOF
|
||||
@@ -49,8 +45,6 @@ foreach (@ARGV)
|
||||
{ print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^cms$/))
|
||||
{ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^ocsp$/))
|
||||
{ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
|
||||
else
|
||||
{ print $str; }
|
||||
}
|
||||
@@ -68,7 +62,7 @@ foreach (
|
||||
"camellia-128-cbc", "camellia-128-ecb",
|
||||
"camellia-192-cbc", "camellia-192-ecb",
|
||||
"camellia-256-cbc", "camellia-256-ecb",
|
||||
"base64", "zlib",
|
||||
"base64",
|
||||
"des", "des3", "desx", "idea", "seed", "rc4", "rc4-40",
|
||||
"rc2", "bf", "cast", "rc5",
|
||||
"des-ecb", "des-ede", "des-ede3",
|
||||
@@ -95,7 +89,6 @@ foreach (
|
||||
elsif ($_ =~ /bf/) { $t="#ifndef OPENSSL_NO_BF\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /cast/) { $t="#ifndef OPENSSL_NO_CAST\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /rc5/) { $t="#ifndef OPENSSL_NO_RC5\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /zlib/) { $t="#ifdef ZLIB\n${t}#endif\n"; }
|
||||
print $t;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
int i, r, ret = 1;
|
||||
int badopt;
|
||||
char *outfile = NULL;
|
||||
@@ -178,7 +175,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||
|
||||
522
apps/req.c
522
apps/req.c
@@ -141,33 +141,39 @@ static int add_attribute_object(X509_REQ *req, char *text, const char *def,
|
||||
int n_max, unsigned long chtype);
|
||||
static int add_DN_object(X509_NAME *n, char *text, const char *def, char *value,
|
||||
int nid,int n_min,int n_max, unsigned long chtype, int mval);
|
||||
static int genpkey_cb(EVP_PKEY_CTX *ctx);
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb);
|
||||
#endif
|
||||
static int req_check_len(int len,int n_min,int n_max);
|
||||
static int check_end(const char *str, const char *end);
|
||||
static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
|
||||
long *pkeylen, char **palgnam,
|
||||
ENGINE *keygen_engine);
|
||||
#ifndef MONOLITH
|
||||
static char *default_config_file=NULL;
|
||||
#endif
|
||||
static CONF *req_conf=NULL;
|
||||
static int batch=0;
|
||||
|
||||
#define TYPE_RSA 1
|
||||
#define TYPE_DSA 2
|
||||
#define TYPE_DH 3
|
||||
#define TYPE_EC 4
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL, *gen_eng = NULL;
|
||||
ENGINE *e = NULL;
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
DSA *dsa_params=NULL;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
EC_KEY *ec_params = NULL;
|
||||
#endif
|
||||
unsigned long nmflag = 0, reqflag = 0;
|
||||
int ex=1,x509=0,days=30;
|
||||
X509 *x509ss=NULL;
|
||||
X509_REQ *req=NULL;
|
||||
EVP_PKEY_CTX *genctx = NULL;
|
||||
const char *keyalg = NULL;
|
||||
char *keyalgstr = NULL;
|
||||
STACK_OF(STRING) *pkeyopts = NULL;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
int i=0,badops=0,newreq=0,verbose=0,pkey_type=-1;
|
||||
int i=0,badops=0,newreq=0,verbose=0,pkey_type=TYPE_RSA;
|
||||
long newkey = -1;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
|
||||
@@ -187,7 +193,7 @@ int MAIN(int argc, char **argv)
|
||||
char *p;
|
||||
char *subj = NULL;
|
||||
int multirdn = 0;
|
||||
const EVP_MD *md_alg=NULL,*digest=NULL;
|
||||
const EVP_MD *md_alg=NULL,*digest=EVP_sha1();
|
||||
unsigned long chtype = MBSTRING_ASC;
|
||||
#ifndef MONOLITH
|
||||
char *to_free;
|
||||
@@ -230,16 +236,6 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
engine= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-keygen_engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
gen_eng = ENGINE_by_id(*(++argv));
|
||||
if (gen_eng == NULL)
|
||||
{
|
||||
BIO_printf(bio_err, "Can't find keygen engine %s\n", *argv);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(*argv,"-key") == 0)
|
||||
{
|
||||
@@ -296,20 +292,126 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else if (strcmp(*argv,"-newkey") == 0)
|
||||
{
|
||||
if (--argc < 1)
|
||||
int is_numeric;
|
||||
|
||||
if (--argc < 1) goto bad;
|
||||
p= *(++argv);
|
||||
is_numeric = p[0] >= '0' && p[0] <= '9';
|
||||
if (strncmp("rsa:",p,4) == 0 || is_numeric)
|
||||
{
|
||||
pkey_type=TYPE_RSA;
|
||||
if(!is_numeric)
|
||||
p+=4;
|
||||
newkey= atoi(p);
|
||||
}
|
||||
else
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (strncmp("dsa:",p,4) == 0)
|
||||
{
|
||||
X509 *xtmp=NULL;
|
||||
EVP_PKEY *dtmp;
|
||||
|
||||
pkey_type=TYPE_DSA;
|
||||
p+=4;
|
||||
if ((in=BIO_new_file(p,"r")) == NULL)
|
||||
{
|
||||
perror(p);
|
||||
goto end;
|
||||
}
|
||||
if ((dsa_params=PEM_read_bio_DSAparams(in,NULL,NULL,NULL)) == NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
(void)BIO_reset(in);
|
||||
if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load DSA parameters from file\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end;
|
||||
if (dtmp->type == EVP_PKEY_DSA)
|
||||
dsa_params=DSAparams_dup(dtmp->pkey.dsa);
|
||||
EVP_PKEY_free(dtmp);
|
||||
X509_free(xtmp);
|
||||
if (dsa_params == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Certificate does not contain DSA parameters\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
BIO_free(in);
|
||||
in=NULL;
|
||||
newkey=BN_num_bits(dsa_params->p);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (strncmp("ec:",p,3) == 0)
|
||||
{
|
||||
X509 *xtmp=NULL;
|
||||
EVP_PKEY *dtmp;
|
||||
EC_GROUP *group;
|
||||
|
||||
pkey_type=TYPE_EC;
|
||||
p+=3;
|
||||
if ((in=BIO_new_file(p,"r")) == NULL)
|
||||
{
|
||||
perror(p);
|
||||
goto end;
|
||||
}
|
||||
if ((ec_params = EC_KEY_new()) == NULL)
|
||||
goto end;
|
||||
group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
|
||||
if (group == NULL)
|
||||
{
|
||||
EC_KEY_free(ec_params);
|
||||
ERR_clear_error();
|
||||
(void)BIO_reset(in);
|
||||
if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load EC parameters from file\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((dtmp=X509_get_pubkey(xtmp))==NULL)
|
||||
goto end;
|
||||
if (dtmp->type == EVP_PKEY_EC)
|
||||
ec_params = EC_KEY_dup(dtmp->pkey.ec);
|
||||
EVP_PKEY_free(dtmp);
|
||||
X509_free(xtmp);
|
||||
if (ec_params == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Certificate does not contain EC parameters\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EC_KEY_set_group(ec_params, group) == 0)
|
||||
goto end;
|
||||
EC_GROUP_free(group);
|
||||
}
|
||||
|
||||
BIO_free(in);
|
||||
in=NULL;
|
||||
newkey = EC_GROUP_get_degree(EC_KEY_get0_group(ec_params));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DH
|
||||
if (strncmp("dh:",p,4) == 0)
|
||||
{
|
||||
pkey_type=TYPE_DH;
|
||||
p+=3;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
goto bad;
|
||||
keyalg = *(++argv);
|
||||
}
|
||||
|
||||
newreq=1;
|
||||
}
|
||||
else if (strcmp(*argv,"-pkeyopt") == 0)
|
||||
{
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
if (!pkeyopts)
|
||||
pkeyopts = sk_STRING_new_null();
|
||||
if (!pkeyopts || !sk_STRING_push(pkeyopts, *(++argv)))
|
||||
goto bad;
|
||||
}
|
||||
else if (strcmp(*argv,"-batch") == 0)
|
||||
batch=1;
|
||||
else if (strcmp(*argv,"-newhdr") == 0)
|
||||
@@ -365,6 +467,11 @@ int MAIN(int argc, char **argv)
|
||||
serial = s2i_ASN1_INTEGER(NULL, *(++argv));
|
||||
if (!serial) goto bad;
|
||||
}
|
||||
else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
|
||||
{
|
||||
/* ok */
|
||||
digest=md_alg;
|
||||
}
|
||||
else if (strcmp(*argv,"-extensions") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -375,11 +482,6 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
req_exts = *(++argv);
|
||||
}
|
||||
else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
|
||||
{
|
||||
/* ok */
|
||||
digest=md_alg;
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||
@@ -628,20 +730,15 @@ bad:
|
||||
|
||||
if (newreq && (pkey == NULL))
|
||||
{
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
BN_GENCB cb;
|
||||
#endif
|
||||
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||
if (randfile == NULL)
|
||||
ERR_clear_error();
|
||||
app_RAND_load_file(randfile, bio_err, 0);
|
||||
if (inrand)
|
||||
app_RAND_load_files(inrand);
|
||||
|
||||
if (keyalg)
|
||||
{
|
||||
genctx = set_keygen_ctx(bio_err, keyalg, &pkey_type, &newkey,
|
||||
&keyalgstr, gen_eng);
|
||||
if (!genctx)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (newkey <= 0)
|
||||
{
|
||||
@@ -649,55 +746,58 @@ bad:
|
||||
newkey=DEFAULT_KEY_LENGTH;
|
||||
}
|
||||
|
||||
if (newkey < MIN_KEY_LENGTH && (pkey_type == EVP_PKEY_RSA || pkey_type == EVP_PKEY_DSA))
|
||||
if (newkey < MIN_KEY_LENGTH && (pkey_type == TYPE_RSA || pkey_type == TYPE_DSA))
|
||||
{
|
||||
BIO_printf(bio_err,"private key length is too short,\n");
|
||||
BIO_printf(bio_err,"it needs to be at least %d bits, not %ld\n",MIN_KEY_LENGTH,newkey);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!genctx)
|
||||
{
|
||||
genctx = set_keygen_ctx(bio_err, NULL, &pkey_type, &newkey,
|
||||
&keyalgstr, gen_eng);
|
||||
if (!genctx)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (pkeyopts)
|
||||
{
|
||||
char *genopt;
|
||||
for (i = 0; i < sk_STRING_num(pkeyopts); i++)
|
||||
{
|
||||
genopt = sk_STRING_value(pkeyopts, i);
|
||||
if (pkey_ctrl_string(genctx, genopt) <= 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"parameter error \"%s\"\n",
|
||||
genopt);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIO_printf(bio_err,"Generating a %ld bit %s private key\n",
|
||||
newkey, keyalgstr);
|
||||
newkey,(pkey_type == TYPE_RSA)?"RSA":
|
||||
(pkey_type == TYPE_DSA)?"DSA":"EC");
|
||||
|
||||
EVP_PKEY_CTX_set_cb(genctx, genpkey_cb);
|
||||
EVP_PKEY_CTX_set_app_data(genctx, bio_err);
|
||||
if ((pkey=EVP_PKEY_new()) == NULL) goto end;
|
||||
|
||||
if (EVP_PKEY_keygen(genctx, &pkey) <= 0)
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
BN_GENCB_set(&cb, req_cb, bio_err);
|
||||
if (pkey_type == TYPE_RSA)
|
||||
{
|
||||
BIO_puts(bio_err, "Error Generating Key\n");
|
||||
goto end;
|
||||
RSA *rsa = RSA_new();
|
||||
BIGNUM *bn = BN_new();
|
||||
if(!bn || !rsa || !BN_set_word(bn, 0x10001) ||
|
||||
!RSA_generate_key_ex(rsa, newkey, bn, &cb) ||
|
||||
!EVP_PKEY_assign_RSA(pkey, rsa))
|
||||
{
|
||||
if(bn) BN_free(bn);
|
||||
if(rsa) RSA_free(rsa);
|
||||
goto end;
|
||||
}
|
||||
BN_free(bn);
|
||||
}
|
||||
|
||||
EVP_PKEY_CTX_free(genctx);
|
||||
genctx = NULL;
|
||||
else
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (pkey_type == TYPE_DSA)
|
||||
{
|
||||
if (!DSA_generate_key(dsa_params)) goto end;
|
||||
if (!EVP_PKEY_assign_DSA(pkey,dsa_params)) goto end;
|
||||
dsa_params=NULL;
|
||||
}
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (pkey_type == TYPE_EC)
|
||||
{
|
||||
if (!EC_KEY_generate_key(ec_params)) goto end;
|
||||
if (!EVP_PKEY_assign_EC_KEY(pkey, ec_params))
|
||||
goto end;
|
||||
ec_params = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
app_RAND_write_file(randfile, bio_err);
|
||||
|
||||
if (pkey == NULL) goto end;
|
||||
|
||||
if (keyout == NULL)
|
||||
{
|
||||
keyout=NCONF_get_string(req_conf,SECTION,KEYFILE);
|
||||
@@ -795,7 +895,14 @@ loop:
|
||||
BIO_printf(bio_err,"you need to specify a private key\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (pkey->type == EVP_PKEY_DSA)
|
||||
digest=EVP_dss1();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (pkey->type == EVP_PKEY_EC)
|
||||
digest=EVP_ecdsa();
|
||||
#endif
|
||||
if (req == NULL)
|
||||
{
|
||||
req=X509_REQ_new();
|
||||
@@ -838,7 +945,7 @@ loop:
|
||||
|
||||
if (!X509_set_issuer_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
|
||||
if (!X509_gmtime_adj(X509_get_notBefore(x509ss),0)) goto end;
|
||||
if (!X509_time_adj_ex(X509_get_notAfter(x509ss), days, 0, NULL)) goto end;
|
||||
if (!X509_gmtime_adj(X509_get_notAfter(x509ss), (long)60*60*24*days)) goto end;
|
||||
if (!X509_set_subject_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
|
||||
tmppkey = X509_REQ_get_pubkey(req);
|
||||
if (!tmppkey || !X509_set_pubkey(x509ss,tmppkey)) goto end;
|
||||
@@ -860,10 +967,7 @@ loop:
|
||||
}
|
||||
|
||||
if (!(i=X509_sign(x509ss,pkey,digest)))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -884,10 +988,7 @@ loop:
|
||||
goto end;
|
||||
}
|
||||
if (!(i=X509_REQ_sign(req,pkey,digest)))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1024,7 +1125,7 @@ loop:
|
||||
}
|
||||
fprintf(stdout,"Modulus=");
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
if (EVP_PKEY_base_id(tpubkey) == EVP_PKEY_RSA)
|
||||
if (tpubkey->type == EVP_PKEY_RSA)
|
||||
BN_print(out,tpubkey->pkey.rsa->n);
|
||||
else
|
||||
#endif
|
||||
@@ -1080,22 +1181,18 @@ end:
|
||||
BIO_free(in);
|
||||
BIO_free_all(out);
|
||||
EVP_PKEY_free(pkey);
|
||||
if (genctx)
|
||||
EVP_PKEY_CTX_free(genctx);
|
||||
if (pkeyopts)
|
||||
sk_STRING_free(pkeyopts);
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (gen_eng)
|
||||
ENGINE_free(gen_eng);
|
||||
#endif
|
||||
if (keyalgstr)
|
||||
OPENSSL_free(keyalgstr);
|
||||
X509_REQ_free(req);
|
||||
X509_free(x509ss);
|
||||
ASN1_INTEGER_free(serial);
|
||||
if(passargin && passin) OPENSSL_free(passin);
|
||||
if(passargout && passout) OPENSSL_free(passout);
|
||||
OBJ_cleanup();
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (dsa_params != NULL) DSA_free(dsa_params);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (ec_params != NULL) EC_KEY_free(ec_params);
|
||||
#endif
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ex);
|
||||
}
|
||||
@@ -1336,11 +1433,17 @@ start2: for (;;)
|
||||
|
||||
BIO_snprintf(buf,sizeof buf,"%s_min",type);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
|
||||
{
|
||||
ERR_clear_error();
|
||||
n_min = -1;
|
||||
}
|
||||
|
||||
BIO_snprintf(buf,sizeof buf,"%s_max",type);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
|
||||
{
|
||||
ERR_clear_error();
|
||||
n_max = -1;
|
||||
}
|
||||
|
||||
if (!add_attribute_object(req,
|
||||
v->value,def,value,nid,n_min,n_max, chtype))
|
||||
@@ -1441,7 +1544,8 @@ start:
|
||||
buf[0]='\0';
|
||||
if (!batch)
|
||||
{
|
||||
fgets(buf,sizeof buf,stdin);
|
||||
if (!fgets(buf,sizeof buf,stdin))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1470,7 +1574,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;
|
||||
@@ -1499,7 +1609,8 @@ start:
|
||||
buf[0]='\0';
|
||||
if (!batch)
|
||||
{
|
||||
fgets(buf,sizeof buf,stdin);
|
||||
if (!fgets(buf,sizeof buf,stdin))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1528,7 +1639,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)) {
|
||||
@@ -1542,6 +1658,24 @@ err:
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb)
|
||||
{
|
||||
char c='*';
|
||||
|
||||
if (p == 0) c='.';
|
||||
if (p == 1) c='+';
|
||||
if (p == 2) c='*';
|
||||
if (p == 3) c='\n';
|
||||
BIO_write(cb->arg,&c,1);
|
||||
(void)BIO_flush(cb->arg);
|
||||
#ifdef LINT
|
||||
p=n;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int req_check_len(int len, int n_min, int n_max)
|
||||
{
|
||||
if ((n_min > 0) && (len < n_min))
|
||||
@@ -1568,183 +1702,3 @@ static int check_end(const char *str, const char *end)
|
||||
tmp = str + slen - elen;
|
||||
return strcmp(tmp, end);
|
||||
}
|
||||
|
||||
static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
|
||||
long *pkeylen, char **palgnam,
|
||||
ENGINE *keygen_engine)
|
||||
{
|
||||
EVP_PKEY_CTX *gctx = NULL;
|
||||
EVP_PKEY *param = NULL;
|
||||
long keylen = -1;
|
||||
BIO *pbio = NULL;
|
||||
const char *paramfile = NULL;
|
||||
|
||||
if (gstr == NULL)
|
||||
{
|
||||
*pkey_type = EVP_PKEY_RSA;
|
||||
keylen = *pkeylen;
|
||||
}
|
||||
else if (gstr[0] >= '0' && gstr[0] <= '9')
|
||||
{
|
||||
*pkey_type = EVP_PKEY_RSA;
|
||||
keylen = atol(gstr);
|
||||
*pkeylen = keylen;
|
||||
}
|
||||
else if (!strncmp(gstr, "param:", 6))
|
||||
paramfile = gstr + 6;
|
||||
else
|
||||
{
|
||||
const char *p = strchr(gstr, ':');
|
||||
int len;
|
||||
ENGINE *tmpeng;
|
||||
const EVP_PKEY_ASN1_METHOD *ameth;
|
||||
|
||||
if (p)
|
||||
len = p - gstr;
|
||||
else
|
||||
len = strlen(gstr);
|
||||
/* The lookup of a the string will cover all engines so
|
||||
* keep a note of the implementation.
|
||||
*/
|
||||
|
||||
ameth = EVP_PKEY_asn1_find_str(&tmpeng, gstr, len);
|
||||
|
||||
if (!ameth)
|
||||
{
|
||||
BIO_printf(err, "Unknown algorithm %.*s\n", len, gstr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EVP_PKEY_asn1_get0_info(NULL, pkey_type, NULL, NULL, NULL,
|
||||
ameth);
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (tmpeng)
|
||||
ENGINE_finish(tmpeng);
|
||||
#endif
|
||||
if (*pkey_type == EVP_PKEY_RSA)
|
||||
{
|
||||
if (p)
|
||||
{
|
||||
keylen = atol(p + 1);
|
||||
*pkeylen = keylen;
|
||||
}
|
||||
}
|
||||
else if (p)
|
||||
paramfile = p + 1;
|
||||
}
|
||||
|
||||
if (paramfile)
|
||||
{
|
||||
pbio = BIO_new_file(paramfile, "r");
|
||||
if (!pbio)
|
||||
{
|
||||
BIO_printf(err, "Can't open parameter file %s\n",
|
||||
paramfile);
|
||||
return NULL;
|
||||
}
|
||||
param = PEM_read_bio_Parameters(pbio, NULL);
|
||||
|
||||
if (!param)
|
||||
{
|
||||
X509 *x;
|
||||
(void)BIO_reset(pbio);
|
||||
x = PEM_read_bio_X509(pbio, NULL, NULL, NULL);
|
||||
if (x)
|
||||
{
|
||||
param = X509_get_pubkey(x);
|
||||
X509_free(x);
|
||||
}
|
||||
}
|
||||
|
||||
BIO_free(pbio);
|
||||
|
||||
if (!param)
|
||||
{
|
||||
BIO_printf(err, "Error reading parameter file %s\n",
|
||||
paramfile);
|
||||
return NULL;
|
||||
}
|
||||
if (*pkey_type == -1)
|
||||
*pkey_type = EVP_PKEY_id(param);
|
||||
else if (*pkey_type != EVP_PKEY_base_id(param))
|
||||
{
|
||||
BIO_printf(err, "Key Type does not match parameters\n");
|
||||
EVP_PKEY_free(param);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (palgnam)
|
||||
{
|
||||
const EVP_PKEY_ASN1_METHOD *ameth;
|
||||
ENGINE *tmpeng;
|
||||
const char *anam;
|
||||
ameth = EVP_PKEY_asn1_find(&tmpeng, *pkey_type);
|
||||
if (!ameth)
|
||||
{
|
||||
BIO_puts(err, "Internal error: can't find key algorithm\n");
|
||||
return NULL;
|
||||
}
|
||||
EVP_PKEY_asn1_get0_info(NULL, NULL, NULL, NULL, &anam, ameth);
|
||||
*palgnam = BUF_strdup(anam);
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (tmpeng)
|
||||
ENGINE_finish(tmpeng);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (param)
|
||||
{
|
||||
gctx = EVP_PKEY_CTX_new(param, keygen_engine);
|
||||
*pkeylen = EVP_PKEY_bits(param);
|
||||
EVP_PKEY_free(param);
|
||||
}
|
||||
else
|
||||
gctx = EVP_PKEY_CTX_new_id(*pkey_type, keygen_engine);
|
||||
|
||||
if (!gctx)
|
||||
{
|
||||
BIO_puts(err, "Error allocating keygen context\n");
|
||||
ERR_print_errors(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (EVP_PKEY_keygen_init(gctx) <= 0)
|
||||
{
|
||||
BIO_puts(err, "Error initializing keygen context\n");
|
||||
ERR_print_errors(err);
|
||||
return NULL;
|
||||
}
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
if ((*pkey_type == EVP_PKEY_RSA) && (keylen != -1))
|
||||
{
|
||||
if (EVP_PKEY_CTX_set_rsa_keygen_bits(gctx, keylen) <= 0)
|
||||
{
|
||||
BIO_puts(err, "Error setting RSA keysize\n");
|
||||
ERR_print_errors(err);
|
||||
EVP_PKEY_CTX_free(gctx);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return gctx;
|
||||
}
|
||||
|
||||
static int genpkey_cb(EVP_PKEY_CTX *ctx)
|
||||
{
|
||||
char c='*';
|
||||
BIO *b = EVP_PKEY_CTX_get_app_data(ctx);
|
||||
int p;
|
||||
p = EVP_PKEY_CTX_get_keygen_info(ctx, 0);
|
||||
if (p == 0) c='.';
|
||||
if (p == 1) c='+';
|
||||
if (p == 2) c='*';
|
||||
if (p == 3) c='\n';
|
||||
BIO_write(b,&c,1);
|
||||
(void)BIO_flush(b);
|
||||
#ifdef LINT
|
||||
p=n;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
61
apps/rsa.c
61
apps/rsa.c
@@ -115,8 +115,6 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
int modulus=0;
|
||||
|
||||
int pvk_encr = 2;
|
||||
|
||||
apps_startup();
|
||||
|
||||
if (bio_err == NULL)
|
||||
@@ -179,16 +177,6 @@ int MAIN(int argc, char **argv)
|
||||
pubin=1;
|
||||
else if (strcmp(*argv,"-pubout") == 0)
|
||||
pubout=1;
|
||||
else if (strcmp(*argv,"-RSAPublicKey_in") == 0)
|
||||
pubin = 2;
|
||||
else if (strcmp(*argv,"-RSAPublicKey_out") == 0)
|
||||
pubout = 2;
|
||||
else if (strcmp(*argv,"-pvk-strong") == 0)
|
||||
pvk_encr=2;
|
||||
else if (strcmp(*argv,"-pvk-weak") == 0)
|
||||
pvk_encr=1;
|
||||
else if (strcmp(*argv,"-pvk-none") == 0)
|
||||
pvk_encr=0;
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
@@ -269,23 +257,10 @@ bad:
|
||||
EVP_PKEY *pkey;
|
||||
|
||||
if (pubin)
|
||||
{
|
||||
int tmpformat=-1;
|
||||
if (pubin == 2)
|
||||
{
|
||||
if (informat == FORMAT_PEM)
|
||||
tmpformat = FORMAT_PEMRSA;
|
||||
else if (informat == FORMAT_ASN1)
|
||||
tmpformat = FORMAT_ASN1RSA;
|
||||
}
|
||||
else if (informat == FORMAT_NETSCAPE && sgckey)
|
||||
tmpformat = FORMAT_IISSGC;
|
||||
else
|
||||
tmpformat = informat;
|
||||
|
||||
pkey = load_pubkey(bio_err, infile, tmpformat, 1,
|
||||
pkey = load_pubkey(bio_err, infile,
|
||||
(informat == FORMAT_NETSCAPE && sgckey ?
|
||||
FORMAT_IISSGC : informat), 1,
|
||||
passin, e, "Public Key");
|
||||
}
|
||||
else
|
||||
pkey = load_key(bio_err, infile,
|
||||
(informat == FORMAT_NETSCAPE && sgckey ?
|
||||
@@ -293,7 +268,7 @@ bad:
|
||||
passin, e, "Private Key");
|
||||
|
||||
if (pkey != NULL)
|
||||
rsa = EVP_PKEY_get1_RSA(pkey);
|
||||
rsa = pkey == NULL ? NULL : EVP_PKEY_get1_RSA(pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
|
||||
@@ -371,13 +346,7 @@ bad:
|
||||
}
|
||||
BIO_printf(bio_err,"writing RSA key\n");
|
||||
if (outformat == FORMAT_ASN1) {
|
||||
if(pubout || pubin)
|
||||
{
|
||||
if (pubout == 2)
|
||||
i=i2d_RSAPublicKey_bio(out,rsa);
|
||||
else
|
||||
i=i2d_RSA_PUBKEY_bio(out,rsa);
|
||||
}
|
||||
if(pubout || pubin) i=i2d_RSA_PUBKEY_bio(out,rsa);
|
||||
else i=i2d_RSAPrivateKey_bio(out,rsa);
|
||||
}
|
||||
#ifndef OPENSSL_NO_RC4
|
||||
@@ -401,27 +370,9 @@ bad:
|
||||
#endif
|
||||
else if (outformat == FORMAT_PEM) {
|
||||
if(pubout || pubin)
|
||||
{
|
||||
if (pubout == 2)
|
||||
i=PEM_write_bio_RSAPublicKey(out,rsa);
|
||||
else
|
||||
i=PEM_write_bio_RSA_PUBKEY(out,rsa);
|
||||
}
|
||||
i=PEM_write_bio_RSA_PUBKEY(out,rsa);
|
||||
else i=PEM_write_bio_RSAPrivateKey(out,rsa,
|
||||
enc,NULL,0,NULL,passout);
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
|
||||
EVP_PKEY *pk;
|
||||
pk = EVP_PKEY_new();
|
||||
EVP_PKEY_set1_RSA(pk, rsa);
|
||||
if (outformat == FORMAT_PVK)
|
||||
i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
|
||||
else if (pubin || pubout)
|
||||
i = i2b_PublicKey_bio(out, pk);
|
||||
else
|
||||
i = i2b_PrivateKey_bio(out, pk);
|
||||
EVP_PKEY_free(pk);
|
||||
#endif
|
||||
} else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
|
||||
@@ -342,10 +342,4 @@ static void usage()
|
||||
|
||||
}
|
||||
|
||||
#else /* !OPENSSL_NO_RSA */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
#include <conio.h>
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)
|
||||
#ifdef OPENSSL_SYS_MSDOS
|
||||
#define _kbhit kbhit
|
||||
#endif
|
||||
|
||||
@@ -162,7 +162,7 @@ int extract_port(char *str, short *port_ptr);
|
||||
int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
|
||||
|
||||
long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
|
||||
int argi, long argl, long ret);
|
||||
int argi, long argl, long ret);
|
||||
|
||||
#ifdef HEADER_SSL_H
|
||||
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret);
|
||||
@@ -171,3 +171,6 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||
unsigned char *data, int len,
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len);
|
||||
int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len);
|
||||
|
||||
127
apps/s_cb.c
127
apps/s_cb.c
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -117,13 +117,17 @@
|
||||
#undef NON_MAIN
|
||||
#undef USE_SOCKETS
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include "s_apps.h"
|
||||
|
||||
#define COOKIE_SECRET_LENGTH 16
|
||||
|
||||
int verify_depth=0;
|
||||
int verify_error=X509_V_OK;
|
||||
int verify_return_error=0;
|
||||
unsigned char cookie_secret[COOKIE_SECRET_LENGTH];
|
||||
int cookie_initialized=0;
|
||||
|
||||
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
|
||||
{
|
||||
@@ -143,8 +147,7 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
|
||||
X509_verify_cert_error_string(err));
|
||||
if (verify_depth >= depth)
|
||||
{
|
||||
if (!verify_return_error)
|
||||
ok=1;
|
||||
ok=1;
|
||||
verify_error=X509_V_OK;
|
||||
}
|
||||
else
|
||||
@@ -260,7 +263,7 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key)
|
||||
}
|
||||
|
||||
long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
|
||||
int argi, long argl, long ret)
|
||||
int argi, long argl, long ret)
|
||||
{
|
||||
BIO *out;
|
||||
|
||||
@@ -269,15 +272,15 @@ long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
|
||||
|
||||
if (cmd == (BIO_CB_READ|BIO_CB_RETURN))
|
||||
{
|
||||
BIO_printf(out,"read from %p [%p] (%lu bytes => %ld (0x%lX))\n",
|
||||
(void *)bio,argp,(unsigned long)argi,ret,ret);
|
||||
BIO_printf(out,"read from %p [%p] (%d bytes => %ld (0x%lX))\n",
|
||||
(void *)bio,argp,argi,ret,ret);
|
||||
BIO_dump(out,argp,(int)ret);
|
||||
return(ret);
|
||||
}
|
||||
else if (cmd == (BIO_CB_WRITE|BIO_CB_RETURN))
|
||||
{
|
||||
BIO_printf(out,"write to %p [%p] (%lu bytes => %ld (0x%lX))\n",
|
||||
(void *)bio,argp,(unsigned long)argi,ret,ret);
|
||||
BIO_printf(out,"write to %p [%p] (%d bytes => %ld (0x%lX))\n",
|
||||
(void *)bio,argp,argi,ret,ret);
|
||||
BIO_dump(out,argp,(int)ret);
|
||||
}
|
||||
return(ret);
|
||||
@@ -340,6 +343,12 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
|
||||
break;
|
||||
default:
|
||||
str_version = "???";
|
||||
case DTLS1_VERSION:
|
||||
str_version = "DTLS 1.0 ";
|
||||
break;
|
||||
case DTLS1_BAD_VER:
|
||||
str_version = "DTLS 1.0 (bad) ";
|
||||
break;
|
||||
}
|
||||
|
||||
if (version == SSL2_VERSION)
|
||||
@@ -403,7 +412,10 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
|
||||
}
|
||||
}
|
||||
|
||||
if (version == SSL3_VERSION || version == TLS1_VERSION)
|
||||
if (version == SSL3_VERSION ||
|
||||
version == TLS1_VERSION ||
|
||||
version == DTLS1_VERSION ||
|
||||
version == DTLS1_BAD_VER)
|
||||
{
|
||||
switch (content_type)
|
||||
{
|
||||
@@ -521,6 +533,9 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
|
||||
case 114:
|
||||
str_details2 = " bad_certificate_hash_value";
|
||||
break;
|
||||
case 115:
|
||||
str_details2 = " unknown_psk_identity";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -557,6 +572,9 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
|
||||
case 15:
|
||||
str_details1 = ", CertificateVerify";
|
||||
break;
|
||||
case 3:
|
||||
str_details1 = ", HelloVerifyRequest";
|
||||
break;
|
||||
case 16:
|
||||
str_details1 = ", ClientKeyExchange";
|
||||
break;
|
||||
@@ -638,11 +656,9 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||
extname = "server ticket";
|
||||
break;
|
||||
|
||||
#ifdef TLSEXT_TYPE_opaque_prf_input
|
||||
case TLSEXT_TYPE_opaque_prf_input:
|
||||
extname = "opaque PRF input";
|
||||
case TLSEXT_TYPE_renegotiate:
|
||||
extname = "renegotiate";
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
extname = "unknown";
|
||||
@@ -656,3 +672,86 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||
BIO_dump(bio, (char *)data, len);
|
||||
(void)BIO_flush(bio);
|
||||
}
|
||||
|
||||
int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)
|
||||
{
|
||||
unsigned char *buffer, result[EVP_MAX_MD_SIZE];
|
||||
unsigned int length, resultlength;
|
||||
struct sockaddr_in peer;
|
||||
|
||||
/* Initialize a random secret */
|
||||
if (!cookie_initialized)
|
||||
{
|
||||
if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH))
|
||||
{
|
||||
BIO_printf(bio_err,"error setting random cookie secret\n");
|
||||
return 0;
|
||||
}
|
||||
cookie_initialized = 1;
|
||||
}
|
||||
|
||||
/* Read peer information */
|
||||
(void)BIO_dgram_get_peer(SSL_get_rbio(ssl), &peer);
|
||||
|
||||
/* Create buffer with peer's address and port */
|
||||
length = sizeof(peer.sin_addr);
|
||||
length += sizeof(peer.sin_port);
|
||||
buffer = OPENSSL_malloc(length);
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(buffer, &peer.sin_addr, sizeof(peer.sin_addr));
|
||||
memcpy(buffer + sizeof(peer.sin_addr), &peer.sin_port, sizeof(peer.sin_port));
|
||||
|
||||
/* Calculate HMAC of buffer using the secret */
|
||||
HMAC(EVP_sha1(), cookie_secret, COOKIE_SECRET_LENGTH,
|
||||
buffer, length, result, &resultlength);
|
||||
OPENSSL_free(buffer);
|
||||
|
||||
memcpy(cookie, result, resultlength);
|
||||
*cookie_len = resultlength;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)
|
||||
{
|
||||
unsigned char *buffer, result[EVP_MAX_MD_SIZE];
|
||||
unsigned int length, resultlength;
|
||||
struct sockaddr_in peer;
|
||||
|
||||
/* If secret isn't initialized yet, the cookie can't be valid */
|
||||
if (!cookie_initialized)
|
||||
return 0;
|
||||
|
||||
/* Read peer information */
|
||||
(void)BIO_dgram_get_peer(SSL_get_rbio(ssl), &peer);
|
||||
|
||||
/* Create buffer with peer's address and port */
|
||||
length = sizeof(peer.sin_addr);
|
||||
length += sizeof(peer.sin_port);
|
||||
buffer = (unsigned char*) OPENSSL_malloc(length);
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(buffer, &peer.sin_addr, sizeof(peer.sin_addr));
|
||||
memcpy(buffer + sizeof(peer.sin_addr), &peer.sin_port, sizeof(peer.sin_port));
|
||||
|
||||
/* Calculate HMAC of buffer using the secret */
|
||||
HMAC(EVP_sha1(), cookie_secret, COOKIE_SECRET_LENGTH,
|
||||
buffer, length, result, &resultlength);
|
||||
OPENSSL_free(buffer);
|
||||
|
||||
if (cookie_len == resultlength && memcmp(result, cookie, resultlength) == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
354
apps/s_client.c
354
apps/s_client.c
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -108,35 +108,8 @@
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright 2005 Nokia. All rights reserved.
|
||||
*
|
||||
* The portions of the attached software ("Contribution") is developed by
|
||||
* Nokia Corporation and is licensed pursuant to the OpenSSL open source
|
||||
* license.
|
||||
*
|
||||
* The Contribution, originally written by Mika Kousa and Pasi Eronen of
|
||||
* Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
|
||||
* support (see RFC 4279) to OpenSSL.
|
||||
*
|
||||
* No patent licenses or other rights except those expressly stated in
|
||||
* the OpenSSL open source license shall be deemed granted or received
|
||||
* expressly, by implication, estoppel, or otherwise.
|
||||
*
|
||||
* No assurances are provided by Nokia that the Contribution does not
|
||||
* infringe the patent or other intellectual property rights of any third
|
||||
* party or that the license provides you with all the necessary rights
|
||||
* to make use of the Contribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
|
||||
* ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
|
||||
* SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
|
||||
* OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
|
||||
* OTHERWISE.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -162,19 +135,23 @@ typedef unsigned int u_int;
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/ocsp.h>
|
||||
#include <openssl/bn.h>
|
||||
#include "s_apps.h"
|
||||
#include "timeouts.h"
|
||||
|
||||
#ifdef OPENSSL_SYS_WINCE
|
||||
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
||||
#ifdef fileno
|
||||
#undef fileno
|
||||
#endif
|
||||
#define fileno(a) (int)_fileno(a)
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
|
||||
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
||||
#undef FIONBIO
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_BEOS_R5)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#undef PROG
|
||||
#define PROG s_client_main
|
||||
|
||||
@@ -189,7 +166,6 @@ typedef unsigned int u_int;
|
||||
|
||||
extern int verify_depth;
|
||||
extern int verify_error;
|
||||
extern int verify_return_error;
|
||||
|
||||
#ifdef FIONBIO
|
||||
static int c_nbio=0;
|
||||
@@ -212,69 +188,6 @@ static BIO *bio_c_out=NULL;
|
||||
static int c_quiet=0;
|
||||
static int c_ign_eof=0;
|
||||
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
/* Default PSK identity and key */
|
||||
static char *psk_identity="Client_identity";
|
||||
/*char *psk_key=NULL; by default PSK is not used */
|
||||
|
||||
static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,
|
||||
unsigned int max_identity_len, unsigned char *psk,
|
||||
unsigned int max_psk_len)
|
||||
{
|
||||
unsigned int psk_len = 0;
|
||||
int ret;
|
||||
BIGNUM *bn=NULL;
|
||||
|
||||
if (c_debug)
|
||||
BIO_printf(bio_c_out, "psk_client_cb\n");
|
||||
if (!hint)
|
||||
{
|
||||
/* no ServerKeyExchange message*/
|
||||
if (c_debug)
|
||||
BIO_printf(bio_c_out,"NULL received PSK identity hint, continuing anyway\n");
|
||||
}
|
||||
else if (c_debug)
|
||||
BIO_printf(bio_c_out, "Received PSK identity hint '%s'\n", hint);
|
||||
|
||||
/* lookup PSK identity and PSK key based on the given identity hint here */
|
||||
ret = BIO_snprintf(identity, max_identity_len, "%s", psk_identity);
|
||||
if (ret < 0 || (unsigned int)ret > max_identity_len)
|
||||
goto out_err;
|
||||
if (c_debug)
|
||||
BIO_printf(bio_c_out, "created identity '%s' len=%d\n", identity, ret);
|
||||
ret=BN_hex2bn(&bn, psk_key);
|
||||
if (!ret)
|
||||
{
|
||||
BIO_printf(bio_err,"Could not convert PSK key '%s' to BIGNUM\n", psk_key);
|
||||
if (bn)
|
||||
BN_free(bn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((unsigned int)BN_num_bytes(bn) > max_psk_len)
|
||||
{
|
||||
BIO_printf(bio_err,"psk buffer of callback is too small (%d) for key (%d)\n",
|
||||
max_psk_len, BN_num_bytes(bn));
|
||||
BN_free(bn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
psk_len=BN_bn2bin(bn, psk);
|
||||
BN_free(bn);
|
||||
if (psk_len == 0)
|
||||
goto out_err;
|
||||
|
||||
if (c_debug)
|
||||
BIO_printf(bio_c_out, "created PSK len=%d\n", psk_len);
|
||||
|
||||
return psk_len;
|
||||
out_err:
|
||||
if (c_debug)
|
||||
BIO_printf(bio_err, "Error in PSK client callback\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void sc_usage(void)
|
||||
{
|
||||
BIO_printf(bio_err,"usage: s_client args\n");
|
||||
@@ -283,7 +196,7 @@ static void sc_usage(void)
|
||||
BIO_printf(bio_err," -port port - use -connect instead\n");
|
||||
BIO_printf(bio_err," -connect host:port - who to connect to (default is %s:%s)\n",SSL_HOST_NAME,PORT_STR);
|
||||
|
||||
BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n");
|
||||
BIO_printf(bio_err," -verify depth - turn on peer certificate verification\n");
|
||||
BIO_printf(bio_err," -cert arg - certificate file to use, PEM format assumed\n");
|
||||
BIO_printf(bio_err," -certform arg - certificate format (PEM or DER) PEM default\n");
|
||||
BIO_printf(bio_err," -key arg - Private key file to use, in cert file if\n");
|
||||
@@ -309,17 +222,11 @@ static void sc_usage(void)
|
||||
BIO_printf(bio_err," -quiet - no s_client output\n");
|
||||
BIO_printf(bio_err," -ign_eof - ignore input eof (default when -quiet)\n");
|
||||
BIO_printf(bio_err," -no_ign_eof - don't ignore input eof\n");
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
BIO_printf(bio_err," -psk_identity arg - PSK identity\n");
|
||||
BIO_printf(bio_err," -psk arg - PSK in hex (without 0x)\n");
|
||||
# ifndef OPENSSL_NO_JPAKE
|
||||
BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n");
|
||||
# endif
|
||||
#endif
|
||||
BIO_printf(bio_err," -ssl2 - just use SSLv2\n");
|
||||
BIO_printf(bio_err," -ssl3 - just use SSLv3\n");
|
||||
BIO_printf(bio_err," -tls1 - just use TLSv1\n");
|
||||
BIO_printf(bio_err," -dtls1 - just use DTLSv1\n");
|
||||
BIO_printf(bio_err," -fallback_scsv - send TLS_FALLBACK_SCSV\n");
|
||||
BIO_printf(bio_err," -mtu - set the link layer MTU\n");
|
||||
BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n");
|
||||
BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n");
|
||||
@@ -343,6 +250,7 @@ static void sc_usage(void)
|
||||
BIO_printf(bio_err," -status - request certificate status from server\n");
|
||||
BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
@@ -366,7 +274,6 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg)
|
||||
return SSL_TLSEXT_ERR_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
PROTO_OFF = 0,
|
||||
@@ -381,8 +288,9 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int off=0;
|
||||
SSL *con=NULL;
|
||||
int off=0, clr = 0;
|
||||
SSL *con=NULL,*con2=NULL;
|
||||
X509_STORE *store = NULL;
|
||||
int s,k,width,state=0;
|
||||
char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL;
|
||||
int cbuf_len,cbuf_off;
|
||||
@@ -403,26 +311,26 @@ int MAIN(int argc, char **argv)
|
||||
SSL_CTX *ctx=NULL;
|
||||
int ret=1,in_init=1,i,nbio_test=0;
|
||||
int starttls_proto = PROTO_OFF;
|
||||
int prexit = 0;
|
||||
X509_VERIFY_PARAM *vpm = NULL;
|
||||
int badarg = 0;
|
||||
const SSL_METHOD *meth=NULL;
|
||||
int socket_type=SOCK_STREAM;
|
||||
int prexit = 0, vflags = 0;
|
||||
SSL_METHOD *meth=NULL;
|
||||
#ifdef sock_type
|
||||
#undef sock_type
|
||||
#endif
|
||||
int sock_type=SOCK_STREAM;
|
||||
BIO *sbio;
|
||||
char *inrand=NULL;
|
||||
int mbuf_len=0;
|
||||
struct timeval timeout, *timeoutp;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine_id=NULL;
|
||||
char *ssl_client_engine_id=NULL;
|
||||
ENGINE *ssl_client_engine=NULL;
|
||||
#endif
|
||||
ENGINE *e=NULL;
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
|
||||
struct timeval tv;
|
||||
#if defined(OPENSSL_SYS_BEOS_R5)
|
||||
int stdin_set = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
char *servername = NULL;
|
||||
tlsextctx tlsextcbp =
|
||||
@@ -432,19 +340,14 @@ int MAIN(int argc, char **argv)
|
||||
char *sess_out = NULL;
|
||||
struct sockaddr peer;
|
||||
int peerlen = sizeof(peer);
|
||||
int fallback_scsv = 0;
|
||||
int enable_timeouts = 0 ;
|
||||
long socket_mtu = 0;
|
||||
#ifndef OPENSSL_NO_JPAKE
|
||||
char *jpake_secret = NULL;
|
||||
#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;
|
||||
@@ -522,14 +425,10 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
cert_format = str2fmt(*(++argv));
|
||||
}
|
||||
else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm))
|
||||
{
|
||||
if (badarg)
|
||||
goto bad;
|
||||
continue;
|
||||
}
|
||||
else if (strcmp(*argv,"-verify_return_error") == 0)
|
||||
verify_return_error = 1;
|
||||
else if (strcmp(*argv,"-crl_check") == 0)
|
||||
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||
else if (strcmp(*argv,"-crl_check_all") == 0)
|
||||
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||
else if (strcmp(*argv,"-prexit") == 0)
|
||||
prexit=1;
|
||||
else if (strcmp(*argv,"-crlf") == 0)
|
||||
@@ -565,27 +464,6 @@ int MAIN(int argc, char **argv)
|
||||
nbio_test=1;
|
||||
else if (strcmp(*argv,"-state") == 0)
|
||||
state=1;
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
else if (strcmp(*argv,"-psk_identity") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
psk_identity=*(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-psk") == 0)
|
||||
{
|
||||
size_t j;
|
||||
|
||||
if (--argc < 1) goto bad;
|
||||
psk_key=*(++argv);
|
||||
for (j = 0; j < strlen(psk_key); j++)
|
||||
{
|
||||
if (isxdigit((int)psk_key[j]))
|
||||
continue;
|
||||
BIO_printf(bio_err,"Not a hex number '%s'\n",*argv);
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SSL2
|
||||
else if (strcmp(*argv,"-ssl2") == 0)
|
||||
meth=SSLv2_client_method();
|
||||
@@ -602,7 +480,7 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-dtls1") == 0)
|
||||
{
|
||||
meth=DTLSv1_client_method();
|
||||
socket_type=SOCK_DGRAM;
|
||||
sock_type=SOCK_DGRAM;
|
||||
}
|
||||
else if (strcmp(*argv,"-timeout") == 0)
|
||||
enable_timeouts=1;
|
||||
@@ -612,6 +490,10 @@ int MAIN(int argc, char **argv)
|
||||
socket_mtu = atol(*(++argv));
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(*argv,"-fallback_scsv") == 0)
|
||||
{
|
||||
fallback_scsv = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-bugs") == 0)
|
||||
bugs=1;
|
||||
else if (strcmp(*argv,"-keyform") == 0)
|
||||
@@ -649,14 +531,18 @@ int MAIN(int argc, char **argv)
|
||||
off|=SSL_OP_NO_SSLv3;
|
||||
else if (strcmp(*argv,"-no_ssl2") == 0)
|
||||
off|=SSL_OP_NO_SSLv2;
|
||||
else if (strcmp(*argv,"-no_comp") == 0)
|
||||
{ off|=SSL_OP_NO_COMPRESSION; }
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
else if (strcmp(*argv,"-no_ticket") == 0)
|
||||
{ off|=SSL_OP_NO_TICKET; }
|
||||
#endif
|
||||
else if (strcmp(*argv,"-serverpref") == 0)
|
||||
off|=SSL_OP_CIPHER_SERVER_PREFERENCE;
|
||||
else if (strcmp(*argv,"-legacy_renegotiation") == 0)
|
||||
off|=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION;
|
||||
else if (strcmp(*argv,"-legacy_server_connect") == 0)
|
||||
{ off|=SSL_OP_LEGACY_SERVER_CONNECT; }
|
||||
else if (strcmp(*argv,"-no_legacy_server_connect") == 0)
|
||||
{ clr|=SSL_OP_LEGACY_SERVER_CONNECT; }
|
||||
else if (strcmp(*argv,"-cipher") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -731,26 +617,6 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK)
|
||||
if (jpake_secret)
|
||||
{
|
||||
if (psk_key)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't use JPAKE and PSK together\n");
|
||||
goto end;
|
||||
}
|
||||
psk_identity = "JPAKE";
|
||||
}
|
||||
|
||||
if (cipher)
|
||||
{
|
||||
BIO_printf(bio_err, "JPAKE sets cipher to PSK\n");
|
||||
goto end;
|
||||
}
|
||||
cipher = "PSK";
|
||||
#endif
|
||||
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
SSL_load_error_strings();
|
||||
|
||||
@@ -766,7 +632,6 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
if (!app_passwd(bio_err, passarg, NULL, &pass, NULL))
|
||||
{
|
||||
@@ -834,9 +699,6 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (vpm)
|
||||
SSL_CTX_set1_param(ctx, vpm);
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (ssl_client_engine)
|
||||
{
|
||||
@@ -851,26 +713,17 @@ bad:
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
#ifdef OPENSSL_NO_JPAKE
|
||||
if (psk_key != NULL)
|
||||
#else
|
||||
if (psk_key != NULL || jpake_secret)
|
||||
#endif
|
||||
{
|
||||
if (c_debug)
|
||||
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
|
||||
if (bugs)
|
||||
SSL_CTX_set_options(ctx,SSL_OP_ALL|off);
|
||||
else
|
||||
SSL_CTX_set_options(ctx,off);
|
||||
|
||||
if (clr)
|
||||
SSL_CTX_clear_options(ctx, clr);
|
||||
/* DTLS: partial reads end up discarding unread UDP bytes :-(
|
||||
* Setting read ahead solves this problem.
|
||||
*/
|
||||
if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1);
|
||||
if (sock_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1);
|
||||
|
||||
if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
|
||||
if (cipher != NULL)
|
||||
@@ -896,6 +749,8 @@ bad:
|
||||
/* goto end; */
|
||||
}
|
||||
|
||||
store = SSL_CTX_get_cert_store(ctx);
|
||||
X509_STORE_set_flags(store, vflags);
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
if (servername != NULL)
|
||||
{
|
||||
@@ -929,6 +784,10 @@ bad:
|
||||
SSL_set_session(con, sess);
|
||||
SSL_SESSION_free(sess);
|
||||
}
|
||||
|
||||
if (fallback_scsv)
|
||||
SSL_set_mode(con, SSL_MODE_SEND_FALLBACK_SCSV);
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
if (servername != NULL)
|
||||
{
|
||||
@@ -940,6 +799,7 @@ bad:
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_KRB5
|
||||
if (con && (con->kssl_ctx = kssl_ctx_new()) != NULL)
|
||||
{
|
||||
@@ -947,15 +807,10 @@ bad:
|
||||
}
|
||||
#endif /* OPENSSL_NO_KRB5 */
|
||||
/* SSL_set_cipher_list(con,"RC4-MD5"); */
|
||||
#if 0
|
||||
#ifdef TLSEXT_TYPE_opaque_prf_input
|
||||
SSL_set_tlsext_opaque_prf_input(con, "Test client", 11);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
re_start:
|
||||
|
||||
if (init_client(&s,host,port,socket_type) == 0)
|
||||
if (init_client(&s,host,port,sock_type) == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"connect:errno=%d\n",get_last_socket_error());
|
||||
SHUTDOWN(s);
|
||||
@@ -979,7 +834,6 @@ re_start:
|
||||
|
||||
if ( SSL_version(con) == DTLS1_VERSION)
|
||||
{
|
||||
struct timeval timeout;
|
||||
|
||||
sbio=BIO_new_dgram(s,BIO_NOCLOSE);
|
||||
if (getsockname(s, &peer, (void *)&peerlen) < 0)
|
||||
@@ -992,7 +846,7 @@ re_start:
|
||||
|
||||
(void)BIO_ctrl_set_connected(sbio, 1, &peer);
|
||||
|
||||
if (enable_timeouts)
|
||||
if ( enable_timeouts)
|
||||
{
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = DGRAM_RCV_TIMEOUT;
|
||||
@@ -1196,6 +1050,12 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
FD_ZERO(&readfds);
|
||||
FD_ZERO(&writefds);
|
||||
|
||||
if ((SSL_version(con) == DTLS1_VERSION) &&
|
||||
DTLSv1_get_timeout(con, &timeout))
|
||||
timeoutp = &timeout;
|
||||
else
|
||||
timeoutp = NULL;
|
||||
|
||||
if (SSL_in_init(con) && !SSL_total_renegotiations(con))
|
||||
{
|
||||
in_init=1;
|
||||
@@ -1207,14 +1067,6 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
if (in_init)
|
||||
{
|
||||
in_init=0;
|
||||
#if 0 /* This test doesn't really work as intended (needs to be fixed) */
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
if (servername != NULL && !SSL_session_reused(con))
|
||||
{
|
||||
BIO_printf(bio_c_out,"Server did %sacknowledge servername extension.\n",tlsextcbp.ack?"":"not ");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (sess_out)
|
||||
{
|
||||
BIO *stmp = BIO_new_file(sess_out, "w");
|
||||
@@ -1252,22 +1104,22 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
|
||||
if (!ssl_pending)
|
||||
{
|
||||
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined (OPENSSL_SYS_BEOS_R5)
|
||||
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE)
|
||||
if (tty_on)
|
||||
{
|
||||
if (read_tty) openssl_fdset(fileno(stdin),&readfds);
|
||||
if (write_tty) openssl_fdset(fileno(stdout),&writefds);
|
||||
if (read_tty) FD_SET(fileno(stdin),&readfds);
|
||||
if (write_tty) FD_SET(fileno(stdout),&writefds);
|
||||
}
|
||||
if (read_ssl)
|
||||
openssl_fdset(SSL_get_fd(con),&readfds);
|
||||
FD_SET(SSL_get_fd(con),&readfds);
|
||||
if (write_ssl)
|
||||
openssl_fdset(SSL_get_fd(con),&writefds);
|
||||
FD_SET(SSL_get_fd(con),&writefds);
|
||||
#else
|
||||
if(!tty_on || !write_tty) {
|
||||
if (read_ssl)
|
||||
openssl_fdset(SSL_get_fd(con),&readfds);
|
||||
FD_SET(SSL_get_fd(con),&readfds);
|
||||
if (write_ssl)
|
||||
openssl_fdset(SSL_get_fd(con),&writefds);
|
||||
FD_SET(SSL_get_fd(con),&writefds);
|
||||
}
|
||||
#endif
|
||||
/* printf("mode tty(%d %d%d) ssl(%d%d)\n",
|
||||
@@ -1300,7 +1152,7 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
|
||||
#endif
|
||||
} else i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,NULL);
|
||||
NULL,timeoutp);
|
||||
}
|
||||
#elif defined(OPENSSL_SYS_NETWARE)
|
||||
if(!write_tty) {
|
||||
@@ -1310,30 +1162,11 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,&tv);
|
||||
} else i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,NULL);
|
||||
NULL,timeoutp);
|
||||
}
|
||||
#elif defined(OPENSSL_SYS_BEOS_R5)
|
||||
/* Under BeOS-R5 the situation is similar to DOS */
|
||||
i=0;
|
||||
stdin_set = 0;
|
||||
(void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
|
||||
if(!write_tty) {
|
||||
if(read_tty) {
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,&tv);
|
||||
if (read(fileno(stdin), sbuf, 0) >= 0)
|
||||
stdin_set = 1;
|
||||
if (!i && (stdin_set != 1 || !read_tty))
|
||||
continue;
|
||||
} else i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,NULL);
|
||||
}
|
||||
(void)fcntl(fileno(stdin), F_SETFL, 0);
|
||||
#else
|
||||
i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,NULL);
|
||||
NULL,timeoutp);
|
||||
#endif
|
||||
if ( i < 0)
|
||||
{
|
||||
@@ -1344,6 +1177,11 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
}
|
||||
}
|
||||
|
||||
if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_handle_timeout(con) > 0)
|
||||
{
|
||||
BIO_printf(bio_err,"TIMEOUT occured\n");
|
||||
}
|
||||
|
||||
if (!ssl_pending && FD_ISSET(SSL_get_fd(con),&writefds))
|
||||
{
|
||||
k=SSL_write(con,&(cbuf[cbuf_off]),
|
||||
@@ -1384,7 +1222,6 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
if (cbuf_len != 0)
|
||||
{
|
||||
BIO_printf(bio_c_out,"shutdown\n");
|
||||
ret = 0;
|
||||
goto shut;
|
||||
}
|
||||
else
|
||||
@@ -1412,8 +1249,8 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
goto shut;
|
||||
}
|
||||
}
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
|
||||
/* Assume Windows/DOS/BeOS can always write */
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
|
||||
/* Assume Windows/DOS can always write */
|
||||
else if (!ssl_pending && write_tty)
|
||||
#else
|
||||
else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
|
||||
@@ -1422,12 +1259,11 @@ SSL_set_tlsext_status_ids(con, ids);
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ascii2ebcdic(&(sbuf[sbuf_off]),&(sbuf[sbuf_off]),sbuf_len);
|
||||
#endif
|
||||
i=raw_write_stdout(&(sbuf[sbuf_off]),sbuf_len);
|
||||
i=write(fileno(stdout),&(sbuf[sbuf_off]),sbuf_len);
|
||||
|
||||
if (i <= 0)
|
||||
{
|
||||
BIO_printf(bio_c_out,"DONE\n");
|
||||
ret = 0;
|
||||
goto shut;
|
||||
/* goto end; */
|
||||
}
|
||||
@@ -1482,12 +1318,10 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
BIO_printf(bio_c_out,"read X BLOCK\n");
|
||||
break;
|
||||
case SSL_ERROR_SYSCALL:
|
||||
ret=get_last_socket_error();
|
||||
BIO_printf(bio_err,"read:errno=%d\n",ret);
|
||||
BIO_printf(bio_err,"read:errno=%d\n",get_last_socket_error());
|
||||
goto shut;
|
||||
case SSL_ERROR_ZERO_RETURN:
|
||||
BIO_printf(bio_c_out,"closed\n");
|
||||
ret=0;
|
||||
goto shut;
|
||||
case SSL_ERROR_SSL:
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -1503,9 +1337,7 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
|
||||
#endif
|
||||
#elif defined (OPENSSL_SYS_NETWARE)
|
||||
else if (_kbhit())
|
||||
#elif defined(OPENSSL_SYS_BEOS_R5)
|
||||
else if (stdin_set)
|
||||
else if (_kbhit())
|
||||
#else
|
||||
else if (FD_ISSET(fileno(stdin),&readfds))
|
||||
#endif
|
||||
@@ -1514,7 +1346,7 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
{
|
||||
int j, lf_num;
|
||||
|
||||
i=raw_read_stdin(cbuf,BUFSIZZ/2);
|
||||
i=read(fileno(stdin),cbuf,BUFSIZZ/2);
|
||||
lf_num = 0;
|
||||
/* both loops are skipped when i <= 0 */
|
||||
for (j = 0; j < i; j++)
|
||||
@@ -1533,12 +1365,11 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
assert(lf_num == 0);
|
||||
}
|
||||
else
|
||||
i=raw_read_stdin(cbuf,BUFSIZZ);
|
||||
i=read(fileno(stdin),cbuf,BUFSIZZ);
|
||||
|
||||
if ((!c_ign_eof) && ((i <= 0) || (cbuf[0] == 'Q')))
|
||||
{
|
||||
BIO_printf(bio_err,"DONE\n");
|
||||
ret=0;
|
||||
goto shut;
|
||||
}
|
||||
|
||||
@@ -1561,20 +1392,14 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
read_tty=0;
|
||||
}
|
||||
}
|
||||
|
||||
ret=0;
|
||||
shut:
|
||||
if (in_init)
|
||||
print_stuff(bio_c_out,con,full_log);
|
||||
SSL_shutdown(con);
|
||||
SHUTDOWN(SSL_get_fd(con));
|
||||
ret=0;
|
||||
end:
|
||||
if (con != NULL)
|
||||
{
|
||||
if (prexit != 0)
|
||||
print_stuff(bio_c_out,con,1);
|
||||
SSL_free(con);
|
||||
}
|
||||
if(prexit) print_stuff(bio_c_out,con,1);
|
||||
if (con != NULL) SSL_free(con);
|
||||
if (con2 != NULL) SSL_free(con2);
|
||||
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||
if (cert)
|
||||
X509_free(cert);
|
||||
@@ -1603,7 +1428,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
||||
char buf[BUFSIZ];
|
||||
STACK_OF(X509) *sk;
|
||||
STACK_OF(X509_NAME) *sk2;
|
||||
const SSL_CIPHER *c;
|
||||
SSL_CIPHER *c;
|
||||
X509_NAME *xn;
|
||||
int j,i;
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
@@ -1711,6 +1536,8 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
||||
EVP_PKEY_bits(pktmp));
|
||||
EVP_PKEY_free(pktmp);
|
||||
}
|
||||
BIO_printf(bio, "Secure Renegotiation IS%s supported\n",
|
||||
SSL_get_secure_renegotiation_support(s) ? "" : " NOT");
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
comp=SSL_get_current_compression(s);
|
||||
expansion=SSL_get_current_expansion(s);
|
||||
@@ -1754,5 +1581,4 @@ static int ocsp_resp_cb(SSL *s, void *arg)
|
||||
OCSP_RESPONSE_free(rsp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* ndef OPENSSL_NO_TLSEXT */
|
||||
|
||||
385
apps/s_server.c
385
apps/s_server.c
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -113,32 +113,6 @@
|
||||
* ECC cipher suite support in OpenSSL originally developed by
|
||||
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright 2005 Nokia. All rights reserved.
|
||||
*
|
||||
* The portions of the attached software ("Contribution") is developed by
|
||||
* Nokia Corporation and is licensed pursuant to the OpenSSL open source
|
||||
* license.
|
||||
*
|
||||
* The Contribution, originally written by Mika Kousa and Pasi Eronen of
|
||||
* Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
|
||||
* support (see RFC 4279) to OpenSSL.
|
||||
*
|
||||
* No patent licenses or other rights except those expressly stated in
|
||||
* the OpenSSL open source license shall be deemed granted or received
|
||||
* expressly, by implication, estoppel, or otherwise.
|
||||
*
|
||||
* No assurances are provided by Nokia that the Contribution does not
|
||||
* infringe the patent or other intellectual property rights of any third
|
||||
* party or that the license provides you with all the necessary rights
|
||||
* to make use of the Contribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
|
||||
* ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
|
||||
* SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
|
||||
* OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
|
||||
* OTHERWISE.
|
||||
*/
|
||||
|
||||
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||
* deprecated functions for openssl-internal code */
|
||||
@@ -147,11 +121,11 @@
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <openssl/e_os2.h>
|
||||
#ifdef OPENSSL_NO_STDIO
|
||||
#define APPS_WIN16
|
||||
@@ -189,15 +163,19 @@ typedef unsigned int u_int;
|
||||
#include "s_apps.h"
|
||||
#include "timeouts.h"
|
||||
|
||||
#ifdef OPENSSL_SYS_WINCE
|
||||
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
||||
#ifdef fileno
|
||||
#undef fileno
|
||||
#endif
|
||||
#define fileno(a) (int)_fileno(a)
|
||||
#endif
|
||||
|
||||
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
|
||||
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
||||
#undef FIONBIO
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_BEOS_R5)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength);
|
||||
#endif
|
||||
@@ -218,6 +196,14 @@ static DH *get_dh512(void);
|
||||
static void s_server_init(void);
|
||||
#endif
|
||||
|
||||
#ifndef S_ISDIR
|
||||
# if defined(_S_IFMT) && defined(_S_IFDIR)
|
||||
# define S_ISDIR(a) (((a) & _S_IFMT) == _S_IFDIR)
|
||||
# else
|
||||
# define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_DH
|
||||
static unsigned char dh512_p[]={
|
||||
0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
|
||||
@@ -259,7 +245,7 @@ static int accept_socket= -1;
|
||||
#undef PROG
|
||||
#define PROG s_server_main
|
||||
|
||||
extern int verify_depth, verify_return_error;
|
||||
extern int verify_depth;
|
||||
|
||||
static char *cipher=NULL;
|
||||
static int s_server_verify=SSL_VERIFY_NONE;
|
||||
@@ -302,72 +288,6 @@ static long socket_mtu;
|
||||
static int cert_chain = 0;
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
static char *psk_identity="Client_identity";
|
||||
char *psk_key=NULL; /* by default PSK is not used */
|
||||
|
||||
static unsigned int psk_server_cb(SSL *ssl, const char *identity,
|
||||
unsigned char *psk, unsigned int max_psk_len)
|
||||
{
|
||||
unsigned int psk_len = 0;
|
||||
int ret;
|
||||
BIGNUM *bn = NULL;
|
||||
|
||||
if (s_debug)
|
||||
BIO_printf(bio_s_out,"psk_server_cb\n");
|
||||
if (!identity)
|
||||
{
|
||||
BIO_printf(bio_err,"Error: client did not send PSK identity\n");
|
||||
goto out_err;
|
||||
}
|
||||
if (s_debug)
|
||||
BIO_printf(bio_s_out,"identity_len=%d identity=%s\n",
|
||||
identity ? (int)strlen(identity) : 0, identity);
|
||||
|
||||
/* here we could lookup the given identity e.g. from a database */
|
||||
if (strcmp(identity, psk_identity) != 0)
|
||||
{
|
||||
BIO_printf(bio_s_out, "PSK error: client identity not found"
|
||||
" (got '%s' expected '%s')\n", identity,
|
||||
psk_identity);
|
||||
goto out_err;
|
||||
}
|
||||
if (s_debug)
|
||||
BIO_printf(bio_s_out, "PSK client identity found\n");
|
||||
|
||||
/* convert the PSK key to binary */
|
||||
ret = BN_hex2bn(&bn, psk_key);
|
||||
if (!ret)
|
||||
{
|
||||
BIO_printf(bio_err,"Could not convert PSK key '%s' to BIGNUM\n", psk_key);
|
||||
if (bn)
|
||||
BN_free(bn);
|
||||
return 0;
|
||||
}
|
||||
if (BN_num_bytes(bn) > (int)max_psk_len)
|
||||
{
|
||||
BIO_printf(bio_err,"psk buffer of callback is too small (%d) for key (%d)\n",
|
||||
max_psk_len, BN_num_bytes(bn));
|
||||
BN_free(bn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = BN_bn2bin(bn, psk);
|
||||
BN_free(bn);
|
||||
|
||||
if (ret < 0)
|
||||
goto out_err;
|
||||
psk_len = (unsigned int)ret;
|
||||
|
||||
if (s_debug)
|
||||
BIO_printf(bio_s_out, "fetched PSK len=%d\n", psk_len);
|
||||
return psk_len;
|
||||
out_err:
|
||||
if (s_debug)
|
||||
BIO_printf(bio_err, "Error in PSK server callback\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MONOLITH
|
||||
static void s_server_init(void)
|
||||
@@ -432,7 +352,7 @@ static void sv_usage(void)
|
||||
#ifndef OPENSSL_NO_ECDH
|
||||
BIO_printf(bio_err," -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" \
|
||||
" Use \"openssl ecparam -list_curves\" for all names\n" \
|
||||
" (default is nistp256).\n");
|
||||
" (default is sect163r2).\n");
|
||||
#endif
|
||||
#ifdef FIONBIO
|
||||
BIO_printf(bio_err," -nbio - Run with non-blocking IO\n");
|
||||
@@ -449,13 +369,6 @@ static void sv_usage(void)
|
||||
BIO_printf(bio_err," -serverpref - Use server's cipher preferences\n");
|
||||
BIO_printf(bio_err," -quiet - No server output\n");
|
||||
BIO_printf(bio_err," -no_tmp_rsa - Do not generate a tmp RSA key\n");
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
BIO_printf(bio_err," -psk_hint arg - PSK identity hint to use\n");
|
||||
BIO_printf(bio_err," -psk arg - PSK in hex (without 0x)\n");
|
||||
# ifndef OPENSSL_NO_JPAKE
|
||||
BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n");
|
||||
# endif
|
||||
#endif
|
||||
BIO_printf(bio_err," -ssl2 - Just talk SSLv2\n");
|
||||
BIO_printf(bio_err," -ssl3 - Just talk SSLv3\n");
|
||||
BIO_printf(bio_err," -tls1 - Just talk TLSv1\n");
|
||||
@@ -491,6 +404,7 @@ static void sv_usage(void)
|
||||
BIO_printf(bio_err," not specified (default is %s)\n",TEST_CERT2);
|
||||
BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n");
|
||||
BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n");
|
||||
BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -669,11 +583,11 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg)
|
||||
|
||||
if (servername)
|
||||
{
|
||||
if (strcmp(servername,p->servername))
|
||||
if (strcasecmp(servername,p->servername))
|
||||
return p->extension_error;
|
||||
if (ctx2)
|
||||
{
|
||||
BIO_printf(p->biodebug,"Switching server context.\n");
|
||||
BIO_printf(p->biodebug,"Swiching server context.\n");
|
||||
SSL_set_SSL_CTX(s,ctx2);
|
||||
}
|
||||
}
|
||||
@@ -712,7 +626,7 @@ static int cert_status_cb(SSL *s, void *arg)
|
||||
int use_ssl;
|
||||
unsigned char *rspder = NULL;
|
||||
int rspderlen;
|
||||
STACK_OF(STRING) *aia = NULL;
|
||||
STACK *aia = NULL;
|
||||
X509 *x = NULL;
|
||||
X509_STORE_CTX inctx;
|
||||
X509_OBJECT obj;
|
||||
@@ -734,7 +648,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
|
||||
aia = X509_get1_ocsp(x);
|
||||
if (aia)
|
||||
{
|
||||
if (!OCSP_parse_url(sk_STRING_value(aia, 0),
|
||||
if (!OCSP_parse_url(sk_value(aia, 0),
|
||||
&host, &port, &path, &use_ssl))
|
||||
{
|
||||
BIO_puts(err, "cert_status: can't parse AIA URL\n");
|
||||
@@ -742,7 +656,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
|
||||
}
|
||||
if (srctx->verbose)
|
||||
BIO_printf(err, "cert_status: AIA URL: %s\n",
|
||||
sk_STRING_value(aia, 0));
|
||||
sk_value(aia, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -826,7 +740,6 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
#ifndef OPENSSL_NO_JPAKE
|
||||
@@ -835,8 +748,8 @@ static char *jpake_secret = NULL;
|
||||
|
||||
int MAIN(int argc, char *argv[])
|
||||
{
|
||||
X509_VERIFY_PARAM *vpm = NULL;
|
||||
int badarg = 0;
|
||||
X509_STORE *store = NULL;
|
||||
int vflags = 0;
|
||||
short port=PORT;
|
||||
char *CApath=NULL,*CAfile=NULL;
|
||||
unsigned char *context = NULL;
|
||||
@@ -849,8 +762,8 @@ int MAIN(int argc, char *argv[])
|
||||
int off=0;
|
||||
int no_tmp_rsa=0,no_dhe=0,no_ecdhe=0,nocert=0;
|
||||
int state=0;
|
||||
const SSL_METHOD *meth=NULL;
|
||||
int socket_type=SOCK_STREAM;
|
||||
SSL_METHOD *meth=NULL;
|
||||
int socket_type=SOCK_STREAM;
|
||||
ENGINE *e=NULL;
|
||||
char *inrand=NULL;
|
||||
int s_cert_format = FORMAT_PEM, s_key_format = FORMAT_PEM;
|
||||
@@ -859,6 +772,7 @@ int MAIN(int argc, char *argv[])
|
||||
int s_dcert_format = FORMAT_PEM, s_dkey_format = FORMAT_PEM;
|
||||
X509 *s_cert = NULL, *s_dcert = NULL;
|
||||
EVP_PKEY *s_key = NULL, *s_dkey = NULL;
|
||||
int no_cache = 0;
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
EVP_PKEY *s_key2 = NULL;
|
||||
X509 *s_cert2 = NULL;
|
||||
@@ -866,17 +780,8 @@ int MAIN(int argc, char *argv[])
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
tlsextctx tlsextcbp = {NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING};
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
/* by default do not send a PSK identity hint */
|
||||
static char *psk_identity_hint=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();
|
||||
#endif
|
||||
|
||||
local_argc=argc;
|
||||
local_argv=argv;
|
||||
@@ -1001,16 +906,20 @@ int MAIN(int argc, char *argv[])
|
||||
if (--argc < 1) goto bad;
|
||||
CApath= *(++argv);
|
||||
}
|
||||
else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm))
|
||||
else if (strcmp(*argv,"-no_cache") == 0)
|
||||
no_cache = 1;
|
||||
else if (strcmp(*argv,"-crl_check") == 0)
|
||||
{
|
||||
if (badarg)
|
||||
goto bad;
|
||||
continue;
|
||||
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||
}
|
||||
else if (strcmp(*argv,"-crl_check_all") == 0)
|
||||
{
|
||||
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||
}
|
||||
else if (strcmp(*argv,"-verify_return_error") == 0)
|
||||
verify_return_error = 1;
|
||||
else if (strcmp(*argv,"-serverpref") == 0)
|
||||
{ off|=SSL_OP_CIPHER_SERVER_PREFERENCE; }
|
||||
else if (strcmp(*argv,"-legacy_renegotiation") == 0)
|
||||
off|=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION;
|
||||
else if (strcmp(*argv,"-cipher") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -1083,27 +992,6 @@ int MAIN(int argc, char *argv[])
|
||||
{ no_dhe=1; }
|
||||
else if (strcmp(*argv,"-no_ecdhe") == 0)
|
||||
{ no_ecdhe=1; }
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
else if (strcmp(*argv,"-psk_hint") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
psk_identity_hint= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-psk") == 0)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (--argc < 1) goto bad;
|
||||
psk_key=*(++argv);
|
||||
for (i=0; i<strlen(psk_key); i++)
|
||||
{
|
||||
if (isxdigit((int)psk_key[i]))
|
||||
continue;
|
||||
BIO_printf(bio_err,"Not a hex number '%s'\n",*argv);
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(*argv,"-www") == 0)
|
||||
{ www=1; }
|
||||
else if (strcmp(*argv,"-WWW") == 0)
|
||||
@@ -1116,8 +1004,6 @@ int MAIN(int argc, char *argv[])
|
||||
{ off|=SSL_OP_NO_SSLv3; }
|
||||
else if (strcmp(*argv,"-no_tls1") == 0)
|
||||
{ off|=SSL_OP_NO_TLSv1; }
|
||||
else if (strcmp(*argv,"-no_comp") == 0)
|
||||
{ off|=SSL_OP_NO_COMPRESSION; }
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
else if (strcmp(*argv,"-no_ticket") == 0)
|
||||
{ off|=SSL_OP_NO_TICKET; }
|
||||
@@ -1187,7 +1073,7 @@ int MAIN(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#endif
|
||||
#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK)
|
||||
#ifndef OPENSSL_NO_JPAKE
|
||||
else if (strcmp(*argv,"-jpake") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -1209,25 +1095,13 @@ bad:
|
||||
sv_usage();
|
||||
goto end;
|
||||
}
|
||||
|
||||
#if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK)
|
||||
if (jpake_secret)
|
||||
#ifndef OPENSSL_NO_DTLS1
|
||||
if (www && socket_type == SOCK_DGRAM)
|
||||
{
|
||||
if (psk_key)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Can't use JPAKE and PSK together\n");
|
||||
goto end;
|
||||
}
|
||||
psk_identity = "JPAKE";
|
||||
if (cipher)
|
||||
{
|
||||
BIO_printf(bio_err, "JPAKE sets cipher to PSK\n");
|
||||
goto end;
|
||||
}
|
||||
cipher = "PSK";
|
||||
BIO_printf(bio_err,
|
||||
"Can't use -HTTP, -www or -WWW with DTLS\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SSL_load_error_strings();
|
||||
@@ -1292,8 +1166,6 @@ bad:
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if (s_dcert_file)
|
||||
{
|
||||
|
||||
@@ -1388,8 +1260,10 @@ bad:
|
||||
if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1);
|
||||
|
||||
if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
|
||||
|
||||
SSL_CTX_sess_set_cache_size(ctx,128);
|
||||
if (no_cache)
|
||||
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
|
||||
else
|
||||
SSL_CTX_sess_set_cache_size(ctx,128);
|
||||
|
||||
#if 0
|
||||
if (cipher == NULL) cipher=getenv("SSL_CIPHER");
|
||||
@@ -1410,9 +1284,8 @@ bad:
|
||||
ERR_print_errors(bio_err);
|
||||
/* goto end; */
|
||||
}
|
||||
if (vpm)
|
||||
SSL_CTX_set1_param(ctx, vpm);
|
||||
|
||||
store = SSL_CTX_get_cert_store(ctx);
|
||||
X509_STORE_set_flags(store, vflags);
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
if (s_cert2)
|
||||
{
|
||||
@@ -1448,25 +1321,31 @@ bad:
|
||||
if (bugs) SSL_CTX_set_options(ctx2,SSL_OP_ALL);
|
||||
if (hack) SSL_CTX_set_options(ctx2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
|
||||
SSL_CTX_set_options(ctx2,off);
|
||||
|
||||
/* DTLS: partial reads end up discarding unread UDP bytes :-(
|
||||
* Setting read ahead solves this problem.
|
||||
*/
|
||||
if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx2, 1);
|
||||
|
||||
|
||||
if (state) SSL_CTX_set_info_callback(ctx2,apps_ssl_info_callback);
|
||||
|
||||
SSL_CTX_sess_set_cache_size(ctx2,128);
|
||||
if (no_cache)
|
||||
SSL_CTX_set_session_cache_mode(ctx2,SSL_SESS_CACHE_OFF);
|
||||
else
|
||||
SSL_CTX_sess_set_cache_size(ctx2,128);
|
||||
|
||||
if ((!SSL_CTX_load_verify_locations(ctx2,CAfile,CApath)) ||
|
||||
(!SSL_CTX_set_default_verify_paths(ctx2)))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
if (vpm)
|
||||
SSL_CTX_set1_param(ctx2, vpm);
|
||||
store = SSL_CTX_get_cert_store(ctx2);
|
||||
X509_STORE_set_flags(store, vflags);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef OPENSSL_NO_DH
|
||||
if (!no_dhe)
|
||||
{
|
||||
@@ -1542,10 +1421,10 @@ bad:
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_s_out,"Using default temp ECDH parameters\n");
|
||||
ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
|
||||
ecdh = EC_KEY_new_by_curve_name(NID_sect163r2);
|
||||
if (ecdh == NULL)
|
||||
{
|
||||
BIO_printf(bio_err, "unable to create curve (nistp256)\n");
|
||||
BIO_printf(bio_err, "unable to create curve (sect163r2)\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -1580,7 +1459,7 @@ bad:
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
if (ctx2)
|
||||
SSL_CTX_set_tmp_rsa_callback(ctx2,tmp_rsa_cb);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
if (!no_tmp_rsa && SSL_CTX_need_tmp_RSA(ctx))
|
||||
@@ -1613,34 +1492,11 @@ bad:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
#ifdef OPENSSL_NO_JPAKE
|
||||
if (psk_key != NULL)
|
||||
#else
|
||||
if (psk_key != NULL || jpake_secret)
|
||||
#endif
|
||||
{
|
||||
if (s_debug)
|
||||
BIO_printf(bio_s_out, "PSK key given or JPAKE in use, setting server callback\n");
|
||||
SSL_CTX_set_psk_server_callback(ctx, psk_server_cb);
|
||||
}
|
||||
|
||||
if (!SSL_CTX_use_psk_identity_hint(ctx, psk_identity_hint))
|
||||
{
|
||||
BIO_printf(bio_err,"error setting PSK identity hint to context\n");
|
||||
if (cipher != NULL)
|
||||
if(!SSL_CTX_set_cipher_list(ctx,cipher)) {
|
||||
BIO_printf(bio_err,"error setting cipher list\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cipher != NULL)
|
||||
{
|
||||
if(!SSL_CTX_set_cipher_list(ctx,cipher))
|
||||
{
|
||||
BIO_printf(bio_err,"error setting cipher list\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
if (ctx2 && !SSL_CTX_set_cipher_list(ctx2,cipher))
|
||||
{
|
||||
@@ -1649,11 +1505,15 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
SSL_CTX_set_verify(ctx,s_server_verify,verify_callback);
|
||||
SSL_CTX_set_session_id_context(ctx,(void*)&s_server_session_id_context,
|
||||
sizeof s_server_session_id_context);
|
||||
|
||||
/* Set DTLS cookie generation and verification callbacks */
|
||||
SSL_CTX_set_cookie_generate_cb(ctx, generate_cookie_callback);
|
||||
SSL_CTX_set_cookie_verify_cb(ctx, verify_cookie_callback);
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
if (ctx2)
|
||||
{
|
||||
@@ -1668,7 +1528,6 @@ bad:
|
||||
SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (CAfile != NULL)
|
||||
{
|
||||
SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile));
|
||||
@@ -1677,9 +1536,7 @@ bad:
|
||||
SSL_CTX_set_client_CA_list(ctx2,SSL_load_client_CA_file(CAfile));
|
||||
#endif
|
||||
}
|
||||
|
||||
BIO_printf(bio_s_out,"ACCEPT\n");
|
||||
(void)BIO_flush(bio_s_out);
|
||||
if (www)
|
||||
do_server(port,socket_type,&accept_socket,www_body, context);
|
||||
else
|
||||
@@ -1701,6 +1558,12 @@ end:
|
||||
if (dpass)
|
||||
OPENSSL_free(dpass);
|
||||
#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);
|
||||
@@ -1750,8 +1613,11 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
unsigned long l;
|
||||
SSL *con=NULL;
|
||||
BIO *sbio;
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
|
||||
struct timeval timeout;
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
|
||||
struct timeval tv;
|
||||
#else
|
||||
struct timeval *timeoutp;
|
||||
#endif
|
||||
|
||||
if ((buf=OPENSSL_malloc(bufsize)) == NULL)
|
||||
@@ -1800,19 +1666,13 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
strlen((char *)context));
|
||||
}
|
||||
SSL_clear(con);
|
||||
#if 0
|
||||
#ifdef TLSEXT_TYPE_opaque_prf_input
|
||||
SSL_set_tlsext_opaque_prf_input(con, "Test server", 11);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (SSL_version(con) == DTLS1_VERSION)
|
||||
{
|
||||
struct timeval timeout;
|
||||
|
||||
sbio=BIO_new_dgram(s,BIO_NOCLOSE);
|
||||
|
||||
if (enable_timeouts)
|
||||
if ( enable_timeouts)
|
||||
{
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = DGRAM_RCV_TIMEOUT;
|
||||
@@ -1823,6 +1683,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout);
|
||||
}
|
||||
|
||||
|
||||
if (socket_mtu > 28)
|
||||
{
|
||||
SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
|
||||
@@ -1885,10 +1746,10 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
if (!read_from_sslcon)
|
||||
{
|
||||
FD_ZERO(&readfds);
|
||||
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_BEOS_R5)
|
||||
openssl_fdset(fileno(stdin),&readfds);
|
||||
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE)
|
||||
FD_SET(fileno(stdin),&readfds);
|
||||
#endif
|
||||
openssl_fdset(s,&readfds);
|
||||
FD_SET(s,&readfds);
|
||||
/* Note: under VMS with SOCKETSHR the second parameter is
|
||||
* currently of type (int *) whereas under other systems
|
||||
* it is (void *) if you don't have a cast it will choke
|
||||
@@ -1907,19 +1768,20 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
if((i < 0) || (!i && !_kbhit() ) )continue;
|
||||
if(_kbhit())
|
||||
read_from_terminal = 1;
|
||||
#elif defined(OPENSSL_SYS_BEOS_R5)
|
||||
/* Under BeOS-R5 the situation is similar to DOS */
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
(void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
|
||||
i=select(width,(void *)&readfds,NULL,NULL,&tv);
|
||||
if ((i < 0) || (!i && read(fileno(stdin), buf, 0) < 0))
|
||||
continue;
|
||||
if (read(fileno(stdin), buf, 0) >= 0)
|
||||
read_from_terminal = 1;
|
||||
(void)fcntl(fileno(stdin), F_SETFL, 0);
|
||||
#else
|
||||
i=select(width,(void *)&readfds,NULL,NULL,NULL);
|
||||
if ((SSL_version(con) == DTLS1_VERSION) &&
|
||||
DTLSv1_get_timeout(con, &timeout))
|
||||
timeoutp = &timeout;
|
||||
else
|
||||
timeoutp = NULL;
|
||||
|
||||
i=select(width,(void *)&readfds,NULL,NULL,timeoutp);
|
||||
|
||||
if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_handle_timeout(con) > 0)
|
||||
{
|
||||
BIO_printf(bio_err,"TIMEOUT occured\n");
|
||||
}
|
||||
|
||||
if (i <= 0) continue;
|
||||
if (FD_ISSET(fileno(stdin),&readfds))
|
||||
read_from_terminal = 1;
|
||||
@@ -1933,7 +1795,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
{
|
||||
int j, lf_num;
|
||||
|
||||
i=raw_read_stdin(buf, bufsize/2);
|
||||
i=read(fileno(stdin), buf, bufsize/2);
|
||||
lf_num = 0;
|
||||
/* both loops are skipped when i <= 0 */
|
||||
for (j = 0; j < i; j++)
|
||||
@@ -1952,7 +1814,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
assert(lf_num == 0);
|
||||
}
|
||||
else
|
||||
i=raw_read_stdin(buf,bufsize);
|
||||
i=read(fileno(stdin),buf,bufsize);
|
||||
if (!s_quiet)
|
||||
{
|
||||
if ((i <= 0) || (buf[0] == 'Q'))
|
||||
@@ -1972,7 +1834,6 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
ret= -11;*/
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((buf[0] == 'r') &&
|
||||
((buf[1] == '\n') || (buf[1] == '\r')))
|
||||
{
|
||||
@@ -2069,8 +1930,10 @@ again:
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ascii2ebcdic(buf,buf,i);
|
||||
#endif
|
||||
raw_write_stdout(buf,
|
||||
(unsigned int)i);
|
||||
if (write(fileno(stdout),buf,
|
||||
(unsigned int)i) != i)
|
||||
goto err;
|
||||
|
||||
if (SSL_pending(con)) goto again;
|
||||
break;
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
@@ -2093,16 +1956,13 @@ again:
|
||||
}
|
||||
}
|
||||
err:
|
||||
if (con != NULL)
|
||||
{
|
||||
BIO_printf(bio_s_out,"shutting down SSL\n");
|
||||
BIO_printf(bio_s_out,"shutting down SSL\n");
|
||||
#if 1
|
||||
SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
|
||||
SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
|
||||
#else
|
||||
SSL_shutdown(con);
|
||||
SSL_shutdown(con);
|
||||
#endif
|
||||
SSL_free(con);
|
||||
}
|
||||
if (con != NULL) SSL_free(con);
|
||||
BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
|
||||
if (buf != NULL)
|
||||
{
|
||||
@@ -2180,6 +2040,8 @@ static int init_ssl_connection(SSL *con)
|
||||
con->kssl_ctx->client_princ);
|
||||
}
|
||||
#endif /* OPENSSL_NO_KRB5 */
|
||||
BIO_printf(bio_s_out, "Secure Renegotiation IS%s supported\n",
|
||||
SSL_get_secure_renegotiation_support(con) ? "" : " NOT");
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -2223,11 +2085,14 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
{
|
||||
char *buf=NULL;
|
||||
int ret=1;
|
||||
int i,j,k,blank,dot;
|
||||
int i,j,k,dot;
|
||||
struct stat st_buf;
|
||||
SSL *con;
|
||||
const SSL_CIPHER *c;
|
||||
SSL_CIPHER *c;
|
||||
BIO *io,*ssl_bio,*sbio;
|
||||
#ifdef RENEG
|
||||
long total_bytes;
|
||||
#endif
|
||||
|
||||
buf=OPENSSL_malloc(bufsize);
|
||||
if (buf == NULL) return(0);
|
||||
@@ -2298,7 +2163,6 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
SSL_set_msg_callback_arg(con, bio_s_out);
|
||||
}
|
||||
|
||||
blank=0;
|
||||
for (;;)
|
||||
{
|
||||
if (hack)
|
||||
@@ -2495,7 +2359,14 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
#endif
|
||||
|
||||
/* if a directory, do the index thang */
|
||||
if (app_isdir(p)>0)
|
||||
if (stat(p,&st_buf) < 0)
|
||||
{
|
||||
BIO_puts(io,text);
|
||||
BIO_printf(io,"Error accessing '%s'\r\n",p);
|
||||
ERR_print_errors(io);
|
||||
break;
|
||||
}
|
||||
if (S_ISDIR(st_buf.st_mode))
|
||||
{
|
||||
#if 0 /* must check buffer size */
|
||||
strcat(p,"/index.html");
|
||||
@@ -2528,7 +2399,9 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n");
|
||||
}
|
||||
/* send the file */
|
||||
#ifdef RENEG
|
||||
total_bytes=0;
|
||||
#endif
|
||||
for (;;)
|
||||
{
|
||||
i=BIO_read(file,buf,bufsize);
|
||||
|
||||
@@ -62,6 +62,12 @@
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef FLAT_INC
|
||||
#include "e_os2.h"
|
||||
#else
|
||||
#include "../e_os2.h"
|
||||
#endif
|
||||
|
||||
/* With IPv6, it looks like Digital has mixed up the proper order of
|
||||
recursive header file inclusion, resulting in the compiler complaining
|
||||
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
||||
@@ -231,11 +237,13 @@ static int ssl_sock_init(void)
|
||||
int init_client(int *sock, char *host, int port, int type)
|
||||
{
|
||||
unsigned char ip[4];
|
||||
short p=0;
|
||||
|
||||
if (!host_ip(host,&(ip[0])))
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
if (p != 0) port=p;
|
||||
return(init_client_ip(sock,ip,port,type));
|
||||
}
|
||||
|
||||
@@ -264,7 +272,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
|
||||
|
||||
if (s == INVALID_SOCKET) { perror("socket"); return(0); }
|
||||
|
||||
#if defined(SO_KEEPALIVE) && !defined(OPENSSL_SYS_MPE)
|
||||
#ifndef OPENSSL_SYS_MPE
|
||||
if (type == SOCK_STREAM)
|
||||
{
|
||||
i=0;
|
||||
@@ -274,7 +282,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
|
||||
#endif
|
||||
|
||||
if (connect(s,(struct sockaddr *)&them,sizeof(them)) == -1)
|
||||
{ closesocket(s); perror("connect"); return(0); }
|
||||
{ close(s); perror("connect"); return(0); }
|
||||
*sock=s;
|
||||
return(1);
|
||||
}
|
||||
@@ -283,7 +291,7 @@ int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, uns
|
||||
{
|
||||
int sock;
|
||||
char *name = NULL;
|
||||
int accept_socket = 0;
|
||||
int accept_socket;
|
||||
int i;
|
||||
|
||||
if (!init_server(&accept_socket,port,type)) return(0);
|
||||
@@ -321,7 +329,7 @@ static int init_server_long(int *sock, int port, char *ip, int type)
|
||||
{
|
||||
int ret=0;
|
||||
struct sockaddr_in server;
|
||||
int s= -1,i;
|
||||
int s= -1;
|
||||
|
||||
if (!ssl_sock_init()) return(0);
|
||||
|
||||
@@ -360,7 +368,6 @@ static int init_server_long(int *sock, int port, char *ip, int type)
|
||||
}
|
||||
/* Make it 128 for linux */
|
||||
if (type==SOCK_STREAM && listen(s,128) == -1) goto err;
|
||||
i=0;
|
||||
*sock=s;
|
||||
ret=1;
|
||||
err:
|
||||
@@ -378,7 +385,7 @@ static int init_server(int *sock, int port, int type)
|
||||
|
||||
static int do_accept(int acc_sock, int *sock, char **host)
|
||||
{
|
||||
int ret,i;
|
||||
int ret;
|
||||
struct hostent *h1,*h2;
|
||||
static struct sockaddr_in from;
|
||||
int len;
|
||||
@@ -401,6 +408,7 @@ redoit:
|
||||
if (ret == INVALID_SOCKET)
|
||||
{
|
||||
#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
|
||||
int i;
|
||||
i=WSAGetLastError();
|
||||
BIO_printf(bio_err,"accept error %d\n",i);
|
||||
#else
|
||||
@@ -455,7 +463,6 @@ redoit:
|
||||
BIO_printf(bio_err,"gethostbyname failure\n");
|
||||
return(0);
|
||||
}
|
||||
i=0;
|
||||
if (h2->h_addrtype != AF_INET)
|
||||
{
|
||||
BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
|
||||
|
||||
109
apps/s_time.c
109
apps/s_time.c
@@ -85,6 +85,54 @@
|
||||
#include OPENSSL_UNISTD
|
||||
#endif
|
||||
|
||||
#if !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
|
||||
#define TIMES
|
||||
#endif
|
||||
|
||||
#ifndef _IRIX
|
||||
#include <time.h>
|
||||
#endif
|
||||
#ifdef TIMES
|
||||
#include <sys/types.h>
|
||||
#include <sys/times.h>
|
||||
#endif
|
||||
|
||||
/* Depending on the VMS version, the tms structure is perhaps defined.
|
||||
The __TMS macro will show if it was. If it wasn't defined, we should
|
||||
undefine TIMES, since that tells the rest of the program how things
|
||||
should be handled. -- Richard Levitte */
|
||||
#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS)
|
||||
#undef TIMES
|
||||
#endif
|
||||
|
||||
#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE)
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
#if defined(sun) || defined(__ultrix)
|
||||
#define _POSIX_SOURCE
|
||||
#include <limits.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
/* The following if from times(3) man page. It may need to be changed
|
||||
*/
|
||||
#ifndef HZ
|
||||
# ifdef _SC_CLK_TCK
|
||||
# define HZ ((double)sysconf(_SC_CLK_TCK))
|
||||
# else
|
||||
# ifndef CLK_TCK
|
||||
# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
|
||||
# define HZ 100.0
|
||||
# else /* _BSD_CLK_TCK_ */
|
||||
# define HZ ((double)_BSD_CLK_TCK_)
|
||||
# endif
|
||||
# else /* CLK_TCK */
|
||||
# define HZ ((double)CLK_TCK)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef PROG
|
||||
#define PROG s_time_main
|
||||
|
||||
@@ -129,7 +177,7 @@ static char *tm_cipher=NULL;
|
||||
static int tm_verify = SSL_VERIFY_NONE;
|
||||
static int maxTime = SECONDS;
|
||||
static SSL_CTX *tm_ctx=NULL;
|
||||
static const SSL_METHOD *s_time_meth=NULL;
|
||||
static SSL_METHOD *s_time_meth=NULL;
|
||||
static char *s_www_path=NULL;
|
||||
static long bytes_read=0;
|
||||
static int st_bugs=0;
|
||||
@@ -324,8 +372,63 @@ bad:
|
||||
|
||||
static double tm_Time_F(int s)
|
||||
{
|
||||
return app_tminterval(s,1);
|
||||
static double ret;
|
||||
#ifdef TIMES
|
||||
static struct tms tstart,tend;
|
||||
|
||||
if(s == START) {
|
||||
times(&tstart);
|
||||
return(0);
|
||||
} else {
|
||||
times(&tend);
|
||||
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
||||
return((ret == 0.0)?1e-6:ret);
|
||||
}
|
||||
#elif defined(OPENSSL_SYS_NETWARE)
|
||||
static clock_t tstart,tend;
|
||||
|
||||
if (s == START)
|
||||
{
|
||||
tstart=clock();
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
tend=clock();
|
||||
ret=(double)((double)(tend)-(double)(tstart));
|
||||
return((ret < 0.001)?0.001:ret);
|
||||
}
|
||||
#elif defined(OPENSSL_SYS_VXWORKS)
|
||||
{
|
||||
static unsigned long tick_start, tick_end;
|
||||
|
||||
if( s == START )
|
||||
{
|
||||
tick_start = tickGet();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tick_end = tickGet();
|
||||
ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
|
||||
return((ret == 0.0)?1e-6:ret);
|
||||
}
|
||||
}
|
||||
#else /* !times() */
|
||||
static struct timeb tstart,tend;
|
||||
long i;
|
||||
|
||||
if(s == START) {
|
||||
ftime(&tstart);
|
||||
return(0);
|
||||
} else {
|
||||
ftime(&tend);
|
||||
i=(long)tend.millitm-(long)tstart.millitm;
|
||||
ret=((double)(tend.time-tstart.time))+((double)i)/1000.0;
|
||||
return((ret == 0.0)?1e-6:ret);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MAIN - main processing area for client
|
||||
@@ -601,7 +704,7 @@ static SSL *doConnection(SSL *scon)
|
||||
i=SSL_get_fd(serverCon);
|
||||
width=i+1;
|
||||
FD_ZERO(&readfds);
|
||||
openssl_fdset(i,&readfds);
|
||||
FD_SET(i,&readfds);
|
||||
/* Note: under VMS with SOCKETSHR the 2nd parameter
|
||||
* is currently of type (int *) whereas under other
|
||||
* systems it is (void *) if you don't have a cast it
|
||||
|
||||
416
apps/smime.c
416
apps/smime.c
@@ -73,14 +73,11 @@ static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
||||
static int smime_cb(int ok, X509_STORE_CTX *ctx);
|
||||
|
||||
#define SMIME_OP 0x10
|
||||
#define SMIME_IP 0x20
|
||||
#define SMIME_SIGNERS 0x40
|
||||
#define SMIME_ENCRYPT (1 | SMIME_OP)
|
||||
#define SMIME_DECRYPT (2 | SMIME_IP)
|
||||
#define SMIME_SIGN (3 | SMIME_OP | SMIME_SIGNERS)
|
||||
#define SMIME_VERIFY (4 | SMIME_IP)
|
||||
#define SMIME_PK7OUT (5 | SMIME_IP | SMIME_OP)
|
||||
#define SMIME_RESIGN (6 | SMIME_IP | SMIME_OP | SMIME_SIGNERS)
|
||||
#define SMIME_DECRYPT 2
|
||||
#define SMIME_SIGN (3 | SMIME_OP)
|
||||
#define SMIME_VERIFY 4
|
||||
#define SMIME_PK7OUT 5
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -93,7 +90,6 @@ int MAIN(int argc, char **argv)
|
||||
const char *inmode = "r", *outmode = "w";
|
||||
char *infile = NULL, *outfile = NULL;
|
||||
char *signerfile = NULL, *recipfile = NULL;
|
||||
STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL;
|
||||
char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
|
||||
const EVP_CIPHER *cipher = NULL;
|
||||
PKCS7 *p7 = NULL;
|
||||
@@ -109,8 +105,6 @@ int MAIN(int argc, char **argv)
|
||||
char *passargin = NULL, *passin = NULL;
|
||||
char *inrand = NULL;
|
||||
int need_rand = 0;
|
||||
int indef = 0;
|
||||
const EVP_MD *sign_md = NULL;
|
||||
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
|
||||
int keyform = FORMAT_PEM;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
@@ -141,8 +135,6 @@ int MAIN(int argc, char **argv)
|
||||
operation = SMIME_DECRYPT;
|
||||
else if (!strcmp (*args, "-sign"))
|
||||
operation = SMIME_SIGN;
|
||||
else if (!strcmp (*args, "-resign"))
|
||||
operation = SMIME_RESIGN;
|
||||
else if (!strcmp (*args, "-verify"))
|
||||
operation = SMIME_VERIFY;
|
||||
else if (!strcmp (*args, "-pk7out"))
|
||||
@@ -201,209 +193,205 @@ int MAIN(int argc, char **argv)
|
||||
flags |= PKCS7_BINARY;
|
||||
else if (!strcmp (*args, "-nosigs"))
|
||||
flags |= PKCS7_NOSIGS;
|
||||
else if (!strcmp (*args, "-stream"))
|
||||
indef = 1;
|
||||
else if (!strcmp (*args, "-indef"))
|
||||
indef = 1;
|
||||
else if (!strcmp (*args, "-noindef"))
|
||||
indef = 0;
|
||||
else if (!strcmp (*args, "-nooldmime"))
|
||||
flags |= PKCS7_NOOLDMIMETYPE;
|
||||
else if (!strcmp (*args, "-crlfeol"))
|
||||
flags |= PKCS7_CRLFEOL;
|
||||
else if (!strcmp(*args,"-rand"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
args++;
|
||||
inrand = *args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
inrand = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
need_rand = 1;
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if (!strcmp(*args,"-engine"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
engine = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
engine = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
#endif
|
||||
else if (!strcmp(*args,"-passin"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
passargin = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
passargin = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-to"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
to = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
to = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-from"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
from = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
from = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-subject"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
subject = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
subject = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-signer"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
/* If previous -signer argument add signer to list */
|
||||
|
||||
if (signerfile)
|
||||
if (args[1])
|
||||
{
|
||||
if (!sksigners)
|
||||
sksigners = sk_STRING_new_null();
|
||||
sk_STRING_push(sksigners, signerfile);
|
||||
if (!keyfile)
|
||||
keyfile = signerfile;
|
||||
if (!skkeys)
|
||||
skkeys = sk_STRING_new_null();
|
||||
sk_STRING_push(skkeys, keyfile);
|
||||
keyfile = NULL;
|
||||
args++;
|
||||
signerfile = *args;
|
||||
}
|
||||
signerfile = *++args;
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-recip"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
recipfile = *++args;
|
||||
}
|
||||
else if (!strcmp (*args, "-md"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
sign_md = EVP_get_digestbyname(*++args);
|
||||
if (sign_md == NULL)
|
||||
if (args[1])
|
||||
{
|
||||
BIO_printf(bio_err, "Unknown digest %s\n",
|
||||
*args);
|
||||
goto argerr;
|
||||
args++;
|
||||
recipfile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-inkey"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
/* If previous -inkey arument add signer to list */
|
||||
if (keyfile)
|
||||
if (args[1])
|
||||
{
|
||||
if (!signerfile)
|
||||
{
|
||||
BIO_puts(bio_err, "Illegal -inkey without -signer\n");
|
||||
goto argerr;
|
||||
}
|
||||
if (!sksigners)
|
||||
sksigners = sk_STRING_new_null();
|
||||
sk_STRING_push(sksigners, signerfile);
|
||||
signerfile = NULL;
|
||||
if (!skkeys)
|
||||
skkeys = sk_STRING_new_null();
|
||||
sk_STRING_push(skkeys, keyfile);
|
||||
args++;
|
||||
keyfile = *args;
|
||||
}
|
||||
keyfile = *++args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-keyform"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
keyform = str2fmt(*++args);
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
keyform = str2fmt(*args);
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-certfile"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
certfile = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
certfile = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-CAfile"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
CAfile = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
CAfile = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-CApath"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
CApath = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
CApath = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-in"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
infile = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
infile = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-inform"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
informat = str2fmt(*++args);
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
informat = str2fmt(*args);
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-outform"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
outformat = str2fmt(*++args);
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
outformat = str2fmt(*args);
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-out"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
outfile = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
outfile = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-content"))
|
||||
{
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
contfile = *++args;
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
contfile = *args;
|
||||
}
|
||||
else
|
||||
badarg = 1;
|
||||
}
|
||||
else if (args_verify(&args, NULL, &badarg, bio_err, &vpm))
|
||||
continue;
|
||||
else if ((cipher = EVP_get_cipherbyname(*args + 1)) == NULL)
|
||||
else
|
||||
badarg = 1;
|
||||
args++;
|
||||
}
|
||||
|
||||
if (!(operation & SMIME_SIGNERS) && (skkeys || sksigners))
|
||||
{
|
||||
BIO_puts(bio_err, "Multiple signers or keys not allowed\n");
|
||||
goto argerr;
|
||||
}
|
||||
|
||||
if (operation & SMIME_SIGNERS)
|
||||
if (operation == SMIME_SIGN)
|
||||
{
|
||||
/* Check to see if any final signer needs to be appended */
|
||||
if (keyfile && !signerfile)
|
||||
{
|
||||
BIO_puts(bio_err, "Illegal -inkey without -signer\n");
|
||||
goto argerr;
|
||||
}
|
||||
if (signerfile)
|
||||
{
|
||||
if (!sksigners)
|
||||
sksigners = sk_STRING_new_null();
|
||||
sk_STRING_push(sksigners, signerfile);
|
||||
if (!skkeys)
|
||||
skkeys = sk_STRING_new_null();
|
||||
if (!keyfile)
|
||||
keyfile = signerfile;
|
||||
sk_STRING_push(skkeys, keyfile);
|
||||
}
|
||||
if (!sksigners)
|
||||
if (!signerfile)
|
||||
{
|
||||
BIO_printf(bio_err, "No signer certificate specified\n");
|
||||
badarg = 1;
|
||||
}
|
||||
signerfile = NULL;
|
||||
keyfile = NULL;
|
||||
need_rand = 1;
|
||||
}
|
||||
else if (operation == SMIME_DECRYPT)
|
||||
@@ -428,7 +416,6 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (badarg)
|
||||
{
|
||||
argerr:
|
||||
BIO_printf (bio_err, "Usage smime [options] cert.pem ...\n");
|
||||
BIO_printf (bio_err, "where options are\n");
|
||||
BIO_printf (bio_err, "-encrypt encrypt message\n");
|
||||
@@ -512,11 +499,13 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
ret = 2;
|
||||
|
||||
if (!(operation & SMIME_SIGNERS))
|
||||
if (operation != SMIME_SIGN)
|
||||
flags &= ~PKCS7_DETACHED;
|
||||
|
||||
if (operation & SMIME_OP)
|
||||
{
|
||||
if (flags & PKCS7_BINARY)
|
||||
inmode = "rb";
|
||||
if (outformat == FORMAT_ASN1)
|
||||
outmode = "wb";
|
||||
}
|
||||
@@ -524,25 +513,16 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
if (flags & PKCS7_BINARY)
|
||||
outmode = "wb";
|
||||
}
|
||||
|
||||
if (operation & SMIME_IP)
|
||||
{
|
||||
if (informat == FORMAT_ASN1)
|
||||
inmode = "rb";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flags & PKCS7_BINARY)
|
||||
inmode = "rb";
|
||||
}
|
||||
|
||||
if (operation == SMIME_ENCRYPT)
|
||||
{
|
||||
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;
|
||||
@@ -565,11 +545,26 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (signerfile && (operation == SMIME_SIGN))
|
||||
{
|
||||
if (!(signer = load_cert(bio_err,signerfile,FORMAT_PEM, NULL,
|
||||
e, "signer certificate")))
|
||||
{
|
||||
#if 0 /* An appropri message has already been printed */
|
||||
BIO_printf(bio_err, "Can't read signer certificate file %s\n", signerfile);
|
||||
#endif
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (certfile)
|
||||
{
|
||||
if (!(other = load_certs(bio_err,certfile,FORMAT_PEM, NULL,
|
||||
e, "certificate file")))
|
||||
{
|
||||
#if 0 /* An appropriate message has already been printed */
|
||||
BIO_printf(bio_err, "Can't read certificate file %s\n", certfile);
|
||||
#endif
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -580,6 +575,9 @@ int MAIN(int argc, char **argv)
|
||||
if (!(recip = load_cert(bio_err,recipfile,FORMAT_PEM,NULL,
|
||||
e, "recipient certificate file")))
|
||||
{
|
||||
#if 0 /* An appropriate message has alrady been printed */
|
||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", recipfile);
|
||||
#endif
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -617,36 +615,6 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
|
||||
if (operation & SMIME_IP)
|
||||
{
|
||||
if (informat == FORMAT_SMIME)
|
||||
p7 = SMIME_read_PKCS7(in, &indata);
|
||||
else if (informat == FORMAT_PEM)
|
||||
p7 = PEM_read_bio_PKCS7(in, NULL, NULL, NULL);
|
||||
else if (informat == FORMAT_ASN1)
|
||||
p7 = d2i_PKCS7_bio(in, NULL);
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad input format for PKCS#7 file\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!p7)
|
||||
{
|
||||
BIO_printf(bio_err, "Error reading S/MIME message\n");
|
||||
goto end;
|
||||
}
|
||||
if (contfile)
|
||||
{
|
||||
BIO_free(indata);
|
||||
if (!(indata = BIO_new_file(contfile, "rb")))
|
||||
{
|
||||
BIO_printf(bio_err, "Can't read content file %s\n", contfile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (outfile)
|
||||
{
|
||||
if (!(out = BIO_new_file(outfile, outmode)))
|
||||
@@ -680,58 +648,43 @@ int MAIN(int argc, char **argv)
|
||||
ret = 3;
|
||||
|
||||
if (operation == SMIME_ENCRYPT)
|
||||
{
|
||||
if (indef)
|
||||
flags |= PKCS7_STREAM;
|
||||
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
||||
}
|
||||
else if (operation & SMIME_SIGNERS)
|
||||
else if (operation == SMIME_SIGN)
|
||||
{
|
||||
int i;
|
||||
/* If detached data content we only enable streaming if
|
||||
* S/MIME output format.
|
||||
/* If detached data and SMIME output enable partial
|
||||
* signing.
|
||||
*/
|
||||
if (operation == SMIME_SIGN)
|
||||
{
|
||||
if (flags & PKCS7_DETACHED)
|
||||
{
|
||||
if (outformat == FORMAT_SMIME)
|
||||
flags |= PKCS7_STREAM;
|
||||
}
|
||||
else if (indef)
|
||||
flags |= PKCS7_STREAM;
|
||||
flags |= PKCS7_PARTIAL;
|
||||
p7 = PKCS7_sign(NULL, NULL, other, in, flags);
|
||||
if (!p7)
|
||||
goto end;
|
||||
}
|
||||
if ((flags & PKCS7_DETACHED) && (outformat == FORMAT_SMIME))
|
||||
flags |= PKCS7_STREAM;
|
||||
p7 = PKCS7_sign(signer, key, other, in, flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (informat == FORMAT_SMIME)
|
||||
p7 = SMIME_read_PKCS7(in, &indata);
|
||||
else if (informat == FORMAT_PEM)
|
||||
p7 = PEM_read_bio_PKCS7(in, NULL, NULL, NULL);
|
||||
else if (informat == FORMAT_ASN1)
|
||||
p7 = d2i_PKCS7_bio(in, NULL);
|
||||
else
|
||||
flags |= PKCS7_REUSE_DIGEST;
|
||||
for (i = 0; i < sk_STRING_num(sksigners); i++)
|
||||
{
|
||||
signerfile = sk_STRING_value(sksigners, i);
|
||||
keyfile = sk_STRING_value(skkeys, i);
|
||||
signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
|
||||
e, "signer certificate");
|
||||
if (!signer)
|
||||
goto end;
|
||||
key = load_key(bio_err, keyfile, keyform, 0, passin, e,
|
||||
"signing key file");
|
||||
if (!key)
|
||||
goto end;
|
||||
if (!PKCS7_sign_add_signer(p7, signer, key,
|
||||
sign_md, flags))
|
||||
goto end;
|
||||
X509_free(signer);
|
||||
signer = NULL;
|
||||
EVP_PKEY_free(key);
|
||||
key = NULL;
|
||||
BIO_printf(bio_err, "Bad input format for PKCS#7 file\n");
|
||||
goto end;
|
||||
}
|
||||
/* If not streaming or resigning finalize structure */
|
||||
if ((operation == SMIME_SIGN) && !(flags & PKCS7_STREAM))
|
||||
|
||||
if (!p7)
|
||||
{
|
||||
if (!PKCS7_final(p7, in, flags))
|
||||
BIO_printf(bio_err, "Error reading S/MIME message\n");
|
||||
goto end;
|
||||
}
|
||||
if (contfile)
|
||||
{
|
||||
BIO_free(indata);
|
||||
if (!(indata = BIO_new_file(contfile, "rb")))
|
||||
{
|
||||
BIO_printf(bio_err, "Can't read content file %s\n", contfile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -781,16 +734,11 @@ int MAIN(int argc, char **argv)
|
||||
if (subject)
|
||||
BIO_printf(out, "Subject: %s\n", subject);
|
||||
if (outformat == FORMAT_SMIME)
|
||||
{
|
||||
if (operation == SMIME_RESIGN)
|
||||
SMIME_write_PKCS7(out, p7, indata, flags);
|
||||
else
|
||||
SMIME_write_PKCS7(out, p7, in, flags);
|
||||
}
|
||||
SMIME_write_PKCS7(out, p7, in, flags);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
PEM_write_bio_PKCS7_stream(out, p7, in, flags);
|
||||
PEM_write_bio_PKCS7(out,p7);
|
||||
else if (outformat == FORMAT_ASN1)
|
||||
i2d_PKCS7_bio_stream(out,p7, in, flags);
|
||||
i2d_PKCS7_bio(out,p7);
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Bad output format for PKCS#7 file\n");
|
||||
@@ -806,10 +754,6 @@ end:
|
||||
sk_X509_pop_free(other, X509_free);
|
||||
if (vpm)
|
||||
X509_VERIFY_PARAM_free(vpm);
|
||||
if (sksigners)
|
||||
sk_STRING_free(sksigners);
|
||||
if (skkeys)
|
||||
sk_STRING_free(skkeys);
|
||||
X509_STORE_free(store);
|
||||
X509_free(cert);
|
||||
X509_free(recip);
|
||||
|
||||
385
apps/speed.c
385
apps/speed.c
@@ -108,8 +108,53 @@
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX)
|
||||
# define USE_TOD
|
||||
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
|
||||
# define TIMES
|
||||
#endif
|
||||
#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) /* FIXME */
|
||||
# define TIMEB
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_NETWARE)
|
||||
#undef TIMES
|
||||
#undef TIMEB
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifndef _IRIX
|
||||
# include <time.h>
|
||||
#endif
|
||||
#ifdef TIMES
|
||||
# include <sys/types.h>
|
||||
# include <sys/times.h>
|
||||
#endif
|
||||
#ifdef USE_TOD
|
||||
# include <sys/time.h>
|
||||
# include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
/* Depending on the VMS version, the tms structure is perhaps defined.
|
||||
The __TMS macro will show if it was. If it wasn't defined, we should
|
||||
undefine TIMES, since that tells the rest of the program how things
|
||||
should be handled. -- Richard Levitte */
|
||||
#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS)
|
||||
#undef TIMES
|
||||
#endif
|
||||
|
||||
#ifdef TIMEB
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE)
|
||||
#error "It seems neither struct tms nor struct timeb is supported in this platform!"
|
||||
#endif
|
||||
|
||||
#if defined(sun) || defined(__ultrix)
|
||||
#define _POSIX_SOURCE
|
||||
#include <limits.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include <openssl/bn.h>
|
||||
@@ -144,9 +189,6 @@
|
||||
#ifndef OPENSSL_NO_RIPEMD
|
||||
#include <openssl/ripemd.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_WHIRLPOOL
|
||||
#include <openssl/whrlpool.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_RC4
|
||||
#include <openssl/rc4.h>
|
||||
#endif
|
||||
@@ -184,14 +226,53 @@
|
||||
#include <openssl/ecdh.h>
|
||||
#endif
|
||||
|
||||
#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
|
||||
# define HAVE_FORK 1
|
||||
/*
|
||||
* The following "HZ" timing stuff should be sync'd up with the code in
|
||||
* crypto/tmdiff.[ch]. That appears to try to do the same job, though I think
|
||||
* this code is more up to date than libcrypto's so there may be features to
|
||||
* migrate over first. This is used in two places further down AFAICS.
|
||||
* The point is that nothing in openssl actually *uses* that tmdiff stuff, so
|
||||
* either speed.c should be using it or it should go because it's obviously not
|
||||
* useful enough. Anyone want to do a janitorial job on this?
|
||||
*/
|
||||
|
||||
/* The following if from times(3) man page. It may need to be changed */
|
||||
#ifndef HZ
|
||||
# if defined(_SC_CLK_TCK) \
|
||||
&& (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
|
||||
# define HZ sysconf(_SC_CLK_TCK)
|
||||
# else
|
||||
# ifndef CLK_TCK
|
||||
# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
|
||||
# define HZ 100.0
|
||||
# else /* _BSD_CLK_TCK_ */
|
||||
# define HZ ((double)_BSD_CLK_TCK_)
|
||||
# endif
|
||||
# else /* CLK_TCK */
|
||||
# define HZ ((double)CLK_TCK)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FORK
|
||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
|
||||
# define HAVE_FORK 0
|
||||
# else
|
||||
# define HAVE_FORK 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_FORK
|
||||
# undef NO_FORK
|
||||
#else
|
||||
# define NO_FORK
|
||||
#endif
|
||||
|
||||
#undef BUFSIZE
|
||||
#define BUFSIZE ((long)1024*8+1)
|
||||
int run=0;
|
||||
|
||||
static char ftime_used = 0, times_used = 0, gettimeofday_used = 0, getrusage_used = 0;
|
||||
static int mr=0;
|
||||
static int usertime=1;
|
||||
|
||||
@@ -200,11 +281,11 @@ static void print_message(const char *s,long num,int length);
|
||||
static void pkey_print_message(const char *str, const char *str2,
|
||||
long num, int bits, int sec);
|
||||
static void print_result(int alg,int run_no,int count,double time_used);
|
||||
#ifdef HAVE_FORK
|
||||
#ifndef NO_FORK
|
||||
static int do_multi(int multi);
|
||||
#endif
|
||||
|
||||
#define ALGOR_NUM 29
|
||||
#define ALGOR_NUM 28
|
||||
#define SIZE_NUM 5
|
||||
#define RSA_NUM 4
|
||||
#define DSA_NUM 3
|
||||
@@ -218,12 +299,16 @@ static const char *names[ALGOR_NUM]={
|
||||
"rc2 cbc","rc5-32/12 cbc","blowfish cbc","cast cbc",
|
||||
"aes-128 cbc","aes-192 cbc","aes-256 cbc",
|
||||
"camellia-128 cbc","camellia-192 cbc","camellia-256 cbc",
|
||||
"evp","sha256","sha512","whirlpool",
|
||||
"evp","sha256","sha512",
|
||||
"aes-128 ige","aes-192 ige","aes-256 ige"};
|
||||
static double results[ALGOR_NUM][SIZE_NUM];
|
||||
static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
static double rsa_results[RSA_NUM][2];
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
static double dsa_results[DSA_NUM][2];
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
static double ecdsa_results[EC_NUM][2];
|
||||
#endif
|
||||
@@ -257,46 +342,141 @@ static SIGRETTYPE sig_done(int sig)
|
||||
#define START 0
|
||||
#define STOP 1
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
#define SIGALRM
|
||||
static unsigned int lapse,schlock;
|
||||
static void alarm(unsigned int secs) { lapse = secs*1000; }
|
||||
|
||||
static DWORD WINAPI sleepy(VOID *arg)
|
||||
{
|
||||
schlock = 1;
|
||||
Sleep(lapse);
|
||||
run = 0;
|
||||
return 0;
|
||||
}
|
||||
#if defined(OPENSSL_SYS_NETWARE)
|
||||
|
||||
/* for NetWare the best we can do is use clock() which returns the
|
||||
* time, in hundredths of a second, since the NLM began executing
|
||||
*/
|
||||
static double Time_F(int s)
|
||||
{
|
||||
if (s == START)
|
||||
{
|
||||
HANDLE thr;
|
||||
schlock = 0;
|
||||
thr = CreateThread(NULL,4096,sleepy,NULL,0,NULL);
|
||||
if (thr==NULL)
|
||||
{
|
||||
DWORD ret=GetLastError();
|
||||
BIO_printf(bio_err,"unable to CreateThread (%d)",ret);
|
||||
ExitProcess(ret);
|
||||
}
|
||||
CloseHandle(thr); /* detach the thread */
|
||||
while (!schlock) Sleep(0); /* scheduler spinlock */
|
||||
}
|
||||
double ret;
|
||||
|
||||
static clock_t tstart,tend;
|
||||
|
||||
if (s == START)
|
||||
{
|
||||
tstart=clock();
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
tend=clock();
|
||||
ret=(double)((double)(tend)-(double)(tstart));
|
||||
return((ret < 0.001)?0.001:ret);
|
||||
}
|
||||
}
|
||||
|
||||
return app_tminterval(s,usertime);
|
||||
}
|
||||
#else
|
||||
|
||||
static double Time_F(int s)
|
||||
{
|
||||
return app_tminterval(s,usertime);
|
||||
}
|
||||
double ret;
|
||||
|
||||
#ifdef USE_TOD
|
||||
if(usertime)
|
||||
{
|
||||
static struct rusage tstart,tend;
|
||||
|
||||
getrusage_used = 1;
|
||||
if (s == START)
|
||||
{
|
||||
getrusage(RUSAGE_SELF,&tstart);
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
long i;
|
||||
|
||||
getrusage(RUSAGE_SELF,&tend);
|
||||
i=(long)tend.ru_utime.tv_usec-(long)tstart.ru_utime.tv_usec;
|
||||
ret=((double)(tend.ru_utime.tv_sec-tstart.ru_utime.tv_sec))
|
||||
+((double)i)/1000000.0;
|
||||
return((ret < 0.001)?0.001:ret);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static struct timeval tstart,tend;
|
||||
long i;
|
||||
|
||||
gettimeofday_used = 1;
|
||||
if (s == START)
|
||||
{
|
||||
gettimeofday(&tstart,NULL);
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
gettimeofday(&tend,NULL);
|
||||
i=(long)tend.tv_usec-(long)tstart.tv_usec;
|
||||
ret=((double)(tend.tv_sec-tstart.tv_sec))+((double)i)/1000000.0;
|
||||
return((ret < 0.001)?0.001:ret);
|
||||
}
|
||||
}
|
||||
#else /* ndef USE_TOD */
|
||||
|
||||
# ifdef TIMES
|
||||
if (usertime)
|
||||
{
|
||||
static struct tms tstart,tend;
|
||||
|
||||
times_used = 1;
|
||||
if (s == START)
|
||||
{
|
||||
times(&tstart);
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
times(&tend);
|
||||
ret = HZ;
|
||||
ret=(double)(tend.tms_utime-tstart.tms_utime) / ret;
|
||||
return((ret < 1e-3)?1e-3:ret);
|
||||
}
|
||||
}
|
||||
# endif /* times() */
|
||||
# if defined(TIMES) && defined(TIMEB)
|
||||
else
|
||||
# endif
|
||||
# ifdef OPENSSL_SYS_VXWORKS
|
||||
{
|
||||
static unsigned long tick_start, tick_end;
|
||||
|
||||
if( s == START )
|
||||
{
|
||||
tick_start = tickGet();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tick_end = tickGet();
|
||||
ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
|
||||
return((ret < 0.001)?0.001:ret);
|
||||
}
|
||||
}
|
||||
# elif defined(TIMEB)
|
||||
{
|
||||
static struct timeb tstart,tend;
|
||||
long i;
|
||||
|
||||
ftime_used = 1;
|
||||
if (s == START)
|
||||
{
|
||||
ftime(&tstart);
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ftime(&tend);
|
||||
i=(long)tend.millitm-(long)tstart.millitm;
|
||||
ret=((double)(tend.time-tstart.time))+((double)i)/1000.0;
|
||||
return((ret < 0.001)?0.001:ret);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
#endif /* if defined(OPENSSL_SYS_NETWARE) */
|
||||
|
||||
|
||||
#ifndef OPENSSL_NO_ECDH
|
||||
@@ -320,9 +500,6 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
ENGINE *e = NULL;
|
||||
#endif
|
||||
unsigned char *buf=NULL,*buf2=NULL;
|
||||
int mret=1;
|
||||
long count=0,save_count=0;
|
||||
@@ -356,9 +533,6 @@ int MAIN(int argc, char **argv)
|
||||
unsigned char sha512[SHA512_DIGEST_LENGTH];
|
||||
#endif
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_WHIRLPOOL
|
||||
unsigned char whirlpool[WHIRLPOOL_DIGEST_LENGTH];
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_RIPEMD
|
||||
unsigned char rmd160[RIPEMD160_DIGEST_LENGTH];
|
||||
#endif
|
||||
@@ -416,7 +590,6 @@ int MAIN(int argc, char **argv)
|
||||
unsigned char DES_iv[8];
|
||||
unsigned char iv[2*MAX_BLOCK_SIZE/8];
|
||||
#ifndef OPENSSL_NO_DES
|
||||
DES_cblock *buf_as_des_cblock = NULL;
|
||||
static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
|
||||
static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
|
||||
static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
|
||||
@@ -455,10 +628,9 @@ int MAIN(int argc, char **argv)
|
||||
#define D_EVP 22
|
||||
#define D_SHA256 23
|
||||
#define D_SHA512 24
|
||||
#define D_WHIRLPOOL 25
|
||||
#define D_IGE_128_AES 26
|
||||
#define D_IGE_192_AES 27
|
||||
#define D_IGE_256_AES 28
|
||||
#define D_IGE_128_AES 25
|
||||
#define D_IGE_192_AES 26
|
||||
#define D_IGE_256_AES 27
|
||||
double d=0.0;
|
||||
long c[ALGOR_NUM][SIZE_NUM];
|
||||
#define R_DSA_512 0
|
||||
@@ -587,7 +759,7 @@ int MAIN(int argc, char **argv)
|
||||
const EVP_CIPHER *evp_cipher=NULL;
|
||||
const EVP_MD *evp_md=NULL;
|
||||
int decrypt=0;
|
||||
#ifdef HAVE_FORK
|
||||
#ifndef NO_FORK
|
||||
int multi=0;
|
||||
#endif
|
||||
|
||||
@@ -630,9 +802,6 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_DES
|
||||
buf_as_des_cblock = (DES_cblock *)buf;
|
||||
#endif
|
||||
if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
@@ -707,7 +876,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,"no engine given\n");
|
||||
goto end;
|
||||
}
|
||||
e = setup_engine(bio_err, *argv, 0);
|
||||
setup_engine(bio_err, *argv, 0);
|
||||
/* j will be increased again further down. We just
|
||||
don't want speed to confuse an engine with an
|
||||
algorithm, especially when none is given (which
|
||||
@@ -715,7 +884,7 @@ int MAIN(int argc, char **argv)
|
||||
j--;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_FORK
|
||||
#ifndef NO_FORK
|
||||
else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
|
||||
{
|
||||
argc--;
|
||||
@@ -778,10 +947,6 @@ int MAIN(int argc, char **argv)
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_WHIRLPOOL
|
||||
if (strcmp(*argv,"whirlpool") == 0) doit[D_WHIRLPOOL]=1;
|
||||
else
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_RIPEMD
|
||||
if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1;
|
||||
else
|
||||
@@ -993,16 +1158,12 @@ int MAIN(int argc, char **argv)
|
||||
#ifndef OPENSSL_NO_SHA512
|
||||
BIO_printf(bio_err,"sha512 ");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_WHIRLPOOL
|
||||
BIO_printf(bio_err,"whirlpool");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_RIPEMD160
|
||||
BIO_printf(bio_err,"rmd160");
|
||||
#endif
|
||||
#if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \
|
||||
!defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \
|
||||
!defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) || \
|
||||
!defined(OPENSSL_NO_WHIRLPOOL)
|
||||
!defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160)
|
||||
BIO_printf(bio_err,"\n");
|
||||
#endif
|
||||
|
||||
@@ -1103,7 +1264,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err,"-evp e use EVP e.\n");
|
||||
BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n");
|
||||
BIO_printf(bio_err,"-mr produce machine readable output.\n");
|
||||
#ifdef HAVE_FORK
|
||||
#ifndef NO_FORK
|
||||
BIO_printf(bio_err,"-multi n run n benchmarks in parallel.\n");
|
||||
#endif
|
||||
goto end;
|
||||
@@ -1113,7 +1274,7 @@ int MAIN(int argc, char **argv)
|
||||
j++;
|
||||
}
|
||||
|
||||
#ifdef HAVE_FORK
|
||||
#ifndef NO_FORK
|
||||
if(multi && do_multi(multi))
|
||||
goto show_res;
|
||||
#endif
|
||||
@@ -1129,20 +1290,17 @@ int MAIN(int argc, char **argv)
|
||||
rsa_doit[i]=1;
|
||||
for (i=0; i<DSA_NUM; i++)
|
||||
dsa_doit[i]=1;
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
for (i=0; i<EC_NUM; i++)
|
||||
ecdsa_doit[i]=1;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDH
|
||||
for (i=0; i<EC_NUM; i++)
|
||||
ecdh_doit[i]=1;
|
||||
#endif
|
||||
}
|
||||
for (i=0; i<ALGOR_NUM; i++)
|
||||
if (doit[i]) pr_header++;
|
||||
|
||||
if (usertime == 0 && !mr)
|
||||
BIO_printf(bio_err,"You have chosen to measure elapsed time instead of user CPU time.\n");
|
||||
if (usertime <= 0 && !mr)
|
||||
{
|
||||
BIO_printf(bio_err,"To get the most accurate results, try to run this\n");
|
||||
BIO_printf(bio_err,"program when this computer is idle.\n");
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
for (i=0; i<RSA_NUM; i++)
|
||||
@@ -1223,7 +1381,8 @@ int MAIN(int argc, char **argv)
|
||||
count*=2;
|
||||
Time_F(START);
|
||||
for (it=count; it; it--)
|
||||
DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock,
|
||||
DES_ecb_encrypt((DES_cblock *)buf,
|
||||
(DES_cblock *)buf,
|
||||
&sch,DES_ENCRYPT);
|
||||
d=Time_F(STOP);
|
||||
} while (d <3);
|
||||
@@ -1252,7 +1411,6 @@ int MAIN(int argc, char **argv)
|
||||
c[D_CBC_256_CML][0]=count;
|
||||
c[D_SHA256][0]=count;
|
||||
c[D_SHA512][0]=count;
|
||||
c[D_WHIRLPOOL][0]=count;
|
||||
c[D_IGE_128_AES][0]=count;
|
||||
c[D_IGE_192_AES][0]=count;
|
||||
c[D_IGE_256_AES][0]=count;
|
||||
@@ -1268,7 +1426,6 @@ int MAIN(int argc, char **argv)
|
||||
c[D_RMD160][i]=c[D_RMD160][0]*4*lengths[0]/lengths[i];
|
||||
c[D_SHA256][i]=c[D_SHA256][0]*4*lengths[0]/lengths[i];
|
||||
c[D_SHA512][i]=c[D_SHA512][0]*4*lengths[0]/lengths[i];
|
||||
c[D_WHIRLPOOL][i]=c[D_WHIRLPOOL][0]*4*lengths[0]/lengths[i];
|
||||
}
|
||||
for (i=1; i<SIZE_NUM; i++)
|
||||
{
|
||||
@@ -1452,9 +1609,7 @@ int MAIN(int argc, char **argv)
|
||||
#else
|
||||
#define COND(c) (run)
|
||||
#define COUNT(d) (count)
|
||||
#ifndef _WIN32
|
||||
signal(SIGALRM,sig_done);
|
||||
#endif
|
||||
#endif /* SIGALRM */
|
||||
|
||||
#ifndef OPENSSL_NO_MD2
|
||||
@@ -1584,23 +1739,8 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_WHIRLPOOL
|
||||
if (doit[D_WHIRLPOOL])
|
||||
{
|
||||
for (j=0; j<SIZE_NUM; j++)
|
||||
{
|
||||
print_message(names[D_WHIRLPOOL],c[D_WHIRLPOOL][j],lengths[j]);
|
||||
Time_F(START);
|
||||
for (count=0,run=1; COND(c[D_WHIRLPOOL][j]); count++)
|
||||
WHIRLPOOL(buf,lengths[j],whirlpool);
|
||||
d=Time_F(STOP);
|
||||
print_result(D_WHIRLPOOL,j,count,d);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_RIPEMD
|
||||
if (doit[D_RMD160])
|
||||
{
|
||||
@@ -1746,8 +1886,6 @@ int MAIN(int argc, char **argv)
|
||||
print_result(D_IGE_256_AES,j,count,d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_CAMELLIA
|
||||
if (doit[D_CBC_128_CML])
|
||||
@@ -2332,7 +2470,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
if (rnd_fake) RAND_cleanup();
|
||||
#endif
|
||||
#ifdef HAVE_FORK
|
||||
#ifndef NO_FORK
|
||||
show_res:
|
||||
#endif
|
||||
if(!mr)
|
||||
@@ -2360,6 +2498,35 @@ show_res:
|
||||
printf("%s ",BF_options());
|
||||
#endif
|
||||
fprintf(stdout,"\n%s\n",SSLeay_version(SSLEAY_CFLAGS));
|
||||
printf("available timing options: ");
|
||||
#ifdef TIMES
|
||||
printf("TIMES ");
|
||||
#endif
|
||||
#ifdef TIMEB
|
||||
printf("TIMEB ");
|
||||
#endif
|
||||
#ifdef USE_TOD
|
||||
printf("USE_TOD ");
|
||||
#endif
|
||||
#ifdef HZ
|
||||
#define as_string(s) (#s)
|
||||
{
|
||||
double dbl = HZ;
|
||||
printf("HZ=%g", dbl);
|
||||
}
|
||||
# ifdef _SC_CLK_TCK
|
||||
printf(" [sysconf value]");
|
||||
# endif
|
||||
#endif
|
||||
printf("\n");
|
||||
printf("timing function used: %s%s%s%s%s%s%s\n",
|
||||
(ftime_used ? "ftime" : ""),
|
||||
(ftime_used + times_used > 1 ? "," : ""),
|
||||
(times_used ? "times" : ""),
|
||||
(ftime_used + times_used + gettimeofday_used > 1 ? "," : ""),
|
||||
(gettimeofday_used ? "gettimeofday" : ""),
|
||||
(ftime_used + times_used + gettimeofday_used + getrusage_used > 1 ? "," : ""),
|
||||
(getrusage_used ? "getrusage" : ""));
|
||||
}
|
||||
|
||||
if (pr_header)
|
||||
@@ -2558,7 +2725,7 @@ static void print_result(int alg,int run_no,int count,double time_used)
|
||||
results[alg][run_no]=((double)count)/time_used*lengths[run_no];
|
||||
}
|
||||
|
||||
#ifdef HAVE_FORK
|
||||
#ifndef NO_FORK
|
||||
static char *sstrsep(char **string, const char *delim)
|
||||
{
|
||||
char isdelim[256];
|
||||
@@ -2600,7 +2767,11 @@ static int do_multi(int multi)
|
||||
fds=malloc(multi*sizeof *fds);
|
||||
for(n=0 ; n < multi ; ++n)
|
||||
{
|
||||
pipe(fd);
|
||||
if (pipe(fd) == -1)
|
||||
{
|
||||
fprintf(stderr, "pipe failure\n");
|
||||
exit(1);
|
||||
}
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
if(fork())
|
||||
@@ -2612,11 +2783,14 @@ static int do_multi(int multi)
|
||||
{
|
||||
close(fd[0]);
|
||||
close(1);
|
||||
dup(fd[1]);
|
||||
if (dup(fd[1]) == -1)
|
||||
{
|
||||
fprintf(stderr, "dup failed\n");
|
||||
exit(1);
|
||||
}
|
||||
close(fd[1]);
|
||||
mr=1;
|
||||
usertime=0;
|
||||
free(fds);
|
||||
return 0;
|
||||
}
|
||||
printf("Forked child %d\n",n);
|
||||
@@ -2765,10 +2939,7 @@ static int do_multi(int multi)
|
||||
else
|
||||
fprintf(stderr,"Unknown type '%s' from child %d\n",buf,n);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
free(fds);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
195
apps/tsget
195
apps/tsget
@@ -1,195 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# Written by Zoltan Glozik <zglozik@stones.com>.
|
||||
# Copyright (c) 2002 The OpenTSA Project. All rights reserved.
|
||||
$::version = '$Id: tsget,v 1.1 2006/02/12 23:11:21 ulf Exp $';
|
||||
|
||||
use strict;
|
||||
use IO::Handle;
|
||||
use Getopt::Std;
|
||||
use File::Basename;
|
||||
use WWW::Curl::easy;
|
||||
|
||||
use vars qw(%options);
|
||||
|
||||
# Callback for reading the body.
|
||||
sub read_body {
|
||||
my ($maxlength, $state) = @_;
|
||||
my $return_data = "";
|
||||
my $data_len = length ${$state->{data}};
|
||||
if ($state->{bytes} < $data_len) {
|
||||
$data_len = $data_len - $state->{bytes};
|
||||
$data_len = $maxlength if $data_len > $maxlength;
|
||||
$return_data = substr ${$state->{data}}, $state->{bytes}, $data_len;
|
||||
$state->{bytes} += $data_len;
|
||||
}
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
# Callback for writing the body into a variable.
|
||||
sub write_body {
|
||||
my ($data, $pointer) = @_;
|
||||
${$pointer} .= $data;
|
||||
return length($data);
|
||||
}
|
||||
|
||||
# Initialise a new Curl object.
|
||||
sub create_curl {
|
||||
my $url = shift;
|
||||
|
||||
# Create Curl object.
|
||||
my $curl = WWW::Curl::easy::new();
|
||||
|
||||
# Error-handling related options.
|
||||
$curl->setopt(CURLOPT_VERBOSE, 1) if $options{d};
|
||||
$curl->setopt(CURLOPT_FAILONERROR, 1);
|
||||
$curl->setopt(CURLOPT_USERAGENT, "OpenTSA tsget.pl/" . (split / /, $::version)[2]);
|
||||
|
||||
# Options for POST method.
|
||||
$curl->setopt(CURLOPT_UPLOAD, 1);
|
||||
$curl->setopt(CURLOPT_CUSTOMREQUEST, "POST");
|
||||
$curl->setopt(CURLOPT_HTTPHEADER,
|
||||
["Content-Type: application/timestamp-query",
|
||||
"Accept: application/timestamp-reply"]);
|
||||
$curl->setopt(CURLOPT_READFUNCTION, \&read_body);
|
||||
$curl->setopt(CURLOPT_HEADERFUNCTION, sub { return length($_[0]); });
|
||||
|
||||
# Options for getting the result.
|
||||
$curl->setopt(CURLOPT_WRITEFUNCTION, \&write_body);
|
||||
|
||||
# SSL related options.
|
||||
$curl->setopt(CURLOPT_SSLKEYTYPE, "PEM");
|
||||
$curl->setopt(CURLOPT_SSL_VERIFYPEER, 1); # Verify server's certificate.
|
||||
$curl->setopt(CURLOPT_SSL_VERIFYHOST, 2); # Check server's CN.
|
||||
$curl->setopt(CURLOPT_SSLKEY, $options{k}) if defined($options{k});
|
||||
$curl->setopt(CURLOPT_SSLKEYPASSWD, $options{p}) if defined($options{p});
|
||||
$curl->setopt(CURLOPT_SSLCERT, $options{c}) if defined($options{c});
|
||||
$curl->setopt(CURLOPT_CAINFO, $options{C}) if defined($options{C});
|
||||
$curl->setopt(CURLOPT_CAPATH, $options{P}) if defined($options{P});
|
||||
$curl->setopt(CURLOPT_RANDOM_FILE, $options{r}) if defined($options{r});
|
||||
$curl->setopt(CURLOPT_EGDSOCKET, $options{g}) if defined($options{g});
|
||||
|
||||
# Setting destination.
|
||||
$curl->setopt(CURLOPT_URL, $url);
|
||||
|
||||
return $curl;
|
||||
}
|
||||
|
||||
# Send a request and returns the body back.
|
||||
sub get_timestamp {
|
||||
my $curl = shift;
|
||||
my $body = shift;
|
||||
my $ts_body;
|
||||
local $::error_buf;
|
||||
|
||||
# Error-handling related options.
|
||||
$curl->setopt(CURLOPT_ERRORBUFFER, "::error_buf");
|
||||
|
||||
# Options for POST method.
|
||||
$curl->setopt(CURLOPT_INFILE, {data => $body, bytes => 0});
|
||||
$curl->setopt(CURLOPT_INFILESIZE, length(${$body}));
|
||||
|
||||
# Options for getting the result.
|
||||
$curl->setopt(CURLOPT_FILE, \$ts_body);
|
||||
|
||||
# Send the request...
|
||||
my $error_code = $curl->perform();
|
||||
my $error_string;
|
||||
if ($error_code != 0) {
|
||||
my $http_code = $curl->getinfo(CURLINFO_HTTP_CODE);
|
||||
$error_string = "could not get timestamp";
|
||||
$error_string .= ", http code: $http_code" unless $http_code == 0;
|
||||
$error_string .= ", curl code: $error_code";
|
||||
$error_string .= " ($::error_buf)" if defined($::error_buf);
|
||||
} else {
|
||||
my $ct = $curl->getinfo(CURLINFO_CONTENT_TYPE);
|
||||
if (lc($ct) ne "application/timestamp-reply") {
|
||||
$error_string = "unexpected content type returned: $ct";
|
||||
}
|
||||
}
|
||||
return ($ts_body, $error_string);
|
||||
|
||||
}
|
||||
|
||||
# Print usage information and exists.
|
||||
sub usage {
|
||||
|
||||
print STDERR "usage: $0 -h <server_url> [-e <extension>] [-o <output>] ";
|
||||
print STDERR "[-v] [-d] [-k <private_key.pem>] [-p <key_password>] ";
|
||||
print STDERR "[-c <client_cert.pem>] [-C <CA_certs.pem>] [-P <CA_path>] ";
|
||||
print STDERR "[-r <file:file...>] [-g <EGD_socket>] [<request>]...\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Main program
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Getting command-line options (default comes from TSGET environment variable).
|
||||
my $getopt_arg = "h:e:o:vdk:p:c:C:P:r:g:";
|
||||
if (exists $ENV{TSGET}) {
|
||||
my @old_argv = @ARGV;
|
||||
@ARGV = split /\s+/, $ENV{TSGET};
|
||||
getopts($getopt_arg, \%options) or usage;
|
||||
@ARGV = @old_argv;
|
||||
}
|
||||
getopts($getopt_arg, \%options) or usage;
|
||||
|
||||
# Checking argument consistency.
|
||||
if (!exists($options{h}) || (@ARGV == 0 && !exists($options{o}))
|
||||
|| (@ARGV > 1 && exists($options{o}))) {
|
||||
print STDERR "Inconsistent command line options.\n";
|
||||
usage;
|
||||
}
|
||||
# Setting defaults.
|
||||
@ARGV = ("-") unless @ARGV != 0;
|
||||
$options{e} = ".tsr" unless defined($options{e});
|
||||
|
||||
# Processing requests.
|
||||
my $curl = create_curl $options{h};
|
||||
undef $/; # For reading whole files.
|
||||
REQUEST: foreach (@ARGV) {
|
||||
my $input = $_;
|
||||
my ($base, $path) = fileparse($input, '\.[^.]*');
|
||||
my $output_base = $base . $options{e};
|
||||
my $output = defined($options{o}) ? $options{o} : $path . $output_base;
|
||||
|
||||
STDERR->printflush("$input: ") if $options{v};
|
||||
# Read request.
|
||||
my $body;
|
||||
if ($input eq "-") {
|
||||
# Read the request from STDIN;
|
||||
$body = <STDIN>;
|
||||
} else {
|
||||
# Read the request from file.
|
||||
open INPUT, "<" . $input
|
||||
or warn("$input: could not open input file: $!\n"), next REQUEST;
|
||||
$body = <INPUT>;
|
||||
close INPUT
|
||||
or warn("$input: could not close input file: $!\n"), next REQUEST;
|
||||
}
|
||||
|
||||
# Send request.
|
||||
STDERR->printflush("sending request") if $options{v};
|
||||
|
||||
my ($ts_body, $error) = get_timestamp $curl, \$body;
|
||||
if (defined($error)) {
|
||||
die "$input: fatal error: $error\n";
|
||||
}
|
||||
STDERR->printflush(", reply received") if $options{v};
|
||||
|
||||
# Write response.
|
||||
if ($output eq "-") {
|
||||
# Write to STDOUT.
|
||||
print $ts_body;
|
||||
} else {
|
||||
# Write to file.
|
||||
open OUTPUT, ">", $output
|
||||
or warn("$output: could not open output file: $!\n"), next REQUEST;
|
||||
print OUTPUT $ts_body;
|
||||
close OUTPUT
|
||||
or warn("$output: could not close output file: $!\n"), next REQUEST;
|
||||
}
|
||||
STDERR->printflush(", $output written.\n") if $options{v};
|
||||
}
|
||||
$curl->cleanup();
|
||||
WWW::Curl::easy::global_cleanup();
|
||||
65
apps/x509.c
65
apps/x509.c
@@ -190,7 +190,7 @@ int MAIN(int argc, char **argv)
|
||||
X509_REQ *rq=NULL;
|
||||
int fingerprint=0;
|
||||
char buf[256];
|
||||
const EVP_MD *md_alg,*digest=NULL;
|
||||
const EVP_MD *md_alg,*digest=EVP_sha1();
|
||||
CONF *extconf = NULL;
|
||||
char *extsect = NULL, *extfile = NULL, *passin = NULL, *passargin = NULL;
|
||||
int need_rand = 0;
|
||||
@@ -539,7 +539,6 @@ bad:
|
||||
if (reqfile)
|
||||
{
|
||||
EVP_PKEY *pkey;
|
||||
X509_CINF *ci;
|
||||
BIO *in;
|
||||
|
||||
if (!sign_flag && !CA_flag)
|
||||
@@ -607,7 +606,6 @@ bad:
|
||||
print_name(bio_err, "subject=", X509_REQ_get_subject_name(req), nmflag);
|
||||
|
||||
if ((x=X509_new()) == NULL) goto end;
|
||||
ci=x->cert_info;
|
||||
|
||||
if (sno == NULL)
|
||||
{
|
||||
@@ -626,7 +624,7 @@ bad:
|
||||
if (!X509_set_subject_name(x,req->req_info->subject)) goto end;
|
||||
|
||||
X509_gmtime_adj(X509_get_notBefore(x),0);
|
||||
X509_time_adj_ex(X509_get_notAfter(x),days, 0, NULL);
|
||||
X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days);
|
||||
|
||||
pkey = X509_REQ_get_pubkey(req);
|
||||
X509_set_pubkey(x,pkey);
|
||||
@@ -738,14 +736,13 @@ bad:
|
||||
else if ((email == i) || (ocsp_uri == i))
|
||||
{
|
||||
int j;
|
||||
STACK_OF(STRING) *emlst;
|
||||
STACK *emlst;
|
||||
if (email == i)
|
||||
emlst = X509_get1_email(x);
|
||||
else
|
||||
emlst = X509_get1_ocsp(x);
|
||||
for (j = 0; j < sk_STRING_num(emlst); j++)
|
||||
BIO_printf(STDout, "%s\n",
|
||||
sk_STRING_value(emlst, j));
|
||||
for (j = 0; j < sk_num(emlst); j++)
|
||||
BIO_printf(STDout, "%s\n", sk_value(emlst, j));
|
||||
X509_email_free(emlst);
|
||||
}
|
||||
else if (aliasout == i)
|
||||
@@ -893,18 +890,14 @@ bad:
|
||||
int j;
|
||||
unsigned int n;
|
||||
unsigned char md[EVP_MAX_MD_SIZE];
|
||||
const EVP_MD *fdig = digest;
|
||||
|
||||
if (!fdig)
|
||||
fdig = EVP_sha1();
|
||||
|
||||
if (!X509_digest(x,fdig,md,&n))
|
||||
if (!X509_digest(x,digest,md,&n))
|
||||
{
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(STDout,"%s Fingerprint=",
|
||||
OBJ_nid2sn(EVP_MD_type(fdig)));
|
||||
OBJ_nid2sn(EVP_MD_type(digest)));
|
||||
for (j=0; j<(int)n; j++)
|
||||
{
|
||||
BIO_printf(STDout,"%02X%c",md[j],
|
||||
@@ -924,6 +917,14 @@ bad:
|
||||
passin, e, "Private key");
|
||||
if (Upkey == NULL) goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (Upkey->type == EVP_PKEY_DSA)
|
||||
digest=EVP_dss1();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (Upkey->type == EVP_PKEY_EC)
|
||||
digest=EVP_ecdsa();
|
||||
#endif
|
||||
|
||||
assert(need_rand);
|
||||
if (!sign(x,Upkey,days,clrext,digest,
|
||||
@@ -940,6 +941,14 @@ bad:
|
||||
"CA Private Key");
|
||||
if (CApkey == NULL) goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (CApkey->type == EVP_PKEY_DSA)
|
||||
digest=EVP_dss1();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (CApkey->type == EVP_PKEY_EC)
|
||||
digest = EVP_ecdsa();
|
||||
#endif
|
||||
|
||||
assert(need_rand);
|
||||
if (!x509_certify(ctx,CAfile,digest,x,xca,
|
||||
@@ -960,13 +969,22 @@ bad:
|
||||
else
|
||||
{
|
||||
pk=load_key(bio_err,
|
||||
keyfile, FORMAT_PEM, 0,
|
||||
keyfile, keyformat, 0,
|
||||
passin, e, "request key");
|
||||
if (pk == NULL) goto end;
|
||||
}
|
||||
|
||||
BIO_printf(bio_err,"Generating certificate request\n");
|
||||
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (pk->type == EVP_PKEY_DSA)
|
||||
digest=EVP_dss1();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
if (pk->type == EVP_PKEY_EC)
|
||||
digest=EVP_ecdsa();
|
||||
#endif
|
||||
|
||||
rq=X509_to_X509_REQ(x,pk,digest);
|
||||
EVP_PKEY_free(pk);
|
||||
if (rq == NULL)
|
||||
@@ -1020,15 +1038,16 @@ bad:
|
||||
}
|
||||
else if (outformat == FORMAT_NETSCAPE)
|
||||
{
|
||||
NETSCAPE_X509 nx;
|
||||
ASN1_OCTET_STRING hdr;
|
||||
ASN1_HEADER ah;
|
||||
ASN1_OCTET_STRING os;
|
||||
|
||||
hdr.data=(unsigned char *)NETSCAPE_CERT_HDR;
|
||||
hdr.length=strlen(NETSCAPE_CERT_HDR);
|
||||
nx.header= &hdr;
|
||||
nx.cert=x;
|
||||
os.data=(unsigned char *)NETSCAPE_CERT_HDR;
|
||||
os.length=strlen(NETSCAPE_CERT_HDR);
|
||||
ah.header= &os;
|
||||
ah.data=(char *)x;
|
||||
ah.meth=X509_asn1_meth();
|
||||
|
||||
i=ASN1_item_i2d_bio(ASN1_ITEM_rptr(NETSCAPE_X509),out,&nx);
|
||||
i=ASN1_i2d_bio_of(ASN1_HEADER,i2d_ASN1_HEADER,out,&ah);
|
||||
}
|
||||
else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
@@ -1147,7 +1166,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
goto end;
|
||||
|
||||
/* hardwired expired */
|
||||
if (X509_time_adj_ex(X509_get_notAfter(x),days, 0, NULL) == NULL)
|
||||
if (X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days) == NULL)
|
||||
goto end;
|
||||
|
||||
if (clrext)
|
||||
|
||||
67
config
67
config
@@ -29,7 +29,7 @@ EXE=""
|
||||
for i
|
||||
do
|
||||
case "$i" in
|
||||
-d*) PREFIX="debug-";;
|
||||
-d) PREFIX="debug-";;
|
||||
-t*) TEST="true";;
|
||||
-h*) TEST="true"; cat <<EOF
|
||||
Usage: config [options]
|
||||
@@ -48,10 +48,10 @@ done
|
||||
|
||||
# First get uname entries that we use below
|
||||
|
||||
MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
|
||||
RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
|
||||
SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
|
||||
VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
|
||||
[ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
|
||||
[ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
|
||||
[ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
|
||||
[ "$BUILD" ] || VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
|
||||
|
||||
|
||||
# Now test for ISC and SCO, since it is has a braindamaged uname.
|
||||
@@ -122,14 +122,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "${MACHINE}-ibm-aix3"; exit 0
|
||||
;;
|
||||
|
||||
BeOS:*:BePC)
|
||||
if [ -e /boot/develop/headers/be/bone ]; then
|
||||
echo "beos-x86-bone"; exit 0
|
||||
else
|
||||
echo "beos-x86-r5"; exit 0
|
||||
fi
|
||||
;;
|
||||
|
||||
dgux:*)
|
||||
echo "${MACHINE}-dg-dgux"; exit 0
|
||||
;;
|
||||
@@ -278,7 +270,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "ppc-apple-darwin${VERSION}"
|
||||
;;
|
||||
*)
|
||||
echo "i686-apple-darwin${VERSION}"
|
||||
echo "i386-apple-darwin${VERSION}"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
@@ -496,12 +488,6 @@ echo Operating system: $GUESSOS
|
||||
# script above so we end up with values in vars but that would take
|
||||
# more time that I want to waste at the moment
|
||||
case "$GUESSOS" in
|
||||
uClinux*64*)
|
||||
OUT=uClinux-dist64
|
||||
;;
|
||||
uClinux*)
|
||||
OUT=uClinux-dist
|
||||
;;
|
||||
mips2-sgi-irix)
|
||||
CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
||||
CPU=${CPU:-0}
|
||||
@@ -537,28 +523,8 @@ case "$GUESSOS" in
|
||||
OUT="irix-mips3-$CC"
|
||||
;;
|
||||
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
||||
ppc-apple-darwin*)
|
||||
ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
|
||||
if [ "$ISA64" = "1" ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure darwin64-ppc-cc' *manually*."
|
||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
fi
|
||||
fi
|
||||
OUT="darwin-ppc-cc" ;;
|
||||
i?86-apple-darwin*)
|
||||
ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
|
||||
if [ "$ISA64" = "1" ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure darwin64-x86_64-cc' *manually*."
|
||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
fi
|
||||
fi
|
||||
OUT="darwin-i386-cc" ;;
|
||||
ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
|
||||
i386-apple-darwin*) OUT="darwin-i386-cc" ;;
|
||||
alpha-*-linux2)
|
||||
ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
|
||||
case ${ISA:-generic} in
|
||||
@@ -623,13 +589,13 @@ case "$GUESSOS" in
|
||||
|
||||
options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
||||
OUT="linux-generic32" ;;
|
||||
armv[1-3]*-*-linux2) OUT="linux-generic32" ;;
|
||||
arm*-*-linux2) OUT="linux-armv4" ;;
|
||||
arm*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||
arm*l-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
|
||||
sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||
sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
|
||||
m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||
s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||
s390x-*-linux2) OUT="linux-s390x" ;;
|
||||
s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
|
||||
s390x-*-linux2) OUT="linux-generic64"; options="$options -DB_ENDIAN" ;;
|
||||
x86_64-*-linux?) OUT="linux-x86_64" ;;
|
||||
*86-*-linux2) OUT="linux-elf"
|
||||
if [ "$GCCVER" -gt 28 ]; then
|
||||
@@ -775,6 +741,10 @@ case "$GUESSOS" in
|
||||
OBJECT_MODE=${OBJECT_MODE:-32}
|
||||
if [ "$CC" = "gcc" ]; then
|
||||
OUT="aix-gcc"
|
||||
if [ $OBJECT_MODE -eq 64 ]; then
|
||||
echo 'Your $OBJECT_MODE was found to be set to 64'
|
||||
OUT="aix64-gcc"
|
||||
fi
|
||||
elif [ $OBJECT_MODE -eq 64 ]; then
|
||||
echo 'Your $OBJECT_MODE was found to be set to 64'
|
||||
OUT="aix64-cc"
|
||||
@@ -803,7 +773,6 @@ case "$GUESSOS" in
|
||||
t3e-cray-unicosmk) OUT="cray-t3e" ;;
|
||||
j90-cray-unicos) OUT="cray-j90" ;;
|
||||
nsr-tandem-nsk) OUT="tandem-c89" ;;
|
||||
beos-*) OUT="$GUESSOS" ;;
|
||||
x86pc-*-qnx6) OUT="QNX6-i386" ;;
|
||||
*-*-qnx6) OUT="QNX6" ;;
|
||||
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
||||
@@ -821,6 +790,10 @@ esac
|
||||
# options="$options -DATALLA"
|
||||
#fi
|
||||
|
||||
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
|
||||
grep \\--noexecstack) 2>&1 > /dev/null && \
|
||||
options="$options -Wa,--noexecstack"
|
||||
|
||||
# gcc < 2.8 does not support -march=ultrasparc
|
||||
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
|
||||
then
|
||||
|
||||
@@ -4,5 +4,3 @@ opensslconf.h
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
*cpuid.s
|
||||
uplink-cof.s
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* $LP: LPlib/source/LPdir_vms.c,v 1.20 2004/08/26 13:36:05 _cvs_levitte Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2004, Richard Levitte <richard@levitte.org>
|
||||
* All rights reserved.
|
||||
@@ -82,6 +81,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
|
||||
size_t filespeclen = strlen(directory);
|
||||
char *filespec = NULL;
|
||||
|
||||
if (filespeclen == 0)
|
||||
{
|
||||
errno = ENOENT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MUST be a VMS directory specification! Let's estimate if it is. */
|
||||
if (directory[filespeclen-1] != ']'
|
||||
&& directory[filespeclen-1] != '>'
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* $LP: LPlib/source/LPdir_win.c,v 1.10 2004/08/26 13:36:05 _cvs_levitte Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2004, Richard Levitte <richard@levitte.org>
|
||||
* All rights reserved.
|
||||
@@ -54,6 +53,8 @@ struct LP_dir_context_st
|
||||
|
||||
const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
|
||||
{
|
||||
struct dirent *direntry = NULL;
|
||||
|
||||
if (ctx == NULL || directory == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
@@ -63,6 +64,16 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
|
||||
errno = 0;
|
||||
if (*ctx == NULL)
|
||||
{
|
||||
const char *extdir = directory;
|
||||
char *extdirbuf = NULL;
|
||||
size_t dirlen = strlen (directory);
|
||||
|
||||
if (dirlen == 0)
|
||||
{
|
||||
errno = ENOENT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX));
|
||||
if (*ctx == NULL)
|
||||
{
|
||||
@@ -71,15 +82,35 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
|
||||
}
|
||||
memset(*ctx, '\0', sizeof(LP_DIR_CTX));
|
||||
|
||||
if (directory[dirlen-1] != '*')
|
||||
{
|
||||
extdirbuf = (char *)malloc(dirlen + 3);
|
||||
if (extdirbuf == NULL)
|
||||
{
|
||||
free(*ctx);
|
||||
*ctx = NULL;
|
||||
errno = ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
if (directory[dirlen-1] != '/' && directory[dirlen-1] != '\\')
|
||||
extdir = strcat(strcpy (extdirbuf,directory),"/*");
|
||||
else
|
||||
extdir = strcat(strcpy (extdirbuf,directory),"*");
|
||||
}
|
||||
|
||||
if (sizeof(TCHAR) != sizeof(char))
|
||||
{
|
||||
TCHAR *wdir = NULL;
|
||||
/* len_0 denotes string length *with* trailing 0 */
|
||||
size_t index = 0,len_0 = strlen(directory) + 1;
|
||||
size_t index = 0,len_0 = strlen(extdir) + 1;
|
||||
|
||||
wdir = (TCHAR *)malloc(len_0 * sizeof(TCHAR));
|
||||
wdir = (TCHAR *)calloc(len_0, sizeof(TCHAR));
|
||||
if (wdir == NULL)
|
||||
{
|
||||
if (extdirbuf != NULL)
|
||||
{
|
||||
free (extdirbuf);
|
||||
}
|
||||
free(*ctx);
|
||||
*ctx = NULL;
|
||||
errno = ENOMEM;
|
||||
@@ -87,17 +118,23 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
|
||||
}
|
||||
|
||||
#ifdef LP_MULTIBYTE_AVAILABLE
|
||||
if (!MultiByteToWideChar(CP_ACP, 0, directory, len_0, (WCHAR *)wdir, len_0))
|
||||
if (!MultiByteToWideChar(CP_ACP, 0, extdir, len_0, (WCHAR *)wdir, len_0))
|
||||
#endif
|
||||
for (index = 0; index < len_0; index++)
|
||||
wdir[index] = (TCHAR)directory[index];
|
||||
wdir[index] = (TCHAR)extdir[index];
|
||||
|
||||
(*ctx)->handle = FindFirstFile(wdir, &(*ctx)->ctx);
|
||||
|
||||
free(wdir);
|
||||
}
|
||||
else
|
||||
(*ctx)->handle = FindFirstFile((TCHAR *)directory, &(*ctx)->ctx);
|
||||
{
|
||||
(*ctx)->handle = FindFirstFile((TCHAR *)extdir, &(*ctx)->ctx);
|
||||
}
|
||||
if (extdirbuf != NULL)
|
||||
{
|
||||
free (extdirbuf);
|
||||
}
|
||||
|
||||
if ((*ctx)->handle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
@@ -114,7 +151,6 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof(TCHAR) != sizeof(char))
|
||||
{
|
||||
TCHAR *wdir = (*ctx)->ctx.cFileName;
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
DIR= crypto
|
||||
TOP= ..
|
||||
CC= cc
|
||||
INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE)
|
||||
INCLUDE= -I. -I$(TOP) -I../include
|
||||
# INCLUDES targets sudbirs!
|
||||
INCLUDES= -I.. -I../.. -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE)
|
||||
INCLUDES= -I.. -I../.. -I../../include
|
||||
CFLAG= -g
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
@@ -17,7 +17,7 @@ AR= ar r
|
||||
|
||||
RECURSIVE_MAKE= [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
|
||||
(cd $$i && echo "making $$target in $(DIR)/$$i..." && \
|
||||
$(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$target ) || exit 1; \
|
||||
$(MAKE) -e TOP=../.. DIR=$$i INCLUDES='${INCLUDES}' $$target ) || exit 1; \
|
||||
done;
|
||||
|
||||
PEX_LIBS=
|
||||
@@ -26,29 +26,30 @@ EX_LIBS=
|
||||
CFLAGS= $(INCLUDE) $(CFLAG)
|
||||
ASFLAGS= $(INCLUDE) $(ASFLAG)
|
||||
AFLAGS=$(ASFLAGS)
|
||||
CPUID_OBJ=mem_clr.o
|
||||
|
||||
LIBS=
|
||||
|
||||
GENERAL=Makefile README crypto-lib.com install.com
|
||||
TEST=constant_time_test.c
|
||||
|
||||
LIB= $(TOP)/libcrypto.a
|
||||
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
||||
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c
|
||||
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ)
|
||||
LIBSRC= cryptlib.c dyn_lck.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c o_init.c fips_err.c
|
||||
LIBOBJ= cryptlib.o dyn_lck.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_init.o fips_err.o $(CPUID_OBJ)
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
|
||||
EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
|
||||
ossl_typ.h
|
||||
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER)
|
||||
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \
|
||||
constant_time_locl.h $(EXHEADER)
|
||||
|
||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
|
||||
top:
|
||||
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
||||
|
||||
all: shared
|
||||
all: lib
|
||||
|
||||
buildinf.h: ../Makefile
|
||||
( echo "#ifndef MK1MF_BUILD"; \
|
||||
@@ -58,26 +59,26 @@ buildinf.h: ../Makefile
|
||||
echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
|
||||
echo '#endif' ) >buildinf.h
|
||||
|
||||
x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
|
||||
$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
||||
x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
|
||||
$(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
|
||||
x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
|
||||
$(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
|
||||
x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
|
||||
$(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
|
||||
|
||||
applink.o: $(TOP)/ms/applink.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
|
||||
uplink.o: ../ms/uplink.c
|
||||
$(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c
|
||||
|
||||
uplink.o: $(TOP)/ms/uplink.c applink.o
|
||||
$(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
|
||||
|
||||
uplink-cof.s: $(TOP)/ms/uplink.pl
|
||||
$(PERL) $(TOP)/ms/uplink.pl coff > $@
|
||||
uplink-cof.s: ../ms/uplink.pl
|
||||
$(PERL) ../ms/uplink.pl coff > $@
|
||||
|
||||
x86_64cpuid.s: x86_64cpuid.pl
|
||||
$(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
|
||||
$(PERL) x86_64cpuid.pl $@
|
||||
ia64cpuid.s: ia64cpuid.S
|
||||
$(CC) $(CFLAGS) -E ia64cpuid.S > $@
|
||||
ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
|
||||
|
||||
testapps:
|
||||
[ -z "$(THIS)" ] || ( if echo $(SDIRS) | fgrep ' des '; \
|
||||
[ -z "$(THIS)" ] || ( if echo ${SDIRS} | fgrep ' des '; \
|
||||
then cd des && $(MAKE) -e des; fi )
|
||||
[ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) -e testapps );
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
@@ -95,11 +96,11 @@ links:
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
|
||||
@target=links; $(RECURSIVE_MAKE)
|
||||
|
||||
# lib: $(LIB): are splitted to avoid end-less loop
|
||||
lib: $(LIB)
|
||||
# lib: and $(LIB): are splitted to avoid end-less loop
|
||||
lib: buildinf.h $(LIB) subdirs
|
||||
@touch lib
|
||||
$(LIB): $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(ARX) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
|
||||
shared: buildinf.h lib subdirs
|
||||
@@ -136,7 +137,6 @@ clean:
|
||||
dclean:
|
||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
rm -f opensslconf.h
|
||||
@target=dclean; $(RECURSIVE_MAKE)
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
@@ -161,6 +161,13 @@ cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
|
||||
cversion.o: cryptlib.h cversion.c
|
||||
dyn_lck.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
dyn_lck.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
dyn_lck.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||
dyn_lck.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
dyn_lck.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
dyn_lck.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
|
||||
dyn_lck.o: dyn_lck.c
|
||||
ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
|
||||
ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
@@ -169,6 +176,13 @@ ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
|
||||
ex_data.o: ex_data.c
|
||||
fips_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
|
||||
fips_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
fips_err.o: ../include/openssl/fips.h ../include/openssl/lhash.h
|
||||
fips_err.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
fips_err.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
fips_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h fips_err.c
|
||||
fips_err.o: fips_err.h
|
||||
mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||
@@ -189,10 +203,23 @@ mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
|
||||
mem_dbg.o: mem_dbg.c
|
||||
o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
|
||||
o_dir.o: LPdir_unix.c o_dir.c o_dir.h
|
||||
o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
|
||||
o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
||||
o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||
o_init.o: ../include/openssl/symhacks.h o_init.c
|
||||
o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
|
||||
o_str.o: o_str.c o_str.h
|
||||
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
|
||||
o_time.o: o_time.h
|
||||
tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||
tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
tmdiff.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h tmdiff.c
|
||||
uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
|
||||
@@ -2,4 +2,4 @@ lib
|
||||
Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
aes-*.s
|
||||
ax86-elf.s
|
||||
|
||||
@@ -11,7 +11,7 @@ CFLAG=-g
|
||||
MAKEFILE= Makefile
|
||||
AR= ar r
|
||||
|
||||
AES_ENC=aes_core.o aes_cbc.o
|
||||
AES_ASM_OBJ=aes_core.o aes_cbc.o
|
||||
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
ASFLAGS= $(INCLUDES) $(ASFLAG)
|
||||
@@ -26,7 +26,7 @@ LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC=aes_core.c aes_misc.c aes_ecb.c aes_cbc.c aes_cfb.c aes_ofb.c \
|
||||
aes_ctr.c aes_ige.c aes_wrap.c
|
||||
LIBOBJ=aes_misc.o aes_ecb.o aes_cfb.o aes_ofb.o aes_ctr.o aes_ige.o aes_wrap.o \
|
||||
$(AES_ENC)
|
||||
$(AES_ASM_OBJ)
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
@@ -41,27 +41,24 @@ top:
|
||||
all: lib
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(ARX) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@touch lib
|
||||
|
||||
$(LIBOBJ): $(LIBSRC)
|
||||
|
||||
aes-ia64.s: asm/aes-ia64.S
|
||||
$(CC) $(CFLAGS) -E asm/aes-ia64.S > $@
|
||||
|
||||
aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl
|
||||
$(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
||||
ax86-elf.s: asm/aes-586.pl ../perlasm/x86asm.pl
|
||||
(cd asm; $(PERL) aes-586.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
|
||||
ax86-cof.s: asm/aes-586.pl ../perlasm/x86asm.pl
|
||||
(cd asm; $(PERL) aes-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
|
||||
ax86-out.s: asm/aes-586.pl ../perlasm/x86asm.pl
|
||||
(cd asm; $(PERL) aes-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
|
||||
|
||||
aes-x86_64.s: asm/aes-x86_64.pl
|
||||
$(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
|
||||
aes-sparcv9.s: asm/aes-sparcv9.pl
|
||||
$(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@
|
||||
|
||||
aes-ppc.s: asm/aes-ppc.pl
|
||||
$(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@
|
||||
|
||||
# GNU make "catch all"
|
||||
aes-%.s: asm/aes-%.pl; $(PERL) $< $(CFLAGS) > $@
|
||||
$(PERL) asm/aes-x86_64.pl $@
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
@@ -100,14 +97,16 @@ clean:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
aes_cbc.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
|
||||
aes_cbc.o: ../../include/openssl/opensslconf.h aes_cbc.c
|
||||
aes_cfb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
|
||||
aes_cfb.o: ../../include/openssl/opensslconf.h aes_cfb.c
|
||||
aes_cbc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_cbc.o: ../../include/openssl/opensslconf.h aes_cbc.c aes_locl.h
|
||||
aes_cfb.o: ../../e_os.h ../../include/openssl/aes.h
|
||||
aes_cfb.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
|
||||
aes_cfb.o: aes_cfb.c aes_locl.h
|
||||
aes_core.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_core.o: ../../include/openssl/opensslconf.h aes_core.c aes_locl.h
|
||||
aes_ctr.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
|
||||
aes_ctr.o: ../../include/openssl/opensslconf.h aes_ctr.c
|
||||
aes_core.o: ../../include/openssl/fips.h ../../include/openssl/opensslconf.h
|
||||
aes_core.o: aes_core.c aes_locl.h
|
||||
aes_ctr.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_ctr.o: ../../include/openssl/opensslconf.h aes_ctr.c aes_locl.h
|
||||
aes_ecb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_ecb.o: ../../include/openssl/opensslconf.h aes_ecb.c aes_locl.h
|
||||
aes_ige.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/bio.h
|
||||
@@ -120,8 +119,8 @@ aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h
|
||||
aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_misc.o: ../../include/openssl/opensslconf.h
|
||||
aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c
|
||||
aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
|
||||
aes_ofb.o: ../../include/openssl/opensslconf.h aes_ofb.c
|
||||
aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_ofb.o: ../../include/openssl/opensslconf.h aes_locl.h aes_ofb.c
|
||||
aes_wrap.o: ../../e_os.h ../../include/openssl/aes.h
|
||||
aes_wrap.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
aes_wrap.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
|
||||
@@ -58,8 +58,6 @@
|
||||
#error AES is disabled.
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define AES_ENCRYPT 1
|
||||
#define AES_DECRYPT 0
|
||||
|
||||
@@ -68,6 +66,10 @@
|
||||
#define AES_MAXNR 14
|
||||
#define AES_BLOCK_SIZE 16
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define FIPS_AES_SIZE_T int
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -98,32 +100,37 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key, const int enc);
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
|
||||
const int nbits,const AES_KEY *key,
|
||||
unsigned char *ivec,const int enc);
|
||||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num);
|
||||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char ivec[AES_BLOCK_SIZE],
|
||||
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
||||
unsigned int *num);
|
||||
|
||||
/* For IGE, see also http://www.links.org/files/openssl-ige.pdf */
|
||||
/* NB: the IV is _two_ blocks long */
|
||||
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
/* NB: the IV is _four_ blocks long */
|
||||
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
const AES_KEY *key2, const unsigned char *ivec,
|
||||
const int enc);
|
||||
|
||||
@@ -134,7 +141,6 @@ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, unsigned int inlen);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -49,15 +49,85 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#ifndef AES_DEBUG
|
||||
# ifndef NDEBUG
|
||||
# define NDEBUG
|
||||
# endif
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
#if !defined(OPENSSL_FIPS_AES_ASM)
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc) {
|
||||
|
||||
if (enc)
|
||||
CRYPTO_cbc128_encrypt(in,out,len,key,ivec,(block128_f)AES_encrypt);
|
||||
else
|
||||
CRYPTO_cbc128_decrypt(in,out,len,key,ivec,(block128_f)AES_decrypt);
|
||||
unsigned long n;
|
||||
unsigned long len = length;
|
||||
unsigned char tmp[AES_BLOCK_SIZE];
|
||||
const unsigned char *iv = ivec;
|
||||
|
||||
assert(in && out && key && ivec);
|
||||
assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
|
||||
|
||||
if (AES_ENCRYPT == enc) {
|
||||
while (len >= AES_BLOCK_SIZE) {
|
||||
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] = in[n] ^ iv[n];
|
||||
AES_encrypt(out, out, key);
|
||||
iv = out;
|
||||
len -= AES_BLOCK_SIZE;
|
||||
in += AES_BLOCK_SIZE;
|
||||
out += AES_BLOCK_SIZE;
|
||||
}
|
||||
if (len) {
|
||||
for(n=0; n < len; ++n)
|
||||
out[n] = in[n] ^ iv[n];
|
||||
for(n=len; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] = iv[n];
|
||||
AES_encrypt(out, out, key);
|
||||
iv = out;
|
||||
}
|
||||
memcpy(ivec,iv,AES_BLOCK_SIZE);
|
||||
} else if (in != out) {
|
||||
while (len >= AES_BLOCK_SIZE) {
|
||||
AES_decrypt(in, out, key);
|
||||
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] ^= iv[n];
|
||||
iv = in;
|
||||
len -= AES_BLOCK_SIZE;
|
||||
in += AES_BLOCK_SIZE;
|
||||
out += AES_BLOCK_SIZE;
|
||||
}
|
||||
if (len) {
|
||||
AES_decrypt(in,tmp,key);
|
||||
for(n=0; n < len; ++n)
|
||||
out[n] = tmp[n] ^ iv[n];
|
||||
iv = in;
|
||||
}
|
||||
memcpy(ivec,iv,AES_BLOCK_SIZE);
|
||||
} else {
|
||||
while (len >= AES_BLOCK_SIZE) {
|
||||
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||
AES_decrypt(in, out, key);
|
||||
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] ^= ivec[n];
|
||||
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||
len -= AES_BLOCK_SIZE;
|
||||
in += AES_BLOCK_SIZE;
|
||||
out += AES_BLOCK_SIZE;
|
||||
}
|
||||
if (len) {
|
||||
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||
AES_decrypt(tmp, out, key);
|
||||
for(n=0; n < len; ++n)
|
||||
out[n] ^= ivec[n];
|
||||
for(n=len; n < AES_BLOCK_SIZE; ++n)
|
||||
out[n] = tmp[n];
|
||||
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* crypto/aes/aes_cfb.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -48,9 +48,73 @@
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef AES_DEBUG
|
||||
# ifndef NDEBUG
|
||||
# define NDEBUG
|
||||
# endif
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#include "aes_locl.h"
|
||||
#include "e_os.h"
|
||||
|
||||
/* The input and output encrypted as though 128bit cfb mode is being
|
||||
* used. The extra state information to record how much of the
|
||||
@@ -58,24 +122,103 @@
|
||||
*/
|
||||
|
||||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc) {
|
||||
|
||||
CRYPTO_cfb128_encrypt(in,out,length,key,ivec,num,enc,(block128_f)AES_encrypt);
|
||||
unsigned int n;
|
||||
unsigned long l = length;
|
||||
unsigned char c;
|
||||
|
||||
assert(in && out && key && ivec && num);
|
||||
|
||||
n = *num;
|
||||
|
||||
if (enc) {
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(ivec, ivec, key);
|
||||
}
|
||||
ivec[n] = *(out++) = *(in++) ^ ivec[n];
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
} else {
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(ivec, ivec, key);
|
||||
}
|
||||
c = *(in);
|
||||
*(out++) = *(in++) ^ ivec[n];
|
||||
ivec[n] = c;
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
*num=n;
|
||||
}
|
||||
|
||||
/* This expects a single block of size nbits for both in and out. Note that
|
||||
it corrupts any extra bits in the last byte of out */
|
||||
void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
|
||||
const int nbits,const AES_KEY *key,
|
||||
unsigned char *ivec,const int enc)
|
||||
{
|
||||
int n,rem,num;
|
||||
unsigned char ovec[AES_BLOCK_SIZE*2];
|
||||
|
||||
if (nbits<=0 || nbits>128) return;
|
||||
|
||||
/* fill in the first half of the new IV with the current IV */
|
||||
memcpy(ovec,ivec,AES_BLOCK_SIZE);
|
||||
/* construct the new IV */
|
||||
AES_encrypt(ivec,ivec,key);
|
||||
num = (nbits+7)/8;
|
||||
if (enc) /* encrypt the input */
|
||||
for(n=0 ; n < num ; ++n)
|
||||
out[n] = (ovec[AES_BLOCK_SIZE+n] = in[n] ^ ivec[n]);
|
||||
else /* decrypt the input */
|
||||
for(n=0 ; n < num ; ++n)
|
||||
out[n] = (ovec[AES_BLOCK_SIZE+n] = in[n]) ^ ivec[n];
|
||||
/* shift ovec left... */
|
||||
rem = nbits%8;
|
||||
num = nbits/8;
|
||||
if(rem==0)
|
||||
memcpy(ivec,ovec+num,AES_BLOCK_SIZE);
|
||||
else
|
||||
for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
|
||||
ivec[n] = ovec[n+num]<<rem | ovec[n+num+1]>>(8-rem);
|
||||
|
||||
/* it is not necessary to cleanse ovec, since the IV is not secret */
|
||||
}
|
||||
|
||||
/* N.B. This expects the input to be packed, MS bit first */
|
||||
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc)
|
||||
{
|
||||
CRYPTO_cfb128_1_encrypt(in,out,length,key,ivec,num,enc,(block128_f)AES_encrypt);
|
||||
unsigned int n;
|
||||
unsigned char c[1],d[1];
|
||||
|
||||
assert(in && out && key && ivec && num);
|
||||
assert(*num == 0);
|
||||
|
||||
for(n=0 ; n < length ; ++n)
|
||||
{
|
||||
c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
|
||||
AES_cfbr_encrypt_block(c,d,1,key,ivec,enc);
|
||||
out[n/8]=(out[n/8]&~(1 << (7-n%8)))|((d[0]&0x80) >> (n%8));
|
||||
}
|
||||
}
|
||||
|
||||
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc)
|
||||
{
|
||||
CRYPTO_cfb128_8_encrypt(in,out,length,key,ivec,num,enc,(block128_f)AES_encrypt);
|
||||
unsigned int n;
|
||||
|
||||
assert(in && out && key && ivec && num);
|
||||
assert(*num == 0);
|
||||
|
||||
for(n=0 ; n < length ; ++n)
|
||||
AES_cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,12 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <openssl/aes.h>
|
||||
#ifdef OPENSSL_FIPS
|
||||
#include <openssl/fips.h>
|
||||
#endif
|
||||
|
||||
#include "aes_locl.h"
|
||||
|
||||
#ifndef AES_ASM
|
||||
/*
|
||||
Te0[x] = S [x].[02, 01, 01, 03];
|
||||
Te1[x] = S [x].[03, 02, 01, 01];
|
||||
@@ -632,6 +635,10 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
int i = 0;
|
||||
u32 temp;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
FIPS_selftest_check();
|
||||
#endif
|
||||
|
||||
if (!userKey || !key)
|
||||
return -1;
|
||||
if (bits != 128 && bits != 192 && bits != 256)
|
||||
@@ -774,6 +781,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef AES_ASM
|
||||
/*
|
||||
* Encrypt a single block
|
||||
* in and out can overlap
|
||||
@@ -1156,203 +1164,4 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
PUTU32(out + 12, s3);
|
||||
}
|
||||
|
||||
#else /* AES_ASM */
|
||||
|
||||
static const u8 Te4[256] = {
|
||||
0x63U, 0x7cU, 0x77U, 0x7bU, 0xf2U, 0x6bU, 0x6fU, 0xc5U,
|
||||
0x30U, 0x01U, 0x67U, 0x2bU, 0xfeU, 0xd7U, 0xabU, 0x76U,
|
||||
0xcaU, 0x82U, 0xc9U, 0x7dU, 0xfaU, 0x59U, 0x47U, 0xf0U,
|
||||
0xadU, 0xd4U, 0xa2U, 0xafU, 0x9cU, 0xa4U, 0x72U, 0xc0U,
|
||||
0xb7U, 0xfdU, 0x93U, 0x26U, 0x36U, 0x3fU, 0xf7U, 0xccU,
|
||||
0x34U, 0xa5U, 0xe5U, 0xf1U, 0x71U, 0xd8U, 0x31U, 0x15U,
|
||||
0x04U, 0xc7U, 0x23U, 0xc3U, 0x18U, 0x96U, 0x05U, 0x9aU,
|
||||
0x07U, 0x12U, 0x80U, 0xe2U, 0xebU, 0x27U, 0xb2U, 0x75U,
|
||||
0x09U, 0x83U, 0x2cU, 0x1aU, 0x1bU, 0x6eU, 0x5aU, 0xa0U,
|
||||
0x52U, 0x3bU, 0xd6U, 0xb3U, 0x29U, 0xe3U, 0x2fU, 0x84U,
|
||||
0x53U, 0xd1U, 0x00U, 0xedU, 0x20U, 0xfcU, 0xb1U, 0x5bU,
|
||||
0x6aU, 0xcbU, 0xbeU, 0x39U, 0x4aU, 0x4cU, 0x58U, 0xcfU,
|
||||
0xd0U, 0xefU, 0xaaU, 0xfbU, 0x43U, 0x4dU, 0x33U, 0x85U,
|
||||
0x45U, 0xf9U, 0x02U, 0x7fU, 0x50U, 0x3cU, 0x9fU, 0xa8U,
|
||||
0x51U, 0xa3U, 0x40U, 0x8fU, 0x92U, 0x9dU, 0x38U, 0xf5U,
|
||||
0xbcU, 0xb6U, 0xdaU, 0x21U, 0x10U, 0xffU, 0xf3U, 0xd2U,
|
||||
0xcdU, 0x0cU, 0x13U, 0xecU, 0x5fU, 0x97U, 0x44U, 0x17U,
|
||||
0xc4U, 0xa7U, 0x7eU, 0x3dU, 0x64U, 0x5dU, 0x19U, 0x73U,
|
||||
0x60U, 0x81U, 0x4fU, 0xdcU, 0x22U, 0x2aU, 0x90U, 0x88U,
|
||||
0x46U, 0xeeU, 0xb8U, 0x14U, 0xdeU, 0x5eU, 0x0bU, 0xdbU,
|
||||
0xe0U, 0x32U, 0x3aU, 0x0aU, 0x49U, 0x06U, 0x24U, 0x5cU,
|
||||
0xc2U, 0xd3U, 0xacU, 0x62U, 0x91U, 0x95U, 0xe4U, 0x79U,
|
||||
0xe7U, 0xc8U, 0x37U, 0x6dU, 0x8dU, 0xd5U, 0x4eU, 0xa9U,
|
||||
0x6cU, 0x56U, 0xf4U, 0xeaU, 0x65U, 0x7aU, 0xaeU, 0x08U,
|
||||
0xbaU, 0x78U, 0x25U, 0x2eU, 0x1cU, 0xa6U, 0xb4U, 0xc6U,
|
||||
0xe8U, 0xddU, 0x74U, 0x1fU, 0x4bU, 0xbdU, 0x8bU, 0x8aU,
|
||||
0x70U, 0x3eU, 0xb5U, 0x66U, 0x48U, 0x03U, 0xf6U, 0x0eU,
|
||||
0x61U, 0x35U, 0x57U, 0xb9U, 0x86U, 0xc1U, 0x1dU, 0x9eU,
|
||||
0xe1U, 0xf8U, 0x98U, 0x11U, 0x69U, 0xd9U, 0x8eU, 0x94U,
|
||||
0x9bU, 0x1eU, 0x87U, 0xe9U, 0xceU, 0x55U, 0x28U, 0xdfU,
|
||||
0x8cU, 0xa1U, 0x89U, 0x0dU, 0xbfU, 0xe6U, 0x42U, 0x68U,
|
||||
0x41U, 0x99U, 0x2dU, 0x0fU, 0xb0U, 0x54U, 0xbbU, 0x16U
|
||||
};
|
||||
static const u32 rcon[] = {
|
||||
0x01000000, 0x02000000, 0x04000000, 0x08000000,
|
||||
0x10000000, 0x20000000, 0x40000000, 0x80000000,
|
||||
0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
|
||||
};
|
||||
|
||||
/**
|
||||
* Expand the cipher key into the encryption key schedule.
|
||||
*/
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key) {
|
||||
u32 *rk;
|
||||
int i = 0;
|
||||
u32 temp;
|
||||
|
||||
if (!userKey || !key)
|
||||
return -1;
|
||||
if (bits != 128 && bits != 192 && bits != 256)
|
||||
return -2;
|
||||
|
||||
rk = key->rd_key;
|
||||
|
||||
if (bits==128)
|
||||
key->rounds = 10;
|
||||
else if (bits==192)
|
||||
key->rounds = 12;
|
||||
else
|
||||
key->rounds = 14;
|
||||
|
||||
rk[0] = GETU32(userKey );
|
||||
rk[1] = GETU32(userKey + 4);
|
||||
rk[2] = GETU32(userKey + 8);
|
||||
rk[3] = GETU32(userKey + 12);
|
||||
if (bits == 128) {
|
||||
while (1) {
|
||||
temp = rk[3];
|
||||
rk[4] = rk[0] ^
|
||||
(Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ]) ^
|
||||
rcon[i];
|
||||
rk[5] = rk[1] ^ rk[4];
|
||||
rk[6] = rk[2] ^ rk[5];
|
||||
rk[7] = rk[3] ^ rk[6];
|
||||
if (++i == 10) {
|
||||
return 0;
|
||||
}
|
||||
rk += 4;
|
||||
}
|
||||
}
|
||||
rk[4] = GETU32(userKey + 16);
|
||||
rk[5] = GETU32(userKey + 20);
|
||||
if (bits == 192) {
|
||||
while (1) {
|
||||
temp = rk[ 5];
|
||||
rk[ 6] = rk[ 0] ^
|
||||
(Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ]) ^
|
||||
rcon[i];
|
||||
rk[ 7] = rk[ 1] ^ rk[ 6];
|
||||
rk[ 8] = rk[ 2] ^ rk[ 7];
|
||||
rk[ 9] = rk[ 3] ^ rk[ 8];
|
||||
if (++i == 8) {
|
||||
return 0;
|
||||
}
|
||||
rk[10] = rk[ 4] ^ rk[ 9];
|
||||
rk[11] = rk[ 5] ^ rk[10];
|
||||
rk += 6;
|
||||
}
|
||||
}
|
||||
rk[6] = GETU32(userKey + 24);
|
||||
rk[7] = GETU32(userKey + 28);
|
||||
if (bits == 256) {
|
||||
while (1) {
|
||||
temp = rk[ 7];
|
||||
rk[ 8] = rk[ 0] ^
|
||||
(Te4[(temp >> 16) & 0xff] << 24) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 16) ^
|
||||
(Te4[(temp ) & 0xff] << 8) ^
|
||||
(Te4[(temp >> 24) ]) ^
|
||||
rcon[i];
|
||||
rk[ 9] = rk[ 1] ^ rk[ 8];
|
||||
rk[10] = rk[ 2] ^ rk[ 9];
|
||||
rk[11] = rk[ 3] ^ rk[10];
|
||||
if (++i == 7) {
|
||||
return 0;
|
||||
}
|
||||
temp = rk[11];
|
||||
rk[12] = rk[ 4] ^
|
||||
(Te4[(temp >> 24) ] << 24) ^
|
||||
(Te4[(temp >> 16) & 0xff] << 16) ^
|
||||
(Te4[(temp >> 8) & 0xff] << 8) ^
|
||||
(Te4[(temp ) & 0xff]);
|
||||
rk[13] = rk[ 5] ^ rk[12];
|
||||
rk[14] = rk[ 6] ^ rk[13];
|
||||
rk[15] = rk[ 7] ^ rk[14];
|
||||
|
||||
rk += 8;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand the cipher key into the decryption key schedule.
|
||||
*/
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key) {
|
||||
|
||||
u32 *rk;
|
||||
int i, j, status;
|
||||
u32 temp;
|
||||
|
||||
/* first, start with an encryption schedule */
|
||||
status = AES_set_encrypt_key(userKey, bits, key);
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
rk = key->rd_key;
|
||||
|
||||
/* invert the order of the round keys: */
|
||||
for (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {
|
||||
temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
|
||||
temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
|
||||
temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
|
||||
temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
|
||||
}
|
||||
/* apply the inverse MixColumn transform to all round keys but the first and the last: */
|
||||
for (i = 1; i < (key->rounds); i++) {
|
||||
rk += 4;
|
||||
for (j = 0; j < 4; j++) {
|
||||
u32 tp1, tp2, tp4, tp8, tp9, tpb, tpd, tpe, m;
|
||||
|
||||
tp1 = rk[j];
|
||||
m = tp1 & 0x80808080;
|
||||
tp2 = ((tp1 & 0x7f7f7f7f) << 1) ^
|
||||
((m - (m >> 7)) & 0x1b1b1b1b);
|
||||
m = tp2 & 0x80808080;
|
||||
tp4 = ((tp2 & 0x7f7f7f7f) << 1) ^
|
||||
((m - (m >> 7)) & 0x1b1b1b1b);
|
||||
m = tp4 & 0x80808080;
|
||||
tp8 = ((tp4 & 0x7f7f7f7f) << 1) ^
|
||||
((m - (m >> 7)) & 0x1b1b1b1b);
|
||||
tp9 = tp8 ^ tp1;
|
||||
tpb = tp9 ^ tp2;
|
||||
tpd = tp9 ^ tp4;
|
||||
tpe = tp8 ^ tp4 ^ tp2;
|
||||
#if defined(ROTATE)
|
||||
rk[j] = tpe ^ ROTATE(tpd,16) ^
|
||||
ROTATE(tp9,24) ^ ROTATE(tpb,8);
|
||||
#else
|
||||
rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^
|
||||
(tp9 >> 8) ^ (tp9 << 24) ^
|
||||
(tpb >> 24) ^ (tpb << 8);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* AES_ASM */
|
||||
|
||||
@@ -49,13 +49,91 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#ifndef AES_DEBUG
|
||||
# ifndef NDEBUG
|
||||
# define NDEBUG
|
||||
# endif
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char ivec[AES_BLOCK_SIZE],
|
||||
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
||||
unsigned int *num) {
|
||||
CRYPTO_ctr128_encrypt(in,out,length,key,ivec,ecount_buf,num,(block128_f)AES_encrypt);
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
/* NOTE: the IV/counter CTR mode is big-endian. The rest of the AES code
|
||||
* is endian-neutral. */
|
||||
|
||||
/* increment counter (128-bit int) by 1 */
|
||||
static void AES_ctr128_inc(unsigned char *counter) {
|
||||
unsigned long c;
|
||||
|
||||
/* Grab bottom dword of counter and increment */
|
||||
c = GETU32(counter + 12);
|
||||
c++; c &= 0xFFFFFFFF;
|
||||
PUTU32(counter + 12, c);
|
||||
|
||||
/* if no overflow, we're done */
|
||||
if (c)
|
||||
return;
|
||||
|
||||
/* Grab 1st dword of counter and increment */
|
||||
c = GETU32(counter + 8);
|
||||
c++; c &= 0xFFFFFFFF;
|
||||
PUTU32(counter + 8, c);
|
||||
|
||||
/* if no overflow, we're done */
|
||||
if (c)
|
||||
return;
|
||||
|
||||
/* Grab 2nd dword of counter and increment */
|
||||
c = GETU32(counter + 4);
|
||||
c++; c &= 0xFFFFFFFF;
|
||||
PUTU32(counter + 4, c);
|
||||
|
||||
/* if no overflow, we're done */
|
||||
if (c)
|
||||
return;
|
||||
|
||||
/* Grab top dword of counter and increment */
|
||||
c = GETU32(counter + 0);
|
||||
c++; c &= 0xFFFFFFFF;
|
||||
PUTU32(counter + 0, c);
|
||||
}
|
||||
|
||||
/* The input encrypted as though 128bit counter mode is being
|
||||
* used. The extra state information to record how much of the
|
||||
* 128bit block we have used is contained in *num, and the
|
||||
* encrypted counter is kept in ecount_buf. Both *num and
|
||||
* ecount_buf must be initialised with zeros before the first
|
||||
* call to AES_ctr128_encrypt().
|
||||
*
|
||||
* This algorithm assumes that the counter is in the x lower bits
|
||||
* of the IV (ivec), and that the application has full control over
|
||||
* overflow and the rest of the IV. This implementation takes NO
|
||||
* responsability for checking that the counter doesn't overflow
|
||||
* into the rest of the IV when incremented.
|
||||
*/
|
||||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char ivec[AES_BLOCK_SIZE],
|
||||
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
||||
unsigned int *num) {
|
||||
|
||||
unsigned int n;
|
||||
unsigned long l=length;
|
||||
|
||||
assert(in && out && key && counter && num);
|
||||
assert(*num < AES_BLOCK_SIZE);
|
||||
|
||||
n = *num;
|
||||
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(ivec, ecount_buf, key);
|
||||
AES_ctr128_inc(ivec);
|
||||
}
|
||||
*(out++) = *(in++) ^ ecount_buf[n];
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
*num=n;
|
||||
}
|
||||
|
||||
@@ -77,11 +77,11 @@ typedef struct {
|
||||
/* N.B. The IV for this mode is _twice_ the block size */
|
||||
|
||||
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc)
|
||||
{
|
||||
size_t n;
|
||||
size_t len = length;
|
||||
unsigned long n;
|
||||
unsigned long len;
|
||||
|
||||
OPENSSL_assert(in && out && key && ivec);
|
||||
OPENSSL_assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
|
||||
@@ -211,12 +211,12 @@ void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
/* N.B. The IV for this mode is _four times_ the block size */
|
||||
|
||||
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
const AES_KEY *key2, const unsigned char *ivec,
|
||||
const int enc)
|
||||
{
|
||||
size_t n;
|
||||
size_t len = length;
|
||||
unsigned long n;
|
||||
unsigned long len = length;
|
||||
unsigned char tmp[AES_BLOCK_SIZE];
|
||||
unsigned char tmp2[AES_BLOCK_SIZE];
|
||||
unsigned char tmp3[AES_BLOCK_SIZE];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* crypto/aes/aes_ofb.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -48,13 +48,95 @@
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef AES_DEBUG
|
||||
# ifndef NDEBUG
|
||||
# define NDEBUG
|
||||
# endif
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
/* The input and output encrypted as though 128bit ofb mode is being
|
||||
* used. The extra state information to record how much of the
|
||||
* 128bit block we have used is contained in *num;
|
||||
*/
|
||||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num)
|
||||
{
|
||||
CRYPTO_ofb128_encrypt(in,out,length,key,ivec,num,(block128_f)AES_encrypt);
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num) {
|
||||
|
||||
unsigned int n;
|
||||
unsigned long l=length;
|
||||
|
||||
assert(in && out && key && ivec && num);
|
||||
|
||||
n = *num;
|
||||
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(ivec, ivec, key);
|
||||
}
|
||||
*(out++) = *(in++) ^ ivec[n];
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
*num=n;
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@ int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
A[7] ^= (unsigned char)(t & 0xff);
|
||||
if (t > 0xff)
|
||||
{
|
||||
A[6] ^= (unsigned char)((t & 0xff) >> 8);
|
||||
A[5] ^= (unsigned char)((t & 0xff) >> 16);
|
||||
A[4] ^= (unsigned char)((t & 0xff) >> 24);
|
||||
A[6] ^= (unsigned char)((t >> 8) & 0xff);
|
||||
A[5] ^= (unsigned char)((t >> 16) & 0xff);
|
||||
A[4] ^= (unsigned char)((t >> 24) & 0xff);
|
||||
}
|
||||
memcpy(R, B + 8, 8);
|
||||
}
|
||||
@@ -119,9 +119,9 @@ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
A[7] ^= (unsigned char)(t & 0xff);
|
||||
if (t > 0xff)
|
||||
{
|
||||
A[6] ^= (unsigned char)((t & 0xff) >> 8);
|
||||
A[5] ^= (unsigned char)((t & 0xff) >> 16);
|
||||
A[4] ^= (unsigned char)((t & 0xff) >> 24);
|
||||
A[6] ^= (unsigned char)((t >> 8) & 0xff);
|
||||
A[5] ^= (unsigned char)((t >> 16) & 0xff);
|
||||
A[4] ^= (unsigned char)((t >> 24) & 0xff);
|
||||
}
|
||||
memcpy(B + 8, R, 8);
|
||||
AES_decrypt(B, B, key);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,124 +0,0 @@
|
||||
.text
|
||||
|
||||
.set noat
|
||||
|
||||
.globl OPENSSL_cpuid_setup
|
||||
.ent OPENSSL_cpuid_setup
|
||||
OPENSSL_cpuid_setup:
|
||||
.frame $30,0,$26
|
||||
.prologue 0
|
||||
ret ($26)
|
||||
.end OPENSSL_cpuid_setup
|
||||
|
||||
.globl OPENSSL_wipe_cpu
|
||||
.ent OPENSSL_wipe_cpu
|
||||
OPENSSL_wipe_cpu:
|
||||
.frame $30,0,$26
|
||||
.prologue 0
|
||||
clr $1
|
||||
clr $2
|
||||
clr $3
|
||||
clr $4
|
||||
clr $5
|
||||
clr $6
|
||||
clr $7
|
||||
clr $8
|
||||
clr $16
|
||||
clr $17
|
||||
clr $18
|
||||
clr $19
|
||||
clr $20
|
||||
clr $21
|
||||
clr $22
|
||||
clr $23
|
||||
clr $24
|
||||
clr $25
|
||||
clr $27
|
||||
clr $at
|
||||
clr $29
|
||||
fclr $f0
|
||||
fclr $f1
|
||||
fclr $f10
|
||||
fclr $f11
|
||||
fclr $f12
|
||||
fclr $f13
|
||||
fclr $f14
|
||||
fclr $f15
|
||||
fclr $f16
|
||||
fclr $f17
|
||||
fclr $f18
|
||||
fclr $f19
|
||||
fclr $f20
|
||||
fclr $f21
|
||||
fclr $f22
|
||||
fclr $f23
|
||||
fclr $f24
|
||||
fclr $f25
|
||||
fclr $f26
|
||||
fclr $f27
|
||||
fclr $f28
|
||||
fclr $f29
|
||||
fclr $f30
|
||||
mov $sp,$0
|
||||
ret ($26)
|
||||
.end OPENSSL_wipe_cpu
|
||||
|
||||
.globl OPENSSL_atomic_add
|
||||
.ent OPENSSL_atomic_add
|
||||
OPENSSL_atomic_add:
|
||||
.frame $30,0,$26
|
||||
.prologue 0
|
||||
1: ldl_l $0,($16)
|
||||
addl $0,$17,$1
|
||||
stl_c $1,($16)
|
||||
beq $1,1b
|
||||
addl $0,$17,$0
|
||||
ret ($26)
|
||||
.end OPENSSL_atomic_add
|
||||
|
||||
.globl OPENSSL_rdtsc
|
||||
.ent OPENSSL_rdtsc
|
||||
OPENSSL_rdtsc:
|
||||
.frame $30,0,$26
|
||||
.prologue 0
|
||||
rpcc $0
|
||||
ret ($26)
|
||||
.end OPENSSL_rdtsc
|
||||
|
||||
.globl OPENSSL_cleanse
|
||||
.ent OPENSSL_cleanse
|
||||
OPENSSL_cleanse:
|
||||
.frame $30,0,$26
|
||||
.prologue 0
|
||||
and $16,7,$0
|
||||
bic $17,7,$at
|
||||
beq $at,.Little
|
||||
beq $0,.Laligned
|
||||
|
||||
.Little:
|
||||
ldq_u $1,0($16)
|
||||
mov $16,$2
|
||||
.Lalign:
|
||||
mskbl $1,$16,$1
|
||||
lda $16,1($16)
|
||||
subq $17,1,$17
|
||||
subq $0,1,$0
|
||||
beq $17,.Lout
|
||||
bne $0,.Lalign
|
||||
.Lout: stq_u $1,0($2)
|
||||
beq $17,.Ldone
|
||||
bic $17,7,$at
|
||||
mov $17,$0
|
||||
beq $at,.Little
|
||||
|
||||
.Laligned:
|
||||
stq $31,0($16)
|
||||
subq $17,8,$17
|
||||
lda $16,8($16)
|
||||
bic $17,7,$at
|
||||
bne $at,.Laligned
|
||||
beq $17,.Ldone
|
||||
mov $17,$0
|
||||
br .Little
|
||||
.Ldone: ret ($26)
|
||||
.end OPENSSL_cleanse
|
||||
@@ -22,32 +22,30 @@ LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
|
||||
a_enum.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c a_strex.c \
|
||||
x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c x_bignum.c \
|
||||
x_long.c x_name.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c \
|
||||
x_nx509.c d2i_pu.c d2i_pr.c i2d_pu.c i2d_pr.c\
|
||||
d2i_pu.c d2i_pr.c i2d_pu.c i2d_pr.c\
|
||||
t_req.c t_x509.c t_x509a.c t_crl.c t_pkey.c t_spki.c t_bitst.c \
|
||||
tasn_new.c tasn_fre.c tasn_enc.c tasn_dec.c tasn_utl.c tasn_typ.c \
|
||||
tasn_prn.c ameth_lib.c \
|
||||
f_int.c f_string.c n_pkey.c \
|
||||
f_enum.c x_pkey.c a_bool.c x_exten.c bio_asn1.c bio_ndef.c asn_mime.c \
|
||||
asn1_gen.c asn1_par.c asn1_lib.c asn1_err.c a_bytes.c a_strnid.c \
|
||||
f_enum.c a_hdr.c x_pkey.c a_bool.c x_exten.c asn_mime.c \
|
||||
asn1_gen.c asn1_par.c asn1_lib.c asn1_err.c a_meth.c a_bytes.c a_strnid.c \
|
||||
evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c asn_moid.c
|
||||
LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \
|
||||
a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o \
|
||||
a_enum.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o a_strex.o \
|
||||
x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o x_bignum.o \
|
||||
x_long.o x_name.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o \
|
||||
x_nx509.o d2i_pu.o d2i_pr.o i2d_pu.o i2d_pr.o \
|
||||
d2i_pu.o d2i_pr.o i2d_pu.o i2d_pr.o \
|
||||
t_req.o t_x509.o t_x509a.o t_crl.o t_pkey.o t_spki.o t_bitst.o \
|
||||
tasn_new.o tasn_fre.o tasn_enc.o tasn_dec.o tasn_utl.o tasn_typ.o \
|
||||
tasn_prn.o ameth_lib.o \
|
||||
f_int.o f_string.o n_pkey.o \
|
||||
f_enum.o x_pkey.o a_bool.o x_exten.o bio_asn1.o bio_ndef.o asn_mime.o \
|
||||
asn1_gen.o asn1_par.o asn1_lib.o asn1_err.o a_bytes.o a_strnid.o \
|
||||
f_enum.o a_hdr.o x_pkey.o a_bool.o x_exten.o asn_mime.o \
|
||||
asn1_gen.o asn1_par.o asn1_lib.o asn1_err.o a_meth.o a_bytes.o a_strnid.o \
|
||||
evp_asn1.o asn_pack.o p5_pbe.o p5_pbev2.o p8_pkey.o asn_moid.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
EXHEADER= asn1.h asn1_mac.h asn1t.h
|
||||
HEADER= $(EXHEADER) asn1_locl.h
|
||||
HEADER= $(EXHEADER)
|
||||
|
||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
|
||||
@@ -65,7 +63,7 @@ pk: pk.c
|
||||
all: lib
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(ARX) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@touch lib
|
||||
|
||||
@@ -144,9 +142,9 @@ a_digest.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
a_digest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
a_digest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
a_digest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
a_digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
a_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
a_digest.o: ../../include/openssl/opensslconf.h
|
||||
a_digest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
a_digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
a_digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
a_digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
a_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
@@ -175,6 +173,14 @@ a_gentm.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_gentm.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
a_gentm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
a_gentm.o: ../cryptlib.h ../o_time.h a_gentm.c
|
||||
a_hdr.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
a_hdr.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
|
||||
a_hdr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
a_hdr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
a_hdr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
a_hdr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
a_hdr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
a_hdr.o: ../../include/openssl/symhacks.h ../cryptlib.h a_hdr.c
|
||||
a_i2d_fp.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
a_i2d_fp.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
a_i2d_fp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
@@ -199,6 +205,13 @@ a_mbstr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_mbstr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
a_mbstr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
a_mbstr.o: ../cryptlib.h a_mbstr.c
|
||||
a_meth.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_meth.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
a_meth.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
a_meth.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
a_meth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
a_meth.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
a_meth.o: ../../include/openssl/symhacks.h ../cryptlib.h a_meth.c
|
||||
a_object.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
a_object.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
a_object.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
@@ -237,27 +250,27 @@ a_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
a_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
a_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
a_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
a_sign.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
a_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
a_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_sign.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
a_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
a_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
a_sign.o: ../cryptlib.h a_sign.c asn1_locl.h
|
||||
a_sign.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
a_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
a_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
a_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
a_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
a_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
a_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
a_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_sign.c
|
||||
a_strex.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
a_strex.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
a_strex.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
a_strex.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
a_strex.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
a_strex.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
a_strex.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
a_strex.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_strex.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
a_strex.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
a_strex.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
a_strex.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
a_strex.o: ../cryptlib.h a_strex.c charmap.h
|
||||
a_strex.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
a_strex.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
a_strex.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
a_strex.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
a_strex.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
a_strex.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
a_strex.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
a_strex.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_strex.c charmap.h
|
||||
a_strnid.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
a_strnid.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
a_strnid.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
@@ -305,29 +318,14 @@ a_verify.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
a_verify.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
a_verify.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
a_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
a_verify.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
a_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
a_verify.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
a_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
a_verify.o: ../../include/openssl/opensslconf.h
|
||||
a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
a_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
a_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
a_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
a_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_verify.c
|
||||
a_verify.o: asn1_locl.h
|
||||
ameth_lib.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
ameth_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
ameth_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
ameth_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
ameth_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
ameth_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
|
||||
ameth_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
ameth_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
ameth_lib.o: ../../include/openssl/opensslconf.h
|
||||
ameth_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
ameth_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
ameth_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
ameth_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
ameth_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ameth_lib.c
|
||||
ameth_lib.o: asn1_locl.h
|
||||
asn1_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
asn1_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
asn1_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
@@ -341,8 +339,9 @@ asn1_gen.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
asn1_gen.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
asn1_gen.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
asn1_gen.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
asn1_gen.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
asn1_gen.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
asn1_gen.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
asn1_gen.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
asn1_gen.o: ../../include/openssl/opensslconf.h
|
||||
asn1_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
asn1_gen.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
asn1_gen.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
@@ -372,23 +371,24 @@ asn_mime.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
asn_mime.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
asn_mime.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
asn_mime.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
asn_mime.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
asn_mime.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
asn_mime.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
asn_mime.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
asn_mime.o: ../../include/openssl/opensslconf.h
|
||||
asn_mime.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
asn_mime.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
|
||||
asn_mime.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
asn_mime.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
asn_mime.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
asn_mime.o: ../cryptlib.h asn1_locl.h asn_mime.c
|
||||
asn_mime.o: ../cryptlib.h asn_mime.c
|
||||
asn_moid.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
asn_moid.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
asn_moid.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
asn_moid.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
|
||||
asn_moid.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
asn_moid.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
asn_moid.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
asn_moid.o: ../../include/openssl/opensslconf.h
|
||||
asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
asn_moid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
asn_moid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
asn_moid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
asn_moid.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
asn_moid.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
@@ -402,43 +402,28 @@ asn_pack.o: ../../include/openssl/opensslconf.h
|
||||
asn_pack.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
asn_pack.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
asn_pack.o: ../../include/openssl/symhacks.h ../cryptlib.h asn_pack.c
|
||||
bio_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
bio_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
bio_asn1.o: ../../include/openssl/opensslconf.h
|
||||
bio_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
bio_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
bio_asn1.o: ../../include/openssl/symhacks.h bio_asn1.c
|
||||
bio_ndef.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
|
||||
bio_ndef.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
|
||||
bio_ndef.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
bio_ndef.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
bio_ndef.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
bio_ndef.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
bio_ndef.o: ../../include/openssl/symhacks.h bio_ndef.c
|
||||
d2i_pr.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
d2i_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
d2i_pr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
d2i_pr.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
|
||||
d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
|
||||
d2i_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
d2i_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
d2i_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
d2i_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
d2i_pr.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
d2i_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
d2i_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
d2i_pr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h asn1_locl.h d2i_pr.c
|
||||
d2i_pr.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
d2i_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
d2i_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
d2i_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
|
||||
d2i_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
d2i_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h d2i_pr.c
|
||||
d2i_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
d2i_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
d2i_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
|
||||
d2i_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
d2i_pu.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
d2i_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
d2i_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
d2i_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
d2i_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
d2i_pu.o: ../cryptlib.h d2i_pu.c
|
||||
d2i_pu.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
d2i_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
d2i_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
d2i_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
|
||||
d2i_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
d2i_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h d2i_pu.c
|
||||
evp_asn1.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
evp_asn1.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
|
||||
evp_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
@@ -470,76 +455,77 @@ f_string.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
f_string.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
f_string.o: ../../include/openssl/symhacks.h ../cryptlib.h f_string.c
|
||||
i2d_pr.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
i2d_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
i2d_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
i2d_pr.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
|
||||
i2d_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
i2d_pr.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
i2d_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
i2d_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
i2d_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
i2d_pr.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
i2d_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
i2d_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
i2d_pr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h asn1_locl.h i2d_pr.c
|
||||
i2d_pr.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
i2d_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
i2d_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
i2d_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
|
||||
i2d_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
i2d_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h i2d_pr.c
|
||||
i2d_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
i2d_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
i2d_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
|
||||
i2d_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
i2d_pu.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
i2d_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
i2d_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
i2d_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
i2d_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
i2d_pu.o: ../cryptlib.h i2d_pu.c
|
||||
i2d_pu.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
i2d_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
i2d_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
i2d_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
|
||||
i2d_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
i2d_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h i2d_pu.c
|
||||
n_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
n_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/asn1t.h
|
||||
n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
n_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
n_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
n_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
n_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
n_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
n_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
n_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
n_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
n_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
n_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h n_pkey.c
|
||||
n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
n_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
n_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
n_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
n_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
|
||||
n_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
n_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
n_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
n_pkey.o: ../cryptlib.h n_pkey.c
|
||||
nsseq.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
|
||||
nsseq.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
nsseq.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
nsseq.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
nsseq.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
|
||||
nsseq.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
nsseq.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
nsseq.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
nsseq.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
nsseq.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
nsseq.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
nsseq.o: ../../include/openssl/x509_vfy.h nsseq.c
|
||||
nsseq.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
nsseq.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
nsseq.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
nsseq.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
nsseq.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
nsseq.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
nsseq.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h nsseq.c
|
||||
p5_pbe.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
p5_pbe.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
p5_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
p5_pbe.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
p5_pbe.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
p5_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
p5_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
p5_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
p5_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
p5_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
|
||||
p5_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
p5_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
p5_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
p5_pbe.o: ../cryptlib.h p5_pbe.c
|
||||
p5_pbe.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
p5_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
p5_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
p5_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
p5_pbe.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
|
||||
p5_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
p5_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
p5_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_pbe.c
|
||||
p5_pbev2.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
p5_pbev2.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
p5_pbev2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
p5_pbev2.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
p5_pbev2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
p5_pbev2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
p5_pbev2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
p5_pbev2.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
p5_pbev2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
p5_pbev2.o: ../../include/openssl/opensslconf.h
|
||||
p5_pbev2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
p5_pbev2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
|
||||
p5_pbev2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
@@ -552,48 +538,51 @@ p8_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
p8_pkey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
p8_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
p8_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
p8_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
p8_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
p8_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
p8_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
p8_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
p8_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p8_pkey.c
|
||||
p8_pkey.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
p8_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
p8_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
p8_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
p8_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
p8_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
p8_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
p8_pkey.o: ../cryptlib.h p8_pkey.c
|
||||
t_bitst.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
t_bitst.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
t_bitst.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_bitst.o: ../cryptlib.h t_bitst.c
|
||||
t_bitst.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_bitst.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h t_bitst.c
|
||||
t_crl.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_crl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
t_crl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_crl.o: ../cryptlib.h t_crl.c
|
||||
t_crl.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h t_crl.c
|
||||
t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
t_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
t_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
|
||||
t_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
|
||||
t_pkey.o: ../../include/openssl/ec.h ../../include/openssl/err.h
|
||||
t_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
t_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
t_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_pkey.o: ../cryptlib.h t_pkey.c
|
||||
t_req.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
@@ -602,57 +591,57 @@ t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
|
||||
t_req.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
t_req.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
t_req.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_req.o: ../cryptlib.h t_req.c
|
||||
t_req.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
|
||||
t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h t_req.c
|
||||
t_spki.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
t_spki.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
|
||||
t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
t_spki.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
t_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
t_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
t_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
|
||||
t_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_spki.o: ../cryptlib.h t_spki.c
|
||||
t_spki.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
t_spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_spki.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
t_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_spki.c
|
||||
t_x509.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
|
||||
t_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
t_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_x509.o: ../cryptlib.h t_x509.c
|
||||
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
|
||||
t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h t_x509.c
|
||||
t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
t_x509a.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
t_x509a.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
t_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
t_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
t_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
t_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_x509a.o: ../cryptlib.h t_x509a.c
|
||||
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
t_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
t_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
t_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
t_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_x509a.c
|
||||
tasn_dec.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
|
||||
tasn_dec.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
tasn_dec.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
@@ -686,21 +675,6 @@ tasn_new.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
tasn_new.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
tasn_new.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
tasn_new.o: ../../include/openssl/symhacks.h tasn_new.c
|
||||
tasn_prn.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
tasn_prn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
tasn_prn.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
|
||||
tasn_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
tasn_prn.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
tasn_prn.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
tasn_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
tasn_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
tasn_prn.o: ../../include/openssl/opensslconf.h
|
||||
tasn_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
tasn_prn.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
tasn_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
tasn_prn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
tasn_prn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
tasn_prn.o: ../cryptlib.h asn1_locl.h tasn_prn.c
|
||||
tasn_typ.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
|
||||
tasn_typ.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
|
||||
tasn_typ.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
|
||||
@@ -720,21 +694,23 @@ x_algor.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
x_algor.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
x_algor.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
x_algor.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
|
||||
x_algor.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_algor.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_algor.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_algor.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_algor.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_algor.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_algor.o: ../../include/openssl/x509_vfy.h x_algor.c
|
||||
x_algor.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_algor.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_algor.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_algor.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_algor.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_algor.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_algor.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_algor.o: x_algor.c
|
||||
x_attrib.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_attrib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_attrib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_attrib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_attrib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_attrib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_attrib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_attrib.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_attrib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_attrib.o: ../../include/openssl/opensslconf.h
|
||||
x_attrib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_attrib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_attrib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
@@ -751,42 +727,44 @@ x_bignum.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
x_bignum.o: ../../include/openssl/symhacks.h ../cryptlib.h x_bignum.c
|
||||
x_crl.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_crl.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_crl.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
|
||||
x_crl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
x_crl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
x_crl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
x_crl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
x_crl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_crl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_crl.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h asn1_locl.h x_crl.c
|
||||
x_crl.o: ../cryptlib.h x_crl.c
|
||||
x_exten.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
|
||||
x_exten.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
x_exten.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
x_exten.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
x_exten.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
|
||||
x_exten.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_exten.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_exten.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_exten.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_exten.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_exten.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_exten.o: ../../include/openssl/x509_vfy.h x_exten.c
|
||||
x_exten.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_exten.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_exten.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_exten.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_exten.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_exten.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_exten.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_exten.o: x_exten.c
|
||||
x_info.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
x_info.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_info.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_info.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_info.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_info.c
|
||||
x_info.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_info.o: ../cryptlib.h x_info.c
|
||||
x_long.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_long.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_long.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
@@ -802,129 +780,125 @@ x_name.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_name.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_name.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_name.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_name.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_name.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_name.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_name.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_name.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h asn1_locl.h x_name.c
|
||||
x_nx509.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
|
||||
x_nx509.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
x_nx509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
x_nx509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
x_nx509.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
|
||||
x_nx509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_nx509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_nx509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_nx509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_nx509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_nx509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_nx509.o: ../../include/openssl/x509_vfy.h x_nx509.c
|
||||
x_name.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_name.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_name.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_name.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_name.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_name.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_name.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_name.o: ../cryptlib.h x_name.c
|
||||
x_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
|
||||
x_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_pkey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_pkey.c
|
||||
x_pkey.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_pkey.o: ../cryptlib.h x_pkey.c
|
||||
x_pubkey.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_pubkey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_pubkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_pubkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
|
||||
x_pubkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
x_pubkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
x_pubkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_pubkey.o: ../../include/openssl/opensslconf.h
|
||||
x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
x_pubkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_pubkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_pubkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_pubkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
|
||||
x_pubkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_pubkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_pubkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_pubkey.o: ../cryptlib.h asn1_locl.h x_pubkey.c
|
||||
x_pubkey.o: ../cryptlib.h x_pubkey.c
|
||||
x_req.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_req.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_req.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_req.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_req.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_req.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_req.c
|
||||
x_req.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_req.o: ../cryptlib.h x_req.c
|
||||
x_sig.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_sig.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_sig.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_sig.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_sig.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_sig.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_sig.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_sig.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_sig.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_sig.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_sig.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_sig.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_sig.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_sig.c
|
||||
x_sig.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_sig.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_sig.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_sig.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_sig.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_sig.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_sig.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_sig.o: ../cryptlib.h x_sig.c
|
||||
x_spki.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_spki.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_spki.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_spki.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_spki.c
|
||||
x_spki.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_spki.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_spki.o: ../cryptlib.h x_spki.c
|
||||
x_val.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_val.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_val.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_val.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_val.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_val.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_val.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_val.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_val.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_val.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_val.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_val.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_val.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_val.c
|
||||
x_val.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_val.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_val.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_val.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_val.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_val.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_val.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_val.o: ../cryptlib.h x_val.c
|
||||
x_x509.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_x509.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_x509.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
|
||||
x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
x_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
|
||||
x_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
|
||||
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
|
||||
x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h x_x509.c
|
||||
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
|
||||
x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
x_x509.o: ../cryptlib.h x_x509.c
|
||||
x_x509a.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
x_x509a.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
x_x509a.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
x_x509a.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
|
||||
x_x509a.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
x_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
x_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
x_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
x_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
|
||||
x_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
x_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
x_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_x509a.c
|
||||
x_x509a.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
|
||||
x_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
|
||||
x_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
|
||||
x_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
x_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
x_x509a.o: ../cryptlib.h x_x509a.c
|
||||
|
||||
@@ -136,11 +136,16 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
|
||||
|
||||
p= *pp;
|
||||
i= *(p++);
|
||||
if (i > 7)
|
||||
{
|
||||
i=ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
|
||||
goto err;
|
||||
}
|
||||
/* We do this to preserve the settings. If we modify
|
||||
* the settings, via the _set_bit function, we will recalculate
|
||||
* on output */
|
||||
ret->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */
|
||||
ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|(i&0x07)); /* set */
|
||||
ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|i); /* set */
|
||||
|
||||
if (len-- > 1) /* using one because of the bits left byte */
|
||||
{
|
||||
@@ -223,26 +228,3 @@ int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n)
|
||||
return((a->data[w]&v) != 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if the given bit string contains only bits specified by
|
||||
* the flags vector. Returns 0 if there is at least one bit set in 'a'
|
||||
* which is not specified in 'flags', 1 otherwise.
|
||||
* 'len' is the length of 'flags'.
|
||||
*/
|
||||
int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a,
|
||||
unsigned char *flags, int flags_len)
|
||||
{
|
||||
int i, ok;
|
||||
/* Check if there is one bit set at all. */
|
||||
if (!a || !a->data) return 1;
|
||||
|
||||
/* Check each byte of the internal representation of the bit string. */
|
||||
ok = 1;
|
||||
for (i = 0; i < a->length && ok; ++i)
|
||||
{
|
||||
unsigned char mask = i < flags_len ? ~flags[i] : 0xff;
|
||||
/* We are done if there is an unneeded bit set. */
|
||||
ok = (a->data[i] & mask) == 0;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user