Compare commits
3203 Commits
OpenSSL_0_
...
STATE_afte
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a372f9bf25 | ||
|
|
fdaea9ed2e | ||
|
|
5daec7ea0e | ||
|
|
e9224c7177 | ||
|
|
e90e719739 | ||
|
|
7ba666fa0e | ||
|
|
86a62cf15c | ||
|
|
b11405723d | ||
|
|
4c3a2b4f8a | ||
|
|
bbf8198feb | ||
|
|
3dda0dd2a2 | ||
|
|
fa63a98ad8 | ||
|
|
1fc73fef48 | ||
|
|
90543bd07a | ||
|
|
43ecece595 | ||
|
|
4ba8cabf62 | ||
|
|
f68bb3c51f | ||
|
|
6d4ac67ac1 | ||
|
|
b84d5b72f1 | ||
|
|
8cbccedf7c | ||
|
|
1c24347062 | ||
|
|
9ef888130d | ||
|
|
4387f47832 | ||
|
|
38d6e4bb50 | ||
|
|
ced621e3c2 | ||
|
|
85940ea8ea | ||
|
|
439ae4d398 | ||
|
|
4fbe40c54f | ||
|
|
578ca7e4cd | ||
|
|
7e8c30b589 | ||
|
|
2b32b28191 | ||
|
|
532215f2db | ||
|
|
5319be4438 | ||
|
|
f7a3e73ef6 | ||
|
|
ff3345cb72 | ||
|
|
716b2079dc | ||
|
|
e7b6228fd3 | ||
|
|
2053c43de2 | ||
|
|
1c3e4a3660 | ||
|
|
4707991520 | ||
|
|
7a1f92fdc3 | ||
|
|
e7a285694e | ||
|
|
6ab285bf4c | ||
|
|
1d3159bcca | ||
|
|
f60ceb54eb | ||
|
|
0f995b2f40 | ||
|
|
848f735ae4 | ||
|
|
a678430602 | ||
|
|
e9b553dac1 | ||
|
|
db3758923b | ||
|
|
5e4a75e79f | ||
|
|
43d601641f | ||
|
|
55f78baf32 | ||
|
|
6c359479d7 | ||
|
|
4579924b7e | ||
|
|
2047bda6fb | ||
|
|
406c6f6962 | ||
|
|
df29cc8f77 | ||
|
|
ec7164133d | ||
|
|
ba8ad07490 | ||
|
|
17582ccf21 | ||
|
|
31be2daa06 | ||
|
|
de868e0b94 | ||
|
|
15994b034a | ||
|
|
922fa76e26 | ||
|
|
19aa370573 | ||
|
|
d020e701bb | ||
|
|
364ff369d1 | ||
|
|
8a09b3866a | ||
|
|
137445140b | ||
|
|
6a8afe2201 | ||
|
|
1e3a9b650f | ||
|
|
229dc0ee31 | ||
|
|
fcc764639d | ||
|
|
821385ad00 | ||
|
|
25ff76d565 | ||
|
|
9801fb61d0 | ||
|
|
20199ca809 | ||
|
|
711f1a3c26 | ||
|
|
a1d85309ee | ||
|
|
450cee5c3a | ||
|
|
a2dbcf3644 | ||
|
|
4663355496 | ||
|
|
9dc610495c | ||
|
|
055076cd4f | ||
|
|
527497a722 | ||
|
|
32d21c1ef6 | ||
|
|
629b58b7fb | ||
|
|
7fa2a81d34 | ||
|
|
7f66ab4783 | ||
|
|
95189389b0 | ||
|
|
b4b82ab465 | ||
|
|
89618e7a0d | ||
|
|
b87e2576b5 | ||
|
|
0bf23d9b20 | ||
|
|
813f256783 | ||
|
|
bfa96bc20e | ||
|
|
6f17f16fd5 | ||
|
|
84034f7aec | ||
|
|
acce40c585 | ||
|
|
6dc78bf7e8 | ||
|
|
ce4f169ff9 | ||
|
|
c566205319 | ||
|
|
eaf6c61c9f | ||
|
|
4c53d11d7f | ||
|
|
1d647444e3 | ||
|
|
c1eeb6078f | ||
|
|
953db08416 | ||
|
|
0a5942093e | ||
|
|
d78254aa28 | ||
|
|
af67804bef | ||
|
|
35a6db8640 | ||
|
|
56dc24d483 | ||
|
|
84d828ab70 | ||
|
|
cfae3d94e9 | ||
|
|
b9c23cca01 | ||
|
|
c863201780 | ||
|
|
cb21d001c9 | ||
|
|
c7faede37b | ||
|
|
d4e573f305 | ||
|
|
e20afbb340 | ||
|
|
2b2ab52354 | ||
|
|
8d6e60486f | ||
|
|
1f30946481 | ||
|
|
b1697f189b | ||
|
|
17a202add7 | ||
|
|
3bd16a8902 | ||
|
|
555d75252a | ||
|
|
eaad02a747 | ||
|
|
97101fafd5 | ||
|
|
403f1bdc70 | ||
|
|
d574d83993 | ||
|
|
83411793b6 | ||
|
|
65caee44ff | ||
|
|
738554331b | ||
|
|
3f083ef0eb | ||
|
|
17ed6c06a7 | ||
|
|
c112323dd5 | ||
|
|
0709385d3c | ||
|
|
54a656ef08 | ||
|
|
8f797f14b8 | ||
|
|
c0d64de660 | ||
|
|
c1ce8cf3b8 | ||
|
|
2d780dfd81 | ||
|
|
b6fee5c2fb | ||
|
|
10fa047622 | ||
|
|
04f0a6ba39 | ||
|
|
eb43641dd3 | ||
|
|
d479dc1d02 | ||
|
|
7fb8d254fe | ||
|
|
c99935e32c | ||
|
|
2232e262bf | ||
|
|
137e7e3aa1 | ||
|
|
ba36b61d3d | ||
|
|
ccb13ded84 | ||
|
|
9ea1b87862 | ||
|
|
688cf84d1f | ||
|
|
69ce48c307 | ||
|
|
06b7c8d5ba | ||
|
|
6722b62b36 | ||
|
|
7d80b27949 | ||
|
|
d742bd882e | ||
|
|
97a06ad9ef | ||
|
|
756b9a0046 | ||
|
|
96c930dd2f | ||
|
|
c81a15099a | ||
|
|
a8c125550c | ||
|
|
3782350c14 | ||
|
|
d6257073aa | ||
|
|
ddff68bee7 | ||
|
|
491659c436 | ||
|
|
8d6fc30bc7 | ||
|
|
56824b9658 | ||
|
|
892e9625d3 | ||
|
|
e2916b2540 | ||
|
|
1810d2088e | ||
|
|
d618f703ec | ||
|
|
896e4fef30 | ||
|
|
38c7271a39 | ||
|
|
5e3247d8bc | ||
|
|
b53e44e572 | ||
|
|
e5f4d8279d | ||
|
|
86e8b56ac4 | ||
|
|
bff1567623 | ||
|
|
db199abd9e | ||
|
|
b6d0defb98 | ||
|
|
ad22b914d6 | ||
|
|
f216fae545 | ||
|
|
242823c9bc | ||
|
|
40efa67248 | ||
|
|
769fedc3ad | ||
|
|
9c3db400dc | ||
|
|
d9ec9d990f | ||
|
|
b5148cf1f7 | ||
|
|
90a617e050 | ||
|
|
259cdf2af9 | ||
|
|
6c950e0dc9 | ||
|
|
62dd6f161a | ||
|
|
6aba658cd8 | ||
|
|
accb0c6edb | ||
|
|
e0db2eed8d | ||
|
|
00a357ab20 | ||
|
|
8ee4845b65 | ||
|
|
19b8d06a79 | ||
|
|
5c6bf03117 | ||
|
|
f72ed6153b | ||
|
|
d652a0957f | ||
|
|
fbcd27907b | ||
|
|
a551bea52e | ||
|
|
6cb686208e | ||
|
|
bd1fb77245 | ||
|
|
d610d27f30 | ||
|
|
96b35c9e26 | ||
|
|
907a8f1e6e | ||
|
|
e1c191fe44 | ||
|
|
5aa3429c5d | ||
|
|
ffd418f217 | ||
|
|
0711be1696 | ||
|
|
7521ab3d0b | ||
|
|
0587ec2645 | ||
|
|
b76d66fbf6 | ||
|
|
06f851f721 | ||
|
|
f6661d391c | ||
|
|
284b216b3a | ||
|
|
05dbe6ee1f | ||
|
|
871d0f5126 | ||
|
|
5be1264b7e | ||
|
|
314c667050 | ||
|
|
28c8a911bd | ||
|
|
437d1ed49f | ||
|
|
12fd8be2c4 | ||
|
|
8258f7b361 | ||
|
|
e15ea3d9e1 | ||
|
|
677532629d | ||
|
|
57d8ff79b2 | ||
|
|
4b14ed760d | ||
|
|
79a6260a11 | ||
|
|
a0bf8f2008 | ||
|
|
408bf2f0c4 | ||
|
|
874fee478c | ||
|
|
90d9a69bb1 | ||
|
|
4006c56036 | ||
|
|
1729588435 | ||
|
|
6f7c2cb31e | ||
|
|
a4629f4136 | ||
|
|
56b5f687e4 | ||
|
|
caa4f47f61 | ||
|
|
36757b4438 | ||
|
|
75871dda4b | ||
|
|
506fec1a95 | ||
|
|
aae329c447 | ||
|
|
02acf1409e | ||
|
|
6ac3309c74 | ||
|
|
1b15cfa11d | ||
|
|
76dfca879f | ||
|
|
7cdc7bacea | ||
|
|
fbd78b5c08 | ||
|
|
fbcd0da597 | ||
|
|
665dc3924d | ||
|
|
4bdacff25b | ||
|
|
ecd45314b8 | ||
|
|
3e06fb754e | ||
|
|
b2e20a31ea | ||
|
|
38e19a4220 | ||
|
|
f28164fefd | ||
|
|
2eaabb718b | ||
|
|
5572f482e7 | ||
|
|
729f0a277e | ||
|
|
c55d759168 | ||
|
|
b7910992d8 | ||
|
|
cf3b8b52f1 | ||
|
|
42b06fbaca | ||
|
|
2245cd87d4 | ||
|
|
c199837c54 | ||
|
|
83699c4784 | ||
|
|
30afcc072a | ||
|
|
832f9304fd | ||
|
|
fa4bde98d2 | ||
|
|
ca80756c70 | ||
|
|
ef0baf60aa | ||
|
|
7ba3a4c3d2 | ||
|
|
29e48c18b7 | ||
|
|
982dfb7d10 | ||
|
|
8c4b69d3ab | ||
|
|
0e2cc42cfb | ||
|
|
1e5c205ccb | ||
|
|
4c82171a8e | ||
|
|
88c80b3e75 | ||
|
|
27bad5ad3d | ||
|
|
6a89a25c27 | ||
|
|
001ab3abad | ||
|
|
ec8ad2bb96 | ||
|
|
5fbb02fcb1 | ||
|
|
4e1b50e219 | ||
|
|
d7b2342a6a | ||
|
|
7e9db7cefc | ||
|
|
d30e4c5b0b | ||
|
|
9de6bb8abc | ||
|
|
72e04bd13f | ||
|
|
4ec0448122 | ||
|
|
842d8e209b | ||
|
|
292fcd5c7b | ||
|
|
74e3931f84 | ||
|
|
12dadc555f | ||
|
|
b75b2225e5 | ||
|
|
12f27bd414 | ||
|
|
69deec58fb | ||
|
|
1e976bdc46 | ||
|
|
9946fceb9d | ||
|
|
6fed88113b | ||
|
|
97ebe047d0 | ||
|
|
fc6a6a1030 | ||
|
|
3d840c827f | ||
|
|
a2a1a04e53 | ||
|
|
f86abc2e80 | ||
|
|
7104c376ae | ||
|
|
0638ced5cc | ||
|
|
e984b2af64 | ||
|
|
70e96dcf59 | ||
|
|
2c696b2ddc | ||
|
|
9a48b07ee4 | ||
|
|
230fd6b7b6 | ||
|
|
20b33a015f | ||
|
|
293d5082c7 | ||
|
|
929f116733 | ||
|
|
ba5ba5490d | ||
|
|
b8565a9af9 | ||
|
|
94960c8421 | ||
|
|
6859cf7459 | ||
|
|
2018681b33 | ||
|
|
e204516178 | ||
|
|
153aecf91a | ||
|
|
cd98ab6491 | ||
|
|
b3823ac64b | ||
|
|
5d9470ff8e | ||
|
|
e78f137899 | ||
|
|
40e66398db | ||
|
|
6e32d0a74b | ||
|
|
a4f53a1c73 | ||
|
|
a90ae02454 | ||
|
|
4c8f79a33e | ||
|
|
7cc6ec7af7 | ||
|
|
c2bbf275b2 | ||
|
|
9226e2187c | ||
|
|
48921e00fc | ||
|
|
f804930150 | ||
|
|
3403caf3da | ||
|
|
ba11121731 | ||
|
|
ed5e37c309 | ||
|
|
65b1d31df5 | ||
|
|
b499ed06d2 | ||
|
|
6ff7c95843 | ||
|
|
41cc7096b8 | ||
|
|
c237de058f | ||
|
|
e2aeb8174b | ||
|
|
34f1f2a81c | ||
|
|
c96f0fd2d1 | ||
|
|
8aefe253a7 | ||
|
|
7e31164ae0 | ||
|
|
ad55f581f9 | ||
|
|
d4a8f90cab | ||
|
|
41ab00bedf | ||
|
|
fc85ac20c7 | ||
|
|
e88479243c | ||
|
|
c787525ac8 | ||
|
|
9a2601033d | ||
|
|
fbb311a7d2 | ||
|
|
f309c1ae50 | ||
|
|
82a20fb0f0 | ||
|
|
428112ef10 | ||
|
|
64376cd8ff | ||
|
|
cc8aa08b02 | ||
|
|
1c4e4e4f56 | ||
|
|
3f6db7f518 | ||
|
|
8435a755fd | ||
|
|
52c29b7b99 | ||
|
|
c6bf63da7c | ||
|
|
0fd05a2f0f | ||
|
|
1fd0338b49 | ||
|
|
b2be73e4e8 | ||
|
|
37f5fcf85c | ||
|
|
f742e497dd | ||
|
|
dcc426fcfe | ||
|
|
7eb18f1237 | ||
|
|
265e892fed | ||
|
|
623e9e66c0 | ||
|
|
90f5a2b6fe | ||
|
|
bf625abe29 | ||
|
|
b44069730b | ||
|
|
749d055eba | ||
|
|
49a0f77867 | ||
|
|
2af52de7b5 | ||
|
|
629d860cbc | ||
|
|
056cc163f5 | ||
|
|
e09efcf71a | ||
|
|
763b4dcc66 | ||
|
|
83348e0b80 | ||
|
|
f13ddd5d0a | ||
|
|
18a31aa861 | ||
|
|
b2a4e959c9 | ||
|
|
f17ef241d1 | ||
|
|
aa1e56b0b9 | ||
|
|
7ef524ea1c | ||
|
|
0c7141a343 | ||
|
|
5488bb6197 | ||
|
|
8e28c67155 | ||
|
|
36969082bb | ||
|
|
4fde69b066 | ||
|
|
fd9a4dbe94 | ||
|
|
f0db0ed35d | ||
|
|
6d24cbf452 | ||
|
|
5454829ae6 | ||
|
|
da0bca6466 | ||
|
|
4705bd9b37 | ||
|
|
5bd90983bc | ||
|
|
329f981582 | ||
|
|
cece7adcee | ||
|
|
74cc4903ef | ||
|
|
41fdcfa71e | ||
|
|
60cc56b1a9 | ||
|
|
f912e9293f | ||
|
|
56939728b7 | ||
|
|
ea26226046 | ||
|
|
17f6279317 | ||
|
|
e172d60ddb | ||
|
|
f8fe7fa491 | ||
|
|
fbe792f0ac | ||
|
|
14a7cfb32a | ||
|
|
7a8645d171 | ||
|
|
5bf738737d | ||
|
|
415e03aa6f | ||
|
|
ac120e20e3 | ||
|
|
3f90e45079 | ||
|
|
9dcc441a5f | ||
|
|
db4f691f9f | ||
|
|
d28735a05b | ||
|
|
183847747a | ||
|
|
bac6012308 | ||
|
|
aaa384ca1a | ||
|
|
f908226898 | ||
|
|
909abce800 | ||
|
|
33d4e690cc | ||
|
|
848c849584 | ||
|
|
102c8f47bf | ||
|
|
d3bcbba45c | ||
|
|
0903e56196 | ||
|
|
95ecacf8a2 | ||
|
|
be8a280e0b | ||
|
|
6fb60a84dd | ||
|
|
5af7d1a3b8 | ||
|
|
35b73a1f20 | ||
|
|
9e4f9b36fc | ||
|
|
84d7e365a0 | ||
|
|
64c3da230f | ||
|
|
7793f30e09 | ||
|
|
714df32e33 | ||
|
|
1dc920c8de | ||
|
|
16dc1cfb5c | ||
|
|
819ff32dc4 | ||
|
|
5574e0ed41 | ||
|
|
042e57d562 | ||
|
|
ba8fb52183 | ||
|
|
f6f9961819 | ||
|
|
e74e9c48de | ||
|
|
179add2b07 | ||
|
|
456bc309d8 | ||
|
|
a7535a2727 | ||
|
|
44c09667ff | ||
|
|
da9b972466 | ||
|
|
bd45950f4a | ||
|
|
f70cf11819 | ||
|
|
5575f781ad | ||
|
|
0472883cc2 | ||
|
|
87e8feca95 | ||
|
|
e70a39830c | ||
|
|
ba25198517 | ||
|
|
6297bcd74c | ||
|
|
dd7ab82e75 | ||
|
|
c046fffa16 | ||
|
|
3aecef7697 | ||
|
|
b218af2b27 | ||
|
|
77c46bbf29 | ||
|
|
02750ff56f | ||
|
|
0bee0e6294 | ||
|
|
12593e6f45 | ||
|
|
819a040f44 | ||
|
|
546405bece | ||
|
|
f013c7f2a6 | ||
|
|
1cc67fa80c | ||
|
|
eefa6e4e2b | ||
|
|
6d9116f83d | ||
|
|
8be4e173e8 | ||
|
|
648765ba2f | ||
|
|
c6ccf055ba | ||
|
|
1649d85d10 | ||
|
|
cd72dcd925 | ||
|
|
7a5ed919ad | ||
|
|
799d7a34cf | ||
|
|
20adcfa058 | ||
|
|
02b7ec88bb | ||
|
|
0af9a89cef | ||
|
|
db802c60e3 | ||
|
|
503f3b1a21 | ||
|
|
402bcde847 | ||
|
|
ec9ea6a3c8 | ||
|
|
7e6617611f | ||
|
|
ca6dde5d3d | ||
|
|
8e6cbcd7c0 | ||
|
|
9335a5f7c0 | ||
|
|
32bf74e30e | ||
|
|
6643f275e2 | ||
|
|
cd4c36adb8 | ||
|
|
311e209931 | ||
|
|
fe5eb6707f | ||
|
|
f5db08e57a | ||
|
|
8cfdb960f0 | ||
|
|
ebccb429de | ||
|
|
7dbed652fc | ||
|
|
6789b41d86 | ||
|
|
0487cb234c | ||
|
|
80e1495b99 | ||
|
|
041843e47e | ||
|
|
c2aa4f2081 | ||
|
|
b23f50e67e | ||
|
|
7fe03ed3a3 | ||
|
|
9466fa6750 | ||
|
|
cead7f36da | ||
|
|
cbecb3ac37 | ||
|
|
5dbd3efce7 | ||
|
|
876811e2af | ||
|
|
b57c98df7b | ||
|
|
c4da6dd38a | ||
|
|
2edcb4ac71 | ||
|
|
0c4d9b2fbc | ||
|
|
5012158adf | ||
|
|
5c9396e37c | ||
|
|
7b63c0fa8c | ||
|
|
063a8905bf | ||
|
|
cd7562091d | ||
|
|
d1d0be3cd2 | ||
|
|
2c8ad4f1af | ||
|
|
121dea3f85 | ||
|
|
ea4f109c99 | ||
|
|
7650934f21 | ||
|
|
40c5cae24a | ||
|
|
cce9396dc9 | ||
|
|
47f3eafb8d | ||
|
|
53fc93dda6 | ||
|
|
17085b022c | ||
|
|
4367eb8706 | ||
|
|
0a8a99785b | ||
|
|
a9d96b98cb | ||
|
|
ae689b6b27 | ||
|
|
60d160da2d | ||
|
|
05086644c4 | ||
|
|
fb96d9d90d | ||
|
|
e1a32c1807 | ||
|
|
5585f4eca4 | ||
|
|
e8b4d05f61 | ||
|
|
0df748e7e2 | ||
|
|
1fbcfbe693 | ||
|
|
34ab17b669 | ||
|
|
4942ef6f0e | ||
|
|
9ae08a9c04 | ||
|
|
76f8a1f51d | ||
|
|
9d358821e5 | ||
|
|
a6c6874a1a | ||
|
|
a947f2d2b6 | ||
|
|
94e19e7111 | ||
|
|
04677ce024 | ||
|
|
407adb5b17 | ||
|
|
da0616cd13 | ||
|
|
1c02ca537a | ||
|
|
3f2f3d4264 | ||
|
|
c4c2c61e8c | ||
|
|
5f3d6f70f6 | ||
|
|
ece0bdf1fd | ||
|
|
97e4b1883e | ||
|
|
a2b38b3022 | ||
|
|
d51092f42b | ||
|
|
bdb6171334 | ||
|
|
1d4547a43d | ||
|
|
65ee74fbc7 | ||
|
|
c21506ba02 | ||
|
|
00f1628eac | ||
|
|
c69d103956 | ||
|
|
d56f92ee78 | ||
|
|
d5492d9b47 | ||
|
|
451dc18f10 | ||
|
|
127dca46a0 | ||
|
|
e888074bb4 | ||
|
|
1ef5026ef9 | ||
|
|
40889b9cd3 | ||
|
|
99889b46c9 | ||
|
|
82869b3c8d | ||
|
|
e8233e699b | ||
|
|
04cc76660a | ||
|
|
e1f7ea25d2 | ||
|
|
8586df1efb | ||
|
|
b8e0e12399 | ||
|
|
254ef80db1 | ||
|
|
f9de8446a0 | ||
|
|
d15711efc6 | ||
|
|
25ace3ed25 | ||
|
|
012c86ab74 | ||
|
|
458c29175e | ||
|
|
8a5dbb0a2e | ||
|
|
532203cdb0 | ||
|
|
870d3d5595 | ||
|
|
c6c0e4cb32 | ||
|
|
8f6f347848 | ||
|
|
0f7b63c834 | ||
|
|
345731731a | ||
|
|
b2c04539a1 | ||
|
|
d13363af60 | ||
|
|
b6fc2386f0 | ||
|
|
9f353dd662 | ||
|
|
b49053cae2 | ||
|
|
c8062c3a5e | ||
|
|
05c08fc708 | ||
|
|
0990a0851a | ||
|
|
bb0db9c491 | ||
|
|
966a753997 | ||
|
|
0f829bd111 | ||
|
|
a5200a1b8f | ||
|
|
6631a7e7f1 | ||
|
|
010da5c015 | ||
|
|
fbb56e5b1d | ||
|
|
78055aa6a5 | ||
|
|
e6bd5e8a6d | ||
|
|
94f1b50c0f | ||
|
|
bd54d55c1d | ||
|
|
09c70c3261 | ||
|
|
1ed0c6621b | ||
|
|
5f8453587e | ||
|
|
d6e2d12c74 | ||
|
|
305a1afcf7 | ||
|
|
9cdf87f194 | ||
|
|
a81e9d3dc4 | ||
|
|
6b7e0a9987 | ||
|
|
8b57fb1208 | ||
|
|
2962243d19 | ||
|
|
dbdc5d14d3 | ||
|
|
6cbe638294 | ||
|
|
07c08ed42c | ||
|
|
17b226a672 | ||
|
|
f33ca23e2f | ||
|
|
6d79659dd7 | ||
|
|
c56fb0f1a3 | ||
|
|
08241a5814 | ||
|
|
3d27b1fa85 | ||
|
|
6298bf9073 | ||
|
|
9a26adf598 | ||
|
|
64ad04eb2d | ||
|
|
349b293353 | ||
|
|
fd91256316 | ||
|
|
a9a025d08c | ||
|
|
b605e3ada3 | ||
|
|
02cbedc387 | ||
|
|
e5d814d040 | ||
|
|
b09f4fb271 | ||
|
|
1f4eada3b4 | ||
|
|
b935754cb0 | ||
|
|
396bc53593 | ||
|
|
7711de24f9 | ||
|
|
eee6c81af8 | ||
|
|
b89670ef0e | ||
|
|
0fccb00b5b | ||
|
|
72da660ddb | ||
|
|
46ffee4792 | ||
|
|
c0a953650b | ||
|
|
0424fe1a8f | ||
|
|
544a2aea4b | ||
|
|
60e5f36d27 | ||
|
|
2469361c0f | ||
|
|
6fa865a325 | ||
|
|
e9ba69631b | ||
|
|
d80a8d1919 | ||
|
|
d0ff2a237b | ||
|
|
6e5dd63c77 | ||
|
|
dc014d43af | ||
|
|
2f9cf160e4 | ||
|
|
336c35dc9e | ||
|
|
72b5215645 | ||
|
|
06bed64317 | ||
|
|
c559759265 | ||
|
|
b4000e8ad8 | ||
|
|
21d5ed98d5 | ||
|
|
e9a182fa30 | ||
|
|
b6db386ffd | ||
|
|
2c975b501d | ||
|
|
279fe3b1c5 | ||
|
|
98a9092af1 | ||
|
|
87108f5af9 | ||
|
|
f257d984b7 | ||
|
|
b889d6a8e8 | ||
|
|
47234cd3d2 | ||
|
|
2c8d0dccfc | ||
|
|
a4f576a378 | ||
|
|
3def5a010e | ||
|
|
294bd1e2f3 | ||
|
|
253ef2187c | ||
|
|
c0455cbb18 | ||
|
|
17e2c77a77 | ||
|
|
b52f3818f4 | ||
|
|
cc12975514 | ||
|
|
9738f395c6 | ||
|
|
d4294c8984 | ||
|
|
8df61b5011 | ||
|
|
f1e6643751 | ||
|
|
6991bf196c | ||
|
|
822a4c1bdb | ||
|
|
a5868b3fe2 | ||
|
|
4edfacb983 | ||
|
|
c6efe6f59e | ||
|
|
35c2b3a9ac | ||
|
|
af9675e75a | ||
|
|
8b2f9cdfad | ||
|
|
01682a8b3c | ||
|
|
8b07f23c30 | ||
|
|
45932ad508 | ||
|
|
ce94682ce1 | ||
|
|
2d7ab7e9ea | ||
|
|
6176df94ed | ||
|
|
a8f8788248 | ||
|
|
d5d007abe3 | ||
|
|
151457ab16 | ||
|
|
dde3e83129 | ||
|
|
8f182fdc69 | ||
|
|
1064acafc4 | ||
|
|
ff8e412ceb | ||
|
|
e9cbcb1d98 | ||
|
|
ea7fc0311c | ||
|
|
30911232c1 | ||
|
|
2940a1298e | ||
|
|
f916052eab | ||
|
|
2fb3f002d0 | ||
|
|
82b0bf0b87 | ||
|
|
3a7cef3e76 | ||
|
|
592c0e0273 | ||
|
|
08b977b5a5 | ||
|
|
85fb12d554 | ||
|
|
b975183c41 | ||
|
|
083100e2ab | ||
|
|
241d2ba1da | ||
|
|
e4fb49775b | ||
|
|
381a146dc6 | ||
|
|
b4a262832a | ||
|
|
6d498d478e | ||
|
|
d0561b5c2d | ||
|
|
4f4b192402 | ||
|
|
0ae1661ba2 | ||
|
|
4e9ef338fc | ||
|
|
d16e1131b4 | ||
|
|
a18894d159 | ||
|
|
dfee50ecd9 | ||
|
|
10189984f9 | ||
|
|
d8425465a3 | ||
|
|
1fc02dcf6a | ||
|
|
83d092f785 | ||
|
|
4825092bbe | ||
|
|
bbd79bdf03 | ||
|
|
a096e9b719 | ||
|
|
ddab25a90d | ||
|
|
ffbe98b763 | ||
|
|
d7a9bb0a2a | ||
|
|
0d81c69b8e | ||
|
|
401cd0af0f | ||
|
|
c7b41e67f0 | ||
|
|
003144a8e8 | ||
|
|
af1cb47e65 | ||
|
|
e8e7fbdb16 | ||
|
|
d5c21afd4b | ||
|
|
1afa967909 | ||
|
|
85b7b80434 | ||
|
|
fe0f662310 | ||
|
|
90453438ff | ||
|
|
2e63f3b733 | ||
|
|
125cc35b59 | ||
|
|
7e58aa7d71 | ||
|
|
be3d90de02 | ||
|
|
82652aaf17 | ||
|
|
17d6bb8158 | ||
|
|
11c26ecf81 | ||
|
|
99d5b23023 | ||
|
|
611ba3f4a1 | ||
|
|
af28dd6c75 | ||
|
|
e79ec456be | ||
|
|
3e268d2717 | ||
|
|
c46acbacde | ||
|
|
304d90425f | ||
|
|
bfaa8a89e1 | ||
|
|
de941e289e | ||
|
|
1d28453529 | ||
|
|
690ecff795 | ||
|
|
234c73767d | ||
|
|
497810cae7 | ||
|
|
cbc9d9713d | ||
|
|
98fa4fe8c5 | ||
|
|
0b4c91c0fc | ||
|
|
b9b43196e1 | ||
|
|
bf6a9e66d6 | ||
|
|
0c372b94f7 | ||
|
|
26e1237380 | ||
|
|
4882171df5 | ||
|
|
931627e6a0 | ||
|
|
274a2c9970 | ||
|
|
006fcc22a8 | ||
|
|
709c51c424 | ||
|
|
9bc448546e | ||
|
|
0dc092334b | ||
|
|
36c194638e | ||
|
|
45fb737950 | ||
|
|
a01273bae3 | ||
|
|
2c17323e15 | ||
|
|
870694b3da | ||
|
|
87a4b4d1f4 | ||
|
|
8ecf5104b3 | ||
|
|
2b3aeffbbd | ||
|
|
2c2f9e2cc3 | ||
|
|
2d9b1b3ffa | ||
|
|
f070480275 | ||
|
|
49f1597de2 | ||
|
|
b44e425f39 | ||
|
|
93683c3cf8 | ||
|
|
a08ee55e2d | ||
|
|
3bac6d9479 | ||
|
|
5c5143de48 | ||
|
|
c8cd7d9e0f | ||
|
|
e0a6cdcf30 | ||
|
|
a0ecb9b8fc | ||
|
|
4bf4bc784f | ||
|
|
9437fef8cc | ||
|
|
16b0384bd2 | ||
|
|
87ebdd8a71 | ||
|
|
7d68189d8a | ||
|
|
26414ee013 | ||
|
|
5c62f68e14 | ||
|
|
0d22b5dace | ||
|
|
023ec151df | ||
|
|
59dbdb51dc | ||
|
|
92d1bc09cb | ||
|
|
d62bfb39cd | ||
|
|
ce4b274aa1 | ||
|
|
334f1842fc | ||
|
|
b12540520d | ||
|
|
0d7b9b8b7e | ||
|
|
31188ee1a8 | ||
|
|
4a3e6bce79 | ||
|
|
a3829cb720 | ||
|
|
e84be9b495 | ||
|
|
3a3ca3f515 | ||
|
|
032c49b8b3 | ||
|
|
3208ff58ca | ||
|
|
6707d22a40 | ||
|
|
3647bee263 | ||
|
|
e2aebccba1 | ||
|
|
3e563bcea7 | ||
|
|
92f91ff48b | ||
|
|
b3dfaaa143 | ||
|
|
5b7848a345 | ||
|
|
915c6a21ba | ||
|
|
58706d595b | ||
|
|
236be53269 | ||
|
|
1fc1bd382b | ||
|
|
a60033f106 | ||
|
|
3613e6fc57 | ||
|
|
f8e21776f9 | ||
|
|
006723cf76 | ||
|
|
aa89bcd279 | ||
|
|
f19759a182 | ||
|
|
d009bcbfb6 | ||
|
|
4b71f63ac0 | ||
|
|
3adb8c3854 | ||
|
|
02e666d59f | ||
|
|
5b2d6ff07e | ||
|
|
877b2fbd3c | ||
|
|
afeab58a3c | ||
|
|
744c49a81b | ||
|
|
9c5b91fd0b | ||
|
|
290d3eab76 | ||
|
|
46dae77c23 | ||
|
|
a6cd870784 | ||
|
|
97879bcd57 | ||
|
|
ab1dee1efc | ||
|
|
e072aa535d | ||
|
|
48f9859d2a | ||
|
|
48b5083ca0 | ||
|
|
cd64618674 | ||
|
|
5d7e960adf | ||
|
|
f0d6ee6be8 | ||
|
|
e65991f977 | ||
|
|
3e83e686ba | ||
|
|
8f06b00373 | ||
|
|
1dea1f4509 | ||
|
|
44411db8e0 | ||
|
|
23ac7a1407 | ||
|
|
dda640835f | ||
|
|
6cc3700314 | ||
|
|
cc1489d2f2 | ||
|
|
016029c69f | ||
|
|
516b848286 | ||
|
|
c4202285ef | ||
|
|
49e045482a | ||
|
|
d8309efc72 | ||
|
|
f43acc8a50 | ||
|
|
ba47f5c9b0 | ||
|
|
4d94ae00d5 | ||
|
|
60d8bae30d | ||
|
|
0caec9e8f8 | ||
|
|
4f85a2e21e | ||
|
|
945e15a253 | ||
|
|
1fe198b6f9 | ||
|
|
78d6603aad | ||
|
|
7241ae1a0a | ||
|
|
5f58d6a5e0 | ||
|
|
acfe628b6e | ||
|
|
182d8435f0 | ||
|
|
4de920c91d | ||
|
|
3cd039dd8f | ||
|
|
81269a81ee | ||
|
|
3537525e00 | ||
|
|
d38f3ad1ee | ||
|
|
e083f91497 | ||
|
|
ba2cad19cf | ||
|
|
db0a1efcc9 | ||
|
|
9074521458 | ||
|
|
f924200e1b | ||
|
|
de2f6e4dae | ||
|
|
44bdb056d4 | ||
|
|
c31bbf1e68 | ||
|
|
5e68f8ce15 | ||
|
|
b9a3ef4c6e | ||
|
|
1955b87423 | ||
|
|
866eedb936 | ||
|
|
f701551f36 | ||
|
|
adc4df3616 | ||
|
|
1199e2d8cf | ||
|
|
0f180d1d1d | ||
|
|
072569e0f1 | ||
|
|
ba9786e4b8 | ||
|
|
613599ffff | ||
|
|
c9c21d3b89 | ||
|
|
d0d046eca2 | ||
|
|
2a81428489 | ||
|
|
7073e9e2a0 | ||
|
|
d866df33a1 | ||
|
|
b77fcddb6b | ||
|
|
f6fbd470e3 | ||
|
|
63810d8566 | ||
|
|
123c401967 | ||
|
|
a3fffd648b | ||
|
|
2d57b73a50 | ||
|
|
f14845d999 | ||
|
|
80bb905d3d | ||
|
|
a297985f42 | ||
|
|
404dcc5e8e | ||
|
|
8242a6a9fc | ||
|
|
17bcb8d465 | ||
|
|
72165799a8 | ||
|
|
f1c2a9de45 | ||
|
|
52b66a622d | ||
|
|
273db408a8 | ||
|
|
957b6db3b1 | ||
|
|
a14e2d9dfe | ||
|
|
a8b94d6409 | ||
|
|
fe19c448f0 | ||
|
|
fcf6473199 | ||
|
|
1285221370 | ||
|
|
5dcf517d84 | ||
|
|
9b2f486c9e | ||
|
|
24995f3a10 | ||
|
|
0fc5cf0870 | ||
|
|
f78d4a35f8 | ||
|
|
df5eaa8a52 | ||
|
|
6ce46d69f5 | ||
|
|
575e664a7c | ||
|
|
7389c848d4 | ||
|
|
4d393410f3 | ||
|
|
bd69750360 | ||
|
|
c9501c223f | ||
|
|
9dd5ae6553 | ||
|
|
e1e876072d | ||
|
|
dd2589494f | ||
|
|
1cfa8a397f | ||
|
|
bdae099862 | ||
|
|
cca28b291c | ||
|
|
062d3e39e7 | ||
|
|
e29f478a7a | ||
|
|
1b58b616e3 | ||
|
|
c70d381775 | ||
|
|
508d8b1617 | ||
|
|
8c74b5e56c | ||
|
|
c59ba5b528 | ||
|
|
45d87a1ffe | ||
|
|
a3feb21bbe | ||
|
|
37530362fa | ||
|
|
fd69886aed | ||
|
|
fd795679bb | ||
|
|
e523f5f389 | ||
|
|
e4dd79bbc8 | ||
|
|
bc37d996fc | ||
|
|
31cafe53c9 | ||
|
|
dc4ddcd2bb | ||
|
|
5256b021f3 | ||
|
|
1bb68d62ab | ||
|
|
4ab1e7ceaf | ||
|
|
06623ff028 | ||
|
|
67d48c8cc8 | ||
|
|
d59fb0dd2f | ||
|
|
245f44e2ab | ||
|
|
e5d6528a12 | ||
|
|
980afccf98 | ||
|
|
9bd2cd745f | ||
|
|
015fbde807 | ||
|
|
ba1b888384 | ||
|
|
6f9079fd50 | ||
|
|
c938563a81 | ||
|
|
40928698bb | ||
|
|
138d8ab0c7 | ||
|
|
47cc5525a2 | ||
|
|
67fec850e1 | ||
|
|
82db6e1646 | ||
|
|
e7227322b3 | ||
|
|
a5595fde9a | ||
|
|
95f8c7195c | ||
|
|
dcbbf83dba | ||
|
|
3c89d78dba | ||
|
|
84fcd6f83e | ||
|
|
a92ae07091 | ||
|
|
68809d3969 | ||
|
|
d6a89fcf88 | ||
|
|
ef5f6a08ff | ||
|
|
7c517a04b1 | ||
|
|
d78e52987e | ||
|
|
755cc53a6e | ||
|
|
1226c472b7 | ||
|
|
4d7072f4b5 | ||
|
|
b5348a095d | ||
|
|
66df02fd98 | ||
|
|
206eb6a11d | ||
|
|
f11fd3f4e1 | ||
|
|
29b108f939 | ||
|
|
31106cc750 | ||
|
|
ff3fa48fc7 | ||
|
|
87166e1fb6 | ||
|
|
f3e24baddf | ||
|
|
a6977ee73d | ||
|
|
d4704d5245 | ||
|
|
8f0edcb3d2 | ||
|
|
35e25255e0 | ||
|
|
c3fbf5d9a8 | ||
|
|
55e42c93a8 | ||
|
|
6a0dec9584 | ||
|
|
21a85f1977 | ||
|
|
322de0c8c1 | ||
|
|
6a9af68b56 | ||
|
|
b6e4dac217 | ||
|
|
8a0a9392ab | ||
|
|
bcbe4e5254 | ||
|
|
47ff5c6279 | ||
|
|
898f856c44 | ||
|
|
883b0c2274 | ||
|
|
4f94d1a8b1 | ||
|
|
1d4581c2dd | ||
|
|
c05940edc7 | ||
|
|
c507a16e49 | ||
|
|
308f028e28 | ||
|
|
e4a6cf421a | ||
|
|
329636d6e3 | ||
|
|
9163b8fb23 | ||
|
|
a542db90c6 | ||
|
|
a7ce69dbd7 | ||
|
|
9d93ce246c | ||
|
|
76c4336c43 | ||
|
|
e71adb85c5 | ||
|
|
033c51f0a3 | ||
|
|
452d1595a6 | ||
|
|
0d197a833c | ||
|
|
e0031b80ee | ||
|
|
b19941ab05 | ||
|
|
752938daab | ||
|
|
c78515f55e | ||
|
|
3ba1f11147 | ||
|
|
bbc206fdf7 | ||
|
|
2bd065dfbe | ||
|
|
6d7dbc12f2 | ||
|
|
83c40e7fc0 | ||
|
|
b5fe234588 | ||
|
|
e1a00d7d1d | ||
|
|
acf60ef707 | ||
|
|
c85a157854 | ||
|
|
0c5d16e4f5 | ||
|
|
bd2af5e707 | ||
|
|
58d55afa6f | ||
|
|
6343e2fac3 | ||
|
|
b476df64a1 | ||
|
|
1d46b6b3b9 | ||
|
|
bbb35447c4 | ||
|
|
6276f1e100 | ||
|
|
5b8a57ecae | ||
|
|
817dfc18a3 | ||
|
|
0b0b2a8087 | ||
|
|
c23d16ac19 | ||
|
|
1b28ed575b | ||
|
|
135c0af1bb | ||
|
|
475918410b | ||
|
|
3102792161 | ||
|
|
a291182757 | ||
|
|
b26ca3408c | ||
|
|
83978bd37a | ||
|
|
a3790c0d01 | ||
|
|
63b6090f7c | ||
|
|
c5571db0c2 | ||
|
|
e0457d5f7c | ||
|
|
ae52ec9869 | ||
|
|
0b33bc6b72 | ||
|
|
7aa983c6db | ||
|
|
2b90b1f344 | ||
|
|
65123f8064 | ||
|
|
1d8634b110 | ||
|
|
29e0c30c2a | ||
|
|
cf82191d77 | ||
|
|
3a8a0a3945 | ||
|
|
c5d4ab7e35 | ||
|
|
b955dbd325 | ||
|
|
45582d1e2b | ||
|
|
60c50cbf9c | ||
|
|
3a3619b46a | ||
|
|
b83eddc578 | ||
|
|
7f558334ad | ||
|
|
6229a5607c | ||
|
|
6acc3b9689 | ||
|
|
66aa856698 | ||
|
|
f559f31bef | ||
|
|
3210b4fd14 | ||
|
|
a7b42009c4 | ||
|
|
7b5ffd6834 | ||
|
|
9b55da73ca | ||
|
|
e7156ff2e8 | ||
|
|
437db75b94 | ||
|
|
1586365835 | ||
|
|
7d5b04db4e | ||
|
|
48b0cf8b10 | ||
|
|
b693f941fd | ||
|
|
c602e7f4e8 | ||
|
|
1fc6d41bf6 | ||
|
|
a41477f92e | ||
|
|
5f68c5feef | ||
|
|
ee84a5a7fb | ||
|
|
66d3e7481e | ||
|
|
0e21156333 | ||
|
|
f533b7780e | ||
|
|
cc2f5a8022 | ||
|
|
b441bf9226 | ||
|
|
2a9aca32dc | ||
|
|
89da653fa6 | ||
|
|
af50b58c3f | ||
|
|
4d635a7001 | ||
|
|
ce15d5a9dc | ||
|
|
ba1c602281 | ||
|
|
cfc781be6e | ||
|
|
84acc3c2bc | ||
|
|
c2e4f17c1a | ||
|
|
979689aa5c | ||
|
|
a3faebd104 | ||
|
|
025c7737b2 | ||
|
|
513d4b4c16 | ||
|
|
7ef701519b | ||
|
|
50d194af4d | ||
|
|
287973746e | ||
|
|
f1558bb424 | ||
|
|
6ca487992b | ||
|
|
cf3a5cebd7 | ||
|
|
a661b65357 | ||
|
|
98e6654938 | ||
|
|
cecd263878 | ||
|
|
31fe950d2b | ||
|
|
db6a87d8cc | ||
|
|
7beb408771 | ||
|
|
51008ffce1 | ||
|
|
3811eed8d5 | ||
|
|
581f1c8494 | ||
|
|
41ebed27fa | ||
|
|
bf21446a2a | ||
|
|
e72d734d5f | ||
|
|
20d2186c87 | ||
|
|
9ba3ec9176 | ||
|
|
8f71fb8d98 | ||
|
|
48948d53b6 | ||
|
|
dbec19622e | ||
|
|
2ce15df528 | ||
|
|
681bfae499 | ||
|
|
5dd955dcd2 | ||
|
|
56fa8e69cf | ||
|
|
67d0738aba | ||
|
|
b8a61e7362 | ||
|
|
dd5e774664 | ||
|
|
6b86bad5ef | ||
|
|
712557128b | ||
|
|
3009e9f9ef | ||
|
|
b30245dae0 | ||
|
|
116daf4c2f | ||
|
|
cb40bdaf57 | ||
|
|
4b12506891 | ||
|
|
cf98440178 | ||
|
|
c500d44735 | ||
|
|
18eda73234 | ||
|
|
7526e2c043 | ||
|
|
6d52f260bf | ||
|
|
752f2b6785 | ||
|
|
e1c279b63d | ||
|
|
467889703a | ||
|
|
3a457cca86 | ||
|
|
285046ec51 | ||
|
|
f8000b9345 | ||
|
|
77a8eb352f | ||
|
|
114697bef3 | ||
|
|
2aa9043ad3 | ||
|
|
1a095560f7 | ||
|
|
f329b8d73b | ||
|
|
3d90a32429 | ||
|
|
e3a7463c5d | ||
|
|
796c6eadcb | ||
|
|
b485e5b7e3 | ||
|
|
d1cc7b8f22 | ||
|
|
1cf9d58cb4 | ||
|
|
0cff933416 | ||
|
|
c41b29e5db | ||
|
|
65fb3fa630 | ||
|
|
0b0f08dbc7 | ||
|
|
5c32657c80 | ||
|
|
07cee70258 | ||
|
|
4ba163cbf9 | ||
|
|
2bfb2398e3 | ||
|
|
a4a8f7b3ef | ||
|
|
34c66925aa | ||
|
|
cb7fd76f57 | ||
|
|
de822715b2 | ||
|
|
89f534e1d3 | ||
|
|
d46c1a8126 | ||
|
|
e32587d5a6 | ||
|
|
7876e4488f | ||
|
|
1a19f83d4c | ||
|
|
db8c838c6a | ||
|
|
37da54b10e | ||
|
|
0fea7ed4a4 | ||
|
|
dbeac560aa | ||
|
|
89eeccacde | ||
|
|
c9fc143972 | ||
|
|
004aa803a9 | ||
|
|
c921a5e1d4 | ||
|
|
0b4b9a11f5 | ||
|
|
d7e0299792 | ||
|
|
9dfdf0ad1d | ||
|
|
3b04cdd706 | ||
|
|
11a57c7be5 | ||
|
|
b370230b78 | ||
|
|
50a381b789 | ||
|
|
534aaf3731 | ||
|
|
6dc5d570d0 | ||
|
|
cb78486d97 | ||
|
|
9c9aa4f145 | ||
|
|
b6d1e52d45 | ||
|
|
f185e725a0 | ||
|
|
591ccf586d | ||
|
|
b7061c61b0 | ||
|
|
8a428200a6 | ||
|
|
10b2328fea | ||
|
|
98c2a26ea6 | ||
|
|
965b6dad44 | ||
|
|
a3d8c0fc5d | ||
|
|
a32d795aae | ||
|
|
ef3dc028ef | ||
|
|
2413a3975f | ||
|
|
3b0b5abae3 | ||
|
|
b49124f6d9 | ||
|
|
2260ad21fb | ||
|
|
6b0e9facf4 | ||
|
|
c404ff7955 | ||
|
|
8e2f6b79ea | ||
|
|
ee60d9fb28 | ||
|
|
be6d77005f | ||
|
|
b263b66746 | ||
|
|
5294dd705d | ||
|
|
2b67158673 | ||
|
|
db744f8950 | ||
|
|
e059b19ddb | ||
|
|
997a54c981 | ||
|
|
b78e502104 | ||
|
|
b6d0054a52 | ||
|
|
117df10db4 | ||
|
|
d300bcca7f | ||
|
|
d59c3e5046 | ||
|
|
6d8566f2eb | ||
|
|
4e1b0d8904 | ||
|
|
8ce2912fbc | ||
|
|
1372965e2e | ||
|
|
1a1422643b | ||
|
|
409960491d | ||
|
|
96bd6f730a | ||
|
|
c0f5dd070b | ||
|
|
9d7a8d3578 | ||
|
|
4dec4f646d | ||
|
|
2cb924b052 | ||
|
|
51ac0cfe44 | ||
|
|
16e819e1d8 | ||
|
|
1023cfe70d | ||
|
|
8e0a2d8461 | ||
|
|
e13ae96d7c | ||
|
|
9f29ec4721 | ||
|
|
b9a20b5057 | ||
|
|
c2222c2ea2 | ||
|
|
336da5642d | ||
|
|
8573fa1806 | ||
|
|
a52c2fb296 | ||
|
|
41450b27f2 | ||
|
|
e72d5983f2 | ||
|
|
5a85385387 | ||
|
|
5e54b4f364 | ||
|
|
5ba372b17c | ||
|
|
f9b0f47c0c | ||
|
|
4deeadf7dc | ||
|
|
384eff877c | ||
|
|
68dbba9817 | ||
|
|
ea7150b070 | ||
|
|
cb42ce0b67 | ||
|
|
e8330cf5ac | ||
|
|
7d34470458 | ||
|
|
f1047cebea | ||
|
|
da8a2e6f90 | ||
|
|
546ec5a9b3 | ||
|
|
e3fefbfd56 | ||
|
|
3b80e3aa9e | ||
|
|
14cfde9c83 | ||
|
|
9cabef963c | ||
|
|
ce9eab79a7 | ||
|
|
e9e202cfa8 | ||
|
|
d83ae69455 | ||
|
|
bb4f7a8d52 | ||
|
|
619b2c03dc | ||
|
|
aa4c2de10e | ||
|
|
6c36f7a9f2 | ||
|
|
78f7923580 | ||
|
|
978ebf0141 | ||
|
|
a9ed4da8eb | ||
|
|
e1a4814cd4 | ||
|
|
3cad81f6fe | ||
|
|
4450107afb | ||
|
|
908efd3b73 | ||
|
|
1a7691c059 | ||
|
|
f524ddbe04 | ||
|
|
541814c403 | ||
|
|
5013540224 | ||
|
|
94cb5ee63c | ||
|
|
fc9c61bc3b | ||
|
|
e815d3015e | ||
|
|
dc2a33d680 | ||
|
|
7ba45bf133 | ||
|
|
d98a4b7366 | ||
|
|
889a54c467 | ||
|
|
9d07fd03e3 | ||
|
|
a8a1878256 | ||
|
|
5b46eee0f5 | ||
|
|
e5e6a94fbf | ||
|
|
d9ff889073 | ||
|
|
e4decc418a | ||
|
|
cf5bfbfc21 | ||
|
|
567fef894e | ||
|
|
6ee2a1365e | ||
|
|
435037d4e4 | ||
|
|
c5de8996cc | ||
|
|
2dc5383a20 | ||
|
|
9391f97715 | ||
|
|
5b16639538 | ||
|
|
1738bb61e1 | ||
|
|
91b3f0e691 | ||
|
|
6ac4e8bd6e | ||
|
|
983495c4b2 | ||
|
|
931a23a5a5 | ||
|
|
72849dce81 | ||
|
|
2618893114 | ||
|
|
36026dfc01 | ||
|
|
79aa04ef27 | ||
|
|
3a0799977b | ||
|
|
e19ea55783 | ||
|
|
8716dbea40 | ||
|
|
e9bc66c84f | ||
|
|
c078798c60 | ||
|
|
de73cca923 | ||
|
|
b1051789d6 | ||
|
|
4db73c1bb8 | ||
|
|
3ae34e3a8c | ||
|
|
1f3b65801b | ||
|
|
5e2c4e23f4 | ||
|
|
35780c2139 | ||
|
|
ceff5fec5a | ||
|
|
4897dc4056 | ||
|
|
35e33f0e52 | ||
|
|
a844e27baa | ||
|
|
0783bf151c | ||
|
|
566bdf2bda | ||
|
|
eb6dc02b23 | ||
|
|
78435364ec | ||
|
|
5cbc2e8bc1 | ||
|
|
e7cf7fcd21 | ||
|
|
bb8aab0211 | ||
|
|
0fbf5f7102 | ||
|
|
f1b2807478 | ||
|
|
faacb092f8 | ||
|
|
b439a74620 | ||
|
|
3132ab8ce6 | ||
|
|
bfd7bb3eb6 | ||
|
|
11c8f0b79d | ||
|
|
c4068186ac | ||
|
|
0a93a68020 | ||
|
|
f2ab7d1392 | ||
|
|
c41ab9ade5 | ||
|
|
141e584998 | ||
|
|
336736ef35 | ||
|
|
df7cb13525 | ||
|
|
d93eb21c7c | ||
|
|
a403188f92 | ||
|
|
82b2230527 | ||
|
|
a8a004987c | ||
|
|
0e36019977 | ||
|
|
354c3ace73 | ||
|
|
52129c0b0b | ||
|
|
a52877a2f1 | ||
|
|
cdd7c3ce92 | ||
|
|
c1497b4d19 | ||
|
|
b2ed462934 | ||
|
|
bb766a0ad6 | ||
|
|
b65f851318 | ||
|
|
35bf35411c | ||
|
|
54fbc77dc8 | ||
|
|
9e09eebf94 | ||
|
|
45a2f93906 | ||
|
|
6982c0da4e | ||
|
|
b7727ee616 | ||
|
|
f0446ca8d7 | ||
|
|
6bc847e49e | ||
|
|
3f1c4e49a3 | ||
|
|
37a7cd1a11 | ||
|
|
3a2d9c4dd0 | ||
|
|
e51d1321fc | ||
|
|
b9fdb3eb99 | ||
|
|
d66ace9da5 | ||
|
|
db75357110 | ||
|
|
0713f8abe6 | ||
|
|
93d9121a77 | ||
|
|
92dad6cc84 | ||
|
|
61454a9f8c | ||
|
|
bb2297a41d | ||
|
|
75e98d0563 | ||
|
|
e9eb000c53 | ||
|
|
1ba01caaa3 | ||
|
|
5cd6571fae | ||
|
|
6383bbe525 | ||
|
|
06da6e4977 | ||
|
|
b72faddc47 | ||
|
|
d92f0bb6e9 | ||
|
|
710e5d5639 | ||
|
|
6da980e2b5 | ||
|
|
37f599bcec | ||
|
|
8408f4fbc7 | ||
|
|
534164ef90 | ||
|
|
e32c852e1e | ||
|
|
dbfc0f8c2b | ||
|
|
3728974460 | ||
|
|
fdc2bbcacb | ||
|
|
c2a3358b60 | ||
|
|
882e891284 | ||
|
|
05bbf78afd | ||
|
|
99ecb90a99 | ||
|
|
dbad169019 | ||
|
|
3ba5d1cf2e | ||
|
|
be2e2c3297 | ||
|
|
ed0015284b | ||
|
|
6d03b73e35 | ||
|
|
622d3d3592 | ||
|
|
0e06354402 | ||
|
|
62c271610b | ||
|
|
db089ad60d | ||
|
|
1f0c9ad7e1 | ||
|
|
06efc222f9 | ||
|
|
de3333bae4 | ||
|
|
924875e53b | ||
|
|
3a64458217 | ||
|
|
ea71c22731 | ||
|
|
dc706cd35f | ||
|
|
1241126adf | ||
|
|
19da130053 | ||
|
|
a75b191502 | ||
|
|
e5cb260365 | ||
|
|
6aecef815c | ||
|
|
daba492c3a | ||
|
|
24cff6ced5 | ||
|
|
ac7b42610f | ||
|
|
7abe76e1bd | ||
|
|
7bc03ded12 | ||
|
|
ea3b8af50a | ||
|
|
badb910f3c | ||
|
|
3866752e7e | ||
|
|
3e3dac9f97 | ||
|
|
397ba0f08a | ||
|
|
07ad8f5d17 | ||
|
|
47c3448a97 | ||
|
|
4db48ec0bd | ||
|
|
c518ade1fd | ||
|
|
acdf4afb91 | ||
|
|
6d3dec92fb | ||
|
|
2d3b6a5be7 | ||
|
|
81d1998e09 | ||
|
|
6b46ca135a | ||
|
|
fa293e4e4b | ||
|
|
24cbf3efc6 | ||
|
|
534a1ed0cb | ||
|
|
ee306a1332 | ||
|
|
45442167b0 | ||
|
|
131645ecce | ||
|
|
f1ca5f5b89 | ||
|
|
e452de9d87 | ||
|
|
a0256f462a | ||
|
|
82d5d46c14 | ||
|
|
0665dd6852 | ||
|
|
98fc09b18a | ||
|
|
192ebef8cf | ||
|
|
b01ab14338 | ||
|
|
2a96235bf7 | ||
|
|
1cf9bf00f4 | ||
|
|
a5224c3420 | ||
|
|
af436bc158 | ||
|
|
ab603c6987 | ||
|
|
9c11a0e541 | ||
|
|
8de83bf876 | ||
|
|
679df234b7 | ||
|
|
26eaab0990 | ||
|
|
7be96d7c9f | ||
|
|
d11493934c | ||
|
|
c62da732a4 | ||
|
|
a1a63a4239 | ||
|
|
103a434386 | ||
|
|
567671e291 | ||
|
|
d8a750ee7f | ||
|
|
9c10b2c8d3 | ||
|
|
56a106115f | ||
|
|
e9ad0d2c31 | ||
|
|
97639f0d73 | ||
|
|
e3a4f8b84c | ||
|
|
7e99812432 | ||
|
|
2a1ef75435 | ||
|
|
c148d70978 | ||
|
|
7b6055d1af | ||
|
|
f31b12503e | ||
|
|
f82197ad75 | ||
|
|
3f37e73bae | ||
|
|
0774f470d9 | ||
|
|
d7a9e91688 | ||
|
|
601cb9be20 | ||
|
|
f3229ee19a | ||
|
|
219a3580b7 | ||
|
|
d63c6bd397 | ||
|
|
fdb61e583a | ||
|
|
b8e2f83ae6 | ||
|
|
93dbd83570 | ||
|
|
5be022712a | ||
|
|
43f9391bcc | ||
|
|
c1c971654b | ||
|
|
72b1072fbd | ||
|
|
3bfd99bfbb | ||
|
|
a169e82065 | ||
|
|
c80410c50c | ||
|
|
dc01b6b1f2 | ||
|
|
b7a26e6daf | ||
|
|
ce16450a89 | ||
|
|
9d2e51c199 | ||
|
|
1e325f6149 | ||
|
|
c458a33196 | ||
|
|
7953b8ff1b | ||
|
|
b1460627f3 | ||
|
|
5abc8ae6f9 | ||
|
|
6a184a6098 | ||
|
|
3d5e97f560 | ||
|
|
54c7559a7e | ||
|
|
0c9de428ae | ||
|
|
f13def508c | ||
|
|
1ae6ddac91 | ||
|
|
55dcfa421c | ||
|
|
c04f8cf44a | ||
|
|
870d986131 | ||
|
|
4f272c17f5 | ||
|
|
fd3e027faa | ||
|
|
235dd0a22a | ||
|
|
b589977b9e | ||
|
|
291e4a6ebe | ||
|
|
2d2ed9dffd | ||
|
|
8ada6e7705 | ||
|
|
7f657f342a | ||
|
|
20e8f0ee27 | ||
|
|
429266b7e4 | ||
|
|
2c7bc88d78 | ||
|
|
54f7ebe789 | ||
|
|
dd499e74de | ||
|
|
19a6e8b32c | ||
|
|
ed5538dc2b | ||
|
|
b8ffcf49ed | ||
|
|
eb929eef14 | ||
|
|
2cd3ad9bdd | ||
|
|
323f289c48 | ||
|
|
a45e4a5537 | ||
|
|
b7fe2f9675 | ||
|
|
6dcd1c9109 | ||
|
|
2fe5adc36c | ||
|
|
839590f576 | ||
|
|
e0a8d1f94e | ||
|
|
9ad0f6812f | ||
|
|
a3376fe8fc | ||
|
|
3cc1f498a1 | ||
|
|
c6c0035ea5 | ||
|
|
531d630b5c | ||
|
|
853b1eb424 | ||
|
|
09a2615fb2 | ||
|
|
285b42756a | ||
|
|
508f15cdab | ||
|
|
52c0d30078 | ||
|
|
10997ee8ab | ||
|
|
8a774dc9a6 | ||
|
|
200bc9e3e8 | ||
|
|
7dd0ee0495 | ||
|
|
76569fc662 | ||
|
|
f2a253e0dd | ||
|
|
0ad0eaf61c | ||
|
|
47b0f48dd9 | ||
|
|
44e48abc44 | ||
|
|
f420de027f | ||
|
|
ecf186065c | ||
|
|
20e021bf41 | ||
|
|
8ca2ae775d | ||
|
|
ee8aa8217a | ||
|
|
2b49dd1e8f | ||
|
|
30a54b9085 | ||
|
|
1e7e62f8cd | ||
|
|
5352823fbf | ||
|
|
20251f01ea | ||
|
|
528f6b81db | ||
|
|
27bfba299e | ||
|
|
1690863acc | ||
|
|
397211323c | ||
|
|
a87f50fb5a | ||
|
|
31bc51c8cf | ||
|
|
be487c429e | ||
|
|
80340f1fe9 | ||
|
|
d918f85146 | ||
|
|
a95541d61e | ||
|
|
30b4c2724e | ||
|
|
2adc929367 | ||
|
|
7e97837274 | ||
|
|
4cb73bf8e4 | ||
|
|
79bb8d0077 | ||
|
|
6c1a3e4f58 | ||
|
|
76c919c1a3 | ||
|
|
98405f240b | ||
|
|
181355616e | ||
|
|
b49a5b2dc0 | ||
|
|
713f226114 | ||
|
|
d57d85ff35 | ||
|
|
74daa124c2 | ||
|
|
b8e35bd66e | ||
|
|
e8734731d3 | ||
|
|
9e0fcabeca | ||
|
|
6482dec1bb | ||
|
|
81b5eeed6a | ||
|
|
365359dd79 | ||
|
|
2757be06de | ||
|
|
d0afe49d3e | ||
|
|
81b31b7087 | ||
|
|
2643b122fc | ||
|
|
88db657ac2 | ||
|
|
1f0af2c073 | ||
|
|
2ed2d1515e | ||
|
|
bb5b16a36c | ||
|
|
5892855c5f | ||
|
|
a6e859e9ec | ||
|
|
99c65cef0f | ||
|
|
496da8b918 | ||
|
|
739862384c | ||
|
|
0a647c2b8b | ||
|
|
429e4f0de8 | ||
|
|
2d10c7156c | ||
|
|
299053becd | ||
|
|
1449bda052 | ||
|
|
56bb1a7c83 | ||
|
|
96aaf806d8 | ||
|
|
d70e5100c0 | ||
|
|
4831e626aa | ||
|
|
33ab4699ba | ||
|
|
595cc5b4b8 | ||
|
|
29fb08c2de | ||
|
|
7babdf2029 | ||
|
|
4b3270f78e | ||
|
|
3351b8d007 | ||
|
|
4b49bf6a93 | ||
|
|
926a56bfe3 | ||
|
|
d6f188be71 | ||
|
|
016cadfb54 | ||
|
|
bdee69f718 | ||
|
|
ff43e2e155 | ||
|
|
f53948856e | ||
|
|
14056ee2ee | ||
|
|
b545dc6775 | ||
|
|
027902999e | ||
|
|
9a310a5d4e | ||
|
|
a63d5eaab2 | ||
|
|
6af59bc095 | ||
|
|
24cc290b85 | ||
|
|
8e264a933f | ||
|
|
f0b54fefe9 | ||
|
|
cf2d9e09b3 | ||
|
|
d02408ad8a | ||
|
|
7ae551fd03 | ||
|
|
c2e45f6ddf | ||
|
|
f9a4ad4fa6 | ||
|
|
10645a4f13 | ||
|
|
06cb0353e5 | ||
|
|
b41f836e5f | ||
|
|
26a81abffc | ||
|
|
ab03b0df4c | ||
|
|
e5a77633cf | ||
|
|
6f8a82c7af | ||
|
|
7a7f47ea80 | ||
|
|
0ce5f3e4f5 | ||
|
|
21023745e2 | ||
|
|
a679116f6f | ||
|
|
3988bb34aa | ||
|
|
9e78e6c3f8 | ||
|
|
3caff6092a | ||
|
|
0d96bf8950 | ||
|
|
91dc71f98d | ||
|
|
b7b6c047ca | ||
|
|
0ea659475c | ||
|
|
1e20bb0648 | ||
|
|
c962479bdf | ||
|
|
b31ccc362c | ||
|
|
0cd5866726 | ||
|
|
2a8a10eda6 | ||
|
|
f11bc84080 | ||
|
|
e2f3ae1252 | ||
|
|
40fcda292f | ||
|
|
59bc3126c5 | ||
|
|
4d6115a5cc | ||
|
|
3a25b96caf | ||
|
|
6e6d04e29a | ||
|
|
48ff225300 | ||
|
|
a4a9d97a3e | ||
|
|
404f952aa3 | ||
|
|
dcd87618ab | ||
|
|
d54bf14559 | ||
|
|
ea3a429efe | ||
|
|
e3f1223fe4 | ||
|
|
7ef6e3fe2f | ||
|
|
197322455d | ||
|
|
4f19a0672b | ||
|
|
854e076df8 | ||
|
|
cb2a0e1319 | ||
|
|
638b0d4277 | ||
|
|
f2346808de | ||
|
|
d7818facb9 | ||
|
|
bcf95a2183 | ||
|
|
f7181a9179 | ||
|
|
9237ba8b66 | ||
|
|
95874603b0 | ||
|
|
ed2e24d564 | ||
|
|
c9fd77e9dd | ||
|
|
a9d2bc4902 | ||
|
|
c3bdbcf639 | ||
|
|
d9a770e6ea | ||
|
|
35feed50f0 | ||
|
|
a116afa42e | ||
|
|
b4542fb307 | ||
|
|
1f224bf029 | ||
|
|
4d231b4359 | ||
|
|
ac0f1d0b14 | ||
|
|
124d8cf701 | ||
|
|
7d0d0996aa | ||
|
|
9cddbf14db | ||
|
|
5f1fddbbe7 | ||
|
|
027e257b1d | ||
|
|
93f117003e | ||
|
|
42748c084e | ||
|
|
77dd9c1850 | ||
|
|
83d968df60 | ||
|
|
4ac881ede3 | ||
|
|
ccd2cd3e64 | ||
|
|
6186ef9338 | ||
|
|
6bcac6e578 | ||
|
|
967d95f096 | ||
|
|
26c7750827 | ||
|
|
5a16d270ab | ||
|
|
3a465d5ec9 | ||
|
|
413a4a0461 | ||
|
|
a95d2c5133 | ||
|
|
1876cc32ae | ||
|
|
4e2a08ddd4 | ||
|
|
61e2c34a10 | ||
|
|
e56b54a376 | ||
|
|
0da945bb20 | ||
|
|
69443d0da0 | ||
|
|
e4dc18d7e5 | ||
|
|
3f86a2b147 | ||
|
|
fd664b9fc6 | ||
|
|
722ca2781c | ||
|
|
1c72eebf89 | ||
|
|
69ce8bb952 | ||
|
|
50b8ba0201 | ||
|
|
c9fd9152bd | ||
|
|
f891abccf2 | ||
|
|
e2effdbc6b | ||
|
|
b10ae320f7 | ||
|
|
5d3ab9b096 | ||
|
|
4fea8145e2 | ||
|
|
884e26080f | ||
|
|
9946491fcc | ||
|
|
ae6dfff5bf | ||
|
|
307bf4dae2 | ||
|
|
96d65fc022 | ||
|
|
080b8cadfa | ||
|
|
7cdd2aa128 | ||
|
|
7d7672f119 | ||
|
|
6a5b52efa0 | ||
|
|
6d864b7030 | ||
|
|
71a39dd4be | ||
|
|
500230ee94 | ||
|
|
347177e052 | ||
|
|
b7883fbb6e | ||
|
|
a77e023ab4 | ||
|
|
812cb5638c | ||
|
|
77a0f1d727 | ||
|
|
b9a18f3b8d | ||
|
|
73aeb61c3f | ||
|
|
3041903844 | ||
|
|
ad8ee98617 | ||
|
|
bc29d0e5d4 | ||
|
|
f89aebb1c4 | ||
|
|
1d7fb4f0c5 | ||
|
|
81a6c7817f | ||
|
|
5238fccc15 | ||
|
|
fba9046490 | ||
|
|
8a2908a24a | ||
|
|
e8b12f7a6f | ||
|
|
271da5a2e0 | ||
|
|
26fbabf3d1 | ||
|
|
37cdcb4d8a | ||
|
|
57b6534e53 | ||
|
|
8bf49ea170 | ||
|
|
02ee8626fb | ||
|
|
6276e5b41b | ||
|
|
51740b12ae | ||
|
|
6e6783056e | ||
|
|
791bd0cd2b | ||
|
|
e890dcdb19 | ||
|
|
5ddcb8664a | ||
|
|
09c4b4e0b7 | ||
|
|
368101778e | ||
|
|
535d79da63 | ||
|
|
4f69172d25 | ||
|
|
eb272ac0b0 | ||
|
|
63c43dcc59 | ||
|
|
8562801137 | ||
|
|
5d8094143e | ||
|
|
bb6dcb54f9 | ||
|
|
0a3ea5d34a | ||
|
|
a5e4c0bb9e | ||
|
|
cad4b840c8 | ||
|
|
37a92e9ce4 | ||
|
|
1896ce3558 | ||
|
|
0357422d14 | ||
|
|
d3ee37c5d9 | ||
|
|
f51cf14b85 | ||
|
|
194dd04699 | ||
|
|
14f7ee4916 | ||
|
|
a29d78e90b | ||
|
|
5b054c6955 | ||
|
|
10654d3a74 | ||
|
|
6017e604f8 | ||
|
|
3837491174 | ||
|
|
86a921af06 | ||
|
|
616df35633 | ||
|
|
e44fcedadf | ||
|
|
6f8f443170 | ||
|
|
d18af3f37e | ||
|
|
48fe4d6233 | ||
|
|
7b8250053b | ||
|
|
251cb4cfed | ||
|
|
24a93e6cdd | ||
|
|
40e15f9d78 | ||
|
|
b4f682d32f | ||
|
|
83d0e5e512 | ||
|
|
4e20b1a656 | ||
|
|
cc5ba6a7b6 | ||
|
|
0396479dec | ||
|
|
e34cfcf7e1 | ||
|
|
1358835050 | ||
|
|
754d494bef | ||
|
|
42909e3968 | ||
|
|
c108108028 | ||
|
|
5451e0d924 | ||
|
|
4ea3855514 | ||
|
|
20a9b1a7cf | ||
|
|
156e85578d | ||
|
|
b28ec12420 | ||
|
|
bb62a8b0c5 | ||
|
|
a75d8bebd2 | ||
|
|
b72ff47037 | ||
|
|
a2b03690a8 | ||
|
|
abb48d5a5f | ||
|
|
0e99546424 | ||
|
|
bd9e2e4c53 | ||
|
|
ff612904d2 | ||
|
|
429cf462d0 | ||
|
|
c62b26fdc6 | ||
|
|
e0a9ba9c3c | ||
|
|
2dc769a1c1 | ||
|
|
4f98cbabde | ||
|
|
98499135d7 | ||
|
|
3285076c8e | ||
|
|
3b4cfea688 | ||
|
|
de10f6900d | ||
|
|
adfe54b7be | ||
|
|
b576337e8b | ||
|
|
4de633dd5f | ||
|
|
91f29a38a0 | ||
|
|
1d5bd6cf71 | ||
|
|
226cc7ded4 | ||
|
|
e869d4bd32 | ||
|
|
60428dbf0a | ||
|
|
70d70a3c81 | ||
|
|
f1f25544e0 | ||
|
|
2e0db07627 | ||
|
|
58fc62296f | ||
|
|
df9cc1535e | ||
|
|
c4b36ff474 | ||
|
|
f418f8c17c | ||
|
|
5277d7cb7c | ||
|
|
0657bf9c14 | ||
|
|
5b438e9b0f | ||
|
|
7b4c588f58 | ||
|
|
1d00800e88 | ||
|
|
774530f412 | ||
|
|
fb171e534e | ||
|
|
7d7db13e67 | ||
|
|
45abac85a9 | ||
|
|
24b8dc9a55 | ||
|
|
d8c79c7f72 | ||
|
|
3a12ce0137 | ||
|
|
9bd35f6376 | ||
|
|
62763f682b | ||
|
|
38e3c5815c | ||
|
|
f8fe20e0d9 | ||
|
|
65e8167079 | ||
|
|
757a8b4621 | ||
|
|
5cac59b6c1 | ||
|
|
bad4058574 | ||
|
|
d8c2adae57 | ||
|
|
786e0c2424 | ||
|
|
794103d285 | ||
|
|
c454dbcd32 | ||
|
|
f3a3106807 | ||
|
|
62dc5aad06 | ||
|
|
45ecfb1973 | ||
|
|
f23478c314 | ||
|
|
3d2e469cfa | ||
|
|
bf401a2aef | ||
|
|
06a2b07bb0 | ||
|
|
8700e7b3cf | ||
|
|
7f19d42e9d | ||
|
|
d7bbd31efe | ||
|
|
fafc7f9875 | ||
|
|
d88a26c489 | ||
|
|
64b48877fa | ||
|
|
b31cc2d9f7 | ||
|
|
f196522159 | ||
|
|
4ff18c8c3e | ||
|
|
db4a465974 | ||
|
|
3cdc8ad07a | ||
|
|
2c1571b4ff | ||
|
|
6767a53669 | ||
|
|
ba93fd6a38 | ||
|
|
d7c06e9ec7 | ||
|
|
386828d029 | ||
|
|
d339187b1a | ||
|
|
61fca8b69b | ||
|
|
bb5ea36b96 | ||
|
|
e3a9164073 | ||
|
|
f85c9904c6 | ||
|
|
48bf4aae24 | ||
|
|
6231576088 | ||
|
|
4270144b39 | ||
|
|
5031a89dc3 | ||
|
|
bbd1c84e6e | ||
|
|
a2cf08cc23 | ||
|
|
d3a73875e2 | ||
|
|
41d2a336ee | ||
|
|
627774fd87 | ||
|
|
a5bc1e8568 | ||
|
|
c38171ba1f | ||
|
|
bb3ee8e75d | ||
|
|
32654e792b | ||
|
|
19f2192136 | ||
|
|
1961b327eb | ||
|
|
2ae87d465e | ||
|
|
e3ef8d2e6b | ||
|
|
65a87c7d01 | ||
|
|
72e3c20c14 | ||
|
|
ec0f19597e | ||
|
|
fa2b8db499 | ||
|
|
1aa0d94781 | ||
|
|
dc644fe229 | ||
|
|
47ddf355b4 | ||
|
|
941181ec0f | ||
|
|
d399fdf877 | ||
|
|
487550b61d | ||
|
|
35618bf6ad | ||
|
|
460fe31f0c | ||
|
|
14565bedaf | ||
|
|
02cc82ff8a | ||
|
|
38f3b3e29c | ||
|
|
4dc719fc37 | ||
|
|
48f2ef8d00 | ||
|
|
be1bd9239f | ||
|
|
b8feddae71 | ||
|
|
a9daa46758 | ||
|
|
569afce4b0 | ||
|
|
a9aa3d580c | ||
|
|
56a6ccc84f | ||
|
|
03c4d82fa1 | ||
|
|
7ab1a39181 | ||
|
|
56dde3ebe6 | ||
|
|
6525ced540 | ||
|
|
32d0ad41a4 | ||
|
|
e28e42a549 | ||
|
|
ff055b5c89 | ||
|
|
d8770f3ece | ||
|
|
4981372d03 | ||
|
|
3ebac273f5 | ||
|
|
5af18f65f4 | ||
|
|
a9b34991d9 | ||
|
|
bc36ee6227 | ||
|
|
f2bc668429 | ||
|
|
8120813066 | ||
|
|
7242cd8f8f | ||
|
|
12c2fe8d53 | ||
|
|
28143c66e1 | ||
|
|
335c4f0966 | ||
|
|
5003a61b9f | ||
|
|
7bd51947e5 | ||
|
|
4901b41653 | ||
|
|
74cd365b03 | ||
|
|
2affbab9fc | ||
|
|
cf1b7d9664 | ||
|
|
649c5a2b09 | ||
|
|
07247321c6 | ||
|
|
0c43540433 | ||
|
|
acba75c59d | ||
|
|
267a1927eb | ||
|
|
b0c8638650 | ||
|
|
b36c170d1b | ||
|
|
934397ec66 | ||
|
|
0f8631495d | ||
|
|
95ffe86dbc | ||
|
|
87b79c3ef3 | ||
|
|
52d160d85d | ||
|
|
54ff1e6ae5 | ||
|
|
a6b7ffddac | ||
|
|
f30d34f3a8 | ||
|
|
84a2173797 | ||
|
|
52b621db88 | ||
|
|
a6ed5dd674 | ||
|
|
1417f2dccb | ||
|
|
f2e5ca84d4 | ||
|
|
36fafffae2 | ||
|
|
cdc7b8cc60 | ||
|
|
720235eeec | ||
|
|
8e495e4ac7 | ||
|
|
2afbd6fa08 | ||
|
|
f282ca7413 | ||
|
|
67c1801924 | ||
|
|
46a58ab946 | ||
|
|
94fcd01349 | ||
|
|
9a04387362 | ||
|
|
282d8b1c38 | ||
|
|
41ecaba97e | ||
|
|
96dfab9e0e | ||
|
|
1b65ce7db3 | ||
|
|
7b9cb4a224 | ||
|
|
bc2dfde4b3 | ||
|
|
ec9dc137e7 | ||
|
|
620cea37e0 | ||
|
|
c15e036398 | ||
|
|
ccb08f98ae | ||
|
|
e306892994 | ||
|
|
836f996010 | ||
|
|
1613c4d3bf | ||
|
|
b5f6d9dc6e | ||
|
|
c063f2c5ec | ||
|
|
c47c619680 | ||
|
|
93cd57a578 | ||
|
|
49ce63cd7c | ||
|
|
b3f2e399d2 | ||
|
|
8c950429a9 | ||
|
|
c2bf70a27c | ||
|
|
9235adbf47 | ||
|
|
a71b5abfa4 | ||
|
|
928cc3a6de | ||
|
|
466e4249ab | ||
|
|
9fbc45b159 | ||
|
|
792e2ce7f4 | ||
|
|
3952584571 | ||
|
|
a5d2acfc79 | ||
|
|
35ed8cb8b6 | ||
|
|
7edc5ed90a | ||
|
|
420125f996 | ||
|
|
57e7d3ce15 | ||
|
|
a8ebe4697e | ||
|
|
deb2c1a1c5 | ||
|
|
d4219c485b | ||
|
|
73fc98a7bf | ||
|
|
259810e05b | ||
|
|
171cc53a96 | ||
|
|
9eea2be6f1 | ||
|
|
69a03c1799 | ||
|
|
4327aae816 | ||
|
|
741a9690df | ||
|
|
e24e40657f | ||
|
|
448361a86c | ||
|
|
26e083ccb7 | ||
|
|
4978361212 | ||
|
|
247c1361f3 | ||
|
|
1618bc7921 | ||
|
|
1b843d3c69 | ||
|
|
0bc6597d4d | ||
|
|
2b916952a8 | ||
|
|
02e4fbed3d | ||
|
|
7403c34b0b | ||
|
|
9022f2403b | ||
|
|
08f3f07212 | ||
|
|
8cbceba610 | ||
|
|
88ce56f8c1 | ||
|
|
664d83bb23 | ||
|
|
8cff6331c9 | ||
|
|
cd6aa710b5 | ||
|
|
903872d65e | ||
|
|
16a44ae7e9 | ||
|
|
739423fceb | ||
|
|
78f3a2aad7 | ||
|
|
b847024026 | ||
|
|
50d5199120 | ||
|
|
9020b86250 | ||
|
|
a342cc5a70 | ||
|
|
67c3cf0675 | ||
|
|
9a875a3574 | ||
|
|
a43cf9fae9 | ||
|
|
9ae9c221de | ||
|
|
4256650d68 | ||
|
|
ae0665b8f1 | ||
|
|
75802000c8 | ||
|
|
325ae88efb | ||
|
|
a25b265d27 | ||
|
|
d0a8af61b1 | ||
|
|
e58d808a4c | ||
|
|
751b5e8ff2 | ||
|
|
36f74d60b3 | ||
|
|
9756da13dd | ||
|
|
893b76c544 | ||
|
|
b5a6f0a92d | ||
|
|
ba8e28248f | ||
|
|
bfcec27d61 | ||
|
|
8e8972bb68 | ||
|
|
57108f0ad5 | ||
|
|
73758d435b | ||
|
|
90f63e8f83 | ||
|
|
e8af92fcb1 | ||
|
|
361ef5f4dc | ||
|
|
b3466895e6 | ||
|
|
81f169e95c | ||
|
|
a068630a20 | ||
|
|
dfebac32c0 | ||
|
|
ab5db00717 | ||
|
|
6308af199d | ||
|
|
8e5b6314ef | ||
|
|
b4b1bdd5d3 | ||
|
|
5782ceb298 | ||
|
|
cc85ec447b | ||
|
|
c67cdb50d2 | ||
|
|
af5473c45a | ||
|
|
f2c46006e7 | ||
|
|
69e42952e1 | ||
|
|
adf87b2df5 | ||
|
|
40753f760d | ||
|
|
d199858e89 | ||
|
|
10a2975a27 | ||
|
|
9b4dc8308f | ||
|
|
b93642c5cc | ||
|
|
a5435e8b29 | ||
|
|
72e2d9138c | ||
|
|
1dd080bca4 | ||
|
|
f648590991 | ||
|
|
a14280d41e | ||
|
|
91b842c972 | ||
|
|
eddf82a36a | ||
|
|
673b3fde82 | ||
|
|
a87e50a945 | ||
|
|
b62a0c4cab | ||
|
|
c06648f7f0 | ||
|
|
cd56182b41 | ||
|
|
65a22e8e4d | ||
|
|
cbf0f45f90 | ||
|
|
b2293b1e9b | ||
|
|
04e53c273f | ||
|
|
599c03530a | ||
|
|
56a67adb64 | ||
|
|
28e5428d5d | ||
|
|
3c91484052 | ||
|
|
98d517c5da | ||
|
|
18602745de | ||
|
|
ad2e032049 | ||
|
|
601140b363 | ||
|
|
e02cc10ea4 | ||
|
|
b5524a3ac3 | ||
|
|
0c61e299b3 | ||
|
|
0b33bc65cd | ||
|
|
0f5fa24a7c | ||
|
|
8e96183506 | ||
|
|
a8312c0e24 | ||
|
|
bf0d176e48 | ||
|
|
ec5add8784 | ||
|
|
856d456a71 | ||
|
|
7f2113a2d5 | ||
|
|
97f56446a3 | ||
|
|
5d92be8cc6 | ||
|
|
e102a3dcfd | ||
|
|
ecbe07817a | ||
|
|
71db02813c | ||
|
|
a6574c21eb | ||
|
|
26da3e65ac | ||
|
|
21cd437886 | ||
|
|
f09628e42f | ||
|
|
6f346c7115 | ||
|
|
d8ecc56c9d | ||
|
|
4e1209ebf8 | ||
|
|
78d3b819f0 | ||
|
|
200b24e391 | ||
|
|
1690c2b26e | ||
|
|
701adceb12 | ||
|
|
3f07fe09b5 | ||
|
|
f86c5c9ac7 | ||
|
|
66a0def81b | ||
|
|
73e92de577 | ||
|
|
09ab755c55 | ||
|
|
ec558b6548 | ||
|
|
037a9f9c1a | ||
|
|
29e1fdf3f2 | ||
|
|
28ddfc61dc | ||
|
|
725c88879c | ||
|
|
a0aae68cf6 | ||
|
|
57d2f21782 | ||
|
|
895959b736 | ||
|
|
3c07b4c2ee | ||
|
|
1cc0b0a66a | ||
|
|
beb23252a6 | ||
|
|
3ba25ee86a | ||
|
|
0be35f5c51 | ||
|
|
60f7492646 | ||
|
|
1456d1860e | ||
|
|
5755cab49d | ||
|
|
975842f9fb | ||
|
|
126fe085db | ||
|
|
123d24d600 | ||
|
|
3880cd35ad | ||
|
|
cb38052b3a | ||
|
|
f640ee90c3 | ||
|
|
09f4278d25 | ||
|
|
1f47ec53a2 | ||
|
|
959f67d6a4 | ||
|
|
b2e7419a1d | ||
|
|
6546fdfaf8 | ||
|
|
3a3ca1d474 | ||
|
|
7522254b48 | ||
|
|
f1a6a0d4dd | ||
|
|
9c67ab2f26 | ||
|
|
1a7b2d33f4 | ||
|
|
6e2dad1cc7 | ||
|
|
2c0d10123e | ||
|
|
3ac82faae5 | ||
|
|
c08523d862 | ||
|
|
137e601277 | ||
|
|
09f4bd2a39 | ||
|
|
2fc0d1f15e | ||
|
|
2a86064f95 | ||
|
|
016d7d250a | ||
|
|
2c15d426b9 | ||
|
|
bdcfe1d165 | ||
|
|
3b28dbce7e | ||
|
|
5a4fbc69c3 | ||
|
|
7e7c8952b5 | ||
|
|
de487514ae | ||
|
|
06db4253e2 | ||
|
|
4ce7894c4a | ||
|
|
36f554d43c | ||
|
|
8d28d5f81b | ||
|
|
53b407da84 | ||
|
|
765e531159 | ||
|
|
de282fe3ba | ||
|
|
36ac656a1b | ||
|
|
2aff7727f7 | ||
|
|
cc93ae3ef4 | ||
|
|
34d69d3b23 | ||
|
|
daea0ff8a9 | ||
|
|
448701473a | ||
|
|
572f0017d5 | ||
|
|
df2c442a6d | ||
|
|
23e2947cc8 | ||
|
|
44b51ca36c | ||
|
|
bbf848ce8d | ||
|
|
d0fa136ce2 | ||
|
|
15156cce0e | ||
|
|
9d6b1ce644 | ||
|
|
66ebbb6a56 | ||
|
|
c5e48d8b01 | ||
|
|
8dea52fa42 | ||
|
|
f7356b677b | ||
|
|
80d89e6a6a | ||
|
|
bc5f2740d2 | ||
|
|
aa66eba7c8 | ||
|
|
f27b45d237 | ||
|
|
3bb4736289 | ||
|
|
bac685417a | ||
|
|
1a4d6400ae | ||
|
|
322006dcb1 | ||
|
|
db01d55671 | ||
|
|
0a52d38b31 | ||
|
|
902d1051b1 | ||
|
|
f67868ff4c | ||
|
|
a6576c56dd | ||
|
|
240f516939 | ||
|
|
ef8f14a882 | ||
|
|
aecb0b018f | ||
|
|
e4d56bab5b | ||
|
|
1435ccfba1 | ||
|
|
d766a23deb | ||
|
|
b1e21f8fac | ||
|
|
9347ba487c | ||
|
|
c28500900e | ||
|
|
e4c5391ddb | ||
|
|
0c34556cbd | ||
|
|
b50118ca3e | ||
|
|
a57ecb95f6 | ||
|
|
428a55a0fe | ||
|
|
cc74659fcc | ||
|
|
90e7ce363a | ||
|
|
a47b505e37 | ||
|
|
9f49524331 | ||
|
|
6a2347ee45 | ||
|
|
e5164b7041 | ||
|
|
ebff44b83a | ||
|
|
c0e7c3aab9 | ||
|
|
733777275b | ||
|
|
f1919c3df9 | ||
|
|
97b1719583 | ||
|
|
b0dc680f71 | ||
|
|
addb309ad6 | ||
|
|
152a689cf9 | ||
|
|
35a99b6380 | ||
|
|
dfa46e502d | ||
|
|
c21c35e6a4 | ||
|
|
b26f84cbbd | ||
|
|
0dba0613ea | ||
|
|
e0c875081e | ||
|
|
ea1b7fe6d4 | ||
|
|
db88223baa | ||
|
|
d29b63bc9b | ||
|
|
1946cd8bc2 | ||
|
|
111482cf2e | ||
|
|
52a1bab2d9 | ||
|
|
0826c85f4c | ||
|
|
385d81380c | ||
|
|
862e973b50 | ||
|
|
2efff10cfa | ||
|
|
33479d275a | ||
|
|
3e7a6396ed | ||
|
|
5a12df5c40 | ||
|
|
b5a25a430a | ||
|
|
592c784ffe | ||
|
|
17e757478a | ||
|
|
a023052580 | ||
|
|
4b757c830d | ||
|
|
9b7a552f4b | ||
|
|
8df788c97f | ||
|
|
12cfcc128c | ||
|
|
f9b3bff6f7 | ||
|
|
fc2e05c2d5 | ||
|
|
b2993bdea1 | ||
|
|
470fa98f8a | ||
|
|
de6e207db6 | ||
|
|
1363155145 | ||
|
|
db5bda670f | ||
|
|
0ae485dc07 | ||
|
|
19cda70045 | ||
|
|
4751717cd8 | ||
|
|
bd68b6b1f6 | ||
|
|
cd9b7d7c35 | ||
|
|
058123afb6 | ||
|
|
a4614bf06d | ||
|
|
23f80f46a4 | ||
|
|
c4438dc0e5 | ||
|
|
04ca16890b | ||
|
|
20f88b9bd4 | ||
|
|
25439b76ad | ||
|
|
3465dd3853 | ||
|
|
ac445acf69 | ||
|
|
77ac92d00a | ||
|
|
73c2522c7c | ||
|
|
6b5d39e82d | ||
|
|
cd2eebfd64 | ||
|
|
06676624fc | ||
|
|
ef8b601789 | ||
|
|
01e62900c7 | ||
|
|
d50f1bdfac | ||
|
|
38b40c624c | ||
|
|
eb1f1b0a34 | ||
|
|
a9376dbff9 | ||
|
|
14697d9d6d | ||
|
|
c6a926d9e2 | ||
|
|
c1db5bfc08 | ||
|
|
429b8162c6 | ||
|
|
0dd2254d76 | ||
|
|
03a0848922 | ||
|
|
9161672950 | ||
|
|
a08bcccc67 | ||
|
|
bdec3c5323 | ||
|
|
53d286797c | ||
|
|
b6cafbd7d8 | ||
|
|
499e167fda | ||
|
|
0135e33511 | ||
|
|
f2cc7559dd | ||
|
|
fe8686ba4b | ||
|
|
4aa69fe0b6 | ||
|
|
b984cd2b01 | ||
|
|
adcc64cd9e | ||
|
|
c94b6de017 | ||
|
|
000e21779c | ||
|
|
f1d6f64c8e | ||
|
|
d79cab27a5 | ||
|
|
24b44446e2 | ||
|
|
87739b2c53 | ||
|
|
c782089611 | ||
|
|
265592b99a | ||
|
|
077ff61eef | ||
|
|
dcbd0d74d5 | ||
|
|
1ec0a3862e | ||
|
|
946cd9a540 | ||
|
|
0ac87024e3 | ||
|
|
7abe830501 | ||
|
|
5acaa49504 | ||
|
|
535b9b5724 | ||
|
|
78a0c1f18d | ||
|
|
6cc5e19d47 | ||
|
|
7e0c5264e7 | ||
|
|
73343ac38a | ||
|
|
d53d271728 | ||
|
|
37fc8c3747 | ||
|
|
01412ec600 | ||
|
|
c4f3542abf | ||
|
|
c799770060 | ||
|
|
cd26e6c79d | ||
|
|
4e773226f5 | ||
|
|
646d56956b | ||
|
|
0cc1115643 | ||
|
|
257341b5b4 | ||
|
|
83f2571782 | ||
|
|
baa257f1ed | ||
|
|
e06cc57118 | ||
|
|
0450d28759 | ||
|
|
7f56097c65 | ||
|
|
7396958515 | ||
|
|
3c758be86e | ||
|
|
227385b719 | ||
|
|
f7a059316f | ||
|
|
b1d6e3f551 | ||
|
|
db70a3fd6e | ||
|
|
28fd5c60de | ||
|
|
cbd48ba626 | ||
|
|
67d93e6f49 | ||
|
|
afb83c45e6 | ||
|
|
43fcc1b096 | ||
|
|
d5695a26a6 | ||
|
|
8bfc8f934f | ||
|
|
ef02b10a16 | ||
|
|
803e4e93d4 | ||
|
|
60b8607727 | ||
|
|
159564ae9f | ||
|
|
cd1bf28e2c | ||
|
|
74e10aa58b | ||
|
|
5f524accc1 | ||
|
|
451e60e99f | ||
|
|
89c16ab53e | ||
|
|
820aaa5fc5 | ||
|
|
993ea851f5 | ||
|
|
305db17b5f | ||
|
|
6a8ba34f9d | ||
|
|
f777408fc5 | ||
|
|
2984b0ae24 | ||
|
|
3d6001f7b9 | ||
|
|
f6a8898fc3 | ||
|
|
757e392d4e | ||
|
|
2f9f0c72de | ||
|
|
cb4ae6c0d3 | ||
|
|
359fd02fec | ||
|
|
e1a8ac495b | ||
|
|
0b5806b5f5 | ||
|
|
ccb9643f02 | ||
|
|
7f7b8d6871 | ||
|
|
bb7e632aef | ||
|
|
55d892e373 | ||
|
|
f971ccb264 | ||
|
|
a4aba800d9 | ||
|
|
669cefdd35 | ||
|
|
7be7c2eda5 | ||
|
|
8de2910b5c | ||
|
|
74489a3668 | ||
|
|
e06433d9ba | ||
|
|
e0bf5c11ea | ||
|
|
58f0f52e67 | ||
|
|
55b3c877c7 | ||
|
|
bbbc96a87e | ||
|
|
5e4ca4220e | ||
|
|
e5828cd46f | ||
|
|
7081f3bd89 | ||
|
|
0413ba429c | ||
|
|
29c1f0615b | ||
|
|
10e473e930 | ||
|
|
e7ef1a561a | ||
|
|
458d356db9 | ||
|
|
020fc820dc | ||
|
|
bc8a9f1f0f | ||
|
|
6b77e6d7f3 | ||
|
|
361c7f2b52 | ||
|
|
9f6fe8dbe7 | ||
|
|
ee78e1fc8b | ||
|
|
864170286a | ||
|
|
02af65b347 | ||
|
|
2f13ee21ea | ||
|
|
1d833a9910 | ||
|
|
11c0f1201c | ||
|
|
69e7805f54 | ||
|
|
e264cfe17a | ||
|
|
8224b0cbe5 | ||
|
|
15d52ddb55 | ||
|
|
d48f487e2c | ||
|
|
ce23b0f73e | ||
|
|
d313047f63 | ||
|
|
d1855cc7af | ||
|
|
14c6d27d63 | ||
|
|
dcea8e12e2 | ||
|
|
26b264795d | ||
|
|
501ebf16b6 | ||
|
|
815c83f70a | ||
|
|
92125ffaec | ||
|
|
7db2fcaa81 | ||
|
|
7d09713d09 | ||
|
|
3aba98e787 | ||
|
|
32d862ede4 | ||
|
|
a44f26d5c9 | ||
|
|
3e126d3610 | ||
|
|
5660eb489e | ||
|
|
7c155330de | ||
|
|
8bb4ad88d8 | ||
|
|
eb64730b9c | ||
|
|
34a1488220 | ||
|
|
5270e7025e | ||
|
|
1df586bec2 | ||
|
|
551e5990d2 | ||
|
|
d9efa3616a | ||
|
|
51c8dc37dd | ||
|
|
28967cf079 | ||
|
|
a2bbe59401 | ||
|
|
421cb50b2d | ||
|
|
0fa504b68d | ||
|
|
705bfcf8e7 | ||
|
|
4fb40db932 | ||
|
|
9dd0463852 | ||
|
|
5cb5715f97 | ||
|
|
e9a583aa26 | ||
|
|
f3f316f13f | ||
|
|
99b1aaf2ec | ||
|
|
53400da75c | ||
|
|
2b59a6ac14 | ||
|
|
48d89b560c | ||
|
|
b5a43800ef | ||
|
|
0fd44e2ddb | ||
|
|
0a2221f9ad | ||
|
|
567f17cfe0 | ||
|
|
627ec355d8 | ||
|
|
4184a78761 | ||
|
|
bbdc9c98a8 | ||
|
|
11b62699a1 | ||
|
|
14a74a21f0 | ||
|
|
c8cda405e7 | ||
|
|
befb3e7a4d | ||
|
|
c6f1787bbd | ||
|
|
9bd3bd227f | ||
|
|
d0ef53bd2d | ||
|
|
8d3f155a66 | ||
|
|
ef0ab7f94f | ||
|
|
bf55ece1c1 | ||
|
|
51754ec835 | ||
|
|
1bc5dd3efc | ||
|
|
0ded1638ba | ||
|
|
71d525c9f6 | ||
|
|
3ab5651112 | ||
|
|
82ce0b2308 | ||
|
|
a22fb399cb | ||
|
|
8df8f27513 | ||
|
|
cde70093ac | ||
|
|
5f97f508e4 | ||
|
|
553615f500 | ||
|
|
924046ce75 | ||
|
|
9e2c0f41d7 | ||
|
|
5ef67042f9 | ||
|
|
53fe8d5be5 | ||
|
|
8c23788dd1 | ||
|
|
ef76e3dbda | ||
|
|
7ba839bfe2 | ||
|
|
d2dcf4f40d | ||
|
|
75a382bd90 | ||
|
|
5b0a0544f2 | ||
|
|
a0ec9cf6d5 | ||
|
|
e9ebf346c4 | ||
|
|
8ca533e378 | ||
|
|
d0c9858914 | ||
|
|
356c06c776 | ||
|
|
ef71cb6daf | ||
|
|
2e7e3d6ce9 | ||
|
|
a269d312da | ||
|
|
a87aa87bcc | ||
|
|
6df3553255 | ||
|
|
2eaad87f36 | ||
|
|
b7af080fb1 | ||
|
|
3a0afe1eed | ||
|
|
086a32d754 | ||
|
|
544ebbceb4 | ||
|
|
6d0dcbedb1 | ||
|
|
88aeb646bd | ||
|
|
46b1b91309 | ||
|
|
be054868a1 | ||
|
|
0acc90e5f7 | ||
|
|
4e20a4e688 | ||
|
|
9ef9e78520 | ||
|
|
393e826ec3 | ||
|
|
c5e8580e7b | ||
|
|
16221173c8 | ||
|
|
0e8f2fdfdd | ||
|
|
fec8c79a7e | ||
|
|
56245be46d | ||
|
|
eb206eb8be | ||
|
|
fda05b2155 | ||
|
|
8c4ab6d5ae | ||
|
|
8fdec3e558 | ||
|
|
69431c2998 | ||
|
|
90d7fc1de4 | ||
|
|
bb28bcdf98 | ||
|
|
d49da3aa5b | ||
|
|
fc55bf3b20 | ||
|
|
03dbae0d20 | ||
|
|
5a5accdd64 | ||
|
|
f1192b7f2e | ||
|
|
dbba890cf1 | ||
|
|
3f8b90c345 | ||
|
|
28a63d3e6f | ||
|
|
318e09356b | ||
|
|
6b3a4ffe36 | ||
|
|
7f6e0a4c09 | ||
|
|
6cffb201f3 | ||
|
|
4b0f00b7ce | ||
|
|
4aa4f333ed | ||
|
|
a04cfb72d5 | ||
|
|
1cbb729fdc | ||
|
|
d176986488 | ||
|
|
c759ddd676 | ||
|
|
9cfab47b18 | ||
|
|
6e3dfc1f3b | ||
|
|
ef63568e94 | ||
|
|
d40898dfab | ||
|
|
422e5a4807 | ||
|
|
6397710486 | ||
|
|
10bb0dbfec | ||
|
|
c19b6c922a | ||
|
|
c5f8bbbc0b | ||
|
|
4759abc5f2 | ||
|
|
e31e385ce3 | ||
|
|
b22bda21a1 | ||
|
|
b38d84d867 | ||
|
|
50b14a38f5 | ||
|
|
edb0d64367 | ||
|
|
33b1a4c218 | ||
|
|
645749ef98 | ||
|
|
9a0c0d3f74 | ||
|
|
7cae5f9fc8 | ||
|
|
18edda0f92 | ||
|
|
89681b183d | ||
|
|
c8973693ab | ||
|
|
4e87e05b25 | ||
|
|
fe03519704 | ||
|
|
b004872c59 | ||
|
|
933f32cc4d | ||
|
|
c6def253b4 | ||
|
|
dd3430a6e9 | ||
|
|
cb1fbf8e6a | ||
|
|
51012a0969 | ||
|
|
a45bd29535 | ||
|
|
688fbf5475 | ||
|
|
f4364e0730 | ||
|
|
fae8762630 | ||
|
|
28178bcf24 | ||
|
|
cec7fe4da6 | ||
|
|
c15602f48e | ||
|
|
3b2cbbcb9a | ||
|
|
c69c47b9fe | ||
|
|
5d1a5ddb65 | ||
|
|
f97cc10372 | ||
|
|
a3829b8650 | ||
|
|
615513ba52 | ||
|
|
2bd8aaefa4 | ||
|
|
252d333fc1 | ||
|
|
2aa4e2e2d4 | ||
|
|
c6cda0bdb7 | ||
|
|
730e37edb6 | ||
|
|
4b6e6ab91c | ||
|
|
24842e0586 | ||
|
|
159cf04e86 | ||
|
|
676432d4e1 | ||
|
|
1e72b77994 | ||
|
|
1cf3bbaea6 | ||
|
|
d448429e52 | ||
|
|
4534fb1c86 | ||
|
|
362f2b69ff | ||
|
|
3c184d8180 | ||
|
|
a440d6636f | ||
|
|
91e8cc6216 | ||
|
|
d0c2ebf414 | ||
|
|
e17b712894 | ||
|
|
1d95fb659d | ||
|
|
62324627aa | ||
|
|
623eea376a | ||
|
|
5ef8093732 | ||
|
|
6d50071e84 | ||
|
|
60dae9985d | ||
|
|
df320c4473 | ||
|
|
3aa477f6ec | ||
|
|
282f92f7dd | ||
|
|
8e913bff55 | ||
|
|
07fcf422a1 | ||
|
|
da542e1bf7 | ||
|
|
93fe6e13a3 | ||
|
|
2c281ebb6c | ||
|
|
37b08e8365 | ||
|
|
318f962928 | ||
|
|
acb5b34328 | ||
|
|
c1629c9ea2 | ||
|
|
1e4e549296 | ||
|
|
439fb8e1e0 | ||
|
|
53e44d90c7 | ||
|
|
32751b8ab1 | ||
|
|
5ce0e07da7 | ||
|
|
1c86d93ca5 | ||
|
|
ea4e4149af | ||
|
|
0e05f54516 | ||
|
|
095aadc43f | ||
|
|
68a1c6b0d9 | ||
|
|
bda702ef83 | ||
|
|
a4129c6e33 | ||
|
|
848f3d40c8 | ||
|
|
1949e78336 | ||
|
|
2273d6b657 | ||
|
|
e39c194387 | ||
|
|
e1b78bc64d | ||
|
|
e65c84abb0 | ||
|
|
8eec1389fb | ||
|
|
e38dabbc0c | ||
|
|
54731d75d7 | ||
|
|
18f2259499 | ||
|
|
1d84fd64fc | ||
|
|
03ed26afdd | ||
|
|
775bcebde5 | ||
|
|
7fcc8326e3 | ||
|
|
cc99526db1 | ||
|
|
72660f5f15 | ||
|
|
bace212474 | ||
|
|
e117a890ca | ||
|
|
5614bb91f5 | ||
|
|
7abee0cedf | ||
|
|
6dcbaf5857 | ||
|
|
baa080d46a | ||
|
|
02ef611ef3 | ||
|
|
24b8bf2163 | ||
|
|
e37c27d239 | ||
|
|
270f4f6d63 | ||
|
|
e147c6fef8 | ||
|
|
cea81a62ff | ||
|
|
c0366d89f6 | ||
|
|
523d778aef | ||
|
|
5b7417dbe1 | ||
|
|
5401c4c2bf | ||
|
|
c11dead17c | ||
|
|
4041156461 | ||
|
|
279fff0d7f | ||
|
|
54f10e6adc | ||
|
|
fb1cba063d | ||
|
|
e4daf9dfce | ||
|
|
8a26980b07 | ||
|
|
1e27f4b68c | ||
|
|
03ea28c985 | ||
|
|
0f92cae9bc | ||
|
|
a9740b7da6 | ||
|
|
d572cb6c1c | ||
|
|
05c2b37176 | ||
|
|
8c0514f741 | ||
|
|
2aff74dd68 | ||
|
|
b924f04784 | ||
|
|
d63b8db852 | ||
|
|
2959f292db | ||
|
|
965c17756a | ||
|
|
0c415ddd67 | ||
|
|
16e91fe8ab | ||
|
|
74d2b0f112 | ||
|
|
d40a9e8257 | ||
|
|
ec6a40e278 | ||
|
|
4a6367ae66 | ||
|
|
bed1847b6a | ||
|
|
4d0c6b2936 | ||
|
|
25a73f2690 | ||
|
|
b1ccd57b18 | ||
|
|
5fd0cd9a9b | ||
|
|
97d8e82c4c | ||
|
|
d7b9c76c72 | ||
|
|
0baed24c1b | ||
|
|
4f7068c165 | ||
|
|
b144a5e907 | ||
|
|
c5a3b7e790 | ||
|
|
a652ffc4b5 | ||
|
|
eec79f9bab | ||
|
|
a1b15ac21f | ||
|
|
709e85953d | ||
|
|
84b65340e1 | ||
|
|
f50c11ca40 | ||
|
|
cfd3bb1785 | ||
|
|
62ab514e98 | ||
|
|
724f9694a6 | ||
|
|
948d0125db | ||
|
|
9fc2570677 | ||
|
|
79d2eb64bb | ||
|
|
1974a58fe0 | ||
|
|
827dbcb150 | ||
|
|
47770c4dfb | ||
|
|
7228920ca8 | ||
|
|
61f175f4ba | ||
|
|
26b0d15628 | ||
|
|
15387be289 | ||
|
|
f684090cbe | ||
|
|
b7c190d97b | ||
|
|
82aec1cc35 | ||
|
|
75cb225989 | ||
|
|
36124b1087 | ||
|
|
1af407e78f | ||
|
|
2b40660ec1 | ||
|
|
f5882ce758 | ||
|
|
34417732fa | ||
|
|
b894b13059 | ||
|
|
bbb720034a | ||
|
|
4af6e2432b | ||
|
|
f3f53c8ca5 | ||
|
|
2f043896d1 | ||
|
|
29eb7d9ce0 | ||
|
|
34216c0422 | ||
|
|
22c7ea4068 | ||
|
|
29dc25e88a | ||
|
|
0572abbf53 | ||
|
|
7d95ff76e6 | ||
|
|
affadbef0b | ||
|
|
397bd0938a | ||
|
|
bbb8de0966 | ||
|
|
5e38616380 | ||
|
|
54705b3992 | ||
|
|
4ed601b172 | ||
|
|
04a3ae5592 | ||
|
|
bd08a2bd0c | ||
|
|
55ac522068 | ||
|
|
ccc265eaa7 | ||
|
|
a545c6f6b1 | ||
|
|
5b774c67d3 | ||
|
|
7049ef5f90 | ||
|
|
7df1c720f6 | ||
|
|
b3756cf0e9 | ||
|
|
065866b28d | ||
|
|
dcb1ef5c22 | ||
|
|
d428bf8c56 | ||
|
|
d096b524af | ||
|
|
c9b51693dc | ||
|
|
cae0ae2e4b | ||
|
|
469938cb40 | ||
|
|
eaa2818189 | ||
|
|
622ec449e5 | ||
|
|
bb531a0a1c | ||
|
|
e6629837a9 | ||
|
|
97a377b973 | ||
|
|
6fd5a04729 | ||
|
|
0f4e21360d | ||
|
|
d03e0f3411 | ||
|
|
12dc462520 | ||
|
|
967f4ca847 | ||
|
|
368f85545e | ||
|
|
c59cb511f3 | ||
|
|
fa1194d30a | ||
|
|
25b93b9def | ||
|
|
b98ebe0fa5 | ||
|
|
3009458e2f | ||
|
|
5ce42a7e68 | ||
|
|
9ee1c838cb | ||
|
|
88364bc2bc | ||
|
|
35140f3354 | ||
|
|
15c2e1260b | ||
|
|
d309394447 | ||
|
|
d4fbe3182d | ||
|
|
5584fa1709 | ||
|
|
2d978cbd30 | ||
|
|
0a3f67e3b0 | ||
|
|
ea58130d1a | ||
|
|
3132e196bd | ||
|
|
51b66427c9 | ||
|
|
69764d720a | ||
|
|
fcc6a1c4ec | ||
|
|
55bad949ed | ||
|
|
bb1c9dcc3b | ||
|
|
aa04f1d7ad | ||
|
|
f4b45b76ef | ||
|
|
554097ff7f | ||
|
|
96f3b56c8c | ||
|
|
ee087bb8eb | ||
|
|
e5acb2bd2e | ||
|
|
173e243aae | ||
|
|
cc244b371d | ||
|
|
bd4e152791 | ||
|
|
aa826d88e1 | ||
|
|
37569e64e8 | ||
|
|
a657546f9c | ||
|
|
8083e1bd9e | ||
|
|
8b4e27e26e | ||
|
|
d6ade7422a | ||
|
|
ca1e465f6d | ||
|
|
f6c1c9e95d | ||
|
|
2dbef509e2 | ||
|
|
a4125514f5 | ||
|
|
033d001e90 | ||
|
|
284ef5f357 | ||
|
|
47ff5de8c2 | ||
|
|
34f0fe9de0 | ||
|
|
ccb9aae905 | ||
|
|
f4316c36df | ||
|
|
8886f118db | ||
|
|
f944e7845c | ||
|
|
6b7a83c7b0 | ||
|
|
f6cd2d38c0 | ||
|
|
d55a3cf19d | ||
|
|
fa729135d8 | ||
|
|
b436a98257 | ||
|
|
2d789604b8 | ||
|
|
c4558f8291 | ||
|
|
2ad3c4c89e | ||
|
|
3866db2d5a | ||
|
|
8ad7635ec9 | ||
|
|
c0722725f9 | ||
|
|
25063f1d9b | ||
|
|
fd13f0ee52 | ||
|
|
b364e5d27b | ||
|
|
16ece03a2e | ||
|
|
094fe66d9f | ||
|
|
27d7260075 | ||
|
|
a338e21bd1 | ||
|
|
5789f8f780 | ||
|
|
9b2961573a | ||
|
|
d5870bbe23 | ||
|
|
c2bbf9cf6c | ||
|
|
8f0d68fa27 | ||
|
|
d54f8c8cf6 | ||
|
|
e0b0dc11df | ||
|
|
75c4f7e097 | ||
|
|
904cb691f3 | ||
|
|
3f2599d97d | ||
|
|
186a6f4876 | ||
|
|
69b5d3c51f | ||
|
|
2bfb4dbce4 | ||
|
|
4e74239cca | ||
|
|
f365611ca3 | ||
|
|
523c83ec9a | ||
|
|
20d242b0de | ||
|
|
dffd72f171 | ||
|
|
3b3bc455d0 | ||
|
|
e871dcbc23 | ||
|
|
adbd4ed16d | ||
|
|
1f4643a2f4 | ||
|
|
8ba92cfe81 | ||
|
|
fc57ebc057 | ||
|
|
e958c5afe7 | ||
|
|
431b0cce7d | ||
|
|
1023b1220e | ||
|
|
ff4e9d91d9 | ||
|
|
ce2d00b2b4 | ||
|
|
90ae4673a5 | ||
|
|
2a98f41708 | ||
|
|
fb0b844a7d | ||
|
|
ac57d15b75 | ||
|
|
4dd4535441 | ||
|
|
8415060e1e | ||
|
|
1a797ac67c | ||
|
|
130832150c | ||
|
|
7ef8206859 | ||
|
|
438fa2fdc1 | ||
|
|
0f4805f515 | ||
|
|
562ba1715a | ||
|
|
55b7688ef5 | ||
|
|
3b21161922 | ||
|
|
95a9fea711 | ||
|
|
e73a6965e3 | ||
|
|
9bc629208f | ||
|
|
4b88270ba8 | ||
|
|
c79223040d | ||
|
|
a8b07aa4e9 | ||
|
|
3f39e5ae6c | ||
|
|
3aceb94b9e | ||
|
|
fb3e1eeb93 | ||
|
|
f03aa651c0 | ||
|
|
5d07c20d8e | ||
|
|
4ee1eb7bd4 | ||
|
|
e9a68cfbc3 | ||
|
|
d3ed8ceb3d | ||
|
|
569e7f6ef2 | ||
|
|
f20ee31477 | ||
|
|
1e55286996 | ||
|
|
9ef876f269 | ||
|
|
24bec03beb | ||
|
|
c3b1424cc0 | ||
|
|
8ba6d1b0cc | ||
|
|
1c4f90a05d | ||
|
|
44317f04b1 | ||
|
|
b7b40c3120 | ||
|
|
e366f2b876 | ||
|
|
fd75eb50c0 | ||
|
|
a91dedca48 | ||
|
|
482a9d41b9 | ||
|
|
a71e2621bc | ||
|
|
b908bd4e15 | ||
|
|
ef33b97050 | ||
|
|
814ed26cfa | ||
|
|
6da6a11331 | ||
|
|
3dd985ee2a | ||
|
|
f1d92d941e | ||
|
|
dc434bbcb0 | ||
|
|
947b3b8baf | ||
|
|
f8989a2155 | ||
|
|
6dad7bd69c | ||
|
|
208f3688e0 | ||
|
|
b598ea93e7 | ||
|
|
7e6502a6cb | ||
|
|
9887c71c41 | ||
|
|
62187daf9f | ||
|
|
e7cae74725 | ||
|
|
e6441154fc | ||
|
|
849c0e3046 | ||
|
|
b368eddd04 | ||
|
|
823d8a6eb1 | ||
|
|
bc596a7418 | ||
|
|
be5d92e014 | ||
|
|
c32364f54c | ||
|
|
1921eaad64 | ||
|
|
26a3a48d65 | ||
|
|
de42b6a7a8 | ||
|
|
922ebc7b0d | ||
|
|
b194041adf | ||
|
|
db82b8f9bd | ||
|
|
a9ef75c50d | ||
|
|
7edd20916a | ||
|
|
e41c8d6ad4 | ||
|
|
ccd86b68ef | ||
|
|
7bb7043580 | ||
|
|
f3e9b338e0 | ||
|
|
cbb6ad9d10 | ||
|
|
727daea783 | ||
|
|
2453890463 | ||
|
|
78e2426859 | ||
|
|
602ef2ae00 | ||
|
|
31efc3a78d | ||
|
|
a4e31088ce | ||
|
|
e20d7d7167 | ||
|
|
b108611622 | ||
|
|
15e98129b2 | ||
|
|
af463e7e19 | ||
|
|
01296a6de0 | ||
|
|
2ace287dea | ||
|
|
939fff6799 | ||
|
|
361ee9733f | ||
|
|
49528751b8 | ||
|
|
547bf7f983 | ||
|
|
fbecbc8cfb | ||
|
|
5da2f69f41 | ||
|
|
57ae2e2428 | ||
|
|
380d3aa6be | ||
|
|
4c0aee5a75 | ||
|
|
8c343cf861 | ||
|
|
4dbe060f2c | ||
|
|
e212226828 | ||
|
|
e9e6b88b35 | ||
|
|
360370d953 | ||
|
|
1fab73ac85 | ||
|
|
be06a9348d | ||
|
|
7f0606016c | ||
|
|
7b224903f4 | ||
|
|
93d8bfcdc4 | ||
|
|
2c05c494c0 | ||
|
|
2933ed4df7 | ||
|
|
b4b41f48d1 | ||
|
|
447a9638b7 | ||
|
|
4d29312ce1 | ||
|
|
c129544f0f | ||
|
|
063c0502ef | ||
|
|
2ea0910031 | ||
|
|
33399fdee2 | ||
|
|
a45623c447 | ||
|
|
145d39fbe5 | ||
|
|
d9586857d6 | ||
|
|
c95b7a723f | ||
|
|
5569e1c39a | ||
|
|
89269c84fe | ||
|
|
608c31c60d | ||
|
|
6d7cce481e | ||
|
|
6d52cf2149 | ||
|
|
439df5087f | ||
|
|
0d3b0afe9e | ||
|
|
abc9400e10 | ||
|
|
371acb22e6 | ||
|
|
5de603abc8 | ||
|
|
f2716dada0 | ||
|
|
b4604683fa | ||
|
|
0e1c06128a | ||
|
|
0c109ea2cb | ||
|
|
911ea946cb | ||
|
|
c22e4b19e6 | ||
|
|
991f0706d8 | ||
|
|
fd73a2121c | ||
|
|
50e4e9283d | ||
|
|
8530712dff | ||
|
|
0cb957a684 | ||
|
|
a331a305e9 | ||
|
|
316e6a66f2 | ||
|
|
c4d0df0c4f | ||
|
|
aa9fb57b99 | ||
|
|
6596268675 | ||
|
|
b50e1bd3c3 | ||
|
|
82271cee5b | ||
|
|
22a415478f | ||
|
|
dcba2534fa | ||
|
|
b222eb6443 | ||
|
|
3973628ea6 | ||
|
|
7fc840cc85 | ||
|
|
4adcfa052f | ||
|
|
09451b6857 | ||
|
|
21346b7a04 | ||
|
|
ebbaebf784 | ||
|
|
da414db464 | ||
|
|
deb4d50e51 | ||
|
|
ffb488781f | ||
|
|
b9e6391582 | ||
|
|
2c8c4ce2e0 | ||
|
|
bc36f18117 | ||
|
|
e5c84d5152 | ||
|
|
d49f3797a5 | ||
|
|
b87ef9460b | ||
|
|
a9831305d8 | ||
|
|
7a807ad8a7 | ||
|
|
d86b6915be | ||
|
|
05e15b046f | ||
|
|
1d90f28029 | ||
|
|
8acdd759b9 | ||
|
|
46b3bd5454 | ||
|
|
51175595b3 | ||
|
|
eca57e925a | ||
|
|
bc2aadad84 | ||
|
|
6ef4d9d512 | ||
|
|
9ec0126ed2 | ||
|
|
8f4fac7f96 | ||
|
|
02859fb74a | ||
|
|
3e3844b554 | ||
|
|
c90341a155 | ||
|
|
7c6c052e68 |
@@ -1,3 +1,4 @@
|
|||||||
|
openssl.pc
|
||||||
Makefile.ssl
|
Makefile.ssl
|
||||||
MINFO
|
MINFO
|
||||||
makefile.one
|
makefile.one
|
||||||
@@ -11,3 +12,5 @@ maketest.log
|
|||||||
cctest
|
cctest
|
||||||
cctest.c
|
cctest.c
|
||||||
cctest.a
|
cctest.a
|
||||||
|
libcrypto.so.*
|
||||||
|
libssl.so.*
|
||||||
|
|||||||
752
FAQ
752
FAQ
@@ -1,30 +1,72 @@
|
|||||||
OpenSSL - Frequently Asked Questions
|
OpenSSL - Frequently Asked Questions
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
|
[MISC] Miscellaneous questions
|
||||||
|
|
||||||
* Which is the current version of OpenSSL?
|
* Which is the current version of OpenSSL?
|
||||||
* Where is the documentation?
|
* Where is the documentation?
|
||||||
* How can I contact the OpenSSL developers?
|
* 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?
|
* Where can I get a compiled version of OpenSSL?
|
||||||
* I've compiled a program under Windows and it crashes: why?
|
* Why aren't tools like 'autoconf' and 'libtool' used?
|
||||||
* I've called <some function> and it fails, why?
|
* What is an 'engine' version?
|
||||||
* I just get a load of numbers for the error output, what do they mean?
|
* How do I check the authenticity of the OpenSSL distribution?
|
||||||
* Why do I get errors about unknown algorithms?
|
|
||||||
|
[LEGAL] Legal questions
|
||||||
|
|
||||||
|
* Do I need patent licenses to use OpenSSL?
|
||||||
|
* Can I use OpenSSL with GPL software?
|
||||||
|
|
||||||
|
[USER] Questions on using the OpenSSL applications
|
||||||
|
|
||||||
|
* Why do I get a "PRNG not seeded" error message?
|
||||||
|
* Why do I get an "unable to write 'random state'" error message?
|
||||||
* How do I create certificates or certificate requests?
|
* How do I create certificates or certificate requests?
|
||||||
* Why can't I create certificate requests?
|
* Why can't I create certificate requests?
|
||||||
* Why does <SSL program> fail with a certificate verify error?
|
* Why does <SSL program> fail with a certificate verify error?
|
||||||
|
* Why can I only use weak ciphers when I connect to a server using OpenSSL?
|
||||||
* How can I create DSA certificates?
|
* How can I create DSA certificates?
|
||||||
* Why can't I make an SSL connection using a DSA certificate?
|
* Why can't I make an SSL connection using a DSA certificate?
|
||||||
* Why can't the OpenSSH configure script detect OpenSSL?
|
* How can I remove the passphrase on a private key?
|
||||||
|
* Why can't I use OpenSSL certificates with SSL client authentication?
|
||||||
|
* Why does my browser give a warning about a mismatched hostname?
|
||||||
|
* How do I install a CA certificate into a browser?
|
||||||
|
* Why is OpenSSL x509 DN output not conformant to RFC2253?
|
||||||
|
|
||||||
|
[BUILD] Questions about building and testing OpenSSL
|
||||||
|
|
||||||
|
* Why does the linker complain about undefined symbols?
|
||||||
|
* Why does the OpenSSL test fail with "bc: command not found"?
|
||||||
|
* Why does the OpenSSL test fail with "bc: 1 no implemented"?
|
||||||
|
* Why does the OpenSSL test fail with "bc: stack empty"?
|
||||||
|
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
|
||||||
|
* Why does the OpenSSL compilation fail with "ar: command not found"?
|
||||||
|
* Why does the OpenSSL compilation fail on Win32 with VC++?
|
||||||
|
* What is special about OpenSSL on Redhat?
|
||||||
|
* Why does the OpenSSL compilation fail on MacOS X?
|
||||||
|
* Why does the OpenSSL test suite fail on MacOS X?
|
||||||
|
|
||||||
|
[PROG] Questions about programming with OpenSSL
|
||||||
|
|
||||||
|
* Is OpenSSL thread-safe?
|
||||||
|
* I've compiled a program under Windows and it crashes: why?
|
||||||
|
* How do I read or write a DER encoded buffer using the ASN1 functions?
|
||||||
|
* I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
|
||||||
|
* I've called <some function> and it fails, why?
|
||||||
|
* I just get a load of numbers for the error output, what do they mean?
|
||||||
|
* Why do I get errors about unknown algorithms?
|
||||||
|
* Why can't the OpenSSH configure script detect OpenSSL?
|
||||||
|
* Can I use OpenSSL's SSL library with non-blocking I/O?
|
||||||
|
* Why doesn't my server application receive a client certificate?
|
||||||
|
* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
[MISC] ========================================================================
|
||||||
|
|
||||||
* Which is the current version of OpenSSL?
|
* Which is the current version of OpenSSL?
|
||||||
|
|
||||||
The current version is available from <URL: http://www.openssl.org>.
|
The current version is available from <URL: http://www.openssl.org>.
|
||||||
OpenSSL 0.9.5a was released on April 1st, 2000.
|
OpenSSL 0.9.6h was released on December 5, 2002.
|
||||||
|
|
||||||
In addition to the current stable release, you can also access daily
|
In addition to the current stable release, you can also access daily
|
||||||
snapshots of the OpenSSL development version at <URL:
|
snapshots of the OpenSSL development version at <URL:
|
||||||
@@ -70,89 +112,6 @@ OpenSSL. Information on the OpenSSL mailing lists is available from
|
|||||||
<URL: http://www.openssl.org>.
|
<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 (with limitations: an SSL connection may not concurrently be used
|
|
||||||
by multiple threads). 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 and later make the error visible by refusing
|
|
||||||
to perform potentially insecure encryption.
|
|
||||||
|
|
||||||
On systems without /dev/urandom, it is a good idea to use the Entropy
|
|
||||||
Gathering Demon; see the RAND_egd() manpage for details.
|
|
||||||
|
|
||||||
Most components of the openssl command line tool try to use the
|
|
||||||
file $HOME/.rnd (or $RANDFILE, if this environment variable is set)
|
|
||||||
for seeding the PRNG. If this file does not exist or is too short,
|
|
||||||
the "PRNG not seeded" error message may occur.
|
|
||||||
|
|
||||||
[Note to OpenSSL 0.9.5 users: The command "openssl rsa" in version
|
|
||||||
0.9.5 does not do this and will fail on systems without /dev/urandom
|
|
||||||
when trying to password-encrypt an RSA key! This is a bug in the
|
|
||||||
library; try a later version instead.]
|
|
||||||
|
|
||||||
|
|
||||||
* 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).
|
|
||||||
|
|
||||||
In case you get errors about the following symbols, use the config
|
|
||||||
option "no-asm", as described in INSTALL:
|
|
||||||
|
|
||||||
BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
|
|
||||||
CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
|
|
||||||
RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
|
|
||||||
bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
|
|
||||||
bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
|
|
||||||
des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
|
|
||||||
des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
|
|
||||||
|
|
||||||
If none of these helps, 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?
|
* Where can I get a compiled version of OpenSSL?
|
||||||
|
|
||||||
Some applications that use OpenSSL are distributed in binary form.
|
Some applications that use OpenSSL are distributed in binary form.
|
||||||
@@ -166,37 +125,135 @@ on how to obtain and install the free GNU C compiler.
|
|||||||
A number of Linux and *BSD distributions include OpenSSL.
|
A number of Linux and *BSD distributions include OpenSSL.
|
||||||
|
|
||||||
|
|
||||||
* I've compiled a program under Windows and it crashes: why?
|
* Why aren't tools like 'autoconf' and 'libtool' used?
|
||||||
|
|
||||||
This is usually because you've missed the comment in INSTALL.W32. You
|
autoconf will probably be used in future OpenSSL versions. If it was
|
||||||
must link with the multithreaded DLL version of the VC++ runtime library
|
less Unix-centric, it might have been used much earlier.
|
||||||
otherwise the conflict will cause a program to crash: typically on the
|
|
||||||
first BIO related read or write operation.
|
* What is an 'engine' version?
|
||||||
|
|
||||||
|
With version 0.9.6 OpenSSL was extended to interface to external crypto
|
||||||
|
hardware. This was realized in a special release '0.9.6-engine'. With
|
||||||
|
version 0.9.7 (not yet released) the changes were merged into the main
|
||||||
|
development line, so that the special release is no longer necessary.
|
||||||
|
|
||||||
|
* How do I check the authenticity of the OpenSSL distribution?
|
||||||
|
|
||||||
|
We provide MD5 digests and ASC signatures of each tarball.
|
||||||
|
Use MD5 to check that a tarball from a mirror site is identical:
|
||||||
|
|
||||||
|
md5sum TARBALL | awk '{print $1;}' | cmp - TARBALL.md5
|
||||||
|
|
||||||
|
You can check authenticity using pgp or gpg. You need the OpenSSL team
|
||||||
|
member public key used to sign it (download it from a key server). Then
|
||||||
|
just do:
|
||||||
|
|
||||||
|
pgp TARBALL.asc
|
||||||
|
|
||||||
|
[LEGAL] =======================================================================
|
||||||
|
|
||||||
|
* 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
|
||||||
|
|
||||||
|
|
||||||
* I've called <some function> and it fails, why?
|
* Can I use OpenSSL with GPL software?
|
||||||
|
|
||||||
Before submitting a report or asking in one of the mailing lists you
|
On many systems including the major Linux and BSD distributions, yes (the
|
||||||
should try to determine the cause. In particular you should call
|
GPL does not place restrictions on using libraries that are part of the
|
||||||
ERR_print_errors() or ERR_print_errors_fp() after the failed call
|
normal operating system distribution).
|
||||||
and see if the message helps.
|
|
||||||
|
On other systems, the situation is less clear. Some GPL software copyright
|
||||||
|
holders claim that you infringe on their rights if you use OpenSSL with
|
||||||
|
their software on operating systems that don't normally include OpenSSL.
|
||||||
|
|
||||||
|
If you develop open source software that uses OpenSSL, you may find it
|
||||||
|
useful to choose an other license than the GPL, or state explicitly that
|
||||||
|
"This program is released under the GPL with the additional exemption that
|
||||||
|
compiling, linking, and/or using OpenSSL is allowed." If you are using
|
||||||
|
GPL software developed by others, you may want to ask the copyright holder
|
||||||
|
for permission to use their software with OpenSSL.
|
||||||
|
|
||||||
|
|
||||||
* I just get a load of numbers for the error output, what do they mean?
|
[USER] ========================================================================
|
||||||
|
|
||||||
The actual format is described in the ERR_print_errors() manual page.
|
* Why do I get a "PRNG not seeded" error message?
|
||||||
You should call the function ERR_load_crypto_strings() before hand and
|
|
||||||
the message will be output in text form. If you can't do this (for example
|
Cryptographic software needs a source of unpredictable data to work
|
||||||
it is a pre-compiled binary) you can use the errstr utility on the error
|
correctly. Many open source operating systems provide a "randomness
|
||||||
code itself (the hex digits after the second colon).
|
device" that serves this purpose. On other systems, applications have
|
||||||
|
to call the RAND_add() or RAND_seed() function with appropriate data
|
||||||
|
before generating keys or performing public key encryption.
|
||||||
|
(These functions initialize the pseudo-random number generator, PRNG.)
|
||||||
|
|
||||||
|
Some broken applications do not do this. As of version 0.9.5, the
|
||||||
|
OpenSSL functions that need randomness report an error if the random
|
||||||
|
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 and later make the error visible by refusing
|
||||||
|
to perform potentially insecure encryption.
|
||||||
|
|
||||||
|
On systems without /dev/urandom and /dev/random, it is a good idea to
|
||||||
|
use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
|
||||||
|
details. Starting with version 0.9.7, OpenSSL will automatically look
|
||||||
|
for an EGD socket at /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool and
|
||||||
|
/etc/entropy.
|
||||||
|
|
||||||
|
Most components of the openssl command line utility automatically try
|
||||||
|
to seed the random number generator from a file. The name of the
|
||||||
|
default seeding file is determined as follows: If environment variable
|
||||||
|
RANDFILE is set, then it names the seeding file. Otherwise if
|
||||||
|
environment variable HOME is set, then the seeding file is $HOME/.rnd.
|
||||||
|
If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
|
||||||
|
use file .rnd in the current directory while OpenSSL 0.9.6a uses no
|
||||||
|
default seeding file at all. OpenSSL 0.9.6b and later will behave
|
||||||
|
similarly to 0.9.6a, but will use a default of "C:\" for HOME on
|
||||||
|
Windows systems if the environment variable has not been set.
|
||||||
|
|
||||||
|
If the default seeding file does not exist or is too short, the "PRNG
|
||||||
|
not seeded" error message may occur.
|
||||||
|
|
||||||
|
The openssl command line utility will write back a new state to the
|
||||||
|
default seeding file (and create this file if necessary) unless
|
||||||
|
there was no sufficient seeding.
|
||||||
|
|
||||||
|
Pointing $RANDFILE to an Entropy Gathering Daemon socket does not work.
|
||||||
|
Use the "-rand" option of the OpenSSL command line tools instead.
|
||||||
|
The $RANDFILE environment variable and $HOME/.rnd are only used by the
|
||||||
|
OpenSSL command line tools. Applications using the OpenSSL library
|
||||||
|
provide their own configuration options to specify the entropy source,
|
||||||
|
please check out the documentation coming the with application.
|
||||||
|
|
||||||
|
For Solaris 2.6, Tim Nibbe <tnibbe@sprint.net> and others have suggested
|
||||||
|
installing the SUNski package from Sun patch 105710-01 (Sparc) which
|
||||||
|
adds a /dev/random device and make sure it gets used, usually through
|
||||||
|
$RANDFILE. There are probably similar patches for the other Solaris
|
||||||
|
versions. An official statement from Sun with respect to /dev/random
|
||||||
|
support can be found at
|
||||||
|
http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski
|
||||||
|
However, be warned that /dev/random is usually a blocking device, which
|
||||||
|
may have some effects on OpenSSL.
|
||||||
|
A third party /dev/random solution for Solaris is available at
|
||||||
|
http://www.cosy.sbg.ac.at/~andi/
|
||||||
|
|
||||||
|
|
||||||
* Why do I get errors about unknown algorithms?
|
* Why do I get an "unable to write 'random state'" error message?
|
||||||
|
|
||||||
This can happen under several circumstances such as reading in an
|
|
||||||
encrypted private key or attempting to decrypt a PKCS#12 file. The cause
|
Sometimes the openssl command line utility does not abort with
|
||||||
is forgetting to load OpenSSL's table of algorithms with
|
a "PRNG not seeded" error message, but complains that it is
|
||||||
OpenSSL_add_all_algorithms(). See the manual page for more information.
|
"unable to write 'random state'". This message refers to the
|
||||||
|
default seeding file (see previous answer). A possible reason
|
||||||
|
is that no default filename is known because neither RANDFILE
|
||||||
|
nor HOME is set. (Versions up to 0.9.6 used file ".rnd" in the
|
||||||
|
current directory in this case, but this has changed with 0.9.6a.)
|
||||||
|
|
||||||
|
|
||||||
* How do I create certificates or certificate requests?
|
* How do I create certificates or certificate requests?
|
||||||
@@ -229,6 +286,13 @@ or file and the relevant program configured to read it. The OpenSSL program
|
|||||||
the verify(1) program manual page for more information.
|
the verify(1) program manual page for more information.
|
||||||
|
|
||||||
|
|
||||||
|
* Why can I only use weak ciphers when I connect to a server using OpenSSL?
|
||||||
|
|
||||||
|
This is almost certainly because you are using an old "export grade" browser
|
||||||
|
which only supports weak encryption. Upgrade your browser to support 128 bit
|
||||||
|
ciphers.
|
||||||
|
|
||||||
|
|
||||||
* How can I create DSA certificates?
|
* How can I create DSA certificates?
|
||||||
|
|
||||||
Check the CA.pl(1) manual page for a DSA certificate example.
|
Check the CA.pl(1) manual page for a DSA certificate example.
|
||||||
@@ -239,49 +303,427 @@ Check the CA.pl(1) manual page for a DSA certificate example.
|
|||||||
Typically you'll see a message saying there are no shared ciphers when
|
Typically you'll see a message saying there are no shared ciphers when
|
||||||
the same setup works fine with an RSA certificate. There are two possible
|
the same setup works fine with an RSA certificate. There are two possible
|
||||||
causes. The client may not support connections to DSA servers most web
|
causes. The client may not support connections to DSA servers most web
|
||||||
browsers only support connections to servers supporting RSA cipher suites.
|
browsers (including Netscape and MSIE) only support connections to servers
|
||||||
The other cause is that a set of DH parameters has not been supplied to
|
supporting RSA cipher suites. The other cause is that a set of DH parameters
|
||||||
the server. DH parameters can be created with the dhparam(1) command and
|
has not been supplied to the server. DH parameters can be created with the
|
||||||
loaded using the SSL_CTX_set_tmp_dh() for example: check the source to
|
dhparam(1) command and loaded using the SSL_CTX_set_tmp_dh() for example:
|
||||||
s_server in apps/s_server.c for an example.
|
check the source to s_server in apps/s_server.c for an example.
|
||||||
|
|
||||||
|
|
||||||
|
* How can I remove the passphrase on a private key?
|
||||||
|
|
||||||
|
Firstly you should be really *really* sure you want to do this. Leaving
|
||||||
|
a private key unencrypted is a major security risk. If you decide that
|
||||||
|
you do have to do this check the EXAMPLES sections of the rsa(1) and
|
||||||
|
dsa(1) manual pages.
|
||||||
|
|
||||||
|
|
||||||
|
* Why can't I use OpenSSL certificates with SSL client authentication?
|
||||||
|
|
||||||
|
What will typically happen is that when a server requests authentication
|
||||||
|
it will either not include your certificate or tell you that you have
|
||||||
|
no client certificates (Netscape) or present you with an empty list box
|
||||||
|
(MSIE). The reason for this is that when a server requests a client
|
||||||
|
certificate it includes a list of CAs names which it will accept. Browsers
|
||||||
|
will only let you select certificates from the list on the grounds that
|
||||||
|
there is little point presenting a certificate which the server will
|
||||||
|
reject.
|
||||||
|
|
||||||
|
The solution is to add the relevant CA certificate to your servers "trusted
|
||||||
|
CA list". How you do this depends on the server software in uses. You can
|
||||||
|
print out the servers list of acceptable CAs using the OpenSSL s_client tool:
|
||||||
|
|
||||||
|
openssl s_client -connect www.some.host:443 -prexit
|
||||||
|
|
||||||
|
If your server only requests certificates on certain URLs then you may need
|
||||||
|
to manually issue an HTTP GET command to get the list when s_client connects:
|
||||||
|
|
||||||
|
GET /some/page/needing/a/certificate.html
|
||||||
|
|
||||||
|
If your CA does not appear in the list then this confirms the problem.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does my browser give a warning about a mismatched hostname?
|
||||||
|
|
||||||
|
Browsers expect the server's hostname to match the value in the commonName
|
||||||
|
(CN) field of the certificate. If it does not then you get a warning.
|
||||||
|
|
||||||
|
|
||||||
|
* How do I install a CA certificate into a browser?
|
||||||
|
|
||||||
|
The usual way is to send the DER encoded certificate to the browser as
|
||||||
|
MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
|
||||||
|
link. On MSIE certain extensions such as .der or .cacert may also work, or you
|
||||||
|
can import the certificate using the certificate import wizard.
|
||||||
|
|
||||||
|
You can convert a certificate to DER form using the command:
|
||||||
|
|
||||||
|
openssl x509 -in ca.pem -outform DER -out ca.der
|
||||||
|
|
||||||
|
Occasionally someone suggests using a command such as:
|
||||||
|
|
||||||
|
openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
|
||||||
|
|
||||||
|
DO NOT DO THIS! This command will give away your CAs private key and
|
||||||
|
reduces its security to zero: allowing anyone to forge certificates in
|
||||||
|
whatever name they choose.
|
||||||
|
|
||||||
|
* Why is OpenSSL x509 DN output not conformant to RFC2253?
|
||||||
|
|
||||||
|
The ways to print out the oneline format of the DN (Distinguished Name) have
|
||||||
|
been extended in version 0.9.7 of OpenSSL. Using the new X509_NAME_print_ex()
|
||||||
|
interface, the "-nameopt" option could be introduded. See the manual
|
||||||
|
page of the "openssl x509" commandline tool for details. The old behaviour
|
||||||
|
has however been left as default for the sake of compatibility.
|
||||||
|
|
||||||
|
[BUILD] =======================================================================
|
||||||
|
|
||||||
|
* Why does the linker complain about undefined symbols?
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
In case you get errors about the following symbols, use the config
|
||||||
|
option "no-asm", as described in INSTALL:
|
||||||
|
|
||||||
|
BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
|
||||||
|
CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
|
||||||
|
RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
|
||||||
|
bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
|
||||||
|
bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
|
||||||
|
des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
|
||||||
|
des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
|
||||||
|
|
||||||
|
If none of these helps, you may want to try using the current snapshot.
|
||||||
|
If the problem persists, please submit a bug report.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL test fail with "bc: command not found"?
|
||||||
|
|
||||||
|
You didn't install "bc", the Unix calculator. If you want to run the
|
||||||
|
tests, get GNU bc from ftp://ftp.gnu.org or from your OS distributor.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL test fail with "bc: 1 no implemented"?
|
||||||
|
|
||||||
|
On some SCO installations or versions, bc has a bug that gets triggered
|
||||||
|
when you run the test suite (using "make test"). The message returned is
|
||||||
|
"bc: 1 not implemented".
|
||||||
|
|
||||||
|
The best way to deal with this is to find another implementation of bc
|
||||||
|
and compile/install it. GNU bc (see http://www.gnu.org/software/software.html
|
||||||
|
for download instructions) can be safely used, for example.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL test fail with "bc: stack empty"?
|
||||||
|
|
||||||
|
On some DG/ux versions, bc seems to have a too small stack for calculations
|
||||||
|
that the OpenSSL bntest throws at it. This gets triggered when you run the
|
||||||
|
test suite (using "make test"). The message returned is "bc: stack empty".
|
||||||
|
|
||||||
|
The best way to deal with this is to find another implementation of bc
|
||||||
|
and compile/install it. GNU bc (see http://www.gnu.org/software/software.html
|
||||||
|
for download instructions) can be safely used, for example.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
|
||||||
|
|
||||||
|
On some Alpha installations running Tru64 Unix and Compaq C, the compilation
|
||||||
|
of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual
|
||||||
|
memory to continue compilation.' As far as the tests have shown, this may be
|
||||||
|
a compiler bug. What happens is that it eats up a lot of resident memory
|
||||||
|
to build something, probably a table. The problem is clearly in the
|
||||||
|
optimization code, because if one eliminates optimization completely (-O0),
|
||||||
|
the compilation goes through (and the compiler consumes about 2MB of resident
|
||||||
|
memory instead of 240MB or whatever one's limit is currently).
|
||||||
|
|
||||||
|
There are three options to solve this problem:
|
||||||
|
|
||||||
|
1. set your current data segment size soft limit higher. Experience shows
|
||||||
|
that about 241000 kbytes seems to be enough on an AlphaServer DS10. You do
|
||||||
|
this with the command 'ulimit -Sd nnnnnn', where 'nnnnnn' is the number of
|
||||||
|
kbytes to set the limit to.
|
||||||
|
|
||||||
|
2. If you have a hard limit that is lower than what you need and you can't
|
||||||
|
get it changed, you can compile all of OpenSSL with -O0 as optimization
|
||||||
|
level. This is however not a very nice thing to do for those who expect to
|
||||||
|
get the best result from OpenSSL. A bit more complicated solution is the
|
||||||
|
following:
|
||||||
|
|
||||||
|
----- snip:start -----
|
||||||
|
make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \
|
||||||
|
sed -e 's/ -O[0-9] / -O0 /'`"
|
||||||
|
rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'`
|
||||||
|
make
|
||||||
|
----- snip:end -----
|
||||||
|
|
||||||
|
This will only compile sha_dgst.c with -O0, the rest with the optimization
|
||||||
|
level chosen by the configuration process. When the above is done, do the
|
||||||
|
test and installation and you're set.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL compilation fail with "ar: command not found"?
|
||||||
|
|
||||||
|
Getting this message is quite usual on Solaris 2, because Sun has hidden
|
||||||
|
away 'ar' and other development commands in directories that aren't in
|
||||||
|
$PATH by default. One of those directories is '/usr/ccs/bin'. The
|
||||||
|
quickest way to fix this is to do the following (it assumes you use sh
|
||||||
|
or any sh-compatible shell):
|
||||||
|
|
||||||
|
----- snip:start -----
|
||||||
|
PATH=${PATH}:/usr/ccs/bin; export PATH
|
||||||
|
----- snip:end -----
|
||||||
|
|
||||||
|
and then redo the compilation. What you should really do is make sure
|
||||||
|
'/usr/ccs/bin' is permanently in your $PATH, for example through your
|
||||||
|
'.profile' (again, assuming you use a sh-compatible shell).
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL compilation fail on Win32 with VC++?
|
||||||
|
|
||||||
|
Sometimes, you may get reports from VC++ command line (cl) that it
|
||||||
|
can't find standard include files like stdio.h and other weirdnesses.
|
||||||
|
One possible cause is that the environment isn't correctly set up.
|
||||||
|
To solve that problem, one should run VCVARS32.BAT which is found in
|
||||||
|
the 'bin' subdirectory of the VC++ installation directory (somewhere
|
||||||
|
under 'Program Files'). This needs to be done prior to running NMAKE,
|
||||||
|
and the changes are only valid for the current DOS session.
|
||||||
|
|
||||||
|
|
||||||
|
* What is special about OpenSSL on Redhat?
|
||||||
|
|
||||||
|
Red Hat Linux (release 7.0 and later) include a preinstalled limited
|
||||||
|
version of OpenSSL. For patent reasons, support for IDEA, RC5 and MDC2
|
||||||
|
is disabled in this version. The same may apply to other Linux distributions.
|
||||||
|
Users may therefore wish to install more or all of the features left out.
|
||||||
|
|
||||||
|
To do this you MUST ensure that you do not overwrite the openssl that is in
|
||||||
|
/usr/bin on your Red Hat machine. Several packages depend on this file,
|
||||||
|
including sendmail and ssh. /usr/local/bin is a good alternative choice. The
|
||||||
|
libraries that come with Red Hat 7.0 onwards have different names and so are
|
||||||
|
not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
|
||||||
|
/lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
|
||||||
|
/lib/libcrypto.so.2 respectively).
|
||||||
|
|
||||||
|
Please note that we have been advised by Red Hat attempting to recompile the
|
||||||
|
openssl rpm with all the cryptography enabled will not work. All other
|
||||||
|
packages depend on the original Red Hat supplied openssl package. It is also
|
||||||
|
worth noting that due to the way Red Hat supplies its packages, updates to
|
||||||
|
openssl on each distribution never change the package version, only the
|
||||||
|
build number. For example, on Red Hat 7.1, the latest openssl package has
|
||||||
|
version number 0.9.6 and build number 9 even though it contains all the
|
||||||
|
relevant updates in packages up to and including 0.9.6b.
|
||||||
|
|
||||||
|
A possible way around this is to persuade Red Hat to produce a non-US
|
||||||
|
version of Red Hat Linux.
|
||||||
|
|
||||||
|
FYI: Patent numbers and expiry dates of US patents:
|
||||||
|
MDC-2: 4,908,861 13/03/2007
|
||||||
|
IDEA: 5,214,703 25/05/2010
|
||||||
|
RC5: 5,724,428 03/03/2015
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL compilation fail on MacOS X?
|
||||||
|
|
||||||
|
If the failure happens when trying to build the "openssl" binary, with
|
||||||
|
a large number of undefined symbols, it's very probable that you have
|
||||||
|
OpenSSL 0.9.6b delivered with the operating system (you can find out by
|
||||||
|
running '/usr/bin/openssl version') and that you were trying to build
|
||||||
|
OpenSSL 0.9.7 or newer. The problem is that the loader ('ld') in
|
||||||
|
MacOS X has a misfeature that's quite difficult to go around.
|
||||||
|
Look in the file PROBLEMS for a more detailed explanation and for possible
|
||||||
|
solutions.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does the OpenSSL test suite fail on MacOS X?
|
||||||
|
|
||||||
|
If the failure happens when running 'make test' and the RC4 test fails,
|
||||||
|
it's very probable that you have OpenSSL 0.9.6b delivered with the
|
||||||
|
operating system (you can find out by running '/usr/bin/openssl version')
|
||||||
|
and that you were trying to build OpenSSL 0.9.6d. The problem is that
|
||||||
|
the loader ('ld') in MacOS X has a misfeature that's quite difficult to
|
||||||
|
go around and has linked the programs "openssl" and the test programs
|
||||||
|
with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the
|
||||||
|
libraries you just built.
|
||||||
|
Look in the file PROBLEMS for a more detailed explanation and for possible
|
||||||
|
solutions.
|
||||||
|
|
||||||
|
[PROG] ========================================================================
|
||||||
|
|
||||||
|
* Is OpenSSL thread-safe?
|
||||||
|
|
||||||
|
Yes (with limitations: an SSL connection may not concurrently be used
|
||||||
|
by multiple threads). 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.
|
||||||
|
|
||||||
|
|
||||||
|
* I've compiled a program under Windows and it crashes: why?
|
||||||
|
|
||||||
|
This is usually because you've missed the comment in INSTALL.W32.
|
||||||
|
Your application must link against the same version of the Win32
|
||||||
|
C-Runtime against which your openssl libraries were linked. The
|
||||||
|
default version for OpenSSL is /MD - "Multithreaded DLL".
|
||||||
|
|
||||||
|
If you are using Microsoft Visual C++'s IDE (Visual Studio), in
|
||||||
|
many cases, your new project most likely defaulted to "Debug
|
||||||
|
Singlethreaded" - /ML. This is NOT interchangeable with /MD and your
|
||||||
|
program will crash, typically on the first BIO related read or write
|
||||||
|
operation.
|
||||||
|
|
||||||
|
For each of the six possible link stage configurations within Win32,
|
||||||
|
your application must link against the same by which OpenSSL was
|
||||||
|
built. If you are using MS Visual C++ (Studio) this can be changed
|
||||||
|
by:
|
||||||
|
|
||||||
|
1. Select Settings... from the Project Menu.
|
||||||
|
2. Select the C/C++ Tab.
|
||||||
|
3. Select "Code Generation from the "Category" drop down list box
|
||||||
|
4. Select the Appropriate library (see table below) from the "Use
|
||||||
|
run-time library" drop down list box. Perform this step for both
|
||||||
|
your debug and release versions of your application (look at the
|
||||||
|
top left of the settings panel to change between the two)
|
||||||
|
|
||||||
|
Single Threaded /ML - MS VC++ often defaults to
|
||||||
|
this for the release
|
||||||
|
version of a new project.
|
||||||
|
Debug Single Threaded /MLd - MS VC++ often defaults to
|
||||||
|
this for the debug version
|
||||||
|
of a new project.
|
||||||
|
Multithreaded /MT
|
||||||
|
Debug Multithreaded /MTd
|
||||||
|
Multithreaded DLL /MD - OpenSSL defaults to this.
|
||||||
|
Debug Multithreaded DLL /MDd
|
||||||
|
|
||||||
|
Note that debug and release libraries are NOT interchangeable. If you
|
||||||
|
built OpenSSL with /MD your application must use /MD and cannot use /MDd.
|
||||||
|
|
||||||
|
|
||||||
|
* How do I read or write a DER encoded buffer using the ASN1 functions?
|
||||||
|
|
||||||
|
You have two options. You can either use a memory BIO in conjunction
|
||||||
|
with the i2d_XXX_bio() or d2i_XXX_bio() functions or you can use the
|
||||||
|
i2d_XXX(), d2i_XXX() functions directly. Since these are often the
|
||||||
|
cause of grief here are some code fragments using PKCS7 as an example:
|
||||||
|
|
||||||
|
unsigned char *buf, *p;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len = i2d_PKCS7(p7, NULL);
|
||||||
|
buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */
|
||||||
|
p = buf;
|
||||||
|
i2d_PKCS7(p7, &p);
|
||||||
|
|
||||||
|
At this point buf contains the len bytes of the DER encoding of
|
||||||
|
p7.
|
||||||
|
|
||||||
|
The opposite assumes we already have len bytes in buf:
|
||||||
|
|
||||||
|
unsigned char *p;
|
||||||
|
p = buf;
|
||||||
|
p7 = d2i_PKCS7(NULL, &p, len);
|
||||||
|
|
||||||
|
At this point p7 contains a valid PKCS7 structure of NULL if an error
|
||||||
|
occurred. If an error occurred ERR_print_errors(bio) should give more
|
||||||
|
information.
|
||||||
|
|
||||||
|
The reason for the temporary variable 'p' is that the ASN1 functions
|
||||||
|
increment the passed pointer so it is ready to read or write the next
|
||||||
|
structure. This is often a cause of problems: without the temporary
|
||||||
|
variable the buffer pointer is changed to point just after the data
|
||||||
|
that has been read or written. This may well be uninitialized data
|
||||||
|
and attempts to free the buffer will have unpredictable results
|
||||||
|
because it no longer points to the same address.
|
||||||
|
|
||||||
|
|
||||||
|
* I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
|
||||||
|
|
||||||
|
This usually happens when you try compiling something using the PKCS#12
|
||||||
|
macros with a C++ compiler. There is hardly ever any need to use the
|
||||||
|
PKCS#12 macros in a program, it is much easier to parse and create
|
||||||
|
PKCS#12 files using the PKCS12_parse() and PKCS12_create() functions
|
||||||
|
documented in doc/openssl.txt and with examples in demos/pkcs12. The
|
||||||
|
'pkcs12' application has to use the macros because it prints out
|
||||||
|
debugging information.
|
||||||
|
|
||||||
|
|
||||||
|
* I've called <some function> and it fails, why?
|
||||||
|
|
||||||
|
Before submitting a report or asking in one of the mailing lists, you
|
||||||
|
should try to determine the cause. In particular, you should call
|
||||||
|
ERR_print_errors() or ERR_print_errors_fp() after the failed call
|
||||||
|
and see if the message helps. Note that the problem may occur earlier
|
||||||
|
than you think -- you should check for errors after every call where
|
||||||
|
it is possible, otherwise the actual problem may be hidden because
|
||||||
|
some OpenSSL functions clear the error state.
|
||||||
|
|
||||||
|
|
||||||
|
* I just get a load of numbers for the error output, what do they mean?
|
||||||
|
|
||||||
|
The actual format is described in the ERR_print_errors() manual page.
|
||||||
|
You should call the function ERR_load_crypto_strings() before hand and
|
||||||
|
the message will be output in text form. If you can't do this (for example
|
||||||
|
it is a pre-compiled binary) you can use the errstr utility on the error
|
||||||
|
code itself (the hex digits after the second colon).
|
||||||
|
|
||||||
|
|
||||||
|
* Why do I get errors about unknown algorithms?
|
||||||
|
|
||||||
|
This can happen under several circumstances such as reading in an
|
||||||
|
encrypted private key or attempting to decrypt a PKCS#12 file. The cause
|
||||||
|
is forgetting to load OpenSSL's table of algorithms with
|
||||||
|
OpenSSL_add_all_algorithms(). See the manual page for more information.
|
||||||
|
|
||||||
|
|
||||||
* Why can't the OpenSSH configure script detect OpenSSL?
|
* Why can't the OpenSSH configure script detect OpenSSL?
|
||||||
|
|
||||||
There is a problem with OpenSSH 1.2.2p1, in that the configure script
|
Several reasons for problems with the automatic detection exist.
|
||||||
can't find the installed OpenSSL libraries. The problem is actually
|
OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
|
||||||
a small glitch that is easily solved with the following patch to be
|
Sometimes the distribution has installed an older version in the system
|
||||||
applied to the OpenSSH distribution:
|
locations that is detected instead of a new one installed. The OpenSSL
|
||||||
|
library might have been compiled for another CPU or another mode (32/64 bits).
|
||||||
|
Permissions might be wrong.
|
||||||
|
|
||||||
|
The general answer is to check the config.log file generated when running
|
||||||
|
the OpenSSH configure script. It should contain the detailed information
|
||||||
|
on why the OpenSSL library was not detected or considered incompatible.
|
||||||
|
|
||||||
|
* Can I use OpenSSL's SSL library with non-blocking I/O?
|
||||||
|
|
||||||
|
Yes; make sure to read the SSL_get_error(3) manual page!
|
||||||
|
|
||||||
|
A pitfall to avoid: Don't assume that SSL_read() will just read from
|
||||||
|
the underlying transport or that SSL_write() will just write to it --
|
||||||
|
it is also possible that SSL_write() cannot do any useful work until
|
||||||
|
there is data to read, or that SSL_read() cannot do anything until it
|
||||||
|
is possible to send data. One reason for this is that the peer may
|
||||||
|
request a new TLS/SSL handshake at any time during the protocol,
|
||||||
|
requiring a bi-directional message exchange; both SSL_read() and
|
||||||
|
SSL_write() will try to continue any pending handshake.
|
||||||
|
|
||||||
|
|
||||||
|
* Why doesn't my server application receive a client certificate?
|
||||||
|
|
||||||
|
Due to the TLS protocol definition, a client will only send a certificate,
|
||||||
|
if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
|
||||||
|
SSL_CTX_set_verify() function to enable the use of client certificates.
|
||||||
|
|
||||||
|
|
||||||
|
* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
|
||||||
|
|
||||||
|
For OpenSSL 0.9.7 the OID table was extended and corrected. In earlier
|
||||||
|
versions, uniqueIdentifier was incorrectly used for X.509 certificates.
|
||||||
|
The correct name according to RFC2256 (LDAP) is x500UniqueIdentifier.
|
||||||
|
Change your code to use the new name when compiling against OpenSSL 0.9.7.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
----- snip:start -----
|
|
||||||
--- openssh-1.2.2p1/configure.in.orig Thu Mar 23 18:56:58 2000
|
|
||||||
+++ openssh-1.2.2p1/configure.in Thu Mar 23 18:55:05 2000
|
|
||||||
@@ -152,10 +152,10 @@
|
|
||||||
AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
|
|
||||||
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
|
||||||
if test ! -z "$ssldir" ; then
|
|
||||||
- LIBS="$saved_LIBS -L$ssldir"
|
|
||||||
+ LIBS="$saved_LIBS -L$ssldir/lib"
|
|
||||||
CFLAGS="$CFLAGS -I$ssldir/include"
|
|
||||||
if test "x$need_dash_r" = "x1" ; then
|
|
||||||
- LIBS="$LIBS -R$ssldir"
|
|
||||||
+ LIBS="$LIBS -R$ssldir/lib"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
LIBS="$LIBS -lcrypto"
|
|
||||||
--- openssh-1.2.2p1/configure.orig Thu Mar 23 18:55:02 2000
|
|
||||||
+++ openssh-1.2.2p1/configure Thu Mar 23 18:57:08 2000
|
|
||||||
@@ -1890,10 +1890,10 @@
|
|
||||||
echo "configure:1891: checking for OpenSSL/SSLeay directory" >&5
|
|
||||||
for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
|
||||||
if test ! -z "$ssldir" ; then
|
|
||||||
- LIBS="$saved_LIBS -L$ssldir"
|
|
||||||
+ LIBS="$saved_LIBS -L$ssldir/lib"
|
|
||||||
CFLAGS="$CFLAGS -I$ssldir/include"
|
|
||||||
if test "x$need_dash_r" = "x1" ; then
|
|
||||||
- LIBS="$LIBS -R$ssldir"
|
|
||||||
+ LIBS="$LIBS -R$ssldir/lib"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
LIBS="$LIBS -lcrypto"
|
|
||||||
----- snip:end -----
|
|
||||||
|
|||||||
79
INSTALL
79
INSTALL
@@ -2,13 +2,18 @@
|
|||||||
INSTALLATION ON THE UNIX PLATFORM
|
INSTALLATION ON THE UNIX PLATFORM
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
[Installation on Windows, OpenVMS and MacOS (before MacOS X) is described
|
[Installation on DOS (with djgpp), Windows, OpenVMS and MacOS (before MacOS X)
|
||||||
in INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.]
|
is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.
|
||||||
|
This document describes installation on operating systems in the Unix
|
||||||
|
family.]
|
||||||
|
|
||||||
To install OpenSSL, you will need:
|
To install OpenSSL, you will need:
|
||||||
|
|
||||||
|
* make
|
||||||
* Perl 5
|
* Perl 5
|
||||||
* an ANSI C compiler
|
* an ANSI C compiler
|
||||||
|
* a development environment in form of development libraries and C
|
||||||
|
header files
|
||||||
* a supported Unix operating system
|
* a supported Unix operating system
|
||||||
|
|
||||||
Quick Start
|
Quick Start
|
||||||
@@ -43,9 +48,6 @@
|
|||||||
--openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
|
--openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
|
||||||
the library files and binaries are also installed there.
|
the library files and binaries are also installed there.
|
||||||
|
|
||||||
rsaref Build with RSADSI's RSAREF toolkit (this assumes that
|
|
||||||
librsaref.a is in the library search path).
|
|
||||||
|
|
||||||
no-threads Don't try to build with support for multi-threaded
|
no-threads Don't try to build with support for multi-threaded
|
||||||
applications.
|
applications.
|
||||||
|
|
||||||
@@ -53,6 +55,21 @@
|
|||||||
This will usually require additional system-dependent options!
|
This will usually require additional system-dependent options!
|
||||||
See "Note on multi-threading" below.
|
See "Note on multi-threading" below.
|
||||||
|
|
||||||
|
no-zlib Don't try to build with support for zlib compression and
|
||||||
|
decompression.
|
||||||
|
|
||||||
|
zlib Build with support for zlib compression/decompression.
|
||||||
|
|
||||||
|
zlib-dynamic Like "zlib", but has OpenSSL load the zlib library dynamically
|
||||||
|
when needed. This is only supported on systems where loading
|
||||||
|
of shared libraries is supported. This is the default choice.
|
||||||
|
|
||||||
|
no-shared Don't try to create shared libraries.
|
||||||
|
|
||||||
|
shared In addition to the usual static libraries, create shared
|
||||||
|
libraries on platforms where it's supported. See "Note on
|
||||||
|
shared libraries" below.
|
||||||
|
|
||||||
no-asm Do not use assembler code.
|
no-asm Do not use assembler code.
|
||||||
|
|
||||||
386 Use the 80386 instruction set only (the default x86 code is
|
386 Use the 80386 instruction set only (the default x86 code is
|
||||||
@@ -118,9 +135,15 @@
|
|||||||
OpenSSL binary ("openssl"). The libraries will be built in the top-level
|
OpenSSL binary ("openssl"). The libraries will be built in the top-level
|
||||||
directory, and the binary will be in the "apps" directory.
|
directory, and the binary will be in the "apps" directory.
|
||||||
|
|
||||||
If "make" fails, please report the problem to <openssl-bugs@openssl.org>
|
If "make" fails, look at the output. There may be reasons for
|
||||||
(note that your message will be forwarded to a public mailing list).
|
the failure that aren't problems in OpenSSL itself (like missing
|
||||||
Include the output of "make report" in your message.
|
standard headers). If it is a problem with OpenSSL itself, please
|
||||||
|
report the problem to <openssl-bugs@openssl.org> (note that your
|
||||||
|
message will be recorded in the request tracker publicly readable
|
||||||
|
via http://www.openssl.org/rt2.html and will be forwarded to a public
|
||||||
|
mailing list). Include the output of "make report" in your message.
|
||||||
|
Please check out the request tracker. Maybe the bug was already
|
||||||
|
reported or has already been fixed.
|
||||||
|
|
||||||
[If you encounter assembler error messages, try the "no-asm"
|
[If you encounter assembler error messages, try the "no-asm"
|
||||||
configuration option as an immediate fix.]
|
configuration option as an immediate fix.]
|
||||||
@@ -132,10 +155,14 @@
|
|||||||
|
|
||||||
$ make test
|
$ make test
|
||||||
|
|
||||||
If a test fails, try removing any compiler optimization flags from
|
If a test fails, look at the output. There may be reasons for
|
||||||
the CFLAGS line in Makefile.ssl and run "make clean; make". Please
|
the failure that isn't a problem in OpenSSL itself (like a missing
|
||||||
send a bug report to <openssl-bugs@openssl.org>, including the
|
or malfunctioning bc). If it is a problem with OpenSSL itself,
|
||||||
output of "make report".
|
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
|
||||||
|
"make report" in order to be added to the request tracker at
|
||||||
|
http://www.openssl.org/rt2.html.
|
||||||
|
|
||||||
4. If everything tests ok, install OpenSSL with
|
4. If everything tests ok, install OpenSSL with
|
||||||
|
|
||||||
@@ -253,3 +280,31 @@
|
|||||||
you can still use "no-threads" to suppress an annoying warning message
|
you can still use "no-threads" to suppress an annoying warning message
|
||||||
from the Configure script.)
|
from the Configure script.)
|
||||||
|
|
||||||
|
|
||||||
|
Note on shared libraries
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
Shared library is currently an experimental feature. The only reason to
|
||||||
|
have them would be to conserve memory on systems where several program
|
||||||
|
are using OpenSSL. Binary backward compatibility can't be guaranteed
|
||||||
|
before OpenSSL version 1.0.
|
||||||
|
|
||||||
|
For some systems, the OpenSSL Configure script knows what is needed to
|
||||||
|
build shared libraries for libcrypto and libssl. On these systems,
|
||||||
|
the shared libraries are currently not created by default, but giving
|
||||||
|
the option "shared" will get them created. This method supports Makefile
|
||||||
|
targets for shared library creation, like linux-shared. Those targets
|
||||||
|
can currently be used on their own just as well, but this is expected
|
||||||
|
to change in future versions of OpenSSL.
|
||||||
|
|
||||||
|
Note on random number generation
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Availability of cryptographically secure random numbers is required for
|
||||||
|
secret key generation. OpenSSL provides several options to seed the
|
||||||
|
internal PRNG. If not properly seeded, the internal PRNG will refuse
|
||||||
|
to deliver random bytes and a "PRNG not seeded error" will occur.
|
||||||
|
On systems without /dev/urandom (or similar) device, it may be necessary
|
||||||
|
to install additional support software to obtain random seed.
|
||||||
|
Please check out the manual pages for RAND_add(), RAND_bytes(), RAND_egd(),
|
||||||
|
and the FAQ for more information.
|
||||||
|
|||||||
34
INSTALL.DJGPP
Normal file
34
INSTALL.DJGPP
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
|
||||||
|
INSTALLATION ON THE DOS PLATFORM WITH DJGPP
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
Openssl has been ported to DOS, but only with long filename support. If
|
||||||
|
you wish to compile on native DOS with 8+3 filenames, you will have to
|
||||||
|
tweak the installation yourself, including renaming files with illegal
|
||||||
|
or duplicate names.
|
||||||
|
|
||||||
|
You should have a full DJGPP environment installed, including the
|
||||||
|
latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package
|
||||||
|
requires that PERL and BC also be installed.
|
||||||
|
|
||||||
|
All of these can be obtained from the usual DJGPP mirror sites, such
|
||||||
|
as "ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp". You also need to
|
||||||
|
have the WATT-32 networking package installed before you try to compile
|
||||||
|
openssl. This can be obtained from "http://www.bgnett.no/~giva/".
|
||||||
|
The Makefile assumes that the WATT-32 code is in the directory
|
||||||
|
specified by the environment variable WATT_ROOT. If you have watt-32
|
||||||
|
in directory "watt32" under your main DJGPP directory, specify
|
||||||
|
WATT_ROOT="/dev/env/DJDIR/watt32".
|
||||||
|
|
||||||
|
To compile openssl, start your BASH shell. Then configure for DOS by
|
||||||
|
running "./Configure" with appropriate arguments. The basic syntax for
|
||||||
|
DOS is:
|
||||||
|
./Configure no-threads --prefix=/dev/env/DJDIR DJGPP
|
||||||
|
|
||||||
|
You may run out of DPMI selectors when running in a DOS box under
|
||||||
|
Windows. If so, just close the BASH shell, go back to Windows, and
|
||||||
|
restart BASH. Then run "make" again.
|
||||||
|
|
||||||
|
Building openssl under DJGPP has been tested with DJGPP 2.03,
|
||||||
|
GCC 2.952, GCC 2.953, perl 5.005_02 and perl 5.006_01.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
OpenSSL - Port To The Macintosh
|
OpenSSL - Port To The Macintosh OS 9 or Earlier
|
||||||
===============================
|
===============================================
|
||||||
|
|
||||||
Thanks to Roy Wood <roy@centricsystems.ca> initial support for Mac OS (pre
|
Thanks to Roy Wood <roy@centricsystems.ca> initial support for Mac OS (pre
|
||||||
X) is now provided. "Initial" means that unlike other platforms where you
|
X) is now provided. "Initial" means that unlike other platforms where you
|
||||||
@@ -32,17 +32,17 @@ Installation procedure:
|
|||||||
to 42, change appropriately.
|
to 42, change appropriately.
|
||||||
(**) If you use SUNtar, then it might have already unbinhexed the files
|
(**) If you use SUNtar, then it might have already unbinhexed the files
|
||||||
in question.
|
in question.
|
||||||
(***) The project file was saved with CW Pro 5.3. If you have earlier
|
(***) The project file was saved with CW Pro 5.3. If you have an earlier
|
||||||
version and it refuses to open it, then download
|
version and it refuses to open it, then download
|
||||||
http://www.openssl.org/~appro/OpenSSL.mcp.xml and import it
|
http://www.openssl.org/~appro/OpenSSL.mcp.xml and import it
|
||||||
overwriting the original OpenSSL.mcp.
|
overwriting the original OpenSSL.mcp.
|
||||||
(****) Other targets are work in progress. If you feel like giving 'em a
|
(****) Other targets are works in progress. If you feel like giving 'em a
|
||||||
shot, then you should know that OpenSSL* and Lib* targets are
|
shot, then you should know that OpenSSL* and Lib* targets are
|
||||||
supposed to be built with the GUSI, MacOS library which mimics
|
supposed to be built with the GUSI, MacOS library which mimics
|
||||||
BSD sockets and some other POSIX APIs. The GUSI distribution is
|
BSD sockets and some other POSIX APIs. The GUSI distribution is
|
||||||
expected to be found in the same directory as openssl source tree,
|
expected to be found in the same directory as the openssl source tree,
|
||||||
i.e. in the parent directory to the one where this very file,
|
i.e., in the parent directory to the one where this very file,
|
||||||
namely INSTALL.MacOS. For more informations about GUSI, see
|
namely INSTALL.MacOS, resides. For more information about GUSI, see
|
||||||
http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
|
http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
|
||||||
|
|
||||||
Finally some essential comments from our generous contributor:-)
|
Finally some essential comments from our generous contributor:-)
|
||||||
|
|||||||
31
INSTALL.OS2
Normal file
31
INSTALL.OS2
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Installation on OS/2
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
You need to have the following tools installed:
|
||||||
|
|
||||||
|
* EMX GCC
|
||||||
|
* PERL
|
||||||
|
* GNU make
|
||||||
|
|
||||||
|
|
||||||
|
To build the makefile, run
|
||||||
|
|
||||||
|
> os2\os2-emx
|
||||||
|
|
||||||
|
This will configure OpenSSL and create OS2-EMX.mak which you then use to
|
||||||
|
build the OpenSSL libraries & programs by running
|
||||||
|
|
||||||
|
> make -f os2-emx.mak
|
||||||
|
|
||||||
|
If that finishes successfully you will find the libraries and programs in the
|
||||||
|
"out" directory.
|
||||||
|
|
||||||
|
Alternatively, you can make a dynamic build that puts the library code into
|
||||||
|
crypto.dll and ssl.dll by running
|
||||||
|
|
||||||
|
> make -f os2-emx-dll.mak
|
||||||
|
|
||||||
|
This will build the above mentioned dlls and a matching pair of import
|
||||||
|
libraries in the "out_dll" directory along with the set of test programs
|
||||||
|
and the openssl application.
|
||||||
39
INSTALL.VMS
39
INSTALL.VMS
@@ -8,6 +8,7 @@ Intro:
|
|||||||
|
|
||||||
This file is divided in the following parts:
|
This file is divided in the following parts:
|
||||||
|
|
||||||
|
Requirements - Mandatory reading.
|
||||||
Checking the distribution - Mandatory reading.
|
Checking the distribution - Mandatory reading.
|
||||||
Compilation - Mandatory reading.
|
Compilation - Mandatory reading.
|
||||||
Logical names - Mandatory reading.
|
Logical names - Mandatory reading.
|
||||||
@@ -19,15 +20,24 @@ This file is divided in the following parts:
|
|||||||
TODO - Things that are to come.
|
TODO - Things that are to come.
|
||||||
|
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
=============
|
||||||
|
|
||||||
|
To build and install OpenSSL, you will need:
|
||||||
|
|
||||||
|
* DEC C or some other ANSI C compiler. VAX C is *not* supported.
|
||||||
|
[Note: OpenSSL has only been tested with DEC C. Compiling with
|
||||||
|
a different ANSI C compiler may require some work]
|
||||||
|
|
||||||
Checking the distribution:
|
Checking the distribution:
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
There have been reports of places where the distribution didn't quite get
|
There have been reports of places where the distribution didn't quite get
|
||||||
through, for example if you've copied the tree from a NFS-mounted unix
|
through, for example if you've copied the tree from a NFS-mounted Unix
|
||||||
mount point.
|
mount point.
|
||||||
|
|
||||||
The easiest way to check if everything got through as it should is to check
|
The easiest way to check if everything got through as it should is to check
|
||||||
for oen of the following files:
|
for one of the following files:
|
||||||
|
|
||||||
[.CRYPTO]OPENSSLCONF.H_IN
|
[.CRYPTO]OPENSSLCONF.H_IN
|
||||||
[.CRYPTO]OPENSSLCONF_H.IN
|
[.CRYPTO]OPENSSLCONF_H.IN
|
||||||
@@ -59,7 +69,7 @@ for a command procedure name xxx-LIB.COM (in the library directories)
|
|||||||
or MAKExxx.COM (in the program directories) and read the comments at
|
or MAKExxx.COM (in the program directories) and read the comments at
|
||||||
the top to understand how to use them. However, if you want to
|
the top to understand how to use them. However, if you want to
|
||||||
compile all you can get, the simplest is to use MAKEVMS.COM in the top
|
compile all you can get, the simplest is to use MAKEVMS.COM in the top
|
||||||
directory. The syntax is trhe following:
|
directory. The syntax is the following:
|
||||||
|
|
||||||
@MAKEVMS <option> <rsaref-p> <debug-p> [<compiler>]
|
@MAKEVMS <option> <rsaref-p> <debug-p> [<compiler>]
|
||||||
|
|
||||||
@@ -69,7 +79,7 @@ directory. The syntax is trhe following:
|
|||||||
CONFIG Just build the "[.CRYPTO]OPENSSLCONF.H" file.
|
CONFIG Just build the "[.CRYPTO]OPENSSLCONF.H" file.
|
||||||
BUILDINF Just build the "[.INCLUDE]BUILDINF.H" file.
|
BUILDINF Just build the "[.INCLUDE]BUILDINF.H" file.
|
||||||
SOFTLINKS Just copies some files, to simulate Unix soft links.
|
SOFTLINKS Just copies some files, to simulate Unix soft links.
|
||||||
BUILDALL Same as ALL, except CONFIG, BUILDINF and SOFTILNKS aren't done.
|
BUILDALL Same as ALL, except CONFIG, BUILDINF and SOFTLINKS aren't done.
|
||||||
RSAREF Just build the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" library.
|
RSAREF Just build the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" library.
|
||||||
CRYPTO Just build the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library.
|
CRYPTO Just build the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library.
|
||||||
SSL Just build the "[.xxx.EXE.SSL]LIBSSL.OLB" library.
|
SSL Just build the "[.xxx.EXE.SSL]LIBSSL.OLB" library.
|
||||||
@@ -82,12 +92,17 @@ directory. The syntax is trhe following:
|
|||||||
RSAREF compile using the RSAREF Library
|
RSAREF compile using the RSAREF Library
|
||||||
NORSAREF compile without using RSAREF
|
NORSAREF compile without using RSAREF
|
||||||
|
|
||||||
Note 1: The RSAREF libraries are NOT INCLUDED and you have to
|
Note 0: The RSAREF library IS NO LONGER NEEDED. The RSA patent
|
||||||
download it from "ftp://ftp.rsa.com/rsaref". You have to
|
expires September 20, 2000, and RSA Security chose to make
|
||||||
get the ".tar-Z" file as the ".zip" file doesn't have the
|
the algorithm public domain two weeks before that.
|
||||||
directory structure stored. You have to extract the file
|
|
||||||
into the [.RSAREF] directory as that is where the scripts
|
Note 1: If you still want to use RSAREF, the library is NOT INCLUDED
|
||||||
will look for the files.
|
and you have to download it. RSA Security doesn't carry it
|
||||||
|
any more, but there are a number of places where you can find
|
||||||
|
it. 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.
|
Note 2: I have never done this, so I've no idea if it works or not.
|
||||||
|
|
||||||
@@ -129,7 +144,7 @@ Currently, the logical names supported are:
|
|||||||
used. This is good to try if something doesn't work.
|
used. This is good to try if something doesn't work.
|
||||||
OPENSSL_NO_'alg' with value YES, the corresponding crypto algorithm
|
OPENSSL_NO_'alg' with value YES, the corresponding crypto algorithm
|
||||||
will not be implemented. Supported algorithms to
|
will not be implemented. Supported algorithms to
|
||||||
do this with are: RSA, DSA, DH, MD2, MD5, RIPEMD,
|
do this with are: RSA, DSA, DH, MD2, MD4, MD5, RIPEMD,
|
||||||
SHA, DES, MDC2, CR2, RC4, RC5, IDEA, BF, CAST, HMAC,
|
SHA, DES, MDC2, CR2, RC4, RC5, IDEA, BF, CAST, HMAC,
|
||||||
SSL2. So, for example, having the logical name
|
SSL2. So, for example, having the logical name
|
||||||
OPENSSL_NO_RSA with the value YES means that the
|
OPENSSL_NO_RSA with the value YES means that the
|
||||||
@@ -249,7 +264,7 @@ following before you start compiling:
|
|||||||
The USER_CCDISABLEWARNINGS is there because otherwise, DEC C will complain
|
The USER_CCDISABLEWARNINGS is there because otherwise, DEC C will complain
|
||||||
that those macros have been changed.
|
that those macros have been changed.
|
||||||
|
|
||||||
Note: Currently, this is only usefull for library compilation. The
|
Note: Currently, this is only useful for library compilation. The
|
||||||
programs will still be linked with the current version of the
|
programs will still be linked with the current version of the
|
||||||
C library shareable image, and will thus complain if they are
|
C library shareable image, and will thus complain if they are
|
||||||
faced with an older version of the same C library shareable image.
|
faced with an older version of the same C library shareable image.
|
||||||
|
|||||||
116
INSTALL.W32
116
INSTALL.W32
@@ -2,16 +2,21 @@
|
|||||||
INSTALLATION ON THE WIN32 PLATFORM
|
INSTALLATION ON THE WIN32 PLATFORM
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
Heres a few comments about building OpenSSL in Windows environments. Most of
|
[Instructions for building for Windows CE can be found in INSTALL.WCE]
|
||||||
this is tested on Win32 but it may also work in Win 3.1 with some
|
|
||||||
|
Heres a few comments about building OpenSSL in Windows environments. Most
|
||||||
|
of this is tested on Win32 but it may also work in Win 3.1 with some
|
||||||
modification.
|
modification.
|
||||||
|
|
||||||
You need Perl for Win32 (available from http://www.activestate.com/ActivePerl)
|
You need Perl for Win32. Unless you will build on Cygwin, you will need
|
||||||
|
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
|
||||||
|
For Cygwin users, there's more info in the Cygwin section.
|
||||||
|
|
||||||
and one of the following C compilers:
|
and one of the following C compilers:
|
||||||
|
|
||||||
* Visual C++
|
* Visual C++
|
||||||
* Borland C
|
* Borland C
|
||||||
* GNU C (Mingw32 or Cygwin32)
|
* GNU C (Mingw32 or Cygwin)
|
||||||
|
|
||||||
If you want to compile in the assembly language routines with Visual C++ then
|
If you want to compile in the assembly language routines with Visual C++ then
|
||||||
you will need an assembler. This is worth doing because it will result in
|
you will need an assembler. This is worth doing because it will result in
|
||||||
@@ -78,8 +83,9 @@
|
|||||||
|
|
||||||
There are various changes you can make to the Win32 compile environment. By
|
There are various changes you can make to the Win32 compile environment. By
|
||||||
default the library is not compiled with debugging symbols. If you add 'debug'
|
default the library is not compiled with debugging symbols. If you add 'debug'
|
||||||
to the mk1mk.pl lines in the do_* batch file then debugging symbols will be
|
to the mk1mf.pl lines in the do_* batch file then debugging symbols will be
|
||||||
compiled in.
|
compiled in. Note that mk1mf.pl expects the platform to be the last argument
|
||||||
|
on the command line, so 'debug' must appear before that, as all other options.
|
||||||
|
|
||||||
The default Win32 environment is to leave out any Windows NT specific
|
The default Win32 environment is to leave out any Windows NT specific
|
||||||
features.
|
features.
|
||||||
@@ -91,6 +97,18 @@
|
|||||||
You can also build a static version of the library using the Makefile
|
You can also build a static version of the library using the Makefile
|
||||||
ms\nt.mak
|
ms\nt.mak
|
||||||
|
|
||||||
|
Borland C++ builder 5
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
* Configure for building with Borland Builder:
|
||||||
|
> perl Configure BC-32
|
||||||
|
|
||||||
|
* Create the appropriate makefile
|
||||||
|
> ms\do_nasm
|
||||||
|
|
||||||
|
* Build
|
||||||
|
> make -f ms\bcb.mak
|
||||||
|
|
||||||
Borland C++ builder 3 and 4
|
Borland C++ builder 3 and 4
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
@@ -108,11 +126,11 @@
|
|||||||
|
|
||||||
* Compiler installation:
|
* Compiler installation:
|
||||||
|
|
||||||
Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/
|
Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/
|
||||||
mingw32/egcs-1.1.2/egcs-1.1.2-mingw32.zip>. GNU make is at
|
gnu-win32/mingw32/gcc-2.95.2/gcc-2.95.2-msvcrt.exe>. Extract it
|
||||||
<ftp://agnes.dida.physik.uni-essen.de/home/janjaap/mingw32/binaries/
|
to a directory such as C:\gcc-2.95.2 and add c:\gcc-2.95.2\bin to
|
||||||
make-3.76.1.zip>. Install both of them in C:\egcs-1.1.2 and run
|
the PATH environment variable in "System Properties"; or edit and
|
||||||
C:\egcs-1.1.2\mingw32.bat to set the PATH.
|
run C:\gcc-2.95.2\mingw32.bat to set the PATH.
|
||||||
|
|
||||||
* Compile OpenSSL:
|
* Compile OpenSSL:
|
||||||
|
|
||||||
@@ -134,6 +152,80 @@
|
|||||||
> cd out
|
> cd out
|
||||||
> ..\ms\test
|
> ..\ms\test
|
||||||
|
|
||||||
|
GNU C (Cygwin)
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Cygwin provides a bash shell and GNU tools environment running
|
||||||
|
on NT 4.0, Windows 9x, Windows ME, Windows 2000, and Windows XP.
|
||||||
|
Consequently, a make of OpenSSL with Cygwin is closer to a GNU
|
||||||
|
bash environment such as Linux than to other W32 makes which are
|
||||||
|
based on a single makefile approach. Cygwin implements Posix/Unix
|
||||||
|
calls through cygwin1.dll, and is contrasted to Mingw32 which links
|
||||||
|
dynamically to msvcrt.dll or crtdll.dll.
|
||||||
|
|
||||||
|
To build OpenSSL using Cygwin:
|
||||||
|
|
||||||
|
* Install Cygwin (see http://cygwin.com/)
|
||||||
|
|
||||||
|
* Install Perl and ensure it is in the path (recent Cygwin perl
|
||||||
|
(version 5.6.1-2 of the latter has been reported to work) or
|
||||||
|
ActivePerl)
|
||||||
|
|
||||||
|
* Run the Cygwin bash shell
|
||||||
|
|
||||||
|
* $ tar zxvf openssl-x.x.x.tar.gz
|
||||||
|
$ cd openssl-x.x.x
|
||||||
|
$ ./config
|
||||||
|
[...]
|
||||||
|
$ make
|
||||||
|
[...]
|
||||||
|
$ make test
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
This will create a default install in /usr/local/ssl.
|
||||||
|
|
||||||
|
Cygwin Notes:
|
||||||
|
|
||||||
|
"make test" and normal file operations may fail in directories
|
||||||
|
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
|
||||||
|
stripping of carriage returns. To avoid this ensure that a binary
|
||||||
|
mount is used, e.g. mount -b c:\somewhere /home.
|
||||||
|
|
||||||
|
"bc" is not provided in older Cygwin distribution. This causes a
|
||||||
|
non-fatal error in "make test" but is otherwise harmless. If
|
||||||
|
desired and needed, GNU bc can be built with Cygwin without change.
|
||||||
|
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
|
||||||
|
If you used the Cygwin procedure above, you have already installed and
|
||||||
|
can skip this section. For all other procedures, there's currently no real
|
||||||
|
installation procedure for Win32. There are, however, some suggestions:
|
||||||
|
|
||||||
|
- do nothing. The include files are found in the inc32/ subdirectory,
|
||||||
|
all binaries are found in out32dll/ or out32/ depending if you built
|
||||||
|
dynamic or static libraries.
|
||||||
|
|
||||||
|
- do as is written in INSTALL.Win32 that comes with modssl:
|
||||||
|
|
||||||
|
$ md c:\openssl
|
||||||
|
$ md c:\openssl\bin
|
||||||
|
$ md c:\openssl\lib
|
||||||
|
$ md c:\openssl\include
|
||||||
|
$ md c:\openssl\include\openssl
|
||||||
|
$ copy /b inc32\* c:\openssl\include\openssl
|
||||||
|
$ copy /b out32dll\ssleay32.lib c:\openssl\lib
|
||||||
|
$ copy /b out32dll\libeay32.lib c:\openssl\lib
|
||||||
|
$ copy /b out32dll\ssleay32.dll c:\openssl\bin
|
||||||
|
$ copy /b out32dll\libeay32.dll c:\openssl\bin
|
||||||
|
$ copy /b out32dll\openssl.exe c:\openssl\bin
|
||||||
|
|
||||||
|
Of course, you can choose another device than c:. C: is used here
|
||||||
|
because that's usually the first (and often only) harddisk device.
|
||||||
|
Note: in the modssl INSTALL.Win32, p: is used rather than c:.
|
||||||
|
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
@@ -181,5 +273,5 @@
|
|||||||
malloc(), free() and realloc() as the application. However there are many
|
malloc(), free() and realloc() as the application. However there are many
|
||||||
standard library functions used by OpenSSL that call malloc() internally
|
standard library functions used by OpenSSL that call malloc() internally
|
||||||
(e.g. fopen()), and OpenSSL cannot change these; so in general you cannot
|
(e.g. fopen()), and OpenSSL cannot change these; so in general you cannot
|
||||||
rely on CYRPTO_malloc_init() solving your problem, and you should
|
rely on CRYPTO_malloc_init() solving your problem, and you should
|
||||||
consistently use the multithreaded library.
|
consistently use the multithreaded library.
|
||||||
|
|||||||
71
INSTALL.WCE
Normal file
71
INSTALL.WCE
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
INSTALLATION FOR THE WINDOWS CE PLATFORM
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Building OpenSSL for Windows CE requires the following external tools:
|
||||||
|
|
||||||
|
* Microsoft eMbedded Visual C++ 3.0
|
||||||
|
* wcecompat compatibility library (www.essemer.com.au)
|
||||||
|
* Optionally ceutils for running automated tests (www.essemer.com.au)
|
||||||
|
|
||||||
|
You also need Perl for Win32. You will need ActiveState Perl, available
|
||||||
|
from http://www.activestate.com/ActivePerl.
|
||||||
|
|
||||||
|
Windows CE support in OpenSSL relies on wcecompat. All Windows CE specific
|
||||||
|
issues should be directed to www.essemer.com.au.
|
||||||
|
|
||||||
|
The C Runtime Library implementation for Windows CE that is included with
|
||||||
|
Microsoft eMbedded Visual C++ 3.0 is incomplete and in some places
|
||||||
|
incorrect. wcecompat plugs the holes and tries to bring the Windows CE
|
||||||
|
CRT to a level that is more compatible with ANSI C. wcecompat goes further
|
||||||
|
and provides low-level IO and stream IO support for stdin/stdout/stderr
|
||||||
|
(which Windows CE does not provide). This IO functionality is not needed
|
||||||
|
by the OpenSSL library itself but is used for the tests and openssl.exe.
|
||||||
|
More information is available at www.essemer.com.au.
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
Setup the eMbedded Visual C++ environment. There are batch files for doing
|
||||||
|
this installed with eVC++. For an ARM processor, for example, execute:
|
||||||
|
|
||||||
|
> "C:\Program Files\Microsoft eMbedded Tools\EVC\WCE300\BIN\WCEARM.BAT"
|
||||||
|
|
||||||
|
Next indicate where wcecompat is located:
|
||||||
|
|
||||||
|
> set WCECOMPAT=C:\wcecompat
|
||||||
|
|
||||||
|
Next you should run Configure:
|
||||||
|
|
||||||
|
> perl Configure VC-CE
|
||||||
|
|
||||||
|
Next you need to build the Makefiles:
|
||||||
|
|
||||||
|
> ms\do_ms
|
||||||
|
|
||||||
|
If you get errors about things not having numbers assigned then check the
|
||||||
|
troubleshooting section in INSTALL.W32: you probably won't be able to compile
|
||||||
|
it as it stands.
|
||||||
|
|
||||||
|
Then from the VC++ environment at a prompt do:
|
||||||
|
|
||||||
|
- to build static libraries:
|
||||||
|
|
||||||
|
> nmake -f ms\ce.mak
|
||||||
|
|
||||||
|
- or to build DLLs:
|
||||||
|
|
||||||
|
> nmake -f ms\cedll.mak
|
||||||
|
|
||||||
|
If all is well it should compile and you will have some static libraries and
|
||||||
|
executables in out32, or some DLLs and executables in out32dll. If you want
|
||||||
|
to try the tests then make sure the ceutils are in the path and do:
|
||||||
|
|
||||||
|
> cd out32
|
||||||
|
> ..\ms\testce
|
||||||
|
|
||||||
|
This will copy each of the test programs to the Windows CE device and execute
|
||||||
|
them, displaying the output of the tests on this computer. The output should
|
||||||
|
look similar to the output produced by running the tests for a regular Windows
|
||||||
|
build.
|
||||||
|
|
||||||
2
LICENSE
2
LICENSE
@@ -12,7 +12,7 @@
|
|||||||
---------------
|
---------------
|
||||||
|
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ void main(void)
|
|||||||
|
|
||||||
tempString[bytesRead] = '\0';
|
tempString[bytesRead] = '\0';
|
||||||
|
|
||||||
printf(tempString);
|
printf("%s", tempString);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n\n\n");
|
printf("\n\n\n");
|
||||||
@@ -201,7 +201,7 @@ EXITPOINT:
|
|||||||
{
|
{
|
||||||
printf("An error occurred:\n");
|
printf("An error occurred:\n");
|
||||||
|
|
||||||
printf(GetErrorMessage());
|
printf("%s",GetErrorMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1287,7 +1287,7 @@ EXITPOINT:
|
|||||||
|
|
||||||
// Send some bytes
|
// Send some bytes
|
||||||
|
|
||||||
int MacSocket_send(const int inSocketNum,void *inBuff,int inBuffLength)
|
int MacSocket_send(const int inSocketNum,const void *inBuff,int inBuffLength)
|
||||||
{
|
{
|
||||||
OSErr errCode = noErr;
|
OSErr errCode = noErr;
|
||||||
int bytesSent = 0;
|
int bytesSent = 0;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ int MacSocket_recv(const int inSocketNum,void *outBuff,int outBuffLength,const B
|
|||||||
|
|
||||||
// Call this to send data on a socket
|
// Call this to send data on a socket
|
||||||
|
|
||||||
int MacSocket_send(const int inSocketNum,void *inBuff,int inBuffLength);
|
int MacSocket_send(const int inSocketNum,const 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
|
// If zero bytes were read in a call to MacSocket_recv(), it may be that the remote end has done a half-close
|
||||||
|
|||||||
334
Makefile.org
334
Makefile.org
@@ -5,8 +5,16 @@
|
|||||||
VERSION=
|
VERSION=
|
||||||
MAJOR=
|
MAJOR=
|
||||||
MINOR=
|
MINOR=
|
||||||
|
SHLIB_VERSION_NUMBER=
|
||||||
|
SHLIB_VERSION_HISTORY=
|
||||||
|
SHLIB_MAJOR=
|
||||||
|
SHLIB_MINOR=
|
||||||
|
SHLIB_EXT=
|
||||||
PLATFORM=dist
|
PLATFORM=dist
|
||||||
OPTIONS=
|
OPTIONS=
|
||||||
|
CONFIGURE_ARGS=
|
||||||
|
SHLIB_TARGET=
|
||||||
|
|
||||||
# INSTALL_PREFIX is for package builders so that they can configure
|
# INSTALL_PREFIX is for package builders so that they can configure
|
||||||
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
|
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
|
||||||
# Normally it is left empty.
|
# Normally it is left empty.
|
||||||
@@ -16,7 +24,6 @@ INSTALLTOP=/usr/local/ssl
|
|||||||
# Do not edit this manually. Use Configure --openssldir=DIR do change this!
|
# Do not edit this manually. Use Configure --openssldir=DIR do change this!
|
||||||
OPENSSLDIR=/usr/local/ssl
|
OPENSSLDIR=/usr/local/ssl
|
||||||
|
|
||||||
# RSAref - Define if we are to link with RSAref.
|
|
||||||
# NO_IDEA - Define to build without the IDEA algorithm
|
# NO_IDEA - Define to build without the IDEA algorithm
|
||||||
# NO_RC4 - Define to build without the RC4 algorithm
|
# NO_RC4 - Define to build without the RC4 algorithm
|
||||||
# NO_RC2 - Define to build without the RC2 algorithm
|
# NO_RC2 - Define to build without the RC2 algorithm
|
||||||
@@ -49,13 +56,16 @@ CC= gcc
|
|||||||
#CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
|
#CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
|
||||||
CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
|
CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
|
||||||
DEPFLAG=
|
DEPFLAG=
|
||||||
PEX_LIBS= -L. -L.. -L../.. -L../../..
|
PEX_LIBS=
|
||||||
EX_LIBS=
|
EX_LIBS=
|
||||||
AR=ar r
|
EXE_EXT=
|
||||||
|
ARFLAGS=
|
||||||
|
AR=ar $(ARFLAGS) r
|
||||||
RANLIB= ranlib
|
RANLIB= ranlib
|
||||||
PERL= perl
|
PERL= perl
|
||||||
TAR= tar
|
TAR= tar
|
||||||
TARFLAGS= --norecurse
|
TARFLAGS= --no-recursion
|
||||||
|
MAKEDEPPROG=makedepend
|
||||||
|
|
||||||
# Set BN_ASM to bn_asm.o if you want to use the C version
|
# Set BN_ASM to bn_asm.o if you want to use the C version
|
||||||
BN_ASM= bn_asm.o
|
BN_ASM= bn_asm.o
|
||||||
@@ -142,19 +152,28 @@ RMD160_ASM_OBJ= asm/rm86-out.o
|
|||||||
#RMD160_ASM_OBJ= asm/rm86-out.o # a.out, FreeBSD
|
#RMD160_ASM_OBJ= asm/rm86-out.o # a.out, FreeBSD
|
||||||
#RMD160_ASM_OBJ= asm/rm86bsdi.o # bsdi
|
#RMD160_ASM_OBJ= asm/rm86bsdi.o # bsdi
|
||||||
|
|
||||||
DIRS= crypto ssl rsaref apps test tools
|
# KRB5 stuff
|
||||||
|
KRB5_INCLUDES=
|
||||||
|
LIBKRB5=
|
||||||
|
|
||||||
|
DIRS= crypto ssl engines apps test tools
|
||||||
SHLIBDIRS= crypto ssl
|
SHLIBDIRS= crypto ssl
|
||||||
|
|
||||||
# dirs in crypto to build
|
# dirs in crypto to build
|
||||||
SDIRS= \
|
SDIRS= \
|
||||||
md2 md5 sha mdc2 hmac ripemd \
|
md2 md4 md5 sha mdc2 hmac ripemd \
|
||||||
des rc2 rc4 rc5 idea bf cast \
|
des rc2 rc4 rc5 idea bf cast \
|
||||||
bn rsa dsa dh \
|
bn ec rsa dsa ecdsa dh ecdh dso engine aes \
|
||||||
buffer bio stack lhash rand err objects \
|
buffer bio stack lhash rand err objects \
|
||||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
|
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
|
||||||
|
|
||||||
|
# tests to perform. "alltests" is a special word indicating that all tests
|
||||||
|
# should be performed.
|
||||||
|
TESTS = alltests
|
||||||
|
|
||||||
MAKEFILE= Makefile.ssl
|
MAKEFILE= Makefile.ssl
|
||||||
MAKE= make -f Makefile.ssl
|
NEWMAKE= make
|
||||||
|
MAKE= $(NEWMAKE) -f Makefile.ssl
|
||||||
|
|
||||||
MANDIR=$(OPENSSLDIR)/man
|
MANDIR=$(OPENSSLDIR)/man
|
||||||
MAN1=1
|
MAN1=1
|
||||||
@@ -166,47 +185,111 @@ ONEDIRS=out tmp
|
|||||||
EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
|
EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
|
||||||
WDIRS= windows
|
WDIRS= windows
|
||||||
LIBS= libcrypto.a libssl.a
|
LIBS= libcrypto.a libssl.a
|
||||||
|
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
|
||||||
|
SHARED_SSL=libssl$(SHLIB_EXT)
|
||||||
|
SHARED_LIBS=
|
||||||
|
SHARED_LIBS_LINK_EXTS=
|
||||||
|
SHARED_LDFLAGS=
|
||||||
|
|
||||||
GENERAL= Makefile
|
GENERAL= Makefile
|
||||||
BASENAME= openssl
|
BASENAME= openssl
|
||||||
NAME= $(BASENAME)-$(VERSION)
|
NAME= $(BASENAME)-$(VERSION)
|
||||||
TARFILE= $(NAME).tar
|
TARFILE= $(NAME).tar
|
||||||
WTARFILE= $(NAME)-win.tar
|
WTARFILE= $(NAME)-win.tar
|
||||||
EXHEADER= e_os.h e_os2.h
|
EXHEADER= e_os2.h
|
||||||
HEADER= e_os.h
|
HEADER= e_os.h
|
||||||
|
|
||||||
all: Makefile.ssl
|
all: Makefile.ssl build_all openssl.pc
|
||||||
@for i in $(DIRS) ;\
|
|
||||||
do \
|
BUILD_CMD=if echo " $(DIRS) " | grep " $$i " >/dev/null 2>/dev/null; then \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making all in $$i..." && \
|
(cd $$i && echo "making all in $$i..." && \
|
||||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' 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; \
|
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
|
||||||
|
else \
|
||||||
|
$(MAKE) $$i; \
|
||||||
|
fi; fi
|
||||||
|
|
||||||
|
sub_all: build_all
|
||||||
|
build_all: build_libs build_apps build_tests build_tools
|
||||||
|
|
||||||
|
build_libs: build_crypto build_ssl build_engines
|
||||||
|
|
||||||
|
build_crypto:
|
||||||
|
@i=crypto; $(BUILD_CMD)
|
||||||
|
build_ssl:
|
||||||
|
@i=ssl; $(BUILD_CMD)
|
||||||
|
build_engines:
|
||||||
|
@i=engines; $(BUILD_CMD)
|
||||||
|
build_apps:
|
||||||
|
@i=apps; $(BUILD_CMD)
|
||||||
|
build_tests:
|
||||||
|
@i=test; $(BUILD_CMD)
|
||||||
|
build_tools:
|
||||||
|
@i=tools; $(BUILD_CMD)
|
||||||
|
|
||||||
|
libcrypto$(SHLIB_EXT): libcrypto.a
|
||||||
|
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||||
|
$(MAKE) SHLIBDIRS=crypto build-shared; \
|
||||||
|
else \
|
||||||
|
echo "There's no support for shared libraries on this platform" >&2; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
|
||||||
|
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||||
|
$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
|
||||||
|
else \
|
||||||
|
echo "There's no support for shared libraries on this platform" >&2; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
clean-shared:
|
||||||
|
@for i in $(SHLIBDIRS); do \
|
||||||
|
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
|
||||||
|
tmp="$(SHARED_LIBS_LINK_EXTS)"; \
|
||||||
|
for j in $${tmp:-x}; do \
|
||||||
|
( set -x; rm -f lib$$i$$j ); \
|
||||||
|
done; \
|
||||||
|
fi; \
|
||||||
|
( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
|
||||||
|
if [ "$(PLATFORM)" = "Cygwin" ]; then \
|
||||||
|
( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
|
||||||
|
fi; \
|
||||||
done
|
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:
|
link-shared:
|
||||||
@for i in $(DIRS) ;\
|
@ for i in ${SHLIBDIRS}; do \
|
||||||
do \
|
$(NEWMAKE) -f Makefile.shared \
|
||||||
(cd $$i && echo "making all in $$i..." && \
|
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \
|
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
||||||
done;
|
symlink.$(SHLIB_TARGET); \
|
||||||
|
libs="$$libs -l$$i"; \
|
||||||
|
done
|
||||||
|
|
||||||
linux-shared:
|
build-shared: do_$(SHLIB_TARGET) link-shared
|
||||||
for i in ${SHLIBDIRS}; do \
|
|
||||||
rm -f lib$$i.a lib$$i.so \
|
do_$(SHLIB_TARGET):
|
||||||
lib$$i.so.${MAJOR} lib$$i.so.${MAJOR}.${MINOR}; \
|
@ libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||||
${MAKE} CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='-fPIC ${CFLAG}' SDIRS='${SDIRS}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' DIRS=$$i clean all || exit 1; \
|
$(NEWMAKE) -f Makefile.shared \
|
||||||
( set -x; ${CC} -shared -o lib$$i.so.${MAJOR}.${MINOR} \
|
CC="$(CC)" LDFLAGS="$(LDFLAGS)" \
|
||||||
-Wl,-S,-soname=lib$$i.so.${MAJOR} \
|
SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
|
||||||
-Wl,--whole-archive lib$$i.a \
|
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||||
-Wl,--no-whole-archive -lc ) || exit 1; \
|
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
|
||||||
rm -f lib$$i.a; make -C $$i clean || exit 1 ;\
|
LIBDEPS="$$libs $(EX_LIBS)" \
|
||||||
done;
|
link_a.$(SHLIB_TARGET); \
|
||||||
@set -x; \
|
libs="$$libs -l$$i"; \
|
||||||
for i in ${SHLIBDIRS}; do \
|
done
|
||||||
ln -s lib$$i.so.${MAJOR}.${MINOR} lib$$i.so.${MAJOR}; \
|
|
||||||
ln -s lib$$i.so.${MAJOR} lib$$i.so; \
|
openssl.pc:
|
||||||
done;
|
@ ( echo 'prefix=$(INSTALLTOP)'; \
|
||||||
|
echo 'exec_prefix=$${prefix}'; \
|
||||||
|
echo 'libdir=$${exec_prefix}/lib'; \
|
||||||
|
echo 'includedir=$${prefix}/include'; \
|
||||||
|
echo ''; \
|
||||||
|
echo 'Name: OpenSSL'; \
|
||||||
|
echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
|
||||||
|
echo 'Version: '$(VERSION); \
|
||||||
|
echo 'Requires: '; \
|
||||||
|
echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
|
||||||
|
echo 'Cflags: -I$${includedir}' ) > openssl.pc
|
||||||
|
|
||||||
Makefile.ssl: Makefile.org
|
Makefile.ssl: Makefile.org
|
||||||
@echo "Makefile.ssl is older than Makefile.org."
|
@echo "Makefile.ssl is older than Makefile.org."
|
||||||
@@ -214,16 +297,19 @@ Makefile.ssl: Makefile.org
|
|||||||
@false
|
@false
|
||||||
|
|
||||||
libclean:
|
libclean:
|
||||||
rm -f *.a */lib */*/lib
|
rm -f *.so *.so.* engines/*.so *.a */lib */*/lib
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
|
rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
|
||||||
@for i in $(DIRS) ;\
|
@for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making clean in $$i..." && \
|
(cd $$i && echo "making clean in $$i..." && \
|
||||||
$(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
|
$(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
|
||||||
rm -f $(LIBS); \
|
rm -f $(LIBS); \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
rm -f openssl.pc
|
||||||
rm -f *.a *.o speed.* *.map *.so .pure core
|
rm -f *.a *.o speed.* *.map *.so .pure core
|
||||||
rm -f $(TARFILE)
|
rm -f $(TARFILE)
|
||||||
@for i in $(ONEDIRS) ;\
|
@for i in $(ONEDIRS) ;\
|
||||||
@@ -239,8 +325,10 @@ files:
|
|||||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
|
$(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
|
||||||
@for i in $(DIRS) ;\
|
@for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making 'files' in $$i..." && \
|
(cd $$i && echo "making 'files' in $$i..." && \
|
||||||
$(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
|
$(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
links:
|
links:
|
||||||
@@ -248,29 +336,47 @@ links:
|
|||||||
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
||||||
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
||||||
@for i in $(DIRS); do \
|
@for i in $(DIRS); do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making links in $$i..." && \
|
(cd $$i && echo "making links in $$i..." && \
|
||||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' links ) || exit 1; \
|
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
gentests:
|
||||||
|
@(cd test && echo "generating dummy tests (if needed)..." && \
|
||||||
|
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
|
||||||
|
|
||||||
dclean:
|
dclean:
|
||||||
rm -f *.bak
|
rm -f *.bak
|
||||||
@for i in $(DIRS) ;\
|
@for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making dclean in $$i..." && \
|
(cd $$i && echo "making dclean in $$i..." && \
|
||||||
$(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
|
$(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
rehash: rehash.time
|
rehash: rehash.time
|
||||||
rehash.time: certs
|
rehash.time: certs
|
||||||
@(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
|
@(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
|
||||||
|
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
||||||
|
LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
||||||
|
if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||||
|
elif [ "$(PLATFORM)" != "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
||||||
|
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
||||||
|
$(PERL) tools/c_rehash certs)
|
||||||
touch rehash.time
|
touch rehash.time
|
||||||
|
|
||||||
test: tests
|
test: tests
|
||||||
|
|
||||||
tests: rehash
|
tests: rehash
|
||||||
@(cd test && echo "testing..." && \
|
@(cd test && echo "testing..." && \
|
||||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' tests );
|
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
|
||||||
@apps/openssl version -a
|
@LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
||||||
|
if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||||
|
elif [ "$(PLATFORM)" != "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
||||||
|
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
||||||
|
apps/openssl version -a
|
||||||
|
|
||||||
report:
|
report:
|
||||||
@$(PERL) util/selftest.pl
|
@$(PERL) util/selftest.pl
|
||||||
@@ -278,56 +384,85 @@ report:
|
|||||||
depend:
|
depend:
|
||||||
@for i in $(DIRS) ;\
|
@for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making dependencies $$i..." && \
|
(cd $$i && echo "making dependencies $$i..." && \
|
||||||
$(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' depend ) || exit 1; \
|
$(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@for i in $(DIRS) ;\
|
@for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making lint $$i..." && \
|
(cd $$i && echo "making lint $$i..." && \
|
||||||
$(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
|
$(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
@for i in $(DIRS) ;\
|
@for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i && echo "making tags $$i..." && \
|
(cd $$i && echo "making tags $$i..." && \
|
||||||
$(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
|
$(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
errors:
|
errors:
|
||||||
perl util/mkerr.pl -recurse -write
|
$(PERL) util/mkerr.pl -recurse -write
|
||||||
|
(cd engines; $(MAKE) PERL=$(PERL) errors)
|
||||||
|
|
||||||
|
stacks:
|
||||||
|
$(PERL) util/mkstack.pl -write
|
||||||
|
|
||||||
util/libeay.num::
|
util/libeay.num::
|
||||||
perl util/mkdef.pl crypto update
|
$(PERL) util/mkdef.pl crypto update
|
||||||
|
|
||||||
util/ssleay.num::
|
util/ssleay.num::
|
||||||
perl util/mkdef.pl ssl update
|
$(PERL) util/mkdef.pl ssl update
|
||||||
|
|
||||||
crypto/objects/obj_dat.h: crypto/objects/objects.h crypto/objects/obj_dat.pl
|
crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
|
||||||
perl crypto/objects/obj_dat.pl crypto/objects/objects.h crypto/objects/obj_dat.h
|
$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
|
||||||
|
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
|
||||||
|
$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
|
||||||
|
|
||||||
TABLE: Configure
|
TABLE: Configure
|
||||||
(echo 'Output of `Configure TABLE'"':"; \
|
(echo 'Output of `Configure TABLE'"':"; \
|
||||||
perl Configure TABLE) > TABLE
|
$(PERL) Configure TABLE) > TABLE
|
||||||
|
|
||||||
update: depend errors util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
|
update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
|
||||||
|
|
||||||
|
# Build distribution tar-file. As the list of files returned by "find" is
|
||||||
|
# pretty long, on several platforms a "too many arguments" error or similar
|
||||||
|
# would occur. Therefore the list of files is temporarily stored into a file
|
||||||
|
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
|
||||||
|
# tar does not support the --files-from option.
|
||||||
tar:
|
tar:
|
||||||
@$(TAR) $(TARFLAGS) -cvf - \
|
find . -type d -print | xargs chmod 755
|
||||||
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort` |\
|
find . -type f -print | xargs chmod a+r
|
||||||
|
find . -type f -perm -0100 -print | xargs chmod a+x
|
||||||
|
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
|
||||||
|
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
|
||||||
tardy --user_number=0 --user_name=openssl \
|
tardy --user_number=0 --user_name=openssl \
|
||||||
--group_number=0 --group_name=openssl \
|
--group_number=0 --group_name=openssl \
|
||||||
--prefix=openssl-$(VERSION) - |\
|
--prefix=openssl-$(VERSION) - |\
|
||||||
gzip --best >../$(TARFILE).gz; \
|
gzip --best >../$(TARFILE).gz; \
|
||||||
|
rm -f ../$(TARFILE).list; \
|
||||||
ls -l ../$(TARFILE).gz
|
ls -l ../$(TARFILE).gz
|
||||||
|
|
||||||
|
tar-snap:
|
||||||
|
@$(TAR) $(TARFLAGS) -cvf - \
|
||||||
|
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
|
||||||
|
tardy --user_number=0 --user_name=openssl \
|
||||||
|
--group_number=0 --group_name=openssl \
|
||||||
|
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
|
||||||
|
ls -l ../$(TARFILE)
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
$(PERL) Configure dist
|
$(PERL) Configure dist
|
||||||
@$(MAKE) dist_pem_h
|
@$(MAKE) dist_pem_h
|
||||||
@$(MAKE) SDIRS='${SDIRS}' clean
|
@$(MAKE) SDIRS='${SDIRS}' clean
|
||||||
@$(MAKE) tar
|
@$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
|
||||||
|
|
||||||
dist_pem_h:
|
dist_pem_h:
|
||||||
(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
|
(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
|
||||||
@@ -335,7 +470,9 @@ dist_pem_h:
|
|||||||
install: all install_docs
|
install: all install_docs
|
||||||
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
|
||||||
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \
|
$(INSTALL_PREFIX)$(INSTALLTOP)/lib \
|
||||||
|
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo \
|
||||||
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
|
$(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
|
||||||
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/engines \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
|
||||||
$(INSTALL_PREFIX)$(OPENSSLDIR)/private \
|
$(INSTALL_PREFIX)$(OPENSSLDIR)/private \
|
||||||
@@ -347,16 +484,47 @@ install: all install_docs
|
|||||||
done;
|
done;
|
||||||
@for i in $(DIRS) ;\
|
@for i in $(DIRS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -d "$$i" ]; then \
|
||||||
(cd $$i; echo "installing $$i..."; \
|
(cd $$i; echo "installing $$i..."; \
|
||||||
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' install ); \
|
$(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' install ); \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
@for i in $(LIBS) ;\
|
@for i in $(LIBS) ;\
|
||||||
do \
|
do \
|
||||||
|
if [ -f "$$i" ]; then \
|
||||||
( echo installing $$i; \
|
( echo installing $$i; \
|
||||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
done
|
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
@if [ -n "$(SHARED_LIBS)" ]; then \
|
||||||
|
tmp="$(SHARED_LIBS)"; \
|
||||||
|
for i in $${tmp:-x}; \
|
||||||
|
do \
|
||||||
|
if [ -f "$$i" -o -f "$$i.a" ]; then \
|
||||||
|
( echo installing $$i; \
|
||||||
|
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||||
|
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
|
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||||
|
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||||
|
else \
|
||||||
|
c=`echo $$i | sed 's/^lib/cyg/'`; \
|
||||||
|
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||||
|
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||||
|
mv $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||||
|
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
||||||
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
||||||
|
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||||
|
fi ); \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
( here="`pwd`"; \
|
||||||
|
cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
|
||||||
|
$(NEWMAKE) -f $$here/Makefile link-shared ); \
|
||||||
|
fi
|
||||||
|
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo
|
||||||
|
|
||||||
install_docs:
|
install_docs:
|
||||||
@$(PERL) $(TOP)/util/mkdir-p.pl \
|
@$(PERL) $(TOP)/util/mkdir-p.pl \
|
||||||
@@ -364,30 +532,34 @@ install_docs:
|
|||||||
$(INSTALL_PREFIX)$(MANDIR)/man3 \
|
$(INSTALL_PREFIX)$(MANDIR)/man3 \
|
||||||
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
||||||
$(INSTALL_PREFIX)$(MANDIR)/man7
|
$(INSTALL_PREFIX)$(MANDIR)/man7
|
||||||
@echo installing man 1 and man 5
|
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
|
||||||
@for i in doc/apps/*.pod; do \
|
for i in doc/apps/*.pod; do \
|
||||||
fn=`basename $$i .pod`; \
|
fn=`basename $$i .pod`; \
|
||||||
sec=`[ "$$fn" = "config" ] && echo 5 || echo 1`; \
|
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
|
||||||
(cd `dirname $$i`; \
|
echo "installing man$$sec/$$fn.$$sec"; \
|
||||||
$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
|
(cd `$(PERL) util/dirname.pl $$i`; \
|
||||||
--release=$(VERSION) `basename $$i`) \
|
sh -c "$$pod2man \
|
||||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
|
--section=$$sec --center=OpenSSL \
|
||||||
done
|
--release=$(VERSION) `basename $$i`") \
|
||||||
@echo installing man 3 and man 7
|
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
|
||||||
@for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
$(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
|
||||||
|
while read n; do \
|
||||||
|
util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
|
||||||
|
done; \
|
||||||
|
done; \
|
||||||
|
for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
||||||
fn=`basename $$i .pod`; \
|
fn=`basename $$i .pod`; \
|
||||||
sec=`[ "$$fn" = "des_modes" ] && echo 7 || echo 3`; \
|
if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
|
||||||
(cd `dirname $$i`; \
|
echo "installing man$$sec/$$fn.$$sec"; \
|
||||||
$(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \
|
(cd `$(PERL) util/dirname.pl $$i`; \
|
||||||
--release=$(VERSION) `basename $$i`) \
|
sh -c "$$pod2man \
|
||||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
|
--section=$$sec --center=OpenSSL \
|
||||||
|
--release=$(VERSION) `basename $$i`") \
|
||||||
|
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
|
||||||
|
$(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
|
||||||
|
while read n; do \
|
||||||
|
util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
|
||||||
|
done; \
|
||||||
done
|
done
|
||||||
|
|
||||||
shlib: all
|
|
||||||
if [ ! -d shlib_dir ] ; then mkdir shlib_dir ; else rm -f shlib_dir/* ; fi
|
|
||||||
cd shlib_dir ; ar -x ../libcrypto.a && $(CC) -shared ./*.o -Wl,-soname -Wl,libcrypto.so.0.9 \
|
|
||||||
-o ./libcrypto.so.0.9.4 && rm *.o
|
|
||||||
cd shlib_dir ; ar -x ../libssl.a && $(CC) -shared ./*.o -Wl,-soname -Wl,libssl.so.0.9 \
|
|
||||||
-o ./libssl.so.0.9.4 && rm *.o
|
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|||||||
584
Makefile.shared
Normal file
584
Makefile.shared
Normal file
@@ -0,0 +1,584 @@
|
|||||||
|
#
|
||||||
|
# Helper makefile to link shared libraries in a portable way.
|
||||||
|
# This is much simpler than libtool, and hopefully not too error-prone.
|
||||||
|
#
|
||||||
|
# The following variables need to be set on the command line to build
|
||||||
|
# properly
|
||||||
|
|
||||||
|
# CC contains the current compiler. This one MUST be defined
|
||||||
|
CC=cc
|
||||||
|
# LDFLAGS contains flags to be used when the temporary object file is
|
||||||
|
# created. SHARED_LDFLAGS contains flags to be used when the shared
|
||||||
|
# library is created.
|
||||||
|
LDFLAGS=
|
||||||
|
SHARED_LDFLAGS=
|
||||||
|
|
||||||
|
# LIBNAME contains just the name of thhe library, without prefix ("lib"
|
||||||
|
# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
|
||||||
|
# .dll, ...). This one MUST have a value when using this makefile.
|
||||||
|
# For example, to build libfoo.so, you need to do the following:
|
||||||
|
#LIBNAME=foo
|
||||||
|
LIBNAME=
|
||||||
|
|
||||||
|
# LIBEXTRAS contains extra modules to link together with the library.
|
||||||
|
# For example, if a second library, say libbar.a needs to be linked into
|
||||||
|
# libfoo.so, you need to do the following:
|
||||||
|
#LIBEXTRAS=libbar.a
|
||||||
|
# Note that this MUST be used when using the link_o targets, to hold the
|
||||||
|
# names of all object files that go into the target library.
|
||||||
|
LIBEXTRAS=
|
||||||
|
|
||||||
|
# LIBVERSION contains the current version of the library.
|
||||||
|
# For example, to build libfoo.so.1.2, you need to do the following:
|
||||||
|
#LIBVERSION=1.2
|
||||||
|
LIBVERSION=
|
||||||
|
|
||||||
|
# LIBCOMPATVERSIONS contains the compatibility versions (a list) of
|
||||||
|
# the library. They MUST be in decreasing order.
|
||||||
|
# For example, if libfoo.so.1.2.1 is backward compatible with libfoo.so.1.2
|
||||||
|
# and libfoo.so.1, you need to do the following:
|
||||||
|
#LIBCOMPATVERSIONS=1.2 1
|
||||||
|
# Note that on systems that use sonames, the last number will appear as
|
||||||
|
# part of it.
|
||||||
|
# It's also possible, for systems that support it (Tru64, for example),
|
||||||
|
# to add extra compatibility info with more precision, by adding a second
|
||||||
|
# list of versions, separated from the first with a semicolon, like this:
|
||||||
|
#LIBCOMPATVERSIONS=1.2 1;1.2.0 1.1.2 1.1.1 1.1.0 1.0.0
|
||||||
|
LIBCOMPATVERSIONS=
|
||||||
|
|
||||||
|
# LIBDEPS contains all the flags necessary to cover all necessary
|
||||||
|
# dependencies to other libraries.
|
||||||
|
LIBDEPS=
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# The rest is private to this makefile.
|
||||||
|
|
||||||
|
#DEBUG=:
|
||||||
|
DEBUG=set -x
|
||||||
|
|
||||||
|
top:
|
||||||
|
echo "Trying to use this makefile interactively? Don't."
|
||||||
|
|
||||||
|
CALC_VERSIONS= \
|
||||||
|
SHLIB_COMPAT=; SHLIB_SOVER=; \
|
||||||
|
if [ -n "$(LIBVERSION)$(LIBCOMPATVERSIONS)" ]; then \
|
||||||
|
prev=""; \
|
||||||
|
for v in `echo "$(LIBVERSION) $(LIBCOMPATVERSIONS)" | cut -d';' -f1`; do \
|
||||||
|
SHLIB_SOVER_NODOT=$$v \
|
||||||
|
SHLIB_SOVER=.$$v; \
|
||||||
|
if [ -n "$$prev" ]; then \
|
||||||
|
SHLIB_COMPAT="$$SHLIB_COMPAT .$$prev"; \
|
||||||
|
fi; \
|
||||||
|
prev=$$v; \
|
||||||
|
done; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
LINK_SO= \
|
||||||
|
( $(DEBUG); \
|
||||||
|
nm -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \
|
||||||
|
$$SHAREDCMD $(SHARED_LDFLAGS) $$SHAREDFLAGS -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
|
||||||
|
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS ) && \
|
||||||
|
$(SYMLINK_SO); ( $(DEBUG); rm -f lib$(LIBNAME).exp )
|
||||||
|
SYMLINK_SO= \
|
||||||
|
if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
|
||||||
|
prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
|
||||||
|
if [ -n "$$SHLIB_COMPAT" ]; then \
|
||||||
|
for x in $$SHLIB_COMPAT; do \
|
||||||
|
( $(DEBUG); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
|
||||||
|
ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
|
||||||
|
prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
|
||||||
|
done; \
|
||||||
|
fi; \
|
||||||
|
if [ -n "$$SHLIB_SOVER" ]; then \
|
||||||
|
( $(DEBUG); rm -f $$SHLIB$$SHLIB_SUFFIX; \
|
||||||
|
ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
|
||||||
|
fi; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
LINK_SO_A= SHOBJECTS="lib$(LIBNAME).a $(LIBEXTRAS)"; $(LINK_SO)
|
||||||
|
LINK_SO_O= SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
|
||||||
|
LINK_SO_A_VIA_O= \
|
||||||
|
SHOBJECTS=lib$(LIBNAME).o ALL=$$ALLSYMSFLAGS ALLSYMSFLAGS= NOALLSYMSFLAGS=; \
|
||||||
|
( $(DEBUG); \
|
||||||
|
ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
|
||||||
|
$(LINK_SO) && rm -f $(LIBNAME).o
|
||||||
|
LINK_SO_A_UNPACKED= \
|
||||||
|
UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
|
||||||
|
(cd $$UNPACKDIR; ar x ../lib$(LIBNAME).a) && cp $(LIBEXTRAS) $$UNPACKDIR && \
|
||||||
|
SHOBJECTS=$$UNPACKDIR/*.o; \
|
||||||
|
$(LINK_SO) && rm -rf $$UNPACKDIR
|
||||||
|
|
||||||
|
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
|
||||||
|
my_ld=`${CC} -print-prog-name=ld 2>&1` && \
|
||||||
|
[ -n "$$my_ld" ] && \
|
||||||
|
$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
|
||||||
|
DO_GNU=$(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-Wl,--whole-archive' \
|
||||||
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
|
||||||
|
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX" \
|
||||||
|
SHAREDCMD='$(CC)'
|
||||||
|
|
||||||
|
link_o.gnu:
|
||||||
|
@ $(DO_GNU); $(LINK_SO_O)
|
||||||
|
link_a.gnu:
|
||||||
|
@ $(DO_GNU); $(LINK_SO_A)
|
||||||
|
|
||||||
|
# For Darwin AKA Mac OS/X (dyld)
|
||||||
|
link_o.darwin:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME) \
|
||||||
|
SHLIB_SUFFIX=.dylib \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-all_load' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS="-dynamiclib" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$(LIBVERSION)" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
||||||
|
fi; \
|
||||||
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.darwin:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME) \
|
||||||
|
SHLIB_SUFFIX=.dylib \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-all_load' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS="-dynamiclib" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$(LIBVERSION)" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -current_version $(LIBVERSION)"; \
|
||||||
|
fi; \
|
||||||
|
if [ -n "$$SHLIB_SOVER_NODOT" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -compatibility_version $$SHLIB_SOVER_NODOT"; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A)
|
||||||
|
|
||||||
|
link_o.cygwin:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
INHIBIT_SYMLINKS=yes; \
|
||||||
|
SHLIB=cyg$(LIBNAME) \
|
||||||
|
SHLIB_SUFFIX=.dll \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_SOVER=-$(LIBVERSION) \
|
||||||
|
ALLSYMSFLAGS='-Wl,--whole-archive' \
|
||||||
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
|
||||||
|
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \
|
||||||
|
SHAREDCMD='${CC}'; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.cygwin:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
INHIBIT_SYMLINKS=yes; \
|
||||||
|
SHLIB=cyg$(LIBNAME) \
|
||||||
|
SHLIB_SUFFIX=.dll \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_SOVER= \
|
||||||
|
ALLSYMSFLAGS='-Wl,--whole-archive' \
|
||||||
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive' \
|
||||||
|
SHAREDFLAGS="-shared -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a" \
|
||||||
|
SHAREDCMD='${CC}'; \
|
||||||
|
$(LINK_SO_A)
|
||||||
|
|
||||||
|
link_o.alpha-osf1:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
|
else \
|
||||||
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
|
fi
|
||||||
|
SHLIB_SOVER= \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='-none' \
|
||||||
|
SHAREDFLAGS="-shared" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
|
fi; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.alpha-osf1:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
|
else \
|
||||||
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
|
fi
|
||||||
|
SHLIB_SOVER= \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='-none' \
|
||||||
|
SHAREDFLAGS="-shared" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
|
fi; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A)
|
||||||
|
|
||||||
|
# The difference between alpha-osf1-shared and tru64-shared is the `-msym'
|
||||||
|
# option passed to the linker.
|
||||||
|
link_o.tru64:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
|
else \
|
||||||
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
|
fi
|
||||||
|
SHLIB_SOVER= \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='-none' \
|
||||||
|
SHAREDFLAGS="-shared -msym" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
|
fi; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.tru64:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
|
else \
|
||||||
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
|
fi
|
||||||
|
SHLIB_SOVER= \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='-none' \
|
||||||
|
SHAREDFLAGS="-shared -msym" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
|
fi; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A)
|
||||||
|
|
||||||
|
# The difference between tru64-shared and tru64-shared-rpath is the
|
||||||
|
# -rpath ${LIBRPATH} passed to the linker.
|
||||||
|
link_o.tru64-rpath:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
|
else \
|
||||||
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
|
fi
|
||||||
|
SHLIB_SOVER= \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='-none' \
|
||||||
|
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
|
fi; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.tru64-rpath:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
SHLIB_HIST=`echo "$(LIBCOMPATVERSIONS)" | cut -d';' -f2 | sed -e 's/ */:/'`; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHLIB_HIST="$${SHLIB_HIST}:$(LIBVERSION)"; \
|
||||||
|
else \
|
||||||
|
SHLIB_HIST="$(LIBVERSION)"; \
|
||||||
|
fi
|
||||||
|
SHLIB_SOVER= \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='-none' \
|
||||||
|
SHAREDFLAGS="-shared -msym -rpath $(LIBRPATH)" \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
if [ -n "$$SHLIB_HIST" ]; then \
|
||||||
|
SHAREDFLAGS="$SHAREDFLAGS -set_version \"$$SHLIB_HIST\""; \
|
||||||
|
fi; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A)
|
||||||
|
|
||||||
|
link_o.solaris:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
$(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-z allextract' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.solaris:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
$(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-z allextract' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A)
|
||||||
|
|
||||||
|
# OpenServer 5 native compilers used
|
||||||
|
# UnixWare 7 and OpenUNIX 8 native compilers used
|
||||||
|
link_o.svr3:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
$(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-z allextract' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.svr3:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
$(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-z allextract' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G -h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A_UNPACKED)
|
||||||
|
|
||||||
|
link_o.irix:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
$(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.irix:
|
||||||
|
@ if ${DETECT_GNU_LD}; then \
|
||||||
|
$(DO_GNU); \
|
||||||
|
else \
|
||||||
|
$(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-all' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-shared -Wl,-soname,$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
fi; \
|
||||||
|
$(LINK_SO_A)
|
||||||
|
|
||||||
|
# HP-UX includes the full pathname of libs we depend on, so we would get
|
||||||
|
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
||||||
|
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
|
||||||
|
# anyway.
|
||||||
|
# The object modules are loaded from lib$i.a using the undocumented -Fl
|
||||||
|
# option.
|
||||||
|
#
|
||||||
|
# WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
|
||||||
|
# by temporarily specifying "+s"!
|
||||||
|
#
|
||||||
|
link_o.hpux32:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).sl \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-Fl' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
|
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
|
link_a.hpux32:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).sl \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-Fl' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='+vnocompatwarnings -b -z +s +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
|
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
|
|
||||||
|
# HP-UX includes the full pathname of libs we depend on, so we would get
|
||||||
|
# ./libcrypto (with ./ as path information) compiled into libssl, hence
|
||||||
|
# we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
|
||||||
|
# anyway.
|
||||||
|
#
|
||||||
|
# HP-UX in 64bit mode has "+s" enabled by default; it will search for
|
||||||
|
# shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
|
||||||
|
#
|
||||||
|
link_o.hpux64:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).sl \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='+forceload' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
|
$(LINK_SO_O) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
|
link_a.hpux64:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).sl \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='+forceload' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-b -z +h $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX' \
|
||||||
|
SHAREDCMD='/usr/ccs/bin/ld'; \
|
||||||
|
$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
|
||||||
|
|
||||||
|
link_o.aix:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-bnogc' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.aix:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS='-bnogc' \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G -bE:lib$(LIBNAME).exp -bM:SRE' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
$(LINK_SO_A_VIA_O)
|
||||||
|
|
||||||
|
link_o.reliantunix:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS= \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
$(LINK_SO_O)
|
||||||
|
link_a.reliantunix:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so \
|
||||||
|
SHLIB_SUFFIX= \
|
||||||
|
LIBDEPS="$(LIBDEPS) -lc" \
|
||||||
|
ALLSYMSFLAGS= \
|
||||||
|
NOALLSYMSFLAGS='' \
|
||||||
|
SHAREDFLAGS='-G' \
|
||||||
|
SHAREDCMD='$(CC)'; \
|
||||||
|
$(LINK_SO_A_UNPACKED)
|
||||||
|
|
||||||
|
# Targets to build symbolic links when needed
|
||||||
|
symlink.gnu symlink.solaris symlink.svr3 symlink.irix \
|
||||||
|
symlink.aix symlink.reliantunix:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).so; \
|
||||||
|
$(SYMLINK_SO)
|
||||||
|
symlink.darwin:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME) \
|
||||||
|
SHLIB_SUFFIX=.dylib; \
|
||||||
|
$(SYMLINK_SO)
|
||||||
|
symlink.hpux32 symlink.hpux64:
|
||||||
|
@ $(CALC_VERSIONS); \
|
||||||
|
SHLIB=lib$(LIBNAME).sl; \
|
||||||
|
$(SYMLINK_SO)
|
||||||
|
# The following lines means those specific architectures do no symlinks
|
||||||
|
symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
|
||||||
|
|
||||||
|
# Compatibility targets
|
||||||
|
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
|
||||||
|
link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
|
||||||
|
symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
|
||||||
|
link_o.darwin-shared: link_o.darwin
|
||||||
|
link_a.darwin-shared: link_a.darwin
|
||||||
|
symlink.darwin-shared: symlink.darwin
|
||||||
|
link_o.cygwin-shared: link_o.cygwin
|
||||||
|
link_a.cygwin-shared: link_a.cygwin
|
||||||
|
symlink.cygwin-shared: symlink.cygwin
|
||||||
|
link_o.alpha-osf1-shared: link_o.alpha-osf1
|
||||||
|
link_a.alpha-osf1-shared: link_a.alpha-osf1
|
||||||
|
symlink.alpha-osf1-shared: symlink.alpha-osf1
|
||||||
|
link_o.tru64-shared: link_o.tru64
|
||||||
|
link_a.tru64-shared: link_a.tru64
|
||||||
|
symlink.tru64-shared: symlink.tru64
|
||||||
|
link_o.tru64-shared-rpath: link_o.tru64-rpath
|
||||||
|
link_a.tru64-shared-rpath: link_a.tru64-rpath
|
||||||
|
symlink.tru64-shared-rpath: symlink.tru64-rpath
|
||||||
|
link_o.solaris-shared: link_o.solaris
|
||||||
|
link_a.solaris-shared: link_a.solaris
|
||||||
|
symlink.solaris-shared: symlink.solaris
|
||||||
|
link_o.svr3-shared: link_o.svr3
|
||||||
|
link_a.svr3-shared: link_a.svr3
|
||||||
|
symlink.svr3-shared: symlink.svr3
|
||||||
|
link_o.svr5-shared: link_o.svr3
|
||||||
|
link_a.svr5-shared: link_a.svr3
|
||||||
|
symlink.svr5-shared: symlink.svr3
|
||||||
|
link_o.irix-shared: link_o.irix
|
||||||
|
link_a.irix-shared: link_a.irix
|
||||||
|
symlink.irix-shared: symlink.irix
|
||||||
|
link_o.hpux-shared: link_o.hpux32
|
||||||
|
link_a.hpux-shared: link_a.hpux32
|
||||||
|
symlink.hpux-shared: symlink.hpux32
|
||||||
|
link_o.hpux64-shared: link_o.hpux64
|
||||||
|
link_a.hpux64-shared: link_a.hpux64
|
||||||
|
symlink.hpux64-shared: symlink.hpux64
|
||||||
|
link_o.aix-shared: link_o.aix
|
||||||
|
link_a.aix-shared: link_a.aix
|
||||||
|
symlink.aix-shared: symlink.aix
|
||||||
|
link_o.reliantunix-shared: link_o.reliantunix
|
||||||
|
link_a.reliantunix-shared: link_a.reliantunix
|
||||||
|
symlink.reliantunix-shared: symlink.reliantunix
|
||||||
145
NEWS
145
NEWS
@@ -5,6 +5,151 @@
|
|||||||
This file gives a brief overview of the major changes between each OpenSSL
|
This file gives a brief overview of the major changes between each OpenSSL
|
||||||
release. For more details please read the CHANGES file.
|
release. For more details please read the CHANGES file.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7:
|
||||||
|
|
||||||
|
o New library section OCSP.
|
||||||
|
o Complete rewrite of ASN1 code.
|
||||||
|
o CRL checking in verify code and openssl utility.
|
||||||
|
o Extension copying in 'ca' utility.
|
||||||
|
o Flexible display options in 'ca' utility.
|
||||||
|
o Provisional support for international characters with UTF8.
|
||||||
|
o Support for external crypto devices ('engine') is no longer
|
||||||
|
a separate distribution.
|
||||||
|
o New elliptic curve library section.
|
||||||
|
o New AES (Rijndael) library section.
|
||||||
|
o Support for new platforms: Windows CE, Tandem OSS, A/UX, AIX 64-bit,
|
||||||
|
Linux x86_64
|
||||||
|
o Extended support for some platforms: VxWorks
|
||||||
|
o Enhanced support for shared libraries.
|
||||||
|
o Support for pkg-config.
|
||||||
|
o Lots of new manuals.
|
||||||
|
o Change DES API to clean up the namespace (some applications link also
|
||||||
|
against libdes providing similar functions having the same name).
|
||||||
|
Provide macros for backward compatibility (will be removed in the
|
||||||
|
future).
|
||||||
|
o Unify handling of cryptographic algorithms (software and engine)
|
||||||
|
to be available via EVP routines for asymmetric and symmetric ciphers.
|
||||||
|
o NCONF: new configuration handling routines.
|
||||||
|
o Change API to use more 'const' modifiers to improve error checking
|
||||||
|
and help optimizers.
|
||||||
|
o Finally remove references to RSAref.
|
||||||
|
o Reworked parts of the BIGNUM code.
|
||||||
|
o Support for new engines: Broadcom ubsec, Accelerated Encryption
|
||||||
|
Processing, IBM 4758.
|
||||||
|
o A few new engines added in the demos area.
|
||||||
|
o Extended and corrected OID (object identifier) table.
|
||||||
|
o PRNG: query at more locations for a random device, automatic query for
|
||||||
|
EGD style random sources at several locations.
|
||||||
|
o SSL/TLS: allow optional cipher choice according to server's preference.
|
||||||
|
o SSL/TLS: allow server to explicitly set new session ids.
|
||||||
|
o SSL/TLS: support Kerberos cipher suites (RFC2712).
|
||||||
|
Only supports MIT Kerberos for now.
|
||||||
|
o SSL/TLS: allow more precise control of renegotiations and sessions.
|
||||||
|
o SSL/TLS: add callback to retrieve SSL/TLS messages.
|
||||||
|
o SSL/TLS: support AES cipher suites (RFC3268).
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h:
|
||||||
|
|
||||||
|
o New configuration targets for Tandem OSS and A/UX.
|
||||||
|
o New OIDs for Microsoft attributes.
|
||||||
|
o Better handling of SSL session caching.
|
||||||
|
o Better comparison of distinguished names.
|
||||||
|
o Better handling of shared libraries in a mixed GNU/non-GNU environment.
|
||||||
|
o Support assembler code with Borland C.
|
||||||
|
o Fixes for length problems.
|
||||||
|
o Fixes for uninitialised variables.
|
||||||
|
o Fixes for memory leaks, some unusual crashes and some race conditions.
|
||||||
|
o Fixes for smaller building problems.
|
||||||
|
o Updates of manuals, FAQ and other instructive documents.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g:
|
||||||
|
|
||||||
|
o Important building fixes on Unix.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f:
|
||||||
|
|
||||||
|
o Various important bugfixes.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e:
|
||||||
|
|
||||||
|
o Important security related bugfixes.
|
||||||
|
o Various SSL/TLS library bugfixes.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d:
|
||||||
|
|
||||||
|
o Various SSL/TLS library bugfixes.
|
||||||
|
o Fix DH parameter generation for 'non-standard' generators.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c:
|
||||||
|
|
||||||
|
o Various SSL/TLS library bugfixes.
|
||||||
|
o BIGNUM library fixes.
|
||||||
|
o RSA OAEP and random number generation fixes.
|
||||||
|
o Object identifiers corrected and added.
|
||||||
|
o Add assembler BN routines for IA64.
|
||||||
|
o Add support for OS/390 Unix, UnixWare with gcc, OpenUNIX 8,
|
||||||
|
MIPS Linux; shared library support for Irix, HP-UX.
|
||||||
|
o Add crypto accelerator support for AEP, Baltimore SureWare,
|
||||||
|
Broadcom and Cryptographic Appliance's keyserver
|
||||||
|
[in 0.9.6c-engine release].
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b:
|
||||||
|
|
||||||
|
o Security fix: PRNG improvements.
|
||||||
|
o Security fix: RSA OAEP check.
|
||||||
|
o Security fix: Reinsert and fix countermeasure to Bleichbacher's
|
||||||
|
attack.
|
||||||
|
o MIPS bug fix in BIGNUM.
|
||||||
|
o Bug fix in "openssl enc".
|
||||||
|
o Bug fix in X.509 printing routine.
|
||||||
|
o Bug fix in DSA verification routine and DSA S/MIME verification.
|
||||||
|
o Bug fix to make PRNG thread-safe.
|
||||||
|
o Bug fix in RAND_file_name().
|
||||||
|
o Bug fix in compatibility mode trust settings.
|
||||||
|
o Bug fix in blowfish EVP.
|
||||||
|
o Increase default size for BIO buffering filter.
|
||||||
|
o Compatibility fixes in some scripts.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a:
|
||||||
|
|
||||||
|
o Security fix: change behavior of OpenSSL to avoid using
|
||||||
|
environment variables when running as root.
|
||||||
|
o Security fix: check the result of RSA-CRT to reduce the
|
||||||
|
possibility of deducing the private key from an incorrectly
|
||||||
|
calculated signature.
|
||||||
|
o Security fix: prevent Bleichenbacher's DSA attack.
|
||||||
|
o Security fix: Zero the premaster secret after deriving the
|
||||||
|
master secret in DH ciphersuites.
|
||||||
|
o Reimplement SSL_peek(), which had various problems.
|
||||||
|
o Compatibility fix: the function des_encrypt() renamed to
|
||||||
|
des_encrypt1() to avoid clashes with some Unixen libc.
|
||||||
|
o Bug fixes for Win32, HP/UX and Irix.
|
||||||
|
o Bug fixes in BIGNUM, SSL, PKCS#7, PKCS#12, X.509, CONF and
|
||||||
|
memory checking routines.
|
||||||
|
o Bug fixes for RSA operations in threaded environments.
|
||||||
|
o Bug fixes in misc. openssl applications.
|
||||||
|
o Remove a few potential memory leaks.
|
||||||
|
o Add tighter checks of BIGNUM routines.
|
||||||
|
o Shared library support has been reworked for generality.
|
||||||
|
o More documentation.
|
||||||
|
o New function BN_rand_range().
|
||||||
|
o Add "-rand" option to openssl s_client and s_server.
|
||||||
|
|
||||||
|
Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6:
|
||||||
|
|
||||||
|
o Some documentation for BIO and SSL libraries.
|
||||||
|
o Enhanced chain verification using key identifiers.
|
||||||
|
o New sign and verify options to 'dgst' application.
|
||||||
|
o Support for DER and PEM encoded messages in 'smime' application.
|
||||||
|
o New 'rsautl' application, low level RSA utility.
|
||||||
|
o MD4 now included.
|
||||||
|
o Bugfix for SSL rollback padding check.
|
||||||
|
o Support for external crypto devices [1].
|
||||||
|
o Enhanced EVP interface.
|
||||||
|
|
||||||
|
[1] The support for external crypto devices is currently a separate
|
||||||
|
distribution. See the file README.ENGINE.
|
||||||
|
|
||||||
Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a:
|
Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a:
|
||||||
|
|
||||||
o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8
|
o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8
|
||||||
|
|||||||
64
PROBLEMS
Normal file
64
PROBLEMS
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
* System libcrypto.dylib and libssl.dylib are used by system ld on MacOS X.
|
||||||
|
|
||||||
|
|
||||||
|
NOTE: The problem described here only applies when OpenSSL isn't built
|
||||||
|
with shared library support (i.e. without the "shared" configuration
|
||||||
|
option). If you build with shared library support, you will have no
|
||||||
|
problems as long as you set up DYLD_LIBRARY_PATH properly at all times.
|
||||||
|
|
||||||
|
|
||||||
|
This is really a misfeature in ld, which seems to look for .dylib libraries
|
||||||
|
along the whole library path before it bothers looking for .a libraries. This
|
||||||
|
means that -L switches won't matter unless OpenSSL is built with shared
|
||||||
|
library support.
|
||||||
|
|
||||||
|
The workaround may be to change the following lines in apps/Makefile.ssl and
|
||||||
|
test/Makefile.ssl:
|
||||||
|
|
||||||
|
LIBCRYPTO=-L.. -lcrypto
|
||||||
|
LIBSSL=-L.. -lssl
|
||||||
|
|
||||||
|
to:
|
||||||
|
|
||||||
|
LIBCRYPTO=../libcrypto.a
|
||||||
|
LIBSSL=../libssl.a
|
||||||
|
|
||||||
|
It's possible that something similar is needed for shared library support
|
||||||
|
as well. That hasn't been well tested yet.
|
||||||
|
|
||||||
|
|
||||||
|
Another solution that many seem to recommend is to move the libraries
|
||||||
|
/usr/lib/libcrypto.0.9.dylib, /usr/lib/libssl.0.9.dylib to a different
|
||||||
|
directory, build and install OpenSSL and anything that depends on your
|
||||||
|
build, then move libcrypto.0.9.dylib and libssl.0.9.dylib back to their
|
||||||
|
original places. Note that the version numbers on those two libraries
|
||||||
|
may differ on your machine.
|
||||||
|
|
||||||
|
|
||||||
|
As long as Apple doesn't fix the problem with ld, this problem building
|
||||||
|
OpenSSL will remain as is.
|
||||||
|
|
||||||
|
|
||||||
|
* Parallell make leads to errors
|
||||||
|
|
||||||
|
While running tests, running a parallell make is a bad idea. Many test
|
||||||
|
scripts use the same name for output and input files, which means different
|
||||||
|
will interfere with each other and lead to test failure.
|
||||||
|
|
||||||
|
The solution is simple for now: don't run parallell make when testing.
|
||||||
|
|
||||||
|
|
||||||
|
* Bugs in gcc 3.0 triggered
|
||||||
|
|
||||||
|
According to a problem report, there are bugs in gcc 3.0 that are
|
||||||
|
triggered by some of the code in OpenSSL, more specifically in
|
||||||
|
PEM_get_EVP_CIPHER_INFO(). The triggering code is the following:
|
||||||
|
|
||||||
|
header+=11;
|
||||||
|
if (*header != '4') return(0); header++;
|
||||||
|
if (*header != ',') return(0); header++;
|
||||||
|
|
||||||
|
What happens is that gcc might optimize a little too agressively, and
|
||||||
|
you end up with an extra incrementation when *header != '4'.
|
||||||
|
|
||||||
|
We recommend that you upgrade gcc to as high a 3.x version as you can.
|
||||||
50
README
50
README
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
OpenSSL 0.9.5a 1 Apr 2000
|
OpenSSL 0.9.8-dev XX xxx XXXX
|
||||||
|
|
||||||
Copyright (c) 1998-2000 The OpenSSL Project
|
Copyright (c) 1998-2002 The OpenSSL Project
|
||||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
X.509v3 certificates
|
X.509v3 certificates
|
||||||
X509 encoding/decoding into/from binary ASN1 and a PEM
|
X509 encoding/decoding into/from binary ASN1 and a PEM
|
||||||
based ascii-binary encoding which supports encryption with a
|
based ASCII-binary encoding which supports encryption with a
|
||||||
private key. Program to generate RSA and DSA certificate
|
private key. Program to generate RSA and DSA certificate
|
||||||
requests and to generate RSA and DSA certificates.
|
requests and to generate RSA and DSA certificates.
|
||||||
|
|
||||||
@@ -97,19 +97,18 @@
|
|||||||
locations around the world. _YOU_ are responsible for ensuring that your use
|
locations around the world. _YOU_ are responsible for ensuring that your use
|
||||||
of any algorithms is legal by checking if there are any patents in your
|
of any algorithms is legal by checking if there are any patents in your
|
||||||
country. The file contains some of the patents that we know about or are
|
country. The file contains some of the patents that we know about or are
|
||||||
rumoured to exist. This is not a definitive list.
|
rumored to exist. This is not a definitive list.
|
||||||
|
|
||||||
RSA Data Security holds software patents on the RSA and RC5 algorithms. If
|
RSA Security holds software patents on the RC5 algorithm. If you
|
||||||
their ciphers are used used inside the USA (and Japan?), you must contact RSA
|
intend to use this cipher, you must contact RSA Security for
|
||||||
Data Security for licensing conditions. Their web page is
|
licensing conditions. Their web page is http://www.rsasecurity.com/.
|
||||||
http://www.rsa.com/.
|
|
||||||
|
|
||||||
RC4 is a trademark of RSA Data Security, so use of this label should perhaps
|
RC4 is a trademark of RSA Security, so use of this label should perhaps
|
||||||
only be used with RSA Data Security's permission.
|
only be used with RSA Security's permission.
|
||||||
|
|
||||||
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
|
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
|
||||||
Japan, Netherlands, Spain, Sweden, Switzerland, UK and the USA. They should
|
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They
|
||||||
be contacted if that algorithm is to be used, their web page is
|
should be contacted if that algorithm is to be used; their web page is
|
||||||
http://www.ascom.ch/.
|
http://www.ascom.ch/.
|
||||||
|
|
||||||
INSTALLATION
|
INSTALLATION
|
||||||
@@ -119,12 +118,16 @@
|
|||||||
a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read
|
a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read
|
||||||
INSTALL.VMS.
|
INSTALL.VMS.
|
||||||
|
|
||||||
For people in the USA, it is possible to compile OpenSSL to use RSA Inc.'s
|
|
||||||
public key library, RSAREF, by configuring OpenSSL with the option "rsaref".
|
|
||||||
|
|
||||||
Read the documentation in the doc/ directory. It is quite rough, but it
|
Read the documentation in the doc/ directory. It is quite rough, but it
|
||||||
lists the functions, you will probably have to look at the code to work out
|
lists the functions; you will probably have to look at the code to work out
|
||||||
how to used them. Look at the example programs.
|
how to use them. Look at the example programs.
|
||||||
|
|
||||||
|
PROBLEMS
|
||||||
|
--------
|
||||||
|
|
||||||
|
For some platforms, there are some known problems that may affect the user
|
||||||
|
or application author. We try to collect those in doc/PROBLEMS, with current
|
||||||
|
thoughts on how they should be solved in a future of OpenSSL.
|
||||||
|
|
||||||
SUPPORT
|
SUPPORT
|
||||||
-------
|
-------
|
||||||
@@ -150,11 +153,13 @@
|
|||||||
- Problem Description (steps that will reproduce the problem, if known)
|
- Problem Description (steps that will reproduce the problem, if known)
|
||||||
- Stack Traceback (if the application dumps core)
|
- Stack Traceback (if the application dumps core)
|
||||||
|
|
||||||
Report the bug to the OpenSSL project at:
|
Report the bug to the OpenSSL project via the Request Tracker
|
||||||
|
(http://www.openssl.org/rt2.html) by mail to:
|
||||||
|
|
||||||
openssl-bugs@openssl.org
|
openssl-bugs@openssl.org
|
||||||
|
|
||||||
Note that mail to openssl-bugs@openssl.org is forwarded to a public
|
Note that mail to openssl-bugs@openssl.org is recorded in the publicly
|
||||||
|
readable request tracker database and is forwarded to a public
|
||||||
mailing list. Confidential mail may be sent to openssl-security@openssl.org
|
mailing list. Confidential mail may be sent to openssl-security@openssl.org
|
||||||
(PGP key available from the key servers).
|
(PGP key available from the key servers).
|
||||||
|
|
||||||
@@ -167,6 +172,11 @@
|
|||||||
the string "[PATCH]" in the subject. Please be sure to include a
|
the string "[PATCH]" in the subject. Please be sure to include a
|
||||||
textual explanation of what your patch does.
|
textual explanation of what your patch does.
|
||||||
|
|
||||||
|
Note: For legal reasons, contributions from the US can be accepted only
|
||||||
|
if a TSA notification and a copy of the patch is sent to crypt@bis.doc.gov;
|
||||||
|
see http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
|
||||||
|
and http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e)).
|
||||||
|
|
||||||
The preferred format for changes is "diff -u" output. You might
|
The preferred format for changes is "diff -u" output. You might
|
||||||
generate it like this:
|
generate it like this:
|
||||||
|
|
||||||
@@ -174,4 +184,4 @@
|
|||||||
# [your changes]
|
# [your changes]
|
||||||
# ./Configure dist; make clean
|
# ./Configure dist; make clean
|
||||||
# cd ..
|
# cd ..
|
||||||
# diff -urN openssl-orig openssl-work > mydiffs.patch
|
# diff -ur openssl-orig openssl-work > mydiffs.patch
|
||||||
|
|||||||
187
README.ASN1
Normal file
187
README.ASN1
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
|
||||||
|
OpenSSL ASN1 Revision
|
||||||
|
=====================
|
||||||
|
|
||||||
|
This document describes some of the issues relating to the new ASN1 code.
|
||||||
|
|
||||||
|
Previous OpenSSL ASN1 problems
|
||||||
|
=============================
|
||||||
|
|
||||||
|
OK why did the OpenSSL ASN1 code need revising in the first place? Well
|
||||||
|
there are lots of reasons some of which are included below...
|
||||||
|
|
||||||
|
1. The code is difficult to read and write. For every single ASN1 structure
|
||||||
|
(e.g. SEQUENCE) four functions need to be written for new, free, encode and
|
||||||
|
decode operations. This is a very painful and error prone operation. Very few
|
||||||
|
people have ever written any OpenSSL ASN1 and those that have usually wish
|
||||||
|
they hadn't.
|
||||||
|
|
||||||
|
2. Partly because of 1. the code is bloated and takes up a disproportionate
|
||||||
|
amount of space. The SEQUENCE encoder is particularly bad: it essentially
|
||||||
|
contains two copies of the same operation, one to compute the SEQUENCE length
|
||||||
|
and the other to encode it.
|
||||||
|
|
||||||
|
3. The code is memory based: that is it expects to be able to read the whole
|
||||||
|
structure from memory. This is fine for small structures but if you have a
|
||||||
|
(say) 1Gb PKCS#7 signedData structure it isn't such a good idea...
|
||||||
|
|
||||||
|
4. The code for the ASN1 IMPLICIT tag is evil. It is handled by temporarily
|
||||||
|
changing the tag to the expected one, attempting to read it, then changing it
|
||||||
|
back again. This means that decode buffers have to be writable even though they
|
||||||
|
are ultimately unchanged. This gets in the way of constification.
|
||||||
|
|
||||||
|
5. The handling of EXPLICIT isn't much better. It adds a chunk of code into
|
||||||
|
the decoder and encoder for every EXPLICIT tag.
|
||||||
|
|
||||||
|
6. APPLICATION and PRIVATE tags aren't even supported at all.
|
||||||
|
|
||||||
|
7. Even IMPLICIT isn't complete: there is no support for implicitly tagged
|
||||||
|
types that are not OPTIONAL.
|
||||||
|
|
||||||
|
8. Much of the code assumes that a tag will fit in a single octet. This is
|
||||||
|
only true if the tag is 30 or less (mercifully tags over 30 are rare).
|
||||||
|
|
||||||
|
9. The ASN1 CHOICE type has to be largely handled manually, there aren't any
|
||||||
|
macros that properly support it.
|
||||||
|
|
||||||
|
10. Encoders have no concept of OPTIONAL and have no error checking. If the
|
||||||
|
passed structure contains a NULL in a mandatory field it will not be encoded,
|
||||||
|
resulting in an invalid structure.
|
||||||
|
|
||||||
|
11. It is tricky to add ASN1 encoders and decoders to external applications.
|
||||||
|
|
||||||
|
Template model
|
||||||
|
==============
|
||||||
|
|
||||||
|
One of the major problems with revision is the sheer volume of the ASN1 code.
|
||||||
|
Attempts to change (for example) the IMPLICIT behaviour would result in a
|
||||||
|
modification of *every* single decode function.
|
||||||
|
|
||||||
|
I decided to adopt a template based approach. I'm using the term 'template'
|
||||||
|
in a manner similar to SNACC templates: it has nothing to do with C++
|
||||||
|
templates.
|
||||||
|
|
||||||
|
A template is a description of an ASN1 module as several constant C structures.
|
||||||
|
It describes in a machine readable way exactly how the ASN1 structure should
|
||||||
|
behave. If this template contains enough detail then it is possible to write
|
||||||
|
versions of new, free, encode, decode (and possibly others operations) that
|
||||||
|
operate on templates.
|
||||||
|
|
||||||
|
Instead of having to write code to handle each operation only a single
|
||||||
|
template needs to be written. If new operations are needed (such as a 'print'
|
||||||
|
operation) only a single new template based function needs to be written
|
||||||
|
which will then automatically handle all existing templates.
|
||||||
|
|
||||||
|
Plans for revision
|
||||||
|
==================
|
||||||
|
|
||||||
|
The revision will consist of the following steps. Other than the first two
|
||||||
|
these can be handled in any order.
|
||||||
|
|
||||||
|
o Design and write template new, free, encode and decode operations, initially
|
||||||
|
memory based. *DONE*
|
||||||
|
|
||||||
|
o Convert existing ASN1 code to template form. *IN PROGRESS*
|
||||||
|
|
||||||
|
o Convert an existing ASN1 compiler (probably SNACC) to output templates
|
||||||
|
in OpenSSL form.
|
||||||
|
|
||||||
|
o Add support for BIO based ASN1 encoders and decoders to handle large
|
||||||
|
structures, initially blocking I/O.
|
||||||
|
|
||||||
|
o Add support for non blocking I/O: this is quite a bit harder than blocking
|
||||||
|
I/O.
|
||||||
|
|
||||||
|
o Add new ASN1 structures, such as OCSP, CRMF, S/MIME v3 (CMS), attribute
|
||||||
|
certificates etc etc.
|
||||||
|
|
||||||
|
Description of major changes
|
||||||
|
============================
|
||||||
|
|
||||||
|
The BOOLEAN type now takes three values. 0xff is TRUE, 0 is FALSE and -1 is
|
||||||
|
absent. The meaning of absent depends on the context. If for example the
|
||||||
|
boolean type is DEFAULT FALSE (as in the case of the critical flag for
|
||||||
|
certificate extensions) then -1 is FALSE, if DEFAULT TRUE then -1 is TRUE.
|
||||||
|
Usually the value will only ever be read via an API which will hide this from
|
||||||
|
an application.
|
||||||
|
|
||||||
|
There is an evil bug in the old ASN1 code that mishandles OPTIONAL with
|
||||||
|
SEQUENCE OF or SET OF. These are both implemented as a STACK structure. The
|
||||||
|
old code would omit the structure if the STACK was NULL (which is fine) or if
|
||||||
|
it had zero elements (which is NOT OK). This causes problems because an empty
|
||||||
|
SEQUENCE OF or SET OF will result in an empty STACK when it is decoded but when
|
||||||
|
it is encoded it will be omitted resulting in different encodings. The new code
|
||||||
|
only omits the encoding if the STACK is NULL, if it contains zero elements it
|
||||||
|
is encoded and empty. There is an additional problem though: because an empty
|
||||||
|
STACK was omitted, sometimes the corresponding *_new() function would
|
||||||
|
initialize the STACK to empty so an application could immediately use it, if
|
||||||
|
this is done with the new code (i.e. a NULL) it wont work. Therefore a new
|
||||||
|
STACK should be allocated first. One instance of this is the X509_CRL list of
|
||||||
|
revoked certificates: a helper function X509_CRL_add0_revoked() has been added
|
||||||
|
for this purpose.
|
||||||
|
|
||||||
|
The X509_ATTRIBUTE structure used to have an element called 'set' which took
|
||||||
|
the value 1 if the attribute value was a SET OF or 0 if it was a single. Due
|
||||||
|
to the behaviour of CHOICE in the new code this has been changed to a field
|
||||||
|
called 'single' which is 0 for a SET OF and 1 for single. The old field has
|
||||||
|
been deleted to deliberately break source compatibility. Since this structure
|
||||||
|
is normally accessed via higher level functions this shouldn't break too much.
|
||||||
|
|
||||||
|
The X509_REQ_INFO certificate request info structure no longer has a field
|
||||||
|
called 'req_kludge'. This used to be set to 1 if the attributes field was
|
||||||
|
(incorrectly) omitted. You can check to see if the field is omitted now by
|
||||||
|
checking if the attributes field is NULL. Similarly if you need to omit
|
||||||
|
the field then free attributes and set it to NULL.
|
||||||
|
|
||||||
|
The top level 'detached' field in the PKCS7 structure is no longer set when
|
||||||
|
a PKCS#7 structure is read in. PKCS7_is_detached() should be called instead.
|
||||||
|
The behaviour of PKCS7_get_detached() is unaffected.
|
||||||
|
|
||||||
|
The values of 'type' in the GENERAL_NAME structure have changed. This is
|
||||||
|
because the old code use the ASN1 initial octet as the selector. The new
|
||||||
|
code uses the index in the ASN1_CHOICE template.
|
||||||
|
|
||||||
|
The DIST_POINT_NAME structure has changed to be a true CHOICE type.
|
||||||
|
|
||||||
|
typedef struct DIST_POINT_NAME_st {
|
||||||
|
int type;
|
||||||
|
union {
|
||||||
|
STACK_OF(GENERAL_NAME) *fullname;
|
||||||
|
STACK_OF(X509_NAME_ENTRY) *relativename;
|
||||||
|
} name;
|
||||||
|
} DIST_POINT_NAME;
|
||||||
|
|
||||||
|
This means that name.fullname or name.relativename should be set
|
||||||
|
and type reflects the option. That is if name.fullname is set then
|
||||||
|
type is 0 and if name.relativename is set type is 1.
|
||||||
|
|
||||||
|
With the old code using the i2d functions would typically involve:
|
||||||
|
|
||||||
|
unsigned char *buf, *p;
|
||||||
|
int len;
|
||||||
|
/* Find length of encoding */
|
||||||
|
len = i2d_SOMETHING(x, NULL);
|
||||||
|
/* Allocate buffer */
|
||||||
|
buf = OPENSSL_malloc(len);
|
||||||
|
if(buf == NULL) {
|
||||||
|
/* Malloc error */
|
||||||
|
}
|
||||||
|
/* Use temp variable because &p gets updated to point to end of
|
||||||
|
* encoding.
|
||||||
|
*/
|
||||||
|
p = buf;
|
||||||
|
i2d_SOMETHING(x, &p);
|
||||||
|
|
||||||
|
|
||||||
|
Using the new i2d you can also do:
|
||||||
|
|
||||||
|
unsigned char *buf = NULL;
|
||||||
|
int len;
|
||||||
|
len = i2d_SOMETHING(x, &buf);
|
||||||
|
if(len < 0) {
|
||||||
|
/* Malloc error */
|
||||||
|
}
|
||||||
|
|
||||||
|
and it will automatically allocate and populate a buffer with the
|
||||||
|
encoding. After this call 'buf' will point to the start of the
|
||||||
|
encoding which is len bytes long.
|
||||||
289
README.ENGINE
Normal file
289
README.ENGINE
Normal file
@@ -0,0 +1,289 @@
|
|||||||
|
ENGINE
|
||||||
|
======
|
||||||
|
|
||||||
|
With OpenSSL 0.9.6, a new component was added to support alternative
|
||||||
|
cryptography implementations, most commonly for interfacing with external
|
||||||
|
crypto devices (eg. accelerator cards). This component is called ENGINE,
|
||||||
|
and its presence in OpenSSL 0.9.6 (and subsequent bug-fix releases)
|
||||||
|
caused a little confusion as 0.9.6** releases were rolled in two
|
||||||
|
versions, a "standard" and an "engine" version. In development for 0.9.7,
|
||||||
|
the ENGINE code has been merged into the main branch and will be present
|
||||||
|
in the standard releases from 0.9.7 forwards.
|
||||||
|
|
||||||
|
There are currently built-in ENGINE implementations for the following
|
||||||
|
crypto devices:
|
||||||
|
|
||||||
|
o CryptoSwift
|
||||||
|
o Compaq Atalla
|
||||||
|
o nCipher CHIL
|
||||||
|
o Nuron
|
||||||
|
o Broadcom uBSec
|
||||||
|
|
||||||
|
In addition, dynamic binding to external ENGINE implementations is now
|
||||||
|
provided by a special ENGINE called "dynamic". See the "DYNAMIC ENGINE"
|
||||||
|
section below for details.
|
||||||
|
|
||||||
|
At this stage, a number of things are still needed and are being worked on:
|
||||||
|
|
||||||
|
1 Integration of EVP support.
|
||||||
|
2 Configuration support.
|
||||||
|
3 Documentation!
|
||||||
|
|
||||||
|
1 With respect to EVP, this relates to support for ciphers and digests in
|
||||||
|
the ENGINE model so that alternative implementations of existing
|
||||||
|
algorithms/modes (or previously unimplemented ones) can be provided by
|
||||||
|
ENGINE implementations.
|
||||||
|
|
||||||
|
2 Configuration support currently exists in the ENGINE API itself, in the
|
||||||
|
form of "control commands". These allow an application to expose to the
|
||||||
|
user/admin the set of commands and parameter types a given ENGINE
|
||||||
|
implementation supports, and for an application to directly feed string
|
||||||
|
based input to those ENGINEs, in the form of name-value pairs. This is an
|
||||||
|
extensible way for ENGINEs to define their own "configuration" mechanisms
|
||||||
|
that are specific to a given ENGINE (eg. for a particular hardware
|
||||||
|
device) but that should be consistent across *all* OpenSSL-based
|
||||||
|
applications when they use that ENGINE. Work is in progress (or at least
|
||||||
|
in planning) for supporting these control commands from the CONF (or
|
||||||
|
NCONF) code so that applications using OpenSSL's existing configuration
|
||||||
|
file format can have ENGINE settings specified in much the same way.
|
||||||
|
Presently however, applications must use the ENGINE API itself to provide
|
||||||
|
such functionality. To see first hand the types of commands available
|
||||||
|
with the various compiled-in ENGINEs (see further down for dynamic
|
||||||
|
ENGINEs), use the "engine" openssl utility with full verbosity, ie;
|
||||||
|
openssl engine -vvvv
|
||||||
|
|
||||||
|
3 Documentation? Volunteers welcome! The source code is reasonably well
|
||||||
|
self-documenting, but some summaries and usage instructions are needed -
|
||||||
|
moreover, they are needed in the same POD format the existing OpenSSL
|
||||||
|
documentation is provided in. Any complete or incomplete contributions
|
||||||
|
would help make this happen.
|
||||||
|
|
||||||
|
STABILITY & BUG-REPORTS
|
||||||
|
=======================
|
||||||
|
|
||||||
|
What already exists is fairly stable as far as it has been tested, but
|
||||||
|
the test base has been a bit small most of the time. For the most part,
|
||||||
|
the vendors of the devices these ENGINEs support have contributed to the
|
||||||
|
development and/or testing of the implementations, and *usually* (with no
|
||||||
|
guarantees) have experience in using the ENGINE support to drive their
|
||||||
|
devices from common OpenSSL-based applications. Bugs and/or inexplicable
|
||||||
|
behaviour in using a specific ENGINE implementation should be sent to the
|
||||||
|
author of that implementation (if it is mentioned in the corresponding C
|
||||||
|
file), and in the case of implementations for commercial hardware
|
||||||
|
devices, also through whatever vendor support channels are available. If
|
||||||
|
none of this is possible, or the problem seems to be something about the
|
||||||
|
ENGINE API itself (ie. not necessarily specific to a particular ENGINE
|
||||||
|
implementation) then you should mail complete details to the relevant
|
||||||
|
OpenSSL mailing list. For a definition of "complete details", refer to
|
||||||
|
the OpenSSL "README" file. As for which list to send it to;
|
||||||
|
|
||||||
|
openssl-users: if you are *using* the ENGINE abstraction, either in an
|
||||||
|
pre-compiled application or in your own application code.
|
||||||
|
|
||||||
|
openssl-dev: if you are discussing problems with OpenSSL source code.
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
=====
|
||||||
|
|
||||||
|
The default "openssl" ENGINE is always chosen when performing crypto
|
||||||
|
operations unless you specify otherwise. You must actively tell the
|
||||||
|
openssl utility commands to use anything else through a new command line
|
||||||
|
switch called "-engine". Also, if you want to use the ENGINE support in
|
||||||
|
your own code to do something similar, you must likewise explicitly
|
||||||
|
select the ENGINE implementation you want.
|
||||||
|
|
||||||
|
Depending on the type of hardware, system, and configuration, "settings"
|
||||||
|
may need to be applied to an ENGINE for it to function as expected/hoped.
|
||||||
|
The recommended way of doing this is for the application to support
|
||||||
|
ENGINE "control commands" so that each ENGINE implementation can provide
|
||||||
|
whatever configuration primitives it might require and the application
|
||||||
|
can allow the user/admin (and thus the hardware vendor's support desk
|
||||||
|
also) to provide any such input directly to the ENGINE implementation.
|
||||||
|
This way, applications do not need to know anything specific to any
|
||||||
|
device, they only need to provide the means to carry such user/admin
|
||||||
|
input through to the ENGINE in question. Ie. this connects *you* (and
|
||||||
|
your helpdesk) to the specific ENGINE implementation (and device), and
|
||||||
|
allows application authors to not get buried in hassle supporting
|
||||||
|
arbitrary devices they know (and care) nothing about.
|
||||||
|
|
||||||
|
A new "openssl" utility, "openssl engine", has been added in that allows
|
||||||
|
for testing and examination of ENGINE implementations. Basic usage
|
||||||
|
instructions are available by specifying the "-?" command line switch.
|
||||||
|
|
||||||
|
DYNAMIC ENGINES
|
||||||
|
===============
|
||||||
|
|
||||||
|
The new "dynamic" ENGINE provides a low-overhead way to support ENGINE
|
||||||
|
implementations that aren't pre-compiled and linked into OpenSSL-based
|
||||||
|
applications. This could be because existing compiled-in implementations
|
||||||
|
have known problems and you wish to use a newer version with an existing
|
||||||
|
application. It could equally be because the application (or OpenSSL
|
||||||
|
library) you are using simply doesn't have support for the ENGINE you
|
||||||
|
wish to use, and the ENGINE provider (eg. hardware vendor) is providing
|
||||||
|
you with a self-contained implementation in the form of a shared-library.
|
||||||
|
The other use-case for "dynamic" is with applications that wish to
|
||||||
|
maintain the smallest foot-print possible and so do not link in various
|
||||||
|
ENGINE implementations from OpenSSL, but instead leaves you to provide
|
||||||
|
them, if you want them, in the form of "dynamic"-loadable
|
||||||
|
shared-libraries. It should be possible for hardware vendors to provide
|
||||||
|
their own shared-libraries to support arbitrary hardware to work with
|
||||||
|
applications based on OpenSSL 0.9.7 or later. If you're using an
|
||||||
|
application based on 0.9.7 (or later) and the support you desire is only
|
||||||
|
announced for versions later than the one you need, ask the vendor to
|
||||||
|
backport their ENGINE to the version you need.
|
||||||
|
|
||||||
|
How does "dynamic" work?
|
||||||
|
------------------------
|
||||||
|
The dynamic ENGINE has a special flag in its implementation such that
|
||||||
|
every time application code asks for the 'dynamic' ENGINE, it in fact
|
||||||
|
gets its own copy of it. As such, multi-threaded code (or code that
|
||||||
|
multiplexes multiple uses of 'dynamic' in a single application in any
|
||||||
|
way at all) does not get confused by 'dynamic' being used to do many
|
||||||
|
independent things. Other ENGINEs typically don't do this so there is
|
||||||
|
only ever 1 ENGINE structure of its type (and reference counts are used
|
||||||
|
to keep order). The dynamic ENGINE itself provides absolutely no
|
||||||
|
cryptographic functionality, and any attempt to "initialise" the ENGINE
|
||||||
|
automatically fails. All it does provide are a few "control commands"
|
||||||
|
that can be used to control how it will load an external ENGINE
|
||||||
|
implementation from a shared-library. To see these control commands,
|
||||||
|
use the command-line;
|
||||||
|
|
||||||
|
openssl engine -vvvv dynamic
|
||||||
|
|
||||||
|
The "SO_PATH" control command should be used to identify the
|
||||||
|
shared-library that contains the ENGINE implementation, and "NO_VCHECK"
|
||||||
|
might possibly be useful if there is a minor version conflict and you
|
||||||
|
(or a vendor helpdesk) is convinced you can safely ignore it.
|
||||||
|
"ID" is probably only needed if a shared-library implements
|
||||||
|
multiple ENGINEs, but if you know the engine id you expect to be using,
|
||||||
|
it doesn't hurt to specify it (and this provides a sanity check if
|
||||||
|
nothing else). "LIST_ADD" is only required if you actually wish the
|
||||||
|
loaded ENGINE to be discoverable by application code later on using the
|
||||||
|
ENGINE's "id". For most applications, this isn't necessary - but some
|
||||||
|
application authors may have nifty reasons for using it. The "LOAD"
|
||||||
|
command is the only one that takes no parameters and is the command
|
||||||
|
that uses the settings from any previous commands to actually *load*
|
||||||
|
the shared-library ENGINE implementation. If this command succeeds, the
|
||||||
|
(copy of the) 'dynamic' ENGINE will magically morph into the ENGINE
|
||||||
|
that has been loaded from the shared-library. As such, any control
|
||||||
|
commands supported by the loaded ENGINE could then be executed as per
|
||||||
|
normal. Eg. if ENGINE "foo" is implemented in the shared-library
|
||||||
|
"libfoo.so" and it supports some special control command "CMD_FOO", the
|
||||||
|
following code would load and use it (NB: obviously this code has no
|
||||||
|
error checking);
|
||||||
|
|
||||||
|
ENGINE *e = ENGINE_by_id("dynamic");
|
||||||
|
ENGINE_ctrl_cmd_string(e, "SO_PATH", "/lib/libfoo.so", 0);
|
||||||
|
ENGINE_ctrl_cmd_string(e, "ID", "foo", 0);
|
||||||
|
ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0);
|
||||||
|
ENGINE_ctrl_cmd_string(e, "CMD_FOO", "some input data", 0);
|
||||||
|
|
||||||
|
For testing, the "openssl engine" utility can be useful for this sort
|
||||||
|
of thing. For example the above code excerpt would achieve much the
|
||||||
|
same result as;
|
||||||
|
|
||||||
|
openssl engine dynamic \
|
||||||
|
-pre SO_PATH:/lib/libfoo.so \
|
||||||
|
-pre ID:foo \
|
||||||
|
-pre LOAD \
|
||||||
|
-pre "CMD_FOO:some input data"
|
||||||
|
|
||||||
|
Or to simply see the list of commands supported by the "foo" ENGINE;
|
||||||
|
|
||||||
|
openssl engine -vvvv dynamic \
|
||||||
|
-pre SO_PATH:/lib/libfoo.so \
|
||||||
|
-pre ID:foo \
|
||||||
|
-pre LOAD
|
||||||
|
|
||||||
|
Applications that support the ENGINE API and more specifically, the
|
||||||
|
"control commands" mechanism, will provide some way for you to pass
|
||||||
|
such commands through to ENGINEs. As such, you would select "dynamic"
|
||||||
|
as the ENGINE to use, and the parameters/commands you pass would
|
||||||
|
control the *actual* ENGINE used. Each command is actually a name-value
|
||||||
|
pair and the value can sometimes be omitted (eg. the "LOAD" command).
|
||||||
|
Whilst the syntax demonstrated in "openssl engine" uses a colon to
|
||||||
|
separate the command name from the value, applications may provide
|
||||||
|
their own syntax for making that separation (eg. a win32 registry
|
||||||
|
key-value pair may be used by some applications). The reason for the
|
||||||
|
"-pre" syntax in the "openssl engine" utility is that some commands
|
||||||
|
might be issued to an ENGINE *after* it has been initialised for use.
|
||||||
|
Eg. if an ENGINE implementation requires a smart-card to be inserted
|
||||||
|
during initialisation (or a PIN to be typed, or whatever), there may be
|
||||||
|
a control command you can issue afterwards to "forget" the smart-card
|
||||||
|
so that additional initialisation is no longer possible. In
|
||||||
|
applications such as web-servers, where potentially volatile code may
|
||||||
|
run on the same host system, this may provide some arguable security
|
||||||
|
value. In such a case, the command would be passed to the ENGINE after
|
||||||
|
it has been initialised for use, and so the "-post" switch would be
|
||||||
|
used instead. Applications may provide a different syntax for
|
||||||
|
supporting this distinction, and some may simply not provide it at all
|
||||||
|
("-pre" is almost always what you're after, in reality).
|
||||||
|
|
||||||
|
How do I build a "dynamic" ENGINE?
|
||||||
|
----------------------------------
|
||||||
|
This question is trickier - currently OpenSSL bundles various ENGINE
|
||||||
|
implementations that are statically built in, and any application that
|
||||||
|
calls the "ENGINE_load_builtin_engines()" function will automatically
|
||||||
|
have all such ENGINEs available (and occupying memory). Applications
|
||||||
|
that don't call that function have no ENGINEs available like that and
|
||||||
|
would have to use "dynamic" to load any such ENGINE - but on the other
|
||||||
|
hand such applications would only have the memory footprint of any
|
||||||
|
ENGINEs explicitly loaded using user/admin provided control commands.
|
||||||
|
The main advantage of not statically linking ENGINEs and only using
|
||||||
|
"dynamic" for hardware support is that any installation using no
|
||||||
|
"external" ENGINE suffers no unnecessary memory footprint from unused
|
||||||
|
ENGINEs. Likewise, installations that do require an ENGINE incur the
|
||||||
|
overheads from only *that* ENGINE once it has been loaded.
|
||||||
|
|
||||||
|
Sounds good? Maybe, but currently building an ENGINE implementation as
|
||||||
|
a shared-library that can be loaded by "dynamic" isn't automated in
|
||||||
|
OpenSSL's build process. It can be done manually quite easily however.
|
||||||
|
Such a shared-library can either be built with any OpenSSL code it
|
||||||
|
needs statically linked in, or it can link dynamically against OpenSSL
|
||||||
|
if OpenSSL itself is built as a shared library. The instructions are
|
||||||
|
the same in each case, but in the former (statically linked any
|
||||||
|
dependencies on OpenSSL) you must ensure OpenSSL is built with
|
||||||
|
position-independent code ("PIC"). The default OpenSSL compilation may
|
||||||
|
already specify the relevant flags to do this, but you should consult
|
||||||
|
with your compiler documentation if you are in any doubt.
|
||||||
|
|
||||||
|
This example will show building the "atalla" ENGINE in the
|
||||||
|
crypto/engine/ directory as a shared-library for use via the "dynamic"
|
||||||
|
ENGINE.
|
||||||
|
1) "cd" to the crypto/engine/ directory of a pre-compiled OpenSSL
|
||||||
|
source tree.
|
||||||
|
2) Recompile at least one source file so you can see all the compiler
|
||||||
|
flags (and syntax) being used to build normally. Eg;
|
||||||
|
touch hw_atalla.c ; make
|
||||||
|
will rebuild "hw_atalla.o" using all such flags.
|
||||||
|
3) Manually enter the same compilation line to compile the
|
||||||
|
"hw_atalla.c" file but with the following two changes;
|
||||||
|
(a) add "-DENGINE_DYNAMIC_SUPPORT" to the command line switches,
|
||||||
|
(b) change the output file from "hw_atalla.o" to something new,
|
||||||
|
eg. "tmp_atalla.o"
|
||||||
|
4) Link "tmp_atalla.o" into a shared-library using the top-level
|
||||||
|
OpenSSL libraries to resolve any dependencies. The syntax for doing
|
||||||
|
this depends heavily on your system/compiler and is a nightmare
|
||||||
|
known well to anyone who has worked with shared-library portability
|
||||||
|
before. 'gcc' on Linux, for example, would use the following syntax;
|
||||||
|
gcc -shared -o dyn_atalla.so tmp_atalla.o -L../.. -lcrypto
|
||||||
|
5) Test your shared library using "openssl engine" as explained in the
|
||||||
|
previous section. Eg. from the top-level directory, you might try;
|
||||||
|
apps/openssl engine -vvvv dynamic \
|
||||||
|
-pre SO_PATH:./crypto/engine/dyn_atalla.so -pre LOAD
|
||||||
|
If the shared-library loads successfully, you will see both "-pre"
|
||||||
|
commands marked as "SUCCESS" and the list of control commands
|
||||||
|
displayed (because of "-vvvv") will be the control commands for the
|
||||||
|
*atalla* ENGINE (ie. *not* the 'dynamic' ENGINE). You can also add
|
||||||
|
the "-t" switch to the utility if you want it to try and initialise
|
||||||
|
the atalla ENGINE for use to test any possible hardware/driver
|
||||||
|
issues.
|
||||||
|
|
||||||
|
PROBLEMS
|
||||||
|
========
|
||||||
|
|
||||||
|
It seems like the ENGINE part doesn't work too well with CryptoSwift on Win32.
|
||||||
|
A quick test done right before the release showed that trying "openssl speed
|
||||||
|
-engine cswift" generated errors. If the DSO gets enabled, an attempt is made
|
||||||
|
to write at memory address 0x00000002.
|
||||||
|
|
||||||
151
STATUS
151
STATUS
@@ -1,45 +1,26 @@
|
|||||||
|
|
||||||
OpenSSL STATUS Last modified at
|
OpenSSL STATUS Last modified at
|
||||||
______________ $Date: 2000/03/25 10:44:28 $
|
______________ $Date: 2002/12/07 20:03:42 $
|
||||||
|
|
||||||
DEVELOPMENT STATE
|
DEVELOPMENT STATE
|
||||||
|
|
||||||
o OpenSSL 0.9.5a: Under development...
|
o OpenSSL 0.9.8: Under development...
|
||||||
Proposed release date March 31st, 2000
|
o OpenSSL 0.9.7-beta5: Released on December 5th, 2002
|
||||||
0.9.5a-beta1 is available.
|
o OpenSSL 0.9.7-beta4: Released on November 19th, 2002
|
||||||
sunos-gcc - failed (ssize_t)
|
Debian GNU/Linux (kernel version 2.4.19, gcc 2.95.4) - PASSED
|
||||||
ultrix-gcc, ultrix-cc - failed (ssize_t)
|
o OpenSSL 0.9.7-beta3: Released on July 30th, 2002
|
||||||
sco5-cc - bc fails in test
|
o OpenSSL 0.9.7-beta2: Released on June 16th, 2002
|
||||||
VC-Win32 (MSVC6SP3, nasm) - failed (fixed)
|
o OpenSSL 0.9.7-beta1: Released on June 1st, 2002
|
||||||
FreeBSD-elf (i686-pc-freebsd3.2)- failed (fixed)
|
o OpenSSL 0.9.6h: Released on December 5th, 2002
|
||||||
HPUX (hpux-parisc-cc w/ +02) - passed
|
o OpenSSL 0.9.6g: Released on August 9th, 2002
|
||||||
OpenBSD-x86 - passed
|
o OpenSSL 0.9.6f: Released on August 8th, 2002
|
||||||
solaris-sparcv9-cc - passed
|
o OpenSSL 0.9.6e: Released on July 30th, 2002
|
||||||
0.9.5a-beta2 is available.
|
o OpenSSL 0.9.6d: Released on May 9th, 2002
|
||||||
linux-elf - passed
|
o OpenSSL 0.9.6c: Released on December 21st, 2001
|
||||||
linux-ppc (egcs 2.91.66) - passed
|
o OpenSSL 0.9.6b: Released on July 9th, 2001
|
||||||
OpenBSD-elf - passed
|
o OpenSSL 0.9.6a: Released on April 5th, 2001
|
||||||
FreeBSD-elf (i586-pc-freebsd3.2)- passed
|
o OpenSSL 0.9.6: Released on September 24th, 2000
|
||||||
solaris-sparcv9-cc - passed
|
o OpenSSL 0.9.5a: Released on April 1st, 2000
|
||||||
solaris-sparcv9-gcc - passed
|
|
||||||
Mingw32 - passed
|
|
||||||
VMS/Alpha 7.1 w/ DEC C 5.6-003 - passed
|
|
||||||
VMS/Alpha 7.2-1 w/ CPQ C 6.2-003- passed
|
|
||||||
VMS/VAX 7.1 w/ DEC C 5.6-003 - passed
|
|
||||||
VMS/VAX 7.2 w/ DEC C 6.0-001 - passed
|
|
||||||
AIX 4.3.3.0 w/ cc - passed
|
|
||||||
AIX 4.3.3.0 w/ gcc (2.7.2.3?) - passed
|
|
||||||
Irix 6.4 w/ cc - passed
|
|
||||||
Irix 6.4 w/ gcc - passed
|
|
||||||
Irix 6.5 w/ cc - passed
|
|
||||||
Irix 6.5 w/ gcc - passed
|
|
||||||
NetBSD-x86 - passed
|
|
||||||
Unixware 7.0.1 w/ native cc - passed
|
|
||||||
Solaris-x86 2.6 w/ gcc 2.7.2.3 - passed
|
|
||||||
Solaris-x86 2.7 w/ gcc 2.7.2.3 - passed
|
|
||||||
True64 Unix w/ gcc 2.7.2.3 - passed
|
|
||||||
Win32 w/ VC++ 5 & NASM 0.98 - passed
|
|
||||||
|
|
||||||
o OpenSSL 0.9.5: Released on February 28th, 2000
|
o OpenSSL 0.9.5: Released on February 28th, 2000
|
||||||
o OpenSSL 0.9.4: Released on August 09th, 1999
|
o OpenSSL 0.9.4: Released on August 09th, 1999
|
||||||
o OpenSSL 0.9.3a: Released on May 29th, 1999
|
o OpenSSL 0.9.3a: Released on May 29th, 1999
|
||||||
@@ -47,32 +28,64 @@
|
|||||||
o OpenSSL 0.9.2b: Released on March 22th, 1999
|
o OpenSSL 0.9.2b: Released on March 22th, 1999
|
||||||
o OpenSSL 0.9.1c: Released on December 23th, 1998
|
o OpenSSL 0.9.1c: Released on December 23th, 1998
|
||||||
|
|
||||||
|
[See also http://www.openssl.org/support/rt2.html]
|
||||||
|
|
||||||
RELEASE SHOWSTOPPERS
|
RELEASE SHOWSTOPPERS
|
||||||
|
|
||||||
|
o BN_mod_mul verification fails for mips3-sgi-irix
|
||||||
|
unless configured with no-asm
|
||||||
|
|
||||||
|
o [2002-11-21]
|
||||||
|
PR 343 mentions that scrubbing memory with 'memset(ptr, 0, n)' may
|
||||||
|
be optimized away in modern compilers. This is definitely not good
|
||||||
|
and needs to be fixed immediately. The formula to use is presented
|
||||||
|
in:
|
||||||
|
|
||||||
|
http://online.securityfocus.com/archive/82/297918/2002-10-27/2002-11-02/0
|
||||||
|
|
||||||
|
The problem report that mentions this is:
|
||||||
|
|
||||||
|
https://www.aet.TU-Cottbus.DE/rt2/Ticket/Display.html?id=343
|
||||||
|
|
||||||
AVAILABLE PATCHES
|
AVAILABLE PATCHES
|
||||||
|
|
||||||
o CA.pl patch (Damien Miller)
|
o
|
||||||
|
|
||||||
IN PROGRESS
|
IN PROGRESS
|
||||||
|
|
||||||
o Steve is currently working on (in no particular order):
|
o Steve is currently working on (in no particular order):
|
||||||
Proper (or at least usable) certificate chain verification.
|
ASN1 code redesign, butchery, replacement.
|
||||||
|
OCSP
|
||||||
|
EVP cipher enhancement.
|
||||||
|
Enhanced certificate chain verification.
|
||||||
Private key, certificate and CRL API and implementation.
|
Private key, certificate and CRL API and implementation.
|
||||||
Developing and bugfixing PKCS#7 (S/MIME code).
|
Developing and bugfixing PKCS#7 (S/MIME code).
|
||||||
Various X509 issues: character sets, certificate request extensions.
|
Various X509 issues: character sets, certificate request extensions.
|
||||||
Documentation for the openssl utility.
|
o Geoff and Richard are currently working on:
|
||||||
|
ENGINE (the new code that gives hardware support among others).
|
||||||
|
o Richard is currently working on:
|
||||||
|
UI (User Interface)
|
||||||
|
UTIL (a new set of library functions to support some higher level
|
||||||
|
functionality that is currently missing).
|
||||||
|
Shared library support for VMS.
|
||||||
|
Kerberos 5 authentication (Heimdal)
|
||||||
|
Constification
|
||||||
|
Compression
|
||||||
|
Attribute Certificate support
|
||||||
|
Certificate Pair support
|
||||||
|
Storage Engines (primarly an LDAP storage engine)
|
||||||
|
|
||||||
NEEDS PATCH
|
NEEDS PATCH
|
||||||
|
|
||||||
o non-blocking socket on AIX
|
o 0.9.8-dev: COMPLEMENTOFALL and COMPLEMENTOFDEFAULT do not
|
||||||
o $(PERL) in */Makefile.ssl
|
handle ECCdraft cipher suites correctly.
|
||||||
o "Sign the certificate?" - "n" creates empty certificate file
|
|
||||||
|
o apps/ca.c: "Sign the certificate?" - "n" creates empty certificate file
|
||||||
|
|
||||||
|
o "OpenSSL STATUS" is never up-to-date.
|
||||||
|
|
||||||
OPEN ISSUES
|
OPEN ISSUES
|
||||||
|
|
||||||
o internal_verify doesn't know about X509.v3 (basicConstraints
|
|
||||||
CA flag ...)
|
|
||||||
|
|
||||||
o The Makefile hierarchy and build mechanism is still not a round thing:
|
o The Makefile hierarchy and build mechanism is still not a round thing:
|
||||||
|
|
||||||
1. The config vs. Configure scripts
|
1. The config vs. Configure scripts
|
||||||
@@ -97,36 +110,20 @@
|
|||||||
which apparently is not flexible enough to generate
|
which apparently is not flexible enough to generate
|
||||||
libcrypto)
|
libcrypto)
|
||||||
|
|
||||||
|
|
||||||
o The perl/ stuff needs a major overhaul. Currently it's
|
|
||||||
totally obsolete. Either we clean it up and enhance it to be up-to-date
|
|
||||||
with the C code or we also could replace it with the really nice
|
|
||||||
Net::SSLeay package we can find under
|
|
||||||
http://www.neuronio.pt/SSLeay.pm.html. Ralf uses this package for a
|
|
||||||
longer time and it works fine and is a nice Perl module. Best would be
|
|
||||||
to convince the author to work for the OpenSSL project and create a
|
|
||||||
Net::OpenSSL or Crypt::OpenSSL package out of it and maintains it for
|
|
||||||
us.
|
|
||||||
|
|
||||||
Status: Ralf thinks we should both contact the author of Net::SSLeay
|
|
||||||
and look how much effort it is to bring Eric's perl/ stuff up
|
|
||||||
to date.
|
|
||||||
Paul +1
|
|
||||||
|
|
||||||
o The EVP and ASN1 stuff is a mess. Currently you have one EVP_CIPHER
|
|
||||||
structure for each cipher. This may make sense for things like DES but
|
|
||||||
for variable length ciphers like RC2 and RC4 it is NBG. Need a way to
|
|
||||||
use the EVP interface and set up the cipher parameters. The ASN1 stuff
|
|
||||||
is also foo wrt ciphers whose AlgorithmIdentifier has more than just
|
|
||||||
an IV in it (e.g. RC2, RC5). This also means that EVP_Seal and EVP_Open
|
|
||||||
don't work unless the key length matches the fixed value (some vendors
|
|
||||||
use a key length decided by the size of the RSA encrypted key and expect
|
|
||||||
RC2 to adapt).
|
|
||||||
|
|
||||||
o ERR_error_string(..., buf) does not know how large buf is,
|
|
||||||
there should be ERR_error_string_n(..., buf, bufsize)
|
|
||||||
or similar.
|
|
||||||
|
|
||||||
WISHES
|
WISHES
|
||||||
|
|
||||||
o
|
o Add variants of DH_generate_parameters() and BN_generate_prime() [etc?]
|
||||||
|
where the callback function can request that the function be aborted.
|
||||||
|
[Gregory Stark <ghstark@pobox.com>, <rayyang2000@yahoo.com>]
|
||||||
|
|
||||||
|
o SRP in TLS.
|
||||||
|
[wished by:
|
||||||
|
Dj <derek@yo.net>, Tom Wu <tom@arcot.com>,
|
||||||
|
Tom Holroyd <tomh@po.crl.go.jp>]
|
||||||
|
|
||||||
|
See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
|
||||||
|
as well as http://www-cs-students.stanford.edu/~tjw/srp/.
|
||||||
|
|
||||||
|
Tom Holroyd tells us there is a SRP patch for OpenSSH at
|
||||||
|
http://members.tripod.com/professor_tom/archives/, that could
|
||||||
|
be useful.
|
||||||
|
|||||||
@@ -34,10 +34,8 @@ $ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
|
|||||||
$ IF F$PARSE("WRK_SSLROOT:[VMS]") .EQS. "" THEN -
|
$ IF F$PARSE("WRK_SSLROOT:[VMS]") .EQS. "" THEN -
|
||||||
CREATE/DIR/LOG WRK_SSLROOT:[VMS]
|
CREATE/DIR/LOG WRK_SSLROOT:[VMS]
|
||||||
$
|
$
|
||||||
$ EXHEADER := vms_idhacks.h
|
$ IF F$SEARCH("WRK_SSLINCLUDE:vms_idhacks.h") .NES. "" THEN -
|
||||||
$
|
DELETE WRK_SSLINCLUDE: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
|
$ OPEN/WRITE SF WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM
|
||||||
$ WRITE SYS$OUTPUT "%OPEN-I-CREATED, ",F$SEARCH("WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM")," created."
|
$ WRITE SYS$OUTPUT "%OPEN-I-CREATED, ",F$SEARCH("WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM")," created."
|
||||||
|
|||||||
354
VMS/mkshared.com
Normal file
354
VMS/mkshared.com
Normal file
@@ -0,0 +1,354 @@
|
|||||||
|
$! MKSHARED.COM -- script to created shareable images on VMS
|
||||||
|
$!
|
||||||
|
$! No command line parameters. This should be run at the start of the source
|
||||||
|
$! tree (the same directory where one finds INSTALL.VMS).
|
||||||
|
$!
|
||||||
|
$! Input: [.UTIL]LIBEAY.NUM,[.AXP.EXE.CRYPTO]LIBCRYPTO.OLB
|
||||||
|
$! [.UTIL]SSLEAY.NUM,[.AXP.EXE.SSL]LIBSSL.OLB
|
||||||
|
$! Output: [.AXP.EXE.CRYPTO]LIBCRYPTO.OPT,.MAP,.EXE
|
||||||
|
$! [.AXP.EXE.SSL]LIBSSL.OPT,.MAP,.EXE
|
||||||
|
$!
|
||||||
|
$! So far, tests have only been made on VMS for Alpha. VAX will come in time.
|
||||||
|
$! ===========================================================================
|
||||||
|
$
|
||||||
|
$! ----- Prepare info for processing: version number and file info
|
||||||
|
$ gosub read_version_info
|
||||||
|
$ if libver .eqs. ""
|
||||||
|
$ then
|
||||||
|
$ write sys$error "ERROR: Couldn't find any library version info..."
|
||||||
|
$ exit
|
||||||
|
$ endif
|
||||||
|
$
|
||||||
|
$ if f$getsyi("CPU") .ge. 128
|
||||||
|
$ then
|
||||||
|
$ libid = "Crypto"
|
||||||
|
$ libnum = "[.UTIL]LIBEAY.NUM"
|
||||||
|
$ libdir = "[.AXP.EXE.CRYPTO]"
|
||||||
|
$ libolb = "''libdir'LIBCRYPTO.OLB"
|
||||||
|
$ libopt = "''libdir'LIBCRYPTO.OPT"
|
||||||
|
$ libmap = "''libdir'LIBCRYPTO.MAP"
|
||||||
|
$ libgoal= "''libdir'LIBCRYPTO.EXE"
|
||||||
|
$ libref = ""
|
||||||
|
$ gosub create_axp_shr
|
||||||
|
$ libid = "SSL"
|
||||||
|
$ libnum = "[.UTIL]SSLEAY.NUM"
|
||||||
|
$ libdir = "[.AXP.EXE.SSL]"
|
||||||
|
$ libolb = "''libdir'LIBSSL.OLB"
|
||||||
|
$ libopt = "''libdir'LIBSSL.OPT"
|
||||||
|
$ libmap = "''libdir'LIBSSL.MAP"
|
||||||
|
$ libgoal= "''libdir'LIBSSL.EXE"
|
||||||
|
$ libref = "[.AXP.EXE.CRYPTO]LIBCRYPTO.EXE"
|
||||||
|
$ gosub create_axp_shr
|
||||||
|
$ else
|
||||||
|
$ libtit = "CRYPTO_TRANSFER_VECTOR"
|
||||||
|
$ libid = "Crypto"
|
||||||
|
$ libnum = "[.UTIL]LIBEAY.NUM"
|
||||||
|
$ libdir = "[.VAX.EXE.CRYPTO]"
|
||||||
|
$ libmar = "''libdir'LIBCRYPTO.MAR"
|
||||||
|
$ libolb = "''libdir'LIBCRYPTO.OLB"
|
||||||
|
$ libopt = "''libdir'LIBCRYPTO.OPT"
|
||||||
|
$ libobj = "''libdir'LIBCRYPTO.OBJ"
|
||||||
|
$ libmap = "''libdir'LIBCRYPTO.MAP"
|
||||||
|
$ libgoal= "''libdir'LIBCRYPTO.EXE"
|
||||||
|
$ libref = ""
|
||||||
|
$ libvec = "LIBCRYPTO"
|
||||||
|
$ gosub create_vax_shr
|
||||||
|
$ libtit = "SSL_TRANSFER_VECTOR"
|
||||||
|
$ libid = "SSL"
|
||||||
|
$ libnum = "[.UTIL]SSLEAY.NUM"
|
||||||
|
$ libdir = "[.VAX.EXE.SSL]"
|
||||||
|
$ libmar = "''libdir'LIBSSL.MAR"
|
||||||
|
$ libolb = "''libdir'LIBSSL.OLB"
|
||||||
|
$ libopt = "''libdir'LIBSSL.OPT"
|
||||||
|
$ libobj = "''libdir'LIBSSL.OBJ"
|
||||||
|
$ libmap = "''libdir'LIBSSL.MAP"
|
||||||
|
$ libgoal= "''libdir'LIBSSL.EXE"
|
||||||
|
$ libref = "[.VAX.EXE.CRYPTO]LIBCRYPTO.EXE"
|
||||||
|
$ libvec = "LIBSSL"
|
||||||
|
$ gosub create_vax_shr
|
||||||
|
$ endif
|
||||||
|
$ exit
|
||||||
|
$
|
||||||
|
$! ----- Soubroutines to actually build the shareable libraries
|
||||||
|
$! The way things work, there's a main shareable library creator for each
|
||||||
|
$! supported architecture, which is called from the main code above.
|
||||||
|
$! The creator will define a number of variables to tell the next levels of
|
||||||
|
$! subroutines what routines to use to write to the option files, call the
|
||||||
|
$! main processor, read_func_num, and when that is done, it will write version
|
||||||
|
$! data at the end of the .opt file, close it, and link the library.
|
||||||
|
$!
|
||||||
|
$! read_func_num reads through a .num file and calls the writer routine for
|
||||||
|
$! each line. It's also responsible for checking that order is properly kept
|
||||||
|
$! in the .num file, check that each line applies to VMS and the architecture,
|
||||||
|
$! and to fill in "holes" with dummy entries.
|
||||||
|
$!
|
||||||
|
$! The creator routines depend on the following variables:
|
||||||
|
$! libnum The name of the .num file to use as input
|
||||||
|
$! libolb The name of the object library to build from
|
||||||
|
$! libid The identification string of the shareable library
|
||||||
|
$! libopt The name of the .opt file to write
|
||||||
|
$! libtit The title of the assembler transfer vector file (VAX only)
|
||||||
|
$! libmar The name of the assembler transfer vector file (VAX only)
|
||||||
|
$! libmap The name of the map file to write
|
||||||
|
$! libgoal The name of the shareable library to write
|
||||||
|
$! libref The name of a shareable library to link in
|
||||||
|
$!
|
||||||
|
$! read_func_num depends on the following variables from the creator:
|
||||||
|
$! libwriter The name of the writer routine to call for each .num file line
|
||||||
|
$! -----
|
||||||
|
$
|
||||||
|
$! ----- Subroutines for AXP
|
||||||
|
$! -----
|
||||||
|
$! The creator routine
|
||||||
|
$ create_axp_shr:
|
||||||
|
$ open/write opt 'libopt'
|
||||||
|
$ write opt "identification=""",libid," ",libverstr,""""
|
||||||
|
$ write opt libolb,"/lib"
|
||||||
|
$ if libref .nes. "" then write opt libref,"/SHARE"
|
||||||
|
$ write opt "SYMBOL_VECTOR=(-"
|
||||||
|
$ libfirstentry := true
|
||||||
|
$ libwrch := opt
|
||||||
|
$ libwriter := write_axp_transfer_entry
|
||||||
|
$ textcount = 0
|
||||||
|
$ gosub read_func_num
|
||||||
|
$ write opt ")"
|
||||||
|
$ write opt "GSMATCH=",libvmatch,",",libver
|
||||||
|
$ close opt
|
||||||
|
$ link/map='libmap'/full/share='libgoal' 'libopt'/option
|
||||||
|
$ return
|
||||||
|
$
|
||||||
|
$! The record writer routine
|
||||||
|
$ write_axp_transfer_entry:
|
||||||
|
$ if libentry .eqs. ".dummy" then return
|
||||||
|
$ if info_kind .eqs. "VARIABLE"
|
||||||
|
$ then
|
||||||
|
$ pr:=DATA
|
||||||
|
$ else
|
||||||
|
$ pr:=PROCEDURE
|
||||||
|
$ endif
|
||||||
|
$ textcount_this = f$length(pr) + f$length(libentry) + 5
|
||||||
|
$ if textcount + textcount_this .gt. 1024
|
||||||
|
$ then
|
||||||
|
$ write opt ")"
|
||||||
|
$ write opt "SYMBOL_VECTOR=(-"
|
||||||
|
$ textcount = 16
|
||||||
|
$ libfirstentry := true
|
||||||
|
$ endif
|
||||||
|
$ if libfirstentry
|
||||||
|
$ then
|
||||||
|
$ write 'libwrch' " ",libentry,"=",pr," -"
|
||||||
|
$ else
|
||||||
|
$ write 'libwrch' " ,",libentry,"=",pr," -"
|
||||||
|
$ endif
|
||||||
|
$ libfirstentry := false
|
||||||
|
$ textcount = textcount + textcount_this
|
||||||
|
$ return
|
||||||
|
$
|
||||||
|
$! ----- Subroutines for AXP
|
||||||
|
$! -----
|
||||||
|
$! The creator routine
|
||||||
|
$ create_vax_shr:
|
||||||
|
$ open/write mar 'libmar'
|
||||||
|
$ type sys$input:/out=mar:
|
||||||
|
;
|
||||||
|
; Transfer vector for VAX shareable image
|
||||||
|
;
|
||||||
|
$ write mar " .TITLE ",libtit
|
||||||
|
$ write mar " .IDENT /",libid,"/"
|
||||||
|
$ type sys$input:/out=mar:
|
||||||
|
;
|
||||||
|
; Define macro to assist in building transfer vector entries. Each entry
|
||||||
|
; should take no more than 8 bytes.
|
||||||
|
;
|
||||||
|
.MACRO FTRANSFER_ENTRY routine
|
||||||
|
.ALIGN QUAD
|
||||||
|
.TRANSFER routine
|
||||||
|
.MASK routine
|
||||||
|
JMP routine+2
|
||||||
|
.ENDM FTRANSFER_ENTRY
|
||||||
|
;
|
||||||
|
; Place entries in own program section.
|
||||||
|
;
|
||||||
|
$ write mar " .PSECT $$",libvec,",QUAD,PIC,USR,CON,REL,LCL,SHR,EXE,RD,NOWRT"
|
||||||
|
$ write mar libvec,"_xfer:"
|
||||||
|
$ libwrch := mar
|
||||||
|
$ libwriter := write_vax_ftransfer_entry
|
||||||
|
$ gosub read_func_num
|
||||||
|
$ type sys$input:/out=mar:
|
||||||
|
;
|
||||||
|
; Allocate extra storage at end of vector to allow for expansion.
|
||||||
|
;
|
||||||
|
$ write mar " .BLKB 32768-<.-",libvec,"_xfer> ; 64 pages total."
|
||||||
|
$! libwriter := write_vax_vtransfer_entry
|
||||||
|
$! gosub read_func_num
|
||||||
|
$ write mar " .END"
|
||||||
|
$ close mar
|
||||||
|
$ open/write opt 'libopt'
|
||||||
|
$ write opt "identification=""",libid," ",libverstr,""""
|
||||||
|
$ write opt libobj
|
||||||
|
$ write opt libolb,"/lib"
|
||||||
|
$ if libref .nes. "" then write opt libref,"/SHARE"
|
||||||
|
$ type sys$input:/out=opt:
|
||||||
|
!
|
||||||
|
! Ensure transfer vector is at beginning of image
|
||||||
|
!
|
||||||
|
CLUSTER=FIRST
|
||||||
|
$ write opt "COLLECT=FIRST,$$",libvec
|
||||||
|
$ write opt "GSMATCH=",libvmatch,",",libver
|
||||||
|
$ type sys$input:/out=opt:
|
||||||
|
!
|
||||||
|
! make psects nonshareable so image can be installed.
|
||||||
|
!
|
||||||
|
PSECT_ATTR=$CHAR_STRING_CONSTANTS,NOWRT
|
||||||
|
$ libwrch := opt
|
||||||
|
$ libwriter := write_vax_psect_attr
|
||||||
|
$ gosub read_func_num
|
||||||
|
$ close opt
|
||||||
|
$ macro/obj='libobj' 'libmar'
|
||||||
|
$ link/map='libmap'/full/share='libgoal' 'libopt'/option
|
||||||
|
$ return
|
||||||
|
$
|
||||||
|
$! The record writer routine for VAX functions
|
||||||
|
$ write_vax_ftransfer_entry:
|
||||||
|
$ if info_kind .nes. "FUNCTION" then return
|
||||||
|
$ if libentry .eqs ".dummy"
|
||||||
|
$ then
|
||||||
|
$ write 'libwrch' " .BLKB 8" ! Dummy is zeroes...
|
||||||
|
$ else
|
||||||
|
$ write 'libwrch' " FTRANSFER_ENTRY ",libentry
|
||||||
|
$ endif
|
||||||
|
$ return
|
||||||
|
$! The record writer routine for VAX variables (should never happen!)
|
||||||
|
$ write_vax_psect_attr:
|
||||||
|
$ if info_kind .nes. "VARIABLE" then return
|
||||||
|
$ if libentry .eqs ".dummy" then return
|
||||||
|
$ write 'libwrch' "PSECT_ATTR=",libentry,",NOSHR"
|
||||||
|
$ return
|
||||||
|
$
|
||||||
|
$! ----- Common subroutines
|
||||||
|
$! -----
|
||||||
|
$! The .num file reader. This one has great responsability.
|
||||||
|
$ read_func_num:
|
||||||
|
$ open libnum 'libnum'
|
||||||
|
$ goto read_nums
|
||||||
|
$
|
||||||
|
$ read_nums:
|
||||||
|
$ libentrynum=0
|
||||||
|
$ liblastentry:=false
|
||||||
|
$ entrycount=0
|
||||||
|
$ loop:
|
||||||
|
$ read/end=loop_end/err=loop_end libnum line
|
||||||
|
$ entrynum=f$int(f$element(1," ",f$edit(line,"COMPRESS,TRIM")))
|
||||||
|
$ entryinfo=f$element(2," ",f$edit(line,"COMPRESS,TRIM"))
|
||||||
|
$ curentry=f$element(0," ",f$edit(line,"COMPRESS,TRIM"))
|
||||||
|
$ info_exist=f$element(0,":",entryinfo)
|
||||||
|
$ info_platforms=","+f$element(1,":",entryinfo)+","
|
||||||
|
$ info_kind=f$element(2,":",entryinfo)
|
||||||
|
$ info_algorithms=","+f$element(3,":",entryinfo)+","
|
||||||
|
$ if info_exist .eqs. "NOEXIST" then goto loop
|
||||||
|
$ truesum = 0
|
||||||
|
$ falsesum = 0
|
||||||
|
$ negatives = 1
|
||||||
|
$ plat_i = 0
|
||||||
|
$ loop1:
|
||||||
|
$ plat_entry = f$element(plat_i,",",info_platforms)
|
||||||
|
$ plat_i = plat_i + 1
|
||||||
|
$ if plat_entry .eqs. "" then goto loop1
|
||||||
|
$ if plat_entry .nes. ","
|
||||||
|
$ then
|
||||||
|
$ if f$extract(0,1,plat_entry) .nes. "!" then negatives = 0
|
||||||
|
$ if f$getsyi("CPU") .lt. 128
|
||||||
|
$ then
|
||||||
|
$ if plat_entry .eqs. "EXPORT_VAR_AS_FUNCTION" then -
|
||||||
|
$ truesum = truesum + 1
|
||||||
|
$ if plat_entry .eqs. "!EXPORT_VAR_AS_FUNCTION" then -
|
||||||
|
$ falsesum = falsesum + 1
|
||||||
|
$ endif
|
||||||
|
$ if plat_entry .eqs. "VMS" then truesum = truesum + 1
|
||||||
|
$ if plat_entry .eqs. "!VMS" then falsesum = falsesum + 1
|
||||||
|
$ goto loop1
|
||||||
|
$ endif
|
||||||
|
$ endloop1:
|
||||||
|
$!DEBUG!$ if info_platforms - "EXPORT_VAR_AS_FUNCTION" .nes. info_platforms
|
||||||
|
$!DEBUG!$ then
|
||||||
|
$!DEBUG!$ write sys$output line
|
||||||
|
$!DEBUG!$ write sys$output " truesum = ",truesum,-
|
||||||
|
$!DEBUG! ", negatives = ",negatives,", falsesum = ",falsesum
|
||||||
|
$!DEBUG!$ endif
|
||||||
|
$ if falsesum .ne. 0 then goto loop
|
||||||
|
$ if truesum+negatives .eq. 0 then goto loop
|
||||||
|
$ alg_i = 0
|
||||||
|
$ loop2:
|
||||||
|
$ alg_entry = f$element(alg_i,",",info_algorithms)
|
||||||
|
$ alg_i = alg_i + 1
|
||||||
|
$ if alg_entry .eqs. "" then goto loop2
|
||||||
|
$ if alg_entry .nes. ","
|
||||||
|
$ then
|
||||||
|
$ if alg_entry .eqs. "KRB5" then goto loop ! Special for now
|
||||||
|
$ if alg_entry .eqs. "STATIC_ENGINE" then goto loop ! Special for now
|
||||||
|
$ if f$trnlnm("OPENSSL_NO_"+alg_entry) .nes. "" then goto loop
|
||||||
|
$ goto loop2
|
||||||
|
$ endif
|
||||||
|
$ endloop2:
|
||||||
|
$ if info_platforms - "EXPORT_VAR_AS_FUNCTION" .nes. info_platforms
|
||||||
|
$ then
|
||||||
|
$!DEBUG!$ write sys$output curentry," ; ",entrynum," ; ",entryinfo
|
||||||
|
$ endif
|
||||||
|
$ redo:
|
||||||
|
$ next:=loop
|
||||||
|
$ tolibentry=curentry
|
||||||
|
$ if libentrynum .ne. entrynum
|
||||||
|
$ then
|
||||||
|
$ entrycount=entrycount+1
|
||||||
|
$ if entrycount .lt. entrynum
|
||||||
|
$ then
|
||||||
|
$!DEBUG!$ write sys$output "Info: entrycount: ''entrycount', entrynum: ''entrynum' => 0"
|
||||||
|
$ tolibentry=".dummy"
|
||||||
|
$ next:=redo
|
||||||
|
$ endif
|
||||||
|
$ if entrycount .gt. entrynum
|
||||||
|
$ then
|
||||||
|
$ write sys$error "Decreasing library entry numbers! Can't continue"
|
||||||
|
$ write sys$error """",line,""""
|
||||||
|
$ close libnum
|
||||||
|
$ return
|
||||||
|
$ endif
|
||||||
|
$ libentry=tolibentry
|
||||||
|
$!DEBUG!$ write sys$output entrycount," ",libentry," ",entryinfo
|
||||||
|
$ if libentry .nes. "" .and. libwriter .nes. "" then gosub 'libwriter'
|
||||||
|
$ else
|
||||||
|
$ write sys$error "Info: ""''curentry'"" is an alias for ""''libentry'"". Overriding..."
|
||||||
|
$ endif
|
||||||
|
$ libentrynum=entrycount
|
||||||
|
$ goto 'next'
|
||||||
|
$ loop_end:
|
||||||
|
$ close libnum
|
||||||
|
$ return
|
||||||
|
$
|
||||||
|
$! The version number reader
|
||||||
|
$ read_version_info:
|
||||||
|
$ libver = ""
|
||||||
|
$ open/read vf [.CRYPTO]OPENSSLV.H
|
||||||
|
$ loop_rvi:
|
||||||
|
$ read/err=endloop_rvi/end=endloop_rvi vf rvi_line
|
||||||
|
$ if rvi_line - "SHLIB_VERSION_NUMBER """ .eqs. rvi_line then -
|
||||||
|
goto loop_rvi
|
||||||
|
$ libverstr = f$element(1,"""",rvi_line)
|
||||||
|
$ libvmajor = f$element(0,".",libverstr)
|
||||||
|
$ libvminor = f$element(1,".",libverstr)
|
||||||
|
$ libvedit = f$element(2,".",libverstr)
|
||||||
|
$ libvpatch = f$cvui(0,8,f$extract(1,1,libvedit)+"@")-f$cvui(0,8,"@")
|
||||||
|
$ libvedit = f$extract(0,1,libvedit)
|
||||||
|
$ libver = f$string(f$int(libvmajor)*100)+","+-
|
||||||
|
f$string(f$int(libvminor)*100+f$int(libvedit)*10+f$int(libvpatch))
|
||||||
|
$ if libvmajor .eqs. "0"
|
||||||
|
$ then
|
||||||
|
$ libvmatch = "EQUAL"
|
||||||
|
$ else
|
||||||
|
$ ! Starting with the 1.0 release, backward compatibility should be
|
||||||
|
$ ! kept, so switch over to the following
|
||||||
|
$ libvmatch = "LEQUAL"
|
||||||
|
$ endif
|
||||||
|
$ endloop_rvi:
|
||||||
|
$ close vf
|
||||||
|
$ return
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
/* ====================================================================
|
|
||||||
* 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
|
|
||||||
* openssl-core@openssl.org.
|
|
||||||
*
|
|
||||||
* 5. Products derived from this software may not be called "OpenSSL"
|
|
||||||
* nor may "OpenSSL" appear in their names without prior written
|
|
||||||
* permission of the OpenSSL Project.
|
|
||||||
*
|
|
||||||
* 6. Redistributions of any form whatsoever must retain the following
|
|
||||||
* acknowledgment:
|
|
||||||
* "This product includes software developed by the OpenSSL Project
|
|
||||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
|
||||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
|
||||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
||||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
* ====================================================================
|
|
||||||
*
|
|
||||||
* This product includes cryptographic software written by Eric Young
|
|
||||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
|
||||||
* Hudson (tjh@cryptsoft.com).
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef HEADER_VMS_IDHACKS_H
|
|
||||||
#define HEADER_VMS_IDHACKS_H
|
|
||||||
|
|
||||||
#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_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
|
|
||||||
|
|
||||||
/* 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_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
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
#define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQUENCE
|
|
||||||
#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQUENCE
|
|
||||||
#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQUENCE
|
|
||||||
#define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQUENCE
|
|
||||||
|
|
||||||
/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */
|
|
||||||
#define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO
|
|
||||||
#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_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 */
|
|
||||||
|
|
||||||
#endif /* ! defined HEADER_VMS_IDHACKS_H */
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
# things easier between now and when Eric is convinced to fix it :-)
|
# things easier between now and when Eric is convinced to fix it :-)
|
||||||
#
|
#
|
||||||
# CA -newca ... will setup the right stuff
|
# CA -newca ... will setup the right stuff
|
||||||
# CA -newreq ... will generate a certificate request
|
# CA -newreq[-nodes] ... will generate a certificate request
|
||||||
# CA -sign ... will sign the generated request and output
|
# CA -sign ... will sign the generated request and output
|
||||||
#
|
#
|
||||||
# At the end of that grab newreq.pem and newcert.pem (one has the key
|
# At the end of that grab newreq.pem and newcert.pem (one has the key
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
# default openssl.cnf file has setup as per the following
|
# default openssl.cnf file has setup as per the following
|
||||||
# demoCA ... where everything is stored
|
# demoCA ... where everything is stored
|
||||||
|
|
||||||
|
$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"};
|
||||||
$DAYS="-days 365";
|
$DAYS="-days 365";
|
||||||
$REQ="openssl req $SSLEAY_CONFIG";
|
$REQ="openssl req $SSLEAY_CONFIG";
|
||||||
$CA="openssl ca $SSLEAY_CONFIG";
|
$CA="openssl ca $SSLEAY_CONFIG";
|
||||||
@@ -53,7 +54,7 @@ $RET = 0;
|
|||||||
|
|
||||||
foreach (@ARGV) {
|
foreach (@ARGV) {
|
||||||
if ( /^(-\?|-h|-help)$/ ) {
|
if ( /^(-\?|-h|-help)$/ ) {
|
||||||
print STDERR "usage: CA -newcert|-newreq|-newca|-sign|-verify\n";
|
print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
|
||||||
exit 0;
|
exit 0;
|
||||||
} elsif (/^-newcert$/) {
|
} elsif (/^-newcert$/) {
|
||||||
# create a certificate
|
# create a certificate
|
||||||
@@ -65,6 +66,11 @@ foreach (@ARGV) {
|
|||||||
system ("$REQ -new -keyout newreq.pem -out newreq.pem $DAYS");
|
system ("$REQ -new -keyout newreq.pem -out newreq.pem $DAYS");
|
||||||
$RET=$?;
|
$RET=$?;
|
||||||
print "Request (and private key) is in newreq.pem\n";
|
print "Request (and private key) is in newreq.pem\n";
|
||||||
|
} elsif (/^-newreq-nodes$/) {
|
||||||
|
# create a certificate request
|
||||||
|
system ("$REQ -new -nodes -keyout newreq.pem -out newreq.pem $DAYS");
|
||||||
|
$RET=$?;
|
||||||
|
print "Request (and private key) is in newreq.pem\n";
|
||||||
} elsif (/^-newca$/) {
|
} elsif (/^-newca$/) {
|
||||||
# if explicitly 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
|
# directory structure that Eric likes to manage things
|
||||||
@@ -116,6 +122,11 @@ foreach (@ARGV) {
|
|||||||
"-infiles newreq.pem");
|
"-infiles newreq.pem");
|
||||||
$RET=$?;
|
$RET=$?;
|
||||||
print "Signed certificate is in newcert.pem\n";
|
print "Signed certificate is in newcert.pem\n";
|
||||||
|
} elsif (/^(-signCA)$/) {
|
||||||
|
system ("$CA -policy policy_anything -out newcert.pem " .
|
||||||
|
"-extensions v3_ca -infiles newreq.pem");
|
||||||
|
$RET=$?;
|
||||||
|
print "Signed CA certificate is in newcert.pem\n";
|
||||||
} elsif (/^-signcert$/) {
|
} elsif (/^-signcert$/) {
|
||||||
system ("$X509 -x509toreq -in newreq.pem -signkey newreq.pem " .
|
system ("$X509 -x509toreq -in newreq.pem -signkey newreq.pem " .
|
||||||
"-out tmp.pem");
|
"-out tmp.pem");
|
||||||
@@ -137,7 +148,7 @@ foreach (@ARGV) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print STDERR "Unknown arg $_\n";
|
print STDERR "Unknown arg $_\n";
|
||||||
print STDERR "usage: CA -newcert|-newreq|-newca|-sign|-verify\n";
|
print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1434
apps/Makefile.ssl
1434
apps/Makefile.ssl
File diff suppressed because it is too large
Load Diff
@@ -124,7 +124,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
|
|||||||
int consider_randfile = (file == NULL);
|
int consider_randfile = (file == NULL);
|
||||||
char buffer[200];
|
char buffer[200];
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
BIO_printf(bio_e,"Loading 'screen' into random state -");
|
BIO_printf(bio_e,"Loading 'screen' into random state -");
|
||||||
BIO_flush(bio_e);
|
BIO_flush(bio_e);
|
||||||
RAND_screen();
|
RAND_screen();
|
||||||
@@ -142,7 +142,9 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
|
|||||||
}
|
}
|
||||||
if (file == NULL || !RAND_load_file(file, -1))
|
if (file == NULL || !RAND_load_file(file, -1))
|
||||||
{
|
{
|
||||||
if (RAND_status() == 0 && !dont_warn)
|
if (RAND_status() == 0)
|
||||||
|
{
|
||||||
|
if (!dont_warn)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_e,"unable to load 'random state'\n");
|
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,"This means that the random number generator has not been seeded\n");
|
||||||
@@ -155,6 +157,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
seeded = 1;
|
seeded = 1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -177,7 +180,9 @@ long app_RAND_load_files(char *name)
|
|||||||
if (*n == '\0') break;
|
if (*n == '\0') break;
|
||||||
|
|
||||||
egd=RAND_egd(n);
|
egd=RAND_egd(n);
|
||||||
if (egd > 0) tot+=egd;
|
if (egd > 0)
|
||||||
|
tot+=egd;
|
||||||
|
else
|
||||||
tot+=RAND_load_file(n,-1);
|
tot+=RAND_load_file(n,-1);
|
||||||
if (last) break;
|
if (last) break;
|
||||||
}
|
}
|
||||||
|
|||||||
1060
apps/apps.c
1060
apps/apps.c
File diff suppressed because it is too large
Load Diff
155
apps/apps.h
155
apps/apps.h
@@ -55,16 +55,74 @@
|
|||||||
* copied and put under another distribution licence
|
* copied and put under another distribution licence
|
||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef HEADER_APPS_H
|
#ifndef HEADER_APPS_H
|
||||||
#define HEADER_APPS_H
|
#define HEADER_APPS_H
|
||||||
|
|
||||||
#include "openssl/e_os.h"
|
#include "e_os.h"
|
||||||
|
|
||||||
#include <openssl/buffer.h>
|
#include <openssl/buffer.h>
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
|
#include <openssl/lhash.h>
|
||||||
|
#include <openssl/conf.h>
|
||||||
|
#include <openssl/txt_db.h>
|
||||||
|
#include <openssl/engine.h>
|
||||||
|
#include <openssl/ossl_typ.h>
|
||||||
|
|
||||||
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
|
int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
|
||||||
int app_RAND_write_file(const char *file, BIO *bio_e);
|
int app_RAND_write_file(const char *file, BIO *bio_e);
|
||||||
@@ -76,30 +134,33 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read,
|
|||||||
* (see e_os.h). The string is
|
* (see e_os.h). The string is
|
||||||
* destroyed! */
|
* destroyed! */
|
||||||
|
|
||||||
#ifdef NO_STDIO
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
BIO_METHOD *BIO_s_file();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define rename(from,to) WIN32_rename((from),(to))
|
#define rename(from,to) WIN32_rename((from),(to))
|
||||||
int WIN32_rename(char *oldname,char *newname);
|
int WIN32_rename(char *oldname,char *newname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* VMS below version 7.0 doesn't have strcasecmp() */
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
#define strcasecmp(str1,str2) VMS_strcasecmp((str1),(str2))
|
||||||
|
int VMS_strcasecmp(const char *str1, const char *str2);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef MONOLITH
|
#ifndef MONOLITH
|
||||||
|
|
||||||
#define MAIN(a,v) main(a,v)
|
#define MAIN(a,v) main(a,v)
|
||||||
|
|
||||||
#ifndef NON_MAIN
|
#ifndef NON_MAIN
|
||||||
|
CONF *config=NULL;
|
||||||
BIO *bio_err=NULL;
|
BIO *bio_err=NULL;
|
||||||
#else
|
#else
|
||||||
|
extern CONF *config;
|
||||||
extern BIO *bio_err;
|
extern BIO *bio_err;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define MAIN(a,v) PROG(a,v)
|
#define MAIN(a,v) PROG(a,v)
|
||||||
#include <openssl/conf.h>
|
extern CONF *config;
|
||||||
extern LHASH *config;
|
|
||||||
extern char *default_config_file;
|
extern char *default_config_file;
|
||||||
extern BIO *bio_err;
|
extern BIO *bio_err;
|
||||||
|
|
||||||
@@ -114,21 +175,34 @@ extern BIO *bio_err;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MONOLITH) && !defined(OPENSSL_C)
|
#if defined(MONOLITH) && !defined(OPENSSL_C)
|
||||||
# define apps_startup() do_pipe_sig()
|
# define apps_startup() \
|
||||||
|
do_pipe_sig()
|
||||||
|
# define apps_shutdown()
|
||||||
#else
|
#else
|
||||||
# if defined(MSDOS) || defined(WIN16) || defined(WIN32)
|
# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
|
||||||
|
defined(OPENSSL_SYS_WIN32)
|
||||||
# ifdef _O_BINARY
|
# ifdef _O_BINARY
|
||||||
# define apps_startup() \
|
# define apps_startup() \
|
||||||
_fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||||
SSLeay_add_all_algorithms()
|
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||||
|
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
||||||
# else
|
# else
|
||||||
# define apps_startup() \
|
# define apps_startup() \
|
||||||
_fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
|
||||||
SSLeay_add_all_algorithms()
|
ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
|
||||||
|
ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
# define apps_startup() do_pipe_sig(); SSLeay_add_all_algorithms();
|
# define apps_startup() \
|
||||||
|
do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
|
||||||
|
ERR_load_crypto_strings(); ENGINE_load_builtin_engines(); \
|
||||||
|
setup_ui_method(); } while(0)
|
||||||
# endif
|
# endif
|
||||||
|
# define apps_shutdown() \
|
||||||
|
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||||
|
EVP_cleanup(); ENGINE_cleanup(); \
|
||||||
|
CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
|
||||||
|
ERR_free_strings(); } while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct args_st
|
typedef struct args_st
|
||||||
@@ -137,6 +211,19 @@ typedef struct args_st
|
|||||||
int count;
|
int count;
|
||||||
} ARGS;
|
} ARGS;
|
||||||
|
|
||||||
|
#define PW_MIN_LENGTH 4
|
||||||
|
typedef struct pw_cb_data
|
||||||
|
{
|
||||||
|
const void *password;
|
||||||
|
const char *prompt_info;
|
||||||
|
} PW_CB_DATA;
|
||||||
|
|
||||||
|
int password_callback(char *buf, int bufsiz, int verify,
|
||||||
|
PW_CB_DATA *cb_data);
|
||||||
|
|
||||||
|
int setup_ui_method(void);
|
||||||
|
void destroy_ui_method(void);
|
||||||
|
|
||||||
int should_retry(int i);
|
int should_retry(int i);
|
||||||
int args_from_file(char *file, int *argc, char **argv[]);
|
int args_from_file(char *file, int *argc, char **argv[]);
|
||||||
int str2fmt(char *s);
|
int str2fmt(char *s);
|
||||||
@@ -144,13 +231,51 @@ void program_name(char *in,char *out,int size);
|
|||||||
int chopup_args(ARGS *arg,char *buf, int *argc, char **argv[]);
|
int chopup_args(ARGS *arg,char *buf, int *argc, char **argv[]);
|
||||||
#ifdef HEADER_X509_H
|
#ifdef HEADER_X509_H
|
||||||
int dump_cert_text(BIO *out, X509 *x);
|
int dump_cert_text(BIO *out, X509 *x);
|
||||||
|
void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags);
|
||||||
#endif
|
#endif
|
||||||
|
int set_cert_ex(unsigned long *flags, const char *arg);
|
||||||
|
int set_name_ex(unsigned long *flags, const char *arg);
|
||||||
|
int set_ext_copy(int *copy_type, const char *arg);
|
||||||
|
int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
|
||||||
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
|
int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
|
||||||
|
int add_oid_section(BIO *err, CONF *conf);
|
||||||
|
X509 *load_cert(BIO *err, const char *file, int format,
|
||||||
|
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||||
|
EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
||||||
|
const char *pass, ENGINE *e, const char *key_descrip);
|
||||||
|
EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
|
||||||
|
const char *pass, ENGINE *e, const char *key_descrip);
|
||||||
|
STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
|
||||||
|
const char *pass, ENGINE *e, const char *cert_descrip);
|
||||||
|
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
|
||||||
|
ENGINE *setup_engine(BIO *err, const char *engine, int debug);
|
||||||
|
|
||||||
|
int load_config(BIO *err, CONF *cnf);
|
||||||
|
char *make_config_name(void);
|
||||||
|
|
||||||
|
/* Functions defined in ca.c and also used in ocsp.c */
|
||||||
|
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
|
||||||
|
ASN1_GENERALIZEDTIME **pinvtm, char *str);
|
||||||
|
int make_serial_index(TXT_DB *db);
|
||||||
|
|
||||||
|
X509_NAME *do_subject(char *str, long chtype);
|
||||||
|
|
||||||
#define FORMAT_UNDEF 0
|
#define FORMAT_UNDEF 0
|
||||||
#define FORMAT_ASN1 1
|
#define FORMAT_ASN1 1
|
||||||
#define FORMAT_TEXT 2
|
#define FORMAT_TEXT 2
|
||||||
#define FORMAT_PEM 3
|
#define FORMAT_PEM 3
|
||||||
#define FORMAT_NETSCAPE 4
|
#define FORMAT_NETSCAPE 4
|
||||||
|
#define FORMAT_PKCS12 5
|
||||||
|
#define FORMAT_SMIME 6
|
||||||
|
#define FORMAT_ENGINE 7
|
||||||
|
#define FORMAT_IISSGC 8 /* XXX this stupid macro helps us to avoid
|
||||||
|
* adding yet another param to load_*key() */
|
||||||
|
|
||||||
|
#define EXT_COPY_NONE 0
|
||||||
|
#define EXT_COPY_ADD 1
|
||||||
|
#define EXT_COPY_ALL 2
|
||||||
|
|
||||||
|
#define NETSCAPE_CERT_HDR "certificate"
|
||||||
|
|
||||||
#define APP_PASS_LEN 1024
|
#define APP_PASS_LEN 1024
|
||||||
|
|
||||||
|
|||||||
123
apps/asn1pars.c
123
apps/asn1pars.c
@@ -82,14 +82,17 @@
|
|||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
|
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i,badops=0,offset=0,ret=1,j;
|
int i,badops=0,offset=0,ret=1,j;
|
||||||
unsigned int length=0;
|
unsigned int length=0;
|
||||||
long num,tmplen;
|
long num,tmplen;
|
||||||
BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL;
|
BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL;
|
||||||
int informat,indent=0, noout = 0;
|
int informat,indent=0, noout = 0, dump = 0;
|
||||||
char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
|
char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
|
||||||
|
char *genstr=NULL, *genconf=NULL;
|
||||||
unsigned char *tmpbuf;
|
unsigned char *tmpbuf;
|
||||||
BUF_MEM *buf=NULL;
|
BUF_MEM *buf=NULL;
|
||||||
STACK *osk=NULL;
|
STACK *osk=NULL;
|
||||||
@@ -103,12 +106,15 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
prog=argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
if ((osk=sk_new_null()) == NULL)
|
if ((osk=sk_new_null()) == NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"Malloc failure\n");
|
BIO_printf(bio_err,"Memory allocation failure\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
while (argc >= 1)
|
while (argc >= 1)
|
||||||
@@ -149,11 +155,31 @@ int MAIN(int argc, char **argv)
|
|||||||
length= atoi(*(++argv));
|
length= atoi(*(++argv));
|
||||||
if (length == 0) goto bad;
|
if (length == 0) goto bad;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-dump") == 0)
|
||||||
|
{
|
||||||
|
dump= -1;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-dlimit") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
dump= atoi(*(++argv));
|
||||||
|
if (dump <= 0) goto bad;
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-strparse") == 0)
|
else if (strcmp(*argv,"-strparse") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
sk_push(osk,*(++argv));
|
sk_push(osk,*(++argv));
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-genstr") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
genstr= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-genconf") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
genconf= *(++argv);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
@@ -171,16 +197,19 @@ bad:
|
|||||||
BIO_printf(bio_err,"where options are\n");
|
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," -inform arg input format - one of DER TXT PEM\n");
|
||||||
BIO_printf(bio_err," -in arg input file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
BIO_printf(bio_err," -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file (output format is always DER\n");
|
||||||
BIO_printf(bio_err," -noout arg don't produce any output\n");
|
BIO_printf(bio_err," -noout arg don't produce any output\n");
|
||||||
BIO_printf(bio_err," -offset arg offset into file\n");
|
BIO_printf(bio_err," -offset arg offset into file\n");
|
||||||
BIO_printf(bio_err," -length arg length 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," -i indent entries\n");
|
||||||
|
BIO_printf(bio_err," -dump dump unknown data in hex form\n");
|
||||||
|
BIO_printf(bio_err," -dlimit arg dump the first arg bytes of unknown data in hex form\n");
|
||||||
BIO_printf(bio_err," -oid file file of extra oid definitions\n");
|
BIO_printf(bio_err," -oid file file of extra oid definitions\n");
|
||||||
BIO_printf(bio_err," -strparse offset\n");
|
BIO_printf(bio_err," -strparse offset\n");
|
||||||
BIO_printf(bio_err," a series of these can be used to 'dig' into multiple\n");
|
BIO_printf(bio_err," a series of these can be used to 'dig' into multiple\n");
|
||||||
BIO_printf(bio_err," ASN1 blob wrappings\n");
|
BIO_printf(bio_err," ASN1 blob wrappings\n");
|
||||||
BIO_printf(bio_err," -out filename output DER encoding to file\n");
|
BIO_printf(bio_err," -genstr str string to generate ASN1 structure from\n");
|
||||||
|
BIO_printf(bio_err," -genconf file file to generate ASN1 structure from\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,6 +223,12 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (oidfile != NULL)
|
if (oidfile != NULL)
|
||||||
{
|
{
|
||||||
@@ -228,6 +263,19 @@ bad:
|
|||||||
if ((buf=BUF_MEM_new()) == NULL) goto end;
|
if ((buf=BUF_MEM_new()) == NULL) goto end;
|
||||||
if (!BUF_MEM_grow(buf,BUFSIZ*8)) goto end; /* Pre-allocate :-) */
|
if (!BUF_MEM_grow(buf,BUFSIZ*8)) goto end; /* Pre-allocate :-) */
|
||||||
|
|
||||||
|
if (genstr || genconf)
|
||||||
|
{
|
||||||
|
num = do_generate(bio_err, genstr, genconf, buf);
|
||||||
|
if (num < 0)
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
if (informat == FORMAT_PEM)
|
if (informat == FORMAT_PEM)
|
||||||
{
|
{
|
||||||
BIO *tmp;
|
BIO *tmp;
|
||||||
@@ -248,6 +296,7 @@ bad:
|
|||||||
if (i <= 0) break;
|
if (i <= 0) break;
|
||||||
num+=i;
|
num+=i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
str=buf->data;
|
str=buf->data;
|
||||||
|
|
||||||
/* If any structs to parse go through in sequence */
|
/* If any structs to parse go through in sequence */
|
||||||
@@ -293,7 +342,8 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!noout &&
|
if (!noout &&
|
||||||
!ASN1_parse(out,(unsigned char *)&(str[offset]),length,indent))
|
!ASN1_parse_dump(out,(unsigned char *)&(str[offset]),length,
|
||||||
|
indent,dump))
|
||||||
{
|
{
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
@@ -302,7 +352,7 @@ bad:
|
|||||||
end:
|
end:
|
||||||
BIO_free(derout);
|
BIO_free(derout);
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (b64 != NULL) BIO_free(b64);
|
if (b64 != NULL) BIO_free(b64);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
@@ -310,6 +360,65 @@ end:
|
|||||||
if (at != NULL) ASN1_TYPE_free(at);
|
if (at != NULL) ASN1_TYPE_free(at);
|
||||||
if (osk != NULL) sk_free(osk);
|
if (osk != NULL) sk_free(osk);
|
||||||
OBJ_cleanup();
|
OBJ_cleanup();
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
|
||||||
|
{
|
||||||
|
CONF *cnf = NULL;
|
||||||
|
int len;
|
||||||
|
long errline;
|
||||||
|
unsigned char *p;
|
||||||
|
ASN1_TYPE *atyp = NULL;
|
||||||
|
|
||||||
|
if (genconf)
|
||||||
|
{
|
||||||
|
cnf = NCONF_new(NULL);
|
||||||
|
if (!NCONF_load(cnf, genconf, &errline))
|
||||||
|
goto conferr;
|
||||||
|
if (!genstr)
|
||||||
|
genstr = NCONF_get_string(cnf, "default", "asn1");
|
||||||
|
if (!genstr)
|
||||||
|
{
|
||||||
|
BIO_printf(bio, "Can't find 'asn1' in '%s'\n", genconf);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
atyp = ASN1_generate_nconf(genstr, cnf);
|
||||||
|
NCONF_free(cnf);
|
||||||
|
|
||||||
|
if (!atyp)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
len = i2d_ASN1_TYPE(atyp, NULL);
|
||||||
|
|
||||||
|
if (len <= 0)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
if (!BUF_MEM_grow(buf,len))
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
p=(unsigned char *)buf->data;
|
||||||
|
|
||||||
|
i2d_ASN1_TYPE(atyp, &p);
|
||||||
|
|
||||||
|
ASN1_TYPE_free(atyp);
|
||||||
|
return len;
|
||||||
|
|
||||||
|
conferr:
|
||||||
|
|
||||||
|
if (errline > 0)
|
||||||
|
BIO_printf(bio, "Error on line %ld of config file '%s'\n",
|
||||||
|
errline, genconf);
|
||||||
|
else
|
||||||
|
BIO_printf(bio, "Error loading config file '%s'\n", genconf);
|
||||||
|
|
||||||
|
err:
|
||||||
|
NCONF_free(cnf);
|
||||||
|
ASN1_TYPE_free(atyp);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
05
|
07
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef NO_STDIO
|
#ifdef OPENSSL_NO_STDIO
|
||||||
#define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
@@ -74,6 +74,7 @@ static char *ciphers_usage[]={
|
|||||||
" -v - verbose mode, a textual listing of the ciphers in SSLeay\n",
|
" -v - verbose mode, a textual listing of the ciphers in SSLeay\n",
|
||||||
" -ssl2 - SSL2 mode\n",
|
" -ssl2 - SSL2 mode\n",
|
||||||
" -ssl3 - SSL3 mode\n",
|
" -ssl3 - SSL3 mode\n",
|
||||||
|
" -tls1 - TLS1 mode\n",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -94,11 +95,11 @@ int MAIN(int argc, char **argv)
|
|||||||
char buf[512];
|
char buf[512];
|
||||||
BIO *STDout=NULL;
|
BIO *STDout=NULL;
|
||||||
|
|
||||||
#if !defined(NO_SSL2) && !defined(NO_SSL3)
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
meth=SSLv23_server_method();
|
meth=SSLv23_server_method();
|
||||||
#elif !defined(NO_SSL3)
|
#elif !defined(OPENSSL_NO_SSL3)
|
||||||
meth=SSLv3_server_method();
|
meth=SSLv3_server_method();
|
||||||
#elif !defined(NO_SSL2)
|
#elif !defined(OPENSSL_NO_SSL2)
|
||||||
meth=SSLv2_server_method();
|
meth=SSLv2_server_method();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -107,6 +108,12 @@ int MAIN(int argc, char **argv)
|
|||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
|
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
STDout = BIO_push(tmpbio, STDout);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
@@ -114,13 +121,17 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if (strcmp(*argv,"-v") == 0)
|
if (strcmp(*argv,"-v") == 0)
|
||||||
verbose=1;
|
verbose=1;
|
||||||
#ifndef NO_SSL2
|
#ifndef OPENSSL_NO_SSL2
|
||||||
else if (strcmp(*argv,"-ssl2") == 0)
|
else if (strcmp(*argv,"-ssl2") == 0)
|
||||||
meth=SSLv2_client_method();
|
meth=SSLv2_client_method();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SSL3
|
#ifndef OPENSSL_NO_SSL3
|
||||||
else if (strcmp(*argv,"-ssl3") == 0)
|
else if (strcmp(*argv,"-ssl3") == 0)
|
||||||
meth=SSLv3_client_method();
|
meth=SSLv3_client_method();
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_TLS1
|
||||||
|
else if (strcmp(*argv,"-tls1") == 0)
|
||||||
|
meth=TLSv1_client_method();
|
||||||
#endif
|
#endif
|
||||||
else if ((strncmp(*argv,"-h",2) == 0) ||
|
else if ((strncmp(*argv,"-h",2) == 0) ||
|
||||||
(strcmp(*argv,"-?") == 0))
|
(strcmp(*argv,"-?") == 0))
|
||||||
@@ -139,7 +150,7 @@ int MAIN(int argc, char **argv)
|
|||||||
if (badops)
|
if (badops)
|
||||||
{
|
{
|
||||||
for (pp=ciphers_usage; (*pp != NULL); pp++)
|
for (pp=ciphers_usage; (*pp != NULL); pp++)
|
||||||
BIO_printf(bio_err,*pp);
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +187,7 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
BIO_puts(STDout,SSL_CIPHER_description(
|
BIO_puts(STDout,SSL_CIPHER_description(
|
||||||
sk_SSL_CIPHER_value(sk,i),
|
sk_SSL_CIPHER_value(sk,i),
|
||||||
buf,512));
|
buf,sizeof buf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +201,8 @@ err:
|
|||||||
end:
|
end:
|
||||||
if (ctx != NULL) SSL_CTX_free(ctx);
|
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||||
if (ssl != NULL) SSL_free(ssl);
|
if (ssl != NULL) SSL_free(ssl);
|
||||||
if (STDout != NULL) BIO_free(STDout);
|
if (STDout != NULL) BIO_free_all(STDout);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
76
apps/crl.c
76
apps/crl.c
@@ -87,6 +87,7 @@ static char *crl_usage[]={
|
|||||||
" -noout - no CRL output\n",
|
" -noout - no CRL output\n",
|
||||||
" -CAfile name - verify CRL using certificates in file \"name\"\n",
|
" -CAfile name - verify CRL using certificates in file \"name\"\n",
|
||||||
" -CApath dir - verify CRL using certificates in \"dir\"\n",
|
" -CApath dir - verify CRL using certificates in \"dir\"\n",
|
||||||
|
" -nameopt arg - various certificate name options\n",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
unsigned long nmflag = 0;
|
||||||
X509_CRL *x=NULL;
|
X509_CRL *x=NULL;
|
||||||
char *CAfile = NULL, *CApath = NULL;
|
char *CAfile = NULL, *CApath = NULL;
|
||||||
int ret=1,i,num,badops=0;
|
int ret=1,i,num,badops=0;
|
||||||
@@ -104,13 +106,15 @@ int MAIN(int argc, char **argv)
|
|||||||
int informat,outformat;
|
int informat,outformat;
|
||||||
char *infile=NULL,*outfile=NULL;
|
char *infile=NULL,*outfile=NULL;
|
||||||
int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
|
int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
|
||||||
char **pp,buf[256];
|
int fingerprint = 0;
|
||||||
|
char **pp;
|
||||||
X509_STORE *store = NULL;
|
X509_STORE *store = NULL;
|
||||||
X509_STORE_CTX ctx;
|
X509_STORE_CTX ctx;
|
||||||
X509_LOOKUP *lookup = NULL;
|
X509_LOOKUP *lookup = NULL;
|
||||||
X509_OBJECT xobj;
|
X509_OBJECT xobj;
|
||||||
EVP_PKEY *pkey;
|
EVP_PKEY *pkey;
|
||||||
int do_ver = 0;
|
int do_ver = 0;
|
||||||
|
const EVP_MD *md_alg,*digest=EVP_md5();
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -118,9 +122,20 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
if (bio_out == NULL)
|
if (bio_out == NULL)
|
||||||
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_out=BIO_new(BIO_s_file())) != NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(bio_out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
bio_out = BIO_push(tmpbio, bio_out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat=FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
@@ -175,6 +190,11 @@ int MAIN(int argc, char **argv)
|
|||||||
text = 1;
|
text = 1;
|
||||||
else if (strcmp(*argv,"-hash") == 0)
|
else if (strcmp(*argv,"-hash") == 0)
|
||||||
hash= ++num;
|
hash= ++num;
|
||||||
|
else if (strcmp(*argv,"-nameopt") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
if (!set_name_ex(&nmflag, *(++argv))) goto bad;
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-issuer") == 0)
|
else if (strcmp(*argv,"-issuer") == 0)
|
||||||
issuer= ++num;
|
issuer= ++num;
|
||||||
else if (strcmp(*argv,"-lastupdate") == 0)
|
else if (strcmp(*argv,"-lastupdate") == 0)
|
||||||
@@ -183,6 +203,13 @@ int MAIN(int argc, char **argv)
|
|||||||
nextupdate= ++num;
|
nextupdate= ++num;
|
||||||
else if (strcmp(*argv,"-noout") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
noout= ++num;
|
noout= ++num;
|
||||||
|
else if (strcmp(*argv,"-fingerprint") == 0)
|
||||||
|
fingerprint= ++num;
|
||||||
|
else if ((md_alg=EVP_get_digestbyname(*argv + 1)))
|
||||||
|
{
|
||||||
|
/* ok */
|
||||||
|
digest=md_alg;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
@@ -197,7 +224,7 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
bad:
|
bad:
|
||||||
for (pp=crl_usage; (*pp != NULL); pp++)
|
for (pp=crl_usage; (*pp != NULL); pp++)
|
||||||
BIO_printf(bio_err,*pp);
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +245,11 @@ bad:
|
|||||||
X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
|
|
||||||
X509_STORE_CTX_init(&ctx, store, NULL, NULL);
|
if(!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) {
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"Error initialising X509 store\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
i = X509_STORE_get_by_subject(&ctx, X509_LU_X509,
|
i = X509_STORE_get_by_subject(&ctx, X509_LU_X509,
|
||||||
X509_CRL_get_issuer(x), &xobj);
|
X509_CRL_get_issuer(x), &xobj);
|
||||||
@@ -247,9 +278,7 @@ bad:
|
|||||||
{
|
{
|
||||||
if (issuer == i)
|
if (issuer == i)
|
||||||
{
|
{
|
||||||
X509_NAME_oneline(X509_CRL_get_issuer(x),
|
print_name(bio_out, "issuer=", X509_CRL_get_issuer(x), nmflag);
|
||||||
buf,256);
|
|
||||||
BIO_printf(bio_out,"issuer= %s\n",buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hash == i)
|
if (hash == i)
|
||||||
@@ -274,6 +303,26 @@ bad:
|
|||||||
BIO_printf(bio_out,"NONE");
|
BIO_printf(bio_out,"NONE");
|
||||||
BIO_printf(bio_out,"\n");
|
BIO_printf(bio_out,"\n");
|
||||||
}
|
}
|
||||||
|
if (fingerprint == i)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
unsigned int n;
|
||||||
|
unsigned char md[EVP_MAX_MD_SIZE];
|
||||||
|
|
||||||
|
if (!X509_CRL_digest(x,digest,md,&n))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"out of memory\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
BIO_printf(bio_out,"%s Fingerprint=",
|
||||||
|
OBJ_nid2sn(EVP_MD_type(digest)));
|
||||||
|
for (j=0; j<(int)n; j++)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out,"%02X%c",md[j],
|
||||||
|
(j+1 == (int)n)
|
||||||
|
?'\n':':');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +334,15 @@ bad:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -311,15 +368,16 @@ bad:
|
|||||||
if (!i) { BIO_printf(bio_err,"unable to write CRL\n"); goto end; }
|
if (!i) { BIO_printf(bio_err,"unable to write CRL\n"); goto end; }
|
||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
BIO_free(bio_out);
|
BIO_free_all(bio_out);
|
||||||
bio_out=NULL;
|
bio_out=NULL;
|
||||||
X509_CRL_free(x);
|
X509_CRL_free(x);
|
||||||
if(store) {
|
if(store) {
|
||||||
X509_STORE_CTX_cleanup(&ctx);
|
X509_STORE_CTX_cleanup(&ctx);
|
||||||
X509_STORE_free(store);
|
X509_STORE_free(store);
|
||||||
}
|
}
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static X509_CRL *load_crl(char *infile, int format)
|
static X509_CRL *load_crl(char *infile, int format)
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ int MAIN(int argc, char **argv)
|
|||||||
else if (strcmp(*argv,"-certfile") == 0)
|
else if (strcmp(*argv,"-certfile") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
if(!certflst) certflst = sk_new(NULL);
|
if(!certflst) certflst = sk_new_null();
|
||||||
sk_push(certflst,*(++argv));
|
sk_push(certflst,*(++argv));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -166,7 +166,8 @@ bad:
|
|||||||
BIO_printf(bio_err," -certfile arg certificates file of chain to a trusted CA\n");
|
BIO_printf(bio_err," -certfile arg certificates file of chain to a trusted CA\n");
|
||||||
BIO_printf(bio_err," (can be used more than once)\n");
|
BIO_printf(bio_err," (can be used more than once)\n");
|
||||||
BIO_printf(bio_err," -nocrl no crl to load, just certs from '-certfile'\n");
|
BIO_printf(bio_err," -nocrl no crl to load, just certs from '-certfile'\n");
|
||||||
EXIT(1);
|
ret = 1;
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
@@ -215,15 +216,15 @@ bad:
|
|||||||
p7s->contents->type=OBJ_nid2obj(NID_pkcs7_data);
|
p7s->contents->type=OBJ_nid2obj(NID_pkcs7_data);
|
||||||
|
|
||||||
if (!ASN1_INTEGER_set(p7s->version,1)) goto end;
|
if (!ASN1_INTEGER_set(p7s->version,1)) goto end;
|
||||||
if ((crl_stack=sk_X509_CRL_new(NULL)) == NULL) goto end;
|
if ((crl_stack=sk_X509_CRL_new_null()) == NULL) goto end;
|
||||||
p7s->crl=crl_stack;
|
p7s->crl=crl_stack;
|
||||||
if (crl != NULL)
|
if (crl != NULL)
|
||||||
{
|
{
|
||||||
sk_X509_CRL_push(crl_stack,crl);
|
sk_X509_CRL_push(crl_stack,crl);
|
||||||
crl=NULL; /* now part of p7 for Freeing */
|
crl=NULL; /* now part of p7 for OPENSSL_freeing */
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cert_stack=sk_X509_new(NULL)) == NULL) goto end;
|
if ((cert_stack=sk_X509_new_null()) == NULL) goto end;
|
||||||
p7s->cert=cert_stack;
|
p7s->cert=cert_stack;
|
||||||
|
|
||||||
if(certflst) for(i = 0; i < sk_num(certflst); i++) {
|
if(certflst) for(i = 0; i < sk_num(certflst); i++) {
|
||||||
@@ -239,7 +240,15 @@ bad:
|
|||||||
sk_free(certflst);
|
sk_free(certflst);
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -266,11 +275,12 @@ bad:
|
|||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (p7 != NULL) PKCS7_free(p7);
|
if (p7 != NULL) PKCS7_free(p7);
|
||||||
if (crl != NULL) X509_CRL_free(crl);
|
if (crl != NULL) X509_CRL_free(crl);
|
||||||
|
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -327,7 +337,7 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
|
|||||||
|
|
||||||
ret=count;
|
ret=count;
|
||||||
end:
|
end:
|
||||||
/* never need to Free x */
|
/* never need to OPENSSL_free x */
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (sk != NULL) sk_X509_INFO_free(sk);
|
if (sk != NULL) sk_X509_INFO_free(sk);
|
||||||
return(ret);
|
return(ret);
|
||||||
|
|||||||
247
apps/dgst.c
247
apps/dgst.c
@@ -73,26 +73,38 @@
|
|||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG dgst_main
|
#define PROG dgst_main
|
||||||
|
|
||||||
void do_fp(unsigned char *buf,BIO *f,int sep);
|
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||||
|
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||||
|
const char *file);
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
unsigned char *buf=NULL;
|
unsigned char *buf=NULL;
|
||||||
int i,err=0;
|
int i,err=0;
|
||||||
const EVP_MD *md=NULL,*m;
|
const EVP_MD *md=NULL,*m;
|
||||||
BIO *in=NULL,*inp;
|
BIO *in=NULL,*inp;
|
||||||
BIO *bmd=NULL;
|
BIO *bmd=NULL;
|
||||||
|
BIO *out = NULL;
|
||||||
const char *name;
|
const char *name;
|
||||||
#define PROG_NAME_SIZE 16
|
#define PROG_NAME_SIZE 39
|
||||||
char pname[PROG_NAME_SIZE];
|
char pname[PROG_NAME_SIZE+1];
|
||||||
int separator=0;
|
int separator=0;
|
||||||
int debug=0;
|
int debug=0;
|
||||||
|
int keyform=FORMAT_PEM;
|
||||||
|
const char *outfile = NULL, *keyfile = NULL;
|
||||||
|
const char *sigfile = NULL, *randfile = NULL;
|
||||||
|
int out_bin = -1, want_pub = 0, do_verify = 0;
|
||||||
|
EVP_PKEY *sigkey = NULL;
|
||||||
|
unsigned char *sigbuf = NULL;
|
||||||
|
int siglen = 0;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if ((buf=(unsigned char *)Malloc(BUFSIZE)) == NULL)
|
if ((buf=(unsigned char *)OPENSSL_malloc(BUFSIZE)) == NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"out of memory\n");
|
BIO_printf(bio_err,"out of memory\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -101,8 +113,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
/* first check the program name */
|
/* first check the program name */
|
||||||
program_name(argv[0],pname,PROG_NAME_SIZE);
|
program_name(argv[0],pname,sizeof pname);
|
||||||
|
|
||||||
md=EVP_get_digestbyname(pname);
|
md=EVP_get_digestbyname(pname);
|
||||||
|
|
||||||
@@ -113,6 +128,53 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((*argv)[0] != '-') break;
|
if ((*argv)[0] != '-') break;
|
||||||
if (strcmp(*argv,"-c") == 0)
|
if (strcmp(*argv,"-c") == 0)
|
||||||
separator=1;
|
separator=1;
|
||||||
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
randfile=*(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-out") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
outfile=*(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-sign") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
keyfile=*(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-verify") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
keyfile=*(++argv);
|
||||||
|
want_pub = 1;
|
||||||
|
do_verify = 1;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-prverify") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
keyfile=*(++argv);
|
||||||
|
do_verify = 1;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-signature") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
sigfile=*(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-keyform") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
keyform=str2fmt(*(++argv));
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) break;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-hex") == 0)
|
||||||
|
out_bin = 0;
|
||||||
|
else if (strcmp(*argv,"-binary") == 0)
|
||||||
|
out_bin = 1;
|
||||||
else if (strcmp(*argv,"-d") == 0)
|
else if (strcmp(*argv,"-d") == 0)
|
||||||
debug=1;
|
debug=1;
|
||||||
else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
|
else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
|
||||||
@@ -126,14 +188,32 @@ int MAIN(int argc, char **argv)
|
|||||||
if (md == NULL)
|
if (md == NULL)
|
||||||
md=EVP_md5();
|
md=EVP_md5();
|
||||||
|
|
||||||
|
if(do_verify && !sigfile) {
|
||||||
|
BIO_printf(bio_err, "No signature to verify: use the -signature option\n");
|
||||||
|
err = 1;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if ((argc > 0) && (argv[0][0] == '-')) /* bad option */
|
if ((argc > 0) && (argv[0][0] == '-')) /* bad option */
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unknown option '%s'\n",*argv);
|
BIO_printf(bio_err,"unknown option '%s'\n",*argv);
|
||||||
BIO_printf(bio_err,"options are\n");
|
BIO_printf(bio_err,"options are\n");
|
||||||
BIO_printf(bio_err,"-c to output the digest with separating colons\n");
|
BIO_printf(bio_err,"-c to output the digest with separating colons\n");
|
||||||
BIO_printf(bio_err,"-d to output debug info\n");
|
BIO_printf(bio_err,"-d to output debug info\n");
|
||||||
|
BIO_printf(bio_err,"-hex output as hex dump\n");
|
||||||
|
BIO_printf(bio_err,"-binary output in binary form\n");
|
||||||
|
BIO_printf(bio_err,"-sign file sign digest using private key in file\n");
|
||||||
|
BIO_printf(bio_err,"-verify file verify a signature using public key in file\n");
|
||||||
|
BIO_printf(bio_err,"-prverify file verify a signature using private key in file\n");
|
||||||
|
BIO_printf(bio_err,"-keyform arg key file format (PEM or ENGINE)\n");
|
||||||
|
BIO_printf(bio_err,"-signature file signature to verify\n");
|
||||||
|
BIO_printf(bio_err,"-binary output in binary form\n");
|
||||||
|
BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
|
||||||
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
|
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm (default)\n",
|
||||||
LN_md5,LN_md5);
|
LN_md5,LN_md5);
|
||||||
|
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
|
||||||
|
LN_md4,LN_md4);
|
||||||
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
|
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
|
||||||
LN_md2,LN_md2);
|
LN_md2,LN_md2);
|
||||||
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
|
BIO_printf(bio_err,"-%3s to use the %s message digest algorithm\n",
|
||||||
@@ -148,6 +228,8 @@ int MAIN(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
bmd=BIO_new(BIO_f_md());
|
bmd=BIO_new(BIO_f_md());
|
||||||
if (debug)
|
if (debug)
|
||||||
@@ -163,6 +245,74 @@ int MAIN(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(out_bin == -1) {
|
||||||
|
if(keyfile) out_bin = 1;
|
||||||
|
else out_bin = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(randfile)
|
||||||
|
app_RAND_load_file(randfile, bio_err, 0);
|
||||||
|
|
||||||
|
if(outfile) {
|
||||||
|
if(out_bin)
|
||||||
|
out = BIO_new_file(outfile, "wb");
|
||||||
|
else out = BIO_new_file(outfile, "w");
|
||||||
|
} else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!out) {
|
||||||
|
BIO_printf(bio_err, "Error opening output file %s\n",
|
||||||
|
outfile ? outfile : "(stdout)");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(keyfile)
|
||||||
|
{
|
||||||
|
if (want_pub)
|
||||||
|
sigkey = load_pubkey(bio_err, keyfile, keyform, 0, NULL,
|
||||||
|
e, "key file");
|
||||||
|
else
|
||||||
|
sigkey = load_key(bio_err, keyfile, keyform, 0, NULL,
|
||||||
|
e, "key file");
|
||||||
|
if (!sigkey)
|
||||||
|
{
|
||||||
|
/* load_[pub]key() has already printed an appropriate
|
||||||
|
message */
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sigfile && sigkey) {
|
||||||
|
BIO *sigbio;
|
||||||
|
sigbio = BIO_new_file(sigfile, "rb");
|
||||||
|
siglen = EVP_PKEY_size(sigkey);
|
||||||
|
sigbuf = OPENSSL_malloc(siglen);
|
||||||
|
if(!sigbio) {
|
||||||
|
BIO_printf(bio_err, "Error opening signature file %s\n",
|
||||||
|
sigfile);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
siglen = BIO_read(sigbio, sigbuf, siglen);
|
||||||
|
BIO_free(sigbio);
|
||||||
|
if(siglen <= 0) {
|
||||||
|
BIO_printf(bio_err, "Error reading signature file %s\n",
|
||||||
|
sigfile);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* we use md as a filter, reading from 'in' */
|
/* we use md as a filter, reading from 'in' */
|
||||||
BIO_set_md(bmd,md);
|
BIO_set_md(bmd,md);
|
||||||
inp=BIO_push(bmd,in);
|
inp=BIO_push(bmd,in);
|
||||||
@@ -170,36 +320,57 @@ int MAIN(int argc, char **argv)
|
|||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
{
|
{
|
||||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
do_fp(buf,inp,separator);
|
err=do_fp(out, buf,inp,separator, out_bin, sigkey, sigbuf,
|
||||||
|
siglen,"","(stdin)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
name=OBJ_nid2sn(md->type);
|
name=OBJ_nid2sn(md->type);
|
||||||
for (i=0; i<argc; i++)
|
for (i=0; i<argc; i++)
|
||||||
{
|
{
|
||||||
|
char *tmp,*tofree=NULL;
|
||||||
|
int r;
|
||||||
|
|
||||||
if (BIO_read_filename(in,argv[i]) <= 0)
|
if (BIO_read_filename(in,argv[i]) <= 0)
|
||||||
{
|
{
|
||||||
perror(argv[i]);
|
perror(argv[i]);
|
||||||
err++;
|
err++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
printf("%s(%s)= ",name,argv[i]);
|
if(!out_bin)
|
||||||
do_fp(buf,inp,separator);
|
{
|
||||||
|
tmp=tofree=OPENSSL_malloc(strlen(name)+strlen(argv[i])+5);
|
||||||
|
sprintf(tmp,"%s(%s)= ",name,argv[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
tmp="";
|
||||||
|
r=do_fp(out,buf,inp,separator,out_bin,sigkey,sigbuf,
|
||||||
|
siglen,tmp,argv[i]);
|
||||||
|
if(r)
|
||||||
|
err=r;
|
||||||
|
if(tofree)
|
||||||
|
OPENSSL_free(tofree);
|
||||||
(void)BIO_reset(bmd);
|
(void)BIO_reset(bmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
memset(buf,0,BUFSIZE);
|
OPENSSL_cleanse(buf,BUFSIZE);
|
||||||
Free(buf);
|
OPENSSL_free(buf);
|
||||||
}
|
}
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
|
BIO_free_all(out);
|
||||||
|
EVP_PKEY_free(sigkey);
|
||||||
|
if(sigbuf) OPENSSL_free(sigbuf);
|
||||||
if (bmd != NULL) BIO_free(bmd);
|
if (bmd != NULL) BIO_free(bmd);
|
||||||
EXIT(err);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_fp(unsigned char *buf, BIO *bp, int sep)
|
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||||
|
EVP_PKEY *key, unsigned char *sigin, int siglen, const char *title,
|
||||||
|
const char *file)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
int i;
|
int i;
|
||||||
@@ -207,16 +378,60 @@ void do_fp(unsigned char *buf, BIO *bp, int sep)
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
i=BIO_read(bp,(char *)buf,BUFSIZE);
|
i=BIO_read(bp,(char *)buf,BUFSIZE);
|
||||||
if (i <= 0) break;
|
if(i < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Read Error in %s\n",file);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (i == 0) break;
|
||||||
|
}
|
||||||
|
if(sigin)
|
||||||
|
{
|
||||||
|
EVP_MD_CTX *ctx;
|
||||||
|
BIO_get_md_ctx(bp, &ctx);
|
||||||
|
i = EVP_VerifyFinal(ctx, sigin, (unsigned int)siglen, key);
|
||||||
|
if(i > 0)
|
||||||
|
BIO_printf(out, "Verified OK\n");
|
||||||
|
else if(i == 0)
|
||||||
|
{
|
||||||
|
BIO_printf(out, "Verification Failure\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Error Verifying Data\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if(key)
|
||||||
|
{
|
||||||
|
EVP_MD_CTX *ctx;
|
||||||
|
BIO_get_md_ctx(bp, &ctx);
|
||||||
|
if(!EVP_SignFinal(ctx, buf, (unsigned int *)&len, key))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Error Signing Data\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
len=BIO_gets(bp,(char *)buf,BUFSIZE);
|
len=BIO_gets(bp,(char *)buf,BUFSIZE);
|
||||||
|
|
||||||
|
if(binout) BIO_write(out, buf, len);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_write(out,title,strlen(title));
|
||||||
for (i=0; i<len; i++)
|
for (i=0; i<len; i++)
|
||||||
{
|
{
|
||||||
if (sep && (i != 0))
|
if (sep && (i != 0))
|
||||||
putc(':',stdout);
|
BIO_printf(out, ":");
|
||||||
printf("%02x",buf[i]);
|
BIO_printf(out, "%02x",buf[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
BIO_printf(out, "\n");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
36
apps/dh.c
36
apps/dh.c
@@ -57,7 +57,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -87,11 +87,12 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
DH *dh=NULL;
|
DH *dh=NULL;
|
||||||
int i,badops=0,text=0;
|
int i,badops=0,text=0;
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog,*engine;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -99,6 +100,10 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
engine=NULL;
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -129,6 +134,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile= *(++argv);
|
outfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-check") == 0)
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
check=1;
|
check=1;
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
@@ -160,11 +170,14 @@ bad:
|
|||||||
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
BIO_printf(bio_err," -text print a text form of the DH parameters\n");
|
||||||
BIO_printf(bio_err," -C Output C code\n");
|
BIO_printf(bio_err," -C Output C code\n");
|
||||||
BIO_printf(bio_err," -noout no output\n");
|
BIO_printf(bio_err," -noout no output\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL))
|
if ((in == NULL) || (out == NULL))
|
||||||
@@ -184,7 +197,15 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -251,10 +272,10 @@ bad:
|
|||||||
|
|
||||||
len=BN_num_bytes(dh->p);
|
len=BN_num_bytes(dh->p);
|
||||||
bits=BN_num_bits(dh->p);
|
bits=BN_num_bits(dh->p);
|
||||||
data=(unsigned char *)Malloc(len);
|
data=(unsigned char *)OPENSSL_malloc(len);
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
{
|
{
|
||||||
perror("Malloc");
|
perror("OPENSSL_malloc");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
l=BN_bn2bin(dh->p,data);
|
l=BN_bn2bin(dh->p,data);
|
||||||
@@ -285,7 +306,7 @@ bad:
|
|||||||
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
||||||
printf("\t\treturn(NULL);\n");
|
printf("\t\treturn(NULL);\n");
|
||||||
printf("\treturn(dh);\n\t}\n");
|
printf("\treturn(dh);\n\t}\n");
|
||||||
Free(data);
|
OPENSSL_free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -309,8 +330,9 @@ bad:
|
|||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dh != NULL) DH_free(dh);
|
if (dh != NULL) DH_free(dh);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
-----BEGIN DH PARAMETERS-----
|
-----BEGIN DH PARAMETERS-----
|
||||||
MIGHAoGBAJf2QmHKtQXdKCjhPx1ottPb0PMTBH9A6FbaWMsTuKG/K3g6TG1Z1fkq
|
MIGHAoGBAPSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsY
|
||||||
/Gz/PWk/eLI9TzFgqVAuPvr3q14a1aZeVUMTgo2oO5/y2UHe6VaJ+trqCTat3xlx
|
jY67VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6
|
||||||
/mNbIK9HA2RgPC3gWfVLZQrY+gz3ASHHR5nXWHEyvpuZm7m3h+irAgEC
|
ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpL3jHAgEC
|
||||||
-----END DH PARAMETERS-----
|
-----END DH PARAMETERS-----
|
||||||
|
|
||||||
|
These are the 1024 bit DH parameters from "Assigned Number for SKIP Protocols"
|
||||||
|
(http://www.skip-vpn.org/spec/numbers.html).
|
||||||
|
See there for how they were generated.
|
||||||
|
Note that g is not a generator, but this is not a problem since p is a safe prime.
|
||||||
|
|||||||
12
apps/dh2048.pem
Normal file
12
apps/dh2048.pem
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
-----BEGIN DH PARAMETERS-----
|
||||||
|
MIIBCAKCAQEA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlLOCDaAadWoxTpj0BV
|
||||||
|
89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeSWc39uK50
|
||||||
|
T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknb
|
||||||
|
zSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdX
|
||||||
|
Q6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbT
|
||||||
|
CD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwIBAg==
|
||||||
|
-----END DH PARAMETERS-----
|
||||||
|
|
||||||
|
These are the 2048 bit DH parameters from "Assigned Number for SKIP Protocols"
|
||||||
|
(http://www.skip-vpn.org/spec/numbers.html).
|
||||||
|
See there for how they were generated.
|
||||||
18
apps/dh4096.pem
Normal file
18
apps/dh4096.pem
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
-----BEGIN DH PARAMETERS-----
|
||||||
|
MIICCAKCAgEA+hRyUsFN4VpJ1O8JLcCo/VWr19k3BCgJ4uk+d+KhehjdRqNDNyOQ
|
||||||
|
l/MOyQNQfWXPeGKmOmIig6Ev/nm6Nf9Z2B1h3R4hExf+zTiHnvVPeRBhjdQi81rt
|
||||||
|
Xeoh6TNrSBIKIHfUJWBh3va0TxxjQIs6IZOLeVNRLMqzeylWqMf49HsIXqbcokUS
|
||||||
|
Vt1BkvLdW48j8PPv5DsKRN3tloTxqDJGo9tKvj1Fuk74A+Xda1kNhB7KFlqMyN98
|
||||||
|
VETEJ6c7KpfOo30mnK30wqw3S8OtaIR/maYX72tGOno2ehFDkq3pnPtEbD2CScxc
|
||||||
|
alJC+EL7RPk5c/tgeTvCngvc1KZn92Y//EI7G9tPZtylj2b56sHtMftIoYJ9+ODM
|
||||||
|
sccD5Piz/rejE3Ome8EOOceUSCYAhXn8b3qvxVI1ddd1pED6FHRhFvLrZxFvBEM9
|
||||||
|
ERRMp5QqOaHJkM+Dxv8Cj6MqrCbfC4u+ZErxodzuusgDgvZiLF22uxMZbobFWyte
|
||||||
|
OvOzKGtwcTqO/1wV5gKkzu1ZVswVUQd5Gg8lJicwqRWyyNRczDDoG9jVDxmogKTH
|
||||||
|
AaqLulO7R8Ifa1SwF2DteSGVtgWEN8gDpN3RBmmPTDngyF2DHb5qmpnznwtFKdTL
|
||||||
|
KWbuHn491xNO25CQWMtem80uKw+pTnisBRF/454n1Jnhub144YRBoN8CAQI=
|
||||||
|
-----END DH PARAMETERS-----
|
||||||
|
|
||||||
|
These are the 4096 bit DH parameters from "Assigned Number for SKIP Protocols"
|
||||||
|
(http://www.skip-vpn.org/spec/numbers.html).
|
||||||
|
See there for how they were generated.
|
||||||
|
Note that g is not a generator, but this is not a problem since p is a safe prime.
|
||||||
9
apps/dh512.pem
Normal file
9
apps/dh512.pem
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
-----BEGIN DH PARAMETERS-----
|
||||||
|
MEYCQQD1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWak
|
||||||
|
XUGfnHy9iUsiGSa6q6Jew1XpKgVfAgEC
|
||||||
|
-----END DH PARAMETERS-----
|
||||||
|
|
||||||
|
These are the 512 bit DH parameters from "Assigned Number for SKIP Protocols"
|
||||||
|
(http://www.skip-vpn.org/spec/numbers.html).
|
||||||
|
See there for how they were generated.
|
||||||
|
Note that g is not a generator, but this is not a problem since p is a safe prime.
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
#include <openssl/dsa.h>
|
#include <openssl/dsa.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -148,15 +148,16 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
DH *dh=NULL;
|
DH *dh=NULL;
|
||||||
int i,badops=0,text=0;
|
int i,badops=0,text=0;
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
int dsaparam=0;
|
int dsaparam=0;
|
||||||
#endif
|
#endif
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
int informat,outformat,check=0,noout=0,C=0,ret=1;
|
||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog;
|
||||||
char *inrand=NULL;
|
char *inrand=NULL,*engine=NULL;
|
||||||
int num = 0, g = 0;
|
int num = 0, g = 0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
@@ -165,6 +166,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -195,11 +199,16 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile= *(++argv);
|
outfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-check") == 0)
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
check=1;
|
check=1;
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
text=1;
|
text=1;
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
else if (strcmp(*argv,"-dsaparam") == 0)
|
else if (strcmp(*argv,"-dsaparam") == 0)
|
||||||
dsaparam=1;
|
dsaparam=1;
|
||||||
#endif
|
#endif
|
||||||
@@ -231,7 +240,7 @@ bad:
|
|||||||
BIO_printf(bio_err," -outform arg output 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," -in arg input file\n");
|
||||||
BIO_printf(bio_err," -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
BIO_printf(bio_err," -dsaparam read or generate DSA parameters, convert to DH\n");
|
BIO_printf(bio_err," -dsaparam read or generate DSA parameters, convert to DH\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err," -check check the DH parameters\n");
|
BIO_printf(bio_err," -check check the DH parameters\n");
|
||||||
@@ -240,6 +249,7 @@ bad:
|
|||||||
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
|
BIO_printf(bio_err," -2 generate parameters using 2 as the generator value\n");
|
||||||
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
|
BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n");
|
||||||
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
|
BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
@@ -249,10 +259,12 @@ bad:
|
|||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if (g && !num)
|
if (g && !num)
|
||||||
num = DEFBITS;
|
num = DEFBITS;
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (dsaparam)
|
if (dsaparam)
|
||||||
{
|
{
|
||||||
if (g)
|
if (g)
|
||||||
@@ -279,7 +291,7 @@ bad:
|
|||||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
app_RAND_load_files(inrand));
|
app_RAND_load_files(inrand));
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (dsaparam)
|
if (dsaparam)
|
||||||
{
|
{
|
||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
@@ -340,7 +352,7 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (dsaparam)
|
if (dsaparam)
|
||||||
{
|
{
|
||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
@@ -391,7 +403,15 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -432,10 +452,10 @@ bad:
|
|||||||
|
|
||||||
len=BN_num_bytes(dh->p);
|
len=BN_num_bytes(dh->p);
|
||||||
bits=BN_num_bits(dh->p);
|
bits=BN_num_bits(dh->p);
|
||||||
data=(unsigned char *)Malloc(len);
|
data=(unsigned char *)OPENSSL_malloc(len);
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
{
|
{
|
||||||
perror("Malloc");
|
perror("OPENSSL_malloc");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
printf("#ifndef HEADER_DH_H\n"
|
printf("#ifndef HEADER_DH_H\n"
|
||||||
@@ -470,9 +490,9 @@ bad:
|
|||||||
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
|
||||||
printf("\t\t{ DH_free(dh); return(NULL); }\n");
|
printf("\t\t{ DH_free(dh); return(NULL); }\n");
|
||||||
if (dh->length)
|
if (dh->length)
|
||||||
printf("\tdh->length = %d;\n", dh->length);
|
printf("\tdh->length = %ld;\n", dh->length);
|
||||||
printf("\treturn(dh);\n\t}\n");
|
printf("\treturn(dh);\n\t}\n");
|
||||||
Free(data);
|
OPENSSL_free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -496,9 +516,10 @@ bad:
|
|||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dh != NULL) DH_free(dh);
|
if (dh != NULL) DH_free(dh);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
|
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
|
||||||
|
|||||||
43
apps/dsa.c
43
apps/dsa.c
@@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -79,6 +79,9 @@
|
|||||||
* -des - encrypt output if PEM format with DES in cbc mode
|
* -des - encrypt output if PEM format with DES in cbc mode
|
||||||
* -des3 - encrypt output if PEM format
|
* -des3 - encrypt output if PEM format
|
||||||
* -idea - encrypt output if PEM format
|
* -idea - encrypt output if PEM format
|
||||||
|
* -aes128 - encrypt output if PEM format
|
||||||
|
* -aes192 - encrypt output if PEM format
|
||||||
|
* -aes256 - encrypt output if PEM format
|
||||||
* -text - print a text version
|
* -text - print a text version
|
||||||
* -modulus - print the DSA public key
|
* -modulus - print the DSA public key
|
||||||
*/
|
*/
|
||||||
@@ -87,6 +90,7 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
DSA *dsa=NULL;
|
DSA *dsa=NULL;
|
||||||
int i,badops=0;
|
int i,badops=0;
|
||||||
@@ -94,7 +98,7 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat,outformat,text=0,noout=0;
|
int informat,outformat,text=0,noout=0;
|
||||||
int pubin = 0, pubout = 0;
|
int pubin = 0, pubout = 0;
|
||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog,*engine;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
int modulus=0;
|
int modulus=0;
|
||||||
@@ -105,6 +109,10 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
engine=NULL;
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -145,6 +153,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargout= *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-noout") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
noout=1;
|
noout=1;
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
@@ -176,10 +189,15 @@ bad:
|
|||||||
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err," -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_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
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err," -text print the key in text\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," -noout don't print key out\n");
|
||||||
@@ -189,6 +207,8 @@ bad:
|
|||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -233,7 +253,15 @@ bad:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -281,10 +309,11 @@ bad:
|
|||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if(in != NULL) BIO_free(in);
|
if(in != NULL) BIO_free(in);
|
||||||
if(out != NULL) BIO_free(out);
|
if(out != NULL) BIO_free_all(out);
|
||||||
if(dsa != NULL) DSA_free(dsa);
|
if(dsa != NULL) DSA_free(dsa);
|
||||||
if(passin) Free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
if(passout) Free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -90,6 +90,7 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
DSA *dsa=NULL;
|
DSA *dsa=NULL;
|
||||||
int i,badops=0,text=0;
|
int i,badops=0,text=0;
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
@@ -97,6 +98,7 @@ int MAIN(int argc, char **argv)
|
|||||||
char *infile,*outfile,*prog,*inrand=NULL;
|
char *infile,*outfile,*prog,*inrand=NULL;
|
||||||
int numbits= -1,num,genkey=0;
|
int numbits= -1,num,genkey=0;
|
||||||
int need_rand=0;
|
int need_rand=0;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -104,6 +106,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -134,6 +139,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
outfile= *(++argv);
|
outfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if(strcmp(*argv, "-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine = *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-text") == 0)
|
else if (strcmp(*argv,"-text") == 0)
|
||||||
text=1;
|
text=1;
|
||||||
else if (strcmp(*argv,"-C") == 0)
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
@@ -176,10 +186,12 @@ bad:
|
|||||||
BIO_printf(bio_err," -outform arg output 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," -in arg input file\n");
|
||||||
BIO_printf(bio_err," -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
BIO_printf(bio_err," -text print the key in text\n");
|
BIO_printf(bio_err," -text print as text\n");
|
||||||
BIO_printf(bio_err," -C Output C code\n");
|
BIO_printf(bio_err," -C Output C code\n");
|
||||||
BIO_printf(bio_err," -noout no output\n");
|
BIO_printf(bio_err," -noout no output\n");
|
||||||
|
BIO_printf(bio_err," -genkey generate a DSA key\n");
|
||||||
BIO_printf(bio_err," -rand files to use for random number input\n");
|
BIO_printf(bio_err," -rand files to use for random number input\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err," number number of bits to use for generating private key\n");
|
BIO_printf(bio_err," number number of bits to use for generating private key\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -205,7 +217,15 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -215,6 +235,8 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if (need_rand)
|
if (need_rand)
|
||||||
{
|
{
|
||||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||||
@@ -260,10 +282,10 @@ bad:
|
|||||||
bits_p=BN_num_bits(dsa->p);
|
bits_p=BN_num_bits(dsa->p);
|
||||||
bits_q=BN_num_bits(dsa->q);
|
bits_q=BN_num_bits(dsa->q);
|
||||||
bits_g=BN_num_bits(dsa->g);
|
bits_g=BN_num_bits(dsa->g);
|
||||||
data=(unsigned char *)Malloc(len+20);
|
data=(unsigned char *)OPENSSL_malloc(len+20);
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
{
|
{
|
||||||
perror("Malloc");
|
perror("OPENSSL_malloc");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
l=BN_bn2bin(dsa->p,data);
|
l=BN_bn2bin(dsa->p,data);
|
||||||
@@ -303,7 +325,7 @@ bad:
|
|||||||
printf("\tdsa->g=BN_bin2bn(dsa%d_g,sizeof(dsa%d_g),NULL);\n",
|
printf("\tdsa->g=BN_bin2bn(dsa%d_g,sizeof(dsa%d_g),NULL);\n",
|
||||||
bits_p,bits_p);
|
bits_p,bits_p);
|
||||||
printf("\tif ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))\n");
|
printf("\tif ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))\n");
|
||||||
printf("\t\treturn(NULL);\n");
|
printf("\t\t{ DSA_free(dsa); return(NULL); }\n");
|
||||||
printf("\treturn(dsa);\n\t}\n");
|
printf("\treturn(dsa);\n\t}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,9 +369,10 @@ bad:
|
|||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dsa != NULL) DSA_free(dsa);
|
if (dsa != NULL) DSA_free(dsa);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
|
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
|
||||||
|
|||||||
395
apps/ec.c
Normal file
395
apps/ec.c
Normal file
@@ -0,0 +1,395 @@
|
|||||||
|
/* apps/ec.c */
|
||||||
|
/*
|
||||||
|
* Written by Nils Larsch for the OpenSSL project.
|
||||||
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_EC
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "apps.h"
|
||||||
|
#include <openssl/bio.h>
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/evp.h>
|
||||||
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
|
#undef PROG
|
||||||
|
#define PROG ec_main
|
||||||
|
|
||||||
|
/* -inform arg - input format - default PEM (one of DER, NET 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
|
||||||
|
* -text - print a text version
|
||||||
|
* -param_out - print the elliptic curve parameters
|
||||||
|
* -conv_form arg - specifies the point encoding form
|
||||||
|
* -param_enc arg - specifies the parameter encoding
|
||||||
|
*/
|
||||||
|
|
||||||
|
int MAIN(int, char **);
|
||||||
|
|
||||||
|
int MAIN(int argc, char **argv)
|
||||||
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
|
int ret = 1;
|
||||||
|
EC_KEY *eckey = NULL;
|
||||||
|
int i, badops = 0;
|
||||||
|
const EVP_CIPHER *enc = NULL;
|
||||||
|
BIO *in = NULL, *out = NULL;
|
||||||
|
int informat, outformat, text=0, noout=0;
|
||||||
|
int pubin = 0, pubout = 0, param_out = 0;
|
||||||
|
char *infile, *outfile, *prog, *engine;
|
||||||
|
char *passargin = NULL, *passargout = NULL;
|
||||||
|
char *passin = NULL, *passout = NULL;
|
||||||
|
point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
|
||||||
|
int new_form = 0;
|
||||||
|
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
||||||
|
int new_asn1_flag = 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);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
engine = NULL;
|
||||||
|
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,"-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, "-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv, "-noout") == 0)
|
||||||
|
noout = 1;
|
||||||
|
else if (strcmp(*argv, "-text") == 0)
|
||||||
|
text = 1;
|
||||||
|
else if (strcmp(*argv, "-conv_form") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1)
|
||||||
|
goto bad;
|
||||||
|
++argv;
|
||||||
|
new_form = 1;
|
||||||
|
if (strcmp(*argv, "compressed") == 0)
|
||||||
|
form = POINT_CONVERSION_COMPRESSED;
|
||||||
|
else if (strcmp(*argv, "uncompressed") == 0)
|
||||||
|
form = POINT_CONVERSION_UNCOMPRESSED;
|
||||||
|
else if (strcmp(*argv, "hybrid") == 0)
|
||||||
|
form = POINT_CONVERSION_HYBRID;
|
||||||
|
else
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv, "-param_enc") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1)
|
||||||
|
goto bad;
|
||||||
|
++argv;
|
||||||
|
new_asn1_flag = 1;
|
||||||
|
if (strcmp(*argv, "named_curve") == 0)
|
||||||
|
asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
||||||
|
else if (strcmp(*argv, "explicit") == 0)
|
||||||
|
asn1_flag = 0;
|
||||||
|
else
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv, "-param_out") == 0)
|
||||||
|
param_out = 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);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (badops)
|
||||||
|
{
|
||||||
|
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 - "
|
||||||
|
"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, " -engine e use engine e, "
|
||||||
|
"possibly a hardware device.\n");
|
||||||
|
BIO_printf(bio_err, " -des encrypt PEM output, "
|
||||||
|
"instead of 'des' every other \n"
|
||||||
|
" cipher "
|
||||||
|
"supported by OpenSSL can be used\n");
|
||||||
|
BIO_printf(bio_err, " -text print the key\n");
|
||||||
|
BIO_printf(bio_err, " -noout don't print key out\n");
|
||||||
|
BIO_printf(bio_err, " -param_out print the elliptic "
|
||||||
|
"curve parameters\n");
|
||||||
|
BIO_printf(bio_err, " -conv_form arg specifies the "
|
||||||
|
"point conversion form \n");
|
||||||
|
BIO_printf(bio_err, " possible values:"
|
||||||
|
" compressed\n");
|
||||||
|
BIO_printf(bio_err, " "
|
||||||
|
" uncompressed (default)\n");
|
||||||
|
BIO_printf(bio_err, " "
|
||||||
|
" hybrid\n");
|
||||||
|
BIO_printf(bio_err, " -param_enc arg specifies the way"
|
||||||
|
" the ec parameters are encoded\n");
|
||||||
|
BIO_printf(bio_err, " in the asn1 der "
|
||||||
|
"encoding\n");
|
||||||
|
BIO_printf(bio_err, " possilbe values:"
|
||||||
|
" named_curve (default)\n");
|
||||||
|
BIO_printf(bio_err," "
|
||||||
|
"explicit\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (infile == NULL)
|
||||||
|
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_read_filename(in, infile) <= 0)
|
||||||
|
{
|
||||||
|
perror(infile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BIO_printf(bio_err, "read EC key\n");
|
||||||
|
if (informat == FORMAT_ASN1)
|
||||||
|
{
|
||||||
|
if (pubin)
|
||||||
|
eckey = d2i_EC_PUBKEY_bio(in, NULL);
|
||||||
|
else
|
||||||
|
eckey = d2i_ECPrivateKey_bio(in, NULL);
|
||||||
|
}
|
||||||
|
else if (informat == FORMAT_PEM)
|
||||||
|
{
|
||||||
|
if (pubin)
|
||||||
|
eckey = PEM_read_bio_EC_PUBKEY(in, NULL, NULL,
|
||||||
|
NULL);
|
||||||
|
else
|
||||||
|
eckey = PEM_read_bio_ECPrivateKey(in, NULL, NULL,
|
||||||
|
passin);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "bad input format specified for key\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (eckey == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unable to load Key\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
|
BIO_set_fp(out, stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_write_filename(out, outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_form)
|
||||||
|
{
|
||||||
|
EC_GROUP_set_point_conversion_form(eckey->group, form);
|
||||||
|
eckey->conv_form = form;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_asn1_flag)
|
||||||
|
EC_GROUP_set_asn1_flag(eckey->group, asn1_flag);
|
||||||
|
|
||||||
|
if (text)
|
||||||
|
if (!EC_KEY_print(out, eckey, 0))
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (noout)
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
BIO_printf(bio_err, "writing EC key\n");
|
||||||
|
if (outformat == FORMAT_ASN1)
|
||||||
|
{
|
||||||
|
if (param_out)
|
||||||
|
i = i2d_ECPKParameters_bio(out, eckey->group);
|
||||||
|
else if (pubin || pubout)
|
||||||
|
i = i2d_EC_PUBKEY_bio(out, eckey);
|
||||||
|
else
|
||||||
|
i = i2d_ECPrivateKey_bio(out, eckey);
|
||||||
|
}
|
||||||
|
else if (outformat == FORMAT_PEM)
|
||||||
|
{
|
||||||
|
if (param_out)
|
||||||
|
i = PEM_write_bio_ECPKParameters(out, eckey->group);
|
||||||
|
else if (pubin || pubout)
|
||||||
|
i = PEM_write_bio_EC_PUBKEY(out, eckey);
|
||||||
|
else
|
||||||
|
i = PEM_write_bio_ECPrivateKey(out, eckey, 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");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ret=0;
|
||||||
|
end:
|
||||||
|
if (in)
|
||||||
|
BIO_free(in);
|
||||||
|
if (out)
|
||||||
|
BIO_free_all(out);
|
||||||
|
if (eckey)
|
||||||
|
EC_KEY_free(eckey);
|
||||||
|
if (passin)
|
||||||
|
OPENSSL_free(passin);
|
||||||
|
if (passout)
|
||||||
|
OPENSSL_free(passout);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
709
apps/ecparam.c
Normal file
709
apps/ecparam.c
Normal file
@@ -0,0 +1,709 @@
|
|||||||
|
/* apps/ecparam.c */
|
||||||
|
/*
|
||||||
|
* Written by Nils Larsch for the OpenSSL project.
|
||||||
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
|
||||||
|
*
|
||||||
|
* Portions of the attached software ("Contribution") are developed by
|
||||||
|
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
|
||||||
|
*
|
||||||
|
* The Contribution is licensed pursuant to the OpenSSL open source
|
||||||
|
* license provided above.
|
||||||
|
*
|
||||||
|
* The elliptic curve binary polynomial software is originally written by
|
||||||
|
* Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef OPENSSL_NO_EC
|
||||||
|
#include <assert.h>
|
||||||
|
#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/ec.h>
|
||||||
|
#include <openssl/x509.h>
|
||||||
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
|
#undef PROG
|
||||||
|
#define PROG ecparam_main
|
||||||
|
|
||||||
|
/* -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
|
||||||
|
* -noout - do not print the ec parameter
|
||||||
|
* -text - print the ec parameters in text form
|
||||||
|
* -check - validate the ec parameters
|
||||||
|
* -C - print a 'C' function creating the parameters
|
||||||
|
* -name arg - use the ec parameters with 'short name' name
|
||||||
|
* -list_curves - prints a list of all currently available curve 'short names'
|
||||||
|
* -conv_form arg - specifies the point conversion form
|
||||||
|
* - possible values: compressed
|
||||||
|
* uncompressed (default)
|
||||||
|
* hybrid
|
||||||
|
* -param_enc arg - specifies the way the ec parameters are encoded
|
||||||
|
* in the asn1 der encoding
|
||||||
|
* possible values: named_curve (default)
|
||||||
|
* explicit
|
||||||
|
* -no_seed - if 'explicit' parameters are choosen do not use the seed
|
||||||
|
* -genkey - generate ec key
|
||||||
|
* -rand file - files to use for random number input
|
||||||
|
* -engine e - use engine e, possibly a hardware device
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static int ecparam_print_var(BIO *,BIGNUM *,const char *,int,unsigned char *);
|
||||||
|
|
||||||
|
int MAIN(int, char **);
|
||||||
|
|
||||||
|
int MAIN(int argc, char **argv)
|
||||||
|
{
|
||||||
|
EC_GROUP *group = NULL;
|
||||||
|
point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
|
||||||
|
int new_form = 0;
|
||||||
|
int asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
||||||
|
int new_asn1_flag = 0;
|
||||||
|
char *curve_name = NULL, *inrand = NULL;
|
||||||
|
int list_curves = 0, no_seed = 0, check = 0,
|
||||||
|
badops = 0, text = 0, i, need_rand = 0, genkey = 0;
|
||||||
|
char *infile = NULL, *outfile = NULL, *prog;
|
||||||
|
BIO *in = NULL, *out = NULL;
|
||||||
|
int informat, outformat, noout = 0, C = 0, ret = 1;
|
||||||
|
ENGINE *e = NULL;
|
||||||
|
char *engine = NULL;
|
||||||
|
|
||||||
|
BIGNUM *ec_p = NULL, *ec_a = NULL, *ec_b = NULL,
|
||||||
|
*ec_gen = NULL, *ec_order = NULL, *ec_cofactor = NULL;
|
||||||
|
unsigned char *buffer = NULL;
|
||||||
|
|
||||||
|
apps_startup();
|
||||||
|
|
||||||
|
if (bio_err == NULL)
|
||||||
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
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,"-text") == 0)
|
||||||
|
text = 1;
|
||||||
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
|
C = 1;
|
||||||
|
else if (strcmp(*argv,"-check") == 0)
|
||||||
|
check = 1;
|
||||||
|
else if (strcmp (*argv, "-name") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1)
|
||||||
|
goto bad;
|
||||||
|
curve_name = *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv, "-list_curves") == 0)
|
||||||
|
list_curves = 1;
|
||||||
|
else if (strcmp(*argv, "-conv_form") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1)
|
||||||
|
goto bad;
|
||||||
|
++argv;
|
||||||
|
new_form = 1;
|
||||||
|
if (strcmp(*argv, "compressed") == 0)
|
||||||
|
form = POINT_CONVERSION_COMPRESSED;
|
||||||
|
else if (strcmp(*argv, "uncompressed") == 0)
|
||||||
|
form = POINT_CONVERSION_UNCOMPRESSED;
|
||||||
|
else if (strcmp(*argv, "hybrid") == 0)
|
||||||
|
form = POINT_CONVERSION_HYBRID;
|
||||||
|
else
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv, "-param_enc") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1)
|
||||||
|
goto bad;
|
||||||
|
++argv;
|
||||||
|
new_asn1_flag = 1;
|
||||||
|
if (strcmp(*argv, "named_curve") == 0)
|
||||||
|
asn1_flag = OPENSSL_EC_NAMED_CURVE;
|
||||||
|
else if (strcmp(*argv, "explicit") == 0)
|
||||||
|
asn1_flag = 0;
|
||||||
|
else
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv, "-no_seed") == 0)
|
||||||
|
no_seed = 1;
|
||||||
|
else if (strcmp(*argv, "-noout") == 0)
|
||||||
|
noout=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, "-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine = *(++argv);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
|
badops=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (badops)
|
||||||
|
{
|
||||||
|
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 - "
|
||||||
|
"default PEM (DER or PEM)\n");
|
||||||
|
BIO_printf(bio_err, " -outform arg output format - "
|
||||||
|
"default PEM\n");
|
||||||
|
BIO_printf(bio_err, " -in arg input file - "
|
||||||
|
"default stdin\n");
|
||||||
|
BIO_printf(bio_err, " -out arg output file - "
|
||||||
|
"default stdout\n");
|
||||||
|
BIO_printf(bio_err, " -noout do not print the "
|
||||||
|
"ec parameter\n");
|
||||||
|
BIO_printf(bio_err, " -text print the ec "
|
||||||
|
"parameters in text form\n");
|
||||||
|
BIO_printf(bio_err, " -check validate the ec "
|
||||||
|
"parameters\n");
|
||||||
|
BIO_printf(bio_err, " -C print a 'C' "
|
||||||
|
"function creating the parameters\n");
|
||||||
|
BIO_printf(bio_err, " -name arg use the "
|
||||||
|
"ec parameters with 'short name' name\n");
|
||||||
|
BIO_printf(bio_err, " -list_curves prints a list of "
|
||||||
|
"all currently available curve 'short names'\n");
|
||||||
|
BIO_printf(bio_err, " -conv_form arg specifies the "
|
||||||
|
"point conversion form \n");
|
||||||
|
BIO_printf(bio_err, " possible values:"
|
||||||
|
" compressed\n");
|
||||||
|
BIO_printf(bio_err, " "
|
||||||
|
" uncompressed (default)\n");
|
||||||
|
BIO_printf(bio_err, " "
|
||||||
|
" hybrid\n");
|
||||||
|
BIO_printf(bio_err, " -param_enc arg specifies the way"
|
||||||
|
" the ec parameters are encoded\n");
|
||||||
|
BIO_printf(bio_err, " in the asn1 der "
|
||||||
|
"encoding\n");
|
||||||
|
BIO_printf(bio_err, " possible values:"
|
||||||
|
" named_curve (default)\n");
|
||||||
|
BIO_printf(bio_err, " "
|
||||||
|
" explicit\n");
|
||||||
|
BIO_printf(bio_err, " -no_seed if 'explicit'"
|
||||||
|
" parameters are choosen do not"
|
||||||
|
" use the seed\n");
|
||||||
|
BIO_printf(bio_err, " -genkey generate ec"
|
||||||
|
" key\n");
|
||||||
|
BIO_printf(bio_err, " -rand file files to use for"
|
||||||
|
" random number input\n");
|
||||||
|
BIO_printf(bio_err, " -engine e use engine e, "
|
||||||
|
"possibly a hardware device\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
in=BIO_new(BIO_s_file());
|
||||||
|
out=BIO_new(BIO_s_file());
|
||||||
|
if ((in == NULL) || (out == NULL))
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (infile == NULL)
|
||||||
|
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
|
{
|
||||||
|
perror(infile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
|
{
|
||||||
|
perror(outfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
|
if (list_curves)
|
||||||
|
{
|
||||||
|
EC_builtin_curve *curves = NULL;
|
||||||
|
size_t crv_len = 0;
|
||||||
|
size_t n = 0;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
crv_len = EC_get_builtin_curves(NULL, 0);
|
||||||
|
|
||||||
|
curves = OPENSSL_malloc(sizeof(EC_builtin_curve) * crv_len);
|
||||||
|
|
||||||
|
if (curves == NULL)
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
if (!EC_get_builtin_curves(curves, crv_len))
|
||||||
|
{
|
||||||
|
OPENSSL_free(curves);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (n = 0; n < crv_len; n++)
|
||||||
|
{
|
||||||
|
const char *comment;
|
||||||
|
const char *sname;
|
||||||
|
comment = curves[n].comment;
|
||||||
|
sname = OBJ_nid2sn(curves[n].nid);
|
||||||
|
if (comment == NULL)
|
||||||
|
comment = "CURVE DESCRIPTION NOT AVAILABLE";
|
||||||
|
if (sname == NULL)
|
||||||
|
sname = "";
|
||||||
|
|
||||||
|
len = BIO_printf(out, " %-10s: ", sname);
|
||||||
|
if (len + strlen(comment) > 80)
|
||||||
|
BIO_printf(out, "\n%80s\n", comment);
|
||||||
|
else
|
||||||
|
BIO_printf(out, "%s\n", comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
OPENSSL_free(curves);
|
||||||
|
ret = 0;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (curve_name != NULL)
|
||||||
|
{
|
||||||
|
int nid = OBJ_sn2nid(curve_name);
|
||||||
|
|
||||||
|
if (nid == 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "unknown curve name (%s)\n",
|
||||||
|
curve_name);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
group = EC_GROUP_new_by_nid(nid);
|
||||||
|
if (group == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "unable to create curve (%s)\n",
|
||||||
|
curve_name);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
EC_GROUP_set_asn1_flag(group, asn1_flag);
|
||||||
|
EC_GROUP_set_point_conversion_form(group, form);
|
||||||
|
}
|
||||||
|
else if (informat == FORMAT_ASN1)
|
||||||
|
{
|
||||||
|
group = d2i_ECPKParameters_bio(in, NULL);
|
||||||
|
}
|
||||||
|
else if (informat == FORMAT_PEM)
|
||||||
|
{
|
||||||
|
group = PEM_read_bio_ECPKParameters(in,NULL,NULL,NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "bad input format specified\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (group == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"unable to load elliptic curve parameters\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_form)
|
||||||
|
EC_GROUP_set_point_conversion_form(group, form);
|
||||||
|
|
||||||
|
if (new_asn1_flag)
|
||||||
|
EC_GROUP_set_asn1_flag(group, asn1_flag);
|
||||||
|
|
||||||
|
if (no_seed)
|
||||||
|
{
|
||||||
|
EC_GROUP_set_seed(group, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text)
|
||||||
|
{
|
||||||
|
if (!ECPKParameters_print(out, group, 0))
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (check)
|
||||||
|
{
|
||||||
|
if (group == NULL)
|
||||||
|
BIO_printf(bio_err, "no elliptic curve parameters\n");
|
||||||
|
BIO_printf(bio_err, "checking elliptic curve parameters: ");
|
||||||
|
if (!EC_GROUP_check(group, NULL))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "failed\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
BIO_printf(bio_err, "ok\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (C)
|
||||||
|
{
|
||||||
|
size_t buf_len = 0, tmp_len = 0;
|
||||||
|
const EC_POINT *point;
|
||||||
|
int is_prime, len = 0;
|
||||||
|
const EC_METHOD *meth = EC_GROUP_method_of(group);
|
||||||
|
|
||||||
|
if ((ec_p = BN_new()) == NULL || (ec_a = BN_new()) == NULL ||
|
||||||
|
(ec_b = BN_new()) == NULL || (ec_gen = BN_new()) == NULL ||
|
||||||
|
(ec_order = BN_new()) == NULL ||
|
||||||
|
(ec_cofactor = BN_new()) == NULL )
|
||||||
|
{
|
||||||
|
perror("OPENSSL_malloc");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
is_prime = (EC_METHOD_get_field_type(meth) ==
|
||||||
|
NID_X9_62_prime_field);
|
||||||
|
|
||||||
|
if (is_prime)
|
||||||
|
{
|
||||||
|
if (!EC_GROUP_get_curve_GFp(group, ec_p, ec_a,
|
||||||
|
ec_b, NULL))
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((point = EC_GROUP_get0_generator(group)) == NULL)
|
||||||
|
goto end;
|
||||||
|
if (!EC_POINT_point2bn(group, point,
|
||||||
|
EC_GROUP_get_point_conversion_form(group), ec_gen,
|
||||||
|
NULL))
|
||||||
|
goto end;
|
||||||
|
if (!EC_GROUP_get_order(group, ec_order, NULL))
|
||||||
|
goto end;
|
||||||
|
if (!EC_GROUP_get_cofactor(group, ec_cofactor, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
if (!ec_p || !ec_a || !ec_b || !ec_gen ||
|
||||||
|
!ec_order || !ec_cofactor)
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
len = BN_num_bits(ec_order);
|
||||||
|
|
||||||
|
if ((tmp_len = (size_t)BN_num_bytes(ec_p)) > buf_len)
|
||||||
|
buf_len = tmp_len;
|
||||||
|
if ((tmp_len = (size_t)BN_num_bytes(ec_a)) > buf_len)
|
||||||
|
buf_len = tmp_len;
|
||||||
|
if ((tmp_len = (size_t)BN_num_bytes(ec_b)) > buf_len)
|
||||||
|
buf_len = tmp_len;
|
||||||
|
if ((tmp_len = (size_t)BN_num_bytes(ec_gen)) > buf_len)
|
||||||
|
buf_len = tmp_len;
|
||||||
|
if ((tmp_len = (size_t)BN_num_bytes(ec_order)) > buf_len)
|
||||||
|
buf_len = tmp_len;
|
||||||
|
if ((tmp_len = (size_t)BN_num_bytes(ec_cofactor)) > buf_len)
|
||||||
|
buf_len = tmp_len;
|
||||||
|
|
||||||
|
buffer = (unsigned char *)OPENSSL_malloc(buf_len);
|
||||||
|
|
||||||
|
if (buffer == NULL)
|
||||||
|
{
|
||||||
|
perror("OPENSSL_malloc");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
ecparam_print_var(out, ec_p, "ec_p", len, buffer);
|
||||||
|
ecparam_print_var(out, ec_a, "ec_a", len, buffer);
|
||||||
|
ecparam_print_var(out, ec_b, "ec_b", len, buffer);
|
||||||
|
ecparam_print_var(out, ec_gen, "ec_gen", len, buffer);
|
||||||
|
ecparam_print_var(out, ec_order, "ec_order", len, buffer);
|
||||||
|
ecparam_print_var(out, ec_cofactor, "ec_cofactor", len,
|
||||||
|
buffer);
|
||||||
|
|
||||||
|
BIO_printf(out, "\n\n");
|
||||||
|
|
||||||
|
BIO_printf(out, "EC_GROUP *get_ec_group_%d(void)\n\t{\n", len);
|
||||||
|
BIO_printf(out, "\tint ok=0;\n");
|
||||||
|
BIO_printf(out, "\tEC_GROUP *group = NULL;\n");
|
||||||
|
BIO_printf(out, "\tEC_POINT *point = NULL;\n");
|
||||||
|
BIO_printf(out, "\tBIGNUM *tmp_1 = NULL, *tmp_2 = NULL, "
|
||||||
|
"*tmp_3 = NULL;\n\n");
|
||||||
|
BIO_printf(out, "\tif ((tmp_1 = BN_bin2bn(ec_p_%d, "
|
||||||
|
"sizeof(ec_p_%d), NULL)) == NULL)\n\t\t"
|
||||||
|
"goto err;\n", len, len);
|
||||||
|
BIO_printf(out, "\tif ((tmp_2 = BN_bin2bn(ec_a_%d, "
|
||||||
|
"sizeof(ec_a_%d), NULL)) == NULL)\n\t\t"
|
||||||
|
"goto err;\n", len, len);
|
||||||
|
BIO_printf(out, "\tif ((tmp_3 = BN_bin2bn(ec_b_%d, "
|
||||||
|
"sizeof(ec_b_%d), NULL)) == NULL)\n\t\t"
|
||||||
|
"goto err;\n", len, len);
|
||||||
|
if (is_prime)
|
||||||
|
{
|
||||||
|
BIO_printf(out, "\tif ((group = EC_GROUP_new_curve_"
|
||||||
|
"GFp(tmp_1, tmp_2, tmp_3, NULL)) == NULL)"
|
||||||
|
"\n\t\tgoto err;\n\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
BIO_printf(out, "\t/* build generator */\n");
|
||||||
|
BIO_printf(out, "\tif ((tmp_1 = BN_bin2bn(ec_gen_%d, "
|
||||||
|
"sizeof(ec_gen_%d), tmp_1)) == NULL)"
|
||||||
|
"\n\t\tgoto err;\n", len, len);
|
||||||
|
BIO_printf(out, "\tpoint = EC_POINT_bn2point(group, tmp_1, "
|
||||||
|
"NULL, NULL);\n");
|
||||||
|
BIO_printf(out, "\tif (point == NULL)\n\t\tgoto err;\n");
|
||||||
|
BIO_printf(out, "\tif ((tmp_2 = BN_bin2bn(ec_order_%d, "
|
||||||
|
"sizeof(ec_order_%d), tmp_2)) == NULL)"
|
||||||
|
"\n\t\tgoto err;\n", len, len);
|
||||||
|
BIO_printf(out, "\tif ((tmp_3 = BN_bin2bn(ec_cofactor_%d, "
|
||||||
|
"sizeof(ec_cofactor_%d), tmp_3)) == NULL)"
|
||||||
|
"\n\t\tgoto err;\n", len, len);
|
||||||
|
BIO_printf(out, "\tif (!EC_GROUP_set_generator(group, point,"
|
||||||
|
" tmp_2, tmp_3))\n\t\tgoto err;\n");
|
||||||
|
BIO_printf(out, "\n\tok=1;\n");
|
||||||
|
BIO_printf(out, "err:\n");
|
||||||
|
BIO_printf(out, "\tif (tmp_1)\n\t\tBN_free(tmp_1);\n");
|
||||||
|
BIO_printf(out, "\tif (tmp_2)\n\t\tBN_free(tmp_2);\n");
|
||||||
|
BIO_printf(out, "\tif (tmp_3)\n\t\tBN_free(tmp_3);\n");
|
||||||
|
BIO_printf(out, "\tif (point)\n\t\tEC_POINT_free(point);\n");
|
||||||
|
BIO_printf(out, "\tif (!ok)\n");
|
||||||
|
BIO_printf(out, "\t\t{\n");
|
||||||
|
BIO_printf(out, "\t\tEC_GROUP_free(group);\n");
|
||||||
|
BIO_printf(out, "\t\tgroup = NULL;\n");
|
||||||
|
BIO_printf(out, "\t\t}\n");
|
||||||
|
BIO_printf(out, "\treturn(group);\n\t}\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!noout)
|
||||||
|
{
|
||||||
|
if (outformat == FORMAT_ASN1)
|
||||||
|
i = i2d_ECPKParameters_bio(out, group);
|
||||||
|
else if (outformat == FORMAT_PEM)
|
||||||
|
i = PEM_write_bio_ECPKParameters(out, group);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"bad output format specified for"
|
||||||
|
" outfile\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!i)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "unable to write elliptic "
|
||||||
|
"curve parameters\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (genkey)
|
||||||
|
{
|
||||||
|
EC_KEY *eckey = EC_KEY_new();
|
||||||
|
|
||||||
|
if (eckey == NULL)
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
assert(need_rand);
|
||||||
|
|
||||||
|
eckey->group = group;
|
||||||
|
|
||||||
|
if (!EC_KEY_generate_key(eckey))
|
||||||
|
{
|
||||||
|
eckey->group = NULL;
|
||||||
|
EC_KEY_free(eckey);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (outformat == FORMAT_ASN1)
|
||||||
|
i = i2d_ECPrivateKey_bio(out, eckey);
|
||||||
|
else if (outformat == FORMAT_PEM)
|
||||||
|
i = PEM_write_bio_ECPrivateKey(out, eckey, NULL,
|
||||||
|
NULL, 0, NULL, NULL);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "bad output format specified "
|
||||||
|
"for outfile\n");
|
||||||
|
eckey->group = NULL;
|
||||||
|
EC_KEY_free(eckey);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
eckey->group = NULL;
|
||||||
|
EC_KEY_free(eckey);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (need_rand)
|
||||||
|
app_RAND_write_file(NULL, bio_err);
|
||||||
|
|
||||||
|
ret=0;
|
||||||
|
end:
|
||||||
|
if (ec_p)
|
||||||
|
BN_free(ec_p);
|
||||||
|
if (ec_a)
|
||||||
|
BN_free(ec_a);
|
||||||
|
if (ec_b)
|
||||||
|
BN_free(ec_b);
|
||||||
|
if (ec_gen)
|
||||||
|
BN_free(ec_gen);
|
||||||
|
if (ec_order)
|
||||||
|
BN_free(ec_order);
|
||||||
|
if (ec_cofactor)
|
||||||
|
BN_free(ec_cofactor);
|
||||||
|
if (buffer)
|
||||||
|
OPENSSL_free(buffer);
|
||||||
|
if (in != NULL)
|
||||||
|
BIO_free(in);
|
||||||
|
if (out != NULL)
|
||||||
|
BIO_free_all(out);
|
||||||
|
if (group != NULL)
|
||||||
|
EC_GROUP_free(group);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
|
||||||
|
int len, unsigned char *buffer)
|
||||||
|
{
|
||||||
|
BIO_printf(out, "static unsigned char %s_%d[] = {", var, len);
|
||||||
|
if (BN_is_zero(in))
|
||||||
|
BIO_printf(out, "\n\t0x00");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i, l;
|
||||||
|
|
||||||
|
l = BN_bn2bin(in, buffer);
|
||||||
|
for (i=0; i<l-1; i++)
|
||||||
|
{
|
||||||
|
if ((i%12) == 0)
|
||||||
|
BIO_printf(out, "\n\t");
|
||||||
|
BIO_printf(out, "0x%02X,", buffer[i]);
|
||||||
|
}
|
||||||
|
if ((i%12) == 0)
|
||||||
|
BIO_printf(out, "\n\t");
|
||||||
|
BIO_printf(out, "0x%02X", buffer[i]);
|
||||||
|
}
|
||||||
|
BIO_printf(out, "\n\t};\n\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
178
apps/enc.c
178
apps/enc.c
@@ -66,10 +66,8 @@
|
|||||||
#include <openssl/objects.h>
|
#include <openssl/objects.h>
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#ifndef NO_MD5
|
|
||||||
#include <openssl/md5.h>
|
|
||||||
#endif
|
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
int set_hex(char *in,unsigned char *out,int size);
|
int set_hex(char *in,unsigned char *out,int size);
|
||||||
#undef SIZE
|
#undef SIZE
|
||||||
@@ -80,17 +78,37 @@ int set_hex(char *in,unsigned char *out,int size);
|
|||||||
#define BSIZE (8*1024)
|
#define BSIZE (8*1024)
|
||||||
#define PROG enc_main
|
#define PROG enc_main
|
||||||
|
|
||||||
|
static void show_ciphers(const OBJ_NAME *name,void *bio_)
|
||||||
|
{
|
||||||
|
BIO *bio=bio_;
|
||||||
|
static int n;
|
||||||
|
|
||||||
|
if(!islower((unsigned char)*name->name))
|
||||||
|
return;
|
||||||
|
|
||||||
|
BIO_printf(bio,"-%-25s",name->name);
|
||||||
|
if(++n == 3)
|
||||||
|
{
|
||||||
|
BIO_printf(bio,"\n");
|
||||||
|
n=0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
BIO_printf(bio," ");
|
||||||
|
}
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
static const char magic[]="Salted__";
|
static const char magic[]="Salted__";
|
||||||
char mbuf[8]; /* should be 1 smaller than magic */
|
char mbuf[sizeof magic-1];
|
||||||
char *strbuf=NULL;
|
char *strbuf=NULL;
|
||||||
unsigned char *buff=NULL,*bufsize=NULL;
|
unsigned char *buff=NULL,*bufsize=NULL;
|
||||||
int bsize=BSIZE,verbose=0;
|
int bsize=BSIZE,verbose=0;
|
||||||
int ret=1,inl;
|
int ret=1,inl;
|
||||||
unsigned char key[24],iv[MD5_DIGEST_LENGTH];
|
int nopad = 0;
|
||||||
|
unsigned char key[EVP_MAX_KEY_LENGTH],iv[EVP_MAX_IV_LENGTH];
|
||||||
unsigned char salt[PKCS5_SALT_LEN];
|
unsigned char salt[PKCS5_SALT_LEN];
|
||||||
char *str=NULL, *passarg = NULL, *pass = NULL;
|
char *str=NULL, *passarg = NULL, *pass = NULL;
|
||||||
char *hkey=NULL,*hiv=NULL,*hsalt = NULL;
|
char *hkey=NULL,*hiv=NULL,*hsalt = NULL;
|
||||||
@@ -99,8 +117,9 @@ int MAIN(int argc, char **argv)
|
|||||||
const EVP_CIPHER *cipher=NULL,*c;
|
const EVP_CIPHER *cipher=NULL,*c;
|
||||||
char *inf=NULL,*outf=NULL;
|
char *inf=NULL,*outf=NULL;
|
||||||
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
|
BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL;
|
||||||
#define PROG_NAME_SIZE 16
|
#define PROG_NAME_SIZE 39
|
||||||
char pname[PROG_NAME_SIZE];
|
char pname[PROG_NAME_SIZE+1];
|
||||||
|
char *engine = NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -108,8 +127,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
/* first check the program name */
|
/* first check the program name */
|
||||||
program_name(argv[0],pname,PROG_NAME_SIZE);
|
program_name(argv[0],pname,sizeof pname);
|
||||||
if (strcmp(pname,"base64") == 0)
|
if (strcmp(pname,"base64") == 0)
|
||||||
base64=1;
|
base64=1;
|
||||||
|
|
||||||
@@ -141,12 +163,19 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passarg= *(++argv);
|
passarg= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-d") == 0)
|
else if (strcmp(*argv,"-d") == 0)
|
||||||
enc=0;
|
enc=0;
|
||||||
else if (strcmp(*argv,"-p") == 0)
|
else if (strcmp(*argv,"-p") == 0)
|
||||||
printkey=1;
|
printkey=1;
|
||||||
else if (strcmp(*argv,"-v") == 0)
|
else if (strcmp(*argv,"-v") == 0)
|
||||||
verbose=1;
|
verbose=1;
|
||||||
|
else if (strcmp(*argv,"-nopad") == 0)
|
||||||
|
nopad=1;
|
||||||
else if (strcmp(*argv,"-salt") == 0)
|
else if (strcmp(*argv,"-salt") == 0)
|
||||||
nosalt=0;
|
nosalt=0;
|
||||||
else if (strcmp(*argv,"-nosalt") == 0)
|
else if (strcmp(*argv,"-nosalt") == 0)
|
||||||
@@ -187,7 +216,7 @@ int MAIN(int argc, char **argv)
|
|||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
buf[0]='\0';
|
buf[0]='\0';
|
||||||
fgets(buf,128,infile);
|
fgets(buf,sizeof buf,infile);
|
||||||
fclose(infile);
|
fclose(infile);
|
||||||
i=strlen(buf);
|
i=strlen(buf);
|
||||||
if ((i > 0) &&
|
if ((i > 0) &&
|
||||||
@@ -241,79 +270,22 @@ bad:
|
|||||||
BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv");
|
BIO_printf(bio_err,"%-14s key/iv in hex is the next argument\n","-K/-iv");
|
||||||
BIO_printf(bio_err,"%-14s print the iv/key (then exit if -P)\n","-[pP]");
|
BIO_printf(bio_err,"%-14s print the iv/key (then exit if -P)\n","-[pP]");
|
||||||
BIO_printf(bio_err,"%-14s buffer size\n","-bufsize <n>");
|
BIO_printf(bio_err,"%-14s buffer size\n","-bufsize <n>");
|
||||||
|
BIO_printf(bio_err,"%-14s use engine e, possibly a hardware device.\n","-engine e");
|
||||||
|
|
||||||
BIO_printf(bio_err,"Cipher Types\n");
|
BIO_printf(bio_err,"Cipher Types\n");
|
||||||
BIO_printf(bio_err,"des : 56 bit key DES encryption\n");
|
OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH,
|
||||||
BIO_printf(bio_err,"des_ede :112 bit key ede DES encryption\n");
|
show_ciphers,
|
||||||
BIO_printf(bio_err,"des_ede3:168 bit key ede DES encryption\n");
|
bio_err);
|
||||||
#ifndef NO_IDEA
|
BIO_printf(bio_err,"\n");
|
||||||
BIO_printf(bio_err,"idea :128 bit key IDEA encryption\n");
|
|
||||||
#endif
|
|
||||||
#ifndef NO_RC4
|
|
||||||
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");
|
|
||||||
#endif
|
|
||||||
#ifndef NO_RC4
|
|
||||||
BIO_printf(bio_err," -%-5s :128 bit key RC4 encryption\n",
|
|
||||||
LN_rc4);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_des_ecb,LN_des_cbc,
|
|
||||||
LN_des_cfb64,LN_des_ofb64);
|
|
||||||
BIO_printf(bio_err," -%-4s (%s)\n",
|
|
||||||
"des", LN_des_cbc);
|
|
||||||
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_des_ede,LN_des_ede_cbc,
|
|
||||||
LN_des_ede_cfb64,LN_des_ede_ofb64);
|
|
||||||
BIO_printf(bio_err," -desx -none\n");
|
|
||||||
|
|
||||||
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_des_ede3,LN_des_ede3_cbc,
|
|
||||||
LN_des_ede3_cfb64,LN_des_ede3_ofb64);
|
|
||||||
BIO_printf(bio_err," -%-4s (%s)\n",
|
|
||||||
"des3", LN_des_ede3_cbc);
|
|
||||||
|
|
||||||
#ifndef NO_IDEA
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_idea_ecb, LN_idea_cbc,
|
|
||||||
LN_idea_cfb64, LN_idea_ofb64);
|
|
||||||
BIO_printf(bio_err," -%-4s (%s)\n","idea",LN_idea_cbc);
|
|
||||||
#endif
|
|
||||||
#ifndef NO_RC2
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_rc2_ecb, LN_rc2_cbc,
|
|
||||||
LN_rc2_cfb64, LN_rc2_ofb64);
|
|
||||||
BIO_printf(bio_err," -%-4s (%s)\n","rc2", LN_rc2_cbc);
|
|
||||||
#endif
|
|
||||||
#ifndef NO_BF
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_bf_ecb, LN_bf_cbc,
|
|
||||||
LN_bf_cfb64, LN_bf_ofb64);
|
|
||||||
BIO_printf(bio_err," -%-4s (%s)\n","bf", LN_bf_cbc);
|
|
||||||
#endif
|
|
||||||
#ifndef NO_CAST
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_cast5_ecb, LN_cast5_cbc,
|
|
||||||
LN_cast5_cfb64, LN_cast5_ofb64);
|
|
||||||
BIO_printf(bio_err," -%-4s (%s)\n","cast", LN_cast5_cbc);
|
|
||||||
#endif
|
|
||||||
#ifndef NO_RC5
|
|
||||||
BIO_printf(bio_err," -%-12s -%-12s -%-12s -%-12s",
|
|
||||||
LN_rc5_ecb, LN_rc5_cbc,
|
|
||||||
LN_rc5_cfb64, LN_rc5_ofb64);
|
|
||||||
BIO_printf(bio_err," -%-4s (%s)\n","rc5", LN_rc5_cbc);
|
|
||||||
#endif
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if (bufsize != NULL)
|
if (bufsize != NULL)
|
||||||
{
|
{
|
||||||
unsigned long n;
|
unsigned long n;
|
||||||
@@ -343,11 +315,11 @@ bad:
|
|||||||
if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize);
|
if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
strbuf=Malloc(SIZE);
|
strbuf=OPENSSL_malloc(SIZE);
|
||||||
buff=(unsigned char *)Malloc(EVP_ENCODE_LENGTH(bsize));
|
buff=(unsigned char *)OPENSSL_malloc(EVP_ENCODE_LENGTH(bsize));
|
||||||
if ((buff == NULL) || (strbuf == NULL))
|
if ((buff == NULL) || (strbuf == NULL))
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"Malloc failure %ld\n",(long)EVP_ENCODE_LENGTH(bsize));
|
BIO_printf(bio_err,"OPENSSL_malloc failure %ld\n",(long)EVP_ENCODE_LENGTH(bsize));
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,7 +388,15 @@ bad:
|
|||||||
|
|
||||||
|
|
||||||
if (outf == NULL)
|
if (outf == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outf) <= 0)
|
if (BIO_write_filename(out,outf) <= 0)
|
||||||
@@ -448,6 +428,9 @@ bad:
|
|||||||
|
|
||||||
if (cipher != NULL)
|
if (cipher != NULL)
|
||||||
{
|
{
|
||||||
|
/* Note that str is NULL if a key was passed on the command
|
||||||
|
* line, so we get no salt in that case. Is this a bug?
|
||||||
|
*/
|
||||||
if (str != NULL)
|
if (str != NULL)
|
||||||
{
|
{
|
||||||
/* Salt handling: if encrypting generate a salt and
|
/* Salt handling: if encrypting generate a salt and
|
||||||
@@ -459,12 +442,12 @@ bad:
|
|||||||
else {
|
else {
|
||||||
if(enc) {
|
if(enc) {
|
||||||
if(hsalt) {
|
if(hsalt) {
|
||||||
if(!set_hex(hsalt,salt,PKCS5_SALT_LEN)) {
|
if(!set_hex(hsalt,salt,sizeof salt)) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"invalid hex salt value\n");
|
"invalid hex salt value\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else if (RAND_pseudo_bytes(salt, PKCS5_SALT_LEN) < 0)
|
} else if (RAND_pseudo_bytes(salt, sizeof salt) < 0)
|
||||||
goto end;
|
goto end;
|
||||||
/* If -P option then don't bother writing */
|
/* If -P option then don't bother writing */
|
||||||
if((printkey != 2)
|
if((printkey != 2)
|
||||||
@@ -472,14 +455,14 @@ bad:
|
|||||||
sizeof magic-1) != sizeof magic-1
|
sizeof magic-1) != sizeof magic-1
|
||||||
|| BIO_write(wbio,
|
|| BIO_write(wbio,
|
||||||
(char *)salt,
|
(char *)salt,
|
||||||
PKCS5_SALT_LEN) != PKCS5_SALT_LEN)) {
|
sizeof salt) != sizeof salt)) {
|
||||||
BIO_printf(bio_err,"error writing output file\n");
|
BIO_printf(bio_err,"error writing output file\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else if(BIO_read(rbio,mbuf,sizeof mbuf) != sizeof mbuf
|
} else if(BIO_read(rbio,mbuf,sizeof mbuf) != sizeof mbuf
|
||||||
|| BIO_read(rbio,
|
|| BIO_read(rbio,
|
||||||
(unsigned char *)salt,
|
(unsigned char *)salt,
|
||||||
PKCS5_SALT_LEN) != PKCS5_SALT_LEN) {
|
sizeof salt) != sizeof salt) {
|
||||||
BIO_printf(bio_err,"error reading input file\n");
|
BIO_printf(bio_err,"error reading input file\n");
|
||||||
goto end;
|
goto end;
|
||||||
} else if(memcmp(mbuf,magic,sizeof magic-1)) {
|
} else if(memcmp(mbuf,magic,sizeof magic-1)) {
|
||||||
@@ -498,16 +481,24 @@ bad:
|
|||||||
* bug picked up by
|
* bug picked up by
|
||||||
* Larry J. Hughes Jr. <hughes@indiana.edu> */
|
* Larry J. Hughes Jr. <hughes@indiana.edu> */
|
||||||
if (str == strbuf)
|
if (str == strbuf)
|
||||||
memset(str,0,SIZE);
|
OPENSSL_cleanse(str,SIZE);
|
||||||
else
|
else
|
||||||
memset(str,0,strlen(str));
|
OPENSSL_cleanse(str,strlen(str));
|
||||||
}
|
}
|
||||||
if ((hiv != NULL) && !set_hex(hiv,iv,8))
|
if ((hiv != NULL) && !set_hex(hiv,iv,sizeof iv))
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"invalid hex iv value\n");
|
BIO_printf(bio_err,"invalid hex iv value\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if ((hkey != NULL) && !set_hex(hkey,key,24))
|
if ((hiv == NULL) && (str == NULL))
|
||||||
|
{
|
||||||
|
/* No IV was explicitly set and no IV was generated
|
||||||
|
* during EVP_BytesToKey. Hence the IV is undefined,
|
||||||
|
* making correct decryption impossible. */
|
||||||
|
BIO_printf(bio_err, "iv undefined\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if ((hkey != NULL) && !set_hex(hkey,key,sizeof key))
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"invalid hex key value\n");
|
BIO_printf(bio_err,"invalid hex key value\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -516,6 +507,12 @@ bad:
|
|||||||
if ((benc=BIO_new(BIO_f_cipher())) == NULL)
|
if ((benc=BIO_new(BIO_f_cipher())) == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
BIO_set_cipher(benc,cipher,key,iv,enc);
|
BIO_set_cipher(benc,cipher,key,iv,enc);
|
||||||
|
if (nopad)
|
||||||
|
{
|
||||||
|
EVP_CIPHER_CTX *ctx;
|
||||||
|
BIO_get_cipher_ctx(benc, &ctx);
|
||||||
|
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||||
|
}
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
BIO_set_callback(benc,BIO_debug_callback);
|
BIO_set_callback(benc,BIO_debug_callback);
|
||||||
@@ -527,7 +524,7 @@ bad:
|
|||||||
if (!nosalt)
|
if (!nosalt)
|
||||||
{
|
{
|
||||||
printf("salt=");
|
printf("salt=");
|
||||||
for (i=0; i<PKCS5_SALT_LEN; i++)
|
for (i=0; i<sizeof salt; i++)
|
||||||
printf("%02X",salt[i]);
|
printf("%02X",salt[i]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
@@ -581,14 +578,15 @@ bad:
|
|||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (strbuf != NULL) Free(strbuf);
|
if (strbuf != NULL) OPENSSL_free(strbuf);
|
||||||
if (buff != NULL) Free(buff);
|
if (buff != NULL) OPENSSL_free(buff);
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (benc != NULL) BIO_free(benc);
|
if (benc != NULL) BIO_free(benc);
|
||||||
if (b64 != NULL) BIO_free(b64);
|
if (b64 != NULL) BIO_free(b64);
|
||||||
if(pass) Free(pass);
|
if(pass) OPENSSL_free(pass);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int set_hex(char *in, unsigned char *out, int size)
|
int set_hex(char *in, unsigned char *out, int size)
|
||||||
|
|||||||
520
apps/engine.c
Normal file
520
apps/engine.c
Normal file
@@ -0,0 +1,520 @@
|
|||||||
|
/* apps/engine.c -*- mode: C; c-file-style: "eay" -*- */
|
||||||
|
/* Written by Richard Levitte <richard@levitte.org> for the OpenSSL
|
||||||
|
* project 2000.
|
||||||
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 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
|
||||||
|
* 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>
|
||||||
|
#ifdef OPENSSL_NO_STDIO
|
||||||
|
#define APPS_WIN16
|
||||||
|
#endif
|
||||||
|
#include "apps.h"
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/engine.h>
|
||||||
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
|
#undef PROG
|
||||||
|
#define PROG engine_main
|
||||||
|
|
||||||
|
static char *engine_usage[]={
|
||||||
|
"usage: engine opts [engine ...]\n",
|
||||||
|
" -v[v[v[v]]] - verbose mode, for each engine, list its 'control commands'\n",
|
||||||
|
" -vv will additionally display each command's description\n",
|
||||||
|
" -vvv will also add the input flags for each command\n",
|
||||||
|
" -vvvv will also show internal input flags\n",
|
||||||
|
" -c - for each engine, also list the capabilities\n",
|
||||||
|
" -t - for each engine, check that they are really available\n",
|
||||||
|
" -pre <cmd> - runs command 'cmd' against the ENGINE before any attempts\n",
|
||||||
|
" to load it (if -t is used)\n",
|
||||||
|
" -post <cmd> - runs command 'cmd' against the ENGINE after loading it\n",
|
||||||
|
" (only used if -t is also provided)\n",
|
||||||
|
" NB: -pre and -post will be applied to all ENGINEs supplied on the command\n",
|
||||||
|
" line, or all supported ENGINEs if none are specified.\n",
|
||||||
|
" Eg. '-pre \"SO_PATH:/lib/libdriver.so\"' calls command \"SO_PATH\" with\n",
|
||||||
|
" argument \"/lib/libdriver.so\".\n",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
static void identity(void *ptr)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int append_buf(char **buf, const char *s, int *size, int step)
|
||||||
|
{
|
||||||
|
int l = strlen(s);
|
||||||
|
|
||||||
|
if (*buf == NULL)
|
||||||
|
{
|
||||||
|
*size = step;
|
||||||
|
*buf = OPENSSL_malloc(*size);
|
||||||
|
if (*buf == NULL)
|
||||||
|
return 0;
|
||||||
|
**buf = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (**buf != '\0')
|
||||||
|
l += 2; /* ", " */
|
||||||
|
|
||||||
|
if (strlen(*buf) + strlen(s) >= (unsigned int)*size)
|
||||||
|
{
|
||||||
|
*size += step;
|
||||||
|
*buf = OPENSSL_realloc(*buf, *size);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*buf == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (**buf != '\0')
|
||||||
|
strcat(*buf, ", ");
|
||||||
|
strcat(*buf, s);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int util_flags(BIO *bio_out, unsigned int flags, const char *indent)
|
||||||
|
{
|
||||||
|
int started = 0, err = 0;
|
||||||
|
/* Indent before displaying input flags */
|
||||||
|
BIO_printf(bio_out, "%s%s(input flags): ", indent, indent);
|
||||||
|
if(flags == 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "<no flags>\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/* If the object is internal, mark it in a way that shows instead of
|
||||||
|
* having it part of all the other flags, even if it really is. */
|
||||||
|
if(flags & ENGINE_CMD_FLAG_INTERNAL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "[Internal] ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flags & ENGINE_CMD_FLAG_NUMERIC)
|
||||||
|
{
|
||||||
|
if(started)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "|");
|
||||||
|
err = 1;
|
||||||
|
}
|
||||||
|
BIO_printf(bio_out, "NUMERIC");
|
||||||
|
started = 1;
|
||||||
|
}
|
||||||
|
/* Now we check that no combinations of the mutually exclusive NUMERIC,
|
||||||
|
* STRING, and NO_INPUT flags have been used. Future flags that can be
|
||||||
|
* OR'd together with these would need to added after these to preserve
|
||||||
|
* the testing logic. */
|
||||||
|
if(flags & ENGINE_CMD_FLAG_STRING)
|
||||||
|
{
|
||||||
|
if(started)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "|");
|
||||||
|
err = 1;
|
||||||
|
}
|
||||||
|
BIO_printf(bio_out, "STRING");
|
||||||
|
started = 1;
|
||||||
|
}
|
||||||
|
if(flags & ENGINE_CMD_FLAG_NO_INPUT)
|
||||||
|
{
|
||||||
|
if(started)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "|");
|
||||||
|
err = 1;
|
||||||
|
}
|
||||||
|
BIO_printf(bio_out, "NO_INPUT");
|
||||||
|
started = 1;
|
||||||
|
}
|
||||||
|
/* Check for unknown flags */
|
||||||
|
flags = flags & ~ENGINE_CMD_FLAG_NUMERIC &
|
||||||
|
~ENGINE_CMD_FLAG_STRING &
|
||||||
|
~ENGINE_CMD_FLAG_NO_INPUT &
|
||||||
|
~ENGINE_CMD_FLAG_INTERNAL;
|
||||||
|
if(flags)
|
||||||
|
{
|
||||||
|
if(started) BIO_printf(bio_out, "|");
|
||||||
|
BIO_printf(bio_out, "<0x%04X>", flags);
|
||||||
|
}
|
||||||
|
if(err)
|
||||||
|
BIO_printf(bio_out, " <illegal flags!>");
|
||||||
|
BIO_printf(bio_out, "\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent)
|
||||||
|
{
|
||||||
|
static const int line_wrap = 78;
|
||||||
|
int num;
|
||||||
|
int ret = 0;
|
||||||
|
char *name = NULL;
|
||||||
|
char *desc = NULL;
|
||||||
|
int flags;
|
||||||
|
int xpos = 0;
|
||||||
|
STACK *cmds = NULL;
|
||||||
|
if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
|
||||||
|
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
|
||||||
|
0, NULL, NULL)) <= 0))
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
BIO_printf(bio_out, "%s<no control commands>\n", indent);
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmds = sk_new_null();
|
||||||
|
|
||||||
|
if(!cmds)
|
||||||
|
goto err;
|
||||||
|
do {
|
||||||
|
int len;
|
||||||
|
/* Get the command input flags */
|
||||||
|
if((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num,
|
||||||
|
NULL, NULL)) < 0)
|
||||||
|
goto err;
|
||||||
|
if (!(flags & ENGINE_CMD_FLAG_INTERNAL) || verbose >= 4)
|
||||||
|
{
|
||||||
|
/* Get the command name */
|
||||||
|
if((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_LEN_FROM_CMD, num,
|
||||||
|
NULL, NULL)) <= 0)
|
||||||
|
goto err;
|
||||||
|
if((name = OPENSSL_malloc(len + 1)) == NULL)
|
||||||
|
goto err;
|
||||||
|
if(ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_FROM_CMD, num, name,
|
||||||
|
NULL) <= 0)
|
||||||
|
goto err;
|
||||||
|
/* Get the command description */
|
||||||
|
if((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_LEN_FROM_CMD, num,
|
||||||
|
NULL, NULL)) < 0)
|
||||||
|
goto err;
|
||||||
|
if(len > 0)
|
||||||
|
{
|
||||||
|
if((desc = OPENSSL_malloc(len + 1)) == NULL)
|
||||||
|
goto err;
|
||||||
|
if(ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_FROM_CMD, num, desc,
|
||||||
|
NULL) <= 0)
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
/* Now decide on the output */
|
||||||
|
if(xpos == 0)
|
||||||
|
/* Do an indent */
|
||||||
|
xpos = BIO_printf(bio_out, indent);
|
||||||
|
else
|
||||||
|
/* Otherwise prepend a ", " */
|
||||||
|
xpos += BIO_printf(bio_out, ", ");
|
||||||
|
if(verbose == 1)
|
||||||
|
{
|
||||||
|
/* We're just listing names, comma-delimited */
|
||||||
|
if((xpos > (int)strlen(indent)) &&
|
||||||
|
(xpos + (int)strlen(name) > line_wrap))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "\n");
|
||||||
|
xpos = BIO_printf(bio_out, indent);
|
||||||
|
}
|
||||||
|
xpos += BIO_printf(bio_out, "%s", name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We're listing names plus descriptions */
|
||||||
|
BIO_printf(bio_out, "%s: %s\n", name,
|
||||||
|
(desc == NULL) ? "<no description>" : desc);
|
||||||
|
/* ... and sometimes input flags */
|
||||||
|
if((verbose >= 3) && !util_flags(bio_out, flags,
|
||||||
|
indent))
|
||||||
|
goto err;
|
||||||
|
xpos = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OPENSSL_free(name); name = NULL;
|
||||||
|
if(desc) { OPENSSL_free(desc); desc = NULL; }
|
||||||
|
/* Move to the next command */
|
||||||
|
num = ENGINE_ctrl(e, ENGINE_CTRL_GET_NEXT_CMD_TYPE,
|
||||||
|
num, NULL, NULL);
|
||||||
|
} while(num > 0);
|
||||||
|
if(xpos > 0)
|
||||||
|
BIO_printf(bio_out, "\n");
|
||||||
|
ret = 1;
|
||||||
|
err:
|
||||||
|
if(cmds) sk_pop_free(cmds, identity);
|
||||||
|
if(name) OPENSSL_free(name);
|
||||||
|
if(desc) OPENSSL_free(desc);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void util_do_cmds(ENGINE *e, STACK *cmds, BIO *bio_out, const char *indent)
|
||||||
|
{
|
||||||
|
int loop, res, num = sk_num(cmds);
|
||||||
|
if(num < 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "[Error]: internal stack error\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for(loop = 0; loop < num; loop++)
|
||||||
|
{
|
||||||
|
char buf[256];
|
||||||
|
const char *cmd, *arg;
|
||||||
|
cmd = sk_value(cmds, loop);
|
||||||
|
res = 1; /* assume success */
|
||||||
|
/* Check if this command has no ":arg" */
|
||||||
|
if((arg = strstr(cmd, ":")) == NULL)
|
||||||
|
{
|
||||||
|
if(!ENGINE_ctrl_cmd_string(e, cmd, NULL, 0))
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if((int)(arg - cmd) > 254)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out,"[Error]: command name too long\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
memcpy(buf, cmd, (int)(arg - cmd));
|
||||||
|
buf[arg-cmd] = '\0';
|
||||||
|
arg++; /* Move past the ":" */
|
||||||
|
/* Call the command with the argument */
|
||||||
|
if(!ENGINE_ctrl_cmd_string(e, buf, arg, 0))
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
|
if(res)
|
||||||
|
BIO_printf(bio_out, "[Success]: %s\n", cmd);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "[Failure]: %s\n", cmd);
|
||||||
|
ERR_print_errors(bio_out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int MAIN(int, char **);
|
||||||
|
|
||||||
|
int MAIN(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int ret=1,i;
|
||||||
|
char **pp;
|
||||||
|
int verbose=0, list_cap=0, test_avail=0;
|
||||||
|
ENGINE *e;
|
||||||
|
STACK *engines = sk_new_null();
|
||||||
|
STACK *pre_cmds = sk_new_null();
|
||||||
|
STACK *post_cmds = sk_new_null();
|
||||||
|
int badops=1;
|
||||||
|
BIO *bio_out=NULL;
|
||||||
|
const char *indent = " ";
|
||||||
|
|
||||||
|
apps_startup();
|
||||||
|
SSL_load_error_strings();
|
||||||
|
|
||||||
|
if (bio_err == NULL)
|
||||||
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
bio_out=BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
bio_out = BIO_push(tmpbio, bio_out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
while (argc >= 1)
|
||||||
|
{
|
||||||
|
if (strncmp(*argv,"-v",2) == 0)
|
||||||
|
{
|
||||||
|
if(strspn(*argv + 1, "v") < strlen(*argv + 1))
|
||||||
|
goto skip_arg_loop;
|
||||||
|
if((verbose=strlen(*argv + 1)) > 4)
|
||||||
|
goto skip_arg_loop;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-c") == 0)
|
||||||
|
list_cap=1;
|
||||||
|
else if (strcmp(*argv,"-t") == 0)
|
||||||
|
test_avail=1;
|
||||||
|
else if (strcmp(*argv,"-pre") == 0)
|
||||||
|
{
|
||||||
|
argc--; argv++;
|
||||||
|
sk_push(pre_cmds,*argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-post") == 0)
|
||||||
|
{
|
||||||
|
argc--; argv++;
|
||||||
|
sk_push(post_cmds,*argv);
|
||||||
|
}
|
||||||
|
else if ((strncmp(*argv,"-h",2) == 0) ||
|
||||||
|
(strcmp(*argv,"-?") == 0))
|
||||||
|
goto skip_arg_loop;
|
||||||
|
else
|
||||||
|
sk_push(engines,*argv);
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
/* Looks like everything went OK */
|
||||||
|
badops = 0;
|
||||||
|
skip_arg_loop:
|
||||||
|
|
||||||
|
if (badops)
|
||||||
|
{
|
||||||
|
for (pp=engine_usage; (*pp != NULL); pp++)
|
||||||
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sk_num(engines) == 0)
|
||||||
|
{
|
||||||
|
for(e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e))
|
||||||
|
{
|
||||||
|
sk_push(engines,(char *)ENGINE_get_id(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i=0; i<sk_num(engines); i++)
|
||||||
|
{
|
||||||
|
const char *id = sk_value(engines,i);
|
||||||
|
if ((e = ENGINE_by_id(id)) != NULL)
|
||||||
|
{
|
||||||
|
const char *name = ENGINE_get_name(e);
|
||||||
|
/* Do "id" first, then "name". Easier to auto-parse. */
|
||||||
|
BIO_printf(bio_out, "(%s) %s\n", id, name);
|
||||||
|
util_do_cmds(e, pre_cmds, bio_out, indent);
|
||||||
|
if (strcmp(ENGINE_get_id(e), id) != 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "Loaded: (%s) %s\n",
|
||||||
|
ENGINE_get_id(e), ENGINE_get_name(e));
|
||||||
|
}
|
||||||
|
if (list_cap)
|
||||||
|
{
|
||||||
|
int cap_size = 256;
|
||||||
|
char *cap_buf = NULL;
|
||||||
|
int k,n;
|
||||||
|
const int *nids;
|
||||||
|
ENGINE_CIPHERS_PTR fn_c;
|
||||||
|
ENGINE_DIGESTS_PTR fn_d;
|
||||||
|
|
||||||
|
if (ENGINE_get_RSA(e) != NULL
|
||||||
|
&& !append_buf(&cap_buf, "RSA",
|
||||||
|
&cap_size, 256))
|
||||||
|
goto end;
|
||||||
|
if (ENGINE_get_DSA(e) != NULL
|
||||||
|
&& !append_buf(&cap_buf, "DSA",
|
||||||
|
&cap_size, 256))
|
||||||
|
goto end;
|
||||||
|
if (ENGINE_get_DH(e) != NULL
|
||||||
|
&& !append_buf(&cap_buf, "DH",
|
||||||
|
&cap_size, 256))
|
||||||
|
goto end;
|
||||||
|
if (ENGINE_get_RAND(e) != NULL
|
||||||
|
&& !append_buf(&cap_buf, "RAND",
|
||||||
|
&cap_size, 256))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
fn_c = ENGINE_get_ciphers(e);
|
||||||
|
if(!fn_c) goto skip_ciphers;
|
||||||
|
n = fn_c(e, NULL, &nids, 0);
|
||||||
|
for(k=0 ; k < n ; ++k)
|
||||||
|
if(!append_buf(&cap_buf,
|
||||||
|
OBJ_nid2sn(nids[k]),
|
||||||
|
&cap_size, 256))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
skip_ciphers:
|
||||||
|
fn_d = ENGINE_get_digests(e);
|
||||||
|
if(!fn_d) goto skip_digests;
|
||||||
|
n = fn_d(e, NULL, &nids, 0);
|
||||||
|
for(k=0 ; k < n ; ++k)
|
||||||
|
if(!append_buf(&cap_buf,
|
||||||
|
OBJ_nid2sn(nids[k]),
|
||||||
|
&cap_size, 256))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
skip_digests:
|
||||||
|
if (cap_buf && (*cap_buf != '\0'))
|
||||||
|
BIO_printf(bio_out, " [%s]\n", cap_buf);
|
||||||
|
|
||||||
|
OPENSSL_free(cap_buf);
|
||||||
|
}
|
||||||
|
if(test_avail)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "%s", indent);
|
||||||
|
if (ENGINE_init(e))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "[ available ]\n");
|
||||||
|
util_do_cmds(e, post_cmds, bio_out, indent);
|
||||||
|
ENGINE_finish(e);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_out, "[ unavailable ]\n");
|
||||||
|
ERR_print_errors_fp(stdout);
|
||||||
|
ERR_clear_error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if((verbose > 0) && !util_verbose(e, verbose, bio_out, indent))
|
||||||
|
goto end;
|
||||||
|
ENGINE_free(e);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret=0;
|
||||||
|
end:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
sk_pop_free(engines, identity);
|
||||||
|
sk_pop_free(pre_cmds, identity);
|
||||||
|
sk_pop_free(post_cmds, identity);
|
||||||
|
if (bio_out != NULL) BIO_free_all(bio_out);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
|
}
|
||||||
@@ -91,12 +91,18 @@ int MAIN(int argc, char **argv)
|
|||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((out != NULL) && BIO_set_fp(out,stdout,BIO_NOCLOSE))
|
if ((out != NULL) && BIO_set_fp(out,stdout,BIO_NOCLOSE))
|
||||||
{
|
{
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
lh_node_stats_bio((LHASH *)ERR_get_string_table(),out);
|
lh_node_stats_bio((LHASH *)ERR_get_string_table(),out);
|
||||||
lh_stats_bio((LHASH *)ERR_get_string_table(),out);
|
lh_stats_bio((LHASH *)ERR_get_string_table(),out);
|
||||||
lh_node_usage_stats_bio((LHASH *)
|
lh_node_usage_stats_bio((LHASH *)
|
||||||
ERR_get_string_table(),out);
|
ERR_get_string_table(),out);
|
||||||
}
|
}
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
@@ -104,7 +110,10 @@ int MAIN(int argc, char **argv)
|
|||||||
for (i=1; i<argc; i++)
|
for (i=1; i<argc; i++)
|
||||||
{
|
{
|
||||||
if (sscanf(argv[i],"%lx",&l))
|
if (sscanf(argv[i],"%lx",&l))
|
||||||
printf("%s\n",ERR_error_string(l,buf));
|
{
|
||||||
|
ERR_error_string_n(l, buf, sizeof buf);
|
||||||
|
printf("%s\n",buf);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("%s: bad error code\n",argv[i]);
|
printf("%s: bad error code\n",argv[i]);
|
||||||
@@ -112,5 +121,6 @@ int MAIN(int argc, char **argv)
|
|||||||
ret++;
|
ret++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
34
apps/gendh.c
34
apps/gendh.c
@@ -57,7 +57,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -81,11 +81,13 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
DH *dh=NULL;
|
DH *dh=NULL;
|
||||||
int ret=1,num=DEFBITS;
|
int ret=1,num=DEFBITS;
|
||||||
int g=2;
|
int g=2;
|
||||||
char *outfile=NULL;
|
char *outfile=NULL;
|
||||||
char *inrand=NULL;
|
char *inrand=NULL;
|
||||||
|
char *engine=NULL;
|
||||||
BIO *out=NULL;
|
BIO *out=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
@@ -94,6 +96,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
argc--;
|
argc--;
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -110,6 +115,11 @@ int MAIN(int argc, char **argv)
|
|||||||
g=3; */
|
g=3; */
|
||||||
else if (strcmp(*argv,"-5") == 0)
|
else if (strcmp(*argv,"-5") == 0)
|
||||||
g=5;
|
g=5;
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -125,15 +135,18 @@ int MAIN(int argc, char **argv)
|
|||||||
bad:
|
bad:
|
||||||
BIO_printf(bio_err,"usage: gendh [args] [numbits]\n");
|
BIO_printf(bio_err,"usage: gendh [args] [numbits]\n");
|
||||||
BIO_printf(bio_err," -out file - output the key to 'file\n");
|
BIO_printf(bio_err," -out file - output the key to 'file\n");
|
||||||
BIO_printf(bio_err," -2 use 2 as the generator value\n");
|
BIO_printf(bio_err," -2 - use 2 as the generator value\n");
|
||||||
/* BIO_printf(bio_err," -3 use 3 as the generator value\n"); */
|
/* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */
|
||||||
BIO_printf(bio_err," -5 use 5 as the generator value\n");
|
BIO_printf(bio_err," -5 - use 5 as the generator value\n");
|
||||||
|
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
{
|
{
|
||||||
@@ -142,7 +155,15 @@ bad:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -174,9 +195,10 @@ bad:
|
|||||||
end:
|
end:
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dh != NULL) DH_free(dh);
|
if (dh != NULL) DH_free(dh);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
static void MS_CALLBACK dh_cb(int p, int n, void *arg)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -77,13 +77,15 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
DSA *dsa=NULL;
|
DSA *dsa=NULL;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
char *outfile=NULL;
|
char *outfile=NULL;
|
||||||
char *inrand=NULL,*dsaparams=NULL;
|
char *inrand=NULL,*dsaparams=NULL;
|
||||||
char *passargout = NULL, *passout = NULL;
|
char *passargout = NULL, *passout = NULL;
|
||||||
BIO *out=NULL,*in=NULL;
|
BIO *out=NULL,*in=NULL;
|
||||||
EVP_CIPHER *enc=NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -91,6 +93,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
argc--;
|
argc--;
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -106,6 +111,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargout= *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -113,15 +123,23 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (strcmp(*argv,"-") == 0)
|
else if (strcmp(*argv,"-") == 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
else if (strcmp(*argv,"-des") == 0)
|
else if (strcmp(*argv,"-des") == 0)
|
||||||
enc=EVP_des_cbc();
|
enc=EVP_des_cbc();
|
||||||
else if (strcmp(*argv,"-des3") == 0)
|
else if (strcmp(*argv,"-des3") == 0)
|
||||||
enc=EVP_des_ede3_cbc();
|
enc=EVP_des_ede3_cbc();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
else if (strcmp(*argv,"-idea") == 0)
|
else if (strcmp(*argv,"-idea") == 0)
|
||||||
enc=EVP_idea_cbc();
|
enc=EVP_idea_cbc();
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
else if (strcmp(*argv,"-aes128") == 0)
|
||||||
|
enc=EVP_aes_128_cbc();
|
||||||
|
else if (strcmp(*argv,"-aes192") == 0)
|
||||||
|
enc=EVP_aes_192_cbc();
|
||||||
|
else if (strcmp(*argv,"-aes256") == 0)
|
||||||
|
enc=EVP_aes_256_cbc();
|
||||||
#endif
|
#endif
|
||||||
else if (**argv != '-' && dsaparams == NULL)
|
else if (**argv != '-' && dsaparams == NULL)
|
||||||
{
|
{
|
||||||
@@ -138,13 +156,18 @@ int MAIN(int argc, char **argv)
|
|||||||
bad:
|
bad:
|
||||||
BIO_printf(bio_err,"usage: gendsa [args] dsaparam-file\n");
|
BIO_printf(bio_err,"usage: gendsa [args] dsaparam-file\n");
|
||||||
BIO_printf(bio_err," -out file - output the key to 'file'\n");
|
BIO_printf(bio_err," -out file - output the key to 'file'\n");
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
BIO_printf(bio_err," -des - encrypt the generated key with DES in cbc mode\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," -des3 - encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_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
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
|
#endif
|
||||||
|
BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
@@ -153,6 +176,8 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -178,7 +203,15 @@ bad:
|
|||||||
if (out == NULL) goto end;
|
if (out == NULL) goto end;
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -209,9 +242,10 @@ end:
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (dsa != NULL) DSA_free(dsa);
|
if (dsa != NULL) DSA_free(dsa);
|
||||||
if(passout) Free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -69,6 +69,7 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
#include <openssl/rand.h>
|
||||||
|
|
||||||
#define DEFBITS 512
|
#define DEFBITS 512
|
||||||
#undef PROG
|
#undef PROG
|
||||||
@@ -80,14 +81,16 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
RSA *rsa=NULL;
|
RSA *rsa=NULL;
|
||||||
int i,num=DEFBITS;
|
int i,num=DEFBITS;
|
||||||
long l;
|
long l;
|
||||||
EVP_CIPHER *enc=NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
unsigned long f4=RSA_F4;
|
unsigned long f4=RSA_F4;
|
||||||
char *outfile=NULL;
|
char *outfile=NULL;
|
||||||
char *passargout = NULL, *passout = NULL;
|
char *passargout = NULL, *passout = NULL;
|
||||||
|
char *engine=NULL;
|
||||||
char *inrand=NULL;
|
char *inrand=NULL;
|
||||||
BIO *out=NULL;
|
BIO *out=NULL;
|
||||||
|
|
||||||
@@ -96,6 +99,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto err;
|
||||||
if ((out=BIO_new(BIO_s_file())) == NULL)
|
if ((out=BIO_new(BIO_s_file())) == NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unable to create BIO for output\n");
|
BIO_printf(bio_err,"unable to create BIO for output\n");
|
||||||
@@ -114,22 +120,35 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (strcmp(*argv,"-3") == 0)
|
else if (strcmp(*argv,"-3") == 0)
|
||||||
f4=3;
|
f4=3;
|
||||||
else if (strcmp(*argv,"-F4") == 0)
|
else if (strcmp(*argv,"-F4") == 0 || strcmp(*argv,"-f4") == 0)
|
||||||
f4=RSA_F4;
|
f4=RSA_F4;
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-rand") == 0)
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
inrand= *(++argv);
|
inrand= *(++argv);
|
||||||
}
|
}
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
else if (strcmp(*argv,"-des") == 0)
|
else if (strcmp(*argv,"-des") == 0)
|
||||||
enc=EVP_des_cbc();
|
enc=EVP_des_cbc();
|
||||||
else if (strcmp(*argv,"-des3") == 0)
|
else if (strcmp(*argv,"-des3") == 0)
|
||||||
enc=EVP_des_ede3_cbc();
|
enc=EVP_des_ede3_cbc();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
else if (strcmp(*argv,"-idea") == 0)
|
else if (strcmp(*argv,"-idea") == 0)
|
||||||
enc=EVP_idea_cbc();
|
enc=EVP_idea_cbc();
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
else if (strcmp(*argv,"-aes128") == 0)
|
||||||
|
enc=EVP_aes_128_cbc();
|
||||||
|
else if (strcmp(*argv,"-aes192") == 0)
|
||||||
|
enc=EVP_aes_192_cbc();
|
||||||
|
else if (strcmp(*argv,"-aes256") == 0)
|
||||||
|
enc=EVP_aes_256_cbc();
|
||||||
#endif
|
#endif
|
||||||
else if (strcmp(*argv,"-passout") == 0)
|
else if (strcmp(*argv,"-passout") == 0)
|
||||||
{
|
{
|
||||||
@@ -147,13 +166,18 @@ bad:
|
|||||||
BIO_printf(bio_err,"usage: genrsa [args] [numbits]\n");
|
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," -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," -des3 encrypt the generated key with DES in ede cbc mode (168 bit key)\n");
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_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
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err," -out file output the key to 'file\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," -passout arg output file pass phrase source\n");
|
||||||
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
|
BIO_printf(bio_err," -f4 use F4 (0x10001) for the E value\n");
|
||||||
BIO_printf(bio_err," -3 use 3 for the E value\n");
|
BIO_printf(bio_err," -3 use 3 for the E value\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err," load the file (or the files in the directory) into\n");
|
BIO_printf(bio_err," load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err," the random number generator\n");
|
BIO_printf(bio_err," the random number generator\n");
|
||||||
@@ -167,8 +191,18 @@ bad:
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -178,7 +212,8 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL)
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
||||||
|
&& !RAND_status())
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n");
|
||||||
}
|
}
|
||||||
@@ -206,17 +241,24 @@ bad:
|
|||||||
l+=rsa->e->d[i];
|
l+=rsa->e->d[i];
|
||||||
}
|
}
|
||||||
BIO_printf(bio_err,"e is %ld (0x%lX)\n",l,l);
|
BIO_printf(bio_err,"e is %ld (0x%lX)\n",l,l);
|
||||||
if (!PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,NULL, passout))
|
{
|
||||||
|
PW_CB_DATA cb_data;
|
||||||
|
cb_data.password = passout;
|
||||||
|
cb_data.prompt_info = outfile;
|
||||||
|
if (!PEM_write_bio_RSAPrivateKey(out,rsa,enc,NULL,0,
|
||||||
|
(pem_password_cb *)password_callback,&cb_data))
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
ret=0;
|
ret=0;
|
||||||
err:
|
err:
|
||||||
if (rsa != NULL) RSA_free(rsa);
|
if (rsa != NULL) RSA_free(rsa);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if(passout) Free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
|
static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
|
||||||
@@ -233,7 +275,7 @@ static void MS_CALLBACK genrsa_cb(int p, int n, void *arg)
|
|||||||
p=n;
|
p=n;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else /* !NO_RSA */
|
#else /* !OPENSSL_NO_RSA */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy=&dummy;
|
static void *dummy=&dummy;
|
||||||
|
|||||||
@@ -15,22 +15,10 @@ $!
|
|||||||
$! It was written so it would try to determine what "C" compiler to
|
$! It was written so it would try to determine what "C" compiler to
|
||||||
$! use or you can specify which "C" compiler to use.
|
$! use or you can specify which "C" compiler to use.
|
||||||
$!
|
$!
|
||||||
$! Specify RSAREF as P1 to compile with the RSAREF library instead of
|
$! Specify DEBUG or NODEBUG as P1 to compile with or without debugger
|
||||||
$! the regular one. If you specify NORSAREF it will compile with the
|
|
||||||
$! regular RSAREF routines. (Note: If you are in the United States
|
|
||||||
$! you MUST compile with RSAREF unless you have a license from RSA).
|
|
||||||
$!
|
|
||||||
$! 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 under the root directory as that
|
|
||||||
$! is where the scripts will look for the files.
|
|
||||||
$!
|
|
||||||
$! Specify DEBUG or NODEBUG as P2 to compile with or without debugger
|
|
||||||
$! information.
|
$! information.
|
||||||
$!
|
$!
|
||||||
$! Specify which compiler at P3 to try to compile under.
|
$! Specify which compiler at P2 to try to compile under.
|
||||||
$!
|
$!
|
||||||
$! VAXC For VAX C.
|
$! VAXC For VAX C.
|
||||||
$! DECC For DEC C.
|
$! DECC For DEC C.
|
||||||
@@ -39,15 +27,16 @@ $!
|
|||||||
$! If you don't speficy a compiler, it will try to determine which
|
$! If you don't speficy a compiler, it will try to determine which
|
||||||
$! "C" compiler to use.
|
$! "C" compiler to use.
|
||||||
$!
|
$!
|
||||||
$! P4, if defined, sets a TCP/IP library to use, through one of the following
|
$! P3, if defined, sets a TCP/IP library to use, through one of the following
|
||||||
$! keywords:
|
$! keywords:
|
||||||
$!
|
$!
|
||||||
$! UCX for UCX
|
$! UCX for UCX
|
||||||
$! SOCKETSHR for SOCKETSHR+NETLIB
|
$! SOCKETSHR for SOCKETSHR+NETLIB
|
||||||
|
$! TCPIP for TCPIP (post UCX)
|
||||||
$!
|
$!
|
||||||
$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
|
$! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
|
||||||
$!
|
$!
|
||||||
$! P6, if defined, sets a choice of programs to compile.
|
$! P5, if defined, sets a choice of programs to compile.
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$! Define A TCP/IP Library That We Will Need To Link To.
|
$! Define A TCP/IP Library That We Will Need To Link To.
|
||||||
@@ -100,10 +89,6 @@ $! Define The CRYPTO Library.
|
|||||||
$!
|
$!
|
||||||
$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB
|
$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB
|
||||||
$!
|
$!
|
||||||
$! Define The RSAREF Library.
|
|
||||||
$!
|
|
||||||
$ RSAREF_LIB := SYS$DISK:[-.'ARCH'.EXE.RSAREF]LIBRSAGLUE.OLB
|
|
||||||
$!
|
|
||||||
$! Define The SSL Library.
|
$! Define The SSL Library.
|
||||||
$!
|
$!
|
||||||
$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB
|
$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB
|
||||||
@@ -154,16 +139,16 @@ $! Define The Application Files.
|
|||||||
$!
|
$!
|
||||||
$ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;DHPARAM;ENC;PASSWD;GENDH;ERRSTR;"+-
|
$ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;DHPARAM;ENC;PASSWD;GENDH;ERRSTR;"+-
|
||||||
"CA;PKCS7;CRL2P7;CRL;"+-
|
"CA;PKCS7;CRL2P7;CRL;"+-
|
||||||
"RSA;DSA;DSAPARAM;"+-
|
"RSA;RSAUTL;DSA;DSAPARAM;EC;ECPARAM;"+-
|
||||||
"X509;GENRSA;GENDSA;S_SERVER;S_CLIENT;SPEED;"+-
|
"X509;GENRSA;GENDSA;S_SERVER;S_CLIENT;SPEED;"+-
|
||||||
"S_TIME;APPS;S_CB;S_SOCKET;APP_RAND;VERSION;SESS_ID;"+-
|
"S_TIME;APPS;S_CB;S_SOCKET;APP_RAND;VERSION;SESS_ID;"+-
|
||||||
"CIPHERS;NSEQ;PKCS12;PKCS8;SPKAC;SMIME;RAND"
|
"CIPHERS;NSEQ;PKCS12;PKCS8;SPKAC;SMIME;RAND;ENGINE;OCSP"
|
||||||
$ 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,-
|
$ 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,-
|
CA.OBJ,PKCS7.OBJ,CRL2P7.OBJ,CRL.OBJ,-
|
||||||
RSA.OBJ,DSA.OBJ,DSAPARAM.OBJ,-
|
RSA.OBJ,RSAUTL.OBJ,DSA.OBJ,DSAPARAM.OBJ,EC.OBJ,ECPARAM.OBJ,-
|
||||||
X509.OBJ,GENRSA.OBJ,GENDSA.OBJ,S_SERVER.OBJ,S_CLIENT.OBJ,SPEED.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,APP_RAND.OBJ,VERSION.OBJ,SESS_ID.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,RAND.OBJ
|
CIPHERS.OBJ,NSEQ.OBJ,PKCS12.OBJ,PKCS8.OBJ,SPKAC.OBJ,SMIME.OBJ,RAND.OBJ,ENGINE.OBJ,OCSP.OBJ
|
||||||
$ TCPIP_PROGRAMS = ",,"
|
$ TCPIP_PROGRAMS = ",,"
|
||||||
$ IF COMPILER .EQS. "VAXC" THEN -
|
$ IF COMPILER .EQS. "VAXC" THEN -
|
||||||
TCPIP_PROGRAMS = ",OPENSSL,"
|
TCPIP_PROGRAMS = ",OPENSSL,"
|
||||||
@@ -292,45 +277,7 @@ $ WRITE SYS$OUTPUT FILE_NAME," needs a TCP/IP library. Can't link. Skipping.
|
|||||||
$ GOTO NEXT_FILE
|
$ GOTO NEXT_FILE
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! Link The Program, Check To See If We Need To Link With RSAREF Or Not.
|
$! Link The Program.
|
||||||
$!
|
|
||||||
$ IF (RSAREF.EQS."TRUE")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! Check To See If We Are To Link With A Specific TCP/IP Library.
|
|
||||||
$!
|
|
||||||
$ IF (TCPIP_LIB.NES."")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! Link With The RSAREF Library And A Specific TCP/IP Library.
|
|
||||||
$!
|
|
||||||
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
|
|
||||||
'OBJECT_FILE''EXTRA_OBJ', -
|
|
||||||
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, -
|
|
||||||
'TCPIP_LIB','OPT_FILE'/OPTION
|
|
||||||
$!
|
|
||||||
$! Else...
|
|
||||||
$!
|
|
||||||
$ ELSE
|
|
||||||
$!
|
|
||||||
$! Link With The RSAREF Library And NO TCP/IP Library.
|
|
||||||
$!
|
|
||||||
$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' -
|
|
||||||
'OBJECT_FILE''EXTRA_OBJ', -
|
|
||||||
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, -
|
|
||||||
'OPT_FILE'/OPTION
|
|
||||||
$!
|
|
||||||
$! End The TCP/IP Library Check.
|
|
||||||
$!
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! Else...
|
|
||||||
$!
|
|
||||||
$ ELSE
|
|
||||||
$!
|
|
||||||
$! Don't Link With The RSAREF Routines.
|
|
||||||
$!
|
|
||||||
$!
|
|
||||||
$! Check To See If We Are To Link With A Specific TCP/IP Library.
|
$! Check To See If We Are To Link With A Specific TCP/IP Library.
|
||||||
$!
|
$!
|
||||||
$ IF (TCPIP_LIB.NES."")
|
$ IF (TCPIP_LIB.NES."")
|
||||||
@@ -358,10 +305,6 @@ $! End The TCP/IP Library Check.
|
|||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! End The RSAREF Link Check.
|
|
||||||
$!
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! Go Back And Do It Again.
|
$! Go Back And Do It Again.
|
||||||
$!
|
$!
|
||||||
$ GOTO NEXT_FILE
|
$ GOTO NEXT_FILE
|
||||||
@@ -525,32 +468,6 @@ $! End The Crypto Library Check.
|
|||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! See If We Need The RSAREF Library.
|
|
||||||
$!
|
|
||||||
$ IF (RSAREF.EQS."TRUE")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! Look For The Library LIBRSAGLUE.OLB.
|
|
||||||
$!
|
|
||||||
$ IF (F$SEARCH(RSAREF_LIB).EQS."")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! Tell The User We Can't Find The LIBRSAGLUE.OLB Library.
|
|
||||||
$!
|
|
||||||
$ WRITE SYS$OUTPUT ""
|
|
||||||
$ WRITE SYS$OUTPUT "Can't Find The Library ",RSAREF_LIB,"."
|
|
||||||
$ WRITE SYS$OUTPUT "We Can't Link Without It."
|
|
||||||
$ WRITE SYS$OUTPUT ""
|
|
||||||
$!
|
|
||||||
$! Since We Can't Link Without It, Exit.
|
|
||||||
$!
|
|
||||||
$ EXIT
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! End The RSAREF Library Check.
|
|
||||||
$!
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! Look For The Library LIBSSL.OLB.
|
$! Look For The Library LIBSSL.OLB.
|
||||||
$!
|
$!
|
||||||
$ IF (F$SEARCH(SSL_LIB).EQS."")
|
$ IF (F$SEARCH(SSL_LIB).EQS."")
|
||||||
@@ -581,86 +498,10 @@ $ CHECK_OPTIONS:
|
|||||||
$!
|
$!
|
||||||
$! Check To See If P1 Is Blank.
|
$! Check To See If P1 Is Blank.
|
||||||
$!
|
$!
|
||||||
$ IF (P1.EQS."NORSAREF")
|
$ IF (P1.EQS."NODEBUG")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! P1 Is NORSAREF, So Compile With The Regular RSA Libraries.
|
$! P1 Is NODEBUG, So Compile Without Debugger Information.
|
||||||
$!
|
|
||||||
$ RSAREF = "FALSE"
|
|
||||||
$!
|
|
||||||
$! Else...
|
|
||||||
$!
|
|
||||||
$ ELSE
|
|
||||||
$!
|
|
||||||
$! Check To See If We Are To Use The RSAREF Library.
|
|
||||||
$!
|
|
||||||
$ IF (P1.EQS."RSAREF")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! Check To Make Sure We Have The RSAREF Source Code Directory.
|
|
||||||
$!
|
|
||||||
$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]SOURCE.DIR").EQS."")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! We Don't Have The RSAREF Souce Code Directory, So Tell The
|
|
||||||
$! User This.
|
|
||||||
$!
|
|
||||||
$ WRITE SYS$OUTPUT ""
|
|
||||||
$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code."
|
|
||||||
$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to"
|
|
||||||
$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the"
|
|
||||||
$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file"
|
|
||||||
$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory"
|
|
||||||
$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files."
|
|
||||||
$ WRITE SYS$OUTPUT ""
|
|
||||||
$!
|
|
||||||
$! Time To Exit.
|
|
||||||
$!
|
|
||||||
$ EXIT
|
|
||||||
$!
|
|
||||||
$! Else...
|
|
||||||
$!
|
|
||||||
$ ELSE
|
|
||||||
$!
|
|
||||||
$! Compile Using The RSAREF Library.
|
|
||||||
$!
|
|
||||||
$ RSAREF = "TRUE"
|
|
||||||
$!
|
|
||||||
$! End The RSAREF Soure Directory Check.
|
|
||||||
$!
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! Else...
|
|
||||||
$!
|
|
||||||
$ ELSE
|
|
||||||
$!
|
|
||||||
$! They Entered An Invalid Option..
|
|
||||||
$!
|
|
||||||
$ WRITE SYS$OUTPUT ""
|
|
||||||
$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
|
|
||||||
$ WRITE SYS$OUTPUT ""
|
|
||||||
$ WRITE SYS$OUTPUT " RSAREF : Compile With The RSAREF Library."
|
|
||||||
$ WRITE SYS$OUTPUT " NORSAREF : Compile With The Regular RSA Library."
|
|
||||||
$ WRITE SYS$OUTPUT ""
|
|
||||||
$!
|
|
||||||
$! Time To EXIT.
|
|
||||||
$!
|
|
||||||
$ EXIT
|
|
||||||
$!
|
|
||||||
$! End The Valid Arguement Check.
|
|
||||||
$!
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! End P1 Check.
|
|
||||||
$!
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! Check To See If P2 Is Blank.
|
|
||||||
$!
|
|
||||||
$ IF (P2.EQS."NODEBUG")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! P2 Is NODEBUG, So Compile Without Debugger Information.
|
|
||||||
$!
|
$!
|
||||||
$ DEBUGGER = "NODEBUG"
|
$ DEBUGGER = "NODEBUG"
|
||||||
$ TRACEBACK = "NOTRACEBACK"
|
$ TRACEBACK = "NOTRACEBACK"
|
||||||
@@ -675,7 +516,7 @@ $ ELSE
|
|||||||
$!
|
$!
|
||||||
$! Check To See If We Are To Compile With Debugger Information.
|
$! Check To See If We Are To Compile With Debugger Information.
|
||||||
$!
|
$!
|
||||||
$ IF (P2.EQS."DEBUG")
|
$ IF (P1.EQS."DEBUG")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Compile With Debugger Information.
|
$! Compile With Debugger Information.
|
||||||
@@ -691,7 +532,7 @@ $!
|
|||||||
$! Tell The User Entered An Invalid Option..
|
$! Tell The User Entered An Invalid Option..
|
||||||
$!
|
$!
|
||||||
$ WRITE SYS$OUTPUT ""
|
$ WRITE SYS$OUTPUT ""
|
||||||
$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
|
$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
|
||||||
$ WRITE SYS$OUTPUT ""
|
$ WRITE SYS$OUTPUT ""
|
||||||
$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
|
$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information."
|
||||||
$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
|
$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information."
|
||||||
@@ -705,13 +546,13 @@ $! End The Valid Arguement Check.
|
|||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! End The P2 Check.
|
$! End The P1 Check.
|
||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! Check To See If P3 Is Blank.
|
$! Check To See If P2 Is Blank.
|
||||||
$!
|
$!
|
||||||
$ IF (P3.EQS."")
|
$ IF (P2.EQS."")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! O.K., The User Didn't Specify A Compiler, Let's Try To
|
$! O.K., The User Didn't Specify A Compiler, Let's Try To
|
||||||
@@ -724,7 +565,7 @@ $ THEN
|
|||||||
$!
|
$!
|
||||||
$! Looks Like GNUC, Set To Use GNUC.
|
$! Looks Like GNUC, Set To Use GNUC.
|
||||||
$!
|
$!
|
||||||
$ P3 = "GNUC"
|
$ P2 = "GNUC"
|
||||||
$!
|
$!
|
||||||
$! Else...
|
$! Else...
|
||||||
$!
|
$!
|
||||||
@@ -737,7 +578,7 @@ $ THEN
|
|||||||
$!
|
$!
|
||||||
$! Looks Like DECC, Set To Use DECC.
|
$! Looks Like DECC, Set To Use DECC.
|
||||||
$!
|
$!
|
||||||
$ P3 = "DECC"
|
$ P2 = "DECC"
|
||||||
$!
|
$!
|
||||||
$! Else...
|
$! Else...
|
||||||
$!
|
$!
|
||||||
@@ -745,7 +586,7 @@ $ ELSE
|
|||||||
$!
|
$!
|
||||||
$! Looks Like VAXC, Set To Use VAXC.
|
$! Looks Like VAXC, Set To Use VAXC.
|
||||||
$!
|
$!
|
||||||
$ P3 = "VAXC"
|
$ P2 = "VAXC"
|
||||||
$!
|
$!
|
||||||
$! End The VAXC Compiler Check.
|
$! End The VAXC Compiler Check.
|
||||||
$!
|
$!
|
||||||
@@ -759,9 +600,9 @@ $! End The Compiler Check.
|
|||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! Check To See If We Have A Option For P4.
|
$! Check To See If We Have A Option For P3.
|
||||||
$!
|
$!
|
||||||
$ IF (P4.EQS."")
|
$ IF (P3.EQS."")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Find out what socket library we have available
|
$! Find out what socket library we have available
|
||||||
@@ -771,7 +612,7 @@ $ THEN
|
|||||||
$!
|
$!
|
||||||
$! We have SOCKETSHR, and it is my opinion that it's the best to use.
|
$! We have SOCKETSHR, and it is my opinion that it's the best to use.
|
||||||
$!
|
$!
|
||||||
$ P4 = "SOCKETSHR"
|
$ P3 = "SOCKETSHR"
|
||||||
$!
|
$!
|
||||||
$! Tell the user
|
$! Tell the user
|
||||||
$!
|
$!
|
||||||
@@ -791,7 +632,7 @@ $ THEN
|
|||||||
$!
|
$!
|
||||||
$! Last resort: a UCX or UCX-compatible library
|
$! Last resort: a UCX or UCX-compatible library
|
||||||
$!
|
$!
|
||||||
$ P4 = "UCX"
|
$ P3 = "UCX"
|
||||||
$!
|
$!
|
||||||
$! Tell the user
|
$! Tell the user
|
||||||
$!
|
$!
|
||||||
@@ -805,31 +646,7 @@ $ ENDIF
|
|||||||
$!
|
$!
|
||||||
$! Set Up Initial CC Definitions, Possibly With User Ones
|
$! Set Up Initial CC Definitions, Possibly With User Ones
|
||||||
$!
|
$!
|
||||||
$ CCDEFS = "VMS=1,MONOLITH"
|
$ CCDEFS = "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
|
$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS
|
||||||
$ CCEXTRAFLAGS = ""
|
$ CCEXTRAFLAGS = ""
|
||||||
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
||||||
@@ -839,12 +656,12 @@ $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN -
|
|||||||
$!
|
$!
|
||||||
$! Check To See If The User Entered A Valid Paramter.
|
$! Check To See If The User Entered A Valid Paramter.
|
||||||
$!
|
$!
|
||||||
$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC")
|
$ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Check To See If The User Wanted DECC.
|
$! Check To See If The User Wanted DECC.
|
||||||
$!
|
$!
|
||||||
$ IF (P3.EQS."DECC")
|
$ IF (P2.EQS."DECC")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Looks Like DECC, Set To Use DECC.
|
$! Looks Like DECC, Set To Use DECC.
|
||||||
@@ -861,7 +678,8 @@ $ CC = "CC"
|
|||||||
$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
|
$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
|
||||||
THEN CC = "CC/DECC"
|
THEN CC = "CC/DECC"
|
||||||
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
|
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
|
||||||
"/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS
|
"/NOLIST/PREFIX=ALL" + -
|
||||||
|
"/INCLUDE=(SYS$DISK:[-])" + CCEXTRAFLAGS
|
||||||
$!
|
$!
|
||||||
$! Define The Linker Options File Name.
|
$! Define The Linker Options File Name.
|
||||||
$!
|
$!
|
||||||
@@ -873,7 +691,7 @@ $ ENDIF
|
|||||||
$!
|
$!
|
||||||
$! Check To See If We Are To Use VAXC.
|
$! Check To See If We Are To Use VAXC.
|
||||||
$!
|
$!
|
||||||
$ IF (P3.EQS."VAXC")
|
$ IF (P2.EQS."VAXC")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Looks Like VAXC, Set To Use VAXC.
|
$! Looks Like VAXC, Set To Use VAXC.
|
||||||
@@ -892,7 +710,8 @@ $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
|
|||||||
$ EXIT
|
$ EXIT
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
|
$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
|
||||||
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
|
$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
|
||||||
|
"/INCLUDE=(SYS$DISK:[-])" + CCEXTRAFLAGS
|
||||||
$ CCDEFS = CCDEFS + ",""VAXC"""
|
$ CCDEFS = CCDEFS + ",""VAXC"""
|
||||||
$!
|
$!
|
||||||
$! Define <sys> As SYS$COMMON:[SYSLIB]
|
$! Define <sys> As SYS$COMMON:[SYSLIB]
|
||||||
@@ -909,7 +728,7 @@ $ ENDIF
|
|||||||
$!
|
$!
|
||||||
$! Check To See If We Are To Use GNU C.
|
$! Check To See If We Are To Use GNU C.
|
||||||
$!
|
$!
|
||||||
$ IF (P3.EQS."GNUC")
|
$ IF (P2.EQS."GNUC")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Looks Like GNUC, Set To Use GNUC.
|
$! Looks Like GNUC, Set To Use GNUC.
|
||||||
@@ -923,7 +742,8 @@ $!
|
|||||||
$! Use GNU C...
|
$! Use GNU C...
|
||||||
$!
|
$!
|
||||||
$ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC
|
$ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC
|
||||||
$ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
|
$ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
|
||||||
|
"/INCLUDE=(SYS$DISK:[-])" + CCEXTRAFLAGS
|
||||||
$!
|
$!
|
||||||
$! Define The Linker Options File Name.
|
$! Define The Linker Options File Name.
|
||||||
$!
|
$!
|
||||||
@@ -937,31 +757,6 @@ $! Set up default defines
|
|||||||
$!
|
$!
|
||||||
$ CCDEFS = """FLAT_INC=1""," + CCDEFS
|
$ CCDEFS = """FLAT_INC=1""," + CCDEFS
|
||||||
$!
|
$!
|
||||||
$! Check To See If We Are To Compile With RSAREF Routines.
|
|
||||||
$!
|
|
||||||
$ IF (RSAREF.EQS."TRUE")
|
|
||||||
$ THEN
|
|
||||||
$!
|
|
||||||
$! Compile With RSAREF.
|
|
||||||
$!
|
|
||||||
$ CCDEFS = CCDEFS + ",""RSAref=1"""
|
|
||||||
$!
|
|
||||||
$! Tell The User This.
|
|
||||||
$!
|
|
||||||
$ WRITE SYS$OUTPUT "Compiling With RSAREF Routines."
|
|
||||||
$!
|
|
||||||
$! Else, We Don't Care. Compile Without The RSAREF Library.
|
|
||||||
$!
|
|
||||||
$ ELSE
|
|
||||||
$!
|
|
||||||
$! Tell The User We Are Compile Without The RSAREF Routines.
|
|
||||||
$!
|
|
||||||
$ WRITE SYS$OUTPUT "Compiling Without The RSAREF Routines.
|
|
||||||
$!
|
|
||||||
$! End The RSAREF Check.
|
|
||||||
$!
|
|
||||||
$ ENDIF
|
|
||||||
$!
|
|
||||||
$! Else The User Entered An Invalid Arguement.
|
$! Else The User Entered An Invalid Arguement.
|
||||||
$!
|
$!
|
||||||
$ ELSE
|
$ ELSE
|
||||||
@@ -969,7 +764,7 @@ $!
|
|||||||
$! Tell The User We Don't Know What They Want.
|
$! Tell The User We Don't Know What They Want.
|
||||||
$!
|
$!
|
||||||
$ WRITE SYS$OUTPUT ""
|
$ WRITE SYS$OUTPUT ""
|
||||||
$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
|
$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:"
|
||||||
$ WRITE SYS$OUTPUT ""
|
$ WRITE SYS$OUTPUT ""
|
||||||
$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
|
$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C."
|
||||||
$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
|
$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C."
|
||||||
@@ -983,17 +778,18 @@ $ ENDIF
|
|||||||
$!
|
$!
|
||||||
$! Time to check the contents, and to make sure we get the correct library.
|
$! Time to check the contents, and to make sure we get the correct library.
|
||||||
$!
|
$!
|
||||||
$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX"
|
$ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" -
|
||||||
|
.OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE"
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Check to see if SOCKETSHR was chosen
|
$! Check to see if SOCKETSHR was chosen
|
||||||
$!
|
$!
|
||||||
$ IF P4.EQS."SOCKETSHR"
|
$ IF P3.EQS."SOCKETSHR"
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Set the library to use SOCKETSHR
|
$! Set the library to use SOCKETSHR
|
||||||
$!
|
$!
|
||||||
$ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT"
|
$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT"
|
||||||
$!
|
$!
|
||||||
$! Done with SOCKETSHR
|
$! Done with SOCKETSHR
|
||||||
$!
|
$!
|
||||||
@@ -1001,12 +797,12 @@ $ ENDIF
|
|||||||
$!
|
$!
|
||||||
$! Check to see if MULTINET was chosen
|
$! Check to see if MULTINET was chosen
|
||||||
$!
|
$!
|
||||||
$ IF P4.EQS."MULTINET"
|
$ IF P3.EQS."MULTINET"
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Set the library to use UCX emulation.
|
$! Set the library to use UCX emulation.
|
||||||
$!
|
$!
|
||||||
$ P4 = "UCX"
|
$ P3 = "UCX"
|
||||||
$!
|
$!
|
||||||
$! Done with MULTINET
|
$! Done with MULTINET
|
||||||
$!
|
$!
|
||||||
@@ -1014,27 +810,53 @@ $ ENDIF
|
|||||||
$!
|
$!
|
||||||
$! Check to see if UCX was chosen
|
$! Check to see if UCX was chosen
|
||||||
$!
|
$!
|
||||||
$ IF P4.EQS."UCX"
|
$ IF P3.EQS."UCX"
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Set the library to use UCX.
|
$! Set the library to use UCX.
|
||||||
$!
|
$!
|
||||||
$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT"
|
$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT"
|
||||||
$ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
|
$ IF F$TRNLNM("UCX$IPC_SHR") .NES. ""
|
||||||
$ THEN
|
$ THEN
|
||||||
$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
|
$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT"
|
||||||
$ ELSE
|
$ ELSE
|
||||||
$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
|
$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN -
|
||||||
TCPIP_LIB = "[-.VMS]UCX_SHR_VAXC.OPT/OPT"
|
TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT"
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! Done with UCX
|
$! Done with UCX
|
||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
|
$! Check to see if TCPIP (post UCX) was chosen
|
||||||
|
$!
|
||||||
|
$ IF P3.EQS."TCPIP"
|
||||||
|
$ THEN
|
||||||
|
$!
|
||||||
|
$! Set the library to use TCPIP.
|
||||||
|
$!
|
||||||
|
$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT"
|
||||||
|
$!
|
||||||
|
$! Done with TCPIP
|
||||||
|
$!
|
||||||
|
$ ENDIF
|
||||||
|
$!
|
||||||
|
$! Check to see if NONE was chosen
|
||||||
|
$!
|
||||||
|
$ IF P3.EQS."NONE"
|
||||||
|
$ THEN
|
||||||
|
$!
|
||||||
|
$! Do not use TCPIP.
|
||||||
|
$!
|
||||||
|
$ TCPIP_LIB = ""
|
||||||
|
$!
|
||||||
|
$! Done with TCPIP
|
||||||
|
$!
|
||||||
|
$ ENDIF
|
||||||
|
$!
|
||||||
$! Add TCP/IP type to CC definitions.
|
$! Add TCP/IP type to CC definitions.
|
||||||
$!
|
$!
|
||||||
$ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P4'"
|
$ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P3'"
|
||||||
$!
|
$!
|
||||||
$! Print info
|
$! Print info
|
||||||
$!
|
$!
|
||||||
@@ -1047,10 +869,11 @@ $!
|
|||||||
$! Tell The User We Don't Know What They Want.
|
$! Tell The User We Don't Know What They Want.
|
||||||
$!
|
$!
|
||||||
$ WRITE SYS$OUTPUT ""
|
$ WRITE SYS$OUTPUT ""
|
||||||
$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:"
|
$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:"
|
||||||
$ WRITE SYS$OUTPUT ""
|
$ WRITE SYS$OUTPUT ""
|
||||||
$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
|
$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library."
|
||||||
$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
|
$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library."
|
||||||
|
$ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library."
|
||||||
$ WRITE SYS$OUTPUT ""
|
$ WRITE SYS$OUTPUT ""
|
||||||
$!
|
$!
|
||||||
$! Time To EXIT.
|
$! Time To EXIT.
|
||||||
@@ -1077,7 +900,7 @@ $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS
|
|||||||
$!
|
$!
|
||||||
$! Show user the result
|
$! Show user the result
|
||||||
$!
|
$!
|
||||||
$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC
|
$ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC
|
||||||
$!
|
$!
|
||||||
$! Special Threads For OpenVMS v7.1 Or Later
|
$! Special Threads For OpenVMS v7.1 Or Later
|
||||||
$!
|
$!
|
||||||
@@ -1085,9 +908,9 @@ $! Written By: Richard Levitte
|
|||||||
$! richard@levitte.org
|
$! richard@levitte.org
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$! Check To See If We Have A Option For P5.
|
$! Check To See If We Have A Option For P4.
|
||||||
$!
|
$!
|
||||||
$ IF (P5.EQS."")
|
$ IF (P4.EQS."")
|
||||||
$ THEN
|
$ THEN
|
||||||
$!
|
$!
|
||||||
$! Get The Version Of VMS We Are Using.
|
$! Get The Version Of VMS We Are Using.
|
||||||
@@ -1109,15 +932,15 @@ $! End The VMS Version Check.
|
|||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! End The P5 Check.
|
$! End The P4 Check.
|
||||||
$!
|
$!
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! Check if the user wanted to compile just a subset of all the programs.
|
$! Check if the user wanted to compile just a subset of all the programs.
|
||||||
$!
|
$!
|
||||||
$ IF P6 .NES. ""
|
$ IF P5 .NES. ""
|
||||||
$ THEN
|
$ THEN
|
||||||
$ PROGRAMS = P6
|
$ PROGRAMS = P5
|
||||||
$ ENDIF
|
$ ENDIF
|
||||||
$!
|
$!
|
||||||
$! Time To RETURN...
|
$! Time To RETURN...
|
||||||
@@ -1133,6 +956,7 @@ $!
|
|||||||
$! Save directory information
|
$! Save directory information
|
||||||
$!
|
$!
|
||||||
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
|
$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;"
|
||||||
|
$ __HERE = F$EDIT(__HERE,"UPCASE")
|
||||||
$ __TOP = __HERE - "APPS]"
|
$ __TOP = __HERE - "APPS]"
|
||||||
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
|
$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]"
|
||||||
$!
|
$!
|
||||||
|
|||||||
21
apps/nseq.c
21
apps/nseq.c
@@ -58,9 +58,9 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "apps.h"
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include "apps.h"
|
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG nseq_main
|
#define PROG nseq_main
|
||||||
@@ -102,7 +102,7 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-in file input file\n");
|
BIO_printf (bio_err, "-in file input file\n");
|
||||||
BIO_printf (bio_err, "-out file output file\n");
|
BIO_printf (bio_err, "-out file output file\n");
|
||||||
BIO_printf (bio_err, "-toseq output NS Sequence file\n");
|
BIO_printf (bio_err, "-toseq output NS Sequence file\n");
|
||||||
EXIT(1);
|
OPENSSL_EXIT(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (infile) {
|
if (infile) {
|
||||||
@@ -119,11 +119,18 @@ int MAIN(int argc, char **argv)
|
|||||||
"Can't open output file %s\n", outfile);
|
"Can't open output file %s\n", outfile);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
} else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
if (toseq) {
|
if (toseq) {
|
||||||
seq = NETSCAPE_CERT_SEQUENCE_new();
|
seq = NETSCAPE_CERT_SEQUENCE_new();
|
||||||
seq->certs = sk_X509_new(NULL);
|
seq->certs = sk_X509_new_null();
|
||||||
while((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)))
|
while((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)))
|
||||||
sk_X509_push(seq->certs,x509);
|
sk_X509_push(seq->certs,x509);
|
||||||
|
|
||||||
@@ -152,9 +159,9 @@ int MAIN(int argc, char **argv)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
NETSCAPE_CERT_SEQUENCE_free(seq);
|
NETSCAPE_CERT_SEQUENCE_free(seq);
|
||||||
|
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1228
apps/ocsp.c
Normal file
1228
apps/ocsp.c
Normal file
File diff suppressed because it is too large
Load Diff
235
apps/openssl.c
235
apps/openssl.c
@@ -55,11 +55,66 @@
|
|||||||
* copied and put under another distribution licence
|
* copied and put under another distribution licence
|
||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define OPENSSL_C /* tells apps.h to use complete apps_startup() */
|
#define OPENSSL_C /* tells apps.h to use complete apps_startup() */
|
||||||
|
#include "apps.h"
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
#include <openssl/lhash.h>
|
#include <openssl/lhash.h>
|
||||||
@@ -67,31 +122,104 @@
|
|||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
#include <openssl/engine.h>
|
||||||
#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
|
#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
|
||||||
#include "apps.h"
|
|
||||||
#include "progs.h"
|
#include "progs.h"
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
|
||||||
static unsigned long MS_CALLBACK hash(FUNCTION *a);
|
/* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the
|
||||||
static int MS_CALLBACK cmp(FUNCTION *a,FUNCTION *b);
|
* base prototypes (we cast each variable inside the function to the required
|
||||||
|
* type of "FUNCTION*"). This removes the necessity for macro-generated wrapper
|
||||||
|
* functions. */
|
||||||
|
|
||||||
|
/* static unsigned long MS_CALLBACK hash(FUNCTION *a); */
|
||||||
|
static unsigned long MS_CALLBACK hash(const void *a_void);
|
||||||
|
/* static int MS_CALLBACK cmp(FUNCTION *a,FUNCTION *b); */
|
||||||
|
static int MS_CALLBACK cmp(const void *a_void,const void *b_void);
|
||||||
static LHASH *prog_init(void );
|
static LHASH *prog_init(void );
|
||||||
static int do_cmd(LHASH *prog,int argc,char *argv[]);
|
static int do_cmd(LHASH *prog,int argc,char *argv[]);
|
||||||
LHASH *config=NULL;
|
|
||||||
char *default_config_file=NULL;
|
char *default_config_file=NULL;
|
||||||
|
|
||||||
/* Make sure there is only one when MONOLITH is defined */
|
/* Make sure there is only one when MONOLITH is defined */
|
||||||
#ifdef MONOLITH
|
#ifdef MONOLITH
|
||||||
|
CONF *config=NULL;
|
||||||
BIO *bio_err=NULL;
|
BIO *bio_err=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static void lock_dbg_cb(int mode, int type, const char *file, int line)
|
||||||
|
{
|
||||||
|
static int modes[CRYPTO_NUM_LOCKS]; /* = {0, 0, ... } */
|
||||||
|
const char *errstr = NULL;
|
||||||
|
int rw;
|
||||||
|
|
||||||
|
rw = mode & (CRYPTO_READ|CRYPTO_WRITE);
|
||||||
|
if (!((rw == CRYPTO_READ) || (rw == CRYPTO_WRITE)))
|
||||||
|
{
|
||||||
|
errstr = "invalid mode";
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type < 0 || type > CRYPTO_NUM_LOCKS)
|
||||||
|
{
|
||||||
|
errstr = "type out of bounds";
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode & CRYPTO_LOCK)
|
||||||
|
{
|
||||||
|
if (modes[type])
|
||||||
|
{
|
||||||
|
errstr = "already locked";
|
||||||
|
/* must not happen in a single-threaded program
|
||||||
|
* (would deadlock) */
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
modes[type] = rw;
|
||||||
|
}
|
||||||
|
else if (mode & CRYPTO_UNLOCK)
|
||||||
|
{
|
||||||
|
if (!modes[type])
|
||||||
|
{
|
||||||
|
errstr = "not locked";
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modes[type] != rw)
|
||||||
|
{
|
||||||
|
errstr = (rw == CRYPTO_READ) ?
|
||||||
|
"CRYPTO_r_unlock on write lock" :
|
||||||
|
"CRYPTO_w_unlock on read lock";
|
||||||
|
}
|
||||||
|
|
||||||
|
modes[type] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errstr = "invalid mode";
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err:
|
||||||
|
if (errstr)
|
||||||
|
{
|
||||||
|
/* we cannot use bio_err here */
|
||||||
|
fprintf(stderr, "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n",
|
||||||
|
errstr, mode, type, file, line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int Argc, char *Argv[])
|
int main(int Argc, char *Argv[])
|
||||||
{
|
{
|
||||||
ARGS arg;
|
ARGS arg;
|
||||||
#define PROG_NAME_SIZE 16
|
#define PROG_NAME_SIZE 39
|
||||||
char pname[PROG_NAME_SIZE];
|
char pname[PROG_NAME_SIZE+1];
|
||||||
FUNCTION f,*fp;
|
FUNCTION f,*fp;
|
||||||
MS_STATIC char *prompt,buf[1024],config_name[256];
|
MS_STATIC char *prompt,buf[1024];
|
||||||
|
char *to_free=NULL;
|
||||||
int n,i,ret=0;
|
int n,i,ret=0;
|
||||||
int argc;
|
int argc;
|
||||||
char **argv,*p;
|
char **argv,*p;
|
||||||
@@ -101,39 +229,56 @@ int main(int Argc, char *Argv[])
|
|||||||
arg.data=NULL;
|
arg.data=NULL;
|
||||||
arg.count=0;
|
arg.count=0;
|
||||||
|
|
||||||
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
|
||||||
|
|
||||||
apps_startup();
|
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) /* if not defined, use compiled-in library defaults */
|
||||||
|
{
|
||||||
|
if (!(0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))
|
||||||
|
{
|
||||||
|
CRYPTO_malloc_debug_init();
|
||||||
|
CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* OPENSSL_DEBUG_MEMORY=off */
|
||||||
|
CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (getenv("OPENSSL_DEBUG_LOCKING") != NULL)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
CRYPTO_set_locking_callback(lock_dbg_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
apps_startup();
|
||||||
|
|
||||||
/* Lets load up our environment a little */
|
/* Lets load up our environment a little */
|
||||||
p=getenv("OPENSSL_CONF");
|
p=getenv("OPENSSL_CONF");
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
p=getenv("SSLEAY_CONF");
|
p=getenv("SSLEAY_CONF");
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
p=to_free=make_config_name();
|
||||||
strcpy(config_name,X509_get_default_cert_area());
|
|
||||||
#ifndef VMS
|
|
||||||
strcat(config_name,"/");
|
|
||||||
#endif
|
|
||||||
strcat(config_name,OPENSSL_CONF);
|
|
||||||
p=config_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
default_config_file=p;
|
default_config_file=p;
|
||||||
|
|
||||||
config=CONF_load(config,p,&errline);
|
config=NCONF_new(NULL);
|
||||||
if (config == NULL) ERR_clear_error();
|
i=NCONF_load(config,p,&errline);
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
NCONF_free(config);
|
||||||
|
config = NULL;
|
||||||
|
ERR_clear_error();
|
||||||
|
}
|
||||||
|
|
||||||
prog=prog_init();
|
prog=prog_init();
|
||||||
|
|
||||||
/* first check the program name */
|
/* first check the program name */
|
||||||
program_name(Argv[0],pname,PROG_NAME_SIZE);
|
program_name(Argv[0],pname,sizeof pname);
|
||||||
|
|
||||||
f.name=pname;
|
f.name=pname;
|
||||||
fp=(FUNCTION *)lh_retrieve(prog,&f);
|
fp=(FUNCTION *)lh_retrieve(prog,&f);
|
||||||
@@ -161,7 +306,7 @@ int main(int Argc, char *Argv[])
|
|||||||
{
|
{
|
||||||
ret=0;
|
ret=0;
|
||||||
p=buf;
|
p=buf;
|
||||||
n=1024;
|
n=sizeof buf;
|
||||||
i=0;
|
i=0;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@@ -195,17 +340,17 @@ int main(int Argc, char *Argv[])
|
|||||||
BIO_printf(bio_err,"bad exit\n");
|
BIO_printf(bio_err,"bad exit\n");
|
||||||
ret=1;
|
ret=1;
|
||||||
end:
|
end:
|
||||||
|
if (to_free)
|
||||||
|
OPENSSL_free(to_free);
|
||||||
if (config != NULL)
|
if (config != NULL)
|
||||||
{
|
{
|
||||||
CONF_free(config);
|
NCONF_free(config);
|
||||||
config=NULL;
|
config=NULL;
|
||||||
}
|
}
|
||||||
if (prog != NULL) lh_free(prog);
|
if (prog != NULL) lh_free(prog);
|
||||||
if (arg.data != NULL) Free(arg.data);
|
if (arg.data != NULL) OPENSSL_free(arg.data);
|
||||||
ERR_remove_state(0);
|
|
||||||
|
|
||||||
EVP_cleanup();
|
apps_shutdown();
|
||||||
ERR_free_strings();
|
|
||||||
|
|
||||||
CRYPTO_mem_leaks(bio_err);
|
CRYPTO_mem_leaks(bio_err);
|
||||||
if (bio_err != NULL)
|
if (bio_err != NULL)
|
||||||
@@ -213,7 +358,7 @@ end:
|
|||||||
BIO_free(bio_err);
|
BIO_free(bio_err);
|
||||||
bio_err=NULL;
|
bio_err=NULL;
|
||||||
}
|
}
|
||||||
EXIT(ret);
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LIST_STANDARD_COMMANDS "list-standard-commands"
|
#define LIST_STANDARD_COMMANDS "list-standard-commands"
|
||||||
@@ -236,13 +381,19 @@ static int do_cmd(LHASH *prog, int argc, char *argv[])
|
|||||||
else if ((strncmp(argv[0],"no-",3)) == 0)
|
else if ((strncmp(argv[0],"no-",3)) == 0)
|
||||||
{
|
{
|
||||||
BIO *bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
|
BIO *bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
bio_stdout = BIO_push(tmpbio, bio_stdout);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
f.name=argv[0]+3;
|
f.name=argv[0]+3;
|
||||||
ret = (lh_retrieve(prog,&f) != NULL);
|
ret = (lh_retrieve(prog,&f) != NULL);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
BIO_printf(bio_stdout, "%s\n", argv[0]);
|
BIO_printf(bio_stdout, "%s\n", argv[0]);
|
||||||
else
|
else
|
||||||
BIO_printf(bio_stdout, "%s\n", argv[0]+3);
|
BIO_printf(bio_stdout, "%s\n", argv[0]+3);
|
||||||
BIO_free(bio_stdout);
|
BIO_free_all(bio_stdout);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
else if ((strcmp(argv[0],"quit") == 0) ||
|
else if ((strcmp(argv[0],"quit") == 0) ||
|
||||||
@@ -267,11 +418,17 @@ static int do_cmd(LHASH *prog, int argc, char *argv[])
|
|||||||
else /* strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0 */
|
else /* strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0 */
|
||||||
list_type = FUNC_TYPE_CIPHER;
|
list_type = FUNC_TYPE_CIPHER;
|
||||||
bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
|
bio_stdout = BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
bio_stdout = BIO_push(tmpbio, bio_stdout);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (fp=functions; fp->name != NULL; fp++)
|
for (fp=functions; fp->name != NULL; fp++)
|
||||||
if (fp->type == list_type)
|
if (fp->type == list_type)
|
||||||
BIO_printf(bio_stdout, "%s\n", fp->name);
|
BIO_printf(bio_stdout, "%s\n", fp->name);
|
||||||
BIO_free(bio_stdout);
|
BIO_free_all(bio_stdout);
|
||||||
ret=0;
|
ret=0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -336,19 +493,23 @@ static LHASH *prog_init(void)
|
|||||||
;
|
;
|
||||||
qsort(functions,i,sizeof *functions,SortFnByName);
|
qsort(functions,i,sizeof *functions,SortFnByName);
|
||||||
|
|
||||||
if ((ret=lh_new(hash,cmp)) == NULL) return(NULL);
|
if ((ret=lh_new(hash, cmp)) == NULL)
|
||||||
|
return(NULL);
|
||||||
|
|
||||||
for (f=functions; f->name != NULL; f++)
|
for (f=functions; f->name != NULL; f++)
|
||||||
lh_insert(ret,f);
|
lh_insert(ret,f);
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b)
|
/* static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b) */
|
||||||
|
static int MS_CALLBACK cmp(const void *a_void, const void *b_void)
|
||||||
{
|
{
|
||||||
return(strncmp(a->name,b->name,8));
|
return(strncmp(((FUNCTION *)a_void)->name,
|
||||||
|
((FUNCTION *)b_void)->name,8));
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long MS_CALLBACK hash(FUNCTION *a)
|
/* static unsigned long MS_CALLBACK hash(FUNCTION *a) */
|
||||||
|
static unsigned long MS_CALLBACK hash(const void *a_void)
|
||||||
{
|
{
|
||||||
return(lh_strhash(a->name));
|
return(lh_strhash(((FUNCTION *)a_void)->name));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,14 @@ RANDFILE = $dir/private/.rand # private random number file
|
|||||||
|
|
||||||
x509_extensions = usr_cert # The extentions to add to the cert
|
x509_extensions = usr_cert # The extentions to add to the cert
|
||||||
|
|
||||||
|
# Comment out the following two lines for the "traditional"
|
||||||
|
# (and highly broken) format.
|
||||||
|
name_opt = ca_default # Subject Name options
|
||||||
|
cert_opt = ca_default # Certificate field options
|
||||||
|
|
||||||
|
# Extension copying option: use with caution.
|
||||||
|
# copy_extensions = copy
|
||||||
|
|
||||||
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
||||||
# so this is commented out by default to leave a V1 CRL.
|
# so this is commented out by default to leave a V1 CRL.
|
||||||
# crl_extensions = crl_ext
|
# crl_extensions = crl_ext
|
||||||
@@ -132,7 +140,7 @@ commonName = Common Name (eg, YOUR name)
|
|||||||
commonName_max = 64
|
commonName_max = 64
|
||||||
|
|
||||||
emailAddress = Email Address
|
emailAddress = Email Address
|
||||||
emailAddress_max = 40
|
emailAddress_max = 64
|
||||||
|
|
||||||
# SET-ex3 = SET extension number 3
|
# SET-ex3 = SET extension number 3
|
||||||
|
|
||||||
@@ -180,6 +188,9 @@ authorityKeyIdentifier=keyid,issuer:always
|
|||||||
# This stuff is for subjectAltName and issuerAltname.
|
# This stuff is for subjectAltName and issuerAltname.
|
||||||
# Import the email address.
|
# Import the email address.
|
||||||
# subjectAltName=email:copy
|
# subjectAltName=email:copy
|
||||||
|
# An alternative to produce certificates that aren't
|
||||||
|
# deprecated according to PKIX.
|
||||||
|
# subjectAltName=email:move
|
||||||
|
|
||||||
# Copy subject details
|
# Copy subject details
|
||||||
# issuerAltName=issuer:copy
|
# issuerAltName=issuer:copy
|
||||||
|
|||||||
181
apps/passwd.c
181
apps/passwd.c
@@ -1,10 +1,10 @@
|
|||||||
/* apps/passwd.c */
|
/* apps/passwd.c */
|
||||||
|
|
||||||
#if defined NO_MD5 || defined CHARSET_EBCDIC
|
#if defined OPENSSL_NO_MD5 || defined CHARSET_EBCDIC
|
||||||
# define NO_APR1
|
# define NO_MD5CRYPT_1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_DES) || !defined(NO_APR1)
|
#if !defined(OPENSSL_NO_DES) || !defined(NO_MD5CRYPT_1)
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -15,11 +15,10 @@
|
|||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
#ifndef OPENSSL_NO_DES
|
||||||
#ifndef NO_DES
|
|
||||||
# include <openssl/des.h>
|
# include <openssl/des.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_APR1
|
#ifndef NO_MD5CRYPT_1
|
||||||
# include <openssl/md5.h>
|
# include <openssl/md5.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -42,13 +41,15 @@ static unsigned const char cov_2char[64]={
|
|||||||
|
|
||||||
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
||||||
char *passwd, BIO *out, int quiet, int table, int reverse,
|
char *passwd, BIO *out, int quiet, int table, int reverse,
|
||||||
size_t pw_maxlen, int usecrypt, int useapr1);
|
size_t pw_maxlen, int usecrypt, int use1, int useapr1);
|
||||||
|
|
||||||
/* -crypt - standard Unix password algorithm (default, only choice)
|
/* -crypt - standard Unix password algorithm (default)
|
||||||
* -apr1 - MD5-based password algorithm
|
* -1 - MD5-based password algorithm
|
||||||
|
* -apr1 - MD5-based password algorithm, Apache variant
|
||||||
* -salt string - salt
|
* -salt string - salt
|
||||||
* -in file - read passwords from file
|
* -in file - read passwords from file
|
||||||
* -stdin - read passwords from stdin
|
* -stdin - read passwords from stdin
|
||||||
|
* -noverify - never verify when reading password from terminal
|
||||||
* -quiet - no warnings
|
* -quiet - no warnings
|
||||||
* -table - format output as table
|
* -table - format output as table
|
||||||
* -reverse - switch table columns
|
* -reverse - switch table columns
|
||||||
@@ -61,13 +62,15 @@ int MAIN(int argc, char **argv)
|
|||||||
int ret = 1;
|
int ret = 1;
|
||||||
char *infile = NULL;
|
char *infile = NULL;
|
||||||
int in_stdin = 0;
|
int in_stdin = 0;
|
||||||
|
int in_noverify = 0;
|
||||||
char *salt = NULL, *passwd = NULL, **passwds = NULL;
|
char *salt = NULL, *passwd = NULL, **passwds = NULL;
|
||||||
char *salt_malloc = NULL, *passwd_malloc = NULL;
|
char *salt_malloc = NULL, *passwd_malloc = NULL;
|
||||||
|
size_t passwd_malloc_size = 0;
|
||||||
int pw_source_defined = 0;
|
int pw_source_defined = 0;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
int i, badopt, opt_done;
|
int i, badopt, opt_done;
|
||||||
int passed_salt = 0, quiet = 0, table = 0, reverse = 0;
|
int passed_salt = 0, quiet = 0, table = 0, reverse = 0;
|
||||||
int usecrypt = 0, useapr1 = 0;
|
int usecrypt = 0, use1 = 0, useapr1 = 0;
|
||||||
size_t pw_maxlen = 0;
|
size_t pw_maxlen = 0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
@@ -75,10 +78,19 @@ int MAIN(int argc, char **argv)
|
|||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto err;
|
||||||
out = BIO_new(BIO_s_file());
|
out = BIO_new(BIO_s_file());
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
badopt = 0, opt_done = 0;
|
badopt = 0, opt_done = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
@@ -86,6 +98,8 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if (strcmp(argv[i], "-crypt") == 0)
|
if (strcmp(argv[i], "-crypt") == 0)
|
||||||
usecrypt = 1;
|
usecrypt = 1;
|
||||||
|
else if (strcmp(argv[i], "-1") == 0)
|
||||||
|
use1 = 1;
|
||||||
else if (strcmp(argv[i], "-apr1") == 0)
|
else if (strcmp(argv[i], "-apr1") == 0)
|
||||||
useapr1 = 1;
|
useapr1 = 1;
|
||||||
else if (strcmp(argv[i], "-salt") == 0)
|
else if (strcmp(argv[i], "-salt") == 0)
|
||||||
@@ -118,6 +132,8 @@ int MAIN(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[i], "-noverify") == 0)
|
||||||
|
in_noverify = 1;
|
||||||
else if (strcmp(argv[i], "-quiet") == 0)
|
else if (strcmp(argv[i], "-quiet") == 0)
|
||||||
quiet = 1;
|
quiet = 1;
|
||||||
else if (strcmp(argv[i], "-table") == 0)
|
else if (strcmp(argv[i], "-table") == 0)
|
||||||
@@ -137,32 +153,34 @@ int MAIN(int argc, char **argv)
|
|||||||
badopt = 1;
|
badopt = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!usecrypt && !useapr1) /* use default */
|
if (!usecrypt && !use1 && !useapr1) /* use default */
|
||||||
usecrypt = 1;
|
usecrypt = 1;
|
||||||
if (usecrypt + useapr1 > 1) /* conflict */
|
if (usecrypt + use1 + useapr1 > 1) /* conflict */
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
|
|
||||||
/* reject unsupported algorithms */
|
/* reject unsupported algorithms */
|
||||||
#ifdef NO_DES
|
#ifdef OPENSSL_NO_DES
|
||||||
if (usecrypt) badopt = 1;
|
if (usecrypt) badopt = 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NO_APR1
|
#ifdef NO_MD5CRYPT_1
|
||||||
if (useapr1) badopt = 1;
|
if (use1 || useapr1) badopt = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (badopt)
|
if (badopt)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err, "Usage: passwd [options] [passwords]\n");
|
BIO_printf(bio_err, "Usage: passwd [options] [passwords]\n");
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "where options are\n");
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
BIO_printf(bio_err, "-crypt standard Unix password algorithm (default)\n");
|
BIO_printf(bio_err, "-crypt standard Unix password algorithm (default)\n");
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_APR1
|
#ifndef NO_MD5CRYPT_1
|
||||||
BIO_printf(bio_err, "-apr1 MD5-based password algorithm\n");
|
BIO_printf(bio_err, "-1 MD5-based password algorithm\n");
|
||||||
|
BIO_printf(bio_err, "-apr1 MD5-based password algorithm, Apache variant\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err, "-salt string use provided salt\n");
|
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, "-in file read passwords from file\n");
|
||||||
BIO_printf(bio_err, "-stdin read passwords from stdin\n");
|
BIO_printf(bio_err, "-stdin read passwords from stdin\n");
|
||||||
|
BIO_printf(bio_err, "-noverify never verify when reading password from terminal\n");
|
||||||
BIO_printf(bio_err, "-quiet no warnings\n");
|
BIO_printf(bio_err, "-quiet no warnings\n");
|
||||||
BIO_printf(bio_err, "-table format output as table\n");
|
BIO_printf(bio_err, "-table format output as table\n");
|
||||||
BIO_printf(bio_err, "-reverse switch table columns\n");
|
BIO_printf(bio_err, "-reverse switch table columns\n");
|
||||||
@@ -190,13 +208,16 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if (usecrypt)
|
if (usecrypt)
|
||||||
pw_maxlen = 8;
|
pw_maxlen = 8;
|
||||||
else if (useapr1)
|
else if (use1 || useapr1)
|
||||||
pw_maxlen = 256; /* arbitrary limit, should be enough for most passwords */
|
pw_maxlen = 256; /* arbitrary limit, should be enough for most passwords */
|
||||||
|
|
||||||
if (passwds == NULL)
|
if (passwds == NULL)
|
||||||
{
|
{
|
||||||
/* no passwords on the command line */
|
/* no passwords on the command line */
|
||||||
passwd = passwd_malloc = Malloc(pw_maxlen + 1);
|
|
||||||
|
passwd_malloc_size = pw_maxlen + 2;
|
||||||
|
/* longer than necessary so that we can warn about truncation */
|
||||||
|
passwd = passwd_malloc = OPENSSL_malloc(passwd_malloc_size);
|
||||||
if (passwd_malloc == NULL)
|
if (passwd_malloc == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@@ -208,7 +229,7 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
passwds = passwds_static;
|
passwds = passwds_static;
|
||||||
if (in == NULL)
|
if (in == NULL)
|
||||||
if (EVP_read_pw_string(passwd_malloc, pw_maxlen + 1, "Password: ", 0) != 0)
|
if (EVP_read_pw_string(passwd_malloc, passwd_malloc_size, "Password: ", !(passed_salt || in_noverify)) != 0)
|
||||||
goto err;
|
goto err;
|
||||||
passwds[0] = passwd_malloc;
|
passwds[0] = passwd_malloc;
|
||||||
}
|
}
|
||||||
@@ -222,7 +243,7 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
passwd = *passwds++;
|
passwd = *passwds++;
|
||||||
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
||||||
quiet, table, reverse, pw_maxlen, usecrypt, useapr1))
|
quiet, table, reverse, pw_maxlen, usecrypt, use1, useapr1))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
while (*passwds != NULL);
|
while (*passwds != NULL);
|
||||||
@@ -251,90 +272,103 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
if (!do_passwd(passed_salt, &salt, &salt_malloc, passwd, out,
|
||||||
quiet, table, reverse, pw_maxlen, usecrypt, useapr1))
|
quiet, table, reverse, pw_maxlen, usecrypt, use1, useapr1))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
done = (r <= 0);
|
done = (r <= 0);
|
||||||
}
|
}
|
||||||
while (!done);
|
while (!done);
|
||||||
}
|
}
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (salt_malloc)
|
if (salt_malloc)
|
||||||
Free(salt_malloc);
|
OPENSSL_free(salt_malloc);
|
||||||
if (passwd_malloc)
|
if (passwd_malloc)
|
||||||
Free(passwd_malloc);
|
OPENSSL_free(passwd_malloc);
|
||||||
if (in)
|
if (in)
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
if (out)
|
if (out)
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_APR1
|
#ifndef NO_MD5CRYPT_1
|
||||||
/* MD5-based password algorithm compatible to the one found in Apache
|
/* MD5-based password algorithm (should probably be available as a library
|
||||||
* (should probably be available as a library function;
|
* function; then the static buffer would not be acceptable).
|
||||||
* then the static buffer would not be acceptable) */
|
* For magic string "1", this should be compatible to the MD5-based BSD
|
||||||
static char *apr1_crypt(const char *passwd, const char *salt)
|
* password algorithm.
|
||||||
|
* For 'magic' string "apr1", this is compatible to the MD5-based Apache
|
||||||
|
* password algorithm.
|
||||||
|
* (Apparently, the Apache password algorithm is identical except that the
|
||||||
|
* 'magic' string was changed -- the laziest application of the NIH principle
|
||||||
|
* I've ever encountered.)
|
||||||
|
*/
|
||||||
|
static char *md5crypt(const char *passwd, const char *magic, const char *salt)
|
||||||
{
|
{
|
||||||
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
|
static char out_buf[6 + 9 + 24 + 2]; /* "$apr1$..salt..$.......md5hash..........\0" */
|
||||||
unsigned char buf[MD5_DIGEST_LENGTH];
|
unsigned char buf[MD5_DIGEST_LENGTH];
|
||||||
char *salt_out;
|
char *salt_out;
|
||||||
int n, i;
|
int n, i;
|
||||||
MD5_CTX md;
|
EVP_MD_CTX md,md2;
|
||||||
size_t passwd_len, salt_len;
|
size_t passwd_len, salt_len;
|
||||||
|
|
||||||
passwd_len = strlen(passwd);
|
passwd_len = strlen(passwd);
|
||||||
strcpy(out_buf, "$apr1$");
|
out_buf[0] = '$';
|
||||||
|
out_buf[1] = 0;
|
||||||
|
assert(strlen(magic) <= 4); /* "1" or "apr1" */
|
||||||
|
strncat(out_buf, magic, 4);
|
||||||
|
strncat(out_buf, "$", 1);
|
||||||
strncat(out_buf, salt, 8);
|
strncat(out_buf, salt, 8);
|
||||||
assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */
|
assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */
|
||||||
salt_out = out_buf + 6;
|
salt_out = out_buf + 2 + strlen(magic);
|
||||||
salt_len = strlen(salt_out);
|
salt_len = strlen(salt_out);
|
||||||
assert(salt_len <= 8);
|
assert(salt_len <= 8);
|
||||||
|
|
||||||
MD5_Init(&md);
|
EVP_MD_CTX_init(&md);
|
||||||
MD5_Update(&md, passwd, passwd_len);
|
EVP_DigestInit_ex(&md,EVP_md5(), NULL);
|
||||||
MD5_Update(&md, "$apr1$", 6);
|
EVP_DigestUpdate(&md, passwd, passwd_len);
|
||||||
MD5_Update(&md, salt_out, salt_len);
|
EVP_DigestUpdate(&md, "$", 1);
|
||||||
|
EVP_DigestUpdate(&md, magic, strlen(magic));
|
||||||
|
EVP_DigestUpdate(&md, "$", 1);
|
||||||
|
EVP_DigestUpdate(&md, salt_out, salt_len);
|
||||||
|
|
||||||
{
|
EVP_MD_CTX_init(&md2);
|
||||||
MD5_CTX md2;
|
EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
|
||||||
|
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||||
|
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
||||||
|
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||||
|
EVP_DigestFinal_ex(&md2, buf, NULL);
|
||||||
|
|
||||||
MD5_Init(&md2);
|
|
||||||
MD5_Update(&md2, passwd, passwd_len);
|
|
||||||
MD5_Update(&md2, salt_out, salt_len);
|
|
||||||
MD5_Update(&md2, passwd, passwd_len);
|
|
||||||
MD5_Final(buf, &md2);
|
|
||||||
}
|
|
||||||
for (i = passwd_len; i > sizeof buf; i -= sizeof buf)
|
for (i = passwd_len; i > sizeof buf; i -= sizeof buf)
|
||||||
MD5_Update(&md, buf, sizeof buf);
|
EVP_DigestUpdate(&md, buf, sizeof buf);
|
||||||
MD5_Update(&md, buf, i);
|
EVP_DigestUpdate(&md, buf, i);
|
||||||
|
|
||||||
n = passwd_len;
|
n = passwd_len;
|
||||||
while (n)
|
while (n)
|
||||||
{
|
{
|
||||||
MD5_Update(&md, (n & 1) ? "\0" : passwd, 1);
|
EVP_DigestUpdate(&md, (n & 1) ? "\0" : passwd, 1);
|
||||||
n >>= 1;
|
n >>= 1;
|
||||||
}
|
}
|
||||||
MD5_Final(buf, &md);
|
EVP_DigestFinal_ex(&md, buf, NULL);
|
||||||
|
|
||||||
for (i = 0; i < 1000; i++)
|
for (i = 0; i < 1000; i++)
|
||||||
{
|
{
|
||||||
MD5_CTX md2;
|
EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
|
||||||
|
EVP_DigestUpdate(&md2, (i & 1) ? (unsigned char *) passwd : buf,
|
||||||
MD5_Init(&md2);
|
|
||||||
MD5_Update(&md2, (i & 1) ? (unsigned char *) passwd : buf,
|
|
||||||
(i & 1) ? passwd_len : sizeof buf);
|
(i & 1) ? passwd_len : sizeof buf);
|
||||||
if (i % 3)
|
if (i % 3)
|
||||||
MD5_Update(&md2, salt_out, salt_len);
|
EVP_DigestUpdate(&md2, salt_out, salt_len);
|
||||||
if (i % 7)
|
if (i % 7)
|
||||||
MD5_Update(&md2, passwd, passwd_len);
|
EVP_DigestUpdate(&md2, passwd, passwd_len);
|
||||||
MD5_Update(&md2, (i & 1) ? buf : (unsigned char *) passwd,
|
EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned char *) passwd,
|
||||||
(i & 1) ? sizeof buf : passwd_len);
|
(i & 1) ? sizeof buf : passwd_len);
|
||||||
MD5_Final(buf, &md2);
|
EVP_DigestFinal_ex(&md2, buf, NULL);
|
||||||
}
|
}
|
||||||
|
EVP_MD_CTX_cleanup(&md2);
|
||||||
|
|
||||||
{
|
{
|
||||||
/* transform buf into output string */
|
/* transform buf into output string */
|
||||||
@@ -372,6 +406,7 @@ static char *apr1_crypt(const char *passwd, const char *salt)
|
|||||||
*output = 0;
|
*output = 0;
|
||||||
assert(strlen(out_buf) < sizeof(out_buf));
|
assert(strlen(out_buf) < sizeof(out_buf));
|
||||||
}
|
}
|
||||||
|
EVP_MD_CTX_cleanup(&md);
|
||||||
|
|
||||||
return out_buf;
|
return out_buf;
|
||||||
}
|
}
|
||||||
@@ -380,7 +415,7 @@ static char *apr1_crypt(const char *passwd, const char *salt)
|
|||||||
|
|
||||||
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
||||||
char *passwd, BIO *out, int quiet, int table, int reverse,
|
char *passwd, BIO *out, int quiet, int table, int reverse,
|
||||||
size_t pw_maxlen, int usecrypt, int useapr1)
|
size_t pw_maxlen, int usecrypt, int use1, int useapr1)
|
||||||
{
|
{
|
||||||
char *hash = NULL;
|
char *hash = NULL;
|
||||||
|
|
||||||
@@ -390,12 +425,12 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
|||||||
/* first make sure we have a salt */
|
/* first make sure we have a salt */
|
||||||
if (!passed_salt)
|
if (!passed_salt)
|
||||||
{
|
{
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
if (usecrypt)
|
if (usecrypt)
|
||||||
{
|
{
|
||||||
if (*salt_malloc_p == NULL)
|
if (*salt_malloc_p == NULL)
|
||||||
{
|
{
|
||||||
*salt_p = *salt_malloc_p = Malloc(3);
|
*salt_p = *salt_malloc_p = OPENSSL_malloc(3);
|
||||||
if (*salt_malloc_p == NULL)
|
if (*salt_malloc_p == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@@ -409,16 +444,16 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
|||||||
* back to ASCII */
|
* back to ASCII */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* !NO_DES */
|
#endif /* !OPENSSL_NO_DES */
|
||||||
|
|
||||||
#ifndef NO_APR1
|
#ifndef NO_MD5CRYPT_1
|
||||||
if (useapr1)
|
if (use1 || useapr1)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (*salt_malloc_p == NULL)
|
if (*salt_malloc_p == NULL)
|
||||||
{
|
{
|
||||||
*salt_p = *salt_malloc_p = Malloc(9);
|
*salt_p = *salt_malloc_p = OPENSSL_malloc(9);
|
||||||
if (*salt_malloc_p == NULL)
|
if (*salt_malloc_p == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@@ -429,7 +464,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
|||||||
(*salt_p)[i] = cov_2char[(*salt_p)[i] & 0x3f]; /* 6 bits */
|
(*salt_p)[i] = cov_2char[(*salt_p)[i] & 0x3f]; /* 6 bits */
|
||||||
(*salt_p)[8] = 0;
|
(*salt_p)[8] = 0;
|
||||||
}
|
}
|
||||||
#endif /* !NO_APR1 */
|
#endif /* !NO_MD5CRYPT_1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(*salt_p != NULL);
|
assert(*salt_p != NULL);
|
||||||
@@ -444,13 +479,13 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
|
|||||||
assert(strlen(passwd) <= pw_maxlen);
|
assert(strlen(passwd) <= pw_maxlen);
|
||||||
|
|
||||||
/* now compute password hash */
|
/* now compute password hash */
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
if (usecrypt)
|
if (usecrypt)
|
||||||
hash = des_crypt(passwd, *salt_p);
|
hash = DES_crypt(passwd, *salt_p);
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_APR1
|
#ifndef NO_MD5CRYPT_1
|
||||||
if (useapr1)
|
if (use1 || useapr1)
|
||||||
hash = apr1_crypt(passwd, *salt_p);
|
hash = md5crypt(passwd, (use1 ? "1" : "apr1"), *salt_p);
|
||||||
#endif
|
#endif
|
||||||
assert(hash != NULL);
|
assert(hash != NULL);
|
||||||
|
|
||||||
@@ -470,6 +505,6 @@ err:
|
|||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
fputs("Program not available.\n", stderr)
|
fputs("Program not available.\n", stderr)
|
||||||
EXIT(1);
|
OPENSSL_EXIT(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
01
|
07
|
||||||
|
|||||||
419
apps/pkcs12.c
419
apps/pkcs12.c
@@ -1,11 +1,11 @@
|
|||||||
/* pkcs12.c */
|
/* pkcs12.c */
|
||||||
#if !defined(NO_DES) && !defined(NO_SHA1)
|
#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)
|
||||||
|
|
||||||
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||||
* project 1999.
|
* project.
|
||||||
*/
|
*/
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
* Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
#define PROG pkcs12_main
|
#define PROG pkcs12_main
|
||||||
|
|
||||||
EVP_CIPHER *enc;
|
const EVP_CIPHER *enc;
|
||||||
|
|
||||||
|
|
||||||
#define NOKEYS 0x1
|
#define NOKEYS 0x1
|
||||||
@@ -78,9 +78,10 @@ EVP_CIPHER *enc;
|
|||||||
#define CLCERTS 0x8
|
#define CLCERTS 0x8
|
||||||
#define CACERTS 0x10
|
#define CACERTS 0x10
|
||||||
|
|
||||||
int get_cert_chain(X509 *cert, STACK_OF(X509) **chain);
|
int get_cert_chain (X509 *cert, X509_STORE *store, STACK_OF(X509) **chain);
|
||||||
int dump_certs_keys_p12(BIO *out, PKCS12 *p12, char *pass, int passlen, int options, char *pempass);
|
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_bags(BIO *out, STACK_OF(PKCS12_SAFEBAG) *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 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);
|
int print_attribs(BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name);
|
||||||
void hex_prin(BIO *out, unsigned char *buf, int len);
|
void hex_prin(BIO *out, unsigned char *buf, int len);
|
||||||
@@ -91,11 +92,13 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
char *infile=NULL, *outfile=NULL, *keyname = NULL;
|
char *infile=NULL, *outfile=NULL, *keyname = NULL;
|
||||||
char *certfile=NULL;
|
char *certfile=NULL;
|
||||||
BIO *in=NULL, *out = NULL, *inkey = NULL, *certsin = NULL;
|
BIO *in=NULL, *out = NULL;
|
||||||
char **args;
|
char **args;
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
|
char *csp_name = NULL;
|
||||||
PKCS12 *p12 = NULL;
|
PKCS12 *p12 = NULL;
|
||||||
char pass[50], macpass[50];
|
char pass[50], macpass[50];
|
||||||
int export_cert = 0;
|
int export_cert = 0;
|
||||||
@@ -116,12 +119,17 @@ int MAIN(int argc, char **argv)
|
|||||||
char *passargin = NULL, *passargout = NULL, *passarg = NULL;
|
char *passargin = NULL, *passargout = NULL, *passarg = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
char *inrand = NULL;
|
char *inrand = NULL;
|
||||||
|
char *CApath = NULL, *CAfile = NULL;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
enc = EVP_des_ede3_cbc();
|
enc = EVP_des_ede3_cbc();
|
||||||
if (bio_err == NULL ) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
if (bio_err == NULL ) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
args = argv + 1;
|
args = argv + 1;
|
||||||
|
|
||||||
|
|
||||||
@@ -142,19 +150,28 @@ int MAIN(int argc, char **argv)
|
|||||||
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||||
else if (!strcmp (*args, "-export")) export_cert = 1;
|
else if (!strcmp (*args, "-export")) export_cert = 1;
|
||||||
else if (!strcmp (*args, "-des")) enc=EVP_des_cbc();
|
else if (!strcmp (*args, "-des")) enc=EVP_des_cbc();
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
else if (!strcmp (*args, "-idea")) enc=EVP_idea_cbc();
|
else if (!strcmp (*args, "-idea")) enc=EVP_idea_cbc();
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp (*args, "-des3")) enc = EVP_des_ede3_cbc();
|
else if (!strcmp (*args, "-des3")) enc = EVP_des_ede3_cbc();
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
else if (!strcmp(*args,"-aes128")) enc=EVP_aes_128_cbc();
|
||||||
|
else if (!strcmp(*args,"-aes192")) enc=EVP_aes_192_cbc();
|
||||||
|
else if (!strcmp(*args,"-aes256")) enc=EVP_aes_256_cbc();
|
||||||
|
#endif
|
||||||
else if (!strcmp (*args, "-noiter")) iter = 1;
|
else if (!strcmp (*args, "-noiter")) iter = 1;
|
||||||
else if (!strcmp (*args, "-maciter"))
|
else if (!strcmp (*args, "-maciter"))
|
||||||
maciter = PKCS12_DEFAULT_ITER;
|
maciter = PKCS12_DEFAULT_ITER;
|
||||||
else if (!strcmp (*args, "-nomaciter"))
|
else if (!strcmp (*args, "-nomaciter"))
|
||||||
maciter = 1;
|
maciter = 1;
|
||||||
|
else if (!strcmp (*args, "-nomac"))
|
||||||
|
maciter = -1;
|
||||||
else if (!strcmp (*args, "-nodes")) enc=NULL;
|
else if (!strcmp (*args, "-nodes")) enc=NULL;
|
||||||
else if (!strcmp (*args, "-certpbe")) {
|
else if (!strcmp (*args, "-certpbe")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
|
if (!strcmp(*args, "NONE"))
|
||||||
|
cert_pbe = -1;
|
||||||
cert_pbe=OBJ_txt2nid(*args);
|
cert_pbe=OBJ_txt2nid(*args);
|
||||||
if(cert_pbe == NID_undef) {
|
if(cert_pbe == NID_undef) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
@@ -165,6 +182,9 @@ int MAIN(int argc, char **argv)
|
|||||||
} else if (!strcmp (*args, "-keypbe")) {
|
} else if (!strcmp (*args, "-keypbe")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
|
if (!strcmp(*args, "NONE"))
|
||||||
|
key_pbe = -1;
|
||||||
|
else
|
||||||
key_pbe=OBJ_txt2nid(*args);
|
key_pbe=OBJ_txt2nid(*args);
|
||||||
if(key_pbe == NID_undef) {
|
if(key_pbe == NID_undef) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
@@ -192,10 +212,15 @@ int MAIN(int argc, char **argv)
|
|||||||
args++;
|
args++;
|
||||||
name = *args;
|
name = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp (*args, "-CSP")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
csp_name = *args;
|
||||||
|
} else badarg = 1;
|
||||||
} else if (!strcmp (*args, "-caname")) {
|
} else if (!strcmp (*args, "-caname")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
if (!canames) canames = sk_new(NULL);
|
if (!canames) canames = sk_new_null();
|
||||||
sk_push(canames, *args);
|
sk_push(canames, *args);
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
} else if (!strcmp (*args, "-in")) {
|
} else if (!strcmp (*args, "-in")) {
|
||||||
@@ -224,6 +249,21 @@ int MAIN(int argc, char **argv)
|
|||||||
passarg = *args;
|
passarg = *args;
|
||||||
noprompt = 1;
|
noprompt = 1;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp(*args,"-CApath")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
CApath = *args;
|
||||||
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp(*args,"-CAfile")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
CAfile = *args;
|
||||||
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp(*args,"-engine")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
engine = *args;
|
||||||
|
} else badarg = 1;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
@@ -237,6 +277,8 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-chain add certificate chain\n");
|
BIO_printf (bio_err, "-chain add certificate chain\n");
|
||||||
BIO_printf (bio_err, "-inkey file private key if not infile\n");
|
BIO_printf (bio_err, "-inkey file private key if not infile\n");
|
||||||
BIO_printf (bio_err, "-certfile f add all certs in f\n");
|
BIO_printf (bio_err, "-certfile f add all certs in f\n");
|
||||||
|
BIO_printf (bio_err, "-CApath arg - PEM format directory of CA's\n");
|
||||||
|
BIO_printf (bio_err, "-CAfile arg - PEM format file of CA's\n");
|
||||||
BIO_printf (bio_err, "-name \"name\" use name as friendly name\n");
|
BIO_printf (bio_err, "-name \"name\" use name as friendly name\n");
|
||||||
BIO_printf (bio_err, "-caname \"nm\" use nm as CA friendly name (can be used more than once).\n");
|
BIO_printf (bio_err, "-caname \"nm\" use nm as CA friendly name (can be used more than once).\n");
|
||||||
BIO_printf (bio_err, "-in infile input filename\n");
|
BIO_printf (bio_err, "-in infile input filename\n");
|
||||||
@@ -250,8 +292,12 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-info give info about PKCS#12 structure.\n");
|
BIO_printf (bio_err, "-info give info about PKCS#12 structure.\n");
|
||||||
BIO_printf (bio_err, "-des encrypt private keys with DES\n");
|
BIO_printf (bio_err, "-des encrypt private keys with DES\n");
|
||||||
BIO_printf (bio_err, "-des3 encrypt private keys with triple DES (default)\n");
|
BIO_printf (bio_err, "-des3 encrypt private keys with triple DES (default)\n");
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
BIO_printf (bio_err, "-idea encrypt private keys with idea\n");
|
BIO_printf (bio_err, "-idea encrypt private keys with idea\n");
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
BIO_printf (bio_err, "-aes128, -aes192, -aes256\n");
|
||||||
|
BIO_printf (bio_err, " encrypt PEM output with cbc aes\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf (bio_err, "-nodes don't encrypt private keys\n");
|
BIO_printf (bio_err, "-nodes don't encrypt private keys\n");
|
||||||
BIO_printf (bio_err, "-noiter don't use encryption iteration\n");
|
BIO_printf (bio_err, "-noiter don't use encryption iteration\n");
|
||||||
@@ -265,12 +311,15 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-password p set import/export password source\n");
|
BIO_printf (bio_err, "-password p set import/export password source\n");
|
||||||
BIO_printf (bio_err, "-passin p input file pass phrase source\n");
|
BIO_printf (bio_err, "-passin p input file pass phrase source\n");
|
||||||
BIO_printf (bio_err, "-passout p output file pass phrase source\n");
|
BIO_printf (bio_err, "-passout p output file pass phrase source\n");
|
||||||
|
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
BIO_printf(bio_err, " the random number generator\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if(passarg) {
|
if(passarg) {
|
||||||
if(export_cert) passargout = passarg;
|
if(export_cert) passargout = passarg;
|
||||||
else passargin = passarg;
|
else passargin = passarg;
|
||||||
@@ -315,29 +364,20 @@ int MAIN(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (certfile) {
|
|
||||||
if(!(certsin = BIO_new_file(certfile, "r"))) {
|
|
||||||
BIO_printf(bio_err, "Can't open certificate file %s\n", certfile);
|
|
||||||
perror (certfile);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keyname) {
|
|
||||||
if(!(inkey = BIO_new_file(keyname, "r"))) {
|
|
||||||
BIO_printf(bio_err, "Can't key certificate file %s\n", keyname);
|
|
||||||
perror (keyname);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_pop_info();
|
CRYPTO_pop_info();
|
||||||
CRYPTO_push_info("write files");
|
CRYPTO_push_info("write files");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!outfile) out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
if (!outfile) {
|
||||||
else out = BIO_new_file(outfile, "wb");
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
} else out = BIO_new_file(outfile, "wb");
|
||||||
if (!out) {
|
if (!out) {
|
||||||
BIO_printf(bio_err, "Error opening output file %s\n",
|
BIO_printf(bio_err, "Error opening output file %s\n",
|
||||||
outfile ? outfile : "<stdout>");
|
outfile ? outfile : "<stdout>");
|
||||||
@@ -348,7 +388,7 @@ int MAIN(int argc, char **argv)
|
|||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_push_info("read MAC password");
|
CRYPTO_push_info("read MAC password");
|
||||||
#endif
|
#endif
|
||||||
if(EVP_read_pw_string (macpass, 50, "Enter MAC Password:", export_cert))
|
if(EVP_read_pw_string (macpass, sizeof macpass, "Enter MAC Password:", export_cert))
|
||||||
{
|
{
|
||||||
BIO_printf (bio_err, "Can't read Password\n");
|
BIO_printf (bio_err, "Can't read Password\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -359,145 +399,189 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (export_cert) {
|
if (export_cert) {
|
||||||
EVP_PKEY *key;
|
EVP_PKEY *key = NULL;
|
||||||
STACK *bags, *safes;
|
X509 *ucert = NULL, *x = NULL;
|
||||||
PKCS12_SAFEBAG *bag;
|
|
||||||
PKCS8_PRIV_KEY_INFO *p8;
|
|
||||||
PKCS7 *authsafe;
|
|
||||||
X509 *ucert = NULL;
|
|
||||||
STACK_OF(X509) *certs=NULL;
|
STACK_OF(X509) *certs=NULL;
|
||||||
char *catmp;
|
unsigned char *catmp = NULL;
|
||||||
int i;
|
int i;
|
||||||
unsigned char keyid[EVP_MAX_MD_SIZE];
|
|
||||||
unsigned int keyidlen = 0;
|
if ((options & (NOCERTS|NOKEYS)) == (NOCERTS|NOKEYS))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Nothing to do!\n");
|
||||||
|
goto export_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options & NOCERTS)
|
||||||
|
chain = 0;
|
||||||
|
|
||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_push_info("process -export_cert");
|
CRYPTO_push_info("process -export_cert");
|
||||||
|
CRYPTO_push_info("reading private key");
|
||||||
#endif
|
#endif
|
||||||
key = PEM_read_bio_PrivateKey(inkey ? inkey : in, NULL, NULL, passin);
|
if (!(options & NOKEYS))
|
||||||
if (!inkey) (void) BIO_reset(in);
|
{
|
||||||
else BIO_free(inkey);
|
key = load_key(bio_err, keyname ? keyname : infile,
|
||||||
if (!key) {
|
FORMAT_PEM, 1, passin, e, "private key");
|
||||||
BIO_printf (bio_err, "Error loading private key\n");
|
if (!key)
|
||||||
ERR_print_errors(bio_err);
|
goto export_end;
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
certs = sk_X509_new(NULL);
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("reading certs from input");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Load in all certs in input file */
|
/* Load in all certs in input file */
|
||||||
if(!cert_load(in, certs)) {
|
if(!(options & NOCERTS))
|
||||||
BIO_printf(bio_err, "Error loading certificates from input\n");
|
{
|
||||||
ERR_print_errors(bio_err);
|
certs = load_certs(bio_err, infile, FORMAT_PEM, NULL, e,
|
||||||
goto end;
|
"certificates");
|
||||||
}
|
if (!certs)
|
||||||
|
goto export_end;
|
||||||
|
|
||||||
for(i = 0; i < sk_X509_num(certs); i++) {
|
if (key)
|
||||||
ucert = sk_X509_value(certs, i);
|
{
|
||||||
if(X509_check_private_key(ucert, key)) {
|
/* Look for matching private key */
|
||||||
X509_digest(ucert, EVP_sha1(), keyid, &keyidlen);
|
for(i = 0; i < sk_X509_num(certs); i++)
|
||||||
|
{
|
||||||
|
x = sk_X509_value(certs, i);
|
||||||
|
if(X509_check_private_key(x, key))
|
||||||
|
{
|
||||||
|
ucert = x;
|
||||||
|
/* Zero keyid and alias */
|
||||||
|
X509_keyid_set1(ucert, NULL, 0);
|
||||||
|
X509_alias_set1(ucert, NULL, 0);
|
||||||
|
/* Remove from list */
|
||||||
|
sk_X509_delete(certs, i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ucert)
|
||||||
if(!keyidlen) {
|
{
|
||||||
BIO_printf(bio_err, "No certificate matches private key\n");
|
BIO_printf(bio_err, "No certificate matches private key\n");
|
||||||
goto end;
|
goto export_end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bags = sk_new (NULL);
|
}
|
||||||
|
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("reading certs from input 2");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Add any more certificates asked for */
|
/* Add any more certificates asked for */
|
||||||
if (certsin) {
|
if(certfile)
|
||||||
if(!cert_load(certsin, certs)) {
|
{
|
||||||
BIO_printf(bio_err, "Error loading certificates from certfile\n");
|
STACK_OF(X509) *morecerts=NULL;
|
||||||
ERR_print_errors(bio_err);
|
if(!(morecerts = load_certs(bio_err, certfile, FORMAT_PEM,
|
||||||
goto end;
|
NULL, e,
|
||||||
}
|
"certificates from certfile")))
|
||||||
BIO_free(certsin);
|
goto export_end;
|
||||||
|
while(sk_X509_num(morecerts) > 0)
|
||||||
|
sk_X509_push(certs, sk_X509_shift(morecerts));
|
||||||
|
sk_X509_free(morecerts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("reading certs from certfile");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("building chain");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If chaining get chain from user cert */
|
/* If chaining get chain from user cert */
|
||||||
if (chain) {
|
if (chain) {
|
||||||
int vret;
|
int vret;
|
||||||
STACK_OF(X509) *chain2;
|
STACK_OF(X509) *chain2;
|
||||||
vret = get_cert_chain (ucert, &chain2);
|
X509_STORE *store = X509_STORE_new();
|
||||||
if (vret) {
|
if (!store)
|
||||||
BIO_printf (bio_err, "Error %s getting chain.\n",
|
{
|
||||||
X509_verify_cert_error_string(vret));
|
BIO_printf (bio_err, "Memory allocation error\n");
|
||||||
goto end;
|
goto export_end;
|
||||||
}
|
}
|
||||||
|
if (!X509_STORE_load_locations(store, CAfile, CApath))
|
||||||
|
X509_STORE_set_default_paths (store);
|
||||||
|
|
||||||
|
vret = get_cert_chain (ucert, store, &chain2);
|
||||||
|
X509_STORE_free(store);
|
||||||
|
|
||||||
|
if (!vret) {
|
||||||
/* Exclude verified certificate */
|
/* Exclude verified certificate */
|
||||||
for (i = 1; i < sk_X509_num (chain2) ; i++)
|
for (i = 1; i < sk_X509_num (chain2) ; i++)
|
||||||
sk_X509_push(certs, sk_X509_value (chain2, i));
|
sk_X509_push(certs, sk_X509_value (chain2, i));
|
||||||
|
/* Free first certificate */
|
||||||
|
X509_free(sk_X509_value(chain2, 0));
|
||||||
sk_X509_free(chain2);
|
sk_X509_free(chain2);
|
||||||
|
} else {
|
||||||
|
BIO_printf (bio_err, "Error %s getting chain.\n",
|
||||||
|
X509_verify_cert_error_string(vret));
|
||||||
|
goto export_end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We now have loads of certificates: include them all */
|
/* Add any CA names */
|
||||||
for(i = 0; i < sk_X509_num(certs); i++) {
|
|
||||||
X509 *cert = NULL;
|
for (i = 0; i < sk_num(canames); i++)
|
||||||
cert = sk_X509_value(certs, i);
|
{
|
||||||
bag = M_PKCS12_x5092certbag(cert);
|
catmp = (unsigned char *)sk_value(canames, i);
|
||||||
/* If it matches private key set id */
|
X509_alias_set1(sk_X509_value(certs, i), catmp, -1);
|
||||||
if(cert == ucert) {
|
|
||||||
if(name) PKCS12_add_friendlyname(bag, name, -1);
|
|
||||||
PKCS12_add_localkeyid(bag, keyid, keyidlen);
|
|
||||||
} else if((catmp = sk_shift(canames)))
|
|
||||||
PKCS12_add_friendlyname(bag, catmp, -1);
|
|
||||||
sk_push(bags, (char *)bag);
|
|
||||||
}
|
}
|
||||||
sk_X509_pop_free(certs, X509_free);
|
|
||||||
if (canames) sk_free(canames);
|
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("reading password");
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!noprompt &&
|
if(!noprompt &&
|
||||||
EVP_read_pw_string(pass, 50, "Enter Export Password:", 1)) {
|
EVP_read_pw_string(pass, sizeof pass, "Enter Export Password:", 1))
|
||||||
|
{
|
||||||
BIO_printf (bio_err, "Can't read Password\n");
|
BIO_printf (bio_err, "Can't read Password\n");
|
||||||
goto end;
|
goto export_end;
|
||||||
}
|
}
|
||||||
if (!twopass) strcpy(macpass, pass);
|
if (!twopass) strcpy(macpass, pass);
|
||||||
/* Turn certbags into encrypted authsafe */
|
|
||||||
authsafe = PKCS12_pack_p7encdata(cert_pbe, cpass, -1, NULL, 0,
|
|
||||||
iter, bags);
|
|
||||||
sk_pop_free(bags, PKCS12_SAFEBAG_free);
|
|
||||||
|
|
||||||
if (!authsafe) {
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("creating PKCS#12 structure");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
p12 = PKCS12_create(pass, name, key, ucert, certs,
|
||||||
|
key_pbe, cert_pbe, iter, -1, keytype);
|
||||||
|
|
||||||
|
if (!p12)
|
||||||
|
{
|
||||||
ERR_print_errors (bio_err);
|
ERR_print_errors (bio_err);
|
||||||
goto end;
|
goto export_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
safes = sk_new (NULL);
|
if (maciter != -1)
|
||||||
sk_push (safes, (char *)authsafe);
|
|
||||||
|
|
||||||
/* Make a shrouded key bag */
|
|
||||||
p8 = EVP_PKEY2PKCS8 (key);
|
|
||||||
EVP_PKEY_free(key);
|
|
||||||
if(keytype) PKCS8_add_keyusage(p8, keytype);
|
|
||||||
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);
|
|
||||||
bags = sk_new(NULL);
|
|
||||||
sk_push (bags, (char *)bag);
|
|
||||||
/* Turn it into unencrypted safe bag */
|
|
||||||
authsafe = PKCS12_pack_p7data (bags);
|
|
||||||
sk_pop_free(bags, PKCS12_SAFEBAG_free);
|
|
||||||
sk_push (safes, (char *)authsafe);
|
|
||||||
|
|
||||||
p12 = PKCS12_init (NID_pkcs7_data);
|
|
||||||
|
|
||||||
M_PKCS12_pack_authsafes (p12, safes);
|
|
||||||
|
|
||||||
sk_pop_free(safes, PKCS7_free);
|
|
||||||
|
|
||||||
PKCS12_set_mac(p12, mpass, -1, NULL, 0, maciter, NULL);
|
PKCS12_set_mac(p12, mpass, -1, NULL, 0, maciter, NULL);
|
||||||
|
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("writing pkcs12");
|
||||||
|
#endif
|
||||||
|
|
||||||
i2d_PKCS12_bio(out, p12);
|
i2d_PKCS12_bio(out, p12);
|
||||||
|
|
||||||
PKCS12_free(p12);
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
export_end:
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
CRYPTO_push_info("process -export_cert: freeing");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (key) EVP_PKEY_free(key);
|
||||||
|
if (certs) sk_X509_pop_free(certs, X509_free);
|
||||||
|
if (ucert) X509_free(ucert);
|
||||||
|
|
||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_pop_info();
|
CRYPTO_pop_info();
|
||||||
#endif
|
#endif
|
||||||
@@ -513,7 +597,7 @@ int MAIN(int argc, char **argv)
|
|||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_push_info("read import password");
|
CRYPTO_push_info("read import password");
|
||||||
#endif
|
#endif
|
||||||
if(!noprompt && EVP_read_pw_string(pass, 50, "Enter Import Password:", 0)) {
|
if(!noprompt && EVP_read_pw_string(pass, sizeof pass, "Enter Import Password:", 0)) {
|
||||||
BIO_printf (bio_err, "Can't read Password\n");
|
BIO_printf (bio_err, "Can't read Password\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -528,11 +612,16 @@ int MAIN(int argc, char **argv)
|
|||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_push_info("verify MAC");
|
CRYPTO_push_info("verify MAC");
|
||||||
#endif
|
#endif
|
||||||
if (!PKCS12_verify_mac (p12, mpass, -1)) {
|
/* If we enter empty password try no password first */
|
||||||
|
if(!macpass[0] && PKCS12_verify_mac(p12, NULL, 0)) {
|
||||||
|
/* If mac and crypto pass the same set it to NULL too */
|
||||||
|
if(!twopass) cpass = NULL;
|
||||||
|
} else if (!PKCS12_verify_mac(p12, mpass, -1)) {
|
||||||
BIO_printf (bio_err, "Mac verify error: invalid password?\n");
|
BIO_printf (bio_err, "Mac verify error: invalid password?\n");
|
||||||
ERR_print_errors (bio_err);
|
ERR_print_errors (bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
} else BIO_printf (bio_err, "MAC verified OK\n");
|
}
|
||||||
|
BIO_printf (bio_err, "MAC verified OK\n");
|
||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_pop_info();
|
CRYPTO_pop_info();
|
||||||
#endif
|
#endif
|
||||||
@@ -549,32 +638,36 @@ int MAIN(int argc, char **argv)
|
|||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_pop_info();
|
CRYPTO_pop_info();
|
||||||
#endif
|
#endif
|
||||||
PKCS12_free(p12);
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
|
if (p12) PKCS12_free(p12);
|
||||||
if(export_cert || inrand) app_RAND_write_file(NULL, bio_err);
|
if(export_cert || inrand) app_RAND_write_file(NULL, bio_err);
|
||||||
#ifdef CRYPTO_MDEBUG
|
#ifdef CRYPTO_MDEBUG
|
||||||
CRYPTO_remove_all_info();
|
CRYPTO_remove_all_info();
|
||||||
#endif
|
#endif
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
if(passin) Free(passin);
|
if (canames) sk_free(canames);
|
||||||
if(passout) Free(passout);
|
if(passin) OPENSSL_free(passin);
|
||||||
EXIT(ret);
|
if(passout) OPENSSL_free(passout);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
||||||
int passlen, int options, char *pempass)
|
int passlen, int options, char *pempass)
|
||||||
{
|
{
|
||||||
STACK *asafes, *bags;
|
STACK_OF(PKCS7) *asafes;
|
||||||
|
STACK_OF(PKCS12_SAFEBAG) *bags;
|
||||||
int i, bagnid;
|
int i, bagnid;
|
||||||
PKCS7 *p7;
|
PKCS7 *p7;
|
||||||
if (!( asafes = M_PKCS12_unpack_authsafes (p12))) return 0;
|
|
||||||
for (i = 0; i < sk_num (asafes); i++) {
|
if (!( asafes = PKCS12_unpack_authsafes(p12))) return 0;
|
||||||
p7 = (PKCS7 *) sk_value (asafes, i);
|
for (i = 0; i < sk_PKCS7_num (asafes); i++) {
|
||||||
|
p7 = sk_PKCS7_value (asafes, i);
|
||||||
bagnid = OBJ_obj2nid (p7->type);
|
bagnid = OBJ_obj2nid (p7->type);
|
||||||
if (bagnid == NID_pkcs7_data) {
|
if (bagnid == NID_pkcs7_data) {
|
||||||
bags = M_PKCS12_unpack_p7data (p7);
|
bags = PKCS12_unpack_p7data(p7);
|
||||||
if (options & INFO) BIO_printf (bio_err, "PKCS7 Data\n");
|
if (options & INFO) BIO_printf (bio_err, "PKCS7 Data\n");
|
||||||
} else if (bagnid == NID_pkcs7_encrypted) {
|
} else if (bagnid == NID_pkcs7_encrypted) {
|
||||||
if (options & INFO) {
|
if (options & INFO) {
|
||||||
@@ -582,28 +675,30 @@ int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, char *pass,
|
|||||||
alg_print(bio_err,
|
alg_print(bio_err,
|
||||||
p7->d.encrypted->enc_data->algorithm);
|
p7->d.encrypted->enc_data->algorithm);
|
||||||
}
|
}
|
||||||
bags = M_PKCS12_unpack_p7encdata (p7, pass, passlen);
|
bags = PKCS12_unpack_p7encdata(p7, pass, passlen);
|
||||||
} else continue;
|
} else continue;
|
||||||
if (!bags) return 0;
|
if (!bags) return 0;
|
||||||
if (!dump_certs_pkeys_bags (out, bags, pass, passlen,
|
if (!dump_certs_pkeys_bags (out, bags, pass, passlen,
|
||||||
options, pempass)) {
|
options, pempass)) {
|
||||||
sk_pop_free (bags, PKCS12_SAFEBAG_free);
|
sk_PKCS12_SAFEBAG_pop_free (bags, PKCS12_SAFEBAG_free);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
sk_pop_free (bags, PKCS12_SAFEBAG_free);
|
sk_PKCS12_SAFEBAG_pop_free (bags, PKCS12_SAFEBAG_free);
|
||||||
}
|
}
|
||||||
sk_pop_free (asafes, PKCS7_free);
|
sk_PKCS7_pop_free (asafes, PKCS7_free);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dump_certs_pkeys_bags (BIO *out, STACK *bags, char *pass,
|
int dump_certs_pkeys_bags (BIO *out, STACK_OF(PKCS12_SAFEBAG) *bags,
|
||||||
int passlen, int options, char *pempass)
|
char *pass, int passlen, int options, char *pempass)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < sk_num (bags); i++) {
|
for (i = 0; i < sk_PKCS12_SAFEBAG_num (bags); i++) {
|
||||||
if (!dump_certs_pkeys_bag (out,
|
if (!dump_certs_pkeys_bag (out,
|
||||||
(PKCS12_SAFEBAG *)sk_value (bags, i), pass, passlen,
|
sk_PKCS12_SAFEBAG_value (bags, i),
|
||||||
options, pempass)) return 0;
|
pass, passlen,
|
||||||
|
options, pempass))
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -635,9 +730,12 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
|||||||
}
|
}
|
||||||
if (options & NOKEYS) return 1;
|
if (options & NOKEYS) return 1;
|
||||||
print_attribs (out, bag->attrib, "Bag Attributes");
|
print_attribs (out, bag->attrib, "Bag Attributes");
|
||||||
if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen)))
|
if (!(p8 = PKCS12_decrypt_skey(bag, pass, passlen)))
|
||||||
return 0;
|
return 0;
|
||||||
if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
|
if (!(pkey = EVP_PKCS82PKEY (p8))) {
|
||||||
|
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
print_attribs (out, p8->attributes, "Key Attributes");
|
print_attribs (out, p8->attributes, "Key Attributes");
|
||||||
PKCS8_PRIV_KEY_INFO_free(p8);
|
PKCS8_PRIV_KEY_INFO_free(p8);
|
||||||
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);
|
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);
|
||||||
@@ -653,7 +751,7 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
|||||||
print_attribs (out, bag->attrib, "Bag Attributes");
|
print_attribs (out, bag->attrib, "Bag Attributes");
|
||||||
if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate )
|
if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate )
|
||||||
return 1;
|
return 1;
|
||||||
if (!(x509 = M_PKCS12_certbag2x509(bag))) return 0;
|
if (!(x509 = PKCS12_certbag2x509(bag))) return 0;
|
||||||
dump_cert_text (out, x509);
|
dump_cert_text (out, x509);
|
||||||
PEM_write_bio_X509 (out, x509);
|
PEM_write_bio_X509 (out, x509);
|
||||||
X509_free(x509);
|
X509_free(x509);
|
||||||
@@ -679,15 +777,15 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
|
|||||||
|
|
||||||
/* Hope this is OK .... */
|
/* Hope this is OK .... */
|
||||||
|
|
||||||
int get_cert_chain (X509 *cert, STACK_OF(X509) **chain)
|
int get_cert_chain (X509 *cert, X509_STORE *store, STACK_OF(X509) **chain)
|
||||||
{
|
{
|
||||||
X509_STORE *store;
|
|
||||||
X509_STORE_CTX store_ctx;
|
X509_STORE_CTX store_ctx;
|
||||||
STACK_OF(X509) *chn;
|
STACK_OF(X509) *chn;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
store = X509_STORE_new ();
|
/* FIXME: Should really check the return status of X509_STORE_CTX_init
|
||||||
X509_STORE_set_default_paths (store);
|
* for an error, but how that fits into the return value of this
|
||||||
|
* function is less obvious. */
|
||||||
X509_STORE_CTX_init(&store_ctx, store, cert, NULL);
|
X509_STORE_CTX_init(&store_ctx, store, cert, NULL);
|
||||||
if (X509_verify_cert(&store_ctx) <= 0) {
|
if (X509_verify_cert(&store_ctx) <= 0) {
|
||||||
i = X509_STORE_CTX_get_error (&store_ctx);
|
i = X509_STORE_CTX_get_error (&store_ctx);
|
||||||
@@ -698,7 +796,6 @@ int get_cert_chain (X509 *cert, STACK_OF(X509) **chain)
|
|||||||
*chain = chn;
|
*chain = chn;
|
||||||
err:
|
err:
|
||||||
X509_STORE_CTX_cleanup(&store_ctx);
|
X509_STORE_CTX_cleanup(&store_ctx);
|
||||||
X509_STORE_free(store);
|
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -722,10 +819,22 @@ int cert_load(BIO *in, STACK_OF(X509) *sk)
|
|||||||
int ret;
|
int ret;
|
||||||
X509 *cert;
|
X509 *cert;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_push_info("cert_load(): reading one cert");
|
||||||
|
#endif
|
||||||
while((cert = PEM_read_bio_X509(in, NULL, NULL, NULL))) {
|
while((cert = PEM_read_bio_X509(in, NULL, NULL, NULL))) {
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
#endif
|
||||||
ret = 1;
|
ret = 1;
|
||||||
sk_X509_push(sk, cert);
|
sk_X509_push(sk, cert);
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_push_info("cert_load(): reading one cert");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifdef CRYPTO_MDEBUG
|
||||||
|
CRYPTO_pop_info();
|
||||||
|
#endif
|
||||||
if(ret) ERR_clear_error();
|
if(ret) ERR_clear_error();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -763,18 +872,18 @@ int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name)
|
|||||||
value = uni2asc(av->value.bmpstring->data,
|
value = uni2asc(av->value.bmpstring->data,
|
||||||
av->value.bmpstring->length);
|
av->value.bmpstring->length);
|
||||||
BIO_printf(out, "%s\n", value);
|
BIO_printf(out, "%s\n", value);
|
||||||
Free(value);
|
OPENSSL_free(value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case V_ASN1_OCTET_STRING:
|
case V_ASN1_OCTET_STRING:
|
||||||
hex_prin(out, av->value.bit_string->data,
|
hex_prin(out, av->value.octet_string->data,
|
||||||
av->value.bit_string->length);
|
av->value.octet_string->length);
|
||||||
BIO_printf(out, "\n");
|
BIO_printf(out, "\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case V_ASN1_BIT_STRING:
|
case V_ASN1_BIT_STRING:
|
||||||
hex_prin(out, av->value.octet_string->data,
|
hex_prin(out, av->value.bit_string->data,
|
||||||
av->value.octet_string->length);
|
av->value.bit_string->length);
|
||||||
BIO_printf(out, "\n");
|
BIO_printf(out, "\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
28
apps/pkcs7.c
28
apps/pkcs7.c
@@ -82,13 +82,15 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
PKCS7 *p7=NULL;
|
PKCS7 *p7=NULL;
|
||||||
int i,badops=0;
|
int i,badops=0;
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *in=NULL,*out=NULL;
|
||||||
int informat,outformat;
|
int informat,outformat;
|
||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog;
|
||||||
int print_certs=0,text=0,noout=0;
|
int print_certs=0,text=0,noout=0;
|
||||||
int ret=0;
|
int ret=1;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -132,6 +134,11 @@ int MAIN(int argc, char **argv)
|
|||||||
text=1;
|
text=1;
|
||||||
else if (strcmp(*argv,"-print_certs") == 0)
|
else if (strcmp(*argv,"-print_certs") == 0)
|
||||||
print_certs=1;
|
print_certs=1;
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
@@ -154,11 +161,15 @@ bad:
|
|||||||
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
|
BIO_printf(bio_err," -print_certs print any certs or crl in the input\n");
|
||||||
BIO_printf(bio_err," -text print full details of certificates\n");
|
BIO_printf(bio_err," -text print full details of certificates\n");
|
||||||
BIO_printf(bio_err," -noout don't output encoded data\n");
|
BIO_printf(bio_err," -noout don't output encoded data\n");
|
||||||
EXIT(1);
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
|
ret = 1;
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
in=BIO_new(BIO_s_file());
|
||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL))
|
if ((in == NULL) || (out == NULL))
|
||||||
@@ -196,7 +207,15 @@ bad:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -280,6 +299,7 @@ bad:
|
|||||||
end:
|
end:
|
||||||
if (p7 != NULL) PKCS7_free(p7);
|
if (p7 != NULL) PKCS7_free(p7);
|
||||||
if (in != NULL) BIO_free(in);
|
if (in != NULL) BIO_free(in);
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
65
apps/pkcs8.c
65
apps/pkcs8.c
@@ -63,13 +63,13 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/pkcs12.h>
|
#include <openssl/pkcs12.h>
|
||||||
|
|
||||||
#include "apps.h"
|
|
||||||
#define PROG pkcs8_main
|
#define PROG pkcs8_main
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
char **args, *infile = NULL, *outfile = NULL;
|
char **args, *infile = NULL, *outfile = NULL;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
@@ -82,12 +82,19 @@ int MAIN(int argc, char **argv)
|
|||||||
int nocrypt = 0;
|
int nocrypt = 0;
|
||||||
X509_SIG *p8;
|
X509_SIG *p8;
|
||||||
PKCS8_PRIV_KEY_INFO *p8inf;
|
PKCS8_PRIV_KEY_INFO *p8inf;
|
||||||
EVP_PKEY *pkey;
|
EVP_PKEY *pkey=NULL;
|
||||||
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
char pass[50], *passin = NULL, *passout = NULL, *p8pass = NULL;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
if (bio_err == NULL) bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat=FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
args = argv + 1;
|
args = argv + 1;
|
||||||
@@ -138,6 +145,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (!args[1]) goto bad;
|
if (!args[1]) goto bad;
|
||||||
passargout= *(++args);
|
passargout= *(++args);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*args,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (!args[1]) goto bad;
|
||||||
|
engine= *(++args);
|
||||||
|
}
|
||||||
else if (!strcmp (*args, "-in")) {
|
else if (!strcmp (*args, "-in")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
@@ -170,9 +182,12 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
|
BIO_printf(bio_err, "-nocrypt use or expect unencrypted private key\n");
|
||||||
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
BIO_printf(bio_err, "-v2 alg use PKCS#5 v2.0 and cipher \"alg\"\n");
|
||||||
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
BIO_printf(bio_err, "-v1 obj use PKCS#5 v1.5 and cipher \"alg\"\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
return (1);
|
return (1);
|
||||||
@@ -194,23 +209,23 @@ int MAIN(int argc, char **argv)
|
|||||||
"Can't open output file %s\n", outfile);
|
"Can't open output file %s\n", outfile);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
} else out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
} else {
|
||||||
|
out = BIO_new_fp (stdout, BIO_NOCLOSE);
|
||||||
if (topk8) {
|
#ifdef OPENSSL_SYS_VMS
|
||||||
if(informat == FORMAT_PEM)
|
{
|
||||||
pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, passin);
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
else if(informat == FORMAT_ASN1)
|
out = BIO_push(tmpbio, out);
|
||||||
pkey = d2i_PrivateKey_bio(in, NULL);
|
|
||||||
else {
|
|
||||||
BIO_printf(bio_err, "Bad format specified for key\n");
|
|
||||||
return (1);
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (topk8)
|
||||||
|
{
|
||||||
|
BIO_free(in); /* Not needed in this section */
|
||||||
|
pkey = load_key(bio_err, infile, informat, 1,
|
||||||
|
passin, e, "key");
|
||||||
if (!pkey) {
|
if (!pkey) {
|
||||||
BIO_printf(bio_err, "Error reading key\n", outfile);
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
BIO_free(in);
|
|
||||||
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
|
if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) {
|
||||||
BIO_printf(bio_err, "Error converting key\n", outfile);
|
BIO_printf(bio_err, "Error converting key\n", outfile);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
@@ -229,7 +244,8 @@ int MAIN(int argc, char **argv)
|
|||||||
if(passout) p8pass = passout;
|
if(passout) p8pass = passout;
|
||||||
else {
|
else {
|
||||||
p8pass = pass;
|
p8pass = pass;
|
||||||
EVP_read_pw_string(pass, 50, "Enter Encryption Password:", 1);
|
if (EVP_read_pw_string(pass, sizeof pass, "Enter Encryption Password:", 1))
|
||||||
|
return (1);
|
||||||
}
|
}
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
if (!(p8 = PKCS8_encrypt(pbe_nid, cipher,
|
||||||
@@ -253,9 +269,9 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
PKCS8_PRIV_KEY_INFO_free (p8inf);
|
PKCS8_PRIV_KEY_INFO_free (p8inf);
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
if(passin) Free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
if(passout) Free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,9 +302,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if(passin) p8pass = passin;
|
if(passin) p8pass = passin;
|
||||||
else {
|
else {
|
||||||
p8pass = pass;
|
p8pass = pass;
|
||||||
EVP_read_pw_string(pass, 50, "Enter Password:", 0);
|
EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0);
|
||||||
}
|
}
|
||||||
p8inf = M_PKCS8_decrypt(p8, p8pass, strlen(p8pass));
|
p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
|
||||||
X509_SIG_free(p8);
|
X509_SIG_free(p8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,11 +351,12 @@ int MAIN(int argc, char **argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
if(passin) Free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
if(passout) Free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
165
apps/progs.h
165
apps/progs.h
@@ -14,8 +14,11 @@ extern int errstr_main(int argc,char *argv[]);
|
|||||||
extern int ca_main(int argc,char *argv[]);
|
extern int ca_main(int argc,char *argv[]);
|
||||||
extern int crl_main(int argc,char *argv[]);
|
extern int crl_main(int argc,char *argv[]);
|
||||||
extern int rsa_main(int argc,char *argv[]);
|
extern int rsa_main(int argc,char *argv[]);
|
||||||
|
extern int rsautl_main(int argc,char *argv[]);
|
||||||
extern int dsa_main(int argc,char *argv[]);
|
extern int dsa_main(int argc,char *argv[]);
|
||||||
extern int dsaparam_main(int argc,char *argv[]);
|
extern int dsaparam_main(int argc,char *argv[]);
|
||||||
|
extern int ec_main(int argc,char *argv[]);
|
||||||
|
extern int ecparam_main(int argc,char *argv[]);
|
||||||
extern int x509_main(int argc,char *argv[]);
|
extern int x509_main(int argc,char *argv[]);
|
||||||
extern int genrsa_main(int argc,char *argv[]);
|
extern int genrsa_main(int argc,char *argv[]);
|
||||||
extern int gendsa_main(int argc,char *argv[]);
|
extern int gendsa_main(int argc,char *argv[]);
|
||||||
@@ -34,6 +37,8 @@ extern int pkcs8_main(int argc,char *argv[]);
|
|||||||
extern int spkac_main(int argc,char *argv[]);
|
extern int spkac_main(int argc,char *argv[]);
|
||||||
extern int smime_main(int argc,char *argv[]);
|
extern int smime_main(int argc,char *argv[]);
|
||||||
extern int rand_main(int argc,char *argv[]);
|
extern int rand_main(int argc,char *argv[]);
|
||||||
|
extern int engine_main(int argc,char *argv[]);
|
||||||
|
extern int ocsp_main(int argc,char *argv[]);
|
||||||
|
|
||||||
#define FUNC_TYPE_GENERAL 1
|
#define FUNC_TYPE_GENERAL 1
|
||||||
#define FUNC_TYPE_MD 2
|
#define FUNC_TYPE_MD 2
|
||||||
@@ -50,201 +55,245 @@ FUNCTION functions[] = {
|
|||||||
{FUNC_TYPE_GENERAL,"asn1parse",asn1parse_main},
|
{FUNC_TYPE_GENERAL,"asn1parse",asn1parse_main},
|
||||||
{FUNC_TYPE_GENERAL,"req",req_main},
|
{FUNC_TYPE_GENERAL,"req",req_main},
|
||||||
{FUNC_TYPE_GENERAL,"dgst",dgst_main},
|
{FUNC_TYPE_GENERAL,"dgst",dgst_main},
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
{FUNC_TYPE_GENERAL,"dh",dh_main},
|
{FUNC_TYPE_GENERAL,"dh",dh_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
{FUNC_TYPE_GENERAL,"dhparam",dhparam_main},
|
{FUNC_TYPE_GENERAL,"dhparam",dhparam_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"enc",enc_main},
|
{FUNC_TYPE_GENERAL,"enc",enc_main},
|
||||||
{FUNC_TYPE_GENERAL,"passwd",passwd_main},
|
{FUNC_TYPE_GENERAL,"passwd",passwd_main},
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
{FUNC_TYPE_GENERAL,"gendh",gendh_main},
|
{FUNC_TYPE_GENERAL,"gendh",gendh_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"errstr",errstr_main},
|
{FUNC_TYPE_GENERAL,"errstr",errstr_main},
|
||||||
{FUNC_TYPE_GENERAL,"ca",ca_main},
|
{FUNC_TYPE_GENERAL,"ca",ca_main},
|
||||||
{FUNC_TYPE_GENERAL,"crl",crl_main},
|
{FUNC_TYPE_GENERAL,"crl",crl_main},
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
{FUNC_TYPE_GENERAL,"rsa",rsa_main},
|
{FUNC_TYPE_GENERAL,"rsa",rsa_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
|
{FUNC_TYPE_GENERAL,"rsautl",rsautl_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_DSA
|
||||||
{FUNC_TYPE_GENERAL,"dsa",dsa_main},
|
{FUNC_TYPE_GENERAL,"dsa",dsa_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
{FUNC_TYPE_GENERAL,"dsaparam",dsaparam_main},
|
{FUNC_TYPE_GENERAL,"dsaparam",dsaparam_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_EC
|
||||||
|
{FUNC_TYPE_GENERAL,"ec",ec_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_EC
|
||||||
|
{FUNC_TYPE_GENERAL,"ecparam",ecparam_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"x509",x509_main},
|
{FUNC_TYPE_GENERAL,"x509",x509_main},
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
{FUNC_TYPE_GENERAL,"genrsa",genrsa_main},
|
{FUNC_TYPE_GENERAL,"genrsa",genrsa_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
{FUNC_TYPE_GENERAL,"gendsa",gendsa_main},
|
{FUNC_TYPE_GENERAL,"gendsa",gendsa_main},
|
||||||
#endif
|
#endif
|
||||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL,"s_server",s_server_main},
|
{FUNC_TYPE_GENERAL,"s_server",s_server_main},
|
||||||
#endif
|
#endif
|
||||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL,"s_client",s_client_main},
|
{FUNC_TYPE_GENERAL,"s_client",s_client_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"speed",speed_main},
|
{FUNC_TYPE_GENERAL,"speed",speed_main},
|
||||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL,"s_time",s_time_main},
|
{FUNC_TYPE_GENERAL,"s_time",s_time_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"version",version_main},
|
{FUNC_TYPE_GENERAL,"version",version_main},
|
||||||
{FUNC_TYPE_GENERAL,"pkcs7",pkcs7_main},
|
{FUNC_TYPE_GENERAL,"pkcs7",pkcs7_main},
|
||||||
{FUNC_TYPE_GENERAL,"crl2pkcs7",crl2pkcs7_main},
|
{FUNC_TYPE_GENERAL,"crl2pkcs7",crl2pkcs7_main},
|
||||||
{FUNC_TYPE_GENERAL,"sess_id",sess_id_main},
|
{FUNC_TYPE_GENERAL,"sess_id",sess_id_main},
|
||||||
#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))
|
#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))
|
||||||
{FUNC_TYPE_GENERAL,"ciphers",ciphers_main},
|
{FUNC_TYPE_GENERAL,"ciphers",ciphers_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"nseq",nseq_main},
|
{FUNC_TYPE_GENERAL,"nseq",nseq_main},
|
||||||
#if !defined(NO_DES) && !defined(NO_SHA1)
|
#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)
|
||||||
{FUNC_TYPE_GENERAL,"pkcs12",pkcs12_main},
|
{FUNC_TYPE_GENERAL,"pkcs12",pkcs12_main},
|
||||||
#endif
|
#endif
|
||||||
{FUNC_TYPE_GENERAL,"pkcs8",pkcs8_main},
|
{FUNC_TYPE_GENERAL,"pkcs8",pkcs8_main},
|
||||||
{FUNC_TYPE_GENERAL,"spkac",spkac_main},
|
{FUNC_TYPE_GENERAL,"spkac",spkac_main},
|
||||||
{FUNC_TYPE_GENERAL,"smime",smime_main},
|
{FUNC_TYPE_GENERAL,"smime",smime_main},
|
||||||
{FUNC_TYPE_GENERAL,"rand",rand_main},
|
{FUNC_TYPE_GENERAL,"rand",rand_main},
|
||||||
|
{FUNC_TYPE_GENERAL,"engine",engine_main},
|
||||||
|
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
|
||||||
|
#ifndef OPENSSL_NO_MD2
|
||||||
{FUNC_TYPE_MD,"md2",dgst_main},
|
{FUNC_TYPE_MD,"md2",dgst_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_MD4
|
||||||
|
{FUNC_TYPE_MD,"md4",dgst_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_MD5
|
||||||
{FUNC_TYPE_MD,"md5",dgst_main},
|
{FUNC_TYPE_MD,"md5",dgst_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_SHA
|
||||||
{FUNC_TYPE_MD,"sha",dgst_main},
|
{FUNC_TYPE_MD,"sha",dgst_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_SHA1
|
||||||
{FUNC_TYPE_MD,"sha1",dgst_main},
|
{FUNC_TYPE_MD,"sha1",dgst_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_MDC2
|
||||||
{FUNC_TYPE_MD,"mdc2",dgst_main},
|
{FUNC_TYPE_MD,"mdc2",dgst_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_RMD160
|
||||||
{FUNC_TYPE_MD,"rmd160",dgst_main},
|
{FUNC_TYPE_MD,"rmd160",dgst_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
{FUNC_TYPE_CIPHER,"aes-128-cbc",enc_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
{FUNC_TYPE_CIPHER,"aes-128-ecb",enc_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
{FUNC_TYPE_CIPHER,"aes-192-cbc",enc_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
{FUNC_TYPE_CIPHER,"aes-192-ecb",enc_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
{FUNC_TYPE_CIPHER,"aes-256-cbc",enc_main},
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
{FUNC_TYPE_CIPHER,"aes-256-ecb",enc_main},
|
||||||
|
#endif
|
||||||
{FUNC_TYPE_CIPHER,"base64",enc_main},
|
{FUNC_TYPE_CIPHER,"base64",enc_main},
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des",enc_main},
|
{FUNC_TYPE_CIPHER,"des",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des3",enc_main},
|
{FUNC_TYPE_CIPHER,"des3",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"desx",enc_main},
|
{FUNC_TYPE_CIPHER,"desx",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER,"idea",enc_main},
|
{FUNC_TYPE_CIPHER,"idea",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC4
|
#ifndef OPENSSL_NO_RC4
|
||||||
{FUNC_TYPE_CIPHER,"rc4",enc_main},
|
{FUNC_TYPE_CIPHER,"rc4",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC4
|
#ifndef OPENSSL_NO_RC4
|
||||||
{FUNC_TYPE_CIPHER,"rc4-40",enc_main},
|
{FUNC_TYPE_CIPHER,"rc4-40",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER,"rc2",enc_main},
|
{FUNC_TYPE_CIPHER,"rc2",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER,"bf",enc_main},
|
{FUNC_TYPE_CIPHER,"bf",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER,"cast",enc_main},
|
{FUNC_TYPE_CIPHER,"cast",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER,"rc5",enc_main},
|
{FUNC_TYPE_CIPHER,"rc5",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ecb",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede3",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"des-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede3-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"des-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede3-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
{FUNC_TYPE_CIPHER,"des-ede3-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"des-ede3-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER,"idea-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"idea-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER,"idea-ecb",enc_main},
|
{FUNC_TYPE_CIPHER,"idea-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER,"idea-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"idea-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
{FUNC_TYPE_CIPHER,"idea-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"idea-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER,"rc2-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER,"rc2-ecb",enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER,"rc2-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER,"rc2-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER,"rc2-64-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-64-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
{FUNC_TYPE_CIPHER,"rc2-40-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"rc2-40-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER,"bf-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"bf-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER,"bf-ecb",enc_main},
|
{FUNC_TYPE_CIPHER,"bf-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER,"bf-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"bf-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
{FUNC_TYPE_CIPHER,"bf-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"bf-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER,"cast5-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER,"cast5-ecb",enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER,"cast5-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER,"cast5-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"cast5-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_CAST
|
#ifndef OPENSSL_NO_CAST
|
||||||
{FUNC_TYPE_CIPHER,"cast-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"cast-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER,"rc5-cbc",enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-cbc",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER,"rc5-ecb",enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-ecb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER,"rc5-cfb",enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-cfb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC5
|
#ifndef OPENSSL_NO_RC5
|
||||||
{FUNC_TYPE_CIPHER,"rc5-ofb",enc_main},
|
{FUNC_TYPE_CIPHER,"rc5-ofb",enc_main},
|
||||||
#endif
|
#endif
|
||||||
{0,NULL,NULL}
|
{0,NULL,NULL}
|
||||||
|
|||||||
@@ -28,26 +28,31 @@ foreach (@ARGV)
|
|||||||
push(@files,$_);
|
push(@files,$_);
|
||||||
$str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
|
$str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
|
||||||
if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
|
if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
|
||||||
{ print "#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(NO_SSL3))\n${str}#endif\n"; }
|
{ print "#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))\n${str}#endif\n"; }
|
||||||
elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) )
|
elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) || ($_ =~ /^rsautl$/))
|
||||||
{ print "#ifndef NO_RSA\n${str}#endif\n"; }
|
{ print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n"; }
|
||||||
elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/))
|
elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/))
|
||||||
{ print "#ifndef NO_DSA\n${str}#endif\n"; }
|
{ print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n"; }
|
||||||
|
elsif ( ($_ =~ /^ec$/) || ($_ =~ /^ecparam$/))
|
||||||
|
{ print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";}
|
||||||
elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/))
|
elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/))
|
||||||
{ print "#ifndef NO_DH\n${str}#endif\n"; }
|
{ print "#ifndef OPENSSL_NO_DH\n${str}#endif\n"; }
|
||||||
elsif ( ($_ =~ /^pkcs12$/))
|
elsif ( ($_ =~ /^pkcs12$/))
|
||||||
{ print "#if !defined(NO_DES) && !defined(NO_SHA1)\n${str}#endif\n"; }
|
{ print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)\n${str}#endif\n"; }
|
||||||
else
|
else
|
||||||
{ print $str; }
|
{ print $str; }
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ("md2","md5","sha","sha1","mdc2","rmd160")
|
foreach ("md2","md4","md5","sha","sha1","mdc2","rmd160")
|
||||||
{
|
{
|
||||||
push(@files,$_);
|
push(@files,$_);
|
||||||
printf "\t{FUNC_TYPE_MD,\"%s\",dgst_main},\n",$_;
|
printf "#ifndef OPENSSL_NO_".uc($_)."\n\t{FUNC_TYPE_MD,\"".$_."\",dgst_main},\n#endif\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (
|
foreach (
|
||||||
|
"aes-128-cbc", "aes-128-ecb",
|
||||||
|
"aes-192-cbc", "aes-192-ecb",
|
||||||
|
"aes-256-cbc", "aes-256-ecb",
|
||||||
"base64",
|
"base64",
|
||||||
"des", "des3", "desx", "idea", "rc4", "rc4-40",
|
"des", "des3", "desx", "idea", "rc4", "rc4-40",
|
||||||
"rc2", "bf", "cast", "rc5",
|
"rc2", "bf", "cast", "rc5",
|
||||||
@@ -64,13 +69,14 @@ foreach (
|
|||||||
push(@files,$_);
|
push(@files,$_);
|
||||||
|
|
||||||
$t=sprintf("\t{FUNC_TYPE_CIPHER,\"%s\",enc_main},\n",$_);
|
$t=sprintf("\t{FUNC_TYPE_CIPHER,\"%s\",enc_main},\n",$_);
|
||||||
if ($_ =~ /des/) { $t="#ifndef NO_DES\n${t}#endif\n"; }
|
if ($_ =~ /des/) { $t="#ifndef OPENSSL_NO_DES\n${t}#endif\n"; }
|
||||||
elsif ($_ =~ /idea/) { $t="#ifndef NO_IDEA\n${t}#endif\n"; }
|
elsif ($_ =~ /aes/) { $t="#ifndef OPENSSL_NO_AES\n${t}#endif\n"; }
|
||||||
elsif ($_ =~ /rc4/) { $t="#ifndef NO_RC4\n${t}#endif\n"; }
|
elsif ($_ =~ /idea/) { $t="#ifndef OPENSSL_NO_IDEA\n${t}#endif\n"; }
|
||||||
elsif ($_ =~ /rc2/) { $t="#ifndef NO_RC2\n${t}#endif\n"; }
|
elsif ($_ =~ /rc4/) { $t="#ifndef OPENSSL_NO_RC4\n${t}#endif\n"; }
|
||||||
elsif ($_ =~ /bf/) { $t="#ifndef NO_BF\n${t}#endif\n"; }
|
elsif ($_ =~ /rc2/) { $t="#ifndef OPENSSL_NO_RC2\n${t}#endif\n"; }
|
||||||
elsif ($_ =~ /cast/) { $t="#ifndef NO_CAST\n${t}#endif\n"; }
|
elsif ($_ =~ /bf/) { $t="#ifndef OPENSSL_NO_BF\n${t}#endif\n"; }
|
||||||
elsif ($_ =~ /rc5/) { $t="#ifndef NO_RC5\n${t}#endif\n"; }
|
elsif ($_ =~ /cast/) { $t="#ifndef OPENSSL_NO_CAST\n${t}#endif\n"; }
|
||||||
|
elsif ($_ =~ /rc5/) { $t="#ifndef OPENSSL_NO_RC5\n${t}#endif\n"; }
|
||||||
print $t;
|
print $t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
81
apps/rand.c
81
apps/rand.c
@@ -1,4 +1,57 @@
|
|||||||
/* apps/rand.c */
|
/* apps/rand.c */
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
|
|
||||||
@@ -23,6 +76,7 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int i, r, ret = 1;
|
int i, r, ret = 1;
|
||||||
int badopt;
|
int badopt;
|
||||||
char *outfile = NULL;
|
char *outfile = NULL;
|
||||||
@@ -30,6 +84,7 @@ int MAIN(int argc, char **argv)
|
|||||||
int base64 = 0;
|
int base64 = 0;
|
||||||
BIO *out = NULL;
|
BIO *out = NULL;
|
||||||
int num = -1;
|
int num = -1;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -37,6 +92,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto err;
|
||||||
|
|
||||||
badopt = 0;
|
badopt = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
while (!badopt && argv[++i] != NULL)
|
while (!badopt && argv[++i] != NULL)
|
||||||
@@ -48,6 +106,13 @@ int MAIN(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[i], "-engine") == 0)
|
||||||
|
{
|
||||||
|
if ((argv[i+1] != NULL) && (engine == NULL))
|
||||||
|
engine = argv[++i];
|
||||||
|
else
|
||||||
|
badopt = 1;
|
||||||
|
}
|
||||||
else if (strcmp(argv[i], "-rand") == 0)
|
else if (strcmp(argv[i], "-rand") == 0)
|
||||||
{
|
{
|
||||||
if ((argv[i+1] != NULL) && (inrand == NULL))
|
if ((argv[i+1] != NULL) && (inrand == NULL))
|
||||||
@@ -62,7 +127,7 @@ int MAIN(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
badopt = 1;
|
badopt = 1;
|
||||||
}
|
}
|
||||||
else if (isdigit(argv[i][0]))
|
else if (isdigit((unsigned char)argv[i][0]))
|
||||||
{
|
{
|
||||||
if (num < 0)
|
if (num < 0)
|
||||||
{
|
{
|
||||||
@@ -85,11 +150,14 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf(bio_err, "Usage: rand [options] num\n");
|
BIO_printf(bio_err, "Usage: rand [options] num\n");
|
||||||
BIO_printf(bio_err, "where options are\n");
|
BIO_printf(bio_err, "where options are\n");
|
||||||
BIO_printf(bio_err, "-out file - write to file\n");
|
BIO_printf(bio_err, "-out file - write to file\n");
|
||||||
|
BIO_printf(bio_err, "-engine e - use engine e, possibly a hardware device.\n");
|
||||||
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err, "-rand file%cfile%c... - seed PRNG from files\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err, "-base64 - encode output\n");
|
BIO_printf(bio_err, "-base64 - encode output\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
app_RAND_load_file(NULL, bio_err, (inrand != NULL));
|
||||||
if (inrand != NULL)
|
if (inrand != NULL)
|
||||||
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
|
||||||
@@ -101,7 +169,15 @@ int MAIN(int argc, char **argv)
|
|||||||
if (outfile != NULL)
|
if (outfile != NULL)
|
||||||
r = BIO_write_filename(out, outfile);
|
r = BIO_write_filename(out, outfile);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
r = BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
r = BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
if (r <= 0)
|
if (r <= 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
@@ -136,5 +212,6 @@ err:
|
|||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (out)
|
if (out)
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
706
apps/req.c
706
apps/req.c
File diff suppressed because it is too large
Load Diff
147
apps/rsa.c
147
apps/rsa.c
@@ -56,7 +56,7 @@
|
|||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -79,6 +79,9 @@
|
|||||||
* -des - encrypt output if PEM format with DES in cbc mode
|
* -des - encrypt output if PEM format with DES in cbc mode
|
||||||
* -des3 - encrypt output if PEM format
|
* -des3 - encrypt output if PEM format
|
||||||
* -idea - encrypt output if PEM format
|
* -idea - encrypt output if PEM format
|
||||||
|
* -aes128 - encrypt output if PEM format
|
||||||
|
* -aes192 - encrypt output if PEM format
|
||||||
|
* -aes256 - encrypt output if PEM format
|
||||||
* -text - print a text version
|
* -text - print a text version
|
||||||
* -modulus - print the RSA key modulus
|
* -modulus - print the RSA key modulus
|
||||||
* -check - verify key consistency
|
* -check - verify key consistency
|
||||||
@@ -90,16 +93,18 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
RSA *rsa=NULL;
|
RSA *rsa=NULL;
|
||||||
int i,badops=0;
|
int i,badops=0, sgckey=0;
|
||||||
const EVP_CIPHER *enc=NULL;
|
const EVP_CIPHER *enc=NULL;
|
||||||
BIO *in=NULL,*out=NULL;
|
BIO *out=NULL;
|
||||||
int informat,outformat,text=0,check=0,noout=0;
|
int informat,outformat,text=0,check=0,noout=0;
|
||||||
int pubin = 0, pubout = 0;
|
int pubin = 0, pubout = 0;
|
||||||
char *infile,*outfile,*prog;
|
char *infile,*outfile,*prog;
|
||||||
char *passargin = NULL, *passargout = NULL;
|
char *passargin = NULL, *passargout = NULL;
|
||||||
char *passin = NULL, *passout = NULL;
|
char *passin = NULL, *passout = NULL;
|
||||||
|
char *engine=NULL;
|
||||||
int modulus=0;
|
int modulus=0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
@@ -108,6 +113,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
infile=NULL;
|
infile=NULL;
|
||||||
outfile=NULL;
|
outfile=NULL;
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
@@ -148,6 +156,13 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
passargout= *(++argv);
|
passargout= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-sgckey") == 0)
|
||||||
|
sgckey=1;
|
||||||
else if (strcmp(*argv,"-pubin") == 0)
|
else if (strcmp(*argv,"-pubin") == 0)
|
||||||
pubin=1;
|
pubin=1;
|
||||||
else if (strcmp(*argv,"-pubout") == 0)
|
else if (strcmp(*argv,"-pubout") == 0)
|
||||||
@@ -178,13 +193,18 @@ bad:
|
|||||||
BIO_printf(bio_err," -inform arg input format - one of DER NET PEM\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," -outform arg output format - one of DER NET PEM\n");
|
||||||
BIO_printf(bio_err," -in arg input file\n");
|
BIO_printf(bio_err," -in arg input file\n");
|
||||||
|
BIO_printf(bio_err," -sgckey Use IIS SGC key format\n");
|
||||||
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
BIO_printf(bio_err," -passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err," -out arg output file\n");
|
BIO_printf(bio_err," -out arg output file\n");
|
||||||
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
BIO_printf(bio_err," -passout arg output file pass phrase source\n");
|
||||||
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
|
||||||
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_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
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
|
||||||
|
BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err," -text print the key in text\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," -noout don't print key out\n");
|
||||||
@@ -192,11 +212,14 @@ bad:
|
|||||||
BIO_printf(bio_err," -check verify key consistency\n");
|
BIO_printf(bio_err," -check verify key consistency\n");
|
||||||
BIO_printf(bio_err," -pubin expect a public key in input file\n");
|
BIO_printf(bio_err," -pubin expect a public key in input file\n");
|
||||||
BIO_printf(bio_err," -pubout output a public key\n");
|
BIO_printf(bio_err," -pubout output a public key\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||||
BIO_printf(bio_err, "Error getting passwords\n");
|
BIO_printf(bio_err, "Error getting passwords\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -207,75 +230,43 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
|
||||||
out=BIO_new(BIO_s_file());
|
out=BIO_new(BIO_s_file());
|
||||||
if ((in == NULL) || (out == NULL))
|
|
||||||
{
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (infile == NULL)
|
{
|
||||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
EVP_PKEY *pkey;
|
||||||
|
|
||||||
|
if (pubin)
|
||||||
|
pkey = load_pubkey(bio_err, infile,
|
||||||
|
(informat == FORMAT_NETSCAPE && sgckey ?
|
||||||
|
FORMAT_IISSGC : informat), 1,
|
||||||
|
passin, e, "Public Key");
|
||||||
else
|
else
|
||||||
{
|
pkey = load_key(bio_err, infile,
|
||||||
if (BIO_read_filename(in,infile) <= 0)
|
(informat == FORMAT_NETSCAPE && sgckey ?
|
||||||
{
|
FORMAT_IISSGC : informat), 1,
|
||||||
perror(infile);
|
passin, e, "Private Key");
|
||||||
goto end;
|
|
||||||
}
|
if (pkey != NULL)
|
||||||
|
rsa = pkey == NULL ? NULL : EVP_PKEY_get1_RSA(pkey);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err,"read RSA key\n");
|
|
||||||
if (informat == FORMAT_ASN1) {
|
|
||||||
if (pubin) rsa=d2i_RSA_PUBKEY_bio(in,NULL);
|
|
||||||
else rsa=d2i_RSAPrivateKey_bio(in,NULL);
|
|
||||||
}
|
|
||||||
#ifndef NO_RC4
|
|
||||||
else if (informat == FORMAT_NETSCAPE)
|
|
||||||
{
|
|
||||||
BUF_MEM *buf=NULL;
|
|
||||||
unsigned char *p;
|
|
||||||
int size=0;
|
|
||||||
|
|
||||||
buf=BUF_MEM_new();
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
if ((buf == NULL) || (!BUF_MEM_grow(buf,size+1024*10)))
|
|
||||||
goto end;
|
|
||||||
i=BIO_read(in,&(buf->data[size]),1024*10);
|
|
||||||
size+=i;
|
|
||||||
if (i == 0) break;
|
|
||||||
if (i < 0)
|
|
||||||
{
|
|
||||||
perror("reading private key");
|
|
||||||
BUF_MEM_free(buf);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p=(unsigned char *)buf->data;
|
|
||||||
rsa=d2i_Netscape_RSA(NULL,&p,(long)size,NULL);
|
|
||||||
BUF_MEM_free(buf);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (informat == FORMAT_PEM) {
|
|
||||||
if(pubin) rsa=PEM_read_bio_RSA_PUBKEY(in,NULL,NULL,NULL);
|
|
||||||
else rsa=PEM_read_bio_RSAPrivateKey(in,NULL, NULL,passin);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"bad input format specified for key\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (rsa == NULL)
|
if (rsa == NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unable to load key\n");
|
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -308,14 +299,14 @@ bad:
|
|||||||
BIO_printf(out,"RSA key ok\n");
|
BIO_printf(out,"RSA key ok\n");
|
||||||
else if (r == 0)
|
else if (r == 0)
|
||||||
{
|
{
|
||||||
long e;
|
long err;
|
||||||
|
|
||||||
while ((e = ERR_peek_error()) != 0 &&
|
while ((err = ERR_peek_error()) != 0 &&
|
||||||
ERR_GET_LIB(e) == ERR_LIB_RSA &&
|
ERR_GET_LIB(err) == ERR_LIB_RSA &&
|
||||||
ERR_GET_FUNC(e) == RSA_F_RSA_CHECK_KEY &&
|
ERR_GET_FUNC(err) == RSA_F_RSA_CHECK_KEY &&
|
||||||
ERR_GET_REASON(e) != ERR_R_MALLOC_FAILURE)
|
ERR_GET_REASON(err) != ERR_R_MALLOC_FAILURE)
|
||||||
{
|
{
|
||||||
BIO_printf(out, "RSA key error: %s\n", ERR_reason_error_string(e));
|
BIO_printf(out, "RSA key error: %s\n", ERR_reason_error_string(err));
|
||||||
ERR_get_error(); /* remove e from error stack */
|
ERR_get_error(); /* remove e from error stack */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -337,23 +328,23 @@ bad:
|
|||||||
if(pubout || pubin) i=i2d_RSA_PUBKEY_bio(out,rsa);
|
if(pubout || pubin) i=i2d_RSA_PUBKEY_bio(out,rsa);
|
||||||
else i=i2d_RSAPrivateKey_bio(out,rsa);
|
else i=i2d_RSAPrivateKey_bio(out,rsa);
|
||||||
}
|
}
|
||||||
#ifndef NO_RC4
|
#ifndef OPENSSL_NO_RC4
|
||||||
else if (outformat == FORMAT_NETSCAPE)
|
else if (outformat == FORMAT_NETSCAPE)
|
||||||
{
|
{
|
||||||
unsigned char *p,*pp;
|
unsigned char *p,*pp;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
i=1;
|
i=1;
|
||||||
size=i2d_Netscape_RSA(rsa,NULL,NULL);
|
size=i2d_RSA_NET(rsa,NULL,NULL, sgckey);
|
||||||
if ((p=(unsigned char *)Malloc(size)) == NULL)
|
if ((p=(unsigned char *)OPENSSL_malloc(size)) == NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"Malloc failure\n");
|
BIO_printf(bio_err,"Memory allocation failure\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
pp=p;
|
pp=p;
|
||||||
i2d_Netscape_RSA(rsa,&p,NULL);
|
i2d_RSA_NET(rsa,&p,NULL, sgckey);
|
||||||
BIO_write(out,(char *)pp,size);
|
BIO_write(out,(char *)pp,size);
|
||||||
Free(pp);
|
OPENSSL_free(pp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (outformat == FORMAT_PEM) {
|
else if (outformat == FORMAT_PEM) {
|
||||||
@@ -373,14 +364,14 @@ bad:
|
|||||||
else
|
else
|
||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if(in != NULL) BIO_free(in);
|
if(out != NULL) BIO_free_all(out);
|
||||||
if(out != NULL) BIO_free(out);
|
|
||||||
if(rsa != NULL) RSA_free(rsa);
|
if(rsa != NULL) RSA_free(rsa);
|
||||||
if(passin) Free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
if(passout) Free(passout);
|
if(passout) OPENSSL_free(passout);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
#else /* !NO_RSA */
|
#else /* !OPENSSL_NO_RSA */
|
||||||
|
|
||||||
# if PEDANTIC
|
# if PEDANTIC
|
||||||
static void *dummy=&dummy;
|
static void *dummy=&dummy;
|
||||||
|
|||||||
312
apps/rsautl.c
Normal file
312
apps/rsautl.c
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
/* rsautl.c */
|
||||||
|
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
||||||
|
* project 2000.
|
||||||
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 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
|
||||||
|
* 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).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_RSA
|
||||||
|
|
||||||
|
#include "apps.h"
|
||||||
|
#include <string.h>
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
|
#define RSA_SIGN 1
|
||||||
|
#define RSA_VERIFY 2
|
||||||
|
#define RSA_ENCRYPT 3
|
||||||
|
#define RSA_DECRYPT 4
|
||||||
|
|
||||||
|
#define KEY_PRIVKEY 1
|
||||||
|
#define KEY_PUBKEY 2
|
||||||
|
#define KEY_CERT 3
|
||||||
|
|
||||||
|
static void usage(void);
|
||||||
|
|
||||||
|
#undef PROG
|
||||||
|
|
||||||
|
#define PROG rsautl_main
|
||||||
|
|
||||||
|
int MAIN(int argc, char **);
|
||||||
|
|
||||||
|
int MAIN(int argc, char **argv)
|
||||||
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
|
BIO *in = NULL, *out = NULL;
|
||||||
|
char *infile = NULL, *outfile = NULL;
|
||||||
|
char *engine = NULL;
|
||||||
|
char *keyfile = NULL;
|
||||||
|
char rsa_mode = RSA_VERIFY, key_type = KEY_PRIVKEY;
|
||||||
|
int keyform = FORMAT_PEM;
|
||||||
|
char need_priv = 0, badarg = 0, rev = 0;
|
||||||
|
char hexdump = 0, asn1parse = 0;
|
||||||
|
X509 *x;
|
||||||
|
EVP_PKEY *pkey = NULL;
|
||||||
|
RSA *rsa = NULL;
|
||||||
|
unsigned char *rsa_in = NULL, *rsa_out = NULL, pad;
|
||||||
|
int rsa_inlen, rsa_outlen = 0;
|
||||||
|
int keysize;
|
||||||
|
|
||||||
|
int ret = 1;
|
||||||
|
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
|
||||||
|
if(!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
ERR_load_crypto_strings();
|
||||||
|
OpenSSL_add_all_algorithms();
|
||||||
|
pad = RSA_PKCS1_PADDING;
|
||||||
|
|
||||||
|
while(argc >= 1)
|
||||||
|
{
|
||||||
|
if (!strcmp(*argv,"-in")) {
|
||||||
|
if (--argc < 1) badarg = 1;
|
||||||
|
infile= *(++argv);
|
||||||
|
} else if (!strcmp(*argv,"-out")) {
|
||||||
|
if (--argc < 1) badarg = 1;
|
||||||
|
outfile= *(++argv);
|
||||||
|
} else if(!strcmp(*argv, "-inkey")) {
|
||||||
|
if (--argc < 1) badarg = 1;
|
||||||
|
keyfile = *(++argv);
|
||||||
|
} else if (strcmp(*argv,"-keyform") == 0) {
|
||||||
|
if (--argc < 1) badarg = 1;
|
||||||
|
keyform=str2fmt(*(++argv));
|
||||||
|
} else if(!strcmp(*argv, "-engine")) {
|
||||||
|
if (--argc < 1) badarg = 1;
|
||||||
|
engine = *(++argv);
|
||||||
|
} else if(!strcmp(*argv, "-pubin")) {
|
||||||
|
key_type = KEY_PUBKEY;
|
||||||
|
} else if(!strcmp(*argv, "-certin")) {
|
||||||
|
key_type = KEY_CERT;
|
||||||
|
}
|
||||||
|
else if(!strcmp(*argv, "-asn1parse")) asn1parse = 1;
|
||||||
|
else if(!strcmp(*argv, "-hexdump")) hexdump = 1;
|
||||||
|
else if(!strcmp(*argv, "-raw")) pad = RSA_NO_PADDING;
|
||||||
|
else if(!strcmp(*argv, "-oaep")) pad = RSA_PKCS1_OAEP_PADDING;
|
||||||
|
else if(!strcmp(*argv, "-ssl")) pad = RSA_SSLV23_PADDING;
|
||||||
|
else if(!strcmp(*argv, "-pkcs")) pad = RSA_PKCS1_PADDING;
|
||||||
|
else if(!strcmp(*argv, "-sign")) {
|
||||||
|
rsa_mode = RSA_SIGN;
|
||||||
|
need_priv = 1;
|
||||||
|
} else if(!strcmp(*argv, "-verify")) rsa_mode = RSA_VERIFY;
|
||||||
|
else if(!strcmp(*argv, "-rev")) rev = 1;
|
||||||
|
else if(!strcmp(*argv, "-encrypt")) rsa_mode = RSA_ENCRYPT;
|
||||||
|
else if(!strcmp(*argv, "-decrypt")) {
|
||||||
|
rsa_mode = RSA_DECRYPT;
|
||||||
|
need_priv = 1;
|
||||||
|
} else badarg = 1;
|
||||||
|
if(badarg) {
|
||||||
|
usage();
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(need_priv && (key_type != KEY_PRIVKEY)) {
|
||||||
|
BIO_printf(bio_err, "A private key is needed for this operation\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
|
/* FIXME: seed PRNG only if needed */
|
||||||
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
|
|
||||||
|
switch(key_type) {
|
||||||
|
case KEY_PRIVKEY:
|
||||||
|
pkey = load_key(bio_err, keyfile, keyform, 0,
|
||||||
|
NULL, e, "Private Key");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KEY_PUBKEY:
|
||||||
|
pkey = load_pubkey(bio_err, keyfile, keyform, 0,
|
||||||
|
NULL, e, "Public Key");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KEY_CERT:
|
||||||
|
x = load_cert(bio_err, keyfile, keyform,
|
||||||
|
NULL, e, "Certificate");
|
||||||
|
if(x) {
|
||||||
|
pkey = X509_get_pubkey(x);
|
||||||
|
X509_free(x);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!pkey) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
rsa = EVP_PKEY_get1_RSA(pkey);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
|
||||||
|
if(!rsa) {
|
||||||
|
BIO_printf(bio_err, "Error getting RSA key\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(infile) {
|
||||||
|
if(!(in = BIO_new_file(infile, "rb"))) {
|
||||||
|
BIO_printf(bio_err, "Error Reading Input File\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
} else in = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if(outfile) {
|
||||||
|
if(!(out = BIO_new_file(outfile, "wb"))) {
|
||||||
|
BIO_printf(bio_err, "Error Reading Output File\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
keysize = RSA_size(rsa);
|
||||||
|
|
||||||
|
rsa_in = OPENSSL_malloc(keysize * 2);
|
||||||
|
rsa_out = OPENSSL_malloc(keysize);
|
||||||
|
|
||||||
|
/* Read the input data */
|
||||||
|
rsa_inlen = BIO_read(in, rsa_in, keysize * 2);
|
||||||
|
if(rsa_inlen <= 0) {
|
||||||
|
BIO_printf(bio_err, "Error reading input Data\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if(rev) {
|
||||||
|
int i;
|
||||||
|
unsigned char ctmp;
|
||||||
|
for(i = 0; i < rsa_inlen/2; i++) {
|
||||||
|
ctmp = rsa_in[i];
|
||||||
|
rsa_in[i] = rsa_in[rsa_inlen - 1 - i];
|
||||||
|
rsa_in[rsa_inlen - 1 - i] = ctmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch(rsa_mode) {
|
||||||
|
|
||||||
|
case RSA_VERIFY:
|
||||||
|
rsa_outlen = RSA_public_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSA_SIGN:
|
||||||
|
rsa_outlen = RSA_private_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSA_ENCRYPT:
|
||||||
|
rsa_outlen = RSA_public_encrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSA_DECRYPT:
|
||||||
|
rsa_outlen = RSA_private_decrypt(rsa_inlen, rsa_in, rsa_out, rsa, pad);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(rsa_outlen <= 0) {
|
||||||
|
BIO_printf(bio_err, "RSA operation error\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
ret = 0;
|
||||||
|
if(asn1parse) {
|
||||||
|
if(!ASN1_parse_dump(out, rsa_out, rsa_outlen, 1, -1)) {
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
} else if(hexdump) BIO_dump(out, (char *)rsa_out, rsa_outlen);
|
||||||
|
else BIO_write(out, rsa_out, rsa_outlen);
|
||||||
|
end:
|
||||||
|
RSA_free(rsa);
|
||||||
|
BIO_free(in);
|
||||||
|
BIO_free_all(out);
|
||||||
|
if(rsa_in) OPENSSL_free(rsa_in);
|
||||||
|
if(rsa_out) OPENSSL_free(rsa_out);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void usage()
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "Usage: rsautl [options]\n");
|
||||||
|
BIO_printf(bio_err, "-in file input file\n");
|
||||||
|
BIO_printf(bio_err, "-out file output file\n");
|
||||||
|
BIO_printf(bio_err, "-inkey file input key\n");
|
||||||
|
BIO_printf(bio_err, "-keyform arg private key format - default PEM\n");
|
||||||
|
BIO_printf(bio_err, "-pubin input is an RSA public\n");
|
||||||
|
BIO_printf(bio_err, "-certin input is a certificate carrying an RSA public key\n");
|
||||||
|
BIO_printf(bio_err, "-ssl use SSL v2 padding\n");
|
||||||
|
BIO_printf(bio_err, "-raw use no padding\n");
|
||||||
|
BIO_printf(bio_err, "-pkcs use PKCS#1 v1.5 padding (default)\n");
|
||||||
|
BIO_printf(bio_err, "-oaep use PKCS#1 OAEP\n");
|
||||||
|
BIO_printf(bio_err, "-sign sign with private key\n");
|
||||||
|
BIO_printf(bio_err, "-verify verify with public key\n");
|
||||||
|
BIO_printf(bio_err, "-encrypt encrypt with public key\n");
|
||||||
|
BIO_printf(bio_err, "-decrypt decrypt with private key\n");
|
||||||
|
BIO_printf(bio_err, "-hexdump hex dump output\n");
|
||||||
|
BIO_printf(bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -55,9 +55,64 @@
|
|||||||
* copied and put under another distribution licence
|
* copied and put under another distribution licence
|
||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if (defined(VMS) || defined(__VMS)) && !defined(FD_SET)
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
|
#if defined(OPENSSL_SYS_VMS) && !defined(FD_SET)
|
||||||
/* VAX C does not defined fd_set and friends, but it's actually quite simple */
|
/* VAX C does not defined fd_set and friends, but it's actually quite simple */
|
||||||
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
|
/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
|
||||||
#define MAX_NOFILE 32
|
#define MAX_NOFILE 32
|
||||||
@@ -87,13 +142,9 @@ typedef fd_mask fd_set;
|
|||||||
int do_server(int port, int *ret, int (*cb) (), char *context);
|
int do_server(int port, int *ret, int (*cb) (), char *context);
|
||||||
#ifdef HEADER_X509_H
|
#ifdef HEADER_X509_H
|
||||||
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
|
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
|
||||||
#else
|
|
||||||
int MS_CALLBACK verify_callback(int ok, char *ctx);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HEADER_SSL_H
|
#ifdef HEADER_SSL_H
|
||||||
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
|
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
|
||||||
#else
|
|
||||||
int set_cert_stuff(char *ctx, char *cert_file, char *key_file);
|
|
||||||
#endif
|
#endif
|
||||||
int init_client(int *sock, char *server, int port);
|
int init_client(int *sock, char *server, int port);
|
||||||
int should_retry(int i);
|
int should_retry(int i);
|
||||||
@@ -104,8 +155,6 @@ long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp,
|
|||||||
int argi, long argl, long ret);
|
int argi, long argl, long ret);
|
||||||
|
|
||||||
#ifdef HEADER_SSL_H
|
#ifdef HEADER_SSL_H
|
||||||
void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret);
|
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret);
|
||||||
#else
|
void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
|
||||||
void MS_CALLBACK apps_ssl_info_callback(char *s, int where, int ret);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
317
apps/s_cb.c
317
apps/s_cb.c
@@ -55,6 +55,59 @@
|
|||||||
* copied and put under another distribution licence
|
* copied and put under another distribution licence
|
||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -81,7 +134,7 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
|
|||||||
err= X509_STORE_CTX_get_error(ctx);
|
err= X509_STORE_CTX_get_error(ctx);
|
||||||
depth= X509_STORE_CTX_get_error_depth(ctx);
|
depth= X509_STORE_CTX_get_error_depth(ctx);
|
||||||
|
|
||||||
X509_NAME_oneline(X509_get_subject_name(err_cert),buf,256);
|
X509_NAME_oneline(X509_get_subject_name(err_cert),buf,sizeof buf);
|
||||||
BIO_printf(bio_err,"depth=%d %s\n",depth,buf);
|
BIO_printf(bio_err,"depth=%d %s\n",depth,buf);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
@@ -101,7 +154,7 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
|
|||||||
switch (ctx->error)
|
switch (ctx->error)
|
||||||
{
|
{
|
||||||
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
|
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
|
||||||
X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert),buf,256);
|
X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert),buf,sizeof buf);
|
||||||
BIO_printf(bio_err,"issuer= %s\n",buf);
|
BIO_printf(bio_err,"issuer= %s\n",buf);
|
||||||
break;
|
break;
|
||||||
case X509_V_ERR_CERT_NOT_YET_VALID:
|
case X509_V_ERR_CERT_NOT_YET_VALID:
|
||||||
@@ -200,7 +253,7 @@ long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi,
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret)
|
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret)
|
||||||
{
|
{
|
||||||
char *str;
|
char *str;
|
||||||
int w;
|
int w;
|
||||||
@@ -236,3 +289,261 @@ void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)
|
||||||
|
{
|
||||||
|
BIO *bio = arg;
|
||||||
|
const char *str_write_p, *str_version, *str_content_type = "", *str_details1 = "", *str_details2= "";
|
||||||
|
|
||||||
|
str_write_p = write_p ? ">>>" : "<<<";
|
||||||
|
|
||||||
|
switch (version)
|
||||||
|
{
|
||||||
|
case SSL2_VERSION:
|
||||||
|
str_version = "SSL 2.0";
|
||||||
|
break;
|
||||||
|
case SSL3_VERSION:
|
||||||
|
str_version = "SSL 3.0 ";
|
||||||
|
break;
|
||||||
|
case TLS1_VERSION:
|
||||||
|
str_version = "TLS 1.0 ";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
str_version = "???";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version == SSL2_VERSION)
|
||||||
|
{
|
||||||
|
str_details1 = "???";
|
||||||
|
|
||||||
|
if (len > 0)
|
||||||
|
{
|
||||||
|
switch (((unsigned char*)buf)[0])
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
str_details1 = ", ERROR:";
|
||||||
|
str_details2 = " ???";
|
||||||
|
if (len >= 3)
|
||||||
|
{
|
||||||
|
unsigned err = (((unsigned char*)buf)[1]<<8) + ((unsigned char*)buf)[2];
|
||||||
|
|
||||||
|
switch (err)
|
||||||
|
{
|
||||||
|
case 0x0001:
|
||||||
|
str_details2 = " NO-CIPHER-ERROR";
|
||||||
|
break;
|
||||||
|
case 0x0002:
|
||||||
|
str_details2 = " NO-CERTIFICATE-ERROR";
|
||||||
|
break;
|
||||||
|
case 0x0004:
|
||||||
|
str_details2 = " BAD-CERTIFICATE-ERROR";
|
||||||
|
break;
|
||||||
|
case 0x0006:
|
||||||
|
str_details2 = " UNSUPPORTED-CERTIFICATE-TYPE-ERROR";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
str_details1 = ", CLIENT-HELLO";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
str_details1 = ", CLIENT-MASTER-KEY";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
str_details1 = ", CLIENT-FINISHED";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
str_details1 = ", SERVER-HELLO";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
str_details1 = ", SERVER-VERIFY";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
str_details1 = ", SERVER-FINISHED";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
str_details1 = ", REQUEST-CERTIFICATE";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
str_details1 = ", CLIENT-CERTIFICATE";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version == SSL3_VERSION || version == TLS1_VERSION)
|
||||||
|
{
|
||||||
|
switch (content_type)
|
||||||
|
{
|
||||||
|
case 20:
|
||||||
|
str_content_type = "ChangeCipherSpec";
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
str_content_type = "Alert";
|
||||||
|
break;
|
||||||
|
case 22:
|
||||||
|
str_content_type = "Handshake";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (content_type == 21) /* Alert */
|
||||||
|
{
|
||||||
|
str_details1 = ", ???";
|
||||||
|
|
||||||
|
if (len == 2)
|
||||||
|
{
|
||||||
|
switch (((unsigned char*)buf)[0])
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
str_details1 = ", warning";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
str_details1 = ", fatal";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
str_details2 = " ???";
|
||||||
|
switch (((unsigned char*)buf)[1])
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
str_details2 = " close_notify";
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
str_details2 = " unexpected_message";
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
str_details2 = " bad_record_mac";
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
str_details2 = " decryption_failed";
|
||||||
|
break;
|
||||||
|
case 22:
|
||||||
|
str_details2 = " record_overflow";
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
|
str_details2 = " decompression_failure";
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
str_details2 = " handshake_failure";
|
||||||
|
break;
|
||||||
|
case 42:
|
||||||
|
str_details2 = " bad_certificate";
|
||||||
|
break;
|
||||||
|
case 43:
|
||||||
|
str_details2 = " unsupported_certificate";
|
||||||
|
break;
|
||||||
|
case 44:
|
||||||
|
str_details2 = " certificate_revoked";
|
||||||
|
break;
|
||||||
|
case 45:
|
||||||
|
str_details2 = " certificate_expired";
|
||||||
|
break;
|
||||||
|
case 46:
|
||||||
|
str_details2 = " certificate_unknown";
|
||||||
|
break;
|
||||||
|
case 47:
|
||||||
|
str_details2 = " illegal_parameter";
|
||||||
|
break;
|
||||||
|
case 48:
|
||||||
|
str_details2 = " unknown_ca";
|
||||||
|
break;
|
||||||
|
case 49:
|
||||||
|
str_details2 = " access_denied";
|
||||||
|
break;
|
||||||
|
case 50:
|
||||||
|
str_details2 = " decode_error";
|
||||||
|
break;
|
||||||
|
case 51:
|
||||||
|
str_details2 = " decrypt_error";
|
||||||
|
break;
|
||||||
|
case 60:
|
||||||
|
str_details2 = " export_restriction";
|
||||||
|
break;
|
||||||
|
case 70:
|
||||||
|
str_details2 = " protocol_version";
|
||||||
|
break;
|
||||||
|
case 71:
|
||||||
|
str_details2 = " insufficient_security";
|
||||||
|
break;
|
||||||
|
case 80:
|
||||||
|
str_details2 = " internal_error";
|
||||||
|
break;
|
||||||
|
case 90:
|
||||||
|
str_details2 = " user_canceled";
|
||||||
|
break;
|
||||||
|
case 100:
|
||||||
|
str_details2 = " no_renegotiation";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (content_type == 22) /* Handshake */
|
||||||
|
{
|
||||||
|
str_details1 = "???";
|
||||||
|
|
||||||
|
if (len > 0)
|
||||||
|
{
|
||||||
|
switch (((unsigned char*)buf)[0])
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
str_details1 = ", HelloRequest";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
str_details1 = ", ClientHello";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
str_details1 = ", ServerHello";
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
str_details1 = ", Certificate";
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
str_details1 = ", ServerKeyExchange";
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
str_details1 = ", CertificateRequest";
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
str_details1 = ", ServerHelloDone";
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
str_details1 = ", CertificateVerify";
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
str_details1 = ", ClientKeyExchange";
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
str_details1 = ", Finished";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BIO_printf(bio, "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version, str_content_type, (unsigned long)len, str_details1, str_details2);
|
||||||
|
|
||||||
|
if (len > 0)
|
||||||
|
{
|
||||||
|
size_t num, i;
|
||||||
|
|
||||||
|
BIO_printf(bio, " ");
|
||||||
|
num = len;
|
||||||
|
#if 0
|
||||||
|
if (num > 16)
|
||||||
|
num = 16;
|
||||||
|
#endif
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
if (i % 16 == 0 && i > 0)
|
||||||
|
BIO_printf(bio, "\n ");
|
||||||
|
BIO_printf(bio, " %02x", ((unsigned char*)buf)[i]);
|
||||||
|
}
|
||||||
|
if (i < len)
|
||||||
|
BIO_printf(bio, " ...");
|
||||||
|
BIO_printf(bio, "\n");
|
||||||
|
}
|
||||||
|
BIO_flush(bio);
|
||||||
|
}
|
||||||
|
|||||||
223
apps/s_client.c
223
apps/s_client.c
@@ -55,12 +55,66 @@
|
|||||||
* copied and put under another distribution licence
|
* copied and put under another distribution licence
|
||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef NO_STDIO
|
#include <openssl/e_os2.h>
|
||||||
|
#ifdef OPENSSL_NO_STDIO
|
||||||
#define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -68,7 +122,7 @@
|
|||||||
recursive header file inclusion, resulting in the compiler complaining
|
recursive header file inclusion, resulting in the compiler complaining
|
||||||
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
||||||
is needed to have fileno() declared correctly... So let's define u_int */
|
is needed to have fileno() declared correctly... So let's define u_int */
|
||||||
#if defined(VMS) && defined(__DECC) && !defined(__U_INT)
|
#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__U_INT)
|
||||||
#define __U_INT
|
#define __U_INT
|
||||||
typedef unsigned int u_int;
|
typedef unsigned int u_int;
|
||||||
#endif
|
#endif
|
||||||
@@ -79,14 +133,23 @@ typedef unsigned int u_int;
|
|||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
#include <openssl/rand.h>
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef OPENSSL_SYS_WINCE
|
||||||
|
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
||||||
|
#ifdef fileno
|
||||||
|
#undef fileno
|
||||||
|
#endif
|
||||||
|
#define fileno(a) (int)_fileno(a)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (defined(VMS) && __VMS_VER < 70000000)
|
|
||||||
|
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
|
||||||
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
||||||
#undef FIONBIO
|
#undef FIONBIO
|
||||||
#endif
|
#endif
|
||||||
@@ -111,6 +174,7 @@ static int c_nbio=0;
|
|||||||
#endif
|
#endif
|
||||||
static int c_Pause=0;
|
static int c_Pause=0;
|
||||||
static int c_debug=0;
|
static int c_debug=0;
|
||||||
|
static int c_msg=0;
|
||||||
static int c_showcerts=0;
|
static int c_showcerts=0;
|
||||||
|
|
||||||
static void sc_usage(void);
|
static void sc_usage(void);
|
||||||
@@ -137,6 +201,7 @@ static void sc_usage(void)
|
|||||||
BIO_printf(bio_err," -pause - sleep(1) after each read(2) and write(2) system call\n");
|
BIO_printf(bio_err," -pause - sleep(1) after each read(2) and write(2) system call\n");
|
||||||
BIO_printf(bio_err," -showcerts - show all certificates in the chain\n");
|
BIO_printf(bio_err," -showcerts - show all certificates in the chain\n");
|
||||||
BIO_printf(bio_err," -debug - extra output\n");
|
BIO_printf(bio_err," -debug - extra output\n");
|
||||||
|
BIO_printf(bio_err," -msg - Show protocol messages\n");
|
||||||
BIO_printf(bio_err," -nbio_test - more ssl protocol testing\n");
|
BIO_printf(bio_err," -nbio_test - more ssl protocol testing\n");
|
||||||
BIO_printf(bio_err," -state - print the 'ssl' states\n");
|
BIO_printf(bio_err," -state - print the 'ssl' states\n");
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
@@ -150,8 +215,15 @@ static void sc_usage(void)
|
|||||||
BIO_printf(bio_err," -tls1 - just use TLSv1\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," -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," -bugs - Switch on all SSL implementation bug workarounds\n");
|
||||||
|
BIO_printf(bio_err," -serverpref - Use server's cipher preferences (only SSLv2)\n");
|
||||||
BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n");
|
BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n");
|
||||||
BIO_printf(bio_err," command to see what is available\n");
|
BIO_printf(bio_err," command to see what is available\n");
|
||||||
|
BIO_printf(bio_err," -starttls prot - use the STARTTLS command before starting TLS\n");
|
||||||
|
BIO_printf(bio_err," for those protocols that support it, where\n");
|
||||||
|
BIO_printf(bio_err," 'prot' defines which one to assume. Currently,\n");
|
||||||
|
BIO_printf(bio_err," only \"smtp\" is supported.\n");
|
||||||
|
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
||||||
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,8 +233,9 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int off=0;
|
int off=0;
|
||||||
SSL *con=NULL,*con2=NULL;
|
SSL *con=NULL,*con2=NULL;
|
||||||
|
X509_STORE *store = NULL;
|
||||||
int s,k,width,state=0;
|
int s,k,width,state=0;
|
||||||
char *cbuf=NULL,*sbuf=NULL;
|
char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL;
|
||||||
int cbuf_len,cbuf_off;
|
int cbuf_len,cbuf_off;
|
||||||
int sbuf_len,sbuf_off;
|
int sbuf_len,sbuf_off;
|
||||||
fd_set readfds,writefds;
|
fd_set readfds,writefds;
|
||||||
@@ -176,18 +249,22 @@ int MAIN(int argc, char **argv)
|
|||||||
int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
|
int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
|
||||||
SSL_CTX *ctx=NULL;
|
SSL_CTX *ctx=NULL;
|
||||||
int ret=1,in_init=1,i,nbio_test=0;
|
int ret=1,in_init=1,i,nbio_test=0;
|
||||||
int prexit = 0;
|
int smtp_starttls = 0;
|
||||||
|
int prexit = 0, vflags = 0;
|
||||||
SSL_METHOD *meth=NULL;
|
SSL_METHOD *meth=NULL;
|
||||||
BIO *sbio;
|
BIO *sbio;
|
||||||
#ifdef WINDOWS
|
char *inrand=NULL;
|
||||||
|
char *engine_id=NULL;
|
||||||
|
ENGINE *e=NULL;
|
||||||
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_SSL2) && !defined(NO_SSL3)
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
meth=SSLv23_client_method();
|
meth=SSLv23_client_method();
|
||||||
#elif !defined(NO_SSL3)
|
#elif !defined(OPENSSL_NO_SSL3)
|
||||||
meth=SSLv3_client_method();
|
meth=SSLv3_client_method();
|
||||||
#elif !defined(NO_SSL2)
|
#elif !defined(OPENSSL_NO_SSL2)
|
||||||
meth=SSLv2_client_method();
|
meth=SSLv2_client_method();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -196,13 +273,18 @@ int MAIN(int argc, char **argv)
|
|||||||
c_quiet=0;
|
c_quiet=0;
|
||||||
c_ign_eof=0;
|
c_ign_eof=0;
|
||||||
c_debug=0;
|
c_debug=0;
|
||||||
|
c_msg=0;
|
||||||
c_showcerts=0;
|
c_showcerts=0;
|
||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
|
|
||||||
if ( ((cbuf=Malloc(BUFSIZZ)) == NULL) ||
|
if (!load_config(bio_err, NULL))
|
||||||
((sbuf=Malloc(BUFSIZZ)) == NULL))
|
goto end;
|
||||||
|
|
||||||
|
if ( ((cbuf=OPENSSL_malloc(BUFSIZZ)) == NULL) ||
|
||||||
|
((sbuf=OPENSSL_malloc(BUFSIZZ)) == NULL) ||
|
||||||
|
((mbuf=OPENSSL_malloc(BUFSIZZ)) == NULL))
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"out of memory\n");
|
BIO_printf(bio_err,"out of memory\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -247,6 +329,10 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
cert_file= *(++argv);
|
cert_file= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-crl_check") == 0)
|
||||||
|
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||||
|
else if (strcmp(*argv,"-crl_check_all") == 0)
|
||||||
|
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||||
else if (strcmp(*argv,"-prexit") == 0)
|
else if (strcmp(*argv,"-prexit") == 0)
|
||||||
prexit=1;
|
prexit=1;
|
||||||
else if (strcmp(*argv,"-crlf") == 0)
|
else if (strcmp(*argv,"-crlf") == 0)
|
||||||
@@ -262,21 +348,23 @@ int MAIN(int argc, char **argv)
|
|||||||
c_Pause=1;
|
c_Pause=1;
|
||||||
else if (strcmp(*argv,"-debug") == 0)
|
else if (strcmp(*argv,"-debug") == 0)
|
||||||
c_debug=1;
|
c_debug=1;
|
||||||
|
else if (strcmp(*argv,"-msg") == 0)
|
||||||
|
c_msg=1;
|
||||||
else if (strcmp(*argv,"-showcerts") == 0)
|
else if (strcmp(*argv,"-showcerts") == 0)
|
||||||
c_showcerts=1;
|
c_showcerts=1;
|
||||||
else if (strcmp(*argv,"-nbio_test") == 0)
|
else if (strcmp(*argv,"-nbio_test") == 0)
|
||||||
nbio_test=1;
|
nbio_test=1;
|
||||||
else if (strcmp(*argv,"-state") == 0)
|
else if (strcmp(*argv,"-state") == 0)
|
||||||
state=1;
|
state=1;
|
||||||
#ifndef NO_SSL2
|
#ifndef OPENSSL_NO_SSL2
|
||||||
else if (strcmp(*argv,"-ssl2") == 0)
|
else if (strcmp(*argv,"-ssl2") == 0)
|
||||||
meth=SSLv2_client_method();
|
meth=SSLv2_client_method();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SSL3
|
#ifndef OPENSSL_NO_SSL3
|
||||||
else if (strcmp(*argv,"-ssl3") == 0)
|
else if (strcmp(*argv,"-ssl3") == 0)
|
||||||
meth=SSLv3_client_method();
|
meth=SSLv3_client_method();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_TLS1
|
#ifndef OPENSSL_NO_TLS1
|
||||||
else if (strcmp(*argv,"-tls1") == 0)
|
else if (strcmp(*argv,"-tls1") == 0)
|
||||||
meth=TLSv1_client_method();
|
meth=TLSv1_client_method();
|
||||||
#endif
|
#endif
|
||||||
@@ -307,6 +395,8 @@ int MAIN(int argc, char **argv)
|
|||||||
off|=SSL_OP_NO_SSLv3;
|
off|=SSL_OP_NO_SSLv3;
|
||||||
else if (strcmp(*argv,"-no_ssl2") == 0)
|
else if (strcmp(*argv,"-no_ssl2") == 0)
|
||||||
off|=SSL_OP_NO_SSLv2;
|
off|=SSL_OP_NO_SSLv2;
|
||||||
|
else if (strcmp(*argv,"-serverpref") == 0)
|
||||||
|
off|=SSL_OP_CIPHER_SERVER_PREFERENCE;
|
||||||
else if (strcmp(*argv,"-cipher") == 0)
|
else if (strcmp(*argv,"-cipher") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -316,6 +406,25 @@ int MAIN(int argc, char **argv)
|
|||||||
else if (strcmp(*argv,"-nbio") == 0)
|
else if (strcmp(*argv,"-nbio") == 0)
|
||||||
{ c_nbio=1; }
|
{ c_nbio=1; }
|
||||||
#endif
|
#endif
|
||||||
|
else if (strcmp(*argv,"-starttls") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
++argv;
|
||||||
|
if (strcmp(*argv,"smtp") == 0)
|
||||||
|
smtp_starttls = 1;
|
||||||
|
else
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine_id = *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
inrand= *(++argv);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
@@ -332,11 +441,23 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
OpenSSL_add_ssl_algorithms();
|
||||||
|
SSL_load_error_strings();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine_id, 1);
|
||||||
|
|
||||||
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
||||||
|
&& !RAND_status())
|
||||||
|
{
|
||||||
|
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));
|
||||||
|
|
||||||
if (bio_c_out == NULL)
|
if (bio_c_out == NULL)
|
||||||
{
|
{
|
||||||
if (c_quiet)
|
if (c_quiet && !c_debug && !c_msg)
|
||||||
{
|
{
|
||||||
bio_c_out=BIO_new(BIO_s_null());
|
bio_c_out=BIO_new(BIO_s_null());
|
||||||
}
|
}
|
||||||
@@ -347,8 +468,6 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenSSL_add_ssl_algorithms();
|
|
||||||
SSL_load_error_strings();
|
|
||||||
ctx=SSL_CTX_new(meth);
|
ctx=SSL_CTX_new(meth);
|
||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
{
|
{
|
||||||
@@ -385,8 +504,16 @@ bad:
|
|||||||
/* goto end; */
|
/* goto end; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
store = SSL_CTX_get_cert_store(ctx);
|
||||||
|
X509_STORE_set_flags(store, vflags);
|
||||||
|
|
||||||
con=SSL_new(ctx);
|
con=SSL_new(ctx);
|
||||||
|
#ifndef OPENSSL_NO_KRB5
|
||||||
|
if (con && (con->kssl_ctx = kssl_ctx_new()) != NULL)
|
||||||
|
{
|
||||||
|
kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVER, host);
|
||||||
|
}
|
||||||
|
#endif /* OPENSSL_NO_KRB5 */
|
||||||
/* SSL_set_cipher_list(con,"RC4-MD5"); */
|
/* SSL_set_cipher_list(con,"RC4-MD5"); */
|
||||||
|
|
||||||
re_start:
|
re_start:
|
||||||
@@ -428,6 +555,11 @@ re_start:
|
|||||||
BIO_set_callback(sbio,bio_dump_cb);
|
BIO_set_callback(sbio,bio_dump_cb);
|
||||||
BIO_set_callback_arg(sbio,bio_c_out);
|
BIO_set_callback_arg(sbio,bio_c_out);
|
||||||
}
|
}
|
||||||
|
if (c_msg)
|
||||||
|
{
|
||||||
|
SSL_set_msg_callback(con, msg_cb);
|
||||||
|
SSL_set_msg_callback_arg(con, bio_c_out);
|
||||||
|
}
|
||||||
|
|
||||||
SSL_set_bio(con,sbio,sbio);
|
SSL_set_bio(con,sbio,sbio);
|
||||||
SSL_set_connect_state(con);
|
SSL_set_connect_state(con);
|
||||||
@@ -446,6 +578,14 @@ re_start:
|
|||||||
sbuf_len=0;
|
sbuf_len=0;
|
||||||
sbuf_off=0;
|
sbuf_off=0;
|
||||||
|
|
||||||
|
/* This is an ugly hack that does a lot of assumptions */
|
||||||
|
if (smtp_starttls)
|
||||||
|
{
|
||||||
|
BIO_read(sbio,mbuf,BUFSIZZ);
|
||||||
|
BIO_printf(sbio,"STARTTLS\r\n");
|
||||||
|
BIO_read(sbio,sbuf,BUFSIZZ);
|
||||||
|
}
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
@@ -465,6 +605,13 @@ re_start:
|
|||||||
print_stuff(bio_c_out,con,full_log);
|
print_stuff(bio_c_out,con,full_log);
|
||||||
if (full_log > 0) full_log--;
|
if (full_log > 0) full_log--;
|
||||||
|
|
||||||
|
if (smtp_starttls)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"%s",mbuf);
|
||||||
|
/* We don't need to know any more */
|
||||||
|
smtp_starttls = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (reconnect)
|
if (reconnect)
|
||||||
{
|
{
|
||||||
reconnect--;
|
reconnect--;
|
||||||
@@ -481,7 +628,7 @@ re_start:
|
|||||||
|
|
||||||
if (!ssl_pending)
|
if (!ssl_pending)
|
||||||
{
|
{
|
||||||
#ifndef WINDOWS
|
#ifndef OPENSSL_SYS_WINDOWS
|
||||||
if (tty_on)
|
if (tty_on)
|
||||||
{
|
{
|
||||||
if (read_tty) FD_SET(fileno(stdin),&readfds);
|
if (read_tty) FD_SET(fileno(stdin),&readfds);
|
||||||
@@ -508,7 +655,7 @@ re_start:
|
|||||||
* will choke the compiler: if you do have a cast then
|
* will choke the compiler: if you do have a cast then
|
||||||
* you can either go for (int *) or (void *).
|
* you can either go for (int *) or (void *).
|
||||||
*/
|
*/
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
/* Under Windows we make the assumption that we can
|
/* Under Windows we make the assumption that we can
|
||||||
* always write to the tty: therefore if we need to
|
* always write to the tty: therefore if we need to
|
||||||
* write to the tty we just fall through. Otherwise
|
* write to the tty we just fall through. Otherwise
|
||||||
@@ -523,7 +670,11 @@ re_start:
|
|||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
i=select(width,(void *)&readfds,(void *)&writefds,
|
i=select(width,(void *)&readfds,(void *)&writefds,
|
||||||
NULL,&tv);
|
NULL,&tv);
|
||||||
|
#ifdef OPENSSL_SYS_WINCE
|
||||||
if(!i && (!_kbhit() || !read_tty) ) continue;
|
if(!i && (!_kbhit() || !read_tty) ) continue;
|
||||||
|
#else
|
||||||
|
if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
|
||||||
|
#endif
|
||||||
} else i=select(width,(void *)&readfds,(void *)&writefds,
|
} else i=select(width,(void *)&readfds,(void *)&writefds,
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
}
|
}
|
||||||
@@ -607,8 +758,8 @@ re_start:
|
|||||||
goto shut;
|
goto shut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef WINDOWS
|
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
|
||||||
/* Assume Windows can always write */
|
/* Assume Windows/DOS can always write */
|
||||||
else if (!ssl_pending && write_tty)
|
else if (!ssl_pending && write_tty)
|
||||||
#else
|
#else
|
||||||
else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
|
else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
|
||||||
@@ -688,8 +839,12 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
|
#ifdef OPENSSL_SYS_WINCE
|
||||||
else if (_kbhit())
|
else if (_kbhit())
|
||||||
|
#else
|
||||||
|
else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
else if (FD_ISSET(fileno(stdin),&readfds))
|
else if (FD_ISSET(fileno(stdin),&readfds))
|
||||||
#endif
|
#endif
|
||||||
@@ -753,14 +908,16 @@ end:
|
|||||||
if (con != NULL) SSL_free(con);
|
if (con != NULL) SSL_free(con);
|
||||||
if (con2 != NULL) SSL_free(con2);
|
if (con2 != NULL) SSL_free(con2);
|
||||||
if (ctx != NULL) SSL_CTX_free(ctx);
|
if (ctx != NULL) SSL_CTX_free(ctx);
|
||||||
if (cbuf != NULL) { memset(cbuf,0,BUFSIZZ); Free(cbuf); }
|
if (cbuf != NULL) { OPENSSL_cleanse(cbuf,BUFSIZZ); OPENSSL_free(cbuf); }
|
||||||
if (sbuf != NULL) { memset(sbuf,0,BUFSIZZ); Free(sbuf); }
|
if (sbuf != NULL) { OPENSSL_cleanse(sbuf,BUFSIZZ); OPENSSL_free(sbuf); }
|
||||||
|
if (mbuf != NULL) { OPENSSL_cleanse(mbuf,BUFSIZZ); OPENSSL_free(mbuf); }
|
||||||
if (bio_c_out != NULL)
|
if (bio_c_out != NULL)
|
||||||
{
|
{
|
||||||
BIO_free(bio_c_out);
|
BIO_free(bio_c_out);
|
||||||
bio_c_out=NULL;
|
bio_c_out=NULL;
|
||||||
}
|
}
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -789,10 +946,10 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
|||||||
for (i=0; i<sk_X509_num(sk); i++)
|
for (i=0; i<sk_X509_num(sk); i++)
|
||||||
{
|
{
|
||||||
X509_NAME_oneline(X509_get_subject_name(
|
X509_NAME_oneline(X509_get_subject_name(
|
||||||
sk_X509_value(sk,i)),buf,BUFSIZ);
|
sk_X509_value(sk,i)),buf,sizeof buf);
|
||||||
BIO_printf(bio,"%2d s:%s\n",i,buf);
|
BIO_printf(bio,"%2d s:%s\n",i,buf);
|
||||||
X509_NAME_oneline(X509_get_issuer_name(
|
X509_NAME_oneline(X509_get_issuer_name(
|
||||||
sk_X509_value(sk,i)),buf,BUFSIZ);
|
sk_X509_value(sk,i)),buf,sizeof buf);
|
||||||
BIO_printf(bio," i:%s\n",buf);
|
BIO_printf(bio," i:%s\n",buf);
|
||||||
if (c_showcerts)
|
if (c_showcerts)
|
||||||
PEM_write_bio_X509(bio,sk_X509_value(sk,i));
|
PEM_write_bio_X509(bio,sk_X509_value(sk,i));
|
||||||
@@ -807,10 +964,10 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
|||||||
if (!(c_showcerts && got_a_chain)) /* Redundant if we showed the whole chain */
|
if (!(c_showcerts && got_a_chain)) /* Redundant if we showed the whole chain */
|
||||||
PEM_write_bio_X509(bio,peer);
|
PEM_write_bio_X509(bio,peer);
|
||||||
X509_NAME_oneline(X509_get_subject_name(peer),
|
X509_NAME_oneline(X509_get_subject_name(peer),
|
||||||
buf,BUFSIZ);
|
buf,sizeof buf);
|
||||||
BIO_printf(bio,"subject=%s\n",buf);
|
BIO_printf(bio,"subject=%s\n",buf);
|
||||||
X509_NAME_oneline(X509_get_issuer_name(peer),
|
X509_NAME_oneline(X509_get_issuer_name(peer),
|
||||||
buf,BUFSIZ);
|
buf,sizeof buf);
|
||||||
BIO_printf(bio,"issuer=%s\n",buf);
|
BIO_printf(bio,"issuer=%s\n",buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -832,7 +989,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
|||||||
{
|
{
|
||||||
BIO_printf(bio,"---\nNo client certificate CA names sent\n");
|
BIO_printf(bio,"---\nNo client certificate CA names sent\n");
|
||||||
}
|
}
|
||||||
p=SSL_get_shared_ciphers(s,buf,BUFSIZ);
|
p=SSL_get_shared_ciphers(s,buf,sizeof buf);
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
/* This works only for SSL 2. In later protocol
|
/* This works only for SSL 2. In later protocol
|
||||||
@@ -881,5 +1038,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
|
|||||||
BIO_printf(bio,"---\n");
|
BIO_printf(bio,"---\n");
|
||||||
if (peer != NULL)
|
if (peer != NULL)
|
||||||
X509_free(peer);
|
X509_free(peer);
|
||||||
|
/* flush, or debugging output gets mixed with http response */
|
||||||
|
BIO_flush(bio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
420
apps/s_server.c
420
apps/s_server.c
@@ -55,6 +55,64 @@
|
|||||||
* copied and put under another distribution licence
|
* copied and put under another distribution licence
|
||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
|
||||||
|
* ECC cipher suite support in OpenSSL originally developed by
|
||||||
|
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -62,7 +120,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef NO_STDIO
|
#include <openssl/e_os2.h>
|
||||||
|
#ifdef OPENSSL_NO_STDIO
|
||||||
#define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -70,7 +129,7 @@
|
|||||||
recursive header file inclusion, resulting in the compiler complaining
|
recursive header file inclusion, resulting in the compiler complaining
|
||||||
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
||||||
is needed to have fileno() declared correctly... So let's define u_int */
|
is needed to have fileno() declared correctly... So let's define u_int */
|
||||||
#if defined(VMS) && defined(__DECC) && !defined(__U_INT)
|
#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__U_INT)
|
||||||
#define __U_INT
|
#define __U_INT
|
||||||
typedef unsigned int u_int;
|
typedef unsigned int u_int;
|
||||||
#endif
|
#endif
|
||||||
@@ -83,18 +142,27 @@ typedef unsigned int u_int;
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
#include <openssl/rand.h>
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(VMS) && __VMS_VER < 70000000)
|
#ifdef OPENSSL_SYS_WINCE
|
||||||
|
/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
|
||||||
|
#ifdef fileno
|
||||||
|
#undef fileno
|
||||||
|
#endif
|
||||||
|
#define fileno(a) (int)_fileno(a)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
|
||||||
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
|
||||||
#undef FIONBIO
|
#undef FIONBIO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength);
|
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength);
|
||||||
#endif
|
#endif
|
||||||
static int sv_body(char *hostname, int s, unsigned char *context);
|
static int sv_body(char *hostname, int s, unsigned char *context);
|
||||||
@@ -103,10 +171,13 @@ static void close_accept_socket(void );
|
|||||||
static void sv_usage(void);
|
static void sv_usage(void);
|
||||||
static int init_ssl_connection(SSL *s);
|
static int init_ssl_connection(SSL *s);
|
||||||
static void print_stats(BIO *bp,SSL_CTX *ctx);
|
static void print_stats(BIO *bp,SSL_CTX *ctx);
|
||||||
#ifndef NO_DH
|
static int generate_session_id(const SSL *ssl, unsigned char *id,
|
||||||
|
unsigned int *id_len);
|
||||||
|
#ifndef OPENSSL_NO_DH
|
||||||
static DH *load_dh_param(char *dhfile);
|
static DH *load_dh_param(char *dhfile);
|
||||||
static DH *get_dh512(void);
|
static DH *get_dh512(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MONOLITH
|
#ifdef MONOLITH
|
||||||
static void s_server_init(void);
|
static void s_server_init(void);
|
||||||
#endif
|
#endif
|
||||||
@@ -119,7 +190,7 @@ static void s_server_init(void);
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
static unsigned char dh512_p[]={
|
static unsigned char dh512_p[]={
|
||||||
0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
|
0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
|
||||||
0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F,
|
0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F,
|
||||||
@@ -145,6 +216,7 @@ static DH *get_dh512(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* static int load_CA(SSL_CTX *ctx, char *file);*/
|
/* static int load_CA(SSL_CTX *ctx, char *file);*/
|
||||||
|
|
||||||
#undef BUFSIZZ
|
#undef BUFSIZZ
|
||||||
@@ -173,9 +245,12 @@ static int www=0;
|
|||||||
|
|
||||||
static BIO *bio_s_out=NULL;
|
static BIO *bio_s_out=NULL;
|
||||||
static int s_debug=0;
|
static int s_debug=0;
|
||||||
|
static int s_msg=0;
|
||||||
static int s_quiet=0;
|
static int s_quiet=0;
|
||||||
|
|
||||||
static int hack=0;
|
static int hack=0;
|
||||||
|
static char *engine_id=NULL;
|
||||||
|
static const char *session_id_prefix=NULL;
|
||||||
|
|
||||||
#ifdef MONOLITH
|
#ifdef MONOLITH
|
||||||
static void s_server_init(void)
|
static void s_server_init(void)
|
||||||
@@ -196,8 +271,10 @@ static void s_server_init(void)
|
|||||||
|
|
||||||
bio_s_out=NULL;
|
bio_s_out=NULL;
|
||||||
s_debug=0;
|
s_debug=0;
|
||||||
|
s_msg=0;
|
||||||
s_quiet=0;
|
s_quiet=0;
|
||||||
hack=0;
|
hack=0;
|
||||||
|
engine_id=NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -217,17 +294,24 @@ static void sv_usage(void)
|
|||||||
BIO_printf(bio_err," -dkey arg - second private key 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," -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");
|
BIO_printf(bio_err," or a default set of parameters is used\n");
|
||||||
|
#ifndef OPENSSL_NO_ECDH
|
||||||
|
BIO_printf(bio_err," -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" \
|
||||||
|
" Use \"openssl ecparam -list_curves\" for all names\n" \
|
||||||
|
" (default is sect163r2).\n");
|
||||||
|
#endif
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
BIO_printf(bio_err," -nbio - Run with non-blocking IO\n");
|
BIO_printf(bio_err," -nbio - Run with non-blocking IO\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err," -nbio_test - test with the non-blocking test bio\n");
|
BIO_printf(bio_err," -nbio_test - test with the non-blocking test bio\n");
|
||||||
BIO_printf(bio_err," -crlf - convert LF from terminal into CRLF\n");
|
BIO_printf(bio_err," -crlf - convert LF from terminal into CRLF\n");
|
||||||
BIO_printf(bio_err," -debug - Print more output\n");
|
BIO_printf(bio_err," -debug - Print more output\n");
|
||||||
|
BIO_printf(bio_err," -msg - Show protocol messages\n");
|
||||||
BIO_printf(bio_err," -state - Print the SSL states\n");
|
BIO_printf(bio_err," -state - Print the SSL states\n");
|
||||||
BIO_printf(bio_err," -CApath arg - PEM format directory of CA's\n");
|
BIO_printf(bio_err," -CApath arg - PEM format directory of CA's\n");
|
||||||
BIO_printf(bio_err," -CAfile arg - PEM format file of CA's\n");
|
BIO_printf(bio_err," -CAfile arg - PEM format file of CA's\n");
|
||||||
BIO_printf(bio_err," -nocert - Don't use any certificates (Anon-DH)\n");
|
BIO_printf(bio_err," -nocert - Don't use any certificates (Anon-DH)\n");
|
||||||
BIO_printf(bio_err," -cipher arg - play with 'openssl ciphers' to see what goes here\n");
|
BIO_printf(bio_err," -cipher arg - play with 'openssl ciphers' to see what goes here\n");
|
||||||
|
BIO_printf(bio_err," -serverpref - Use server's cipher preferences\n");
|
||||||
BIO_printf(bio_err," -quiet - No server output\n");
|
BIO_printf(bio_err," -quiet - No server output\n");
|
||||||
BIO_printf(bio_err," -no_tmp_rsa - Do not generate a tmp RSA key\n");
|
BIO_printf(bio_err," -no_tmp_rsa - Do not generate a tmp RSA key\n");
|
||||||
BIO_printf(bio_err," -ssl2 - Just talk SSLv2\n");
|
BIO_printf(bio_err," -ssl2 - Just talk SSLv2\n");
|
||||||
@@ -236,12 +320,20 @@ static void sv_usage(void)
|
|||||||
BIO_printf(bio_err," -no_ssl2 - Just disable SSLv2\n");
|
BIO_printf(bio_err," -no_ssl2 - Just disable SSLv2\n");
|
||||||
BIO_printf(bio_err," -no_ssl3 - Just disable SSLv3\n");
|
BIO_printf(bio_err," -no_ssl3 - Just disable SSLv3\n");
|
||||||
BIO_printf(bio_err," -no_tls1 - Just disable TLSv1\n");
|
BIO_printf(bio_err," -no_tls1 - Just disable TLSv1\n");
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
BIO_printf(bio_err," -no_dhe - Disable ephemeral DH\n");
|
BIO_printf(bio_err," -no_dhe - Disable ephemeral DH\n");
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_ECDH
|
||||||
|
BIO_printf(bio_err," -no_ecdhe - Disable ephemeral ECDH\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf(bio_err," -bugs - Turn on SSL bug compatibility\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 /' with a status page\n");
|
||||||
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
BIO_printf(bio_err," -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
||||||
|
BIO_printf(bio_err," -HTTP - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
|
||||||
|
BIO_printf(bio_err," with the assumption it contains a complete HTTP response.\n");
|
||||||
|
BIO_printf(bio_err," -engine id - Initialise and use the specified engine\n");
|
||||||
|
BIO_printf(bio_err," -id_prefix arg - Generate SSL/TLS session IDs prefixed by 'arg'\n");
|
||||||
|
BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int local_argc=0;
|
static int local_argc=0;
|
||||||
@@ -251,10 +343,10 @@ static char **local_argv;
|
|||||||
static int ebcdic_new(BIO *bi);
|
static int ebcdic_new(BIO *bi);
|
||||||
static int ebcdic_free(BIO *a);
|
static int ebcdic_free(BIO *a);
|
||||||
static int ebcdic_read(BIO *b, char *out, int outl);
|
static int ebcdic_read(BIO *b, char *out, int outl);
|
||||||
static int ebcdic_write(BIO *b, char *in, int inl);
|
static int ebcdic_write(BIO *b, const char *in, int inl);
|
||||||
static long ebcdic_ctrl(BIO *b, int cmd, long num, char *ptr);
|
static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr);
|
||||||
static int ebcdic_gets(BIO *bp, char *buf, int size);
|
static int ebcdic_gets(BIO *bp, char *buf, int size);
|
||||||
static int ebcdic_puts(BIO *bp, char *str);
|
static int ebcdic_puts(BIO *bp, const char *str);
|
||||||
|
|
||||||
#define BIO_TYPE_EBCDIC_FILTER (18|0x0200)
|
#define BIO_TYPE_EBCDIC_FILTER (18|0x0200)
|
||||||
static BIO_METHOD methods_ebcdic=
|
static BIO_METHOD methods_ebcdic=
|
||||||
@@ -285,7 +377,7 @@ static int ebcdic_new(BIO *bi)
|
|||||||
{
|
{
|
||||||
EBCDIC_OUTBUFF *wbuf;
|
EBCDIC_OUTBUFF *wbuf;
|
||||||
|
|
||||||
wbuf = (EBCDIC_OUTBUFF *)Malloc(sizeof(EBCDIC_OUTBUFF) + 1024);
|
wbuf = (EBCDIC_OUTBUFF *)OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + 1024);
|
||||||
wbuf->alloced = 1024;
|
wbuf->alloced = 1024;
|
||||||
wbuf->buff[0] = '\0';
|
wbuf->buff[0] = '\0';
|
||||||
|
|
||||||
@@ -299,7 +391,7 @@ static int ebcdic_free(BIO *a)
|
|||||||
{
|
{
|
||||||
if (a == NULL) return(0);
|
if (a == NULL) return(0);
|
||||||
if (a->ptr != NULL)
|
if (a->ptr != NULL)
|
||||||
Free(a->ptr);
|
OPENSSL_free(a->ptr);
|
||||||
a->ptr=NULL;
|
a->ptr=NULL;
|
||||||
a->init=0;
|
a->init=0;
|
||||||
a->flags=0;
|
a->flags=0;
|
||||||
@@ -319,7 +411,7 @@ static int ebcdic_read(BIO *b, char *out, int outl)
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ebcdic_write(BIO *b, char *in, int inl)
|
static int ebcdic_write(BIO *b, const char *in, int inl)
|
||||||
{
|
{
|
||||||
EBCDIC_OUTBUFF *wbuf;
|
EBCDIC_OUTBUFF *wbuf;
|
||||||
int ret=0;
|
int ret=0;
|
||||||
@@ -336,8 +428,8 @@ static int ebcdic_write(BIO *b, char *in, int inl)
|
|||||||
num = num + num; /* double the size */
|
num = num + num; /* double the size */
|
||||||
if (num < inl)
|
if (num < inl)
|
||||||
num = inl;
|
num = inl;
|
||||||
Free(wbuf);
|
OPENSSL_free(wbuf);
|
||||||
wbuf=(EBCDIC_OUTBUFF *)Malloc(sizeof(EBCDIC_OUTBUFF) + num);
|
wbuf=(EBCDIC_OUTBUFF *)OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + num);
|
||||||
|
|
||||||
wbuf->alloced = num;
|
wbuf->alloced = num;
|
||||||
wbuf->buff[0] = '\0';
|
wbuf->buff[0] = '\0';
|
||||||
@@ -352,7 +444,7 @@ static int ebcdic_write(BIO *b, char *in, int inl)
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static long ebcdic_ctrl(BIO *b, int cmd, long num, char *ptr)
|
static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||||
{
|
{
|
||||||
long ret;
|
long ret;
|
||||||
|
|
||||||
@@ -371,7 +463,7 @@ static long ebcdic_ctrl(BIO *b, int cmd, long num, char *ptr)
|
|||||||
|
|
||||||
static int ebcdic_gets(BIO *bp, char *buf, int size)
|
static int ebcdic_gets(BIO *bp, char *buf, int size)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret=0;
|
||||||
if (bp->next_bio == NULL) return(0);
|
if (bp->next_bio == NULL) return(0);
|
||||||
/* return(BIO_gets(bp->next_bio,buf,size));*/
|
/* return(BIO_gets(bp->next_bio,buf,size));*/
|
||||||
for (i=0; i<size-1; ++i)
|
for (i=0; i<size-1; ++i)
|
||||||
@@ -390,7 +482,7 @@ static int ebcdic_gets(BIO *bp, char *buf, int size)
|
|||||||
return (ret < 0 && i == 0) ? ret : i;
|
return (ret < 0 && i == 0) ? ret : i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ebcdic_puts(BIO *bp, char *str)
|
static int ebcdic_puts(BIO *bp, const char *str)
|
||||||
{
|
{
|
||||||
if (bp->next_bio == NULL) return(0);
|
if (bp->next_bio == NULL) return(0);
|
||||||
return ebcdic_write(bp, str, strlen(str));
|
return ebcdic_write(bp, str, strlen(str));
|
||||||
@@ -401,25 +493,27 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char *argv[])
|
int MAIN(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
X509_STORE *store = NULL;
|
||||||
|
int vflags = 0;
|
||||||
short port=PORT;
|
short port=PORT;
|
||||||
char *CApath=NULL,*CAfile=NULL;
|
char *CApath=NULL,*CAfile=NULL;
|
||||||
char *context = NULL;
|
char *context = NULL;
|
||||||
char *dhfile = NULL;
|
char *dhfile = NULL;
|
||||||
|
char *named_curve = NULL;
|
||||||
int badop=0,bugs=0;
|
int badop=0,bugs=0;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
int off=0;
|
int off=0;
|
||||||
int no_tmp_rsa=0,no_dhe=0,nocert=0;
|
int no_tmp_rsa=0,no_dhe=0,no_ecdhe=0,nocert=0;
|
||||||
int state=0;
|
int state=0;
|
||||||
SSL_METHOD *meth=NULL;
|
SSL_METHOD *meth=NULL;
|
||||||
#ifndef NO_DH
|
ENGINE *e=NULL;
|
||||||
DH *dh=NULL;
|
char *inrand=NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(NO_SSL2) && !defined(NO_SSL3)
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
meth=SSLv23_server_method();
|
meth=SSLv23_server_method();
|
||||||
#elif !defined(NO_SSL3)
|
#elif !defined(OPENSSL_NO_SSL3)
|
||||||
meth=SSLv3_server_method();
|
meth=SSLv3_server_method();
|
||||||
#elif !defined(NO_SSL2)
|
#elif !defined(OPENSSL_NO_SSL2)
|
||||||
meth=SSLv2_server_method();
|
meth=SSLv2_server_method();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -434,6 +528,9 @@ int MAIN(int argc, char *argv[])
|
|||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
verify_depth=0;
|
verify_depth=0;
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
s_nbio=0;
|
s_nbio=0;
|
||||||
@@ -487,6 +584,13 @@ int MAIN(int argc, char *argv[])
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
dhfile = *(++argv);
|
dhfile = *(++argv);
|
||||||
}
|
}
|
||||||
|
#ifndef OPENSSL_NO_ECDH
|
||||||
|
else if (strcmp(*argv,"-named_curve") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
named_curve = *(++argv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else if (strcmp(*argv,"-dcert") == 0)
|
else if (strcmp(*argv,"-dcert") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -506,6 +610,16 @@ int MAIN(int argc, char *argv[])
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
CApath= *(++argv);
|
CApath= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-crl_check") == 0)
|
||||||
|
{
|
||||||
|
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-crl_check") == 0)
|
||||||
|
{
|
||||||
|
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-serverpref") == 0)
|
||||||
|
{ off|=SSL_OP_CIPHER_SERVER_PREFERENCE; }
|
||||||
else if (strcmp(*argv,"-cipher") == 0)
|
else if (strcmp(*argv,"-cipher") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
@@ -529,6 +643,8 @@ int MAIN(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (strcmp(*argv,"-debug") == 0)
|
else if (strcmp(*argv,"-debug") == 0)
|
||||||
{ s_debug=1; }
|
{ s_debug=1; }
|
||||||
|
else if (strcmp(*argv,"-msg") == 0)
|
||||||
|
{ s_msg=1; }
|
||||||
else if (strcmp(*argv,"-hack") == 0)
|
else if (strcmp(*argv,"-hack") == 0)
|
||||||
{ hack=1; }
|
{ hack=1; }
|
||||||
else if (strcmp(*argv,"-state") == 0)
|
else if (strcmp(*argv,"-state") == 0)
|
||||||
@@ -543,28 +659,47 @@ int MAIN(int argc, char *argv[])
|
|||||||
{ no_tmp_rsa=1; }
|
{ no_tmp_rsa=1; }
|
||||||
else if (strcmp(*argv,"-no_dhe") == 0)
|
else if (strcmp(*argv,"-no_dhe") == 0)
|
||||||
{ no_dhe=1; }
|
{ no_dhe=1; }
|
||||||
|
else if (strcmp(*argv,"-no_ecdhe") == 0)
|
||||||
|
{ no_ecdhe=1; }
|
||||||
else if (strcmp(*argv,"-www") == 0)
|
else if (strcmp(*argv,"-www") == 0)
|
||||||
{ www=1; }
|
{ www=1; }
|
||||||
else if (strcmp(*argv,"-WWW") == 0)
|
else if (strcmp(*argv,"-WWW") == 0)
|
||||||
{ www=2; }
|
{ www=2; }
|
||||||
|
else if (strcmp(*argv,"-HTTP") == 0)
|
||||||
|
{ www=3; }
|
||||||
else if (strcmp(*argv,"-no_ssl2") == 0)
|
else if (strcmp(*argv,"-no_ssl2") == 0)
|
||||||
{ off|=SSL_OP_NO_SSLv2; }
|
{ off|=SSL_OP_NO_SSLv2; }
|
||||||
else if (strcmp(*argv,"-no_ssl3") == 0)
|
else if (strcmp(*argv,"-no_ssl3") == 0)
|
||||||
{ off|=SSL_OP_NO_SSLv3; }
|
{ off|=SSL_OP_NO_SSLv3; }
|
||||||
else if (strcmp(*argv,"-no_tls1") == 0)
|
else if (strcmp(*argv,"-no_tls1") == 0)
|
||||||
{ off|=SSL_OP_NO_TLSv1; }
|
{ off|=SSL_OP_NO_TLSv1; }
|
||||||
#ifndef NO_SSL2
|
#ifndef OPENSSL_NO_SSL2
|
||||||
else if (strcmp(*argv,"-ssl2") == 0)
|
else if (strcmp(*argv,"-ssl2") == 0)
|
||||||
{ meth=SSLv2_server_method(); }
|
{ meth=SSLv2_server_method(); }
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SSL3
|
#ifndef OPENSSL_NO_SSL3
|
||||||
else if (strcmp(*argv,"-ssl3") == 0)
|
else if (strcmp(*argv,"-ssl3") == 0)
|
||||||
{ meth=SSLv3_server_method(); }
|
{ meth=SSLv3_server_method(); }
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_TLS1
|
#ifndef OPENSSL_NO_TLS1
|
||||||
else if (strcmp(*argv,"-tls1") == 0)
|
else if (strcmp(*argv,"-tls1") == 0)
|
||||||
{ meth=TLSv1_server_method(); }
|
{ meth=TLSv1_server_method(); }
|
||||||
#endif
|
#endif
|
||||||
|
else if (strcmp(*argv, "-id_prefix") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
session_id_prefix = *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine_id= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-rand") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
inrand= *(++argv);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
BIO_printf(bio_err,"unknown option %s\n",*argv);
|
||||||
@@ -581,11 +716,23 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
SSL_load_error_strings();
|
||||||
|
OpenSSL_add_ssl_algorithms();
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine_id, 1);
|
||||||
|
|
||||||
|
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
|
||||||
|
&& !RAND_status())
|
||||||
|
{
|
||||||
|
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));
|
||||||
|
|
||||||
if (bio_s_out == NULL)
|
if (bio_s_out == NULL)
|
||||||
{
|
{
|
||||||
if (s_quiet && !s_debug)
|
if (s_quiet && !s_debug && !s_msg)
|
||||||
{
|
{
|
||||||
bio_s_out=BIO_new(BIO_s_null());
|
bio_s_out=BIO_new(BIO_s_null());
|
||||||
}
|
}
|
||||||
@@ -596,7 +743,7 @@ bad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(NO_RSA) || !defined(NO_DSA)
|
#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA)
|
||||||
if (nocert)
|
if (nocert)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -606,21 +753,32 @@ bad:
|
|||||||
s_dkey_file=NULL;
|
s_dkey_file=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SSL_load_error_strings();
|
|
||||||
OpenSSL_add_ssl_algorithms();
|
|
||||||
|
|
||||||
ctx=SSL_CTX_new(meth);
|
ctx=SSL_CTX_new(meth);
|
||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
{
|
{
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
if (session_id_prefix)
|
||||||
|
{
|
||||||
|
if(strlen(session_id_prefix) >= 32)
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"warning: id_prefix is too long, only one new session will be possible\n");
|
||||||
|
else if(strlen(session_id_prefix) >= 16)
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"warning: id_prefix is too long if you use SSLv2\n");
|
||||||
|
if(!SSL_CTX_set_generate_session_id(ctx, generate_session_id))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"error setting 'id_prefix'\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
BIO_printf(bio_err,"id_prefix '%s' set.\n", session_id_prefix);
|
||||||
|
}
|
||||||
SSL_CTX_set_quiet_shutdown(ctx,1);
|
SSL_CTX_set_quiet_shutdown(ctx,1);
|
||||||
if (bugs) SSL_CTX_set_options(ctx,SSL_OP_ALL);
|
if (bugs) SSL_CTX_set_options(ctx,SSL_OP_ALL);
|
||||||
if (hack) SSL_CTX_set_options(ctx,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
|
if (hack) SSL_CTX_set_options(ctx,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
|
||||||
SSL_CTX_set_options(ctx,off);
|
SSL_CTX_set_options(ctx,off);
|
||||||
if (hack) SSL_CTX_set_options(ctx,SSL_OP_NON_EXPORT_FIRST);
|
|
||||||
|
|
||||||
if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
|
if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
|
||||||
|
|
||||||
@@ -645,11 +803,19 @@ bad:
|
|||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
/* goto end; */
|
/* goto end; */
|
||||||
}
|
}
|
||||||
|
store = SSL_CTX_get_cert_store(ctx);
|
||||||
|
X509_STORE_set_flags(store, vflags);
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
if (!no_dhe)
|
if (!no_dhe)
|
||||||
{
|
{
|
||||||
dh=load_dh_param(dhfile ? dhfile : s_cert_file);
|
DH *dh=NULL;
|
||||||
|
|
||||||
|
if (dhfile)
|
||||||
|
dh = load_dh_param(dhfile);
|
||||||
|
else if (s_cert_file)
|
||||||
|
dh = load_dh_param(s_cert_file);
|
||||||
|
|
||||||
if (dh != NULL)
|
if (dh != NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_s_out,"Setting temp DH parameters\n");
|
BIO_printf(bio_s_out,"Setting temp DH parameters\n");
|
||||||
@@ -666,6 +832,59 @@ bad:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_ECDH
|
||||||
|
if (!no_ecdhe)
|
||||||
|
{
|
||||||
|
EC_KEY *ecdh=NULL;
|
||||||
|
|
||||||
|
ecdh = EC_KEY_new();
|
||||||
|
if (ecdh == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"Could not create ECDH struct.\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (named_curve)
|
||||||
|
{
|
||||||
|
int nid = OBJ_sn2nid(named_curve);
|
||||||
|
|
||||||
|
if (nid == 0)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "unknown curve name (%s)\n",
|
||||||
|
named_curve);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
ecdh->group = EC_GROUP_new_by_nid(nid);
|
||||||
|
if (ecdh->group == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "unable to create curve (%s)\n",
|
||||||
|
named_curve);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ecdh->group != NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_s_out,"Setting temp ECDH parameters\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(bio_s_out,"Using default temp ECDH parameters\n");
|
||||||
|
ecdh->group=EC_GROUP_new_by_nid(NID_sect163r2);
|
||||||
|
if (ecdh->group == NULL)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err, "unable to create curve (sect163r2)\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void)BIO_flush(bio_s_out);
|
||||||
|
|
||||||
|
SSL_CTX_set_tmp_ecdh(ctx,ecdh);
|
||||||
|
EC_KEY_free(ecdh);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!set_cert_stuff(ctx,s_cert_file,s_key_file))
|
if (!set_cert_stuff(ctx,s_cert_file,s_key_file))
|
||||||
goto end;
|
goto end;
|
||||||
if (s_dcert_file != NULL)
|
if (s_dcert_file != NULL)
|
||||||
@@ -674,8 +893,9 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
#if 1
|
#if 1
|
||||||
|
if (!no_tmp_rsa)
|
||||||
SSL_CTX_set_tmp_rsa_callback(ctx,tmp_rsa_cb);
|
SSL_CTX_set_tmp_rsa_callback(ctx,tmp_rsa_cb);
|
||||||
#else
|
#else
|
||||||
if (!no_tmp_rsa && SSL_CTX_need_tmp_RSA(ctx))
|
if (!no_tmp_rsa && SSL_CTX_need_tmp_RSA(ctx))
|
||||||
@@ -725,7 +945,8 @@ end:
|
|||||||
BIO_free(bio_s_out);
|
BIO_free(bio_s_out);
|
||||||
bio_s_out=NULL;
|
bio_s_out=NULL;
|
||||||
}
|
}
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
|
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
|
||||||
@@ -762,11 +983,11 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
unsigned long l;
|
unsigned long l;
|
||||||
SSL *con=NULL;
|
SSL *con=NULL;
|
||||||
BIO *sbio;
|
BIO *sbio;
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((buf=Malloc(bufsize)) == NULL)
|
if ((buf=OPENSSL_malloc(bufsize)) == NULL)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"out of memory\n");
|
BIO_printf(bio_err,"out of memory\n");
|
||||||
goto err;
|
goto err;
|
||||||
@@ -785,6 +1006,15 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
|
|
||||||
if (con == NULL) {
|
if (con == NULL) {
|
||||||
con=SSL_new(ctx);
|
con=SSL_new(ctx);
|
||||||
|
#ifndef OPENSSL_NO_KRB5
|
||||||
|
if ((con->kssl_ctx = kssl_ctx_new()) != NULL)
|
||||||
|
{
|
||||||
|
kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVICE,
|
||||||
|
KRB5SVC);
|
||||||
|
kssl_ctx_setstring(con->kssl_ctx, KSSL_KEYTAB,
|
||||||
|
KRB5KEYTAB);
|
||||||
|
}
|
||||||
|
#endif /* OPENSSL_NO_KRB5 */
|
||||||
if(context)
|
if(context)
|
||||||
SSL_set_session_id_context(con, context,
|
SSL_set_session_id_context(con, context,
|
||||||
strlen((char *)context));
|
strlen((char *)context));
|
||||||
@@ -809,6 +1039,11 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
BIO_set_callback(SSL_get_rbio(con),bio_dump_cb);
|
BIO_set_callback(SSL_get_rbio(con),bio_dump_cb);
|
||||||
BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
|
BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
|
||||||
}
|
}
|
||||||
|
if (s_msg)
|
||||||
|
{
|
||||||
|
SSL_set_msg_callback(con, msg_cb);
|
||||||
|
SSL_set_msg_callback_arg(con, bio_s_out);
|
||||||
|
}
|
||||||
|
|
||||||
width=s+1;
|
width=s+1;
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -822,7 +1057,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
if (!read_from_sslcon)
|
if (!read_from_sslcon)
|
||||||
{
|
{
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
#ifndef WINDOWS
|
#ifndef OPENSSL_SYS_WINDOWS
|
||||||
FD_SET(fileno(stdin),&readfds);
|
FD_SET(fileno(stdin),&readfds);
|
||||||
#endif
|
#endif
|
||||||
FD_SET(s,&readfds);
|
FD_SET(s,&readfds);
|
||||||
@@ -832,7 +1067,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
|
|||||||
* the compiler: if you do have a cast then you can either
|
* the compiler: if you do have a cast then you can either
|
||||||
* go for (int *) or (void *).
|
* go for (int *) or (void *).
|
||||||
*/
|
*/
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
/* Under Windows we can't select on stdin: only
|
/* Under Windows we can't select on stdin: only
|
||||||
* on sockets. As a workaround we timeout the select every
|
* on sockets. As a workaround we timeout the select every
|
||||||
* second and check for any keypress. In a proper Windows
|
* second and check for any keypress. In a proper Windows
|
||||||
@@ -1027,8 +1262,8 @@ err:
|
|||||||
BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
|
BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
memset(buf,0,bufsize);
|
OPENSSL_cleanse(buf,bufsize);
|
||||||
Free(buf);
|
OPENSSL_free(buf);
|
||||||
}
|
}
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
BIO_printf(bio_s_out,"ACCEPT\n");
|
BIO_printf(bio_s_out,"ACCEPT\n");
|
||||||
@@ -1079,14 +1314,14 @@ static int init_ssl_connection(SSL *con)
|
|||||||
{
|
{
|
||||||
BIO_printf(bio_s_out,"Client certificate\n");
|
BIO_printf(bio_s_out,"Client certificate\n");
|
||||||
PEM_write_bio_X509(bio_s_out,peer);
|
PEM_write_bio_X509(bio_s_out,peer);
|
||||||
X509_NAME_oneline(X509_get_subject_name(peer),buf,BUFSIZ);
|
X509_NAME_oneline(X509_get_subject_name(peer),buf,sizeof buf);
|
||||||
BIO_printf(bio_s_out,"subject=%s\n",buf);
|
BIO_printf(bio_s_out,"subject=%s\n",buf);
|
||||||
X509_NAME_oneline(X509_get_issuer_name(peer),buf,BUFSIZ);
|
X509_NAME_oneline(X509_get_issuer_name(peer),buf,sizeof buf);
|
||||||
BIO_printf(bio_s_out,"issuer=%s\n",buf);
|
BIO_printf(bio_s_out,"issuer=%s\n",buf);
|
||||||
X509_free(peer);
|
X509_free(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SSL_get_shared_ciphers(con,buf,BUFSIZ) != NULL)
|
if (SSL_get_shared_ciphers(con,buf,sizeof buf) != NULL)
|
||||||
BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf);
|
BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf);
|
||||||
str=SSL_CIPHER_get_name(SSL_get_current_cipher(con));
|
str=SSL_CIPHER_get_name(SSL_get_current_cipher(con));
|
||||||
BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)");
|
BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)");
|
||||||
@@ -1098,7 +1333,7 @@ static int init_ssl_connection(SSL *con)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef OPENSSL_NO_DH
|
||||||
static DH *load_dh_param(char *dhfile)
|
static DH *load_dh_param(char *dhfile)
|
||||||
{
|
{
|
||||||
DH *ret=NULL;
|
DH *ret=NULL;
|
||||||
@@ -1145,7 +1380,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
BIO *io,*ssl_bio,*sbio;
|
BIO *io,*ssl_bio,*sbio;
|
||||||
long total_bytes;
|
long total_bytes;
|
||||||
|
|
||||||
buf=Malloc(bufsize);
|
buf=OPENSSL_malloc(bufsize);
|
||||||
if (buf == NULL) return(0);
|
if (buf == NULL) return(0);
|
||||||
io=BIO_new(BIO_f_buffer());
|
io=BIO_new(BIO_f_buffer());
|
||||||
ssl_bio=BIO_new(BIO_f_ssl());
|
ssl_bio=BIO_new(BIO_f_ssl());
|
||||||
@@ -1167,6 +1402,13 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
if (!BIO_set_write_buffer_size(io,bufsize)) goto err;
|
if (!BIO_set_write_buffer_size(io,bufsize)) goto err;
|
||||||
|
|
||||||
if ((con=SSL_new(ctx)) == NULL) goto err;
|
if ((con=SSL_new(ctx)) == NULL) goto err;
|
||||||
|
#ifndef OPENSSL_NO_KRB5
|
||||||
|
if ((con->kssl_ctx = kssl_ctx_new()) != NULL)
|
||||||
|
{
|
||||||
|
kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVICE, KRB5SVC);
|
||||||
|
kssl_ctx_setstring(con->kssl_ctx, KSSL_KEYTAB, KRB5KEYTAB);
|
||||||
|
}
|
||||||
|
#endif /* OPENSSL_NO_KRB5 */
|
||||||
if(context) SSL_set_session_id_context(con, context,
|
if(context) SSL_set_session_id_context(con, context,
|
||||||
strlen((char *)context));
|
strlen((char *)context));
|
||||||
|
|
||||||
@@ -1194,6 +1436,11 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
BIO_set_callback(SSL_get_rbio(con),bio_dump_cb);
|
BIO_set_callback(SSL_get_rbio(con),bio_dump_cb);
|
||||||
BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
|
BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
|
||||||
}
|
}
|
||||||
|
if (s_msg)
|
||||||
|
{
|
||||||
|
SSL_set_msg_callback(con, msg_cb);
|
||||||
|
SSL_set_msg_callback_arg(con, bio_s_out);
|
||||||
|
}
|
||||||
|
|
||||||
blank=0;
|
blank=0;
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -1234,7 +1481,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_s_out,"read R BLOCK\n");
|
BIO_printf(bio_s_out,"read R BLOCK\n");
|
||||||
#ifndef MSDOS
|
#if !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
|
||||||
sleep(1);
|
sleep(1);
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
@@ -1328,7 +1575,8 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
BIO_puts(io,"</BODY></HTML>\r\n\r\n");
|
BIO_puts(io,"</BODY></HTML>\r\n\r\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ((www == 2) && (strncmp("GET /",buf,5) == 0))
|
else if ((www == 2 || www == 3)
|
||||||
|
&& (strncmp("GET /",buf,5) == 0))
|
||||||
{
|
{
|
||||||
BIO *file;
|
BIO *file;
|
||||||
char *p,*e;
|
char *p,*e;
|
||||||
@@ -1336,15 +1584,29 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
|
|
||||||
/* skip the '/' */
|
/* skip the '/' */
|
||||||
p= &(buf[5]);
|
p= &(buf[5]);
|
||||||
dot=0;
|
|
||||||
|
dot = 1;
|
||||||
for (e=p; *e != '\0'; e++)
|
for (e=p; *e != '\0'; e++)
|
||||||
{
|
{
|
||||||
if (e[0] == ' ') break;
|
if (e[0] == ' ')
|
||||||
if ( (e[0] == '.') &&
|
break;
|
||||||
(strncmp(&(e[-1]),"/../",4) == 0))
|
|
||||||
dot=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
switch (dot)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
dot = (e[0] == '.') ? 2 : 0;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
dot = (e[0] == '.') ? 3 : 0;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
dot = (e[0] == '/') ? -1 : 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (dot == 0)
|
||||||
|
dot = (e[0] == '/') ? 1 : 0;
|
||||||
|
}
|
||||||
|
dot = (dot == 3) || (dot == -1); /* filename contains ".." component */
|
||||||
|
|
||||||
if (*e == '\0')
|
if (*e == '\0')
|
||||||
{
|
{
|
||||||
@@ -1368,9 +1630,11 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* append if a directory lookup */
|
/* append if a directory lookup */
|
||||||
if (e[-1] == '/')
|
if (e[-1] == '/')
|
||||||
strcat(p,"index.html");
|
strcat(p,"index.html");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* if a directory, do the index thang */
|
/* if a directory, do the index thang */
|
||||||
if (stat(p,&st_buf) < 0)
|
if (stat(p,&st_buf) < 0)
|
||||||
@@ -1382,7 +1646,13 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
}
|
}
|
||||||
if (S_ISDIR(st_buf.st_mode))
|
if (S_ISDIR(st_buf.st_mode))
|
||||||
{
|
{
|
||||||
|
#if 0 /* must check buffer size */
|
||||||
strcat(p,"/index.html");
|
strcat(p,"/index.html");
|
||||||
|
#else
|
||||||
|
BIO_puts(io,text);
|
||||||
|
BIO_printf(io,"'%s' is a directory\r\n",p);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((file=BIO_new_file(p,"r")) == NULL)
|
if ((file=BIO_new_file(p,"r")) == NULL)
|
||||||
@@ -1396,6 +1666,8 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
if (!s_quiet)
|
if (!s_quiet)
|
||||||
BIO_printf(bio_err,"FILE:%s\n",p);
|
BIO_printf(bio_err,"FILE:%s\n",p);
|
||||||
|
|
||||||
|
if (www == 2)
|
||||||
|
{
|
||||||
i=strlen(p);
|
i=strlen(p);
|
||||||
if ( ((i > 5) && (strcmp(&(p[i-5]),".html") == 0)) ||
|
if ( ((i > 5) && (strcmp(&(p[i-5]),".html") == 0)) ||
|
||||||
((i > 4) && (strcmp(&(p[i-4]),".php") == 0)) ||
|
((i > 4) && (strcmp(&(p[i-4]),".php") == 0)) ||
|
||||||
@@ -1403,6 +1675,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
|
|||||||
BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n");
|
BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n");
|
||||||
else
|
else
|
||||||
BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n");
|
BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n");
|
||||||
|
}
|
||||||
/* send the file */
|
/* send the file */
|
||||||
total_bytes=0;
|
total_bytes=0;
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -1474,13 +1747,13 @@ err:
|
|||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
BIO_printf(bio_s_out,"ACCEPT\n");
|
BIO_printf(bio_s_out,"ACCEPT\n");
|
||||||
|
|
||||||
if (buf != NULL) Free(buf);
|
if (buf != NULL) OPENSSL_free(buf);
|
||||||
if (io != NULL) BIO_free_all(io);
|
if (io != NULL) BIO_free_all(io);
|
||||||
/* if (ssl_bio != NULL) BIO_free(ssl_bio);*/
|
/* if (ssl_bio != NULL) BIO_free(ssl_bio);*/
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
|
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
|
||||||
{
|
{
|
||||||
static RSA *rsa_tmp=NULL;
|
static RSA *rsa_tmp=NULL;
|
||||||
@@ -1502,3 +1775,26 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
|
|||||||
return(rsa_tmp);
|
return(rsa_tmp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MAX_SESSION_ID_ATTEMPTS 10
|
||||||
|
static int generate_session_id(const SSL *ssl, unsigned char *id,
|
||||||
|
unsigned int *id_len)
|
||||||
|
{
|
||||||
|
unsigned int count = 0;
|
||||||
|
do {
|
||||||
|
RAND_pseudo_bytes(id, *id_len);
|
||||||
|
/* Prefix the session_id with the required prefix. NB: If our
|
||||||
|
* prefix is too long, clip it - but there will be worse effects
|
||||||
|
* anyway, eg. the server could only possibly create 1 session
|
||||||
|
* ID (ie. the prefix!) so all future session negotiations will
|
||||||
|
* fail due to conflicts. */
|
||||||
|
memcpy(id, session_id_prefix,
|
||||||
|
(strlen(session_id_prefix) < *id_len) ?
|
||||||
|
strlen(session_id_prefix) : *id_len);
|
||||||
|
}
|
||||||
|
while(SSL_has_matching_session_id(ssl, id, *id_len) &&
|
||||||
|
(++count < MAX_SESSION_ID_ATTEMPTS));
|
||||||
|
if(count >= MAX_SESSION_ID_ATTEMPTS)
|
||||||
|
return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
recursive header file inclusion, resulting in the compiler complaining
|
recursive header file inclusion, resulting in the compiler complaining
|
||||||
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
|
||||||
is needed to have fileno() declared correctly... So let's define u_int */
|
is needed to have fileno() declared correctly... So let's define u_int */
|
||||||
#if defined(VMS) && defined(__DECC) && !defined(__U_INT)
|
#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__U_INT)
|
||||||
#define __U_INT
|
#define __U_INT
|
||||||
typedef unsigned int u_int;
|
typedef unsigned int u_int;
|
||||||
#endif
|
#endif
|
||||||
@@ -79,28 +79,36 @@ typedef unsigned int u_int;
|
|||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
static struct hostent *GetHostByName(char *name);
|
#ifdef FLAT_INC
|
||||||
#ifdef WINDOWS
|
#include "e_os.h"
|
||||||
static void sock_cleanup(void);
|
#else
|
||||||
|
#include "../e_os.h"
|
||||||
#endif
|
#endif
|
||||||
static int sock_init(void);
|
|
||||||
|
#ifndef OPENSSL_NO_SOCK
|
||||||
|
|
||||||
|
static struct hostent *GetHostByName(char *name);
|
||||||
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
|
static void ssl_sock_cleanup(void);
|
||||||
|
#endif
|
||||||
|
static int ssl_sock_init(void);
|
||||||
static int init_client_ip(int *sock,unsigned char ip[4], int port);
|
static int init_client_ip(int *sock,unsigned char ip[4], int port);
|
||||||
static int init_server(int *sock, int port);
|
static int init_server(int *sock, int port);
|
||||||
static int init_server_long(int *sock, int port,char *ip);
|
static int init_server_long(int *sock, int port,char *ip);
|
||||||
static int do_accept(int acc_sock, int *sock, char **host);
|
static int do_accept(int acc_sock, int *sock, char **host);
|
||||||
static int host_ip(char *str, unsigned char ip[4]);
|
static int host_ip(char *str, unsigned char ip[4]);
|
||||||
|
|
||||||
#ifdef WIN16
|
#ifdef OPENSSL_SYS_WIN16
|
||||||
#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
|
#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
|
||||||
#else
|
#else
|
||||||
#define SOCKET_PROTOCOL IPPROTO_TCP
|
#define SOCKET_PROTOCOL IPPROTO_TCP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
static struct WSAData wsa_state;
|
static struct WSAData wsa_state;
|
||||||
static int wsa_init_done=0;
|
static int wsa_init_done=0;
|
||||||
|
|
||||||
#ifdef WIN16
|
#ifdef OPENSSL_SYS_WIN16
|
||||||
static HWND topWnd=0;
|
static HWND topWnd=0;
|
||||||
static FARPROC lpTopWndProc=NULL;
|
static FARPROC lpTopWndProc=NULL;
|
||||||
static FARPROC lpTopHookProc=NULL;
|
static FARPROC lpTopHookProc=NULL;
|
||||||
@@ -116,7 +124,7 @@ static LONG FAR PASCAL topHookProc(HWND hwnd, UINT message, WPARAM wParam,
|
|||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopWndProc);
|
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopWndProc);
|
||||||
sock_cleanup();
|
ssl_sock_cleanup();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,30 +137,38 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* WIN32 */
|
#endif /* OPENSSL_SYS_WIN32 */
|
||||||
#endif /* WINDOWS */
|
#endif /* OPENSSL_SYS_WINDOWS */
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
static void sock_cleanup(void)
|
static void ssl_sock_cleanup(void)
|
||||||
{
|
{
|
||||||
if (wsa_init_done)
|
if (wsa_init_done)
|
||||||
{
|
{
|
||||||
wsa_init_done=0;
|
wsa_init_done=0;
|
||||||
|
#ifndef OPENSSL_SYS_WINCE
|
||||||
WSACancelBlockingCall();
|
WSACancelBlockingCall();
|
||||||
|
#endif
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int sock_init(void)
|
static int ssl_sock_init(void)
|
||||||
{
|
{
|
||||||
#ifdef WINDOWS
|
#ifdef WATT32
|
||||||
|
extern int _watt_do_exit;
|
||||||
|
_watt_do_exit = 0;
|
||||||
|
dbug_init();
|
||||||
|
if (sock_init())
|
||||||
|
return (0);
|
||||||
|
#elif defined(OPENSSL_SYS_WINDOWS)
|
||||||
if (!wsa_init_done)
|
if (!wsa_init_done)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
#ifdef SIGINT
|
#ifdef SIGINT
|
||||||
signal(SIGINT,(void (*)(int))sock_cleanup);
|
signal(SIGINT,(void (*)(int))ssl_sock_cleanup);
|
||||||
#endif
|
#endif
|
||||||
wsa_init_done=1;
|
wsa_init_done=1;
|
||||||
memset(&wsa_state,0,sizeof(wsa_state));
|
memset(&wsa_state,0,sizeof(wsa_state));
|
||||||
@@ -163,15 +179,15 @@ static int sock_init(void)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN16
|
#ifdef OPENSSL_SYS_WIN16
|
||||||
EnumTaskWindows(GetCurrentTask(),enumproc,0L);
|
EnumTaskWindows(GetCurrentTask(),enumproc,0L);
|
||||||
lpTopWndProc=(FARPROC)GetWindowLong(topWnd,GWL_WNDPROC);
|
lpTopWndProc=(FARPROC)GetWindowLong(topWnd,GWL_WNDPROC);
|
||||||
lpTopHookProc=MakeProcInstance((FARPROC)topHookProc,_hInstance);
|
lpTopHookProc=MakeProcInstance((FARPROC)topHookProc,_hInstance);
|
||||||
|
|
||||||
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
|
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
|
||||||
#endif /* WIN16 */
|
#endif /* OPENSSL_SYS_WIN16 */
|
||||||
}
|
}
|
||||||
#endif /* WINDOWS */
|
#endif /* OPENSSL_SYS_WINDOWS */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,7 +210,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port)
|
|||||||
struct sockaddr_in them;
|
struct sockaddr_in them;
|
||||||
int s,i;
|
int s,i;
|
||||||
|
|
||||||
if (!sock_init()) return(0);
|
if (!ssl_sock_init()) return(0);
|
||||||
|
|
||||||
memset((char *)&them,0,sizeof(them));
|
memset((char *)&them,0,sizeof(them));
|
||||||
them.sin_family=AF_INET;
|
them.sin_family=AF_INET;
|
||||||
@@ -209,9 +225,11 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port)
|
|||||||
s=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
|
s=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
|
||||||
if (s == INVALID_SOCKET) { perror("socket"); return(0); }
|
if (s == INVALID_SOCKET) { perror("socket"); return(0); }
|
||||||
|
|
||||||
|
#ifndef OPENSSL_SYS_MPE
|
||||||
i=0;
|
i=0;
|
||||||
i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
|
i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
|
||||||
if (i < 0) { perror("keepalive"); return(0); }
|
if (i < 0) { perror("keepalive"); return(0); }
|
||||||
|
#endif
|
||||||
|
|
||||||
if (connect(s,(struct sockaddr *)&them,sizeof(them)) == -1)
|
if (connect(s,(struct sockaddr *)&them,sizeof(them)) == -1)
|
||||||
{ close(s); perror("connect"); return(0); }
|
{ close(s); perror("connect"); return(0); }
|
||||||
@@ -241,7 +259,7 @@ int do_server(int port, int *ret, int (*cb)(), char *context)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
i=(*cb)(name,sock, context);
|
i=(*cb)(name,sock, context);
|
||||||
if (name != NULL) Free(name);
|
if (name != NULL) OPENSSL_free(name);
|
||||||
SHUTDOWN2(sock);
|
SHUTDOWN2(sock);
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
{
|
{
|
||||||
@@ -257,7 +275,7 @@ static int init_server_long(int *sock, int port, char *ip)
|
|||||||
struct sockaddr_in server;
|
struct sockaddr_in server;
|
||||||
int s= -1,i;
|
int s= -1,i;
|
||||||
|
|
||||||
if (!sock_init()) return(0);
|
if (!ssl_sock_init()) return(0);
|
||||||
|
|
||||||
memset((char *)&server,0,sizeof(server));
|
memset((char *)&server,0,sizeof(server));
|
||||||
server.sin_family=AF_INET;
|
server.sin_family=AF_INET;
|
||||||
@@ -283,7 +301,7 @@ static int init_server_long(int *sock, int port, char *ip)
|
|||||||
#endif
|
#endif
|
||||||
if (bind(s,(struct sockaddr *)&server,sizeof(server)) == -1)
|
if (bind(s,(struct sockaddr *)&server,sizeof(server)) == -1)
|
||||||
{
|
{
|
||||||
#ifndef WINDOWS
|
#ifndef OPENSSL_SYS_WINDOWS
|
||||||
perror("bind");
|
perror("bind");
|
||||||
#endif
|
#endif
|
||||||
goto err;
|
goto err;
|
||||||
@@ -314,9 +332,9 @@ static int do_accept(int acc_sock, int *sock, char **host)
|
|||||||
int len;
|
int len;
|
||||||
/* struct linger ling; */
|
/* struct linger ling; */
|
||||||
|
|
||||||
if (!sock_init()) return(0);
|
if (!ssl_sock_init()) return(0);
|
||||||
|
|
||||||
#ifndef WINDOWS
|
#ifndef OPENSSL_SYS_WINDOWS
|
||||||
redoit:
|
redoit:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -330,7 +348,7 @@ redoit:
|
|||||||
ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
|
ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
|
||||||
if (ret == INVALID_SOCKET)
|
if (ret == INVALID_SOCKET)
|
||||||
{
|
{
|
||||||
#ifdef WINDOWS
|
#ifdef OPENSSL_SYS_WINDOWS
|
||||||
i=WSAGetLastError();
|
i=WSAGetLastError();
|
||||||
BIO_printf(bio_err,"accept error %d\n",i);
|
BIO_printf(bio_err,"accept error %d\n",i);
|
||||||
#else
|
#else
|
||||||
@@ -372,9 +390,9 @@ redoit:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((*host=(char *)Malloc(strlen(h1->h_name)+1)) == NULL)
|
if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
|
||||||
{
|
{
|
||||||
perror("Malloc");
|
perror("OPENSSL_malloc");
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
strcpy(*host,h1->h_name);
|
strcpy(*host,h1->h_name);
|
||||||
@@ -444,7 +462,7 @@ static int host_ip(char *str, unsigned char ip[4])
|
|||||||
{ /* do a gethostbyname */
|
{ /* do a gethostbyname */
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
|
|
||||||
if (!sock_init()) return(0);
|
if (!ssl_sock_init()) return(0);
|
||||||
|
|
||||||
he=GetHostByName(str);
|
he=GetHostByName(str);
|
||||||
if (he == NULL)
|
if (he == NULL)
|
||||||
@@ -525,9 +543,12 @@ static struct hostent *GetHostByName(char *name)
|
|||||||
ret=gethostbyname(name);
|
ret=gethostbyname(name);
|
||||||
if (ret == NULL) return(NULL);
|
if (ret == NULL) return(NULL);
|
||||||
/* else add to cache */
|
/* else add to cache */
|
||||||
strncpy(ghbn_cache[lowi].name,name,128);
|
if(strlen(name) < sizeof ghbn_cache[0].name)
|
||||||
|
{
|
||||||
|
strcpy(ghbn_cache[lowi].name,name);
|
||||||
memcpy((char *)&(ghbn_cache[lowi].ent),ret,sizeof(struct hostent));
|
memcpy((char *)&(ghbn_cache[lowi].ent),ret,sizeof(struct hostent));
|
||||||
ghbn_cache[lowi].order=ghbn_miss+ghbn_hits;
|
ghbn_cache[lowi].order=ghbn_miss+ghbn_hits;
|
||||||
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -538,3 +559,5 @@ static struct hostent *GetHostByName(char *name)
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -67,22 +67,25 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef NO_STDIO
|
#define USE_SOCKETS
|
||||||
|
#include "apps.h"
|
||||||
|
#ifdef OPENSSL_NO_STDIO
|
||||||
#define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
#define USE_SOCKETS
|
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include "apps.h"
|
|
||||||
#include "s_apps.h"
|
#include "s_apps.h"
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#ifdef WIN32_STUFF
|
#ifdef WIN32_STUFF
|
||||||
#include "winmain.h"
|
#include "winmain.h"
|
||||||
#include "wintext.h"
|
#include "wintext.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(OPENSSL_SYS_MSDOS)
|
||||||
|
#include OPENSSL_UNISTD
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
|
#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
|
||||||
#define TIMES
|
#define TIMES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -98,18 +101,14 @@
|
|||||||
The __TMS macro will show if it was. If it wasn't defined, we should
|
The __TMS macro will show if it was. If it wasn't defined, we should
|
||||||
undefine TIMES, since that tells the rest of the program how things
|
undefine TIMES, since that tells the rest of the program how things
|
||||||
should be handled. -- Richard Levitte */
|
should be handled. -- Richard Levitte */
|
||||||
#if defined(VMS) && defined(__DECC) && !defined(__TMS)
|
#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS)
|
||||||
#undef TIMES
|
#undef TIMES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TIMES
|
#if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS)
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _AIX
|
|
||||||
#include <sys/select.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(sun) || defined(__ultrix)
|
#if defined(sun) || defined(__ultrix)
|
||||||
#define _POSIX_SOURCE
|
#define _POSIX_SOURCE
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -119,12 +118,20 @@
|
|||||||
/* The following if from times(3) man page. It may need to be changed
|
/* The following if from times(3) man page. It may need to be changed
|
||||||
*/
|
*/
|
||||||
#ifndef HZ
|
#ifndef HZ
|
||||||
|
# ifdef _SC_CLK_TCK
|
||||||
|
# define HZ ((double)sysconf(_SC_CLK_TCK))
|
||||||
|
# else
|
||||||
# ifndef CLK_TCK
|
# ifndef CLK_TCK
|
||||||
|
# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
|
||||||
# define HZ 100.0
|
# define HZ 100.0
|
||||||
|
# else /* _BSD_CLK_TCK_ */
|
||||||
|
# define HZ ((double)_BSD_CLK_TCK_)
|
||||||
|
# endif
|
||||||
# else /* CLK_TCK */
|
# else /* CLK_TCK */
|
||||||
# define HZ ((double)CLK_TCK)
|
# define HZ ((double)CLK_TCK)
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG s_time_main
|
#define PROG s_time_main
|
||||||
@@ -139,6 +146,10 @@
|
|||||||
#undef BUFSIZZ
|
#undef BUFSIZZ
|
||||||
#define BUFSIZZ 1024*10
|
#define BUFSIZZ 1024*10
|
||||||
|
|
||||||
|
#define MYBUFSIZ 1024*8
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
#undef max
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
|
|
||||||
@@ -174,7 +185,7 @@ static int perform=0;
|
|||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
static int t_nbio=0;
|
static int t_nbio=0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
static int exitNow = 0; /* Set when it's time to exit main */
|
static int exitNow = 0; /* Set when it's time to exit main */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -198,7 +209,7 @@ static void s_time_init(void)
|
|||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
t_nbio=0;
|
t_nbio=0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
exitNow = 0; /* Set when it's time to exit main */
|
exitNow = 0; /* Set when it's time to exit main */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -311,14 +322,19 @@ static int parseArgs(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
s_www_path= *(++argv);
|
s_www_path= *(++argv);
|
||||||
|
if(strlen(s_www_path) > MYBUFSIZ-100)
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"-www option too long\n");
|
||||||
|
badop=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(strcmp(*argv,"-bugs") == 0)
|
else if(strcmp(*argv,"-bugs") == 0)
|
||||||
st_bugs=1;
|
st_bugs=1;
|
||||||
#ifndef NO_SSL2
|
#ifndef OPENSSL_NO_SSL2
|
||||||
else if(strcmp(*argv,"-ssl2") == 0)
|
else if(strcmp(*argv,"-ssl2") == 0)
|
||||||
s_time_meth=SSLv2_client_method();
|
s_time_meth=SSLv2_client_method();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SSL3
|
#ifndef OPENSSL_NO_SSL3
|
||||||
else if(strcmp(*argv,"-ssl3") == 0)
|
else if(strcmp(*argv,"-ssl3") == 0)
|
||||||
s_time_meth=SSLv3_client_method();
|
s_time_meth=SSLv3_client_method();
|
||||||
#endif
|
#endif
|
||||||
@@ -368,6 +384,22 @@ static double tm_Time_F(int s)
|
|||||||
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ;
|
||||||
return((ret == 0.0)?1e-6:ret);
|
return((ret == 0.0)?1e-6:ret);
|
||||||
}
|
}
|
||||||
|
#elif defined(OPENSSL_SYS_VXWORKS)
|
||||||
|
{
|
||||||
|
static unsigned long tick_start, tick_end;
|
||||||
|
|
||||||
|
if( s == START )
|
||||||
|
{
|
||||||
|
tick_start = tickGet();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tick_end = tickGet();
|
||||||
|
ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
|
||||||
|
return((ret == 0.0)?1e-6:ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
#else /* !times() */
|
#else /* !times() */
|
||||||
static struct timeb tstart,tend;
|
static struct timeb tstart,tend;
|
||||||
long i;
|
long i;
|
||||||
@@ -406,11 +438,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
|
|
||||||
#if !defined(NO_SSL2) && !defined(NO_SSL3)
|
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||||
s_time_meth=SSLv23_client_method();
|
s_time_meth=SSLv23_client_method();
|
||||||
#elif !defined(NO_SSL3)
|
#elif !defined(OPENSSL_NO_SSL3)
|
||||||
s_time_meth=SSLv3_client_method();
|
s_time_meth=SSLv3_client_method();
|
||||||
#elif !defined(NO_SSL2)
|
#elif !defined(OPENSSL_NO_SSL2)
|
||||||
s_time_meth=SSLv2_client_method();
|
s_time_meth=SSLv2_client_method();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -443,7 +475,6 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if (tm_cipher == NULL ) {
|
if (tm_cipher == NULL ) {
|
||||||
fprintf( stderr, "No CIPHER specified\n" );
|
fprintf( stderr, "No CIPHER specified\n" );
|
||||||
/* EXIT(1); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(perform & 1)) goto next;
|
if (!(perform & 1)) goto next;
|
||||||
@@ -456,7 +487,7 @@ int MAIN(int argc, char **argv)
|
|||||||
tm_Time_F(START);
|
tm_Time_F(START);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (finishtime < time(NULL)) break;
|
if (finishtime < (long)time(NULL)) break;
|
||||||
#ifdef WIN32_STUFF
|
#ifdef WIN32_STUFF
|
||||||
|
|
||||||
if( flushWinMsgs(0) == -1 )
|
if( flushWinMsgs(0) == -1 )
|
||||||
@@ -507,9 +538,9 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
totalTime += tm_Time_F(STOP); /* Add the time for this iteration */
|
totalTime += tm_Time_F(STOP); /* Add the time for this iteration */
|
||||||
|
|
||||||
i=(int)(time(NULL)-finishtime+maxTime);
|
i=(int)((long)time(NULL)-finishtime+maxTime);
|
||||||
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
|
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
|
||||||
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,time(NULL)-finishtime+maxTime,bytes_read/nConn);
|
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,(long)time(NULL)-finishtime+maxTime,bytes_read/nConn);
|
||||||
|
|
||||||
/* Now loop and time connections using the same session id over and over */
|
/* Now loop and time connections using the same session id over and over */
|
||||||
|
|
||||||
@@ -541,7 +572,7 @@ next:
|
|||||||
nConn = 0;
|
nConn = 0;
|
||||||
totalTime = 0.0;
|
totalTime = 0.0;
|
||||||
|
|
||||||
finishtime=time(NULL)+maxTime;
|
finishtime=(long)time(NULL)+maxTime;
|
||||||
|
|
||||||
printf( "starting\n" );
|
printf( "starting\n" );
|
||||||
bytes_read=0;
|
bytes_read=0;
|
||||||
@@ -549,7 +580,7 @@ next:
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (finishtime < time(NULL)) break;
|
if (finishtime < (long)time(NULL)) break;
|
||||||
|
|
||||||
#ifdef WIN32_STUFF
|
#ifdef WIN32_STUFF
|
||||||
if( flushWinMsgs(0) == -1 )
|
if( flushWinMsgs(0) == -1 )
|
||||||
@@ -599,7 +630,7 @@ next:
|
|||||||
|
|
||||||
|
|
||||||
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
|
printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);
|
||||||
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,time(NULL)-finishtime+maxTime,bytes_read/nConn);
|
printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,(long)time(NULL)-finishtime+maxTime,bytes_read/nConn);
|
||||||
|
|
||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
@@ -610,7 +641,8 @@ end:
|
|||||||
SSL_CTX_free(tm_ctx);
|
SSL_CTX_free(tm_ctx);
|
||||||
tm_ctx=NULL;
|
tm_ctx=NULL;
|
||||||
}
|
}
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||||
subject= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (512 bit)
|
subject= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (512 bit)
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIB6TCCAVICAQQwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
MIIB6TCCAVICAQYwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
||||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
||||||
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTgwNjI5MjM1MjQwWhcNMDAwNjI4
|
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNMDAxMDE2MjIzMTAzWhcNMDMwMTE0
|
||||||
MjM1MjQwWjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
MjIzMTAzWjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||||
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0IGNl
|
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0IGNl
|
||||||
cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8SMVIP
|
cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8SMVIP
|
||||||
Fe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8Ey2//
|
Fe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8Ey2//
|
||||||
Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCVvvfkGSe2GHgDFfmOua4Isjb9
|
Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCT0grFQeZaqYb5EYfk20XixZV4
|
||||||
JVhImWMASiOClkZlMESDJjsszg/6+d/W+8TrbObhazpl95FivXBVucbj9dudh7AO
|
GmyAbXMftG1Eo7qGiMhYzRwGNWxEYojf5PZkYZXvSqZ/ZXHXa4g59jK/rJNnaVGM
|
||||||
IZu1h1MAPlyknc9Ud816vz3FejB4qqUoaXjnlkrIgEbr/un7jSS86WOe0hRhwHkJ
|
k+xIX8mxQvlV0n5O9PIha5BX5teZnkHKgL8aKKLKW1BK7YTngsfSzzaeame5iKfz
|
||||||
FUGcPZf9ND22Etc+AQ==
|
itAE+OjGF+PFKbwX8Q==
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD
|
MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
bad:
|
bad:
|
||||||
for (pp=sess_id_usage; (*pp != NULL); pp++)
|
for (pp=sess_id_usage; (*pp != NULL); pp++)
|
||||||
BIO_printf(bio_err,*pp);
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +206,15 @@ bad:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -262,9 +270,10 @@ bad:
|
|||||||
}
|
}
|
||||||
ret=0;
|
ret=0;
|
||||||
end:
|
end:
|
||||||
if (out != NULL) BIO_free(out);
|
if (out != NULL) BIO_free_all(out);
|
||||||
if (x != NULL) SSL_SESSION_free(x);
|
if (x != NULL) SSL_SESSION_free(x);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SSL_SESSION *load_sess_id(char *infile, int format)
|
static SSL_SESSION *load_sess_id(char *infile, int format)
|
||||||
|
|||||||
252
apps/smime.c
252
apps/smime.c
@@ -67,10 +67,6 @@
|
|||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG smime_main
|
#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);
|
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
||||||
|
|
||||||
#define SMIME_OP 0x10
|
#define SMIME_OP 0x10
|
||||||
@@ -84,14 +80,15 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int operation = 0;
|
int operation = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
char **args;
|
char **args;
|
||||||
char *inmode = "r", *outmode = "w";
|
char *inmode = "r", *outmode = "w";
|
||||||
char *infile = NULL, *outfile = NULL;
|
char *infile = NULL, *outfile = NULL;
|
||||||
char *signerfile = NULL, *recipfile = NULL;
|
char *signerfile = NULL, *recipfile = NULL;
|
||||||
char *certfile = NULL, *keyfile = NULL;
|
char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
|
||||||
EVP_CIPHER *cipher = NULL;
|
const EVP_CIPHER *cipher = NULL;
|
||||||
PKCS7 *p7 = NULL;
|
PKCS7 *p7 = NULL;
|
||||||
X509_STORE *store = NULL;
|
X509_STORE *store = NULL;
|
||||||
X509 *cert = NULL, *recip = NULL, *signer = NULL;
|
X509 *cert = NULL, *recip = NULL, *signer = NULL;
|
||||||
@@ -99,35 +96,55 @@ int MAIN(int argc, char **argv)
|
|||||||
STACK_OF(X509) *encerts = NULL, *other = NULL;
|
STACK_OF(X509) *encerts = NULL, *other = NULL;
|
||||||
BIO *in = NULL, *out = NULL, *indata = NULL;
|
BIO *in = NULL, *out = NULL, *indata = NULL;
|
||||||
int badarg = 0;
|
int badarg = 0;
|
||||||
int flags = PKCS7_DETACHED;
|
int flags = PKCS7_DETACHED, store_flags = 0;
|
||||||
char *to = NULL, *from = NULL, *subject = NULL;
|
char *to = NULL, *from = NULL, *subject = NULL;
|
||||||
char *CAfile = NULL, *CApath = NULL;
|
char *CAfile = NULL, *CApath = NULL;
|
||||||
char *passargin = NULL, *passin = NULL;
|
char *passargin = NULL, *passin = NULL;
|
||||||
char *inrand = NULL;
|
char *inrand = NULL;
|
||||||
int need_rand = 0;
|
int need_rand = 0;
|
||||||
args = argv + 1;
|
int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
|
||||||
|
int keyform = FORMAT_PEM;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
|
args = argv + 1;
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
|
apps_startup();
|
||||||
|
|
||||||
|
if (bio_err == NULL)
|
||||||
|
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
||||||
|
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
while (!badarg && *args && *args[0] == '-') {
|
while (!badarg && *args && *args[0] == '-') {
|
||||||
if (!strcmp (*args, "-encrypt")) operation = SMIME_ENCRYPT;
|
if (!strcmp (*args, "-encrypt")) operation = SMIME_ENCRYPT;
|
||||||
else if (!strcmp (*args, "-decrypt")) operation = SMIME_DECRYPT;
|
else if (!strcmp (*args, "-decrypt")) operation = SMIME_DECRYPT;
|
||||||
else if (!strcmp (*args, "-sign")) operation = SMIME_SIGN;
|
else if (!strcmp (*args, "-sign")) operation = SMIME_SIGN;
|
||||||
else if (!strcmp (*args, "-verify")) operation = SMIME_VERIFY;
|
else if (!strcmp (*args, "-verify")) operation = SMIME_VERIFY;
|
||||||
else if (!strcmp (*args, "-pk7out")) operation = SMIME_PK7OUT;
|
else if (!strcmp (*args, "-pk7out")) operation = SMIME_PK7OUT;
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
else if (!strcmp (*args, "-des3"))
|
else if (!strcmp (*args, "-des3"))
|
||||||
cipher = EVP_des_ede3_cbc();
|
cipher = EVP_des_ede3_cbc();
|
||||||
else if (!strcmp (*args, "-des"))
|
else if (!strcmp (*args, "-des"))
|
||||||
cipher = EVP_des_cbc();
|
cipher = EVP_des_cbc();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
else if (!strcmp (*args, "-rc2-40"))
|
else if (!strcmp (*args, "-rc2-40"))
|
||||||
cipher = EVP_rc2_40_cbc();
|
cipher = EVP_rc2_40_cbc();
|
||||||
else if (!strcmp (*args, "-rc2-128"))
|
else if (!strcmp (*args, "-rc2-128"))
|
||||||
cipher = EVP_rc2_cbc();
|
cipher = EVP_rc2_cbc();
|
||||||
else if (!strcmp (*args, "-rc2-64"))
|
else if (!strcmp (*args, "-rc2-64"))
|
||||||
cipher = EVP_rc2_64_cbc();
|
cipher = EVP_rc2_64_cbc();
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
else if (!strcmp(*args,"-aes128"))
|
||||||
|
cipher = EVP_aes_128_cbc();
|
||||||
|
else if (!strcmp(*args,"-aes192"))
|
||||||
|
cipher = EVP_aes_192_cbc();
|
||||||
|
else if (!strcmp(*args,"-aes256"))
|
||||||
|
cipher = EVP_aes_256_cbc();
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp (*args, "-text"))
|
else if (!strcmp (*args, "-text"))
|
||||||
flags |= PKCS7_TEXT;
|
flags |= PKCS7_TEXT;
|
||||||
@@ -143,16 +160,27 @@ int MAIN(int argc, char **argv)
|
|||||||
flags |= PKCS7_NOATTR;
|
flags |= PKCS7_NOATTR;
|
||||||
else if (!strcmp (*args, "-nodetach"))
|
else if (!strcmp (*args, "-nodetach"))
|
||||||
flags &= ~PKCS7_DETACHED;
|
flags &= ~PKCS7_DETACHED;
|
||||||
|
else if (!strcmp (*args, "-nosmimecap"))
|
||||||
|
flags |= PKCS7_NOSMIMECAP;
|
||||||
else if (!strcmp (*args, "-binary"))
|
else if (!strcmp (*args, "-binary"))
|
||||||
flags |= PKCS7_BINARY;
|
flags |= PKCS7_BINARY;
|
||||||
else if (!strcmp (*args, "-nosigs"))
|
else if (!strcmp (*args, "-nosigs"))
|
||||||
flags |= PKCS7_NOSIGS;
|
flags |= PKCS7_NOSIGS;
|
||||||
|
else if (!strcmp (*args, "-crl_check"))
|
||||||
|
store_flags |= X509_V_FLAG_CRL_CHECK;
|
||||||
|
else if (!strcmp (*args, "-crl_check_all"))
|
||||||
|
store_flags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||||
else if (!strcmp(*args,"-rand")) {
|
else if (!strcmp(*args,"-rand")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
inrand = *args;
|
inrand = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
need_rand = 1;
|
need_rand = 1;
|
||||||
|
} else if (!strcmp(*args,"-engine")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
engine = *args;
|
||||||
|
} else badarg = 1;
|
||||||
} else if (!strcmp(*args,"-passin")) {
|
} else if (!strcmp(*args,"-passin")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
@@ -188,6 +216,11 @@ int MAIN(int argc, char **argv)
|
|||||||
args++;
|
args++;
|
||||||
keyfile = *args;
|
keyfile = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp (*args, "-keyform")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
keyform = str2fmt(*args);
|
||||||
|
} else badarg = 1;
|
||||||
} else if (!strcmp (*args, "-certfile")) {
|
} else if (!strcmp (*args, "-certfile")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
@@ -208,11 +241,26 @@ int MAIN(int argc, char **argv)
|
|||||||
args++;
|
args++;
|
||||||
infile = *args;
|
infile = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp (*args, "-inform")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
informat = str2fmt(*args);
|
||||||
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp (*args, "-outform")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
outformat = str2fmt(*args);
|
||||||
|
} else badarg = 1;
|
||||||
} else if (!strcmp (*args, "-out")) {
|
} else if (!strcmp (*args, "-out")) {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
args++;
|
args++;
|
||||||
outfile = *args;
|
outfile = *args;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
|
} else if (!strcmp (*args, "-content")) {
|
||||||
|
if (args[1]) {
|
||||||
|
args++;
|
||||||
|
contfile = *args;
|
||||||
|
} else badarg = 1;
|
||||||
} else badarg = 1;
|
} else badarg = 1;
|
||||||
args++;
|
args++;
|
||||||
}
|
}
|
||||||
@@ -244,14 +292,18 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-sign sign message\n");
|
BIO_printf (bio_err, "-sign sign message\n");
|
||||||
BIO_printf (bio_err, "-verify verify signed message\n");
|
BIO_printf (bio_err, "-verify verify signed message\n");
|
||||||
BIO_printf (bio_err, "-pk7out output PKCS#7 structure\n");
|
BIO_printf (bio_err, "-pk7out output PKCS#7 structure\n");
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
BIO_printf (bio_err, "-des3 encrypt with triple DES\n");
|
BIO_printf (bio_err, "-des3 encrypt with triple DES\n");
|
||||||
BIO_printf (bio_err, "-des encrypt with DES\n");
|
BIO_printf (bio_err, "-des encrypt with DES\n");
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
BIO_printf (bio_err, "-rc2-40 encrypt with RC2-40 (default)\n");
|
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-64 encrypt with RC2-64\n");
|
||||||
BIO_printf (bio_err, "-rc2-128 encrypt with RC2-128\n");
|
BIO_printf (bio_err, "-rc2-128 encrypt with RC2-128\n");
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_AES
|
||||||
|
BIO_printf (bio_err, "-aes128, -aes192, -aes256\n");
|
||||||
|
BIO_printf (bio_err, " encrypt PEM output with cbc aes\n");
|
||||||
#endif
|
#endif
|
||||||
BIO_printf (bio_err, "-nointern don't search certificates in message for signer\n");
|
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, "-nosigs don't verify message signature\n");
|
||||||
@@ -264,14 +316,22 @@ int MAIN(int argc, char **argv)
|
|||||||
BIO_printf (bio_err, "-signer file signer certificate 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, "-recip file recipient certificate file for decryption\n");
|
||||||
BIO_printf (bio_err, "-in file input file\n");
|
BIO_printf (bio_err, "-in file input file\n");
|
||||||
|
BIO_printf (bio_err, "-inform arg input format SMIME (default), PEM or DER\n");
|
||||||
BIO_printf (bio_err, "-inkey file input private key (if not signer or recipient)\n");
|
BIO_printf (bio_err, "-inkey file input private key (if not signer or recipient)\n");
|
||||||
|
BIO_printf (bio_err, "-keyform arg input private key format (PEM or ENGINE)\n");
|
||||||
BIO_printf (bio_err, "-out file output file\n");
|
BIO_printf (bio_err, "-out file output file\n");
|
||||||
|
BIO_printf (bio_err, "-outform arg output format SMIME (default), PEM or DER\n");
|
||||||
|
BIO_printf (bio_err, "-content file supply or override content for detached signature\n");
|
||||||
BIO_printf (bio_err, "-to addr to address\n");
|
BIO_printf (bio_err, "-to addr to address\n");
|
||||||
BIO_printf (bio_err, "-from ad from address\n");
|
BIO_printf (bio_err, "-from ad from address\n");
|
||||||
BIO_printf (bio_err, "-subject s subject\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, "-text include or delete text MIME headers\n");
|
||||||
BIO_printf (bio_err, "-CApath dir trusted certificates directory\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, "-CAfile file trusted certificates file\n");
|
||||||
|
BIO_printf (bio_err, "-crl_check check revocation status of signer's certificate using CRLs\n");
|
||||||
|
BIO_printf (bio_err, "-crl_check_all check revocation status of signer's certificate chain using CRLs\n");
|
||||||
|
BIO_printf (bio_err, "-engine e use engine e, possibly a hardware device.\n");
|
||||||
|
BIO_printf (bio_err, "-passin arg input file pass phrase source\n");
|
||||||
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
BIO_printf(bio_err, "-rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
|
||||||
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
BIO_printf(bio_err, " load the file (or the files in the directory) into\n");
|
||||||
BIO_printf(bio_err, " the random number generator\n");
|
BIO_printf(bio_err, " the random number generator\n");
|
||||||
@@ -279,6 +339,8 @@ int MAIN(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
goto end;
|
goto end;
|
||||||
@@ -295,14 +357,17 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if(operation != SMIME_SIGN) flags &= ~PKCS7_DETACHED;
|
if(operation != SMIME_SIGN) flags &= ~PKCS7_DETACHED;
|
||||||
|
|
||||||
if(flags & PKCS7_BINARY) {
|
if(operation & SMIME_OP) {
|
||||||
if(operation & SMIME_OP) inmode = "rb";
|
if(flags & PKCS7_BINARY) inmode = "rb";
|
||||||
else outmode = "rb";
|
if(outformat == FORMAT_ASN1) outmode = "wb";
|
||||||
|
} else {
|
||||||
|
if(flags & PKCS7_BINARY) outmode = "wb";
|
||||||
|
if(informat == FORMAT_ASN1) inmode = "rb";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(operation == SMIME_ENCRYPT) {
|
if(operation == SMIME_ENCRYPT) {
|
||||||
if (!cipher) {
|
if (!cipher) {
|
||||||
#ifndef NO_RC2
|
#ifndef OPENSSL_NO_RC2
|
||||||
cipher = EVP_rc2_40_cbc();
|
cipher = EVP_rc2_40_cbc();
|
||||||
#else
|
#else
|
||||||
BIO_printf(bio_err, "No cipher selected\n");
|
BIO_printf(bio_err, "No cipher selected\n");
|
||||||
@@ -311,8 +376,11 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
encerts = sk_X509_new_null();
|
encerts = sk_X509_new_null();
|
||||||
while (*args) {
|
while (*args) {
|
||||||
if(!(cert = load_cert(*args))) {
|
if(!(cert = load_cert(bio_err,*args,FORMAT_PEM,
|
||||||
|
NULL, e, "recipient certificate file"))) {
|
||||||
|
#if 0 /* An appropriate message is already printed */
|
||||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", *args);
|
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", *args);
|
||||||
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
sk_X509_push(encerts, cert);
|
sk_X509_push(encerts, cert);
|
||||||
@@ -322,23 +390,32 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(signerfile && (operation == SMIME_SIGN)) {
|
if(signerfile && (operation == SMIME_SIGN)) {
|
||||||
if(!(signer = load_cert(signerfile))) {
|
if(!(signer = load_cert(bio_err,signerfile,FORMAT_PEM, NULL,
|
||||||
|
e, "signer certificate"))) {
|
||||||
|
#if 0 /* An appropri message has already been printed */
|
||||||
BIO_printf(bio_err, "Can't read signer certificate file %s\n", signerfile);
|
BIO_printf(bio_err, "Can't read signer certificate file %s\n", signerfile);
|
||||||
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(certfile) {
|
if(certfile) {
|
||||||
if(!(other = load_certs(certfile))) {
|
if(!(other = load_certs(bio_err,certfile,FORMAT_PEM, NULL,
|
||||||
|
e, "certificate file"))) {
|
||||||
|
#if 0 /* An appropriate message has already been printed */
|
||||||
BIO_printf(bio_err, "Can't read certificate file %s\n", certfile);
|
BIO_printf(bio_err, "Can't read certificate file %s\n", certfile);
|
||||||
|
#endif
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(recipfile && (operation == SMIME_DECRYPT)) {
|
if(recipfile && (operation == SMIME_DECRYPT)) {
|
||||||
if(!(recip = load_cert(recipfile))) {
|
if(!(recip = load_cert(bio_err,recipfile,FORMAT_PEM,NULL,
|
||||||
|
e, "recipient certificate file"))) {
|
||||||
|
#if 0 /* An appropriate message has alrady been printed */
|
||||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", recipfile);
|
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", recipfile);
|
||||||
|
#endif
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -351,9 +428,9 @@ int MAIN(int argc, char **argv)
|
|||||||
} else keyfile = NULL;
|
} else keyfile = NULL;
|
||||||
|
|
||||||
if(keyfile) {
|
if(keyfile) {
|
||||||
if(!(key = load_key(keyfile, passin))) {
|
key = load_key(bio_err, keyfile, keyform, 0, passin, e,
|
||||||
BIO_printf(bio_err, "Can't read recipient certificate file %s\n", keyfile);
|
"signing key file");
|
||||||
ERR_print_errors(bio_err);
|
if (!key) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,24 +449,55 @@ int MAIN(int argc, char **argv)
|
|||||||
"Can't open output file %s\n", outfile);
|
"Can't open output file %s\n", outfile);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
} else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if(operation == SMIME_VERIFY) {
|
if(operation == SMIME_VERIFY) {
|
||||||
if(!(store = setup_verify(CAfile, CApath))) goto end;
|
if(!(store = setup_verify(bio_err, CAfile, CApath))) goto end;
|
||||||
|
X509_STORE_set_flags(store, store_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ret = 3;
|
ret = 3;
|
||||||
|
|
||||||
if(operation == SMIME_ENCRYPT) {
|
if(operation == SMIME_ENCRYPT) {
|
||||||
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
p7 = PKCS7_encrypt(encerts, in, cipher, flags);
|
||||||
} else if(operation == SMIME_SIGN) {
|
} else if(operation == SMIME_SIGN) {
|
||||||
p7 = PKCS7_sign(signer, key, other, in, flags);
|
p7 = PKCS7_sign(signer, key, other, in, flags);
|
||||||
BIO_reset(in);
|
if (BIO_reset(in) != 0 && (flags & PKCS7_DETACHED)) {
|
||||||
|
BIO_printf(bio_err, "Can't rewind input file\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!(p7 = SMIME_read_PKCS7(in, &indata))) {
|
if(informat == FORMAT_SMIME)
|
||||||
|
p7 = SMIME_read_PKCS7(in, &indata);
|
||||||
|
else if(informat == FORMAT_PEM)
|
||||||
|
p7 = PEM_read_bio_PKCS7(in, NULL, NULL, NULL);
|
||||||
|
else if(informat == FORMAT_ASN1)
|
||||||
|
p7 = d2i_PKCS7_bio(in, NULL);
|
||||||
|
else {
|
||||||
|
BIO_printf(bio_err, "Bad input format for PKCS#7 file\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!p7) {
|
||||||
BIO_printf(bio_err, "Error reading S/MIME message\n");
|
BIO_printf(bio_err, "Error reading S/MIME message\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
if(contfile) {
|
||||||
|
BIO_free(indata);
|
||||||
|
if(!(indata = BIO_new_file(contfile, "rb"))) {
|
||||||
|
BIO_printf(bio_err, "Can't read content file %s\n", contfile);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!p7) {
|
if(!p7) {
|
||||||
@@ -406,9 +514,9 @@ int MAIN(int argc, char **argv)
|
|||||||
} else if(operation == SMIME_VERIFY) {
|
} else if(operation == SMIME_VERIFY) {
|
||||||
STACK_OF(X509) *signers;
|
STACK_OF(X509) *signers;
|
||||||
if(PKCS7_verify(p7, other, store, indata, out, flags)) {
|
if(PKCS7_verify(p7, other, store, indata, out, flags)) {
|
||||||
BIO_printf(bio_err, "Verification Successful\n");
|
BIO_printf(bio_err, "Verification successful\n");
|
||||||
} else {
|
} else {
|
||||||
BIO_printf(bio_err, "Verification Failure\n");
|
BIO_printf(bio_err, "Verification failure\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
signers = PKCS7_get0_signers(p7, other, flags);
|
signers = PKCS7_get0_signers(p7, other, flags);
|
||||||
@@ -425,7 +533,16 @@ int MAIN(int argc, char **argv)
|
|||||||
if(to) BIO_printf(out, "To: %s\n", to);
|
if(to) BIO_printf(out, "To: %s\n", to);
|
||||||
if(from) BIO_printf(out, "From: %s\n", from);
|
if(from) BIO_printf(out, "From: %s\n", from);
|
||||||
if(subject) BIO_printf(out, "Subject: %s\n", subject);
|
if(subject) BIO_printf(out, "Subject: %s\n", subject);
|
||||||
|
if(outformat == FORMAT_SMIME)
|
||||||
SMIME_write_PKCS7(out, p7, in, flags);
|
SMIME_write_PKCS7(out, p7, in, flags);
|
||||||
|
else if(outformat == FORMAT_PEM)
|
||||||
|
PEM_write_bio_PKCS7(out,p7);
|
||||||
|
else if(outformat == FORMAT_ASN1)
|
||||||
|
i2d_PKCS7_bio(out,p7);
|
||||||
|
else {
|
||||||
|
BIO_printf(bio_err, "Bad output format for PKCS#7 file\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
@@ -442,84 +559,11 @@ end:
|
|||||||
PKCS7_free(p7);
|
PKCS7_free(p7);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free(indata);
|
BIO_free(indata);
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
if(passin) Free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
return (ret);
|
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;
|
|
||||||
if(!(store = X509_STORE_new())) goto end;
|
|
||||||
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());
|
|
||||||
if (lookup == NULL) goto end;
|
|
||||||
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);
|
|
||||||
|
|
||||||
lookup=X509_STORE_add_lookup(store,X509_LOOKUP_hash_dir());
|
|
||||||
if (lookup == NULL) goto end;
|
|
||||||
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);
|
|
||||||
|
|
||||||
ERR_clear_error();
|
|
||||||
return store;
|
|
||||||
end:
|
|
||||||
X509_STORE_free(store);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int save_certs(char *signerfile, STACK_OF(X509) *signers)
|
static int save_certs(char *signerfile, STACK_OF(X509) *signers)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
1862
apps/speed.c
1862
apps/speed.c
File diff suppressed because it is too large
Load Diff
69
apps/spkac.c
69
apps/spkac.c
@@ -81,21 +81,26 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int i,badops=0, ret = 1;
|
int i,badops=0, ret = 1;
|
||||||
BIO *in = NULL,*out = NULL, *key = NULL;
|
BIO *in = NULL,*out = NULL;
|
||||||
int verify=0,noout=0,pubkey=0;
|
int verify=0,noout=0,pubkey=0;
|
||||||
char *infile = NULL,*outfile = NULL,*prog;
|
char *infile = NULL,*outfile = NULL,*prog;
|
||||||
char *passargin = NULL, *passin = NULL;
|
char *passargin = NULL, *passin = NULL;
|
||||||
char *spkac = "SPKAC", *spksect = "default", *spkstr = NULL;
|
char *spkac = "SPKAC", *spksect = "default", *spkstr = NULL;
|
||||||
char *challenge = NULL, *keyfile = NULL;
|
char *challenge = NULL, *keyfile = NULL;
|
||||||
LHASH *conf = NULL;
|
CONF *conf = NULL;
|
||||||
NETSCAPE_SPKI *spki = NULL;
|
NETSCAPE_SPKI *spki = NULL;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
if (!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
if (!bio_err) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
prog=argv[0];
|
prog=argv[0];
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
@@ -136,6 +141,11 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
spksect= *(++argv);
|
spksect= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-noout") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
noout=1;
|
noout=1;
|
||||||
else if (strcmp(*argv,"-pubkey") == 0)
|
else if (strcmp(*argv,"-pubkey") == 0)
|
||||||
@@ -161,6 +171,7 @@ bad:
|
|||||||
BIO_printf(bio_err," -noout don't print SPKAC\n");
|
BIO_printf(bio_err," -noout don't print SPKAC\n");
|
||||||
BIO_printf(bio_err," -pubkey output public key\n");
|
BIO_printf(bio_err," -pubkey output public key\n");
|
||||||
BIO_printf(bio_err," -verify verify SPKAC signature\n");
|
BIO_printf(bio_err," -verify verify SPKAC signature\n");
|
||||||
|
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,18 +181,13 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if(keyfile) {
|
if(keyfile) {
|
||||||
if(strcmp(keyfile, "-")) key = BIO_new_file(keyfile, "r");
|
pkey = load_key(bio_err,
|
||||||
else key = BIO_new_fp(stdin, BIO_NOCLOSE);
|
strcmp(keyfile, "-") ? keyfile : NULL,
|
||||||
if(!key) {
|
FORMAT_PEM, 1, passin, e, "private 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) {
|
if(!pkey) {
|
||||||
BIO_printf(bio_err, "Error reading private key\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
spki = NETSCAPE_SPKI_new();
|
spki = NETSCAPE_SPKI_new();
|
||||||
@@ -192,7 +198,15 @@ bad:
|
|||||||
spkstr = NETSCAPE_SPKI_b64_encode(spki);
|
spkstr = NETSCAPE_SPKI_b64_encode(spki);
|
||||||
|
|
||||||
if (outfile) out = BIO_new_file(outfile, "w");
|
if (outfile) out = BIO_new_file(outfile, "w");
|
||||||
else out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if(!out) {
|
if(!out) {
|
||||||
BIO_printf(bio_err, "Error opening output file\n");
|
BIO_printf(bio_err, "Error opening output file\n");
|
||||||
@@ -200,7 +214,7 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
BIO_printf(out, "SPKAC=%s\n", spkstr);
|
BIO_printf(out, "SPKAC=%s\n", spkstr);
|
||||||
Free(spkstr);
|
OPENSSL_free(spkstr);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -216,15 +230,16 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
conf = CONF_load_bio(NULL, in, NULL);
|
conf = NCONF_new(NULL);
|
||||||
|
i = NCONF_load_bio(conf, in, NULL);
|
||||||
|
|
||||||
if(!conf) {
|
if(!i) {
|
||||||
BIO_printf(bio_err, "Error parsing config file\n");
|
BIO_printf(bio_err, "Error parsing config file\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
spkstr = CONF_get_string(conf, spksect, spkac);
|
spkstr = NCONF_get_string(conf, spksect, spkac);
|
||||||
|
|
||||||
if(!spkstr) {
|
if(!spkstr) {
|
||||||
BIO_printf(bio_err, "Can't find SPKAC called \"%s\"\n", spkac);
|
BIO_printf(bio_err, "Can't find SPKAC called \"%s\"\n", spkac);
|
||||||
@@ -241,7 +256,15 @@ bad:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outfile) out = BIO_new_file(outfile, "w");
|
if (outfile) out = BIO_new_file(outfile, "w");
|
||||||
else out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
else {
|
||||||
|
out = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if(!out) {
|
if(!out) {
|
||||||
BIO_printf(bio_err, "Error opening output file\n");
|
BIO_printf(bio_err, "Error opening output file\n");
|
||||||
@@ -265,12 +288,12 @@ bad:
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
CONF_free(conf);
|
NCONF_free(conf);
|
||||||
NETSCAPE_SPKI_free(spki);
|
NETSCAPE_SPKI_free(spki);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
BIO_free(key);
|
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
if(passin) Free(passin);
|
if(passin) OPENSSL_free(passin);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
DSA *get_dsa512(void );
|
DSA *get_dsa512(void );
|
||||||
DSA *get_dsa1024(void );
|
DSA *get_dsa1024(void );
|
||||||
DSA *get_dsa2048(void );
|
DSA *get_dsa2048(void );
|
||||||
|
static unsigned char dsa512_priv[] = {
|
||||||
|
0x65,0xe5,0xc7,0x38,0x60,0x24,0xb5,0x89,0xd4,0x9c,0xeb,0x4c,
|
||||||
|
0x9c,0x1d,0x7a,0x22,0xbd,0xd1,0xc2,0xd2,
|
||||||
|
};
|
||||||
|
static unsigned char dsa512_pub[] = {
|
||||||
|
0x00,0x95,0xa7,0x0d,0xec,0x93,0x68,0xba,0x5f,0xf7,0x5f,0x07,
|
||||||
|
0xf2,0x3b,0xad,0x6b,0x01,0xdc,0xbe,0xec,0xde,0x04,0x7a,0x3a,
|
||||||
|
0x27,0xb3,0xec,0x49,0xfd,0x08,0x43,0x3d,0x7e,0xa8,0x2c,0x5e,
|
||||||
|
0x7b,0xbb,0xfc,0xf4,0x6e,0xeb,0x6c,0xb0,0x6e,0xf8,0x02,0x12,
|
||||||
|
0x8c,0x38,0x5d,0x83,0x56,0x7d,0xee,0x53,0x05,0x3e,0x24,0x84,
|
||||||
|
0xbe,0xba,0x0a,0x6b,0xc8,
|
||||||
|
};
|
||||||
static unsigned char dsa512_p[]={
|
static unsigned char dsa512_p[]={
|
||||||
0x9D,0x1B,0x69,0x8E,0x26,0xDB,0xF2,0x2B,0x11,0x70,0x19,0x86,
|
0x9D,0x1B,0x69,0x8E,0x26,0xDB,0xF2,0x2B,0x11,0x70,0x19,0x86,
|
||||||
0xF6,0x19,0xC8,0xF8,0x19,0xF2,0x18,0x53,0x94,0x46,0x06,0xD0,
|
0xF6,0x19,0xC8,0xF8,0x19,0xF2,0x18,0x53,0x94,0x46,0x06,0xD0,
|
||||||
@@ -29,14 +41,34 @@ DSA *get_dsa512()
|
|||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
|
|
||||||
if ((dsa=DSA_new()) == NULL) return(NULL);
|
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||||
|
dsa->priv_key=BN_bin2bn(dsa512_priv,sizeof(dsa512_priv),NULL);
|
||||||
|
dsa->pub_key=BN_bin2bn(dsa512_pub,sizeof(dsa512_pub),NULL);
|
||||||
dsa->p=BN_bin2bn(dsa512_p,sizeof(dsa512_p),NULL);
|
dsa->p=BN_bin2bn(dsa512_p,sizeof(dsa512_p),NULL);
|
||||||
dsa->q=BN_bin2bn(dsa512_q,sizeof(dsa512_q),NULL);
|
dsa->q=BN_bin2bn(dsa512_q,sizeof(dsa512_q),NULL);
|
||||||
dsa->g=BN_bin2bn(dsa512_g,sizeof(dsa512_g),NULL);
|
dsa->g=BN_bin2bn(dsa512_g,sizeof(dsa512_g),NULL);
|
||||||
if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
|
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||||
|
(dsa->q == NULL) || (dsa->g == NULL))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
return(dsa);
|
return(dsa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned char dsa1024_priv[]={
|
||||||
|
0x7d,0x21,0xda,0xbb,0x62,0x15,0x47,0x36,0x07,0x67,0x12,0xe8,
|
||||||
|
0x8c,0xaa,0x1c,0xcd,0x38,0x12,0x61,0x18,
|
||||||
|
};
|
||||||
|
static unsigned char dsa1024_pub[]={
|
||||||
|
0x3c,0x4e,0x9c,0x2a,0x7f,0x16,0xc1,0x25,0xeb,0xac,0x78,0x63,
|
||||||
|
0x90,0x14,0x8c,0x8b,0xf4,0x68,0x43,0x3c,0x2d,0xee,0x65,0x50,
|
||||||
|
0x7d,0x9c,0x8f,0x8c,0x8a,0x51,0xd6,0x11,0x2b,0x99,0xaf,0x1e,
|
||||||
|
0x90,0x97,0xb5,0xd3,0xa6,0x20,0x25,0xd6,0xfe,0x43,0x02,0xd5,
|
||||||
|
0x91,0x7d,0xa7,0x8c,0xdb,0xc9,0x85,0xa3,0x36,0x48,0xf7,0x68,
|
||||||
|
0xaa,0x60,0xb1,0xf7,0x05,0x68,0x3a,0xa3,0x3f,0xd3,0x19,0x82,
|
||||||
|
0xd8,0x82,0x7a,0x77,0xfb,0xef,0xf4,0x15,0x0a,0xeb,0x06,0x04,
|
||||||
|
0x7f,0x53,0x07,0x0c,0xbc,0xcb,0x2d,0x83,0xdb,0x3e,0xd1,0x28,
|
||||||
|
0xa5,0xa1,0x31,0xe0,0x67,0xfa,0x50,0xde,0x9b,0x07,0x83,0x7e,
|
||||||
|
0x2c,0x0b,0xc3,0x13,0x50,0x61,0xe5,0xad,0xbd,0x36,0xb8,0x97,
|
||||||
|
0x4e,0x40,0x7d,0xe8,0x83,0x0d,0xbc,0x4b
|
||||||
|
};
|
||||||
static unsigned char dsa1024_p[]={
|
static unsigned char dsa1024_p[]={
|
||||||
0xA7,0x3F,0x6E,0x85,0xBF,0x41,0x6A,0x29,0x7D,0xF0,0x9F,0x47,
|
0xA7,0x3F,0x6E,0x85,0xBF,0x41,0x6A,0x29,0x7D,0xF0,0x9F,0x47,
|
||||||
0x19,0x30,0x90,0x9A,0x09,0x1D,0xDA,0x6A,0x33,0x1E,0xC5,0x3D,
|
0x19,0x30,0x90,0x9A,0x09,0x1D,0xDA,0x6A,0x33,0x1E,0xC5,0x3D,
|
||||||
@@ -73,14 +105,45 @@ DSA *get_dsa1024()
|
|||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
|
|
||||||
if ((dsa=DSA_new()) == NULL) return(NULL);
|
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||||
|
dsa->priv_key=BN_bin2bn(dsa1024_priv,sizeof(dsa1024_priv),NULL);
|
||||||
|
dsa->pub_key=BN_bin2bn(dsa1024_pub,sizeof(dsa1024_pub),NULL);
|
||||||
dsa->p=BN_bin2bn(dsa1024_p,sizeof(dsa1024_p),NULL);
|
dsa->p=BN_bin2bn(dsa1024_p,sizeof(dsa1024_p),NULL);
|
||||||
dsa->q=BN_bin2bn(dsa1024_q,sizeof(dsa1024_q),NULL);
|
dsa->q=BN_bin2bn(dsa1024_q,sizeof(dsa1024_q),NULL);
|
||||||
dsa->g=BN_bin2bn(dsa1024_g,sizeof(dsa1024_g),NULL);
|
dsa->g=BN_bin2bn(dsa1024_g,sizeof(dsa1024_g),NULL);
|
||||||
if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
|
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||||
|
(dsa->q == NULL) || (dsa->g == NULL))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
return(dsa);
|
return(dsa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned char dsa2048_priv[]={
|
||||||
|
0x32,0x67,0x92,0xf6,0xc4,0xe2,0xe2,0xe8,0xa0,0x8b,0x6b,0x45,
|
||||||
|
0x0c,0x8a,0x76,0xb0,0xee,0xcf,0x91,0xa7,
|
||||||
|
};
|
||||||
|
static unsigned char dsa2048_pub[]={
|
||||||
|
0x17,0x8f,0xa8,0x11,0x84,0x92,0xec,0x83,0x47,0xc7,0x6a,0xb0,
|
||||||
|
0x92,0xaf,0x5a,0x20,0x37,0xa3,0x64,0x79,0xd2,0xd0,0x3d,0xcd,
|
||||||
|
0xe0,0x61,0x88,0x88,0x21,0xcc,0x74,0x5d,0xce,0x4c,0x51,0x47,
|
||||||
|
0xf0,0xc5,0x5c,0x4c,0x82,0x7a,0xaf,0x72,0xad,0xb9,0xe0,0x53,
|
||||||
|
0xf2,0x78,0xb7,0xf0,0xb5,0x48,0x7f,0x8a,0x3a,0x18,0xd1,0x9f,
|
||||||
|
0x8b,0x7d,0xa5,0x47,0xb7,0x95,0xab,0x98,0xf8,0x7b,0x74,0x50,
|
||||||
|
0x56,0x8e,0x57,0xf0,0xee,0xf5,0xb7,0xba,0xab,0x85,0x86,0xf9,
|
||||||
|
0x2b,0xef,0x41,0x56,0xa0,0xa4,0x9f,0xb7,0x38,0x00,0x46,0x0a,
|
||||||
|
0xa6,0xf1,0xfc,0x1f,0xd8,0x4e,0x85,0x44,0x92,0x43,0x21,0x5d,
|
||||||
|
0x6e,0xcc,0xc2,0xcb,0x26,0x31,0x0d,0x21,0xc4,0xbd,0x8d,0x24,
|
||||||
|
0xbc,0xd9,0x18,0x19,0xd7,0xdc,0xf1,0xe7,0x93,0x50,0x48,0x03,
|
||||||
|
0x2c,0xae,0x2e,0xe7,0x49,0x88,0x5f,0x93,0x57,0x27,0x99,0x36,
|
||||||
|
0xb4,0x20,0xab,0xfc,0xa7,0x2b,0xf2,0xd9,0x98,0xd7,0xd4,0x34,
|
||||||
|
0x9d,0x96,0x50,0x58,0x9a,0xea,0x54,0xf3,0xee,0xf5,0x63,0x14,
|
||||||
|
0xee,0x85,0x83,0x74,0x76,0xe1,0x52,0x95,0xc3,0xf7,0xeb,0x04,
|
||||||
|
0x04,0x7b,0xa7,0x28,0x1b,0xcc,0xea,0x4a,0x4e,0x84,0xda,0xd8,
|
||||||
|
0x9c,0x79,0xd8,0x9b,0x66,0x89,0x2f,0xcf,0xac,0xd7,0x79,0xf9,
|
||||||
|
0xa9,0xd8,0x45,0x13,0x78,0xb9,0x00,0x14,0xc9,0x7e,0x22,0x51,
|
||||||
|
0x86,0x67,0xb0,0x9f,0x26,0x11,0x23,0xc8,0x38,0xd7,0x70,0x1d,
|
||||||
|
0x15,0x8e,0x4d,0x4f,0x95,0x97,0x40,0xa1,0xc2,0x7e,0x01,0x18,
|
||||||
|
0x72,0xf4,0x10,0xe6,0x8d,0x52,0x16,0x7f,0xf2,0xc9,0xf8,0x33,
|
||||||
|
0x8b,0x33,0xb7,0xce,
|
||||||
|
};
|
||||||
static unsigned char dsa2048_p[]={
|
static unsigned char dsa2048_p[]={
|
||||||
0xA0,0x25,0xFA,0xAD,0xF4,0x8E,0xB9,0xE5,0x99,0xF3,0x5D,0x6F,
|
0xA0,0x25,0xFA,0xAD,0xF4,0x8E,0xB9,0xE5,0x99,0xF3,0x5D,0x6F,
|
||||||
0x4F,0x83,0x34,0xE2,0x7E,0xCF,0x6F,0xBF,0x30,0xAF,0x6F,0x81,
|
0x4F,0x83,0x34,0xE2,0x7E,0xCF,0x6F,0xBF,0x30,0xAF,0x6F,0x81,
|
||||||
@@ -139,10 +202,13 @@ DSA *get_dsa2048()
|
|||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
|
|
||||||
if ((dsa=DSA_new()) == NULL) return(NULL);
|
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||||
|
dsa->priv_key=BN_bin2bn(dsa2048_priv,sizeof(dsa2048_priv),NULL);
|
||||||
|
dsa->pub_key=BN_bin2bn(dsa2048_pub,sizeof(dsa2048_pub),NULL);
|
||||||
dsa->p=BN_bin2bn(dsa2048_p,sizeof(dsa2048_p),NULL);
|
dsa->p=BN_bin2bn(dsa2048_p,sizeof(dsa2048_p),NULL);
|
||||||
dsa->q=BN_bin2bn(dsa2048_q,sizeof(dsa2048_q),NULL);
|
dsa->q=BN_bin2bn(dsa2048_q,sizeof(dsa2048_q),NULL);
|
||||||
dsa->g=BN_bin2bn(dsa2048_g,sizeof(dsa2048_g),NULL);
|
dsa->g=BN_bin2bn(dsa2048_g,sizeof(dsa2048_g),NULL);
|
||||||
if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
|
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) ||
|
||||||
|
(dsa->q == NULL) || (dsa->g == NULL))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
return(dsa);
|
return(dsa);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,21 +70,23 @@
|
|||||||
#define PROG verify_main
|
#define PROG verify_main
|
||||||
|
|
||||||
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx);
|
static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx);
|
||||||
static int check(X509_STORE *ctx,char *file, STACK_OF(X509)*other, int purpose);
|
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e);
|
||||||
static STACK_OF(X509) *load_untrusted(char *file);
|
static STACK_OF(X509) *load_untrusted(char *file);
|
||||||
static int v_verbose=0;
|
static int v_verbose=0, vflags = 0;
|
||||||
|
|
||||||
int MAIN(int, char **);
|
int MAIN(int, char **);
|
||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int i,ret=1;
|
int i,ret=1;
|
||||||
int purpose = -1;
|
int purpose = -1;
|
||||||
char *CApath=NULL,*CAfile=NULL;
|
char *CApath=NULL,*CAfile=NULL;
|
||||||
char *untfile = NULL;
|
char *untfile = NULL, *trustfile = NULL;
|
||||||
STACK_OF(X509) *untrusted = NULL;
|
STACK_OF(X509) *untrusted = NULL, *trusted = NULL;
|
||||||
X509_STORE *cert_ctx=NULL;
|
X509_STORE *cert_ctx=NULL;
|
||||||
X509_LOOKUP *lookup=NULL;
|
X509_LOOKUP *lookup=NULL;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
cert_ctx=X509_STORE_new();
|
cert_ctx=X509_STORE_new();
|
||||||
if (cert_ctx == NULL) goto end;
|
if (cert_ctx == NULL) goto end;
|
||||||
@@ -98,6 +100,9 @@ int MAIN(int argc, char **argv)
|
|||||||
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
|
||||||
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
|
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -132,8 +137,26 @@ int MAIN(int argc, char **argv)
|
|||||||
if (argc-- < 1) goto end;
|
if (argc-- < 1) goto end;
|
||||||
untfile= *(++argv);
|
untfile= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-trusted") == 0)
|
||||||
|
{
|
||||||
|
if (argc-- < 1) goto end;
|
||||||
|
trustfile= *(++argv);
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto end;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-help") == 0)
|
else if (strcmp(*argv,"-help") == 0)
|
||||||
goto end;
|
goto end;
|
||||||
|
else if (strcmp(*argv,"-ignore_critical") == 0)
|
||||||
|
vflags |= X509_V_FLAG_IGNORE_CRITICAL;
|
||||||
|
else if (strcmp(*argv,"-issuer_checks") == 0)
|
||||||
|
vflags |= X509_V_FLAG_CB_ISSUER_CHECK;
|
||||||
|
else if (strcmp(*argv,"-crl_check") == 0)
|
||||||
|
vflags |= X509_V_FLAG_CRL_CHECK;
|
||||||
|
else if (strcmp(*argv,"-crl_check_all") == 0)
|
||||||
|
vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
|
||||||
else if (strcmp(*argv,"-verbose") == 0)
|
else if (strcmp(*argv,"-verbose") == 0)
|
||||||
v_verbose=1;
|
v_verbose=1;
|
||||||
else if (argv[0][0] == '-')
|
else if (argv[0][0] == '-')
|
||||||
@@ -147,6 +170,8 @@ int MAIN(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
lookup=X509_STORE_add_lookup(cert_ctx,X509_LOOKUP_file());
|
||||||
if (lookup == NULL) abort();
|
if (lookup == NULL) abort();
|
||||||
if (CAfile) {
|
if (CAfile) {
|
||||||
@@ -179,14 +204,22 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc < 1) check(cert_ctx, NULL, untrusted, purpose);
|
if(trustfile) {
|
||||||
|
if(!(trusted = load_untrusted(trustfile))) {
|
||||||
|
BIO_printf(bio_err, "Error loading untrusted file %s\n", trustfile);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, purpose, e);
|
||||||
else
|
else
|
||||||
for (i=0; i<argc; i++)
|
for (i=0; i<argc; i++)
|
||||||
check(cert_ctx,argv[i], untrusted, purpose);
|
check(cert_ctx,argv[i], untrusted, trusted, purpose, e);
|
||||||
ret=0;
|
ret=0;
|
||||||
end:
|
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,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check] [-engine e] cert1 cert2 ...\n");
|
||||||
BIO_printf(bio_err,"recognized usages:\n");
|
BIO_printf(bio_err,"recognized usages:\n");
|
||||||
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
for(i = 0; i < X509_PURPOSE_get_count(); i++) {
|
||||||
X509_PURPOSE *ptmp;
|
X509_PURPOSE *ptmp;
|
||||||
@@ -197,42 +230,20 @@ end:
|
|||||||
}
|
}
|
||||||
if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
|
if (cert_ctx != NULL) X509_STORE_free(cert_ctx);
|
||||||
sk_X509_pop_free(untrusted, X509_free);
|
sk_X509_pop_free(untrusted, X509_free);
|
||||||
EXIT(ret);
|
sk_X509_pop_free(trusted, X509_free);
|
||||||
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, int purpose)
|
static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X509) *tchain, int purpose, ENGINE *e)
|
||||||
{
|
{
|
||||||
X509 *x=NULL;
|
X509 *x=NULL;
|
||||||
BIO *in=NULL;
|
|
||||||
int i=0,ret=0;
|
int i=0,ret=0;
|
||||||
X509_STORE_CTX *csc;
|
X509_STORE_CTX *csc;
|
||||||
|
|
||||||
in=BIO_new(BIO_s_file());
|
x = load_cert(bio_err, file, FORMAT_PEM, NULL, e, "certificate file");
|
||||||
if (in == NULL)
|
|
||||||
{
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file == NULL)
|
|
||||||
BIO_set_fp(in,stdin,BIO_NOCLOSE);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (BIO_read_filename(in,file) <= 0)
|
|
||||||
{
|
|
||||||
perror(file);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
x=PEM_read_bio_X509(in,NULL,NULL,NULL);
|
|
||||||
if (x == NULL)
|
if (x == NULL)
|
||||||
{
|
|
||||||
fprintf(stdout,"%s: unable to load certificate file\n",
|
|
||||||
(file == NULL)?"stdin":file);
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
fprintf(stdout,"%s: ",(file == NULL)?"stdin":file);
|
fprintf(stdout,"%s: ",(file == NULL)?"stdin":file);
|
||||||
|
|
||||||
csc = X509_STORE_CTX_new();
|
csc = X509_STORE_CTX_new();
|
||||||
@@ -241,7 +252,13 @@ static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, int purpos
|
|||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
X509_STORE_CTX_init(csc,ctx,x,uchain);
|
X509_STORE_set_flags(ctx, vflags);
|
||||||
|
if(!X509_STORE_CTX_init(csc,ctx,x,uchain))
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if(tchain) X509_STORE_CTX_trusted_stack(csc, tchain);
|
||||||
if(purpose >= 0) X509_STORE_CTX_set_purpose(csc, purpose);
|
if(purpose >= 0) X509_STORE_CTX_set_purpose(csc, purpose);
|
||||||
i=X509_verify_cert(csc);
|
i=X509_verify_cert(csc);
|
||||||
X509_STORE_CTX_free(csc);
|
X509_STORE_CTX_free(csc);
|
||||||
@@ -256,7 +273,6 @@ end:
|
|||||||
else
|
else
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (x != NULL) X509_free(x);
|
if (x != NULL) X509_free(x);
|
||||||
if (in != NULL) BIO_free(in);
|
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
@@ -314,7 +330,8 @@ static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
|
|||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
X509_NAME_oneline(
|
X509_NAME_oneline(
|
||||||
X509_get_subject_name(ctx->current_cert),buf,256);
|
X509_get_subject_name(ctx->current_cert),buf,
|
||||||
|
sizeof buf);
|
||||||
printf("%s\n",buf);
|
printf("%s\n",buf);
|
||||||
printf("error %d at %d depth lookup:%s\n",ctx->error,
|
printf("error %d at %d depth lookup:%s\n",ctx->error,
|
||||||
ctx->error_depth,
|
ctx->error_depth,
|
||||||
@@ -330,6 +347,9 @@ static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
|
|||||||
if (ctx->error == X509_V_ERR_PATH_LENGTH_EXCEEDED) ok=1;
|
if (ctx->error == X509_V_ERR_PATH_LENGTH_EXCEEDED) ok=1;
|
||||||
if (ctx->error == X509_V_ERR_INVALID_PURPOSE) ok=1;
|
if (ctx->error == X509_V_ERR_INVALID_PURPOSE) ok=1;
|
||||||
if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
|
if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
|
||||||
|
if (ctx->error == X509_V_ERR_CRL_HAS_EXPIRED) ok=1;
|
||||||
|
if (ctx->error == X509_V_ERR_CRL_NOT_YET_VALID) ok=1;
|
||||||
|
if (ctx->error == X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION) ok=1;
|
||||||
}
|
}
|
||||||
if (!v_verbose)
|
if (!v_verbose)
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
|
|||||||
104
apps/version.c
104
apps/version.c
@@ -55,6 +55,59 @@
|
|||||||
* copied and put under another distribution licence
|
* copied and put under another distribution licence
|
||||||
* [including the GNU Public Licence.]
|
* [including the GNU Public Licence.]
|
||||||
*/
|
*/
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This product includes cryptographic software written by Eric Young
|
||||||
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||||
|
* Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -62,6 +115,21 @@
|
|||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
|
#ifndef OPENSSL_NO_MD2
|
||||||
|
# include <openssl/md2.h>
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_RC4
|
||||||
|
# include <openssl/rc4.h>
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_DES
|
||||||
|
# include <openssl/des.h>
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_IDEA
|
||||||
|
# include <openssl/idea.h>
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_BF
|
||||||
|
# include <openssl/blowfish.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef PROG
|
#undef PROG
|
||||||
#define PROG version_main
|
#define PROG version_main
|
||||||
@@ -71,7 +139,7 @@ int MAIN(int, char **);
|
|||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i,ret=0;
|
int i,ret=0;
|
||||||
int cflags=0,version=0,date=0,options=0,platform=0;
|
int cflags=0,version=0,date=0,options=0,platform=0,dir=0;
|
||||||
|
|
||||||
apps_startup();
|
apps_startup();
|
||||||
|
|
||||||
@@ -92,8 +160,10 @@ int MAIN(int argc, char **argv)
|
|||||||
options=1;
|
options=1;
|
||||||
else if (strcmp(argv[i],"-p") == 0)
|
else if (strcmp(argv[i],"-p") == 0)
|
||||||
platform=1;
|
platform=1;
|
||||||
|
else if (strcmp(argv[i],"-d") == 0)
|
||||||
|
dir=1;
|
||||||
else if (strcmp(argv[i],"-a") == 0)
|
else if (strcmp(argv[i],"-a") == 0)
|
||||||
date=version=cflags=options=platform=1;
|
date=version=cflags=options=platform=dir=1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"usage:version -[avbofp]\n");
|
BIO_printf(bio_err,"usage:version -[avbofp]\n");
|
||||||
@@ -102,31 +172,45 @@ int MAIN(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version) printf("%s\n",SSLeay_version(SSLEAY_VERSION));
|
if (version)
|
||||||
|
{
|
||||||
|
if (SSLeay() == SSLEAY_VERSION_NUMBER)
|
||||||
|
{
|
||||||
|
printf("%s\n",SSLeay_version(SSLEAY_VERSION));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("%s (Library: %s)\n",
|
||||||
|
OPENSSL_VERSION_TEXT,
|
||||||
|
SSLeay_version(SSLEAY_VERSION));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (date) printf("%s\n",SSLeay_version(SSLEAY_BUILT_ON));
|
if (date) printf("%s\n",SSLeay_version(SSLEAY_BUILT_ON));
|
||||||
if (platform) printf("%s\n",SSLeay_version(SSLEAY_PLATFORM));
|
if (platform) printf("%s\n",SSLeay_version(SSLEAY_PLATFORM));
|
||||||
if (options)
|
if (options)
|
||||||
{
|
{
|
||||||
printf("options: ");
|
printf("options: ");
|
||||||
printf("%s ",BN_options());
|
printf("%s ",BN_options());
|
||||||
#ifndef NO_MD2
|
#ifndef OPENSSL_NO_MD2
|
||||||
printf("%s ",MD2_options());
|
printf("%s ",MD2_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RC4
|
#ifndef OPENSSL_NO_RC4
|
||||||
printf("%s ",RC4_options());
|
printf("%s ",RC4_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DES
|
#ifndef OPENSSL_NO_DES
|
||||||
printf("%s ",des_options());
|
printf("%s ",DES_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_IDEA
|
#ifndef OPENSSL_NO_IDEA
|
||||||
printf("%s ",idea_options());
|
printf("%s ",idea_options());
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_BF
|
#ifndef OPENSSL_NO_BF
|
||||||
printf("%s ",BF_options());
|
printf("%s ",BF_options());
|
||||||
#endif
|
#endif
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
if (cflags) printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
|
if (cflags) printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
|
||||||
|
if (dir) printf("%s\n",SSLeay_version(SSLEAY_DIR));
|
||||||
end:
|
end:
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
HDC hdc;
|
HDC hdc;
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
char buffer[200];
|
|
||||||
static int seeded = 0;
|
static int seeded = 0;
|
||||||
|
|
||||||
switch (iMsg)
|
switch (iMsg)
|
||||||
|
|||||||
507
apps/x509.c
507
apps/x509.c
@@ -60,7 +60,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef NO_STDIO
|
#ifdef OPENSSL_NO_STDIO
|
||||||
#define APPS_WIN16
|
#define APPS_WIN16
|
||||||
#endif
|
#endif
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
@@ -81,8 +81,6 @@
|
|||||||
#define POSTFIX ".srl"
|
#define POSTFIX ".srl"
|
||||||
#define DEF_DAYS 30
|
#define DEF_DAYS 30
|
||||||
|
|
||||||
#define CERT_HDR "certificate"
|
|
||||||
|
|
||||||
static char *x509_usage[]={
|
static char *x509_usage[]={
|
||||||
"usage: x509 args\n",
|
"usage: x509 args\n",
|
||||||
" -inform arg - input format - default PEM (one of DER, NET or PEM)\n",
|
" -inform arg - input format - default PEM (one of DER, NET or PEM)\n",
|
||||||
@@ -97,6 +95,7 @@ static char *x509_usage[]={
|
|||||||
" -hash - print hash value\n",
|
" -hash - print hash value\n",
|
||||||
" -subject - print subject DN\n",
|
" -subject - print subject DN\n",
|
||||||
" -issuer - print issuer DN\n",
|
" -issuer - print issuer DN\n",
|
||||||
|
" -email - print email address(es)\n",
|
||||||
" -startdate - notBefore field\n",
|
" -startdate - notBefore field\n",
|
||||||
" -enddate - notAfter field\n",
|
" -enddate - notAfter field\n",
|
||||||
" -purpose - print out certificate purposes\n",
|
" -purpose - print out certificate purposes\n",
|
||||||
@@ -106,6 +105,7 @@ static char *x509_usage[]={
|
|||||||
" -fingerprint - print the certificate fingerprint\n",
|
" -fingerprint - print the certificate fingerprint\n",
|
||||||
" -alias - output certificate alias\n",
|
" -alias - output certificate alias\n",
|
||||||
" -noout - no certificate output\n",
|
" -noout - no certificate output\n",
|
||||||
|
" -ocspid - print OCSP hash values for the subject name and public key\n",
|
||||||
" -trustout - output a \"trusted\" certificate\n",
|
" -trustout - output a \"trusted\" certificate\n",
|
||||||
" -clrtrust - clear all trusted purposes\n",
|
" -clrtrust - clear all trusted purposes\n",
|
||||||
" -clrreject - clear all rejected purposes\n",
|
" -clrreject - clear all rejected purposes\n",
|
||||||
@@ -113,6 +113,8 @@ static char *x509_usage[]={
|
|||||||
" -addreject arg - reject certificate for a given purpose\n",
|
" -addreject arg - reject certificate for a given purpose\n",
|
||||||
" -setalias arg - set certificate alias\n",
|
" -setalias arg - set certificate alias\n",
|
||||||
" -days arg - How long till expiry of a signed certificate - def 30 days\n",
|
" -days arg - How long till expiry of a signed certificate - def 30 days\n",
|
||||||
|
" -checkend arg - check whether the cert expires in the next arg seconds\n",
|
||||||
|
" exit 1 if so, 0 if not\n",
|
||||||
" -signkey arg - self sign cert with arg\n",
|
" -signkey arg - self sign cert with arg\n",
|
||||||
" -x509toreq - output a certification request object\n",
|
" -x509toreq - output a certification request object\n",
|
||||||
" -req - input is a certificate request, sign and output.\n",
|
" -req - input is a certificate request, sign and output.\n",
|
||||||
@@ -120,24 +122,27 @@ static char *x509_usage[]={
|
|||||||
" -CAkey arg - set the CA key, must be PEM format\n",
|
" -CAkey arg - set the CA key, must be PEM format\n",
|
||||||
" missing, it is assumed 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",
|
" -CAcreateserial - create serial number file if it does not exist\n",
|
||||||
" -CAserial - serial file\n",
|
" -CAserial arg - serial file\n",
|
||||||
|
" -set_serial - serial number to use\n",
|
||||||
" -text - print the certificate in text form\n",
|
" -text - print the certificate in text form\n",
|
||||||
" -C - print out C code forms\n",
|
" -C - print out C code forms\n",
|
||||||
" -md2/-md5/-sha1/-mdc2 - digest to use\n",
|
" -md2/-md5/-sha1/-mdc2 - digest to use\n",
|
||||||
" -extfile - configuration file with X509V3 extensions to add\n",
|
" -extfile - configuration file with X509V3 extensions to add\n",
|
||||||
" -extensions - section from config file with X509V3 extensions to add\n",
|
" -extensions - section from config file with X509V3 extensions to add\n",
|
||||||
" -clrext - delete extensions before signing and input certificate\n",
|
" -clrext - delete extensions before signing and input certificate\n",
|
||||||
|
" -nameopt arg - various certificate name options\n",
|
||||||
|
" -engine e - use engine e, possibly a hardware device.\n",
|
||||||
|
" -certopt arg - various certificate text options\n",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
|
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
|
||||||
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,int clrext, const EVP_MD *digest,
|
static int sign (X509 *x, EVP_PKEY *pkey,int days,int clrext, const EVP_MD *digest,
|
||||||
LHASH *conf, char *section);
|
CONF *conf, char *section);
|
||||||
static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest,
|
static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest,
|
||||||
X509 *x,X509 *xca,EVP_PKEY *pkey,char *serial,
|
X509 *x,X509 *xca,EVP_PKEY *pkey,char *serial,
|
||||||
int create,int days, int clrext, LHASH *conf, char *section);
|
int create,int days, int clrext, CONF *conf, char *section,
|
||||||
|
ASN1_INTEGER *sno);
|
||||||
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt);
|
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt);
|
||||||
static int reqfile=0;
|
static int reqfile=0;
|
||||||
|
|
||||||
@@ -145,11 +150,13 @@ int MAIN(int, char **);
|
|||||||
|
|
||||||
int MAIN(int argc, char **argv)
|
int MAIN(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
ENGINE *e = NULL;
|
||||||
int ret=1;
|
int ret=1;
|
||||||
X509_REQ *req=NULL;
|
X509_REQ *req=NULL;
|
||||||
X509 *x=NULL,*xca=NULL;
|
X509 *x=NULL,*xca=NULL;
|
||||||
ASN1_OBJECT *objtmp;
|
ASN1_OBJECT *objtmp;
|
||||||
EVP_PKEY *Upkey=NULL,*CApkey=NULL;
|
EVP_PKEY *Upkey=NULL,*CApkey=NULL;
|
||||||
|
ASN1_INTEGER *sno = NULL;
|
||||||
int i,num,badops=0;
|
int i,num,badops=0;
|
||||||
BIO *out=NULL;
|
BIO *out=NULL;
|
||||||
BIO *STDout=NULL;
|
BIO *STDout=NULL;
|
||||||
@@ -159,7 +166,8 @@ int MAIN(int argc, char **argv)
|
|||||||
char *CAkeyfile=NULL,*CAserial=NULL;
|
char *CAkeyfile=NULL,*CAserial=NULL;
|
||||||
char *alias=NULL;
|
char *alias=NULL;
|
||||||
int text=0,serial=0,hash=0,subject=0,issuer=0,startdate=0,enddate=0;
|
int text=0,serial=0,hash=0,subject=0,issuer=0,startdate=0,enddate=0;
|
||||||
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0;
|
int ocspid=0;
|
||||||
|
int noout=0,sign_flag=0,CA_flag=0,CA_createserial=0,email=0;
|
||||||
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
|
int trustout=0,clrtrust=0,clrreject=0,aliasout=0,clrext=0;
|
||||||
int C=0;
|
int C=0;
|
||||||
int x509req=0,days=DEF_DAYS,modulus=0,pubkey=0;
|
int x509req=0,days=DEF_DAYS,modulus=0,pubkey=0;
|
||||||
@@ -170,9 +178,12 @@ int MAIN(int argc, char **argv)
|
|||||||
int fingerprint=0;
|
int fingerprint=0;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
const EVP_MD *md_alg,*digest=EVP_md5();
|
const EVP_MD *md_alg,*digest=EVP_md5();
|
||||||
LHASH *extconf = NULL;
|
CONF *extconf = NULL;
|
||||||
char *extsect = NULL, *extfile = NULL, *passin = NULL, *passargin = NULL;
|
char *extsect = NULL, *extfile = NULL, *passin = NULL, *passargin = NULL;
|
||||||
int need_rand = 0;
|
int need_rand = 0;
|
||||||
|
int checkend=0,checkoffset=0;
|
||||||
|
unsigned long nmflag = 0, certflag = 0;
|
||||||
|
char *engine=NULL;
|
||||||
|
|
||||||
reqfile=0;
|
reqfile=0;
|
||||||
|
|
||||||
@@ -180,7 +191,16 @@ int MAIN(int argc, char **argv)
|
|||||||
|
|
||||||
if (bio_err == NULL)
|
if (bio_err == NULL)
|
||||||
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
|
||||||
|
|
||||||
|
if (!load_config(bio_err, NULL))
|
||||||
|
goto end;
|
||||||
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
|
STDout=BIO_new_fp(stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
STDout = BIO_push(tmpbio, STDout);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
informat=FORMAT_PEM;
|
informat=FORMAT_PEM;
|
||||||
outformat=FORMAT_PEM;
|
outformat=FORMAT_PEM;
|
||||||
@@ -225,7 +245,7 @@ int MAIN(int argc, char **argv)
|
|||||||
else if (strcmp(*argv,"-CAkeyform") == 0)
|
else if (strcmp(*argv,"-CAkeyform") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
CAformat=str2fmt(*(++argv));
|
CAkeyformat=str2fmt(*(++argv));
|
||||||
}
|
}
|
||||||
else if (strcmp(*argv,"-days") == 0)
|
else if (strcmp(*argv,"-days") == 0)
|
||||||
{
|
{
|
||||||
@@ -286,10 +306,17 @@ int MAIN(int argc, char **argv)
|
|||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
CAserial= *(++argv);
|
CAserial= *(++argv);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-set_serial") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
if (!(sno = s2i_ASN1_INTEGER(NULL, *(++argv))))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-addtrust") == 0)
|
else if (strcmp(*argv,"-addtrust") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
if(!(objtmp = OBJ_txt2obj(*(++argv), 0))) {
|
if (!(objtmp = OBJ_txt2obj(*(++argv), 0)))
|
||||||
|
{
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"Invalid trust object value %s\n", *argv);
|
"Invalid trust object value %s\n", *argv);
|
||||||
goto bad;
|
goto bad;
|
||||||
@@ -301,7 +328,8 @@ int MAIN(int argc, char **argv)
|
|||||||
else if (strcmp(*argv,"-addreject") == 0)
|
else if (strcmp(*argv,"-addreject") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
if(!(objtmp = OBJ_txt2obj(*(++argv), 0))) {
|
if (!(objtmp = OBJ_txt2obj(*(++argv), 0)))
|
||||||
|
{
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"Invalid reject object value %s\n", *argv);
|
"Invalid reject object value %s\n", *argv);
|
||||||
goto bad;
|
goto bad;
|
||||||
@@ -316,14 +344,31 @@ int MAIN(int argc, char **argv)
|
|||||||
alias= *(++argv);
|
alias= *(++argv);
|
||||||
trustout = 1;
|
trustout = 1;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-certopt") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
if (!set_cert_ex(&certflag, *(++argv))) goto bad;
|
||||||
|
}
|
||||||
|
else if (strcmp(*argv,"-nameopt") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
if (!set_name_ex(&nmflag, *(++argv))) goto bad;
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-setalias") == 0)
|
else if (strcmp(*argv,"-setalias") == 0)
|
||||||
{
|
{
|
||||||
if (--argc < 1) goto bad;
|
if (--argc < 1) goto bad;
|
||||||
alias= *(++argv);
|
alias= *(++argv);
|
||||||
trustout = 1;
|
trustout = 1;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(*argv,"-engine") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
engine= *(++argv);
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-C") == 0)
|
else if (strcmp(*argv,"-C") == 0)
|
||||||
C= ++num;
|
C= ++num;
|
||||||
|
else if (strcmp(*argv,"-email") == 0)
|
||||||
|
email= ++num;
|
||||||
else if (strcmp(*argv,"-serial") == 0)
|
else if (strcmp(*argv,"-serial") == 0)
|
||||||
serial= ++num;
|
serial= ++num;
|
||||||
else if (strcmp(*argv,"-modulus") == 0)
|
else if (strcmp(*argv,"-modulus") == 0)
|
||||||
@@ -353,6 +398,12 @@ int MAIN(int argc, char **argv)
|
|||||||
startdate= ++num;
|
startdate= ++num;
|
||||||
else if (strcmp(*argv,"-enddate") == 0)
|
else if (strcmp(*argv,"-enddate") == 0)
|
||||||
enddate= ++num;
|
enddate= ++num;
|
||||||
|
else if (strcmp(*argv,"-checkend") == 0)
|
||||||
|
{
|
||||||
|
if (--argc < 1) goto bad;
|
||||||
|
checkoffset=atoi(*(++argv));
|
||||||
|
checkend=1;
|
||||||
|
}
|
||||||
else if (strcmp(*argv,"-noout") == 0)
|
else if (strcmp(*argv,"-noout") == 0)
|
||||||
noout= ++num;
|
noout= ++num;
|
||||||
else if (strcmp(*argv,"-trustout") == 0)
|
else if (strcmp(*argv,"-trustout") == 0)
|
||||||
@@ -374,6 +425,8 @@ int MAIN(int argc, char **argv)
|
|||||||
clrext = 1;
|
clrext = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else if (strcmp(*argv,"-ocspid") == 0)
|
||||||
|
ocspid= ++num;
|
||||||
else if ((md_alg=EVP_get_digestbyname(*argv + 1)))
|
else if ((md_alg=EVP_get_digestbyname(*argv + 1)))
|
||||||
{
|
{
|
||||||
/* ok */
|
/* ok */
|
||||||
@@ -393,16 +446,19 @@ int MAIN(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
bad:
|
bad:
|
||||||
for (pp=x509_usage; (*pp != NULL); pp++)
|
for (pp=x509_usage; (*pp != NULL); pp++)
|
||||||
BIO_printf(bio_err,*pp);
|
BIO_printf(bio_err,"%s",*pp);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e = setup_engine(bio_err, engine, 0);
|
||||||
|
|
||||||
if (need_rand)
|
if (need_rand)
|
||||||
app_RAND_load_file(NULL, bio_err, 0);
|
app_RAND_load_file(NULL, bio_err, 0);
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
|
|
||||||
if(!app_passwd(bio_err, passargin, NULL, &passin, NULL)) {
|
if (!app_passwd(bio_err, passargin, NULL, &passin, NULL))
|
||||||
|
{
|
||||||
BIO_printf(bio_err, "Error getting password\n");
|
BIO_printf(bio_err, "Error getting password\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -421,10 +477,13 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extfile) {
|
if (extfile)
|
||||||
long errorline;
|
{
|
||||||
|
long errorline = -1;
|
||||||
X509V3_CTX ctx2;
|
X509V3_CTX ctx2;
|
||||||
if (!(extconf=CONF_load(NULL,extfile,&errorline))) {
|
extconf = NCONF_new(NULL);
|
||||||
|
if (!NCONF_load(extconf, extfile,&errorline))
|
||||||
|
{
|
||||||
if (errorline <= 0)
|
if (errorline <= 0)
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"error loading the config file '%s'\n",
|
"error loading the config file '%s'\n",
|
||||||
@@ -435,11 +494,19 @@ bad:
|
|||||||
,errorline,extfile);
|
,errorline,extfile);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if(!extsect && !(extsect = CONF_get_string(extconf, "default",
|
if (!extsect)
|
||||||
"extensions"))) extsect = "default";
|
{
|
||||||
|
extsect = NCONF_get_string(extconf, "default", "extensions");
|
||||||
|
if (!extsect)
|
||||||
|
{
|
||||||
|
ERR_clear_error();
|
||||||
|
extsect = "default";
|
||||||
|
}
|
||||||
|
}
|
||||||
X509V3_set_ctx_test(&ctx2);
|
X509V3_set_ctx_test(&ctx2);
|
||||||
X509V3_set_conf_lhash(&ctx2, extconf);
|
X509V3_set_nconf(&ctx2, extconf);
|
||||||
if(!X509V3_EXT_add_conf(extconf, &ctx2, extsect, NULL)) {
|
if (!X509V3_EXT_add_nconf(extconf, &ctx2, extsect, NULL))
|
||||||
|
{
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"Error Loading extension section %s\n",
|
"Error Loading extension section %s\n",
|
||||||
extsect);
|
extsect);
|
||||||
@@ -474,13 +541,18 @@ bad:
|
|||||||
if (BIO_read_filename(in,infile) <= 0)
|
if (BIO_read_filename(in,infile) <= 0)
|
||||||
{
|
{
|
||||||
perror(infile);
|
perror(infile);
|
||||||
|
BIO_free(in);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
req=PEM_read_bio_X509_REQ(in,NULL,NULL,NULL);
|
req=PEM_read_bio_X509_REQ(in,NULL,NULL,NULL);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
|
|
||||||
if (req == NULL) { perror(infile); goto end; }
|
if (req == NULL)
|
||||||
|
{
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if ( (req->req_info == NULL) ||
|
if ( (req->req_info == NULL) ||
|
||||||
(req->req_info->pubkey == NULL) ||
|
(req->req_info->pubkey == NULL) ||
|
||||||
@@ -512,13 +584,17 @@ bad:
|
|||||||
else
|
else
|
||||||
BIO_printf(bio_err,"Signature ok\n");
|
BIO_printf(bio_err,"Signature ok\n");
|
||||||
|
|
||||||
X509_NAME_oneline(req->req_info->subject,buf,256);
|
print_name(bio_err, "subject=", X509_REQ_get_subject_name(req), nmflag);
|
||||||
BIO_printf(bio_err,"subject=%s\n",buf);
|
|
||||||
|
|
||||||
if ((x=X509_new()) == NULL) goto end;
|
if ((x=X509_new()) == NULL) goto end;
|
||||||
ci=x->cert_info;
|
ci=x->cert_info;
|
||||||
|
|
||||||
if (!ASN1_INTEGER_set(X509_get_serialNumber(x),0)) goto end;
|
if (sno)
|
||||||
|
{
|
||||||
|
if (!X509_set_serialNumber(x, sno))
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
else if (!ASN1_INTEGER_set(X509_get_serialNumber(x),0)) goto end;
|
||||||
if (!X509_set_issuer_name(x,req->req_info->subject)) goto end;
|
if (!X509_set_issuer_name(x,req->req_info->subject)) goto end;
|
||||||
if (!X509_set_subject_name(x,req->req_info->subject)) goto end;
|
if (!X509_set_subject_name(x,req->req_info->subject)) goto end;
|
||||||
|
|
||||||
@@ -530,12 +606,12 @@ bad:
|
|||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
x=load_cert(infile,informat);
|
x=load_cert(bio_err,infile,informat,NULL,e,"Certificate");
|
||||||
|
|
||||||
if (x == NULL) goto end;
|
if (x == NULL) goto end;
|
||||||
if (CA_flag)
|
if (CA_flag)
|
||||||
{
|
{
|
||||||
xca=load_cert(CAfile,CAformat);
|
xca=load_cert(bio_err,CAfile,CAformat,NULL,e,"CA Certificate");
|
||||||
if (xca == NULL) goto end;
|
if (xca == NULL) goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,7 +627,15 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (outfile == NULL)
|
if (outfile == NULL)
|
||||||
|
{
|
||||||
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
BIO_set_fp(out,stdout,BIO_NOCLOSE);
|
||||||
|
#ifdef OPENSSL_SYS_VMS
|
||||||
|
{
|
||||||
|
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
|
||||||
|
out = BIO_push(tmpbio, out);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (BIO_write_filename(out,outfile) <= 0)
|
if (BIO_write_filename(out,outfile) <= 0)
|
||||||
@@ -567,15 +651,19 @@ bad:
|
|||||||
if (clrtrust) X509_trust_clear(x);
|
if (clrtrust) X509_trust_clear(x);
|
||||||
if (clrreject) X509_reject_clear(x);
|
if (clrreject) X509_reject_clear(x);
|
||||||
|
|
||||||
if(trust) {
|
if (trust)
|
||||||
for(i = 0; i < sk_ASN1_OBJECT_num(trust); i++) {
|
{
|
||||||
|
for (i = 0; i < sk_ASN1_OBJECT_num(trust); i++)
|
||||||
|
{
|
||||||
objtmp = sk_ASN1_OBJECT_value(trust, i);
|
objtmp = sk_ASN1_OBJECT_value(trust, i);
|
||||||
X509_add1_trust_object(x, objtmp);
|
X509_add1_trust_object(x, objtmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reject) {
|
if (reject)
|
||||||
for(i = 0; i < sk_ASN1_OBJECT_num(reject); i++) {
|
{
|
||||||
|
for (i = 0; i < sk_ASN1_OBJECT_num(reject); i++)
|
||||||
|
{
|
||||||
objtmp = sk_ASN1_OBJECT_value(reject, i);
|
objtmp = sk_ASN1_OBJECT_value(reject, i);
|
||||||
X509_add1_reject_object(x, objtmp);
|
X509_add1_reject_object(x, objtmp);
|
||||||
}
|
}
|
||||||
@@ -587,15 +675,13 @@ bad:
|
|||||||
{
|
{
|
||||||
if (issuer == i)
|
if (issuer == i)
|
||||||
{
|
{
|
||||||
X509_NAME_oneline(X509_get_issuer_name(x),
|
print_name(STDout, "issuer= ",
|
||||||
buf,256);
|
X509_get_issuer_name(x), nmflag);
|
||||||
BIO_printf(STDout,"issuer= %s\n",buf);
|
|
||||||
}
|
}
|
||||||
else if (subject == i)
|
else if (subject == i)
|
||||||
{
|
{
|
||||||
X509_NAME_oneline(X509_get_subject_name(x),
|
print_name(STDout, "subject= ",
|
||||||
buf,256);
|
X509_get_subject_name(x), nmflag);
|
||||||
BIO_printf(STDout,"subject=%s\n",buf);
|
|
||||||
}
|
}
|
||||||
else if (serial == i)
|
else if (serial == i)
|
||||||
{
|
{
|
||||||
@@ -603,6 +689,15 @@ bad:
|
|||||||
i2a_ASN1_INTEGER(STDout,x->cert_info->serialNumber);
|
i2a_ASN1_INTEGER(STDout,x->cert_info->serialNumber);
|
||||||
BIO_printf(STDout,"\n");
|
BIO_printf(STDout,"\n");
|
||||||
}
|
}
|
||||||
|
else if (email == i)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
STACK *emlst;
|
||||||
|
emlst = X509_get1_email(x);
|
||||||
|
for (j = 0; j < sk_num(emlst); j++)
|
||||||
|
BIO_printf(STDout, "%s\n", sk_value(emlst, j));
|
||||||
|
X509_email_free(emlst);
|
||||||
|
}
|
||||||
else if (aliasout == i)
|
else if (aliasout == i)
|
||||||
{
|
{
|
||||||
unsigned char *alstr;
|
unsigned char *alstr;
|
||||||
@@ -638,12 +733,12 @@ bad:
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
BIO_printf(STDout,"Modulus=");
|
BIO_printf(STDout,"Modulus=");
|
||||||
#ifndef NO_RSA
|
#ifndef OPENSSL_NO_RSA
|
||||||
if (pkey->type == EVP_PKEY_RSA)
|
if (pkey->type == EVP_PKEY_RSA)
|
||||||
BN_print(STDout,pkey->pkey.rsa->n);
|
BN_print(STDout,pkey->pkey.rsa->n);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (pkey->type == EVP_PKEY_DSA)
|
if (pkey->type == EVP_PKEY_DSA)
|
||||||
BN_print(STDout,pkey->pkey.dsa->pub_key);
|
BN_print(STDout,pkey->pkey.dsa->pub_key);
|
||||||
else
|
else
|
||||||
@@ -675,14 +770,15 @@ bad:
|
|||||||
int y,z;
|
int y,z;
|
||||||
|
|
||||||
X509_NAME_oneline(X509_get_subject_name(x),
|
X509_NAME_oneline(X509_get_subject_name(x),
|
||||||
buf,256);
|
buf,sizeof buf);
|
||||||
BIO_printf(STDout,"/* subject:%s */\n",buf);
|
BIO_printf(STDout,"/* subject:%s */\n",buf);
|
||||||
m=X509_NAME_oneline(
|
m=X509_NAME_oneline(
|
||||||
X509_get_issuer_name(x),buf,256);
|
X509_get_issuer_name(x),buf,
|
||||||
|
sizeof buf);
|
||||||
BIO_printf(STDout,"/* issuer :%s */\n",buf);
|
BIO_printf(STDout,"/* issuer :%s */\n",buf);
|
||||||
|
|
||||||
z=i2d_X509(x,NULL);
|
z=i2d_X509(x,NULL);
|
||||||
m=Malloc(z);
|
m=OPENSSL_malloc(z);
|
||||||
|
|
||||||
d=(unsigned char *)m;
|
d=(unsigned char *)m;
|
||||||
z=i2d_X509_NAME(X509_get_subject_name(x),&d);
|
z=i2d_X509_NAME(X509_get_subject_name(x),&d);
|
||||||
@@ -720,11 +816,11 @@ bad:
|
|||||||
if (y%16 != 0) BIO_printf(STDout,"\n");
|
if (y%16 != 0) BIO_printf(STDout,"\n");
|
||||||
BIO_printf(STDout,"};\n");
|
BIO_printf(STDout,"};\n");
|
||||||
|
|
||||||
Free(m);
|
OPENSSL_free(m);
|
||||||
}
|
}
|
||||||
else if (text == i)
|
else if (text == i)
|
||||||
{
|
{
|
||||||
X509_print(out,x);
|
X509_print_ex(out,x,nmflag, certflag);
|
||||||
}
|
}
|
||||||
else if (startdate == i)
|
else if (startdate == i)
|
||||||
{
|
{
|
||||||
@@ -765,13 +861,19 @@ bad:
|
|||||||
BIO_printf(bio_err,"Getting Private key\n");
|
BIO_printf(bio_err,"Getting Private key\n");
|
||||||
if (Upkey == NULL)
|
if (Upkey == NULL)
|
||||||
{
|
{
|
||||||
Upkey=load_key(keyfile,keyformat, passin);
|
Upkey=load_key(bio_err,
|
||||||
|
keyfile, keyformat, 0,
|
||||||
|
passin, e, "Private key");
|
||||||
if (Upkey == NULL) goto end;
|
if (Upkey == NULL) goto end;
|
||||||
}
|
}
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (Upkey->type == EVP_PKEY_DSA)
|
if (Upkey->type == EVP_PKEY_DSA)
|
||||||
digest=EVP_dss1();
|
digest=EVP_dss1();
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_ECDSA
|
||||||
|
if (Upkey->type == EVP_PKEY_EC)
|
||||||
|
digest=EVP_ecdsa();
|
||||||
|
#endif
|
||||||
|
|
||||||
assert(need_rand);
|
assert(need_rand);
|
||||||
if (!sign(x,Upkey,days,clrext,digest,
|
if (!sign(x,Upkey,days,clrext,digest,
|
||||||
@@ -782,18 +884,25 @@ bad:
|
|||||||
BIO_printf(bio_err,"Getting CA Private Key\n");
|
BIO_printf(bio_err,"Getting CA Private Key\n");
|
||||||
if (CAkeyfile != NULL)
|
if (CAkeyfile != NULL)
|
||||||
{
|
{
|
||||||
CApkey=load_key(CAkeyfile,CAkeyformat, passin);
|
CApkey=load_key(bio_err,
|
||||||
|
CAkeyfile, CAkeyformat,
|
||||||
|
0, passin, e,
|
||||||
|
"CA Private Key");
|
||||||
if (CApkey == NULL) goto end;
|
if (CApkey == NULL) goto end;
|
||||||
}
|
}
|
||||||
#ifndef NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (CApkey->type == EVP_PKEY_DSA)
|
if (CApkey->type == EVP_PKEY_DSA)
|
||||||
digest=EVP_dss1();
|
digest=EVP_dss1();
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_ECDSA
|
||||||
|
if (CApkey->type == EVP_PKEY_EC)
|
||||||
|
digest = EVP_ecdsa();
|
||||||
|
#endif
|
||||||
|
|
||||||
assert(need_rand);
|
assert(need_rand);
|
||||||
if (!x509_certify(ctx,CAfile,digest,x,xca,
|
if (!x509_certify(ctx,CAfile,digest,x,xca,
|
||||||
CApkey, CAserial,CA_createserial,days, clrext,
|
CApkey, CAserial,CA_createserial,days, clrext,
|
||||||
extconf, extsect))
|
extconf, extsect, sno))
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
else if (x509req == i)
|
else if (x509req == i)
|
||||||
@@ -808,14 +917,22 @@ bad:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pk=load_key(keyfile,FORMAT_PEM, passin);
|
pk=load_key(bio_err,
|
||||||
|
keyfile, FORMAT_PEM, 0,
|
||||||
|
passin, e, "request key");
|
||||||
if (pk == NULL) goto end;
|
if (pk == NULL) goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err,"Generating certificate request\n");
|
BIO_printf(bio_err,"Generating certificate request\n");
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_DSA
|
||||||
if (pk->type == EVP_PKEY_DSA)
|
if (pk->type == EVP_PKEY_DSA)
|
||||||
digest=EVP_dss1();
|
digest=EVP_dss1();
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_ECDSA
|
||||||
|
if (pk->type == EVP_PKEY_EC)
|
||||||
|
digest=EVP_ecdsa();
|
||||||
|
#endif
|
||||||
|
|
||||||
rq=X509_to_X509_REQ(x,pk,digest);
|
rq=X509_to_X509_REQ(x,pk,digest);
|
||||||
EVP_PKEY_free(pk);
|
EVP_PKEY_free(pk);
|
||||||
@@ -831,8 +948,29 @@ bad:
|
|||||||
}
|
}
|
||||||
noout=1;
|
noout=1;
|
||||||
}
|
}
|
||||||
|
else if (ocspid == i)
|
||||||
|
{
|
||||||
|
X509_ocspid_print(out, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkend)
|
||||||
|
{
|
||||||
|
time_t tnow=time(NULL);
|
||||||
|
|
||||||
|
if (ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(x), tnow+checkoffset) == -1)
|
||||||
|
{
|
||||||
|
BIO_printf(out,"Certificate will expire\n");
|
||||||
|
ret=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BIO_printf(out,"Certificate will not expire\n");
|
||||||
|
ret=0;
|
||||||
|
}
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
if (noout)
|
if (noout)
|
||||||
{
|
{
|
||||||
@@ -842,16 +980,18 @@ bad:
|
|||||||
|
|
||||||
if (outformat == FORMAT_ASN1)
|
if (outformat == FORMAT_ASN1)
|
||||||
i=i2d_X509_bio(out,x);
|
i=i2d_X509_bio(out,x);
|
||||||
else if (outformat == FORMAT_PEM) {
|
else if (outformat == FORMAT_PEM)
|
||||||
|
{
|
||||||
if (trustout) i=PEM_write_bio_X509_AUX(out,x);
|
if (trustout) i=PEM_write_bio_X509_AUX(out,x);
|
||||||
else i=PEM_write_bio_X509(out,x);
|
else i=PEM_write_bio_X509(out,x);
|
||||||
} else if (outformat == FORMAT_NETSCAPE)
|
}
|
||||||
|
else if (outformat == FORMAT_NETSCAPE)
|
||||||
{
|
{
|
||||||
ASN1_HEADER ah;
|
ASN1_HEADER ah;
|
||||||
ASN1_OCTET_STRING os;
|
ASN1_OCTET_STRING os;
|
||||||
|
|
||||||
os.data=(unsigned char *)CERT_HDR;
|
os.data=(unsigned char *)NETSCAPE_CERT_HDR;
|
||||||
os.length=strlen(CERT_HDR);
|
os.length=strlen(NETSCAPE_CERT_HDR);
|
||||||
ah.header= &os;
|
ah.header= &os;
|
||||||
ah.data=(char *)x;
|
ah.data=(char *)x;
|
||||||
ah.meth=X509_asn1_meth();
|
ah.meth=X509_asn1_meth();
|
||||||
@@ -863,7 +1003,8 @@ bad:
|
|||||||
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
BIO_printf(bio_err,"bad output format specified for outfile\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (!i) {
|
if (!i)
|
||||||
|
{
|
||||||
BIO_printf(bio_err,"unable to write certificate\n");
|
BIO_printf(bio_err,"unable to write certificate\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
@@ -873,9 +1014,9 @@ end:
|
|||||||
if (need_rand)
|
if (need_rand)
|
||||||
app_RAND_write_file(NULL, bio_err);
|
app_RAND_write_file(NULL, bio_err);
|
||||||
OBJ_cleanup();
|
OBJ_cleanup();
|
||||||
CONF_free(extconf);
|
NCONF_free(extconf);
|
||||||
BIO_free(out);
|
BIO_free_all(out);
|
||||||
BIO_free(STDout);
|
BIO_free_all(STDout);
|
||||||
X509_STORE_free(ctx);
|
X509_STORE_free(ctx);
|
||||||
X509_REQ_free(req);
|
X509_REQ_free(req);
|
||||||
X509_free(x);
|
X509_free(x);
|
||||||
@@ -883,32 +1024,23 @@ end:
|
|||||||
EVP_PKEY_free(Upkey);
|
EVP_PKEY_free(Upkey);
|
||||||
EVP_PKEY_free(CApkey);
|
EVP_PKEY_free(CApkey);
|
||||||
X509_REQ_free(rq);
|
X509_REQ_free(rq);
|
||||||
|
ASN1_INTEGER_free(sno);
|
||||||
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
|
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
|
||||||
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
|
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
|
||||||
if(passin) Free(passin);
|
if (passin) OPENSSL_free(passin);
|
||||||
EXIT(ret);
|
apps_shutdown();
|
||||||
|
OPENSSL_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
static ASN1_INTEGER *load_serial(char *CAfile, char *serialfile, int create)
|
||||||
X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
|
|
||||||
int days, int clrext, LHASH *conf, char *section)
|
|
||||||
{
|
{
|
||||||
int ret=0;
|
|
||||||
BIO *io=NULL;
|
|
||||||
MS_STATIC char buf2[1024];
|
|
||||||
char *buf = NULL, *p;
|
char *buf = NULL, *p;
|
||||||
|
MS_STATIC char buf2[1024];
|
||||||
|
ASN1_INTEGER *bs = NULL, *bs2 = NULL;
|
||||||
|
BIO *io = NULL;
|
||||||
BIGNUM *serial = NULL;
|
BIGNUM *serial = NULL;
|
||||||
ASN1_INTEGER *bs=NULL,bs2;
|
|
||||||
X509_STORE_CTX xsc;
|
|
||||||
EVP_PKEY *upkey;
|
|
||||||
|
|
||||||
upkey = X509_get_pubkey(xca);
|
buf=OPENSSL_malloc( ((serialfile == NULL)
|
||||||
EVP_PKEY_copy_parameters(upkey,pkey);
|
|
||||||
EVP_PKEY_free(upkey);
|
|
||||||
|
|
||||||
X509_STORE_CTX_init(&xsc,ctx,x,NULL);
|
|
||||||
buf=Malloc(EVP_PKEY_size(pkey)*2+
|
|
||||||
((serialfile == NULL)
|
|
||||||
?(strlen(CAfile)+strlen(POSTFIX)+1)
|
?(strlen(CAfile)+strlen(POSTFIX)+1)
|
||||||
:(strlen(serialfile)))+1);
|
:(strlen(serialfile)))+1);
|
||||||
if (buf == NULL) { BIO_printf(bio_err,"out of mem\n"); goto end; }
|
if (buf == NULL) { BIO_printf(bio_err,"out of mem\n"); goto end; }
|
||||||
@@ -955,7 +1087,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!a2i_ASN1_INTEGER(io,bs,buf2,1024))
|
if (!a2i_ASN1_INTEGER(io,bs,buf2,sizeof buf2))
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"unable to load serial number from %s\n",buf);
|
BIO_printf(bio_err,"unable to load serial number from %s\n",buf);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
@@ -974,19 +1106,54 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
|||||||
|
|
||||||
if (!BN_add_word(serial,1))
|
if (!BN_add_word(serial,1))
|
||||||
{ BIO_printf(bio_err,"add_word failure\n"); goto end; }
|
{ BIO_printf(bio_err,"add_word failure\n"); goto end; }
|
||||||
bs2.data=(unsigned char *)buf2;
|
if (!(bs2 = BN_to_ASN1_INTEGER(serial, NULL)))
|
||||||
bs2.length=BN_bn2bin(serial,bs2.data);
|
{ BIO_printf(bio_err,"error converting bn 2 asn1_integer\n"); goto end; }
|
||||||
|
|
||||||
if (BIO_write_filename(io,buf) <= 0)
|
if (BIO_write_filename(io,buf) <= 0)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"error attempting to write serial number file\n");
|
BIO_printf(bio_err,"error attempting to write serial number file\n");
|
||||||
perror(buf);
|
perror(buf);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
i2a_ASN1_INTEGER(io,&bs2);
|
i2a_ASN1_INTEGER(io,bs2);
|
||||||
BIO_puts(io,"\n");
|
BIO_puts(io,"\n");
|
||||||
|
|
||||||
BIO_free(io);
|
BIO_free(io);
|
||||||
|
if (buf) OPENSSL_free(buf);
|
||||||
|
ASN1_INTEGER_free(bs2);
|
||||||
|
BN_free(serial);
|
||||||
io=NULL;
|
io=NULL;
|
||||||
|
return bs;
|
||||||
|
|
||||||
|
end:
|
||||||
|
if (buf) OPENSSL_free(buf);
|
||||||
|
BIO_free(io);
|
||||||
|
ASN1_INTEGER_free(bs);
|
||||||
|
BN_free(serial);
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||||
|
X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
|
||||||
|
int days, int clrext, CONF *conf, char *section, ASN1_INTEGER *sno)
|
||||||
|
{
|
||||||
|
int ret=0;
|
||||||
|
ASN1_INTEGER *bs=NULL;
|
||||||
|
X509_STORE_CTX xsc;
|
||||||
|
EVP_PKEY *upkey;
|
||||||
|
|
||||||
|
upkey = X509_get_pubkey(xca);
|
||||||
|
EVP_PKEY_copy_parameters(upkey,pkey);
|
||||||
|
EVP_PKEY_free(upkey);
|
||||||
|
|
||||||
|
if(!X509_STORE_CTX_init(&xsc,ctx,x,NULL))
|
||||||
|
{
|
||||||
|
BIO_printf(bio_err,"Error initialising X509 store\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (sno) bs = sno;
|
||||||
|
else if (!(bs = load_serial(CAfile, serialfile, create)))
|
||||||
|
goto end;
|
||||||
|
|
||||||
if (!X509_STORE_add_cert(ctx,x)) goto end;
|
if (!X509_STORE_add_cert(ctx,x)) goto end;
|
||||||
|
|
||||||
@@ -1012,16 +1179,18 @@ 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)
|
if (X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days) == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if(clrext) {
|
if (clrext)
|
||||||
|
{
|
||||||
while (X509_get_ext_count(x) > 0) X509_delete_ext(x, 0);
|
while (X509_get_ext_count(x) > 0) X509_delete_ext(x, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(conf) {
|
if (conf)
|
||||||
|
{
|
||||||
X509V3_CTX ctx2;
|
X509V3_CTX ctx2;
|
||||||
X509_set_version(x,2); /* version 3 certificate */
|
X509_set_version(x,2); /* version 3 certificate */
|
||||||
X509V3_set_ctx(&ctx2, xca, x, NULL, NULL, 0);
|
X509V3_set_ctx(&ctx2, xca, x, NULL, NULL, 0);
|
||||||
X509V3_set_conf_lhash(&ctx2, conf);
|
X509V3_set_nconf(&ctx2, conf);
|
||||||
if(!X509V3_EXT_add_conf(conf, &ctx2, section, x)) goto end;
|
if (!X509V3_EXT_add_nconf(conf, &ctx2, section, x)) goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!X509_sign(x,pkey,digest)) goto end;
|
if (!X509_sign(x,pkey,digest)) goto end;
|
||||||
@@ -1030,16 +1199,12 @@ end:
|
|||||||
X509_STORE_CTX_cleanup(&xsc);
|
X509_STORE_CTX_cleanup(&xsc);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
if (buf != NULL) Free(buf);
|
if (!sno) ASN1_INTEGER_free(bs);
|
||||||
if (bs != NULL) ASN1_INTEGER_free(bs);
|
return ret;
|
||||||
if (io != NULL) BIO_free(io);
|
|
||||||
if (serial != NULL) BN_free(serial);
|
|
||||||
return(ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
|
static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
|
||||||
{
|
{
|
||||||
char buf[256];
|
|
||||||
int err;
|
int err;
|
||||||
X509 *err_cert;
|
X509 *err_cert;
|
||||||
|
|
||||||
@@ -1048,7 +1213,7 @@ static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
|
|||||||
* final ok == 1 calls to this function */
|
* final ok == 1 calls to this function */
|
||||||
err=X509_STORE_CTX_get_error(ctx);
|
err=X509_STORE_CTX_get_error(ctx);
|
||||||
if (err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT)
|
if (err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT)
|
||||||
return(1);
|
return 1;
|
||||||
|
|
||||||
/* BAD we should have gotten an error. Normally if everything
|
/* BAD we should have gotten an error. Normally if everything
|
||||||
* worked X509_STORE_CTX_get_error(ctx) will still be set to
|
* worked X509_STORE_CTX_get_error(ctx) will still be set to
|
||||||
@@ -1056,150 +1221,22 @@ static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
|
|||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err,"error with certificate to be certified - should be self signed\n");
|
BIO_printf(bio_err,"error with certificate to be certified - should be self signed\n");
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err_cert=X509_STORE_CTX_get_current_cert(ctx);
|
err_cert=X509_STORE_CTX_get_current_cert(ctx);
|
||||||
X509_NAME_oneline(X509_get_subject_name(err_cert),buf,256);
|
print_name(bio_err, NULL, X509_get_subject_name(err_cert),0);
|
||||||
BIO_printf(bio_err,"%s\n",buf);
|
|
||||||
BIO_printf(bio_err,"error with certificate - error %d at depth %d\n%s\n",
|
BIO_printf(bio_err,"error with certificate - error %d at depth %d\n%s\n",
|
||||||
err,X509_STORE_CTX_get_error_depth(ctx),
|
err,X509_STORE_CTX_get_error_depth(ctx),
|
||||||
X509_verify_cert_error_string(err));
|
X509_verify_cert_error_string(err));
|
||||||
return(1);
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static EVP_PKEY *load_key(char *file, int format, char *passin)
|
|
||||||
{
|
|
||||||
BIO *key=NULL;
|
|
||||||
EVP_PKEY *pkey=NULL;
|
|
||||||
|
|
||||||
if (file == NULL)
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"no keyfile specified\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
key=BIO_new(BIO_s_file());
|
|
||||||
if (key == NULL)
|
|
||||||
{
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (BIO_read_filename(key,file) <= 0)
|
|
||||||
{
|
|
||||||
perror(file);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (format == FORMAT_ASN1)
|
|
||||||
{
|
|
||||||
pkey=d2i_PrivateKey_bio(key, NULL);
|
|
||||||
}
|
|
||||||
else if (format == FORMAT_PEM)
|
|
||||||
{
|
|
||||||
pkey=PEM_read_bio_PrivateKey(key,NULL,NULL,passin);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"bad input format specified for key\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
end:
|
|
||||||
if (key != NULL) BIO_free(key);
|
|
||||||
if (pkey == NULL)
|
|
||||||
BIO_printf(bio_err,"unable to load Private Key\n");
|
|
||||||
return(pkey);
|
|
||||||
}
|
|
||||||
|
|
||||||
static X509 *load_cert(char *file, int format)
|
|
||||||
{
|
|
||||||
ASN1_HEADER *ah=NULL;
|
|
||||||
BUF_MEM *buf=NULL;
|
|
||||||
X509 *x=NULL;
|
|
||||||
BIO *cert;
|
|
||||||
|
|
||||||
if ((cert=BIO_new(BIO_s_file())) == NULL)
|
|
||||||
{
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file == NULL)
|
|
||||||
BIO_set_fp(cert,stdin,BIO_NOCLOSE);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (BIO_read_filename(cert,file) <= 0)
|
|
||||||
{
|
|
||||||
perror(file);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (format == FORMAT_ASN1)
|
|
||||||
x=d2i_X509_bio(cert,NULL);
|
|
||||||
else if (format == FORMAT_NETSCAPE)
|
|
||||||
{
|
|
||||||
unsigned char *p,*op;
|
|
||||||
int size=0,i;
|
|
||||||
|
|
||||||
/* We sort of have to do it this way because it is sort of nice
|
|
||||||
* to read the header first and check it, then
|
|
||||||
* try to read the certificate */
|
|
||||||
buf=BUF_MEM_new();
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
if ((buf == NULL) || (!BUF_MEM_grow(buf,size+1024*10)))
|
|
||||||
goto end;
|
|
||||||
i=BIO_read(cert,&(buf->data[size]),1024*10);
|
|
||||||
size+=i;
|
|
||||||
if (i == 0) break;
|
|
||||||
if (i < 0)
|
|
||||||
{
|
|
||||||
perror("reading certificate");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p=(unsigned char *)buf->data;
|
|
||||||
op=p;
|
|
||||||
|
|
||||||
/* First load the header */
|
|
||||||
if ((ah=d2i_ASN1_HEADER(NULL,&p,(long)size)) == NULL)
|
|
||||||
goto end;
|
|
||||||
if ((ah->header == NULL) || (ah->header->data == NULL) ||
|
|
||||||
(strncmp(CERT_HDR,(char *)ah->header->data,
|
|
||||||
ah->header->length) != 0))
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"Error reading header on certificate\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
/* header is ok, so now read the object */
|
|
||||||
p=op;
|
|
||||||
ah->meth=X509_asn1_meth();
|
|
||||||
if ((ah=d2i_ASN1_HEADER(&ah,&p,(long)size)) == NULL)
|
|
||||||
goto end;
|
|
||||||
x=(X509 *)ah->data;
|
|
||||||
ah->data=NULL;
|
|
||||||
}
|
|
||||||
else if (format == FORMAT_PEM)
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
end:
|
|
||||||
if (x == NULL)
|
|
||||||
{
|
|
||||||
BIO_printf(bio_err,"unable to load certificate\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
}
|
|
||||||
if (ah != NULL) ASN1_HEADER_free(ah);
|
|
||||||
if (cert != NULL) BIO_free(cert);
|
|
||||||
if (buf != NULL) BUF_MEM_free(buf);
|
|
||||||
return(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* self sign */
|
/* self sign */
|
||||||
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest,
|
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest,
|
||||||
LHASH *conf, char *section)
|
CONF *conf, char *section)
|
||||||
{
|
{
|
||||||
|
|
||||||
EVP_PKEY *pktmp;
|
EVP_PKEY *pktmp;
|
||||||
@@ -1220,21 +1257,23 @@ static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *dig
|
|||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (!X509_set_pubkey(x,pkey)) goto err;
|
if (!X509_set_pubkey(x,pkey)) goto err;
|
||||||
if(clrext) {
|
if (clrext)
|
||||||
|
{
|
||||||
while (X509_get_ext_count(x) > 0) X509_delete_ext(x, 0);
|
while (X509_get_ext_count(x) > 0) X509_delete_ext(x, 0);
|
||||||
}
|
}
|
||||||
if(conf) {
|
if (conf)
|
||||||
|
{
|
||||||
X509V3_CTX ctx;
|
X509V3_CTX ctx;
|
||||||
X509_set_version(x,2); /* version 3 certificate */
|
X509_set_version(x,2); /* version 3 certificate */
|
||||||
X509V3_set_ctx(&ctx, x, x, NULL, NULL, 0);
|
X509V3_set_ctx(&ctx, x, x, NULL, NULL, 0);
|
||||||
X509V3_set_conf_lhash(&ctx, conf);
|
X509V3_set_nconf(&ctx, conf);
|
||||||
if(!X509V3_EXT_add_conf(conf, &ctx, section, x)) goto err;
|
if (!X509V3_EXT_add_nconf(conf, &ctx, section, x)) goto err;
|
||||||
}
|
}
|
||||||
if (!X509_sign(x,pkey,digest)) goto err;
|
if (!X509_sign(x,pkey,digest)) goto err;
|
||||||
return(1);
|
return 1;
|
||||||
err:
|
err:
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt)
|
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt)
|
||||||
@@ -1243,7 +1282,8 @@ static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt)
|
|||||||
char *pname;
|
char *pname;
|
||||||
id = X509_PURPOSE_get_id(pt);
|
id = X509_PURPOSE_get_id(pt);
|
||||||
pname = X509_PURPOSE_get0_name(pt);
|
pname = X509_PURPOSE_get0_name(pt);
|
||||||
for(i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
idret = X509_check_purpose(cert, id, i);
|
idret = X509_check_purpose(cert, id, i);
|
||||||
BIO_printf(bio, "%s%s : ", pname, i ? " CA" : "");
|
BIO_printf(bio, "%s%s : ", pname, i ? " CA" : "");
|
||||||
if (idret == 1) BIO_printf(bio, "Yes\n");
|
if (idret == 1) BIO_printf(bio, "Yes\n");
|
||||||
@@ -1252,6 +1292,3 @@ static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt)
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <openssl/rc4.h>
|
#include <openssl/rc4.h>
|
||||||
#ifdef NO_DES
|
#ifdef OPENSSL_NO_DES
|
||||||
#include <des.h>
|
#include <des.h>
|
||||||
#else
|
#else
|
||||||
#include <openssl/des.h>
|
#include <openssl/des.h>
|
||||||
|
|||||||
19
certs/RegTP-4R.pem
Normal file
19
certs/RegTP-4R.pem
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
issuer= CN=4R-CA 1:PN+0.2.262.1.10.7.20=#130131,O=Regulierungsbeh\C3\88orde f\C3\88ur Telekommunikation und Post,C=DE
|
||||||
|
notBefore=Jan 21 16:04:53 1999 GMT
|
||||||
|
notAfter=Jan 21 16:04:53 2004 GMT
|
||||||
|
subject= CN=4R-CA 1:PN+0.2.262.1.10.7.20=#130131,O=Regulierungsbeh\C3\88orde f\C3\88ur Telekommunikation und Post,C=DE
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICZzCCAdOgAwIBAgIEOwVn1DAKBgYrJAMDAQIFADBvMQswCQYDVQQGEwJERTE9
|
||||||
|
MDsGA1UEChQ0UmVndWxpZXJ1bmdzYmVoyG9yZGUgZsh1ciBUZWxla29tbXVuaWth
|
||||||
|
dGlvbiB1bmQgUG9zdDEhMAwGBwKCBgEKBxQTATEwEQYDVQQDFAo0Ui1DQSAxOlBO
|
||||||
|
MCIYDzE5OTkwMTIxMTYwNDUzWhgPMjAwNDAxMjExNjA0NTNaMG8xCzAJBgNVBAYT
|
||||||
|
AkRFMT0wOwYDVQQKFDRSZWd1bGllcnVuZ3NiZWjIb3JkZSBmyHVyIFRlbGVrb21t
|
||||||
|
dW5pa2F0aW9uIHVuZCBQb3N0MSEwDAYHAoIGAQoHFBMBMTARBgNVBAMUCjRSLUNB
|
||||||
|
IDE6UE4wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGAjzHbq2asUlqeWbXTQHso
|
||||||
|
aVF6YIPVH3c/B2cbuy9HJ/lnE6x0asOzM2DGDqi47xkdAxPc0LZ0fxO87rkmz7xs
|
||||||
|
jJObnVrMXpyUSDSp5Y0wqKJdsFdr6mGFOQZteIti8AJnr8xMkwnWVyuOlEXsFe1h
|
||||||
|
5gxwQXrOcPinE6qu1t/3PmECBMAAAAGjEjAQMA4GA1UdDwEB/wQEAwIBBjAKBgYr
|
||||||
|
JAMDAQIFAAOBgQA+RdocBmA2VV9E5aKPBcp01tdZAvvW9Tve3docArVKR/4/yvSX
|
||||||
|
Z+wvzzk+uu4qBp49HN3nqPYMrzbTmjBFu4ce5fkZ7dHF0W1sSBL0rox5z36Aq2re
|
||||||
|
JjfEOEmSnNe0+opuh4FSVOssXblXTE8lEQU0FhhItgDx2ADnWZibaxLG4w==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
19
certs/RegTP-5R.pem
Normal file
19
certs/RegTP-5R.pem
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
issuer= CN=5R-CA 1:PN+0.2.262.1.10.7.20=#130131,O=Regulierungsbeh\C3\88orde f\C3\88ur Telekommunikation und Post,C=DE
|
||||||
|
notBefore=Mar 22 08:55:51 2000 GMT
|
||||||
|
notAfter=Mar 22 08:55:51 2005 GMT
|
||||||
|
subject= CN=5R-CA 1:PN+0.2.262.1.10.7.20=#130131,O=Regulierungsbeh\C3\88orde f\C3\88ur Telekommunikation und Post,C=DE
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICaDCCAdSgAwIBAgIDDIOqMAoGBiskAwMBAgUAMG8xCzAJBgNVBAYTAkRFMT0w
|
||||||
|
OwYDVQQKFDRSZWd1bGllcnVuZ3NiZWjIb3JkZSBmyHVyIFRlbGVrb21tdW5pa2F0
|
||||||
|
aW9uIHVuZCBQb3N0MSEwDAYHAoIGAQoHFBMBMTARBgNVBAMUCjVSLUNBIDE6UE4w
|
||||||
|
IhgPMjAwMDAzMjIwODU1NTFaGA8yMDA1MDMyMjA4NTU1MVowbzELMAkGA1UEBhMC
|
||||||
|
REUxPTA7BgNVBAoUNFJlZ3VsaWVydW5nc2JlaMhvcmRlIGbIdXIgVGVsZWtvbW11
|
||||||
|
bmlrYXRpb24gdW5kIFBvc3QxITAMBgcCggYBCgcUEwExMBEGA1UEAxQKNVItQ0Eg
|
||||||
|
MTpQTjCBoTANBgkqhkiG9w0BAQEFAAOBjwAwgYsCgYEAih5BUycfBpqKhU8RDsaS
|
||||||
|
vV5AtzWeXQRColL9CH3t0DKnhjKAlJ8iccFtJNv+d3bh8bb9sh0maRSo647xP7hs
|
||||||
|
HTjKgTE4zM5BYNfXvST79OtcMgAzrnDiGjQIIWv8xbfV1MqxxdtZJygrwzRMb9jG
|
||||||
|
CAGoJEymoyzAMNG7tSdBWnUCBQDAAAABoxIwEDAOBgNVHQ8BAf8EBAMCAQYwCgYG
|
||||||
|
KyQDAwECBQADgYEAOaK8ihVSBUcL2IdVBxZYYUKwMz5m7H3zqhN8W9w+iafWudH6
|
||||||
|
b+aahkbENEwzg3C3v5g8nze7v7ssacQze657LHjP+e7ksUDIgcS4R1pU2eN16bjS
|
||||||
|
P/qGPF3rhrIEHoK5nJULkjkZYTtNiOvmQ/+G70TXDi3Os/TwLlWRvu+7YLM=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
19
certs/RegTP-6R.pem
Normal file
19
certs/RegTP-6R.pem
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
issuer= CN=6R-Ca 1:PN+0.2.262.1.10.7.20=#130131,O=Regulierungsbeh\C3\88orde f\C3\88ur Telekommunikation und Post,C=DE
|
||||||
|
notBefore=Feb 1 09:52:17 2001 GMT
|
||||||
|
notAfter=Jun 1 09:52:17 2005 GMT
|
||||||
|
subject= CN=6R-Ca 1:PN+0.2.262.1.10.7.20=#130131,O=Regulierungsbeh\C3\88orde f\C3\88ur Telekommunikation und Post,C=DE
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICaDCCAdSgAwIBAgIDMtGNMAoGBiskAwMBAgUAMG8xCzAJBgNVBAYTAkRFMT0w
|
||||||
|
OwYDVQQKFDRSZWd1bGllcnVuZ3NiZWjIb3JkZSBmyHVyIFRlbGVrb21tdW5pa2F0
|
||||||
|
aW9uIHVuZCBQb3N0MSEwDAYHAoIGAQoHFBMBMTARBgNVBAMUCjZSLUNhIDE6UE4w
|
||||||
|
IhgPMjAwMTAyMDEwOTUyMTdaGA8yMDA1MDYwMTA5NTIxN1owbzELMAkGA1UEBhMC
|
||||||
|
REUxPTA7BgNVBAoUNFJlZ3VsaWVydW5nc2JlaMhvcmRlIGbIdXIgVGVsZWtvbW11
|
||||||
|
bmlrYXRpb24gdW5kIFBvc3QxITAMBgcCggYBCgcUEwExMBEGA1UEAxQKNlItQ2Eg
|
||||||
|
MTpQTjCBoTANBgkqhkiG9w0BAQEFAAOBjwAwgYsCgYEAg6KrFSTNXKqe+2GKGeW2
|
||||||
|
wTmbVeflNkp5H/YxA9K1zmEn5XjKm0S0jH4Wfms6ipPlURVaFwTfnB1s++AnJAWf
|
||||||
|
mayaE9BP/pdIY6WtZGgW6aZc32VDMCMKPWyBNyagsJVDmzlakIA5cXBVa7Xqqd3P
|
||||||
|
ew8i2feMnQXcqHfDv02CW88CBQDAAAABoxIwEDAOBgNVHQ8BAf8EBAMCAQYwCgYG
|
||||||
|
KyQDAwECBQADgYEAOkqkUwdaTCt8wcJLA2zLuOwL5ADHMWLhv6gr5zEF+VckA6qe
|
||||||
|
IVLVf8e7fYlRmzQd+5OJcGglCQJLGT+ZplI3Mjnrd4plkoTNKV4iOzBcvJD7K4tn
|
||||||
|
XPvs9wCFcC7QU7PLvc1FDsAlr7e4wyefZRDL+wbqNfI7QZTSF1ubLd9AzeQ=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
460
config
460
config
@@ -20,6 +20,31 @@
|
|||||||
# Be as similar to the output of config.guess/config.sub
|
# Be as similar to the output of config.guess/config.sub
|
||||||
# as possible.
|
# as possible.
|
||||||
|
|
||||||
|
PREFIX=""
|
||||||
|
SUFFIX=""
|
||||||
|
TEST="false"
|
||||||
|
|
||||||
|
# pick up any command line args to config
|
||||||
|
for i
|
||||||
|
do
|
||||||
|
case "$i" in
|
||||||
|
-d*) PREFIX="debug-";;
|
||||||
|
-t*) TEST="true";;
|
||||||
|
-h*) TEST="true"; cat <<EOF
|
||||||
|
Usage: config [options]
|
||||||
|
-d Add a debug- prefix to machine choice.
|
||||||
|
-t Test mode, do not run the Configure perl script.
|
||||||
|
-h This help.
|
||||||
|
|
||||||
|
Any other text will be passed to the Configure perl script.
|
||||||
|
See INSTALL for instructions.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
*) options=$options" $i" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# First get uname entries that we use below
|
# First get uname entries that we use below
|
||||||
|
|
||||||
MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
|
MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
|
||||||
@@ -49,10 +74,18 @@ if [ "x$XREL" != "x" ]; then
|
|||||||
echo "whatever-whatever-sco5"; exit 0
|
echo "whatever-whatever-sco5"; exit 0
|
||||||
;;
|
;;
|
||||||
4.2MP)
|
4.2MP)
|
||||||
if [ "x$VERSION" = "x2.1.1" ]; then
|
if [ "x$VERSION" = "x2.01" ]; then
|
||||||
|
echo "${MACHINE}-whatever-unixware201"; exit 0
|
||||||
|
elif [ "x$VERSION" = "x2.02" ]; then
|
||||||
|
echo "${MACHINE}-whatever-unixware202"; exit 0
|
||||||
|
elif [ "x$VERSION" = "x2.03" ]; then
|
||||||
|
echo "${MACHINE}-whatever-unixware203"; exit 0
|
||||||
|
elif [ "x$VERSION" = "x2.1.1" ]; then
|
||||||
echo "${MACHINE}-whatever-unixware211"; exit 0
|
echo "${MACHINE}-whatever-unixware211"; exit 0
|
||||||
elif [ "x$VERSION" = "x2.1.2" ]; then
|
elif [ "x$VERSION" = "x2.1.2" ]; then
|
||||||
echo "${MACHINE}-whatever-unixware212"; exit 0
|
echo "${MACHINE}-whatever-unixware212"; exit 0
|
||||||
|
elif [ "x$VERSION" = "x2.1.3" ]; then
|
||||||
|
echo "${MACHINE}-whatever-unixware213"; exit 0
|
||||||
else
|
else
|
||||||
echo "${MACHINE}-whatever-unixware2"; exit 0
|
echo "${MACHINE}-whatever-unixware2"; exit 0
|
||||||
fi
|
fi
|
||||||
@@ -60,6 +93,11 @@ if [ "x$XREL" != "x" ]; then
|
|||||||
4.2)
|
4.2)
|
||||||
echo "whatever-whatever-unixware1"; exit 0
|
echo "whatever-whatever-unixware1"; exit 0
|
||||||
;;
|
;;
|
||||||
|
OpenUNIX)
|
||||||
|
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x8" ]; then
|
||||||
|
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
5)
|
5)
|
||||||
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
|
if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
|
||||||
echo "${MACHINE}-sco-unixware7"; exit 0
|
echo "${MACHINE}-sco-unixware7"; exit 0
|
||||||
@@ -71,10 +109,22 @@ fi
|
|||||||
# Now we simply scan though... In most cases, the SYSTEM info is enough
|
# Now we simply scan though... In most cases, the SYSTEM info is enough
|
||||||
#
|
#
|
||||||
case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||||
|
MPE/iX:*)
|
||||||
|
MACHINE=`echo "$MACHINE" | sed -e 's/-/_/g'`
|
||||||
|
echo "parisc-hp-MPE/iX"; exit 0
|
||||||
|
;;
|
||||||
A/UX:*)
|
A/UX:*)
|
||||||
echo "m68k-apple-aux3"; exit 0
|
echo "m68k-apple-aux3"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
AIX:[3456789]:4:*)
|
||||||
|
echo "${MACHINE}-ibm-aix43"; exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
AIX:*:[56789]:*)
|
||||||
|
echo "${MACHINE}-ibm-aix43"; exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
AIX:*)
|
AIX:*)
|
||||||
echo "${MACHINE}-ibm-aix"; exit 0
|
echo "${MACHINE}-ibm-aix"; exit 0
|
||||||
;;
|
;;
|
||||||
@@ -90,10 +140,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
HP-UX:*)
|
HP-UX:*)
|
||||||
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||||
case "$HPUXVER" in
|
case "$HPUXVER" in
|
||||||
11.*)
|
1[0-9].*) # HPUX 10 and 11 targets are unified
|
||||||
echo "${MACHINE}-hp-hpux11"; exit 0
|
|
||||||
;;
|
|
||||||
10.*)
|
|
||||||
echo "${MACHINE}-hp-hpux10"; exit 0
|
echo "${MACHINE}-hp-hpux10"; exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -122,6 +169,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
echo "${MACHINE}-whatever-linux1"; exit 0
|
echo "${MACHINE}-whatever-linux1"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
GNU*)
|
||||||
|
echo "hurd-x86"; exit 0;
|
||||||
|
;;
|
||||||
|
|
||||||
LynxOS:*)
|
LynxOS:*)
|
||||||
echo "${MACHINE}-lynx-lynxos"; exit 0
|
echo "${MACHINE}-lynx-lynxos"; exit 0
|
||||||
;;
|
;;
|
||||||
@@ -164,7 +215,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
NetBSD:*:*:*386*)
|
NetBSD:*:*:*386*)
|
||||||
echo "`sysctl -n hw.model | sed 's,.*\(.\)86-class.*,i\186,'`-whateve\r-netbsd"; exit 0
|
echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
NetBSD:*)
|
NetBSD:*)
|
||||||
@@ -175,17 +226,35 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
echo "${MACHINE}-whatever-openbsd"; exit 0
|
echo "${MACHINE}-whatever-openbsd"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
OpenUNIX:*)
|
||||||
|
echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
OSF1:*:*:*alpha*)
|
OSF1:*:*:*alpha*)
|
||||||
|
OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
|
||||||
|
case "$OSFMAJOR" in
|
||||||
|
4|5)
|
||||||
|
echo "${MACHINE}-dec-tru64"; exit 0
|
||||||
|
;;
|
||||||
|
1|2|3)
|
||||||
echo "${MACHINE}-dec-osf"; exit 0
|
echo "${MACHINE}-dec-osf"; exit 0
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
echo "${MACHINE}-dec-osf"; exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
QNX:*)
|
QNX:*)
|
||||||
case "$VERSION" in
|
case "$RELEASE" in
|
||||||
423)
|
4*)
|
||||||
echo "${MACHINE}-qssl-qnx32"
|
echo "${MACHINE}-whatever-qnx4"
|
||||||
|
;;
|
||||||
|
6*)
|
||||||
|
echo "${MACHINE}-whatever-qnx6"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "${MACHINE}-qssl-qnx"
|
echo "${MACHINE}-whatever-qnx"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
@@ -199,8 +268,20 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
echo "ppc-apple-rhapsody"; exit 0
|
echo "ppc-apple-rhapsody"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Darwin:*)
|
||||||
|
case "$MACHINE" in
|
||||||
|
Power*)
|
||||||
|
echo "ppc-apple-darwin${VERSION}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "i386-apple-darwin${VERSION}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
SunOS:5.*)
|
SunOS:5.*)
|
||||||
echo "${MACHINE}-sun-solaris2"; exit 0
|
echo "${MACHINE}-whatever-solaris2"; exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
SunOS:*)
|
SunOS:*)
|
||||||
@@ -247,6 +328,33 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
|||||||
echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
|
echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
NEWS-OS:4.*)
|
||||||
|
echo "mips-sony-newsos4"; exit 0;
|
||||||
|
;;
|
||||||
|
|
||||||
|
CYGWIN*)
|
||||||
|
case "$RELEASE" in
|
||||||
|
[bB]*|1.0|1.[12].*)
|
||||||
|
echo "${MACHINE}-whatever-cygwin_pre1.3"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "${MACHINE}-whatever-cygwin"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
*"CRAY T3E")
|
||||||
|
echo "t3e-cray-unicosmk"; exit 0;
|
||||||
|
;;
|
||||||
|
|
||||||
|
*CRAY*)
|
||||||
|
echo "j90-cray-unicos"; exit 0;
|
||||||
|
;;
|
||||||
|
|
||||||
|
NONSTOP_KERNEL*)
|
||||||
|
echo "nsr-tandem-nsk"; exit 0;
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -284,47 +392,45 @@ exit 0
|
|||||||
# this is where the translation occurs into SSLeay terms
|
# this is where the translation occurs into SSLeay terms
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
PREFIX=""
|
|
||||||
SUFFIX=""
|
|
||||||
TEST="false"
|
|
||||||
|
|
||||||
# pick up any command line args to config
|
|
||||||
for i
|
|
||||||
do
|
|
||||||
case "$i" in
|
|
||||||
# shared library support (behnke@trustcenter.de)
|
|
||||||
-shared) SHARED=true;;
|
|
||||||
-d*) PREFIX="debug-";;
|
|
||||||
-t*) TEST="true";;
|
|
||||||
-h*) TEST="true"; cat <<EOF
|
|
||||||
Usage: config [options]
|
|
||||||
-d Add a debug- prefix to machine choice.
|
|
||||||
-t Test mode, do not run the Configure perl script.
|
|
||||||
-h This help.
|
|
||||||
|
|
||||||
Any other text will be passed to the Configure perl script.
|
|
||||||
See INSTALL for instructions.
|
|
||||||
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
*) options=$options" $i" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# figure out if gcc is available and if so we use it otherwise
|
# figure out if gcc is available and if so we use it otherwise
|
||||||
# we fallback to whatever cc does on the system
|
# we fallback to whatever cc does on the system
|
||||||
GCCVER=`(gcc --version) 2>/dev/null`
|
GCCVER=`(gcc -dumpversion) 2>/dev/null`
|
||||||
if [ "$GCCVER" != "" ]; then
|
if [ "$GCCVER" != "" ]; then
|
||||||
CC=gcc
|
CC=gcc
|
||||||
# then strip off whatever prefix Cygnus prepends the number with...
|
# then strip off whatever prefix egcs prepends the number with...
|
||||||
GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'`
|
# Hopefully, this will work for any future prefixes as well.
|
||||||
|
GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z]*\-//'`
|
||||||
|
# Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
|
||||||
|
# does give us what we want though, so we use that. We just just the
|
||||||
|
# major and minor version numbers.
|
||||||
# peak single digit before and after first dot, e.g. 2.95.1 gives 29
|
# peak single digit before and after first dot, e.g. 2.95.1 gives 29
|
||||||
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||||
else
|
else
|
||||||
CC=cc
|
CC=cc
|
||||||
fi
|
fi
|
||||||
|
GCCVER=${GCCVER:-0}
|
||||||
|
if [ "$SYSTEM" = "HP-UX" ];then
|
||||||
|
# By default gcc is a ILP32 compiler (with long long == 64).
|
||||||
|
GCC_BITS="32"
|
||||||
|
if [ $GCCVER -ge 30 ]; then
|
||||||
|
# PA64 support only came in with gcc 3.0.x.
|
||||||
|
# We look for the preprocessor symbol __LP64__ indicating
|
||||||
|
# 64bit bit long and pointer. sizeof(int) == 32 on HPUX64.
|
||||||
|
if gcc -v -E -x c /dev/null 2>&1 | grep __LP64__ > /dev/null; then
|
||||||
|
GCC_BITS="64"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
if [ "$SYSTEM" = "SunOS" ]; then
|
if [ "$SYSTEM" = "SunOS" ]; then
|
||||||
|
if [ $GCCVER -ge 30 ]; then
|
||||||
|
# 64-bit ABI isn't officially supported in gcc 3.0, but it appears
|
||||||
|
# to be working, at the very least 'make test' passes...
|
||||||
|
if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then
|
||||||
|
GCC_ARCH="-m64"
|
||||||
|
else
|
||||||
|
GCC_ARCH="-m32"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
# check for WorkShop C, expected output is "cc: blah-blah C x.x"
|
# check for WorkShop C, expected output is "cc: blah-blah C x.x"
|
||||||
CCVER=`(cc -V 2>&1) 2>/dev/null | \
|
CCVER=`(cc -V 2>&1) 2>/dev/null | \
|
||||||
egrep -e '^cc: .* C [0-9]\.[0-9]' | \
|
egrep -e '^cc: .* C [0-9]\.[0-9]' | \
|
||||||
@@ -355,7 +461,6 @@ if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GCCVER=${GCCVER:-0}
|
|
||||||
CCVER=${CCVER:-0}
|
CCVER=${CCVER:-0}
|
||||||
|
|
||||||
# read the output of the embedded GuessOS
|
# read the output of the embedded GuessOS
|
||||||
@@ -387,10 +492,18 @@ case "$GUESSOS" in
|
|||||||
;;
|
;;
|
||||||
mips4-sgi-irix64)
|
mips4-sgi-irix64)
|
||||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||||
echo " invoke './Configre irix64-mips4-$CC' *manually*."
|
echo " invoke './Configure irix64-mips4-$CC' *manually*."
|
||||||
echo " Type Ctrl-C if you don't want to continue."
|
if [ "$TEST" = "false" ]; then
|
||||||
read waste < /dev/tty
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
|
fi
|
||||||
|
CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
|
||||||
|
CPU=${CPU:-0}
|
||||||
|
if [ $CPU -ge 5000 ]; then
|
||||||
options="$options -mips4"
|
options="$options -mips4"
|
||||||
|
else
|
||||||
|
options="$options -mips3"
|
||||||
|
fi
|
||||||
OUT="irix-mips3-$CC"
|
OUT="irix-mips3-$CC"
|
||||||
;;
|
;;
|
||||||
alpha-*-linux2)
|
alpha-*-linux2)
|
||||||
@@ -407,41 +520,124 @@ case "$GUESSOS" in
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
mips-*-linux?) OUT="linux-mips" ;;
|
mips-*-linux?)
|
||||||
|
cat >dummy.c <<EOF
|
||||||
|
#include <stdio.h> /* for printf() prototype */
|
||||||
|
int main (argc, argv) int argc; char *argv[]; {
|
||||||
|
#ifdef __MIPSEB__
|
||||||
|
printf ("linux-%s\n", argv[1]);
|
||||||
|
#endif
|
||||||
|
#ifdef __MIPSEL__
|
||||||
|
printf ("linux-%sel\n", argv[1]);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
|
||||||
|
rm dummy dummy.c
|
||||||
|
;;
|
||||||
|
ppc64-*-linux2)
|
||||||
|
#Use the standard target for PPC architecture until we create a
|
||||||
|
#special one for the 64bit architecture.
|
||||||
|
OUT="linux-ppc" ;;
|
||||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||||
|
m68k-*-linux*) OUT="linux-m68k" ;;
|
||||||
ia64-*-linux?) OUT="linux-ia64" ;;
|
ia64-*-linux?) OUT="linux-ia64" ;;
|
||||||
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
||||||
|
ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
|
||||||
|
i386-apple-darwin*) OUT="darwin-i386-cc" ;;
|
||||||
sparc64-*-linux2)
|
sparc64-*-linux2)
|
||||||
#Before we can uncomment following lines we have to wait at least
|
echo "WARNING! If *know* that your GNU C supports 64-bit/V9 ABI"
|
||||||
#till 64-bit glibc for SPARC is operational:-(
|
echo " and wish to build 64-bit library, then you have to"
|
||||||
#echo "WARNING! If you wish to build 64-bit library, then you have to"
|
echo " invoke './Configure linux64-sparcv9' *manually*."
|
||||||
#echo " invoke './Configure linux64-sparcv9' *manually*."
|
if [ "$TEST" = "false" ]; then
|
||||||
#echo " Type Ctrl-C if you don't want to continue."
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
#read waste < /dev/tty
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
|
fi
|
||||||
OUT="linux-sparcv9" ;;
|
OUT="linux-sparcv9" ;;
|
||||||
sparc-*-linux2)
|
sparc-*-linux2)
|
||||||
KARCH=`awk '/type/{print$3}' /proc/cpuinfo`
|
KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
|
||||||
case ${KARCH:-sun4} in
|
case ${KARCH:-sun4} in
|
||||||
sun4u*) OUT="linux-sparcv9" ;;
|
sun4u*) OUT="linux-sparcv9" ;;
|
||||||
sun4m) OUT="linux-sparcv8" ;;
|
sun4m) OUT="linux-sparcv8" ;;
|
||||||
sun4d) OUT="linux-sparcv8" ;;
|
sun4d) OUT="linux-sparcv8" ;;
|
||||||
*) OUT="linux-sparcv7" ;;
|
*) OUT="linux-sparcv7" ;;
|
||||||
esac ;;
|
esac ;;
|
||||||
*-*-linux2) OUT="linux-elf" ;;
|
parisc-*-linux2)
|
||||||
|
CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo`
|
||||||
|
CPUSCHEDULE=`awk '/^cpu.[ ]: PA/{print substr($3,3)}' /proc/cpuinfo`
|
||||||
|
|
||||||
|
# ??TODO ?? Model transformations
|
||||||
|
# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
|
||||||
|
# assuming no further arch. identification will ever be used by GCC.
|
||||||
|
# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
|
||||||
|
# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
|
||||||
|
# for these chips in the future.
|
||||||
|
# PA7300LC -> 7100LC (1.1)
|
||||||
|
# PA8200 -> 8000 (2.0)
|
||||||
|
# PA8500 -> 8000 (2.0)
|
||||||
|
# PA8600 -> 8000 (2.0)
|
||||||
|
|
||||||
|
CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'`
|
||||||
|
# Finish Model transformations
|
||||||
|
|
||||||
|
options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
||||||
|
OUT="linux-parisc" ;;
|
||||||
|
arm*-*-linux2) OUT="linux-elf-arm" ;;
|
||||||
|
s390-*-linux2) OUT="linux-s390" ;;
|
||||||
|
s390x-*-linux?) OUT="linux-s390x" ;;
|
||||||
|
x86_64-*-linux?) OUT="linux-x86_64" ;;
|
||||||
|
*-*-linux2) OUT="linux-elf"
|
||||||
|
if [ "$GCCVER" -gt 28 ]; then
|
||||||
|
if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
|
||||||
|
OUT="linux-pentium"
|
||||||
|
fi
|
||||||
|
if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
|
||||||
|
OUT="linux-ppro"
|
||||||
|
fi
|
||||||
|
if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
|
||||||
|
OUT="linux-k6"
|
||||||
|
fi
|
||||||
|
fi ;;
|
||||||
*-*-linux1) OUT="linux-aout" ;;
|
*-*-linux1) OUT="linux-aout" ;;
|
||||||
sun4u*-sun-solaris2)
|
sun4u*-*-solaris2)
|
||||||
|
OUT="solaris-sparcv9-$CC"
|
||||||
ISA64=`(isalist) 2>/dev/null | grep sparcv9`
|
ISA64=`(isalist) 2>/dev/null | grep sparcv9`
|
||||||
if [ "$ISA64" != "" -a "$CC" = "cc" -a $CCVER -ge 50 ]; then
|
if [ "$ISA64" != "" ]; then
|
||||||
|
if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
|
||||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||||
echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
|
echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
|
||||||
echo " Type Ctrl-C if you don't want to continue."
|
if [ "$TEST" = "false" ]; then
|
||||||
read waste < /dev/tty
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
fi
|
fi
|
||||||
OUT="solaris-sparcv9-$CC" ;;
|
elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
|
||||||
sun4m-sun-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
# $GCC_ARCH denotes default ABI chosen by compiler driver
|
||||||
sun4d-sun-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
# (first one found on the $PATH). I assume that user
|
||||||
sun4*-sun-solaris2) OUT="solaris-sparcv7-$CC" ;;
|
# expects certain consistency with the rest of his builds
|
||||||
*86*-sun-solaris2) OUT="solaris-x86-$CC" ;;
|
# and therefore switch over to 64-bit. <appro>
|
||||||
|
OUT="solaris64-sparcv9-gcc"
|
||||||
|
echo "WARNING! If you wish to build 32-bit library, then you have to"
|
||||||
|
echo " invoke './Configure solaris-sparcv9-gcc' *manually*."
|
||||||
|
if [ "$TEST" = "false" ]; then
|
||||||
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
|
fi
|
||||||
|
elif [ "$GCC_ARCH" = "-m32" ]; then
|
||||||
|
echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
|
||||||
|
echo " and wish to build 64-bit library, then you have to"
|
||||||
|
echo " invoke './Configure solaris64-sparcv9-gcc' *manually*."
|
||||||
|
if [ "$TEST" = "false" ]; then
|
||||||
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||||
|
sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||||
|
sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;;
|
||||||
|
*86*-*-solaris2) OUT="solaris-x86-$CC" ;;
|
||||||
*-*-sunos4) OUT="sunos-$CC" ;;
|
*-*-sunos4) OUT="sunos-$CC" ;;
|
||||||
alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
|
alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
|
||||||
*-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
|
*-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
|
||||||
@@ -449,45 +645,107 @@ case "$GUESSOS" in
|
|||||||
*86*-*-netbsd) OUT="NetBSD-x86" ;;
|
*86*-*-netbsd) OUT="NetBSD-x86" ;;
|
||||||
sun3*-*-netbsd) OUT="NetBSD-m68" ;;
|
sun3*-*-netbsd) OUT="NetBSD-m68" ;;
|
||||||
*-*-netbsd) OUT="NetBSD-sparc" ;;
|
*-*-netbsd) OUT="NetBSD-sparc" ;;
|
||||||
*86*-*-openbsd) OUT="OpenBSD-x86" ;;
|
|
||||||
alpha*-*-openbsd) OUT="OpenBSD-alpha" ;;
|
alpha*-*-openbsd) OUT="OpenBSD-alpha" ;;
|
||||||
|
*86*-*-openbsd) OUT="OpenBSD-i386" ;;
|
||||||
|
m68k*-*-openbsd) OUT="OpenBSD-m68k" ;;
|
||||||
|
m88k*-*-openbsd) OUT="OpenBSD-m88k" ;;
|
||||||
|
mips*-*-openbsd) OUT="OpenBSD-mips" ;;
|
||||||
pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
|
pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
|
||||||
|
powerpc*-*-openbsd) OUT="OpenBSD-powerpc" ;;
|
||||||
|
sparc64*-*-openbsd) OUT="OpenBSD-sparc64" ;;
|
||||||
|
sparc*-*-openbsd) OUT="OpenBSD-sparc" ;;
|
||||||
|
vax*-*-openbsd) OUT="OpenBSD-vax" ;;
|
||||||
|
hppa*-*-openbsd) OUT="OpenBSD-hppa" ;;
|
||||||
*-*-openbsd) OUT="OpenBSD" ;;
|
*-*-openbsd) OUT="OpenBSD" ;;
|
||||||
*86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
|
*86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
|
||||||
*-*-osf) OUT="alpha-cc" ;;
|
*-*-osf) OUT="alphaold-cc" ;;
|
||||||
|
*-*-tru64) OUT="alpha-cc" ;;
|
||||||
|
*-*-OpenUNIX*)
|
||||||
|
if [ "$CC" = "gcc" ]; then
|
||||||
|
OUT="OpenUNIX-8-gcc"
|
||||||
|
else
|
||||||
|
OUT="OpenUNIX-8"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*-*-unixware7) OUT="unixware-7" ;;
|
*-*-unixware7) OUT="unixware-7" ;;
|
||||||
*-*-UnixWare7) OUT="unixware-7" ;;
|
*-*-UnixWare7) OUT="unixware-7" ;;
|
||||||
*-*-Unixware7) OUT="unixware-7" ;;
|
*-*-Unixware7) OUT="unixware-7" ;;
|
||||||
*-*-unixware[1-2]*) OUT="unixware-2.0" ;;
|
*-*-unixware20*) OUT="unixware-2.0" ;;
|
||||||
*-*-UnixWare[1-2]*) OUT="unixware-2.0" ;;
|
*-*-unixware21*) OUT="unixware-2.1" ;;
|
||||||
*-*-Unixware[1-2]*) OUT="unixware-2.0" ;;
|
*-*-UnixWare20*) OUT="unixware-2.0" ;;
|
||||||
|
*-*-UnixWare21*) OUT="unixware-2.1" ;;
|
||||||
|
*-*-Unixware20*) OUT="unixware-2.0" ;;
|
||||||
|
*-*-Unixware21*) OUT="unixware-2.1" ;;
|
||||||
BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
|
BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
|
||||||
RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
|
RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
|
||||||
*-siemens-sysv4) OUT="SINIX" ;;
|
*-siemens-sysv4) OUT="SINIX" ;;
|
||||||
*-hpux1*) OUT="hpux-parisc-$CC"
|
*-hpux1*)
|
||||||
|
if [ $CC = "gcc" ];
|
||||||
|
then
|
||||||
|
if [ $GCC_BITS = "64" ]; then
|
||||||
|
OUT="hpux64-parisc-gcc"
|
||||||
|
else
|
||||||
|
OUT="hpux-parisc-gcc"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
OUT="hpux-parisc-$CC"
|
||||||
|
fi
|
||||||
|
KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
|
||||||
|
KERNEL_BITS=${KERNEL_BITS:-32}
|
||||||
|
CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
|
||||||
|
CPU_VERSION=${CPU_VERSION:-0}
|
||||||
|
# See <sys/unistd.h> for further info on CPU_VERSION.
|
||||||
|
if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
|
||||||
|
echo "NOTICE! 64-bit is the only ABI currently operational on HP-UXi."
|
||||||
|
echo " Post request to openssl-dev@openssl.org for 32-bit support."
|
||||||
|
if [ "$TEST" = "false" ]; then
|
||||||
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
|
fi
|
||||||
|
OUT="hpux64-ia64-cc"
|
||||||
|
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
|
||||||
|
if [ "$CC" = "cc" ]; then
|
||||||
|
OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
|
||||||
|
fi
|
||||||
|
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
||||||
|
echo "WARNING! If you wish to build 64-bit library then you have to"
|
||||||
|
echo " invoke './Configure hpux64-parisc2-cc' *manually*."
|
||||||
|
if [ "$TEST" = "false" ]; then
|
||||||
|
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||||
|
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
|
||||||
|
:
|
||||||
|
elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
|
||||||
|
:
|
||||||
|
else # Motorola(?) CPU
|
||||||
|
OUT="hpux-$CC"
|
||||||
|
fi
|
||||||
options="$options -D_REENTRANT" ;;
|
options="$options -D_REENTRANT" ;;
|
||||||
*-hpux) OUT="hpux-parisc-$CC" ;;
|
*-hpux) OUT="hpux-parisc-$CC" ;;
|
||||||
# these are all covered by the catchall below
|
# these are all covered by the catchall below
|
||||||
# *-aix) OUT="aix-$CC" ;;
|
# *-aix) OUT="aix-$CC" ;;
|
||||||
# *-dgux) OUT="dgux" ;;
|
# *-dgux) OUT="dgux" ;;
|
||||||
|
mips-sony-newsos4) OUT="newsos4-gcc" ;;
|
||||||
|
*-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
|
||||||
|
*-*-cygwin) OUT="Cygwin" ;;
|
||||||
|
t3e-cray-unicosmk) OUT="cray-t3e" ;;
|
||||||
|
j90-cray-unicos) OUT="cray-j90" ;;
|
||||||
|
nsr-tandem-nsk) OUT="tandem-c89" ;;
|
||||||
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# NB: This atalla support has been superceded by the ENGINE support
|
||||||
|
# That contains its own header and definitions anyway. Support can
|
||||||
|
# be enabled or disabled on any supported platform without external
|
||||||
|
# headers, eg. by adding the "hw-atalla" switch to ./config or
|
||||||
|
# perl Configure
|
||||||
|
#
|
||||||
# See whether we can compile Atalla support
|
# See whether we can compile Atalla support
|
||||||
if [ -f /usr/include/atasi.h ]
|
#if [ -f /usr/include/atasi.h ]
|
||||||
then
|
#then
|
||||||
options="$options -DATALLA"
|
# options="$options -DATALLA"
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
#get some basic shared lib support (behnke@trustcenter.de)
|
|
||||||
case "$OUT" in
|
|
||||||
solaris-*-gcc)
|
|
||||||
if [ "$SHARED" = "true" ]
|
|
||||||
then
|
|
||||||
options="$options -DPIC -fPIC"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# gcc < 2.8 does not support -mcpu=ultrasparc
|
# gcc < 2.8 does not support -mcpu=ultrasparc
|
||||||
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
|
if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
|
||||||
@@ -503,23 +761,12 @@ then
|
|||||||
sleep 5
|
sleep 5
|
||||||
OUT=linux-sparcv8
|
OUT=linux-sparcv8
|
||||||
fi
|
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
|
case "$GUESSOS" in
|
||||||
i386-*) options="$options 386" ;;
|
i386-*) options="$options 386" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
for i in bf cast des dh dsa hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
|
for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 aes ripemd rsa sha
|
||||||
do
|
do
|
||||||
if [ ! -d crypto/$i ]
|
if [ ! -d crypto/$i ]
|
||||||
then
|
then
|
||||||
@@ -527,6 +774,27 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Discover Kerberos 5 (since it's still a prototype, we don't
|
||||||
|
# do any guesses yet, that's why this section is commented away.
|
||||||
|
#if [ -d /usr/kerberos ]; then
|
||||||
|
# krb5_dir=/usr/kerberos
|
||||||
|
# if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
|
||||||
|
# -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
|
||||||
|
# -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
|
||||||
|
# -a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
|
||||||
|
# -a \( -f $krb5_dir/include/krb5.h \) ]; then
|
||||||
|
# options="$options --with-krb5-flavor=MIT"
|
||||||
|
# fi
|
||||||
|
#elif [ -d /usr/heimdal ]; then
|
||||||
|
# krb5_dir=/usr/heimdal
|
||||||
|
# if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
|
||||||
|
# -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
|
||||||
|
# -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
|
||||||
|
# -a \( -f $krb5_dir/include/krb5.h \) ]; then
|
||||||
|
# options="$options --with-krb5-flavor=Heimdal"
|
||||||
|
# fi
|
||||||
|
#fi
|
||||||
|
|
||||||
if [ -z "$OUT" ]; then
|
if [ -z "$OUT" ]; then
|
||||||
OUT="$CC"
|
OUT="$CC"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,14 +5,15 @@
|
|||||||
DIR= crypto
|
DIR= crypto
|
||||||
TOP= ..
|
TOP= ..
|
||||||
CC= cc
|
CC= cc
|
||||||
INCLUDE= -I. -I../include
|
INCLUDE= -I. -I$(TOP) -I../include
|
||||||
INCLUDES= -I.. -I../../include
|
INCLUDES= -I.. -I../.. -I../../include
|
||||||
CFLAG= -g
|
CFLAG= -g
|
||||||
INSTALL_PREFIX=
|
INSTALL_PREFIX=
|
||||||
OPENSSLDIR= /usr/local/ssl
|
OPENSSLDIR= /usr/local/ssl
|
||||||
INSTALLTOP= /usr/local/ssl
|
INSTALLTOP= /usr/local/ssl
|
||||||
MAKE= make -f Makefile.ssl
|
MAKE= make -f Makefile.ssl
|
||||||
MAKEDEPEND= $(TOP)/util/domd $(TOP)
|
MAKEDEPPROG= makedepend
|
||||||
|
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||||
MAKEFILE= Makefile.ssl
|
MAKEFILE= Makefile.ssl
|
||||||
RM= rm -f
|
RM= rm -f
|
||||||
AR= ar r
|
AR= ar r
|
||||||
@@ -27,35 +28,37 @@ LIBS=
|
|||||||
|
|
||||||
SDIRS= md2 md5 sha mdc2 hmac ripemd \
|
SDIRS= md2 md5 sha mdc2 hmac ripemd \
|
||||||
des rc2 rc4 rc5 idea bf cast \
|
des rc2 rc4 rc5 idea bf cast \
|
||||||
bn rsa dsa dh \
|
bn ec rsa dsa ecdsa ecdh dh dso engine aes \
|
||||||
buffer bio stack lhash rand err objects \
|
buffer bio stack lhash rand err objects \
|
||||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
|
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
|
||||||
|
|
||||||
GENERAL=Makefile README crypto-lib.com install.com
|
GENERAL=Makefile README crypto-lib.com install.com
|
||||||
|
|
||||||
LIB= $(TOP)/libcrypto.a
|
LIB= $(TOP)/libcrypto.a
|
||||||
LIBSRC= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c
|
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
||||||
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o
|
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c
|
||||||
|
LIBOBJ= cryptlib.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o
|
||||||
|
|
||||||
SRC= $(LIBSRC)
|
SRC= $(LIBSRC)
|
||||||
|
|
||||||
EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h
|
EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
|
||||||
HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER)
|
ossl_typ.h
|
||||||
|
HEADER= cryptlib.h buildinf.h md32_common.h o_time.h $(EXHEADER)
|
||||||
|
|
||||||
ALL= $(GENERAL) $(SRC) $(HEADER)
|
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||||
|
|
||||||
top:
|
top:
|
||||||
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
||||||
|
|
||||||
all: buildinf.h lib subdirs
|
all: buildinf.h lib subdirs shared
|
||||||
|
|
||||||
buildinf.h: ../Makefile.ssl
|
buildinf.h: ../Makefile.ssl
|
||||||
( echo "#ifndef MK1MF_BUILD"; \
|
( echo "#ifndef MK1MF_BUILD"; \
|
||||||
echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
|
echo ' /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */'; \
|
||||||
echo " #define CFLAGS \"$(CC) $(CFLAG)\""; \
|
echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \
|
||||||
echo " #define PLATFORM \"$(PLATFORM)\""; \
|
echo ' #define PLATFORM "$(PLATFORM)"'; \
|
||||||
echo " #define DATE \"`date`\""; \
|
echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
|
||||||
echo "#endif" ) >buildinf.h
|
echo '#endif' ) >buildinf.h
|
||||||
|
|
||||||
testapps:
|
testapps:
|
||||||
if echo ${SDIRS} | fgrep ' des '; \
|
if echo ${SDIRS} | fgrep ' des '; \
|
||||||
@@ -73,7 +76,7 @@ files:
|
|||||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making 'files' in crypto/$$i..."; \
|
(cd $$i && echo "making 'files' in crypto/$$i..." && \
|
||||||
$(MAKE) PERL='${PERL}' files ); \
|
$(MAKE) PERL='${PERL}' files ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
@@ -84,26 +87,31 @@ links:
|
|||||||
@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
|
@$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
|
||||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||||
@for i in $(SDIRS); do \
|
@for i in $(SDIRS); do \
|
||||||
(cd $$i; echo "making links in crypto/$$i..."; \
|
(cd $$i && echo "making links in crypto/$$i..." && \
|
||||||
$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
|
$(MAKE) CC='$(CC)' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' AR='${AR}' PERL='${PERL}' links ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
lib: $(LIBOBJ)
|
lib: $(LIBOBJ)
|
||||||
$(AR) $(LIB) $(LIBOBJ)
|
$(AR) $(LIB) $(LIBOBJ)
|
||||||
$(RANLIB) $(LIB)
|
$(RANLIB) $(LIB) || echo Never mind.
|
||||||
@touch lib
|
@touch lib
|
||||||
|
|
||||||
|
shared:
|
||||||
|
if [ -n "$(SHARED_LIBS)" ]; then \
|
||||||
|
(cd ..; $(MAKE) $(SHARED_LIB)); \
|
||||||
|
fi
|
||||||
|
|
||||||
libs:
|
libs:
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making libs in crypto/$$i..."; \
|
(cd $$i && echo "making libs in crypto/$$i..." && \
|
||||||
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
|
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' lib ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making tests in crypto/$$i..."; \
|
(cd $$i && echo "making tests in crypto/$$i..." && \
|
||||||
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
|
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' AR='${AR}' tests ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
@@ -115,32 +123,32 @@ install:
|
|||||||
done;
|
done;
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making install in crypto/$$i..."; \
|
(cd $$i && echo "making install in crypto/$$i..." && \
|
||||||
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
|
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making lint in crypto/$$i..."; \
|
(cd $$i && echo "making lint in crypto/$$i..." && \
|
||||||
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
|
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' lint ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
if [ ! -f 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)
|
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||||
if [ ! -s buildinf.h ]; then rm buildinf.h; fi
|
if [ ! -s buildinf.h ]; then rm buildinf.h; fi
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making depend in crypto/$$i..."; \
|
(cd $$i && echo "making depend in crypto/$$i..." && \
|
||||||
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
|
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' PERL='${PERL}' depend ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f buildinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
rm -f buildinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making clean in crypto/$$i..."; \
|
(cd $$i && echo "making clean in crypto/$$i..." && \
|
||||||
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
|
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' clean ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
@@ -149,47 +157,62 @@ dclean:
|
|||||||
mv -f Makefile.new $(MAKEFILE)
|
mv -f Makefile.new $(MAKEFILE)
|
||||||
@for i in $(SDIRS) ;\
|
@for i in $(SDIRS) ;\
|
||||||
do \
|
do \
|
||||||
(cd $$i; echo "making dclean in crypto/$$i..."; \
|
(cd $$i && echo "making dclean in crypto/$$i..." && \
|
||||||
$(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
|
$(MAKE) PERL='${PERL}' CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' dclean ); \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# 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/bio.h ../include/openssl/crypto.h
|
||||||
|
cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||||
|
cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
||||||
cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
|
cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
|
||||||
cpt_err.o: ../include/openssl/stack.h
|
cpt_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cpt_err.c
|
||||||
cryptlib.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||||
cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
cryptlib.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||||
cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
cryptlib.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
cryptlib.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
cryptlib.o: cryptlib.h
|
cryptlib.o: ../include/openssl/symhacks.h cryptlib.c cryptlib.h
|
||||||
cversion.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||||
cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
cversion.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||||
cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
cversion.o: buildinf.h cryptlib.h
|
cversion.o: ../include/openssl/symhacks.h buildinf.h cryptlib.h cversion.c
|
||||||
ex_data.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
|
||||||
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||||
ex_data.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
ex_data.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||||
ex_data.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
|
ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
ex_data.o: ../include/openssl/stack.h cryptlib.h
|
ex_data.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
mem.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
ex_data.o: ../include/openssl/symhacks.h cryptlib.h ex_data.c
|
||||||
mem.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||||
mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
|
mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||||
mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h cryptlib.h
|
mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
mem.o: ../include/openssl/symhacks.h cryptlib.h mem.c
|
||||||
mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
mem_dbg.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
mem_clr.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
mem_dbg.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
|
mem_clr.o: ../include/openssl/symhacks.h mem_clr.c
|
||||||
mem_dbg.o: ../include/openssl/stack.h cryptlib.h
|
mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||||
tmdiff.o: ../include/openssl/bio.h ../include/openssl/buffer.h
|
mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
|
mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||||
tmdiff.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
|
mem_dbg.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
|
mem_dbg.o: ../include/openssl/symhacks.h cryptlib.h mem_dbg.c
|
||||||
|
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
|
||||||
|
o_time.o: o_time.h
|
||||||
|
tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||||
|
tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
|
tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||||
tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
tmdiff.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
tmdiff.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h
|
tmdiff.o: ../include/openssl/symhacks.h ../include/openssl/tmdiff.h cryptlib.h
|
||||||
|
tmdiff.o: tmdiff.c
|
||||||
|
uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||||
|
uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||||
|
uid.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||||
|
uid.o: ../include/openssl/symhacks.h uid.c
|
||||||
|
|||||||
103
crypto/aes/Makefile.ssl
Normal file
103
crypto/aes/Makefile.ssl
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
#
|
||||||
|
# crypto/aes/Makefile
|
||||||
|
#
|
||||||
|
|
||||||
|
DIR= aes
|
||||||
|
TOP= ../..
|
||||||
|
CC= cc
|
||||||
|
CPP= $(CC) -E
|
||||||
|
INCLUDES=
|
||||||
|
CFLAG=-g
|
||||||
|
INSTALL_PREFIX=
|
||||||
|
OPENSSLDIR= /usr/local/ssl
|
||||||
|
INSTALLTOP= /usr/local/ssl
|
||||||
|
MAKE= make -f Makefile.ssl
|
||||||
|
MAKEDEPPROG= makedepend
|
||||||
|
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||||
|
MAKEFILE= Makefile.ssl
|
||||||
|
AR= ar r
|
||||||
|
|
||||||
|
# CFLAGS= -mpentiumpro $(INCLUDES) $(CFLAG) -O3 -fexpensive-optimizations -funroll-loops -fforce-addr
|
||||||
|
CFLAGS= $(INCLUDES) $(CFLAG)
|
||||||
|
|
||||||
|
GENERAL=Makefile
|
||||||
|
#TEST=aestest.c
|
||||||
|
TEST=
|
||||||
|
APPS=
|
||||||
|
|
||||||
|
LIB=$(TOP)/libcrypto.a
|
||||||
|
LIBSRC=aes_core.c aes_misc.c aes_ecb.c aes_cbc.c aes_cfb.c aes_ofb.c aes_ctr.c
|
||||||
|
LIBOBJ=aes_core.o aes_misc.o aes_ecb.o aes_cbc.o aes_cfb.o aes_ofb.o aes_ctr.o
|
||||||
|
|
||||||
|
SRC= $(LIBSRC)
|
||||||
|
|
||||||
|
EXHEADER= aes.h
|
||||||
|
HEADER= aes_locl.h $(EXHEADER)
|
||||||
|
|
||||||
|
ALL= $(GENERAL) $(SRC) $(HEADER)
|
||||||
|
|
||||||
|
top:
|
||||||
|
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
|
||||||
|
|
||||||
|
all: lib
|
||||||
|
|
||||||
|
lib: $(LIBOBJ)
|
||||||
|
$(AR) $(LIB) $(LIBOBJ)
|
||||||
|
$(RANLIB) $(LIB) || echo Never mind.
|
||||||
|
@touch lib
|
||||||
|
|
||||||
|
$(LIBOBJ): $(LIBSRC)
|
||||||
|
|
||||||
|
files:
|
||||||
|
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||||
|
|
||||||
|
links:
|
||||||
|
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||||
|
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||||
|
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
|
||||||
|
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
|
||||||
|
|
||||||
|
install: installs
|
||||||
|
|
||||||
|
installs:
|
||||||
|
@for i in $(EXHEADER) ; \
|
||||||
|
do \
|
||||||
|
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||||
|
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||||
|
done;
|
||||||
|
|
||||||
|
tags:
|
||||||
|
ctags $(SRC)
|
||||||
|
|
||||||
|
tests:
|
||||||
|
|
||||||
|
lint:
|
||||||
|
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||||
|
|
||||||
|
depend:
|
||||||
|
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||||
|
|
||||||
|
dclean:
|
||||||
|
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||||
|
mv -f Makefile.new $(MAKEFILE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||||
|
|
||||||
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|
||||||
|
aes_cbc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||||
|
aes_cbc.o: ../../include/openssl/opensslconf.h aes_cbc.c aes_locl.h
|
||||||
|
aes_cfb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||||
|
aes_cfb.o: ../../include/openssl/opensslconf.h aes_cfb.c aes_locl.h
|
||||||
|
aes_core.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||||
|
aes_core.o: ../../include/openssl/opensslconf.h aes_core.c aes_locl.h
|
||||||
|
aes_ctr.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||||
|
aes_ctr.o: ../../include/openssl/opensslconf.h aes_ctr.c aes_locl.h
|
||||||
|
aes_ecb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||||
|
aes_ecb.o: ../../include/openssl/opensslconf.h aes_ecb.c aes_locl.h
|
||||||
|
aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||||
|
aes_misc.o: ../../include/openssl/opensslconf.h
|
||||||
|
aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c
|
||||||
|
aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||||
|
aes_ofb.o: ../../include/openssl/opensslconf.h aes_locl.h aes_ofb.c
|
||||||
3
crypto/aes/README
Normal file
3
crypto/aes/README
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
This is an OpenSSL-compatible version of AES (also called Rijndael).
|
||||||
|
aes_core.c is basically the same as rijndael-alg-fst.c but with an
|
||||||
|
API that looks like the rest of the OpenSSL symmetric cipher suite.
|
||||||
111
crypto/aes/aes.h
Normal file
111
crypto/aes/aes.h
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef HEADER_AES_H
|
||||||
|
#define HEADER_AES_H
|
||||||
|
|
||||||
|
#ifdef OPENSSL_NO_AES
|
||||||
|
#error AES is disabled.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const int AES_DECRYPT = 0;
|
||||||
|
static const int AES_ENCRYPT = 1;
|
||||||
|
/* Because array size can't be a const in C, the following two are macros.
|
||||||
|
Both sizes are in bytes. */
|
||||||
|
#define AES_MAXNR 14
|
||||||
|
#define AES_BLOCK_SIZE 16
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This should be a hidden type, but EVP requires that the size be known */
|
||||||
|
struct aes_key_st {
|
||||||
|
unsigned long rd_key[4 *(AES_MAXNR + 1)];
|
||||||
|
int rounds;
|
||||||
|
};
|
||||||
|
typedef struct aes_key_st AES_KEY;
|
||||||
|
|
||||||
|
const char *AES_options(void);
|
||||||
|
|
||||||
|
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||||
|
AES_KEY *key);
|
||||||
|
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||||
|
AES_KEY *key);
|
||||||
|
|
||||||
|
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const AES_KEY *key);
|
||||||
|
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const AES_KEY *key);
|
||||||
|
|
||||||
|
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const AES_KEY *key, const int enc);
|
||||||
|
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char *ivec, const int enc);
|
||||||
|
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char *ivec, int *num, const int enc);
|
||||||
|
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char *ivec, int *num);
|
||||||
|
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char counter[AES_BLOCK_SIZE],
|
||||||
|
unsigned char ecount_buf[AES_BLOCK_SIZE],
|
||||||
|
unsigned int *num);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* !HEADER_AES_H */
|
||||||
111
crypto/aes/aes_cbc.c
Normal file
111
crypto/aes/aes_cbc.c
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/* crypto/aes/aes_cbc.c -*- mode:C; c-file-style: "eay" -*- */
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AES_DEBUG
|
||||||
|
# ifndef NDEBUG
|
||||||
|
# define NDEBUG
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <openssl/aes.h>
|
||||||
|
#include "aes_locl.h"
|
||||||
|
|
||||||
|
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char *ivec, const int enc) {
|
||||||
|
|
||||||
|
unsigned long n;
|
||||||
|
unsigned long len = length;
|
||||||
|
unsigned char tmp[AES_BLOCK_SIZE];
|
||||||
|
|
||||||
|
assert(in && out && key && ivec);
|
||||||
|
assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
|
||||||
|
|
||||||
|
if (AES_ENCRYPT == enc) {
|
||||||
|
while (len >= AES_BLOCK_SIZE) {
|
||||||
|
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||||
|
tmp[n] = in[n] ^ ivec[n];
|
||||||
|
AES_encrypt(tmp, out, key);
|
||||||
|
memcpy(ivec, out, AES_BLOCK_SIZE);
|
||||||
|
len -= AES_BLOCK_SIZE;
|
||||||
|
in += AES_BLOCK_SIZE;
|
||||||
|
out += AES_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
if (len) {
|
||||||
|
for(n=0; n < len; ++n)
|
||||||
|
tmp[n] = in[n] ^ ivec[n];
|
||||||
|
for(n=len; n < AES_BLOCK_SIZE; ++n)
|
||||||
|
tmp[n] = ivec[n];
|
||||||
|
AES_encrypt(tmp, tmp, key);
|
||||||
|
memcpy(out, tmp, len);
|
||||||
|
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while (len >= AES_BLOCK_SIZE) {
|
||||||
|
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||||
|
AES_decrypt(in, out, key);
|
||||||
|
for(n=0; n < AES_BLOCK_SIZE; ++n)
|
||||||
|
out[n] ^= ivec[n];
|
||||||
|
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||||
|
len -= AES_BLOCK_SIZE;
|
||||||
|
in += AES_BLOCK_SIZE;
|
||||||
|
out += AES_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
if (len) {
|
||||||
|
memcpy(tmp, in, AES_BLOCK_SIZE);
|
||||||
|
AES_decrypt(tmp, tmp, key);
|
||||||
|
for(n=0; n < len; ++n)
|
||||||
|
out[n] ^= ivec[n];
|
||||||
|
memcpy(ivec, tmp, AES_BLOCK_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
157
crypto/aes/aes_cfb.c
Normal file
157
crypto/aes/aes_cfb.c
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
/* crypto/aes/aes_cfb.c -*- mode:C; c-file-style: "eay" -*- */
|
||||||
|
/* ====================================================================
|
||||||
|
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* 3. All advertising materials mentioning features or use of this
|
||||||
|
* software must display the following acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||||
|
* endorse or promote products derived from this software without
|
||||||
|
* prior written permission. For written permission, please contact
|
||||||
|
* openssl-core@openssl.org.
|
||||||
|
*
|
||||||
|
* 5. Products derived from this software may not be called "OpenSSL"
|
||||||
|
* nor may "OpenSSL" appear in their names without prior written
|
||||||
|
* permission of the OpenSSL Project.
|
||||||
|
*
|
||||||
|
* 6. Redistributions of any form whatsoever must retain the following
|
||||||
|
* acknowledgment:
|
||||||
|
* "This product includes software developed by the OpenSSL Project
|
||||||
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||||
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||||
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This package is an SSL implementation written
|
||||||
|
* by Eric Young (eay@cryptsoft.com).
|
||||||
|
* The implementation was written so as to conform with Netscapes SSL.
|
||||||
|
*
|
||||||
|
* This library is free for commercial and non-commercial use as long as
|
||||||
|
* the following conditions are aheared to. The following conditions
|
||||||
|
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||||
|
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||||
|
* included with this distribution is covered by the same copyright terms
|
||||||
|
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||||
|
*
|
||||||
|
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||||
|
* the code are not to be removed.
|
||||||
|
* If this package is used in a product, Eric Young should be given attribution
|
||||||
|
* as the author of the parts of the library used.
|
||||||
|
* This can be in the form of a textual message at program startup or
|
||||||
|
* in documentation (online or textual) provided with the package.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* "This product includes cryptographic software written by
|
||||||
|
* Eric Young (eay@cryptsoft.com)"
|
||||||
|
* The word 'cryptographic' can be left out if the rouines from the library
|
||||||
|
* being used are not cryptographic related :-).
|
||||||
|
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||||
|
* the apps directory (application code) you must include an acknowledgement:
|
||||||
|
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* The licence and distribution terms for any publically available version or
|
||||||
|
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||||
|
* copied and put under another distribution licence
|
||||||
|
* [including the GNU Public Licence.]
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AES_DEBUG
|
||||||
|
# ifndef NDEBUG
|
||||||
|
# define NDEBUG
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <openssl/aes.h>
|
||||||
|
#include "aes_locl.h"
|
||||||
|
|
||||||
|
/* The input and output encrypted as though 128bit cfb mode is being
|
||||||
|
* used. The extra state information to record how much of the
|
||||||
|
* 128bit block we have used is contained in *num;
|
||||||
|
*/
|
||||||
|
|
||||||
|
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||||
|
const unsigned long length, const AES_KEY *key,
|
||||||
|
unsigned char *ivec, int *num, const int enc) {
|
||||||
|
|
||||||
|
unsigned int n;
|
||||||
|
unsigned long l = length;
|
||||||
|
unsigned char c;
|
||||||
|
|
||||||
|
assert(in && out && key && ivec && num);
|
||||||
|
|
||||||
|
n = *num;
|
||||||
|
|
||||||
|
if (enc) {
|
||||||
|
while (l--) {
|
||||||
|
if (n == 0) {
|
||||||
|
AES_encrypt(ivec, ivec, key);
|
||||||
|
}
|
||||||
|
ivec[n] = *(out++) = *(in++) ^ ivec[n];
|
||||||
|
n = (n+1) % AES_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while (l--) {
|
||||||
|
if (n == 0) {
|
||||||
|
AES_encrypt(ivec, ivec, key);
|
||||||
|
}
|
||||||
|
c = *(in);
|
||||||
|
*(out++) = *(in++) ^ ivec[n];
|
||||||
|
ivec[n] = c;
|
||||||
|
n = (n+1) % AES_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*num=n;
|
||||||
|
}
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user