Compare commits
1438 Commits
OpenSSL_0_
...
OpenSSL_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48acb9e08a | ||
|
|
e5706ccbde | ||
|
|
9a82ef5255 | ||
|
|
4a1dcb2d03 | ||
|
|
ef92312b41 | ||
|
|
4673461789 | ||
|
|
2f8275c52d | ||
|
|
39ebb51bba | ||
|
|
d7227da9a8 | ||
|
|
ab805194a6 | ||
|
|
4fac53a757 | ||
|
|
11198b78a2 | ||
|
|
573a568dd0 | ||
|
|
ff3dd00370 | ||
|
|
2028c2800a | ||
|
|
fd8766b67e | ||
|
|
7d210e5194 | ||
|
|
2e674fc611 | ||
|
|
5cfd3419c6 | ||
|
|
9efd4fb891 | ||
|
|
b2e85f9d93 | ||
|
|
f10581829d | ||
|
|
78af3b274f | ||
|
|
facd9a2024 | ||
|
|
461f00dd53 | ||
|
|
22f03eaedf | ||
|
|
d467c74954 | ||
|
|
c4c745ccb8 | ||
|
|
3b66e34e74 | ||
|
|
2250f475fc | ||
|
|
ed703912b2 | ||
|
|
2cddcd1dbb | ||
|
|
231360a3b7 | ||
|
|
65ac3faff6 | ||
|
|
778252741e | ||
|
|
96e40d97cc | ||
|
|
4b3743c85a | ||
|
|
5795665a7d | ||
|
|
88f1be140c | ||
|
|
fc16b228fd | ||
|
|
a5b2ccaaad | ||
|
|
5dd352c916 | ||
|
|
3c204aaf50 | ||
|
|
3ae184d31f | ||
|
|
3e975124f3 | ||
|
|
74c467f9f2 | ||
|
|
1b97c938e9 | ||
|
|
b3e2acac4e | ||
|
|
403fa0dc53 | ||
|
|
f918c330a9 | ||
|
|
7f52f77efe | ||
|
|
90b480f2af | ||
|
|
578c33c010 | ||
|
|
d6a821b9d7 | ||
|
|
7d8b5c530f | ||
|
|
2033da0b23 | ||
|
|
c4ac954c59 | ||
|
|
2640aec227 | ||
|
|
a1037ce3bc | ||
|
|
249737e53d | ||
|
|
c70573dee1 | ||
|
|
6c98ed520d | ||
|
|
37ceea7333 | ||
|
|
374b227226 | ||
|
|
8c4a5016ce | ||
|
|
1056275825 | ||
|
|
9634acedaf | ||
|
|
3a4b0bed49 | ||
|
|
84f4e33ea3 | ||
|
|
b093ef7445 | ||
|
|
405ac901c9 | ||
|
|
721ccb6cf5 | ||
|
|
ba05727773 | ||
|
|
f9332da521 | ||
|
|
156516ce44 | ||
|
|
157e44a799 | ||
|
|
7d2ff3f081 | ||
|
|
25a87e82d4 | ||
|
|
e400753ed8 | ||
|
|
0984fcf118 | ||
|
|
18cc99ac17 | ||
|
|
1522c23470 | ||
|
|
2341e303da | ||
|
|
dca142029c | ||
|
|
7448f5e5ed | ||
|
|
45caf9c50c | ||
|
|
ace2ca484b | ||
|
|
7dc584ed91 | ||
|
|
855f0b4f2f | ||
|
|
2bf30d6b47 | ||
|
|
685e7d7225 | ||
|
|
38dbcb2248 | ||
|
|
bb3a69f801 | ||
|
|
55db40d3e0 | ||
|
|
f1fbf15116 | ||
|
|
9bdbdda261 | ||
|
|
ad2057500a | ||
|
|
d0e3726ca4 | ||
|
|
75a46764e5 | ||
|
|
4eceda658b | ||
|
|
1c511bdb7c | ||
|
|
f9bd76e4f7 | ||
|
|
e74e0dedcd | ||
|
|
dcf6eb2a9e | ||
|
|
7d2980f09e | ||
|
|
f1fe6fa6e4 | ||
|
|
ecb7a9c73a | ||
|
|
aebe0396e9 | ||
|
|
4e9a77cf26 | ||
|
|
14ef32631c | ||
|
|
500f07c8de | ||
|
|
ae936dae90 | ||
|
|
67166dc05c | ||
|
|
aa9fed8cc2 | ||
|
|
442eb8a4c3 | ||
|
|
46805f696d | ||
|
|
29f6a99432 | ||
|
|
1f13793b1a | ||
|
|
08130eb158 | ||
|
|
b27dfeacc9 | ||
|
|
fb0f53b2e0 | ||
|
|
baa521bef5 | ||
|
|
7bcf65a125 | ||
|
|
306009bb6a | ||
|
|
dfc5336975 | ||
|
|
4cea95a547 | ||
|
|
b23b3272dc | ||
|
|
1696aa1891 | ||
|
|
52407725c9 | ||
|
|
81da3c3319 | ||
|
|
7729bc2634 | ||
|
|
69a305d434 | ||
|
|
ab5b1cf86b | ||
|
|
c33387749b | ||
|
|
c9ca65b469 | ||
|
|
8b2f9cdfad | ||
|
|
8e078f45e0 | ||
|
|
01682a8b3c | ||
|
|
8b07f23c30 | ||
|
|
45932ad508 | ||
|
|
ce94682ce1 | ||
|
|
2d7ab7e9ea | ||
|
|
f84ffd0130 | ||
|
|
6176df94ed | ||
|
|
a8f8788248 | ||
|
|
300e3d7c73 | ||
|
|
d5d007abe3 | ||
|
|
365c6e4661 | ||
|
|
151457ab16 | ||
|
|
1dc03ef706 | ||
|
|
dde3e83129 | ||
|
|
8f182fdc69 | ||
|
|
1064acafc4 | ||
|
|
d4a67e3186 | ||
|
|
ff8e412ceb | ||
|
|
e9cbcb1d98 | ||
|
|
18e10315e5 | ||
|
|
ea7fc0311c | ||
|
|
e9caaa4ad9 | ||
|
|
30911232c1 | ||
|
|
a6198b9ed1 | ||
|
|
2940a1298e | ||
|
|
a7be294ed7 | ||
|
|
617f461c9d | ||
|
|
f916052eab | ||
|
|
2fb3f002d0 | ||
|
|
1dcb6c994f | ||
|
|
a9ab63c01c | ||
|
|
82b0bf0b87 | ||
|
|
f89db4020f | ||
|
|
393c09659e | ||
|
|
3a7cef3e76 | ||
|
|
592c0e0273 | ||
|
|
08b977b5a5 | ||
|
|
2d96549cd0 | ||
|
|
b48892d403 | ||
|
|
85fb12d554 | ||
|
|
b975183c41 | ||
|
|
7b907f0bb5 | ||
|
|
083100e2ab | ||
|
|
9dfcad117c | ||
|
|
241d2ba1da | ||
|
|
e4fb49775b | ||
|
|
7018feed88 | ||
|
|
381a146dc6 | ||
|
|
9be529f12d | ||
|
|
b4a262832a | ||
|
|
f5e5277908 | ||
|
|
c991c6e710 | ||
|
|
6d498d478e | ||
|
|
e1f4319279 | ||
|
|
d0561b5c2d | ||
|
|
4f4b192402 | ||
|
|
2826fcc851 | ||
|
|
0ae1661ba2 | ||
|
|
4e9ef338fc | ||
|
|
d16e1131b4 | ||
|
|
37562f753a | ||
|
|
a18894d159 | ||
|
|
248252682c | ||
|
|
dfee50ecd9 | ||
|
|
cc3586028e | ||
|
|
10189984f9 | ||
|
|
f60df86c89 | ||
|
|
d8425465a3 | ||
|
|
bc7a3a9e99 | ||
|
|
1fc02dcf6a | ||
|
|
d3cbf7d86a | ||
|
|
313bf45e42 | ||
|
|
83d092f785 | ||
|
|
ce34d0ac09 | ||
|
|
4825092bbe | ||
|
|
4e9dd6b0f5 | ||
|
|
bbd79bdf03 | ||
|
|
b6ccbffe2b | ||
|
|
a096e9b719 | ||
|
|
ddab25a90d | ||
|
|
1aecc34e9e | ||
|
|
ffbe98b763 | ||
|
|
75b9c0044c | ||
|
|
d7a9bb0a2a | ||
|
|
0d81c69b8e | ||
|
|
600b77a93f | ||
|
|
401cd0af0f | ||
|
|
39335c356b | ||
|
|
c7b41e67f0 | ||
|
|
a3c62bb737 | ||
|
|
003144a8e8 | ||
|
|
af1cb47e65 | ||
|
|
e8e7fbdb16 | ||
|
|
2f6263a696 | ||
|
|
d5c21afd4b | ||
|
|
35748f40d6 | ||
|
|
1afa967909 | ||
|
|
ed62478192 | ||
|
|
9e7733a743 | ||
|
|
85b7b80434 | ||
|
|
fe0f662310 | ||
|
|
fc0bdd1aa8 | ||
|
|
90453438ff | ||
|
|
e9dad4048f | ||
|
|
2e63f3b733 | ||
|
|
125cc35b59 | ||
|
|
ddba94214f | ||
|
|
e9f970891d | ||
|
|
a89cf50c59 | ||
|
|
7e58aa7d71 | ||
|
|
f90c544039 | ||
|
|
be3d90de02 | ||
|
|
82652aaf17 | ||
|
|
afcf54a5c9 | ||
|
|
17d6bb8158 | ||
|
|
3671e38af4 | ||
|
|
11c26ecf81 | ||
|
|
99d5b23023 | ||
|
|
611ba3f4a1 | ||
|
|
4fc3946111 | ||
|
|
af28dd6c75 | ||
|
|
e79ec456be | ||
|
|
3e268d2717 | ||
|
|
59a941e4a4 | ||
|
|
a7cd5f3f38 | ||
|
|
c46acbacde | ||
|
|
304d90425f | ||
|
|
0bdbc5a86e | ||
|
|
bfaa8a89e1 | ||
|
|
abecef77cf | ||
|
|
de941e289e | ||
|
|
b74dfe6e8e | ||
|
|
1d28453529 | ||
|
|
d80f6e0f8c | ||
|
|
690ecff795 | ||
|
|
234c73767d | ||
|
|
13962f0b15 | ||
|
|
2fc1f3dd48 | ||
|
|
497810cae7 | ||
|
|
f2cbb15468 | ||
|
|
e38e8b29f8 | ||
|
|
cbc9d9713d | ||
|
|
c03ceadfbd | ||
|
|
98fa4fe8c5 | ||
|
|
e50baf58ab | ||
|
|
0b4c91c0fc | ||
|
|
b9b43196e1 | ||
|
|
1750ec5c52 | ||
|
|
bf6a9e66d6 | ||
|
|
c77bd28775 | ||
|
|
0c372b94f7 | ||
|
|
1619add90c | ||
|
|
a1a4e8b6bb | ||
|
|
26e1237380 | ||
|
|
25f350a058 | ||
|
|
4882171df5 | ||
|
|
121cb9ee38 | ||
|
|
931627e6a0 | ||
|
|
bc173b9fb0 | ||
|
|
274a2c9970 | ||
|
|
006fcc22a8 | ||
|
|
4fd9c70f06 | ||
|
|
709c51c424 | ||
|
|
9bc448546e | ||
|
|
91aeab0de3 | ||
|
|
0dc092334b | ||
|
|
c913cf446f | ||
|
|
36c194638e | ||
|
|
45fb737950 | ||
|
|
a01273bae3 | ||
|
|
a88f39457b | ||
|
|
2bbaab4a24 | ||
|
|
2c17323e15 | ||
|
|
870694b3da | ||
|
|
1a8f4b57a9 | ||
|
|
87a4b4d1f4 | ||
|
|
022b31a8c8 | ||
|
|
8ecf5104b3 | ||
|
|
2b3aeffbbd | ||
|
|
dd6b494eb3 | ||
|
|
2c2f9e2cc3 | ||
|
|
2d9b1b3ffa | ||
|
|
f070480275 | ||
|
|
49f1597de2 | ||
|
|
c9bea5bad3 | ||
|
|
b44e425f39 | ||
|
|
296324ea03 | ||
|
|
93683c3cf8 | ||
|
|
fa41e86a28 | ||
|
|
9e77b7075a | ||
|
|
a08ee55e2d | ||
|
|
5c7f9a627f | ||
|
|
3bac6d9479 | ||
|
|
bc3e3472c1 | ||
|
|
5c5143de48 | ||
|
|
c8cd7d9e0f | ||
|
|
66bd86e2c2 | ||
|
|
e0a6cdcf30 | ||
|
|
487fe20490 | ||
|
|
a0ecb9b8fc | ||
|
|
80d9b1ccd7 | ||
|
|
4bf4bc784f | ||
|
|
69c48301e0 | ||
|
|
2be9b88135 | ||
|
|
9437fef8cc | ||
|
|
16b0384bd2 | ||
|
|
98fa4fce09 | ||
|
|
1ec1d17e16 | ||
|
|
87ebdd8a71 | ||
|
|
1e11df0dc3 | ||
|
|
7d68189d8a | ||
|
|
421d474332 | ||
|
|
26414ee013 | ||
|
|
58060fa11b | ||
|
|
5c62f68e14 | ||
|
|
cea698f19c | ||
|
|
0d22b5dace | ||
|
|
48781ef7f7 | ||
|
|
023ec151df | ||
|
|
59dbdb51dc | ||
|
|
92d1bc09cb | ||
|
|
6d1a837df7 | ||
|
|
21f422ca5e | ||
|
|
d62bfb39cd | ||
|
|
291ae60b52 | ||
|
|
ce4b274aa1 | ||
|
|
3b79d2789d | ||
|
|
334f1842fc | ||
|
|
b12540520d | ||
|
|
bb9dcc99cf | ||
|
|
0d7b9b8b7e | ||
|
|
3d59821134 | ||
|
|
31188ee1a8 | ||
|
|
cae111287b | ||
|
|
e36e473859 | ||
|
|
4a3e6bce79 | ||
|
|
a3829cb720 | ||
|
|
d7fb66aa82 | ||
|
|
344b3b5ce1 | ||
|
|
3f7cf29124 | ||
|
|
63dc69fef6 | ||
|
|
e84be9b495 | ||
|
|
cfe1c195c4 | ||
|
|
3a3ca3f515 | ||
|
|
032c49b8b3 | ||
|
|
3208ff58ca | ||
|
|
6707d22a40 | ||
|
|
3647bee263 | ||
|
|
0cd8572b2d | ||
|
|
7c2831ac90 | ||
|
|
e2aebccba1 | ||
|
|
de603b75fc | ||
|
|
3e563bcea7 | ||
|
|
1244be2eda | ||
|
|
92f91ff48b | ||
|
|
9f0a373b51 | ||
|
|
b3dfaaa143 | ||
|
|
b0701709c1 | ||
|
|
5b7848a345 | ||
|
|
34aa216a65 | ||
|
|
915c6a21ba | ||
|
|
a76a29f233 | ||
|
|
4e06ab75e8 | ||
|
|
58706d595b | ||
|
|
236be53269 | ||
|
|
1fc1bd382b | ||
|
|
26147fb954 | ||
|
|
a60033f106 | ||
|
|
3613e6fc57 | ||
|
|
f8e21776f9 | ||
|
|
006723cf76 | ||
|
|
bd53a054b1 | ||
|
|
aa89bcd279 | ||
|
|
f19759a182 | ||
|
|
d009bcbfb6 | ||
|
|
211b8685d3 | ||
|
|
4b71f63ac0 | ||
|
|
3adb8c3854 | ||
|
|
02e666d59f | ||
|
|
5b2d6ff07e | ||
|
|
877b2fbd3c | ||
|
|
afeab58a3c | ||
|
|
744c49a81b | ||
|
|
9c75b2d931 | ||
|
|
54d11e6057 | ||
|
|
9c5b91fd0b | ||
|
|
290d3eab76 | ||
|
|
46dae77c23 | ||
|
|
3d7ba69a05 | ||
|
|
a6cd870784 | ||
|
|
58133d22a8 | ||
|
|
330e5c5460 | ||
|
|
97879bcd57 | ||
|
|
ab519c8262 | ||
|
|
ab1dee1efc | ||
|
|
e072aa535d | ||
|
|
48f9859d2a | ||
|
|
48b5083ca0 | ||
|
|
cd64618674 | ||
|
|
65f29a78b2 | ||
|
|
5d7e960adf | ||
|
|
c363b5a62f | ||
|
|
60ed0f94ed | ||
|
|
f38f8d94a9 | ||
|
|
679eb352e0 | ||
|
|
f0d6ee6be8 | ||
|
|
80bbb6578e | ||
|
|
19cc0f0ab4 | ||
|
|
14e14ea68c | ||
|
|
834d37ed86 | ||
|
|
adcc235ef6 | ||
|
|
86a0d0234d | ||
|
|
4598be561a | ||
|
|
af5db47e99 | ||
|
|
fb67f40f04 | ||
|
|
e65991f977 | ||
|
|
3e83e686ba | ||
|
|
48033c3242 | ||
|
|
8f06b00373 | ||
|
|
1dea1f4509 | ||
|
|
44411db8e0 | ||
|
|
23ac7a1407 | ||
|
|
dda640835f | ||
|
|
aa1f5b3581 | ||
|
|
6cc3700314 | ||
|
|
d9d3a69595 | ||
|
|
cc1489d2f2 | ||
|
|
016029c69f | ||
|
|
516b848286 | ||
|
|
f9adfa6d4e | ||
|
|
85b1fce1ef | ||
|
|
c4202285ef | ||
|
|
da566db150 | ||
|
|
be37dc73f6 | ||
|
|
49e045482a | ||
|
|
d8309efc72 | ||
|
|
f43acc8a50 | ||
|
|
976b2c9c2f | ||
|
|
b74d2cda28 | ||
|
|
ba47f5c9b0 | ||
|
|
cc5dd9f14e | ||
|
|
4d94ae00d5 | ||
|
|
60d8bae30d | ||
|
|
0caec9e8f8 | ||
|
|
4f85a2e21e | ||
|
|
945e15a253 | ||
|
|
fbfcdc4cef | ||
|
|
1fe198b6f9 | ||
|
|
78d6603aad | ||
|
|
7241ae1a0a | ||
|
|
5f58d6a5e0 | ||
|
|
acfe628b6e | ||
|
|
182d8435f0 | ||
|
|
4de920c91d | ||
|
|
3cd039dd8f | ||
|
|
81269a81ee | ||
|
|
3537525e00 | ||
|
|
d38f3ad1ee | ||
|
|
e083f91497 | ||
|
|
ba2cad19cf | ||
|
|
db0a1efcc9 | ||
|
|
9074521458 | ||
|
|
f924200e1b | ||
|
|
de2f6e4dae | ||
|
|
44bdb056d4 | ||
|
|
c31bbf1e68 | ||
|
|
5e68f8ce15 | ||
|
|
b9a3ef4c6e | ||
|
|
1955b87423 | ||
|
|
866eedb936 | ||
|
|
f701551f36 | ||
|
|
adc4df3616 | ||
|
|
1199e2d8cf | ||
|
|
0f180d1d1d | ||
|
|
072569e0f1 | ||
|
|
ba9786e4b8 | ||
|
|
613599ffff | ||
|
|
c9c21d3b89 | ||
|
|
d0d046eca2 | ||
|
|
2a81428489 | ||
|
|
7073e9e2a0 | ||
|
|
d866df33a1 | ||
|
|
b77fcddb6b | ||
|
|
f6fbd470e3 | ||
|
|
63810d8566 | ||
|
|
123c401967 | ||
|
|
a3fffd648b | ||
|
|
2d57b73a50 | ||
|
|
f14845d999 | ||
|
|
80bb905d3d | ||
|
|
a297985f42 | ||
|
|
404dcc5e8e | ||
|
|
8242a6a9fc | ||
|
|
17bcb8d465 | ||
|
|
72165799a8 | ||
|
|
f1c2a9de45 | ||
|
|
52b66a622d | ||
|
|
273db408a8 | ||
|
|
957b6db3b1 | ||
|
|
a14e2d9dfe | ||
|
|
a8b94d6409 | ||
|
|
fe19c448f0 | ||
|
|
fcf6473199 | ||
|
|
1285221370 | ||
|
|
5dcf517d84 | ||
|
|
9b2f486c9e | ||
|
|
24995f3a10 | ||
|
|
0fc5cf0870 | ||
|
|
f78d4a35f8 | ||
|
|
df5eaa8a52 | ||
|
|
6ce46d69f5 | ||
|
|
575e664a7c | ||
|
|
7389c848d4 | ||
|
|
4d393410f3 | ||
|
|
bd69750360 | ||
|
|
c9501c223f | ||
|
|
9dd5ae6553 | ||
|
|
e1e876072d | ||
|
|
dd2589494f | ||
|
|
1cfa8a397f | ||
|
|
bdae099862 | ||
|
|
cca28b291c | ||
|
|
062d3e39e7 | ||
|
|
e29f478a7a | ||
|
|
1b58b616e3 | ||
|
|
c70d381775 | ||
|
|
508d8b1617 | ||
|
|
8c74b5e56c | ||
|
|
c59ba5b528 | ||
|
|
45d87a1ffe | ||
|
|
a3feb21bbe | ||
|
|
37530362fa | ||
|
|
fd69886aed | ||
|
|
fd795679bb | ||
|
|
e523f5f389 | ||
|
|
e4dd79bbc8 | ||
|
|
bc37d996fc | ||
|
|
31cafe53c9 | ||
|
|
dc4ddcd2bb | ||
|
|
5256b021f3 | ||
|
|
1bb68d62ab | ||
|
|
4ab1e7ceaf | ||
|
|
06623ff028 | ||
|
|
67d48c8cc8 | ||
|
|
d59fb0dd2f | ||
|
|
245f44e2ab | ||
|
|
e5d6528a12 | ||
|
|
980afccf98 | ||
|
|
9bd2cd745f | ||
|
|
015fbde807 | ||
|
|
ba1b888384 | ||
|
|
6f9079fd50 | ||
|
|
c938563a81 | ||
|
|
40928698bb | ||
|
|
138d8ab0c7 | ||
|
|
47cc5525a2 | ||
|
|
67fec850e1 | ||
|
|
82db6e1646 | ||
|
|
e7227322b3 | ||
|
|
a5595fde9a | ||
|
|
95f8c7195c | ||
|
|
dcbbf83dba | ||
|
|
3c89d78dba | ||
|
|
84fcd6f83e | ||
|
|
a92ae07091 | ||
|
|
68809d3969 | ||
|
|
d6a89fcf88 | ||
|
|
ef5f6a08ff | ||
|
|
7c517a04b1 | ||
|
|
d78e52987e | ||
|
|
755cc53a6e | ||
|
|
1226c472b7 | ||
|
|
4d7072f4b5 | ||
|
|
b5348a095d | ||
|
|
66df02fd98 | ||
|
|
206eb6a11d | ||
|
|
f11fd3f4e1 | ||
|
|
29b108f939 | ||
|
|
31106cc750 | ||
|
|
ff3fa48fc7 | ||
|
|
87166e1fb6 | ||
|
|
f3e24baddf | ||
|
|
a6977ee73d | ||
|
|
d4704d5245 | ||
|
|
8f0edcb3d2 | ||
|
|
35e25255e0 | ||
|
|
c3fbf5d9a8 | ||
|
|
55e42c93a8 | ||
|
|
6a0dec9584 | ||
|
|
21a85f1977 | ||
|
|
322de0c8c1 | ||
|
|
6a9af68b56 | ||
|
|
b6e4dac217 | ||
|
|
8a0a9392ab | ||
|
|
bcbe4e5254 | ||
|
|
47ff5c6279 | ||
|
|
898f856c44 | ||
|
|
883b0c2274 | ||
|
|
4f94d1a8b1 | ||
|
|
1d4581c2dd | ||
|
|
c05940edc7 | ||
|
|
c507a16e49 | ||
|
|
308f028e28 | ||
|
|
e4a6cf421a | ||
|
|
329636d6e3 | ||
|
|
9163b8fb23 | ||
|
|
a542db90c6 | ||
|
|
a7ce69dbd7 | ||
|
|
9d93ce246c | ||
|
|
76c4336c43 | ||
|
|
e71adb85c5 | ||
|
|
033c51f0a3 | ||
|
|
452d1595a6 | ||
|
|
0d197a833c | ||
|
|
e0031b80ee | ||
|
|
b19941ab05 | ||
|
|
752938daab | ||
|
|
c78515f55e | ||
|
|
3ba1f11147 | ||
|
|
bbc206fdf7 | ||
|
|
2bd065dfbe | ||
|
|
6d7dbc12f2 | ||
|
|
83c40e7fc0 | ||
|
|
b5fe234588 | ||
|
|
e1a00d7d1d | ||
|
|
acf60ef707 | ||
|
|
c85a157854 | ||
|
|
0c5d16e4f5 | ||
|
|
bd2af5e707 | ||
|
|
58d55afa6f | ||
|
|
6343e2fac3 | ||
|
|
b476df64a1 | ||
|
|
1d46b6b3b9 | ||
|
|
bbb35447c4 | ||
|
|
6276f1e100 | ||
|
|
5b8a57ecae | ||
|
|
817dfc18a3 | ||
|
|
0b0b2a8087 | ||
|
|
c23d16ac19 | ||
|
|
1b28ed575b | ||
|
|
135c0af1bb | ||
|
|
475918410b | ||
|
|
3102792161 | ||
|
|
a291182757 | ||
|
|
b26ca3408c | ||
|
|
83978bd37a | ||
|
|
a3790c0d01 | ||
|
|
63b6090f7c | ||
|
|
c5571db0c2 | ||
|
|
e0457d5f7c | ||
|
|
ae52ec9869 | ||
|
|
0b33bc6b72 | ||
|
|
7aa983c6db | ||
|
|
2b90b1f344 | ||
|
|
65123f8064 | ||
|
|
1d8634b110 | ||
|
|
29e0c30c2a | ||
|
|
cf82191d77 | ||
|
|
3a8a0a3945 | ||
|
|
c5d4ab7e35 | ||
|
|
b955dbd325 | ||
|
|
45582d1e2b | ||
|
|
60c50cbf9c | ||
|
|
3a3619b46a | ||
|
|
b83eddc578 | ||
|
|
7f558334ad | ||
|
|
6229a5607c | ||
|
|
6acc3b9689 | ||
|
|
66aa856698 | ||
|
|
f559f31bef | ||
|
|
3210b4fd14 | ||
|
|
a7b42009c4 | ||
|
|
7b5ffd6834 | ||
|
|
9b55da73ca | ||
|
|
e7156ff2e8 | ||
|
|
437db75b94 | ||
|
|
1586365835 | ||
|
|
7d5b04db4e | ||
|
|
48b0cf8b10 | ||
|
|
b693f941fd | ||
|
|
c602e7f4e8 | ||
|
|
1fc6d41bf6 | ||
|
|
a41477f92e | ||
|
|
5f68c5feef | ||
|
|
ee84a5a7fb | ||
|
|
66d3e7481e | ||
|
|
0e21156333 | ||
|
|
f533b7780e | ||
|
|
cc2f5a8022 | ||
|
|
b441bf9226 | ||
|
|
2a9aca32dc | ||
|
|
89da653fa6 | ||
|
|
af50b58c3f | ||
|
|
4d635a7001 | ||
|
|
ce15d5a9dc | ||
|
|
ba1c602281 | ||
|
|
cfc781be6e | ||
|
|
84acc3c2bc | ||
|
|
c2e4f17c1a | ||
|
|
979689aa5c | ||
|
|
a3faebd104 | ||
|
|
025c7737b2 | ||
|
|
513d4b4c16 | ||
|
|
7ef701519b | ||
|
|
50d194af4d | ||
|
|
287973746e | ||
|
|
f1558bb424 | ||
|
|
6ca487992b | ||
|
|
cf3a5cebd7 | ||
|
|
a661b65357 | ||
|
|
98e6654938 | ||
|
|
cecd263878 | ||
|
|
31fe950d2b | ||
|
|
db6a87d8cc | ||
|
|
7beb408771 | ||
|
|
51008ffce1 | ||
|
|
3811eed8d5 | ||
|
|
581f1c8494 | ||
|
|
41ebed27fa | ||
|
|
bf21446a2a | ||
|
|
e72d734d5f | ||
|
|
20d2186c87 | ||
|
|
9ba3ec9176 | ||
|
|
8f71fb8d98 | ||
|
|
48948d53b6 | ||
|
|
dbec19622e | ||
|
|
2ce15df528 | ||
|
|
681bfae499 | ||
|
|
5dd955dcd2 | ||
|
|
56fa8e69cf | ||
|
|
67d0738aba | ||
|
|
b8a61e7362 | ||
|
|
dd5e774664 | ||
|
|
6b86bad5ef | ||
|
|
712557128b | ||
|
|
3009e9f9ef | ||
|
|
b30245dae0 | ||
|
|
116daf4c2f | ||
|
|
cb40bdaf57 | ||
|
|
4b12506891 | ||
|
|
cf98440178 | ||
|
|
c500d44735 | ||
|
|
18eda73234 | ||
|
|
7526e2c043 | ||
|
|
6d52f260bf | ||
|
|
752f2b6785 | ||
|
|
e1c279b63d | ||
|
|
467889703a | ||
|
|
3a457cca86 | ||
|
|
285046ec51 | ||
|
|
f8000b9345 | ||
|
|
77a8eb352f | ||
|
|
114697bef3 | ||
|
|
2aa9043ad3 | ||
|
|
1a095560f7 | ||
|
|
f329b8d73b | ||
|
|
3d90a32429 | ||
|
|
e3a7463c5d | ||
|
|
796c6eadcb | ||
|
|
b485e5b7e3 | ||
|
|
d1cc7b8f22 | ||
|
|
1cf9d58cb4 | ||
|
|
0cff933416 | ||
|
|
c41b29e5db | ||
|
|
65fb3fa630 | ||
|
|
0b0f08dbc7 | ||
|
|
5c32657c80 | ||
|
|
07cee70258 | ||
|
|
4ba163cbf9 | ||
|
|
2bfb2398e3 | ||
|
|
a4a8f7b3ef | ||
|
|
34c66925aa | ||
|
|
cb7fd76f57 | ||
|
|
de822715b2 | ||
|
|
89f534e1d3 | ||
|
|
d46c1a8126 | ||
|
|
e32587d5a6 | ||
|
|
7876e4488f | ||
|
|
1a19f83d4c | ||
|
|
db8c838c6a | ||
|
|
37da54b10e | ||
|
|
0fea7ed4a4 | ||
|
|
dbeac560aa | ||
|
|
89eeccacde | ||
|
|
c9fc143972 | ||
|
|
004aa803a9 | ||
|
|
c921a5e1d4 | ||
|
|
0b4b9a11f5 | ||
|
|
d7e0299792 | ||
|
|
9dfdf0ad1d | ||
|
|
3b04cdd706 | ||
|
|
11a57c7be5 | ||
|
|
b370230b78 | ||
|
|
50a381b789 | ||
|
|
534aaf3731 | ||
|
|
6dc5d570d0 | ||
|
|
cb78486d97 | ||
|
|
9c9aa4f145 | ||
|
|
b6d1e52d45 | ||
|
|
f185e725a0 | ||
|
|
591ccf586d | ||
|
|
b7061c61b0 | ||
|
|
8a428200a6 | ||
|
|
10b2328fea | ||
|
|
98c2a26ea6 | ||
|
|
965b6dad44 | ||
|
|
a3d8c0fc5d | ||
|
|
a32d795aae | ||
|
|
ef3dc028ef | ||
|
|
2413a3975f | ||
|
|
3b0b5abae3 | ||
|
|
b49124f6d9 | ||
|
|
2260ad21fb | ||
|
|
6b0e9facf4 | ||
|
|
c404ff7955 | ||
|
|
8e2f6b79ea | ||
|
|
ee60d9fb28 | ||
|
|
be6d77005f | ||
|
|
b263b66746 | ||
|
|
5294dd705d | ||
|
|
2b67158673 | ||
|
|
db744f8950 | ||
|
|
e059b19ddb | ||
|
|
997a54c981 | ||
|
|
b78e502104 | ||
|
|
b6d0054a52 | ||
|
|
117df10db4 | ||
|
|
d300bcca7f | ||
|
|
d59c3e5046 | ||
|
|
6d8566f2eb | ||
|
|
4e1b0d8904 | ||
|
|
8ce2912fbc | ||
|
|
1372965e2e | ||
|
|
1a1422643b | ||
|
|
409960491d | ||
|
|
96bd6f730a | ||
|
|
c0f5dd070b | ||
|
|
9d7a8d3578 | ||
|
|
4dec4f646d | ||
|
|
2cb924b052 | ||
|
|
51ac0cfe44 | ||
|
|
16e819e1d8 | ||
|
|
1023cfe70d | ||
|
|
8e0a2d8461 | ||
|
|
e13ae96d7c | ||
|
|
9f29ec4721 | ||
|
|
b9a20b5057 | ||
|
|
c2222c2ea2 | ||
|
|
336da5642d | ||
|
|
8573fa1806 | ||
|
|
a52c2fb296 | ||
|
|
41450b27f2 | ||
|
|
e72d5983f2 | ||
|
|
5a85385387 | ||
|
|
5e54b4f364 | ||
|
|
5ba372b17c | ||
|
|
f9b0f47c0c | ||
|
|
4deeadf7dc | ||
|
|
384eff877c | ||
|
|
68dbba9817 | ||
|
|
ea7150b070 | ||
|
|
cb42ce0b67 | ||
|
|
e8330cf5ac | ||
|
|
7d34470458 | ||
|
|
f1047cebea | ||
|
|
da8a2e6f90 | ||
|
|
546ec5a9b3 | ||
|
|
e3fefbfd56 | ||
|
|
3b80e3aa9e | ||
|
|
14cfde9c83 | ||
|
|
9cabef963c | ||
|
|
ce9eab79a7 | ||
|
|
e9e202cfa8 | ||
|
|
d83ae69455 | ||
|
|
bb4f7a8d52 | ||
|
|
619b2c03dc | ||
|
|
aa4c2de10e | ||
|
|
6c36f7a9f2 | ||
|
|
78f7923580 | ||
|
|
978ebf0141 | ||
|
|
a9ed4da8eb | ||
|
|
e1a4814cd4 | ||
|
|
3cad81f6fe | ||
|
|
4450107afb | ||
|
|
908efd3b73 | ||
|
|
1a7691c059 | ||
|
|
f524ddbe04 | ||
|
|
541814c403 | ||
|
|
5013540224 | ||
|
|
94cb5ee63c | ||
|
|
fc9c61bc3b | ||
|
|
e815d3015e | ||
|
|
dc2a33d680 | ||
|
|
7ba45bf133 | ||
|
|
d98a4b7366 | ||
|
|
889a54c467 | ||
|
|
9d07fd03e3 | ||
|
|
a8a1878256 | ||
|
|
5b46eee0f5 | ||
|
|
e5e6a94fbf | ||
|
|
d9ff889073 | ||
|
|
e4decc418a | ||
|
|
cf5bfbfc21 | ||
|
|
567fef894e | ||
|
|
6ee2a1365e | ||
|
|
435037d4e4 | ||
|
|
c5de8996cc | ||
|
|
2dc5383a20 | ||
|
|
9391f97715 | ||
|
|
5b16639538 | ||
|
|
1738bb61e1 | ||
|
|
91b3f0e691 | ||
|
|
6ac4e8bd6e | ||
|
|
983495c4b2 | ||
|
|
931a23a5a5 | ||
|
|
72849dce81 | ||
|
|
2618893114 | ||
|
|
36026dfc01 | ||
|
|
79aa04ef27 | ||
|
|
3a0799977b | ||
|
|
e19ea55783 | ||
|
|
8716dbea40 | ||
|
|
e9bc66c84f | ||
|
|
c078798c60 | ||
|
|
de73cca923 | ||
|
|
b1051789d6 | ||
|
|
4db73c1bb8 | ||
|
|
3ae34e3a8c | ||
|
|
1f3b65801b | ||
|
|
5e2c4e23f4 | ||
|
|
35780c2139 | ||
|
|
ceff5fec5a | ||
|
|
4897dc4056 | ||
|
|
35e33f0e52 | ||
|
|
a844e27baa | ||
|
|
0783bf151c | ||
|
|
566bdf2bda | ||
|
|
eb6dc02b23 | ||
|
|
78435364ec | ||
|
|
5cbc2e8bc1 | ||
|
|
e7cf7fcd21 | ||
|
|
bb8aab0211 | ||
|
|
0fbf5f7102 | ||
|
|
f1b2807478 | ||
|
|
faacb092f8 | ||
|
|
b439a74620 | ||
|
|
3132ab8ce6 | ||
|
|
bfd7bb3eb6 | ||
|
|
11c8f0b79d | ||
|
|
c4068186ac | ||
|
|
0a93a68020 | ||
|
|
f2ab7d1392 | ||
|
|
c41ab9ade5 | ||
|
|
141e584998 | ||
|
|
336736ef35 | ||
|
|
df7cb13525 | ||
|
|
d93eb21c7c | ||
|
|
a403188f92 | ||
|
|
82b2230527 | ||
|
|
a8a004987c | ||
|
|
0e36019977 | ||
|
|
354c3ace73 | ||
|
|
52129c0b0b | ||
|
|
a52877a2f1 | ||
|
|
cdd7c3ce92 | ||
|
|
c1497b4d19 | ||
|
|
b2ed462934 | ||
|
|
bb766a0ad6 | ||
|
|
b65f851318 | ||
|
|
35bf35411c | ||
|
|
54fbc77dc8 | ||
|
|
9e09eebf94 | ||
|
|
45a2f93906 | ||
|
|
6982c0da4e | ||
|
|
b7727ee616 | ||
|
|
f0446ca8d7 | ||
|
|
6bc847e49e | ||
|
|
3f1c4e49a3 | ||
|
|
37a7cd1a11 | ||
|
|
3a2d9c4dd0 | ||
|
|
e51d1321fc | ||
|
|
b9fdb3eb99 | ||
|
|
d66ace9da5 | ||
|
|
db75357110 | ||
|
|
0713f8abe6 | ||
|
|
93d9121a77 | ||
|
|
92dad6cc84 | ||
|
|
61454a9f8c | ||
|
|
bb2297a41d | ||
|
|
75e98d0563 | ||
|
|
e9eb000c53 | ||
|
|
1ba01caaa3 | ||
|
|
5cd6571fae | ||
|
|
6383bbe525 | ||
|
|
06da6e4977 | ||
|
|
b72faddc47 | ||
|
|
d92f0bb6e9 | ||
|
|
710e5d5639 | ||
|
|
6da980e2b5 | ||
|
|
37f599bcec | ||
|
|
8408f4fbc7 | ||
|
|
534164ef90 | ||
|
|
e32c852e1e | ||
|
|
dbfc0f8c2b | ||
|
|
3728974460 | ||
|
|
fdc2bbcacb | ||
|
|
c2a3358b60 | ||
|
|
882e891284 | ||
|
|
05bbf78afd | ||
|
|
99ecb90a99 | ||
|
|
dbad169019 | ||
|
|
3ba5d1cf2e | ||
|
|
be2e2c3297 | ||
|
|
ed0015284b | ||
|
|
6d03b73e35 | ||
|
|
622d3d3592 | ||
|
|
0e06354402 | ||
|
|
62c271610b | ||
|
|
db089ad60d | ||
|
|
1f0c9ad7e1 | ||
|
|
06efc222f9 | ||
|
|
de3333bae4 | ||
|
|
924875e53b | ||
|
|
3a64458217 | ||
|
|
ea71c22731 | ||
|
|
dc706cd35f | ||
|
|
1241126adf | ||
|
|
19da130053 | ||
|
|
a75b191502 | ||
|
|
e5cb260365 | ||
|
|
6aecef815c | ||
|
|
daba492c3a | ||
|
|
24cff6ced5 | ||
|
|
ac7b42610f | ||
|
|
7abe76e1bd | ||
|
|
7bc03ded12 | ||
|
|
ea3b8af50a | ||
|
|
badb910f3c | ||
|
|
3866752e7e | ||
|
|
3e3dac9f97 | ||
|
|
397ba0f08a | ||
|
|
07ad8f5d17 | ||
|
|
47c3448a97 | ||
|
|
4db48ec0bd | ||
|
|
c518ade1fd | ||
|
|
acdf4afb91 | ||
|
|
6d3dec92fb | ||
|
|
2d3b6a5be7 | ||
|
|
81d1998e09 | ||
|
|
6b46ca135a | ||
|
|
fa293e4e4b | ||
|
|
24cbf3efc6 | ||
|
|
534a1ed0cb | ||
|
|
ee306a1332 | ||
|
|
45442167b0 | ||
|
|
131645ecce | ||
|
|
f1ca5f5b89 | ||
|
|
e452de9d87 | ||
|
|
a0256f462a | ||
|
|
82d5d46c14 | ||
|
|
0665dd6852 | ||
|
|
98fc09b18a | ||
|
|
192ebef8cf | ||
|
|
b01ab14338 | ||
|
|
2a96235bf7 | ||
|
|
1cf9bf00f4 | ||
|
|
a5224c3420 | ||
|
|
af436bc158 | ||
|
|
ab603c6987 | ||
|
|
9c11a0e541 | ||
|
|
8de83bf876 | ||
|
|
679df234b7 | ||
|
|
26eaab0990 | ||
|
|
7be96d7c9f | ||
|
|
d11493934c | ||
|
|
c62da732a4 | ||
|
|
a1a63a4239 | ||
|
|
103a434386 | ||
|
|
567671e291 | ||
|
|
d8a750ee7f | ||
|
|
9c10b2c8d3 | ||
|
|
56a106115f | ||
|
|
e9ad0d2c31 | ||
|
|
97639f0d73 | ||
|
|
e3a4f8b84c | ||
|
|
7e99812432 | ||
|
|
2a1ef75435 | ||
|
|
c148d70978 | ||
|
|
7b6055d1af | ||
|
|
f31b12503e | ||
|
|
f82197ad75 | ||
|
|
3f37e73bae | ||
|
|
0774f470d9 | ||
|
|
d7a9e91688 | ||
|
|
601cb9be20 | ||
|
|
f3229ee19a | ||
|
|
219a3580b7 | ||
|
|
d63c6bd397 | ||
|
|
fdb61e583a | ||
|
|
b8e2f83ae6 | ||
|
|
93dbd83570 | ||
|
|
5be022712a | ||
|
|
43f9391bcc | ||
|
|
c1c971654b | ||
|
|
72b1072fbd | ||
|
|
3bfd99bfbb | ||
|
|
a169e82065 | ||
|
|
c80410c50c | ||
|
|
dc01b6b1f2 | ||
|
|
b7a26e6daf | ||
|
|
ce16450a89 | ||
|
|
9d2e51c199 | ||
|
|
1e325f6149 | ||
|
|
c458a33196 | ||
|
|
7953b8ff1b | ||
|
|
b1460627f3 | ||
|
|
5abc8ae6f9 | ||
|
|
6a184a6098 | ||
|
|
3d5e97f560 | ||
|
|
54c7559a7e | ||
|
|
0c9de428ae | ||
|
|
f13def508c | ||
|
|
1ae6ddac91 | ||
|
|
55dcfa421c | ||
|
|
c04f8cf44a | ||
|
|
870d986131 | ||
|
|
4f272c17f5 | ||
|
|
fd3e027faa | ||
|
|
235dd0a22a | ||
|
|
b589977b9e | ||
|
|
291e4a6ebe | ||
|
|
2d2ed9dffd | ||
|
|
8ada6e7705 | ||
|
|
7f657f342a | ||
|
|
20e8f0ee27 | ||
|
|
429266b7e4 | ||
|
|
2c7bc88d78 | ||
|
|
54f7ebe789 | ||
|
|
dd499e74de | ||
|
|
19a6e8b32c | ||
|
|
ed5538dc2b | ||
|
|
b8ffcf49ed | ||
|
|
eb929eef14 | ||
|
|
2cd3ad9bdd | ||
|
|
323f289c48 | ||
|
|
a45e4a5537 | ||
|
|
b7fe2f9675 | ||
|
|
6dcd1c9109 | ||
|
|
2fe5adc36c | ||
|
|
839590f576 | ||
|
|
e0a8d1f94e | ||
|
|
9ad0f6812f | ||
|
|
a3376fe8fc | ||
|
|
3cc1f498a1 | ||
|
|
c6c0035ea5 | ||
|
|
531d630b5c | ||
|
|
853b1eb424 | ||
|
|
09a2615fb2 | ||
|
|
285b42756a | ||
|
|
508f15cdab | ||
|
|
52c0d30078 | ||
|
|
10997ee8ab | ||
|
|
8a774dc9a6 | ||
|
|
200bc9e3e8 | ||
|
|
7dd0ee0495 | ||
|
|
76569fc662 | ||
|
|
f2a253e0dd | ||
|
|
0ad0eaf61c | ||
|
|
47b0f48dd9 | ||
|
|
44e48abc44 | ||
|
|
f420de027f | ||
|
|
ecf186065c | ||
|
|
20e021bf41 | ||
|
|
8ca2ae775d | ||
|
|
ee8aa8217a | ||
|
|
2b49dd1e8f | ||
|
|
30a54b9085 | ||
|
|
1e7e62f8cd | ||
|
|
5352823fbf | ||
|
|
20251f01ea | ||
|
|
528f6b81db | ||
|
|
27bfba299e | ||
|
|
1690863acc | ||
|
|
397211323c | ||
|
|
a87f50fb5a | ||
|
|
31bc51c8cf | ||
|
|
be487c429e | ||
|
|
80340f1fe9 | ||
|
|
d918f85146 | ||
|
|
a95541d61e | ||
|
|
30b4c2724e | ||
|
|
2adc929367 | ||
|
|
7e97837274 | ||
|
|
4cb73bf8e4 | ||
|
|
79bb8d0077 | ||
|
|
6c1a3e4f58 | ||
|
|
76c919c1a3 | ||
|
|
98405f240b | ||
|
|
181355616e | ||
|
|
b49a5b2dc0 | ||
|
|
713f226114 | ||
|
|
d57d85ff35 | ||
|
|
74daa124c2 | ||
|
|
b8e35bd66e | ||
|
|
e8734731d3 | ||
|
|
9e0fcabeca | ||
|
|
6482dec1bb | ||
|
|
81b5eeed6a | ||
|
|
365359dd79 | ||
|
|
2757be06de | ||
|
|
d0afe49d3e | ||
|
|
81b31b7087 | ||
|
|
2643b122fc | ||
|
|
88db657ac2 | ||
|
|
1f0af2c073 | ||
|
|
2ed2d1515e | ||
|
|
bb5b16a36c | ||
|
|
5892855c5f | ||
|
|
a6e859e9ec | ||
|
|
99c65cef0f | ||
|
|
496da8b918 | ||
|
|
739862384c | ||
|
|
0a647c2b8b | ||
|
|
429e4f0de8 | ||
|
|
2d10c7156c | ||
|
|
299053becd | ||
|
|
1449bda052 | ||
|
|
56bb1a7c83 | ||
|
|
96aaf806d8 | ||
|
|
d70e5100c0 | ||
|
|
4831e626aa | ||
|
|
33ab4699ba | ||
|
|
595cc5b4b8 | ||
|
|
29fb08c2de | ||
|
|
7babdf2029 | ||
|
|
4b3270f78e | ||
|
|
3351b8d007 | ||
|
|
4b49bf6a93 | ||
|
|
926a56bfe3 | ||
|
|
d6f188be71 | ||
|
|
016cadfb54 | ||
|
|
bdee69f718 | ||
|
|
ff43e2e155 | ||
|
|
f53948856e | ||
|
|
14056ee2ee | ||
|
|
b545dc6775 | ||
|
|
027902999e | ||
|
|
9a310a5d4e | ||
|
|
a63d5eaab2 | ||
|
|
6af59bc095 | ||
|
|
24cc290b85 | ||
|
|
8e264a933f | ||
|
|
f0b54fefe9 | ||
|
|
cf2d9e09b3 | ||
|
|
d02408ad8a | ||
|
|
7ae551fd03 | ||
|
|
c2e45f6ddf | ||
|
|
f9a4ad4fa6 | ||
|
|
10645a4f13 | ||
|
|
06cb0353e5 | ||
|
|
b41f836e5f | ||
|
|
26a81abffc | ||
|
|
ab03b0df4c | ||
|
|
e5a77633cf | ||
|
|
6f8a82c7af | ||
|
|
7a7f47ea80 | ||
|
|
0ce5f3e4f5 | ||
|
|
21023745e2 | ||
|
|
a679116f6f | ||
|
|
3988bb34aa | ||
|
|
9e78e6c3f8 | ||
|
|
3caff6092a | ||
|
|
0d96bf8950 | ||
|
|
91dc71f98d | ||
|
|
b7b6c047ca | ||
|
|
0ea659475c | ||
|
|
1e20bb0648 | ||
|
|
c962479bdf | ||
|
|
b31ccc362c | ||
|
|
0cd5866726 | ||
|
|
2a8a10eda6 | ||
|
|
f11bc84080 | ||
|
|
e2f3ae1252 | ||
|
|
40fcda292f | ||
|
|
59bc3126c5 | ||
|
|
4d6115a5cc | ||
|
|
3a25b96caf | ||
|
|
6e6d04e29a | ||
|
|
48ff225300 | ||
|
|
a4a9d97a3e | ||
|
|
404f952aa3 | ||
|
|
dcd87618ab | ||
|
|
d54bf14559 | ||
|
|
ea3a429efe | ||
|
|
e3f1223fe4 | ||
|
|
7ef6e3fe2f | ||
|
|
197322455d | ||
|
|
4f19a0672b | ||
|
|
854e076df8 | ||
|
|
cb2a0e1319 | ||
|
|
638b0d4277 | ||
|
|
f2346808de | ||
|
|
d7818facb9 | ||
|
|
bcf95a2183 | ||
|
|
f7181a9179 | ||
|
|
9237ba8b66 | ||
|
|
95874603b0 | ||
|
|
ed2e24d564 | ||
|
|
c9fd77e9dd | ||
|
|
a9d2bc4902 | ||
|
|
c3bdbcf639 | ||
|
|
d9a770e6ea | ||
|
|
35feed50f0 | ||
|
|
a116afa42e | ||
|
|
b4542fb307 | ||
|
|
1f224bf029 | ||
|
|
4d231b4359 | ||
|
|
ac0f1d0b14 | ||
|
|
124d8cf701 | ||
|
|
7d0d0996aa | ||
|
|
9cddbf14db | ||
|
|
5f1fddbbe7 | ||
|
|
027e257b1d | ||
|
|
93f117003e | ||
|
|
42748c084e | ||
|
|
77dd9c1850 | ||
|
|
83d968df60 | ||
|
|
4ac881ede3 | ||
|
|
ccd2cd3e64 | ||
|
|
6186ef9338 | ||
|
|
6bcac6e578 | ||
|
|
967d95f096 | ||
|
|
26c7750827 | ||
|
|
5a16d270ab | ||
|
|
3a465d5ec9 | ||
|
|
413a4a0461 | ||
|
|
a95d2c5133 | ||
|
|
1876cc32ae | ||
|
|
4e2a08ddd4 | ||
|
|
61e2c34a10 | ||
|
|
e56b54a376 | ||
|
|
0da945bb20 | ||
|
|
69443d0da0 | ||
|
|
e4dc18d7e5 | ||
|
|
3f86a2b147 | ||
|
|
fd664b9fc6 | ||
|
|
722ca2781c | ||
|
|
1c72eebf89 | ||
|
|
69ce8bb952 | ||
|
|
50b8ba0201 | ||
|
|
c9fd9152bd | ||
|
|
f891abccf2 | ||
|
|
e2effdbc6b | ||
|
|
b10ae320f7 | ||
|
|
5d3ab9b096 | ||
|
|
4fea8145e2 | ||
|
|
884e26080f | ||
|
|
9946491fcc | ||
|
|
ae6dfff5bf | ||
|
|
307bf4dae2 | ||
|
|
96d65fc022 | ||
|
|
080b8cadfa | ||
|
|
7cdd2aa128 | ||
|
|
7d7672f119 | ||
|
|
6a5b52efa0 | ||
|
|
6d864b7030 | ||
|
|
71a39dd4be | ||
|
|
500230ee94 | ||
|
|
347177e052 | ||
|
|
b7883fbb6e | ||
|
|
a77e023ab4 | ||
|
|
812cb5638c | ||
|
|
77a0f1d727 | ||
|
|
b9a18f3b8d | ||
|
|
73aeb61c3f | ||
|
|
3041903844 | ||
|
|
ad8ee98617 | ||
|
|
bc29d0e5d4 | ||
|
|
f89aebb1c4 | ||
|
|
1d7fb4f0c5 | ||
|
|
81a6c7817f | ||
|
|
5238fccc15 | ||
|
|
fba9046490 | ||
|
|
8a2908a24a | ||
|
|
e8b12f7a6f | ||
|
|
271da5a2e0 | ||
|
|
26fbabf3d1 | ||
|
|
37cdcb4d8a | ||
|
|
57b6534e53 | ||
|
|
8bf49ea170 | ||
|
|
02ee8626fb | ||
|
|
6276e5b41b | ||
|
|
51740b12ae | ||
|
|
6e6783056e | ||
|
|
791bd0cd2b | ||
|
|
e890dcdb19 | ||
|
|
5ddcb8664a | ||
|
|
09c4b4e0b7 | ||
|
|
368101778e | ||
|
|
535d79da63 | ||
|
|
4f69172d25 |
571
Configure
571
Configure
@@ -10,7 +10,7 @@ use strict;
|
||||
|
||||
# see INSTALL for instructions.
|
||||
|
||||
my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [no-threads] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx=vvv] os/compiler[:flags]\n";
|
||||
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";
|
||||
|
||||
# Options:
|
||||
#
|
||||
@@ -25,13 +25,18 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
|
||||
#
|
||||
# --with-krb5-dir Declare where Kerberos 5 lives. The libraries are expected
|
||||
# to live in the subdirectory lib/ and the header files in
|
||||
# include/.
|
||||
# --with-krb5-lib Declare where the Kerberos 5 libraries live.
|
||||
# include/. A value is required.
|
||||
# --with-krb5-lib Declare where the Kerberos 5 libraries live. A value is
|
||||
# required.
|
||||
# (Default: KRB5_DIR/lib)
|
||||
# --with-krb5-include Declare where the Kerberos 5 header files live.
|
||||
# --with-krb5-include Declare where the Kerberos 5 header files live. A
|
||||
# value is required.
|
||||
# (Default: KRB5_DIR/include)
|
||||
# --with-krb5-flavor Declare what flavor of Kerberos 5 is used. Currently
|
||||
# supported values are "MIT" and "Heimdal".
|
||||
# supported values are "MIT" and "Heimdal". A value is required.
|
||||
#
|
||||
# --test-sanity Make a number of sanity checks on the data in this file.
|
||||
# This is a debugging tool for OpenSSL developers.
|
||||
#
|
||||
# no-hw-xxx do not compile support for specific crypto hardware.
|
||||
# Generic OpenSSL-style methods relating to this support
|
||||
@@ -46,6 +51,9 @@ my $usage="Usage: Configure [no-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-
|
||||
# no-dso do not compile in any native shared-library methods. This
|
||||
# will ensure that all methods just return NULL.
|
||||
# no-krb5 do not compile in any KRB5 library or code.
|
||||
# [no-]zlib [don't] compile support for zlib compression.
|
||||
# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
|
||||
# library and will be loaded in run-time by the OpenSSL library.
|
||||
# 386 generate 80386 code
|
||||
# no-<cipher> build without specified algorithm (rsa, idea, rc5, ...)
|
||||
# -<xxx> +<xxx> compiler options are passed through
|
||||
@@ -104,10 +112,15 @@ my $x86_elf_asm="asm/bn86-elf.o asm/co86-elf.o:asm/dx86-elf.o asm/yx86-elf.o:asm
|
||||
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 $mips3_irix_asm="asm/mips3.o::::::::";
|
||||
# There seems to be boundary faults in asm/alpha.s.
|
||||
#my $alpha_asm="asm/alpha.o::::::::";
|
||||
my $alpha_asm="::::::::";
|
||||
|
||||
# -DB_ENDIAN slows things down on a sparc for md5, but helps sha1.
|
||||
# So the md5_locl.h file has an undef B_ENDIAN if sun is defined
|
||||
|
||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag
|
||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib
|
||||
|
||||
my %table=(
|
||||
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
|
||||
@@ -123,61 +136,71 @@ my %table=(
|
||||
"purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::",
|
||||
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::",
|
||||
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::asm/bn86-elf.o asm/co86-elf.o",
|
||||
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
||||
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
||||
"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::::",
|
||||
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
|
||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -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-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -m486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT:::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"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 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -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-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 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -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-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-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-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 -W -Wtraditional -Wundef -Wshadow -Wid-clash-31 -Wcast-align -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-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 -W -Wtraditional -Wundef -Wshadow -Wid-clash-31 -Wcast-align -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)",
|
||||
"dist", "cc:-O::(unknown)::::::",
|
||||
|
||||
# Basic configs that should work on any (32 and less bit) box
|
||||
"gcc", "gcc:-O3::(unknown):::BN_LLONG:::",
|
||||
"cc", "cc:-O::(unknown)::::::",
|
||||
|
||||
#### Solaris x86 setups
|
||||
#### Solaris x86 with GNU C setups
|
||||
# -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have to do it
|
||||
# here because whenever GNU C instantiates an assembler template it
|
||||
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
|
||||
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
|
||||
# error message.
|
||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -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_sol_asm}:dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### Solaris x86 with Sun C setups
|
||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### SPARC Solaris with GNU C setups
|
||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-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-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# -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)",
|
||||
"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::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
|
||||
# but keep the assembler modules.
|
||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-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/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC::.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::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
####
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### SPARC Solaris with Sun C setups
|
||||
# DO NOT use /xO[34] on sparc with SC3.0. It is broken, and will not pass the tests
|
||||
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
|
||||
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
|
||||
# SC5.0 note: Compiler common patch 107357-01 or later is required!
|
||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-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)",
|
||||
"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:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
|
||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-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)",
|
||||
"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",
|
||||
####
|
||||
"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-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)",
|
||||
|
||||
#### SPARC Linux setups
|
||||
"linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
|
||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
||||
# assisted with debugging of following two configs.
|
||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o::::",
|
||||
"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)",
|
||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
||||
# -Wa,-Av8plus should do the trick no matter what.
|
||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
"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)",
|
||||
# !!!Folowing can't be even tested yet!!!
|
||||
# We have to wait till 64-bit glibc for SPARC is operational!!!
|
||||
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:ULTRASPARC::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
||||
@@ -188,17 +211,17 @@ my %table=(
|
||||
|
||||
#### IRIX 5.x configs
|
||||
# -mips2 flag is added by ./config when appropriate.
|
||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR::::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR::::::::::dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
#### IRIX 6.x configs
|
||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
||||
# './Configure irix-[g]cc' manually.
|
||||
# -mips4 flag is added by ./config when appropriate.
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:asm/mips3.o:::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:asm/mips3.o:::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# N64 ABI builds.
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o:::::::::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:asm/mips3.o:::::::::dlfcn:irix-shared::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_irix_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### Unified HP-UX ANSI C configs.
|
||||
# Special notes:
|
||||
@@ -216,7 +239,7 @@ my %table=(
|
||||
# - Keep in mind that the HP compiler by default generates code
|
||||
# suitable for execution on the host you're currently compiling at.
|
||||
# If the toolkit is ment to be used on various PA-RISC processors
|
||||
# consider './config +Dportable'.
|
||||
# consider './config +DAportable'.
|
||||
# - +DD64 is chosen in favour of +DA2.0W because it's ment to be
|
||||
# compatible with *future* releases.
|
||||
# - If you run ./Configure hpux-parisc-[g]cc manually don't forget to
|
||||
@@ -230,41 +253,56 @@ my %table=(
|
||||
#
|
||||
#!#"hpux-parisc-cc","cc:-Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
|
||||
# Since there is mention of this in shlib/hpux10-cc.sh
|
||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::-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-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)",
|
||||
"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)",
|
||||
# 64bit PARISC for GCC without optimization, which seems to make problems.
|
||||
# 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)",
|
||||
|
||||
# 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.
|
||||
#
|
||||
# Chris Ruemmler <ruemmler@cup.hp.com>
|
||||
# Kevin Steves <ks@hp.se>
|
||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-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)",
|
||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-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 +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-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)",
|
||||
"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)",
|
||||
# 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_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 9.X config.
|
||||
# Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or
|
||||
# egcs. gcc 2.8.1 is also broken.
|
||||
|
||||
"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown)::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown)::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux-cc fails (e.g. during "make test"), try the next one; otherwise,
|
||||
# please report your OS and compiler version to the openssl-bugs@openssl.org
|
||||
# mailing list.
|
||||
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux-gcc fails, try this one:
|
||||
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# HPUX 9.X on Motorola 68k platforms with gcc
|
||||
"hpux-m68k-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):::BN_LLONG DES_PTR DES_UNROLL:::::::::::::",
|
||||
|
||||
# HPUX 10.X config. Supports threads.
|
||||
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux10-cc fails, try this one (if still fails, try deleting BN_LLONG):
|
||||
"hpux10-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
"hpux10-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# If hpux10-gcc fails, try this one:
|
||||
"hpux10-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux10-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC::.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# HPUX 11.X from www.globus.org.
|
||||
# Only works on PA-RISC 2.0 cpus, and not optimized. Why?
|
||||
@@ -275,13 +313,43 @@ my %table=(
|
||||
#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
|
||||
"MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
|
||||
# Dec Alpha, OSF/1 - the alpha164-cc is the flags for a 21164A with
|
||||
# the new compiler
|
||||
#### PARISC Linux setups
|
||||
"linux-parisc","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
|
||||
|
||||
# Dec Alpha, OSF/1 - the alpha164-cc is historical, for the conversion
|
||||
# from the older DEC C Compiler to the newer compiler. It's now the
|
||||
# same as the preferred entry, alpha-cc. If you are still using the
|
||||
# older compiler (you're at 3.x or earlier, or perhaps very early 4.x)
|
||||
# you should use `alphaold-cc'.
|
||||
#
|
||||
# "What's in a name? That which we call a rose
|
||||
# By any other word would smell as sweet."
|
||||
#
|
||||
# - William Shakespeare, "Romeo & Juliet", Act II, scene II.
|
||||
#
|
||||
# For OSF/1 3.2b and earlier, and Digital UNIX 3.2c - 3.2g, with the
|
||||
# vendor compiler, use alphaold-cc.
|
||||
# For Digital UNIX 4.0 - 4.0e, with the vendor compiler, use alpha-cc.
|
||||
# For Tru64 UNIX 4.f - current, with the vendor compiler, use alpha-cc.
|
||||
#
|
||||
# There's also an alternate target available (which `config' will never
|
||||
# select) called alpha-cc-rpath. This target builds an RPATH into the
|
||||
# shared libraries, which is very convenient on Tru64 since binaries
|
||||
# linked against that shared library will automatically inherit that RPATH,
|
||||
# and hence know where to look for the openssl libraries, even if they're in
|
||||
# an odd place.
|
||||
#
|
||||
# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version
|
||||
"alpha-gcc","gcc:-O3::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:asm/alpha.o:::::::::dlfcn:tru64-shared::.so",
|
||||
"alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:asm/alpha.o:::::::::dlfcn:tru64-shared::.so",
|
||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:asm/alpha.o:::::::::dlfcn:tru64-shared::.so",
|
||||
"FreeBSD-alpha","gcc:-DTERMIOS -O -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
#
|
||||
"alpha-gcc","gcc:-O3::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
|
||||
"alphaold-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
|
||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared:::.so",
|
||||
"alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared:::.so",
|
||||
"alpha-cc-rpath", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:tru64-shared-rpath:::.so",
|
||||
#
|
||||
# This probably belongs in a different section.
|
||||
#
|
||||
"FreeBSD-alpha","gcc:-DTERMIOS -O -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### Alpha Linux with GNU C and Compaq C setups
|
||||
# Special notes:
|
||||
@@ -296,33 +364,39 @@ my %table=(
|
||||
#
|
||||
# <appro@fy.chalmers.se>
|
||||
#
|
||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:asm/alpha.o:::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:asm/alpha.o:::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:asm/alpha.o::",
|
||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:asm/alpha.o::",
|
||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
|
||||
# assembler versions -- currently defunct:
|
||||
##"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer:::(unknown):SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:asm/alpha.o::",
|
||||
##"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer:::(unknown):SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${alpha_asm}",
|
||||
|
||||
# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the
|
||||
# bn86-elf.o file file since it is hand tweaked assembler.
|
||||
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"linux-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-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-k6", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=k6 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"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",
|
||||
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
||||
"linux-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown):::BN_LLONG:::",
|
||||
"linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown):::BN_LLONG:::",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-m68k", "gcc:-DB_ENDIAN -DTERMIO -O2 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::",
|
||||
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown):::SIXTY_FOUR_BIT_LONG::",
|
||||
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG:::::::::::linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"FreeBSD", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
|
||||
"bsdi-gcc", "gcc:-O3 -ffast-math -DL_ENDIAN -DPERL5 -m486::(unknown):::RSA_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_bsdi_asm}",
|
||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"nextstep", "cc:-O -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
"nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
|
||||
@@ -332,22 +406,41 @@ my %table=(
|
||||
# QNX 4
|
||||
"qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
|
||||
|
||||
# Linux on ARM
|
||||
"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::::::::::dlfcn:linux-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# QNX 6
|
||||
"qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:",
|
||||
|
||||
# UnixWare 2.0
|
||||
"unixware-2.0","cc:-O -DFILIO_H::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
"unixware-2.0-pentium","cc:-O -DFILIO_H -Kpentium -Kthread::(unknown)::-lsocket -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
# 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)",
|
||||
|
||||
# UnixWare 2.0x fails destest with -O
|
||||
"unixware-2.0","cc:-DFILIO_H::-Kthread::-lsocket -lnsl -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
"unixware-2.0-pentium","cc:-DFILIO_H -Kpentium::-Kthread::-lsocket -lnsl -lx:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
|
||||
# UnixWare 2.1
|
||||
"unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
"unixware-2.1-pentium","cc:-O -DFILIO_H -Kpentium::-Kthread::-lsocket -lnsl -lx:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
"unixware-2.1-p6","cc:-O -DFILIO_H -Kp6::-Kthread::-lsocket -lnsl -lx:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
|
||||
# UnixWare 7
|
||||
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl: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}::::::::::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.
|
||||
"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:::",
|
||||
"aix43-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:",
|
||||
"aix43-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:",
|
||||
|
||||
#
|
||||
# Cray T90 (SDSC)
|
||||
# Cray T90 and similar (SDSC)
|
||||
# It's Big-endian, but the algorithms work properly when B_ENDIAN is NOT
|
||||
# defined. The T90 ints and longs are 8 bytes long, and apparently the
|
||||
# B_ENDIAN code assumes 4 byte ints. Fortunately, the non-B_ENDIAN and
|
||||
@@ -357,7 +450,10 @@ my %table=(
|
||||
#'Taking the address of a bit field is not allowed. '
|
||||
#'An expression with bit field exists as the operand of "sizeof" '
|
||||
# (written by Wayne Schroeder <schroede@SDSC.EDU>)
|
||||
"cray-t90-cc", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG DES_INT:::",
|
||||
#
|
||||
# j90 is considered the base machine type for unicos machines,
|
||||
# so this configuration is now called "cray-j90" ...
|
||||
"cray-j90", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG DES_INT:::",
|
||||
|
||||
#
|
||||
# Cray T3E (Research Center Juelich, beckman@acl.lanl.gov)
|
||||
@@ -371,27 +467,37 @@ my %table=(
|
||||
|
||||
# DGUX, 88100.
|
||||
"dgux-R3-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown):::RC4_INDEX DES_UNROLL:::",
|
||||
"dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX: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}",
|
||||
|
||||
# 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:::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:::", # des options?
|
||||
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
|
||||
"sco5-cc", "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
|
||||
# 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:::",
|
||||
"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)",
|
||||
"SINIX","cc:-O::(unknown):SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:RC4_INDEX RC4_CHAR:::",
|
||||
"SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::",
|
||||
|
||||
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
|
||||
"BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
||||
|
||||
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
|
||||
# You need to compile using the c89.sh wrapper in the tools directory, because the
|
||||
# IBM compiler does not like the -L switch after any object modules.
|
||||
#
|
||||
"OS390-Unix","c89.sh:-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE::(unknown):::THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::",
|
||||
|
||||
# Windows NT, Microsoft Visual C++ 4.0
|
||||
|
||||
"VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX ${x86_gcc_opts}::::::::::win32",
|
||||
"VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX ${x86_gcc_opts}::::::::::win32",
|
||||
"VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}::::::::::win32",
|
||||
"VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}::::::::::win32",
|
||||
"VC-WIN16","cl:::(unknown):WIN16::MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
|
||||
"VC-W31-16","cl:::(unknown):WIN16::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX SIXTEEN_BIT:::",
|
||||
"VC-W31-32","cl::::WIN16::BN_LLONG MD2_CHAR DES_UNROLL DES_PTR RC4_INDEX THIRTY_TWO_BIT:::",
|
||||
@@ -406,8 +512,15 @@ my %table=(
|
||||
# and its library files in util/pl/*)
|
||||
"Mingw32", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
|
||||
# CygWin32
|
||||
"CygWin32", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
# UWIN
|
||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||
|
||||
# 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", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:::.dll",
|
||||
|
||||
# DJGPP
|
||||
"DJGPP", "gcc:-I/dev/env/DJDIR/watt32/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L$ENV{DJDIR}/watt32/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
|
||||
|
||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown):::::::",
|
||||
@@ -416,15 +529,22 @@ my %table=(
|
||||
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
|
||||
|
||||
# Some OpenBSD from Bob Beck <beck@obtuse.com>
|
||||
"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-mips","gcc:-O2 -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::dlfcn:bsd-gcc-shared:-fPIC:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD", "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-alpha", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"OpenBSD-m68k", "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-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-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-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)",
|
||||
|
||||
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
|
||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
"darwin-ppc-cc","cc:-O3 -nostdinc -I/System/Library/Frameworks/System.framework/Headers -I/System/Library/Frameworks/System.frameworks/Headers/bsd -I/usr/include -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::-fPIC",
|
||||
"darwin-i386-cc","cc:-O3 -nostdinc -I/System/Library/Frameworks/System.framework/Headers -I/System/Library/Frameworks/System.frameworks/Headers/bsd -I/usr/include -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::-fPIC",
|
||||
"darwin-ppc-cc","cc:-O3 -nostdinc -I/System/Library/Frameworks/System.framework/Headers -I/System/Library/Frameworks/System.frameworks/Headers/bsd -I/usr/include -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-i386-cc","cc:-O3 -nostdinc -I/System/Library/Frameworks/System.framework/Headers -I/System/Library/Frameworks/System.frameworks/Headers/bsd -I/usr/include -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
|
||||
##### Sony NEWS-OS 4.x
|
||||
"newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::",
|
||||
@@ -432,16 +552,48 @@ my %table=(
|
||||
##### GNU Hurd
|
||||
"hurd-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC",
|
||||
|
||||
##### OS/2 EMX
|
||||
"OS2-EMX", "gcc::::::::",
|
||||
|
||||
##### VxWorks for various targets
|
||||
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
||||
|
||||
);
|
||||
|
||||
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
|
||||
BC-16 Mingw32);
|
||||
BC-16 Mingw32 OS2-EMX);
|
||||
|
||||
my $idx = 0;
|
||||
my $idx_cc = $idx++;
|
||||
my $idx_cflags = $idx++;
|
||||
my $idx_unistd = $idx++;
|
||||
my $idx_thread_cflag = $idx++;
|
||||
my $idx_sys_id = $idx++;
|
||||
my $idx_lflags = $idx++;
|
||||
my $idx_bn_ops = $idx++;
|
||||
my $idx_bn_obj = $idx++;
|
||||
my $idx_des_obj = $idx++;
|
||||
my $idx_bf_obj = $idx++;
|
||||
my $idx_md5_obj = $idx++;
|
||||
my $idx_sha1_obj = $idx++;
|
||||
my $idx_cast_obj = $idx++;
|
||||
my $idx_rc4_obj = $idx++;
|
||||
my $idx_rmd160_obj = $idx++;
|
||||
my $idx_rc5_obj = $idx++;
|
||||
my $idx_dso_scheme = $idx++;
|
||||
my $idx_shared_target = $idx++;
|
||||
my $idx_shared_cflag = $idx++;
|
||||
my $idx_shared_ldflag = $idx++;
|
||||
my $idx_shared_extension = $idx++;
|
||||
my $idx_ranlib = $idx++;
|
||||
|
||||
my $prefix="";
|
||||
my $openssldir="";
|
||||
my $exe_ext="";
|
||||
my $install_prefix="";
|
||||
my $no_threads=0;
|
||||
my $no_shared=1;
|
||||
my $zlib=0;
|
||||
my $no_krb5=0;
|
||||
my $threads=0;
|
||||
my $no_asm=0;
|
||||
@@ -470,6 +622,14 @@ my $processor="";
|
||||
my $default_ranlib;
|
||||
my $perl;
|
||||
|
||||
my $no_ssl2=0;
|
||||
my $no_ssl3=0;
|
||||
my $no_tls1=0;
|
||||
my $no_md5=0;
|
||||
my $no_sha=0;
|
||||
my $no_rsa=0;
|
||||
my $no_dh=0;
|
||||
|
||||
$default_ranlib= &which("ranlib") or $default_ranlib="true";
|
||||
$perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl")
|
||||
or $perl="perl";
|
||||
@@ -486,6 +646,7 @@ my $libs;
|
||||
my $target;
|
||||
my $options;
|
||||
my $symlink;
|
||||
my $make_depend=0;
|
||||
my %withargs=();
|
||||
|
||||
my @argvcopy=@ARGV;
|
||||
@@ -512,7 +673,11 @@ PROCESS_ARGS:
|
||||
foreach (@argvcopy)
|
||||
{
|
||||
s /^-no-/no-/; # some people just can't read the instructions
|
||||
if (/^no-asm$/)
|
||||
if (/^--test-sanity$/)
|
||||
{
|
||||
exit(&test_sanity());
|
||||
}
|
||||
elsif (/^no-asm$/)
|
||||
{
|
||||
$no_asm=1;
|
||||
$flags .= "-DOPENSSL_NO_ASM ";
|
||||
@@ -542,8 +707,22 @@ PROCESS_ARGS:
|
||||
{ $no_shared=1; }
|
||||
elsif (/^shared$/)
|
||||
{ $no_shared=0; }
|
||||
elsif (/^no-zlib$/)
|
||||
{ $zlib=0; }
|
||||
elsif (/^zlib$/)
|
||||
{ $zlib=1; }
|
||||
elsif (/^zlib-dynamic$/)
|
||||
{ $zlib=2; }
|
||||
elsif (/^no-symlinks$/)
|
||||
{ $symlink=0; }
|
||||
elsif (/^no-ssl$/)
|
||||
{ $no_ssl2 = $no_ssl3 = 1; }
|
||||
elsif (/^no-ssl2$/)
|
||||
{ $no_ssl2 = 1; }
|
||||
elsif (/^no-ssl3$/)
|
||||
{ $no_ssl3 = 1; }
|
||||
elsif (/^no-tls1?$/)
|
||||
{ $no_tls1 = 1; }
|
||||
elsif (/^no-(.+)$/)
|
||||
{
|
||||
my $algo=$1;
|
||||
@@ -552,6 +731,12 @@ PROCESS_ARGS:
|
||||
$flags .= "-DOPENSSL_NO_$algo ";
|
||||
$depflags .= "-DOPENSSL_NO_$algo ";
|
||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_$algo\n";
|
||||
if ($algo eq "RIJNDAEL")
|
||||
{
|
||||
$flags .= "-DOPENSSL_NO_AES ";
|
||||
$depflags .= "-DOPENSSL_NO_AES ";
|
||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_AES\n";
|
||||
}
|
||||
if ($algo eq "DES")
|
||||
{
|
||||
push @skip, "mdc2";
|
||||
@@ -560,6 +745,22 @@ PROCESS_ARGS:
|
||||
$depflags .= "-DOPENSSL_NO_MDC2 ";
|
||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_MDC2\n";
|
||||
}
|
||||
if ($algo eq "MD5")
|
||||
{
|
||||
$no_md5 = 1;
|
||||
}
|
||||
if ($algo eq "SHA")
|
||||
{
|
||||
$no_sha = 1;
|
||||
}
|
||||
if ($algo eq "RSA")
|
||||
{
|
||||
$no_rsa = 1;
|
||||
}
|
||||
if ($algo eq "DH")
|
||||
{
|
||||
$no_dh = 1;
|
||||
}
|
||||
}
|
||||
elsif (/^reconfigure/ || /^reconf/)
|
||||
{
|
||||
@@ -644,6 +845,39 @@ PROCESS_ARGS:
|
||||
}
|
||||
}
|
||||
|
||||
$no_ssl3=1 if ($no_md5 || $no_sha);
|
||||
$no_ssl3=1 if ($no_rsa && $no_dh);
|
||||
|
||||
$no_ssl2=1 if ($no_md5);
|
||||
$no_ssl2=1 if ($no_rsa);
|
||||
|
||||
$no_tls1=1 if ($no_md5 || $no_sha);
|
||||
$no_tls1=1 if ($no_dh);
|
||||
|
||||
if ($no_ssl2)
|
||||
{
|
||||
push @skip,"SSL2";
|
||||
$flags .= "-DOPENSSL_NO_SSL2 ";
|
||||
$depflags .= "-DOPENSSL_NO_SSL2 ";
|
||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL2\n";
|
||||
}
|
||||
|
||||
if ($no_ssl3)
|
||||
{
|
||||
push @skip,"SSL3";
|
||||
$flags .= "-DOPENSSL_NO_SSL3 ";
|
||||
$depflags .= "-DOPENSSL_NO_SSL3 ";
|
||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_SSL3\n";
|
||||
}
|
||||
|
||||
if ($no_tls1)
|
||||
{
|
||||
push @skip,"TLS1";
|
||||
$flags .= "-DOPENSSL_NO_TLS1 ";
|
||||
$depflags .= "-DOPENSSL_NO_TLS1 ";
|
||||
$openssl_algorithm_defines .= "#define OPENSSL_NO_TLS1\n";
|
||||
}
|
||||
|
||||
if ($target eq "TABLE") {
|
||||
foreach $target (sort keys %table) {
|
||||
print_table_entry($target);
|
||||
@@ -659,12 +893,18 @@ if ($target eq "LIST") {
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($target =~ m/^CygWin32(-.*)$/) {
|
||||
$target = "Cygwin".$1;
|
||||
}
|
||||
|
||||
print "Configuring for $target\n";
|
||||
|
||||
&usage if (!defined($table{$target}));
|
||||
|
||||
my $IsWindows=scalar grep /^$target$/,@WinTargets;
|
||||
|
||||
$exe_ext=".exe" if ($target eq "Cygwin");
|
||||
$exe_ext=".exe" if ($target eq "DJGPP");
|
||||
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
|
||||
$prefix=$openssldir if $prefix eq "";
|
||||
|
||||
@@ -672,17 +912,35 @@ chop $openssldir if $openssldir =~ /\/$/;
|
||||
chop $prefix if $prefix =~ /\/$/;
|
||||
|
||||
$openssldir=$prefix . "/ssl" if $openssldir eq "";
|
||||
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /^\//;
|
||||
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
|
||||
|
||||
|
||||
print "IsWindows=$IsWindows\n";
|
||||
|
||||
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags,
|
||||
my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
|
||||
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
|
||||
my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,
|
||||
my $shared_extension,my $ranlib)=
|
||||
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
my $cc = $fields[$idx_cc];
|
||||
my $cflags = $fields[$idx_cflags];
|
||||
my $unistd = $fields[$idx_unistd];
|
||||
my $thread_cflag = $fields[$idx_thread_cflag];
|
||||
my $sys_id = $fields[$idx_sys_id];
|
||||
my $lflags = $fields[$idx_lflags];
|
||||
my $bn_ops = $fields[$idx_bn_ops];
|
||||
my $bn_obj = $fields[$idx_bn_obj];
|
||||
my $des_obj = $fields[$idx_des_obj];
|
||||
my $bf_obj = $fields[$idx_bf_obj];
|
||||
$md5_obj = $fields[$idx_md5_obj];
|
||||
$sha1_obj = $fields[$idx_sha1_obj];
|
||||
my $cast_obj = $fields[$idx_cast_obj];
|
||||
my $rc4_obj = $fields[$idx_rc4_obj];
|
||||
$rmd160_obj = $fields[$idx_rmd160_obj];
|
||||
my $rc5_obj = $fields[$idx_rc5_obj];
|
||||
my $dso_scheme = $fields[$idx_dso_scheme];
|
||||
my $shared_target = $fields[$idx_shared_target];
|
||||
my $shared_cflag = $fields[$idx_shared_cflag];
|
||||
my $shared_ldflag = $fields[$idx_shared_ldflag];
|
||||
my $shared_extension = $fields[$idx_shared_extension];
|
||||
my $ranlib = $fields[$idx_ranlib];
|
||||
|
||||
$cflags="$flags$cflags" if ($flags ne "");
|
||||
|
||||
# Kerberos settings. The flavor must be provided from outside, either through
|
||||
@@ -697,6 +955,7 @@ if ($no_krb5
|
||||
}
|
||||
else
|
||||
{
|
||||
my ($lresolv, $lpath, $lext);
|
||||
if ($withargs{"krb5-flavor"} =~ /^[Hh]eimdal$/)
|
||||
{
|
||||
$withargs{"krb5-dir"} = "/usr/heimdal"
|
||||
@@ -706,7 +965,7 @@ else
|
||||
if $withargs{"krb5-lib"} eq "";
|
||||
$cflags="-DKRB5_HEIMDAL $cflags";
|
||||
}
|
||||
if ($withargs{"krb5-flavor"} =~ /^[Mm][Ii][Tt]$/)
|
||||
if ($withargs{"krb5-flavor"} =~ /^[Mm][Ii][Tt]/)
|
||||
{
|
||||
$withargs{"krb5-dir"} = "/usr/kerberos"
|
||||
if $withargs{"krb5-dir"} eq "";
|
||||
@@ -714,9 +973,27 @@ else
|
||||
"/lib -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto"
|
||||
if $withargs{"krb5-lib"} eq "";
|
||||
$cflags="-DKRB5_MIT $cflags";
|
||||
$withargs{"krb5-flavor"} =~ s/^[Mm][Ii][Tt][._-]*//;
|
||||
if ($withargs{"krb5-flavor"} =~ /^1[._-]*[01]/)
|
||||
{
|
||||
$cflags="-DKRB5_MIT_OLD11 $cflags";
|
||||
}
|
||||
}
|
||||
LRESOLV:
|
||||
foreach $lpath ("/lib", "/usr/lib")
|
||||
{
|
||||
foreach $lext ("a", "so")
|
||||
{
|
||||
$lresolv = "$lpath/libresolv.$lext";
|
||||
last LRESOLV if (-r "$lresolv");
|
||||
$lresolv = "";
|
||||
}
|
||||
}
|
||||
$withargs{"krb5-lib"} .= " -lresolv"
|
||||
if ("$lresolv");
|
||||
$withargs{"krb5-include"} = "-I".$withargs{"krb5-dir"}."/include"
|
||||
if $withargs{"krb5-include"} eq "" && $withargs{"krb5-dir"} ne "";
|
||||
if $withargs{"krb5-include"} eq "" &&
|
||||
$withargs{"krb5-dir"} ne "";
|
||||
}
|
||||
|
||||
# The DSO code currently always implements all functions so that no
|
||||
@@ -782,8 +1059,15 @@ if ($no_asm)
|
||||
|
||||
if ($threads)
|
||||
{
|
||||
$cflags=$thread_cflags;
|
||||
$openssl_thread_defines .= $thread_defines;
|
||||
$cflags=$thread_cflags;
|
||||
$openssl_thread_defines .= $thread_defines;
|
||||
}
|
||||
|
||||
if ($zlib)
|
||||
{
|
||||
$cflags = "-DZLIB $cflags";
|
||||
$cflags = "-DZLIB_SHARED $cflags" if $zlib == 2;
|
||||
$lflags = "$lflags -lz" if $zlib == 2;
|
||||
}
|
||||
|
||||
# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
|
||||
@@ -843,6 +1127,10 @@ if ($rmd160_obj =~ /\.o$/)
|
||||
$cflags.=" -DRMD160_ASM";
|
||||
}
|
||||
|
||||
# "Stringify" the C flags string. This permits it to be made part of a string
|
||||
# and works as well on command lines.
|
||||
$cflags =~ s/([\\\"])/\\\1/g;
|
||||
|
||||
my $version = "unknown";
|
||||
my $major = "unknown";
|
||||
my $minor = "unknown";
|
||||
@@ -884,7 +1172,7 @@ while (<IN>)
|
||||
if ($sdirs) {
|
||||
my $dir;
|
||||
foreach $dir (@skip) {
|
||||
s/ $dir / /;
|
||||
s/([ ])$dir /\1/;
|
||||
}
|
||||
}
|
||||
$sdirs = 0 unless /\\$/;
|
||||
@@ -907,6 +1195,7 @@ while (<IN>)
|
||||
s/^CFLAG=.*$/CFLAG= $cflags/;
|
||||
s/^DEPFLAG=.*$/DEPFLAG= $depflags/;
|
||||
s/^EX_LIBS=.*$/EX_LIBS= $lflags/;
|
||||
s/^EXE_EXT=.*$/EXE_EXT= $exe_ext/;
|
||||
s/^BN_ASM=.*$/BN_ASM= $bn_obj/;
|
||||
s/^DES_ENC=.*$/DES_ENC= $des_obj/;
|
||||
s/^BF_ENC=.*$/BF_ENC= $bf_obj/;
|
||||
@@ -927,13 +1216,22 @@ while (<IN>)
|
||||
if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/)
|
||||
{
|
||||
my $sotmp = $1;
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/;
|
||||
}
|
||||
elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.dylib$/)
|
||||
{
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.dylib/;
|
||||
}
|
||||
elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
|
||||
{
|
||||
my $sotmp = $1;
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
|
||||
}
|
||||
elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/)
|
||||
{
|
||||
s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.\$(SHLIB_MAJOR).dylib .dylib/;
|
||||
}
|
||||
s/^SHARED_LDFLAGS=.*/SHARED_LDFLAGS=$shared_ldflag/;
|
||||
print OUT $_."\n";
|
||||
}
|
||||
close(IN);
|
||||
@@ -1021,7 +1319,9 @@ $openssl_thread_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#end
|
||||
$openssl_sys_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg;
|
||||
$openssl_other_defines =~ s/^\s*#\s*define\s+(.*)/#ifndef $1\n# define $1\n#endif/mg;
|
||||
print OUT $openssl_sys_defines;
|
||||
print OUT "#ifndef OPENSSL_DOING_MAKEDEPEND\n\n";
|
||||
print OUT $openssl_algorithm_defines;
|
||||
print OUT "\n#endif /* OPENSSL_DOING_MAKEDEPEND */\n";
|
||||
print OUT $openssl_thread_defines;
|
||||
print OUT $openssl_other_defines,"\n";
|
||||
|
||||
@@ -1139,11 +1439,12 @@ if($IsWindows) {
|
||||
EOF
|
||||
close(OUT);
|
||||
} else {
|
||||
(system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?
|
||||
if $symlink;
|
||||
### (system 'make depend') == 0 or exit $? if $depflags ne "";
|
||||
# Run "make depend" manually if you want to be able to delete
|
||||
# the source code files of ciphers you left out.
|
||||
my $make_command = "make -f Makefile.ssl PERL=\'$perl\'";
|
||||
my $make_targets = "";
|
||||
$make_targets .= " links" if $symlink;
|
||||
$make_targets .= " depend" if $depflags ne "" && $make_depend;
|
||||
(system $make_command.$make_targets) == 0 or exit $?
|
||||
if $make_targets ne "";
|
||||
if ( $perl =~ m@^/@) {
|
||||
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
||||
&dofile("apps/der_chop",$perl,'^#!/', '#!%s');
|
||||
@@ -1153,7 +1454,16 @@ EOF
|
||||
&dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
||||
&dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||
}
|
||||
}
|
||||
if ($depflags ne "" && !$make_depend) {
|
||||
print <<EOF;
|
||||
|
||||
Since you've disabled at least one algorithm, you need to do the following
|
||||
before building:
|
||||
|
||||
make depend
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
@@ -1244,7 +1554,7 @@ sub print_table_entry
|
||||
my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
|
||||
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
|
||||
my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,
|
||||
my $shared_extension,my $ranlib)=
|
||||
my $shared_ldflag,my $shared_extension,my $ranlib)=
|
||||
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
|
||||
print <<EOF
|
||||
@@ -1269,7 +1579,44 @@ sub print_table_entry
|
||||
\$dso_scheme = $dso_scheme
|
||||
\$shared_target= $shared_target
|
||||
\$shared_cflag = $shared_cflag
|
||||
\$shared_ldflag = $shared_ldflag
|
||||
\$shared_extension = $shared_extension
|
||||
\$ranlib = $ranlib
|
||||
EOF
|
||||
}
|
||||
|
||||
sub test_sanity
|
||||
{
|
||||
my $errorcnt = 0;
|
||||
|
||||
print STDERR "=" x 70, "\n";
|
||||
print STDERR "=== SANITY TESTING!\n";
|
||||
print STDERR "=== No configuration will be done, all other arguments will be ignored!\n";
|
||||
print STDERR "=" x 70, "\n";
|
||||
|
||||
foreach $target (sort keys %table)
|
||||
{
|
||||
@fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
|
||||
if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/)
|
||||
{
|
||||
$errorcnt++;
|
||||
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
|
||||
print STDERR " in the previous field\n";
|
||||
}
|
||||
elsif ($fields[$idx_dso_scheme+1] =~ /^(dl|dlfcn|win32|vms)$/)
|
||||
{
|
||||
$errorcnt++;
|
||||
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
|
||||
print STDERR " in the following field\n";
|
||||
}
|
||||
elsif ($fields[$idx_dso_scheme] !~ /^(dl|dlfcn|win32|vms|)$/)
|
||||
{
|
||||
$errorcnt++;
|
||||
print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n";
|
||||
print STDERR " valid values are 'dl', 'dlfcn', 'win32' and 'vms'\n";
|
||||
}
|
||||
}
|
||||
print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
|
||||
return $errorcnt;
|
||||
}
|
||||
|
||||
204
FAQ
204
FAQ
@@ -8,6 +8,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* How can I contact the OpenSSL developers?
|
||||
* Where can I get a compiled version of OpenSSL?
|
||||
* Why aren't tools like 'autoconf' and 'libtool' used?
|
||||
* What is an 'engine' version?
|
||||
|
||||
[LEGAL] Legal questions
|
||||
|
||||
@@ -17,6 +18,7 @@ OpenSSL - Frequently Asked Questions
|
||||
[USER] Questions on using the OpenSSL applications
|
||||
|
||||
* Why do I get a "PRNG not seeded" error message?
|
||||
* Why do I get an "unable to write 'random state'" error message?
|
||||
* How do I create certificates or certificate requests?
|
||||
* Why can't I create certificate requests?
|
||||
* Why does <SSL program> fail with a certificate verify error?
|
||||
@@ -26,13 +28,15 @@ OpenSSL - Frequently Asked Questions
|
||||
* How can I remove the passphrase on a private key?
|
||||
* Why can't I use OpenSSL certificates with SSL client authentication?
|
||||
* Why does my browser give a warning about a mismatched hostname?
|
||||
* How do I install a CA certificate into a browser?
|
||||
* Why is OpenSSL x509 DN output not conformant to RFC2253?
|
||||
|
||||
[BUILD] Questions about building and testing OpenSSL
|
||||
|
||||
* Why does the linker complain about undefined symbols?
|
||||
* Why does the OpenSSL test fail with "bc: command not found"?
|
||||
* Why does the OpenSSL test fail with "bc: 1 no implemented"?
|
||||
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
|
||||
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
|
||||
* Why does the OpenSSL compilation fail with "ar: command not found"?
|
||||
* Why does the OpenSSL compilation fail on Win32 with VC++?
|
||||
|
||||
@@ -47,6 +51,8 @@ OpenSSL - Frequently Asked Questions
|
||||
* Why do I get errors about unknown algorithms?
|
||||
* Why can't the OpenSSH configure script detect OpenSSL?
|
||||
* Can I use OpenSSL's SSL library with non-blocking I/O?
|
||||
* Why doesn't my server application receive a client certificate?
|
||||
* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
|
||||
|
||||
===============================================================================
|
||||
|
||||
@@ -55,7 +61,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* Which is the current version of OpenSSL?
|
||||
|
||||
The current version is available from <URL: http://www.openssl.org>.
|
||||
OpenSSL 0.9.6 was released on September 24th, 2000.
|
||||
OpenSSL 0.9.6d was released on May 9, 2002.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
@@ -119,6 +125,12 @@ A number of Linux and *BSD distributions include OpenSSL.
|
||||
autoconf will probably be used in future OpenSSL versions. If it was
|
||||
less Unix-centric, it might have been used much earlier.
|
||||
|
||||
* What is an 'engine' version?
|
||||
|
||||
With version 0.9.6 OpenSSL was extended to interface to external crypto
|
||||
hardware. This was realized in a special release '0.9.6-engine'. With
|
||||
version 0.9.7 (not yet released) the changes were merged into the main
|
||||
development line, so that the special release is no longer necessary.
|
||||
|
||||
[LEGAL] =======================================================================
|
||||
|
||||
@@ -144,7 +156,7 @@ holders claim that you infringe on their rights if you use OpenSSL with
|
||||
their software on operating systems that don't normally include OpenSSL.
|
||||
|
||||
If you develop open source software that uses OpenSSL, you may find it
|
||||
useful to choose an other license than the GPL, or state explicitely that
|
||||
useful to choose an other license than the GPL, or state explicitly that
|
||||
"This program is released under the GPL with the additional exemption that
|
||||
compiling, linking, and/or using OpenSSL is allowed." If you are using
|
||||
GPL software developed by others, you may want to ask the copyright holder
|
||||
@@ -160,6 +172,7 @@ correctly. Many open source operating systems provide a "randomness
|
||||
device" that serves this purpose. On other systems, applications have
|
||||
to call the RAND_add() or RAND_seed() function with appropriate data
|
||||
before generating keys or performing public key encryption.
|
||||
(These functions initialize the pseudo-random number generator, PRNG.)
|
||||
|
||||
Some broken applications do not do this. As of version 0.9.5, the
|
||||
OpenSSL functions that need randomness report an error if the random
|
||||
@@ -169,18 +182,36 @@ application you are using. It is likely that it never worked
|
||||
correctly. OpenSSL 0.9.5 and later make the error visible by refusing
|
||||
to perform potentially insecure encryption.
|
||||
|
||||
On systems without /dev/urandom, it is a good idea to use the Entropy
|
||||
Gathering Demon; see the RAND_egd() manpage for details.
|
||||
On systems without /dev/urandom and /dev/random, it is a good idea to
|
||||
use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
|
||||
details. Starting with version 0.9.7, OpenSSL will automatically look
|
||||
for an EGD socket at /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool and
|
||||
/etc/entropy.
|
||||
|
||||
Most components of the openssl command line tool try to use the
|
||||
file $HOME/.rnd (or $RANDFILE, if this environment variable is set)
|
||||
for seeding the PRNG. If this file does not exist or is too short,
|
||||
the "PRNG not seeded" error message may occur.
|
||||
Most components of the openssl command line utility automatically try
|
||||
to seed the random number generator from a file. The name of the
|
||||
default seeding file is determined as follows: If environment variable
|
||||
RANDFILE is set, then it names the seeding file. Otherwise if
|
||||
environment variable HOME is set, then the seeding file is $HOME/.rnd.
|
||||
If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
|
||||
use file .rnd in the current directory while OpenSSL 0.9.6a uses no
|
||||
default seeding file at all. OpenSSL 0.9.6b and later will behave
|
||||
similarly to 0.9.6a, but will use a default of "C:\" for HOME on
|
||||
Windows systems if the environment variable has not been set.
|
||||
|
||||
[Note to OpenSSL 0.9.5 users: The command "openssl rsa" in version
|
||||
0.9.5 does not do this and will fail on systems without /dev/urandom
|
||||
when trying to password-encrypt an RSA key! This is a bug in the
|
||||
library; try a later version instead.]
|
||||
If the default seeding file does not exist or is too short, the "PRNG
|
||||
not seeded" error message may occur.
|
||||
|
||||
The openssl command line utility will write back a new state to the
|
||||
default seeding file (and create this file if necessary) unless
|
||||
there was no sufficient seeding.
|
||||
|
||||
Pointing $RANDFILE to an Entropy Gathering Daemon socket does not work.
|
||||
Use the "-rand" option of the OpenSSL command line tools instead.
|
||||
The $RANDFILE environment variable and $HOME/.rnd are only used by the
|
||||
OpenSSL command line tools. Applications using the OpenSSL library
|
||||
provide their own configuration options to specify the entropy source,
|
||||
please check out the documentation coming the with application.
|
||||
|
||||
For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
|
||||
installing the SUNski package from Sun patch 105710-01 (Sparc) which
|
||||
@@ -190,6 +221,18 @@ versions. However, be warned that /dev/random is usually a blocking
|
||||
device, which may have some effects on OpenSSL.
|
||||
|
||||
|
||||
* Why do I get an "unable to write 'random state'" error message?
|
||||
|
||||
|
||||
Sometimes the openssl command line utility does not abort with
|
||||
a "PRNG not seeded" error message, but complains that it is
|
||||
"unable to write 'random state'". This message refers to the
|
||||
default seeding file (see previous answer). A possible reason
|
||||
is that no default filename is known because neither RANDFILE
|
||||
nor HOME is set. (Versions up to 0.9.6 used file ".rnd" in the
|
||||
current directory in this case, but this has changed with 0.9.6a.)
|
||||
|
||||
|
||||
* How do I create certificates or certificate requests?
|
||||
|
||||
Check out the CA.pl(1) manual page. This provides a simple wrapper round
|
||||
@@ -264,7 +307,7 @@ there is little point presenting a certificate which the server will
|
||||
reject.
|
||||
|
||||
The solution is to add the relevant CA certificate to your servers "trusted
|
||||
CA list". How you do this depends on the server sofware in uses. You can
|
||||
CA list". How you do this depends on the server software in uses. You can
|
||||
print out the servers list of acceptable CAs using the OpenSSL s_client tool:
|
||||
|
||||
openssl s_client -connect www.some.host:443 -prexit
|
||||
@@ -283,6 +326,33 @@ Browsers expect the server's hostname to match the value in the commonName
|
||||
(CN) field of the certificate. If it does not then you get a warning.
|
||||
|
||||
|
||||
* How do I install a CA certificate into a browser?
|
||||
|
||||
The usual way is to send the DER encoded certificate to the browser as
|
||||
MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
|
||||
link. On MSIE certain extensions such as .der or .cacert may also work, or you
|
||||
can import the certificate using the certificate import wizard.
|
||||
|
||||
You can convert a certificate to DER form using the command:
|
||||
|
||||
openssl x509 -in ca.pem -outform DER -out ca.der
|
||||
|
||||
Occasionally someone suggests using a command such as:
|
||||
|
||||
openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
|
||||
|
||||
DO NOT DO THIS! This command will give away your CAs private key and
|
||||
reduces its security to zero: allowing anyone to forge certificates in
|
||||
whatever name they choose.
|
||||
|
||||
* Why is OpenSSL x509 DN output not conformant to RFC2253?
|
||||
|
||||
The ways to print out the oneline format of the DN (Distinguished Name) have
|
||||
been extended in version 0.9.7 of OpenSSL. Using the new X509_NAME_print_ex()
|
||||
interface, the "-nameopt" option could be introduded. See the manual
|
||||
page of the "openssl x509" commandline tool for details. The old behaviour
|
||||
has however been left as default for the sake of compatibility.
|
||||
|
||||
[BUILD] =======================================================================
|
||||
|
||||
* Why does the linker complain about undefined symbols?
|
||||
@@ -326,9 +396,9 @@ and compile/install it. GNU bc (see http://www.gnu.org/software/software.html
|
||||
for download instructions) can be safely used, for example.
|
||||
|
||||
|
||||
* Why does the OpenSSL compilation fail on Alpha True64 Unix?
|
||||
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
|
||||
|
||||
On some Alpha installations running True64 Unix and Compaq C, the compilation
|
||||
On some Alpha installations running Tru64 Unix and Compaq C, the compilation
|
||||
of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual
|
||||
memory to continue compilation.' As far as the tests have shown, this may be
|
||||
a compiler bug. What happens is that it eats up a lot of resident memory
|
||||
@@ -406,10 +476,43 @@ OpenSSL. This is described in the threads(3) manpage.
|
||||
|
||||
* I've compiled a program under Windows and it crashes: why?
|
||||
|
||||
This is usually because you've missed the comment in INSTALL.W32. You
|
||||
must link with the multithreaded DLL version of the VC++ runtime library
|
||||
otherwise the conflict will cause a program to crash: typically on the
|
||||
first BIO related read or write operation.
|
||||
This is usually because you've missed the comment in INSTALL.W32.
|
||||
Your application must link against the same version of the Win32
|
||||
C-Runtime against which your openssl libraries were linked. The
|
||||
default version for OpenSSL is /MD - "Multithreaded DLL".
|
||||
|
||||
If you are using Microsoft Visual C++'s IDE (Visual Studio), in
|
||||
many cases, your new project most likely defaulted to "Debug
|
||||
Singlethreaded" - /ML. This is NOT interchangeable with /MD and your
|
||||
program will crash, typically on the first BIO related read or write
|
||||
operation.
|
||||
|
||||
For each of the six possible link stage configurations within Win32,
|
||||
your application must link against the same by which OpenSSL was
|
||||
built. If you are using MS Visual C++ (Studio) this can be changed
|
||||
by:
|
||||
|
||||
1. Select Settings... from the Project Menu.
|
||||
2. Select the C/C++ Tab.
|
||||
3. Select "Code Generation from the "Category" drop down list box
|
||||
4. Select the Appropriate library (see table below) from the "Use
|
||||
run-time library" drop down list box. Perform this step for both
|
||||
your debug and release versions of your application (look at the
|
||||
top left of the settings panel to change between the two)
|
||||
|
||||
Single Threaded /ML - MS VC++ often defaults to
|
||||
this for the release
|
||||
version of a new project.
|
||||
Debug Single Threaded /MLd - MS VC++ often defaults to
|
||||
this for the debug version
|
||||
of a new project.
|
||||
Multithreaded /MT
|
||||
Debug Multithreaded /MTd
|
||||
Multithreaded DLL /MD - OpenSSL defaults to this.
|
||||
Debug Multithreaded DLL /MDd
|
||||
|
||||
Note that debug and release libraries are NOT interchangeable. If you
|
||||
built OpenSSL with /MD your application must use /MD and cannot use /MDd.
|
||||
|
||||
|
||||
* How do I read or write a DER encoded buffer using the ASN1 functions?
|
||||
@@ -490,44 +593,16 @@ OpenSSL_add_all_algorithms(). See the manual page for more information.
|
||||
|
||||
* Why can't the OpenSSH configure script detect OpenSSL?
|
||||
|
||||
There is a problem with OpenSSH 1.2.2p1, in that the configure script
|
||||
can't find the installed OpenSSL libraries. The problem is actually
|
||||
a small glitch that is easily solved with the following patch to be
|
||||
applied to the OpenSSH distribution:
|
||||
|
||||
----- snip:start -----
|
||||
--- openssh-1.2.2p1/configure.in.orig Thu Mar 23 18:56:58 2000
|
||||
+++ openssh-1.2.2p1/configure.in Thu Mar 23 18:55:05 2000
|
||||
@@ -152,10 +152,10 @@
|
||||
AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
|
||||
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
||||
if test ! -z "$ssldir" ; then
|
||||
- LIBS="$saved_LIBS -L$ssldir"
|
||||
+ LIBS="$saved_LIBS -L$ssldir/lib"
|
||||
CFLAGS="$CFLAGS -I$ssldir/include"
|
||||
if test "x$need_dash_r" = "x1" ; then
|
||||
- LIBS="$LIBS -R$ssldir"
|
||||
+ LIBS="$LIBS -R$ssldir/lib"
|
||||
fi
|
||||
fi
|
||||
LIBS="$LIBS -lcrypto"
|
||||
--- openssh-1.2.2p1/configure.orig Thu Mar 23 18:55:02 2000
|
||||
+++ openssh-1.2.2p1/configure Thu Mar 23 18:57:08 2000
|
||||
@@ -1890,10 +1890,10 @@
|
||||
echo "configure:1891: checking for OpenSSL/SSLeay directory" >&5
|
||||
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
||||
if test ! -z "$ssldir" ; then
|
||||
- LIBS="$saved_LIBS -L$ssldir"
|
||||
+ LIBS="$saved_LIBS -L$ssldir/lib"
|
||||
CFLAGS="$CFLAGS -I$ssldir/include"
|
||||
if test "x$need_dash_r" = "x1" ; then
|
||||
- LIBS="$LIBS -R$ssldir"
|
||||
+ LIBS="$LIBS -R$ssldir/lib"
|
||||
fi
|
||||
fi
|
||||
LIBS="$LIBS -lcrypto"
|
||||
----- snip:end -----
|
||||
Several reasons for problems with the automatic detection exist.
|
||||
OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
|
||||
Sometimes the distribution has installed an older version in the system
|
||||
locations that is detected instead of a new one installed. The OpenSSL
|
||||
library might have been compiled for another CPU or another mode (32/64 bits).
|
||||
Permissions might be wrong.
|
||||
|
||||
The general answer is to check the config.log file generated when running
|
||||
the OpenSSH configure script. It should contain the detailed information
|
||||
on why the OpenSSL library was not detected or considered incompatible.
|
||||
|
||||
* Can I use OpenSSL's SSL library with non-blocking I/O?
|
||||
|
||||
@@ -543,5 +618,20 @@ requiring a bi-directional message exchange; both SSL_read() and
|
||||
SSL_write() will try to continue any pending handshake.
|
||||
|
||||
|
||||
* Why doesn't my server application receive a client certificate?
|
||||
|
||||
Due to the TLS protocol definition, a client will only send a certificate,
|
||||
if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
|
||||
SSL_CTX_set_verify() function to enable the use of client certificates.
|
||||
|
||||
|
||||
* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
|
||||
|
||||
For OpenSSL 0.9.7 the OID table was extended and corrected. In earlier
|
||||
versions, uniqueIdentifier was incorrectly used for X.509 certificates.
|
||||
The correct name according to RFC2256 (LDAP) is x500UniqueIdentifier.
|
||||
Change your code to use the new name when compiling against OpenSSL 0.9.7.
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
||||
|
||||
23
INSTALL
23
INSTALL
@@ -2,13 +2,18 @@
|
||||
INSTALLATION ON THE UNIX PLATFORM
|
||||
---------------------------------
|
||||
|
||||
[Installation on Windows, OpenVMS and MacOS (before MacOS X) is described
|
||||
in INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.]
|
||||
[Installation on DOS (with djgpp), Windows, OpenVMS and MacOS (before MacOS X)
|
||||
is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.
|
||||
This document describes installation on operating systems in the Unix
|
||||
family.]
|
||||
|
||||
To install OpenSSL, you will need:
|
||||
|
||||
* make
|
||||
* Perl 5
|
||||
* an ANSI C compiler
|
||||
* a development environment in form of development libraries and C
|
||||
header files
|
||||
* a supported Unix operating system
|
||||
|
||||
Quick Start
|
||||
@@ -50,6 +55,15 @@
|
||||
This will usually require additional system-dependent options!
|
||||
See "Note on multi-threading" below.
|
||||
|
||||
no-zlib Don't try to build with support for zlib compression and
|
||||
decompression.
|
||||
|
||||
zlib Build with support for zlib compression/decompression.
|
||||
|
||||
zlib-dynamic Like "zlib", but has OpenSSL load the zlib library dynamically
|
||||
when needed. This is only supported on systems where loading
|
||||
of shared libraries is supported. This is the default choice.
|
||||
|
||||
no-shared Don't try to create shared libraries.
|
||||
|
||||
shared In addition to the usual static libraries, create shared
|
||||
@@ -266,6 +280,11 @@
|
||||
Note on shared libraries
|
||||
------------------------
|
||||
|
||||
Shared library is currently an experimental feature. The only reason to
|
||||
have them would be to conserve memory on systems where several program
|
||||
are using OpenSSL. Binary backward compatibility can't be guaranteed
|
||||
before OpenSSL version 1.0.
|
||||
|
||||
For some systems, the OpenSSL Configure script knows what is needed to
|
||||
build shared libraries for libcrypto and libssl. On these systems,
|
||||
the shared libraries are currently not created by default, but giving
|
||||
|
||||
32
INSTALL.DJGPP
Normal file
32
INSTALL.DJGPP
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
INSTALLATION ON THE DOS PLATFORM WITH DJGPP
|
||||
-------------------------------------------
|
||||
|
||||
Openssl has been ported to DOS, but only with long filename support. If
|
||||
you wish to compile on native DOS with 8+3 filenames, you will have to
|
||||
tweak the installation yourself, including renaming files with illegal
|
||||
or duplicate names.
|
||||
|
||||
You should have a full DJGPP environment installed, including the
|
||||
latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package
|
||||
requires that PERL and BC also be installed.
|
||||
|
||||
All of these can be obtained from the usual DJGPP mirror sites, such as
|
||||
"ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp". You also need to have
|
||||
the WATT-32 networking package installed before you try to compile
|
||||
openssl. This can be obtained from "http://www.bgnett.no/~giva/". The
|
||||
Makefile assumes that the WATT-32 code is in directory "watt32" under
|
||||
/dev/env/DJDIR.
|
||||
|
||||
To compile openssl, start your BASH shell. Then configure for DOS by
|
||||
running "./Configure" with appropriate arguments. The basic syntax for
|
||||
DOS is:
|
||||
./Configure no-threads --prefix=/dev/env/DJDIR DJGPP
|
||||
|
||||
You may run out of DPMI selectors when running in a DOS box under
|
||||
Windows. If so, just close the BASH shell, go back to Windows, and
|
||||
restart BASH. Then run "make" again.
|
||||
|
||||
Building openssl under DJGPP has been tested with DJGPP 2.03,
|
||||
GCC 2.952, GCC 2.953, perl 5.005_02 and perl 5.006_01.
|
||||
@@ -1,7 +1,7 @@
|
||||
OpenSSL - Port To The Macintosh
|
||||
===============================
|
||||
OpenSSL - Port To The Macintosh OS 9 or Earlier
|
||||
===============================================
|
||||
|
||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for MacOS (pre
|
||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for Mac OS (pre
|
||||
X) is now provided. "Initial" means that unlike other platforms where you
|
||||
get an SDK and a "swiss army" openssl application, on Macintosh you only
|
||||
get one sample application which fetches a page over HTTPS(*) and dumps it
|
||||
|
||||
22
INSTALL.OS2
Normal file
22
INSTALL.OS2
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
Installation on OS/2
|
||||
--------------------
|
||||
|
||||
You need to have the following tools installed:
|
||||
|
||||
* EMX GCC
|
||||
* PERL
|
||||
* GNU make
|
||||
|
||||
|
||||
To build the makefile, run
|
||||
|
||||
> os2\os2-emx
|
||||
|
||||
This will configure OpenSSL and create OS2-EMX.mak which you then use to
|
||||
build the OpenSSL libraries & programs by running
|
||||
|
||||
> make -f os2-emx.mak
|
||||
|
||||
If that finishes successfully you will find the libraries and programs in the
|
||||
"out" directory.
|
||||
22
INSTALL.VMS
22
INSTALL.VMS
@@ -8,6 +8,7 @@ Intro:
|
||||
|
||||
This file is divided in the following parts:
|
||||
|
||||
Requirements - Mandatory reading.
|
||||
Checking the distribution - Mandatory reading.
|
||||
Compilation - Mandatory reading.
|
||||
Logical names - Mandatory reading.
|
||||
@@ -19,15 +20,24 @@ This file is divided in the following parts:
|
||||
TODO - Things that are to come.
|
||||
|
||||
|
||||
Requirements:
|
||||
=============
|
||||
|
||||
To build and install OpenSSL, you will need:
|
||||
|
||||
* DEC C or some other ANSI C compiler. VAX C is *not* supported.
|
||||
[Note: OpenSSL has only been tested with DEC C. Compiling with
|
||||
a different ANSI C compiler may require some work]
|
||||
|
||||
Checking the distribution:
|
||||
==========================
|
||||
|
||||
There have been reports of places where the distribution didn't quite get
|
||||
through, for example if you've copied the tree from a NFS-mounted unix
|
||||
through, for example if you've copied the tree from a NFS-mounted Unix
|
||||
mount point.
|
||||
|
||||
The easiest way to check if everything got through as it should is to check
|
||||
for oen of the following files:
|
||||
for one of the following files:
|
||||
|
||||
[.CRYPTO]OPENSSLCONF.H_IN
|
||||
[.CRYPTO]OPENSSLCONF_H.IN
|
||||
@@ -59,7 +69,7 @@ for a command procedure name xxx-LIB.COM (in the library directories)
|
||||
or MAKExxx.COM (in the program directories) and read the comments at
|
||||
the top to understand how to use them. However, if you want to
|
||||
compile all you can get, the simplest is to use MAKEVMS.COM in the top
|
||||
directory. The syntax is trhe following:
|
||||
directory. The syntax is the following:
|
||||
|
||||
@MAKEVMS <option> <rsaref-p> <debug-p> [<compiler>]
|
||||
|
||||
@@ -69,7 +79,7 @@ directory. The syntax is trhe following:
|
||||
CONFIG Just build the "[.CRYPTO]OPENSSLCONF.H" file.
|
||||
BUILDINF Just build the "[.INCLUDE]BUILDINF.H" file.
|
||||
SOFTLINKS Just copies some files, to simulate Unix soft links.
|
||||
BUILDALL Same as ALL, except CONFIG, BUILDINF and SOFTILNKS aren't done.
|
||||
BUILDALL Same as ALL, except CONFIG, BUILDINF and SOFTLINKS aren't done.
|
||||
RSAREF Just build the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" library.
|
||||
CRYPTO Just build the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library.
|
||||
SSL Just build the "[.xxx.EXE.SSL]LIBSSL.OLB" library.
|
||||
@@ -82,7 +92,7 @@ directory. The syntax is trhe following:
|
||||
RSAREF compile using the RSAREF Library
|
||||
NORSAREF compile without using RSAREF
|
||||
|
||||
Note 0: The RASREF library IS NO LONGER NEEDED. The RSA patent
|
||||
Note 0: The RSAREF library IS NO LONGER NEEDED. The RSA patent
|
||||
expires September 20, 2000, and RSA Security chose to make
|
||||
the algorithm public domain two weeks before that.
|
||||
|
||||
@@ -254,7 +264,7 @@ following before you start compiling:
|
||||
The USER_CCDISABLEWARNINGS is there because otherwise, DEC C will complain
|
||||
that those macros have been changed.
|
||||
|
||||
Note: Currently, this is only usefull for library compilation. The
|
||||
Note: Currently, this is only useful for library compilation. The
|
||||
programs will still be linked with the current version of the
|
||||
C library shareable image, and will thus complain if they are
|
||||
faced with an older version of the same C library shareable image.
|
||||
|
||||
60
INSTALL.W32
60
INSTALL.W32
@@ -2,16 +2,19 @@
|
||||
INSTALLATION ON THE WIN32 PLATFORM
|
||||
----------------------------------
|
||||
|
||||
Heres a few comments about building OpenSSL in Windows environments. Most of
|
||||
this is tested on Win32 but it may also work in Win 3.1 with some
|
||||
Heres a few comments about building OpenSSL in Windows environments. Most
|
||||
of this is tested on Win32 but it may also work in Win 3.1 with some
|
||||
modification.
|
||||
|
||||
You need Perl for Win32 (available from http://www.activestate.com/ActivePerl)
|
||||
You need Perl for Win32. Unless you will build on Cygwin, you will need
|
||||
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
|
||||
For Cygwin users, there's more info in the Cygwin section.
|
||||
|
||||
and one of the following C compilers:
|
||||
|
||||
* Visual C++
|
||||
* Borland C
|
||||
* GNU C (Mingw32 or Cygwin32)
|
||||
* GNU C (Mingw32 or Cygwin)
|
||||
|
||||
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
|
||||
@@ -78,7 +81,7 @@
|
||||
|
||||
There are various changes you can make to the Win32 compile environment. By
|
||||
default the library is not compiled with debugging symbols. If you add 'debug'
|
||||
to the mk1mk.pl lines in the do_* batch file then debugging symbols will be
|
||||
to the mk1mf.pl lines in the do_* batch file then debugging symbols will be
|
||||
compiled in.
|
||||
|
||||
The default Win32 environment is to leave out any Windows NT specific
|
||||
@@ -109,10 +112,10 @@
|
||||
* Compiler installation:
|
||||
|
||||
Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/
|
||||
gnu-win32/mingw32/gcc-2.95.2/gcc-2.95.2-msvcrt.exe>. GNU make is at
|
||||
<ftp://agnes.dida.physik.uni-essen.de/home/janjaap/mingw32/binaries/
|
||||
make-3.76.1.zip>. Install both of them in C:\egcs-1.1.2 and run
|
||||
C:\egcs-1.1.2\mingw32.bat to set the PATH.
|
||||
gnu-win32/mingw32/gcc-2.95.2/gcc-2.95.2-msvcrt.exe>. Extract it
|
||||
to a directory such as C:\gcc-2.95.2 and add c:\gcc-2.95.2\bin to
|
||||
the PATH environment variable in "System Properties"; or edit and
|
||||
run C:\gcc-2.95.2\mingw32.bat to set the PATH.
|
||||
|
||||
* Compile OpenSSL:
|
||||
|
||||
@@ -134,28 +137,30 @@
|
||||
> cd out
|
||||
> ..\ms\test
|
||||
|
||||
GNU C (CygWin32)
|
||||
---------------
|
||||
GNU C (Cygwin)
|
||||
--------------
|
||||
|
||||
CygWin32 provides a bash shell and GNU tools environment running on
|
||||
Cygwin provides a bash shell and GNU tools environment running on
|
||||
NT 4.0, Windows 9x and Windows 2000. Consequently, a make of OpenSSL
|
||||
with CygWin is closer to a GNU bash environment such as Linux rather
|
||||
with Cygwin is closer to a GNU bash environment such as Linux rather
|
||||
than other W32 makes that are based on a single makefile approach.
|
||||
CygWin32 implements Posix/Unix calls through cygwin1.dll, and is
|
||||
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 CygWin32:
|
||||
To build OpenSSL using Cygwin:
|
||||
|
||||
* Install CygWin32 (see http://sourceware.cygnus.com/cygwin)
|
||||
* Install Cygwin (see http://sourceware.cygnus.com/cygwin)
|
||||
|
||||
* Install Perl and ensure it is in the path
|
||||
* 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
|
||||
* Run the Cygwin bash shell
|
||||
|
||||
* $ tar zxvf openssl-x.x.x.tar.gz
|
||||
$ cd openssl-x.x.x
|
||||
$ ./Configure no-threads CygWin32
|
||||
$ ./config
|
||||
[...]
|
||||
$ make
|
||||
[...]
|
||||
@@ -164,27 +169,28 @@
|
||||
|
||||
This will create a default install in /usr/local/ssl.
|
||||
|
||||
CygWin32 Notes:
|
||||
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
|
||||
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
|
||||
stripping of carriage returns. To avoid this ensure that a binary
|
||||
mount is used, e.g. mount -b c:\somewhere /home.
|
||||
|
||||
As of version 1.1.1 CygWin32 is relatively unstable in its handling
|
||||
As of version 1.1.1 Cygwin is relatively unstable in its handling
|
||||
of cr/lf issues. These make procedures succeeded with versions 1.1 and
|
||||
the snapshot 20000524 (Slow!).
|
||||
|
||||
"bc" is not provided in the CygWin32 distribution. This causes a
|
||||
"bc" is not provided in the Cygwin distribution. This causes a
|
||||
non-fatal error in "make test" but is otherwise harmless. If
|
||||
desired, GNU bc can be built with CygWin32 without change.
|
||||
desired, GNU bc can be built with Cygwin without change.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
There's currently no real installation procedure for Win32. There are,
|
||||
however, some suggestions:
|
||||
If you used the Cygwin procedure above, you have already installed and
|
||||
can skip this section. For all other procedures, there's currently no real
|
||||
installation procedure for Win32. There are, however, some suggestions:
|
||||
|
||||
- do nothing. The include files are found in the inc32/ subdirectory,
|
||||
all binaries are found in out32dll/ or out32/ depending if you built
|
||||
@@ -256,5 +262,5 @@
|
||||
malloc(), free() and realloc() as the application. However there are many
|
||||
standard library functions used by OpenSSL that call malloc() internally
|
||||
(e.g. fopen()), and OpenSSL cannot change these; so in general you cannot
|
||||
rely on CYRPTO_malloc_init() solving your problem, and you should
|
||||
rely on CRYPTO_malloc_init() solving your problem, and you should
|
||||
consistently use the multithreaded library.
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
347
Makefile.org
347
Makefile.org
@@ -56,8 +56,9 @@ CC= gcc
|
||||
#CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
|
||||
CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
|
||||
DEPFLAG=
|
||||
PEX_LIBS= -L. -L.. -L../.. -L../../..
|
||||
PEX_LIBS=
|
||||
EX_LIBS=
|
||||
EXE_EXT=
|
||||
AR=ar r
|
||||
RANLIB= ranlib
|
||||
PERL= perl
|
||||
@@ -165,9 +166,9 @@ SHLIBDIRS= crypto ssl
|
||||
SDIRS= \
|
||||
md2 md4 md5 sha mdc2 hmac ripemd \
|
||||
des rc2 rc4 rc5 idea bf cast \
|
||||
bn ec rsa dsa dh dso engine rijndael \
|
||||
bn ec rsa dsa dh dso engine aes \
|
||||
buffer bio stack lhash rand err objects \
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
|
||||
|
||||
# tests to perform. "alltests" is a special word indicating that all tests
|
||||
# should be performed.
|
||||
@@ -190,6 +191,7 @@ SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
|
||||
SHARED_SSL=libssl$(SHLIB_EXT)
|
||||
SHARED_LIBS=
|
||||
SHARED_LIBS_LINK_EXTS=
|
||||
SHARED_LDFLAGS=
|
||||
|
||||
GENERAL= Makefile
|
||||
BASENAME= openssl
|
||||
@@ -202,23 +204,18 @@ HEADER= e_os.h
|
||||
# When we're prepared to use shared libraries in the programs we link here
|
||||
# we might remove 'clean-shared' from the targets to perform at this stage
|
||||
|
||||
all: clean-shared Makefile.ssl sub_all
|
||||
all: Makefile.ssl sub_all
|
||||
|
||||
sub_all:
|
||||
@for i in $(DIRS); \
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(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}' all ) || 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}' 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 \
|
||||
$(MAKE) $$i; \
|
||||
fi; \
|
||||
done; \
|
||||
if echo "$(DIRS)" | \
|
||||
egrep '(^| )(crypto|ssl)( |$$)' > /dev/null 2>&1 && \
|
||||
[ -n "$(SHARED_LIBS)" ]; then \
|
||||
$(MAKE) $(SHARED_LIBS); \
|
||||
fi
|
||||
done;
|
||||
|
||||
libcrypto$(SHLIB_EXT): libcrypto.a
|
||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||
@@ -226,9 +223,10 @@ libcrypto$(SHLIB_EXT): libcrypto.a
|
||||
else \
|
||||
echo "There's no support for shared libraries on this platform" >&2; \
|
||||
fi
|
||||
|
||||
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
|
||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||
$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-L. -lcrypto' build-shared; \
|
||||
$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
|
||||
else \
|
||||
echo "There's no support for shared libraries on this platform" >&2; \
|
||||
fi
|
||||
@@ -242,58 +240,181 @@ clean-shared:
|
||||
done; \
|
||||
fi; \
|
||||
( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
|
||||
done
|
||||
|
||||
link-shared:
|
||||
@for i in $(SHLIBDIRS); do \
|
||||
prev=lib$$i$(SHLIB_EXT); \
|
||||
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
||||
tmp="$(SHARED_LIBS_LINK_EXTS)"; \
|
||||
for j in $${tmp:-x}; do \
|
||||
( set -x; ln -s -f $$prev lib$$i$$j ); \
|
||||
prev=lib$$i$$j; \
|
||||
done; \
|
||||
if [ "$(PLATFORM)" = "Cygwin" ]; then \
|
||||
( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
|
||||
fi; \
|
||||
done
|
||||
|
||||
link-shared:
|
||||
@if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
||||
tmp="$(SHARED_LIBS_LINK_EXTS)"; \
|
||||
for i in $(SHLIBDIRS); do \
|
||||
prev=lib$$i$(SHLIB_EXT); \
|
||||
for j in $${tmp:-x}; do \
|
||||
( set -x; ln -f -s $$prev lib$$i$$j ); \
|
||||
prev=lib$$i$$j; \
|
||||
done; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
build-shared: clean-shared do_$(SHLIB_TARGET) link-shared
|
||||
|
||||
do_bsd-gcc-shared: linux-shared
|
||||
do_linux-shared:
|
||||
libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-S,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
do_bsd-gcc-shared: do_gnu-shared
|
||||
do_linux-shared: do_gnu-shared
|
||||
do_gnu-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-Bsymbolic \
|
||||
-Wl,--whole-archive lib$$i.a \
|
||||
-Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -L. -l$$i"; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
|
||||
collect2=`gcc -print-prog-name=collect2 2>&1` && \
|
||||
[ -n "$$collect2" ] && \
|
||||
my_ld=`$$collect2 --help 2>&1 | grep Usage: | sed 's/^Usage: *\([^ ][^ ]*\).*/\1/'` && \
|
||||
[ -n "$$my_ld" ] && \
|
||||
$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
|
||||
|
||||
# For Darwin AKA Mac OS/X (dyld)
|
||||
do_darwin-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x ; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
|
||||
lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
|
||||
-install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
|
||||
libs="$$libs -l`basename $$i${SHLIB_EXT} .dylib`"; \
|
||||
echo "" ; \
|
||||
done
|
||||
|
||||
do_cygwin-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} -shared -o cyg$$i.dll \
|
||||
-Wl,-Bsymbolic \
|
||||
-Wl,--whole-archive lib$$i.a \
|
||||
-Wl,--out-implib,lib$$i.dll.a \
|
||||
-Wl,--no-whole-archive $$libs ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_alpha-osf1-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
|
||||
# option passed to the linker.
|
||||
do_tru64-shared:
|
||||
libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} -shared -no_archive -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -L. -l$$i"; \
|
||||
done
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -msym -o lib$$i.so \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
# The difference between tru64-shared and tru64-shared-rpath is the
|
||||
# -rpath ${INSTALLTOP}/lib passed to the linker.
|
||||
do_tru64-shared-rpath:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -msym -o lib$$i.so \
|
||||
-rpath ${INSTALLTOP}/lib \
|
||||
-set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
|
||||
-all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_solaris-shared:
|
||||
libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -L. -l$$i"; \
|
||||
done
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# OpenServer 5 native compilers used
|
||||
do_svr3-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
find . -name "*.o" -print > allobjs ; \
|
||||
OBJS= ; export OBJS ; \
|
||||
for obj in `ar t lib$$i.a` ; do \
|
||||
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# UnixWare 7 and OpenUNIX 8 native compilers used
|
||||
do_svr5-shared:
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
find . -name "*.o" -print > allobjs ; \
|
||||
OBJS= ; export OBJS ; \
|
||||
for obj in `ar t lib$$i.a` ; do \
|
||||
OBJS="$${OBJS} `grep $$obj allobjs`" ; \
|
||||
done ; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
$${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
do_irix-shared:
|
||||
libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
|
||||
libs="$$libs -L. -l$$i"; \
|
||||
done
|
||||
if ${DETECT_GNU_LD}; then \
|
||||
$(MAKE) do_gnu-shared; \
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# This assumes that GNU utilities are *not* used
|
||||
# HP-UX includes the full pathname of libs we depend on, so we would get
|
||||
@@ -308,7 +429,8 @@ do_irix-shared:
|
||||
#
|
||||
do_hpux-shared:
|
||||
for i in ${SHLIBDIRS}; do \
|
||||
( set -x; /usr/ccs/bin/ld +vnocompatwarnings \
|
||||
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
|
||||
+vnocompatwarnings \
|
||||
-b -z +s \
|
||||
-o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
@@ -326,12 +448,70 @@ do_hpux-shared:
|
||||
#
|
||||
do_hpux64-shared:
|
||||
for i in ${SHLIBDIRS}; do \
|
||||
( set -x; /usr/ccs/bin/ld -b -z \
|
||||
( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
|
||||
-b -z \
|
||||
-o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
+h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
+forceload lib$$i.a -ldl -lc ) || exit 1; \
|
||||
done
|
||||
|
||||
# The following method is said to work on all platforms. Tests will
|
||||
# determine if that's how it's gong to be used.
|
||||
# This assumes that for all but GNU systems, GNU utilities are *not* used.
|
||||
# ALLSYMSFLAGS would be:
|
||||
# GNU systems: --whole-archive
|
||||
# Tru64 Unix: -all
|
||||
# Solaris: -z allextract
|
||||
# Irix: -all
|
||||
# HP/UX-32bit: -Fl
|
||||
# HP/UX-64bit: +forceload
|
||||
# AIX: -bnogc
|
||||
# SHAREDFLAGS would be:
|
||||
# GNU systems: -shared -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# Tru64 Unix: -shared \
|
||||
# -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}"
|
||||
# Solaris: -G -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# Irix: -shared -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# HP/UX-32bit: +vnocompatwarnings -b -z +s \
|
||||
# +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# HP/UX-64bit: -b -z +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
||||
# AIX: -G -bE:lib$$i.exp -bM:SRE
|
||||
# SHAREDCMD would be:
|
||||
# GNU systems: $(CC)
|
||||
# Tru64 Unix: $(CC)
|
||||
# Solaris: $(CC)
|
||||
# Irix: $(CC)
|
||||
# HP/UX-32bit: /usr/ccs/bin/ld
|
||||
# HP/UX-64bit: /usr/ccs/bin/ld
|
||||
# AIX: $(CC)
|
||||
ALLSYMSFLAG=-bnogc
|
||||
SHAREDFLAGS=${SHARED_LDFLAGS} -G -bE:lib$$i.exp -bM:SRE
|
||||
SHAREDCMD=$(CC)
|
||||
do_aix-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( set -x; \
|
||||
ld -r -o $$i.o $(ALLSYMSFLAG) lib$$i.a && \
|
||||
( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
|
||||
$(SHAREDCMD) $(SHAREDFLAG) -o lib$$i.so lib$$i.o \
|
||||
$$libs ${EX_LIBS} ) ) \
|
||||
|| exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
do_reliantunix-shared:
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
tmpdir=/tmp/openssl.$$$$ ; rm -rf $$tmpdir ; \
|
||||
( set -x; \
|
||||
( Opwd=`pwd` ; mkdir $$tmpdir || exit 1; \
|
||||
cd $$tmpdir || exit 1 ; ar x $$Opwd/lib$$i.a ; \
|
||||
${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
|
||||
) || exit 1; \
|
||||
cp $$tmpdir/lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} . ; \
|
||||
) || exit 1; \
|
||||
rm -rf $$tmpdir ; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
Makefile.ssl: Makefile.org
|
||||
@echo "Makefile.ssl is older than Makefile.org."
|
||||
@echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
|
||||
@@ -394,15 +574,21 @@ dclean:
|
||||
|
||||
rehash: rehash.time
|
||||
rehash.time: certs
|
||||
@(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; export OPENSSL OPENSSL_DEBUG_MEMORY; $(PERL) tools/c_rehash certs)
|
||||
@(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
|
||||
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
||||
LD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
||||
export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \
|
||||
$(PERL) tools/c_rehash certs)
|
||||
touch rehash.time
|
||||
|
||||
test: tests
|
||||
|
||||
tests: rehash
|
||||
@(cd test && echo "testing..." && \
|
||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' OPENSSL_DEBUG_MEMORY=on tests );
|
||||
@apps/openssl version -a
|
||||
$(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`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
||||
export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \
|
||||
apps/openssl version -a
|
||||
|
||||
report:
|
||||
@$(PERL) util/selftest.pl
|
||||
@@ -412,7 +598,7 @@ depend:
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(cd $$i && echo "making dependencies $$i..." && \
|
||||
$(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' depend ) || exit 1; \
|
||||
$(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
|
||||
fi; \
|
||||
done;
|
||||
|
||||
@@ -436,6 +622,7 @@ tags:
|
||||
|
||||
errors:
|
||||
$(PERL) util/mkerr.pl -recurse -write
|
||||
(cd crypto/engine; $(MAKE) PERL=$(PERL) errors)
|
||||
|
||||
stacks:
|
||||
$(PERL) util/mkstack.pl -write
|
||||
@@ -457,18 +644,24 @@ TABLE: Configure
|
||||
|
||||
update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
|
||||
|
||||
# Build distribution tar-file. As the list of files returned by "find" is
|
||||
# pretty long, on several platforms a "too many arguments" error or similar
|
||||
# would occur. Therefore the list of files is temporarily stored into a file
|
||||
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
|
||||
# tar does not support the --files-from option.
|
||||
tar:
|
||||
@$(TAR) $(TARFLAGS) -cvf - \
|
||||
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort` |\
|
||||
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
|
||||
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
|
||||
tardy --user_number=0 --user_name=openssl \
|
||||
--group_number=0 --group_name=openssl \
|
||||
--prefix=openssl-$(VERSION) - |\
|
||||
gzip --best >../$(TARFILE).gz; \
|
||||
rm -f ../$(TARFILE).list; \
|
||||
ls -l ../$(TARFILE).gz
|
||||
|
||||
tar-snap:
|
||||
@$(TAR) $(TARFLAGS) -cvf - \
|
||||
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' | sort` |\
|
||||
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
|
||||
tardy --user_number=0 --user_name=openssl \
|
||||
--group_number=0 --group_name=openssl \
|
||||
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
|
||||
@@ -478,7 +671,7 @@ dist:
|
||||
$(PERL) Configure dist
|
||||
@$(MAKE) dist_pem_h
|
||||
@$(MAKE) SDIRS='${SDIRS}' clean
|
||||
@$(MAKE) tar
|
||||
@$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
|
||||
|
||||
dist_pem_h:
|
||||
(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
|
||||
@@ -500,7 +693,7 @@ install: all install_docs
|
||||
do \
|
||||
if [ -d "$$i" ]; then \
|
||||
(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}' 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}' install ); \
|
||||
fi; \
|
||||
done
|
||||
@for i in $(LIBS) ;\
|
||||
@@ -510,17 +703,25 @@ install: all install_docs
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi \
|
||||
done
|
||||
fi; \
|
||||
done;
|
||||
@if [ -n "$(SHARED_LIBS)" ]; then \
|
||||
tmp="$(SHARED_LIBS)"; \
|
||||
for i in $${tmp:-x}; \
|
||||
do \
|
||||
if [ -f "$$i" ]; then \
|
||||
if [ -f "$$i" -o -f "$$i.a" ]; then \
|
||||
( echo installing $$i; \
|
||||
cp -f $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi \
|
||||
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
else \
|
||||
c=`echo $$i | sed 's/^lib/cyg/'`; \
|
||||
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||
fi ); \
|
||||
fi; \
|
||||
done; \
|
||||
( here="`pwd`"; \
|
||||
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||
@@ -535,20 +736,22 @@ install_docs:
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man7
|
||||
@for i in doc/apps/*.pod; do \
|
||||
fn=`basename $$i .pod`; \
|
||||
sec=`[ "$$fn" = "config" ] && echo 5 || echo 1`; \
|
||||
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
|
||||
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
|
||||
(cd `dirname $$i`; \
|
||||
$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i`) \
|
||||
(cd `$(PERL) util/dirname.pl $$i`; \
|
||||
sh -c "`cd ../../util; ./pod2mantest ignore` \
|
||||
--section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i`") \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
|
||||
done
|
||||
@for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
||||
fn=`basename $$i .pod`; \
|
||||
sec=`[ "$$fn" = "des_modes" ] && echo 7 || echo 3`; \
|
||||
if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
|
||||
echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
|
||||
(cd `dirname $$i`; \
|
||||
$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i`) \
|
||||
(cd `$(PERL) util/dirname.pl $$i`; \
|
||||
sh -c "`cd ../../util; ./pod2mantest ignore` \
|
||||
--section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i`") \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
|
||||
done
|
||||
|
||||
|
||||
98
NEWS
98
NEWS
@@ -8,7 +8,98 @@
|
||||
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7:
|
||||
|
||||
o New library section OCSP.
|
||||
o Complete haul-over of the ASN.1 library section.
|
||||
o Complete rewrite of ASN1 code.
|
||||
o CRL checking in verify code and openssl utility.
|
||||
o Extension copying in 'ca' utility.
|
||||
o Flexible display options in 'ca' utility.
|
||||
o Provisional support for international characters with UTF8.
|
||||
o Support for external crypto devices ('engine') is no longer
|
||||
a separate distribution.
|
||||
o New elliptic curve library section.
|
||||
o New AES (Rijndael) library section.
|
||||
o Change DES API to clean up the namespace (some applications link also
|
||||
against libdes providing similar functions having the same name).
|
||||
Provide macros for backward compatibility (will be removed in the
|
||||
future).
|
||||
o Unifiy handling of cryptographic algorithms (software and
|
||||
engine) to be available via EVP routines for asymmetric and
|
||||
symmetric ciphers.
|
||||
o NCONF: new configuration handling routines.
|
||||
o Change API to use more 'const' modifiers to improve error checking
|
||||
and help optimizers.
|
||||
o Finally remove references to RSAref.
|
||||
o Reworked parts of the BIGNUM code.
|
||||
o Support for new engines: Broadcom ubsec, Accelerated Encryption
|
||||
Processing, IBM 4758.
|
||||
o Extended and corrected OID (object identifier) table.
|
||||
o PRNG: query at more locations for a random device, automatic query for
|
||||
EGD style random sources at several locations.
|
||||
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: support Kerberos cipher suites (RFC2712).
|
||||
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 draft AES ciphersuites (disabled unless explicitly requested).
|
||||
|
||||
Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
|
||||
|
||||
o Various SSL/TLS library bugfixes.
|
||||
o Fix DH parameter generation for 'non-standard' generators.
|
||||
|
||||
Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
|
||||
|
||||
o Various SSL/TLS library bugfixes.
|
||||
o BIGNUM library fixes.
|
||||
o RSA OAEP and random number generation fixes.
|
||||
o Object identifiers corrected and added.
|
||||
o Add assembler BN routines for IA64.
|
||||
o Add support for OS/390 Unix, UnixWare with gcc, OpenUNIX 8,
|
||||
MIPS Linux; shared library support for Irix, HP-UX.
|
||||
o Add crypto accelerator support for AEP, Baltimore SureWare,
|
||||
Broadcom and Cryptographic Appliance's keyserver
|
||||
[in 0.9.6c-engine release].
|
||||
|
||||
Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
|
||||
|
||||
o Security fix: PRNG improvements.
|
||||
o Security fix: RSA OAEP check.
|
||||
o Security fix: Reinsert and fix countermeasure to Bleichbacher's
|
||||
attack.
|
||||
o MIPS bug fix in BIGNUM.
|
||||
o Bug fix in "openssl enc".
|
||||
o Bug fix in X.509 printing routine.
|
||||
o Bug fix in DSA verification routine and DSA S/MIME verification.
|
||||
o Bug fix to make PRNG thread-safe.
|
||||
o Bug fix in RAND_file_name().
|
||||
o Bug fix in compatibility mode trust settings.
|
||||
o Bug fix in blowfish EVP.
|
||||
o Increase default size for BIO buffering filter.
|
||||
o Compatibility fixes in some scripts.
|
||||
|
||||
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a:
|
||||
|
||||
o Security fix: change behavior of OpenSSL to avoid using
|
||||
environment variables when running as root.
|
||||
o Security fix: check the result of RSA-CRT to reduce the
|
||||
possibility of deducing the private key from an incorrectly
|
||||
calculated signature.
|
||||
o Security fix: prevent Bleichenbacher's DSA attack.
|
||||
o Security fix: Zero the premaster secret after deriving the
|
||||
master secret in DH ciphersuites.
|
||||
o Reimplement SSL_peek(), which had various problems.
|
||||
o Compatibility fix: the function des_encrypt() renamed to
|
||||
des_encrypt1() to avoid clashes with some Unixen libc.
|
||||
o Bug fixes for Win32, HP/UX and Irix.
|
||||
o Bug fixes in BIGNUM, SSL, PKCS#7, PKCS#12, X.509, CONF and
|
||||
memory checking routines.
|
||||
o Bug fixes for RSA operations in threaded enviroments.
|
||||
o Bug fixes in misc. openssl applications.
|
||||
o Remove a few potential memory leaks.
|
||||
o Add tighter checks of BIGNUM routines.
|
||||
o Shared library support has been reworked for generality.
|
||||
o More documentation.
|
||||
o New function BN_rand_range().
|
||||
o Add "-rand" option to openssl s_client and s_server.
|
||||
|
||||
Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6:
|
||||
|
||||
@@ -19,9 +110,12 @@
|
||||
o New 'rsautl' application, low level RSA utility.
|
||||
o MD4 now included.
|
||||
o Bugfix for SSL rollback padding check.
|
||||
o Support for external crypto devices.
|
||||
o Support for external crypto devices [1].
|
||||
o Enhanced EVP interface.
|
||||
|
||||
[1] The support for external crypto devices is currently a separate
|
||||
distribution. See the file README.ENGINE.
|
||||
|
||||
Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a:
|
||||
|
||||
o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8
|
||||
|
||||
8
README
8
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 0.9.7-dev 24 Sep 2000
|
||||
OpenSSL 0.9.7-beta2 16 Jun 2002
|
||||
|
||||
Copyright (c) 1998-2000 The OpenSSL Project
|
||||
Copyright (c) 1998-2002 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
X.509v3 certificates
|
||||
X509 encoding/decoding into/from binary ASN1 and a PEM
|
||||
based ascii-binary encoding which supports encryption with a
|
||||
based ASCII-binary encoding which supports encryption with a
|
||||
private key. Program to generate RSA and DSA certificate
|
||||
requests and to generate RSA and DSA certificates.
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
locations around the world. _YOU_ are responsible for ensuring that your use
|
||||
of any algorithms is legal by checking if there are any patents in your
|
||||
country. The file contains some of the patents that we know about or are
|
||||
rumoured to exist. This is not a definitive list.
|
||||
rumored to exist. This is not a definitive list.
|
||||
|
||||
RSA Security holds software patents on the RC5 algorithm. If you
|
||||
intend to use this cipher, you must contact RSA Security for
|
||||
|
||||
290
README.ENGINE
290
README.ENGINE
@@ -1,43 +1,289 @@
|
||||
|
||||
ENGINE
|
||||
======
|
||||
|
||||
With OpenSSL 0.9.6, a new component has been added to support external
|
||||
crypto devices, for example accelerator cards. The component is called
|
||||
ENGINE, and has still a pretty experimental status and almost no
|
||||
documentation. It's designed to be faily easily extensible by the
|
||||
calling programs.
|
||||
With OpenSSL 0.9.6, a new component was added to support alternative
|
||||
cryptography implementations, most commonly for interfacing with external
|
||||
crypto devices (eg. accelerator cards). This component is called ENGINE,
|
||||
and its presence in OpenSSL 0.9.6 (and subsequent bug-fix releases)
|
||||
caused a little confusion as 0.9.6** releases were rolled in two
|
||||
versions, a "standard" and an "engine" version. In development for 0.9.7,
|
||||
the ENGINE code has been merged into the main branch and will be present
|
||||
in the standard releases from 0.9.7 forwards.
|
||||
|
||||
There's currently built-in support for the following crypto devices:
|
||||
There are currently built-in ENGINE implementations for the following
|
||||
crypto devices:
|
||||
|
||||
o CryptoSwift
|
||||
o Compaq Atalla
|
||||
o nCipher CHIL
|
||||
o Nuron
|
||||
o Broadcom uBSec
|
||||
|
||||
A number of things are still needed and are being worked on:
|
||||
In addition, dynamic binding to external ENGINE implementations is now
|
||||
provided by a special ENGINE called "dynamic". See the "DYNAMIC ENGINE"
|
||||
section below for details.
|
||||
|
||||
o A better way of handling the methods that are handled by the
|
||||
engines.
|
||||
o Documentation!
|
||||
At this stage, a number of things are still needed and are being worked on:
|
||||
|
||||
1 Integration of EVP support.
|
||||
2 Configuration support.
|
||||
3 Documentation!
|
||||
|
||||
1 With respect to EVP, this relates to support for ciphers and digests in
|
||||
the ENGINE model so that alternative implementations of existing
|
||||
algorithms/modes (or previously unimplemented ones) can be provided by
|
||||
ENGINE implementations.
|
||||
|
||||
2 Configuration support currently exists in the ENGINE API itself, in the
|
||||
form of "control commands". These allow an application to expose to the
|
||||
user/admin the set of commands and parameter types a given ENGINE
|
||||
implementation supports, and for an application to directly feed string
|
||||
based input to those ENGINEs, in the form of name-value pairs. This is an
|
||||
extensible way for ENGINEs to define their own "configuration" mechanisms
|
||||
that are specific to a given ENGINE (eg. for a particular hardware
|
||||
device) but that should be consistent across *all* OpenSSL-based
|
||||
applications when they use that ENGINE. Work is in progress (or at least
|
||||
in planning) for supporting these control commands from the CONF (or
|
||||
NCONF) code so that applications using OpenSSL's existing configuration
|
||||
file format can have ENGINE settings specified in much the same way.
|
||||
Presently however, applications must use the ENGINE API itself to provide
|
||||
such functionality. To see first hand the types of commands available
|
||||
with the various compiled-in ENGINEs (see further down for dynamic
|
||||
ENGINEs), use the "engine" openssl utility with full verbosity, ie;
|
||||
openssl engine -vvvv
|
||||
|
||||
3 Documentation? Volunteers welcome! The source code is reasonably well
|
||||
self-documenting, but some summaries and usage instructions are needed -
|
||||
moreover, they are needed in the same POD format the existing OpenSSL
|
||||
documentation is provided in. Any complete or incomplete contributions
|
||||
would help make this happen.
|
||||
|
||||
STABILITY & BUG-REPORTS
|
||||
=======================
|
||||
|
||||
What already exists is fairly stable as far as it has been tested, but
|
||||
the test base has been a bit small most of the time.
|
||||
the test base has been a bit small most of the time. For the most part,
|
||||
the vendors of the devices these ENGINEs support have contributed to the
|
||||
development and/or testing of the implementations, and *usually* (with no
|
||||
guarantees) have experience in using the ENGINE support to drive their
|
||||
devices from common OpenSSL-based applications. Bugs and/or inexplicable
|
||||
behaviour in using a specific ENGINE implementation should be sent to the
|
||||
author of that implementation (if it is mentioned in the corresponding C
|
||||
file), and in the case of implementations for commercial hardware
|
||||
devices, also through whatever vendor support channels are available. If
|
||||
none of this is possible, or the problem seems to be something about the
|
||||
ENGINE API itself (ie. not necessarily specific to a particular ENGINE
|
||||
implementation) then you should mail complete details to the relevant
|
||||
OpenSSL mailing list. For a definition of "complete details", refer to
|
||||
the OpenSSL "README" file. As for which list to send it to;
|
||||
|
||||
openssl-users: if you are *using* the ENGINE abstraction, either in an
|
||||
pre-compiled application or in your own application code.
|
||||
|
||||
No external crypto device is chosen unless you say so. You have actively
|
||||
tell the openssl utility commands to use it through a new command line
|
||||
switch called "-engine". And if you want to use the ENGINE library to
|
||||
do something similar, you must also explicitely choose an external crypto
|
||||
device, or the built-in crypto routines will be used, just as in the
|
||||
default OpenSSL distribution.
|
||||
openssl-dev: if you are discussing problems with OpenSSL source code.
|
||||
|
||||
USAGE
|
||||
=====
|
||||
|
||||
The default "openssl" ENGINE is always chosen when performing crypto
|
||||
operations unless you specify otherwise. You must actively tell the
|
||||
openssl utility commands to use anything else through a new command line
|
||||
switch called "-engine". Also, if you want to use the ENGINE support in
|
||||
your own code to do something similar, you must likewise explicitly
|
||||
select the ENGINE implementation you want.
|
||||
|
||||
Depending on the type of hardware, system, and configuration, "settings"
|
||||
may need to be applied to an ENGINE for it to function as expected/hoped.
|
||||
The recommended way of doing this is for the application to support
|
||||
ENGINE "control commands" so that each ENGINE implementation can provide
|
||||
whatever configuration primitives it might require and the application
|
||||
can allow the user/admin (and thus the hardware vendor's support desk
|
||||
also) to provide any such input directly to the ENGINE implementation.
|
||||
This way, applications do not need to know anything specific to any
|
||||
device, they only need to provide the means to carry such user/admin
|
||||
input through to the ENGINE in question. Ie. this connects *you* (and
|
||||
your helpdesk) to the specific ENGINE implementation (and device), and
|
||||
allows application authors to not get buried in hassle supporting
|
||||
arbitrary devices they know (and care) nothing about.
|
||||
|
||||
A new "openssl" utility, "openssl engine", has been added in that allows
|
||||
for testing and examination of ENGINE implementations. Basic usage
|
||||
instructions are available by specifying the "-?" command line switch.
|
||||
|
||||
DYNAMIC ENGINES
|
||||
===============
|
||||
|
||||
The new "dynamic" ENGINE provides a low-overhead way to support ENGINE
|
||||
implementations that aren't pre-compiled and linked into OpenSSL-based
|
||||
applications. This could be because existing compiled-in implementations
|
||||
have known problems and you wish to use a newer version with an existing
|
||||
application. It could equally be because the application (or OpenSSL
|
||||
library) you are using simply doesn't have support for the ENGINE you
|
||||
wish to use, and the ENGINE provider (eg. hardware vendor) is providing
|
||||
you with a self-contained implementation in the form of a shared-library.
|
||||
The other use-case for "dynamic" is with applications that wish to
|
||||
maintain the smallest foot-print possible and so do not link in various
|
||||
ENGINE implementations from OpenSSL, but instead leaves you to provide
|
||||
them, if you want them, in the form of "dynamic"-loadable
|
||||
shared-libraries. It should be possible for hardware vendors to provide
|
||||
their own shared-libraries to support arbitrary hardware to work with
|
||||
applications based on OpenSSL 0.9.7 or later. If you're using an
|
||||
application based on 0.9.7 (or later) and the support you desire is only
|
||||
announced for versions later than the one you need, ask the vendor to
|
||||
backport their ENGINE to the version you need.
|
||||
|
||||
How does "dynamic" work?
|
||||
------------------------
|
||||
The dynamic ENGINE has a special flag in its implementation such that
|
||||
every time application code asks for the 'dynamic' ENGINE, it in fact
|
||||
gets its own copy of it. As such, multi-threaded code (or code that
|
||||
multiplexes multiple uses of 'dynamic' in a single application in any
|
||||
way at all) does not get confused by 'dynamic' being used to do many
|
||||
independent things. Other ENGINEs typically don't do this so there is
|
||||
only ever 1 ENGINE structure of its type (and reference counts are used
|
||||
to keep order). The dynamic ENGINE itself provides absolutely no
|
||||
cryptographic functionality, and any attempt to "initialise" the ENGINE
|
||||
automatically fails. All it does provide are a few "control commands"
|
||||
that can be used to control how it will load an external ENGINE
|
||||
implementation from a shared-library. To see these control commands,
|
||||
use the command-line;
|
||||
|
||||
openssl engine -vvvv dynamic
|
||||
|
||||
The "SO_PATH" control command should be used to identify the
|
||||
shared-library that contains the ENGINE implementation, and "NO_VCHECK"
|
||||
might possibly be useful if there is a minor version conflict and you
|
||||
(or a vendor helpdesk) is convinced you can safely ignore it.
|
||||
"ENGINE_ID" is probably only needed if a shared-library implements
|
||||
multiple ENGINEs, but if you know the engine id you expect to be using,
|
||||
it doesn't hurt to specify it (and this provides a sanity check if
|
||||
nothing else). "LIST_ADD" is only required if you actually wish the
|
||||
loaded ENGINE to be discoverable by application code later on using the
|
||||
ENGINE's "id". For most applications, this isn't necessary - but some
|
||||
application authors may have nifty reasons for using it. The "LOAD"
|
||||
command is the only one that takes no parameters and is the command
|
||||
that uses the settings from any previous commands to actually *load*
|
||||
the shared-library ENGINE implementation. If this command succeeds, the
|
||||
(copy of the) 'dynamic' ENGINE will magically morph into the ENGINE
|
||||
that has been loaded from the shared-library. As such, any control
|
||||
commands supported by the loaded ENGINE could then be executed as per
|
||||
normal. Eg. if ENGINE "foo" is implemented in the shared-library
|
||||
"libfoo.so" and it supports some special control command "CMD_FOO", the
|
||||
following code would load and use it (NB: obviously this code has no
|
||||
error checking);
|
||||
|
||||
ENGINE *e = ENGINE_by_id("dynamic");
|
||||
ENGINE_ctrl_cmd_string(e, "SO_PATH", "/lib/libfoo.so", 0);
|
||||
ENGINE_ctrl_cmd_string(e, "ENGINE_ID", "foo", 0);
|
||||
ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0);
|
||||
ENGINE_ctrl_cmd_string(e, "CMD_FOO", "some input data", 0);
|
||||
|
||||
For testing, the "openssl engine" utility can be useful for this sort
|
||||
of thing. For example the above code excerpt would achieve much the
|
||||
same result as;
|
||||
|
||||
openssl engine dynamic \
|
||||
-pre SO_PATH:/lib/libfoo.so \
|
||||
-pre ENGINE_ID:foo \
|
||||
-pre LOAD \
|
||||
-pre "CMD_FOO:some input data"
|
||||
|
||||
Or to simply see the list of commands supported by the "foo" ENGINE;
|
||||
|
||||
openssl engine -vvvv dynamic \
|
||||
-pre SO_PATH:/lib/libfoo.so \
|
||||
-pre ENGINE_ID:foo \
|
||||
-pre LOAD
|
||||
|
||||
Applications that support the ENGINE API and more specifically, the
|
||||
"control commands" mechanism, will provide some way for you to pass
|
||||
such commands through to ENGINEs. As such, you would select "dynamic"
|
||||
as the ENGINE to use, and the parameters/commands you pass would
|
||||
control the *actual* ENGINE used. Each command is actually a name-value
|
||||
pair and the value can sometimes be omitted (eg. the "LOAD" command).
|
||||
Whilst the syntax demonstrated in "openssl engine" uses a colon to
|
||||
separate the command name from the value, applications may provide
|
||||
their own syntax for making that separation (eg. a win32 registry
|
||||
key-value pair may be used by some applications). The reason for the
|
||||
"-pre" syntax in the "openssl engine" utility is that some commands
|
||||
might be issued to an ENGINE *after* it has been initialised for use.
|
||||
Eg. if an ENGINE implementation requires a smart-card to be inserted
|
||||
during initialisation (or a PIN to be typed, or whatever), there may be
|
||||
a control command you can issue afterwards to "forget" the smart-card
|
||||
so that additional initialisation is no longer possible. In
|
||||
applications such as web-servers, where potentially volatile code may
|
||||
run on the same host system, this may provide some arguable security
|
||||
value. In such a case, the command would be passed to the ENGINE after
|
||||
it has been initialised for use, and so the "-post" switch would be
|
||||
used instead. Applications may provide a different syntax for
|
||||
supporting this distinction, and some may simply not provide it at all
|
||||
("-pre" is almost always what you're after, in reality).
|
||||
|
||||
How do I build a "dynamic" ENGINE?
|
||||
----------------------------------
|
||||
This question is trickier - currently OpenSSL bundles various ENGINE
|
||||
implementations that are statically built in, and any application that
|
||||
calls the "ENGINE_load_builtin_engines()" function will automatically
|
||||
have all such ENGINEs available (and occupying memory). Applications
|
||||
that don't call that function have no ENGINEs available like that and
|
||||
would have to use "dynamic" to load any such ENGINE - but on the other
|
||||
hand such applications would only have the memory footprint of any
|
||||
ENGINEs explicitly loaded using user/admin provided control commands.
|
||||
The main advantage of not statically linking ENGINEs and only using
|
||||
"dynamic" for hardware support is that any installation using no
|
||||
"external" ENGINE suffers no unnecessary memory footprint from unused
|
||||
ENGINEs. Likewise, installations that do require an ENGINE incur the
|
||||
overheads from only *that* ENGINE once it has been loaded.
|
||||
|
||||
Sounds good? Maybe, but currently building an ENGINE implementation as
|
||||
a shared-library that can be loaded by "dynamic" isn't automated in
|
||||
OpenSSL's build process. It can be done manually quite easily however.
|
||||
Such a shared-library can either be built with any OpenSSL code it
|
||||
needs statically linked in, or it can link dynamically against OpenSSL
|
||||
if OpenSSL itself is built as a shared library. The instructions are
|
||||
the same in each case, but in the former (statically linked any
|
||||
dependencies on OpenSSL) you must ensure OpenSSL is built with
|
||||
position-independent code ("PIC"). The default OpenSSL compilation may
|
||||
already specify the relevant flags to do this, but you should consult
|
||||
with your compiler documentation if you are in any doubt.
|
||||
|
||||
This example will show building the "atalla" ENGINE in the
|
||||
crypto/engine/ directory as a shared-library for use via the "dynamic"
|
||||
ENGINE.
|
||||
1) "cd" to the crypto/engine/ directory of a pre-compiled OpenSSL
|
||||
source tree.
|
||||
2) Recompile at least one source file so you can see all the compiler
|
||||
flags (and syntax) being used to build normally. Eg;
|
||||
touch hw_atalla.c ; make
|
||||
will rebuild "hw_atalla.o" using all such flags.
|
||||
3) Manually enter the same compilation line to compile the
|
||||
"hw_atalla.c" file but with the following two changes;
|
||||
(a) add "-DENGINE_DYNAMIC_SUPPORT" to the command line switches,
|
||||
(b) change the output file from "hw_atalla.o" to something new,
|
||||
eg. "tmp_atalla.o"
|
||||
4) Link "tmp_atalla.o" into a shared-library using the top-level
|
||||
OpenSSL libraries to resolve any dependencies. The syntax for doing
|
||||
this depends heavily on your system/compiler and is a nightmare
|
||||
known well to anyone who has worked with shared-library portability
|
||||
before. 'gcc' on Linux, for example, would use the following syntax;
|
||||
gcc -shared -o dyn_atalla.so tmp_atalla.o -L../.. -lcrypto
|
||||
5) Test your shared library using "openssl engine" as explained in the
|
||||
previous section. Eg. from the top-level directory, you might try;
|
||||
apps/openssl engine -vvvv dynamic \
|
||||
-pre SO_PATH:./crypto/engine/dyn_atalla.so -pre LOAD
|
||||
If the shared-library loads successfully, you will see both "-pre"
|
||||
commands marked as "SUCCESS" and the list of control commands
|
||||
displayed (because of "-vvvv") will be the control commands for the
|
||||
*atalla* ENGINE (ie. *not* the 'dynamic' ENGINE). You can also add
|
||||
the "-t" switch to the utility if you want it to try and initialise
|
||||
the atalla ENGINE for use to test any possible hardware/driver
|
||||
issues.
|
||||
|
||||
PROBLEMS
|
||||
========
|
||||
|
||||
It seems like the ENGINE part doesn't work too well with Cryptoswift on
|
||||
Win32. A quick test done right before the release showed that trying
|
||||
"openssl speed -engine cswift" generated errors. If the DSO gets enabled,
|
||||
an attempt is made to write at memory address 0x00000002.
|
||||
It seems like the ENGINE part doesn't work too well with CryptoSwift on Win32.
|
||||
A quick test done right before the release showed that trying "openssl speed
|
||||
-engine cswift" generated errors. If the DSO gets enabled, an attempt is made
|
||||
to write at memory address 0x00000002.
|
||||
|
||||
|
||||
66
STATUS
66
STATUS
@@ -1,11 +1,16 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2001/02/22 15:10:11 $
|
||||
______________ $Date: 2002/06/16 11:27:38 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 0.9.7: Under development...
|
||||
o OpenSSL 0.9.6a: Bugfix release -- under development...
|
||||
o OpenSSL 0.9.8: Under development...
|
||||
o OpenSSL 0.9.7-beta2: Released on June 16th, 2002
|
||||
o OpenSSL 0.9.7-beta1: Released on June 1st, 2002
|
||||
o OpenSSL 0.9.6d: Released on May 9th, 2002
|
||||
o OpenSSL 0.9.6c: Released on December 21st, 2001
|
||||
o OpenSSL 0.9.6b: Released on July 9th, 2001
|
||||
o OpenSSL 0.9.6a: Released on April 5th, 2001
|
||||
o OpenSSL 0.9.6: Released on September 24th, 2000
|
||||
o OpenSSL 0.9.5a: Released on April 1st, 2000
|
||||
o OpenSSL 0.9.5: Released on February 28th, 2000
|
||||
@@ -15,13 +20,16 @@
|
||||
o OpenSSL 0.9.2b: Released on March 22th, 1999
|
||||
o OpenSSL 0.9.1c: Released on December 23th, 1998
|
||||
|
||||
[See also http://www.openssl.org/support/rt2.html]
|
||||
|
||||
RELEASE SHOWSTOPPERS
|
||||
|
||||
o
|
||||
o BN_mod_mul verification fails for mips3-sgi-irix
|
||||
unless configured with no-asm
|
||||
|
||||
AVAILABLE PATCHES
|
||||
|
||||
o
|
||||
o
|
||||
|
||||
IN PROGRESS
|
||||
|
||||
@@ -36,32 +44,22 @@
|
||||
o Geoff and Richard are currently working on:
|
||||
ENGINE (the new code that gives hardware support among others).
|
||||
o Richard is currently working on:
|
||||
UI (User Interface)
|
||||
UTIL (a new set of library functions to support some higher level
|
||||
functionality that is currently missing).
|
||||
Shared library support for VMS.
|
||||
OCSP
|
||||
Kerberos 5 authentication
|
||||
Constification
|
||||
OCSP
|
||||
|
||||
NEEDS PATCH
|
||||
|
||||
o apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file
|
||||
|
||||
o OpenSSL_0_9_6-stable:
|
||||
#include <openssl/e_os.h> in exported header files is illegal since
|
||||
e_os.h is suitable only for library-internal use.
|
||||
|
||||
o Whenever strncpy is used, make sure the resulting string is NULL-terminated
|
||||
or an error is reported
|
||||
o "OpenSSL STATUS" is never up-to-date.
|
||||
|
||||
OPEN ISSUES
|
||||
|
||||
o crypto/ex_data.c is not really thread-safe and so must be used
|
||||
with care (e.g., extra locking where necessary, or don't call
|
||||
CRYPTO_get_ex_new_index once multiple threads exist).
|
||||
The current API is not suitable for everything that it pretends
|
||||
to offer.
|
||||
|
||||
o The Makefile hierarchy and build mechanism is still not a round thing:
|
||||
|
||||
1. The config vs. Configure scripts
|
||||
@@ -86,22 +84,20 @@
|
||||
which apparently is not flexible enough to generate
|
||||
libcrypto)
|
||||
|
||||
|
||||
o The perl/ stuff needs a major overhaul. Currently it's
|
||||
totally obsolete. Either we clean it up and enhance it to be up-to-date
|
||||
with the C code or we also could replace it with the really nice
|
||||
Net::SSLeay package we can find under
|
||||
http://www.neuronio.pt/SSLeay.pm.html. Ralf uses this package for a
|
||||
longer time and it works fine and is a nice Perl module. Best would be
|
||||
to convince the author to work for the OpenSSL project and create a
|
||||
Net::OpenSSL or Crypt::OpenSSL package out of it and maintains it for
|
||||
us.
|
||||
|
||||
Status: Ralf thinks we should both contact the author of Net::SSLeay
|
||||
and look how much effort it is to bring Eric's perl/ stuff up
|
||||
to date.
|
||||
Paul +1
|
||||
|
||||
WISHES
|
||||
|
||||
o
|
||||
o Add variants of DH_generate_parameters() and BN_generate_prime() [etc?]
|
||||
where the callback function can request that the function be aborted.
|
||||
[Gregory Stark <ghstark@pobox.com>, <rayyang2000@yahoo.com>]
|
||||
|
||||
o SRP in TLS.
|
||||
[wished by:
|
||||
Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
|
||||
Tom Holroyd <tomh@po.crl.go.jp>]
|
||||
|
||||
See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
|
||||
as well as http://www-cs-students.stanford.edu/~tjw/srp/.
|
||||
|
||||
Tom Holroyd tells us there is a SRP patch for OpenSSH at
|
||||
http://members.tripod.com/professor_tom/archives/, that could
|
||||
be useful.
|
||||
|
||||
353
VMS/mkshared.com
Normal file
353
VMS/mkshared.com
Normal file
@@ -0,0 +1,353 @@
|
||||
$! MKSHARED.COM -- script to created shareable images on VMS
|
||||
$!
|
||||
$! No command line parameters. This should be run at the start of the source
|
||||
$! tree (the same directory where one finds INSTALL.VMS).
|
||||
$!
|
||||
$! Input: [.UTIL]LIBEAY.NUM,[.AXP.EXE.CRYPTO]LIBCRYPTO.OLB
|
||||
$! [.UTIL]SSLEAY.NUM,[.AXP.EXE.SSL]LIBSSL.OLB
|
||||
$! Output: [.AXP.EXE.CRYPTO]LIBCRYPTO.OPT,.MAP,.EXE
|
||||
$! [.AXP.EXE.SSL]LIBSSL.OPT,.MAP,.EXE
|
||||
$!
|
||||
$! So far, tests have only been made on VMS for Alpha. VAX will come in time.
|
||||
$! ===========================================================================
|
||||
$
|
||||
$! ----- Prepare info for processing: version number and file info
|
||||
$ gosub read_version_info
|
||||
$ if libver .eqs. ""
|
||||
$ then
|
||||
$ write sys$error "ERROR: Couldn't find any library version info..."
|
||||
$ exit
|
||||
$ endif
|
||||
$
|
||||
$ if f$getsyi("CPU") .ge. 128
|
||||
$ then
|
||||
$ libid = "Crypto"
|
||||
$ libnum = "[.UTIL]LIBEAY.NUM"
|
||||
$ libdir = "[.AXP.EXE.CRYPTO]"
|
||||
$ libolb = "''libdir'LIBCRYPTO.OLB"
|
||||
$ libopt = "''libdir'LIBCRYPTO.OPT"
|
||||
$ libmap = "''libdir'LIBCRYPTO.MAP"
|
||||
$ libgoal= "''libdir'LIBCRYPTO.EXE"
|
||||
$ libref = ""
|
||||
$ gosub create_axp_shr
|
||||
$ libid = "SSL"
|
||||
$ libnum = "[.UTIL]SSLEAY.NUM"
|
||||
$ libdir = "[.AXP.EXE.SSL]"
|
||||
$ libolb = "''libdir'LIBSSL.OLB"
|
||||
$ libopt = "''libdir'LIBSSL.OPT"
|
||||
$ libmap = "''libdir'LIBSSL.MAP"
|
||||
$ libgoal= "''libdir'LIBSSL.EXE"
|
||||
$ libref = "[.AXP.EXE.CRYPTO]LIBCRYPTO.EXE"
|
||||
$ gosub create_axp_shr
|
||||
$ else
|
||||
$ libtit = "CRYPTO_TRANSFER_VECTOR"
|
||||
$ libid = "Crypto"
|
||||
$ libnum = "[.UTIL]LIBEAY.NUM"
|
||||
$ libdir = "[.VAX.EXE.CRYPTO]"
|
||||
$ libmar = "''libdir'LIBCRYPTO.MAR"
|
||||
$ libolb = "''libdir'LIBCRYPTO.OLB"
|
||||
$ libopt = "''libdir'LIBCRYPTO.OPT"
|
||||
$ libobj = "''libdir'LIBCRYPTO.OBJ"
|
||||
$ libmap = "''libdir'LIBCRYPTO.MAP"
|
||||
$ libgoal= "''libdir'LIBCRYPTO.EXE"
|
||||
$ libref = ""
|
||||
$ libvec = "LIBCRYPTO"
|
||||
$ gosub create_vax_shr
|
||||
$ libtit = "SSL_TRANSFER_VECTOR"
|
||||
$ libid = "SSL"
|
||||
$ libnum = "[.UTIL]SSLEAY.NUM"
|
||||
$ libdir = "[.VAX.EXE.SSL]"
|
||||
$ libmar = "''libdir'LIBSSL.MAR"
|
||||
$ libolb = "''libdir'LIBSSL.OLB"
|
||||
$ libopt = "''libdir'LIBSSL.OPT"
|
||||
$ libobj = "''libdir'LIBSSL.OBJ"
|
||||
$ libmap = "''libdir'LIBSSL.MAP"
|
||||
$ libgoal= "''libdir'LIBSSL.EXE"
|
||||
$ libref = "[.VAX.EXE.CRYPTO]LIBCRYPTO.EXE"
|
||||
$ libvec = "LIBSSL"
|
||||
$ gosub create_vax_shr
|
||||
$ endif
|
||||
$ exit
|
||||
$
|
||||
$! ----- Soubroutines to actually build the shareable libraries
|
||||
$! The way things work, there's a main shareable library creator for each
|
||||
$! supported architecture, which is called from the main code above.
|
||||
$! The creator will define a number of variables to tell the next levels of
|
||||
$! subroutines what routines to use to write to the option files, call the
|
||||
$! main processor, read_func_num, and when that is done, it will write version
|
||||
$! data at the end of the .opt file, close it, and link the library.
|
||||
$!
|
||||
$! read_func_num reads through a .num file and calls the writer routine for
|
||||
$! each line. It's also responsible for checking that order is properly kept
|
||||
$! in the .num file, check that each line applies to VMS and the architecture,
|
||||
$! and to fill in "holes" with dummy entries.
|
||||
$!
|
||||
$! The creator routines depend on the following variables:
|
||||
$! libnum The name of the .num file to use as input
|
||||
$! libolb The name of the object library to build from
|
||||
$! libid The identification string of the shareable library
|
||||
$! libopt The name of the .opt file to write
|
||||
$! libtit The title of the assembler transfer vector file (VAX only)
|
||||
$! libmar The name of the assembler transfer vector file (VAX only)
|
||||
$! libmap The name of the map file to write
|
||||
$! libgoal The name of the shareable library to write
|
||||
$! libref The name of a shareable library to link in
|
||||
$!
|
||||
$! read_func_num depends on the following variables from the creator:
|
||||
$! libwriter The name of the writer routine to call for each .num file line
|
||||
$! -----
|
||||
$
|
||||
$! ----- Subroutines for AXP
|
||||
$! -----
|
||||
$! The creator routine
|
||||
$ create_axp_shr:
|
||||
$ open/write opt 'libopt'
|
||||
$ write opt "identification=""",libid," ",libverstr,""""
|
||||
$ write opt libolb,"/lib"
|
||||
$ if libref .nes. "" then write opt libref,"/SHARE"
|
||||
$ write opt "SYMBOL_VECTOR=(-"
|
||||
$ libfirstentry := true
|
||||
$ libwrch := opt
|
||||
$ libwriter := write_axp_transfer_entry
|
||||
$ textcount = 0
|
||||
$ gosub read_func_num
|
||||
$ write opt ")"
|
||||
$ write opt "GSMATCH=",libvmatch,",",libver
|
||||
$ close opt
|
||||
$ link/map='libmap'/full/share='libgoal' 'libopt'/option
|
||||
$ return
|
||||
$
|
||||
$! The record writer routine
|
||||
$ write_axp_transfer_entry:
|
||||
$ if libentry .eqs. ".dummy" then return
|
||||
$ if info_kind .eqs. "VARIABLE"
|
||||
$ then
|
||||
$ pr:=DATA
|
||||
$ else
|
||||
$ pr:=PROCEDURE
|
||||
$ endif
|
||||
$ textcount_this = f$length(pr) + f$length(libentry) + 5
|
||||
$ if textcount + textcount_this .gt. 1024
|
||||
$ then
|
||||
$ write opt ")"
|
||||
$ write opt "SYMBOL_VECTOR=(-"
|
||||
$ textcount = 16
|
||||
$ libfirstentry := true
|
||||
$ endif
|
||||
$ if libfirstentry
|
||||
$ then
|
||||
$ write 'libwrch' " ",libentry,"=",pr," -"
|
||||
$ else
|
||||
$ write 'libwrch' " ,",libentry,"=",pr," -"
|
||||
$ endif
|
||||
$ libfirstentry := false
|
||||
$ textcount = textcount + textcount_this
|
||||
$ return
|
||||
$
|
||||
$! ----- Subroutines for AXP
|
||||
$! -----
|
||||
$! The creator routine
|
||||
$ create_vax_shr:
|
||||
$ open/write mar 'libmar'
|
||||
$ type sys$input:/out=mar:
|
||||
;
|
||||
; Transfer vector for VAX shareable image
|
||||
;
|
||||
$ write mar " .TITLE ",libtit
|
||||
$ write mar " .IDENT /",libid,"/"
|
||||
$ type sys$input:/out=mar:
|
||||
;
|
||||
; Define macro to assist in building transfer vector entries. Each entry
|
||||
; should take no more than 8 bytes.
|
||||
;
|
||||
.MACRO FTRANSFER_ENTRY routine
|
||||
.ALIGN QUAD
|
||||
.TRANSFER routine
|
||||
.MASK routine
|
||||
JMP routine+2
|
||||
.ENDM FTRANSFER_ENTRY
|
||||
;
|
||||
; Place entries in own program section.
|
||||
;
|
||||
$ write mar " .PSECT $$",libvec,",QUAD,PIC,USR,CON,REL,LCL,SHR,EXE,RD,NOWRT"
|
||||
$ write mar libvec,"_xfer:"
|
||||
$ libwrch := mar
|
||||
$ libwriter := write_vax_ftransfer_entry
|
||||
$ gosub read_func_num
|
||||
$ type sys$input:/out=mar:
|
||||
;
|
||||
; Allocate extra storage at end of vector to allow for expansion.
|
||||
;
|
||||
$ write mar " .BLKB 32768-<.-",libvec,"_xfer> ; 64 pages total."
|
||||
$! libwriter := write_vax_vtransfer_entry
|
||||
$! gosub read_func_num
|
||||
$ write mar " .END"
|
||||
$ close mar
|
||||
$ open/write opt 'libopt'
|
||||
$ write opt "identification=""",libid," ",libverstr,""""
|
||||
$ write opt libobj
|
||||
$ write opt libolb,"/lib"
|
||||
$ if libref .nes. "" then write opt libref,"/SHARE"
|
||||
$ type sys$input:/out=opt:
|
||||
!
|
||||
! Ensure transfer vector is at beginning of image
|
||||
!
|
||||
CLUSTER=FIRST
|
||||
$ write opt "COLLECT=FIRST,$$",libvec
|
||||
$ write opt "GSMATCH=",libvmatch,",",libver
|
||||
$ type sys$input:/out=opt:
|
||||
!
|
||||
! make psects nonshareable so image can be installed.
|
||||
!
|
||||
PSECT_ATTR=$CHAR_STRING_CONSTANTS,NOWRT
|
||||
$ libwrch := opt
|
||||
$ libwriter := write_vax_psect_attr
|
||||
$ gosub read_func_num
|
||||
$ close opt
|
||||
$ macro/obj='libobj' 'libmar'
|
||||
$ link/map='libmap'/full/share='libgoal' 'libopt'/option
|
||||
$ return
|
||||
$
|
||||
$! The record writer routine for VAX functions
|
||||
$ write_vax_ftransfer_entry:
|
||||
$ if info_kind .nes. "FUNCTION" then return
|
||||
$ if libentry .eqs ".dummy"
|
||||
$ then
|
||||
$ write 'libwrch' " .BLKB 8" ! Dummy is zeroes...
|
||||
$ else
|
||||
$ write 'libwrch' " FTRANSFER_ENTRY ",libentry
|
||||
$ endif
|
||||
$ return
|
||||
$! The record writer routine for VAX variables (should never happen!)
|
||||
$ write_vax_psect_attr:
|
||||
$ if info_kind .nes. "VARIABLE" then return
|
||||
$ if libentry .eqs ".dummy" then return
|
||||
$ write 'libwrch' "PSECT_ATTR=",libentry,",NOSHR"
|
||||
$ return
|
||||
$
|
||||
$! ----- Common subroutines
|
||||
$! -----
|
||||
$! The .num file reader. This one has great responsability.
|
||||
$ read_func_num:
|
||||
$ open libnum 'libnum'
|
||||
$ goto read_nums
|
||||
$
|
||||
$ read_nums:
|
||||
$ libentrynum=0
|
||||
$ liblastentry:=false
|
||||
$ entrycount=0
|
||||
$ loop:
|
||||
$ read/end=loop_end/err=loop_end libnum line
|
||||
$ entrynum=f$int(f$element(1," ",f$edit(line,"COMPRESS,TRIM")))
|
||||
$ entryinfo=f$element(2," ",f$edit(line,"COMPRESS,TRIM"))
|
||||
$ curentry=f$element(0," ",f$edit(line,"COMPRESS,TRIM"))
|
||||
$ info_exist=f$element(0,":",entryinfo)
|
||||
$ info_platforms=","+f$element(1,":",entryinfo)+","
|
||||
$ info_kind=f$element(2,":",entryinfo)
|
||||
$ info_algorithms=","+f$element(3,":",entryinfo)+","
|
||||
$ if info_exist .eqs. "NOEXIST" then goto loop
|
||||
$ truesum = 0
|
||||
$ falsesum = 0
|
||||
$ negatives = 1
|
||||
$ plat_i = 0
|
||||
$ loop1:
|
||||
$ plat_entry = f$element(plat_i,",",info_platforms)
|
||||
$ plat_i = plat_i + 1
|
||||
$ if plat_entry .eqs. "" then goto loop1
|
||||
$ if plat_entry .nes. ","
|
||||
$ then
|
||||
$ if f$extract(0,1,plat_entry) .nes. "!" then negatives = 0
|
||||
$ if f$getsyi("CPU") .lt. 128
|
||||
$ then
|
||||
$ if plat_entry .eqs. "EXPORT_VAR_AS_FUNCTION" then -
|
||||
$ truesum = truesum + 1
|
||||
$ if plat_entry .eqs. "!EXPORT_VAR_AS_FUNCTION" then -
|
||||
$ falsesum = falsesum + 1
|
||||
$ endif
|
||||
$ if plat_entry .eqs. "VMS" then truesum = truesum + 1
|
||||
$ if plat_entry .eqs. "!VMS" then falsesum = falsesum + 1
|
||||
$ goto loop1
|
||||
$ endif
|
||||
$ endloop1:
|
||||
$!DEBUG!$ if info_platforms - "EXPORT_VAR_AS_FUNCTION" .nes. info_platforms
|
||||
$!DEBUG!$ then
|
||||
$!DEBUG!$ write sys$output line
|
||||
$!DEBUG!$ write sys$output " truesum = ",truesum,-
|
||||
$!DEBUG! ", negatives = ",negatives,", falsesum = ",falsesum
|
||||
$!DEBUG!$ endif
|
||||
$ if falsesum .ne. 0 then goto loop
|
||||
$ if truesum+negatives .eq. 0 then goto loop
|
||||
$ alg_i = 0
|
||||
$ loop2:
|
||||
$ alg_entry = f$element(alg_i,",",info_algorithms)
|
||||
$ alg_i = alg_i + 1
|
||||
$ if alg_entry .eqs. "" then goto loop2
|
||||
$ if alg_entry .nes. ","
|
||||
$ then
|
||||
$ if alg_entry .eqs. "KRB5" then goto loop ! Special for now
|
||||
$ if f$trnlnm("OPENSSL_NO_"+alg_entry) .nes. "" then goto loop
|
||||
$ goto loop2
|
||||
$ endif
|
||||
$ endloop2:
|
||||
$ if info_platforms - "EXPORT_VAR_AS_FUNCTION" .nes. info_platforms
|
||||
$ then
|
||||
$!DEBUG!$ write sys$output curentry," ; ",entrynum," ; ",entryinfo
|
||||
$ endif
|
||||
$ redo:
|
||||
$ next:=loop
|
||||
$ tolibentry=curentry
|
||||
$ if libentrynum .ne. entrynum
|
||||
$ then
|
||||
$ entrycount=entrycount+1
|
||||
$ if entrycount .lt. entrynum
|
||||
$ then
|
||||
$!DEBUG!$ write sys$output "Info: entrycount: ''entrycount', entrynum: ''entrynum' => 0"
|
||||
$ tolibentry=".dummy"
|
||||
$ next:=redo
|
||||
$ endif
|
||||
$ if entrycount .gt. entrynum
|
||||
$ then
|
||||
$ write sys$error "Decreasing library entry numbers! Can't continue"
|
||||
$ write sys$error """",line,""""
|
||||
$ close libnum
|
||||
$ return
|
||||
$ endif
|
||||
$ libentry=tolibentry
|
||||
$!DEBUG!$ write sys$output entrycount," ",libentry," ",entryinfo
|
||||
$ if libentry .nes. "" .and. libwriter .nes. "" then gosub 'libwriter'
|
||||
$ else
|
||||
$ write sys$error "Info: ""''curentry'"" is an alias for ""''libentry'"". Overriding..."
|
||||
$ endif
|
||||
$ libentrynum=entrycount
|
||||
$ goto 'next'
|
||||
$ loop_end:
|
||||
$ close libnum
|
||||
$ return
|
||||
$
|
||||
$! The version number reader
|
||||
$ read_version_info:
|
||||
$ libver = ""
|
||||
$ open/read vf [.CRYPTO]OPENSSLV.H
|
||||
$ loop_rvi:
|
||||
$ read/err=endloop_rvi/end=endloop_rvi vf rvi_line
|
||||
$ if rvi_line - "SHLIB_VERSION_NUMBER """ .eqs. rvi_line then -
|
||||
goto loop_rvi
|
||||
$ libverstr = f$element(1,"""",rvi_line)
|
||||
$ libvmajor = f$element(0,".",libverstr)
|
||||
$ libvminor = f$element(1,".",libverstr)
|
||||
$ libvedit = f$element(2,".",libverstr)
|
||||
$ libvpatch = f$cvui(0,8,f$extract(1,1,libvedit)+"@")-f$cvui(0,8,"@")
|
||||
$ libvedit = f$extract(0,1,libvedit)
|
||||
$ libver = f$string(f$int(libvmajor)*100)+","+-
|
||||
f$string(f$int(libvminor)*100+f$int(libvedit)*10+f$int(libvpatch))
|
||||
$ if libvmajor .eqs. "0"
|
||||
$ then
|
||||
$ libvmatch = "EQUAL"
|
||||
$ else
|
||||
$ ! Starting with the 1.0 release, backward compatibility should be
|
||||
$ ! kept, so switch over to the following
|
||||
$ libvmatch = "LEQUAL"
|
||||
$ endif
|
||||
$ endloop_rvi:
|
||||
$ close vf
|
||||
$ return
|
||||
1
VMS/tcpip_shr_decc.opt
Normal file
1
VMS/tcpip_shr_decc.opt
Normal file
@@ -0,0 +1 @@
|
||||
sys$share:tcpip$ipc_shr.exe/share
|
||||
1173
apps/Makefile.ssl
1173
apps/Makefile.ssl
File diff suppressed because it is too large
Load Diff
536
apps/apps.c
536
apps/apps.c
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -66,9 +119,12 @@
|
||||
#undef NON_MAIN
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include <openssl/ui.h>
|
||||
#include <openssl/safestack.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#ifdef OPENSSL_SYS_WINDOWS
|
||||
#define strcasecmp _stricmp
|
||||
@@ -86,7 +142,17 @@ typedef struct {
|
||||
unsigned long mask;
|
||||
} NAME_EX_TBL;
|
||||
|
||||
static UI_METHOD *ui_method = NULL;
|
||||
|
||||
static int set_table_opts(unsigned long *flags, const char *arg, const NAME_EX_TBL *in_tbl);
|
||||
static int set_multi_opts(unsigned long *flags, const char *arg, const NAME_EX_TBL *in_tbl);
|
||||
|
||||
#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
|
||||
/* Looks like this stuff is worth moving into separate function */
|
||||
static EVP_PKEY *
|
||||
load_netscape_key(BIO *err, BIO *key, const char *file,
|
||||
const char *key_descrip, int format);
|
||||
#endif
|
||||
|
||||
int app_init(long mesgwin);
|
||||
#ifdef undef /* never finished - probably never will be :-) */
|
||||
@@ -244,9 +310,16 @@ void program_name(char *in, char *out, int size)
|
||||
|
||||
q=strrchr(p,'.');
|
||||
if (q == NULL)
|
||||
q = in+size;
|
||||
strncpy(out,p,q-p);
|
||||
out[q-p]='\0';
|
||||
q = p + strlen(p);
|
||||
strncpy(out,p,size-1);
|
||||
if (q-p >= size)
|
||||
{
|
||||
out[size-1]='\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
out[q-p]='\0';
|
||||
}
|
||||
}
|
||||
#else
|
||||
void program_name(char *in, char *out, int size)
|
||||
@@ -267,16 +340,13 @@ void program_name(char *in, char *out, int size)
|
||||
#ifdef OPENSSL_SYS_WIN32
|
||||
int WIN32_rename(char *from, char *to)
|
||||
{
|
||||
#ifdef OPENSSL_SYS_WINNT
|
||||
int ret;
|
||||
/* Note: MoveFileEx() doesn't work under Win95, Win98 */
|
||||
|
||||
ret=MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED);
|
||||
return(ret?0:-1);
|
||||
#else
|
||||
unlink(to);
|
||||
return MoveFile(from, to);
|
||||
#endif
|
||||
/* Windows rename gives an error if 'to' exists, so delete it
|
||||
* first and ignore file not found errror
|
||||
*/
|
||||
if((remove(to) != 0) && (errno != ENOENT))
|
||||
return -1;
|
||||
#undef rename
|
||||
return rename(from, to);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -367,6 +437,159 @@ int dump_cert_text (BIO *out, X509 *x)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ui_open(UI *ui)
|
||||
{
|
||||
return UI_method_get_opener(UI_OpenSSL())(ui);
|
||||
}
|
||||
static int ui_read(UI *ui, UI_STRING *uis)
|
||||
{
|
||||
if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
|
||||
&& UI_get0_user_data(ui))
|
||||
{
|
||||
switch(UI_get_string_type(uis))
|
||||
{
|
||||
case UIT_PROMPT:
|
||||
case UIT_VERIFY:
|
||||
{
|
||||
const char *password =
|
||||
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
||||
if (password[0] != '\0')
|
||||
{
|
||||
UI_set_result(ui, uis, password);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return UI_method_get_reader(UI_OpenSSL())(ui, uis);
|
||||
}
|
||||
static int ui_write(UI *ui, UI_STRING *uis)
|
||||
{
|
||||
if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
|
||||
&& UI_get0_user_data(ui))
|
||||
{
|
||||
switch(UI_get_string_type(uis))
|
||||
{
|
||||
case UIT_PROMPT:
|
||||
case UIT_VERIFY:
|
||||
{
|
||||
const char *password =
|
||||
((PW_CB_DATA *)UI_get0_user_data(ui))->password;
|
||||
if (password[0] != '\0')
|
||||
return 1;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return UI_method_get_writer(UI_OpenSSL())(ui, uis);
|
||||
}
|
||||
static int ui_close(UI *ui)
|
||||
{
|
||||
return UI_method_get_closer(UI_OpenSSL())(ui);
|
||||
}
|
||||
int setup_ui_method(void)
|
||||
{
|
||||
ui_method = UI_create_method("OpenSSL application user interface");
|
||||
UI_method_set_opener(ui_method, ui_open);
|
||||
UI_method_set_reader(ui_method, ui_read);
|
||||
UI_method_set_writer(ui_method, ui_write);
|
||||
UI_method_set_closer(ui_method, ui_close);
|
||||
return 0;
|
||||
}
|
||||
void destroy_ui_method(void)
|
||||
{
|
||||
if(ui_method)
|
||||
{
|
||||
UI_destroy_method(ui_method);
|
||||
ui_method = NULL;
|
||||
}
|
||||
}
|
||||
int password_callback(char *buf, int bufsiz, int verify,
|
||||
PW_CB_DATA *cb_tmp)
|
||||
{
|
||||
UI *ui = NULL;
|
||||
int res = 0;
|
||||
const char *prompt_info = NULL;
|
||||
const char *password = NULL;
|
||||
PW_CB_DATA *cb_data = (PW_CB_DATA *)cb_tmp;
|
||||
|
||||
if (cb_data)
|
||||
{
|
||||
if (cb_data->password)
|
||||
password = cb_data->password;
|
||||
if (cb_data->prompt_info)
|
||||
prompt_info = cb_data->prompt_info;
|
||||
}
|
||||
|
||||
if (password)
|
||||
{
|
||||
res = strlen(password);
|
||||
if (res > bufsiz)
|
||||
res = bufsiz;
|
||||
memcpy(buf, password, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
ui = UI_new_method(ui_method);
|
||||
if (ui)
|
||||
{
|
||||
int ok = 0;
|
||||
char *buff = NULL;
|
||||
int ui_flags = 0;
|
||||
char *prompt = NULL;
|
||||
|
||||
prompt = UI_construct_prompt(ui, "pass phrase",
|
||||
cb_data->prompt_info);
|
||||
|
||||
ui_flags |= UI_INPUT_FLAG_DEFAULT_PWD;
|
||||
UI_ctrl(ui, UI_CTRL_PRINT_ERRORS, 1, 0, 0);
|
||||
|
||||
if (ok >= 0)
|
||||
ok = UI_add_input_string(ui,prompt,ui_flags,buf,
|
||||
PW_MIN_LENGTH,BUFSIZ-1);
|
||||
if (ok >= 0 && verify)
|
||||
{
|
||||
buff = (char *)OPENSSL_malloc(bufsiz);
|
||||
ok = UI_add_verify_string(ui,prompt,ui_flags,buff,
|
||||
PW_MIN_LENGTH,BUFSIZ-1, buf);
|
||||
}
|
||||
if (ok >= 0)
|
||||
do
|
||||
{
|
||||
ok = UI_process(ui);
|
||||
}
|
||||
while (ok < 0 && UI_ctrl(ui, UI_CTRL_IS_REDOABLE, 0, 0, 0));
|
||||
|
||||
if (buff)
|
||||
{
|
||||
memset(buff,0,(unsigned int)bufsiz);
|
||||
OPENSSL_free(buff);
|
||||
}
|
||||
|
||||
if (ok >= 0)
|
||||
res = strlen(buf);
|
||||
if (ok == -1)
|
||||
{
|
||||
BIO_printf(bio_err, "User interface error\n");
|
||||
ERR_print_errors(bio_err);
|
||||
memset(buf,0,(unsigned int)bufsiz);
|
||||
res = 0;
|
||||
}
|
||||
if (ok == -2)
|
||||
{
|
||||
BIO_printf(bio_err,"aborted!\n");
|
||||
memset(buf,0,(unsigned int)bufsiz);
|
||||
res = 0;
|
||||
}
|
||||
UI_free(ui);
|
||||
OPENSSL_free(prompt);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static char *app_get_pass(BIO *err, char *arg, int keepbio);
|
||||
|
||||
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2)
|
||||
@@ -442,18 +665,18 @@ static char *app_get_pass(BIO *err, char *arg, int keepbio)
|
||||
return BUF_strdup(tpass);
|
||||
}
|
||||
|
||||
int add_oid_section(BIO *err, LHASH *conf)
|
||||
int add_oid_section(BIO *err, CONF *conf)
|
||||
{
|
||||
char *p;
|
||||
STACK_OF(CONF_VALUE) *sktmp;
|
||||
CONF_VALUE *cnf;
|
||||
int i;
|
||||
if(!(p=CONF_get_string(conf,NULL,"oid_section")))
|
||||
if(!(p=NCONF_get_string(conf,NULL,"oid_section")))
|
||||
{
|
||||
ERR_clear_error();
|
||||
return 1;
|
||||
}
|
||||
if(!(sktmp = CONF_get_section(conf, p))) {
|
||||
if(!(sktmp = NCONF_get_section(conf, p))) {
|
||||
BIO_printf(err, "problem loading oid section %s\n", p);
|
||||
return 0;
|
||||
}
|
||||
@@ -468,7 +691,8 @@ int add_oid_section(BIO *err, LHASH *conf)
|
||||
return 1;
|
||||
}
|
||||
|
||||
X509 *load_cert(BIO *err, char *file, int format)
|
||||
X509 *load_cert(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *cert_descrip)
|
||||
{
|
||||
ASN1_HEADER *ah=NULL;
|
||||
BUF_MEM *buf=NULL;
|
||||
@@ -490,7 +714,9 @@ X509 *load_cert(BIO *err, char *file, int format)
|
||||
{
|
||||
if (BIO_read_filename(cert,file) <= 0)
|
||||
{
|
||||
perror(file);
|
||||
BIO_printf(err, "Error opening %s %s\n",
|
||||
cert_descrip, file);
|
||||
ERR_print_errors(err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -541,7 +767,8 @@ X509 *load_cert(BIO *err, char *file, int format)
|
||||
ah->data=NULL;
|
||||
}
|
||||
else if (format == FORMAT_PEM)
|
||||
x=PEM_read_bio_X509_AUX(cert,NULL,NULL,NULL);
|
||||
x=PEM_read_bio_X509_AUX(cert,NULL,
|
||||
(pem_password_cb *)password_callback, NULL);
|
||||
else if (format == FORMAT_PKCS12)
|
||||
{
|
||||
PKCS12 *p12 = d2i_PKCS12_bio(cert, NULL);
|
||||
@@ -551,7 +778,8 @@ X509 *load_cert(BIO *err, char *file, int format)
|
||||
p12 = NULL;
|
||||
}
|
||||
else {
|
||||
BIO_printf(err,"bad input format specified for input cert\n");
|
||||
BIO_printf(err,"bad input format specified for %s\n",
|
||||
cert_descrip);
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
@@ -566,10 +794,15 @@ end:
|
||||
return(x);
|
||||
}
|
||||
|
||||
EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e)
|
||||
EVP_PKEY *load_key(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *key_descrip)
|
||||
{
|
||||
BIO *key=NULL;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
PW_CB_DATA cb_data;
|
||||
|
||||
cb_data.password = pass;
|
||||
cb_data.prompt_info = file;
|
||||
|
||||
if (file == NULL)
|
||||
{
|
||||
@@ -581,7 +814,8 @@ EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e)
|
||||
if (!e)
|
||||
BIO_printf(bio_err,"no engine specified\n");
|
||||
else
|
||||
pkey = ENGINE_load_private_key(e, file, pass);
|
||||
pkey = ENGINE_load_private_key(e, file,
|
||||
ui_method, &cb_data);
|
||||
goto end;
|
||||
}
|
||||
key=BIO_new(BIO_s_file());
|
||||
@@ -592,7 +826,8 @@ EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e)
|
||||
}
|
||||
if (BIO_read_filename(key,file) <= 0)
|
||||
{
|
||||
perror(file);
|
||||
BIO_printf(err, "Error opening %s %s\n", key_descrip, file);
|
||||
ERR_print_errors(err);
|
||||
goto end;
|
||||
}
|
||||
if (format == FORMAT_ASN1)
|
||||
@@ -601,8 +836,13 @@ EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e)
|
||||
}
|
||||
else if (format == FORMAT_PEM)
|
||||
{
|
||||
pkey=PEM_read_bio_PrivateKey(key,NULL,NULL,pass);
|
||||
pkey=PEM_read_bio_PrivateKey(key,NULL,
|
||||
(pem_password_cb *)password_callback, &cb_data);
|
||||
}
|
||||
#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
|
||||
else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
|
||||
pkey = load_netscape_key(err, key, file, key_descrip, format);
|
||||
#endif
|
||||
else if (format == FORMAT_PKCS12)
|
||||
{
|
||||
PKCS12 *p12 = d2i_PKCS12_bio(key, NULL);
|
||||
@@ -613,20 +853,25 @@ EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e)
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(err,"bad input format specified for key\n");
|
||||
BIO_printf(err,"bad input format specified for key file\n");
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
if (key != NULL) BIO_free(key);
|
||||
if (pkey == NULL)
|
||||
BIO_printf(err,"unable to load Private Key\n");
|
||||
BIO_printf(err,"unable to load %s\n", key_descrip);
|
||||
return(pkey);
|
||||
}
|
||||
|
||||
EVP_PKEY *load_pubkey(BIO *err, char *file, int format, ENGINE *e)
|
||||
EVP_PKEY *load_pubkey(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *key_descrip)
|
||||
{
|
||||
BIO *key=NULL;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
PW_CB_DATA cb_data;
|
||||
|
||||
cb_data.password = pass;
|
||||
cb_data.prompt_info = file;
|
||||
|
||||
if (file == NULL)
|
||||
{
|
||||
@@ -638,7 +883,8 @@ EVP_PKEY *load_pubkey(BIO *err, char *file, int format, ENGINE *e)
|
||||
if (!e)
|
||||
BIO_printf(bio_err,"no engine specified\n");
|
||||
else
|
||||
pkey = ENGINE_load_public_key(e, file, NULL);
|
||||
pkey = ENGINE_load_public_key(e, file,
|
||||
ui_method, &cb_data);
|
||||
goto end;
|
||||
}
|
||||
key=BIO_new(BIO_s_file());
|
||||
@@ -649,7 +895,8 @@ EVP_PKEY *load_pubkey(BIO *err, char *file, int format, ENGINE *e)
|
||||
}
|
||||
if (BIO_read_filename(key,file) <= 0)
|
||||
{
|
||||
perror(file);
|
||||
BIO_printf(err, "Error opening %s %s\n", key_descrip, file);
|
||||
ERR_print_errors(err);
|
||||
goto end;
|
||||
}
|
||||
if (format == FORMAT_ASN1)
|
||||
@@ -658,27 +905,83 @@ EVP_PKEY *load_pubkey(BIO *err, char *file, int format, ENGINE *e)
|
||||
}
|
||||
else if (format == FORMAT_PEM)
|
||||
{
|
||||
pkey=PEM_read_bio_PUBKEY(key,NULL,NULL,NULL);
|
||||
pkey=PEM_read_bio_PUBKEY(key,NULL,
|
||||
(pem_password_cb *)password_callback, &cb_data);
|
||||
}
|
||||
#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
|
||||
else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
|
||||
pkey = load_netscape_key(err, key, file, key_descrip, format);
|
||||
#endif
|
||||
else
|
||||
{
|
||||
BIO_printf(err,"bad input format specified for key\n");
|
||||
BIO_printf(err,"bad input format specified for key file\n");
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
if (key != NULL) BIO_free(key);
|
||||
if (pkey == NULL)
|
||||
BIO_printf(err,"unable to load Public Key\n");
|
||||
BIO_printf(err,"unable to load %s\n", key_descrip);
|
||||
return(pkey);
|
||||
}
|
||||
|
||||
STACK_OF(X509) *load_certs(BIO *err, char *file, int format)
|
||||
#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
|
||||
EVP_PKEY *
|
||||
load_netscape_key(BIO *err, BIO *key, const char *file,
|
||||
const char *key_descrip, int format)
|
||||
{
|
||||
EVP_PKEY *pkey;
|
||||
BUF_MEM *buf;
|
||||
RSA *rsa;
|
||||
const unsigned char *p;
|
||||
int size, i;
|
||||
|
||||
buf=BUF_MEM_new();
|
||||
pkey = EVP_PKEY_new();
|
||||
size = 0;
|
||||
if (buf == NULL || pkey == NULL)
|
||||
goto error;
|
||||
for (;;)
|
||||
{
|
||||
if (!BUF_MEM_grow(buf,size+1024*10))
|
||||
goto error;
|
||||
i = BIO_read(key, &(buf->data[size]), 1024*10);
|
||||
size += i;
|
||||
if (i == 0)
|
||||
break;
|
||||
if (i < 0)
|
||||
{
|
||||
BIO_printf(err, "Error reading %s %s",
|
||||
key_descrip, file);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
p=(unsigned char *)buf->data;
|
||||
rsa = d2i_RSA_NET(NULL,&p,(long)size,NULL,
|
||||
(format == FORMAT_IISSGC ? 1 : 0));
|
||||
if (rsa == NULL)
|
||||
goto error;
|
||||
BUF_MEM_free(buf);
|
||||
EVP_PKEY_set1_RSA(pkey, rsa);
|
||||
return pkey;
|
||||
error:
|
||||
BUF_MEM_free(buf);
|
||||
EVP_PKEY_free(pkey);
|
||||
return NULL;
|
||||
}
|
||||
#endif /* ndef OPENSSL_NO_RC4 */
|
||||
|
||||
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *cert_descrip)
|
||||
{
|
||||
BIO *certs;
|
||||
int i;
|
||||
STACK_OF(X509) *othercerts = NULL;
|
||||
STACK_OF(X509_INFO) *allcerts = NULL;
|
||||
X509_INFO *xi;
|
||||
PW_CB_DATA cb_data;
|
||||
|
||||
cb_data.password = pass;
|
||||
cb_data.prompt_info = file;
|
||||
|
||||
if((certs = BIO_new(BIO_s_file())) == NULL)
|
||||
{
|
||||
@@ -692,7 +995,9 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format)
|
||||
{
|
||||
if (BIO_read_filename(certs,file) <= 0)
|
||||
{
|
||||
perror(file);
|
||||
BIO_printf(err, "Error opening %s %s\n",
|
||||
cert_descrip, file);
|
||||
ERR_print_errors(err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -706,7 +1011,8 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format)
|
||||
othercerts = NULL;
|
||||
goto end;
|
||||
}
|
||||
allcerts = PEM_X509_INFO_read_bio(certs, NULL, NULL, NULL);
|
||||
allcerts = PEM_X509_INFO_read_bio(certs, NULL,
|
||||
(pem_password_cb *)password_callback, &cb_data);
|
||||
for(i = 0; i < sk_X509_INFO_num(allcerts); i++)
|
||||
{
|
||||
xi = sk_X509_INFO_value (allcerts, i);
|
||||
@@ -719,7 +1025,8 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format)
|
||||
goto end;
|
||||
}
|
||||
else {
|
||||
BIO_printf(err,"bad input format specified for input cert\n");
|
||||
BIO_printf(err,"bad input format specified for %s\n",
|
||||
cert_descrip);
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
@@ -744,10 +1051,14 @@ end:
|
||||
/* BIO_dump unknown extensions */
|
||||
#define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
|
||||
|
||||
#define X509_FLAG_CA (X509_FLAG_NO_ISSUER | X509_FLAG_NO_PUBKEY | \
|
||||
X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION)
|
||||
|
||||
int set_cert_ex(unsigned long *flags, const char *arg)
|
||||
{
|
||||
static const NAME_EX_TBL cert_tbl[] = {
|
||||
{ "compatible", X509_FLAG_COMPAT, 0xffffffffl},
|
||||
{ "ca_default", X509_FLAG_CA, 0xffffffffl},
|
||||
{ "no_header", X509_FLAG_NO_HEADER, 0},
|
||||
{ "no_version", X509_FLAG_NO_VERSION, 0},
|
||||
{ "no_serial", X509_FLAG_NO_SERIAL, 0},
|
||||
@@ -765,7 +1076,7 @@ int set_cert_ex(unsigned long *flags, const char *arg)
|
||||
{ "ext_dump", X509V3_EXT_DUMP_UNKNOWN, X509V3_EXT_UNKNOWN_MASK},
|
||||
{ NULL, 0, 0}
|
||||
};
|
||||
return set_table_opts(flags, arg, cert_tbl);
|
||||
return set_multi_opts(flags, arg, cert_tbl);
|
||||
}
|
||||
|
||||
int set_name_ex(unsigned long *flags, const char *arg)
|
||||
@@ -790,15 +1101,89 @@ int set_name_ex(unsigned long *flags, const char *arg)
|
||||
{ "nofname", XN_FLAG_FN_NONE, XN_FLAG_FN_MASK},
|
||||
{ "sname", XN_FLAG_FN_SN, XN_FLAG_FN_MASK},
|
||||
{ "lname", XN_FLAG_FN_LN, XN_FLAG_FN_MASK},
|
||||
{ "align", XN_FLAG_FN_ALIGN, 0},
|
||||
{ "oid", XN_FLAG_FN_OID, XN_FLAG_FN_MASK},
|
||||
{ "space_eq", XN_FLAG_SPC_EQ, 0},
|
||||
{ "dump_unknown", XN_FLAG_DUMP_UNKNOWN_FIELDS, 0},
|
||||
{ "RFC2253", XN_FLAG_RFC2253, 0xffffffffL},
|
||||
{ "oneline", XN_FLAG_ONELINE, 0xffffffffL},
|
||||
{ "multiline", XN_FLAG_MULTILINE, 0xffffffffL},
|
||||
{ "ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
|
||||
{ NULL, 0, 0}
|
||||
};
|
||||
return set_table_opts(flags, arg, ex_tbl);
|
||||
return set_multi_opts(flags, arg, ex_tbl);
|
||||
}
|
||||
|
||||
int set_ext_copy(int *copy_type, const char *arg)
|
||||
{
|
||||
if (!strcasecmp(arg, "none"))
|
||||
*copy_type = EXT_COPY_NONE;
|
||||
else if (!strcasecmp(arg, "copy"))
|
||||
*copy_type = EXT_COPY_ADD;
|
||||
else if (!strcasecmp(arg, "copyall"))
|
||||
*copy_type = EXT_COPY_ALL;
|
||||
else
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int copy_extensions(X509 *x, X509_REQ *req, int copy_type)
|
||||
{
|
||||
STACK_OF(X509_EXTENSION) *exts = NULL;
|
||||
X509_EXTENSION *ext, *tmpext;
|
||||
ASN1_OBJECT *obj;
|
||||
int i, idx, ret = 0;
|
||||
if (!x || !req || (copy_type == EXT_COPY_NONE))
|
||||
return 1;
|
||||
exts = X509_REQ_get_extensions(req);
|
||||
|
||||
for(i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
|
||||
ext = sk_X509_EXTENSION_value(exts, i);
|
||||
obj = X509_EXTENSION_get_object(ext);
|
||||
idx = X509_get_ext_by_OBJ(x, obj, -1);
|
||||
/* Does extension exist? */
|
||||
if (idx != -1) {
|
||||
/* If normal copy don't override existing extension */
|
||||
if (copy_type == EXT_COPY_ADD)
|
||||
continue;
|
||||
/* Delete all extensions of same type */
|
||||
do {
|
||||
tmpext = X509_get_ext(x, idx);
|
||||
X509_delete_ext(x, idx);
|
||||
X509_EXTENSION_free(tmpext);
|
||||
idx = X509_get_ext_by_OBJ(x, obj, -1);
|
||||
} while (idx != -1);
|
||||
}
|
||||
if (!X509_add_ext(x, ext, -1))
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = 1;
|
||||
|
||||
end:
|
||||
|
||||
sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static int set_multi_opts(unsigned long *flags, const char *arg, const NAME_EX_TBL *in_tbl)
|
||||
{
|
||||
STACK_OF(CONF_VALUE) *vals;
|
||||
CONF_VALUE *val;
|
||||
int i, ret = 1;
|
||||
if(!arg) return 0;
|
||||
vals = X509V3_parse_list(arg);
|
||||
for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
|
||||
val = sk_CONF_VALUE_value(vals, i);
|
||||
if (!set_table_opts(flags, val->name, in_tbl))
|
||||
ret = 0;
|
||||
}
|
||||
sk_CONF_VALUE_pop_free(vals, X509V3_conf_free);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int set_table_opts(unsigned long *flags, const char *arg, const NAME_EX_TBL *in_tbl)
|
||||
@@ -876,3 +1261,78 @@ X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath)
|
||||
X509_STORE_free(store);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Try to load an engine in a shareable library */
|
||||
static ENGINE *try_load_engine(BIO *err, const char *engine, int debug)
|
||||
{
|
||||
ENGINE *e = ENGINE_by_id("dynamic");
|
||||
if (e)
|
||||
{
|
||||
if (!ENGINE_ctrl_cmd_string(e, "SO_PATH", engine, 0)
|
||||
|| !ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0))
|
||||
{
|
||||
ENGINE_free(e);
|
||||
e = NULL;
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
ENGINE *setup_engine(BIO *err, const char *engine, int debug)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
|
||||
if (engine)
|
||||
{
|
||||
if(strcmp(engine, "auto") == 0)
|
||||
{
|
||||
BIO_printf(err,"enabling auto ENGINE support\n");
|
||||
ENGINE_register_all_complete();
|
||||
return NULL;
|
||||
}
|
||||
if((e = ENGINE_by_id(engine)) == NULL
|
||||
&& (e = try_load_engine(err, engine, debug)) == NULL)
|
||||
{
|
||||
BIO_printf(err,"invalid engine \"%s\"\n", engine);
|
||||
ERR_print_errors(err);
|
||||
return NULL;
|
||||
}
|
||||
if (debug)
|
||||
{
|
||||
ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
|
||||
0, err, 0);
|
||||
}
|
||||
ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, ui_method, 0, 1);
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(err,"can't use that engine\n");
|
||||
ERR_print_errors(err);
|
||||
ENGINE_free(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BIO_printf(err,"engine \"%s\" set.\n", ENGINE_get_id(e));
|
||||
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
int load_config(BIO *err, CONF *cnf)
|
||||
{
|
||||
if (!cnf)
|
||||
cnf = config;
|
||||
if (!cnf)
|
||||
return 1;
|
||||
|
||||
OPENSSL_load_builtin_modules();
|
||||
|
||||
if (CONF_modules_load(cnf, NULL, 0) <= 0)
|
||||
{
|
||||
BIO_printf(err, "Error configuring OpenSSL\n");
|
||||
ERR_print_errors(err);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
130
apps/apps.h
130
apps/apps.h
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_APPS_H
|
||||
#define HEADER_APPS_H
|
||||
@@ -67,7 +120,9 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/txt_db.h>
|
||||
#include <openssl/engine.h>
|
||||
#include <openssl/ossl_typ.h>
|
||||
|
||||
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
|
||||
int app_RAND_write_file(const char *file, BIO *bio_e);
|
||||
@@ -79,10 +134,6 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
||||
* (see e_os.h). The string is
|
||||
* destroyed! */
|
||||
|
||||
#ifdef OPENSSL_NO_STDIO
|
||||
BIO_METHOD *BIO_s_file();
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_SYS_WIN32
|
||||
#define rename(from,to) WIN32_rename((from),(to))
|
||||
int WIN32_rename(char *oldname,char *newname);
|
||||
@@ -101,7 +152,7 @@ extern BIO *bio_err;
|
||||
#else
|
||||
|
||||
#define MAIN(a,v) PROG(a,v)
|
||||
extern LHASH *config;
|
||||
extern CONF *config;
|
||||
extern char *default_config_file;
|
||||
extern BIO *bio_err;
|
||||
|
||||
@@ -116,24 +167,34 @@ extern BIO *bio_err;
|
||||
#endif
|
||||
|
||||
#if defined(MONOLITH) && !defined(OPENSSL_C)
|
||||
# define apps_startup() do_pipe_sig()
|
||||
# define apps_startup() \
|
||||
do_pipe_sig()
|
||||
# define apps_shutdown()
|
||||
#else
|
||||
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
|
||||
defined(OPENSSL_SYS_WIN32)
|
||||
# ifdef _O_BINARY
|
||||
# define apps_startup() \
|
||||
_fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
OpenSSL_add_all_algorithms(); ENGINE_load_builtin_engines()
|
||||
do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
||||
# else
|
||||
# define apps_startup() \
|
||||
_fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
OpenSSL_add_all_algorithms(); ENGINE_load_builtin_engines()
|
||||
do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
||||
# endif
|
||||
# else
|
||||
# define apps_startup() \
|
||||
do_pipe_sig(); OpenSSL_add_all_algorithms(); \
|
||||
ENGINE_load_builtin_engines()
|
||||
do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
|
||||
ERR_load_crypto_strings(); ENGINE_load_builtin_engines(); \
|
||||
setup_ui_method(); } while(0)
|
||||
# endif
|
||||
# define apps_shutdown() \
|
||||
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||
EVP_cleanup(); ENGINE_cleanup(); \
|
||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
|
||||
ERR_free_strings(); } while(0)
|
||||
#endif
|
||||
|
||||
typedef struct args_st
|
||||
@@ -142,6 +203,19 @@ typedef struct args_st
|
||||
int count;
|
||||
} ARGS;
|
||||
|
||||
#define PW_MIN_LENGTH 4
|
||||
typedef struct pw_cb_data
|
||||
{
|
||||
const void *password;
|
||||
const char *prompt_info;
|
||||
} PW_CB_DATA;
|
||||
|
||||
int password_callback(char *buf, int bufsiz, int verify,
|
||||
PW_CB_DATA *cb_data);
|
||||
|
||||
int setup_ui_method(void);
|
||||
void destroy_ui_method(void);
|
||||
|
||||
int should_retry(int i);
|
||||
int args_from_file(char *file, int *argc, char **argv[]);
|
||||
int str2fmt(char *s);
|
||||
@@ -153,13 +227,29 @@ void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags);
|
||||
#endif
|
||||
int set_cert_ex(unsigned long *flags, const char *arg);
|
||||
int set_name_ex(unsigned long *flags, const char *arg);
|
||||
int set_ext_copy(int *copy_type, const char *arg);
|
||||
int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
|
||||
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
|
||||
int add_oid_section(BIO *err, LHASH *conf);
|
||||
X509 *load_cert(BIO *err, char *file, int format);
|
||||
EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e);
|
||||
EVP_PKEY *load_pubkey(BIO *err, char *file, int format, ENGINE *e);
|
||||
STACK_OF(X509) *load_certs(BIO *err, char *file, int format);
|
||||
int add_oid_section(BIO *err, CONF *conf);
|
||||
X509 *load_cert(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||
EVP_PKEY *load_key(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *key_descrip);
|
||||
EVP_PKEY *load_pubkey(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *key_descrip);
|
||||
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
|
||||
ENGINE *setup_engine(BIO *err, const char *engine, int debug);
|
||||
|
||||
int load_config(BIO *err, CONF *cnf);
|
||||
|
||||
/* Functions defined in ca.c and also used in ocsp.c */
|
||||
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||
ASN1_GENERALIZEDTIME **pinvtm, char *str);
|
||||
int make_serial_index(TXT_DB *db);
|
||||
|
||||
X509_NAME *do_subject(char *str, long chtype);
|
||||
|
||||
#define FORMAT_UNDEF 0
|
||||
#define FORMAT_ASN1 1
|
||||
@@ -169,6 +259,12 @@ X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
|
||||
#define FORMAT_PKCS12 5
|
||||
#define FORMAT_SMIME 6
|
||||
#define FORMAT_ENGINE 7
|
||||
#define FORMAT_IISSGC 8 /* XXX this stupid macro helps us to avoid
|
||||
* adding yet another param to load_*key() */
|
||||
|
||||
#define EXT_COPY_NONE 0
|
||||
#define EXT_COPY_ADD 1
|
||||
#define EXT_COPY_ALL 2
|
||||
|
||||
#define NETSCAPE_CERT_HDR "certificate"
|
||||
|
||||
|
||||
@@ -103,6 +103,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
prog=argv[0];
|
||||
argc--;
|
||||
argv++;
|
||||
@@ -181,7 +184,7 @@ bad:
|
||||
BIO_printf(bio_err,"where options are\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER TXT PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -out arg output file (output format is always DER\n");
|
||||
BIO_printf(bio_err," -noout arg don't produce any output\n");
|
||||
BIO_printf(bio_err," -offset arg offset into file\n");
|
||||
BIO_printf(bio_err," -length arg length of section in file\n");
|
||||
@@ -192,7 +195,6 @@ bad:
|
||||
BIO_printf(bio_err," -strparse offset\n");
|
||||
BIO_printf(bio_err," a series of these can be used to 'dig' into multiple\n");
|
||||
BIO_printf(bio_err," ASN1 blob wrappings\n");
|
||||
BIO_printf(bio_err," -out filename output DER encoding to file\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -329,6 +331,7 @@ end:
|
||||
if (at != NULL) ASN1_TYPE_free(at);
|
||||
if (osk != NULL) sk_free(osk);
|
||||
OBJ_cleanup();
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -202,6 +202,7 @@ end:
|
||||
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||
if (ssl != NULL) SSL_free(ssl);
|
||||
if (STDout != NULL) BIO_free_all(STDout);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
23
apps/crl.c
23
apps/crl.c
@@ -87,6 +87,7 @@ static char *crl_usage[]={
|
||||
" -noout - no CRL output\n",
|
||||
" -CAfile name - verify CRL using certificates in file \"name\"\n",
|
||||
" -CApath dir - verify CRL using certificates in \"dir\"\n",
|
||||
" -nameopt arg - various certificate name options\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -97,6 +98,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
unsigned long nmflag = 0;
|
||||
X509_CRL *x=NULL;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
int ret=1,i,num,badops=0;
|
||||
@@ -105,7 +107,7 @@ int MAIN(int argc, char **argv)
|
||||
char *infile=NULL,*outfile=NULL;
|
||||
int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
|
||||
int fingerprint = 0;
|
||||
char **pp,buf[256];
|
||||
char **pp;
|
||||
X509_STORE *store = NULL;
|
||||
X509_STORE_CTX ctx;
|
||||
X509_LOOKUP *lookup = NULL;
|
||||
@@ -120,6 +122,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
if (bio_out == NULL)
|
||||
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
|
||||
{
|
||||
@@ -185,6 +190,11 @@ int MAIN(int argc, char **argv)
|
||||
text = 1;
|
||||
else if (strcmp(*argv,"-hash") == 0)
|
||||
hash= ++num;
|
||||
else if (strcmp(*argv,"-nameopt") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
if (!set_name_ex(&nmflag, *(++argv))) goto bad;
|
||||
}
|
||||
else if (strcmp(*argv,"-issuer") == 0)
|
||||
issuer= ++num;
|
||||
else if (strcmp(*argv,"-lastupdate") == 0)
|
||||
@@ -235,7 +245,11 @@ bad:
|
||||
X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
ERR_clear_error();
|
||||
|
||||
X509_STORE_CTX_init(&ctx, store, NULL, NULL);
|
||||
if(!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) {
|
||||
BIO_printf(bio_err,
|
||||
"Error initialising X509 store\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
i = X509_STORE_get_by_subject(&ctx, X509_LU_X509,
|
||||
X509_CRL_get_issuer(x), &xobj);
|
||||
@@ -264,9 +278,7 @@ bad:
|
||||
{
|
||||
if (issuer == i)
|
||||
{
|
||||
X509_NAME_oneline(X509_CRL_get_issuer(x),
|
||||
buf,256);
|
||||
BIO_printf(bio_out,"issuer= %s\n",buf);
|
||||
print_name(bio_out, "issuer=", X509_CRL_get_issuer(x), nmflag);
|
||||
}
|
||||
|
||||
if (hash == i)
|
||||
@@ -364,6 +376,7 @@ end:
|
||||
X509_STORE_CTX_cleanup(&ctx);
|
||||
X509_STORE_free(store);
|
||||
}
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,8 @@ bad:
|
||||
BIO_printf(bio_err," -certfile arg certificates file of chain to a trusted CA\n");
|
||||
BIO_printf(bio_err," (can be used more than once)\n");
|
||||
BIO_printf(bio_err," -nocrl no crl to load, just certs from '-certfile'\n");
|
||||
EXIT(1);
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
@@ -278,6 +279,7 @@ end:
|
||||
if (p7 != NULL) PKCS7_free(p7);
|
||||
if (crl != NULL) X509_CRL_free(crl);
|
||||
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
132
apps/dgst.c
132
apps/dgst.c
@@ -66,7 +66,6 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef BUFSIZE
|
||||
#define BUFSIZE 1024*8
|
||||
@@ -74,8 +73,9 @@
|
||||
#undef PROG
|
||||
#define PROG dgst_main
|
||||
|
||||
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen);
|
||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||
const char *file);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -89,8 +89,8 @@ int MAIN(int argc, char **argv)
|
||||
BIO *bmd=NULL;
|
||||
BIO *out = NULL;
|
||||
const char *name;
|
||||
#define PROG_NAME_SIZE 16
|
||||
char pname[PROG_NAME_SIZE];
|
||||
#define PROG_NAME_SIZE 39
|
||||
char pname[PROG_NAME_SIZE+1];
|
||||
int separator=0;
|
||||
int debug=0;
|
||||
int keyform=FORMAT_PEM;
|
||||
@@ -113,6 +113,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
/* first check the program name */
|
||||
program_name(argv[0],pname,PROG_NAME_SIZE);
|
||||
|
||||
@@ -225,23 +228,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
bmd=BIO_new(BIO_f_md());
|
||||
@@ -289,52 +276,19 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if(keyfile)
|
||||
{
|
||||
if (keyform == FORMAT_PEM)
|
||||
{
|
||||
BIO *keybio;
|
||||
keybio = BIO_new_file(keyfile, "r");
|
||||
if(!keybio)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Error opening key file %s\n",
|
||||
keyfile);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if(want_pub)
|
||||
sigkey = PEM_read_bio_PUBKEY(keybio,
|
||||
NULL, NULL, NULL);
|
||||
else
|
||||
sigkey = PEM_read_bio_PrivateKey(keybio,
|
||||
NULL, NULL, NULL);
|
||||
BIO_free(keybio);
|
||||
}
|
||||
else if (keyform == FORMAT_ENGINE)
|
||||
{
|
||||
if (!e)
|
||||
{
|
||||
BIO_printf(bio_err,"no engine specified\n");
|
||||
goto end;
|
||||
}
|
||||
if (want_pub)
|
||||
sigkey = ENGINE_load_public_key(e, keyfile, NULL);
|
||||
else
|
||||
sigkey = ENGINE_load_private_key(e, keyfile, NULL);
|
||||
}
|
||||
if (want_pub)
|
||||
sigkey = load_pubkey(bio_err, keyfile, keyform, NULL,
|
||||
e, "key file");
|
||||
else
|
||||
sigkey = load_key(bio_err, keyfile, keyform, NULL,
|
||||
e, "key file");
|
||||
if (!sigkey)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"bad input format specified for key file\n");
|
||||
/* load_[pub]key() has already printed an appropriate
|
||||
message */
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!sigkey) {
|
||||
BIO_printf(bio_err, "Error reading key file %s\n",
|
||||
keyfile);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if(sigfile && sigkey) {
|
||||
BIO *sigbio;
|
||||
@@ -366,22 +320,36 @@ int MAIN(int argc, char **argv)
|
||||
if (argc == 0)
|
||||
{
|
||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
do_fp(out, buf,inp,separator, out_bin, sigkey, sigbuf, siglen);
|
||||
err=do_fp(out, buf,inp,separator, out_bin, sigkey, sigbuf,
|
||||
siglen,"","(stdin)");
|
||||
}
|
||||
else
|
||||
{
|
||||
name=OBJ_nid2sn(md->type);
|
||||
for (i=0; i<argc; i++)
|
||||
{
|
||||
char *tmp,*tofree=NULL;
|
||||
int r;
|
||||
|
||||
if (BIO_read_filename(in,argv[i]) <= 0)
|
||||
{
|
||||
perror(argv[i]);
|
||||
err++;
|
||||
continue;
|
||||
}
|
||||
if(!out_bin) BIO_printf(out, "%s(%s)= ",name,argv[i]);
|
||||
do_fp(out, buf,inp,separator, out_bin, sigkey,
|
||||
sigbuf, siglen);
|
||||
if(!out_bin)
|
||||
{
|
||||
tmp=tofree=OPENSSL_malloc(strlen(name)+strlen(argv[i])+5);
|
||||
sprintf(tmp,"%s(%s)= ",name,argv[i]);
|
||||
}
|
||||
else
|
||||
tmp="";
|
||||
r=do_fp(out,buf,inp,separator,out_bin,sigkey,sigbuf,
|
||||
siglen,tmp,argv[i]);
|
||||
if(r)
|
||||
err=r;
|
||||
if(tofree)
|
||||
OPENSSL_free(tofree);
|
||||
(void)BIO_reset(bmd);
|
||||
}
|
||||
}
|
||||
@@ -396,11 +364,13 @@ end:
|
||||
EVP_PKEY_free(sigkey);
|
||||
if(sigbuf) OPENSSL_free(sigbuf);
|
||||
if (bmd != NULL) BIO_free(bmd);
|
||||
apps_shutdown();
|
||||
EXIT(err);
|
||||
}
|
||||
|
||||
void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen)
|
||||
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||
const char *file)
|
||||
{
|
||||
int len;
|
||||
int i;
|
||||
@@ -408,21 +378,33 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
for (;;)
|
||||
{
|
||||
i=BIO_read(bp,(char *)buf,BUFSIZE);
|
||||
if (i <= 0) break;
|
||||
if(i < 0)
|
||||
{
|
||||
BIO_printf(bio_err, "Read Error in %s\n",file);
|
||||
ERR_print_errors(bio_err);
|
||||
return 1;
|
||||
}
|
||||
if (i == 0) break;
|
||||
}
|
||||
if(sigin)
|
||||
{
|
||||
EVP_MD_CTX *ctx;
|
||||
BIO_get_md_ctx(bp, &ctx);
|
||||
i = EVP_VerifyFinal(ctx, sigin, (unsigned int)siglen, key);
|
||||
if(i > 0) BIO_printf(out, "Verified OK\n");
|
||||
else if(i == 0) BIO_printf(out, "Verification Failure\n");
|
||||
if(i > 0)
|
||||
BIO_printf(out, "Verified OK\n");
|
||||
else if(i == 0)
|
||||
{
|
||||
BIO_printf(out, "Verification Failure\n");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err, "Error Verifying Data\n");
|
||||
ERR_print_errors(bio_err);
|
||||
return 1;
|
||||
}
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
if(key)
|
||||
{
|
||||
@@ -432,7 +414,7 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
{
|
||||
BIO_printf(bio_err, "Error Signing Data\n");
|
||||
ERR_print_errors(bio_err);
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -441,6 +423,7 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
if(binout) BIO_write(out, buf, len);
|
||||
else
|
||||
{
|
||||
BIO_write(out,title,strlen(title));
|
||||
for (i=0; i<len; i++)
|
||||
{
|
||||
if (sep && (i != 0))
|
||||
@@ -449,5 +432,6 @@ void do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
}
|
||||
BIO_printf(out, "\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
23
apps/dh.c
23
apps/dh.c
@@ -69,7 +69,6 @@
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dh_main
|
||||
@@ -101,6 +100,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
engine=NULL;
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
@@ -174,23 +176,7 @@ bad:
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
@@ -346,6 +332,7 @@ end:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (dh != NULL) DH_free(dh);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -121,7 +121,6 @@
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
#include <openssl/dsa.h>
|
||||
@@ -167,6 +166,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
informat=FORMAT_PEM;
|
||||
@@ -257,23 +259,7 @@ bad:
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if (g && !num)
|
||||
num = DEFBITS;
|
||||
@@ -504,7 +490,7 @@ bad:
|
||||
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
||||
printf("\t\t{ DH_free(dh); return(NULL); }\n");
|
||||
if (dh->length)
|
||||
printf("\tdh->length = %d;\n", dh->length);
|
||||
printf("\tdh->length = %ld;\n", dh->length);
|
||||
printf("\treturn(dh);\n\t}\n");
|
||||
OPENSSL_free(data);
|
||||
}
|
||||
@@ -532,6 +518,7 @@ end:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (dh != NULL) DH_free(dh);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
30
apps/dsa.c
30
apps/dsa.c
@@ -68,7 +68,6 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dsa_main
|
||||
@@ -80,6 +79,9 @@
|
||||
* -des - encrypt output if PEM format with DES in cbc mode
|
||||
* -des3 - encrypt output if PEM format
|
||||
* -idea - encrypt output if PEM format
|
||||
* -aes128 - encrypt output if PEM format
|
||||
* -aes192 - encrypt output if PEM format
|
||||
* -aes256 - encrypt output if PEM format
|
||||
* -text - print a text version
|
||||
* -modulus - print the DSA public key
|
||||
*/
|
||||
@@ -107,6 +109,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
engine=NULL;
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
@@ -189,6 +194,10 @@ bad:
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -noout don't print key out\n");
|
||||
@@ -198,23 +207,7 @@ bad:
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
@@ -320,6 +313,7 @@ end:
|
||||
if(dsa != NULL) DSA_free(dsa);
|
||||
if(passin) OPENSSL_free(passin);
|
||||
if(passout) OPENSSL_free(passout);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dsaparam_main
|
||||
@@ -107,6 +106,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
informat=FORMAT_PEM;
|
||||
@@ -184,9 +186,10 @@ bad:
|
||||
BIO_printf(bio_err," -outform arg output format - DER or PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -text print as text\n");
|
||||
BIO_printf(bio_err," -C Output C code\n");
|
||||
BIO_printf(bio_err," -noout no output\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," -engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," number number of bits to use for generating private key\n");
|
||||
@@ -232,23 +235,7 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if (need_rand)
|
||||
{
|
||||
@@ -384,6 +371,7 @@ end:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (dsa != NULL) DSA_free(dsa);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
40
apps/enc.c
40
apps/enc.c
@@ -66,11 +66,7 @@
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/rand.h>
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
#include <openssl/md5.h>
|
||||
#endif
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int set_hex(char *in,unsigned char *out,int size);
|
||||
@@ -82,7 +78,7 @@ int set_hex(char *in,unsigned char *out,int size);
|
||||
#define BSIZE (8*1024)
|
||||
#define PROG enc_main
|
||||
|
||||
void show_ciphers(const OBJ_NAME *name,void *bio_)
|
||||
static void show_ciphers(const OBJ_NAME *name,void *bio_)
|
||||
{
|
||||
BIO *bio=bio_;
|
||||
static int n;
|
||||
@@ -121,8 +117,8 @@ int MAIN(int argc, char **argv)
|
||||
const EVP_CIPHER *cipher=NULL,*c;
|
||||
char *inf=NULL,*outf=NULL;
|
||||
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
|
||||
#define PROG_NAME_SIZE 16
|
||||
char pname[PROG_NAME_SIZE];
|
||||
#define PROG_NAME_SIZE 39
|
||||
char pname[PROG_NAME_SIZE+1];
|
||||
char *engine = NULL;
|
||||
|
||||
apps_startup();
|
||||
@@ -131,6 +127,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
/* first check the program name */
|
||||
program_name(argv[0],pname,PROG_NAME_SIZE);
|
||||
if (strcmp(pname,"base64") == 0)
|
||||
@@ -285,23 +284,7 @@ bad:
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if (bufsize != NULL)
|
||||
{
|
||||
@@ -507,6 +490,14 @@ bad:
|
||||
BIO_printf(bio_err,"invalid hex iv value\n");
|
||||
goto end;
|
||||
}
|
||||
if ((hiv == NULL) && (str == NULL))
|
||||
{
|
||||
/* No IV was explicitly set and no IV was generated
|
||||
* during EVP_BytesToKey. Hence the IV is undefined,
|
||||
* making correct decryption impossible. */
|
||||
BIO_printf(bio_err, "iv undefined\n");
|
||||
goto end;
|
||||
}
|
||||
if ((hkey != NULL) && !set_hex(hkey,key,sizeof key))
|
||||
{
|
||||
BIO_printf(bio_err,"invalid hex key value\n");
|
||||
@@ -594,6 +585,7 @@ end:
|
||||
if (benc != NULL) BIO_free(benc);
|
||||
if (b64 != NULL) BIO_free(b64);
|
||||
if(pass) OPENSSL_free(pass);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
335
apps/engine.c
335
apps/engine.c
@@ -72,9 +72,20 @@
|
||||
|
||||
static char *engine_usage[]={
|
||||
"usage: engine opts [engine ...]\n",
|
||||
" -v - verbose mode, a textual listing of the engines in OpenSSL\n",
|
||||
" -v[v[v[v]]] - verbose mode, for each engine, list its 'control commands'\n",
|
||||
" -vv will additionally display each command's description\n",
|
||||
" -vvv will also add the input flags for each command\n",
|
||||
" -vvvv will also show internal input flags\n",
|
||||
" -c - for each engine, also list the capabilities\n",
|
||||
" -t - for each engine, check that they are really available\n",
|
||||
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n",
|
||||
" to load it (if -t is used)\n",
|
||||
" -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n",
|
||||
" (only used if -t is also provided)\n",
|
||||
" NB: -pre and -post will be applied to all ENGINEs supplied on the command\n",
|
||||
" line, or all supported ENGINEs if none are specified.\n",
|
||||
" Eg. '-pre \"SO_PATH:/lib/libdriver.so\"' calls command \"SO_PATH\" with\n",
|
||||
" argument \"/lib/libdriver.so\".\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -83,7 +94,7 @@ static void identity(void *ptr)
|
||||
return;
|
||||
}
|
||||
|
||||
static int append_buf(char **buf, char *s, int *size, int step)
|
||||
static int append_buf(char **buf, const char *s, int *size, int step)
|
||||
{
|
||||
int l = strlen(s);
|
||||
|
||||
@@ -115,6 +126,216 @@ static int append_buf(char **buf, char *s, int *size, int step)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
|
||||
{
|
||||
int started = 0, err = 0;
|
||||
/* Indent before displaying input flags */
|
||||
BIO_printf(bio_out, "%s%s(input flags): ", indent, indent);
|
||||
if(flags == 0)
|
||||
{
|
||||
BIO_printf(bio_out, "<no flags>\n");
|
||||
return 1;
|
||||
}
|
||||
/* If the object is internal, mark it in a way that shows instead of
|
||||
* having it part of all the other flags, even if it really is. */
|
||||
if(flags & ENGINE_CMD_FLAG_INTERNAL)
|
||||
{
|
||||
BIO_printf(bio_out, "[Internal] ");
|
||||
}
|
||||
|
||||
if(flags & ENGINE_CMD_FLAG_NUMERIC)
|
||||
{
|
||||
if(started)
|
||||
{
|
||||
BIO_printf(bio_out, "|");
|
||||
err = 1;
|
||||
}
|
||||
BIO_printf(bio_out, "NUMERIC");
|
||||
started = 1;
|
||||
}
|
||||
/* Now we check that no combinations of the mutually exclusive NUMERIC,
|
||||
* STRING, and NO_INPUT flags have been used. Future flags that can be
|
||||
* OR'd together with these would need to added after these to preserve
|
||||
* the testing logic. */
|
||||
if(flags & ENGINE_CMD_FLAG_STRING)
|
||||
{
|
||||
if(started)
|
||||
{
|
||||
BIO_printf(bio_out, "|");
|
||||
err = 1;
|
||||
}
|
||||
BIO_printf(bio_out, "STRING");
|
||||
started = 1;
|
||||
}
|
||||
if(flags & ENGINE_CMD_FLAG_NO_INPUT)
|
||||
{
|
||||
if(started)
|
||||
{
|
||||
BIO_printf(bio_out, "|");
|
||||
err = 1;
|
||||
}
|
||||
BIO_printf(bio_out, "NO_INPUT");
|
||||
started = 1;
|
||||
}
|
||||
/* Check for unknown flags */
|
||||
flags = flags & ~ENGINE_CMD_FLAG_NUMERIC &
|
||||
~ENGINE_CMD_FLAG_STRING &
|
||||
~ENGINE_CMD_FLAG_NO_INPUT &
|
||||
~ENGINE_CMD_FLAG_INTERNAL;
|
||||
if(flags)
|
||||
{
|
||||
if(started) BIO_printf(bio_out, "|");
|
||||
BIO_printf(bio_out, "<0x%04X>", flags);
|
||||
}
|
||||
if(err)
|
||||
BIO_printf(bio_out, " <illegal flags!>");
|
||||
BIO_printf(bio_out, "\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent)
|
||||
{
|
||||
static const int line_wrap = 78;
|
||||
int num;
|
||||
int ret = 0;
|
||||
char *name = NULL;
|
||||
char *desc = NULL;
|
||||
int flags;
|
||||
int xpos = 0;
|
||||
STACK *cmds = NULL;
|
||||
if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
|
||||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
|
||||
0, NULL, NULL)) <= 0))
|
||||
{
|
||||
#if 0
|
||||
BIO_printf(bio_out, "%s<no control commands>\n", indent);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmds = sk_new_null();
|
||||
|
||||
if(!cmds)
|
||||
goto err;
|
||||
do {
|
||||
int len;
|
||||
/* Get the command input flags */
|
||||
if((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num,
|
||||
NULL, NULL)) < 0)
|
||||
goto err;
|
||||
if (!(flags & ENGINE_CMD_FLAG_INTERNAL) || verbose >= 4)
|
||||
{
|
||||
/* Get the command name */
|
||||
if((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_LEN_FROM_CMD, num,
|
||||
NULL, NULL)) <= 0)
|
||||
goto err;
|
||||
if((name = OPENSSL_malloc(len + 1)) == NULL)
|
||||
goto err;
|
||||
if(ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_FROM_CMD, num, name,
|
||||
NULL) <= 0)
|
||||
goto err;
|
||||
/* Get the command description */
|
||||
if((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_LEN_FROM_CMD, num,
|
||||
NULL, NULL)) < 0)
|
||||
goto err;
|
||||
if(len > 0)
|
||||
{
|
||||
if((desc = OPENSSL_malloc(len + 1)) == NULL)
|
||||
goto err;
|
||||
if(ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_FROM_CMD, num, desc,
|
||||
NULL) <= 0)
|
||||
goto err;
|
||||
}
|
||||
/* Now decide on the output */
|
||||
if(xpos == 0)
|
||||
/* Do an indent */
|
||||
xpos = BIO_printf(bio_out, indent);
|
||||
else
|
||||
/* Otherwise prepend a ", " */
|
||||
xpos += BIO_printf(bio_out, ", ");
|
||||
if(verbose == 1)
|
||||
{
|
||||
/* We're just listing names, comma-delimited */
|
||||
if((xpos > (int)strlen(indent)) &&
|
||||
(xpos + (int)strlen(name) > line_wrap))
|
||||
{
|
||||
BIO_printf(bio_out, "\n");
|
||||
xpos = BIO_printf(bio_out, indent);
|
||||
}
|
||||
xpos += BIO_printf(bio_out, "%s", name);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We're listing names plus descriptions */
|
||||
BIO_printf(bio_out, "%s: %s\n", name,
|
||||
(desc == NULL) ? "<no description>" : desc);
|
||||
/* ... and sometimes input flags */
|
||||
if((verbose >= 3) && !util_flags(bio_out, flags,
|
||||
indent))
|
||||
goto err;
|
||||
xpos = 0;
|
||||
}
|
||||
}
|
||||
OPENSSL_free(name); name = NULL;
|
||||
if(desc) { OPENSSL_free(desc); desc = NULL; }
|
||||
/* Move to the next command */
|
||||
num = ENGINE_ctrl(e, ENGINE_CTRL_GET_NEXT_CMD_TYPE,
|
||||
num, NULL, NULL);
|
||||
} while(num > 0);
|
||||
if(xpos > 0)
|
||||
BIO_printf(bio_out, "\n");
|
||||
ret = 1;
|
||||
err:
|
||||
if(cmds) sk_pop_free(cmds, identity);
|
||||
if(name) OPENSSL_free(name);
|
||||
if(desc) OPENSSL_free(desc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void util_do_cmds(ENGINE *e, STACK *cmds, BIO *bio_out, const char *indent)
|
||||
{
|
||||
int loop, res, num = sk_num(cmds);
|
||||
if(num < 0)
|
||||
{
|
||||
BIO_printf(bio_out, "[Error]: internal stack error\n");
|
||||
return;
|
||||
}
|
||||
for(loop = 0; loop < num; loop++)
|
||||
{
|
||||
char buf[256];
|
||||
const char *cmd, *arg;
|
||||
cmd = sk_value(cmds, loop);
|
||||
res = 1; /* assume success */
|
||||
/* Check if this command has no ":arg" */
|
||||
if((arg = strstr(cmd, ":")) == NULL)
|
||||
{
|
||||
if(!ENGINE_ctrl_cmd_string(e, cmd, NULL, 0))
|
||||
res = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)(arg - cmd) > 254)
|
||||
{
|
||||
BIO_printf(bio_out,"[Error]: command name too long\n");
|
||||
return;
|
||||
}
|
||||
memcpy(buf, cmd, (int)(arg - cmd));
|
||||
buf[arg-cmd] = '\0';
|
||||
arg++; /* Move past the ":" */
|
||||
/* Call the command with the argument */
|
||||
if(!ENGINE_ctrl_cmd_string(e, buf, arg, 0))
|
||||
res = 0;
|
||||
}
|
||||
if(res)
|
||||
BIO_printf(bio_out, "[Success]: %s\n", cmd);
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_out, "[Failure]: %s\n", cmd);
|
||||
ERR_print_errors(bio_out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
@@ -124,14 +345,20 @@ int MAIN(int argc, char **argv)
|
||||
int verbose=0, list_cap=0, test_avail=0;
|
||||
ENGINE *e;
|
||||
STACK *engines = sk_new_null();
|
||||
int badops=0;
|
||||
STACK *pre_cmds = sk_new_null();
|
||||
STACK *post_cmds = sk_new_null();
|
||||
int badops=1;
|
||||
BIO *bio_out=NULL;
|
||||
const char *indent = " ";
|
||||
|
||||
apps_startup();
|
||||
SSL_load_error_strings();
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
bio_out=BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
{
|
||||
@@ -144,25 +371,38 @@ int MAIN(int argc, char **argv)
|
||||
argv++;
|
||||
while (argc >= 1)
|
||||
{
|
||||
if (strcmp(*argv,"-v") == 0)
|
||||
verbose=1;
|
||||
if (strncmp(*argv,"-v",2) == 0)
|
||||
{
|
||||
if(strspn(*argv + 1, "v") < strlen(*argv + 1))
|
||||
goto skip_arg_loop;
|
||||
if((verbose=strlen(*argv + 1)) > 4)
|
||||
goto skip_arg_loop;
|
||||
}
|
||||
else if (strcmp(*argv,"-c") == 0)
|
||||
list_cap=1;
|
||||
else if (strcmp(*argv,"-t") == 0)
|
||||
test_avail=1;
|
||||
else if (strcmp(*argv,"-pre") == 0)
|
||||
{
|
||||
argc--; argv++;
|
||||
sk_push(pre_cmds,*argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-post") == 0)
|
||||
{
|
||||
argc--; argv++;
|
||||
sk_push(post_cmds,*argv);
|
||||
}
|
||||
else if ((strncmp(*argv,"-h",2) == 0) ||
|
||||
(strcmp(*argv,"-?") == 0))
|
||||
{
|
||||
badops=1;
|
||||
break;
|
||||
}
|
||||
(strcmp(*argv,"-?") == 0))
|
||||
goto skip_arg_loop;
|
||||
else
|
||||
{
|
||||
sk_push(engines,*argv);
|
||||
}
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
/* Looks like everything went OK */
|
||||
badops = 0;
|
||||
skip_arg_loop:
|
||||
|
||||
if (badops)
|
||||
{
|
||||
@@ -185,26 +425,22 @@ int MAIN(int argc, char **argv)
|
||||
if ((e = ENGINE_by_id(id)) != NULL)
|
||||
{
|
||||
const char *name = ENGINE_get_name(e);
|
||||
BIO_printf(bio_out, "%s (%s)", name, id);
|
||||
if (list_cap || test_avail)
|
||||
BIO_printf(bio_out, ":");
|
||||
if (test_avail)
|
||||
/* Do "id" first, then "name". Easier to auto-parse. */
|
||||
BIO_printf(bio_out, "(%s) %s\n", id, name);
|
||||
util_do_cmds(e, pre_cmds, bio_out, indent);
|
||||
if (strcmp(ENGINE_get_id(e), id) != 0)
|
||||
{
|
||||
if (ENGINE_init(e))
|
||||
{
|
||||
BIO_printf(bio_out, " available");
|
||||
ENGINE_finish(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_out, " unavailable");
|
||||
ERR_clear_error();
|
||||
}
|
||||
BIO_printf(bio_out, "Loaded: (%s) %s\n",
|
||||
ENGINE_get_id(e), ENGINE_get_name(e));
|
||||
}
|
||||
if (list_cap)
|
||||
{
|
||||
int cap_size = 256;
|
||||
char *cap_buf = NULL;
|
||||
int k,n;
|
||||
const int *nids;
|
||||
ENGINE_CIPHERS_PTR fn_c;
|
||||
ENGINE_DIGESTS_PTR fn_d;
|
||||
|
||||
if (ENGINE_get_RSA(e) != NULL
|
||||
&& !append_buf(&cap_buf, "RSA",
|
||||
@@ -223,12 +459,50 @@ int MAIN(int argc, char **argv)
|
||||
&cap_size, 256))
|
||||
goto end;
|
||||
|
||||
if (*cap_buf != '\0')
|
||||
BIO_printf(bio_out, " [%s]", cap_buf);
|
||||
fn_c = ENGINE_get_ciphers(e);
|
||||
if(!fn_c) goto skip_ciphers;
|
||||
n = fn_c(e, NULL, &nids, 0);
|
||||
for(k=0 ; k < n ; ++k)
|
||||
if(!append_buf(&cap_buf,
|
||||
OBJ_nid2sn(nids[k]),
|
||||
&cap_size, 256))
|
||||
goto end;
|
||||
|
||||
skip_ciphers:
|
||||
fn_d = ENGINE_get_digests(e);
|
||||
if(!fn_d) goto skip_digests;
|
||||
n = fn_d(e, NULL, &nids, 0);
|
||||
for(k=0 ; k < n ; ++k)
|
||||
if(!append_buf(&cap_buf,
|
||||
OBJ_nid2sn(nids[k]),
|
||||
&cap_size, 256))
|
||||
goto end;
|
||||
|
||||
skip_digests:
|
||||
if (cap_buf && (*cap_buf != '\0'))
|
||||
BIO_printf(bio_out, " [%s]\n", cap_buf);
|
||||
|
||||
OPENSSL_free(cap_buf);
|
||||
}
|
||||
BIO_printf(bio_out, "\n");
|
||||
if(test_avail)
|
||||
{
|
||||
BIO_printf(bio_out, "%s", indent);
|
||||
if (ENGINE_init(e))
|
||||
{
|
||||
BIO_printf(bio_out, "[ available ]\n");
|
||||
util_do_cmds(e, post_cmds, bio_out, indent);
|
||||
ENGINE_finish(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_out, "[ unavailable ]\n");
|
||||
ERR_print_errors_fp(stdout);
|
||||
ERR_clear_error();
|
||||
}
|
||||
}
|
||||
if((verbose > 0) && !util_verbose(e, verbose, bio_out, indent))
|
||||
goto end;
|
||||
ENGINE_free(e);
|
||||
}
|
||||
else
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -238,6 +512,9 @@ int MAIN(int argc, char **argv)
|
||||
end:
|
||||
ERR_print_errors(bio_err);
|
||||
sk_pop_free(engines, identity);
|
||||
sk_pop_free(pre_cmds, identity);
|
||||
sk_pop_free(post_cmds, identity);
|
||||
if (bio_out != NULL) BIO_free_all(bio_out);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
@@ -121,5 +121,6 @@ int MAIN(int argc, char **argv)
|
||||
ret++;
|
||||
}
|
||||
}
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
23
apps/gendh.c
23
apps/gendh.c
@@ -70,7 +70,6 @@
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define DEFBITS 512
|
||||
#undef PROG
|
||||
@@ -97,6 +96,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
argv++;
|
||||
argc--;
|
||||
for (;;)
|
||||
@@ -143,23 +145,7 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
out=BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
@@ -211,6 +197,7 @@ end:
|
||||
ERR_print_errors(bio_err);
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (dh != NULL) DH_free(dh);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define DEFBITS 512
|
||||
#undef PROG
|
||||
@@ -94,6 +93,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
argv++;
|
||||
argc--;
|
||||
for (;;)
|
||||
@@ -130,6 +132,14 @@ int MAIN(int argc, char **argv)
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
else if (strcmp(*argv,"-idea") == 0)
|
||||
enc=EVP_idea_cbc();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
else if (strcmp(*argv,"-aes128") == 0)
|
||||
enc=EVP_aes_128_cbc();
|
||||
else if (strcmp(*argv,"-aes192") == 0)
|
||||
enc=EVP_aes_192_cbc();
|
||||
else if (strcmp(*argv,"-aes256") == 0)
|
||||
enc=EVP_aes_256_cbc();
|
||||
#endif
|
||||
else if (**argv != '-' && dsaparams == NULL)
|
||||
{
|
||||
@@ -152,6 +162,10 @@ bad:
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
BIO_printf(bio_err," -idea - encrypt the generated key with IDEA in cbc mode\n");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
@@ -162,23 +176,7 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
@@ -247,6 +245,7 @@ end:
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (dsa != NULL) DSA_free(dsa);
|
||||
if(passout) OPENSSL_free(passout);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#define DEFBITS 512
|
||||
#undef PROG
|
||||
@@ -99,6 +99,9 @@ int MAIN(int argc, char **argv)
|
||||
if (bio_err == NULL)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto err;
|
||||
if ((out=BIO_new(BIO_s_file())) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to create BIO for output\n");
|
||||
@@ -138,6 +141,14 @@ int MAIN(int argc, char **argv)
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
else if (strcmp(*argv,"-idea") == 0)
|
||||
enc=EVP_idea_cbc();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
else if (strcmp(*argv,"-aes128") == 0)
|
||||
enc=EVP_aes_128_cbc();
|
||||
else if (strcmp(*argv,"-aes192") == 0)
|
||||
enc=EVP_aes_192_cbc();
|
||||
else if (strcmp(*argv,"-aes256") == 0)
|
||||
enc=EVP_aes_256_cbc();
|
||||
#endif
|
||||
else if (strcmp(*argv,"-passout") == 0)
|
||||
{
|
||||
@@ -157,6 +168,10 @@ bad:
|
||||
BIO_printf(bio_err," -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
BIO_printf(bio_err," -idea encrypt the generated key with IDEA in cbc mode\n");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -out file output the key to 'file\n");
|
||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||
@@ -176,23 +191,7 @@ bad:
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto err;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if (outfile == NULL)
|
||||
{
|
||||
@@ -242,8 +241,14 @@ bad:
|
||||
l+=rsa->e->d[i];
|
||||
}
|
||||
BIO_printf(bio_err,"e is %ld (0x%lX)\n",l,l);
|
||||
if (!PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,NULL, passout))
|
||||
{
|
||||
PW_CB_DATA cb_data;
|
||||
cb_data.password = passout;
|
||||
cb_data.prompt_info = outfile;
|
||||
if (!PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,
|
||||
(pem_password_cb *)password_callback,&cb_data))
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret=0;
|
||||
err:
|
||||
@@ -252,6 +257,7 @@ err:
|
||||
if(passout) OPENSSL_free(passout);
|
||||
if (ret != 0)
|
||||
ERR_print_errors(bio_err);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ $! keywords:
|
||||
$!
|
||||
$! UCX for UCX
|
||||
$! SOCKETSHR for SOCKETSHR+NETLIB
|
||||
$! TCPIP for TCPIP (post UCX)
|
||||
$!
|
||||
$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
|
||||
$!
|
||||
@@ -963,7 +964,8 @@ $ ENDIF
|
||||
$!
|
||||
$! Time to check the contents, and to make sure we get the correct library.
|
||||
$!
|
||||
$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX"
|
||||
$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" -
|
||||
.OR. P4.EQS."TCPIP" .OR. P4.EQS."NONE"
|
||||
$ THEN
|
||||
$!
|
||||
$! Check to see if SOCKETSHR was chosen
|
||||
@@ -973,7 +975,7 @@ $ THEN
|
||||
$!
|
||||
$! Set the library to use SOCKETSHR
|
||||
$!
|
||||
$ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT"
|
||||
$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
|
||||
$!
|
||||
$! Done with SOCKETSHR
|
||||
$!
|
||||
@@ -999,19 +1001,45 @@ $ THEN
|
||||
$!
|
||||
$! Set the library to use UCX.
|
||||
$!
|
||||
$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT"
|
||||
$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
|
||||
$ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
|
||||
$ THEN
|
||||
$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
|
||||
$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
|
||||
$ ELSE
|
||||
$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
|
||||
TCPIP_LIB = "[-.VMS]UCX_SHR_VAXC.OPT/OPT"
|
||||
TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
|
||||
$ ENDIF
|
||||
$!
|
||||
$! Done with UCX
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
$! Check to see if TCPIP (post UCX) was chosen
|
||||
$!
|
||||
$ IF P4.EQS."TCPIP"
|
||||
$ THEN
|
||||
$!
|
||||
$! Set the library to use TCPIP.
|
||||
$!
|
||||
$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
|
||||
$!
|
||||
$! Done with TCPIP
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
$! Check to see if NONE was chosen
|
||||
$!
|
||||
$ IF P4.EQS."NONE"
|
||||
$ THEN
|
||||
$!
|
||||
$! Do not use TCPIP.
|
||||
$!
|
||||
$ TCPIP_LIB = ""
|
||||
$!
|
||||
$! Done with TCPIP
|
||||
$!
|
||||
$ ENDIF
|
||||
$!
|
||||
$! Add TCP/IP type to CC definitions.
|
||||
$!
|
||||
$ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P4'"
|
||||
@@ -1031,6 +1059,7 @@ $ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
|
||||
$ WRITE SYS$OUTPUT ""
|
||||
$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
|
||||
$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
|
||||
$ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
|
||||
$ WRITE SYS$OUTPUT ""
|
||||
$!
|
||||
$! Time To EXIT.
|
||||
@@ -1113,6 +1142,7 @@ $!
|
||||
$! Save directory information
|
||||
$!
|
||||
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
|
||||
$ __HERE = F$EDIT(__HERE,"UPCASE")
|
||||
$ __TOP = __HERE - "APPS]"
|
||||
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
|
||||
$!
|
||||
|
||||
513
apps/ocsp.c
513
apps/ocsp.c
@@ -67,6 +67,19 @@
|
||||
/* Maximum leeway in validity period: default 5 minutes */
|
||||
#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,
|
||||
STACK_OF(OCSP_CERTID) *ids);
|
||||
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, X509 *issuer,
|
||||
@@ -75,6 +88,16 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
STACK *names, STACK_OF(OCSP_CERTID) *ids,
|
||||
long nsec, long maxage);
|
||||
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db,
|
||||
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
||||
STACK_OF(X509) *rother, unsigned long flags,
|
||||
int nmin, int ndays);
|
||||
|
||||
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser);
|
||||
static BIO *init_responder(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);
|
||||
|
||||
#undef PROG
|
||||
#define PROG ocsp_main
|
||||
|
||||
@@ -82,35 +105,49 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
char **args;
|
||||
char *host = NULL, *port = NULL, *path = "/";
|
||||
char *reqin = NULL, *respin = NULL;
|
||||
char *reqout = NULL, *respout = NULL;
|
||||
char *signfile = NULL, *keyfile = NULL;
|
||||
char *rsignfile = NULL, *rkeyfile = NULL;
|
||||
char *outfile = NULL;
|
||||
int add_nonce = 1, noverify = 0, use_ssl = -1;
|
||||
OCSP_REQUEST *req = NULL;
|
||||
OCSP_RESPONSE *resp = NULL;
|
||||
OCSP_BASICRESP *bs = NULL;
|
||||
X509 *issuer = NULL, *cert = NULL;
|
||||
X509 *signer = NULL;
|
||||
EVP_PKEY *key = NULL;
|
||||
BIO *cbio = NULL, *derbio = NULL;
|
||||
X509 *signer = NULL, *rsigner = NULL;
|
||||
EVP_PKEY *key = NULL, *rkey = NULL;
|
||||
BIO *acbio = NULL, *cbio = NULL;
|
||||
BIO *derbio = NULL;
|
||||
BIO *out = NULL;
|
||||
int req_text = 0, resp_text = 0;
|
||||
long nsec = MAX_VALIDITY_PERIOD, maxage = -1;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
X509_STORE *store = NULL;
|
||||
SSL_CTX *ctx = NULL;
|
||||
STACK_OF(X509) *sign_other = NULL, *verify_other = NULL;
|
||||
char *sign_certfile = NULL, *verify_certfile = NULL;
|
||||
unsigned long sign_flags = 0, verify_flags = 0;
|
||||
STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;
|
||||
char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;
|
||||
unsigned long sign_flags = 0, verify_flags = 0, rflags = 0;
|
||||
int ret = 1;
|
||||
int accept_count = -1;
|
||||
int badarg = 0;
|
||||
int i;
|
||||
STACK *reqnames = NULL;
|
||||
STACK_OF(OCSP_CERTID) *ids = NULL;
|
||||
|
||||
X509 *rca_cert = NULL;
|
||||
char *ridx_filename = NULL;
|
||||
char *rca_filename = NULL;
|
||||
TXT_DB *rdb = NULL;
|
||||
int nmin = 0, ndays = -1;
|
||||
|
||||
if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
SSL_load_error_strings();
|
||||
args = argv + 1;
|
||||
reqnames = sk_new_null();
|
||||
@@ -148,12 +185,25 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args, "-port"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
port = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args, "-noverify"))
|
||||
noverify = 1;
|
||||
else if (!strcmp(*args, "-nonce"))
|
||||
add_nonce = 2;
|
||||
else if (!strcmp(*args, "-no_nonce"))
|
||||
add_nonce = 0;
|
||||
else if (!strcmp(*args, "-resp_no_certs"))
|
||||
rflags |= OCSP_NOCERTS;
|
||||
else if (!strcmp(*args, "-resp_key_id"))
|
||||
rflags |= OCSP_RESPID_KEY;
|
||||
else if (!strcmp(*args, "-no_certs"))
|
||||
sign_flags |= OCSP_NOCERTS;
|
||||
else if (!strcmp(*args, "-no_signature_verify"))
|
||||
@@ -326,7 +376,8 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
args++;
|
||||
X509_free(issuer);
|
||||
issuer = load_cert(bio_err, *args, FORMAT_PEM);
|
||||
issuer = load_cert(bio_err, *args, FORMAT_PEM,
|
||||
NULL, e, "issuer certificate");
|
||||
if(!issuer) goto end;
|
||||
}
|
||||
else badarg = 1;
|
||||
@@ -337,7 +388,8 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
args++;
|
||||
X509_free(cert);
|
||||
cert = load_cert(bio_err, *args, FORMAT_PEM);
|
||||
cert = load_cert(bio_err, *args, FORMAT_PEM,
|
||||
NULL, e, "certificate");
|
||||
if(!cert) goto end;
|
||||
if(!add_ocsp_cert(&req, cert, issuer, ids))
|
||||
goto end;
|
||||
@@ -358,12 +410,107 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args, "-index"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
ridx_filename = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args, "-CA"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
rca_filename = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-nmin"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
nmin = atol(*args);
|
||||
if (nmin < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Illegal update period %s\n",
|
||||
*args);
|
||||
badarg = 1;
|
||||
}
|
||||
}
|
||||
if (ndays == -1)
|
||||
ndays = 0;
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-nrequest"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
accept_count = atol(*args);
|
||||
if (accept_count < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Illegal accept count %s\n",
|
||||
*args);
|
||||
badarg = 1;
|
||||
}
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp (*args, "-ndays"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
ndays = atol(*args);
|
||||
if (ndays < 0)
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Illegal update period %s\n",
|
||||
*args);
|
||||
badarg = 1;
|
||||
}
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args, "-rsigner"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
rsignfile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args, "-rkey"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
rkeyfile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else if (!strcmp(*args, "-rother"))
|
||||
{
|
||||
if (args[1])
|
||||
{
|
||||
args++;
|
||||
rcertfile = *args;
|
||||
}
|
||||
else badarg = 1;
|
||||
}
|
||||
else badarg = 1;
|
||||
args++;
|
||||
}
|
||||
|
||||
/* Have we anything to do? */
|
||||
if (!req && !reqin && !respin) badarg = 1;
|
||||
if (!req && !reqin && !respin && !(port && ridx_filename)) badarg = 1;
|
||||
|
||||
if (badarg)
|
||||
{
|
||||
@@ -403,6 +550,17 @@ int MAIN(int argc, char **argv)
|
||||
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_cert_checks don't do additional checks on signing certificate\n");
|
||||
BIO_printf (bio_err, "-port num port to run responder on\n");
|
||||
BIO_printf (bio_err, "-index file certificate status index file\n");
|
||||
BIO_printf (bio_err, "-CA file CA certificate\n");
|
||||
BIO_printf (bio_err, "-rsigner file responder certificate to sign responses with\n");
|
||||
BIO_printf (bio_err, "-rkey file responder key to sign responses with\n");
|
||||
BIO_printf (bio_err, "-rother file other certificates to include in response\n");
|
||||
BIO_printf (bio_err, "-resp_no_certs don't include any certificates in response\n");
|
||||
BIO_printf (bio_err, "-nmin n number of minutes before next update\n");
|
||||
BIO_printf (bio_err, "-ndays n number of days before next update\n");
|
||||
BIO_printf (bio_err, "-resp_key_id identify reponse by signing certificate key ID\n");
|
||||
BIO_printf (bio_err, "-nrequest n number of requests to accept (default unlimited)\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -434,7 +592,54 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!req && (signfile || reqout || host || add_nonce))
|
||||
if (!req && port)
|
||||
{
|
||||
acbio = init_responder(port);
|
||||
if (!acbio)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (rsignfile && !rdb)
|
||||
{
|
||||
if (!rkeyfile) rkeyfile = rsignfile;
|
||||
rsigner = load_cert(bio_err, rsignfile, FORMAT_PEM,
|
||||
NULL, e, "responder certificate");
|
||||
if (!rsigner)
|
||||
{
|
||||
BIO_printf(bio_err, "Error loading responder certificate\n");
|
||||
goto end;
|
||||
}
|
||||
rca_cert = load_cert(bio_err, rca_filename, FORMAT_PEM,
|
||||
NULL, e, "CA certificate");
|
||||
if (rcertfile)
|
||||
{
|
||||
rother = load_certs(bio_err, sign_certfile, FORMAT_PEM,
|
||||
NULL, e, "responder other certificates");
|
||||
if (!sign_other) goto end;
|
||||
}
|
||||
rkey = load_key(bio_err, rkeyfile, FORMAT_PEM, NULL, NULL,
|
||||
"responder private key");
|
||||
if (!rkey)
|
||||
goto end;
|
||||
}
|
||||
if(acbio)
|
||||
BIO_printf(bio_err, "Waiting for OCSP client connections...\n");
|
||||
|
||||
redo_accept:
|
||||
|
||||
if (acbio)
|
||||
{
|
||||
if (!do_responder(&req, &cbio, acbio, port))
|
||||
goto end;
|
||||
if (!req)
|
||||
{
|
||||
resp = OCSP_response_create(OCSP_RESPONSE_STATUS_MALFORMEDREQUEST, NULL);
|
||||
send_ocsp_response(cbio, resp);
|
||||
goto done_resp;
|
||||
}
|
||||
}
|
||||
|
||||
if (!req && (signfile || reqout || host || add_nonce || ridx_filename))
|
||||
{
|
||||
BIO_printf(bio_err, "Need an OCSP request for this operation!\n");
|
||||
goto end;
|
||||
@@ -445,7 +650,8 @@ int MAIN(int argc, char **argv)
|
||||
if (signfile)
|
||||
{
|
||||
if (!keyfile) keyfile = signfile;
|
||||
signer = load_cert(bio_err, signfile, FORMAT_PEM);
|
||||
signer = load_cert(bio_err, signfile, FORMAT_PEM,
|
||||
NULL, e, "signer certificate");
|
||||
if (!signer)
|
||||
{
|
||||
BIO_printf(bio_err, "Error loading signer certificate\n");
|
||||
@@ -453,15 +659,14 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
if (sign_certfile)
|
||||
{
|
||||
sign_other = load_certs(bio_err, sign_certfile, FORMAT_PEM);
|
||||
sign_other = load_certs(bio_err, sign_certfile, FORMAT_PEM,
|
||||
NULL, e, "signer certificates");
|
||||
if (!sign_other) goto end;
|
||||
}
|
||||
key = load_key(bio_err, keyfile, FORMAT_PEM, NULL, NULL);
|
||||
key = load_key(bio_err, keyfile, FORMAT_PEM, NULL, NULL,
|
||||
"signer private key");
|
||||
if (!key)
|
||||
{
|
||||
BIO_printf(bio_err, "Error loading signer private key\n");
|
||||
goto end;
|
||||
}
|
||||
if (!OCSP_request_sign(req, signer, key, EVP_sha1(), sign_other, sign_flags))
|
||||
{
|
||||
BIO_printf(bio_err, "Error signing OCSP request\n");
|
||||
@@ -469,10 +674,12 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (req_text && req) OCSP_REQUEST_print(out, req, 0);
|
||||
|
||||
if (reqout)
|
||||
{
|
||||
derbio = BIO_new_file(reqout, "wb");
|
||||
if (!derbio)
|
||||
if(!derbio)
|
||||
{
|
||||
BIO_printf(bio_err, "Error opening file %s\n", reqout);
|
||||
goto end;
|
||||
@@ -481,9 +688,39 @@ int MAIN(int argc, char **argv)
|
||||
BIO_free(derbio);
|
||||
}
|
||||
|
||||
if (req_text && req) OCSP_REQUEST_print(out, req, 0);
|
||||
if (ridx_filename && (!rkey || !rsigner || !rca_cert))
|
||||
{
|
||||
BIO_printf(bio_err, "Need a responder certificate, key and CA for this operation!\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (host)
|
||||
if (ridx_filename && !rdb)
|
||||
{
|
||||
BIO *db_bio = NULL;
|
||||
db_bio = BIO_new_file(ridx_filename, "r");
|
||||
if (!db_bio)
|
||||
{
|
||||
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)
|
||||
{
|
||||
i = make_ocsp_response(&resp, req, rdb, rca_cert, rsigner, rkey, rother, rflags, nmin, ndays);
|
||||
if (cbio)
|
||||
send_ocsp_response(cbio, resp);
|
||||
}
|
||||
else if (host)
|
||||
{
|
||||
cbio = BIO_new_connect(host);
|
||||
if (!cbio)
|
||||
@@ -537,6 +774,8 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
done_resp:
|
||||
|
||||
if (respout)
|
||||
{
|
||||
derbio = BIO_new_file(respout, "wb");
|
||||
@@ -561,11 +800,33 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (resp_text) OCSP_RESPONSE_print(out, resp, 0);
|
||||
|
||||
store = setup_verify(bio_err, CAfile, CApath);
|
||||
if(!store) goto end;
|
||||
/* If running as responder don't verify our own response */
|
||||
if (cbio)
|
||||
{
|
||||
if (accept_count > 0)
|
||||
accept_count--;
|
||||
/* Redo if more connections needed */
|
||||
if (accept_count)
|
||||
{
|
||||
BIO_free_all(cbio);
|
||||
cbio = NULL;
|
||||
OCSP_REQUEST_free(req);
|
||||
req = NULL;
|
||||
OCSP_RESPONSE_free(resp);
|
||||
resp = NULL;
|
||||
goto redo_accept;
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!store)
|
||||
store = setup_verify(bio_err, CAfile, CApath);
|
||||
if (!store)
|
||||
goto end;
|
||||
if (verify_certfile)
|
||||
{
|
||||
verify_other = load_certs(bio_err, verify_certfile, FORMAT_PEM);
|
||||
verify_other = load_certs(bio_err, verify_certfile, FORMAT_PEM,
|
||||
NULL, e, "validator certificate");
|
||||
if (!verify_other) goto end;
|
||||
}
|
||||
|
||||
@@ -613,9 +874,14 @@ end:
|
||||
X509_free(signer);
|
||||
X509_STORE_free(store);
|
||||
EVP_PKEY_free(key);
|
||||
EVP_PKEY_free(rkey);
|
||||
X509_free(issuer);
|
||||
X509_free(cert);
|
||||
X509_free(rsigner);
|
||||
X509_free(rca_cert);
|
||||
TXT_DB_free(rdb);
|
||||
BIO_free_all(cbio);
|
||||
BIO_free_all(acbio);
|
||||
BIO_free(out);
|
||||
OCSP_REQUEST_free(req);
|
||||
OCSP_RESPONSE_free(resp);
|
||||
@@ -754,3 +1020,206 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, TXT_DB *db,
|
||||
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
|
||||
STACK_OF(X509) *rother, unsigned long flags,
|
||||
int nmin, int ndays)
|
||||
{
|
||||
ASN1_TIME *thisupd = NULL, *nextupd = NULL;
|
||||
OCSP_CERTID *cid, *ca_id = NULL;
|
||||
OCSP_BASICRESP *bs = NULL;
|
||||
int i, id_count, ret = 1;
|
||||
|
||||
|
||||
id_count = OCSP_request_onereq_count(req);
|
||||
|
||||
if (id_count <= 0)
|
||||
{
|
||||
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_MALFORMEDREQUEST, NULL);
|
||||
goto end;
|
||||
}
|
||||
|
||||
ca_id = OCSP_cert_to_id(EVP_sha1(), NULL, ca);
|
||||
|
||||
bs = OCSP_BASICRESP_new();
|
||||
thisupd = X509_gmtime_adj(NULL, 0);
|
||||
if (ndays != -1)
|
||||
nextupd = X509_gmtime_adj(NULL, nmin * 60 + ndays * 3600 * 24 );
|
||||
|
||||
/* Examine each certificate id in the request */
|
||||
for (i = 0; i < id_count; i++)
|
||||
{
|
||||
OCSP_ONEREQ *one;
|
||||
ASN1_INTEGER *serial;
|
||||
char **inf;
|
||||
one = OCSP_request_onereq_get0(req, i);
|
||||
cid = OCSP_onereq_get0_id(one);
|
||||
/* Is this request about our CA? */
|
||||
if (OCSP_id_issuer_cmp(ca_id, cid))
|
||||
{
|
||||
OCSP_basic_add1_status(bs, cid,
|
||||
V_OCSP_CERTSTATUS_UNKNOWN,
|
||||
0, NULL,
|
||||
thisupd, nextupd);
|
||||
continue;
|
||||
}
|
||||
OCSP_id_get0_info(NULL, NULL, NULL, &serial, cid);
|
||||
inf = lookup_serial(db, serial);
|
||||
if (!inf)
|
||||
OCSP_basic_add1_status(bs, cid,
|
||||
V_OCSP_CERTSTATUS_UNKNOWN,
|
||||
0, NULL,
|
||||
thisupd, nextupd);
|
||||
else if (inf[DB_type][0] == DB_TYPE_VAL)
|
||||
OCSP_basic_add1_status(bs, cid,
|
||||
V_OCSP_CERTSTATUS_GOOD,
|
||||
0, NULL,
|
||||
thisupd, nextupd);
|
||||
else if (inf[DB_type][0] == DB_TYPE_REV)
|
||||
{
|
||||
ASN1_OBJECT *inst = NULL;
|
||||
ASN1_TIME *revtm = NULL;
|
||||
ASN1_GENERALIZEDTIME *invtm = NULL;
|
||||
OCSP_SINGLERESP *single;
|
||||
int reason = -1;
|
||||
unpack_revinfo(&revtm, &reason, &inst, &invtm, inf[DB_rev_date]);
|
||||
single = OCSP_basic_add1_status(bs, cid,
|
||||
V_OCSP_CERTSTATUS_REVOKED,
|
||||
reason, revtm,
|
||||
thisupd, nextupd);
|
||||
if (invtm)
|
||||
OCSP_SINGLERESP_add1_ext_i2d(single, NID_invalidity_date, invtm, 0, 0);
|
||||
else if (inst)
|
||||
OCSP_SINGLERESP_add1_ext_i2d(single, NID_hold_instruction_code, inst, 0, 0);
|
||||
ASN1_OBJECT_free(inst);
|
||||
ASN1_TIME_free(revtm);
|
||||
ASN1_GENERALIZEDTIME_free(invtm);
|
||||
}
|
||||
}
|
||||
|
||||
OCSP_copy_nonce(bs, req);
|
||||
|
||||
OCSP_basic_sign(bs, rcert, rkey, EVP_sha1(), rother, flags);
|
||||
|
||||
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs);
|
||||
|
||||
end:
|
||||
ASN1_TIME_free(thisupd);
|
||||
ASN1_TIME_free(nextupd);
|
||||
OCSP_CERTID_free(ca_id);
|
||||
OCSP_BASICRESP_free(bs);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser)
|
||||
{
|
||||
int i;
|
||||
BIGNUM *bn = NULL;
|
||||
char *itmp, *row[DB_NUMBER],**rrow;
|
||||
for (i = 0; i < DB_NUMBER; i++) row[i] = NULL;
|
||||
bn = ASN1_INTEGER_to_BN(ser,NULL);
|
||||
itmp = BN_bn2hex(bn);
|
||||
row[DB_serial] = itmp;
|
||||
BN_free(bn);
|
||||
rrow=TXT_DB_get_by_index(db,DB_serial,row);
|
||||
OPENSSL_free(itmp);
|
||||
return rrow;
|
||||
}
|
||||
|
||||
/* Quick and dirty OCSP server: read in and parse input request */
|
||||
|
||||
static BIO *init_responder(char *port)
|
||||
{
|
||||
BIO *acbio = NULL, *bufbio = NULL;
|
||||
bufbio = BIO_new(BIO_f_buffer());
|
||||
if (!bufbio)
|
||||
goto err;
|
||||
acbio = BIO_new_accept(port);
|
||||
if (!acbio)
|
||||
goto err;
|
||||
BIO_set_accept_bios(acbio, bufbio);
|
||||
bufbio = NULL;
|
||||
|
||||
if (BIO_do_accept(acbio) <= 0)
|
||||
{
|
||||
BIO_printf(bio_err, "Error setting up accept BIO\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
return acbio;
|
||||
|
||||
err:
|
||||
BIO_free_all(acbio);
|
||||
BIO_free(bufbio);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port)
|
||||
{
|
||||
int have_post = 0, len;
|
||||
OCSP_REQUEST *req = NULL;
|
||||
char inbuf[1024];
|
||||
BIO *cbio = NULL;
|
||||
|
||||
if (BIO_do_accept(acbio) <= 0)
|
||||
{
|
||||
BIO_printf(bio_err, "Error accepting connection\n");
|
||||
ERR_print_errors(bio_err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cbio = BIO_pop(acbio);
|
||||
*pcbio = cbio;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
len = BIO_gets(cbio, inbuf, 1024);
|
||||
if (len <= 0)
|
||||
return 1;
|
||||
/* Look for "POST" signalling start of query */
|
||||
if (!have_post)
|
||||
{
|
||||
if(strncmp(inbuf, "POST", 4))
|
||||
{
|
||||
BIO_printf(bio_err, "Invalid request\n");
|
||||
return 1;
|
||||
}
|
||||
have_post = 1;
|
||||
}
|
||||
/* Look for end of headers */
|
||||
if ((inbuf[0] == '\r') || (inbuf[0] == '\n'))
|
||||
break;
|
||||
}
|
||||
|
||||
/* Try to read OCSP request */
|
||||
|
||||
req = d2i_OCSP_REQUEST_bio(cbio, NULL);
|
||||
|
||||
if (!req)
|
||||
{
|
||||
BIO_printf(bio_err, "Error parsing OCSP request\n");
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
|
||||
*preq = req;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp)
|
||||
{
|
||||
char http_resp[] =
|
||||
"HTTP/1.0 200 OK\r\nContent-type: application/ocsp-response\r\n"
|
||||
"Content-Length: %d\r\n\r\n";
|
||||
if (!cbio)
|
||||
return 0;
|
||||
BIO_printf(cbio, http_resp, i2d_OCSP_RESPONSE(resp, NULL));
|
||||
i2d_OCSP_RESPONSE_bio(cbio, resp);
|
||||
BIO_flush(cbio);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -121,6 +121,7 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/engine.h>
|
||||
#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
|
||||
#include "apps.h"
|
||||
#include "progs.h"
|
||||
@@ -138,7 +139,7 @@ static unsigned long MS_CALLBACK hash(const void *a_void);
|
||||
static int MS_CALLBACK cmp(const void *a_void,const void *b_void);
|
||||
static LHASH *prog_init(void );
|
||||
static int do_cmd(LHASH *prog,int argc,char *argv[]);
|
||||
LHASH *config=NULL;
|
||||
CONF *config=NULL;
|
||||
char *default_config_file=NULL;
|
||||
|
||||
/* Make sure there is only one when MONOLITH is defined */
|
||||
@@ -214,8 +215,8 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line)
|
||||
int main(int Argc, char *Argv[])
|
||||
{
|
||||
ARGS arg;
|
||||
#define PROG_NAME_SIZE 16
|
||||
char pname[PROG_NAME_SIZE];
|
||||
#define PROG_NAME_SIZE 39
|
||||
char pname[PROG_NAME_SIZE+1];
|
||||
FUNCTION f,*fp;
|
||||
MS_STATIC char *prompt,buf[1024],config_name[256];
|
||||
int n,i,ret=0;
|
||||
@@ -227,12 +228,17 @@ int main(int Argc, char *Argv[])
|
||||
arg.data=NULL;
|
||||
arg.count=0;
|
||||
|
||||
if (getenv("OPENSSL_DEBUG_MEMORY") != NULL)
|
||||
if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) /* if not defined, use compiled-in library defaults */
|
||||
{
|
||||
if (!(0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))
|
||||
{
|
||||
CRYPTO_malloc_debug_init();
|
||||
CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
|
||||
CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* OPENSSL_DEBUG_MEMORY=off */
|
||||
CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
||||
@@ -250,9 +256,6 @@ int main(int Argc, char *Argv[])
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
ENGINE_load_builtin_engines();
|
||||
|
||||
/* Lets load up our environment a little */
|
||||
p=getenv("OPENSSL_CONF");
|
||||
if (p == NULL)
|
||||
@@ -269,8 +272,14 @@ int main(int Argc, char *Argv[])
|
||||
|
||||
default_config_file=p;
|
||||
|
||||
config=CONF_load(config,p,&errline);
|
||||
if (config == NULL) ERR_clear_error();
|
||||
config=NCONF_new(NULL);
|
||||
i=NCONF_load(config,p,&errline);
|
||||
if (i == 0)
|
||||
{
|
||||
NCONF_free(config);
|
||||
config = NULL;
|
||||
ERR_clear_error();
|
||||
}
|
||||
|
||||
prog=prog_init();
|
||||
|
||||
@@ -339,16 +348,14 @@ int main(int Argc, char *Argv[])
|
||||
end:
|
||||
if (config != NULL)
|
||||
{
|
||||
CONF_free(config);
|
||||
NCONF_free(config);
|
||||
config=NULL;
|
||||
}
|
||||
if (prog != NULL) lh_free(prog);
|
||||
if (arg.data != NULL) OPENSSL_free(arg.data);
|
||||
ERR_remove_state(0);
|
||||
|
||||
EVP_cleanup();
|
||||
ERR_free_strings();
|
||||
|
||||
apps_shutdown();
|
||||
|
||||
CRYPTO_mem_leaks(bio_err);
|
||||
if (bio_err != NULL)
|
||||
{
|
||||
|
||||
@@ -48,6 +48,14 @@ RANDFILE = $dir/private/.rand # private random number file
|
||||
|
||||
x509_extensions = usr_cert # The extentions to add to the cert
|
||||
|
||||
# Comment out the following two lines for the "traditional"
|
||||
# (and highly broken) format.
|
||||
name_opt = ca_default # Subject Name options
|
||||
cert_opt = ca_default # Certificate field options
|
||||
|
||||
# Extension copying option: use with caution.
|
||||
# copy_extensions = copy
|
||||
|
||||
# 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.
|
||||
# crl_extensions = crl_ext
|
||||
@@ -180,6 +188,9 @@ authorityKeyIdentifier=keyid,issuer:always
|
||||
# This stuff is for subjectAltName and issuerAltname.
|
||||
# Import the email address.
|
||||
# subjectAltName=email:copy
|
||||
# An alternative to produce certificates that aren't
|
||||
# deprecated according to PKIX.
|
||||
# subjectAltName=email:move
|
||||
|
||||
# Copy subject details
|
||||
# issuerAltName=issuer:copy
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#ifndef OPENSSL_NO_DES
|
||||
# include <openssl/des.h>
|
||||
#endif
|
||||
#ifndef NO_MD5CRYPT_1
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/md5.h>
|
||||
#endif
|
||||
|
||||
@@ -79,6 +79,9 @@ int MAIN(int argc, char **argv)
|
||||
if (bio_err == NULL)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto err;
|
||||
out = BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
goto err;
|
||||
@@ -289,6 +292,7 @@ err:
|
||||
BIO_free(in);
|
||||
if (out)
|
||||
BIO_free_all(out);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
@@ -310,7 +314,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
|
||||
unsigned char buf[MD5_DIGEST_LENGTH];
|
||||
char *salt_out;
|
||||
int n, i;
|
||||
MD5_CTX md;
|
||||
EVP_MD_CTX md,md2;
|
||||
size_t passwd_len, salt_len;
|
||||
|
||||
passwd_len = strlen(passwd);
|
||||
@@ -325,49 +329,47 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
|
||||
salt_len = strlen(salt_out);
|
||||
assert(salt_len <= 8);
|
||||
|
||||
MD5_Init(&md);
|
||||
MD5_Update(&md, passwd, passwd_len);
|
||||
MD5_Update(&md, "$", 1);
|
||||
MD5_Update(&md, magic, strlen(magic));
|
||||
MD5_Update(&md, "$", 1);
|
||||
MD5_Update(&md, salt_out, salt_len);
|
||||
EVP_MD_CTX_init(&md);
|
||||
EVP_DigestInit_ex(&md,EVP_md5(), NULL);
|
||||
EVP_DigestUpdate(&md, passwd, passwd_len);
|
||||
EVP_DigestUpdate(&md, "$", 1);
|
||||
EVP_DigestUpdate(&md, magic, strlen(magic));
|
||||
EVP_DigestUpdate(&md, "$", 1);
|
||||
EVP_DigestUpdate(&md, salt_out, salt_len);
|
||||
|
||||
{
|
||||
MD5_CTX md2;
|
||||
EVP_MD_CTX_init(&md2);
|
||||
EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
|
||||
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
||||
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||
EVP_DigestFinal_ex(&md2, buf, NULL);
|
||||
|
||||
MD5_Init(&md2);
|
||||
MD5_Update(&md2, passwd, passwd_len);
|
||||
MD5_Update(&md2, salt_out, salt_len);
|
||||
MD5_Update(&md2, passwd, passwd_len);
|
||||
MD5_Final(buf, &md2);
|
||||
}
|
||||
for (i = passwd_len; i > sizeof buf; i -= sizeof buf)
|
||||
MD5_Update(&md, buf, sizeof buf);
|
||||
MD5_Update(&md, buf, i);
|
||||
EVP_DigestUpdate(&md, buf, sizeof buf);
|
||||
EVP_DigestUpdate(&md, buf, i);
|
||||
|
||||
n = passwd_len;
|
||||
while (n)
|
||||
{
|
||||
MD5_Update(&md, (n & 1) ? "\0" : passwd, 1);
|
||||
EVP_DigestUpdate(&md, (n & 1) ? "\0" : passwd, 1);
|
||||
n >>= 1;
|
||||
}
|
||||
MD5_Final(buf, &md);
|
||||
EVP_DigestFinal_ex(&md, buf, NULL);
|
||||
|
||||
for (i = 0; i < 1000; i++)
|
||||
{
|
||||
MD5_CTX md2;
|
||||
|
||||
MD5_Init(&md2);
|
||||
MD5_Update(&md2, (i & 1) ? (unsigned char *) passwd : buf,
|
||||
(i & 1) ? passwd_len : sizeof buf);
|
||||
EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
|
||||
EVP_DigestUpdate(&md2, (i & 1) ? (unsigned char *) passwd : buf,
|
||||
(i & 1) ? passwd_len : sizeof buf);
|
||||
if (i % 3)
|
||||
MD5_Update(&md2, salt_out, salt_len);
|
||||
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
||||
if (i % 7)
|
||||
MD5_Update(&md2, passwd, passwd_len);
|
||||
MD5_Update(&md2, (i & 1) ? buf : (unsigned char *) passwd,
|
||||
(i & 1) ? sizeof buf : passwd_len);
|
||||
MD5_Final(buf, &md2);
|
||||
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||
EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned char *) passwd,
|
||||
(i & 1) ? sizeof buf : passwd_len);
|
||||
EVP_DigestFinal_ex(&md2, buf, NULL);
|
||||
}
|
||||
EVP_MD_CTX_cleanup(&md2);
|
||||
|
||||
{
|
||||
/* transform buf into output string */
|
||||
@@ -405,6 +407,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
|
||||
*output = 0;
|
||||
assert(strlen(out_buf) < sizeof(out_buf));
|
||||
}
|
||||
EVP_MD_CTX_cleanup(&md);
|
||||
|
||||
return out_buf;
|
||||
}
|
||||
@@ -479,7 +482,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
||||
/* now compute password hash */
|
||||
#ifndef OPENSSL_NO_DES
|
||||
if (usecrypt)
|
||||
hash = des_crypt(passwd, *salt_p);
|
||||
hash = DES_crypt(passwd, *salt_p);
|
||||
#endif
|
||||
#ifndef NO_MD5CRYPT_1
|
||||
if (use1 || useapr1)
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define PROG pkcs12_main
|
||||
|
||||
@@ -96,9 +95,10 @@ int MAIN(int argc, char **argv)
|
||||
ENGINE *e = NULL;
|
||||
char *infile=NULL, *outfile=NULL, *keyname = NULL;
|
||||
char *certfile=NULL;
|
||||
BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL;
|
||||
BIO *in=NULL, *out = NULL;
|
||||
char **args;
|
||||
char *name = NULL;
|
||||
char *csp_name = NULL;
|
||||
PKCS12 *p12 = NULL;
|
||||
char pass[50], macpass[50];
|
||||
int export_cert = 0;
|
||||
@@ -127,6 +127,9 @@ int MAIN(int argc, char **argv)
|
||||
enc = EVP_des_ede3_cbc();
|
||||
if (bio_err == NULL ) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
args = argv + 1;
|
||||
|
||||
|
||||
@@ -151,6 +154,11 @@ int MAIN(int argc, char **argv)
|
||||
else if (!strcmp (*args, "-idea")) enc=EVP_idea_cbc();
|
||||
#endif
|
||||
else if (!strcmp (*args, "-des3")) enc = EVP_des_ede3_cbc();
|
||||
#ifndef OPENSSL_NO_AES
|
||||
else if (!strcmp(*args,"-aes128")) enc=EVP_aes_128_cbc();
|
||||
else if (!strcmp(*args,"-aes192")) enc=EVP_aes_192_cbc();
|
||||
else if (!strcmp(*args,"-aes256")) enc=EVP_aes_256_cbc();
|
||||
#endif
|
||||
else if (!strcmp (*args, "-noiter")) iter = 1;
|
||||
else if (!strcmp (*args, "-maciter"))
|
||||
maciter = PKCS12_DEFAULT_ITER;
|
||||
@@ -197,6 +205,11 @@ int MAIN(int argc, char **argv)
|
||||
args++;
|
||||
name = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-CSP")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
csp_name = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-caname")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -274,6 +287,10 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "-des3 encrypt private keys with triple DES (default)\n");
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
BIO_printf (bio_err, "-idea encrypt private keys with idea\n");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
BIO_printf (bio_err, "-aes128, -aes192, -aes256\n");
|
||||
BIO_printf (bio_err, " encrypt PEM output with cbc aes\n");
|
||||
#endif
|
||||
BIO_printf (bio_err, "-nodes don't encrypt private keys\n");
|
||||
BIO_printf (bio_err, "-noiter don't use encryption iteration\n");
|
||||
@@ -294,19 +311,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL) {
|
||||
if((e = ENGINE_by_id(engine)) == NULL) {
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n", engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if(passarg) {
|
||||
if(export_cert) passargout = passarg;
|
||||
@@ -352,6 +357,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (certfile) {
|
||||
if(!(certsin = BIO_new_file(certfile, "r"))) {
|
||||
BIO_printf(bio_err, "Can't open certificate file %s\n", certfile);
|
||||
@@ -367,6 +373,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
@@ -420,12 +427,9 @@ int MAIN(int argc, char **argv)
|
||||
CRYPTO_push_info("process -export_cert");
|
||||
CRYPTO_push_info("reading private key");
|
||||
#endif
|
||||
key = PEM_read_bio_PrivateKey(inkey ? inkey : in, NULL, NULL, passin);
|
||||
if (!inkey) (void) BIO_reset(in);
|
||||
else BIO_free(inkey);
|
||||
key = load_key(bio_err, keyname ? keyname : infile, FORMAT_PEM,
|
||||
passin, e, "private key");
|
||||
if (!key) {
|
||||
BIO_printf (bio_err, "Error loading private key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto export_end;
|
||||
}
|
||||
|
||||
@@ -434,12 +438,9 @@ int MAIN(int argc, char **argv)
|
||||
CRYPTO_push_info("reading certs from input");
|
||||
#endif
|
||||
|
||||
certs = sk_X509_new_null();
|
||||
|
||||
/* Load in all certs in input file */
|
||||
if(!cert_load(in, certs)) {
|
||||
BIO_printf(bio_err, "Error loading certificates from input\n");
|
||||
ERR_print_errors(bio_err);
|
||||
if(!(certs = load_certs(bio_err, infile, FORMAT_PEM, NULL, e,
|
||||
"certificates"))) {
|
||||
goto export_end;
|
||||
}
|
||||
|
||||
@@ -469,13 +470,17 @@ int MAIN(int argc, char **argv)
|
||||
bags = sk_PKCS12_SAFEBAG_new_null ();
|
||||
|
||||
/* Add any more certificates asked for */
|
||||
if (certsin) {
|
||||
if(!cert_load(certsin, certs)) {
|
||||
BIO_printf(bio_err, "Error loading certificates from certfile\n");
|
||||
ERR_print_errors(bio_err);
|
||||
if (certfile) {
|
||||
STACK_OF(X509) *morecerts=NULL;
|
||||
if(!(morecerts = load_certs(bio_err, certfile, FORMAT_PEM,
|
||||
NULL, e,
|
||||
"certificates from certfile"))) {
|
||||
goto export_end;
|
||||
}
|
||||
BIO_free(certsin);
|
||||
while(sk_X509_num(morecerts) > 0) {
|
||||
sk_X509_push(certs, sk_X509_shift(morecerts));
|
||||
}
|
||||
sk_X509_free(morecerts);
|
||||
}
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
@@ -572,6 +577,7 @@ int MAIN(int argc, char **argv)
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
p8 = NULL;
|
||||
if (name) PKCS12_add_friendlyname (bag, name, -1);
|
||||
if(csp_name) PKCS12_add_CSPName_asc(bag, csp_name, -1);
|
||||
PKCS12_add_localkeyid (bag, keyid, keyidlen);
|
||||
bags = sk_PKCS12_SAFEBAG_new_null();
|
||||
sk_PKCS12_SAFEBAG_push (bags, bag);
|
||||
@@ -691,6 +697,7 @@ int MAIN(int argc, char **argv)
|
||||
if (canames) sk_free(canames);
|
||||
if(passin) OPENSSL_free(passin);
|
||||
if(passout) OPENSSL_free(passout);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
@@ -772,7 +779,10 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
||||
print_attribs (out, bag->attrib, "Bag Attributes");
|
||||
if (!(p8 = PKCS12_decrypt_skey(bag, pass, passlen)))
|
||||
return 0;
|
||||
if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
|
||||
if (!(pkey = EVP_PKCS82PKEY (p8))) {
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
return 0;
|
||||
}
|
||||
print_attribs (out, p8->attributes, "Key Attributes");
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);
|
||||
@@ -820,6 +830,9 @@ int get_cert_chain (X509 *cert, X509_STORE *store, STACK_OF(X509) **chain)
|
||||
STACK_OF(X509) *chn;
|
||||
int i;
|
||||
|
||||
/* FIXME: Should really check the return status of X509_STORE_CTX_init
|
||||
* for an error, but how that fits into the return value of this
|
||||
* function is less obvious. */
|
||||
X509_STORE_CTX_init(&store_ctx, store, cert, NULL);
|
||||
if (X509_verify_cert(&store_ctx) <= 0) {
|
||||
i = X509_STORE_CTX_get_error (&store_ctx);
|
||||
|
||||
23
apps/pkcs7.c
23
apps/pkcs7.c
@@ -67,7 +67,6 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pkcs7.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG pkcs7_main
|
||||
@@ -163,28 +162,13 @@ bad:
|
||||
BIO_printf(bio_err," -text print full details of certificates\n");
|
||||
BIO_printf(bio_err," -noout don't output encoded data\n");
|
||||
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||
EXIT(1);
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
@@ -316,5 +300,6 @@ end:
|
||||
if (p7 != NULL) PKCS7_free(p7);
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
41
apps/pkcs8.c
41
apps/pkcs8.c
@@ -62,7 +62,6 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#include "apps.h"
|
||||
#define PROG pkcs8_main
|
||||
@@ -84,13 +83,16 @@ int MAIN(int argc, char **argv)
|
||||
int nocrypt = 0;
|
||||
X509_SIG *p8;
|
||||
PKCS8_PRIV_KEY_INFO *p8inf;
|
||||
EVP_PKEY *pkey;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
||||
int badarg = 0;
|
||||
char *engine=NULL;
|
||||
|
||||
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
informat=FORMAT_PEM;
|
||||
outformat=FORMAT_PEM;
|
||||
|
||||
@@ -185,23 +187,7 @@ int MAIN(int argc, char **argv)
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
return (1);
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
return (1);
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
@@ -233,21 +219,13 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (topk8) {
|
||||
if(informat == FORMAT_PEM)
|
||||
pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, passin);
|
||||
else if(informat == FORMAT_ASN1)
|
||||
pkey = d2i_PrivateKey_bio(in, NULL);
|
||||
else {
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
return (1);
|
||||
}
|
||||
if (topk8)
|
||||
{
|
||||
BIO_free(in); /* Not needed in this section */
|
||||
pkey = load_key(bio_err, infile, informat, passin, e, "key");
|
||||
if (!pkey) {
|
||||
BIO_printf(bio_err, "Error reading key\n", outfile);
|
||||
ERR_print_errors(bio_err);
|
||||
return (1);
|
||||
}
|
||||
BIO_free(in);
|
||||
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
|
||||
BIO_printf(bio_err, "Error converting key\n", outfile);
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -372,6 +350,7 @@ int MAIN(int argc, char **argv)
|
||||
return (1);
|
||||
}
|
||||
|
||||
end:
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free_all(out);
|
||||
BIO_free(in);
|
||||
|
||||
32
apps/progs.h
32
apps/progs.h
@@ -113,13 +113,45 @@ FUNCTION functions[] = {
|
||||
{FUNC_TYPE_GENERAL,"rand",rand_main},
|
||||
{FUNC_TYPE_GENERAL,"engine",engine_main},
|
||||
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
|
||||
#ifndef OPENSSL_NO_MD2
|
||||
{FUNC_TYPE_MD,"md2",dgst_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_MD4
|
||||
{FUNC_TYPE_MD,"md4",dgst_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
{FUNC_TYPE_MD,"md5",dgst_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SHA
|
||||
{FUNC_TYPE_MD,"sha",dgst_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SHA1
|
||||
{FUNC_TYPE_MD,"sha1",dgst_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_MDC2
|
||||
{FUNC_TYPE_MD,"mdc2",dgst_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_RMD160
|
||||
{FUNC_TYPE_MD,"rmd160",dgst_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
{FUNC_TYPE_CIPHER,"aes-128-cbc",enc_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
{FUNC_TYPE_CIPHER,"aes-128-ecb",enc_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
{FUNC_TYPE_CIPHER,"aes-192-cbc",enc_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
{FUNC_TYPE_CIPHER,"aes-192-ecb",enc_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
{FUNC_TYPE_CIPHER,"aes-256-cbc",enc_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
{FUNC_TYPE_CIPHER,"aes-256-ecb",enc_main},
|
||||
#endif
|
||||
{FUNC_TYPE_CIPHER,"base64",enc_main},
|
||||
#ifndef OPENSSL_NO_DES
|
||||
{FUNC_TYPE_CIPHER,"des",enc_main},
|
||||
|
||||
@@ -28,15 +28,15 @@ foreach (@ARGV)
|
||||
push(@files,$_);
|
||||
$str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
|
||||
if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
|
||||
{ print "#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))\n${str}#endif\n"; }
|
||||
{ print "#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) || ($_ =~ /^rsautl$/))
|
||||
{ print "#ifndef NO_RSA\n${str}#endif\n"; }
|
||||
{ print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/))
|
||||
{ print "#ifndef NO_DSA\n${str}#endif\n"; }
|
||||
{ print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/))
|
||||
{ print "#ifndef NO_DH\n${str}#endif\n"; }
|
||||
{ print "#ifndef OPENSSL_NO_DH\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^pkcs12$/))
|
||||
{ print "#if !defined(NO_DES) && !defined(NO_SHA1)\n${str}#endif\n"; }
|
||||
{ print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)\n${str}#endif\n"; }
|
||||
else
|
||||
{ print $str; }
|
||||
}
|
||||
@@ -44,10 +44,13 @@ foreach (@ARGV)
|
||||
foreach ("md2","md4","md5","sha","sha1","mdc2","rmd160")
|
||||
{
|
||||
push(@files,$_);
|
||||
printf "\t{FUNC_TYPE_MD,\"%s\",dgst_main},\n",$_;
|
||||
printf "#ifndef OPENSSL_NO_".uc($_)."\n\t{FUNC_TYPE_MD,\"".$_."\",dgst_main},\n#endif\n";
|
||||
}
|
||||
|
||||
foreach (
|
||||
"aes-128-cbc", "aes-128-ecb",
|
||||
"aes-192-cbc", "aes-192-ecb",
|
||||
"aes-256-cbc", "aes-256-ecb",
|
||||
"base64",
|
||||
"des", "des3", "desx", "idea", "rc4", "rc4-40",
|
||||
"rc2", "bf", "cast", "rc5",
|
||||
@@ -64,13 +67,14 @@ foreach (
|
||||
push(@files,$_);
|
||||
|
||||
$t=sprintf("\t{FUNC_TYPE_CIPHER,\"%s\",enc_main},\n",$_);
|
||||
if ($_ =~ /des/) { $t="#ifndef NO_DES\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /idea/) { $t="#ifndef NO_IDEA\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /rc4/) { $t="#ifndef NO_RC4\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /rc2/) { $t="#ifndef NO_RC2\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /bf/) { $t="#ifndef NO_BF\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /cast/) { $t="#ifndef NO_CAST\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /rc5/) { $t="#ifndef NO_RC5\n${t}#endif\n"; }
|
||||
if ($_ =~ /des/) { $t="#ifndef OPENSSL_NO_DES\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /aes/) { $t="#ifndef OPENSSL_NO_AES\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /idea/) { $t="#ifndef OPENSSL_NO_IDEA\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /rc4/) { $t="#ifndef OPENSSL_NO_RC4\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /rc2/) { $t="#ifndef OPENSSL_NO_RC2\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /bf/) { $t="#ifndef OPENSSL_NO_BF\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /cast/) { $t="#ifndef OPENSSL_NO_CAST\n${t}#endif\n"; }
|
||||
elsif ($_ =~ /rc5/) { $t="#ifndef OPENSSL_NO_RC5\n${t}#endif\n"; }
|
||||
print $t;
|
||||
}
|
||||
|
||||
|
||||
76
apps/rand.c
76
apps/rand.c
@@ -1,4 +1,57 @@
|
||||
/* apps/rand.c */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include "apps.h"
|
||||
|
||||
@@ -9,7 +62,6 @@
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG rand_main
|
||||
@@ -40,6 +92,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto err;
|
||||
|
||||
badopt = 0;
|
||||
i = 0;
|
||||
while (!badopt && argv[++i] != NULL)
|
||||
@@ -101,23 +156,7 @@ int MAIN(int argc, char **argv)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto err;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto err;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||
if (inrand != NULL)
|
||||
@@ -173,5 +212,6 @@ err:
|
||||
ERR_print_errors(bio_err);
|
||||
if (out)
|
||||
BIO_free_all(out);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
374
apps/req.c
374
apps/req.c
@@ -73,7 +73,6 @@
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define SECTION "req"
|
||||
|
||||
@@ -85,6 +84,7 @@
|
||||
#define V3_EXTENSIONS "x509_extensions"
|
||||
#define REQ_EXTENSIONS "req_extensions"
|
||||
#define STRING_MASK "string_mask"
|
||||
#define UTF8_IN "utf8"
|
||||
|
||||
#define DEFAULT_KEY_LENGTH 512
|
||||
#define MIN_KEY_LENGTH 384
|
||||
@@ -106,33 +106,37 @@
|
||||
* -rand file(s) - load the file(s) into the PRNG.
|
||||
* -newkey - make a key and a request.
|
||||
* -modulus - print RSA modulus.
|
||||
* -pubkey - output Public Key.
|
||||
* -x509 - output a self signed X509 structure instead.
|
||||
* -asn1-kludge - output new certificate request in a format that some CA's
|
||||
* require. This format is wrong
|
||||
*/
|
||||
|
||||
static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,char *dn,int attribs);
|
||||
static int build_subject(X509_REQ *req, char *subj);
|
||||
static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,char *dn,int attribs,
|
||||
unsigned long chtype);
|
||||
static int build_subject(X509_REQ *req, char *subj, unsigned long chtype);
|
||||
static int prompt_info(X509_REQ *req,
|
||||
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,
|
||||
unsigned long chtype);
|
||||
static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *sk,
|
||||
STACK_OF(CONF_VALUE) *attr, int attribs);
|
||||
STACK_OF(CONF_VALUE) *attr, int attribs,
|
||||
unsigned long chtype);
|
||||
static int add_attribute_object(X509_REQ *req, char *text,
|
||||
char *def, char *value, int nid, int min,
|
||||
int max);
|
||||
char *def, char *value, int nid, int n_min,
|
||||
int n_max, unsigned long chtype);
|
||||
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
||||
int nid,int min,int max);
|
||||
int nid,int n_min,int n_max, unsigned long chtype);
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
static void MS_CALLBACK req_cb(int p,int n,void *arg);
|
||||
#endif
|
||||
static int req_check_len(int len,int min,int max);
|
||||
static int req_check_len(int len,int n_min,int n_max);
|
||||
static int check_end(char *str, char *end);
|
||||
#ifndef MONOLITH
|
||||
static char *default_config_file=NULL;
|
||||
static LHASH *config=NULL;
|
||||
static CONF *config=NULL;
|
||||
#endif
|
||||
static LHASH *req_conf=NULL;
|
||||
static CONF *req_conf=NULL;
|
||||
static int batch=0;
|
||||
|
||||
#define TYPE_RSA 1
|
||||
@@ -152,10 +156,11 @@ int MAIN(int argc, char **argv)
|
||||
X509 *x509ss=NULL;
|
||||
X509_REQ *req=NULL;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
int i,badops=0,newreq=0,newkey= -1,verbose=0,pkey_type=TYPE_RSA;
|
||||
int i=0,badops=0,newreq=0,verbose=0,pkey_type=TYPE_RSA;
|
||||
long newkey = -1;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
|
||||
int nodes=0,kludge=0,newhdr=0,subject=0;
|
||||
int nodes=0,kludge=0,newhdr=0,subject=0,pubkey=0;
|
||||
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
|
||||
char *engine=NULL;
|
||||
char *extensions = NULL;
|
||||
@@ -169,8 +174,10 @@ int MAIN(int argc, char **argv)
|
||||
char *p;
|
||||
char *subj = NULL;
|
||||
const EVP_MD *md_alg=NULL,*digest=EVP_md5();
|
||||
unsigned long chtype = MBSTRING_ASC;
|
||||
#ifndef MONOLITH
|
||||
MS_STATIC char config_name[256];
|
||||
long errline;
|
||||
#endif
|
||||
|
||||
req_conf = NULL;
|
||||
@@ -213,6 +220,10 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
keyfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-pubkey") == 0)
|
||||
{
|
||||
pubkey=1;
|
||||
}
|
||||
else if (strcmp(*argv,"-new") == 0)
|
||||
{
|
||||
newreq=1;
|
||||
@@ -295,7 +306,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
dtmp=X509_get_pubkey(xtmp);
|
||||
if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end;
|
||||
if (dtmp->type == EVP_PKEY_DSA)
|
||||
dsa_params=DSAparams_dup(dtmp->pkey.dsa);
|
||||
EVP_PKEY_free(dtmp);
|
||||
@@ -338,6 +349,8 @@ int MAIN(int argc, char **argv)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-verbose") == 0)
|
||||
verbose=1;
|
||||
else if (strcmp(*argv,"-utf8") == 0)
|
||||
chtype = MBSTRING_UTF8;
|
||||
else if (strcmp(*argv,"-nameopt") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -405,6 +418,7 @@ bad:
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -text text form of request\n");
|
||||
BIO_printf(bio_err," -pubkey output public key\n");
|
||||
BIO_printf(bio_err," -noout do not output REQ\n");
|
||||
BIO_printf(bio_err," -verify verify signature on REQ\n");
|
||||
BIO_printf(bio_err," -modulus RSA modulus\n");
|
||||
@@ -420,7 +434,7 @@ bad:
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
BIO_printf(bio_err," -newkey rsa:bits generate a new RSA key of 'bits' in size\n");
|
||||
BIO_printf(bio_err," -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n");
|
||||
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2)\n");
|
||||
BIO_printf(bio_err," -[digest] Digest to sign with (md5, sha1, md2, mdc2, md4)\n");
|
||||
BIO_printf(bio_err," -config file request template file.\n");
|
||||
BIO_printf(bio_err," -subj arg set or modify request subject\n");
|
||||
BIO_printf(bio_err," -new new request.\n");
|
||||
@@ -433,6 +447,8 @@ bad:
|
||||
BIO_printf(bio_err," have been reported as requiring\n");
|
||||
BIO_printf(bio_err," -extensions .. specify certificate extension section (override value in config file)\n");
|
||||
BIO_printf(bio_err," -reqexts .. specify request extension section (override value in config file)\n");
|
||||
BIO_printf(bio_err," -utf8 input characters are UTF8 (default ASCII)\n");
|
||||
BIO_printf(bio_err," -nameopt arg - various certificate name options\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -457,16 +473,19 @@ bad:
|
||||
p=config_name;
|
||||
}
|
||||
default_config_file=p;
|
||||
config=CONF_load(config,p,NULL);
|
||||
config=NCONF_new(NULL);
|
||||
i=NCONF_load(config, p, &errline);
|
||||
#endif
|
||||
|
||||
if (template != NULL)
|
||||
{
|
||||
long errline;
|
||||
|
||||
BIO_printf(bio_err,"Using configuration from %s\n",template);
|
||||
req_conf=CONF_load(NULL,template,&errline);
|
||||
if (req_conf == NULL)
|
||||
if( verbose )
|
||||
BIO_printf(bio_err,"Using configuration from %s\n",template);
|
||||
req_conf=NCONF_new(NULL);
|
||||
i=NCONF_load(req_conf,template,&errline);
|
||||
if (i == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"error on line %ld of %s\n",errline,template);
|
||||
goto end;
|
||||
@@ -475,7 +494,8 @@ bad:
|
||||
else
|
||||
{
|
||||
req_conf=config;
|
||||
BIO_printf(bio_err,"Using configuration from %s\n",
|
||||
if( verbose )
|
||||
BIO_printf(bio_err,"Using configuration from %s\n",
|
||||
default_config_file);
|
||||
if (req_conf == NULL)
|
||||
{
|
||||
@@ -485,7 +505,9 @@ bad:
|
||||
|
||||
if (req_conf != NULL)
|
||||
{
|
||||
p=CONF_get_string(req_conf,NULL,"oid_file");
|
||||
if (!load_config(bio_err, req_conf))
|
||||
goto end;
|
||||
p=NCONF_get_string(req_conf,NULL,"oid_file");
|
||||
if (p == NULL)
|
||||
ERR_clear_error();
|
||||
if (p != NULL)
|
||||
@@ -511,7 +533,7 @@ bad:
|
||||
|
||||
if (md_alg == NULL)
|
||||
{
|
||||
p=CONF_get_string(req_conf,SECTION,"default_md");
|
||||
p=NCONF_get_string(req_conf,SECTION,"default_md");
|
||||
if (p == NULL)
|
||||
ERR_clear_error();
|
||||
if (p != NULL)
|
||||
@@ -523,7 +545,7 @@ bad:
|
||||
|
||||
if (!extensions)
|
||||
{
|
||||
extensions = CONF_get_string(req_conf, SECTION, V3_EXTENSIONS);
|
||||
extensions = NCONF_get_string(req_conf, SECTION, V3_EXTENSIONS);
|
||||
if (!extensions)
|
||||
ERR_clear_error();
|
||||
}
|
||||
@@ -531,8 +553,8 @@ bad:
|
||||
/* Check syntax of file */
|
||||
X509V3_CTX ctx;
|
||||
X509V3_set_ctx_test(&ctx);
|
||||
X509V3_set_conf_lhash(&ctx, req_conf);
|
||||
if(!X509V3_EXT_add_conf(req_conf, &ctx, extensions, NULL)) {
|
||||
X509V3_set_nconf(&ctx, req_conf);
|
||||
if(!X509V3_EXT_add_nconf(req_conf, &ctx, extensions, NULL)) {
|
||||
BIO_printf(bio_err,
|
||||
"Error Loading extension section %s\n", extensions);
|
||||
goto end;
|
||||
@@ -541,19 +563,19 @@ bad:
|
||||
|
||||
if(!passin)
|
||||
{
|
||||
passin = CONF_get_string(req_conf, SECTION, "input_password");
|
||||
passin = NCONF_get_string(req_conf, SECTION, "input_password");
|
||||
if (!passin)
|
||||
ERR_clear_error();
|
||||
}
|
||||
|
||||
if(!passout)
|
||||
{
|
||||
passout = CONF_get_string(req_conf, SECTION, "output_password");
|
||||
passout = NCONF_get_string(req_conf, SECTION, "output_password");
|
||||
if (!passout)
|
||||
ERR_clear_error();
|
||||
}
|
||||
|
||||
p = CONF_get_string(req_conf, SECTION, STRING_MASK);
|
||||
p = NCONF_get_string(req_conf, SECTION, STRING_MASK);
|
||||
if (!p)
|
||||
ERR_clear_error();
|
||||
|
||||
@@ -562,9 +584,19 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (chtype != MBSTRING_UTF8)
|
||||
{
|
||||
p = NCONF_get_string(req_conf, SECTION, UTF8_IN);
|
||||
if (!p)
|
||||
ERR_clear_error();
|
||||
else if (!strcmp(p, "yes"))
|
||||
chtype = MBSTRING_UTF8;
|
||||
}
|
||||
|
||||
|
||||
if(!req_exts)
|
||||
{
|
||||
req_exts = CONF_get_string(req_conf, SECTION, REQ_EXTENSIONS);
|
||||
req_exts = NCONF_get_string(req_conf, SECTION, REQ_EXTENSIONS);
|
||||
if (!req_exts)
|
||||
ERR_clear_error();
|
||||
}
|
||||
@@ -572,8 +604,8 @@ bad:
|
||||
/* Check syntax of file */
|
||||
X509V3_CTX ctx;
|
||||
X509V3_set_ctx_test(&ctx);
|
||||
X509V3_set_conf_lhash(&ctx, req_conf);
|
||||
if(!X509V3_EXT_add_conf(req_conf, &ctx, req_exts, NULL)) {
|
||||
X509V3_set_nconf(&ctx, req_conf);
|
||||
if(!X509V3_EXT_add_nconf(req_conf, &ctx, req_exts, NULL)) {
|
||||
BIO_printf(bio_err,
|
||||
"Error Loading request extension section %s\n",
|
||||
req_exts);
|
||||
@@ -586,65 +618,21 @@ bad:
|
||||
if ((in == NULL) || (out == NULL))
|
||||
goto end;
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if (keyfile != NULL)
|
||||
{
|
||||
if (keyform == FORMAT_ENGINE)
|
||||
pkey = load_key(bio_err, keyfile, keyform, passin, e,
|
||||
"Private Key");
|
||||
if (!pkey)
|
||||
{
|
||||
if (!e)
|
||||
{
|
||||
BIO_printf(bio_err,"no engine specified\n");
|
||||
goto end;
|
||||
}
|
||||
pkey = ENGINE_load_private_key(e, keyfile, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BIO_read_filename(in,keyfile) <= 0)
|
||||
{
|
||||
perror(keyfile);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (keyform == FORMAT_ASN1)
|
||||
pkey=d2i_PrivateKey_bio(in,NULL);
|
||||
else if (keyform == FORMAT_PEM)
|
||||
{
|
||||
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,
|
||||
passin);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"bad input format specified for X509 request\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (pkey == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load Private key\n");
|
||||
/* load_key() has already printed an appropriate
|
||||
message */
|
||||
goto end;
|
||||
}
|
||||
if (EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA)
|
||||
{
|
||||
char *randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||
if (randfile == NULL)
|
||||
ERR_clear_error();
|
||||
app_RAND_load_file(randfile, bio_err, 0);
|
||||
@@ -653,7 +641,7 @@ bad:
|
||||
|
||||
if (newreq && (pkey == NULL))
|
||||
{
|
||||
char *randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||
char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||
if (randfile == NULL)
|
||||
ERR_clear_error();
|
||||
app_RAND_load_file(randfile, bio_err, 0);
|
||||
@@ -662,8 +650,7 @@ bad:
|
||||
|
||||
if (newkey <= 0)
|
||||
{
|
||||
newkey=(int)CONF_get_number(req_conf,SECTION,BITS);
|
||||
if (newkey <= 0)
|
||||
if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey))
|
||||
newkey=DEFAULT_KEY_LENGTH;
|
||||
}
|
||||
|
||||
@@ -703,7 +690,7 @@ bad:
|
||||
|
||||
if (keyout == NULL)
|
||||
{
|
||||
keyout=CONF_get_string(req_conf,SECTION,KEYFILE);
|
||||
keyout=NCONF_get_string(req_conf,SECTION,KEYFILE);
|
||||
if (keyout == NULL)
|
||||
ERR_clear_error();
|
||||
}
|
||||
@@ -729,11 +716,11 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
p=CONF_get_string(req_conf,SECTION,"encrypt_rsa_key");
|
||||
p=NCONF_get_string(req_conf,SECTION,"encrypt_rsa_key");
|
||||
if (p == NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
p=CONF_get_string(req_conf,SECTION,"encrypt_key");
|
||||
p=NCONF_get_string(req_conf,SECTION,"encrypt_key");
|
||||
if (p == NULL)
|
||||
ERR_clear_error();
|
||||
}
|
||||
@@ -810,7 +797,7 @@ loop:
|
||||
goto end;
|
||||
}
|
||||
|
||||
i=make_REQ(req,pkey,subj,!x509);
|
||||
i=make_REQ(req,pkey,subj,!x509, chtype);
|
||||
subj=NULL; /* done processing '-subj' option */
|
||||
if ((kludge > 0) && !sk_X509_ATTRIBUTE_num(req->req_info->attributes))
|
||||
{
|
||||
@@ -832,28 +819,29 @@ loop:
|
||||
/* Set version to V3 */
|
||||
if(!X509_set_version(x509ss, 2)) goto end;
|
||||
if (serial)
|
||||
X509_set_serialNumber(x509ss, serial);
|
||||
{
|
||||
if (!X509_set_serialNumber(x509ss, serial)) goto end;
|
||||
}
|
||||
else
|
||||
ASN1_INTEGER_set(X509_get_serialNumber(x509ss),0L);
|
||||
{
|
||||
if (!ASN1_INTEGER_set(X509_get_serialNumber(x509ss),0L)) goto end;
|
||||
}
|
||||
|
||||
X509_set_issuer_name(x509ss,
|
||||
X509_REQ_get_subject_name(req));
|
||||
X509_gmtime_adj(X509_get_notBefore(x509ss),0);
|
||||
X509_gmtime_adj(X509_get_notAfter(x509ss),
|
||||
(long)60*60*24*days);
|
||||
X509_set_subject_name(x509ss,
|
||||
X509_REQ_get_subject_name(req));
|
||||
if (!X509_set_issuer_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
|
||||
if (!X509_gmtime_adj(X509_get_notBefore(x509ss),0)) goto end;
|
||||
if (!X509_gmtime_adj(X509_get_notAfter(x509ss), (long)60*60*24*days)) goto end;
|
||||
if (!X509_set_subject_name(x509ss, X509_REQ_get_subject_name(req))) goto end;
|
||||
tmppkey = X509_REQ_get_pubkey(req);
|
||||
X509_set_pubkey(x509ss,tmppkey);
|
||||
if (!tmppkey || !X509_set_pubkey(x509ss,tmppkey)) goto end;
|
||||
EVP_PKEY_free(tmppkey);
|
||||
|
||||
/* Set up V3 context struct */
|
||||
|
||||
X509V3_set_ctx(&ext_ctx, x509ss, x509ss, NULL, NULL, 0);
|
||||
X509V3_set_conf_lhash(&ext_ctx, req_conf);
|
||||
X509V3_set_nconf(&ext_ctx, req_conf);
|
||||
|
||||
/* Add extensions */
|
||||
if(extensions && !X509V3_EXT_add_conf(req_conf,
|
||||
if(extensions && !X509V3_EXT_add_nconf(req_conf,
|
||||
&ext_ctx, extensions, x509ss))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
@@ -872,10 +860,10 @@ loop:
|
||||
/* Set up V3 context struct */
|
||||
|
||||
X509V3_set_ctx(&ext_ctx, NULL, NULL, req, NULL, 0);
|
||||
X509V3_set_conf_lhash(&ext_ctx, req_conf);
|
||||
X509V3_set_nconf(&ext_ctx, req_conf);
|
||||
|
||||
/* Add extensions */
|
||||
if(req_exts && !X509V3_EXT_REQ_add_conf(req_conf,
|
||||
if(req_exts && !X509V3_EXT_REQ_add_nconf(req_conf,
|
||||
&ext_ctx, req_exts, req))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
@@ -902,7 +890,7 @@ loop:
|
||||
print_name(bio_err, "old subject=", X509_REQ_get_subject_name(req), nmflag);
|
||||
}
|
||||
|
||||
if (build_subject(req, subj) == 0)
|
||||
if (build_subject(req, subj, chtype) == 0)
|
||||
{
|
||||
BIO_printf(bio_err, "ERROR: cannot modify subject\n");
|
||||
ex=1;
|
||||
@@ -941,12 +929,13 @@ loop:
|
||||
else if (i == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"verify failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
else /* if (i > 0) */
|
||||
BIO_printf(bio_err,"verify OK\n");
|
||||
}
|
||||
|
||||
if (noout && !text && !modulus && !subject)
|
||||
if (noout && !text && !modulus && !subject && !pubkey)
|
||||
{
|
||||
ex=0;
|
||||
goto end;
|
||||
@@ -975,6 +964,20 @@ loop:
|
||||
}
|
||||
}
|
||||
|
||||
if (pubkey)
|
||||
{
|
||||
EVP_PKEY *tpubkey;
|
||||
tpubkey=X509_REQ_get_pubkey(req);
|
||||
if (tpubkey == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Error getting public key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
PEM_write_bio_PUBKEY(out, tpubkey);
|
||||
EVP_PKEY_free(tpubkey);
|
||||
}
|
||||
|
||||
if (text)
|
||||
{
|
||||
if (x509)
|
||||
@@ -993,24 +996,25 @@ loop:
|
||||
|
||||
if (modulus)
|
||||
{
|
||||
EVP_PKEY *pubkey;
|
||||
EVP_PKEY *tpubkey;
|
||||
|
||||
if (x509)
|
||||
pubkey=X509_get_pubkey(x509ss);
|
||||
tpubkey=X509_get_pubkey(x509ss);
|
||||
else
|
||||
pubkey=X509_REQ_get_pubkey(req);
|
||||
if (pubkey == NULL)
|
||||
tpubkey=X509_REQ_get_pubkey(req);
|
||||
if (tpubkey == NULL)
|
||||
{
|
||||
fprintf(stdout,"Modulus=unavailable\n");
|
||||
goto end;
|
||||
}
|
||||
fprintf(stdout,"Modulus=");
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
if (pubkey->type == EVP_PKEY_RSA)
|
||||
BN_print(out,pubkey->pkey.rsa->n);
|
||||
if (tpubkey->type == EVP_PKEY_RSA)
|
||||
BN_print(out,tpubkey->pkey.rsa->n);
|
||||
else
|
||||
#endif
|
||||
fprintf(stdout,"Wrong Algorithm type");
|
||||
EVP_PKEY_free(tpubkey);
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
|
||||
@@ -1053,7 +1057,7 @@ end:
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
if ((req_conf != NULL) && (req_conf != config)) CONF_free(req_conf);
|
||||
if ((req_conf != NULL) && (req_conf != config)) NCONF_free(req_conf);
|
||||
BIO_free(in);
|
||||
BIO_free_all(out);
|
||||
EVP_PKEY_free(pkey);
|
||||
@@ -1066,36 +1070,38 @@ end:
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
if (dsa_params != NULL) DSA_free(dsa_params);
|
||||
#endif
|
||||
apps_shutdown();
|
||||
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 attribs,
|
||||
unsigned long chtype)
|
||||
{
|
||||
int ret=0,i;
|
||||
char no_prompt = 0;
|
||||
STACK_OF(CONF_VALUE) *dn_sk, *attr_sk = NULL;
|
||||
char *tmp, *dn_sect,*attr_sect;
|
||||
|
||||
tmp=CONF_get_string(req_conf,SECTION,PROMPT);
|
||||
tmp=NCONF_get_string(req_conf,SECTION,PROMPT);
|
||||
if (tmp == NULL)
|
||||
ERR_clear_error();
|
||||
if((tmp != NULL) && !strcmp(tmp, "no")) no_prompt = 1;
|
||||
|
||||
dn_sect=CONF_get_string(req_conf,SECTION,DISTINGUISHED_NAME);
|
||||
dn_sect=NCONF_get_string(req_conf,SECTION,DISTINGUISHED_NAME);
|
||||
if (dn_sect == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to find '%s' in config\n",
|
||||
DISTINGUISHED_NAME);
|
||||
goto err;
|
||||
}
|
||||
dn_sk=CONF_get_section(req_conf,dn_sect);
|
||||
dn_sk=NCONF_get_section(req_conf,dn_sect);
|
||||
if (dn_sk == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to get '%s' section\n",dn_sect);
|
||||
goto err;
|
||||
}
|
||||
|
||||
attr_sect=CONF_get_string(req_conf,SECTION,ATTRIBUTES);
|
||||
attr_sect=NCONF_get_string(req_conf,SECTION,ATTRIBUTES);
|
||||
if (attr_sect == NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
@@ -1103,7 +1109,7 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs)
|
||||
}
|
||||
else
|
||||
{
|
||||
attr_sk=CONF_get_section(req_conf,attr_sect);
|
||||
attr_sk=NCONF_get_section(req_conf,attr_sect);
|
||||
if (attr_sk == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to get '%s' section\n",attr_sect);
|
||||
@@ -1115,81 +1121,39 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, char *subj, int attribs)
|
||||
if (!X509_REQ_set_version(req,0L)) goto err; /* version 1 */
|
||||
|
||||
if (no_prompt)
|
||||
i = auto_info(req, dn_sk, attr_sk, attribs);
|
||||
i = auto_info(req, dn_sk, attr_sk, attribs, chtype);
|
||||
else
|
||||
{
|
||||
if (subj)
|
||||
i = build_subject(req, subj);
|
||||
i = build_subject(req, subj, chtype);
|
||||
else
|
||||
i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs);
|
||||
i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs, chtype);
|
||||
}
|
||||
if(!i) goto err;
|
||||
|
||||
X509_REQ_set_pubkey(req,pkey);
|
||||
if (!X509_REQ_set_pubkey(req,pkey)) goto err;
|
||||
|
||||
ret=1;
|
||||
err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int build_subject(X509_REQ *req, char *subject)
|
||||
/*
|
||||
* subject is expected to be in the format /type0=value0/type1=value1/type2=...
|
||||
* where characters may be escaped by \
|
||||
*/
|
||||
static int build_subject(X509_REQ *req, char *subject, unsigned long chtype)
|
||||
{
|
||||
X509_NAME *n = NULL;
|
||||
X509_NAME *n;
|
||||
|
||||
int i, nid, ne_num=0;
|
||||
|
||||
char *ne_name = NULL;
|
||||
char *ne_value = NULL;
|
||||
|
||||
char *tmp = NULL;
|
||||
char *p[2];
|
||||
|
||||
char *str_list[256];
|
||||
|
||||
p[0] = ",/";
|
||||
p[1] = "=";
|
||||
|
||||
n = X509_NAME_new();
|
||||
|
||||
tmp = strtok(subject, p[0]);
|
||||
while((tmp != NULL) && (ne_num < (sizeof str_list/sizeof *str_list)))
|
||||
{
|
||||
char *token = tmp;
|
||||
|
||||
while (token[0] == ' ')
|
||||
token++;
|
||||
str_list[ne_num] = token;
|
||||
|
||||
tmp = strtok(NULL, p[0]);
|
||||
ne_num++;
|
||||
}
|
||||
|
||||
for(i = 0; i < ne_num; i++)
|
||||
{
|
||||
ne_name = strtok(str_list[i], p[1]);
|
||||
ne_value = strtok(NULL, p[1]);
|
||||
|
||||
if ((nid=OBJ_txt2nid(ne_name)) == NID_undef)
|
||||
{
|
||||
BIO_printf(bio_err, "Subject Attribute %s has no known NID, skipped\n", ne_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ne_value == NULL)
|
||||
{
|
||||
BIO_printf(bio_err, "No value provided for Subject Attribute %s, skipped\n", ne_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!X509_NAME_add_entry_by_NID(n, nid, MBSTRING_ASC, (unsigned char*)ne_value, -1,-1,0))
|
||||
{
|
||||
X509_NAME_free(n);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (!(n = do_subject(subject, chtype)))
|
||||
return 0;
|
||||
|
||||
if (!X509_REQ_set_subject_name(req, n))
|
||||
{
|
||||
X509_NAME_free(n);
|
||||
return 0;
|
||||
}
|
||||
X509_NAME_free(n);
|
||||
return 1;
|
||||
}
|
||||
@@ -1197,12 +1161,14 @@ static int build_subject(X509_REQ *req, char *subject)
|
||||
|
||||
static int prompt_info(X509_REQ *req,
|
||||
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,
|
||||
unsigned long chtype)
|
||||
{
|
||||
int i;
|
||||
char *p,*q;
|
||||
char buf[100];
|
||||
int nid,min,max;
|
||||
int nid;
|
||||
long n_min,n_max;
|
||||
char *type,*def,*value;
|
||||
CONF_VALUE *v;
|
||||
X509_NAME *subj;
|
||||
@@ -1247,27 +1213,29 @@ start: for (;;)
|
||||
/* If OBJ not recognised ignore it */
|
||||
if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start;
|
||||
sprintf(buf,"%s_default",v->name);
|
||||
if ((def=CONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
if ((def=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
def="";
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_value",v->name);
|
||||
if ((value=CONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
if ((value=NCONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
value=NULL;
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_min",v->name);
|
||||
min=(int)CONF_get_number(req_conf,dn_sect,buf);
|
||||
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_min))
|
||||
n_min = -1;
|
||||
|
||||
sprintf(buf,"%s_max",v->name);
|
||||
max=(int)CONF_get_number(req_conf,dn_sect,buf);
|
||||
if (!NCONF_get_number(req_conf,dn_sect,buf, &n_max))
|
||||
n_max = -1;
|
||||
|
||||
if (!add_DN_object(subj,v->value,def,value,nid,
|
||||
min,max))
|
||||
n_min,n_max, chtype))
|
||||
return 0;
|
||||
}
|
||||
if (X509_NAME_entry_count(subj) == 0)
|
||||
@@ -1298,7 +1266,7 @@ start2: for (;;)
|
||||
goto start2;
|
||||
|
||||
sprintf(buf,"%s_default",type);
|
||||
if ((def=CONF_get_string(req_conf,attr_sect,buf))
|
||||
if ((def=NCONF_get_string(req_conf,attr_sect,buf))
|
||||
== NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
@@ -1307,7 +1275,7 @@ start2: for (;;)
|
||||
|
||||
|
||||
sprintf(buf,"%s_value",type);
|
||||
if ((value=CONF_get_string(req_conf,attr_sect,buf))
|
||||
if ((value=NCONF_get_string(req_conf,attr_sect,buf))
|
||||
== NULL)
|
||||
{
|
||||
ERR_clear_error();
|
||||
@@ -1315,13 +1283,15 @@ start2: for (;;)
|
||||
}
|
||||
|
||||
sprintf(buf,"%s_min",type);
|
||||
min=(int)CONF_get_number(req_conf,attr_sect,buf);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_min))
|
||||
n_min = -1;
|
||||
|
||||
sprintf(buf,"%s_max",type);
|
||||
max=(int)CONF_get_number(req_conf,attr_sect,buf);
|
||||
if (!NCONF_get_number(req_conf,attr_sect,buf, &n_max))
|
||||
n_max = -1;
|
||||
|
||||
if (!add_attribute_object(req,
|
||||
v->value,def,value,nid,min,max))
|
||||
v->value,def,value,nid,n_min,n_max, chtype))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1337,7 +1307,7 @@ start2: for (;;)
|
||||
}
|
||||
|
||||
static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
|
||||
STACK_OF(CONF_VALUE) *attr_sk, int attribs)
|
||||
STACK_OF(CONF_VALUE) *attr_sk, int attribs, unsigned long chtype)
|
||||
{
|
||||
int i;
|
||||
char *p,*q;
|
||||
@@ -1365,7 +1335,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
|
||||
if(*p) type = p;
|
||||
break;
|
||||
}
|
||||
if (!X509_NAME_add_entry_by_txt(subj,type, MBSTRING_ASC,
|
||||
if (!X509_NAME_add_entry_by_txt(subj,type, chtype,
|
||||
(unsigned char *) v->value,-1,-1,0)) return 0;
|
||||
|
||||
}
|
||||
@@ -1380,7 +1350,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
|
||||
for (i = 0; i < sk_CONF_VALUE_num(attr_sk); i++)
|
||||
{
|
||||
v=sk_CONF_VALUE_value(attr_sk,i);
|
||||
if(!X509_REQ_add1_attr_by_txt(req, v->name, MBSTRING_ASC,
|
||||
if(!X509_REQ_add1_attr_by_txt(req, v->name, chtype,
|
||||
(unsigned char *)v->value, -1)) return 0;
|
||||
}
|
||||
}
|
||||
@@ -1389,7 +1359,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,
|
||||
int nid, int min, int max)
|
||||
int nid, int n_min, int n_max, unsigned long chtype)
|
||||
{
|
||||
int i,ret=0;
|
||||
MS_STATIC char buf[1024];
|
||||
@@ -1436,8 +1406,8 @@ start:
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ebcdic2ascii(buf, buf, i);
|
||||
#endif
|
||||
if(!req_check_len(i, min, max)) goto start;
|
||||
if (!X509_NAME_add_entry_by_NID(n,nid, MBSTRING_ASC,
|
||||
if(!req_check_len(i, n_min, n_max)) goto start;
|
||||
if (!X509_NAME_add_entry_by_NID(n,nid, chtype,
|
||||
(unsigned char *) buf, -1,-1,0)) goto err;
|
||||
ret=1;
|
||||
err:
|
||||
@@ -1445,8 +1415,8 @@ err:
|
||||
}
|
||||
|
||||
static int add_attribute_object(X509_REQ *req, char *text,
|
||||
char *def, char *value, int nid, int min,
|
||||
int max)
|
||||
char *def, char *value, int nid, int n_min,
|
||||
int n_max, unsigned long chtype)
|
||||
{
|
||||
int i;
|
||||
static char buf[1024];
|
||||
@@ -1494,9 +1464,9 @@ start:
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ebcdic2ascii(buf, buf, i);
|
||||
#endif
|
||||
if(!req_check_len(i, min, max)) goto start;
|
||||
if(!req_check_len(i, n_min, n_max)) goto start;
|
||||
|
||||
if(!X509_REQ_add1_attr_by_NID(req, nid, MBSTRING_ASC,
|
||||
if(!X509_REQ_add1_attr_by_NID(req, nid, chtype,
|
||||
(unsigned char *)buf, -1)) {
|
||||
BIO_printf(bio_err, "Error adding attribute\n");
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -1525,16 +1495,16 @@ static void MS_CALLBACK req_cb(int p, int n, void *arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
static int req_check_len(int len, int min, int max)
|
||||
static int req_check_len(int len, int n_min, int n_max)
|
||||
{
|
||||
if (len < min)
|
||||
if ((n_min > 0) && (len < n_min))
|
||||
{
|
||||
BIO_printf(bio_err,"string is too short, it needs to be at least %d bytes long\n",min);
|
||||
BIO_printf(bio_err,"string is too short, it needs to be at least %d bytes long\n",n_min);
|
||||
return(0);
|
||||
}
|
||||
if ((max != 0) && (len > max))
|
||||
if ((n_max >= 0) && (len > n_max))
|
||||
{
|
||||
BIO_printf(bio_err,"string is too long, it needs to be less than %d bytes long\n",max);
|
||||
BIO_printf(bio_err,"string is too long, it needs to be less than %d bytes long\n",n_max);
|
||||
return(0);
|
||||
}
|
||||
return(1);
|
||||
|
||||
105
apps/rsa.c
105
apps/rsa.c
@@ -68,7 +68,6 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG rsa_main
|
||||
@@ -80,6 +79,9 @@
|
||||
* -des - encrypt output if PEM format with DES in cbc mode
|
||||
* -des3 - encrypt output if PEM format
|
||||
* -idea - encrypt output if PEM format
|
||||
* -aes128 - encrypt output if PEM format
|
||||
* -aes192 - encrypt output if PEM format
|
||||
* -aes256 - encrypt output if PEM format
|
||||
* -text - print a text version
|
||||
* -modulus - print the RSA key modulus
|
||||
* -check - verify key consistency
|
||||
@@ -96,7 +98,7 @@ int MAIN(int argc, char **argv)
|
||||
RSA *rsa=NULL;
|
||||
int i,badops=0, sgckey=0;
|
||||
const EVP_CIPHER *enc=NULL;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
BIO *out=NULL;
|
||||
int informat,outformat,text=0,check=0,noout=0;
|
||||
int pubin = 0, pubout = 0;
|
||||
char *infile,*outfile,*prog;
|
||||
@@ -111,6 +113,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
informat=FORMAT_PEM;
|
||||
@@ -196,6 +201,10 @@ bad:
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -noout don't print key out\n");
|
||||
@@ -209,23 +218,7 @@ bad:
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
@@ -237,69 +230,29 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (infile == NULL)
|
||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
else
|
||||
{
|
||||
if (BIO_read_filename(in,infile) <= 0)
|
||||
{
|
||||
perror(infile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
{
|
||||
EVP_PKEY *pkey;
|
||||
|
||||
BIO_printf(bio_err,"read RSA key\n");
|
||||
if (informat == FORMAT_ASN1) {
|
||||
if (pubin) rsa=d2i_RSA_PUBKEY_bio(in,NULL);
|
||||
else rsa=d2i_RSAPrivateKey_bio(in,NULL);
|
||||
if (pubin)
|
||||
pkey = load_pubkey(bio_err, infile,
|
||||
(informat == FORMAT_NETSCAPE && sgckey ?
|
||||
FORMAT_IISSGC : informat),
|
||||
passin, e, "Public Key");
|
||||
else
|
||||
pkey = load_key(bio_err, infile,
|
||||
(informat == FORMAT_NETSCAPE && sgckey ?
|
||||
FORMAT_IISSGC : informat),
|
||||
passin, e, "Private Key");
|
||||
|
||||
if (pkey != NULL)
|
||||
rsa = pkey == NULL ? NULL : EVP_PKEY_get1_RSA(pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
#ifndef OPENSSL_NO_RC4
|
||||
else if (informat == FORMAT_NETSCAPE)
|
||||
{
|
||||
BUF_MEM *buf=NULL;
|
||||
const unsigned char *p;
|
||||
int size=0;
|
||||
|
||||
buf=BUF_MEM_new();
|
||||
for (;;)
|
||||
{
|
||||
if ((buf == NULL) || (!BUF_MEM_grow(buf,size+1024*10)))
|
||||
goto end;
|
||||
i=BIO_read(in,&(buf->data[size]),1024*10);
|
||||
size+=i;
|
||||
if (i == 0) break;
|
||||
if (i < 0)
|
||||
{
|
||||
perror("reading private key");
|
||||
BUF_MEM_free(buf);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
p=(unsigned char *)buf->data;
|
||||
rsa=d2i_RSA_NET(NULL,&p,(long)size,NULL, sgckey);
|
||||
BUF_MEM_free(buf);
|
||||
}
|
||||
#endif
|
||||
else if (informat == FORMAT_PEM) {
|
||||
if(pubin) rsa=PEM_read_bio_RSA_PUBKEY(in,NULL,NULL,NULL);
|
||||
else rsa=PEM_read_bio_RSAPrivateKey(in,NULL, NULL,passin);
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"bad input format specified for key\n");
|
||||
goto end;
|
||||
}
|
||||
if (rsa == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -411,11 +364,11 @@ bad:
|
||||
else
|
||||
ret=0;
|
||||
end:
|
||||
if(in != NULL) BIO_free(in);
|
||||
if(out != NULL) BIO_free_all(out);
|
||||
if(rsa != NULL) RSA_free(rsa);
|
||||
if(passin) OPENSSL_free(passin);
|
||||
if(passout) OPENSSL_free(passout);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
#else /* !OPENSSL_NO_RSA */
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
#include <string.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define RSA_SIGN 1
|
||||
#define RSA_VERIFY 2
|
||||
@@ -105,6 +104,9 @@ int MAIN(int argc, char **argv)
|
||||
argv++;
|
||||
|
||||
if(!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
ERR_load_crypto_strings();
|
||||
OpenSSL_add_all_algorithms();
|
||||
pad = RSA_PKCS1_PADDING;
|
||||
@@ -120,6 +122,9 @@ int MAIN(int argc, char **argv)
|
||||
} else if(!strcmp(*argv, "-inkey")) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
keyfile = *(++argv);
|
||||
} else if (strcmp(*argv,"-keyform") == 0) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
keyform=str2fmt(*(++argv));
|
||||
} else if(!strcmp(*argv, "-engine")) {
|
||||
if (--argc < 1) badarg = 1;
|
||||
engine = *(++argv);
|
||||
@@ -157,38 +162,25 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
/* FIXME: seed PRNG only if needed */
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
|
||||
switch(key_type) {
|
||||
case KEY_PRIVKEY:
|
||||
pkey = load_key(bio_err, keyfile, keyform, NULL, e);
|
||||
pkey = load_key(bio_err, keyfile, keyform,
|
||||
NULL, e, "Private Key");
|
||||
break;
|
||||
|
||||
case KEY_PUBKEY:
|
||||
pkey = load_pubkey(bio_err, keyfile, keyform, e);
|
||||
pkey = load_pubkey(bio_err, keyfile, keyform,
|
||||
NULL, e, "Public Key");
|
||||
break;
|
||||
|
||||
case KEY_CERT:
|
||||
x = load_cert(bio_err, keyfile, keyform);
|
||||
x = load_cert(bio_err, keyfile, keyform,
|
||||
NULL, e, "Certificate");
|
||||
if(x) {
|
||||
pkey = X509_get_pubkey(x);
|
||||
X509_free(x);
|
||||
@@ -197,7 +189,6 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
if(!pkey) {
|
||||
BIO_printf(bio_err, "Error loading key\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -302,6 +293,7 @@ static void usage()
|
||||
BIO_printf(bio_err, "-in file input file\n");
|
||||
BIO_printf(bio_err, "-out file output file\n");
|
||||
BIO_printf(bio_err, "-inkey file input key\n");
|
||||
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
|
||||
BIO_printf(bio_err, "-pubin input is an RSA public\n");
|
||||
BIO_printf(bio_err, "-certin input is a certificate carrying an RSA public key\n");
|
||||
BIO_printf(bio_err, "-ssl use SSL v2 padding\n");
|
||||
@@ -313,6 +305,8 @@ static void usage()
|
||||
BIO_printf(bio_err, "-encrypt encrypt with public 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, "-engine e use engine e, possibly a hardware device.\n");
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <openssl/opensslconf.h>
|
||||
@@ -89,13 +142,9 @@ typedef fd_mask fd_set;
|
||||
int do_server(int port, int *ret, int (*cb) (), char *context);
|
||||
#ifdef HEADER_X509_H
|
||||
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
|
||||
#else
|
||||
int MS_CALLBACK verify_callback(int ok, char *ctx);
|
||||
#endif
|
||||
#ifdef HEADER_SSL_H
|
||||
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
|
||||
#else
|
||||
int set_cert_stuff(char *ctx, char *cert_file, char *key_file);
|
||||
#endif
|
||||
int init_client(int *sock, char *server, int port);
|
||||
int should_retry(int i);
|
||||
@@ -106,8 +155,6 @@ long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp,
|
||||
int argi, long argl, long ret);
|
||||
|
||||
#ifdef HEADER_SSL_H
|
||||
void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret);
|
||||
#else
|
||||
void MS_CALLBACK apps_ssl_info_callback(char *s, int where, int ret);
|
||||
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret);
|
||||
void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
|
||||
#endif
|
||||
|
||||
|
||||
313
apps/s_cb.c
313
apps/s_cb.c
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -200,7 +253,7 @@ long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi,
|
||||
return(ret);
|
||||
}
|
||||
|
||||
void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret)
|
||||
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret)
|
||||
{
|
||||
char *str;
|
||||
int w;
|
||||
@@ -236,3 +289,261 @@ void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)
|
||||
{
|
||||
BIO *bio = arg;
|
||||
const char *str_write_p, *str_version, *str_content_type = "", *str_details1 = "", *str_details2= "";
|
||||
|
||||
str_write_p = write_p ? ">>>" : "<<<";
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case SSL2_VERSION:
|
||||
str_version = "SSL 2.0";
|
||||
break;
|
||||
case SSL3_VERSION:
|
||||
str_version = "SSL 3.0 ";
|
||||
break;
|
||||
case TLS1_VERSION:
|
||||
str_version = "TLS 1.0 ";
|
||||
break;
|
||||
default:
|
||||
str_version = "???";
|
||||
}
|
||||
|
||||
if (version == SSL2_VERSION)
|
||||
{
|
||||
str_details1 = "???";
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
switch (((unsigned char*)buf)[0])
|
||||
{
|
||||
case 0:
|
||||
str_details1 = ", ERROR:";
|
||||
str_details2 = " ???";
|
||||
if (len >= 3)
|
||||
{
|
||||
unsigned err = (((unsigned char*)buf)[1]<<8) + ((unsigned char*)buf)[2];
|
||||
|
||||
switch (err)
|
||||
{
|
||||
case 0x0001:
|
||||
str_details2 = " NO-CIPHER-ERROR";
|
||||
break;
|
||||
case 0x0002:
|
||||
str_details2 = " NO-CERTIFICATE-ERROR";
|
||||
break;
|
||||
case 0x0004:
|
||||
str_details2 = " BAD-CERTIFICATE-ERROR";
|
||||
break;
|
||||
case 0x0006:
|
||||
str_details2 = " UNSUPPORTED-CERTIFICATE-TYPE-ERROR";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 1:
|
||||
str_details1 = ", CLIENT-HELLO";
|
||||
break;
|
||||
case 2:
|
||||
str_details1 = ", CLIENT-MASTER-KEY";
|
||||
break;
|
||||
case 3:
|
||||
str_details1 = ", CLIENT-FINISHED";
|
||||
break;
|
||||
case 4:
|
||||
str_details1 = ", SERVER-HELLO";
|
||||
break;
|
||||
case 5:
|
||||
str_details1 = ", SERVER-VERIFY";
|
||||
break;
|
||||
case 6:
|
||||
str_details1 = ", SERVER-FINISHED";
|
||||
break;
|
||||
case 7:
|
||||
str_details1 = ", REQUEST-CERTIFICATE";
|
||||
break;
|
||||
case 8:
|
||||
str_details1 = ", CLIENT-CERTIFICATE";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (version == SSL3_VERSION || version == TLS1_VERSION)
|
||||
{
|
||||
switch (content_type)
|
||||
{
|
||||
case 20:
|
||||
str_content_type = "ChangeCipherSpec";
|
||||
break;
|
||||
case 21:
|
||||
str_content_type = "Alert";
|
||||
break;
|
||||
case 22:
|
||||
str_content_type = "Handshake";
|
||||
break;
|
||||
}
|
||||
|
||||
if (content_type == 21) /* Alert */
|
||||
{
|
||||
str_details1 = ", ???";
|
||||
|
||||
if (len == 2)
|
||||
{
|
||||
switch (((unsigned char*)buf)[0])
|
||||
{
|
||||
case 1:
|
||||
str_details1 = ", warning";
|
||||
break;
|
||||
case 2:
|
||||
str_details1 = ", fatal";
|
||||
break;
|
||||
}
|
||||
|
||||
str_details2 = " ???";
|
||||
switch (((unsigned char*)buf)[1])
|
||||
{
|
||||
case 0:
|
||||
str_details2 = " close_notify";
|
||||
break;
|
||||
case 10:
|
||||
str_details2 = " unexpected_message";
|
||||
break;
|
||||
case 20:
|
||||
str_details2 = " bad_record_mac";
|
||||
break;
|
||||
case 21:
|
||||
str_details2 = " decryption_failed";
|
||||
break;
|
||||
case 22:
|
||||
str_details2 = " record_overflow";
|
||||
break;
|
||||
case 30:
|
||||
str_details2 = " decompression_failure";
|
||||
break;
|
||||
case 40:
|
||||
str_details2 = " handshake_failure";
|
||||
break;
|
||||
case 42:
|
||||
str_details2 = " bad_certificate";
|
||||
break;
|
||||
case 43:
|
||||
str_details2 = " unsupported_certificate";
|
||||
break;
|
||||
case 44:
|
||||
str_details2 = " certificate_revoked";
|
||||
break;
|
||||
case 45:
|
||||
str_details2 = " certificate_expired";
|
||||
break;
|
||||
case 46:
|
||||
str_details2 = " certificate_unknown";
|
||||
break;
|
||||
case 47:
|
||||
str_details2 = " illegal_parameter";
|
||||
break;
|
||||
case 48:
|
||||
str_details2 = " unknown_ca";
|
||||
break;
|
||||
case 49:
|
||||
str_details2 = " access_denied";
|
||||
break;
|
||||
case 50:
|
||||
str_details2 = " decode_error";
|
||||
break;
|
||||
case 51:
|
||||
str_details2 = " decrypt_error";
|
||||
break;
|
||||
case 60:
|
||||
str_details2 = " export_restriction";
|
||||
break;
|
||||
case 70:
|
||||
str_details2 = " protocol_version";
|
||||
break;
|
||||
case 71:
|
||||
str_details2 = " insufficient_security";
|
||||
break;
|
||||
case 80:
|
||||
str_details2 = " internal_error";
|
||||
break;
|
||||
case 90:
|
||||
str_details2 = " user_canceled";
|
||||
break;
|
||||
case 100:
|
||||
str_details2 = " no_renegotiation";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (content_type == 22) /* Handshake */
|
||||
{
|
||||
str_details1 = "???";
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
switch (((unsigned char*)buf)[0])
|
||||
{
|
||||
case 0:
|
||||
str_details1 = ", HelloRequest";
|
||||
break;
|
||||
case 1:
|
||||
str_details1 = ", ClientHello";
|
||||
break;
|
||||
case 2:
|
||||
str_details1 = ", ServerHello";
|
||||
break;
|
||||
case 11:
|
||||
str_details1 = ", Certificate";
|
||||
break;
|
||||
case 12:
|
||||
str_details1 = ", ServerKeyExchange";
|
||||
break;
|
||||
case 13:
|
||||
str_details1 = ", CertificateRequest";
|
||||
break;
|
||||
case 14:
|
||||
str_details1 = ", ServerHelloDone";
|
||||
break;
|
||||
case 15:
|
||||
str_details1 = ", CertificateVerify";
|
||||
break;
|
||||
case 16:
|
||||
str_details1 = ", ClientKeyExchange";
|
||||
break;
|
||||
case 20:
|
||||
str_details1 = ", Finished";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIO_printf(bio, "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version, str_content_type, (unsigned long)len, str_details1, str_details2);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
size_t num, i;
|
||||
|
||||
BIO_printf(bio, " ");
|
||||
num = len;
|
||||
#if 0
|
||||
if (num > 16)
|
||||
num = 16;
|
||||
#endif
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
if (i % 16 == 0 && i > 0)
|
||||
BIO_printf(bio, "\n ");
|
||||
BIO_printf(bio, " %02x", ((unsigned char*)buf)[i]);
|
||||
}
|
||||
if (i < len)
|
||||
BIO_printf(bio, " ...");
|
||||
BIO_printf(bio, "\n");
|
||||
}
|
||||
BIO_flush(bio);
|
||||
}
|
||||
|
||||
140
apps/s_client.c
140
apps/s_client.c
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
@@ -80,7 +133,7 @@ typedef unsigned int u_int;
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
#include <openssl/rand.h>
|
||||
#include "s_apps.h"
|
||||
|
||||
#ifdef OPENSSL_SYS_WINDOWS
|
||||
@@ -113,6 +166,7 @@ static int c_nbio=0;
|
||||
#endif
|
||||
static int c_Pause=0;
|
||||
static int c_debug=0;
|
||||
static int c_msg=0;
|
||||
static int c_showcerts=0;
|
||||
|
||||
static void sc_usage(void);
|
||||
@@ -139,6 +193,7 @@ static void sc_usage(void)
|
||||
BIO_printf(bio_err," -pause - sleep(1) after each read(2) and write(2) system call\n");
|
||||
BIO_printf(bio_err," -showcerts - show all certificates in the chain\n");
|
||||
BIO_printf(bio_err," -debug - extra output\n");
|
||||
BIO_printf(bio_err," -msg - Show protocol messages\n");
|
||||
BIO_printf(bio_err," -nbio_test - more ssl protocol testing\n");
|
||||
BIO_printf(bio_err," -state - print the 'ssl' states\n");
|
||||
#ifdef FIONBIO
|
||||
@@ -155,6 +210,10 @@ static void sc_usage(void)
|
||||
BIO_printf(bio_err," -serverpref - Use server's cipher preferences (only SSLv2)\n");
|
||||
BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n");
|
||||
BIO_printf(bio_err," command to see what is available\n");
|
||||
BIO_printf(bio_err," -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," 'prot' defines which one to assume. Currently,\n");
|
||||
BIO_printf(bio_err," only \"smtp\" is supported.\n");
|
||||
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
|
||||
@@ -166,8 +225,9 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
int off=0;
|
||||
SSL *con=NULL,*con2=NULL;
|
||||
X509_STORE *store = NULL;
|
||||
int s,k,width,state=0;
|
||||
char *cbuf=NULL,*sbuf=NULL;
|
||||
char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL;
|
||||
int cbuf_len,cbuf_off;
|
||||
int sbuf_len,sbuf_off;
|
||||
fd_set readfds,writefds;
|
||||
@@ -181,7 +241,8 @@ int MAIN(int argc, char **argv)
|
||||
int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
|
||||
SSL_CTX *ctx=NULL;
|
||||
int ret=1,in_init=1,i,nbio_test=0;
|
||||
int prexit = 0;
|
||||
int smtp_starttls = 0;
|
||||
int prexit = 0, vflags = 0;
|
||||
SSL_METHOD *meth=NULL;
|
||||
BIO *sbio;
|
||||
char *inrand=NULL;
|
||||
@@ -204,13 +265,18 @@ int MAIN(int argc, char **argv)
|
||||
c_quiet=0;
|
||||
c_ign_eof=0;
|
||||
c_debug=0;
|
||||
c_msg=0;
|
||||
c_showcerts=0;
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
if ( ((cbuf=OPENSSL_malloc(BUFSIZZ)) == NULL) ||
|
||||
((sbuf=OPENSSL_malloc(BUFSIZZ)) == NULL))
|
||||
((sbuf=OPENSSL_malloc(BUFSIZZ)) == NULL) ||
|
||||
((mbuf=OPENSSL_malloc(BUFSIZZ)) == NULL))
|
||||
{
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
goto end;
|
||||
@@ -255,6 +321,10 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
cert_file= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-crl_check") == 0)
|
||||
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||
else if (strcmp(*argv,"-crl_check_all") == 0)
|
||||
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||
else if (strcmp(*argv,"-prexit") == 0)
|
||||
prexit=1;
|
||||
else if (strcmp(*argv,"-crlf") == 0)
|
||||
@@ -270,6 +340,8 @@ int MAIN(int argc, char **argv)
|
||||
c_Pause=1;
|
||||
else if (strcmp(*argv,"-debug") == 0)
|
||||
c_debug=1;
|
||||
else if (strcmp(*argv,"-msg") == 0)
|
||||
c_msg=1;
|
||||
else if (strcmp(*argv,"-showcerts") == 0)
|
||||
c_showcerts=1;
|
||||
else if (strcmp(*argv,"-nbio_test") == 0)
|
||||
@@ -326,6 +398,15 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-nbio") == 0)
|
||||
{ c_nbio=1; }
|
||||
#endif
|
||||
else if (strcmp(*argv,"-starttls") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
++argv;
|
||||
if (strcmp(*argv,"smtp") == 0)
|
||||
smtp_starttls = 1;
|
||||
else
|
||||
goto bad;
|
||||
}
|
||||
else if (strcmp(*argv,"-engine") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -363,7 +444,7 @@ bad:
|
||||
|
||||
if (bio_c_out == NULL)
|
||||
{
|
||||
if (c_quiet)
|
||||
if (c_quiet && !c_debug && !c_msg)
|
||||
{
|
||||
bio_c_out=BIO_new(BIO_s_null());
|
||||
}
|
||||
@@ -377,28 +458,7 @@ bad:
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
SSL_load_error_strings();
|
||||
|
||||
if (engine_id != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine_id)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (c_debug)
|
||||
{
|
||||
ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
|
||||
0, bio_err, 0);
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine_id);
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine_id, 1);
|
||||
|
||||
ctx=SSL_CTX_new(meth);
|
||||
if (ctx == NULL)
|
||||
@@ -436,6 +496,8 @@ bad:
|
||||
/* goto end; */
|
||||
}
|
||||
|
||||
store = SSL_CTX_get_cert_store(ctx);
|
||||
X509_STORE_set_flags(store, vflags);
|
||||
|
||||
con=SSL_new(ctx);
|
||||
#ifndef OPENSSL_NO_KRB5
|
||||
@@ -485,6 +547,11 @@ re_start:
|
||||
BIO_set_callback(sbio,bio_dump_cb);
|
||||
BIO_set_callback_arg(sbio,bio_c_out);
|
||||
}
|
||||
if (c_msg)
|
||||
{
|
||||
SSL_set_msg_callback(con, msg_cb);
|
||||
SSL_set_msg_callback_arg(con, bio_c_out);
|
||||
}
|
||||
|
||||
SSL_set_bio(con,sbio,sbio);
|
||||
SSL_set_connect_state(con);
|
||||
@@ -503,6 +570,14 @@ re_start:
|
||||
sbuf_len=0;
|
||||
sbuf_off=0;
|
||||
|
||||
/* This is an ugly hack that does a lot of assumptions */
|
||||
if (smtp_starttls)
|
||||
{
|
||||
BIO_read(sbio,mbuf,BUFSIZZ);
|
||||
BIO_printf(sbio,"STARTTLS\r\n");
|
||||
BIO_read(sbio,sbuf,BUFSIZZ);
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
FD_ZERO(&readfds);
|
||||
@@ -522,6 +597,13 @@ re_start:
|
||||
print_stuff(bio_c_out,con,full_log);
|
||||
if (full_log > 0) full_log--;
|
||||
|
||||
if (smtp_starttls)
|
||||
{
|
||||
BIO_printf(bio_err,"%s",mbuf);
|
||||
/* We don't need to know any more */
|
||||
smtp_starttls = 0;
|
||||
}
|
||||
|
||||
if (reconnect)
|
||||
{
|
||||
reconnect--;
|
||||
@@ -812,11 +894,13 @@ end:
|
||||
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||
if (cbuf != NULL) { memset(cbuf,0,BUFSIZZ); OPENSSL_free(cbuf); }
|
||||
if (sbuf != NULL) { memset(sbuf,0,BUFSIZZ); OPENSSL_free(sbuf); }
|
||||
if (mbuf != NULL) { memset(mbuf,0,BUFSIZZ); OPENSSL_free(mbuf); }
|
||||
if (bio_c_out != NULL)
|
||||
{
|
||||
BIO_free(bio_c_out);
|
||||
bio_c_out=NULL;
|
||||
}
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
@@ -938,5 +1022,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
||||
BIO_printf(bio,"---\n");
|
||||
if (peer != NULL)
|
||||
X509_free(peer);
|
||||
/* flush, or debugging output gets mixed with http response */
|
||||
BIO_flush(bio);
|
||||
}
|
||||
|
||||
|
||||
162
apps/s_server.c
162
apps/s_server.c
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
@@ -84,7 +137,7 @@ typedef unsigned int u_int;
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/engine.h>
|
||||
#include <openssl/rand.h>
|
||||
#include "s_apps.h"
|
||||
|
||||
#ifdef OPENSSL_SYS_WINDOWS
|
||||
@@ -177,6 +230,7 @@ static int www=0;
|
||||
|
||||
static BIO *bio_s_out=NULL;
|
||||
static int s_debug=0;
|
||||
static int s_msg=0;
|
||||
static int s_quiet=0;
|
||||
|
||||
static int hack=0;
|
||||
@@ -202,6 +256,7 @@ static void s_server_init(void)
|
||||
|
||||
bio_s_out=NULL;
|
||||
s_debug=0;
|
||||
s_msg=0;
|
||||
s_quiet=0;
|
||||
hack=0;
|
||||
engine_id=NULL;
|
||||
@@ -230,6 +285,7 @@ static void sv_usage(void)
|
||||
BIO_printf(bio_err," -nbio_test - test with the non-blocking test bio\n");
|
||||
BIO_printf(bio_err," -crlf - convert LF from terminal into CRLF\n");
|
||||
BIO_printf(bio_err," -debug - Print more output\n");
|
||||
BIO_printf(bio_err," -msg - Show protocol messages\n");
|
||||
BIO_printf(bio_err," -state - Print the SSL states\n");
|
||||
BIO_printf(bio_err," -CApath arg - PEM format directory of CA's\n");
|
||||
BIO_printf(bio_err," -CAfile arg - PEM format file of CA's\n");
|
||||
@@ -414,6 +470,8 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char *argv[])
|
||||
{
|
||||
X509_STORE *store = NULL;
|
||||
int vflags = 0;
|
||||
short port=PORT;
|
||||
char *CApath=NULL,*CAfile=NULL;
|
||||
char *context = NULL;
|
||||
@@ -446,6 +504,9 @@ int MAIN(int argc, char *argv[])
|
||||
if (bio_err == NULL)
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
verify_depth=0;
|
||||
#ifdef FIONBIO
|
||||
s_nbio=0;
|
||||
@@ -518,6 +579,14 @@ int MAIN(int argc, char *argv[])
|
||||
if (--argc < 1) goto bad;
|
||||
CApath= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-crl_check") == 0)
|
||||
{
|
||||
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||
}
|
||||
else if (strcmp(*argv,"-crl_check") == 0)
|
||||
{
|
||||
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||
}
|
||||
else if (strcmp(*argv,"-serverpref") == 0)
|
||||
{ off|=SSL_OP_CIPHER_SERVER_PREFERENCE; }
|
||||
else if (strcmp(*argv,"-cipher") == 0)
|
||||
@@ -543,6 +612,8 @@ int MAIN(int argc, char *argv[])
|
||||
}
|
||||
else if (strcmp(*argv,"-debug") == 0)
|
||||
{ s_debug=1; }
|
||||
else if (strcmp(*argv,"-msg") == 0)
|
||||
{ s_msg=1; }
|
||||
else if (strcmp(*argv,"-hack") == 0)
|
||||
{ hack=1; }
|
||||
else if (strcmp(*argv,"-state") == 0)
|
||||
@@ -623,7 +694,7 @@ bad:
|
||||
|
||||
if (bio_s_out == NULL)
|
||||
{
|
||||
if (s_quiet && !s_debug)
|
||||
if (s_quiet && !s_debug && !s_msg)
|
||||
{
|
||||
bio_s_out=BIO_new(BIO_s_null());
|
||||
}
|
||||
@@ -647,28 +718,7 @@ bad:
|
||||
SSL_load_error_strings();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
|
||||
if (engine_id != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine_id)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (s_debug)
|
||||
{
|
||||
ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM,
|
||||
0, bio_err, 0);
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine_id);
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine_id, 1);
|
||||
|
||||
ctx=SSL_CTX_new(meth);
|
||||
if (ctx == NULL)
|
||||
@@ -696,7 +746,6 @@ bad:
|
||||
if (bugs) SSL_CTX_set_options(ctx,SSL_OP_ALL);
|
||||
if (hack) SSL_CTX_set_options(ctx,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
|
||||
SSL_CTX_set_options(ctx,off);
|
||||
if (hack) SSL_CTX_set_options(ctx,SSL_OP_NON_EXPORT_FIRST);
|
||||
|
||||
if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
|
||||
|
||||
@@ -721,6 +770,8 @@ bad:
|
||||
ERR_print_errors(bio_err);
|
||||
/* goto end; */
|
||||
}
|
||||
store = SSL_CTX_get_cert_store(ctx);
|
||||
X509_STORE_set_flags(store, vflags);
|
||||
|
||||
#ifndef OPENSSL_NO_DH
|
||||
if (!no_dhe)
|
||||
@@ -808,6 +859,7 @@ end:
|
||||
BIO_free(bio_s_out);
|
||||
bio_s_out=NULL;
|
||||
}
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
@@ -871,8 +923,10 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
#ifndef OPENSSL_NO_KRB5
|
||||
if ((con->kssl_ctx = kssl_ctx_new()) != NULL)
|
||||
{
|
||||
kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVICE, KRB5SVC);
|
||||
kssl_ctx_setstring(con->kssl_ctx, KSSL_KEYTAB, KRB5KEYTAB);
|
||||
kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVICE,
|
||||
KRB5SVC);
|
||||
kssl_ctx_setstring(con->kssl_ctx, KSSL_KEYTAB,
|
||||
KRB5KEYTAB);
|
||||
}
|
||||
#endif /* OPENSSL_NO_KRB5 */
|
||||
if(context)
|
||||
@@ -899,6 +953,11 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
BIO_set_callback(SSL_get_rbio(con),bio_dump_cb);
|
||||
BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
|
||||
}
|
||||
if (s_msg)
|
||||
{
|
||||
SSL_set_msg_callback(con, msg_cb);
|
||||
SSL_set_msg_callback_arg(con, bio_s_out);
|
||||
}
|
||||
|
||||
width=s+1;
|
||||
for (;;)
|
||||
@@ -1257,6 +1316,13 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
if (!BIO_set_write_buffer_size(io,bufsize)) goto err;
|
||||
|
||||
if ((con=SSL_new(ctx)) == NULL) goto err;
|
||||
#ifndef OPENSSL_NO_KRB5
|
||||
if ((con->kssl_ctx = kssl_ctx_new()) != NULL)
|
||||
{
|
||||
kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVICE, KRB5SVC);
|
||||
kssl_ctx_setstring(con->kssl_ctx, KSSL_KEYTAB, KRB5KEYTAB);
|
||||
}
|
||||
#endif /* OPENSSL_NO_KRB5 */
|
||||
if(context) SSL_set_session_id_context(con, context,
|
||||
strlen((char *)context));
|
||||
|
||||
@@ -1284,6 +1350,11 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
BIO_set_callback(SSL_get_rbio(con),bio_dump_cb);
|
||||
BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
|
||||
}
|
||||
if (s_msg)
|
||||
{
|
||||
SSL_set_msg_callback(con, msg_cb);
|
||||
SSL_set_msg_callback_arg(con, bio_s_out);
|
||||
}
|
||||
|
||||
blank=0;
|
||||
for (;;)
|
||||
@@ -1423,20 +1494,33 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
{
|
||||
BIO *file;
|
||||
char *p,*e;
|
||||
static char *text="HTTP/1.0 200 ok\r\n"
|
||||
"Content-type: text/plain\r\n\r\n";
|
||||
static char *text="HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n";
|
||||
|
||||
/* skip the '/' */
|
||||
p= &(buf[5]);
|
||||
dot=0;
|
||||
|
||||
dot = 1;
|
||||
for (e=p; *e != '\0'; e++)
|
||||
{
|
||||
if (e[0] == ' ') break;
|
||||
if ( (e[0] == '.') &&
|
||||
(strncmp(&(e[-1]),"/../",4) == 0))
|
||||
dot=1;
|
||||
if (e[0] == ' ')
|
||||
break;
|
||||
|
||||
switch (dot)
|
||||
{
|
||||
case 1:
|
||||
dot = (e[0] == '.') ? 2 : 0;
|
||||
break;
|
||||
case 2:
|
||||
dot = (e[0] == '.') ? 3 : 0;
|
||||
break;
|
||||
case 3:
|
||||
dot = (e[0] == '/') ? -1 : 0;
|
||||
break;
|
||||
}
|
||||
if (dot == 0)
|
||||
dot = (e[0] == '/') ? 1 : 0;
|
||||
}
|
||||
|
||||
dot = (dot == 3) || (dot == -1); /* filename contains ".." component */
|
||||
|
||||
if (*e == '\0')
|
||||
{
|
||||
@@ -1460,9 +1544,11 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* append if a directory lookup */
|
||||
if (e[-1] == '/')
|
||||
strcat(p,"index.html");
|
||||
#endif
|
||||
|
||||
/* if a directory, do the index thang */
|
||||
if (stat(p,&st_buf) < 0)
|
||||
@@ -1474,7 +1560,13 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
}
|
||||
if (S_ISDIR(st_buf.st_mode))
|
||||
{
|
||||
#if 0 /* must check buffer size */
|
||||
strcat(p,"/index.html");
|
||||
#else
|
||||
BIO_puts(io,text);
|
||||
BIO_printf(io,"'%s' is a directory\r\n",p);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((file=BIO_new_file(p,"r")) == NULL)
|
||||
|
||||
@@ -67,22 +67,25 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define USE_SOCKETS
|
||||
#include "apps.h"
|
||||
#ifdef OPENSSL_NO_STDIO
|
||||
#define APPS_WIN16
|
||||
#endif
|
||||
#define USE_SOCKETS
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/pem.h>
|
||||
#include "apps.h"
|
||||
#include "s_apps.h"
|
||||
#include <openssl/err.h>
|
||||
#ifdef WIN32_STUFF
|
||||
#include "winmain.h"
|
||||
#include "wintext.h"
|
||||
#endif
|
||||
#if !defined(OPENSSL_SYS_MSDOS)
|
||||
#include OPENSSL_UNISTD
|
||||
#endif
|
||||
|
||||
#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX)
|
||||
#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX)
|
||||
#define TIMES
|
||||
#endif
|
||||
|
||||
@@ -102,7 +105,7 @@
|
||||
#undef TIMES
|
||||
#endif
|
||||
|
||||
#ifndef TIMES
|
||||
#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS)
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
@@ -119,11 +122,19 @@
|
||||
/* The following if from times(3) man page. It may need to be changed
|
||||
*/
|
||||
#ifndef HZ
|
||||
#ifndef CLK_TCK
|
||||
#define HZ 100.0
|
||||
#else /* CLK_TCK */
|
||||
#define HZ ((double)CLK_TCK)
|
||||
#endif
|
||||
# ifdef _SC_CLK_TCK
|
||||
# define HZ ((double)sysconf(_SC_CLK_TCK))
|
||||
# else
|
||||
# ifndef CLK_TCK
|
||||
# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
|
||||
# define HZ 100.0
|
||||
# else /* _BSD_CLK_TCK_ */
|
||||
# define HZ ((double)_BSD_CLK_TCK_)
|
||||
# endif
|
||||
# else /* CLK_TCK */
|
||||
# define HZ ((double)CLK_TCK)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef PROG
|
||||
@@ -139,6 +150,8 @@
|
||||
#undef BUFSIZZ
|
||||
#define BUFSIZZ 1024*10
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
@@ -368,6 +381,22 @@ static double tm_Time_F(int s)
|
||||
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
||||
return((ret == 0.0)?1e-6:ret);
|
||||
}
|
||||
#elif defined(OPENSSL_SYS_VXWORKS)
|
||||
{
|
||||
static unsigned long tick_start, tick_end;
|
||||
|
||||
if( s == START )
|
||||
{
|
||||
tick_start = tickGet();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tick_end = tickGet();
|
||||
ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
|
||||
return((ret == 0.0)?1e-6:ret);
|
||||
}
|
||||
}
|
||||
#else /* !times() */
|
||||
static struct timeb tstart,tend;
|
||||
long i;
|
||||
@@ -443,7 +472,6 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (tm_cipher == NULL ) {
|
||||
fprintf( stderr, "No CIPHER specified\n" );
|
||||
/* EXIT(1); */
|
||||
}
|
||||
|
||||
if (!(perform & 1)) goto next;
|
||||
@@ -610,6 +638,7 @@ end:
|
||||
SSL_CTX_free(tm_ctx);
|
||||
tm_ctx=NULL;
|
||||
}
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -272,6 +272,7 @@ bad:
|
||||
end:
|
||||
if (out != NULL) BIO_free_all(out);
|
||||
if (x != NULL) SSL_SESSION_free(x);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
95
apps/smime.c
95
apps/smime.c
@@ -64,7 +64,6 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG smime_main
|
||||
@@ -97,18 +96,28 @@ int MAIN(int argc, char **argv)
|
||||
STACK_OF(X509) *encerts = NULL, *other = NULL;
|
||||
BIO *in = NULL, *out = NULL, *indata = NULL;
|
||||
int badarg = 0;
|
||||
int flags = PKCS7_DETACHED;
|
||||
int flags = PKCS7_DETACHED, store_flags = 0;
|
||||
char *to = NULL, *from = NULL, *subject = NULL;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
char *passargin = NULL, *passin = NULL;
|
||||
char *inrand = NULL;
|
||||
int need_rand = 0;
|
||||
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
|
||||
int keyform = FORMAT_PEM;
|
||||
char *engine=NULL;
|
||||
|
||||
args = argv + 1;
|
||||
ret = 1;
|
||||
|
||||
apps_startup();
|
||||
|
||||
if (bio_err == NULL)
|
||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
while (!badarg && *args && *args[0] == '-') {
|
||||
if (!strcmp (*args, "-encrypt")) operation = SMIME_ENCRYPT;
|
||||
else if (!strcmp (*args, "-decrypt")) operation = SMIME_DECRYPT;
|
||||
@@ -128,6 +137,14 @@ int MAIN(int argc, char **argv)
|
||||
cipher = EVP_rc2_cbc();
|
||||
else if (!strcmp (*args, "-rc2-64"))
|
||||
cipher = EVP_rc2_64_cbc();
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
else if (!strcmp(*args,"-aes128"))
|
||||
cipher = EVP_aes_128_cbc();
|
||||
else if (!strcmp(*args,"-aes192"))
|
||||
cipher = EVP_aes_192_cbc();
|
||||
else if (!strcmp(*args,"-aes256"))
|
||||
cipher = EVP_aes_256_cbc();
|
||||
#endif
|
||||
else if (!strcmp (*args, "-text"))
|
||||
flags |= PKCS7_TEXT;
|
||||
@@ -149,6 +166,10 @@ int MAIN(int argc, char **argv)
|
||||
flags |= PKCS7_BINARY;
|
||||
else if (!strcmp (*args, "-nosigs"))
|
||||
flags |= PKCS7_NOSIGS;
|
||||
else if (!strcmp (*args, "-crl_check"))
|
||||
store_flags |= X509_V_FLAG_CRL_CHECK;
|
||||
else if (!strcmp (*args, "-crl_check_all"))
|
||||
store_flags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||
else if (!strcmp(*args,"-rand")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -195,6 +216,11 @@ int MAIN(int argc, char **argv)
|
||||
args++;
|
||||
keyfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-keyform")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
keyform = str2fmt(*args);
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-certfile")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -274,6 +300,10 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "-rc2-40 encrypt with RC2-40 (default)\n");
|
||||
BIO_printf (bio_err, "-rc2-64 encrypt with RC2-64\n");
|
||||
BIO_printf (bio_err, "-rc2-128 encrypt with RC2-128\n");
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_AES
|
||||
BIO_printf (bio_err, "-aes128, -aes192, -aes256\n");
|
||||
BIO_printf (bio_err, " encrypt PEM output with cbc aes\n");
|
||||
#endif
|
||||
BIO_printf (bio_err, "-nointern don't search certificates in message for signer\n");
|
||||
BIO_printf (bio_err, "-nosigs don't verify message signature\n");
|
||||
@@ -288,6 +318,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "-in file input file\n");
|
||||
BIO_printf (bio_err, "-inform arg input format SMIME (default), PEM or DER\n");
|
||||
BIO_printf (bio_err, "-inkey file input private key (if not signer or recipient)\n");
|
||||
BIO_printf (bio_err, "-keyform arg input private key format (PEM or ENGINE)\n");
|
||||
BIO_printf (bio_err, "-out file output file\n");
|
||||
BIO_printf (bio_err, "-outform arg output format SMIME (default), PEM or DER\n");
|
||||
BIO_printf (bio_err, "-content file supply or override content for detached signature\n");
|
||||
@@ -297,7 +328,10 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "-text include or delete text MIME headers\n");
|
||||
BIO_printf (bio_err, "-CApath dir trusted certificates directory\n");
|
||||
BIO_printf (bio_err, "-CAfile file trusted certificates file\n");
|
||||
BIO_printf (bio_err, "-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, "-engine e use engine e, possibly a hardware device.\n");
|
||||
BIO_printf (bio_err, "-passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err, " the random number generator\n");
|
||||
@@ -305,23 +339,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
@@ -358,8 +376,11 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
encerts = sk_X509_new_null();
|
||||
while (*args) {
|
||||
if(!(cert = load_cert(bio_err,*args,FORMAT_PEM))) {
|
||||
if(!(cert = load_cert(bio_err,*args,FORMAT_PEM,
|
||||
NULL, e, "recipient certificate file"))) {
|
||||
#if 0 /* An appropriate message is already printed */
|
||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", *args);
|
||||
#endif
|
||||
goto end;
|
||||
}
|
||||
sk_X509_push(encerts, cert);
|
||||
@@ -369,23 +390,32 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
if(signerfile && (operation == SMIME_SIGN)) {
|
||||
if(!(signer = load_cert(bio_err,signerfile,FORMAT_PEM))) {
|
||||
if(!(signer = load_cert(bio_err,signerfile,FORMAT_PEM, NULL,
|
||||
e, "signer certificate"))) {
|
||||
#if 0 /* An appropri message has already been printed */
|
||||
BIO_printf(bio_err, "Can't read signer certificate file %s\n", signerfile);
|
||||
#endif
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if(certfile) {
|
||||
if(!(other = load_certs(bio_err,certfile,FORMAT_PEM))) {
|
||||
if(!(other = load_certs(bio_err,certfile,FORMAT_PEM, NULL,
|
||||
e, "certificate file"))) {
|
||||
#if 0 /* An appropriate message has already been printed */
|
||||
BIO_printf(bio_err, "Can't read certificate file %s\n", certfile);
|
||||
#endif
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if(recipfile && (operation == SMIME_DECRYPT)) {
|
||||
if(!(recip = load_cert(bio_err,recipfile,FORMAT_PEM))) {
|
||||
if(!(recip = load_cert(bio_err,recipfile,FORMAT_PEM,NULL,
|
||||
e, "recipient certificate file"))) {
|
||||
#if 0 /* An appropriate message has alrady been printed */
|
||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", recipfile);
|
||||
#endif
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -398,11 +428,11 @@ int MAIN(int argc, char **argv)
|
||||
} else keyfile = NULL;
|
||||
|
||||
if(keyfile) {
|
||||
if(!(key = load_key(bio_err,keyfile, FORMAT_PEM, passin, NULL))) {
|
||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", keyfile);
|
||||
ERR_print_errors(bio_err);
|
||||
key = load_key(bio_err, keyfile, keyform, passin, e,
|
||||
"signing key file");
|
||||
if (!key) {
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (infile) {
|
||||
@@ -431,15 +461,20 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if(operation == SMIME_VERIFY) {
|
||||
if(!(store = setup_verify(bio_err, CAfile, CApath))) goto end;
|
||||
X509_STORE_set_flags(store, store_flags);
|
||||
}
|
||||
|
||||
|
||||
ret = 3;
|
||||
|
||||
if(operation == SMIME_ENCRYPT) {
|
||||
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
||||
} else if(operation == SMIME_SIGN) {
|
||||
p7 = PKCS7_sign(signer, key, other, in, flags);
|
||||
BIO_reset(in);
|
||||
if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) {
|
||||
BIO_printf(bio_err, "Can't rewind input file\n");
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
if(informat == FORMAT_SMIME)
|
||||
p7 = SMIME_read_PKCS7(in, &indata);
|
||||
@@ -479,9 +514,9 @@ int MAIN(int argc, char **argv)
|
||||
} else if(operation == SMIME_VERIFY) {
|
||||
STACK_OF(X509) *signers;
|
||||
if(PKCS7_verify(p7, other, store, indata, out, flags)) {
|
||||
BIO_printf(bio_err, "Verification Successful\n");
|
||||
BIO_printf(bio_err, "Verification successful\n");
|
||||
} else {
|
||||
BIO_printf(bio_err, "Verification Failure\n");
|
||||
BIO_printf(bio_err, "Verification failure\n");
|
||||
goto end;
|
||||
}
|
||||
signers = PKCS7_get0_signers(p7, other, flags);
|
||||
|
||||
882
apps/speed.c
882
apps/speed.c
File diff suppressed because it is too large
Load Diff
50
apps/spkac.c
50
apps/spkac.c
@@ -69,7 +69,6 @@
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG spkac_main
|
||||
@@ -84,13 +83,13 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL;
|
||||
int i,badops=0, ret = 1;
|
||||
BIO *in = NULL,*out = NULL, *key = NULL;
|
||||
BIO *in = NULL,*out = NULL;
|
||||
int verify=0,noout=0,pubkey=0;
|
||||
char *infile = NULL,*outfile = NULL,*prog;
|
||||
char *passargin = NULL, *passin = NULL;
|
||||
char *spkac = "SPKAC", *spksect = "default", *spkstr = NULL;
|
||||
char *challenge = NULL, *keyfile = NULL;
|
||||
LHASH *conf = NULL;
|
||||
CONF *conf = NULL;
|
||||
NETSCAPE_SPKI *spki = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
char *engine=NULL;
|
||||
@@ -99,6 +98,9 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
prog=argv[0];
|
||||
argc--;
|
||||
argv++;
|
||||
@@ -179,36 +181,13 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if(keyfile) {
|
||||
if(strcmp(keyfile, "-")) key = BIO_new_file(keyfile, "r");
|
||||
else key = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
if(!key) {
|
||||
BIO_printf(bio_err, "Error opening key file\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
pkey = PEM_read_bio_PrivateKey(key, NULL, NULL, passin);
|
||||
pkey = load_key(bio_err,
|
||||
strcmp(keyfile, "-") ? keyfile : NULL,
|
||||
FORMAT_PEM, passin, e, "private key");
|
||||
if(!pkey) {
|
||||
BIO_printf(bio_err, "Error reading private key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
spki = NETSCAPE_SPKI_new();
|
||||
@@ -251,15 +230,16 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
conf = CONF_load_bio(NULL, in, NULL);
|
||||
conf = NCONF_new(NULL);
|
||||
i = NCONF_load_bio(conf, in, NULL);
|
||||
|
||||
if(!conf) {
|
||||
if(!i) {
|
||||
BIO_printf(bio_err, "Error parsing config file\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
spkstr = CONF_get_string(conf, spksect, spkac);
|
||||
spkstr = NCONF_get_string(conf, spksect, spkac);
|
||||
|
||||
if(!spkstr) {
|
||||
BIO_printf(bio_err, "Can't find SPKAC called \"%s\"\n", spkac);
|
||||
@@ -308,12 +288,12 @@ bad:
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
CONF_free(conf);
|
||||
NCONF_free(conf);
|
||||
NETSCAPE_SPKI_free(spki);
|
||||
BIO_free(in);
|
||||
BIO_free_all(out);
|
||||
BIO_free(key);
|
||||
EVP_PKEY_free(pkey);
|
||||
if(passin) OPENSSL_free(passin);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
DSA *get_dsa512(void );
|
||||
DSA *get_dsa1024(void );
|
||||
DSA *get_dsa2048(void );
|
||||
static unsigned char dsa512_priv[] = {
|
||||
0x65,0xe5,0xc7,0x38,0x60,0x24,0xb5,0x89,0xd4,0x9c,0xeb,0x4c,
|
||||
0x9c,0x1d,0x7a,0x22,0xbd,0xd1,0xc2,0xd2,
|
||||
};
|
||||
static unsigned char dsa512_pub[] = {
|
||||
0x00,0x95,0xa7,0x0d,0xec,0x93,0x68,0xba,0x5f,0xf7,0x5f,0x07,
|
||||
0xf2,0x3b,0xad,0x6b,0x01,0xdc,0xbe,0xec,0xde,0x04,0x7a,0x3a,
|
||||
0x27,0xb3,0xec,0x49,0xfd,0x08,0x43,0x3d,0x7e,0xa8,0x2c,0x5e,
|
||||
0x7b,0xbb,0xfc,0xf4,0x6e,0xeb,0x6c,0xb0,0x6e,0xf8,0x02,0x12,
|
||||
0x8c,0x38,0x5d,0x83,0x56,0x7d,0xee,0x53,0x05,0x3e,0x24,0x84,
|
||||
0xbe,0xba,0x0a,0x6b,0xc8,
|
||||
};
|
||||
static unsigned char dsa512_p[]={
|
||||
0x9D,0x1B,0x69,0x8E,0x26,0xDB,0xF2,0x2B,0x11,0x70,0x19,0x86,
|
||||
0xF6,0x19,0xC8,0xF8,0x19,0xF2,0x18,0x53,0x94,0x46,0x06,0xD0,
|
||||
@@ -29,14 +41,34 @@ DSA *get_dsa512()
|
||||
DSA *dsa;
|
||||
|
||||
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||
dsa->priv_key=BN_bin2bn(dsa512_priv,sizeof(dsa512_priv),NULL);
|
||||
dsa->pub_key=BN_bin2bn(dsa512_pub,sizeof(dsa512_pub),NULL);
|
||||
dsa->p=BN_bin2bn(dsa512_p,sizeof(dsa512_p),NULL);
|
||||
dsa->q=BN_bin2bn(dsa512_q,sizeof(dsa512_q),NULL);
|
||||
dsa->g=BN_bin2bn(dsa512_g,sizeof(dsa512_g),NULL);
|
||||
if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
|
||||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||
(dsa->q == NULL) || (dsa->g == NULL))
|
||||
return(NULL);
|
||||
return(dsa);
|
||||
}
|
||||
|
||||
static unsigned char dsa1024_priv[]={
|
||||
0x7d,0x21,0xda,0xbb,0x62,0x15,0x47,0x36,0x07,0x67,0x12,0xe8,
|
||||
0x8c,0xaa,0x1c,0xcd,0x38,0x12,0x61,0x18,
|
||||
};
|
||||
static unsigned char dsa1024_pub[]={
|
||||
0x3c,0x4e,0x9c,0x2a,0x7f,0x16,0xc1,0x25,0xeb,0xac,0x78,0x63,
|
||||
0x90,0x14,0x8c,0x8b,0xf4,0x68,0x43,0x3c,0x2d,0xee,0x65,0x50,
|
||||
0x7d,0x9c,0x8f,0x8c,0x8a,0x51,0xd6,0x11,0x2b,0x99,0xaf,0x1e,
|
||||
0x90,0x97,0xb5,0xd3,0xa6,0x20,0x25,0xd6,0xfe,0x43,0x02,0xd5,
|
||||
0x91,0x7d,0xa7,0x8c,0xdb,0xc9,0x85,0xa3,0x36,0x48,0xf7,0x68,
|
||||
0xaa,0x60,0xb1,0xf7,0x05,0x68,0x3a,0xa3,0x3f,0xd3,0x19,0x82,
|
||||
0xd8,0x82,0x7a,0x77,0xfb,0xef,0xf4,0x15,0x0a,0xeb,0x06,0x04,
|
||||
0x7f,0x53,0x07,0x0c,0xbc,0xcb,0x2d,0x83,0xdb,0x3e,0xd1,0x28,
|
||||
0xa5,0xa1,0x31,0xe0,0x67,0xfa,0x50,0xde,0x9b,0x07,0x83,0x7e,
|
||||
0x2c,0x0b,0xc3,0x13,0x50,0x61,0xe5,0xad,0xbd,0x36,0xb8,0x97,
|
||||
0x4e,0x40,0x7d,0xe8,0x83,0x0d,0xbc,0x4b
|
||||
};
|
||||
static unsigned char dsa1024_p[]={
|
||||
0xA7,0x3F,0x6E,0x85,0xBF,0x41,0x6A,0x29,0x7D,0xF0,0x9F,0x47,
|
||||
0x19,0x30,0x90,0x9A,0x09,0x1D,0xDA,0x6A,0x33,0x1E,0xC5,0x3D,
|
||||
@@ -73,14 +105,45 @@ DSA *get_dsa1024()
|
||||
DSA *dsa;
|
||||
|
||||
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||
dsa->priv_key=BN_bin2bn(dsa1024_priv,sizeof(dsa1024_priv),NULL);
|
||||
dsa->pub_key=BN_bin2bn(dsa1024_pub,sizeof(dsa1024_pub),NULL);
|
||||
dsa->p=BN_bin2bn(dsa1024_p,sizeof(dsa1024_p),NULL);
|
||||
dsa->q=BN_bin2bn(dsa1024_q,sizeof(dsa1024_q),NULL);
|
||||
dsa->g=BN_bin2bn(dsa1024_g,sizeof(dsa1024_g),NULL);
|
||||
if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
|
||||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||
(dsa->q == NULL) || (dsa->g == NULL))
|
||||
return(NULL);
|
||||
return(dsa);
|
||||
}
|
||||
|
||||
static unsigned char dsa2048_priv[]={
|
||||
0x32,0x67,0x92,0xf6,0xc4,0xe2,0xe2,0xe8,0xa0,0x8b,0x6b,0x45,
|
||||
0x0c,0x8a,0x76,0xb0,0xee,0xcf,0x91,0xa7,
|
||||
};
|
||||
static unsigned char dsa2048_pub[]={
|
||||
0x17,0x8f,0xa8,0x11,0x84,0x92,0xec,0x83,0x47,0xc7,0x6a,0xb0,
|
||||
0x92,0xaf,0x5a,0x20,0x37,0xa3,0x64,0x79,0xd2,0xd0,0x3d,0xcd,
|
||||
0xe0,0x61,0x88,0x88,0x21,0xcc,0x74,0x5d,0xce,0x4c,0x51,0x47,
|
||||
0xf0,0xc5,0x5c,0x4c,0x82,0x7a,0xaf,0x72,0xad,0xb9,0xe0,0x53,
|
||||
0xf2,0x78,0xb7,0xf0,0xb5,0x48,0x7f,0x8a,0x3a,0x18,0xd1,0x9f,
|
||||
0x8b,0x7d,0xa5,0x47,0xb7,0x95,0xab,0x98,0xf8,0x7b,0x74,0x50,
|
||||
0x56,0x8e,0x57,0xf0,0xee,0xf5,0xb7,0xba,0xab,0x85,0x86,0xf9,
|
||||
0x2b,0xef,0x41,0x56,0xa0,0xa4,0x9f,0xb7,0x38,0x00,0x46,0x0a,
|
||||
0xa6,0xf1,0xfc,0x1f,0xd8,0x4e,0x85,0x44,0x92,0x43,0x21,0x5d,
|
||||
0x6e,0xcc,0xc2,0xcb,0x26,0x31,0x0d,0x21,0xc4,0xbd,0x8d,0x24,
|
||||
0xbc,0xd9,0x18,0x19,0xd7,0xdc,0xf1,0xe7,0x93,0x50,0x48,0x03,
|
||||
0x2c,0xae,0x2e,0xe7,0x49,0x88,0x5f,0x93,0x57,0x27,0x99,0x36,
|
||||
0xb4,0x20,0xab,0xfc,0xa7,0x2b,0xf2,0xd9,0x98,0xd7,0xd4,0x34,
|
||||
0x9d,0x96,0x50,0x58,0x9a,0xea,0x54,0xf3,0xee,0xf5,0x63,0x14,
|
||||
0xee,0x85,0x83,0x74,0x76,0xe1,0x52,0x95,0xc3,0xf7,0xeb,0x04,
|
||||
0x04,0x7b,0xa7,0x28,0x1b,0xcc,0xea,0x4a,0x4e,0x84,0xda,0xd8,
|
||||
0x9c,0x79,0xd8,0x9b,0x66,0x89,0x2f,0xcf,0xac,0xd7,0x79,0xf9,
|
||||
0xa9,0xd8,0x45,0x13,0x78,0xb9,0x00,0x14,0xc9,0x7e,0x22,0x51,
|
||||
0x86,0x67,0xb0,0x9f,0x26,0x11,0x23,0xc8,0x38,0xd7,0x70,0x1d,
|
||||
0x15,0x8e,0x4d,0x4f,0x95,0x97,0x40,0xa1,0xc2,0x7e,0x01,0x18,
|
||||
0x72,0xf4,0x10,0xe6,0x8d,0x52,0x16,0x7f,0xf2,0xc9,0xf8,0x33,
|
||||
0x8b,0x33,0xb7,0xce,
|
||||
};
|
||||
static unsigned char dsa2048_p[]={
|
||||
0xA0,0x25,0xFA,0xAD,0xF4,0x8E,0xB9,0xE5,0x99,0xF3,0x5D,0x6F,
|
||||
0x4F,0x83,0x34,0xE2,0x7E,0xCF,0x6F,0xBF,0x30,0xAF,0x6F,0x81,
|
||||
@@ -139,10 +202,13 @@ DSA *get_dsa2048()
|
||||
DSA *dsa;
|
||||
|
||||
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||
dsa->priv_key=BN_bin2bn(dsa2048_priv,sizeof(dsa2048_priv),NULL);
|
||||
dsa->pub_key=BN_bin2bn(dsa2048_pub,sizeof(dsa2048_pub),NULL);
|
||||
dsa->p=BN_bin2bn(dsa2048_p,sizeof(dsa2048_p),NULL);
|
||||
dsa->q=BN_bin2bn(dsa2048_q,sizeof(dsa2048_q),NULL);
|
||||
dsa->g=BN_bin2bn(dsa2048_g,sizeof(dsa2048_g),NULL);
|
||||
if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
|
||||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||
(dsa->q == NULL) || (dsa->g == NULL))
|
||||
return(NULL);
|
||||
return(dsa);
|
||||
}
|
||||
|
||||
@@ -65,15 +65,14 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG verify_main
|
||||
|
||||
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx);
|
||||
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose);
|
||||
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e);
|
||||
static STACK_OF(X509) *load_untrusted(char *file);
|
||||
static int v_verbose=0, issuer_checks = 0;
|
||||
static int v_verbose=0, vflags = 0;
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -101,6 +100,9 @@ int MAIN(int argc, char **argv)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
for (;;)
|
||||
@@ -147,8 +149,14 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else if (strcmp(*argv,"-help") == 0)
|
||||
goto end;
|
||||
else if (strcmp(*argv,"-ignore_critical") == 0)
|
||||
vflags |= X509_V_FLAG_IGNORE_CRITICAL;
|
||||
else if (strcmp(*argv,"-issuer_checks") == 0)
|
||||
issuer_checks=1;
|
||||
vflags |= X509_V_FLAG_CB_ISSUER_CHECK;
|
||||
else if (strcmp(*argv,"-crl_check") == 0)
|
||||
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||
else if (strcmp(*argv,"-crl_check_all") == 0)
|
||||
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||
else if (strcmp(*argv,"-verbose") == 0)
|
||||
v_verbose=1;
|
||||
else if (argv[0][0] == '-')
|
||||
@@ -162,23 +170,7 @@ int MAIN(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
||||
if (lookup == NULL) abort();
|
||||
@@ -220,14 +212,14 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, purpose);
|
||||
if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, purpose, e);
|
||||
else
|
||||
for (i=0; i<argc; i++)
|
||||
check(cert_ctx,argv[i], untrusted, trusted, purpose);
|
||||
check(cert_ctx,argv[i], untrusted, trusted, purpose, e);
|
||||
ret=0;
|
||||
end:
|
||||
if (ret == 1) {
|
||||
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-engine e] cert1 cert2 ...\n");
|
||||
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check] [-engine e] cert1 cert2 ...\n");
|
||||
BIO_printf(bio_err,"recognized usages:\n");
|
||||
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
||||
X509_PURPOSE *ptmp;
|
||||
@@ -239,42 +231,19 @@ end:
|
||||
if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
|
||||
sk_X509_pop_free(untrusted, X509_free);
|
||||
sk_X509_pop_free(trusted, X509_free);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose)
|
||||
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e)
|
||||
{
|
||||
X509 *x=NULL;
|
||||
BIO *in=NULL;
|
||||
int i=0,ret=0;
|
||||
X509_STORE_CTX *csc;
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
if (in == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (file == NULL)
|
||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||
else
|
||||
{
|
||||
if (BIO_read_filename(in,file) <= 0)
|
||||
{
|
||||
perror(file);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
x=PEM_read_bio_X509(in,NULL,NULL,NULL);
|
||||
x = load_cert(bio_err, file, FORMAT_PEM, NULL, e, "certificate file");
|
||||
if (x == NULL)
|
||||
{
|
||||
fprintf(stdout,"%s: unable to load certificate file\n",
|
||||
(file == NULL)?"stdin":file);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
fprintf(stdout,"%s: ",(file == NULL)?"stdin":file);
|
||||
|
||||
csc = X509_STORE_CTX_new();
|
||||
@@ -283,11 +252,14 @@ static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
X509_STORE_CTX_init(csc,ctx,x,uchain);
|
||||
X509_STORE_set_flags(ctx, vflags);
|
||||
if(!X509_STORE_CTX_init(csc,ctx,x,uchain))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if(tchain) X509_STORE_CTX_trusted_stack(csc, tchain);
|
||||
if(purpose >= 0) X509_STORE_CTX_set_purpose(csc, purpose);
|
||||
if(issuer_checks)
|
||||
X509_STORE_CTX_set_flags(csc, X509_V_FLAG_CB_ISSUER_CHECK);
|
||||
i=X509_verify_cert(csc);
|
||||
X509_STORE_CTX_free(csc);
|
||||
|
||||
@@ -301,7 +273,6 @@ end:
|
||||
else
|
||||
ERR_print_errors(bio_err);
|
||||
if (x != NULL) X509_free(x);
|
||||
if (in != NULL) BIO_free(in);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
@@ -375,6 +346,9 @@ static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
|
||||
if (ctx->error == X509_V_ERR_PATH_LENGTH_EXCEEDED) ok=1;
|
||||
if (ctx->error == X509_V_ERR_INVALID_PURPOSE) ok=1;
|
||||
if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
|
||||
if (ctx->error == X509_V_ERR_CRL_HAS_EXPIRED) ok=1;
|
||||
if (ctx->error == X509_V_ERR_CRL_NOT_YET_VALID) ok=1;
|
||||
if (ctx->error == X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION) ok=1;
|
||||
}
|
||||
if (!v_verbose)
|
||||
ERR_clear_error();
|
||||
|
||||
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -62,6 +115,21 @@
|
||||
#include "apps.h"
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/crypto.h>
|
||||
#ifndef OPENSSL_NO_MD2
|
||||
# include <openssl/md2.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_RC4
|
||||
# include <openssl/rc4.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DES
|
||||
# include <openssl/des.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
# include <openssl/idea.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_BF
|
||||
# include <openssl/blowfish.h>
|
||||
#endif
|
||||
|
||||
#undef PROG
|
||||
#define PROG version_main
|
||||
@@ -118,7 +186,7 @@ int MAIN(int argc, char **argv)
|
||||
printf("%s ",RC4_options());
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DES
|
||||
printf("%s ",des_options());
|
||||
printf("%s ",DES_options());
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
printf("%s ",idea_options());
|
||||
@@ -131,5 +199,6 @@ int MAIN(int argc, char **argv)
|
||||
if (cflags) printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
|
||||
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
|
||||
end:
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
72
apps/x509.c
72
apps/x509.c
@@ -73,7 +73,6 @@
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG x509_main
|
||||
@@ -139,10 +138,10 @@ NULL
|
||||
|
||||
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
|
||||
static int sign (X509 *x, EVP_PKEY *pkey,int days,int clrext, const EVP_MD *digest,
|
||||
LHASH *conf, char *section);
|
||||
CONF *conf, char *section);
|
||||
static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest,
|
||||
X509 *x,X509 *xca,EVP_PKEY *pkey,char *serial,
|
||||
int create,int days, int clrext, LHASH *conf, char *section,
|
||||
int create,int days, int clrext, CONF *conf, char *section,
|
||||
ASN1_INTEGER *sno);
|
||||
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt);
|
||||
static int reqfile=0;
|
||||
@@ -179,7 +178,7 @@ int MAIN(int argc, char **argv)
|
||||
int fingerprint=0;
|
||||
char buf[256];
|
||||
const EVP_MD *md_alg,*digest=EVP_md5();
|
||||
LHASH *extconf = NULL;
|
||||
CONF *extconf = NULL;
|
||||
char *extsect = NULL, *extfile = NULL, *passin = NULL, *passargin = NULL;
|
||||
int need_rand = 0;
|
||||
int checkend=0,checkoffset=0;
|
||||
@@ -192,6 +191,9 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
|
||||
if (!load_config(bio_err, NULL))
|
||||
goto end;
|
||||
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
{
|
||||
@@ -243,7 +245,7 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-CAkeyform") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
CAformat=str2fmt(*(++argv));
|
||||
CAkeyformat=str2fmt(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-days") == 0)
|
||||
{
|
||||
@@ -448,23 +450,7 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (engine != NULL)
|
||||
{
|
||||
if((e = ENGINE_by_id(engine)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"invalid engine \"%s\"\n",
|
||||
engine);
|
||||
goto end;
|
||||
}
|
||||
if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
|
||||
{
|
||||
BIO_printf(bio_err,"can't use that engine\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"engine \"%s\" set.\n", engine);
|
||||
/* Free our "structural" reference. */
|
||||
ENGINE_free(e);
|
||||
}
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
|
||||
if (need_rand)
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
@@ -495,7 +481,8 @@ bad:
|
||||
{
|
||||
long errorline;
|
||||
X509V3_CTX ctx2;
|
||||
if (!(extconf=CONF_load(NULL,extfile,&errorline)))
|
||||
extconf = NCONF_new(NULL);
|
||||
if (!NCONF_load(extconf, extfile,&errorline))
|
||||
{
|
||||
if (errorline <= 0)
|
||||
BIO_printf(bio_err,
|
||||
@@ -509,7 +496,7 @@ bad:
|
||||
}
|
||||
if (!extsect)
|
||||
{
|
||||
extsect = CONF_get_string(extconf, "default", "extensions");
|
||||
extsect = NCONF_get_string(extconf, "default", "extensions");
|
||||
if (!extsect)
|
||||
{
|
||||
ERR_clear_error();
|
||||
@@ -517,8 +504,8 @@ bad:
|
||||
}
|
||||
}
|
||||
X509V3_set_ctx_test(&ctx2);
|
||||
X509V3_set_conf_lhash(&ctx2, extconf);
|
||||
if (!X509V3_EXT_add_conf(extconf, &ctx2, extsect, NULL))
|
||||
X509V3_set_nconf(&ctx2, extconf);
|
||||
if (!X509V3_EXT_add_nconf(extconf, &ctx2, extsect, NULL))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Error Loading extension section %s\n",
|
||||
@@ -619,12 +606,12 @@ bad:
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
else
|
||||
x=load_cert(bio_err,infile,informat);
|
||||
x=load_cert(bio_err,infile,informat,NULL,e,"Certificate");
|
||||
|
||||
if (x == NULL) goto end;
|
||||
if (CA_flag)
|
||||
{
|
||||
xca=load_cert(bio_err,CAfile,CAformat);
|
||||
xca=load_cert(bio_err,CAfile,CAformat,NULL,e,"CA Certificate");
|
||||
if (xca == NULL) goto end;
|
||||
}
|
||||
|
||||
@@ -874,7 +861,8 @@ bad:
|
||||
if (Upkey == NULL)
|
||||
{
|
||||
Upkey=load_key(bio_err,
|
||||
keyfile,keyformat, passin, e);
|
||||
keyfile,keyformat, passin, e,
|
||||
"Private key");
|
||||
if (Upkey == NULL) goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
@@ -893,7 +881,7 @@ bad:
|
||||
{
|
||||
CApkey=load_key(bio_err,
|
||||
CAkeyfile,CAkeyformat, passin,
|
||||
e);
|
||||
e, "CA Private Key");
|
||||
if (CApkey == NULL) goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
@@ -920,7 +908,8 @@ bad:
|
||||
else
|
||||
{
|
||||
pk=load_key(bio_err,
|
||||
keyfile,FORMAT_PEM, passin, e);
|
||||
keyfile,FORMAT_PEM, passin, e,
|
||||
"request key");
|
||||
if (pk == NULL) goto end;
|
||||
}
|
||||
|
||||
@@ -1009,7 +998,7 @@ end:
|
||||
if (need_rand)
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
OBJ_cleanup();
|
||||
CONF_free(extconf);
|
||||
NCONF_free(extconf);
|
||||
BIO_free_all(out);
|
||||
BIO_free_all(STDout);
|
||||
X509_STORE_free(ctx);
|
||||
@@ -1023,6 +1012,7 @@ end:
|
||||
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
|
||||
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
|
||||
if (passin) OPENSSL_free(passin);
|
||||
apps_shutdown();
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
@@ -1129,7 +1119,7 @@ static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create)
|
||||
|
||||
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
|
||||
int days, int clrext, LHASH *conf, char *section, ASN1_INTEGER *sno)
|
||||
int days, int clrext, CONF *conf, char *section, ASN1_INTEGER *sno)
|
||||
{
|
||||
int ret=0;
|
||||
ASN1_INTEGER *bs=NULL;
|
||||
@@ -1140,7 +1130,11 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
EVP_PKEY_copy_parameters(upkey,pkey);
|
||||
EVP_PKEY_free(upkey);
|
||||
|
||||
X509_STORE_CTX_init(&xsc,ctx,x,NULL);
|
||||
if(!X509_STORE_CTX_init(&xsc,ctx,x,NULL))
|
||||
{
|
||||
BIO_printf(bio_err,"Error initialising X509 store\n");
|
||||
goto end;
|
||||
}
|
||||
if (sno) bs = sno;
|
||||
else if (!(bs = load_serial(CAfile, serialfile, create)))
|
||||
goto end;
|
||||
@@ -1179,8 +1173,8 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
X509V3_CTX ctx2;
|
||||
X509_set_version(x,2); /* version 3 certificate */
|
||||
X509V3_set_ctx(&ctx2, xca, x, NULL, NULL, 0);
|
||||
X509V3_set_conf_lhash(&ctx2, conf);
|
||||
if (!X509V3_EXT_add_conf(conf, &ctx2, section, x)) goto end;
|
||||
X509V3_set_nconf(&ctx2, conf);
|
||||
if (!X509V3_EXT_add_nconf(conf, &ctx2, section, x)) goto end;
|
||||
}
|
||||
|
||||
if (!X509_sign(x,pkey,digest)) goto end;
|
||||
@@ -1226,7 +1220,7 @@ static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
|
||||
|
||||
/* self sign */
|
||||
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest,
|
||||
LHASH *conf, char *section)
|
||||
CONF *conf, char *section)
|
||||
{
|
||||
|
||||
EVP_PKEY *pktmp;
|
||||
@@ -1256,8 +1250,8 @@ static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *dig
|
||||
X509V3_CTX ctx;
|
||||
X509_set_version(x,2); /* version 3 certificate */
|
||||
X509V3_set_ctx(&ctx, x, x, NULL, NULL, 0);
|
||||
X509V3_set_conf_lhash(&ctx, conf);
|
||||
if (!X509V3_EXT_add_conf(conf, &ctx, section, x)) goto err;
|
||||
X509V3_set_nconf(&ctx, conf);
|
||||
if (!X509V3_EXT_add_nconf(conf, &ctx, section, x)) goto err;
|
||||
}
|
||||
if (!X509_sign(x,pkey,digest)) goto err;
|
||||
return 1;
|
||||
|
||||
253
config
253
config
@@ -74,10 +74,18 @@ if [ "x$XREL" != "x" ]; then
|
||||
echo "whatever-whatever-sco5"; exit 0
|
||||
;;
|
||||
4.2MP)
|
||||
if [ "x$VERSION" = "x2.1.1" ]; then
|
||||
if [ "x$VERSION" = "x2.01" ]; then
|
||||
echo "${MACHINE}-whatever-unixware201"; exit 0
|
||||
elif [ "x$VERSION" = "x2.02" ]; then
|
||||
echo "${MACHINE}-whatever-unixware202"; exit 0
|
||||
elif [ "x$VERSION" = "x2.03" ]; then
|
||||
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
|
||||
@@ -85,6 +93,11 @@ if [ "x$XREL" != "x" ]; then
|
||||
4.2)
|
||||
echo "whatever-whatever-unixware1"; exit 0
|
||||
;;
|
||||
OpenUNIX)
|
||||
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
|
||||
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
|
||||
fi
|
||||
;;
|
||||
5)
|
||||
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
|
||||
echo "${MACHINE}-sco-unixware7"; exit 0
|
||||
@@ -104,6 +117,14 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "m68k-apple-aux3"; exit 0
|
||||
;;
|
||||
|
||||
AIX:[3456789]:4:*)
|
||||
echo "${MACHINE}-ibm-aix43"; exit 0
|
||||
;;
|
||||
|
||||
AIX:*:[56789]:*)
|
||||
echo "${MACHINE}-ibm-aix43"; exit 0
|
||||
;;
|
||||
|
||||
AIX:*)
|
||||
echo "${MACHINE}-ibm-aix"; exit 0
|
||||
;;
|
||||
@@ -119,10 +140,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
HP-UX:*)
|
||||
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
case "$HPUXVER" in
|
||||
11.*)
|
||||
echo "${MACHINE}-hp-hpux11"; exit 0
|
||||
;;
|
||||
10.*)
|
||||
1[0-9].*) # HPUX 10 and 11 targets are unified
|
||||
echo "${MACHINE}-hp-hpux10"; exit 0
|
||||
;;
|
||||
*)
|
||||
@@ -208,15 +226,33 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "${MACHINE}-whatever-openbsd"; exit 0
|
||||
;;
|
||||
|
||||
OpenUNIX:*)
|
||||
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
|
||||
;;
|
||||
|
||||
OSF1:*:*:*alpha*)
|
||||
echo "${MACHINE}-dec-osf"; exit 0
|
||||
OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
|
||||
case "$OSFMAJOR" in
|
||||
4|5)
|
||||
echo "${MACHINE}-dec-tru64"; exit 0
|
||||
;;
|
||||
1|2|3)
|
||||
echo "${MACHINE}-dec-osf"; exit 0
|
||||
;;
|
||||
*)
|
||||
echo "${MACHINE}-dec-osf"; exit 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
QNX:*)
|
||||
case "$VERSION" in
|
||||
case "$RELEASE" in
|
||||
4*)
|
||||
echo "${MACHINE}-whatever-qnx4"
|
||||
;;
|
||||
6*)
|
||||
echo "${MACHINE}-whatever-qnx6"
|
||||
;;
|
||||
*)
|
||||
echo "${MACHINE}-whatever-qnx"
|
||||
;;
|
||||
@@ -296,6 +332,25 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "mips-sony-newsos4"; exit 0;
|
||||
;;
|
||||
|
||||
CYGWIN*)
|
||||
case "$RELEASE" in
|
||||
[bB]*|1.0|1.[12].*)
|
||||
echo "${MACHINE}-whatever-cygwin_pre1.3"
|
||||
;;
|
||||
*)
|
||||
echo "${MACHINE}-whatever-cygwin"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*"CRAY T3E")
|
||||
echo "t3e-cray-unicosmk"; exit 0;
|
||||
;;
|
||||
|
||||
*CRAY*)
|
||||
echo "j90-cray-unicos"; exit 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
@@ -335,18 +390,40 @@ exit 0
|
||||
|
||||
# figure out if gcc is available and if so we use it otherwise
|
||||
# we fallback to whatever cc does on the system
|
||||
GCCVER=`(gcc --version) 2>/dev/null`
|
||||
GCCVER=`(gcc -dumpversion) 2>/dev/null`
|
||||
if [ "$GCCVER" != "" ]; then
|
||||
CC=gcc
|
||||
# then strip off whatever prefix Cygnus prepends the number with...
|
||||
GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'`
|
||||
# Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
|
||||
# does give us what we want though, so we use that. We just just the
|
||||
# major and minor version numbers.
|
||||
# peak single digit before and after first dot, e.g. 2.95.1 gives 29
|
||||
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||
else
|
||||
CC=cc
|
||||
fi
|
||||
|
||||
GCCVER=${GCCVER:-0}
|
||||
if [ "$SYSTEM" = "HP-UX" ];then
|
||||
# By default gcc is a ILP32 compiler (with long long == 64).
|
||||
GCC_BITS="32"
|
||||
if [ $GCCVER -ge 30 ]; then
|
||||
# PA64 support only came in with gcc 3.0.x.
|
||||
# We look for the preprocessor symbol __LP64__ indicating
|
||||
# 64bit bit long and pointer. sizeof(int) == 32 on HPUX64.
|
||||
if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
|
||||
GCC_BITS="64"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ "$SYSTEM" = "SunOS" ]; then
|
||||
if [ $GCCVER -ge 30 ]; then
|
||||
# 64-bit ABI isn't officially supported in gcc 3.0, but it appears
|
||||
# to be working, at the very least 'make test' passes...
|
||||
if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then
|
||||
GCC_ARCH="-m64"
|
||||
else
|
||||
GCC_ARCH="-m32"
|
||||
fi
|
||||
fi
|
||||
# check for WorkShop C, expected output is "cc: blah-blah C x.x"
|
||||
CCVER=`(cc -V 2>&1) 2>/dev/null | \
|
||||
egrep -e '^cc: .* C [0-9]\.[0-9]' | \
|
||||
@@ -377,7 +454,6 @@ if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
GCCVER=${GCCVER:-0}
|
||||
CCVER=${CCVER:-0}
|
||||
|
||||
# read the output of the embedded GuessOS
|
||||
@@ -410,9 +486,9 @@ case "$GUESSOS" in
|
||||
mips4-sgi-irix64)
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure irix64-mips4-$CC' *manually*."
|
||||
echo " Type return if you want to continue, Ctrl-C to abort."
|
||||
if [ "$TEST" = "false" ]; then
|
||||
read waste < /dev/tty
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||
fi
|
||||
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
||||
CPU=${CPU:-0}
|
||||
@@ -453,6 +529,10 @@ EOF
|
||||
${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
|
||||
rm dummy dummy.c
|
||||
;;
|
||||
ppc64-*-linux2)
|
||||
#Use the standard target for PPC architecture until we create a
|
||||
#special one for the 64bit architecture.
|
||||
OUT="linux-ppc" ;;
|
||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||
m68k-*-linux*) OUT="linux-m68k" ;;
|
||||
ia64-*-linux?) OUT="linux-ia64" ;;
|
||||
@@ -475,21 +555,76 @@ EOF
|
||||
sun4d) OUT="linux-sparcv8" ;;
|
||||
*) OUT="linux-sparcv7" ;;
|
||||
esac ;;
|
||||
parisc-*-linux2)
|
||||
CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
|
||||
CPUSCHEDULE=`awk '/^cpu.[ ]: PA/{print substr($3,3)}' /proc/cpuinfo`
|
||||
|
||||
# ??TODO ?? Model transformations
|
||||
# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
|
||||
# assuming no further arch. identification will ever be used by GCC.
|
||||
# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
|
||||
# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
|
||||
# for these chips in the future.
|
||||
# PA7300LC -> 7100LC (1.1)
|
||||
# PA8200 -> 8000 (2.0)
|
||||
# PA8500 -> 8000 (2.0)
|
||||
# PA8600 -> 8000 (2.0)
|
||||
|
||||
CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
|
||||
# Finish Model transformations
|
||||
|
||||
options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
||||
OUT="linux-parisc" ;;
|
||||
arm*-*-linux2) OUT="linux-elf-arm" ;;
|
||||
s390-*-linux2) OUT="linux-s390" ;;
|
||||
*-*-linux2) OUT="linux-elf" ;;
|
||||
s390x-*-linux?) OUT="linux-s390x" ;;
|
||||
*-*-linux2) OUT="linux-elf"
|
||||
if [ "$GCCVER" -gt 28 ]; then
|
||||
if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
|
||||
OUT="linux-pentium"
|
||||
fi
|
||||
if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
|
||||
OUT="linux-ppro"
|
||||
fi
|
||||
if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
|
||||
OUT="linux-k6"
|
||||
fi
|
||||
fi ;;
|
||||
*-*-linux1) OUT="linux-aout" ;;
|
||||
sun4u*-*-solaris2)
|
||||
OUT="solaris-sparcv9-$CC"
|
||||
ISA64=`(isalist) 2>/dev/null | grep sparcv9`
|
||||
if [ "$ISA64" != "" -a "$CC" = "cc" -a $CCVER -ge 50 ]; then
|
||||
if [ "$ISA64" != "" ]; then
|
||||
if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
|
||||
echo " Type return if you want to continue, Ctrl-C to abort."
|
||||
if [ "$TEST" = "false" ]; then
|
||||
read waste < /dev/tty
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||
fi
|
||||
elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
|
||||
# $GCC_ARCH denotes default ABI chosen by compiler driver
|
||||
# (first one found on the $PATH). I assume that user
|
||||
# expects certain consistency with the rest of his builds
|
||||
# and therefore switch over to 64-bit. <appro>
|
||||
OUT="solaris64-sparcv9-gcc"
|
||||
echo "WARNING! If you wish to build 32-bit library, then you have to"
|
||||
echo " invoke './Configure solaris-sparcv9-gcc' *manually*."
|
||||
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
|
||||
fi
|
||||
elif [ "$GCC_ARCH" = "-m32" ]; then
|
||||
echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
|
||||
echo " and wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure solaris64-sparcv9-gcc' *manually*."
|
||||
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
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
OUT="solaris-sparcv9-$CC" ;;
|
||||
;;
|
||||
sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||
sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||
sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;;
|
||||
@@ -501,28 +636,92 @@ EOF
|
||||
*86*-*-netbsd) OUT="NetBSD-x86" ;;
|
||||
sun3*-*-netbsd) OUT="NetBSD-m68" ;;
|
||||
*-*-netbsd) OUT="NetBSD-sparc" ;;
|
||||
*86*-*-openbsd) OUT="OpenBSD-x86" ;;
|
||||
alpha*-*-openbsd) OUT="OpenBSD-alpha" ;;
|
||||
*86*-*-openbsd) OUT="OpenBSD-i386" ;;
|
||||
m68k*-*-openbsd) OUT="OpenBSD-m68k" ;;
|
||||
m88k*-*-openbsd) OUT="OpenBSD-m88k" ;;
|
||||
mips*-*-openbsd) OUT="OpenBSD-mips" ;;
|
||||
pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
|
||||
powerpc*-*-openbsd) OUT="OpenBSD-powerpc" ;;
|
||||
sparc64*-*-openbsd) OUT="OpenBSD-sparc64" ;;
|
||||
sparc*-*-openbsd) OUT="OpenBSD-sparc" ;;
|
||||
vax*-*-openbsd) OUT="OpenBSD-vax" ;;
|
||||
hppa*-*-openbsd) OUT="OpenBSD-hppa" ;;
|
||||
*-*-openbsd) OUT="OpenBSD" ;;
|
||||
*86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
|
||||
*-*-osf) OUT="alpha-cc" ;;
|
||||
*-*-osf) OUT="alphaold-cc" ;;
|
||||
*-*-tru64) OUT="alpha-cc" ;;
|
||||
*-*-OpenUNIX*)
|
||||
if [ "$CC" = "gcc" ]; then
|
||||
OUT="OpenUNIX-8-gcc"
|
||||
else
|
||||
OUT="OpenUNIX-8"
|
||||
fi
|
||||
;;
|
||||
*-*-unixware7) OUT="unixware-7" ;;
|
||||
*-*-UnixWare7) OUT="unixware-7" ;;
|
||||
*-*-Unixware7) OUT="unixware-7" ;;
|
||||
*-*-unixware[1-2]*) OUT="unixware-2.0" ;;
|
||||
*-*-UnixWare[1-2]*) OUT="unixware-2.0" ;;
|
||||
*-*-Unixware[1-2]*) OUT="unixware-2.0" ;;
|
||||
*-*-unixware20*) OUT="unixware-2.0" ;;
|
||||
*-*-unixware21*) OUT="unixware-2.1" ;;
|
||||
*-*-UnixWare20*) OUT="unixware-2.0" ;;
|
||||
*-*-UnixWare21*) OUT="unixware-2.1" ;;
|
||||
*-*-Unixware20*) OUT="unixware-2.0" ;;
|
||||
*-*-Unixware21*) OUT="unixware-2.1" ;;
|
||||
BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
|
||||
RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
|
||||
*-siemens-sysv4) OUT="SINIX" ;;
|
||||
*-hpux1*) OUT="hpux-parisc-$CC"
|
||||
options="$options -D_REENTRANT" ;;
|
||||
*-hpux1*)
|
||||
if [ $CC = "gcc" ];
|
||||
then
|
||||
if [ $GCC_BITS = "64" ]; then
|
||||
OUT="hpux64-parisc-gcc"
|
||||
else
|
||||
OUT="hpux-parisc-gcc"
|
||||
fi
|
||||
else
|
||||
OUT="hpux-parisc-$CC"
|
||||
fi
|
||||
KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
|
||||
KERNEL_BITS=${KERNEL_BITS:-32}
|
||||
CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
|
||||
CPU_VERSION=${CPU_VERSION:-0}
|
||||
# See <sys/unistd.h> for further info on CPU_VERSION.
|
||||
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
|
||||
echo "NOTICE! 64-bit is the only ABI currently operational on HP-UXi."
|
||||
echo " Post request to openssl-dev@openssl.org for 32-bit support."
|
||||
if [ "$TEST" = "false" ]; then
|
||||
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||
fi
|
||||
OUT="hpux64-ia64-cc"
|
||||
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
|
||||
if [ "$CC" = "cc" ]; then
|
||||
OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
|
||||
fi
|
||||
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library then you have to"
|
||||
echo " invoke './Configure hpux64-parisc2-cc' *manually*."
|
||||
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
|
||||
fi
|
||||
fi
|
||||
elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
|
||||
:
|
||||
elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
|
||||
:
|
||||
else # Motorola(?) CPU
|
||||
OUT="hpux-$CC"
|
||||
fi
|
||||
options="$options -D_REENTRANT" ;;
|
||||
*-hpux) OUT="hpux-parisc-$CC" ;;
|
||||
# these are all covered by the catchall below
|
||||
# *-aix) OUT="aix-$CC" ;;
|
||||
# *-dgux) OUT="dgux" ;;
|
||||
mips-sony-newsos4) OUT="newsos4-gcc" ;;
|
||||
*-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
|
||||
*-*-cygwin) OUT="Cygwin" ;;
|
||||
t3e-cray-unicosmk) OUT="cray-t3e" ;;
|
||||
j90-cray-unicos) OUT="cray-j90" ;;
|
||||
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
||||
esac
|
||||
|
||||
@@ -557,7 +756,7 @@ case "$GUESSOS" in
|
||||
i386-*) options="$options 386" ;;
|
||||
esac
|
||||
|
||||
for i in bf cast des dh dsa ec hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
|
||||
for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 rijndael ripemd rsa sha
|
||||
do
|
||||
if [ ! -d crypto/$i ]
|
||||
then
|
||||
|
||||
@@ -28,35 +28,37 @@ LIBS=
|
||||
|
||||
SDIRS= md2 md5 sha mdc2 hmac ripemd \
|
||||
des rc2 rc4 rc5 idea bf cast \
|
||||
bn ec rsa dsa dh dso engine rijndael \
|
||||
bn ec rsa dsa dh dso engine aes \
|
||||
buffer bio stack lhash rand err objects \
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
|
||||
|
||||
GENERAL=Makefile README crypto-lib.com install.com
|
||||
|
||||
LIB= $(TOP)/libcrypto.a
|
||||
LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c
|
||||
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o
|
||||
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
||||
LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c
|
||||
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h
|
||||
HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER)
|
||||
EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
|
||||
ossl_typ.h
|
||||
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h $(EXHEADER)
|
||||
|
||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
|
||||
top:
|
||||
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
||||
|
||||
all: buildinf.h lib subdirs
|
||||
all: buildinf.h lib subdirs shared
|
||||
|
||||
buildinf.h: ../Makefile.ssl
|
||||
( echo "#ifndef MK1MF_BUILD"; \
|
||||
echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
|
||||
echo " #define CFLAGS \"$(CC) $(CFLAG)\""; \
|
||||
echo " #define PLATFORM \"$(PLATFORM)\""; \
|
||||
echo " #define DATE \"`date`\""; \
|
||||
echo "#endif" ) >buildinf.h
|
||||
echo ' /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */'; \
|
||||
echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \
|
||||
echo ' #define PLATFORM "$(PLATFORM)"'; \
|
||||
echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
|
||||
echo '#endif' ) >buildinf.h
|
||||
|
||||
testapps:
|
||||
if echo ${SDIRS} | fgrep ' des '; \
|
||||
@@ -94,6 +96,11 @@ lib: $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@touch lib
|
||||
|
||||
shared:
|
||||
if [ -n "$(SHARED_LIBS)" ]; then \
|
||||
(cd ..; make $(SHARED_LIB)); \
|
||||
fi
|
||||
|
||||
libs:
|
||||
@for i in $(SDIRS) ;\
|
||||
do \
|
||||
@@ -134,7 +141,7 @@ depend:
|
||||
@for i in $(SDIRS) ;\
|
||||
do \
|
||||
(cd $$i && echo "making depend in crypto/$$i..." && \
|
||||
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
|
||||
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ); \
|
||||
done;
|
||||
|
||||
clean:
|
||||
@@ -192,6 +199,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/safestack.h ../include/openssl/stack.h
|
||||
mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c
|
||||
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
|
||||
o_time.o: o_time.h
|
||||
tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||
|
||||
2
crypto/aes/.cvsignore
Normal file
2
crypto/aes/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
lib
|
||||
Makefile.save
|
||||
103
crypto/aes/Makefile.ssl
Normal file
103
crypto/aes/Makefile.ssl
Normal file
@@ -0,0 +1,103 @@
|
||||
#
|
||||
# crypto/aes/Makefile
|
||||
#
|
||||
|
||||
DIR= aes
|
||||
TOP= ../..
|
||||
CC= cc
|
||||
CPP= $(CC) -E
|
||||
INCLUDES=
|
||||
CFLAG=-g
|
||||
INSTALL_PREFIX=
|
||||
OPENSSLDIR= /usr/local/ssl
|
||||
INSTALLTOP= /usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
MAKEFILE= Makefile.ssl
|
||||
AR= ar r
|
||||
|
||||
# CFLAGS= -mpentiumpro $(INCLUDES) $(CFLAG) -O3 -fexpensive-optimizations -funroll-loops -fforce-addr
|
||||
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||
|
||||
GENERAL=Makefile
|
||||
#TEST=aestest.c
|
||||
TEST=
|
||||
APPS=
|
||||
|
||||
LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC=aes_core.c aes_misc.c aes_ecb.c aes_cbc.c aes_cfb.c aes_ofb.c aes_ctr.c
|
||||
LIBOBJ=aes_core.o aes_misc.o aes_ecb.o aes_cbc.o aes_cfb.o aes_ofb.o aes_ctr.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
EXHEADER= aes.h
|
||||
HEADER= aes_locl.h $(EXHEADER)
|
||||
|
||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||
|
||||
top:
|
||||
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
@touch lib
|
||||
|
||||
$(LIBOBJ): $(LIBSRC)
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||
|
||||
install: installs
|
||||
|
||||
installs:
|
||||
@for i in $(EXHEADER) ; \
|
||||
do \
|
||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||
done;
|
||||
|
||||
tags:
|
||||
ctags $(SRC)
|
||||
|
||||
tests:
|
||||
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
depend:
|
||||
$(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
|
||||
|
||||
dclean:
|
||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
aes_cbc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_cbc.o: ../../include/openssl/opensslconf.h aes_cbc.c aes_locl.h
|
||||
aes_cfb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_cfb.o: ../../include/openssl/opensslconf.h aes_cfb.c aes_locl.h
|
||||
aes_core.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_core.o: ../../include/openssl/opensslconf.h aes_core.c aes_locl.h
|
||||
aes_ctr.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_ctr.o: ../../include/openssl/opensslconf.h aes_ctr.c aes_locl.h
|
||||
aes_ecb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_ecb.o: ../../include/openssl/opensslconf.h aes_ecb.c aes_locl.h
|
||||
aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_misc.o: ../../include/openssl/opensslconf.h
|
||||
aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c
|
||||
aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_ofb.o: ../../include/openssl/opensslconf.h aes_locl.h aes_ofb.c
|
||||
3
crypto/aes/README
Normal file
3
crypto/aes/README
Normal file
@@ -0,0 +1,3 @@
|
||||
This is an OpenSSL-compatible version of AES (also called Rijndael).
|
||||
aes_core.c is basically the same as rijndael-alg-fst.c but with an
|
||||
API that looks like the rest of the OpenSSL symmetric cipher suite.
|
||||
109
crypto/aes/aes.h
Normal file
109
crypto/aes/aes.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_AES_H
|
||||
#define HEADER_AES_H
|
||||
|
||||
#ifdef OPENSSL_NO_AES
|
||||
#error AES is disabled.
|
||||
#endif
|
||||
|
||||
static const int AES_DECRYPT = 0;
|
||||
static const int AES_ENCRYPT = 1;
|
||||
/* Because array size can't be a const in C, the following two are macros.
|
||||
Both sizes are in bytes. */
|
||||
#define AES_MAXNR 14
|
||||
#define AES_BLOCK_SIZE 16
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This should be a hidden type, but EVP requires that the size be known */
|
||||
struct aes_key_st {
|
||||
unsigned long rd_key[4 *(AES_MAXNR + 1)];
|
||||
int rounds;
|
||||
};
|
||||
typedef struct aes_key_st AES_KEY;
|
||||
|
||||
const char *AES_options(void);
|
||||
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
|
||||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key, const int enc);
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num);
|
||||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *counter, unsigned int *num);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !HEADER_AES_H */
|
||||
89
crypto/aes/aes_cbc.c
Normal file
89
crypto/aes/aes_cbc.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/* crypto/aes/aes_cbc.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc) {
|
||||
|
||||
int n;
|
||||
unsigned long len = length;
|
||||
unsigned char tmp[16];
|
||||
|
||||
assert(in && out && key && ivec);
|
||||
assert(length % AES_BLOCK_SIZE == 0);
|
||||
assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
|
||||
|
||||
if (AES_ENCRYPT == enc)
|
||||
while (len > 0) {
|
||||
for(n=0; n < 16; ++n)
|
||||
tmp[n] = in[n] ^ ivec[n];
|
||||
AES_encrypt(tmp, out, key);
|
||||
memcpy(ivec, out, 16);
|
||||
len -= 16;
|
||||
in += 16;
|
||||
out += 16;
|
||||
}
|
||||
else
|
||||
while (len > 0) {
|
||||
memcpy(tmp, in, 16);
|
||||
AES_decrypt(in, out, key);
|
||||
for(n=0; n < 16; ++n)
|
||||
out[n] ^= ivec[n];
|
||||
memcpy(ivec, tmp, 16);
|
||||
len -= 16;
|
||||
in += 16;
|
||||
out += 16;
|
||||
}
|
||||
}
|
||||
151
crypto/aes/aes_cfb.c
Normal file
151
crypto/aes/aes_cfb.c
Normal file
@@ -0,0 +1,151 @@
|
||||
/* crypto/aes/aes_cfb.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
/* The input and output encrypted as though 128bit cfb mode is being
|
||||
* used. The extra state information to record how much of the
|
||||
* 128bit block we have used is contained in *num;
|
||||
*/
|
||||
|
||||
void AES_cfb128_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 long l = length;
|
||||
unsigned char c;
|
||||
|
||||
assert(in && out && key && ivec && num);
|
||||
|
||||
n = *num;
|
||||
|
||||
if (enc) {
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(ivec, ivec, key);
|
||||
}
|
||||
ivec[n] = *(out++) = *(in++) ^ ivec[n];
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
} else {
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(ivec, ivec, key);
|
||||
}
|
||||
c = *(in);
|
||||
*(out++) = *(in++) ^ ivec[n];
|
||||
ivec[n] = c;
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
*num=n;
|
||||
}
|
||||
|
||||
1251
crypto/aes/aes_core.c
Normal file
1251
crypto/aes/aes_core.c
Normal file
File diff suppressed because it is too large
Load Diff
117
crypto/aes/aes_ctr.c
Normal file
117
crypto/aes/aes_ctr.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/* crypto/aes/aes_ctr.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
/* NOTE: CTR mode is big-endian. The rest of the AES code
|
||||
* is endian-neutral. */
|
||||
|
||||
/* increment counter (128-bit int) by 2^64 */
|
||||
static void AES_ctr128_inc(unsigned char *counter) {
|
||||
unsigned long c;
|
||||
|
||||
/* Grab 3rd dword of counter and increment */
|
||||
#ifdef L_ENDIAN
|
||||
c = GETU32(counter + 8);
|
||||
c++;
|
||||
PUTU32(counter + 8, c);
|
||||
#else
|
||||
c = GETU32(counter + 4);
|
||||
c++;
|
||||
PUTU32(counter + 4, c);
|
||||
#endif
|
||||
|
||||
/* if no overflow, we're done */
|
||||
if (c)
|
||||
return;
|
||||
|
||||
/* 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++;
|
||||
PUTU32(counter + 0, c);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* The input encrypted as though 128bit counter mode is being
|
||||
* used. The extra state information to record how much of the
|
||||
* 128bit block we have used is contained in *num;
|
||||
*/
|
||||
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *counter, unsigned int *num) {
|
||||
|
||||
unsigned int n;
|
||||
unsigned long l=length;
|
||||
unsigned char tmp[AES_BLOCK_SIZE];
|
||||
|
||||
assert(in && out && key && counter && num);
|
||||
|
||||
n = *num;
|
||||
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(counter, tmp, key);
|
||||
AES_ctr128_inc(counter);
|
||||
}
|
||||
*(out++) = *(in++) ^ tmp[n];
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
*num=n;
|
||||
}
|
||||
67
crypto/aes/aes_ecb.c
Normal file
67
crypto/aes/aes_ecb.c
Normal file
@@ -0,0 +1,67 @@
|
||||
/* crypto/aes/aes_ecb.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key, const int enc) {
|
||||
|
||||
assert(in && out && key);
|
||||
assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
|
||||
|
||||
if (AES_ENCRYPT == enc)
|
||||
AES_encrypt(in, out, key);
|
||||
else
|
||||
AES_decrypt(in, out, key);
|
||||
}
|
||||
|
||||
88
crypto/aes/aes_locl.h
Normal file
88
crypto/aes/aes_locl.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_AES_LOCL_H
|
||||
#define HEADER_AES_LOCL_H
|
||||
|
||||
#include <openssl/e_os2.h>
|
||||
|
||||
#ifdef OPENSSL_NO_AES
|
||||
#error AES is disabled.
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__STDC__) || defined(OPENSSL_SYS_VMS) || defined(M_XENIX) || defined(OPENSSL_SYS_MSDOS)
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
|
||||
# define GETU32(p) SWAP(*((u32 *)(p)))
|
||||
# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }
|
||||
#else
|
||||
# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
|
||||
# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); }
|
||||
#endif
|
||||
|
||||
typedef unsigned long u32;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned char u8;
|
||||
|
||||
#define MAXKC (256/32)
|
||||
#define MAXKB (256/8)
|
||||
#define MAXNR 14
|
||||
|
||||
/* This controls loop-unrolling in aes_core.c */
|
||||
#undef FULL_UNROLL
|
||||
|
||||
#endif /* !HEADER_AES_LOCL_H */
|
||||
64
crypto/aes/aes_misc.c
Normal file
64
crypto/aes/aes_misc.c
Normal file
@@ -0,0 +1,64 @@
|
||||
/* crypto/aes/aes_misc.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
const char *AES_version="AES" OPENSSL_VERSION_PTEXT;
|
||||
|
||||
const char *AES_options(void) {
|
||||
#ifdef FULL_UNROLL
|
||||
return "aes(full)";
|
||||
#else
|
||||
return "aes(partial)";
|
||||
#endif
|
||||
}
|
||||
136
crypto/aes/aes_ofb.c
Normal file
136
crypto/aes/aes_ofb.c
Normal file
@@ -0,0 +1,136 @@
|
||||
/* crypto/aes/aes_ofb.c -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
*/
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
/* The input and output encrypted as though 128bit ofb mode is being
|
||||
* used. The extra state information to record how much of the
|
||||
* 128bit block we have used is contained in *num;
|
||||
*/
|
||||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const unsigned long length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num) {
|
||||
|
||||
unsigned int n;
|
||||
unsigned long l=length;
|
||||
|
||||
assert(in && out && key && ivec && num);
|
||||
|
||||
n = *num;
|
||||
|
||||
while (l--) {
|
||||
if (n == 0) {
|
||||
AES_encrypt(ivec, ivec, key);
|
||||
}
|
||||
*(out++) = *(in++) ^ ivec[n];
|
||||
n = (n+1) % AES_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
*num=n;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -71,8 +71,6 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
|
||||
if (a == NULL) return(0);
|
||||
|
||||
len=a->length;
|
||||
ret=1+len;
|
||||
if (pp == NULL) return(ret);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
@@ -100,6 +98,10 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
|
||||
}
|
||||
else
|
||||
bits=0;
|
||||
|
||||
ret=1+len;
|
||||
if (pp == NULL) return(ret);
|
||||
|
||||
p= *pp;
|
||||
|
||||
*(p++)=(unsigned char)bits;
|
||||
@@ -172,6 +174,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
|
||||
w=n/8;
|
||||
v=1<<(7-(n&0x07));
|
||||
iv= ~v;
|
||||
if (!value) v=0;
|
||||
|
||||
a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */
|
||||
|
||||
|
||||
@@ -60,24 +60,6 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
static unsigned long tag2bit[32]={
|
||||
0, 0, 0, B_ASN1_BIT_STRING, /* tags 0 - 3 */
|
||||
B_ASN1_OCTET_STRING, 0, 0, B_ASN1_UNKNOWN,/* tags 4- 7 */
|
||||
B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN,/* tags 8-11 */
|
||||
B_ASN1_UTF8STRING,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,/* tags 12-15 */
|
||||
0, 0, B_ASN1_NUMERICSTRING,B_ASN1_PRINTABLESTRING, /* tags 16-19 */
|
||||
B_ASN1_T61STRING,B_ASN1_VIDEOTEXSTRING,B_ASN1_IA5STRING, /* tags 20-22 */
|
||||
B_ASN1_UTCTIME, B_ASN1_GENERALIZEDTIME, /* tags 23-24 */
|
||||
B_ASN1_GRAPHICSTRING,B_ASN1_ISO64STRING,B_ASN1_GENERALSTRING, /* tags 25-27 */
|
||||
B_ASN1_UNIVERSALSTRING,B_ASN1_UNKNOWN,B_ASN1_BMPSTRING,B_ASN1_UNKNOWN, /* tags 28-31 */
|
||||
};
|
||||
|
||||
unsigned long ASN1_tag2bit(int tag)
|
||||
{
|
||||
if((tag < 0) || (tag > 30)) return 0;
|
||||
return tag2bit[tag];
|
||||
}
|
||||
|
||||
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c);
|
||||
/* type is a 'bitmap' of acceptable string types.
|
||||
*/
|
||||
@@ -99,7 +81,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
|
||||
i=ASN1_R_TAG_VALUE_TOO_HIGH;;
|
||||
goto err;
|
||||
}
|
||||
if (!(tag2bit[tag] & type))
|
||||
if (!(ASN1_tag2bit(tag) & type))
|
||||
{
|
||||
i=ASN1_R_WRONG_TYPE;
|
||||
goto err;
|
||||
|
||||
@@ -82,7 +82,7 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
|
||||
p=str;
|
||||
i2d(data,&p);
|
||||
|
||||
EVP_Digest(str, i, md, len, type);
|
||||
EVP_Digest(str, i, md, len, type, NULL);
|
||||
OPENSSL_free(str);
|
||||
return(1);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
|
||||
i=ASN1_item_i2d(asn,&str, it);
|
||||
if (!str) return(0);
|
||||
|
||||
EVP_Digest(str, i, md, len, type);
|
||||
EVP_Digest(str, i, md, len, type, NULL);
|
||||
OPENSSL_free(str);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,17 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
|
||||
else ret->type=V_ASN1_ENUMERATED;
|
||||
j=BN_num_bits(bn);
|
||||
len=((j == 0)?0:((j/8)+1));
|
||||
ret->data=(unsigned char *)OPENSSL_malloc(len+4);
|
||||
if (ret->length < len+4)
|
||||
{
|
||||
unsigned char *new_data=OPENSSL_realloc(ret->data, len+4);
|
||||
if (!new_data)
|
||||
{
|
||||
ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
ret->data=new_data;
|
||||
}
|
||||
|
||||
ret->length=BN_bn2bin(bn,ret->data);
|
||||
return(ret);
|
||||
err:
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "cryptlib.h"
|
||||
#include "o_time.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
#if 0
|
||||
@@ -145,6 +146,19 @@ int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
|
||||
|
||||
if ((n < min[i]) || (n > max[i])) goto err;
|
||||
}
|
||||
/* Optional fractional seconds: decimal point followed by one
|
||||
* or more digits.
|
||||
*/
|
||||
if (a[o] == '.')
|
||||
{
|
||||
if (++o > l) goto err;
|
||||
i = o;
|
||||
while ((a[o] >= '0') && (a[o] <= '9') && (o <= l))
|
||||
o++;
|
||||
/* Must have at least one digit after decimal point */
|
||||
if (i == o) goto err;
|
||||
}
|
||||
|
||||
if (a[o] == 'Z')
|
||||
o++;
|
||||
else if ((a[o] == '+') || (a[o] == '-'))
|
||||
@@ -193,21 +207,17 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
{
|
||||
char *p;
|
||||
struct tm *ts;
|
||||
#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32)
|
||||
struct tm data;
|
||||
#endif
|
||||
|
||||
if (s == NULL)
|
||||
s=M_ASN1_GENERALIZEDTIME_new();
|
||||
if (s == NULL)
|
||||
return(NULL);
|
||||
|
||||
#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32)
|
||||
gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
|
||||
ts=&data;
|
||||
#else
|
||||
ts=gmtime(&t);
|
||||
#endif
|
||||
ts=OPENSSL_gmtime(&t, &data);
|
||||
if (ts == NULL)
|
||||
return(NULL);
|
||||
|
||||
p=(char *)s->data;
|
||||
if ((p == NULL) || (s->length < 16))
|
||||
{
|
||||
|
||||
@@ -397,7 +397,16 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
|
||||
else ret->type=V_ASN1_INTEGER;
|
||||
j=BN_num_bits(bn);
|
||||
len=((j == 0)?0:((j/8)+1));
|
||||
ret->data=(unsigned char *)OPENSSL_malloc(len+4);
|
||||
if (ret->length < len+4)
|
||||
{
|
||||
unsigned char *new_data=OPENSSL_realloc(ret->data, len+4);
|
||||
if (!new_data)
|
||||
{
|
||||
ASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
ret->data=new_data;
|
||||
}
|
||||
ret->length=BN_bn2bin(bn,ret->data);
|
||||
/* Correct zero case */
|
||||
if(!ret->length)
|
||||
|
||||
@@ -118,7 +118,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
|
||||
}
|
||||
|
||||
pStart = p; /* Catch the beg of Setblobs*/
|
||||
rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
|
||||
if (!(rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)))) return 0; /* In this array
|
||||
we will store the SET blobs */
|
||||
|
||||
for (i=0; i<sk_num(a); i++)
|
||||
@@ -135,7 +135,7 @@ SetBlob
|
||||
/* Now we have to sort the blobs. I am using a simple algo.
|
||||
*Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
|
||||
qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp);
|
||||
pTempMem = OPENSSL_malloc(totSize);
|
||||
if (!(pTempMem = OPENSSL_malloc(totSize))) return 0;
|
||||
|
||||
/* Copy to temp mem */
|
||||
p = pTempMem;
|
||||
|
||||
@@ -55,6 +55,59 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
@@ -82,6 +135,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
int i,inl=0,outl=0,outll=0;
|
||||
X509_ALGOR *a;
|
||||
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
for (i=0; i<2; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
@@ -89,7 +143,14 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
else
|
||||
a=algor2;
|
||||
if (a == NULL) continue;
|
||||
if ( (a->parameter == NULL) ||
|
||||
if (type->pkey_type == NID_dsaWithSHA1)
|
||||
{
|
||||
/* special case: RFC 2459 tells us to omit 'parameters'
|
||||
* with id-dsa-with-sha1 */
|
||||
ASN1_TYPE_free(a->parameter);
|
||||
a->parameter = NULL;
|
||||
}
|
||||
else if ((a->parameter == NULL) ||
|
||||
(a->parameter->type != V_ASN1_NULL))
|
||||
{
|
||||
ASN1_TYPE_free(a->parameter);
|
||||
@@ -122,7 +183,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
p=buf_in;
|
||||
|
||||
i2d(data,&p);
|
||||
EVP_SignInit(&ctx,type);
|
||||
EVP_SignInit_ex(&ctx,type, NULL);
|
||||
EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl);
|
||||
if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out,
|
||||
(unsigned int *)&outl,pkey))
|
||||
@@ -141,7 +202,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
|
||||
signature->flags|=ASN1_STRING_FLAG_BITS_LEFT;
|
||||
err:
|
||||
memset(&ctx,0,sizeof(ctx));
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
if (buf_in != NULL)
|
||||
{ memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
|
||||
if (buf_out != NULL)
|
||||
@@ -160,6 +221,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
int i,inl=0,outl=0,outll=0;
|
||||
X509_ALGOR *a;
|
||||
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
for (i=0; i<2; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
@@ -167,7 +229,14 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
else
|
||||
a=algor2;
|
||||
if (a == NULL) continue;
|
||||
if ( (a->parameter == NULL) ||
|
||||
if (type->pkey_type == NID_dsaWithSHA1)
|
||||
{
|
||||
/* special case: RFC 2459 tells us to omit 'parameters'
|
||||
* with id-dsa-with-sha1 */
|
||||
ASN1_TYPE_free(a->parameter);
|
||||
a->parameter = NULL;
|
||||
}
|
||||
else if ((a->parameter == NULL) ||
|
||||
(a->parameter->type != V_ASN1_NULL))
|
||||
{
|
||||
ASN1_TYPE_free(a->parameter);
|
||||
@@ -197,7 +266,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
goto err;
|
||||
}
|
||||
|
||||
EVP_SignInit(&ctx,type);
|
||||
EVP_SignInit_ex(&ctx,type, NULL);
|
||||
EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl);
|
||||
if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out,
|
||||
(unsigned int *)&outl,pkey))
|
||||
@@ -216,7 +285,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
|
||||
signature->flags|=ASN1_STRING_FLAG_BITS_LEFT;
|
||||
err:
|
||||
memset(&ctx,0,sizeof(ctx));
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
if (buf_in != NULL)
|
||||
{ memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
|
||||
if (buf_out != NULL)
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
/* Three IO functions for sending data to memory, a BIO and
|
||||
* and a FILE pointer.
|
||||
*/
|
||||
|
||||
int send_mem_chars(void *arg, const void *buf, int len)
|
||||
#if 0 /* never used */
|
||||
static int send_mem_chars(void *arg, const void *buf, int len)
|
||||
{
|
||||
unsigned char **out = arg;
|
||||
if(!out) return 1;
|
||||
@@ -86,15 +86,16 @@ int send_mem_chars(void *arg, const void *buf, int len)
|
||||
*out += len;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int send_bio_chars(void *arg, const void *buf, int len)
|
||||
static int send_bio_chars(void *arg, const void *buf, int len)
|
||||
{
|
||||
if(!arg) return 1;
|
||||
if(BIO_write(arg, buf, len) != len) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int send_fp_chars(void *arg, const void *buf, int len)
|
||||
static int send_fp_chars(void *arg, const void *buf, int len)
|
||||
{
|
||||
if(!arg) return 1;
|
||||
if(fwrite(buf, 1, len, arg) != (unsigned int)len) return 0;
|
||||
@@ -240,7 +241,7 @@ static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, int buflen
|
||||
* #01234 format.
|
||||
*/
|
||||
|
||||
int do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str)
|
||||
static int do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str)
|
||||
{
|
||||
/* Placing the ASN1_STRING in a temp ASN1_TYPE allows
|
||||
* the DER encoding to readily obtained
|
||||
@@ -371,6 +372,8 @@ static int do_indent(char_io *io_ch, void *arg, int indent)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define FN_WIDTH_LN 25
|
||||
#define FN_WIDTH_SN 10
|
||||
|
||||
static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n,
|
||||
int indent, unsigned long flags)
|
||||
@@ -456,19 +459,29 @@ static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n,
|
||||
val = X509_NAME_ENTRY_get_data(ent);
|
||||
fn_nid = OBJ_obj2nid(fn);
|
||||
if(fn_opt != XN_FLAG_FN_NONE) {
|
||||
int objlen;
|
||||
int objlen, fld_len;
|
||||
if((fn_opt == XN_FLAG_FN_OID) || (fn_nid==NID_undef) ) {
|
||||
OBJ_obj2txt(objtmp, 80, fn, 1);
|
||||
fld_len = 0; /* XXX: what should this be? */
|
||||
objbuf = objtmp;
|
||||
} else {
|
||||
if(fn_opt == XN_FLAG_FN_SN)
|
||||
if(fn_opt == XN_FLAG_FN_SN) {
|
||||
fld_len = FN_WIDTH_SN;
|
||||
objbuf = OBJ_nid2sn(fn_nid);
|
||||
else if(fn_opt == XN_FLAG_FN_LN)
|
||||
} else if(fn_opt == XN_FLAG_FN_LN) {
|
||||
fld_len = FN_WIDTH_LN;
|
||||
objbuf = OBJ_nid2ln(fn_nid);
|
||||
else objbuf = "";
|
||||
} else {
|
||||
fld_len = 0; /* XXX: what should this be? */
|
||||
objbuf = "";
|
||||
}
|
||||
}
|
||||
objlen = strlen(objbuf);
|
||||
if(!io_ch(arg, objbuf, objlen)) return -1;
|
||||
if ((objlen < fld_len) && (flags & XN_FLAG_FN_ALIGN)) {
|
||||
if (!do_indent(io_ch, arg, fld_len - objlen)) return -1;
|
||||
outlen += fld_len - objlen;
|
||||
}
|
||||
if(!io_ch(arg, sep_eq, sep_eq_len)) return -1;
|
||||
outlen += objlen + sep_eq_len;
|
||||
}
|
||||
|
||||
@@ -105,9 +105,9 @@ int ASN1_STRING_set_default_mask_asc(char *p)
|
||||
mask = strtoul(p + 5, &end, 0);
|
||||
if(*end) return 0;
|
||||
} else if(!strcmp(p, "nombstr"))
|
||||
mask = ~(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING);
|
||||
mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING));
|
||||
else if(!strcmp(p, "pkix"))
|
||||
mask = ~B_ASN1_T61STRING;
|
||||
mask = ~((unsigned long)B_ASN1_T61STRING);
|
||||
else if(!strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING;
|
||||
else if(!strcmp(p, "default"))
|
||||
mask = 0xFFFFFFFFL;
|
||||
@@ -170,8 +170,10 @@ static ASN1_STRING_TABLE tbl_standard[] = {
|
||||
{NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0},
|
||||
{NID_surname, 1, ub_name, DIRSTRING_TYPE, 0},
|
||||
{NID_initials, 1, ub_name, DIRSTRING_TYPE, 0},
|
||||
{NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
|
||||
{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_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}
|
||||
};
|
||||
|
||||
static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "cryptlib.h"
|
||||
#include "o_time.h"
|
||||
#include <openssl/asn1t.h>
|
||||
|
||||
IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME)
|
||||
@@ -100,14 +101,11 @@ int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp)
|
||||
ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
|
||||
{
|
||||
struct tm *ts;
|
||||
#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)
|
||||
struct tm data;
|
||||
|
||||
gmtime_r(&t,&data);
|
||||
ts=&data; /* should return &data, but doesn't on some systems, so we don't even look at the return value */
|
||||
#else
|
||||
ts=gmtime(&t);
|
||||
#endif
|
||||
ts=OPENSSL_gmtime(&t,&data);
|
||||
if (ts == NULL)
|
||||
return NULL;
|
||||
if((ts->tm_year >= 50) && (ts->tm_year < 150))
|
||||
return ASN1_UTCTIME_set(s, t);
|
||||
return ASN1_GENERALIZEDTIME_set(s,t);
|
||||
|
||||
@@ -59,12 +59,8 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "cryptlib.h"
|
||||
#include "o_time.h"
|
||||
#include <openssl/asn1.h>
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
#include <descrip.h>
|
||||
#include <lnmdef.h>
|
||||
#include <starlet.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
|
||||
@@ -191,59 +187,17 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
|
||||
{
|
||||
char *p;
|
||||
struct tm *ts;
|
||||
#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)
|
||||
|
||||
struct tm data;
|
||||
#endif
|
||||
|
||||
if (s == NULL)
|
||||
s=M_ASN1_UTCTIME_new();
|
||||
if (s == NULL)
|
||||
return(NULL);
|
||||
|
||||
#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)
|
||||
gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
|
||||
ts=&data;
|
||||
#else
|
||||
ts=gmtime(&t);
|
||||
#endif
|
||||
#ifdef OPENSSL_SYS_VMS
|
||||
ts=OPENSSL_gmtime(&t, &data);
|
||||
if (ts == NULL)
|
||||
{
|
||||
static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL");
|
||||
static $DESCRIPTOR(lognam,"SYS$TIMEZONE_DIFFERENTIAL");
|
||||
char result[256];
|
||||
unsigned int reslen = 0;
|
||||
struct {
|
||||
short buflen;
|
||||
short code;
|
||||
void *bufaddr;
|
||||
unsigned int *reslen;
|
||||
} itemlist[] = {
|
||||
{ 0, LNM$_STRING, 0, 0 },
|
||||
{ 0, 0, 0, 0 },
|
||||
};
|
||||
int status;
|
||||
return(NULL);
|
||||
|
||||
/* Get the value for SYS$TIMEZONE_DIFFERENTIAL */
|
||||
itemlist[0].buflen = sizeof(result);
|
||||
itemlist[0].bufaddr = result;
|
||||
itemlist[0].reslen = &reslen;
|
||||
status = sys$trnlnm(0, &tabnam, &lognam, 0, itemlist);
|
||||
if (!(status & 1))
|
||||
return NULL;
|
||||
result[reslen] = '\0';
|
||||
|
||||
/* Get the numerical value of the equivalence string */
|
||||
status = atoi(result);
|
||||
|
||||
/* and use it to move time to GMT */
|
||||
t -= status;
|
||||
|
||||
/* then convert the result to the time structure */
|
||||
ts=(struct tm *)localtime(&t);
|
||||
}
|
||||
#endif
|
||||
p=(char *)s->data;
|
||||
if ((p == NULL) || (s->length < 14))
|
||||
{
|
||||
@@ -268,6 +222,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
|
||||
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
|
||||
{
|
||||
struct tm *tm;
|
||||
struct tm data;
|
||||
int offset;
|
||||
int year;
|
||||
|
||||
@@ -284,11 +239,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
|
||||
|
||||
t -= offset*60; /* FIXME: may overflow in extreme cases */
|
||||
|
||||
#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__)
|
||||
{ struct tm data; gmtime_r(&t, &data); tm = &data; }
|
||||
#else
|
||||
tm = gmtime(&t);
|
||||
#endif
|
||||
tm = OPENSSL_gmtime(&t, &data);
|
||||
|
||||
#define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
|
||||
year = g2(s->data);
|
||||
|
||||
@@ -81,6 +81,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
|
||||
unsigned char *p,*buf_in=NULL;
|
||||
int ret= -1,i,inl;
|
||||
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
i=OBJ_obj2nid(a->algorithm);
|
||||
type=EVP_get_digestbyname(OBJ_nid2sn(i));
|
||||
if (type == NULL)
|
||||
@@ -99,7 +100,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
|
||||
p=buf_in;
|
||||
|
||||
i2d(data,&p);
|
||||
EVP_VerifyInit(&ctx,type);
|
||||
EVP_VerifyInit_ex(&ctx,type, NULL);
|
||||
EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl);
|
||||
|
||||
memset(buf_in,0,(unsigned int)inl);
|
||||
@@ -117,6 +118,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
|
||||
/* memset(&ctx,0,sizeof(ctx)); */
|
||||
ret=1;
|
||||
err:
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -131,6 +133,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat
|
||||
unsigned char *buf_in=NULL;
|
||||
int ret= -1,i,inl;
|
||||
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
i=OBJ_obj2nid(a->algorithm);
|
||||
type=EVP_get_digestbyname(OBJ_nid2sn(i));
|
||||
if (type == NULL)
|
||||
@@ -147,7 +150,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat
|
||||
goto err;
|
||||
}
|
||||
|
||||
EVP_VerifyInit(&ctx,type);
|
||||
EVP_VerifyInit_ex(&ctx,type, NULL);
|
||||
EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl);
|
||||
|
||||
memset(buf_in,0,(unsigned int)inl);
|
||||
@@ -165,6 +168,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat
|
||||
/* memset(&ctx,0,sizeof(ctx)); */
|
||||
ret=1;
|
||||
err:
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
#include <openssl/e_os2.h>
|
||||
#include <openssl/ossl_typ.h>
|
||||
|
||||
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
||||
# undef OPENSSL_EXTERN
|
||||
@@ -246,44 +247,6 @@ DECLARE_STACK_OF(ASN1_STRING_TABLE)
|
||||
#define ub_title 64
|
||||
#define ub_email_address 128
|
||||
|
||||
#ifdef NO_ASN1_TYPEDEFS
|
||||
#define ASN1_INTEGER ASN1_STRING
|
||||
#define ASN1_ENUMERATED ASN1_STRING
|
||||
#define ASN1_BIT_STRING ASN1_STRING
|
||||
#define ASN1_OCTET_STRING ASN1_STRING
|
||||
#define ASN1_PRINTABLESTRING ASN1_STRING
|
||||
#define ASN1_T61STRING ASN1_STRING
|
||||
#define ASN1_IA5STRING ASN1_STRING
|
||||
#define ASN1_UTCTIME ASN1_STRING
|
||||
#define ASN1_GENERALIZEDTIME ASN1_STRING
|
||||
#define ASN1_TIME ASN1_STRING
|
||||
#define ASN1_GENERALSTRING ASN1_STRING
|
||||
#define ASN1_UNIVERSALSTRING ASN1_STRING
|
||||
#define ASN1_BMPSTRING ASN1_STRING
|
||||
#define ASN1_VISIBLESTRING ASN1_STRING
|
||||
#define ASN1_UTF8STRING ASN1_STRING
|
||||
#define ASN1_BOOLEAN int
|
||||
#define ASN1_NULL int
|
||||
#else
|
||||
typedef struct asn1_string_st ASN1_INTEGER;
|
||||
typedef struct asn1_string_st ASN1_ENUMERATED;
|
||||
typedef struct asn1_string_st ASN1_BIT_STRING;
|
||||
typedef struct asn1_string_st ASN1_OCTET_STRING;
|
||||
typedef struct asn1_string_st ASN1_PRINTABLESTRING;
|
||||
typedef struct asn1_string_st ASN1_T61STRING;
|
||||
typedef struct asn1_string_st ASN1_IA5STRING;
|
||||
typedef struct asn1_string_st ASN1_GENERALSTRING;
|
||||
typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
|
||||
typedef struct asn1_string_st ASN1_BMPSTRING;
|
||||
typedef struct asn1_string_st ASN1_UTCTIME;
|
||||
typedef struct asn1_string_st ASN1_TIME;
|
||||
typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
|
||||
typedef struct asn1_string_st ASN1_VISIBLESTRING;
|
||||
typedef struct asn1_string_st ASN1_UTF8STRING;
|
||||
typedef int ASN1_BOOLEAN;
|
||||
typedef int ASN1_NULL;
|
||||
#endif
|
||||
|
||||
/* Declarations for template structures: for full definitions
|
||||
* see asn1t.h
|
||||
*/
|
||||
@@ -477,6 +440,8 @@ typedef const ASN1_ITEM * ASN1_ITEM_EXP(void);
|
||||
DECLARE_STACK_OF(ASN1_INTEGER)
|
||||
DECLARE_ASN1_SET_OF(ASN1_INTEGER)
|
||||
|
||||
DECLARE_STACK_OF(ASN1_GENERALSTRING)
|
||||
|
||||
typedef struct asn1_type_st
|
||||
{
|
||||
int type;
|
||||
@@ -808,6 +773,7 @@ int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b);
|
||||
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, unsigned char *data, int len);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
|
||||
@@ -822,6 +788,7 @@ DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
|
||||
@@ -922,8 +889,6 @@ void ASN1_HEADER_free(ASN1_HEADER *a);
|
||||
|
||||
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
|
||||
|
||||
void ERR_load_ASN1_strings(void);
|
||||
|
||||
/* Not used that much at this point, except for the first two */
|
||||
ASN1_METHOD *X509_asn1_meth(void);
|
||||
ASN1_METHOD *RSAPrivateKey_asn1_meth(void);
|
||||
@@ -971,11 +936,13 @@ void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
|
||||
ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, unsigned char **in, long len, const ASN1_ITEM *it);
|
||||
int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
||||
|
||||
void ASN1_add_oid_module(void);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_ASN1_strings(void);
|
||||
|
||||
/* Error codes for the ASN1 functions. */
|
||||
|
||||
@@ -1047,6 +1014,7 @@ int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
||||
#define ASN1_F_I2D_PUBLICKEY 164
|
||||
#define ASN1_F_I2D_RSA_PUBKEY 165
|
||||
#define ASN1_F_LONG_C2I 166
|
||||
#define ASN1_F_OID_MODULE_INIT 174
|
||||
#define ASN1_F_PKCS5_PBE2_SET 167
|
||||
#define ASN1_F_X509_CINF_NEW 168
|
||||
#define ASN1_F_X509_CRL_ADD0_REVOKED 169
|
||||
@@ -1056,6 +1024,7 @@ int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
||||
#define ASN1_F_X509_PKEY_NEW 173
|
||||
|
||||
/* Reason codes. */
|
||||
#define ASN1_R_ADDING_OBJECT 171
|
||||
#define ASN1_R_AUX_ERROR 100
|
||||
#define ASN1_R_BAD_CLASS 101
|
||||
#define ASN1_R_BAD_OBJECT_HEADER 102
|
||||
@@ -1069,6 +1038,7 @@ int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
||||
#define ASN1_R_DECODE_ERROR 110
|
||||
#define ASN1_R_DECODING_ERROR 111
|
||||
#define ASN1_R_ENCODE_ERROR 112
|
||||
#define ASN1_R_ERROR_LOADING_SECTION 172
|
||||
#define ASN1_R_ERROR_PARSING_SET_ELEMENT 113
|
||||
#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
|
||||
#define ASN1_R_EXPECTING_AN_INTEGER 115
|
||||
@@ -1132,4 +1102,3 @@ int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
|
||||
{ERR_PACK(0,ASN1_F_I2D_PUBLICKEY,0), "i2d_PublicKey"},
|
||||
{ERR_PACK(0,ASN1_F_I2D_RSA_PUBKEY,0), "i2d_RSA_PUBKEY"},
|
||||
{ERR_PACK(0,ASN1_F_LONG_C2I,0), "LONG_C2I"},
|
||||
{ERR_PACK(0,ASN1_F_OID_MODULE_INIT,0), "OID_MODULE_INIT"},
|
||||
{ERR_PACK(0,ASN1_F_PKCS5_PBE2_SET,0), "PKCS5_pbe2_set"},
|
||||
{ERR_PACK(0,ASN1_F_X509_CINF_NEW,0), "X509_CINF_NEW"},
|
||||
{ERR_PACK(0,ASN1_F_X509_CRL_ADD0_REVOKED,0), "X509_CRL_add0_revoked"},
|
||||
@@ -145,6 +146,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
|
||||
|
||||
static ERR_STRING_DATA ASN1_str_reasons[]=
|
||||
{
|
||||
{ASN1_R_ADDING_OBJECT ,"adding object"},
|
||||
{ASN1_R_AUX_ERROR ,"aux error"},
|
||||
{ASN1_R_BAD_CLASS ,"bad class"},
|
||||
{ASN1_R_BAD_OBJECT_HEADER ,"bad object header"},
|
||||
@@ -158,6 +160,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
|
||||
{ASN1_R_DECODE_ERROR ,"decode error"},
|
||||
{ASN1_R_DECODING_ERROR ,"decoding error"},
|
||||
{ASN1_R_ENCODE_ERROR ,"encode error"},
|
||||
{ASN1_R_ERROR_LOADING_SECTION ,"error loading section"},
|
||||
{ASN1_R_ERROR_PARSING_SET_ELEMENT ,"error parsing set element"},
|
||||
{ASN1_R_ERROR_SETTING_CIPHER_PARAMS ,"error setting cipher params"},
|
||||
{ASN1_R_EXPECTING_AN_INTEGER ,"expecting an integer"},
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include <stdio.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/asn1_mac.h>
|
||||
|
||||
static int asn1_get_length(unsigned char **pp,int *inf,long *rl,int max);
|
||||
static void asn1_put_length(unsigned char **pp, int length);
|
||||
|
||||
@@ -780,6 +780,12 @@ typedef struct ASN1_AUX_st {
|
||||
return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
|
||||
}
|
||||
|
||||
#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
|
||||
stname * stname##_dup(stname *x) \
|
||||
{ \
|
||||
return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
|
||||
}
|
||||
|
||||
#define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
|
||||
IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
|
||||
|
||||
|
||||
95
crypto/asn1/asn_moid.c
Normal file
95
crypto/asn1/asn_moid.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/* asn_moid.c */
|
||||
/* Written by Stephen Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
* project 2001.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/dso.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
/* Simple ASN1 OID module: add all objects in a given section */
|
||||
|
||||
static int oid_module_init(CONF_IMODULE *md, const CONF *cnf)
|
||||
{
|
||||
int i;
|
||||
const char *oid_section;
|
||||
STACK_OF(CONF_VALUE) *sktmp;
|
||||
CONF_VALUE *oval;
|
||||
oid_section = CONF_imodule_get_value(md);
|
||||
if(!(sktmp = NCONF_get_section(cnf, oid_section)))
|
||||
{
|
||||
ASN1err(ASN1_F_OID_MODULE_INIT, ASN1_R_ERROR_LOADING_SECTION);
|
||||
return 0;
|
||||
}
|
||||
for(i = 0; i < sk_CONF_VALUE_num(sktmp); i++)
|
||||
{
|
||||
oval = sk_CONF_VALUE_value(sktmp, i);
|
||||
if(OBJ_create(oval->value, oval->name, oval->name) == NID_undef)
|
||||
{
|
||||
ASN1err(ASN1_F_OID_MODULE_INIT, ASN1_R_ADDING_OBJECT);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ASN1_add_oid_module(void)
|
||||
{
|
||||
CONF_module_add("oid_section", oid_module_init, 0);
|
||||
}
|
||||
@@ -62,6 +62,12 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/asn1.h>
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
#include <openssl/rsa.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
#include <openssl/dsa.h>
|
||||
#endif
|
||||
|
||||
EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp,
|
||||
long length)
|
||||
|
||||
@@ -62,6 +62,12 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/asn1.h>
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
#include <openssl/rsa.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
#include <openssl/dsa.h>
|
||||
#endif
|
||||
|
||||
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
|
||||
long length)
|
||||
|
||||
@@ -61,6 +61,12 @@
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/objects.h>
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
#include <openssl/rsa.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DSA
|
||||
#include <openssl/dsa.h>
|
||||
#endif
|
||||
|
||||
int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user