Compare commits
822 Commits
OpenSSL-en
...
LEVITTE_af
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
828f94d852 | ||
|
|
875a644a90 | ||
|
|
ec37635c94 | ||
|
|
fd836aeee0 | ||
|
|
560f7abb7e | ||
|
|
b6358c89a1 | ||
|
|
5d735465d1 | ||
|
|
9e051bac13 | ||
|
|
30fbcaa213 | ||
|
|
93825dddad | ||
|
|
a8aa764d3c | ||
|
|
e7716b7a19 | ||
|
|
a4e3150f00 | ||
|
|
edec614efd | ||
|
|
2457c19df1 | ||
|
|
5fa5eb71a4 | ||
|
|
3f39976da3 | ||
|
|
216ad9ef58 | ||
|
|
bc50157010 | ||
|
|
91180d45f9 | ||
|
|
d9f40bbe55 | ||
|
|
ec7c9ee8b8 | ||
|
|
f82bb9cb9c | ||
|
|
5a8922aed5 | ||
|
|
f2c1812560 | ||
|
|
4cfa4ae820 | ||
|
|
a30af36c77 | ||
|
|
5075521e75 | ||
|
|
ee3a47a994 | ||
|
|
f727266ae8 | ||
|
|
8bb0c8522a | ||
|
|
c6700d2746 | ||
|
|
1b06804491 | ||
|
|
dc90f64d56 | ||
|
|
6c43032121 | ||
|
|
37ead9be0b | ||
|
|
1751034669 | ||
|
|
d4575825f1 | ||
|
|
d04b1b4656 | ||
|
|
1247092776 | ||
|
|
7e22a1df55 | ||
|
|
bb5810d21d | ||
|
|
61a88c31c0 | ||
|
|
b86ed8d18f | ||
|
|
e5886a2388 | ||
|
|
8d1ebe0bd1 | ||
|
|
1fb724449d | ||
|
|
721a5e83f9 | ||
|
|
6df617a59d | ||
|
|
8c6336b0aa | ||
|
|
87203dc99a | ||
|
|
4de65cbc06 | ||
|
|
27b2b78f90 | ||
|
|
3a160f1dc6 | ||
|
|
7f24b1c3e9 | ||
|
|
a5e8bcfb7b | ||
|
|
9d5c3c1939 | ||
|
|
815d7057be | ||
|
|
30cb9ec715 | ||
|
|
af6dab9b00 | ||
|
|
cdb42bcf0c | ||
|
|
fc56b52924 | ||
|
|
a32fc687de | ||
|
|
c0017a5a65 | ||
|
|
344e86645d | ||
|
|
075521725d | ||
|
|
5fdf06666c | ||
|
|
f28e8bd300 | ||
|
|
de02ec2767 | ||
|
|
112341031b | ||
|
|
7cf803230b | ||
|
|
79b42e7654 | ||
|
|
f0c5db92f7 | ||
|
|
d420ac2c7d | ||
|
|
b79aa47a0c | ||
|
|
e88c577738 | ||
|
|
a2b0de98af | ||
|
|
4775944f81 | ||
|
|
2abd5b7aa0 | ||
|
|
380e145daf | ||
|
|
a9f2330f43 | ||
|
|
ce38bb1a8c | ||
|
|
919f8bcd21 | ||
|
|
2bfd2c74d2 | ||
|
|
82b2f57e30 | ||
|
|
2ae1ea3788 | ||
|
|
34066d741a | ||
|
|
b74cc0776b | ||
|
|
e7e5fe4705 | ||
|
|
998ae048e7 | ||
|
|
e65c2b9872 | ||
|
|
2fe9ab8e20 | ||
|
|
1145e03870 | ||
|
|
6781efb92f | ||
|
|
0bf1c1d80d | ||
|
|
6ed474ca66 | ||
|
|
46cb8d3689 | ||
|
|
23fc5ac646 | ||
|
|
5734bebe05 | ||
|
|
657a919598 | ||
|
|
6859bb1a22 | ||
|
|
3822740ce3 | ||
|
|
0d78bc3356 | ||
|
|
d87b79bf31 | ||
|
|
70ef9c5a3d | ||
|
|
b727907ae8 | ||
|
|
444c3a8492 | ||
|
|
0b352c58db | ||
|
|
03ddbdd9b9 | ||
|
|
5ebdb39084 | ||
|
|
d45a098472 | ||
|
|
6d5ffb591b | ||
|
|
7ce9e425bc | ||
|
|
4d8743f490 | ||
|
|
4c8b4f9d03 | ||
|
|
81ba5f6713 | ||
|
|
6defae04f3 | ||
|
|
e1064adfd3 | ||
|
|
d7559f16cd | ||
|
|
9e989810ba | ||
|
|
ec2179cf81 | ||
|
|
a8287a90ea | ||
|
|
ad5f0ed509 | ||
|
|
0a4c8baf5e | ||
|
|
95de3d204f | ||
|
|
31182ad39b | ||
|
|
f35232e6f3 | ||
|
|
fda5e38551 | ||
|
|
ac9c6e10a4 | ||
|
|
1a01733047 | ||
|
|
d2cd46127c | ||
|
|
9dde17e8b4 | ||
|
|
37af03d311 | ||
|
|
f7a397cc8d | ||
|
|
cd2e8a6f2d | ||
|
|
d18b993c43 | ||
|
|
e6e81c5894 | ||
|
|
f75abcefed | ||
|
|
18f62d4b82 | ||
|
|
5c0c22803e | ||
|
|
0ef85c7f45 | ||
|
|
078dd1a0f9 | ||
|
|
2b96c95197 | ||
|
|
c5f1c7b4d8 | ||
|
|
d870740cd7 | ||
|
|
d8ec0dcf45 | ||
|
|
c465e7941e | ||
|
|
933398f110 | ||
|
|
cfd06a6223 | ||
|
|
a9fd78f9da | ||
|
|
5f747c7f4b | ||
|
|
c4db1a8b5c | ||
|
|
f7939fcd9a | ||
|
|
d531c9014d | ||
|
|
aca95e0b2f | ||
|
|
bc3c578208 | ||
|
|
06e4024d98 | ||
|
|
8087d8f7ea | ||
|
|
31166ec8f3 | ||
|
|
2754597013 | ||
|
|
2ce90b9b74 | ||
|
|
4e952ae4fc | ||
|
|
db59141467 | ||
|
|
8a66d17899 | ||
|
|
2eeaa0261e | ||
|
|
8dc344ccbf | ||
|
|
6bcd3f903a | ||
|
|
40f935f5b4 | ||
|
|
0991f07034 | ||
|
|
2aaec9cced | ||
|
|
9d473aa2e4 | ||
|
|
6145b0b183 | ||
|
|
2a85f77146 | ||
|
|
66b82f5aad | ||
|
|
12bdceac8a | ||
|
|
aea293e3bc | ||
|
|
8ad7e3ad2a | ||
|
|
0b6956b474 | ||
|
|
0bb6187e71 | ||
|
|
c5a5546389 | ||
|
|
77fe058c10 | ||
|
|
8d9086dfa2 | ||
|
|
0602abf5bd | ||
|
|
caf044cb3e | ||
|
|
a08ced78c8 | ||
|
|
83eb412da8 | ||
|
|
4d1c443123 | ||
|
|
f44e184ec6 | ||
|
|
377dcdba44 | ||
|
|
8242354952 | ||
|
|
c40b9bdefb | ||
|
|
6895cca89d | ||
|
|
f82ab534c6 | ||
|
|
f6e8c19ed1 | ||
|
|
cf89b40584 | ||
|
|
c076599c18 | ||
|
|
4d8148fa98 | ||
|
|
aed29ce5ea | ||
|
|
9ad82c123a | ||
|
|
eeff6bb6b3 | ||
|
|
d90e74c50c | ||
|
|
2990244980 | ||
|
|
c798868d96 | ||
|
|
057a04398d | ||
|
|
7f3ba9428f | ||
|
|
3c02e24bb3 | ||
|
|
1be02dd842 | ||
|
|
3d7c4a5a6d | ||
|
|
11171f3c74 | ||
|
|
ba9f80c5d5 | ||
|
|
e59659dc41 | ||
|
|
253e893c2b | ||
|
|
0ad2c4f85b | ||
|
|
0e6c20da46 | ||
|
|
f6b659cba4 | ||
|
|
6bd27f8644 | ||
|
|
dfe399e7d9 | ||
|
|
7068c8b1a6 | ||
|
|
82384690e2 | ||
|
|
e6fa67fa93 | ||
|
|
9ea72d3705 | ||
|
|
a907751350 | ||
|
|
560dfd2a02 | ||
|
|
14f3d7c5cc | ||
|
|
510dc1ecd0 | ||
|
|
563c05e2dc | ||
|
|
643ecd2ed6 | ||
|
|
88401ed449 | ||
|
|
3aa8d3a7f1 | ||
|
|
5b6e7c8c65 | ||
|
|
f96d1af449 | ||
|
|
968766cad8 | ||
|
|
652ae06bad | ||
|
|
ddc38679ce | ||
|
|
02e0559477 | ||
|
|
ada0e717fa | ||
|
|
2c789c82be | ||
|
|
d143dce03c | ||
|
|
f9d183c209 | ||
|
|
182cd19dea | ||
|
|
61f00386ab | ||
|
|
2ae0352b0f | ||
|
|
94805c84d1 | ||
|
|
6f2f534b58 | ||
|
|
da6c44fc97 | ||
|
|
da0d33560f | ||
|
|
9d19fbc4fc | ||
|
|
aa5ae4841e | ||
|
|
eb3d68c454 | ||
|
|
c89f31def0 | ||
|
|
ed5fae580e | ||
|
|
d55141ed7a | ||
|
|
a99ce1a574 | ||
|
|
c687a3d5d5 | ||
|
|
dfc3151925 | ||
|
|
0fbffe7a71 | ||
|
|
037f6e73f1 | ||
|
|
cf82439de8 | ||
|
|
37fcd48f86 | ||
|
|
cf9a88cad7 | ||
|
|
4f1cd8324c | ||
|
|
ed7f1d0bc6 | ||
|
|
f6b9cd7f82 | ||
|
|
8fbb2af392 | ||
|
|
c5aba56c5b | ||
|
|
fd4ef69913 | ||
|
|
834ac33a37 | ||
|
|
4e9023f4d2 | ||
|
|
d3a28e8b8d | ||
|
|
0bd71d3b7e | ||
|
|
d97322f0e6 | ||
|
|
b52d512dfa | ||
|
|
a3a2ff4cd9 | ||
|
|
5a1fd87ec1 | ||
|
|
8645c415cf | ||
|
|
700d86ea18 | ||
|
|
54bbde3c3f | ||
|
|
c14b337570 | ||
|
|
e666c4599f | ||
|
|
98cec7fc7b | ||
|
|
fadd2246a0 | ||
|
|
c78b4f1d3d | ||
|
|
33862b90bb | ||
|
|
36bad5cdfd | ||
|
|
54f6451670 | ||
|
|
490967195a | ||
|
|
606c8048a0 | ||
|
|
e66d863cd0 | ||
|
|
a069460015 | ||
|
|
55b12f8641 | ||
|
|
40e5b9abeb | ||
|
|
dcfb57c736 | ||
|
|
2ee67f1dad | ||
|
|
4af3184662 | ||
|
|
e31047744a | ||
|
|
f6eba601b0 | ||
|
|
f796dc5c06 | ||
|
|
50078051bd | ||
|
|
db01746978 | ||
|
|
63b815583b | ||
|
|
ca82ac1fee | ||
|
|
aff0542844 | ||
|
|
beab098d53 | ||
|
|
02b95b7499 | ||
|
|
c4d471552f | ||
|
|
01fc834bc9 | ||
|
|
f7f8d82aaa | ||
|
|
4f17dfcd75 | ||
|
|
83b4f49c0a | ||
|
|
60790aff6f | ||
|
|
e19d0ef068 | ||
|
|
f5f7dffdd1 | ||
|
|
edd55d08f5 | ||
|
|
83743ad039 | ||
|
|
163f5b236c | ||
|
|
513c01a591 | ||
|
|
d9a2a89a17 | ||
|
|
31939f1544 | ||
|
|
11ce33a71d | ||
|
|
9acef3bbd7 | ||
|
|
164bc7dae8 | ||
|
|
f59c941950 | ||
|
|
0239876511 | ||
|
|
93c929e411 | ||
|
|
c2dac35a02 | ||
|
|
727ef76ebd | ||
|
|
bca52f7d4e | ||
|
|
48c36fdb2a | ||
|
|
9b2042fac3 | ||
|
|
816d785721 | ||
|
|
742b139f54 | ||
|
|
3b30121bd9 | ||
|
|
9ee789e6c3 | ||
|
|
b9d2d20086 | ||
|
|
b9d7ca9748 | ||
|
|
5b194dfbd5 | ||
|
|
7f6af7d9db | ||
|
|
42b2b6a2d5 | ||
|
|
d1465bac90 | ||
|
|
3bbb0212f3 | ||
|
|
a5db6fa576 | ||
|
|
9236b5b013 | ||
|
|
535fba4907 | ||
|
|
7e4140f73f | ||
|
|
1ae0a83bdd | ||
|
|
7ae46c6761 | ||
|
|
d584fd6b66 | ||
|
|
54dbdd9837 | ||
|
|
9d6c32d6d1 | ||
|
|
26851b6b42 | ||
|
|
ea5240a5ed | ||
|
|
eec7968f18 | ||
|
|
1cc087fe4f | ||
|
|
040c687ce4 | ||
|
|
cd1226bc6a | ||
|
|
7a04fdd87f | ||
|
|
138f970e6e | ||
|
|
1a0c1f9052 | ||
|
|
1774e22d6f | ||
|
|
26abc8f01a | ||
|
|
5924c21608 | ||
|
|
c93fbfaebc | ||
|
|
0b1c00abeb | ||
|
|
721688c2f8 | ||
|
|
a109220107 | ||
|
|
4a4a04622e | ||
|
|
d6fd88fffd | ||
|
|
e96133e4cf | ||
|
|
f65a75786b | ||
|
|
0b55368306 | ||
|
|
43eb3b0130 | ||
|
|
0a861ab7f3 | ||
|
|
7b36590b17 | ||
|
|
a8b728445c | ||
|
|
af0f0f3e8f | ||
|
|
8d570498a2 | ||
|
|
4c771796d5 | ||
|
|
d6df2b281f | ||
|
|
6fcf735497 | ||
|
|
b5f96e8818 | ||
|
|
3ae70939ba | ||
|
|
c433d72593 | ||
|
|
68b42986cb | ||
|
|
57544ee224 | ||
|
|
83b23ed967 | ||
|
|
4342c5c1a0 | ||
|
|
16b1b03543 | ||
|
|
e6526fbf4d | ||
|
|
8152d88799 | ||
|
|
4ce4884a5b | ||
|
|
db598fbce2 | ||
|
|
8382ec5d37 | ||
|
|
0998cfaadd | ||
|
|
c4448f60d6 | ||
|
|
63b6fe2bf6 | ||
|
|
f85b68cd49 | ||
|
|
5679bcce07 | ||
|
|
24692fc5d7 | ||
|
|
4390d66179 | ||
|
|
d678cc07ed | ||
|
|
6dd6da6005 | ||
|
|
03eeb07152 | ||
|
|
1a15c89988 | ||
|
|
d0a4bd00b6 | ||
|
|
423b1a840c | ||
|
|
a47789e849 | ||
|
|
e5b0508a14 | ||
|
|
c4d00669a0 | ||
|
|
d6cab100fa | ||
|
|
81bd0446a9 | ||
|
|
520b76ffd9 | ||
|
|
1c2d141238 | ||
|
|
32e75dd3f0 | ||
|
|
abfc6a3a9b | ||
|
|
5cc5ec1bba | ||
|
|
f80153e20b | ||
|
|
33b34a9d8f | ||
|
|
9b94f215b1 | ||
|
|
8b5bcef798 | ||
|
|
ea17e1f00f | ||
|
|
543105ac17 | ||
|
|
3789284807 | ||
|
|
be9bec9bc7 | ||
|
|
9c35452842 | ||
|
|
69104cdf34 | ||
|
|
dfefdb41f7 | ||
|
|
cd6ab56da0 | ||
|
|
c988c9b839 | ||
|
|
bff8e1dddb | ||
|
|
641e6ef2cb | ||
|
|
9e9e8cb6a8 | ||
|
|
f118514501 | ||
|
|
39c4b7092c | ||
|
|
c7e7fc3ee4 | ||
|
|
786b0075d5 | ||
|
|
fb10590910 | ||
|
|
abf21308d2 | ||
|
|
8c84b677e2 | ||
|
|
d5ef144222 | ||
|
|
741dae576f | ||
|
|
59ade20500 | ||
|
|
c11b9af75e | ||
|
|
08a54f6e6a | ||
|
|
8305477157 | ||
|
|
e8cc7de4f4 | ||
|
|
3b6aa36c77 | ||
|
|
03829b2b47 | ||
|
|
87c9c659de | ||
|
|
751ff1d376 | ||
|
|
d3ae5b1c8a | ||
|
|
0f3879455b | ||
|
|
0c7d61ee0e | ||
|
|
78951e7711 | ||
|
|
9ba4cc007b | ||
|
|
7b5a6c7a62 | ||
|
|
44deca977d | ||
|
|
536b73e78e | ||
|
|
940767b03f | ||
|
|
d4a47a5778 | ||
|
|
b24668626e | ||
|
|
ea3675b5b6 | ||
|
|
c554155b58 | ||
|
|
a1d12daed2 | ||
|
|
6f528cac5a | ||
|
|
10a66ad389 | ||
|
|
e986704d24 | ||
|
|
ce06265a37 | ||
|
|
439909a068 | ||
|
|
d177e6180d | ||
|
|
48f1fa7482 | ||
|
|
aa9d896b0d | ||
|
|
42a559163d | ||
|
|
3285eb336c | ||
|
|
02da5bcd83 | ||
|
|
9ed1fa4813 | ||
|
|
500df82a96 | ||
|
|
e8e0e3716a | ||
|
|
bc441b739b | ||
|
|
e6539fe22d | ||
|
|
ba5df66a8b | ||
|
|
12d4e7b8c8 | ||
|
|
bba2cb3ada | ||
|
|
52c4c51f02 | ||
|
|
767712fa62 | ||
|
|
90e8a3102b | ||
|
|
879650b866 | ||
|
|
176f31ddec | ||
|
|
fe14ee96db | ||
|
|
57376542a0 | ||
|
|
b8dc9693a7 | ||
|
|
6ac26a5ce5 | ||
|
|
155bd1137e | ||
|
|
f0dc08e656 | ||
|
|
e9ec63961b | ||
|
|
0185803cc2 | ||
|
|
5c9a9c9c33 | ||
|
|
63ff3e83fc | ||
|
|
b4f43344d5 | ||
|
|
c8c5cec1f9 | ||
|
|
66ecdf3bfb | ||
|
|
7841edc9c1 | ||
|
|
132eaa59da | ||
|
|
5562cfaca4 | ||
|
|
c8252b71b5 | ||
|
|
94949a50aa | ||
|
|
0214893e6a | ||
|
|
5be4a42e99 | ||
|
|
f2aa055ec6 | ||
|
|
62e3163b1b | ||
|
|
8214e74f76 | ||
|
|
542a1b1a2e | ||
|
|
5672e3a321 | ||
|
|
fbbfd86b67 | ||
|
|
d8cbc93585 | ||
|
|
5b0b0e98ce | ||
|
|
d5234c7b3a | ||
|
|
77e270d10e | ||
|
|
c893bffae7 | ||
|
|
988e8458ad | ||
|
|
758f942b88 | ||
|
|
26e9724458 | ||
|
|
4879ec7bf3 | ||
|
|
b653327d47 | ||
|
|
4cadedef57 | ||
|
|
27068df7e0 | ||
|
|
b12753dffc | ||
|
|
79221bc265 | ||
|
|
ffa49dc3d9 | ||
|
|
b7bbac72c4 | ||
|
|
c1269c81fd | ||
|
|
794a386af3 | ||
|
|
e270cf9c5e | ||
|
|
7e38616d1f | ||
|
|
85d686e723 | ||
|
|
2d3de726c5 | ||
|
|
4989f0599f | ||
|
|
e4b52ac353 | ||
|
|
abd22c9c46 | ||
|
|
ba729265a8 | ||
|
|
9ec1d35f29 | ||
|
|
cf56663fb7 | ||
|
|
ea513641d0 | ||
|
|
8537943e8b | ||
|
|
a8f5b2ed50 | ||
|
|
33075f229e | ||
|
|
28f573a28d | ||
|
|
e2c9c91b5b | ||
|
|
d42d2d1ab6 | ||
|
|
65b254e8c0 | ||
|
|
82871eaa17 | ||
|
|
24893ca999 | ||
|
|
27a9bf17c7 | ||
|
|
37c660ff9b | ||
|
|
772ec4135c | ||
|
|
0e9035ac98 | ||
|
|
4e5d3a7f98 | ||
|
|
379e568950 | ||
|
|
c09a297892 | ||
|
|
2619676256 | ||
|
|
33cc07f79a | ||
|
|
c029841e36 | ||
|
|
bfa3555081 | ||
|
|
5d780babe3 | ||
|
|
5cd48abf9f | ||
|
|
db5006df04 | ||
|
|
3d6a84c42a | ||
|
|
5fe11c7533 | ||
|
|
a1d57849b3 | ||
|
|
0b13e9f055 | ||
|
|
96f7065f63 | ||
|
|
f3c22ef10d | ||
|
|
a85bef1899 | ||
|
|
bb3e67f315 | ||
|
|
c0a93e31ab | ||
|
|
2e60ea7634 | ||
|
|
4e78074b39 | ||
|
|
b637670f03 | ||
|
|
bd1217a176 | ||
|
|
da45180de4 | ||
|
|
82516e3baf | ||
|
|
c1862f9136 | ||
|
|
9048c7245b | ||
|
|
02bf9a151a | ||
|
|
d3b5cb5343 | ||
|
|
97e6bf6b22 | ||
|
|
04da4558dd | ||
|
|
0c3426da86 | ||
|
|
9b3f03d5a2 | ||
|
|
9abff96b2f | ||
|
|
722d17cbac | ||
|
|
59b846c515 | ||
|
|
42bf2a5cdc | ||
|
|
80bcbaa02f | ||
|
|
7c4e24af38 | ||
|
|
726c223143 | ||
|
|
59ae8c9419 | ||
|
|
0bdd2da5d2 | ||
|
|
2f09524501 | ||
|
|
06492aef01 | ||
|
|
c00cee00fd | ||
|
|
8228f302dd | ||
|
|
018c56fdca | ||
|
|
d745af4b0c | ||
|
|
44ea41cfff | ||
|
|
acad5755a2 | ||
|
|
28b958f732 | ||
|
|
4e59cd3bb6 | ||
|
|
a74333f905 | ||
|
|
365e14622a | ||
|
|
8ec16ce711 | ||
|
|
0e4aa0d2d2 | ||
|
|
08cb96bba2 | ||
|
|
cdc5b4a41e | ||
|
|
52e5e5c2ba | ||
|
|
c653b56937 | ||
|
|
04aff67de4 | ||
|
|
1a6356b2ca | ||
|
|
b05645902a | ||
|
|
54d4f8c320 | ||
|
|
c76153f31d | ||
|
|
8cbb91c857 | ||
|
|
aaae0aa48b | ||
|
|
0535d3b25f | ||
|
|
62be003150 | ||
|
|
364c7cd621 | ||
|
|
9d5390a049 | ||
|
|
bda2fa364d | ||
|
|
caa7b2ad4f | ||
|
|
c14b4d6b38 | ||
|
|
0382c95e4d | ||
|
|
fda20f08d0 | ||
|
|
afd41c9fc7 | ||
|
|
2964ba8c6a | ||
|
|
c0cc5c3059 | ||
|
|
e68cb95d84 | ||
|
|
448666239c | ||
|
|
c0ac323360 | ||
|
|
a0cd3ca62b | ||
|
|
4a9476dd8d | ||
|
|
8d2511688d | ||
|
|
969511d2cb | ||
|
|
989f48d8c1 | ||
|
|
f8ea5cb579 | ||
|
|
360e506710 | ||
|
|
09ad2458b8 | ||
|
|
ad200a864e | ||
|
|
9d1b5614f9 | ||
|
|
416b19c6fc | ||
|
|
5b7249f302 | ||
|
|
699543e4a2 | ||
|
|
4309c4ad46 | ||
|
|
4ebb5293fc | ||
|
|
2814c62915 | ||
|
|
876e96fdbf | ||
|
|
f68843e3d7 | ||
|
|
19a97a1df0 | ||
|
|
72997517b0 | ||
|
|
2a9fca82d2 | ||
|
|
55b1516770 | ||
|
|
3cc9a89dda | ||
|
|
46a0d4fbcb | ||
|
|
04945fda66 | ||
|
|
97e2e71ef9 | ||
|
|
c8a647846c | ||
|
|
90ce14cd84 | ||
|
|
28e276f139 | ||
|
|
f22e1e4dd2 | ||
|
|
e0d769caa2 | ||
|
|
4a37c48789 | ||
|
|
ad492c3601 | ||
|
|
0c055b201e | ||
|
|
7eed0fc041 | ||
|
|
7a1c6aa2a3 | ||
|
|
948dcdb81b | ||
|
|
08101d72ce | ||
|
|
75c4028585 | ||
|
|
85f258d1c2 | ||
|
|
49be7042dc | ||
|
|
44fcd3ef3e | ||
|
|
21cde7a41c | ||
|
|
8598289936 | ||
|
|
35dde7480f | ||
|
|
5e42f9ab46 | ||
|
|
7acf00a633 | ||
|
|
69339d254b | ||
|
|
ec517d25e8 | ||
|
|
ce9b1b0573 | ||
|
|
0a2407a851 | ||
|
|
76a03d568e | ||
|
|
7c03f26393 | ||
|
|
9ff9e406ea | ||
|
|
b5beb13abb | ||
|
|
ceb12d3074 | ||
|
|
59c0dd56ab | ||
|
|
dcf19c173c | ||
|
|
e235000169 | ||
|
|
821951b851 | ||
|
|
35ba1f17dc | ||
|
|
ea8e0cc7c2 | ||
|
|
cb661c56b0 | ||
|
|
e904bd0ddc | ||
|
|
e9883d285d | ||
|
|
8d6ad9e39d | ||
|
|
aa18245f7e | ||
|
|
316bfb77b5 | ||
|
|
9b58214e4a | ||
|
|
3c801fa460 | ||
|
|
1c9202004b | ||
|
|
1004c99c29 | ||
|
|
c9ecb1edd8 | ||
|
|
8baf5fdca0 | ||
|
|
aafafa314d | ||
|
|
49e42a1f60 | ||
|
|
9cd16b1dea | ||
|
|
12cd28258d | ||
|
|
9564997222 | ||
|
|
f968059c67 | ||
|
|
0b900a5e93 | ||
|
|
09867a47a4 | ||
|
|
9d5c42b61b | ||
|
|
8e7a8b68d2 | ||
|
|
4d625031a5 | ||
|
|
26a60b2eb0 | ||
|
|
07d09fdb66 | ||
|
|
4553ed276b | ||
|
|
62966f3829 | ||
|
|
c445142505 | ||
|
|
f70ddce761 | ||
|
|
e29246cb17 | ||
|
|
146e6776f5 | ||
|
|
a45051fbfc | ||
|
|
ec9f67f610 | ||
|
|
30c08f2e3d | ||
|
|
9f100cf344 | ||
|
|
a5a01e9051 | ||
|
|
6be4688bdc | ||
|
|
717c5cdcc7 | ||
|
|
0654bba39f | ||
|
|
4d77d5b316 | ||
|
|
2f98abbcb6 | ||
|
|
270fa8aeda | ||
|
|
4329db3726 | ||
|
|
6f7ac8e1b0 | ||
|
|
a1457874c6 | ||
|
|
18be6c4116 | ||
|
|
dad1535f7a | ||
|
|
f60e6604b8 | ||
|
|
0d3f2ccb62 | ||
|
|
14676ffcd6 | ||
|
|
e5a08ce44d | ||
|
|
b9b6e14b4a | ||
|
|
442d42300b | ||
|
|
75e1c74724 | ||
|
|
5db2b5e573 | ||
|
|
005ef84c5d | ||
|
|
f92570f00a | ||
|
|
9314e366c8 | ||
|
|
b22c7a1cfb | ||
|
|
99efc0f50f | ||
|
|
d979d09ccc | ||
|
|
c17810b087 | ||
|
|
e0b2073fd4 | ||
|
|
123e5dfc3a | ||
|
|
0edad88a31 | ||
|
|
4ccfe5f49b | ||
|
|
e189872486 | ||
|
|
fdaea9ed2e | ||
|
|
5daec7ea0e | ||
|
|
e9224c7177 | ||
|
|
e90e719739 | ||
|
|
7ba666fa0e | ||
|
|
86a62cf15c | ||
|
|
b11405723d | ||
|
|
4c3a2b4f8a | ||
|
|
bbf8198feb | ||
|
|
3dda0dd2a2 | ||
|
|
fa63a98ad8 | ||
|
|
1fc73fef48 | ||
|
|
90543bd07a | ||
|
|
43ecece595 | ||
|
|
4ba8cabf62 | ||
|
|
f68bb3c51f | ||
|
|
6d4ac67ac1 | ||
|
|
b84d5b72f1 | ||
|
|
8cbccedf7c | ||
|
|
1c24347062 | ||
|
|
9ef888130d | ||
|
|
4387f47832 | ||
|
|
38d6e4bb50 | ||
|
|
ced621e3c2 | ||
|
|
85940ea8ea | ||
|
|
439ae4d398 | ||
|
|
4fbe40c54f | ||
|
|
578ca7e4cd | ||
|
|
7e8c30b589 | ||
|
|
2b32b28191 | ||
|
|
532215f2db | ||
|
|
5319be4438 | ||
|
|
f7a3e73ef6 | ||
|
|
ff3345cb72 | ||
|
|
716b2079dc | ||
|
|
e7b6228fd3 | ||
|
|
2053c43de2 | ||
|
|
1c3e4a3660 | ||
|
|
4707991520 | ||
|
|
7a1f92fdc3 | ||
|
|
e7a285694e | ||
|
|
6ab285bf4c | ||
|
|
1d3159bcca | ||
|
|
f60ceb54eb | ||
|
|
0f995b2f40 | ||
|
|
848f735ae4 | ||
|
|
a678430602 | ||
|
|
e9b553dac1 | ||
|
|
db3758923b | ||
|
|
5e4a75e79f | ||
|
|
43d601641f | ||
|
|
55f78baf32 | ||
|
|
6c359479d7 | ||
|
|
4579924b7e | ||
|
|
2047bda6fb | ||
|
|
406c6f6962 |
618
CHANGES
618
CHANGES
@@ -2,7 +2,298 @@
|
|||||||
OpenSSL CHANGES
|
OpenSSL CHANGES
|
||||||
_______________
|
_______________
|
||||||
|
|
||||||
Changes between 0.9.7 and 0.9.8 [xx XXX 2002]
|
Changes between 0.9.7c and 0.9.8 [xx XXX xxxx]
|
||||||
|
|
||||||
|
*) Constify all or almost all d2i, c2i, s2i and r2i functions, along with
|
||||||
|
associated ASN1, EVP and SSL functions and old ASN1 macros.
|
||||||
|
|
||||||
|
*) BN_zero() only needs to set 'top' and 'neg' to zero for correct results,
|
||||||
|
and this should never fail. So the return value from the use of
|
||||||
|
BN_set_word() (which can fail due to needless expansion) is now deprecated;
|
||||||
|
if OPENSSL_NO_DEPRECATED is defined, BN_zero() is a void macro.
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) BN_CTX_get() should return zero-valued bignums, providing the same
|
||||||
|
initialised value as BN_new().
|
||||||
|
[Geoff Thorpe, suggested by Ulf M<>ller]
|
||||||
|
|
||||||
|
*) Support for inhibitAnyPolicy certificate extension.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) An audit of the BIGNUM code is underway, for which debugging code is
|
||||||
|
enabled when BN_DEBUG is defined. This makes stricter enforcements on what
|
||||||
|
is considered valid when processing BIGNUMs, and causes execution to
|
||||||
|
assert() when a problem is discovered. If BN_DEBUG_RAND is defined,
|
||||||
|
further steps are taken to deliberately pollute unused data in BIGNUM
|
||||||
|
structures to try and expose faulty code further on. For now, openssl will
|
||||||
|
(in its default mode of operation) continue to tolerate the inconsistent
|
||||||
|
forms that it has tolerated in the past, but authors and packagers should
|
||||||
|
consider trying openssl and their own applications when compiled with
|
||||||
|
these debugging symbols defined. It will help highlight potential bugs in
|
||||||
|
their own code, and will improve the test coverage for OpenSSL itself. At
|
||||||
|
some point, these tighter rules will become openssl's default to improve
|
||||||
|
maintainability, though the assert()s and other overheads will remain only
|
||||||
|
in debugging configurations. See bn.h for more details.
|
||||||
|
[Geoff Thorpe, Nils Larsch, Ulf M<>ller]
|
||||||
|
|
||||||
|
*) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure
|
||||||
|
that can only be obtained through BN_CTX_new() (which implicitly
|
||||||
|
initialises it). The presence of this function only made it possible
|
||||||
|
to overwrite an existing structure (and cause memory leaks).
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) Because of the callback-based approach for implementing LHASH as a
|
||||||
|
template type, lh_insert() adds opaque objects to hash-tables and
|
||||||
|
lh_doall() or lh_doall_arg() are typically used with a destructor callback
|
||||||
|
to clean up those corresponding objects before destroying the hash table
|
||||||
|
(and losing the object pointers). So some over-zealous constifications in
|
||||||
|
LHASH have been relaxed so that lh_insert() does not take (nor store) the
|
||||||
|
objects as "const" and the lh_doall[_arg] callback wrappers are not
|
||||||
|
prototyped to have "const" restrictions on the object pointers they are
|
||||||
|
given (and so aren't required to cast them away any more).
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) The tmdiff.h API was so ugly and minimal that our own timing utility
|
||||||
|
(speed) prefers to use its own implementation. The two implementations
|
||||||
|
haven't been consolidated as yet (volunteers?) but the tmdiff API has had
|
||||||
|
its object type properly exposed (MS_TM) instead of casting to/from "char
|
||||||
|
*". This may still change yet if someone realises MS_TM and "ms_time_***"
|
||||||
|
aren't necessarily the greatest nomenclatures - but this is what was used
|
||||||
|
internally to the implementation so I've used that for now.
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) Ensure that deprecated functions do not get compiled when
|
||||||
|
OPENSSL_NO_DEPRECATED is defined. Some "openssl" subcommands and a few of
|
||||||
|
the self-tests were still using deprecated key-generation functions so
|
||||||
|
these have been updated also.
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) Reorganise PKCS#7 code to separate the digest location functionality
|
||||||
|
into PKCS7_find_digest(), digest addtion into PKCS7_bio_add_digest().
|
||||||
|
New function PKCS7_set_digest() to set the digest type for PKCS#7
|
||||||
|
digestedData type. Add additional code to correctly generate the
|
||||||
|
digestedData type and add support for this type in PKCS7 initialization
|
||||||
|
functions.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) New function PKCS7_set0_type_other() this initializes a PKCS7
|
||||||
|
structure of type "other".
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Fix prime generation loop in crypto/bn/bn_prime.pl by making
|
||||||
|
sure the loop does correctly stop and breaking ("division by zero")
|
||||||
|
modulus operations are not performed. The (pre-generated) prime
|
||||||
|
table crypto/bn/bn_prime.h was already correct, but it could not be
|
||||||
|
re-generated on some platforms because of the "division by zero"
|
||||||
|
situation in the script.
|
||||||
|
[Ralf S. Engelschall]
|
||||||
|
|
||||||
|
*) Update support for ECC-based TLS ciphersuites according to
|
||||||
|
draft-ietf-tls-ecc-03.txt: the KDF1 key derivation function with
|
||||||
|
SHA-1 now is only used for "small" curves (where the
|
||||||
|
representation of a field element takes up to 24 bytes); for
|
||||||
|
larger curves, the field element resulting from ECDH is directly
|
||||||
|
used as premaster secret.
|
||||||
|
[Douglas Stebila (Sun Microsystems Laboratories)]
|
||||||
|
|
||||||
|
*) Add code for kP+lQ timings to crypto/ec/ectest.c, and add SEC2
|
||||||
|
curve secp160r1 to the tests.
|
||||||
|
[Douglas Stebila (Sun Microsystems Laboratories)]
|
||||||
|
|
||||||
|
*) Add the possibility to load symbols globally with DSO.
|
||||||
|
[G<>tz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
|
||||||
|
|
||||||
|
*) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better
|
||||||
|
control of the error stack.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add support for STORE in ENGINE.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add the STORE type. The intention is to provide a common interface
|
||||||
|
to certificate and key stores, be they simple file-based stores, or
|
||||||
|
HSM-type store, or LDAP stores, or...
|
||||||
|
NOTE: The code is currently UNTESTED and isn't really used anywhere.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add a generic structure called OPENSSL_ITEM. This can be used to
|
||||||
|
pass a list of arguments to any function as well as provide a way
|
||||||
|
for a function to pass data back to the caller.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add the functions BUF_strndup() and BUF_memdup(). BUF_strndup()
|
||||||
|
works like BUF_strdup() but can be used to duplicate a portion of
|
||||||
|
a string. The copy gets NUL-terminated. BUF_memdup() duplicates
|
||||||
|
a memory area.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add the function sk_find_ex() which works like sk_find(), but will
|
||||||
|
return an index to an element even if an exact match couldn't be
|
||||||
|
found. The index is guaranteed to point at the element where the
|
||||||
|
searched-for key would be inserted to preserve sorting order.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add the function OBJ_bsearch_ex() which works like OBJ_bsearch() but
|
||||||
|
takes an extra flags argument for optional functionality. Currently,
|
||||||
|
the following flags are defined:
|
||||||
|
|
||||||
|
OBJ_BSEARCH_VALUE_ON_NOMATCH
|
||||||
|
This one gets OBJ_bsearch_ex() to return a pointer to the first
|
||||||
|
element where the comparing function returns a negative or zero
|
||||||
|
number.
|
||||||
|
|
||||||
|
OBJ_BSEARCH_FIRST_VALUE_ON_MATCH
|
||||||
|
This one gets OBJ_bsearch_ex() to return a pointer to the first
|
||||||
|
element where the comparing function returns zero. This is useful
|
||||||
|
if there are more than one element where the comparing function
|
||||||
|
returns zero.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Make it possible to create self-signed certificates with 'openssl ca'
|
||||||
|
in such a way that the self-signed certificate becomes part of the
|
||||||
|
CA database and uses the same mechanisms for serial number generation
|
||||||
|
as all other certificate signing. The new flag '-selfsign' enables
|
||||||
|
this functionality. Adapt CA.sh and CA.pl.in.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add functionality to check the public key of a certificate request
|
||||||
|
against a given private. This is useful to check that a certificate
|
||||||
|
request can be signed by that key (self-signing).
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Make it possible to have multiple active certificates with the same
|
||||||
|
subject in the CA index file. This is done only if the keyword
|
||||||
|
'unique_subject' is set to 'no' in the main CA section (default
|
||||||
|
if 'CA_default') of the configuration file. The value is saved
|
||||||
|
with the database itself in a separate index attribute file,
|
||||||
|
named like the index file with '.attr' appended to the name.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Generate muti valued AVAs using '+' notation in config files for
|
||||||
|
req and dirName.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Support for nameConstraints certificate extension.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Support for policyConstraints certificate extension.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Support for policyMappings certificate extension.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Fixed a typo bug that would cause ENGINE_set_default() to set an
|
||||||
|
ENGINE as defaults for all supported algorithms irrespective of
|
||||||
|
the 'flags' parameter. 'flags' is now honoured, so applications
|
||||||
|
should make sure they are passing it correctly.
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) Make sure the default DSA_METHOD implementation only uses its
|
||||||
|
dsa_mod_exp() and/or bn_mod_exp() handlers if they are non-NULL,
|
||||||
|
and change its own handlers to be NULL so as to remove unnecessary
|
||||||
|
indirection. This lets alternative implementations fallback to the
|
||||||
|
default implementation more easily.
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) Support for directoryName in GeneralName related extensions
|
||||||
|
in config files.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Make it possible to link applications using Makefile.shared.
|
||||||
|
Make that possible even when linking against static libraries!
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Support for single pass processing for S/MIME signing. This now
|
||||||
|
means that S/MIME signing can be done from a pipe, in addition
|
||||||
|
cleartext signing (multipart/signed type) is effectively streaming
|
||||||
|
and the signed data does not need to be all held in memory.
|
||||||
|
|
||||||
|
This is done with a new flag PKCS7_STREAM. When this flag is set
|
||||||
|
PKCS7_sign() only initializes the PKCS7 structure and the actual signing
|
||||||
|
is done after the data is output (and digests calculated) in
|
||||||
|
SMIME_write_PKCS7().
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Add full support for -rpath/-R, both in shared libraries and
|
||||||
|
applications, at least on the platforms where it's known how
|
||||||
|
to do it.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) In crypto/ec/ec_mult.c, implement fast point multiplication with
|
||||||
|
precomputation, based on wNAF splitting: EC_GROUP_precompute_mult()
|
||||||
|
will now compute a table of multiples of the generator that
|
||||||
|
makes subsequent invocations of EC_POINTs_mul() or EC_POINT_mul()
|
||||||
|
faster (notably in the case of a single point multiplication,
|
||||||
|
scalar * generator).
|
||||||
|
[Nils Larsch, Bodo Moeller]
|
||||||
|
|
||||||
|
*) IPv6 support for certificate extensions. The various extensions
|
||||||
|
which use the IP:a.b.c.d can now take IPv6 addresses using the
|
||||||
|
formats of RFC1884 2.2 . IPv6 addresses are now also displayed
|
||||||
|
correctly.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Added an ENGINE that implements RSA by performing private key
|
||||||
|
exponentiations with the GMP library. The conversions to and from
|
||||||
|
GMP's mpz_t format aren't optimised nor are any montgomery forms
|
||||||
|
cached, and on x86 it appears OpenSSL's own performance has caught up.
|
||||||
|
However there are likely to be other architectures where GMP could
|
||||||
|
provide a boost. This ENGINE is not built in by default, but it can be
|
||||||
|
specified at Configure time and should be accompanied by the necessary
|
||||||
|
linker additions, eg;
|
||||||
|
./config -DOPENSSL_USE_GMP -lgmp
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) "openssl engine" will not display ENGINE/DSO load failure errors when
|
||||||
|
testing availability of engines with "-t" - the old behaviour is
|
||||||
|
produced by increasing the feature's verbosity with "-tt".
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) ECDSA routines: under certain error conditions uninitialized BN objects
|
||||||
|
could be freed. Solution: make sure initialization is performed early
|
||||||
|
enough. (Reported and fix supplied by Nils Larsch <nla@trustcenter.de>
|
||||||
|
via PR#459)
|
||||||
|
[Lutz Jaenicke]
|
||||||
|
|
||||||
|
*) Key-generation can now be implemented in RSA_METHOD, DSA_METHOD
|
||||||
|
and DH_METHOD (eg. by ENGINE implementations) to override the normal
|
||||||
|
software implementations. For DSA and DH, parameter generation can
|
||||||
|
also be overriden by providing the appropriate method callbacks.
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) Change the "progress" mechanism used in key-generation and
|
||||||
|
primality testing to functions that take a new BN_GENCB pointer in
|
||||||
|
place of callback/argument pairs. The new API functions have "_ex"
|
||||||
|
postfixes and the older functions are reimplemented as wrappers for
|
||||||
|
the new ones. The OPENSSL_NO_DEPRECATED symbol can be used to hide
|
||||||
|
declarations of the old functions to help (graceful) attempts to
|
||||||
|
migrate to the new functions. Also, the new key-generation API
|
||||||
|
functions operate on a caller-supplied key-structure and return
|
||||||
|
success/failure rather than returning a key or NULL - this is to
|
||||||
|
help make "keygen" another member function of RSA_METHOD etc.
|
||||||
|
|
||||||
|
Example for using the new callback interface:
|
||||||
|
|
||||||
|
int (*my_callback)(int a, int b, BN_GENCB *cb) = ...;
|
||||||
|
void *my_arg = ...;
|
||||||
|
BN_GENCB my_cb;
|
||||||
|
|
||||||
|
BN_GENCB_set(&my_cb, my_callback, my_arg);
|
||||||
|
|
||||||
|
return BN_is_prime_ex(some_bignum, BN_prime_checks, NULL, &cb);
|
||||||
|
/* For the meaning of a, b in calls to my_callback(), see the
|
||||||
|
* documentation of the function that calls the callback.
|
||||||
|
* cb will point to my_cb; my_arg can be retrieved as cb->arg.
|
||||||
|
* my_callback should return 1 if it wants BN_is_prime_ex()
|
||||||
|
* to continue, or 0 to stop.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[Geoff Thorpe]
|
||||||
|
|
||||||
|
*) Change the ZLIB compression method to be stateful, and make it
|
||||||
|
available to TLS with the number defined in
|
||||||
|
draft-ietf-tls-compression-04.txt.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
*) Add the ASN.1 structures and functions for CertificatePair, which
|
*) Add the ASN.1 structures and functions for CertificatePair, which
|
||||||
is defined as follows (according to X.509_4thEditionDraftV6.pdf):
|
is defined as follows (according to X.509_4thEditionDraftV6.pdf):
|
||||||
@@ -103,8 +394,6 @@
|
|||||||
[Nils Gura and Douglas Stebila (Sun Microsystems Laboratories)]
|
[Nils Gura and Douglas Stebila (Sun Microsystems Laboratories)]
|
||||||
|
|
||||||
*) Add ECDH in new directory crypto/ecdh/.
|
*) Add ECDH in new directory crypto/ecdh/.
|
||||||
TODO: more general interface (return x coordinate, not its hash)
|
|
||||||
TODO: bug: pad x with leading zeros if necessary
|
|
||||||
[Douglas Stebila (Sun Microsystems Laboratories)]
|
[Douglas Stebila (Sun Microsystems Laboratories)]
|
||||||
|
|
||||||
*) Let BN_rand_range() abort with an error after 100 iterations
|
*) Let BN_rand_range() abort with an error after 100 iterations
|
||||||
@@ -333,7 +622,245 @@ TODO: bug: pad x with leading zeros if necessary
|
|||||||
EC_GROUP_get_nid()
|
EC_GROUP_get_nid()
|
||||||
[Nils Larsch <nla@trustcenter.de, Bodo Moeller]
|
[Nils Larsch <nla@trustcenter.de, Bodo Moeller]
|
||||||
|
|
||||||
Changes between 0.9.6h and 0.9.7 [XX xxx 2002]
|
*) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
|
||||||
|
was actually never needed) and in BN_mul(). The removal in BN_mul()
|
||||||
|
required a small change in bn_mul_part_recursive() and the addition
|
||||||
|
of the functions bn_cmp_part_words(), bn_sub_part_words() and
|
||||||
|
bn_add_part_words(), which do the same thing as bn_cmp_words(),
|
||||||
|
bn_sub_words() and bn_add_words() except they take arrays with
|
||||||
|
differing sizes.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
Changes between 0.9.7c and 0.9.7d [xx XXX XXXX]
|
||||||
|
|
||||||
|
*) X509 verify fixes. Disable broken certificate workarounds when
|
||||||
|
X509_V_FLAGS_X509_STRICT is set. Check CRL issuer has cRLSign set if
|
||||||
|
keyUsage extension present. Don't accept CRLs with unhandled critical
|
||||||
|
extensions: since verify currently doesn't process CRL extensions this
|
||||||
|
rejects a CRL with *any* critical extensions. Add new verify error codes
|
||||||
|
for these cases.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) When creating an OCSP nonce use an OCTET STRING inside the extnValue.
|
||||||
|
A clarification of RFC2560 will require the use of OCTET STRINGs and
|
||||||
|
some implementations cannot handle the current raw format. Since OpenSSL
|
||||||
|
copies and compares OCSP nonces as opaque blobs without any attempt at
|
||||||
|
parsing them this should not create any compatibility issues.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) New md flag EVP_MD_CTX_FLAG_REUSE this allows md_data to be reused when
|
||||||
|
calling EVP_MD_CTX_copy_ex() to avoid calling OPENSSL_malloc(). Without
|
||||||
|
this HMAC (and other) operations are several times slower than OpenSSL
|
||||||
|
< 0.9.7.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Print out GeneralizedTime and UTCTime in ASN1_STRING_print_ex().
|
||||||
|
[Peter Sylvester <Peter.Sylvester@EdelWeb.fr>]
|
||||||
|
|
||||||
|
*) Use the correct content when signing type "other".
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
Changes between 0.9.7b and 0.9.7c [30 Sep 2003]
|
||||||
|
|
||||||
|
*) Fix various bugs revealed by running the NISCC test suite:
|
||||||
|
|
||||||
|
Stop out of bounds reads in the ASN1 code when presented with
|
||||||
|
invalid tags (CAN-2003-0543 and CAN-2003-0544).
|
||||||
|
|
||||||
|
Free up ASN1_TYPE correctly if ANY type is invalid (CAN-2003-0545).
|
||||||
|
|
||||||
|
If verify callback ignores invalid public key errors don't try to check
|
||||||
|
certificate signature with the NULL public key.
|
||||||
|
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) New -ignore_err option in ocsp application to stop the server
|
||||||
|
exiting on the first error in a request.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) In ssl3_accept() (ssl/s3_srvr.c) only accept a client certificate
|
||||||
|
if the server requested one: as stated in TLS 1.0 and SSL 3.0
|
||||||
|
specifications.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) In ssl3_get_client_hello() (ssl/s3_srvr.c), tolerate additional
|
||||||
|
extra data after the compression methods not only for TLS 1.0
|
||||||
|
but also for SSL 3.0 (as required by the specification).
|
||||||
|
[Bodo Moeller; problem pointed out by Matthias Loepfe]
|
||||||
|
|
||||||
|
*) Change X509_certificate_type() to mark the key as exported/exportable
|
||||||
|
when it's 512 *bits* long, not 512 bytes.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Change AES_cbc_encrypt() so it outputs exact multiple of
|
||||||
|
blocks during encryption.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Various fixes to base64 BIO and non blocking I/O. On write
|
||||||
|
flushes were not handled properly if the BIO retried. On read
|
||||||
|
data was not being buffered properly and had various logic bugs.
|
||||||
|
This also affects blocking I/O when the data being decoded is a
|
||||||
|
certain size.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Various S/MIME bugfixes and compatibility changes:
|
||||||
|
output correct application/pkcs7 MIME type if
|
||||||
|
PKCS7_NOOLDMIMETYPE is set. Tolerate some broken signatures.
|
||||||
|
Output CR+LF for EOL if PKCS7_CRLFEOL is set (this makes opening
|
||||||
|
of files as .eml work). Correctly handle very long lines in MIME
|
||||||
|
parser.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
Changes between 0.9.7a and 0.9.7b [10 Apr 2003]
|
||||||
|
|
||||||
|
*) Countermeasure against the Klima-Pokorny-Rosa extension of
|
||||||
|
Bleichbacher's attack on PKCS #1 v1.5 padding: treat
|
||||||
|
a protocol version number mismatch like a decryption error
|
||||||
|
in ssl3_get_client_key_exchange (ssl/s3_srvr.c).
|
||||||
|
[Bodo Moeller]
|
||||||
|
|
||||||
|
*) Turn on RSA blinding by default in the default implementation
|
||||||
|
to avoid a timing attack. Applications that don't want it can call
|
||||||
|
RSA_blinding_off() or use the new flag RSA_FLAG_NO_BLINDING.
|
||||||
|
They would be ill-advised to do so in most cases.
|
||||||
|
[Ben Laurie, Steve Henson, Geoff Thorpe, Bodo Moeller]
|
||||||
|
|
||||||
|
*) Change RSA blinding code so that it works when the PRNG is not
|
||||||
|
seeded (in this case, the secret RSA exponent is abused as
|
||||||
|
an unpredictable seed -- if it is not unpredictable, there
|
||||||
|
is no point in blinding anyway). Make RSA blinding thread-safe
|
||||||
|
by remembering the creator's thread ID in rsa->blinding and
|
||||||
|
having all other threads use local one-time blinding factors
|
||||||
|
(this requires more computation than sharing rsa->blinding, but
|
||||||
|
avoids excessive locking; and if an RSA object is not shared
|
||||||
|
between threads, blinding will still be very fast).
|
||||||
|
[Bodo Moeller]
|
||||||
|
|
||||||
|
yet to be integrated into this CVS branch:
|
||||||
|
- Geoff's ENGINE_set_default() fix
|
||||||
|
|
||||||
|
*) Target "mingw" now allows native Windows code to be generated in
|
||||||
|
the Cygwin environment as well as with the MinGW compiler.
|
||||||
|
[Ulf Moeller]
|
||||||
|
|
||||||
|
Changes between 0.9.7 and 0.9.7a [19 Feb 2003]
|
||||||
|
|
||||||
|
*) In ssl3_get_record (ssl/s3_pkt.c), minimize information leaked
|
||||||
|
via timing by performing a MAC computation even if incorrrect
|
||||||
|
block cipher padding has been found. This is a countermeasure
|
||||||
|
against active attacks where the attacker has to distinguish
|
||||||
|
between bad padding and a MAC verification error. (CAN-2003-0078)
|
||||||
|
|
||||||
|
[Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
|
||||||
|
Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
|
||||||
|
Martin Vuagnoux (EPFL, Ilion)]
|
||||||
|
|
||||||
|
*) Make the no-err option work as intended. The intention with no-err
|
||||||
|
is not to have the whole error stack handling routines removed from
|
||||||
|
libcrypto, it's only intended to remove all the function name and
|
||||||
|
reason texts, thereby removing some of the footprint that may not
|
||||||
|
be interesting if those errors aren't displayed anyway.
|
||||||
|
|
||||||
|
NOTE: it's still possible for any application or module to have it's
|
||||||
|
own set of error texts inserted. The routines are there, just not
|
||||||
|
used by default when no-err is given.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) Add support for FreeBSD on IA64.
|
||||||
|
[dirk.meyer@dinoex.sub.org via Richard Levitte, resolves #454]
|
||||||
|
|
||||||
|
*) Adjust DES_cbc_cksum() so it returns the same value as the MIT
|
||||||
|
Kerberos function mit_des_cbc_cksum(). Before this change,
|
||||||
|
the value returned by DES_cbc_cksum() was like the one from
|
||||||
|
mit_des_cbc_cksum(), except the bytes were swapped.
|
||||||
|
[Kevin Greaney <Kevin.Greaney@hp.com> and Richard Levitte]
|
||||||
|
|
||||||
|
*) Allow an application to disable the automatic SSL chain building.
|
||||||
|
Before this a rather primitive chain build was always performed in
|
||||||
|
ssl3_output_cert_chain(): an application had no way to send the
|
||||||
|
correct chain if the automatic operation produced an incorrect result.
|
||||||
|
|
||||||
|
Now the chain builder is disabled if either:
|
||||||
|
|
||||||
|
1. Extra certificates are added via SSL_CTX_add_extra_chain_cert().
|
||||||
|
|
||||||
|
2. The mode flag SSL_MODE_NO_AUTO_CHAIN is set.
|
||||||
|
|
||||||
|
The reasoning behind this is that an application would not want the
|
||||||
|
auto chain building to take place if extra chain certificates are
|
||||||
|
present and it might also want a means of sending no additional
|
||||||
|
certificates (for example the chain has two certificates and the
|
||||||
|
root is omitted).
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Add the possibility to build without the ENGINE framework.
|
||||||
|
[Steven Reddie <smr@essemer.com.au> via Richard Levitte]
|
||||||
|
|
||||||
|
*) Under Win32 gmtime() can return NULL: check return value in
|
||||||
|
OPENSSL_gmtime(). Add error code for case where gmtime() fails.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) DSA routines: under certain error conditions uninitialized BN objects
|
||||||
|
could be freed. Solution: make sure initialization is performed early
|
||||||
|
enough. (Reported and fix supplied by Ivan D Nestlerode <nestler@MIT.EDU>,
|
||||||
|
Nils Larsch <nla@trustcenter.de> via PR#459)
|
||||||
|
[Lutz Jaenicke]
|
||||||
|
|
||||||
|
*) Another fix for SSLv2 session ID handling: the session ID was incorrectly
|
||||||
|
checked on reconnect on the client side, therefore session resumption
|
||||||
|
could still fail with a "ssl session id is different" error. This
|
||||||
|
behaviour is masked when SSL_OP_ALL is used due to
|
||||||
|
SSL_OP_MICROSOFT_SESS_ID_BUG being set.
|
||||||
|
Behaviour observed by Crispin Flowerday <crispin@flowerday.cx> as
|
||||||
|
followup to PR #377.
|
||||||
|
[Lutz Jaenicke]
|
||||||
|
|
||||||
|
*) IA-32 assembler support enhancements: unified ELF targets, support
|
||||||
|
for SCO/Caldera platforms, fix for Cygwin shared build.
|
||||||
|
[Andy Polyakov]
|
||||||
|
|
||||||
|
*) Add support for FreeBSD on sparc64. As a consequence, support for
|
||||||
|
FreeBSD on non-x86 processors is separate from x86 processors on
|
||||||
|
the config script, much like the NetBSD support.
|
||||||
|
[Richard Levitte & Kris Kennaway <kris@obsecurity.org>]
|
||||||
|
|
||||||
|
Changes between 0.9.6h and 0.9.7 [31 Dec 2002]
|
||||||
|
|
||||||
|
[NB: OpenSSL 0.9.6i and later 0.9.6 patch levels were released after
|
||||||
|
OpenSSL 0.9.7.]
|
||||||
|
|
||||||
|
*) Fix session ID handling in SSLv2 client code: the SERVER FINISHED
|
||||||
|
code (06) was taken as the first octet of the session ID and the last
|
||||||
|
octet was ignored consequently. As a result SSLv2 client side session
|
||||||
|
caching could not have worked due to the session ID mismatch between
|
||||||
|
client and server.
|
||||||
|
Behaviour observed by Crispin Flowerday <crispin@flowerday.cx> as
|
||||||
|
PR #377.
|
||||||
|
[Lutz Jaenicke]
|
||||||
|
|
||||||
|
*) Change the declaration of needed Kerberos libraries to use EX_LIBS
|
||||||
|
instead of the special (and badly supported) LIBKRB5. LIBKRB5 is
|
||||||
|
removed entirely.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) The hw_ncipher.c engine requires dynamic locks. Unfortunately, it
|
||||||
|
seems that in spite of existing for more than a year, many application
|
||||||
|
author have done nothing to provide the necessary callbacks, which
|
||||||
|
means that this particular engine will not work properly anywhere.
|
||||||
|
This is a very unfortunate situation which forces us, in the name
|
||||||
|
of usability, to give the hw_ncipher.c a static lock, which is part
|
||||||
|
of libcrypto.
|
||||||
|
NOTE: This is for the 0.9.7 series ONLY. This hack will never
|
||||||
|
appear in 0.9.8 or later. We EXPECT application authors to have
|
||||||
|
dealt properly with this when 0.9.8 is released (unless we actually
|
||||||
|
make such changes in the libcrypto locking code that changes will
|
||||||
|
have to be made anyway).
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
*) In asn1_d2i_read_bio() repeatedly call BIO_read() until all content
|
||||||
|
octets have been read, EOF or an error occurs. Without this change
|
||||||
|
some truncated ASN1 structures will not produce an error.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
*) Disable Heimdal support, since it hasn't been fully implemented.
|
*) Disable Heimdal support, since it hasn't been fully implemented.
|
||||||
Still give the possibility to force the use of Heimdal, but with
|
Still give the possibility to force the use of Heimdal, but with
|
||||||
@@ -475,7 +1002,7 @@ TODO: bug: pad x with leading zeros if necessary
|
|||||||
# is assumed to contain the absolute OpenSSL source directory.
|
# is assumed to contain the absolute OpenSSL source directory.
|
||||||
mkdir -p objtree/"`uname -s`-`uname -r`-`uname -m`"
|
mkdir -p objtree/"`uname -s`-`uname -r`-`uname -m`"
|
||||||
cd objtree/"`uname -s`-`uname -r`-`uname -m`"
|
cd objtree/"`uname -s`-`uname -r`-`uname -m`"
|
||||||
(cd $OPENSSL_SOURCE; find . -type f -o -type l) | while read F; do
|
(cd $OPENSSL_SOURCE; find . -type f) | while read F; do
|
||||||
mkdir -p `dirname $F`
|
mkdir -p `dirname $F`
|
||||||
ln -s $OPENSSL_SOURCE/$F $F
|
ln -s $OPENSSL_SOURCE/$F $F
|
||||||
done
|
done
|
||||||
@@ -1975,6 +2502,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
|||||||
be reduced modulo m.
|
be reduced modulo m.
|
||||||
[Lenka Fibikova <fibikova@exp-math.uni-essen.de>, Bodo Moeller]
|
[Lenka Fibikova <fibikova@exp-math.uni-essen.de>, Bodo Moeller]
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
The following entry accidentily appeared in the CHANGES file
|
||||||
|
distributed with OpenSSL 0.9.7. The modifications described in
|
||||||
|
it do *not* apply to OpenSSL 0.9.7.
|
||||||
|
|
||||||
*) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
|
*) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
|
||||||
was actually never needed) and in BN_mul(). The removal in BN_mul()
|
was actually never needed) and in BN_mul(). The removal in BN_mul()
|
||||||
required a small change in bn_mul_part_recursive() and the addition
|
required a small change in bn_mul_part_recursive() and the addition
|
||||||
@@ -1983,6 +2515,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
|||||||
bn_sub_words() and bn_add_words() except they take arrays with
|
bn_sub_words() and bn_add_words() except they take arrays with
|
||||||
differing sizes.
|
differing sizes.
|
||||||
[Richard Levitte]
|
[Richard Levitte]
|
||||||
|
#endif
|
||||||
|
|
||||||
*) In 'openssl passwd', verify passwords read from the terminal
|
*) In 'openssl passwd', verify passwords read from the terminal
|
||||||
unless the '-salt' option is used (which usually means that
|
unless the '-salt' option is used (which usually means that
|
||||||
@@ -2114,7 +2647,80 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
|
|||||||
*) Clean old EAY MD5 hack from e_os.h.
|
*) Clean old EAY MD5 hack from e_os.h.
|
||||||
[Richard Levitte]
|
[Richard Levitte]
|
||||||
|
|
||||||
Changes between 0.9.6g and 0.9.6h [xx XXX xxxx]
|
Changes between 0.9.6j and 0.9.6k [30 Sep 2003]
|
||||||
|
|
||||||
|
*) Fix various bugs revealed by running the NISCC test suite:
|
||||||
|
|
||||||
|
Stop out of bounds reads in the ASN1 code when presented with
|
||||||
|
invalid tags (CAN-2003-0543 and CAN-2003-0544).
|
||||||
|
|
||||||
|
If verify callback ignores invalid public key errors don't try to check
|
||||||
|
certificate signature with the NULL public key.
|
||||||
|
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) Fix various bugs revealed by running the NISCC test suite:
|
||||||
|
|
||||||
|
Stop out of bounds reads in the ASN1 code when presented with
|
||||||
|
invalid tags (CAN-2003-0543 and CAN-2003-0544).
|
||||||
|
|
||||||
|
If verify callback ignores invalid public key errors don't try to check
|
||||||
|
certificate signature with the NULL public key.
|
||||||
|
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) In ssl3_accept() (ssl/s3_srvr.c) only accept a client certificate
|
||||||
|
if the server requested one: as stated in TLS 1.0 and SSL 3.0
|
||||||
|
specifications.
|
||||||
|
[Steve Henson]
|
||||||
|
|
||||||
|
*) In ssl3_get_client_hello() (ssl/s3_srvr.c), tolerate additional
|
||||||
|
extra data after the compression methods not only for TLS 1.0
|
||||||
|
but also for SSL 3.0 (as required by the specification).
|
||||||
|
[Bodo Moeller; problem pointed out by Matthias Loepfe]
|
||||||
|
|
||||||
|
*) Change X509_certificate_type() to mark the key as exported/exportable
|
||||||
|
when it's 512 *bits* long, not 512 bytes.
|
||||||
|
[Richard Levitte]
|
||||||
|
|
||||||
|
Changes between 0.9.6i and 0.9.6j [10 Apr 2003]
|
||||||
|
|
||||||
|
*) Countermeasure against the Klima-Pokorny-Rosa extension of
|
||||||
|
Bleichbacher's attack on PKCS #1 v1.5 padding: treat
|
||||||
|
a protocol version number mismatch like a decryption error
|
||||||
|
in ssl3_get_client_key_exchange (ssl/s3_srvr.c).
|
||||||
|
[Bodo Moeller]
|
||||||
|
|
||||||
|
*) Turn on RSA blinding by default in the default implementation
|
||||||
|
to avoid a timing attack. Applications that don't want it can call
|
||||||
|
RSA_blinding_off() or use the new flag RSA_FLAG_NO_BLINDING.
|
||||||
|
They would be ill-advised to do so in most cases.
|
||||||
|
[Ben Laurie, Steve Henson, Geoff Thorpe, Bodo Moeller]
|
||||||
|
|
||||||
|
*) Change RSA blinding code so that it works when the PRNG is not
|
||||||
|
seeded (in this case, the secret RSA exponent is abused as
|
||||||
|
an unpredictable seed -- if it is not unpredictable, there
|
||||||
|
is no point in blinding anyway). Make RSA blinding thread-safe
|
||||||
|
by remembering the creator's thread ID in rsa->blinding and
|
||||||
|
having all other threads use local one-time blinding factors
|
||||||
|
(this requires more computation than sharing rsa->blinding, but
|
||||||
|
avoids excessive locking; and if an RSA object is not shared
|
||||||
|
between threads, blinding will still be very fast).
|
||||||
|
[Bodo Moeller]
|
||||||
|
|
||||||
|
Changes between 0.9.6h and 0.9.6i [19 Feb 2003]
|
||||||
|
|
||||||
|
*) In ssl3_get_record (ssl/s3_pkt.c), minimize information leaked
|
||||||
|
via timing by performing a MAC computation even if incorrrect
|
||||||
|
block cipher padding has been found. This is a countermeasure
|
||||||
|
against active attacks where the attacker has to distinguish
|
||||||
|
between bad padding and a MAC verification error. (CAN-2003-0078)
|
||||||
|
|
||||||
|
[Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
|
||||||
|
Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
|
||||||
|
Martin Vuagnoux (EPFL, Ilion)]
|
||||||
|
|
||||||
|
Changes between 0.9.6g and 0.9.6h [5 Dec 2002]
|
||||||
|
|
||||||
*) New function OPENSSL_cleanse(), which is used to cleanse a section of
|
*) New function OPENSSL_cleanse(), which is used to cleanse a section of
|
||||||
memory from it's contents. This is done with a counter that will
|
memory from it's contents. This is done with a counter that will
|
||||||
|
|||||||
276
Configure
276
Configure
@@ -10,7 +10,7 @@ use strict;
|
|||||||
|
|
||||||
# see INSTALL for instructions.
|
# see INSTALL for instructions.
|
||||||
|
|
||||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-engine] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
||||||
|
|
||||||
# Options:
|
# Options:
|
||||||
#
|
#
|
||||||
@@ -38,6 +38,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
|
|||||||
# --test-sanity Make a number of sanity checks on the data in this file.
|
# --test-sanity Make a number of sanity checks on the data in this file.
|
||||||
# This is a debugging tool for OpenSSL developers.
|
# This is a debugging tool for OpenSSL developers.
|
||||||
#
|
#
|
||||||
|
# no-engine do not compile in any engine code.
|
||||||
# no-hw-xxx do not compile support for specific crypto hardware.
|
# no-hw-xxx do not compile support for specific crypto hardware.
|
||||||
# Generic OpenSSL-style methods relating to this support
|
# Generic OpenSSL-style methods relating to this support
|
||||||
# are always compiled but return NULL if the hardware
|
# are always compiled but return NULL if the hardware
|
||||||
@@ -107,7 +108,6 @@ my $tlib="-lnsl -lsocket";
|
|||||||
my $bits1="THIRTY_TWO_BIT ";
|
my $bits1="THIRTY_TWO_BIT ";
|
||||||
my $bits2="SIXTY_FOUR_BIT ";
|
my $bits2="SIXTY_FOUR_BIT ";
|
||||||
|
|
||||||
my $x86_sol_asm="asm/bn86-sol.o asm/co86-sol.o:asm/dx86-sol.o asm/yx86-sol.o:asm/bx86-sol.o:asm/mx86-sol.o:asm/sx86-sol.o:asm/cx86-sol.o:asm/rx86-sol.o:asm/rm86-sol.o:asm/r586-sol.o";
|
|
||||||
my $x86_elf_asm="asm/bn86-elf.o asm/co86-elf.o:asm/dx86-elf.o asm/yx86-elf.o:asm/bx86-elf.o:asm/mx86-elf.o:asm/sx86-elf.o:asm/cx86-elf.o:asm/rx86-elf.o:asm/rm86-elf.o:asm/r586-elf.o";
|
my $x86_elf_asm="asm/bn86-elf.o asm/co86-elf.o:asm/dx86-elf.o asm/yx86-elf.o:asm/bx86-elf.o:asm/mx86-elf.o:asm/sx86-elf.o:asm/cx86-elf.o:asm/rx86-elf.o:asm/rm86-elf.o:asm/r586-elf.o";
|
||||||
my $x86_out_asm="asm/bn86-out.o asm/co86-out.o:asm/dx86-out.o asm/yx86-out.o:asm/bx86-out.o:asm/mx86-out.o:asm/sx86-out.o:asm/cx86-out.o:asm/rx86-out.o:asm/rm86-out.o:asm/r586-out.o";
|
my $x86_out_asm="asm/bn86-out.o asm/co86-out.o:asm/dx86-out.o asm/yx86-out.o:asm/bx86-out.o:asm/mx86-out.o:asm/sx86-out.o:asm/cx86-out.o:asm/rx86-out.o:asm/rm86-out.o:asm/r586-out.o";
|
||||||
my $x86_bsdi_asm="asm/bn86bsdi.o asm/co86bsdi.o:asm/dx86bsdi.o asm/yx86bsdi.o:asm/bx86bsdi.o:asm/mx86bsdi.o:asm/sx86bsdi.o:asm/cx86bsdi.o:asm/rx86bsdi.o:asm/rm86bsdi.o:asm/r586bsdi.o";
|
my $x86_bsdi_asm="asm/bn86bsdi.o asm/co86bsdi.o:asm/dx86bsdi.o asm/yx86bsdi.o:asm/bx86bsdi.o:asm/mx86bsdi.o:asm/sx86bsdi.o:asm/cx86bsdi.o:asm/rx86bsdi.o:asm/rm86bsdi.o:asm/r586bsdi.o";
|
||||||
@@ -142,13 +142,14 @@ my %table=(
|
|||||||
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
|
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
|
||||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||||
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||||
"debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT:::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32::::win32:cygwin-shared:::.dll",
|
||||||
"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -mcpu=i486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -mcpu=i486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared",
|
||||||
"debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT::dlfcn",
|
"debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT::dlfcn:linux-shared",
|
||||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wconversion -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wconversion -Wno-long-long -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"debug-geoff","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DBN_CTX_DEBUG -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -g -ggdb3 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"dist", "cc:-O::(unknown)::::::",
|
"dist", "cc:-O::(unknown)::::::",
|
||||||
|
|
||||||
# Basic configs that should work on any (32 and less bit) box
|
# Basic configs that should work on any (32 and less bit) box
|
||||||
@@ -161,25 +162,24 @@ my %table=(
|
|||||||
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
|
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
|
||||||
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
|
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
|
||||||
# error message.
|
# error message.
|
||||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
#### Solaris x86 with Sun C setups
|
#### Solaris x86 with Sun C setups
|
||||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
#### SPARC Solaris with GNU C setups
|
#### SPARC Solaris with GNU C setups
|
||||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
|
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
|
||||||
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris64-sparcv9-gcc31","gcc:-mcpu=ultrasparc -m64 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
|
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
|
||||||
# but keep the assembler modules.
|
# but keep the assembler modules.
|
||||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
####
|
####
|
||||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
#### SPARC Solaris with Sun C setups
|
#### SPARC Solaris with Sun C setups
|
||||||
# DO NOT use /xO[34] on sparc with SC3.0. It is broken, and will not pass the tests
|
# DO NOT use /xO[34] on sparc with SC3.0. It is broken, and will not pass the tests
|
||||||
@@ -188,9 +188,9 @@ my %table=(
|
|||||||
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
|
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
|
||||||
# SC5.0 note: Compiler common patch 107357-01 or later is required!
|
# SC5.0 note: Compiler common patch 107357-01 or later is required!
|
||||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
|
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
|
||||||
####
|
####
|
||||||
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
@@ -199,13 +199,12 @@ my %table=(
|
|||||||
"linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
|
"linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
|
||||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
||||||
# assisted with debugging of following two configs.
|
# assisted with debugging of following two configs.
|
||||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
||||||
# -Wa,-Av8plus should do the trick no matter what.
|
# -Wa,-Av8plus should do the trick no matter what.
|
||||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# !!!Folowing can't be even tested yet!!!
|
# GCC 3.1 is a requirement
|
||||||
# We have to wait till 64-bit glibc for SPARC is operational!!!
|
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::asm/md5-sparcv9.o::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:ULTRASPARC::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
|
||||||
|
|
||||||
# Sunos configs, assuming sparc for the gcc one.
|
# Sunos configs, assuming sparc for the gcc one.
|
||||||
##"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:::",
|
##"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:::",
|
||||||
@@ -217,13 +216,13 @@ my %table=(
|
|||||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
#### IRIX 6.x configs
|
#### IRIX 6.x configs
|
||||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
||||||
# './Configure irix-[g]cc' manually.
|
# './Configure irix-cc -o32' manually.
|
||||||
# -mips4 flag is added by ./config when appropriate.
|
# -mips4 flag is added by ./config when appropriate.
|
||||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# N64 ABI builds.
|
# N64 ABI builds.
|
||||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
#### Unified HP-UX ANSI C configs.
|
#### Unified HP-UX ANSI C configs.
|
||||||
# Special notes:
|
# Special notes:
|
||||||
@@ -242,7 +241,7 @@ my %table=(
|
|||||||
# suitable for execution on the host you're currently compiling at.
|
# suitable for execution on the host you're currently compiling at.
|
||||||
# If the toolkit is ment to be used on various PA-RISC processors
|
# If the toolkit is ment to be used on various PA-RISC processors
|
||||||
# consider './config +DAportable'.
|
# consider './config +DAportable'.
|
||||||
# - +DD64 is chosen in favour of +DA2.0W because it's ment to be
|
# - +DD64 is chosen in favour of +DA2.0W because it's meant to be
|
||||||
# compatible with *future* releases.
|
# compatible with *future* releases.
|
||||||
# - If you run ./Configure hpux-parisc-[g]cc manually don't forget to
|
# - If you run ./Configure hpux-parisc-[g]cc manually don't forget to
|
||||||
# pass -D_REENTRANT on HP-UX 10 and later.
|
# pass -D_REENTRANT on HP-UX 10 and later.
|
||||||
@@ -253,32 +252,35 @@ my %table=(
|
|||||||
# crypto/sha/sha_lcl.h.
|
# crypto/sha/sha_lcl.h.
|
||||||
# <appro@fy.chalmers.se>
|
# <appro@fy.chalmers.se>
|
||||||
#
|
#
|
||||||
#!#"hpux-parisc-cc","cc:-Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
|
||||||
# Since there is mention of this in shlib/hpux10-cc.sh
|
# Since there is mention of this in shlib/hpux10-cc.sh
|
||||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN::-D_REENTRANT::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1:asm/pa-risc2.o:::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# 64bit PARISC for GCC without optimization, which seems to make problems.
|
# 64bit PARISC for GCC without optimization, which seems to make problems.
|
||||||
# Submitted by <ross.alexander@uk.neceur.com>
|
# Submitted by <ross.alexander@uk.neceur.com>
|
||||||
"hpux64-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux64-parisc-gcc","gcc:-DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:-fpic::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# IA-64 targets
|
|
||||||
# I have no idea if this one actually works, feedback needed. <appro>
|
|
||||||
"hpux-ia64-cc","cc:-Ae +DD32 +O3 +ESlit -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
# Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted with
|
|
||||||
# with debugging of the following config.
|
|
||||||
"hpux64-ia64-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
|
|
||||||
# More attempts at unified 10.X and 11.X targets for HP C compiler.
|
# More attempts at unified 10.X and 11.X targets for HP C compiler.
|
||||||
#
|
#
|
||||||
# Chris Ruemmler <ruemmler@cup.hp.com>
|
# Chris Ruemmler <ruemmler@cup.hp.com>
|
||||||
# Kevin Steves <ks@hp.se>
|
# Kevin Steves <ks@hp.se>
|
||||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
# Isn't the line below meaningless? HP-UX cc optimizes for host by default.
|
# Isn't the line below meaningless? HP-UX cc optimizes for host by default.
|
||||||
# hpux-parisc1_0-cc with +DAportable flag would make more sense. <appro>
|
# hpux-parisc1_0-cc with +DAportable flag would make more sense. <appro>
|
||||||
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
|
# HP/UX IA-64 targets
|
||||||
|
"hpux-ia64-cc","cc:-Ae +DD32 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
# Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted with
|
||||||
|
# with debugging of the following config.
|
||||||
|
"hpux64-ia64-cc","cc:-Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64-cpp.o:::::::::dlfcn:hpux64-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
# GCC builds [not tested yet]...
|
||||||
|
# _ILP32 should have been defined by compiler driver, but it isn't...
|
||||||
|
"hpux-ia64-gcc","gcc:-O3 -DB_ENDIAN -D_ILP32::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64.o:::::::::dlfcn:hpux-shared:-fpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"hpux64-ia64-gcc","gcc:-mlp64 -O3 -DB_ENDIAN::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/ia64.o:::::::::dlfcn:hpux-shared:-fpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
# HPUX 9.X config.
|
# HPUX 9.X config.
|
||||||
# Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or
|
# Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or
|
||||||
@@ -376,6 +378,7 @@ my %table=(
|
|||||||
|
|
||||||
# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the
|
# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the
|
||||||
# bn86-elf.o file file since it is hand tweaked assembler.
|
# bn86-elf.o file file since it is hand tweaked assembler.
|
||||||
|
"linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-pentium", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-pentium", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-ppro", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ppro", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
@@ -385,17 +388,21 @@ my %table=(
|
|||||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||||
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
||||||
"linux-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown):::BN_LLONG:::",
|
"linux-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown):::BN_LLONG:::",
|
"linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-m68k", "gcc:-DB_ENDIAN -DTERMIO -O2 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::",
|
"linux-m68k", "gcc:-DB_ENDIAN -DTERMIO -O2 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::",
|
||||||
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"linux-ia64-ecc", "ecc:-DL_ENDIAN -DTERMIO -O2 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o:::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"FreeBSD-sparc64","gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE:::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2 BF_PTR::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"FreeBSD-ia64","gcc:-DL_ENDIAN -DTERMIOS -O -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64-cpp.o:::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"FreeBSD", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
"FreeBSD", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
||||||
"bsdi-gcc", "gcc:-O3 -ffast-math -DL_ENDIAN -DPERL5 -m486::(unknown):::RSA_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_bsdi_asm}",
|
"bsdi-gcc", "gcc:-O3 -ffast-math -DL_ENDIAN -DPERL5 -m486::(unknown):::RSA_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_bsdi_asm}",
|
||||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
@@ -403,7 +410,7 @@ my %table=(
|
|||||||
"nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
|
"nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||||
|
|
||||||
# NCR MP-RAS UNIX ver 02.03.01
|
# NCR MP-RAS UNIX ver 02.03.01
|
||||||
"ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:::",
|
"ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown)::-lsocket -lnsl -lc89:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||||
|
|
||||||
# QNX 4
|
# QNX 4
|
||||||
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
|
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
|
||||||
@@ -414,33 +421,36 @@ my %table=(
|
|||||||
# Linux on ARM
|
# Linux on ARM
|
||||||
"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
# UnixWare 2.0x fails destest with -O
|
# SCO/Caldera targets.
|
||||||
|
#
|
||||||
|
# Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
|
||||||
|
# Now we only have blended unixware-* as it's the only one used by ./config.
|
||||||
|
# If you want to optimize for particular microarchitecture, bypass ./config
|
||||||
|
# and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
|
||||||
|
# Note that not all targets include assembler support. Mostly because of
|
||||||
|
# lack of motivation to support out-of-date platforms with out-of-date
|
||||||
|
# compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
|
||||||
|
# patiently assisted to debug most of it.
|
||||||
|
#
|
||||||
|
# UnixWare 2.0x fails destest with -O.
|
||||||
"unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
"unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||||
"unixware-2.0-pentium","cc:-DFILIO_H -DNO_STRINGS_H -Kpentium::-Kthread::-lsocket -lnsl -lresolv -lx:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
|
||||||
|
|
||||||
# UnixWare 2.1
|
|
||||||
"unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
"unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||||
"unixware-2.1-pentium","cc:-O -DFILIO_H -Kpentium::-Kthread::-lsocket -lnsl -lresolv -lx:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"unixware-2.1-p6","cc:-O -DFILIO_H -Kp6::-Kthread::-lsocket -lnsl -lresolv -lx:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"OpenUNIX-8","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"OpenUNIX-8-gcc","gcc:-O -DFILIO_H -fomit-frame-pointer::-pthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"sco3-gcc", "gcc:-O3 -fomit-frame-pointer -Dssize_t=int -DNO_SYS_UN_H::(unknown)::-lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
|
||||||
|
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
|
||||||
|
"sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
# UnixWare 7
|
|
||||||
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"unixware-7-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"unixware-7-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
|
|
||||||
# OpenUNIX 8
|
|
||||||
"OpenUNIX-8","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"OpenUNIX-8-gcc","gcc:-O -DFILIO_H -fomit-frame-pointer::-pthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"OpenUNIX-8-pentium","cc:-O -DFILIO_H -Kalloca -Kpentium::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
"OpenUNIX-8-pentium_pro","cc:-O -DFILIO_H -Kalloca -Kpentium_pro::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}::::::::::dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
|
||||||
|
|
||||||
# IBM's AIX.
|
# IBM's AIX.
|
||||||
"aix-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::",
|
"aix-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::",
|
||||||
"aix-gcc", "gcc:-O3 -DB_ENDIAN::(unknown):AIX::BN_LLONG RC4_CHAR:::",
|
"aix-gcc", "gcc:-O3 -DB_ENDIAN::(unknown):AIX::BN_LLONG RC4_CHAR:::",
|
||||||
"aix43-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:",
|
"aix43-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:aix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::",
|
||||||
"aix43-gcc", "gcc:-O1 -DAIX -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:",
|
"aix43-gcc", "gcc:-O1 -DAIX -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:",
|
||||||
"aix64-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384 -q64::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHAR::::::::::dlfcn::::::-X 64",
|
"aix64-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384 -q64::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHAR::::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cray T90 and similar (SDSC)
|
# Cray T90 and similar (SDSC)
|
||||||
@@ -473,15 +483,6 @@ my %table=(
|
|||||||
"dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX DES_UNROLL:::",
|
"dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX DES_UNROLL:::",
|
||||||
"dgux-R4-x86-gcc", "gcc:-O3 -fomit-frame-pointer -DL_ENDIAN::(unknown)::-lnsl -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
"dgux-R4-x86-gcc", "gcc:-O3 -fomit-frame-pointer -DL_ENDIAN::(unknown)::-lnsl -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||||
|
|
||||||
# SCO 3 - Tim Rice <tim@multitalents.net>
|
|
||||||
"sco3-gcc", "gcc:-O3 -fomit-frame-pointer -Dssize_t=int -DNO_SYS_UN_H::(unknown)::-lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
|
|
||||||
|
|
||||||
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the
|
|
||||||
# SCO cc.
|
|
||||||
"sco5-cc", "cc:-belf::(unknown)::-lsocket -lresolv -lnsl:${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:svr3-shared:-Kpic", # des options?
|
|
||||||
"sco5-cc-pentium", "cc:-Kpentium::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
|
|
||||||
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lresolv -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC", # the SCO assembler doesn't seem to like our assembler files ...
|
|
||||||
|
|
||||||
# Sinix/ReliantUNIX RM400
|
# Sinix/ReliantUNIX RM400
|
||||||
# NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */
|
# NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */
|
||||||
"ReliantUNIX","cc:-KPIC -g -DTERMIOS -DB_ENDIAN::-Kthread:SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:reliantunix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"ReliantUNIX","cc:-KPIC -g -DTERMIOS -DB_ENDIAN::-Kthread:SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:reliantunix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
@@ -508,13 +509,11 @@ my %table=(
|
|||||||
"VC-MSDOS","cl:::(unknown):MSDOS::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
|
"VC-MSDOS","cl:::(unknown):MSDOS::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
|
||||||
|
|
||||||
# Borland C++ 4.5
|
# Borland C++ 4.5
|
||||||
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX::::::::::win32",
|
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN::::::::::win32",
|
||||||
"BC-16","bcc:::(unknown):WIN16::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",
|
"BC-16","bcc:::(unknown):WIN16::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",
|
||||||
|
|
||||||
# Mingw32
|
# MinGW
|
||||||
# (Note: the real CFLAGS for Windows builds are defined by util/mk1mf.pl
|
"mingw", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall:::MINGW32:-mno-cygwin -lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32::::.dll",
|
||||||
# and its library files in util/pl/*)
|
|
||||||
"Mingw32", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
|
||||||
|
|
||||||
# UWIN
|
# UWIN
|
||||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||||
@@ -522,12 +521,19 @@ my %table=(
|
|||||||
# Cygwin
|
# Cygwin
|
||||||
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:::.dll",
|
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:::.dll",
|
||||||
|
"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32::::win32:cygwin-shared:::.dll",
|
||||||
|
|
||||||
|
# NetWare from David Ward (dsward@novell.com) - requires MetroWerks NLM development tools
|
||||||
|
# netware-clib => legacy CLib c-runtime support
|
||||||
|
"netware-clib", "mwccnlm:::::${x86_gcc_opts}:::",
|
||||||
|
# netware-libc => LibC/NKS support
|
||||||
|
"netware-libc", "mwccnlm:::::BN_LLONG ${x86_gcc_opts}:::",
|
||||||
|
|
||||||
# DJGPP
|
# DJGPP
|
||||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
|
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
|
||||||
|
|
||||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||||
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown):::::::",
|
"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
|
||||||
"ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::",
|
"ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::",
|
||||||
# K&R C is no longer supported; you need gcc on old Ultrix installations
|
# K&R C is no longer supported; you need gcc on old Ultrix installations
|
||||||
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
|
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
|
||||||
@@ -540,8 +546,8 @@ my %table=(
|
|||||||
"OpenBSD-m88k", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"OpenBSD-m88k", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"OpenBSD-mips", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"OpenBSD-mips", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"OpenBSD-powerpc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"OpenBSD-powerpc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"OpenBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"OpenBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"OpenBSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2 BF_PTR::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"OpenBSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2 BF_PTR::asm/des_enc-sparc.o fcrypt_b.o::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"OpenBSD-vax", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"OpenBSD-vax", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
"OpenBSD-hppa", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
"OpenBSD-hppa", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||||
|
|
||||||
@@ -566,14 +572,16 @@ my %table=(
|
|||||||
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
||||||
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
|
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
|
||||||
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
|
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
|
||||||
|
"vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
||||||
|
"vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::::::::::::::::ranlibmips:",
|
||||||
|
|
||||||
##### Compaq Non-Stop Kernel (Tandem)
|
##### Compaq Non-Stop Kernel (Tandem)
|
||||||
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
|
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my @WinTargets=qw(VC-NT VC-CE VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS
|
my @MK1MF_Builds=qw(VC-NT VC-CE VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS
|
||||||
BC-32 BC-16 Mingw32 OS2-EMX);
|
BC-32 BC-16 Mingw32 OS2-EMX netware-clib netware-libc);
|
||||||
|
|
||||||
my $idx = 0;
|
my $idx = 0;
|
||||||
my $idx_cc = $idx++;
|
my $idx_cc = $idx++;
|
||||||
@@ -656,6 +664,7 @@ my $openssl_thread_defines;
|
|||||||
my $openssl_sys_defines="";
|
my $openssl_sys_defines="";
|
||||||
my $openssl_other_defines;
|
my $openssl_other_defines;
|
||||||
my $libs;
|
my $libs;
|
||||||
|
my $libkrb5="";
|
||||||
my $target;
|
my $target;
|
||||||
my $options;
|
my $options;
|
||||||
my $symlink;
|
my $symlink;
|
||||||
@@ -693,19 +702,24 @@ PROCESS_ARGS:
|
|||||||
elsif (/^no-asm$/)
|
elsif (/^no-asm$/)
|
||||||
{
|
{
|
||||||
$no_asm=1;
|
$no_asm=1;
|
||||||
$flags .= "-DOPENSSL_NO_ASM ";
|
#$flags .= "-DOPENSSL_NO_ASM ";
|
||||||
$openssl_other_defines .= "#define OPENSSL_NO_ASM\n";
|
$openssl_other_defines .= "#define OPENSSL_NO_ASM\n";
|
||||||
}
|
}
|
||||||
|
elsif (/^no-err$/)
|
||||||
|
{
|
||||||
|
$flags .= "-DOPENSSL_NO_ERR ";
|
||||||
|
$openssl_other_defines .= "#define OPENSSL_NO_ERR\n";
|
||||||
|
}
|
||||||
elsif (/^no-hw-(.+)$/)
|
elsif (/^no-hw-(.+)$/)
|
||||||
{
|
{
|
||||||
my $hw=$1;
|
my $hw=$1;
|
||||||
$hw =~ tr/[a-z]/[A-Z]/;
|
$hw =~ tr/[a-z]/[A-Z]/;
|
||||||
$flags .= "-DOPENSSL_NO_HW_$hw ";
|
#$flags .= "-DOPENSSL_NO_HW_$hw ";
|
||||||
$openssl_other_defines .= "#define OPENSSL_NO_HW_$hw\n";
|
$openssl_other_defines .= "#define OPENSSL_NO_HW_$hw\n";
|
||||||
}
|
}
|
||||||
elsif (/^no-hw$/)
|
elsif (/^no-hw$/)
|
||||||
{
|
{
|
||||||
$flags .= "-DOPENSSL_NO_HW ";
|
#$flags .= "-DOPENSSL_NO_HW ";
|
||||||
$openssl_other_defines .= "#define OPENSSL_NO_HW\n";
|
$openssl_other_defines .= "#define OPENSSL_NO_HW\n";
|
||||||
}
|
}
|
||||||
elsif (/^no-dso$/)
|
elsif (/^no-dso$/)
|
||||||
@@ -741,22 +755,22 @@ PROCESS_ARGS:
|
|||||||
my $algo=$1;
|
my $algo=$1;
|
||||||
push @skip,$algo;
|
push @skip,$algo;
|
||||||
$algo =~ tr/[a-z]/[A-Z]/;
|
$algo =~ tr/[a-z]/[A-Z]/;
|
||||||
$flags .= "-DOPENSSL_NO_$algo ";
|
#$flags .= "-DOPENSSL_NO_$algo ";
|
||||||
$depflags .= "-DOPENSSL_NO_$algo ";
|
#$depflags .= "-DOPENSSL_NO_$algo ";
|
||||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_$algo\n";
|
$openssl_algorithm_defines .= "#define OPENSSL_NO_$algo\n";
|
||||||
if ($algo eq "RIJNDAEL")
|
if ($algo eq "RIJNDAEL")
|
||||||
{
|
{
|
||||||
push @skip, "aes";
|
push @skip, "aes";
|
||||||
$flags .= "-DOPENSSL_NO_AES ";
|
#$flags .= "-DOPENSSL_NO_AES ";
|
||||||
$depflags .= "-DOPENSSL_NO_AES ";
|
#$depflags .= "-DOPENSSL_NO_AES ";
|
||||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_AES\n";
|
$openssl_algorithm_defines .= "#define OPENSSL_NO_AES\n";
|
||||||
}
|
}
|
||||||
if ($algo eq "DES")
|
if ($algo eq "DES")
|
||||||
{
|
{
|
||||||
push @skip, "mdc2";
|
push @skip, "mdc2";
|
||||||
$options .= " no-mdc2";
|
$options .= " no-mdc2";
|
||||||
$flags .= "-DOPENSSL_NO_MDC2 ";
|
#$flags .= "-DOPENSSL_NO_MDC2 ";
|
||||||
$depflags .= "-DOPENSSL_NO_MDC2 ";
|
#$depflags .= "-DOPENSSL_NO_MDC2 ";
|
||||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_MDC2\n";
|
$openssl_algorithm_defines .= "#define OPENSSL_NO_MDC2\n";
|
||||||
}
|
}
|
||||||
if ($algo eq "EC")
|
if ($algo eq "EC")
|
||||||
@@ -892,24 +906,24 @@ $no_tls1=1 if ($no_dh);
|
|||||||
if ($no_ssl2)
|
if ($no_ssl2)
|
||||||
{
|
{
|
||||||
push @skip,"SSL2";
|
push @skip,"SSL2";
|
||||||
$flags .= "-DOPENSSL_NO_SSL2 ";
|
#$flags .= "-DOPENSSL_NO_SSL2 ";
|
||||||
$depflags .= "-DOPENSSL_NO_SSL2 ";
|
#$depflags .= "-DOPENSSL_NO_SSL2 ";
|
||||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL2\n";
|
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL2\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($no_ssl3)
|
if ($no_ssl3)
|
||||||
{
|
{
|
||||||
push @skip,"SSL3";
|
push @skip,"SSL3";
|
||||||
$flags .= "-DOPENSSL_NO_SSL3 ";
|
#$flags .= "-DOPENSSL_NO_SSL3 ";
|
||||||
$depflags .= "-DOPENSSL_NO_SSL3 ";
|
#$depflags .= "-DOPENSSL_NO_SSL3 ";
|
||||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL3\n";
|
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL3\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($no_tls1)
|
if ($no_tls1)
|
||||||
{
|
{
|
||||||
push @skip,"TLS1";
|
push @skip,"TLS1";
|
||||||
$flags .= "-DOPENSSL_NO_TLS1 ";
|
#$flags .= "-DOPENSSL_NO_TLS1 ";
|
||||||
$depflags .= "-DOPENSSL_NO_TLS1 ";
|
#$depflags .= "-DOPENSSL_NO_TLS1 ";
|
||||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_TLS1\n";
|
$openssl_algorithm_defines .= "#define OPENSSL_NO_TLS1\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -936,7 +950,7 @@ print "Configuring for $target\n";
|
|||||||
|
|
||||||
&usage if (!defined($table{$target}));
|
&usage if (!defined($table{$target}));
|
||||||
|
|
||||||
my $IsWindows=scalar grep /^$target$/,@WinTargets;
|
my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
|
||||||
|
|
||||||
$exe_ext=".exe" if ($target eq "Cygwin");
|
$exe_ext=".exe" if ($target eq "Cygwin");
|
||||||
$exe_ext=".exe" if ($target eq "DJGPP");
|
$exe_ext=".exe" if ($target eq "DJGPP");
|
||||||
@@ -950,7 +964,7 @@ $openssldir=$prefix . "/ssl" if $openssldir eq "";
|
|||||||
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
|
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
|
||||||
|
|
||||||
|
|
||||||
print "IsWindows=$IsWindows\n";
|
print "IsMK1MF=$IsMK1MF\n";
|
||||||
|
|
||||||
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||||
my $cc = $fields[$idx_cc];
|
my $cc = $fields[$idx_cc];
|
||||||
@@ -977,6 +991,8 @@ my $shared_extension = $fields[$idx_shared_extension];
|
|||||||
my $ranlib = $fields[$idx_ranlib];
|
my $ranlib = $fields[$idx_ranlib];
|
||||||
my $arflags = $fields[$idx_arflags];
|
my $arflags = $fields[$idx_arflags];
|
||||||
|
|
||||||
|
my $no_shared_warn=0;
|
||||||
|
|
||||||
$cflags="$flags$cflags" if ($flags ne "");
|
$cflags="$flags$cflags" if ($flags ne "");
|
||||||
|
|
||||||
# Kerberos settings. The flavor must be provided from outside, either through
|
# Kerberos settings. The flavor must be provided from outside, either through
|
||||||
@@ -985,7 +1001,7 @@ if ($no_krb5
|
|||||||
|| !defined($withargs{"krb5-flavor"})
|
|| !defined($withargs{"krb5-flavor"})
|
||||||
|| $withargs{"krb5-flavor"} eq "")
|
|| $withargs{"krb5-flavor"} eq "")
|
||||||
{
|
{
|
||||||
$cflags="-DOPENSSL_NO_KRB5 $cflags";
|
#$cflags="-DOPENSSL_NO_KRB5 $cflags";
|
||||||
$options.=" no-krb5" unless $no_krb5;
|
$options.=" no-krb5" unless $no_krb5;
|
||||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_KRB5\n";
|
$openssl_algorithm_defines .= "#define OPENSSL_NO_KRB5\n";
|
||||||
}
|
}
|
||||||
@@ -1037,7 +1053,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$withargs{"krb5-lib"} .= " -lresolv"
|
$withargs{"krb5-lib"} .= " -lresolv"
|
||||||
if ("$lresolv");
|
if ("$lresolv" ne "");
|
||||||
$withargs{"krb5-include"} = "-I".$withargs{"krb5-dir"}."/include"
|
$withargs{"krb5-include"} = "-I".$withargs{"krb5-dir"}."/include"
|
||||||
if $withargs{"krb5-include"} eq "" &&
|
if $withargs{"krb5-include"} eq "" &&
|
||||||
$withargs{"krb5-dir"} ne "";
|
$withargs{"krb5-dir"} ne "";
|
||||||
@@ -1096,7 +1112,7 @@ else
|
|||||||
# }
|
# }
|
||||||
}
|
}
|
||||||
|
|
||||||
$lflags="$libs$lflags"if ($libs ne "");
|
$lflags="$libs$lflags" if ($libs ne "");
|
||||||
|
|
||||||
if ($no_asm)
|
if ($no_asm)
|
||||||
{
|
{
|
||||||
@@ -1104,9 +1120,14 @@ if ($no_asm)
|
|||||||
$sha1_obj=$md5_obj=$rmd160_obj="";
|
$sha1_obj=$md5_obj=$rmd160_obj="";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$no_shared)
|
||||||
|
{
|
||||||
|
$cast_obj=""; # CAST assembler is not PIC
|
||||||
|
}
|
||||||
|
|
||||||
if ($threads)
|
if ($threads)
|
||||||
{
|
{
|
||||||
$cflags=$thread_cflags;
|
#$cflags=$thread_cflags;
|
||||||
$openssl_thread_defines .= $thread_defines;
|
$openssl_thread_defines .= $thread_defines;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1119,36 +1140,33 @@ if ($zlib)
|
|||||||
|
|
||||||
# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
|
# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
|
||||||
my $shared_mark = "";
|
my $shared_mark = "";
|
||||||
if ($shared_target ne "")
|
if ($shared_target eq "")
|
||||||
|
{
|
||||||
|
$no_shared_warn = 1 if !$no_shared;
|
||||||
|
$no_shared = 1;
|
||||||
|
}
|
||||||
|
if (!$no_shared)
|
||||||
{
|
{
|
||||||
if ($shared_cflag ne "")
|
if ($shared_cflag ne "")
|
||||||
{
|
{
|
||||||
$cflags = "$shared_cflag $cflags";
|
$cflags = "$shared_cflag -DOPENSSL_PIC $cflags";
|
||||||
}
|
}
|
||||||
if (!$no_shared)
|
|
||||||
{
|
|
||||||
#$shared_mark = "\$(SHARED_LIBS)";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$no_shared = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($no_shared)
|
if ($no_shared)
|
||||||
{
|
{
|
||||||
$cflags="-DOPENSSL_NO_DYNAMIC_ENGINE $cflags";
|
#$cflags="-DOPENSSL_NO_DYNAMIC_ENGINE $cflags";
|
||||||
$openssl_other_defines.="#define OPENSSL_NO_DYNAMIC_ENGINE\n";
|
$openssl_other_defines.="#define OPENSSL_NO_DYNAMIC_ENGINE\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cflags="-DOPENSSL_NO_STATIC_ENGINE $cflags";
|
#$cflags="-DOPENSSL_NO_STATIC_ENGINE $cflags";
|
||||||
$openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n";
|
$openssl_other_defines.="#define OPENSSL_NO_STATIC_ENGINE\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sys_id ne "")
|
if ($sys_id ne "")
|
||||||
{
|
{
|
||||||
$cflags="-DOPENSSL_SYSNAME_$sys_id $cflags";
|
#$cflags="-DOPENSSL_SYSNAME_$sys_id $cflags";
|
||||||
$openssl_sys_defines="#define OPENSSL_SYSNAME_$sys_id\n";
|
$openssl_sys_defines="#define OPENSSL_SYSNAME_$sys_id\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1163,6 +1181,8 @@ if ($ranlib eq "")
|
|||||||
#$bn_obj="$bn1";
|
#$bn_obj="$bn1";
|
||||||
|
|
||||||
$bn_obj = $bn_asm unless $bn_obj ne "";
|
$bn_obj = $bn_asm unless $bn_obj ne "";
|
||||||
|
# bn86* is the only one implementing bn_*_part_words
|
||||||
|
$cflags.=" -DOPENSSL_BN_ASM_PART_WORDS" if ($bn_obj =~ /bn86/);
|
||||||
|
|
||||||
$des_obj=$des_enc unless ($des_obj =~ /\.o$/);
|
$des_obj=$des_enc unless ($des_obj =~ /\.o$/);
|
||||||
$bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/);
|
$bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/);
|
||||||
@@ -1319,8 +1339,6 @@ print "ARFLAGS =$arflags\n";
|
|||||||
print "PERL =$perl\n";
|
print "PERL =$perl\n";
|
||||||
print "KRB5_INCLUDES =",$withargs{"krb5-include"},"\n"
|
print "KRB5_INCLUDES =",$withargs{"krb5-include"},"\n"
|
||||||
if $withargs{"krb5-include"} ne "";
|
if $withargs{"krb5-include"} ne "";
|
||||||
print "LIBKRB5 =",$withargs{"krb5-lib"},"\n"
|
|
||||||
if $withargs{"krb5-lib"} ne "";
|
|
||||||
|
|
||||||
my $des_ptr=0;
|
my $des_ptr=0;
|
||||||
my $des_risc1=0;
|
my $des_risc1=0;
|
||||||
@@ -1494,7 +1512,7 @@ print "RC2 uses u$type[$rc2_int]\n" if $rc2_int != $def_int;
|
|||||||
print "BF_PTR used\n" if $bf_ptr == 1;
|
print "BF_PTR used\n" if $bf_ptr == 1;
|
||||||
print "BF_PTR2 used\n" if $bf_ptr == 2;
|
print "BF_PTR2 used\n" if $bf_ptr == 2;
|
||||||
|
|
||||||
if($IsWindows) {
|
if($IsMK1MF) {
|
||||||
open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h";
|
open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h";
|
||||||
printf OUT <<EOF;
|
printf OUT <<EOF;
|
||||||
#ifndef MK1MF_BUILD
|
#ifndef MK1MF_BUILD
|
||||||
@@ -1536,7 +1554,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
# create the ms/version32.rc file if needed
|
# create the ms/version32.rc file if needed
|
||||||
if ($IsWindows) {
|
if ($IsMK1MF) {
|
||||||
my ($v1, $v2, $v3, $v4);
|
my ($v1, $v2, $v3, $v4);
|
||||||
if ($version_num =~ /(^[0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i) {
|
if ($version_num =~ /(^[0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i) {
|
||||||
$v1=hex $1;
|
$v1=hex $1;
|
||||||
@@ -1609,6 +1627,16 @@ applications as the compiler options required on this system are not known.
|
|||||||
See file INSTALL for details if you need multi-threading.
|
See file INSTALL for details if you need multi-threading.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
print <<\EOF if ($no_shared_warn);
|
||||||
|
|
||||||
|
You gave the option 'shared'. Normally, that would give you shared libraries.
|
||||||
|
Unfortunately, the OpenSSL configuration doesn't include shared library support
|
||||||
|
for this platform yet, so it will pretend you gave the option 'no-shared'. If
|
||||||
|
you can inform the developpers (openssl-dev\@openssl.org) how to support shared
|
||||||
|
libraries on this platform, they will at least look at it and try their best
|
||||||
|
(but please first make sure you have tried with a current version of OpenSSL).
|
||||||
|
EOF
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
sub usage
|
sub usage
|
||||||
|
|||||||
120
FAQ
120
FAQ
@@ -44,6 +44,8 @@ OpenSSL - Frequently Asked Questions
|
|||||||
* What is special about OpenSSL on Redhat?
|
* What is special about OpenSSL on Redhat?
|
||||||
* Why does the OpenSSL compilation fail on MacOS X?
|
* Why does the OpenSSL compilation fail on MacOS X?
|
||||||
* Why does the OpenSSL test suite fail on MacOS X?
|
* Why does the OpenSSL test suite fail on MacOS X?
|
||||||
|
* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
|
||||||
|
* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
|
||||||
|
|
||||||
[PROG] Questions about programming with OpenSSL
|
[PROG] Questions about programming with OpenSSL
|
||||||
|
|
||||||
@@ -66,7 +68,7 @@ OpenSSL - Frequently Asked Questions
|
|||||||
* Which is the current version of OpenSSL?
|
* Which is the current version of OpenSSL?
|
||||||
|
|
||||||
The current version is available from <URL: http://www.openssl.org>.
|
The current version is available from <URL: http://www.openssl.org>.
|
||||||
OpenSSL 0.9.6g was released on August 9, 2002.
|
OpenSSL 0.9.7c was released on September 30, 2003.
|
||||||
|
|
||||||
In addition to the current stable release, you can also access daily
|
In addition to the current stable release, you can also access daily
|
||||||
snapshots of the OpenSSL development version at <URL:
|
snapshots of the OpenSSL development version at <URL:
|
||||||
@@ -114,11 +116,14 @@ OpenSSL. Information on the OpenSSL mailing lists is available from
|
|||||||
|
|
||||||
* Where can I get a compiled version of OpenSSL?
|
* Where can I get a compiled version of OpenSSL?
|
||||||
|
|
||||||
|
You can finder pointers to binary distributions in
|
||||||
|
http://www.openssl.org/related/binaries.html .
|
||||||
|
|
||||||
Some applications that use OpenSSL are distributed in binary form.
|
Some applications that use OpenSSL are distributed in binary form.
|
||||||
When using such an application, you don't need to install OpenSSL
|
When using such an application, you don't need to install OpenSSL
|
||||||
yourself; the application will include the required parts (e.g. DLLs).
|
yourself; the application will include the required parts (e.g. DLLs).
|
||||||
|
|
||||||
If you want to install OpenSSL on a Windows system and you don't have
|
If you want to build OpenSSL on a Windows system and you don't have
|
||||||
a C compiler, read the "Mingw32" section of INSTALL.W32 for information
|
a C compiler, read the "Mingw32" section of INSTALL.W32 for information
|
||||||
on how to obtain and install the free GNU C compiler.
|
on how to obtain and install the free GNU C compiler.
|
||||||
|
|
||||||
@@ -187,18 +192,30 @@ for permission to use their software with OpenSSL.
|
|||||||
|
|
||||||
Cryptographic software needs a source of unpredictable data to work
|
Cryptographic software needs a source of unpredictable data to work
|
||||||
correctly. Many open source operating systems provide a "randomness
|
correctly. Many open source operating systems provide a "randomness
|
||||||
device" that serves this purpose. On other systems, applications have
|
device" (/dev/urandom or /dev/random) that serves this purpose.
|
||||||
to call the RAND_add() or RAND_seed() function with appropriate data
|
All OpenSSL versions try to use /dev/urandom by default; starting with
|
||||||
before generating keys or performing public key encryption.
|
version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not
|
||||||
(These functions initialize the pseudo-random number generator, PRNG.)
|
available.
|
||||||
|
|
||||||
Some broken applications do not do this. As of version 0.9.5, the
|
On other systems, applications have to call the RAND_add() or
|
||||||
OpenSSL functions that need randomness report an error if the random
|
RAND_seed() function with appropriate data before generating keys or
|
||||||
number generator has not been seeded with at least 128 bits of
|
performing public key encryption. (These functions initialize the
|
||||||
randomness. If this error occurs, please contact the author of the
|
pseudo-random number generator, PRNG.) Some broken applications do
|
||||||
application you are using. It is likely that it never worked
|
not do this. As of version 0.9.5, the OpenSSL functions that need
|
||||||
correctly. OpenSSL 0.9.5 and later make the error visible by refusing
|
randomness report an error if the random number generator has not been
|
||||||
to perform potentially insecure encryption.
|
seeded with at least 128 bits of randomness. If this error occurs and
|
||||||
|
is not discussed in the documentation of the application you are
|
||||||
|
using, please contact the author of that application; it is likely
|
||||||
|
that it never worked correctly. OpenSSL 0.9.5 and later make the
|
||||||
|
error visible by refusing to perform potentially insecure encryption.
|
||||||
|
|
||||||
|
If you are using Solaris 8, you can add /dev/urandom and /dev/random
|
||||||
|
devices by installing patch 112438 (Sparc) or 112439 (x86), which are
|
||||||
|
available via the Patchfinder at <URL: http://sunsolve.sun.com>
|
||||||
|
(Solaris 9 includes these devices by default). For /dev/random support
|
||||||
|
for earlier Solaris versions, see Sun's statement at
|
||||||
|
<URL: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski>
|
||||||
|
(the SUNWski package is available in patch 105710).
|
||||||
|
|
||||||
On systems without /dev/urandom and /dev/random, it is a good idea to
|
On systems without /dev/urandom and /dev/random, it is a good idea to
|
||||||
use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
|
use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
|
||||||
@@ -231,18 +248,6 @@ OpenSSL command line tools. Applications using the OpenSSL library
|
|||||||
provide their own configuration options to specify the entropy source,
|
provide their own configuration options to specify the entropy source,
|
||||||
please check out the documentation coming the with application.
|
please check out the documentation coming the with application.
|
||||||
|
|
||||||
For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
|
|
||||||
installing the SUNski package from Sun patch 105710-01 (Sparc) which
|
|
||||||
adds a /dev/random device and make sure it gets used, usually through
|
|
||||||
$RANDFILE. There are probably similar patches for the other Solaris
|
|
||||||
versions. An official statement from Sun with respect to /dev/random
|
|
||||||
support can be found at
|
|
||||||
http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski
|
|
||||||
However, be warned that /dev/random is usually a blocking device, which
|
|
||||||
may have some effects on OpenSSL.
|
|
||||||
A third party /dev/random solution for Solaris is available at
|
|
||||||
http://www.cosy.sbg.ac.at/~andi/
|
|
||||||
|
|
||||||
|
|
||||||
* Why do I get an "unable to write 'random state'" error message?
|
* Why do I get an "unable to write 'random state'" error message?
|
||||||
|
|
||||||
@@ -488,10 +493,13 @@ and then redo the compilation. What you should really do is make sure
|
|||||||
Sometimes, you may get reports from VC++ command line (cl) that it
|
Sometimes, you may get reports from VC++ command line (cl) that it
|
||||||
can't find standard include files like stdio.h and other weirdnesses.
|
can't find standard include files like stdio.h and other weirdnesses.
|
||||||
One possible cause is that the environment isn't correctly set up.
|
One possible cause is that the environment isn't correctly set up.
|
||||||
To solve that problem, one should run VCVARS32.BAT which is found in
|
To solve that problem for VC++ versions up to 6, one should run
|
||||||
the 'bin' subdirectory of the VC++ installation directory (somewhere
|
VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
|
||||||
under 'Program Files'). This needs to be done prior to running NMAKE,
|
installation directory (somewhere under 'Program Files'). For VC++
|
||||||
and the changes are only valid for the current DOS session.
|
version 7 (and up?), which is also called VS.NET, the file is called
|
||||||
|
VSVARS32.BAT instead.
|
||||||
|
This needs to be done prior to running NMAKE, and the changes are only
|
||||||
|
valid for the current DOS session.
|
||||||
|
|
||||||
|
|
||||||
* What is special about OpenSSL on Redhat?
|
* What is special about OpenSSL on Redhat?
|
||||||
@@ -552,6 +560,37 @@ libraries you just built.
|
|||||||
Look in the file PROBLEMS for a more detailed explanation and for possible
|
Look in the file PROBLEMS for a more detailed explanation and for possible
|
||||||
solutions.
|
solutions.
|
||||||
|
|
||||||
|
* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
|
||||||
|
|
||||||
|
Failure in BN_sqr test is most likely caused by a failure to configure the
|
||||||
|
toolkit for current platform or lack of support for the platform in question.
|
||||||
|
Run './config -t' and './apps/openssl version -p'. Do these platform
|
||||||
|
identifiers match? If they don't, then you most likely failed to run
|
||||||
|
./config and you're hereby advised to do so before filing a bug report.
|
||||||
|
If ./config itself fails to run, then it's most likely problem with your
|
||||||
|
local environment and you should turn to your system administrator (or
|
||||||
|
similar). If identifiers match (and/or no alternative identifier is
|
||||||
|
suggested by ./config script), then the platform is unsupported. There might
|
||||||
|
or might not be a workaround. Most notably on SPARC64 platforms with GNU
|
||||||
|
C compiler you should be able to produce a working build by running
|
||||||
|
'./config -m32'. I understand that -m32 might not be what you want/need,
|
||||||
|
but the build should be operational. For further details turn to
|
||||||
|
<openssl-dev@openssl.org>.
|
||||||
|
|
||||||
|
* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
|
||||||
|
|
||||||
|
As of 0.9.7 assembler routines were overhauled for position independence
|
||||||
|
of the machine code, which is essential for shared library support. For
|
||||||
|
some reason OpenBSD is equipped with an out-of-date GNU assembler which
|
||||||
|
finds the new code offensive. To work around the problem, configure with
|
||||||
|
no-asm (and sacrifice a great deal of performance) or patch your assembler
|
||||||
|
according to <URL: http://www.openssl.org/~appro/gas-1.92.3.OpenBSD.patch>.
|
||||||
|
For your convenience a pre-compiled replacement binary is provided at
|
||||||
|
<URL: http://www.openssl.org/~appro/gas-1.92.3.static.aout.bin>.
|
||||||
|
Reportedly elder *BSD a.out platforms also suffer from this problem and
|
||||||
|
remedy should be same. Provided binary is statically linked and should be
|
||||||
|
working across wider range of *BSD branches, not just OpenBSD.
|
||||||
|
|
||||||
[PROG] ========================================================================
|
[PROG] ========================================================================
|
||||||
|
|
||||||
* Is OpenSSL thread-safe?
|
* Is OpenSSL thread-safe?
|
||||||
@@ -610,26 +649,26 @@ built OpenSSL with /MD your application must use /MD and cannot use /MDd.
|
|||||||
* How do I read or write a DER encoded buffer using the ASN1 functions?
|
* How do I read or write a DER encoded buffer using the ASN1 functions?
|
||||||
|
|
||||||
You have two options. You can either use a memory BIO in conjunction
|
You have two options. You can either use a memory BIO in conjunction
|
||||||
with the i2d_XXX_bio() or d2i_XXX_bio() functions or you can use the
|
with the i2d_*_bio() or d2i_*_bio() functions or you can use the
|
||||||
i2d_XXX(), d2i_XXX() functions directly. Since these are often the
|
i2d_*(), d2i_*() functions directly. Since these are often the
|
||||||
cause of grief here are some code fragments using PKCS7 as an example:
|
cause of grief here are some code fragments using PKCS7 as an example:
|
||||||
|
|
||||||
unsigned char *buf, *p;
|
unsigned char *buf, *p;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = i2d_PKCS7(p7, NULL);
|
len = i2d_PKCS7(p7, NULL);
|
||||||
buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */
|
buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */
|
||||||
p = buf;
|
p = buf;
|
||||||
i2d_PKCS7(p7, &p);
|
i2d_PKCS7(p7, &p);
|
||||||
|
|
||||||
At this point buf contains the len bytes of the DER encoding of
|
At this point buf contains the len bytes of the DER encoding of
|
||||||
p7.
|
p7.
|
||||||
|
|
||||||
The opposite assumes we already have len bytes in buf:
|
The opposite assumes we already have len bytes in buf:
|
||||||
|
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
p = buf;
|
p = buf;
|
||||||
p7 = d2i_PKCS7(NULL, &p, len);
|
p7 = d2i_PKCS7(NULL, &p, len);
|
||||||
|
|
||||||
At this point p7 contains a valid PKCS7 structure of NULL if an error
|
At this point p7 contains a valid PKCS7 structure of NULL if an error
|
||||||
occurred. If an error occurred ERR_print_errors(bio) should give more
|
occurred. If an error occurred ERR_print_errors(bio) should give more
|
||||||
@@ -696,6 +735,7 @@ The general answer is to check the config.log file generated when running
|
|||||||
the OpenSSH configure script. It should contain the detailed information
|
the OpenSSH configure script. It should contain the detailed information
|
||||||
on why the OpenSSL library was not detected or considered incompatible.
|
on why the OpenSSL library was not detected or considered incompatible.
|
||||||
|
|
||||||
|
|
||||||
* Can I use OpenSSL's SSL library with non-blocking I/O?
|
* Can I use OpenSSL's SSL library with non-blocking I/O?
|
||||||
|
|
||||||
Yes; make sure to read the SSL_get_error(3) manual page!
|
Yes; make sure to read the SSL_get_error(3) manual page!
|
||||||
|
|||||||
36
INSTALL
36
INSTALL
@@ -2,8 +2,10 @@
|
|||||||
INSTALLATION ON THE UNIX PLATFORM
|
INSTALLATION ON THE UNIX PLATFORM
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
[Installation on DOS (with djgpp), Windows, OpenVMS and MacOS (before MacOS X)
|
[Installation on DOS (with djgpp), Windows, OpenVMS, MacOS (before MacOS X)
|
||||||
is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.
|
and NetWare is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS,
|
||||||
|
INSTALL.MacOS and INSTALL.NW.
|
||||||
|
|
||||||
This document describes installation on operating systems in the Unix
|
This document describes installation on operating systems in the Unix
|
||||||
family.]
|
family.]
|
||||||
|
|
||||||
@@ -140,8 +142,8 @@
|
|||||||
standard headers). If it is a problem with OpenSSL itself, please
|
standard headers). If it is a problem with OpenSSL itself, please
|
||||||
report the problem to <openssl-bugs@openssl.org> (note that your
|
report the problem to <openssl-bugs@openssl.org> (note that your
|
||||||
message will be recorded in the request tracker publicly readable
|
message will be recorded in the request tracker publicly readable
|
||||||
via http://www.openssl.org/rt2.html and will be forwarded to a public
|
via http://www.openssl.org/support/rt2.html and will be forwarded to a
|
||||||
mailing list). Include the output of "make report" in your message.
|
public mailing list). Include the output of "make report" in your message.
|
||||||
Please check out the request tracker. Maybe the bug was already
|
Please check out the request tracker. Maybe the bug was already
|
||||||
reported or has already been fixed.
|
reported or has already been fixed.
|
||||||
|
|
||||||
@@ -158,11 +160,11 @@
|
|||||||
If a test fails, look at the output. There may be reasons for
|
If a test fails, look at the output. There may be reasons for
|
||||||
the failure that isn't a problem in OpenSSL itself (like a missing
|
the failure that isn't a problem in OpenSSL itself (like a missing
|
||||||
or malfunctioning bc). If it is a problem with OpenSSL itself,
|
or malfunctioning bc). If it is a problem with OpenSSL itself,
|
||||||
try removing any compiler optimization flags from the CFLAGS line
|
try removing any compiler optimization flags from the CFLAG line
|
||||||
in Makefile.ssl and run "make clean; make". Please send a bug
|
in Makefile.ssl and run "make clean; make". Please send a bug
|
||||||
report to <openssl-bugs@openssl.org>, including the output of
|
report to <openssl-bugs@openssl.org>, including the output of
|
||||||
"make report" in order to be added to the request tracker at
|
"make report" in order to be added to the request tracker at
|
||||||
http://www.openssl.org/rt2.html.
|
http://www.openssl.org/support/rt2.html.
|
||||||
|
|
||||||
4. If everything tests ok, install OpenSSL with
|
4. If everything tests ok, install OpenSSL with
|
||||||
|
|
||||||
@@ -308,3 +310,25 @@
|
|||||||
to install additional support software to obtain random seed.
|
to install additional support software to obtain random seed.
|
||||||
Please check out the manual pages for RAND_add(), RAND_bytes(), RAND_egd(),
|
Please check out the manual pages for RAND_add(), RAND_bytes(), RAND_egd(),
|
||||||
and the FAQ for more information.
|
and the FAQ for more information.
|
||||||
|
|
||||||
|
Note on support for multiple builds
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
OpenSSL is usually built in it's source tree. Unfortunately, this doesn't
|
||||||
|
support building for multiple platforms from the same source tree very well.
|
||||||
|
It is however possible to build in a separate tree through the use of lots
|
||||||
|
of symbolic links, which should be prepared like this:
|
||||||
|
|
||||||
|
mkdir -p objtree/"`uname -s`-`uname -r`-`uname -m`"
|
||||||
|
cd objtree/"`uname -s`-`uname -r`-`uname -m`"
|
||||||
|
(cd $OPENSSL_SOURCE; find . -type f) | while read F; do
|
||||||
|
mkdir -p `dirname $F`
|
||||||
|
rm -f $F; ln -s $OPENSSL_SOURCE/$F $F
|
||||||
|
echo $F '->' $OPENSSL_SOURCE/$F
|
||||||
|
done
|
||||||
|
make -f Makefile.org clean
|
||||||
|
|
||||||
|
OPENSSL_SOURCE is an environment variable that contains the absolute (this
|
||||||
|
is important!) path to the OpenSSL source tree.
|
||||||
|
|
||||||
|
Also, operations like 'make update' should still be made in the source tree.
|
||||||
|
|||||||
@@ -12,12 +12,14 @@
|
|||||||
latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package
|
latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package
|
||||||
requires that PERL and BC also be installed.
|
requires that PERL and BC also be installed.
|
||||||
|
|
||||||
All of these can be obtained from the usual DJGPP mirror sites, such as
|
All of these can be obtained from the usual DJGPP mirror sites, such
|
||||||
"ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp". You also need to have
|
as "ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp". You also need to
|
||||||
the WATT-32 networking package installed before you try to compile
|
have the WATT-32 networking package installed before you try to compile
|
||||||
openssl. This can be obtained from "http://www.bgnett.no/~giva/". The
|
openssl. This can be obtained from "http://www.bgnett.no/~giva/".
|
||||||
Makefile assumes that the WATT-32 code is in directory "watt32" under
|
The Makefile assumes that the WATT-32 code is in the directory
|
||||||
/dev/env/DJDIR.
|
specified by the environment variable WATT_ROOT. If you have watt-32
|
||||||
|
in directory "watt32" under your main DJGPP directory, specify
|
||||||
|
WATT_ROOT="/dev/env/DJDIR/watt32".
|
||||||
|
|
||||||
To compile openssl, start your BASH shell. Then configure for DOS by
|
To compile openssl, start your BASH shell. Then configure for DOS by
|
||||||
running "./Configure" with appropriate arguments. The basic syntax for
|
running "./Configure" with appropriate arguments. The basic syntax for
|
||||||
|
|||||||
437
INSTALL.NW
Normal file
437
INSTALL.NW
Normal file
@@ -0,0 +1,437 @@
|
|||||||
|
|
||||||
|
INSTALLATION ON THE NETWARE PLATFORM
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
Notes about building OpenSSL for NetWare.
|
||||||
|
|
||||||
|
|
||||||
|
BUILD PLATFORM:
|
||||||
|
---------------
|
||||||
|
The build scripts (batch files, perl scripts, etc) have been developed and
|
||||||
|
tested on W2K. The scripts should run fine on other Windows
|
||||||
|
platforms (NT, Win9x, WinXP) but they haven't been tested. They may require
|
||||||
|
some modifications.
|
||||||
|
|
||||||
|
|
||||||
|
Supported NetWare Platforms - NetWare 5.x, NetWare 6.x:
|
||||||
|
------------------------------------------
|
||||||
|
OpenSSL uses the WinSock interfaces introduced in NetWare 5. Therefore,
|
||||||
|
previous versions of NetWare, 4.x and 3.x, are not supported.
|
||||||
|
|
||||||
|
On NetWare there are two c-runtime libraries. There is the legacy CLIB
|
||||||
|
interfaces and the newer LibC interfaces. Being ANSI-C libraries, the
|
||||||
|
functionality in CLIB and LibC is similar but the LibC interfaces are built
|
||||||
|
using Novell Kernal Services (NKS) which is designed to leverage
|
||||||
|
multi-processor environments.
|
||||||
|
|
||||||
|
The NetWare port of OpenSSL can configured to build using CLIB or LibC. The
|
||||||
|
CLIB build was developed and tested using NetWare 5.0 sp6.0a. The LibC
|
||||||
|
build was developed and tested using the NetWare 6.0 FCS.
|
||||||
|
|
||||||
|
The necessary LibC functionality ships with NetWare 6. However, earlier
|
||||||
|
NetWare 5.x versions will require updates in order to run the OpenSSL LibC
|
||||||
|
build.
|
||||||
|
|
||||||
|
|
||||||
|
REQUIRED TOOLS:
|
||||||
|
---------------
|
||||||
|
Based upon the configuration and build options used, some or all of the
|
||||||
|
following tools may be required:
|
||||||
|
|
||||||
|
|
||||||
|
* Perl for Win32 - required (http://www.activestate.com/ActivePerl)
|
||||||
|
Used to run the various perl scripts on the build platform.
|
||||||
|
|
||||||
|
|
||||||
|
* Perl 5.8.0 for NetWare v3.20 (or later) - required
|
||||||
|
(http://developer.novell.com) Used to run the test script on NetWare
|
||||||
|
after building.
|
||||||
|
|
||||||
|
|
||||||
|
* Metrowerks CodeWarrior PDK 2.1 (or later) for NetWare - required:
|
||||||
|
Provides command line tools used for building.
|
||||||
|
|
||||||
|
Tools:
|
||||||
|
mwccnlm.exe - C/C++ Compiler for NetWare
|
||||||
|
mwldnlm.exe - Linker for NetWare
|
||||||
|
mwasmnlm.exe - x86 assembler for NetWare (if using assembly option)
|
||||||
|
|
||||||
|
|
||||||
|
* Assemblers - optional:
|
||||||
|
If you intend to build using the assembly options you will need an
|
||||||
|
assembler. Work has been completed to support two assemblers, Metrowerks
|
||||||
|
and NASM. However, during development, a bug was found in the Metrowerks
|
||||||
|
assembler which generates incorrect code. Until this problem is fixed,
|
||||||
|
the Metrowerks assembler cannot be used.
|
||||||
|
|
||||||
|
mwasmnlm.exe - Metrowerks x86 assembler - part of CodeWarrior tools.
|
||||||
|
(version 2.2 Built Aug 23, 1999 - not useable due to code
|
||||||
|
generation bug)
|
||||||
|
|
||||||
|
nasmw.exe - Netwide Assembler NASM
|
||||||
|
version 0.98 was used in development and testing
|
||||||
|
|
||||||
|
* Make Tool - required:
|
||||||
|
In order to build you will need a make tool. Two make tools are
|
||||||
|
supported, GNU make (gmake.exe) or Microsoft nmake.exe.
|
||||||
|
|
||||||
|
gmake.exe - GNU make for Windows (version 3.75 used for development)
|
||||||
|
http://www.gnu.org/software/make/make.html
|
||||||
|
|
||||||
|
nmake.exe - Microsoft make (Version 6.00.8168.0 used for development)
|
||||||
|
|
||||||
|
|
||||||
|
* Novell Developer Kit (NDK) - required: (http://developer.novell.com)
|
||||||
|
|
||||||
|
CLIB - BUILDS:
|
||||||
|
|
||||||
|
WinSock2 Developer Components for NetWare:
|
||||||
|
For initial development, the October 27, 2000 version was used.
|
||||||
|
However, future versions should also work.
|
||||||
|
|
||||||
|
NOTE: The WinSock2 components include headers & import files for
|
||||||
|
NetWare, but you will also need the winsock2.h and supporting
|
||||||
|
headers (pshpack4.h, poppack.h, qos.h) delivered in the
|
||||||
|
Microsoft SDK. Note: The winsock2.h support headers may change
|
||||||
|
with various versions of winsock2.h. Check the dependencies
|
||||||
|
section on the NDK WinSock2 download page for the latest
|
||||||
|
information on dependencies.
|
||||||
|
|
||||||
|
|
||||||
|
NLM and NetWare libraries for C (including CLIB and XPlat):
|
||||||
|
If you are going to build a CLIB version of OpenSSL, you will
|
||||||
|
need the CLIB headers and imports. The March, 2001 NDK release or
|
||||||
|
later is recommended.
|
||||||
|
|
||||||
|
Earlier versions should work but haven't been tested. In recent
|
||||||
|
versions the import files have been consolidated and function
|
||||||
|
names moved. This means you may run into link problems
|
||||||
|
(undefined symbols) when using earlier versions. The functions
|
||||||
|
are available in earlier versions, but you will have to modifiy
|
||||||
|
the make files to include additional import files (see
|
||||||
|
openssl\util\pl\netware.pl).
|
||||||
|
|
||||||
|
|
||||||
|
LIBC - BUILDS:
|
||||||
|
|
||||||
|
Libraries for C (LibC) - LibC headers and import files
|
||||||
|
If you are going to build a LibC version of OpenSSL, you will
|
||||||
|
need the LibC headers and imports. The March 14, 2002 NDK release or
|
||||||
|
later is required.
|
||||||
|
|
||||||
|
NOTE: The LibC SDK includes the necessary WinSock2 support. It
|
||||||
|
It is not necessary to download the WinSock2 Developer when building
|
||||||
|
for LibC.
|
||||||
|
|
||||||
|
|
||||||
|
BUILDING:
|
||||||
|
---------
|
||||||
|
Before building, you will need to set a few environment variables. You can
|
||||||
|
set them manually or you can modify the "netware\set_env.bat" file.
|
||||||
|
|
||||||
|
The set_env.bat file is a template you can use to set up the path
|
||||||
|
and environment variables you will need to build. Modify the
|
||||||
|
various lines to point to YOUR tools and run set_env.bat.
|
||||||
|
|
||||||
|
netware\set_env.bat [target]
|
||||||
|
|
||||||
|
target - "netware-clib" - CLib NetWare build
|
||||||
|
- "netware-libc" - LibC NetWare build
|
||||||
|
|
||||||
|
If you don't use set_env.bat, you will need to set up the following
|
||||||
|
environment variables:
|
||||||
|
|
||||||
|
path - Set path to point to the tools you will use.
|
||||||
|
|
||||||
|
MWCIncludes - The location of the NDK include files.
|
||||||
|
|
||||||
|
CLIB ex: set MWCIncludes=c:\ndk\nwsdk\include\nlm
|
||||||
|
LibC ex: set MWCIncludes=c:\ndk\libc\include
|
||||||
|
|
||||||
|
PRELUDE - The absolute path of the prelude object to link with. For
|
||||||
|
a CLIB build it is recommended you use the "nwpre.obj" file shipped
|
||||||
|
with the Metrowerks PDK for NetWare. For a LibC build you should
|
||||||
|
use the "libcpre.o" file delivered with the LibC NDK components.
|
||||||
|
|
||||||
|
CLIB ex: set PRELUDE=c:\codewar\novell support\metrowerks support\
|
||||||
|
libraries\runtime\nwpre.obj
|
||||||
|
|
||||||
|
LibC ex: set PRELUDE=c:\ndk\libc\imports\libcpre.o
|
||||||
|
|
||||||
|
IMPORTS - The locaton of the NDK import files.
|
||||||
|
|
||||||
|
CLIB ex: set IMPORTS=c:\ndk\nwsdk\imports
|
||||||
|
LibC ex: set IMPORTS=c:\ndk\libc\imports
|
||||||
|
|
||||||
|
|
||||||
|
In order to build, you need to run the Perl scripts to configure the build
|
||||||
|
process and generate a make file. There is a batch file,
|
||||||
|
"netware\build.bat", to automate the process.
|
||||||
|
|
||||||
|
Build.bat runs the build configuration scripts and generates a make file.
|
||||||
|
If an assembly option is specified, it also runs the scripts to generate
|
||||||
|
the assembly code. Always run build.bat from the "openssl" directory.
|
||||||
|
|
||||||
|
netware\build [target] [debug opts] [assembly opts] [configure opts]
|
||||||
|
|
||||||
|
target - "netware-clib" - CLib NetWare build
|
||||||
|
- "netware-libc" - LibC NetWare build
|
||||||
|
|
||||||
|
debug opts - "debug" - build debug
|
||||||
|
|
||||||
|
assembly opts - "nw-mwasm" - use Metrowerks assembler
|
||||||
|
"nw-nasm" - use NASM assembler
|
||||||
|
"no-asm" - don't use assembly
|
||||||
|
|
||||||
|
configure opts- all unrecognized arguments are passed to the
|
||||||
|
perl configure script
|
||||||
|
|
||||||
|
examples:
|
||||||
|
|
||||||
|
CLIB build, debug, without assembly:
|
||||||
|
netware\build.bat netware-clib debug no-asm
|
||||||
|
|
||||||
|
LibC build, non-debug, using NASM assembly:
|
||||||
|
netware\build.bat netware-libc nw-nasm
|
||||||
|
|
||||||
|
Running build.bat generates a make file to be processed by your make
|
||||||
|
tool (gmake or nmake):
|
||||||
|
|
||||||
|
CLIB ex: gmake -f netware\nlm_clib.mak
|
||||||
|
LibC ex: gmake -f netware\nlm_libc.mak
|
||||||
|
|
||||||
|
|
||||||
|
You can also run the build scripts manually if you do not want to use the
|
||||||
|
build.bat file. Run the following scripts in the "\openssl"
|
||||||
|
subdirectory (in the order listed below):
|
||||||
|
|
||||||
|
perl configure no-asm [other config opts] [netware-clib|netware-libc]
|
||||||
|
configures no assembly build for specified netware environment
|
||||||
|
(CLIB or LibC).
|
||||||
|
|
||||||
|
perl util\mkfiles.pl >MINFO
|
||||||
|
generates a listing of source files (used by mk1mf)
|
||||||
|
|
||||||
|
perl util\mk1mf.pl no-asm [other config opts] [netware-clib|netware-libc >netware\nlm.mak
|
||||||
|
generates the makefile for NetWare
|
||||||
|
|
||||||
|
gmake -f netware\nlm.mak
|
||||||
|
build with the make tool (nmake.exe also works)
|
||||||
|
|
||||||
|
NOTE: If you are building using the assembly option, you must also run the
|
||||||
|
various Perl scripts to generate the assembly files. See build.bat
|
||||||
|
for an example of running the various assembly scripts. You must use the
|
||||||
|
"no-asm" option to build without assembly. The configure and mk1mf scripts
|
||||||
|
also have various other options. See the scripts for more information.
|
||||||
|
|
||||||
|
|
||||||
|
The output from the build is placed in the following directories:
|
||||||
|
|
||||||
|
CLIB Debug build:
|
||||||
|
out_nw_clib.dbg - static libs & test nlm(s)
|
||||||
|
tmp_nw_clib.dbg - temporary build files
|
||||||
|
outinc_nw_clib - necessary include files
|
||||||
|
|
||||||
|
CLIB Non-debug build:
|
||||||
|
out_nw_clib - static libs & test nlm(s)
|
||||||
|
tmp_nw_clib - temporary build files
|
||||||
|
outinc_nw_clib - necesary include files
|
||||||
|
|
||||||
|
LibC Debug build:
|
||||||
|
out_nw_libc.dbg - static libs & test nlm(s)
|
||||||
|
tmp_nw_libc.dbg - temporary build files
|
||||||
|
outinc_nw_libc - necessary include files
|
||||||
|
|
||||||
|
LibC Non-debug build:
|
||||||
|
out_nw_libc - static libs & test nlm(s)
|
||||||
|
tmp_nw_libc - temporary build files
|
||||||
|
outinc_nw_libc - necesary include files
|
||||||
|
|
||||||
|
|
||||||
|
TESTING:
|
||||||
|
--------
|
||||||
|
The build process creates the OpenSSL static libs ( crypto.lib, ssl.lib,
|
||||||
|
rsaglue.lib ) and several test programs. You should copy the test programs
|
||||||
|
to your NetWare server and run the tests.
|
||||||
|
|
||||||
|
The batch file "netware\cpy_tests.bat" will copy all the necessary files
|
||||||
|
to your server for testing. In order to run the batch file, you need a
|
||||||
|
drive mapped to your target server. It will create an "OpenSSL" directory
|
||||||
|
on the drive and copy the test files to it. CAUTION: If a directory with the
|
||||||
|
name of "OpenSSL" already exists, it will be deleted.
|
||||||
|
|
||||||
|
To run cpy_tests.bat:
|
||||||
|
|
||||||
|
netware\cpy_tests [output directory] [NetWare drive]
|
||||||
|
|
||||||
|
output directory - "out_nw_clib.dbg", "out_nw_libc", etc.
|
||||||
|
NetWare drive - drive letter of mapped drive
|
||||||
|
|
||||||
|
CLIB ex: netware\cpy_tests out_nw_clib m:
|
||||||
|
LibC ex: netware\cpy_tests out_nw_libc m:
|
||||||
|
|
||||||
|
|
||||||
|
The Perl script, "do_tests.pl", in the "OpenSSL" directory on the server
|
||||||
|
should be used to execute the tests. Before running the script, make sure
|
||||||
|
your SEARCH PATH includes the "OpenSSL" directory. For example, if you
|
||||||
|
copied the files to the "sys:" volume you use the command:
|
||||||
|
|
||||||
|
SEARCH ADD SYS:\OPENSSL
|
||||||
|
|
||||||
|
|
||||||
|
To run do_tests.pl type (at the console prompt):
|
||||||
|
|
||||||
|
perl \openssl\do_tests.pl [options]
|
||||||
|
|
||||||
|
options:
|
||||||
|
-p - pause after executing each test
|
||||||
|
|
||||||
|
The do_tests.pl script generates a log file "\openssl\test_out\tests.log"
|
||||||
|
which should be reviewed for errors. Any errors will be denoted by the word
|
||||||
|
"ERROR" in the log.
|
||||||
|
|
||||||
|
NOTE: Currently (11/2002), the LibC test nlms report an error while loading
|
||||||
|
when launched from the perl script (do_tests.pl). The problems are
|
||||||
|
being addressed by the LibC development team and should be fixed in the
|
||||||
|
next release. Until the problems are corrected, the LibC test nlms
|
||||||
|
will have to be executed manually.
|
||||||
|
|
||||||
|
|
||||||
|
DEVELOPING WITH THE OPENSSL SDK:
|
||||||
|
--------------------------------
|
||||||
|
Now that everything is built and tested, you are ready to use the OpenSSL
|
||||||
|
libraries in your development.
|
||||||
|
|
||||||
|
There is no real installation procedure, just copy the static libs and
|
||||||
|
headers to your build location. The libs (crypto.lib & ssl.lib) are
|
||||||
|
located in the appropriate "out_nw_XXXX" directory
|
||||||
|
(out_nw_clib, out_nw_libc, etc).
|
||||||
|
|
||||||
|
The headers are located in the appropriate "outinc_nw_XXX" directory
|
||||||
|
(outinc_nw_clib, outinc_nw_libc).
|
||||||
|
|
||||||
|
One suggestion is to create the following directory
|
||||||
|
structure for the OpenSSL SDK:
|
||||||
|
|
||||||
|
\openssl
|
||||||
|
|- bin
|
||||||
|
| |- openssl.nlm
|
||||||
|
| |- (other tests you want)
|
||||||
|
|
|
||||||
|
|- lib
|
||||||
|
| | - crypto.lib
|
||||||
|
| | - ssl.lib
|
||||||
|
|
|
||||||
|
|- include
|
||||||
|
| | - openssl
|
||||||
|
| | | - (all the headers in "outinc_nw\openssl")
|
||||||
|
|
||||||
|
|
||||||
|
The program "openssl.nlm" can be very useful. It has dozens of
|
||||||
|
options and you may want to keep it handy for debugging, testing, etc.
|
||||||
|
|
||||||
|
When building your apps using OpenSSL, define "NETWARE". It is needed by
|
||||||
|
some of the OpenSSL headers. One way to do this is with a compile option,
|
||||||
|
for example "-DNETWARE".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
------
|
||||||
|
|
||||||
|
Resource leaks in Tests
|
||||||
|
------------------------
|
||||||
|
Some OpenSSL tests do not clean up resources and NetWare reports
|
||||||
|
the resource leaks when the tests unload. If this really bugs you,
|
||||||
|
you can stop the messages by setting the developer option off at the console
|
||||||
|
prompt (set developer option = off). Or better yet, fix the tests to
|
||||||
|
clean up the resources!
|
||||||
|
|
||||||
|
|
||||||
|
Multi-threaded Development
|
||||||
|
---------------------------
|
||||||
|
The NetWare version of OpenSSL is thread-safe however, multi-threaded
|
||||||
|
applications must provide the necessary locking function callbacks. This
|
||||||
|
is described in doc\threads.doc. The file "openssl\crypto\threads\mttest.c"
|
||||||
|
is a multi-threaded test program and demonstrates the locking functions.
|
||||||
|
|
||||||
|
|
||||||
|
What is openssl2.nlm?
|
||||||
|
---------------------
|
||||||
|
The openssl program has numerous options and can be used for many different
|
||||||
|
things. Many of the options operate in an interactive mode requiring the
|
||||||
|
user to enter data. Because of this, a default screen is created for the
|
||||||
|
program. However, when running the test script it is not desirable to
|
||||||
|
have a seperate screen. Therefore, the build also creates openssl2.nlm.
|
||||||
|
Openssl2.nlm is functionally identical but uses the console screen.
|
||||||
|
Openssl2 can be used when a non-interactive mode is desired.
|
||||||
|
|
||||||
|
NOTE: There are may other possibilities (command line options, etc)
|
||||||
|
which could have been used to address the screen issue. The openssl2.nlm
|
||||||
|
option was chosen because it impacted only the build not the code.
|
||||||
|
|
||||||
|
|
||||||
|
Why only static libraries?
|
||||||
|
--------------------------
|
||||||
|
Globals, globals, and more globals. The OpenSSL code uses many global
|
||||||
|
variables that are allocated and initialized when used for the first time.
|
||||||
|
|
||||||
|
On NetWare, most applications (at least historically) run in the kernel.
|
||||||
|
When running in the kernel, there is one instance of global variables.
|
||||||
|
For regular application type NLM(s) this isn't a problem because they are
|
||||||
|
the only ones using the globals. However, for a library NLM (an NLM which
|
||||||
|
exposes functions and has no threads of execution), the globals cause
|
||||||
|
problems. Applications could inadvertently step on each other if they
|
||||||
|
change some globals. Even worse, the first application that triggers a
|
||||||
|
global to be allocated and initialized has the allocated memory charged to
|
||||||
|
itself. Now when that application unloads, NetWare will clean up all the
|
||||||
|
applicaton's memory. The global pointer variables inside OpenSSL now
|
||||||
|
point to freed memory. An abend waiting to happen!
|
||||||
|
|
||||||
|
To work correctly in the kernel, library NLM(s) that use globals need to
|
||||||
|
provide a set of globals (instance data) for each application. Another
|
||||||
|
option is to require the library only be loaded in a protected address
|
||||||
|
space along with the application using it.
|
||||||
|
|
||||||
|
Modifying the OpenSSL code to provide a set of globals (instance data) for
|
||||||
|
each application isn't technically difficult, but due to the large number
|
||||||
|
globals it would require substantial code changes and it wasn't done. Hence,
|
||||||
|
the build currently only builds static libraries which are then linked
|
||||||
|
into each application.
|
||||||
|
|
||||||
|
NOTE: If you are building a library NLM that uses the OpenSSL static
|
||||||
|
libraries, you will still have to deal with the global variable issue.
|
||||||
|
This is because when you link in the OpenSSL code you bring in all the
|
||||||
|
globals. One possible solution for the global pointer variables is to
|
||||||
|
register memory functions with OpenSSL which allocate memory and charge it
|
||||||
|
to your library NLM (see the function CRYPTO_set_mem_functions). However,
|
||||||
|
be aware that now all memory allocated by OpenSSL is charged to your NLM.
|
||||||
|
|
||||||
|
|
||||||
|
CodeWarrior Tools and W2K
|
||||||
|
---------------------------
|
||||||
|
There have been problems reported with the CodeWarrior Linker
|
||||||
|
(mwldnlm.exe) in the PDK 2.1 for NetWare when running on Windows 2000. The
|
||||||
|
problems cause the link step to fail. The only work around is to obtain an
|
||||||
|
updated linker from Metrowerks. It is expected Metrowerks will release
|
||||||
|
PDK 3.0 (in beta testing at this time - May, 2001) in the near future which
|
||||||
|
will fix these problems.
|
||||||
|
|
||||||
|
|
||||||
|
Makefile "vclean"
|
||||||
|
------------------
|
||||||
|
The generated makefile has a "vclean" target which cleans up the build
|
||||||
|
directories. If you have been building successfully and suddenly
|
||||||
|
experience problems, use "vclean" (gmake -f netware\nlm.mak vclean) and retry.
|
||||||
|
|
||||||
|
|
||||||
|
"Undefined Symbol" Linker errors
|
||||||
|
--------------------------------
|
||||||
|
There have been linker errors reported when doing a CLIB build. The problems
|
||||||
|
occur because some versions of the CLIB SDK import files inadvertently
|
||||||
|
left out some symbols. One symbol in particular is "_lrotl". The missing
|
||||||
|
functions are actually delivered in the binaries, but they were left out of
|
||||||
|
the import files. The issues should be fixed in the September 2001 release
|
||||||
|
of the NDK. If you experience the problems you can temporarily
|
||||||
|
work around it by manually adding the missing symbols to your version of
|
||||||
|
"clib.imp".
|
||||||
147
INSTALL.W32
147
INSTALL.W32
@@ -10,13 +10,20 @@
|
|||||||
|
|
||||||
You need Perl for Win32. Unless you will build on Cygwin, you will need
|
You need Perl for Win32. Unless you will build on Cygwin, you will need
|
||||||
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
|
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
|
||||||
For Cygwin users, there's more info in the Cygwin section.
|
|
||||||
|
|
||||||
and one of the following C compilers:
|
and one of the following C compilers:
|
||||||
|
|
||||||
* Visual C++
|
* Visual C++
|
||||||
* Borland C
|
* Borland C
|
||||||
* GNU C (Mingw32 or Cygwin)
|
* GNU C (Cygwin or MinGW)
|
||||||
|
|
||||||
|
If you are compiling from a tarball or a CVS 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.
|
||||||
|
|
||||||
|
Visual C++
|
||||||
|
----------
|
||||||
|
|
||||||
If you want to compile in the assembly language routines with Visual C++ then
|
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
|
you will need an assembler. This is worth doing because it will result in
|
||||||
@@ -26,26 +33,19 @@
|
|||||||
* Microsoft MASM (aka "ml")
|
* Microsoft MASM (aka "ml")
|
||||||
* Free Netwide Assembler NASM.
|
* Free Netwide Assembler NASM.
|
||||||
|
|
||||||
MASM was at one point distributed with VC++. It is now distributed with some
|
MASM is distributed with most versions of VC++. For the versions where it is
|
||||||
Microsoft DDKs, for example the Windows NT 4.0 DDK and the Windows 98 DDK. If
|
not included in VC++, it is also distributed with some Microsoft DDKs, for
|
||||||
you do not have either of these DDKs then you can just download the binaries
|
example the Windows NT 4.0 DDK and the Windows 98 DDK. If you do not have
|
||||||
for the Windows 98 DDK and extract and rename the two files XXXXXml.exe and
|
either of these DDKs then you can just download the binaries for the Windows
|
||||||
XXXXXml.err, to ml.exe and ml.err and install somewhere on your PATH. Both
|
98 DDK and extract and rename the two files XXXXXml.exe and XXXXXml.err, to
|
||||||
DDKs can be downloaded from the Microsoft developers site www.msdn.com.
|
ml.exe and ml.err and install somewhere on your PATH. Both DDKs can be
|
||||||
|
downloaded from the Microsoft developers site www.msdn.com.
|
||||||
|
|
||||||
NASM is freely available. Version 0.98 was used during testing: other versions
|
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:
|
may also work. It is available from many places, see for example:
|
||||||
http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
|
http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
|
||||||
The NASM binary nasmw.exe needs to be installed anywhere on your PATH.
|
The NASM binary nasmw.exe needs to be installed anywhere on your PATH.
|
||||||
|
|
||||||
If you are compiling from a tarball or a CVS 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.
|
|
||||||
|
|
||||||
Visual C++
|
|
||||||
----------
|
|
||||||
|
|
||||||
Firstly you should run Configure:
|
Firstly you should run Configure:
|
||||||
|
|
||||||
> perl Configure VC-WIN32
|
> perl Configure VC-WIN32
|
||||||
@@ -119,18 +119,72 @@
|
|||||||
* Run make:
|
* Run make:
|
||||||
> make -f bcb.mak
|
> make -f bcb.mak
|
||||||
|
|
||||||
GNU C (Mingw32)
|
GNU C (Cygwin)
|
||||||
---------------
|
--------------
|
||||||
|
|
||||||
To build OpenSSL, you need the Mingw32 package and GNU make.
|
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:
|
||||||
|
|
||||||
|
* Install Cygwin (see http://cygwin.com/)
|
||||||
|
|
||||||
|
* Install Perl and ensure it is in the path. Both Cygwin perl
|
||||||
|
(5.6.1-2 or newer) and ActivePerl work.
|
||||||
|
|
||||||
|
* Run the Cygwin bash shell
|
||||||
|
|
||||||
|
* $ tar zxvf openssl-x.x.x.tar.gz
|
||||||
|
$ cd openssl-x.x.x
|
||||||
|
|
||||||
|
To build the Cygwin version of OpenSSL:
|
||||||
|
|
||||||
|
$ ./config
|
||||||
|
[...]
|
||||||
|
$ make
|
||||||
|
[...]
|
||||||
|
$ make test
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
This will create a default install in /usr/local/ssl.
|
||||||
|
|
||||||
|
To build the MinGW version (native Windows) in Cygwin:
|
||||||
|
|
||||||
|
$ ./Configure mingw
|
||||||
|
[...]
|
||||||
|
$ make
|
||||||
|
[...]
|
||||||
|
$ make test
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
Cygwin Notes:
|
||||||
|
|
||||||
|
"make test" and normal file operations may fail in directories
|
||||||
|
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
|
||||||
|
stripping of carriage returns. To avoid this ensure that a binary
|
||||||
|
mount is used, e.g. mount -b c:\somewhere /home.
|
||||||
|
|
||||||
|
"bc" is not provided in older Cygwin distribution. This causes a
|
||||||
|
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)
|
||||||
|
-------------
|
||||||
|
|
||||||
* Compiler installation:
|
* Compiler installation:
|
||||||
|
|
||||||
Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/
|
MinGW is available from http://www.mingw.org. Run the installer and
|
||||||
gnu-win32/mingw32/gcc-2.95.2/gcc-2.95.2-msvcrt.exe>. Extract it
|
set the MinGW bin directory to the PATH in "System Properties" or
|
||||||
to a directory such as C:\gcc-2.95.2 and add c:\gcc-2.95.2\bin to
|
autoexec.bat.
|
||||||
the PATH environment variable in "System Properties"; or edit and
|
|
||||||
run C:\gcc-2.95.2\mingw32.bat to set the PATH.
|
|
||||||
|
|
||||||
* Compile OpenSSL:
|
* Compile OpenSSL:
|
||||||
|
|
||||||
@@ -152,49 +206,6 @@
|
|||||||
> cd out
|
> cd out
|
||||||
> ..\ms\test
|
> ..\ms\test
|
||||||
|
|
||||||
GNU C (Cygwin)
|
|
||||||
--------------
|
|
||||||
|
|
||||||
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 W32 makes which are
|
|
||||||
based on a single makefile approach. Cygwin implements Posix/Unix
|
|
||||||
calls through cygwin1.dll, and is contrasted to Mingw32 which links
|
|
||||||
dynamically to msvcrt.dll or crtdll.dll.
|
|
||||||
|
|
||||||
To build OpenSSL using Cygwin:
|
|
||||||
|
|
||||||
* Install Cygwin (see http://cygwin.com/)
|
|
||||||
|
|
||||||
* Install Perl and ensure it is in the path (recent Cygwin perl
|
|
||||||
(version 5.6.1-2 of the latter has been reported to work) or
|
|
||||||
ActivePerl)
|
|
||||||
|
|
||||||
* Run the Cygwin bash shell
|
|
||||||
|
|
||||||
* $ tar zxvf openssl-x.x.x.tar.gz
|
|
||||||
$ cd openssl-x.x.x
|
|
||||||
$ ./config
|
|
||||||
[...]
|
|
||||||
$ make
|
|
||||||
[...]
|
|
||||||
$ make test
|
|
||||||
$ make install
|
|
||||||
|
|
||||||
This will create a default install in /usr/local/ssl.
|
|
||||||
|
|
||||||
Cygwin Notes:
|
|
||||||
|
|
||||||
"make test" and normal file operations may fail in directories
|
|
||||||
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
|
|
||||||
stripping of carriage returns. To avoid this ensure that a binary
|
|
||||||
mount is used, e.g. mount -b c:\somewhere /home.
|
|
||||||
|
|
||||||
"bc" is not provided in older Cygwin distribution. This causes a
|
|
||||||
non-fatal error in "make test" but is otherwise harmless. If
|
|
||||||
desired and needed, GNU bc can be built with Cygwin without change.
|
|
||||||
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
@@ -214,7 +225,7 @@
|
|||||||
$ md c:\openssl\lib
|
$ md c:\openssl\lib
|
||||||
$ md c:\openssl\include
|
$ md c:\openssl\include
|
||||||
$ md c:\openssl\include\openssl
|
$ md c:\openssl\include\openssl
|
||||||
$ copy /b inc32\* c:\openssl\include\openssl
|
$ copy /b inc32\openssl\* c:\openssl\include\openssl
|
||||||
$ copy /b out32dll\ssleay32.lib c:\openssl\lib
|
$ copy /b out32dll\ssleay32.lib c:\openssl\lib
|
||||||
$ copy /b out32dll\libeay32.lib c:\openssl\lib
|
$ copy /b out32dll\libeay32.lib c:\openssl\lib
|
||||||
$ copy /b out32dll\ssleay32.dll c:\openssl\bin
|
$ copy /b out32dll\ssleay32.dll c:\openssl\bin
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
You also need Perl for Win32. You will need ActiveState Perl, available
|
You also need Perl for Win32. You will need ActiveState Perl, available
|
||||||
from http://www.activestate.com/ActivePerl.
|
from http://www.activestate.com/ActivePerl.
|
||||||
|
|
||||||
|
Windows CE support in OpenSSL relies on wcecompat. All Windows CE specific
|
||||||
|
issues should be directed to www.essemer.com.au.
|
||||||
|
|
||||||
The C Runtime Library implementation for Windows CE that is included with
|
The C Runtime Library implementation for Windows CE that is included with
|
||||||
Microsoft eMbedded Visual C++ 3.0 is incomplete and in some places
|
Microsoft eMbedded Visual C++ 3.0 is incomplete and in some places
|
||||||
incorrect. wcecompat plugs the holes and tries to bring the Windows CE
|
incorrect. wcecompat plugs the holes and tries to bring the Windows CE
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
|||||||
---------------
|
---------------
|
||||||
|
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
|
|||||||
140
Makefile.org
140
Makefile.org
@@ -15,6 +15,11 @@ OPTIONS=
|
|||||||
CONFIGURE_ARGS=
|
CONFIGURE_ARGS=
|
||||||
SHLIB_TARGET=
|
SHLIB_TARGET=
|
||||||
|
|
||||||
|
# HERE indicates where this Makefile lives. This can be used to indicate
|
||||||
|
# where sub-Makefiles are expected to be. Currently has very limited usage,
|
||||||
|
# and should probably not be bothered with at all.
|
||||||
|
HERE=.
|
||||||
|
|
||||||
# INSTALL_PREFIX is for package builders so that they can configure
|
# INSTALL_PREFIX is for package builders so that they can configure
|
||||||
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
|
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
|
||||||
# Normally it is left empty.
|
# Normally it is left empty.
|
||||||
@@ -67,6 +72,14 @@ TAR= tar
|
|||||||
TARFLAGS= --no-recursion
|
TARFLAGS= --no-recursion
|
||||||
MAKEDEPPROG=makedepend
|
MAKEDEPPROG=makedepend
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
|
||||||
|
# gcc, then the driver will automatically translate it to -xarch=v8plus
|
||||||
|
# and pass it down to assembler.
|
||||||
|
AS=$(CC) -c
|
||||||
|
ASFLAG=$(CFLAG)
|
||||||
|
|
||||||
# Set BN_ASM to bn_asm.o if you want to use the C version
|
# Set BN_ASM to bn_asm.o if you want to use the C version
|
||||||
BN_ASM= bn_asm.o
|
BN_ASM= bn_asm.o
|
||||||
#BN_ASM= bn_asm.o
|
#BN_ASM= bn_asm.o
|
||||||
@@ -161,11 +174,13 @@ SHLIBDIRS= crypto ssl
|
|||||||
|
|
||||||
# dirs in crypto to build
|
# dirs in crypto to build
|
||||||
SDIRS= \
|
SDIRS= \
|
||||||
|
objects \
|
||||||
md2 md4 md5 sha mdc2 hmac ripemd \
|
md2 md4 md5 sha mdc2 hmac ripemd \
|
||||||
des rc2 rc4 rc5 idea bf cast \
|
des rc2 rc4 rc5 idea bf cast \
|
||||||
bn ec rsa dsa ecdsa dh ecdh dso engine aes \
|
bn ec rsa dsa ecdsa dh ecdh dso engine aes \
|
||||||
buffer bio stack lhash rand err objects \
|
buffer bio stack lhash rand err \
|
||||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
|
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
|
||||||
|
store
|
||||||
|
|
||||||
# tests to perform. "alltests" is a special word indicating that all tests
|
# tests to perform. "alltests" is a special word indicating that all tests
|
||||||
# should be performed.
|
# should be performed.
|
||||||
@@ -178,6 +193,7 @@ MAKE= $(NEWMAKE) -f Makefile.ssl
|
|||||||
MANDIR=$(OPENSSLDIR)/man
|
MANDIR=$(OPENSSLDIR)/man
|
||||||
MAN1=1
|
MAN1=1
|
||||||
MAN3=3
|
MAN3=3
|
||||||
|
MANSUFFIX=
|
||||||
SHELL=/bin/sh
|
SHELL=/bin/sh
|
||||||
|
|
||||||
TOP= .
|
TOP= .
|
||||||
@@ -204,7 +220,7 @@ all: Makefile.ssl build_all openssl.pc
|
|||||||
BUILD_CMD=if echo " $(DIRS) " | grep " $$i " >/dev/null 2>/dev/null; then \
|
BUILD_CMD=if echo " $(DIRS) " | grep " $$i " >/dev/null 2>/dev/null; then \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making all in $$i..." && \
|
(cd $$i && echo "making all in $$i..." && \
|
||||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
||||||
else \
|
else \
|
||||||
$(MAKE) $$i; \
|
$(MAKE) $$i; \
|
||||||
fi; fi
|
fi; fi
|
||||||
@@ -242,7 +258,7 @@ libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
clean-shared:
|
clean-shared:
|
||||||
@for i in $(SHLIBDIRS); do \
|
@set -e; for i in $(SHLIBDIRS); do \
|
||||||
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
||||||
tmp="$(SHARED_LIBS_LINK_EXTS)"; \
|
tmp="$(SHARED_LIBS_LINK_EXTS)"; \
|
||||||
for j in $${tmp:-x}; do \
|
for j in $${tmp:-x}; do \
|
||||||
@@ -256,8 +272,8 @@ clean-shared:
|
|||||||
done
|
done
|
||||||
|
|
||||||
link-shared:
|
link-shared:
|
||||||
@ for i in ${SHLIBDIRS}; do \
|
@ set -e; for i in ${SHLIBDIRS}; do \
|
||||||
$(NEWMAKE) -f Makefile.shared \
|
$(NEWMAKE) -f $(HERE)/Makefile.shared \
|
||||||
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||||
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
||||||
symlink.$(SHLIB_TARGET); \
|
symlink.$(SHLIB_TARGET); \
|
||||||
@@ -267,18 +283,22 @@ link-shared:
|
|||||||
build-shared: do_$(SHLIB_TARGET) link-shared
|
build-shared: do_$(SHLIB_TARGET) link-shared
|
||||||
|
|
||||||
do_$(SHLIB_TARGET):
|
do_$(SHLIB_TARGET):
|
||||||
@ libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
@ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||||
|
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
|
||||||
|
libs="$(LIBKRB5) $$libs"; \
|
||||||
|
fi; \
|
||||||
$(NEWMAKE) -f Makefile.shared \
|
$(NEWMAKE) -f Makefile.shared \
|
||||||
CC="$(CC)" LDFLAGS="$(LDFLAGS)" \
|
CC="$(CC)" LDFLAGS="$(LDFLAGS)" \
|
||||||
SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
|
SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
|
||||||
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||||
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
||||||
LIBDEPS="$$libs $(EX_LIBS)" \
|
LIBDEPS="$$libs $(EX_LIBS)" \
|
||||||
|
LIBRPATH="$(INSTALLTOP)/lib" \
|
||||||
link_a.$(SHLIB_TARGET); \
|
link_a.$(SHLIB_TARGET); \
|
||||||
libs="$$libs -l$$i"; \
|
libs="-l$$i $$libs"; \
|
||||||
done
|
done
|
||||||
|
|
||||||
openssl.pc:
|
openssl.pc: Makefile.ssl
|
||||||
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
||||||
echo 'exec_prefix=$${prefix}'; \
|
echo 'exec_prefix=$${prefix}'; \
|
||||||
echo 'libdir=$${exec_prefix}/lib'; \
|
echo 'libdir=$${exec_prefix}/lib'; \
|
||||||
@@ -289,7 +309,7 @@ openssl.pc:
|
|||||||
echo 'Version: '$(VERSION); \
|
echo 'Version: '$(VERSION); \
|
||||||
echo 'Requires: '; \
|
echo 'Requires: '; \
|
||||||
echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
|
echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
|
||||||
echo 'Cflags: -I$${includedir}' ) > openssl.pc
|
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
|
||||||
|
|
||||||
Makefile.ssl: Makefile.org
|
Makefile.ssl: Makefile.org
|
||||||
@echo "Makefile.ssl is older than Makefile.org."
|
@echo "Makefile.ssl is older than Makefile.org."
|
||||||
@@ -297,11 +317,11 @@ Makefile.ssl: Makefile.org
|
|||||||
@false
|
@false
|
||||||
|
|
||||||
libclean:
|
libclean:
|
||||||
rm -f *.so *.so.* engines/*.so *.a */lib */*/lib
|
rm -f *.map *.so *.so.* engines/*.so *.a */lib */*/lib
|
||||||
|
|
||||||
clean:
|
clean: libclean
|
||||||
rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
|
rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
|
||||||
@for i in $(DIRS) ;\
|
@set -e; for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making clean in $$i..." && \
|
(cd $$i && echo "making clean in $$i..." && \
|
||||||
@@ -310,9 +330,9 @@ clean:
|
|||||||
fi; \
|
fi; \
|
||||||
done;
|
done;
|
||||||
rm -f openssl.pc
|
rm -f openssl.pc
|
||||||
rm -f *.a *.o speed.* *.map *.so .pure core
|
rm -f speed.* .pure
|
||||||
rm -f $(TARFILE)
|
rm -f $(TARFILE)
|
||||||
@for i in $(ONEDIRS) ;\
|
@set -e; for i in $(ONEDIRS) ;\
|
||||||
do \
|
do \
|
||||||
rm -fr $$i/*; \
|
rm -fr $$i/*; \
|
||||||
done
|
done
|
||||||
@@ -323,7 +343,7 @@ makefile.one: files
|
|||||||
|
|
||||||
files:
|
files:
|
||||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
|
$(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
|
||||||
@for i in $(DIRS) ;\
|
@set -e; for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making 'files' in $$i..." && \
|
(cd $$i && echo "making 'files' in $$i..." && \
|
||||||
@@ -335,7 +355,7 @@ links:
|
|||||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||||
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
||||||
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
||||||
@for i in $(DIRS); do \
|
@set -e; for i in $(DIRS); do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making links in $$i..." && \
|
(cd $$i && echo "making links in $$i..." && \
|
||||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
|
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
|
||||||
@@ -348,7 +368,7 @@ gentests:
|
|||||||
|
|
||||||
dclean:
|
dclean:
|
||||||
rm -f *.bak
|
rm -f *.bak
|
||||||
@for i in $(DIRS) ;\
|
@set -e; for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making dclean in $$i..." && \
|
(cd $$i && echo "making dclean in $$i..." && \
|
||||||
@@ -360,8 +380,11 @@ rehash: rehash.time
|
|||||||
rehash.time: certs
|
rehash.time: certs
|
||||||
@(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
|
@(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
|
||||||
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
||||||
LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
|
||||||
if [ "$(PLATFORM)" != "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
|
||||||
|
SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
|
||||||
|
LIBPATH="`pwd`:$$LIBPATH"; \
|
||||||
|
if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
||||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
||||||
$(PERL) tools/c_rehash certs)
|
$(PERL) tools/c_rehash certs)
|
||||||
touch rehash.time
|
touch rehash.time
|
||||||
@@ -371,8 +394,11 @@ test: tests
|
|||||||
tests: rehash
|
tests: rehash
|
||||||
@(cd test && echo "testing..." && \
|
@(cd test && echo "testing..." && \
|
||||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
|
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
|
||||||
@LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
@LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
|
||||||
if [ "$(PLATFORM)" != "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
|
||||||
|
SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
|
||||||
|
LIBPATH="`pwd`:$$LIBPATH"; \
|
||||||
|
if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
||||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
||||||
apps/openssl version -a
|
apps/openssl version -a
|
||||||
|
|
||||||
@@ -380,7 +406,7 @@ report:
|
|||||||
@$(PERL) util/selftest.pl
|
@$(PERL) util/selftest.pl
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
@for i in $(DIRS) ;\
|
@set -e; for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making dependencies $$i..." && \
|
(cd $$i && echo "making dependencies $$i..." && \
|
||||||
@@ -389,7 +415,7 @@ depend:
|
|||||||
done;
|
done;
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@for i in $(DIRS) ;\
|
@set -e; for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making lint $$i..." && \
|
(cd $$i && echo "making lint $$i..." && \
|
||||||
@@ -398,7 +424,7 @@ lint:
|
|||||||
done;
|
done;
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
@for i in $(DIRS) ;\
|
@set -e; for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making tags $$i..." && \
|
(cd $$i && echo "making tags $$i..." && \
|
||||||
@@ -468,36 +494,36 @@ dist_pem_h:
|
|||||||
install: all install_docs
|
install: all install_docs
|
||||||
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
|
||||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \
|
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \
|
||||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo \
|
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
|
||||||
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
|
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/engines \
|
$(INSTALL_PREFIX)$(INSTALLTOP)/engines \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/private \
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/private \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/lib
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/lib
|
||||||
@for i in $(EXHEADER) ;\
|
@set -e; for i in $(EXHEADER) ;\
|
||||||
do \
|
do \
|
||||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||||
done;
|
done;
|
||||||
@for i in $(DIRS) ;\
|
@set -e; for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -d "$$i" ]; then \
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i; echo "installing $$i..."; \
|
(cd $$i; echo "installing $$i..."; \
|
||||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' install ); \
|
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' install ); \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
@for i in $(LIBS) ;\
|
@set -e; for i in $(LIBS) ;\
|
||||||
do \
|
do \
|
||||||
if [ -f "$$i" ]; then \
|
if [ -f "$$i" ]; then \
|
||||||
( echo installing $$i; \
|
( echo installing $$i; \
|
||||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||||
fi; \
|
fi; \
|
||||||
done;
|
done;
|
||||||
@if [ -n "$(SHARED_LIBS)" ]; then \
|
@set -e; if [ -n "$(SHARED_LIBS)" ]; then \
|
||||||
tmp="$(SHARED_LIBS)"; \
|
tmp="$(SHARED_LIBS)"; \
|
||||||
for i in $${tmp:-x}; \
|
for i in $${tmp:-x}; \
|
||||||
do \
|
do \
|
||||||
@@ -506,23 +532,30 @@ install: all install_docs
|
|||||||
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||||
else \
|
else \
|
||||||
c=`echo $$i | sed 's/^lib/cyg/'`; \
|
c=`echo $$i | sed 's/^lib/cyg/'`; \
|
||||||
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||||
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
||||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
||||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||||
fi ); \
|
fi ); \
|
||||||
fi; \
|
fi; \
|
||||||
done; \
|
done; \
|
||||||
( here="`pwd`"; \
|
( here="`pwd`"; \
|
||||||
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||||
$(NEWMAKE) -f $$here/Makefile link-shared ); \
|
$(NEWMAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
|
||||||
|
if [ "$(INSTALLTOP)" != "/usr" ]; then \
|
||||||
|
echo 'OpenSSL shared libraries have been installed in:'; \
|
||||||
|
echo ' $(INSTALLTOP)'; \
|
||||||
|
echo ''; \
|
||||||
|
sed -e '1,/^$$/d' doc/openssl-shared.txt; \
|
||||||
|
fi; \
|
||||||
fi
|
fi
|
||||||
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo
|
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
|
||||||
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
|
||||||
|
|
||||||
install_docs:
|
install_docs:
|
||||||
@$(PERL) $(TOP)/util/mkdir-p.pl \
|
@$(PERL) $(TOP)/util/mkdir-p.pl \
|
||||||
@@ -531,25 +564,44 @@ install_docs:
|
|||||||
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
||||||
$(INSTALL_PREFIX)$(MANDIR)/man7
|
$(INSTALL_PREFIX)$(MANDIR)/man7
|
||||||
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
|
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
|
||||||
for i in doc/apps/*.pod; do \
|
here="`pwd`"; \
|
||||||
|
filecase=; \
|
||||||
|
if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" ]; then \
|
||||||
|
filecase=-i; \
|
||||||
|
fi; \
|
||||||
|
set -e; for i in doc/apps/*.pod; do \
|
||||||
fn=`basename $$i .pod`; \
|
fn=`basename $$i .pod`; \
|
||||||
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
|
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
|
||||||
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
|
echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
|
||||||
(cd `$(PERL) util/dirname.pl $$i`; \
|
(cd `$(PERL) util/dirname.pl $$i`; \
|
||||||
sh -c "$$pod2man \
|
sh -c "$$pod2man \
|
||||||
--section=$$sec --center=OpenSSL \
|
--section=$$sec --center=OpenSSL \
|
||||||
--release=$(VERSION) `basename $$i`") \
|
--release=$(VERSION) `basename $$i`") \
|
||||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
|
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
|
||||||
|
$(PERL) util/extract-names.pl < $$i | \
|
||||||
|
grep -v $$filecase "^$$fn\$$" | \
|
||||||
|
grep -v "[ ]" | \
|
||||||
|
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||||
|
while read n; do \
|
||||||
|
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||||
|
done); \
|
||||||
done; \
|
done; \
|
||||||
for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
||||||
fn=`basename $$i .pod`; \
|
fn=`basename $$i .pod`; \
|
||||||
if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
|
if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
|
||||||
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
|
echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
|
||||||
(cd `$(PERL) util/dirname.pl $$i`; \
|
(cd `$(PERL) util/dirname.pl $$i`; \
|
||||||
sh -c "$$pod2man \
|
sh -c "$$pod2man \
|
||||||
--section=$$sec --center=OpenSSL \
|
--section=$$sec --center=OpenSSL \
|
||||||
--release=$(VERSION) `basename $$i`") \
|
--release=$(VERSION) `basename $$i`") \
|
||||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
|
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
|
||||||
|
$(PERL) util/extract-names.pl < $$i | \
|
||||||
|
grep -v $$filecase "^$$fn\$$" | \
|
||||||
|
grep -v "[ ]" | \
|
||||||
|
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||||
|
while read n; do \
|
||||||
|
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
|
||||||
|
done); \
|
||||||
done
|
done
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|||||||
616
Makefile.shared
616
Makefile.shared
@@ -7,19 +7,32 @@
|
|||||||
|
|
||||||
# CC contains the current compiler. This one MUST be defined
|
# CC contains the current compiler. This one MUST be defined
|
||||||
CC=cc
|
CC=cc
|
||||||
# LDFLAGS contains flags to be used when the temporary object file is
|
# LDFLAGS contains flags to be used when temporary object files (when building
|
||||||
# created. SHARED_LDFLAGS contains flags to be used when the shared
|
# shared libraries) are created, or when an application is linked.
|
||||||
# library is created.
|
# SHARED_LDFLAGS contains flags to be used when the shared library is created.
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
SHARED_LDFLAGS=
|
SHARED_LDFLAGS=
|
||||||
|
|
||||||
# LIBNAME contains just the name of thhe library, without prefix ("lib"
|
# LIBNAME contains just the name of the library, without prefix ("lib"
|
||||||
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
|
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
|
||||||
# .dll, ...). This one MUST have a value when using this makefile.
|
# .dll, ...). This one MUST have a value when using this makefile to
|
||||||
|
# build shared libraries.
|
||||||
# For example, to build libfoo.so, you need to do the following:
|
# For example, to build libfoo.so, you need to do the following:
|
||||||
#LIBNAME=foo
|
#LIBNAME=foo
|
||||||
LIBNAME=
|
LIBNAME=
|
||||||
|
|
||||||
|
# APPNAME contains just the name of the application, without suffix (""
|
||||||
|
# on Unix, ".exe" on Windows, ...). This one MUST have a value when using
|
||||||
|
# this makefile to build applications.
|
||||||
|
# For example, to build foo, you need to do the following:
|
||||||
|
#APPNAME=foo
|
||||||
|
APPNAME=
|
||||||
|
|
||||||
|
# OBJECTS contains all the object files to link together into the application.
|
||||||
|
# This must contain at least one object file.
|
||||||
|
#OBJECTS=foo.o
|
||||||
|
OBJECTS=
|
||||||
|
|
||||||
# LIBEXTRAS contains extra modules to link together with the library.
|
# LIBEXTRAS contains extra modules to link together with the library.
|
||||||
# For example, if a second library, say libbar.a needs to be linked into
|
# For example, if a second library, say libbar.a needs to be linked into
|
||||||
# libfoo.so, you need to do the following:
|
# libfoo.so, you need to do the following:
|
||||||
@@ -64,7 +77,7 @@ CALC_VERSIONS= \
|
|||||||
if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
|
if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
|
||||||
prev=""; \
|
prev=""; \
|
||||||
for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
|
for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
|
||||||
SHLIB_SOVER_NODOT=$$v \
|
SHLIB_SOVER_NODOT=$$v; \
|
||||||
SHLIB_SOVER=.$$v; \
|
SHLIB_SOVER=.$$v; \
|
||||||
if [ -n "$$prev" ]; then \
|
if [ -n "$$prev" ]; then \
|
||||||
SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
|
SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
|
||||||
@@ -73,9 +86,19 @@ CALC_VERSIONS= \
|
|||||||
done; \
|
done; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
LINK_APP= \
|
||||||
|
( $(DEBUG); \
|
||||||
|
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) $$LDFLAGS -o $$APPNAME $(OBJECTS) $$LIBDEPS )
|
||||||
|
|
||||||
LINK_SO= \
|
LINK_SO= \
|
||||||
( $(DEBUG); \
|
( $(DEBUG); \
|
||||||
nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
|
nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
|
||||||
|
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 $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
|
$$SHAREDCMD $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
|
||||||
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
|
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
|
||||||
$(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp )
|
$(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp )
|
||||||
@@ -98,326 +121,467 @@ SYMLINK_SO= \
|
|||||||
LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
|
LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
|
||||||
LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
|
LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
|
||||||
LINK_SO_A_VIA_O= \
|
LINK_SO_A_VIA_O= \
|
||||||
SHOBJECTS=lib$(LIBNAME).o ALL=$$ALLSYMSFLAGS ALLSYMSFLAGS= NOALLSYMSFLAGS=; \
|
SHOBJECTS=lib$(LIBNAME).o; \
|
||||||
|
ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
|
||||||
( $(DEBUG); \
|
( $(DEBUG); \
|
||||||
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
|
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
|
||||||
$(LINK_SO) && rm -f $(LIBNAME).o
|
$(LINK_SO) && rm -f $(LIBNAME).o
|
||||||
LINK_SO_A_UNPACKED= \
|
LINK_SO_A_UNPACKED= \
|
||||||
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
|
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
|
||||||
(cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && cp $(LIBEXTRAS) $$UNPACKDIR && \
|
(cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && \
|
||||||
|
([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
|
||||||
SHOBJECTS=$$UNPACKDIR/*.o; \
|
SHOBJECTS=$$UNPACKDIR/*.o; \
|
||||||
$(LINK_SO) && rm -rf $$UNPACKDIR
|
$(LINK_SO) && rm -rf $$UNPACKDIR
|
||||||
|
|
||||||
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
|
DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
||||||
my_ld=`${CC} -print-prog-name=ld 2>&1` && \
|
|
||||||
[ -n "$$my_ld" ] && \
|
DO_GNU_SO=$(CALC_VERSIONS); \
|
||||||
$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
DO_GNU=$(CALC_VERSIONS); \
|
SHLIB_SUFFIX=; \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_SUFFIX= \
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
||||||
ALLSYMSFLAGS='-Wl,--whole-archive' \
|
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
|
||||||
NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
|
|
||||||
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" \
|
|
||||||
SHAREDCMD='$(CC)'
|
SHAREDCMD='$(CC)'
|
||||||
|
DO_GNU_APP=LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-Wl,-rpath,$(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME=$(APPNAME)
|
||||||
|
|
||||||
|
#This is rather special. It's a special target with which one can link
|
||||||
|
#applications without bothering with any features that have anything to
|
||||||
|
#do with shared libraries, for example when linking against static
|
||||||
|
#libraries. It's mostly here to avoid a lot of conditionals everywhere
|
||||||
|
#else...
|
||||||
|
link_app.:
|
||||||
|
LDCMD=$(CC); \
|
||||||
|
LDFLAGS=""; \
|
||||||
|
LIBDEPS="$(LIBDEPS)"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
link_o.gnu:
|
link_o.gnu:
|
||||||
@ $(DO_GNU); $(LINK_SO_O)
|
@ $(DO_GNU_SO); $(LINK_SO_O)
|
||||||
link_a.gnu:
|
link_a.gnu:
|
||||||
@ $(DO_GNU); $(LINK_SO_A)
|
@ $(DO_GNU_SO); $(LINK_SO_A)
|
||||||
|
link_app.gnu:
|
||||||
|
@ $(DO_GNU_APP); $(LINK_APP)
|
||||||
|
|
||||||
# For Darwin AKA Mac OS/X (dyld)
|
# For Darwin AKA Mac OS/X (dyld)
|
||||||
link_o.darwin:
|
link_o.darwin:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME) \
|
SHLIB=lib$(LIBNAME); \
|
||||||
SHLIB_SUFFIX=.dylib \
|
SHLIB_SUFFIX=.dylib; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-all_load' \
|
ALLSYMSFLAGS='-all_load'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS="-dynamiclib" \
|
SHAREDFLAGS="-dynamiclib"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$(LIBVERSION)" ]; then \
|
if [ -n "$(LIBVERSION)" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.darwin:
|
link_a.darwin:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME) \
|
SHLIB=lib$(LIBNAME); \
|
||||||
SHLIB_SUFFIX=.dylib \
|
SHLIB_SUFFIX=.dylib; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-all_load' \
|
ALLSYMSFLAGS='-all_load'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS="-dynamiclib" \
|
SHAREDFLAGS="-dynamiclib"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$(LIBVERSION)" ]; then \
|
if [ -n "$(LIBVERSION)" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
SHAREDFLAGS="$$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
SHAREDFLAGS="$$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_A)
|
$(LINK_SO_A)
|
||||||
|
link_app.darwin:
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS=""; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
link_o.cygwin:
|
link_o.cygwin:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
INHIBIT_SYMLINKS=yes; \
|
INHIBIT_SYMLINKS=yes; \
|
||||||
SHLIB=cyg$(LIBNAME) \
|
SHLIB=cyg$(LIBNAME); \
|
||||||
SHLIB_SUFFIX=.dll \
|
SHLIB_SUFFIX=.dll; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_SOVER=-$(LIBVERSION) \
|
SHLIB_SOVER=-$(LIBVERSION); \
|
||||||
ALLSYMSFLAGS='-Wl,--whole-archive' \
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
||||||
NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
||||||
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \
|
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
|
||||||
SHAREDCMD='${CC}'; \
|
SHAREDCMD='${CC}'; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.cygwin:
|
link_a.cygwin:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
INHIBIT_SYMLINKS=yes; \
|
INHIBIT_SYMLINKS=yes; \
|
||||||
SHLIB=cyg$(LIBNAME) \
|
SHLIB=cyg$(LIBNAME); \
|
||||||
SHLIB_SUFFIX=.dll \
|
SHLIB_SUFFIX=.dll; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_SOVER= \
|
SHLIB_SOVER=; \
|
||||||
ALLSYMSFLAGS='-Wl,--whole-archive' \
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
||||||
NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
||||||
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \
|
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
|
||||||
SHAREDCMD='${CC}'; \
|
SHAREDCMD='${CC}'; \
|
||||||
$(LINK_SO_A)
|
$(LINK_SO_A)
|
||||||
|
link_app.cygwin:
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS=""; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME).exe"
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
link_o.alpha-osf1:
|
link_o.alpha-osf1:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
else \
|
else \
|
||||||
SHLIB_HIST="$(LIBVERSION)"; \
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
fi
|
fi; \
|
||||||
SHLIB_SOVER= \
|
SHLIB_SOVER=; \
|
||||||
ALLSYMSFLAGS='-all' \
|
ALLSYMSFLAGS='-all'; \
|
||||||
NOALLSYMSFLAGS='-none' \
|
NOALLSYMSFLAGS='-none'; \
|
||||||
SHAREDFLAGS="-shared" \
|
SHAREDFLAGS="-shared"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.alpha-osf1:
|
link_a.alpha-osf1:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
else \
|
else \
|
||||||
SHLIB_HIST="$(LIBVERSION)"; \
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
fi
|
fi; \
|
||||||
SHLIB_SOVER= \
|
SHLIB_SOVER=; \
|
||||||
ALLSYMSFLAGS='-all' \
|
ALLSYMSFLAGS='-all'; \
|
||||||
NOALLSYMSFLAGS='-none' \
|
NOALLSYMSFLAGS='-none'; \
|
||||||
SHAREDFLAGS="-shared" \
|
SHAREDFLAGS="-shared"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_A)
|
$(LINK_SO_A)
|
||||||
|
link_app.alpha-osf1:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU_APP); \
|
||||||
|
else \
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS=""; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"
|
||||||
|
fi; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
|
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
|
||||||
# option passed to the linker.
|
# option passed to the linker.
|
||||||
link_o.tru64:
|
link_o.tru64:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
else \
|
else \
|
||||||
SHLIB_HIST="$(LIBVERSION)"; \
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
fi
|
fi; \
|
||||||
SHLIB_SOVER= \
|
SHLIB_SOVER=; \
|
||||||
ALLSYMSFLAGS='-all' \
|
ALLSYMSFLAGS='-all'; \
|
||||||
NOALLSYMSFLAGS='-none' \
|
NOALLSYMSFLAGS='-none'; \
|
||||||
SHAREDFLAGS="-shared -msym" \
|
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.tru64:
|
link_a.tru64:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
else \
|
else \
|
||||||
SHLIB_HIST="$(LIBVERSION)"; \
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
fi
|
fi; \
|
||||||
SHLIB_SOVER= \
|
SHLIB_SOVER=; \
|
||||||
ALLSYMSFLAGS='-all' \
|
ALLSYMSFLAGS='-all'; \
|
||||||
NOALLSYMSFLAGS='-none' \
|
NOALLSYMSFLAGS='-none'; \
|
||||||
SHAREDFLAGS="-shared -msym" \
|
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_A)
|
$(LINK_SO_A)
|
||||||
|
link_app.tru64:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU_APP); \
|
||||||
|
else \
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-rpath $(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
# The difference between tru64-shared and tru64-shared-rpath is the
|
# The difference between tru64-shared and tru64-shared-rpath is the
|
||||||
# -rpath ${LIBRPATH} passed to the linker.
|
# -rpath ${LIBRPATH} passed to the linker.
|
||||||
link_o.tru64-rpath:
|
link_o.tru64-rpath:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
else \
|
else \
|
||||||
SHLIB_HIST="$(LIBVERSION)"; \
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
fi
|
fi; \
|
||||||
SHLIB_SOVER= \
|
SHLIB_SOVER=; \
|
||||||
ALLSYMSFLAGS='-all' \
|
ALLSYMSFLAGS='-all'; \
|
||||||
NOALLSYMSFLAGS='-none' \
|
NOALLSYMSFLAGS='-none'; \
|
||||||
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)" \
|
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.tru64-rpath:
|
link_a.tru64-rpath:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
else \
|
else \
|
||||||
SHLIB_HIST="$(LIBVERSION)"; \
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
fi
|
fi; \
|
||||||
SHLIB_SOVER= \
|
SHLIB_SOVER=; \
|
||||||
ALLSYMSFLAGS='-all' \
|
ALLSYMSFLAGS='-all'; \
|
||||||
NOALLSYMSFLAGS='-none' \
|
NOALLSYMSFLAGS='-none'; \
|
||||||
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)" \
|
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
if [ -n "$$SHLIB_HIST" ]; then \
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
SHAREDFLAGS="$$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_A)
|
$(LINK_SO_A)
|
||||||
|
link_app.tru64-rpath:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU_APP); \
|
||||||
|
else \
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-rpath $(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
link_o.solaris:
|
link_o.solaris:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
$(CALC_VERSIONS); \
|
$(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
MINUSZ='-z '; \
|
||||||
SHLIB_SUFFIX= \
|
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
ALLSYMSFLAGS='-z allextract' \
|
SHLIB_SUFFIX=; \
|
||||||
NOALLSYMSFLAGS='' \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
|
||||||
|
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
|
||||||
|
SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.solaris:
|
link_a.solaris:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
$(CALC_VERSIONS); \
|
$(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
MINUSZ='-z '; \
|
||||||
SHLIB_SUFFIX= \
|
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
ALLSYMSFLAGS='-z allextract' \
|
SHLIB_SUFFIX=;\
|
||||||
NOALLSYMSFLAGS='' \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
ALLSYMSFLAGS="$${MINUSZ}allextract"; \
|
||||||
|
NOALLSYMSFLAGS="$${MINUSZ}defaultextract"; \
|
||||||
|
SHAREDFLAGS="-G -dy -z text -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -R $(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_A)
|
$(LINK_SO_A)
|
||||||
|
link_app.solaris:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU_APP); \
|
||||||
|
else \
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-R $(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
# OpenServer 5 native compilers used
|
# OpenServer 5 native compilers used
|
||||||
# UnixWare 7 and OpenUNIX 8 native compilers used
|
|
||||||
link_o.svr3:
|
link_o.svr3:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
$(CALC_VERSIONS); \
|
$(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-z allextract' \
|
ALLSYMSFLAGS=''; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.svr3:
|
link_a.svr3:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
$(CALC_VERSIONS); \
|
$(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-z allextract' \
|
ALLSYMSFLAGS=''; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
SHAREDFLAGS="-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_A_UNPACKED)
|
$(LINK_SO_A_UNPACKED)
|
||||||
|
link_app.svr3:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU_APP); \
|
||||||
|
else \
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS=""; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
|
# UnixWare 7 and OpenUNIX 8 native compilers used
|
||||||
|
link_o.svr5:
|
||||||
|
@ 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'; \
|
||||||
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
|
SHLIB_SUFFIX=; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
ALLSYMSFLAGS=''; \
|
||||||
|
NOALLSYMSFLAGS=''; \
|
||||||
|
SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.svr5:
|
||||||
|
@ 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'; \
|
||||||
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
|
SHLIB_SUFFIX=; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
ALLSYMSFLAGS=''; \
|
||||||
|
NOALLSYMSFLAGS=''; \
|
||||||
|
SHAREDFLAGS="$${SHARE_FLAG} -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"; \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A_UNPACKED)
|
||||||
|
link_app.svr5:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU_APP); \
|
||||||
|
else \
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS=""; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
link_o.irix:
|
link_o.irix:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
$(CALC_VERSIONS); \
|
$(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-all' \
|
MINUSWL=""; \
|
||||||
NOALLSYMSFLAGS='' \
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
|
||||||
SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
ALLSYMSFLAGS="$${MINUSWL}-all"; \
|
||||||
|
NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
|
||||||
|
SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.irix:
|
link_a.irix:
|
||||||
@ if ${DETECT_GNU_LD}; then \
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
$(DO_GNU); \
|
$(DO_GNU_SO); \
|
||||||
else \
|
else \
|
||||||
$(CALC_VERSIONS); \
|
$(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-all' \
|
MINUSWL=""; \
|
||||||
NOALLSYMSFLAGS='' \
|
($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
|
||||||
SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
ALLSYMSFLAGS="$${MINUSWL}-all"; \
|
||||||
|
NOALLSYMSFLAGS="$${MINUSWL}-notall"; \
|
||||||
|
SHAREDFLAGS="-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX -Wl,-rpath,$(LIBRPATH)"; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
fi; \
|
fi; \
|
||||||
$(LINK_SO_A)
|
$(LINK_SO_A)
|
||||||
|
link_app.irix:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU_APP); \
|
||||||
|
else \
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-Wl,-rpath,$(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
# HP-UX includes the full pathname of libs we depend on, so we would get
|
# HP-UX includes the full pathname of libs we depend on, so we would get
|
||||||
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
||||||
@@ -431,24 +595,30 @@ link_a.irix:
|
|||||||
#
|
#
|
||||||
link_o.hpux32:
|
link_o.hpux32:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).sl \
|
SHLIB=lib$(LIBNAME).sl; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-Fl' \
|
ALLSYMSFLAGS='-Fl'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
|
||||||
SHAREDCMD='/usr/ccs/bin/ld'; \
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
link_a.hpux32:
|
link_a.hpux32:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).sl \
|
SHLIB=lib$(LIBNAME).sl; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-Fl' \
|
ALLSYMSFLAGS='-Fl'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
SHAREDFLAGS="+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
|
||||||
SHAREDCMD='/usr/ccs/bin/ld'; \
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
|
link_app.hpux32:
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-Wl,+b,$(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
# HP-UX includes the full pathname of libs we depend on, so we would get
|
# HP-UX includes the full pathname of libs we depend on, so we would get
|
||||||
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
||||||
@@ -460,76 +630,94 @@ link_a.hpux32:
|
|||||||
#
|
#
|
||||||
link_o.hpux64:
|
link_o.hpux64:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).sl \
|
SHLIB=lib$(LIBNAME).sl; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='+forceload' \
|
ALLSYMSFLAGS='+forceload'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
|
||||||
SHAREDCMD='/usr/ccs/bin/ld'; \
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
link_a.hpux64:
|
link_a.hpux64:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).sl \
|
SHLIB=lib$(LIBNAME).sl; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='+forceload' \
|
ALLSYMSFLAGS='+forceload'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
SHAREDFLAGS="-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX +b $(LIBRPATH)"; \
|
||||||
SHAREDCMD='/usr/ccs/bin/ld'; \
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
|
link_app.hpux64:
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-Wl,+b,$(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
link_o.aix:
|
link_o.aix:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-bnogc' \
|
ALLSYMSFLAGS='-bnogc'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \
|
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.aix:
|
link_a.aix:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS='-bnogc' \
|
ALLSYMSFLAGS='-bnogc'; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \
|
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE -blibpath:$(LIBRPATH)'; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
$(LINK_SO_A_VIA_O)
|
$(LINK_SO_A_VIA_O)
|
||||||
|
link_app.aix:
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS="-blibpath:$(LIBRPATH)"; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
link_o.reliantunix:
|
link_o.reliantunix:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS= \
|
ALLSYMSFLAGS=; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-G' \
|
SHAREDFLAGS='-G'; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
$(LINK_SO_O)
|
$(LINK_SO_O)
|
||||||
link_a.reliantunix:
|
link_a.reliantunix:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
SHLIB_SUFFIX= \
|
SHLIB_SUFFIX=; \
|
||||||
LIBDEPS="$(LIBDEPS) -lc" \
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
ALLSYMSFLAGS= \
|
ALLSYMSFLAGS=; \
|
||||||
NOALLSYMSFLAGS='' \
|
NOALLSYMSFLAGS=''; \
|
||||||
SHAREDFLAGS='-G' \
|
SHAREDFLAGS='-G'; \
|
||||||
SHAREDCMD='$(CC)'; \
|
SHAREDCMD='$(CC)'; \
|
||||||
$(LINK_SO_A_UNPACKED)
|
$(LINK_SO_A_UNPACKED)
|
||||||
|
link_app.reliantunix:
|
||||||
|
LDCMD=$(CC);\
|
||||||
|
LDFLAGS=""; \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc"; \
|
||||||
|
APPNAME="$(APPNAME)"
|
||||||
|
$(LINK_APP)
|
||||||
|
|
||||||
# Targets to build symbolic links when needed
|
# Targets to build symbolic links when needed
|
||||||
symlink.gnu symlink.solaris symlink.svr3 symlink.irix \
|
symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
|
||||||
symlink.aix symlink.reliantunix:
|
symlink.aix symlink.reliantunix:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME).so; \
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
$(SYMLINK_SO)
|
$(SYMLINK_SO)
|
||||||
symlink.darwin:
|
symlink.darwin:
|
||||||
@ $(CALC_VERSIONS); \
|
@ $(CALC_VERSIONS); \
|
||||||
SHLIB=lib$(LIBNAME) \
|
SHLIB=lib$(LIBNAME); \
|
||||||
SHLIB_SUFFIX=.dylib; \
|
SHLIB_SUFFIX=.dylib; \
|
||||||
$(SYMLINK_SO)
|
$(SYMLINK_SO)
|
||||||
symlink.hpux32 symlink.hpux64:
|
symlink.hpux32 symlink.hpux64:
|
||||||
@@ -542,43 +730,57 @@ symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
|
|||||||
# Compatibility targets
|
# Compatibility targets
|
||||||
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
|
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
|
||||||
link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
|
link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
|
||||||
|
link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
|
||||||
symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
|
symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
|
||||||
link_o.darwin-shared: link_o.darwin
|
link_o.darwin-shared: link_o.darwin
|
||||||
link_a.darwin-shared: link_a.darwin
|
link_a.darwin-shared: link_a.darwin
|
||||||
|
link_app.darwin-shared: link_app.darwin
|
||||||
symlink.darwin-shared: symlink.darwin
|
symlink.darwin-shared: symlink.darwin
|
||||||
link_o.cygwin-shared: link_o.cygwin
|
link_o.cygwin-shared: link_o.cygwin
|
||||||
link_a.cygwin-shared: link_a.cygwin
|
link_a.cygwin-shared: link_a.cygwin
|
||||||
|
link_app.cygwin-shared: link_app.cygwin
|
||||||
symlink.cygwin-shared: symlink.cygwin
|
symlink.cygwin-shared: symlink.cygwin
|
||||||
link_o.alpha-osf1-shared: link_o.alpha-osf1
|
link_o.alpha-osf1-shared: link_o.alpha-osf1
|
||||||
link_a.alpha-osf1-shared: link_a.alpha-osf1
|
link_a.alpha-osf1-shared: link_a.alpha-osf1
|
||||||
|
link_app.alpha-osf1-shared: link_app.alpha-osf1
|
||||||
symlink.alpha-osf1-shared: symlink.alpha-osf1
|
symlink.alpha-osf1-shared: symlink.alpha-osf1
|
||||||
link_o.tru64-shared: link_o.tru64
|
link_o.tru64-shared: link_o.tru64
|
||||||
link_a.tru64-shared: link_a.tru64
|
link_a.tru64-shared: link_a.tru64
|
||||||
|
link_app.tru64-shared: link_app.tru64
|
||||||
symlink.tru64-shared: symlink.tru64
|
symlink.tru64-shared: symlink.tru64
|
||||||
link_o.tru64-shared-rpath: link_o.tru64-rpath
|
link_o.tru64-shared-rpath: link_o.tru64-rpath
|
||||||
link_a.tru64-shared-rpath: link_a.tru64-rpath
|
link_a.tru64-shared-rpath: link_a.tru64-rpath
|
||||||
|
link_app.tru64-shared-rpath: link_app.tru64-rpath
|
||||||
symlink.tru64-shared-rpath: symlink.tru64-rpath
|
symlink.tru64-shared-rpath: symlink.tru64-rpath
|
||||||
link_o.solaris-shared: link_o.solaris
|
link_o.solaris-shared: link_o.solaris
|
||||||
link_a.solaris-shared: link_a.solaris
|
link_a.solaris-shared: link_a.solaris
|
||||||
|
link_app.solaris-shared: link_app.solaris
|
||||||
symlink.solaris-shared: symlink.solaris
|
symlink.solaris-shared: symlink.solaris
|
||||||
link_o.svr3-shared: link_o.svr3
|
link_o.svr3-shared: link_o.svr3
|
||||||
link_a.svr3-shared: link_a.svr3
|
link_a.svr3-shared: link_a.svr3
|
||||||
|
link_app.svr3-shared: link_app.svr3
|
||||||
symlink.svr3-shared: symlink.svr3
|
symlink.svr3-shared: symlink.svr3
|
||||||
link_o.svr5-shared: link_o.svr3
|
link_o.svr5-shared: link_o.svr5
|
||||||
link_a.svr5-shared: link_a.svr3
|
link_a.svr5-shared: link_a.svr5
|
||||||
symlink.svr5-shared: symlink.svr3
|
link_app.svr5-shared: link_app.svr5
|
||||||
|
symlink.svr5-shared: symlink.svr5
|
||||||
link_o.irix-shared: link_o.irix
|
link_o.irix-shared: link_o.irix
|
||||||
link_a.irix-shared: link_a.irix
|
link_a.irix-shared: link_a.irix
|
||||||
|
link_app.irix-shared: link_app.irix
|
||||||
symlink.irix-shared: symlink.irix
|
symlink.irix-shared: symlink.irix
|
||||||
link_o.hpux-shared: link_o.hpux32
|
link_o.hpux-shared: link_o.hpux32
|
||||||
link_a.hpux-shared: link_a.hpux32
|
link_a.hpux-shared: link_a.hpux32
|
||||||
|
link_app.hpux-shared: link_app.hpux32
|
||||||
symlink.hpux-shared: symlink.hpux32
|
symlink.hpux-shared: symlink.hpux32
|
||||||
link_o.hpux64-shared: link_o.hpux64
|
link_o.hpux64-shared: link_o.hpux64
|
||||||
link_a.hpux64-shared: link_a.hpux64
|
link_a.hpux64-shared: link_a.hpux64
|
||||||
|
link_app.hpux64-shared: link_app.hpux64
|
||||||
symlink.hpux64-shared: symlink.hpux64
|
symlink.hpux64-shared: symlink.hpux64
|
||||||
link_o.aix-shared: link_o.aix
|
link_o.aix-shared: link_o.aix
|
||||||
link_a.aix-shared: link_a.aix
|
link_a.aix-shared: link_a.aix
|
||||||
|
link_app.aix-shared: link_app.aix
|
||||||
symlink.aix-shared: symlink.aix
|
symlink.aix-shared: symlink.aix
|
||||||
link_o.reliantunix-shared: link_o.reliantunix
|
link_o.reliantunix-shared: link_o.reliantunix
|
||||||
link_a.reliantunix-shared: link_a.reliantunix
|
link_a.reliantunix-shared: link_a.reliantunix
|
||||||
|
link_app.reliantunix-shared: link_app.reliantunix
|
||||||
symlink.reliantunix-shared: symlink.reliantunix
|
symlink.reliantunix-shared: symlink.reliantunix
|
||||||
|
|||||||
52
NEWS
52
NEWS
@@ -5,6 +5,35 @@
|
|||||||
This file gives a brief overview of the major changes between each OpenSSL
|
This file gives a brief overview of the major changes between each OpenSSL
|
||||||
release. For more details please read the CHANGES file.
|
release. For more details please read the CHANGES file.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c:
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
o Security: counter the Klima-Pokorny-Rosa extension of
|
||||||
|
Bleichbacher's attack
|
||||||
|
o Security: make RSA blinding default.
|
||||||
|
o Configuration: Irix fixes, AIX fixes, better mingw support.
|
||||||
|
o Support for new platforms: linux-ia64-ecc.
|
||||||
|
o Build: shared library support fixes.
|
||||||
|
o ASN.1: treat domainComponent correctly.
|
||||||
|
o Documentation: fixes and additions.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a:
|
||||||
|
|
||||||
|
o Security: Important security related bugfixes.
|
||||||
|
o Enhanced compatibility with MIT Kerberos.
|
||||||
|
o Can be built without the ENGINE framework.
|
||||||
|
o IA32 assembler enhancements.
|
||||||
|
o Support for new platforms: FreeBSD/IA64 and FreeBSD/Sparc64.
|
||||||
|
o Configuration: the no-err option now works properly.
|
||||||
|
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:
|
||||||
|
|
||||||
o New library section OCSP.
|
o New library section OCSP.
|
||||||
@@ -17,11 +46,15 @@
|
|||||||
a separate distribution.
|
a separate distribution.
|
||||||
o New elliptic curve library section.
|
o New elliptic curve library section.
|
||||||
o New AES (Rijndael) library section.
|
o New AES (Rijndael) library section.
|
||||||
o Support for new platforms: Windows CE, Tandem OSS, A/UX, AIX 64-bit
|
o Support for new platforms: Windows CE, Tandem OSS, A/UX, AIX 64-bit,
|
||||||
|
Linux x86_64, Linux 64-bit on Sparc v9
|
||||||
o Extended support for some platforms: VxWorks
|
o Extended support for some platforms: VxWorks
|
||||||
o Enhanced support for shared libraries.
|
o Enhanced support for shared libraries.
|
||||||
|
o Now only builds PIC code when shared library support is requested.
|
||||||
o Support for pkg-config.
|
o Support for pkg-config.
|
||||||
o Lots of new manuals.
|
o Lots of new manuals.
|
||||||
|
o Makes symbolic links to or copies of manuals to cover all described
|
||||||
|
functions.
|
||||||
o Change DES API to clean up the namespace (some applications link also
|
o Change DES API to clean up the namespace (some applications link also
|
||||||
against libdes providing similar functions having the same name).
|
against libdes providing similar functions having the same name).
|
||||||
Provide macros for backward compatibility (will be removed in the
|
Provide macros for backward compatibility (will be removed in the
|
||||||
@@ -42,10 +75,27 @@
|
|||||||
o SSL/TLS: allow optional cipher choice according to server's preference.
|
o SSL/TLS: allow optional cipher choice according to server's preference.
|
||||||
o SSL/TLS: allow server to explicitly set new session ids.
|
o SSL/TLS: allow server to explicitly set new session ids.
|
||||||
o SSL/TLS: support Kerberos cipher suites (RFC2712).
|
o SSL/TLS: support Kerberos cipher suites (RFC2712).
|
||||||
|
Only supports MIT Kerberos for now.
|
||||||
o SSL/TLS: allow more precise control of renegotiations and sessions.
|
o SSL/TLS: allow more precise control of renegotiations and sessions.
|
||||||
o SSL/TLS: add callback to retrieve SSL/TLS messages.
|
o SSL/TLS: add callback to retrieve SSL/TLS messages.
|
||||||
o SSL/TLS: support AES cipher suites (RFC3268).
|
o SSL/TLS: support AES cipher suites (RFC3268).
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k:
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
o New configuration targets for Tandem OSS and A/UX.
|
o New configuration targets for Tandem OSS and A/UX.
|
||||||
|
|||||||
204
Netware/build.bat
Normal file
204
Netware/build.bat
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem ========================================================================
|
||||||
|
rem Batch file to automate building OpenSSL for NetWare.
|
||||||
|
rem
|
||||||
|
rem usage:
|
||||||
|
rem build [target] [debug opts] [assembly opts] [configure opts]
|
||||||
|
rem
|
||||||
|
rem target - "netware-clib" - CLib NetWare build
|
||||||
|
rem - "netware-libc" - LibC NKS NetWare build
|
||||||
|
rem
|
||||||
|
rem debug opts - "debug" - build debug
|
||||||
|
rem
|
||||||
|
rem assembly opts - "nw-mwasm" - use Metrowerks assembler
|
||||||
|
rem "nw-nasm" - use NASM assembler
|
||||||
|
rem "no-asm" - don't use assembly
|
||||||
|
rem
|
||||||
|
rem configure opts- all unrecognized arguments are passed to the
|
||||||
|
rem perl configure script
|
||||||
|
rem
|
||||||
|
rem If no arguments are specified the default is to build non-debug with
|
||||||
|
rem no assembly. NOTE: there is no default BLD_TARGET.
|
||||||
|
rem
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
rem No assembly is the default - Uncomment section below to change
|
||||||
|
rem the assembler default
|
||||||
|
set ASM_MODE=
|
||||||
|
set ASSEMBLER=
|
||||||
|
set NO_ASM=no-asm
|
||||||
|
|
||||||
|
rem Uncomment to default to the Metrowerks assembler
|
||||||
|
rem set ASM_MODE=nw-mwasm
|
||||||
|
rem set ASSEMBLER=Metrowerks
|
||||||
|
rem set NO_ASM=
|
||||||
|
|
||||||
|
rem Uncomment to default to the NASM assembler
|
||||||
|
rem set ASM_MODE=nw-nasm
|
||||||
|
rem set ASSEMBLER=NASM
|
||||||
|
rem set NO_ASM=
|
||||||
|
|
||||||
|
rem No default Bld target
|
||||||
|
set BLD_TARGET=no_target
|
||||||
|
rem set BLD_TARGET=netware-clib
|
||||||
|
rem set BLD_TARGET=netware-libc
|
||||||
|
|
||||||
|
|
||||||
|
rem Default to build non-debug
|
||||||
|
set DEBUG=
|
||||||
|
|
||||||
|
rem Uncomment to default to debug build
|
||||||
|
rem set DEBUG=debug
|
||||||
|
|
||||||
|
|
||||||
|
set CONFIG_OPTS=
|
||||||
|
set ARG_PROCESSED=NO
|
||||||
|
|
||||||
|
|
||||||
|
rem Process command line args
|
||||||
|
:opts
|
||||||
|
if "a%1" == "a" goto endopt
|
||||||
|
if "%1" == "no-asm" set NO_ASM=no-asm
|
||||||
|
if "%1" == "no-asm" set ARG_PROCESSED=YES
|
||||||
|
if "%1" == "debug" set DEBUG=debug
|
||||||
|
if "%1" == "debug" set ARG_PROCESSED=YES
|
||||||
|
if "%1" == "nw-nasm" set ASM_MODE=nw-nasm
|
||||||
|
if "%1" == "nw-nasm" set ASSEMBLER=NASM
|
||||||
|
if "%1" == "nw-nasm" set NO_ASM=
|
||||||
|
if "%1" == "nw-nasm" set ARG_PROCESSED=YES
|
||||||
|
if "%1" == "nw-mwasm" set ASM_MODE=nw-mwasm
|
||||||
|
if "%1" == "nw-mwasm" set ASSEMBLER=Metrowerks
|
||||||
|
if "%1" == "nw-mwasm" set NO_ASM=
|
||||||
|
if "%1" == "nw-mwasm" set ARG_PROCESSED=YES
|
||||||
|
if "%1" == "netware-clib" set BLD_TARGET=netware-clib
|
||||||
|
if "%1" == "netware-clib" set ARG_PROCESSED=YES
|
||||||
|
if "%1" == "netware-libc" set BLD_TARGET=netware-libc
|
||||||
|
if "%1" == "netware-libc" set ARG_PROCESSED=YES
|
||||||
|
|
||||||
|
rem If we didn't recognize the argument, consider it an option for config
|
||||||
|
if "%ARG_PROCESSED%" == "NO" set CONFIG_OPTS=%CONFIG_OPTS% %1
|
||||||
|
if "%ARG_PROCESSED%" == "YES" set ARG_PROCESSED=NO
|
||||||
|
|
||||||
|
shift
|
||||||
|
goto opts
|
||||||
|
:endopt
|
||||||
|
|
||||||
|
rem make sure a valid BLD_TARGET was specified
|
||||||
|
if "%BLD_TARGET%" == "no_target" goto no_target
|
||||||
|
|
||||||
|
rem build the nlm make file name which includes target and debug info
|
||||||
|
set NLM_MAKE=
|
||||||
|
if "%BLD_TARGET%" == "netware-clib" set NLM_MAKE=netware\nlm_clib
|
||||||
|
if "%BLD_TARGET%" == "netware-libc" set NLM_MAKE=netware\nlm_libc
|
||||||
|
if "%DEBUG%" == "" set NLM_MAKE=%NLM_MAKE%.mak
|
||||||
|
if "%DEBUG%" == "debug" set NLM_MAKE=%NLM_MAKE%_dbg.mak
|
||||||
|
|
||||||
|
if "%NO_ASM%" == "no-asm" set ASM_MODE=
|
||||||
|
if "%NO_ASM%" == "no-asm" set ASSEMBLER=
|
||||||
|
if "%NO_ASM%" == "no-asm" set CONFIG_OPTS=%CONFIG_OPTS% no-asm
|
||||||
|
if "%NO_ASM%" == "no-asm" goto do_config
|
||||||
|
|
||||||
|
|
||||||
|
rem ==================================================
|
||||||
|
echo Generating x86 for %ASSEMBLER% assembler
|
||||||
|
|
||||||
|
echo Bignum
|
||||||
|
cd crypto\bn\asm
|
||||||
|
perl x86.pl %ASM_MODE% > bn-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo DES
|
||||||
|
cd crypto\des\asm
|
||||||
|
perl des-586.pl %ASM_MODE% > d-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo "crypt(3)"
|
||||||
|
|
||||||
|
cd crypto\des\asm
|
||||||
|
perl crypt586.pl %ASM_MODE% > y-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo Blowfish
|
||||||
|
|
||||||
|
cd crypto\bf\asm
|
||||||
|
perl bf-586.pl %ASM_MODE% > b-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo CAST5
|
||||||
|
cd crypto\cast\asm
|
||||||
|
perl cast-586.pl %ASM_MODE% > c-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo RC4
|
||||||
|
cd crypto\rc4\asm
|
||||||
|
perl rc4-586.pl %ASM_MODE% > r4-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo MD5
|
||||||
|
cd crypto\md5\asm
|
||||||
|
perl md5-586.pl %ASM_MODE% > m5-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo SHA1
|
||||||
|
cd crypto\sha\asm
|
||||||
|
perl sha1-586.pl %ASM_MODE% > s1-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo RIPEMD160
|
||||||
|
cd crypto\ripemd\asm
|
||||||
|
perl rmd-586.pl %ASM_MODE% > rm-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
echo RC5\32
|
||||||
|
cd crypto\rc5\asm
|
||||||
|
perl rc5-586.pl %ASM_MODE% > r5-nw.asm
|
||||||
|
cd ..\..\..
|
||||||
|
|
||||||
|
rem ===============================================================
|
||||||
|
rem
|
||||||
|
:do_config
|
||||||
|
|
||||||
|
echo .
|
||||||
|
echo configure options: %CONFIG_OPTS% %BLD_TARGET%
|
||||||
|
echo .
|
||||||
|
perl configure %CONFIG_OPTS% %BLD_TARGET%
|
||||||
|
|
||||||
|
perl util\mkfiles.pl >MINFO
|
||||||
|
|
||||||
|
echo .
|
||||||
|
echo mk1mf.pl options: %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET%
|
||||||
|
echo .
|
||||||
|
perl util\mk1mf.pl %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% >%NLM_MAKE%
|
||||||
|
|
||||||
|
echo The makefile "%NLM_MAKE%" has been created use your maketool to
|
||||||
|
echo build (ex: gmake -f %NLM_MAKE%)
|
||||||
|
goto end
|
||||||
|
|
||||||
|
rem ===============================================================
|
||||||
|
rem
|
||||||
|
:no_target
|
||||||
|
echo .
|
||||||
|
echo . No build target specified!!!
|
||||||
|
echo .
|
||||||
|
echo . usage: build [target] [debug opts] [assembly opts] [configure opts]
|
||||||
|
echo .
|
||||||
|
echo . target - "netware-clib" - CLib NetWare build
|
||||||
|
echo . - "netware-libc" - LibC NKS NetWare build
|
||||||
|
echo .
|
||||||
|
echo . debug opts - "debug" - build debug
|
||||||
|
echo .
|
||||||
|
echo . assembly opts - "nw-mwasm" - use Metrowerks assembler
|
||||||
|
echo . "nw-nasm" - use NASM assembler
|
||||||
|
echo . "no-asm" - don't use assembly
|
||||||
|
echo .
|
||||||
|
echo . configure opts- all unrecognized arguments are passed to the
|
||||||
|
echo . perl configure script
|
||||||
|
echo .
|
||||||
|
echo . If no debug or assembly opts are specified the default is to build
|
||||||
|
echo . non-debug without assembly
|
||||||
|
echo .
|
||||||
|
|
||||||
|
|
||||||
|
:end
|
||||||
112
Netware/cpy_tests.bat
Normal file
112
Netware/cpy_tests.bat
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem Batch file to copy OpenSSL stuff to a NetWare server for testing
|
||||||
|
|
||||||
|
rem This batch file will create an "opensssl" directory at the root of the
|
||||||
|
rem specified NetWare drive and copy the required files to run the tests.
|
||||||
|
rem It should be run from inside the "openssl\netware" subdirectory.
|
||||||
|
|
||||||
|
rem Usage:
|
||||||
|
rem cpy_tests.bat <test subdirectory> <NetWare drive>
|
||||||
|
rem <test subdirectory> - out_nw.dbg | out_nw
|
||||||
|
rem <NetWare drive> - any mapped drive letter
|
||||||
|
rem
|
||||||
|
rem example ( copy from debug build to m: dirve ):
|
||||||
|
rem cpy_tests.bat out_nw.dbg m:
|
||||||
|
rem
|
||||||
|
rem CAUTION: If a directory named OpenSSL exists on the target drive
|
||||||
|
rem it will be deleted first.
|
||||||
|
|
||||||
|
|
||||||
|
if "%1" == "" goto usage
|
||||||
|
if "%2" == "" goto usage
|
||||||
|
|
||||||
|
rem Assume running in \openssl directory unless cpy_tests.bat exists then
|
||||||
|
rem it must be the \openssl\netware directory
|
||||||
|
set loc=.
|
||||||
|
if exist cpy_tests.bat set loc=..
|
||||||
|
|
||||||
|
rem make sure the local build subdirectory specified is valid
|
||||||
|
if not exist %loc%\%1\NUL goto invalid_dir
|
||||||
|
|
||||||
|
rem make sure target drive is valid
|
||||||
|
if not exist %2\NUL goto invalid_drive
|
||||||
|
|
||||||
|
rem If an OpenSSL directory exists on the target drive, remove it
|
||||||
|
if exist %2\openssl\NUL goto remove_openssl
|
||||||
|
goto do_copy
|
||||||
|
|
||||||
|
:remove_openssl
|
||||||
|
echo .
|
||||||
|
echo OpenSSL directory exists on %2 - it will be removed!
|
||||||
|
pause
|
||||||
|
rmdir %2\openssl /s /q
|
||||||
|
|
||||||
|
:do_copy
|
||||||
|
rem make an "openssl" directory and others at the root of the NetWare drive
|
||||||
|
mkdir %2\openssl
|
||||||
|
mkdir %2\openssl\test_out
|
||||||
|
mkdir %2\openssl\apps
|
||||||
|
mkdir %2\openssl\certs
|
||||||
|
mkdir %2\openssl\test
|
||||||
|
|
||||||
|
|
||||||
|
rem copy the test nlms
|
||||||
|
copy %loc%\%1\*.nlm %2\openssl\
|
||||||
|
|
||||||
|
rem copy the test perl script
|
||||||
|
copy %loc%\netware\do_tests.pl %2\openssl\
|
||||||
|
|
||||||
|
rem copy the certs directory stuff
|
||||||
|
xcopy %loc%\certs\*.* %2\openssl\certs\ /s
|
||||||
|
|
||||||
|
rem copy the test directory stuff
|
||||||
|
copy %loc%\test\CAss.cnf %2\openssl\test\
|
||||||
|
copy %loc%\test\Uss.cnf %2\openssl\test\
|
||||||
|
copy %loc%\test\pkcs7.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\pkcs7-1.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\testcrl.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\testp7.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\testreq2.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\testrsa.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\testsid.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\testx509.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\v3-cert1.pem %2\openssl\test\
|
||||||
|
copy %loc%\test\v3-cert2.pem %2\openssl\test\
|
||||||
|
|
||||||
|
rem copy the apps directory stuff
|
||||||
|
copy %loc%\apps\client.pem %2\openssl\apps\
|
||||||
|
copy %loc%\apps\server.pem %2\openssl\apps\
|
||||||
|
copy %loc%\apps\openssl.cnf %2\openssl\apps\
|
||||||
|
|
||||||
|
echo .
|
||||||
|
echo Tests copied
|
||||||
|
echo Run the test script at the console by typing:
|
||||||
|
echo "Perl \openssl\do_tests.pl"
|
||||||
|
echo .
|
||||||
|
echo Make sure the Search path includes the OpenSSL subdirectory
|
||||||
|
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:invalid_dir
|
||||||
|
echo.
|
||||||
|
echo Invalid build directory specified: %1
|
||||||
|
echo.
|
||||||
|
goto usage
|
||||||
|
|
||||||
|
:invalid_drive
|
||||||
|
echo.
|
||||||
|
echo Invalid drive: %2
|
||||||
|
echo.
|
||||||
|
goto usage
|
||||||
|
|
||||||
|
:usage
|
||||||
|
echo.
|
||||||
|
echo usage: cpy_tests.bat [test subdirectory] [NetWare drive]
|
||||||
|
echo [test subdirectory] - out_nw_clib.dbg, out_nw_libc.dbg, etc.
|
||||||
|
echo [NetWare drive] - any mapped drive letter
|
||||||
|
echo.
|
||||||
|
echo example: cpy_test out_nw_clib.dbg M:
|
||||||
|
echo (copy from clib debug build area to M: drive)
|
||||||
|
|
||||||
|
:end
|
||||||
585
Netware/do_tests.pl
Normal file
585
Netware/do_tests.pl
Normal file
@@ -0,0 +1,585 @@
|
|||||||
|
# perl script to run OpenSSL tests
|
||||||
|
|
||||||
|
|
||||||
|
my $base_path = "\\openssl";
|
||||||
|
|
||||||
|
my $output_path = "$base_path\\test_out";
|
||||||
|
my $cert_path = "$base_path\\certs";
|
||||||
|
my $test_path = "$base_path\\test";
|
||||||
|
my $app_path = "$base_path\\apps";
|
||||||
|
|
||||||
|
my $tmp_cert = "$output_path\\cert.tmp";
|
||||||
|
my $OpenSSL_config = "$app_path\\openssl.cnf";
|
||||||
|
my $log_file = "$output_path\\tests.log";
|
||||||
|
|
||||||
|
my $pause = 0;
|
||||||
|
|
||||||
|
|
||||||
|
# process the command line args to see if they wanted us to pause
|
||||||
|
# between executing each command
|
||||||
|
foreach $i (@ARGV)
|
||||||
|
{
|
||||||
|
if ($i =~ /^-p$/)
|
||||||
|
{ $pause=1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
main();
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub main()
|
||||||
|
{
|
||||||
|
# delete all the output files in the output directory
|
||||||
|
unlink <$output_path\\*.*>;
|
||||||
|
|
||||||
|
# open the main log file
|
||||||
|
open(OUT, ">$log_file") || die "unable to open $log_file\n";
|
||||||
|
|
||||||
|
|
||||||
|
algorithm_tests();
|
||||||
|
encryption_tests();
|
||||||
|
pem_tests();
|
||||||
|
verify_tests();
|
||||||
|
ssl_tests();
|
||||||
|
ca_tests();
|
||||||
|
|
||||||
|
close(OUT);
|
||||||
|
|
||||||
|
print("\nCompleted running tests.\n\n");
|
||||||
|
print("Check log file for errors: $log_file\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub algorithm_tests
|
||||||
|
{
|
||||||
|
my $i;
|
||||||
|
my $outFile;
|
||||||
|
my @tests = ( rsa_test, destest, ideatest, bftest, shatest, sha1test,
|
||||||
|
md5test, dsatest, md2test, mdc2test, rc2test, rc4test, randtest,
|
||||||
|
dhtest, exptest );
|
||||||
|
|
||||||
|
print( "\nRUNNING CRYPTO ALGORITHM TESTS:\n\n");
|
||||||
|
|
||||||
|
print( OUT "\n========================================================\n");
|
||||||
|
print( OUT "CRYPTO ALGORITHM TESTS:\n\n");
|
||||||
|
|
||||||
|
foreach $i (@tests)
|
||||||
|
{
|
||||||
|
$outFile = "$output_path\\$i.out";
|
||||||
|
system("$i > $outFile");
|
||||||
|
log_desc("Test: $i\.nlm:");
|
||||||
|
log_output("", $outFile );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub encryption_tests
|
||||||
|
{
|
||||||
|
my $i;
|
||||||
|
my $outFile;
|
||||||
|
my @enc_tests = ( "enc", "rc4", "des-cfb", "des-ede-cfb", "des-ede3-cfb",
|
||||||
|
"des-ofb", "des-ede-ofb", "des-ede3-ofb",
|
||||||
|
"des-ecb", "des-ede", "des-ede3", "des-cbc",
|
||||||
|
"des-ede-cbc", "des-ede3-cbc", "idea-ecb", "idea-cfb",
|
||||||
|
"idea-ofb", "idea-cbc", "rc2-ecb", "rc2-cfb",
|
||||||
|
"rc2-ofb", "rc2-cbc", "bf-ecb", "bf-cfb",
|
||||||
|
"bf-ofb", "bf-cbc" );
|
||||||
|
|
||||||
|
my $input = "$base_path\\do_tests.pl";
|
||||||
|
my $cipher = "$output_path\\cipher.out";
|
||||||
|
my $clear = "$output_path\\clear.out";
|
||||||
|
|
||||||
|
print( "\nRUNNING ENCRYPTION & DECRYPTION TESTS:\n\n");
|
||||||
|
|
||||||
|
print( OUT "\n========================================================\n");
|
||||||
|
print( OUT "FILE ENCRYPTION & DECRYPTION TESTS:\n\n");
|
||||||
|
|
||||||
|
foreach $i (@enc_tests)
|
||||||
|
{
|
||||||
|
log_desc("Testing: $i");
|
||||||
|
|
||||||
|
# do encryption
|
||||||
|
$outFile = "$output_path\\enc.out";
|
||||||
|
system("openssl2 $i -e -bufsize 113 -k test -in $input -out $cipher > $outFile" );
|
||||||
|
log_output("Encrypting: $input --> $cipher", $outFile);
|
||||||
|
|
||||||
|
# do decryption
|
||||||
|
$outFile = "$output_path\\dec.out";
|
||||||
|
system("openssl2 $i -d -bufsize 157 -k test -in $cipher -out $clear > $outFile");
|
||||||
|
log_output("Decrypting: $cipher --> $clear", $outFile);
|
||||||
|
|
||||||
|
# compare files
|
||||||
|
$x = compare_files( $input, $clear, 1);
|
||||||
|
if ( $x == 0 )
|
||||||
|
{
|
||||||
|
print( "SUCCESS - files match: $input, $clear\n");
|
||||||
|
print( OUT "SUCCESS - files match: $input, $clear\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print( "ERROR: files don't match\n");
|
||||||
|
print( OUT "ERROR: files don't match\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
do_wait();
|
||||||
|
|
||||||
|
# Now do the same encryption but use Base64
|
||||||
|
|
||||||
|
# do encryption B64
|
||||||
|
$outFile = "$output_path\\B64enc.out";
|
||||||
|
system("openssl2 $i -a -e -bufsize 113 -k test -in $input -out $cipher > $outFile");
|
||||||
|
log_output("Encrypting(B64): $cipher --> $clear", $outFile);
|
||||||
|
|
||||||
|
# do decryption B64
|
||||||
|
$outFile = "$output_path\\B64dec.out";
|
||||||
|
system("openssl2 $i -a -d -bufsize 157 -k test -in $cipher -out $clear > $outFile");
|
||||||
|
log_output("Decrypting(B64): $cipher --> $clear", $outFile);
|
||||||
|
|
||||||
|
# compare files
|
||||||
|
$x = compare_files( $input, $clear, 1);
|
||||||
|
if ( $x == 0 )
|
||||||
|
{
|
||||||
|
print( "SUCCESS - files match: $input, $clear\n");
|
||||||
|
print( OUT "SUCCESS - files match: $input, $clear\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print( "ERROR: files don't match\n");
|
||||||
|
print( OUT "ERROR: files don't match\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
do_wait();
|
||||||
|
|
||||||
|
} # end foreach
|
||||||
|
|
||||||
|
# delete the temporary files
|
||||||
|
unlink($cipher);
|
||||||
|
unlink($clear);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub pem_tests
|
||||||
|
{
|
||||||
|
my $i;
|
||||||
|
my $tmp_out;
|
||||||
|
my $outFile = "$output_path\\pem.out";
|
||||||
|
|
||||||
|
my %pem_tests = (
|
||||||
|
"crl" => "testcrl.pem",
|
||||||
|
"pkcs7" => "testp7.pem",
|
||||||
|
"req" => "testreq2.pem",
|
||||||
|
"rsa" => "testrsa.pem",
|
||||||
|
"x509" => "testx509.pem",
|
||||||
|
"x509" => "v3-cert1.pem",
|
||||||
|
"sess_id" => "testsid.pem" );
|
||||||
|
|
||||||
|
|
||||||
|
print( "\nRUNNING PEM TESTS:\n\n");
|
||||||
|
|
||||||
|
print( OUT "\n========================================================\n");
|
||||||
|
print( OUT "PEM TESTS:\n\n");
|
||||||
|
|
||||||
|
foreach $i (keys(%pem_tests))
|
||||||
|
{
|
||||||
|
log_desc( "Testing: $i");
|
||||||
|
|
||||||
|
my $input = "$test_path\\$pem_tests{$i}";
|
||||||
|
|
||||||
|
$tmp_out = "$output_path\\$pem_tests{$i}";
|
||||||
|
|
||||||
|
if ($i ne "req" )
|
||||||
|
{
|
||||||
|
system("openssl2 $i -in $input -out $tmp_out > $outFile");
|
||||||
|
log_output( "openssl2 $i -in $input -out $tmp_out", $outFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
system("openssl2 $i -in $input -out $tmp_out -config $OpenSSL_config > $outFile");
|
||||||
|
log_output( "openssl2 $i -in $input -out $tmp_out -config $OpenSSL_config", $outFile );
|
||||||
|
}
|
||||||
|
|
||||||
|
$x = compare_files( $input, $tmp_out);
|
||||||
|
if ( $x == 0 )
|
||||||
|
{
|
||||||
|
print( "SUCCESS - files match: $input, $tmp_out\n");
|
||||||
|
print( OUT "SUCCESS - files match: $input, $tmp_out\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print( "ERROR: files don't match\n");
|
||||||
|
print( OUT "ERROR: files don't match\n");
|
||||||
|
}
|
||||||
|
do_wait();
|
||||||
|
|
||||||
|
} # end foreach
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub verify_tests
|
||||||
|
{
|
||||||
|
my $i;
|
||||||
|
my $outFile = "$output_path\\verify.out";
|
||||||
|
|
||||||
|
my @cert_files = <$cert_path\\*.pem>;
|
||||||
|
|
||||||
|
print( "\nRUNNING VERIFY TESTS:\n\n");
|
||||||
|
|
||||||
|
print( OUT "\n========================================================\n");
|
||||||
|
print( OUT "VERIFY TESTS:\n\n");
|
||||||
|
|
||||||
|
make_tmp_cert_file();
|
||||||
|
|
||||||
|
foreach $i (@cert_files)
|
||||||
|
{
|
||||||
|
system("openssl2 verify -CAfile $tmp_cert $i >$outFile");
|
||||||
|
log_desc("Verifying cert: $i");
|
||||||
|
log_output("openssl2 verify -CAfile $tmp_cert $i", $outFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub ssl_tests
|
||||||
|
{
|
||||||
|
my $outFile = "$output_path\\ssl_tst.out";
|
||||||
|
|
||||||
|
print( "\nRUNNING SSL TESTS:\n\n");
|
||||||
|
|
||||||
|
print( OUT "\n========================================================\n");
|
||||||
|
print( OUT "SSL TESTS:\n\n");
|
||||||
|
|
||||||
|
make_tmp_cert_file();
|
||||||
|
|
||||||
|
system("ssltest -ssl2 >$outFile");
|
||||||
|
log_desc("Testing sslv2:");
|
||||||
|
log_output("ssltest -ssl2", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -ssl2 -server_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2 with server authentication:");
|
||||||
|
log_output("ssltest -ssl2 -server_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -ssl2 -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2 with client authentication:");
|
||||||
|
log_output("ssltest -ssl2 -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -ssl2 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2 with both client and server authentication:");
|
||||||
|
log_output("ssltest -ssl2 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -ssl3 >$outFile");
|
||||||
|
log_desc("Testing sslv3:");
|
||||||
|
log_output("ssltest -ssl3", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -ssl3 -server_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv3 with server authentication:");
|
||||||
|
log_output("ssltest -ssl3 -server_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -ssl3 -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv3 with client authentication:");
|
||||||
|
log_output("ssltest -ssl3 -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -ssl3 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv3 with both client and server authentication:");
|
||||||
|
log_output("ssltest -ssl3 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3:");
|
||||||
|
log_output("ssltest", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -server_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 with server authentication:");
|
||||||
|
log_output("ssltest -server_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 with client authentication:");
|
||||||
|
log_output("ssltest -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -server_auth -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 with both client and server authentication:");
|
||||||
|
log_output("ssltest -server_auth -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl2 >$outFile");
|
||||||
|
log_desc("Testing sslv2 via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl2", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -dhe1024dsa -v >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 with 1024 bit DHE via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -dhe1024dsa -v", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl2 -server_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2 with server authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl2 -server_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl2 -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2 with client authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl2 -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl2 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2 with both client and server authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl2 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl3 >$outFile");
|
||||||
|
log_desc("Testing sslv3 via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl3", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl3 -server_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv3 with server authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl3 -server_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl3 -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv3 with client authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl3 -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -ssl3 -server_auth -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv3 with both client and server authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -ssl3 -server_auth -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -server_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 with server authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -server_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 with client authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
|
||||||
|
system("ssltest -bio_pair -server_auth -client_auth -CAfile $tmp_cert >$outFile");
|
||||||
|
log_desc("Testing sslv2/sslv3 with both client and server authentication via BIO pair:");
|
||||||
|
log_output("ssltest -bio_pair -server_auth -client_auth -CAfile $tmp_cert", $outFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub ca_tests
|
||||||
|
{
|
||||||
|
my $outFile = "$output_path\\ca_tst.out";
|
||||||
|
|
||||||
|
my($CAkey) = "$output_path\\keyCA.ss";
|
||||||
|
my($CAcert) = "$output_path\\certCA.ss";
|
||||||
|
my($CAserial) = "$output_path\\certCA.srl";
|
||||||
|
my($CAreq) = "$output_path\\reqCA.ss";
|
||||||
|
my($CAreq2) = "$output_path\\req2CA.ss";
|
||||||
|
|
||||||
|
my($CAconf) = "$test_path\\CAss.cnf";
|
||||||
|
|
||||||
|
my($Uconf) = "$test_path\\Uss.cnf";
|
||||||
|
|
||||||
|
my($Ukey) = "$output_path\\keyU.ss";
|
||||||
|
my($Ureq) = "$output_path\\reqU.ss";
|
||||||
|
my($Ucert) = "$output_path\\certU.ss";
|
||||||
|
|
||||||
|
print( "\nRUNNING CA TESTS:\n\n");
|
||||||
|
|
||||||
|
print( OUT "\n========================================================\n");
|
||||||
|
print( OUT "CA TESTS:\n");
|
||||||
|
|
||||||
|
system("openssl2 req -config $CAconf -out $CAreq -keyout $CAkey -new >$outFile");
|
||||||
|
log_desc("Make a certificate request using req:");
|
||||||
|
log_output("openssl2 req -config $CAconf -out $CAreq -keyout $CAkey -new", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 x509 -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey >$outFile");
|
||||||
|
log_desc("Convert the certificate request into a self signed certificate using x509:");
|
||||||
|
log_output("openssl2 x509 -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 x509 -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >$outFile");
|
||||||
|
log_desc("Convert a certificate into a certificate request using 'x509':");
|
||||||
|
log_output("openssl2 x509 -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 req -config $OpenSSL_config -verify -in $CAreq -noout >$outFile");
|
||||||
|
log_output("openssl2 req -config $OpenSSL_config -verify -in $CAreq -noout", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 req -config $OpenSSL_config -verify -in $CAreq2 -noout >$outFile");
|
||||||
|
log_output( "openssl2 req -config $OpenSSL_config -verify -in $CAreq2 -noout", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 verify -CAfile $CAcert $CAcert >$outFile");
|
||||||
|
log_output("openssl2 verify -CAfile $CAcert $CAcert", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 req -config $Uconf -out $Ureq -keyout $Ukey -new >$outFile");
|
||||||
|
log_desc("Make another certificate request using req:");
|
||||||
|
log_output("openssl2 req -config $Uconf -out $Ureq -keyout $Ukey -new", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 x509 -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -CAserial $CAserial >$outFile");
|
||||||
|
log_desc("Sign certificate request with the just created CA via x509:");
|
||||||
|
log_output("openssl2 x509 -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -CAserial $CAserial", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 verify -CAfile $CAcert $Ucert >$outFile");
|
||||||
|
log_output("openssl2 verify -CAfile $CAcert $Ucert", $outFile);
|
||||||
|
|
||||||
|
system("openssl2 x509 -subject -issuer -startdate -enddate -noout -in $Ucert >$outFile");
|
||||||
|
log_desc("Certificate details");
|
||||||
|
log_output("openssl2 x509 -subject -issuer -startdate -enddate -noout -in $Ucert", $outFile);
|
||||||
|
|
||||||
|
print(OUT "-- \n");
|
||||||
|
print(OUT "The generated CA certificate is $CAcert\n");
|
||||||
|
print(OUT "The generated CA private key is $CAkey\n");
|
||||||
|
print(OUT "The current CA signing serial number is in $CAserial\n");
|
||||||
|
|
||||||
|
print(OUT "The generated user certificate is $Ucert\n");
|
||||||
|
print(OUT "The generated user private key is $Ukey\n");
|
||||||
|
print(OUT "--\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub log_output( $ $ )
|
||||||
|
{
|
||||||
|
my( $desc, $file ) = @_;
|
||||||
|
my($error) = 0;
|
||||||
|
my($key);
|
||||||
|
my($msg);
|
||||||
|
|
||||||
|
if ($desc)
|
||||||
|
{
|
||||||
|
print("$desc\n");
|
||||||
|
print(OUT "$desc\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
# loop waiting for test program to complete
|
||||||
|
while ( stat($file) == 0)
|
||||||
|
{ print(". "); sleep(1); }
|
||||||
|
|
||||||
|
|
||||||
|
# copy test output to log file
|
||||||
|
open(IN, "<$file");
|
||||||
|
while (<IN>)
|
||||||
|
{
|
||||||
|
print(OUT $_);
|
||||||
|
if ( $_ =~ /ERROR/ )
|
||||||
|
{
|
||||||
|
$error = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# close and delete the temporary test output file
|
||||||
|
close(IN);
|
||||||
|
unlink($file);
|
||||||
|
|
||||||
|
if ( $error == 0 )
|
||||||
|
{
|
||||||
|
$msg = "Test Succeeded";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$msg = "Test Failed";
|
||||||
|
}
|
||||||
|
|
||||||
|
print(OUT "$msg\n");
|
||||||
|
|
||||||
|
if ($pause)
|
||||||
|
{
|
||||||
|
print("$msg - press ENTER to continue...");
|
||||||
|
$key = getc;
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Several of the testing scripts run a loop loading the
|
||||||
|
# same NLM with different options.
|
||||||
|
# On slow NetWare machines there appears to be some delay in the
|
||||||
|
# OS actually unloading the test nlms and the OS complains about.
|
||||||
|
# the NLM already being loaded. This additional pause is to
|
||||||
|
# to help provide a little more time for unloading before trying to
|
||||||
|
# load again.
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub log_desc( $ )
|
||||||
|
{
|
||||||
|
my( $desc ) = @_;
|
||||||
|
|
||||||
|
print("\n");
|
||||||
|
print("$desc\n");
|
||||||
|
|
||||||
|
print(OUT "\n");
|
||||||
|
print(OUT "$desc\n");
|
||||||
|
print(OUT "======================================\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub compare_files( $ $ $ )
|
||||||
|
{
|
||||||
|
my( $file1, $file2, $binary ) = @_;
|
||||||
|
my( $n1, $n2, $b1, $b2 );
|
||||||
|
my($ret) = 1;
|
||||||
|
|
||||||
|
open(IN0, $file1) || die "\nunable to open $file1\n";
|
||||||
|
open(IN1, $file2) || die "\nunable to open $file2\n";
|
||||||
|
|
||||||
|
if ($binary)
|
||||||
|
{
|
||||||
|
binmode IN0;
|
||||||
|
binmode IN1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
$n1 = read(IN0, $b1, 512);
|
||||||
|
$n2 = read(IN1, $b2, 512);
|
||||||
|
|
||||||
|
if ($n1 != $n2) {last;}
|
||||||
|
if ($b1 != $b2) {last;}
|
||||||
|
|
||||||
|
if ($n1 == 0)
|
||||||
|
{
|
||||||
|
$ret = 0;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(IN0);
|
||||||
|
close(IN1);
|
||||||
|
return($ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub do_wait()
|
||||||
|
{
|
||||||
|
my($key);
|
||||||
|
|
||||||
|
if ($pause)
|
||||||
|
{
|
||||||
|
print("Press ENTER to continue...");
|
||||||
|
$key = getc;
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
sub make_tmp_cert_file()
|
||||||
|
{
|
||||||
|
my @cert_files = <$cert_path\\*.pem>;
|
||||||
|
|
||||||
|
# delete the file if it already exists
|
||||||
|
unlink($tmp_cert);
|
||||||
|
|
||||||
|
open( TMP_CERT, ">$tmp_cert") || die "\nunable to open $tmp_cert\n";
|
||||||
|
|
||||||
|
print("building temporary cert file\n");
|
||||||
|
|
||||||
|
# create a temporary cert file that contains all the certs
|
||||||
|
foreach $i (@cert_files)
|
||||||
|
{
|
||||||
|
open( IN_CERT, $i ) || die "\nunable to open $i\n";
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
$n = sysread(IN_CERT, $data, 1024);
|
||||||
|
|
||||||
|
if ($n == 0)
|
||||||
|
{
|
||||||
|
close(IN_CERT);
|
||||||
|
last;
|
||||||
|
};
|
||||||
|
|
||||||
|
syswrite(TMP_CERT, $data, $n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close( TMP_CERT );
|
||||||
|
}
|
||||||
254
Netware/globals.txt
Normal file
254
Netware/globals.txt
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
An initial review of the OpenSSL code was done to determine how many
|
||||||
|
global variables where present. The idea was to determine the amount of
|
||||||
|
work required to pull the globals into an instance data structure in
|
||||||
|
order to build a Library NLM for NetWare. This file contains the results
|
||||||
|
of the review. Each file is listed along with the globals in the file.
|
||||||
|
The initial review was done very quickly so this list is probably
|
||||||
|
not a comprehensive list.
|
||||||
|
|
||||||
|
|
||||||
|
cryptlib.c
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
static STACK *app_locks=NULL;
|
||||||
|
|
||||||
|
static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL;
|
||||||
|
|
||||||
|
static void (MS_FAR *locking_callback)(int mode,int type,
|
||||||
|
const char *file,int line)=NULL;
|
||||||
|
static int (MS_FAR *add_lock_callback)(int *pointer,int amount,
|
||||||
|
int type,const char *file,int line)=NULL;
|
||||||
|
static unsigned long (MS_FAR *id_callback)(void)=NULL;
|
||||||
|
static struct CRYPTO_dynlock_value *(MS_FAR *dynlock_create_callback)
|
||||||
|
(const char *file,int line)=NULL;
|
||||||
|
static void (MS_FAR *dynlock_lock_callback)(int mode,
|
||||||
|
struct CRYPTO_dynlock_value *l, const char *file,int line)=NULL;
|
||||||
|
static void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l,
|
||||||
|
const char *file,int line)=NULL;
|
||||||
|
|
||||||
|
|
||||||
|
mem.c
|
||||||
|
===========================================
|
||||||
|
static int allow_customize = 1; /* we provide flexible functions for */
|
||||||
|
static int allow_customize_debug = 1;/* exchanging memory-related functions at
|
||||||
|
|
||||||
|
/* may be changed as long as `allow_customize' is set */
|
||||||
|
static void *(*malloc_locked_func)(size_t) = malloc;
|
||||||
|
static void (*free_locked_func)(void *) = free;
|
||||||
|
static void *(*malloc_func)(size_t) = malloc;
|
||||||
|
static void *(*realloc_func)(void *, size_t)= realloc;
|
||||||
|
static void (*free_func)(void *) = free;
|
||||||
|
|
||||||
|
/* use default functions from mem_dbg.c */
|
||||||
|
static void (*malloc_debug_func)(void *,int,const char *,int,int)
|
||||||
|
= CRYPTO_dbg_malloc;
|
||||||
|
static void (*realloc_debug_func)(void *,void *,int,const char *,int,int)
|
||||||
|
= CRYPTO_dbg_realloc;
|
||||||
|
static void (*free_debug_func)(void *,int) = CRYPTO_dbg_free;
|
||||||
|
static void (*set_debug_options_func)(long) = CRYPTO_dbg_set_options;
|
||||||
|
static long (*get_debug_options_func)(void) = CRYPTO_dbg_get_options;
|
||||||
|
|
||||||
|
|
||||||
|
mem_dbg.c
|
||||||
|
===========================================
|
||||||
|
static int mh_mode=CRYPTO_MEM_CHECK_OFF;
|
||||||
|
static unsigned long order = 0; /* number of memory requests */
|
||||||
|
static LHASH *mh=NULL; /* hash-table of memory requests (address as key) */
|
||||||
|
|
||||||
|
static LHASH *amih=NULL; /* hash-table with those app_mem_info_st's */
|
||||||
|
static long options = /* extra information to be recorded */
|
||||||
|
static unsigned long disabling_thread = 0;
|
||||||
|
|
||||||
|
|
||||||
|
err.c
|
||||||
|
===========================================
|
||||||
|
static LHASH *error_hash=NULL;
|
||||||
|
static LHASH *thread_hash=NULL;
|
||||||
|
|
||||||
|
several files have routines with static "init" to track if error strings
|
||||||
|
have been loaded ( may not want seperate error strings for each process )
|
||||||
|
The "init" variable can't be left "global" because the error has is a ptr
|
||||||
|
that is malloc'ed. The malloc'ed error has is dependant on the "init"
|
||||||
|
vars.
|
||||||
|
|
||||||
|
files:
|
||||||
|
pem_err.c
|
||||||
|
cpt_err.c
|
||||||
|
pk12err.c
|
||||||
|
asn1_err.c
|
||||||
|
bio_err.c
|
||||||
|
bn_err.c
|
||||||
|
buf_err.c
|
||||||
|
comp_err.c
|
||||||
|
conf_err.c
|
||||||
|
cpt_err.c
|
||||||
|
dh_err.c
|
||||||
|
dsa_err.c
|
||||||
|
dso_err.c
|
||||||
|
evp_err.c
|
||||||
|
obj_err.c
|
||||||
|
pkcs7err.c
|
||||||
|
rand_err.c
|
||||||
|
rsa_err.c
|
||||||
|
rsar_err.c
|
||||||
|
ssl_err.c
|
||||||
|
x509_err.c
|
||||||
|
v3err.c
|
||||||
|
err.c
|
||||||
|
|
||||||
|
These file have similar "init" globals but they are for other stuff not
|
||||||
|
error strings:
|
||||||
|
|
||||||
|
bn_lib.c
|
||||||
|
ecc_enc.c
|
||||||
|
s23_clnt.c
|
||||||
|
s23_meth.c
|
||||||
|
s23_srvr.c
|
||||||
|
s2_clnt.c
|
||||||
|
s2_lib.c
|
||||||
|
s2_meth.c
|
||||||
|
s2_srvr.c
|
||||||
|
s3_clnt.c
|
||||||
|
s3_lib.c
|
||||||
|
s3_srvr.c
|
||||||
|
t1_clnt.c
|
||||||
|
t1_meth.c
|
||||||
|
t1_srvr.c
|
||||||
|
|
||||||
|
rand_lib.c
|
||||||
|
===========================================
|
||||||
|
static RAND_METHOD *rand_meth= &rand_ssleay_meth;
|
||||||
|
|
||||||
|
md_rand.c
|
||||||
|
===========================================
|
||||||
|
static int state_num=0,state_index=0;
|
||||||
|
static unsigned char state[STATE_SIZE+MD_DIGEST_LENGTH];
|
||||||
|
static unsigned char md[MD_DIGEST_LENGTH];
|
||||||
|
static long md_count[2]={0,0};
|
||||||
|
static double entropy=0;
|
||||||
|
static int initialized=0;
|
||||||
|
|
||||||
|
/* This should be set to 1 only when ssleay_rand_add() is called inside
|
||||||
|
an already locked state, so it doesn't try to lock and thereby cause
|
||||||
|
a hang. And it should always be reset back to 0 before unlocking. */
|
||||||
|
static int add_do_not_lock=0;
|
||||||
|
|
||||||
|
obj_dat.c
|
||||||
|
============================================
|
||||||
|
static int new_nid=NUM_NID;
|
||||||
|
static LHASH *added=NULL;
|
||||||
|
|
||||||
|
b_sock.c
|
||||||
|
===========================================
|
||||||
|
static unsigned long BIO_ghbn_hits=0L;
|
||||||
|
static unsigned long BIO_ghbn_miss=0L;
|
||||||
|
static struct ghbn_cache_st
|
||||||
|
{
|
||||||
|
char name[129];
|
||||||
|
struct hostent *ent;
|
||||||
|
unsigned long order;
|
||||||
|
} ghbn_cache[GHBN_NUM];
|
||||||
|
|
||||||
|
static int wsa_init_done=0;
|
||||||
|
|
||||||
|
|
||||||
|
bio_lib.c
|
||||||
|
===========================================
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *bio_meth=NULL;
|
||||||
|
static int bio_meth_num=0;
|
||||||
|
|
||||||
|
|
||||||
|
bn_lib.c
|
||||||
|
========================================
|
||||||
|
static int bn_limit_bits=0;
|
||||||
|
static int bn_limit_num=8; /* (1<<bn_limit_bits) */
|
||||||
|
static int bn_limit_bits_low=0;
|
||||||
|
static int bn_limit_num_low=8; /* (1<<bn_limit_bits_low) */
|
||||||
|
static int bn_limit_bits_high=0;
|
||||||
|
static int bn_limit_num_high=8; /* (1<<bn_limit_bits_high) */
|
||||||
|
static int bn_limit_bits_mont=0;
|
||||||
|
static int bn_limit_num_mont=8; /* (1<<bn_limit_bits_mont) */
|
||||||
|
|
||||||
|
conf_lib.c
|
||||||
|
========================================
|
||||||
|
static CONF_METHOD *default_CONF_method=NULL;
|
||||||
|
|
||||||
|
dh_lib.c
|
||||||
|
========================================
|
||||||
|
static DH_METHOD *default_DH_method;
|
||||||
|
static int dh_meth_num = 0;
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;
|
||||||
|
|
||||||
|
dsa_lib.c
|
||||||
|
========================================
|
||||||
|
static DSA_METHOD *default_DSA_method;
|
||||||
|
static int dsa_meth_num = 0;
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;
|
||||||
|
|
||||||
|
dso_lib.c
|
||||||
|
========================================
|
||||||
|
static DSO_METHOD *default_DSO_meth = NULL;
|
||||||
|
|
||||||
|
rsa_lib.c
|
||||||
|
========================================
|
||||||
|
static RSA_METHOD *default_RSA_meth=NULL;
|
||||||
|
static int rsa_meth_num=0;
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *rsa_meth=NULL;
|
||||||
|
|
||||||
|
x509_trs.c
|
||||||
|
=======================================
|
||||||
|
static int (*default_trust)(int id, X509 *x, int flags) = obj_trust;
|
||||||
|
static STACK_OF(X509_TRUST) *trtable = NULL;
|
||||||
|
|
||||||
|
x509_req.c
|
||||||
|
=======================================
|
||||||
|
static int *ext_nids = ext_nid_list;
|
||||||
|
|
||||||
|
o_names.c
|
||||||
|
======================================
|
||||||
|
static LHASH *names_lh=NULL;
|
||||||
|
static STACK_OF(NAME_FUNCS) *name_funcs_stack;
|
||||||
|
static int free_type;
|
||||||
|
static int names_type_num=OBJ_NAME_TYPE_NUM;
|
||||||
|
|
||||||
|
|
||||||
|
th-lock.c - NEED to add support for locking for NetWare
|
||||||
|
==============================================
|
||||||
|
static long *lock_count;
|
||||||
|
(other platform specific globals)
|
||||||
|
|
||||||
|
x_x509.c
|
||||||
|
==============================================
|
||||||
|
static int x509_meth_num = 0;
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
evp_pbe.c
|
||||||
|
============================================
|
||||||
|
static STACK *pbe_algs;
|
||||||
|
|
||||||
|
evp_key.c
|
||||||
|
============================================
|
||||||
|
static char prompt_string[80];
|
||||||
|
|
||||||
|
ssl_ciph.c
|
||||||
|
============================================
|
||||||
|
static STACK_OF(SSL_COMP) *ssl_comp_methods=NULL;
|
||||||
|
|
||||||
|
ssl_lib.c
|
||||||
|
=============================================
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_meth=NULL;
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_ctx_meth=NULL;
|
||||||
|
static int ssl_meth_num=0;
|
||||||
|
static int ssl_ctx_meth_num=0;
|
||||||
|
|
||||||
|
ssl_sess.c
|
||||||
|
=============================================
|
||||||
|
static int ssl_session_num=0;
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_session_meth=NULL;
|
||||||
|
|
||||||
|
x509_vfy.c
|
||||||
|
============================================
|
||||||
|
static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_ctx_method=NULL;
|
||||||
|
static int x509_store_ctx_num=0;
|
||||||
|
|
||||||
19
Netware/readme.txt
Normal file
19
Netware/readme.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
Contents of the openssl\netware directory
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
Regular files:
|
||||||
|
|
||||||
|
readme.txt - this file
|
||||||
|
do_tests.pl - perl script used to run the OpenSSL tests on NetWare
|
||||||
|
cpy_tests.bat - batch to to copy test stuff to NetWare server
|
||||||
|
build.bat - batch file to help with builds
|
||||||
|
set_env.bat - batch file to help setup build environments
|
||||||
|
globals.txt - results of initial code review to identify OpenSSL global variables
|
||||||
|
|
||||||
|
|
||||||
|
The following files are generated by the various scripts. They are
|
||||||
|
recreated each time and it is okay to delete them.
|
||||||
|
|
||||||
|
*.def - command files used by Metrowerks linker
|
||||||
|
*.mak - make files generated by mk1mf.pl
|
||||||
90
Netware/set_env.bat
Normal file
90
Netware/set_env.bat
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem ========================================================================
|
||||||
|
rem Batch file to assist in setting up the necessary enviroment for
|
||||||
|
rem building OpenSSL for NetWare.
|
||||||
|
rem
|
||||||
|
rem usage:
|
||||||
|
rem set_env [target]
|
||||||
|
rem
|
||||||
|
rem target - "netware-clib" - Clib build
|
||||||
|
rem - "netware-libc" - LibC build
|
||||||
|
rem
|
||||||
|
rem
|
||||||
|
|
||||||
|
if "a%1" == "a" goto usage
|
||||||
|
|
||||||
|
set LIBC_BUILD=
|
||||||
|
set CLIB_BUILD=
|
||||||
|
|
||||||
|
if "%1" == "netware-clib" set CLIB_BUILD=Y
|
||||||
|
if "%1" == "netware-clib" set LIBC_BUILD=
|
||||||
|
|
||||||
|
if "%1" == "netware-libc" set LIBC_BUILD=Y
|
||||||
|
if "%1" == "netware-libc" set CLIB_BUILD=
|
||||||
|
|
||||||
|
rem Location of tools (compiler, linker, etc)
|
||||||
|
set TOOLS=d:\i_drive\tools
|
||||||
|
|
||||||
|
rem If Perl for Win32 is not already in your path, add it here
|
||||||
|
set PERL_PATH=
|
||||||
|
|
||||||
|
rem Define path to the Metrowerks command line tools
|
||||||
|
rem ( compiler, assembler, linker)
|
||||||
|
set METROWERKS_PATH=%TOOLS%\codewar\pdk_21\tools\command line tools
|
||||||
|
rem set METROWERKS_PATH=%TOOLS%\codewar\PDK_40\Other Metrowerks Tools\Command Line Tools
|
||||||
|
|
||||||
|
rem If using gnu make define path to utility
|
||||||
|
set GNU_MAKE_PATH=%TOOLS%\gnu
|
||||||
|
|
||||||
|
rem If using ms nmake define path to nmake
|
||||||
|
set MS_NMAKE_PATH=%TOOLS%\msvc\600\bin
|
||||||
|
|
||||||
|
rem If using NASM assembler define path
|
||||||
|
set NASM_PATH=%TOOLS%\nasm
|
||||||
|
|
||||||
|
rem Update path to include tool paths
|
||||||
|
set path=%path%;%METROWERKS_PATH%
|
||||||
|
if not "%GNU_MAKE_PATH%" == "" set path=%path%;%GNU_MAKE_PATH%
|
||||||
|
if not "%MS_NMAKE_PATH%" == "" set path=%path%;%MS_NMAKE_PATH%
|
||||||
|
if not "%NASM_PATH%" == "" set path=%path%;%NASM_PATH%
|
||||||
|
if not "%PERL_PATH%" == "" set path=%path%;%PERL_PATH%
|
||||||
|
|
||||||
|
rem Set MWCIncludes to location of Novell NDK includes
|
||||||
|
if "%LIBC_BUILD%" == "Y" set MWCIncludes=%TOOLS%\ndk\libc\include;%TOOLS%\ndk\libc\include\winsock;.\engines
|
||||||
|
if "%CLIB_BUILD%" == "Y" set MWCIncludes=%TOOLS%\ndk\nwsdk\include\nlm;.\engines
|
||||||
|
set include=
|
||||||
|
|
||||||
|
rem Set Imports to location of Novell NDK import files
|
||||||
|
if "%LIBC_BUILD%" == "Y" set IMPORTS=%TOOLS%\ndk\libc\imports
|
||||||
|
if "%CLIB_BUILD%" == "Y" set IMPORTS=%TOOLS%\ndk\nwsdk\imports
|
||||||
|
|
||||||
|
rem Set PRELUDE to the absolute path of the prelude object to link with in
|
||||||
|
rem the Metrowerks NetWare PDK - NOTE: for Clib builds "nwpre.obj" is
|
||||||
|
rem recommended, for LibC NKS builds libcpre.o must be used
|
||||||
|
if "%LIBC_BUILD%" == "Y" set PRELUDE=%TOOLS%\ndk\libc\imports\libcpre.o
|
||||||
|
if "%CLIB_BUILD%" == "Y" set PRELUDE=%TOOLS%\codewar\pdk_21\novell support\metrowerks support\libraries\runtime\nwpre.obj
|
||||||
|
|
||||||
|
|
||||||
|
if "%LIBC_BUILD%" == "Y" echo Enviroment configured for LibC build
|
||||||
|
if "%LIBC_BUILD%" == "Y" echo use "netware\build.bat netware-libc ..."
|
||||||
|
|
||||||
|
if "%CLIB_BUILD%" == "Y" echo Enviroment configured for CLib build
|
||||||
|
if "%CLIB_BUILD%" == "Y" echo use "netware\build.bat netware-clib ..."
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:usage
|
||||||
|
rem ===============================================================
|
||||||
|
echo .
|
||||||
|
echo . No target build specified!
|
||||||
|
echo .
|
||||||
|
echo . usage: set_env [target]
|
||||||
|
echo .
|
||||||
|
echo . target - "netware-clib" - Clib build
|
||||||
|
echo . - "netware-libc" - LibC build
|
||||||
|
echo .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
:end
|
||||||
|
|
||||||
83
PROBLEMS
83
PROBLEMS
@@ -46,3 +46,86 @@ scripts use the same name for output and input files, which means different
|
|||||||
will interfere with each other and lead to test failure.
|
will interfere with each other and lead to test failure.
|
||||||
|
|
||||||
The solution is simple for now: don't run parallell make when testing.
|
The solution is simple for now: don't run parallell make when testing.
|
||||||
|
|
||||||
|
|
||||||
|
* Bugs in gcc 3.0 triggered
|
||||||
|
|
||||||
|
According to a problem report, there are bugs in gcc 3.0 that are
|
||||||
|
triggered by some of the code in OpenSSL, more specifically in
|
||||||
|
PEM_get_EVP_CIPHER_INFO(). The triggering code is the following:
|
||||||
|
|
||||||
|
header+=11;
|
||||||
|
if (*header != '4') return(0); header++;
|
||||||
|
if (*header != ',') return(0); header++;
|
||||||
|
|
||||||
|
What happens is that gcc might optimize a little too agressively, and
|
||||||
|
you end up with an extra incrementation when *header != '4'.
|
||||||
|
|
||||||
|
We recommend that you upgrade gcc to as high a 3.x version as you can.
|
||||||
|
|
||||||
|
* solaris64-sparcv9-cc SHA-1 performance with WorkShop 6 compiler.
|
||||||
|
|
||||||
|
As subject suggests SHA-1 might perform poorly (4 times slower)
|
||||||
|
if compiled with WorkShop 6 compiler and -xarch=v9. The cause for
|
||||||
|
this seems to be the fact that compiler emits multiplication to
|
||||||
|
perform shift operations:-( To work the problem around configure
|
||||||
|
with './Configure solaris64-sparcv9-cc -DMD32_REG_T=int'.
|
||||||
|
|
||||||
|
* Problems with hp-parisc2-cc target when used with "no-asm" flag
|
||||||
|
|
||||||
|
When using the hp-parisc2-cc target, wrong bignum code is generated.
|
||||||
|
This is due to the SIXTY_FOUR_BIT build being compiled with the +O3
|
||||||
|
aggressive optimization.
|
||||||
|
The problem manifests itself by the BN_kronecker test hanging in an
|
||||||
|
endless loop. Reason: the BN_kronecker test calls BN_generate_prime()
|
||||||
|
which itself hangs. The reason could be tracked down to the bn_mul_comba8()
|
||||||
|
function in bn_asm.c. At some occasions the higher 32bit value of r[7]
|
||||||
|
is off by 1 (meaning: calculated=shouldbe+1). Further analysis failed,
|
||||||
|
as no debugger support possible at +O3 and additional fprintf()'s
|
||||||
|
introduced fixed the bug, therefore it is most likely a bug in the
|
||||||
|
optimizer.
|
||||||
|
The bug was found in the BN_kronecker test but may also lead to
|
||||||
|
failures in other parts of the code.
|
||||||
|
(See Ticket #426.)
|
||||||
|
|
||||||
|
Workaround: modify the target to +O2 when building with no-asm.
|
||||||
|
|
||||||
|
* Poor support for AIX shared builds.
|
||||||
|
|
||||||
|
do_aix-shared rule is not flexible enough to parameterize through a
|
||||||
|
config-line. './Configure aix43-cc shared' is working, but not
|
||||||
|
'./Configure aix64-gcc shared'. In latter case make fails to create shared
|
||||||
|
libraries. It's possible to build 64-bit shared libraries by running
|
||||||
|
'env OBJECT_MODE=64 make', but we need more elegant solution. Preferably one
|
||||||
|
supporting even gcc shared builds. See RT#463 for background information.
|
||||||
|
|
||||||
|
* Problems building shared libraries on SCO OpenServer Release 5.0.6
|
||||||
|
with gcc 2.95.3
|
||||||
|
|
||||||
|
The symptoms appear when running the test suite, more specifically
|
||||||
|
test/ectest, with the following result:
|
||||||
|
|
||||||
|
OSSL_LIBPATH="`cd ..; pwd`"; LD_LIBRARY_PATH="$OSSL_LIBPATH:$LD_LIBRARY_PATH"; DYLD_LIBRARY_PATH="$OSSL_LIBPATH:$DYLD_LIBRARY_PATH"; SHLIB_PATH="$OSSL_LIBPATH:$SHLIB_PATH"; LIBPATH="$OSSL_LIBPATH:$LIBPATH"; if [ "debug-sco5-gcc" = "Cygwin" ]; then PATH="${LIBPATH}:$PATH"; fi; export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; ./ectest
|
||||||
|
ectest.c:186: ABORT
|
||||||
|
|
||||||
|
The cause of the problem seems to be that isxdigit(), called from
|
||||||
|
BN_hex2bn(), returns 0 on a perfectly legitimate hex digit. Further
|
||||||
|
investigation shows that any of the isxxx() macros return 0 on any
|
||||||
|
input. A direct look in the information array that the isxxx() use,
|
||||||
|
called __ctype, shows that it contains all zeroes...
|
||||||
|
|
||||||
|
Taking a look at the newly created libcrypto.so with nm, one can see
|
||||||
|
that the variable __ctype is defined in libcrypto's .bss (which
|
||||||
|
explains why it is filled with zeroes):
|
||||||
|
|
||||||
|
$ nm -Pg libcrypto.so | grep __ctype
|
||||||
|
__ctype B 0011659c
|
||||||
|
__ctype2 U
|
||||||
|
|
||||||
|
Curiously, __ctype2 is undefined, in spite of being declared in
|
||||||
|
/usr/include/ctype.h in exactly the same way as __ctype.
|
||||||
|
|
||||||
|
Any information helping to solve this issue would be deeply
|
||||||
|
appreciated.
|
||||||
|
|
||||||
|
NOTE: building non-shared doesn't come with this problem.
|
||||||
|
|||||||
1
README
1
README
@@ -185,3 +185,4 @@
|
|||||||
# ./Configure dist; make clean
|
# ./Configure dist; make clean
|
||||||
# cd ..
|
# cd ..
|
||||||
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
||||||
|
|
||||||
|
|||||||
34
STATUS
34
STATUS
@@ -1,15 +1,14 @@
|
|||||||
|
|
||||||
OpenSSL STATUS Last modified at
|
OpenSSL STATUS Last modified at
|
||||||
______________ $Date: 2002/11/21 22:39:08 $
|
______________ $Date: 2003/02/28 15:17:45 $
|
||||||
|
|
||||||
DEVELOPMENT STATE
|
DEVELOPMENT STATE
|
||||||
|
|
||||||
o OpenSSL 0.9.8: Under development...
|
o OpenSSL 0.9.8: Under development...
|
||||||
o OpenSSL 0.9.7-beta4: Released on November 19th, 2002
|
o OpenSSL 0.9.7a: Released on February 19th, 2003
|
||||||
Debian GNU/Linux (kernel version 2.4.19, gcc 2.95.4) - PASSED
|
o OpenSSL 0.9.7: Released on December 31st, 2002
|
||||||
o OpenSSL 0.9.7-beta3: Released on July 30th, 2002
|
o OpenSSL 0.9.6i: Released on February 19th, 2003
|
||||||
o OpenSSL 0.9.7-beta2: Released on June 16th, 2002
|
o OpenSSL 0.9.6h: Released on December 5th, 2002
|
||||||
o OpenSSL 0.9.7-beta1: Released on June 1st, 2002
|
|
||||||
o OpenSSL 0.9.6g: Released on August 9th, 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.6f: Released on August 8th, 2002
|
||||||
o OpenSSL 0.9.6e: Released on July 30th, 2002
|
o OpenSSL 0.9.6e: Released on July 30th, 2002
|
||||||
@@ -30,20 +29,7 @@
|
|||||||
|
|
||||||
RELEASE SHOWSTOPPERS
|
RELEASE SHOWSTOPPERS
|
||||||
|
|
||||||
o BN_mod_mul verification fails for mips3-sgi-irix
|
o
|
||||||
unless configured with no-asm
|
|
||||||
|
|
||||||
o [2002-11-21]
|
|
||||||
PR 343 mentions that scrubbing memory with 'memset(ptr, 0, n)' may
|
|
||||||
be optimized away in modern compilers. This is definitely not good
|
|
||||||
and needs to be fixed immediately. The formula to use is presented
|
|
||||||
in:
|
|
||||||
|
|
||||||
http://online.securityfocus.com/archive/82/297918/2002-10-27/2002-11-02/0
|
|
||||||
|
|
||||||
The problem report that mentions this is:
|
|
||||||
|
|
||||||
https://www.aet.TU-Cottbus.DE/rt2/Ticket/Display.html?id=343
|
|
||||||
|
|
||||||
AVAILABLE PATCHES
|
AVAILABLE PATCHES
|
||||||
|
|
||||||
@@ -66,9 +52,13 @@
|
|||||||
UTIL (a new set of library functions to support some higher level
|
UTIL (a new set of library functions to support some higher level
|
||||||
functionality that is currently missing).
|
functionality that is currently missing).
|
||||||
Shared library support for VMS.
|
Shared library support for VMS.
|
||||||
Kerberos 5 authentication
|
Kerberos 5 authentication (Heimdal)
|
||||||
Constification
|
Constification
|
||||||
OCSP
|
Compression
|
||||||
|
Attribute Certificate support
|
||||||
|
Certificate Pair support
|
||||||
|
Storage Engines (primarly an LDAP storage engine)
|
||||||
|
Certificate chain validation with full RFC 3280 compatibility
|
||||||
|
|
||||||
NEEDS PATCH
|
NEEDS PATCH
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
# demoCA ... where everything is stored
|
# demoCA ... where everything is stored
|
||||||
|
|
||||||
$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"};
|
$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"};
|
||||||
$DAYS="-days 365";
|
$DAYS="-days 365"; # 1 year
|
||||||
|
$CADAYS="-days 1095"; # 3 years
|
||||||
$REQ="openssl req $SSLEAY_CONFIG";
|
$REQ="openssl req $SSLEAY_CONFIG";
|
||||||
$CA="openssl ca $SSLEAY_CONFIG";
|
$CA="openssl ca $SSLEAY_CONFIG";
|
||||||
$VERIFY="openssl verify";
|
$VERIFY="openssl verify";
|
||||||
@@ -46,6 +47,7 @@ $PKCS12="openssl pkcs12";
|
|||||||
|
|
||||||
$CATOP="./demoCA";
|
$CATOP="./demoCA";
|
||||||
$CAKEY="cakey.pem";
|
$CAKEY="cakey.pem";
|
||||||
|
$CAREQ="careq.pem";
|
||||||
$CACERT="cacert.pem";
|
$CACERT="cacert.pem";
|
||||||
|
|
||||||
$DIRMODE = 0777;
|
$DIRMODE = 0777;
|
||||||
@@ -101,8 +103,11 @@ foreach (@ARGV) {
|
|||||||
$RET=$?;
|
$RET=$?;
|
||||||
} else {
|
} else {
|
||||||
print "Making CA certificate ...\n";
|
print "Making CA certificate ...\n";
|
||||||
system ("$REQ -new -x509 -keyout " .
|
system ("$REQ -new -keyout " .
|
||||||
"${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT $DAYS");
|
"${CATOP}/private/$CAKEY -out ${CATOP}/$CAREQ");
|
||||||
|
system ("$CA -out ${CATOP}/$CACERT $CADAYS -batch " .
|
||||||
|
"-keyfile ${CATOP}/private/$CAKEY -selfsign " .
|
||||||
|
"-infiles ${CATOP}/$CAREQ ");
|
||||||
$RET=$?;
|
$RET=$?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
apps/CA.sh
13
apps/CA.sh
@@ -30,7 +30,8 @@
|
|||||||
# default openssl.cnf file has setup as per the following
|
# default openssl.cnf file has setup as per the following
|
||||||
# demoCA ... where everything is stored
|
# demoCA ... where everything is stored
|
||||||
|
|
||||||
DAYS="-days 365"
|
DAYS="-days 365" # 1 year
|
||||||
|
CADAYS="-days 1095" # 3 years
|
||||||
REQ="openssl req $SSLEAY_CONFIG"
|
REQ="openssl req $SSLEAY_CONFIG"
|
||||||
CA="openssl ca $SSLEAY_CONFIG"
|
CA="openssl ca $SSLEAY_CONFIG"
|
||||||
VERIFY="openssl verify"
|
VERIFY="openssl verify"
|
||||||
@@ -38,6 +39,7 @@ X509="openssl x509"
|
|||||||
|
|
||||||
CATOP=./demoCA
|
CATOP=./demoCA
|
||||||
CAKEY=./cakey.pem
|
CAKEY=./cakey.pem
|
||||||
|
CAREQ=./careq.pem
|
||||||
CACERT=./cacert.pem
|
CACERT=./cacert.pem
|
||||||
|
|
||||||
for i
|
for i
|
||||||
@@ -70,7 +72,7 @@ case $i in
|
|||||||
mkdir ${CATOP}/crl
|
mkdir ${CATOP}/crl
|
||||||
mkdir ${CATOP}/newcerts
|
mkdir ${CATOP}/newcerts
|
||||||
mkdir ${CATOP}/private
|
mkdir ${CATOP}/private
|
||||||
echo "01" > ${CATOP}/serial
|
echo "00" > ${CATOP}/serial
|
||||||
touch ${CATOP}/index.txt
|
touch ${CATOP}/index.txt
|
||||||
fi
|
fi
|
||||||
if [ ! -f ${CATOP}/private/$CAKEY ]; then
|
if [ ! -f ${CATOP}/private/$CAKEY ]; then
|
||||||
@@ -83,8 +85,11 @@ case $i in
|
|||||||
RET=$?
|
RET=$?
|
||||||
else
|
else
|
||||||
echo "Making CA certificate ..."
|
echo "Making CA certificate ..."
|
||||||
$REQ -new -x509 -keyout ${CATOP}/private/$CAKEY \
|
$REQ -new -keyout ${CATOP}/private/$CAKEY \
|
||||||
-out ${CATOP}/$CACERT $DAYS
|
-out ${CATOP}/$CAREQ
|
||||||
|
$CA -out ${CATOP}/$CACERT $CADAYS -batch \
|
||||||
|
-keyfile ${CATOP}/private/$CAKEY -selfsign \
|
||||||
|
-infiles ${CATOP}/$CAREQ
|
||||||
RET=$?
|
RET=$?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
1243
apps/Makefile.ssl
1243
apps/Makefile.ssl
File diff suppressed because it is too large
Load Diff
776
apps/apps.c
776
apps/apps.c
@@ -122,26 +122,14 @@
|
|||||||
#include <openssl/pkcs12.h>
|
#include <openssl/pkcs12.h>
|
||||||
#include <openssl/ui.h>
|
#include <openssl/ui.h>
|
||||||
#include <openssl/safestack.h>
|
#include <openssl/safestack.h>
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
|
||||||
#define strcasecmp _stricmp
|
|
||||||
#else
|
|
||||||
# ifdef NO_STRINGS_H
|
|
||||||
int strcasecmp();
|
|
||||||
# else
|
|
||||||
# include <strings.h>
|
|
||||||
# endif /* NO_STRINGS_H */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NON_MAIN
|
#define NON_MAIN
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#undef NON_MAIN
|
#undef NON_MAIN
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
|
||||||
# include "bss_file.c"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char *name;
|
||||||
unsigned long flag;
|
unsigned long flag;
|
||||||
@@ -262,7 +250,7 @@ int str2fmt(char *s)
|
|||||||
return(FORMAT_UNDEF);
|
return(FORMAT_UNDEF);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
|
#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_NETWARE)
|
||||||
void program_name(char *in, char *out, int size)
|
void program_name(char *in, char *out, int size)
|
||||||
{
|
{
|
||||||
int i,n;
|
int i,n;
|
||||||
@@ -281,12 +269,23 @@ void program_name(char *in, char *out, int size)
|
|||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
p=in;
|
p=in;
|
||||||
n=strlen(p);
|
n=strlen(p);
|
||||||
|
|
||||||
|
#if defined(OPENSSL_SYS_NETWARE)
|
||||||
|
/* strip off trailing .nlm if present. */
|
||||||
|
if ((n > 4) && (p[n-4] == '.') &&
|
||||||
|
((p[n-3] == 'n') || (p[n-3] == 'N')) &&
|
||||||
|
((p[n-2] == 'l') || (p[n-2] == 'L')) &&
|
||||||
|
((p[n-1] == 'm') || (p[n-1] == 'M')))
|
||||||
|
n-=4;
|
||||||
|
#else
|
||||||
/* strip off trailing .exe if present. */
|
/* strip off trailing .exe if present. */
|
||||||
if ((n > 4) && (p[n-4] == '.') &&
|
if ((n > 4) && (p[n-4] == '.') &&
|
||||||
((p[n-3] == 'e') || (p[n-3] == 'E')) &&
|
((p[n-3] == 'e') || (p[n-3] == 'E')) &&
|
||||||
((p[n-2] == 'x') || (p[n-2] == 'X')) &&
|
((p[n-2] == 'x') || (p[n-2] == 'X')) &&
|
||||||
((p[n-1] == 'e') || (p[n-1] == 'E')))
|
((p[n-1] == 'e') || (p[n-1] == 'E')))
|
||||||
n-=4;
|
n-=4;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (n > size-1)
|
if (n > size-1)
|
||||||
n=size-1;
|
n=size-1;
|
||||||
|
|
||||||
@@ -380,22 +379,6 @@ int WIN32_rename(char *from, char *to)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_VMS
|
|
||||||
int VMS_strcasecmp(const char *str1, const char *str2)
|
|
||||||
{
|
|
||||||
while (*str1 && *str2)
|
|
||||||
{
|
|
||||||
int res = toupper(*str1) - toupper(*str2);
|
|
||||||
if (res) return res < 0 ? -1 : 1;
|
|
||||||
}
|
|
||||||
if (*str1)
|
|
||||||
return 1;
|
|
||||||
if (*str2)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
|
int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
|
||||||
{
|
{
|
||||||
int num,len,i;
|
int num,len,i;
|
||||||
@@ -503,7 +486,7 @@ static int ui_read(UI *ui, UI_STRING *uis)
|
|||||||
{
|
{
|
||||||
const char *password =
|
const char *password =
|
||||||
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
||||||
if (password[0] != '\0')
|
if (password && password[0] != '\0')
|
||||||
{
|
{
|
||||||
UI_set_result(ui, uis, password);
|
UI_set_result(ui, uis, password);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -527,7 +510,7 @@ static int ui_write(UI *ui, UI_STRING *uis)
|
|||||||
{
|
{
|
||||||
const char *password =
|
const char *password =
|
||||||
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
||||||
if (password[0] != '\0')
|
if (password && password[0] != '\0')
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -615,7 +598,7 @@ int password_callback(char *buf, int bufsiz, int verify,
|
|||||||
|
|
||||||
if (buff)
|
if (buff)
|
||||||
{
|
{
|
||||||
memset(buff,0,(unsigned int)bufsiz);
|
OPENSSL_cleanse(buff,(unsigned int)bufsiz);
|
||||||
OPENSSL_free(buff);
|
OPENSSL_free(buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,13 +608,13 @@ int password_callback(char *buf, int bufsiz, int verify,
|
|||||||
{
|
{
|
||||||
BIO_printf(bio_err, "User interface error\n");
|
BIO_printf(bio_err, "User interface error\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
memset(buf,0,(unsigned int)bufsiz);
|
OPENSSL_cleanse(buf,(unsigned int)bufsiz);
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
if (ok == -2)
|
if (ok == -2)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"aborted!\n");
|
BIO_printf(bio_err,"aborted!\n");
|
||||||
memset(buf,0,(unsigned int)bufsiz);
|
OPENSSL_cleanse(buf,(unsigned int)bufsiz);
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
UI_free(ui);
|
UI_free(ui);
|
||||||
@@ -775,7 +758,7 @@ X509 *load_cert(BIO *err, const char *file, int format,
|
|||||||
x=d2i_X509_bio(cert,NULL);
|
x=d2i_X509_bio(cert,NULL);
|
||||||
else if (format == FORMAT_NETSCAPE)
|
else if (format == FORMAT_NETSCAPE)
|
||||||
{
|
{
|
||||||
unsigned char *p,*op;
|
const unsigned char *p,*op;
|
||||||
int size=0,i;
|
int size=0,i;
|
||||||
|
|
||||||
/* We sort of have to do it this way because it is sort of nice
|
/* We sort of have to do it this way because it is sort of nice
|
||||||
@@ -859,6 +842,7 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
|||||||
BIO_printf(err,"no keyfile specified\n");
|
BIO_printf(err,"no keyfile specified\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (format == FORMAT_ENGINE)
|
if (format == FORMAT_ENGINE)
|
||||||
{
|
{
|
||||||
if (!e)
|
if (!e)
|
||||||
@@ -868,6 +852,7 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
|||||||
ui_method, &cb_data);
|
ui_method, &cb_data);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
key=BIO_new(BIO_s_file());
|
key=BIO_new(BIO_s_file());
|
||||||
if (key == NULL)
|
if (key == NULL)
|
||||||
{
|
{
|
||||||
@@ -935,6 +920,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
|
|||||||
BIO_printf(err,"no keyfile specified\n");
|
BIO_printf(err,"no keyfile specified\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (format == FORMAT_ENGINE)
|
if (format == FORMAT_ENGINE)
|
||||||
{
|
{
|
||||||
if (!e)
|
if (!e)
|
||||||
@@ -944,6 +930,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
|
|||||||
ui_method, &cb_data);
|
ui_method, &cb_data);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
key=BIO_new(BIO_s_file());
|
key=BIO_new(BIO_s_file());
|
||||||
if (key == NULL)
|
if (key == NULL)
|
||||||
{
|
{
|
||||||
@@ -1329,6 +1316,7 @@ X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
/* Try to load an engine in a shareable library */
|
/* Try to load an engine in a shareable library */
|
||||||
static ENGINE *try_load_engine(BIO *err, const char *engine, int debug)
|
static ENGINE *try_load_engine(BIO *err, const char *engine, int debug)
|
||||||
{
|
{
|
||||||
@@ -1385,6 +1373,7 @@ ENGINE *setup_engine(BIO *err, const char *engine, int debug)
|
|||||||
}
|
}
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int load_config(BIO *err, CONF *cnf)
|
int load_config(BIO *err, CONF *cnf)
|
||||||
{
|
{
|
||||||
@@ -1407,14 +1396,721 @@ int load_config(BIO *err, CONF *cnf)
|
|||||||
char *make_config_name()
|
char *make_config_name()
|
||||||
{
|
{
|
||||||
const char *t=X509_get_default_cert_area();
|
const char *t=X509_get_default_cert_area();
|
||||||
|
size_t len;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p=OPENSSL_malloc(strlen(t)+strlen(OPENSSL_CONF)+2);
|
len=strlen(t)+strlen(OPENSSL_CONF)+2;
|
||||||
strcpy(p,t);
|
p=OPENSSL_malloc(len);
|
||||||
|
BUF_strlcpy(p,t,len);
|
||||||
#ifndef OPENSSL_SYS_VMS
|
#ifndef OPENSSL_SYS_VMS
|
||||||
strcat(p,"/");
|
BUF_strlcat(p,"/",len);
|
||||||
#endif
|
#endif
|
||||||
strcat(p,OPENSSL_CONF);
|
BUF_strlcat(p,OPENSSL_CONF,len);
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned long index_serial_hash(const char **a)
|
||||||
|
{
|
||||||
|
const char *n;
|
||||||
|
|
||||||
|
n=a[DB_serial];
|
||||||
|
while (*n == '0') n++;
|
||||||
|
return(lh_strhash(n));
|
||||||
|
}
|
||||||
|
|
||||||
|
static int index_serial_cmp(const char **a, const char **b)
|
||||||
|
{
|
||||||
|
const char *aa,*bb;
|
||||||
|
|
||||||
|
for (aa=a[DB_serial]; *aa == '0'; aa++);
|
||||||
|
for (bb=b[DB_serial]; *bb == '0'; bb++);
|
||||||
|
return(strcmp(aa,bb));
|
||||||
|
}
|
||||||
|
|
||||||
|
static int index_name_qual(char **a)
|
||||||
|
{ return(a[0][0] == 'V'); }
|
||||||
|
|
||||||
|
static unsigned long index_name_hash(const char **a)
|
||||||
|
{ return(lh_strhash(a[DB_name])); }
|
||||||
|
|
||||||
|
int index_name_cmp(const char **a, const char **b)
|
||||||
|
{ return(strcmp(a[DB_name],
|
||||||
|
b[DB_name])); }
|
||||||
|
|
||||||
|
static IMPLEMENT_LHASH_HASH_FN(index_serial_hash,const char **)
|
||||||
|
static IMPLEMENT_LHASH_COMP_FN(index_serial_cmp,const char **)
|
||||||
|
static IMPLEMENT_LHASH_HASH_FN(index_name_hash,const char **)
|
||||||
|
static IMPLEMENT_LHASH_COMP_FN(index_name_cmp,const char **)
|
||||||
|
|
||||||
|
#undef BSIZE
|
||||||
|
#define BSIZE 256
|
||||||
|
|
||||||
|
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
|
||||||
|
{
|
||||||
|
BIO *in=NULL;
|
||||||
|
BIGNUM *ret=NULL;
|
||||||
|
MS_STATIC char buf[1024];
|
||||||
|
ASN1_INTEGER *ai=NULL;
|
||||||
|
|
||||||
|
ai=ASN1_INTEGER_new();
|
||||||
|
if (ai == NULL) goto err;
|
||||||
|
|
||||||
|
if ((in=BIO_new(BIO_s_file())) == NULL)
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BIO_read_filename(in,serialfile) <= 0)
|
||||||
|
{
|
||||||
|
if (!create)
|
||||||
|
{
|
||||||
|
perror(serialfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ASN1_INTEGER_set(ai,1);
|
||||||
|
ret=BN_new();
|
||||||
|
if (ret == NULL)
|
||||||
|
BIO_printf(bio_err, "Out of memory\n");
|
||||||
|
else
|
||||||
|
BN_one(ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!a2i_ASN1_INTEGER(in,ai,buf,1024))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unable to load number from %s\n",
|
||||||
|
serialfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
ret=ASN1_INTEGER_to_BN(ai,NULL);
|
||||||
|
if (ret == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"error converting number from bin to BIGNUM\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret && retai)
|
||||||
|
{
|
||||||
|
*retai = ai;
|
||||||
|
ai = NULL;
|
||||||
|
}
|
||||||
|
err:
|
||||||
|
if (in != NULL) BIO_free(in);
|
||||||
|
if (ai != NULL) ASN1_INTEGER_free(ai);
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai)
|
||||||
|
{
|
||||||
|
char buf[1][BSIZE];
|
||||||
|
BIO *out = NULL;
|
||||||
|
int ret=0;
|
||||||
|
ASN1_INTEGER *ai=NULL;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
if (suffix == NULL)
|
||||||
|
j = strlen(serialfile);
|
||||||
|
else
|
||||||
|
j = strlen(serialfile) + strlen(suffix) + 1;
|
||||||
|
if (j >= BSIZE)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"file name too long\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (suffix == NULL)
|
||||||
|
BUF_strlcpy(buf[0], serialfile, BSIZE);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, suffix);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
|
||||||
|
#endif
|
||||||
|
out=BIO_new(BIO_s_file());
|
||||||
|
if (out == NULL)
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if (BIO_write_filename(out,buf[0]) <= 0)
|
||||||
|
{
|
||||||
|
perror(serialfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((ai=BN_to_ASN1_INTEGER(serial,NULL)) == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"error converting serial to ASN.1 format\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
i2a_ASN1_INTEGER(out,ai);
|
||||||
|
BIO_puts(out,"\n");
|
||||||
|
ret=1;
|
||||||
|
if (retai)
|
||||||
|
{
|
||||||
|
*retai = ai;
|
||||||
|
ai = NULL;
|
||||||
|
}
|
||||||
|
err:
|
||||||
|
if (out != NULL) BIO_free_all(out);
|
||||||
|
if (ai != NULL) ASN1_INTEGER_free(ai);
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix)
|
||||||
|
{
|
||||||
|
char buf[5][BSIZE];
|
||||||
|
int i,j;
|
||||||
|
struct stat sb;
|
||||||
|
|
||||||
|
i = strlen(serialfile) + strlen(old_suffix);
|
||||||
|
j = strlen(serialfile) + strlen(new_suffix);
|
||||||
|
if (i > j) j = i;
|
||||||
|
if (j + 1 >= BSIZE)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"file name too long\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s",
|
||||||
|
serialfile, new_suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s",
|
||||||
|
serialfile, new_suffix);
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s",
|
||||||
|
serialfile, old_suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s",
|
||||||
|
serialfile, old_suffix);
|
||||||
|
#endif
|
||||||
|
if (stat(serialfile,&sb) < 0)
|
||||||
|
{
|
||||||
|
if (errno != ENOENT
|
||||||
|
#ifdef ENOTDIR
|
||||||
|
&& errno != ENOTDIR)
|
||||||
|
#endif
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||||
|
serialfile, buf[1]);
|
||||||
|
#endif
|
||||||
|
if (rename(serialfile,buf[1]) < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"unable to rename %s to %s\n",
|
||||||
|
serialfile, buf[1]);
|
||||||
|
perror("reason");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||||
|
buf[0],serialfile);
|
||||||
|
#endif
|
||||||
|
if (rename(buf[0],serialfile) < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"unable to rename %s to %s\n",
|
||||||
|
buf[0],serialfile);
|
||||||
|
perror("reason");
|
||||||
|
rename(buf[1],serialfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
err:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CA_DB *load_index(char *dbfile, DB_ATTR *db_attr)
|
||||||
|
{
|
||||||
|
CA_DB *retdb = NULL;
|
||||||
|
TXT_DB *tmpdb = NULL;
|
||||||
|
BIO *in = BIO_new(BIO_s_file());
|
||||||
|
CONF *dbattr_conf = NULL;
|
||||||
|
char buf[1][BSIZE];
|
||||||
|
long errorline= -1;
|
||||||
|
|
||||||
|
if (in == NULL)
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if (BIO_read_filename(in,dbfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(dbfile);
|
||||||
|
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if ((tmpdb = TXT_DB_read(in,DB_NUMBER)) == NULL)
|
||||||
|
{
|
||||||
|
if (tmpdb != NULL) TXT_DB_free(tmpdb);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
BIO_snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile);
|
||||||
|
#else
|
||||||
|
BIO_snprintf(buf[0], sizeof buf[0], "%s-attr", dbfile);
|
||||||
|
#endif
|
||||||
|
dbattr_conf = NCONF_new(NULL);
|
||||||
|
if (NCONF_load(dbattr_conf,buf[0],&errorline) <= 0)
|
||||||
|
{
|
||||||
|
if (errorline > 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"error on line %ld of db attribute file '%s'\n"
|
||||||
|
,errorline,buf[0]);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NCONF_free(dbattr_conf);
|
||||||
|
dbattr_conf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((retdb = OPENSSL_malloc(sizeof(CA_DB))) == NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Out of memory\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
retdb->db = tmpdb;
|
||||||
|
tmpdb = NULL;
|
||||||
|
if (db_attr)
|
||||||
|
retdb->attributes = *db_attr;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retdb->attributes.unique_subject = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dbattr_conf)
|
||||||
|
{
|
||||||
|
char *p = NCONF_get_string(dbattr_conf,NULL,"unique_subject");
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG[load_index]: unique_subject = \"%s\"\n", p);
|
||||||
|
#endif
|
||||||
|
retdb->attributes.unique_subject = parse_yesno(p,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
err:
|
||||||
|
if (dbattr_conf) NCONF_free(dbattr_conf);
|
||||||
|
if (tmpdb) TXT_DB_free(tmpdb);
|
||||||
|
if (in) BIO_free_all(in);
|
||||||
|
return retdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
int index_index(CA_DB *db)
|
||||||
|
{
|
||||||
|
if (!TXT_DB_create_index(db->db, DB_serial, NULL,
|
||||||
|
LHASH_HASH_FN(index_serial_hash),
|
||||||
|
LHASH_COMP_FN(index_serial_cmp)))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"error creating serial number index:(%ld,%ld,%ld)\n",
|
||||||
|
db->db->error,db->db->arg1,db->db->arg2);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (db->attributes.unique_subject
|
||||||
|
&& !TXT_DB_create_index(db->db, DB_name, index_name_qual,
|
||||||
|
LHASH_HASH_FN(index_name_hash),
|
||||||
|
LHASH_COMP_FN(index_name_cmp)))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"error creating name index:(%ld,%ld,%ld)\n",
|
||||||
|
db->db->error,db->db->arg1,db->db->arg2);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int save_index(char *dbfile, char *suffix, CA_DB *db)
|
||||||
|
{
|
||||||
|
char buf[3][BSIZE];
|
||||||
|
BIO *out = BIO_new(BIO_s_file());
|
||||||
|
int j;
|
||||||
|
|
||||||
|
if (out == NULL)
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
j = strlen(dbfile) + strlen(suffix);
|
||||||
|
if (j + 6 >= BSIZE)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"file name too long\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr", dbfile);
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-attr-%s", dbfile, suffix);
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, suffix);
|
||||||
|
#endif
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
|
||||||
|
#endif
|
||||||
|
if (BIO_write_filename(out,buf[0]) <= 0)
|
||||||
|
{
|
||||||
|
perror(dbfile);
|
||||||
|
BIO_printf(bio_err,"unable to open '%s'\n", dbfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
j=TXT_DB_write(out,db->db);
|
||||||
|
if (j <= 0) goto err;
|
||||||
|
|
||||||
|
BIO_free(out);
|
||||||
|
|
||||||
|
out = BIO_new(BIO_s_file());
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[1]);
|
||||||
|
#endif
|
||||||
|
if (BIO_write_filename(out,buf[1]) <= 0)
|
||||||
|
{
|
||||||
|
perror(buf[2]);
|
||||||
|
BIO_printf(bio_err,"unable to open '%s'\n", buf[2]);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
BIO_printf(out,"unique_subject = %s\n",
|
||||||
|
db->attributes.unique_subject ? "yes" : "no");
|
||||||
|
BIO_free(out);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
err:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
|
||||||
|
{
|
||||||
|
char buf[5][BSIZE];
|
||||||
|
int i,j;
|
||||||
|
struct stat sb;
|
||||||
|
|
||||||
|
i = strlen(dbfile) + strlen(old_suffix);
|
||||||
|
j = strlen(dbfile) + strlen(new_suffix);
|
||||||
|
if (i > j) j = i;
|
||||||
|
if (j + 6 >= BSIZE)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"file name too long\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[4], sizeof buf[4], "%s-attr", dbfile);
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr.%s",
|
||||||
|
dbfile, new_suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr-%s",
|
||||||
|
dbfile, new_suffix);
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s",
|
||||||
|
dbfile, new_suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s",
|
||||||
|
dbfile, new_suffix);
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s",
|
||||||
|
dbfile, old_suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s",
|
||||||
|
dbfile, old_suffix);
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
j = BIO_snprintf(buf[3], sizeof buf[3], "%s.attr.%s",
|
||||||
|
dbfile, old_suffix);
|
||||||
|
#else
|
||||||
|
j = BIO_snprintf(buf[3], sizeof buf[3], "%s-attr-%s",
|
||||||
|
dbfile, old_suffix);
|
||||||
|
#endif
|
||||||
|
if (stat(dbfile,&sb) < 0)
|
||||||
|
{
|
||||||
|
if (errno != ENOENT
|
||||||
|
#ifdef ENOTDIR
|
||||||
|
&& errno != ENOTDIR)
|
||||||
|
#endif
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||||
|
dbfile, buf[1]);
|
||||||
|
#endif
|
||||||
|
if (rename(dbfile,buf[1]) < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"unable to rename %s to %s\n",
|
||||||
|
dbfile, buf[1]);
|
||||||
|
perror("reason");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||||
|
buf[0],dbfile);
|
||||||
|
#endif
|
||||||
|
if (rename(buf[0],dbfile) < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"unable to rename %s to %s\n",
|
||||||
|
buf[0],dbfile);
|
||||||
|
perror("reason");
|
||||||
|
rename(buf[1],dbfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if (stat(buf[4],&sb) < 0)
|
||||||
|
{
|
||||||
|
if (errno != ENOENT
|
||||||
|
#ifdef ENOTDIR
|
||||||
|
&& errno != ENOTDIR)
|
||||||
|
#endif
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||||
|
buf[4],buf[3]);
|
||||||
|
#endif
|
||||||
|
if (rename(buf[4],buf[3]) < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"unable to rename %s to %s\n",
|
||||||
|
buf[4], buf[3]);
|
||||||
|
perror("reason");
|
||||||
|
rename(dbfile,buf[0]);
|
||||||
|
rename(buf[1],dbfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef RL_DEBUG
|
||||||
|
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||||
|
buf[2],buf[4]);
|
||||||
|
#endif
|
||||||
|
if (rename(buf[2],buf[4]) < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"unable to rename %s to %s\n",
|
||||||
|
buf[2],buf[4]);
|
||||||
|
perror("reason");
|
||||||
|
rename(buf[3],buf[4]);
|
||||||
|
rename(dbfile,buf[0]);
|
||||||
|
rename(buf[1],dbfile);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
err:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void free_index(CA_DB *db)
|
||||||
|
{
|
||||||
|
if (db)
|
||||||
|
{
|
||||||
|
if (db->db) TXT_DB_free(db->db);
|
||||||
|
OPENSSL_free(db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int parse_yesno(char *str, int def)
|
||||||
|
{
|
||||||
|
int ret = def;
|
||||||
|
if (str)
|
||||||
|
{
|
||||||
|
switch (*str)
|
||||||
|
{
|
||||||
|
case 'f': /* false */
|
||||||
|
case 'F': /* FALSE */
|
||||||
|
case 'n': /* no */
|
||||||
|
case 'N': /* NO */
|
||||||
|
case '0': /* 0 */
|
||||||
|
ret = 0;
|
||||||
|
break;
|
||||||
|
case 't': /* true */
|
||||||
|
case 'T': /* TRUE */
|
||||||
|
case 'y': /* yes */
|
||||||
|
case 'Y': /* YES */
|
||||||
|
case '1': /* 1 */
|
||||||
|
ret = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ret = def;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* subject is expected to be in the format /type0=value0/type1=value1/type2=...
|
||||||
|
* where characters may be escaped by \
|
||||||
|
*/
|
||||||
|
X509_NAME *parse_name(char *subject, long chtype, int multirdn)
|
||||||
|
{
|
||||||
|
size_t buflen = strlen(subject)+1; /* to copy the types and values into. due to escaping, the copy can only become shorter */
|
||||||
|
char *buf = OPENSSL_malloc(buflen);
|
||||||
|
size_t max_ne = buflen / 2 + 1; /* maximum number of name elements */
|
||||||
|
char **ne_types = OPENSSL_malloc(max_ne * sizeof (char *));
|
||||||
|
char **ne_values = OPENSSL_malloc(max_ne * sizeof (char *));
|
||||||
|
int *mval = OPENSSL_malloc (max_ne * sizeof (int));
|
||||||
|
|
||||||
|
char *sp = subject, *bp = buf;
|
||||||
|
int i, ne_num = 0;
|
||||||
|
|
||||||
|
X509_NAME *n = NULL;
|
||||||
|
int nid;
|
||||||
|
|
||||||
|
if (!buf || !ne_types || !ne_values)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "malloc error\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*subject != '/')
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Subject does not start with '/'.\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
sp++; /* skip leading / */
|
||||||
|
|
||||||
|
/* no multivalued RDN by default */
|
||||||
|
mval[ne_num] = 0;
|
||||||
|
|
||||||
|
while (*sp)
|
||||||
|
{
|
||||||
|
/* collect type */
|
||||||
|
ne_types[ne_num] = bp;
|
||||||
|
while (*sp)
|
||||||
|
{
|
||||||
|
if (*sp == '\\') /* is there anything to escape in the type...? */
|
||||||
|
{
|
||||||
|
if (*++sp)
|
||||||
|
*bp++ = *sp++;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "escape character at end of string\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (*sp == '=')
|
||||||
|
{
|
||||||
|
sp++;
|
||||||
|
*bp++ = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*bp++ = *sp++;
|
||||||
|
}
|
||||||
|
if (!*sp)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "end of string encountered while processing type of subject name element #%d\n", ne_num);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
ne_values[ne_num] = bp;
|
||||||
|
while (*sp)
|
||||||
|
{
|
||||||
|
if (*sp == '\\')
|
||||||
|
{
|
||||||
|
if (*++sp)
|
||||||
|
*bp++ = *sp++;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "escape character at end of string\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (*sp == '/')
|
||||||
|
{
|
||||||
|
sp++;
|
||||||
|
/* no multivalued RDN by default */
|
||||||
|
mval[ne_num+1] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (*sp == '+' && multirdn)
|
||||||
|
{
|
||||||
|
/* a not escaped + signals a mutlivalued RDN */
|
||||||
|
sp++;
|
||||||
|
mval[ne_num+1] = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*bp++ = *sp++;
|
||||||
|
}
|
||||||
|
*bp++ = '\0';
|
||||||
|
ne_num++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(n = X509_NAME_new()))
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
for (i = 0; i < ne_num; i++)
|
||||||
|
{
|
||||||
|
if ((nid=OBJ_txt2nid(ne_types[i])) == NID_undef)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Subject Attribute %s has no known NID, skipped\n", ne_types[i]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!*ne_values[i])
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "No value provided for Subject Attribute %s, skipped\n", ne_types[i]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!X509_NAME_add_entry_by_NID(n, nid, chtype, (unsigned char*)ne_values[i], -1,-1,mval[i]))
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPENSSL_free(ne_values);
|
||||||
|
OPENSSL_free(ne_types);
|
||||||
|
OPENSSL_free(buf);
|
||||||
|
return n;
|
||||||
|
|
||||||
|
error:
|
||||||
|
X509_NAME_free(n);
|
||||||
|
if (ne_values)
|
||||||
|
OPENSSL_free(ne_values);
|
||||||
|
if (ne_types)
|
||||||
|
OPENSSL_free(ne_types);
|
||||||
|
if (buf)
|
||||||
|
OPENSSL_free(buf);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
75
apps/apps.h
75
apps/apps.h
@@ -121,7 +121,9 @@
|
|||||||
#include <openssl/lhash.h>
|
#include <openssl/lhash.h>
|
||||||
#include <openssl/conf.h>
|
#include <openssl/conf.h>
|
||||||
#include <openssl/txt_db.h>
|
#include <openssl/txt_db.h>
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
|
#endif
|
||||||
#include <openssl/ossl_typ.h>
|
#include <openssl/ossl_typ.h>
|
||||||
|
|
||||||
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
|
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
|
||||||
@@ -139,12 +141,6 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
|||||||
int WIN32_rename(char *oldname,char *newname);
|
int WIN32_rename(char *oldname,char *newname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* VMS below version 7.0 doesn't have strcasecmp() */
|
|
||||||
#ifdef OPENSSL_SYS_VMS
|
|
||||||
#define strcasecmp(str1,str2) VMS_strcasecmp((str1),(str2))
|
|
||||||
int VMS_strcasecmp(const char *str1, const char *str2);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MONOLITH
|
#ifndef MONOLITH
|
||||||
|
|
||||||
#define MAIN(a,v) main(a,v)
|
#define MAIN(a,v) main(a,v)
|
||||||
@@ -166,7 +162,9 @@ extern BIO *bio_err;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPENSSL_SYS_NETWARE
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SIGPIPE
|
#ifdef SIGPIPE
|
||||||
#define do_pipe_sig() signal(SIGPIPE,SIG_IGN)
|
#define do_pipe_sig() signal(SIGPIPE,SIG_IGN)
|
||||||
@@ -179,6 +177,7 @@ extern BIO *bio_err;
|
|||||||
do_pipe_sig()
|
do_pipe_sig()
|
||||||
# define apps_shutdown()
|
# define apps_shutdown()
|
||||||
#else
|
#else
|
||||||
|
# ifndef OPENSSL_NO_ENGINE
|
||||||
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
|
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
|
||||||
defined(OPENSSL_SYS_WIN32)
|
defined(OPENSSL_SYS_WIN32)
|
||||||
# ifdef _O_BINARY
|
# ifdef _O_BINARY
|
||||||
@@ -203,6 +202,32 @@ extern BIO *bio_err;
|
|||||||
EVP_cleanup(); ENGINE_cleanup(); \
|
EVP_cleanup(); ENGINE_cleanup(); \
|
||||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
|
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
|
||||||
ERR_free_strings(); } while(0)
|
ERR_free_strings(); } while(0)
|
||||||
|
# else
|
||||||
|
# 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(); \
|
||||||
|
EVP_cleanup(); \
|
||||||
|
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
|
||||||
|
ERR_free_strings(); } while(0)
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct args_st
|
typedef struct args_st
|
||||||
@@ -248,7 +273,9 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
|
|||||||
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
|
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
|
||||||
const char *pass, ENGINE *e, const char *cert_descrip);
|
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||||
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
|
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *setup_engine(BIO *err, const char *engine, int debug);
|
ENGINE *setup_engine(BIO *err, const char *engine, int debug);
|
||||||
|
#endif
|
||||||
|
|
||||||
int load_config(BIO *err, CONF *cnf);
|
int load_config(BIO *err, CONF *cnf);
|
||||||
char *make_config_name(void);
|
char *make_config_name(void);
|
||||||
@@ -256,9 +283,41 @@ char *make_config_name(void);
|
|||||||
/* Functions defined in ca.c and also used in ocsp.c */
|
/* Functions defined in ca.c and also used in ocsp.c */
|
||||||
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||||
ASN1_GENERALIZEDTIME **pinvtm, char *str);
|
ASN1_GENERALIZEDTIME **pinvtm, char *str);
|
||||||
int make_serial_index(TXT_DB *db);
|
|
||||||
|
|
||||||
X509_NAME *do_subject(char *str, long chtype);
|
#define DB_type 0
|
||||||
|
#define DB_exp_date 1
|
||||||
|
#define DB_rev_date 2
|
||||||
|
#define DB_serial 3 /* index - unique */
|
||||||
|
#define DB_file 4
|
||||||
|
#define DB_name 5 /* index - unique when active and not disabled */
|
||||||
|
#define DB_NUMBER 6
|
||||||
|
|
||||||
|
#define DB_TYPE_REV 'R'
|
||||||
|
#define DB_TYPE_EXP 'E'
|
||||||
|
#define DB_TYPE_VAL 'V'
|
||||||
|
|
||||||
|
typedef struct db_attr_st
|
||||||
|
{
|
||||||
|
int unique_subject;
|
||||||
|
} DB_ATTR;
|
||||||
|
typedef struct ca_db_st
|
||||||
|
{
|
||||||
|
DB_ATTR attributes;
|
||||||
|
TXT_DB *db;
|
||||||
|
} CA_DB;
|
||||||
|
|
||||||
|
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
|
||||||
|
int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai);
|
||||||
|
int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
|
||||||
|
CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
|
||||||
|
int index_index(CA_DB *db);
|
||||||
|
int save_index(char *dbfile, char *suffix, CA_DB *db);
|
||||||
|
int rotate_index(char *dbfile, char *new_suffix, char *old_suffix);
|
||||||
|
void free_index(CA_DB *db);
|
||||||
|
int index_name_cmp(const char **a, const char **b);
|
||||||
|
int parse_yesno(char *str, int def);
|
||||||
|
|
||||||
|
X509_NAME *parse_name(char *str, long chtype, int multirdn);
|
||||||
|
|
||||||
#define FORMAT_UNDEF 0
|
#define FORMAT_UNDEF 0
|
||||||
#define FORMAT_ASN1 1
|
#define FORMAT_ASN1 1
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ int MAIN(int argc, char **argv)
|
|||||||
char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
|
char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
|
||||||
char *genstr=NULL, *genconf=NULL;
|
char *genstr=NULL, *genconf=NULL;
|
||||||
unsigned char *tmpbuf;
|
unsigned char *tmpbuf;
|
||||||
|
const unsigned char *ctmpbuf;
|
||||||
BUF_MEM *buf=NULL;
|
BUF_MEM *buf=NULL;
|
||||||
STACK *osk=NULL;
|
STACK *osk=NULL;
|
||||||
ASN1_TYPE *at=NULL;
|
ASN1_TYPE *at=NULL;
|
||||||
@@ -317,7 +318,8 @@ bad:
|
|||||||
tmpbuf+=j;
|
tmpbuf+=j;
|
||||||
tmplen-=j;
|
tmplen-=j;
|
||||||
atmp = at;
|
atmp = at;
|
||||||
at = d2i_ASN1_TYPE(NULL,&tmpbuf,tmplen);
|
ctmpbuf = tmpbuf;
|
||||||
|
at = d2i_ASN1_TYPE(NULL,&ctmpbuf,tmplen);
|
||||||
ASN1_TYPE_free(atmp);
|
ASN1_TYPE_free(atmp);
|
||||||
if(!at)
|
if(!at)
|
||||||
{
|
{
|
||||||
@@ -333,7 +335,15 @@ bad:
|
|||||||
num=tmplen;
|
num=tmplen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length == 0) length=(unsigned int)num;
|
if (offset >= num)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Error: offset too large\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
num -= offset;
|
||||||
|
|
||||||
|
if ((length == 0) || ((long)length > num)) length=(unsigned int)num;
|
||||||
if(derout) {
|
if(derout) {
|
||||||
if(BIO_write(derout, str + offset, length) != (int)length) {
|
if(BIO_write(derout, str + offset, length) != (int)length) {
|
||||||
BIO_printf(bio_err, "Error writing output\n");
|
BIO_printf(bio_err, "Error writing output\n");
|
||||||
@@ -361,7 +371,7 @@ end:
|
|||||||
if (osk != NULL) sk_free(osk);
|
if (osk != NULL) sk_free(osk);
|
||||||
OBJ_cleanup();
|
OBJ_cleanup();
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
|
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
|
||||||
|
|||||||
@@ -203,6 +203,6 @@ end:
|
|||||||
if (ssl != NULL) SSL_free(ssl);
|
if (ssl != NULL) SSL_free(ssl);
|
||||||
if (STDout != NULL) BIO_free_all(STDout);
|
if (STDout != NULL) BIO_free_all(STDout);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ static char *crl_usage[]={
|
|||||||
" -in arg - input file - default stdin\n",
|
" -in arg - input file - default stdin\n",
|
||||||
" -out arg - output file - default stdout\n",
|
" -out arg - output file - default stdout\n",
|
||||||
" -hash - print hash value\n",
|
" -hash - print hash value\n",
|
||||||
|
" -fingerprint - print the crl fingerprint\n",
|
||||||
" -issuer - print issuer DN\n",
|
" -issuer - print issuer DN\n",
|
||||||
" -lastupdate - lastUpdate field\n",
|
" -lastupdate - lastUpdate field\n",
|
||||||
" -nextupdate - nextUpdate field\n",
|
" -nextupdate - nextUpdate field\n",
|
||||||
@@ -377,7 +378,7 @@ end:
|
|||||||
X509_STORE_free(store);
|
X509_STORE_free(store);
|
||||||
}
|
}
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static X509_CRL *load_crl(char *infile, int format)
|
static X509_CRL *load_crl(char *infile, int format)
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ end:
|
|||||||
if (crl != NULL) X509_CRL_free(crl);
|
if (crl != NULL) X509_CRL_free(crl);
|
||||||
|
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
17
apps/dgst.c
17
apps/dgst.c
@@ -100,7 +100,9 @@ int MAIN(int argc, char **argv)
|
|||||||
EVP_PKEY *sigkey = NULL;
|
EVP_PKEY *sigkey = NULL;
|
||||||
unsigned char *sigbuf = NULL;
|
unsigned char *sigbuf = NULL;
|
||||||
int siglen = 0;
|
int siglen = 0;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -166,11 +168,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) break;
|
if (--argc < 1) break;
|
||||||
keyform=str2fmt(*(++argv));
|
keyform=str2fmt(*(++argv));
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) break;
|
if (--argc < 1) break;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-hex") == 0)
|
else if (strcmp(*argv,"-hex") == 0)
|
||||||
out_bin = 0;
|
out_bin = 0;
|
||||||
else if (strcmp(*argv,"-binary") == 0)
|
else if (strcmp(*argv,"-binary") == 0)
|
||||||
@@ -208,7 +212,9 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\n");
|
BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\n");
|
||||||
BIO_printf(bio_err,"-signature file signature to verify\n");
|
BIO_printf(bio_err,"-signature file signature to verify\n");
|
||||||
BIO_printf(bio_err,"-binary output in binary form\n");
|
BIO_printf(bio_err,"-binary output in binary form\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
|
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
|
||||||
LN_md5,LN_md5);
|
LN_md5,LN_md5);
|
||||||
@@ -228,7 +234,9 @@ int MAIN(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
bmd=BIO_new(BIO_f_md());
|
bmd=BIO_new(BIO_f_md());
|
||||||
@@ -339,8 +347,9 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if(!out_bin)
|
if(!out_bin)
|
||||||
{
|
{
|
||||||
tmp=tofree=OPENSSL_malloc(strlen(name)+strlen(argv[i])+5);
|
size_t len = strlen(name)+strlen(argv[i])+5;
|
||||||
sprintf(tmp,"%s(%s)= ",name,argv[i]);
|
tmp=tofree=OPENSSL_malloc(len);
|
||||||
|
BIO_snprintf(tmp,len,"%s(%s)= ",name,argv[i]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tmp="";
|
tmp="";
|
||||||
@@ -356,7 +365,7 @@ int MAIN(int argc, char **argv)
|
|||||||
end:
|
end:
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
memset(buf,0,BUFSIZE);
|
OPENSSL_cleanse(buf,BUFSIZE);
|
||||||
OPENSSL_free(buf);
|
OPENSSL_free(buf);
|
||||||
}
|
}
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
@@ -365,7 +374,7 @@ end:
|
|||||||
if(sigbuf) OPENSSL_free(sigbuf);
|
if(sigbuf) OPENSSL_free(sigbuf);
|
||||||
if (bmd != NULL) BIO_free(bmd);
|
if (bmd != NULL) BIO_free(bmd);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(err);
|
OPENSSL_EXIT(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||||
|
|||||||
17
apps/dh.c
17
apps/dh.c
@@ -87,12 +87,17 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
DH *dh=NULL;
|
DH *dh=NULL;
|
||||||
int i,badops=0,text=0;
|
int i,badops=0,text=0;
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||||
char *infile,*outfile,*prog,*engine;
|
char *infile,*outfile,*prog;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
|
char *engine;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -103,7 +108,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
engine=NULL;
|
engine=NULL;
|
||||||
|
#endif
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -134,11 +141,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile= *(++argv);
|
outfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-check") == 0)
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
check=1;
|
check=1;
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
@@ -170,13 +179,17 @@ bad:
|
|||||||
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
||||||
BIO_printf(bio_err," -C Output C code\n");
|
BIO_printf(bio_err," -C Output C code\n");
|
||||||
BIO_printf(bio_err," -noout no output\n");
|
BIO_printf(bio_err," -noout no output\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
@@ -333,6 +346,6 @@ end:
|
|||||||
if (out != NULL) BIO_free_all(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dh != NULL) DH_free(dh);
|
if (dh != NULL) DH_free(dh);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -142,13 +142,15 @@
|
|||||||
* -C
|
* -C
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg);
|
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
DH *dh=NULL;
|
DH *dh=NULL;
|
||||||
int i,badops=0,text=0;
|
int i,badops=0,text=0;
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
@@ -157,7 +159,10 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog;
|
||||||
char *inrand=NULL,*engine=NULL;
|
char *inrand=NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
int num = 0, g = 0;
|
int num = 0, g = 0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
@@ -199,11 +204,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile= *(++argv);
|
outfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-check") == 0)
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
check=1;
|
check=1;
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
@@ -249,7 +256,9 @@ bad:
|
|||||||
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
|
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
|
||||||
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
|
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
|
||||||
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
|
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
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," - load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
@@ -259,7 +268,9 @@ bad:
|
|||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (g && !num)
|
if (g && !num)
|
||||||
num = DEFBITS;
|
num = DEFBITS;
|
||||||
@@ -283,6 +294,8 @@ bad:
|
|||||||
|
|
||||||
if(num) {
|
if(num) {
|
||||||
|
|
||||||
|
BN_GENCB cb;
|
||||||
|
BN_GENCB_set(&cb, dh_cb, bio_err);
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||||
@@ -294,12 +307,13 @@ bad:
|
|||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (dsaparam)
|
if (dsaparam)
|
||||||
{
|
{
|
||||||
DSA *dsa;
|
DSA *dsa = DSA_new();
|
||||||
|
|
||||||
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
|
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
|
||||||
dsa = DSA_generate_parameters(num, NULL, 0, NULL, NULL, dh_cb, bio_err);
|
if(!dsa || !DSA_generate_parameters_ex(dsa, num,
|
||||||
if (dsa == NULL)
|
NULL, 0, NULL, NULL, &cb))
|
||||||
{
|
{
|
||||||
|
if(dsa) DSA_free(dsa);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -315,12 +329,12 @@ bad:
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
dh = DH_new();
|
||||||
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
|
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
|
||||||
BIO_printf(bio_err,"This is going to take a long time\n");
|
BIO_printf(bio_err,"This is going to take a long time\n");
|
||||||
dh=DH_generate_parameters(num,g,dh_cb,bio_err);
|
if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb))
|
||||||
|
|
||||||
if (dh == NULL)
|
|
||||||
{
|
{
|
||||||
|
if(dh) DH_free(dh);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -519,11 +533,11 @@ end:
|
|||||||
if (out != NULL) BIO_free_all(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dh != NULL) DH_free(dh);
|
if (dh != NULL) DH_free(dh);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
|
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
|
||||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c='*';
|
char c='*';
|
||||||
|
|
||||||
@@ -531,11 +545,12 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
|||||||
if (p == 1) c='+';
|
if (p == 1) c='+';
|
||||||
if (p == 2) c='*';
|
if (p == 2) c='*';
|
||||||
if (p == 3) c='\n';
|
if (p == 3) c='\n';
|
||||||
BIO_write((BIO *)arg,&c,1);
|
BIO_write(cb->arg,&c,1);
|
||||||
(void)BIO_flush((BIO *)arg);
|
(void)BIO_flush(cb->arg);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
p=n;
|
p=n;
|
||||||
#endif
|
#endif
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
17
apps/dsa.c
17
apps/dsa.c
@@ -90,7 +90,9 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
int ret=1;
|
int ret=1;
|
||||||
DSA *dsa=NULL;
|
DSA *dsa=NULL;
|
||||||
int i,badops=0;
|
int i,badops=0;
|
||||||
@@ -98,7 +100,10 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat,outformat,text=0,noout=0;
|
int informat,outformat,text=0,noout=0;
|
||||||
int pubin = 0, pubout = 0;
|
int pubin = 0, pubout = 0;
|
||||||
char *infile,*outfile,*prog,*engine;
|
char *infile,*outfile,*prog;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
|
char *engine;
|
||||||
|
#endif
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
int modulus=0;
|
int modulus=0;
|
||||||
@@ -112,7 +117,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if (!load_config(bio_err, NULL))
|
if (!load_config(bio_err, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
engine=NULL;
|
engine=NULL;
|
||||||
|
#endif
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -153,11 +160,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargout= *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-noout") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
noout=1;
|
noout=1;
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
@@ -189,7 +198,9 @@ bad:
|
|||||||
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err," -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
BIO_printf(bio_err," -passout arg output file pass phrase source\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");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||||
#ifndef OPENSSL_NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
@@ -207,7 +218,9 @@ bad:
|
|||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
@@ -314,6 +327,6 @@ end:
|
|||||||
if(passin) OPENSSL_free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
if(passout) OPENSSL_free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -56,6 +56,12 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
|
* deprecated functions for openssl-internal code */
|
||||||
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -82,15 +88,31 @@
|
|||||||
* -C
|
* -C
|
||||||
* -noout
|
* -noout
|
||||||
* -genkey
|
* -genkey
|
||||||
|
* #ifdef GENCB_TEST
|
||||||
|
* -timebomb n - interrupt keygen after <n> seconds
|
||||||
|
* #endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void MS_CALLBACK dsa_cb(int p, int n, void *arg);
|
#ifdef GENCB_TEST
|
||||||
|
|
||||||
|
static int stop_keygen_flag = 0;
|
||||||
|
|
||||||
|
static void timebomb_sigalarm(int foo)
|
||||||
|
{
|
||||||
|
stop_keygen_flag = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
DSA *dsa=NULL;
|
DSA *dsa=NULL;
|
||||||
int i,badops=0,text=0;
|
int i,badops=0,text=0;
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
@@ -98,7 +120,12 @@ int MAIN(int argc, char **argv)
|
|||||||
char *infile,*outfile,*prog,*inrand=NULL;
|
char *infile,*outfile,*prog,*inrand=NULL;
|
||||||
int numbits= -1,num,genkey=0;
|
int numbits= -1,num,genkey=0;
|
||||||
int need_rand=0;
|
int need_rand=0;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
#ifdef GENCB_TEST
|
||||||
|
int timebomb=0;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -139,11 +166,20 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile= *(++argv);
|
outfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if(strcmp(*argv, "-engine") == 0)
|
else if(strcmp(*argv, "-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine = *(++argv);
|
engine = *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef GENCB_TEST
|
||||||
|
else if(strcmp(*argv, "-timebomb") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
timebomb = atoi(*(++argv));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
text=1;
|
text=1;
|
||||||
else if (strcmp(*argv,"-C") == 0)
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
@@ -191,7 +227,12 @@ bad:
|
|||||||
BIO_printf(bio_err," -noout no output\n");
|
BIO_printf(bio_err," -noout no output\n");
|
||||||
BIO_printf(bio_err," -genkey generate a DSA key\n");
|
BIO_printf(bio_err," -genkey generate a DSA key\n");
|
||||||
BIO_printf(bio_err," -rand files to use for random number input\n");
|
BIO_printf(bio_err," -rand files to use for random number input\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
|
#ifdef GENCB_TEST
|
||||||
|
BIO_printf(bio_err," -timebomb n interrupt keygen after <n> seconds\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," number number of bits to use for generating private key\n");
|
BIO_printf(bio_err," number number of bits to use for generating private key\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -235,7 +276,9 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (need_rand)
|
if (need_rand)
|
||||||
{
|
{
|
||||||
@@ -247,10 +290,47 @@ bad:
|
|||||||
|
|
||||||
if (numbits > 0)
|
if (numbits > 0)
|
||||||
{
|
{
|
||||||
|
BN_GENCB cb;
|
||||||
|
BN_GENCB_set(&cb, dsa_cb, bio_err);
|
||||||
assert(need_rand);
|
assert(need_rand);
|
||||||
|
dsa = DSA_new();
|
||||||
|
if(!dsa)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"Error allocating DSA object\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
|
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
|
||||||
BIO_printf(bio_err,"This could take some time\n");
|
BIO_printf(bio_err,"This could take some time\n");
|
||||||
dsa=DSA_generate_parameters(num,NULL,0,NULL,NULL, dsa_cb,bio_err);
|
#ifdef GENCB_TEST
|
||||||
|
if(timebomb > 0)
|
||||||
|
{
|
||||||
|
struct sigaction act;
|
||||||
|
act.sa_handler = timebomb_sigalarm;
|
||||||
|
act.sa_flags = 0;
|
||||||
|
BIO_printf(bio_err,"(though I'll stop it if not done within %d secs)\n",
|
||||||
|
timebomb);
|
||||||
|
if(sigaction(SIGALRM, &act, NULL) != 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"Error, couldn't set SIGALRM handler\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
alarm(timebomb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if(!DSA_generate_parameters_ex(dsa,num,NULL,0,NULL,NULL, &cb))
|
||||||
|
{
|
||||||
|
#ifdef GENCB_TEST
|
||||||
|
if(stop_keygen_flag)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"DSA key generation time-stopped\n");
|
||||||
|
/* This is an asked-for behaviour! */
|
||||||
|
ret = 0;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
BIO_printf(bio_err,"Error, DSA key generation failed\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (informat == FORMAT_ASN1)
|
else if (informat == FORMAT_ASN1)
|
||||||
dsa=d2i_DSAparams_bio(in,NULL);
|
dsa=d2i_DSAparams_bio(in,NULL);
|
||||||
@@ -372,10 +452,10 @@ end:
|
|||||||
if (out != NULL) BIO_free_all(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dsa != NULL) DSA_free(dsa);
|
if (dsa != NULL) DSA_free(dsa);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
|
static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c='*';
|
char c='*';
|
||||||
|
|
||||||
@@ -383,10 +463,15 @@ static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
|
|||||||
if (p == 1) c='+';
|
if (p == 1) c='+';
|
||||||
if (p == 2) c='*';
|
if (p == 2) c='*';
|
||||||
if (p == 3) c='\n';
|
if (p == 3) c='\n';
|
||||||
BIO_write(arg,&c,1);
|
BIO_write(cb->arg,&c,1);
|
||||||
(void)BIO_flush(arg);
|
(void)BIO_flush(cb->arg);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
p=n;
|
p=n;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef GENCB_TEST
|
||||||
|
if(stop_keygen_flag)
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -390,6 +390,6 @@ end:
|
|||||||
if (passout)
|
if (passout)
|
||||||
OPENSSL_free(passout);
|
OPENSSL_free(passout);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -383,7 +383,26 @@ bad:
|
|||||||
|
|
||||||
if (curve_name != NULL)
|
if (curve_name != NULL)
|
||||||
{
|
{
|
||||||
int nid = OBJ_sn2nid(curve_name);
|
int nid;
|
||||||
|
|
||||||
|
/* workaround for the SECG curve names secp192r1
|
||||||
|
* and secp256r1 (which are the same as the curves
|
||||||
|
* prime192v1 and prime256v1 defined in X9.62)
|
||||||
|
*/
|
||||||
|
if (!strcmp(curve_name, "secp192r1"))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "using curve name prime192v1 "
|
||||||
|
"instead of secp192r1\n");
|
||||||
|
nid = NID_X9_62_prime192v1;
|
||||||
|
}
|
||||||
|
else if (!strcmp(curve_name, "secp256r1"))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "using curve name prime256v1 "
|
||||||
|
"instead of secp256r1\n");
|
||||||
|
nid = NID_X9_62_prime256v1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
nid = OBJ_sn2nid(curve_name);
|
||||||
|
|
||||||
if (nid == 0)
|
if (nid == 0)
|
||||||
{
|
{
|
||||||
@@ -679,10 +698,10 @@ end:
|
|||||||
if (group != NULL)
|
if (group != NULL)
|
||||||
EC_GROUP_free(group);
|
EC_GROUP_free(group);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
|
static int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
|
||||||
int len, unsigned char *buffer)
|
int len, unsigned char *buffer)
|
||||||
{
|
{
|
||||||
BIO_printf(out, "static unsigned char %s_%d[] = {", var, len);
|
BIO_printf(out, "static unsigned char %s_%d[] = {", var, len);
|
||||||
|
|||||||
20
apps/enc.c
20
apps/enc.c
@@ -100,7 +100,9 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
static const char magic[]="Salted__";
|
static const char magic[]="Salted__";
|
||||||
char mbuf[sizeof magic-1];
|
char mbuf[sizeof magic-1];
|
||||||
char *strbuf=NULL;
|
char *strbuf=NULL;
|
||||||
@@ -119,7 +121,9 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
|
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
|
||||||
#define PROG_NAME_SIZE 39
|
#define PROG_NAME_SIZE 39
|
||||||
char pname[PROG_NAME_SIZE+1];
|
char pname[PROG_NAME_SIZE+1];
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -163,11 +167,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passarg= *(++argv);
|
passarg= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-d") == 0)
|
else if (strcmp(*argv,"-d") == 0)
|
||||||
enc=0;
|
enc=0;
|
||||||
else if (strcmp(*argv,"-p") == 0)
|
else if (strcmp(*argv,"-p") == 0)
|
||||||
@@ -270,7 +276,9 @@ bad:
|
|||||||
BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv");
|
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 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 buffer size\n","-bufsize <n>");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
|
BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
|
||||||
|
#endif
|
||||||
|
|
||||||
BIO_printf(bio_err,"Cipher Types\n");
|
BIO_printf(bio_err,"Cipher Types\n");
|
||||||
OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH,
|
OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH,
|
||||||
@@ -284,7 +292,9 @@ bad:
|
|||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (bufsize != NULL)
|
if (bufsize != NULL)
|
||||||
{
|
{
|
||||||
@@ -363,7 +373,7 @@ bad:
|
|||||||
{
|
{
|
||||||
char buf[200];
|
char buf[200];
|
||||||
|
|
||||||
sprintf(buf,"enter %s %s password:",
|
BIO_snprintf(buf,sizeof buf,"enter %s %s password:",
|
||||||
OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
|
OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
|
||||||
(enc)?"encryption":"decryption");
|
(enc)?"encryption":"decryption");
|
||||||
strbuf[0]='\0';
|
strbuf[0]='\0';
|
||||||
@@ -481,9 +491,9 @@ bad:
|
|||||||
* bug picked up by
|
* bug picked up by
|
||||||
* Larry J. Hughes Jr. <hughes@indiana.edu> */
|
* Larry J. Hughes Jr. <hughes@indiana.edu> */
|
||||||
if (str == strbuf)
|
if (str == strbuf)
|
||||||
memset(str,0,SIZE);
|
OPENSSL_cleanse(str,SIZE);
|
||||||
else
|
else
|
||||||
memset(str,0,strlen(str));
|
OPENSSL_cleanse(str,strlen(str));
|
||||||
}
|
}
|
||||||
if ((hiv != NULL) && !set_hex(hiv,iv,sizeof iv))
|
if ((hiv != NULL) && !set_hex(hiv,iv,sizeof iv))
|
||||||
{
|
{
|
||||||
@@ -524,7 +534,7 @@ bad:
|
|||||||
if (!nosalt)
|
if (!nosalt)
|
||||||
{
|
{
|
||||||
printf("salt=");
|
printf("salt=");
|
||||||
for (i=0; i<sizeof salt; i++)
|
for (i=0; i<(int)sizeof(salt); i++)
|
||||||
printf("%02X",salt[i]);
|
printf("%02X",salt[i]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
@@ -586,7 +596,7 @@ end:
|
|||||||
if (b64 != NULL) BIO_free(b64);
|
if (b64 != NULL) BIO_free(b64);
|
||||||
if(pass) OPENSSL_free(pass);
|
if(pass) OPENSSL_free(pass);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int set_hex(char *in, unsigned char *out, int size)
|
int set_hex(char *in, unsigned char *out, int size)
|
||||||
|
|||||||
@@ -56,6 +56,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -77,7 +79,8 @@ static char *engine_usage[]={
|
|||||||
" -vvv will also add the input flags for each command\n",
|
" -vvv will also add the input flags for each command\n",
|
||||||
" -vvvv will also show internal input flags\n",
|
" -vvvv will also show internal input flags\n",
|
||||||
" -c - for each engine, also list the capabilities\n",
|
" -c - for each engine, also list the capabilities\n",
|
||||||
" -t - for each engine, check that they are really available\n",
|
" -t[t] - for each engine, check that they are really available\n",
|
||||||
|
" -tt will display error trace for unavailable engines\n",
|
||||||
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n",
|
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n",
|
||||||
" to load it (if -t is used)\n",
|
" to load it (if -t is used)\n",
|
||||||
" -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n",
|
" -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n",
|
||||||
@@ -120,8 +123,8 @@ static int append_buf(char **buf, const char *s, int *size, int step)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (**buf != '\0')
|
if (**buf != '\0')
|
||||||
strcat(*buf, ", ");
|
BUF_strlcat(*buf, ", ", *size);
|
||||||
strcat(*buf, s);
|
BUF_strlcat(*buf, s, *size);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -342,7 +345,7 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int ret=1,i;
|
int ret=1,i;
|
||||||
char **pp;
|
char **pp;
|
||||||
int verbose=0, list_cap=0, test_avail=0;
|
int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0;
|
||||||
ENGINE *e;
|
ENGINE *e;
|
||||||
STACK *engines = sk_new_null();
|
STACK *engines = sk_new_null();
|
||||||
STACK *pre_cmds = sk_new_null();
|
STACK *pre_cmds = sk_new_null();
|
||||||
@@ -380,8 +383,14 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (strcmp(*argv,"-c") == 0)
|
else if (strcmp(*argv,"-c") == 0)
|
||||||
list_cap=1;
|
list_cap=1;
|
||||||
else if (strcmp(*argv,"-t") == 0)
|
else if (strncmp(*argv,"-t",2) == 0)
|
||||||
|
{
|
||||||
test_avail=1;
|
test_avail=1;
|
||||||
|
if(strspn(*argv + 1, "t") < strlen(*argv + 1))
|
||||||
|
goto skip_arg_loop;
|
||||||
|
if((test_avail_noise = strlen(*argv + 1) - 1) > 1)
|
||||||
|
goto skip_arg_loop;
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-pre") == 0)
|
else if (strcmp(*argv,"-pre") == 0)
|
||||||
{
|
{
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
@@ -496,6 +505,7 @@ skip_digests:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_out, "[ unavailable ]\n");
|
BIO_printf(bio_out, "[ unavailable ]\n");
|
||||||
|
if(test_avail_noise)
|
||||||
ERR_print_errors_fp(stdout);
|
ERR_print_errors_fp(stdout);
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
}
|
}
|
||||||
@@ -510,11 +520,19 @@ skip_digests:
|
|||||||
|
|
||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
|
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
sk_pop_free(engines, identity);
|
sk_pop_free(engines, identity);
|
||||||
sk_pop_free(pre_cmds, identity);
|
sk_pop_free(pre_cmds, identity);
|
||||||
sk_pop_free(post_cmds, identity);
|
sk_pop_free(post_cmds, identity);
|
||||||
if (bio_out != NULL) BIO_free_all(bio_out);
|
if (bio_out != NULL) BIO_free_all(bio_out);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
|
# if PEDANTIC
|
||||||
|
static void *dummy=&dummy;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -122,5 +122,5 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
33
apps/gendh.c
33
apps/gendh.c
@@ -57,6 +57,12 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
|
* deprecated functions for openssl-internal code */
|
||||||
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -75,23 +81,29 @@
|
|||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG gendh_main
|
#define PROG gendh_main
|
||||||
|
|
||||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg);
|
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
BN_GENCB cb;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
DH *dh=NULL;
|
DH *dh=NULL;
|
||||||
int ret=1,num=DEFBITS;
|
int ret=1,num=DEFBITS;
|
||||||
int g=2;
|
int g=2;
|
||||||
char *outfile=NULL;
|
char *outfile=NULL;
|
||||||
char *inrand=NULL;
|
char *inrand=NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
BIO *out=NULL;
|
BIO *out=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
|
BN_GENCB_set(&cb, dh_cb, bio_err);
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
@@ -115,11 +127,13 @@ int MAIN(int argc, char **argv)
|
|||||||
g=3; */
|
g=3; */
|
||||||
else if (strcmp(*argv,"-5") == 0)
|
else if (strcmp(*argv,"-5") == 0)
|
||||||
g=5;
|
g=5;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -138,14 +152,18 @@ bad:
|
|||||||
BIO_printf(bio_err," -2 - use 2 as the generator value\n");
|
BIO_printf(bio_err," -2 - use 2 as the generator value\n");
|
||||||
/* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */
|
/* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */
|
||||||
BIO_printf(bio_err," -5 - use 5 as the generator value\n");
|
BIO_printf(bio_err," -5 - use 5 as the generator value\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
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," - load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
@@ -183,9 +201,9 @@ bad:
|
|||||||
|
|
||||||
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
|
BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g);
|
||||||
BIO_printf(bio_err,"This is going to take a long time\n");
|
BIO_printf(bio_err,"This is going to take a long time\n");
|
||||||
dh=DH_generate_parameters(num,g,dh_cb,bio_err);
|
|
||||||
|
|
||||||
if (dh == NULL) goto end;
|
if(((dh = DH_new()) == NULL) || !DH_generate_parameters_ex(dh, num, g, &cb))
|
||||||
|
goto end;
|
||||||
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
app_RAND_write_file(NULL, bio_err);
|
||||||
|
|
||||||
@@ -198,10 +216,10 @@ end:
|
|||||||
if (out != NULL) BIO_free_all(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dh != NULL) DH_free(dh);
|
if (dh != NULL) DH_free(dh);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c='*';
|
char c='*';
|
||||||
|
|
||||||
@@ -209,10 +227,11 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
|||||||
if (p == 1) c='+';
|
if (p == 1) c='+';
|
||||||
if (p == 2) c='*';
|
if (p == 2) c='*';
|
||||||
if (p == 3) c='\n';
|
if (p == 3) c='\n';
|
||||||
BIO_write((BIO *)arg,&c,1);
|
BIO_write(cb->arg,&c,1);
|
||||||
(void)BIO_flush((BIO *)arg);
|
(void)BIO_flush(cb->arg);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
p=n;
|
p=n;
|
||||||
#endif
|
#endif
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
DSA *dsa=NULL;
|
DSA *dsa=NULL;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
char *outfile=NULL;
|
char *outfile=NULL;
|
||||||
@@ -85,7 +87,9 @@ int MAIN(int argc, char **argv)
|
|||||||
char *passargout = NULL, *passout = NULL;
|
char *passargout = NULL, *passout = NULL;
|
||||||
BIO *out=NULL,*in=NULL;
|
BIO *out=NULL,*in=NULL;
|
||||||
const EVP_CIPHER *enc=NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -111,11 +115,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargout= *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -167,7 +173,9 @@ bad:
|
|||||||
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
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," - load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
@@ -176,7 +184,9 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
@@ -246,6 +256,6 @@ end:
|
|||||||
if (dsa != NULL) DSA_free(dsa);
|
if (dsa != NULL) DSA_free(dsa);
|
||||||
if(passout) OPENSSL_free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -56,6 +56,12 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
|
* deprecated functions for openssl-internal code */
|
||||||
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -75,13 +81,16 @@
|
|||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG genrsa_main
|
#define PROG genrsa_main
|
||||||
|
|
||||||
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg);
|
static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
BN_GENCB cb;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
int ret=1;
|
int ret=1;
|
||||||
RSA *rsa=NULL;
|
RSA *rsa=NULL;
|
||||||
int i,num=DEFBITS;
|
int i,num=DEFBITS;
|
||||||
@@ -90,11 +99,14 @@ int MAIN(int argc, char **argv)
|
|||||||
unsigned long f4=RSA_F4;
|
unsigned long f4=RSA_F4;
|
||||||
char *outfile=NULL;
|
char *outfile=NULL;
|
||||||
char *passargout = NULL, *passout = NULL;
|
char *passargout = NULL, *passout = NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
char *inrand=NULL;
|
char *inrand=NULL;
|
||||||
BIO *out=NULL;
|
BIO *out=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
BN_GENCB_set(&cb, genrsa_cb, bio_err);
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
@@ -122,11 +134,13 @@ int MAIN(int argc, char **argv)
|
|||||||
f4=3;
|
f4=3;
|
||||||
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
|
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
|
||||||
f4=RSA_F4;
|
f4=RSA_F4;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -177,7 +191,9 @@ bad:
|
|||||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||||
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
|
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
|
||||||
BIO_printf(bio_err," -3 use 3 for the E value\n");
|
BIO_printf(bio_err," -3 use 3 for the E value\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
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," load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
@@ -191,7 +207,9 @@ bad:
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
{
|
{
|
||||||
@@ -223,7 +241,9 @@ bad:
|
|||||||
|
|
||||||
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
|
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
|
||||||
num);
|
num);
|
||||||
rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err);
|
|
||||||
|
if(((rsa = RSA_new()) == NULL) || !RSA_generate_key_ex(rsa, num, f4, &cb))
|
||||||
|
goto err;
|
||||||
|
|
||||||
app_RAND_write_file(NULL, bio_err);
|
app_RAND_write_file(NULL, bio_err);
|
||||||
|
|
||||||
@@ -258,10 +278,10 @@ err:
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
|
static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c='*';
|
char c='*';
|
||||||
|
|
||||||
@@ -269,11 +289,12 @@ static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
|
|||||||
if (p == 1) c='+';
|
if (p == 1) c='+';
|
||||||
if (p == 2) c='*';
|
if (p == 2) c='*';
|
||||||
if (p == 3) c='\n';
|
if (p == 3) c='\n';
|
||||||
BIO_write((BIO *)arg,&c,1);
|
BIO_write(cb->arg,&c,1);
|
||||||
(void)BIO_flush((BIO *)arg);
|
(void)BIO_flush(cb->arg);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
p=n;
|
p=n;
|
||||||
#endif
|
#endif
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
#else /* !OPENSSL_NO_RSA */
|
#else /* !OPENSSL_NO_RSA */
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ $! TCPIP_PROGRAMS = ",S_SERVER,S_CLIENT,SESS_ID,CIPHERS,S_TIME,"
|
|||||||
$!
|
$!
|
||||||
$! Setup exceptional compilations
|
$! Setup exceptional compilations
|
||||||
$!
|
$!
|
||||||
$ COMPILEWITH_CC2 = ",S_SOCKET,S_SERVER,S_CLIENT,"
|
$ COMPILEWITH_CC2 = ",S_SERVER,S_CLIENT,"
|
||||||
$!
|
$!
|
||||||
$ PHASE := LIB
|
$ PHASE := LIB
|
||||||
$!
|
$!
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-in file input file\n");
|
BIO_printf (bio_err, "-in file input file\n");
|
||||||
BIO_printf (bio_err, "-out file output file\n");
|
BIO_printf (bio_err, "-out file output file\n");
|
||||||
BIO_printf (bio_err, "-toseq output NS Sequence file\n");
|
BIO_printf (bio_err, "-toseq output NS Sequence file\n");
|
||||||
EXIT(1);
|
OPENSSL_EXIT(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (infile) {
|
if (infile) {
|
||||||
@@ -162,6 +162,6 @@ end:
|
|||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
NETSCAPE_CERT_SEQUENCE_free(seq);
|
NETSCAPE_CERT_SEQUENCE_free(seq);
|
||||||
|
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
83
apps/ocsp.c
83
apps/ocsp.c
@@ -55,6 +55,7 @@
|
|||||||
* Hudson (tjh@cryptsoft.com).
|
* Hudson (tjh@cryptsoft.com).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#ifndef OPENSSL_NO_OCSP
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -67,19 +68,6 @@
|
|||||||
/* Maximum leeway in validity period: default 5 minutes */
|
/* Maximum leeway in validity period: default 5 minutes */
|
||||||
#define MAX_VALIDITY_PERIOD (5 * 60)
|
#define MAX_VALIDITY_PERIOD (5 * 60)
|
||||||
|
|
||||||
/* CA index.txt definitions */
|
|
||||||
#define DB_type 0
|
|
||||||
#define DB_exp_date 1
|
|
||||||
#define DB_rev_date 2
|
|
||||||
#define DB_serial 3 /* index - unique */
|
|
||||||
#define DB_file 4
|
|
||||||
#define DB_name 5 /* index - unique for active */
|
|
||||||
#define DB_NUMBER 6
|
|
||||||
|
|
||||||
#define DB_TYPE_REV 'R'
|
|
||||||
#define DB_TYPE_EXP 'E'
|
|
||||||
#define DB_TYPE_VAL 'V'
|
|
||||||
|
|
||||||
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
|
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
|
||||||
STACK_OF(OCSP_CERTID) *ids);
|
STACK_OF(OCSP_CERTID) *ids);
|
||||||
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer,
|
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer,
|
||||||
@@ -88,12 +76,12 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
|||||||
STACK *names, STACK_OF(OCSP_CERTID) *ids,
|
STACK *names, STACK_OF(OCSP_CERTID) *ids,
|
||||||
long nsec, long maxage);
|
long nsec, long maxage);
|
||||||
|
|
||||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db,
|
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
|
||||||
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
||||||
STACK_OF(X509) *rother, unsigned long flags,
|
STACK_OF(X509) *rother, unsigned long flags,
|
||||||
int nmin, int ndays);
|
int nmin, int ndays);
|
||||||
|
|
||||||
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser);
|
static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser);
|
||||||
static BIO *init_responder(char *port);
|
static BIO *init_responder(char *port);
|
||||||
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port);
|
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port);
|
||||||
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp);
|
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp);
|
||||||
@@ -135,13 +123,14 @@ int MAIN(int argc, char **argv)
|
|||||||
int accept_count = -1;
|
int accept_count = -1;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
int i;
|
int i;
|
||||||
|
int ignore_err = 0;
|
||||||
STACK *reqnames = NULL;
|
STACK *reqnames = NULL;
|
||||||
STACK_OF(OCSP_CERTID) *ids = NULL;
|
STACK_OF(OCSP_CERTID) *ids = NULL;
|
||||||
|
|
||||||
X509 *rca_cert = NULL;
|
X509 *rca_cert = NULL;
|
||||||
char *ridx_filename = NULL;
|
char *ridx_filename = NULL;
|
||||||
char *rca_filename = NULL;
|
char *rca_filename = NULL;
|
||||||
TXT_DB *rdb = NULL;
|
CA_DB *rdb = NULL;
|
||||||
int nmin = 0, ndays = -1;
|
int nmin = 0, ndays = -1;
|
||||||
|
|
||||||
if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||||
@@ -194,6 +183,8 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else badarg = 1;
|
else badarg = 1;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(*args, "-ignore_err"))
|
||||||
|
ignore_err = 1;
|
||||||
else if (!strcmp(*args, "-noverify"))
|
else if (!strcmp(*args, "-noverify"))
|
||||||
noverify = 1;
|
noverify = 1;
|
||||||
else if (!strcmp(*args, "-nonce"))
|
else if (!strcmp(*args, "-nonce"))
|
||||||
@@ -523,7 +514,7 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-serial n serial number to check\n");
|
BIO_printf (bio_err, "-serial n serial number to check\n");
|
||||||
BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n");
|
BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n");
|
||||||
BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n");
|
BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n");
|
||||||
BIO_printf (bio_err, "-sign_certs file additional certificates to include in signed request\n");
|
BIO_printf (bio_err, "-sign_other file additional certificates to include in signed request\n");
|
||||||
BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n");
|
BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n");
|
||||||
BIO_printf (bio_err, "-req_text print text form of request\n");
|
BIO_printf (bio_err, "-req_text print text form of request\n");
|
||||||
BIO_printf (bio_err, "-resp_text print text form of response\n");
|
BIO_printf (bio_err, "-resp_text print text form of response\n");
|
||||||
@@ -543,10 +534,10 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n");
|
BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n");
|
||||||
BIO_printf (bio_err, "-status_age n maximum status age in seconds\n");
|
BIO_printf (bio_err, "-status_age n maximum status age in seconds\n");
|
||||||
BIO_printf (bio_err, "-noverify don't verify response at all\n");
|
BIO_printf (bio_err, "-noverify don't verify response at all\n");
|
||||||
BIO_printf (bio_err, "-verify_certs file additional certificates to search for signer\n");
|
BIO_printf (bio_err, "-verify_other file additional certificates to search for signer\n");
|
||||||
BIO_printf (bio_err, "-trust_other don't verify additional certificates\n");
|
BIO_printf (bio_err, "-trust_other don't verify additional certificates\n");
|
||||||
BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n");
|
BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n");
|
||||||
BIO_printf (bio_err, "-no_sig_verify don't check signature on response\n");
|
BIO_printf (bio_err, "-no_signature_verify don't check signature on response\n");
|
||||||
BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n");
|
BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n");
|
||||||
BIO_printf (bio_err, "-no_chain don't chain verify response\n");
|
BIO_printf (bio_err, "-no_chain don't chain verify response\n");
|
||||||
BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n");
|
BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n");
|
||||||
@@ -696,22 +687,9 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if (ridx_filename && !rdb)
|
if (ridx_filename && !rdb)
|
||||||
{
|
{
|
||||||
BIO *db_bio = NULL;
|
rdb = load_index(ridx_filename, NULL);
|
||||||
db_bio = BIO_new_file(ridx_filename, "r");
|
if (!rdb) goto end;
|
||||||
if (!db_bio)
|
if (!index_index(rdb)) goto end;
|
||||||
{
|
|
||||||
BIO_printf(bio_err, "Error opening index file %s\n", ridx_filename);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
rdb = TXT_DB_read(db_bio, DB_NUMBER);
|
|
||||||
BIO_free(db_bio);
|
|
||||||
if (!rdb)
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err, "Error reading index file %s\n", ridx_filename);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (!make_serial_index(rdb))
|
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rdb)
|
if (rdb)
|
||||||
@@ -722,7 +700,12 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (host)
|
else if (host)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_SOCK
|
||||||
cbio = BIO_new_connect(host);
|
cbio = BIO_new_connect(host);
|
||||||
|
#else
|
||||||
|
BIO_printf(bio_err, "Error creating connect BIO - sockets not supported.\n");
|
||||||
|
goto end;
|
||||||
|
#endif
|
||||||
if (!cbio)
|
if (!cbio)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err, "Error creating connect BIO\n");
|
BIO_printf(bio_err, "Error creating connect BIO\n");
|
||||||
@@ -732,7 +715,16 @@ int MAIN(int argc, char **argv)
|
|||||||
if (use_ssl == 1)
|
if (use_ssl == 1)
|
||||||
{
|
{
|
||||||
BIO *sbio;
|
BIO *sbio;
|
||||||
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
ctx = SSL_CTX_new(SSLv23_client_method());
|
ctx = SSL_CTX_new(SSLv23_client_method());
|
||||||
|
#elif !defined(OPENSSL_NO_SSL3)
|
||||||
|
ctx = SSL_CTX_new(SSLv3_client_method());
|
||||||
|
#elif !defined(OPENSSL_NO_SSL2)
|
||||||
|
ctx = SSL_CTX_new(SSLv2_client_method());
|
||||||
|
#else
|
||||||
|
BIO_printf(bio_err, "SSL is disabled\n");
|
||||||
|
goto end;
|
||||||
|
#endif
|
||||||
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
|
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
|
||||||
sbio = BIO_new_ssl(ctx, 1);
|
sbio = BIO_new_ssl(ctx, 1);
|
||||||
cbio = BIO_push(sbio, cbio);
|
cbio = BIO_push(sbio, cbio);
|
||||||
@@ -792,8 +784,10 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if (i != OCSP_RESPONSE_STATUS_SUCCESSFUL)
|
if (i != OCSP_RESPONSE_STATUS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
BIO_printf(out, "Responder Error: %s (%ld)\n",
|
BIO_printf(out, "Responder Error: %s (%d)\n",
|
||||||
OCSP_response_status_str(i), i);
|
OCSP_response_status_str(i), i);
|
||||||
|
if (ignore_err)
|
||||||
|
goto redo_accept;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -856,7 +850,7 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if(i <= 0)
|
if(i <= 0)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err, "Response Verify Failure\n", i);
|
BIO_printf(bio_err, "Response Verify Failure\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -879,7 +873,7 @@ end:
|
|||||||
X509_free(cert);
|
X509_free(cert);
|
||||||
X509_free(rsigner);
|
X509_free(rsigner);
|
||||||
X509_free(rca_cert);
|
X509_free(rca_cert);
|
||||||
TXT_DB_free(rdb);
|
free_index(rdb);
|
||||||
BIO_free_all(cbio);
|
BIO_free_all(cbio);
|
||||||
BIO_free_all(acbio);
|
BIO_free_all(acbio);
|
||||||
BIO_free(out);
|
BIO_free(out);
|
||||||
@@ -899,7 +893,7 @@ end:
|
|||||||
SSL_CTX_free(ctx);
|
SSL_CTX_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
|
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
|
||||||
@@ -1021,7 +1015,7 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db,
|
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
|
||||||
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
||||||
STACK_OF(X509) *rother, unsigned long flags,
|
STACK_OF(X509) *rother, unsigned long flags,
|
||||||
int nmin, int ndays)
|
int nmin, int ndays)
|
||||||
@@ -1113,7 +1107,7 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *d
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser)
|
static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
BIGNUM *bn = NULL;
|
BIGNUM *bn = NULL;
|
||||||
@@ -1126,7 +1120,7 @@ static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser)
|
|||||||
itmp = BN_bn2hex(bn);
|
itmp = BN_bn2hex(bn);
|
||||||
row[DB_serial] = itmp;
|
row[DB_serial] = itmp;
|
||||||
BN_free(bn);
|
BN_free(bn);
|
||||||
rrow=TXT_DB_get_by_index(db,DB_serial,row);
|
rrow=TXT_DB_get_by_index(db->db,DB_serial,row);
|
||||||
OPENSSL_free(itmp);
|
OPENSSL_free(itmp);
|
||||||
return rrow;
|
return rrow;
|
||||||
}
|
}
|
||||||
@@ -1139,7 +1133,11 @@ static BIO *init_responder(char *port)
|
|||||||
bufbio = BIO_new(BIO_f_buffer());
|
bufbio = BIO_new(BIO_f_buffer());
|
||||||
if (!bufbio)
|
if (!bufbio)
|
||||||
goto err;
|
goto err;
|
||||||
|
#ifndef OPENSSL_NO_SOCK
|
||||||
acbio = BIO_new_accept(port);
|
acbio = BIO_new_accept(port);
|
||||||
|
#else
|
||||||
|
BIO_printf(bio_err, "Error setting up accept BIO - sockets not supported.\n");
|
||||||
|
#endif
|
||||||
if (!acbio)
|
if (!acbio)
|
||||||
goto err;
|
goto err;
|
||||||
BIO_set_accept_bios(acbio, bufbio);
|
BIO_set_accept_bios(acbio, bufbio);
|
||||||
@@ -1226,3 +1224,4 @@ static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -122,7 +122,9 @@
|
|||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
|
#endif
|
||||||
#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
|
#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
|
||||||
#include "progs.h"
|
#include "progs.h"
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
@@ -161,7 +163,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type < 0 || type > CRYPTO_NUM_LOCKS)
|
if (type < 0 || type >= CRYPTO_NUM_LOCKS)
|
||||||
{
|
{
|
||||||
errstr = "type out of bounds";
|
errstr = "type out of bounds";
|
||||||
goto err;
|
goto err;
|
||||||
@@ -358,7 +360,7 @@ end:
|
|||||||
BIO_free(bio_err);
|
BIO_free(bio_err);
|
||||||
bio_err=NULL;
|
bio_err=NULL;
|
||||||
}
|
}
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LIST_STANDARD_COMMANDS "list-standard-commands"
|
#define LIST_STANDARD_COMMANDS "list-standard-commands"
|
||||||
|
|||||||
@@ -38,10 +38,14 @@ dir = ./demoCA # Where everything is kept
|
|||||||
certs = $dir/certs # Where the issued certs are kept
|
certs = $dir/certs # Where the issued certs are kept
|
||||||
crl_dir = $dir/crl # Where the issued crl are kept
|
crl_dir = $dir/crl # Where the issued crl are kept
|
||||||
database = $dir/index.txt # database index file.
|
database = $dir/index.txt # database index file.
|
||||||
|
#unique_subject = no # Set to 'no' to allow creation of
|
||||||
|
# several ctificates with same subject.
|
||||||
new_certs_dir = $dir/newcerts # default place for new certs.
|
new_certs_dir = $dir/newcerts # default place for new certs.
|
||||||
|
|
||||||
certificate = $dir/cacert.pem # The CA certificate
|
certificate = $dir/cacert.pem # The CA certificate
|
||||||
serial = $dir/serial # The current serial number
|
serial = $dir/serial # The current serial number
|
||||||
|
crlnumber = $dir/crlnumber # the current crl number
|
||||||
|
# must be commented out to leave a V1 CRL
|
||||||
crl = $dir/crl.pem # The current CRL
|
crl = $dir/crl.pem # The current CRL
|
||||||
private_key = $dir/private/cakey.pem# The private key
|
private_key = $dir/private/cakey.pem# The private key
|
||||||
RANDFILE = $dir/private/.rand # private random number file
|
RANDFILE = $dir/private/.rand # private random number file
|
||||||
@@ -58,6 +62,7 @@ cert_opt = ca_default # Certificate field options
|
|||||||
|
|
||||||
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
||||||
# so this is commented out by default to leave a V1 CRL.
|
# so this is commented out by default to leave a V1 CRL.
|
||||||
|
# crlnumber must also be commented out to leave a V1 CRL.
|
||||||
# crl_extensions = crl_ext
|
# crl_extensions = crl_ext
|
||||||
|
|
||||||
default_days = 365 # how long to certify for
|
default_days = 365 # how long to certify for
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ err:
|
|||||||
if (out)
|
if (out)
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -312,7 +312,8 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
|
|||||||
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
|
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
|
||||||
unsigned char buf[MD5_DIGEST_LENGTH];
|
unsigned char buf[MD5_DIGEST_LENGTH];
|
||||||
char *salt_out;
|
char *salt_out;
|
||||||
int n, i;
|
int n;
|
||||||
|
unsigned int i;
|
||||||
EVP_MD_CTX md,md2;
|
EVP_MD_CTX md,md2;
|
||||||
size_t passwd_len, salt_len;
|
size_t passwd_len, salt_len;
|
||||||
|
|
||||||
@@ -505,6 +506,6 @@ err:
|
|||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
fputs("Program not available.\n", stderr)
|
fputs("Program not available.\n", stderr)
|
||||||
EXIT(1);
|
OPENSSL_EXIT(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -120,7 +120,9 @@ int MAIN(int argc, char **argv)
|
|||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
char *inrand = NULL;
|
char *inrand = NULL;
|
||||||
char *CApath = NULL, *CAfile = NULL;
|
char *CApath = NULL, *CAfile = NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -259,11 +261,13 @@ int MAIN(int argc, char **argv)
|
|||||||
args++;
|
args++;
|
||||||
CAfile = *args;
|
CAfile = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
} else if (!strcmp(*args,"-engine")) {
|
} else if (!strcmp(*args,"-engine")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
engine = *args;
|
engine = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
#endif
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
@@ -311,14 +315,18 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-password p set import/export password source\n");
|
BIO_printf (bio_err, "-password p set import/export password source\n");
|
||||||
BIO_printf (bio_err, "-passin p input file pass phrase source\n");
|
BIO_printf (bio_err, "-passin p input file pass phrase source\n");
|
||||||
BIO_printf (bio_err, "-passout p output file pass phrase source\n");
|
BIO_printf (bio_err, "-passout p output file pass phrase source\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
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, " load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
BIO_printf(bio_err, " the random number generator\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(passarg) {
|
if(passarg) {
|
||||||
if(export_cert) passargout = passarg;
|
if(export_cert) passargout = passarg;
|
||||||
@@ -543,14 +551,14 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "Can't read Password\n");
|
BIO_printf (bio_err, "Can't read Password\n");
|
||||||
goto export_end;
|
goto export_end;
|
||||||
}
|
}
|
||||||
if (!twopass) strcpy(macpass, pass);
|
if (!twopass) BUF_strlcpy(macpass, pass, sizeof macpass);
|
||||||
|
|
||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_pop_info();
|
CRYPTO_pop_info();
|
||||||
CRYPTO_push_info("creating PKCS#12 structure");
|
CRYPTO_push_info("creating PKCS#12 structure");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
p12 = PKCS12_create(pass, name, key, ucert, certs,
|
p12 = PKCS12_create(cpass, name, key, ucert, certs,
|
||||||
key_pbe, cert_pbe, iter, -1, keytype);
|
key_pbe, cert_pbe, iter, -1, keytype);
|
||||||
|
|
||||||
if (!p12)
|
if (!p12)
|
||||||
@@ -605,7 +613,7 @@ int MAIN(int argc, char **argv)
|
|||||||
CRYPTO_pop_info();
|
CRYPTO_pop_info();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!twopass) strcpy(macpass, pass);
|
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) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1);
|
||||||
if(macver) {
|
if(macver) {
|
||||||
@@ -651,7 +659,7 @@ int MAIN(int argc, char **argv)
|
|||||||
if(passin) OPENSSL_free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
if(passout) OPENSSL_free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
||||||
@@ -803,11 +811,12 @@ err:
|
|||||||
int alg_print (BIO *x, X509_ALGOR *alg)
|
int alg_print (BIO *x, X509_ALGOR *alg)
|
||||||
{
|
{
|
||||||
PBEPARAM *pbe;
|
PBEPARAM *pbe;
|
||||||
unsigned char *p;
|
const unsigned char *p;
|
||||||
p = alg->parameter->value.sequence->data;
|
p = alg->parameter->value.sequence->data;
|
||||||
pbe = d2i_PBEPARAM (NULL, &p, alg->parameter->value.sequence->length);
|
pbe = d2i_PBEPARAM (NULL, &p, alg->parameter->value.sequence->length);
|
||||||
BIO_printf (bio_err, "%s, Iteration %d\n",
|
BIO_printf (bio_err, "%s, Iteration %ld\n",
|
||||||
OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)), ASN1_INTEGER_get(pbe->iter));
|
OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)),
|
||||||
|
ASN1_INTEGER_get(pbe->iter));
|
||||||
PBEPARAM_free (pbe);
|
PBEPARAM_free (pbe);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
15
apps/pkcs7.c
15
apps/pkcs7.c
@@ -82,7 +82,9 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
PKCS7 *p7=NULL;
|
PKCS7 *p7=NULL;
|
||||||
int i,badops=0;
|
int i,badops=0;
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
@@ -90,7 +92,9 @@ int MAIN(int argc, char **argv)
|
|||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog;
|
||||||
int print_certs=0,text=0,noout=0;
|
int print_certs=0,text=0,noout=0;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -98,6 +102,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -134,11 +141,13 @@ int MAIN(int argc, char **argv)
|
|||||||
text=1;
|
text=1;
|
||||||
else if (strcmp(*argv,"-print_certs") == 0)
|
else if (strcmp(*argv,"-print_certs") == 0)
|
||||||
print_certs=1;
|
print_certs=1;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
@@ -161,14 +170,18 @@ bad:
|
|||||||
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
|
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
|
||||||
BIO_printf(bio_err," -text print full details of certificates\n");
|
BIO_printf(bio_err," -text print full details of certificates\n");
|
||||||
BIO_printf(bio_err," -noout don't output encoded data\n");
|
BIO_printf(bio_err," -noout don't output encoded data\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
@@ -301,5 +314,5 @@ end:
|
|||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free_all(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
36
apps/pkcs8.c
36
apps/pkcs8.c
@@ -85,7 +85,9 @@ int MAIN(int argc, char **argv)
|
|||||||
EVP_PKEY *pkey=NULL;
|
EVP_PKEY *pkey=NULL;
|
||||||
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
@@ -145,11 +147,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (!args[1]) goto bad;
|
if (!args[1]) goto bad;
|
||||||
passargout= *(++args);
|
passargout= *(++args);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*args,"-engine") == 0)
|
else if (strcmp(*args,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (!args[1]) goto bad;
|
if (!args[1]) goto bad;
|
||||||
engine= *(++args);
|
engine= *(++args);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (!strcmp (*args, "-in")) {
|
else if (!strcmp (*args, "-in")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
@@ -182,11 +186,15 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
|
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
|
||||||
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
||||||
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
@@ -224,11 +232,14 @@ int MAIN(int argc, char **argv)
|
|||||||
pkey = load_key(bio_err, infile, informat, 1,
|
pkey = load_key(bio_err, infile, informat, 1,
|
||||||
passin, e, "key");
|
passin, e, "key");
|
||||||
if (!pkey) {
|
if (!pkey) {
|
||||||
|
BIO_free_all(out);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
|
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
|
||||||
BIO_printf(bio_err, "Error converting key\n", outfile);
|
BIO_printf(bio_err, "Error converting key\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
BIO_free_all(out);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
if(nocrypt) {
|
if(nocrypt) {
|
||||||
@@ -238,6 +249,9 @@ int MAIN(int argc, char **argv)
|
|||||||
i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8inf);
|
i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8inf);
|
||||||
else {
|
else {
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
|
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
BIO_free_all(out);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -245,15 +259,22 @@ int MAIN(int argc, char **argv)
|
|||||||
else {
|
else {
|
||||||
p8pass = pass;
|
p8pass = pass;
|
||||||
if (EVP_read_pw_string(pass, sizeof pass, "Enter Encryption Password:", 1))
|
if (EVP_read_pw_string(pass, sizeof pass, "Enter Encryption Password:", 1))
|
||||||
|
{
|
||||||
|
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
BIO_free_all(out);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
||||||
p8pass, strlen(p8pass),
|
p8pass, strlen(p8pass),
|
||||||
NULL, 0, iter, p8inf))) {
|
NULL, 0, iter, p8inf))) {
|
||||||
BIO_printf(bio_err, "Error encrypting key\n",
|
BIO_printf(bio_err, "Error encrypting key\n");
|
||||||
outfile);
|
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
|
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
BIO_free_all(out);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
app_RAND_write_file(NULL, bio_err);
|
app_RAND_write_file(NULL, bio_err);
|
||||||
@@ -263,6 +284,9 @@ int MAIN(int argc, char **argv)
|
|||||||
i2d_PKCS8_bio(out, p8);
|
i2d_PKCS8_bio(out, p8);
|
||||||
else {
|
else {
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||||
|
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
BIO_free_all(out);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
X509_SIG_free(p8);
|
X509_SIG_free(p8);
|
||||||
@@ -295,7 +319,7 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!p8) {
|
if (!p8) {
|
||||||
BIO_printf (bio_err, "Error reading key\n", outfile);
|
BIO_printf (bio_err, "Error reading key\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@@ -309,13 +333,13 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!p8inf) {
|
if (!p8inf) {
|
||||||
BIO_printf(bio_err, "Error decrypting key\n", outfile);
|
BIO_printf(bio_err, "Error decrypting key\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(pkey = EVP_PKCS82PKEY(p8inf))) {
|
if (!(pkey = EVP_PKCS82PKEY(p8inf))) {
|
||||||
BIO_printf(bio_err, "Error converting key\n", outfile);
|
BIO_printf(bio_err, "Error converting key\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ extern int pkcs8_main(int argc,char *argv[]);
|
|||||||
extern int spkac_main(int argc,char *argv[]);
|
extern int spkac_main(int argc,char *argv[]);
|
||||||
extern int smime_main(int argc,char *argv[]);
|
extern int smime_main(int argc,char *argv[]);
|
||||||
extern int rand_main(int argc,char *argv[]);
|
extern int rand_main(int argc,char *argv[]);
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
extern int engine_main(int argc,char *argv[]);
|
extern int engine_main(int argc,char *argv[]);
|
||||||
|
#endif
|
||||||
extern int ocsp_main(int argc,char *argv[]);
|
extern int ocsp_main(int argc,char *argv[]);
|
||||||
|
|
||||||
#define FUNC_TYPE_GENERAL 1
|
#define FUNC_TYPE_GENERAL 1
|
||||||
@@ -100,7 +102,9 @@ FUNCTION functions[] = {
|
|||||||
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL,"s_client",s_client_main},
|
{FUNC_TYPE_GENERAL,"s_client",s_client_main},
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_SPEED
|
||||||
{FUNC_TYPE_GENERAL,"speed",speed_main},
|
{FUNC_TYPE_GENERAL,"speed",speed_main},
|
||||||
|
#endif
|
||||||
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL,"s_time",s_time_main},
|
{FUNC_TYPE_GENERAL,"s_time",s_time_main},
|
||||||
#endif
|
#endif
|
||||||
@@ -119,7 +123,9 @@ FUNCTION functions[] = {
|
|||||||
{FUNC_TYPE_GENERAL,"spkac",spkac_main},
|
{FUNC_TYPE_GENERAL,"spkac",spkac_main},
|
||||||
{FUNC_TYPE_GENERAL,"smime",smime_main},
|
{FUNC_TYPE_GENERAL,"smime",smime_main},
|
||||||
{FUNC_TYPE_GENERAL,"rand",rand_main},
|
{FUNC_TYPE_GENERAL,"rand",rand_main},
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
{FUNC_TYPE_GENERAL,"engine",engine_main},
|
{FUNC_TYPE_GENERAL,"engine",engine_main},
|
||||||
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
|
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
|
||||||
#ifndef OPENSSL_NO_MD2
|
#ifndef OPENSSL_NO_MD2
|
||||||
{FUNC_TYPE_MD,"md2",dgst_main},
|
{FUNC_TYPE_MD,"md2",dgst_main},
|
||||||
|
|||||||
14
apps/rand.c
14
apps/rand.c
@@ -76,7 +76,9 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
int i, r, ret = 1;
|
int i, r, ret = 1;
|
||||||
int badopt;
|
int badopt;
|
||||||
char *outfile = NULL;
|
char *outfile = NULL;
|
||||||
@@ -84,7 +86,9 @@ int MAIN(int argc, char **argv)
|
|||||||
int base64 = 0;
|
int base64 = 0;
|
||||||
BIO *out = NULL;
|
BIO *out = NULL;
|
||||||
int num = -1;
|
int num = -1;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -106,6 +110,7 @@ int MAIN(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(argv[i], "-engine") == 0)
|
else if (strcmp(argv[i], "-engine") == 0)
|
||||||
{
|
{
|
||||||
if ((argv[i+1] != NULL) && (engine == NULL))
|
if ((argv[i+1] != NULL) && (engine == NULL))
|
||||||
@@ -113,6 +118,7 @@ int MAIN(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(argv[i], "-rand") == 0)
|
else if (strcmp(argv[i], "-rand") == 0)
|
||||||
{
|
{
|
||||||
if ((argv[i+1] != NULL) && (inrand == NULL))
|
if ((argv[i+1] != NULL) && (inrand == NULL))
|
||||||
@@ -150,13 +156,17 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf(bio_err, "Usage: rand [options] num\n");
|
BIO_printf(bio_err, "Usage: rand [options] num\n");
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "where options are\n");
|
||||||
BIO_printf(bio_err, "-out file - write to file\n");
|
BIO_printf(bio_err, "-out file - write to file\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err, "-base64 - encode output\n");
|
BIO_printf(bio_err, "-base64 - encode output\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||||
if (inrand != NULL)
|
if (inrand != NULL)
|
||||||
@@ -195,7 +205,7 @@ int MAIN(int argc, char **argv)
|
|||||||
int chunk;
|
int chunk;
|
||||||
|
|
||||||
chunk = num;
|
chunk = num;
|
||||||
if (chunk > sizeof buf)
|
if (chunk > (int)sizeof(buf))
|
||||||
chunk = sizeof buf;
|
chunk = sizeof buf;
|
||||||
r = RAND_bytes(buf, chunk);
|
r = RAND_bytes(buf, chunk);
|
||||||
if (r <= 0)
|
if (r <= 0)
|
||||||
@@ -213,5 +223,5 @@ err:
|
|||||||
if (out)
|
if (out)
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
145
apps/req.c
145
apps/req.c
@@ -56,6 +56,12 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
|
* deprecated functions for openssl-internal code */
|
||||||
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -113,9 +119,10 @@
|
|||||||
* require. This format is wrong
|
* require. This format is wrong
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,char *dn,int attribs,
|
static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,char *dn,int mutlirdn,
|
||||||
unsigned long chtype);
|
int attribs,unsigned long chtype);
|
||||||
static int build_subject(X509_REQ *req, char *subj, unsigned long chtype);
|
static int build_subject(X509_REQ *req, char *subj, unsigned long chtype,
|
||||||
|
int multirdn);
|
||||||
static int prompt_info(X509_REQ *req,
|
static int prompt_info(X509_REQ *req,
|
||||||
STACK_OF(CONF_VALUE) *dn_sk, char *dn_sect,
|
STACK_OF(CONF_VALUE) *dn_sk, char *dn_sect,
|
||||||
STACK_OF(CONF_VALUE) *attr_sk, char *attr_sect, int attribs,
|
STACK_OF(CONF_VALUE) *attr_sk, char *attr_sect, int attribs,
|
||||||
@@ -127,15 +134,14 @@ static int add_attribute_object(X509_REQ *req, char *text,
|
|||||||
char *def, char *value, int nid, int n_min,
|
char *def, char *value, int nid, int n_min,
|
||||||
int n_max, unsigned long chtype);
|
int n_max, unsigned long chtype);
|
||||||
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
||||||
int nid,int n_min,int n_max, unsigned long chtype);
|
int nid,int n_min,int n_max, unsigned long chtype, int mval);
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
static void MS_CALLBACK req_cb(int p,int n,void *arg);
|
static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb);
|
||||||
#endif
|
#endif
|
||||||
static int req_check_len(int len,int n_min,int n_max);
|
static int req_check_len(int len,int n_min,int n_max);
|
||||||
static int check_end(char *str, char *end);
|
static int check_end(char *str, char *end);
|
||||||
#ifndef MONOLITH
|
#ifndef MONOLITH
|
||||||
static char *default_config_file=NULL;
|
static char *default_config_file=NULL;
|
||||||
static CONF *config=NULL;
|
|
||||||
#endif
|
#endif
|
||||||
static CONF *req_conf=NULL;
|
static CONF *req_conf=NULL;
|
||||||
static int batch=0;
|
static int batch=0;
|
||||||
@@ -167,7 +173,9 @@ int MAIN(int argc, char **argv)
|
|||||||
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
|
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
|
||||||
int nodes=0,kludge=0,newhdr=0,subject=0,pubkey=0;
|
int nodes=0,kludge=0,newhdr=0,subject=0,pubkey=0;
|
||||||
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
|
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
char *extensions = NULL;
|
char *extensions = NULL;
|
||||||
char *req_exts = NULL;
|
char *req_exts = NULL;
|
||||||
const EVP_CIPHER *cipher=NULL;
|
const EVP_CIPHER *cipher=NULL;
|
||||||
@@ -178,6 +186,7 @@ int MAIN(int argc, char **argv)
|
|||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
char *subj = NULL;
|
char *subj = NULL;
|
||||||
|
int multirdn = 0;
|
||||||
const EVP_MD *md_alg=NULL,*digest=EVP_md5();
|
const EVP_MD *md_alg=NULL,*digest=EVP_md5();
|
||||||
unsigned long chtype = MBSTRING_ASC;
|
unsigned long chtype = MBSTRING_ASC;
|
||||||
#ifndef MONOLITH
|
#ifndef MONOLITH
|
||||||
@@ -215,11 +224,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outformat=str2fmt(*(++argv));
|
outformat=str2fmt(*(++argv));
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-key") == 0)
|
else if (strcmp(*argv,"-key") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -431,6 +442,8 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
subj= *(++argv);
|
subj= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-multivalue-rdn") == 0)
|
||||||
|
multirdn=1;
|
||||||
else if (strcmp(*argv,"-days") == 0)
|
else if (strcmp(*argv,"-days") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -483,7 +496,9 @@ bad:
|
|||||||
BIO_printf(bio_err," -verify verify signature on REQ\n");
|
BIO_printf(bio_err," -verify verify signature on REQ\n");
|
||||||
BIO_printf(bio_err," -modulus RSA modulus\n");
|
BIO_printf(bio_err," -modulus RSA modulus\n");
|
||||||
BIO_printf(bio_err," -nodes don't encrypt the output key\n");
|
BIO_printf(bio_err," -nodes don't encrypt the output key\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -subject output the request's subject\n");
|
BIO_printf(bio_err," -subject output the request's subject\n");
|
||||||
BIO_printf(bio_err," -passin private key password source\n");
|
BIO_printf(bio_err," -passin private key password source\n");
|
||||||
BIO_printf(bio_err," -key file use the private key contained in file\n");
|
BIO_printf(bio_err," -key file use the private key contained in file\n");
|
||||||
@@ -500,6 +515,7 @@ bad:
|
|||||||
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2, md4)\n");
|
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2, md4)\n");
|
||||||
BIO_printf(bio_err," -config file request template file.\n");
|
BIO_printf(bio_err," -config file request template file.\n");
|
||||||
BIO_printf(bio_err," -subj arg set or modify request subject\n");
|
BIO_printf(bio_err," -subj arg set or modify request subject\n");
|
||||||
|
BIO_printf(bio_err," -multivalue-rdn enable support for multivalued RDNs\n");
|
||||||
BIO_printf(bio_err," -new new request.\n");
|
BIO_printf(bio_err," -new new request.\n");
|
||||||
BIO_printf(bio_err," -batch do not ask anything during request generation\n");
|
BIO_printf(bio_err," -batch do not ask anything during request generation\n");
|
||||||
BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n");
|
BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n");
|
||||||
@@ -675,7 +691,9 @@ bad:
|
|||||||
if ((in == NULL) || (out == NULL))
|
if ((in == NULL) || (out == NULL))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (keyfile != NULL)
|
if (keyfile != NULL)
|
||||||
{
|
{
|
||||||
@@ -699,6 +717,7 @@ bad:
|
|||||||
|
|
||||||
if (newreq && (pkey == NULL))
|
if (newreq && (pkey == NULL))
|
||||||
{
|
{
|
||||||
|
BN_GENCB cb;
|
||||||
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
|
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||||
if (randfile == NULL)
|
if (randfile == NULL)
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
@@ -715,23 +734,27 @@ bad:
|
|||||||
if (newkey < MIN_KEY_LENGTH && (pkey_type == TYPE_RSA || pkey_type == TYPE_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,"private key length is too short,\n");
|
||||||
BIO_printf(bio_err,"it needs to be at least %d bits, not %d\n",MIN_KEY_LENGTH,newkey);
|
BIO_printf(bio_err,"it needs to be at least %d bits, not %ld\n",MIN_KEY_LENGTH,newkey);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
BIO_printf(bio_err,"Generating a %d bit %s private key\n",
|
BIO_printf(bio_err,"Generating a %ld bit %s private key\n",
|
||||||
newkey,(pkey_type == TYPE_RSA)?"RSA":
|
newkey,(pkey_type == TYPE_RSA)?"RSA":
|
||||||
(pkey_type == TYPE_DSA)?"DSA":"EC");
|
(pkey_type == TYPE_DSA)?"DSA":"EC");
|
||||||
|
|
||||||
if ((pkey=EVP_PKEY_new()) == NULL) goto end;
|
if ((pkey=EVP_PKEY_new()) == NULL) goto end;
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
|
BN_GENCB_set(&cb, req_cb, bio_err);
|
||||||
if (pkey_type == TYPE_RSA)
|
if (pkey_type == TYPE_RSA)
|
||||||
{
|
{
|
||||||
if (!EVP_PKEY_assign_RSA(pkey,
|
RSA *rsa = RSA_new();
|
||||||
RSA_generate_key(newkey,0x10001,
|
if(!rsa || !RSA_generate_key_ex(rsa, newkey, 0x10001, &cb) ||
|
||||||
req_cb,bio_err)))
|
!EVP_PKEY_assign_RSA(pkey, rsa))
|
||||||
|
{
|
||||||
|
if(rsa) RSA_free(rsa);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
@@ -869,7 +892,7 @@ loop:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
i=make_REQ(req,pkey,subj,!x509, chtype);
|
i=make_REQ(req,pkey,subj,multirdn,!x509, chtype);
|
||||||
subj=NULL; /* done processing '-subj' option */
|
subj=NULL; /* done processing '-subj' option */
|
||||||
if ((kludge > 0) && !sk_X509_ATTRIBUTE_num(req->req_info->attributes))
|
if ((kludge > 0) && !sk_X509_ATTRIBUTE_num(req->req_info->attributes))
|
||||||
{
|
{
|
||||||
@@ -889,7 +912,7 @@ loop:
|
|||||||
if ((x509ss=X509_new()) == NULL) goto end;
|
if ((x509ss=X509_new()) == NULL) goto end;
|
||||||
|
|
||||||
/* Set version to V3 */
|
/* Set version to V3 */
|
||||||
if(!X509_set_version(x509ss, 2)) goto end;
|
if(extensions && !X509_set_version(x509ss, 2)) goto end;
|
||||||
if (serial)
|
if (serial)
|
||||||
{
|
{
|
||||||
if (!X509_set_serialNumber(x509ss, serial)) goto end;
|
if (!X509_set_serialNumber(x509ss, serial)) goto end;
|
||||||
@@ -962,7 +985,7 @@ loop:
|
|||||||
print_name(bio_err, "old subject=", X509_REQ_get_subject_name(req), nmflag);
|
print_name(bio_err, "old subject=", X509_REQ_get_subject_name(req), nmflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (build_subject(req, subj, chtype) == 0)
|
if (build_subject(req, subj, chtype, multirdn) == 0)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err, "ERROR: cannot modify subject\n");
|
BIO_printf(bio_err, "ERROR: cannot modify subject\n");
|
||||||
ex=1;
|
ex=1;
|
||||||
@@ -1150,11 +1173,11 @@ end:
|
|||||||
if (ec_params != NULL) EC_KEY_free(ec_params);
|
if (ec_params != NULL) EC_KEY_free(ec_params);
|
||||||
#endif
|
#endif
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ex);
|
OPENSSL_EXIT(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs,
|
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int multirdn,
|
||||||
unsigned long chtype)
|
int attribs, unsigned long chtype)
|
||||||
{
|
{
|
||||||
int ret=0,i;
|
int ret=0,i;
|
||||||
char no_prompt = 0;
|
char no_prompt = 0;
|
||||||
@@ -1204,7 +1227,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (subj)
|
if (subj)
|
||||||
i = build_subject(req, subj, chtype);
|
i = build_subject(req, subj, chtype, multirdn);
|
||||||
else
|
else
|
||||||
i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs, chtype);
|
i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs, chtype);
|
||||||
}
|
}
|
||||||
@@ -1221,11 +1244,11 @@ err:
|
|||||||
* subject is expected to be in the format /type0=value0/type1=value1/type2=...
|
* subject is expected to be in the format /type0=value0/type1=value1/type2=...
|
||||||
* where characters may be escaped by \
|
* where characters may be escaped by \
|
||||||
*/
|
*/
|
||||||
static int build_subject(X509_REQ *req, char *subject, unsigned long chtype)
|
static int build_subject(X509_REQ *req, char *subject, unsigned long chtype, int multirdn)
|
||||||
{
|
{
|
||||||
X509_NAME *n;
|
X509_NAME *n;
|
||||||
|
|
||||||
if (!(n = do_subject(subject, chtype)))
|
if (!(n = parse_name(subject, chtype, multirdn)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!X509_REQ_set_subject_name(req, n))
|
if (!X509_REQ_set_subject_name(req, n))
|
||||||
@@ -1246,7 +1269,7 @@ static int prompt_info(X509_REQ *req,
|
|||||||
int i;
|
int i;
|
||||||
char *p,*q;
|
char *p,*q;
|
||||||
char buf[100];
|
char buf[100];
|
||||||
int nid;
|
int nid, mval;
|
||||||
long n_min,n_max;
|
long n_min,n_max;
|
||||||
char *type,*def,*value;
|
char *type,*def,*value;
|
||||||
CONF_VALUE *v;
|
CONF_VALUE *v;
|
||||||
@@ -1289,38 +1312,51 @@ start: for (;;)
|
|||||||
if(*p) type = p;
|
if(*p) type = p;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (*type == '+')
|
||||||
|
{
|
||||||
|
mval = -1;
|
||||||
|
type++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mval = 0;
|
||||||
/* If OBJ not recognised ignore it */
|
/* If OBJ not recognised ignore it */
|
||||||
if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start;
|
if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start;
|
||||||
|
if (BIO_snprintf(buf,sizeof buf,"%s_default",v->name)
|
||||||
if(strlen(v->name) > sizeof buf-9)
|
>= (int)sizeof(buf))
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
|
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf,"%s_default",v->name);
|
|
||||||
if ((def=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
if ((def=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||||
{
|
{
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
def="";
|
def="";
|
||||||
}
|
}
|
||||||
sprintf(buf,"%s_value",v->name);
|
|
||||||
|
BIO_snprintf(buf,sizeof buf,"%s_value",v->name);
|
||||||
if ((value=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
if ((value=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||||
{
|
{
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
value=NULL;
|
value=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf,"%s_min",v->name);
|
BIO_snprintf(buf,sizeof buf,"%s_min",v->name);
|
||||||
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_min))
|
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_min))
|
||||||
|
{
|
||||||
|
ERR_clear_error();
|
||||||
n_min = -1;
|
n_min = -1;
|
||||||
|
}
|
||||||
|
|
||||||
sprintf(buf,"%s_max",v->name);
|
BIO_snprintf(buf,sizeof buf,"%s_max",v->name);
|
||||||
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_max))
|
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_max))
|
||||||
|
{
|
||||||
|
ERR_clear_error();
|
||||||
n_max = -1;
|
n_max = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!add_DN_object(subj,v->value,def,value,nid,
|
if (!add_DN_object(subj,v->value,def,value,nid,
|
||||||
n_min,n_max, chtype))
|
n_min,n_max, chtype, mval))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (X509_NAME_entry_count(subj) == 0)
|
if (X509_NAME_entry_count(subj) == 0)
|
||||||
@@ -1350,13 +1386,13 @@ start2: for (;;)
|
|||||||
if ((nid=OBJ_txt2nid(type)) == NID_undef)
|
if ((nid=OBJ_txt2nid(type)) == NID_undef)
|
||||||
goto start2;
|
goto start2;
|
||||||
|
|
||||||
if(strlen(v->name) > sizeof buf-9)
|
if (BIO_snprintf(buf,sizeof buf,"%s_default",type)
|
||||||
|
>= (int)sizeof(buf))
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
|
BIO_printf(bio_err,"Name '%s' too long\n",v->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf,"%s_default",type);
|
|
||||||
if ((def=NCONF_get_string(req_conf,attr_sect,buf))
|
if ((def=NCONF_get_string(req_conf,attr_sect,buf))
|
||||||
== NULL)
|
== NULL)
|
||||||
{
|
{
|
||||||
@@ -1365,7 +1401,7 @@ start2: for (;;)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sprintf(buf,"%s_value",type);
|
BIO_snprintf(buf,sizeof buf,"%s_value",type);
|
||||||
if ((value=NCONF_get_string(req_conf,attr_sect,buf))
|
if ((value=NCONF_get_string(req_conf,attr_sect,buf))
|
||||||
== NULL)
|
== NULL)
|
||||||
{
|
{
|
||||||
@@ -1373,11 +1409,11 @@ start2: for (;;)
|
|||||||
value=NULL;
|
value=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf,"%s_min",type);
|
BIO_snprintf(buf,sizeof buf,"%s_min",type);
|
||||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
|
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
|
||||||
n_min = -1;
|
n_min = -1;
|
||||||
|
|
||||||
sprintf(buf,"%s_max",type);
|
BIO_snprintf(buf,sizeof buf,"%s_max",type);
|
||||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
|
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
|
||||||
n_max = -1;
|
n_max = -1;
|
||||||
|
|
||||||
@@ -1410,6 +1446,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
|
|||||||
|
|
||||||
for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++)
|
for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++)
|
||||||
{
|
{
|
||||||
|
int mval;
|
||||||
v=sk_CONF_VALUE_value(dn_sk,i);
|
v=sk_CONF_VALUE_value(dn_sk,i);
|
||||||
p=q=NULL;
|
p=q=NULL;
|
||||||
type=v->name;
|
type=v->name;
|
||||||
@@ -1426,8 +1463,19 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
|
|||||||
if(*p) type = p;
|
if(*p) type = p;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifndef CHARSET_EBCDIC
|
||||||
|
if (*p == '+')
|
||||||
|
#else
|
||||||
|
if (*p == os_toascii['+'])
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
p++;
|
||||||
|
mval = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mval = 0;
|
||||||
if (!X509_NAME_add_entry_by_txt(subj,type, chtype,
|
if (!X509_NAME_add_entry_by_txt(subj,type, chtype,
|
||||||
(unsigned char *) v->value,-1,-1,0)) return 0;
|
(unsigned char *) v->value,-1,-1,mval)) return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1450,7 +1498,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
|
|||||||
|
|
||||||
|
|
||||||
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
||||||
int nid, int n_min, int n_max, unsigned long chtype)
|
int nid, int n_min, int n_max, unsigned long chtype, int mval)
|
||||||
{
|
{
|
||||||
int i,ret=0;
|
int i,ret=0;
|
||||||
MS_STATIC char buf[1024];
|
MS_STATIC char buf[1024];
|
||||||
@@ -1459,9 +1507,8 @@ start:
|
|||||||
(void)BIO_flush(bio_err);
|
(void)BIO_flush(bio_err);
|
||||||
if(value != NULL)
|
if(value != NULL)
|
||||||
{
|
{
|
||||||
OPENSSL_assert(strlen(value) < sizeof buf-2);
|
BUF_strlcpy(buf,value,sizeof buf);
|
||||||
strcpy(buf,value);
|
BUF_strlcat(buf,"\n",sizeof buf);
|
||||||
strcat(buf,"\n");
|
|
||||||
BIO_printf(bio_err,"%s\n",value);
|
BIO_printf(bio_err,"%s\n",value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1483,8 +1530,8 @@ start:
|
|||||||
{
|
{
|
||||||
if ((def == NULL) || (def[0] == '\0'))
|
if ((def == NULL) || (def[0] == '\0'))
|
||||||
return(1);
|
return(1);
|
||||||
strcpy(buf,def);
|
BUF_strlcpy(buf,def,sizeof buf);
|
||||||
strcat(buf,"\n");
|
BUF_strlcat(buf,"\n",sizeof buf);
|
||||||
}
|
}
|
||||||
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
||||||
|
|
||||||
@@ -1500,7 +1547,7 @@ start:
|
|||||||
#endif
|
#endif
|
||||||
if(!req_check_len(i, n_min, n_max)) goto start;
|
if(!req_check_len(i, n_min, n_max)) goto start;
|
||||||
if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
|
if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
|
||||||
(unsigned char *) buf, -1,-1,0)) goto err;
|
(unsigned char *) buf, -1,-1,mval)) goto err;
|
||||||
ret=1;
|
ret=1;
|
||||||
err:
|
err:
|
||||||
return(ret);
|
return(ret);
|
||||||
@@ -1518,9 +1565,8 @@ start:
|
|||||||
(void)BIO_flush(bio_err);
|
(void)BIO_flush(bio_err);
|
||||||
if (value != NULL)
|
if (value != NULL)
|
||||||
{
|
{
|
||||||
OPENSSL_assert(strlen(value) < sizeof buf-2);
|
BUF_strlcpy(buf,value,sizeof buf);
|
||||||
strcpy(buf,value);
|
BUF_strlcat(buf,"\n",sizeof buf);
|
||||||
strcat(buf,"\n");
|
|
||||||
BIO_printf(bio_err,"%s\n",value);
|
BIO_printf(bio_err,"%s\n",value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1542,8 +1588,8 @@ start:
|
|||||||
{
|
{
|
||||||
if ((def == NULL) || (def[0] == '\0'))
|
if ((def == NULL) || (def[0] == '\0'))
|
||||||
return(1);
|
return(1);
|
||||||
strcpy(buf,def);
|
BUF_strlcpy(buf,def,sizeof buf);
|
||||||
strcat(buf,"\n");
|
BUF_strlcat(buf,"\n",sizeof buf);
|
||||||
}
|
}
|
||||||
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
||||||
|
|
||||||
@@ -1572,7 +1618,7 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
static void MS_CALLBACK req_cb(int p, int n, void *arg)
|
static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb)
|
||||||
{
|
{
|
||||||
char c='*';
|
char c='*';
|
||||||
|
|
||||||
@@ -1580,11 +1626,12 @@ static void MS_CALLBACK req_cb(int p, int n, void *arg)
|
|||||||
if (p == 1) c='+';
|
if (p == 1) c='+';
|
||||||
if (p == 2) c='*';
|
if (p == 2) c='*';
|
||||||
if (p == 3) c='\n';
|
if (p == 3) c='\n';
|
||||||
BIO_write((BIO *)arg,&c,1);
|
BIO_write(cb->arg,&c,1);
|
||||||
(void)BIO_flush((BIO *)arg);
|
(void)BIO_flush(cb->arg);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
p=n;
|
p=n;
|
||||||
#endif
|
#endif
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
10
apps/rsa.c
10
apps/rsa.c
@@ -104,7 +104,9 @@ int MAIN(int argc, char **argv)
|
|||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
int modulus=0;
|
int modulus=0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
@@ -156,11 +158,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargout= *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-sgckey") == 0)
|
else if (strcmp(*argv,"-sgckey") == 0)
|
||||||
sgckey=1;
|
sgckey=1;
|
||||||
else if (strcmp(*argv,"-pubin") == 0)
|
else if (strcmp(*argv,"-pubin") == 0)
|
||||||
@@ -212,13 +216,17 @@ bad:
|
|||||||
BIO_printf(bio_err," -check verify key consistency\n");
|
BIO_printf(bio_err," -check verify key consistency\n");
|
||||||
BIO_printf(bio_err," -pubin expect a public key in input file\n");
|
BIO_printf(bio_err," -pubin expect a public key in input file\n");
|
||||||
BIO_printf(bio_err," -pubout output a public key\n");
|
BIO_printf(bio_err," -pubout output a public key\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
@@ -369,7 +377,7 @@ end:
|
|||||||
if(passin) OPENSSL_free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
if(passout) OPENSSL_free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#else /* !OPENSSL_NO_RSA */
|
#else /* !OPENSSL_NO_RSA */
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ int MAIN(int argc, char **argv)
|
|||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
char *infile = NULL, *outfile = NULL;
|
char *infile = NULL, *outfile = NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine = NULL;
|
char *engine = NULL;
|
||||||
|
#endif
|
||||||
char *keyfile = NULL;
|
char *keyfile = NULL;
|
||||||
char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY;
|
char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY;
|
||||||
int keyform = FORMAT_PEM;
|
int keyform = FORMAT_PEM;
|
||||||
@@ -95,6 +97,7 @@ int MAIN(int argc, char **argv)
|
|||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
RSA *rsa = NULL;
|
RSA *rsa = NULL;
|
||||||
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
|
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
|
||||||
|
char *passargin = NULL, *passin = NULL;
|
||||||
int rsa_inlen, rsa_outlen = 0;
|
int rsa_inlen, rsa_outlen = 0;
|
||||||
int keysize;
|
int keysize;
|
||||||
|
|
||||||
@@ -122,12 +125,17 @@ int MAIN(int argc, char **argv)
|
|||||||
} else if(!strcmp(*argv, "-inkey")) {
|
} else if(!strcmp(*argv, "-inkey")) {
|
||||||
if (--argc < 1) badarg = 1;
|
if (--argc < 1) badarg = 1;
|
||||||
keyfile = *(++argv);
|
keyfile = *(++argv);
|
||||||
|
} else if (!strcmp(*argv,"-passin")) {
|
||||||
|
if (--argc < 1) badarg = 1;
|
||||||
|
passargin= *(++argv);
|
||||||
} else if (strcmp(*argv,"-keyform") == 0) {
|
} else if (strcmp(*argv,"-keyform") == 0) {
|
||||||
if (--argc < 1) badarg = 1;
|
if (--argc < 1) badarg = 1;
|
||||||
keyform=str2fmt(*(++argv));
|
keyform=str2fmt(*(++argv));
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
} else if(!strcmp(*argv, "-engine")) {
|
} else if(!strcmp(*argv, "-engine")) {
|
||||||
if (--argc < 1) badarg = 1;
|
if (--argc < 1) badarg = 1;
|
||||||
engine = *(++argv);
|
engine = *(++argv);
|
||||||
|
#endif
|
||||||
} else if(!strcmp(*argv, "-pubin")) {
|
} else if(!strcmp(*argv, "-pubin")) {
|
||||||
key_type = KEY_PUBKEY;
|
key_type = KEY_PUBKEY;
|
||||||
} else if(!strcmp(*argv, "-certin")) {
|
} else if(!strcmp(*argv, "-certin")) {
|
||||||
@@ -162,7 +170,13 @@ int MAIN(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||||
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: seed PRNG only if needed */
|
/* FIXME: seed PRNG only if needed */
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
@@ -170,7 +184,7 @@ int MAIN(int argc, char **argv)
|
|||||||
switch(key_type) {
|
switch(key_type) {
|
||||||
case KEY_PRIVKEY:
|
case KEY_PRIVKEY:
|
||||||
pkey = load_key(bio_err, keyfile, keyform, 0,
|
pkey = load_key(bio_err, keyfile, keyform, 0,
|
||||||
NULL, e, "Private Key");
|
passin, e, "Private Key");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_PUBKEY:
|
case KEY_PUBKEY:
|
||||||
@@ -284,6 +298,7 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
if(rsa_in) OPENSSL_free(rsa_in);
|
if(rsa_in) OPENSSL_free(rsa_in);
|
||||||
if(rsa_out) OPENSSL_free(rsa_out);
|
if(rsa_out) OPENSSL_free(rsa_out);
|
||||||
|
if(passin) OPENSSL_free(passin);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,7 +320,10 @@ static void usage()
|
|||||||
BIO_printf(bio_err, "-encrypt encrypt with public key\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, "-decrypt decrypt with private key\n");
|
||||||
BIO_printf(bio_err, "-hexdump hex dump output\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");
|
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
BIO_printf (bio_err, "-passin arg pass phrase source\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,10 +108,19 @@
|
|||||||
* Hudson (tjh@cryptsoft.com).
|
* Hudson (tjh@cryptsoft.com).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
|
||||||
|
#include <conio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef OPENSSL_SYS_MSDOS
|
||||||
|
#define _kbhit kbhit
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(OPENSSL_SYS_VMS) && !defined(FD_SET)
|
#if defined(OPENSSL_SYS_VMS) && !defined(FD_SET)
|
||||||
/* VAX C does not defined fd_set and friends, but it's actually quite simple */
|
/* VAX C does not defined fd_set and friends, but it's actually quite simple */
|
||||||
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
|
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
|
||||||
|
|||||||
@@ -239,15 +239,15 @@ long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi,
|
|||||||
|
|
||||||
if (cmd == (BIO_CB_READ|BIO_CB_RETURN))
|
if (cmd == (BIO_CB_READ|BIO_CB_RETURN))
|
||||||
{
|
{
|
||||||
BIO_printf(out,"read from %08X [%08lX] (%d bytes => %ld (0x%X))\n",
|
BIO_printf(out,"read from %p [%p] (%d bytes => %ld (0x%lX))\n",
|
||||||
bio,argp,argi,ret,ret);
|
(void *)bio,argp,argi,ret,ret);
|
||||||
BIO_dump(out,argp,(int)ret);
|
BIO_dump(out,argp,(int)ret);
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
else if (cmd == (BIO_CB_WRITE|BIO_CB_RETURN))
|
else if (cmd == (BIO_CB_WRITE|BIO_CB_RETURN))
|
||||||
{
|
{
|
||||||
BIO_printf(out,"write to %08X [%08lX] (%d bytes => %ld (0x%X))\n",
|
BIO_printf(out,"write to %p [%p] (%d bytes => %ld (0x%lX))\n",
|
||||||
bio,argp,argi,ret,ret);
|
(void *)bio,argp,argi,ret,ret);
|
||||||
BIO_dump(out,argp,(int)ret);
|
BIO_dump(out,argp,(int)ret);
|
||||||
}
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
|
|||||||
@@ -136,10 +136,6 @@ typedef unsigned int u_int;
|
|||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
|
||||||
#include <conio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINCE
|
#ifdef OPENSSL_SYS_WINCE
|
||||||
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
||||||
#ifdef fileno
|
#ifdef fileno
|
||||||
@@ -221,8 +217,10 @@ static void sc_usage(void)
|
|||||||
BIO_printf(bio_err," -starttls prot - use the STARTTLS command before starting TLS\n");
|
BIO_printf(bio_err," -starttls prot - use the STARTTLS command before starting TLS\n");
|
||||||
BIO_printf(bio_err," for those protocols that support it, where\n");
|
BIO_printf(bio_err," for those protocols that support it, where\n");
|
||||||
BIO_printf(bio_err," 'prot' defines which one to assume. Currently,\n");
|
BIO_printf(bio_err," 'prot' defines which one to assume. Currently,\n");
|
||||||
BIO_printf(bio_err," only \"smtp\" is supported.\n");
|
BIO_printf(bio_err," only \"smtp\" and \"pop3\" are supported.\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -249,14 +247,16 @@ int MAIN(int argc, char **argv)
|
|||||||
int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
|
int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
|
||||||
SSL_CTX *ctx=NULL;
|
SSL_CTX *ctx=NULL;
|
||||||
int ret=1,in_init=1,i,nbio_test=0;
|
int ret=1,in_init=1,i,nbio_test=0;
|
||||||
int smtp_starttls = 0;
|
int starttls_proto = 0;
|
||||||
int prexit = 0, vflags = 0;
|
int prexit = 0, vflags = 0;
|
||||||
SSL_METHOD *meth=NULL;
|
SSL_METHOD *meth=NULL;
|
||||||
BIO *sbio;
|
BIO *sbio;
|
||||||
char *inrand=NULL;
|
char *inrand=NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine_id=NULL;
|
char *engine_id=NULL;
|
||||||
ENGINE *e=NULL;
|
ENGINE *e=NULL;
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#endif
|
||||||
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -411,15 +411,19 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
++argv;
|
++argv;
|
||||||
if (strcmp(*argv,"smtp") == 0)
|
if (strcmp(*argv,"smtp") == 0)
|
||||||
smtp_starttls = 1;
|
starttls_proto = 1;
|
||||||
|
else if (strcmp(*argv,"pop3") == 0)
|
||||||
|
starttls_proto = 2;
|
||||||
else
|
else
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine_id = *(++argv);
|
engine_id = *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -444,7 +448,9 @@ bad:
|
|||||||
OpenSSL_add_ssl_algorithms();
|
OpenSSL_add_ssl_algorithms();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine_id, 1);
|
e = setup_engine(bio_err, engine_id, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
||||||
&& !RAND_status())
|
&& !RAND_status())
|
||||||
@@ -579,12 +585,18 @@ re_start:
|
|||||||
sbuf_off=0;
|
sbuf_off=0;
|
||||||
|
|
||||||
/* This is an ugly hack that does a lot of assumptions */
|
/* This is an ugly hack that does a lot of assumptions */
|
||||||
if (smtp_starttls)
|
if (starttls_proto == 1)
|
||||||
{
|
{
|
||||||
BIO_read(sbio,mbuf,BUFSIZZ);
|
BIO_read(sbio,mbuf,BUFSIZZ);
|
||||||
BIO_printf(sbio,"STARTTLS\r\n");
|
BIO_printf(sbio,"STARTTLS\r\n");
|
||||||
BIO_read(sbio,sbuf,BUFSIZZ);
|
BIO_read(sbio,sbuf,BUFSIZZ);
|
||||||
}
|
}
|
||||||
|
if (starttls_proto == 2)
|
||||||
|
{
|
||||||
|
BIO_read(sbio,mbuf,BUFSIZZ);
|
||||||
|
BIO_printf(sbio,"STLS\r\n");
|
||||||
|
BIO_read(sbio,sbuf,BUFSIZZ);
|
||||||
|
}
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@@ -605,11 +617,11 @@ re_start:
|
|||||||
print_stuff(bio_c_out,con,full_log);
|
print_stuff(bio_c_out,con,full_log);
|
||||||
if (full_log > 0) full_log--;
|
if (full_log > 0) full_log--;
|
||||||
|
|
||||||
if (smtp_starttls)
|
if (starttls_proto)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"%s",mbuf);
|
BIO_printf(bio_err,"%s",mbuf);
|
||||||
/* We don't need to know any more */
|
/* We don't need to know any more */
|
||||||
smtp_starttls = 0;
|
starttls_proto = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reconnect)
|
if (reconnect)
|
||||||
@@ -628,7 +640,7 @@ re_start:
|
|||||||
|
|
||||||
if (!ssl_pending)
|
if (!ssl_pending)
|
||||||
{
|
{
|
||||||
#ifndef OPENSSL_SYS_WINDOWS
|
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE)
|
||||||
if (tty_on)
|
if (tty_on)
|
||||||
{
|
{
|
||||||
if (read_tty) FD_SET(fileno(stdin),&readfds);
|
if (read_tty) FD_SET(fileno(stdin),&readfds);
|
||||||
@@ -655,8 +667,8 @@ re_start:
|
|||||||
* will choke the compiler: if you do have a cast then
|
* will choke the compiler: if you do have a cast then
|
||||||
* you can either go for (int *) or (void *).
|
* you can either go for (int *) or (void *).
|
||||||
*/
|
*/
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
|
||||||
/* Under Windows we make the assumption that we can
|
/* Under Windows/DOS we make the assumption that we can
|
||||||
* always write to the tty: therefore if we need to
|
* always write to the tty: therefore if we need to
|
||||||
* write to the tty we just fall through. Otherwise
|
* write to the tty we just fall through. Otherwise
|
||||||
* we timeout the select every second and see if there
|
* we timeout the select every second and see if there
|
||||||
@@ -670,7 +682,7 @@ re_start:
|
|||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
i=select(width,(void *)&readfds,(void *)&writefds,
|
i=select(width,(void *)&readfds,(void *)&writefds,
|
||||||
NULL,&tv);
|
NULL,&tv);
|
||||||
#ifdef OPENSSL_SYS_WINCE
|
#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
|
||||||
if(!i && (!_kbhit() || !read_tty) ) continue;
|
if(!i && (!_kbhit() || !read_tty) ) continue;
|
||||||
#else
|
#else
|
||||||
if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
|
if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
|
||||||
@@ -758,7 +770,7 @@ re_start:
|
|||||||
goto shut;
|
goto shut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
|
||||||
/* Assume Windows/DOS can always write */
|
/* Assume Windows/DOS can always write */
|
||||||
else if (!ssl_pending && write_tty)
|
else if (!ssl_pending && write_tty)
|
||||||
#else
|
#else
|
||||||
@@ -839,12 +851,14 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
|
||||||
#ifdef OPENSSL_SYS_WINCE
|
#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
|
||||||
else if (_kbhit())
|
else if (_kbhit())
|
||||||
#else
|
#else
|
||||||
else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
|
else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined (OPENSSL_SYS_NETWARE)
|
||||||
|
else if (_kbhit())
|
||||||
#else
|
#else
|
||||||
else if (FD_ISSET(fileno(stdin),&readfds))
|
else if (FD_ISSET(fileno(stdin),&readfds))
|
||||||
#endif
|
#endif
|
||||||
@@ -908,16 +922,16 @@ end:
|
|||||||
if (con != NULL) SSL_free(con);
|
if (con != NULL) SSL_free(con);
|
||||||
if (con2 != NULL) SSL_free(con2);
|
if (con2 != NULL) SSL_free(con2);
|
||||||
if (ctx != NULL) SSL_CTX_free(ctx);
|
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||||
if (cbuf != NULL) { memset(cbuf,0,BUFSIZZ); OPENSSL_free(cbuf); }
|
if (cbuf != NULL) { OPENSSL_cleanse(cbuf,BUFSIZZ); OPENSSL_free(cbuf); }
|
||||||
if (sbuf != NULL) { memset(sbuf,0,BUFSIZZ); OPENSSL_free(sbuf); }
|
if (sbuf != NULL) { OPENSSL_cleanse(sbuf,BUFSIZZ); OPENSSL_free(sbuf); }
|
||||||
if (mbuf != NULL) { memset(mbuf,0,BUFSIZZ); OPENSSL_free(mbuf); }
|
if (mbuf != NULL) { OPENSSL_cleanse(mbuf,BUFSIZZ); OPENSSL_free(mbuf); }
|
||||||
if (bio_c_out != NULL)
|
if (bio_c_out != NULL)
|
||||||
{
|
{
|
||||||
BIO_free(bio_c_out);
|
BIO_free(bio_c_out);
|
||||||
bio_c_out=NULL;
|
bio_c_out=NULL;
|
||||||
}
|
}
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -932,6 +946,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
|||||||
SSL_CIPHER *c;
|
SSL_CIPHER *c;
|
||||||
X509_NAME *xn;
|
X509_NAME *xn;
|
||||||
int j,i;
|
int j,i;
|
||||||
|
const COMP_METHOD *comp, *expansion;
|
||||||
|
|
||||||
if (full)
|
if (full)
|
||||||
{
|
{
|
||||||
@@ -1034,6 +1049,12 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
|||||||
EVP_PKEY_bits(pktmp));
|
EVP_PKEY_bits(pktmp));
|
||||||
EVP_PKEY_free(pktmp);
|
EVP_PKEY_free(pktmp);
|
||||||
}
|
}
|
||||||
|
comp=SSL_get_current_compression(s);
|
||||||
|
expansion=SSL_get_current_expansion(s);
|
||||||
|
BIO_printf(bio,"Compression: %s\n",
|
||||||
|
comp ? SSL_COMP_get_name(comp) : "NONE");
|
||||||
|
BIO_printf(bio,"Expansion: %s\n",
|
||||||
|
expansion ? SSL_COMP_get_name(expansion) : "NONE");
|
||||||
SSL_SESSION_print(bio,SSL_get_session(s));
|
SSL_SESSION_print(bio,SSL_get_session(s));
|
||||||
BIO_printf(bio,"---\n");
|
BIO_printf(bio,"---\n");
|
||||||
if (peer != NULL)
|
if (peer != NULL)
|
||||||
|
|||||||
@@ -114,17 +114,27 @@
|
|||||||
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
|
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Until the key-gen callbacks are modified to use newer prototypes, we allow
|
||||||
|
* deprecated functions for openssl-internal code */
|
||||||
|
#ifdef OPENSSL_NO_DEPRECATED
|
||||||
|
#undef OPENSSL_NO_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <openssl/e_os2.h>
|
#include <openssl/e_os2.h>
|
||||||
#ifdef OPENSSL_NO_STDIO
|
#ifdef OPENSSL_NO_STDIO
|
||||||
#define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* With IPv6, it looks like Digital has mixed up the proper order of
|
/* With IPv6, it looks like Digital has mixed up the proper order of
|
||||||
recursive header file inclusion, resulting in the compiler complaining
|
recursive header file inclusion, resulting in the compiler complaining
|
||||||
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
||||||
@@ -145,10 +155,6 @@ typedef unsigned int u_int;
|
|||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
|
||||||
#include <conio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINCE
|
#ifdef OPENSSL_SYS_WINCE
|
||||||
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
||||||
#ifdef fileno
|
#ifdef fileno
|
||||||
@@ -249,7 +255,9 @@ static int s_msg=0;
|
|||||||
static int s_quiet=0;
|
static int s_quiet=0;
|
||||||
|
|
||||||
static int hack=0;
|
static int hack=0;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
static char *engine_id=NULL;
|
static char *engine_id=NULL;
|
||||||
|
#endif
|
||||||
static const char *session_id_prefix=NULL;
|
static const char *session_id_prefix=NULL;
|
||||||
|
|
||||||
#ifdef MONOLITH
|
#ifdef MONOLITH
|
||||||
@@ -274,7 +282,9 @@ static void s_server_init(void)
|
|||||||
s_msg=0;
|
s_msg=0;
|
||||||
s_quiet=0;
|
s_quiet=0;
|
||||||
hack=0;
|
hack=0;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
engine_id=NULL;
|
engine_id=NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -331,7 +341,9 @@ static void sv_usage(void)
|
|||||||
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
||||||
BIO_printf(bio_err," -HTTP - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
BIO_printf(bio_err," -HTTP - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
||||||
BIO_printf(bio_err," with the assumption it contains a complete HTTP response.\n");
|
BIO_printf(bio_err," with the assumption it contains a complete HTTP response.\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err," -id_prefix arg - Generate SSL/TLS session IDs prefixed by 'arg'\n");
|
BIO_printf(bio_err," -id_prefix arg - Generate SSL/TLS session IDs prefixed by 'arg'\n");
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
}
|
}
|
||||||
@@ -506,7 +518,9 @@ int MAIN(int argc, char *argv[])
|
|||||||
int no_tmp_rsa=0,no_dhe=0,no_ecdhe=0,nocert=0;
|
int no_tmp_rsa=0,no_dhe=0,no_ecdhe=0,nocert=0;
|
||||||
int state=0;
|
int state=0;
|
||||||
SSL_METHOD *meth=NULL;
|
SSL_METHOD *meth=NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e=NULL;
|
ENGINE *e=NULL;
|
||||||
|
#endif
|
||||||
char *inrand=NULL;
|
char *inrand=NULL;
|
||||||
|
|
||||||
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
@@ -690,11 +704,13 @@ int MAIN(int argc, char *argv[])
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
session_id_prefix = *(++argv);
|
session_id_prefix = *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine_id= *(++argv);
|
engine_id= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -719,7 +735,9 @@ bad:
|
|||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
OpenSSL_add_ssl_algorithms();
|
OpenSSL_add_ssl_algorithms();
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine_id, 1);
|
e = setup_engine(bio_err, engine_id, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
||||||
&& !RAND_status())
|
&& !RAND_status())
|
||||||
@@ -946,30 +964,30 @@ end:
|
|||||||
bio_s_out=NULL;
|
bio_s_out=NULL;
|
||||||
}
|
}
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
|
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
|
||||||
{
|
{
|
||||||
BIO_printf(bio,"%4ld items in the session cache\n",
|
BIO_printf(bio,"%4ld items in the session cache\n",
|
||||||
SSL_CTX_sess_number(ssl_ctx));
|
SSL_CTX_sess_number(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d client connects (SSL_connect())\n",
|
BIO_printf(bio,"%4ld client connects (SSL_connect())\n",
|
||||||
SSL_CTX_sess_connect(ssl_ctx));
|
SSL_CTX_sess_connect(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d client renegotiates (SSL_connect())\n",
|
BIO_printf(bio,"%4ld client renegotiates (SSL_connect())\n",
|
||||||
SSL_CTX_sess_connect_renegotiate(ssl_ctx));
|
SSL_CTX_sess_connect_renegotiate(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d client connects that finished\n",
|
BIO_printf(bio,"%4ld client connects that finished\n",
|
||||||
SSL_CTX_sess_connect_good(ssl_ctx));
|
SSL_CTX_sess_connect_good(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d server accepts (SSL_accept())\n",
|
BIO_printf(bio,"%4ld server accepts (SSL_accept())\n",
|
||||||
SSL_CTX_sess_accept(ssl_ctx));
|
SSL_CTX_sess_accept(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d server renegotiates (SSL_accept())\n",
|
BIO_printf(bio,"%4ld server renegotiates (SSL_accept())\n",
|
||||||
SSL_CTX_sess_accept_renegotiate(ssl_ctx));
|
SSL_CTX_sess_accept_renegotiate(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d server accepts that finished\n",
|
BIO_printf(bio,"%4ld server accepts that finished\n",
|
||||||
SSL_CTX_sess_accept_good(ssl_ctx));
|
SSL_CTX_sess_accept_good(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d session cache hits\n",SSL_CTX_sess_hits(ssl_ctx));
|
BIO_printf(bio,"%4ld session cache hits\n",SSL_CTX_sess_hits(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d session cache misses\n",SSL_CTX_sess_misses(ssl_ctx));
|
BIO_printf(bio,"%4ld session cache misses\n",SSL_CTX_sess_misses(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d session cache timeouts\n",SSL_CTX_sess_timeouts(ssl_ctx));
|
BIO_printf(bio,"%4ld session cache timeouts\n",SSL_CTX_sess_timeouts(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d callback cache hits\n",SSL_CTX_sess_cb_hits(ssl_ctx));
|
BIO_printf(bio,"%4ld callback cache hits\n",SSL_CTX_sess_cb_hits(ssl_ctx));
|
||||||
BIO_printf(bio,"%4d cache full overflows (%d allowed)\n",
|
BIO_printf(bio,"%4ld cache full overflows (%ld allowed)\n",
|
||||||
SSL_CTX_sess_cache_full(ssl_ctx),
|
SSL_CTX_sess_cache_full(ssl_ctx),
|
||||||
SSL_CTX_sess_get_cache_size(ssl_ctx));
|
SSL_CTX_sess_get_cache_size(ssl_ctx));
|
||||||
}
|
}
|
||||||
@@ -983,7 +1001,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
unsigned long l;
|
unsigned long l;
|
||||||
SSL *con=NULL;
|
SSL *con=NULL;
|
||||||
BIO *sbio;
|
BIO *sbio;
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1057,7 +1075,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
if (!read_from_sslcon)
|
if (!read_from_sslcon)
|
||||||
{
|
{
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
#ifndef OPENSSL_SYS_WINDOWS
|
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE)
|
||||||
FD_SET(fileno(stdin),&readfds);
|
FD_SET(fileno(stdin),&readfds);
|
||||||
#endif
|
#endif
|
||||||
FD_SET(s,&readfds);
|
FD_SET(s,&readfds);
|
||||||
@@ -1067,8 +1085,8 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
* the compiler: if you do have a cast then you can either
|
* the compiler: if you do have a cast then you can either
|
||||||
* go for (int *) or (void *).
|
* go for (int *) or (void *).
|
||||||
*/
|
*/
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
|
||||||
/* Under Windows we can't select on stdin: only
|
/* Under DOS (non-djgpp) and Windows we can't select on stdin: only
|
||||||
* on sockets. As a workaround we timeout the select every
|
* on sockets. As a workaround we timeout the select every
|
||||||
* second and check for any keypress. In a proper Windows
|
* second and check for any keypress. In a proper Windows
|
||||||
* application we wouldn't do this because it is inefficient.
|
* application we wouldn't do this because it is inefficient.
|
||||||
@@ -1262,7 +1280,7 @@ err:
|
|||||||
BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
|
BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
memset(buf,0,bufsize);
|
OPENSSL_cleanse(buf,bufsize);
|
||||||
OPENSSL_free(buf);
|
OPENSSL_free(buf);
|
||||||
}
|
}
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
@@ -1329,7 +1347,13 @@ static int init_ssl_connection(SSL *con)
|
|||||||
if (SSL_ctrl(con,SSL_CTRL_GET_FLAGS,0,NULL) &
|
if (SSL_ctrl(con,SSL_CTRL_GET_FLAGS,0,NULL) &
|
||||||
TLS1_FLAGS_TLS_PADDING_BUG)
|
TLS1_FLAGS_TLS_PADDING_BUG)
|
||||||
BIO_printf(bio_s_out,"Peer has incorrect TLSv1 block padding\n");
|
BIO_printf(bio_s_out,"Peer has incorrect TLSv1 block padding\n");
|
||||||
|
#ifndef OPENSSL_NO_KRB5
|
||||||
|
if (con->kssl_ctx->client_princ != NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_s_out,"Kerberos peer principal is %s\n",
|
||||||
|
con->kssl_ctx->client_princ);
|
||||||
|
}
|
||||||
|
#endif /* OPENSSL_NO_KRB5 */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1481,7 +1505,9 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_s_out,"read R BLOCK\n");
|
BIO_printf(bio_s_out,"read R BLOCK\n");
|
||||||
#if !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
|
#if defined(OPENSSL_SYS_NETWARE)
|
||||||
|
delay(1000);
|
||||||
|
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
|
||||||
sleep(1);
|
sleep(1);
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
@@ -1765,7 +1791,12 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
|
|||||||
BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength);
|
BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength);
|
||||||
(void)BIO_flush(bio_err);
|
(void)BIO_flush(bio_err);
|
||||||
}
|
}
|
||||||
rsa_tmp=RSA_generate_key(keylength,RSA_F4,NULL,NULL);
|
if(((rsa_tmp = RSA_new()) == NULL) || !RSA_generate_key_ex(
|
||||||
|
rsa_tmp, keylength,RSA_F4,NULL))
|
||||||
|
{
|
||||||
|
if(rsa_tmp) RSA_free(rsa_tmp);
|
||||||
|
rsa_tmp = NULL;
|
||||||
|
}
|
||||||
if (!s_quiet)
|
if (!s_quiet)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"\n");
|
BIO_printf(bio_err,"\n");
|
||||||
|
|||||||
@@ -62,14 +62,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#ifdef FLAT_INC
|
|
||||||
#include "e_os.h"
|
|
||||||
#else
|
|
||||||
#include "../e_os.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_SOCK
|
|
||||||
|
|
||||||
/* With IPv6, it looks like Digital has mixed up the proper order of
|
/* With IPv6, it looks like Digital has mixed up the proper order of
|
||||||
recursive header file inclusion, resulting in the compiler complaining
|
recursive header file inclusion, resulting in the compiler complaining
|
||||||
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
||||||
@@ -87,8 +79,16 @@ typedef unsigned int u_int;
|
|||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
|
#ifdef FLAT_INC
|
||||||
|
#include "e_os.h"
|
||||||
|
#else
|
||||||
|
#include "../e_os.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_SOCK
|
||||||
|
|
||||||
static struct hostent *GetHostByName(char *name);
|
static struct hostent *GetHostByName(char *name);
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
|
||||||
static void ssl_sock_cleanup(void);
|
static void ssl_sock_cleanup(void);
|
||||||
#endif
|
#endif
|
||||||
static int ssl_sock_init(void);
|
static int ssl_sock_init(void);
|
||||||
@@ -104,6 +104,10 @@ static int host_ip(char *str, unsigned char ip[4]);
|
|||||||
#define SOCKET_PROTOCOL IPPROTO_TCP
|
#define SOCKET_PROTOCOL IPPROTO_TCP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef OPENSSL_SYS_NETWARE
|
||||||
|
static int wsa_init_done=0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
static struct WSAData wsa_state;
|
static struct WSAData wsa_state;
|
||||||
static int wsa_init_done=0;
|
static int wsa_init_done=0;
|
||||||
@@ -152,6 +156,15 @@ static void ssl_sock_cleanup(void)
|
|||||||
WSACleanup();
|
WSACleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#elif defined(OPENSSL_SYS_NETWARE)
|
||||||
|
static void sock_cleanup(void)
|
||||||
|
{
|
||||||
|
if (wsa_init_done)
|
||||||
|
{
|
||||||
|
wsa_init_done=0;
|
||||||
|
WSACleanup();
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int ssl_sock_init(void)
|
static int ssl_sock_init(void)
|
||||||
@@ -187,6 +200,27 @@ static int ssl_sock_init(void)
|
|||||||
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
|
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
|
||||||
#endif /* OPENSSL_SYS_WIN16 */
|
#endif /* OPENSSL_SYS_WIN16 */
|
||||||
}
|
}
|
||||||
|
#elif defined(OPENSSL_SYS_NETWARE)
|
||||||
|
WORD wVerReq;
|
||||||
|
WSADATA wsaData;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
if (!wsa_init_done)
|
||||||
|
{
|
||||||
|
|
||||||
|
# ifdef SIGINT
|
||||||
|
signal(SIGINT,(void (*)(int))sock_cleanup);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
wsa_init_done=1;
|
||||||
|
wVerReq = MAKEWORD( 2, 0 );
|
||||||
|
err = WSAStartup(wVerReq,&wsaData);
|
||||||
|
if (err != 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unable to start WINSOCK2, error code=%d\n",err);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif /* OPENSSL_SYS_WINDOWS */
|
#endif /* OPENSSL_SYS_WINDOWS */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
@@ -348,7 +382,7 @@ redoit:
|
|||||||
ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
|
ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
|
||||||
if (ret == INVALID_SOCKET)
|
if (ret == INVALID_SOCKET)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_SYS_WINDOWS
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
|
||||||
i=WSAGetLastError();
|
i=WSAGetLastError();
|
||||||
BIO_printf(bio_err,"accept error %d\n",i);
|
BIO_printf(bio_err,"accept error %d\n",i);
|
||||||
#else
|
#else
|
||||||
@@ -395,7 +429,7 @@ redoit:
|
|||||||
perror("OPENSSL_malloc");
|
perror("OPENSSL_malloc");
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
strcpy(*host,h1->h_name);
|
BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
|
||||||
|
|
||||||
h2=GetHostByName(*host);
|
h2=GetHostByName(*host);
|
||||||
if (h2 == NULL)
|
if (h2 == NULL)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
#include OPENSSL_UNISTD
|
#include OPENSSL_UNISTD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
|
#if !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
|
||||||
#define TIMES
|
#define TIMES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
#undef TIMES
|
#undef TIMES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS)
|
#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE)
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -384,6 +384,20 @@ static double tm_Time_F(int s)
|
|||||||
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
||||||
return((ret == 0.0)?1e-6:ret);
|
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)
|
#elif defined(OPENSSL_SYS_VXWORKS)
|
||||||
{
|
{
|
||||||
static unsigned long tick_start, tick_end;
|
static unsigned long tick_start, tick_end;
|
||||||
@@ -502,7 +516,7 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if (s_www_path != NULL)
|
if (s_www_path != NULL)
|
||||||
{
|
{
|
||||||
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
||||||
SSL_write(scon,buf,strlen(buf));
|
SSL_write(scon,buf,strlen(buf));
|
||||||
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
|
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
|
||||||
bytes_read+=i;
|
bytes_read+=i;
|
||||||
@@ -557,7 +571,7 @@ next:
|
|||||||
|
|
||||||
if (s_www_path != NULL)
|
if (s_www_path != NULL)
|
||||||
{
|
{
|
||||||
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
||||||
SSL_write(scon,buf,strlen(buf));
|
SSL_write(scon,buf,strlen(buf));
|
||||||
while (SSL_read(scon,buf,sizeof(buf)) > 0)
|
while (SSL_read(scon,buf,sizeof(buf)) > 0)
|
||||||
;
|
;
|
||||||
@@ -595,7 +609,7 @@ next:
|
|||||||
|
|
||||||
if (s_www_path)
|
if (s_www_path)
|
||||||
{
|
{
|
||||||
sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
BIO_snprintf(buf,sizeof buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);
|
||||||
SSL_write(scon,buf,strlen(buf));
|
SSL_write(scon,buf,strlen(buf));
|
||||||
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
|
while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)
|
||||||
bytes_read+=i;
|
bytes_read+=i;
|
||||||
@@ -642,7 +656,7 @@ end:
|
|||||||
tm_ctx=NULL;
|
tm_ctx=NULL;
|
||||||
}
|
}
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ end:
|
|||||||
if (out != NULL) BIO_free_all(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (x != NULL) SSL_SESSION_free(x);
|
if (x != NULL) SSL_SESSION_free(x);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SSL_SESSION *load_sess_id(char *infile, int format)
|
static SSL_SESSION *load_sess_id(char *infile, int format)
|
||||||
|
|||||||
24
apps/smime.c
24
apps/smime.c
@@ -1,9 +1,9 @@
|
|||||||
/* smime.c */
|
/* smime.c */
|
||||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||||
* project 1999.
|
* project.
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -104,7 +104,9 @@ int MAIN(int argc, char **argv)
|
|||||||
int need_rand = 0;
|
int need_rand = 0;
|
||||||
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
|
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
|
||||||
int keyform = FORMAT_PEM;
|
int keyform = FORMAT_PEM;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
args = argv + 1;
|
args = argv + 1;
|
||||||
ret = 1;
|
ret = 1;
|
||||||
@@ -166,6 +168,10 @@ int MAIN(int argc, char **argv)
|
|||||||
flags |= PKCS7_BINARY;
|
flags |= PKCS7_BINARY;
|
||||||
else if (!strcmp (*args, "-nosigs"))
|
else if (!strcmp (*args, "-nosigs"))
|
||||||
flags |= PKCS7_NOSIGS;
|
flags |= PKCS7_NOSIGS;
|
||||||
|
else if (!strcmp (*args, "-nooldmime"))
|
||||||
|
flags |= PKCS7_NOOLDMIMETYPE;
|
||||||
|
else if (!strcmp (*args, "-crlfeol"))
|
||||||
|
flags |= PKCS7_CRLFEOL;
|
||||||
else if (!strcmp (*args, "-crl_check"))
|
else if (!strcmp (*args, "-crl_check"))
|
||||||
store_flags |= X509_V_FLAG_CRL_CHECK;
|
store_flags |= X509_V_FLAG_CRL_CHECK;
|
||||||
else if (!strcmp (*args, "-crl_check_all"))
|
else if (!strcmp (*args, "-crl_check_all"))
|
||||||
@@ -176,11 +182,13 @@ int MAIN(int argc, char **argv)
|
|||||||
inrand = *args;
|
inrand = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
need_rand = 1;
|
need_rand = 1;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
} else if (!strcmp(*args,"-engine")) {
|
} else if (!strcmp(*args,"-engine")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
engine = *args;
|
engine = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
#endif
|
||||||
} else if (!strcmp(*args,"-passin")) {
|
} else if (!strcmp(*args,"-passin")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
@@ -330,7 +338,9 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-CAfile file trusted certificates file\n");
|
BIO_printf (bio_err, "-CAfile file trusted certificates file\n");
|
||||||
BIO_printf (bio_err, "-crl_check check revocation status of signer's certificate using CRLs\n");
|
BIO_printf (bio_err, "-crl_check check revocation status of signer's certificate using CRLs\n");
|
||||||
BIO_printf (bio_err, "-crl_check_all check revocation status of signer's certificate chain using CRLs\n");
|
BIO_printf (bio_err, "-crl_check_all check revocation status of signer's certificate chain using CRLs\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf (bio_err, "-passin arg input file pass phrase source\n");
|
BIO_printf (bio_err, "-passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err, "-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, " load the file (or the files in the directory) into\n");
|
||||||
@@ -339,7 +349,9 @@ int MAIN(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
@@ -470,8 +482,14 @@ int MAIN(int argc, char **argv)
|
|||||||
if(operation == SMIME_ENCRYPT) {
|
if(operation == SMIME_ENCRYPT) {
|
||||||
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
||||||
} else if(operation == SMIME_SIGN) {
|
} else if(operation == SMIME_SIGN) {
|
||||||
|
/* If detached data and SMIME output enable partial
|
||||||
|
* signing.
|
||||||
|
*/
|
||||||
|
if ((flags & PKCS7_DETACHED) && (outformat == FORMAT_SMIME))
|
||||||
|
flags |= PKCS7_STREAM;
|
||||||
p7 = PKCS7_sign(signer, key, other, in, flags);
|
p7 = PKCS7_sign(signer, key, other, in, flags);
|
||||||
if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) {
|
/* Don't need to rewind for partial signing */
|
||||||
|
if (!(flags & PKCS7_STREAM) && (BIO_reset(in) != 0)) {
|
||||||
BIO_printf(bio_err, "Can't rewind input file\n");
|
BIO_printf(bio_err, "Can't rewind input file\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|||||||
133
apps/speed.c
133
apps/speed.c
@@ -71,6 +71,8 @@
|
|||||||
|
|
||||||
/* most of this code has been pilfered from my libdes speed.c program */
|
/* most of this code has been pilfered from my libdes speed.c program */
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_SPEED
|
||||||
|
|
||||||
#undef SECONDS
|
#undef SECONDS
|
||||||
#define SECONDS 3
|
#define SECONDS 3
|
||||||
#define RSA_SECONDS 10
|
#define RSA_SECONDS 10
|
||||||
@@ -86,7 +88,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
@@ -102,6 +104,10 @@
|
|||||||
#include OPENSSL_UNISTD
|
#include OPENSSL_UNISTD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPENSSL_SYS_NETWARE
|
||||||
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX)
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX)
|
||||||
# define USE_TOD
|
# define USE_TOD
|
||||||
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
|
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
|
||||||
@@ -111,6 +117,12 @@
|
|||||||
# define TIMEB
|
# define TIMEB
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(OPENSSL_SYS_NETWARE)
|
||||||
|
#undef TIMES
|
||||||
|
#undef TIMEB
|
||||||
|
#include <time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _IRIX
|
#ifndef _IRIX
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -135,7 +147,7 @@
|
|||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS)
|
#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!"
|
#error "It seems neither struct tms nor struct timeb is supported in this platform!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -206,11 +218,21 @@
|
|||||||
#include <openssl/ecdh.h>
|
#include <openssl/ecdh.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 */
|
/* The following if from times(3) man page. It may need to be changed */
|
||||||
#ifndef HZ
|
#ifndef HZ
|
||||||
# if defined(_SC_CLK_TCK) \
|
# if defined(_SC_CLK_TCK) \
|
||||||
&& (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
|
&& (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
|
||||||
# define HZ ((double)sysconf(_SC_CLK_TCK))
|
# define HZ sysconf(_SC_CLK_TCK)
|
||||||
# else
|
# else
|
||||||
# ifndef CLK_TCK
|
# ifndef CLK_TCK
|
||||||
# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
|
# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
|
||||||
@@ -224,7 +246,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2)
|
#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
|
# define HAVE_FORK 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -286,6 +308,32 @@ static SIGRETTYPE sig_done(int sig)
|
|||||||
#define START 0
|
#define START 0
|
||||||
#define STOP 1
|
#define STOP 1
|
||||||
|
|
||||||
|
#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)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
static double Time_F(int s)
|
static double Time_F(int s)
|
||||||
{
|
{
|
||||||
double ret;
|
double ret;
|
||||||
@@ -347,7 +395,8 @@ static double Time_F(int s)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
times(&tend);
|
times(&tend);
|
||||||
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
ret = HZ;
|
||||||
|
ret=(double)(tend.tms_utime-tstart.tms_utime) / ret;
|
||||||
return((ret < 1e-3)?1e-3:ret);
|
return((ret < 1e-3)?1e-3:ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -393,12 +442,29 @@ static double Time_F(int s)
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif /* if defined(OPENSSL_SYS_NETWARE) */
|
||||||
|
|
||||||
|
|
||||||
|
static const int KDF1_SHA1_len = 20;
|
||||||
|
static void *KDF1_SHA1(void *in, size_t inlen, void *out, size_t outlen)
|
||||||
|
{
|
||||||
|
#ifndef OPENSSL_NO_SHA
|
||||||
|
if (outlen != SHA_DIGEST_LENGTH)
|
||||||
|
return NULL;
|
||||||
|
return SHA1(in, inlen, out);
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
#endif
|
||||||
unsigned char *buf=NULL,*buf2=NULL;
|
unsigned char *buf=NULL,*buf2=NULL;
|
||||||
int mret=1;
|
int mret=1;
|
||||||
long count=0,save_count=0;
|
long count=0,save_count=0;
|
||||||
@@ -731,6 +797,7 @@ int MAIN(int argc, char **argv)
|
|||||||
j--; /* Otherwise, -elapsed gets confused with
|
j--; /* Otherwise, -elapsed gets confused with
|
||||||
an algorithm. */
|
an algorithm. */
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
|
else if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
|
||||||
{
|
{
|
||||||
argc--;
|
argc--;
|
||||||
@@ -747,6 +814,7 @@ int MAIN(int argc, char **argv)
|
|||||||
means all of them should be run) */
|
means all of them should be run) */
|
||||||
j--;
|
j--;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#ifdef HAVE_FORK
|
#ifdef HAVE_FORK
|
||||||
else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
|
else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
|
||||||
{
|
{
|
||||||
@@ -908,6 +976,7 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
dsa_doit[R_DSA_512]=1;
|
dsa_doit[R_DSA_512]=1;
|
||||||
dsa_doit[R_DSA_1024]=1;
|
dsa_doit[R_DSA_1024]=1;
|
||||||
|
dsa_doit[R_DSA_2048]=1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@@ -1064,7 +1133,9 @@ int MAIN(int argc, char **argv)
|
|||||||
#if defined(TIMES) || defined(USE_TOD)
|
#if defined(TIMES) || defined(USE_TOD)
|
||||||
BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n");
|
BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n");
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
BIO_printf(bio_err,"-evp e use EVP e.\n");
|
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,"-decrypt time decryption instead of encryption (only EVP).\n");
|
||||||
BIO_printf(bio_err,"-mr produce machine readable output.\n");
|
BIO_printf(bio_err,"-mr produce machine readable output.\n");
|
||||||
@@ -1197,6 +1268,9 @@ int MAIN(int argc, char **argv)
|
|||||||
c[D_CBC_RC5][0]=count;
|
c[D_CBC_RC5][0]=count;
|
||||||
c[D_CBC_BF][0]=count;
|
c[D_CBC_BF][0]=count;
|
||||||
c[D_CBC_CAST][0]=count;
|
c[D_CBC_CAST][0]=count;
|
||||||
|
c[D_CBC_128_AES][0]=count;
|
||||||
|
c[D_CBC_192_AES][0]=count;
|
||||||
|
c[D_CBC_256_AES][0]=count;
|
||||||
|
|
||||||
for (i=1; i<SIZE_NUM; i++)
|
for (i=1; i<SIZE_NUM; i++)
|
||||||
{
|
{
|
||||||
@@ -1222,6 +1296,9 @@ int MAIN(int argc, char **argv)
|
|||||||
c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;
|
c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;
|
||||||
c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
|
c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
|
||||||
c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;
|
c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;
|
||||||
|
c[D_CBC_128_AES][i]=c[D_CBC_128_AES][i-1]*l0/l1;
|
||||||
|
c[D_CBC_192_AES][i]=c[D_CBC_192_AES][i-1]*l0/l1;
|
||||||
|
c[D_CBC_256_AES][i]=c[D_CBC_256_AES][i-1]*l0/l1;
|
||||||
}
|
}
|
||||||
#ifndef OPENSSL_NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
rsa_c[R_RSA_512][0]=count/2000;
|
rsa_c[R_RSA_512][0]=count/2000;
|
||||||
@@ -1700,6 +1777,7 @@ int MAIN(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
EVP_EncryptFinal_ex(&ctx,buf,&outl);
|
EVP_EncryptFinal_ex(&ctx,buf,&outl);
|
||||||
d=Time_F(STOP);
|
d=Time_F(STOP);
|
||||||
|
EVP_CIPHER_CTX_cleanup(&ctx);
|
||||||
}
|
}
|
||||||
if (evp_md)
|
if (evp_md)
|
||||||
{
|
{
|
||||||
@@ -1926,6 +2004,9 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if 1
|
||||||
|
EC_GROUP_precompute_mult(ecdsa[j]->group, NULL);
|
||||||
|
#endif
|
||||||
/* Perform ECDSA signature test */
|
/* Perform ECDSA signature test */
|
||||||
EC_KEY_generate_key(ecdsa[j]);
|
EC_KEY_generate_key(ecdsa[j]);
|
||||||
ret = ECDSA_sign(0, buf, 20, ecdsasig,
|
ret = ECDSA_sign(0, buf, 20, ecdsasig,
|
||||||
@@ -2041,7 +2122,7 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ecdh_b[j]->group = ecdh_a[j]->group;
|
ecdh_b[j]->group = EC_GROUP_dup(ecdh_a[j]->group);
|
||||||
|
|
||||||
/* generate two ECDH key pairs */
|
/* generate two ECDH key pairs */
|
||||||
if (!EC_KEY_generate_key(ecdh_a[j]) ||
|
if (!EC_KEY_generate_key(ecdh_a[j]) ||
|
||||||
@@ -2053,12 +2134,28 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
secret_size_a = ECDH_compute_key(secret_a,
|
/* If field size is not more than 24 octets, then use SHA-1 hash of result;
|
||||||
|
* otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt).
|
||||||
|
*/
|
||||||
|
int field_size, outlen;
|
||||||
|
void *(*kdf)(void *in, size_t inlen, void *out, size_t xoutlen);
|
||||||
|
field_size = EC_GROUP_get_degree(ecdh_a[j]->group);
|
||||||
|
if (field_size <= 24 * 8)
|
||||||
|
{
|
||||||
|
outlen = KDF1_SHA1_len;
|
||||||
|
kdf = KDF1_SHA1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outlen = (field_size+7)/8;
|
||||||
|
kdf = NULL;
|
||||||
|
}
|
||||||
|
secret_size_a = ECDH_compute_key(secret_a, outlen,
|
||||||
ecdh_b[j]->pub_key,
|
ecdh_b[j]->pub_key,
|
||||||
ecdh_a[j]);
|
ecdh_a[j], kdf);
|
||||||
secret_size_b = ECDH_compute_key(secret_b,
|
secret_size_b = ECDH_compute_key(secret_b, outlen,
|
||||||
ecdh_a[j]->pub_key,
|
ecdh_a[j]->pub_key,
|
||||||
ecdh_b[j]);
|
ecdh_b[j], kdf);
|
||||||
if (secret_size_a != secret_size_b)
|
if (secret_size_a != secret_size_b)
|
||||||
ecdh_checks = 0;
|
ecdh_checks = 0;
|
||||||
else
|
else
|
||||||
@@ -2087,9 +2184,9 @@ int MAIN(int argc, char **argv)
|
|||||||
Time_F(START);
|
Time_F(START);
|
||||||
for (count=0,run=1; COND(ecdh_c[j][0]); count++)
|
for (count=0,run=1; COND(ecdh_c[j][0]); count++)
|
||||||
{
|
{
|
||||||
ECDH_compute_key(secret_a,
|
ECDH_compute_key(secret_a, outlen,
|
||||||
ecdh_b[j]->pub_key,
|
ecdh_b[j]->pub_key,
|
||||||
ecdh_a[j]);
|
ecdh_a[j], kdf);
|
||||||
}
|
}
|
||||||
d=Time_F(STOP);
|
d=Time_F(STOP);
|
||||||
BIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\n" :"%ld %d-bit ECDH ops in %.2fs\n",
|
BIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\n" :"%ld %d-bit ECDH ops in %.2fs\n",
|
||||||
@@ -2149,7 +2246,10 @@ show_res:
|
|||||||
#endif
|
#endif
|
||||||
#ifdef HZ
|
#ifdef HZ
|
||||||
#define as_string(s) (#s)
|
#define as_string(s) (#s)
|
||||||
printf("HZ=%g", (double)HZ);
|
{
|
||||||
|
double dbl = HZ;
|
||||||
|
printf("HZ=%g", dbl);
|
||||||
|
}
|
||||||
# ifdef _SC_CLK_TCK
|
# ifdef _SC_CLK_TCK
|
||||||
printf(" [sysconf value]");
|
printf(" [sysconf value]");
|
||||||
# endif
|
# endif
|
||||||
@@ -2316,7 +2416,7 @@ end:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(mret);
|
OPENSSL_EXIT(mret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_message(const char *s, long num, int length)
|
static void print_message(const char *s, long num, int length)
|
||||||
@@ -2356,8 +2456,8 @@ static void pkey_print_message(char *str, char *str2, long num, int bits,
|
|||||||
|
|
||||||
static void print_result(int alg,int run_no,int count,double time_used)
|
static void print_result(int alg,int run_no,int count,double time_used)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,mr ? "+R:%ld:%s:%f\n"
|
BIO_printf(bio_err,mr ? "+R:%d:%s:%f\n"
|
||||||
: "%ld %s's in %.2fs\n",count,names[alg],time_used);
|
: "%d %s's in %.2fs\n",count,names[alg],time_used);
|
||||||
results[alg][run_no]=((double)count)/time_used*lengths[run_no];
|
results[alg][run_no]=((double)count)/time_used*lengths[run_no];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2569,3 +2669,4 @@ static int do_multi(int multi)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|||||||
10
apps/spkac.c
10
apps/spkac.c
@@ -92,7 +92,9 @@ int MAIN(int argc, char **argv)
|
|||||||
CONF *conf = NULL;
|
CONF *conf = NULL;
|
||||||
NETSCAPE_SPKI *spki = NULL;
|
NETSCAPE_SPKI *spki = NULL;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -141,11 +143,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
spksect= *(++argv);
|
spksect= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-noout") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
noout=1;
|
noout=1;
|
||||||
else if (strcmp(*argv,"-pubkey") == 0)
|
else if (strcmp(*argv,"-pubkey") == 0)
|
||||||
@@ -171,7 +175,9 @@ bad:
|
|||||||
BIO_printf(bio_err," -noout don't print SPKAC\n");
|
BIO_printf(bio_err," -noout don't print SPKAC\n");
|
||||||
BIO_printf(bio_err," -pubkey output public key\n");
|
BIO_printf(bio_err," -pubkey output public key\n");
|
||||||
BIO_printf(bio_err," -verify verify SPKAC signature\n");
|
BIO_printf(bio_err," -verify verify SPKAC signature\n");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +187,9 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(keyfile) {
|
if(keyfile) {
|
||||||
pkey = load_key(bio_err,
|
pkey = load_key(bio_err,
|
||||||
@@ -295,5 +303,5 @@ end:
|
|||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
if(passin) OPENSSL_free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,9 @@ int MAIN(int argc, char **argv)
|
|||||||
STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
|
STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
|
||||||
X509_STORE *cert_ctx=NULL;
|
X509_STORE *cert_ctx=NULL;
|
||||||
X509_LOOKUP *lookup=NULL;
|
X509_LOOKUP *lookup=NULL;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
cert_ctx=X509_STORE_new();
|
cert_ctx=X509_STORE_new();
|
||||||
if (cert_ctx == NULL) goto end;
|
if (cert_ctx == NULL) goto end;
|
||||||
@@ -142,11 +144,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (argc-- < 1) goto end;
|
if (argc-- < 1) goto end;
|
||||||
trustfile= *(++argv);
|
trustfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto end;
|
if (--argc < 1) goto end;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-help") == 0)
|
else if (strcmp(*argv,"-help") == 0)
|
||||||
goto end;
|
goto end;
|
||||||
else if (strcmp(*argv,"-ignore_critical") == 0)
|
else if (strcmp(*argv,"-ignore_critical") == 0)
|
||||||
@@ -170,7 +174,9 @@ int MAIN(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
||||||
if (lookup == NULL) abort();
|
if (lookup == NULL) abort();
|
||||||
@@ -219,7 +225,11 @@ int MAIN(int argc, char **argv)
|
|||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if (ret == 1) {
|
if (ret == 1) {
|
||||||
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check] [-engine e] cert1 cert2 ...\n");
|
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
|
BIO_printf(bio_err," [-engine e]");
|
||||||
|
#endif
|
||||||
|
BIO_printf(bio_err," cert1 cert2 ...\n");
|
||||||
BIO_printf(bio_err,"recognized usages:\n");
|
BIO_printf(bio_err,"recognized usages:\n");
|
||||||
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
||||||
X509_PURPOSE *ptmp;
|
X509_PURPOSE *ptmp;
|
||||||
@@ -232,7 +242,7 @@ end:
|
|||||||
sk_X509_pop_free(untrusted, X509_free);
|
sk_X509_pop_free(untrusted, X509_free);
|
||||||
sk_X509_pop_free(trusted, X509_free);
|
sk_X509_pop_free(trusted, X509_free);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e)
|
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e)
|
||||||
|
|||||||
@@ -212,5 +212,5 @@ int MAIN(int argc, char **argv)
|
|||||||
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
|
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
|
||||||
end:
|
end:
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
128
apps/x509.c
128
apps/x509.c
@@ -92,7 +92,9 @@ static char *x509_usage[]={
|
|||||||
" -out arg - output file - default stdout\n",
|
" -out arg - output file - default stdout\n",
|
||||||
" -passin arg - private key password source\n",
|
" -passin arg - private key password source\n",
|
||||||
" -serial - print serial number value\n",
|
" -serial - print serial number value\n",
|
||||||
" -hash - print hash value\n",
|
" -subject_hash - print subject hash value\n",
|
||||||
|
" -issuer_hash - print issuer hash value\n",
|
||||||
|
" -hash - synonym for -subject_hash\n",
|
||||||
" -subject - print subject DN\n",
|
" -subject - print subject DN\n",
|
||||||
" -issuer - print issuer DN\n",
|
" -issuer - print issuer DN\n",
|
||||||
" -email - print email address(es)\n",
|
" -email - print email address(es)\n",
|
||||||
@@ -131,7 +133,9 @@ static char *x509_usage[]={
|
|||||||
" -extensions - section from config file with X509V3 extensions to add\n",
|
" -extensions - section from config file with X509V3 extensions to add\n",
|
||||||
" -clrext - delete extensions before signing and input certificate\n",
|
" -clrext - delete extensions before signing and input certificate\n",
|
||||||
" -nameopt arg - various certificate name options\n",
|
" -nameopt arg - various certificate name options\n",
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
" -engine e - use engine e, possibly a hardware device.\n",
|
" -engine e - use engine e, possibly a hardware device.\n",
|
||||||
|
#endif
|
||||||
" -certopt arg - various certificate text options\n",
|
" -certopt arg - various certificate text options\n",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@@ -165,8 +169,8 @@ int MAIN(int argc, char **argv)
|
|||||||
char *infile=NULL,*outfile=NULL,*keyfile=NULL,*CAfile=NULL;
|
char *infile=NULL,*outfile=NULL,*keyfile=NULL,*CAfile=NULL;
|
||||||
char *CAkeyfile=NULL,*CAserial=NULL;
|
char *CAkeyfile=NULL,*CAserial=NULL;
|
||||||
char *alias=NULL;
|
char *alias=NULL;
|
||||||
int text=0,serial=0,hash=0,subject=0,issuer=0,startdate=0,enddate=0;
|
int text=0,serial=0,subject=0,issuer=0,startdate=0,enddate=0;
|
||||||
int ocspid=0;
|
int subject_hash=0,issuer_hash=0,ocspid=0;
|
||||||
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0;
|
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0;
|
||||||
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
|
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
|
||||||
int C=0;
|
int C=0;
|
||||||
@@ -183,7 +187,9 @@ int MAIN(int argc, char **argv)
|
|||||||
int need_rand = 0;
|
int need_rand = 0;
|
||||||
int checkend=0,checkoffset=0;
|
int checkend=0,checkoffset=0;
|
||||||
unsigned long nmflag = 0, certflag = 0;
|
unsigned long nmflag = 0, certflag = 0;
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
char *engine=NULL;
|
char *engine=NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
reqfile=0;
|
reqfile=0;
|
||||||
|
|
||||||
@@ -354,17 +360,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
if (!set_name_ex(&nmflag, *(++argv))) goto bad;
|
if (!set_name_ex(&nmflag, *(++argv))) goto bad;
|
||||||
}
|
}
|
||||||
else if (strcmp(*argv,"-setalias") == 0)
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
{
|
|
||||||
if (--argc < 1) goto bad;
|
|
||||||
alias= *(++argv);
|
|
||||||
trustout = 1;
|
|
||||||
}
|
|
||||||
else if (strcmp(*argv,"-engine") == 0)
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
engine= *(++argv);
|
engine= *(++argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-C") == 0)
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
C= ++num;
|
C= ++num;
|
||||||
else if (strcmp(*argv,"-email") == 0)
|
else if (strcmp(*argv,"-email") == 0)
|
||||||
@@ -379,8 +381,11 @@ int MAIN(int argc, char **argv)
|
|||||||
x509req= ++num;
|
x509req= ++num;
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
text= ++num;
|
text= ++num;
|
||||||
else if (strcmp(*argv,"-hash") == 0)
|
else if (strcmp(*argv,"-hash") == 0
|
||||||
hash= ++num;
|
|| strcmp(*argv,"-subject_hash") == 0)
|
||||||
|
subject_hash= ++num;
|
||||||
|
else if (strcmp(*argv,"-issuer_hash") == 0)
|
||||||
|
issuer_hash= ++num;
|
||||||
else if (strcmp(*argv,"-subject") == 0)
|
else if (strcmp(*argv,"-subject") == 0)
|
||||||
subject= ++num;
|
subject= ++num;
|
||||||
else if (strcmp(*argv,"-issuer") == 0)
|
else if (strcmp(*argv,"-issuer") == 0)
|
||||||
@@ -450,7 +455,9 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
e = setup_engine(bio_err, engine, 0);
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (need_rand)
|
if (need_rand)
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
@@ -705,10 +712,14 @@ bad:
|
|||||||
if (alstr) BIO_printf(STDout,"%s\n", alstr);
|
if (alstr) BIO_printf(STDout,"%s\n", alstr);
|
||||||
else BIO_puts(STDout,"<No Alias>\n");
|
else BIO_puts(STDout,"<No Alias>\n");
|
||||||
}
|
}
|
||||||
else if (hash == i)
|
else if (subject_hash == i)
|
||||||
{
|
{
|
||||||
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x));
|
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x));
|
||||||
}
|
}
|
||||||
|
else if (issuer_hash == i)
|
||||||
|
{
|
||||||
|
BIO_printf(STDout,"%08lx\n",X509_issuer_name_hash(x));
|
||||||
|
}
|
||||||
else if (pprint == i)
|
else if (pprint == i)
|
||||||
{
|
{
|
||||||
X509_PURPOSE *ptmp;
|
X509_PURPOSE *ptmp;
|
||||||
@@ -1029,108 +1040,47 @@ end:
|
|||||||
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
|
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
|
||||||
if (passin) OPENSSL_free(passin);
|
if (passin) OPENSSL_free(passin);
|
||||||
apps_shutdown();
|
apps_shutdown();
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create)
|
static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile, int create)
|
||||||
{
|
{
|
||||||
char *buf = NULL, *p;
|
char *buf = NULL, *p;
|
||||||
MS_STATIC char buf2[1024];
|
ASN1_INTEGER *bs = NULL;
|
||||||
ASN1_INTEGER *bs = NULL, *bs2 = NULL;
|
|
||||||
BIO *io = NULL;
|
|
||||||
BIGNUM *serial = NULL;
|
BIGNUM *serial = NULL;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
buf=OPENSSL_malloc( ((serialfile == NULL)
|
len = ((serialfile == NULL)
|
||||||
?(strlen(CAfile)+strlen(POSTFIX)+1)
|
?(strlen(CAfile)+strlen(POSTFIX)+1)
|
||||||
:(strlen(serialfile)))+1);
|
:(strlen(serialfile)))+1;
|
||||||
|
buf=OPENSSL_malloc(len);
|
||||||
if (buf == NULL) { BIO_printf(bio_err,"out of mem\n"); goto end; }
|
if (buf == NULL) { BIO_printf(bio_err,"out of mem\n"); goto end; }
|
||||||
if (serialfile == NULL)
|
if (serialfile == NULL)
|
||||||
{
|
{
|
||||||
strcpy(buf,CAfile);
|
BUF_strlcpy(buf,CAfile,len);
|
||||||
for (p=buf; *p; p++)
|
for (p=buf; *p; p++)
|
||||||
if (*p == '.')
|
if (*p == '.')
|
||||||
{
|
{
|
||||||
*p='\0';
|
*p='\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
strcat(buf,POSTFIX);
|
BUF_strlcat(buf,POSTFIX,len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strcpy(buf,serialfile);
|
BUF_strlcpy(buf,serialfile,len);
|
||||||
serial=BN_new();
|
|
||||||
bs=ASN1_INTEGER_new();
|
|
||||||
if ((serial == NULL) || (bs == NULL))
|
|
||||||
{
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
io=BIO_new(BIO_s_file());
|
serial = load_serial(buf, create, NULL);
|
||||||
if (io == NULL)
|
if (serial == NULL) goto end;
|
||||||
{
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (BIO_read_filename(io,buf) <= 0)
|
|
||||||
{
|
|
||||||
if (!create)
|
|
||||||
{
|
|
||||||
perror(buf);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ASN1_INTEGER_set(bs,1);
|
|
||||||
BN_one(serial);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!a2i_ASN1_INTEGER(io,bs,buf2,sizeof buf2))
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"unable to load serial number from %s\n",buf);
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
serial=BN_bin2bn(bs->data,bs->length,serial);
|
|
||||||
if (serial == NULL)
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"error converting bin 2 bn");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!BN_add_word(serial,1))
|
if (!BN_add_word(serial,1))
|
||||||
{ BIO_printf(bio_err,"add_word failure\n"); goto end; }
|
{ BIO_printf(bio_err,"add_word failure\n"); goto end; }
|
||||||
if (!(bs2 = BN_to_ASN1_INTEGER(serial, NULL)))
|
|
||||||
{ BIO_printf(bio_err,"error converting bn 2 asn1_integer\n"); goto end; }
|
|
||||||
if (BIO_write_filename(io,buf) <= 0)
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"error attempting to write serial number file\n");
|
|
||||||
perror(buf);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
i2a_ASN1_INTEGER(io,bs2);
|
|
||||||
BIO_puts(io,"\n");
|
|
||||||
|
|
||||||
BIO_free(io);
|
if (!save_serial(buf, NULL, serial, &bs)) goto end;
|
||||||
if (buf) OPENSSL_free(buf);
|
|
||||||
ASN1_INTEGER_free(bs2);
|
|
||||||
BN_free(serial);
|
|
||||||
io=NULL;
|
|
||||||
return bs;
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (buf) OPENSSL_free(buf);
|
if (buf) OPENSSL_free(buf);
|
||||||
BIO_free(io);
|
|
||||||
ASN1_INTEGER_free(bs);
|
|
||||||
BN_free(serial);
|
BN_free(serial);
|
||||||
return NULL;
|
return bs;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||||
@@ -1152,10 +1102,10 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (sno) bs = sno;
|
if (sno) bs = sno;
|
||||||
else if (!(bs = load_serial(CAfile, serialfile, create)))
|
else if (!(bs = x509_load_serial(CAfile, serialfile, create)))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (!X509_STORE_add_cert(ctx,x)) goto end;
|
/* if (!X509_STORE_add_cert(ctx,x)) goto end;*/
|
||||||
|
|
||||||
/* NOTE: this certificate can/should be self signed, unless it was
|
/* NOTE: this certificate can/should be self signed, unless it was
|
||||||
* a certificate request in which case it is not. */
|
* a certificate request in which case it is not. */
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ RC4-MD5, but a re-connect tries to use DES-CBC-SHA. So netscape, when
|
|||||||
doing a re-connect, always takes the first cipher in the cipher list.
|
doing a re-connect, always takes the first cipher in the cipher list.
|
||||||
|
|
||||||
If we accept a netscape connection, demand a client cert, have a
|
If we accept a netscape connection, demand a client cert, have a
|
||||||
non-self-sighed CA which does not have it's CA in netscape, and the
|
non-self-signed CA which does not have it's CA in netscape, and the
|
||||||
browser has a cert, it will crash/hang. Works for 3.x and 4.xbeta
|
browser has a cert, it will crash/hang. Works for 3.x and 4.xbeta
|
||||||
|
|
||||||
Netscape browsers do not really notice the server sending a
|
Netscape browsers do not really notice the server sending a
|
||||||
|
|||||||
18
certs/expired/vsign3.pem
Normal file
18
certs/expired/vsign3.pem
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||||
|
notBefore=Jan 29 00:00:00 1996 GMT
|
||||||
|
notAfter=Jan 7 23:59:59 2004 GMT
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ
|
||||||
|
BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh
|
||||||
|
c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05
|
||||||
|
NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD
|
||||||
|
VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp
|
||||||
|
bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB
|
||||||
|
jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo
|
||||||
|
RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4
|
||||||
|
rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN
|
||||||
|
BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp
|
||||||
|
STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH
|
||||||
|
ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ
|
||||||
|
pA==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
@@ -1,18 +1,17 @@
|
|||||||
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||||
notBefore=Jan 29 00:00:00 1996 GMT
|
notBefore=Jan 29 00:00:00 1996 GMT
|
||||||
notAfter=Jan 7 23:59:59 2004 GMT
|
notAfter=Aug 1 23:59:59 2028 GMT
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ
|
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
|
||||||
BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh
|
A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
|
||||||
c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05
|
cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
|
||||||
NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD
|
MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
|
||||||
VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp
|
BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
|
||||||
bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB
|
YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
|
||||||
jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo
|
ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
|
||||||
RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4
|
BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
|
||||||
rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN
|
I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
|
||||||
BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp
|
CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
|
||||||
STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH
|
lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
|
||||||
ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ
|
AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
|
||||||
pA==
|
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|||||||
106
config
106
config
@@ -74,34 +74,27 @@ if [ "x$XREL" != "x" ]; then
|
|||||||
echo "whatever-whatever-sco5"; exit 0
|
echo "whatever-whatever-sco5"; exit 0
|
||||||
;;
|
;;
|
||||||
4.2MP)
|
4.2MP)
|
||||||
if [ "x$VERSION" = "x2.01" ]; then
|
case "x${VERSION}" in
|
||||||
echo "${MACHINE}-whatever-unixware201"; exit 0
|
x2.0*) echo "whatever-whatever-unixware20"; exit 0 ;;
|
||||||
elif [ "x$VERSION" = "x2.02" ]; then
|
x2.1*) echo "whatever-whatever-unixware21"; exit 0 ;;
|
||||||
echo "${MACHINE}-whatever-unixware202"; exit 0
|
x2*) echo "whatever-whatever-unixware2"; exit 0 ;;
|
||||||
elif [ "x$VERSION" = "x2.03" ]; then
|
esac
|
||||||
echo "${MACHINE}-whatever-unixware203"; exit 0
|
|
||||||
elif [ "x$VERSION" = "x2.1.1" ]; then
|
|
||||||
echo "${MACHINE}-whatever-unixware211"; exit 0
|
|
||||||
elif [ "x$VERSION" = "x2.1.2" ]; then
|
|
||||||
echo "${MACHINE}-whatever-unixware212"; exit 0
|
|
||||||
elif [ "x$VERSION" = "x2.1.3" ]; then
|
|
||||||
echo "${MACHINE}-whatever-unixware213"; exit 0
|
|
||||||
else
|
|
||||||
echo "${MACHINE}-whatever-unixware2"; exit 0
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
4.2)
|
4.2)
|
||||||
echo "whatever-whatever-unixware1"; exit 0
|
echo "whatever-whatever-unixware1"; exit 0
|
||||||
;;
|
;;
|
||||||
OpenUNIX)
|
|
||||||
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
|
|
||||||
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
5)
|
5)
|
||||||
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
|
case "x${VERSION}" in
|
||||||
echo "${MACHINE}-sco-unixware7"; exit 0
|
# We hardcode i586 in place of ${MACHINE} for the
|
||||||
fi
|
# following reason. The catch is that even though Pentium
|
||||||
|
# is minimum requirement for platforms in question,
|
||||||
|
# ${MACHINE} gets always assigned to i386. Now, problem
|
||||||
|
# with i386 is that it makes ./config pass 386 to
|
||||||
|
# ./Configure, which in turn makes make generate
|
||||||
|
# inefficient SHA-1 (for this moment) code.
|
||||||
|
x7*) echo "i586-sco-unixware7"; exit 0 ;;
|
||||||
|
x8*) echo "i586-unkn-OpenUNIX${VERSION}"; exit 0 ;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@@ -141,7 +134,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||||
case "$HPUXVER" in
|
case "$HPUXVER" in
|
||||||
1[0-9].*) # HPUX 10 and 11 targets are unified
|
1[0-9].*) # HPUX 10 and 11 targets are unified
|
||||||
echo "${MACHINE}-hp-hpux10"; exit 0
|
echo "${MACHINE}-hp-hpux1x"; exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "${MACHINE}-hp-hpux"; exit 0
|
echo "${MACHINE}-hp-hpux"; exit 0
|
||||||
@@ -196,7 +189,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
echo "${MACHINE}-whatever-bsdi"; exit 0
|
echo "${MACHINE}-whatever-bsdi"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
FreeBSD:*)
|
FreeBSD:*:*:*386*)
|
||||||
VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
|
VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
|
||||||
MACH=`sysctl -n hw.model`
|
MACH=`sysctl -n hw.model`
|
||||||
ARCH='whatever'
|
ARCH='whatever'
|
||||||
@@ -205,7 +198,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
*486* ) MACH="i486" ;;
|
*486* ) MACH="i486" ;;
|
||||||
Pentium\ II*) MACH="i686" ;;
|
Pentium\ II*) MACH="i686" ;;
|
||||||
Pentium* ) MACH="i586" ;;
|
Pentium* ) MACH="i586" ;;
|
||||||
Alpha* ) MACH="alpha" ;;
|
|
||||||
* ) MACH="$MACHINE" ;;
|
* ) MACH="$MACHINE" ;;
|
||||||
esac
|
esac
|
||||||
case ${MACH} in
|
case ${MACH} in
|
||||||
@@ -214,6 +206,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
|
echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
FreeBSD:*)
|
||||||
|
echo "${MACHINE}-whatever-freebsd"; exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
NetBSD:*:*:*386*)
|
NetBSD:*:*:*386*)
|
||||||
echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
|
echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
|
||||||
;;
|
;;
|
||||||
@@ -414,9 +410,10 @@ if [ "$SYSTEM" = "HP-UX" ];then
|
|||||||
GCC_BITS="32"
|
GCC_BITS="32"
|
||||||
if [ $GCCVER -ge 30 ]; then
|
if [ $GCCVER -ge 30 ]; then
|
||||||
# PA64 support only came in with gcc 3.0.x.
|
# PA64 support only came in with gcc 3.0.x.
|
||||||
# We look for the preprocessor symbol __LP64__ indicating
|
# We check if the preprocessor symbol __LP64__ is defined...
|
||||||
# 64bit bit long and pointer. sizeof(int) == 32 on HPUX64.
|
if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then
|
||||||
if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
|
: # __LP64__ has slipped through, it therefore is not defined
|
||||||
|
else
|
||||||
GCC_BITS="64"
|
GCC_BITS="64"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -461,6 +458,10 @@ if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${SYSTEM}" = "AIX" ]; then # favor vendor cc over gcc
|
||||||
|
(cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
|
||||||
|
fi
|
||||||
|
|
||||||
CCVER=${CCVER:-0}
|
CCVER=${CCVER:-0}
|
||||||
|
|
||||||
# read the output of the embedded GuessOS
|
# read the output of the embedded GuessOS
|
||||||
@@ -473,7 +474,7 @@ echo Operating system: $GUESSOS
|
|||||||
# more time that I want to waste at the moment
|
# more time that I want to waste at the moment
|
||||||
case "$GUESSOS" in
|
case "$GUESSOS" in
|
||||||
mips2-sgi-irix)
|
mips2-sgi-irix)
|
||||||
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
||||||
CPU=${CPU:-0}
|
CPU=${CPU:-0}
|
||||||
if [ $CPU -ge 4000 ]; then
|
if [ $CPU -ge 4000 ]; then
|
||||||
options="$options -mips2"
|
options="$options -mips2"
|
||||||
@@ -481,7 +482,7 @@ case "$GUESSOS" in
|
|||||||
OUT="irix-$CC"
|
OUT="irix-$CC"
|
||||||
;;
|
;;
|
||||||
mips3-sgi-irix)
|
mips3-sgi-irix)
|
||||||
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
||||||
CPU=${CPU:-0}
|
CPU=${CPU:-0}
|
||||||
if [ $CPU -ge 5000 ]; then
|
if [ $CPU -ge 5000 ]; then
|
||||||
options="$options -mips4"
|
options="$options -mips4"
|
||||||
@@ -497,7 +498,7 @@ case "$GUESSOS" in
|
|||||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
fi
|
fi
|
||||||
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
||||||
CPU=${CPU:-0}
|
CPU=${CPU:-0}
|
||||||
if [ $CPU -ge 5000 ]; then
|
if [ $CPU -ge 5000 ]; then
|
||||||
options="$options -mips4"
|
options="$options -mips4"
|
||||||
@@ -547,12 +548,13 @@ EOF
|
|||||||
ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
|
ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
|
||||||
i386-apple-darwin*) OUT="darwin-i386-cc" ;;
|
i386-apple-darwin*) OUT="darwin-i386-cc" ;;
|
||||||
sparc64-*-linux2)
|
sparc64-*-linux2)
|
||||||
#Before we can uncomment following lines we have to wait at least
|
echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
|
||||||
#till 64-bit glibc for SPARC is operational:-(
|
echo " and wish to build 64-bit library, then you have to"
|
||||||
#echo "WARNING! If you wish to build 64-bit library, then you have to"
|
echo " invoke './Configure linux64-sparcv9' *manually*."
|
||||||
#echo " invoke './Configure linux64-sparcv9' *manually*."
|
if [ "$TEST" = "false" ]; then
|
||||||
#echo " Type return if you want to continue, Ctrl-C to abort."
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
#read waste < /dev/tty
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
|
fi
|
||||||
OUT="linux-sparcv9" ;;
|
OUT="linux-sparcv9" ;;
|
||||||
sparc-*-linux2)
|
sparc-*-linux2)
|
||||||
KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
|
KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
|
||||||
@@ -585,6 +587,7 @@ EOF
|
|||||||
arm*-*-linux2) OUT="linux-elf-arm" ;;
|
arm*-*-linux2) OUT="linux-elf-arm" ;;
|
||||||
s390-*-linux2) OUT="linux-s390" ;;
|
s390-*-linux2) OUT="linux-s390" ;;
|
||||||
s390x-*-linux?) OUT="linux-s390x" ;;
|
s390x-*-linux?) OUT="linux-s390x" ;;
|
||||||
|
x86_64-*-linux?) OUT="linux-x86_64" ;;
|
||||||
*-*-linux2) OUT="linux-elf"
|
*-*-linux2) OUT="linux-elf"
|
||||||
if [ "$GCCVER" -gt 28 ]; then
|
if [ "$GCCVER" -gt 28 ]; then
|
||||||
if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
|
if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
|
||||||
@@ -638,6 +641,8 @@ EOF
|
|||||||
*86*-*-solaris2) OUT="solaris-x86-$CC" ;;
|
*86*-*-solaris2) OUT="solaris-x86-$CC" ;;
|
||||||
*-*-sunos4) OUT="sunos-$CC" ;;
|
*-*-sunos4) OUT="sunos-$CC" ;;
|
||||||
alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
|
alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
|
||||||
|
sparc64-*-freebsd*) OUT="FreeBSD-sparc64" ;;
|
||||||
|
ia64-*-freebsd*) OUT="FreeBSD-ia64" ;;
|
||||||
*-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
|
*-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
|
||||||
*-freebsd[1-2]*) OUT="FreeBSD" ;;
|
*-freebsd[1-2]*) OUT="FreeBSD" ;;
|
||||||
*86*-*-netbsd) OUT="NetBSD-x86" ;;
|
*86*-*-netbsd) OUT="NetBSD-x86" ;;
|
||||||
@@ -678,15 +683,8 @@ EOF
|
|||||||
RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
|
RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
|
||||||
*-siemens-sysv4) OUT="SINIX" ;;
|
*-siemens-sysv4) OUT="SINIX" ;;
|
||||||
*-hpux1*)
|
*-hpux1*)
|
||||||
if [ $CC = "gcc" ];
|
if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
|
||||||
then
|
OUT="hpux64-parisc2-gcc"
|
||||||
if [ $GCC_BITS = "64" ]; then
|
|
||||||
OUT="hpux64-parisc-gcc"
|
|
||||||
else
|
|
||||||
OUT="hpux-parisc-gcc"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
OUT="hpux-parisc-$CC"
|
|
||||||
fi
|
fi
|
||||||
KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
|
KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
|
||||||
KERNEL_BITS=${KERNEL_BITS:-32}
|
KERNEL_BITS=${KERNEL_BITS:-32}
|
||||||
@@ -694,16 +692,16 @@ EOF
|
|||||||
CPU_VERSION=${CPU_VERSION:-0}
|
CPU_VERSION=${CPU_VERSION:-0}
|
||||||
# See <sys/unistd.h> for further info on CPU_VERSION.
|
# See <sys/unistd.h> for further info on CPU_VERSION.
|
||||||
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
|
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
|
||||||
echo "NOTICE! 64-bit is the only ABI currently operational on HP-UXi."
|
echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
|
||||||
echo " Post request to openssl-dev@openssl.org for 32-bit support."
|
echo " If you wish to build 32-bit library, the you have to"
|
||||||
|
echo " invoke './Configure hpux-ia64-cc' *manually*."
|
||||||
if [ "$TEST" = "false" ]; then
|
if [ "$TEST" = "false" ]; then
|
||||||
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
fi
|
fi
|
||||||
OUT="hpux64-ia64-cc"
|
OUT="hpux64-ia64-cc"
|
||||||
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
|
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
|
||||||
if [ "$CC" = "cc" ]; then
|
OUT=${OUT:-"hpux-parisc2-${CC}"}
|
||||||
OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
|
|
||||||
fi
|
|
||||||
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
||||||
echo "WARNING! If you wish to build 64-bit library then you have to"
|
echo "WARNING! If you wish to build 64-bit library then you have to"
|
||||||
echo " invoke './Configure hpux64-parisc2-cc' *manually*."
|
echo " invoke './Configure hpux64-parisc2-cc' *manually*."
|
||||||
@@ -713,9 +711,9 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
|
elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
|
||||||
:
|
OUT="hpux-parisc-${CC}
|
||||||
elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
|
elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
|
||||||
:
|
OUT="hpux-parisc-${CC}
|
||||||
else # Motorola(?) CPU
|
else # Motorola(?) CPU
|
||||||
OUT="hpux-$CC"
|
OUT="hpux-$CC"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -26,31 +26,33 @@ CFLAGS= $(INCLUDE) $(CFLAG)
|
|||||||
|
|
||||||
LIBS=
|
LIBS=
|
||||||
|
|
||||||
SDIRS= md2 md5 sha mdc2 hmac ripemd \
|
SDIRS= objects \
|
||||||
|
md2 md4 md5 sha mdc2 hmac ripemd \
|
||||||
des rc2 rc4 rc5 idea bf cast \
|
des rc2 rc4 rc5 idea bf cast \
|
||||||
bn ec rsa dsa ecdsa ecdh dh dso engine aes \
|
bn ec rsa dsa ecdsa ecdh dh dso engine aes \
|
||||||
buffer bio stack lhash rand err objects \
|
buffer bio stack lhash rand err \
|
||||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
|
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
|
||||||
|
store
|
||||||
|
|
||||||
GENERAL=Makefile README crypto-lib.com install.com
|
GENERAL=Makefile README crypto-lib.com install.com
|
||||||
|
|
||||||
LIB= $(TOP)/libcrypto.a
|
LIB= $(TOP)/libcrypto.a
|
||||||
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
||||||
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c
|
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c
|
||||||
LIBOBJ= cryptlib.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o
|
LIBOBJ= cryptlib.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o
|
||||||
|
|
||||||
SRC= $(LIBSRC)
|
SRC= $(LIBSRC)
|
||||||
|
|
||||||
EXHEADER= crypto.h tmdiff.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
|
ossl_typ.h
|
||||||
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h $(EXHEADER)
|
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h $(EXHEADER)
|
||||||
|
|
||||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||||
|
|
||||||
top:
|
top:
|
||||||
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
||||||
|
|
||||||
all: buildinf.h lib subdirs shared
|
all: shared
|
||||||
|
|
||||||
buildinf.h: ../Makefile.ssl
|
buildinf.h: ../Makefile.ssl
|
||||||
( echo "#ifndef MK1MF_BUILD"; \
|
( echo "#ifndef MK1MF_BUILD"; \
|
||||||
@@ -81,11 +83,11 @@ files:
|
|||||||
done;
|
done;
|
||||||
|
|
||||||
links:
|
links:
|
||||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
@sh $(TOP)/util/point.sh Makefile.ssl Makefile
|
||||||
@$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
|
@$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
|
||||||
@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
|
@$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
|
||||||
@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
|
@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
|
||||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
@sh $(TOP)/util/point.sh Makefile.ssl Makefile
|
||||||
@for i in $(SDIRS); do \
|
@for i in $(SDIRS); do \
|
||||||
(cd $$i && echo "making links in crypto/$$i..." && \
|
(cd $$i && echo "making links in crypto/$$i..." && \
|
||||||
$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
|
$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
|
||||||
@@ -96,7 +98,7 @@ lib: $(LIBOBJ)
|
|||||||
$(RANLIB) $(LIB) || echo Never mind.
|
$(RANLIB) $(LIB) || echo Never mind.
|
||||||
@touch lib
|
@touch lib
|
||||||
|
|
||||||
shared:
|
shared: buildinf.h lib subdirs
|
||||||
if [ -n "$(SHARED_LIBS)" ]; then \
|
if [ -n "$(SHARED_LIBS)" ]; then \
|
||||||
(cd ..; $(MAKE) $(SHARED_LIB)); \
|
(cd ..; $(MAKE) $(SHARED_LIB)); \
|
||||||
fi
|
fi
|
||||||
@@ -141,7 +143,7 @@ depend:
|
|||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i && echo "making depend in crypto/$$i..." && \
|
(cd $$i && echo "making depend in crypto/$$i..." && \
|
||||||
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ); \
|
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@@ -203,6 +205,8 @@ mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
|||||||
mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
mem_dbg.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
mem_dbg.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c
|
mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c
|
||||||
|
o_str.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_str.c
|
||||||
|
o_str.o: o_str.h
|
||||||
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
|
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
|
||||||
o_time.o: o_time.h
|
o_time.o: o_time.h
|
||||||
tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ files:
|
|||||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||||
|
|
||||||
links:
|
links:
|
||||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
@sh $(TOP)/util/point.sh Makefile.ssl Makefile
|
||||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||||
|
|||||||
@@ -52,12 +52,15 @@
|
|||||||
#ifndef HEADER_AES_H
|
#ifndef HEADER_AES_H
|
||||||
#define HEADER_AES_H
|
#define HEADER_AES_H
|
||||||
|
|
||||||
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
#ifdef OPENSSL_NO_AES
|
#ifdef OPENSSL_NO_AES
|
||||||
#error AES is disabled.
|
#error AES is disabled.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const int AES_DECRYPT = 0;
|
#define AES_ENCRYPT 1
|
||||||
static const int AES_ENCRYPT = 1;
|
#define AES_DECRYPT 0
|
||||||
|
|
||||||
/* Because array size can't be a const in C, the following two are macros.
|
/* Because array size can't be a const in C, the following two are macros.
|
||||||
Both sizes are in bytes. */
|
Both sizes are in bytes. */
|
||||||
#define AES_MAXNR 14
|
#define AES_MAXNR 14
|
||||||
@@ -94,12 +97,21 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
|||||||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
const unsigned long length, const AES_KEY *key,
|
const unsigned long length, const AES_KEY *key,
|
||||||
unsigned char *ivec, int *num, const int enc);
|
unsigned char *ivec, int *num, const int enc);
|
||||||
|
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
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,
|
||||||
|
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,
|
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
const unsigned long length, const AES_KEY *key,
|
const unsigned long length, const AES_KEY *key,
|
||||||
unsigned char *ivec, int *num);
|
unsigned char *ivec, int *num);
|
||||||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
const unsigned long length, const AES_KEY *key,
|
const unsigned long length, const AES_KEY *key,
|
||||||
unsigned char counter[AES_BLOCK_SIZE],
|
unsigned char ivec[AES_BLOCK_SIZE],
|
||||||
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
||||||
unsigned int *num);
|
unsigned int *num);
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
|||||||
for(n=len; n < AES_BLOCK_SIZE; ++n)
|
for(n=len; n < AES_BLOCK_SIZE; ++n)
|
||||||
tmp[n] = ivec[n];
|
tmp[n] = ivec[n];
|
||||||
AES_encrypt(tmp, tmp, key);
|
AES_encrypt(tmp, tmp, key);
|
||||||
memcpy(out, tmp, len);
|
memcpy(out, tmp, AES_BLOCK_SIZE);
|
||||||
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -104,7 +104,7 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
|||||||
memcpy(tmp, in, AES_BLOCK_SIZE);
|
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||||
AES_decrypt(tmp, tmp, key);
|
AES_decrypt(tmp, tmp, key);
|
||||||
for(n=0; n < len; ++n)
|
for(n=0; n < len; ++n)
|
||||||
out[n] ^= ivec[n];
|
out[n] = tmp[n] ^ ivec[n];
|
||||||
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,3 +155,96 @@ void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
|||||||
*num=n;
|
*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 */
|
||||||
|
/* Untested, once it is working, it will be optimised */
|
||||||
|
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;
|
||||||
|
unsigned char ovec[AES_BLOCK_SIZE*2];
|
||||||
|
|
||||||
|
assert(in && out && key && ivec);
|
||||||
|
if(enc)
|
||||||
|
{
|
||||||
|
/* construct the new IV */
|
||||||
|
AES_encrypt(ivec,ovec,key);
|
||||||
|
/* encrypt the input */
|
||||||
|
for(n=0 ; n < (nbits+7)/8 ; ++n)
|
||||||
|
out[n]=in[n]^ovec[n];
|
||||||
|
/* fill in the first half of the new IV with the current IV */
|
||||||
|
memcpy(ovec,ivec,AES_BLOCK_SIZE);
|
||||||
|
/* and put the ciphertext in the second half */
|
||||||
|
memcpy(ovec+AES_BLOCK_SIZE,out,(nbits+7)/8);
|
||||||
|
/* shift ovec left most of the bits... */
|
||||||
|
memmove(ovec,ovec+nbits/8,AES_BLOCK_SIZE+(nbits%8 ? 1 : 0));
|
||||||
|
/* now the remaining bits */
|
||||||
|
if(nbits%8 != 0)
|
||||||
|
for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
|
||||||
|
{
|
||||||
|
ovec[n]<<=nbits%8;
|
||||||
|
ovec[n]|=ovec[n+1]>>(8-nbits%8);
|
||||||
|
}
|
||||||
|
/* finally, move it back into place */
|
||||||
|
memcpy(ivec,ovec,AES_BLOCK_SIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* construct the new IV in the first half of ovec */
|
||||||
|
AES_encrypt(ivec,ovec,key);
|
||||||
|
/* decrypt the input */
|
||||||
|
for(n=0 ; n < (nbits+7)/8 ; ++n)
|
||||||
|
out[n]=in[n]^ovec[n];
|
||||||
|
/* fill in the first half of the new IV with the current IV */
|
||||||
|
memcpy(ovec,ivec,AES_BLOCK_SIZE);
|
||||||
|
/* append the ciphertext */
|
||||||
|
memcpy(ovec+AES_BLOCK_SIZE,in,(nbits+7)/8);
|
||||||
|
/* shift ovec left most of the bits... */
|
||||||
|
memmove(ovec,ovec+nbits/8,AES_BLOCK_SIZE+(nbits%8 ? 1 : 0));
|
||||||
|
/* now the remaining bits */
|
||||||
|
if(nbits%8 != 0)
|
||||||
|
for(n=0 ; n < AES_BLOCK_SIZE ; ++n)
|
||||||
|
{
|
||||||
|
ovec[n]<<=nbits%8;
|
||||||
|
ovec[n]|=ovec[n+1]>>(8-nbits%8);
|
||||||
|
}
|
||||||
|
/* finally, move it back into place */
|
||||||
|
memcpy(ivec,ovec,AES_BLOCK_SIZE);
|
||||||
|
}
|
||||||
|
/* 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,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char *ivec, int *num, const int enc)
|
||||||
|
{
|
||||||
|
unsigned int n;
|
||||||
|
unsigned char c[1],d[1];
|
||||||
|
|
||||||
|
assert(in && out && key && ivec && num);
|
||||||
|
assert(*num == 0);
|
||||||
|
|
||||||
|
memset(out,0,(length+7)/8);
|
||||||
|
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,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char *ivec, int *num, const int enc)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -750,7 +750,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
|||||||
rk[2] = GETU32(userKey + 8);
|
rk[2] = GETU32(userKey + 8);
|
||||||
rk[3] = GETU32(userKey + 12);
|
rk[3] = GETU32(userKey + 12);
|
||||||
if (bits == 128) {
|
if (bits == 128) {
|
||||||
for (;;) {
|
while (1) {
|
||||||
temp = rk[3];
|
temp = rk[3];
|
||||||
rk[4] = rk[0] ^
|
rk[4] = rk[0] ^
|
||||||
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||||
@@ -770,7 +770,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
|||||||
rk[4] = GETU32(userKey + 16);
|
rk[4] = GETU32(userKey + 16);
|
||||||
rk[5] = GETU32(userKey + 20);
|
rk[5] = GETU32(userKey + 20);
|
||||||
if (bits == 192) {
|
if (bits == 192) {
|
||||||
for (;;) {
|
while (1) {
|
||||||
temp = rk[ 5];
|
temp = rk[ 5];
|
||||||
rk[ 6] = rk[ 0] ^
|
rk[ 6] = rk[ 0] ^
|
||||||
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||||
@@ -792,7 +792,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
|||||||
rk[6] = GETU32(userKey + 24);
|
rk[6] = GETU32(userKey + 24);
|
||||||
rk[7] = GETU32(userKey + 28);
|
rk[7] = GETU32(userKey + 28);
|
||||||
if (bits == 256) {
|
if (bits == 256) {
|
||||||
for (;;) {
|
while (1) {
|
||||||
temp = rk[ 7];
|
temp = rk[ 7];
|
||||||
rk[ 8] = rk[ 0] ^
|
rk[ 8] = rk[ 0] ^
|
||||||
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
|
||||||
|
|||||||
@@ -59,39 +59,44 @@
|
|||||||
#include <openssl/aes.h>
|
#include <openssl/aes.h>
|
||||||
#include "aes_locl.h"
|
#include "aes_locl.h"
|
||||||
|
|
||||||
/* NOTE: CTR mode is big-endian. The rest of the AES code
|
/* NOTE: the IV/counter CTR mode is big-endian. The rest of the AES code
|
||||||
* is endian-neutral. */
|
* is endian-neutral. */
|
||||||
|
|
||||||
/* increment counter (128-bit int) by 2^64 */
|
/* increment counter (128-bit int) by 1 */
|
||||||
static void AES_ctr128_inc(unsigned char *counter) {
|
static void AES_ctr128_inc(unsigned char *counter) {
|
||||||
unsigned long c;
|
unsigned long c;
|
||||||
|
|
||||||
/* Grab 3rd dword of counter and increment */
|
/* Grab bottom dword of counter and increment */
|
||||||
#ifdef L_ENDIAN
|
c = GETU32(counter + 12);
|
||||||
|
c++;
|
||||||
|
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 = GETU32(counter + 8);
|
||||||
c++;
|
c++;
|
||||||
PUTU32(counter + 8, c);
|
PUTU32(counter + 8, c);
|
||||||
#else
|
|
||||||
|
/* if no overflow, we're done */
|
||||||
|
if (c)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Grab 2nd dword of counter and increment */
|
||||||
c = GETU32(counter + 4);
|
c = GETU32(counter + 4);
|
||||||
c++;
|
c++;
|
||||||
PUTU32(counter + 4, c);
|
PUTU32(counter + 4, c);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* if no overflow, we're done */
|
/* if no overflow, we're done */
|
||||||
if (c)
|
if (c)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Grab top dword of counter and increment */
|
/* Grab top dword of counter and increment */
|
||||||
#ifdef L_ENDIAN
|
|
||||||
c = GETU32(counter + 12);
|
|
||||||
c++;
|
|
||||||
PUTU32(counter + 12, c);
|
|
||||||
#else
|
|
||||||
c = GETU32(counter + 0);
|
c = GETU32(counter + 0);
|
||||||
c++;
|
c++;
|
||||||
PUTU32(counter + 0, c);
|
PUTU32(counter + 0, c);
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The input encrypted as though 128bit counter mode is being
|
/* The input encrypted as though 128bit counter mode is being
|
||||||
@@ -100,10 +105,16 @@ static void AES_ctr128_inc(unsigned char *counter) {
|
|||||||
* encrypted counter is kept in ecount_buf. Both *num and
|
* encrypted counter is kept in ecount_buf. Both *num and
|
||||||
* ecount_buf must be initialised with zeros before the first
|
* ecount_buf must be initialised with zeros before the first
|
||||||
* call to AES_ctr128_encrypt().
|
* 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,
|
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
const unsigned long length, const AES_KEY *key,
|
const unsigned long length, const AES_KEY *key,
|
||||||
unsigned char counter[AES_BLOCK_SIZE],
|
unsigned char ivec[AES_BLOCK_SIZE],
|
||||||
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
||||||
unsigned int *num) {
|
unsigned int *num) {
|
||||||
|
|
||||||
@@ -117,8 +128,8 @@ void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
|||||||
|
|
||||||
while (l--) {
|
while (l--) {
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
AES_encrypt(counter, ecount_buf, key);
|
AES_encrypt(ivec, ecount_buf, key);
|
||||||
AES_ctr128_inc(counter);
|
AES_ctr128_inc(ivec);
|
||||||
}
|
}
|
||||||
*(out++) = *(in++) ^ ecount_buf[n];
|
*(out++) = *(in++) ^ ecount_buf[n];
|
||||||
n = (n+1) % AES_BLOCK_SIZE;
|
n = (n+1) % AES_BLOCK_SIZE;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -113,11 +113,12 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
|
ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
|
||||||
long len)
|
const unsigned char **pp, long len)
|
||||||
{
|
{
|
||||||
ASN1_BIT_STRING *ret=NULL;
|
ASN1_BIT_STRING *ret=NULL;
|
||||||
unsigned char *p,*s;
|
const unsigned char *p;
|
||||||
|
unsigned char *s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (len < 1)
|
if (len < 1)
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ int i2d_ASN1_BOOLEAN(int a, unsigned char **pp)
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int d2i_ASN1_BOOLEAN(int *a, unsigned char **pp, long length)
|
int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length)
|
||||||
{
|
{
|
||||||
int ret= -1;
|
int ret= -1;
|
||||||
unsigned char *p;
|
const unsigned char *p;
|
||||||
long len;
|
long len;
|
||||||
int inf,tag,xclass;
|
int inf,tag,xclass;
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|||||||
@@ -60,14 +60,15 @@
|
|||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
#include <openssl/asn1.h>
|
#include <openssl/asn1.h>
|
||||||
|
|
||||||
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c);
|
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c);
|
||||||
/* type is a 'bitmap' of acceptable string types.
|
/* type is a 'bitmap' of acceptable string types.
|
||||||
*/
|
*/
|
||||||
ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
|
ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
|
||||||
long length, int type)
|
long length, int type)
|
||||||
{
|
{
|
||||||
ASN1_STRING *ret=NULL;
|
ASN1_STRING *ret=NULL;
|
||||||
unsigned char *p,*s;
|
const unsigned char *p;
|
||||||
|
unsigned char *s;
|
||||||
long len;
|
long len;
|
||||||
int inf,tag,xclass;
|
int inf,tag,xclass;
|
||||||
int i=0;
|
int i=0;
|
||||||
@@ -153,11 +154,12 @@ int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass)
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
|
ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
|
||||||
int Ptag, int Pclass)
|
long length, int Ptag, int Pclass)
|
||||||
{
|
{
|
||||||
ASN1_STRING *ret=NULL;
|
ASN1_STRING *ret=NULL;
|
||||||
unsigned char *p,*s;
|
const unsigned char *p;
|
||||||
|
unsigned char *s;
|
||||||
long len;
|
long len;
|
||||||
int inf,tag,xclass;
|
int inf,tag,xclass;
|
||||||
int i=0;
|
int i=0;
|
||||||
@@ -185,7 +187,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
|
|||||||
|
|
||||||
if (inf & V_ASN1_CONSTRUCTED)
|
if (inf & V_ASN1_CONSTRUCTED)
|
||||||
{
|
{
|
||||||
ASN1_CTX c;
|
ASN1_const_CTX c;
|
||||||
|
|
||||||
c.pp=pp;
|
c.pp=pp;
|
||||||
c.p=p;
|
c.p=p;
|
||||||
@@ -247,7 +249,7 @@ err:
|
|||||||
* them into the one structure that is then returned */
|
* them into the one structure that is then returned */
|
||||||
/* There have been a few bug fixes for this function from
|
/* There have been a few bug fixes for this function from
|
||||||
* Paul Keogh <paul.keogh@sse.ie>, many thanks to him */
|
* Paul Keogh <paul.keogh@sse.ie>, many thanks to him */
|
||||||
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
|
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c)
|
||||||
{
|
{
|
||||||
ASN1_STRING *os=NULL;
|
ASN1_STRING *os=NULL;
|
||||||
BUF_MEM b;
|
BUF_MEM b;
|
||||||
@@ -268,7 +270,7 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
|
|||||||
{
|
{
|
||||||
if (c->inf & 1)
|
if (c->inf & 1)
|
||||||
{
|
{
|
||||||
c->eos=ASN1_check_infinite_end(&c->p,
|
c->eos=ASN1_const_check_infinite_end(&c->p,
|
||||||
(long)(c->max-c->p));
|
(long)(c->max-c->p));
|
||||||
if (c->eos) break;
|
if (c->eos) break;
|
||||||
}
|
}
|
||||||
@@ -296,7 +298,7 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
|
|||||||
num+=os->length;
|
num+=os->length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!asn1_Finish(c)) goto err;
|
if (!asn1_const_Finish(c)) goto err;
|
||||||
|
|
||||||
a->length=num;
|
a->length=num;
|
||||||
if (a->data != NULL) OPENSSL_free(a->data);
|
if (a->data != NULL) OPENSSL_free(a->data);
|
||||||
|
|||||||
@@ -107,14 +107,14 @@ err:
|
|||||||
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x)
|
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x)
|
||||||
{
|
{
|
||||||
BUF_MEM *b = NULL;
|
BUF_MEM *b = NULL;
|
||||||
unsigned char *p;
|
const unsigned char *p;
|
||||||
void *ret=NULL;
|
void *ret=NULL;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = asn1_d2i_read_bio(in, &b);
|
len = asn1_d2i_read_bio(in, &b);
|
||||||
if(len < 0) goto err;
|
if(len < 0) goto err;
|
||||||
|
|
||||||
p=(unsigned char *)b->data;
|
p=(const unsigned char *)b->data;
|
||||||
ret=ASN1_item_d2i(x,&p,len, it);
|
ret=ASN1_item_d2i(x,&p,len, it);
|
||||||
err:
|
err:
|
||||||
if (b != NULL) BUF_MEM_free(b);
|
if (b != NULL) BUF_MEM_free(b);
|
||||||
@@ -146,10 +146,15 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
|
|||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
int i;
|
int i;
|
||||||
int ret=-1;
|
int ret=-1;
|
||||||
ASN1_CTX c;
|
ASN1_const_CTX c;
|
||||||
int want=HEADER_SIZE;
|
int want=HEADER_SIZE;
|
||||||
int eos=0;
|
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;
|
int off=0;
|
||||||
|
#endif
|
||||||
int len=0;
|
int len=0;
|
||||||
|
|
||||||
b=BUF_MEM_new();
|
b=BUF_MEM_new();
|
||||||
@@ -226,13 +231,18 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
|
|||||||
ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE);
|
ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
while (want > 0)
|
||||||
|
{
|
||||||
i=BIO_read(in,&(b->data[len]),want);
|
i=BIO_read(in,&(b->data[len]),want);
|
||||||
if (i <= 0)
|
if (i <= 0)
|
||||||
{
|
{
|
||||||
ASN1err(ASN1_F_ASN1_D2I_BIO,ASN1_R_NOT_ENOUGH_DATA);
|
ASN1err(ASN1_F_ASN1_D2I_BIO,
|
||||||
|
ASN1_R_NOT_ENOUGH_DATA);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
len+=i;
|
len+=i;
|
||||||
|
want -= i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
off+=(int)c.slen;
|
off+=(int)c.slen;
|
||||||
if (eos <= 0)
|
if (eos <= 0)
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)
|
|||||||
|
|
||||||
void *ASN1_item_dup(const ASN1_ITEM *it, void *x)
|
void *ASN1_item_dup(const ASN1_ITEM *it, void *x)
|
||||||
{
|
{
|
||||||
unsigned char *b = NULL, *p;
|
unsigned char *b = NULL;
|
||||||
|
const unsigned char *p;
|
||||||
long i;
|
long i;
|
||||||
void *ret;
|
void *ret;
|
||||||
|
|
||||||
|
|||||||
@@ -67,12 +67,13 @@
|
|||||||
|
|
||||||
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
|
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
|
||||||
{
|
{
|
||||||
int i,j,k;
|
int j,k;
|
||||||
|
unsigned int i;
|
||||||
unsigned char buf[sizeof(long)+1];
|
unsigned char buf[sizeof(long)+1];
|
||||||
long d;
|
long d;
|
||||||
|
|
||||||
a->type=V_ASN1_ENUMERATED;
|
a->type=V_ASN1_ENUMERATED;
|
||||||
if (a->length < (sizeof(long)+1))
|
if (a->length < (int)(sizeof(long)+1))
|
||||||
{
|
{
|
||||||
if (a->data != NULL)
|
if (a->data != NULL)
|
||||||
OPENSSL_free(a->data);
|
OPENSSL_free(a->data);
|
||||||
@@ -116,7 +117,7 @@ long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a)
|
|||||||
else if (i != V_ASN1_ENUMERATED)
|
else if (i != V_ASN1_ENUMERATED)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (a->length > sizeof(long))
|
if (a->length > (int)sizeof(long))
|
||||||
{
|
{
|
||||||
/* hmm... a bit ugly */
|
/* hmm... a bit ugly */
|
||||||
return(0xffffffffL);
|
return(0xffffffffL);
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ err:
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str)
|
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
|
||||||
{
|
{
|
||||||
ASN1_GENERALIZEDTIME t;
|
ASN1_GENERALIZEDTIME t;
|
||||||
|
|
||||||
@@ -208,6 +208,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
|||||||
char *p;
|
char *p;
|
||||||
struct tm *ts;
|
struct tm *ts;
|
||||||
struct tm data;
|
struct tm data;
|
||||||
|
size_t len = 20;
|
||||||
|
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
s=M_ASN1_GENERALIZEDTIME_new();
|
s=M_ASN1_GENERALIZEDTIME_new();
|
||||||
@@ -219,16 +220,16 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
p=(char *)s->data;
|
p=(char *)s->data;
|
||||||
if ((p == NULL) || (s->length < 16))
|
if ((p == NULL) || ((size_t)s->length < len))
|
||||||
{
|
{
|
||||||
p=OPENSSL_malloc(20);
|
p=OPENSSL_malloc(len);
|
||||||
if (p == NULL) return(NULL);
|
if (p == NULL) return(NULL);
|
||||||
if (s->data != NULL)
|
if (s->data != NULL)
|
||||||
OPENSSL_free(s->data);
|
OPENSSL_free(s->data);
|
||||||
s->data=(unsigned char *)p;
|
s->data=(unsigned char *)p;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(p,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
|
BIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
|
||||||
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
|
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
|
||||||
s->length=strlen(p);
|
s->length=strlen(p);
|
||||||
s->type=V_ASN1_GENERALIZEDTIME;
|
s->type=V_ASN1_GENERALIZEDTIME;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ int i2d_ASN1_HEADER(ASN1_HEADER *a, unsigned char **pp)
|
|||||||
M_ASN1_I2D_finish();
|
M_ASN1_I2D_finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a, unsigned char **pp,
|
ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a, const unsigned char **pp,
|
||||||
long length)
|
long length)
|
||||||
{
|
{
|
||||||
M_ASN1_D2I_vars(a,ASN1_HEADER *,ASN1_HEADER_new);
|
M_ASN1_D2I_vars(a,ASN1_HEADER *,ASN1_HEADER_new);
|
||||||
|
|||||||
@@ -155,11 +155,12 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
|
|||||||
|
|
||||||
/* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */
|
/* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */
|
||||||
|
|
||||||
ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
|
||||||
long len)
|
long len)
|
||||||
{
|
{
|
||||||
ASN1_INTEGER *ret=NULL;
|
ASN1_INTEGER *ret=NULL;
|
||||||
unsigned char *p,*to,*s, *pend;
|
const unsigned char *p, *pend;
|
||||||
|
unsigned char *to,*s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((a == NULL) || ((*a) == NULL))
|
if ((a == NULL) || ((*a) == NULL))
|
||||||
@@ -247,11 +248,12 @@ err:
|
|||||||
* with its MSB set as negative (it doesn't add a padding zero).
|
* with its MSB set as negative (it doesn't add a padding zero).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
|
||||||
long length)
|
long length)
|
||||||
{
|
{
|
||||||
ASN1_INTEGER *ret=NULL;
|
ASN1_INTEGER *ret=NULL;
|
||||||
unsigned char *p,*to,*s;
|
const unsigned char *p;
|
||||||
|
unsigned char *to,*s;
|
||||||
long len;
|
long len;
|
||||||
int inf,tag,xclass;
|
int inf,tag,xclass;
|
||||||
int i;
|
int i;
|
||||||
@@ -313,12 +315,13 @@ err:
|
|||||||
|
|
||||||
int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)
|
int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)
|
||||||
{
|
{
|
||||||
int i,j,k;
|
int j,k;
|
||||||
|
unsigned int i;
|
||||||
unsigned char buf[sizeof(long)+1];
|
unsigned char buf[sizeof(long)+1];
|
||||||
long d;
|
long d;
|
||||||
|
|
||||||
a->type=V_ASN1_INTEGER;
|
a->type=V_ASN1_INTEGER;
|
||||||
if (a->length < (sizeof(long)+1))
|
if (a->length < (int)(sizeof(long)+1))
|
||||||
{
|
{
|
||||||
if (a->data != NULL)
|
if (a->data != NULL)
|
||||||
OPENSSL_free(a->data);
|
OPENSSL_free(a->data);
|
||||||
@@ -362,7 +365,7 @@ long ASN1_INTEGER_get(ASN1_INTEGER *a)
|
|||||||
else if (i != V_ASN1_INTEGER)
|
else if (i != V_ASN1_INTEGER)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (a->length > sizeof(long))
|
if (a->length > (int)sizeof(long))
|
||||||
{
|
{
|
||||||
/* hmm... a bit ugly */
|
/* hmm... a bit ugly */
|
||||||
return(0xffffffffL);
|
return(0xffffffffL);
|
||||||
|
|||||||
@@ -145,14 +145,14 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
|
|||||||
|
|
||||||
if((minsize > 0) && (nchar < minsize)) {
|
if((minsize > 0) && (nchar < minsize)) {
|
||||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_SHORT);
|
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_SHORT);
|
||||||
sprintf(strbuf, "%ld", minsize);
|
BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
|
||||||
ERR_add_error_data(2, "minsize=", strbuf);
|
ERR_add_error_data(2, "minsize=", strbuf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((maxsize > 0) && (nchar > maxsize)) {
|
if((maxsize > 0) && (nchar > maxsize)) {
|
||||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_LONG);
|
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_LONG);
|
||||||
sprintf(strbuf, "%ld", maxsize);
|
BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
|
||||||
ERR_add_error_data(2, "maxsize=", strbuf);
|
ERR_add_error_data(2, "maxsize=", strbuf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -296,7 +296,7 @@ static int in_utf8(unsigned long value, void *arg)
|
|||||||
|
|
||||||
static int out_utf8(unsigned long value, void *arg)
|
static int out_utf8(unsigned long value, void *arg)
|
||||||
{
|
{
|
||||||
long *outlen;
|
int *outlen;
|
||||||
outlen = arg;
|
outlen = arg;
|
||||||
*outlen += UTF8_putc(NULL, -1, value);
|
*outlen += UTF8_putc(NULL, -1, value);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -184,15 +184,15 @@ int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
|
|||||||
if ((a == NULL) || (a->data == NULL))
|
if ((a == NULL) || (a->data == NULL))
|
||||||
return(BIO_write(bp,"NULL",4));
|
return(BIO_write(bp,"NULL",4));
|
||||||
i=i2t_ASN1_OBJECT(buf,sizeof buf,a);
|
i=i2t_ASN1_OBJECT(buf,sizeof buf,a);
|
||||||
if (i > sizeof buf) i=sizeof buf;
|
if (i > (int)sizeof(buf)) i=sizeof buf;
|
||||||
BIO_write(bp,buf,i);
|
BIO_write(bp,buf,i);
|
||||||
return(i);
|
return(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
|
ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
|
||||||
long length)
|
long length)
|
||||||
{
|
{
|
||||||
unsigned char *p;
|
const unsigned char *p;
|
||||||
long len;
|
long len;
|
||||||
int tag,xclass;
|
int tag,xclass;
|
||||||
int inf,i;
|
int inf,i;
|
||||||
@@ -219,11 +219,11 @@ err:
|
|||||||
ASN1_OBJECT_free(ret);
|
ASN1_OBJECT_free(ret);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
|
ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
|
||||||
long len)
|
long len)
|
||||||
{
|
{
|
||||||
ASN1_OBJECT *ret=NULL;
|
ASN1_OBJECT *ret=NULL;
|
||||||
unsigned char *p;
|
const unsigned char *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* only the ASN1_OBJECTs from the 'table' will have values
|
/* only the ASN1_OBJECTs from the 'table' will have values
|
||||||
|
|||||||
@@ -66,6 +66,6 @@ ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *x)
|
|||||||
int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b)
|
int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b)
|
||||||
{ return M_ASN1_OCTET_STRING_cmp(a, b); }
|
{ return M_ASN1_OCTET_STRING_cmp(a, b); }
|
||||||
|
|
||||||
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, unsigned char *d, int len)
|
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len)
|
||||||
{ return M_ASN1_OCTET_STRING_set(x, d, len); }
|
{ return M_ASN1_OCTET_STRING_set(x, d, len); }
|
||||||
|
|
||||||
|
|||||||
@@ -153,10 +153,10 @@ SetBlob
|
|||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
|
STACK *d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
|
||||||
char *(*func)(), void (*free_func)(void *), int ex_tag, int ex_class)
|
char *(*func)(), void (*free_func)(void *), int ex_tag, int ex_class)
|
||||||
{
|
{
|
||||||
ASN1_CTX c;
|
ASN1_const_CTX c;
|
||||||
STACK *ret=NULL;
|
STACK *ret=NULL;
|
||||||
|
|
||||||
if ((a == NULL) || ((*a) == NULL))
|
if ((a == NULL) || ((*a) == NULL))
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -204,9 +204,9 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
|||||||
err:
|
err:
|
||||||
EVP_MD_CTX_cleanup(&ctx);
|
EVP_MD_CTX_cleanup(&ctx);
|
||||||
if (buf_in != NULL)
|
if (buf_in != NULL)
|
||||||
{ memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
|
{ OPENSSL_cleanse((char *)buf_in,(unsigned int)inl); OPENSSL_free(buf_in); }
|
||||||
if (buf_out != NULL)
|
if (buf_out != NULL)
|
||||||
{ memset((char *)buf_out,0,outll); OPENSSL_free(buf_out); }
|
{ OPENSSL_cleanse((char *)buf_out,outll); OPENSSL_free(buf_out); }
|
||||||
return(outl);
|
return(outl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,10 +229,11 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
|||||||
else
|
else
|
||||||
a=algor2;
|
a=algor2;
|
||||||
if (a == NULL) continue;
|
if (a == NULL) continue;
|
||||||
if (type->pkey_type == NID_dsaWithSHA1)
|
if (type->pkey_type == NID_dsaWithSHA1 ||
|
||||||
|
type->pkey_type == NID_ecdsa_with_SHA1)
|
||||||
{
|
{
|
||||||
/* special case: RFC 2459 tells us to omit 'parameters'
|
/* special case: RFC 3279 tells us to omit 'parameters'
|
||||||
* with id-dsa-with-sha1 */
|
* with id-dsa-with-sha1 and ecdsa-with-SHA1 */
|
||||||
ASN1_TYPE_free(a->parameter);
|
ASN1_TYPE_free(a->parameter);
|
||||||
a->parameter = NULL;
|
a->parameter = NULL;
|
||||||
}
|
}
|
||||||
@@ -287,8 +288,8 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
|||||||
err:
|
err:
|
||||||
EVP_MD_CTX_cleanup(&ctx);
|
EVP_MD_CTX_cleanup(&ctx);
|
||||||
if (buf_in != NULL)
|
if (buf_in != NULL)
|
||||||
{ memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
|
{ OPENSSL_cleanse((char *)buf_in,(unsigned int)inl); OPENSSL_free(buf_in); }
|
||||||
if (buf_out != NULL)
|
if (buf_out != NULL)
|
||||||
{ memset((char *)buf_out,0,outll); OPENSSL_free(buf_out); }
|
{ OPENSSL_cleanse((char *)buf_out,outll); OPENSSL_free(buf_out); }
|
||||||
return(outl);
|
return(outl);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,13 +279,13 @@ static int do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING
|
|||||||
* otherwise it is the number of bytes per character
|
* otherwise it is the number of bytes per character
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const static char tag2nbyte[] = {
|
const static signed char tag2nbyte[] = {
|
||||||
-1, -1, -1, -1, -1, /* 0-4 */
|
-1, -1, -1, -1, -1, /* 0-4 */
|
||||||
-1, -1, -1, -1, -1, /* 5-9 */
|
-1, -1, -1, -1, -1, /* 5-9 */
|
||||||
-1, -1, 0, -1, /* 10-13 */
|
-1, -1, 0, -1, /* 10-13 */
|
||||||
-1, -1, -1, -1, /* 15-17 */
|
-1, -1, -1, -1, /* 15-17 */
|
||||||
-1, 1, 1, /* 18-20 */
|
-1, 1, 1, /* 18-20 */
|
||||||
-1, 1, -1,-1, /* 21-24 */
|
-1, 1, 1, 1, /* 21-24 */
|
||||||
-1, 1, -1, /* 25-27 */
|
-1, 1, -1, /* 25-27 */
|
||||||
4, -1, 2 /* 28-30 */
|
4, -1, 2 /* 28-30 */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in,
|
|||||||
/* Now the tables and helper functions for the string table:
|
/* Now the tables and helper functions for the string table:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* size limits: this stuff is taken straight from RFC2459 */
|
/* size limits: this stuff is taken straight from RFC3280 */
|
||||||
|
|
||||||
#define ub_name 32768
|
#define ub_name 32768
|
||||||
#define ub_common_name 64
|
#define ub_common_name 64
|
||||||
@@ -153,6 +153,8 @@ ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in,
|
|||||||
#define ub_organization_unit_name 64
|
#define ub_organization_unit_name 64
|
||||||
#define ub_title 64
|
#define ub_title 64
|
||||||
#define ub_email_address 128
|
#define ub_email_address 128
|
||||||
|
#define ub_serial_number 64
|
||||||
|
|
||||||
|
|
||||||
/* This table must be kept in NID order */
|
/* This table must be kept in NID order */
|
||||||
|
|
||||||
@@ -170,9 +172,11 @@ static ASN1_STRING_TABLE tbl_standard[] = {
|
|||||||
{NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0},
|
{NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0},
|
||||||
{NID_surname, 1, ub_name, DIRSTRING_TYPE, 0},
|
{NID_surname, 1, ub_name, DIRSTRING_TYPE, 0},
|
||||||
{NID_initials, 1, ub_name, DIRSTRING_TYPE, 0},
|
{NID_initials, 1, ub_name, DIRSTRING_TYPE, 0},
|
||||||
|
{NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
|
||||||
{NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
|
{NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
|
||||||
{NID_name, 1, ub_name, DIRSTRING_TYPE, 0},
|
{NID_name, 1, ub_name, DIRSTRING_TYPE, 0},
|
||||||
{NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
|
{NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
|
||||||
|
{NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK},
|
||||||
{NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}
|
{NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -249,4 +253,38 @@ static void st_free(ASN1_STRING_TABLE *tbl)
|
|||||||
if(tbl->flags & STABLE_FLAGS_MALLOC) OPENSSL_free(tbl);
|
if(tbl->flags & STABLE_FLAGS_MALLOC) OPENSSL_free(tbl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IMPLEMENT_STACK_OF(ASN1_STRING_TABLE)
|
IMPLEMENT_STACK_OF(ASN1_STRING_TABLE)
|
||||||
|
|
||||||
|
#ifdef STRING_TABLE_TEST
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
ASN1_STRING_TABLE *tmp;
|
||||||
|
int i, last_nid = -1;
|
||||||
|
|
||||||
|
for (tmp = tbl_standard, i = 0;
|
||||||
|
i < sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE); i++, tmp++)
|
||||||
|
{
|
||||||
|
if (tmp->nid < last_nid)
|
||||||
|
{
|
||||||
|
last_nid = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
last_nid = tmp->nid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (last_nid != 0)
|
||||||
|
{
|
||||||
|
printf("Table order OK\n");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (tmp = tbl_standard, i = 0;
|
||||||
|
i < sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE); i++, tmp++)
|
||||||
|
printf("Index %d, NID %d, Name=%s\n", i, tmp->nid,
|
||||||
|
OBJ_nid2ln(tmp->nid));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user