Compare commits
691 Commits
OpenSSL_0_
...
OpenSSL_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1a426ea20 | ||
|
|
4f07317ffa | ||
|
|
cde28e18bf | ||
|
|
6209ada910 | ||
|
|
2e904727c2 | ||
|
|
1a8b087ad7 | ||
|
|
5ee6cc1162 | ||
|
|
a5770be6ae | ||
|
|
0a9d53e9eb | ||
|
|
688938fbb4 | ||
|
|
9b95f1df4b | ||
|
|
94de04192d | ||
|
|
1070e0e2ee | ||
|
|
1b199605c4 | ||
|
|
f27e41349f | ||
|
|
775c63fc02 | ||
|
|
db209ec295 | ||
|
|
0202197dbf | ||
|
|
63933136ab | ||
|
|
6ee6fdf555 | ||
|
|
c131593d48 | ||
|
|
6d0d5431d4 | ||
|
|
7bd3a58022 | ||
|
|
921c9bd539 | ||
|
|
8072c135cb | ||
|
|
1472f300d5 | ||
|
|
60b8e17568 | ||
|
|
a1990dd76d | ||
|
|
cb464c38b2 | ||
|
|
9a5a7401e9 | ||
|
|
234b5e9611 | ||
|
|
8ab59e7a49 | ||
|
|
668ba7d63f | ||
|
|
c7cb16a8ff | ||
|
|
47c177c7b3 | ||
|
|
b755955a53 | ||
|
|
7c0dc41c38 | ||
|
|
1b8b0a8294 | ||
|
|
c29b6d560b | ||
|
|
1340db6569 | ||
|
|
9da65c3280 | ||
|
|
dc8c8cda4d | ||
|
|
2d2d31394a | ||
|
|
1e7396beeb | ||
|
|
582afb4bd7 | ||
|
|
f63500c09c | ||
|
|
f36e02b2ef | ||
|
|
3e0f27f3c9 | ||
|
|
17dddc0596 | ||
|
|
b91f8a482c | ||
|
|
e0b8b39f3a | ||
|
|
87a025cbb4 | ||
|
|
3167f68faf | ||
|
|
d52c973498 | ||
|
|
dbe7113308 | ||
|
|
1c890fa864 | ||
|
|
b08b07b8ae | ||
|
|
4621a00063 | ||
|
|
7dce5a727a | ||
|
|
3813046dc5 | ||
|
|
a6fc578bd5 | ||
|
|
e01eed0fae | ||
|
|
5946ede512 | ||
|
|
e5599db448 | ||
|
|
26fb2b4b44 | ||
|
|
5e7bec63eb | ||
|
|
4101054ab5 | ||
|
|
fea217f96f | ||
|
|
cacbb51ee1 | ||
|
|
40134e22d0 | ||
|
|
a3b17baf4e | ||
|
|
b478e91fda | ||
|
|
935a50e886 | ||
|
|
b05c7211cb | ||
|
|
c6709c6b0f | ||
|
|
fbb41ae0ad | ||
|
|
766d78c8f5 | ||
|
|
c04949e978 | ||
|
|
505b5a0ee0 | ||
|
|
e8973060ee | ||
|
|
a3321387c1 | ||
|
|
9fd4ee5d7c | ||
|
|
f6de86dc3d | ||
|
|
1a33f6da8b | ||
|
|
0dd0cbf554 | ||
|
|
a610374cb2 | ||
|
|
a7b991bd68 | ||
|
|
a4cfd178f9 | ||
|
|
2c0ff02fba | ||
|
|
29a5374fb6 | ||
|
|
4d524e10b4 | ||
|
|
c6a33c6f61 | ||
|
|
07fb39c32e | ||
|
|
8d5b4ee1ca | ||
|
|
331b59214b | ||
|
|
4c5fac4ac4 | ||
|
|
390ead1e9a | ||
|
|
ac9c1bcb81 | ||
|
|
4ec2d4d2b3 | ||
|
|
5921ea3bcf | ||
|
|
2dbb3ccd5c | ||
|
|
9f7f1ff75e | ||
|
|
b6891e9c35 | ||
|
|
d7f0ab5ff4 | ||
|
|
49976df599 | ||
|
|
e6a58767c5 | ||
|
|
9ae2ad23e6 | ||
|
|
4a26329b4c | ||
|
|
71308c3bb5 | ||
|
|
720b590f56 | ||
|
|
cdf20e0839 | ||
|
|
88886fd305 | ||
|
|
2b670ea298 | ||
|
|
be7ae17560 | ||
|
|
c1ce32f1bf | ||
|
|
f9a7c34f4b | ||
|
|
41e68ef25f | ||
|
|
3142c86d65 | ||
|
|
4b42658082 | ||
|
|
3f2b5a88ad | ||
|
|
43e9d805e8 | ||
|
|
de4b598946 | ||
|
|
17ef291661 | ||
|
|
261b5d96ad | ||
|
|
fc6d523f0a | ||
|
|
72b60351f1 | ||
|
|
1b8a8088a5 | ||
|
|
a2a0158959 | ||
|
|
e7ecc7d4dd | ||
|
|
8bd5b7944e | ||
|
|
745c70e565 | ||
|
|
9dd2b2a940 | ||
|
|
10a926c1eb | ||
|
|
d3442bc780 | ||
|
|
dab6f09573 | ||
|
|
45206340d3 | ||
|
|
b35e9050f2 | ||
|
|
9f7b1b24e2 | ||
|
|
4ec19e203c | ||
|
|
d754b3850f | ||
|
|
853f757ece | ||
|
|
ae1bb4e572 | ||
|
|
fb77c6fb45 | ||
|
|
7fa1343e93 | ||
|
|
ad86060357 | ||
|
|
e5b4462f47 | ||
|
|
26dc267f8c | ||
|
|
a91451ef13 | ||
|
|
fb044c592d | ||
|
|
4328d51d08 | ||
|
|
8a208cba97 | ||
|
|
5c2ec54f12 | ||
|
|
73c5591944 | ||
|
|
c417db4675 | ||
|
|
671cf7f54a | ||
|
|
cd3c54e50f | ||
|
|
a3fe382e2d | ||
|
|
bd03b99b9b | ||
|
|
8691ff97a1 | ||
|
|
bd44570322 | ||
|
|
e1c55191cb | ||
|
|
02d034cc24 | ||
|
|
2aca27a9a8 | ||
|
|
bc80c86031 | ||
|
|
f8bbcf3af0 | ||
|
|
89cee61b45 | ||
|
|
de469ef21e | ||
|
|
ea96c4bc7f | ||
|
|
207c7df746 | ||
|
|
5f5b8d2bcd | ||
|
|
c6ce792fc5 | ||
|
|
c9080477ec | ||
|
|
bcba6cc60f | ||
|
|
d13e4eb0b5 | ||
|
|
07fc35519e | ||
|
|
3ebf0be142 | ||
|
|
cbcc5c01f9 | ||
|
|
e6e7b5f3df | ||
|
|
b1f8affbd5 | ||
|
|
efb416299f | ||
|
|
f6814ea43a | ||
|
|
5160448b98 | ||
|
|
667ac4ec6a | ||
|
|
bb325c7d6a | ||
|
|
0a751d8ce8 | ||
|
|
a5d9c6e4fe | ||
|
|
8ce288a881 | ||
|
|
cf0694015e | ||
|
|
0cd4498b8f | ||
|
|
f07fb9b24b | ||
|
|
1e8f28c491 | ||
|
|
7948febeca | ||
|
|
ff8a4c47ce | ||
|
|
4e539aaa1e | ||
|
|
4facdbb5fa | ||
|
|
1c6fbf9ea2 | ||
|
|
3cbe1980fd | ||
|
|
6d9ca500d8 | ||
|
|
fcb20be846 | ||
|
|
cae55bfc68 | ||
|
|
0fad6cb7e7 | ||
|
|
7cf6e2a35b | ||
|
|
8652d1c22e | ||
|
|
4a6222d71b | ||
|
|
e290c7d4e0 | ||
|
|
29a28ee503 | ||
|
|
66430207a4 | ||
|
|
eb5a6a55c5 | ||
|
|
37e48b88ad | ||
|
|
6535eb1728 | ||
|
|
9b141126d4 | ||
|
|
7e708ebee0 | ||
|
|
c236e66d62 | ||
|
|
981b87f712 | ||
|
|
d716308288 | ||
|
|
af57d84312 | ||
|
|
53002dc691 | ||
|
|
f50c049707 | ||
|
|
b136aa5423 | ||
|
|
ce76ce43ae | ||
|
|
b20b78b720 | ||
|
|
657e60fa00 | ||
|
|
9dbc41d7ee | ||
|
|
82fc1d9c28 | ||
|
|
7999c65c9b | ||
|
|
bfe30e4d1b | ||
|
|
aff0825c61 | ||
|
|
e74231ed9e | ||
|
|
fb81ac5e6b | ||
|
|
54a34aecc3 | ||
|
|
1399f17a07 | ||
|
|
0bde1089f8 | ||
|
|
cf802b983f | ||
|
|
20ead2c6f7 | ||
|
|
fef47a1d1e | ||
|
|
ee25d40bea | ||
|
|
cb5b7850ac | ||
|
|
fe7cd1647d | ||
|
|
1c8337abe3 | ||
|
|
2c5fe5b12a | ||
|
|
f40c02d908 | ||
|
|
8efb60144d | ||
|
|
388f2f56f2 | ||
|
|
f5a8d67872 | ||
|
|
89ec98e0ce | ||
|
|
6671fe16ee | ||
|
|
4e3b0992da | ||
|
|
98d0b2e375 | ||
|
|
51ca375e7e | ||
|
|
1749d8a039 | ||
|
|
9d1a01be8f | ||
|
|
74235cc9ec | ||
|
|
da0fc5bf0f | ||
|
|
cdd43b5ba5 | ||
|
|
1baa94907c | ||
|
|
7865b871c0 | ||
|
|
a87030a1ed | ||
|
|
15701211b5 | ||
|
|
1e264ff325 | ||
|
|
f27c5509f7 | ||
|
|
e1314b5716 | ||
|
|
07e6dbde66 | ||
|
|
1f36fe2835 | ||
|
|
aa3353fda2 | ||
|
|
2af9fd006d | ||
|
|
90644dd74d | ||
|
|
75b0edaafa | ||
|
|
f95a9f678a | ||
|
|
0b3300f866 | ||
|
|
953aa79040 | ||
|
|
01d16b54c2 | ||
|
|
3ac60a612e | ||
|
|
294b3c1a9c | ||
|
|
6c2c3e9ba9 | ||
|
|
157be2b67d | ||
|
|
5d6e31dbe6 | ||
|
|
38e33cef15 | ||
|
|
0c23524963 | ||
|
|
480116f062 | ||
|
|
2233bed1cb | ||
|
|
ec1258dd44 | ||
|
|
b99b110766 | ||
|
|
6e0cad8d34 | ||
|
|
5f5e96d92b | ||
|
|
38b1fa8995 | ||
|
|
387ca353fa | ||
|
|
d629757a84 | ||
|
|
fc58fa8bb8 | ||
|
|
e93f9a3284 | ||
|
|
bb075f8833 | ||
|
|
52732b38da | ||
|
|
ada3cc4a8f | ||
|
|
a598cd1ab4 | ||
|
|
2557eaeac8 | ||
|
|
a46faa2bfd | ||
|
|
aabbb7451b | ||
|
|
4a1a3440a4 | ||
|
|
1d7d74647a | ||
|
|
05ccd698b9 | ||
|
|
f13b93d3b4 | ||
|
|
7be5af1ddf | ||
|
|
baf32381b5 | ||
|
|
1675f6eb05 | ||
|
|
8548d44270 | ||
|
|
fd38fecc1a | ||
|
|
3bec05e933 | ||
|
|
223fc8654a | ||
|
|
0e930f25d2 | ||
|
|
dd9d233e2a | ||
|
|
dd8dec69b8 | ||
|
|
ce052b6c3b | ||
|
|
e84c2d2679 | ||
|
|
fabce04122 | ||
|
|
64287002ce | ||
|
|
c88a900fa1 | ||
|
|
2a99e8b9df | ||
|
|
99e812cb93 | ||
|
|
fcb76baeb0 | ||
|
|
4486d0cd7a | ||
|
|
09483c58e3 | ||
|
|
bda70ed430 | ||
|
|
018e57c74d | ||
|
|
3604a4d3d1 | ||
|
|
3779469192 | ||
|
|
0b5cfe32e9 | ||
|
|
cc8709a090 | ||
|
|
2c8aeddc5d | ||
|
|
720b3598d6 | ||
|
|
60b5245360 | ||
|
|
5d82c5b3f4 | ||
|
|
674b8eec4c | ||
|
|
033db22d57 | ||
|
|
af6f388180 | ||
|
|
af5eb82979 | ||
|
|
435b72dd4f | ||
|
|
8100490a72 | ||
|
|
dd46d58f65 | ||
|
|
e7f97e2d22 | ||
|
|
731d9c5fb5 | ||
|
|
4699af98e6 | ||
|
|
b25c8db872 | ||
|
|
b838465135 | ||
|
|
6481f3d29d | ||
|
|
4146aa6b42 | ||
|
|
4f392a200e | ||
|
|
97c1f605f4 | ||
|
|
281959aa61 | ||
|
|
6e6bc352b1 | ||
|
|
77b47b9036 | ||
|
|
721b5b2a5c | ||
|
|
a9188d4e17 | ||
|
|
ea5e7bcf63 | ||
|
|
c89cb36dbf | ||
|
|
7be760be38 | ||
|
|
7256ce6a8c | ||
|
|
fb8d5a16a3 | ||
|
|
9c86df6a98 | ||
|
|
2697557764 | ||
|
|
b058a08085 | ||
|
|
e7399bf592 | ||
|
|
cef80e8c14 | ||
|
|
aa82db4fb4 | ||
|
|
b0bb2b914a | ||
|
|
88618bac73 | ||
|
|
373b575f5a | ||
|
|
e1798f856d | ||
|
|
243ba4095c | ||
|
|
29ccd81f58 | ||
|
|
b9d82f4735 | ||
|
|
d593983da4 | ||
|
|
9597902a91 | ||
|
|
7d388202bd | ||
|
|
691401fc53 | ||
|
|
4fd2ead09d | ||
|
|
b46c3e9b69 | ||
|
|
ed84dfab00 | ||
|
|
375a7a9383 | ||
|
|
105c0be00f | ||
|
|
7f5b6f0f19 | ||
|
|
0c50e02b30 | ||
|
|
a8eeb155b5 | ||
|
|
2f878669b7 | ||
|
|
f2b86c955c | ||
|
|
11afb40c01 | ||
|
|
2c736d077b | ||
|
|
0983760dfc | ||
|
|
a873356c00 | ||
|
|
eb952088f0 | ||
|
|
22e219d90f | ||
|
|
036c8d7e7b | ||
|
|
6a3fff5ecf | ||
|
|
76aa0ddc86 | ||
|
|
e4b7645631 | ||
|
|
90308e7072 | ||
|
|
2186cd8ef1 | ||
|
|
de73e397f8 | ||
|
|
cbfa4c32c0 | ||
|
|
f1d712ce80 | ||
|
|
cc96f6b7a4 | ||
|
|
3cc6cdea0f | ||
|
|
c51ae173a6 | ||
|
|
7e3d8df1bb | ||
|
|
efeca6aa32 | ||
|
|
4b08eaf5c7 | ||
|
|
25f923ddd1 | ||
|
|
150a4320d8 | ||
|
|
a2151c5b9a | ||
|
|
752d706aaf | ||
|
|
c3ed3b6eab | ||
|
|
c708302516 | ||
|
|
3ea4404fd7 | ||
|
|
7328b0a89d | ||
|
|
ef7eaa4cb0 | ||
|
|
dad666fbbe | ||
|
|
5b58baee3c | ||
|
|
69396b4199 | ||
|
|
918a8a16fa | ||
|
|
d2b6c3f31f | ||
|
|
63da21c01b | ||
|
|
b64e735b08 | ||
|
|
9ea76b951d | ||
|
|
0f583f69f3 | ||
|
|
fc6be0fa56 | ||
|
|
2fdf5d7c23 | ||
|
|
1f2f922455 | ||
|
|
19d2bb574b | ||
|
|
35f4850ae0 | ||
|
|
add9e2544a | ||
|
|
b38f9f66c3 | ||
|
|
ca03109c3a | ||
|
|
9fb617e252 | ||
|
|
f2d9a32cf4 | ||
|
|
245206eadd | ||
|
|
c44f754047 | ||
|
|
023f77002f | ||
|
|
3a4f14f3d1 | ||
|
|
37b0d5d05d | ||
|
|
1eab9a1fbb | ||
|
|
2e97d4f9f5 | ||
|
|
bdf5e18317 | ||
|
|
3d14b9d04a | ||
|
|
20432eae41 | ||
|
|
47134b7864 | ||
|
|
45fd4dbb84 | ||
|
|
9535f8c165 | ||
|
|
891e465607 | ||
|
|
f45f40ffff | ||
|
|
6447cce372 | ||
|
|
76997b7dd0 | ||
|
|
e6f3c5850e | ||
|
|
b96eb06f79 | ||
|
|
36217a9424 | ||
|
|
12aefe78f0 | ||
|
|
525f51f6c9 | ||
|
|
78baa17ad0 | ||
|
|
a9e9db8153 | ||
|
|
e76f935ead | ||
|
|
15df5802fd | ||
|
|
099bf0e959 | ||
|
|
404fb7149e | ||
|
|
a7c5241f5f | ||
|
|
099f1b32c8 | ||
|
|
9a1e34e5de | ||
|
|
2b6313d0da | ||
|
|
75acc288ca | ||
|
|
0cd08cce17 | ||
|
|
03c48fa07b | ||
|
|
f3a2a04496 | ||
|
|
d8df48a9bc | ||
|
|
78bf1920a2 | ||
|
|
3db1f2d5be | ||
|
|
e8f48dbacc | ||
|
|
08807172b2 | ||
|
|
9ac42ed8fc | ||
|
|
1ad9bdf253 | ||
|
|
8a1580096b | ||
|
|
a5ec86d16c | ||
|
|
1887988497 | ||
|
|
3fc9635ea7 | ||
|
|
3b14cb717d | ||
|
|
55f30198ad | ||
|
|
2449961ab2 | ||
|
|
b216664f66 | ||
|
|
d8223efd04 | ||
|
|
e3775a33c1 | ||
|
|
a4af39ac44 | ||
|
|
63daa2aaf4 | ||
|
|
a2121e0aee | ||
|
|
55ec5861c8 | ||
|
|
5a9a4b299c | ||
|
|
bc3baeacca | ||
|
|
9f382899b2 | ||
|
|
cd9860af26 | ||
|
|
23fb9bc0eb | ||
|
|
cddfe788fb | ||
|
|
21131f00d7 | ||
|
|
6ea5314007 | ||
|
|
dd4134101f | ||
|
|
08cba61011 | ||
|
|
fea9afbfc7 | ||
|
|
5f2f0b5596 | ||
|
|
7b418a474c | ||
|
|
bb7cd4e3eb | ||
|
|
13938aceca | ||
|
|
51630a3706 | ||
|
|
74ecf9e2bb | ||
|
|
21f775522b | ||
|
|
9868232ae1 | ||
|
|
d4cec6a13d | ||
|
|
1126239111 | ||
|
|
6d3724d3b0 | ||
|
|
52664f5081 | ||
|
|
a716d72734 | ||
|
|
44eca70641 | ||
|
|
5ef738240a | ||
|
|
1088e27ca8 | ||
|
|
4f23052492 | ||
|
|
f76d8c4747 | ||
|
|
b1fe6ca175 | ||
|
|
91895a5938 | ||
|
|
6d1b637ba1 | ||
|
|
fd699ac55f | ||
|
|
e947f39689 | ||
|
|
b7cfcfb7f8 | ||
|
|
06556a1744 | ||
|
|
4abc5c624a | ||
|
|
a0e9f529a4 | ||
|
|
0286d94454 | ||
|
|
938ead8f88 | ||
|
|
6828f02c9a | ||
|
|
47d216940c | ||
|
|
01aad2c80a | ||
|
|
71d7526b72 | ||
|
|
1f575f1b1d | ||
|
|
f18a93ab04 | ||
|
|
03da458a06 | ||
|
|
f48158b854 | ||
|
|
b3e1a4c68c | ||
|
|
849c0fe240 | ||
|
|
ca0e2bc973 | ||
|
|
13427e4561 | ||
|
|
02ab618c97 | ||
|
|
82a2d07262 | ||
|
|
c96ab5101a | ||
|
|
954ef7ef69 | ||
|
|
c4471290c0 | ||
|
|
5e76807bbd | ||
|
|
af29811edd | ||
|
|
53b1899e3c | ||
|
|
174a4a8c89 | ||
|
|
aba3e65f2c | ||
|
|
0d9cfe1ae7 | ||
|
|
95fdc5eef9 | ||
|
|
5fe2085bba | ||
|
|
a0ad17bb6c | ||
|
|
ce1b4fe146 | ||
|
|
ce2c95b2a2 | ||
|
|
b05eaeb545 | ||
|
|
9716a8f9f2 | ||
|
|
74400f7348 | ||
|
|
62ac293801 | ||
|
|
c1e744b912 | ||
|
|
847c52e47f | ||
|
|
99e87569fd | ||
|
|
640588bbfb | ||
|
|
a31011e8e0 | ||
|
|
38899535f8 | ||
|
|
b6b1f0d0aa | ||
|
|
798757762a | ||
|
|
a5fcd09e75 | ||
|
|
f769ce3ea4 | ||
|
|
042a93e443 | ||
|
|
cbb448c945 | ||
|
|
462f79ec44 | ||
|
|
08e9c1af6c | ||
|
|
023c8d0b0a | ||
|
|
673b102c5b | ||
|
|
56a3fec1b1 | ||
|
|
4654ef985b | ||
|
|
0b62b30233 | ||
|
|
7e102e28e1 | ||
|
|
2dae04d038 | ||
|
|
def38e38ec | ||
|
|
d71c6bc5a4 | ||
|
|
2d681b779c | ||
|
|
3908cdf442 | ||
|
|
3ea23631d4 | ||
|
|
393f2c651d | ||
|
|
f846335657 | ||
|
|
2b024cd242 | ||
|
|
18c77bf29e | ||
|
|
4579dd5dc6 | ||
|
|
c91e125934 | ||
|
|
d4cf2f1882 | ||
|
|
de808df47b | ||
|
|
8e1589ece5 | ||
|
|
49e747e670 | ||
|
|
39b30b6ab7 | ||
|
|
e405b8d120 | ||
|
|
6cc4ee03df | ||
|
|
8569c322be | ||
|
|
dd73193c83 | ||
|
|
4ad378ea43 | ||
|
|
0ca6d7c6b1 | ||
|
|
0f7e6fe10c | ||
|
|
ca7fea9656 | ||
|
|
eb02599870 | ||
|
|
f4e723f3e7 | ||
|
|
96c2201bef | ||
|
|
cd357c75b2 | ||
|
|
06f4536a61 | ||
|
|
bf1966354a | ||
|
|
1c80019a2c | ||
|
|
090d848ea8 | ||
|
|
9a0f732d75 | ||
|
|
d79812b0fa | ||
|
|
0d3118bed3 | ||
|
|
4dd60b3b96 | ||
|
|
d0f2876c3f | ||
|
|
ac7da00048 | ||
|
|
17f389bbbf | ||
|
|
5bdae1675c | ||
|
|
cb0369d885 | ||
|
|
778f1092dd | ||
|
|
5671876d1d | ||
|
|
6f7af1524e | ||
|
|
ac3e3cdc96 | ||
|
|
953ad1bc10 | ||
|
|
c82c1d4a9d | ||
|
|
63d3f44abf | ||
|
|
d680ba8617 | ||
|
|
396f631458 | ||
|
|
0d64ea89f7 | ||
|
|
c1cd88a0eb | ||
|
|
4a61a64f50 | ||
|
|
6882a96446 | ||
|
|
c1082a90bb | ||
|
|
b7d7440cf5 | ||
|
|
9bb2560cf7 | ||
|
|
b82ccbb7a0 | ||
|
|
a785abc324 | ||
|
|
092ec334f0 | ||
|
|
232616efce | ||
|
|
a32640b0f4 | ||
|
|
69fb1c3f9d | ||
|
|
7f7c318cfc | ||
|
|
aef838fc95 | ||
|
|
b74ba295da | ||
|
|
ba3a6e7262 | ||
|
|
f70df1b887 | ||
|
|
074309b7ee | ||
|
|
77fa04a9bc | ||
|
|
497cc4b35e | ||
|
|
1e4149350c | ||
|
|
8ce97163a2 | ||
|
|
ac8b4ee04a | ||
|
|
2d4287da34 | ||
|
|
2d0c55eda2 | ||
|
|
28e0be13f6 | ||
|
|
b357e95cc4 | ||
|
|
1cbde6e4fa | ||
|
|
87a25f9032 | ||
|
|
f9150e5421 | ||
|
|
c79b16e11d | ||
|
|
43ca6c02dc | ||
|
|
0bbd03525e | ||
|
|
7b65c3298f | ||
|
|
13066cee60 | ||
|
|
c0711f7f0f | ||
|
|
8484721adb | ||
|
|
de1915e48c | ||
|
|
6e4a3b5529 | ||
|
|
c6c3450643 | ||
|
|
2cfa692136 | ||
|
|
364836ca1c | ||
|
|
0b7618888b | ||
|
|
5c1d0b314a | ||
|
|
2b7af70139 | ||
|
|
1bf0b46b13 | ||
|
|
27ad06a627 | ||
|
|
cab161c85f | ||
|
|
99cc4f075c | ||
|
|
690233bccc | ||
|
|
fd52057729 | ||
|
|
8b94634428 | ||
|
|
019a7aba4a | ||
|
|
87c49f622e | ||
|
|
29159a42d2 | ||
|
|
1b1a6e7808 | ||
|
|
385be6eb20 | ||
|
|
d91e201e96 |
@@ -4,3 +4,8 @@ makefile.one
|
||||
tmp
|
||||
out
|
||||
outinc
|
||||
rehash.time
|
||||
testlog
|
||||
make.log
|
||||
cctest
|
||||
cctest.c
|
||||
|
||||
282
Configure
282
Configure
@@ -51,6 +51,10 @@ my $usage="Usage: Configure [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no
|
||||
# RC4_LONG use 'long' instead of 'int' for RC4_INT in crypto/rc4/rc4.h
|
||||
# RC4_INDEX define RC4_INDEX in crypto/rc4/rc4_locl.h. This turns on
|
||||
# array lookups instead of pointer use.
|
||||
# RC4_CHUNK enables code that handles data aligned at long (natural CPU
|
||||
# word) boundary.
|
||||
# RC4_CHUNK_LL enables code that handles data aligned at long long boundary
|
||||
# (intended for 64-bit CPUs running 32-bit OS).
|
||||
# BF_PTR use 'pointer arithmatic' for Blowfish (unsafe on Alpha).
|
||||
# BF_PTR2 intel specific version (generic version is more efficient).
|
||||
# MD5_ASM use some extra md5 assember,
|
||||
@@ -82,8 +86,8 @@ my $x86_bsdi_asm="asm/bn86bsdi.o asm/co86bsdi.o:asm/dx86bsdi.o asm/yx86bsdi.o:as
|
||||
# -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 : LDFLAGS : special header file mods:bn_asm \
|
||||
# des_asm:bf_asm
|
||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $lflags : $bn_ops : $bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj
|
||||
|
||||
my %table=(
|
||||
#"b", "$tcc:$tflags::$tlib:$bits1:$tbn_mul::",
|
||||
#"bl-4c-2c", "$tcc:$tflags::$tlib:${bits1}BN_LLONG RC4_CHAR MD2_CHAR:$tbn_mul::",
|
||||
@@ -92,80 +96,123 @@ my %table=(
|
||||
|
||||
# Our development configs
|
||||
"purify", "purify gcc:-g -DPURIFY -Wall::(unknown):-lsocket -lnsl::::",
|
||||
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown):-lefence::::",
|
||||
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DPEDANTIC -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
|
||||
"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
|
||||
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown):::::",
|
||||
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown):-lefence::::",
|
||||
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
|
||||
"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
|
||||
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -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:-DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG_ALL -g -m486 -Wall::-D_REENTRANT::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
|
||||
"debug-bodo", "gcc:-DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -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 -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 -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::$x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
|
||||
"debug-levitte-linux-elf","gcc:-DRL_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:::",
|
||||
"dist", "cc:-O::(unknown):::::",
|
||||
|
||||
# Basic configs that should work on any box
|
||||
# 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-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_sol_asm",
|
||||
# -DNO_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 -DNO_INLINE_ASM::-D_REENTRANT:-lsocket -lnsl:BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_sol_asm",
|
||||
|
||||
#### SPARC Solaris with GNU C setups
|
||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:::",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8.o::",
|
||||
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o::",
|
||||
"solaris-sparcv9-gcc","gcc:-mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
|
||||
# but keep the assembler modules.
|
||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o:",
|
||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o:",
|
||||
####
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DREF_CHECK -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:::",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DREF_CHECK -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8plus.o::",
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o::",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o::",
|
||||
|
||||
#### 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:BN_LLONG RC4_CHAR DES_PTR DES_UNROLL BF_PTR:::",
|
||||
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:::",
|
||||
# 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:BN_LLONG RC4_CHAR DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o::",
|
||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:SIXTY_FOUR_BIT_LONG RC4_CHAR DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
||||
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::",
|
||||
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o::",
|
||||
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
||||
####
|
||||
"debug-solaris-sparcv8-cc","cc:-DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8.o::",
|
||||
"debug-solaris-sparcv9-cc","cc:-DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
|
||||
#### SPARC Linux setups
|
||||
"linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG RC4_CHAR DES_UNROLL BF_PTR::",
|
||||
"linux-sparcv7","gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::",
|
||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
||||
# 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 DES_UNROLL BF_PTR:asm/sparcv8.o::::",
|
||||
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o::::",
|
||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
||||
# -Wa,-Av8plus should do the trick no matter what.
|
||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR 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 -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o:",
|
||||
# !!!Folowing can't be even tested yet!!!
|
||||
# We have to wait till 64-bit glibc for SPARC is operational!!!
|
||||
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
||||
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
||||
|
||||
# Sunos configs, assuming sparc for the gcc one.
|
||||
##"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown)::DES_UNROLL:::",
|
||||
"sunos-gcc","gcc:-O3 -mv8::(unknown)::BN_LLONG RC4_CHAR DES_UNROLL DES_PTR DES_RISC1:::",
|
||||
"sunos-gcc","gcc:-O3 -mv8::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:::",
|
||||
|
||||
#### 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 DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR:::",
|
||||
"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:::",
|
||||
"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:::",
|
||||
#### 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::(unknown)::MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
|
||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::DES_PTR DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
|
||||
"irix-mips3-cc", "cc:-n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:asm/mips3.o::",
|
||||
# N64 ABI builds.
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN::(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::(unknown)::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:asm/mips3.o::",
|
||||
|
||||
#### Unified HP-UX ANSI C configs.
|
||||
# Special notes:
|
||||
# - Originally we were optimizing at +O4 level. It should be noted
|
||||
# that the only difference between +O3 and +O4 is global inter-
|
||||
# procedural analysis. As it has to be performed during the link
|
||||
# stage the compiler leaves behind certain pseudo-code in lib*.a
|
||||
# which might be release or even patch level specific. Generating
|
||||
# the machine code for and analyzing the *whole* program appears
|
||||
# to be *extremely* memory demanding while the performance gain is
|
||||
# actually questionable. The situation is intensified by the default
|
||||
# HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
|
||||
# which is way too low for +O4. In other words, doesn't +O3 make
|
||||
# more sense?
|
||||
# - 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'.
|
||||
# - +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
|
||||
# pass -D_REENTRANT on HP-UX 10 and later.
|
||||
# - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
|
||||
# 32-bit message digests. (For the moment of this writing) HP C
|
||||
# doesn't seem to "digest" too many local variables (they make "him"
|
||||
# chew forever:-). For more details look-up MD32_XARRAY comment in
|
||||
# crypto/sha/sha_lcl.h.
|
||||
# <appro@fy.chalmers.se>
|
||||
#
|
||||
"hpux-parisc-cc","cc:-Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::::BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::::BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:::",
|
||||
|
||||
# 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 -Ae +ESlit +O4 -z::(unknown)::BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
"hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown)::BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
# If hpux-cc fails (e.g. during "make test"), try the next one; otherwise,
|
||||
# please report your OS and compiler version to the bugs@openssl.org
|
||||
# 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)::DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
|
||||
@@ -174,7 +221,7 @@ my %table=(
|
||||
"hpux-brokengcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
|
||||
# HPUX 10.X config. Supports threads.
|
||||
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O4 -z::-D_REENTRANT::BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
"hpux10-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT::BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
# 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::BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
|
||||
@@ -184,30 +231,46 @@ my %table=(
|
||||
|
||||
# HPUX 11.X from www.globus.org.
|
||||
# Only works on PA-RISC 2.0 cpus, and not optimized. Why?
|
||||
"hpux11-32bit-cc","cc:+DA2.0 -DB_ENDIAN -D_HPUX_SOURCE -Aa -Ae +ESlit::-D_REENTRANT::DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
"hpux11-64bit-cc","cc:+DA2.0W -g -D_HPUX_SOURCE -Aa -Ae +ESlit::-D_REENTRANT::SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT :::",
|
||||
#"hpux11-32bit-cc","cc:+DA2.0 -DB_ENDIAN -D_HPUX_SOURCE -Aa -Ae +ESlit::-D_REENTRANT::DES_PTR DES_UNROLL DES_RISC1:::",
|
||||
#"hpux11-64bit-cc","cc:+DA2.0W -g -D_HPUX_SOURCE -Aa -Ae +ESlit::-D_REENTRANT::SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT :::",
|
||||
# Use unified settings above instead.
|
||||
|
||||
# Dec Alpha, OSF/1 - the alpha164-cc is the flags for a 21164A with
|
||||
# the new compiler
|
||||
# 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 DES_UNROLL DES_RISC1:::",
|
||||
"alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG:::",
|
||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG:::",
|
||||
"FreeBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:::",
|
||||
"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:asm/alpha.o::",
|
||||
"alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:asm/alpha.o::",
|
||||
"alpha164-cc", "cc:-std1 -tune host -fast -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK:asm/alpha.o::",
|
||||
"FreeBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2:::",
|
||||
|
||||
#### Alpha Linux with GNU C and Compaq C setups
|
||||
# Special notes:
|
||||
# - linux-alpha+bwx-gcc is ment to be used from ./config only. If you
|
||||
# ought to run './Configure linux-alpha+bwx-gcc' manually, do
|
||||
# complement the command line with -mcpu=ev56, -mcpu=ev6 or whatever
|
||||
# which is appropriate.
|
||||
# - If you use ccc keep in mind that -fast implies -arch host and the
|
||||
# compiler is free to issue instructions which gonna make elder CPU
|
||||
# choke. If you wish to build "blended" toolkit, add -arch generic
|
||||
# *after* -fast and invoke './Configure linux-alpha-ccc' manually.
|
||||
#
|
||||
# <appro@fy.chalmers.se>
|
||||
#
|
||||
"linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:asm/alpha.o::",
|
||||
"linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:asm/alpha.o::",
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::(unknown)::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::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:asm/alpha.o::",
|
||||
|
||||
# assembler versions -- currently defunct:
|
||||
##"alpha-gcc","gcc:-O3::(unknown)::SIXTY_FOUR_BIT_LONG DES_UNROLL DES_RISC1:asm/alpha.o::",
|
||||
##"alpha-cc", "cc:-tune host -O4 -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG:asm/alpha.o::",
|
||||
##"alpha164-cc", "cc:-tune host -fast -readonly_strings::(unknown)::SIXTY_FOUR_BIT_LONG:asm/alpha.o::",
|
||||
##"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:asm/alpha.o::",
|
||||
|
||||
# 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::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
|
||||
"debug-linux-elf","gcc:-DREF_CHECK -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT:-lefence:BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
|
||||
"debug-linux-elf","gcc:-DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall::-D_REENTRANT:-lefence:BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
|
||||
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_out_asm",
|
||||
"linux-mips", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::::",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
|
||||
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:::",
|
||||
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:::",
|
||||
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:",
|
||||
@@ -224,6 +287,9 @@ my %table=(
|
||||
"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}::",
|
||||
|
||||
# UnixWare 7
|
||||
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread:-lsocket -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::",
|
||||
|
||||
# IBM's AIX.
|
||||
"aix-cc", "cc:-O -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::",
|
||||
"aix-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::",
|
||||
@@ -249,7 +315,7 @@ my %table=(
|
||||
# for some st_addr stuff, and then sizeof and address-of fails
|
||||
# I could not use the ams/alpha.o option because the Cray assembler, 'cam'
|
||||
# did not like it.
|
||||
"cray-t3e", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT:::",
|
||||
"cray-t3e", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown)::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:::",
|
||||
|
||||
# DGUX, 88100.
|
||||
"dgux-R3-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::RC4_INDEX DES_UNROLL:::",
|
||||
@@ -268,7 +334,7 @@ my %table=(
|
||||
"SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown):-lucb:RC4_INDEX RC4_CHAR:::",
|
||||
|
||||
# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
|
||||
"BS2000-OSD","c89:-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:::",
|
||||
"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:::",
|
||||
|
||||
# Windows NT, Microsoft Visual C++ 4.0
|
||||
|
||||
@@ -301,6 +367,9 @@ my %table=(
|
||||
"OpenBSD", "gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown)::BN_LLONG RC2_CHAR RC4_INDEX DES_UNROLL:::",
|
||||
"OpenBSD-mips","gcc:-O2 -DL_ENDIAN::(unknown):BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR::::",
|
||||
|
||||
##### MacOS X (a.k.a. Rhapsody) setup
|
||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
|
||||
);
|
||||
|
||||
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
|
||||
@@ -337,12 +406,16 @@ my $ranlib;
|
||||
my $perl;
|
||||
|
||||
$ranlib=&which("ranlib") or $ranlib="true";
|
||||
$perl=&which("perl5") or $perl=&which("perl") or $perl="perl";
|
||||
$perl=$ENV{'PERL'} or $perl=&which("perl5") or $perl=&which("perl")
|
||||
or $perl="perl";
|
||||
|
||||
&usage if ($#ARGV < 0);
|
||||
|
||||
my $flags="";
|
||||
my $depflags="";
|
||||
my $openssl_algorithm_defines="";
|
||||
my $openssl_thread_defines="";
|
||||
my $openssl_other_defines="";
|
||||
my $libs="";
|
||||
my $target="";
|
||||
my $options="";
|
||||
@@ -352,6 +425,7 @@ foreach (@ARGV)
|
||||
{
|
||||
$no_asm=1;
|
||||
$flags .= "-DNO_ASM ";
|
||||
$openssl_other_defines .= "#define NO_ASM\n";
|
||||
}
|
||||
elsif (/^no-threads$/)
|
||||
{ $no_threads=1; }
|
||||
@@ -364,11 +438,14 @@ foreach (@ARGV)
|
||||
$algo =~ tr/[a-z]/[A-Z]/;
|
||||
$flags .= "-DNO_$algo ";
|
||||
$depflags .= "-DNO_$algo ";
|
||||
$openssl_algorithm_defines .= "#define NO_$algo\n";
|
||||
if ($algo eq "DES")
|
||||
{
|
||||
push @skip, "mdc2";
|
||||
$options .= " no-mdc2";
|
||||
$flags .= "-DNO_MDC2 ";
|
||||
$depflags .= "-DNO_MDC2 ";
|
||||
$openssl_algorithm_defines .= "#define NO_MDC2\n";
|
||||
}
|
||||
}
|
||||
elsif (/^386$/)
|
||||
@@ -377,6 +454,7 @@ foreach (@ARGV)
|
||||
{
|
||||
$libs.= "-lRSAglue -lrsaref ";
|
||||
$flags.= "-DRSAref ";
|
||||
$openssl_other_defines .= "#define RSAref\n";
|
||||
}
|
||||
elsif (/^[-+]/)
|
||||
{
|
||||
@@ -432,6 +510,14 @@ if ($target eq "TABLE") {
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($target eq "LIST") {
|
||||
foreach (sort keys %table) {
|
||||
print;
|
||||
print "\n";
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
&usage if (!defined($table{$target}));
|
||||
|
||||
my $IsWindows=scalar grep /^$target$/,@WinTargets;
|
||||
@@ -454,6 +540,7 @@ print "IsWindows=$IsWindows\n";
|
||||
$cflags="$flags$cflags" if ($flags ne "");
|
||||
|
||||
my $thread_cflags;
|
||||
my $thread_defines;
|
||||
if ($thread_cflag ne "(unknown)" && !$no_threads)
|
||||
{
|
||||
# If we know how to do it, support threads by default.
|
||||
@@ -463,11 +550,21 @@ if ($thread_cflag eq "(unknown)")
|
||||
{
|
||||
# If the user asked for "threads", hopefully they also provided
|
||||
# any system-dependent compiler options that are necessary.
|
||||
$thread_cflags="-DTHREADS $cflags"
|
||||
$thread_cflags="-DTHREADS $cflags" ;
|
||||
$thread_defines .= "#define THREADS\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$thread_cflags="-DTHREADS $thread_cflag $cflags"
|
||||
$thread_cflags="-DTHREADS $thread_cflag $cflags";
|
||||
$thread_defines .= "#define THREADS\n";
|
||||
# my $def;
|
||||
# foreach $def (split ' ',$thread_cflag)
|
||||
# {
|
||||
# if ($def =~ s/^-D// && $def !~ /^_/)
|
||||
# {
|
||||
# $thread_defines .= "#define $def\n";
|
||||
# }
|
||||
# }
|
||||
}
|
||||
|
||||
$lflags="$libs$lflags"if ($libs ne "");
|
||||
@@ -481,6 +578,7 @@ if ($no_asm)
|
||||
if ($threads)
|
||||
{
|
||||
$cflags=$thread_cflags;
|
||||
$openssl_thread_defines .= $thread_defines;
|
||||
}
|
||||
|
||||
#my ($bn1)=split(/\s+/,$bn_obj);
|
||||
@@ -530,6 +628,7 @@ if ($version =~ /(^[0-9]*)\.([0-9\.]*)/)
|
||||
|
||||
open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
|
||||
open(OUT,">$Makefile") || die "unable to create $Makefile:$!\n";
|
||||
print OUT "### Generated automatically from Makefile.org by Configure.\n\n";
|
||||
my $sdirs=0;
|
||||
while (<IN>)
|
||||
{
|
||||
@@ -598,6 +697,7 @@ my $md2_int=$def_int;
|
||||
my $idea_int=$def_int;
|
||||
my $rc2_int=$def_int;
|
||||
my $rc4_idx=0;
|
||||
my $rc4_chunk=0;
|
||||
my $bf_ptr=0;
|
||||
my @type=("char","short","int","long");
|
||||
my ($b64l,$b64,$b32,$b16,$b8)=(0,0,1,0,0);
|
||||
@@ -615,6 +715,8 @@ foreach (sort split(/\s+/,$bn_ops))
|
||||
$rc4_int=0 if /RC4_CHAR/;
|
||||
$rc4_int=3 if /RC4_LONG/;
|
||||
$rc4_idx=1 if /RC4_INDEX/;
|
||||
$rc4_chunk=1 if /RC4_CHUNK/;
|
||||
$rc4_chunk=2 if /RC4_CHUNK_LL/;
|
||||
$md2_int=0 if /MD2_CHAR/;
|
||||
$md2_int=3 if /MD2_LONG/;
|
||||
$idea_int=1 if /IDEA_SHORT/;
|
||||
@@ -632,6 +734,18 @@ foreach (sort split(/\s+/,$bn_ops))
|
||||
|
||||
open(IN,'<crypto/opensslconf.h.in') || die "unable to read crypto/opensslconf.h.in:$!\n";
|
||||
open(OUT,'>crypto/opensslconf.h') || die "unable to create crypto/opensslconf.h:$!\n";
|
||||
print OUT "/* opensslconf.h */\n";
|
||||
print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n";
|
||||
|
||||
print OUT "/* OpenSSL was configured with the following options: */\n";
|
||||
$openssl_algorithm_defines =~ s/^\s*#\s*define\s+(.*)/# ifndef $1\n# define $1\n# endif/mg;
|
||||
$openssl_algorithm_defines = " /* no ciphers excluded */\n" if $openssl_algorithm_defines eq "";
|
||||
$openssl_thread_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 "#ifdef OPENSSL_ALGORITHM_DEFINES\n$openssl_algorithm_defines#endif\n";
|
||||
print OUT "#ifdef OPENSSL_THREAD_DEFINES\n$openssl_thread_defines#endif\n";
|
||||
print OUT "#ifdef OPENSSL_OTHER_DEFINES\n$openssl_other_defines#endif\n\n";
|
||||
|
||||
while (<IN>)
|
||||
{
|
||||
if (/^#define\s+OPENSSLDIR/)
|
||||
@@ -666,6 +780,12 @@ while (<IN>)
|
||||
{ printf OUT "#%s DES_UNROLL\n",($des_unroll)?'define':'undef'; }
|
||||
elsif (/^#define\s+RC4_INT\s/)
|
||||
{ printf OUT "#define RC4_INT unsigned %s\n",$type[$rc4_int]; }
|
||||
elsif (/^#undef\s+RC4_CHUNK/)
|
||||
{
|
||||
printf OUT "#undef RC4_CHUNK\n" if $rc4_chunk==0;
|
||||
printf OUT "#define RC4_CHUNK unsigned long\n" if $rc4_chunk==1;
|
||||
printf OUT "#define RC4_CHUNK unsigned long long\n" if $rc4_chunk==2;
|
||||
}
|
||||
elsif (/^#((define)|(undef))\s+RC4_INDEX/)
|
||||
{ printf OUT "#%s RC4_INDEX\n",($rc4_idx)?"define":"undef"; }
|
||||
elsif (/^#(define|undef)\s+I386_ONLY/)
|
||||
@@ -705,6 +825,9 @@ print "DES_INT used\n" if $des_int;
|
||||
print "BN_LLONG mode\n" if $bn_ll;
|
||||
print "RC4 uses u$type[$rc4_int]\n" if $rc4_int != $def_int;
|
||||
print "RC4_INDEX mode\n" if $rc4_idx;
|
||||
print "RC4_CHUNK is undefined\n" if $rc4_chunk==0;
|
||||
print "RC4_CHUNK is unsigned long\n" if $rc4_chunk==1;
|
||||
print "RC4_CHUNK is unsigned long long\n" if $rc4_chunk==2;
|
||||
print "MD2 uses u$type[$md2_int]\n" if $md2_int != $def_int;
|
||||
print "IDEA uses u$type[$idea_int]\n" if $idea_int != $def_int;
|
||||
print "RC2 uses u$type[$rc2_int]\n" if $rc2_int != $def_int;
|
||||
@@ -723,8 +846,6 @@ if($IsWindows) {
|
||||
#endif
|
||||
EOF
|
||||
close(OUT);
|
||||
|
||||
system "perl crypto/objects/obj_dat.pl <crypto\\objects\\objects.h >crypto\\objects\\obj_dat.h";
|
||||
} else {
|
||||
(system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?;
|
||||
### (system 'make depend') == 0 or exit $? if $depflags ne "";
|
||||
@@ -733,43 +854,20 @@ EOF
|
||||
&dofile("tools/c_rehash",$openssldir,'^DIR=', 'DIR=%s',);
|
||||
if ( $perl =~ m@^/@) {
|
||||
&dofile("apps/der_chop",$perl,'^#!/', '#!%s');
|
||||
&dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
|
||||
} else {
|
||||
# No path for Perl known ...
|
||||
&dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||
}
|
||||
}
|
||||
|
||||
my $pwd;
|
||||
|
||||
if($IsWindows) {
|
||||
$pwd="(current directory)";
|
||||
} else {
|
||||
$pwd =`pwd`;
|
||||
chop($pwd);
|
||||
}
|
||||
print <<EOF;
|
||||
|
||||
NOTE: The OpenSSL header files have been moved from include/*.h
|
||||
to include/openssl/*.h. To include OpenSSL header files, now
|
||||
directives of the form
|
||||
#include <openssl/foo.h>
|
||||
should be used instead of #include <foo.h>.
|
||||
These new file locations allow installing the OpenSSL header
|
||||
files in /usr/local/include/openssl/ and should help avoid
|
||||
conflicts with other libraries.
|
||||
|
||||
To compile programs that use the old form <foo.h>,
|
||||
usually an additional compiler option will suffice: E.g., add
|
||||
-I$prefix/include/openssl
|
||||
or
|
||||
-I$pwd/include/openssl
|
||||
to the CFLAGS in the Makefile of the program that you want to compile
|
||||
(and leave all the original -I...'s in place!).
|
||||
|
||||
Please make sure that no old OpenSSL header files are around:
|
||||
The include directory should now be empty except for the openssl
|
||||
subdirectory.
|
||||
Configured for $target.
|
||||
|
||||
NOTE: OpenSSL header files were moved from <*.h> to <openssl/*.h>;
|
||||
see file INSTALL for hints on coping with compatibility problems.
|
||||
EOF
|
||||
|
||||
print <<\EOF if (!$no_threads && !$threads);
|
||||
@@ -777,7 +875,6 @@ print <<\EOF if (!$no_threads && !$threads);
|
||||
The library could not be configured for supporting multi-threaded
|
||||
applications as the compiler options required on this system are not known.
|
||||
See file INSTALL for details if you need multi-threading.
|
||||
|
||||
EOF
|
||||
|
||||
exit(0);
|
||||
@@ -785,22 +882,33 @@ exit(0);
|
||||
sub usage
|
||||
{
|
||||
print STDERR $usage;
|
||||
print STDERR "pick os/compiler from:";
|
||||
print STDERR "\npick os/compiler from:\n";
|
||||
my $j=0;
|
||||
my $i;
|
||||
my $k=0;
|
||||
foreach $i (sort keys %table)
|
||||
{
|
||||
next if $i =~ /^debug/;
|
||||
print STDERR "\n" if ($j++ % 4) == 0;
|
||||
printf(STDERR "%-18s ",$i);
|
||||
$k += length($i) + 1;
|
||||
if ($k > 78)
|
||||
{
|
||||
print STDERR "\n";
|
||||
$k=length($i);
|
||||
}
|
||||
print STDERR $i . " ";
|
||||
}
|
||||
foreach $i (sort keys %table)
|
||||
{
|
||||
next if $i !~ /^debug/;
|
||||
print STDERR "\n" if ($j++ % 4) == 0;
|
||||
printf(STDERR "%-18s ",$i);
|
||||
$k += length($i) + 1;
|
||||
if ($k > 78)
|
||||
{
|
||||
print STDERR "\n";
|
||||
$k=length($i);
|
||||
}
|
||||
print STDERR $i . " ";
|
||||
}
|
||||
print STDERR "\n";
|
||||
print STDERR "\n\nNOTE: If in doubt, on Unix-ish systems use './config'.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
130
FAQ
Normal file
130
FAQ
Normal file
@@ -0,0 +1,130 @@
|
||||
OpenSSL - Frequently Asked Questions
|
||||
--------------------------------------
|
||||
|
||||
* Which is the current version of OpenSSL?
|
||||
* Where is the documentation?
|
||||
* How can I contact the OpenSSL developers?
|
||||
* Do I need patent licenses to use OpenSSL?
|
||||
* Is OpenSSL thread-safe?
|
||||
* Why do I get a "PRNG not seeded" error message?
|
||||
* Why does the linker complain about undefined symbols?
|
||||
* Where can I get a compiled version of OpenSSL?
|
||||
|
||||
|
||||
* Which is the current version of OpenSSL?
|
||||
|
||||
The current version is available from <URL: http://www.openssl.org>.
|
||||
OpenSSL 0.9.4 was released on August 9th, 1999.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
ftp://ftp.openssl.org/snapshot/>, or get it by anonymous CVS access.
|
||||
|
||||
|
||||
* Where is the documentation?
|
||||
|
||||
OpenSSL is a library that provides cryptographic functionality to
|
||||
applications such as secure web servers. Be sure to read the
|
||||
documentation of the application you want to use. The INSTALL file
|
||||
explains how to install this library.
|
||||
|
||||
OpenSSL includes a command line utility that can be used to perform a
|
||||
variety of cryptographic functions. It is described in the openssl(1)
|
||||
manpage. Documentation for developers is currently being written. A
|
||||
few manual pages already are available; overviews over libcrypto and
|
||||
libssl are given in the crypto(3) and ssl(3) manpages.
|
||||
|
||||
The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
|
||||
different directory if you specified one as described in INSTALL).
|
||||
In addition, you can read the most current versions at
|
||||
<URL: http://www.openssl.org/docs/>.
|
||||
|
||||
For information on parts of libcrypto that are not yet documented, you
|
||||
might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's
|
||||
predecessor, at <URL: http://www.columbia.edu/~ariel/ssleay/>. Much
|
||||
of this still applies to OpenSSL.
|
||||
|
||||
There is some documentation about certificate extensions and PKCS#12
|
||||
in doc/openssl.txt
|
||||
|
||||
The original SSLeay documentation is included in OpenSSL as
|
||||
doc/ssleay.txt. It may be useful when none of the other resources
|
||||
help, but please note that it reflects the obsolete version SSLeay
|
||||
0.6.6.
|
||||
|
||||
|
||||
* How can I contact the OpenSSL developers?
|
||||
|
||||
The README file describes how to submit bug reports and patches to
|
||||
OpenSSL. Information on the OpenSSL mailing lists is available from
|
||||
<URL: http://www.openssl.org>.
|
||||
|
||||
|
||||
* Do I need patent licenses to use OpenSSL?
|
||||
|
||||
The patents section of the README file lists patents that may apply to
|
||||
you if you want to use OpenSSL. For information on intellectual
|
||||
property rights, please consult a lawyer. The OpenSSL team does not
|
||||
offer legal advice.
|
||||
|
||||
You can configure OpenSSL so as not to use RC5 and IDEA by using
|
||||
./config no-rc5 no-idea
|
||||
|
||||
Until the RSA patent expires, U.S. users may want to use
|
||||
./config no-rc5 no-idea no-rsa
|
||||
|
||||
Please note that you will *not* be able to communicate with most of
|
||||
the popular web browsers without RSA support.
|
||||
|
||||
|
||||
* Is OpenSSL thread-safe?
|
||||
|
||||
Yes. On Windows and many Unix systems, OpenSSL automatically uses the
|
||||
multi-threaded versions of the standard libraries. If your platform
|
||||
is not one of these, consult the INSTALL file.
|
||||
|
||||
Multi-threaded applications must provide two callback functions to
|
||||
OpenSSL. This is described in the threads(3) manpage.
|
||||
|
||||
|
||||
* Why do I get a "PRNG not seeded" error message?
|
||||
|
||||
Cryptographic software needs a source of unpredictable data to work
|
||||
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.
|
||||
|
||||
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
|
||||
number generator has not been seeded with at least 128 bits of
|
||||
randomness. If this error occurs, please contact the author of the
|
||||
application you are using. It is likely that it never worked
|
||||
correctly. OpenSSL 0.9.5 makes the error visible by refusing to
|
||||
perform potentially insecure encryption.
|
||||
|
||||
|
||||
* Why does the linker complain about undefined symbols?
|
||||
|
||||
Maybe the compilation was interrupted, and make doesn't notice that
|
||||
something is missing. Run "make clean; make".
|
||||
|
||||
If you used ./Configure instead of ./config, make sure that you
|
||||
selected the right target. File formats may differ slightly between
|
||||
OS versions (for example sparcv8/sparcv9, or a.out/elf).
|
||||
|
||||
If that doesn't help, you may want to try using the current snapshot.
|
||||
If the problem persists, please submit a bug report.
|
||||
|
||||
|
||||
* Where can I get a compiled version of OpenSSL?
|
||||
|
||||
Some applications that use OpenSSL are distributed in binary form.
|
||||
When using such an application, you don't need to install OpenSSL
|
||||
yourself; the application will include the required parts (e.g. DLLs).
|
||||
|
||||
If you want to install OpenSSL on a Windows system and you don't have
|
||||
a C compiler, read the "Mingw32" section of INSTALL.W32 for information
|
||||
on how to obtain and install the free GNU C compiler.
|
||||
|
||||
A number of Linux and *BSD distributions include OpenSSL.
|
||||
159
INSTALL
159
INSTALL
@@ -77,8 +77,9 @@
|
||||
|
||||
This guesses at your operating system (and compiler, if necessary) and
|
||||
configures OpenSSL based on this guess. Run ./config -t to see
|
||||
if it guessed correctly. If it did not get it correct or you want to
|
||||
use a different compiler then go to step 1b. Otherwise go to step 2.
|
||||
if it guessed correctly. If you want to use a different compiler, you
|
||||
are cross-compiling for another platform, or the ./config guess was
|
||||
wrong for other reasons, go to step 1b. Otherwise go to step 2.
|
||||
|
||||
On some systems, you can include debugging information as follows:
|
||||
|
||||
@@ -101,7 +102,8 @@
|
||||
|
||||
If your system is not available, you will have to edit the Configure
|
||||
program and add the correct configuration for your system. The
|
||||
generic configurations "cc" or "gcc" should usually work.
|
||||
generic configurations "cc" or "gcc" should usually work on 32 bit
|
||||
systems.
|
||||
|
||||
Configure creates the file Makefile.ssl from Makefile.org and
|
||||
defines various macros in crypto/opensslconf.h (generated from
|
||||
@@ -115,14 +117,12 @@
|
||||
OpenSSL binary ("openssl"). The libraries will be built in the top-level
|
||||
directory, and the binary will be in the "apps" directory.
|
||||
|
||||
If "make" fails, please report the problem to <openssl-bugs@openssl.org>.
|
||||
Include the output of "./config -t" and the OpenSSL version
|
||||
number in your message.
|
||||
If "make" fails, please report the problem to <openssl-bugs@openssl.org>
|
||||
(note that your message will be forwarded to a public mailing list).
|
||||
Include the output of "make report" in your message.
|
||||
|
||||
[If you encounter assembler error messages, try the "no-asm"
|
||||
configuration option as an immediate fix. Note that on Solaris x86
|
||||
(not on Sparcs!) you may have to install the GNU assembler to use
|
||||
OpenSSL assembler code -- /usr/ccs/bin/as won't do.]
|
||||
configuration option as an immediate fix.]
|
||||
|
||||
Compiling parts of OpenSSL with gcc and others with the system
|
||||
compiler will result in unresolved symbols on some systems.
|
||||
@@ -134,7 +134,7 @@
|
||||
If a test fails, try removing any compiler optimization flags from
|
||||
the CFLAGS line in Makefile.ssl and run "make clean; make". Please
|
||||
send a bug report to <openssl-bugs@openssl.org>, including the
|
||||
output of "openssl version -a" and of the failed test.
|
||||
output of "make report".
|
||||
|
||||
4. If everything tests ok, install OpenSSL with
|
||||
|
||||
@@ -145,11 +145,13 @@
|
||||
|
||||
certs Initially empty, this is the default location
|
||||
for certificate files.
|
||||
man/man1 Manual pages for the 'openssl' command line tool
|
||||
man/man3 Manual pages for the libraries (very incomplete)
|
||||
misc Various scripts.
|
||||
private Initially empty, this is the default location
|
||||
for private key files.
|
||||
|
||||
If you didn't chose a different installation prefix, the
|
||||
If you didn't choose a different installation prefix, the
|
||||
following additional subdirectories will be created:
|
||||
|
||||
bin Contains the openssl binary and a few other
|
||||
@@ -250,138 +252,3 @@
|
||||
you can still use "no-threads" to suppress an annoying warning message
|
||||
from the Configure script.)
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
The orignal Unix build instructions from SSLeay follow.
|
||||
Note: some of this may be out of date and no longer applicable
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
# When bringing the SSLeay distribution back from the evil intel world
|
||||
# of Windows NT, do the following to make it nice again under unix :-)
|
||||
# You don't normally need to run this.
|
||||
sh util/fixNT.sh # This only works for NT now - eay - 21-Jun-1996
|
||||
|
||||
# If you have perl, and it is not in /usr/local/bin, you can run
|
||||
perl util/perlpath.pl /new/path
|
||||
# and this will fix the paths in all the scripts. DO NOT put
|
||||
# /new/path/perl, just /new/path. The build
|
||||
# environment always run scripts as 'perl perlscript.pl' but some of the
|
||||
# 'applications' are easier to usr with the path fixed.
|
||||
|
||||
# Edit crypto/cryptlib.h, tools/c_rehash, and Makefile.ssl
|
||||
# to set the install locations if you don't like
|
||||
# the default location of /usr/local/ssl
|
||||
# Do this by running
|
||||
perl util/ssldir.pl /new/ssl/home
|
||||
# if you have perl, or by hand if not.
|
||||
|
||||
# If things have been stuffed up with the sym links, run
|
||||
make -f Makefile.ssl links
|
||||
# This will re-populate lib/include with symlinks and for each
|
||||
# directory, link Makefile to Makefile.ssl
|
||||
|
||||
# Setup the machine dependent stuff for the top level makefile
|
||||
# and some select .h files
|
||||
# If you don't have perl, this will bomb, in which case just edit the
|
||||
# top level Makefile.ssl
|
||||
./Configure 'system type'
|
||||
|
||||
# The 'Configure' command contains default configuration parameters
|
||||
# for lots of machines. Configure edits 5 lines in the top level Makefile
|
||||
# It modifies the following values in the following files
|
||||
Makefile.ssl CC CFLAG EX_LIBS BN_MULW
|
||||
crypto/des/des.h DES_LONG
|
||||
crypto/des/des_locl.h DES_PTR
|
||||
crypto/md2/md2.h MD2_INT
|
||||
crypto/rc4/rc4.h RC4_INT
|
||||
crypto/rc4/rc4_enc.c RC4_INDEX
|
||||
crypto/rc2/rc2.h RC2_INT
|
||||
crypto/bf/bf_locl.h BF_INT
|
||||
crypto/idea/idea.h IDEA_INT
|
||||
crypto/bn/bn.h BN_LLONG (and defines one of SIXTY_FOUR_BIT,
|
||||
SIXTY_FOUR_BIT_LONG, THIRTY_TWO_BIT,
|
||||
SIXTEEN_BIT or EIGHT_BIT)
|
||||
Please remember that all these files are actually copies of the file with
|
||||
a .org extention. So if you change crypto/des/des.h, the next time
|
||||
you run Configure, it will be runover by a 'configured' version of
|
||||
crypto/des/des.org. So to make the changer the default, change the .org
|
||||
files. The reason these files have to be edited is because most of
|
||||
these modifications change the size of fundamental data types.
|
||||
While in theory this stuff is optional, it often makes a big
|
||||
difference in performance and when using assember, it is importaint
|
||||
for the 'Bignum bits' match those required by the assember code.
|
||||
A warning for people using gcc with sparc cpu's. Gcc needs the -mv8
|
||||
flag to use the hardware multiply instruction which was not present in
|
||||
earlier versions of the sparc CPU. I define it by default. If you
|
||||
have an old sparc, and it crashes, try rebuilding with this flag
|
||||
removed. I am leaving this flag on by default because it makes
|
||||
things run 4 times faster :-)
|
||||
|
||||
# clean out all the old stuff
|
||||
make clean
|
||||
|
||||
# Do a make depend only if you have the makedepend command installed
|
||||
# This is not needed but it does make things nice when developing.
|
||||
make depend
|
||||
|
||||
# make should build everything
|
||||
make
|
||||
|
||||
# fix up the demo certificate hash directory if it has been stuffed up.
|
||||
make rehash
|
||||
|
||||
# test everything
|
||||
make test
|
||||
|
||||
# install the lot
|
||||
make install
|
||||
|
||||
# It is worth noting that all the applications are built into the one
|
||||
# program, ssleay, which is then has links from the other programs
|
||||
# names to it.
|
||||
# The applicatons can be built by themselves, just don't define the
|
||||
# 'MONOLITH' flag. So to build the 'enc' program stand alone,
|
||||
gcc -O2 -Iinclude apps/enc.c apps/apps.c libcrypto.a
|
||||
|
||||
# Other useful make options are
|
||||
make makefile.one
|
||||
# which generate a 'makefile.one' file which will build the complete
|
||||
# SSLeay distribution with temp. files in './tmp' and 'installable' files
|
||||
# in './out'
|
||||
|
||||
# Have a look at running
|
||||
perl util/mk1mf.pl help
|
||||
# this can be used to generate a single makefile and is about the only
|
||||
# way to generate makefiles for windows.
|
||||
|
||||
# There is actually a final way of building SSLeay.
|
||||
gcc -O2 -c -Icrypto -Iinclude crypto/crypto.c
|
||||
gcc -O2 -c -Issl -Iinclude ssl/ssl.c
|
||||
# and you now have the 2 libraries as single object files :-).
|
||||
# If you want to use the assember code for your particular platform
|
||||
# (DEC alpha/x86 are the main ones, the other assember is just the
|
||||
# output from gcc) you will need to link the assember with the above generated
|
||||
# object file and also do the above compile as
|
||||
gcc -O2 -DBN_ASM -c -Icrypto -Iinclude crypto/crypto.c
|
||||
|
||||
This last option is probably the best way to go when porting to another
|
||||
platform or building shared libraries. It is not good for development so
|
||||
I don't normally use it.
|
||||
|
||||
To build shared libararies under unix, have a look in shlib, basically
|
||||
you are on your own, but it is quite easy and all you have to do
|
||||
is compile 2 (or 3) files.
|
||||
|
||||
For mult-threading, have a read of doc/threads.doc. Again it is quite
|
||||
easy and normally only requires some extra callbacks to be defined
|
||||
by the application.
|
||||
The examples for solaris and windows NT/95 are in the mt directory.
|
||||
|
||||
have fun
|
||||
|
||||
eric 25-Jun-1997
|
||||
|
||||
IRIX 5.x will build as a 32 bit system with mips1 assember.
|
||||
IRIX 6.x will build as a 64 bit system with mips3 assember. It conforms
|
||||
to n32 standards. In theory you can compile the 64 bit assember under
|
||||
IRIX 5.x but you will have to have the correct system software installed.
|
||||
|
||||
72
INSTALL.MacOS
Normal file
72
INSTALL.MacOS
Normal file
@@ -0,0 +1,72 @@
|
||||
OpenSSL - Port To The Macintosh
|
||||
===============================
|
||||
|
||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for MacOS (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
|
||||
in a window. We don't even build the test applications so that we can't
|
||||
guarantee that all algorithms are operational.
|
||||
|
||||
Required software:
|
||||
|
||||
- StuffIt Expander 5.5 or later, alternatively MacGzip and SUNtar;
|
||||
- Scriptable Finder;
|
||||
- CodeWarrior Pro 5;
|
||||
|
||||
Installation procedure:
|
||||
|
||||
- fetch the source at ftp://ftp.openssl.org/ (well, you probably already
|
||||
did, huh?)
|
||||
- unpack the .tar.gz file:
|
||||
- if you have StuffIt Expander then just drag it over it;
|
||||
- otherwise uncompress it with MacGzip and then unpack with SUNtar;
|
||||
- locate MacOS folder in OpenSSL source tree and open it;
|
||||
- unbinhex mklinks.as.hqx and OpenSSL.mcp.hqx if present (**), do it
|
||||
"in-place", i.e. unpacked files should end-up in the very same folder;
|
||||
- execute mklinks.as;
|
||||
- open OpenSSL.mcp(***) and build 'GetHTTPS PPC' target(****);
|
||||
- that's it for now;
|
||||
|
||||
(*) URL is hardcoded into ./MacOS/GetHTTPS.src/GetHTTPS.cpp, lines 40
|
||||
to 42, change appropriately.
|
||||
(**) If you use SUNtar, then it might have already unbinhexed the files
|
||||
in question.
|
||||
(***) The project file was saved with CW Pro 5.3. If you have earlier
|
||||
version and it refuses to open it, then download
|
||||
http://www.openssl.org/~appro/OpenSSL.mcp.xml and import it
|
||||
overwriting the original OpenSSL.mcp.
|
||||
(****) Other targets are work in progress. If you feel like giving 'em a
|
||||
shot, then you should know that OpenSSL* and Lib* targets are
|
||||
supposed to be built with the GUSI, MacOS library which mimics
|
||||
BSD sockets and some other POSIX APIs. The GUSI distribution is
|
||||
expected to be found in the same directory as openssl source tree,
|
||||
i.e. in the parent directory to the one where this very file,
|
||||
namely INSTALL.MacOS. For more informations about GUSI, see
|
||||
http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
|
||||
|
||||
Finally some essential comments from our generous contributor:-)
|
||||
|
||||
"I've gotten OpenSSL working on the Macintosh. It's probably a bit of a
|
||||
hack, but it works for what I'm doing. If you don't like the way I've done
|
||||
it, then feel free to change what I've done. I freely admit that I've done
|
||||
some less-than-ideal things in my port, and if you don't like the way I've
|
||||
done something, then feel free to change it-- I won't be offended!
|
||||
|
||||
... I've tweaked "bss_sock.c" a little to call routines in a "MacSocket"
|
||||
library I wrote. My MacSocket library is a wrapper around OpenTransport,
|
||||
handling stuff like endpoint creation, reading, writing, etc. It is not
|
||||
designed as a high-performance package such as you'd use in a webserver,
|
||||
but is fine for lots of other applications. MacSocket also uses some other
|
||||
code libraries I've written to deal with string manipulations and error
|
||||
handling. Feel free to use these things in your own code, but give me
|
||||
credit and/or send me free stuff in appreciation! :-)
|
||||
|
||||
...
|
||||
|
||||
If you have any questions, feel free to email me as the following:
|
||||
|
||||
roy@centricsystems.ca
|
||||
|
||||
-Roy Wood"
|
||||
|
||||
71
INSTALL.VMS
71
INSTALL.VMS
@@ -16,6 +16,7 @@ This file is divided in the following parts:
|
||||
may go wrong or may surprise you.
|
||||
Report - How to get in touch with me.
|
||||
|
||||
|
||||
Compilation:
|
||||
============
|
||||
|
||||
@@ -35,26 +36,28 @@ directory. The syntax is trhe following:
|
||||
<option> must be one of the following:
|
||||
|
||||
ALL Just build "everything".
|
||||
DATE Just build the "[.INCLUDE]DATE.H" file.
|
||||
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.
|
||||
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.
|
||||
SSL_TASK Just build the "[.xxx.EXE.SSL]SSL_TASK.EXE" program.
|
||||
TEST Just build the "test" programs for OpenSSL.
|
||||
APPS Just build the "application" programs for OpenSSL.
|
||||
TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL.
|
||||
APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL.
|
||||
|
||||
<rsaref-p> must be one of the following:
|
||||
|
||||
RSAREF compile using the RSAREF Library
|
||||
NORSAREF compile without using RSAREF
|
||||
|
||||
Note: The RSAREF libraries are NOT INCLUDED and you have to
|
||||
download it from "ftp://ftp.rsa.com/rsaref". You have to
|
||||
get the ".tar-Z" file as the ".zip" file dosen't have the
|
||||
directory structure stored. You have to extract the file
|
||||
into the [.RSAREF] directory as that is where the scripts
|
||||
will look for the files.
|
||||
Note 1: The RSAREF libraries are NOT INCLUDED and you have to
|
||||
download it from "ftp://ftp.rsa.com/rsaref". You have to
|
||||
get the ".tar-Z" file as the ".zip" file doesn't have the
|
||||
directory structure stored. You have to extract the file
|
||||
into the [.RSAREF] directory as that is where the scripts
|
||||
will look for the files.
|
||||
|
||||
Note 2: I have never done this, so I've no idea if it works or not.
|
||||
|
||||
@@ -65,7 +68,6 @@ Note 2: I have never done this, so I've no idea if it works or not.
|
||||
|
||||
<compiler> must be one of the following:
|
||||
|
||||
VAXC For VAX C.
|
||||
DECC For DEC C.
|
||||
GNUC For GNU C.
|
||||
|
||||
@@ -77,15 +79,33 @@ named LIBSSL.OLB, and you will find a bunch of useful programs in
|
||||
just to test them. For production use, make sure you install first, see
|
||||
Installation below.
|
||||
|
||||
Note: Some programs in this package require a TCP/IP library.
|
||||
Note 1: Some programs in this package require a TCP/IP library.
|
||||
|
||||
Note 2: if you want to compile the crypto library only, please make sure
|
||||
you have at least done a @MAKEVMS DATE and a @MAKEVMS SOFTLINKS.
|
||||
A lot of things will break if you don't.
|
||||
you have at least done a @MAKEVMS CONFIG, a @MAKEVMS BUILDINF and
|
||||
a @MAKEVMS SOFTLINKS. A lot of things will break if you don't.
|
||||
|
||||
|
||||
Logical names:
|
||||
==============
|
||||
|
||||
There are a few things that can't currently be given through the command
|
||||
line. Instead, logical names are used.
|
||||
|
||||
Currently, the logical names supported are:
|
||||
|
||||
OPENSSL_NO_ASM with value YES, the assembler parts of OpenSSL will
|
||||
not be used. Instead, plain C implementations are
|
||||
used. This is good to try if something doesn't work.
|
||||
OPENSSL_NO_'alg' with value YES, the corresponding crypto algorithm
|
||||
will not be implemented. Supported algorithms to
|
||||
do this with are: RSA, DSA, DH, MD2, MD5, RIPEMD,
|
||||
SHA, DES, MDC2, CR2, RC4, RC5, IDEA, BF, CAST, HMAC,
|
||||
SSL2. So, for example, having the logical name
|
||||
OPENSSL_NO_RSA with the value YES means that the
|
||||
LIBCRYPTO.OLB library will not contain an RSA
|
||||
implementation.
|
||||
|
||||
Note 3: Alpha users will get a number of informational messages when
|
||||
compiling the [.asm]vms.mar file in the BN (bignum) part of
|
||||
the crypto library. These can be safely ignored.
|
||||
|
||||
Test:
|
||||
=====
|
||||
@@ -99,6 +119,7 @@ it's an ugly hack!) and rebuild. Please send a bug report to
|
||||
<openssl-bugs@openssl.org>, including the output of "openssl version -a"
|
||||
and of the failed test.
|
||||
|
||||
|
||||
Installation:
|
||||
=============
|
||||
|
||||
@@ -158,6 +179,7 @@ The logical names that are set up are the following:
|
||||
(the NOTE in section 4 of "Installation in Detail").
|
||||
You don't need to "deleting old header files"!!!
|
||||
|
||||
|
||||
Backward portability:
|
||||
=====================
|
||||
|
||||
@@ -175,7 +197,7 @@ dependent on the OpenVMS version or the C library version, *and* you
|
||||
can use those macros to simulate older OpenVMS or C library versions,
|
||||
by defining the macros _VMS_V6_SOURCE, __VMS_VER and __CTRL_VER with
|
||||
correct values. In the compilation scripts, I've provided the possibility
|
||||
for the user to influense the creation of such macros, through a bunch of
|
||||
for the user to influence the creation of such macros, through a bunch of
|
||||
symbols, all having names starting with USER_. Here's the list of them:
|
||||
|
||||
USER_CCFLAGS - Used to give additional qualifiers to the
|
||||
@@ -212,19 +234,6 @@ directory by default, it may very well be that you have to give them
|
||||
extra arguments. Please experiment.
|
||||
|
||||
|
||||
Report:
|
||||
=======
|
||||
|
||||
I maintain a few mailinglists for bug reports and such on software that
|
||||
I develop/port/enhance/destroy. Please look at http://www.free.lp.se/
|
||||
for further info.
|
||||
|
||||
|
||||
--
|
||||
Richard Levitte <richard@levitte.org>
|
||||
1999-03-09
|
||||
|
||||
|
||||
TODO:
|
||||
=====
|
||||
|
||||
@@ -242,4 +251,4 @@ have any ideas.
|
||||
|
||||
--
|
||||
Richard Levitte <richard@levitte.org>
|
||||
1999-05-24
|
||||
2000-02-27
|
||||
|
||||
194
INSTALL.W32
194
INSTALL.W32
@@ -4,7 +4,7 @@
|
||||
|
||||
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. See the end of this file for Eric's original comments.
|
||||
modification.
|
||||
|
||||
You need Perl for Win32 (available from http://www.activestate.com/ActivePerl)
|
||||
and one of the following C compilers:
|
||||
@@ -21,10 +21,12 @@
|
||||
* Microsoft MASM (aka "ml")
|
||||
* Free Netwide Assembler NASM.
|
||||
|
||||
MASM was I believe distributed in the past with VC++ and it is also part of
|
||||
the MSDN SDKs. It is no longer distributed as part of VC++ and can be hard
|
||||
to get hold of. It can be purchased: see Microsoft's site for details at:
|
||||
http://www.microsoft.com/
|
||||
MASM was at one point distributed with VC++. It is now distributed with some
|
||||
Microsoft DDKs, for example the Windows NT 4.0 DDK and the Windows 98 DDK. If
|
||||
you do not have either of these DDKs then you can just download the binaries
|
||||
for the Windows 98 DDK and extract and rename the two files XXXXXml.exe and
|
||||
XXXXXml.err, to ml.exe and ml.err and install somewhere on your PATH. Both
|
||||
DDKs can be downloaded from the Microsoft developers site www.msdn.com.
|
||||
|
||||
NASM is freely available. Version 0.98 was used during testing: other versions
|
||||
may also work. It is available from many places, see for example:
|
||||
@@ -59,7 +61,7 @@
|
||||
> ms\do_ms
|
||||
|
||||
If you get errors about things not having numbers assigned then check the
|
||||
troubleshooting section: you probably wont be able to compile it as it
|
||||
troubleshooting section: you probably won't be able to compile it as it
|
||||
stands.
|
||||
|
||||
Then from the VC++ environment at a prompt do:
|
||||
@@ -145,12 +147,16 @@
|
||||
assigned in the CVS tree: so anything linked against this version of the
|
||||
library may need to be recompiled.
|
||||
|
||||
If you get errors about unresolved externals then this means that either you
|
||||
didn't read the note above about functions not having numbers assigned or
|
||||
someone forgot to add a function to the header file.
|
||||
If you get errors about unresolved symbols there are several possible
|
||||
causes.
|
||||
|
||||
In this latter case check out the header file to see if the function is
|
||||
defined in the header file.
|
||||
If this happens when the DLL is being linked and you have disabled some
|
||||
ciphers then it is possible the DEF file generator hasn't removed all
|
||||
the disabled symbols: the easiest solution is to edit the DEF files manually
|
||||
to delete them. The DEF files are ms\libeay32.def ms\ssleay32.def.
|
||||
|
||||
Another cause is if you missed or ignored the errors about missing numbers
|
||||
mentioned above.
|
||||
|
||||
If you get warnings in the code then the compilation will halt.
|
||||
|
||||
@@ -165,159 +171,13 @@
|
||||
|
||||
One final comment about compiling applications linked to the OpenSSL library.
|
||||
If you don't use the multithreaded DLL runtime library (/MD option) your
|
||||
program will almost certainly crash: see the original SSLeay description
|
||||
below for more details.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
The orignal Windows build instructions from SSLeay follow.
|
||||
Note: some of this may be out of date and no longer applicable. In particular
|
||||
the Crypto_malloc_init() comment appears to be wrong: you always need to use
|
||||
the same runtime library as the DLL itself.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
The Microsoft World.
|
||||
|
||||
The good news, to build SSLeay for the Microsft World
|
||||
|
||||
Windows 3.1 DLL's
|
||||
perl Configure VC-WIN16
|
||||
nmake -f ms\w31dll.mak
|
||||
|
||||
Windows NT/95 DLL's
|
||||
perl Configure VC-WIN32
|
||||
nmake -f ms\ntdll.mak
|
||||
|
||||
Now the bad news
|
||||
All builds were done using Microsofts Visual C++ 1.52c and [45].x.
|
||||
If you are a borland person, you are probably going to have to help me
|
||||
finish the stuff in util/pl/BC*pl
|
||||
|
||||
All builds were made under Windows NT - this means long filenames, so
|
||||
you may have problems under Windows 3.1 but probably not under 95.
|
||||
|
||||
Because file pointers don't work in DLL's under Windows 3.1 (well at
|
||||
least stdin/stdout don't and I don't like having to differentiate
|
||||
between these and other file pointers), I now use the BIO file-pointer
|
||||
module, which needs to be linked into your application. You can either
|
||||
use the memory buffer BIO for IO, or compile bss_file.c into your
|
||||
application, it is in the apps directory and is just a copy of
|
||||
crypto/buffer/bss_file.c with #define APPS_WIN16 added.
|
||||
I have not yet automated the makefile to automatically copy it into 'out'
|
||||
for a win 3.1 build....
|
||||
|
||||
All callbacks passed into SSLeay for Windows 3.1 need to be of type
|
||||
_far _loadds.
|
||||
|
||||
I don't support building with the pascal calling convention.
|
||||
|
||||
The DLL and static builds are large memory model.
|
||||
|
||||
To build static libraries for NT/95 or win 3.1
|
||||
|
||||
perl util/mk1mf.pl VC-WIN32 > mf-stat.nt
|
||||
perl util/mk1mf.pl VC-WIN16 > mf-stat.w31
|
||||
for DLL's
|
||||
perl util/mk1mf.pl dll VC-WIN32 > mf-dll.nt
|
||||
perl util/mk1mf.pl dll VC-WIN16 > mf-dll.w31
|
||||
|
||||
Again you will notice that if you dont have perl, you cannot do this.
|
||||
|
||||
Now the next importaint issue. Running Configure!
|
||||
I have small assember code files for critical big number library operation
|
||||
in crypto/bn/asm. There is, asm code, object files and uuencode
|
||||
object files. They are
|
||||
x86nt32.asm - 32bit flat memory model assember - suitable Win32
|
||||
x86w16.asm - 16bit assember - used in the msdos build.
|
||||
x86w32.asm - 32bit assember, win 3.1 segments, used for win16 build.
|
||||
|
||||
If you feel compelled to build the 16bit maths routines in the windows 3.1
|
||||
build,
|
||||
perl Configure VC-W31-16
|
||||
perl util/mk1mf.pl dll VC-W31-16 > mf-dll.w31
|
||||
|
||||
If you hate assember and don't want anything to do with it,
|
||||
perl util/mk1mf.pl no-asm VC-WIN16 > mf-dll.w31
|
||||
will work for any of the makefile generations.
|
||||
|
||||
There are more options to mk1mf.pl but these all leave the temporary
|
||||
files in 'tmp' and the output files in 'out' by default.
|
||||
|
||||
The NT build is done for console mode.
|
||||
|
||||
The Windows 3.1 version of SSLeay uses quickwin, the interface is ugly
|
||||
but it is better than nothing. If you want ugly, try doing anything
|
||||
that involves getting a password. I decided to be ugly instead of
|
||||
echoing characters. For Windows 3.1 I would just sugest using the
|
||||
msdos version of the ssleay application for command line work.
|
||||
The QuickWin build is primarily for testing.
|
||||
|
||||
For both NT and Windows 3.1, I have not written the code so that
|
||||
s_client, s_server can take input from the keyboard. You can happily
|
||||
start applications up in separate windows, watch them handshake, and then sit
|
||||
there for-ever. I have not had the time to get this working, and I've
|
||||
been able to test things from a unix box to the NT box :-).
|
||||
Try running ssleay s_server on the windows box
|
||||
(with either -cert ../apps/server.pem -www)
|
||||
and run ssleay s_time from another window.
|
||||
This often stuffs up on Windows 3.1, but I'm not worried since this is
|
||||
probably a problem with my demo applications, not the libraries.
|
||||
|
||||
After a build of one of the version of microsoft SSLeay,
|
||||
'cd ms' and then run 'test'. This should check everything out and
|
||||
even does a trial run of generating certificates.
|
||||
'test.bat' requires that perl be install, you be in the ms directory
|
||||
(not the test directory, thats for unix so stay out :-) and that the
|
||||
build output directory be ../out
|
||||
|
||||
On a last note, you will probably get division by zero errors and
|
||||
stuff after a build. This is due to your own inability to follow
|
||||
instructions :-).
|
||||
|
||||
The reasons for the problem is probably one of the following.
|
||||
|
||||
1) You did not run Configure. This is critical for windows 3.1 when
|
||||
using assember. The values in crypto/bn/bn.h must match the
|
||||
ones requred for the assember code. (remember that if you
|
||||
edit crypto/bn/bn.h by hand, it will be clobered the next time
|
||||
you run Configure by the contents of crypto/bn/bn.org).
|
||||
SSLeay version -o will list the compile options.
|
||||
For VC-WIN32 you need bn(64,32) or bn(32,32)
|
||||
For VC-W31-32/VC-WIN16 you need bn(32,32)
|
||||
For VC-W31-16 you need bn(32,16) or bn(16,16)
|
||||
For VC-MSDOS you need bn(32,16) or bn(16,16).
|
||||
|
||||
The first number will be 2 times bigger than the second if
|
||||
BN_LLONG is defined in bn.h and the size of the second number
|
||||
depends on the 'bits' defined at the start of bn.h. Have a
|
||||
look, it's all reasonably clear.
|
||||
If you want to start messing with 8 bit builds and things like
|
||||
that, build without the assember by re-generating a makefile
|
||||
via 'perl util/mk1mf.pl no-asm'.
|
||||
2) You tried to build under MS-DOS or Windows 3.1 using the /G3
|
||||
option. Don't. It is buggy (thats why you just got that
|
||||
error) and unless you want to work out which optimising flag
|
||||
to turn off, I'm not going to help you :-). I also noticed
|
||||
that code often ran slower when compiled with /G3.
|
||||
3) Under NT/95, malloc goes stupid. You are probably linking with
|
||||
the wrong library, there are problems if you mix the threaded
|
||||
and non-threaded libraries (due to the DLL being staticly
|
||||
linked with one and the applicaion using another.
|
||||
|
||||
Well hopefully thats most of the MS issues handled, see you in ssl-users :-).
|
||||
|
||||
eric 30-Aug-1996
|
||||
|
||||
SSLeay 0.6.5
|
||||
For Windows 95/NT, add CRYPTO_malloc_init() to your program before any
|
||||
calls to the SSLeay libraries. This function will insert callbacks so that
|
||||
the SSLeay libraries will use the same malloc(), free() and realloc() as
|
||||
your application so 'problem 3)' mentioned above will go away.
|
||||
|
||||
There is now DES assember for Windows NT/95. The file is
|
||||
crypto/des/asm/win32.asm and replaces crypto/des/des_enc.c in the build.
|
||||
|
||||
There is also Blowfish assember for Windows NT/95. The file is
|
||||
crypto/bf/asm/win32.asm and replaces crypto/bf/bf_enc.c in the build.
|
||||
|
||||
eric 25-Jun-1997
|
||||
|
||||
program will almost certainly crash because malloc gets confused -- the
|
||||
OpenSSL DLLs are statically linked to one version, the application must
|
||||
not use a different one. You might be able to work around such problems
|
||||
by adding CRYPTO_malloc_init() to your program before any calls to the
|
||||
OpenSSL libraries: This tells the OpenSSL libraries to use the same
|
||||
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
|
||||
consistently use the multithreaded library.
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
||||
---------------
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-1999 The OpenSSL Project. All rights reserved.
|
||||
* Copyright (c) 1998-2000 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
|
||||
|
||||
62
MacOS/GUSI_Init.cpp
Normal file
62
MacOS/GUSI_Init.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
/**************** BEGIN GUSI CONFIGURATION ****************************
|
||||
*
|
||||
* GUSI Configuration section generated by GUSI Configurator
|
||||
* last modified: Wed Jan 5 20:33:51 2000
|
||||
*
|
||||
* This section will be overwritten by the next run of Configurator.
|
||||
*/
|
||||
|
||||
#define GUSI_SOURCE
|
||||
#include <GUSIConfig.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* Declarations of Socket Factories */
|
||||
|
||||
__BEGIN_DECLS
|
||||
void GUSIwithInetSockets();
|
||||
void GUSIwithLocalSockets();
|
||||
void GUSIwithMTInetSockets();
|
||||
void GUSIwithMTTcpSockets();
|
||||
void GUSIwithMTUdpSockets();
|
||||
void GUSIwithOTInetSockets();
|
||||
void GUSIwithOTTcpSockets();
|
||||
void GUSIwithOTUdpSockets();
|
||||
void GUSIwithPPCSockets();
|
||||
void GUSISetupFactories();
|
||||
__END_DECLS
|
||||
|
||||
/* Configure Socket Factories */
|
||||
|
||||
void GUSISetupFactories()
|
||||
{
|
||||
#ifdef GUSISetupFactories_BeginHook
|
||||
GUSISetupFactories_BeginHook
|
||||
#endif
|
||||
GUSIwithInetSockets();
|
||||
#ifdef GUSISetupFactories_EndHook
|
||||
GUSISetupFactories_EndHook
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Declarations of File Devices */
|
||||
|
||||
__BEGIN_DECLS
|
||||
void GUSIwithDConSockets();
|
||||
void GUSIwithNullSockets();
|
||||
void GUSISetupDevices();
|
||||
__END_DECLS
|
||||
|
||||
/* Configure File Devices */
|
||||
|
||||
void GUSISetupDevices()
|
||||
{
|
||||
#ifdef GUSISetupDevices_BeginHook
|
||||
GUSISetupDevices_BeginHook
|
||||
#endif
|
||||
GUSIwithNullSockets();
|
||||
#ifdef GUSISetupDevices_EndHook
|
||||
GUSISetupDevices_EndHook
|
||||
#endif
|
||||
}
|
||||
|
||||
/**************** END GUSI CONFIGURATION *************************/
|
||||
2753
MacOS/GetHTTPS.src/CPStringUtils.cpp
Normal file
2753
MacOS/GetHTTPS.src/CPStringUtils.cpp
Normal file
File diff suppressed because it is too large
Load Diff
104
MacOS/GetHTTPS.src/CPStringUtils.hpp
Normal file
104
MacOS/GetHTTPS.src/CPStringUtils.hpp
Normal file
@@ -0,0 +1,104 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void CopyPStrToCStr(const unsigned char *thePStr,char *theCStr,const int maxCStrLength);
|
||||
void CopyPStrToPStr(const unsigned char *theSrcPStr,unsigned char *theDstPStr,const int maxDstStrLength);
|
||||
void CopyCStrToCStr(const char *theSrcCStr,char *theDstCStr,const int maxDstStrLength);
|
||||
void CopyCStrToPStr(const char *theSrcCStr,unsigned char *theDstPStr,const int maxDstStrLength);
|
||||
void ConcatPStrToCStr(const unsigned char *thePStr,char *theCStr,const int maxCStrLength);
|
||||
void ConcatPStrToPStr(const unsigned char *theSrcPStr,unsigned char *theDstPStr,const int maxDstStrLength);
|
||||
void ConcatCStrToPStr(const char *theSrcCStr,unsigned char *theDstPStr,const int maxDstStrLength);
|
||||
void ConcatCStrToCStr(const char *theSrcCStr,char *theDstCStr,const int maxCStrLength);
|
||||
|
||||
void ConcatCharToCStr(const char theChar,char *theDstCStr,const int maxCStrLength);
|
||||
void ConcatCharToPStr(const char theChar,unsigned char *theDstPStr,const int maxPStrLength);
|
||||
|
||||
int ComparePStrs(const unsigned char *theFirstPStr,const unsigned char *theSecondPStr,const Boolean ignoreCase = true);
|
||||
int CompareCStrs(const char *theFirstCStr,const char *theSecondCStr,const Boolean ignoreCase = true);
|
||||
int CompareCStrToPStr(const char *theCStr,const unsigned char *thePStr,const Boolean ignoreCase = true);
|
||||
|
||||
Boolean CStrsAreEqual(const char *theFirstCStr,const char *theSecondCStr,const Boolean ignoreCase = true);
|
||||
Boolean PStrsAreEqual(const unsigned char *theFirstCStr,const unsigned char *theSecondCStr,const Boolean ignoreCase = true);
|
||||
|
||||
void CopyLongIntToCStr(const long theNum,char *theCStr,const int maxCStrLength,const int numDigits = -1);
|
||||
void CopyUnsignedLongIntToCStr(const unsigned long theNum,char *theCStr,const int maxCStrLength);
|
||||
void ConcatLongIntToCStr(const long theNum,char *theCStr,const int maxCStrLength,const int numDigits = -1);
|
||||
void CopyCStrAndConcatLongIntToCStr(const char *theSrcCStr,const long theNum,char *theDstCStr,const int maxDstStrLength);
|
||||
|
||||
void CopyLongIntToPStr(const long theNum,unsigned char *thePStr,const int maxPStrLength,const int numDigits = -1);
|
||||
void ConcatLongIntToPStr(const long theNum,unsigned char *thePStr,const int maxPStrLength,const int numDigits = -1);
|
||||
|
||||
long CStrLength(const char *theCString);
|
||||
long PStrLength(const unsigned char *thePString);
|
||||
|
||||
OSErr CopyCStrToExistingHandle(const char *theCString,Handle theHandle);
|
||||
OSErr CopyLongIntToExistingHandle(const long inTheLongInt,Handle theHandle);
|
||||
|
||||
OSErr CopyCStrToNewHandle(const char *theCString,Handle *theHandle);
|
||||
OSErr CopyPStrToNewHandle(const unsigned char *thePString,Handle *theHandle);
|
||||
OSErr CopyLongIntToNewHandle(const long inTheLongInt,Handle *theHandle);
|
||||
|
||||
OSErr AppendCStrToHandle(const char *theCString,Handle theHandle,long *currentLength = nil,long *maxLength = nil);
|
||||
OSErr AppendCharsToHandle(const char *theChars,const int numChars,Handle theHandle,long *currentLength = nil,long *maxLength = nil);
|
||||
OSErr AppendPStrToHandle(const unsigned char *thePString,Handle theHandle,long *currentLength = nil);
|
||||
OSErr AppendLongIntToHandle(const long inTheLongInt,Handle theHandle,long *currentLength = nil);
|
||||
|
||||
void ZeroMem(void *theMemPtr,const unsigned long numBytes);
|
||||
|
||||
char *FindCharInCStr(const char theChar,const char *theCString);
|
||||
long FindCharOffsetInCStr(const char theChar,const char *theCString,const Boolean inIgnoreCase = false);
|
||||
long FindCStrOffsetInCStr(const char *theCSubstring,const char *theCString,const Boolean inIgnoreCase = false);
|
||||
|
||||
void CopyCSubstrToCStr(const char *theSrcCStr,const int maxCharsToCopy,char *theDstCStr,const int maxDstStrLength);
|
||||
void CopyCSubstrToPStr(const char *theSrcCStr,const int maxCharsToCopy,unsigned char *theDstPStr,const int maxDstStrLength);
|
||||
|
||||
void InsertCStrIntoCStr(const char *theSrcCStr,const int theInsertionOffset,char *theDstCStr,const int maxDstStrLength);
|
||||
void InsertPStrIntoCStr(const unsigned char *theSrcPStr,const int theInsertionOffset,char *theDstCStr,const int maxDstStrLength);
|
||||
OSErr InsertCStrIntoHandle(const char *theCString,Handle theHandle,const long inInsertOffset);
|
||||
|
||||
void CopyCStrAndInsertCStrIntoCStr(const char *theSrcCStr,const char *theInsertCStr,char *theDstCStr,const int maxDstStrLength);
|
||||
|
||||
void CopyCStrAndInsertCStrsLongIntsIntoCStr(const char *theSrcCStr,const char **theInsertCStrs,const long *theLongInts,char *theDstCStr,const int maxDstStrLength);
|
||||
|
||||
void CopyCStrAndInsert1LongIntIntoCStr(const char *theSrcCStr,const long theNum,char *theDstCStr,const int maxDstStrLength);
|
||||
void CopyCStrAndInsert2LongIntsIntoCStr(const char *theSrcCStr,const long long1,const long long2,char *theDstCStr,const int maxDstStrLength);
|
||||
void CopyCStrAndInsert3LongIntsIntoCStr(const char *theSrcCStr,const long long1,const long long2,const long long3,char *theDstCStr,const int maxDstStrLength);
|
||||
|
||||
void CopyCStrAndInsertCStrLongIntIntoCStr(const char *theSrcCStr,const char *theInsertCStr,const long theNum,char *theDstCStr,const int maxDstStrLength);
|
||||
OSErr CopyCStrAndInsertCStrLongIntIntoHandle(const char *theSrcCStr,const char *theInsertCStr,const long theNum,Handle *theHandle);
|
||||
|
||||
|
||||
OSErr CopyIndexedWordToCStr(char *theSrcCStr,int whichWord,char *theDstCStr,int maxDstCStrLength);
|
||||
OSErr CopyIndexedWordToNewHandle(char *theSrcCStr,int whichWord,Handle *outTheHandle);
|
||||
|
||||
OSErr CopyIndexedLineToCStr(const char *theSrcCStr,int inWhichLine,int *lineEndIndex,Boolean *gotLastLine,char *theDstCStr,const int maxDstCStrLength);
|
||||
OSErr CopyIndexedLineToNewHandle(const char *theSrcCStr,int inWhichLine,Handle *outNewHandle);
|
||||
|
||||
OSErr ExtractIntFromCStr(const char *theSrcCStr,int *outInt,Boolean skipLeadingSpaces = true);
|
||||
OSErr ExtractIntFromPStr(const unsigned char *theSrcPStr,int *outInt,Boolean skipLeadingSpaces = true);
|
||||
|
||||
|
||||
void ConvertCStrToUpperCase(char *theSrcCStr);
|
||||
|
||||
|
||||
int CountOccurencesOfCharInCStr(const char inChar,const char *inSrcCStr);
|
||||
int CountWordsInCStr(const char *inSrcCStr);
|
||||
|
||||
OSErr CountDigits(const char *inCStr,int *outNumIntegerDigits,int *outNumFractDigits);
|
||||
|
||||
void ExtractCStrItemFromCStr(const char *inSrcCStr,const char inItemDelimiter,const int inItemNumber,Boolean *foundItem,char *outDstCharPtr,const int inDstCharPtrMaxLength,const Boolean inTreatMultipleDelimsAsSingleDelim = false);
|
||||
OSErr ExtractCStrItemFromCStrIntoNewHandle(const char *inSrcCStr,const char inItemDelimiter,const int inItemNumber,Boolean *foundItem,Handle *outNewHandle,const Boolean inTreatMultipleDelimsAsSingleDelim = false);
|
||||
|
||||
|
||||
OSErr ExtractFloatFromCStr(const char *inCString,extended80 *outFloat);
|
||||
OSErr CopyFloatToCStr(const extended80 *theFloat,char *theCStr,const int maxCStrLength,const int inMaxNumIntDigits = -1,const int inMaxNumFractDigits = -1);
|
||||
|
||||
void SkipWhiteSpace(char **ioSrcCharPtr,const Boolean inStopAtEOL = false);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
170
MacOS/GetHTTPS.src/ErrorHandling.cpp
Normal file
170
MacOS/GetHTTPS.src/ErrorHandling.cpp
Normal file
@@ -0,0 +1,170 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* 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 "ErrorHandling.hpp"
|
||||
#include "CPStringUtils.hpp"
|
||||
|
||||
#ifdef __EXCEPTIONS_ENABLED__
|
||||
#include "CMyException.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
static char gErrorMessageBuffer[512];
|
||||
|
||||
char *gErrorMessage = gErrorMessageBuffer;
|
||||
int gErrorMessageMaxLength = sizeof(gErrorMessageBuffer);
|
||||
|
||||
|
||||
|
||||
void SetErrorMessage(const char *theErrorMessage)
|
||||
{
|
||||
if (theErrorMessage != nil)
|
||||
{
|
||||
CopyCStrToCStr(theErrorMessage,gErrorMessage,gErrorMessageMaxLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SetErrorMessageAndAppendLongInt(const char *theErrorMessage,const long theLongInt)
|
||||
{
|
||||
if (theErrorMessage != nil)
|
||||
{
|
||||
CopyCStrAndConcatLongIntToCStr(theErrorMessage,theLongInt,gErrorMessage,gErrorMessageMaxLength);
|
||||
}
|
||||
}
|
||||
|
||||
void SetErrorMessageAndCStrAndLongInt(const char *theErrorMessage,const char * theCStr,const long theLongInt)
|
||||
{
|
||||
if (theErrorMessage != nil)
|
||||
{
|
||||
CopyCStrAndInsertCStrLongIntIntoCStr(theErrorMessage,theCStr,theLongInt,gErrorMessage,gErrorMessageMaxLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SetErrorMessageAndCStr(const char *theErrorMessage,const char * theCStr)
|
||||
{
|
||||
if (theErrorMessage != nil)
|
||||
{
|
||||
CopyCStrAndInsertCStrLongIntIntoCStr(theErrorMessage,theCStr,-1,gErrorMessage,gErrorMessageMaxLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AppendCStrToErrorMessage(const char *theErrorMessage)
|
||||
{
|
||||
if (theErrorMessage != nil)
|
||||
{
|
||||
ConcatCStrToCStr(theErrorMessage,gErrorMessage,gErrorMessageMaxLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AppendLongIntToErrorMessage(const long theLongInt)
|
||||
{
|
||||
ConcatLongIntToCStr(theLongInt,gErrorMessage,gErrorMessageMaxLength);
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *GetErrorMessage(void)
|
||||
{
|
||||
return gErrorMessage;
|
||||
}
|
||||
|
||||
|
||||
OSErr GetErrorMessageInNewHandle(Handle *inoutHandle)
|
||||
{
|
||||
OSErr errCode;
|
||||
|
||||
|
||||
errCode = CopyCStrToNewHandle(gErrorMessage,inoutHandle);
|
||||
|
||||
return(errCode);
|
||||
}
|
||||
|
||||
|
||||
OSErr GetErrorMessageInExistingHandle(Handle inoutHandle)
|
||||
{
|
||||
OSErr errCode;
|
||||
|
||||
|
||||
errCode = CopyCStrToExistingHandle(gErrorMessage,inoutHandle);
|
||||
|
||||
return(errCode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
OSErr AppendErrorMessageToHandle(Handle inoutHandle)
|
||||
{
|
||||
OSErr errCode;
|
||||
|
||||
|
||||
errCode = AppendCStrToHandle(gErrorMessage,inoutHandle,nil);
|
||||
|
||||
return(errCode);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __EXCEPTIONS_ENABLED__
|
||||
|
||||
void ThrowErrorMessageException(void)
|
||||
{
|
||||
ThrowDescriptiveException(gErrorMessage);
|
||||
}
|
||||
|
||||
#endif
|
||||
147
MacOS/GetHTTPS.src/ErrorHandling.hpp
Normal file
147
MacOS/GetHTTPS.src/ErrorHandling.hpp
Normal file
@@ -0,0 +1,147 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef kGenericError
|
||||
#define kGenericError -1
|
||||
#endif
|
||||
|
||||
extern char *gErrorMessage;
|
||||
|
||||
|
||||
void SetErrorMessage(const char *theErrorMessage);
|
||||
void SetErrorMessageAndAppendLongInt(const char *theErrorMessage,const long theLongInt);
|
||||
void SetErrorMessageAndCStrAndLongInt(const char *theErrorMessage,const char * theCStr,const long theLongInt);
|
||||
void SetErrorMessageAndCStr(const char *theErrorMessage,const char * theCStr);
|
||||
void AppendCStrToErrorMessage(const char *theErrorMessage);
|
||||
void AppendLongIntToErrorMessage(const long theLongInt);
|
||||
|
||||
|
||||
char *GetErrorMessage(void);
|
||||
OSErr GetErrorMessageInNewHandle(Handle *inoutHandle);
|
||||
OSErr GetErrorMessageInExistingHandle(Handle inoutHandle);
|
||||
OSErr AppendErrorMessageToHandle(Handle inoutHandle);
|
||||
|
||||
|
||||
#ifdef __EXCEPTIONS_ENABLED__
|
||||
void ThrowErrorMessageException(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// A bunch of evil macros that would be uneccessary if I were always using C++ !
|
||||
|
||||
#define SetErrorMessageAndBailIfNil(theArg,theMessage) \
|
||||
{ \
|
||||
if (theArg == nil) \
|
||||
{ \
|
||||
SetErrorMessage(theMessage); \
|
||||
errCode = kGenericError; \
|
||||
goto EXITPOINT; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorMessageAndBail(theMessage) \
|
||||
{ \
|
||||
SetErrorMessage(theMessage); \
|
||||
errCode = kGenericError; \
|
||||
goto EXITPOINT; \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorMessageAndLongIntAndBail(theMessage,theLongInt) \
|
||||
{ \
|
||||
SetErrorMessageAndAppendLongInt(theMessage,theLongInt); \
|
||||
errCode = kGenericError; \
|
||||
goto EXITPOINT; \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorMessageAndLongIntAndBailIfError(theErrCode,theMessage,theLongInt) \
|
||||
{ \
|
||||
if (theErrCode != noErr) \
|
||||
{ \
|
||||
SetErrorMessageAndAppendLongInt(theMessage,theLongInt); \
|
||||
errCode = theErrCode; \
|
||||
goto EXITPOINT; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorMessageCStrLongIntAndBailIfError(theErrCode,theMessage,theCStr,theLongInt) \
|
||||
{ \
|
||||
if (theErrCode != noErr) \
|
||||
{ \
|
||||
SetErrorMessageAndCStrAndLongInt(theMessage,theCStr,theLongInt); \
|
||||
errCode = theErrCode; \
|
||||
goto EXITPOINT; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorMessageAndCStrAndBail(theMessage,theCStr) \
|
||||
{ \
|
||||
SetErrorMessageAndCStr(theMessage,theCStr); \
|
||||
errCode = kGenericError; \
|
||||
goto EXITPOINT; \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorMessageAndBailIfError(theErrCode,theMessage) \
|
||||
{ \
|
||||
if (theErrCode != noErr) \
|
||||
{ \
|
||||
SetErrorMessage(theMessage); \
|
||||
errCode = theErrCode; \
|
||||
goto EXITPOINT; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorMessageAndLongIntAndBailIfNil(theArg,theMessage,theLongInt) \
|
||||
{ \
|
||||
if (theArg == nil) \
|
||||
{ \
|
||||
SetErrorMessageAndAppendLongInt(theMessage,theLongInt); \
|
||||
errCode = kGenericError; \
|
||||
goto EXITPOINT; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define BailIfError(theErrCode) \
|
||||
{ \
|
||||
if ((theErrCode) != noErr) \
|
||||
{ \
|
||||
goto EXITPOINT; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrCodeAndBail(theErrCode) \
|
||||
{ \
|
||||
errCode = theErrCode; \
|
||||
\
|
||||
goto EXITPOINT; \
|
||||
}
|
||||
|
||||
|
||||
#define SetErrorCodeAndMessageAndBail(theErrCode,theMessage) \
|
||||
{ \
|
||||
SetErrorMessage(theMessage); \
|
||||
errCode = theErrCode; \
|
||||
goto EXITPOINT; \
|
||||
}
|
||||
|
||||
|
||||
#define BailNow() \
|
||||
{ \
|
||||
errCode = kGenericError; \
|
||||
goto EXITPOINT; \
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
215
MacOS/GetHTTPS.src/GetHTTPS.cpp
Normal file
215
MacOS/GetHTTPS.src/GetHTTPS.cpp
Normal file
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* An demo illustrating how to retrieve a URI from a secure HTTP server.
|
||||
*
|
||||
* Author: Roy Wood
|
||||
* Date: September 7, 1999
|
||||
* Comments: This relies heavily on my MacSockets library.
|
||||
* This project is also set up so that it expects the OpenSSL source folder (0.9.4 as I write this)
|
||||
* to live in a folder called "OpenSSL-0.9.4" in this project's parent folder. For example:
|
||||
*
|
||||
* Macintosh HD:
|
||||
* Development:
|
||||
* OpenSSL-0.9.4:
|
||||
* (OpenSSL sources here)
|
||||
* OpenSSL Example:
|
||||
* (OpenSSL example junk here)
|
||||
*
|
||||
*
|
||||
* Also-- before attempting to compile this, make sure the aliases in "OpenSSL-0.9.4:include:openssl"
|
||||
* are installed! Use the AppleScript applet in the "openssl-0.9.4" folder to do this!
|
||||
*/
|
||||
/* modified to seed the PRNG */
|
||||
|
||||
|
||||
// Include some funky libs I've developed over time
|
||||
|
||||
#include "CPStringUtils.hpp"
|
||||
#include "ErrorHandling.hpp"
|
||||
#include "MacSocket.h"
|
||||
|
||||
|
||||
// We use the OpenSSL implementation of SSL....
|
||||
// This was a lot of work to finally get going, though you wouldn't know it by the results!
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#include <timer.h>
|
||||
|
||||
// Let's try grabbing some data from here:
|
||||
|
||||
#define kHTTPS_DNS "www.apache-ssl.org"
|
||||
#define kHTTPS_Port 443
|
||||
#define kHTTPS_URI "/"
|
||||
|
||||
|
||||
// Forward-declare this
|
||||
|
||||
OSErr MyMacSocket_IdleWaitCallback(void *inUserRefPtr);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// My idle-wait callback. Doesn't do much, does it? Silly cooperative multitasking.
|
||||
|
||||
OSErr MyMacSocket_IdleWaitCallback(void *inUserRefPtr)
|
||||
{
|
||||
#pragma unused(inUserRefPtr)
|
||||
|
||||
EventRecord theEvent;
|
||||
|
||||
::EventAvail(everyEvent,&theEvent);
|
||||
|
||||
return(noErr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Finally!
|
||||
|
||||
void main(void)
|
||||
{
|
||||
OSErr errCode;
|
||||
int theSocket = -1;
|
||||
int theTimeout = 30;
|
||||
|
||||
SSL_CTX *ssl_ctx = nil;
|
||||
SSL *ssl = nil;
|
||||
|
||||
char tempString[256];
|
||||
UnsignedWide microTickCount;
|
||||
|
||||
#warning -- USE A TRUE RANDOM SEED, AND ADD ENTROPY WHENEVER POSSIBLE. --
|
||||
const char seed[] = "uyq9,7-b(VHGT^%$&^F/,876;,;./lkJHGFUY{PO*"; // Just gobbledygook
|
||||
|
||||
printf("OpenSSL Demo by Roy Wood, roy@centricsystems.ca\n\n");
|
||||
|
||||
BailIfError(errCode = MacSocket_Startup());
|
||||
|
||||
|
||||
|
||||
// Create a socket-like object
|
||||
|
||||
BailIfError(errCode = MacSocket_socket(&theSocket,false,theTimeout * 60,MyMacSocket_IdleWaitCallback,nil));
|
||||
|
||||
|
||||
// Set up the connect string and try to connect
|
||||
|
||||
CopyCStrAndInsertCStrLongIntIntoCStr("%s:%ld",kHTTPS_DNS,kHTTPS_Port,tempString,sizeof(tempString));
|
||||
|
||||
printf("Connecting to %s....\n",tempString);
|
||||
|
||||
BailIfError(errCode = MacSocket_connect(theSocket,tempString));
|
||||
|
||||
|
||||
// Init SSL stuff
|
||||
|
||||
SSL_load_error_strings();
|
||||
|
||||
SSLeay_add_ssl_algorithms();
|
||||
|
||||
|
||||
// Pick the SSL method
|
||||
|
||||
// ssl_ctx = SSL_CTX_new(SSLv2_client_method());
|
||||
ssl_ctx = SSL_CTX_new(SSLv23_client_method());
|
||||
// ssl_ctx = SSL_CTX_new(SSLv3_client_method());
|
||||
|
||||
|
||||
RAND_seed (seed, sizeof (seed));
|
||||
Microseconds (µTickCount);
|
||||
RAND_add (µTickCount, sizeof (microTickCount), 0); // Entropy is actually > 0, needs an estimate
|
||||
|
||||
// Create an SSL thingey and try to negotiate the connection
|
||||
|
||||
ssl = SSL_new(ssl_ctx);
|
||||
|
||||
SSL_set_fd(ssl,theSocket);
|
||||
|
||||
errCode = SSL_connect(ssl);
|
||||
|
||||
if (errCode < 0)
|
||||
{
|
||||
SetErrorMessageAndLongIntAndBail("OpenSSL: Can't initiate SSL connection, SSL_connect() = ",errCode);
|
||||
}
|
||||
|
||||
// Request the URI from the host
|
||||
|
||||
CopyCStrToCStr("GET ",tempString,sizeof(tempString));
|
||||
ConcatCStrToCStr(kHTTPS_URI,tempString,sizeof(tempString));
|
||||
ConcatCStrToCStr(" HTTP/1.0\r\n\r\n",tempString,sizeof(tempString));
|
||||
|
||||
|
||||
errCode = SSL_write(ssl,tempString,CStrLength(tempString));
|
||||
|
||||
if (errCode < 0)
|
||||
{
|
||||
SetErrorMessageAndLongIntAndBail("OpenSSL: Error writing data via ssl, SSL_write() = ",errCode);
|
||||
}
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
char tempString[256];
|
||||
int bytesRead;
|
||||
|
||||
|
||||
// Read some bytes and dump them to the console
|
||||
|
||||
bytesRead = SSL_read(ssl,tempString,sizeof(tempString) - 1);
|
||||
|
||||
if (bytesRead == 0 && MacSocket_RemoteEndIsClosing(theSocket))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
else if (bytesRead < 0)
|
||||
{
|
||||
SetErrorMessageAndLongIntAndBail("OpenSSL: Error reading data via ssl, SSL_read() = ",bytesRead);
|
||||
}
|
||||
|
||||
|
||||
tempString[bytesRead] = '\0';
|
||||
|
||||
printf(tempString);
|
||||
}
|
||||
|
||||
printf("\n\n\n");
|
||||
|
||||
// All done!
|
||||
|
||||
errCode = noErr;
|
||||
|
||||
|
||||
EXITPOINT:
|
||||
|
||||
// Clean up and go home
|
||||
|
||||
if (theSocket >= 0)
|
||||
{
|
||||
MacSocket_close(theSocket);
|
||||
}
|
||||
|
||||
if (ssl != nil)
|
||||
{
|
||||
SSL_free(ssl);
|
||||
}
|
||||
|
||||
if (ssl_ctx != nil)
|
||||
{
|
||||
SSL_CTX_free(ssl_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (errCode != noErr)
|
||||
{
|
||||
printf("An error occurred:\n");
|
||||
|
||||
printf(GetErrorMessage());
|
||||
}
|
||||
|
||||
|
||||
MacSocket_Shutdown();
|
||||
}
|
||||
1607
MacOS/GetHTTPS.src/MacSocket.cpp
Normal file
1607
MacOS/GetHTTPS.src/MacSocket.cpp
Normal file
File diff suppressed because it is too large
Load Diff
103
MacOS/GetHTTPS.src/MacSocket.h
Normal file
103
MacOS/GetHTTPS.src/MacSocket.h
Normal file
@@ -0,0 +1,103 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
kMacSocket_TimeoutErr = -2
|
||||
};
|
||||
|
||||
|
||||
// Since MacSocket does busy waiting, I do a callback while waiting
|
||||
|
||||
typedef OSErr (*MacSocket_IdleWaitCallback)(void *);
|
||||
|
||||
|
||||
// Call this before anything else!
|
||||
|
||||
OSErr MacSocket_Startup(void);
|
||||
|
||||
|
||||
// Call this to cleanup before quitting
|
||||
|
||||
OSErr MacSocket_Shutdown(void);
|
||||
|
||||
|
||||
// Call this to allocate a "socket" (reference number is returned in outSocketNum)
|
||||
// Note that inDoThreadSwitching is pretty much irrelevant right now, since I ignore it
|
||||
// The inTimeoutTicks parameter is applied during reads/writes of data
|
||||
// The inIdleWaitCallback parameter specifies a callback which is called during busy-waiting periods
|
||||
// The inUserRefPtr parameter is passed back to the idle-wait callback
|
||||
|
||||
OSErr MacSocket_socket(int *outSocketNum,const Boolean inDoThreadSwitching,const long inTimeoutTicks,MacSocket_IdleWaitCallback inIdleWaitCallback,void *inUserRefPtr);
|
||||
|
||||
|
||||
// Call this to connect to an IP/DNS address
|
||||
// Note that inTargetAddressAndPort is in "IP:port" format-- e.g. 10.1.1.1:123
|
||||
|
||||
OSErr MacSocket_connect(const int inSocketNum,char *inTargetAddressAndPort);
|
||||
|
||||
|
||||
// Call this to listen on a port
|
||||
// Since this a low-performance implementation, I allow a maximum of 1 (one!) incoming request when I listen
|
||||
|
||||
OSErr MacSocket_listen(const int inSocketNum,const int inPortNum);
|
||||
|
||||
|
||||
// Call this to close a socket
|
||||
|
||||
OSErr MacSocket_close(const int inSocketNum);
|
||||
|
||||
|
||||
// Call this to receive data on a socket
|
||||
// Most parameters' purpose are obvious-- except maybe "inBlock" which controls whether I wait for data or return immediately
|
||||
|
||||
int MacSocket_recv(const int inSocketNum,void *outBuff,int outBuffLength,const Boolean inBlock);
|
||||
|
||||
|
||||
// Call this to send data on a socket
|
||||
|
||||
int MacSocket_send(const int inSocketNum,void *inBuff,int inBuffLength);
|
||||
|
||||
|
||||
// If zero bytes were read in a call to MacSocket_recv(), it may be that the remote end has done a half-close
|
||||
// This function will let you check whether that's true or not
|
||||
|
||||
Boolean MacSocket_RemoteEndIsClosing(const int inSocketNum);
|
||||
|
||||
|
||||
// Call this to see if the listen has completed after a call to MacSocket_listen()
|
||||
|
||||
Boolean MacSocket_ListenCompleted(const int inSocketNum);
|
||||
|
||||
|
||||
// These really aren't very useful anymore
|
||||
|
||||
Boolean MacSocket_LocalEndIsOpen(const int inSocketNum);
|
||||
Boolean MacSocket_RemoteEndIsOpen(const int inSocketNum);
|
||||
|
||||
|
||||
// You may wish to change the userRefPtr for a socket callback-- use this to do it
|
||||
|
||||
void MacSocket_SetUserRefPtr(const int inSocketNum,void *inNewRefPtr);
|
||||
|
||||
|
||||
// Call these to get the socket's IP:port descriptor
|
||||
|
||||
void MacSocket_GetLocalIPAndPort(const int inSocketNum,char *outIPAndPort,const int inIPAndPortLength);
|
||||
void MacSocket_GetRemoteIPAndPort(const int inSocketNum,char *outIPAndPort,const int inIPAndPortLength);
|
||||
|
||||
|
||||
// Call this to get error info from a socket
|
||||
|
||||
void MacSocket_GetSocketErrorInfo(const int inSocketNum,int *outSocketErrCode,char *outSocketErrString,const int inSocketErrStringMaxLength);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
4939
MacOS/OpenSSL.mcp.hqx
Normal file
4939
MacOS/OpenSSL.mcp.hqx
Normal file
File diff suppressed because it is too large
Load Diff
18
MacOS/TODO
Normal file
18
MacOS/TODO
Normal file
@@ -0,0 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Verify server certificate
|
||||
-------------------------------------------------------------------
|
||||
Currently omitted from the project:
|
||||
|
||||
crypto/tmdiff.c
|
||||
crypto/bio/bss_conn.c
|
||||
crypto/bio/b_sock.c
|
||||
crypto/bio/bss_acpt.c
|
||||
crypto/bio/bss_log.h
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Build libraries to link with...
|
||||
-------------------------------------------------------------------
|
||||
Port openssl application.
|
||||
-------------------------------------------------------------------
|
||||
BN optimizations (currently PPC version is compiled with BN_LLONG)
|
||||
-------------------------------------------------------------------
|
||||
9
MacOS/_MWERKS_GUSI_prefix.h
Normal file
9
MacOS/_MWERKS_GUSI_prefix.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <MacHeaders.h>
|
||||
#define B_ENDIAN
|
||||
#ifdef __POWERPC__
|
||||
#pragma longlong on
|
||||
#endif
|
||||
#if 1
|
||||
#define MAC_OS_GUSI_SOURCE
|
||||
#endif
|
||||
#define MONOLITH
|
||||
9
MacOS/_MWERKS_prefix.h
Normal file
9
MacOS/_MWERKS_prefix.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <MacHeaders.h>
|
||||
#define B_ENDIAN
|
||||
#ifdef __POWERPC__
|
||||
#pragma longlong on
|
||||
#endif
|
||||
#if 0
|
||||
#define MAC_OS_GUSI_SOURCE
|
||||
#endif
|
||||
#define MONOLITH
|
||||
5
MacOS/buildinf.h
Normal file
5
MacOS/buildinf.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#ifndef MK1MF_BUILD
|
||||
# define CFLAGS "-DB_ENDIAN"
|
||||
# define PLATFORM "macos"
|
||||
# define DATE "Sat Dec 18 23:10 MEST 1999"
|
||||
#endif
|
||||
820
MacOS/mklinks.as.hqx
Normal file
820
MacOS/mklinks.as.hqx
Normal file
@@ -0,0 +1,820 @@
|
||||
(This file must be converted with BinHex 4.0)
|
||||
|
||||
:#QeVE'PZDh-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
|
||||
!!!$rrb!!!9)!!!!!!!(rra3!!@i#DG`%!)$rr`!!!Pi#DH"X!!$rr`!!!Ri!!!!
|
||||
!!)$rr`!!!S-#DH"d!*Err`!!!Si!!!!!!*Err`!!!j)!!!!!!*Err`!!"CB#DH%
|
||||
i!*Err`!!"GS#DH%dkF$rr`!!"[`!!!!!rrrrr`!!"a)!!!!!!)$rr`!!"b!!!!!
|
||||
!*4S:
|
||||
117
MacOS/opensslconf.h
Normal file
117
MacOS/opensslconf.h
Normal file
@@ -0,0 +1,117 @@
|
||||
/* MacOS/opensslconf.h */
|
||||
|
||||
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
|
||||
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
|
||||
#define OPENSSLDIR "/usr/local/ssl"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
|
||||
#define IDEA_INT unsigned int
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_MD2_H) && !defined(MD2_INT)
|
||||
#define MD2_INT unsigned int
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_RC2_H) && !defined(RC2_INT)
|
||||
/* I need to put in a mod for the alpha - eay */
|
||||
#define RC2_INT unsigned int
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_RC4_H)
|
||||
#if !defined(RC4_INT)
|
||||
/* using int types make the structure larger but make the code faster
|
||||
* on most boxes I have tested - up to %20 faster. */
|
||||
/*
|
||||
* I don't know what does "most" mean, but declaring "int" is a must on:
|
||||
* - Intel P6 because partial register stalls are very expensive;
|
||||
* - elder Alpha because it lacks byte load/store instructions;
|
||||
*/
|
||||
#define RC4_INT unsigned char
|
||||
#endif
|
||||
#if !defined(RC4_CHUNK)
|
||||
/*
|
||||
* This enables code handling data aligned at natural CPU word
|
||||
* boundary. See crypto/rc4/rc4_enc.c for further details.
|
||||
*/
|
||||
#define RC4_CHUNK unsigned long
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_DES_H) && !defined(DES_LONG)
|
||||
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
|
||||
* %20 speed up (longs are 8 bytes, int's are 4). */
|
||||
#ifndef DES_LONG
|
||||
#define DES_LONG unsigned long
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
|
||||
#define CONFIG_HEADER_BN_H
|
||||
#if __option(longlong)
|
||||
# define BN_LLONG
|
||||
#else
|
||||
# undef BN_LLONG
|
||||
#endif
|
||||
|
||||
/* Should we define BN_DIV2W here? */
|
||||
|
||||
/* Only one for the following should be defined */
|
||||
/* The prime number generation stuff may not work when
|
||||
* EIGHT_BIT but I don't care since I've only used this mode
|
||||
* for debuging the bignum libraries */
|
||||
#undef SIXTY_FOUR_BIT_LONG
|
||||
#undef SIXTY_FOUR_BIT
|
||||
#define THIRTY_TWO_BIT
|
||||
#undef SIXTEEN_BIT
|
||||
#undef EIGHT_BIT
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
|
||||
#define CONFIG_HEADER_RC4_LOCL_H
|
||||
/* if this is defined data[i] is used instead of *data, this is a %20
|
||||
* speedup on x86 */
|
||||
#undef RC4_INDEX
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
|
||||
#define CONFIG_HEADER_BF_LOCL_H
|
||||
#define BF_PTR
|
||||
#endif /* HEADER_BF_LOCL_H */
|
||||
|
||||
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
|
||||
#define CONFIG_HEADER_DES_LOCL_H
|
||||
/* the following is tweaked from a config script, that is why it is a
|
||||
* protected undef/define */
|
||||
#ifndef DES_PTR
|
||||
#define DES_PTR
|
||||
#endif
|
||||
|
||||
/* This helps C compiler generate the correct code for multiple functional
|
||||
* units. It reduces register dependancies at the expense of 2 more
|
||||
* registers */
|
||||
#ifndef DES_RISC1
|
||||
#define DES_RISC1
|
||||
#endif
|
||||
|
||||
#ifndef DES_RISC2
|
||||
#undef DES_RISC2
|
||||
#endif
|
||||
|
||||
#if defined(DES_RISC1) && defined(DES_RISC2)
|
||||
YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
||||
#endif
|
||||
|
||||
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
|
||||
* Very mucy CPU dependant */
|
||||
#ifndef DES_UNROLL
|
||||
#define DES_UNROLL
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_DES_LOCL_H */
|
||||
|
||||
#ifndef __POWERPC__
|
||||
#define SHA_XARRAY
|
||||
#endif
|
||||
|
||||
49
Makefile.org
49
Makefile.org
@@ -56,6 +56,8 @@ EX_LIBS=
|
||||
AR=ar r
|
||||
RANLIB= ranlib
|
||||
PERL= perl
|
||||
TAR= tar
|
||||
TARFLAGS= --norecurse
|
||||
|
||||
# Set BN_ASM to bn_asm.o if you want to use the C version
|
||||
BN_ASM= bn_asm.o
|
||||
@@ -156,6 +158,7 @@ SDIRS= \
|
||||
MAKEFILE= Makefile.ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
|
||||
MANDIR=$(OPENSSLDIR)/man
|
||||
MAN1=1
|
||||
MAN3=3
|
||||
SHELL=/bin/sh
|
||||
@@ -180,6 +183,7 @@ all: Makefile.ssl
|
||||
(cd $$i && echo "making all in $$i..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' 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}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' SDIRS='${SDIRS}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \
|
||||
done
|
||||
-@# cd crypto; $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' 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}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' SDIRS='${SDIRS}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' testapps
|
||||
-@# cd perl; $(PERL) Makefile.PL; make
|
||||
|
||||
sub_all:
|
||||
@@ -215,7 +219,7 @@ libclean:
|
||||
rm -f *.a */lib */*/lib
|
||||
|
||||
clean:
|
||||
rm -f shlib/*.o *.o core a.out fluff *.map
|
||||
rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
|
||||
@for i in $(DIRS) ;\
|
||||
do \
|
||||
(cd $$i && echo "making clean in $$i..." && \
|
||||
@@ -258,8 +262,10 @@ dclean:
|
||||
$(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
|
||||
done;
|
||||
|
||||
rehash:
|
||||
rehash: rehash.time
|
||||
rehash.time: certs
|
||||
@(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
|
||||
touch rehash.time
|
||||
|
||||
test: tests
|
||||
|
||||
@@ -268,6 +274,9 @@ tests: rehash
|
||||
$(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}' tests );
|
||||
@apps/openssl version -a
|
||||
|
||||
report:
|
||||
@$(PERL) util/selftest.pl
|
||||
|
||||
depend:
|
||||
@for i in $(DIRS) ;\
|
||||
do \
|
||||
@@ -298,14 +307,17 @@ util/libeay.num::
|
||||
util/ssleay.num::
|
||||
perl util/mkdef.pl ssl update
|
||||
|
||||
crypto/objects/obj_dat.h: crypto/objects/objects.h crypto/objects/obj_dat.pl
|
||||
perl crypto/objects/obj_dat.pl crypto/objects/objects.h crypto/objects/obj_dat.h
|
||||
|
||||
TABLE: Configure
|
||||
(echo 'Output of `Configure TABLE'"':"; \
|
||||
perl Configure TABLE) > TABLE
|
||||
|
||||
update: depend errors util/libeay.num util/ssleay.num TABLE
|
||||
update: depend errors util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
|
||||
|
||||
tar:
|
||||
@tar --norecurse -cvf - \
|
||||
@$(TAR) $(TARFLAGS) -cvf - \
|
||||
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort` |\
|
||||
tardy --user_number=0 --user_name=openssl \
|
||||
--group_number=0 --group_name=openssl \
|
||||
@@ -322,7 +334,7 @@ dist:
|
||||
dist_pem_h:
|
||||
(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
|
||||
|
||||
install: all
|
||||
install: all install_docs
|
||||
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \
|
||||
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
|
||||
@@ -338,7 +350,7 @@ install: all
|
||||
@for i in $(DIRS) ;\
|
||||
do \
|
||||
(cd $$i; echo "installing $$i..."; \
|
||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
|
||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' install ); \
|
||||
done
|
||||
@for i in $(LIBS) ;\
|
||||
do \
|
||||
@@ -348,4 +360,29 @@ install: all
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
done
|
||||
|
||||
install_docs:
|
||||
@$(PERL) $(TOP)/util/mkdir-p.pl \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man1 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man3 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man7
|
||||
@echo installing man 1 and man 5
|
||||
@for i in doc/apps/*.pod; do \
|
||||
(cd `dirname $$i`; \
|
||||
fn=`basename $$i .pod`; \
|
||||
sec=`[ "$$fn" = "config" ] && echo 5 || echo 1`; \
|
||||
$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i` \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec); \
|
||||
done
|
||||
@echo installing man 3 and man 7
|
||||
@for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
||||
(cd `dirname $$i`; \
|
||||
fn=`basename $$i .pod`; \
|
||||
sec=`[ "$$fn" = "des_modes" ] && echo 7 || echo 3`; \
|
||||
$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i` \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec); \
|
||||
done
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
36
NEWS
36
NEWS
@@ -5,6 +5,42 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5:
|
||||
|
||||
o S/MIME support in new 'smime' command
|
||||
o Documentation for the OpenSSL command line application
|
||||
o Automation of 'req' application
|
||||
o Fixes to make s_client, s_server work under Windows
|
||||
o Support for multiple fieldnames in SPKACs
|
||||
o New SPKAC command line utilty and associated library functions
|
||||
o Options to allow passwords to be obtained from various sources
|
||||
o New public key PEM format and options to handle it
|
||||
o Many other fixes and enhancements to command line utilities
|
||||
o Usable certificate chain verification
|
||||
o Certificate purpose checking
|
||||
o Certificate trust settings
|
||||
o Support of authority information access extension
|
||||
o Extensions in certificate requests
|
||||
o Simplified X509 name and attribute routines
|
||||
o Initial (incomplete) support for international character sets
|
||||
o New DH_METHOD, DSA_METHOD and enhanced RSA_METHOD
|
||||
o Read only memory BIOs and simplified creation function
|
||||
o TLS/SSL protocol bugfixes: Accept TLS 'client hello' in SSL 3.0
|
||||
record; allow fragmentation and interleaving of handshake and other
|
||||
data
|
||||
o TLS/SSL code now "tolerates" MS SGC
|
||||
o Work around for Netscape client certificate hang bug
|
||||
o RSA_NULL option that removes RSA patent code but keeps other
|
||||
RSA functionality
|
||||
o Memory leak detection now allows applications to add extra information
|
||||
via a per-thread stack
|
||||
o PRNG robustness improved
|
||||
o EGD support
|
||||
o BIGNUM library bug fixes
|
||||
o Faster DSA parameter generation
|
||||
o Enhanced support for Alpha Linux
|
||||
o Experimental MacOS support
|
||||
|
||||
Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4:
|
||||
|
||||
o Transparent support for PKCS#8 format private keys: these are used
|
||||
|
||||
83
README
83
README
@@ -1,7 +1,7 @@
|
||||
|
||||
OpenSSL 0.9.4 09 Aug 1999
|
||||
OpenSSL 0.9.5-dev xx XXX 2000
|
||||
|
||||
Copyright (c) 1998-1999 The OpenSSL Project
|
||||
Copyright (c) 1998-2000 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
@@ -80,40 +80,14 @@
|
||||
A Configuration loader that uses a format similar to MS .ini files.
|
||||
|
||||
openssl:
|
||||
A command line tool which provides the following functions:
|
||||
A command line tool that can be used for:
|
||||
Creation of RSA, DH and DSA key parameters
|
||||
Creation of X.509 certificates, CSRs and CRLs
|
||||
Calculation of Message Digests
|
||||
Encryption and Decryption with Ciphers
|
||||
SSL/TLS Client and Server Tests
|
||||
Handling of S/MIME signed or encrypted mail
|
||||
|
||||
enc - a general encryption program that can encrypt/decrypt using
|
||||
one of 17 different cipher/mode combinations. The
|
||||
input/output can also be converted to/from base64
|
||||
ascii encoding.
|
||||
dgst - a generate message digesting program that will generate
|
||||
message digests for any of md2, md5, sha (sha-0 or sha-1)
|
||||
or mdc2.
|
||||
asn1parse - parse and display the structure of an asn1 encoded
|
||||
binary file.
|
||||
rsa - Manipulate RSA private keys.
|
||||
dsa - Manipulate DSA private keys.
|
||||
dh - Manipulate Diffie-Hellman parameter files.
|
||||
dsaparam- Manipulate and generate DSA parameter files.
|
||||
crl - Manipulate certificate revocation lists.
|
||||
crt2pkcs7- Generate a pkcs7 object containing a crl and a certificate.
|
||||
x509 - Manipulate x509 certificates, self-sign certificates.
|
||||
req - Manipulate PKCS#10 certificate requests and also
|
||||
generate certificate requests.
|
||||
genrsa - Generates an arbitrary sized RSA private key.
|
||||
gendsa - Generates DSA parameters.
|
||||
gendh - Generates a set of Diffie-Hellman parameters, the prime
|
||||
will be a strong prime.
|
||||
ca - Create certificates from PKCS#10 certificate requests.
|
||||
This program also maintains a database of certificates
|
||||
issued.
|
||||
verify - Check x509 certificate signatures.
|
||||
speed - Benchmark OpenSSL's ciphers.
|
||||
s_server- A test SSL server.
|
||||
s_client- A test SSL client.
|
||||
s_time - Benchmark SSL performance of SSL server programs.
|
||||
errstr - Convert from OpenSSL hex error codes to a readable form.
|
||||
nseq - Netscape certificate sequence utility
|
||||
|
||||
PATENTS
|
||||
-------
|
||||
@@ -157,43 +131,40 @@
|
||||
If you have any problems with OpenSSL then please take the following steps
|
||||
first:
|
||||
|
||||
- Download the current snapshot from ftp://ftp.openssl.org/snapshot/
|
||||
to see if the problem has already been addressed
|
||||
- Remove ASM versions of libraries
|
||||
- Remove compiler optimisation flags
|
||||
- Add compiler debug flags (if using gcc then remove -fomit-frame-pointer
|
||||
before you try to debug things)
|
||||
|
||||
If you wish to report a bug then please include the following information in
|
||||
any bug report:
|
||||
|
||||
OpenSSL Details
|
||||
- Version, most of these details can be got from the
|
||||
'openssl version -a' command.
|
||||
Operating System Details
|
||||
- On Unix systems: Output of './config -t'
|
||||
- OS Name, Version
|
||||
- Hardware platform
|
||||
Compiler Details
|
||||
- Name
|
||||
- Version
|
||||
Application Details
|
||||
- Name
|
||||
- Version
|
||||
Problem Description
|
||||
- include steps that will reproduce the problem (if known)
|
||||
Stack Traceback (if the application dumps core)
|
||||
- On Unix systems:
|
||||
Self-test report generated by 'make report'
|
||||
- On other systems:
|
||||
OpenSSL version: output of 'openssl version -a'
|
||||
OS Name, Version, Hardware platform
|
||||
Compiler Details (name, version)
|
||||
- Application Details (name, version)
|
||||
- Problem Description (steps that will reproduce the problem, if known)
|
||||
- Stack Traceback (if the application dumps core)
|
||||
|
||||
Report the bug to the OpenSSL project at:
|
||||
|
||||
openssl-bugs@openssl.org
|
||||
|
||||
Note that mail to openssl-bugs@openssl.org is forwarded to a public
|
||||
mailing list. Confidential mail may be sent to openssl-security@openssl.org
|
||||
(PGP key available from the key servers).
|
||||
|
||||
HOW TO CONTRIBUTE TO OpenSSL
|
||||
----------------------------
|
||||
|
||||
Development is coordinated on the openssl-dev mailing list (see
|
||||
http://www.openssl.org for information on subscribing). If you
|
||||
would like to submit a patch, send it to openssl-dev@openssl.org.
|
||||
Please be sure to include a textual explanation of what your patch
|
||||
does.
|
||||
would like to submit a patch, send it to openssl-dev@openssl.org with
|
||||
the string "[PATCH]" in the subject. Please be sure to include a
|
||||
textual explanation of what your patch does.
|
||||
|
||||
The preferred format for changes is "diff -u" output. You might
|
||||
generate it like this:
|
||||
|
||||
63
STATUS
63
STATUS
@@ -1,10 +1,22 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 1999/08/09 10:25:36 $
|
||||
______________ $Date: 2000/02/27 01:15:18 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 0.9.4: Is rolled the next hour...
|
||||
o OpenSSL 0.9.5: Under development...
|
||||
0.9.5-beta1 is available.
|
||||
Debian GNU/Linux 2.1 - test passed
|
||||
Mingw32 egcs 1.1.2 - test passed
|
||||
FreeBSD 3.0-RELEASE - test passed
|
||||
FreeBSD 3.2-RELEASE - test passed
|
||||
solaris-sparcv9-cc - test passed
|
||||
solaris-sparcv9-gcc - test passed
|
||||
hpux-parisc-gcc - test passed
|
||||
AIX 4.3 (aix-cc) - test passed
|
||||
VC++ - test passed
|
||||
Proposed release time: Monday, February 28th 2000
|
||||
o OpenSSL 0.9.4: Released on August 09th, 1999
|
||||
o OpenSSL 0.9.3a: Released on May 29th, 1999
|
||||
o OpenSSL 0.9.3: Released on May 25th, 1999
|
||||
o OpenSSL 0.9.2b: Released on March 22th, 1999
|
||||
@@ -14,48 +26,22 @@
|
||||
|
||||
AVAILABLE PATCHES
|
||||
|
||||
o OCSP (titchenert@certco.com)
|
||||
o getenv in ca.c and x509_def.c (jaltman@watsun.cc.columbia.edu)
|
||||
o shared libraries <behnke@trustcenter.de>
|
||||
o CA.pl patch (Damien Miller)
|
||||
o FreeBSD 3.0 changes (Richard Levitte)
|
||||
|
||||
IN PROGRESS
|
||||
|
||||
o Steve is currently working on (in no particular order):
|
||||
Proper (or at least usable) certificate chain verification.
|
||||
Private key, certificate and CRL API and implementation.
|
||||
Checking and bugfixing PKCS#7 (S/MIME code).
|
||||
|
||||
o Mark is currently working on:
|
||||
Folding in any changes that are in the C2Net code base that were
|
||||
not in the original SSLeay-0.9.1.b release. Plus other minor
|
||||
tidying.
|
||||
|
||||
o Ralf is currently working on:
|
||||
1. Support for SSL_set_default_verify_paths(),
|
||||
SSL_load_verify_locations(), SSL_get_cert_store() and
|
||||
SSL_set_cert_store() functions which work like their existing
|
||||
SSL_CTX_xxx() variants but on a per connection basis. That's needed
|
||||
to let us provide full-featured per-URL client verification in
|
||||
mod_ssl or Apache-SSL.
|
||||
=> It still dumps core, so I suspend this and investigate
|
||||
again for OpenSSL 0.9.3.
|
||||
2. The perl/ stuff to make it really work the first time ;-)
|
||||
=> I'll investigate a few more hours for OpenSSL 0.9.2
|
||||
3. The new documentation set in POD format under doc/
|
||||
=> I'll investigate a few more hours for OpenSSL 0.9.2
|
||||
4. More cleanups to get rid of obsolete/old/ugly files in the
|
||||
source tree which are not really needed.
|
||||
=> Done all which were possible with my personal knowledge
|
||||
|
||||
o Ben is currently working on:
|
||||
1. Function Prototype Thought Police issues.
|
||||
2. Integrated documentation.
|
||||
3. New TLS Ciphersuites.
|
||||
4. Anything else that takes his fancy.
|
||||
Developing and bugfixing PKCS#7 (S/MIME code).
|
||||
Various X509 issues: character sets, certificate request extensions.
|
||||
Documentation for the openssl utility.
|
||||
|
||||
NEEDS PATCH
|
||||
|
||||
o salzr@certco.com (Rich Salz): Bug in X509_name_print
|
||||
<29E0A6D39ABED111A36000A0C99609CA2C2BA4@macertco-srv1.ma.certco.com>
|
||||
o non-blocking socket on AIX
|
||||
o $(PERL) in */Makefile.ssl
|
||||
o "Sign the certificate?" - "n" creates empty certificate file
|
||||
|
||||
@@ -84,6 +70,11 @@
|
||||
compiler PIC and linker DSO flags from Apache
|
||||
into the OpenSSL Configure script.
|
||||
|
||||
Ulf: +1 for using GNU autoconf and libtool (but not automake,
|
||||
which apparently is not flexible enough to generate
|
||||
libcrypto)
|
||||
|
||||
|
||||
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
|
||||
@@ -109,8 +100,6 @@
|
||||
use a key length decided by the size of the RSA encrypted key and expect
|
||||
RC2 to adapt).
|
||||
|
||||
o Properly initialize the PRNG in the absence of /dev/random.
|
||||
|
||||
o ERR_error_string(..., buf) does not know how large buf is,
|
||||
there should be ERR_error_string_n(..., buf, bufsize)
|
||||
or similar.
|
||||
|
||||
361
TABLE
361
TABLE
@@ -36,7 +36,7 @@ $rc5_obj =
|
||||
|
||||
*** BS2000-OSD
|
||||
$cc = c89
|
||||
$cflags = -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC
|
||||
$cflags = -O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags = -lsocket -lnsl
|
||||
@@ -91,7 +91,7 @@ $cflags = -DTERMIOS -O3 -fomit-frame-pointer
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -102,6 +102,23 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** FreeBSD-elf
|
||||
$cc = gcc
|
||||
$cflags = -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
|
||||
$bn_obj = asm/bn86-elf.o asm/co86-elf.o
|
||||
$des_obj = asm/dx86-elf.o asm/yx86-elf.o
|
||||
$bf_obj = asm/bx86-elf.o
|
||||
$md5_obj = asm/mx86-elf.o
|
||||
$sha1_obj = asm/sx86-elf.o
|
||||
$cast_obj = asm/cx86-elf.o
|
||||
$rc4_obj = asm/rx86-elf.o
|
||||
$rmd160_obj = asm/rm86-elf.o
|
||||
$rc5_obj = asm/r586-elf.o
|
||||
|
||||
*** Mingw32
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall
|
||||
@@ -431,8 +448,8 @@ $cflags = -std1 -tune host -O4 -readonly_strings
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG
|
||||
$bn_obj =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
|
||||
$bn_obj = asm/alpha.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
@@ -448,8 +465,8 @@ $cflags = -O3
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1
|
||||
$bn_obj = asm/alpha.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
@@ -465,8 +482,8 @@ $cflags = -std1 -tune host -fast -readonly_strings
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG
|
||||
$bn_obj =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
|
||||
$bn_obj = asm/alpha.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
@@ -533,7 +550,7 @@ $cflags = -DBIT_FIELD_LIMITS -DTERMIOS
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG DES_INT
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -563,7 +580,7 @@ $rc5_obj =
|
||||
|
||||
*** debug
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags = -lefence
|
||||
@@ -580,7 +597,7 @@ $rc5_obj =
|
||||
|
||||
*** debug-ben
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DPEDANTIC -O2 -pedantic -Wall -Wshadow -Werror -pipe
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -O2 -pedantic -Wall -Wshadow -Werror -pipe
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
@@ -597,7 +614,7 @@ $rc5_obj =
|
||||
|
||||
*** debug-ben-debug
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
@@ -614,7 +631,7 @@ $rc5_obj =
|
||||
|
||||
*** debug-ben-strict
|
||||
$cc = gcc
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe
|
||||
$cflags = -DBN_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
@@ -631,7 +648,7 @@ $rc5_obj =
|
||||
|
||||
*** debug-bodo
|
||||
$cc = gcc
|
||||
$cflags = -DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG_ALL -g -m486 -Wall
|
||||
$cflags = -DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -m486 -pedantic -Wshadow -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
@@ -646,9 +663,26 @@ $rc4_obj = asm/rx86-elf.o
|
||||
$rmd160_obj = asm/rm86-elf.o
|
||||
$rc5_obj = asm/r586-elf.o
|
||||
|
||||
*** debug-levitte-linux-elf
|
||||
$cc = gcc
|
||||
$cflags = -DRL_DEBUG -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops =
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** debug-linux-elf
|
||||
$cc = gcc
|
||||
$cflags = -DREF_CHECK -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall
|
||||
$cflags = -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -m486 -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lefence
|
||||
@@ -680,14 +714,14 @@ $rc4_obj = asm/rx86-elf.o
|
||||
$rmd160_obj = asm/rm86-elf.o
|
||||
$rc5_obj = asm/r586-elf.o
|
||||
|
||||
*** debug-solaris-sparcv8-gcc
|
||||
$cc = gcc
|
||||
$cflags = -DREF_CHECK -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN
|
||||
*** debug-solaris-sparcv8-cc
|
||||
$cc = cc
|
||||
$cflags = -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
@@ -697,13 +731,47 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** debug-solaris-sparcv9-gcc
|
||||
*** debug-solaris-sparcv8-gcc
|
||||
$cc = gcc
|
||||
$cflags = -DREF_CHECK -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN
|
||||
$cflags = -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** debug-solaris-sparcv9-cc
|
||||
$cc = cc
|
||||
$cflags = -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W -DULTRASPARC
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8plus.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj = asm/md5-sparcv8plus.o
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** debug-solaris-sparcv9-gcc
|
||||
$cc = gcc
|
||||
$cflags = -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8plus.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -714,6 +782,40 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** debug-steve
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DREF_CHECK -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Werror -Wshadow -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
|
||||
$bn_obj = asm/bn86-elf.o asm/co86-elf.o
|
||||
$des_obj = asm/dx86-elf.o asm/yx86-elf.o
|
||||
$bf_obj = asm/bx86-elf.o
|
||||
$md5_obj = asm/mx86-elf.o
|
||||
$sha1_obj = asm/sx86-elf.o
|
||||
$cast_obj = asm/cx86-elf.o
|
||||
$rc4_obj = asm/rx86-elf.o
|
||||
$rmd160_obj = asm/rm86-elf.o
|
||||
$rc5_obj = asm/r586-elf.o
|
||||
|
||||
*** debug-ulf
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DREF_CHECK -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -g -O2 -m486 -Wall -Werror -Wshadow -pipe
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
|
||||
$bn_obj = asm/bn86-elf.o asm/co86-elf.o
|
||||
$des_obj = asm/dx86-elf.o asm/yx86-elf.o
|
||||
$bf_obj = asm/bx86-elf.o
|
||||
$md5_obj = asm/mx86-elf.o
|
||||
$sha1_obj = asm/sx86-elf.o
|
||||
$cast_obj = asm/cx86-elf.o
|
||||
$rc4_obj = asm/rx86-elf.o
|
||||
$rmd160_obj = asm/rm86-elf.o
|
||||
$rc5_obj = asm/r586-elf.o
|
||||
|
||||
*** dgux-R3-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -fomit-frame-pointer
|
||||
@@ -835,7 +937,7 @@ $rc5_obj =
|
||||
|
||||
*** hpux-cc
|
||||
$cc = cc
|
||||
$cflags = -DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O4 -z
|
||||
$cflags = -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
@@ -867,6 +969,40 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** hpux-parisc-cc
|
||||
$cc = cc
|
||||
$cflags = -Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** hpux-parisc-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag =
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** hpux10-brokencc
|
||||
$cc = cc
|
||||
$cflags = -DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z
|
||||
@@ -903,7 +1039,7 @@ $rc5_obj =
|
||||
|
||||
*** hpux10-cc
|
||||
$cc = cc
|
||||
$cflags = -DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O4 -z
|
||||
$cflags = -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
@@ -935,26 +1071,9 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** hpux11-32bit-cc
|
||||
*** hpux64-parisc-cc
|
||||
$cc = cc
|
||||
$cflags = +DA2.0 -DB_ENDIAN -D_HPUX_SOURCE -Aa -Ae +ESlit
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops = DES_PTR DES_UNROLL DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** hpux11-64bit-cc
|
||||
$cc = cc
|
||||
$cflags = +DA2.0W -g -D_HPUX_SOURCE -Aa -Ae +ESlit
|
||||
$cflags = -Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
@@ -975,7 +1094,7 @@ $cflags = -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -992,7 +1111,7 @@ $cflags = -O3 -DTERMIOS -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR
|
||||
$bn_ops = BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1005,11 +1124,11 @@ $rc5_obj =
|
||||
|
||||
*** irix-mips3-cc
|
||||
$cc = cc
|
||||
$cflags = -n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN
|
||||
$cflags = -n32 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = DES_PTR DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT
|
||||
$bn_ops = DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT
|
||||
$bn_obj = asm/mips3.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1022,11 +1141,11 @@ $rc5_obj =
|
||||
|
||||
*** irix-mips3-gcc
|
||||
$cc = gcc
|
||||
$cflags = -mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN
|
||||
$cflags = -mabi=n32 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT
|
||||
$bn_ops = MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT
|
||||
$bn_obj = asm/mips3.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1039,11 +1158,11 @@ $rc5_obj =
|
||||
|
||||
*** irix64-mips4-cc
|
||||
$cc = cc
|
||||
$cflags = -64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN
|
||||
$cflags = -64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG
|
||||
$bn_ops = RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG
|
||||
$bn_obj = asm/mips3.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1056,11 +1175,11 @@ $rc5_obj =
|
||||
|
||||
*** irix64-mips4-gcc
|
||||
$cc = gcc
|
||||
$cflags = -mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN
|
||||
$cflags = -mabi=64 -mips4 -mmips-as -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG
|
||||
$bn_ops = RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG
|
||||
$bn_obj = asm/mips3.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1071,6 +1190,74 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** linux-alpha+bwx-ccc
|
||||
$cc = ccc
|
||||
$cflags = -fast -readonly_strings -DL_ENDIAN -DTERMIO
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL
|
||||
$bn_obj = asm/alpha.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** linux-alpha+bwx-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -DL_ENDIAN -DTERMIO
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL
|
||||
$bn_obj = asm/alpha.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** linux-alpha-ccc
|
||||
$cc = ccc
|
||||
$cflags = -fast -readonly_strings -DL_ENDIAN -DTERMIO
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL
|
||||
$bn_obj = asm/alpha.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** linux-alpha-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -DL_ENDIAN -DTERMIO
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL
|
||||
$bn_obj = asm/alpha.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** linux-aout
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall
|
||||
@@ -1126,9 +1313,9 @@ $rc5_obj =
|
||||
$cc = gcc
|
||||
$cflags = -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops =
|
||||
$bn_ops = BN_LLONG
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1145,7 +1332,7 @@ $cflags = -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1162,7 +1349,7 @@ $cflags = -mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1179,7 +1366,7 @@ $cflags = -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8plus.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1258,6 +1445,23 @@ $rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** rhapsody-ppc-cc
|
||||
$cc = cc
|
||||
$cflags = -O3 -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** sco5-cc
|
||||
$cc = cc
|
||||
$cflags =
|
||||
@@ -1298,7 +1502,7 @@ $cflags = -fast -O -Xa -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_PTR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1315,7 +1519,7 @@ $cflags = -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1332,7 +1536,7 @@ $cflags = -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1349,7 +1553,7 @@ $cflags = -xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1366,7 +1570,7 @@ $cflags = -mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1383,7 +1587,7 @@ $cflags = -xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_EN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8plus.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1400,7 +1604,7 @@ $cflags = -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8plus.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1417,7 +1621,7 @@ $cflags = -mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DULTR
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL BF_PTR
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj = asm/sparcv8plus-gcc27.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1430,7 +1634,7 @@ $rc5_obj =
|
||||
|
||||
*** solaris-x86-gcc
|
||||
$cc = gcc
|
||||
$cflags = -O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN
|
||||
$cflags = -O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DNO_INLINE_ASM
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
@@ -1451,7 +1655,7 @@ $cflags = -xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1468,7 +1672,7 @@ $cflags = -O3 -mv8
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$lflags =
|
||||
$bn_ops = BN_LLONG RC4_CHAR DES_UNROLL DES_PTR DES_RISC1
|
||||
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
@@ -1546,3 +1750,20 @@ $cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
*** unixware-7
|
||||
$cc = cc
|
||||
$cflags = -O -DFILIO_H -Kalloca
|
||||
$unistd =
|
||||
$thread_cflag = -Kthread
|
||||
$lflags = -lsocket -lnsl
|
||||
$bn_ops = MD2_CHAR RC4_INDEX DES_PTR DES_RISC1 DES_UNROLL
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
|
||||
@@ -37,6 +37,7 @@ $
|
||||
$ EXHEADER := vms_idhacks.h
|
||||
$
|
||||
$ COPY 'EXHEADER' WRK_SSLINCLUDE: /LOG
|
||||
$ SET FILE/PROT=WORLD:RE WRK_SSLINCLUDE:'EXHEADER'
|
||||
$
|
||||
$ OPEN/WRITE SF WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM
|
||||
$ WRITE SYS$OUTPUT "%OPEN-I-CREATED, ",F$SEARCH("WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM")," created."
|
||||
@@ -65,7 +66,9 @@ $ WRITE SF " @SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM"
|
||||
$ WRITE SF "$"
|
||||
$ WRITE SF "$ EXIT"
|
||||
$ CLOSE SF
|
||||
$ SET FILE/PROT=WORLD:RE WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM
|
||||
$
|
||||
$ COPY OPENSSL_UTILS.COM WRK_SSLROOT:[VMS]/LOG
|
||||
$ SET FILE/PROT=WORLD:RE WRK_SSLROOT:[VMS]OPENSSL_UTILS.COM
|
||||
$
|
||||
$ EXIT
|
||||
|
||||
28
VMS/test-includes.com
Normal file
28
VMS/test-includes.com
Normal file
@@ -0,0 +1,28 @@
|
||||
$! Quick script to check how well including individual header files works
|
||||
$! on VMS, even when the VMS macro isn't defined.
|
||||
$
|
||||
$ sav_def = f$env("DEFAULT")
|
||||
$ here = f$parse("A.;0",f$ENV("PROCEDURE")) - "A.;0"
|
||||
$ set default 'here'
|
||||
$ set default [-.include.openssl]
|
||||
$ define openssl 'f$env("DEFAULT")'
|
||||
$ set default [--]
|
||||
$
|
||||
$ loop:
|
||||
$ f = f$search("openssl:*.h")
|
||||
$ if f .eqs. "" then goto loop_end
|
||||
$ write sys$output "Checking ",f
|
||||
$ open/write foo foo.c
|
||||
$ write foo "#undef VMS"
|
||||
$ write foo "#include <stdio.h>"
|
||||
$ write foo "#include <openssl/",f$parse(f,,,"NAME"),".h>"
|
||||
$ write foo "main()"
|
||||
$ write foo "{printf(""foo\n"");}"
|
||||
$ close foo
|
||||
$ cc/STANDARD=ANSI89/NOLIST/PREFIX=ALL foo.c
|
||||
$ delete foo.c;
|
||||
$ goto loop
|
||||
$ loop_end:
|
||||
$ set default 'save_def'
|
||||
$ exit
|
||||
|
||||
@@ -57,55 +57,124 @@
|
||||
|
||||
#ifdef VMS
|
||||
|
||||
/* Hack a long name in crypto/asn1/a_mbstr.c */
|
||||
#define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc
|
||||
/* Hack the names created with DECLARE_STACK_OF(PKCS7_SIGNER_INFO) */
|
||||
#define sk_PKCS7_SIGNER_INFO_new sk_PKCS7_SIGINF_new
|
||||
#define sk_PKCS7_SIGNER_INFO_new_null sk_PKCS7_SIGINF_new_null
|
||||
#define sk_PKCS7_SIGNER_INFO_free sk_PKCS7_SIGINF_free
|
||||
#define sk_PKCS7_SIGNER_INFO_num sk_PKCS7_SIGINF_num
|
||||
#define sk_PKCS7_SIGNER_INFO_value sk_PKCS7_SIGINF_value
|
||||
#define sk_PKCS7_SIGNER_INFO_set sk_PKCS7_SIGINF_set
|
||||
#define sk_PKCS7_SIGNER_INFO_zero sk_PKCS7_SIGINF_zero
|
||||
#define sk_PKCS7_SIGNER_INFO_push sk_PKCS7_SIGINF_push
|
||||
#define sk_PKCS7_SIGNER_INFO_unshift sk_PKCS7_SIGINF_unshift
|
||||
#define sk_PKCS7_SIGNER_INFO_find sk_PKCS7_SIGINF_find
|
||||
#define sk_PKCS7_SIGNER_INFO_delete sk_PKCS7_SIGINF_delete
|
||||
#define sk_PKCS7_SIGNER_INFO_delete_ptr sk_PKCS7_SIGINF_delete_ptr
|
||||
#define sk_PKCS7_SIGNER_INFO_insert sk_PKCS7_SIGINF_insert
|
||||
#define sk_PKCS7_SIGNER_INFO_new sk_PKCS7_SIGINF_new
|
||||
#define sk_PKCS7_SIGNER_INFO_new_null sk_PKCS7_SIGINF_new_null
|
||||
#define sk_PKCS7_SIGNER_INFO_free sk_PKCS7_SIGINF_free
|
||||
#define sk_PKCS7_SIGNER_INFO_num sk_PKCS7_SIGINF_num
|
||||
#define sk_PKCS7_SIGNER_INFO_value sk_PKCS7_SIGINF_value
|
||||
#define sk_PKCS7_SIGNER_INFO_set sk_PKCS7_SIGINF_set
|
||||
#define sk_PKCS7_SIGNER_INFO_zero sk_PKCS7_SIGINF_zero
|
||||
#define sk_PKCS7_SIGNER_INFO_push sk_PKCS7_SIGINF_push
|
||||
#define sk_PKCS7_SIGNER_INFO_unshift sk_PKCS7_SIGINF_unshift
|
||||
#define sk_PKCS7_SIGNER_INFO_find sk_PKCS7_SIGINF_find
|
||||
#define sk_PKCS7_SIGNER_INFO_delete sk_PKCS7_SIGINF_delete
|
||||
#define sk_PKCS7_SIGNER_INFO_delete_ptr sk_PKCS7_SIGINF_delete_ptr
|
||||
#define sk_PKCS7_SIGNER_INFO_insert sk_PKCS7_SIGINF_insert
|
||||
#define sk_PKCS7_SIGNER_INFO_set_cmp_func sk_PKCS7_SIGINF_set_cmp_func
|
||||
#define sk_PKCS7_SIGNER_INFO_dup sk_PKCS7_SIGINF_dup
|
||||
#define sk_PKCS7_SIGNER_INFO_pop_free sk_PKCS7_SIGINF_pop_free
|
||||
#define sk_PKCS7_SIGNER_INFO_shift sk_PKCS7_SIGINF_shift
|
||||
#define sk_PKCS7_SIGNER_INFO_pop sk_PKCS7_SIGINF_pop
|
||||
#define sk_PKCS7_SIGNER_INFO_sort sk_PKCS7_SIGINF_sort
|
||||
#define sk_PKCS7_SIGNER_INFO_dup sk_PKCS7_SIGINF_dup
|
||||
#define sk_PKCS7_SIGNER_INFO_pop_free sk_PKCS7_SIGINF_pop_free
|
||||
#define sk_PKCS7_SIGNER_INFO_shift sk_PKCS7_SIGINF_shift
|
||||
#define sk_PKCS7_SIGNER_INFO_pop sk_PKCS7_SIGINF_pop
|
||||
#define sk_PKCS7_SIGNER_INFO_sort sk_PKCS7_SIGINF_sort
|
||||
|
||||
/* Hack the names created with DECLARE_STACK_OF(PKCS7_RECIP_INFO) */
|
||||
#define sk_PKCS7_RECIP_INFO_new sk_PKCS7_RECINF_new
|
||||
#define sk_PKCS7_RECIP_INFO_new_null sk_PKCS7_RECINF_new_null
|
||||
#define sk_PKCS7_RECIP_INFO_free sk_PKCS7_RECINF_free
|
||||
#define sk_PKCS7_RECIP_INFO_num sk_PKCS7_RECINF_num
|
||||
#define sk_PKCS7_RECIP_INFO_value sk_PKCS7_RECINF_value
|
||||
#define sk_PKCS7_RECIP_INFO_set sk_PKCS7_RECINF_set
|
||||
#define sk_PKCS7_RECIP_INFO_zero sk_PKCS7_RECINF_zero
|
||||
#define sk_PKCS7_RECIP_INFO_push sk_PKCS7_RECINF_push
|
||||
#define sk_PKCS7_RECIP_INFO_unshift sk_PKCS7_RECINF_unshift
|
||||
#define sk_PKCS7_RECIP_INFO_find sk_PKCS7_RECINF_find
|
||||
#define sk_PKCS7_RECIP_INFO_delete sk_PKCS7_RECINF_delete
|
||||
#define sk_PKCS7_RECIP_INFO_delete_ptr sk_PKCS7_RECINF_delete_ptr
|
||||
#define sk_PKCS7_RECIP_INFO_insert sk_PKCS7_RECINF_insert
|
||||
#define sk_PKCS7_RECIP_INFO_new sk_PKCS7_RECINF_new
|
||||
#define sk_PKCS7_RECIP_INFO_new_null sk_PKCS7_RECINF_new_null
|
||||
#define sk_PKCS7_RECIP_INFO_free sk_PKCS7_RECINF_free
|
||||
#define sk_PKCS7_RECIP_INFO_num sk_PKCS7_RECINF_num
|
||||
#define sk_PKCS7_RECIP_INFO_value sk_PKCS7_RECINF_value
|
||||
#define sk_PKCS7_RECIP_INFO_set sk_PKCS7_RECINF_set
|
||||
#define sk_PKCS7_RECIP_INFO_zero sk_PKCS7_RECINF_zero
|
||||
#define sk_PKCS7_RECIP_INFO_push sk_PKCS7_RECINF_push
|
||||
#define sk_PKCS7_RECIP_INFO_unshift sk_PKCS7_RECINF_unshift
|
||||
#define sk_PKCS7_RECIP_INFO_find sk_PKCS7_RECINF_find
|
||||
#define sk_PKCS7_RECIP_INFO_delete sk_PKCS7_RECINF_delete
|
||||
#define sk_PKCS7_RECIP_INFO_delete_ptr sk_PKCS7_RECINF_delete_ptr
|
||||
#define sk_PKCS7_RECIP_INFO_insert sk_PKCS7_RECINF_insert
|
||||
#define sk_PKCS7_RECIP_INFO_set_cmp_func sk_PKCS7_RECINF_set_cmp_func
|
||||
#define sk_PKCS7_RECIP_INFO_dup sk_PKCS7_RECINF_dup
|
||||
#define sk_PKCS7_RECIP_INFO_pop_free sk_PKCS7_RECINF_pop_free
|
||||
#define sk_PKCS7_RECIP_INFO_shift sk_PKCS7_RECINF_shift
|
||||
#define sk_PKCS7_RECIP_INFO_pop sk_PKCS7_RECINF_pop
|
||||
#define sk_PKCS7_RECIP_INFO_sort sk_PKCS7_RECINF_sort
|
||||
#define sk_PKCS7_RECIP_INFO_dup sk_PKCS7_RECINF_dup
|
||||
#define sk_PKCS7_RECIP_INFO_pop_free sk_PKCS7_RECINF_pop_free
|
||||
#define sk_PKCS7_RECIP_INFO_shift sk_PKCS7_RECINF_shift
|
||||
#define sk_PKCS7_RECIP_INFO_pop sk_PKCS7_RECINF_pop
|
||||
#define sk_PKCS7_RECIP_INFO_sort sk_PKCS7_RECINF_sort
|
||||
|
||||
/* Hack the names created with DECLARE_STACK_OF(ASN1_STRING_TABLE) */
|
||||
#define sk_ASN1_STRING_TABLE_new sk_ASN1_STRTAB_new
|
||||
#define sk_ASN1_STRING_TABLE_new_null sk_ASN1_STRTAB_new_null
|
||||
#define sk_ASN1_STRING_TABLE_free sk_ASN1_STRTAB_free
|
||||
#define sk_ASN1_STRING_TABLE_num sk_ASN1_STRTAB_num
|
||||
#define sk_ASN1_STRING_TABLE_value sk_ASN1_STRTAB_value
|
||||
#define sk_ASN1_STRING_TABLE_set sk_ASN1_STRTAB_set
|
||||
#define sk_ASN1_STRING_TABLE_zero sk_ASN1_STRTAB_zero
|
||||
#define sk_ASN1_STRING_TABLE_push sk_ASN1_STRTAB_push
|
||||
#define sk_ASN1_STRING_TABLE_unshift sk_ASN1_STRTAB_unshift
|
||||
#define sk_ASN1_STRING_TABLE_find sk_ASN1_STRTAB_find
|
||||
#define sk_ASN1_STRING_TABLE_delete sk_ASN1_STRTAB_delete
|
||||
#define sk_ASN1_STRING_TABLE_delete_ptr sk_ASN1_STRTAB_delete_ptr
|
||||
#define sk_ASN1_STRING_TABLE_insert sk_ASN1_STRTAB_insert
|
||||
#define sk_ASN1_STRING_TABLE_set_cmp_func sk_ASN1_STRTAB_set_cmp_func
|
||||
#define sk_ASN1_STRING_TABLE_dup sk_ASN1_STRTAB_dup
|
||||
#define sk_ASN1_STRING_TABLE_pop_free sk_ASN1_STRTAB_pop_free
|
||||
#define sk_ASN1_STRING_TABLE_shift sk_ASN1_STRTAB_shift
|
||||
#define sk_ASN1_STRING_TABLE_pop sk_ASN1_STRTAB_pop
|
||||
#define sk_ASN1_STRING_TABLE_sort sk_ASN1_STRTAB_sort
|
||||
|
||||
/* Hack the names created with DECLARE_STACK_OF(ACCESS_DESCRIPTION) */
|
||||
#define sk_ACCESS_DESCRIPTION_new sk_ACC_DESC_new
|
||||
#define sk_ACCESS_DESCRIPTION_new_null sk_ACC_DESC_new_null
|
||||
#define sk_ACCESS_DESCRIPTION_free sk_ACC_DESC_free
|
||||
#define sk_ACCESS_DESCRIPTION_num sk_ACC_DESC_num
|
||||
#define sk_ACCESS_DESCRIPTION_value sk_ACC_DESC_value
|
||||
#define sk_ACCESS_DESCRIPTION_set sk_ACC_DESC_set
|
||||
#define sk_ACCESS_DESCRIPTION_zero sk_ACC_DESC_zero
|
||||
#define sk_ACCESS_DESCRIPTION_push sk_ACC_DESC_push
|
||||
#define sk_ACCESS_DESCRIPTION_unshift sk_ACC_DESC_unshift
|
||||
#define sk_ACCESS_DESCRIPTION_find sk_ACC_DESC_find
|
||||
#define sk_ACCESS_DESCRIPTION_delete sk_ACC_DESC_delete
|
||||
#define sk_ACCESS_DESCRIPTION_delete_ptr sk_ACC_DESC_delete_ptr
|
||||
#define sk_ACCESS_DESCRIPTION_insert sk_ACC_DESC_insert
|
||||
#define sk_ACCESS_DESCRIPTION_set_cmp_func sk_ACC_DESC_set_cmp_func
|
||||
#define sk_ACCESS_DESCRIPTION_dup sk_ACC_DESC_dup
|
||||
#define sk_ACCESS_DESCRIPTION_pop_free sk_ACC_DESC_pop_free
|
||||
#define sk_ACCESS_DESCRIPTION_shift sk_ACC_DESC_shift
|
||||
#define sk_ACCESS_DESCRIPTION_pop sk_ACC_DESC_pop
|
||||
#define sk_ACCESS_DESCRIPTION_sort sk_ACC_DESC_sort
|
||||
|
||||
/* Hack the names created with DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) */
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_new sk_CRYPT_EX_DATFNS_new
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_new_null sk_CRYPT_EX_DATFNS_new_null
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_free sk_CRYPT_EX_DATFNS_free
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_num sk_CRYPT_EX_DATFNS_num
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_value sk_CRYPT_EX_DATFNS_value
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_set sk_CRYPT_EX_DATFNS_set
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_zero sk_CRYPT_EX_DATFNS_zero
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_push sk_CRYPT_EX_DATFNS_push
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_unshift sk_CRYPT_EX_DATFNS_unshift
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_find sk_CRYPT_EX_DATFNS_find
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_delete sk_CRYPT_EX_DATFNS_delete
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr sk_CRYPT_EX_DATFNS_delete_ptr
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_insert sk_CRYPT_EX_DATFNS_insert
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func sk_CRYPT_EX_DATFNS_set_cmp_func
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_dup sk_CRYPT_EX_DATFNS_dup
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_pop_free sk_CRYPT_EX_DATFNS_pop_free
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_shift sk_CRYPT_EX_DATFNS_shift
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_pop sk_CRYPT_EX_DATFNS_pop
|
||||
#define sk_CRYPTO_EX_DATA_FUNCS_sort sk_CRYPT_EX_DATFNS_sort
|
||||
|
||||
/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */
|
||||
#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
|
||||
#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
|
||||
#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
|
||||
#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
|
||||
|
||||
/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */
|
||||
#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECGINF
|
||||
#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECGINF
|
||||
#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECGINF
|
||||
#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECGINF
|
||||
|
||||
/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */
|
||||
#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC
|
||||
#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC
|
||||
|
||||
/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */
|
||||
#define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQUENCE
|
||||
@@ -119,7 +188,10 @@
|
||||
#define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO
|
||||
#define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO
|
||||
#define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO
|
||||
#define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_write_cb_bio_P8_PRIV_KEY_INFO
|
||||
#define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO
|
||||
|
||||
/* Hack other PEM names */
|
||||
#define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid
|
||||
|
||||
#endif /* defined VMS */
|
||||
|
||||
|
||||
@@ -2,3 +2,4 @@ openssl
|
||||
Makefile.save
|
||||
der_chop
|
||||
der_chop.bak
|
||||
CA.pl
|
||||
|
||||
20
apps/CA.com
20
apps/CA.com
@@ -35,6 +35,7 @@ $ REQ = openssl + " req " + SSLEAY_CONFIG
|
||||
$ CA = openssl + " ca " + SSLEAY_CONFIG
|
||||
$ VERIFY = openssl + " verify"
|
||||
$ X509 = openssl + " x509"
|
||||
$ PKCS12 = openssl + " pkcs12"
|
||||
$ echo = "write sys$Output"
|
||||
$!
|
||||
$ s = F$PARSE(F$ENVIRONMENT("DEFAULT"),"[]") - "].;"
|
||||
@@ -96,10 +97,18 @@ $ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.certs]
|
||||
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.crl]
|
||||
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.newcerts]
|
||||
$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.private]
|
||||
$
|
||||
$ OPEN /WRITE ser_file 'CATOP']serial.
|
||||
$ WRITE ser_file "01"
|
||||
$ CLOSE ser_file
|
||||
$ APPEND/NEW NL: 'CATOP']index.txt
|
||||
$
|
||||
$ ! The following is to make sure access() doesn't get confused. It
|
||||
$ ! really needs one file in the directory to give correct answers...
|
||||
$ COPY NLA0: 'CATOP'.certs].;
|
||||
$ COPY NLA0: 'CATOP'.crl].;
|
||||
$ COPY NLA0: 'CATOP'.newcerts].;
|
||||
$ COPY NLA0: 'CATOP'.private].;
|
||||
$ ENDIF
|
||||
$!
|
||||
$ IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. ""
|
||||
@@ -121,6 +130,17 @@ $ ENDIF
|
||||
$ GOTO opt_loop_continue
|
||||
$ ENDIF
|
||||
$!
|
||||
$ IF (prog_opt .EQS. "-pkcs12")
|
||||
$ THEN
|
||||
$ i = i + 1
|
||||
$ cname = P'i'
|
||||
$ IF cname .EQS. "" THEN cname = "My certificate"
|
||||
$ PKCS12 -in newcert.pem -inkey newreq.pem -certfile 'CATOP''CACERT -
|
||||
-out newcert.p12 -export -name "''cname'"
|
||||
$ RET=$STATUS
|
||||
$ exit RET
|
||||
$ ENDIF
|
||||
$!
|
||||
$ IF (prog_opt .EQS. "-xsign")
|
||||
$ THEN
|
||||
$!
|
||||
|
||||
11
apps/CA.pl → apps/CA.pl.in
Executable file → Normal file
11
apps/CA.pl → apps/CA.pl.in
Executable file → Normal file
@@ -41,6 +41,7 @@ $REQ="openssl req $SSLEAY_CONFIG";
|
||||
$CA="openssl ca $SSLEAY_CONFIG";
|
||||
$VERIFY="openssl verify";
|
||||
$X509="openssl x509";
|
||||
$PKCS12="openssl pkcs12";
|
||||
|
||||
$CATOP="./demoCA";
|
||||
$CAKEY="cakey.pem";
|
||||
@@ -65,7 +66,7 @@ foreach (@ARGV) {
|
||||
$RET=$?;
|
||||
print "Request (and private key) is in newreq.pem\n";
|
||||
} elsif (/^-newca$/) {
|
||||
# if explictly asked for or it doesn't exist then setup the
|
||||
# if explicitly asked for or it doesn't exist then setup the
|
||||
# directory structure that Eric likes to manage things
|
||||
$NEW="1";
|
||||
if ( "$NEW" || ! -f "${CATOP}/serial" ) {
|
||||
@@ -99,6 +100,14 @@ foreach (@ARGV) {
|
||||
$RET=$?;
|
||||
}
|
||||
}
|
||||
} elsif (/^-pkcs12$/) {
|
||||
my $cname = $ARGV[1];
|
||||
$cname = "My Certificate" unless defined $cname;
|
||||
system ("$PKCS12 -in newcert.pem -inkey newreq.pem " .
|
||||
"-certfile ${CATOP}/$CACERT -out newcert.p12 " .
|
||||
"-export -name \"$cname\"");
|
||||
$RET=$?;
|
||||
exit $RET;
|
||||
} elsif (/^-xsign$/) {
|
||||
system ("$CA -policy policy_anything -infiles newreq.pem");
|
||||
$RET=$?;
|
||||
@@ -60,7 +60,7 @@ case $i in
|
||||
echo "Request (and private key) is in newreq.pem"
|
||||
;;
|
||||
-newca)
|
||||
# if explictly asked for or it doesn't exist then setup the directory
|
||||
# if explicitly asked for or it doesn't exist then setup the directory
|
||||
# structure that Eric likes to manage things
|
||||
NEW="1"
|
||||
if [ "$NEW" -o ! -f ${CATOP}/serial ]; then
|
||||
|
||||
@@ -13,6 +13,7 @@ OPENSSLDIR= /usr/local/ssl
|
||||
MAKE= make -f Makefile.ssl
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP)
|
||||
MAKEFILE= Makefile.ssl
|
||||
PERL=/usr/local/bin/perl
|
||||
RM= rm -f
|
||||
|
||||
PEX_LIBS=
|
||||
@@ -33,11 +34,11 @@ SCRIPTS=CA.sh CA.pl der_chop
|
||||
|
||||
EXE= $(PROGRAM)
|
||||
|
||||
E_EXE= verify asn1pars req dgst dh enc gendh errstr ca crl \
|
||||
rsa dsa dsaparam \
|
||||
E_EXE= verify asn1pars req dgst dh dhparam enc passwd gendh errstr \
|
||||
ca crl rsa dsa dsaparam \
|
||||
x509 genrsa gendsa s_server s_client speed \
|
||||
s_time version pkcs7 crl2pkcs7 sess_id ciphers nseq pkcs12 \
|
||||
pkcs8
|
||||
pkcs8 spkac smime
|
||||
|
||||
PROGS= $(PROGRAM).c
|
||||
|
||||
@@ -45,22 +46,24 @@ A_OBJ=apps.o
|
||||
A_SRC=apps.c
|
||||
S_OBJ= s_cb.o s_socket.o
|
||||
S_SRC= s_cb.c s_socket.c
|
||||
RAND_OBJ=app_rand.o
|
||||
RAND_SRC=app_rand.c
|
||||
|
||||
E_OBJ= verify.o asn1pars.o req.o dgst.o dh.o enc.o gendh.o errstr.o ca.o \
|
||||
pkcs7.o crl2p7.o crl.o \
|
||||
E_OBJ= verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o \
|
||||
ca.o pkcs7.o crl2p7.o crl.o \
|
||||
rsa.o dsa.o dsaparam.o \
|
||||
x509.o genrsa.o gendsa.o s_server.o s_client.o speed.o \
|
||||
s_time.o $(A_OBJ) $(S_OBJ) version.o sess_id.o \
|
||||
ciphers.o nseq.o pkcs12.o pkcs8.o
|
||||
s_time.o $(A_OBJ) $(S_OBJ) $(RAND_OBJ) version.o sess_id.o \
|
||||
ciphers.o nseq.o pkcs12.o pkcs8.o spkac.o smime.o
|
||||
|
||||
# pem_mail.o
|
||||
|
||||
E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c gendh.c errstr.c ca.c \
|
||||
E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.c \
|
||||
pkcs7.c crl2p7.c crl.c \
|
||||
rsa.c dsa.c dsaparam.c \
|
||||
x509.c genrsa.c gendsa.c s_server.c s_client.c speed.c \
|
||||
s_time.c $(A_SRC) $(S_SRC) version.c sess_id.c \
|
||||
ciphers.c nseq.c pkcs12.c pkcs8.c
|
||||
s_time.c $(A_SRC) $(S_SRC) $(RAND_SRC) version.c sess_id.c \
|
||||
ciphers.c nseq.c pkcs12.c pkcs8.c spkac.c smime.c
|
||||
|
||||
# pem_mail.c
|
||||
|
||||
@@ -81,7 +84,7 @@ all: exe
|
||||
exe: $(EXE)
|
||||
|
||||
req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
|
||||
$(CC) -o req $(CFLAG) sreq.o $(A_OBJ) $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
|
||||
$(CC) -o req $(CFLAG) sreq.o $(A_OBJ) $(RAND_OBJ) $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
|
||||
|
||||
sreq.o: req.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
|
||||
@@ -138,16 +141,44 @@ $(PROGRAM): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||
$(CC) -o $(PROGRAM) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS)
|
||||
@(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
|
||||
|
||||
progs.h:
|
||||
$(PERL) ./progs.pl $(E_EXE) >progs.h
|
||||
progs.h: progs.pl
|
||||
$(PERL) progs.pl $(E_EXE) >progs.h
|
||||
$(RM) $(PROGRAM).o
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
apps.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
apps.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
||||
apps.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
|
||||
apps.o: ../include/openssl/opensslv.h ../include/openssl/stack.h apps.h progs.h
|
||||
app_rand.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
app_rand.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
app_rand.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
app_rand.o: ../include/openssl/crypto.h ../include/openssl/des.h
|
||||
app_rand.o: ../include/openssl/dh.h ../include/openssl/dsa.h
|
||||
app_rand.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
|
||||
app_rand.o: ../include/openssl/evp.h ../include/openssl/idea.h
|
||||
app_rand.o: ../include/openssl/md2.h ../include/openssl/md5.h
|
||||
app_rand.o: ../include/openssl/mdc2.h ../include/openssl/objects.h
|
||||
app_rand.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
app_rand.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
|
||||
app_rand.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
app_rand.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
app_rand.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
app_rand.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
app_rand.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
apps.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
apps.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
apps.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
apps.o: ../include/openssl/crypto.h ../include/openssl/des.h
|
||||
apps.o: ../include/openssl/dh.h ../include/openssl/dsa.h
|
||||
apps.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
|
||||
apps.o: ../include/openssl/evp.h ../include/openssl/idea.h
|
||||
apps.o: ../include/openssl/md2.h ../include/openssl/md5.h
|
||||
apps.o: ../include/openssl/mdc2.h ../include/openssl/objects.h
|
||||
apps.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
apps.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
|
||||
apps.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
apps.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
apps.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
apps.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
apps.o: ../include/openssl/x509_vfy.h apps.h
|
||||
asn1pars.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
asn1pars.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
asn1pars.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -165,7 +196,6 @@ asn1pars.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
asn1pars.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
asn1pars.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
asn1pars.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
asn1pars.o: progs.h
|
||||
ca.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
ca.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
ca.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -184,7 +214,7 @@ ca.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
ca.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
ca.o: ../include/openssl/stack.h ../include/openssl/txt_db.h
|
||||
ca.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
ca.o: ../include/openssl/x509v3.h apps.h progs.h
|
||||
ca.o: ../include/openssl/x509v3.h apps.h
|
||||
ciphers.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
ciphers.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
ciphers.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -205,7 +235,6 @@ ciphers.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
ciphers.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
ciphers.o: ../include/openssl/stack.h ../include/openssl/tls1.h
|
||||
ciphers.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
ciphers.o: progs.h
|
||||
crl.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
crl.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
crl.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -224,7 +253,7 @@ crl.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
crl.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
crl.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
crl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
crl.o: ../include/openssl/x509v3.h apps.h progs.h
|
||||
crl.o: ../include/openssl/x509v3.h apps.h
|
||||
crl2p7.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
crl2p7.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
crl2p7.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -242,7 +271,6 @@ crl2p7.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
crl2p7.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
crl2p7.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
crl2p7.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
crl2p7.o: progs.h
|
||||
dgst.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
dgst.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
dgst.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -259,7 +287,7 @@ dgst.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
dgst.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
dgst.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
dgst.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
dgst.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
dgst.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
dh.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
dh.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
dh.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -276,7 +304,7 @@ dh.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
dh.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
dh.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
dh.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
dh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
dh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
dsa.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
dsa.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
dsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -293,7 +321,7 @@ dsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
dsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
dsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
dsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
dsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
dsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
dsaparam.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
dsaparam.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
dsaparam.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -306,12 +334,11 @@ dsaparam.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
dsaparam.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
dsaparam.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
dsaparam.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
dsaparam.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
dsaparam.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
dsaparam.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
dsaparam.o: ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
dsaparam.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
dsaparam.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
dsaparam.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
dsaparam.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
dsaparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
enc.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
enc.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
enc.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -324,11 +351,12 @@ enc.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
enc.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
enc.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
enc.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
enc.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
enc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
enc.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
enc.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
enc.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
enc.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
enc.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
enc.o: ../include/openssl/x509_vfy.h apps.h
|
||||
errstr.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
errstr.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
errstr.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -349,7 +377,6 @@ errstr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
errstr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
errstr.o: ../include/openssl/stack.h ../include/openssl/tls1.h
|
||||
errstr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
errstr.o: progs.h
|
||||
gendh.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
gendh.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
gendh.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -367,7 +394,7 @@ gendh.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
gendh.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
gendh.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
gendh.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
gendh.o: ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
gendh.o: ../include/openssl/x509_vfy.h apps.h
|
||||
gendsa.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
gendsa.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
gendsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -380,12 +407,11 @@ gendsa.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
gendsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
gendsa.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
gendsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
gendsa.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
gendsa.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
gendsa.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
gendsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
gendsa.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
gendsa.o: ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
gendsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
gendsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
gendsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
gendsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
gendsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
genrsa.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
genrsa.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
genrsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -398,12 +424,11 @@ genrsa.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
genrsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
genrsa.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
genrsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
genrsa.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
genrsa.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
genrsa.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
genrsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
genrsa.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
genrsa.o: ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
genrsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
genrsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
genrsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
genrsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
genrsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
nseq.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
nseq.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
nseq.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -420,7 +445,7 @@ nseq.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
nseq.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
nseq.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
nseq.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
nseq.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
nseq.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
openssl.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
openssl.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
openssl.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -442,6 +467,23 @@ openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
openssl.o: ../include/openssl/tls1.h ../include/openssl/x509.h
|
||||
openssl.o: ../include/openssl/x509_vfy.h apps.h progs.h s_apps.h
|
||||
passwd.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
passwd.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
passwd.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
passwd.o: ../include/openssl/crypto.h ../include/openssl/des.h
|
||||
passwd.o: ../include/openssl/dh.h ../include/openssl/dsa.h
|
||||
passwd.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
|
||||
passwd.o: ../include/openssl/err.h ../include/openssl/evp.h
|
||||
passwd.o: ../include/openssl/idea.h ../include/openssl/md2.h
|
||||
passwd.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
passwd.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
passwd.o: ../include/openssl/opensslv.h ../include/openssl/pkcs7.h
|
||||
passwd.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
passwd.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
passwd.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
passwd.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
passwd.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
passwd.o: ../include/openssl/x509_vfy.h apps.h
|
||||
pkcs12.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
pkcs12.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
pkcs12.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -459,7 +501,7 @@ pkcs12.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
pkcs12.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
pkcs12.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
pkcs12.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
pkcs12.o: ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
pkcs12.o: ../include/openssl/x509_vfy.h apps.h
|
||||
pkcs7.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
pkcs7.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
pkcs7.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -476,7 +518,7 @@ pkcs7.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
pkcs7.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
pkcs7.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
pkcs7.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
pkcs7.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
pkcs7.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
pkcs8.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
pkcs8.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
pkcs8.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -494,7 +536,7 @@ pkcs8.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
pkcs8.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
pkcs8.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
pkcs8.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
pkcs8.o: ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
pkcs8.o: ../include/openssl/x509_vfy.h apps.h
|
||||
req.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
req.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
req.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -508,12 +550,12 @@ req.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
req.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
req.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
req.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
req.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
req.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
req.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
req.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
req.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
req.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h progs.h
|
||||
req.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
req.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
req.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
req.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
req.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
req.o: ../include/openssl/x509v3.h apps.h
|
||||
rsa.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
rsa.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
rsa.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -530,7 +572,7 @@ rsa.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
rsa.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
rsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
rsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
rsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
rsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
s_cb.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
s_cb.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
s_cb.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -550,8 +592,7 @@ s_cb.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
s_cb.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_cb.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_cb.o: ../include/openssl/stack.h ../include/openssl/tls1.h
|
||||
s_cb.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h progs.h
|
||||
s_cb.o: s_apps.h
|
||||
s_cb.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h s_apps.h
|
||||
s_client.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
s_client.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
s_client.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -572,7 +613,7 @@ s_client.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_client.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_client.o: ../include/openssl/stack.h ../include/openssl/tls1.h
|
||||
s_client.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
s_client.o: progs.h s_apps.h
|
||||
s_client.o: s_apps.h
|
||||
s_server.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
s_server.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
s_server.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -593,7 +634,7 @@ s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_server.o: ../include/openssl/stack.h ../include/openssl/tls1.h
|
||||
s_server.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
s_server.o: progs.h s_apps.h
|
||||
s_server.o: s_apps.h
|
||||
s_socket.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
s_socket.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
s_socket.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -613,7 +654,7 @@ s_socket.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
s_socket.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
s_socket.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
s_socket.o: ../include/openssl/tls1.h ../include/openssl/x509.h
|
||||
s_socket.o: ../include/openssl/x509_vfy.h apps.h progs.h s_apps.h
|
||||
s_socket.o: ../include/openssl/x509_vfy.h apps.h s_apps.h
|
||||
s_time.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
s_time.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
s_time.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -634,7 +675,7 @@ s_time.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_time.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_time.o: ../include/openssl/stack.h ../include/openssl/tls1.h
|
||||
s_time.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
s_time.o: progs.h s_apps.h
|
||||
s_time.o: s_apps.h
|
||||
sess_id.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
sess_id.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
sess_id.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -655,7 +696,23 @@ sess_id.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
sess_id.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
sess_id.o: ../include/openssl/stack.h ../include/openssl/tls1.h
|
||||
sess_id.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
sess_id.o: progs.h
|
||||
smime.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
smime.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
smime.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
smime.o: ../include/openssl/crypto.h ../include/openssl/des.h
|
||||
smime.o: ../include/openssl/dh.h ../include/openssl/dsa.h
|
||||
smime.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
|
||||
smime.o: ../include/openssl/err.h ../include/openssl/evp.h
|
||||
smime.o: ../include/openssl/idea.h ../include/openssl/md2.h
|
||||
smime.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
smime.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
smime.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
smime.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
smime.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
smime.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
smime.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
smime.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
smime.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
speed.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
speed.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
speed.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -673,15 +730,33 @@ speed.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
speed.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ./testdsa.h
|
||||
speed.o: ./testrsa.h apps.h progs.h
|
||||
speed.o: ./testrsa.h apps.h
|
||||
spkac.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
spkac.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
spkac.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
spkac.o: ../include/openssl/crypto.h ../include/openssl/des.h
|
||||
spkac.o: ../include/openssl/dh.h ../include/openssl/dsa.h
|
||||
spkac.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
|
||||
spkac.o: ../include/openssl/err.h ../include/openssl/evp.h
|
||||
spkac.o: ../include/openssl/idea.h ../include/openssl/md2.h
|
||||
spkac.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
spkac.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
spkac.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
spkac.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
spkac.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
spkac.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
spkac.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
spkac.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
spkac.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
verify.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
verify.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
verify.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
verify.o: ../include/openssl/crypto.h ../include/openssl/des.h
|
||||
verify.o: ../include/openssl/dh.h ../include/openssl/dsa.h
|
||||
verify.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h
|
||||
verify.o: ../include/openssl/err.h ../include/openssl/evp.h
|
||||
verify.o: ../include/openssl/idea.h ../include/openssl/md2.h
|
||||
verify.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
verify.o: ../include/openssl/des.h ../include/openssl/dh.h
|
||||
verify.o: ../include/openssl/dsa.h ../include/openssl/e_os.h
|
||||
verify.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
verify.o: ../include/openssl/evp.h ../include/openssl/idea.h
|
||||
verify.o: ../include/openssl/lhash.h ../include/openssl/md2.h
|
||||
verify.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
verify.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
|
||||
verify.o: ../include/openssl/opensslv.h ../include/openssl/pem.h
|
||||
@@ -690,8 +765,8 @@ verify.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
verify.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
verify.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
verify.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
verify.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
|
||||
verify.o: progs.h
|
||||
verify.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
verify.o: ../include/openssl/x509v3.h apps.h
|
||||
version.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
version.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
version.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -702,10 +777,12 @@ version.o: ../include/openssl/evp.h ../include/openssl/idea.h
|
||||
version.o: ../include/openssl/md2.h ../include/openssl/md5.h
|
||||
version.o: ../include/openssl/mdc2.h ../include/openssl/objects.h
|
||||
version.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
version.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
version.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
version.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
version.o: ../include/openssl/sha.h ../include/openssl/stack.h apps.h progs.h
|
||||
version.o: ../include/openssl/pkcs7.h ../include/openssl/rc2.h
|
||||
version.o: ../include/openssl/rc4.h ../include/openssl/rc5.h
|
||||
version.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
version.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
version.o: ../include/openssl/stack.h ../include/openssl/x509.h
|
||||
version.o: ../include/openssl/x509_vfy.h apps.h
|
||||
x509.o: ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
x509.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
|
||||
x509.o: ../include/openssl/buffer.h ../include/openssl/cast.h
|
||||
@@ -724,4 +801,4 @@ x509.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h
|
||||
x509.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
x509.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
x509.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
x509.o: ../include/openssl/x509v3.h apps.h progs.h
|
||||
x509.o: ../include/openssl/x509v3.h apps.h
|
||||
|
||||
211
apps/app_rand.c
Normal file
211
apps/app_rand.c
Normal file
@@ -0,0 +1,211 @@
|
||||
/* apps/app_rand.c */
|
||||
/* 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.]
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* 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"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
|
||||
static int seeded = 0;
|
||||
static int egdsocket = 0;
|
||||
|
||||
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
|
||||
{
|
||||
int consider_randfile = (file == NULL);
|
||||
char buffer[200];
|
||||
|
||||
#ifdef WINDOWS
|
||||
BIO_printf(bio_e,"Loading 'screen' into random state -");
|
||||
BIO_flush(bio_e);
|
||||
RAND_screen();
|
||||
BIO_printf(bio_e," done\n");
|
||||
#endif
|
||||
|
||||
if (file == NULL)
|
||||
file = RAND_file_name(buffer, sizeof buffer);
|
||||
else if (RAND_egd(file) > 0)
|
||||
{
|
||||
/* we try if the given filename is an EGD socket.
|
||||
if it is, we don't write anything back to the file. */
|
||||
egdsocket = 1;
|
||||
return 1;
|
||||
}
|
||||
if (file == NULL || !RAND_load_file(file, -1))
|
||||
{
|
||||
if (RAND_status() == 0 && !dont_warn)
|
||||
{
|
||||
BIO_printf(bio_e,"unable to load 'random state'\n");
|
||||
BIO_printf(bio_e,"This means that the random number generator has not been seeded\n");
|
||||
BIO_printf(bio_e,"with much random data.\n");
|
||||
if (consider_randfile) /* explanation does not apply when a file is explicitly named */
|
||||
{
|
||||
BIO_printf(bio_e,"Consider setting the RANDFILE environment variable to point at a file that\n");
|
||||
BIO_printf(bio_e,"'random' data can be kept in (the file will be overwritten).\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
seeded = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
long app_RAND_load_files(char *name)
|
||||
{
|
||||
char *p,*n;
|
||||
int last;
|
||||
long tot=0;
|
||||
int egd;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
last=0;
|
||||
for (p=name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
|
||||
if (*p == '\0') last=1;
|
||||
*p='\0';
|
||||
n=name;
|
||||
name=p+1;
|
||||
if (*n == '\0') break;
|
||||
|
||||
egd=RAND_egd(n);
|
||||
if (egd > 0) tot+=egd;
|
||||
tot+=RAND_load_file(n,1024L*1024L);
|
||||
if (last) break;
|
||||
}
|
||||
if (tot > 512)
|
||||
app_RAND_allow_write_file();
|
||||
return(tot);
|
||||
}
|
||||
|
||||
int app_RAND_write_file(const char *file, BIO *bio_e)
|
||||
{
|
||||
char buffer[200];
|
||||
|
||||
if (egdsocket || !seeded)
|
||||
/* If we did not manage to read the seed file,
|
||||
* we should not write a low-entropy seed file back --
|
||||
* it would suppress a crucial warning the next time
|
||||
* we want to use it. */
|
||||
return 0;
|
||||
|
||||
if (file == NULL)
|
||||
file = RAND_file_name(buffer, sizeof buffer);
|
||||
if (file == NULL || !RAND_write_file(file))
|
||||
{
|
||||
BIO_printf(bio_e,"unable to write 'random state'\n");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void app_RAND_allow_write_file(void)
|
||||
{
|
||||
seeded = 1;
|
||||
}
|
||||
90
apps/apps.c
90
apps/apps.c
@@ -324,3 +324,93 @@ int app_init(long mesgwin)
|
||||
return(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int dump_cert_text (BIO *out, X509 *x)
|
||||
{
|
||||
char buf[256];
|
||||
X509_NAME_oneline(X509_get_subject_name(x),buf,256);
|
||||
BIO_puts(out,"subject=");
|
||||
BIO_puts(out,buf);
|
||||
|
||||
X509_NAME_oneline(X509_get_issuer_name(x),buf,256);
|
||||
BIO_puts(out,"\nissuer= ");
|
||||
BIO_puts(out,buf);
|
||||
BIO_puts(out,"\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *app_get_pass(BIO *err, char *arg, int keepbio);
|
||||
|
||||
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2)
|
||||
{
|
||||
int same;
|
||||
if(!arg2 || !arg1 || strcmp(arg1, arg2)) same = 0;
|
||||
else same = 1;
|
||||
if(arg1) {
|
||||
*pass1 = app_get_pass(err, arg1, same);
|
||||
if(!*pass1) return 0;
|
||||
} else if(pass1) *pass1 = NULL;
|
||||
if(arg2) {
|
||||
*pass2 = app_get_pass(err, arg2, same ? 2 : 0);
|
||||
if(!*pass2) return 0;
|
||||
} else if(pass2) *pass2 = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static char *app_get_pass(BIO *err, char *arg, int keepbio)
|
||||
{
|
||||
char *tmp, tpass[APP_PASS_LEN];
|
||||
static BIO *pwdbio = NULL;
|
||||
int i;
|
||||
if(!strncmp(arg, "pass:", 5)) return BUF_strdup(arg + 5);
|
||||
if(!strncmp(arg, "env:", 4)) {
|
||||
tmp = getenv(arg + 4);
|
||||
if(!tmp) {
|
||||
BIO_printf(err, "Can't read environment variable %s\n", arg + 4);
|
||||
return NULL;
|
||||
}
|
||||
return BUF_strdup(tmp);
|
||||
}
|
||||
if(!keepbio || !pwdbio) {
|
||||
if(!strncmp(arg, "file:", 5)) {
|
||||
pwdbio = BIO_new_file(arg + 5, "r");
|
||||
if(!pwdbio) {
|
||||
BIO_printf(err, "Can't open file %s\n", arg + 5);
|
||||
return NULL;
|
||||
}
|
||||
} else if(!strncmp(arg, "fd:", 3)) {
|
||||
BIO *btmp;
|
||||
i = atoi(arg + 3);
|
||||
if(i >= 0) pwdbio = BIO_new_fd(i, BIO_NOCLOSE);
|
||||
if((i < 0) || !pwdbio) {
|
||||
BIO_printf(err, "Can't access file descriptor %s\n", arg + 3);
|
||||
return NULL;
|
||||
}
|
||||
/* Can't do BIO_gets on an fd BIO so add a buffering BIO */
|
||||
btmp = BIO_new(BIO_f_buffer());
|
||||
pwdbio = BIO_push(btmp, pwdbio);
|
||||
} else if(!strcmp(arg, "stdin")) {
|
||||
pwdbio = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
if(!pwdbio) {
|
||||
BIO_printf(err, "Can't open BIO for stdin\n");
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
BIO_printf(err, "Invalid password argument \"%s\"\n", arg);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
i = BIO_gets(pwdbio, tpass, APP_PASS_LEN);
|
||||
if(keepbio != 1) {
|
||||
BIO_free_all(pwdbio);
|
||||
pwdbio = NULL;
|
||||
}
|
||||
if(i <= 0) {
|
||||
BIO_printf(err, "Error reading password from BIO\n");
|
||||
return NULL;
|
||||
}
|
||||
tmp = strchr(tpass, '\n');
|
||||
if(tmp) *tmp = 0;
|
||||
return BUF_strdup(tpass);
|
||||
}
|
||||
|
||||
20
apps/apps.h
20
apps/apps.h
@@ -64,7 +64,17 @@
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include "progs.h"
|
||||
#include <openssl/x509.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);
|
||||
/* When `file' is NULL, use defaults.
|
||||
* `bio_e' is for error messages. */
|
||||
void app_RAND_allow_write_file(void);
|
||||
long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
||||
* separated by LIST_SEPARATOR_CHAR
|
||||
* (see e_os.h). The string is
|
||||
* destroyed! */
|
||||
|
||||
#ifdef NO_STDIO
|
||||
BIO_METHOD *BIO_s_file();
|
||||
@@ -103,7 +113,7 @@ extern BIO *bio_err;
|
||||
#define do_pipe_sig()
|
||||
#endif
|
||||
|
||||
#if defined(MONOLITH) && !defined(SSLEAY)
|
||||
#if defined(MONOLITH) && !defined(OPENSSL_C)
|
||||
# define apps_startup() do_pipe_sig()
|
||||
#else
|
||||
# if defined(MSDOS) || defined(WIN16) || defined(WIN32)
|
||||
@@ -132,10 +142,16 @@ int args_from_file(char *file, int *argc, char **argv[]);
|
||||
int str2fmt(char *s);
|
||||
void program_name(char *in,char *out,int size);
|
||||
int chopup_args(ARGS *arg,char *buf, int *argc, char **argv[]);
|
||||
#ifdef HEADER_X509_H
|
||||
int dump_cert_text(BIO *out, X509 *x);
|
||||
#endif
|
||||
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
|
||||
#define FORMAT_UNDEF 0
|
||||
#define FORMAT_ASN1 1
|
||||
#define FORMAT_TEXT 2
|
||||
#define FORMAT_PEM 3
|
||||
#define FORMAT_NETSCAPE 4
|
||||
|
||||
#define APP_PASS_LEN 1024
|
||||
|
||||
#endif
|
||||
|
||||
@@ -74,19 +74,21 @@
|
||||
* -i - indent the details by depth
|
||||
* -offset - where in the file to start
|
||||
* -length - how many bytes to use
|
||||
* -oid file - extra oid decription file
|
||||
* -oid file - extra oid description file
|
||||
*/
|
||||
|
||||
#undef PROG
|
||||
#define PROG asn1parse_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,badops=0,offset=0,ret=1,j;
|
||||
unsigned int length=0;
|
||||
long num,tmplen;
|
||||
BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL;
|
||||
int informat,indent=0;
|
||||
int informat,indent=0, noout = 0;
|
||||
char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
|
||||
unsigned char *tmpbuf;
|
||||
BUF_MEM *buf=NULL;
|
||||
@@ -130,6 +132,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
indent=1;
|
||||
}
|
||||
else if (strcmp(*argv,"-noout") == 0) noout = 1;
|
||||
else if (strcmp(*argv,"-oid") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -168,8 +171,10 @@ 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," -noout arg don't produce any output\n");
|
||||
BIO_printf(bio_err," -offset arg offset into file\n");
|
||||
BIO_printf(bio_err," -length arg lenth of section in file\n");
|
||||
BIO_printf(bio_err," -length arg length of section in file\n");
|
||||
BIO_printf(bio_err," -i indent entries\n");
|
||||
BIO_printf(bio_err," -oid file file of extra oid definitions\n");
|
||||
BIO_printf(bio_err," -strparse offset\n");
|
||||
@@ -287,7 +292,8 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
if (!ASN1_parse(out,(unsigned char *)&(str[offset]),length,indent))
|
||||
if (!noout &&
|
||||
!ASN1_parse(out,(unsigned char *)&(str[offset]),length,indent))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
|
||||
219
apps/ca.c
219
apps/ca.c
@@ -147,6 +147,8 @@ static char *ca_usage[]={
|
||||
" -gencrl - Generate a new CRL\n",
|
||||
" -crldays days - Days is when the next CRL is due\n",
|
||||
" -crlhours hours - Hours is when the next CRL is due\n",
|
||||
" -startdate YYMMDDHHMMSSZ - certificate validity notBefore\n",
|
||||
" -enddate YYMMDDHHMMSSZ - certificate validity notAfter (overrides -days)\n",
|
||||
" -days arg - number of days to certify the certificate for\n",
|
||||
" -md arg - md to use, one of md2, md5, sha or sha1\n",
|
||||
" -policy arg - The CA 'policy' to support\n",
|
||||
@@ -163,6 +165,8 @@ static char *ca_usage[]={
|
||||
" -batch - Don't ask questions\n",
|
||||
" -msie_hack - msie modifications to handle all those universal strings\n",
|
||||
" -revoke file - Revoke a certificate (given in file)\n",
|
||||
" -extensions .. - Extension section (override value in config file)\n",
|
||||
" -crlexts .. - CRL extension section (override value in config file)\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -174,7 +178,6 @@ extern int EF_ALIGNMENT;
|
||||
|
||||
static int add_oid_section(LHASH *conf);
|
||||
static void lookup_fail(char *name,char *tag);
|
||||
static int MS_CALLBACK key_callback(char *buf,int len,int verify,void *u);
|
||||
static unsigned long index_serial_hash(char **a);
|
||||
static int index_serial_cmp(char **a, char **b);
|
||||
static unsigned long index_name_hash(char **a);
|
||||
@@ -197,22 +200,24 @@ static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509,
|
||||
char *enddate, int days, char *ext_sect,LHASH *conf,
|
||||
int verbose);
|
||||
static int fix_data(int nid, int *type);
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der);
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext);
|
||||
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
|
||||
STACK_OF(CONF_VALUE) *policy, TXT_DB *db, BIGNUM *serial,
|
||||
char *startdate, char *enddate, int days, int batch, int verbose,
|
||||
X509_REQ *req, char *ext_sect, LHASH *conf);
|
||||
static int do_revoke(X509 *x509, TXT_DB *db);
|
||||
static int check_time_format(char *str);
|
||||
static LHASH *conf;
|
||||
static char *key=NULL;
|
||||
static LHASH *conf=NULL;
|
||||
static char *section=NULL;
|
||||
|
||||
static int preserve=0;
|
||||
static int msie_hack=0;
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char *key=NULL;
|
||||
int total=0;
|
||||
int total_done=0;
|
||||
int badops=0;
|
||||
@@ -244,6 +249,7 @@ int MAIN(int argc, char **argv)
|
||||
char *enddate=NULL;
|
||||
int days=0;
|
||||
int batch=0;
|
||||
int notext=0;
|
||||
X509 *x509=NULL;
|
||||
X509 *x=NULL;
|
||||
BIO *in=NULL,*out=NULL,*Sout=NULL,*Cout=NULL;
|
||||
@@ -262,6 +268,7 @@ int MAIN(int argc, char **argv)
|
||||
#undef BSIZE
|
||||
#define BSIZE 256
|
||||
MS_STATIC char buf[3][BSIZE];
|
||||
char *randfile=NULL;
|
||||
|
||||
#ifdef EFENCE
|
||||
EF_PROTECT_FREE=1;
|
||||
@@ -271,9 +278,12 @@ EF_ALIGNMENT=0;
|
||||
|
||||
apps_startup();
|
||||
|
||||
X509V3_add_standard_extensions();
|
||||
conf = NULL;
|
||||
key = NULL;
|
||||
section = NULL;
|
||||
|
||||
preserve=0;
|
||||
msie_hack=0;
|
||||
if (bio_err == NULL)
|
||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
@@ -350,6 +360,8 @@ EF_ALIGNMENT=0;
|
||||
if (--argc < 1) goto bad;
|
||||
outdir= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-notext") == 0)
|
||||
notext=1;
|
||||
else if (strcmp(*argv,"-batch") == 0)
|
||||
batch=1;
|
||||
else if (strcmp(*argv,"-preserveDN") == 0)
|
||||
@@ -393,6 +405,16 @@ EF_ALIGNMENT=0;
|
||||
infile= *(++argv);
|
||||
dorevoke=1;
|
||||
}
|
||||
else if (strcmp(*argv,"-extensions") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
extensions= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-crlexts") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
crl_ext= *(++argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
bad:
|
||||
@@ -476,12 +498,16 @@ bad:
|
||||
BIO_free(oid_bio);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!add_oid_section(conf)) {
|
||||
if(!add_oid_section(conf))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
randfile = CONF_get_string(conf, BASE_SECTION, "RANDFILE");
|
||||
app_RAND_load_file(randfile, bio_err, 0);
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
Sout=BIO_new(BIO_s_file());
|
||||
@@ -493,7 +519,7 @@ bad:
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
/* we definitly need an public key, so lets get it */
|
||||
/* we definitely need an public key, so lets get it */
|
||||
|
||||
if ((keyfile == NULL) && ((keyfile=CONF_get_string(conf,
|
||||
section,ENV_PRIVATE_KEY)) == NULL))
|
||||
@@ -507,13 +533,8 @@ bad:
|
||||
BIO_printf(bio_err,"trying to load CA private key\n");
|
||||
goto err;
|
||||
}
|
||||
if (key == NULL)
|
||||
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,NULL);
|
||||
else
|
||||
{
|
||||
pkey=PEM_read_bio_PrivateKey(in,NULL,key_callback,NULL);
|
||||
memset(key,0,strlen(key));
|
||||
}
|
||||
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,key);
|
||||
if(key) memset(key,0,strlen(key));
|
||||
if (pkey == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load CA private key\n");
|
||||
@@ -566,14 +587,19 @@ bad:
|
||||
BIO_printf(bio_err,"there needs to be defined a directory for new certificate to be placed in\n");
|
||||
goto err;
|
||||
}
|
||||
#ifdef VMS
|
||||
/* For technical reasons, VMS misbehaves with X_OK */
|
||||
if (access(outdir,R_OK|W_OK) != 0)
|
||||
#else
|
||||
#ifndef VMS /* outdir is a directory spec, but access() for VMS demands a
|
||||
filename. In any case, stat(), below, will catch the problem
|
||||
if outdir is not a directory spec, and the fopen() or open()
|
||||
will catch an error if there is no write access.
|
||||
|
||||
Presumably, this problem could also be solved by using the DEC
|
||||
C routines to convert the directory syntax to Unixly, and give
|
||||
that to access(). However, time's too short to do that just
|
||||
now.
|
||||
*/
|
||||
if (access(outdir,R_OK|W_OK|X_OK) != 0)
|
||||
#endif
|
||||
{
|
||||
BIO_printf(bio_err,"I am unable to acces the %s directory\n",outdir);
|
||||
BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir);
|
||||
perror(outdir);
|
||||
goto err;
|
||||
}
|
||||
@@ -584,12 +610,15 @@ bad:
|
||||
perror(outdir);
|
||||
goto err;
|
||||
}
|
||||
#ifdef S_IFDIR
|
||||
if (!(sb.st_mode & S_IFDIR))
|
||||
{
|
||||
BIO_printf(bio_err,"%s need to be a directory\n",outdir);
|
||||
perror(outdir);
|
||||
goto err;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
@@ -655,7 +684,7 @@ bad:
|
||||
TXT_DB_write(out,db);
|
||||
BIO_printf(bio_err,"%d entries loaded from the database\n",
|
||||
db->data->num);
|
||||
BIO_printf(bio_err,"generating indexs\n");
|
||||
BIO_printf(bio_err,"generating index\n");
|
||||
}
|
||||
|
||||
if (!TXT_DB_create_index(db,DB_serial,NULL,index_serial_hash,
|
||||
@@ -720,8 +749,8 @@ bad:
|
||||
lookup_fail(section,ENV_SERIAL);
|
||||
goto err;
|
||||
}
|
||||
|
||||
extensions=CONF_get_string(conf,section,ENV_EXTENSIONS);
|
||||
if(!extensions)
|
||||
extensions=CONF_get_string(conf,section,ENV_EXTENSIONS);
|
||||
if(extensions) {
|
||||
/* Check syntax of file */
|
||||
X509V3_CTX ctx;
|
||||
@@ -966,8 +995,8 @@ bad:
|
||||
perror(buf[2]);
|
||||
goto err;
|
||||
}
|
||||
write_new_certificate(Cout,x, 0);
|
||||
write_new_certificate(Sout,x, output_der);
|
||||
write_new_certificate(Cout,x, 0, notext);
|
||||
write_new_certificate(Sout,x, output_der, notext);
|
||||
}
|
||||
|
||||
if (sk_num(cert_sk))
|
||||
@@ -987,14 +1016,14 @@ bad:
|
||||
out=NULL;
|
||||
if (rename(serialfile,buf[2]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unabel to rename %s to %s\n",
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
serialfile,buf[2]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
if (rename(buf[0],serialfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unabel to rename %s to %s\n",
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
buf[0],serialfile);
|
||||
perror("reason");
|
||||
rename(buf[2],serialfile);
|
||||
@@ -1011,14 +1040,14 @@ bad:
|
||||
|
||||
if (rename(dbfile,buf[2]) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unabel to rename %s to %s\n",
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
dbfile,buf[2]);
|
||||
perror("reason");
|
||||
goto err;
|
||||
}
|
||||
if (rename(buf[1],dbfile) < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"unabel to rename %s to %s\n",
|
||||
BIO_printf(bio_err,"unable to rename %s to %s\n",
|
||||
buf[1],dbfile);
|
||||
perror("reason");
|
||||
rename(buf[2],dbfile);
|
||||
@@ -1031,7 +1060,7 @@ bad:
|
||||
/*****************************************************************/
|
||||
if (gencrl)
|
||||
{
|
||||
crl_ext=CONF_get_string(conf,section,ENV_CRLEXT);
|
||||
if(!crl_ext) crl_ext=CONF_get_string(conf,section,ENV_CRLEXT);
|
||||
if(crl_ext) {
|
||||
/* Check syntax of file */
|
||||
X509V3_CTX ctx;
|
||||
@@ -1143,13 +1172,6 @@ bad:
|
||||
/*****************************************************************/
|
||||
if (dorevoke)
|
||||
{
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
if (infile == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"no input files\n");
|
||||
@@ -1157,19 +1179,22 @@ bad:
|
||||
}
|
||||
else
|
||||
{
|
||||
X509 *revcert;
|
||||
if (BIO_read_filename(in,infile) <= 0)
|
||||
{
|
||||
perror(infile);
|
||||
BIO_printf(bio_err,"error trying to load '%s' certificate\n",infile);
|
||||
goto err;
|
||||
}
|
||||
x509=PEM_read_bio_X509(in,NULL,NULL,NULL);
|
||||
if (x509 == NULL)
|
||||
revcert=PEM_read_bio_X509(in,NULL,NULL,NULL);
|
||||
if (revcert == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load '%s' certificate\n",infile);
|
||||
goto err;
|
||||
}
|
||||
j=do_revoke(x509,db);
|
||||
j=do_revoke(revcert,db);
|
||||
if (j <= 0) goto err;
|
||||
X509_free(revcert);
|
||||
|
||||
strncpy(buf[0],dbfile,BSIZE-4);
|
||||
strcat(buf[0],".new");
|
||||
@@ -1181,10 +1206,6 @@ bad:
|
||||
}
|
||||
j=TXT_DB_write(out,db);
|
||||
if (j <= 0) goto err;
|
||||
BIO_free(in);
|
||||
BIO_free(out);
|
||||
in=NULL;
|
||||
out=NULL;
|
||||
strncpy(buf[1],dbfile,BSIZE-4);
|
||||
strcat(buf[1],".old");
|
||||
if (rename(dbfile,buf[1]) < 0)
|
||||
@@ -1215,13 +1236,13 @@ err:
|
||||
sk_pop_free(cert_sk,X509_free);
|
||||
|
||||
if (ret) ERR_print_errors(bio_err);
|
||||
app_RAND_write_file(randfile, bio_err);
|
||||
BN_free(serial);
|
||||
TXT_DB_free(db);
|
||||
EVP_PKEY_free(pkey);
|
||||
X509_free(x509);
|
||||
X509_CRL_free(crl);
|
||||
CONF_free(conf);
|
||||
X509V3_EXT_cleanup();
|
||||
OBJ_cleanup();
|
||||
EXIT(ret);
|
||||
}
|
||||
@@ -1231,17 +1252,6 @@ static void lookup_fail(char *name, char *tag)
|
||||
BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag);
|
||||
}
|
||||
|
||||
static int MS_CALLBACK key_callback(char *buf, int len, int verify, void *u)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (key == NULL) return(0);
|
||||
i=strlen(key);
|
||||
i=(i > len)?len:i;
|
||||
memcpy(buf,key,i);
|
||||
return(i);
|
||||
}
|
||||
|
||||
static unsigned long index_serial_hash(char **a)
|
||||
{
|
||||
char *n;
|
||||
@@ -1664,8 +1674,7 @@ again2:
|
||||
|
||||
if (push != NULL)
|
||||
{
|
||||
if (!X509_NAME_add_entry(subject,push,
|
||||
X509_NAME_entry_count(subject),0))
|
||||
if (!X509_NAME_add_entry(subject,push, -1, 0))
|
||||
{
|
||||
if (push != NULL)
|
||||
X509_NAME_ENTRY_free(push);
|
||||
@@ -1685,7 +1694,7 @@ again2:
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
BIO_printf(bio_err,"The subject name apears to be ok, checking data base for clashes\n");
|
||||
BIO_printf(bio_err,"The subject name appears to be ok, checking data base for clashes\n");
|
||||
|
||||
row[DB_name]=X509_NAME_oneline(subject,NULL,0);
|
||||
row[DB_serial]=BN_bn2hex(serial);
|
||||
@@ -1742,7 +1751,7 @@ again2:
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* We are now totaly happy, lets make and sign the certificate */
|
||||
/* We are now totally happy, lets make and sign the certificate */
|
||||
if (verbose)
|
||||
BIO_printf(bio_err,"Everything appears to be ok, creating and signing the certificate\n");
|
||||
|
||||
@@ -1789,7 +1798,7 @@ again2:
|
||||
ASN1_INTEGER_set(ci->version,2); /* version 3 certificate */
|
||||
|
||||
/* Free the current entries if any, there should not
|
||||
* be any I belive */
|
||||
* be any I believe */
|
||||
if (ci->extensions != NULL)
|
||||
sk_X509_EXTENSION_pop_free(ci->extensions,
|
||||
X509_EXTENSION_free);
|
||||
@@ -1883,6 +1892,8 @@ err:
|
||||
X509_NAME_free(CAname);
|
||||
if (subject != NULL)
|
||||
X509_NAME_free(subject);
|
||||
if (tmptm != NULL)
|
||||
ASN1_UTCTIME_free(tmptm);
|
||||
if (ok <= 0)
|
||||
{
|
||||
if (ret != NULL) X509_free(ret);
|
||||
@@ -1893,17 +1904,16 @@ err:
|
||||
return(ok);
|
||||
}
|
||||
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der)
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext)
|
||||
{
|
||||
char *f;
|
||||
char buf[256];
|
||||
|
||||
if (output_der)
|
||||
{
|
||||
(void)i2d_X509_bio(bp,x);
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* ??? Not needed since X509_print prints all this stuff anyway */
|
||||
f=X509_NAME_oneline(X509_get_issuer_name(x),buf,256);
|
||||
BIO_printf(bp,"issuer :%s\n",f);
|
||||
|
||||
@@ -1913,10 +1923,9 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der)
|
||||
BIO_puts(bp,"serial :");
|
||||
i2a_ASN1_INTEGER(bp,x->cert_info->serialNumber);
|
||||
BIO_puts(bp,"\n\n");
|
||||
X509_print(bp,x);
|
||||
BIO_puts(bp,"\n");
|
||||
#endif
|
||||
if(!notext)X509_print(bp,x);
|
||||
PEM_write_bio_X509(bp,x);
|
||||
BIO_puts(bp,"\n");
|
||||
}
|
||||
|
||||
static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
@@ -1929,7 +1938,6 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
X509_REQ *req=NULL;
|
||||
CONF_VALUE *cv=NULL;
|
||||
NETSCAPE_SPKI *spki = NULL;
|
||||
unsigned char *spki_der = NULL,*p;
|
||||
X509_REQ_INFO *ri;
|
||||
char *type,*buf;
|
||||
EVP_PKEY *pktmp=NULL;
|
||||
@@ -1986,31 +1994,22 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
|
||||
cv=sk_CONF_VALUE_value(sk,i);
|
||||
type=cv->name;
|
||||
buf=cv->value;
|
||||
/* Skip past any leading X. X: X, etc to allow for
|
||||
* multiple instances
|
||||
*/
|
||||
for(buf = cv->name; *buf ; buf++)
|
||||
if ((*buf == ':') || (*buf == ',') || (*buf == '.')) {
|
||||
buf++;
|
||||
if(*buf) type = buf;
|
||||
break;
|
||||
}
|
||||
|
||||
buf=cv->value;
|
||||
if ((nid=OBJ_txt2nid(type)) == NID_undef)
|
||||
{
|
||||
if (strcmp(type, "SPKAC") == 0)
|
||||
{
|
||||
spki_der=(unsigned char *)Malloc(
|
||||
strlen(cv->value)+1);
|
||||
if (spki_der == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Malloc failure\n");
|
||||
goto err;
|
||||
}
|
||||
j = EVP_DecodeBlock(spki_der, (unsigned char *)cv->value,
|
||||
strlen(cv->value));
|
||||
if (j <= 0)
|
||||
{
|
||||
BIO_printf(bio_err, "Can't b64 decode SPKAC structure\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
p=spki_der;
|
||||
spki = d2i_NETSCAPE_SPKI(&spki, &p, j);
|
||||
Free(spki_der);
|
||||
spki_der = NULL;
|
||||
spki = NETSCAPE_SPKI_b64_decode(cv->value, -1);
|
||||
if (spki == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load Netscape SPKAC structure\n");
|
||||
@@ -2034,8 +2033,7 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
strlen(buf))) == NULL)
|
||||
goto err;
|
||||
|
||||
if (!X509_NAME_add_entry(n,ne,X509_NAME_entry_count(n),0))
|
||||
goto err;
|
||||
if (!X509_NAME_add_entry(n,ne,-1, 0)) goto err;
|
||||
}
|
||||
if (spki == NULL)
|
||||
{
|
||||
@@ -2050,7 +2048,7 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
|
||||
BIO_printf(bio_err,"Check that the SPKAC request matches the signature\n");
|
||||
|
||||
if ((pktmp=X509_PUBKEY_get(spki->spkac->pubkey)) == NULL)
|
||||
if ((pktmp=NETSCAPE_SPKI_get_pubkey(spki)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"error unpacking SPKAC public key\n");
|
||||
goto err;
|
||||
@@ -2071,7 +2069,6 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
err:
|
||||
if (req != NULL) X509_REQ_free(req);
|
||||
if (parms != NULL) CONF_free(parms);
|
||||
if (spki_der != NULL) Free(spki_der);
|
||||
if (spki != NULL) NETSCAPE_SPKI_free(spki);
|
||||
if (ne != NULL) X509_NAME_ENTRY_free(ne);
|
||||
|
||||
@@ -2127,20 +2124,26 @@ static int add_oid_section(LHASH *hconf)
|
||||
|
||||
static int do_revoke(X509 *x509, TXT_DB *db)
|
||||
{
|
||||
ASN1_UTCTIME *tm=NULL;
|
||||
ASN1_UTCTIME *tm=NULL, *revtm=NULL;
|
||||
char *row[DB_NUMBER],**rrow,**irow;
|
||||
BIGNUM *bn = NULL;
|
||||
int ok=-1,i;
|
||||
|
||||
for (i=0; i<DB_NUMBER; i++)
|
||||
row[i]=NULL;
|
||||
row[DB_name]=X509_NAME_oneline(x509->cert_info->subject,NULL,0);
|
||||
row[DB_serial]=BN_bn2hex(ASN1_INTEGER_to_BN(x509->cert_info->serialNumber,NULL));
|
||||
row[DB_name]=X509_NAME_oneline(X509_get_subject_name(x509),NULL,0);
|
||||
bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(x509),NULL);
|
||||
row[DB_serial]=BN_bn2hex(bn);
|
||||
BN_free(bn);
|
||||
if ((row[DB_name] == NULL) || (row[DB_serial] == NULL))
|
||||
{
|
||||
BIO_printf(bio_err,"Malloc failure\n");
|
||||
goto err;
|
||||
}
|
||||
rrow=TXT_DB_get_by_index(db,DB_name,row);
|
||||
/* We have to lookup by serial number because name lookup
|
||||
* skips revoked certs
|
||||
*/
|
||||
rrow=TXT_DB_get_by_index(db,DB_serial,row);
|
||||
if (rrow == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Adding Entry to DB for %s\n", row[DB_name]);
|
||||
@@ -2191,16 +2194,15 @@ static int do_revoke(X509 *x509, TXT_DB *db)
|
||||
}
|
||||
|
||||
/* Revoke Certificate */
|
||||
do_revoke(x509,db);
|
||||
ok = do_revoke(x509,db);
|
||||
|
||||
ok=1;
|
||||
goto err;
|
||||
|
||||
}
|
||||
else if (index_serial_cmp(row,rrow))
|
||||
else if (index_name_cmp(row,rrow))
|
||||
{
|
||||
BIO_printf(bio_err,"ERROR:no same serial number %s\n",
|
||||
row[DB_serial]);
|
||||
BIO_printf(bio_err,"ERROR:name does not match %s\n",
|
||||
row[DB_name]);
|
||||
goto err;
|
||||
}
|
||||
else if (rrow[DB_type][0]=='R')
|
||||
@@ -2212,12 +2214,14 @@ static int do_revoke(X509 *x509, TXT_DB *db)
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"Revoking Certificate %s.\n", rrow[DB_serial]);
|
||||
tm=X509_gmtime_adj(tm,0);
|
||||
revtm = ASN1_UTCTIME_new();
|
||||
revtm=X509_gmtime_adj(revtm,0);
|
||||
rrow[DB_type][0]='R';
|
||||
rrow[DB_type][1]='\0';
|
||||
rrow[DB_rev_date]=(char *)Malloc(tm->length+1);
|
||||
memcpy(rrow[DB_rev_date],tm->data,tm->length);
|
||||
rrow[DB_rev_date][tm->length]='\0';
|
||||
rrow[DB_rev_date]=(char *)Malloc(revtm->length+1);
|
||||
memcpy(rrow[DB_rev_date],revtm->data,revtm->length);
|
||||
rrow[DB_rev_date][revtm->length]='\0';
|
||||
ASN1_UTCTIME_free(revtm);
|
||||
}
|
||||
ok=1;
|
||||
err:
|
||||
@@ -2226,7 +2230,6 @@ err:
|
||||
if (row[i] != NULL)
|
||||
Free(row[i]);
|
||||
}
|
||||
ASN1_UTCTIME_free(tm);
|
||||
return(ok);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,10 +66,6 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#if defined(NO_RSA) && !defined(NO_SSL2)
|
||||
#define NO_SSL2
|
||||
#endif
|
||||
|
||||
#undef PROG
|
||||
#define PROG ciphers_main
|
||||
|
||||
@@ -81,6 +77,8 @@ static char *ciphers_usage[]={
|
||||
NULL
|
||||
};
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1,i;
|
||||
@@ -145,12 +143,16 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
SSLeay_add_ssl_algorithms();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
|
||||
ctx=SSL_CTX_new(meth);
|
||||
if (ctx == NULL) goto err;
|
||||
if (ciphers != NULL)
|
||||
SSL_CTX_set_cipher_list(ctx,ciphers);
|
||||
if (ciphers != NULL) {
|
||||
if(!SSL_CTX_set_cipher_list(ctx,ciphers)) {
|
||||
BIO_printf(bio_err, "Error in cipher list\n");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
ssl=SSL_new(ctx);
|
||||
if (ssl == NULL) goto err;
|
||||
|
||||
|
||||
83
apps/crl.c
83
apps/crl.c
@@ -75,7 +75,7 @@
|
||||
static char *crl_usage[]={
|
||||
"usage: crl args\n",
|
||||
"\n",
|
||||
" -inform arg - input format - default PEM (one of DER, TXT or PEM)\n",
|
||||
" -inform arg - input format - default PEM (DER or PEM)\n",
|
||||
" -outform arg - output format - default PEM\n",
|
||||
" -text - print out a text format version\n",
|
||||
" -in arg - input file - default stdin\n",
|
||||
@@ -85,21 +85,32 @@ static char *crl_usage[]={
|
||||
" -lastupdate - lastUpdate field\n",
|
||||
" -nextupdate - nextUpdate field\n",
|
||||
" -noout - no CRL output\n",
|
||||
" -CAfile name - verify CRL using certificates in file \"name\"\n",
|
||||
" -CApath dir - verify CRL using certificates in \"dir\"\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
static X509_CRL *load_crl(char *file, int format);
|
||||
static BIO *bio_out=NULL;
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
X509_CRL *x=NULL;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
int ret=1,i,num,badops=0;
|
||||
BIO *out=NULL;
|
||||
int informat,outformat;
|
||||
char *infile=NULL,*outfile=NULL;
|
||||
int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
|
||||
char **pp,buf[256];
|
||||
X509_STORE *store = NULL;
|
||||
X509_STORE_CTX ctx;
|
||||
X509_LOOKUP *lookup = NULL;
|
||||
X509_OBJECT xobj;
|
||||
EVP_PKEY *pkey;
|
||||
int do_ver = 0;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -146,6 +157,20 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-CApath") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
CApath = *(++argv);
|
||||
do_ver = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-CAfile") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
CAfile = *(++argv);
|
||||
do_ver = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-verify") == 0)
|
||||
do_ver = 1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
text = 1;
|
||||
else if (strcmp(*argv,"-hash") == 0)
|
||||
@@ -177,36 +202,74 @@ bad:
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
X509V3_add_standard_extensions();
|
||||
x=load_crl(infile,informat);
|
||||
if (x == NULL) { goto end; }
|
||||
|
||||
if(do_ver) {
|
||||
store = X509_STORE_new();
|
||||
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());
|
||||
if (lookup == NULL) goto end;
|
||||
if (!X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM))
|
||||
X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
|
||||
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_hash_dir());
|
||||
if (lookup == NULL) goto end;
|
||||
if (!X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM))
|
||||
X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
ERR_clear_error();
|
||||
|
||||
X509_STORE_CTX_init(&ctx, store, NULL, NULL);
|
||||
|
||||
i = X509_STORE_get_by_subject(&ctx, X509_LU_X509,
|
||||
X509_CRL_get_issuer(x), &xobj);
|
||||
if(i <= 0) {
|
||||
BIO_printf(bio_err,
|
||||
"Error getting CRL issuer certificate\n");
|
||||
goto end;
|
||||
}
|
||||
pkey = X509_get_pubkey(xobj.data.x509);
|
||||
X509_OBJECT_free_contents(&xobj);
|
||||
if(!pkey) {
|
||||
BIO_printf(bio_err,
|
||||
"Error getting CRL issuer public key\n");
|
||||
goto end;
|
||||
}
|
||||
i = X509_CRL_verify(x, pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
if(i < 0) goto end;
|
||||
if(i == 0) BIO_printf(bio_err, "verify failure\n");
|
||||
else BIO_printf(bio_err, "verify OK\n");
|
||||
}
|
||||
|
||||
if (num)
|
||||
{
|
||||
for (i=1; i<=num; i++)
|
||||
{
|
||||
if (issuer == i)
|
||||
{
|
||||
X509_NAME_oneline(x->crl->issuer,buf,256);
|
||||
X509_NAME_oneline(X509_CRL_get_issuer(x),
|
||||
buf,256);
|
||||
BIO_printf(bio_out,"issuer= %s\n",buf);
|
||||
}
|
||||
|
||||
if (hash == i)
|
||||
{
|
||||
BIO_printf(bio_out,"%08lx\n",
|
||||
X509_NAME_hash(x->crl->issuer));
|
||||
X509_NAME_hash(X509_CRL_get_issuer(x)));
|
||||
}
|
||||
if (lastupdate == i)
|
||||
{
|
||||
BIO_printf(bio_out,"lastUpdate=");
|
||||
ASN1_TIME_print(bio_out,x->crl->lastUpdate);
|
||||
ASN1_TIME_print(bio_out,
|
||||
X509_CRL_get_lastUpdate(x));
|
||||
BIO_printf(bio_out,"\n");
|
||||
}
|
||||
if (nextupdate == i)
|
||||
{
|
||||
BIO_printf(bio_out,"nextUpdate=");
|
||||
if (x->crl->nextUpdate != NULL)
|
||||
ASN1_TIME_print(bio_out,x->crl->nextUpdate);
|
||||
if (X509_CRL_get_nextUpdate(x))
|
||||
ASN1_TIME_print(bio_out,
|
||||
X509_CRL_get_nextUpdate(x));
|
||||
else
|
||||
BIO_printf(bio_out,"NONE");
|
||||
BIO_printf(bio_out,"\n");
|
||||
@@ -250,8 +313,12 @@ bad:
|
||||
end:
|
||||
BIO_free(out);
|
||||
BIO_free(bio_out);
|
||||
bio_out=NULL;
|
||||
X509_CRL_free(x);
|
||||
X509V3_EXT_cleanup();
|
||||
if(store) {
|
||||
X509_STORE_CTX_cleanup(&ctx);
|
||||
X509_STORE_free(store);
|
||||
}
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,12 +76,14 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
|
||||
#undef PROG
|
||||
#define PROG crl2pkcs7_main
|
||||
|
||||
/* -inform arg - input format - default PEM (one of DER, TXT or PEM)
|
||||
/* -inform arg - input format - default PEM (DER or PEM)
|
||||
* -outform arg - output format - default PEM
|
||||
* -in arg - input file - default stdin
|
||||
* -out arg - output file - default stdout
|
||||
*/
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,badops=0;
|
||||
@@ -157,8 +159,8 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||
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," -outform arg output format - one of DER TXT PEM\n");
|
||||
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||
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," -certfile arg certificates file of chain to a trusted CA\n");
|
||||
|
||||
@@ -74,6 +74,9 @@
|
||||
#define PROG dgst_main
|
||||
|
||||
void do_fp(unsigned char *buf,BIO *f,int sep);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
unsigned char *buf=NULL;
|
||||
|
||||
13
apps/dh.c
13
apps/dh.c
@@ -72,7 +72,7 @@
|
||||
#undef PROG
|
||||
#define PROG dh_main
|
||||
|
||||
/* -inform arg - input format - default PEM (one of DER, TXT or PEM)
|
||||
/* -inform arg - input format - default PEM (DER or PEM)
|
||||
* -outform arg - output format - default PEM
|
||||
* -in arg - input file - default stdin
|
||||
* -out arg - output file - default stdout
|
||||
@@ -82,6 +82,8 @@
|
||||
* -C
|
||||
*/
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
DH *dh=NULL;
|
||||
@@ -149,8 +151,8 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||
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," -outform arg output format - one of DER TXT PEM\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER PEM\n");
|
||||
BIO_printf(bio_err," -outform arg output format - one of DER PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -check check the DH parameters\n");
|
||||
@@ -219,7 +221,7 @@ bad:
|
||||
BN_print(stdout,dh->g);
|
||||
printf("\n");
|
||||
if (dh->length != 0)
|
||||
printf("recomented private length=%ld\n",dh->length);
|
||||
printf("recommended private length=%ld\n",dh->length);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -282,6 +284,7 @@ bad:
|
||||
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
||||
printf("\t\treturn(NULL);\n");
|
||||
printf("\treturn(dh);\n\t}\n");
|
||||
Free(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,7 +300,7 @@ bad:
|
||||
}
|
||||
if (!i)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to write DH paramaters\n");
|
||||
BIO_printf(bio_err,"unable to write DH parameters\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
368
apps/dhparam.c
Normal file
368
apps/dhparam.c
Normal file
@@ -0,0 +1,368 @@
|
||||
/* apps/dhparam.c */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef NO_DH
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG dhparam_main
|
||||
|
||||
#define DEFBITS 512
|
||||
|
||||
/* -inform arg - input format - default PEM (DER or PEM)
|
||||
* -outform arg - output format - default PEM
|
||||
* -in arg - input file - default stdin
|
||||
* -out arg - output file - default stdout
|
||||
* -check - check the parameters are ok
|
||||
* -noout
|
||||
* -text
|
||||
* -C
|
||||
*/
|
||||
|
||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
DH *dh=NULL;
|
||||
int i,badops=0,text=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||
char *infile,*outfile,*prog;
|
||||
char *inrand=NULL;
|
||||
int num = 0, g = 0;
|
||||
|
||||
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);
|
||||
|
||||
infile=NULL;
|
||||
outfile=NULL;
|
||||
informat=FORMAT_PEM;
|
||||
outformat=FORMAT_PEM;
|
||||
|
||||
prog=argv[0];
|
||||
argc--;
|
||||
argv++;
|
||||
while (argc >= 1)
|
||||
{
|
||||
if (strcmp(*argv,"-inform") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
informat=str2fmt(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-outform") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
outformat=str2fmt(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-in") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
infile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-out") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-check") == 0)
|
||||
check=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
text=1;
|
||||
else if (strcmp(*argv,"-C") == 0)
|
||||
C=1;
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-2") == 0)
|
||||
g=2;
|
||||
else if (strcmp(*argv,"-5") == 0)
|
||||
g=5;
|
||||
else if (strcmp(*argv,"-rand") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
inrand= *(++argv);
|
||||
}
|
||||
else if (((sscanf(*argv,"%d",&num) == 0) || (num <= 0)))
|
||||
goto bad;
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
|
||||
if (badops)
|
||||
{
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] [numbits]\n",prog);
|
||||
BIO_printf(bio_err,"where options are\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER PEM\n");
|
||||
BIO_printf(bio_err," -outform arg output format - one of DER PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -check check the DH parameters\n");
|
||||
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
||||
BIO_printf(bio_err," -C Output C code\n");
|
||||
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
|
||||
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
|
||||
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
|
||||
BIO_printf(bio_err," -rand file:file:...\n");
|
||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
BIO_printf(bio_err," -noout no output\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if(g && !num) num = DEFBITS;
|
||||
else if(num && !g) g = 2;
|
||||
|
||||
if(num) {
|
||||
|
||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
}
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
app_RAND_load_files(inrand));
|
||||
|
||||
BIO_printf(bio_err,"Generating DH parameters, %d bit long strong prime, generator of %d\n",num,g);
|
||||
BIO_printf(bio_err,"This is going to take a long time\n");
|
||||
dh=DH_generate_parameters(num,g,dh_cb,bio_err);
|
||||
|
||||
if (dh == NULL) goto end;
|
||||
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
} else {
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
if (in == 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (informat == FORMAT_ASN1)
|
||||
dh=d2i_DHparams_bio(in,NULL);
|
||||
else if (informat == FORMAT_PEM)
|
||||
dh=PEM_read_bio_DHparams(in,NULL,NULL,NULL);
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"bad input format specified\n");
|
||||
goto end;
|
||||
}
|
||||
if (dh == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load DH parameters\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
out=BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (outfile == NULL)
|
||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||
else
|
||||
{
|
||||
if (BIO_write_filename(out,outfile) <= 0)
|
||||
{
|
||||
perror(outfile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (text)
|
||||
{
|
||||
DHparams_print(out,dh);
|
||||
}
|
||||
|
||||
if (check)
|
||||
{
|
||||
if (!DH_check(dh,&i))
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (i & DH_CHECK_P_NOT_PRIME)
|
||||
printf("p value is not prime\n");
|
||||
if (i & DH_CHECK_P_NOT_STRONG_PRIME)
|
||||
printf("p value is not a strong prime\n");
|
||||
if (i & DH_UNABLE_TO_CHECK_GENERATOR)
|
||||
printf("unable to check the generator value\n");
|
||||
if (i & DH_NOT_SUITABLE_GENERATOR)
|
||||
printf("the g value is not a generator\n");
|
||||
if (i == 0)
|
||||
printf("DH parameters appear to be ok.\n");
|
||||
}
|
||||
if (C)
|
||||
{
|
||||
unsigned char *data;
|
||||
int len,l,bits;
|
||||
|
||||
len=BN_num_bytes(dh->p);
|
||||
bits=BN_num_bits(dh->p);
|
||||
data=(unsigned char *)Malloc(len);
|
||||
if (data == NULL)
|
||||
{
|
||||
perror("Malloc");
|
||||
goto end;
|
||||
}
|
||||
l=BN_bn2bin(dh->p,data);
|
||||
printf("static unsigned char dh%d_p[]={",bits);
|
||||
for (i=0; i<l; i++)
|
||||
{
|
||||
if ((i%12) == 0) printf("\n\t");
|
||||
printf("0x%02X,",data[i]);
|
||||
}
|
||||
printf("\n\t};\n");
|
||||
|
||||
l=BN_bn2bin(dh->g,data);
|
||||
printf("static unsigned char dh%d_g[]={",bits);
|
||||
for (i=0; i<l; i++)
|
||||
{
|
||||
if ((i%12) == 0) printf("\n\t");
|
||||
printf("0x%02X,",data[i]);
|
||||
}
|
||||
printf("\n\t};\n\n");
|
||||
|
||||
printf("DH *get_dh%d()\n\t{\n",bits);
|
||||
printf("\tDH *dh;\n\n");
|
||||
printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n");
|
||||
printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n",
|
||||
bits,bits);
|
||||
printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n",
|
||||
bits,bits);
|
||||
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
||||
printf("\t\treturn(NULL);\n");
|
||||
printf("\treturn(dh);\n\t}\n");
|
||||
Free(data);
|
||||
}
|
||||
|
||||
|
||||
if (!noout)
|
||||
{
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i=i2d_DHparams_bio(out,dh);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i=PEM_write_bio_DHparams(out,dh);
|
||||
else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
}
|
||||
if (!i)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to write DH parameters\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
ret=0;
|
||||
end:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free(out);
|
||||
if (dh != NULL) DH_free(dh);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
||||
{
|
||||
char c='*';
|
||||
|
||||
if (p == 0) c='.';
|
||||
if (p == 1) c='+';
|
||||
if (p == 2) c='*';
|
||||
if (p == 3) c='\n';
|
||||
BIO_write((BIO *)arg,&c,1);
|
||||
(void)BIO_flush((BIO *)arg);
|
||||
#ifdef LINT
|
||||
p=n;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
86
apps/dsa.c
86
apps/dsa.c
@@ -83,6 +83,8 @@
|
||||
* -modulus - print the DSA public key
|
||||
*/
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
@@ -91,7 +93,10 @@ int MAIN(int argc, char **argv)
|
||||
const EVP_CIPHER *enc=NULL;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,text=0,noout=0;
|
||||
int pubin = 0, pubout = 0;
|
||||
char *infile,*outfile,*prog;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
int modulus=0;
|
||||
|
||||
apps_startup();
|
||||
@@ -130,12 +135,26 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passin") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargin= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passout") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
text=1;
|
||||
else if (strcmp(*argv,"-modulus") == 0)
|
||||
modulus=1;
|
||||
else if (strcmp(*argv,"-pubin") == 0)
|
||||
pubin=1;
|
||||
else if (strcmp(*argv,"-pubout") == 0)
|
||||
pubout=1;
|
||||
else if ((enc=EVP_get_cipherbyname(&(argv[0][1]))) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||
@@ -151,23 +170,30 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||
BIO_printf(bio_err,"where options are\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER NET PEM\n");
|
||||
BIO_printf(bio_err," -outform arg output format - one of DER NET PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||
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," -passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
#ifndef NO_IDEA
|
||||
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -noout don't print key out\n");
|
||||
BIO_printf(bio_err," -modulus print the DSA public value\n");
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -noout don't print key out\n");
|
||||
BIO_printf(bio_err," -modulus print the DSA public value\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
@@ -187,19 +213,21 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
BIO_printf(bio_err,"read DSA private key\n");
|
||||
if (informat == FORMAT_ASN1)
|
||||
dsa=d2i_DSAPrivateKey_bio(in,NULL);
|
||||
else if (informat == FORMAT_PEM)
|
||||
dsa=PEM_read_bio_DSAPrivateKey(in,NULL,NULL,NULL);
|
||||
else
|
||||
BIO_printf(bio_err,"read DSA key\n");
|
||||
if (informat == FORMAT_ASN1) {
|
||||
if(pubin) dsa=d2i_DSA_PUBKEY_bio(in,NULL);
|
||||
else dsa=d2i_DSAPrivateKey_bio(in,NULL);
|
||||
} else if (informat == FORMAT_PEM) {
|
||||
if(pubin) dsa=PEM_read_bio_DSA_PUBKEY(in,NULL, NULL, NULL);
|
||||
else dsa=PEM_read_bio_DSAPrivateKey(in,NULL,NULL,passin);
|
||||
} else
|
||||
{
|
||||
BIO_printf(bio_err,"bad input format specified for key\n");
|
||||
goto end;
|
||||
}
|
||||
if (dsa == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load Private Key\n");
|
||||
BIO_printf(bio_err,"unable to load Key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -231,12 +259,16 @@ bad:
|
||||
}
|
||||
|
||||
if (noout) goto end;
|
||||
BIO_printf(bio_err,"writing DSA private key\n");
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i=i2d_DSAPrivateKey_bio(out,dsa);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,NULL,0,NULL,NULL);
|
||||
else {
|
||||
BIO_printf(bio_err,"writing DSA key\n");
|
||||
if (outformat == FORMAT_ASN1) {
|
||||
if(pubin || pubout) i=i2d_DSA_PUBKEY_bio(out,dsa);
|
||||
else i=i2d_DSAPrivateKey_bio(out,dsa);
|
||||
} else if (outformat == FORMAT_PEM) {
|
||||
if(pubin || pubout)
|
||||
i=PEM_write_bio_DSA_PUBKEY(out,dsa);
|
||||
else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
|
||||
NULL,0,NULL, passout);
|
||||
} else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
}
|
||||
@@ -248,9 +280,11 @@ bad:
|
||||
else
|
||||
ret=0;
|
||||
end:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free(out);
|
||||
if (dsa != NULL) DSA_free(dsa);
|
||||
if(in != NULL) BIO_free(in);
|
||||
if(out != NULL) BIO_free(out);
|
||||
if(dsa != NULL) DSA_free(dsa);
|
||||
if(passin) Free(passin);
|
||||
if(passout) Free(passout);
|
||||
EXIT(ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
*/
|
||||
|
||||
#ifndef NO_DSA
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -65,7 +66,6 @@
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/dsa.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
@@ -73,7 +73,7 @@
|
||||
#undef PROG
|
||||
#define PROG dsaparam_main
|
||||
|
||||
/* -inform arg - input format - default PEM (one of DER, TXT or PEM)
|
||||
/* -inform arg - input format - default PEM (DER or PEM)
|
||||
* -outform arg - output format - default PEM
|
||||
* -in arg - input file - default stdin
|
||||
* -out arg - output file - default stdout
|
||||
@@ -84,7 +84,10 @@
|
||||
* -genkey
|
||||
*/
|
||||
|
||||
static void MS_CALLBACK dsa_cb(int p, int n, char *arg);
|
||||
static void MS_CALLBACK dsa_cb(int p, int n, void *arg);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
DSA *dsa=NULL;
|
||||
@@ -93,7 +96,7 @@ int MAIN(int argc, char **argv)
|
||||
int informat,outformat,noout=0,C=0,ret=1;
|
||||
char *infile,*outfile,*prog,*inrand=NULL;
|
||||
int numbits= -1,num,genkey=0;
|
||||
char buffer[200],*randfile=NULL;
|
||||
int need_rand=0;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -136,11 +139,15 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-C") == 0)
|
||||
C=1;
|
||||
else if (strcmp(*argv,"-genkey") == 0)
|
||||
{
|
||||
genkey=1;
|
||||
need_rand=1;
|
||||
}
|
||||
else if (strcmp(*argv,"-rand") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
inrand= *(++argv);
|
||||
need_rand=1;
|
||||
}
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
@@ -148,6 +155,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
/* generate a key */
|
||||
numbits=num;
|
||||
need_rand=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -164,11 +172,11 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] [bits] <infile >outfile\n",prog);
|
||||
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," -outform arg output format - one of DER TXT PEM\n");
|
||||
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||
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 check the DSA parameters\n");
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -C Output C code\n");
|
||||
BIO_printf(bio_err," -noout no output\n");
|
||||
BIO_printf(bio_err," -rand files to use for random number input\n");
|
||||
@@ -207,15 +215,20 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if (need_rand)
|
||||
{
|
||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
app_RAND_load_files(inrand));
|
||||
}
|
||||
|
||||
if (numbits > 0)
|
||||
{
|
||||
randfile=RAND_file_name(buffer,200);
|
||||
RAND_load_file(randfile,1024L*1024L);
|
||||
|
||||
assert(need_rand);
|
||||
BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num);
|
||||
BIO_printf(bio_err,"This could take some time\n");
|
||||
dsa=DSA_generate_parameters(num,NULL,0,NULL,NULL,
|
||||
dsa_cb,(char *)bio_err);
|
||||
dsa=DSA_generate_parameters(num,NULL,0,NULL,NULL, dsa_cb,bio_err);
|
||||
}
|
||||
else if (informat == FORMAT_ASN1)
|
||||
dsa=d2i_DSAparams_bio(in,NULL);
|
||||
@@ -307,7 +320,7 @@ bad:
|
||||
}
|
||||
if (!i)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to write DSA paramaters\n");
|
||||
BIO_printf(bio_err,"unable to write DSA parameters\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -316,6 +329,7 @@ bad:
|
||||
{
|
||||
DSA *dsakey;
|
||||
|
||||
assert(need_rand);
|
||||
if ((dsakey=DSAparams_dup(dsa)) == NULL) goto end;
|
||||
if (!DSA_generate_key(dsakey)) goto end;
|
||||
if (outformat == FORMAT_ASN1)
|
||||
@@ -328,6 +342,8 @@ bad:
|
||||
}
|
||||
DSA_free(dsakey);
|
||||
}
|
||||
if (need_rand)
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
ret=0;
|
||||
end:
|
||||
if (in != NULL) BIO_free(in);
|
||||
@@ -336,7 +352,7 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
|
||||
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
|
||||
{
|
||||
char c='*';
|
||||
|
||||
@@ -344,8 +360,8 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
|
||||
if (p == 1) c='+';
|
||||
if (p == 2) c='*';
|
||||
if (p == 3) c='\n';
|
||||
BIO_write((BIO *)arg,&c,1);
|
||||
(void)BIO_flush((BIO *)arg);
|
||||
BIO_write(arg,&c,1);
|
||||
(void)BIO_flush(arg);
|
||||
#ifdef LINT
|
||||
p=n;
|
||||
#endif
|
||||
|
||||
211
apps/enc.c
211
apps/enc.c
@@ -65,6 +65,7 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/rand.h>
|
||||
#ifndef NO_MD5
|
||||
#include <openssl/md5.h>
|
||||
#endif
|
||||
@@ -79,17 +80,22 @@ int set_hex(char *in,unsigned char *out,int size);
|
||||
#define BSIZE (8*1024)
|
||||
#define PROG enc_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
static const char magic[]="Salted__";
|
||||
char mbuf[8]; /* should be 1 smaller than magic */
|
||||
char *strbuf=NULL;
|
||||
unsigned char *buff=NULL,*bufsize=NULL;
|
||||
int bsize=BSIZE,verbose=0;
|
||||
int ret=1,inl;
|
||||
unsigned char key[24],iv[MD5_DIGEST_LENGTH];
|
||||
char *str=NULL;
|
||||
char *hkey=NULL,*hiv=NULL;
|
||||
unsigned char salt[PKCS5_SALT_LEN];
|
||||
char *str=NULL, *passarg = NULL, *pass = NULL;
|
||||
char *hkey=NULL,*hiv=NULL,*hsalt = NULL;
|
||||
int enc=1,printkey=0,i,base64=0;
|
||||
int debug=0,olb64=0;
|
||||
int debug=0,olb64=0,nosalt=0;
|
||||
const EVP_CIPHER *cipher=NULL,*c;
|
||||
char *inf=NULL,*outf=NULL;
|
||||
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
|
||||
@@ -130,14 +136,22 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outf= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-pass") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passarg= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-d") == 0)
|
||||
enc=0;
|
||||
else if (strcmp(*argv,"-p") == 0)
|
||||
printkey=1;
|
||||
else if (strcmp(*argv,"-v") == 0)
|
||||
verbose=1;
|
||||
else if ((strcmp(*argv,"-debug") == 0) ||
|
||||
(strcmp(*argv,"-d") == 0))
|
||||
else if (strcmp(*argv,"-salt") == 0)
|
||||
nosalt=0;
|
||||
else if (strcmp(*argv,"-nosalt") == 0)
|
||||
nosalt=1;
|
||||
else if (strcmp(*argv,"-debug") == 0)
|
||||
debug=1;
|
||||
else if (strcmp(*argv,"-P") == 0)
|
||||
printkey=2;
|
||||
@@ -194,6 +208,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
hkey= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-S") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
hsalt= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-iv") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -212,7 +231,8 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"options are\n");
|
||||
BIO_printf(bio_err,"%-14s input file\n","-in <file>");
|
||||
BIO_printf(bio_err,"%-14s output fileencrypt\n","-out <file>");
|
||||
BIO_printf(bio_err,"%-14s output file\n","-out <file>");
|
||||
BIO_printf(bio_err,"%-14s pass phrase source\n","-pass <arg>");
|
||||
BIO_printf(bio_err,"%-14s encrypt\n","-e");
|
||||
BIO_printf(bio_err,"%-14s decrypt\n","-d");
|
||||
BIO_printf(bio_err,"%-14s base64 encode/decode, depending on encryption flag\n","-a/-base64");
|
||||
@@ -233,7 +253,7 @@ bad:
|
||||
BIO_printf(bio_err,"rc2 :128 bit key RC2 encryption\n");
|
||||
#endif
|
||||
#ifndef NO_BF
|
||||
BIO_printf(bio_err,"bf :128 bit key BlowFish encryption\n");
|
||||
BIO_printf(bio_err,"bf :128 bit key Blowfish encryption\n");
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
BIO_printf(bio_err," -%-5s :128 bit key RC4 encryption\n",
|
||||
@@ -357,6 +377,14 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if(!str && passarg) {
|
||||
if(!app_passwd(bio_err, passarg, NULL, &pass, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
str = pass;
|
||||
}
|
||||
|
||||
if ((str == NULL) && (cipher != NULL) && (hkey == NULL))
|
||||
{
|
||||
for (;;)
|
||||
@@ -386,66 +414,6 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if (cipher != NULL)
|
||||
{
|
||||
if (str != NULL)
|
||||
{
|
||||
EVP_BytesToKey(cipher,EVP_md5(),NULL,
|
||||
(unsigned char *)str,
|
||||
strlen(str),1,key,iv);
|
||||
/* zero the complete buffer or the string
|
||||
* passed from the command line
|
||||
* bug picked up by
|
||||
* Larry J. Hughes Jr. <hughes@indiana.edu> */
|
||||
if (str == strbuf)
|
||||
memset(str,0,SIZE);
|
||||
else
|
||||
memset(str,0,strlen(str));
|
||||
}
|
||||
if ((hiv != NULL) && !set_hex(hiv,iv,8))
|
||||
{
|
||||
BIO_printf(bio_err,"invalid hex iv value\n");
|
||||
goto end;
|
||||
}
|
||||
if ((hkey != NULL) && !set_hex(hkey,key,24))
|
||||
{
|
||||
BIO_printf(bio_err,"invalid hex key value\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((benc=BIO_new(BIO_f_cipher())) == NULL)
|
||||
goto end;
|
||||
BIO_set_cipher(benc,cipher,key,iv,enc);
|
||||
if (debug)
|
||||
{
|
||||
BIO_set_callback(benc,BIO_debug_callback);
|
||||
BIO_set_callback_arg(benc,bio_err);
|
||||
}
|
||||
|
||||
if (printkey)
|
||||
{
|
||||
if (cipher->key_len > 0)
|
||||
{
|
||||
printf("key=");
|
||||
for (i=0; i<cipher->key_len; i++)
|
||||
printf("%02X",key[i]);
|
||||
printf("\n");
|
||||
}
|
||||
if (cipher->iv_len > 0)
|
||||
{
|
||||
printf("iv =");
|
||||
for (i=0; i<cipher->iv_len; i++)
|
||||
printf("%02X",iv[i]);
|
||||
printf("\n");
|
||||
}
|
||||
if (printkey == 2)
|
||||
{
|
||||
ret=0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (outf == NULL)
|
||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||
@@ -478,6 +446,113 @@ bad:
|
||||
rbio=BIO_push(b64,rbio);
|
||||
}
|
||||
|
||||
if (cipher != NULL)
|
||||
{
|
||||
if (str != NULL)
|
||||
{
|
||||
/* Salt handling: if encrypting generate a salt and
|
||||
* write to output BIO. If decrypting read salt from
|
||||
* input BIO.
|
||||
*/
|
||||
unsigned char *sptr;
|
||||
if(nosalt) sptr = NULL;
|
||||
else {
|
||||
if(enc) {
|
||||
if(hsalt) {
|
||||
if(!set_hex(hsalt,salt,PKCS5_SALT_LEN)) {
|
||||
BIO_printf(bio_err,
|
||||
"invalid hex salt value\n");
|
||||
goto end;
|
||||
}
|
||||
} else if (RAND_pseudo_bytes(salt, PKCS5_SALT_LEN) < 0)
|
||||
goto end;
|
||||
/* If -P option then don't bother writing */
|
||||
if((printkey != 2)
|
||||
&& (BIO_write(wbio,magic,
|
||||
sizeof magic-1) != sizeof magic-1
|
||||
|| BIO_write(wbio,
|
||||
(char *)salt,
|
||||
PKCS5_SALT_LEN) != PKCS5_SALT_LEN)) {
|
||||
BIO_printf(bio_err,"error writing output file\n");
|
||||
goto end;
|
||||
}
|
||||
} else if(BIO_read(rbio,mbuf,sizeof mbuf) != sizeof mbuf
|
||||
|| BIO_read(rbio,
|
||||
(unsigned char *)salt,
|
||||
PKCS5_SALT_LEN) != PKCS5_SALT_LEN) {
|
||||
BIO_printf(bio_err,"error reading input file\n");
|
||||
goto end;
|
||||
} else if(memcmp(mbuf,magic,sizeof magic-1)) {
|
||||
BIO_printf(bio_err,"bad magic number\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
sptr = salt;
|
||||
}
|
||||
|
||||
EVP_BytesToKey(cipher,EVP_md5(),sptr,
|
||||
(unsigned char *)str,
|
||||
strlen(str),1,key,iv);
|
||||
/* zero the complete buffer or the string
|
||||
* passed from the command line
|
||||
* bug picked up by
|
||||
* Larry J. Hughes Jr. <hughes@indiana.edu> */
|
||||
if (str == strbuf)
|
||||
memset(str,0,SIZE);
|
||||
else
|
||||
memset(str,0,strlen(str));
|
||||
}
|
||||
if ((hiv != NULL) && !set_hex(hiv,iv,8))
|
||||
{
|
||||
BIO_printf(bio_err,"invalid hex iv value\n");
|
||||
goto end;
|
||||
}
|
||||
if ((hkey != NULL) && !set_hex(hkey,key,24))
|
||||
{
|
||||
BIO_printf(bio_err,"invalid hex key value\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((benc=BIO_new(BIO_f_cipher())) == NULL)
|
||||
goto end;
|
||||
BIO_set_cipher(benc,cipher,key,iv,enc);
|
||||
if (debug)
|
||||
{
|
||||
BIO_set_callback(benc,BIO_debug_callback);
|
||||
BIO_set_callback_arg(benc,bio_err);
|
||||
}
|
||||
|
||||
if (printkey)
|
||||
{
|
||||
if (!nosalt)
|
||||
{
|
||||
printf("salt=");
|
||||
for (i=0; i<PKCS5_SALT_LEN; i++)
|
||||
printf("%02X",salt[i]);
|
||||
printf("\n");
|
||||
}
|
||||
if (cipher->key_len > 0)
|
||||
{
|
||||
printf("key=");
|
||||
for (i=0; i<cipher->key_len; i++)
|
||||
printf("%02X",key[i]);
|
||||
printf("\n");
|
||||
}
|
||||
if (cipher->iv_len > 0)
|
||||
{
|
||||
printf("iv =");
|
||||
for (i=0; i<cipher->iv_len; i++)
|
||||
printf("%02X",iv[i]);
|
||||
printf("\n");
|
||||
}
|
||||
if (printkey == 2)
|
||||
{
|
||||
ret=0;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Only encrypt/decrypt as we write the file */
|
||||
if (benc != NULL)
|
||||
wbio=BIO_push(benc,wbio);
|
||||
@@ -505,12 +580,14 @@ bad:
|
||||
BIO_printf(bio_err,"bytes written:%8ld\n",BIO_number_written(out));
|
||||
}
|
||||
end:
|
||||
ERR_print_errors(bio_err);
|
||||
if (strbuf != NULL) Free(strbuf);
|
||||
if (buff != NULL) Free(buff);
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free(out);
|
||||
if (benc != NULL) BIO_free(benc);
|
||||
if (b64 != NULL) BIO_free(b64);
|
||||
if(pass) Free(pass);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,8 @@
|
||||
#undef PROG
|
||||
#define PROG errstr_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,ret=0;
|
||||
|
||||
48
apps/gendh.c
48
apps/gendh.c
@@ -75,15 +75,16 @@
|
||||
#define PROG gendh_main
|
||||
|
||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg);
|
||||
static long dh_load_rand(char *names);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char buffer[200];
|
||||
DH *dh=NULL;
|
||||
int ret=1,num=DEFBITS;
|
||||
int g=2;
|
||||
char *outfile=NULL;
|
||||
char *inrand=NULL,*randfile;
|
||||
char *inrand=NULL;
|
||||
BIO *out=NULL;
|
||||
|
||||
apps_startup();
|
||||
@@ -150,17 +151,13 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
randfile=RAND_file_name(buffer,200);
|
||||
if ((randfile == NULL)|| !RAND_load_file(randfile,1024L*1024L))
|
||||
BIO_printf(bio_err,"unable to load 'random state'\n");
|
||||
|
||||
if (inrand == NULL)
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
else
|
||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
dh_load_rand(inrand));
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
}
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
app_RAND_load_files(inrand));
|
||||
|
||||
BIO_printf(bio_err,"Generating DH parameters, %d bit long strong prime, generator of %d\n",num,g);
|
||||
BIO_printf(bio_err,"This is going to take a long time\n");
|
||||
@@ -168,10 +165,7 @@ bad:
|
||||
|
||||
if (dh == NULL) goto end;
|
||||
|
||||
if (randfile == NULL)
|
||||
BIO_printf(bio_err,"unable to write 'random state'\n");
|
||||
else
|
||||
RAND_write_file(randfile);
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
|
||||
if (!PEM_write_bio_DHparams(out,dh))
|
||||
goto end;
|
||||
@@ -198,26 +192,4 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
||||
p=n;
|
||||
#endif
|
||||
}
|
||||
|
||||
static long dh_load_rand(char *name)
|
||||
{
|
||||
char *p,*n;
|
||||
int last;
|
||||
long tot=0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
last=0;
|
||||
for (p=name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
|
||||
if (*p == '\0') last=1;
|
||||
*p='\0';
|
||||
n=name;
|
||||
name=p+1;
|
||||
if (*n == '\0') break;
|
||||
|
||||
tot+=RAND_load_file(n,1);
|
||||
if (last) break;
|
||||
}
|
||||
return(tot);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dsa.h>
|
||||
@@ -74,14 +73,15 @@
|
||||
#undef PROG
|
||||
#define PROG gendsa_main
|
||||
|
||||
static long dsa_load_rand(char *names);
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char buffer[200];
|
||||
DSA *dsa=NULL;
|
||||
int ret=1;
|
||||
char *outfile=NULL;
|
||||
char *inrand=NULL,*randfile,*dsaparams=NULL;
|
||||
char *inrand=NULL,*dsaparams=NULL;
|
||||
char *passargout = NULL, *passout = NULL;
|
||||
BIO *out=NULL,*in=NULL;
|
||||
EVP_CIPHER *enc=NULL;
|
||||
|
||||
@@ -101,6 +101,11 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passout") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-rand") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -148,6 +153,12 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
if (!(BIO_read_filename(in,dsaparams)))
|
||||
{
|
||||
@@ -161,6 +172,7 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
BIO_free(in);
|
||||
in = NULL;
|
||||
|
||||
out=BIO_new(BIO_s_file());
|
||||
if (out == NULL) goto end;
|
||||
@@ -176,57 +188,30 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
randfile=RAND_file_name(buffer,200);
|
||||
if ((randfile == NULL)|| !RAND_load_file(randfile,1024L*1024L))
|
||||
BIO_printf(bio_err,"unable to load 'random state'\n");
|
||||
|
||||
if (inrand == NULL)
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
else
|
||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
dsa_load_rand(inrand));
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
}
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
app_RAND_load_files(inrand));
|
||||
|
||||
BIO_printf(bio_err,"Generating DSA key, %d bits\n",
|
||||
BN_num_bits(dsa->p));
|
||||
if (!DSA_generate_key(dsa)) goto end;
|
||||
|
||||
if (randfile == NULL)
|
||||
BIO_printf(bio_err,"unable to write 'random state'\n");
|
||||
else
|
||||
RAND_write_file(randfile);
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
|
||||
if (!PEM_write_bio_DSAPrivateKey(out,dsa,enc,NULL,0,NULL,NULL))
|
||||
if (!PEM_write_bio_DSAPrivateKey(out,dsa,enc,NULL,0,NULL, passout))
|
||||
goto end;
|
||||
ret=0;
|
||||
end:
|
||||
if (ret != 0)
|
||||
ERR_print_errors(bio_err);
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free(out);
|
||||
if (dsa != NULL) DSA_free(dsa);
|
||||
if(passout) Free(passout);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static long dsa_load_rand(char *name)
|
||||
{
|
||||
char *p,*n;
|
||||
int last;
|
||||
long tot=0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
last=0;
|
||||
for (p=name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
|
||||
if (*p == '\0') last=1;
|
||||
*p='\0';
|
||||
n=name;
|
||||
name=p+1;
|
||||
if (*n == '\0') break;
|
||||
|
||||
tot+=RAND_load_file(n,1);
|
||||
if (last) break;
|
||||
}
|
||||
return(tot);
|
||||
}
|
||||
#endif
|
||||
|
||||
104
apps/genrsa.c
104
apps/genrsa.c
@@ -63,7 +63,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/rsa.h>
|
||||
@@ -76,18 +75,20 @@
|
||||
#define PROG genrsa_main
|
||||
|
||||
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg);
|
||||
static long gr_load_rand(char *names);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
char buffer[200];
|
||||
RSA *rsa=NULL;
|
||||
int i,num=DEFBITS;
|
||||
long rnum=0,l;
|
||||
long l;
|
||||
EVP_CIPHER *enc=NULL;
|
||||
unsigned long f4=RSA_F4;
|
||||
char *outfile=NULL;
|
||||
char *inrand=NULL,*randfile;
|
||||
char *passargout = NULL, *passout = NULL;
|
||||
char *inrand=NULL;
|
||||
BIO *out=NULL;
|
||||
|
||||
apps_startup();
|
||||
@@ -97,7 +98,7 @@ int MAIN(int argc, char **argv)
|
||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
if ((out=BIO_new(BIO_s_file())) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to creat BIO for output\n");
|
||||
BIO_printf(bio_err,"unable to create BIO for output\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -130,6 +131,11 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv,"-idea") == 0)
|
||||
enc=EVP_idea_cbc();
|
||||
#endif
|
||||
else if (strcmp(*argv,"-passout") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else
|
||||
break;
|
||||
argv++;
|
||||
@@ -139,21 +145,28 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
bad:
|
||||
BIO_printf(bio_err,"usage: genrsa [args] [numbits]\n");
|
||||
BIO_printf(bio_err," -des - encrypt the generated key with DES in cbc mode\n");
|
||||
BIO_printf(bio_err," -des3 - encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
||||
BIO_printf(bio_err," -des encrypt the generated key with DES in cbc mode\n");
|
||||
BIO_printf(bio_err," -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
||||
#ifndef NO_IDEA
|
||||
BIO_printf(bio_err," -idea - encrypt the generated key with IDEA in cbc mode\n");
|
||||
BIO_printf(bio_err," -idea encrypt the generated key with IDEA in cbc mode\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -out file - output the key to 'file\n");
|
||||
BIO_printf(bio_err," -f4 - use F4 (0x10001) for the E value\n");
|
||||
BIO_printf(bio_err," -3 - use 3 for the E value\n");
|
||||
BIO_printf(bio_err," -out file output the key to 'file\n");
|
||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
|
||||
BIO_printf(bio_err," -3 use 3 for the E value\n");
|
||||
BIO_printf(bio_err," -rand file:file:...\n");
|
||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
BIO_printf(bio_err," load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err," the random number generator\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (outfile == NULL)
|
||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||
else
|
||||
@@ -165,45 +178,23 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WINDOWS
|
||||
BIO_printf(bio_err,"Loading 'screen' into random state -");
|
||||
BIO_flush(bio_err);
|
||||
RAND_screen();
|
||||
BIO_printf(bio_err," done\n");
|
||||
#endif
|
||||
randfile=RAND_file_name(buffer,200);
|
||||
if ((randfile == NULL) ||
|
||||
!(rnum=(long)RAND_load_file(randfile,1024L*1024L)))
|
||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load 'random state'\n");
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
}
|
||||
|
||||
if (inrand == NULL)
|
||||
{
|
||||
if (rnum == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rnum+=gr_load_rand(inrand);
|
||||
}
|
||||
if (rnum != 0)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",rnum);
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
app_RAND_load_files(inrand));
|
||||
|
||||
BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
|
||||
num);
|
||||
rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err);
|
||||
|
||||
if (randfile == NULL)
|
||||
BIO_printf(bio_err,"unable to write 'random state'\n");
|
||||
else
|
||||
RAND_write_file(randfile);
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
|
||||
if (rsa == NULL) goto err;
|
||||
|
||||
/* We need to do the folloing for when the base number size is <
|
||||
/* We need to do the following for when the base number size is <
|
||||
* long, esp windows 3.1 :-(. */
|
||||
l=0L;
|
||||
for (i=0; i<rsa->e->top; i++)
|
||||
@@ -215,13 +206,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,NULL))
|
||||
if (!PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,NULL, passout))
|
||||
goto err;
|
||||
|
||||
ret=0;
|
||||
err:
|
||||
if (rsa != NULL) RSA_free(rsa);
|
||||
if (out != NULL) BIO_free(out);
|
||||
if(passout) Free(passout);
|
||||
if (ret != 0)
|
||||
ERR_print_errors(bio_err);
|
||||
EXIT(ret);
|
||||
@@ -241,26 +233,10 @@ static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
|
||||
p=n;
|
||||
#endif
|
||||
}
|
||||
#else /* !NO_RSA */
|
||||
|
||||
static long gr_load_rand(char *name)
|
||||
{
|
||||
char *p,*n;
|
||||
int last;
|
||||
long tot=0;
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
for (;;)
|
||||
{
|
||||
last=0;
|
||||
for (p=name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
|
||||
if (*p == '\0') last=1;
|
||||
*p='\0';
|
||||
n=name;
|
||||
name=p+1;
|
||||
if (*n == '\0') break;
|
||||
|
||||
tot+=RAND_load_file(n,1024L*1024L);
|
||||
if (last) break;
|
||||
}
|
||||
return(tot);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ $!
|
||||
$! Define what programs should be compiled
|
||||
$!
|
||||
$ PROGRAMS := OPENSSL
|
||||
$!$ PROGRAMS := VERIFY,ASN1PARS,REQ,DGST,DH,ENC,GENDH,ERRSTR,CA,CRL,-
|
||||
$!$ PROGRAMS := VERIFY,ASN1PARS,REQ,DGST,DH,ENC,PASSWD,GENDH,ERRSTR,CA,CRL,-
|
||||
$! RSA,DSA,DSAPARAM,-
|
||||
$! X509,GENRSA,GENDSA,S_SERVER,S_CLIENT,SPEED,-
|
||||
$! S_TIME,VERSION,PKCS7,CRL2P7,SESS_ID,CIPHERS,NSEQ,
|
||||
@@ -152,20 +152,18 @@ $ GOSUB CHECK_OPT_FILE
|
||||
$!
|
||||
$! Define The Application Files.
|
||||
$!
|
||||
$ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;ENC;GENDH;"+-
|
||||
"ERRSTR;CA;"+-
|
||||
"PKCS7;CRL2P7;CRL;"+-
|
||||
$ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;DHPARAM;ENC;PASSWD;GENDH;ERRSTR;"+-
|
||||
"CA;PKCS7;CRL2P7;CRL;"+-
|
||||
"RSA;DSA;DSAPARAM;"+-
|
||||
"X509;GENRSA;GENDSA;S_SERVER;S_CLIENT;SPEED;"+-
|
||||
"S_TIME;APPS;S_CB;S_SOCKET;VERSION;SESS_ID;"+-
|
||||
"CIPHERS;NSEQ;PKCS12;PKCS8"
|
||||
$ APP_FILES := OPENSSL,'OBJ_DIR'VERIFY.OBJ,ASN1PARS.OBJ,REQ.OBJ,DGST.OBJ,DH.OBJ,ENC.OBJ,GENDH.OBJ,-
|
||||
ERRSTR.OBJ,CA.OBJ,-
|
||||
PKCS7.OBJ,CRL2P7.OBJ,CRL.OBJ,-
|
||||
"S_TIME;APPS;S_CB;S_SOCKET;APP_RAND;VERSION;SESS_ID;"+-
|
||||
"CIPHERS;NSEQ;PKCS12;PKCS8;SPKAC;SMIME"
|
||||
$ APP_FILES := OPENSSL,'OBJ_DIR'VERIFY.OBJ,ASN1PARS.OBJ,REQ.OBJ,DGST.OBJ,DH.OBJ,DHPARAM.OBJ,ENC.OBJ,PASSWD.OBJ,GENDH.OBJ,ERRSTR.OBJ,-
|
||||
CA.OBJ,PKCS7.OBJ,CRL2P7.OBJ,CRL.OBJ,-
|
||||
RSA.OBJ,DSA.OBJ,DSAPARAM.OBJ,-
|
||||
X509.OBJ,GENRSA.OBJ,GENDSA.OBJ,S_SERVER.OBJ,S_CLIENT.OBJ,SPEED.OBJ,-
|
||||
S_TIME.OBJ,APPS.OBJ,S_CB.OBJ,S_SOCKET.OBJ,VERSION.OBJ,SESS_ID.OBJ,-
|
||||
CIPHERS.OBJ,NSEQ.OBJ,PKCS12.OBJ,PKCS8.OBJ
|
||||
S_TIME.OBJ,APPS.OBJ,S_CB.OBJ,S_SOCKET.OBJ,APP_RAND.OBJ,VERSION.OBJ,SESS_ID.OBJ,-
|
||||
CIPHERS.OBJ,NSEQ.OBJ,PKCS12.OBJ,PKCS8.OBJ,SPKAC.OBJ,SMIME.OBJ
|
||||
$ TCPIP_PROGRAMS = ",,"
|
||||
$ IF COMPILER .EQS. "VAXC" THEN -
|
||||
TCPIP_PROGRAMS = ",OPENSSL,"
|
||||
@@ -808,12 +806,36 @@ $!
|
||||
$! Set Up Initial CC Definitions, Possibly With User Ones
|
||||
$!
|
||||
$ CCDEFS = "VMS=1,MONOLITH"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_ASM") THEN CCDEFS = CCDEFS + ",NO_ASM"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_RSA") THEN CCDEFS = CCDEFS + ",NO_RSA"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_DSA") THEN CCDEFS = CCDEFS + ",NO_DSA"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_DH") THEN CCDEFS = CCDEFS + ",NO_DH"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_MD2") THEN CCDEFS = CCDEFS + ",NO_MD2"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_MD5") THEN CCDEFS = CCDEFS + ",NO_MD5"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_RIPEMD") THEN CCDEFS = CCDEFS + ",NO_RIPEMD"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_SHA") THEN CCDEFS = CCDEFS + ",NO_SHA"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_SHA0") THEN CCDEFS = CCDEFS + ",NO_SHA0"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_SHA1") THEN CCDEFS = CCDEFS + ",NO_SHA1"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_DES")
|
||||
$ THEN
|
||||
$ CCDEFS = CCDEFS + ",NO_DES,NO_MDC2"
|
||||
$ ELSE
|
||||
$ IF F$TRNLNM("OPENSSL_NO_MDC2") THEN CCDEFS = CCDEFS + ",NO_MDC2"
|
||||
$ ENDIF
|
||||
$ IF F$TRNLNM("OPENSSL_NO_RC2") THEN CCDEFS = CCDEFS + ",NO_RC2"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_RC4") THEN CCDEFS = CCDEFS + ",NO_RC4"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_RC5") THEN CCDEFS = CCDEFS + ",NO_RC5"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_IDEA") THEN CCDEFS = CCDEFS + ",NO_IDEA"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_BF") THEN CCDEFS = CCDEFS + ",NO_BF"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_CAST") THEN CCDEFS = CCDEFS + ",NO_CAST"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_HMAC") THEN CCDEFS = CCDEFS + ",NO_HMAC"
|
||||
$ IF F$TRNLNM("OPENSSL_NO_SSL2") THEN CCDEFS = CCDEFS + ",NO_SSL2"
|
||||
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
|
||||
$ CCEXTRAFLAGS = ""
|
||||
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
||||
$ CCDISABLEWARNINGS = ""
|
||||
$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX"
|
||||
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
|
||||
CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS
|
||||
CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS
|
||||
$!
|
||||
$! Check To See If The User Entered A Valid Paramter.
|
||||
$!
|
||||
|
||||
16
apps/nseq.c
16
apps/nseq.c
@@ -65,7 +65,7 @@
|
||||
#undef PROG
|
||||
#define PROG nseq_main
|
||||
|
||||
static int dump_cert_text(BIO *out, X509 *x);
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
@@ -158,17 +158,3 @@ end:
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static int dump_cert_text(BIO *out, X509 *x)
|
||||
{
|
||||
char buf[256];
|
||||
X509_NAME_oneline(X509_get_subject_name(x),buf,256);
|
||||
BIO_puts(out,"subject=");
|
||||
BIO_puts(out,buf);
|
||||
|
||||
X509_NAME_oneline(X509_get_issuer_name(x),buf,256);
|
||||
BIO_puts(out,"\nissuer= ");
|
||||
BIO_puts(out,buf);
|
||||
BIO_puts(out,"\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,19 @@ distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
|
||||
# This sets the permitted types in a DirectoryString. There are several
|
||||
# options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString.
|
||||
# utf8only: only UTF8Strings.
|
||||
# nobmp : PrintableString, T61String (no BMPStrings).
|
||||
# MASK:XXXX a literal mask value.
|
||||
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
|
||||
# so use this option with caution!
|
||||
dirstring_type = nobmp
|
||||
|
||||
# req_extensions = v3_req # The extensions to add to a certificate request
|
||||
|
||||
[ req_distinguished_name ]
|
||||
countryName = Country Name (2 letter code)
|
||||
countryName_default = AU
|
||||
@@ -170,7 +183,15 @@ authorityKeyIdentifier=keyid,issuer:always
|
||||
#nsCaPolicyUrl
|
||||
#nsSslServerName
|
||||
|
||||
[ v3_ca]
|
||||
[ v3_req ]
|
||||
|
||||
# Extensions to add to a certificate request
|
||||
|
||||
basicConstraints = CA:FALSE
|
||||
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
|
||||
[ v3_ca ]
|
||||
|
||||
|
||||
# Extensions for a typical CA
|
||||
|
||||
@@ -200,10 +221,11 @@ basicConstraints = CA:true
|
||||
# Copy issuer details
|
||||
# issuerAltName=issuer:copy
|
||||
|
||||
# RAW DER hex encoding of an extension: beware experts only!
|
||||
# 1.2.3.5=RAW:02:03
|
||||
# DER hex encoding of an extension: beware experts only!
|
||||
# obj=DER:02:03
|
||||
# Where 'obj' is a standard or added object
|
||||
# You can even override a supported extension:
|
||||
# basicConstraints= critical, RAW:30:03:01:01:FF
|
||||
# basicConstraints= critical, DER:30:03:01:01:FF
|
||||
|
||||
[ crl_ext ]
|
||||
|
||||
|
||||
@@ -70,10 +70,10 @@
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/ssl.h>
|
||||
#define SSLEAY /* turn off a few special case MONOLITH macros */
|
||||
#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
|
||||
#define SSLEAY_SRC
|
||||
#define OPENSSL_C /* tells apps.h to use complete apps_startup() */
|
||||
#include "apps.h"
|
||||
#include "progs.h"
|
||||
#include "s_apps.h"
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -120,9 +120,6 @@ int main(int Argc, char *Argv[])
|
||||
arg.data=NULL;
|
||||
arg.count=0;
|
||||
|
||||
/* SSLeay_add_ssl_algorithms(); is called in apps_startup() */
|
||||
apps_startup();
|
||||
|
||||
#if defined(DEBUG) && !defined(WINDOWS) && !defined(MSDOS)
|
||||
#ifdef SIGBUS
|
||||
signal(SIGBUS,sig_stop);
|
||||
@@ -132,12 +129,14 @@ int main(int Argc, char *Argv[])
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
||||
|
||||
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);
|
||||
|
||||
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
/* Lets load up our environment a little */
|
||||
@@ -165,7 +164,7 @@ int main(int Argc, char *Argv[])
|
||||
program_name(Argv[0],pname,PROG_NAME_SIZE);
|
||||
|
||||
f.name=pname;
|
||||
fp=(FUNCTION *)lh_retrieve(prog,(char *)&f);
|
||||
fp=(FUNCTION *)lh_retrieve(prog,&f);
|
||||
if (fp != NULL)
|
||||
{
|
||||
Argv[0]=pname;
|
||||
@@ -236,6 +235,12 @@ end:
|
||||
EVP_cleanup();
|
||||
ERR_free_strings();
|
||||
|
||||
#ifdef LEVITTE_DEBUG
|
||||
CRYPTO_push_info("Just to make sure I get a memory leak I can see :-)");
|
||||
(void)Malloc(1024);
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
|
||||
CRYPTO_mem_leaks(bio_err);
|
||||
if (bio_err != NULL)
|
||||
{
|
||||
@@ -257,7 +262,7 @@ static int do_cmd(LHASH *prog, int argc, char *argv[])
|
||||
if ((argc <= 0) || (argv[0] == NULL))
|
||||
{ ret=0; goto end; }
|
||||
f.name=argv[0];
|
||||
fp=(FUNCTION *)lh_retrieve(prog,(char *)&f);
|
||||
fp=(FUNCTION *)lh_retrieve(prog,&f);
|
||||
if (fp != NULL)
|
||||
{
|
||||
ret=fp->func(argc,argv);
|
||||
@@ -356,7 +361,7 @@ static LHASH *prog_init(void)
|
||||
if ((ret=lh_new(hash,cmp)) == NULL) return(NULL);
|
||||
|
||||
for (f=functions; f->name != NULL; f++)
|
||||
lh_insert(ret,(char *)f);
|
||||
lh_insert(ret,f);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -369,5 +374,3 @@ static unsigned long MS_CALLBACK hash(FUNCTION *a)
|
||||
{
|
||||
return(lh_strhash(a->name));
|
||||
}
|
||||
|
||||
#undef SSLEAY
|
||||
|
||||
@@ -3,8 +3,13 @@
|
||||
# This is mostly being used for generation of certificate requests.
|
||||
#
|
||||
|
||||
# This definition stops the following lines choking if HOME isn't
|
||||
# defined.
|
||||
HOME = .
|
||||
RANDFILE = $ENV::HOME/.rnd
|
||||
oid_file = $ENV::HOME/.oid
|
||||
|
||||
# Extra OBJECT IDENTIFIER info:
|
||||
#oid_file = $ENV::HOME/.oid
|
||||
oid_section = new_oids
|
||||
|
||||
# To use this configuration file with the "-extfile" option of the
|
||||
@@ -86,6 +91,22 @@ distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
|
||||
# Passwords for private keys if not present they will be prompted for
|
||||
# input_password = secret
|
||||
# output_password = secret
|
||||
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString.
|
||||
# utf8only: only UTF8Strings.
|
||||
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
|
||||
# MASK:XXXX a literal mask value.
|
||||
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
|
||||
# so use this option with caution!
|
||||
string_mask = nombstr
|
||||
|
||||
# req_extensions = v3_req # The extensions to add to a certificate request
|
||||
|
||||
[ req_distinguished_name ]
|
||||
countryName = Country Name (2 letter code)
|
||||
countryName_default = AU
|
||||
@@ -170,8 +191,16 @@ authorityKeyIdentifier=keyid,issuer:always
|
||||
#nsCaPolicyUrl
|
||||
#nsSslServerName
|
||||
|
||||
[ v3_req ]
|
||||
|
||||
# Extensions to add to a certificate request
|
||||
|
||||
basicConstraints = CA:FALSE
|
||||
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
|
||||
[ v3_ca ]
|
||||
|
||||
|
||||
# Extensions for a typical CA
|
||||
|
||||
|
||||
@@ -200,10 +229,11 @@ basicConstraints = CA:true
|
||||
# Copy issuer details
|
||||
# issuerAltName=issuer:copy
|
||||
|
||||
# RAW DER hex encoding of an extension: beware experts only!
|
||||
# 1.2.3.5=RAW:02:03
|
||||
# DER hex encoding of an extension: beware experts only!
|
||||
# obj=DER:02:03
|
||||
# Where 'obj' is a standard or added object
|
||||
# You can even override a supported extension:
|
||||
# basicConstraints= critical, RAW:30:03:01:01:FF
|
||||
# basicConstraints= critical, DER:30:03:01:01:FF
|
||||
|
||||
[ crl_ext ]
|
||||
|
||||
|
||||
475
apps/passwd.c
Normal file
475
apps/passwd.c
Normal file
@@ -0,0 +1,475 @@
|
||||
/* apps/passwd.c */
|
||||
|
||||
#if defined NO_MD5 || defined CHARSET_EBCDIC
|
||||
# define NO_APR1
|
||||
#endif
|
||||
|
||||
#if !defined(NO_DES) || !defined(NO_APR1)
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "apps.h"
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#ifndef NO_DES
|
||||
# include <openssl/des.h>
|
||||
#endif
|
||||
#ifndef NO_APR1
|
||||
# include <openssl/md5.h>
|
||||
#endif
|
||||
|
||||
|
||||
#undef PROG
|
||||
#define PROG passwd_main
|
||||
|
||||
|
||||
static unsigned const char cov_2char[64]={
|
||||
/* from crypto/des/fcrypt.c */
|
||||
0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
|
||||
0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,
|
||||
0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,
|
||||
0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,
|
||||
0x55,0x56,0x57,0x58,0x59,0x5A,0x61,0x62,
|
||||
0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,
|
||||
0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,
|
||||
0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A
|
||||
};
|
||||
|
||||
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
||||
char *passwd, BIO *out, int quiet, int table, int reverse,
|
||||
size_t pw_maxlen, int usecrypt, int useapr1);
|
||||
|
||||
/* -crypt - standard Unix password algorithm (default, only choice)
|
||||
* -apr1 - MD5-based password algorithm
|
||||
* -salt string - salt
|
||||
* -in file - read passwords from file
|
||||
* -stdin - read passwords from stdin
|
||||
* -quiet - no warnings
|
||||
* -table - format output as table
|
||||
* -reverse - switch table columns
|
||||
*/
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret = 1;
|
||||
char *infile = NULL;
|
||||
int in_stdin = 0;
|
||||
char *salt = NULL, *passwd = NULL, **passwds = NULL;
|
||||
char *salt_malloc = NULL, *passwd_malloc = NULL;
|
||||
int pw_source_defined = 0;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
int i, badopt, opt_done;
|
||||
int passed_salt = 0, quiet = 0, table = 0, reverse = 0;
|
||||
int usecrypt = 0, useapr1 = 0;
|
||||
size_t pw_maxlen = 0;
|
||||
|
||||
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);
|
||||
out = BIO_new(BIO_s_file());
|
||||
if (out == NULL)
|
||||
goto err;
|
||||
BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
||||
|
||||
badopt = 0, opt_done = 0;
|
||||
i = 0;
|
||||
while (!badopt && !opt_done && argv[++i] != NULL)
|
||||
{
|
||||
if (strcmp(argv[i], "-crypt") == 0)
|
||||
usecrypt = 1;
|
||||
else if (strcmp(argv[i], "-apr1") == 0)
|
||||
useapr1 = 1;
|
||||
else if (strcmp(argv[i], "-salt") == 0)
|
||||
{
|
||||
if ((argv[i+1] != NULL) && (salt == NULL))
|
||||
{
|
||||
passed_salt = 1;
|
||||
salt = argv[++i];
|
||||
}
|
||||
else
|
||||
badopt = 1;
|
||||
}
|
||||
else if (strcmp(argv[i], "-in") == 0)
|
||||
{
|
||||
if ((argv[i+1] != NULL) && !pw_source_defined)
|
||||
{
|
||||
pw_source_defined = 1;
|
||||
infile = argv[++i];
|
||||
}
|
||||
else
|
||||
badopt = 1;
|
||||
}
|
||||
else if (strcmp(argv[i], "-stdin") == 0)
|
||||
{
|
||||
if (!pw_source_defined)
|
||||
{
|
||||
pw_source_defined = 1;
|
||||
in_stdin = 1;
|
||||
}
|
||||
else
|
||||
badopt = 1;
|
||||
}
|
||||
else if (strcmp(argv[i], "-quiet") == 0)
|
||||
quiet = 1;
|
||||
else if (strcmp(argv[i], "-table") == 0)
|
||||
table = 1;
|
||||
else if (strcmp(argv[i], "-reverse") == 0)
|
||||
reverse = 1;
|
||||
else if (argv[i][0] == '-')
|
||||
badopt = 1;
|
||||
else if (!pw_source_defined)
|
||||
/* non-option arguments, use as passwords */
|
||||
{
|
||||
pw_source_defined = 1;
|
||||
passwds = &argv[i];
|
||||
opt_done = 1;
|
||||
}
|
||||
else
|
||||
badopt = 1;
|
||||
}
|
||||
|
||||
if (!usecrypt && !useapr1) /* use default */
|
||||
usecrypt = 1;
|
||||
if (usecrypt + useapr1 > 1) /* conflict */
|
||||
badopt = 1;
|
||||
|
||||
/* reject unsupported algorithms */
|
||||
#ifdef NO_DES
|
||||
if (usecrypt) badopt = 1;
|
||||
#endif
|
||||
#ifdef NO_APR1
|
||||
if (useapr1) badopt = 1;
|
||||
#endif
|
||||
|
||||
if (badopt)
|
||||
{
|
||||
BIO_printf(bio_err, "Usage: passwd [options] [passwords]\n");
|
||||
BIO_printf(bio_err, "where options are\n");
|
||||
#ifndef NO_DES
|
||||
BIO_printf(bio_err, "-crypt standard Unix password algorithm (default)\n");
|
||||
#endif
|
||||
#ifndef NO_APR1
|
||||
BIO_printf(bio_err, "-apr1 MD5-based password algorithm\n");
|
||||
#endif
|
||||
BIO_printf(bio_err, "-salt string use provided salt\n");
|
||||
BIO_printf(bio_err, "-in file read passwords from file\n");
|
||||
BIO_printf(bio_err, "-stdin read passwords from stdin\n");
|
||||
BIO_printf(bio_err, "-quiet no warnings\n");
|
||||
BIO_printf(bio_err, "-table format output as table\n");
|
||||
BIO_printf(bio_err, "-reverse switch table columns\n");
|
||||
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((infile != NULL) || in_stdin)
|
||||
{
|
||||
in = BIO_new(BIO_s_file());
|
||||
if (in == NULL)
|
||||
goto err;
|
||||
if (infile != NULL)
|
||||
{
|
||||
assert(in_stdin == 0);
|
||||
if (BIO_read_filename(in, infile) <= 0)
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(in_stdin);
|
||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (usecrypt)
|
||||
pw_maxlen = 8;
|
||||
else if (useapr1)
|
||||
pw_maxlen = 256; /* arbitrary limit, should be enough for most passwords */
|
||||
|
||||
if (passwds == NULL)
|
||||
{
|
||||
/* no passwords on the command line */
|
||||
passwd = passwd_malloc = Malloc(pw_maxlen + 1);
|
||||
if (passwd_malloc == NULL)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((in == NULL) && (passwds == NULL))
|
||||
{
|
||||
/* build a null-terminated list */
|
||||
static char *passwds_static[2] = {NULL, NULL};
|
||||
|
||||
passwds = passwds_static;
|
||||
if (in == NULL)
|
||||
if (EVP_read_pw_string(passwd_malloc, pw_maxlen + 1, "Password: ", 0) != 0)
|
||||
goto err;
|
||||
passwds[0] = passwd_malloc;
|
||||
}
|
||||
|
||||
if (in == NULL)
|
||||
{
|
||||
assert(passwds != NULL);
|
||||
assert(*passwds != NULL);
|
||||
|
||||
do /* loop over list of passwords */
|
||||
{
|
||||
passwd = *passwds++;
|
||||
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
||||
quiet, table, reverse, pw_maxlen, usecrypt, useapr1))
|
||||
goto err;
|
||||
}
|
||||
while (*passwds != NULL);
|
||||
}
|
||||
else
|
||||
/* in != NULL */
|
||||
{
|
||||
int done;
|
||||
|
||||
assert (passwd != NULL);
|
||||
do
|
||||
{
|
||||
int r = BIO_gets(in, passwd, pw_maxlen + 1);
|
||||
if (r > 0)
|
||||
{
|
||||
char *c = (strchr(passwd, '\n')) ;
|
||||
if (c != NULL)
|
||||
*c = 0; /* truncate at newline */
|
||||
else
|
||||
{
|
||||
/* ignore rest of line */
|
||||
char trash[BUFSIZ];
|
||||
do
|
||||
r = BIO_gets(in, trash, sizeof trash);
|
||||
while ((r > 0) && (!strchr(trash, '\n')));
|
||||
}
|
||||
|
||||
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
||||
quiet, table, reverse, pw_maxlen, usecrypt, useapr1))
|
||||
goto err;
|
||||
}
|
||||
done = (r <= 0);
|
||||
}
|
||||
while (!done);
|
||||
}
|
||||
|
||||
err:
|
||||
ERR_print_errors(bio_err);
|
||||
if (salt_malloc)
|
||||
Free(salt_malloc);
|
||||
if (passwd_malloc)
|
||||
Free(passwd_malloc);
|
||||
if (in)
|
||||
BIO_free(in);
|
||||
if (out)
|
||||
BIO_free(out);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_APR1
|
||||
/* MD5-based password algorithm compatible to the one found in Apache
|
||||
* (should probably be available as a library function;
|
||||
* then the static buffer would not be acceptable) */
|
||||
static char *apr1_crypt(const char *passwd, const char *salt)
|
||||
{
|
||||
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
|
||||
unsigned char buf[MD5_DIGEST_LENGTH];
|
||||
char *salt_out;
|
||||
int n, i;
|
||||
MD5_CTX md;
|
||||
size_t passwd_len, salt_len;
|
||||
|
||||
passwd_len = strlen(passwd);
|
||||
strcpy(out_buf, "$apr1$");
|
||||
strncat(out_buf, salt, 8);
|
||||
assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */
|
||||
salt_out = out_buf + 6;
|
||||
salt_len = strlen(salt_out);
|
||||
assert(salt_len <= 8);
|
||||
|
||||
MD5_Init(&md);
|
||||
MD5_Update(&md, passwd, passwd_len);
|
||||
MD5_Update(&md, "$apr1$", 6);
|
||||
MD5_Update(&md, salt_out, salt_len);
|
||||
|
||||
{
|
||||
MD5_CTX md2;
|
||||
|
||||
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);
|
||||
|
||||
n = passwd_len;
|
||||
while (n)
|
||||
{
|
||||
MD5_Update(&md, (n & 1) ? "\0" : passwd, 1);
|
||||
n >>= 1;
|
||||
}
|
||||
MD5_Final(buf, &md);
|
||||
|
||||
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);
|
||||
if (i % 3)
|
||||
MD5_Update(&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);
|
||||
}
|
||||
|
||||
{
|
||||
/* transform buf into output string */
|
||||
|
||||
unsigned char buf_perm[sizeof buf];
|
||||
int dest, source;
|
||||
char *output;
|
||||
|
||||
/* silly output permutation */
|
||||
for (dest = 0, source = 0; dest < 14; dest++, source = (source + 6) % 17)
|
||||
buf_perm[dest] = buf[source];
|
||||
buf_perm[14] = buf[5];
|
||||
buf_perm[15] = buf[11];
|
||||
#ifndef PEDANTIC /* Unfortunately, this generates a "no effect" warning */
|
||||
assert(16 == sizeof buf_perm);
|
||||
#endif
|
||||
|
||||
output = salt_out + salt_len;
|
||||
assert(output == out_buf + strlen(out_buf));
|
||||
|
||||
*output++ = '$';
|
||||
|
||||
for (i = 0; i < 15; i += 3)
|
||||
{
|
||||
*output++ = cov_2char[buf_perm[i+2] & 0x3f];
|
||||
*output++ = cov_2char[((buf_perm[i+1] & 0xf) << 2) |
|
||||
(buf_perm[i+2] >> 6)];
|
||||
*output++ = cov_2char[((buf_perm[i] & 3) << 4) |
|
||||
(buf_perm[i+1] >> 4)];
|
||||
*output++ = cov_2char[buf_perm[i] >> 2];
|
||||
}
|
||||
assert(i == 15);
|
||||
*output++ = cov_2char[buf_perm[i] & 0x3f];
|
||||
*output++ = cov_2char[buf_perm[i] >> 6];
|
||||
*output = 0;
|
||||
assert(strlen(out_buf) < sizeof(out_buf));
|
||||
}
|
||||
|
||||
return out_buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
||||
char *passwd, BIO *out, int quiet, int table, int reverse,
|
||||
size_t pw_maxlen, int usecrypt, int useapr1)
|
||||
{
|
||||
char *hash = NULL;
|
||||
|
||||
assert(salt_p != NULL);
|
||||
assert(salt_malloc_p != NULL);
|
||||
|
||||
/* first make sure we have a salt */
|
||||
if (!passed_salt)
|
||||
{
|
||||
#ifndef NO_DES
|
||||
if (usecrypt)
|
||||
{
|
||||
if (*salt_malloc_p == NULL)
|
||||
{
|
||||
*salt_p = *salt_malloc_p = Malloc(3);
|
||||
if (*salt_malloc_p == NULL)
|
||||
goto err;
|
||||
}
|
||||
if (RAND_pseudo_bytes((unsigned char *)*salt_p, 2) < 0)
|
||||
goto err;
|
||||
(*salt_p)[0] = cov_2char[(*salt_p)[0] & 0x3f]; /* 6 bits */
|
||||
(*salt_p)[1] = cov_2char[(*salt_p)[1] & 0x3f]; /* 6 bits */
|
||||
(*salt_p)[2] = 0;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ascii2ebcdic(*salt_p, *salt_p, 2); /* des_crypt will convert
|
||||
* back to ASCII */
|
||||
#endif
|
||||
}
|
||||
#endif /* !NO_DES */
|
||||
|
||||
#ifndef NO_APR1
|
||||
if (useapr1)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (*salt_malloc_p == NULL)
|
||||
{
|
||||
*salt_p = *salt_malloc_p = Malloc(9);
|
||||
if (*salt_malloc_p == NULL)
|
||||
goto err;
|
||||
}
|
||||
if (RAND_pseudo_bytes((unsigned char *)*salt_p, 8) < 0)
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
(*salt_p)[i] = cov_2char[(*salt_p)[i] & 0x3f]; /* 6 bits */
|
||||
(*salt_p)[8] = 0;
|
||||
}
|
||||
#endif /* !NO_APR1 */
|
||||
}
|
||||
|
||||
assert(*salt_p != NULL);
|
||||
|
||||
/* truncate password if necessary */
|
||||
if ((strlen(passwd) > pw_maxlen))
|
||||
{
|
||||
if (!quiet)
|
||||
BIO_printf(bio_err, "Warning: truncating password to %u characters\n", pw_maxlen);
|
||||
passwd[pw_maxlen] = 0;
|
||||
}
|
||||
assert(strlen(passwd) <= pw_maxlen);
|
||||
|
||||
/* now compute password hash */
|
||||
#ifndef NO_DES
|
||||
if (usecrypt)
|
||||
hash = des_crypt(passwd, *salt_p);
|
||||
#endif
|
||||
#ifndef NO_APR1
|
||||
if (useapr1)
|
||||
hash = apr1_crypt(passwd, *salt_p);
|
||||
#endif
|
||||
assert(hash != NULL);
|
||||
|
||||
if (table && !reverse)
|
||||
BIO_printf(out, "%s\t%s\n", passwd, hash);
|
||||
else if (table && reverse)
|
||||
BIO_printf(out, "%s\t%s\n", hash, passwd);
|
||||
else
|
||||
BIO_printf(out, "%s\n", hash);
|
||||
return 1;
|
||||
|
||||
err:
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
fputs("Program not available.\n", stderr)
|
||||
EXIT(1);
|
||||
}
|
||||
#endif
|
||||
211
apps/pkcs12.c
211
apps/pkcs12.c
@@ -61,12 +61,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <openssl/des.h>
|
||||
#include <openssl/pem.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
#include "apps.h"
|
||||
#define PROG pkcs12_main
|
||||
|
||||
EVP_CIPHER *enc;
|
||||
@@ -79,14 +79,16 @@ EVP_CIPHER *enc;
|
||||
#define CACERTS 0x10
|
||||
|
||||
int get_cert_chain(X509 *cert, STACK_OF(X509) **chain);
|
||||
int dump_cert_text (BIO *out, X509 *x);
|
||||
int dump_certs_keys_p12(BIO *out, PKCS12 *p12, char *pass, int passlen, int options);
|
||||
int dump_certs_pkeys_bags(BIO *out, STACK *bags, char *pass, int passlen, int options);
|
||||
int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bags, char *pass, int passlen, int options);
|
||||
int dump_certs_keys_p12(BIO *out, PKCS12 *p12, char *pass, int passlen, int options, char *pempass);
|
||||
int dump_certs_pkeys_bags(BIO *out, STACK *bags, char *pass, int passlen, int options, char *pempass);
|
||||
int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bags, char *pass, int passlen, int options, char *pempass);
|
||||
int print_attribs(BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name);
|
||||
void hex_prin(BIO *out, unsigned char *buf, int len);
|
||||
int alg_print(BIO *x, X509_ALGOR *alg);
|
||||
int cert_load(BIO *in, STACK_OF(X509) *sk);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char *infile=NULL, *outfile=NULL, *keyname = NULL;
|
||||
@@ -101,15 +103,19 @@ int MAIN(int argc, char **argv)
|
||||
int chain = 0;
|
||||
int badarg = 0;
|
||||
int iter = PKCS12_DEFAULT_ITER;
|
||||
int maciter = 1;
|
||||
int maciter = PKCS12_DEFAULT_ITER;
|
||||
int twopass = 0;
|
||||
int keytype = 0;
|
||||
int cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
int key_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
int ret = 1;
|
||||
int macver = 1;
|
||||
int noprompt = 0;
|
||||
STACK *canames = NULL;
|
||||
char *cpass = NULL, *mpass = NULL;
|
||||
char *passargin = NULL, *passargout = NULL, *passarg = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
char *inrand = NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -143,8 +149,35 @@ int MAIN(int argc, char **argv)
|
||||
else if (!strcmp (*args, "-noiter")) iter = 1;
|
||||
else if (!strcmp (*args, "-maciter"))
|
||||
maciter = PKCS12_DEFAULT_ITER;
|
||||
else if (!strcmp (*args, "-nomaciter"))
|
||||
maciter = 1;
|
||||
else if (!strcmp (*args, "-nodes")) enc=NULL;
|
||||
else if (!strcmp (*args, "-inkey")) {
|
||||
else if (!strcmp (*args, "-certpbe")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
cert_pbe=OBJ_txt2nid(*args);
|
||||
if(cert_pbe == NID_undef) {
|
||||
BIO_printf(bio_err,
|
||||
"Unknown PBE algorithm %s\n", *args);
|
||||
badarg = 1;
|
||||
}
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-keypbe")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
key_pbe=OBJ_txt2nid(*args);
|
||||
if(key_pbe == NID_undef) {
|
||||
BIO_printf(bio_err,
|
||||
"Unknown PBE algorithm %s\n", *args);
|
||||
badarg = 1;
|
||||
}
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-rand")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
inrand = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-inkey")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
keyname = *args;
|
||||
@@ -175,20 +208,20 @@ int MAIN(int argc, char **argv)
|
||||
args++;
|
||||
outfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-envpass")) {
|
||||
} else if (!strcmp(*args,"-passin")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
if(!(cpass = getenv(*args))) {
|
||||
BIO_printf(bio_err,
|
||||
"Can't read environment variable %s\n", *args);
|
||||
goto end;
|
||||
}
|
||||
noprompt = 1;
|
||||
passargin = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp(*args,"-passout")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
passargout = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-password")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
cpass = *args;
|
||||
passarg = *args;
|
||||
noprompt = 1;
|
||||
} else badarg = 1;
|
||||
} else badarg = 1;
|
||||
@@ -225,21 +258,54 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf (bio_err, "-maciter use MAC iteration\n");
|
||||
BIO_printf (bio_err, "-twopass separate MAC, encryption passwords\n");
|
||||
BIO_printf (bio_err, "-descert encrypt PKCS#12 certificates with triple DES (default RC2-40)\n");
|
||||
BIO_printf (bio_err, "-certpbe alg specify certificate PBE algorithm (default RC2-40)\n");
|
||||
BIO_printf (bio_err, "-keypbe alg specify private key PBE algorithm (default 3DES)\n");
|
||||
BIO_printf (bio_err, "-keyex set MS key exchange type\n");
|
||||
BIO_printf (bio_err, "-keysig set MS key signature type\n");
|
||||
BIO_printf (bio_err, "-password p set import/export password (NOT RECOMMENDED)\n");
|
||||
BIO_printf (bio_err, "-envpass p set import/export password from environment\n");
|
||||
BIO_printf (bio_err, "-password p set import/export password source\n");
|
||||
BIO_printf (bio_err, "-passin p input file pass phrase source\n");
|
||||
BIO_printf (bio_err, "-passout p output file pass phrase source\n");
|
||||
BIO_printf(bio_err, "-rand file:file:...\n");
|
||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err, " the random number generator\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(cpass) mpass = cpass;
|
||||
else {
|
||||
if(passarg) {
|
||||
if(export_cert) passargout = passarg;
|
||||
else passargin = passarg;
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!cpass) {
|
||||
if(export_cert) cpass = passout;
|
||||
else cpass = passin;
|
||||
}
|
||||
|
||||
if(cpass) {
|
||||
mpass = cpass;
|
||||
noprompt = 1;
|
||||
} else {
|
||||
cpass = pass;
|
||||
mpass = macpass;
|
||||
}
|
||||
|
||||
if(export_cert || inrand) {
|
||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
app_RAND_load_files(inrand));
|
||||
}
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("read files");
|
||||
#endif
|
||||
|
||||
if (!infile) in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
else in = BIO_new_file(infile, "rb");
|
||||
if (!in) {
|
||||
@@ -265,6 +331,11 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
CRYPTO_push_info("write files");
|
||||
#endif
|
||||
|
||||
if (!outfile) out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||
else out = BIO_new_file(outfile, "wb");
|
||||
if (!out) {
|
||||
@@ -274,27 +345,38 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
if (twopass) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("read MAC password");
|
||||
#endif
|
||||
if(EVP_read_pw_string (macpass, 50, "Enter MAC Password:", export_cert))
|
||||
{
|
||||
BIO_printf (bio_err, "Can't read Password\n");
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (export_cert) {
|
||||
if (export_cert) {
|
||||
EVP_PKEY *key;
|
||||
STACK *bags, *safes;
|
||||
PKCS12_SAFEBAG *bag;
|
||||
PKCS8_PRIV_KEY_INFO *p8;
|
||||
PKCS7 *authsafe;
|
||||
X509 *cert = NULL, *ucert = NULL;
|
||||
STACK_OF(X509) *certs;
|
||||
X509 *ucert = NULL;
|
||||
STACK_OF(X509) *certs=NULL;
|
||||
char *catmp;
|
||||
int i;
|
||||
unsigned char keyid[EVP_MAX_MD_SIZE];
|
||||
unsigned int keyidlen = 0;
|
||||
key = PEM_read_bio_PrivateKey(inkey ? inkey : in, NULL, NULL, NULL);
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("process -export_cert");
|
||||
#endif
|
||||
key = PEM_read_bio_PrivateKey(inkey ? inkey : in, NULL, NULL, passin);
|
||||
if (!inkey) (void) BIO_reset(in);
|
||||
else BIO_free(inkey);
|
||||
if (!key) {
|
||||
BIO_printf (bio_err, "Error loading private key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -313,7 +395,7 @@ if (export_cert) {
|
||||
for(i = 0; i < sk_X509_num(certs); i++) {
|
||||
ucert = sk_X509_value(certs, i);
|
||||
if(X509_check_private_key(ucert, key)) {
|
||||
X509_digest(cert, EVP_sha1(), keyid, &keyidlen);
|
||||
X509_digest(ucert, EVP_sha1(), keyid, &keyidlen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -354,6 +436,7 @@ if (export_cert) {
|
||||
|
||||
/* We now have loads of certificates: include them all */
|
||||
for(i = 0; i < sk_X509_num(certs); i++) {
|
||||
X509 *cert = NULL;
|
||||
cert = sk_X509_value(certs, i);
|
||||
bag = M_PKCS12_x5092certbag(cert);
|
||||
/* If it matches private key set id */
|
||||
@@ -364,7 +447,7 @@ if (export_cert) {
|
||||
PKCS12_add_friendlyname(bag, catmp, -1);
|
||||
sk_push(bags, (char *)bag);
|
||||
}
|
||||
|
||||
sk_X509_pop_free(certs, X509_free);
|
||||
if (canames) sk_free(canames);
|
||||
|
||||
if(!noprompt &&
|
||||
@@ -390,8 +473,7 @@ if (export_cert) {
|
||||
p8 = EVP_PKEY2PKCS8 (key);
|
||||
EVP_PKEY_free(key);
|
||||
if(keytype) PKCS8_add_keyusage(p8, keytype);
|
||||
bag = PKCS12_MAKE_SHKEYBAG(NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
|
||||
cpass, -1, NULL, 0, iter, p8);
|
||||
bag = PKCS12_MAKE_SHKEYBAG(key_pbe, cpass, -1, NULL, 0, iter, p8);
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
if (name) PKCS12_add_friendlyname (bag, name, -1);
|
||||
PKCS12_add_localkeyid (bag, keyid, keyidlen);
|
||||
@@ -415,6 +497,10 @@ if (export_cert) {
|
||||
PKCS12_free(p12);
|
||||
|
||||
ret = 0;
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
goto end;
|
||||
|
||||
}
|
||||
@@ -424,50 +510,61 @@ if (export_cert) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("read import password");
|
||||
#endif
|
||||
if(!noprompt && EVP_read_pw_string(pass, 50, "Enter Import Password:", 0)) {
|
||||
BIO_printf (bio_err, "Can't read Password\n");
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
|
||||
if (!twopass) strcpy(macpass, pass);
|
||||
|
||||
if (options & INFO) BIO_printf (bio_err, "MAC Iteration %ld\n", p12->mac->iter ? ASN1_INTEGER_get (p12->mac->iter) : 1);
|
||||
if(macver) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("verify MAC");
|
||||
#endif
|
||||
if (!PKCS12_verify_mac (p12, mpass, -1)) {
|
||||
BIO_printf (bio_err, "Mac verify errror: invalid password?\n");
|
||||
BIO_printf (bio_err, "Mac verify error: invalid password?\n");
|
||||
ERR_print_errors (bio_err);
|
||||
goto end;
|
||||
} else BIO_printf (bio_err, "MAC verified OK\n");
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!dump_certs_keys_p12 (out, p12, cpass, -1, options)) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("output keys and certificates");
|
||||
#endif
|
||||
if (!dump_certs_keys_p12 (out, p12, cpass, -1, options, passout)) {
|
||||
BIO_printf(bio_err, "Error outputting keys and certificates\n");
|
||||
ERR_print_errors (bio_err);
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
PKCS12_free(p12);
|
||||
ret = 0;
|
||||
end:
|
||||
if(export_cert || inrand) app_RAND_write_file(NULL, bio_err);
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_remove_all_info();
|
||||
#endif
|
||||
BIO_free(in);
|
||||
BIO_free(out);
|
||||
if(passin) Free(passin);
|
||||
if(passout) Free(passout);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
int dump_cert_text (BIO *out, X509 *x)
|
||||
{
|
||||
char buf[256];
|
||||
X509_NAME_oneline(X509_get_subject_name(x),buf,256);
|
||||
BIO_puts(out,"subject=");
|
||||
BIO_puts(out,buf);
|
||||
|
||||
X509_NAME_oneline(X509_get_issuer_name(x),buf,256);
|
||||
BIO_puts(out,"\nissuer= ");
|
||||
BIO_puts(out,buf);
|
||||
BIO_puts(out,"\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
||||
int passlen, int options)
|
||||
int passlen, int options, char *pempass)
|
||||
{
|
||||
STACK *asafes, *bags;
|
||||
int i, bagnid;
|
||||
@@ -489,7 +586,7 @@ int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
||||
} else continue;
|
||||
if (!bags) return 0;
|
||||
if (!dump_certs_pkeys_bags (out, bags, pass, passlen,
|
||||
options)) {
|
||||
options, pempass)) {
|
||||
sk_pop_free (bags, PKCS12_SAFEBAG_free);
|
||||
return 0;
|
||||
}
|
||||
@@ -500,19 +597,19 @@ int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
||||
}
|
||||
|
||||
int dump_certs_pkeys_bags (BIO *out, STACK *bags, char *pass,
|
||||
int passlen, int options)
|
||||
int passlen, int options, char *pempass)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sk_num (bags); i++) {
|
||||
if (!dump_certs_pkeys_bag (out,
|
||||
(PKCS12_SAFEBAG *)sk_value (bags, i), pass, passlen,
|
||||
options)) return 0;
|
||||
options, pempass)) return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
||||
int passlen, int options)
|
||||
int passlen, int options, char *pempass)
|
||||
{
|
||||
EVP_PKEY *pkey;
|
||||
PKCS8_PRIV_KEY_INFO *p8;
|
||||
@@ -527,7 +624,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
||||
p8 = bag->value.keybag;
|
||||
if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
|
||||
print_attribs (out, p8->attributes, "Key Attributes");
|
||||
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, NULL);
|
||||
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);
|
||||
EVP_PKEY_free(pkey);
|
||||
break;
|
||||
|
||||
@@ -543,7 +640,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
||||
if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
|
||||
print_attribs (out, p8->attributes, "Key Attributes");
|
||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, NULL);
|
||||
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);
|
||||
EVP_PKEY_free(pkey);
|
||||
break;
|
||||
|
||||
@@ -566,7 +663,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
||||
if (options & INFO) BIO_printf (bio_err, "Safe Contents bag\n");
|
||||
print_attribs (out, bag->attrib, "Bag Attributes");
|
||||
return dump_certs_pkeys_bags (out, bag->value.safes, pass,
|
||||
passlen, options);
|
||||
passlen, options, pempass);
|
||||
|
||||
default:
|
||||
BIO_printf (bio_err, "Warning unsupported bag type: ");
|
||||
@@ -588,7 +685,7 @@ int get_cert_chain (X509 *cert, STACK_OF(X509) **chain)
|
||||
X509_STORE_CTX store_ctx;
|
||||
STACK_OF(X509) *chn;
|
||||
int i;
|
||||
X509 *x;
|
||||
|
||||
store = X509_STORE_new ();
|
||||
X509_STORE_set_default_paths (store);
|
||||
X509_STORE_CTX_init(&store_ctx, store, cert, NULL);
|
||||
@@ -596,11 +693,7 @@ int get_cert_chain (X509 *cert, STACK_OF(X509) **chain)
|
||||
i = X509_STORE_CTX_get_error (&store_ctx);
|
||||
goto err;
|
||||
}
|
||||
chn = sk_X509_dup(X509_STORE_CTX_get_chain (&store_ctx));
|
||||
for (i = 0; i < sk_X509_num(chn); i++) {
|
||||
x = sk_X509_value(chn, i);
|
||||
CRYPTO_add(&x->references,1,CRYPTO_LOCK_X509);
|
||||
}
|
||||
chn = X509_STORE_CTX_get1_chain(&store_ctx);
|
||||
i = 0;
|
||||
*chain = chn;
|
||||
err:
|
||||
|
||||
96
apps/pkcs7.c
96
apps/pkcs7.c
@@ -71,27 +71,23 @@
|
||||
#undef PROG
|
||||
#define PROG pkcs7_main
|
||||
|
||||
/* -inform arg - input format - default PEM (one of DER, TXT or PEM)
|
||||
/* -inform arg - input format - default PEM (DER or PEM)
|
||||
* -outform arg - output format - default PEM
|
||||
* -in arg - input file - default stdin
|
||||
* -out arg - output file - default stdout
|
||||
* -des - encrypt output if PEM format with DES in cbc mode
|
||||
* -des3 - encrypt output if PEM format
|
||||
* -idea - encrypt output if PEM format
|
||||
* -print_certs
|
||||
*/
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
PKCS7 *p7=NULL;
|
||||
int i,badops=0;
|
||||
#if !defined(NO_DES) || !defined(NO_IDEA)
|
||||
EVP_CIPHER *enc=NULL;
|
||||
#endif
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat;
|
||||
char *infile,*outfile,*prog,buf[256];
|
||||
int print_certs=0;
|
||||
char *infile,*outfile,*prog;
|
||||
int print_certs=0,text=0,noout=0;
|
||||
int ret=0;
|
||||
|
||||
apps_startup();
|
||||
@@ -130,18 +126,12 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
text=1;
|
||||
else if (strcmp(*argv,"-print_certs") == 0)
|
||||
print_certs=1;
|
||||
#ifndef NO_DES
|
||||
else if (strcmp(*argv,"-des") == 0)
|
||||
enc=EVP_des_cbc();
|
||||
else if (strcmp(*argv,"-des3") == 0)
|
||||
enc=EVP_des_ede3_cbc();
|
||||
#endif
|
||||
#ifndef NO_IDEA
|
||||
else if (strcmp(*argv,"-idea") == 0)
|
||||
enc=EVP_idea_cbc();
|
||||
#endif
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||
@@ -157,16 +147,13 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||
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," -outform arg output format - one of DER TXT PEM\n");
|
||||
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||
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," -print_certs print any certs or crl in the input\n");
|
||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
#ifndef NO_IDEA
|
||||
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -text print full details of certificates\n");
|
||||
BIO_printf(bio_err," -noout don't output encoded data\n");
|
||||
EXIT(1);
|
||||
}
|
||||
|
||||
@@ -246,19 +233,10 @@ bad:
|
||||
for (i=0; i<sk_X509_num(certs); i++)
|
||||
{
|
||||
x=sk_X509_value(certs,i);
|
||||
if(text) X509_print(out, x);
|
||||
else dump_cert_text(out, x);
|
||||
|
||||
X509_NAME_oneline(X509_get_subject_name(x),
|
||||
buf,256);
|
||||
BIO_puts(out,"subject=");
|
||||
BIO_puts(out,buf);
|
||||
|
||||
X509_NAME_oneline(X509_get_issuer_name(x),
|
||||
buf,256);
|
||||
BIO_puts(out,"\nissuer= ");
|
||||
BIO_puts(out,buf);
|
||||
BIO_puts(out,"\n");
|
||||
|
||||
PEM_write_bio_X509(out,x);
|
||||
if(!noout) PEM_write_bio_X509(out,x);
|
||||
BIO_puts(out,"\n");
|
||||
}
|
||||
}
|
||||
@@ -270,17 +248,9 @@ bad:
|
||||
{
|
||||
crl=sk_X509_CRL_value(crls,i);
|
||||
|
||||
X509_NAME_oneline(crl->crl->issuer,buf,256);
|
||||
BIO_puts(out,"issuer= ");
|
||||
BIO_puts(out,buf);
|
||||
X509_CRL_print(out, crl);
|
||||
|
||||
BIO_puts(out,"\nlast update=");
|
||||
ASN1_TIME_print(out,crl->crl->lastUpdate);
|
||||
BIO_puts(out,"\nnext update=");
|
||||
ASN1_TIME_print(out,crl->crl->nextUpdate);
|
||||
BIO_puts(out,"\n");
|
||||
|
||||
PEM_write_bio_X509_CRL(out,crl);
|
||||
if(!noout)PEM_write_bio_X509_CRL(out,crl);
|
||||
BIO_puts(out,"\n");
|
||||
}
|
||||
}
|
||||
@@ -289,21 +259,23 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i=i2d_PKCS7_bio(out,p7);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i=PEM_write_bio_PKCS7(out,p7);
|
||||
else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
}
|
||||
if(!noout) {
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i=i2d_PKCS7_bio(out,p7);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i=PEM_write_bio_PKCS7(out,p7);
|
||||
else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!i)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to write pkcs7 object\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (!i)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to write pkcs7 object\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
ret=0;
|
||||
end:
|
||||
if (p7 != NULL) PKCS7_free(p7);
|
||||
|
||||
131
apps/pkcs8.c
131
apps/pkcs8.c
@@ -57,6 +57,7 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
@@ -65,10 +66,12 @@
|
||||
#include "apps.h"
|
||||
#define PROG pkcs8_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
char **args, *infile = NULL, *outfile = NULL;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
BIO *in = NULL, *out = NULL;
|
||||
int topk8 = 0;
|
||||
int pbe_nid = -1;
|
||||
@@ -80,13 +83,13 @@ int MAIN(int argc, char **argv)
|
||||
X509_SIG *p8;
|
||||
PKCS8_PRIV_KEY_INFO *p8inf;
|
||||
EVP_PKEY *pkey;
|
||||
char pass[50];
|
||||
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
||||
int badarg = 0;
|
||||
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
informat=FORMAT_PEM;
|
||||
outformat=FORMAT_PEM;
|
||||
ERR_load_crypto_strings();
|
||||
SSLeay_add_all_algorithms();
|
||||
OpenSSL_add_all_algorithms();
|
||||
args = argv + 1;
|
||||
while (!badarg && *args && *args[0] == '-') {
|
||||
if (!strcmp(*args,"-v2")) {
|
||||
@@ -99,6 +102,16 @@ int MAIN(int argc, char **argv)
|
||||
badarg = 1;
|
||||
}
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp(*args,"-v1")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
pbe_nid=OBJ_txt2nid(*args);
|
||||
if(pbe_nid == NID_undef) {
|
||||
BIO_printf(bio_err,
|
||||
"Unknown PBE algorithm %s\n", *args);
|
||||
badarg = 1;
|
||||
}
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp(*args,"-inform")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -113,6 +126,18 @@ int MAIN(int argc, char **argv)
|
||||
else if (!strcmp (*args, "-noiter")) iter = 1;
|
||||
else if (!strcmp (*args, "-nocrypt")) nocrypt = 1;
|
||||
else if (!strcmp (*args, "-nooct")) p8_broken = PKCS8_NO_OCTET;
|
||||
else if (!strcmp (*args, "-nsdb")) p8_broken = PKCS8_NS_DB;
|
||||
else if (!strcmp (*args, "-embed")) p8_broken = PKCS8_EMBEDDED_PARAM;
|
||||
else if (!strcmp(*args,"-passin"))
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
passargin= *(++args);
|
||||
}
|
||||
else if (!strcmp(*args,"-passout"))
|
||||
{
|
||||
if (!args[1]) goto bad;
|
||||
passargout= *(++args);
|
||||
}
|
||||
else if (!strcmp (*args, "-in")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -128,25 +153,36 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (badarg) {
|
||||
BIO_printf (bio_err, "Usage pkcs8 [options]\n");
|
||||
BIO_printf (bio_err, "where options are\n");
|
||||
BIO_printf (bio_err, "-in file input file\n");
|
||||
BIO_printf (bio_err, "-inform X input format (DER or PEM)\n");
|
||||
BIO_printf (bio_err, "-outform X output format (DER or PEM)\n");
|
||||
BIO_printf (bio_err, "-out file output file\n");
|
||||
BIO_printf (bio_err, "-topk8 output PKCS8 file\n");
|
||||
BIO_printf (bio_err, "-nooct use (broken) no octet form\n");
|
||||
BIO_printf (bio_err, "-noiter use 1 as iteration count\n");
|
||||
BIO_printf (bio_err, "-nocrypt use or expect unencrypted private key\n");
|
||||
BIO_printf (bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
||||
bad:
|
||||
BIO_printf(bio_err, "Usage pkcs8 [options]\n");
|
||||
BIO_printf(bio_err, "where options are\n");
|
||||
BIO_printf(bio_err, "-in file input file\n");
|
||||
BIO_printf(bio_err, "-inform X input format (DER or PEM)\n");
|
||||
BIO_printf(bio_err, "-passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err, "-outform X output format (DER or PEM)\n");
|
||||
BIO_printf(bio_err, "-out file output file\n");
|
||||
BIO_printf(bio_err, "-passout arg output file pass phrase source\n");
|
||||
BIO_printf(bio_err, "-topk8 output PKCS8 file\n");
|
||||
BIO_printf(bio_err, "-nooct use (nonstandard) no octet format\n");
|
||||
BIO_printf(bio_err, "-embed use (nonstandard) embedded DSA parameters format\n");
|
||||
BIO_printf(bio_err, "-nsdb use (nonstandard) DSA Netscape DB format\n");
|
||||
BIO_printf(bio_err, "-noiter use 1 as iteration count\n");
|
||||
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
|
||||
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
||||
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
||||
return (1);
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
return (1);
|
||||
}
|
||||
|
||||
if ((pbe_nid == -1) && !cipher) pbe_nid = NID_pbeWithMD5AndDES_CBC;
|
||||
|
||||
if (infile) {
|
||||
if (!(in = BIO_new_file (infile, "rb"))) {
|
||||
BIO_printf (bio_err,
|
||||
if (!(in = BIO_new_file(infile, "rb"))) {
|
||||
BIO_printf(bio_err,
|
||||
"Can't open input file %s\n", infile);
|
||||
return (1);
|
||||
}
|
||||
@@ -154,25 +190,32 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (outfile) {
|
||||
if (!(out = BIO_new_file (outfile, "wb"))) {
|
||||
BIO_printf (bio_err,
|
||||
BIO_printf(bio_err,
|
||||
"Can't open output file %s\n", outfile);
|
||||
return (1);
|
||||
}
|
||||
} else out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||
|
||||
if (topk8) {
|
||||
if (!(pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, NULL))) {
|
||||
BIO_printf (bio_err, "Error reading key\n", outfile);
|
||||
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 (!pkey) {
|
||||
BIO_printf(bio_err, "Error reading key\n", outfile);
|
||||
ERR_print_errors(bio_err);
|
||||
return (1);
|
||||
}
|
||||
BIO_free(in);
|
||||
if (!(p8inf = EVP_PKEY2PKCS8(pkey))) {
|
||||
BIO_printf (bio_err, "Error converting key\n", outfile);
|
||||
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
|
||||
BIO_printf(bio_err, "Error converting key\n", outfile);
|
||||
ERR_print_errors(bio_err);
|
||||
return (1);
|
||||
}
|
||||
PKCS8_set_broken(p8inf, p8_broken);
|
||||
if(nocrypt) {
|
||||
if(outformat == FORMAT_PEM)
|
||||
PEM_write_bio_PKCS8_PRIV_KEY_INFO(out, p8inf);
|
||||
@@ -183,17 +226,23 @@ int MAIN(int argc, char **argv)
|
||||
return (1);
|
||||
}
|
||||
} else {
|
||||
EVP_read_pw_string(pass, 50, "Enter Encryption Password:", 1);
|
||||
if(passout) p8pass = passout;
|
||||
else {
|
||||
p8pass = pass;
|
||||
EVP_read_pw_string(pass, 50, "Enter Encryption Password:", 1);
|
||||
}
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
||||
pass, strlen(pass),
|
||||
p8pass, strlen(p8pass),
|
||||
NULL, 0, iter, p8inf))) {
|
||||
BIO_printf (bio_err, "Error encrypting key\n",
|
||||
BIO_printf(bio_err, "Error encrypting key\n",
|
||||
outfile);
|
||||
ERR_print_errors(bio_err);
|
||||
return (1);
|
||||
}
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
if(outformat == FORMAT_PEM)
|
||||
PEM_write_bio_PKCS8 (out, p8);
|
||||
PEM_write_bio_PKCS8(out, p8);
|
||||
else if(outformat == FORMAT_ASN1)
|
||||
i2d_PKCS8_bio(out, p8);
|
||||
else {
|
||||
@@ -205,6 +254,8 @@ int MAIN(int argc, char **argv)
|
||||
PKCS8_PRIV_KEY_INFO_free (p8inf);
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free(out);
|
||||
if(passin) Free(passin);
|
||||
if(passout) Free(passout);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -232,8 +283,12 @@ int MAIN(int argc, char **argv)
|
||||
ERR_print_errors(bio_err);
|
||||
return (1);
|
||||
}
|
||||
EVP_read_pw_string(pass, 50, "Enter Password:", 0);
|
||||
p8inf = M_PKCS8_decrypt(p8, pass, strlen(pass));
|
||||
if(passin) p8pass = passin;
|
||||
else {
|
||||
p8pass = pass;
|
||||
EVP_read_pw_string(pass, 50, "Enter Password:", 0);
|
||||
}
|
||||
p8inf = M_PKCS8_decrypt(p8, p8pass, strlen(p8pass));
|
||||
X509_SIG_free(p8);
|
||||
}
|
||||
|
||||
@@ -253,7 +308,15 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "Warning: broken key encoding: ");
|
||||
switch (p8inf->broken) {
|
||||
case PKCS8_NO_OCTET:
|
||||
BIO_printf(bio_err, "No Octet String\n");
|
||||
BIO_printf(bio_err, "No Octet String in PrivateKey\n");
|
||||
break;
|
||||
|
||||
case PKCS8_EMBEDDED_PARAM:
|
||||
BIO_printf(bio_err, "DSA parameters included in PrivateKey\n");
|
||||
break;
|
||||
|
||||
case PKCS8_NS_DB:
|
||||
BIO_printf(bio_err, "DSA public key include in PrivateKey\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -263,12 +326,20 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
|
||||
PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, NULL);
|
||||
if(outformat == FORMAT_PEM)
|
||||
PEM_write_bio_PrivateKey(out, pkey, NULL, NULL, 0, NULL, passout);
|
||||
else if(outformat == FORMAT_ASN1)
|
||||
i2d_PrivateKey_bio(out, pkey);
|
||||
else {
|
||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
||||
return (1);
|
||||
}
|
||||
|
||||
EVP_PKEY_free(pkey);
|
||||
BIO_free(out);
|
||||
BIO_free(in);
|
||||
if(passin) Free(passin);
|
||||
if(passout) Free(passout);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
32
apps/progs.h
32
apps/progs.h
@@ -1,11 +1,14 @@
|
||||
/* This file was generated by progs.pl. */
|
||||
/* apps/progs.h */
|
||||
/* automatically generated by progs.pl for openssl.c */
|
||||
|
||||
extern int verify_main(int argc,char *argv[]);
|
||||
extern int asn1parse_main(int argc,char *argv[]);
|
||||
extern int req_main(int argc,char *argv[]);
|
||||
extern int dgst_main(int argc,char *argv[]);
|
||||
extern int dh_main(int argc,char *argv[]);
|
||||
extern int dhparam_main(int argc,char *argv[]);
|
||||
extern int enc_main(int argc,char *argv[]);
|
||||
extern int passwd_main(int argc,char *argv[]);
|
||||
extern int gendh_main(int argc,char *argv[]);
|
||||
extern int errstr_main(int argc,char *argv[]);
|
||||
extern int ca_main(int argc,char *argv[]);
|
||||
@@ -28,8 +31,8 @@ extern int ciphers_main(int argc,char *argv[]);
|
||||
extern int nseq_main(int argc,char *argv[]);
|
||||
extern int pkcs12_main(int argc,char *argv[]);
|
||||
extern int pkcs8_main(int argc,char *argv[]);
|
||||
|
||||
#ifdef SSLEAY_SRC /* Defined only in openssl.c. */
|
||||
extern int spkac_main(int argc,char *argv[]);
|
||||
extern int smime_main(int argc,char *argv[]);
|
||||
|
||||
#define FUNC_TYPE_GENERAL 1
|
||||
#define FUNC_TYPE_MD 2
|
||||
@@ -48,8 +51,12 @@ FUNCTION functions[] = {
|
||||
{FUNC_TYPE_GENERAL,"dgst",dgst_main},
|
||||
#ifndef NO_DH
|
||||
{FUNC_TYPE_GENERAL,"dh",dh_main},
|
||||
#endif
|
||||
#ifndef NO_DH
|
||||
{FUNC_TYPE_GENERAL,"dhparam",dhparam_main},
|
||||
#endif
|
||||
{FUNC_TYPE_GENERAL,"enc",enc_main},
|
||||
{FUNC_TYPE_GENERAL,"passwd",passwd_main},
|
||||
#ifndef NO_DH
|
||||
{FUNC_TYPE_GENERAL,"gendh",gendh_main},
|
||||
#endif
|
||||
@@ -72,14 +79,14 @@ FUNCTION functions[] = {
|
||||
#ifndef NO_DSA
|
||||
{FUNC_TYPE_GENERAL,"gendsa",gendsa_main},
|
||||
#endif
|
||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(O_SSL3))
|
||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))
|
||||
{FUNC_TYPE_GENERAL,"s_server",s_server_main},
|
||||
#endif
|
||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(O_SSL3))
|
||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))
|
||||
{FUNC_TYPE_GENERAL,"s_client",s_client_main},
|
||||
#endif
|
||||
{FUNC_TYPE_GENERAL,"speed",speed_main},
|
||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(O_SSL3))
|
||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))
|
||||
{FUNC_TYPE_GENERAL,"s_time",s_time_main},
|
||||
#endif
|
||||
{FUNC_TYPE_GENERAL,"version",version_main},
|
||||
@@ -94,6 +101,8 @@ FUNCTION functions[] = {
|
||||
{FUNC_TYPE_GENERAL,"pkcs12",pkcs12_main},
|
||||
#endif
|
||||
{FUNC_TYPE_GENERAL,"pkcs8",pkcs8_main},
|
||||
{FUNC_TYPE_GENERAL,"spkac",spkac_main},
|
||||
{FUNC_TYPE_GENERAL,"smime",smime_main},
|
||||
{FUNC_TYPE_MD,"md2",dgst_main},
|
||||
{FUNC_TYPE_MD,"md5",dgst_main},
|
||||
{FUNC_TYPE_MD,"sha",dgst_main},
|
||||
@@ -116,6 +125,9 @@ FUNCTION functions[] = {
|
||||
#ifndef NO_RC4
|
||||
{FUNC_TYPE_CIPHER,"rc4",enc_main},
|
||||
#endif
|
||||
#ifndef NO_RC4
|
||||
{FUNC_TYPE_CIPHER,"rc4-40",enc_main},
|
||||
#endif
|
||||
#ifndef NO_RC2
|
||||
{FUNC_TYPE_CIPHER,"rc2",enc_main},
|
||||
#endif
|
||||
@@ -188,6 +200,12 @@ FUNCTION functions[] = {
|
||||
#ifndef NO_RC2
|
||||
{FUNC_TYPE_CIPHER,"rc2-ofb",enc_main},
|
||||
#endif
|
||||
#ifndef NO_RC2
|
||||
{FUNC_TYPE_CIPHER,"rc2-64-cbc",enc_main},
|
||||
#endif
|
||||
#ifndef NO_RC2
|
||||
{FUNC_TYPE_CIPHER,"rc2-40-cbc",enc_main},
|
||||
#endif
|
||||
#ifndef NO_BF
|
||||
{FUNC_TYPE_CIPHER,"bf-cbc",enc_main},
|
||||
#endif
|
||||
@@ -229,5 +247,3 @@ FUNCTION functions[] = {
|
||||
#endif
|
||||
{0,NULL,NULL}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
print "/* This file was generated by progs.pl. */\n\n";
|
||||
print "/* apps/progs.h */\n";
|
||||
print "/* automatically generated by progs.pl for openssl.c */\n\n";
|
||||
|
||||
grep(s/^asn1pars$/asn1parse/,@ARGV);
|
||||
|
||||
@@ -9,8 +10,6 @@ foreach (@ARGV)
|
||||
|
||||
print <<'EOF';
|
||||
|
||||
#ifdef SSLEAY_SRC /* Defined only in openssl.c. */
|
||||
|
||||
#define FUNC_TYPE_GENERAL 1
|
||||
#define FUNC_TYPE_MD 2
|
||||
#define FUNC_TYPE_CIPHER 3
|
||||
@@ -29,13 +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(O_SSL3))\n${str}#endif\n"; }
|
||||
{ print "#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) )
|
||||
{ print "#ifndef NO_RSA\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/))
|
||||
{ print "#ifndef NO_DSA\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/))
|
||||
elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/))
|
||||
{ print "#ifndef NO_DH\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^pkcs12$/))
|
||||
{ print "#if !defined(NO_DES) && !defined(NO_SHA1)\n${str}#endif\n"; }
|
||||
else
|
||||
{ print $str; }
|
||||
}
|
||||
@@ -48,13 +49,14 @@ foreach ("md2","md5","sha","sha1","mdc2","rmd160")
|
||||
|
||||
foreach (
|
||||
"base64",
|
||||
"des", "des3", "desx", "idea", "rc4", "rc2","bf","cast","rc5",
|
||||
"des", "des3", "desx", "idea", "rc4", "rc4-40",
|
||||
"rc2", "bf", "cast", "rc5",
|
||||
"des-ecb", "des-ede", "des-ede3",
|
||||
"des-cbc", "des-ede-cbc","des-ede3-cbc",
|
||||
"des-cfb", "des-ede-cfb","des-ede3-cfb",
|
||||
"des-ofb", "des-ede-ofb","des-ede3-ofb",
|
||||
"idea-cbc","idea-ecb", "idea-cfb", "idea-ofb",
|
||||
"rc2-cbc", "rc2-ecb", "rc2-cfb", "rc2-ofb",
|
||||
"rc2-cbc", "rc2-ecb", "rc2-cfb","rc2-ofb", "rc2-64-cbc", "rc2-40-cbc",
|
||||
"bf-cbc", "bf-ecb", "bf-cfb", "bf-ofb",
|
||||
"cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb",
|
||||
"cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb")
|
||||
@@ -73,5 +75,3 @@ foreach (
|
||||
}
|
||||
|
||||
print "\t{0,NULL,NULL}\n\t};\n";
|
||||
print "#endif\n\n";
|
||||
|
||||
|
||||
489
apps/req.c
489
apps/req.c
@@ -66,7 +66,6 @@
|
||||
#include "apps.h"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/asn1.h>
|
||||
@@ -79,9 +78,12 @@
|
||||
|
||||
#define BITS "default_bits"
|
||||
#define KEYFILE "default_keyfile"
|
||||
#define PROMPT "prompt"
|
||||
#define DISTINGUISHED_NAME "distinguished_name"
|
||||
#define ATTRIBUTES "attributes"
|
||||
#define V3_EXTENSIONS "x509_extensions"
|
||||
#define REQ_EXTENSIONS "req_extensions"
|
||||
#define STRING_MASK "string_mask"
|
||||
|
||||
#define DEFAULT_KEY_LENGTH 512
|
||||
#define MIN_KEY_LENGTH 384
|
||||
@@ -89,7 +91,7 @@
|
||||
#undef PROG
|
||||
#define PROG req_main
|
||||
|
||||
/* -inform arg - input format - default PEM (one of DER, TXT or PEM)
|
||||
/* -inform arg - input format - default PEM (DER or PEM)
|
||||
* -outform arg - output format - default PEM
|
||||
* -in arg - input file - default stdin
|
||||
* -out arg - output file - default stdout
|
||||
@@ -108,13 +110,20 @@
|
||||
*/
|
||||
|
||||
static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,int attribs);
|
||||
static int add_attribute_object(STACK_OF(X509_ATTRIBUTE) *n, char *text,
|
||||
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);
|
||||
static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *sk,
|
||||
STACK_OF(CONF_VALUE) *attr, int attribs);
|
||||
static int add_attribute_object(X509_REQ *req, char *text,
|
||||
char *def, char *value, int nid, int min,
|
||||
int max);
|
||||
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
||||
int nid,int min,int max);
|
||||
#ifndef NO_RSA
|
||||
static void MS_CALLBACK req_cb(int p,int n,void *arg);
|
||||
static int req_fix_data(int nid,int *type,int len,int min,int max);
|
||||
#endif
|
||||
static int req_check_len(int len,int min,int max);
|
||||
static int check_end(char *str, char *end);
|
||||
static int add_oid_section(LHASH *conf);
|
||||
#ifndef MONOLITH
|
||||
@@ -127,6 +136,8 @@ static LHASH *req_conf=NULL;
|
||||
#define TYPE_DSA 2
|
||||
#define TYPE_DH 3
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
#ifndef NO_DSA
|
||||
@@ -139,17 +150,21 @@ int MAIN(int argc, char **argv)
|
||||
int i,badops=0,newreq=0,newkey= -1,pkey_type=0;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;
|
||||
int nodes=0,kludge=0;
|
||||
int nodes=0,kludge=0,newhdr=0;
|
||||
char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;
|
||||
char *extensions = NULL;
|
||||
char *req_exts = NULL;
|
||||
EVP_CIPHER *cipher=NULL;
|
||||
int modulus=0;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
char *p;
|
||||
const EVP_MD *md_alg=NULL,*digest=EVP_md5();
|
||||
#ifndef MONOLITH
|
||||
MS_STATIC char config_name[256];
|
||||
#endif
|
||||
|
||||
req_conf = NULL;
|
||||
#ifndef NO_DES
|
||||
cipher=EVP_des_ede3_cbc();
|
||||
#endif
|
||||
@@ -214,6 +229,16 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
keyout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passin") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargin= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passout") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-newkey") == 0)
|
||||
{
|
||||
int is_numeric;
|
||||
@@ -281,6 +306,8 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
newreq=1;
|
||||
}
|
||||
else if (strcmp(*argv,"-newhdr") == 0)
|
||||
newhdr=1;
|
||||
else if (strcmp(*argv,"-modulus") == 0)
|
||||
modulus=1;
|
||||
else if (strcmp(*argv,"-verify") == 0)
|
||||
@@ -308,8 +335,17 @@ int MAIN(int argc, char **argv)
|
||||
/* ok */
|
||||
digest=md_alg;
|
||||
}
|
||||
else if (strcmp(*argv,"-extensions") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
extensions = *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-reqexts") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
req_exts = *(++argv);
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||
badops=1;
|
||||
@@ -324,8 +360,8 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||
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," -outform arg output format - one of DER TXT PEM\n");
|
||||
BIO_printf(bio_err," -inform arg input format - DER or PEM\n");
|
||||
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 text form of request\n");
|
||||
@@ -344,16 +380,21 @@ bad:
|
||||
BIO_printf(bio_err," -new new request.\n");
|
||||
BIO_printf(bio_err," -x509 output a x509 structure instead of a cert. req.\n");
|
||||
BIO_printf(bio_err," -days number of days a x509 generated by -x509 is valid for.\n");
|
||||
BIO_printf(bio_err," -newhdr output \"NEW\" in the header lines\n");
|
||||
BIO_printf(bio_err," -asn1-kludge Output the 'request' in a format that is wrong but some CA's\n");
|
||||
BIO_printf(bio_err," have been reported as requiring\n");
|
||||
BIO_printf(bio_err," [ It is now always turned on but can be turned off with -no-asn1-kludge ]\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");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
X509V3_add_standard_extensions();
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
#ifndef MONOLITH
|
||||
#ifndef MONOLITH /* else this has happened in openssl.c (global `config') */
|
||||
/* Lets load up our environment a little */
|
||||
p=getenv("OPENSSL_CONF");
|
||||
if (p == NULL)
|
||||
@@ -367,7 +408,7 @@ bad:
|
||||
strcat(config_name,OPENSSL_CONF);
|
||||
p=config_name;
|
||||
}
|
||||
default_config_file=p;
|
||||
default_config_file=p;
|
||||
config=CONF_load(config,p,NULL);
|
||||
#endif
|
||||
|
||||
@@ -425,7 +466,8 @@ bad:
|
||||
digest=md_alg;
|
||||
}
|
||||
|
||||
extensions = CONF_get_string(req_conf, SECTION, V3_EXTENSIONS);
|
||||
if(!extensions)
|
||||
extensions = CONF_get_string(req_conf, SECTION, V3_EXTENSIONS);
|
||||
if(extensions) {
|
||||
/* Check syntax of file */
|
||||
X509V3_CTX ctx;
|
||||
@@ -438,6 +480,34 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if(!passin)
|
||||
passin = CONF_get_string(req_conf, SECTION, "input_password");
|
||||
|
||||
if(!passout)
|
||||
passout = CONF_get_string(req_conf, SECTION, "output_password");
|
||||
|
||||
p = CONF_get_string(req_conf, SECTION, STRING_MASK);
|
||||
|
||||
if(p && !ASN1_STRING_set_default_mask_asc(p)) {
|
||||
BIO_printf(bio_err, "Invalid global string mask setting %s\n", p);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!req_exts)
|
||||
req_exts = CONF_get_string(req_conf, SECTION, REQ_EXTENSIONS);
|
||||
if(req_exts) {
|
||||
/* 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)) {
|
||||
BIO_printf(bio_err,
|
||||
"Error Loading request extension section %s\n",
|
||||
req_exts);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
@@ -451,11 +521,12 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* if (keyform == FORMAT_ASN1)
|
||||
rsa=d2i_RSAPrivateKey_bio(in,NULL);
|
||||
else */
|
||||
if (keyform == FORMAT_PEM)
|
||||
pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,NULL);
|
||||
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");
|
||||
@@ -471,25 +542,9 @@ bad:
|
||||
|
||||
if (newreq && (pkey == NULL))
|
||||
{
|
||||
char *randfile;
|
||||
char buffer[200];
|
||||
|
||||
if ((randfile=CONF_get_string(req_conf,SECTION,"RANDFILE")) == NULL)
|
||||
randfile=RAND_file_name(buffer,200);
|
||||
#ifdef WINDOWS
|
||||
BIO_printf(bio_err,"Loading 'screen' into random state -");
|
||||
BIO_flush(bio_err);
|
||||
RAND_screen();
|
||||
BIO_printf(bio_err," done\n");
|
||||
#endif
|
||||
if ((randfile == NULL) || !RAND_load_file(randfile,1024L*1024L))
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load 'random state'\n");
|
||||
BIO_printf(bio_err,"What this means is that the random number generator has not been seeded\n");
|
||||
BIO_printf(bio_err,"with much random data.\n");
|
||||
BIO_printf(bio_err,"Consider setting the RANDFILE environment variable to point at a file that\n");
|
||||
BIO_printf(bio_err,"'random' data can be kept in.\n");
|
||||
}
|
||||
char *randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
|
||||
app_RAND_load_file(randfile, bio_err, 0);
|
||||
|
||||
if (newkey <= 0)
|
||||
{
|
||||
newkey=(int)CONF_get_number(req_conf,SECTION,BITS);
|
||||
@@ -527,8 +582,7 @@ bad:
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((randfile == NULL) || (RAND_write_file(randfile) == 0))
|
||||
BIO_printf(bio_err,"unable to write 'random state'\n");
|
||||
app_RAND_write_file(randfile, bio_err);
|
||||
|
||||
if (pkey == NULL) goto end;
|
||||
|
||||
@@ -560,7 +614,7 @@ bad:
|
||||
i=0;
|
||||
loop:
|
||||
if (!PEM_write_bio_PrivateKey(out,pkey,cipher,
|
||||
NULL,0,NULL,NULL))
|
||||
NULL,0,NULL,passout))
|
||||
{
|
||||
if ((ERR_GET_REASON(ERR_peek_error()) ==
|
||||
PEM_R_PROBLEMS_GETTING_PASSWORD) && (i < 3))
|
||||
@@ -677,6 +731,22 @@ loop:
|
||||
}
|
||||
else
|
||||
{
|
||||
X509V3_CTX ext_ctx;
|
||||
|
||||
/* Set up V3 context struct */
|
||||
|
||||
X509V3_set_ctx(&ext_ctx, NULL, NULL, req, NULL, 0);
|
||||
X509V3_set_conf_lhash(&ext_ctx, req_conf);
|
||||
|
||||
/* Add extensions */
|
||||
if(req_exts && !X509V3_EXT_REQ_add_conf(req_conf,
|
||||
&ext_ctx, req_exts, req))
|
||||
{
|
||||
BIO_printf(bio_err,
|
||||
"Error Loading extension section %s\n",
|
||||
req_exts);
|
||||
goto end;
|
||||
}
|
||||
if (!(i=X509_REQ_sign(req,pkey,digest)))
|
||||
goto end;
|
||||
}
|
||||
@@ -767,9 +837,10 @@ loop:
|
||||
{
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i=i2d_X509_REQ_bio(out,req);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i=PEM_write_bio_X509_REQ(out,req);
|
||||
else {
|
||||
else if (outformat == FORMAT_PEM) {
|
||||
if(newhdr) i=PEM_write_bio_X509_REQ_NEW(out,req);
|
||||
else i=PEM_write_bio_X509_REQ(out,req);
|
||||
} else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
}
|
||||
@@ -807,7 +878,8 @@ end:
|
||||
EVP_PKEY_free(pkey);
|
||||
X509_REQ_free(req);
|
||||
X509_free(x509ss);
|
||||
X509V3_EXT_cleanup();
|
||||
if(passin) Free(passin);
|
||||
if(passout) Free(passout);
|
||||
OBJ_cleanup();
|
||||
#ifndef NO_DSA
|
||||
if (dsa_params != NULL) DSA_free(dsa_params);
|
||||
@@ -818,43 +890,67 @@ end:
|
||||
static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
|
||||
{
|
||||
int ret=0,i;
|
||||
char *p,*q;
|
||||
X509_REQ_INFO *ri;
|
||||
char buf[100];
|
||||
int nid,min,max;
|
||||
char *type,*def,*tmp,*value,*tmp_attr;
|
||||
STACK_OF(CONF_VALUE) *sk, *attr=NULL;
|
||||
CONF_VALUE *v;
|
||||
|
||||
tmp=CONF_get_string(req_conf,SECTION,DISTINGUISHED_NAME);
|
||||
if (tmp == NULL)
|
||||
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);
|
||||
if((tmp != NULL) && !strcmp(tmp, "no")) no_prompt = 1;
|
||||
|
||||
dn_sect=CONF_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;
|
||||
}
|
||||
sk=CONF_get_section(req_conf,tmp);
|
||||
if (sk == NULL)
|
||||
dn_sk=CONF_get_section(req_conf,dn_sect);
|
||||
if (dn_sk == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to get '%s' section\n",tmp);
|
||||
BIO_printf(bio_err,"unable to get '%s' section\n",dn_sect);
|
||||
goto err;
|
||||
}
|
||||
|
||||
tmp_attr=CONF_get_string(req_conf,SECTION,ATTRIBUTES);
|
||||
if (tmp_attr == NULL)
|
||||
attr=NULL;
|
||||
attr_sect=CONF_get_string(req_conf,SECTION,ATTRIBUTES);
|
||||
if (attr_sect == NULL)
|
||||
attr_sk=NULL;
|
||||
else
|
||||
{
|
||||
attr=CONF_get_section(req_conf,tmp_attr);
|
||||
if (attr == NULL)
|
||||
attr_sk=CONF_get_section(req_conf,attr_sect);
|
||||
if (attr_sk == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to get '%s' section\n",tmp_attr);
|
||||
BIO_printf(bio_err,"unable to get '%s' section\n",attr_sect);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
ri=req->req_info;
|
||||
/* setup version number */
|
||||
if (!X509_REQ_set_version(req,0L)) goto err; /* version 1 */
|
||||
|
||||
if(no_prompt) i = auto_info(req, dn_sk, attr_sk, attribs);
|
||||
else i = prompt_info(req, dn_sk, dn_sect, attr_sk, attr_sect, attribs);
|
||||
if(!i) goto err;
|
||||
|
||||
X509_REQ_set_pubkey(req,pkey);
|
||||
|
||||
ret=1;
|
||||
err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
int i;
|
||||
char *p,*q;
|
||||
char buf[100];
|
||||
int nid,min,max;
|
||||
char *type,*def,*value;
|
||||
CONF_VALUE *v;
|
||||
X509_NAME *subj;
|
||||
subj = X509_REQ_get_subject_name(req);
|
||||
BIO_printf(bio_err,"You are about to be asked to enter information that will be incorporated\n");
|
||||
BIO_printf(bio_err,"into your certificate request.\n");
|
||||
BIO_printf(bio_err,"What you are about to enter is what is called a Distinguished Name or a DN.\n");
|
||||
@@ -863,18 +959,16 @@ static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs)
|
||||
BIO_printf(bio_err,"If you enter '.', the field will be left blank.\n");
|
||||
BIO_printf(bio_err,"-----\n");
|
||||
|
||||
/* setup version number */
|
||||
if (!ASN1_INTEGER_set(ri->version,0L)) goto err; /* version 1 */
|
||||
|
||||
if (sk_CONF_VALUE_num(sk))
|
||||
if (sk_CONF_VALUE_num(dn_sk))
|
||||
{
|
||||
i= -1;
|
||||
start: for (;;)
|
||||
{
|
||||
i++;
|
||||
if (sk_CONF_VALUE_num(sk) <= i) break;
|
||||
if (sk_CONF_VALUE_num(dn_sk) <= i) break;
|
||||
|
||||
v=sk_CONF_VALUE_value(sk,i);
|
||||
v=sk_CONF_VALUE_value(dn_sk,i);
|
||||
p=q=NULL;
|
||||
type=v->name;
|
||||
if(!check_end(type,"_min") || !check_end(type,"_max") ||
|
||||
@@ -893,32 +987,32 @@ 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,tmp,buf)) == NULL)
|
||||
if ((def=CONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
def="";
|
||||
|
||||
sprintf(buf,"%s_value",v->name);
|
||||
if ((value=CONF_get_string(req_conf,tmp,buf)) == NULL)
|
||||
if ((value=CONF_get_string(req_conf,dn_sect,buf)) == NULL)
|
||||
value=NULL;
|
||||
|
||||
sprintf(buf,"%s_min",v->name);
|
||||
min=(int)CONF_get_number(req_conf,tmp,buf);
|
||||
min=(int)CONF_get_number(req_conf,dn_sect,buf);
|
||||
|
||||
sprintf(buf,"%s_max",v->name);
|
||||
max=(int)CONF_get_number(req_conf,tmp,buf);
|
||||
max=(int)CONF_get_number(req_conf,dn_sect,buf);
|
||||
|
||||
if (!add_DN_object(ri->subject,v->value,def,value,nid,
|
||||
if (!add_DN_object(subj,v->value,def,value,nid,
|
||||
min,max))
|
||||
goto err;
|
||||
return 0;
|
||||
}
|
||||
if (sk_X509_NAME_ENTRY_num(ri->subject->entries) == 0)
|
||||
if (X509_NAME_entry_count(subj) == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"error, no objects specified in config file\n");
|
||||
goto err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (attribs)
|
||||
{
|
||||
if ((attr != NULL) && (sk_CONF_VALUE_num(attr) > 0))
|
||||
if ((attr_sk != NULL) && (sk_CONF_VALUE_num(attr_sk) > 0))
|
||||
{
|
||||
BIO_printf(bio_err,"\nPlease enter the following 'extra' attributes\n");
|
||||
BIO_printf(bio_err,"to be sent with your certificate request\n");
|
||||
@@ -928,117 +1022,100 @@ start: for (;;)
|
||||
start2: for (;;)
|
||||
{
|
||||
i++;
|
||||
if ((attr == NULL) ||
|
||||
(sk_CONF_VALUE_num(attr) <= i))
|
||||
if ((attr_sk == NULL) ||
|
||||
(sk_CONF_VALUE_num(attr_sk) <= i))
|
||||
break;
|
||||
|
||||
v=sk_CONF_VALUE_value(attr,i);
|
||||
v=sk_CONF_VALUE_value(attr_sk,i);
|
||||
type=v->name;
|
||||
if ((nid=OBJ_txt2nid(type)) == NID_undef)
|
||||
goto start2;
|
||||
|
||||
sprintf(buf,"%s_default",type);
|
||||
if ((def=CONF_get_string(req_conf,tmp_attr,buf))
|
||||
if ((def=CONF_get_string(req_conf,attr_sect,buf))
|
||||
== NULL)
|
||||
def="";
|
||||
|
||||
sprintf(buf,"%s_value",type);
|
||||
if ((value=CONF_get_string(req_conf,tmp_attr,buf))
|
||||
if ((value=CONF_get_string(req_conf,attr_sect,buf))
|
||||
== NULL)
|
||||
value=NULL;
|
||||
|
||||
sprintf(buf,"%s_min",type);
|
||||
min=(int)CONF_get_number(req_conf,tmp_attr,buf);
|
||||
min=(int)CONF_get_number(req_conf,attr_sect,buf);
|
||||
|
||||
sprintf(buf,"%s_max",type);
|
||||
max=(int)CONF_get_number(req_conf,tmp_attr,buf);
|
||||
max=(int)CONF_get_number(req_conf,attr_sect,buf);
|
||||
|
||||
if (!add_attribute_object(ri->attributes,
|
||||
if (!add_attribute_object(req,
|
||||
v->value,def,value,nid,min,max))
|
||||
goto err;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_err,"No template, please set one up.\n");
|
||||
goto err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
X509_REQ_set_pubkey(req,pkey);
|
||||
return 1;
|
||||
|
||||
ret=1;
|
||||
err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
|
||||
STACK_OF(CONF_VALUE) *attr_sk, int attribs)
|
||||
{
|
||||
int i;
|
||||
char *p,*q;
|
||||
char *type;
|
||||
CONF_VALUE *v;
|
||||
X509_NAME *subj;
|
||||
|
||||
subj = X509_REQ_get_subject_name(req);
|
||||
|
||||
for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++)
|
||||
{
|
||||
v=sk_CONF_VALUE_value(dn_sk,i);
|
||||
p=q=NULL;
|
||||
type=v->name;
|
||||
/* Skip past any leading X. X: X, etc to allow for
|
||||
* multiple instances
|
||||
*/
|
||||
for(p = v->name; *p ; p++)
|
||||
if ((*p == ':') || (*p == ',') || (*p == '.')) {
|
||||
p++;
|
||||
if(*p) type = p;
|
||||
break;
|
||||
}
|
||||
if (!X509_NAME_add_entry_by_txt(subj,type, MBSTRING_ASC,
|
||||
(unsigned char *) v->value,-1,-1,0)) return 0;
|
||||
|
||||
}
|
||||
|
||||
if (!X509_NAME_entry_count(subj))
|
||||
{
|
||||
BIO_printf(bio_err,"error, no objects specified in config file\n");
|
||||
return 0;
|
||||
}
|
||||
if (attribs)
|
||||
{
|
||||
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,
|
||||
(unsigned char *)v->value, -1)) return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,
|
||||
int nid, int min, int max)
|
||||
{
|
||||
int i,j,ret=0;
|
||||
X509_NAME_ENTRY *ne=NULL;
|
||||
int i,ret=0;
|
||||
MS_STATIC char buf[1024];
|
||||
|
||||
BIO_printf(bio_err,"%s [%s]:",text,def);
|
||||
(void)BIO_flush(bio_err);
|
||||
if (value != NULL)
|
||||
{
|
||||
strcpy(buf,value);
|
||||
strcat(buf,"\n");
|
||||
BIO_printf(bio_err,"%s\n",value);
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[0]='\0';
|
||||
fgets(buf,1024,stdin);
|
||||
}
|
||||
|
||||
if (buf[0] == '\0') return(0);
|
||||
else if (buf[0] == '\n')
|
||||
{
|
||||
if ((def == NULL) || (def[0] == '\0'))
|
||||
return(1);
|
||||
strcpy(buf,def);
|
||||
strcat(buf,"\n");
|
||||
}
|
||||
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
||||
|
||||
i=strlen(buf);
|
||||
if (buf[i-1] != '\n')
|
||||
{
|
||||
BIO_printf(bio_err,"weird input :-(\n");
|
||||
return(0);
|
||||
}
|
||||
buf[--i]='\0';
|
||||
|
||||
j=ASN1_PRINTABLE_type((unsigned char *)buf,-1);
|
||||
if (req_fix_data(nid,&j,i,min,max) == 0)
|
||||
goto err;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ebcdic2ascii(buf, buf, i);
|
||||
#endif
|
||||
if ((ne=X509_NAME_ENTRY_create_by_NID(NULL,nid,j,(unsigned char *)buf,
|
||||
strlen(buf)))
|
||||
== NULL) goto err;
|
||||
if (!X509_NAME_add_entry(n,ne,X509_NAME_entry_count(n),0))
|
||||
goto err;
|
||||
|
||||
ret=1;
|
||||
err:
|
||||
if (ne != NULL) X509_NAME_ENTRY_free(ne);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int add_attribute_object(STACK_OF(X509_ATTRIBUTE) *n, char *text,
|
||||
char *def, char *value, int nid, int min,
|
||||
int max)
|
||||
{
|
||||
int i,z;
|
||||
X509_ATTRIBUTE *xa=NULL;
|
||||
static char buf[1024];
|
||||
ASN1_BIT_STRING *bs=NULL;
|
||||
ASN1_TYPE *at=NULL;
|
||||
|
||||
start:
|
||||
BIO_printf(bio_err,"%s [%s]:",text,def);
|
||||
(void)BIO_flush(bio_err);
|
||||
@@ -1072,49 +1149,71 @@ start:
|
||||
}
|
||||
buf[--i]='\0';
|
||||
|
||||
/* add object plus value */
|
||||
if ((xa=X509_ATTRIBUTE_new()) == NULL)
|
||||
goto err;
|
||||
if ((xa->value.set=sk_ASN1_TYPE_new_null()) == NULL)
|
||||
goto err;
|
||||
xa->set=1;
|
||||
#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,
|
||||
(unsigned char *) buf, -1,-1,0)) goto err;
|
||||
ret=1;
|
||||
err:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
if (xa->object != NULL) ASN1_OBJECT_free(xa->object);
|
||||
xa->object=OBJ_nid2obj(nid);
|
||||
static int add_attribute_object(X509_REQ *req, char *text,
|
||||
char *def, char *value, int nid, int min,
|
||||
int max)
|
||||
{
|
||||
int i;
|
||||
static char buf[1024];
|
||||
|
||||
if ((bs=ASN1_BIT_STRING_new()) == NULL) goto err;
|
||||
|
||||
bs->type=ASN1_PRINTABLE_type((unsigned char *)buf,-1);
|
||||
|
||||
z=req_fix_data(nid,&bs->type,i,min,max);
|
||||
if (z == 0)
|
||||
start:
|
||||
BIO_printf(bio_err,"%s [%s]:",text,def);
|
||||
(void)BIO_flush(bio_err);
|
||||
if (value != NULL)
|
||||
{
|
||||
if (value == NULL)
|
||||
goto start;
|
||||
else goto err;
|
||||
strcpy(buf,value);
|
||||
strcat(buf,"\n");
|
||||
BIO_printf(bio_err,"%s\n",value);
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[0]='\0';
|
||||
fgets(buf,1024,stdin);
|
||||
}
|
||||
|
||||
if (!ASN1_STRING_set(bs,(unsigned char *)buf,i+1))
|
||||
{ BIO_printf(bio_err,"Malloc failure\n"); goto err; }
|
||||
if (buf[0] == '\0') return(0);
|
||||
else if (buf[0] == '\n')
|
||||
{
|
||||
if ((def == NULL) || (def[0] == '\0'))
|
||||
return(1);
|
||||
strcpy(buf,def);
|
||||
strcat(buf,"\n");
|
||||
}
|
||||
else if ((buf[0] == '.') && (buf[1] == '\n')) return(1);
|
||||
|
||||
if ((at=ASN1_TYPE_new()) == NULL)
|
||||
{ BIO_printf(bio_err,"Malloc failure\n"); goto err; }
|
||||
i=strlen(buf);
|
||||
if (buf[i-1] != '\n')
|
||||
{
|
||||
BIO_printf(bio_err,"weird input :-(\n");
|
||||
return(0);
|
||||
}
|
||||
buf[--i]='\0';
|
||||
if(!req_check_len(i, min, max)) goto start;
|
||||
|
||||
ASN1_TYPE_set(at,bs->type,(char *)bs);
|
||||
sk_ASN1_TYPE_push(xa->value.set,at);
|
||||
bs=NULL;
|
||||
at=NULL;
|
||||
/* only one item per attribute */
|
||||
if(!X509_REQ_add1_attr_by_NID(req, nid, MBSTRING_ASC,
|
||||
(unsigned char *)buf, -1)) {
|
||||
BIO_printf(bio_err, "Error adding attribute\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!sk_X509_ATTRIBUTE_push(n,xa)) goto err;
|
||||
return(1);
|
||||
err:
|
||||
if (xa != NULL) X509_ATTRIBUTE_free(xa);
|
||||
if (at != NULL) ASN1_TYPE_free(at);
|
||||
if (bs != NULL) ASN1_BIT_STRING_free(bs);
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifndef NO_RSA
|
||||
static void MS_CALLBACK req_cb(int p, int n, void *arg)
|
||||
{
|
||||
char c='*';
|
||||
@@ -1129,26 +1228,10 @@ static void MS_CALLBACK req_cb(int p, int n, void *arg)
|
||||
p=n;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static int req_fix_data(int nid, int *type, int len, int min, int max)
|
||||
static int req_check_len(int len, int min, int max)
|
||||
{
|
||||
if (nid == NID_pkcs9_emailAddress)
|
||||
*type=V_ASN1_IA5STRING;
|
||||
if ((nid == NID_commonName) && (*type == V_ASN1_IA5STRING))
|
||||
*type=V_ASN1_T61STRING;
|
||||
if ((nid == NID_pkcs9_challengePassword) &&
|
||||
(*type == V_ASN1_IA5STRING))
|
||||
*type=V_ASN1_T61STRING;
|
||||
|
||||
if ((nid == NID_pkcs9_unstructuredName) &&
|
||||
(*type == V_ASN1_T61STRING))
|
||||
{
|
||||
BIO_printf(bio_err,"invalid characters in string, please re-enter the string\n");
|
||||
return(0);
|
||||
}
|
||||
if (nid == NID_pkcs9_unstructuredName)
|
||||
*type=V_ASN1_IA5STRING;
|
||||
|
||||
if (len < min)
|
||||
{
|
||||
BIO_printf(bio_err,"string is too short, it needs to be at least %d bytes long\n",min);
|
||||
|
||||
119
apps/rsa.c
119
apps/rsa.c
@@ -82,8 +82,12 @@
|
||||
* -text - print a text version
|
||||
* -modulus - print the RSA key modulus
|
||||
* -check - verify key consistency
|
||||
* -pubin - Expect a public key in input file.
|
||||
* -pubout - Output a public key.
|
||||
*/
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
@@ -92,7 +96,10 @@ int MAIN(int argc, char **argv)
|
||||
const EVP_CIPHER *enc=NULL;
|
||||
BIO *in=NULL,*out=NULL;
|
||||
int informat,outformat,text=0,check=0,noout=0;
|
||||
int pubin = 0, pubout = 0;
|
||||
char *infile,*outfile,*prog;
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
int modulus=0;
|
||||
|
||||
apps_startup();
|
||||
@@ -131,6 +138,20 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passin") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargin= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passout") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargout= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-pubin") == 0)
|
||||
pubin=1;
|
||||
else if (strcmp(*argv,"-pubout") == 0)
|
||||
pubout=1;
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
@@ -154,24 +175,39 @@ int MAIN(int argc, char **argv)
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);
|
||||
BIO_printf(bio_err,"where options are\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER NET PEM\n");
|
||||
BIO_printf(bio_err," -outform arg output format - one of DER NET PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
BIO_printf(bio_err," -inform arg input format - one of DER NET PEM\n");
|
||||
BIO_printf(bio_err," -outform arg output format - one of DER NET PEM\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||
#ifndef NO_IDEA
|
||||
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||
BIO_printf(bio_err," -idea encrypt PEM output with cbc idea\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -noout don't print key out\n");
|
||||
BIO_printf(bio_err," -modulus print the RSA key modulus\n");
|
||||
BIO_printf(bio_err," -check verify key consistency\n");
|
||||
BIO_printf(bio_err," -text print the key in text\n");
|
||||
BIO_printf(bio_err," -noout don't print key out\n");
|
||||
BIO_printf(bio_err," -modulus print the RSA key modulus\n");
|
||||
BIO_printf(bio_err," -check verify key consistency\n");
|
||||
BIO_printf(bio_err," -pubin expect a public key in input file\n");
|
||||
BIO_printf(bio_err," -pubout output a public key\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(check && pubin) {
|
||||
BIO_printf(bio_err, "Only private keys can be checked\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
out=BIO_new(BIO_s_file());
|
||||
if ((in == NULL) || (out == NULL))
|
||||
@@ -191,9 +227,11 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
BIO_printf(bio_err,"read RSA private key\n");
|
||||
if (informat == FORMAT_ASN1)
|
||||
rsa=d2i_RSAPrivateKey_bio(in,NULL);
|
||||
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);
|
||||
}
|
||||
#ifndef NO_RC4
|
||||
else if (informat == FORMAT_NETSCAPE)
|
||||
{
|
||||
@@ -217,12 +255,14 @@ bad:
|
||||
}
|
||||
}
|
||||
p=(unsigned char *)buf->data;
|
||||
rsa=(RSA *)d2i_Netscape_RSA(NULL,&p,(long)size,NULL);
|
||||
rsa=d2i_Netscape_RSA(NULL,&p,(long)size,NULL);
|
||||
BUF_MEM_free(buf);
|
||||
}
|
||||
#endif
|
||||
else if (informat == FORMAT_PEM)
|
||||
rsa=PEM_read_bio_RSAPrivateKey(in,NULL,NULL,NULL);
|
||||
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");
|
||||
@@ -230,7 +270,7 @@ bad:
|
||||
}
|
||||
if (rsa == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to load Private Key\n");
|
||||
BIO_printf(bio_err,"unable to load key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -256,9 +296,9 @@ bad:
|
||||
|
||||
if (modulus)
|
||||
{
|
||||
fprintf(stdout,"Modulus=");
|
||||
BIO_printf(out,"Modulus=");
|
||||
BN_print(out,rsa->n);
|
||||
fprintf(stdout,"\n");
|
||||
BIO_printf(out,"\n");
|
||||
}
|
||||
|
||||
if (check)
|
||||
@@ -288,10 +328,16 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if (noout) goto end;
|
||||
BIO_printf(bio_err,"writing RSA private key\n");
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i=i2d_RSAPrivateKey_bio(out,rsa);
|
||||
if (noout)
|
||||
{
|
||||
ret = 0;
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_err,"writing RSA key\n");
|
||||
if (outformat == FORMAT_ASN1) {
|
||||
if(pubout || pubin) i=i2d_RSA_PUBKEY_bio(out,rsa);
|
||||
else i=i2d_RSAPrivateKey_bio(out,rsa);
|
||||
}
|
||||
#ifndef NO_RC4
|
||||
else if (outformat == FORMAT_NETSCAPE)
|
||||
{
|
||||
@@ -311,23 +357,34 @@ bad:
|
||||
Free(pp);
|
||||
}
|
||||
#endif
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i=PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,NULL,NULL);
|
||||
else {
|
||||
else if (outformat == FORMAT_PEM) {
|
||||
if(pubout || pubin)
|
||||
i=PEM_write_bio_RSA_PUBKEY(out,rsa);
|
||||
else i=PEM_write_bio_RSAPrivateKey(out,rsa,
|
||||
enc,NULL,0,NULL,passout);
|
||||
} else {
|
||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||
goto end;
|
||||
}
|
||||
if (!i)
|
||||
{
|
||||
BIO_printf(bio_err,"unable to write private key\n");
|
||||
BIO_printf(bio_err,"unable to write key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
else
|
||||
ret=0;
|
||||
end:
|
||||
if (in != NULL) BIO_free(in);
|
||||
if (out != NULL) BIO_free(out);
|
||||
if (rsa != NULL) RSA_free(rsa);
|
||||
if(in != NULL) BIO_free(in);
|
||||
if(out != NULL) BIO_free(out);
|
||||
if(rsa != NULL) RSA_free(rsa);
|
||||
if(passin) Free(passin);
|
||||
if(passout) Free(passout);
|
||||
EXIT(ret);
|
||||
}
|
||||
#else /* !NO_RSA */
|
||||
|
||||
# if PEDANTIC
|
||||
static void *dummy=&dummy;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,9 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifdef APPS_CRLF
|
||||
# include <assert.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -83,15 +81,16 @@ typedef unsigned int u_int;
|
||||
#include <openssl/pem.h>
|
||||
#include "s_apps.h"
|
||||
|
||||
#ifdef WINDOWS
|
||||
#include <conio.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(VMS) && __VMS_VER < 70000000)
|
||||
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
||||
#undef FIONBIO
|
||||
#endif
|
||||
|
||||
#if defined(NO_RSA) && !defined(NO_SSL2)
|
||||
#define NO_SSL2
|
||||
#endif
|
||||
|
||||
#undef PROG
|
||||
#define PROG s_client_main
|
||||
|
||||
@@ -142,20 +141,20 @@ static void sc_usage(void)
|
||||
#ifdef FIONBIO
|
||||
BIO_printf(bio_err," -nbio - Run with non-blocking IO\n");
|
||||
#endif
|
||||
#ifdef APPS_CRLF /* won't be #ifdef'd in next release */
|
||||
BIO_printf(bio_err," -crlf - convert LF from terminal into CRLF\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -quiet - no s_client output\n");
|
||||
BIO_printf(bio_err," -ssl2 - just use SSLv2\n");
|
||||
BIO_printf(bio_err," -ssl3 - just use SSLv3\n");
|
||||
BIO_printf(bio_err," -tls1 - just use TLSv1\n");
|
||||
BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n");
|
||||
BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n");
|
||||
BIO_printf(bio_err," -cipher - prefered cipher to use, use the 'openssl ciphers'\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");
|
||||
|
||||
}
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int off=0;
|
||||
@@ -171,15 +170,16 @@ int MAIN(int argc, char **argv)
|
||||
char *cert_file=NULL,*key_file=NULL;
|
||||
char *CApath=NULL,*CAfile=NULL,*cipher=NULL;
|
||||
int reconnect=0,badop=0,verify=SSL_VERIFY_NONE,bugs=0;
|
||||
#ifdef APPS_CRLF
|
||||
int crlf=0;
|
||||
#endif
|
||||
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;
|
||||
SSL_METHOD *meth=NULL;
|
||||
BIO *sbio;
|
||||
/*static struct timeval timeout={10,0};*/
|
||||
#ifdef WINDOWS
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
#if !defined(NO_SSL2) && !defined(NO_SSL3)
|
||||
meth=SSLv23_client_method();
|
||||
@@ -244,10 +244,10 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
cert_file= *(++argv);
|
||||
}
|
||||
#ifdef APPS_CRLF
|
||||
else if (strcmp(*argv,"-prexit") == 0)
|
||||
prexit=1;
|
||||
else if (strcmp(*argv,"-crlf") == 0)
|
||||
crlf=1;
|
||||
#endif
|
||||
else if (strcmp(*argv,"-quiet") == 0)
|
||||
c_quiet=1;
|
||||
else if (strcmp(*argv,"-pause") == 0)
|
||||
@@ -324,6 +324,8 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
|
||||
if (bio_c_out == NULL)
|
||||
{
|
||||
if (c_quiet)
|
||||
@@ -337,7 +339,8 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
SSLeay_add_ssl_algorithms();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
SSL_load_error_strings();
|
||||
ctx=SSL_CTX_new(meth);
|
||||
if (ctx == NULL)
|
||||
{
|
||||
@@ -352,7 +355,11 @@ bad:
|
||||
|
||||
if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
|
||||
if (cipher != NULL)
|
||||
SSL_CTX_set_cipher_list(ctx,cipher);
|
||||
if(!SSL_CTX_set_cipher_list(ctx,cipher)) {
|
||||
BIO_printf(bio_err,"error setting cipher list\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
#if 0
|
||||
else
|
||||
SSL_CTX_set_cipher_list(ctx,getenv("SSL_CIPHER"));
|
||||
@@ -365,14 +372,13 @@ bad:
|
||||
if ((!SSL_CTX_load_verify_locations(ctx,CAfile,CApath)) ||
|
||||
(!SSL_CTX_set_default_verify_paths(ctx)))
|
||||
{
|
||||
/* BIO_printf(bio_err,"error seting default verify locations\n"); */
|
||||
/* BIO_printf(bio_err,"error setting default verify locations\n"); */
|
||||
ERR_print_errors(bio_err);
|
||||
/* goto end; */
|
||||
}
|
||||
|
||||
SSL_load_error_strings();
|
||||
|
||||
con=(SSL *)SSL_new(ctx);
|
||||
con=SSL_new(ctx);
|
||||
/* SSL_set_cipher_list(con,"RC4-MD5"); */
|
||||
|
||||
re_start:
|
||||
@@ -473,12 +479,18 @@ re_start:
|
||||
if (read_tty) FD_SET(fileno(stdin),&readfds);
|
||||
if (write_tty) FD_SET(fileno(stdout),&writefds);
|
||||
}
|
||||
#endif
|
||||
if (read_ssl)
|
||||
FD_SET(SSL_get_fd(con),&readfds);
|
||||
if (write_ssl)
|
||||
FD_SET(SSL_get_fd(con),&writefds);
|
||||
|
||||
#else
|
||||
if(!tty_on || !write_tty) {
|
||||
if (read_ssl)
|
||||
FD_SET(SSL_get_fd(con),&readfds);
|
||||
if (write_ssl)
|
||||
FD_SET(SSL_get_fd(con),&writefds);
|
||||
}
|
||||
#endif
|
||||
/* printf("mode tty(%d %d%d) ssl(%d%d)\n",
|
||||
tty_on,read_tty,write_tty,read_ssl,write_ssl);*/
|
||||
|
||||
@@ -488,8 +500,29 @@ re_start:
|
||||
* will choke the compiler: if you do have a cast then
|
||||
* you can either go for (int *) or (void *).
|
||||
*/
|
||||
#ifdef WINDOWS
|
||||
/* Under Windows we make the assumption that we can
|
||||
* always write to the tty: therefore if we need to
|
||||
* write to the tty we just fall through. Otherwise
|
||||
* we timeout the select every second and see if there
|
||||
* are any keypresses. Note: this is a hack, in a proper
|
||||
* Windows application we wouldn't do this.
|
||||
*/
|
||||
i=0;
|
||||
if(!write_tty) {
|
||||
if(read_tty) {
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,&tv);
|
||||
if(!i && (!_kbhit() || !read_tty) ) continue;
|
||||
} else i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,NULL);
|
||||
}
|
||||
#else
|
||||
i=select(width,(void *)&readfds,(void *)&writefds,
|
||||
NULL,NULL);
|
||||
#endif
|
||||
if ( i < 0)
|
||||
{
|
||||
BIO_printf(bio_err,"bad select %d\n",
|
||||
@@ -566,8 +599,12 @@ re_start:
|
||||
goto shut;
|
||||
}
|
||||
}
|
||||
#ifndef WINDOWS
|
||||
#ifdef WINDOWS
|
||||
/* Assume Windows can always write */
|
||||
else if (!ssl_pending && write_tty)
|
||||
#else
|
||||
else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
|
||||
#endif
|
||||
{
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ascii2ebcdic(&(sbuf[sbuf_off]),&(sbuf[sbuf_off]),sbuf_len);
|
||||
@@ -589,7 +626,6 @@ re_start:
|
||||
write_tty=0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (ssl_pending || FD_ISSET(SSL_get_fd(con),&readfds))
|
||||
{
|
||||
#ifdef RENEG
|
||||
@@ -644,10 +680,12 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef WINDOWS
|
||||
#ifdef WINDOWS
|
||||
else if (_kbhit())
|
||||
#else
|
||||
else if (FD_ISSET(fileno(stdin),&readfds))
|
||||
#endif
|
||||
{
|
||||
#ifdef APPS_CRLF
|
||||
if (crlf)
|
||||
{
|
||||
int j, lf_num;
|
||||
@@ -671,7 +709,6 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
assert(lf_num == 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
i=read(fileno(stdin),cbuf,BUFSIZZ);
|
||||
|
||||
if ((!c_quiet) && ((i <= 0) || (cbuf[0] == 'Q')))
|
||||
@@ -698,13 +735,13 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
||||
write_ssl=1;
|
||||
read_tty=0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
shut:
|
||||
SSL_shutdown(con);
|
||||
SHUTDOWN(SSL_get_fd(con));
|
||||
ret=0;
|
||||
end:
|
||||
if(prexit) print_stuff(bio_c_out,con,1);
|
||||
if (con != NULL) SSL_free(con);
|
||||
if (con2 != NULL) SSL_free(con2);
|
||||
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||
|
||||
144
apps/s_server.c
144
apps/s_server.c
@@ -56,9 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifdef APPS_CRLF
|
||||
# include <assert.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -87,15 +85,15 @@ typedef unsigned int u_int;
|
||||
#include <openssl/ssl.h>
|
||||
#include "s_apps.h"
|
||||
|
||||
#ifdef WINDOWS
|
||||
#include <conio.h>
|
||||
#endif
|
||||
|
||||
#if (defined(VMS) && __VMS_VER < 70000000)
|
||||
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
||||
#undef FIONBIO
|
||||
#endif
|
||||
|
||||
#if defined(NO_RSA) && !defined(NO_SSL2)
|
||||
#define NO_SSL2
|
||||
#endif
|
||||
|
||||
#ifndef NO_RSA
|
||||
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength);
|
||||
#endif
|
||||
@@ -106,10 +104,12 @@ static void sv_usage(void);
|
||||
static int init_ssl_connection(SSL *s);
|
||||
static void print_stats(BIO *bp,SSL_CTX *ctx);
|
||||
#ifndef NO_DH
|
||||
static DH *load_dh_param(void );
|
||||
static DH *load_dh_param(char *dhfile);
|
||||
static DH *get_dh512(void);
|
||||
#endif
|
||||
/* static void s_server_init(void);*/
|
||||
#ifdef MONOLITH
|
||||
static void s_server_init(void);
|
||||
#endif
|
||||
|
||||
#ifndef S_ISDIR
|
||||
# if defined(_S_IFMT) && defined(_S_IFDIR)
|
||||
@@ -149,15 +149,13 @@ static DH *get_dh512(void)
|
||||
|
||||
#undef BUFSIZZ
|
||||
#define BUFSIZZ 16*1024
|
||||
static int bufsize=32;
|
||||
static int bufsize=BUFSIZZ;
|
||||
static int accept_socket= -1;
|
||||
|
||||
#define TEST_CERT "server.pem"
|
||||
#undef PROG
|
||||
#define PROG s_server_main
|
||||
|
||||
#define DH_PARAM "server.pem"
|
||||
|
||||
extern int verify_depth;
|
||||
|
||||
static char *cipher=NULL;
|
||||
@@ -169,9 +167,7 @@ static char *s_dcert_file=NULL,*s_dkey_file=NULL;
|
||||
static int s_nbio=0;
|
||||
#endif
|
||||
static int s_nbio_test=0;
|
||||
#ifdef APPS_CRLF /* won't be #ifdef'd in next release */
|
||||
int s_crlf=0;
|
||||
#endif
|
||||
static SSL_CTX *ctx=NULL;
|
||||
static int www=0;
|
||||
|
||||
@@ -179,9 +175,12 @@ static BIO *bio_s_out=NULL;
|
||||
static int s_debug=0;
|
||||
static int s_quiet=0;
|
||||
|
||||
#if 0
|
||||
static int hack=0;
|
||||
|
||||
#ifdef MONOLITH
|
||||
static void s_server_init(void)
|
||||
{
|
||||
accept_socket=-1;
|
||||
cipher=NULL;
|
||||
s_server_verify=SSL_VERIFY_NONE;
|
||||
s_dcert_file=NULL;
|
||||
@@ -198,6 +197,7 @@ static void s_server_init(void)
|
||||
bio_s_out=NULL;
|
||||
s_debug=0;
|
||||
s_quiet=0;
|
||||
hack=0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -211,17 +211,17 @@ static void sv_usage(void)
|
||||
BIO_printf(bio_err," -Verify arg - turn on peer certificate verification, must have a cert.\n");
|
||||
BIO_printf(bio_err," -cert arg - certificate file to use, PEM format assumed\n");
|
||||
BIO_printf(bio_err," (default is %s)\n",TEST_CERT);
|
||||
BIO_printf(bio_err," -key arg - RSA file to use, PEM format assumed, in cert file if\n");
|
||||
BIO_printf(bio_err," -key arg - Private Key file to use, PEM format assumed, in cert file if\n");
|
||||
BIO_printf(bio_err," not specified (default is %s)\n",TEST_CERT);
|
||||
BIO_printf(bio_err," -dcert arg - second certificate file to use (usually for DSA)\n");
|
||||
BIO_printf(bio_err," -dkey arg - second private key file to use (usually for DSA)\n");
|
||||
BIO_printf(bio_err," -dhparam arg - DH parameter file to use, in cert file if not specified\n");
|
||||
BIO_printf(bio_err," or a default set of parameters is used\n");
|
||||
#ifdef FIONBIO
|
||||
BIO_printf(bio_err," -nbio - Run with non-blocking IO\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -nbio_test - test with the non-blocking test bio\n");
|
||||
#ifdef APPS_CRLF
|
||||
BIO_printf(bio_err," -crlf - convert LF from terminal into CRLF\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -debug - Print more output\n");
|
||||
BIO_printf(bio_err," -state - Print the SSL states\n");
|
||||
BIO_printf(bio_err," -CApath arg - PEM format directory of CA's\n");
|
||||
@@ -239,14 +239,13 @@ static void sv_usage(void)
|
||||
#ifndef NO_DH
|
||||
BIO_printf(bio_err," -no_dhe - Disable ephemeral DH\n");
|
||||
#endif
|
||||
BIO_printf(bio_err," -bugs - Turn on SSL bug compatability\n");
|
||||
BIO_printf(bio_err," -bugs - Turn on SSL bug compatibility\n");
|
||||
BIO_printf(bio_err," -www - Respond to a 'GET /' with a status page\n");
|
||||
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
||||
}
|
||||
|
||||
static int local_argc=0;
|
||||
static char **local_argv;
|
||||
static int hack=0;
|
||||
|
||||
#ifdef CHARSET_EBCDIC
|
||||
static int ebcdic_new(BIO *bi);
|
||||
@@ -337,7 +336,7 @@ static int ebcdic_write(BIO *b, char *in, int inl)
|
||||
num = num + num; /* double the size */
|
||||
if (num < inl)
|
||||
num = inl;
|
||||
Free((char*)wbuf);
|
||||
Free(wbuf);
|
||||
wbuf=(EBCDIC_OUTBUFF *)Malloc(sizeof(EBCDIC_OUTBUFF) + num);
|
||||
|
||||
wbuf->alloced = num;
|
||||
@@ -398,11 +397,14 @@ static int ebcdic_puts(BIO *bp, char *str)
|
||||
}
|
||||
#endif
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char *argv[])
|
||||
{
|
||||
short port=PORT;
|
||||
char *CApath=NULL,*CAfile=NULL;
|
||||
char *context = NULL;
|
||||
char *dhfile = NULL;
|
||||
int badop=0,bugs=0;
|
||||
int ret=1;
|
||||
int off=0;
|
||||
@@ -425,8 +427,9 @@ int MAIN(int argc, char *argv[])
|
||||
local_argv=argv;
|
||||
|
||||
apps_startup();
|
||||
s_quiet=0;
|
||||
s_debug=0;
|
||||
#ifdef MONOLITH
|
||||
s_server_init();
|
||||
#endif
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
@@ -479,6 +482,11 @@ int MAIN(int argc, char *argv[])
|
||||
if (--argc < 1) goto bad;
|
||||
s_key_file= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-dhparam") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
dhfile = *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-dcert") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -525,10 +533,8 @@ int MAIN(int argc, char *argv[])
|
||||
{ hack=1; }
|
||||
else if (strcmp(*argv,"-state") == 0)
|
||||
{ state=1; }
|
||||
#ifdef APPS_CRLF
|
||||
else if (strcmp(*argv,"-crlf") == 0)
|
||||
{ s_crlf=1; }
|
||||
#endif
|
||||
else if (strcmp(*argv,"-quiet") == 0)
|
||||
{ s_quiet=1; }
|
||||
else if (strcmp(*argv,"-bugs") == 0)
|
||||
@@ -575,6 +581,8 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
|
||||
if (bio_s_out == NULL)
|
||||
{
|
||||
if (s_quiet && !s_debug)
|
||||
@@ -599,7 +607,7 @@ bad:
|
||||
}
|
||||
|
||||
SSL_load_error_strings();
|
||||
SSLeay_add_ssl_algorithms();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
|
||||
ctx=SSL_CTX_new(meth);
|
||||
if (ctx == NULL)
|
||||
@@ -641,8 +649,7 @@ bad:
|
||||
#ifndef NO_DH
|
||||
if (!no_dhe)
|
||||
{
|
||||
/* EAY EAY EAY evil hack */
|
||||
dh=load_dh_param();
|
||||
dh=load_dh_param(dhfile ? dhfile : s_cert_file);
|
||||
if (dh != NULL)
|
||||
{
|
||||
BIO_printf(bio_s_out,"Setting temp DH parameters\n");
|
||||
@@ -692,12 +699,17 @@ bad:
|
||||
#endif
|
||||
|
||||
if (cipher != NULL)
|
||||
SSL_CTX_set_cipher_list(ctx,cipher);
|
||||
if(!SSL_CTX_set_cipher_list(ctx,cipher)) {
|
||||
BIO_printf(bio_err,"error setting cipher list\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
SSL_CTX_set_verify(ctx,s_server_verify,verify_callback);
|
||||
SSL_CTX_set_session_id_context(ctx,(void*)&s_server_session_id_context,
|
||||
sizeof s_server_session_id_context);
|
||||
|
||||
SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile));
|
||||
if (CAfile != NULL)
|
||||
SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile));
|
||||
|
||||
BIO_printf(bio_s_out,"ACCEPT\n");
|
||||
if (www)
|
||||
@@ -750,6 +762,9 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
unsigned long l;
|
||||
SSL *con=NULL;
|
||||
BIO *sbio;
|
||||
#ifdef WINDOWS
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
if ((buf=Malloc(bufsize)) == NULL)
|
||||
{
|
||||
@@ -769,7 +784,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
#endif
|
||||
|
||||
if (con == NULL) {
|
||||
con=(SSL *)SSL_new(ctx);
|
||||
con=SSL_new(ctx);
|
||||
if(context)
|
||||
SSL_set_session_id_context(con, context,
|
||||
strlen((char *)context));
|
||||
@@ -798,22 +813,48 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
width=s+1;
|
||||
for (;;)
|
||||
{
|
||||
FD_ZERO(&readfds);
|
||||
#ifndef WINDOWS
|
||||
FD_SET(fileno(stdin),&readfds);
|
||||
#endif
|
||||
FD_SET(s,&readfds);
|
||||
/* Note: under VMS with SOCKETSHR the second parameter is
|
||||
* currently of type (int *) whereas under other systems
|
||||
* it is (void *) if you don't have a cast it will choke
|
||||
* the compiler: if you do have a cast then you can either
|
||||
* go for (int *) or (void *).
|
||||
*/
|
||||
i=select(width,(void *)&readfds,NULL,NULL,NULL);
|
||||
if (i <= 0) continue;
|
||||
if (FD_ISSET(fileno(stdin),&readfds))
|
||||
int read_from_terminal;
|
||||
int read_from_sslcon;
|
||||
|
||||
read_from_terminal = 0;
|
||||
read_from_sslcon = SSL_pending(con);
|
||||
|
||||
if (!read_from_sslcon)
|
||||
{
|
||||
FD_ZERO(&readfds);
|
||||
#ifndef WINDOWS
|
||||
FD_SET(fileno(stdin),&readfds);
|
||||
#endif
|
||||
FD_SET(s,&readfds);
|
||||
/* Note: under VMS with SOCKETSHR the second parameter is
|
||||
* currently of type (int *) whereas under other systems
|
||||
* it is (void *) if you don't have a cast it will choke
|
||||
* the compiler: if you do have a cast then you can either
|
||||
* go for (int *) or (void *).
|
||||
*/
|
||||
#ifdef WINDOWS
|
||||
/* Under Windows we can't select on stdin: only
|
||||
* on sockets. As a workaround we timeout the select every
|
||||
* second and check for any keypress. In a proper Windows
|
||||
* application we wouldn't do this because it is inefficient.
|
||||
*/
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
i=select(width,(void *)&readfds,NULL,NULL,&tv);
|
||||
if((i < 0) || (!i && !_kbhit() ) )continue;
|
||||
if(_kbhit())
|
||||
read_from_terminal = 1;
|
||||
#else
|
||||
i=select(width,(void *)&readfds,NULL,NULL,NULL);
|
||||
if (i <= 0) continue;
|
||||
if (FD_ISSET(fileno(stdin),&readfds))
|
||||
read_from_terminal = 1;
|
||||
#endif
|
||||
if (FD_ISSET(s,&readfds))
|
||||
read_from_sslcon = 1;
|
||||
}
|
||||
if (read_from_terminal)
|
||||
{
|
||||
#ifdef APPS_CRLF
|
||||
if (s_crlf)
|
||||
{
|
||||
int j, lf_num;
|
||||
@@ -837,7 +878,6 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
assert(lf_num == 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
i=read(fileno(stdin),buf,bufsize);
|
||||
if (!s_quiet)
|
||||
{
|
||||
@@ -926,7 +966,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
||||
if (i <= 0) break;
|
||||
}
|
||||
}
|
||||
if (FD_ISSET(s,&readfds))
|
||||
if (read_from_sslcon)
|
||||
{
|
||||
if (!SSL_is_init_finished(con))
|
||||
{
|
||||
@@ -1059,12 +1099,12 @@ static int init_ssl_connection(SSL *con)
|
||||
}
|
||||
|
||||
#ifndef NO_DH
|
||||
static DH *load_dh_param(void)
|
||||
static DH *load_dh_param(char *dhfile)
|
||||
{
|
||||
DH *ret=NULL;
|
||||
BIO *bio;
|
||||
|
||||
if ((bio=BIO_new_file(DH_PARAM,"r")) == NULL)
|
||||
if ((bio=BIO_new_file(dhfile,"r")) == NULL)
|
||||
goto err;
|
||||
ret=PEM_read_bio_DHparams(bio,NULL,NULL,NULL);
|
||||
err:
|
||||
@@ -1126,7 +1166,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
||||
/* lets make the output buffer a reasonable size */
|
||||
if (!BIO_set_write_buffer_size(io,bufsize)) goto err;
|
||||
|
||||
if ((con=(SSL *)SSL_new(ctx)) == NULL) goto err;
|
||||
if ((con=SSL_new(ctx)) == NULL) goto err;
|
||||
if(context) SSL_set_session_id_context(con, context,
|
||||
strlen((char *)context));
|
||||
|
||||
@@ -1424,7 +1464,7 @@ end:
|
||||
/* make sure we re-use sessions */
|
||||
SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
|
||||
#else
|
||||
/* This kills performace */
|
||||
/* This kills performance */
|
||||
/* SSL_shutdown(con); A shutdown gets sent in the
|
||||
* BIO_free_all(io) procession */
|
||||
#endif
|
||||
|
||||
@@ -67,10 +67,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(NO_RSA) && !defined(NO_SSL2)
|
||||
#define NO_SSL2
|
||||
#endif
|
||||
|
||||
#ifdef NO_STDIO
|
||||
#define APPS_WIN16
|
||||
#endif
|
||||
@@ -220,7 +216,7 @@ static void s_time_usage(void)
|
||||
file if not specified by this option\n\
|
||||
-CApath arg - PEM format directory of CA's\n\
|
||||
-CAfile arg - PEM format file of CA's\n\
|
||||
-cipher - prefered cipher to use, play with 'openssl ciphers'\n\n";
|
||||
-cipher - preferred cipher to use, play with 'openssl ciphers'\n\n";
|
||||
|
||||
printf( "usage: s_time <args>\n\n" );
|
||||
|
||||
@@ -229,7 +225,7 @@ static void s_time_usage(void)
|
||||
printf("-nbio - Run with non-blocking IO\n");
|
||||
printf("-ssl2 - Just use SSLv2\n");
|
||||
printf("-ssl3 - Just use SSLv3\n");
|
||||
printf("-bugs - Turn on SSL bug compatability\n");
|
||||
printf("-bugs - Turn on SSL bug compatibility\n");
|
||||
printf("-new - Just time new connections\n");
|
||||
printf("-reuse - Just time connection reuse\n");
|
||||
printf("-www page - Retrieve 'page' from the site\n");
|
||||
@@ -248,15 +244,6 @@ static int parseArgs(int argc, char **argv)
|
||||
|
||||
verify_depth=0;
|
||||
verify_error=X509_V_OK;
|
||||
#ifdef FIONBIO
|
||||
t_nbio=0;
|
||||
#endif
|
||||
|
||||
apps_startup();
|
||||
s_time_init();
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
@@ -401,6 +388,8 @@ static double tm_Time_F(int s)
|
||||
* MAIN - main processing area for client
|
||||
* real name depends on MONOLITH
|
||||
*/
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
double totalTime = 0.0;
|
||||
@@ -411,6 +400,12 @@ int MAIN(int argc, char **argv)
|
||||
MS_STATIC char buf[1024*8];
|
||||
int ver;
|
||||
|
||||
apps_startup();
|
||||
s_time_init();
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||
|
||||
#if !defined(NO_SSL2) && !defined(NO_SSL3)
|
||||
s_time_meth=SSLv23_client_method();
|
||||
#elif !defined(NO_SSL3)
|
||||
@@ -423,7 +418,7 @@ int MAIN(int argc, char **argv)
|
||||
if( parseArgs( argc, argv ) < 0 )
|
||||
goto end;
|
||||
|
||||
SSLeay_add_ssl_algorithms();
|
||||
OpenSSL_add_ssl_algorithms();
|
||||
if ((tm_ctx=SSL_CTX_new(s_time_meth)) == NULL) return(1);
|
||||
|
||||
SSL_CTX_set_quiet_shutdown(tm_ctx,1);
|
||||
@@ -438,7 +433,7 @@ int MAIN(int argc, char **argv)
|
||||
if ((!SSL_CTX_load_verify_locations(tm_ctx,CAfile,CApath)) ||
|
||||
(!SSL_CTX_set_default_verify_paths(tm_ctx)))
|
||||
{
|
||||
/* BIO_printf(bio_err,"error seting default verify locations\n"); */
|
||||
/* BIO_printf(bio_err,"error setting default verify locations\n"); */
|
||||
ERR_print_errors(bio_err);
|
||||
/* goto end; */
|
||||
}
|
||||
@@ -639,7 +634,7 @@ static SSL *doConnection(SSL *scon)
|
||||
BIO_set_conn_hostname(conn,host);
|
||||
|
||||
if (scon == NULL)
|
||||
serverCon=(SSL *)SSL_new(tm_ctx);
|
||||
serverCon=SSL_new(tm_ctx);
|
||||
else
|
||||
{
|
||||
serverCon=scon;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
static char *sess_id_usage[]={
|
||||
"usage: sess_id args\n",
|
||||
"\n",
|
||||
" -inform arg - input format - default PEM (one of DER, TXT or PEM)\n",
|
||||
" -inform arg - input format - default PEM (DER or PEM)\n",
|
||||
" -outform arg - output format - default PEM\n",
|
||||
" -in arg - input file - default stdin\n",
|
||||
" -out arg - output file - default stdout\n",
|
||||
@@ -84,6 +84,9 @@ NULL
|
||||
};
|
||||
|
||||
static SSL_SESSION *load_sess_id(char *file, int format);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
SSL_SESSION *x=NULL;
|
||||
|
||||
646
apps/smime.c
Normal file
646
apps/smime.c
Normal file
@@ -0,0 +1,646 @@
|
||||
/* smime.c */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
* project 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* 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).
|
||||
*
|
||||
*/
|
||||
|
||||
/* S/MIME utility function */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG smime_main
|
||||
static X509 *load_cert(char *file);
|
||||
static EVP_PKEY *load_key(char *file, char *pass);
|
||||
static STACK_OF(X509) *load_certs(char *file);
|
||||
static X509_STORE *setup_verify(char *CAfile, char *CApath);
|
||||
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
||||
|
||||
#define SMIME_OP 0x10
|
||||
#define SMIME_ENCRYPT (1 | SMIME_OP)
|
||||
#define SMIME_DECRYPT 2
|
||||
#define SMIME_SIGN (3 | SMIME_OP)
|
||||
#define SMIME_VERIFY 4
|
||||
#define SMIME_PK7OUT 5
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int operation = 0;
|
||||
int ret = 0;
|
||||
char **args;
|
||||
char *inmode = "r", *outmode = "w";
|
||||
char *infile = NULL, *outfile = NULL;
|
||||
char *signerfile = NULL, *recipfile = NULL;
|
||||
char *certfile = NULL, *keyfile = NULL;
|
||||
EVP_CIPHER *cipher = NULL;
|
||||
PKCS7 *p7 = NULL;
|
||||
X509_STORE *store = NULL;
|
||||
X509 *cert = NULL, *recip = NULL, *signer = NULL;
|
||||
EVP_PKEY *key = NULL;
|
||||
STACK_OF(X509) *encerts = NULL, *other = NULL;
|
||||
BIO *in = NULL, *out = NULL, *indata = NULL;
|
||||
int badarg = 0;
|
||||
int flags = PKCS7_DETACHED;
|
||||
char *to = NULL, *from = NULL, *subject = NULL;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
char *passargin = NULL, *passin = NULL;
|
||||
char *inrand = NULL;
|
||||
int need_rand = 0;
|
||||
args = argv + 1;
|
||||
|
||||
ret = 1;
|
||||
|
||||
while (!badarg && *args && *args[0] == '-') {
|
||||
if (!strcmp (*args, "-encrypt")) operation = SMIME_ENCRYPT;
|
||||
else if (!strcmp (*args, "-decrypt")) operation = SMIME_DECRYPT;
|
||||
else if (!strcmp (*args, "-sign")) operation = SMIME_SIGN;
|
||||
else if (!strcmp (*args, "-verify")) operation = SMIME_VERIFY;
|
||||
else if (!strcmp (*args, "-pk7out")) operation = SMIME_PK7OUT;
|
||||
#ifndef NO_DES
|
||||
else if (!strcmp (*args, "-des3"))
|
||||
cipher = EVP_des_ede3_cbc();
|
||||
else if (!strcmp (*args, "-des"))
|
||||
cipher = EVP_des_cbc();
|
||||
#endif
|
||||
#ifndef NO_RC2
|
||||
else if (!strcmp (*args, "-rc2-40"))
|
||||
cipher = EVP_rc2_40_cbc();
|
||||
else if (!strcmp (*args, "-rc2-128"))
|
||||
cipher = EVP_rc2_cbc();
|
||||
else if (!strcmp (*args, "-rc2-64"))
|
||||
cipher = EVP_rc2_64_cbc();
|
||||
#endif
|
||||
else if (!strcmp (*args, "-text"))
|
||||
flags |= PKCS7_TEXT;
|
||||
else if (!strcmp (*args, "-nointern"))
|
||||
flags |= PKCS7_NOINTERN;
|
||||
else if (!strcmp (*args, "-noverify"))
|
||||
flags |= PKCS7_NOVERIFY;
|
||||
else if (!strcmp (*args, "-nochain"))
|
||||
flags |= PKCS7_NOCHAIN;
|
||||
else if (!strcmp (*args, "-nocerts"))
|
||||
flags |= PKCS7_NOCERTS;
|
||||
else if (!strcmp (*args, "-noattr"))
|
||||
flags |= PKCS7_NOATTR;
|
||||
else if (!strcmp (*args, "-nodetach"))
|
||||
flags &= ~PKCS7_DETACHED;
|
||||
else if (!strcmp (*args, "-binary"))
|
||||
flags |= PKCS7_BINARY;
|
||||
else if (!strcmp (*args, "-nosigs"))
|
||||
flags |= PKCS7_NOSIGS;
|
||||
else if (!strcmp(*args,"-rand")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
inrand = *args;
|
||||
} else badarg = 1;
|
||||
need_rand = 1;
|
||||
} else if (!strcmp(*args,"-passin")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
passargin = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-to")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
to = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-from")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
from = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-subject")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
subject = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-signer")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
signerfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-recip")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
recipfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-inkey")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
keyfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-certfile")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
certfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-CAfile")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
CAfile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-CApath")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
CApath = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-in")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
infile = *args;
|
||||
} else badarg = 1;
|
||||
} else if (!strcmp (*args, "-out")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
outfile = *args;
|
||||
} else badarg = 1;
|
||||
} else badarg = 1;
|
||||
args++;
|
||||
}
|
||||
|
||||
if(operation == SMIME_SIGN) {
|
||||
if(!signerfile) {
|
||||
BIO_printf(bio_err, "No signer certificate specified\n");
|
||||
badarg = 1;
|
||||
}
|
||||
need_rand = 1;
|
||||
} else if(operation == SMIME_DECRYPT) {
|
||||
if(!recipfile) {
|
||||
BIO_printf(bio_err, "No recipient certificate and key specified\n");
|
||||
badarg = 1;
|
||||
}
|
||||
} else if(operation == SMIME_ENCRYPT) {
|
||||
if(!*args) {
|
||||
BIO_printf(bio_err, "No recipient(s) certificate(s) specified\n");
|
||||
badarg = 1;
|
||||
}
|
||||
need_rand = 1;
|
||||
} else if(!operation) badarg = 1;
|
||||
|
||||
if (badarg) {
|
||||
BIO_printf (bio_err, "Usage smime [options] cert.pem ...\n");
|
||||
BIO_printf (bio_err, "where options are\n");
|
||||
BIO_printf (bio_err, "-encrypt encrypt message\n");
|
||||
BIO_printf (bio_err, "-decrypt decrypt encrypted message\n");
|
||||
BIO_printf (bio_err, "-sign sign message\n");
|
||||
BIO_printf (bio_err, "-verify verify signed message\n");
|
||||
BIO_printf (bio_err, "-pk7out output PKCS#7 structure\n");
|
||||
#ifndef NO_DES
|
||||
BIO_printf (bio_err, "-des3 encrypt with triple DES\n");
|
||||
BIO_printf (bio_err, "-des encrypt with DES\n");
|
||||
#endif
|
||||
#ifndef NO_RC2
|
||||
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
|
||||
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");
|
||||
BIO_printf (bio_err, "-noverify don't verify signers certificate\n");
|
||||
BIO_printf (bio_err, "-nocerts don't include signers certificate when signing\n");
|
||||
BIO_printf (bio_err, "-nodetach use opaque signing\n");
|
||||
BIO_printf (bio_err, "-noattr don't include any signed attributes\n");
|
||||
BIO_printf (bio_err, "-binary don't translate message to text\n");
|
||||
BIO_printf (bio_err, "-certfile file other certificates file\n");
|
||||
BIO_printf (bio_err, "-signer file signer certificate file\n");
|
||||
BIO_printf (bio_err, "-recip file recipient certificate file for decryption\n");
|
||||
BIO_printf (bio_err, "-in file input file\n");
|
||||
BIO_printf (bio_err, "-inkey file input private key (if not signer or recipient)\n");
|
||||
BIO_printf (bio_err, "-out file output file\n");
|
||||
BIO_printf (bio_err, "-to addr to address\n");
|
||||
BIO_printf (bio_err, "-from ad from address\n");
|
||||
BIO_printf (bio_err, "-subject s subject\n");
|
||||
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, "-rand file:file:...\n");
|
||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err, " the random number generator\n");
|
||||
BIO_printf (bio_err, "cert.pem recipient certificate(s) for encryption\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (need_rand) {
|
||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||
if (inrand != NULL)
|
||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||
app_RAND_load_files(inrand));
|
||||
}
|
||||
|
||||
ret = 2;
|
||||
|
||||
if(operation != SMIME_SIGN) flags &= ~PKCS7_DETACHED;
|
||||
|
||||
if(flags & PKCS7_BINARY) {
|
||||
if(operation & SMIME_OP) inmode = "rb";
|
||||
else outmode = "rb";
|
||||
}
|
||||
|
||||
if(operation == SMIME_ENCRYPT) {
|
||||
if (!cipher) {
|
||||
#ifndef NO_RC2
|
||||
cipher = EVP_rc2_40_cbc();
|
||||
#else
|
||||
BIO_printf(bio_err, "No cipher selected\n");
|
||||
goto end;
|
||||
#endif
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("load encryption certificates");
|
||||
#endif
|
||||
encerts = sk_X509_new_null();
|
||||
while (*args) {
|
||||
if(!(cert = load_cert(*args))) {
|
||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", *args);
|
||||
goto end;
|
||||
}
|
||||
sk_X509_push(encerts, cert);
|
||||
cert = NULL;
|
||||
args++;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
if(signerfile && (operation == SMIME_SIGN)) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("load signer certificate");
|
||||
#endif
|
||||
if(!(signer = load_cert(signerfile))) {
|
||||
BIO_printf(bio_err, "Can't read signer certificate file %s\n", signerfile);
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
if(certfile) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("load other certfiles");
|
||||
#endif
|
||||
if(!(other = load_certs(certfile))) {
|
||||
BIO_printf(bio_err, "Can't read certificate file %s\n", certfile);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
if(recipfile && (operation == SMIME_DECRYPT)) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("load recipient certificate");
|
||||
#endif
|
||||
if(!(recip = load_cert(recipfile))) {
|
||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", recipfile);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
if(operation == SMIME_DECRYPT) {
|
||||
if(!keyfile) keyfile = recipfile;
|
||||
} else if(operation == SMIME_SIGN) {
|
||||
if(!keyfile) keyfile = signerfile;
|
||||
} else keyfile = NULL;
|
||||
|
||||
if(keyfile) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("load keyfile");
|
||||
#endif
|
||||
if(!(key = load_key(keyfile, passin))) {
|
||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", keyfile);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("open input files");
|
||||
#endif
|
||||
if (infile) {
|
||||
if (!(in = BIO_new_file(infile, inmode))) {
|
||||
BIO_printf (bio_err,
|
||||
"Can't open input file %s\n", infile);
|
||||
goto end;
|
||||
}
|
||||
} else in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("open output files");
|
||||
#endif
|
||||
if (outfile) {
|
||||
if (!(out = BIO_new_file(outfile, outmode))) {
|
||||
BIO_printf (bio_err,
|
||||
"Can't open output file %s\n", outfile);
|
||||
goto end;
|
||||
}
|
||||
} else out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
|
||||
if(operation == SMIME_VERIFY) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("setup_verify");
|
||||
#endif
|
||||
if(!(store = setup_verify(CAfile, CApath))) goto end;
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
ret = 3;
|
||||
|
||||
if(operation == SMIME_ENCRYPT) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("PKCS7_encrypt");
|
||||
#endif
|
||||
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
} else if(operation == SMIME_SIGN) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("PKCS7_sign");
|
||||
#endif
|
||||
p7 = PKCS7_sign(signer, key, other, in, flags);
|
||||
BIO_reset(in);
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
} else {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("SMIME_read_PKCS7");
|
||||
#endif
|
||||
if(!(p7 = SMIME_read_PKCS7(in, &indata))) {
|
||||
BIO_printf(bio_err, "Error reading S/MIME message\n");
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!p7) {
|
||||
BIO_printf(bio_err, "Error creating PKCS#7 structure\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = 4;
|
||||
if(operation == SMIME_DECRYPT) {
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("PKCS7_decrypt");
|
||||
#endif
|
||||
if(!PKCS7_decrypt(p7, key, recip, out, flags)) {
|
||||
BIO_printf(bio_err, "Error decrypting PKCS#7 structure\n");
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
} else if(operation == SMIME_VERIFY) {
|
||||
STACK_OF(X509) *signers;
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("PKCS7_verify");
|
||||
#endif
|
||||
if(PKCS7_verify(p7, other, store, indata, out, flags)) {
|
||||
BIO_printf(bio_err, "Verification Successful\n");
|
||||
} else {
|
||||
BIO_printf(bio_err, "Verification Failure\n");
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
CRYPTO_push_info("PKCS7_get0_signers");
|
||||
#endif
|
||||
signers = PKCS7_get0_signers(p7, other, flags);
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
CRYPTO_push_info("save_certs");
|
||||
#endif
|
||||
if(!save_certs(signerfile, signers)) {
|
||||
BIO_printf(bio_err, "Error writing signers to %s\n",
|
||||
signerfile);
|
||||
ret = 5;
|
||||
goto end;
|
||||
}
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
sk_X509_free(signers);
|
||||
} else if(operation == SMIME_PK7OUT) {
|
||||
PEM_write_bio_PKCS7(out, p7);
|
||||
} else {
|
||||
if(to) BIO_printf(out, "To: %s\n", to);
|
||||
if(from) BIO_printf(out, "From: %s\n", from);
|
||||
if(subject) BIO_printf(out, "Subject: %s\n", subject);
|
||||
SMIME_write_PKCS7(out, p7, in, flags);
|
||||
}
|
||||
ret = 0;
|
||||
end:
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_remove_all_info();
|
||||
#endif
|
||||
if (need_rand)
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
if(ret) ERR_print_errors(bio_err);
|
||||
sk_X509_pop_free(encerts, X509_free);
|
||||
sk_X509_pop_free(other, X509_free);
|
||||
X509_STORE_free(store);
|
||||
X509_free(cert);
|
||||
X509_free(recip);
|
||||
X509_free(signer);
|
||||
EVP_PKEY_free(key);
|
||||
PKCS7_free(p7);
|
||||
BIO_free(in);
|
||||
BIO_free(indata);
|
||||
BIO_free(out);
|
||||
if(passin) Free(passin);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static X509 *load_cert(char *file)
|
||||
{
|
||||
BIO *in;
|
||||
X509 *cert;
|
||||
if(!(in = BIO_new_file(file, "r"))) return NULL;
|
||||
cert = PEM_read_bio_X509(in, NULL, NULL,NULL);
|
||||
BIO_free(in);
|
||||
return cert;
|
||||
}
|
||||
|
||||
static EVP_PKEY *load_key(char *file, char *pass)
|
||||
{
|
||||
BIO *in;
|
||||
EVP_PKEY *key;
|
||||
if(!(in = BIO_new_file(file, "r"))) return NULL;
|
||||
key = PEM_read_bio_PrivateKey(in, NULL,NULL,pass);
|
||||
BIO_free(in);
|
||||
return key;
|
||||
}
|
||||
|
||||
static STACK_OF(X509) *load_certs(char *file)
|
||||
{
|
||||
BIO *in;
|
||||
int i;
|
||||
STACK_OF(X509) *othercerts;
|
||||
STACK_OF(X509_INFO) *allcerts;
|
||||
X509_INFO *xi;
|
||||
if(!(in = BIO_new_file(file, "r"))) return NULL;
|
||||
othercerts = sk_X509_new(NULL);
|
||||
if(!othercerts) return NULL;
|
||||
allcerts = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL);
|
||||
for(i = 0; i < sk_X509_INFO_num(allcerts); i++) {
|
||||
xi = sk_X509_INFO_value (allcerts, i);
|
||||
if (xi->x509) {
|
||||
sk_X509_push(othercerts, xi->x509);
|
||||
xi->x509 = NULL;
|
||||
}
|
||||
}
|
||||
sk_X509_INFO_pop_free(allcerts, X509_INFO_free);
|
||||
BIO_free(in);
|
||||
return othercerts;
|
||||
}
|
||||
|
||||
static X509_STORE *setup_verify(char *CAfile, char *CApath)
|
||||
{
|
||||
X509_STORE *store;
|
||||
X509_LOOKUP *lookup;
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_push_info("X509_STORE_new");
|
||||
#endif
|
||||
if(!(store = X509_STORE_new())) goto end;
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
CRYPTO_push_info("X509_STORE_add_lookup(...file)");
|
||||
#endif
|
||||
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());
|
||||
if (lookup == NULL) goto end;
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
CRYPTO_push_info("X509_LOOKUP_load_file");
|
||||
#endif
|
||||
if (CAfile) {
|
||||
if(!X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM)) {
|
||||
BIO_printf(bio_err, "Error loading file %s\n", CAfile);
|
||||
goto end;
|
||||
}
|
||||
} else X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
CRYPTO_push_info("X509_STORE_add_lookup(...hash_dir)");
|
||||
#endif
|
||||
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_hash_dir());
|
||||
if (lookup == NULL) goto end;
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
CRYPTO_push_info("X509_LOOKUP_add_dir");
|
||||
#endif
|
||||
if (CApath) {
|
||||
if(!X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM)) {
|
||||
BIO_printf(bio_err, "Error loading directory %s\n", CApath);
|
||||
goto end;
|
||||
}
|
||||
} else X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
#ifdef CRYPTO_MDEBUG
|
||||
CRYPTO_pop_info();
|
||||
#endif
|
||||
|
||||
ERR_clear_error();
|
||||
return store;
|
||||
end:
|
||||
X509_STORE_free(store);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int save_certs(char *signerfile, STACK_OF(X509) *signers)
|
||||
{
|
||||
int i;
|
||||
BIO *tmp;
|
||||
if(!signerfile) return 1;
|
||||
tmp = BIO_new_file(signerfile, "w");
|
||||
if(!tmp) return 0;
|
||||
for(i = 0; i < sk_X509_num(signers); i++)
|
||||
PEM_write_bio_X509(tmp, sk_X509_value(signers, i));
|
||||
BIO_free(tmp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
58
apps/speed.c
58
apps/speed.c
@@ -238,16 +238,19 @@ static double Time_F(int s)
|
||||
#endif
|
||||
}
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
unsigned char *buf=NULL,*buf2=NULL;
|
||||
int ret=1;
|
||||
int mret=1;
|
||||
#define ALGOR_NUM 14
|
||||
#define SIZE_NUM 5
|
||||
#define RSA_NUM 4
|
||||
#define DSA_NUM 3
|
||||
long count,rsa_count;
|
||||
int i,j,k,rsa_num,rsa_num2;
|
||||
int i,j,k;
|
||||
unsigned rsa_num,rsa_num2;
|
||||
#ifndef NO_MD2
|
||||
unsigned char md2[MD2_DIGEST_LENGTH];
|
||||
#endif
|
||||
@@ -344,6 +347,7 @@ int MAIN(int argc, char **argv)
|
||||
int pr_header=0;
|
||||
|
||||
apps_startup();
|
||||
memset(results, 0, sizeof(results));
|
||||
#ifndef NO_DSA
|
||||
memset(dsa_key,0,sizeof(dsa_key));
|
||||
#endif
|
||||
@@ -421,7 +425,7 @@ int MAIN(int argc, char **argv)
|
||||
if (strcmp(*argv,"rc4") == 0) doit[D_RC4]=1;
|
||||
else
|
||||
#endif
|
||||
#ifndef NO_DEF
|
||||
#ifndef NO_DES
|
||||
if (strcmp(*argv,"des-cbc") == 0) doit[D_CBC_DES]=1;
|
||||
else if (strcmp(*argv,"des-ede3") == 0) doit[D_EDE3_DES]=1;
|
||||
else
|
||||
@@ -435,12 +439,14 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifndef RSA_NULL
|
||||
if (strcmp(*argv,"openssl") == 0)
|
||||
{
|
||||
RSA_set_default_method(RSA_PKCS1_SSLeay());
|
||||
j--;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif /* !NO_RSA */
|
||||
if (strcmp(*argv,"dsa512") == 0) dsa_doit[R_DSA_512]=2;
|
||||
else if (strcmp(*argv,"dsa1024") == 0) dsa_doit[R_DSA_1024]=2;
|
||||
@@ -586,9 +592,9 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
#ifndef NO_DES
|
||||
des_set_key(&key,sch);
|
||||
des_set_key(&key2,sch2);
|
||||
des_set_key(&key3,sch3);
|
||||
des_set_key_unchecked(&key,sch);
|
||||
des_set_key_unchecked(&key2,sch2);
|
||||
des_set_key_unchecked(&key3,sch3);
|
||||
#endif
|
||||
#ifndef NO_IDEA
|
||||
idea_set_encrypt_key(key16,&idea_ks);
|
||||
@@ -612,6 +618,7 @@ int MAIN(int argc, char **argv)
|
||||
memset(rsa_c,0,sizeof(rsa_c));
|
||||
#endif
|
||||
#ifndef SIGALRM
|
||||
#ifndef NO_DES
|
||||
BIO_printf(bio_err,"First we calculate the approximate speed ...\n");
|
||||
count=10;
|
||||
do {
|
||||
@@ -703,10 +710,14 @@ int MAIN(int argc, char **argv)
|
||||
#define COND(d) (count < (d))
|
||||
#define COUNT(d) (d)
|
||||
#else
|
||||
/* not worth fixing */
|
||||
# error "You cannot disable DES on systems without SIGALRM."
|
||||
#endif /* NO_DES */
|
||||
#else
|
||||
#define COND(c) (run)
|
||||
#define COUNT(d) (count)
|
||||
signal(SIGALRM,sig_done);
|
||||
#endif
|
||||
#endif /* SIGALRM */
|
||||
|
||||
#ifndef NO_MD2
|
||||
if (doit[D_MD2])
|
||||
@@ -956,22 +967,22 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
RAND_bytes(buf,30);
|
||||
RAND_pseudo_bytes(buf,36);
|
||||
#ifndef NO_RSA
|
||||
for (j=0; j<RSA_NUM; j++)
|
||||
{
|
||||
int ret;
|
||||
if (!rsa_doit[j]) continue;
|
||||
rsa_num=RSA_private_encrypt(30,buf,buf2,rsa_key[j],
|
||||
RSA_PKCS1_PADDING);
|
||||
ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]);
|
||||
pkey_print_message("private","rsa",rsa_c[j][0],rsa_bits[j],
|
||||
RSA_SECONDS);
|
||||
/* RSA_blinding_on(rsa_key[j],NULL); */
|
||||
Time_F(START);
|
||||
for (count=0,run=1; COND(rsa_c[j][0]); count++)
|
||||
{
|
||||
rsa_num=RSA_private_encrypt(30,buf,buf2,rsa_key[j],
|
||||
RSA_PKCS1_PADDING);
|
||||
if (rsa_num <= 0)
|
||||
ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num,
|
||||
rsa_key[j]);
|
||||
if (ret <= 0)
|
||||
{
|
||||
BIO_printf(bio_err,"RSA private encrypt failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -986,18 +997,17 @@ int MAIN(int argc, char **argv)
|
||||
rsa_count=count;
|
||||
|
||||
#if 1
|
||||
rsa_num2=RSA_public_decrypt(rsa_num,buf2,buf,rsa_key[j],
|
||||
RSA_PKCS1_PADDING);
|
||||
ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]);
|
||||
pkey_print_message("public","rsa",rsa_c[j][1],rsa_bits[j],
|
||||
RSA_SECONDS);
|
||||
Time_F(START);
|
||||
for (count=0,run=1; COND(rsa_c[j][1]); count++)
|
||||
{
|
||||
rsa_num2=RSA_public_decrypt(rsa_num,buf2,buf,rsa_key[j],
|
||||
RSA_PKCS1_PADDING);
|
||||
if (rsa_num2 <= 0)
|
||||
ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num,
|
||||
rsa_key[j]);
|
||||
if (ret <= 0)
|
||||
{
|
||||
BIO_printf(bio_err,"RSA public encrypt failure\n");
|
||||
BIO_printf(bio_err,"RSA verify failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
count=1;
|
||||
break;
|
||||
@@ -1018,7 +1028,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
RAND_bytes(buf,20);
|
||||
RAND_pseudo_bytes(buf,20);
|
||||
#ifndef NO_DSA
|
||||
for (j=0; j<DSA_NUM; j++)
|
||||
{
|
||||
@@ -1036,7 +1046,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
rsa_num=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,
|
||||
&kk,dsa_key[j]);
|
||||
if (rsa_num <= 0)
|
||||
if (rsa_num == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"DSA sign failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -1059,7 +1069,7 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
rsa_num2=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,
|
||||
kk,dsa_key[j]);
|
||||
if (rsa_num2 <= 0)
|
||||
if (rsa_num2 == 0)
|
||||
{
|
||||
BIO_printf(bio_err,"DSA verify failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -1155,7 +1165,7 @@ int MAIN(int argc, char **argv)
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
#endif
|
||||
ret=0;
|
||||
mret=0;
|
||||
end:
|
||||
if (buf != NULL) Free(buf);
|
||||
if (buf2 != NULL) Free(buf2);
|
||||
@@ -1169,7 +1179,7 @@ end:
|
||||
if (dsa_key[i] != NULL)
|
||||
DSA_free(dsa_key[i]);
|
||||
#endif
|
||||
EXIT(ret);
|
||||
EXIT(mret);
|
||||
}
|
||||
|
||||
static void print_message(char *s, long num, int length)
|
||||
|
||||
274
apps/spkac.c
Normal file
274
apps/spkac.c
Normal file
@@ -0,0 +1,274 @@
|
||||
/* apps/spkac.c */
|
||||
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
* project 1999. Based on an original idea by Massimiliano Pala
|
||||
* (madwolf@openca.org).
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* 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 <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "apps.h"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
|
||||
#undef PROG
|
||||
#define PROG spkac_main
|
||||
|
||||
/* -in arg - input file - default stdin
|
||||
* -out arg - output file - default stdout
|
||||
*/
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,badops=0, ret = 1;
|
||||
BIO *in = NULL,*out = NULL, *key = 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;
|
||||
NETSCAPE_SPKI *spki = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
|
||||
apps_startup();
|
||||
|
||||
if (!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
prog=argv[0];
|
||||
argc--;
|
||||
argv++;
|
||||
while (argc >= 1)
|
||||
{
|
||||
if (strcmp(*argv,"-in") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
infile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-out") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
outfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-passin") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargin= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-key") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
keyfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-challenge") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
challenge= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-spkac") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
spkac= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-spksect") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
spksect= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout=1;
|
||||
else if (strcmp(*argv,"-pubkey") == 0)
|
||||
pubkey=1;
|
||||
else if (strcmp(*argv,"-verify") == 0)
|
||||
verify=1;
|
||||
else badops = 1;
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (badops)
|
||||
{
|
||||
bad:
|
||||
BIO_printf(bio_err,"%s [options]\n",prog);
|
||||
BIO_printf(bio_err,"where options are\n");
|
||||
BIO_printf(bio_err," -in arg input file\n");
|
||||
BIO_printf(bio_err," -out arg output file\n");
|
||||
BIO_printf(bio_err," -key arg create SPKAC using private key\n");
|
||||
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||
BIO_printf(bio_err," -challenge arg challenge string\n");
|
||||
BIO_printf(bio_err," -spkac arg alternative SPKAC name\n");
|
||||
BIO_printf(bio_err," -noout don't print SPKAC\n");
|
||||
BIO_printf(bio_err," -pubkey output public key\n");
|
||||
BIO_printf(bio_err," -verify verify SPKAC signature\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
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);
|
||||
if(!pkey) {
|
||||
BIO_printf(bio_err, "Error reading private key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
spki = NETSCAPE_SPKI_new();
|
||||
if(challenge) ASN1_STRING_set(spki->spkac->challenge,
|
||||
challenge, strlen(challenge));
|
||||
NETSCAPE_SPKI_set_pubkey(spki, pkey);
|
||||
NETSCAPE_SPKI_sign(spki, pkey, EVP_md5());
|
||||
spkstr = NETSCAPE_SPKI_b64_encode(spki);
|
||||
|
||||
if (outfile) out = BIO_new_file(outfile, "w");
|
||||
else out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||
|
||||
if(!out) {
|
||||
BIO_printf(bio_err, "Error opening output file\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(out, "SPKAC=%s\n", spkstr);
|
||||
Free(spkstr);
|
||||
ret = 0;
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (infile) in = BIO_new_file(infile, "r");
|
||||
else in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
|
||||
if(!in) {
|
||||
BIO_printf(bio_err, "Error opening input file\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
conf = CONF_load_bio(NULL, in, NULL);
|
||||
|
||||
if(!conf) {
|
||||
BIO_printf(bio_err, "Error parsing config file\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
spkstr = CONF_get_string(conf, spksect, spkac);
|
||||
|
||||
if(!spkstr) {
|
||||
BIO_printf(bio_err, "Can't find SPKAC called \"%s\"\n", spkac);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
spki = NETSCAPE_SPKI_b64_decode(spkstr, -1);
|
||||
|
||||
if(!spki) {
|
||||
BIO_printf(bio_err, "Error loading SPKAC\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (outfile) out = BIO_new_file(outfile, "w");
|
||||
else out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||
|
||||
if(!out) {
|
||||
BIO_printf(bio_err, "Error opening output file\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!noout) NETSCAPE_SPKI_print(out, spki);
|
||||
pkey = NETSCAPE_SPKI_get_pubkey(spki);
|
||||
if(verify) {
|
||||
i = NETSCAPE_SPKI_verify(spki, pkey);
|
||||
if(i) BIO_printf(bio_err, "Signature OK\n");
|
||||
else {
|
||||
BIO_printf(bio_err, "Signature Failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
if(pubkey) PEM_write_bio_PUBKEY(out, pkey);
|
||||
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
CONF_free(conf);
|
||||
NETSCAPE_SPKI_free(spki);
|
||||
BIO_free(in);
|
||||
BIO_free(out);
|
||||
BIO_free(key);
|
||||
EVP_PKEY_free(pkey);
|
||||
if(passin) Free(passin);
|
||||
EXIT(ret);
|
||||
}
|
||||
165
apps/verify.c
165
apps/verify.c
@@ -63,19 +63,26 @@
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/pem.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);
|
||||
static int check(X509_STORE *ctx,char *file, STACK_OF(X509)*other, int purpose);
|
||||
static STACK_OF(X509) *load_untrusted(char *file);
|
||||
static int v_verbose=0;
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,ret=1;
|
||||
int purpose = -1;
|
||||
char *CApath=NULL,*CAfile=NULL;
|
||||
char *untfile = NULL;
|
||||
STACK_OF(X509) *untrusted = NULL;
|
||||
X509_STORE *cert_ctx=NULL;
|
||||
X509_LOOKUP *lookup=NULL;
|
||||
|
||||
@@ -107,6 +114,24 @@ int MAIN(int argc, char **argv)
|
||||
if (argc-- < 1) goto end;
|
||||
CAfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-purpose") == 0)
|
||||
{
|
||||
X509_PURPOSE *xptmp;
|
||||
if (argc-- < 1) goto end;
|
||||
i = X509_PURPOSE_get_by_sname(*(++argv));
|
||||
if(i < 0)
|
||||
{
|
||||
BIO_printf(bio_err, "unrecognized purpose\n");
|
||||
goto end;
|
||||
}
|
||||
xptmp = X509_PURPOSE_get0(i);
|
||||
purpose = X509_PURPOSE_get_id(xptmp);
|
||||
}
|
||||
else if (strcmp(*argv,"-untrusted") == 0)
|
||||
{
|
||||
if (argc-- < 1) goto end;
|
||||
untfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-help") == 0)
|
||||
goto end;
|
||||
else if (strcmp(*argv,"-verbose") == 0)
|
||||
@@ -124,34 +149,63 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
||||
if (lookup == NULL) abort();
|
||||
if (!X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM))
|
||||
X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
if (CAfile) {
|
||||
i=X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM);
|
||||
if(!i) {
|
||||
BIO_printf(bio_err, "Error loading file %s\n", CAfile);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
} else X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
|
||||
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_hash_dir());
|
||||
if (lookup == NULL) abort();
|
||||
if (!X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM))
|
||||
X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
|
||||
if (CApath) {
|
||||
i=X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM);
|
||||
if(!i) {
|
||||
BIO_printf(bio_err, "Error loading directory %s\n", CApath);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
} else X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||
|
||||
ERR_clear_error();
|
||||
if (argc < 1) check(cert_ctx,NULL);
|
||||
|
||||
if(untfile) {
|
||||
if(!(untrusted = load_untrusted(untfile))) {
|
||||
BIO_printf(bio_err, "Error loading untrusted file %s\n", untfile);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc < 1) check(cert_ctx, NULL, untrusted, purpose);
|
||||
else
|
||||
for (i=0; i<argc; i++)
|
||||
check(cert_ctx,argv[i]);
|
||||
check(cert_ctx,argv[i], untrusted, purpose);
|
||||
ret=0;
|
||||
end:
|
||||
if (ret == 1)
|
||||
if (ret == 1) {
|
||||
BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] cert1 cert2 ...\n");
|
||||
BIO_printf(bio_err,"recognized usages:\n");
|
||||
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
||||
X509_PURPOSE *ptmp;
|
||||
ptmp = X509_PURPOSE_get0(i);
|
||||
BIO_printf(bio_err, "\t%-10s\t%s\n", X509_PURPOSE_get0_sname(ptmp),
|
||||
X509_PURPOSE_get0_name(ptmp));
|
||||
}
|
||||
}
|
||||
if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
|
||||
sk_X509_pop_free(untrusted, X509_free);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
static int check(X509_STORE *ctx, char *file)
|
||||
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, int purpose)
|
||||
{
|
||||
X509 *x=NULL;
|
||||
BIO *in=NULL;
|
||||
int i=0,ret=0;
|
||||
X509_STORE_CTX csc;
|
||||
X509_STORE_CTX *csc;
|
||||
|
||||
in=BIO_new(BIO_s_file());
|
||||
if (in == NULL)
|
||||
@@ -181,9 +235,16 @@ static int check(X509_STORE *ctx, char *file)
|
||||
}
|
||||
fprintf(stdout,"%s: ",(file == NULL)?"stdin":file);
|
||||
|
||||
X509_STORE_CTX_init(&csc,ctx,x,NULL);
|
||||
i=X509_verify_cert(&csc);
|
||||
X509_STORE_CTX_cleanup(&csc);
|
||||
csc = X509_STORE_CTX_new();
|
||||
if (csc == NULL)
|
||||
{
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
X509_STORE_CTX_init(csc,ctx,x,uchain);
|
||||
if(purpose >= 0) X509_STORE_CTX_set_purpose(csc, purpose);
|
||||
i=X509_verify_cert(csc);
|
||||
X509_STORE_CTX_free(csc);
|
||||
|
||||
ret=0;
|
||||
end:
|
||||
@@ -200,27 +261,75 @@ end:
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static STACK_OF(X509) *load_untrusted(char *certfile)
|
||||
{
|
||||
STACK_OF(X509_INFO) *sk=NULL;
|
||||
STACK_OF(X509) *stack=NULL, *ret=NULL;
|
||||
BIO *in=NULL;
|
||||
X509_INFO *xi;
|
||||
|
||||
if(!(stack = sk_X509_new_null())) {
|
||||
BIO_printf(bio_err,"memory allocation failure\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!(in=BIO_new_file(certfile, "r"))) {
|
||||
BIO_printf(bio_err,"error opening the file, %s\n",certfile);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* This loads from a file, a stack of x509/crl/pkey sets */
|
||||
if(!(sk=PEM_X509_INFO_read_bio(in,NULL,NULL,NULL))) {
|
||||
BIO_printf(bio_err,"error reading the file, %s\n",certfile);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* scan over it and pull out the certs */
|
||||
while (sk_X509_INFO_num(sk))
|
||||
{
|
||||
xi=sk_X509_INFO_shift(sk);
|
||||
if (xi->x509 != NULL)
|
||||
{
|
||||
sk_X509_push(stack,xi->x509);
|
||||
xi->x509=NULL;
|
||||
}
|
||||
X509_INFO_free(xi);
|
||||
}
|
||||
if(!sk_X509_num(stack)) {
|
||||
BIO_printf(bio_err,"no certificates in file, %s\n",certfile);
|
||||
sk_X509_free(stack);
|
||||
goto end;
|
||||
}
|
||||
ret=stack;
|
||||
end:
|
||||
BIO_free(in);
|
||||
sk_X509_INFO_free(sk);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
/* since we are just checking the certificates, it is
|
||||
* ok if they are self signed. */
|
||||
if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT)
|
||||
ok=1;
|
||||
else
|
||||
{
|
||||
X509_NAME_oneline(
|
||||
X509_NAME_oneline(
|
||||
X509_get_subject_name(ctx->current_cert),buf,256);
|
||||
printf("%s\n",buf);
|
||||
printf("error %d at %d depth lookup:%s\n",ctx->error,
|
||||
ctx->error_depth,
|
||||
X509_verify_cert_error_string(ctx->error));
|
||||
if (ctx->error == X509_V_ERR_CERT_HAS_EXPIRED)
|
||||
ok=1;
|
||||
}
|
||||
printf("%s\n",buf);
|
||||
printf("error %d at %d depth lookup:%s\n",ctx->error,
|
||||
ctx->error_depth,
|
||||
X509_verify_cert_error_string(ctx->error));
|
||||
if (ctx->error == X509_V_ERR_CERT_HAS_EXPIRED) ok=1;
|
||||
/* since we are just checking the certificates, it is
|
||||
* ok if they are self signed. But we should still warn
|
||||
* the user.
|
||||
*/
|
||||
if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
|
||||
/* Continue after extension errors too */
|
||||
if (ctx->error == X509_V_ERR_INVALID_CA) ok=1;
|
||||
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 (!v_verbose)
|
||||
ERR_clear_error();
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
#undef PROG
|
||||
#define PROG version_main
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int i,ret=0;
|
||||
|
||||
268
apps/x509.c
268
apps/x509.c
@@ -56,6 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -91,59 +92,78 @@ static char *x509_usage[]={
|
||||
" -CAkeyform arg - CA key format - default PEM\n",
|
||||
" -in arg - input file - default stdin\n",
|
||||
" -out arg - output file - default stdout\n",
|
||||
" -passin arg - private key password source\n",
|
||||
" -serial - print serial number value\n",
|
||||
" -hash - print hash value\n",
|
||||
" -subject - print subject DN\n",
|
||||
" -issuer - print issuer DN\n",
|
||||
" -startdate - notBefore field\n",
|
||||
" -enddate - notAfter field\n",
|
||||
" -purpose - print out certificate purposes\n",
|
||||
" -dates - both Before and After dates\n",
|
||||
" -modulus - print the RSA key modulus\n",
|
||||
" -pubkey - output the public key\n",
|
||||
" -fingerprint - print the certificate fingerprint\n",
|
||||
" -alias - output certificate alias\n",
|
||||
" -noout - no certificate output\n",
|
||||
|
||||
" -trustout - output a \"trusted\" certificate\n",
|
||||
" -clrtrust - clear all trusted purposes\n",
|
||||
" -clrreject - clear all rejected purposes\n",
|
||||
" -addtrust arg - trust certificate for a given purpose\n",
|
||||
" -addreject arg - reject certificate for a given purpose\n",
|
||||
" -setalias arg - set certificate alias\n",
|
||||
" -days arg - How long till expiry of a signed certificate - def 30 days\n",
|
||||
" -signkey arg - self sign cert with arg\n",
|
||||
" -x509toreq - output a certification request object\n",
|
||||
" -req - input is a certificate request, sign and output.\n",
|
||||
" -CA arg - set the CA certificate, must be PEM format.\n",
|
||||
" -CAkey arg - set the CA key, must be PEM format\n",
|
||||
" missing, it is asssumed to be in the CA file.\n",
|
||||
" missing, it is assumed to be in the CA file.\n",
|
||||
" -CAcreateserial - create serial number file if it does not exist\n",
|
||||
" -CAserial - serial file\n",
|
||||
" -text - print the certificate in text form\n",
|
||||
" -C - print out C code forms\n",
|
||||
" -md2/-md5/-sha1/-mdc2 - digest to do an RSA sign with\n",
|
||||
" -md2/-md5/-sha1/-mdc2 - digest to use\n",
|
||||
" -extfile - configuration file with X509V3 extensions to add\n",
|
||||
" -extensions - section from config file with X509V3 extensions to add\n",
|
||||
" -crlext - delete extensions before signing and input certificate\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
|
||||
static EVP_PKEY *load_key(char *file, int format);
|
||||
static EVP_PKEY *load_key(char *file, int format, char *passin);
|
||||
static X509 *load_cert(char *file, int format);
|
||||
static int sign (X509 *x, EVP_PKEY *pkey,int days,const EVP_MD *digest,
|
||||
static int sign (X509 *x, EVP_PKEY *pkey,int days,int clrext, const EVP_MD *digest,
|
||||
LHASH *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, LHASH *conf, char *section);
|
||||
int create,int days, int clrext, LHASH *conf, char *section);
|
||||
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt);
|
||||
static int reqfile=0;
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret=1;
|
||||
X509_REQ *req=NULL;
|
||||
X509 *x=NULL,*xca=NULL;
|
||||
ASN1_OBJECT *objtmp;
|
||||
EVP_PKEY *Upkey=NULL,*CApkey=NULL;
|
||||
int i,num,badops=0;
|
||||
BIO *out=NULL;
|
||||
BIO *STDout=NULL;
|
||||
STACK_OF(ASN1_OBJECT) *trust = NULL, *reject = NULL;
|
||||
int informat,outformat,keyformat,CAformat,CAkeyformat;
|
||||
char *infile=NULL,*outfile=NULL,*keyfile=NULL,*CAfile=NULL;
|
||||
char *CAkeyfile=NULL,*CAserial=NULL;
|
||||
char *alias=NULL;
|
||||
int text=0,serial=0,hash=0,subject=0,issuer=0,startdate=0,enddate=0;
|
||||
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0;
|
||||
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
|
||||
int C=0;
|
||||
int x509req=0,days=DEF_DAYS,modulus=0;
|
||||
int x509req=0,days=DEF_DAYS,modulus=0,pubkey=0;
|
||||
int pprint = 0;
|
||||
char **pp;
|
||||
X509_STORE *ctx=NULL;
|
||||
X509_REQ *rq=NULL;
|
||||
@@ -151,7 +171,8 @@ int MAIN(int argc, char **argv)
|
||||
char buf[256];
|
||||
const EVP_MD *md_alg,*digest=EVP_md5();
|
||||
LHASH *extconf = NULL;
|
||||
char *extsect = NULL, *extfile = NULL;
|
||||
char *extsect = NULL, *extfile = NULL, *passin = NULL, *passargin = NULL;
|
||||
int need_rand = 0;
|
||||
|
||||
reqfile=0;
|
||||
|
||||
@@ -192,7 +213,10 @@ int MAIN(int argc, char **argv)
|
||||
keyformat=str2fmt(*(++argv));
|
||||
}
|
||||
else if (strcmp(*argv,"-req") == 0)
|
||||
{
|
||||
reqfile=1;
|
||||
need_rand = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-CAform") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -213,11 +237,21 @@ int MAIN(int argc, char **argv)
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
else if (strcmp(*argv,"-passin") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
passargin= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-extfile") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
extfile= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-extensions") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
extsect= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-in") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
@@ -233,12 +267,14 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
keyfile= *(++argv);
|
||||
sign_flag= ++num;
|
||||
need_rand = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-CA") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
CAfile= *(++argv);
|
||||
CA_flag= ++num;
|
||||
need_rand = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-CAkey") == 0)
|
||||
{
|
||||
@@ -250,12 +286,50 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1) goto bad;
|
||||
CAserial= *(++argv);
|
||||
}
|
||||
else if (strcmp(*argv,"-addtrust") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
if(!(objtmp = OBJ_txt2obj(*(++argv), 0))) {
|
||||
BIO_printf(bio_err,
|
||||
"Invalid trust object value %s\n", *argv);
|
||||
goto bad;
|
||||
}
|
||||
if(!trust) trust = sk_ASN1_OBJECT_new_null();
|
||||
sk_ASN1_OBJECT_push(trust, objtmp);
|
||||
trustout = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-addreject") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
if(!(objtmp = OBJ_txt2obj(*(++argv), 0))) {
|
||||
BIO_printf(bio_err,
|
||||
"Invalid reject object value %s\n", *argv);
|
||||
goto bad;
|
||||
}
|
||||
if(!reject) reject = sk_ASN1_OBJECT_new_null();
|
||||
sk_ASN1_OBJECT_push(reject, objtmp);
|
||||
trustout = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-setalias") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
alias= *(++argv);
|
||||
trustout = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-setalias") == 0)
|
||||
{
|
||||
if (--argc < 1) goto bad;
|
||||
alias= *(++argv);
|
||||
trustout = 1;
|
||||
}
|
||||
else if (strcmp(*argv,"-C") == 0)
|
||||
C= ++num;
|
||||
else if (strcmp(*argv,"-serial") == 0)
|
||||
serial= ++num;
|
||||
else if (strcmp(*argv,"-modulus") == 0)
|
||||
modulus= ++num;
|
||||
else if (strcmp(*argv,"-pubkey") == 0)
|
||||
pubkey= ++num;
|
||||
else if (strcmp(*argv,"-x509toreq") == 0)
|
||||
x509req= ++num;
|
||||
else if (strcmp(*argv,"-text") == 0)
|
||||
@@ -273,15 +347,27 @@ int MAIN(int argc, char **argv)
|
||||
startdate= ++num;
|
||||
enddate= ++num;
|
||||
}
|
||||
else if (strcmp(*argv,"-purpose") == 0)
|
||||
pprint= ++num;
|
||||
else if (strcmp(*argv,"-startdate") == 0)
|
||||
startdate= ++num;
|
||||
else if (strcmp(*argv,"-enddate") == 0)
|
||||
enddate= ++num;
|
||||
else if (strcmp(*argv,"-noout") == 0)
|
||||
noout= ++num;
|
||||
else if (strcmp(*argv,"-trustout") == 0)
|
||||
trustout= 1;
|
||||
else if (strcmp(*argv,"-clrtrust") == 0)
|
||||
clrtrust= ++num;
|
||||
else if (strcmp(*argv,"-clrreject") == 0)
|
||||
clrreject= ++num;
|
||||
else if (strcmp(*argv,"-alias") == 0)
|
||||
aliasout= ++num;
|
||||
else if (strcmp(*argv,"-CAcreateserial") == 0)
|
||||
CA_createserial= ++num;
|
||||
else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
|
||||
else if (strcmp(*argv,"-crlext") == 0)
|
||||
clrext = 1;
|
||||
else if ((md_alg=EVP_get_digestbyname(*argv + 1)))
|
||||
{
|
||||
/* ok */
|
||||
digest=md_alg;
|
||||
@@ -304,8 +390,15 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (need_rand)
|
||||
app_RAND_load_file(NULL, bio_err, 0);
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
X509V3_add_standard_extensions();
|
||||
|
||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||
BIO_printf(bio_err, "Error getting password\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!X509_STORE_set_default_paths(ctx))
|
||||
{
|
||||
@@ -335,7 +428,7 @@ bad:
|
||||
,errorline,extfile);
|
||||
goto end;
|
||||
}
|
||||
if(!(extsect = CONF_get_string(extconf, "default",
|
||||
if(!extsect && !(extsect = CONF_get_string(extconf, "default",
|
||||
"extensions"))) extsect = "default";
|
||||
X509V3_set_ctx_test(&ctx2);
|
||||
X509V3_set_conf_lhash(&ctx2, extconf);
|
||||
@@ -425,15 +518,9 @@ bad:
|
||||
X509_gmtime_adj(X509_get_notBefore(x),0);
|
||||
X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days);
|
||||
|
||||
#if 0
|
||||
X509_PUBKEY_free(ci->key);
|
||||
ci->key=req->req_info->pubkey;
|
||||
req->req_info->pubkey=NULL;
|
||||
#else
|
||||
pkey = X509_REQ_get_pubkey(req);
|
||||
X509_set_pubkey(x,pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
x=load_cert(infile,informat);
|
||||
@@ -468,6 +555,25 @@ bad:
|
||||
}
|
||||
}
|
||||
|
||||
if(alias) X509_alias_set1(x, (unsigned char *)alias, -1);
|
||||
|
||||
if(clrtrust) X509_trust_clear(x);
|
||||
if(clrreject) X509_reject_clear(x);
|
||||
|
||||
if(trust) {
|
||||
for(i = 0; i < sk_ASN1_OBJECT_num(trust); i++) {
|
||||
objtmp = sk_ASN1_OBJECT_value(trust, i);
|
||||
X509_add1_trust_object(x, objtmp);
|
||||
}
|
||||
}
|
||||
|
||||
if(reject) {
|
||||
for(i = 0; i < sk_ASN1_OBJECT_num(reject); i++) {
|
||||
objtmp = sk_ASN1_OBJECT_value(reject, i);
|
||||
X509_add1_reject_object(x, objtmp);
|
||||
}
|
||||
}
|
||||
|
||||
if (num)
|
||||
{
|
||||
for (i=1; i<=num; i++)
|
||||
@@ -490,10 +596,28 @@ bad:
|
||||
i2a_ASN1_INTEGER(STDout,x->cert_info->serialNumber);
|
||||
BIO_printf(STDout,"\n");
|
||||
}
|
||||
else if (aliasout == i)
|
||||
{
|
||||
unsigned char *alstr;
|
||||
alstr = X509_alias_get0(x, NULL);
|
||||
if(alstr) BIO_printf(STDout,"%s\n", alstr);
|
||||
else BIO_puts(STDout,"<No Alias>\n");
|
||||
}
|
||||
else if (hash == i)
|
||||
{
|
||||
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x));
|
||||
}
|
||||
else if (pprint == i)
|
||||
{
|
||||
X509_PURPOSE *ptmp;
|
||||
int j;
|
||||
BIO_printf(STDout, "Certificate purposes:\n");
|
||||
for(j = 0; j < X509_PURPOSE_get_count(); j++)
|
||||
{
|
||||
ptmp = X509_PURPOSE_get0(j);
|
||||
purpose_print(STDout, x, ptmp);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (modulus == i)
|
||||
{
|
||||
@@ -521,6 +645,21 @@ bad:
|
||||
BIO_printf(STDout,"\n");
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
else
|
||||
if (pubkey == i)
|
||||
{
|
||||
EVP_PKEY *pkey;
|
||||
|
||||
pkey=X509_get_pubkey(x);
|
||||
if (pkey == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"Error getting public key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
PEM_write_bio_PUBKEY(STDout, pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
else
|
||||
if (C == i)
|
||||
{
|
||||
@@ -598,12 +737,13 @@ bad:
|
||||
unsigned int n;
|
||||
unsigned char md[EVP_MAX_MD_SIZE];
|
||||
|
||||
if (!X509_digest(x,EVP_md5(),md,&n))
|
||||
if (!X509_digest(x,digest,md,&n))
|
||||
{
|
||||
BIO_printf(bio_err,"out of memory\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(STDout,"MD5 Fingerprint=");
|
||||
BIO_printf(STDout,"%s Fingerprint=",
|
||||
OBJ_nid2sn(EVP_MD_type(digest)));
|
||||
for (j=0; j<(int)n; j++)
|
||||
{
|
||||
BIO_printf(STDout,"%02X%c",md[j],
|
||||
@@ -618,7 +758,7 @@ bad:
|
||||
BIO_printf(bio_err,"Getting Private key\n");
|
||||
if (Upkey == NULL)
|
||||
{
|
||||
Upkey=load_key(keyfile,keyformat);
|
||||
Upkey=load_key(keyfile,keyformat, passin);
|
||||
if (Upkey == NULL) goto end;
|
||||
}
|
||||
#ifndef NO_DSA
|
||||
@@ -626,7 +766,8 @@ bad:
|
||||
digest=EVP_dss1();
|
||||
#endif
|
||||
|
||||
if (!sign(x,Upkey,days,digest,
|
||||
assert(need_rand);
|
||||
if (!sign(x,Upkey,days,clrext,digest,
|
||||
extconf, extsect)) goto end;
|
||||
}
|
||||
else if (CA_flag == i)
|
||||
@@ -634,7 +775,7 @@ bad:
|
||||
BIO_printf(bio_err,"Getting CA Private Key\n");
|
||||
if (CAkeyfile != NULL)
|
||||
{
|
||||
CApkey=load_key(CAkeyfile,CAkeyformat);
|
||||
CApkey=load_key(CAkeyfile,CAkeyformat, passin);
|
||||
if (CApkey == NULL) goto end;
|
||||
}
|
||||
#ifndef NO_DSA
|
||||
@@ -642,8 +783,9 @@ bad:
|
||||
digest=EVP_dss1();
|
||||
#endif
|
||||
|
||||
assert(need_rand);
|
||||
if (!x509_certify(ctx,CAfile,digest,x,xca,
|
||||
CApkey, CAserial,CA_createserial,days,
|
||||
CApkey, CAserial,CA_createserial,days, clrext,
|
||||
extconf, extsect))
|
||||
goto end;
|
||||
}
|
||||
@@ -659,13 +801,16 @@ bad:
|
||||
}
|
||||
else
|
||||
{
|
||||
pk=load_key(keyfile,FORMAT_PEM);
|
||||
pk=load_key(keyfile,FORMAT_PEM, passin);
|
||||
if (pk == NULL) goto end;
|
||||
}
|
||||
|
||||
BIO_printf(bio_err,"Generating certificate request\n");
|
||||
|
||||
rq=X509_to_X509_REQ(x,pk,EVP_md5());
|
||||
if (pk->type == EVP_PKEY_DSA)
|
||||
digest=EVP_dss1();
|
||||
|
||||
rq=X509_to_X509_REQ(x,pk,digest);
|
||||
EVP_PKEY_free(pk);
|
||||
if (rq == NULL)
|
||||
{
|
||||
@@ -690,9 +835,10 @@ bad:
|
||||
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i=i2d_X509_bio(out,x);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i=PEM_write_bio_X509(out,x);
|
||||
else if (outformat == FORMAT_NETSCAPE)
|
||||
else if (outformat == FORMAT_PEM) {
|
||||
if(trustout) i=PEM_write_bio_X509_AUX(out,x);
|
||||
else i=PEM_write_bio_X509(out,x);
|
||||
} else if (outformat == FORMAT_NETSCAPE)
|
||||
{
|
||||
ASN1_HEADER ah;
|
||||
ASN1_OCTET_STRING os;
|
||||
@@ -717,6 +863,8 @@ bad:
|
||||
}
|
||||
ret=0;
|
||||
end:
|
||||
if (need_rand)
|
||||
app_RAND_write_file(NULL, bio_err);
|
||||
OBJ_cleanup();
|
||||
CONF_free(extconf);
|
||||
BIO_free(out);
|
||||
@@ -728,13 +876,15 @@ end:
|
||||
EVP_PKEY_free(Upkey);
|
||||
EVP_PKEY_free(CApkey);
|
||||
X509_REQ_free(rq);
|
||||
X509V3_EXT_cleanup();
|
||||
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
|
||||
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
|
||||
if(passin) Free(passin);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
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, LHASH *conf, char *section)
|
||||
int days, int clrext, LHASH *conf, char *section)
|
||||
{
|
||||
int ret=0;
|
||||
BIO *io=NULL;
|
||||
@@ -750,7 +900,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
EVP_PKEY_free(upkey);
|
||||
|
||||
X509_STORE_CTX_init(&xsc,ctx,x,NULL);
|
||||
buf=(char *)Malloc(EVP_PKEY_size(pkey)*2+
|
||||
buf=Malloc(EVP_PKEY_size(pkey)*2+
|
||||
((serialfile == NULL)
|
||||
?(strlen(CAfile)+strlen(POSTFIX)+1)
|
||||
:(strlen(serialfile)))+1);
|
||||
@@ -792,8 +942,8 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
}
|
||||
else
|
||||
{
|
||||
ASN1_INTEGER_set(bs,0);
|
||||
BN_zero(serial);
|
||||
ASN1_INTEGER_set(bs,1);
|
||||
BN_one(serial);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -855,6 +1005,10 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
if (X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days) == NULL)
|
||||
goto end;
|
||||
|
||||
if(clrext) {
|
||||
while(X509_get_ext_count(x) > 0) X509_delete_ext(x, 0);
|
||||
}
|
||||
|
||||
if(conf) {
|
||||
X509V3_CTX ctx2;
|
||||
X509_set_version(x,2); /* version 3 certificate */
|
||||
@@ -909,7 +1063,7 @@ static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
static EVP_PKEY *load_key(char *file, int format)
|
||||
static EVP_PKEY *load_key(char *file, int format, char *passin)
|
||||
{
|
||||
BIO *key=NULL;
|
||||
EVP_PKEY *pkey=NULL;
|
||||
@@ -930,25 +1084,13 @@ static EVP_PKEY *load_key(char *file, int format)
|
||||
perror(file);
|
||||
goto end;
|
||||
}
|
||||
#ifndef NO_RSA
|
||||
if (format == FORMAT_ASN1)
|
||||
if (format == FORMAT_ASN1)
|
||||
{
|
||||
RSA *rsa;
|
||||
|
||||
rsa=d2i_RSAPrivateKey_bio(key,NULL);
|
||||
if (rsa != NULL)
|
||||
{
|
||||
if ((pkey=EVP_PKEY_new()) != NULL)
|
||||
EVP_PKEY_assign_RSA(pkey,rsa);
|
||||
else
|
||||
RSA_free(rsa);
|
||||
}
|
||||
pkey=d2i_PrivateKey_bio(key, NULL);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (format == FORMAT_PEM)
|
||||
else if (format == FORMAT_PEM)
|
||||
{
|
||||
pkey=PEM_read_bio_PrivateKey(key,NULL,NULL,NULL);
|
||||
pkey=PEM_read_bio_PrivateKey(key,NULL,NULL,passin);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1031,7 +1173,7 @@ static X509 *load_cert(char *file, int format)
|
||||
ah->data=NULL;
|
||||
}
|
||||
else if (format == FORMAT_PEM)
|
||||
x=PEM_read_bio_X509(cert,NULL,NULL,NULL);
|
||||
x=PEM_read_bio_X509_AUX(cert,NULL,NULL,NULL);
|
||||
else {
|
||||
BIO_printf(bio_err,"bad input format specified for input cert\n");
|
||||
goto end;
|
||||
@@ -1049,7 +1191,7 @@ end:
|
||||
}
|
||||
|
||||
/* self sign */
|
||||
static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest,
|
||||
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest,
|
||||
LHASH *conf, char *section)
|
||||
{
|
||||
|
||||
@@ -1071,6 +1213,9 @@ static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest,
|
||||
goto err;
|
||||
|
||||
if (!X509_set_pubkey(x,pkey)) goto err;
|
||||
if(clrext) {
|
||||
while(X509_get_ext_count(x) > 0) X509_delete_ext(x, 0);
|
||||
}
|
||||
if(conf) {
|
||||
X509V3_CTX ctx;
|
||||
X509_set_version(x,2); /* version 3 certificate */
|
||||
@@ -1084,3 +1229,22 @@ err:
|
||||
ERR_print_errors(bio_err);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt)
|
||||
{
|
||||
int id, i, idret;
|
||||
char *pname;
|
||||
id = X509_PURPOSE_get_id(pt);
|
||||
pname = X509_PURPOSE_get0_name(pt);
|
||||
for(i = 0; i < 2; i++) {
|
||||
idret = X509_check_purpose(cert, id, i);
|
||||
BIO_printf(bio, "%s%s : ", pname, i ? " CA" : "");
|
||||
if(idret == 1) BIO_printf(bio, "Yes\n");
|
||||
else if (idret == 0) BIO_printf(bio, "No\n");
|
||||
else BIO_printf(bio, "Yes (WARNING code=%d)\n", idret);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,3 +39,11 @@ SSL_shutdown() and still sharing the socket with its parent).
|
||||
|
||||
Netscape, when using export ciphers, will accept a 1024 bit temporary
|
||||
RSA key. It is supposed to only accept 512.
|
||||
|
||||
If Netscape connects to a server which requests a client certificate
|
||||
it will frequently hang after the user has selected one and never
|
||||
complete the connection. Hitting "Stop" and reload fixes this and
|
||||
all subsequent connections work fine. This appears to be because
|
||||
Netscape wont read any new records in when it is awaiting a server
|
||||
done message at this point. The fix is to send the certificate request
|
||||
and server done messages in one record.
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw
|
||||
OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||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7dqPIkDMmRNM
|
||||
5R5xBTabD+Aji0wzQupYxBLuW5PLj7ECAwEAAaOBtzCBtDAdBgNVHQ4EFgQU1WWA
|
||||
U42mkhi3ecgey1dsJjU61+UwgYQGA1UdIwR9MHuAFE0RaEcrj18q1dw+G6nJbsTW
|
||||
R213oWCkXjBcMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxHDAaBgNVBAMTE1Rlc3QgUENBICgxMDI0
|
||||
IGJpdCmCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBb39BRphHL
|
||||
6aRAQyymsvBvPSCiG9+kR0R1L23aTpNbhXp2BebyFjbEQYZc2kWGiKKcHkNECA35
|
||||
3d4LoqUlVey8DFyafOIJd9hxdZfg+rxlHMxnL7uCJRmx9+xB411Jtsol9/wg1uCK
|
||||
sleGpgB4j8cG2SVCz7V2MNZNK+d5QCnR7A==
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw
|
||||
OTEzNTczN1owXDELMAkGA1UEBhMCQVUx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CFKiQrjUyuDfu4TABmn+kkt3vR1Y
|
||||
BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S
|
||||
Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9
|
||||
xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO
|
||||
cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI
|
||||
NCBiaXQpggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAUa8B3pho
|
||||
+Mvxeq9HsEzJxHIFQla05S5J/e/V+DQTYoKiRFchKPrDAdrzYSEvP3h4QJEtsNqQ
|
||||
JfOxg5M42uLFq7aPGWkF6ZZqZsYS+zA9IVT14g7gNA6Ne+5QtJqQtH9HA24st0T0
|
||||
Tga/lZ9M2ovImovaxSL/kRHbpCWcqWVxpOw=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
|
||||
|
||||
74
config
74
config
@@ -57,6 +57,9 @@ if [ "x$XREL" != "x" ]; then
|
||||
4.2)
|
||||
echo "whatever-whatever-unixware1"; exit 0
|
||||
;;
|
||||
5*)
|
||||
echo "${MACHINE}-sco-unixware7"; exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
@@ -187,6 +190,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
echo "i860-intel-osf1"; exit 0
|
||||
;;
|
||||
|
||||
Rhapsody:*)
|
||||
echo "ppc-apple-rhapsody"; exit 0
|
||||
;;
|
||||
|
||||
SunOS:5.*)
|
||||
echo "${MACHINE}-sun-solaris2"; exit 0
|
||||
;;
|
||||
@@ -311,7 +318,7 @@ else
|
||||
fi
|
||||
|
||||
if [ "$SYSTEM" = "SunOS" ]; then
|
||||
# assume output is "blah-blah C x.x"
|
||||
# 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]' | \
|
||||
sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||
@@ -328,6 +335,19 @@ if [ "$SYSTEM" = "SunOS" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
|
||||
# check for Compaq C, expected output is "blah-blah C Vx.x"
|
||||
CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
|
||||
egrep -e '.* C V[0-9]\.[0-9]' | \
|
||||
sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||
CCCVER=${CCCVER:-0}
|
||||
if [ $CCCVER -gt 60 ]; then
|
||||
CC=ccc # overrides gcc!!! well, ccc outperforms inoticeably
|
||||
# only on hash routines and des, otherwise gcc (2.95)
|
||||
# keeps along rather tight...
|
||||
fi
|
||||
fi
|
||||
|
||||
GCCVER=${GCCVER:-0}
|
||||
CCVER=${CCVER:-0}
|
||||
|
||||
@@ -340,9 +360,6 @@ echo Operating system: $GUESSOS
|
||||
# script above so we end up with values in vars but that would take
|
||||
# more time that I want to waste at the moment
|
||||
case "$GUESSOS" in
|
||||
alpha-*-linux2) OUT="alpha-gcc" ;;
|
||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||
mips-*-linux?) OUT="linux-mips" ;;
|
||||
mips2-sgi-irix)
|
||||
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
||||
CPU=${CPU:-0}
|
||||
@@ -369,6 +386,23 @@ case "$GUESSOS" in
|
||||
options="$options -mips4"
|
||||
OUT="irix-mips3-$CC"
|
||||
;;
|
||||
alpha-*-linux2)
|
||||
ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo`
|
||||
case ${ISA:-generic} in
|
||||
*[67]) OUT="linux-alpha+bwx-$CC" ;;
|
||||
*) OUT="linux-alpha-$CC" ;;
|
||||
esac
|
||||
if [ "$CC" = "gcc" ]; then
|
||||
case ${ISA:-generic} in
|
||||
EV5|EV45) options="$options -mcpu=ev5";;
|
||||
EV56|PCA56) options="$options -mcpu=ev56";;
|
||||
EV6|EV67|PCA57) options="$options -mcpu=ev6";;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
mips-*-linux?) OUT="linux-mips" ;;
|
||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
||||
sparc64-*-linux2)
|
||||
#Before we can uncomment following lines we have to wait at least
|
||||
#till 64-bit glibc for SPARC is operational:-(
|
||||
@@ -413,17 +447,30 @@ case "$GUESSOS" in
|
||||
*-*-openbsd) OUT="OpenBSD" ;;
|
||||
*86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
|
||||
*-*-osf) OUT="alpha-cc" ;;
|
||||
*-*-unixware*) OUT="unixware-2.0" ;;
|
||||
*-*-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" ;;
|
||||
BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
|
||||
RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
|
||||
*-siemens-sysv4) OUT="SINIX" ;;
|
||||
*-hpux1*) OUT="hpux-parisc-$CC"
|
||||
options="$options -D_REENTRANT" ;;
|
||||
*-hpux) OUT="hpux-parisc-$CC" ;;
|
||||
# these are all covered by the catchall below
|
||||
# *-hpux*) OUT="hpux-$CC" ;;
|
||||
# *-aix) OUT="aix-$CC" ;;
|
||||
# *-dgux) OUT="dgux" ;;
|
||||
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
||||
esac
|
||||
|
||||
# See whether we can compile Atalla support
|
||||
if [ -f /usr/include/atasi.h ]
|
||||
then
|
||||
options="$options -DATALLA"
|
||||
fi
|
||||
|
||||
# gcc < 2.8 does not support -mcpu=ultrasparc
|
||||
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
|
||||
then
|
||||
@@ -438,6 +485,17 @@ then
|
||||
sleep 5
|
||||
OUT=linux-sparcv8
|
||||
fi
|
||||
# To start with $OUT is never i86pc-sun-solaris2. Secondly why
|
||||
# ban *all* assembler implementation if it can't stand only one,
|
||||
# SHA-0 implementation.
|
||||
#if [ "$OUT" = "i86pc-sun-solaris2" ]
|
||||
#then
|
||||
# ASM=`as -V /dev/null 2>&1`
|
||||
# case "$ASM" in
|
||||
# GNU*) ;;
|
||||
# *) options="$options no-asm" ; echo "WARNING: You need the GNU assembler to use OpenSSL assembler code." ; echo "Sun as is not supported on Solaris x86." ;;
|
||||
# esac
|
||||
#fi
|
||||
|
||||
case "$GUESSOS" in
|
||||
i386-*) options="$options 386" ;;
|
||||
@@ -484,14 +542,14 @@ fi
|
||||
# compiler for the platform ... in which case we add it on
|
||||
# the end ... otherwise we leave it off
|
||||
|
||||
$PERL ./Configure 2>&1 | grep "$OUT-$CC" > /dev/null
|
||||
$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
|
||||
if [ $? = "0" ]; then
|
||||
OUT="$OUT-$CC"
|
||||
fi
|
||||
|
||||
OUT="$PREFIX$OUT"
|
||||
|
||||
$PERL ./Configure 2>&1 | grep "$OUT" > /dev/null
|
||||
$PERL ./Configure LIST | grep "$OUT" > /dev/null
|
||||
if [ $? = "0" ]; then
|
||||
echo Configuring for $OUT
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ SDIRS= md2 md5 sha mdc2 hmac ripemd \
|
||||
GENERAL=Makefile README crypto-lib.com install.com
|
||||
|
||||
LIB= $(TOP)/libcrypto.a
|
||||
LIBSRC= cryptlib.c mem.c cversion.c ex_data.c tmdiff.c cpt_err.c
|
||||
LIBOBJ= cryptlib.o mem.o cversion.o ex_data.o tmdiff.o cpt_err.o
|
||||
LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c
|
||||
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
@@ -57,6 +57,11 @@ buildinf.h: ../Makefile.ssl
|
||||
echo " #define DATE \"`date`\""; \
|
||||
echo "#endif" ) >buildinf.h
|
||||
|
||||
testapps:
|
||||
if echo ${SDIRS} | fgrep ' des '; \
|
||||
then cd des && $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' des; fi
|
||||
cd pkcs7 && $(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' testapps
|
||||
|
||||
subdirs:
|
||||
@for i in $(SDIRS) ;\
|
||||
do \
|
||||
@@ -122,7 +127,7 @@ lint:
|
||||
done;
|
||||
|
||||
depend:
|
||||
if [ ! -e buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist
|
||||
if [ ! -f buildinf.h ]; then touch buildinf.h; fi # fake buildinf.h if it does not exist
|
||||
$(MAKEDEPEND) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC)
|
||||
if [ ! -s buildinf.h ]; then rm buildinf.h; fi
|
||||
@for i in $(SDIRS) ;\
|
||||
@@ -151,29 +156,40 @@ dclean:
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
cpt_err.o: ../include/openssl/crypto.h ../include/openssl/err.h
|
||||
cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/stack.h
|
||||
cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
|
||||
cpt_err.o: ../include/openssl/stack.h
|
||||
cryptlib.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
||||
cryptlib.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
cryptlib.o: ../include/openssl/stack.h cryptlib.h
|
||||
cryptlib.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||
cryptlib.o: cryptlib.h
|
||||
cversion.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
||||
cversion.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
cversion.o: ../include/openssl/stack.h buildinf.h cryptlib.h
|
||||
cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||
cversion.o: buildinf.h cryptlib.h
|
||||
ex_data.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
||||
ex_data.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
ex_data.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
||||
ex_data.o: ../include/openssl/opensslv.h ../include/openssl/stack.h cryptlib.h
|
||||
ex_data.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
|
||||
ex_data.o: ../include/openssl/stack.h cryptlib.h
|
||||
mem.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
mem.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
||||
mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
mem.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
||||
mem.o: ../include/openssl/opensslv.h ../include/openssl/stack.h cryptlib.h
|
||||
mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h cryptlib.h
|
||||
mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
||||
mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
mem_dbg.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
||||
mem_dbg.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
|
||||
mem_dbg.o: ../include/openssl/stack.h cryptlib.h
|
||||
tmdiff.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
||||
tmdiff.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
tmdiff.o: ../include/openssl/stack.h ../include/openssl/tmdiff.h cryptlib.h
|
||||
tmdiff.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||
tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h
|
||||
|
||||
@@ -23,34 +23,34 @@ APPS=
|
||||
|
||||
LIB=$(TOP)/libcrypto.a
|
||||
LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
|
||||
a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c \
|
||||
a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c \
|
||||
a_null.c a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c \
|
||||
a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c \
|
||||
x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c \
|
||||
x_name.c x_cinf.c x_x509.c x_crl.c x_info.c x_spki.c nsseq.c \
|
||||
x_name.c x_cinf.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c \
|
||||
d2i_r_pr.c i2d_r_pr.c d2i_r_pu.c i2d_r_pu.c \
|
||||
d2i_s_pr.c i2d_s_pr.c d2i_s_pu.c i2d_s_pu.c \
|
||||
d2i_pu.c d2i_pr.c i2d_pu.c i2d_pr.c\
|
||||
t_req.c t_x509.c t_crl.c t_pkey.c \
|
||||
t_req.c t_x509.c t_x509a.c t_crl.c t_pkey.c t_spki.c t_bitst.c \
|
||||
p7_i_s.c p7_signi.c p7_signd.c p7_recip.c p7_enc_c.c p7_evp.c \
|
||||
p7_dgst.c p7_s_e.c p7_enc.c p7_lib.c \
|
||||
f_int.c f_string.c i2d_dhp.c i2d_dsap.c d2i_dhp.c d2i_dsap.c n_pkey.c \
|
||||
f_enum.c a_hdr.c x_pkey.c a_bool.c x_exten.c \
|
||||
asn1_par.c asn1_lib.c asn1_err.c a_meth.c a_bytes.c \
|
||||
asn1_par.c asn1_lib.c asn1_err.c a_meth.c a_bytes.c a_strnid.c \
|
||||
evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c
|
||||
LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \
|
||||
a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o \
|
||||
a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o \
|
||||
a_null.o a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o \
|
||||
a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o \
|
||||
x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o \
|
||||
x_name.o x_cinf.o x_x509.o x_crl.o x_info.o x_spki.o nsseq.o \
|
||||
x_name.o x_cinf.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o \
|
||||
d2i_r_pr.o i2d_r_pr.o d2i_r_pu.o i2d_r_pu.o \
|
||||
d2i_s_pr.o i2d_s_pr.o d2i_s_pu.o i2d_s_pu.o \
|
||||
d2i_pu.o d2i_pr.o i2d_pu.o i2d_pr.o \
|
||||
t_req.o t_x509.o t_crl.o t_pkey.o \
|
||||
t_req.o t_x509.o t_x509a.o t_crl.o t_pkey.o t_spki.o t_bitst.o \
|
||||
p7_i_s.o p7_signi.o p7_signd.o p7_recip.o p7_enc_c.o p7_evp.o \
|
||||
p7_dgst.o p7_s_e.o p7_enc.o p7_lib.o \
|
||||
f_int.o f_string.o i2d_dhp.o i2d_dsap.o d2i_dhp.o d2i_dsap.o n_pkey.o \
|
||||
f_enum.o a_hdr.o x_pkey.o a_bool.o x_exten.o \
|
||||
asn1_par.o asn1_lib.o asn1_err.o a_meth.o a_bytes.o \
|
||||
asn1_par.o asn1_lib.o asn1_err.o a_meth.o a_bytes.o a_strnid.o \
|
||||
evp_asn1.o asn_pack.o p5_pbe.o p5_pbev2.o p8_pkey.o
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
@@ -160,11 +160,13 @@ a_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
a_digest.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
|
||||
a_digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
a_digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
|
||||
a_digest.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
a_digest.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
a_digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
a_digest.o: ../../include/openssl/stack.h ../cryptlib.h
|
||||
a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
a_digest.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
a_digest.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
a_digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
a_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
a_digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
a_digest.o: ../cryptlib.h
|
||||
a_dup.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
a_dup.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
a_dup.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
@@ -207,6 +209,13 @@ a_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
a_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_int.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
a_int.o: ../cryptlib.h
|
||||
a_mbstr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_mbstr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
a_mbstr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
a_mbstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
a_mbstr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_mbstr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
a_mbstr.o: ../cryptlib.h
|
||||
a_meth.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_meth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
a_meth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
@@ -214,6 +223,13 @@ a_meth.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
a_meth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_meth.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
a_meth.o: ../cryptlib.h
|
||||
a_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
a_null.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
a_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
a_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_null.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
a_null.o: ../cryptlib.h
|
||||
a_object.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_object.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
a_object.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
@@ -259,6 +275,13 @@ a_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
a_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
a_sign.o: ../cryptlib.h
|
||||
a_strnid.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_strnid.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
a_strnid.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
a_strnid.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
a_strnid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
a_strnid.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
|
||||
a_strnid.o: ../../include/openssl/stack.h ../cryptlib.h
|
||||
a_time.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_time.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
a_time.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
|
||||
@@ -788,6 +811,24 @@ p8_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
p8_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
p8_pkey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
|
||||
p8_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
|
||||
t_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
t_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
|
||||
t_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
t_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
t_crl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_crl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
t_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
@@ -812,15 +853,17 @@ t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
t_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
t_pkey.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h
|
||||
t_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h
|
||||
t_pkey.o: ../../include/openssl/stack.h ../cryptlib.h
|
||||
t_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
t_pkey.o: ../cryptlib.h
|
||||
t_req.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
t_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
t_req.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
|
||||
t_req.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
|
||||
t_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
|
||||
t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
|
||||
t_req.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
|
||||
t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
|
||||
t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
|
||||
t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
|
||||
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
|
||||
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
|
||||
@@ -829,7 +872,24 @@ t_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
|
||||
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_req.o: ../cryptlib.h
|
||||
t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
t_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
t_spki.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
|
||||
t_spki.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_spki.o: ../../include/openssl/md2.h ../../include/openssl/md5.h
|
||||
t_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h
|
||||
t_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
t_spki.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
t_spki.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
t_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_spki.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
|
||||
t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
|
||||
t_x509.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
t_x509.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
|
||||
t_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
|
||||
@@ -848,6 +908,23 @@ t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
|
||||
t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h
|
||||
t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
t_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
t_x509a.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
|
||||
t_x509a.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
t_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
t_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
t_x509a.o: ../../include/openssl/md2.h ../../include/openssl/md5.h
|
||||
t_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h
|
||||
t_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
t_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
t_x509a.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
t_x509a.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
t_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
t_x509a.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
|
||||
t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
|
||||
x_algor.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
x_algor.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
x_algor.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
@@ -1088,3 +1165,20 @@ x_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_x509.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
|
||||
x_x509.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
|
||||
x_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
|
||||
x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
|
||||
x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||
x_x509a.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
|
||||
x_x509a.o: ../../include/openssl/des.h ../../include/openssl/dh.h
|
||||
x_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
|
||||
x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
x_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
|
||||
x_x509a.o: ../../include/openssl/md2.h ../../include/openssl/md5.h
|
||||
x_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h
|
||||
x_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
x_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
|
||||
x_x509a.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
|
||||
x_x509a.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
|
||||
x_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
|
||||
x_x509a.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
|
||||
x_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
|
||||
|
||||
@@ -60,6 +60,15 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
ASN1_BIT_STRING *ASN1_BIT_STRING_new(void)
|
||||
{ return M_ASN1_BIT_STRING_new(); }
|
||||
|
||||
void ASN1_BIT_STRING_free(ASN1_BIT_STRING *x)
|
||||
{ M_ASN1_BIT_STRING_free(x); }
|
||||
|
||||
int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
|
||||
{ return M_ASN1_BIT_STRING_set(x, d, len); }
|
||||
|
||||
int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
|
||||
{
|
||||
int ret,j,r,bits,len;
|
||||
@@ -121,7 +130,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
|
||||
|
||||
if ((a == NULL) || ((*a) == NULL))
|
||||
{
|
||||
if ((ret=ASN1_BIT_STRING_new()) == NULL) return(NULL);
|
||||
if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL);
|
||||
}
|
||||
else
|
||||
ret=(*a);
|
||||
@@ -164,7 +173,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
|
||||
s=NULL;
|
||||
|
||||
ret->length=(int)len;
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
ret->data=s;
|
||||
ret->type=V_ASN1_BIT_STRING;
|
||||
if (a != NULL) (*a)=ret;
|
||||
@@ -173,7 +182,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
|
||||
err:
|
||||
ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i);
|
||||
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
|
||||
ASN1_BIT_STRING_free(ret);
|
||||
M_ASN1_BIT_STRING_free(ret);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,12 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
ASN1_BMPSTRING *ASN1_BMPSTRING_new(void)
|
||||
{ return M_ASN1_BMPSTRING_new(); }
|
||||
|
||||
void ASN1_BMPSTRING_free(ASN1_BMPSTRING *x)
|
||||
{ M_ASN1_BMPSTRING_free(x); }
|
||||
|
||||
int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
|
||||
@@ -71,7 +71,7 @@ B_ASN1_T61STRING,B_ASN1_VIDEOTEXSTRING,B_ASN1_IA5STRING,0,
|
||||
B_ASN1_UNIVERSALSTRING,B_ASN1_UNKNOWN,B_ASN1_BMPSTRING,B_ASN1_UNKNOWN,
|
||||
};
|
||||
|
||||
static int asn1_collate_primative(ASN1_STRING *a, ASN1_CTX *c);
|
||||
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c);
|
||||
/* type is a 'bitmap' of acceptable string types.
|
||||
*/
|
||||
ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
|
||||
@@ -124,7 +124,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
|
||||
else
|
||||
s=NULL;
|
||||
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
ret->length=(int)len;
|
||||
ret->data=s;
|
||||
ret->type=tag;
|
||||
@@ -205,7 +205,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
|
||||
c.tag=Ptag;
|
||||
c.xclass=Pclass;
|
||||
c.max=(length == 0)?0:(p+length);
|
||||
if (!asn1_collate_primative(ret,&c))
|
||||
if (!asn1_collate_primitive(ret,&c))
|
||||
goto err;
|
||||
else
|
||||
{
|
||||
@@ -218,8 +218,8 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
|
||||
{
|
||||
if ((ret->length < len) || (ret->data == NULL))
|
||||
{
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
s=(unsigned char *)Malloc((int)len);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
s=(unsigned char *)Malloc((int)len + 1);
|
||||
if (s == NULL)
|
||||
{
|
||||
i=ERR_R_MALLOC_FAILURE;
|
||||
@@ -229,12 +229,13 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
|
||||
else
|
||||
s=ret->data;
|
||||
memcpy(s,p,(int)len);
|
||||
s[len] = '\0';
|
||||
p+=len;
|
||||
}
|
||||
else
|
||||
{
|
||||
s=NULL;
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
}
|
||||
|
||||
ret->length=(int)len;
|
||||
@@ -253,11 +254,11 @@ err:
|
||||
}
|
||||
|
||||
|
||||
/* We are about to parse 0..n d2i_ASN1_bytes objects, we are to collapes
|
||||
* them into the one struture that is then returned */
|
||||
/* We are about to parse 0..n d2i_ASN1_bytes objects, we are to collapse
|
||||
* them into the one structure that is then returned */
|
||||
/* There have been a few bug fixes for this function from
|
||||
* Paul Keogh <paul.keogh@sse.ie>, many thanks to him */
|
||||
static int asn1_collate_primative(ASN1_STRING *a, ASN1_CTX *c)
|
||||
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
|
||||
{
|
||||
ASN1_STRING *os=NULL;
|
||||
BUF_MEM b;
|
||||
|
||||
@@ -58,16 +58,19 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "cryptlib.h"
|
||||
|
||||
#ifndef NO_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
int ASN1_digest(int (*i2d)(), EVP_MD *type, char *data, unsigned char *md,
|
||||
unsigned int *len)
|
||||
int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
|
||||
unsigned char *md, unsigned int *len)
|
||||
{
|
||||
EVP_MD_CTX ctx;
|
||||
int i;
|
||||
|
||||
@@ -78,6 +78,6 @@ char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)
|
||||
i=i2d(x,&p);
|
||||
p= b;
|
||||
ret=d2i(NULL,&p,i);
|
||||
Free((char *)b);
|
||||
Free(b);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
* for comments on encoding see a_int.c
|
||||
*/
|
||||
|
||||
ASN1_ENUMERATED *ASN1_ENUMERATED_new(void)
|
||||
{ return M_ASN1_ENUMERATED_new(); }
|
||||
|
||||
void ASN1_ENUMERATED_free(ASN1_ENUMERATED *x)
|
||||
{ M_ASN1_ENUMERATED_free(x); }
|
||||
|
||||
int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp)
|
||||
{
|
||||
int pad=0,ret,r,i,t;
|
||||
@@ -142,7 +148,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
|
||||
|
||||
if ((a == NULL) || ((*a) == NULL))
|
||||
{
|
||||
if ((ret=ASN1_ENUMERATED_new()) == NULL) return(NULL);
|
||||
if ((ret=M_ASN1_ENUMERATED_new()) == NULL) return(NULL);
|
||||
ret->type=V_ASN1_ENUMERATED;
|
||||
}
|
||||
else
|
||||
@@ -171,7 +177,12 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
|
||||
goto err;
|
||||
}
|
||||
to=s;
|
||||
if (*p & 0x80) /* a negative number */
|
||||
if(!len) {
|
||||
/* Strictly speaking this is an illegal ENUMERATED but we
|
||||
* tolerate it.
|
||||
*/
|
||||
ret->type=V_ASN1_ENUMERATED;
|
||||
} else if (*p & 0x80) /* a negative number */
|
||||
{
|
||||
ret->type=V_ASN1_NEG_ENUMERATED;
|
||||
if ((*p == 0xff) && (len != 1)) {
|
||||
@@ -208,7 +219,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
|
||||
p+=len;
|
||||
}
|
||||
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
ret->data=s;
|
||||
ret->length=(int)len;
|
||||
if (a != NULL) (*a)=ret;
|
||||
@@ -217,7 +228,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
|
||||
err:
|
||||
ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,i);
|
||||
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
|
||||
ASN1_ENUMERATED_free(ret);
|
||||
M_ASN1_ENUMERATED_free(ret);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -231,7 +242,7 @@ int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
|
||||
if (a->length < (sizeof(long)+1))
|
||||
{
|
||||
if (a->data != NULL)
|
||||
Free((char *)a->data);
|
||||
Free(a->data);
|
||||
if ((a->data=(unsigned char *)Malloc(sizeof(long)+1)) != NULL)
|
||||
memset((char *)a->data,0,sizeof(long)+1);
|
||||
}
|
||||
@@ -295,7 +306,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
|
||||
int len,j;
|
||||
|
||||
if (ai == NULL)
|
||||
ret=ASN1_ENUMERATED_new();
|
||||
ret=M_ASN1_ENUMERATED_new();
|
||||
else
|
||||
ret=ai;
|
||||
if (ret == NULL)
|
||||
@@ -311,7 +322,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
|
||||
ret->length=BN_bn2bin(bn,ret->data);
|
||||
return(ret);
|
||||
err:
|
||||
if (ret != ai) ASN1_ENUMERATED_free(ret);
|
||||
if (ret != ai) M_ASN1_ENUMERATED_free(ret);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,12 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_new(void)
|
||||
{ return M_ASN1_GENERALIZEDTIME_new(); }
|
||||
|
||||
void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *x)
|
||||
{ M_ASN1_GENERALIZEDTIME_free(x); }
|
||||
|
||||
int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
|
||||
{
|
||||
#ifdef CHARSET_EBCDIC
|
||||
@@ -106,7 +112,7 @@ ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,
|
||||
return(ret);
|
||||
err:
|
||||
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
|
||||
ASN1_GENERALIZEDTIME_free(ret);
|
||||
M_ASN1_GENERALIZEDTIME_free(ret);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -193,7 +199,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
#endif
|
||||
|
||||
if (s == NULL)
|
||||
s=ASN1_GENERALIZEDTIME_new();
|
||||
s=M_ASN1_GENERALIZEDTIME_new();
|
||||
if (s == NULL)
|
||||
return(NULL);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ ASN1_HEADER *ASN1_HEADER_new(void)
|
||||
ASN1_CTX c;
|
||||
|
||||
M_ASN1_New_Malloc(ret,ASN1_HEADER);
|
||||
M_ASN1_New(ret->header,ASN1_OCTET_STRING_new);
|
||||
M_ASN1_New(ret->header,M_ASN1_OCTET_STRING_new);
|
||||
ret->meth=NULL;
|
||||
ret->data=NULL;
|
||||
return(ret);
|
||||
@@ -112,8 +112,8 @@ ASN1_HEADER *ASN1_HEADER_new(void)
|
||||
void ASN1_HEADER_free(ASN1_HEADER *a)
|
||||
{
|
||||
if (a == NULL) return;
|
||||
ASN1_OCTET_STRING_free(a->header);
|
||||
M_ASN1_OCTET_STRING_free(a->header);
|
||||
if (a->meth != NULL)
|
||||
a->meth->destroy(a->data);
|
||||
Free((char *)a);
|
||||
Free(a);
|
||||
}
|
||||
|
||||
@@ -108,6 +108,6 @@ int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x)
|
||||
j+=i;
|
||||
n-=i;
|
||||
}
|
||||
Free((char *)b);
|
||||
Free(b);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,18 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
ASN1_INTEGER *ASN1_INTEGER_new(void)
|
||||
{ return M_ASN1_INTEGER_new();}
|
||||
|
||||
void ASN1_INTEGER_free(ASN1_INTEGER *x)
|
||||
{ M_ASN1_INTEGER_free(x);}
|
||||
|
||||
ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x)
|
||||
{ return M_ASN1_INTEGER_dup(x);}
|
||||
|
||||
int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y)
|
||||
{ return M_ASN1_INTEGER_cmp(x,y);}
|
||||
|
||||
/*
|
||||
* This converts an ASN1 INTEGER into its DER encoding.
|
||||
* The internal representation is an ASN1_STRING whose data is a big endian
|
||||
@@ -160,7 +172,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
|
||||
if ((a == NULL) || ((*a) == NULL))
|
||||
{
|
||||
if ((ret=ASN1_INTEGER_new()) == NULL) return(NULL);
|
||||
if ((ret=M_ASN1_INTEGER_new()) == NULL) return(NULL);
|
||||
ret->type=V_ASN1_INTEGER;
|
||||
}
|
||||
else
|
||||
@@ -190,7 +202,12 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
goto err;
|
||||
}
|
||||
to=s;
|
||||
if (*p & 0x80) /* a negative number */
|
||||
if(!len) {
|
||||
/* Strictly speaking this is an illegal INTEGER but we
|
||||
* tolerate it.
|
||||
*/
|
||||
ret->type=V_ASN1_INTEGER;
|
||||
} else if (*p & 0x80) /* a negative number */
|
||||
{
|
||||
ret->type=V_ASN1_NEG_INTEGER;
|
||||
if ((*p == 0xff) && (len != 1)) {
|
||||
@@ -231,7 +248,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
memcpy(s,p,(int)len);
|
||||
}
|
||||
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
ret->data=s;
|
||||
ret->length=(int)len;
|
||||
if (a != NULL) (*a)=ret;
|
||||
@@ -240,7 +257,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
err:
|
||||
ASN1err(ASN1_F_D2I_ASN1_INTEGER,i);
|
||||
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
|
||||
ASN1_INTEGER_free(ret);
|
||||
M_ASN1_INTEGER_free(ret);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -260,7 +277,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
|
||||
if ((a == NULL) || ((*a) == NULL))
|
||||
{
|
||||
if ((ret=ASN1_INTEGER_new()) == NULL) return(NULL);
|
||||
if ((ret=M_ASN1_INTEGER_new()) == NULL) return(NULL);
|
||||
ret->type=V_ASN1_INTEGER;
|
||||
}
|
||||
else
|
||||
@@ -289,7 +306,8 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
goto err;
|
||||
}
|
||||
to=s;
|
||||
ret->type=V_ASN1_INTEGER;
|
||||
ret->type=V_ASN1_INTEGER;
|
||||
if(len) {
|
||||
if ((*p == 0) && (len != 1))
|
||||
{
|
||||
p++;
|
||||
@@ -297,8 +315,9 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
}
|
||||
memcpy(s,p,(int)len);
|
||||
p+=len;
|
||||
}
|
||||
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
ret->data=s;
|
||||
ret->length=(int)len;
|
||||
if (a != NULL) (*a)=ret;
|
||||
@@ -307,7 +326,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
|
||||
err:
|
||||
ASN1err(ASN1_F_D2I_ASN1_UINTEGER,i);
|
||||
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
|
||||
ASN1_INTEGER_free(ret);
|
||||
M_ASN1_INTEGER_free(ret);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -321,7 +340,7 @@ int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)
|
||||
if (a->length < (sizeof(long)+1))
|
||||
{
|
||||
if (a->data != NULL)
|
||||
Free((char *)a->data);
|
||||
Free(a->data);
|
||||
if ((a->data=(unsigned char *)Malloc(sizeof(long)+1)) != NULL)
|
||||
memset((char *)a->data,0,sizeof(long)+1);
|
||||
}
|
||||
@@ -385,7 +404,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
|
||||
int len,j;
|
||||
|
||||
if (ai == NULL)
|
||||
ret=ASN1_INTEGER_new();
|
||||
ret=M_ASN1_INTEGER_new();
|
||||
else
|
||||
ret=ai;
|
||||
if (ret == NULL)
|
||||
@@ -401,7 +420,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
|
||||
ret->length=BN_bn2bin(bn,ret->data);
|
||||
return(ret);
|
||||
err:
|
||||
if (ret != ai) ASN1_INTEGER_free(ret);
|
||||
if (ret != ai) M_ASN1_INTEGER_free(ret);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
390
crypto/asn1/a_mbstr.c
Normal file
390
crypto/asn1/a_mbstr.c
Normal file
@@ -0,0 +1,390 @@
|
||||
/* a_mbstr.c */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
* project 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* 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 <ctype.h>
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
static int traverse_string(const unsigned char *p, int len, int inform,
|
||||
int (*rfunc)(unsigned long value, void *in), void *arg);
|
||||
static int in_utf8(unsigned long value, void *arg);
|
||||
static int out_utf8(unsigned long value, void *arg);
|
||||
static int type_str(unsigned long value, void *arg);
|
||||
static int cpy_asc(unsigned long value, void *arg);
|
||||
static int cpy_bmp(unsigned long value, void *arg);
|
||||
static int cpy_univ(unsigned long value, void *arg);
|
||||
static int cpy_utf8(unsigned long value, void *arg);
|
||||
static int is_printable(unsigned long value);
|
||||
|
||||
/* These functions take a string in UTF8, ASCII or multibyte form and
|
||||
* a mask of permissible ASN1 string types. It then works out the minimal
|
||||
* type (using the order Printable < IA5 < T61 < BMP < Universal < UTF8)
|
||||
* and creates a string of the correct type with the supplied data.
|
||||
* Yes this is horrible: it has to be :-(
|
||||
* The 'ncopy' form checks minimum and maximum size limits too.
|
||||
*/
|
||||
|
||||
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
|
||||
int inform, unsigned long mask)
|
||||
{
|
||||
return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
|
||||
}
|
||||
|
||||
int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
|
||||
int inform, unsigned long mask,
|
||||
long minsize, long maxsize)
|
||||
{
|
||||
int str_type;
|
||||
int ret;
|
||||
int outform, outlen;
|
||||
ASN1_STRING *dest;
|
||||
unsigned char *p;
|
||||
int nchar;
|
||||
char strbuf[32];
|
||||
int (*cpyfunc)(unsigned long,void *) = NULL;
|
||||
if(len == -1) len = strlen((const char *)in);
|
||||
if(!mask) mask = DIRSTRING_TYPE;
|
||||
|
||||
/* First do a string check and work out the number of characters */
|
||||
switch(inform) {
|
||||
|
||||
case MBSTRING_BMP:
|
||||
if(len & 1) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
|
||||
ASN1_R_INVALID_BMPSTRING_LENGTH);
|
||||
return -1;
|
||||
}
|
||||
nchar = len >> 1;
|
||||
break;
|
||||
|
||||
case MBSTRING_UNIV:
|
||||
if(len & 3) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
|
||||
ASN1_R_INVALID_UNIVERSALSTRING_LENGTH);
|
||||
return -1;
|
||||
}
|
||||
nchar = len >> 2;
|
||||
break;
|
||||
|
||||
case MBSTRING_UTF8:
|
||||
nchar = 0;
|
||||
/* This counts the characters and does utf8 syntax checking */
|
||||
ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar);
|
||||
if(ret < 0) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
|
||||
ASN1_R_INVALID_UTF8STRING);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case MBSTRING_ASC:
|
||||
nchar = len;
|
||||
break;
|
||||
|
||||
default:
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_UNKNOWN_FORMAT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((minsize > 0) && (nchar < minsize)) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_SHORT);
|
||||
sprintf(strbuf, "%ld", minsize);
|
||||
ERR_add_error_data(2, "minsize=", strbuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((maxsize > 0) && (nchar > maxsize)) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_STRING_TOO_LONG);
|
||||
sprintf(strbuf, "%ld", maxsize);
|
||||
ERR_add_error_data(2, "maxsize=", strbuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Now work out minimal type (if any) */
|
||||
if(traverse_string(in, len, inform, type_str, &mask) < 0) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_ILLEGAL_CHARACTERS);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* Now work out output format and string type */
|
||||
outform = MBSTRING_ASC;
|
||||
if(mask & B_ASN1_PRINTABLESTRING) str_type = V_ASN1_PRINTABLESTRING;
|
||||
else if(mask & B_ASN1_IA5STRING) str_type = V_ASN1_IA5STRING;
|
||||
else if(mask & B_ASN1_T61STRING) str_type = V_ASN1_T61STRING;
|
||||
else if(mask & B_ASN1_BMPSTRING) {
|
||||
str_type = V_ASN1_BMPSTRING;
|
||||
outform = MBSTRING_BMP;
|
||||
} else if(mask & B_ASN1_UNIVERSALSTRING) {
|
||||
str_type = V_ASN1_UNIVERSALSTRING;
|
||||
outform = MBSTRING_UNIV;
|
||||
} else {
|
||||
str_type = V_ASN1_UTF8STRING;
|
||||
outform = MBSTRING_UTF8;
|
||||
}
|
||||
if(!out) return str_type;
|
||||
if(*out) {
|
||||
dest = *out;
|
||||
if(dest->data) {
|
||||
dest->length = 0;
|
||||
Free(dest->data);
|
||||
dest->data = NULL;
|
||||
}
|
||||
dest->type = str_type;
|
||||
} else {
|
||||
dest = ASN1_STRING_type_new(str_type);
|
||||
if(!dest) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
|
||||
ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
*out = dest;
|
||||
}
|
||||
/* If both the same type just copy across */
|
||||
if(inform == outform) {
|
||||
if(!ASN1_STRING_set(dest, in, len)) {
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY,ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
return str_type;
|
||||
}
|
||||
|
||||
/* Work out how much space the destination will need */
|
||||
switch(outform) {
|
||||
case MBSTRING_ASC:
|
||||
outlen = nchar;
|
||||
cpyfunc = cpy_asc;
|
||||
break;
|
||||
|
||||
case MBSTRING_BMP:
|
||||
outlen = nchar << 1;
|
||||
cpyfunc = cpy_bmp;
|
||||
break;
|
||||
|
||||
case MBSTRING_UNIV:
|
||||
outlen = nchar << 2;
|
||||
cpyfunc = cpy_univ;
|
||||
break;
|
||||
|
||||
case MBSTRING_UTF8:
|
||||
outlen = 0;
|
||||
traverse_string(in, len, inform, out_utf8, &outlen);
|
||||
cpyfunc = cpy_utf8;
|
||||
break;
|
||||
}
|
||||
if(!(p = Malloc(outlen + 1))) {
|
||||
ASN1_STRING_free(dest);
|
||||
ASN1err(ASN1_F_ASN1_MBSTRING_COPY,ERR_R_MALLOC_FAILURE);
|
||||
return -1;
|
||||
}
|
||||
dest->length = outlen;
|
||||
dest->data = p;
|
||||
p[outlen] = 0;
|
||||
traverse_string(in, len, inform, cpyfunc, &p);
|
||||
return str_type;
|
||||
}
|
||||
|
||||
/* This function traverses a string and passes the value of each character
|
||||
* to an optional function along with a void * argument.
|
||||
*/
|
||||
|
||||
static int traverse_string(const unsigned char *p, int len, int inform,
|
||||
int (*rfunc)(unsigned long value, void *in), void *arg)
|
||||
{
|
||||
unsigned long value;
|
||||
int ret;
|
||||
while(len) {
|
||||
if(inform == MBSTRING_ASC) {
|
||||
value = *p++;
|
||||
len--;
|
||||
} else if(inform == MBSTRING_BMP) {
|
||||
value = *p++ << 8;
|
||||
value |= *p++;
|
||||
len -= 2;
|
||||
} else if(inform == MBSTRING_UNIV) {
|
||||
value = *p++ << 24;
|
||||
value |= *p++ << 16;
|
||||
value |= *p++ << 8;
|
||||
value |= *p++;
|
||||
len -= 4;
|
||||
} else {
|
||||
ret = UTF8_getc(p, len, &value);
|
||||
if(ret < 0) return -1;
|
||||
len -= ret;
|
||||
p += ret;
|
||||
}
|
||||
if(rfunc) {
|
||||
ret = rfunc(value, arg);
|
||||
if(ret <= 0) return ret;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Various utility functions for traverse_string */
|
||||
|
||||
/* Just count number of characters */
|
||||
|
||||
static int in_utf8(unsigned long value, void *arg)
|
||||
{
|
||||
int *nchar;
|
||||
nchar = arg;
|
||||
(*nchar)++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Determine size of output as a UTF8 String */
|
||||
|
||||
static int out_utf8(unsigned long value, void *arg)
|
||||
{
|
||||
long *outlen;
|
||||
outlen = arg;
|
||||
*outlen += UTF8_putc(NULL, -1, value);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Determine the "type" of a string: check each character against a
|
||||
* supplied "mask".
|
||||
*/
|
||||
|
||||
static int type_str(unsigned long value, void *arg)
|
||||
{
|
||||
unsigned long types;
|
||||
types = *((unsigned long *)arg);
|
||||
if((types & B_ASN1_PRINTABLESTRING) && !is_printable(value))
|
||||
types &= ~B_ASN1_PRINTABLESTRING;
|
||||
if((types & B_ASN1_IA5STRING) && (value > 127))
|
||||
types &= ~B_ASN1_IA5STRING;
|
||||
if((types & B_ASN1_T61STRING) && (value > 0xff))
|
||||
types &= ~B_ASN1_T61STRING;
|
||||
if((types & B_ASN1_BMPSTRING) && (value > 0xffff))
|
||||
types &= ~B_ASN1_BMPSTRING;
|
||||
if(!types) return -1;
|
||||
*((unsigned long *)arg) = types;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Copy one byte per character ASCII like strings */
|
||||
|
||||
static int cpy_asc(unsigned long value, void *arg)
|
||||
{
|
||||
unsigned char **p, *q;
|
||||
p = arg;
|
||||
q = *p;
|
||||
*q = (unsigned char) value;
|
||||
(*p)++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Copy two byte per character BMPStrings */
|
||||
|
||||
static int cpy_bmp(unsigned long value, void *arg)
|
||||
{
|
||||
unsigned char **p, *q;
|
||||
p = arg;
|
||||
q = *p;
|
||||
*q++ = (unsigned char) ((value >> 8) & 0xff);
|
||||
*q = (unsigned char) (value & 0xff);
|
||||
*p += 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Copy four byte per character UniversalStrings */
|
||||
|
||||
static int cpy_univ(unsigned long value, void *arg)
|
||||
{
|
||||
unsigned char **p, *q;
|
||||
p = arg;
|
||||
q = *p;
|
||||
*q++ = (unsigned char) ((value >> 24) & 0xff);
|
||||
*q++ = (unsigned char) ((value >> 16) & 0xff);
|
||||
*q++ = (unsigned char) ((value >> 8) & 0xff);
|
||||
*q = (unsigned char) (value & 0xff);
|
||||
*p += 4;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Copy to a UTF8String */
|
||||
|
||||
static int cpy_utf8(unsigned long value, void *arg)
|
||||
{
|
||||
unsigned char **p;
|
||||
int ret;
|
||||
p = arg;
|
||||
/* We already know there is enough room so pass 0xff as the length */
|
||||
ret = UTF8_putc(*p, 0xff, value);
|
||||
*p += ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return 1 if the character is permitted in a PrintableString */
|
||||
static int is_printable(unsigned long value)
|
||||
{
|
||||
int ch;
|
||||
if(value > 0x7f) return 0;
|
||||
ch = (int) value;
|
||||
/* Note: we can't use 'isalnum' because certain accented
|
||||
* characters may count as alphanumeric in some environments.
|
||||
*/
|
||||
if((ch >= 'a') && (ch <= 'z')) return 1;
|
||||
if((ch >= 'A') && (ch <= 'Z')) return 1;
|
||||
if((ch >= '0') && (ch <= '9')) return 1;
|
||||
if ((ch == ' ') || strchr("'()+,-./:=?", ch)) return 1;
|
||||
return 0;
|
||||
}
|
||||
119
crypto/asn1/a_null.c
Normal file
119
crypto/asn1/a_null.c
Normal file
@@ -0,0 +1,119 @@
|
||||
/* a_null.c */
|
||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||
* project 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* 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 "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
/* ASN1 functions for NULL type. For compatibility with other ASN1 code
|
||||
* it returns a pointer to an "ASN1_NULL" structure. The new/free functions
|
||||
* don't need to do any allocating because nothing is stored in a NULL.
|
||||
*/
|
||||
|
||||
int i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **pp)
|
||||
{
|
||||
if(!a) return 0;
|
||||
if (pp) ASN1_put_object(pp,0,0,V_ASN1_NULL,V_ASN1_UNIVERSAL);
|
||||
return 2;
|
||||
}
|
||||
|
||||
ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, unsigned char **pp, long length)
|
||||
{
|
||||
ASN1_NULL *ret = NULL;
|
||||
unsigned char *p;
|
||||
long len;
|
||||
int inf,tag,xclass;
|
||||
int i=0;
|
||||
|
||||
p= *pp;
|
||||
inf=ASN1_get_object(&p,&len,&tag,&xclass,length);
|
||||
if (inf & 0x80)
|
||||
{
|
||||
i=ASN1_R_BAD_OBJECT_HEADER;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (tag != V_ASN1_NULL)
|
||||
{
|
||||
i=ASN1_R_EXPECTING_A_NULL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (len != 0)
|
||||
{
|
||||
i=ASN1_R_NULL_IS_WRONG_LENGTH;
|
||||
goto err;
|
||||
}
|
||||
ret=(ASN1_NULL *)1;
|
||||
if (a != NULL) (*a)=ret;
|
||||
*pp=p;
|
||||
return(ret);
|
||||
err:
|
||||
ASN1err(ASN1_F_D2I_ASN1_NULL,i);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
ASN1_NULL *ASN1_NULL_new(void)
|
||||
{
|
||||
return (ASN1_NULL *)1;
|
||||
}
|
||||
|
||||
void ASN1_NULL_free(ASN1_NULL *a)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -222,8 +222,8 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
|
||||
}
|
||||
if ((ret->data == NULL) || (ret->length < len))
|
||||
{
|
||||
if (ret->data != NULL) Free((char *)ret->data);
|
||||
ret->data=(unsigned char *)Malloc((int)len);
|
||||
if (ret->data != NULL) Free(ret->data);
|
||||
ret->data=(unsigned char *)Malloc(len ? (int)len : 1);
|
||||
ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;
|
||||
if (ret->data == NULL)
|
||||
{ i=ERR_R_MALLOC_FAILURE; goto err; }
|
||||
@@ -269,7 +269,7 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a)
|
||||
if (a == NULL) return;
|
||||
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
|
||||
{
|
||||
#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause mempory leaks */
|
||||
#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */
|
||||
if (a->sn != NULL) Free((void *)a->sn);
|
||||
if (a->ln != NULL) Free((void *)a->ln);
|
||||
#endif
|
||||
|
||||
@@ -60,11 +60,23 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void)
|
||||
{ return M_ASN1_OCTET_STRING_new(); }
|
||||
|
||||
void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *x)
|
||||
{ M_ASN1_OCTET_STRING_free(x); }
|
||||
|
||||
ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *x)
|
||||
{ return M_ASN1_OCTET_STRING_dup(x); }
|
||||
|
||||
int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b)
|
||||
{ return M_ASN1_OCTET_STRING_cmp(a, b); }
|
||||
|
||||
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, unsigned char *d, int len)
|
||||
{ return M_ASN1_OCTET_STRING_set(x, d, len); }
|
||||
|
||||
int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **pp)
|
||||
{
|
||||
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
|
||||
V_ASN1_OCTET_STRING,V_ASN1_UNIVERSAL));
|
||||
}
|
||||
{ return M_i2d_ASN1_OCTET_STRING(a, pp); }
|
||||
|
||||
ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
|
||||
unsigned char **pp, long length)
|
||||
|
||||
@@ -60,6 +60,12 @@
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
ASN1_IA5STRING *ASN1_IA5STRING_new(void)
|
||||
{ return M_ASN1_IA5STRING_new();}
|
||||
|
||||
void ASN1_IA5STRING_free(ASN1_IA5STRING *x)
|
||||
{ M_ASN1_IA5STRING_free(x);}
|
||||
|
||||
int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_ASN1_IA5STRING(a,pp)); }
|
||||
|
||||
@@ -67,15 +73,30 @@ ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_ASN1_IA5STRING(a,pp,l)); }
|
||||
|
||||
ASN1_T61STRING *ASN1_T61STRING_new(void)
|
||||
{ return M_ASN1_T61STRING_new();}
|
||||
|
||||
void ASN1_T61STRING_free(ASN1_T61STRING *x)
|
||||
{ M_ASN1_T61STRING_free(x);}
|
||||
|
||||
ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_ASN1_T61STRING(a,pp,l)); }
|
||||
|
||||
ASN1_PRINTABLESTRING *ASN1_PRINTABLESTRING_new(void)
|
||||
{ return M_ASN1_PRINTABLESTRING_new();}
|
||||
|
||||
void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *x)
|
||||
{ M_ASN1_PRINTABLESTRING_free(x);}
|
||||
|
||||
ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a,
|
||||
unsigned char **pp, long l)
|
||||
{ return(M_d2i_ASN1_PRINTABLESTRING(a,pp,
|
||||
l)); }
|
||||
|
||||
int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_ASN1_PRINTABLESTRING(a,pp)); }
|
||||
|
||||
int i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_ASN1_PRINTABLE(a,pp)); }
|
||||
|
||||
@@ -149,6 +170,11 @@ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
|
||||
return(1);
|
||||
}
|
||||
|
||||
ASN1_STRING *DIRECTORYSTRING_new(void)
|
||||
{ return M_DIRECTORYSTRING_new();}
|
||||
|
||||
void DIRECTORYSTRING_free(ASN1_STRING *x)
|
||||
{ M_DIRECTORYSTRING_free(x);}
|
||||
|
||||
int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_DIRECTORYSTRING(a,pp)); }
|
||||
@@ -157,6 +183,12 @@ ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp,
|
||||
long l)
|
||||
{ return(M_d2i_DIRECTORYSTRING(a,pp,l)); }
|
||||
|
||||
ASN1_STRING *DISPLAYTEXT_new(void)
|
||||
{ return M_DISPLAYTEXT_new();}
|
||||
|
||||
void DISPLAYTEXT_free(ASN1_STRING *x)
|
||||
{ M_DISPLAYTEXT_free(x);}
|
||||
|
||||
int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **pp)
|
||||
{ return(M_i2d_DISPLAYTEXT(a,pp)); }
|
||||
|
||||
|
||||
@@ -58,10 +58,13 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "cryptlib.h"
|
||||
|
||||
#ifndef NO_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
@@ -126,11 +129,11 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB);
|
||||
goto err;
|
||||
}
|
||||
if (signature->data != NULL) Free((char *)signature->data);
|
||||
if (signature->data != NULL) Free(signature->data);
|
||||
signature->data=buf_out;
|
||||
buf_out=NULL;
|
||||
signature->length=outl;
|
||||
/* In the interests of compatability, I'll make sure that
|
||||
/* In the interests of compatibility, I'll make sure that
|
||||
* the bit string has a 'not-used bits' value of 0
|
||||
*/
|
||||
signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
|
||||
@@ -138,8 +141,8 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
err:
|
||||
memset(&ctx,0,sizeof(ctx));
|
||||
if (buf_in != NULL)
|
||||
{ memset((char *)buf_in,0,(unsigned int)inl); Free((char *)buf_in); }
|
||||
{ memset((char *)buf_in,0,(unsigned int)inl); Free(buf_in); }
|
||||
if (buf_out != NULL)
|
||||
{ memset((char *)buf_out,0,outll); Free((char *)buf_out); }
|
||||
{ memset((char *)buf_out,0,outll); Free(buf_out); }
|
||||
return(outl);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user