Compare commits
837 Commits
OpenSSL_1_
...
OpenSSL_1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a06ec5a26f | ||
|
|
62bbfe036d | ||
|
|
f46e8095aa | ||
|
|
57de3216e2 | ||
|
|
857b2ced04 | ||
|
|
809bf2eab7 | ||
|
|
db96b5ab76 | ||
|
|
cb9f1bc1d1 | ||
|
|
9545eac45b | ||
|
|
228806a4f3 | ||
|
|
bb82db1c77 | ||
|
|
470446db9a | ||
|
|
91e64e1427 | ||
|
|
0d3a7e7c91 | ||
|
|
a85eef72f5 | ||
|
|
0ae3473e85 | ||
|
|
98377858d1 | ||
|
|
aaa654d607 | ||
|
|
296559b0ce | ||
|
|
079495cad2 | ||
|
|
591c819c30 | ||
|
|
439c193413 | ||
|
|
1b8403889b | ||
|
|
e261cf5a2e | ||
|
|
b3c721482b | ||
|
|
ea04412c13 | ||
|
|
2dff75f4df | ||
|
|
690d040b2e | ||
|
|
6c63867178 | ||
|
|
b3ac37c69a | ||
|
|
50c2c64fe7 | ||
|
|
a6202a74f9 | ||
|
|
6b7d6c4404 | ||
|
|
21220998f3 | ||
|
|
4bbff0f946 | ||
|
|
923552bd5d | ||
|
|
dafa9534de | ||
|
|
e35e22e1d9 | ||
|
|
06cf4418cf | ||
|
|
81741de632 | ||
|
|
f2f2f64dee | ||
|
|
34fc239378 | ||
|
|
dfc3e9698b | ||
|
|
ab1c3627b7 | ||
|
|
c30465847b | ||
|
|
66e20354cb | ||
|
|
1a08063abf | ||
|
|
9104dc4255 | ||
|
|
0275883673 | ||
|
|
7746ff501c | ||
|
|
765db5f9e5 | ||
|
|
683f03e488 | ||
|
|
765e2465ca | ||
|
|
f10dfa0757 | ||
|
|
394a30c2f8 | ||
|
|
36971258e3 | ||
|
|
71b0bb764c | ||
|
|
09712fd0e3 | ||
|
|
4bf7b29169 | ||
|
|
42ad0100f1 | ||
|
|
dac693c957 | ||
|
|
6e161ee39e | ||
|
|
0e5e7af955 | ||
|
|
2487d77104 | ||
|
|
e5d2a44fb7 | ||
|
|
189de54506 | ||
|
|
beac071b13 | ||
|
|
99ff40515d | ||
|
|
192e148154 | ||
|
|
1804f78298 | ||
|
|
3d7a9aca8c | ||
|
|
4bc9913844 | ||
|
|
a8b966f48f | ||
|
|
e3db68b766 | ||
|
|
c583d40678 | ||
|
|
31082f2127 | ||
|
|
2c783509f4 | ||
|
|
6bd72a273e | ||
|
|
5011589a0b | ||
|
|
7b0ec6a4af | ||
|
|
e5ebff7b6a | ||
|
|
9c392088de | ||
|
|
a75d7245e5 | ||
|
|
b10a8451e3 | ||
|
|
679fee0e18 | ||
|
|
74c1dc909d | ||
|
|
638f75b686 | ||
|
|
510edea8db | ||
|
|
3bc28b8022 | ||
|
|
2d8e9d0c55 | ||
|
|
15a9c36755 | ||
|
|
a988c1edfc | ||
|
|
23a79aac28 | ||
|
|
d8305efeb4 | ||
|
|
7566807cfc | ||
|
|
3ad5ae5d44 | ||
|
|
e16db4b3d7 | ||
|
|
134d38bcde | ||
|
|
74d3242514 | ||
|
|
6020ffc766 | ||
|
|
7cba857c9a | ||
|
|
08220fec49 | ||
|
|
bfe4de7257 | ||
|
|
7a9f1f174c | ||
|
|
033a5fcfe8 | ||
|
|
4f6930f5d3 | ||
|
|
bc18f2f140 | ||
|
|
1a9c746696 | ||
|
|
92fd726fb4 | ||
|
|
46d8227210 | ||
|
|
5d3dc701b9 | ||
|
|
25c438987b | ||
|
|
016b92d112 | ||
|
|
dd6da173fd | ||
|
|
6ff1bf382e | ||
|
|
65f1d188c5 | ||
|
|
a25d0527b7 | ||
|
|
89f6c5b492 | ||
|
|
f326f6544d | ||
|
|
569c68744a | ||
|
|
cdac2e8928 | ||
|
|
01fb34ad43 | ||
|
|
08fac3fb6f | ||
|
|
0c8dc6ebe5 | ||
|
|
f4f1e80801 | ||
|
|
36f309c50a | ||
|
|
94e5cf36bd | ||
|
|
23df532ec4 | ||
|
|
b960060a0d | ||
|
|
e9cb6eb1d3 | ||
|
|
181ae2badb | ||
|
|
a98051fb47 | ||
|
|
225628f280 | ||
|
|
ca39b261bf | ||
|
|
c1beec0e6d | ||
|
|
b095884a58 | ||
|
|
f7fe3d235a | ||
|
|
b2688c9161 | ||
|
|
bf6fa208b5 | ||
|
|
eb37b6aa41 | ||
|
|
f66f76a24a | ||
|
|
65c63da207 | ||
|
|
9f028e4a78 | ||
|
|
64eec8f898 | ||
|
|
08a88774bd | ||
|
|
802a070bb6 | ||
|
|
31c65a7bc0 | ||
|
|
208a6012be | ||
|
|
d7f8a7cafd | ||
|
|
0f1c30b00d | ||
|
|
c4b969639a | ||
|
|
bfb2e4b280 | ||
|
|
d8c8a718a2 | ||
|
|
40c2812f56 | ||
|
|
2e3e3d278e | ||
|
|
2ececf59de | ||
|
|
a60536348b | ||
|
|
9d410579a7 | ||
|
|
4f90ef0c5b | ||
|
|
eae2bb2f1f | ||
|
|
c313270836 | ||
|
|
af8a66d10d | ||
|
|
ec5c25b3b4 | ||
|
|
38afaa48ec | ||
|
|
954818fe60 | ||
|
|
027381f68c | ||
|
|
a900b3b51c | ||
|
|
82d7247fc5 | ||
|
|
ceb4c684e4 | ||
|
|
a8da754d84 | ||
|
|
8ccb44e6f5 | ||
|
|
bbfdd1f0c9 | ||
|
|
8724f9f9cf | ||
|
|
6d41cbb63a | ||
|
|
04a73c844f | ||
|
|
87ff17a05d | ||
|
|
d93112abc6 | ||
|
|
875a33d7f7 | ||
|
|
cf48a6d7f6 | ||
|
|
7f3490e685 | ||
|
|
dcf7a2dc4a | ||
|
|
6ff76b3347 | ||
|
|
3b12515180 | ||
|
|
4e73dc5b76 | ||
|
|
67eb85d7d4 | ||
|
|
915a3b1c21 | ||
|
|
e1b1d82aab | ||
|
|
c25456633c | ||
|
|
aaf9335970 | ||
|
|
cee17f96f1 | ||
|
|
bd36615973 | ||
|
|
db85611989 | ||
|
|
9e5267fcdd | ||
|
|
0d330ce5cc | ||
|
|
2a303a5834 | ||
|
|
8d81dfd0a6 | ||
|
|
69c163ac81 | ||
|
|
b7eaea7397 | ||
|
|
2d2965d2c1 | ||
|
|
56cee260d8 | ||
|
|
e2e13b8f3a | ||
|
|
13b2a4d06a | ||
|
|
41da9188cc | ||
|
|
e9fe4b1033 | ||
|
|
6469c947f5 | ||
|
|
9bf3ff1ca0 | ||
|
|
74f77d40a9 | ||
|
|
55513f3e48 | ||
|
|
c8dd719095 | ||
|
|
0bfd0bff17 | ||
|
|
eb269523bb | ||
|
|
802feda7fc | ||
|
|
cdad6ad015 | ||
|
|
4eca4cfbc8 | ||
|
|
7e29be228e | ||
|
|
8745c0815c | ||
|
|
68828f167c | ||
|
|
59dcfa21e5 | ||
|
|
13f8ddacbe | ||
|
|
ad8b204386 | ||
|
|
7b7aef9bfd | ||
|
|
93540299fe | ||
|
|
1db72876dc | ||
|
|
b55ff319f8 | ||
|
|
9a6940a349 | ||
|
|
c36ceb0b15 | ||
|
|
904fcce0c6 | ||
|
|
2518a35a51 | ||
|
|
442ca2bd00 | ||
|
|
09e62af4d4 | ||
|
|
88f0c9797e | ||
|
|
74f5307d57 | ||
|
|
da8dd611ae | ||
|
|
43711a589b | ||
|
|
bf63eab048 | ||
|
|
62ca466a54 | ||
|
|
17d3b1ecea | ||
|
|
73729e4cf3 | ||
|
|
05f61fb27e | ||
|
|
10be715b95 | ||
|
|
e87a4a7011 | ||
|
|
f2a57c101f | ||
|
|
b88ffa2bce | ||
|
|
27b0494153 | ||
|
|
d38dcafe95 | ||
|
|
b0873dbb44 | ||
|
|
48ae65be09 | ||
|
|
dd5d7447c1 | ||
|
|
4ff9cbe635 | ||
|
|
e164b34079 | ||
|
|
679d0c8655 | ||
|
|
1d5e58b53c | ||
|
|
118149887b | ||
|
|
bb505311c6 | ||
|
|
f5fc85d382 | ||
|
|
6e4929fcdb | ||
|
|
03a12c1330 | ||
|
|
57b0c4697a | ||
|
|
9fd3555305 | ||
|
|
67e53f73bf | ||
|
|
2281d10a7b | ||
|
|
e5861c885f | ||
|
|
60be115771 | ||
|
|
5ee775a4a5 | ||
|
|
934ca0714a | ||
|
|
ad007e0aaf | ||
|
|
84361b898d | ||
|
|
1a80d39021 | ||
|
|
c5526a16b1 | ||
|
|
b6b9670017 | ||
|
|
469665f658 | ||
|
|
c4eb02bcaa | ||
|
|
97f336f25d | ||
|
|
5e05728ace | ||
|
|
061a5bdba2 | ||
|
|
e6ed83fb74 | ||
|
|
c3f2fc419b | ||
|
|
ec9cb40da5 | ||
|
|
ed1de3810d | ||
|
|
df35da266d | ||
|
|
26d60e29e3 | ||
|
|
5a0df377ac | ||
|
|
f7123634a5 | ||
|
|
7aeb3d7937 | ||
|
|
182f1ad8a1 | ||
|
|
0819130188 | ||
|
|
3fe4fc4774 | ||
|
|
1326733457 | ||
|
|
d8426e6b7d | ||
|
|
aa90ff7d8e | ||
|
|
aeae79951c | ||
|
|
cf3792b3e4 | ||
|
|
e6b98d5a40 | ||
|
|
4054d95eb9 | ||
|
|
a05e954b66 | ||
|
|
ca4a339eeb | ||
|
|
835e32f9f6 | ||
|
|
23396f5500 | ||
|
|
1c9b82a91f | ||
|
|
99657430c0 | ||
|
|
ce20ac72b4 | ||
|
|
525b6c7585 | ||
|
|
29ed482ffc | ||
|
|
b38db8803f | ||
|
|
59899c4d1b | ||
|
|
eec4cc8878 | ||
|
|
2e7124497d | ||
|
|
c0eae35b3d | ||
|
|
50c9141d00 | ||
|
|
2617a3c44d | ||
|
|
a7da2b8e17 | ||
|
|
e617a506ff | ||
|
|
80640bf0bc | ||
|
|
f05bce4f2f | ||
|
|
5cd3ae9f18 | ||
|
|
d9d5a12823 | ||
|
|
06f3746c62 | ||
|
|
14247e4f59 | ||
|
|
72bc04942a | ||
|
|
8e28ef0d85 | ||
|
|
996edff7e1 | ||
|
|
532ee6e056 | ||
|
|
08db2cc9c1 | ||
|
|
f25e4263fe | ||
|
|
2dc967ddd0 | ||
|
|
a357acdd3b | ||
|
|
7e98378d15 | ||
|
|
d663f506dc | ||
|
|
ead6774804 | ||
|
|
e05282f8b0 | ||
|
|
34b087c9d0 | ||
|
|
9f81028969 | ||
|
|
8781538f41 | ||
|
|
8343fdc3c7 | ||
|
|
e966578d2f | ||
|
|
7bab3c16ff | ||
|
|
e2d569973c | ||
|
|
caff6fc593 | ||
|
|
ccb0398da6 | ||
|
|
1f163fce81 | ||
|
|
4bee980bb5 | ||
|
|
7fa5428558 | ||
|
|
b9c9cd3ded | ||
|
|
8250e1b232 | ||
|
|
519c977c47 | ||
|
|
123370fb94 | ||
|
|
c97e457d53 | ||
|
|
f4e6ed09e4 | ||
|
|
b79e6e3a27 | ||
|
|
812b7246d4 | ||
|
|
db305124f3 | ||
|
|
bffbaf92bf | ||
|
|
5aca5d41c0 | ||
|
|
8343e6b6b2 | ||
|
|
f87c6a551e | ||
|
|
268ae49453 | ||
|
|
6270d1c086 | ||
|
|
5b54d26830 | ||
|
|
fccbab6f31 | ||
|
|
caf4e91a35 | ||
|
|
c01a838d62 | ||
|
|
66d3fb6af0 | ||
|
|
92e2dc11f3 | ||
|
|
5bcb4be17d | ||
|
|
dd9d9056cb | ||
|
|
44f28dd1e6 | ||
|
|
3f2959beee | ||
|
|
30e9cbe792 | ||
|
|
5b7f4c718f | ||
|
|
cb8044f032 | ||
|
|
7bca2646b5 | ||
|
|
edc2df54b9 | ||
|
|
365e872fa1 | ||
|
|
b3edc5fdb1 | ||
|
|
f7c4fe519b | ||
|
|
92c2c6e88c | ||
|
|
12cbba0d54 | ||
|
|
f9f6befa1f | ||
|
|
0552cbcdaa | ||
|
|
c3cd9be01f | ||
|
|
9f4a47b3ed | ||
|
|
51080676f1 | ||
|
|
1535ff91e1 | ||
|
|
79c8c47d5c | ||
|
|
84fe686173 | ||
|
|
44ea88c26e | ||
|
|
f4e6975590 | ||
|
|
3dd101aa4d | ||
|
|
ba44b8d42e | ||
|
|
7cdbce53f1 | ||
|
|
1ff9f2eed3 | ||
|
|
ee30926671 | ||
|
|
3d50fef7d7 | ||
|
|
33c162301a | ||
|
|
3abcf477a9 | ||
|
|
986fa907ae | ||
|
|
e4e1b8f230 | ||
|
|
da8f10881e | ||
|
|
ebbbc8bd1c | ||
|
|
bddd6e3495 | ||
|
|
6fc530e6a0 | ||
|
|
d24e8ac25b | ||
|
|
06e17142fc | ||
|
|
f82596346b | ||
|
|
38b4d7aab1 | ||
|
|
f16fede1cd | ||
|
|
4a15b7c625 | ||
|
|
065b75d3b7 | ||
|
|
75c3073bbf | ||
|
|
5762c18517 | ||
|
|
6a1dd28576 | ||
|
|
0737acd2a8 | ||
|
|
2198be3483 | ||
|
|
6fe498497c | ||
|
|
ce2c6d8452 | ||
|
|
e67c71c8fd | ||
|
|
ffa0e16198 | ||
|
|
910b3a81fd | ||
|
|
24a47191f3 | ||
|
|
4ba2edd2a5 | ||
|
|
4f5b7a76da | ||
|
|
8fe4d5bedb | ||
|
|
d43301b77a | ||
|
|
4727d57400 | ||
|
|
b815ab2101 | ||
|
|
ffaebdf38c | ||
|
|
8e04001f85 | ||
|
|
0450d6c177 | ||
|
|
745929c2a5 | ||
|
|
158d061609 | ||
|
|
16d616756f | ||
|
|
9fe6acbd1d | ||
|
|
5df832293e | ||
|
|
317ed9abdb | ||
|
|
080ae68432 | ||
|
|
6c6f6c44e5 | ||
|
|
11d31c00ad | ||
|
|
7f94a3c3de | ||
|
|
528c6ef7c0 | ||
|
|
1b0d48126b | ||
|
|
7233e20931 | ||
|
|
2d64b51d20 | ||
|
|
1f7732bca2 | ||
|
|
fec613dcf2 | ||
|
|
91f17128ab | ||
|
|
2a832cf05b | ||
|
|
0c9394280a | ||
|
|
07aafc4956 | ||
|
|
70fd1f9173 | ||
|
|
16f2ba724d | ||
|
|
0c0a51d34b | ||
|
|
68b6a94379 | ||
|
|
b7aa71a3f9 | ||
|
|
f1d0201952 | ||
|
|
41468ed388 | ||
|
|
5f0df1f650 | ||
|
|
e6b4ed7ffa | ||
|
|
f11bedf8ed | ||
|
|
c23746f339 | ||
|
|
7a1b1722f5 | ||
|
|
583c2aa3e5 | ||
|
|
9b2b619133 | ||
|
|
48f91f6a88 | ||
|
|
6f1c8d45f7 | ||
|
|
56023bc405 | ||
|
|
6f87807e62 | ||
|
|
799f203ff6 | ||
|
|
34eee35479 | ||
|
|
bcd092d706 | ||
|
|
713f110f53 | ||
|
|
4d11426716 | ||
|
|
3087bd32ff | ||
|
|
a47060f1c9 | ||
|
|
b04c0d805c | ||
|
|
a1a45c59ec | ||
|
|
64841ed746 | ||
|
|
901554b355 | ||
|
|
0e05f88ebf | ||
|
|
6715f00081 | ||
|
|
6a14feb048 | ||
|
|
02c54f7c22 | ||
|
|
243dac0af0 | ||
|
|
da018b129e | ||
|
|
e9554f7f9b | ||
|
|
71a1ac9398 | ||
|
|
6a2f94b39a | ||
|
|
6ba1d561eb | ||
|
|
f73546df92 | ||
|
|
be125aa5ba | ||
|
|
413cbfe68d | ||
|
|
ee463921ed | ||
|
|
76e7744bef | ||
|
|
d9e048ceac | ||
|
|
65a9383e6b | ||
|
|
c6b82f7ee9 | ||
|
|
25590043d1 | ||
|
|
8a5d624d5b | ||
|
|
ae4a75cecf | ||
|
|
2e884ce11d | ||
|
|
da8f1b738c | ||
|
|
33f44acbbe | ||
|
|
11c48a0fd2 | ||
|
|
3cdaca2436 | ||
|
|
b23da2919b | ||
|
|
610dfc3ef4 | ||
|
|
080f395392 | ||
|
|
f852b60797 | ||
|
|
e2356454c8 | ||
|
|
e5420be6cd | ||
|
|
9c00a95060 | ||
|
|
ebc71865f0 | ||
|
|
1dfa62d4c8 | ||
|
|
8c6364e198 | ||
|
|
98c2e93723 | ||
|
|
c053e538b4 | ||
|
|
6386647298 | ||
|
|
4b24b754f5 | ||
|
|
bfff2cc192 | ||
|
|
d8b177719a | ||
|
|
d985a68c89 | ||
|
|
8dad8bc465 | ||
|
|
235e76bce1 | ||
|
|
d38c549e60 | ||
|
|
558189183f | ||
|
|
77ada38dbd | ||
|
|
8124ebcd78 | ||
|
|
04fde2025b | ||
|
|
6bd61198fb | ||
|
|
23b5e47ffc | ||
|
|
fb81e6d300 | ||
|
|
50ff4afb03 | ||
|
|
c51f6bccea | ||
|
|
836a811604 | ||
|
|
bb65e3f22b | ||
|
|
b8719c753e | ||
|
|
92b2530acd | ||
|
|
9ff94ad7ae | ||
|
|
60ccb02c4a | ||
|
|
094fb13876 | ||
|
|
9c5d75d5a9 | ||
|
|
ca461ecd11 | ||
|
|
0ad9fe2d59 | ||
|
|
a203df7521 | ||
|
|
144517299c | ||
|
|
5c468f0c1f | ||
|
|
83a4ae6b0b | ||
|
|
9374bc1c10 | ||
|
|
e9c563fc29 | ||
|
|
4887e07819 | ||
|
|
652ac3e93a | ||
|
|
8d2f61ac70 | ||
|
|
02a23fa309 | ||
|
|
bef20d4a68 | ||
|
|
dddddb2e6c | ||
|
|
8fcb93613a | ||
|
|
ecb58c1628 | ||
|
|
a969ca5cc8 | ||
|
|
1e4406a854 | ||
|
|
94fbee800b | ||
|
|
c50847c28b | ||
|
|
b1ce2d24dd | ||
|
|
743fb51d2c | ||
|
|
0ed781740d | ||
|
|
d0e542fdc9 | ||
|
|
457863efdf | ||
|
|
5bd4fcc5c2 | ||
|
|
3dd2eebfbc | ||
|
|
d079b387a3 | ||
|
|
8eeaeb4b04 | ||
|
|
0041925844 | ||
|
|
14fa016b2b | ||
|
|
7fdccda37d | ||
|
|
cdc575c46b | ||
|
|
2f0aaf76f3 | ||
|
|
6b7887b0ab | ||
|
|
9ad1b440ae | ||
|
|
9275ad321f | ||
|
|
216a2a5fc6 | ||
|
|
c2c6044933 | ||
|
|
dc95c53c6f | ||
|
|
b24a53dd9a | ||
|
|
ffbe7cd0c5 | ||
|
|
97183a312e | ||
|
|
46ed8aff6d | ||
|
|
6a0a48433b | ||
|
|
ad3d95222d | ||
|
|
18ea747ce4 | ||
|
|
f4f512a853 | ||
|
|
9c2bed0b65 | ||
|
|
ad83334e73 | ||
|
|
2cf4bc9ecd | ||
|
|
c8ac945d59 | ||
|
|
92aa50bc03 | ||
|
|
2f31308b17 | ||
|
|
468d58e712 | ||
|
|
dd4b50ff6a | ||
|
|
030d5b8c97 | ||
|
|
9b73be38ab | ||
|
|
e5bf2f5d4c | ||
|
|
a7096946fa | ||
|
|
4a8362a68b | ||
|
|
25128a11fb | ||
|
|
3deb968fec | ||
|
|
276eb93218 | ||
|
|
29c33e16ac | ||
|
|
bffb696f65 | ||
|
|
fd2d78e70b | ||
|
|
6b1fb9179e | ||
|
|
702175817f | ||
|
|
703ec840dc | ||
|
|
04d706d42a | ||
|
|
b996cecc32 | ||
|
|
7e927da2a5 | ||
|
|
7aa6d2fcf9 | ||
|
|
27b1f137ff | ||
|
|
f63c927e8e | ||
|
|
d572544a2c | ||
|
|
9100840258 | ||
|
|
0f32c83c91 | ||
|
|
80b570142d | ||
|
|
a99b6fcb7c | ||
|
|
02d1a6b3aa | ||
|
|
08e8d58785 | ||
|
|
c90c41f09d | ||
|
|
c47b636a2c | ||
|
|
7200b39ecd | ||
|
|
84c95826de | ||
|
|
63819e6f00 | ||
|
|
8206dba75c | ||
|
|
528ef87850 | ||
|
|
9004c53107 | ||
|
|
f47f99f295 | ||
|
|
00f473b3cc | ||
|
|
356de7146e | ||
|
|
9eab925395 | ||
|
|
22d89c501e | ||
|
|
c06916db9f | ||
|
|
ef7545a3e6 | ||
|
|
fecb4ff331 | ||
|
|
2a4adf19c8 | ||
|
|
44c854ddb9 | ||
|
|
47091035f1 | ||
|
|
f3d51d7740 | ||
|
|
70d3b4b653 | ||
|
|
2fb94e4861 | ||
|
|
1b84893905 | ||
|
|
68b5330040 | ||
|
|
da7ae62abd | ||
|
|
f53337b89c | ||
|
|
f70a5895e3 | ||
|
|
d41bbd0db5 | ||
|
|
49956294fc | ||
|
|
48373e55d1 | ||
|
|
42369021ed | ||
|
|
b00fe7ce18 | ||
|
|
872e3fd502 | ||
|
|
c11ada6c99 | ||
|
|
8f0968850b | ||
|
|
0b96f60a56 | ||
|
|
ab06ff6bee | ||
|
|
bba8456e65 | ||
|
|
b493a05720 | ||
|
|
c2a8133d1c | ||
|
|
e935440ad7 | ||
|
|
8eaf563c41 | ||
|
|
80d7e6b039 | ||
|
|
9c44e33230 | ||
|
|
b86f3197b7 | ||
|
|
0875c00584 | ||
|
|
dd3a770e07 | ||
|
|
64763ce09b | ||
|
|
2fffc29bd1 | ||
|
|
d2650c3a4a | ||
|
|
b5bd966ea4 | ||
|
|
e71f7786e3 | ||
|
|
e3b95e6b24 | ||
|
|
658eeec7cd | ||
|
|
e1c3d65f08 | ||
|
|
2e4abe2ce2 | ||
|
|
ea294bb50e | ||
|
|
b58ea0b941 | ||
|
|
16067fe5fd | ||
|
|
f2e9070f26 | ||
|
|
fe8629e1a5 | ||
|
|
2a12eff4b2 | ||
|
|
b680fef061 | ||
|
|
7f7414e054 | ||
|
|
8b9db484ed | ||
|
|
f59f2fcbff | ||
|
|
419a530194 | ||
|
|
69a8901eb1 | ||
|
|
2bcd08e691 | ||
|
|
167d692925 | ||
|
|
025ee1dbde | ||
|
|
dce7b92d0b | ||
|
|
db886c2a2b | ||
|
|
4d43129446 | ||
|
|
92107f8150 | ||
|
|
e82d6a2019 | ||
|
|
4e5755cd85 | ||
|
|
dda8dcd2c0 | ||
|
|
16646b0018 | ||
|
|
320881c25c | ||
|
|
1d23fb382e | ||
|
|
c4f1942a76 | ||
|
|
38c42c6eea | ||
|
|
51eb247d0f | ||
|
|
8d22673a62 | ||
|
|
3622d3743e | ||
|
|
fbbf28e7c2 | ||
|
|
f5dac77c06 | ||
|
|
067d72a082 | ||
|
|
ac0f3f506a | ||
|
|
f819147028 | ||
|
|
a530963f05 | ||
|
|
bc5a53f5e9 | ||
|
|
83382fb9d5 | ||
|
|
0674370017 | ||
|
|
2f91cb2c5e | ||
|
|
acb25c2327 | ||
|
|
2d842a90f8 | ||
|
|
80705bfc50 | ||
|
|
2a8692311d | ||
|
|
7d0ed89d57 | ||
|
|
0912fae6ce | ||
|
|
0bb2154ee9 | ||
|
|
c9355e20c3 | ||
|
|
6545372c24 | ||
|
|
17f8412983 | ||
|
|
d48df9a91b | ||
|
|
65448fd0d3 | ||
|
|
a677c87b7b | ||
|
|
f8a123b4a2 | ||
|
|
c64beae686 | ||
|
|
99ef8323e4 | ||
|
|
2668c58969 | ||
|
|
5ae3168a77 | ||
|
|
559579659c | ||
|
|
2dd74160cc | ||
|
|
2adf63272c | ||
|
|
fb5a0fb8f1 | ||
|
|
c222de16ce | ||
|
|
19091ac236 | ||
|
|
2fcf251d3d | ||
|
|
dab5848cd9 | ||
|
|
a02f0f3d69 | ||
|
|
e69d49364e | ||
|
|
38921f0abf | ||
|
|
d76ce84c92 | ||
|
|
c3c7a0d26e | ||
|
|
d06bc800f2 | ||
|
|
a01dc637bd | ||
|
|
3bbbe757ea | ||
|
|
76474e519f | ||
|
|
420f572d49 | ||
|
|
6d65d44b95 | ||
|
|
91e1ff77a0 | ||
|
|
c8e60ec8fa | ||
|
|
e840570207 | ||
|
|
077527f19e | ||
|
|
00daa2e6c6 | ||
|
|
000f221d60 | ||
|
|
579a605494 | ||
|
|
fa29ebd7ed | ||
|
|
3360999046 | ||
|
|
0b965e59cb | ||
|
|
1684846f54 | ||
|
|
dde6d9520c | ||
|
|
f9a772b743 | ||
|
|
0d6f7dbb50 | ||
|
|
994a1ea900 | ||
|
|
e5d1fd38d1 | ||
|
|
a330ed26be | ||
|
|
ca0a86c89d | ||
|
|
1cf7bbce48 | ||
|
|
4cdde22432 | ||
|
|
a28cee6efe | ||
|
|
1977bafba4 | ||
|
|
3c96907f2b | ||
|
|
2d96a30dc7 | ||
|
|
c09d1df7d3 | ||
|
|
c20dd45477 | ||
|
|
abb320463d | ||
|
|
ada3f8b5d3 | ||
|
|
6172561597 | ||
|
|
368b64d6dd | ||
|
|
4ed0ca2b3e | ||
|
|
a92f98c630 | ||
|
|
4385b556b4 | ||
|
|
5e7c9519b8 | ||
|
|
ef02492908 | ||
|
|
86d5f9ba4f | ||
|
|
febcec6254 | ||
|
|
f07cb1ce8e | ||
|
|
b3c17a4805 | ||
|
|
7b83fe34c0 | ||
|
|
e0b1c57ae0 | ||
|
|
6806b06d21 | ||
|
|
0af0e9d747 | ||
|
|
2191b3ba44 | ||
|
|
73020a945b | ||
|
|
9c2d0cd11c | ||
|
|
0ef9b9c7bf | ||
|
|
c14c6e996d | ||
|
|
51381cd4ed | ||
|
|
8c9ab050e5 | ||
|
|
b6996c7849 | ||
|
|
2c23b0716e | ||
|
|
f548a0e4d5 | ||
|
|
a404f63f92 | ||
|
|
b54f50d277 | ||
|
|
10ba241909 | ||
|
|
1f238b1c4a | ||
|
|
ef85bf8c2b | ||
|
|
cbfccdb729 | ||
|
|
94111aa401 | ||
|
|
eec48070a1 | ||
|
|
eebe668174 | ||
|
|
8a15a4a7b4 | ||
|
|
19057003f1 | ||
|
|
031648d4ce | ||
|
|
02bee340a2 | ||
|
|
f6f2f68a05 | ||
|
|
982d68a0c0 | ||
|
|
7585a86a76 | ||
|
|
73190f1b46 | ||
|
|
6673ac592a | ||
|
|
59aa655b53 | ||
|
|
c4c99b4961 | ||
|
|
ccbbcddd5f | ||
|
|
65d82478d8 | ||
|
|
02a6518a02 | ||
|
|
a79053511b | ||
|
|
eb56eb2279 | ||
|
|
d40f6d4a02 | ||
|
|
943ae0951a | ||
|
|
999eeaba14 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -11,15 +11,10 @@
|
||||
# Top level excludes
|
||||
/Makefile.bak
|
||||
/Makefile
|
||||
/MINFO
|
||||
/*.a
|
||||
/include
|
||||
/*.pc
|
||||
/rehash.time
|
||||
/inc.*
|
||||
/makefile.*
|
||||
/out.*
|
||||
/tmp.*
|
||||
|
||||
# Most *.c files under test/ are symlinks
|
||||
/test/*.c
|
||||
|
||||
385
Configure
385
Configure
@@ -10,7 +10,7 @@ use strict;
|
||||
|
||||
# see INSTALL for instructions.
|
||||
|
||||
my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
||||
my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
|
||||
|
||||
# Options:
|
||||
#
|
||||
@@ -56,7 +56,6 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
|
||||
# [no-]zlib [don't] compile support for zlib compression.
|
||||
# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
|
||||
# library and will be loaded in run-time by the OpenSSL library.
|
||||
# sctp include SCTP support
|
||||
# 386 generate 80386 code
|
||||
# no-sse2 disables IA-32 SSE2 code, above option implies no-sse2
|
||||
# no-<cipher> build without specified algorithm (rsa, idea, rc5, ...)
|
||||
@@ -105,8 +104,6 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
|
||||
|
||||
my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
|
||||
|
||||
my $clang_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum";
|
||||
|
||||
my $strict_warnings = 0;
|
||||
|
||||
my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
|
||||
@@ -126,25 +123,21 @@ my $tlib="-lnsl -lsocket";
|
||||
my $bits1="THIRTY_TWO_BIT ";
|
||||
my $bits2="SIXTY_FOUR_BIT ";
|
||||
|
||||
my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o x86-gf2m.o::des-586.o crypt586.o:aes-586.o vpaes-x86.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o:ghash-x86.o:";
|
||||
my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes-586.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o";
|
||||
|
||||
my $x86_elf_asm="$x86_asm:elf";
|
||||
|
||||
my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o:ecp_nistz256.o ecp_nistz256-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o aesni-gcm-x86_64.o:";
|
||||
my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void";
|
||||
my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o vis3-mont.o sparct4-mont.o sparcv9-gf2m.o::des_enc-sparc.o fcrypt_b.o dest4-sparcv9.o:aes_core.o aes_cbc.o aes-sparcv9.o aest4-sparcv9.o::md5-sparcv9.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o::::::camellia.o cmll_misc.o cmll_cbc.o cmllt4-sparcv9.o:ghash-sparcv9.o::void";
|
||||
my $sparcv8_asm=":sparcv8.o::des_enc-sparc.o fcrypt_b.o:::::::::::::void";
|
||||
my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::sha1-alpha.o:::::::ghash-alpha.o::void";
|
||||
my $mips64_asm=":bn-mips.o mips-mont.o:::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o sha512-mips.o::::::::";
|
||||
my $mips32_asm=$mips64_asm; $mips32_asm =~ s/\s*sha512\-mips\.o//;
|
||||
my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o s390x-gf2m.o:::aes-s390x.o aes-ctr.o aes-xts.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::ghash-s390x.o:";
|
||||
my $armv4_asm="armcap.o armv4cpuid.o:bn_asm.o armv4-mont.o armv4-gf2m.o:::aes_cbc.o aes-armv4.o bsaes-armv7.o aesv8-armx.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::ghash-armv4.o ghashv8-armx.o::void";
|
||||
my $aarch64_asm="armcap.o arm64cpuid.o mem_clr.o::::aes_core.o aes_cbc.o aesv8-armx.o:::sha1-armv8.o sha256-armv8.o sha512-armv8.o:::::::ghashv8-armx.o:";
|
||||
my $parisc11_asm="pariscid.o:bn_asm.o parisc-mont.o:::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::32";
|
||||
my $parisc20_asm="pariscid.o:pa-risc2W.o parisc-mont.o:::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::64";
|
||||
my $ppc64_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o:::aes_core.o aes_cbc.o aes-ppc.o vpaes-ppc.o aesp8-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o sha256p8-ppc.o sha512p8-ppc.o:::::::ghashp8-ppc.o:";
|
||||
my $ppc32_asm=$ppc64_asm;
|
||||
my $no_asm="::::::::::::::::void";
|
||||
my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o";
|
||||
my $ia64_asm="ia64cpuid.o:bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::void";
|
||||
my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::void";
|
||||
my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::void";
|
||||
my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::::::::void";
|
||||
my $mips3_asm=":bn-mips3.o::::::::::::void";
|
||||
my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o::aes-s390x.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::void";
|
||||
my $armv4_asm=":bn_asm.o armv4-mont.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::void";
|
||||
my $ppc32_asm="ppccpuid.o:bn-ppc.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::";
|
||||
my $ppc64_asm="ppccpuid.o:bn-ppc.o ppc-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::";
|
||||
my $no_asm=":::::::::::::void";
|
||||
|
||||
# As for $BSDthreads. Idea is to maintain "collective" set of flags,
|
||||
# which would cover all BSD flavors. -pthread applies to them all,
|
||||
@@ -155,7 +148,7 @@ my $no_asm="::::::::::::::::void";
|
||||
# seems to be sufficient?
|
||||
my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT";
|
||||
|
||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $ec_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $modes_obj : $engines_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib
|
||||
#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib
|
||||
|
||||
my %table=(
|
||||
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
|
||||
@@ -170,36 +163,33 @@ my %table=(
|
||||
# Our development configs
|
||||
"purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::",
|
||||
"debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::",
|
||||
"debug-ben", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DDEBUG_SAFESTACK -O2 -pipe::(unknown):::::",
|
||||
"debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG_UNUSED -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o",
|
||||
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
||||
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
|
||||
"debug-ben-debug", "gcc44:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe::(unknown)::::::",
|
||||
"debug-ben-debug-64", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-ben-macos", "cc:$gcc_devteam_warn -arch i386 -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::-Wl,-search_paths_first::::",
|
||||
"debug-ben-macos-gcc46", "gcc-mp-4.6:$gcc_devteam_warn -Wconversion -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::::::",
|
||||
"debug-ben-darwin64","cc:$gcc_devteam_warn -g -Wno-language-extension-token -Wno-extended-offsetof -arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"debug-ben-debug-64-clang", "clang:$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-ben-debug-64", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=strict-aliasing -Wno-error=uninitialized -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
|
||||
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
|
||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
|
||||
"debug-bodo", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
|
||||
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn",
|
||||
"debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o::des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"debug-linux-x86_64", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"dist", "cc:-O::(unknown)::::::",
|
||||
|
||||
# Basic configs that should work on any (32 and less bit) box
|
||||
@@ -225,10 +215,10 @@ my %table=(
|
||||
# actually recommend to consider using gcc shared build even with vendor
|
||||
# compiler:-)
|
||||
# <appro@fy.chalmers.se>
|
||||
"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
||||
"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
||||
|
||||
#### Solaris x86 with Sun C setups
|
||||
"solaris-x86-cc","cc:-fast -xarch=generic -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
|
||||
|
||||
#### SPARC Solaris with GNU C setups
|
||||
@@ -259,16 +249,16 @@ my %table=(
|
||||
|
||||
#### IRIX 5.x configs
|
||||
# -mips2 flag is added by ./config when appropriate.
|
||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
#### IRIX 6.x configs
|
||||
# Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke
|
||||
# './Configure irix-cc -o32' manually.
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_asm}:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_asm}:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
# N64 ABI builds.
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_asm}:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_asm}:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
|
||||
#### Unified HP-UX ANSI C configs.
|
||||
# Special notes:
|
||||
@@ -301,18 +291,17 @@ my %table=(
|
||||
# Since there is mention of this in shlib/hpux10-cc.sh
|
||||
"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc1_1-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${parisc11_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1",
|
||||
"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32",
|
||||
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o:::::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
||||
"hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1::pa-risc2.o::::::::::::void:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
||||
|
||||
# More attempts at unified 10.X and 11.X targets for HP C compiler.
|
||||
#
|
||||
# Chris Ruemmler <ruemmler@cup.hp.com>
|
||||
# Kevin Steves <ks@hp.se>
|
||||
"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc1_1-cc","cc:+DA1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${parisc11_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1",
|
||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32",
|
||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${parisc20_asm}:dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
||||
"hpux-parisc1_0-cc","cc:+DAportable +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2.o::::::::::::void:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::void:dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64",
|
||||
|
||||
# HP/UX IA-64 targets
|
||||
"hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/hpux32",
|
||||
@@ -350,72 +339,21 @@ my %table=(
|
||||
# throw in -D[BL]_ENDIAN, whichever appropriate...
|
||||
"linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#######################################################################
|
||||
# Note that -march is not among compiler options in below linux-armv4
|
||||
# target line. Not specifying one is intentional to give you choice to:
|
||||
#
|
||||
# a) rely on your compiler default by not specifying one;
|
||||
# b) specify your target platform explicitly for optimal performance,
|
||||
# e.g. -march=armv6 or -march=armv7-a;
|
||||
# c) build "universal" binary that targets *range* of platforms by
|
||||
# specifying minimum and maximum supported architecture;
|
||||
#
|
||||
# As for c) option. It actually makes no sense to specify maximum to be
|
||||
# less than ARMv7, because it's the least requirement for run-time
|
||||
# switch between platform-specific code paths. And without run-time
|
||||
# switch performance would be equivalent to one for minimum. Secondly,
|
||||
# there are some natural limitations that you'd have to accept and
|
||||
# respect. Most notably you can *not* build "universal" binary for
|
||||
# big-endian platform. This is because ARMv7 processor always picks
|
||||
# instructions in little-endian order. Another similar limitation is
|
||||
# that -mthumb can't "cross" -march=armv6t2 boundary, because that's
|
||||
# where it became Thumb-2. Well, this limitation is a bit artificial,
|
||||
# because it's not really impossible, but it's deemed too tricky to
|
||||
# support. And of course you have to be sure that your binutils are
|
||||
# actually up to the task of handling maximum target platform. With all
|
||||
# this in mind here is an example of how to configure "universal" build:
|
||||
#
|
||||
# ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
|
||||
#
|
||||
# It's believed that majority of ARM toolchains predefine appropriate -march.
|
||||
# If you compiler does not, do complement config command line with one!
|
||||
"linux-armv4", "gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-aarch64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# Configure script adds minimally required -march for assembly support,
|
||||
# if no -march was specified at command line. mips32 and mips64 below
|
||||
# refer to contemporary MIPS Architecture specifications, MIPS32 and
|
||||
# MIPS64, rather than to kernel bitness.
|
||||
"linux-mips32", "gcc:-mabi=32 -DTERMIO -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-mips64", "gcc:-mabi=n32 -DTERMIO -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:n32:dlfcn:linux-shared:-fPIC:-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32",
|
||||
"linux64-mips64", "gcc:-mabi=64 -DTERMIO -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:64:dlfcn:linux-shared:-fPIC:-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
#### IA-32 targets...
|
||||
"linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2::-D_REENTRANT::-ldl -no_cpprt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
|
||||
####
|
||||
"linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-ppc64le","gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:$ppc64_asm:linux64le:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-x86_64-clang", "clang: -m64 -DL_ENDIAN -DTERMIO -O3 -Weverything $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-x86_64-icc", "icc:-DL_ENDIAN -DTERMIO -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-x32", "gcc:-mx32 -DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
|
||||
"linux64-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
#### So called "highgprs" target for z/Architecture CPUs
|
||||
# "Highgprs" is kernel feature first implemented in Linux 2.6.32, see
|
||||
# /proc/cpuinfo. The idea is to preserve most significant bits of
|
||||
# general purpose registers not only upon 32-bit process context
|
||||
# switch, but even on asynchronous signal delivery to such process.
|
||||
# This makes it possible to deploy 64-bit instructions even in legacy
|
||||
# application context and achieve better [or should we say adequate]
|
||||
# performance. The build is binary compatible with linux-generic32,
|
||||
# and the idea is to be able to install the resulting libcrypto.so
|
||||
# alongside generic one, e.g. as /lib/highgprs/libcrypto.so.x.y, for
|
||||
# ldconfig and run-time linker to autodiscover. Unfortunately it
|
||||
# doesn't work just yet, because of couple of bugs in glibc
|
||||
# sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
|
||||
"linux32-s390x", "gcc:-m31 -Wa,-mzarch -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$s390x_asm;$asm=~s/bn\-s390x\.o/bn_asm.o/;$asm}.":31:dlfcn:linux-shared:-fPIC:-m31:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/highgprs",
|
||||
"linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
"linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
|
||||
#### SPARC Linux setups
|
||||
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
|
||||
# assisted with debugging of following two configs.
|
||||
@@ -443,12 +381,6 @@ my %table=(
|
||||
"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
|
||||
|
||||
# Android: linux-* but without -DTERMIO and pointers to headers and libs.
|
||||
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"android-mips","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### *BSD [do see comment about ${BSDthreads} above!]
|
||||
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
@@ -462,7 +394,7 @@ my %table=(
|
||||
# triggered by RIPEMD160 code.
|
||||
"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
"bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
@@ -495,11 +427,11 @@ my %table=(
|
||||
# UnixWare 2.0x fails destest with -O.
|
||||
"unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
"unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::",
|
||||
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}-1:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -march=pentium -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}-1:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -march=pentium -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
|
||||
"sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}-1:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}-1:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### IBM's AIX.
|
||||
"aix3-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::",
|
||||
@@ -559,15 +491,15 @@ my %table=(
|
||||
# Visual C targets
|
||||
#
|
||||
# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
|
||||
"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o ia64-mont.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32",
|
||||
"VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32",
|
||||
"debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32",
|
||||
"debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32",
|
||||
"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32",
|
||||
"VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32",
|
||||
"debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32",
|
||||
"debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32",
|
||||
# x86 Win32 target defaults to ANSI API, if you want UNICODE, complement
|
||||
# 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
|
||||
"VC-WIN32","cl:-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
||||
"VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
||||
# Unified CE target
|
||||
"debug-VC-WIN32","cl:-W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
||||
"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
|
||||
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
|
||||
|
||||
# Borland C++ 4.5
|
||||
@@ -588,8 +520,9 @@ my %table=(
|
||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
|
||||
|
||||
# Cygwin
|
||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
|
||||
"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
|
||||
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
|
||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
|
||||
"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
|
||||
|
||||
# NetWare from David Ward (dsward@novell.com)
|
||||
# requires either MetroWerks NLM development tools, or gcc / nlmconv
|
||||
@@ -619,13 +552,10 @@ my %table=(
|
||||
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
|
||||
"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
# iPhoneOS/iOS
|
||||
"iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
|
||||
##### A/UX
|
||||
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
@@ -640,21 +570,18 @@ my %table=(
|
||||
"OS2-EMX", "gcc::::::::",
|
||||
|
||||
##### VxWorks for various targets
|
||||
"vxworks-ppc60x","ccppc:-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common:::::",
|
||||
"vxworks-ppcgen","ccppc:-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon:::::",
|
||||
"vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
||||
"vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::",
|
||||
"vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::",
|
||||
"vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::",
|
||||
"vxworks-simlinux","ccpentium:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK:::VXWORKS:-r::${no_asm}::::::ranlibpentium:",
|
||||
"vxworks-mips","ccmips:-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip::-D_REENTRANT:VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon::${mips32_asm}:o32::::::ranlibmips:",
|
||||
"vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::${no_asm}::::::ranlibmips:",
|
||||
|
||||
##### Compaq Non-Stop Kernel (Tandem)
|
||||
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
|
||||
|
||||
# uClinux
|
||||
"uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:${no_asm}:$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
||||
"uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:${no_asm}:$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
||||
"uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
||||
"uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
|
||||
|
||||
);
|
||||
|
||||
@@ -675,7 +602,6 @@ my $idx_lflags = $idx++;
|
||||
my $idx_bn_ops = $idx++;
|
||||
my $idx_cpuid_obj = $idx++;
|
||||
my $idx_bn_obj = $idx++;
|
||||
my $idx_ec_obj = $idx++;
|
||||
my $idx_des_obj = $idx++;
|
||||
my $idx_aes_obj = $idx++;
|
||||
my $idx_bf_obj = $idx++;
|
||||
@@ -687,8 +613,6 @@ my $idx_rmd160_obj = $idx++;
|
||||
my $idx_rc5_obj = $idx++;
|
||||
my $idx_wp_obj = $idx++;
|
||||
my $idx_cmll_obj = $idx++;
|
||||
my $idx_modes_obj = $idx++;
|
||||
my $idx_engines_obj = $idx++;
|
||||
my $idx_perlasm_scheme = $idx++;
|
||||
my $idx_dso_scheme = $idx++;
|
||||
my $idx_shared_target = $idx++;
|
||||
@@ -705,9 +629,6 @@ my $openssldir="";
|
||||
my $exe_ext="";
|
||||
my $install_prefix= "$ENV{'INSTALL_PREFIX'}";
|
||||
my $cross_compile_prefix="";
|
||||
my $fipsdir="/usr/local/ssl/fips-2.0";
|
||||
my $fipslibdir="";
|
||||
my $baseaddr="0xFB00000";
|
||||
my $no_threads=0;
|
||||
my $threads=0;
|
||||
my $no_shared=0; # but "no-shared" is default
|
||||
@@ -742,37 +663,26 @@ my $cmll_enc="camellia.o cmll_misc.o cmll_cbc.o";
|
||||
my $processor="";
|
||||
my $default_ranlib;
|
||||
my $perl;
|
||||
my $fips=0;
|
||||
|
||||
if (exists $ENV{FIPSDIR})
|
||||
{
|
||||
$fipsdir = $ENV{FIPSDIR};
|
||||
$fipsdir =~ s/\/$//;
|
||||
}
|
||||
|
||||
# All of the following is disabled by default (RC5 was enabled before 0.9.8):
|
||||
|
||||
my %disabled = ( # "what" => "comment" [or special keyword "experimental"]
|
||||
"ec_nistp_64_gcc_128" => "default",
|
||||
"gmp" => "default",
|
||||
"jpake" => "experimental",
|
||||
"libunbound" => "experimental",
|
||||
"md2" => "default",
|
||||
"rc5" => "default",
|
||||
"jpake" => "experimental",
|
||||
"md2" => "default",
|
||||
"rc5" => "default",
|
||||
"rfc3779" => "default",
|
||||
"sctp" => "default",
|
||||
"shared" => "default",
|
||||
"ssl-trace" => "default",
|
||||
"shared" => "default",
|
||||
"store" => "experimental",
|
||||
"unit-test" => "default",
|
||||
"zlib" => "default",
|
||||
"zlib-dynamic" => "default"
|
||||
);
|
||||
"zlib" => "default",
|
||||
"zlib-dynamic" => "default"
|
||||
);
|
||||
my @experimental = ();
|
||||
|
||||
# This is what $depflags will look like with the above defaults
|
||||
# (we need this to see if we should advise the user to run "make depend"):
|
||||
my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST";
|
||||
my $default_depflags = " -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE";
|
||||
|
||||
# Explicit "no-..." options will be collected in %disabled along with the defaults.
|
||||
# To remove something from %disabled, use "enable-foo" (unless it's experimental).
|
||||
@@ -830,7 +740,6 @@ PROCESS_ARGS:
|
||||
|
||||
# rewrite some options in "enable-..." form
|
||||
s /^-?-?shared$/enable-shared/;
|
||||
s /^sctp$/enable-sctp/;
|
||||
s /^threads$/enable-threads/;
|
||||
s /^zlib$/enable-zlib/;
|
||||
s /^zlib-dynamic$/enable-zlib-dynamic/;
|
||||
@@ -848,11 +757,6 @@ PROCESS_ARGS:
|
||||
{
|
||||
$disabled{"tls1"} = "option(tls)"
|
||||
}
|
||||
elsif ($1 eq "ssl3-method")
|
||||
{
|
||||
$disabled{"ssl3-method"} = "option(ssl)";
|
||||
$disabled{"ssl3"} = "option(ssl)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$disabled{$1} = "option";
|
||||
@@ -905,10 +809,6 @@ PROCESS_ARGS:
|
||||
}
|
||||
elsif (/^386$/)
|
||||
{ $processor=386; }
|
||||
elsif (/^fips$/)
|
||||
{
|
||||
$fips=1;
|
||||
}
|
||||
elsif (/^rsaref$/)
|
||||
{
|
||||
# No RSAref support any more since it's not needed.
|
||||
@@ -917,7 +817,15 @@ PROCESS_ARGS:
|
||||
}
|
||||
elsif (/^[-+]/)
|
||||
{
|
||||
if (/^--prefix=(.*)$/)
|
||||
if (/^-[lL](.*)$/ or /^-Wl,/)
|
||||
{
|
||||
$libs.=$_." ";
|
||||
}
|
||||
elsif (/^-[^-]/ or /^\+/)
|
||||
{
|
||||
$flags.=$_." ";
|
||||
}
|
||||
elsif (/^--prefix=(.*)$/)
|
||||
{
|
||||
$prefix=$1;
|
||||
}
|
||||
@@ -945,30 +853,14 @@ PROCESS_ARGS:
|
||||
{
|
||||
$withargs{"zlib-include"}="-I$1";
|
||||
}
|
||||
elsif (/^--with-fipsdir=(.*)$/)
|
||||
{
|
||||
$fipsdir="$1";
|
||||
}
|
||||
elsif (/^--with-fipslibdir=(.*)$/)
|
||||
{
|
||||
$fipslibdir="$1";
|
||||
}
|
||||
elsif (/^--with-baseaddr=(.*)$/)
|
||||
{
|
||||
$baseaddr="$1";
|
||||
}
|
||||
elsif (/^--cross-compile-prefix=(.*)$/)
|
||||
{
|
||||
$cross_compile_prefix=$1;
|
||||
}
|
||||
elsif (/^-[lL](.*)$/ or /^-Wl,/)
|
||||
else
|
||||
{
|
||||
$libs.=$_." ";
|
||||
}
|
||||
else # common if (/^[-+]/), just pass down...
|
||||
{
|
||||
$_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
|
||||
$flags.=$_." ";
|
||||
print STDERR $usage;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
elsif ($_ =~ /^([^:]+):(.+)$/)
|
||||
@@ -1035,17 +927,6 @@ if (defined($disabled{"md5"}) || defined($disabled{"rsa"}))
|
||||
$disabled{"ssl2"} = "forced";
|
||||
}
|
||||
|
||||
if ($fips && $fipslibdir eq "")
|
||||
{
|
||||
$fipslibdir = $fipsdir . "/lib/";
|
||||
}
|
||||
|
||||
# RSAX ENGINE sets default non-FIPS RSA method.
|
||||
if ($fips)
|
||||
{
|
||||
$disabled{"rsax"} = "forced";
|
||||
}
|
||||
|
||||
# SSL 3.0 and TLS requires MD5 and SHA and either RSA or DSA+DH
|
||||
if (defined($disabled{"md5"}) || defined($disabled{"sha"})
|
||||
|| (defined($disabled{"rsa"})
|
||||
@@ -1066,13 +947,6 @@ if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
|
||||
$disabled{"gost"} = "forced";
|
||||
}
|
||||
|
||||
# SRP and HEARTBEATS require TLSEXT
|
||||
if (defined($disabled{"tlsext"}))
|
||||
{
|
||||
$disabled{"srp"} = "forced";
|
||||
$disabled{"heartbeats"} = "forced";
|
||||
}
|
||||
|
||||
if ($target eq "TABLE") {
|
||||
foreach $target (sort keys %table) {
|
||||
print_table_entry($target);
|
||||
@@ -1122,7 +996,7 @@ foreach (sort (keys %disabled))
|
||||
else
|
||||
{
|
||||
my ($ALGO, $algo);
|
||||
($ALGO = $algo = $_) =~ tr/[\-a-z]/[_A-Z]/;
|
||||
($ALGO = $algo = $_) =~ tr/[a-z]/[A-Z]/;
|
||||
|
||||
if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/)
|
||||
{
|
||||
@@ -1203,7 +1077,6 @@ my $lflags = $fields[$idx_lflags];
|
||||
my $bn_ops = $fields[$idx_bn_ops];
|
||||
my $cpuid_obj = $fields[$idx_cpuid_obj];
|
||||
my $bn_obj = $fields[$idx_bn_obj];
|
||||
my $ec_obj = $fields[$idx_ec_obj];
|
||||
my $des_obj = $fields[$idx_des_obj];
|
||||
my $aes_obj = $fields[$idx_aes_obj];
|
||||
my $bf_obj = $fields[$idx_bf_obj];
|
||||
@@ -1215,8 +1088,6 @@ my $rmd160_obj = $fields[$idx_rmd160_obj];
|
||||
my $rc5_obj = $fields[$idx_rc5_obj];
|
||||
my $wp_obj = $fields[$idx_wp_obj];
|
||||
my $cmll_obj = $fields[$idx_cmll_obj];
|
||||
my $modes_obj = $fields[$idx_modes_obj];
|
||||
my $engines_obj = $fields[$idx_engines_obj];
|
||||
my $perlasm_scheme = $fields[$idx_perlasm_scheme];
|
||||
my $dso_scheme = $fields[$idx_dso_scheme];
|
||||
my $shared_target = $fields[$idx_shared_target];
|
||||
@@ -1249,12 +1120,6 @@ if ($target =~ /^mingw/ && `$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
|
||||
$shared_ldflag =~ s/\-mno\-cygwin\s*//;
|
||||
}
|
||||
|
||||
if ($target =~ /linux.*\-mips/ && !$no_asm && $flags !~ /\-m(ips|arch=)/) {
|
||||
# minimally required architecture flags for assembly modules
|
||||
$cflags="-mips2 $cflags" if ($target =~ /mips32/);
|
||||
$cflags="-mips3 $cflags" if ($target =~ /mips64/);
|
||||
}
|
||||
|
||||
my $no_shared_warn=0;
|
||||
my $no_user_cflags=0;
|
||||
|
||||
@@ -1381,9 +1246,9 @@ $lflags="$libs$lflags" if ($libs ne "");
|
||||
|
||||
if ($no_asm)
|
||||
{
|
||||
$cpuid_obj=$bn_obj=$ec_obj=
|
||||
$cpuid_obj=$bn_obj=
|
||||
$des_obj=$aes_obj=$bf_obj=$cast_obj=$rc4_obj=$rc5_obj=$cmll_obj=
|
||||
$modes_obj=$sha1_obj=$md5_obj=$rmd160_obj=$wp_obj=$engines_obj="";
|
||||
$sha1_obj=$md5_obj=$rmd160_obj=$wp_obj="";
|
||||
}
|
||||
|
||||
if (!$no_shared)
|
||||
@@ -1447,7 +1312,7 @@ if (!$IsMK1MF)
|
||||
}
|
||||
}
|
||||
|
||||
$cpuid_obj.=" uplink.o uplink-x86.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
|
||||
$cpuid_obj.=" uplink.o uplink-cof.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/);
|
||||
|
||||
#
|
||||
# Platform fix-ups
|
||||
@@ -1462,7 +1327,6 @@ if ($target =~ /\-icc$/) # Intel C compiler
|
||||
}
|
||||
if ($iccver>=8)
|
||||
{
|
||||
$cflags=~s/\-KPIC/-fPIC/;
|
||||
# Eliminate unnecessary dependency from libirc.a. This is
|
||||
# essential for shared library support, as otherwise
|
||||
# apps/openssl can end up in endless loop upon startup...
|
||||
@@ -1470,17 +1334,12 @@ if ($target =~ /\-icc$/) # Intel C compiler
|
||||
}
|
||||
if ($iccver>=9)
|
||||
{
|
||||
$lflags.=" -i-static";
|
||||
$lflags=~s/\-no_cpprt/-no-cpprt/;
|
||||
$cflags.=" -i-static";
|
||||
$cflags=~s/\-no_cpprt/-no-cpprt/;
|
||||
}
|
||||
if ($iccver>=10)
|
||||
{
|
||||
$lflags=~s/\-i\-static/-static-intel/;
|
||||
}
|
||||
if ($iccver>=11)
|
||||
{
|
||||
$cflags.=" -no-intel-extensions"; # disable Cilk
|
||||
$lflags=~s/\-no\-cpprt/-no-cxxlib/;
|
||||
$cflags=~s/\-i\-static/-static-intel/;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1521,14 +1380,6 @@ $cflags.=" -DOPENSSL_BN_ASM_PART_WORDS" if ($bn_obj =~ /bn-586/);
|
||||
$cflags.=" -DOPENSSL_IA32_SSE2" if (!$no_sse2 && $bn_obj =~ /86/);
|
||||
|
||||
$cflags.=" -DOPENSSL_BN_ASM_MONT" if ($bn_obj =~ /-mont/);
|
||||
$cflags.=" -DOPENSSL_BN_ASM_MONT5" if ($bn_obj =~ /-mont5/);
|
||||
$cflags.=" -DOPENSSL_BN_ASM_GF2m" if ($bn_obj =~ /-gf2m/);
|
||||
|
||||
if ($fips)
|
||||
{
|
||||
$openssl_other_defines.="#define OPENSSL_FIPS\n";
|
||||
$cflags .= " -I\$(FIPSDIR)/include";
|
||||
}
|
||||
|
||||
$cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/);
|
||||
$des_obj=$des_enc unless ($des_obj =~ /\.o$/);
|
||||
@@ -1561,15 +1412,7 @@ if ($rmd160_obj =~ /\.o$/)
|
||||
}
|
||||
if ($aes_obj =~ /\.o$/)
|
||||
{
|
||||
$cflags.=" -DAES_ASM" if ($aes_obj =~ m/\baes\-/);;
|
||||
# aes-ctr.o is not a real file, only indication that assembler
|
||||
# module implements AES_ctr32_encrypt...
|
||||
$cflags.=" -DAES_CTR_ASM" if ($aes_obj =~ s/\s*aes\-ctr\.o//);
|
||||
# aes-xts.o indicates presense of AES_xts_[en|de]crypt...
|
||||
$cflags.=" -DAES_XTS_ASM" if ($aes_obj =~ s/\s*aes\-xts\.o//);
|
||||
$aes_obj =~ s/\s*(vpaes|aesni)\-x86\.o//g if ($no_sse2);
|
||||
$cflags.=" -DVPAES_ASM" if ($aes_obj =~ m/vpaes/);
|
||||
$cflags.=" -DBSAES_ASM" if ($aes_obj =~ m/bsaes/);
|
||||
$cflags.=" -DAES_ASM";
|
||||
}
|
||||
else {
|
||||
$aes_obj=$aes_enc;
|
||||
@@ -1583,14 +1426,6 @@ else {
|
||||
$wp_obj="wp_block.o";
|
||||
}
|
||||
$cmll_obj=$cmll_enc unless ($cmll_obj =~ /.o$/);
|
||||
if ($modes_obj =~ /ghash\-/)
|
||||
{
|
||||
$cflags.=" -DGHASH_ASM";
|
||||
}
|
||||
if ($ec_obj =~ /ecp_nistz256/)
|
||||
{
|
||||
$cflags.=" -DECP_NISTZ256_ASM";
|
||||
}
|
||||
|
||||
# "Stringify" the C flags string. This permits it to be made part of a string
|
||||
# and works as well on command lines.
|
||||
@@ -1631,7 +1466,7 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
|
||||
if ($strict_warnings)
|
||||
{
|
||||
my $wopt;
|
||||
die "ERROR --strict-warnings requires gcc or clang" unless ($cc =~ /gcc$/ or $cc =~ /clang$/);
|
||||
die "ERROR --strict-warnings requires gcc" unless ($cc =~ /gcc$/);
|
||||
foreach $wopt (split /\s+/, $gcc_devteam_warn)
|
||||
{
|
||||
$cflags .= " $wopt" unless ($cflags =~ /$wopt/)
|
||||
@@ -1694,7 +1529,6 @@ while (<IN>)
|
||||
s/^EXE_EXT=.*$/EXE_EXT= $exe_ext/;
|
||||
s/^CPUID_OBJ=.*$/CPUID_OBJ= $cpuid_obj/;
|
||||
s/^BN_ASM=.*$/BN_ASM= $bn_obj/;
|
||||
s/^EC_ASM=.*$/EC_ASM= $ec_obj/;
|
||||
s/^DES_ENC=.*$/DES_ENC= $des_obj/;
|
||||
s/^AES_ENC=.*$/AES_ENC= $aes_obj/;
|
||||
s/^BF_ENC=.*$/BF_ENC= $bf_obj/;
|
||||
@@ -1706,8 +1540,6 @@ while (<IN>)
|
||||
s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/;
|
||||
s/^WP_ASM_OBJ=.*$/WP_ASM_OBJ= $wp_obj/;
|
||||
s/^CMLL_ENC=.*$/CMLL_ENC= $cmll_obj/;
|
||||
s/^MODES_ASM_OBJ.=*$/MODES_ASM_OBJ= $modes_obj/;
|
||||
s/^ENGINES_ASM_OBJ.=*$/ENGINES_ASM_OBJ= $engines_obj/;
|
||||
s/^PERLASM_SCHEME=.*$/PERLASM_SCHEME= $perlasm_scheme/;
|
||||
s/^PROCESSOR=.*/PROCESSOR= $processor/;
|
||||
s/^ARFLAGS=.*/ARFLAGS= $arflags/;
|
||||
@@ -1716,12 +1548,6 @@ while (<IN>)
|
||||
s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
|
||||
s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/;
|
||||
s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/;
|
||||
|
||||
s/^FIPSDIR=.*/FIPSDIR=$fipsdir/;
|
||||
s/^FIPSLIBDIR=.*/FIPSLIBDIR=$fipslibdir/;
|
||||
s/^FIPSCANLIB=.*/FIPSCANLIB=libcrypto/ if $fips;
|
||||
s/^BASEADDR=.*/BASEADDR=$baseaddr/;
|
||||
|
||||
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
|
||||
s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
|
||||
s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
|
||||
@@ -1756,7 +1582,6 @@ print "CFLAG =$cflags\n";
|
||||
print "EX_LIBS =$lflags\n";
|
||||
print "CPUID_OBJ =$cpuid_obj\n";
|
||||
print "BN_ASM =$bn_obj\n";
|
||||
print "EC_ASM =$ec_obj\n";
|
||||
print "DES_ENC =$des_obj\n";
|
||||
print "AES_ENC =$aes_obj\n";
|
||||
print "BF_ENC =$bf_obj\n";
|
||||
@@ -1766,9 +1591,7 @@ print "RC5_ENC =$rc5_obj\n";
|
||||
print "MD5_OBJ_ASM =$md5_obj\n";
|
||||
print "SHA1_OBJ_ASM =$sha1_obj\n";
|
||||
print "RMD160_OBJ_ASM=$rmd160_obj\n";
|
||||
print "CMLL_ENC =$cmll_obj\n";
|
||||
print "MODES_OBJ =$modes_obj\n";
|
||||
print "ENGINES_OBJ =$engines_obj\n";
|
||||
print "CMLL_ENC= =$cmll_obj\n";
|
||||
print "PROCESSOR =$processor\n";
|
||||
print "RANLIB =$ranlib\n";
|
||||
print "ARFLAGS =$arflags\n";
|
||||
@@ -1830,9 +1653,6 @@ open(OUT,'>crypto/opensslconf.h.new') || die "unable to create crypto/opensslcon
|
||||
print OUT "/* opensslconf.h */\n";
|
||||
print OUT "/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n";
|
||||
|
||||
print OUT "#ifdef __cplusplus\n";
|
||||
print OUT "extern \"C\" {\n";
|
||||
print OUT "#endif\n";
|
||||
print OUT "/* OpenSSL was configured with the following options: */\n";
|
||||
my $openssl_algorithm_defines_trans = $openssl_algorithm_defines;
|
||||
$openssl_experimental_defines =~ s/^\s*#\s*define\s+OPENSSL_NO_(.*)/#ifndef OPENSSL_EXPERIMENTAL_$1\n# ifndef OPENSSL_NO_$1\n# define OPENSSL_NO_$1\n# endif\n#endif/mg;
|
||||
@@ -1937,9 +1757,6 @@ while (<IN>)
|
||||
{ print OUT $_; }
|
||||
}
|
||||
close(IN);
|
||||
print OUT "#ifdef __cplusplus\n";
|
||||
print OUT "}\n";
|
||||
print OUT "#endif\n";
|
||||
close(OUT);
|
||||
rename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h";
|
||||
rename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n";
|
||||
@@ -2055,7 +1872,7 @@ BEGIN
|
||||
VALUE "ProductVersion", "$version\\0"
|
||||
// Optional:
|
||||
//VALUE "Comments", "\\0"
|
||||
VALUE "LegalCopyright", "Copyright <EFBFBD> 1998-2005 The OpenSSL Project. Copyright <20> 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
|
||||
VALUE "LegalCopyright", "Copyright <20> 1998-2005 The OpenSSL Project. Copyright <20> 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
|
||||
//VALUE "LegalTrademarks", "\\0"
|
||||
//VALUE "PrivateBuild", "\\0"
|
||||
//VALUE "SpecialBuild", "\\0"
|
||||
@@ -2164,12 +1981,11 @@ sub print_table_entry
|
||||
{
|
||||
my $target = shift;
|
||||
|
||||
my ($cc, $cflags, $unistd, $thread_cflag, $sys_id, $lflags,
|
||||
$bn_ops, $cpuid_obj, $bn_obj, $ec_obj, $des_obj, $aes_obj, $bf_obj,
|
||||
$md5_obj, $sha1_obj, $cast_obj, $rc4_obj, $rmd160_obj,
|
||||
$rc5_obj, $wp_obj, $cmll_obj, $modes_obj, $engines_obj,
|
||||
$perlasm_scheme, $dso_scheme, $shared_target, $shared_cflag,
|
||||
$shared_ldflag, $shared_extension, $ranlib, $arflags, $multilib)=
|
||||
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags,
|
||||
my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj,
|
||||
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
|
||||
my $rc5_obj,my $wp_obj,my $cmll_obj,my $perlasm_scheme,my $dso_scheme,my $shared_target,my $shared_cflag,
|
||||
my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags,my $multilib)=
|
||||
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
|
||||
|
||||
print <<EOF
|
||||
@@ -2184,7 +2000,6 @@ sub print_table_entry
|
||||
\$bn_ops = $bn_ops
|
||||
\$cpuid_obj = $cpuid_obj
|
||||
\$bn_obj = $bn_obj
|
||||
\$ec_obj = $ec_obj
|
||||
\$des_obj = $des_obj
|
||||
\$aes_obj = $aes_obj
|
||||
\$bf_obj = $bf_obj
|
||||
@@ -2196,8 +2011,6 @@ sub print_table_entry
|
||||
\$rc5_obj = $rc5_obj
|
||||
\$wp_obj = $wp_obj
|
||||
\$cmll_obj = $cmll_obj
|
||||
\$modes_obj = $modes_obj
|
||||
\$engines_obj = $engines_obj
|
||||
\$perlasm_scheme = $perlasm_scheme
|
||||
\$dso_scheme = $dso_scheme
|
||||
\$shared_target= $shared_target
|
||||
|
||||
40
FAQ
40
FAQ
@@ -83,7 +83,7 @@ OpenSSL - Frequently Asked Questions
|
||||
* Which is the current version of OpenSSL?
|
||||
|
||||
The current version is available from <URL: http://www.openssl.org>.
|
||||
OpenSSL 1.0.1a was released on Apr 19th, 2012.
|
||||
OpenSSL 1.0.1c was released on Feb 5th, 2013.
|
||||
|
||||
In addition to the current stable release, you can also access daily
|
||||
snapshots of the OpenSSL development version at <URL:
|
||||
@@ -184,18 +184,14 @@ Therefore the answer to the common question "when will feature X be
|
||||
backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear
|
||||
in the next minor release.
|
||||
|
||||
* What happens when the letter release reaches z?
|
||||
|
||||
It was decided after the release of OpenSSL 0.9.8y the next version should
|
||||
be 0.9.8za then 0.9.8zb and so on.
|
||||
|
||||
|
||||
[LEGAL] =======================================================================
|
||||
|
||||
* Do I need patent licenses to use OpenSSL?
|
||||
|
||||
For information on intellectual property rights, please consult a lawyer.
|
||||
The OpenSSL team does not offer legal advice.
|
||||
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 IDEA, MDC2 and RC5 by using
|
||||
./config no-idea no-mdc2 no-rc5
|
||||
@@ -612,8 +608,8 @@ 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. Red Hat has chosen to disable support for IDEA, RC5 and
|
||||
MDC2 in this version. The same may apply to other Linux distributions.
|
||||
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
|
||||
@@ -636,6 +632,11 @@ 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?
|
||||
|
||||
@@ -861,7 +862,7 @@ The opposite assumes we already have len bytes in buf:
|
||||
p = buf;
|
||||
p7 = d2i_PKCS7(NULL, &p, len);
|
||||
|
||||
At this point p7 contains a valid PKCS7 structure or NULL if an error
|
||||
At this point p7 contains a valid PKCS7 structure of NULL if an error
|
||||
occurred. If an error occurred ERR_print_errors(bio) should give more
|
||||
information.
|
||||
|
||||
@@ -873,21 +874,6 @@ 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.
|
||||
|
||||
Memory allocation and encoding can also be combined in a single
|
||||
operation by the ASN1 routines:
|
||||
|
||||
unsigned char *buf = NULL; /* mandatory */
|
||||
int len;
|
||||
len = i2d_PKCS7(p7, &buf);
|
||||
if (len < 0)
|
||||
/* Error */
|
||||
/* Do some things with 'buf' */
|
||||
/* Finished with buf: free it */
|
||||
OPENSSL_free(buf);
|
||||
|
||||
In this special case the "buf" parameter is *not* incremented, it points
|
||||
to the start of the encoding.
|
||||
|
||||
|
||||
* OpenSSL uses DER but I need BER format: does OpenSSL support BER?
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
./Configure $@ no-symlinks
|
||||
make files
|
||||
util/mk1mf.pl OUT=out.$BRANCH TMP=tmp.$BRANCH INC=inc.$BRANCH copy > makefile.$BRANCH
|
||||
make -f makefile.$BRANCH init
|
||||
5
GitMake
5
GitMake
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
make -f makefile.$BRANCH $@
|
||||
112
Makefile.org
112
Makefile.org
@@ -88,7 +88,6 @@ PROCESSOR=
|
||||
# CPUID module collects small commonly used assembler snippets
|
||||
CPUID_OBJ=
|
||||
BN_ASM= bn_asm.o
|
||||
EC_ASM=
|
||||
DES_ENC= des_enc.o fcrypt_b.o
|
||||
AES_ENC= aes_core.o aes_cbc.o
|
||||
BF_ENC= bf_enc.o
|
||||
@@ -100,8 +99,6 @@ SHA1_ASM_OBJ=
|
||||
RMD160_ASM_OBJ=
|
||||
WP_ASM_OBJ=
|
||||
CMLL_ENC=
|
||||
MODES_ASM_OBJ=
|
||||
ENGINES_ASM_OBJ=
|
||||
PERLASM_SCHEME=
|
||||
|
||||
# KRB5 stuff
|
||||
@@ -112,30 +109,6 @@ LIBKRB5=
|
||||
ZLIB_INCLUDE=
|
||||
LIBZLIB=
|
||||
|
||||
# TOP level FIPS install directory.
|
||||
FIPSDIR=
|
||||
|
||||
# This is the location of fipscanister.o and friends.
|
||||
# The FIPS module build will place it $(INSTALLTOP)/lib
|
||||
# but since $(INSTALLTOP) can only take the default value
|
||||
# when the module is built it will be in /usr/local/ssl/lib
|
||||
# $(INSTALLTOP) for this build may be different so hard
|
||||
# code the path.
|
||||
|
||||
FIPSLIBDIR=
|
||||
|
||||
# The location of the library which contains fipscanister.o
|
||||
# normally it will be libcrypto unless fipsdso is set in which
|
||||
# case it will be libfips. If not compiling in FIPS mode at all
|
||||
# this is empty making it a useful test for a FIPS compile.
|
||||
|
||||
FIPSCANLIB=
|
||||
|
||||
# Shared library base address. Currently only used on Windows.
|
||||
#
|
||||
|
||||
BASEADDR=
|
||||
|
||||
DIRS= crypto ssl engines apps test tools
|
||||
ENGDIRS= ccgost
|
||||
SHLIBDIRS= crypto ssl
|
||||
@@ -148,7 +121,7 @@ SDIRS= \
|
||||
bn ec rsa dsa ecdsa dh ecdh dso engine \
|
||||
buffer bio stack lhash rand err \
|
||||
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
|
||||
cms pqueue ts jpake srp store cmac
|
||||
cms pqueue ts jpake store
|
||||
# keep in mind that the above list is adjusted by ./Configure
|
||||
# according to no-xxx arguments...
|
||||
|
||||
@@ -222,8 +195,8 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
|
||||
EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
|
||||
SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
|
||||
PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
|
||||
CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \
|
||||
EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \
|
||||
CPUID_OBJ='$(CPUID_OBJ)' \
|
||||
BN_ASM='$(BN_ASM)' DES_ENC='$(DES_ENC)' \
|
||||
AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
|
||||
BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
|
||||
RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
|
||||
@@ -231,12 +204,7 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
|
||||
MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
|
||||
RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
|
||||
WP_ASM_OBJ='$(WP_ASM_OBJ)' \
|
||||
MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
|
||||
ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)' \
|
||||
PERLASM_SCHEME='$(PERLASM_SCHEME)' \
|
||||
FIPSLIBDIR='${FIPSLIBDIR}' \
|
||||
FIPSDIR='${FIPSDIR}' \
|
||||
FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
|
||||
THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
|
||||
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
|
||||
# which in turn eliminates ambiguities in variable treatment with -e.
|
||||
@@ -290,21 +258,9 @@ all_testapps: build_libs build_testapps
|
||||
build_testapps:
|
||||
@dir=crypto; target=testapps; $(BUILD_ONE_CMD)
|
||||
|
||||
fips_premain_dso$(EXE_EXT): libcrypto.a
|
||||
[ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \
|
||||
-DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ \
|
||||
$(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \
|
||||
libcrypto.a $(EX_LIBS)
|
||||
|
||||
libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT)
|
||||
libcrypto$(SHLIB_EXT): libcrypto.a
|
||||
@if [ "$(SHLIB_TARGET)" != "" ]; then \
|
||||
if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
|
||||
FIPSLD_LIBCRYPTO=libcrypto.a ; \
|
||||
FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \
|
||||
export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
|
||||
fi; \
|
||||
$(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \
|
||||
(touch -c fips_premain_dso$(EXE_EXT) || :); \
|
||||
$(MAKE) SHLIBDIRS=crypto build-shared; \
|
||||
else \
|
||||
echo "There's no support for shared libraries on this platform" >&2; \
|
||||
exit 1; \
|
||||
@@ -327,7 +283,7 @@ clean-shared:
|
||||
done; \
|
||||
fi; \
|
||||
( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
|
||||
if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
|
||||
if [ "$(PLATFORM)" = "Cygwin" ]; then \
|
||||
( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
|
||||
fi; \
|
||||
done
|
||||
@@ -376,11 +332,11 @@ libssl.pc: Makefile
|
||||
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
|
||||
echo 'includedir=$${prefix}/include'; \
|
||||
echo ''; \
|
||||
echo 'Name: OpenSSL-libssl'; \
|
||||
echo 'Name: OpenSSL'; \
|
||||
echo 'Description: Secure Sockets Layer and cryptography libraries'; \
|
||||
echo 'Version: '$(VERSION); \
|
||||
echo 'Requires.private: libcrypto'; \
|
||||
echo 'Libs: -L$${libdir} -lssl'; \
|
||||
echo 'Requires: '; \
|
||||
echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
|
||||
echo 'Libs.private: $(EX_LIBS)'; \
|
||||
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
|
||||
|
||||
@@ -393,7 +349,10 @@ openssl.pc: Makefile
|
||||
echo 'Name: OpenSSL'; \
|
||||
echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
|
||||
echo 'Version: '$(VERSION); \
|
||||
echo 'Requires: libssl libcrypto' ) > openssl.pc
|
||||
echo 'Requires: '; \
|
||||
echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
|
||||
echo 'Libs.private: $(EX_LIBS)'; \
|
||||
echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
|
||||
|
||||
Makefile: Makefile.org Configure config
|
||||
@echo "Makefile is older than Makefile.org, Configure or config."
|
||||
@@ -401,7 +360,7 @@ Makefile: Makefile.org Configure config
|
||||
@false
|
||||
|
||||
libclean:
|
||||
rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
|
||||
rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
|
||||
|
||||
clean: libclean
|
||||
rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
|
||||
@@ -443,7 +402,7 @@ rehash.time: certs apps
|
||||
[ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
|
||||
OPENSSL_DEBUG_MEMORY=on; \
|
||||
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
||||
$(PERL) tools/c_rehash certs/demo) && \
|
||||
$(PERL) tools/c_rehash certs) && \
|
||||
touch rehash.time; \
|
||||
else :; fi
|
||||
|
||||
@@ -457,6 +416,9 @@ tests: rehash
|
||||
report:
|
||||
@$(PERL) util/selftest.pl
|
||||
|
||||
update: errors stacks util/libeay.num util/ssleay.num TABLE
|
||||
@set -e; target=update; $(RECURSIVE_BUILD_CMD)
|
||||
|
||||
depend:
|
||||
@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
|
||||
|
||||
@@ -468,9 +430,9 @@ tags:
|
||||
find . -name '[^.]*.[ch]' | xargs etags -a
|
||||
|
||||
errors:
|
||||
$(PERL) util/ck_errf.pl -strict */*.c */*/*.c
|
||||
$(PERL) util/mkerr.pl -recurse -write
|
||||
(cd engines; $(MAKE) PERL=$(PERL) errors)
|
||||
$(PERL) util/ck_errf.pl */*.c */*/*.c
|
||||
|
||||
stacks:
|
||||
$(PERL) util/mkstack.pl -write
|
||||
@@ -481,26 +443,10 @@ util/libeay.num::
|
||||
util/ssleay.num::
|
||||
$(PERL) util/mkdef.pl ssl update
|
||||
|
||||
crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
|
||||
$(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
|
||||
crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
|
||||
$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
|
||||
crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
|
||||
$(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
|
||||
|
||||
apps/openssl-vms.cnf: apps/openssl.cnf
|
||||
$(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
|
||||
|
||||
crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
|
||||
$(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
|
||||
|
||||
|
||||
TABLE: Configure
|
||||
(echo 'Output of `Configure TABLE'"':"; \
|
||||
$(PERL) Configure TABLE) > TABLE
|
||||
|
||||
update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
|
||||
|
||||
# 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
|
||||
@@ -553,7 +499,7 @@ install_sw:
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
|
||||
done;
|
||||
@set -e; target=install; $(RECURSIVE_BUILD_CMD)
|
||||
@set -e; liblist="$(LIBS)"; for i in $$liblist ;\
|
||||
@set -e; for i in $(LIBS) ;\
|
||||
do \
|
||||
if [ -f "$$i" ]; then \
|
||||
( echo installing $$i; \
|
||||
@@ -569,7 +515,11 @@ install_sw:
|
||||
do \
|
||||
if [ -f "$$i" -o -f "$$i.a" ]; then \
|
||||
( echo installing $$i; \
|
||||
if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
|
||||
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
|
||||
else \
|
||||
c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
|
||||
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||
@@ -577,10 +527,6 @@ install_sw:
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
|
||||
else \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
|
||||
fi ); \
|
||||
if expr $(PLATFORM) : 'mingw' > /dev/null; then \
|
||||
( case $$i in \
|
||||
@@ -613,10 +559,6 @@ install_sw:
|
||||
|
||||
install_html_docs:
|
||||
here="`pwd`"; \
|
||||
filecase=; \
|
||||
case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
|
||||
filecase=-i; \
|
||||
esac; \
|
||||
for subdir in apps crypto ssl; do \
|
||||
mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
|
||||
for i in doc/$$subdir/*.pod; do \
|
||||
@@ -645,9 +587,9 @@ install_docs:
|
||||
@pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
|
||||
here="`pwd`"; \
|
||||
filecase=; \
|
||||
case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
|
||||
if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
|
||||
filecase=-i; \
|
||||
esac; \
|
||||
fi; \
|
||||
set -e; for i in doc/apps/*.pod; do \
|
||||
fn=`basename $$i .pod`; \
|
||||
sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
|
||||
|
||||
156
NEWS
156
NEWS
@@ -5,22 +5,29 @@
|
||||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 1.0.1l and OpenSSL 1.0.2 [22 Jan 2015]:
|
||||
Major changes between OpenSSL 1.0.0r and OpenSSL 1.0.0s [11 Jun 2015]
|
||||
|
||||
o Suite B support for TLS 1.2 and DTLS 1.2
|
||||
o Support for DTLS 1.2
|
||||
o TLS automatic EC curve selection.
|
||||
o API to set TLS supported signature algorithms and curves
|
||||
o SSL_CONF configuration API.
|
||||
o TLS Brainpool support.
|
||||
o ALPN support.
|
||||
o CMS support for RSA-PSS, RSA-OAEP, ECDH and X9.42 DH.
|
||||
o Malformed ECParameters causes infinite loop (CVE-2015-1788)
|
||||
o Exploitable out-of-bounds read in X509_cmp_time (CVE-2015-1789)
|
||||
o PKCS7 crash with missing EnvelopedContent (CVE-2015-1790)
|
||||
o CMS verify infinite loop with unknown hash function (CVE-2015-1792)
|
||||
o Race condition handling NewSessionTicket (CVE-2015-1791)
|
||||
|
||||
Major changes between OpenSSL 1.0.1k and OpenSSL 1.0.1l [15 Jan 2015]
|
||||
Major changes between OpenSSL 1.0.0q and OpenSSL 1.0.0r [19 Mar 2015]
|
||||
|
||||
o Segmentation fault in ASN1_TYPE_cmp fix (CVE-2015-0286)
|
||||
o ASN.1 structure reuse memory corruption fix (CVE-2015-0287)
|
||||
o PKCS7 NULL pointer dereferences fix (CVE-2015-0289)
|
||||
o DoS via reachable assert in SSLv2 servers fix (CVE-2015-0293)
|
||||
o Use After Free following d2i_ECPrivatekey error fix (CVE-2015-0209)
|
||||
o X509_to_X509_REQ NULL pointer deref fix (CVE-2015-0288)
|
||||
o Removed the export ciphers from the DEFAULT ciphers
|
||||
|
||||
Major changes between OpenSSL 1.0.0p and OpenSSL 1.0.0q [15 Jan 2015]
|
||||
|
||||
o Build fixes for the Windows and OpenVMS platforms
|
||||
|
||||
Major changes between OpenSSL 1.0.1j and OpenSSL 1.0.1k [8 Jan 2015]
|
||||
Major changes between OpenSSL 1.0.0o and OpenSSL 1.0.0p [8 Jan 2015]
|
||||
|
||||
o Fix for CVE-2014-3571
|
||||
o Fix for CVE-2015-0206
|
||||
@@ -31,88 +38,43 @@
|
||||
o Fix for CVE-2014-8275
|
||||
o Fix for CVE-2014-3570
|
||||
|
||||
Major changes between OpenSSL 1.0.1i and OpenSSL 1.0.1j [15 Oct 2014]
|
||||
Major changes between OpenSSL 1.0.0n and OpenSSL 1.0.0o [15 Oct 2014]
|
||||
|
||||
o Fix for CVE-2014-3513
|
||||
o Fix for CVE-2014-3567
|
||||
o Mitigation for CVE-2014-3566 (SSL protocol vulnerability)
|
||||
o Fix for CVE-2014-3568
|
||||
|
||||
Major changes between OpenSSL 1.0.1h and OpenSSL 1.0.1i [6 Aug 2014]
|
||||
Major changes between OpenSSL 1.0.0m and OpenSSL 1.0.0n [6 Aug 2014]
|
||||
|
||||
o Fix for CVE-2014-3512
|
||||
o Fix for CVE-2014-3511
|
||||
o Fix for CVE-2014-3510
|
||||
o Fix for CVE-2014-3507
|
||||
o Fix for CVE-2014-3506
|
||||
o Fix for CVE-2014-3505
|
||||
o Fix for CVE-2014-3509
|
||||
o Fix for CVE-2014-5139
|
||||
o Fix for CVE-2014-3508
|
||||
|
||||
Major changes between OpenSSL 1.0.1g and OpenSSL 1.0.1h [5 Jun 2014]
|
||||
Known issues in OpenSSL 1.0.0m:
|
||||
|
||||
o EAP-FAST and other applications using tls_session_secret_cb
|
||||
wont resume sessions. Fixed in 1.0.0n-dev
|
||||
o Compilation failure of s3_pkt.c on some platforms due to missing
|
||||
<limits.h> include. Fixed in 1.0.0n-dev
|
||||
|
||||
Major changes between OpenSSL 1.0.0l and OpenSSL 1.0.0m [5 Jun 2014]
|
||||
|
||||
o Fix for CVE-2014-0224
|
||||
o Fix for CVE-2014-0221
|
||||
o Fix for CVE-2014-0198
|
||||
o Fix for CVE-2014-0195
|
||||
o Fix for CVE-2014-3470
|
||||
o Fix for CVE-2014-0076
|
||||
o Fix for CVE-2010-5298
|
||||
|
||||
Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014]
|
||||
Major changes between OpenSSL 1.0.0k and OpenSSL 1.0.0l [6 Jan 2014]
|
||||
|
||||
o Fix for CVE-2014-0160
|
||||
o Add TLS padding extension workaround for broken servers.
|
||||
o Fix for CVE-2014-0076
|
||||
|
||||
Major changes between OpenSSL 1.0.1e and OpenSSL 1.0.1f [6 Jan 2014]
|
||||
|
||||
o Don't include gmt_unix_time in TLS server and client random values
|
||||
o Fix for TLS record tampering bug CVE-2013-4353
|
||||
o Fix for TLS version checking bug CVE-2013-6449
|
||||
o Fix for DTLS retransmission bug CVE-2013-6450
|
||||
|
||||
Major changes between OpenSSL 1.0.1d and OpenSSL 1.0.1e [11 Feb 2013]:
|
||||
|
||||
o Corrected fix for CVE-2013-0169
|
||||
|
||||
Major changes between OpenSSL 1.0.1c and OpenSSL 1.0.1d [4 Feb 2013]:
|
||||
|
||||
o Fix renegotiation in TLS 1.1, 1.2 by using the correct TLS version.
|
||||
o Include the fips configuration module.
|
||||
o Fix OCSP bad key DoS attack CVE-2013-0166
|
||||
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
|
||||
o Fix for TLS AESNI record handling flaw CVE-2012-2686
|
||||
|
||||
Major changes between OpenSSL 1.0.1b and OpenSSL 1.0.1c [10 May 2012]:
|
||||
|
||||
o Fix TLS/DTLS record length checking bug CVE-2012-2333
|
||||
o Don't attempt to use non-FIPS composite ciphers in FIPS mode.
|
||||
|
||||
Major changes between OpenSSL 1.0.1a and OpenSSL 1.0.1b [26 Apr 2012]:
|
||||
|
||||
o Fix compilation error on non-x86 platforms.
|
||||
o Make FIPS capable OpenSSL ciphers work in non-FIPS mode.
|
||||
o Fix SSL_OP_NO_TLSv1_1 clash with SSL_OP_ALL in OpenSSL 1.0.0
|
||||
|
||||
Major changes between OpenSSL 1.0.1 and OpenSSL 1.0.1a [19 Apr 2012]:
|
||||
|
||||
o Fix for ASN1 overflow bug CVE-2012-2110
|
||||
o Workarounds for some servers that hang on long client hellos.
|
||||
o Fix SEGV in AES code.
|
||||
|
||||
Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1 [14 Mar 2012]:
|
||||
|
||||
o TLS/DTLS heartbeat support.
|
||||
o SCTP support.
|
||||
o RFC 5705 TLS key material exporter.
|
||||
o RFC 5764 DTLS-SRTP negotiation.
|
||||
o Next Protocol Negotiation.
|
||||
o PSS signatures in certificates, requests and CRLs.
|
||||
o Support for password based recipient info for CMS.
|
||||
o Support TLS v1.2 and TLS v1.1.
|
||||
o Preliminary FIPS capability for unvalidated 2.0 FIPS module.
|
||||
o SRP support.
|
||||
|
||||
Major changes between OpenSSL 1.0.0j and OpenSSL 1.0.0k [5 Feb 2013]:
|
||||
|
||||
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
|
||||
@@ -198,62 +160,6 @@
|
||||
o Opaque PRF Input TLS extension support.
|
||||
o Updated time routines to avoid OS limitations.
|
||||
|
||||
Major changes between OpenSSL 0.9.8x and OpenSSL 0.9.8y [5 Feb 2013]:
|
||||
|
||||
o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
|
||||
o Fix OCSP bad key DoS attack CVE-2013-0166
|
||||
|
||||
Major changes between OpenSSL 0.9.8w and OpenSSL 0.9.8x [10 May 2012]:
|
||||
|
||||
o Fix DTLS record length checking bug CVE-2012-2333
|
||||
|
||||
Major changes between OpenSSL 0.9.8v and OpenSSL 0.9.8w [23 Apr 2012]:
|
||||
|
||||
o Fix for CVE-2012-2131 (corrected fix for 0.9.8 and CVE-2012-2110)
|
||||
|
||||
Major changes between OpenSSL 0.9.8u and OpenSSL 0.9.8v [19 Apr 2012]:
|
||||
|
||||
o Fix for ASN1 overflow bug CVE-2012-2110
|
||||
|
||||
Major changes between OpenSSL 0.9.8t and OpenSSL 0.9.8u [12 Mar 2012]:
|
||||
|
||||
o Fix for CMS/PKCS#7 MMA CVE-2012-0884
|
||||
o Corrected fix for CVE-2011-4619
|
||||
o Various DTLS fixes.
|
||||
|
||||
Major changes between OpenSSL 0.9.8s and OpenSSL 0.9.8t [18 Jan 2012]:
|
||||
|
||||
o Fix for DTLS DoS issue CVE-2012-0050
|
||||
|
||||
Major changes between OpenSSL 0.9.8r and OpenSSL 0.9.8s [4 Jan 2012]:
|
||||
|
||||
o Fix for DTLS plaintext recovery attack CVE-2011-4108
|
||||
o Fix policy check double free error CVE-2011-4109
|
||||
o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
|
||||
o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
|
||||
o Check for malformed RFC3779 data CVE-2011-4577
|
||||
|
||||
Major changes between OpenSSL 0.9.8q and OpenSSL 0.9.8r [8 Feb 2011]:
|
||||
|
||||
o Fix for security issue CVE-2011-0014
|
||||
|
||||
Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q [2 Dec 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-4180
|
||||
o Fix for CVE-2010-4252
|
||||
|
||||
Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p [16 Nov 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-3864.
|
||||
|
||||
Major changes between OpenSSL 0.9.8n and OpenSSL 0.9.8o [1 Jun 2010]:
|
||||
|
||||
o Fix for security issue CVE-2010-0742.
|
||||
o Various DTLS fixes.
|
||||
o Recognise SHA2 certificates if only SSL algorithms added.
|
||||
o Fix for no-rc4 compilation.
|
||||
o Chil ENGINE unload workaround.
|
||||
|
||||
Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
|
||||
|
||||
o CFB cipher definition fixes.
|
||||
|
||||
40
README
40
README
@@ -1,5 +1,5 @@
|
||||
|
||||
OpenSSL 1.0.2 22 Jan 2015
|
||||
OpenSSL 1.0.0s 11 Jun 2015
|
||||
|
||||
Copyright (c) 1998-2011 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
@@ -90,6 +90,32 @@
|
||||
SSL/TLS Client and Server Tests
|
||||
Handling of S/MIME signed or encrypted mail
|
||||
|
||||
|
||||
PATENTS
|
||||
-------
|
||||
|
||||
Various companies hold various patents for various algorithms in various
|
||||
locations around the world. _YOU_ are responsible for ensuring that your use
|
||||
of any algorithms is legal by checking if there are any patents in your
|
||||
country. The file contains some of the patents that we know about or are
|
||||
rumored to exist. This is not a definitive list.
|
||||
|
||||
RSA Security holds software patents on the RC5 algorithm. If you
|
||||
intend to use this cipher, you must contact RSA Security for
|
||||
licensing conditions. Their web page is http://www.rsasecurity.com/.
|
||||
|
||||
RC4 is a trademark of RSA Security, so use of this label should perhaps
|
||||
only be used with RSA Security's permission.
|
||||
|
||||
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
|
||||
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They
|
||||
should be contacted if that algorithm is to be used; their web page is
|
||||
http://www.ascom.ch/.
|
||||
|
||||
NTT and Mitsubishi have patents and pending patents on the Camellia
|
||||
algorithm, but allow use at no charge without requiring an explicit
|
||||
licensing agreement: http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
@@ -135,7 +161,8 @@
|
||||
- Problem Description (steps that will reproduce the problem, if known)
|
||||
- Stack Traceback (if the application dumps core)
|
||||
|
||||
Email the report to:
|
||||
Report the bug to the OpenSSL project via the Request Tracker
|
||||
(http://www.openssl.org/support/rt.html) by mail to:
|
||||
|
||||
openssl-bugs@openssl.org
|
||||
|
||||
@@ -143,11 +170,10 @@
|
||||
or support queries. Just because something doesn't work the way you expect
|
||||
does not mean it is necessarily a bug in OpenSSL.
|
||||
|
||||
Note that mail to openssl-bugs@openssl.org is recorded in the public
|
||||
request tracker database (see https://www.openssl.org/support/rt.html
|
||||
for details) and also forwarded to a public mailing list. Confidential
|
||||
mail may be sent to openssl-security@openssl.org (PGP key available from
|
||||
the key servers).
|
||||
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
|
||||
(PGP key available from the key servers).
|
||||
|
||||
HOW TO CONTRIBUTE TO OpenSSL
|
||||
----------------------------
|
||||
|
||||
182
apps/Makefile
182
apps/Makefile
@@ -39,7 +39,7 @@ E_EXE= verify asn1pars req dgst dh dhparam enc passwd gendh errstr \
|
||||
ca crl rsa rsautl dsa dsaparam ec ecparam \
|
||||
x509 genrsa gendsa genpkey s_server s_client speed \
|
||||
s_time version pkcs7 cms crl2pkcs7 sess_id ciphers nseq pkcs12 \
|
||||
pkcs8 pkey pkeyparam pkeyutl spkac smime rand engine ocsp prime ts srp
|
||||
pkcs8 pkey pkeyparam pkeyutl spkac smime rand engine ocsp prime ts
|
||||
|
||||
PROGS= $(PROGRAM).c
|
||||
|
||||
@@ -56,7 +56,7 @@ E_OBJ= verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o er
|
||||
x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o \
|
||||
s_time.o $(A_OBJ) $(S_OBJ) $(RAND_OBJ) version.o sess_id.o \
|
||||
ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o \
|
||||
spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o
|
||||
spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o
|
||||
|
||||
E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.c \
|
||||
pkcs7.c crl2p7.c crl.c \
|
||||
@@ -64,7 +64,7 @@ E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.
|
||||
x509.c genrsa.c gendsa.c genpkey.c s_server.c s_client.c speed.c \
|
||||
s_time.c $(A_SRC) $(S_SRC) $(RAND_SRC) version.c sess_id.c \
|
||||
ciphers.c nseq.c pkcs12.c pkcs8.c pkey.c pkeyparam.c pkeyutl.c \
|
||||
spkac.c smime.c cms.c rand.c engine.c ocsp.c prime.c ts.c srp.c
|
||||
spkac.c smime.c cms.c rand.c engine.c ocsp.c prime.c ts.c
|
||||
|
||||
SRC=$(E_SRC)
|
||||
|
||||
@@ -94,6 +94,9 @@ req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
|
||||
sreq.o: req.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
|
||||
|
||||
openssl-vms.cnf: openssl.cnf
|
||||
$(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
@@ -127,12 +130,12 @@ links:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
depend:
|
||||
@if [ -z "$(THIS)" ]; then \
|
||||
$(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
|
||||
else \
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
|
||||
fi
|
||||
update: openssl-vms.cnf local_depend
|
||||
|
||||
depend: local_depend
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
local_depend:
|
||||
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
|
||||
|
||||
dclean:
|
||||
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
|
||||
@@ -153,8 +156,6 @@ $(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||
$(RM) $(EXE)
|
||||
shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
|
||||
shlib_target="$(SHLIB_TARGET)"; \
|
||||
elif [ -n "$(FIPSCANLIB)" ]; then \
|
||||
FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; export CC FIPSLD_CC; \
|
||||
fi; \
|
||||
LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \
|
||||
$(MAKE) -f $(TOP)/Makefile.shared -e \
|
||||
@@ -247,13 +248,13 @@ ciphers.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||
ciphers.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
||||
ciphers.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
ciphers.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
ciphers.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
ciphers.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
ciphers.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
ciphers.o: ../include/openssl/x509v3.h apps.h ciphers.c
|
||||
ciphers.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
ciphers.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
ciphers.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
ciphers.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
ciphers.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
ciphers.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
ciphers.o: ciphers.c
|
||||
cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
cms.o: ../include/openssl/buffer.h ../include/openssl/cms.h
|
||||
cms.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
@@ -429,13 +430,13 @@ engine.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||
engine.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
||||
engine.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
engine.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
engine.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
engine.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
engine.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
engine.o: ../include/openssl/x509v3.h apps.h engine.c
|
||||
engine.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
engine.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
engine.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
engine.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
engine.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
engine.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
engine.o: engine.c
|
||||
errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
errstr.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||
errstr.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
@@ -450,13 +451,13 @@ errstr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||
errstr.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
||||
errstr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
errstr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
errstr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
errstr.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
errstr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
errstr.o: ../include/openssl/x509v3.h apps.h errstr.c
|
||||
errstr.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
errstr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
errstr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
errstr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
errstr.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
errstr.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
errstr.o: errstr.c
|
||||
gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||
gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
@@ -558,12 +559,12 @@ ocsp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
ocsp.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
||||
ocsp.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
||||
ocsp.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
ocsp.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
||||
ocsp.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
ocsp.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
ocsp.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
ocsp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
ocsp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ocsp.c
|
||||
ocsp.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
ocsp.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
ocsp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
ocsp.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
ocsp.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
ocsp.o: ../include/openssl/x509v3.h apps.h ocsp.c
|
||||
openssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
openssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||
openssl.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
@@ -577,9 +578,8 @@ openssl.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
|
||||
openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
openssl.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
|
||||
openssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
openssl.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
||||
openssl.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||
openssl.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
@@ -794,13 +794,12 @@ s_cb.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
s_cb.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
s_cb.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
|
||||
s_cb.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
s_cb.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
||||
s_cb.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
s_cb.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
s_cb.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
s_cb.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
s_cb.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
s_cb.o: s_apps.h s_cb.c
|
||||
s_cb.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_cb.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_cb.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
s_cb.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
s_cb.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
s_cb.o: ../include/openssl/x509v3.h apps.h s_apps.h s_cb.c
|
||||
s_client.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
s_client.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||
s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h
|
||||
@@ -816,8 +815,7 @@ s_client.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
s_client.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
||||
s_client.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
||||
s_client.o: ../include/openssl/rand.h ../include/openssl/safestack.h
|
||||
s_client.o: ../include/openssl/sha.h ../include/openssl/srp.h
|
||||
s_client.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
|
||||
s_client.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
s_client.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
s_client.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
s_client.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
@@ -841,7 +839,6 @@ s_server.o: ../include/openssl/pem.h ../include/openssl/pem2.h
|
||||
s_server.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
|
||||
s_server.o: ../include/openssl/rand.h ../include/openssl/rsa.h
|
||||
s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h
|
||||
s_server.o: ../include/openssl/srp.h ../include/openssl/srtp.h
|
||||
s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
@@ -863,13 +860,13 @@ s_socket.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
s_socket.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
s_socket.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
s_socket.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||
s_socket.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
||||
s_socket.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_socket.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_socket.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
s_socket.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
s_socket.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
s_socket.o: ../include/openssl/x509v3.h apps.h s_apps.h s_socket.c
|
||||
s_socket.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
s_socket.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
s_socket.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
s_socket.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
s_socket.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
s_socket.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
s_socket.o: s_apps.h s_socket.c
|
||||
s_time.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
s_time.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||
s_time.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
@@ -884,13 +881,13 @@ s_time.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
s_time.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
s_time.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
s_time.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||
s_time.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
||||
s_time.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
s_time.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
s_time.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
s_time.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
s_time.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
s_time.o: ../include/openssl/x509v3.h apps.h s_apps.h s_time.c
|
||||
s_time.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
s_time.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
s_time.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
s_time.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
s_time.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
s_time.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
s_time.o: s_apps.h s_time.c
|
||||
sess_id.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
sess_id.o: ../include/openssl/buffer.h ../include/openssl/comp.h
|
||||
sess_id.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
@@ -905,13 +902,13 @@ sess_id.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
sess_id.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
|
||||
sess_id.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
|
||||
sess_id.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h
|
||||
sess_id.o: ../include/openssl/sha.h ../include/openssl/srtp.h
|
||||
sess_id.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
|
||||
sess_id.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
|
||||
sess_id.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
sess_id.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
|
||||
sess_id.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
sess_id.o: ../include/openssl/x509v3.h apps.h sess_id.c
|
||||
sess_id.o: ../include/openssl/sha.h ../include/openssl/ssl.h
|
||||
sess_id.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
|
||||
sess_id.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
|
||||
sess_id.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
|
||||
sess_id.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
sess_id.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
sess_id.o: sess_id.c
|
||||
smime.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
smime.o: ../include/openssl/buffer.h ../include/openssl/conf.h
|
||||
smime.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
@@ -941,19 +938,19 @@ speed.o: ../include/openssl/err.h ../include/openssl/evp.h
|
||||
speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
|
||||
speed.o: ../include/openssl/lhash.h ../include/openssl/md4.h
|
||||
speed.o: ../include/openssl/md5.h ../include/openssl/mdc2.h
|
||||
speed.o: ../include/openssl/modes.h ../include/openssl/obj_mac.h
|
||||
speed.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
|
||||
speed.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
speed.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
|
||||
speed.o: ../include/openssl/rand.h ../include/openssl/rc2.h
|
||||
speed.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h
|
||||
speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
|
||||
speed.o: ../include/openssl/seed.h ../include/openssl/sha.h
|
||||
speed.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
speed.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
|
||||
speed.o: ../include/openssl/ui_compat.h ../include/openssl/whrlpool.h
|
||||
speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
|
||||
speed.o: ../include/openssl/x509v3.h apps.h speed.c testdsa.h testrsa.h
|
||||
speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
|
||||
speed.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h
|
||||
speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
speed.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
|
||||
speed.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
|
||||
speed.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
|
||||
speed.o: ../include/openssl/safestack.h ../include/openssl/seed.h
|
||||
speed.o: ../include/openssl/sha.h ../include/openssl/stack.h
|
||||
speed.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
|
||||
speed.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
|
||||
speed.o: ../include/openssl/whrlpool.h ../include/openssl/x509.h
|
||||
speed.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
speed.o: speed.c testdsa.h testrsa.h
|
||||
spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h
|
||||
spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
@@ -970,21 +967,6 @@ spkac.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
spkac.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
spkac.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
|
||||
spkac.o: spkac.c
|
||||
srp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
srp.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||
srp.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
srp.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
|
||||
srp.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
|
||||
srp.o: ../include/openssl/engine.h ../include/openssl/err.h
|
||||
srp.o: ../include/openssl/evp.h ../include/openssl/lhash.h
|
||||
srp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
|
||||
srp.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h
|
||||
srp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
srp.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
|
||||
srp.o: ../include/openssl/sha.h ../include/openssl/srp.h
|
||||
srp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
|
||||
srp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
|
||||
srp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h srp.c
|
||||
ts.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
|
||||
ts.o: ../include/openssl/bn.h ../include/openssl/buffer.h
|
||||
ts.o: ../include/openssl/conf.h ../include/openssl/crypto.h
|
||||
|
||||
310
apps/apps.c
310
apps/apps.c
@@ -119,7 +119,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB)
|
||||
#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(NETWARE_CLIB)
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
@@ -285,8 +285,6 @@ int str2fmt(char *s)
|
||||
return (FORMAT_PKCS12);
|
||||
else if ((*s == 'E') || (*s == 'e'))
|
||||
return (FORMAT_ENGINE);
|
||||
else if ((*s == 'H') || (*s == 'h'))
|
||||
return FORMAT_HTTP;
|
||||
else if ((*s == 'P') || (*s == 'p')) {
|
||||
if (s[1] == 'V' || s[1] == 'v')
|
||||
return FORMAT_PVK;
|
||||
@@ -778,72 +776,12 @@ static int load_pkcs12(BIO *err, BIO *in, const char *desc,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int load_cert_crl_http(const char *url, BIO *err,
|
||||
X509 **pcert, X509_CRL **pcrl)
|
||||
{
|
||||
char *host = NULL, *port = NULL, *path = NULL;
|
||||
BIO *bio = NULL;
|
||||
OCSP_REQ_CTX *rctx = NULL;
|
||||
int use_ssl, rv = 0;
|
||||
if (!OCSP_parse_url(url, &host, &port, &path, &use_ssl))
|
||||
goto err;
|
||||
if (use_ssl) {
|
||||
if (err)
|
||||
BIO_puts(err, "https not supported\n");
|
||||
goto err;
|
||||
}
|
||||
bio = BIO_new_connect(host);
|
||||
if (!bio || !BIO_set_conn_port(bio, port))
|
||||
goto err;
|
||||
rctx = OCSP_REQ_CTX_new(bio, 1024);
|
||||
if (!rctx)
|
||||
goto err;
|
||||
if (!OCSP_REQ_CTX_http(rctx, "GET", path))
|
||||
goto err;
|
||||
if (!OCSP_REQ_CTX_add1_header(rctx, "Host", host))
|
||||
goto err;
|
||||
if (pcert) {
|
||||
do {
|
||||
rv = X509_http_nbio(rctx, pcert);
|
||||
}
|
||||
while (rv == -1);
|
||||
} else {
|
||||
do {
|
||||
rv = X509_CRL_http_nbio(rctx, pcrl);
|
||||
} while (rv == -1);
|
||||
}
|
||||
|
||||
err:
|
||||
if (host)
|
||||
OPENSSL_free(host);
|
||||
if (path)
|
||||
OPENSSL_free(path);
|
||||
if (port)
|
||||
OPENSSL_free(port);
|
||||
if (bio)
|
||||
BIO_free_all(bio);
|
||||
if (rctx)
|
||||
OCSP_REQ_CTX_free(rctx);
|
||||
if (rv != 1) {
|
||||
if (bio && err)
|
||||
BIO_printf(bio_err, "Error loading %s from %s\n",
|
||||
pcert ? "certificate" : "CRL", url);
|
||||
ERR_print_errors(bio_err);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
X509 *load_cert(BIO *err, const char *file, int format,
|
||||
const char *pass, ENGINE *e, const char *cert_descrip)
|
||||
{
|
||||
X509 *x = NULL;
|
||||
BIO *cert;
|
||||
|
||||
if (format == FORMAT_HTTP) {
|
||||
load_cert_crl_http(file, err, &x, NULL);
|
||||
return x;
|
||||
}
|
||||
|
||||
if ((cert = BIO_new(BIO_s_file())) == NULL) {
|
||||
ERR_print_errors(err);
|
||||
goto end;
|
||||
@@ -901,49 +839,6 @@ X509 *load_cert(BIO *err, const char *file, int format,
|
||||
return (x);
|
||||
}
|
||||
|
||||
X509_CRL *load_crl(const char *infile, int format)
|
||||
{
|
||||
X509_CRL *x = NULL;
|
||||
BIO *in = NULL;
|
||||
|
||||
if (format == FORMAT_HTTP) {
|
||||
load_cert_crl_http(infile, bio_err, NULL, &x);
|
||||
return x;
|
||||
}
|
||||
|
||||
in = BIO_new(BIO_s_file());
|
||||
if (in == NULL) {
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (infile == NULL)
|
||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
||||
else {
|
||||
if (BIO_read_filename(in, infile) <= 0) {
|
||||
perror(infile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
if (format == FORMAT_ASN1)
|
||||
x = d2i_X509_CRL_bio(in, NULL);
|
||||
else if (format == FORMAT_PEM)
|
||||
x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
|
||||
else {
|
||||
BIO_printf(bio_err, "bad input format specified for input crl\n");
|
||||
goto end;
|
||||
}
|
||||
if (x == NULL) {
|
||||
BIO_printf(bio_err, "unable to load CRL\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
BIO_free(in);
|
||||
return (x);
|
||||
}
|
||||
|
||||
EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
|
||||
const char *pass, ENGINE *e, const char *key_descrip)
|
||||
{
|
||||
@@ -2252,10 +2147,6 @@ int args_verify(char ***pargs, int *pargc,
|
||||
int purpose = 0, depth = -1;
|
||||
char **oldargs = *pargs;
|
||||
char *arg = **pargs, *argn = (*pargs)[1];
|
||||
time_t at_time = 0;
|
||||
char *hostname = NULL;
|
||||
char *email = NULL;
|
||||
char *ipasc = NULL;
|
||||
if (!strcmp(arg, "-policy")) {
|
||||
if (!argn)
|
||||
*badarg = 1;
|
||||
@@ -2293,37 +2184,6 @@ int args_verify(char ***pargs, int *pargc,
|
||||
}
|
||||
}
|
||||
(*pargs)++;
|
||||
} else if (strcmp(arg, "-attime") == 0) {
|
||||
if (!argn)
|
||||
*badarg = 1;
|
||||
else {
|
||||
long timestamp;
|
||||
/*
|
||||
* interpret the -attime argument as seconds since Epoch
|
||||
*/
|
||||
if (sscanf(argn, "%li", ×tamp) != 1) {
|
||||
BIO_printf(bio_err, "Error parsing timestamp %s\n", argn);
|
||||
*badarg = 1;
|
||||
}
|
||||
/* on some platforms time_t may be a float */
|
||||
at_time = (time_t)timestamp;
|
||||
}
|
||||
(*pargs)++;
|
||||
} else if (strcmp(arg, "-verify_hostname") == 0) {
|
||||
if (!argn)
|
||||
*badarg = 1;
|
||||
hostname = argn;
|
||||
(*pargs)++;
|
||||
} else if (strcmp(arg, "-verify_email") == 0) {
|
||||
if (!argn)
|
||||
*badarg = 1;
|
||||
email = argn;
|
||||
(*pargs)++;
|
||||
} else if (strcmp(arg, "-verify_ip") == 0) {
|
||||
if (!argn)
|
||||
*badarg = 1;
|
||||
ipasc = argn;
|
||||
(*pargs)++;
|
||||
} else if (!strcmp(arg, "-ignore_critical"))
|
||||
flags |= X509_V_FLAG_IGNORE_CRITICAL;
|
||||
else if (!strcmp(arg, "-issuer_checks"))
|
||||
@@ -2350,16 +2210,6 @@ int args_verify(char ***pargs, int *pargc,
|
||||
flags |= X509_V_FLAG_NOTIFY_POLICY;
|
||||
else if (!strcmp(arg, "-check_ss_sig"))
|
||||
flags |= X509_V_FLAG_CHECK_SS_SIGNATURE;
|
||||
else if (!strcmp(arg, "-trusted_first"))
|
||||
flags |= X509_V_FLAG_TRUSTED_FIRST;
|
||||
else if (!strcmp(arg, "-suiteB_128_only"))
|
||||
flags |= X509_V_FLAG_SUITEB_128_LOS_ONLY;
|
||||
else if (!strcmp(arg, "-suiteB_128"))
|
||||
flags |= X509_V_FLAG_SUITEB_128_LOS;
|
||||
else if (!strcmp(arg, "-suiteB_192"))
|
||||
flags |= X509_V_FLAG_SUITEB_192_LOS;
|
||||
else if (!strcmp(arg, "-partial_chain"))
|
||||
flags |= X509_V_FLAG_PARTIAL_CHAIN;
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -2386,18 +2236,6 @@ int args_verify(char ***pargs, int *pargc,
|
||||
if (depth >= 0)
|
||||
X509_VERIFY_PARAM_set_depth(*pm, depth);
|
||||
|
||||
if (at_time)
|
||||
X509_VERIFY_PARAM_set_time(*pm, at_time);
|
||||
|
||||
if (hostname && !X509_VERIFY_PARAM_set1_host(*pm, hostname, 0))
|
||||
*badarg = 1;
|
||||
|
||||
if (email && !X509_VERIFY_PARAM_set1_email(*pm, email, 0))
|
||||
*badarg = 1;
|
||||
|
||||
if (ipasc && !X509_VERIFY_PARAM_set1_ip_asc(*pm, ipasc))
|
||||
*badarg = 1;
|
||||
|
||||
end:
|
||||
|
||||
(*pargs)++;
|
||||
@@ -2681,9 +2519,6 @@ void jpake_client_auth(BIO *out, BIO *conn, const char *secret)
|
||||
|
||||
BIO_puts(out, "JPAKE authentication succeeded, setting PSK\n");
|
||||
|
||||
if (psk_key)
|
||||
OPENSSL_free(psk_key);
|
||||
|
||||
psk_key = BN_bn2hex(JPAKE_get_shared_key(ctx));
|
||||
|
||||
BIO_pop(bconn);
|
||||
@@ -2713,9 +2548,6 @@ void jpake_server_auth(BIO *out, BIO *conn, const char *secret)
|
||||
|
||||
BIO_puts(out, "JPAKE authentication succeeded, setting PSK\n");
|
||||
|
||||
if (psk_key)
|
||||
OPENSSL_free(psk_key);
|
||||
|
||||
psk_key = BN_bn2hex(JPAKE_get_shared_key(ctx));
|
||||
|
||||
BIO_pop(bconn);
|
||||
@@ -2726,146 +2558,6 @@ void jpake_server_auth(BIO *out, BIO *conn, const char *secret)
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
/*-
|
||||
* next_protos_parse parses a comma separated list of strings into a string
|
||||
* in a format suitable for passing to SSL_CTX_set_next_protos_advertised.
|
||||
* outlen: (output) set to the length of the resulting buffer on success.
|
||||
* err: (maybe NULL) on failure, an error message line is written to this BIO.
|
||||
* in: a NUL termianted string like "abc,def,ghi"
|
||||
*
|
||||
* returns: a malloced buffer or NULL on failure.
|
||||
*/
|
||||
unsigned char *next_protos_parse(unsigned short *outlen, const char *in)
|
||||
{
|
||||
size_t len;
|
||||
unsigned char *out;
|
||||
size_t i, start = 0;
|
||||
|
||||
len = strlen(in);
|
||||
if (len >= 65535)
|
||||
return NULL;
|
||||
|
||||
out = OPENSSL_malloc(strlen(in) + 1);
|
||||
if (!out)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i <= len; ++i) {
|
||||
if (i == len || in[i] == ',') {
|
||||
if (i - start > 255) {
|
||||
OPENSSL_free(out);
|
||||
return NULL;
|
||||
}
|
||||
out[start] = i - start;
|
||||
start = i + 1;
|
||||
} else
|
||||
out[i + 1] = in[i];
|
||||
}
|
||||
|
||||
*outlen = len + 1;
|
||||
return out;
|
||||
}
|
||||
#endif /* ndef OPENSSL_NO_TLSEXT */
|
||||
|
||||
void print_cert_checks(BIO *bio, X509 *x,
|
||||
const char *checkhost,
|
||||
const char *checkemail, const char *checkip)
|
||||
{
|
||||
if (x == NULL)
|
||||
return;
|
||||
if (checkhost) {
|
||||
BIO_printf(bio, "Hostname %s does%s match certificate\n",
|
||||
checkhost, X509_check_host(x, checkhost, 0, 0, NULL)
|
||||
? "" : " NOT");
|
||||
}
|
||||
|
||||
if (checkemail) {
|
||||
BIO_printf(bio, "Email %s does%s match certificate\n",
|
||||
checkemail, X509_check_email(x, checkemail, 0,
|
||||
0) ? "" : " NOT");
|
||||
}
|
||||
|
||||
if (checkip) {
|
||||
BIO_printf(bio, "IP %s does%s match certificate\n",
|
||||
checkip, X509_check_ip_asc(x, checkip, 0) ? "" : " NOT");
|
||||
}
|
||||
}
|
||||
|
||||
/* Get first http URL from a DIST_POINT structure */
|
||||
|
||||
static const char *get_dp_url(DIST_POINT *dp)
|
||||
{
|
||||
GENERAL_NAMES *gens;
|
||||
GENERAL_NAME *gen;
|
||||
int i, gtype;
|
||||
ASN1_STRING *uri;
|
||||
if (!dp->distpoint || dp->distpoint->type != 0)
|
||||
return NULL;
|
||||
gens = dp->distpoint->name.fullname;
|
||||
for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
|
||||
gen = sk_GENERAL_NAME_value(gens, i);
|
||||
uri = GENERAL_NAME_get0_value(gen, >ype);
|
||||
if (gtype == GEN_URI && ASN1_STRING_length(uri) > 6) {
|
||||
char *uptr = (char *)ASN1_STRING_data(uri);
|
||||
if (!strncmp(uptr, "http://", 7))
|
||||
return uptr;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Look through a CRLDP structure and attempt to find an http URL to
|
||||
* downloads a CRL from.
|
||||
*/
|
||||
|
||||
static X509_CRL *load_crl_crldp(STACK_OF(DIST_POINT) *crldp)
|
||||
{
|
||||
int i;
|
||||
const char *urlptr = NULL;
|
||||
for (i = 0; i < sk_DIST_POINT_num(crldp); i++) {
|
||||
DIST_POINT *dp = sk_DIST_POINT_value(crldp, i);
|
||||
urlptr = get_dp_url(dp);
|
||||
if (urlptr)
|
||||
return load_crl(urlptr, FORMAT_HTTP);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Example of downloading CRLs from CRLDP: not usable for real world as it
|
||||
* always downloads, doesn't support non-blocking I/O and doesn't cache
|
||||
* anything.
|
||||
*/
|
||||
|
||||
static STACK_OF(X509_CRL) *crls_http_cb(X509_STORE_CTX *ctx, X509_NAME *nm)
|
||||
{
|
||||
X509 *x;
|
||||
STACK_OF(X509_CRL) *crls = NULL;
|
||||
X509_CRL *crl;
|
||||
STACK_OF(DIST_POINT) *crldp;
|
||||
x = X509_STORE_CTX_get_current_cert(ctx);
|
||||
crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL);
|
||||
crl = load_crl_crldp(crldp);
|
||||
sk_DIST_POINT_pop_free(crldp, DIST_POINT_free);
|
||||
if (!crl)
|
||||
return NULL;
|
||||
crls = sk_X509_CRL_new_null();
|
||||
sk_X509_CRL_push(crls, crl);
|
||||
/* Try to download delta CRL */
|
||||
crldp = X509_get_ext_d2i(x, NID_freshest_crl, NULL, NULL);
|
||||
crl = load_crl_crldp(crldp);
|
||||
sk_DIST_POINT_pop_free(crldp, DIST_POINT_free);
|
||||
if (crl)
|
||||
sk_X509_CRL_push(crls, crl);
|
||||
return crls;
|
||||
}
|
||||
|
||||
void store_setup_crl_download(X509_STORE *st)
|
||||
{
|
||||
X509_STORE_set_lookup_crls_cb(st, crls_http_cb);
|
||||
}
|
||||
|
||||
/*
|
||||
* Platform-specific sections
|
||||
*/
|
||||
|
||||
32
apps/apps.h
32
apps/apps.h
@@ -189,7 +189,6 @@ extern BIO *bio_err;
|
||||
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||
OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
|
||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
||||
RAND_cleanup(); \
|
||||
ERR_free_strings(); zlib_cleanup();} while(0)
|
||||
# else
|
||||
# define apps_startup() \
|
||||
@@ -200,12 +199,11 @@ extern BIO *bio_err;
|
||||
do { CONF_modules_unload(1); destroy_ui_method(); \
|
||||
OBJ_cleanup(); EVP_cleanup(); \
|
||||
CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
|
||||
RAND_cleanup(); \
|
||||
ERR_free_strings(); zlib_cleanup(); } while(0)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(OPENSSL_SYSNAME_WIN32) || defined(OPENSSL_SYSNAME_WINCE)
|
||||
# ifdef OPENSSL_SYSNAME_WIN32
|
||||
# define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
|
||||
# else
|
||||
# define openssl_fdset(a,b) FD_SET(a, b)
|
||||
@@ -245,9 +243,6 @@ 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);
|
||||
X509_CRL *load_crl(const char *infile, int format);
|
||||
int load_cert_crl_http(const char *url, BIO *err,
|
||||
X509 **pcert, X509_CRL **pcrl);
|
||||
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,
|
||||
@@ -265,9 +260,8 @@ ENGINE *setup_engine(BIO *err, const char *engine, int debug);
|
||||
|
||||
# ifndef OPENSSL_NO_OCSP
|
||||
OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
|
||||
const char *host, const char *path,
|
||||
const char *port, int use_ssl,
|
||||
const STACK_OF(CONF_VALUE) *headers,
|
||||
char *host, char *path, char *port,
|
||||
int use_ssl, STACK_OF(CONF_VALUE) *headers,
|
||||
int req_timeout);
|
||||
# endif
|
||||
|
||||
@@ -324,12 +318,6 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in);
|
||||
int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value);
|
||||
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
|
||||
const char *algname, ENGINE *e, int do_param);
|
||||
int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts);
|
||||
int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts);
|
||||
int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts);
|
||||
# ifndef OPENSSL_NO_PSK
|
||||
extern char *psk_key;
|
||||
# endif
|
||||
@@ -338,16 +326,6 @@ void jpake_client_auth(BIO *out, BIO *conn, const char *secret);
|
||||
void jpake_server_auth(BIO *out, BIO *conn, const char *secret);
|
||||
# endif
|
||||
|
||||
# ifndef OPENSSL_NO_TLSEXT
|
||||
unsigned char *next_protos_parse(unsigned short *outlen, const char *in);
|
||||
# endif /* ndef OPENSSL_NO_TLSEXT */
|
||||
|
||||
void print_cert_checks(BIO *bio, X509 *x,
|
||||
const char *checkhost,
|
||||
const char *checkemail, const char *checkip);
|
||||
|
||||
void store_setup_crl_download(X509_STORE *st);
|
||||
|
||||
# define FORMAT_UNDEF 0
|
||||
# define FORMAT_ASN1 1
|
||||
# define FORMAT_TEXT 2
|
||||
@@ -362,7 +340,6 @@ void store_setup_crl_download(X509_STORE *st);
|
||||
# define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
|
||||
# define FORMAT_MSBLOB 11 /* MS Key blob format */
|
||||
# define FORMAT_PVK 12 /* MS PVK file format */
|
||||
# define FORMAT_HTTP 13 /* Download using HTTP */
|
||||
|
||||
# define EXT_COPY_NONE 0
|
||||
# define EXT_COPY_ADD 1
|
||||
@@ -381,7 +358,4 @@ int raw_write_stdout(const void *, int);
|
||||
# define TM_START 0
|
||||
# define TM_STOP 1
|
||||
double app_tminterval(int stop, int usertime);
|
||||
|
||||
# define OPENSSL_NO_SSL_INTERN
|
||||
|
||||
#endif
|
||||
|
||||
156
apps/ca.c
156
apps/ca.c
@@ -197,25 +197,23 @@ extern int EF_ALIGNMENT;
|
||||
|
||||
static void lookup_fail(const char *name, const char *tag);
|
||||
static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, unsigned long chtype,
|
||||
int multirdn, int email_dn, char *startdate, char *enddate,
|
||||
long days, int batch, char *ext_sect, CONF *conf,
|
||||
int verbose, unsigned long certopt, unsigned long nameopt,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy,
|
||||
CA_DB *db, BIGNUM *serial, char *subj,
|
||||
unsigned long chtype, int multirdn, int email_dn,
|
||||
char *startdate, char *enddate, long days, int batch,
|
||||
char *ext_sect, CONF *conf, int verbose,
|
||||
unsigned long certopt, unsigned long nameopt,
|
||||
int default_op, int ext_copy, int selfsign);
|
||||
static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, unsigned long chtype,
|
||||
int multirdn, int email_dn, char *startdate,
|
||||
char *enddate, long days, int batch, char *ext_sect,
|
||||
CONF *conf, int verbose, unsigned long certopt,
|
||||
unsigned long nameopt, int default_op, int ext_copy,
|
||||
ENGINE *e);
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy,
|
||||
CA_DB *db, BIGNUM *serial, char *subj,
|
||||
unsigned long chtype, int multirdn, int email_dn,
|
||||
char *startdate, char *enddate, long days, int batch,
|
||||
char *ext_sect, CONF *conf, int verbose,
|
||||
unsigned long certopt, unsigned long nameopt,
|
||||
int default_op, int ext_copy, ENGINE *e);
|
||||
static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey,
|
||||
X509 *x509, const EVP_MD *dgst,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, unsigned long chtype,
|
||||
int multirdn, int email_dn, char *startdate,
|
||||
@@ -225,12 +223,12 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey,
|
||||
static void write_new_certificate(BIO *bp, X509 *x, int output_der,
|
||||
int notext);
|
||||
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,
|
||||
char *subj, unsigned long chtype, int multirdn,
|
||||
int email_dn, char *startdate, char *enddate, long days,
|
||||
int batch, int verbose, X509_REQ *req, char *ext_sect,
|
||||
CONF *conf, unsigned long certopt, unsigned long nameopt,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy,
|
||||
CA_DB *db, BIGNUM *serial, char *subj,
|
||||
unsigned long chtype, int multirdn, int email_dn,
|
||||
char *startdate, char *enddate, long days, int batch,
|
||||
int verbose, X509_REQ *req, char *ext_sect, CONF *conf,
|
||||
unsigned long certopt, unsigned long nameopt,
|
||||
int default_op, int ext_copy, int selfsign);
|
||||
static int do_revoke(X509 *x509, CA_DB *db, int ext, char *extval);
|
||||
static int get_certificate_status(const char *ser_status, CA_DB *db);
|
||||
@@ -320,7 +318,6 @@ int MAIN(int argc, char **argv)
|
||||
const EVP_MD *dgst = NULL;
|
||||
STACK_OF(CONF_VALUE) *attribs = NULL;
|
||||
STACK_OF(X509) *cert_sk = NULL;
|
||||
STACK_OF(OPENSSL_STRING) *sigopts = NULL;
|
||||
#undef BSIZE
|
||||
#define BSIZE 256
|
||||
MS_STATIC char buf[3][BSIZE];
|
||||
@@ -428,13 +425,6 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
outdir = *(++argv);
|
||||
} else if (strcmp(*argv, "-sigopt") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
if (!sigopts)
|
||||
sigopts = sk_OPENSSL_STRING_new_null();
|
||||
if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv)))
|
||||
goto bad;
|
||||
} else if (strcmp(*argv, "-notext") == 0)
|
||||
notext = 1;
|
||||
else if (strcmp(*argv, "-batch") == 0)
|
||||
@@ -479,11 +469,6 @@ int MAIN(int argc, char **argv)
|
||||
goto bad;
|
||||
infile = *(++argv);
|
||||
dorevoke = 1;
|
||||
} else if (strcmp(*argv, "-valid") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
infile = *(++argv);
|
||||
dorevoke = 2;
|
||||
} else if (strcmp(*argv, "-extensions") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
@@ -664,7 +649,7 @@ int MAIN(int argc, char **argv)
|
||||
ERR_clear_error();
|
||||
#ifdef RL_DEBUG
|
||||
if (!p)
|
||||
BIO_printf(bio_err, "DEBUG: unique_subject undefined\n");
|
||||
BIO_printf(bio_err, "DEBUG: unique_subject undefined\n", p);
|
||||
#endif
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: configured unique_subject is %d\n",
|
||||
@@ -1105,10 +1090,10 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
if (spkac_file != NULL) {
|
||||
total++;
|
||||
j = certify_spkac(&x, spkac_file, pkey, x509, dgst, sigopts,
|
||||
attribs, db, serial, subj, chtype, multirdn,
|
||||
email_dn, startdate, enddate, days, extensions,
|
||||
conf, verbose, certopt, nameopt, default_op,
|
||||
j = certify_spkac(&x, spkac_file, pkey, x509, dgst, attribs, db,
|
||||
serial, subj, chtype, multirdn, email_dn,
|
||||
startdate, enddate, days, extensions, conf,
|
||||
verbose, certopt, nameopt, default_op,
|
||||
ext_copy);
|
||||
if (j < 0)
|
||||
goto err;
|
||||
@@ -1129,8 +1114,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
if (ss_cert_file != NULL) {
|
||||
total++;
|
||||
j = certify_cert(&x, ss_cert_file, pkey, x509, dgst, sigopts,
|
||||
attribs,
|
||||
j = certify_cert(&x, ss_cert_file, pkey, x509, dgst, attribs,
|
||||
db, serial, subj, chtype, multirdn, email_dn,
|
||||
startdate, enddate, days, batch, extensions,
|
||||
conf, verbose, certopt, nameopt, default_op,
|
||||
@@ -1150,7 +1134,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
if (infile != NULL) {
|
||||
total++;
|
||||
j = certify(&x, infile, pkey, x509p, dgst, sigopts, attribs, db,
|
||||
j = certify(&x, infile, pkey, x509p, dgst, attribs, db,
|
||||
serial, subj, chtype, multirdn, email_dn, startdate,
|
||||
enddate, days, batch, extensions, conf, verbose,
|
||||
certopt, nameopt, default_op, ext_copy, selfsign);
|
||||
@@ -1169,7 +1153,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
for (i = 0; i < argc; i++) {
|
||||
total++;
|
||||
j = certify(&x, argv[i], pkey, x509p, dgst, sigopts, attribs, db,
|
||||
j = certify(&x, argv[i], pkey, x509p, dgst, attribs, db,
|
||||
serial, subj, chtype, multirdn, email_dn, startdate,
|
||||
enddate, days, batch, extensions, conf, verbose,
|
||||
certopt, nameopt, default_op, ext_copy, selfsign);
|
||||
@@ -1321,7 +1305,6 @@ int MAIN(int argc, char **argv)
|
||||
if (!NCONF_get_number(conf, section,
|
||||
ENV_DEFAULT_CRL_HOURS, &crlhours))
|
||||
crlhours = 0;
|
||||
ERR_clear_error();
|
||||
}
|
||||
if ((crldays == 0) && (crlhours == 0) && (crlsec == 0)) {
|
||||
BIO_printf(bio_err,
|
||||
@@ -1418,7 +1401,7 @@ int MAIN(int argc, char **argv)
|
||||
crlnumber = NULL;
|
||||
}
|
||||
|
||||
if (!do_X509_CRL_sign(bio_err, crl, pkey, dgst, sigopts))
|
||||
if (!X509_CRL_sign(crl, pkey, dgst))
|
||||
goto err;
|
||||
|
||||
PEM_write_bio_X509_CRL(Sout, crl);
|
||||
@@ -1438,8 +1421,6 @@ int MAIN(int argc, char **argv)
|
||||
revcert = load_cert(bio_err, infile, FORMAT_PEM, NULL, e, infile);
|
||||
if (revcert == NULL)
|
||||
goto err;
|
||||
if (dorevoke == 2)
|
||||
rev_type = -1;
|
||||
j = do_revoke(revcert, db, rev_type, rev_arg);
|
||||
if (j <= 0)
|
||||
goto err;
|
||||
@@ -1475,8 +1456,6 @@ int MAIN(int argc, char **argv)
|
||||
BN_free(serial);
|
||||
BN_free(crlnumber);
|
||||
free_index(db);
|
||||
if (sigopts)
|
||||
sk_OPENSSL_STRING_free(sigopts);
|
||||
EVP_PKEY_free(pkey);
|
||||
if (x509)
|
||||
X509_free(x509);
|
||||
@@ -1494,12 +1473,12 @@ static void lookup_fail(const char *name, const char *tag)
|
||||
}
|
||||
|
||||
static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, unsigned long chtype,
|
||||
int multirdn, int email_dn, char *startdate, char *enddate,
|
||||
long days, int batch, char *ext_sect, CONF *lconf,
|
||||
int verbose, unsigned long certopt, unsigned long nameopt,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy,
|
||||
CA_DB *db, BIGNUM *serial, char *subj,
|
||||
unsigned long chtype, int multirdn, int email_dn,
|
||||
char *startdate, char *enddate, long days, int batch,
|
||||
char *ext_sect, CONF *lconf, int verbose,
|
||||
unsigned long certopt, unsigned long nameopt,
|
||||
int default_op, int ext_copy, int selfsign)
|
||||
{
|
||||
X509_REQ *req = NULL;
|
||||
@@ -1550,10 +1529,10 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
} else
|
||||
BIO_printf(bio_err, "Signature ok\n");
|
||||
|
||||
ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
|
||||
chtype, multirdn, email_dn, startdate, enddate, days, batch,
|
||||
verbose, req, ext_sect, lconf, certopt, nameopt, default_op,
|
||||
ext_copy, selfsign);
|
||||
ok = do_body(xret, pkey, x509, dgst, policy, db, serial, subj, chtype,
|
||||
multirdn, email_dn, startdate, enddate, days, batch, verbose,
|
||||
req, ext_sect, lconf, certopt, nameopt, default_op, ext_copy,
|
||||
selfsign);
|
||||
|
||||
err:
|
||||
if (req != NULL)
|
||||
@@ -1564,14 +1543,13 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
}
|
||||
|
||||
static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, unsigned long chtype,
|
||||
int multirdn, int email_dn, char *startdate,
|
||||
char *enddate, long days, int batch, char *ext_sect,
|
||||
CONF *lconf, int verbose, unsigned long certopt,
|
||||
unsigned long nameopt, int default_op, int ext_copy,
|
||||
ENGINE *e)
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy,
|
||||
CA_DB *db, BIGNUM *serial, char *subj,
|
||||
unsigned long chtype, int multirdn, int email_dn,
|
||||
char *startdate, char *enddate, long days, int batch,
|
||||
char *ext_sect, CONF *lconf, int verbose,
|
||||
unsigned long certopt, unsigned long nameopt,
|
||||
int default_op, int ext_copy, ENGINE *e)
|
||||
{
|
||||
X509 *req = NULL;
|
||||
X509_REQ *rreq = NULL;
|
||||
@@ -1607,9 +1585,9 @@ static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
if ((rreq = X509_to_X509_REQ(req, NULL, EVP_md5())) == NULL)
|
||||
goto err;
|
||||
|
||||
ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
|
||||
chtype, multirdn, email_dn, startdate, enddate, days, batch,
|
||||
verbose, rreq, ext_sect, lconf, certopt, nameopt, default_op,
|
||||
ok = do_body(xret, pkey, x509, dgst, policy, db, serial, subj, chtype,
|
||||
multirdn, email_dn, startdate, enddate, days, batch, verbose,
|
||||
rreq, ext_sect, lconf, certopt, nameopt, default_op,
|
||||
ext_copy, 0);
|
||||
|
||||
err:
|
||||
@@ -1621,12 +1599,12 @@ static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
|
||||
}
|
||||
|
||||
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
|
||||
const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,
|
||||
char *subj, unsigned long chtype, int multirdn,
|
||||
int email_dn, char *startdate, char *enddate, long days,
|
||||
int batch, int verbose, X509_REQ *req, char *ext_sect,
|
||||
CONF *lconf, unsigned long certopt, unsigned long nameopt,
|
||||
const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy,
|
||||
CA_DB *db, BIGNUM *serial, char *subj,
|
||||
unsigned long chtype, int multirdn, int email_dn,
|
||||
char *startdate, char *enddate, long days, int batch,
|
||||
int verbose, X509_REQ *req, char *ext_sect, CONF *lconf,
|
||||
unsigned long certopt, unsigned long nameopt,
|
||||
int default_op, int ext_copy, int selfsign)
|
||||
{
|
||||
X509_NAME *name = NULL, *CAname = NULL, *subject = NULL, *dn_subject =
|
||||
@@ -1967,12 +1945,8 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
|
||||
|
||||
if (enddate == NULL)
|
||||
X509_time_adj_ex(X509_get_notAfter(ret), days, 0, NULL);
|
||||
else {
|
||||
int tdays;
|
||||
else
|
||||
ASN1_TIME_set_string(X509_get_notAfter(ret), enddate);
|
||||
ASN1_TIME_diff(&tdays, NULL, NULL, X509_get_notAfter(ret));
|
||||
days = tdays;
|
||||
}
|
||||
|
||||
if (!X509_set_subject_name(ret, subject))
|
||||
goto err;
|
||||
@@ -2097,7 +2071,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
|
||||
EVP_PKEY_copy_parameters(pktmp, pkey);
|
||||
EVP_PKEY_free(pktmp);
|
||||
|
||||
if (!do_X509_sign(bio_err, ret, pkey, dgst, sigopts))
|
||||
if (!X509_sign(ret, pkey, dgst))
|
||||
goto err;
|
||||
|
||||
/* We now just add it to the database */
|
||||
@@ -2190,7 +2164,6 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der,
|
||||
|
||||
static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey,
|
||||
X509 *x509, const EVP_MD *dgst,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
STACK_OF(CONF_VALUE) *policy, CA_DB *db,
|
||||
BIGNUM *serial, char *subj, unsigned long chtype,
|
||||
int multirdn, int email_dn, char *startdate,
|
||||
@@ -2313,10 +2286,10 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey,
|
||||
|
||||
X509_REQ_set_pubkey(req, pktmp);
|
||||
EVP_PKEY_free(pktmp);
|
||||
ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
|
||||
chtype, multirdn, email_dn, startdate, enddate, days, 1,
|
||||
verbose, req, ext_sect, lconf, certopt, nameopt, default_op,
|
||||
ext_copy, 0);
|
||||
ok = do_body(xret, pkey, x509, dgst, policy, db, serial, subj, chtype,
|
||||
multirdn, email_dn, startdate, enddate, days, 1, verbose,
|
||||
req, ext_sect, lconf, certopt, nameopt, default_op, ext_copy,
|
||||
0);
|
||||
err:
|
||||
if (req != NULL)
|
||||
X509_REQ_free(req);
|
||||
@@ -2412,20 +2385,13 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
|
||||
}
|
||||
|
||||
/* Revoke Certificate */
|
||||
if (type == -1)
|
||||
ok = 1;
|
||||
else
|
||||
ok = do_revoke(x509, db, type, value);
|
||||
ok = do_revoke(x509, db, type, value);
|
||||
|
||||
goto err;
|
||||
|
||||
} else if (index_name_cmp_noconst(row, rrow)) {
|
||||
BIO_printf(bio_err, "ERROR:name does not match %s\n", row[DB_name]);
|
||||
goto err;
|
||||
} else if (type == -1) {
|
||||
BIO_printf(bio_err, "ERROR:Already present, serial number %s\n",
|
||||
row[DB_serial]);
|
||||
goto err;
|
||||
} else if (rrow[DB_type][0] == 'R') {
|
||||
BIO_printf(bio_err, "ERROR:Already revoked, serial number %s\n",
|
||||
row[DB_serial]);
|
||||
|
||||
@@ -85,9 +85,6 @@ int MAIN(int argc, char **argv)
|
||||
{
|
||||
int ret = 1, i;
|
||||
int verbose = 0, Verbose = 0;
|
||||
#ifndef OPENSSL_NO_SSL_TRACE
|
||||
int stdname = 0;
|
||||
#endif
|
||||
const char **pp;
|
||||
const char *p;
|
||||
int badops = 0;
|
||||
@@ -122,10 +119,6 @@ int MAIN(int argc, char **argv)
|
||||
verbose = 1;
|
||||
else if (strcmp(*argv, "-V") == 0)
|
||||
verbose = Verbose = 1;
|
||||
#ifndef OPENSSL_NO_SSL_TRACE
|
||||
else if (strcmp(*argv, "-stdname") == 0)
|
||||
stdname = verbose = 1;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SSL2
|
||||
else if (strcmp(*argv, "-ssl2") == 0)
|
||||
meth = SSLv2_client_method();
|
||||
@@ -189,7 +182,7 @@ int MAIN(int argc, char **argv)
|
||||
c = sk_SSL_CIPHER_value(sk, i);
|
||||
|
||||
if (Verbose) {
|
||||
unsigned long id = SSL_CIPHER_get_id(c);
|
||||
unsigned long id = c->id;
|
||||
int id0 = (int)(id >> 24);
|
||||
int id1 = (int)((id >> 16) & 0xffL);
|
||||
int id2 = (int)((id >> 8) & 0xffL);
|
||||
@@ -209,14 +202,7 @@ int MAIN(int argc, char **argv)
|
||||
id1, id2, id3);
|
||||
}
|
||||
}
|
||||
#ifndef OPENSSL_NO_SSL_TRACE
|
||||
if (stdname) {
|
||||
const char *nm = SSL_CIPHER_standard_name(c);
|
||||
if (nm == NULL)
|
||||
nm = "UNKNOWN";
|
||||
BIO_printf(STDout, "%s - ", nm);
|
||||
}
|
||||
#endif
|
||||
|
||||
BIO_puts(STDout, SSL_CIPHER_description(c, buf, sizeof buf));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +1,24 @@
|
||||
subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Client Cert
|
||||
issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA
|
||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Client test cert (512 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID5zCCAs+gAwIBAgIJALnu1NlVpZ6yMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
||||
BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT
|
||||
VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt
|
||||
ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZDELMAkG
|
||||
A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU
|
||||
RVNUSU5HIFBVUlBPU0VTIE9OTFkxGTAXBgNVBAMMEFRlc3QgQ2xpZW50IENlcnQw
|
||||
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0ranbHRLcLVqN+0BzcZpY
|
||||
+yOLqxzDWT1LD9eW1stC4NzXX9/DCtSIVyN7YIHdGLrIPr64IDdXXaMRzgZ2rOKs
|
||||
lmHCAiFpO/ja99gGCJRxH0xwQatqAULfJVHeUhs7OEGOZc2nWifjqKvGfNTilP7D
|
||||
nwi69ipQFq9oS19FmhwVHk2wg7KZGHI1qDyG04UrfCZMRitvS9+UVhPpIPjuiBi2
|
||||
x3/FZIpL5gXJvvFK6xHY63oq2asyzBATntBgnP4qJFWWcvRx24wF1PnZabxuVoL2
|
||||
bPnQ/KvONDrw3IdqkKhYNTul7jEcu3OlcZIMw+7DiaKJLAzKb/bBF5gm/pwW6As9
|
||||
AgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJYIZI
|
||||
AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW
|
||||
BBSZHKyLoTh7Mb409Zn/mK1ceSDAjDAfBgNVHSMEGDAWgBQ2w2yI55X+sL3szj49
|
||||
hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEAD0mL7PtPYgCEuDyOQSbLpeND5hVS
|
||||
curxQdGnrJ6Acrhodb7E9ccATokeb0PLx6HBLQUicxhTZIQ9FbO43YkQcOU6C3BB
|
||||
IlwskqmtN6+VmrQzNolHCDzvxNZs9lYL2VbGPGqVRyjZeHpoAlf9cQr8PgDb4d4b
|
||||
vUx2KAhHQvV2nkmYvKyXcgnRuHggumF87mkxidriGAEFwH4qfOqetUg64WyxP7P2
|
||||
QLipm04SyQa7ONtIApfVXgHcE42Py4/f4arzCzMjKe3VyhGkS7nsT55X/fWgTaRm
|
||||
CQPkO+H94P958WTvQDt77bQ+D3IvYaVvfil8n6HJMOJfFT0LJuSUbpSXJg==
|
||||
MIIB6TCCAVICAQIwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
||||
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU2WhcNOTgwNjA5
|
||||
MTM1NzU2WjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGkNsaWVudCB0ZXN0IGNl
|
||||
cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALtv55QyzG6i2Plw
|
||||
Z1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexmq/R4KedLjFEIYjocDui+IXs62NNt
|
||||
XrT8odkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBwtMmI7oGUG8nKmftQssATViH5
|
||||
NRRtoEw07DxJp/LfatHdrhqQB73eGdL5WILZJXk46Xz2e9WMSUjVCSYhdKxtflU3
|
||||
UR2Ajv1Oo0sTNdfz0wDqJNirLNtzyhhsaq8qMTrLwXrCP31VxBiigFSQSUFnZyTE
|
||||
9TKwhS4GlwbtCfxSKQ==
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpQIBAAKCAQEAtK2p2x0S3C1ajftAc3GaWPsji6scw1k9Sw/XltbLQuDc11/f
|
||||
wwrUiFcje2CB3Ri6yD6+uCA3V12jEc4GdqzirJZhwgIhaTv42vfYBgiUcR9McEGr
|
||||
agFC3yVR3lIbOzhBjmXNp1on46irxnzU4pT+w58IuvYqUBavaEtfRZocFR5NsIOy
|
||||
mRhyNag8htOFK3wmTEYrb0vflFYT6SD47ogYtsd/xWSKS+YFyb7xSusR2Ot6Ktmr
|
||||
MswQE57QYJz+KiRVlnL0cduMBdT52Wm8blaC9mz50PyrzjQ68NyHapCoWDU7pe4x
|
||||
HLtzpXGSDMPuw4miiSwMym/2wReYJv6cFugLPQIDAQABAoIBAAZOyc9MhIwLSU4L
|
||||
p4RgQvM4UVVe8/Id+3XTZ8NsXExJbWxXfIhiqGjaIfL8u4vsgRjcl+v1s/jo2/iT
|
||||
KMab4o4D8gXD7UavQVDjtjb/ta79WL3SjRl2Uc9YjjMkyq6WmDNQeo2NKDdafCTB
|
||||
1uzSJtLNipB8Z53ELPuHJhxX9QMHrMnuha49riQgXZ7buP9iQrHJFhImBjSzbxJx
|
||||
L+TI6rkyLSf9Wi0Pd3L27Ob3QWNfNRYNSeTE+08eSRChkur5W0RuXAcuAICdQlCl
|
||||
LBvWO/LmmvbzCqiDcgy/TliSb6CGGwgiNG7LJZmlkYNj8laGwalNlYZs3UrVv6NO
|
||||
Br2loAECgYEA2kvCvPGj0Dg/6g7WhXDvAkEbcaL1tSeCxBbNH+6HS2UWMWvyTtCn
|
||||
/bbD519QIdkvayy1QjEf32GV/UjUVmlULMLBcDy0DGjtL3+XpIhLKWDNxN1v1/ai
|
||||
1oz23ZJCOgnk6K4qtFtlRS1XtynjA+rBetvYvLP9SKeFrnpzCgaA2r0CgYEA0+KX
|
||||
1ACXDTNH5ySX3kMjSS9xdINf+OOw4CvPHFwbtc9aqk2HePlEsBTz5I/W3rKwXva3
|
||||
NqZ/bRqVVeZB/hHKFywgdUQk2Uc5z/S7Lw70/w1HubNTXGU06Ngb6zOFAo/o/TwZ
|
||||
zTP1BMIKSOB6PAZPS3l+aLO4FRIRotfFhgRHOoECgYEAmiZbqt8cJaJDB/5YYDzC
|
||||
mp3tSk6gIb936Q6M5VqkMYp9pIKsxhk0N8aDCnTU+kIK6SzWBpr3/d9Ecmqmfyq7
|
||||
5SvWO3KyVf0WWK9KH0abhOm2BKm2HBQvI0DB5u8sUx2/hsvOnjPYDISbZ11t0MtK
|
||||
u35Zy89yMYcSsIYJjG/ROCUCgYEAgI2P9G5PNxEP5OtMwOsW84Y3Xat/hPAQFlI+
|
||||
HES+AzbFGWJkeT8zL2nm95tVkFP1sggZ7Kxjz3w7cpx7GX0NkbWSE9O+T51pNASV
|
||||
tN1sQ3p5M+/a+cnlqgfEGJVvc7iAcXQPa3LEi5h2yPR49QYXAgG6cifn3dDSpmwn
|
||||
SUI7PQECgYEApGCIIpSRPLAEHTGmP87RBL1smurhwmy2s/pghkvUkWehtxg0sGHh
|
||||
kuaqDWcskogv+QC0sVdytiLSz8G0DwcEcsHK1Fkyb8A+ayiw6jWJDo2m9+IF4Fww
|
||||
1Te6jFPYDESnbhq7+TLGgHGhtwcu5cnb4vSuYXGXKupZGzoLOBbv1Zw=
|
||||
MIIBOwIBAAJBALtv55QyzG6i2PlwZ1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexm
|
||||
q/R4KedLjFEIYjocDui+IXs62NNtXrT8odkCAwEAAQJAbwXq0vJ/+uyEvsNgxLko
|
||||
/V86mGXQ/KrSkeKlL0r4ENxjcyeMAGoKu6J9yMY7+X9+Zm4nxShNfTsf/+Freoe1
|
||||
HQIhAPOSm5Q1YI+KIsII2GeVJx1U69+wnd71OasIPakS1L1XAiEAxQAW+J3/JWE0
|
||||
ftEYakbhUOKL8tD1OaFZS71/5GdG7E8CIQCefUMmySSvwd6kC0VlATSWbW+d+jp/
|
||||
nWmM1KvqnAo5uQIhALqEADu5U1Wvt8UN8UDGBRPQulHWNycuNV45d3nnskWPAiAw
|
||||
ueTyr6WsZ5+SD8g/Hy3xuvF3nPmJRH+rwvVihlcFOg==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
169
apps/cms.c
169
apps/cms.c
@@ -75,8 +75,6 @@ static void receipt_request_print(BIO *out, CMS_ContentInfo *cms);
|
||||
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING)
|
||||
*rr_to, int rr_allorfirst, STACK_OF(OPENSSL_STRING)
|
||||
*rr_from);
|
||||
static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
|
||||
STACK_OF(OPENSSL_STRING) *param);
|
||||
|
||||
# define SMIME_OP 0x10
|
||||
# define SMIME_IP 0x20
|
||||
@@ -100,14 +98,6 @@ static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
|
||||
|
||||
int verify_err = 0;
|
||||
|
||||
typedef struct cms_key_param_st cms_key_param;
|
||||
|
||||
struct cms_key_param_st {
|
||||
int idx;
|
||||
STACK_OF(OPENSSL_STRING) *param;
|
||||
cms_key_param *next;
|
||||
};
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
@@ -122,7 +112,7 @@ int MAIN(int argc, char **argv)
|
||||
STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL;
|
||||
char *certfile = NULL, *keyfile = NULL, *contfile = NULL;
|
||||
char *certsoutfile = NULL;
|
||||
const EVP_CIPHER *cipher = NULL, *wrap_cipher = NULL;
|
||||
const EVP_CIPHER *cipher = NULL;
|
||||
CMS_ContentInfo *cms = NULL, *rcms = NULL;
|
||||
X509_STORE *store = NULL;
|
||||
X509 *cert = NULL, *recip = NULL, *signer = NULL;
|
||||
@@ -147,11 +137,8 @@ int MAIN(int argc, char **argv)
|
||||
char *engine = NULL;
|
||||
# endif
|
||||
unsigned char *secret_key = NULL, *secret_keyid = NULL;
|
||||
unsigned char *pwri_pass = NULL, *pwri_tmp = NULL;
|
||||
size_t secret_keylen = 0, secret_keyidlen = 0;
|
||||
|
||||
cms_key_param *key_first = NULL, *key_param = NULL;
|
||||
|
||||
ASN1_OBJECT *econtent_type = NULL;
|
||||
|
||||
X509_VERIFY_PARAM *vpm = NULL;
|
||||
@@ -213,8 +200,6 @@ int MAIN(int argc, char **argv)
|
||||
cipher = EVP_des_ede3_cbc();
|
||||
else if (!strcmp(*args, "-des"))
|
||||
cipher = EVP_des_cbc();
|
||||
else if (!strcmp(*args, "-des3-wrap"))
|
||||
wrap_cipher = EVP_des_ede3_wrap();
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SEED
|
||||
else if (!strcmp(*args, "-seed"))
|
||||
@@ -235,12 +220,6 @@ int MAIN(int argc, char **argv)
|
||||
cipher = EVP_aes_192_cbc();
|
||||
else if (!strcmp(*args, "-aes256"))
|
||||
cipher = EVP_aes_256_cbc();
|
||||
else if (!strcmp(*args, "-aes128-wrap"))
|
||||
wrap_cipher = EVP_aes_128_wrap();
|
||||
else if (!strcmp(*args, "-aes192-wrap"))
|
||||
wrap_cipher = EVP_aes_192_wrap();
|
||||
else if (!strcmp(*args, "-aes256-wrap"))
|
||||
wrap_cipher = EVP_aes_256_wrap();
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CAMELLIA
|
||||
else if (!strcmp(*args, "-camellia128"))
|
||||
@@ -334,11 +313,6 @@ int MAIN(int argc, char **argv)
|
||||
goto argerr;
|
||||
}
|
||||
secret_keyidlen = (size_t)ltmp;
|
||||
} else if (!strcmp(*args, "-pwri_password")) {
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
args++;
|
||||
pwri_pass = (unsigned char *)*args;
|
||||
} else if (!strcmp(*args, "-econtent_type")) {
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
@@ -398,17 +372,7 @@ int MAIN(int argc, char **argv)
|
||||
} else if (!strcmp(*args, "-recip")) {
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
if (operation == SMIME_ENCRYPT) {
|
||||
if (!encerts)
|
||||
encerts = sk_X509_new_null();
|
||||
cert = load_cert(bio_err, *++args, FORMAT_PEM,
|
||||
NULL, e, "recipient certificate file");
|
||||
if (!cert)
|
||||
goto end;
|
||||
sk_X509_push(encerts, cert);
|
||||
cert = NULL;
|
||||
} else
|
||||
recipfile = *++args;
|
||||
recipfile = *++args;
|
||||
} else if (!strcmp(*args, "-certsout")) {
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
@@ -443,36 +407,6 @@ int MAIN(int argc, char **argv)
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
keyform = str2fmt(*++args);
|
||||
} else if (!strcmp(*args, "-keyopt")) {
|
||||
int keyidx = -1;
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
if (operation == SMIME_ENCRYPT) {
|
||||
if (encerts)
|
||||
keyidx += sk_X509_num(encerts);
|
||||
} else {
|
||||
if (keyfile || signerfile)
|
||||
keyidx++;
|
||||
if (skkeys)
|
||||
keyidx += sk_OPENSSL_STRING_num(skkeys);
|
||||
}
|
||||
if (keyidx < 0) {
|
||||
BIO_printf(bio_err, "No key specified\n");
|
||||
goto argerr;
|
||||
}
|
||||
if (key_param == NULL || key_param->idx != keyidx) {
|
||||
cms_key_param *nparam;
|
||||
nparam = OPENSSL_malloc(sizeof(cms_key_param));
|
||||
nparam->idx = keyidx;
|
||||
nparam->param = sk_OPENSSL_STRING_new_null();
|
||||
nparam->next = NULL;
|
||||
if (key_first == NULL)
|
||||
key_first = nparam;
|
||||
else
|
||||
key_param->next = nparam;
|
||||
key_param = nparam;
|
||||
}
|
||||
sk_OPENSSL_STRING_push(key_param->param, *++args);
|
||||
} else if (!strcmp(*args, "-rctform")) {
|
||||
if (!args[1])
|
||||
goto argerr;
|
||||
@@ -556,13 +490,13 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
|
||||
else if (operation == SMIME_DECRYPT) {
|
||||
if (!recipfile && !keyfile && !secret_key && !pwri_pass) {
|
||||
if (!recipfile && !keyfile && !secret_key) {
|
||||
BIO_printf(bio_err,
|
||||
"No recipient certificate or key specified\n");
|
||||
badarg = 1;
|
||||
}
|
||||
} else if (operation == SMIME_ENCRYPT) {
|
||||
if (!*args && !secret_key && !pwri_pass && !encerts) {
|
||||
if (!*args && !secret_key) {
|
||||
BIO_printf(bio_err, "No recipient(s) certificate(s) specified\n");
|
||||
badarg = 1;
|
||||
}
|
||||
@@ -627,7 +561,6 @@ int MAIN(int argc, char **argv)
|
||||
"-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, "-keyopt nm:v set public key parameters\n");
|
||||
BIO_printf(bio_err, "-out file output file\n");
|
||||
BIO_printf(bio_err,
|
||||
"-outform arg output format SMIME (default), PEM or DER\n");
|
||||
@@ -711,7 +644,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (*args && !encerts)
|
||||
if (*args)
|
||||
encerts = sk_X509_new_null();
|
||||
while (*args) {
|
||||
if (!(cert = load_cert(bio_err, *args, FORMAT_PEM,
|
||||
@@ -863,39 +796,10 @@ int MAIN(int argc, char **argv)
|
||||
} else if (operation == SMIME_COMPRESS) {
|
||||
cms = CMS_compress(in, -1, flags);
|
||||
} else if (operation == SMIME_ENCRYPT) {
|
||||
int i;
|
||||
flags |= CMS_PARTIAL;
|
||||
cms = CMS_encrypt(NULL, in, cipher, flags);
|
||||
cms = CMS_encrypt(encerts, in, cipher, flags);
|
||||
if (!cms)
|
||||
goto end;
|
||||
for (i = 0; i < sk_X509_num(encerts); i++) {
|
||||
CMS_RecipientInfo *ri;
|
||||
cms_key_param *kparam;
|
||||
int tflags = flags;
|
||||
X509 *x = sk_X509_value(encerts, i);
|
||||
for (kparam = key_first; kparam; kparam = kparam->next) {
|
||||
if (kparam->idx == i) {
|
||||
tflags |= CMS_KEY_PARAM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ri = CMS_add1_recipient_cert(cms, x, tflags);
|
||||
if (!ri)
|
||||
goto end;
|
||||
if (kparam) {
|
||||
EVP_PKEY_CTX *pctx;
|
||||
pctx = CMS_RecipientInfo_get0_pkey_ctx(ri);
|
||||
if (!cms_set_pkey_param(pctx, kparam->param))
|
||||
goto end;
|
||||
}
|
||||
if (CMS_RecipientInfo_type(ri) == CMS_RECIPINFO_AGREE
|
||||
&& wrap_cipher) {
|
||||
EVP_CIPHER_CTX *wctx;
|
||||
wctx = CMS_RecipientInfo_kari_get0_ctx(ri);
|
||||
EVP_EncryptInit_ex(wctx, wrap_cipher, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (secret_key) {
|
||||
if (!CMS_add0_recipient_key(cms, NID_undef,
|
||||
secret_key, secret_keylen,
|
||||
@@ -906,16 +810,6 @@ int MAIN(int argc, char **argv)
|
||||
secret_key = NULL;
|
||||
secret_keyid = NULL;
|
||||
}
|
||||
if (pwri_pass) {
|
||||
pwri_tmp = (unsigned char *)BUF_strdup((char *)pwri_pass);
|
||||
if (!pwri_tmp)
|
||||
goto end;
|
||||
if (!CMS_add0_recipient_password(cms,
|
||||
-1, NID_undef, NID_undef,
|
||||
pwri_tmp, -1, NULL))
|
||||
goto end;
|
||||
pwri_tmp = NULL;
|
||||
}
|
||||
if (!(flags & CMS_STREAM)) {
|
||||
if (!CMS_final(cms, in, NULL, flags))
|
||||
goto end;
|
||||
@@ -968,11 +862,8 @@ int MAIN(int argc, char **argv)
|
||||
flags |= CMS_REUSE_DIGEST;
|
||||
for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++) {
|
||||
CMS_SignerInfo *si;
|
||||
cms_key_param *kparam;
|
||||
int tflags = flags;
|
||||
signerfile = sk_OPENSSL_STRING_value(sksigners, i);
|
||||
keyfile = sk_OPENSSL_STRING_value(skkeys, i);
|
||||
|
||||
signer = load_cert(bio_err, signerfile, FORMAT_PEM, NULL,
|
||||
e, "signer certificate");
|
||||
if (!signer)
|
||||
@@ -981,21 +872,9 @@ int MAIN(int argc, char **argv)
|
||||
"signing key file");
|
||||
if (!key)
|
||||
goto end;
|
||||
for (kparam = key_first; kparam; kparam = kparam->next) {
|
||||
if (kparam->idx == i) {
|
||||
tflags |= CMS_KEY_PARAM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
si = CMS_add1_signer(cms, signer, key, sign_md, tflags);
|
||||
si = CMS_add1_signer(cms, signer, key, sign_md, flags);
|
||||
if (!si)
|
||||
goto end;
|
||||
if (kparam) {
|
||||
EVP_PKEY_CTX *pctx;
|
||||
pctx = CMS_SignerInfo_get0_pkey_ctx(si);
|
||||
if (!cms_set_pkey_param(pctx, kparam->param))
|
||||
goto end;
|
||||
}
|
||||
if (rr && !CMS_add1_ReceiptRequest(si, rr))
|
||||
goto end;
|
||||
X509_free(signer);
|
||||
@@ -1036,13 +915,6 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (pwri_pass) {
|
||||
if (!CMS_decrypt_set1_password(cms, pwri_pass, -1)) {
|
||||
BIO_puts(bio_err, "Error decrypting CMS using password\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (!CMS_decrypt(cms, NULL, NULL, indata, out, flags)) {
|
||||
BIO_printf(bio_err, "Error decrypting CMS structure\n");
|
||||
goto end;
|
||||
@@ -1140,8 +1012,6 @@ int MAIN(int argc, char **argv)
|
||||
OPENSSL_free(secret_key);
|
||||
if (secret_keyid)
|
||||
OPENSSL_free(secret_keyid);
|
||||
if (pwri_tmp)
|
||||
OPENSSL_free(pwri_tmp);
|
||||
if (econtent_type)
|
||||
ASN1_OBJECT_free(econtent_type);
|
||||
if (rr)
|
||||
@@ -1150,13 +1020,6 @@ int MAIN(int argc, char **argv)
|
||||
sk_OPENSSL_STRING_free(rr_to);
|
||||
if (rr_from)
|
||||
sk_OPENSSL_STRING_free(rr_from);
|
||||
for (key_param = key_first; key_param;) {
|
||||
cms_key_param *tparam;
|
||||
sk_OPENSSL_STRING_free(key_param->param);
|
||||
tparam = key_param->next;
|
||||
OPENSSL_free(key_param);
|
||||
key_param = tparam;
|
||||
}
|
||||
X509_STORE_free(store);
|
||||
X509_free(cert);
|
||||
X509_free(recip);
|
||||
@@ -1330,22 +1193,4 @@ static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
|
||||
STACK_OF(OPENSSL_STRING) *param)
|
||||
{
|
||||
char *keyopt;
|
||||
int i;
|
||||
if (sk_OPENSSL_STRING_num(param) <= 0)
|
||||
return 1;
|
||||
for (i = 0; i < sk_OPENSSL_STRING_num(param); i++) {
|
||||
keyopt = sk_OPENSSL_STRING_value(param, i);
|
||||
if (pkey_ctrl_string(pctx, keyopt) <= 0) {
|
||||
BIO_printf(bio_err, "parameter error \"%s\"\n", keyopt);
|
||||
ERR_print_errors(bio_err);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
92
apps/crl.c
92
apps/crl.c
@@ -96,6 +96,7 @@ static const char *crl_usage[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
static X509_CRL *load_crl(char *file, int format);
|
||||
static BIO *bio_out = NULL;
|
||||
|
||||
int MAIN(int, char **);
|
||||
@@ -105,10 +106,10 @@ int MAIN(int argc, char **argv)
|
||||
unsigned long nmflag = 0;
|
||||
X509_CRL *x = NULL;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
int ret = 1, i, num, badops = 0, badsig = 0;
|
||||
int ret = 1, i, num, badops = 0;
|
||||
BIO *out = NULL;
|
||||
int informat, outformat, keyformat;
|
||||
char *infile = NULL, *outfile = NULL, *crldiff = NULL, *keyfile = NULL;
|
||||
int informat, outformat;
|
||||
char *infile = NULL, *outfile = NULL;
|
||||
int hash = 0, issuer = 0, lastupdate = 0, nextupdate = 0, noout =
|
||||
0, text = 0;
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
@@ -146,7 +147,6 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
informat = FORMAT_PEM;
|
||||
outformat = FORMAT_PEM;
|
||||
keyformat = FORMAT_PEM;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
@@ -173,18 +173,6 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
infile = *(++argv);
|
||||
} else if (strcmp(*argv, "-gendelta") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
crldiff = *(++argv);
|
||||
} else if (strcmp(*argv, "-key") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
keyfile = *(++argv);
|
||||
} else if (strcmp(*argv, "-keyform") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
keyformat = str2fmt(*(++argv));
|
||||
} else if (strcmp(*argv, "-out") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
@@ -226,8 +214,6 @@ int MAIN(int argc, char **argv)
|
||||
fingerprint = ++num;
|
||||
else if (strcmp(*argv, "-crlnumber") == 0)
|
||||
crlnumber = ++num;
|
||||
else if (strcmp(*argv, "-badsig") == 0)
|
||||
badsig = 1;
|
||||
else if ((md_alg = EVP_get_digestbyname(*argv + 1))) {
|
||||
/* ok */
|
||||
digest = md_alg;
|
||||
@@ -295,33 +281,6 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "verify OK\n");
|
||||
}
|
||||
|
||||
if (crldiff) {
|
||||
X509_CRL *newcrl, *delta;
|
||||
if (!keyfile) {
|
||||
BIO_puts(bio_err, "Missing CRL signing key\n");
|
||||
goto end;
|
||||
}
|
||||
newcrl = load_crl(crldiff, informat);
|
||||
if (!newcrl)
|
||||
goto end;
|
||||
pkey = load_key(bio_err, keyfile, keyformat, 0, NULL, NULL,
|
||||
"CRL signing key");
|
||||
if (!pkey) {
|
||||
X509_CRL_free(newcrl);
|
||||
goto end;
|
||||
}
|
||||
delta = X509_CRL_diff(x, newcrl, pkey, digest, 0);
|
||||
X509_CRL_free(newcrl);
|
||||
EVP_PKEY_free(pkey);
|
||||
if (delta) {
|
||||
X509_CRL_free(x);
|
||||
x = delta;
|
||||
} else {
|
||||
BIO_puts(bio_err, "Error creating delta CRL\n");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (num) {
|
||||
for (i = 1; i <= num; i++) {
|
||||
if (issuer == i) {
|
||||
@@ -410,9 +369,6 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (badsig)
|
||||
x->signature->data[x->signature->length - 1] ^= 0x1;
|
||||
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i = (int)i2d_X509_CRL_bio(out, x);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
@@ -427,8 +383,6 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
ret = 0;
|
||||
end:
|
||||
if (ret != 0)
|
||||
ERR_print_errors(bio_err);
|
||||
BIO_free_all(out);
|
||||
BIO_free_all(bio_out);
|
||||
bio_out = NULL;
|
||||
@@ -440,3 +394,41 @@ int MAIN(int argc, char **argv)
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
|
||||
static X509_CRL *load_crl(char *infile, int format)
|
||||
{
|
||||
X509_CRL *x = NULL;
|
||||
BIO *in = NULL;
|
||||
|
||||
in = BIO_new(BIO_s_file());
|
||||
if (in == NULL) {
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (infile == NULL)
|
||||
BIO_set_fp(in, stdin, BIO_NOCLOSE);
|
||||
else {
|
||||
if (BIO_read_filename(in, infile) <= 0) {
|
||||
perror(infile);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
if (format == FORMAT_ASN1)
|
||||
x = d2i_X509_CRL_bio(in, NULL);
|
||||
else if (format == FORMAT_PEM)
|
||||
x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
|
||||
else {
|
||||
BIO_printf(bio_err, "bad input format specified for input crl\n");
|
||||
goto end;
|
||||
}
|
||||
if (x == NULL) {
|
||||
BIO_printf(bio_err, "unable to load CRL\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
BIO_free(in);
|
||||
return (x);
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# This is a file that will be filled by the openssl srp routine.
|
||||
# You can initialize the file with additional groups, these are
|
||||
# records starting with a I followed by the g and N values and the id.
|
||||
# The exact values ... you have to dig this out from the source of srp.c
|
||||
# or srp_vfy.c
|
||||
# The last value of an I is used as the default group for new users.
|
||||
@@ -1 +0,0 @@
|
||||
unique_subject = yes
|
||||
51
apps/dgst.c
51
apps/dgst.c
@@ -103,7 +103,7 @@ int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
ENGINE *e = NULL, *impl = NULL;
|
||||
ENGINE *e = NULL;
|
||||
unsigned char *buf = NULL;
|
||||
int i, err = 1;
|
||||
const EVP_MD *md = NULL, *m;
|
||||
@@ -124,11 +124,9 @@ int MAIN(int argc, char **argv)
|
||||
char *passargin = NULL, *passin = NULL;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine = NULL;
|
||||
int engine_impl = 0;
|
||||
#endif
|
||||
char *hmac_key = NULL;
|
||||
char *mac_name = NULL;
|
||||
int non_fips_allow = 0;
|
||||
STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL;
|
||||
|
||||
apps_startup();
|
||||
@@ -200,8 +198,7 @@ int MAIN(int argc, char **argv)
|
||||
break;
|
||||
engine = *(++argv);
|
||||
e = setup_engine(bio_err, engine, 0);
|
||||
} else if (strcmp(*argv, "-engine_impl") == 0)
|
||||
engine_impl = 1;
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(*argv, "-hex") == 0)
|
||||
out_bin = 0;
|
||||
@@ -209,10 +206,6 @@ int MAIN(int argc, char **argv)
|
||||
out_bin = 1;
|
||||
else if (strcmp(*argv, "-d") == 0)
|
||||
debug = 1;
|
||||
else if (!strcmp(*argv, "-fips-fingerprint"))
|
||||
hmac_key = "etaonrishdlcupfm";
|
||||
else if (strcmp(*argv, "-non-fips-allow") == 0)
|
||||
non_fips_allow = 1;
|
||||
else if (!strcmp(*argv, "-hmac")) {
|
||||
if (--argc < 1)
|
||||
break;
|
||||
@@ -259,8 +252,6 @@ int MAIN(int argc, char **argv)
|
||||
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, "-hmac arg set the HMAC key to arg\n");
|
||||
BIO_printf(bio_err, "-non-fips-allow allow use of non FIPS digest\n");
|
||||
BIO_printf(bio_err,
|
||||
"-sign file sign digest using private key in file\n");
|
||||
BIO_printf(bio_err,
|
||||
@@ -286,10 +277,6 @@ int MAIN(int argc, char **argv)
|
||||
EVP_MD_do_all_sorted(list_md_fn, bio_err);
|
||||
goto end;
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (engine_impl)
|
||||
impl = e;
|
||||
#endif
|
||||
|
||||
in = BIO_new(BIO_s_file());
|
||||
bmd = BIO_new(BIO_f_md());
|
||||
@@ -363,7 +350,7 @@ int MAIN(int argc, char **argv)
|
||||
if (mac_name) {
|
||||
EVP_PKEY_CTX *mac_ctx = NULL;
|
||||
int r = 0;
|
||||
if (!init_gen_str(bio_err, &mac_ctx, mac_name, impl, 0))
|
||||
if (!init_gen_str(bio_err, &mac_ctx, mac_name, e, 0))
|
||||
goto mac_end;
|
||||
if (macopts) {
|
||||
char *macopt;
|
||||
@@ -390,14 +377,8 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (non_fips_allow) {
|
||||
EVP_MD_CTX *md_ctx;
|
||||
BIO_get_md_ctx(bmd, &md_ctx);
|
||||
EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
|
||||
}
|
||||
|
||||
if (hmac_key) {
|
||||
sigkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, impl,
|
||||
sigkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, e,
|
||||
(unsigned char *)hmac_key, -1);
|
||||
if (!sigkey)
|
||||
goto end;
|
||||
@@ -413,9 +394,9 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
if (do_verify)
|
||||
r = EVP_DigestVerifyInit(mctx, &pctx, md, impl, sigkey);
|
||||
r = EVP_DigestVerifyInit(mctx, &pctx, md, NULL, sigkey);
|
||||
else
|
||||
r = EVP_DigestSignInit(mctx, &pctx, md, impl, sigkey);
|
||||
r = EVP_DigestSignInit(mctx, &pctx, md, NULL, sigkey);
|
||||
if (!r) {
|
||||
BIO_printf(bio_err, "Error setting context\n");
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -435,15 +416,9 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
/* we use md as a filter, reading from 'in' */
|
||||
else {
|
||||
EVP_MD_CTX *mctx = NULL;
|
||||
if (!BIO_get_md_ctx(bmd, &mctx)) {
|
||||
BIO_printf(bio_err, "Error getting context\n");
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
if (md == NULL)
|
||||
md = EVP_md5();
|
||||
if (!EVP_DigestInit_ex(mctx, md, impl)) {
|
||||
if (!BIO_set_md(bmd, md)) {
|
||||
BIO_printf(bio_err, "Error setting digest %s\n", pname);
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
@@ -490,8 +465,7 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY_asn1_get0_info(NULL, NULL,
|
||||
NULL, NULL, &sig_name, ameth);
|
||||
}
|
||||
if (md)
|
||||
md_name = EVP_MD_name(md);
|
||||
md_name = EVP_MD_name(md);
|
||||
}
|
||||
err = 0;
|
||||
for (i = 0; i < argc; i++) {
|
||||
@@ -589,12 +563,9 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
|
||||
BIO_printf(out, "%02x", buf[i]);
|
||||
BIO_printf(out, " *%s\n", file);
|
||||
} else {
|
||||
if (sig_name) {
|
||||
BIO_puts(out, sig_name);
|
||||
if (md_name)
|
||||
BIO_printf(out, "-%s", md_name);
|
||||
BIO_printf(out, "(%s)= ", file);
|
||||
} else if (md_name)
|
||||
if (sig_name)
|
||||
BIO_printf(out, "%s-%s(%s)= ", sig_name, md_name, file);
|
||||
else if (md_name)
|
||||
BIO_printf(out, "%s(%s)= ", md_name, file);
|
||||
else
|
||||
BIO_printf(out, "(%s)= ", file);
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
# undef PROG
|
||||
# define PROG dhparam_main
|
||||
|
||||
# define DEFBITS 2048
|
||||
# define DEFBITS 512
|
||||
|
||||
/*-
|
||||
* -inform arg - input format - default PEM (DER or PEM)
|
||||
@@ -254,7 +254,7 @@ int MAIN(int argc, char **argv)
|
||||
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 2048)\n");
|
||||
" numbits number of bits in to generate (default 512)\n");
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err,
|
||||
" -engine e use engine e, possibly a hardware device.\n");
|
||||
@@ -489,12 +489,9 @@ int MAIN(int argc, char **argv)
|
||||
if (!noout) {
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i = i2d_DHparams_bio(out, dh);
|
||||
else if (outformat == FORMAT_PEM) {
|
||||
if (dh->q)
|
||||
i = PEM_write_bio_DHxparams(out, dh);
|
||||
else
|
||||
i = PEM_write_bio_DHparams(out, dh);
|
||||
} else {
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i = PEM_write_bio_DHparams(out, dh);
|
||||
else {
|
||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,6 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
# endif
|
||||
ERR_print_errors(bio_err);
|
||||
BIO_printf(bio_err, "Error, DSA key generation failed\n");
|
||||
goto end;
|
||||
}
|
||||
@@ -406,11 +405,8 @@ int MAIN(int argc, char **argv)
|
||||
assert(need_rand);
|
||||
if ((dsakey = DSAparams_dup(dsa)) == NULL)
|
||||
goto end;
|
||||
if (!DSA_generate_key(dsakey)) {
|
||||
ERR_print_errors(bio_err);
|
||||
DSA_free(dsakey);
|
||||
if (!DSA_generate_key(dsakey))
|
||||
goto end;
|
||||
}
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i = i2d_DSAPrivateKey_bio(out, dsakey);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
@@ -418,7 +414,6 @@ int MAIN(int argc, char **argv)
|
||||
NULL);
|
||||
else {
|
||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
||||
DSA_free(dsakey);
|
||||
goto end;
|
||||
}
|
||||
DSA_free(dsakey);
|
||||
|
||||
@@ -370,9 +370,6 @@ int MAIN(int argc, char **argv)
|
||||
} else
|
||||
nid = OBJ_sn2nid(curve_name);
|
||||
|
||||
if (nid == 0)
|
||||
nid = EC_curve_nist2nid(curve_name);
|
||||
|
||||
if (nid == 0) {
|
||||
BIO_printf(bio_err, "unknown curve name (%s)\n", curve_name);
|
||||
goto end;
|
||||
|
||||
23
apps/enc.c
23
apps/enc.c
@@ -130,7 +130,6 @@ int MAIN(int argc, char **argv)
|
||||
char *engine = NULL;
|
||||
#endif
|
||||
const EVP_MD *dgst = NULL;
|
||||
int non_fips_allow = 0;
|
||||
|
||||
apps_startup();
|
||||
|
||||
@@ -266,10 +265,8 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
md = *(++argv);
|
||||
} else if (strcmp(*argv, "-non-fips-allow") == 0)
|
||||
non_fips_allow = 1;
|
||||
else if ((argv[0][0] == '-') &&
|
||||
((c = EVP_get_cipherbyname(&(argv[0][1]))) != NULL)) {
|
||||
} else if ((argv[0][0] == '-') &&
|
||||
((c = EVP_get_cipherbyname(&(argv[0][1]))) != NULL)) {
|
||||
cipher = c;
|
||||
} else if (strcmp(*argv, "-none") == 0)
|
||||
cipher = NULL;
|
||||
@@ -326,18 +323,6 @@ int MAIN(int argc, char **argv)
|
||||
setup_engine(bio_err, engine, 0);
|
||||
#endif
|
||||
|
||||
if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) {
|
||||
BIO_printf(bio_err,
|
||||
"AEAD ciphers not supported by the enc utility\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (cipher && (EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE)) {
|
||||
BIO_printf(bio_err,
|
||||
"Ciphers in XTS mode are not supported by the enc utility\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (md && (dgst = EVP_get_digestbyname(md)) == NULL) {
|
||||
BIO_printf(bio_err, "%s is an unsupported message digest type\n", md);
|
||||
goto end;
|
||||
@@ -576,10 +561,6 @@ int MAIN(int argc, char **argv)
|
||||
*/
|
||||
|
||||
BIO_get_cipher_ctx(benc, &ctx);
|
||||
|
||||
if (non_fips_allow)
|
||||
EVP_CIPHER_CTX_set_flags(ctx, EVP_CIPH_FLAG_NON_FIPS_ALLOW);
|
||||
|
||||
if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc)) {
|
||||
BIO_printf(bio_err, "Error setting cipher %s\n",
|
||||
EVP_CIPHER_name(cipher));
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
# include <openssl/x509.h>
|
||||
# include <openssl/pem.h>
|
||||
|
||||
# define DEFBITS 2048
|
||||
# define DEFBITS 512
|
||||
# undef PROG
|
||||
# define PROG gendh_main
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
# include <openssl/pem.h>
|
||||
# include <openssl/rand.h>
|
||||
|
||||
# define DEFBITS 2048
|
||||
# define DEFBITS 512
|
||||
# undef PROG
|
||||
# define PROG genrsa_main
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
|
||||
"X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+-
|
||||
"S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+-
|
||||
"CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ -
|
||||
"SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS,SRP"
|
||||
"SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS"
|
||||
$!
|
||||
$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT"
|
||||
$!
|
||||
@@ -776,7 +776,7 @@ $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS
|
||||
$ CCDISABLEWARNINGS = "" !!! "MAYLOSEDATA3" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR"
|
||||
$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. ""
|
||||
$ THEN
|
||||
$ IF CCDISABLEWARNINGS .NES. THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
|
||||
$ IF CCDISABLEWARNINGS .NES. "" THEN CCDISABLEWARNINGS = CCDISABLEWARNINGS + ","
|
||||
$ CCDISABLEWARNINGS = CCDISABLEWARNINGS + USER_CCDISABLEWARNINGS
|
||||
$ ENDIF
|
||||
$!
|
||||
|
||||
104
apps/ocsp.c
104
apps/ocsp.c
@@ -110,17 +110,16 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req,
|
||||
CA_DB *db, X509 *ca, X509 *rcert,
|
||||
EVP_PKEY *rkey, const EVP_MD *md,
|
||||
STACK_OF(X509) *rother, unsigned long flags,
|
||||
int nmin, int ndays, int badsig);
|
||||
EVP_PKEY *rkey, STACK_OF(X509) *rother,
|
||||
unsigned long flags, int nmin, int ndays);
|
||||
|
||||
static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser);
|
||||
static BIO *init_responder(const char *port);
|
||||
static BIO *init_responder(char *port);
|
||||
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio,
|
||||
const char *port);
|
||||
char *port);
|
||||
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp);
|
||||
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path,
|
||||
const STACK_OF(CONF_VALUE) *headers,
|
||||
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
|
||||
STACK_OF(CONF_VALUE) *headers,
|
||||
OCSP_REQUEST *req, int req_timeout);
|
||||
|
||||
# undef PROG
|
||||
@@ -155,14 +154,12 @@ int MAIN(int argc, char **argv)
|
||||
long nsec = MAX_VALIDITY_PERIOD, maxage = -1;
|
||||
char *CAfile = NULL, *CApath = NULL;
|
||||
X509_STORE *store = NULL;
|
||||
X509_VERIFY_PARAM *vpm = NULL;
|
||||
STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;
|
||||
char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;
|
||||
unsigned long sign_flags = 0, verify_flags = 0, rflags = 0;
|
||||
int ret = 1;
|
||||
int accept_count = -1;
|
||||
int badarg = 0;
|
||||
int badsig = 0;
|
||||
int i;
|
||||
int ignore_err = 0;
|
||||
STACK_OF(OPENSSL_STRING) *reqnames = NULL;
|
||||
@@ -173,7 +170,7 @@ int MAIN(int argc, char **argv)
|
||||
char *rca_filename = NULL;
|
||||
CA_DB *rdb = NULL;
|
||||
int nmin = 0, ndays = -1;
|
||||
const EVP_MD *cert_id_md = NULL, *rsign_md = NULL;
|
||||
const EVP_MD *cert_id_md = NULL;
|
||||
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
@@ -267,8 +264,6 @@ int MAIN(int argc, char **argv)
|
||||
verify_flags |= OCSP_TRUSTOTHER;
|
||||
else if (!strcmp(*args, "-no_intern"))
|
||||
verify_flags |= OCSP_NOINTERN;
|
||||
else if (!strcmp(*args, "-badsig"))
|
||||
badsig = 1;
|
||||
else if (!strcmp(*args, "-text")) {
|
||||
req_text = 1;
|
||||
resp_text = 1;
|
||||
@@ -325,10 +320,6 @@ int MAIN(int argc, char **argv)
|
||||
CApath = *args;
|
||||
} else
|
||||
badarg = 1;
|
||||
} else if (args_verify(&args, NULL, &badarg, bio_err, &vpm)) {
|
||||
if (badarg)
|
||||
goto end;
|
||||
continue;
|
||||
} else if (!strcmp(*args, "-validity_period")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
@@ -474,14 +465,6 @@ int MAIN(int argc, char **argv)
|
||||
rcertfile = *args;
|
||||
} else
|
||||
badarg = 1;
|
||||
} else if (!strcmp(*args, "-rmd")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
rsign_md = EVP_get_digestbyname(*args);
|
||||
if (!rsign_md)
|
||||
badarg = 1;
|
||||
} else
|
||||
badarg = 1;
|
||||
} else if ((cert_id_md = EVP_get_digestbyname((*args) + 1)) == NULL) {
|
||||
badarg = 1;
|
||||
}
|
||||
@@ -599,10 +582,7 @@ int MAIN(int argc, char **argv)
|
||||
add_nonce = 0;
|
||||
|
||||
if (!req && reqin) {
|
||||
if (!strcmp(reqin, "-"))
|
||||
derbio = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
else
|
||||
derbio = BIO_new_file(reqin, "rb");
|
||||
derbio = BIO_new_file(reqin, "rb");
|
||||
if (!derbio) {
|
||||
BIO_printf(bio_err, "Error Opening OCSP request file\n");
|
||||
goto end;
|
||||
@@ -699,10 +679,7 @@ int MAIN(int argc, char **argv)
|
||||
OCSP_REQUEST_print(out, req, 0);
|
||||
|
||||
if (reqout) {
|
||||
if (!strcmp(reqout, "-"))
|
||||
derbio = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||
else
|
||||
derbio = BIO_new_file(reqout, "wb");
|
||||
derbio = BIO_new_file(reqout, "wb");
|
||||
if (!derbio) {
|
||||
BIO_printf(bio_err, "Error opening file %s\n", reqout);
|
||||
goto end;
|
||||
@@ -727,7 +704,7 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
if (rdb) {
|
||||
i = make_ocsp_response(&resp, req, rdb, rca_cert, rsigner, rkey,
|
||||
rsign_md, rother, rflags, nmin, ndays, badsig);
|
||||
rother, rflags, nmin, ndays);
|
||||
if (cbio)
|
||||
send_ocsp_response(cbio, resp);
|
||||
} else if (host) {
|
||||
@@ -742,10 +719,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
# endif
|
||||
} else if (respin) {
|
||||
if (!strcmp(respin, "-"))
|
||||
derbio = BIO_new_fp(stdin, BIO_NOCLOSE);
|
||||
else
|
||||
derbio = BIO_new_file(respin, "rb");
|
||||
derbio = BIO_new_file(respin, "rb");
|
||||
if (!derbio) {
|
||||
BIO_printf(bio_err, "Error Opening OCSP response file\n");
|
||||
goto end;
|
||||
@@ -765,10 +739,7 @@ int MAIN(int argc, char **argv)
|
||||
done_resp:
|
||||
|
||||
if (respout) {
|
||||
if (!strcmp(respout, "-"))
|
||||
derbio = BIO_new_fp(stdout, BIO_NOCLOSE);
|
||||
else
|
||||
derbio = BIO_new_file(respout, "wb");
|
||||
derbio = BIO_new_file(respout, "wb");
|
||||
if (!derbio) {
|
||||
BIO_printf(bio_err, "Error opening file %s\n", respout);
|
||||
goto end;
|
||||
@@ -805,10 +776,6 @@ int MAIN(int argc, char **argv)
|
||||
resp = NULL;
|
||||
goto redo_accept;
|
||||
}
|
||||
ret = 0;
|
||||
goto end;
|
||||
} else if (ridx_filename) {
|
||||
ret = 0;
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -816,8 +783,6 @@ int MAIN(int argc, char **argv)
|
||||
store = setup_verify(bio_err, CAfile, CApath);
|
||||
if (!store)
|
||||
goto end;
|
||||
if (vpm)
|
||||
X509_STORE_set1_param(store, vpm);
|
||||
if (verify_certfile) {
|
||||
verify_other = load_certs(bio_err, verify_certfile, FORMAT_PEM,
|
||||
NULL, e, "validator certificate");
|
||||
@@ -832,38 +797,37 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
if (!noverify) {
|
||||
if (req && ((i = OCSP_check_nonce(req, bs)) <= 0)) {
|
||||
if (i == -1)
|
||||
BIO_printf(bio_err, "WARNING: no nonce in response\n");
|
||||
else {
|
||||
BIO_printf(bio_err, "Nonce Verify error\n");
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
i = OCSP_basic_verify(bs, verify_other, store, verify_flags);
|
||||
if (i < 0)
|
||||
i = OCSP_basic_verify(bs, NULL, store, 0);
|
||||
|
||||
if (i <= 0) {
|
||||
BIO_printf(bio_err, "Response Verify Failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
ret = 1;
|
||||
} else
|
||||
BIO_printf(bio_err, "Response verify OK\n");
|
||||
|
||||
}
|
||||
|
||||
if (!print_ocsp_summary(out, bs, req, reqnames, ids, nsec, maxage))
|
||||
ret = 1;
|
||||
goto end;
|
||||
|
||||
ret = 0;
|
||||
|
||||
end:
|
||||
ERR_print_errors(bio_err);
|
||||
X509_free(signer);
|
||||
X509_STORE_free(store);
|
||||
if (vpm)
|
||||
X509_VERIFY_PARAM_free(vpm);
|
||||
EVP_PKEY_free(key);
|
||||
EVP_PKEY_free(rkey);
|
||||
X509_free(issuer);
|
||||
@@ -1018,9 +982,8 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
|
||||
|
||||
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req,
|
||||
CA_DB *db, X509 *ca, X509 *rcert,
|
||||
EVP_PKEY *rkey, const EVP_MD *rmd,
|
||||
STACK_OF(X509) *rother, unsigned long flags,
|
||||
int nmin, int ndays, int badsig)
|
||||
EVP_PKEY *rkey, STACK_OF(X509) *rother,
|
||||
unsigned long flags, int nmin, int ndays)
|
||||
{
|
||||
ASN1_TIME *thisupd = NULL, *nextupd = NULL;
|
||||
OCSP_CERTID *cid, *ca_id = NULL;
|
||||
@@ -1104,10 +1067,7 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req,
|
||||
|
||||
OCSP_copy_nonce(bs, req);
|
||||
|
||||
OCSP_basic_sign(bs, rcert, rkey, rmd, rother, flags);
|
||||
|
||||
if (badsig)
|
||||
bs->signature->data[bs->signature->length - 1] ^= 0x1;
|
||||
OCSP_basic_sign(bs, rcert, rkey, NULL, rother, flags);
|
||||
|
||||
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs);
|
||||
|
||||
@@ -1143,7 +1103,7 @@ static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser)
|
||||
|
||||
/* Quick and dirty OCSP server: read in and parse input request */
|
||||
|
||||
static BIO *init_responder(const char *port)
|
||||
static BIO *init_responder(char *port)
|
||||
{
|
||||
BIO *acbio = NULL, *bufbio = NULL;
|
||||
bufbio = BIO_new(BIO_f_buffer());
|
||||
@@ -1175,7 +1135,7 @@ static BIO *init_responder(const char *port)
|
||||
}
|
||||
|
||||
static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio,
|
||||
const char *port)
|
||||
char *port)
|
||||
{
|
||||
int have_post = 0, len;
|
||||
OCSP_REQUEST *req = NULL;
|
||||
@@ -1236,8 +1196,8 @@ static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path,
|
||||
const STACK_OF(CONF_VALUE) *headers,
|
||||
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path,
|
||||
STACK_OF(CONF_VALUE) *headers,
|
||||
OCSP_REQUEST *req, int req_timeout)
|
||||
{
|
||||
int fd;
|
||||
@@ -1324,9 +1284,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path,
|
||||
}
|
||||
|
||||
OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
|
||||
const char *host, const char *path,
|
||||
const char *port, int use_ssl,
|
||||
const STACK_OF(CONF_VALUE) *headers,
|
||||
char *host, char *path, char *port,
|
||||
int use_ssl, STACK_OF(CONF_VALUE) *headers,
|
||||
int req_timeout)
|
||||
{
|
||||
BIO *cbio = NULL;
|
||||
@@ -1341,7 +1300,16 @@ OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
|
||||
BIO_set_conn_port(cbio, port);
|
||||
if (use_ssl == 1) {
|
||||
BIO *sbio;
|
||||
# if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||
ctx = SSL_CTX_new(SSLv23_client_method());
|
||||
# elif !defined(OPENSSL_NO_SSL3)
|
||||
ctx = SSL_CTX_new(SSLv3_client_method());
|
||||
# elif !defined(OPENSSL_NO_SSL2)
|
||||
ctx = SSL_CTX_new(SSLv2_client_method());
|
||||
# else
|
||||
BIO_printf(err, "SSL is disabled\n");
|
||||
goto end;
|
||||
# endif
|
||||
if (ctx == NULL) {
|
||||
BIO_printf(err, "Error creating SSL context.\n");
|
||||
goto end;
|
||||
|
||||
@@ -103,7 +103,7 @@ emailAddress = optional
|
||||
|
||||
####################################################################
|
||||
[ req ]
|
||||
default_bits = 2048
|
||||
default_bits = 1024
|
||||
default_keyfile = privkey.pem
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
|
||||
@@ -117,7 +117,6 @@
|
||||
#include "apps.h"
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/x509.h>
|
||||
@@ -131,9 +130,6 @@
|
||||
#include "progs.h"
|
||||
#include "s_apps.h"
|
||||
#include <openssl/err.h>
|
||||
#ifdef OPENSSL_FIPS
|
||||
# include <openssl/fips.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with
|
||||
@@ -308,19 +304,6 @@ int main(int Argc, char *ARGV[])
|
||||
CRYPTO_set_locking_callback(lock_dbg_cb);
|
||||
}
|
||||
|
||||
if (getenv("OPENSSL_FIPS")) {
|
||||
#ifdef OPENSSL_FIPS
|
||||
if (!FIPS_mode_set(1)) {
|
||||
ERR_load_crypto_strings();
|
||||
ERR_print_errors(BIO_new_fp(stderr, BIO_NOCLOSE));
|
||||
EXIT(1);
|
||||
}
|
||||
#else
|
||||
fprintf(stderr, "FIPS mode not supported.\n");
|
||||
EXIT(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
apps_startup();
|
||||
|
||||
/* Lets load up our environment a little */
|
||||
@@ -428,6 +411,9 @@ int main(int Argc, char *ARGV[])
|
||||
if (arg.data != NULL)
|
||||
OPENSSL_free(arg.data);
|
||||
|
||||
apps_shutdown();
|
||||
|
||||
CRYPTO_mem_leaks(bio_err);
|
||||
if (bio_err != NULL) {
|
||||
BIO_free(bio_err);
|
||||
bio_err = NULL;
|
||||
@@ -438,9 +424,6 @@ int main(int Argc, char *ARGV[])
|
||||
OPENSSL_free(Argv);
|
||||
}
|
||||
#endif
|
||||
apps_shutdown();
|
||||
CRYPTO_mem_leaks(bio_err);
|
||||
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ emailAddress = optional
|
||||
|
||||
####################################################################
|
||||
[ req ]
|
||||
default_bits = 2048
|
||||
default_bits = 1024
|
||||
default_keyfile = privkey.pem
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
|
||||
@@ -116,7 +116,7 @@ int MAIN(int argc, char **argv)
|
||||
int maciter = PKCS12_DEFAULT_ITER;
|
||||
int twopass = 0;
|
||||
int keytype = 0;
|
||||
int cert_pbe;
|
||||
int cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
int key_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
int ret = 1;
|
||||
int macver = 1;
|
||||
@@ -134,13 +134,6 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
apps_startup();
|
||||
|
||||
# ifdef OPENSSL_FIPS
|
||||
if (FIPS_mode())
|
||||
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
|
||||
else
|
||||
# endif
|
||||
cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
|
||||
|
||||
enc = EVP_des_ede3_cbc();
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
10
apps/pkcs8.c
10
apps/pkcs8.c
@@ -124,16 +124,6 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
} else
|
||||
badarg = 1;
|
||||
} else if (!strcmp(*args, "-v2prf")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
pbe_nid = OBJ_txt2nid(*args);
|
||||
if (!EVP_PBE_find(EVP_PBE_TYPE_PRF, pbe_nid, NULL, NULL, 0)) {
|
||||
BIO_printf(bio_err, "Unknown PRF algorithm %s\n", *args);
|
||||
badarg = 1;
|
||||
}
|
||||
} else
|
||||
badarg = 1;
|
||||
} else if (!strcmp(*args, "-inform")) {
|
||||
if (args[1]) {
|
||||
args++;
|
||||
|
||||
@@ -46,7 +46,6 @@ extern int engine_main(int argc, char *argv[]);
|
||||
extern int ocsp_main(int argc, char *argv[]);
|
||||
extern int prime_main(int argc, char *argv[]);
|
||||
extern int ts_main(int argc, char *argv[]);
|
||||
extern int srp_main(int argc, char *argv[]);
|
||||
|
||||
#define FUNC_TYPE_GENERAL 1
|
||||
#define FUNC_TYPE_MD 2
|
||||
@@ -148,9 +147,6 @@ FUNCTION functions[] = {
|
||||
#endif
|
||||
{FUNC_TYPE_GENERAL, "prime", prime_main},
|
||||
{FUNC_TYPE_GENERAL, "ts", ts_main},
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
{FUNC_TYPE_GENERAL, "srp", srp_main},
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_MD2
|
||||
{FUNC_TYPE_MD, "md2", dgst_main},
|
||||
#endif
|
||||
|
||||
@@ -51,8 +51,6 @@ foreach (@ARGV)
|
||||
{ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^ocsp$/))
|
||||
{ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
|
||||
elsif ( ($_ =~ /^srp$/))
|
||||
{ print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n"; }
|
||||
else
|
||||
{ print $str; }
|
||||
}
|
||||
|
||||
75
apps/req.c
75
apps/req.c
@@ -169,7 +169,7 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY_CTX *genctx = NULL;
|
||||
const char *keyalg = NULL;
|
||||
char *keyalgstr = NULL;
|
||||
STACK_OF(OPENSSL_STRING) *pkeyopts = NULL, *sigopts = NULL;
|
||||
STACK_OF(OPENSSL_STRING) *pkeyopts = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
int i = 0, badops = 0, newreq = 0, verbose = 0, pkey_type = -1;
|
||||
long newkey = -1;
|
||||
@@ -295,13 +295,6 @@ int MAIN(int argc, char **argv)
|
||||
pkeyopts = sk_OPENSSL_STRING_new_null();
|
||||
if (!pkeyopts || !sk_OPENSSL_STRING_push(pkeyopts, *(++argv)))
|
||||
goto bad;
|
||||
} else if (strcmp(*argv, "-sigopt") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
if (!sigopts)
|
||||
sigopts = sk_OPENSSL_STRING_new_null();
|
||||
if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv)))
|
||||
goto bad;
|
||||
} else if (strcmp(*argv, "-batch") == 0)
|
||||
batch = 1;
|
||||
else if (strcmp(*argv, "-newhdr") == 0)
|
||||
@@ -825,8 +818,7 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
i = do_X509_sign(bio_err, x509ss, pkey, digest, sigopts);
|
||||
if (!i) {
|
||||
if (!(i = X509_sign(x509ss, pkey, digest))) {
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -846,8 +838,7 @@ int MAIN(int argc, char **argv)
|
||||
req_exts);
|
||||
goto end;
|
||||
}
|
||||
i = do_X509_REQ_sign(bio_err, req, pkey, digest, sigopts);
|
||||
if (!i) {
|
||||
if (!(i = X509_REQ_sign(req, pkey, digest))) {
|
||||
ERR_print_errors(bio_err);
|
||||
goto end;
|
||||
}
|
||||
@@ -1028,8 +1019,6 @@ int MAIN(int argc, char **argv)
|
||||
EVP_PKEY_CTX_free(genctx);
|
||||
if (pkeyopts)
|
||||
sk_OPENSSL_STRING_free(pkeyopts);
|
||||
if (sigopts)
|
||||
sk_OPENSSL_STRING_free(sigopts);
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
if (gen_eng)
|
||||
ENGINE_free(gen_eng);
|
||||
@@ -1672,61 +1661,3 @@ static int genpkey_cb(EVP_PKEY_CTX *ctx)
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int do_sign_init(BIO *err, EVP_MD_CTX *ctx, EVP_PKEY *pkey,
|
||||
const EVP_MD *md, STACK_OF(OPENSSL_STRING) *sigopts)
|
||||
{
|
||||
EVP_PKEY_CTX *pkctx = NULL;
|
||||
int i;
|
||||
EVP_MD_CTX_init(ctx);
|
||||
if (!EVP_DigestSignInit(ctx, &pkctx, md, NULL, pkey))
|
||||
return 0;
|
||||
for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) {
|
||||
char *sigopt = sk_OPENSSL_STRING_value(sigopts, i);
|
||||
if (pkey_ctrl_string(pkctx, sigopt) <= 0) {
|
||||
BIO_printf(err, "parameter error \"%s\"\n", sigopt);
|
||||
ERR_print_errors(bio_err);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts)
|
||||
{
|
||||
int rv;
|
||||
EVP_MD_CTX mctx;
|
||||
EVP_MD_CTX_init(&mctx);
|
||||
rv = do_sign_init(err, &mctx, pkey, md, sigopts);
|
||||
if (rv > 0)
|
||||
rv = X509_sign_ctx(x, &mctx);
|
||||
EVP_MD_CTX_cleanup(&mctx);
|
||||
return rv > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts)
|
||||
{
|
||||
int rv;
|
||||
EVP_MD_CTX mctx;
|
||||
EVP_MD_CTX_init(&mctx);
|
||||
rv = do_sign_init(err, &mctx, pkey, md, sigopts);
|
||||
if (rv > 0)
|
||||
rv = X509_REQ_sign_ctx(x, &mctx);
|
||||
EVP_MD_CTX_cleanup(&mctx);
|
||||
return rv > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts)
|
||||
{
|
||||
int rv;
|
||||
EVP_MD_CTX mctx;
|
||||
EVP_MD_CTX_init(&mctx);
|
||||
rv = do_sign_init(err, &mctx, pkey, md, sigopts);
|
||||
if (rv > 0)
|
||||
rv = X509_CRL_sign_ctx(x, &mctx);
|
||||
EVP_MD_CTX_cleanup(&mctx);
|
||||
return rv > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
@@ -152,21 +152,15 @@ typedef fd_mask fd_set;
|
||||
#define PROTOCOL "tcp"
|
||||
|
||||
int do_server(int port, int type, int *ret,
|
||||
int (*cb) (char *hostname, int s, int stype,
|
||||
unsigned char *context), unsigned char *context,
|
||||
int naccept);
|
||||
int (*cb) (char *hostname, int s, unsigned char *context),
|
||||
unsigned char *context);
|
||||
#ifdef HEADER_X509_H
|
||||
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
|
||||
#endif
|
||||
#ifdef HEADER_SSL_H
|
||||
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
|
||||
int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
|
||||
STACK_OF(X509) *chain, int build_chain);
|
||||
int ssl_print_sigalgs(BIO *out, SSL *s);
|
||||
int ssl_print_point_formats(BIO *out, SSL *s);
|
||||
int ssl_print_curves(BIO *out, SSL *s, int noshared);
|
||||
int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key);
|
||||
#endif
|
||||
int ssl_print_tmp_key(BIO *out, SSL *s);
|
||||
int init_client(int *sock, char *server, int port, int type);
|
||||
int should_retry(int i);
|
||||
int extract_port(char *str, short *port_ptr);
|
||||
@@ -188,24 +182,3 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie,
|
||||
unsigned int *cookie_len);
|
||||
int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie,
|
||||
unsigned int cookie_len);
|
||||
|
||||
typedef struct ssl_excert_st SSL_EXCERT;
|
||||
|
||||
void ssl_ctx_set_excert(SSL_CTX *ctx, SSL_EXCERT *exc);
|
||||
void ssl_excert_free(SSL_EXCERT *exc);
|
||||
int args_excert(char ***pargs, int *pargc,
|
||||
int *badarg, BIO *err, SSL_EXCERT **pexc);
|
||||
int load_excert(SSL_EXCERT **pexc, BIO *err);
|
||||
void print_ssl_summary(BIO *bio, SSL *s);
|
||||
#ifdef HEADER_SSL_H
|
||||
int args_ssl(char ***pargs, int *pargc, SSL_CONF_CTX *cctx,
|
||||
int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr);
|
||||
int args_ssl_call(SSL_CTX *ctx, BIO *err, SSL_CONF_CTX *cctx,
|
||||
STACK_OF(OPENSSL_STRING) *str, int no_ecdhe, int no_jpake);
|
||||
int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls,
|
||||
int crl_download);
|
||||
int ssl_load_stores(SSL_CTX *ctx, const char *vfyCApath,
|
||||
const char *vfyCAfile, const char *chCApath,
|
||||
const char *chCAfile, STACK_OF(X509_CRL) *crls,
|
||||
int crl_download);
|
||||
#endif
|
||||
|
||||
857
apps/s_cb.c
857
apps/s_cb.c
@@ -125,7 +125,6 @@
|
||||
#define COOKIE_SECRET_LENGTH 16
|
||||
|
||||
int verify_depth = 0;
|
||||
int verify_quiet = 0;
|
||||
int verify_error = X509_V_OK;
|
||||
int verify_return_error = 0;
|
||||
unsigned char cookie_secret[COOKIE_SECRET_LENGTH];
|
||||
@@ -140,16 +139,13 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
|
||||
err = X509_STORE_CTX_get_error(ctx);
|
||||
depth = X509_STORE_CTX_get_error_depth(ctx);
|
||||
|
||||
if (!verify_quiet || !ok) {
|
||||
BIO_printf(bio_err, "depth=%d ", depth);
|
||||
if (err_cert) {
|
||||
X509_NAME_print_ex(bio_err,
|
||||
X509_get_subject_name(err_cert),
|
||||
0, XN_FLAG_ONELINE);
|
||||
BIO_puts(bio_err, "\n");
|
||||
} else
|
||||
BIO_puts(bio_err, "<no cert>\n");
|
||||
}
|
||||
BIO_printf(bio_err, "depth=%d ", depth);
|
||||
if (err_cert) {
|
||||
X509_NAME_print_ex(bio_err, X509_get_subject_name(err_cert),
|
||||
0, XN_FLAG_ONELINE);
|
||||
BIO_puts(bio_err, "\n");
|
||||
} else
|
||||
BIO_puts(bio_err, "<no cert>\n");
|
||||
if (!ok) {
|
||||
BIO_printf(bio_err, "verify error:num=%d:%s\n", err,
|
||||
X509_verify_cert_error_string(err));
|
||||
@@ -182,14 +178,13 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
|
||||
BIO_printf(bio_err, "\n");
|
||||
break;
|
||||
case X509_V_ERR_NO_EXPLICIT_POLICY:
|
||||
if (!verify_quiet)
|
||||
policies_print(bio_err, ctx);
|
||||
policies_print(bio_err, ctx);
|
||||
break;
|
||||
}
|
||||
if (err == X509_V_OK && ok == 2 && !verify_quiet)
|
||||
if (err == X509_V_OK && ok == 2)
|
||||
policies_print(bio_err, ctx);
|
||||
if (ok && !verify_quiet)
|
||||
BIO_printf(bio_err, "verify return:%d\n", ok);
|
||||
|
||||
BIO_printf(bio_err, "verify return:%d\n", ok);
|
||||
return (ok);
|
||||
}
|
||||
|
||||
@@ -250,10 +245,8 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
|
||||
return (1);
|
||||
}
|
||||
|
||||
int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
|
||||
STACK_OF(X509) *chain, int build_chain)
|
||||
int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key)
|
||||
{
|
||||
int chflags = chain ? SSL_BUILD_CHAIN_FLAG_CHECK : 0;
|
||||
if (cert == NULL)
|
||||
return 1;
|
||||
if (SSL_CTX_use_certificate(ctx, cert) <= 0) {
|
||||
@@ -261,7 +254,6 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
|
||||
ERR_print_errors(bio_err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (SSL_CTX_use_PrivateKey(ctx, key) <= 0) {
|
||||
BIO_printf(bio_err, "error setting private key\n");
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -276,258 +268,6 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
|
||||
"Private key does not match the certificate public key\n");
|
||||
return 0;
|
||||
}
|
||||
if (chain && !SSL_CTX_set1_chain(ctx, chain)) {
|
||||
BIO_printf(bio_err, "error setting certificate chain\n");
|
||||
ERR_print_errors(bio_err);
|
||||
return 0;
|
||||
}
|
||||
if (build_chain && !SSL_CTX_build_cert_chain(ctx, chflags)) {
|
||||
BIO_printf(bio_err, "error building certificate chain\n");
|
||||
ERR_print_errors(bio_err);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void ssl_print_client_cert_types(BIO *bio, SSL *s)
|
||||
{
|
||||
const unsigned char *p;
|
||||
int i;
|
||||
int cert_type_num = SSL_get0_certificate_types(s, &p);
|
||||
if (!cert_type_num)
|
||||
return;
|
||||
BIO_puts(bio, "Client Certificate Types: ");
|
||||
for (i = 0; i < cert_type_num; i++) {
|
||||
unsigned char cert_type = p[i];
|
||||
char *cname;
|
||||
switch (cert_type) {
|
||||
case TLS_CT_RSA_SIGN:
|
||||
cname = "RSA sign";
|
||||
break;
|
||||
|
||||
case TLS_CT_DSS_SIGN:
|
||||
cname = "DSA sign";
|
||||
break;
|
||||
|
||||
case TLS_CT_RSA_FIXED_DH:
|
||||
cname = "RSA fixed DH";
|
||||
break;
|
||||
|
||||
case TLS_CT_DSS_FIXED_DH:
|
||||
cname = "DSS fixed DH";
|
||||
break;
|
||||
|
||||
case TLS_CT_ECDSA_SIGN:
|
||||
cname = "ECDSA sign";
|
||||
break;
|
||||
|
||||
case TLS_CT_RSA_FIXED_ECDH:
|
||||
cname = "RSA fixed ECDH";
|
||||
break;
|
||||
|
||||
case TLS_CT_ECDSA_FIXED_ECDH:
|
||||
cname = "ECDSA fixed ECDH";
|
||||
break;
|
||||
|
||||
case TLS_CT_GOST94_SIGN:
|
||||
cname = "GOST94 Sign";
|
||||
break;
|
||||
|
||||
case TLS_CT_GOST01_SIGN:
|
||||
cname = "GOST01 Sign";
|
||||
break;
|
||||
|
||||
default:
|
||||
cname = NULL;
|
||||
}
|
||||
|
||||
if (i)
|
||||
BIO_puts(bio, ", ");
|
||||
|
||||
if (cname)
|
||||
BIO_puts(bio, cname);
|
||||
else
|
||||
BIO_printf(bio, "UNKNOWN (%d),", cert_type);
|
||||
}
|
||||
BIO_puts(bio, "\n");
|
||||
}
|
||||
|
||||
static int do_print_sigalgs(BIO *out, SSL *s, int shared)
|
||||
{
|
||||
int i, nsig, client;
|
||||
client = SSL_is_server(s) ? 0 : 1;
|
||||
if (shared)
|
||||
nsig = SSL_get_shared_sigalgs(s, -1, NULL, NULL, NULL, NULL, NULL);
|
||||
else
|
||||
nsig = SSL_get_sigalgs(s, -1, NULL, NULL, NULL, NULL, NULL);
|
||||
if (nsig == 0)
|
||||
return 1;
|
||||
|
||||
if (shared)
|
||||
BIO_puts(out, "Shared ");
|
||||
|
||||
if (client)
|
||||
BIO_puts(out, "Requested ");
|
||||
BIO_puts(out, "Signature Algorithms: ");
|
||||
for (i = 0; i < nsig; i++) {
|
||||
int hash_nid, sign_nid;
|
||||
unsigned char rhash, rsign;
|
||||
const char *sstr = NULL;
|
||||
if (shared)
|
||||
SSL_get_shared_sigalgs(s, i, &sign_nid, &hash_nid, NULL,
|
||||
&rsign, &rhash);
|
||||
else
|
||||
SSL_get_sigalgs(s, i, &sign_nid, &hash_nid, NULL, &rsign, &rhash);
|
||||
if (i)
|
||||
BIO_puts(out, ":");
|
||||
if (sign_nid == EVP_PKEY_RSA)
|
||||
sstr = "RSA";
|
||||
else if (sign_nid == EVP_PKEY_DSA)
|
||||
sstr = "DSA";
|
||||
else if (sign_nid == EVP_PKEY_EC)
|
||||
sstr = "ECDSA";
|
||||
if (sstr)
|
||||
BIO_printf(out, "%s+", sstr);
|
||||
else
|
||||
BIO_printf(out, "0x%02X+", (int)rsign);
|
||||
if (hash_nid != NID_undef)
|
||||
BIO_printf(out, "%s", OBJ_nid2sn(hash_nid));
|
||||
else
|
||||
BIO_printf(out, "0x%02X", (int)rhash);
|
||||
}
|
||||
BIO_puts(out, "\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ssl_print_sigalgs(BIO *out, SSL *s)
|
||||
{
|
||||
int mdnid;
|
||||
if (!SSL_is_server(s))
|
||||
ssl_print_client_cert_types(out, s);
|
||||
do_print_sigalgs(out, s, 0);
|
||||
do_print_sigalgs(out, s, 1);
|
||||
if (SSL_get_peer_signature_nid(s, &mdnid))
|
||||
BIO_printf(out, "Peer signing digest: %s\n", OBJ_nid2sn(mdnid));
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_EC
|
||||
int ssl_print_point_formats(BIO *out, SSL *s)
|
||||
{
|
||||
int i, nformats;
|
||||
const char *pformats;
|
||||
nformats = SSL_get0_ec_point_formats(s, &pformats);
|
||||
if (nformats <= 0)
|
||||
return 1;
|
||||
BIO_puts(out, "Supported Elliptic Curve Point Formats: ");
|
||||
for (i = 0; i < nformats; i++, pformats++) {
|
||||
if (i)
|
||||
BIO_puts(out, ":");
|
||||
switch (*pformats) {
|
||||
case TLSEXT_ECPOINTFORMAT_uncompressed:
|
||||
BIO_puts(out, "uncompressed");
|
||||
break;
|
||||
|
||||
case TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime:
|
||||
BIO_puts(out, "ansiX962_compressed_prime");
|
||||
break;
|
||||
|
||||
case TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2:
|
||||
BIO_puts(out, "ansiX962_compressed_char2");
|
||||
break;
|
||||
|
||||
default:
|
||||
BIO_printf(out, "unknown(%d)", (int)*pformats);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
if (nformats <= 0)
|
||||
BIO_puts(out, "NONE");
|
||||
BIO_puts(out, "\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ssl_print_curves(BIO *out, SSL *s, int noshared)
|
||||
{
|
||||
int i, ncurves, *curves, nid;
|
||||
const char *cname;
|
||||
ncurves = SSL_get1_curves(s, NULL);
|
||||
if (ncurves <= 0)
|
||||
return 1;
|
||||
curves = OPENSSL_malloc(ncurves * sizeof(int));
|
||||
SSL_get1_curves(s, curves);
|
||||
|
||||
BIO_puts(out, "Supported Elliptic Curves: ");
|
||||
for (i = 0; i < ncurves; i++) {
|
||||
if (i)
|
||||
BIO_puts(out, ":");
|
||||
nid = curves[i];
|
||||
/* If unrecognised print out hex version */
|
||||
if (nid & TLSEXT_nid_unknown)
|
||||
BIO_printf(out, "0x%04X", nid & 0xFFFF);
|
||||
else {
|
||||
/* Use NIST name for curve if it exists */
|
||||
cname = EC_curve_nid2nist(nid);
|
||||
if (!cname)
|
||||
cname = OBJ_nid2sn(nid);
|
||||
BIO_printf(out, "%s", cname);
|
||||
}
|
||||
}
|
||||
if (ncurves == 0)
|
||||
BIO_puts(out, "NONE");
|
||||
OPENSSL_free(curves);
|
||||
if (noshared) {
|
||||
BIO_puts(out, "\n");
|
||||
return 1;
|
||||
}
|
||||
BIO_puts(out, "\nShared Elliptic curves: ");
|
||||
ncurves = SSL_get_shared_curve(s, -1);
|
||||
for (i = 0; i < ncurves; i++) {
|
||||
if (i)
|
||||
BIO_puts(out, ":");
|
||||
nid = SSL_get_shared_curve(s, i);
|
||||
cname = EC_curve_nid2nist(nid);
|
||||
if (!cname)
|
||||
cname = OBJ_nid2sn(nid);
|
||||
BIO_printf(out, "%s", cname);
|
||||
}
|
||||
if (ncurves == 0)
|
||||
BIO_puts(out, "NONE");
|
||||
BIO_puts(out, "\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
int ssl_print_tmp_key(BIO *out, SSL *s)
|
||||
{
|
||||
EVP_PKEY *key;
|
||||
if (!SSL_get_server_tmp_key(s, &key))
|
||||
return 1;
|
||||
BIO_puts(out, "Server Temp Key: ");
|
||||
switch (EVP_PKEY_id(key)) {
|
||||
case EVP_PKEY_RSA:
|
||||
BIO_printf(out, "RSA, %d bits\n", EVP_PKEY_bits(key));
|
||||
break;
|
||||
|
||||
case EVP_PKEY_DH:
|
||||
BIO_printf(out, "DH, %d bits\n", EVP_PKEY_bits(key));
|
||||
break;
|
||||
#ifndef OPENSSL_NO_ECDH
|
||||
case EVP_PKEY_EC:
|
||||
{
|
||||
EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
|
||||
int nid;
|
||||
const char *cname;
|
||||
nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec));
|
||||
EC_KEY_free(ec);
|
||||
cname = EC_curve_nid2nist(nid);
|
||||
if (!cname)
|
||||
cname = OBJ_nid2sn(nid);
|
||||
BIO_printf(out, "ECDH, %s, %d bits\n", cname, EVP_PKEY_bits(key));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
EVP_PKEY_free(key);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -605,12 +345,6 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type,
|
||||
case TLS1_VERSION:
|
||||
str_version = "TLS 1.0 ";
|
||||
break;
|
||||
case TLS1_1_VERSION:
|
||||
str_version = "TLS 1.1 ";
|
||||
break;
|
||||
case TLS1_2_VERSION:
|
||||
str_version = "TLS 1.2 ";
|
||||
break;
|
||||
case DTLS1_VERSION:
|
||||
str_version = "DTLS 1.0 ";
|
||||
break;
|
||||
@@ -681,8 +415,6 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type,
|
||||
|
||||
if (version == SSL3_VERSION ||
|
||||
version == TLS1_VERSION ||
|
||||
version == TLS1_1_VERSION ||
|
||||
version == TLS1_2_VERSION ||
|
||||
version == DTLS1_VERSION || version == DTLS1_BAD_VER) {
|
||||
switch (content_type) {
|
||||
case 20:
|
||||
@@ -795,9 +527,6 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type,
|
||||
case 114:
|
||||
str_details2 = " bad_certificate_hash_value";
|
||||
break;
|
||||
case 115:
|
||||
str_details2 = " unknown_psk_identity";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -843,22 +572,6 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type,
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef OPENSSL_NO_HEARTBEATS
|
||||
if (content_type == 24) { /* Heartbeat */
|
||||
str_details1 = ", Heartbeat";
|
||||
|
||||
if (len > 0) {
|
||||
switch (((const unsigned char *)buf)[0]) {
|
||||
case 1:
|
||||
str_details1 = ", HeartbeatRequest";
|
||||
break;
|
||||
case 2:
|
||||
str_details1 = ", HeartbeatResponse";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
BIO_printf(bio, "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version,
|
||||
@@ -917,22 +630,6 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||
extname = "status request";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_user_mapping:
|
||||
extname = "user mapping";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_client_authz:
|
||||
extname = "client authz";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_server_authz:
|
||||
extname = "server authz";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_cert_type:
|
||||
extname = "cert type";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_elliptic_curves:
|
||||
extname = "elliptic curves";
|
||||
break;
|
||||
@@ -941,28 +638,12 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||
extname = "EC point formats";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_srp:
|
||||
extname = "SRP";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_signature_algorithms:
|
||||
extname = "signature algorithms";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_use_srtp:
|
||||
extname = "use SRTP";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_heartbeat:
|
||||
extname = "heartbeat";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_session_ticket:
|
||||
extname = "session ticket";
|
||||
extname = "server ticket";
|
||||
break;
|
||||
|
||||
case TLSEXT_TYPE_renegotiate:
|
||||
extname = "renegotiation info";
|
||||
extname = "renegotiate";
|
||||
break;
|
||||
|
||||
#ifdef TLSEXT_TYPE_opaque_prf_input
|
||||
@@ -970,15 +651,6 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
|
||||
extname = "opaque PRF input";
|
||||
break;
|
||||
#endif
|
||||
#ifdef TLSEXT_TYPE_next_proto_neg
|
||||
case TLSEXT_TYPE_next_proto_neg:
|
||||
extname = "next protocol";
|
||||
break;
|
||||
#endif
|
||||
|
||||
case TLSEXT_TYPE_padding:
|
||||
extname = "TLS padding";
|
||||
break;
|
||||
|
||||
default:
|
||||
extname = "unknown";
|
||||
@@ -1143,504 +815,3 @@ int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Example of extended certificate handling. Where the standard support of
|
||||
* one certificate per algorithm is not sufficient an application can decide
|
||||
* which certificate(s) to use at runtime based on whatever criteria it deems
|
||||
* appropriate.
|
||||
*/
|
||||
|
||||
/* Linked list of certificates, keys and chains */
|
||||
struct ssl_excert_st {
|
||||
int certform;
|
||||
const char *certfile;
|
||||
int keyform;
|
||||
const char *keyfile;
|
||||
const char *chainfile;
|
||||
X509 *cert;
|
||||
EVP_PKEY *key;
|
||||
STACK_OF(X509) *chain;
|
||||
int build_chain;
|
||||
struct ssl_excert_st *next, *prev;
|
||||
};
|
||||
|
||||
struct chain_flags {
|
||||
int flag;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct chain_flags chain_flags_list[] = {
|
||||
{CERT_PKEY_VALID, "Overall Validity"},
|
||||
{CERT_PKEY_SIGN, "Sign with EE key"},
|
||||
{CERT_PKEY_EE_SIGNATURE, "EE signature"},
|
||||
{CERT_PKEY_CA_SIGNATURE, "CA signature"},
|
||||
{CERT_PKEY_EE_PARAM, "EE key parameters"},
|
||||
{CERT_PKEY_CA_PARAM, "CA key parameters"},
|
||||
{CERT_PKEY_EXPLICIT_SIGN, "Explicity sign with EE key"},
|
||||
{CERT_PKEY_ISSUER_NAME, "Issuer Name"},
|
||||
{CERT_PKEY_CERT_TYPE, "Certificate Type"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static void print_chain_flags(BIO *out, SSL *s, int flags)
|
||||
{
|
||||
struct chain_flags *ctmp = chain_flags_list;
|
||||
while (ctmp->name) {
|
||||
BIO_printf(out, "\t%s: %s\n", ctmp->name,
|
||||
flags & ctmp->flag ? "OK" : "NOT OK");
|
||||
ctmp++;
|
||||
}
|
||||
BIO_printf(out, "\tSuite B: ");
|
||||
if (SSL_set_cert_flags(s, 0) & SSL_CERT_FLAG_SUITEB_128_LOS)
|
||||
BIO_puts(out, flags & CERT_PKEY_SUITEB ? "OK\n" : "NOT OK\n");
|
||||
else
|
||||
BIO_printf(out, "not tested\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Very basic selection callback: just use any certificate chain reported as
|
||||
* valid. More sophisticated could prioritise according to local policy.
|
||||
*/
|
||||
static int set_cert_cb(SSL *ssl, void *arg)
|
||||
{
|
||||
int i, rv;
|
||||
SSL_EXCERT *exc = arg;
|
||||
#ifdef CERT_CB_TEST_RETRY
|
||||
static int retry_cnt;
|
||||
if (retry_cnt < 5) {
|
||||
retry_cnt++;
|
||||
fprintf(stderr, "Certificate callback retry test: count %d\n",
|
||||
retry_cnt);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
SSL_certs_clear(ssl);
|
||||
|
||||
if (!exc)
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* Go to end of list and traverse backwards since we prepend newer
|
||||
* entries this retains the original order.
|
||||
*/
|
||||
while (exc->next)
|
||||
exc = exc->next;
|
||||
|
||||
i = 0;
|
||||
|
||||
while (exc) {
|
||||
i++;
|
||||
rv = SSL_check_chain(ssl, exc->cert, exc->key, exc->chain);
|
||||
BIO_printf(bio_err, "Checking cert chain %d:\nSubject: ", i);
|
||||
X509_NAME_print_ex(bio_err, X509_get_subject_name(exc->cert), 0,
|
||||
XN_FLAG_ONELINE);
|
||||
BIO_puts(bio_err, "\n");
|
||||
|
||||
print_chain_flags(bio_err, ssl, rv);
|
||||
if (rv & CERT_PKEY_VALID) {
|
||||
SSL_use_certificate(ssl, exc->cert);
|
||||
SSL_use_PrivateKey(ssl, exc->key);
|
||||
/*
|
||||
* NB: we wouldn't normally do this as it is not efficient
|
||||
* building chains on each connection better to cache the chain
|
||||
* in advance.
|
||||
*/
|
||||
if (exc->build_chain) {
|
||||
if (!SSL_build_cert_chain(ssl, 0))
|
||||
return 0;
|
||||
} else if (exc->chain)
|
||||
SSL_set1_chain(ssl, exc->chain);
|
||||
}
|
||||
exc = exc->prev;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ssl_ctx_set_excert(SSL_CTX *ctx, SSL_EXCERT *exc)
|
||||
{
|
||||
SSL_CTX_set_cert_cb(ctx, set_cert_cb, exc);
|
||||
}
|
||||
|
||||
static int ssl_excert_prepend(SSL_EXCERT **pexc)
|
||||
{
|
||||
SSL_EXCERT *exc;
|
||||
exc = OPENSSL_malloc(sizeof(SSL_EXCERT));
|
||||
if (!exc)
|
||||
return 0;
|
||||
exc->certfile = NULL;
|
||||
exc->keyfile = NULL;
|
||||
exc->chainfile = NULL;
|
||||
exc->cert = NULL;
|
||||
exc->key = NULL;
|
||||
exc->chain = NULL;
|
||||
exc->prev = NULL;
|
||||
exc->build_chain = 0;
|
||||
|
||||
exc->next = *pexc;
|
||||
*pexc = exc;
|
||||
|
||||
if (exc->next) {
|
||||
exc->certform = exc->next->certform;
|
||||
exc->keyform = exc->next->keyform;
|
||||
exc->next->prev = exc;
|
||||
} else {
|
||||
exc->certform = FORMAT_PEM;
|
||||
exc->keyform = FORMAT_PEM;
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
void ssl_excert_free(SSL_EXCERT *exc)
|
||||
{
|
||||
SSL_EXCERT *curr;
|
||||
while (exc) {
|
||||
if (exc->cert)
|
||||
X509_free(exc->cert);
|
||||
if (exc->key)
|
||||
EVP_PKEY_free(exc->key);
|
||||
if (exc->chain)
|
||||
sk_X509_pop_free(exc->chain, X509_free);
|
||||
curr = exc;
|
||||
exc = exc->next;
|
||||
OPENSSL_free(curr);
|
||||
}
|
||||
}
|
||||
|
||||
int load_excert(SSL_EXCERT **pexc, BIO *err)
|
||||
{
|
||||
SSL_EXCERT *exc = *pexc;
|
||||
if (!exc)
|
||||
return 1;
|
||||
/* If nothing in list, free and set to NULL */
|
||||
if (!exc->certfile && !exc->next) {
|
||||
ssl_excert_free(exc);
|
||||
*pexc = NULL;
|
||||
return 1;
|
||||
}
|
||||
for (; exc; exc = exc->next) {
|
||||
if (!exc->certfile) {
|
||||
BIO_printf(err, "Missing filename\n");
|
||||
return 0;
|
||||
}
|
||||
exc->cert = load_cert(err, exc->certfile, exc->certform,
|
||||
NULL, NULL, "Server Certificate");
|
||||
if (!exc->cert)
|
||||
return 0;
|
||||
if (exc->keyfile) {
|
||||
exc->key = load_key(err, exc->keyfile, exc->keyform,
|
||||
0, NULL, NULL, "Server Key");
|
||||
} else {
|
||||
exc->key = load_key(err, exc->certfile, exc->certform,
|
||||
0, NULL, NULL, "Server Key");
|
||||
}
|
||||
if (!exc->key)
|
||||
return 0;
|
||||
if (exc->chainfile) {
|
||||
exc->chain = load_certs(err,
|
||||
exc->chainfile, FORMAT_PEM,
|
||||
NULL, NULL, "Server Chain");
|
||||
if (!exc->chain)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int args_excert(char ***pargs, int *pargc,
|
||||
int *badarg, BIO *err, SSL_EXCERT **pexc)
|
||||
{
|
||||
char *arg = **pargs, *argn = (*pargs)[1];
|
||||
SSL_EXCERT *exc = *pexc;
|
||||
int narg = 2;
|
||||
if (!exc) {
|
||||
if (ssl_excert_prepend(&exc))
|
||||
*pexc = exc;
|
||||
else {
|
||||
BIO_printf(err, "Error initialising xcert\n");
|
||||
*badarg = 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
if (strcmp(arg, "-xcert") == 0) {
|
||||
if (!argn) {
|
||||
*badarg = 1;
|
||||
return 1;
|
||||
}
|
||||
if (exc->certfile && !ssl_excert_prepend(&exc)) {
|
||||
BIO_printf(err, "Error adding xcert\n");
|
||||
*badarg = 1;
|
||||
goto err;
|
||||
}
|
||||
exc->certfile = argn;
|
||||
} else if (strcmp(arg, "-xkey") == 0) {
|
||||
if (!argn) {
|
||||
*badarg = 1;
|
||||
return 1;
|
||||
}
|
||||
if (exc->keyfile) {
|
||||
BIO_printf(err, "Key already specified\n");
|
||||
*badarg = 1;
|
||||
return 1;
|
||||
}
|
||||
exc->keyfile = argn;
|
||||
} else if (strcmp(arg, "-xchain") == 0) {
|
||||
if (!argn) {
|
||||
*badarg = 1;
|
||||
return 1;
|
||||
}
|
||||
if (exc->chainfile) {
|
||||
BIO_printf(err, "Chain already specified\n");
|
||||
*badarg = 1;
|
||||
return 1;
|
||||
}
|
||||
exc->chainfile = argn;
|
||||
} else if (strcmp(arg, "-xchain_build") == 0) {
|
||||
narg = 1;
|
||||
exc->build_chain = 1;
|
||||
} else if (strcmp(arg, "-xcertform") == 0) {
|
||||
if (!argn) {
|
||||
*badarg = 1;
|
||||
goto err;
|
||||
}
|
||||
exc->certform = str2fmt(argn);
|
||||
} else if (strcmp(arg, "-xkeyform") == 0) {
|
||||
if (!argn) {
|
||||
*badarg = 1;
|
||||
goto err;
|
||||
}
|
||||
exc->keyform = str2fmt(argn);
|
||||
} else
|
||||
return 0;
|
||||
|
||||
(*pargs) += narg;
|
||||
|
||||
if (pargc)
|
||||
*pargc -= narg;
|
||||
|
||||
*pexc = exc;
|
||||
|
||||
return 1;
|
||||
|
||||
err:
|
||||
ERR_print_errors(err);
|
||||
ssl_excert_free(exc);
|
||||
*pexc = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void print_raw_cipherlist(BIO *bio, SSL *s)
|
||||
{
|
||||
const unsigned char *rlist;
|
||||
static const unsigned char scsv_id[] = { 0, 0, 0xFF };
|
||||
size_t i, rlistlen, num;
|
||||
if (!SSL_is_server(s))
|
||||
return;
|
||||
num = SSL_get0_raw_cipherlist(s, NULL);
|
||||
rlistlen = SSL_get0_raw_cipherlist(s, &rlist);
|
||||
BIO_puts(bio, "Client cipher list: ");
|
||||
for (i = 0; i < rlistlen; i += num, rlist += num) {
|
||||
const SSL_CIPHER *c = SSL_CIPHER_find(s, rlist);
|
||||
if (i)
|
||||
BIO_puts(bio, ":");
|
||||
if (c)
|
||||
BIO_puts(bio, SSL_CIPHER_get_name(c));
|
||||
else if (!memcmp(rlist, scsv_id - num + 3, num))
|
||||
BIO_puts(bio, "SCSV");
|
||||
else {
|
||||
size_t j;
|
||||
BIO_puts(bio, "0x");
|
||||
for (j = 0; j < num; j++)
|
||||
BIO_printf(bio, "%02X", rlist[j]);
|
||||
}
|
||||
}
|
||||
BIO_puts(bio, "\n");
|
||||
}
|
||||
|
||||
void print_ssl_summary(BIO *bio, SSL *s)
|
||||
{
|
||||
const SSL_CIPHER *c;
|
||||
X509 *peer;
|
||||
/*
|
||||
* const char *pnam = SSL_is_server(s) ? "client" : "server";
|
||||
*/
|
||||
BIO_printf(bio, "Protocol version: %s\n", SSL_get_version(s));
|
||||
print_raw_cipherlist(bio, s);
|
||||
c = SSL_get_current_cipher(s);
|
||||
BIO_printf(bio, "Ciphersuite: %s\n", SSL_CIPHER_get_name(c));
|
||||
do_print_sigalgs(bio, s, 0);
|
||||
peer = SSL_get_peer_certificate(s);
|
||||
if (peer) {
|
||||
int nid;
|
||||
BIO_puts(bio, "Peer certificate: ");
|
||||
X509_NAME_print_ex(bio, X509_get_subject_name(peer),
|
||||
0, XN_FLAG_ONELINE);
|
||||
BIO_puts(bio, "\n");
|
||||
if (SSL_get_peer_signature_nid(s, &nid))
|
||||
BIO_printf(bio, "Hash used: %s\n", OBJ_nid2sn(nid));
|
||||
} else
|
||||
BIO_puts(bio, "No peer certificate\n");
|
||||
if (peer)
|
||||
X509_free(peer);
|
||||
#ifndef OPENSSL_NO_EC
|
||||
ssl_print_point_formats(bio, s);
|
||||
if (SSL_is_server(s))
|
||||
ssl_print_curves(bio, s, 1);
|
||||
else
|
||||
ssl_print_tmp_key(bio, s);
|
||||
#else
|
||||
if (!SSL_is_server(s))
|
||||
ssl_print_tmp_key(bio, s);
|
||||
#endif
|
||||
}
|
||||
|
||||
int args_ssl(char ***pargs, int *pargc, SSL_CONF_CTX *cctx,
|
||||
int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr)
|
||||
{
|
||||
char *arg = **pargs, *argn = (*pargs)[1];
|
||||
int rv;
|
||||
|
||||
/* Attempt to run SSL configuration command */
|
||||
rv = SSL_CONF_cmd_argv(cctx, pargc, pargs);
|
||||
/* If parameter not recognised just return */
|
||||
if (rv == 0)
|
||||
return 0;
|
||||
/* see if missing argument error */
|
||||
if (rv == -3) {
|
||||
BIO_printf(err, "%s needs an argument\n", arg);
|
||||
*badarg = 1;
|
||||
goto end;
|
||||
}
|
||||
/* Check for some other error */
|
||||
if (rv < 0) {
|
||||
BIO_printf(err, "Error with command: \"%s %s\"\n",
|
||||
arg, argn ? argn : "");
|
||||
*badarg = 1;
|
||||
goto end;
|
||||
}
|
||||
/* Store command and argument */
|
||||
/* If only one argument processed store value as NULL */
|
||||
if (rv == 1)
|
||||
argn = NULL;
|
||||
if (!*pstr)
|
||||
*pstr = sk_OPENSSL_STRING_new_null();
|
||||
if (!*pstr || !sk_OPENSSL_STRING_push(*pstr, arg) ||
|
||||
!sk_OPENSSL_STRING_push(*pstr, argn)) {
|
||||
BIO_puts(err, "Memory allocation failure\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
if (*badarg)
|
||||
ERR_print_errors(err);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int args_ssl_call(SSL_CTX *ctx, BIO *err, SSL_CONF_CTX *cctx,
|
||||
STACK_OF(OPENSSL_STRING) *str, int no_ecdhe, int no_jpake)
|
||||
{
|
||||
int i;
|
||||
SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
|
||||
for (i = 0; i < sk_OPENSSL_STRING_num(str); i += 2) {
|
||||
const char *param = sk_OPENSSL_STRING_value(str, i);
|
||||
const char *value = sk_OPENSSL_STRING_value(str, i + 1);
|
||||
/*
|
||||
* If no_ecdhe or named curve already specified don't need a default.
|
||||
*/
|
||||
if (!no_ecdhe && !strcmp(param, "-named_curve"))
|
||||
no_ecdhe = 1;
|
||||
#ifndef OPENSSL_NO_JPAKE
|
||||
if (!no_jpake && !strcmp(param, "-cipher")) {
|
||||
BIO_puts(err, "JPAKE sets cipher to PSK\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
if (SSL_CONF_cmd(cctx, param, value) <= 0) {
|
||||
BIO_printf(err, "Error with command: \"%s %s\"\n",
|
||||
param, value ? value : "");
|
||||
ERR_print_errors(err);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* This is a special case to keep existing s_server functionality: if we
|
||||
* don't have any curve specified *and* we haven't disabled ECDHE then
|
||||
* use P-256.
|
||||
*/
|
||||
if (!no_ecdhe) {
|
||||
if (SSL_CONF_cmd(cctx, "-named_curve", "P-256") <= 0) {
|
||||
BIO_puts(err, "Error setting EC curve\n");
|
||||
ERR_print_errors(err);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#ifndef OPENSSL_NO_JPAKE
|
||||
if (!no_jpake) {
|
||||
if (SSL_CONF_cmd(cctx, "-cipher", "PSK") <= 0) {
|
||||
BIO_puts(err, "Error setting cipher to PSK\n");
|
||||
ERR_print_errors(err);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!SSL_CONF_CTX_finish(cctx)) {
|
||||
BIO_puts(err, "Error finishing context\n");
|
||||
ERR_print_errors(err);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int add_crls_store(X509_STORE *st, STACK_OF(X509_CRL) *crls)
|
||||
{
|
||||
X509_CRL *crl;
|
||||
int i;
|
||||
for (i = 0; i < sk_X509_CRL_num(crls); i++) {
|
||||
crl = sk_X509_CRL_value(crls, i);
|
||||
X509_STORE_add_crl(st, crl);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls, int crl_download)
|
||||
{
|
||||
X509_STORE *st;
|
||||
st = SSL_CTX_get_cert_store(ctx);
|
||||
add_crls_store(st, crls);
|
||||
if (crl_download)
|
||||
store_setup_crl_download(st);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ssl_load_stores(SSL_CTX *ctx,
|
||||
const char *vfyCApath, const char *vfyCAfile,
|
||||
const char *chCApath, const char *chCAfile,
|
||||
STACK_OF(X509_CRL) *crls, int crl_download)
|
||||
{
|
||||
X509_STORE *vfy = NULL, *ch = NULL;
|
||||
int rv = 0;
|
||||
if (vfyCApath || vfyCAfile) {
|
||||
vfy = X509_STORE_new();
|
||||
if (!X509_STORE_load_locations(vfy, vfyCAfile, vfyCApath))
|
||||
goto err;
|
||||
add_crls_store(vfy, crls);
|
||||
SSL_CTX_set1_verify_cert_store(ctx, vfy);
|
||||
if (crl_download)
|
||||
store_setup_crl_download(vfy);
|
||||
}
|
||||
if (chCApath || chCAfile) {
|
||||
ch = X509_STORE_new();
|
||||
if (!X509_STORE_load_locations(ch, chCAfile, chCApath))
|
||||
goto err;
|
||||
SSL_CTX_set1_chain_cert_store(ctx, ch);
|
||||
}
|
||||
rv = 1;
|
||||
err:
|
||||
if (vfy)
|
||||
X509_STORE_free(vfy);
|
||||
if (ch)
|
||||
X509_STORE_free(ch);
|
||||
return rv;
|
||||
}
|
||||
|
||||
722
apps/s_client.c
722
apps/s_client.c
File diff suppressed because it is too large
Load Diff
1113
apps/s_server.c
1113
apps/s_server.c
File diff suppressed because it is too large
Load Diff
@@ -235,10 +235,10 @@ int init_client(int *sock, char *host, int port, int type)
|
||||
{
|
||||
unsigned char ip[4];
|
||||
|
||||
memset(ip, '\0', sizeof ip);
|
||||
if (!host_ip(host, &(ip[0])))
|
||||
return 0;
|
||||
return init_client_ip(sock, ip, port, type);
|
||||
if (!host_ip(host, &(ip[0]))) {
|
||||
return (0);
|
||||
}
|
||||
return (init_client_ip(sock, ip, port, type));
|
||||
}
|
||||
|
||||
static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
|
||||
@@ -290,9 +290,8 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
|
||||
}
|
||||
|
||||
int do_server(int port, int type, int *ret,
|
||||
int (*cb) (char *hostname, int s, int stype,
|
||||
unsigned char *context), unsigned char *context,
|
||||
int naccept)
|
||||
int (*cb) (char *hostname, int s, unsigned char *context),
|
||||
unsigned char *context)
|
||||
{
|
||||
int sock;
|
||||
char *name = NULL;
|
||||
@@ -314,14 +313,12 @@ int do_server(int port, int type, int *ret,
|
||||
}
|
||||
} else
|
||||
sock = accept_socket;
|
||||
i = (*cb) (name, sock, type, context);
|
||||
i = (*cb) (name, sock, context);
|
||||
if (name != NULL)
|
||||
OPENSSL_free(name);
|
||||
if (type == SOCK_STREAM)
|
||||
SHUTDOWN2(sock);
|
||||
if (naccept != -1)
|
||||
naccept--;
|
||||
if (i < 0 || naccept == 0) {
|
||||
if (i < 0) {
|
||||
SHUTDOWN2(accept_socket);
|
||||
return (i);
|
||||
}
|
||||
|
||||
@@ -357,7 +357,13 @@ int MAIN(int argc, char **argv)
|
||||
if (bio_err == NULL)
|
||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
|
||||
#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
|
||||
s_time_meth = SSLv23_client_method();
|
||||
#elif !defined(OPENSSL_NO_SSL3)
|
||||
s_time_meth = SSLv3_client_method();
|
||||
#elif !defined(OPENSSL_NO_SSL2)
|
||||
s_time_meth = SSLv2_client_method();
|
||||
#endif
|
||||
|
||||
/* parse the command line arguments */
|
||||
if (parseArgs(argc, argv) < 0)
|
||||
|
||||
413
apps/server.pem
413
apps/server.pem
@@ -1,52 +1,369 @@
|
||||
subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Server Cert
|
||||
issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA
|
||||
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)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID5zCCAs+gAwIBAgIJALnu1NlVpZ6zMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
||||
BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT
|
||||
VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt
|
||||
ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZDELMAkG
|
||||
A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU
|
||||
RVNUSU5HIFBVUlBPU0VTIE9OTFkxGTAXBgNVBAMMEFRlc3QgU2VydmVyIENlcnQw
|
||||
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDzhPOSNtyyRspmeuUpxfNJ
|
||||
KCLTuf7g3uQ4zu4iHOmRO5TQci+HhVlLZrHF9XqFXcIP0y4pWDbMSGuiorUmzmfi
|
||||
R7bfSdI/+qIQt8KXRH6HNG1t8ou0VSvWId5TS5Dq/er5ODUr9OaaDva7EquHIcMv
|
||||
vPQGuI+OEAcnleVCy9HVEIySrO4P3CNIicnGkwwiAud05yUAq/gPXBC1hTtmlPD7
|
||||
TVcGVSEiJdvzqqlgv02qedGrkki6GY4S7GjZxrrf7Foc2EP+51LJzwLQx3/JfrCU
|
||||
41NEWAsu/Sl0tQabXESN+zJ1pDqoZ3uHMgpQjeGiE0olr+YcsSW/tJmiU9OiAr8R
|
||||
AgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJYIZI
|
||||
AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW
|
||||
BBSCvM8AABPR9zklmifnr9LvIBturDAfBgNVHSMEGDAWgBQ2w2yI55X+sL3szj49
|
||||
hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEAqb1NV0B0/pbpK9Z4/bNjzPQLTRLK
|
||||
WnSNm/Jh5v0GEUOE/Beg7GNjNrmeNmqxAlpqWz9qoeoFZax+QBpIZYjROU3TS3fp
|
||||
yLsrnlr0CDQ5R7kCCDGa8dkXxemmpZZLbUCpW2Uoy8sAA4JjN9OtsZY7dvUXFgJ7
|
||||
vVNTRnI01ghknbtD+2SxSQd3CWF6QhcRMAzZJ1z1cbbwGDDzfvGFPzJ+Sq+zEPds
|
||||
xoVLLSetCiBc+40ZcDS5dV98h9XD7JMTQfxzA7mNGv73JoZJA6nFgj+ADSlJsY/t
|
||||
JBv+z1iQRueoh9Qeee+ZbRifPouCB8FDx+AltvHTANdAq0t/K3o+pplMVA==
|
||||
MIIB6TCCAVICAQYwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
||||
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNMDAxMDE2MjIzMTAzWhcNMDMwMTE0
|
||||
MjIzMTAzWjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0IGNl
|
||||
cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8SMVIP
|
||||
Fe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8Ey2//
|
||||
Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCT0grFQeZaqYb5EYfk20XixZV4
|
||||
GmyAbXMftG1Eo7qGiMhYzRwGNWxEYojf5PZkYZXvSqZ/ZXHXa4g59jK/rJNnaVGM
|
||||
k+xIX8mxQvlV0n5O9PIha5BX5teZnkHKgL8aKKLKW1BK7YTngsfSzzaeame5iKfz
|
||||
itAE+OjGF+PFKbwX8Q==
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEA84TzkjbcskbKZnrlKcXzSSgi07n+4N7kOM7uIhzpkTuU0HIv
|
||||
h4VZS2axxfV6hV3CD9MuKVg2zEhroqK1Js5n4ke230nSP/qiELfCl0R+hzRtbfKL
|
||||
tFUr1iHeU0uQ6v3q+Tg1K/Tmmg72uxKrhyHDL7z0BriPjhAHJ5XlQsvR1RCMkqzu
|
||||
D9wjSInJxpMMIgLndOclAKv4D1wQtYU7ZpTw+01XBlUhIiXb86qpYL9NqnnRq5JI
|
||||
uhmOEuxo2ca63+xaHNhD/udSyc8C0Md/yX6wlONTRFgLLv0pdLUGm1xEjfsydaQ6
|
||||
qGd7hzIKUI3hohNKJa/mHLElv7SZolPTogK/EQIDAQABAoIBAADq9FwNtuE5IRQn
|
||||
zGtO4q7Y5uCzZ8GDNYr9RKp+P2cbuWDbvVAecYq2NV9QoIiWJOAYZKklOvekIju3
|
||||
r0UZLA0PRiIrTg6NrESx3JrjWDK8QNlUO7CPTZ39/K+FrmMkV9lem9yxjJjyC34D
|
||||
AQB+YRTx+l14HppjdxNwHjAVQpIx/uO2F5xAMuk32+3K+pq9CZUtrofe1q4Agj9R
|
||||
5s8mSy9pbRo9kW9wl5xdEotz1LivFOEiqPUJTUq5J5PeMKao3vdK726XI4Z455Nm
|
||||
W2/MA0YV0ug2FYinHcZdvKM6dimH8GLfa3X8xKRfzjGjTiMSwsdjgMa4awY3tEHH
|
||||
674jhAECgYEA/zqMrc0zsbNk83sjgaYIug5kzEpN4ic020rSZsmQxSCerJTgNhmg
|
||||
utKSCt0Re09Jt3LqG48msahX8ycqDsHNvlEGPQSbMu9IYeO3Wr3fAm75GEtFWePY
|
||||
BhM73I7gkRt4s8bUiUepMG/wY45c5tRF23xi8foReHFFe9MDzh8fJFECgYEA9EFX
|
||||
4qAik1pOJGNei9BMwmx0I0gfVEIgu0tzeVqT45vcxbxr7RkTEaDoAG6PlbWP6D9a
|
||||
WQNLp4gsgRM90ZXOJ4up5DsAWDluvaF4/omabMA+MJJ5kGZ0gCj5rbZbKqUws7x8
|
||||
bp+6iBfUPJUbcqNqFmi/08Yt7vrDnMnyMw2A/sECgYEAiiuRMxnuzVm34hQcsbhH
|
||||
6ymVqf7j0PW2qK0F4H1ocT9qhzWFd+RB3kHWrCjnqODQoI6GbGr/4JepHUpre1ex
|
||||
4UEN5oSS3G0ru0rC3U4C59dZ5KwDHFm7ffZ1pr52ljfQDUsrjjIMRtuiwNK2OoRa
|
||||
WSsqiaL+SDzSB+nBmpnAizECgYBdt/y6rerWUx4MhDwwtTnel7JwHyo2MDFS6/5g
|
||||
n8qC2Lj6/fMDRE22w+CA2esp7EJNQJGv+b27iFpbJEDh+/Lf5YzIT4MwVskQ5bYB
|
||||
JFcmRxUVmf4e09D7o705U/DjCgMH09iCsbLmqQ38ONIRSHZaJtMDtNTHD1yi+jF+
|
||||
OT43gQKBgQC/2OHZoko6iRlNOAQ/tMVFNq7fL81GivoQ9F1U0Qr+DH3ZfaH8eIkX
|
||||
xT0ToMPJUzWAn8pZv0snA0um6SIgvkCuxO84OkANCVbttzXImIsL7pFzfcwV/ERK
|
||||
UM6j0ZuSMFOCr/lGPAoOQU0fskidGEHi1/kW+suSr28TqsyYZpwBDQ==
|
||||
MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD
|
||||
TGiXav6ooKXfX3j/7tdkuD8Ey2//Kv7+ue0CAwEAAQJAN6W31vDEP2DjdqhzCDDu
|
||||
OA4NACqoiFqyblo7yc2tM4h4xMbC3Yx5UKMN9ZkCtX0gzrz6DyF47bdKcWBzNWCj
|
||||
gQIhANEoojVt7hq+SQ6MCN6FTAysGgQf56Q3TYoJMoWvdiXVAiEAw3e3rc+VJpOz
|
||||
rHuDo6bgpjUAAXM+v3fcpsfZSNO6V7kCIQCtbVjanpUwvZkMI9by02oUk9taki3b
|
||||
PzPfAfNPYAbCJQIhAJXNQDWyqwn/lGmR11cqY2y9nZ1+5w3yHGatLrcDnQHxAiEA
|
||||
vnlEGo8K85u+KwIOimM48ZG8oTk7iFdkqLJR1utT3aU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||
issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||
notBefore=950413210656Z
|
||||
notAfter =970412210656Z
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV
|
||||
BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS
|
||||
ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ
|
||||
BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD
|
||||
VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA
|
||||
MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR
|
||||
3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM
|
||||
YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI
|
||||
hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5
|
||||
dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/
|
||||
zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8=
|
||||
-----END X509 CERTIFICATE-----
|
||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw
|
||||
OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0
|
||||
IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ
|
||||
DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv
|
||||
1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2
|
||||
mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v
|
||||
hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4
|
||||
YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA
|
||||
q30KIqGM/uoM60INq97qjDmCJapagcNBGQs=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425
|
||||
gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd
|
||||
2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB
|
||||
AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6
|
||||
hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2
|
||||
J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs
|
||||
HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL
|
||||
21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s
|
||||
nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz
|
||||
MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa
|
||||
pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb
|
||||
KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2
|
||||
XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
MIICYDCCAiACAgEoMAkGBSsOAwINBQAwfDELMAkGA1UEBhMCVVMxNjA0BgNVBAoT
|
||||
LU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZ
|
||||
MBcGA1UECxMQVGVzdCBFbnZpcm9ubWVudDEaMBgGA1UECxMRRFNTLU5BU0EtUGls
|
||||
b3QtQ0EwHhcNOTYwMjI2MTYzMjQ1WhcNOTcwMjI1MTYzMjQ1WjB8MQswCQYDVQQG
|
||||
EwJVUzE2MDQGA1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFk
|
||||
bWluaXN0cmF0aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MRowGAYDVQQL
|
||||
ExFEU1MtTkFTQS1QaWxvdC1DQTCB8jAJBgUrDgMCDAUAA4HkADCB4AJBAMA/ssKb
|
||||
hPNUG7ZlASfVwEJU21O5OyF/iyBzgHI1O8eOhJGUYO8cc8wDMjR508Mr9cp6Uhl/
|
||||
ZB7FV5GkLNEnRHYCQQDUEaSg45P2qrDwixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLb
|
||||
bn3QK74T2IxY1yY+kCNq8XrIqf5fJJzIH0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3
|
||||
fVd0geUCQQCzCFUQAh+ZkEmp5804cs6ZWBhrUAfnra8lJItYo9xPcXgdIfLfibcX
|
||||
R71UsyO77MRD7B0+Ag2tq794IleCVcEEMAkGBSsOAwINBQADLwAwLAIUUayDfreR
|
||||
Yh2WeU86/pHNdkUC1IgCFEfxe1f0oMpxJyrJ5XIxTi7vGdoK
|
||||
-----END X509 CERTIFICATE-----
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICGTCCAdgCAwCqTDAJBgUrDgMCDQUAMHwxCzAJBgNVBAYTAlVTMTYwNAYDVQQK
|
||||
Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x
|
||||
GTAXBgNVBAsTEFRlc3QgRW52aXJvbm1lbnQxGjAYBgNVBAsTEURTUy1OQVNBLVBp
|
||||
bG90LUNBMB4XDTk2MDUxNDE3MDE0MVoXDTk3MDUxNDE3MDE0MVowMzELMAkGA1UE
|
||||
BhMCQVUxDzANBgNVBAoTBk1pbmNvbTETMBEGA1UEAxMKRXJpYyBZb3VuZzCB8jAJ
|
||||
BgUrDgMCDAUAA4HkADCB4AJBAKbfHz6vE6pXXMTpswtGUec2tvnfLJUsoxE9qs4+
|
||||
ObZX7LmLvragNPUeiTJx7UOWZ5DfBj6bXLc8eYne0lP1g3ACQQDUEaSg45P2qrDw
|
||||
ixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLbbn3QK74T2IxY1yY+kCNq8XrIqf5fJJzI
|
||||
H0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3fVd0geUCQQCzCFUQAh+ZkEmp5804cs6Z
|
||||
WBhrUAfnra8lJItYo9xPcXgdIfLfibcXR71UsyO77MRD7B0+Ag2tq794IleCVcEE
|
||||
MAkGBSsOAwINBQADMAAwLQIUWsuuJRE3VT4ueWkWMAJMJaZjj1ECFQCYY0zX4bzM
|
||||
LC7obsrHD8XAHG+ZRG==
|
||||
-----END X509 CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM
|
||||
MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT
|
||||
DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx
|
||||
CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv
|
||||
amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB
|
||||
iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt
|
||||
U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw
|
||||
zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd
|
||||
BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G
|
||||
A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8
|
||||
/DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi
|
||||
lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA
|
||||
S7ELuYGtmYgYm9NZOIr7yU0=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB6jCCAZQCAgEtMA0GCSqGSIb3DQEBBAUAMIGAMQswCQYDVQQGEwJVUzE2MDQG
|
||||
A1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFkbWluaXN0cmF0
|
||||
aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MR4wHAYDVQQLExVNRDUtUlNB
|
||||
LU5BU0EtUGlsb3QtQ0EwHhcNOTYwNDMwMjIwNTAwWhcNOTcwNDMwMjIwNTAwWjCB
|
||||
gDELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu
|
||||
ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZMBcGA1UECxMQVGVzdCBFbnZpcm9ubWVu
|
||||
dDEeMBwGA1UECxMVTUQ1LVJTQS1OQVNBLVBpbG90LUNBMFkwCgYEVQgBAQICAgAD
|
||||
SwAwSAJBALmmX5+GqAvcrWK13rfDrNX9UfeA7f+ijyBgeFQjYUoDpFqapw4nzQBL
|
||||
bAXug8pKkRwa2Zh8YODhXsRWu2F/UckCAwEAATANBgkqhkiG9w0BAQQFAANBAH9a
|
||||
OBA+QCsjxXgnSqHx04gcU8S49DVUb1f2XVoLnHlIb8RnX0k5O6mpHT5eti9bLkiW
|
||||
GJNMJ4L0AJ/ac+SmHZc=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN
|
||||
BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w
|
||||
HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0
|
||||
IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL
|
||||
MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls
|
||||
aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww
|
||||
GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL
|
||||
ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc
|
||||
zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0
|
||||
YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq
|
||||
hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF
|
||||
cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W
|
||||
YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw
|
||||
OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy
|
||||
NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg
|
||||
40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp
|
||||
22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3vR1Y
|
||||
BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S
|
||||
Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9
|
||||
xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO
|
||||
cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
|
||||
wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ
|
||||
vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB
|
||||
AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc
|
||||
z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz
|
||||
xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7
|
||||
HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD
|
||||
yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS
|
||||
xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj
|
||||
7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG
|
||||
h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL
|
||||
QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
|
||||
hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||
issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||
notBefore=941104185834Z
|
||||
notAfter =991103185834Z
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw
|
||||
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy
|
||||
Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05
|
||||
OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT
|
||||
ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u
|
||||
IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o
|
||||
975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/
|
||||
touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE
|
||||
7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j
|
||||
9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI
|
||||
0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb
|
||||
MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU=
|
||||
-----END X509 CERTIFICATE-----
|
||||
subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||
issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||
notBefore=941109235417Z
|
||||
notAfter =991231235417Z
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw
|
||||
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl
|
||||
IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda
|
||||
Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0
|
||||
YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB
|
||||
roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12
|
||||
aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc
|
||||
HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A
|
||||
iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7
|
||||
suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h
|
||||
cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk=
|
||||
-----END X509 CERTIFICATE-----
|
||||
subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||
/OU=Certification Services Division/CN=Thawte Server CA
|
||||
/Email=server-certs@thawte.com
|
||||
issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||
/OU=Certification Services Division/CN=Thawte Server CA
|
||||
/Email=server-certs@thawte.com
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD
|
||||
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||
dmljZXMgRGl2aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkq
|
||||
hkiG9w0BCQEWF3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMB4XDTk2MDcyNzE4MDc1
|
||||
N1oXDTk4MDcyNzE4MDc1N1owgcQxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0
|
||||
ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENv
|
||||
bnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2
|
||||
aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkqhkiG9w0BCQEW
|
||||
F3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
|
||||
iQKBgQDTpFBuyP9Wa+bPXbbqDGh1R6KqwtqEJfyo9EdR2oW1IHSUhh4PdcnpCGH1
|
||||
Bm0wbhUZAulSwGLbTZme4moMRDjN/r7jZAlwxf6xaym2L0nIO9QnBCUQly/nkG3A
|
||||
KEKZ10xD3sP1IW1Un13DWOHA5NlbsLjctHvfNjrCtWYiEtaHDQIDAQABMA0GCSqG
|
||||
SIb3DQEBBAUAA4GBAIsvn7ifX3RUIrvYXtpI4DOfARkTogwm6o7OwVdl93yFhDcX
|
||||
7h5t0XZ11MUAMziKdde3rmTvzUYIUCYoY5b032IwGMTvdiclK+STN6NP2m5nvFAM
|
||||
qJT5gC5O+j/jBuZRQ4i0AMYQr5F4lT8oBJnhgafw6PL8aDY2vMHGSPl9+7uf
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDDTCCAnYCAQAwDQYJKoZIhvcNAQEEBQAwgc4xCzAJBgNVBAYTAlpBMRUwEwYD
|
||||
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||
dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBD
|
||||
QTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTAeFw05
|
||||
NjA3MjcxODA3MTRaFw05ODA3MjcxODA3MTRaMIHOMQswCQYDVQQGEwJaQTEVMBMG
|
||||
A1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoT
|
||||
FFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNl
|
||||
cnZpY2VzIERpdmlzaW9uMSEwHwYDVQQDExhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIg
|
||||
Q0ExKDAmBgkqhkiG9w0BCQEWGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb20wgZ8w
|
||||
DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANI2NmqL18JbntqBQWKPOO5JBFXW0O8c
|
||||
G5UWR+8YSDU6UvQragaPOy/qVuOvho2eF/eetGV1Ak3vywmiIVHYm9Bn0LoNkgYU
|
||||
c9STy5cqAJxcTgy8+hVS/PJEbtoRSm4Iny8t4/mqOoZztkZTWMiJBb2DEbhzP6oH
|
||||
jfRCTedAnRw3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAutFIgTRZVYerIZfL9lvR
|
||||
w9Eifvvo5KTZ3h+Bj+VzNnyw4Qc/IyXkPOu6SIiH9LQ3sCmWBdxpe+qr4l77rLj2
|
||||
GYuMtESFfn1XVALzkYgC7JcPuTOjMfIiMByt+uFf8AV8x0IW/Qkuv+hEQcyM9vxK
|
||||
3VZdLbCVIhNoEsysrxCpxcI=
|
||||
-----END CERTIFICATE-----
|
||||
Tims test GCI CA
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||
cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD
|
||||
cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow
|
||||
gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC
|
||||
cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl
|
||||
dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN
|
||||
AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw
|
||||
OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF
|
||||
AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA
|
||||
TfdbFZtAAD2Hx9jUtY3tfdrJOb8=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||
cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O
|
||||
IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB
|
||||
VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1
|
||||
NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH
|
||||
EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT
|
||||
I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta
|
||||
RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ
|
||||
KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR
|
||||
Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG
|
||||
9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4
|
||||
WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIAwgKADAgECAgEAMA0GCSqGSIb3DQEBBAUAMGIxETAPBgNVBAcTCEludGVybmV0
|
||||
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh
|
||||
c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NjA0MDgxMDIwMjda
|
||||
Fw05NzA0MDgxMDIwMjdaMGIxETAPBgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5W
|
||||
ZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xhc3MgMSBDQSAtIElu
|
||||
ZGl2aWR1YWwgU3Vic2NyaWJlcjCAMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2
|
||||
FKbPTdAFDdjKI9BvqrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7j
|
||||
W80GqLd5HUQq7XPysVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cari
|
||||
QPJUObwW7s987LrbP2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG
|
||||
9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C
|
||||
TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW
|
||||
8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||
issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw
|
||||
YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw
|
||||
MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp
|
||||
YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI
|
||||
SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp
|
||||
U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG
|
||||
SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb
|
||||
RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp
|
||||
3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv
|
||||
z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg
|
||||
hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg
|
||||
YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv
|
||||
LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg
|
||||
KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ
|
||||
Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv
|
||||
ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v
|
||||
dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw
|
||||
IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS
|
||||
ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ
|
||||
TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w
|
||||
LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU
|
||||
BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs
|
||||
53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq
|
||||
2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB
|
||||
p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||
issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg
|
||||
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ
|
||||
nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma
|
||||
AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga
|
||||
IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF
|
||||
AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ
|
||||
Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6
|
||||
NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ==
|
||||
-----END CERTIFICATE-----
|
||||
subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||
issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg
|
||||
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1
|
||||
9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj
|
||||
IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd
|
||||
O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF
|
||||
AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ
|
||||
g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am
|
||||
yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
420
apps/server2.pem
420
apps/server2.pem
@@ -1,52 +1,376 @@
|
||||
subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Server Cert #2
|
||||
issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA
|
||||
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 (1024 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID6jCCAtKgAwIBAgIJALnu1NlVpZ60MA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
||||
BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT
|
||||
VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt
|
||||
ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZzELMAkG
|
||||
A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU
|
||||
RVNUSU5HIFBVUlBPU0VTIE9OTFkxHDAaBgNVBAMME1Rlc3QgU2VydmVyIENlcnQg
|
||||
IzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDrdi7j9yctG+L4EjBy
|
||||
gjPmEqZzOJEQba26MoQGzglU7e5Xf59Rb/hgVQuKAoiZe7/R8rK4zJ4W7iXdXw0L
|
||||
qBpyG8B5aGKeI32w+A9TcBApoXXL2CrYQEQjZwUIpLlYBIi2NkJj3nVkq5dgl1gO
|
||||
ALiQ+W8jg3kzg5Ec9rimp9r93N8wsSL3awsafurmYCvOf7leHaMP1WJ/zDRGUNHG
|
||||
/WtDjXc8ZUG1+6EXU9Jc2Fs+2Omf7fcN0l00AK/wPg8OaNS0rKyGq9JdIT9FRGV1
|
||||
bXe/rx58FaE5CItdwCSYhJvF/O95LWQoxJXye5bCFLmvDTEyVq9FMSCptfsmbXjE
|
||||
ZGsXAgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJ
|
||||
YIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1Ud
|
||||
DgQWBBR52UaWWTKzZGDH/X4mWNcuqeQVazAfBgNVHSMEGDAWgBQ2w2yI55X+sL3s
|
||||
zj49hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEANBW+XYLlHBqVY/31ie+3gRlS
|
||||
LPfy4SIqn0t3RJjagT29MXprblBO2cbMO8VGjkQdKGpmMXjxbht2arOOUXRHX4n/
|
||||
XTyn/QHEf0bcwIITMReO3DZUPAEw8hSjn9xEOM0IRVOCP+mH5fi74QzzQaZVCyYg
|
||||
5VtLKdww/+sc0nCbKl2KWgDluriH0nfVx95qgW3mg9dhXRr0zmf1w2zkBHYpARYL
|
||||
Dew6Z8EE4tS3HJu8/qM6meWzNtrfonQ3eiiMxjZBxzV46jchBwa2z9XYhP6AmpPb
|
||||
oeTSzcQNbWsxaGYzWo46oLDUZmJOwSBawbS31bZNMCoPIY6ukoesCzFSsUKZww==
|
||||
MIICLjCCAZcCAQEwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
|
||||
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU0WhcNOTgwNjA5
|
||||
MTM1NzU0WjBkMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
|
||||
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxJDAiBgNVBAMTG1NlcnZlciB0ZXN0IGNl
|
||||
cnQgKDEwMjQgYml0KTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsxH1PBPm
|
||||
RkxrR11eV4bzNi4N9n11CI8nV29+ARlT1+qDe/mjVUvXlmsr1v/vf71G9GgqopSa
|
||||
6RXrICLVdk/FYYYzhPvl1M+OrjaXDFO8BzBAF1Lnz6c7aRZvGRJNrRSr2nZEkqDf
|
||||
JW9dY7r2VZEpD5QeuaRYUnuECkqeieB65GMCAwEAATANBgkqhkiG9w0BAQQFAAOB
|
||||
gQCWsOta6C0wiVzXz8wPmJKyTrurMlgUss2iSuW9366iwofZddsNg7FXniMzkIf6
|
||||
dp7jnmWZwKZ9cXsNUS2o4OL07qOk2HOywC0YsNZQsOBu1CBTYYkIefDiKFL1zQHh
|
||||
8lwwNd4NP+OE3NzUNkCfh4DnFfg9WHkXUlD5UpxNRJ4gJA==
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEA63Yu4/cnLRvi+BIwcoIz5hKmcziREG2tujKEBs4JVO3uV3+f
|
||||
UW/4YFULigKImXu/0fKyuMyeFu4l3V8NC6gachvAeWhiniN9sPgPU3AQKaF1y9gq
|
||||
2EBEI2cFCKS5WASItjZCY951ZKuXYJdYDgC4kPlvI4N5M4ORHPa4pqfa/dzfMLEi
|
||||
92sLGn7q5mArzn+5Xh2jD9Vif8w0RlDRxv1rQ413PGVBtfuhF1PSXNhbPtjpn+33
|
||||
DdJdNACv8D4PDmjUtKyshqvSXSE/RURldW13v68efBWhOQiLXcAkmISbxfzveS1k
|
||||
KMSV8nuWwhS5rw0xMlavRTEgqbX7Jm14xGRrFwIDAQABAoIBAHLsTPihIfLnYIE5
|
||||
x4GsQQ5zXeBw5ITDM37ktwHnQDC+rIzyUl1aLD1AZRBoKinXd4lOTqLZ4/NHKx4A
|
||||
DYr58mZtWyUmqLOMmQVuHXTZBlp7XtYuXMMNovQwjQlp9LicBeoBU6gQ5PVMtubD
|
||||
F4xGF89Sn0cTHW3iMkqTtQ5KcR1j57OcJO0FEb1vPvk2MXI5ZyAatUYE7YacbEzd
|
||||
rg02uIwx3FqNSkuSI79uz4hMdV5TPtuhxx9nTwj9aLUhXFeZ0mn2PVgVzEnnMoJb
|
||||
+znlsZDgzDlJqdaD744YGWh8Z3OEssB35KfzFcdOeO6yH8lmv2Zfznk7pNPT7LTb
|
||||
Lae9VgkCgYEA92p1qnAB3NtJtNcaW53i0S5WJgS1hxWKvUDx3lTB9s8X9fHpqL1a
|
||||
E94fDfWzp/hax6FefUKIvBOukPLQ6bYjTMiFoOHzVirghAIuIUoMI5VtLhwD1hKs
|
||||
Lr7l/dptMgKb1nZHyXoKHRBthsy3K4+udsPi8TzMvYElgEqyQIe/Rk0CgYEA86GL
|
||||
8HC6zLszzKERDPBxrboRmoFvVUCTQDhsfj1M8aR3nQ8V5LkdIJc7Wqm/Ggfk9QRf
|
||||
rJ8M2WUMlU5CNnCn/KCrKzCNZIReze3fV+HnKdbcXGLvgbHPrhnz8yYehUFG+RGq
|
||||
bVyDWRU94T38izy2s5qMYrMJWZEYyXncSPbfcPMCgYAtaXfxcZ+V5xYPQFARMtiX
|
||||
5nZfggvDoJuXgx0h3tK/N2HBfcaSdzbaYLG4gTmZggc/jwnl2dl5E++9oSPhUdIG
|
||||
3ONSFUbxsOsGr9PBvnKd8WZZyUCXAVRjPBzAzF+whzQNWCZy/5htnz9LN7YDI9s0
|
||||
5113Q96cheDZPFydZY0hHQKBgQDVbEhNukM5xCiNcu+f2SaMnLp9EjQ4h5g3IvaP
|
||||
5B16daw/Dw8LzcohWboqIxeAsze0GD/D1ZUJAEd0qBjC3g+a9BjefervCjKOzXng
|
||||
38mEUm+6EwVjJSQcjSmycEs+Sr/kwr/8i5WYvU32+jk4tFgMoC+o6tQe/Uesf68k
|
||||
z/dPVwKBgGbF7Vv1/3SmhlOy+zYyvJ0CrWtKxH9QP6tLIEgEpd8x7YTSuCH94yok
|
||||
kToMXYA3sWNPt22GbRDZ+rcp4c7HkDx6I6vpdP9aQEwJTp0EPy0sgWr2XwYmreIQ
|
||||
NFmkk8Itn9EY2R9VBaP7GLv5kvwxDdLAnmwGmzVtbmaVdxCaBwUk
|
||||
MIICXgIBAAKBgQCzEfU8E+ZGTGtHXV5XhvM2Lg32fXUIjydXb34BGVPX6oN7+aNV
|
||||
S9eWayvW/+9/vUb0aCqilJrpFesgItV2T8VhhjOE++XUz46uNpcMU7wHMEAXUufP
|
||||
pztpFm8ZEk2tFKvadkSSoN8lb11juvZVkSkPlB65pFhSe4QKSp6J4HrkYwIDAQAB
|
||||
AoGBAKy8jvb0Lzby8q11yNLf7+78wCVdYi7ugMHcYA1JVFK8+zb1WfSm44FLQo/0
|
||||
dSChAjgz36TTexeLODPYxleJndjVcOMVzsLJjSM8dLpXsTS4FCeMbhw2s2u+xqKY
|
||||
bbPWfk+HOTyJjfnkcC5Nbg44eOmruq0gSmBeUXVM5UntlTnxAkEA7TGCA3h7kx5E
|
||||
Bl4zl2pc3gPAGt+dyfk5Po9mGJUUXhF5p2zueGmYWW74TmOWB1kzt4QRdYMzFePq
|
||||
zfDNXEa1CwJBAMFErdY0xp0UJ13WwBbUTk8rujqQdHtjw0klhpbuKkjxu2hN0wwM
|
||||
6p0D9qxF7JHaghqVRI0fAW/EE0OzdHMR9QkCQQDNR26dMFXKsoPu+vItljj/UEGf
|
||||
QG7gERiQ4yxaFBPHgdpGo0kT31eh9x9hQGDkxTe0GNG/YSgCRvm8+C3TMcKXAkBD
|
||||
dhGn36wkUFCddMSAM4NSJ1VN8/Z0y5HzCmI8dM3VwGtGMUQlxKxwOl30LEQzdS5M
|
||||
0SWojNYXiT2gOBfBwtbhAkEAhafl5QEOIgUz+XazS/IlZ8goNKdDVfYgK3mHHjvv
|
||||
nY5G+AuGebdNkXJr4KSWxDcN+C2i47zuj4QXA16MAOandA==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||
issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
|
||||
notBefore=950413210656Z
|
||||
notAfter =970412210656Z
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV
|
||||
BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS
|
||||
ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ
|
||||
BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD
|
||||
VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA
|
||||
MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR
|
||||
3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM
|
||||
YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI
|
||||
hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5
|
||||
dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/
|
||||
zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8=
|
||||
-----END X509 CERTIFICATE-----
|
||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw
|
||||
OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0
|
||||
IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ
|
||||
DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv
|
||||
1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2
|
||||
mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v
|
||||
hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4
|
||||
YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA
|
||||
q30KIqGM/uoM60INq97qjDmCJapagcNBGQs=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425
|
||||
gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd
|
||||
2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB
|
||||
AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6
|
||||
hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2
|
||||
J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs
|
||||
HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL
|
||||
21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s
|
||||
nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz
|
||||
MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa
|
||||
pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb
|
||||
KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2
|
||||
XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
MIICYDCCAiACAgEoMAkGBSsOAwINBQAwfDELMAkGA1UEBhMCVVMxNjA0BgNVBAoT
|
||||
LU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZ
|
||||
MBcGA1UECxMQVGVzdCBFbnZpcm9ubWVudDEaMBgGA1UECxMRRFNTLU5BU0EtUGls
|
||||
b3QtQ0EwHhcNOTYwMjI2MTYzMjQ1WhcNOTcwMjI1MTYzMjQ1WjB8MQswCQYDVQQG
|
||||
EwJVUzE2MDQGA1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFk
|
||||
bWluaXN0cmF0aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MRowGAYDVQQL
|
||||
ExFEU1MtTkFTQS1QaWxvdC1DQTCB8jAJBgUrDgMCDAUAA4HkADCB4AJBAMA/ssKb
|
||||
hPNUG7ZlASfVwEJU21O5OyF/iyBzgHI1O8eOhJGUYO8cc8wDMjR508Mr9cp6Uhl/
|
||||
ZB7FV5GkLNEnRHYCQQDUEaSg45P2qrDwixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLb
|
||||
bn3QK74T2IxY1yY+kCNq8XrIqf5fJJzIH0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3
|
||||
fVd0geUCQQCzCFUQAh+ZkEmp5804cs6ZWBhrUAfnra8lJItYo9xPcXgdIfLfibcX
|
||||
R71UsyO77MRD7B0+Ag2tq794IleCVcEEMAkGBSsOAwINBQADLwAwLAIUUayDfreR
|
||||
Yh2WeU86/pHNdkUC1IgCFEfxe1f0oMpxJyrJ5XIxTi7vGdoK
|
||||
-----END X509 CERTIFICATE-----
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICGTCCAdgCAwCqTDAJBgUrDgMCDQUAMHwxCzAJBgNVBAYTAlVTMTYwNAYDVQQK
|
||||
Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x
|
||||
GTAXBgNVBAsTEFRlc3QgRW52aXJvbm1lbnQxGjAYBgNVBAsTEURTUy1OQVNBLVBp
|
||||
bG90LUNBMB4XDTk2MDUxNDE3MDE0MVoXDTk3MDUxNDE3MDE0MVowMzELMAkGA1UE
|
||||
BhMCQVUxDzANBgNVBAoTBk1pbmNvbTETMBEGA1UEAxMKRXJpYyBZb3VuZzCB8jAJ
|
||||
BgUrDgMCDAUAA4HkADCB4AJBAKbfHz6vE6pXXMTpswtGUec2tvnfLJUsoxE9qs4+
|
||||
ObZX7LmLvragNPUeiTJx7UOWZ5DfBj6bXLc8eYne0lP1g3ACQQDUEaSg45P2qrDw
|
||||
ixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLbbn3QK74T2IxY1yY+kCNq8XrIqf5fJJzI
|
||||
H0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3fVd0geUCQQCzCFUQAh+ZkEmp5804cs6Z
|
||||
WBhrUAfnra8lJItYo9xPcXgdIfLfibcXR71UsyO77MRD7B0+Ag2tq794IleCVcEE
|
||||
MAkGBSsOAwINBQADMAAwLQIUWsuuJRE3VT4ueWkWMAJMJaZjj1ECFQCYY0zX4bzM
|
||||
LC7obsrHD8XAHG+ZRG==
|
||||
-----END X509 CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM
|
||||
MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT
|
||||
DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx
|
||||
CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv
|
||||
amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB
|
||||
iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt
|
||||
U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw
|
||||
zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd
|
||||
BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G
|
||||
A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8
|
||||
/DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi
|
||||
lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA
|
||||
S7ELuYGtmYgYm9NZOIr7yU0=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB6jCCAZQCAgEtMA0GCSqGSIb3DQEBBAUAMIGAMQswCQYDVQQGEwJVUzE2MDQG
|
||||
A1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFkbWluaXN0cmF0
|
||||
aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MR4wHAYDVQQLExVNRDUtUlNB
|
||||
LU5BU0EtUGlsb3QtQ0EwHhcNOTYwNDMwMjIwNTAwWhcNOTcwNDMwMjIwNTAwWjCB
|
||||
gDELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu
|
||||
ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZMBcGA1UECxMQVGVzdCBFbnZpcm9ubWVu
|
||||
dDEeMBwGA1UECxMVTUQ1LVJTQS1OQVNBLVBpbG90LUNBMFkwCgYEVQgBAQICAgAD
|
||||
SwAwSAJBALmmX5+GqAvcrWK13rfDrNX9UfeA7f+ijyBgeFQjYUoDpFqapw4nzQBL
|
||||
bAXug8pKkRwa2Zh8YODhXsRWu2F/UckCAwEAATANBgkqhkiG9w0BAQQFAANBAH9a
|
||||
OBA+QCsjxXgnSqHx04gcU8S49DVUb1f2XVoLnHlIb8RnX0k5O6mpHT5eti9bLkiW
|
||||
GJNMJ4L0AJ/ac+SmHZc=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN
|
||||
BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w
|
||||
HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0
|
||||
IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL
|
||||
MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls
|
||||
aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww
|
||||
GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL
|
||||
ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc
|
||||
zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0
|
||||
YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq
|
||||
hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF
|
||||
cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W
|
||||
YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
|
||||
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
|
||||
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw
|
||||
OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
|
||||
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy
|
||||
NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg
|
||||
40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp
|
||||
22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3vR1Y
|
||||
BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S
|
||||
Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9
|
||||
xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO
|
||||
cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
|
||||
wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ
|
||||
vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB
|
||||
AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc
|
||||
z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz
|
||||
xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7
|
||||
HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD
|
||||
yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS
|
||||
xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj
|
||||
7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG
|
||||
h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL
|
||||
QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
|
||||
hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||
issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
|
||||
notBefore=941104185834Z
|
||||
notAfter =991103185834Z
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw
|
||||
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy
|
||||
Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05
|
||||
OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT
|
||||
ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u
|
||||
IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o
|
||||
975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/
|
||||
touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE
|
||||
7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j
|
||||
9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI
|
||||
0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb
|
||||
MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU=
|
||||
-----END X509 CERTIFICATE-----
|
||||
subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||
issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
|
||||
notBefore=941109235417Z
|
||||
notAfter =991231235417Z
|
||||
-----BEGIN X509 CERTIFICATE-----
|
||||
|
||||
MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw
|
||||
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl
|
||||
IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda
|
||||
Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0
|
||||
YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB
|
||||
roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12
|
||||
aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc
|
||||
HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A
|
||||
iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7
|
||||
suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h
|
||||
cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk=
|
||||
-----END X509 CERTIFICATE-----
|
||||
subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||
/OU=Certification Services Division/CN=Thawte Server CA
|
||||
/Email=server-certs@thawte.com
|
||||
issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
|
||||
/OU=Certification Services Division/CN=Thawte Server CA
|
||||
/Email=server-certs@thawte.com
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD
|
||||
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||
dmljZXMgRGl2aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkq
|
||||
hkiG9w0BCQEWF3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMB4XDTk2MDcyNzE4MDc1
|
||||
N1oXDTk4MDcyNzE4MDc1N1owgcQxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0
|
||||
ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENv
|
||||
bnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2
|
||||
aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkqhkiG9w0BCQEW
|
||||
F3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
|
||||
iQKBgQDTpFBuyP9Wa+bPXbbqDGh1R6KqwtqEJfyo9EdR2oW1IHSUhh4PdcnpCGH1
|
||||
Bm0wbhUZAulSwGLbTZme4moMRDjN/r7jZAlwxf6xaym2L0nIO9QnBCUQly/nkG3A
|
||||
KEKZ10xD3sP1IW1Un13DWOHA5NlbsLjctHvfNjrCtWYiEtaHDQIDAQABMA0GCSqG
|
||||
SIb3DQEBBAUAA4GBAIsvn7ifX3RUIrvYXtpI4DOfARkTogwm6o7OwVdl93yFhDcX
|
||||
7h5t0XZ11MUAMziKdde3rmTvzUYIUCYoY5b032IwGMTvdiclK+STN6NP2m5nvFAM
|
||||
qJT5gC5O+j/jBuZRQ4i0AMYQr5F4lT8oBJnhgafw6PL8aDY2vMHGSPl9+7uf
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDDTCCAnYCAQAwDQYJKoZIhvcNAQEEBQAwgc4xCzAJBgNVBAYTAlpBMRUwEwYD
|
||||
VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
|
||||
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
|
||||
dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBD
|
||||
QTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTAeFw05
|
||||
NjA3MjcxODA3MTRaFw05ODA3MjcxODA3MTRaMIHOMQswCQYDVQQGEwJaQTEVMBMG
|
||||
A1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoT
|
||||
FFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNl
|
||||
cnZpY2VzIERpdmlzaW9uMSEwHwYDVQQDExhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIg
|
||||
Q0ExKDAmBgkqhkiG9w0BCQEWGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb20wgZ8w
|
||||
DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANI2NmqL18JbntqBQWKPOO5JBFXW0O8c
|
||||
G5UWR+8YSDU6UvQragaPOy/qVuOvho2eF/eetGV1Ak3vywmiIVHYm9Bn0LoNkgYU
|
||||
c9STy5cqAJxcTgy8+hVS/PJEbtoRSm4Iny8t4/mqOoZztkZTWMiJBb2DEbhzP6oH
|
||||
jfRCTedAnRw3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAutFIgTRZVYerIZfL9lvR
|
||||
w9Eifvvo5KTZ3h+Bj+VzNnyw4Qc/IyXkPOu6SIiH9LQ3sCmWBdxpe+qr4l77rLj2
|
||||
GYuMtESFfn1XVALzkYgC7JcPuTOjMfIiMByt+uFf8AV8x0IW/Qkuv+hEQcyM9vxK
|
||||
3VZdLbCVIhNoEsysrxCpxcI=
|
||||
-----END CERTIFICATE-----
|
||||
Tims test GCI CA
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||
cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD
|
||||
cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow
|
||||
gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC
|
||||
cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl
|
||||
dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN
|
||||
AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw
|
||||
OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF
|
||||
AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA
|
||||
TfdbFZtAAD2Hx9jUtY3tfdrJOb8=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD
|
||||
VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5
|
||||
cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O
|
||||
IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB
|
||||
VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1
|
||||
NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH
|
||||
EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT
|
||||
I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta
|
||||
RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ
|
||||
KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR
|
||||
Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG
|
||||
9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4
|
||||
WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIAwgKADAgECAgEAMA0GCSqGSIb3DQEBBAUAMGIxETAPBgNVBAcTCEludGVybmV0
|
||||
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh
|
||||
c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NjA0MDgxMDIwMjda
|
||||
Fw05NzA0MDgxMDIwMjdaMGIxETAPBgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5W
|
||||
ZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xhc3MgMSBDQSAtIElu
|
||||
ZGl2aWR1YWwgU3Vic2NyaWJlcjCAMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2
|
||||
FKbPTdAFDdjKI9BvqrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7j
|
||||
W80GqLd5HUQq7XPysVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cari
|
||||
QPJUObwW7s987LrbP2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG
|
||||
9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C
|
||||
TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW
|
||||
8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||
issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
|
||||
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw
|
||||
YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw
|
||||
MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp
|
||||
YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI
|
||||
SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp
|
||||
U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG
|
||||
SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb
|
||||
RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp
|
||||
3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv
|
||||
z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg
|
||||
hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg
|
||||
YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv
|
||||
LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg
|
||||
KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ
|
||||
Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv
|
||||
ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v
|
||||
dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw
|
||||
IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS
|
||||
ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ
|
||||
TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w
|
||||
LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU
|
||||
BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs
|
||||
53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq
|
||||
2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB
|
||||
p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||
issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg
|
||||
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ
|
||||
nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma
|
||||
AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga
|
||||
IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF
|
||||
AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ
|
||||
Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6
|
||||
NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ==
|
||||
-----END CERTIFICATE-----
|
||||
subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||
issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
|
||||
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg
|
||||
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
|
||||
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
|
||||
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
|
||||
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1
|
||||
9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj
|
||||
IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd
|
||||
O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF
|
||||
AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ
|
||||
g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am
|
||||
yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
@@ -90,7 +90,6 @@ int MAIN(int, char **);
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
SSL_SESSION *x = NULL;
|
||||
X509 *peer = NULL;
|
||||
int ret = 1, i, num, badops = 0;
|
||||
BIO *out = NULL;
|
||||
int informat, outformat;
|
||||
@@ -158,15 +157,14 @@ int MAIN(int argc, char **argv)
|
||||
if (x == NULL) {
|
||||
goto end;
|
||||
}
|
||||
peer = SSL_SESSION_get0_peer(x);
|
||||
|
||||
if (context) {
|
||||
size_t ctx_len = strlen(context);
|
||||
if (ctx_len > SSL_MAX_SID_CTX_LENGTH) {
|
||||
x->sid_ctx_length = strlen(context);
|
||||
if (x->sid_ctx_length > SSL_MAX_SID_CTX_LENGTH) {
|
||||
BIO_printf(bio_err, "Context too long\n");
|
||||
goto end;
|
||||
}
|
||||
SSL_SESSION_set1_id_context(x, (unsigned char *)context, ctx_len);
|
||||
memcpy(x->sid_ctx, context, x->sid_ctx_length);
|
||||
}
|
||||
#ifdef undef
|
||||
/* just testing for memory leaks :-) */
|
||||
@@ -216,10 +214,10 @@ int MAIN(int argc, char **argv)
|
||||
SSL_SESSION_print(out, x);
|
||||
|
||||
if (cert) {
|
||||
if (peer == NULL)
|
||||
if (x->peer == NULL)
|
||||
BIO_puts(out, "No certificate present\n");
|
||||
else
|
||||
X509_print(out, peer);
|
||||
X509_print(out, x->peer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,11 +234,11 @@ int MAIN(int argc, char **argv)
|
||||
BIO_printf(bio_err, "unable to write SSL_SESSION\n");
|
||||
goto end;
|
||||
}
|
||||
} else if (!noout && (peer != NULL)) { /* just print the certificate */
|
||||
} else if (!noout && (x->peer != NULL)) { /* just print the certificate */
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i = (int)i2d_X509_bio(out, peer);
|
||||
i = (int)i2d_X509_bio(out, x->peer);
|
||||
else if (outformat == FORMAT_PEM)
|
||||
i = PEM_write_bio_X509(out, peer);
|
||||
i = PEM_write_bio_X509(out, x->peer);
|
||||
else {
|
||||
BIO_printf(bio_err, "bad output format specified for outfile\n");
|
||||
goto end;
|
||||
|
||||
@@ -632,12 +632,6 @@ int MAIN(int argc, char **argv)
|
||||
p7 = PKCS7_sign(NULL, NULL, other, in, flags);
|
||||
if (!p7)
|
||||
goto end;
|
||||
if (flags & PKCS7_NOCERTS) {
|
||||
for (i = 0; i < sk_X509_num(other); i++) {
|
||||
X509 *x = sk_X509_value(other, i);
|
||||
PKCS7_add_certificate(p7, x);
|
||||
}
|
||||
}
|
||||
} else
|
||||
flags |= PKCS7_REUSE_DIGEST;
|
||||
for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++) {
|
||||
|
||||
186
apps/speed.c
186
apps/speed.c
@@ -108,16 +108,8 @@
|
||||
# include <signal.h>
|
||||
# endif
|
||||
|
||||
# if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# ifdef _WIN32
|
||||
# include <windows.h>
|
||||
# if defined(__CYGWIN__) && !defined(_WIN32)
|
||||
/*
|
||||
* <windows.h> should define _WIN32, which normally is mutually exclusive
|
||||
* with __CYGWIN__, but if it didn't...
|
||||
*/
|
||||
# define _WIN32
|
||||
/* this is done because Cygwin alarm() fails sometimes. */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# include <openssl/bn.h>
|
||||
@@ -191,25 +183,6 @@
|
||||
# ifndef OPENSSL_NO_ECDH
|
||||
# include <openssl/ecdh.h>
|
||||
# endif
|
||||
# include <openssl/modes.h>
|
||||
|
||||
# ifdef OPENSSL_FIPS
|
||||
# ifdef OPENSSL_DOING_MAKEDEPEND
|
||||
# undef AES_set_encrypt_key
|
||||
# undef AES_set_decrypt_key
|
||||
# undef DES_set_key_unchecked
|
||||
# endif
|
||||
# define BF_set_key private_BF_set_key
|
||||
# define CAST_set_key private_CAST_set_key
|
||||
# define idea_set_encrypt_key private_idea_set_encrypt_key
|
||||
# define SEED_set_key private_SEED_set_key
|
||||
# define RC2_set_key private_RC2_set_key
|
||||
# define RC4_set_key private_RC4_set_key
|
||||
# define DES_set_key_unchecked private_DES_set_key_unchecked
|
||||
# define AES_set_encrypt_key private_AES_set_encrypt_key
|
||||
# define AES_set_decrypt_key private_AES_set_decrypt_key
|
||||
# define Camellia_set_key private_Camellia_set_key
|
||||
# endif
|
||||
|
||||
# ifndef HAVE_FORK
|
||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
|
||||
@@ -227,7 +200,7 @@
|
||||
|
||||
# undef BUFSIZE
|
||||
# define BUFSIZE ((long)1024*8+1)
|
||||
static volatile int run = 0;
|
||||
int run = 0;
|
||||
|
||||
static int mr = 0;
|
||||
static int usertime = 1;
|
||||
@@ -241,7 +214,7 @@ static void print_result(int alg, int run_no, int count, double time_used);
|
||||
static int do_multi(int multi);
|
||||
# endif
|
||||
|
||||
# define ALGOR_NUM 30
|
||||
# define ALGOR_NUM 29
|
||||
# define SIZE_NUM 5
|
||||
# define RSA_NUM 4
|
||||
# define DSA_NUM 3
|
||||
@@ -256,7 +229,7 @@ static const char *names[ALGOR_NUM] = {
|
||||
"aes-128 cbc", "aes-192 cbc", "aes-256 cbc",
|
||||
"camellia-128 cbc", "camellia-192 cbc", "camellia-256 cbc",
|
||||
"evp", "sha256", "sha512", "whirlpool",
|
||||
"aes-128 ige", "aes-192 ige", "aes-256 ige", "ghash"
|
||||
"aes-128 ige", "aes-192 ige", "aes-256 ige"
|
||||
};
|
||||
|
||||
static double results[ALGOR_NUM][SIZE_NUM];
|
||||
@@ -304,17 +277,13 @@ static SIGRETTYPE sig_done(int sig)
|
||||
|
||||
# if defined(_WIN32)
|
||||
|
||||
# if !defined(SIGALRM)
|
||||
# define SIGALRM
|
||||
# endif
|
||||
# define SIGALRM
|
||||
static unsigned int lapse, schlock;
|
||||
static void alarm_win32(unsigned int secs)
|
||||
static void alarm(unsigned int secs)
|
||||
{
|
||||
lapse = secs * 1000;
|
||||
}
|
||||
|
||||
# define alarm alarm_win32
|
||||
|
||||
static DWORD WINAPI sleepy(VOID * arg)
|
||||
{
|
||||
schlock = 1;
|
||||
@@ -366,8 +335,6 @@ static void *KDF1_SHA1(const void *in, size_t inlen, void *out,
|
||||
}
|
||||
# endif /* OPENSSL_NO_ECDH */
|
||||
|
||||
static void multiblock_speed(const EVP_CIPHER *evp_cipher);
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
@@ -515,7 +482,6 @@ int MAIN(int argc, char **argv)
|
||||
# define D_IGE_128_AES 26
|
||||
# define D_IGE_192_AES 27
|
||||
# define D_IGE_256_AES 28
|
||||
# define D_GHASH 29
|
||||
double d = 0.0;
|
||||
long c[ALGOR_NUM][SIZE_NUM];
|
||||
# define R_DSA_512 0
|
||||
@@ -648,7 +614,6 @@ int MAIN(int argc, char **argv)
|
||||
# ifndef NO_FORK
|
||||
int multi = 0;
|
||||
# endif
|
||||
int multiblock = 0;
|
||||
|
||||
# ifndef TIMES
|
||||
usertime = -1;
|
||||
@@ -779,9 +744,6 @@ int MAIN(int argc, char **argv)
|
||||
mr = 1;
|
||||
j--; /* Otherwise, -mr gets confused with an
|
||||
* algorithm. */
|
||||
} else if (argc > 0 && !strcmp(*argv, "-mb")) {
|
||||
multiblock = 1;
|
||||
j--;
|
||||
} else
|
||||
# ifndef OPENSSL_NO_MD2
|
||||
if (strcmp(*argv, "md2") == 0)
|
||||
@@ -961,8 +923,6 @@ int MAIN(int argc, char **argv)
|
||||
doit[D_CBC_128_AES] = 1;
|
||||
doit[D_CBC_192_AES] = 1;
|
||||
doit[D_CBC_256_AES] = 1;
|
||||
} else if (strcmp(*argv, "ghash") == 0) {
|
||||
doit[D_GHASH] = 1;
|
||||
} else
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CAMELLIA
|
||||
@@ -1369,7 +1329,6 @@ int MAIN(int argc, char **argv)
|
||||
c[D_IGE_128_AES][0] = count;
|
||||
c[D_IGE_192_AES][0] = count;
|
||||
c[D_IGE_256_AES][0] = count;
|
||||
c[D_GHASH][0] = count;
|
||||
|
||||
for (i = 1; i < SIZE_NUM; i++) {
|
||||
c[D_MD2][i] = c[D_MD2][0] * 4 * lengths[0] / lengths[i];
|
||||
@@ -1538,7 +1497,7 @@ int MAIN(int argc, char **argv)
|
||||
# error "You cannot disable DES on systems without SIGALRM."
|
||||
# endif /* OPENSSL_NO_DES */
|
||||
# else
|
||||
# define COND(c) (run && count<0x7fffffff)
|
||||
# define COND(c) (run)
|
||||
# define COUNT(d) (count)
|
||||
# ifndef _WIN32
|
||||
signal(SIGALRM, sig_done);
|
||||
@@ -1805,21 +1764,6 @@ int MAIN(int argc, char **argv)
|
||||
print_result(D_IGE_256_AES, j, count, d);
|
||||
}
|
||||
}
|
||||
if (doit[D_GHASH]) {
|
||||
GCM128_CONTEXT *ctx =
|
||||
CRYPTO_gcm128_new(&aes_ks1, (block128_f) AES_encrypt);
|
||||
CRYPTO_gcm128_setiv(ctx, (unsigned char *)"0123456789ab", 12);
|
||||
|
||||
for (j = 0; j < SIZE_NUM; j++) {
|
||||
print_message(names[D_GHASH], c[D_GHASH][j], lengths[j]);
|
||||
Time_F(START);
|
||||
for (count = 0, run = 1; COND(c[D_GHASH][j]); count++)
|
||||
CRYPTO_gcm128_aad(ctx, buf, lengths[j]);
|
||||
d = Time_F(STOP);
|
||||
print_result(D_GHASH, j, count, d);
|
||||
}
|
||||
CRYPTO_gcm128_release(ctx);
|
||||
}
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CAMELLIA
|
||||
if (doit[D_CBC_128_CML]) {
|
||||
@@ -1947,20 +1891,6 @@ int MAIN(int argc, char **argv)
|
||||
# endif
|
||||
|
||||
if (doit[D_EVP]) {
|
||||
# ifdef EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
|
||||
if (multiblock && evp_cipher) {
|
||||
if (!
|
||||
(EVP_CIPHER_flags(evp_cipher) &
|
||||
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) {
|
||||
fprintf(stderr, "%s is not multi-block capable\n",
|
||||
OBJ_nid2ln(evp_cipher->nid));
|
||||
goto end;
|
||||
}
|
||||
multiblock_speed(evp_cipher);
|
||||
mret = 0;
|
||||
goto end;
|
||||
}
|
||||
# endif
|
||||
for (j = 0; j < SIZE_NUM; j++) {
|
||||
if (evp_cipher) {
|
||||
EVP_CIPHER_CTX ctx;
|
||||
@@ -2557,7 +2487,7 @@ static void pkey_print_message(const char *str, const char *str2, long num,
|
||||
mr ? "+DTP:%d:%s:%s:%d\n"
|
||||
: "Doing %d bit %s %s's for %ds: ", bits, str, str2, tm);
|
||||
(void)BIO_flush(bio_err);
|
||||
alarm(tm);
|
||||
alarm(RSA_SECONDS);
|
||||
# else
|
||||
BIO_printf(bio_err,
|
||||
mr ? "+DNP:%ld:%d:%s:%s\n"
|
||||
@@ -2762,104 +2692,4 @@ static int do_multi(int multi)
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
|
||||
static void multiblock_speed(const EVP_CIPHER *evp_cipher)
|
||||
{
|
||||
static int mblengths[] =
|
||||
{ 8 * 1024, 2 * 8 * 1024, 4 * 8 * 1024, 8 * 8 * 1024, 8 * 16 * 1024 };
|
||||
int j, count, num = sizeof(lengths) / sizeof(lengths[0]);
|
||||
const char *alg_name;
|
||||
unsigned char *inp, *out, no_key[32], no_iv[16];
|
||||
EVP_CIPHER_CTX ctx;
|
||||
double d = 0.0;
|
||||
|
||||
inp = OPENSSL_malloc(mblengths[num - 1]);
|
||||
out = OPENSSL_malloc(mblengths[num - 1] + 1024);
|
||||
|
||||
EVP_CIPHER_CTX_init(&ctx);
|
||||
EVP_EncryptInit_ex(&ctx, evp_cipher, NULL, no_key, no_iv);
|
||||
EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_AEAD_SET_MAC_KEY, sizeof(no_key),
|
||||
no_key);
|
||||
alg_name = OBJ_nid2ln(evp_cipher->nid);
|
||||
|
||||
for (j = 0; j < num; j++) {
|
||||
print_message(alg_name, 0, mblengths[j]);
|
||||
Time_F(START);
|
||||
for (count = 0, run = 1; run && count < 0x7fffffff; count++) {
|
||||
unsigned char aad[13];
|
||||
EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
|
||||
size_t len = mblengths[j];
|
||||
int packlen;
|
||||
|
||||
memset(aad, 0, 8); /* avoid uninitialized values */
|
||||
aad[8] = 23; /* SSL3_RT_APPLICATION_DATA */
|
||||
aad[9] = 3; /* version */
|
||||
aad[10] = 2;
|
||||
aad[11] = 0; /* length */
|
||||
aad[12] = 0;
|
||||
mb_param.out = NULL;
|
||||
mb_param.inp = aad;
|
||||
mb_param.len = len;
|
||||
mb_param.interleave = 8;
|
||||
|
||||
packlen = EVP_CIPHER_CTX_ctrl(&ctx,
|
||||
EVP_CTRL_TLS1_1_MULTIBLOCK_AAD,
|
||||
sizeof(mb_param), &mb_param);
|
||||
|
||||
if (packlen > 0) {
|
||||
mb_param.out = out;
|
||||
mb_param.inp = inp;
|
||||
mb_param.len = len;
|
||||
EVP_CIPHER_CTX_ctrl(&ctx,
|
||||
EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT,
|
||||
sizeof(mb_param), &mb_param);
|
||||
} else {
|
||||
int pad;
|
||||
|
||||
RAND_bytes(out, 16);
|
||||
len += 16;
|
||||
aad[11] = len >> 8;
|
||||
aad[12] = len;
|
||||
pad = EVP_CIPHER_CTX_ctrl(&ctx,
|
||||
EVP_CTRL_AEAD_TLS1_AAD, 13, aad);
|
||||
EVP_Cipher(&ctx, out, inp, len + pad);
|
||||
}
|
||||
}
|
||||
d = Time_F(STOP);
|
||||
BIO_printf(bio_err,
|
||||
mr ? "+R:%d:%s:%f\n"
|
||||
: "%d %s's in %.2fs\n", count, "evp", d);
|
||||
results[D_EVP][j] = ((double)count) / d * mblengths[j];
|
||||
}
|
||||
|
||||
if (mr) {
|
||||
fprintf(stdout, "+H");
|
||||
for (j = 0; j < num; j++)
|
||||
fprintf(stdout, ":%d", mblengths[j]);
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "+F:%d:%s", D_EVP, alg_name);
|
||||
for (j = 0; j < num; j++)
|
||||
fprintf(stdout, ":%.2f", results[D_EVP][j]);
|
||||
fprintf(stdout, "\n");
|
||||
} else {
|
||||
fprintf(stdout,
|
||||
"The 'numbers' are in 1000s of bytes per second processed.\n");
|
||||
fprintf(stdout, "type ");
|
||||
for (j = 0; j < num; j++)
|
||||
fprintf(stdout, "%7d bytes", mblengths[j]);
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "%-24s", alg_name);
|
||||
|
||||
for (j = 0; j < num; j++) {
|
||||
if (results[D_EVP][j] > 10000)
|
||||
fprintf(stdout, " %11.2fk", results[D_EVP][j] / 1e3);
|
||||
else
|
||||
fprintf(stdout, " %11.2f ", results[D_EVP][j]);
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
OPENSSL_free(inp);
|
||||
OPENSSL_free(out);
|
||||
}
|
||||
#endif
|
||||
|
||||
760
apps/srp.c
760
apps/srp.c
@@ -1,760 +0,0 @@
|
||||
/* apps/srp.c */
|
||||
/*
|
||||
* Written by Peter Sylvester (peter.sylvester@edelweb.fr) for the EdelKey
|
||||
* project and contributed to the OpenSSL project 2004.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2004 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 <openssl/opensslconf.h>
|
||||
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <openssl/conf.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/err.h>
|
||||
# include <openssl/txt_db.h>
|
||||
# include <openssl/buffer.h>
|
||||
# include <openssl/srp.h>
|
||||
|
||||
# include "apps.h"
|
||||
|
||||
# undef PROG
|
||||
# define PROG srp_main
|
||||
|
||||
# define BASE_SECTION "srp"
|
||||
# define CONFIG_FILE "openssl.cnf"
|
||||
|
||||
# define ENV_RANDFILE "RANDFILE"
|
||||
|
||||
# define ENV_DATABASE "srpvfile"
|
||||
# define ENV_DEFAULT_SRP "default_srp"
|
||||
|
||||
static char *srp_usage[] = {
|
||||
"usage: srp [args] [user] \n",
|
||||
"\n",
|
||||
" -verbose Talk alot while doing things\n",
|
||||
" -config file A config file\n",
|
||||
" -name arg The particular srp definition to use\n",
|
||||
" -srpvfile arg The srp verifier file name\n",
|
||||
" -add add an user and srp verifier\n",
|
||||
" -modify modify the srp verifier of an existing user\n",
|
||||
" -delete delete user from verifier file\n",
|
||||
" -list list user\n",
|
||||
" -gn arg g and N values to be used for new verifier\n",
|
||||
" -userinfo arg additional info to be set for user\n",
|
||||
" -passin arg input file pass phrase source\n",
|
||||
" -passout arg output file pass phrase source\n",
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
" -engine e - use engine e, possibly a hardware device.\n",
|
||||
# endif
|
||||
NULL
|
||||
};
|
||||
|
||||
# ifdef EFENCE
|
||||
extern int EF_PROTECT_FREE;
|
||||
extern int EF_PROTECT_BELOW;
|
||||
extern int EF_ALIGNMENT;
|
||||
# endif
|
||||
|
||||
static CONF *conf = NULL;
|
||||
static char *section = NULL;
|
||||
|
||||
# define VERBOSE if (verbose)
|
||||
# define VVERBOSE if (verbose>1)
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
static int get_index(CA_DB *db, char *id, char type)
|
||||
{
|
||||
char **pp;
|
||||
int i;
|
||||
if (id == NULL)
|
||||
return -1;
|
||||
if (type == DB_SRP_INDEX)
|
||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
||||
if (pp[DB_srptype][0] == DB_SRP_INDEX
|
||||
&& !strcmp(id, pp[DB_srpid]))
|
||||
return i;
|
||||
} else
|
||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
||||
|
||||
if (pp[DB_srptype][0] != DB_SRP_INDEX
|
||||
&& !strcmp(id, pp[DB_srpid]))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void print_entry(CA_DB *db, BIO *bio, int indx, int verbose, char *s)
|
||||
{
|
||||
if (indx >= 0 && verbose) {
|
||||
int j;
|
||||
char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);
|
||||
BIO_printf(bio, "%s \"%s\"\n", s, pp[DB_srpid]);
|
||||
for (j = 0; j < DB_NUMBER; j++) {
|
||||
BIO_printf(bio_err, " %d = \"%s\"\n", j, pp[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void print_index(CA_DB *db, BIO *bio, int indexindex, int verbose)
|
||||
{
|
||||
print_entry(db, bio, indexindex, verbose, "g N entry");
|
||||
}
|
||||
|
||||
static void print_user(CA_DB *db, BIO *bio, int userindex, int verbose)
|
||||
{
|
||||
if (verbose > 0) {
|
||||
char **pp = sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
||||
|
||||
if (pp[DB_srptype][0] != 'I') {
|
||||
print_entry(db, bio, userindex, verbose, "User entry");
|
||||
print_entry(db, bio, get_index(db, pp[DB_srpgN], 'I'), verbose,
|
||||
"g N entry");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static int update_index(CA_DB *db, BIO *bio, char **row)
|
||||
{
|
||||
char **irow;
|
||||
int i;
|
||||
|
||||
if ((irow =
|
||||
(char **)OPENSSL_malloc(sizeof(char *) * (DB_NUMBER + 1))) == NULL) {
|
||||
BIO_printf(bio_err, "Memory allocation failure\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < DB_NUMBER; i++) {
|
||||
irow[i] = row[i];
|
||||
row[i] = NULL;
|
||||
}
|
||||
irow[DB_NUMBER] = NULL;
|
||||
|
||||
if (!TXT_DB_insert(db->db, irow)) {
|
||||
BIO_printf(bio, "failed to update srpvfile\n");
|
||||
BIO_printf(bio, "TXT_DB error number %ld\n", db->db->error);
|
||||
OPENSSL_free(irow);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void lookup_fail(const char *name, char *tag)
|
||||
{
|
||||
BIO_printf(bio_err, "variable lookup failed for %s::%s\n", name, tag);
|
||||
}
|
||||
|
||||
static char *srp_verify_user(const char *user, const char *srp_verifier,
|
||||
char *srp_usersalt, const char *g, const char *N,
|
||||
const char *passin, BIO *bio, int verbose)
|
||||
{
|
||||
char password[1024];
|
||||
PW_CB_DATA cb_tmp;
|
||||
char *verifier = NULL;
|
||||
char *gNid = NULL;
|
||||
|
||||
cb_tmp.prompt_info = user;
|
||||
cb_tmp.password = passin;
|
||||
|
||||
if (password_callback(password, 1024, 0, &cb_tmp) > 0) {
|
||||
VERBOSE BIO_printf(bio,
|
||||
"Validating\n user=\"%s\"\n srp_verifier=\"%s\"\n srp_usersalt=\"%s\"\n g=\"%s\"\n N=\"%s\"\n",
|
||||
user, srp_verifier, srp_usersalt, g, N);
|
||||
BIO_printf(bio, "Pass %s\n", password);
|
||||
|
||||
if (!
|
||||
(gNid =
|
||||
SRP_create_verifier(user, password, &srp_usersalt, &verifier, N,
|
||||
g))) {
|
||||
BIO_printf(bio, "Internal error validating SRP verifier\n");
|
||||
} else {
|
||||
if (strcmp(verifier, srp_verifier))
|
||||
gNid = NULL;
|
||||
OPENSSL_free(verifier);
|
||||
}
|
||||
}
|
||||
return gNid;
|
||||
}
|
||||
|
||||
static char *srp_create_user(char *user, char **srp_verifier,
|
||||
char **srp_usersalt, char *g, char *N,
|
||||
char *passout, BIO *bio, int verbose)
|
||||
{
|
||||
char password[1024];
|
||||
PW_CB_DATA cb_tmp;
|
||||
char *gNid = NULL;
|
||||
char *salt = NULL;
|
||||
cb_tmp.prompt_info = user;
|
||||
cb_tmp.password = passout;
|
||||
|
||||
if (password_callback(password, 1024, 1, &cb_tmp) > 0) {
|
||||
VERBOSE BIO_printf(bio,
|
||||
"Creating\n user=\"%s\"\n g=\"%s\"\n N=\"%s\"\n",
|
||||
user, g, N);
|
||||
if (!
|
||||
(gNid =
|
||||
SRP_create_verifier(user, password, &salt, srp_verifier, N,
|
||||
g))) {
|
||||
BIO_printf(bio, "Internal error creating SRP verifier\n");
|
||||
} else
|
||||
*srp_usersalt = salt;
|
||||
VVERBOSE BIO_printf(bio, "gNid=%s salt =\"%s\"\n verifier =\"%s\"\n",
|
||||
gNid, salt, *srp_verifier);
|
||||
|
||||
}
|
||||
return gNid;
|
||||
}
|
||||
|
||||
int MAIN(int argc, char **argv)
|
||||
{
|
||||
int add_user = 0;
|
||||
int list_user = 0;
|
||||
int delete_user = 0;
|
||||
int modify_user = 0;
|
||||
char *user = NULL;
|
||||
|
||||
char *passargin = NULL, *passargout = NULL;
|
||||
char *passin = NULL, *passout = NULL;
|
||||
char *gN = NULL;
|
||||
int gNindex = -1;
|
||||
char **gNrow = NULL;
|
||||
int maxgN = -1;
|
||||
|
||||
char *userinfo = NULL;
|
||||
|
||||
int badops = 0;
|
||||
int ret = 1;
|
||||
int errors = 0;
|
||||
int verbose = 0;
|
||||
int doupdatedb = 0;
|
||||
char *configfile = NULL;
|
||||
char *dbfile = NULL;
|
||||
CA_DB *db = NULL;
|
||||
char **pp;
|
||||
int i;
|
||||
long errorline = -1;
|
||||
char *randfile = NULL;
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
char *engine = NULL;
|
||||
# endif
|
||||
char *tofree = NULL;
|
||||
DB_ATTR db_attr;
|
||||
|
||||
# ifdef EFENCE
|
||||
EF_PROTECT_FREE = 1;
|
||||
EF_PROTECT_BELOW = 1;
|
||||
EF_ALIGNMENT = 0;
|
||||
# endif
|
||||
|
||||
apps_startup();
|
||||
|
||||
conf = NULL;
|
||||
section = NULL;
|
||||
|
||||
if (bio_err == NULL)
|
||||
if ((bio_err = BIO_new(BIO_s_file())) != NULL)
|
||||
BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
while (argc >= 1 && badops == 0) {
|
||||
if (strcmp(*argv, "-verbose") == 0)
|
||||
verbose++;
|
||||
else if (strcmp(*argv, "-config") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
configfile = *(++argv);
|
||||
} else if (strcmp(*argv, "-name") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
section = *(++argv);
|
||||
} else if (strcmp(*argv, "-srpvfile") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
dbfile = *(++argv);
|
||||
} else if (strcmp(*argv, "-add") == 0)
|
||||
add_user = 1;
|
||||
else if (strcmp(*argv, "-delete") == 0)
|
||||
delete_user = 1;
|
||||
else if (strcmp(*argv, "-modify") == 0)
|
||||
modify_user = 1;
|
||||
else if (strcmp(*argv, "-list") == 0)
|
||||
list_user = 1;
|
||||
else if (strcmp(*argv, "-gn") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
gN = *(++argv);
|
||||
} else if (strcmp(*argv, "-userinfo") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
userinfo = *(++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);
|
||||
}
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
else if (strcmp(*argv, "-engine") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
engine = *(++argv);
|
||||
}
|
||||
# endif
|
||||
|
||||
else if (**argv == '-') {
|
||||
bad:
|
||||
BIO_printf(bio_err, "unknown option %s\n", *argv);
|
||||
badops = 1;
|
||||
break;
|
||||
} else
|
||||
break;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (dbfile && configfile) {
|
||||
BIO_printf(bio_err,
|
||||
"-dbfile and -configfile cannot be specified together.\n");
|
||||
badops = 1;
|
||||
}
|
||||
if (add_user + delete_user + modify_user + list_user != 1) {
|
||||
BIO_printf(bio_err,
|
||||
"Exactly one of the options -add, -delete, -modify -list must be specified.\n");
|
||||
badops = 1;
|
||||
}
|
||||
if (delete_user + modify_user + delete_user == 1 && argc <= 0) {
|
||||
BIO_printf(bio_err,
|
||||
"Need at least one user for options -add, -delete, -modify. \n");
|
||||
badops = 1;
|
||||
}
|
||||
if ((passin || passout) && argc != 1) {
|
||||
BIO_printf(bio_err,
|
||||
"-passin, -passout arguments only valid with one user.\n");
|
||||
badops = 1;
|
||||
}
|
||||
|
||||
if (badops) {
|
||||
for (pp = srp_usage; (*pp != NULL); pp++)
|
||||
BIO_printf(bio_err, "%s", *pp);
|
||||
|
||||
BIO_printf(bio_err, " -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR,
|
||||
LIST_SEPARATOR_CHAR);
|
||||
BIO_printf(bio_err,
|
||||
" load the file (or the files in the directory) into\n");
|
||||
BIO_printf(bio_err, " the random number generator\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
setup_engine(bio_err, engine, 0);
|
||||
# endif
|
||||
|
||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!dbfile) {
|
||||
|
||||
/*****************************************************************/
|
||||
tofree = NULL;
|
||||
if (configfile == NULL)
|
||||
configfile = getenv("OPENSSL_CONF");
|
||||
if (configfile == NULL)
|
||||
configfile = getenv("SSLEAY_CONF");
|
||||
if (configfile == NULL) {
|
||||
const char *s = X509_get_default_cert_area();
|
||||
size_t len;
|
||||
|
||||
# ifdef OPENSSL_SYS_VMS
|
||||
len = strlen(s) + sizeof(CONFIG_FILE);
|
||||
tofree = OPENSSL_malloc(len);
|
||||
strcpy(tofree, s);
|
||||
# else
|
||||
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
|
||||
tofree = OPENSSL_malloc(len);
|
||||
BUF_strlcpy(tofree, s, len);
|
||||
BUF_strlcat(tofree, "/", len);
|
||||
# endif
|
||||
BUF_strlcat(tofree, CONFIG_FILE, len);
|
||||
configfile = tofree;
|
||||
}
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "Using configuration from %s\n",
|
||||
configfile);
|
||||
conf = NCONF_new(NULL);
|
||||
if (NCONF_load(conf, configfile, &errorline) <= 0) {
|
||||
if (errorline <= 0)
|
||||
BIO_printf(bio_err, "error loading the config file '%s'\n",
|
||||
configfile);
|
||||
else
|
||||
BIO_printf(bio_err, "error on line %ld of config file '%s'\n",
|
||||
errorline, configfile);
|
||||
goto err;
|
||||
}
|
||||
if (tofree) {
|
||||
OPENSSL_free(tofree);
|
||||
tofree = NULL;
|
||||
}
|
||||
|
||||
if (!load_config(bio_err, conf))
|
||||
goto err;
|
||||
|
||||
/* Lets get the config section we are using */
|
||||
if (section == NULL) {
|
||||
VERBOSE BIO_printf(bio_err,
|
||||
"trying to read " ENV_DEFAULT_SRP
|
||||
" in \" BASE_SECTION \"\n");
|
||||
|
||||
section = NCONF_get_string(conf, BASE_SECTION, ENV_DEFAULT_SRP);
|
||||
if (section == NULL) {
|
||||
lookup_fail(BASE_SECTION, ENV_DEFAULT_SRP);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (randfile == NULL && conf)
|
||||
randfile = NCONF_get_string(conf, BASE_SECTION, "RANDFILE");
|
||||
|
||||
VERBOSE BIO_printf(bio_err,
|
||||
"trying to read " ENV_DATABASE
|
||||
" in section \"%s\"\n", section);
|
||||
|
||||
if ((dbfile = NCONF_get_string(conf, section, ENV_DATABASE)) == NULL) {
|
||||
lookup_fail(section, ENV_DATABASE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
}
|
||||
if (randfile == NULL)
|
||||
ERR_clear_error();
|
||||
else
|
||||
app_RAND_load_file(randfile, bio_err, 0);
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "Trying to read SRP verifier file \"%s\"\n",
|
||||
dbfile);
|
||||
|
||||
db = load_index(dbfile, &db_attr);
|
||||
if (db == NULL)
|
||||
goto err;
|
||||
|
||||
/* Lets check some fields */
|
||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
||||
|
||||
if (pp[DB_srptype][0] == DB_SRP_INDEX) {
|
||||
maxgN = i;
|
||||
if (gNindex < 0 && gN != NULL && !strcmp(gN, pp[DB_srpid]))
|
||||
gNindex = i;
|
||||
|
||||
print_index(db, bio_err, i, verbose > 1);
|
||||
}
|
||||
}
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "Database initialised\n");
|
||||
|
||||
if (gNindex >= 0) {
|
||||
gNrow = sk_OPENSSL_PSTRING_value(db->db->data, gNindex);
|
||||
print_entry(db, bio_err, gNindex, verbose > 1, "Default g and N");
|
||||
} else if (maxgN > 0 && !SRP_get_default_gN(gN)) {
|
||||
BIO_printf(bio_err, "No g and N value for index \"%s\"\n", gN);
|
||||
goto err;
|
||||
} else {
|
||||
VERBOSE BIO_printf(bio_err, "Database has no g N information.\n");
|
||||
gNrow = NULL;
|
||||
}
|
||||
|
||||
VVERBOSE BIO_printf(bio_err, "Starting user processing\n");
|
||||
|
||||
if (argc > 0)
|
||||
user = *(argv++);
|
||||
|
||||
while (list_user || user) {
|
||||
int userindex = -1;
|
||||
if (user)
|
||||
VVERBOSE BIO_printf(bio_err, "Processing user \"%s\"\n", user);
|
||||
if ((userindex = get_index(db, user, 'U')) >= 0) {
|
||||
print_user(db, bio_err, userindex, (verbose > 0) || list_user);
|
||||
}
|
||||
|
||||
if (list_user) {
|
||||
if (user == NULL) {
|
||||
BIO_printf(bio_err, "List all users\n");
|
||||
|
||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
||||
print_user(db, bio_err, i, 1);
|
||||
}
|
||||
list_user = 0;
|
||||
} else if (userindex < 0) {
|
||||
BIO_printf(bio_err,
|
||||
"user \"%s\" does not exist, ignored. t\n", user);
|
||||
errors++;
|
||||
}
|
||||
} else if (add_user) {
|
||||
if (userindex >= 0) {
|
||||
/* reactivation of a new user */
|
||||
char **row =
|
||||
sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
||||
BIO_printf(bio_err, "user \"%s\" reactivated.\n", user);
|
||||
row[DB_srptype][0] = 'V';
|
||||
|
||||
doupdatedb = 1;
|
||||
} else {
|
||||
char *row[DB_NUMBER];
|
||||
char *gNid;
|
||||
row[DB_srpverifier] = NULL;
|
||||
row[DB_srpsalt] = NULL;
|
||||
row[DB_srpinfo] = NULL;
|
||||
if (!
|
||||
(gNid =
|
||||
srp_create_user(user, &(row[DB_srpverifier]),
|
||||
&(row[DB_srpsalt]),
|
||||
gNrow ? gNrow[DB_srpsalt] : gN,
|
||||
gNrow ? gNrow[DB_srpverifier] : NULL,
|
||||
passout, bio_err, verbose))) {
|
||||
BIO_printf(bio_err,
|
||||
"Cannot create srp verifier for user \"%s\", operation abandoned .\n",
|
||||
user);
|
||||
errors++;
|
||||
goto err;
|
||||
}
|
||||
row[DB_srpid] = BUF_strdup(user);
|
||||
row[DB_srptype] = BUF_strdup("v");
|
||||
row[DB_srpgN] = BUF_strdup(gNid);
|
||||
|
||||
if (!row[DB_srpid] || !row[DB_srpgN] || !row[DB_srptype]
|
||||
|| !row[DB_srpverifier] || !row[DB_srpsalt] || (userinfo
|
||||
&&
|
||||
(!(row
|
||||
[DB_srpinfo]
|
||||
=
|
||||
BUF_strdup
|
||||
(userinfo))))
|
||||
|| !update_index(db, bio_err, row)) {
|
||||
if (row[DB_srpid])
|
||||
OPENSSL_free(row[DB_srpid]);
|
||||
if (row[DB_srpgN])
|
||||
OPENSSL_free(row[DB_srpgN]);
|
||||
if (row[DB_srpinfo])
|
||||
OPENSSL_free(row[DB_srpinfo]);
|
||||
if (row[DB_srptype])
|
||||
OPENSSL_free(row[DB_srptype]);
|
||||
if (row[DB_srpverifier])
|
||||
OPENSSL_free(row[DB_srpverifier]);
|
||||
if (row[DB_srpsalt])
|
||||
OPENSSL_free(row[DB_srpsalt]);
|
||||
goto err;
|
||||
}
|
||||
doupdatedb = 1;
|
||||
}
|
||||
} else if (modify_user) {
|
||||
if (userindex < 0) {
|
||||
BIO_printf(bio_err,
|
||||
"user \"%s\" does not exist, operation ignored.\n",
|
||||
user);
|
||||
errors++;
|
||||
} else {
|
||||
|
||||
char **row =
|
||||
sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
||||
char type = row[DB_srptype][0];
|
||||
if (type == 'v') {
|
||||
BIO_printf(bio_err,
|
||||
"user \"%s\" already updated, operation ignored.\n",
|
||||
user);
|
||||
errors++;
|
||||
} else {
|
||||
char *gNid;
|
||||
|
||||
if (row[DB_srptype][0] == 'V') {
|
||||
int user_gN;
|
||||
char **irow = NULL;
|
||||
VERBOSE BIO_printf(bio_err,
|
||||
"Verifying password for user \"%s\"\n",
|
||||
user);
|
||||
if ((user_gN =
|
||||
get_index(db, row[DB_srpgN], DB_SRP_INDEX)) >= 0)
|
||||
irow =
|
||||
(char **)sk_OPENSSL_PSTRING_value(db->
|
||||
db->data,
|
||||
userindex);
|
||||
|
||||
if (!srp_verify_user
|
||||
(user, row[DB_srpverifier], row[DB_srpsalt],
|
||||
irow ? irow[DB_srpsalt] : row[DB_srpgN],
|
||||
irow ? irow[DB_srpverifier] : NULL, passin,
|
||||
bio_err, verbose)) {
|
||||
BIO_printf(bio_err,
|
||||
"Invalid password for user \"%s\", operation abandoned.\n",
|
||||
user);
|
||||
errors++;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
VERBOSE BIO_printf(bio_err,
|
||||
"Password for user \"%s\" ok.\n",
|
||||
user);
|
||||
|
||||
if (!
|
||||
(gNid =
|
||||
srp_create_user(user, &(row[DB_srpverifier]),
|
||||
&(row[DB_srpsalt]),
|
||||
gNrow ? gNrow[DB_srpsalt] : NULL,
|
||||
gNrow ? gNrow[DB_srpverifier] : NULL,
|
||||
passout, bio_err, verbose))) {
|
||||
BIO_printf(bio_err,
|
||||
"Cannot create srp verifier for user \"%s\", operation abandoned.\n",
|
||||
user);
|
||||
errors++;
|
||||
goto err;
|
||||
}
|
||||
|
||||
row[DB_srptype][0] = 'v';
|
||||
row[DB_srpgN] = BUF_strdup(gNid);
|
||||
|
||||
if (!row[DB_srpid] || !row[DB_srpgN] || !row[DB_srptype]
|
||||
|| !row[DB_srpverifier] || !row[DB_srpsalt]
|
||||
|| (userinfo
|
||||
&& (!(row[DB_srpinfo] = BUF_strdup(userinfo)))))
|
||||
goto err;
|
||||
|
||||
doupdatedb = 1;
|
||||
}
|
||||
}
|
||||
} else if (delete_user) {
|
||||
if (userindex < 0) {
|
||||
BIO_printf(bio_err,
|
||||
"user \"%s\" does not exist, operation ignored. t\n",
|
||||
user);
|
||||
errors++;
|
||||
} else {
|
||||
char **xpp =
|
||||
sk_OPENSSL_PSTRING_value(db->db->data, userindex);
|
||||
BIO_printf(bio_err, "user \"%s\" revoked. t\n", user);
|
||||
|
||||
xpp[DB_srptype][0] = 'R';
|
||||
|
||||
doupdatedb = 1;
|
||||
}
|
||||
}
|
||||
if (--argc > 0)
|
||||
user = *(argv++);
|
||||
else {
|
||||
user = NULL;
|
||||
list_user = 0;
|
||||
}
|
||||
}
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "User procession done.\n");
|
||||
|
||||
if (doupdatedb) {
|
||||
/* Lets check some fields */
|
||||
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
|
||||
pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
|
||||
|
||||
if (pp[DB_srptype][0] == 'v') {
|
||||
pp[DB_srptype][0] = 'V';
|
||||
print_user(db, bio_err, i, verbose);
|
||||
}
|
||||
}
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "Trying to update srpvfile.\n");
|
||||
if (!save_index(dbfile, "new", db))
|
||||
goto err;
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "Temporary srpvfile created.\n");
|
||||
if (!rotate_index(dbfile, "new", "old"))
|
||||
goto err;
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "srpvfile updated.\n");
|
||||
}
|
||||
|
||||
ret = (errors != 0);
|
||||
err:
|
||||
if (errors != 0)
|
||||
VERBOSE BIO_printf(bio_err, "User errors %d.\n", errors);
|
||||
|
||||
VERBOSE BIO_printf(bio_err, "SRP terminating with code %d.\n", ret);
|
||||
if (tofree)
|
||||
OPENSSL_free(tofree);
|
||||
if (ret)
|
||||
ERR_print_errors(bio_err);
|
||||
if (randfile)
|
||||
app_RAND_write_file(randfile, bio_err);
|
||||
if (conf)
|
||||
NCONF_free(conf);
|
||||
if (db)
|
||||
free_index(db);
|
||||
|
||||
OBJ_cleanup();
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -88,7 +88,6 @@ int MAIN(int argc, char **argv)
|
||||
X509_STORE *cert_ctx = NULL;
|
||||
X509_LOOKUP *lookup = NULL;
|
||||
X509_VERIFY_PARAM *vpm = NULL;
|
||||
int crl_download = 0;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine = NULL;
|
||||
#endif
|
||||
@@ -137,8 +136,7 @@ int MAIN(int argc, char **argv)
|
||||
if (argc-- < 1)
|
||||
goto end;
|
||||
crlfile = *(++argv);
|
||||
} else if (strcmp(*argv, "-crl_download") == 0)
|
||||
crl_download = 1;
|
||||
}
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
else if (strcmp(*argv, "-engine") == 0) {
|
||||
if (--argc < 1)
|
||||
@@ -215,29 +213,20 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
if (crl_download)
|
||||
store_setup_crl_download(cert_ctx);
|
||||
if (argc < 1) {
|
||||
if (1 != check(cert_ctx, NULL, untrusted, trusted, crls, e))
|
||||
ret = -1;
|
||||
} else {
|
||||
if (argc < 1)
|
||||
check(cert_ctx, NULL, untrusted, trusted, crls, e);
|
||||
else
|
||||
for (i = 0; i < argc; i++)
|
||||
if (1 != check(cert_ctx, argv[i], untrusted, trusted, crls, e))
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
check(cert_ctx, argv[i], untrusted, trusted, crls, e);
|
||||
ret = 0;
|
||||
end:
|
||||
if (ret == 1) {
|
||||
BIO_printf(bio_err,
|
||||
"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
|
||||
BIO_printf(bio_err, " [-attime timestamp]");
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
BIO_printf(bio_err, " [-engine e]");
|
||||
#endif
|
||||
BIO_printf(bio_err, " cert1 cert2 ...\n");
|
||||
|
||||
BIO_printf(bio_err, "recognized usages:\n");
|
||||
for (i = 0; i < X509_PURPOSE_get_count(); i++) {
|
||||
X509_PURPOSE *ptmp;
|
||||
@@ -255,7 +244,7 @@ int MAIN(int argc, char **argv)
|
||||
sk_X509_pop_free(trusted, X509_free);
|
||||
sk_X509_CRL_pop_free(crls, X509_CRL_free);
|
||||
apps_shutdown();
|
||||
OPENSSL_EXIT(ret < 0 ? 2 : ret);
|
||||
OPENSSL_EXIT(ret);
|
||||
}
|
||||
|
||||
static int check(X509_STORE *ctx, char *file,
|
||||
|
||||
106
apps/x509.c
106
apps/x509.c
@@ -150,9 +150,6 @@ static const char *x509_usage[] = {
|
||||
" -engine e - use engine e, possibly a hardware device.\n",
|
||||
#endif
|
||||
" -certopt arg - various certificate text options\n",
|
||||
" -checkhost host - check certificate matches \"host\"\n",
|
||||
" -checkemail email - check certificate matches \"email\"\n",
|
||||
" -checkip ipaddr - check certificate matches \"ipaddr\"\n",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -160,15 +157,11 @@ static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
|
||||
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext,
|
||||
const EVP_MD *digest, CONF *conf, char *section);
|
||||
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
X509 *x, X509 *xca, EVP_PKEY *pkey,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts, char *serial,
|
||||
X509 *x, X509 *xca, EVP_PKEY *pkey, char *serial,
|
||||
int create, int days, int clrext, CONF *conf,
|
||||
char *section, ASN1_INTEGER *sno);
|
||||
static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt);
|
||||
static int reqfile = 0;
|
||||
#ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
|
||||
static int force_version = 2;
|
||||
#endif
|
||||
|
||||
int MAIN(int, char **);
|
||||
|
||||
@@ -179,17 +172,15 @@ int MAIN(int argc, char **argv)
|
||||
X509_REQ *req = NULL;
|
||||
X509 *x = NULL, *xca = NULL;
|
||||
ASN1_OBJECT *objtmp;
|
||||
STACK_OF(OPENSSL_STRING) *sigopts = NULL;
|
||||
EVP_PKEY *Upkey = NULL, *CApkey = NULL, *fkey = NULL;
|
||||
EVP_PKEY *Upkey = NULL, *CApkey = NULL;
|
||||
ASN1_INTEGER *sno = NULL;
|
||||
int i, num, badops = 0, badsig = 0;
|
||||
int i, num, badops = 0;
|
||||
BIO *out = NULL;
|
||||
BIO *STDout = NULL;
|
||||
STACK_OF(ASN1_OBJECT) *trust = NULL, *reject = NULL;
|
||||
int informat, outformat, keyformat, CAformat, CAkeyformat;
|
||||
char *infile = NULL, *outfile = NULL, *keyfile = NULL, *CAfile = NULL;
|
||||
char *CAkeyfile = NULL, *CAserial = NULL;
|
||||
char *fkeyfile = NULL;
|
||||
char *alias = NULL;
|
||||
int text = 0, serial = 0, subject = 0, issuer = 0, startdate =
|
||||
0, enddate = 0;
|
||||
@@ -215,9 +206,6 @@ int MAIN(int argc, char **argv)
|
||||
int need_rand = 0;
|
||||
int checkend = 0, checkoffset = 0;
|
||||
unsigned long nmflag = 0, certflag = 0;
|
||||
char *checkhost = NULL;
|
||||
char *checkemail = NULL;
|
||||
char *checkip = NULL;
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
char *engine = NULL;
|
||||
#endif
|
||||
@@ -277,27 +265,12 @@ int MAIN(int argc, char **argv)
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
CAkeyformat = str2fmt(*(++argv));
|
||||
} else if (strcmp(*argv, "-sigopt") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
if (!sigopts)
|
||||
sigopts = sk_OPENSSL_STRING_new_null();
|
||||
if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv)))
|
||||
goto bad;
|
||||
}
|
||||
#ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
|
||||
else if (strcmp(*argv, "-force_version") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
force_version = atoi(*(++argv)) - 1;
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(*argv, "-days") == 0) {
|
||||
} else if (strcmp(*argv, "-days") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
days = atoi(*(++argv));
|
||||
if (days == 0) {
|
||||
BIO_printf(bio_err, "bad number of days\n");
|
||||
BIO_printf(STDout, "bad number of days\n");
|
||||
goto bad;
|
||||
}
|
||||
} else if (strcmp(*argv, "-passin") == 0) {
|
||||
@@ -345,10 +318,6 @@ int MAIN(int argc, char **argv)
|
||||
goto bad;
|
||||
if (!(sno = s2i_ASN1_INTEGER(NULL, *(++argv))))
|
||||
goto bad;
|
||||
} else if (strcmp(*argv, "-force_pubkey") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
fkeyfile = *(++argv);
|
||||
} else if (strcmp(*argv, "-addtrust") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
@@ -446,18 +415,6 @@ int MAIN(int argc, char **argv)
|
||||
goto bad;
|
||||
checkoffset = atoi(*(++argv));
|
||||
checkend = 1;
|
||||
} else if (strcmp(*argv, "-checkhost") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
checkhost = *(++argv);
|
||||
} else if (strcmp(*argv, "-checkemail") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
checkemail = *(++argv);
|
||||
} else if (strcmp(*argv, "-checkip") == 0) {
|
||||
if (--argc < 1)
|
||||
goto bad;
|
||||
checkip = *(++argv);
|
||||
} else if (strcmp(*argv, "-noout") == 0)
|
||||
noout = ++num;
|
||||
else if (strcmp(*argv, "-trustout") == 0)
|
||||
@@ -481,8 +438,6 @@ int MAIN(int argc, char **argv)
|
||||
#endif
|
||||
else if (strcmp(*argv, "-ocspid") == 0)
|
||||
ocspid = ++num;
|
||||
else if (strcmp(*argv, "-badsig") == 0)
|
||||
badsig = 1;
|
||||
else if ((md_alg = EVP_get_digestbyname(*argv + 1))) {
|
||||
/* ok */
|
||||
digest = md_alg;
|
||||
@@ -520,13 +475,6 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (fkeyfile) {
|
||||
fkey = load_pubkey(bio_err, fkeyfile, keyformat, 0,
|
||||
NULL, e, "Forced key");
|
||||
if (fkey == NULL)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((CAkeyfile == NULL) && (CA_flag) && (CAformat == FORMAT_PEM)) {
|
||||
CAkeyfile = CAfile;
|
||||
} else if ((CA_flag) && (CAkeyfile == NULL)) {
|
||||
@@ -648,13 +596,10 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
X509_gmtime_adj(X509_get_notBefore(x), 0);
|
||||
X509_time_adj_ex(X509_get_notAfter(x), days, 0, NULL);
|
||||
if (fkey)
|
||||
X509_set_pubkey(x, fkey);
|
||||
else {
|
||||
pkey = X509_REQ_get_pubkey(req);
|
||||
X509_set_pubkey(x, pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
|
||||
pkey = X509_REQ_get_pubkey(req);
|
||||
X509_set_pubkey(x, pkey);
|
||||
EVP_PKEY_free(pkey);
|
||||
} else
|
||||
x = load_cert(bio_err, infile, informat, NULL, e, "Certificate");
|
||||
|
||||
@@ -871,7 +816,7 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
OPENSSL_free(m);
|
||||
} else if (text == i) {
|
||||
X509_print_ex(STDout, x, nmflag, certflag);
|
||||
X509_print_ex(out, x, nmflag, certflag);
|
||||
} else if (startdate == i) {
|
||||
BIO_puts(STDout, "notBefore=");
|
||||
ASN1_TIME_print(STDout, X509_get_notBefore(x));
|
||||
@@ -927,9 +872,8 @@ int MAIN(int argc, char **argv)
|
||||
|
||||
assert(need_rand);
|
||||
if (!x509_certify(ctx, CAfile, digest, x, xca,
|
||||
CApkey, sigopts,
|
||||
CAserial, CA_createserial, days, clrext,
|
||||
extconf, extsect, sno))
|
||||
CApkey, CAserial, CA_createserial, days,
|
||||
clrext, extconf, extsect, sno))
|
||||
goto end;
|
||||
} else if (x509req == i) {
|
||||
EVP_PKEY *pk;
|
||||
@@ -978,16 +922,11 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
print_cert_checks(STDout, x, checkhost, checkemail, checkip);
|
||||
|
||||
if (noout) {
|
||||
ret = 0;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (badsig)
|
||||
x->signature->data[x->signature->length - 1] ^= 0x1;
|
||||
|
||||
if (outformat == FORMAT_ASN1)
|
||||
i = i2d_X509_bio(out, x);
|
||||
else if (outformat == FORMAT_PEM) {
|
||||
@@ -1028,9 +967,6 @@ int MAIN(int argc, char **argv)
|
||||
X509_free(xca);
|
||||
EVP_PKEY_free(Upkey);
|
||||
EVP_PKEY_free(CApkey);
|
||||
EVP_PKEY_free(fkey);
|
||||
if (sigopts)
|
||||
sk_OPENSSL_STRING_free(sigopts);
|
||||
X509_REQ_free(rq);
|
||||
ASN1_INTEGER_free(sno);
|
||||
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
|
||||
@@ -1088,11 +1024,9 @@ static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile,
|
||||
}
|
||||
|
||||
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
X509 *x, X509 *xca, EVP_PKEY *pkey,
|
||||
STACK_OF(OPENSSL_STRING) *sigopts,
|
||||
char *serialfile, int create,
|
||||
int days, int clrext, CONF *conf, char *section,
|
||||
ASN1_INTEGER *sno)
|
||||
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;
|
||||
@@ -1148,18 +1082,14 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
|
||||
|
||||
if (conf) {
|
||||
X509V3_CTX ctx2;
|
||||
#ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
|
||||
X509_set_version(x, force_version);
|
||||
#else
|
||||
X509_set_version(x, 2); /* version 3 certificate */
|
||||
#endif
|
||||
X509V3_set_ctx(&ctx2, xca, x, NULL, NULL, 0);
|
||||
X509V3_set_nconf(&ctx2, conf);
|
||||
if (!X509V3_EXT_add_nconf(conf, &ctx2, section, x))
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!do_X509_sign(bio_err, x, pkey, digest, sigopts))
|
||||
if (!X509_sign(x, pkey, digest))
|
||||
goto end;
|
||||
ret = 1;
|
||||
end:
|
||||
@@ -1237,11 +1167,7 @@ static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext,
|
||||
}
|
||||
if (conf) {
|
||||
X509V3_CTX ctx;
|
||||
#ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
|
||||
X509_set_version(x, force_version);
|
||||
#else
|
||||
X509_set_version(x, 2); /* version 3 certificate */
|
||||
#endif
|
||||
X509V3_set_ctx(&ctx, x, x, NULL, NULL, 0);
|
||||
X509V3_set_nconf(&ctx, conf);
|
||||
if (!X509V3_EXT_add_nconf(conf, &ctx, section, x))
|
||||
|
||||
121
config
121
config
@@ -370,10 +370,6 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
|
||||
NONSTOP_KERNEL*)
|
||||
echo "nsr-tandem-nsk"; exit 0;
|
||||
;;
|
||||
|
||||
vxworks*)
|
||||
echo "${MACHINE}-whatever-vxworks"; exit 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
@@ -411,18 +407,23 @@ exit 0
|
||||
# this is where the translation occurs into SSLeay terms
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
GCCVER=`(gcc -dumpversion) 2>/dev/null`
|
||||
if [ "$GCCVER" != "" ]; then
|
||||
# then strip off whatever prefix egcs prepends the number with...
|
||||
# Hopefully, this will work for any future prefixes as well.
|
||||
GCCVER=`echo $GCCVER | LC_ALL=C 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
|
||||
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||
fi
|
||||
|
||||
# Only set CC if not supplied already
|
||||
if [ -z "$CROSS_COMPILE$CC" ]; then
|
||||
GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null`
|
||||
if [ -z "$CC" ]; then
|
||||
# figure out if gcc is available and if so we use it otherwise
|
||||
# we fallback to whatever cc does on the system
|
||||
if [ "$GCCVER" != "" ]; then
|
||||
# then strip off whatever prefix egcs prepends the number with...
|
||||
# Hopefully, this will work for any future prefixes as well.
|
||||
GCCVER=`echo $GCCVER | LC_ALL=C 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
|
||||
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||
CC=gcc
|
||||
else
|
||||
CC=cc
|
||||
@@ -538,7 +539,7 @@ case "$GUESSOS" in
|
||||
ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
|
||||
ppc-apple-darwin*)
|
||||
ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
|
||||
if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
|
||||
if [ "$ISA64" = "1" ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure darwin64-ppc-cc' *manually*."
|
||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||
@@ -546,14 +547,10 @@ case "$GUESSOS" in
|
||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
fi
|
||||
fi
|
||||
if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
|
||||
OUT="darwin64-ppc-cc"
|
||||
else
|
||||
OUT="darwin-ppc-cc"
|
||||
fi ;;
|
||||
OUT="darwin-ppc-cc" ;;
|
||||
i?86-apple-darwin*)
|
||||
ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
|
||||
if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
|
||||
if [ "$ISA64" = "1" ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure darwin64-x86_64-cc' *manually*."
|
||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||
@@ -561,17 +558,7 @@ case "$GUESSOS" in
|
||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
fi
|
||||
fi
|
||||
if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
|
||||
OUT="darwin64-x86_64-cc"
|
||||
else
|
||||
OUT="darwin-i386-cc"
|
||||
fi ;;
|
||||
armv6+7-*-iphoneos)
|
||||
options="$options -arch%20armv6 -arch%20armv7"
|
||||
OUT="iphoneos-cross" ;;
|
||||
*-*-iphoneos)
|
||||
options="$options -arch%20${MACHINE}"
|
||||
OUT="iphoneos-cross" ;;
|
||||
OUT="darwin-i386-cc" ;;
|
||||
alpha-*-linux2)
|
||||
ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
|
||||
case ${ISA:-generic} in
|
||||
@@ -587,38 +574,15 @@ case "$GUESSOS" in
|
||||
fi
|
||||
;;
|
||||
ppc64-*-linux2)
|
||||
if [ -z "$KERNEL_BITS" ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure linux-ppc64' *manually*."
|
||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
fi
|
||||
fi
|
||||
if [ "$KERNEL_BITS" = "64" ]; then
|
||||
OUT="linux-ppc64"
|
||||
else
|
||||
OUT="linux-ppc"
|
||||
(echo "__LP64__" | gcc -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null) || options="$options -m32"
|
||||
fi
|
||||
;;
|
||||
ppc64le-*-linux2) OUT="linux-ppc64le" ;;
|
||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||
mips64*-*-linux2)
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure linux64-mips64' *manually*."
|
||||
echo " invoke './Configure linux-ppc64' *manually*."
|
||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
fi
|
||||
OUT="linux-mips64"
|
||||
OUT="linux-ppc"
|
||||
;;
|
||||
mips*-*-linux2) OUT="linux-mips32" ;;
|
||||
ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
|
||||
ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;;
|
||||
pentium-*-vxworks*) OUT="vxworks-pentium" ;;
|
||||
simlinux-*-vxworks*) OUT="vxworks-simlinux" ;;
|
||||
mips-*-vxworks*) OUT="vxworks-mips";;
|
||||
ppc-*-linux2) OUT="linux-ppc" ;;
|
||||
ia64-*-linux?) OUT="linux-ia64" ;;
|
||||
sparc64-*-linux2)
|
||||
echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
|
||||
@@ -660,25 +624,12 @@ case "$GUESSOS" in
|
||||
options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
|
||||
OUT="linux-generic32" ;;
|
||||
armv[1-3]*-*-linux2) OUT="linux-generic32" ;;
|
||||
armv[7-9]*-*-linux2) OUT="linux-armv4"; options="$options -march=armv7-a" ;;
|
||||
arm*-*-linux2) OUT="linux-armv4" ;;
|
||||
aarch64-*-linux2) OUT="linux-aarch64" ;;
|
||||
sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||
sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
|
||||
m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||
s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
|
||||
s390x-*-linux2)
|
||||
# To be uncommented when glibc bug is fixed, see Configure...
|
||||
#if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then
|
||||
# echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you"
|
||||
# echo " have to invoke './Configure linux32-s390x' *manually*."
|
||||
# if [ "$TEST" = "false" -a -t -1 ]; then
|
||||
# echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
# (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
# fi
|
||||
#fi
|
||||
OUT="linux64-s390x"
|
||||
;;
|
||||
s390x-*-linux2) OUT="linux-s390x" ;;
|
||||
x86_64-*-linux?) OUT="linux-x86_64" ;;
|
||||
*86-*-linux2) OUT="linux-elf"
|
||||
if [ "$GCCVER" -gt 28 ]; then
|
||||
@@ -697,7 +648,7 @@ case "$GUESSOS" in
|
||||
sun4[uv]*-*-solaris2)
|
||||
OUT="solaris-sparcv9-$CC"
|
||||
ISA64=`(isalist) 2>/dev/null | grep sparcv9`
|
||||
if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then
|
||||
if [ "$ISA64" != "" ]; then
|
||||
if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
|
||||
echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
|
||||
@@ -727,16 +678,13 @@ case "$GUESSOS" in
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then
|
||||
OUT="solaris64-sparcv9-$CC"
|
||||
fi
|
||||
;;
|
||||
sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||
sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
|
||||
sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;;
|
||||
*86*-*-solaris2)
|
||||
ISA64=`(isalist) 2>/dev/null | grep amd64`
|
||||
if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then
|
||||
if [ "$ISA64" != "" ]; then
|
||||
OUT="solaris64-x86_64-$CC"
|
||||
else
|
||||
OUT="solaris-x86-$CC"
|
||||
@@ -788,17 +736,20 @@ case "$GUESSOS" in
|
||||
if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
|
||||
OUT="hpux64-parisc2-gcc"
|
||||
fi
|
||||
[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
|
||||
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
|
||||
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
||||
OUT="hpux64-ia64-cc"
|
||||
else
|
||||
OUT="hpux-ia64-cc"
|
||||
fi
|
||||
echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi."
|
||||
echo " If you wish to build 32-bit library, the you have to"
|
||||
echo " invoke './Configure hpux-ia64-cc' *manually*."
|
||||
if [ "$TEST" = "false" -a -t 1 ]; then
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
|
||||
fi
|
||||
OUT="hpux64-ia64-cc"
|
||||
elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
|
||||
OUT=${OUT:-"hpux-parisc2-${CC}"}
|
||||
if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
|
||||
@@ -819,7 +770,7 @@ case "$GUESSOS" in
|
||||
options="$options -D_REENTRANT" ;;
|
||||
*-hpux) OUT="hpux-parisc-$CC" ;;
|
||||
*-aix)
|
||||
[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
|
||||
KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
|
||||
KERNEL_BITS=${KERNEL_BITS:-32}
|
||||
OBJECT_MODE=${OBJECT_MODE:-32}
|
||||
if [ "$CC" = "gcc" ]; then
|
||||
@@ -859,8 +810,6 @@ case "$GUESSOS" in
|
||||
beos-*) OUT="$GUESSOS" ;;
|
||||
x86pc-*-qnx6) OUT="QNX6-i386" ;;
|
||||
*-*-qnx6) OUT="QNX6" ;;
|
||||
x86-*-android|i?86-*-android) OUT="android-x86" ;;
|
||||
armv[7-9]*-*-android) OUT="android-armv7" ;;
|
||||
*) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ TOP= ..
|
||||
CC= cc
|
||||
INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE)
|
||||
# INCLUDES targets sudbirs!
|
||||
INCLUDES= -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE)
|
||||
INCLUDES= -I.. -I../.. -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE)
|
||||
CFLAG= -g
|
||||
MAKEDEPPROG= makedepend
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
|
||||
@@ -35,10 +35,8 @@ TEST=constant_time_test.c
|
||||
|
||||
LIB= $(TOP)/libcrypto.a
|
||||
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
||||
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
|
||||
ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c
|
||||
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \
|
||||
uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ)
|
||||
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c
|
||||
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ)
|
||||
|
||||
SRC= $(LIBSRC)
|
||||
|
||||
@@ -66,17 +64,16 @@ applink.o: $(TOP)/ms/applink.c
|
||||
uplink.o: $(TOP)/ms/uplink.c applink.o
|
||||
$(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
|
||||
|
||||
uplink-x86.s: $(TOP)/ms/uplink-x86.pl
|
||||
$(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
|
||||
uplink-cof.s: $(TOP)/ms/uplink.pl
|
||||
$(PERL) $(TOP)/ms/uplink.pl coff > $@
|
||||
|
||||
x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
|
||||
ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@
|
||||
x86_64cpuid.s: x86_64cpuid.pl
|
||||
$(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
|
||||
ia64cpuid.s: ia64cpuid.S
|
||||
$(CC) $(CFLAGS) -E ia64cpuid.S > $@
|
||||
ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
|
||||
pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
|
||||
alphacpuid.s: alphacpuid.pl
|
||||
(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
|
||||
$(PERL) alphacpuid.pl > $$preproc && \
|
||||
$(CC) -E -P $$preproc > $@ && rm $$preproc)
|
||||
$(PERL) $< | $(CC) -E - | tee $@ > /dev/null
|
||||
|
||||
testapps:
|
||||
[ -z "$(THIS)" ] || ( if echo $(SDIRS) | fgrep ' des '; \
|
||||
@@ -88,7 +85,7 @@ subdirs:
|
||||
@target=all; $(RECURSIVE_MAKE)
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
@target=files; $(RECURSIVE_MAKE)
|
||||
|
||||
links:
|
||||
@@ -102,7 +99,6 @@ lib: $(LIB)
|
||||
@touch lib
|
||||
$(LIB): $(LIBOBJ)
|
||||
$(AR) $(LIB) $(LIBOBJ)
|
||||
test -z "$(FIPSLIBDIR)" || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o
|
||||
$(RANLIB) $(LIB) || echo Never mind.
|
||||
|
||||
shared: buildinf.h lib subdirs
|
||||
@@ -125,12 +121,17 @@ install:
|
||||
lint:
|
||||
@target=lint; $(RECURSIVE_MAKE)
|
||||
|
||||
depend:
|
||||
update: local_depend
|
||||
@[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
|
||||
depend: local_depend
|
||||
@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
local_depend:
|
||||
@[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
|
||||
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
@[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
|
||||
@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
|
||||
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
||||
|
||||
clean:
|
||||
rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
@@ -172,7 +173,6 @@ ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
|
||||
ex_data.o: ex_data.c
|
||||
fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c
|
||||
mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||
@@ -193,19 +193,6 @@ mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
|
||||
mem_dbg.o: mem_dbg.c
|
||||
o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
|
||||
o_dir.o: LPdir_unix.c o_dir.c o_dir.h
|
||||
o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
|
||||
o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
|
||||
o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h
|
||||
o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
|
||||
o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
|
||||
o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
|
||||
o_fips.o: o_fips.c
|
||||
o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
|
||||
o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
|
||||
o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
|
||||
o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
|
||||
o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
|
||||
o_init.o: ../include/openssl/symhacks.h o_init.c
|
||||
o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
|
||||
o_str.o: o_str.c o_str.h
|
||||
o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
|
||||
|
||||
@@ -3,6 +3,3 @@ Makefile.save
|
||||
*.flc
|
||||
semantic.cache
|
||||
aes-*.s
|
||||
aesni-*.s
|
||||
bsaes-*.s
|
||||
vpaes-*.s
|
||||
|
||||
@@ -50,56 +50,21 @@ aes-ia64.s: asm/aes-ia64.S
|
||||
|
||||
aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl
|
||||
$(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
||||
vpaes-x86.s: asm/vpaes-x86.pl ../perlasm/x86asm.pl
|
||||
$(PERL) asm/vpaes-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
||||
aesni-x86.s: asm/aesni-x86.pl ../perlasm/x86asm.pl
|
||||
$(PERL) asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
||||
|
||||
aes-x86_64.s: asm/aes-x86_64.pl
|
||||
$(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
vpaes-x86_64.s: asm/vpaes-x86_64.pl
|
||||
$(PERL) asm/vpaes-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
bsaes-x86_64.s: asm/bsaes-x86_64.pl
|
||||
$(PERL) asm/bsaes-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
aesni-x86_64.s: asm/aesni-x86_64.pl
|
||||
$(PERL) asm/aesni-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
aesni-sha1-x86_64.s: asm/aesni-sha1-x86_64.pl
|
||||
$(PERL) asm/aesni-sha1-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
aesni-sha256-x86_64.s: asm/aesni-sha256-x86_64.pl
|
||||
$(PERL) asm/aesni-sha256-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
aesni-mb-x86_64.s: asm/aesni-mb-x86_64.pl
|
||||
$(PERL) asm/aesni-mb-x86_64.pl $(PERLASM_SCHEME) > $@
|
||||
|
||||
aes-sparcv9.s: asm/aes-sparcv9.pl
|
||||
$(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@
|
||||
aest4-sparcv9.s: asm/aest4-sparcv9.pl
|
||||
$(PERL) asm/aest4-sparcv9.pl $(CFLAGS) > $@
|
||||
|
||||
aes-ppc.s: asm/aes-ppc.pl
|
||||
$(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@
|
||||
vpaes-ppc.s: asm/vpaes-ppc.pl
|
||||
$(PERL) asm/vpaes-ppc.pl $(PERLASM_SCHEME) $@
|
||||
aesp8-ppc.s: asm/aesp8-ppc.pl
|
||||
$(PERL) asm/aesp8-ppc.pl $(PERLASM_SCHEME) $@
|
||||
|
||||
aes-parisc.s: asm/aes-parisc.pl
|
||||
$(PERL) asm/aes-parisc.pl $(PERLASM_SCHEME) $@
|
||||
|
||||
aes-mips.S: asm/aes-mips.pl
|
||||
$(PERL) asm/aes-mips.pl $(PERLASM_SCHEME) $@
|
||||
|
||||
aesv8-armx.S: asm/aesv8-armx.pl
|
||||
$(PERL) asm/aesv8-armx.pl $(PERLASM_SCHEME) $@
|
||||
aesv8-armx.o: aesv8-armx.S
|
||||
|
||||
# GNU make "catch all"
|
||||
aes-%.S: asm/aes-%.pl; $(PERL) $< $(PERLASM_SCHEME) > $@
|
||||
aes-armv4.o: aes-armv4.S
|
||||
bsaes-%.S: asm/bsaes-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@
|
||||
bsaes-armv7.o: bsaes-armv7.S
|
||||
aes-%.s: asm/aes-%.pl; $(PERL) $< $(CFLAGS) > $@
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl "AES_ENC=$(AES_ENC)" Makefile >> $(TOP)/MINFO
|
||||
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
||||
|
||||
links:
|
||||
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
|
||||
@@ -122,6 +87,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
@@ -152,18 +119,16 @@ aes_ige.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
aes_ige.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
aes_ige.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h
|
||||
aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/crypto.h
|
||||
aes_misc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
|
||||
aes_misc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
aes_misc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
aes_misc.o: ../../include/openssl/symhacks.h aes_locl.h aes_misc.c
|
||||
aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
|
||||
aes_misc.o: ../../include/openssl/opensslconf.h
|
||||
aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c
|
||||
aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
|
||||
aes_ofb.o: ../../include/openssl/opensslconf.h aes_ofb.c
|
||||
aes_wrap.o: ../../e_os.h ../../include/openssl/aes.h
|
||||
aes_wrap.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
aes_wrap.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
aes_wrap.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
aes_wrap.o: ../../include/openssl/modes.h ../../include/openssl/opensslconf.h
|
||||
aes_wrap.o: ../../include/openssl/opensslconf.h
|
||||
aes_wrap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
aes_wrap.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
aes_wrap.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_wrap.c
|
||||
|
||||
@@ -92,11 +92,6 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
int private_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,
|
||||
|
||||
@@ -625,8 +625,8 @@ static const u32 rcon[] = {
|
||||
/**
|
||||
* Expand the cipher key into the encryption key schedule.
|
||||
*/
|
||||
int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
{
|
||||
|
||||
u32 *rk;
|
||||
@@ -727,8 +727,8 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
/**
|
||||
* Expand the cipher key into the decryption key schedule.
|
||||
*/
|
||||
int private_AES_set_decrypt_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)
|
||||
{
|
||||
|
||||
u32 *rk;
|
||||
@@ -736,7 +736,7 @@ int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
u32 temp;
|
||||
|
||||
/* first, start with an encryption schedule */
|
||||
status = private_AES_set_encrypt_key(userKey, bits, key);
|
||||
status = AES_set_encrypt_key(userKey, bits, key);
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
@@ -1204,8 +1204,8 @@ static const u32 rcon[] = {
|
||||
/**
|
||||
* Expand the cipher key into the encryption key schedule.
|
||||
*/
|
||||
int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
{
|
||||
u32 *rk;
|
||||
int i = 0;
|
||||
@@ -1305,16 +1305,15 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
/**
|
||||
* Expand the cipher key into the decryption key schedule.
|
||||
*/
|
||||
int private_AES_set_decrypt_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)
|
||||
{
|
||||
|
||||
u32 *rk;
|
||||
int i, j, status;
|
||||
u32 temp;
|
||||
|
||||
/* first, start with an encryption schedule */
|
||||
status = private_AES_set_encrypt_key(userKey, bits, key);
|
||||
status = AES_set_encrypt_key(userKey, bits, key);
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
*/
|
||||
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/aes.h>
|
||||
#include "aes_locl.h"
|
||||
|
||||
@@ -64,23 +63,3 @@ const char *AES_options(void)
|
||||
return "aes(partial)";
|
||||
#endif
|
||||
}
|
||||
|
||||
/* FIPS wrapper functions to block low level AES calls in FIPS mode */
|
||||
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
{
|
||||
#ifdef OPENSSL_FIPS
|
||||
fips_cipher_abort(AES);
|
||||
#endif
|
||||
return private_AES_set_encrypt_key(userKey, bits, key);
|
||||
}
|
||||
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
{
|
||||
#ifdef OPENSSL_FIPS
|
||||
fips_cipher_abort(AES);
|
||||
#endif
|
||||
return private_AES_set_decrypt_key(userKey, bits, key);
|
||||
}
|
||||
|
||||
@@ -54,19 +54,197 @@
|
||||
|
||||
#include "cryptlib.h"
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#include <openssl/bio.h>
|
||||
|
||||
static const unsigned char default_iv[] = {
|
||||
0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
|
||||
};
|
||||
|
||||
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, unsigned int inlen)
|
||||
{
|
||||
return CRYPTO_128_wrap(key, iv, out, in, inlen, (block128_f) AES_encrypt);
|
||||
unsigned char *A, B[16], *R;
|
||||
unsigned int i, j, t;
|
||||
if ((inlen & 0x7) || (inlen < 8))
|
||||
return -1;
|
||||
A = B;
|
||||
t = 1;
|
||||
memcpy(out + 8, in, inlen);
|
||||
if (!iv)
|
||||
iv = default_iv;
|
||||
|
||||
memcpy(A, iv, 8);
|
||||
|
||||
for (j = 0; j < 6; j++) {
|
||||
R = out + 8;
|
||||
for (i = 0; i < inlen; i += 8, t++, R += 8) {
|
||||
memcpy(B + 8, R, 8);
|
||||
AES_encrypt(B, B, key);
|
||||
A[7] ^= (unsigned char)(t & 0xff);
|
||||
if (t > 0xff) {
|
||||
A[6] ^= (unsigned char)((t >> 8) & 0xff);
|
||||
A[5] ^= (unsigned char)((t >> 16) & 0xff);
|
||||
A[4] ^= (unsigned char)((t >> 24) & 0xff);
|
||||
}
|
||||
memcpy(R, B + 8, 8);
|
||||
}
|
||||
}
|
||||
memcpy(out, A, 8);
|
||||
return inlen + 8;
|
||||
}
|
||||
|
||||
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, unsigned int inlen)
|
||||
{
|
||||
return CRYPTO_128_unwrap(key, iv, out, in, inlen,
|
||||
(block128_f) AES_decrypt);
|
||||
unsigned char *A, B[16], *R;
|
||||
unsigned int i, j, t;
|
||||
inlen -= 8;
|
||||
if (inlen & 0x7)
|
||||
return -1;
|
||||
if (inlen < 8)
|
||||
return -1;
|
||||
A = B;
|
||||
t = 6 * (inlen >> 3);
|
||||
memcpy(A, in, 8);
|
||||
memcpy(out, in + 8, inlen);
|
||||
for (j = 0; j < 6; j++) {
|
||||
R = out + inlen - 8;
|
||||
for (i = 0; i < inlen; i += 8, t--, R -= 8) {
|
||||
A[7] ^= (unsigned char)(t & 0xff);
|
||||
if (t > 0xff) {
|
||||
A[6] ^= (unsigned char)((t >> 8) & 0xff);
|
||||
A[5] ^= (unsigned char)((t >> 16) & 0xff);
|
||||
A[4] ^= (unsigned char)((t >> 24) & 0xff);
|
||||
}
|
||||
memcpy(B + 8, R, 8);
|
||||
AES_decrypt(B, B, key);
|
||||
memcpy(R, B + 8, 8);
|
||||
}
|
||||
}
|
||||
if (!iv)
|
||||
iv = default_iv;
|
||||
if (memcmp(A, iv, 8)) {
|
||||
OPENSSL_cleanse(out, inlen);
|
||||
return 0;
|
||||
}
|
||||
return inlen;
|
||||
}
|
||||
|
||||
#ifdef AES_WRAP_TEST
|
||||
|
||||
int AES_wrap_unwrap_test(const unsigned char *kek, int keybits,
|
||||
const unsigned char *iv,
|
||||
const unsigned char *eout,
|
||||
const unsigned char *key, int keylen)
|
||||
{
|
||||
unsigned char *otmp = NULL, *ptmp = NULL;
|
||||
int r, ret = 0;
|
||||
AES_KEY wctx;
|
||||
otmp = OPENSSL_malloc(keylen + 8);
|
||||
ptmp = OPENSSL_malloc(keylen);
|
||||
if (!otmp || !ptmp)
|
||||
return 0;
|
||||
if (AES_set_encrypt_key(kek, keybits, &wctx))
|
||||
goto err;
|
||||
r = AES_wrap_key(&wctx, iv, otmp, key, keylen);
|
||||
if (r <= 0)
|
||||
goto err;
|
||||
|
||||
if (eout && memcmp(eout, otmp, keylen))
|
||||
goto err;
|
||||
|
||||
if (AES_set_decrypt_key(kek, keybits, &wctx))
|
||||
goto err;
|
||||
r = AES_unwrap_key(&wctx, iv, ptmp, otmp, r);
|
||||
|
||||
if (memcmp(key, ptmp, keylen))
|
||||
goto err;
|
||||
|
||||
ret = 1;
|
||||
|
||||
err:
|
||||
if (otmp)
|
||||
OPENSSL_free(otmp);
|
||||
if (ptmp)
|
||||
OPENSSL_free(ptmp);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
static const unsigned char kek[] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
|
||||
};
|
||||
|
||||
static const unsigned char key[] = {
|
||||
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
|
||||
};
|
||||
|
||||
static const unsigned char e1[] = {
|
||||
0x1f, 0xa6, 0x8b, 0x0a, 0x81, 0x12, 0xb4, 0x47,
|
||||
0xae, 0xf3, 0x4b, 0xd8, 0xfb, 0x5a, 0x7b, 0x82,
|
||||
0x9d, 0x3e, 0x86, 0x23, 0x71, 0xd2, 0xcf, 0xe5
|
||||
};
|
||||
|
||||
static const unsigned char e2[] = {
|
||||
0x96, 0x77, 0x8b, 0x25, 0xae, 0x6c, 0xa4, 0x35,
|
||||
0xf9, 0x2b, 0x5b, 0x97, 0xc0, 0x50, 0xae, 0xd2,
|
||||
0x46, 0x8a, 0xb8, 0xa1, 0x7a, 0xd8, 0x4e, 0x5d
|
||||
};
|
||||
|
||||
static const unsigned char e3[] = {
|
||||
0x64, 0xe8, 0xc3, 0xf9, 0xce, 0x0f, 0x5b, 0xa2,
|
||||
0x63, 0xe9, 0x77, 0x79, 0x05, 0x81, 0x8a, 0x2a,
|
||||
0x93, 0xc8, 0x19, 0x1e, 0x7d, 0x6e, 0x8a, 0xe7
|
||||
};
|
||||
|
||||
static const unsigned char e4[] = {
|
||||
0x03, 0x1d, 0x33, 0x26, 0x4e, 0x15, 0xd3, 0x32,
|
||||
0x68, 0xf2, 0x4e, 0xc2, 0x60, 0x74, 0x3e, 0xdc,
|
||||
0xe1, 0xc6, 0xc7, 0xdd, 0xee, 0x72, 0x5a, 0x93,
|
||||
0x6b, 0xa8, 0x14, 0x91, 0x5c, 0x67, 0x62, 0xd2
|
||||
};
|
||||
|
||||
static const unsigned char e5[] = {
|
||||
0xa8, 0xf9, 0xbc, 0x16, 0x12, 0xc6, 0x8b, 0x3f,
|
||||
0xf6, 0xe6, 0xf4, 0xfb, 0xe3, 0x0e, 0x71, 0xe4,
|
||||
0x76, 0x9c, 0x8b, 0x80, 0xa3, 0x2c, 0xb8, 0x95,
|
||||
0x8c, 0xd5, 0xd1, 0x7d, 0x6b, 0x25, 0x4d, 0xa1
|
||||
};
|
||||
|
||||
static const unsigned char e6[] = {
|
||||
0x28, 0xc9, 0xf4, 0x04, 0xc4, 0xb8, 0x10, 0xf4,
|
||||
0xcb, 0xcc, 0xb3, 0x5c, 0xfb, 0x87, 0xf8, 0x26,
|
||||
0x3f, 0x57, 0x86, 0xe2, 0xd8, 0x0e, 0xd3, 0x26,
|
||||
0xcb, 0xc7, 0xf0, 0xe7, 0x1a, 0x99, 0xf4, 0x3b,
|
||||
0xfb, 0x98, 0x8b, 0x9b, 0x7a, 0x02, 0xdd, 0x21
|
||||
};
|
||||
|
||||
AES_KEY wctx, xctx;
|
||||
int ret;
|
||||
ret = AES_wrap_unwrap_test(kek, 128, NULL, e1, key, 16);
|
||||
fprintf(stderr, "Key test result %d\n", ret);
|
||||
ret = AES_wrap_unwrap_test(kek, 192, NULL, e2, key, 16);
|
||||
fprintf(stderr, "Key test result %d\n", ret);
|
||||
ret = AES_wrap_unwrap_test(kek, 256, NULL, e3, key, 16);
|
||||
fprintf(stderr, "Key test result %d\n", ret);
|
||||
ret = AES_wrap_unwrap_test(kek, 192, NULL, e4, key, 24);
|
||||
fprintf(stderr, "Key test result %d\n", ret);
|
||||
ret = AES_wrap_unwrap_test(kek, 256, NULL, e5, key, 24);
|
||||
fprintf(stderr, "Key test result %d\n", ret);
|
||||
ret = AES_wrap_unwrap_test(kek, 256, NULL, e6, key, 32);
|
||||
fprintf(stderr, "Key test result %d\n", ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -89,10 +89,8 @@ typedef unsigned long long u64;
|
||||
#endif
|
||||
|
||||
#undef ROTATE
|
||||
#if defined(_MSC_VER)
|
||||
# define ROTATE(a,n) _lrotl(a,n)
|
||||
#elif defined(__ICC)
|
||||
# define ROTATE(a,n) _rotl(a,n)
|
||||
#if defined(_MSC_VER) || defined(__ICC)
|
||||
# define ROTATE(a,n) _lrotl(a,n)
|
||||
#elif defined(__GNUC__) && __GNUC__>=2
|
||||
# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
|
||||
# define ROTATE(a,n) ({ register unsigned int ret; \
|
||||
|
||||
@@ -103,12 +103,11 @@
|
||||
# byte for 128-bit key.
|
||||
#
|
||||
# ECB encrypt ECB decrypt CBC large chunk
|
||||
# P4 52[54] 83[95] 23
|
||||
# AMD K8 46[41] 66[70] 18
|
||||
# PIII 41[50] 60[77] 24
|
||||
# Core 2 31[36] 45[64] 18.5
|
||||
# Atom 76[100] 96[138] 60
|
||||
# Pentium 115 150 77
|
||||
# P4 56[60] 84[100] 23
|
||||
# AMD K8 48[44] 70[79] 18
|
||||
# PIII 41[50] 61[91] 24
|
||||
# Core 2 32[38] 45[70] 18.5
|
||||
# Pentium 120 160 77
|
||||
#
|
||||
# Version 4.1 switches to compact S-box even in key schedule setup.
|
||||
#
|
||||
@@ -243,7 +242,7 @@ $vertical_spin=0; # shift "verticaly" defaults to 0, because of
|
||||
|
||||
sub encvert()
|
||||
{ my ($te,@s) = @_;
|
||||
my ($v0,$v1) = ($acc,$key);
|
||||
my $v0 = $acc, $v1 = $key;
|
||||
|
||||
&mov ($v0,$s[3]); # copy s3
|
||||
&mov (&DWP(4,"esp"),$s[2]); # save s2
|
||||
@@ -300,7 +299,7 @@ sub encvert()
|
||||
# Another experimental routine, which features "horizontal spin," but
|
||||
# eliminates one reference to stack. Strangely enough runs slower...
|
||||
sub enchoriz()
|
||||
{ my ($v0,$v1) = ($key,$acc);
|
||||
{ my $v0 = $key, $v1 = $acc;
|
||||
|
||||
&movz ($v0,&LB($s0)); # 3, 2, 1, 0*
|
||||
&rotr ($s2,8); # 8,11,10, 9
|
||||
@@ -428,7 +427,7 @@ sub sse_encbody()
|
||||
######################################################################
|
||||
|
||||
sub enccompact()
|
||||
{ my $Fn = \&mov;
|
||||
{ my $Fn = mov;
|
||||
while ($#_>5) { pop(@_); $Fn=sub{}; }
|
||||
my ($i,$te,@s)=@_;
|
||||
my $tmp = $key;
|
||||
@@ -477,25 +476,24 @@ sub enctransform()
|
||||
my $tmp = $tbl;
|
||||
my $r2 = $key ;
|
||||
|
||||
&and ($tmp,$s[$i]);
|
||||
&lea ($r2,&DWP(0,$s[$i],$s[$i]));
|
||||
&mov ($acc,$tmp);
|
||||
&mov ($acc,$s[$i]);
|
||||
&and ($acc,0x80808080);
|
||||
&mov ($tmp,$acc);
|
||||
&shr ($tmp,7);
|
||||
&and ($r2,0xfefefefe);
|
||||
&lea ($r2,&DWP(0,$s[$i],$s[$i]));
|
||||
&sub ($acc,$tmp);
|
||||
&mov ($tmp,$s[$i]);
|
||||
&and ($r2,0xfefefefe);
|
||||
&and ($acc,0x1b1b1b1b);
|
||||
&rotr ($tmp,16);
|
||||
&mov ($tmp,$s[$i]);
|
||||
&xor ($acc,$r2); # r2
|
||||
&mov ($r2,$s[$i]);
|
||||
|
||||
&xor ($s[$i],$acc); # r0 ^ r2
|
||||
&rotr ($r2,16+8);
|
||||
&xor ($acc,$tmp);
|
||||
&rotl ($s[$i],24);
|
||||
&xor ($acc,$r2);
|
||||
&mov ($tmp,0x80808080) if ($i!=1);
|
||||
&xor ($s[$i],$acc); # ROTATE(r2^r0,24) ^ r2
|
||||
&xor ($s[$i],$acc) # ROTATE(r2^r0,24) ^ r2
|
||||
&rotr ($tmp,16);
|
||||
&xor ($s[$i],$tmp);
|
||||
&rotr ($tmp,8);
|
||||
&xor ($s[$i],$tmp);
|
||||
}
|
||||
|
||||
&function_begin_B("_x86_AES_encrypt_compact");
|
||||
@@ -528,7 +526,6 @@ sub enctransform()
|
||||
&enccompact(1,$tbl,$s1,$s2,$s3,$s0,1);
|
||||
&enccompact(2,$tbl,$s2,$s3,$s0,$s1,1);
|
||||
&enccompact(3,$tbl,$s3,$s0,$s1,$s2,1);
|
||||
&mov ($tbl,0x80808080);
|
||||
&enctransform(2);
|
||||
&enctransform(3);
|
||||
&enctransform(0);
|
||||
@@ -610,84 +607,82 @@ sub sse_enccompact()
|
||||
&pshufw ("mm5","mm4",0x0d); # 15,14,11,10
|
||||
&movd ("eax","mm1"); # 5, 4, 1, 0
|
||||
&movd ("ebx","mm5"); # 15,14,11,10
|
||||
&mov ($__key,$key);
|
||||
|
||||
&movz ($acc,&LB("eax")); # 0
|
||||
&movz ("edx",&HB("eax")); # 1
|
||||
&pshufw ("mm2","mm0",0x0d); # 7, 6, 3, 2
|
||||
&movz ("ecx",&BP(-128,$tbl,$acc,1)); # 0
|
||||
&movz ($key,&LB("ebx")); # 10
|
||||
&pshufw ("mm2","mm0",0x0d); # 7, 6, 3, 2
|
||||
&movz ("edx",&HB("eax")); # 1
|
||||
&movz ("edx",&BP(-128,$tbl,"edx",1)); # 1
|
||||
&shr ("eax",16); # 5, 4
|
||||
&shl ("edx",8); # 1
|
||||
&shr ("eax",16); # 5, 4
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 10
|
||||
&movz ($key,&HB("ebx")); # 11
|
||||
&movz ($acc,&LB("ebx")); # 10
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 10
|
||||
&shl ($acc,16); # 10
|
||||
&pshufw ("mm6","mm4",0x08); # 13,12, 9, 8
|
||||
&or ("ecx",$acc); # 10
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 11
|
||||
&movz ($key,&HB("eax")); # 5
|
||||
&pshufw ("mm6","mm4",0x08); # 13,12, 9, 8
|
||||
&movz ($acc,&HB("ebx")); # 11
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 11
|
||||
&shl ($acc,24); # 11
|
||||
&shr ("ebx",16); # 15,14
|
||||
&or ("edx",$acc); # 11
|
||||
&shr ("ebx",16); # 15,14
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 5
|
||||
&movz ($key,&HB("ebx")); # 15
|
||||
&movz ($acc,&HB("eax")); # 5
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 5
|
||||
&shl ($acc,8); # 5
|
||||
&or ("ecx",$acc); # 5
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 15
|
||||
&movz ($key,&LB("eax")); # 4
|
||||
&movz ($acc,&HB("ebx")); # 15
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 15
|
||||
&shl ($acc,24); # 15
|
||||
&or ("ecx",$acc); # 15
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 4
|
||||
&movz ($key,&LB("ebx")); # 14
|
||||
&movd ("eax","mm2"); # 7, 6, 3, 2
|
||||
&movd ("mm0","ecx"); # t[0] collected
|
||||
&movz ("ecx",&BP(-128,$tbl,$key,1)); # 14
|
||||
&movz ($key,&HB("eax")); # 3
|
||||
&shl ("ecx",16); # 14
|
||||
&movd ("ebx","mm6"); # 13,12, 9, 8
|
||||
|
||||
&movz ($acc,&LB("eax")); # 4
|
||||
&movz ("ecx",&BP(-128,$tbl,$acc,1)); # 4
|
||||
&movd ("eax","mm2"); # 7, 6, 3, 2
|
||||
&movz ($acc,&LB("ebx")); # 14
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 14
|
||||
&shl ($acc,16); # 14
|
||||
&or ("ecx",$acc); # 14
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 3
|
||||
&movz ($key,&HB("ebx")); # 9
|
||||
&movd ("ebx","mm6"); # 13,12, 9, 8
|
||||
&movz ($acc,&HB("eax")); # 3
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 3
|
||||
&shl ($acc,24); # 3
|
||||
&or ("ecx",$acc); # 3
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 9
|
||||
&movz ($key,&LB("ebx")); # 8
|
||||
&movz ($acc,&HB("ebx")); # 9
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 9
|
||||
&shl ($acc,8); # 9
|
||||
&shr ("ebx",16); # 13,12
|
||||
&or ("ecx",$acc); # 9
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 8
|
||||
&movz ($key,&LB("eax")); # 2
|
||||
&shr ("eax",16); # 7, 6
|
||||
&movd ("mm1","ecx"); # t[1] collected
|
||||
&movz ("ecx",&BP(-128,$tbl,$key,1)); # 2
|
||||
&movz ($key,&HB("eax")); # 7
|
||||
&shl ("ecx",16); # 2
|
||||
&and ("eax",0xff); # 6
|
||||
|
||||
&movz ($acc,&LB("ebx")); # 8
|
||||
&movz ("ecx",&BP(-128,$tbl,$acc,1)); # 8
|
||||
&shr ("ebx",16); # 13,12
|
||||
&movz ($acc,&LB("eax")); # 2
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 2
|
||||
&shl ($acc,16); # 2
|
||||
&or ("ecx",$acc); # 2
|
||||
&shr ("eax",16); # 7, 6
|
||||
|
||||
&punpckldq ("mm0","mm1"); # t[0,1] collected
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 7
|
||||
&movz ($key,&HB("ebx")); # 13
|
||||
&movz ($acc,&HB("eax")); # 7
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 7
|
||||
&shl ($acc,24); # 7
|
||||
&and ("ebx",0xff); # 12
|
||||
&movz ("eax",&BP(-128,$tbl,"eax",1)); # 6
|
||||
&or ("ecx",$acc); # 7
|
||||
&and ("eax",0xff); # 6
|
||||
&movz ("eax",&BP(-128,$tbl,"eax",1)); # 6
|
||||
&shl ("eax",16); # 6
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 13
|
||||
&or ("edx","eax"); # 6
|
||||
&movz ($acc,&HB("ebx")); # 13
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 13
|
||||
&shl ($acc,8); # 13
|
||||
&movz ("ebx",&BP(-128,$tbl,"ebx",1)); # 12
|
||||
&or ("ecx",$acc); # 13
|
||||
&or ("edx","ebx"); # 12
|
||||
&mov ($key,$__key);
|
||||
&movd ("mm4","ecx"); # t[2] collected
|
||||
&and ("ebx",0xff); # 12
|
||||
&movz ("ebx",&BP(-128,$tbl,"ebx",1)); # 12
|
||||
&or ("edx","ebx"); # 12
|
||||
&movd ("mm5","edx"); # t[3] collected
|
||||
|
||||
&punpckldq ("mm4","mm5"); # t[2,3] collected
|
||||
@@ -1227,7 +1222,7 @@ sub enclast()
|
||||
######################################################################
|
||||
|
||||
sub deccompact()
|
||||
{ my $Fn = \&mov;
|
||||
{ my $Fn = mov;
|
||||
while ($#_>5) { pop(@_); $Fn=sub{}; }
|
||||
my ($i,$td,@s)=@_;
|
||||
my $tmp = $key;
|
||||
@@ -1275,30 +1270,30 @@ sub dectransform()
|
||||
my $tp4 = @s[($i+3)%4]; $tp4 = @s[3] if ($i==1);
|
||||
my $tp8 = $tbl;
|
||||
|
||||
&mov ($tmp,0x80808080);
|
||||
&and ($tmp,$s[$i]);
|
||||
&mov ($acc,$tmp);
|
||||
&mov ($acc,$s[$i]);
|
||||
&and ($acc,0x80808080);
|
||||
&mov ($tmp,$acc);
|
||||
&shr ($tmp,7);
|
||||
&lea ($tp2,&DWP(0,$s[$i],$s[$i]));
|
||||
&sub ($acc,$tmp);
|
||||
&and ($tp2,0xfefefefe);
|
||||
&and ($acc,0x1b1b1b1b);
|
||||
&xor ($tp2,$acc);
|
||||
&mov ($tmp,0x80808080);
|
||||
&xor ($acc,$tp2);
|
||||
&mov ($tp2,$acc);
|
||||
|
||||
&and ($tmp,$tp2);
|
||||
&mov ($acc,$tmp);
|
||||
&and ($acc,0x80808080);
|
||||
&mov ($tmp,$acc);
|
||||
&shr ($tmp,7);
|
||||
&lea ($tp4,&DWP(0,$tp2,$tp2));
|
||||
&sub ($acc,$tmp);
|
||||
&and ($tp4,0xfefefefe);
|
||||
&and ($acc,0x1b1b1b1b);
|
||||
&xor ($tp2,$s[$i]); # tp2^tp1
|
||||
&xor ($tp4,$acc);
|
||||
&mov ($tmp,0x80808080);
|
||||
&xor ($acc,$tp4);
|
||||
&mov ($tp4,$acc);
|
||||
|
||||
&and ($tmp,$tp4);
|
||||
&mov ($acc,$tmp);
|
||||
&and ($acc,0x80808080);
|
||||
&mov ($tmp,$acc);
|
||||
&shr ($tmp,7);
|
||||
&lea ($tp8,&DWP(0,$tp4,$tp4));
|
||||
&sub ($acc,$tmp);
|
||||
@@ -1310,13 +1305,13 @@ sub dectransform()
|
||||
|
||||
&xor ($s[$i],$tp2);
|
||||
&xor ($tp2,$tp8);
|
||||
&rotl ($tp2,24);
|
||||
&xor ($s[$i],$tp4);
|
||||
&xor ($tp4,$tp8);
|
||||
&rotl ($tp2,24);
|
||||
&xor ($s[$i],$tp8); # ^= tp8^(tp4^tp1)^(tp2^tp1)
|
||||
&rotl ($tp4,16);
|
||||
&xor ($s[$i],$tp2); # ^= ROTATE(tp8^tp2^tp1,24)
|
||||
&xor ($s[$i],$tp8); # ^= tp8^(tp4^tp1)^(tp2^tp1)
|
||||
&rotl ($tp8,8);
|
||||
&xor ($s[$i],$tp2); # ^= ROTATE(tp8^tp2^tp1,24)
|
||||
&xor ($s[$i],$tp4); # ^= ROTATE(tp8^tp4^tp1,16)
|
||||
&mov ($s[0],$__s0) if($i==2); #prefetch $s0
|
||||
&mov ($s[1],$__s1) if($i==3); #prefetch $s1
|
||||
@@ -1394,87 +1389,85 @@ sub dectransform()
|
||||
sub sse_deccompact()
|
||||
{
|
||||
&pshufw ("mm1","mm0",0x0c); # 7, 6, 1, 0
|
||||
&pshufw ("mm5","mm4",0x09); # 13,12,11,10
|
||||
&movd ("eax","mm1"); # 7, 6, 1, 0
|
||||
&movd ("ebx","mm5"); # 13,12,11,10
|
||||
&mov ($__key,$key);
|
||||
|
||||
&pshufw ("mm5","mm4",0x09); # 13,12,11,10
|
||||
&movz ($acc,&LB("eax")); # 0
|
||||
&movz ("edx",&HB("eax")); # 1
|
||||
&pshufw ("mm2","mm0",0x06); # 3, 2, 5, 4
|
||||
&movz ("ecx",&BP(-128,$tbl,$acc,1)); # 0
|
||||
&movz ($key,&LB("ebx")); # 10
|
||||
&movd ("ebx","mm5"); # 13,12,11,10
|
||||
&movz ("edx",&HB("eax")); # 1
|
||||
&movz ("edx",&BP(-128,$tbl,"edx",1)); # 1
|
||||
&shr ("eax",16); # 7, 6
|
||||
&shl ("edx",8); # 1
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 10
|
||||
&movz ($key,&HB("ebx")); # 11
|
||||
&pshufw ("mm2","mm0",0x06); # 3, 2, 5, 4
|
||||
&movz ($acc,&LB("ebx")); # 10
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 10
|
||||
&shl ($acc,16); # 10
|
||||
&pshufw ("mm6","mm4",0x03); # 9, 8,15,14
|
||||
&or ("ecx",$acc); # 10
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 11
|
||||
&movz ($key,&HB("eax")); # 7
|
||||
&shr ("eax",16); # 7, 6
|
||||
&movz ($acc,&HB("ebx")); # 11
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 11
|
||||
&shl ($acc,24); # 11
|
||||
&shr ("ebx",16); # 13,12
|
||||
&or ("edx",$acc); # 11
|
||||
&shr ("ebx",16); # 13,12
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 7
|
||||
&movz ($key,&HB("ebx")); # 13
|
||||
&pshufw ("mm6","mm4",0x03); # 9, 8,15,14
|
||||
&movz ($acc,&HB("eax")); # 7
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 7
|
||||
&shl ($acc,24); # 7
|
||||
&or ("ecx",$acc); # 7
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 13
|
||||
&movz ($key,&LB("eax")); # 6
|
||||
&movz ($acc,&HB("ebx")); # 13
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 13
|
||||
&shl ($acc,8); # 13
|
||||
&movd ("eax","mm2"); # 3, 2, 5, 4
|
||||
&or ("ecx",$acc); # 13
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 6
|
||||
&movz ($key,&LB("ebx")); # 12
|
||||
&shl ($acc,16); # 6
|
||||
&movd ("ebx","mm6"); # 9, 8,15,14
|
||||
&movd ("mm0","ecx"); # t[0] collected
|
||||
&movz ("ecx",&BP(-128,$tbl,$key,1)); # 12
|
||||
&movz ($key,&LB("eax")); # 4
|
||||
|
||||
&movz ($acc,&LB("eax")); # 6
|
||||
&movd ("eax","mm2"); # 3, 2, 5, 4
|
||||
&movz ("ecx",&BP(-128,$tbl,$acc,1)); # 6
|
||||
&shl ("ecx",16); # 6
|
||||
&movz ($acc,&LB("ebx")); # 12
|
||||
&movd ("ebx","mm6"); # 9, 8,15,14
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 12
|
||||
&or ("ecx",$acc); # 12
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 4
|
||||
&movz ($key,&LB("ebx")); # 14
|
||||
&movz ($acc,&LB("eax")); # 4
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 4
|
||||
&or ("edx",$acc); # 4
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 14
|
||||
&movz ($key,&HB("eax")); # 5
|
||||
&movz ($acc,&LB("ebx")); # 14
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 14
|
||||
&shl ($acc,16); # 14
|
||||
&shr ("eax",16); # 3, 2
|
||||
&or ("edx",$acc); # 14
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 5
|
||||
&movz ($key,&HB("ebx")); # 15
|
||||
&shr ("ebx",16); # 9, 8
|
||||
&shl ($acc,8); # 5
|
||||
&movd ("mm1","edx"); # t[1] collected
|
||||
&movz ("edx",&BP(-128,$tbl,$key,1)); # 15
|
||||
&movz ($key,&HB("ebx")); # 9
|
||||
&shl ("edx",24); # 15
|
||||
&and ("ebx",0xff); # 8
|
||||
|
||||
&movz ($acc,&HB("eax")); # 5
|
||||
&movz ("edx",&BP(-128,$tbl,$acc,1)); # 5
|
||||
&shl ("edx",8); # 5
|
||||
&movz ($acc,&HB("ebx")); # 15
|
||||
&shr ("eax",16); # 3, 2
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 15
|
||||
&shl ($acc,24); # 15
|
||||
&or ("edx",$acc); # 15
|
||||
&shr ("ebx",16); # 9, 8
|
||||
|
||||
&punpckldq ("mm0","mm1"); # t[0,1] collected
|
||||
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 9
|
||||
&movz ($key,&LB("eax")); # 2
|
||||
&movz ($acc,&HB("ebx")); # 9
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 9
|
||||
&shl ($acc,8); # 9
|
||||
&movz ("eax",&HB("eax")); # 3
|
||||
&movz ("ebx",&BP(-128,$tbl,"ebx",1)); # 8
|
||||
&or ("ecx",$acc); # 9
|
||||
&movz ($acc,&BP(-128,$tbl,$key,1)); # 2
|
||||
&and ("ebx",0xff); # 8
|
||||
&movz ("ebx",&BP(-128,$tbl,"ebx",1)); # 8
|
||||
&or ("edx","ebx"); # 8
|
||||
&movz ($acc,&LB("eax")); # 2
|
||||
&movz ($acc,&BP(-128,$tbl,$acc,1)); # 2
|
||||
&shl ($acc,16); # 2
|
||||
&movz ("eax",&BP(-128,$tbl,"eax",1)); # 3
|
||||
&or ("edx",$acc); # 2
|
||||
&movd ("mm4","edx"); # t[2] collected
|
||||
&movz ("eax",&HB("eax")); # 3
|
||||
&movz ("eax",&BP(-128,$tbl,"eax",1)); # 3
|
||||
&shl ("eax",24); # 3
|
||||
&or ("ecx","eax"); # 3
|
||||
&mov ($key,$__key);
|
||||
&movd ("mm4","edx"); # t[2] collected
|
||||
&movd ("mm5","ecx"); # t[3] collected
|
||||
|
||||
&punpckldq ("mm4","mm5"); # t[2,3] collected
|
||||
@@ -2188,8 +2181,8 @@ my $mark=&DWP(76+240,"esp"); # copy of aes_key->rounds
|
||||
&mov ("ecx",240/4);
|
||||
&xor ("eax","eax");
|
||||
&align (4);
|
||||
&data_word(0xABF3F689); # rep stosd
|
||||
&set_label("skip_ezero");
|
||||
&data_word(0xABF3F689); # rep stosd
|
||||
&set_label("skip_ezero")
|
||||
&mov ("esp",$_esp);
|
||||
&popf ();
|
||||
&set_label("drop_out");
|
||||
@@ -2308,8 +2301,8 @@ my $mark=&DWP(76+240,"esp"); # copy of aes_key->rounds
|
||||
&mov ("ecx",240/4);
|
||||
&xor ("eax","eax");
|
||||
&align (4);
|
||||
&data_word(0xABF3F689); # rep stosd
|
||||
&set_label("skip_dzero");
|
||||
&data_word(0xABF3F689); # rep stosd
|
||||
&set_label("skip_dzero")
|
||||
&mov ("esp",$_esp);
|
||||
&popf ();
|
||||
&function_end_A();
|
||||
@@ -2861,43 +2854,43 @@ sub enckey()
|
||||
&set_label("exit");
|
||||
&function_end("_x86_AES_set_encrypt_key");
|
||||
|
||||
# int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
# int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
&function_begin_B("private_AES_set_encrypt_key");
|
||||
&function_begin_B("AES_set_encrypt_key");
|
||||
&call ("_x86_AES_set_encrypt_key");
|
||||
&ret ();
|
||||
&function_end_B("private_AES_set_encrypt_key");
|
||||
&function_end_B("AES_set_encrypt_key");
|
||||
|
||||
sub deckey()
|
||||
{ my ($i,$key,$tp1,$tp2,$tp4,$tp8) = @_;
|
||||
my $tmp = $tbl;
|
||||
|
||||
&mov ($tmp,0x80808080);
|
||||
&and ($tmp,$tp1);
|
||||
&lea ($tp2,&DWP(0,$tp1,$tp1));
|
||||
&mov ($acc,$tmp);
|
||||
&mov ($acc,$tp1);
|
||||
&and ($acc,0x80808080);
|
||||
&mov ($tmp,$acc);
|
||||
&shr ($tmp,7);
|
||||
&lea ($tp2,&DWP(0,$tp1,$tp1));
|
||||
&sub ($acc,$tmp);
|
||||
&and ($tp2,0xfefefefe);
|
||||
&and ($acc,0x1b1b1b1b);
|
||||
&xor ($tp2,$acc);
|
||||
&mov ($tmp,0x80808080);
|
||||
&xor ($acc,$tp2);
|
||||
&mov ($tp2,$acc);
|
||||
|
||||
&and ($tmp,$tp2);
|
||||
&lea ($tp4,&DWP(0,$tp2,$tp2));
|
||||
&mov ($acc,$tmp);
|
||||
&and ($acc,0x80808080);
|
||||
&mov ($tmp,$acc);
|
||||
&shr ($tmp,7);
|
||||
&lea ($tp4,&DWP(0,$tp2,$tp2));
|
||||
&sub ($acc,$tmp);
|
||||
&and ($tp4,0xfefefefe);
|
||||
&and ($acc,0x1b1b1b1b);
|
||||
&xor ($tp2,$tp1); # tp2^tp1
|
||||
&xor ($tp4,$acc);
|
||||
&mov ($tmp,0x80808080);
|
||||
&xor ($acc,$tp4);
|
||||
&mov ($tp4,$acc);
|
||||
|
||||
&and ($tmp,$tp4);
|
||||
&lea ($tp8,&DWP(0,$tp4,$tp4));
|
||||
&mov ($acc,$tmp);
|
||||
&and ($acc,0x80808080);
|
||||
&mov ($tmp,$acc);
|
||||
&shr ($tmp,7);
|
||||
&lea ($tp8,&DWP(0,$tp4,$tp4));
|
||||
&xor ($tp4,$tp1); # tp4^tp1
|
||||
&sub ($acc,$tmp);
|
||||
&and ($tp8,0xfefefefe);
|
||||
@@ -2923,9 +2916,9 @@ sub deckey()
|
||||
&mov (&DWP(4*$i,$key),$tp1);
|
||||
}
|
||||
|
||||
# int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
# int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
&function_begin_B("private_AES_set_decrypt_key");
|
||||
&function_begin_B("AES_set_decrypt_key");
|
||||
&call ("_x86_AES_set_encrypt_key");
|
||||
&cmp ("eax",0);
|
||||
&je (&label("proceed"));
|
||||
@@ -2981,7 +2974,7 @@ sub deckey()
|
||||
&jb (&label("permute"));
|
||||
|
||||
&xor ("eax","eax"); # return success
|
||||
&function_end("private_AES_set_decrypt_key");
|
||||
&function_end("AES_set_decrypt_key");
|
||||
&asciz("AES for x86, CRYPTOGAMS by <appro\@openssl.org>");
|
||||
|
||||
&asm_finish();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# ====================================================================
|
||||
# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
|
||||
# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
|
||||
# project. The module is, however, dual licensed under OpenSSL and
|
||||
# CRYPTOGAMS licenses depending on where you obtain it. For further
|
||||
# details see http://www.openssl.org/~appro/cryptogams/.
|
||||
@@ -27,11 +27,6 @@
|
||||
# Rescheduling for dual-issue pipeline resulted in 12% improvement on
|
||||
# Cortex A8 core and ~25 cycles per byte processed with 128-bit key.
|
||||
|
||||
# February 2011.
|
||||
#
|
||||
# Profiler-assisted and platform-specific optimization resulted in 16%
|
||||
# improvement on Cortex A8 core and ~21.5 cycles per byte.
|
||||
|
||||
while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
|
||||
open STDOUT,">$output";
|
||||
|
||||
@@ -51,23 +46,8 @@ $key="r11";
|
||||
$rounds="r12";
|
||||
|
||||
$code=<<___;
|
||||
#ifndef __KERNEL__
|
||||
# include "arm_arch.h"
|
||||
#else
|
||||
# define __ARM_ARCH__ __LINUX_ARM_ARCH__
|
||||
#endif
|
||||
|
||||
.text
|
||||
#if __ARM_ARCH__<7
|
||||
.code 32
|
||||
#else
|
||||
.syntax unified
|
||||
# ifdef __thumb2__
|
||||
.thumb
|
||||
# else
|
||||
.code 32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
.type AES_Te,%object
|
||||
.align 5
|
||||
@@ -181,16 +161,12 @@ AES_Te:
|
||||
.type AES_encrypt,%function
|
||||
.align 5
|
||||
AES_encrypt:
|
||||
#if __ARM_ARCH__<7
|
||||
sub r3,pc,#8 @ AES_encrypt
|
||||
#else
|
||||
adr r3,AES_encrypt
|
||||
#endif
|
||||
stmdb sp!,{r1,r4-r12,lr}
|
||||
mov $rounds,r0 @ inp
|
||||
mov $key,r2
|
||||
sub $tbl,r3,#AES_encrypt-AES_Te @ Te
|
||||
#if __ARM_ARCH__<7
|
||||
|
||||
ldrb $s0,[$rounds,#3] @ load input data in endian-neutral
|
||||
ldrb $t1,[$rounds,#2] @ manner...
|
||||
ldrb $t2,[$rounds,#1]
|
||||
@@ -219,33 +195,10 @@ AES_encrypt:
|
||||
orr $s3,$s3,$t1,lsl#8
|
||||
orr $s3,$s3,$t2,lsl#16
|
||||
orr $s3,$s3,$t3,lsl#24
|
||||
#else
|
||||
ldr $s0,[$rounds,#0]
|
||||
ldr $s1,[$rounds,#4]
|
||||
ldr $s2,[$rounds,#8]
|
||||
ldr $s3,[$rounds,#12]
|
||||
#ifdef __ARMEL__
|
||||
rev $s0,$s0
|
||||
rev $s1,$s1
|
||||
rev $s2,$s2
|
||||
rev $s3,$s3
|
||||
#endif
|
||||
#endif
|
||||
|
||||
bl _armv4_AES_encrypt
|
||||
|
||||
ldr $rounds,[sp],#4 @ pop out
|
||||
#if __ARM_ARCH__>=7
|
||||
#ifdef __ARMEL__
|
||||
rev $s0,$s0
|
||||
rev $s1,$s1
|
||||
rev $s2,$s2
|
||||
rev $s3,$s3
|
||||
#endif
|
||||
str $s0,[$rounds,#0]
|
||||
str $s1,[$rounds,#4]
|
||||
str $s2,[$rounds,#8]
|
||||
str $s3,[$rounds,#12]
|
||||
#else
|
||||
mov $t1,$s0,lsr#24 @ write output in endian-neutral
|
||||
mov $t2,$s0,lsr#16 @ manner...
|
||||
mov $t3,$s0,lsr#8
|
||||
@@ -274,15 +227,11 @@ AES_encrypt:
|
||||
strb $t2,[$rounds,#13]
|
||||
strb $t3,[$rounds,#14]
|
||||
strb $s3,[$rounds,#15]
|
||||
#endif
|
||||
#if __ARM_ARCH__>=5
|
||||
ldmia sp!,{r4-r12,pc}
|
||||
#else
|
||||
|
||||
ldmia sp!,{r4-r12,lr}
|
||||
tst lr,#1
|
||||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
#endif
|
||||
.size AES_encrypt,.-AES_encrypt
|
||||
|
||||
.type _armv4_AES_encrypt,%function
|
||||
@@ -322,11 +271,11 @@ _armv4_AES_encrypt:
|
||||
and $i2,lr,$s2,lsr#16 @ i1
|
||||
eor $t3,$t3,$i3,ror#8
|
||||
and $i3,lr,$s2
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Te2[s2>>8]
|
||||
eor $s1,$s1,$t1,ror#24
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Te1[s2>>16]
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Te2[s2>>8]
|
||||
mov $s2,$s2,lsr#24
|
||||
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Te1[s2>>16]
|
||||
ldr $i3,[$tbl,$i3,lsl#2] @ Te3[s2>>0]
|
||||
eor $s0,$s0,$i1,ror#16
|
||||
ldr $s2,[$tbl,$s2,lsl#2] @ Te0[s2>>24]
|
||||
@@ -335,16 +284,16 @@ _armv4_AES_encrypt:
|
||||
and $i2,lr,$s3,lsr#8 @ i1
|
||||
eor $t3,$t3,$i3,ror#16
|
||||
and $i3,lr,$s3,lsr#16 @ i2
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Te3[s3>>0]
|
||||
eor $s2,$s2,$t2,ror#16
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Te2[s3>>8]
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Te3[s3>>0]
|
||||
mov $s3,$s3,lsr#24
|
||||
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Te2[s3>>8]
|
||||
ldr $i3,[$tbl,$i3,lsl#2] @ Te1[s3>>16]
|
||||
eor $s0,$s0,$i1,ror#24
|
||||
ldr $i1,[$key],#16
|
||||
eor $s1,$s1,$i2,ror#16
|
||||
ldr $s3,[$tbl,$s3,lsl#2] @ Te0[s3>>24]
|
||||
eor $s1,$s1,$i2,ror#16
|
||||
ldr $i1,[$key],#16
|
||||
eor $s2,$s2,$i3,ror#8
|
||||
ldr $t1,[$key,#-12]
|
||||
eor $s3,$s3,$t3,ror#8
|
||||
@@ -384,11 +333,11 @@ _armv4_AES_encrypt:
|
||||
and $i2,lr,$s2,lsr#16 @ i1
|
||||
eor $t3,$i3,$t3,lsl#8
|
||||
and $i3,lr,$s2
|
||||
ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s2>>8]
|
||||
eor $s1,$t1,$s1,lsl#24
|
||||
ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s2>>16]
|
||||
ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s2>>8]
|
||||
mov $s2,$s2,lsr#24
|
||||
|
||||
ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s2>>16]
|
||||
ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s2>>0]
|
||||
eor $s0,$i1,$s0,lsl#8
|
||||
ldrb $s2,[$tbl,$s2,lsl#2] @ Te4[s2>>24]
|
||||
@@ -397,15 +346,15 @@ _armv4_AES_encrypt:
|
||||
and $i2,lr,$s3,lsr#8 @ i1
|
||||
eor $t3,$i3,$t3,lsl#8
|
||||
and $i3,lr,$s3,lsr#16 @ i2
|
||||
ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s3>>0]
|
||||
eor $s2,$t2,$s2,lsl#24
|
||||
ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s3>>8]
|
||||
ldrb $i1,[$tbl,$i1,lsl#2] @ Te4[s3>>0]
|
||||
mov $s3,$s3,lsr#24
|
||||
|
||||
ldrb $i2,[$tbl,$i2,lsl#2] @ Te4[s3>>8]
|
||||
ldrb $i3,[$tbl,$i3,lsl#2] @ Te4[s3>>16]
|
||||
eor $s0,$i1,$s0,lsl#8
|
||||
ldr $i1,[$key,#0]
|
||||
ldrb $s3,[$tbl,$s3,lsl#2] @ Te4[s3>>24]
|
||||
ldr $i1,[$key,#0]
|
||||
eor $s1,$s1,$i2,lsl#8
|
||||
ldr $t1,[$key,#4]
|
||||
eor $s2,$s2,$i3,lsl#16
|
||||
@@ -422,26 +371,15 @@ _armv4_AES_encrypt:
|
||||
ldr pc,[sp],#4 @ pop and return
|
||||
.size _armv4_AES_encrypt,.-_armv4_AES_encrypt
|
||||
|
||||
.global private_AES_set_encrypt_key
|
||||
.type private_AES_set_encrypt_key,%function
|
||||
.global AES_set_encrypt_key
|
||||
.type AES_set_encrypt_key,%function
|
||||
.align 5
|
||||
private_AES_set_encrypt_key:
|
||||
_armv4_AES_set_encrypt_key:
|
||||
#if __ARM_ARCH__<7
|
||||
AES_set_encrypt_key:
|
||||
sub r3,pc,#8 @ AES_set_encrypt_key
|
||||
#else
|
||||
adr r3,private_AES_set_encrypt_key
|
||||
#endif
|
||||
teq r0,#0
|
||||
#if __ARM_ARCH__>=7
|
||||
itt eq @ Thumb2 thing, sanity check in ARM
|
||||
#endif
|
||||
moveq r0,#-1
|
||||
beq .Labrt
|
||||
teq r2,#0
|
||||
#if __ARM_ARCH__>=7
|
||||
itt eq @ Thumb2 thing, sanity check in ARM
|
||||
#endif
|
||||
moveq r0,#-1
|
||||
beq .Labrt
|
||||
|
||||
@@ -450,20 +388,16 @@ _armv4_AES_set_encrypt_key:
|
||||
teq r1,#192
|
||||
beq .Lok
|
||||
teq r1,#256
|
||||
#if __ARM_ARCH__>=7
|
||||
itt ne @ Thumb2 thing, sanity check in ARM
|
||||
#endif
|
||||
movne r0,#-1
|
||||
bne .Labrt
|
||||
|
||||
.Lok: stmdb sp!,{r4-r12,lr}
|
||||
sub $tbl,r3,#_armv4_AES_set_encrypt_key-AES_Te-1024 @ Te4
|
||||
sub $tbl,r3,#AES_set_encrypt_key-AES_Te-1024 @ Te4
|
||||
|
||||
mov $rounds,r0 @ inp
|
||||
mov lr,r1 @ bits
|
||||
mov $key,r2 @ key
|
||||
|
||||
#if __ARM_ARCH__<7
|
||||
ldrb $s0,[$rounds,#3] @ load input data in endian-neutral
|
||||
ldrb $t1,[$rounds,#2] @ manner...
|
||||
ldrb $t2,[$rounds,#1]
|
||||
@@ -496,22 +430,6 @@ _armv4_AES_set_encrypt_key:
|
||||
orr $s3,$s3,$t3,lsl#24
|
||||
str $s2,[$key,#-8]
|
||||
str $s3,[$key,#-4]
|
||||
#else
|
||||
ldr $s0,[$rounds,#0]
|
||||
ldr $s1,[$rounds,#4]
|
||||
ldr $s2,[$rounds,#8]
|
||||
ldr $s3,[$rounds,#12]
|
||||
#ifdef __ARMEL__
|
||||
rev $s0,$s0
|
||||
rev $s1,$s1
|
||||
rev $s2,$s2
|
||||
rev $s3,$s3
|
||||
#endif
|
||||
str $s0,[$key],#16
|
||||
str $s1,[$key,#-12]
|
||||
str $s2,[$key,#-8]
|
||||
str $s3,[$key,#-4]
|
||||
#endif
|
||||
|
||||
teq lr,#128
|
||||
bne .Lnot128
|
||||
@@ -548,7 +466,6 @@ _armv4_AES_set_encrypt_key:
|
||||
b .Ldone
|
||||
|
||||
.Lnot128:
|
||||
#if __ARM_ARCH__<7
|
||||
ldrb $i2,[$rounds,#19]
|
||||
ldrb $t1,[$rounds,#18]
|
||||
ldrb $t2,[$rounds,#17]
|
||||
@@ -565,16 +482,6 @@ _armv4_AES_set_encrypt_key:
|
||||
str $i2,[$key],#8
|
||||
orr $i3,$i3,$t3,lsl#24
|
||||
str $i3,[$key,#-4]
|
||||
#else
|
||||
ldr $i2,[$rounds,#16]
|
||||
ldr $i3,[$rounds,#20]
|
||||
#ifdef __ARMEL__
|
||||
rev $i2,$i2
|
||||
rev $i3,$i3
|
||||
#endif
|
||||
str $i2,[$key],#8
|
||||
str $i3,[$key,#-4]
|
||||
#endif
|
||||
|
||||
teq lr,#192
|
||||
bne .Lnot192
|
||||
@@ -607,9 +514,6 @@ _armv4_AES_set_encrypt_key:
|
||||
str $s2,[$key,#-16]
|
||||
subs $rounds,$rounds,#1
|
||||
str $s3,[$key,#-12]
|
||||
#if __ARM_ARCH__>=7
|
||||
itt eq @ Thumb2 thing, sanity check in ARM
|
||||
#endif
|
||||
subeq r2,$key,#216
|
||||
beq .Ldone
|
||||
|
||||
@@ -622,7 +526,6 @@ _armv4_AES_set_encrypt_key:
|
||||
b .L192_loop
|
||||
|
||||
.Lnot192:
|
||||
#if __ARM_ARCH__<7
|
||||
ldrb $i2,[$rounds,#27]
|
||||
ldrb $t1,[$rounds,#26]
|
||||
ldrb $t2,[$rounds,#25]
|
||||
@@ -639,16 +542,6 @@ _armv4_AES_set_encrypt_key:
|
||||
str $i2,[$key],#8
|
||||
orr $i3,$i3,$t3,lsl#24
|
||||
str $i3,[$key,#-4]
|
||||
#else
|
||||
ldr $i2,[$rounds,#24]
|
||||
ldr $i3,[$rounds,#28]
|
||||
#ifdef __ARMEL__
|
||||
rev $i2,$i2
|
||||
rev $i3,$i3
|
||||
#endif
|
||||
str $i2,[$key],#8
|
||||
str $i3,[$key,#-4]
|
||||
#endif
|
||||
|
||||
mov $rounds,#14
|
||||
str $rounds,[$key,#240-32]
|
||||
@@ -679,9 +572,6 @@ _armv4_AES_set_encrypt_key:
|
||||
str $s2,[$key,#-24]
|
||||
subs $rounds,$rounds,#1
|
||||
str $s3,[$key,#-20]
|
||||
#if __ARM_ARCH__>=7
|
||||
itt eq @ Thumb2 thing, sanity check in ARM
|
||||
#endif
|
||||
subeq r2,$key,#256
|
||||
beq .Ldone
|
||||
|
||||
@@ -711,77 +601,48 @@ _armv4_AES_set_encrypt_key:
|
||||
str $i3,[$key,#-4]
|
||||
b .L256_loop
|
||||
|
||||
.align 2
|
||||
.Ldone: mov r0,#0
|
||||
ldmia sp!,{r4-r12,lr}
|
||||
.Labrt:
|
||||
#if __ARM_ARCH__>=5
|
||||
ret @ bx lr
|
||||
#else
|
||||
tst lr,#1
|
||||
.Labrt: tst lr,#1
|
||||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
#endif
|
||||
.size private_AES_set_encrypt_key,.-private_AES_set_encrypt_key
|
||||
.size AES_set_encrypt_key,.-AES_set_encrypt_key
|
||||
|
||||
.global private_AES_set_decrypt_key
|
||||
.type private_AES_set_decrypt_key,%function
|
||||
.global AES_set_decrypt_key
|
||||
.type AES_set_decrypt_key,%function
|
||||
.align 5
|
||||
private_AES_set_decrypt_key:
|
||||
AES_set_decrypt_key:
|
||||
str lr,[sp,#-4]! @ push lr
|
||||
bl _armv4_AES_set_encrypt_key
|
||||
bl AES_set_encrypt_key
|
||||
teq r0,#0
|
||||
ldr lr,[sp],#4 @ pop lr
|
||||
ldrne lr,[sp],#4 @ pop lr
|
||||
bne .Labrt
|
||||
|
||||
mov r0,r2 @ AES_set_encrypt_key preserves r2,
|
||||
mov r1,r2 @ which is AES_KEY *key
|
||||
b _armv4_AES_set_enc2dec_key
|
||||
.size private_AES_set_decrypt_key,.-private_AES_set_decrypt_key
|
||||
stmdb sp!,{r4-r12}
|
||||
|
||||
@ void AES_set_enc2dec_key(const AES_KEY *inp,AES_KEY *out)
|
||||
.global AES_set_enc2dec_key
|
||||
.type AES_set_enc2dec_key,%function
|
||||
.align 5
|
||||
AES_set_enc2dec_key:
|
||||
_armv4_AES_set_enc2dec_key:
|
||||
stmdb sp!,{r4-r12,lr}
|
||||
ldr $rounds,[r2,#240] @ AES_set_encrypt_key preserves r2,
|
||||
mov $key,r2 @ which is AES_KEY *key
|
||||
mov $i1,r2
|
||||
add $i2,r2,$rounds,lsl#4
|
||||
|
||||
ldr $rounds,[r0,#240]
|
||||
mov $i1,r0 @ input
|
||||
add $i2,r0,$rounds,lsl#4
|
||||
mov $key,r1 @ ouput
|
||||
add $tbl,r1,$rounds,lsl#4
|
||||
str $rounds,[r1,#240]
|
||||
|
||||
.Linv: ldr $s0,[$i1],#16
|
||||
ldr $s1,[$i1,#-12]
|
||||
ldr $s2,[$i1,#-8]
|
||||
ldr $s3,[$i1,#-4]
|
||||
ldr $t1,[$i2],#-16
|
||||
ldr $t2,[$i2,#16+4]
|
||||
ldr $t3,[$i2,#16+8]
|
||||
ldr $i3,[$i2,#16+12]
|
||||
str $s0,[$tbl],#-16
|
||||
str $s1,[$tbl,#16+4]
|
||||
str $s2,[$tbl,#16+8]
|
||||
str $s3,[$tbl,#16+12]
|
||||
str $t1,[$key],#16
|
||||
str $t2,[$key,#-12]
|
||||
str $t3,[$key,#-8]
|
||||
str $i3,[$key,#-4]
|
||||
teq $i1,$i2
|
||||
bne .Linv
|
||||
|
||||
ldr $s0,[$i1]
|
||||
.Linv: ldr $s0,[$i1]
|
||||
ldr $s1,[$i1,#4]
|
||||
ldr $s2,[$i1,#8]
|
||||
ldr $s3,[$i1,#12]
|
||||
str $s0,[$key]
|
||||
str $s1,[$key,#4]
|
||||
str $s2,[$key,#8]
|
||||
str $s3,[$key,#12]
|
||||
sub $key,$key,$rounds,lsl#3
|
||||
ldr $t1,[$i2]
|
||||
ldr $t2,[$i2,#4]
|
||||
ldr $t3,[$i2,#8]
|
||||
ldr $i3,[$i2,#12]
|
||||
str $s0,[$i2],#-16
|
||||
str $s1,[$i2,#16+4]
|
||||
str $s2,[$i2,#16+8]
|
||||
str $s3,[$i2,#16+12]
|
||||
str $t1,[$i1],#16
|
||||
str $t2,[$i1,#-12]
|
||||
str $t3,[$i1,#-8]
|
||||
str $i3,[$i1,#-4]
|
||||
teq $i1,$i2
|
||||
bne .Linv
|
||||
___
|
||||
$mask80=$i1;
|
||||
$mask1b=$i2;
|
||||
@@ -831,15 +692,11 @@ $code.=<<___;
|
||||
bne .Lmix
|
||||
|
||||
mov r0,#0
|
||||
#if __ARM_ARCH__>=5
|
||||
ldmia sp!,{r4-r12,pc}
|
||||
#else
|
||||
ldmia sp!,{r4-r12,lr}
|
||||
tst lr,#1
|
||||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
#endif
|
||||
.size AES_set_enc2dec_key,.-AES_set_enc2dec_key
|
||||
.size AES_set_decrypt_key,.-AES_set_decrypt_key
|
||||
|
||||
.type AES_Td,%object
|
||||
.align 5
|
||||
@@ -949,16 +806,12 @@ AES_Td:
|
||||
.type AES_decrypt,%function
|
||||
.align 5
|
||||
AES_decrypt:
|
||||
#if __ARM_ARCH__<7
|
||||
sub r3,pc,#8 @ AES_decrypt
|
||||
#else
|
||||
adr r3,AES_decrypt
|
||||
#endif
|
||||
stmdb sp!,{r1,r4-r12,lr}
|
||||
mov $rounds,r0 @ inp
|
||||
mov $key,r2
|
||||
sub $tbl,r3,#AES_decrypt-AES_Td @ Td
|
||||
#if __ARM_ARCH__<7
|
||||
|
||||
ldrb $s0,[$rounds,#3] @ load input data in endian-neutral
|
||||
ldrb $t1,[$rounds,#2] @ manner...
|
||||
ldrb $t2,[$rounds,#1]
|
||||
@@ -987,33 +840,10 @@ AES_decrypt:
|
||||
orr $s3,$s3,$t1,lsl#8
|
||||
orr $s3,$s3,$t2,lsl#16
|
||||
orr $s3,$s3,$t3,lsl#24
|
||||
#else
|
||||
ldr $s0,[$rounds,#0]
|
||||
ldr $s1,[$rounds,#4]
|
||||
ldr $s2,[$rounds,#8]
|
||||
ldr $s3,[$rounds,#12]
|
||||
#ifdef __ARMEL__
|
||||
rev $s0,$s0
|
||||
rev $s1,$s1
|
||||
rev $s2,$s2
|
||||
rev $s3,$s3
|
||||
#endif
|
||||
#endif
|
||||
|
||||
bl _armv4_AES_decrypt
|
||||
|
||||
ldr $rounds,[sp],#4 @ pop out
|
||||
#if __ARM_ARCH__>=7
|
||||
#ifdef __ARMEL__
|
||||
rev $s0,$s0
|
||||
rev $s1,$s1
|
||||
rev $s2,$s2
|
||||
rev $s3,$s3
|
||||
#endif
|
||||
str $s0,[$rounds,#0]
|
||||
str $s1,[$rounds,#4]
|
||||
str $s2,[$rounds,#8]
|
||||
str $s3,[$rounds,#12]
|
||||
#else
|
||||
mov $t1,$s0,lsr#24 @ write output in endian-neutral
|
||||
mov $t2,$s0,lsr#16 @ manner...
|
||||
mov $t3,$s0,lsr#8
|
||||
@@ -1042,15 +872,11 @@ AES_decrypt:
|
||||
strb $t2,[$rounds,#13]
|
||||
strb $t3,[$rounds,#14]
|
||||
strb $s3,[$rounds,#15]
|
||||
#endif
|
||||
#if __ARM_ARCH__>=5
|
||||
ldmia sp!,{r4-r12,pc}
|
||||
#else
|
||||
|
||||
ldmia sp!,{r4-r12,lr}
|
||||
tst lr,#1
|
||||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
#endif
|
||||
.size AES_decrypt,.-AES_decrypt
|
||||
|
||||
.type _armv4_AES_decrypt,%function
|
||||
@@ -1090,11 +916,11 @@ _armv4_AES_decrypt:
|
||||
and $i2,lr,$s2 @ i1
|
||||
eor $t3,$i3,$t3,ror#8
|
||||
and $i3,lr,$s2,lsr#16
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Td2[s2>>8]
|
||||
eor $s1,$s1,$t1,ror#8
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Td3[s2>>0]
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Td2[s2>>8]
|
||||
mov $s2,$s2,lsr#24
|
||||
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Td3[s2>>0]
|
||||
ldr $i3,[$tbl,$i3,lsl#2] @ Td1[s2>>16]
|
||||
eor $s0,$s0,$i1,ror#16
|
||||
ldr $s2,[$tbl,$s2,lsl#2] @ Td0[s2>>24]
|
||||
@@ -1103,22 +929,22 @@ _armv4_AES_decrypt:
|
||||
and $i2,lr,$s3,lsr#8 @ i1
|
||||
eor $t3,$i3,$t3,ror#8
|
||||
and $i3,lr,$s3 @ i2
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Td1[s3>>16]
|
||||
eor $s2,$s2,$t2,ror#8
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Td2[s3>>8]
|
||||
ldr $i1,[$tbl,$i1,lsl#2] @ Td1[s3>>16]
|
||||
mov $s3,$s3,lsr#24
|
||||
|
||||
ldr $i2,[$tbl,$i2,lsl#2] @ Td2[s3>>8]
|
||||
ldr $i3,[$tbl,$i3,lsl#2] @ Td3[s3>>0]
|
||||
eor $s0,$s0,$i1,ror#8
|
||||
ldr $i1,[$key],#16
|
||||
eor $s1,$s1,$i2,ror#16
|
||||
ldr $s3,[$tbl,$s3,lsl#2] @ Td0[s3>>24]
|
||||
eor $s1,$s1,$i2,ror#16
|
||||
eor $s2,$s2,$i3,ror#24
|
||||
ldr $i1,[$key],#16
|
||||
eor $s3,$s3,$t3,ror#8
|
||||
|
||||
ldr $t1,[$key,#-12]
|
||||
eor $s0,$s0,$i1
|
||||
ldr $t2,[$key,#-8]
|
||||
eor $s3,$s3,$t3,ror#8
|
||||
eor $s0,$s0,$i1
|
||||
ldr $t3,[$key,#-4]
|
||||
and $i1,lr,$s0,lsr#16
|
||||
eor $s1,$s1,$t1
|
||||
@@ -1150,9 +976,8 @@ _armv4_AES_decrypt:
|
||||
ldrb $t3,[$tbl,$i3] @ Td4[s0>>0]
|
||||
and $i3,lr,$s1,lsr#8
|
||||
|
||||
add $s1,$tbl,$s1,lsr#24
|
||||
ldrb $i1,[$tbl,$i1] @ Td4[s1>>0]
|
||||
ldrb $s1,[$s1] @ Td4[s1>>24]
|
||||
ldrb $s1,[$tbl,$s1,lsr#24] @ Td4[s1>>24]
|
||||
ldrb $i2,[$tbl,$i2] @ Td4[s1>>16]
|
||||
eor $s0,$i1,$s0,lsl#24
|
||||
ldrb $i3,[$tbl,$i3] @ Td4[s1>>8]
|
||||
@@ -1160,27 +985,25 @@ _armv4_AES_decrypt:
|
||||
and $i1,lr,$s2,lsr#8 @ i0
|
||||
eor $t2,$t2,$i2,lsl#8
|
||||
and $i2,lr,$s2 @ i1
|
||||
ldrb $i1,[$tbl,$i1] @ Td4[s2>>8]
|
||||
eor $t3,$t3,$i3,lsl#8
|
||||
ldrb $i2,[$tbl,$i2] @ Td4[s2>>0]
|
||||
ldrb $i1,[$tbl,$i1] @ Td4[s2>>8]
|
||||
and $i3,lr,$s2,lsr#16
|
||||
|
||||
add $s2,$tbl,$s2,lsr#24
|
||||
ldrb $s2,[$s2] @ Td4[s2>>24]
|
||||
ldrb $i2,[$tbl,$i2] @ Td4[s2>>0]
|
||||
ldrb $s2,[$tbl,$s2,lsr#24] @ Td4[s2>>24]
|
||||
eor $s0,$s0,$i1,lsl#8
|
||||
ldrb $i3,[$tbl,$i3] @ Td4[s2>>16]
|
||||
eor $s1,$i2,$s1,lsl#16
|
||||
and $i1,lr,$s3,lsr#16 @ i0
|
||||
eor $s2,$t2,$s2,lsl#16
|
||||
and $i2,lr,$s3,lsr#8 @ i1
|
||||
ldrb $i1,[$tbl,$i1] @ Td4[s3>>16]
|
||||
eor $t3,$t3,$i3,lsl#16
|
||||
ldrb $i2,[$tbl,$i2] @ Td4[s3>>8]
|
||||
ldrb $i1,[$tbl,$i1] @ Td4[s3>>16]
|
||||
and $i3,lr,$s3 @ i2
|
||||
|
||||
add $s3,$tbl,$s3,lsr#24
|
||||
ldrb $i2,[$tbl,$i2] @ Td4[s3>>8]
|
||||
ldrb $i3,[$tbl,$i3] @ Td4[s3>>0]
|
||||
ldrb $s3,[$s3] @ Td4[s3>>24]
|
||||
ldrb $s3,[$tbl,$s3,lsr#24] @ Td4[s3>>24]
|
||||
eor $s0,$s0,$i1,lsl#16
|
||||
ldr $i1,[$key,#0]
|
||||
eor $s1,$s1,$i2,lsl#8
|
||||
@@ -1203,15 +1026,5 @@ _armv4_AES_decrypt:
|
||||
___
|
||||
|
||||
$code =~ s/\bbx\s+lr\b/.word\t0xe12fff1e/gm; # make it possible to compile with -march=armv4
|
||||
$code =~ s/\bret\b/bx\tlr/gm;
|
||||
|
||||
open SELF,$0;
|
||||
while(<SELF>) {
|
||||
next if (/^#!/);
|
||||
last if (!s/^#/@/ and !/^$/);
|
||||
print;
|
||||
}
|
||||
close SELF;
|
||||
|
||||
print $code;
|
||||
close STDOUT; # enforce flush
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,10 +19,9 @@
|
||||
# Performance in number of cycles per processed byte for 128-bit key:
|
||||
#
|
||||
# ECB encrypt ECB decrypt CBC large chunk
|
||||
# AMD64 33 43 13.0
|
||||
# EM64T 38 56 18.6(*)
|
||||
# Core 2 30 42 14.5(*)
|
||||
# Atom 65 86 32.1(*)
|
||||
# AMD64 33 41 13.0
|
||||
# EM64T 38 59 18.6(*)
|
||||
# Core 2 30 43 14.5(*)
|
||||
#
|
||||
# (*) with hyper-threading off
|
||||
|
||||
@@ -367,66 +366,68 @@ $code.=<<___;
|
||||
movzb `&lo("$s0")`,$t0
|
||||
movzb `&lo("$s1")`,$t1
|
||||
movzb `&lo("$s2")`,$t2
|
||||
movzb `&lo("$s3")`,$t3
|
||||
movzb `&hi("$s1")`,$acc0
|
||||
movzb `&hi("$s2")`,$acc1
|
||||
shr \$16,$s2
|
||||
movzb `&hi("$s3")`,$acc2
|
||||
movzb ($sbox,$t0,1),$t0
|
||||
movzb ($sbox,$t1,1),$t1
|
||||
movzb ($sbox,$t2,1),$t2
|
||||
movzb ($sbox,$t3,1),$t3
|
||||
|
||||
movzb `&lo("$s3")`,$t3
|
||||
movzb `&hi("$s1")`,$acc0
|
||||
movzb `&hi("$s2")`,$acc1
|
||||
movzb ($sbox,$t3,1),$t3
|
||||
movzb ($sbox,$acc0,1),$t4 #$t0
|
||||
movzb `&hi("$s0")`,$acc0
|
||||
movzb ($sbox,$acc1,1),$t5 #$t1
|
||||
movzb `&lo("$s2")`,$acc1
|
||||
|
||||
movzb `&hi("$s3")`,$acc2
|
||||
movzb `&hi("$s0")`,$acc0
|
||||
shr \$16,$s2
|
||||
movzb ($sbox,$acc2,1),$acc2 #$t2
|
||||
movzb ($sbox,$acc0,1),$acc0 #$t3
|
||||
|
||||
shl \$8,$t4
|
||||
shr \$16,$s3
|
||||
|
||||
movzb `&lo("$s2")`,$acc1
|
||||
shl \$8,$t4
|
||||
shl \$8,$t5
|
||||
xor $t4,$t0
|
||||
shr \$16,$s0
|
||||
movzb `&lo("$s3")`,$t4
|
||||
shr \$16,$s1
|
||||
xor $t5,$t1
|
||||
shl \$8,$acc2
|
||||
movzb `&lo("$s0")`,$t5
|
||||
movzb ($sbox,$acc1,1),$acc1 #$t0
|
||||
xor $acc2,$t2
|
||||
xor $t4,$t0
|
||||
xor $t5,$t1
|
||||
|
||||
movzb `&lo("$s3")`,$t4
|
||||
shr \$16,$s0
|
||||
shr \$16,$s1
|
||||
movzb `&lo("$s0")`,$t5
|
||||
shl \$8,$acc2
|
||||
shl \$8,$acc0
|
||||
movzb `&lo("$s1")`,$acc2
|
||||
shl \$16,$acc1
|
||||
xor $acc0,$t3
|
||||
movzb ($sbox,$t4,1),$t4 #$t1
|
||||
movzb `&hi("$s3")`,$acc0
|
||||
movzb ($sbox,$t5,1),$t5 #$t2
|
||||
xor $acc1,$t0
|
||||
xor $acc2,$t2
|
||||
xor $acc0,$t3
|
||||
|
||||
shr \$8,$s2
|
||||
movzb `&hi("$s0")`,$acc1
|
||||
shl \$16,$t4
|
||||
shr \$8,$s1
|
||||
shl \$16,$t5
|
||||
xor $t4,$t1
|
||||
movzb `&lo("$s1")`,$acc2
|
||||
movzb `&hi("$s3")`,$acc0
|
||||
shl \$16,$acc1
|
||||
movzb ($sbox,$acc2,1),$acc2 #$t3
|
||||
movzb ($sbox,$acc0,1),$acc0 #$t0
|
||||
xor $acc1,$t0
|
||||
|
||||
movzb `&hi("$s0")`,$acc1
|
||||
shr \$8,$s2
|
||||
shr \$8,$s1
|
||||
movzb ($sbox,$acc1,1),$acc1 #$t1
|
||||
movzb ($sbox,$s2,1),$s3 #$t3
|
||||
movzb ($sbox,$s1,1),$s2 #$t2
|
||||
|
||||
shl \$16,$t4
|
||||
shl \$16,$t5
|
||||
shl \$16,$acc2
|
||||
xor $t4,$t1
|
||||
xor $t5,$t2
|
||||
shl \$24,$acc0
|
||||
xor $acc2,$t3
|
||||
|
||||
shl \$24,$acc0
|
||||
shl \$24,$acc1
|
||||
xor $acc0,$t0
|
||||
shl \$24,$s3
|
||||
xor $acc1,$t1
|
||||
xor $acc0,$t0
|
||||
shl \$24,$s2
|
||||
xor $acc1,$t1
|
||||
mov $t0,$s0
|
||||
mov $t1,$s1
|
||||
xor $t2,$s2
|
||||
@@ -465,12 +466,12 @@ sub enctransform()
|
||||
{ my ($t3,$r20,$r21)=($acc2,"%r8d","%r9d");
|
||||
|
||||
$code.=<<___;
|
||||
mov \$0x80808080,$t0
|
||||
mov \$0x80808080,$t1
|
||||
and $s0,$t0
|
||||
and $s1,$t1
|
||||
mov $t0,$acc0
|
||||
mov $t1,$acc1
|
||||
mov $s0,$acc0
|
||||
mov $s1,$acc1
|
||||
and \$0x80808080,$acc0
|
||||
and \$0x80808080,$acc1
|
||||
mov $acc0,$t0
|
||||
mov $acc1,$t1
|
||||
shr \$7,$t0
|
||||
lea ($s0,$s0),$r20
|
||||
shr \$7,$t1
|
||||
@@ -488,25 +489,25 @@ $code.=<<___;
|
||||
|
||||
xor $r20,$s0
|
||||
xor $r21,$s1
|
||||
mov \$0x80808080,$t2
|
||||
mov $s2,$acc0
|
||||
mov $s3,$acc1
|
||||
rol \$24,$s0
|
||||
mov \$0x80808080,$t3
|
||||
rol \$24,$s1
|
||||
and $s2,$t2
|
||||
and $s3,$t3
|
||||
and \$0x80808080,$acc0
|
||||
and \$0x80808080,$acc1
|
||||
xor $r20,$s0
|
||||
xor $r21,$s1
|
||||
mov $t2,$acc0
|
||||
mov $acc0,$t2
|
||||
mov $acc1,$t3
|
||||
ror \$16,$t0
|
||||
mov $t3,$acc1
|
||||
ror \$16,$t1
|
||||
lea ($s2,$s2),$r20
|
||||
shr \$7,$t2
|
||||
lea ($s2,$s2),$r20
|
||||
xor $t0,$s0
|
||||
shr \$7,$t3
|
||||
xor $t1,$s1
|
||||
ror \$8,$t0
|
||||
shr \$7,$t3
|
||||
lea ($s3,$s3),$r21
|
||||
ror \$8,$t0
|
||||
ror \$8,$t1
|
||||
sub $t2,$acc0
|
||||
sub $t3,$acc1
|
||||
@@ -522,23 +523,23 @@ $code.=<<___;
|
||||
xor $acc0,$r20
|
||||
xor $acc1,$r21
|
||||
|
||||
ror \$16,$t2
|
||||
xor $r20,$s2
|
||||
ror \$16,$t3
|
||||
xor $r21,$s3
|
||||
rol \$24,$s2
|
||||
mov 0($sbox),$acc0 # prefetch Te4
|
||||
rol \$24,$s3
|
||||
xor $r20,$s2
|
||||
mov 64($sbox),$acc1
|
||||
xor $r21,$s3
|
||||
mov 128($sbox),$r20
|
||||
mov 0($sbox),$acc0 # prefetch Te4
|
||||
ror \$16,$t2
|
||||
ror \$16,$t3
|
||||
mov 64($sbox),$acc1
|
||||
xor $t2,$s2
|
||||
ror \$8,$t2
|
||||
xor $t3,$s3
|
||||
mov 128($sbox),$r20
|
||||
ror \$8,$t2
|
||||
ror \$8,$t3
|
||||
xor $t2,$s2
|
||||
mov 192($sbox),$r21
|
||||
xor $t2,$s2
|
||||
xor $t3,$s3
|
||||
___
|
||||
}
|
||||
@@ -588,9 +589,6 @@ $code.=<<___;
|
||||
.globl AES_encrypt
|
||||
.type AES_encrypt,\@function,3
|
||||
.align 16
|
||||
.globl asm_AES_encrypt
|
||||
.hidden asm_AES_encrypt
|
||||
asm_AES_encrypt:
|
||||
AES_encrypt:
|
||||
push %rbx
|
||||
push %rbp
|
||||
@@ -935,69 +933,70 @@ $code.=<<___;
|
||||
movzb `&lo("$s0")`,$t0
|
||||
movzb `&lo("$s1")`,$t1
|
||||
movzb `&lo("$s2")`,$t2
|
||||
movzb `&lo("$s3")`,$t3
|
||||
movzb `&hi("$s3")`,$acc0
|
||||
movzb `&hi("$s0")`,$acc1
|
||||
shr \$16,$s3
|
||||
movzb `&hi("$s1")`,$acc2
|
||||
movzb ($sbox,$t0,1),$t0
|
||||
movzb ($sbox,$t1,1),$t1
|
||||
movzb ($sbox,$t2,1),$t2
|
||||
movzb ($sbox,$t3,1),$t3
|
||||
|
||||
movzb `&lo("$s3")`,$t3
|
||||
movzb `&hi("$s3")`,$acc0
|
||||
movzb `&hi("$s0")`,$acc1
|
||||
movzb ($sbox,$t3,1),$t3
|
||||
movzb ($sbox,$acc0,1),$t4 #$t0
|
||||
movzb `&hi("$s2")`,$acc0
|
||||
movzb ($sbox,$acc1,1),$t5 #$t1
|
||||
|
||||
movzb `&hi("$s1")`,$acc2
|
||||
movzb `&hi("$s2")`,$acc0
|
||||
shr \$16,$s2
|
||||
movzb ($sbox,$acc2,1),$acc2 #$t2
|
||||
movzb ($sbox,$acc0,1),$acc0 #$t3
|
||||
shr \$16,$s3
|
||||
|
||||
shr \$16,$s2
|
||||
shl \$8,$t5
|
||||
shl \$8,$t4
|
||||
movzb `&lo("$s2")`,$acc1
|
||||
shr \$16,$s0
|
||||
xor $t4,$t0
|
||||
shr \$16,$s1
|
||||
movzb `&lo("$s3")`,$t4
|
||||
|
||||
shl \$8,$acc2
|
||||
xor $t5,$t1
|
||||
shl \$8,$acc0
|
||||
movzb `&lo("$s0")`,$t5
|
||||
shl \$8,$t4
|
||||
shl \$8,$t5
|
||||
movzb ($sbox,$acc1,1),$acc1 #$t0
|
||||
xor $acc2,$t2
|
||||
movzb `&lo("$s1")`,$acc2
|
||||
xor $t4,$t0
|
||||
xor $t5,$t1
|
||||
|
||||
shl \$16,$acc1
|
||||
xor $acc0,$t3
|
||||
movzb `&lo("$s3")`,$t4
|
||||
shr \$16,$s0
|
||||
shr \$16,$s1
|
||||
movzb `&lo("$s0")`,$t5
|
||||
shl \$8,$acc2
|
||||
shl \$8,$acc0
|
||||
movzb ($sbox,$t4,1),$t4 #$t1
|
||||
movzb `&hi("$s1")`,$acc0
|
||||
movzb ($sbox,$acc2,1),$acc2 #$t3
|
||||
xor $acc1,$t0
|
||||
movzb ($sbox,$t5,1),$t5 #$t2
|
||||
movzb `&hi("$s2")`,$acc1
|
||||
xor $acc2,$t2
|
||||
xor $acc0,$t3
|
||||
|
||||
shl \$16,$acc2
|
||||
movzb `&lo("$s1")`,$acc2
|
||||
movzb `&hi("$s1")`,$acc0
|
||||
shl \$16,$acc1
|
||||
movzb ($sbox,$acc2,1),$acc2 #$t3
|
||||
movzb ($sbox,$acc0,1),$acc0 #$t0
|
||||
xor $acc1,$t0
|
||||
|
||||
movzb `&hi("$s2")`,$acc1
|
||||
shl \$16,$t4
|
||||
shl \$16,$t5
|
||||
xor $acc2,$t3
|
||||
movzb `&hi("$s3")`,$acc2
|
||||
movzb ($sbox,$acc1,1),$s1 #$t1
|
||||
xor $t4,$t1
|
||||
shr \$8,$s0
|
||||
xor $t5,$t2
|
||||
|
||||
movzb ($sbox,$acc0,1),$acc0 #$t0
|
||||
movzb ($sbox,$acc1,1),$s1 #$t1
|
||||
movzb ($sbox,$acc2,1),$s2 #$t2
|
||||
movzb `&hi("$s3")`,$acc1
|
||||
shr \$8,$s0
|
||||
shl \$16,$acc2
|
||||
movzb ($sbox,$acc1,1),$s2 #$t2
|
||||
movzb ($sbox,$s0,1),$s3 #$t3
|
||||
xor $acc2,$t3
|
||||
|
||||
mov $t0,$s0
|
||||
shl \$24,$acc0
|
||||
shl \$24,$s1
|
||||
shl \$24,$s2
|
||||
xor $acc0,$s0
|
||||
xor $acc0,$t0
|
||||
shl \$24,$s3
|
||||
xor $t1,$s1
|
||||
mov $t0,$s0
|
||||
xor $t2,$s2
|
||||
xor $t3,$s3
|
||||
___
|
||||
@@ -1012,12 +1011,12 @@ sub dectransform()
|
||||
my $prefetch = shift;
|
||||
|
||||
$code.=<<___;
|
||||
mov $mask80,$tp40
|
||||
mov $mask80,$tp48
|
||||
and $tp10,$tp40
|
||||
and $tp18,$tp48
|
||||
mov $tp40,$acc0
|
||||
mov $tp48,$acc8
|
||||
mov $tp10,$acc0
|
||||
mov $tp18,$acc8
|
||||
and $mask80,$acc0
|
||||
and $mask80,$acc8
|
||||
mov $acc0,$tp40
|
||||
mov $acc8,$tp48
|
||||
shr \$7,$tp40
|
||||
lea ($tp10,$tp10),$tp20
|
||||
shr \$7,$tp48
|
||||
@@ -1028,15 +1027,15 @@ $code.=<<___;
|
||||
and $maskfe,$tp28
|
||||
and $mask1b,$acc0
|
||||
and $mask1b,$acc8
|
||||
xor $acc0,$tp20
|
||||
xor $acc8,$tp28
|
||||
mov $mask80,$tp80
|
||||
mov $mask80,$tp88
|
||||
xor $tp20,$acc0
|
||||
xor $tp28,$acc8
|
||||
mov $acc0,$tp20
|
||||
mov $acc8,$tp28
|
||||
|
||||
and $tp20,$tp80
|
||||
and $tp28,$tp88
|
||||
mov $tp80,$acc0
|
||||
mov $tp88,$acc8
|
||||
and $mask80,$acc0
|
||||
and $mask80,$acc8
|
||||
mov $acc0,$tp80
|
||||
mov $acc8,$tp88
|
||||
shr \$7,$tp80
|
||||
lea ($tp20,$tp20),$tp40
|
||||
shr \$7,$tp88
|
||||
@@ -1047,15 +1046,15 @@ $code.=<<___;
|
||||
and $maskfe,$tp48
|
||||
and $mask1b,$acc0
|
||||
and $mask1b,$acc8
|
||||
xor $acc0,$tp40
|
||||
xor $acc8,$tp48
|
||||
mov $mask80,$tp80
|
||||
mov $mask80,$tp88
|
||||
xor $tp40,$acc0
|
||||
xor $tp48,$acc8
|
||||
mov $acc0,$tp40
|
||||
mov $acc8,$tp48
|
||||
|
||||
and $tp40,$tp80
|
||||
and $tp48,$tp88
|
||||
mov $tp80,$acc0
|
||||
mov $tp88,$acc8
|
||||
and $mask80,$acc0
|
||||
and $mask80,$acc8
|
||||
mov $acc0,$tp80
|
||||
mov $acc8,$tp88
|
||||
shr \$7,$tp80
|
||||
xor $tp10,$tp20 # tp2^=tp1
|
||||
shr \$7,$tp88
|
||||
@@ -1080,51 +1079,51 @@ $code.=<<___;
|
||||
mov $tp10,$acc0
|
||||
mov $tp18,$acc8
|
||||
xor $tp80,$tp40 # tp4^tp1^=tp8
|
||||
shr \$32,$acc0
|
||||
xor $tp88,$tp48 # tp4^tp1^=tp8
|
||||
shr \$32,$acc0
|
||||
shr \$32,$acc8
|
||||
xor $tp20,$tp80 # tp8^=tp8^tp2^tp1=tp2^tp1
|
||||
rol \$8,`&LO("$tp10")` # ROTATE(tp1^tp8,8)
|
||||
xor $tp28,$tp88 # tp8^=tp8^tp2^tp1=tp2^tp1
|
||||
rol \$8,`&LO("$tp10")` # ROTATE(tp1^tp8,8)
|
||||
rol \$8,`&LO("$tp18")` # ROTATE(tp1^tp8,8)
|
||||
xor $tp40,$tp80 # tp2^tp1^=tp8^tp4^tp1=tp8^tp4^tp2
|
||||
rol \$8,`&LO("$acc0")` # ROTATE(tp1^tp8,8)
|
||||
xor $tp48,$tp88 # tp2^tp1^=tp8^tp4^tp1=tp8^tp4^tp2
|
||||
|
||||
rol \$8,`&LO("$acc0")` # ROTATE(tp1^tp8,8)
|
||||
rol \$8,`&LO("$acc8")` # ROTATE(tp1^tp8,8)
|
||||
xor `&LO("$tp80")`,`&LO("$tp10")`
|
||||
shr \$32,$tp80
|
||||
xor `&LO("$tp88")`,`&LO("$tp18")`
|
||||
shr \$32,$tp80
|
||||
shr \$32,$tp88
|
||||
xor `&LO("$tp80")`,`&LO("$acc0")`
|
||||
xor `&LO("$tp88")`,`&LO("$acc8")`
|
||||
|
||||
mov $tp20,$tp80
|
||||
rol \$24,`&LO("$tp20")` # ROTATE(tp2^tp1^tp8,24)
|
||||
mov $tp28,$tp88
|
||||
rol \$24,`&LO("$tp28")` # ROTATE(tp2^tp1^tp8,24)
|
||||
shr \$32,$tp80
|
||||
xor `&LO("$tp20")`,`&LO("$tp10")`
|
||||
shr \$32,$tp88
|
||||
xor `&LO("$tp28")`,`&LO("$tp18")`
|
||||
rol \$24,`&LO("$tp20")` # ROTATE(tp2^tp1^tp8,24)
|
||||
rol \$24,`&LO("$tp28")` # ROTATE(tp2^tp1^tp8,24)
|
||||
rol \$24,`&LO("$tp80")` # ROTATE(tp2^tp1^tp8,24)
|
||||
mov $tp40,$tp20
|
||||
rol \$24,`&LO("$tp88")` # ROTATE(tp2^tp1^tp8,24)
|
||||
xor `&LO("$tp20")`,`&LO("$tp10")`
|
||||
xor `&LO("$tp28")`,`&LO("$tp18")`
|
||||
mov $tp40,$tp20
|
||||
mov $tp48,$tp28
|
||||
shr \$32,$tp20
|
||||
xor `&LO("$tp80")`,`&LO("$acc0")`
|
||||
shr \$32,$tp28
|
||||
xor `&LO("$tp88")`,`&LO("$acc8")`
|
||||
|
||||
`"mov 0($sbox),$mask80" if ($prefetch)`
|
||||
rol \$16,`&LO("$tp40")` # ROTATE(tp4^tp1^tp8,16)
|
||||
shr \$32,$tp20
|
||||
shr \$32,$tp28
|
||||
`"mov 64($sbox),$maskfe" if ($prefetch)`
|
||||
rol \$16,`&LO("$tp40")` # ROTATE(tp4^tp1^tp8,16)
|
||||
rol \$16,`&LO("$tp48")` # ROTATE(tp4^tp1^tp8,16)
|
||||
`"mov 128($sbox),$mask1b" if ($prefetch)`
|
||||
rol \$16,`&LO("$tp20")` # ROTATE(tp4^tp1^tp8,16)
|
||||
rol \$16,`&LO("$tp28")` # ROTATE(tp4^tp1^tp8,16)
|
||||
`"mov 192($sbox),$tp80" if ($prefetch)`
|
||||
xor `&LO("$tp40")`,`&LO("$tp10")`
|
||||
rol \$16,`&LO("$tp28")` # ROTATE(tp4^tp1^tp8,16)
|
||||
xor `&LO("$tp48")`,`&LO("$tp18")`
|
||||
`"mov 256($sbox),$tp88" if ($prefetch)`
|
||||
xor `&LO("$tp20")`,`&LO("$acc0")`
|
||||
@@ -1186,9 +1185,6 @@ $code.=<<___;
|
||||
.globl AES_decrypt
|
||||
.type AES_decrypt,\@function,3
|
||||
.align 16
|
||||
.globl asm_AES_decrypt
|
||||
.hidden asm_AES_decrypt
|
||||
asm_AES_decrypt:
|
||||
AES_decrypt:
|
||||
push %rbx
|
||||
push %rbp
|
||||
@@ -1282,13 +1278,13 @@ $code.=<<___;
|
||||
___
|
||||
}
|
||||
|
||||
# int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
# int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
$code.=<<___;
|
||||
.globl private_AES_set_encrypt_key
|
||||
.type private_AES_set_encrypt_key,\@function,3
|
||||
.globl AES_set_encrypt_key
|
||||
.type AES_set_encrypt_key,\@function,3
|
||||
.align 16
|
||||
private_AES_set_encrypt_key:
|
||||
AES_set_encrypt_key:
|
||||
push %rbx
|
||||
push %rbp
|
||||
push %r12 # redundant, but allows to share
|
||||
@@ -1300,12 +1296,16 @@ private_AES_set_encrypt_key:
|
||||
|
||||
call _x86_64_AES_set_encrypt_key
|
||||
|
||||
mov 8(%rsp),%r15
|
||||
mov 16(%rsp),%r14
|
||||
mov 24(%rsp),%r13
|
||||
mov 32(%rsp),%r12
|
||||
mov 40(%rsp),%rbp
|
||||
mov 48(%rsp),%rbx
|
||||
add \$56,%rsp
|
||||
.Lenc_key_epilogue:
|
||||
ret
|
||||
.size private_AES_set_encrypt_key,.-private_AES_set_encrypt_key
|
||||
.size AES_set_encrypt_key,.-AES_set_encrypt_key
|
||||
|
||||
.type _x86_64_AES_set_encrypt_key,\@abi-omnipotent
|
||||
.align 16
|
||||
@@ -1548,13 +1548,13 @@ $code.=<<___;
|
||||
___
|
||||
}
|
||||
|
||||
# int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
# int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
$code.=<<___;
|
||||
.globl private_AES_set_decrypt_key
|
||||
.type private_AES_set_decrypt_key,\@function,3
|
||||
.globl AES_set_decrypt_key
|
||||
.type AES_set_decrypt_key,\@function,3
|
||||
.align 16
|
||||
private_AES_set_decrypt_key:
|
||||
AES_set_decrypt_key:
|
||||
push %rbx
|
||||
push %rbp
|
||||
push %r12
|
||||
@@ -1623,7 +1623,7 @@ $code.=<<___;
|
||||
add \$56,%rsp
|
||||
.Ldec_key_epilogue:
|
||||
ret
|
||||
.size private_AES_set_decrypt_key,.-private_AES_set_decrypt_key
|
||||
.size AES_set_decrypt_key,.-AES_set_decrypt_key
|
||||
___
|
||||
|
||||
# void AES_cbc_encrypt (const void char *inp, unsigned char *out,
|
||||
@@ -1649,9 +1649,6 @@ $code.=<<___;
|
||||
.type AES_cbc_encrypt,\@function,6
|
||||
.align 16
|
||||
.extern OPENSSL_ia32cap_P
|
||||
.globl asm_AES_cbc_encrypt
|
||||
.hidden asm_AES_cbc_encrypt
|
||||
asm_AES_cbc_encrypt:
|
||||
AES_cbc_encrypt:
|
||||
cmp \$0,%rdx # check length
|
||||
je .Lcbc_epilogue
|
||||
@@ -2770,13 +2767,13 @@ cbc_se_handler:
|
||||
.rva .LSEH_end_AES_decrypt
|
||||
.rva .LSEH_info_AES_decrypt
|
||||
|
||||
.rva .LSEH_begin_private_AES_set_encrypt_key
|
||||
.rva .LSEH_end_private_AES_set_encrypt_key
|
||||
.rva .LSEH_info_private_AES_set_encrypt_key
|
||||
.rva .LSEH_begin_AES_set_encrypt_key
|
||||
.rva .LSEH_end_AES_set_encrypt_key
|
||||
.rva .LSEH_info_AES_set_encrypt_key
|
||||
|
||||
.rva .LSEH_begin_private_AES_set_decrypt_key
|
||||
.rva .LSEH_end_private_AES_set_decrypt_key
|
||||
.rva .LSEH_info_private_AES_set_decrypt_key
|
||||
.rva .LSEH_begin_AES_set_decrypt_key
|
||||
.rva .LSEH_end_AES_set_decrypt_key
|
||||
.rva .LSEH_info_AES_set_decrypt_key
|
||||
|
||||
.rva .LSEH_begin_AES_cbc_encrypt
|
||||
.rva .LSEH_end_AES_cbc_encrypt
|
||||
@@ -2792,11 +2789,11 @@ cbc_se_handler:
|
||||
.byte 9,0,0,0
|
||||
.rva block_se_handler
|
||||
.rva .Ldec_prologue,.Ldec_epilogue # HandlerData[]
|
||||
.LSEH_info_private_AES_set_encrypt_key:
|
||||
.LSEH_info_AES_set_encrypt_key:
|
||||
.byte 9,0,0,0
|
||||
.rva key_se_handler
|
||||
.rva .Lenc_key_prologue,.Lenc_key_epilogue # HandlerData[]
|
||||
.LSEH_info_private_AES_set_decrypt_key:
|
||||
.LSEH_info_AES_set_decrypt_key:
|
||||
.byte 9,0,0,0
|
||||
.rva key_se_handler
|
||||
.rva .Ldec_key_prologue,.Ldec_key_epilogue # HandlerData[]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,919 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# ====================================================================
|
||||
# Written by David S. Miller <davem@devemloft.net> and Andy Polyakov
|
||||
# <appro@openssl.org>. The module is licensed under 2-clause BSD
|
||||
# license. October 2012. All rights reserved.
|
||||
# ====================================================================
|
||||
|
||||
######################################################################
|
||||
# AES for SPARC T4.
|
||||
#
|
||||
# AES round instructions complete in 3 cycles and can be issued every
|
||||
# cycle. It means that round calculations should take 4*rounds cycles,
|
||||
# because any given round instruction depends on result of *both*
|
||||
# previous instructions:
|
||||
#
|
||||
# |0 |1 |2 |3 |4
|
||||
# |01|01|01|
|
||||
# |23|23|23|
|
||||
# |01|01|...
|
||||
# |23|...
|
||||
#
|
||||
# Provided that fxor [with IV] takes 3 cycles to complete, critical
|
||||
# path length for CBC encrypt would be 3+4*rounds, or in other words
|
||||
# it should process one byte in at least (3+4*rounds)/16 cycles. This
|
||||
# estimate doesn't account for "collateral" instructions, such as
|
||||
# fetching input from memory, xor-ing it with zero-round key and
|
||||
# storing the result. Yet, *measured* performance [for data aligned
|
||||
# at 64-bit boundary!] deviates from this equation by less than 0.5%:
|
||||
#
|
||||
# 128-bit key 192- 256-
|
||||
# CBC encrypt 2.70/2.90(*) 3.20/3.40 3.70/3.90
|
||||
# (*) numbers after slash are for
|
||||
# misaligned data.
|
||||
#
|
||||
# Out-of-order execution logic managed to fully overlap "collateral"
|
||||
# instructions with those on critical path. Amazing!
|
||||
#
|
||||
# As with Intel AES-NI, question is if it's possible to improve
|
||||
# performance of parallelizeable modes by interleaving round
|
||||
# instructions. Provided round instruction latency and throughput
|
||||
# optimal interleave factor is 2. But can we expect 2x performance
|
||||
# improvement? Well, as round instructions can be issued one per
|
||||
# cycle, they don't saturate the 2-way issue pipeline and therefore
|
||||
# there is room for "collateral" calculations... Yet, 2x speed-up
|
||||
# over CBC encrypt remains unattaintable:
|
||||
#
|
||||
# 128-bit key 192- 256-
|
||||
# CBC decrypt 1.64/2.11 1.89/2.37 2.23/2.61
|
||||
# CTR 1.64/2.08(*) 1.89/2.33 2.23/2.61
|
||||
# (*) numbers after slash are for
|
||||
# misaligned data.
|
||||
#
|
||||
# Estimates based on amount of instructions under assumption that
|
||||
# round instructions are not pairable with any other instruction
|
||||
# suggest that latter is the actual case and pipeline runs
|
||||
# underutilized. It should be noted that T4 out-of-order execution
|
||||
# logic is so capable that performance gain from 2x interleave is
|
||||
# not even impressive, ~7-13% over non-interleaved code, largest
|
||||
# for 256-bit keys.
|
||||
|
||||
# To anchor to something else, software implementation processes
|
||||
# one byte in 29 cycles with 128-bit key on same processor. Intel
|
||||
# Sandy Bridge encrypts byte in 5.07 cycles in CBC mode and decrypts
|
||||
# in 0.93, naturally with AES-NI.
|
||||
|
||||
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
|
||||
push(@INC,"${dir}","${dir}../../perlasm");
|
||||
require "sparcv9_modes.pl";
|
||||
|
||||
&asm_init(@ARGV);
|
||||
|
||||
$::evp=1; # if $evp is set to 0, script generates module with
|
||||
# AES_[en|de]crypt, AES_set_[en|de]crypt_key and AES_cbc_encrypt entry
|
||||
# points. These however are not fully compatible with openssl/aes.h,
|
||||
# because they expect AES_KEY to be aligned at 64-bit boundary. When
|
||||
# used through EVP, alignment is arranged at EVP layer. Second thing
|
||||
# that is arranged by EVP is at least 32-bit alignment of IV.
|
||||
|
||||
######################################################################
|
||||
# single-round subroutines
|
||||
#
|
||||
{
|
||||
my ($inp,$out,$key,$rounds,$tmp,$mask)=map("%o$_",(0..5));
|
||||
|
||||
$code.=<<___ if ($::abibits==64);
|
||||
.register %g2,#scratch
|
||||
.register %g3,#scratch
|
||||
|
||||
___
|
||||
$code.=<<___;
|
||||
.text
|
||||
|
||||
.globl aes_t4_encrypt
|
||||
.align 32
|
||||
aes_t4_encrypt:
|
||||
andcc $inp, 7, %g1 ! is input aligned?
|
||||
andn $inp, 7, $inp
|
||||
|
||||
ldx [$key + 0], %g4
|
||||
ldx [$key + 8], %g5
|
||||
|
||||
ldx [$inp + 0], %o4
|
||||
bz,pt %icc, 1f
|
||||
ldx [$inp + 8], %o5
|
||||
ldx [$inp + 16], $inp
|
||||
sll %g1, 3, %g1
|
||||
sub %g0, %g1, %o3
|
||||
sllx %o4, %g1, %o4
|
||||
sllx %o5, %g1, %g1
|
||||
srlx %o5, %o3, %o5
|
||||
srlx $inp, %o3, %o3
|
||||
or %o5, %o4, %o4
|
||||
or %o3, %g1, %o5
|
||||
1:
|
||||
ld [$key + 240], $rounds
|
||||
ldd [$key + 16], %f12
|
||||
ldd [$key + 24], %f14
|
||||
xor %g4, %o4, %o4
|
||||
xor %g5, %o5, %o5
|
||||
movxtod %o4, %f0
|
||||
movxtod %o5, %f2
|
||||
srl $rounds, 1, $rounds
|
||||
ldd [$key + 32], %f16
|
||||
sub $rounds, 1, $rounds
|
||||
ldd [$key + 40], %f18
|
||||
add $key, 48, $key
|
||||
|
||||
.Lenc:
|
||||
aes_eround01 %f12, %f0, %f2, %f4
|
||||
aes_eround23 %f14, %f0, %f2, %f2
|
||||
ldd [$key + 0], %f12
|
||||
ldd [$key + 8], %f14
|
||||
sub $rounds,1,$rounds
|
||||
aes_eround01 %f16, %f4, %f2, %f0
|
||||
aes_eround23 %f18, %f4, %f2, %f2
|
||||
ldd [$key + 16], %f16
|
||||
ldd [$key + 24], %f18
|
||||
brnz,pt $rounds, .Lenc
|
||||
add $key, 32, $key
|
||||
|
||||
andcc $out, 7, $tmp ! is output aligned?
|
||||
aes_eround01 %f12, %f0, %f2, %f4
|
||||
aes_eround23 %f14, %f0, %f2, %f2
|
||||
aes_eround01_l %f16, %f4, %f2, %f0
|
||||
aes_eround23_l %f18, %f4, %f2, %f2
|
||||
|
||||
bnz,pn %icc, 2f
|
||||
nop
|
||||
|
||||
std %f0, [$out + 0]
|
||||
retl
|
||||
std %f2, [$out + 8]
|
||||
|
||||
2: alignaddrl $out, %g0, $out
|
||||
mov 0xff, $mask
|
||||
srl $mask, $tmp, $mask
|
||||
|
||||
faligndata %f0, %f0, %f4
|
||||
faligndata %f0, %f2, %f6
|
||||
faligndata %f2, %f2, %f8
|
||||
|
||||
stda %f4, [$out + $mask]0xc0 ! partial store
|
||||
std %f6, [$out + 8]
|
||||
add $out, 16, $out
|
||||
orn %g0, $mask, $mask
|
||||
retl
|
||||
stda %f8, [$out + $mask]0xc0 ! partial store
|
||||
.type aes_t4_encrypt,#function
|
||||
.size aes_t4_encrypt,.-aes_t4_encrypt
|
||||
|
||||
.globl aes_t4_decrypt
|
||||
.align 32
|
||||
aes_t4_decrypt:
|
||||
andcc $inp, 7, %g1 ! is input aligned?
|
||||
andn $inp, 7, $inp
|
||||
|
||||
ldx [$key + 0], %g4
|
||||
ldx [$key + 8], %g5
|
||||
|
||||
ldx [$inp + 0], %o4
|
||||
bz,pt %icc, 1f
|
||||
ldx [$inp + 8], %o5
|
||||
ldx [$inp + 16], $inp
|
||||
sll %g1, 3, %g1
|
||||
sub %g0, %g1, %o3
|
||||
sllx %o4, %g1, %o4
|
||||
sllx %o5, %g1, %g1
|
||||
srlx %o5, %o3, %o5
|
||||
srlx $inp, %o3, %o3
|
||||
or %o5, %o4, %o4
|
||||
or %o3, %g1, %o5
|
||||
1:
|
||||
ld [$key + 240], $rounds
|
||||
ldd [$key + 16], %f12
|
||||
ldd [$key + 24], %f14
|
||||
xor %g4, %o4, %o4
|
||||
xor %g5, %o5, %o5
|
||||
movxtod %o4, %f0
|
||||
movxtod %o5, %f2
|
||||
srl $rounds, 1, $rounds
|
||||
ldd [$key + 32], %f16
|
||||
sub $rounds, 1, $rounds
|
||||
ldd [$key + 40], %f18
|
||||
add $key, 48, $key
|
||||
|
||||
.Ldec:
|
||||
aes_dround01 %f12, %f0, %f2, %f4
|
||||
aes_dround23 %f14, %f0, %f2, %f2
|
||||
ldd [$key + 0], %f12
|
||||
ldd [$key + 8], %f14
|
||||
sub $rounds,1,$rounds
|
||||
aes_dround01 %f16, %f4, %f2, %f0
|
||||
aes_dround23 %f18, %f4, %f2, %f2
|
||||
ldd [$key + 16], %f16
|
||||
ldd [$key + 24], %f18
|
||||
brnz,pt $rounds, .Ldec
|
||||
add $key, 32, $key
|
||||
|
||||
andcc $out, 7, $tmp ! is output aligned?
|
||||
aes_dround01 %f12, %f0, %f2, %f4
|
||||
aes_dround23 %f14, %f0, %f2, %f2
|
||||
aes_dround01_l %f16, %f4, %f2, %f0
|
||||
aes_dround23_l %f18, %f4, %f2, %f2
|
||||
|
||||
bnz,pn %icc, 2f
|
||||
nop
|
||||
|
||||
std %f0, [$out + 0]
|
||||
retl
|
||||
std %f2, [$out + 8]
|
||||
|
||||
2: alignaddrl $out, %g0, $out
|
||||
mov 0xff, $mask
|
||||
srl $mask, $tmp, $mask
|
||||
|
||||
faligndata %f0, %f0, %f4
|
||||
faligndata %f0, %f2, %f6
|
||||
faligndata %f2, %f2, %f8
|
||||
|
||||
stda %f4, [$out + $mask]0xc0 ! partial store
|
||||
std %f6, [$out + 8]
|
||||
add $out, 16, $out
|
||||
orn %g0, $mask, $mask
|
||||
retl
|
||||
stda %f8, [$out + $mask]0xc0 ! partial store
|
||||
.type aes_t4_decrypt,#function
|
||||
.size aes_t4_decrypt,.-aes_t4_decrypt
|
||||
___
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# key setup subroutines
|
||||
#
|
||||
{
|
||||
my ($inp,$bits,$out,$tmp)=map("%o$_",(0..5));
|
||||
$code.=<<___;
|
||||
.globl aes_t4_set_encrypt_key
|
||||
.align 32
|
||||
aes_t4_set_encrypt_key:
|
||||
.Lset_encrypt_key:
|
||||
and $inp, 7, $tmp
|
||||
alignaddr $inp, %g0, $inp
|
||||
cmp $bits, 192
|
||||
ldd [$inp + 0], %f0
|
||||
bl,pt %icc,.L128
|
||||
ldd [$inp + 8], %f2
|
||||
|
||||
be,pt %icc,.L192
|
||||
ldd [$inp + 16], %f4
|
||||
brz,pt $tmp, .L256aligned
|
||||
ldd [$inp + 24], %f6
|
||||
|
||||
ldd [$inp + 32], %f8
|
||||
faligndata %f0, %f2, %f0
|
||||
faligndata %f2, %f4, %f2
|
||||
faligndata %f4, %f6, %f4
|
||||
faligndata %f6, %f8, %f6
|
||||
.L256aligned:
|
||||
___
|
||||
for ($i=0; $i<6; $i++) {
|
||||
$code.=<<___;
|
||||
std %f0, [$out + `32*$i+0`]
|
||||
aes_kexpand1 %f0, %f6, $i, %f0
|
||||
std %f2, [$out + `32*$i+8`]
|
||||
aes_kexpand2 %f2, %f0, %f2
|
||||
std %f4, [$out + `32*$i+16`]
|
||||
aes_kexpand0 %f4, %f2, %f4
|
||||
std %f6, [$out + `32*$i+24`]
|
||||
aes_kexpand2 %f6, %f4, %f6
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
std %f0, [$out + `32*$i+0`]
|
||||
aes_kexpand1 %f0, %f6, $i, %f0
|
||||
std %f2, [$out + `32*$i+8`]
|
||||
aes_kexpand2 %f2, %f0, %f2
|
||||
std %f4, [$out + `32*$i+16`]
|
||||
std %f6, [$out + `32*$i+24`]
|
||||
std %f0, [$out + `32*$i+32`]
|
||||
std %f2, [$out + `32*$i+40`]
|
||||
|
||||
mov 14, $tmp
|
||||
st $tmp, [$out + 240]
|
||||
retl
|
||||
xor %o0, %o0, %o0
|
||||
|
||||
.align 16
|
||||
.L192:
|
||||
brz,pt $tmp, .L192aligned
|
||||
nop
|
||||
|
||||
ldd [$inp + 24], %f6
|
||||
faligndata %f0, %f2, %f0
|
||||
faligndata %f2, %f4, %f2
|
||||
faligndata %f4, %f6, %f4
|
||||
.L192aligned:
|
||||
___
|
||||
for ($i=0; $i<7; $i++) {
|
||||
$code.=<<___;
|
||||
std %f0, [$out + `24*$i+0`]
|
||||
aes_kexpand1 %f0, %f4, $i, %f0
|
||||
std %f2, [$out + `24*$i+8`]
|
||||
aes_kexpand2 %f2, %f0, %f2
|
||||
std %f4, [$out + `24*$i+16`]
|
||||
aes_kexpand2 %f4, %f2, %f4
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
std %f0, [$out + `24*$i+0`]
|
||||
aes_kexpand1 %f0, %f4, $i, %f0
|
||||
std %f2, [$out + `24*$i+8`]
|
||||
aes_kexpand2 %f2, %f0, %f2
|
||||
std %f4, [$out + `24*$i+16`]
|
||||
std %f0, [$out + `24*$i+24`]
|
||||
std %f2, [$out + `24*$i+32`]
|
||||
|
||||
mov 12, $tmp
|
||||
st $tmp, [$out + 240]
|
||||
retl
|
||||
xor %o0, %o0, %o0
|
||||
|
||||
.align 16
|
||||
.L128:
|
||||
brz,pt $tmp, .L128aligned
|
||||
nop
|
||||
|
||||
ldd [$inp + 16], %f4
|
||||
faligndata %f0, %f2, %f0
|
||||
faligndata %f2, %f4, %f2
|
||||
.L128aligned:
|
||||
___
|
||||
for ($i=0; $i<10; $i++) {
|
||||
$code.=<<___;
|
||||
std %f0, [$out + `16*$i+0`]
|
||||
aes_kexpand1 %f0, %f2, $i, %f0
|
||||
std %f2, [$out + `16*$i+8`]
|
||||
aes_kexpand2 %f2, %f0, %f2
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
std %f0, [$out + `16*$i+0`]
|
||||
std %f2, [$out + `16*$i+8`]
|
||||
|
||||
mov 10, $tmp
|
||||
st $tmp, [$out + 240]
|
||||
retl
|
||||
xor %o0, %o0, %o0
|
||||
.type aes_t4_set_encrypt_key,#function
|
||||
.size aes_t4_set_encrypt_key,.-aes_t4_set_encrypt_key
|
||||
|
||||
.globl aes_t4_set_decrypt_key
|
||||
.align 32
|
||||
aes_t4_set_decrypt_key:
|
||||
mov %o7, %o5
|
||||
call .Lset_encrypt_key
|
||||
nop
|
||||
|
||||
mov %o5, %o7
|
||||
sll $tmp, 4, $inp ! $tmp is number of rounds
|
||||
add $tmp, 2, $tmp
|
||||
add $out, $inp, $inp ! $inp=$out+16*rounds
|
||||
srl $tmp, 2, $tmp ! $tmp=(rounds+2)/4
|
||||
|
||||
.Lkey_flip:
|
||||
ldd [$out + 0], %f0
|
||||
ldd [$out + 8], %f2
|
||||
ldd [$out + 16], %f4
|
||||
ldd [$out + 24], %f6
|
||||
ldd [$inp + 0], %f8
|
||||
ldd [$inp + 8], %f10
|
||||
ldd [$inp - 16], %f12
|
||||
ldd [$inp - 8], %f14
|
||||
sub $tmp, 1, $tmp
|
||||
std %f0, [$inp + 0]
|
||||
std %f2, [$inp + 8]
|
||||
std %f4, [$inp - 16]
|
||||
std %f6, [$inp - 8]
|
||||
std %f8, [$out + 0]
|
||||
std %f10, [$out + 8]
|
||||
std %f12, [$out + 16]
|
||||
std %f14, [$out + 24]
|
||||
add $out, 32, $out
|
||||
brnz $tmp, .Lkey_flip
|
||||
sub $inp, 32, $inp
|
||||
|
||||
retl
|
||||
xor %o0, %o0, %o0
|
||||
.type aes_t4_set_decrypt_key,#function
|
||||
.size aes_t4_set_decrypt_key,.-aes_t4_set_decrypt_key
|
||||
___
|
||||
}
|
||||
|
||||
{{{
|
||||
my ($inp,$out,$len,$key,$ivec,$enc)=map("%i$_",(0..5));
|
||||
my ($ileft,$iright,$ooff,$omask,$ivoff)=map("%l$_",(1..7));
|
||||
|
||||
$code.=<<___;
|
||||
.align 32
|
||||
_aes128_encrypt_1x:
|
||||
___
|
||||
for ($i=0; $i<4; $i++) {
|
||||
$code.=<<___;
|
||||
aes_eround01 %f`16+8*$i+0`, %f0, %f2, %f4
|
||||
aes_eround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+4`, %f4, %f2, %f0
|
||||
aes_eround23 %f`16+8*$i+6`, %f4, %f2, %f2
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_eround01 %f48, %f0, %f2, %f4
|
||||
aes_eround23 %f50, %f0, %f2, %f2
|
||||
aes_eround01_l %f52, %f4, %f2, %f0
|
||||
retl
|
||||
aes_eround23_l %f54, %f4, %f2, %f2
|
||||
.type _aes128_encrypt_1x,#function
|
||||
.size _aes128_encrypt_1x,.-_aes128_encrypt_1x
|
||||
|
||||
.align 32
|
||||
_aes128_encrypt_2x:
|
||||
___
|
||||
for ($i=0; $i<4; $i++) {
|
||||
$code.=<<___;
|
||||
aes_eround01 %f`16+8*$i+0`, %f0, %f2, %f8
|
||||
aes_eround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+0`, %f4, %f6, %f10
|
||||
aes_eround23 %f`16+8*$i+2`, %f4, %f6, %f6
|
||||
aes_eround01 %f`16+8*$i+4`, %f8, %f2, %f0
|
||||
aes_eround23 %f`16+8*$i+6`, %f8, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+4`, %f10, %f6, %f4
|
||||
aes_eround23 %f`16+8*$i+6`, %f10, %f6, %f6
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_eround01 %f48, %f0, %f2, %f8
|
||||
aes_eround23 %f50, %f0, %f2, %f2
|
||||
aes_eround01 %f48, %f4, %f6, %f10
|
||||
aes_eround23 %f50, %f4, %f6, %f6
|
||||
aes_eround01_l %f52, %f8, %f2, %f0
|
||||
aes_eround23_l %f54, %f8, %f2, %f2
|
||||
aes_eround01_l %f52, %f10, %f6, %f4
|
||||
retl
|
||||
aes_eround23_l %f54, %f10, %f6, %f6
|
||||
.type _aes128_encrypt_2x,#function
|
||||
.size _aes128_encrypt_2x,.-_aes128_encrypt_2x
|
||||
|
||||
.align 32
|
||||
_aes128_loadkey:
|
||||
ldx [$key + 0], %g4
|
||||
ldx [$key + 8], %g5
|
||||
___
|
||||
for ($i=2; $i<22;$i++) { # load key schedule
|
||||
$code.=<<___;
|
||||
ldd [$key + `8*$i`], %f`12+2*$i`
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
retl
|
||||
nop
|
||||
.type _aes128_loadkey,#function
|
||||
.size _aes128_loadkey,.-_aes128_loadkey
|
||||
_aes128_load_enckey=_aes128_loadkey
|
||||
_aes128_load_deckey=_aes128_loadkey
|
||||
|
||||
___
|
||||
|
||||
&alg_cbc_encrypt_implement("aes",128);
|
||||
if ($::evp) {
|
||||
&alg_ctr32_implement("aes",128);
|
||||
&alg_xts_implement("aes",128,"en");
|
||||
&alg_xts_implement("aes",128,"de");
|
||||
}
|
||||
&alg_cbc_decrypt_implement("aes",128);
|
||||
|
||||
$code.=<<___;
|
||||
.align 32
|
||||
_aes128_decrypt_1x:
|
||||
___
|
||||
for ($i=0; $i<4; $i++) {
|
||||
$code.=<<___;
|
||||
aes_dround01 %f`16+8*$i+0`, %f0, %f2, %f4
|
||||
aes_dround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+4`, %f4, %f2, %f0
|
||||
aes_dround23 %f`16+8*$i+6`, %f4, %f2, %f2
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_dround01 %f48, %f0, %f2, %f4
|
||||
aes_dround23 %f50, %f0, %f2, %f2
|
||||
aes_dround01_l %f52, %f4, %f2, %f0
|
||||
retl
|
||||
aes_dround23_l %f54, %f4, %f2, %f2
|
||||
.type _aes128_decrypt_1x,#function
|
||||
.size _aes128_decrypt_1x,.-_aes128_decrypt_1x
|
||||
|
||||
.align 32
|
||||
_aes128_decrypt_2x:
|
||||
___
|
||||
for ($i=0; $i<4; $i++) {
|
||||
$code.=<<___;
|
||||
aes_dround01 %f`16+8*$i+0`, %f0, %f2, %f8
|
||||
aes_dround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+0`, %f4, %f6, %f10
|
||||
aes_dround23 %f`16+8*$i+2`, %f4, %f6, %f6
|
||||
aes_dround01 %f`16+8*$i+4`, %f8, %f2, %f0
|
||||
aes_dround23 %f`16+8*$i+6`, %f8, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+4`, %f10, %f6, %f4
|
||||
aes_dround23 %f`16+8*$i+6`, %f10, %f6, %f6
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_dround01 %f48, %f0, %f2, %f8
|
||||
aes_dround23 %f50, %f0, %f2, %f2
|
||||
aes_dround01 %f48, %f4, %f6, %f10
|
||||
aes_dround23 %f50, %f4, %f6, %f6
|
||||
aes_dround01_l %f52, %f8, %f2, %f0
|
||||
aes_dround23_l %f54, %f8, %f2, %f2
|
||||
aes_dround01_l %f52, %f10, %f6, %f4
|
||||
retl
|
||||
aes_dround23_l %f54, %f10, %f6, %f6
|
||||
.type _aes128_decrypt_2x,#function
|
||||
.size _aes128_decrypt_2x,.-_aes128_decrypt_2x
|
||||
___
|
||||
|
||||
$code.=<<___;
|
||||
.align 32
|
||||
_aes192_encrypt_1x:
|
||||
___
|
||||
for ($i=0; $i<5; $i++) {
|
||||
$code.=<<___;
|
||||
aes_eround01 %f`16+8*$i+0`, %f0, %f2, %f4
|
||||
aes_eround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+4`, %f4, %f2, %f0
|
||||
aes_eround23 %f`16+8*$i+6`, %f4, %f2, %f2
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_eround01 %f56, %f0, %f2, %f4
|
||||
aes_eround23 %f58, %f0, %f2, %f2
|
||||
aes_eround01_l %f60, %f4, %f2, %f0
|
||||
retl
|
||||
aes_eround23_l %f62, %f4, %f2, %f2
|
||||
.type _aes192_encrypt_1x,#function
|
||||
.size _aes192_encrypt_1x,.-_aes192_encrypt_1x
|
||||
|
||||
.align 32
|
||||
_aes192_encrypt_2x:
|
||||
___
|
||||
for ($i=0; $i<5; $i++) {
|
||||
$code.=<<___;
|
||||
aes_eround01 %f`16+8*$i+0`, %f0, %f2, %f8
|
||||
aes_eround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+0`, %f4, %f6, %f10
|
||||
aes_eround23 %f`16+8*$i+2`, %f4, %f6, %f6
|
||||
aes_eround01 %f`16+8*$i+4`, %f8, %f2, %f0
|
||||
aes_eround23 %f`16+8*$i+6`, %f8, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+4`, %f10, %f6, %f4
|
||||
aes_eround23 %f`16+8*$i+6`, %f10, %f6, %f6
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_eround01 %f56, %f0, %f2, %f8
|
||||
aes_eround23 %f58, %f0, %f2, %f2
|
||||
aes_eround01 %f56, %f4, %f6, %f10
|
||||
aes_eround23 %f58, %f4, %f6, %f6
|
||||
aes_eround01_l %f60, %f8, %f2, %f0
|
||||
aes_eround23_l %f62, %f8, %f2, %f2
|
||||
aes_eround01_l %f60, %f10, %f6, %f4
|
||||
retl
|
||||
aes_eround23_l %f62, %f10, %f6, %f6
|
||||
.type _aes192_encrypt_2x,#function
|
||||
.size _aes192_encrypt_2x,.-_aes192_encrypt_2x
|
||||
|
||||
.align 32
|
||||
_aes256_encrypt_1x:
|
||||
aes_eround01 %f16, %f0, %f2, %f4
|
||||
aes_eround23 %f18, %f0, %f2, %f2
|
||||
ldd [$key + 208], %f16
|
||||
ldd [$key + 216], %f18
|
||||
aes_eround01 %f20, %f4, %f2, %f0
|
||||
aes_eround23 %f22, %f4, %f2, %f2
|
||||
ldd [$key + 224], %f20
|
||||
ldd [$key + 232], %f22
|
||||
___
|
||||
for ($i=1; $i<6; $i++) {
|
||||
$code.=<<___;
|
||||
aes_eround01 %f`16+8*$i+0`, %f0, %f2, %f4
|
||||
aes_eround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+4`, %f4, %f2, %f0
|
||||
aes_eround23 %f`16+8*$i+6`, %f4, %f2, %f2
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_eround01 %f16, %f0, %f2, %f4
|
||||
aes_eround23 %f18, %f0, %f2, %f2
|
||||
ldd [$key + 16], %f16
|
||||
ldd [$key + 24], %f18
|
||||
aes_eround01_l %f20, %f4, %f2, %f0
|
||||
aes_eround23_l %f22, %f4, %f2, %f2
|
||||
ldd [$key + 32], %f20
|
||||
retl
|
||||
ldd [$key + 40], %f22
|
||||
.type _aes256_encrypt_1x,#function
|
||||
.size _aes256_encrypt_1x,.-_aes256_encrypt_1x
|
||||
|
||||
.align 32
|
||||
_aes256_encrypt_2x:
|
||||
aes_eround01 %f16, %f0, %f2, %f8
|
||||
aes_eround23 %f18, %f0, %f2, %f2
|
||||
aes_eround01 %f16, %f4, %f6, %f10
|
||||
aes_eround23 %f18, %f4, %f6, %f6
|
||||
ldd [$key + 208], %f16
|
||||
ldd [$key + 216], %f18
|
||||
aes_eround01 %f20, %f8, %f2, %f0
|
||||
aes_eround23 %f22, %f8, %f2, %f2
|
||||
aes_eround01 %f20, %f10, %f6, %f4
|
||||
aes_eround23 %f22, %f10, %f6, %f6
|
||||
ldd [$key + 224], %f20
|
||||
ldd [$key + 232], %f22
|
||||
___
|
||||
for ($i=1; $i<6; $i++) {
|
||||
$code.=<<___;
|
||||
aes_eround01 %f`16+8*$i+0`, %f0, %f2, %f8
|
||||
aes_eround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+0`, %f4, %f6, %f10
|
||||
aes_eround23 %f`16+8*$i+2`, %f4, %f6, %f6
|
||||
aes_eround01 %f`16+8*$i+4`, %f8, %f2, %f0
|
||||
aes_eround23 %f`16+8*$i+6`, %f8, %f2, %f2
|
||||
aes_eround01 %f`16+8*$i+4`, %f10, %f6, %f4
|
||||
aes_eround23 %f`16+8*$i+6`, %f10, %f6, %f6
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_eround01 %f16, %f0, %f2, %f8
|
||||
aes_eround23 %f18, %f0, %f2, %f2
|
||||
aes_eround01 %f16, %f4, %f6, %f10
|
||||
aes_eround23 %f18, %f4, %f6, %f6
|
||||
ldd [$key + 16], %f16
|
||||
ldd [$key + 24], %f18
|
||||
aes_eround01_l %f20, %f8, %f2, %f0
|
||||
aes_eround23_l %f22, %f8, %f2, %f2
|
||||
aes_eround01_l %f20, %f10, %f6, %f4
|
||||
aes_eround23_l %f22, %f10, %f6, %f6
|
||||
ldd [$key + 32], %f20
|
||||
retl
|
||||
ldd [$key + 40], %f22
|
||||
.type _aes256_encrypt_2x,#function
|
||||
.size _aes256_encrypt_2x,.-_aes256_encrypt_2x
|
||||
|
||||
.align 32
|
||||
_aes192_loadkey:
|
||||
ldx [$key + 0], %g4
|
||||
ldx [$key + 8], %g5
|
||||
___
|
||||
for ($i=2; $i<26;$i++) { # load key schedule
|
||||
$code.=<<___;
|
||||
ldd [$key + `8*$i`], %f`12+2*$i`
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
retl
|
||||
nop
|
||||
.type _aes192_loadkey,#function
|
||||
.size _aes192_loadkey,.-_aes192_loadkey
|
||||
_aes256_loadkey=_aes192_loadkey
|
||||
_aes192_load_enckey=_aes192_loadkey
|
||||
_aes192_load_deckey=_aes192_loadkey
|
||||
_aes256_load_enckey=_aes192_loadkey
|
||||
_aes256_load_deckey=_aes192_loadkey
|
||||
___
|
||||
|
||||
&alg_cbc_encrypt_implement("aes",256);
|
||||
&alg_cbc_encrypt_implement("aes",192);
|
||||
if ($::evp) {
|
||||
&alg_ctr32_implement("aes",256);
|
||||
&alg_xts_implement("aes",256,"en");
|
||||
&alg_xts_implement("aes",256,"de");
|
||||
&alg_ctr32_implement("aes",192);
|
||||
}
|
||||
&alg_cbc_decrypt_implement("aes",192);
|
||||
&alg_cbc_decrypt_implement("aes",256);
|
||||
|
||||
$code.=<<___;
|
||||
.align 32
|
||||
_aes256_decrypt_1x:
|
||||
aes_dround01 %f16, %f0, %f2, %f4
|
||||
aes_dround23 %f18, %f0, %f2, %f2
|
||||
ldd [$key + 208], %f16
|
||||
ldd [$key + 216], %f18
|
||||
aes_dround01 %f20, %f4, %f2, %f0
|
||||
aes_dround23 %f22, %f4, %f2, %f2
|
||||
ldd [$key + 224], %f20
|
||||
ldd [$key + 232], %f22
|
||||
___
|
||||
for ($i=1; $i<6; $i++) {
|
||||
$code.=<<___;
|
||||
aes_dround01 %f`16+8*$i+0`, %f0, %f2, %f4
|
||||
aes_dround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+4`, %f4, %f2, %f0
|
||||
aes_dround23 %f`16+8*$i+6`, %f4, %f2, %f2
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_dround01 %f16, %f0, %f2, %f4
|
||||
aes_dround23 %f18, %f0, %f2, %f2
|
||||
ldd [$key + 16], %f16
|
||||
ldd [$key + 24], %f18
|
||||
aes_dround01_l %f20, %f4, %f2, %f0
|
||||
aes_dround23_l %f22, %f4, %f2, %f2
|
||||
ldd [$key + 32], %f20
|
||||
retl
|
||||
ldd [$key + 40], %f22
|
||||
.type _aes256_decrypt_1x,#function
|
||||
.size _aes256_decrypt_1x,.-_aes256_decrypt_1x
|
||||
|
||||
.align 32
|
||||
_aes256_decrypt_2x:
|
||||
aes_dround01 %f16, %f0, %f2, %f8
|
||||
aes_dround23 %f18, %f0, %f2, %f2
|
||||
aes_dround01 %f16, %f4, %f6, %f10
|
||||
aes_dround23 %f18, %f4, %f6, %f6
|
||||
ldd [$key + 208], %f16
|
||||
ldd [$key + 216], %f18
|
||||
aes_dround01 %f20, %f8, %f2, %f0
|
||||
aes_dround23 %f22, %f8, %f2, %f2
|
||||
aes_dround01 %f20, %f10, %f6, %f4
|
||||
aes_dround23 %f22, %f10, %f6, %f6
|
||||
ldd [$key + 224], %f20
|
||||
ldd [$key + 232], %f22
|
||||
___
|
||||
for ($i=1; $i<6; $i++) {
|
||||
$code.=<<___;
|
||||
aes_dround01 %f`16+8*$i+0`, %f0, %f2, %f8
|
||||
aes_dround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+0`, %f4, %f6, %f10
|
||||
aes_dround23 %f`16+8*$i+2`, %f4, %f6, %f6
|
||||
aes_dround01 %f`16+8*$i+4`, %f8, %f2, %f0
|
||||
aes_dround23 %f`16+8*$i+6`, %f8, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+4`, %f10, %f6, %f4
|
||||
aes_dround23 %f`16+8*$i+6`, %f10, %f6, %f6
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_dround01 %f16, %f0, %f2, %f8
|
||||
aes_dround23 %f18, %f0, %f2, %f2
|
||||
aes_dround01 %f16, %f4, %f6, %f10
|
||||
aes_dround23 %f18, %f4, %f6, %f6
|
||||
ldd [$key + 16], %f16
|
||||
ldd [$key + 24], %f18
|
||||
aes_dround01_l %f20, %f8, %f2, %f0
|
||||
aes_dround23_l %f22, %f8, %f2, %f2
|
||||
aes_dround01_l %f20, %f10, %f6, %f4
|
||||
aes_dround23_l %f22, %f10, %f6, %f6
|
||||
ldd [$key + 32], %f20
|
||||
retl
|
||||
ldd [$key + 40], %f22
|
||||
.type _aes256_decrypt_2x,#function
|
||||
.size _aes256_decrypt_2x,.-_aes256_decrypt_2x
|
||||
|
||||
.align 32
|
||||
_aes192_decrypt_1x:
|
||||
___
|
||||
for ($i=0; $i<5; $i++) {
|
||||
$code.=<<___;
|
||||
aes_dround01 %f`16+8*$i+0`, %f0, %f2, %f4
|
||||
aes_dround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+4`, %f4, %f2, %f0
|
||||
aes_dround23 %f`16+8*$i+6`, %f4, %f2, %f2
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_dround01 %f56, %f0, %f2, %f4
|
||||
aes_dround23 %f58, %f0, %f2, %f2
|
||||
aes_dround01_l %f60, %f4, %f2, %f0
|
||||
retl
|
||||
aes_dround23_l %f62, %f4, %f2, %f2
|
||||
.type _aes192_decrypt_1x,#function
|
||||
.size _aes192_decrypt_1x,.-_aes192_decrypt_1x
|
||||
|
||||
.align 32
|
||||
_aes192_decrypt_2x:
|
||||
___
|
||||
for ($i=0; $i<5; $i++) {
|
||||
$code.=<<___;
|
||||
aes_dround01 %f`16+8*$i+0`, %f0, %f2, %f8
|
||||
aes_dround23 %f`16+8*$i+2`, %f0, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+0`, %f4, %f6, %f10
|
||||
aes_dround23 %f`16+8*$i+2`, %f4, %f6, %f6
|
||||
aes_dround01 %f`16+8*$i+4`, %f8, %f2, %f0
|
||||
aes_dround23 %f`16+8*$i+6`, %f8, %f2, %f2
|
||||
aes_dround01 %f`16+8*$i+4`, %f10, %f6, %f4
|
||||
aes_dround23 %f`16+8*$i+6`, %f10, %f6, %f6
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
aes_dround01 %f56, %f0, %f2, %f8
|
||||
aes_dround23 %f58, %f0, %f2, %f2
|
||||
aes_dround01 %f56, %f4, %f6, %f10
|
||||
aes_dround23 %f58, %f4, %f6, %f6
|
||||
aes_dround01_l %f60, %f8, %f2, %f0
|
||||
aes_dround23_l %f62, %f8, %f2, %f2
|
||||
aes_dround01_l %f60, %f10, %f6, %f4
|
||||
retl
|
||||
aes_dround23_l %f62, %f10, %f6, %f6
|
||||
.type _aes192_decrypt_2x,#function
|
||||
.size _aes192_decrypt_2x,.-_aes192_decrypt_2x
|
||||
___
|
||||
}}}
|
||||
|
||||
if (!$::evp) {
|
||||
$code.=<<___;
|
||||
.global AES_encrypt
|
||||
AES_encrypt=aes_t4_encrypt
|
||||
.global AES_decrypt
|
||||
AES_decrypt=aes_t4_decrypt
|
||||
.global AES_set_encrypt_key
|
||||
.align 32
|
||||
AES_set_encrypt_key:
|
||||
andcc %o2, 7, %g0 ! check alignment
|
||||
bnz,a,pn %icc, 1f
|
||||
mov -1, %o0
|
||||
brz,a,pn %o0, 1f
|
||||
mov -1, %o0
|
||||
brz,a,pn %o2, 1f
|
||||
mov -1, %o0
|
||||
andncc %o1, 0x1c0, %g0
|
||||
bnz,a,pn %icc, 1f
|
||||
mov -2, %o0
|
||||
cmp %o1, 128
|
||||
bl,a,pn %icc, 1f
|
||||
mov -2, %o0
|
||||
b aes_t4_set_encrypt_key
|
||||
nop
|
||||
1: retl
|
||||
nop
|
||||
.type AES_set_encrypt_key,#function
|
||||
.size AES_set_encrypt_key,.-AES_set_encrypt_key
|
||||
|
||||
.global AES_set_decrypt_key
|
||||
.align 32
|
||||
AES_set_decrypt_key:
|
||||
andcc %o2, 7, %g0 ! check alignment
|
||||
bnz,a,pn %icc, 1f
|
||||
mov -1, %o0
|
||||
brz,a,pn %o0, 1f
|
||||
mov -1, %o0
|
||||
brz,a,pn %o2, 1f
|
||||
mov -1, %o0
|
||||
andncc %o1, 0x1c0, %g0
|
||||
bnz,a,pn %icc, 1f
|
||||
mov -2, %o0
|
||||
cmp %o1, 128
|
||||
bl,a,pn %icc, 1f
|
||||
mov -2, %o0
|
||||
b aes_t4_set_decrypt_key
|
||||
nop
|
||||
1: retl
|
||||
nop
|
||||
.type AES_set_decrypt_key,#function
|
||||
.size AES_set_decrypt_key,.-AES_set_decrypt_key
|
||||
___
|
||||
|
||||
my ($inp,$out,$len,$key,$ivec,$enc)=map("%o$_",(0..5));
|
||||
|
||||
$code.=<<___;
|
||||
.globl AES_cbc_encrypt
|
||||
.align 32
|
||||
AES_cbc_encrypt:
|
||||
ld [$key + 240], %g1
|
||||
nop
|
||||
brz $enc, .Lcbc_decrypt
|
||||
cmp %g1, 12
|
||||
|
||||
bl,pt %icc, aes128_t4_cbc_encrypt
|
||||
nop
|
||||
be,pn %icc, aes192_t4_cbc_encrypt
|
||||
nop
|
||||
ba aes256_t4_cbc_encrypt
|
||||
nop
|
||||
|
||||
.Lcbc_decrypt:
|
||||
bl,pt %icc, aes128_t4_cbc_decrypt
|
||||
nop
|
||||
be,pn %icc, aes192_t4_cbc_decrypt
|
||||
nop
|
||||
ba aes256_t4_cbc_decrypt
|
||||
nop
|
||||
.type AES_cbc_encrypt,#function
|
||||
.size AES_cbc_encrypt,.-AES_cbc_encrypt
|
||||
___
|
||||
}
|
||||
$code.=<<___;
|
||||
.asciz "AES for SPARC T4, David S. Miller, Andy Polyakov"
|
||||
.align 4
|
||||
___
|
||||
|
||||
&emit_assembler();
|
||||
|
||||
close STDOUT;
|
||||
@@ -1,962 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# ====================================================================
|
||||
# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
|
||||
# project. The module is, however, dual licensed under OpenSSL and
|
||||
# CRYPTOGAMS licenses depending on where you obtain it. For further
|
||||
# details see http://www.openssl.org/~appro/cryptogams/.
|
||||
# ====================================================================
|
||||
#
|
||||
# This module implements support for ARMv8 AES instructions. The
|
||||
# module is endian-agnostic in sense that it supports both big- and
|
||||
# little-endian cases. As does it support both 32- and 64-bit modes
|
||||
# of operation. Latter is achieved by limiting amount of utilized
|
||||
# registers to 16, which implies additional NEON load and integer
|
||||
# instructions. This has no effect on mighty Apple A7, where results
|
||||
# are literally equal to the theoretical estimates based on AES
|
||||
# instruction latencies and issue rates. On Cortex-A53, an in-order
|
||||
# execution core, this costs up to 10-15%, which is partially
|
||||
# compensated by implementing dedicated code path for 128-bit
|
||||
# CBC encrypt case. On Cortex-A57 parallelizable mode performance
|
||||
# seems to be limited by sheer amount of NEON instructions...
|
||||
#
|
||||
# Performance in cycles per byte processed with 128-bit key:
|
||||
#
|
||||
# CBC enc CBC dec CTR
|
||||
# Apple A7 2.39 1.20 1.20
|
||||
# Cortex-A53 2.45 1.87 1.94
|
||||
# Cortex-A57 3.64 1.34 1.32
|
||||
|
||||
$flavour = shift;
|
||||
open STDOUT,">".shift;
|
||||
|
||||
$prefix="aes_v8";
|
||||
|
||||
$code=<<___;
|
||||
#include "arm_arch.h"
|
||||
|
||||
#if __ARM_MAX_ARCH__>=7
|
||||
.text
|
||||
___
|
||||
$code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/);
|
||||
$code.=".arch armv7-a\n.fpu neon\n.code 32\n" if ($flavour !~ /64/);
|
||||
#^^^^^^ this is done to simplify adoption by not depending
|
||||
# on latest binutils.
|
||||
|
||||
# Assembler mnemonics are an eclectic mix of 32- and 64-bit syntax,
|
||||
# NEON is mostly 32-bit mnemonics, integer - mostly 64. Goal is to
|
||||
# maintain both 32- and 64-bit codes within single module and
|
||||
# transliterate common code to either flavour with regex vodoo.
|
||||
#
|
||||
{{{
|
||||
my ($inp,$bits,$out,$ptr,$rounds)=("x0","w1","x2","x3","w12");
|
||||
my ($zero,$rcon,$mask,$in0,$in1,$tmp,$key)=
|
||||
$flavour=~/64/? map("q$_",(0..6)) : map("q$_",(0..3,8..10));
|
||||
|
||||
|
||||
$code.=<<___;
|
||||
.align 5
|
||||
rcon:
|
||||
.long 0x01,0x01,0x01,0x01
|
||||
.long 0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d // rotate-n-splat
|
||||
.long 0x1b,0x1b,0x1b,0x1b
|
||||
|
||||
.globl ${prefix}_set_encrypt_key
|
||||
.type ${prefix}_set_encrypt_key,%function
|
||||
.align 5
|
||||
${prefix}_set_encrypt_key:
|
||||
.Lenc_key:
|
||||
___
|
||||
$code.=<<___ if ($flavour =~ /64/);
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
___
|
||||
$code.=<<___;
|
||||
mov $ptr,#-1
|
||||
cmp $inp,#0
|
||||
b.eq .Lenc_key_abort
|
||||
cmp $out,#0
|
||||
b.eq .Lenc_key_abort
|
||||
mov $ptr,#-2
|
||||
cmp $bits,#128
|
||||
b.lt .Lenc_key_abort
|
||||
cmp $bits,#256
|
||||
b.gt .Lenc_key_abort
|
||||
tst $bits,#0x3f
|
||||
b.ne .Lenc_key_abort
|
||||
|
||||
adr $ptr,rcon
|
||||
cmp $bits,#192
|
||||
|
||||
veor $zero,$zero,$zero
|
||||
vld1.8 {$in0},[$inp],#16
|
||||
mov $bits,#8 // reuse $bits
|
||||
vld1.32 {$rcon,$mask},[$ptr],#32
|
||||
|
||||
b.lt .Loop128
|
||||
b.eq .L192
|
||||
b .L256
|
||||
|
||||
.align 4
|
||||
.Loop128:
|
||||
vtbl.8 $key,{$in0},$mask
|
||||
vext.8 $tmp,$zero,$in0,#12
|
||||
vst1.32 {$in0},[$out],#16
|
||||
aese $key,$zero
|
||||
subs $bits,$bits,#1
|
||||
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $key,$key,$rcon
|
||||
veor $in0,$in0,$tmp
|
||||
vshl.u8 $rcon,$rcon,#1
|
||||
veor $in0,$in0,$key
|
||||
b.ne .Loop128
|
||||
|
||||
vld1.32 {$rcon},[$ptr]
|
||||
|
||||
vtbl.8 $key,{$in0},$mask
|
||||
vext.8 $tmp,$zero,$in0,#12
|
||||
vst1.32 {$in0},[$out],#16
|
||||
aese $key,$zero
|
||||
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $key,$key,$rcon
|
||||
veor $in0,$in0,$tmp
|
||||
vshl.u8 $rcon,$rcon,#1
|
||||
veor $in0,$in0,$key
|
||||
|
||||
vtbl.8 $key,{$in0},$mask
|
||||
vext.8 $tmp,$zero,$in0,#12
|
||||
vst1.32 {$in0},[$out],#16
|
||||
aese $key,$zero
|
||||
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $key,$key,$rcon
|
||||
veor $in0,$in0,$tmp
|
||||
veor $in0,$in0,$key
|
||||
vst1.32 {$in0},[$out]
|
||||
add $out,$out,#0x50
|
||||
|
||||
mov $rounds,#10
|
||||
b .Ldone
|
||||
|
||||
.align 4
|
||||
.L192:
|
||||
vld1.8 {$in1},[$inp],#8
|
||||
vmov.i8 $key,#8 // borrow $key
|
||||
vst1.32 {$in0},[$out],#16
|
||||
vsub.i8 $mask,$mask,$key // adjust the mask
|
||||
|
||||
.Loop192:
|
||||
vtbl.8 $key,{$in1},$mask
|
||||
vext.8 $tmp,$zero,$in0,#12
|
||||
vst1.32 {$in1},[$out],#8
|
||||
aese $key,$zero
|
||||
subs $bits,$bits,#1
|
||||
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in0,$in0,$tmp
|
||||
|
||||
vdup.32 $tmp,${in0}[3]
|
||||
veor $tmp,$tmp,$in1
|
||||
veor $key,$key,$rcon
|
||||
vext.8 $in1,$zero,$in1,#12
|
||||
vshl.u8 $rcon,$rcon,#1
|
||||
veor $in1,$in1,$tmp
|
||||
veor $in0,$in0,$key
|
||||
veor $in1,$in1,$key
|
||||
vst1.32 {$in0},[$out],#16
|
||||
b.ne .Loop192
|
||||
|
||||
mov $rounds,#12
|
||||
add $out,$out,#0x20
|
||||
b .Ldone
|
||||
|
||||
.align 4
|
||||
.L256:
|
||||
vld1.8 {$in1},[$inp]
|
||||
mov $bits,#7
|
||||
mov $rounds,#14
|
||||
vst1.32 {$in0},[$out],#16
|
||||
|
||||
.Loop256:
|
||||
vtbl.8 $key,{$in1},$mask
|
||||
vext.8 $tmp,$zero,$in0,#12
|
||||
vst1.32 {$in1},[$out],#16
|
||||
aese $key,$zero
|
||||
subs $bits,$bits,#1
|
||||
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in0,$in0,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $key,$key,$rcon
|
||||
veor $in0,$in0,$tmp
|
||||
vshl.u8 $rcon,$rcon,#1
|
||||
veor $in0,$in0,$key
|
||||
vst1.32 {$in0},[$out],#16
|
||||
b.eq .Ldone
|
||||
|
||||
vdup.32 $key,${in0}[3] // just splat
|
||||
vext.8 $tmp,$zero,$in1,#12
|
||||
aese $key,$zero
|
||||
|
||||
veor $in1,$in1,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in1,$in1,$tmp
|
||||
vext.8 $tmp,$zero,$tmp,#12
|
||||
veor $in1,$in1,$tmp
|
||||
|
||||
veor $in1,$in1,$key
|
||||
b .Loop256
|
||||
|
||||
.Ldone:
|
||||
str $rounds,[$out]
|
||||
mov $ptr,#0
|
||||
|
||||
.Lenc_key_abort:
|
||||
mov x0,$ptr // return value
|
||||
`"ldr x29,[sp],#16" if ($flavour =~ /64/)`
|
||||
ret
|
||||
.size ${prefix}_set_encrypt_key,.-${prefix}_set_encrypt_key
|
||||
|
||||
.globl ${prefix}_set_decrypt_key
|
||||
.type ${prefix}_set_decrypt_key,%function
|
||||
.align 5
|
||||
${prefix}_set_decrypt_key:
|
||||
___
|
||||
$code.=<<___ if ($flavour =~ /64/);
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
___
|
||||
$code.=<<___ if ($flavour !~ /64/);
|
||||
stmdb sp!,{r4,lr}
|
||||
___
|
||||
$code.=<<___;
|
||||
bl .Lenc_key
|
||||
|
||||
cmp x0,#0
|
||||
b.ne .Ldec_key_abort
|
||||
|
||||
sub $out,$out,#240 // restore original $out
|
||||
mov x4,#-16
|
||||
add $inp,$out,x12,lsl#4 // end of key schedule
|
||||
|
||||
vld1.32 {v0.16b},[$out]
|
||||
vld1.32 {v1.16b},[$inp]
|
||||
vst1.32 {v0.16b},[$inp],x4
|
||||
vst1.32 {v1.16b},[$out],#16
|
||||
|
||||
.Loop_imc:
|
||||
vld1.32 {v0.16b},[$out]
|
||||
vld1.32 {v1.16b},[$inp]
|
||||
aesimc v0.16b,v0.16b
|
||||
aesimc v1.16b,v1.16b
|
||||
vst1.32 {v0.16b},[$inp],x4
|
||||
vst1.32 {v1.16b},[$out],#16
|
||||
cmp $inp,$out
|
||||
b.hi .Loop_imc
|
||||
|
||||
vld1.32 {v0.16b},[$out]
|
||||
aesimc v0.16b,v0.16b
|
||||
vst1.32 {v0.16b},[$inp]
|
||||
|
||||
eor x0,x0,x0 // return value
|
||||
.Ldec_key_abort:
|
||||
___
|
||||
$code.=<<___ if ($flavour !~ /64/);
|
||||
ldmia sp!,{r4,pc}
|
||||
___
|
||||
$code.=<<___ if ($flavour =~ /64/);
|
||||
ldp x29,x30,[sp],#16
|
||||
ret
|
||||
___
|
||||
$code.=<<___;
|
||||
.size ${prefix}_set_decrypt_key,.-${prefix}_set_decrypt_key
|
||||
___
|
||||
}}}
|
||||
{{{
|
||||
sub gen_block () {
|
||||
my $dir = shift;
|
||||
my ($e,$mc) = $dir eq "en" ? ("e","mc") : ("d","imc");
|
||||
my ($inp,$out,$key)=map("x$_",(0..2));
|
||||
my $rounds="w3";
|
||||
my ($rndkey0,$rndkey1,$inout)=map("q$_",(0..3));
|
||||
|
||||
$code.=<<___;
|
||||
.globl ${prefix}_${dir}crypt
|
||||
.type ${prefix}_${dir}crypt,%function
|
||||
.align 5
|
||||
${prefix}_${dir}crypt:
|
||||
ldr $rounds,[$key,#240]
|
||||
vld1.32 {$rndkey0},[$key],#16
|
||||
vld1.8 {$inout},[$inp]
|
||||
sub $rounds,$rounds,#2
|
||||
vld1.32 {$rndkey1},[$key],#16
|
||||
|
||||
.Loop_${dir}c:
|
||||
aes$e $inout,$rndkey0
|
||||
vld1.32 {$rndkey0},[$key],#16
|
||||
aes$mc $inout,$inout
|
||||
subs $rounds,$rounds,#2
|
||||
aes$e $inout,$rndkey1
|
||||
vld1.32 {$rndkey1},[$key],#16
|
||||
aes$mc $inout,$inout
|
||||
b.gt .Loop_${dir}c
|
||||
|
||||
aes$e $inout,$rndkey0
|
||||
vld1.32 {$rndkey0},[$key]
|
||||
aes$mc $inout,$inout
|
||||
aes$e $inout,$rndkey1
|
||||
veor $inout,$inout,$rndkey0
|
||||
|
||||
vst1.8 {$inout},[$out]
|
||||
ret
|
||||
.size ${prefix}_${dir}crypt,.-${prefix}_${dir}crypt
|
||||
___
|
||||
}
|
||||
&gen_block("en");
|
||||
&gen_block("de");
|
||||
}}}
|
||||
{{{
|
||||
my ($inp,$out,$len,$key,$ivp)=map("x$_",(0..4)); my $enc="w5";
|
||||
my ($rounds,$cnt,$key_,$step,$step1)=($enc,"w6","x7","x8","x12");
|
||||
my ($dat0,$dat1,$in0,$in1,$tmp0,$tmp1,$ivec,$rndlast)=map("q$_",(0..7));
|
||||
|
||||
my ($dat,$tmp,$rndzero_n_last)=($dat0,$tmp0,$tmp1);
|
||||
|
||||
### q8-q15 preloaded key schedule
|
||||
|
||||
$code.=<<___;
|
||||
.globl ${prefix}_cbc_encrypt
|
||||
.type ${prefix}_cbc_encrypt,%function
|
||||
.align 5
|
||||
${prefix}_cbc_encrypt:
|
||||
___
|
||||
$code.=<<___ if ($flavour =~ /64/);
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
___
|
||||
$code.=<<___ if ($flavour !~ /64/);
|
||||
mov ip,sp
|
||||
stmdb sp!,{r4-r8,lr}
|
||||
vstmdb sp!,{d8-d15} @ ABI specification says so
|
||||
ldmia ip,{r4-r5} @ load remaining args
|
||||
___
|
||||
$code.=<<___;
|
||||
subs $len,$len,#16
|
||||
mov $step,#16
|
||||
b.lo .Lcbc_abort
|
||||
cclr $step,eq
|
||||
|
||||
cmp $enc,#0 // en- or decrypting?
|
||||
ldr $rounds,[$key,#240]
|
||||
and $len,$len,#-16
|
||||
vld1.8 {$ivec},[$ivp]
|
||||
vld1.8 {$dat},[$inp],$step
|
||||
|
||||
vld1.32 {q8-q9},[$key] // load key schedule...
|
||||
sub $rounds,$rounds,#6
|
||||
add $key_,$key,x5,lsl#4 // pointer to last 7 round keys
|
||||
sub $rounds,$rounds,#2
|
||||
vld1.32 {q10-q11},[$key_],#32
|
||||
vld1.32 {q12-q13},[$key_],#32
|
||||
vld1.32 {q14-q15},[$key_],#32
|
||||
vld1.32 {$rndlast},[$key_]
|
||||
|
||||
add $key_,$key,#32
|
||||
mov $cnt,$rounds
|
||||
b.eq .Lcbc_dec
|
||||
|
||||
cmp $rounds,#2
|
||||
veor $dat,$dat,$ivec
|
||||
veor $rndzero_n_last,q8,$rndlast
|
||||
b.eq .Lcbc_enc128
|
||||
|
||||
.Loop_cbc_enc:
|
||||
aese $dat,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesmc $dat,$dat
|
||||
subs $cnt,$cnt,#2
|
||||
aese $dat,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesmc $dat,$dat
|
||||
b.gt .Loop_cbc_enc
|
||||
|
||||
aese $dat,q8
|
||||
aesmc $dat,$dat
|
||||
subs $len,$len,#16
|
||||
aese $dat,q9
|
||||
aesmc $dat,$dat
|
||||
cclr $step,eq
|
||||
aese $dat,q10
|
||||
aesmc $dat,$dat
|
||||
add $key_,$key,#16
|
||||
aese $dat,q11
|
||||
aesmc $dat,$dat
|
||||
vld1.8 {q8},[$inp],$step
|
||||
aese $dat,q12
|
||||
aesmc $dat,$dat
|
||||
veor q8,q8,$rndzero_n_last
|
||||
aese $dat,q13
|
||||
aesmc $dat,$dat
|
||||
vld1.32 {q9},[$key_],#16 // re-pre-load rndkey[1]
|
||||
aese $dat,q14
|
||||
aesmc $dat,$dat
|
||||
aese $dat,q15
|
||||
|
||||
mov $cnt,$rounds
|
||||
veor $ivec,$dat,$rndlast
|
||||
vst1.8 {$ivec},[$out],#16
|
||||
b.hs .Loop_cbc_enc
|
||||
|
||||
b .Lcbc_done
|
||||
|
||||
.align 5
|
||||
.Lcbc_enc128:
|
||||
vld1.32 {$in0-$in1},[$key_]
|
||||
aese $dat,q8
|
||||
aesmc $dat,$dat
|
||||
b .Lenter_cbc_enc128
|
||||
.Loop_cbc_enc128:
|
||||
aese $dat,q8
|
||||
aesmc $dat,$dat
|
||||
vst1.8 {$ivec},[$out],#16
|
||||
.Lenter_cbc_enc128:
|
||||
aese $dat,q9
|
||||
aesmc $dat,$dat
|
||||
subs $len,$len,#16
|
||||
aese $dat,$in0
|
||||
aesmc $dat,$dat
|
||||
cclr $step,eq
|
||||
aese $dat,$in1
|
||||
aesmc $dat,$dat
|
||||
aese $dat,q10
|
||||
aesmc $dat,$dat
|
||||
aese $dat,q11
|
||||
aesmc $dat,$dat
|
||||
vld1.8 {q8},[$inp],$step
|
||||
aese $dat,q12
|
||||
aesmc $dat,$dat
|
||||
aese $dat,q13
|
||||
aesmc $dat,$dat
|
||||
aese $dat,q14
|
||||
aesmc $dat,$dat
|
||||
veor q8,q8,$rndzero_n_last
|
||||
aese $dat,q15
|
||||
veor $ivec,$dat,$rndlast
|
||||
b.hs .Loop_cbc_enc128
|
||||
|
||||
vst1.8 {$ivec},[$out],#16
|
||||
b .Lcbc_done
|
||||
___
|
||||
{
|
||||
my ($dat2,$in2,$tmp2)=map("q$_",(10,11,9));
|
||||
$code.=<<___;
|
||||
.align 5
|
||||
.Lcbc_dec:
|
||||
vld1.8 {$dat2},[$inp],#16
|
||||
subs $len,$len,#32 // bias
|
||||
add $cnt,$rounds,#2
|
||||
vorr $in1,$dat,$dat
|
||||
vorr $dat1,$dat,$dat
|
||||
vorr $in2,$dat2,$dat2
|
||||
b.lo .Lcbc_dec_tail
|
||||
|
||||
vorr $dat1,$dat2,$dat2
|
||||
vld1.8 {$dat2},[$inp],#16
|
||||
vorr $in0,$dat,$dat
|
||||
vorr $in1,$dat1,$dat1
|
||||
vorr $in2,$dat2,$dat2
|
||||
|
||||
.Loop3x_cbc_dec:
|
||||
aesd $dat0,q8
|
||||
aesd $dat1,q8
|
||||
aesd $dat2,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
subs $cnt,$cnt,#2
|
||||
aesd $dat0,q9
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
b.gt .Loop3x_cbc_dec
|
||||
|
||||
aesd $dat0,q8
|
||||
aesd $dat1,q8
|
||||
aesd $dat2,q8
|
||||
veor $tmp0,$ivec,$rndlast
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp1,$in0,$rndlast
|
||||
aesd $dat0,q9
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
veor $tmp2,$in1,$rndlast
|
||||
subs $len,$len,#0x30
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
vorr $ivec,$in2,$in2
|
||||
mov.lo x6,$len // x6, $cnt, is zero at this point
|
||||
aesd $dat0,q12
|
||||
aesd $dat1,q12
|
||||
aesd $dat2,q12
|
||||
add $inp,$inp,x6 // $inp is adjusted in such way that
|
||||
// at exit from the loop $dat1-$dat2
|
||||
// are loaded with last "words"
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
mov $key_,$key
|
||||
aesd $dat0,q13
|
||||
aesd $dat1,q13
|
||||
aesd $dat2,q13
|
||||
vld1.8 {$in0},[$inp],#16
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
vld1.8 {$in1},[$inp],#16
|
||||
aesd $dat0,q14
|
||||
aesd $dat1,q14
|
||||
aesd $dat2,q14
|
||||
vld1.8 {$in2},[$inp],#16
|
||||
aesimc $dat0,$dat0
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
vld1.32 {q8},[$key_],#16 // re-pre-load rndkey[0]
|
||||
aesd $dat0,q15
|
||||
aesd $dat1,q15
|
||||
aesd $dat2,q15
|
||||
|
||||
add $cnt,$rounds,#2
|
||||
veor $tmp0,$tmp0,$dat0
|
||||
veor $tmp1,$tmp1,$dat1
|
||||
veor $dat2,$dat2,$tmp2
|
||||
vld1.32 {q9},[$key_],#16 // re-pre-load rndkey[1]
|
||||
vorr $dat0,$in0,$in0
|
||||
vst1.8 {$tmp0},[$out],#16
|
||||
vorr $dat1,$in1,$in1
|
||||
vst1.8 {$tmp1},[$out],#16
|
||||
vst1.8 {$dat2},[$out],#16
|
||||
vorr $dat2,$in2,$in2
|
||||
b.hs .Loop3x_cbc_dec
|
||||
|
||||
cmn $len,#0x30
|
||||
b.eq .Lcbc_done
|
||||
nop
|
||||
|
||||
.Lcbc_dec_tail:
|
||||
aesd $dat1,q8
|
||||
aesd $dat2,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
subs $cnt,$cnt,#2
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
b.gt .Lcbc_dec_tail
|
||||
|
||||
aesd $dat1,q8
|
||||
aesd $dat2,q8
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
aesd $dat1,q9
|
||||
aesd $dat2,q9
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
aesd $dat1,q12
|
||||
aesd $dat2,q12
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
cmn $len,#0x20
|
||||
aesd $dat1,q13
|
||||
aesd $dat2,q13
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp1,$ivec,$rndlast
|
||||
aesd $dat1,q14
|
||||
aesd $dat2,q14
|
||||
aesimc $dat1,$dat1
|
||||
aesimc $dat2,$dat2
|
||||
veor $tmp2,$in1,$rndlast
|
||||
aesd $dat1,q15
|
||||
aesd $dat2,q15
|
||||
b.eq .Lcbc_dec_one
|
||||
veor $tmp1,$tmp1,$dat1
|
||||
veor $tmp2,$tmp2,$dat2
|
||||
vorr $ivec,$in2,$in2
|
||||
vst1.8 {$tmp1},[$out],#16
|
||||
vst1.8 {$tmp2},[$out],#16
|
||||
b .Lcbc_done
|
||||
|
||||
.Lcbc_dec_one:
|
||||
veor $tmp1,$tmp1,$dat2
|
||||
vorr $ivec,$in2,$in2
|
||||
vst1.8 {$tmp1},[$out],#16
|
||||
|
||||
.Lcbc_done:
|
||||
vst1.8 {$ivec},[$ivp]
|
||||
.Lcbc_abort:
|
||||
___
|
||||
}
|
||||
$code.=<<___ if ($flavour !~ /64/);
|
||||
vldmia sp!,{d8-d15}
|
||||
ldmia sp!,{r4-r8,pc}
|
||||
___
|
||||
$code.=<<___ if ($flavour =~ /64/);
|
||||
ldr x29,[sp],#16
|
||||
ret
|
||||
___
|
||||
$code.=<<___;
|
||||
.size ${prefix}_cbc_encrypt,.-${prefix}_cbc_encrypt
|
||||
___
|
||||
}}}
|
||||
{{{
|
||||
my ($inp,$out,$len,$key,$ivp)=map("x$_",(0..4));
|
||||
my ($rounds,$cnt,$key_)=("w5","w6","x7");
|
||||
my ($ctr,$tctr0,$tctr1,$tctr2)=map("w$_",(8..10,12));
|
||||
my $step="x12"; # aliases with $tctr2
|
||||
|
||||
my ($dat0,$dat1,$in0,$in1,$tmp0,$tmp1,$ivec,$rndlast)=map("q$_",(0..7));
|
||||
my ($dat2,$in2,$tmp2)=map("q$_",(10,11,9));
|
||||
|
||||
my ($dat,$tmp)=($dat0,$tmp0);
|
||||
|
||||
### q8-q15 preloaded key schedule
|
||||
|
||||
$code.=<<___;
|
||||
.globl ${prefix}_ctr32_encrypt_blocks
|
||||
.type ${prefix}_ctr32_encrypt_blocks,%function
|
||||
.align 5
|
||||
${prefix}_ctr32_encrypt_blocks:
|
||||
___
|
||||
$code.=<<___ if ($flavour =~ /64/);
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
___
|
||||
$code.=<<___ if ($flavour !~ /64/);
|
||||
mov ip,sp
|
||||
stmdb sp!,{r4-r10,lr}
|
||||
vstmdb sp!,{d8-d15} @ ABI specification says so
|
||||
ldr r4, [ip] @ load remaining arg
|
||||
___
|
||||
$code.=<<___;
|
||||
ldr $rounds,[$key,#240]
|
||||
|
||||
ldr $ctr, [$ivp, #12]
|
||||
vld1.32 {$dat0},[$ivp]
|
||||
|
||||
vld1.32 {q8-q9},[$key] // load key schedule...
|
||||
sub $rounds,$rounds,#4
|
||||
mov $step,#16
|
||||
cmp $len,#2
|
||||
add $key_,$key,x5,lsl#4 // pointer to last 5 round keys
|
||||
sub $rounds,$rounds,#2
|
||||
vld1.32 {q12-q13},[$key_],#32
|
||||
vld1.32 {q14-q15},[$key_],#32
|
||||
vld1.32 {$rndlast},[$key_]
|
||||
add $key_,$key,#32
|
||||
mov $cnt,$rounds
|
||||
cclr $step,lo
|
||||
#ifndef __ARMEB__
|
||||
rev $ctr, $ctr
|
||||
#endif
|
||||
vorr $dat1,$dat0,$dat0
|
||||
add $tctr1, $ctr, #1
|
||||
vorr $dat2,$dat0,$dat0
|
||||
add $ctr, $ctr, #2
|
||||
vorr $ivec,$dat0,$dat0
|
||||
rev $tctr1, $tctr1
|
||||
vmov.32 ${dat1}[3],$tctr1
|
||||
b.ls .Lctr32_tail
|
||||
rev $tctr2, $ctr
|
||||
sub $len,$len,#3 // bias
|
||||
vmov.32 ${dat2}[3],$tctr2
|
||||
b .Loop3x_ctr32
|
||||
|
||||
.align 4
|
||||
.Loop3x_ctr32:
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
aese $dat2,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
aesmc $dat2,$dat2
|
||||
subs $cnt,$cnt,#2
|
||||
aese $dat0,q9
|
||||
aese $dat1,q9
|
||||
aese $dat2,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
aesmc $dat2,$dat2
|
||||
b.gt .Loop3x_ctr32
|
||||
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
aese $dat2,q8
|
||||
mov $key_,$key
|
||||
aesmc $tmp0,$dat0
|
||||
vld1.8 {$in0},[$inp],#16
|
||||
aesmc $tmp1,$dat1
|
||||
aesmc $dat2,$dat2
|
||||
vorr $dat0,$ivec,$ivec
|
||||
aese $tmp0,q9
|
||||
vld1.8 {$in1},[$inp],#16
|
||||
aese $tmp1,q9
|
||||
aese $dat2,q9
|
||||
vorr $dat1,$ivec,$ivec
|
||||
aesmc $tmp0,$tmp0
|
||||
vld1.8 {$in2},[$inp],#16
|
||||
aesmc $tmp1,$tmp1
|
||||
aesmc $tmp2,$dat2
|
||||
vorr $dat2,$ivec,$ivec
|
||||
add $tctr0,$ctr,#1
|
||||
aese $tmp0,q12
|
||||
aese $tmp1,q12
|
||||
aese $tmp2,q12
|
||||
veor $in0,$in0,$rndlast
|
||||
add $tctr1,$ctr,#2
|
||||
aesmc $tmp0,$tmp0
|
||||
aesmc $tmp1,$tmp1
|
||||
aesmc $tmp2,$tmp2
|
||||
veor $in1,$in1,$rndlast
|
||||
add $ctr,$ctr,#3
|
||||
aese $tmp0,q13
|
||||
aese $tmp1,q13
|
||||
aese $tmp2,q13
|
||||
veor $in2,$in2,$rndlast
|
||||
rev $tctr0,$tctr0
|
||||
aesmc $tmp0,$tmp0
|
||||
vld1.32 {q8},[$key_],#16 // re-pre-load rndkey[0]
|
||||
aesmc $tmp1,$tmp1
|
||||
aesmc $tmp2,$tmp2
|
||||
vmov.32 ${dat0}[3], $tctr0
|
||||
rev $tctr1,$tctr1
|
||||
aese $tmp0,q14
|
||||
aese $tmp1,q14
|
||||
aese $tmp2,q14
|
||||
vmov.32 ${dat1}[3], $tctr1
|
||||
rev $tctr2,$ctr
|
||||
aesmc $tmp0,$tmp0
|
||||
aesmc $tmp1,$tmp1
|
||||
aesmc $tmp2,$tmp2
|
||||
vmov.32 ${dat2}[3], $tctr2
|
||||
subs $len,$len,#3
|
||||
aese $tmp0,q15
|
||||
aese $tmp1,q15
|
||||
aese $tmp2,q15
|
||||
|
||||
mov $cnt,$rounds
|
||||
veor $in0,$in0,$tmp0
|
||||
veor $in1,$in1,$tmp1
|
||||
veor $in2,$in2,$tmp2
|
||||
vld1.32 {q9},[$key_],#16 // re-pre-load rndkey[1]
|
||||
vst1.8 {$in0},[$out],#16
|
||||
vst1.8 {$in1},[$out],#16
|
||||
vst1.8 {$in2},[$out],#16
|
||||
b.hs .Loop3x_ctr32
|
||||
|
||||
adds $len,$len,#3
|
||||
b.eq .Lctr32_done
|
||||
cmp $len,#1
|
||||
mov $step,#16
|
||||
cclr $step,eq
|
||||
|
||||
.Lctr32_tail:
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
vld1.32 {q8},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
subs $cnt,$cnt,#2
|
||||
aese $dat0,q9
|
||||
aese $dat1,q9
|
||||
vld1.32 {q9},[$key_],#16
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
b.gt .Lctr32_tail
|
||||
|
||||
aese $dat0,q8
|
||||
aese $dat1,q8
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat0,q9
|
||||
aese $dat1,q9
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
vld1.8 {$in0},[$inp],$step
|
||||
aese $dat0,q12
|
||||
aese $dat1,q12
|
||||
vld1.8 {$in1},[$inp]
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat0,q13
|
||||
aese $dat1,q13
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
aese $dat0,q14
|
||||
aese $dat1,q14
|
||||
veor $in0,$in0,$rndlast
|
||||
aesmc $dat0,$dat0
|
||||
aesmc $dat1,$dat1
|
||||
veor $in1,$in1,$rndlast
|
||||
aese $dat0,q15
|
||||
aese $dat1,q15
|
||||
|
||||
cmp $len,#1
|
||||
veor $in0,$in0,$dat0
|
||||
veor $in1,$in1,$dat1
|
||||
vst1.8 {$in0},[$out],#16
|
||||
b.eq .Lctr32_done
|
||||
vst1.8 {$in1},[$out]
|
||||
|
||||
.Lctr32_done:
|
||||
___
|
||||
$code.=<<___ if ($flavour !~ /64/);
|
||||
vldmia sp!,{d8-d15}
|
||||
ldmia sp!,{r4-r10,pc}
|
||||
___
|
||||
$code.=<<___ if ($flavour =~ /64/);
|
||||
ldr x29,[sp],#16
|
||||
ret
|
||||
___
|
||||
$code.=<<___;
|
||||
.size ${prefix}_ctr32_encrypt_blocks,.-${prefix}_ctr32_encrypt_blocks
|
||||
___
|
||||
}}}
|
||||
$code.=<<___;
|
||||
#endif
|
||||
___
|
||||
########################################
|
||||
if ($flavour =~ /64/) { ######## 64-bit code
|
||||
my %opcode = (
|
||||
"aesd" => 0x4e285800, "aese" => 0x4e284800,
|
||||
"aesimc"=> 0x4e287800, "aesmc" => 0x4e286800 );
|
||||
|
||||
local *unaes = sub {
|
||||
my ($mnemonic,$arg)=@_;
|
||||
|
||||
$arg =~ m/[qv]([0-9]+)[^,]*,\s*[qv]([0-9]+)/o &&
|
||||
sprintf ".inst\t0x%08x\t//%s %s",
|
||||
$opcode{$mnemonic}|$1|($2<<5),
|
||||
$mnemonic,$arg;
|
||||
};
|
||||
|
||||
foreach(split("\n",$code)) {
|
||||
s/\`([^\`]*)\`/eval($1)/geo;
|
||||
|
||||
s/\bq([0-9]+)\b/"v".($1<8?$1:$1+8).".16b"/geo; # old->new registers
|
||||
s/@\s/\/\//o; # old->new style commentary
|
||||
|
||||
#s/[v]?(aes\w+)\s+([qv].*)/unaes($1,$2)/geo or
|
||||
s/cclr\s+([wx])([^,]+),\s*([a-z]+)/csel $1$2,$1zr,$1$2,$3/o or
|
||||
s/mov\.([a-z]+)\s+([wx][0-9]+),\s*([wx][0-9]+)/csel $2,$3,$2,$1/o or
|
||||
s/vmov\.i8/movi/o or # fix up legacy mnemonics
|
||||
s/vext\.8/ext/o or
|
||||
s/vrev32\.8/rev32/o or
|
||||
s/vtst\.8/cmtst/o or
|
||||
s/vshr/ushr/o or
|
||||
s/^(\s+)v/$1/o or # strip off v prefix
|
||||
s/\bbx\s+lr\b/ret/o;
|
||||
|
||||
# fix up remainig legacy suffixes
|
||||
s/\.[ui]?8//o;
|
||||
m/\],#8/o and s/\.16b/\.8b/go;
|
||||
s/\.[ui]?32//o and s/\.16b/\.4s/go;
|
||||
s/\.[ui]?64//o and s/\.16b/\.2d/go;
|
||||
s/\.[42]([sd])\[([0-3])\]/\.$1\[$2\]/o;
|
||||
|
||||
print $_,"\n";
|
||||
}
|
||||
} else { ######## 32-bit code
|
||||
my %opcode = (
|
||||
"aesd" => 0xf3b00340, "aese" => 0xf3b00300,
|
||||
"aesimc"=> 0xf3b003c0, "aesmc" => 0xf3b00380 );
|
||||
|
||||
local *unaes = sub {
|
||||
my ($mnemonic,$arg)=@_;
|
||||
|
||||
if ($arg =~ m/[qv]([0-9]+)[^,]*,\s*[qv]([0-9]+)/o) {
|
||||
my $word = $opcode{$mnemonic}|(($1&7)<<13)|(($1&8)<<19)
|
||||
|(($2&7)<<1) |(($2&8)<<2);
|
||||
# since ARMv7 instructions are always encoded little-endian.
|
||||
# correct solution is to use .inst directive, but older
|
||||
# assemblers don't implement it:-(
|
||||
sprintf ".byte\t0x%02x,0x%02x,0x%02x,0x%02x\t@ %s %s",
|
||||
$word&0xff,($word>>8)&0xff,
|
||||
($word>>16)&0xff,($word>>24)&0xff,
|
||||
$mnemonic,$arg;
|
||||
}
|
||||
};
|
||||
|
||||
sub unvtbl {
|
||||
my $arg=shift;
|
||||
|
||||
$arg =~ m/q([0-9]+),\s*\{q([0-9]+)\},\s*q([0-9]+)/o &&
|
||||
sprintf "vtbl.8 d%d,{q%d},d%d\n\t".
|
||||
"vtbl.8 d%d,{q%d},d%d", 2*$1,$2,2*$3, 2*$1+1,$2,2*$3+1;
|
||||
}
|
||||
|
||||
sub unvdup32 {
|
||||
my $arg=shift;
|
||||
|
||||
$arg =~ m/q([0-9]+),\s*q([0-9]+)\[([0-3])\]/o &&
|
||||
sprintf "vdup.32 q%d,d%d[%d]",$1,2*$2+($3>>1),$3&1;
|
||||
}
|
||||
|
||||
sub unvmov32 {
|
||||
my $arg=shift;
|
||||
|
||||
$arg =~ m/q([0-9]+)\[([0-3])\],(.*)/o &&
|
||||
sprintf "vmov.32 d%d[%d],%s",2*$1+($2>>1),$2&1,$3;
|
||||
}
|
||||
|
||||
foreach(split("\n",$code)) {
|
||||
s/\`([^\`]*)\`/eval($1)/geo;
|
||||
|
||||
s/\b[wx]([0-9]+)\b/r$1/go; # new->old registers
|
||||
s/\bv([0-9])\.[12468]+[bsd]\b/q$1/go; # new->old registers
|
||||
s/\/\/\s?/@ /o; # new->old style commentary
|
||||
|
||||
# fix up remainig new-style suffixes
|
||||
s/\{q([0-9]+)\},\s*\[(.+)\],#8/sprintf "{d%d},[$2]!",2*$1/eo or
|
||||
s/\],#[0-9]+/]!/o;
|
||||
|
||||
s/[v]?(aes\w+)\s+([qv].*)/unaes($1,$2)/geo or
|
||||
s/cclr\s+([^,]+),\s*([a-z]+)/mov$2 $1,#0/o or
|
||||
s/vtbl\.8\s+(.*)/unvtbl($1)/geo or
|
||||
s/vdup\.32\s+(.*)/unvdup32($1)/geo or
|
||||
s/vmov\.32\s+(.*)/unvmov32($1)/geo or
|
||||
s/^(\s+)b\./$1b/o or
|
||||
s/^(\s+)mov\./$1mov/o or
|
||||
s/^(\s+)ret/$1bx\tlr/o;
|
||||
|
||||
print $_,"\n";
|
||||
}
|
||||
}
|
||||
|
||||
close STDOUT;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,903 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
######################################################################
|
||||
## Constant-time SSSE3 AES core implementation.
|
||||
## version 0.1
|
||||
##
|
||||
## By Mike Hamburg (Stanford University), 2009
|
||||
## Public domain.
|
||||
##
|
||||
## For details see http://shiftleft.org/papers/vector_aes/ and
|
||||
## http://crypto.stanford.edu/vpaes/.
|
||||
|
||||
######################################################################
|
||||
# September 2011.
|
||||
#
|
||||
# Port vpaes-x86_64.pl as 32-bit "almost" drop-in replacement for
|
||||
# aes-586.pl. "Almost" refers to the fact that AES_cbc_encrypt
|
||||
# doesn't handle partial vectors (doesn't have to if called from
|
||||
# EVP only). "Drop-in" implies that this module doesn't share key
|
||||
# schedule structure with the original nor does it make assumption
|
||||
# about its alignment...
|
||||
#
|
||||
# Performance summary. aes-586.pl column lists large-block CBC
|
||||
# encrypt/decrypt/with-hyper-threading-off(*) results in cycles per
|
||||
# byte processed with 128-bit key, and vpaes-x86.pl column - [also
|
||||
# large-block CBC] encrypt/decrypt.
|
||||
#
|
||||
# aes-586.pl vpaes-x86.pl
|
||||
#
|
||||
# Core 2(**) 28.1/41.4/18.3 21.9/25.2(***)
|
||||
# Nehalem 27.9/40.4/18.1 10.2/11.9
|
||||
# Atom 70.7/92.1/60.1 61.1/75.4(***)
|
||||
# Silvermont 45.4/62.9/24.1 49.2/61.1(***)
|
||||
#
|
||||
# (*) "Hyper-threading" in the context refers rather to cache shared
|
||||
# among multiple cores, than to specifically Intel HTT. As vast
|
||||
# majority of contemporary cores share cache, slower code path
|
||||
# is common place. In other words "with-hyper-threading-off"
|
||||
# results are presented mostly for reference purposes.
|
||||
#
|
||||
# (**) "Core 2" refers to initial 65nm design, a.k.a. Conroe.
|
||||
#
|
||||
# (***) Less impressive improvement on Core 2 and Atom is due to slow
|
||||
# pshufb, yet it's respectable +28%/64% improvement on Core 2
|
||||
# and +15% on Atom (as implied, over "hyper-threading-safe"
|
||||
# code path).
|
||||
#
|
||||
# <appro@openssl.org>
|
||||
|
||||
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
|
||||
push(@INC,"${dir}","${dir}../../perlasm");
|
||||
require "x86asm.pl";
|
||||
|
||||
&asm_init($ARGV[0],"vpaes-x86.pl",$x86only = $ARGV[$#ARGV] eq "386");
|
||||
|
||||
$PREFIX="vpaes";
|
||||
|
||||
my ($round, $base, $magic, $key, $const, $inp, $out)=
|
||||
("eax", "ebx", "ecx", "edx","ebp", "esi","edi");
|
||||
|
||||
&static_label("_vpaes_consts");
|
||||
&static_label("_vpaes_schedule_low_round");
|
||||
|
||||
&set_label("_vpaes_consts",64);
|
||||
$k_inv=-0x30; # inv, inva
|
||||
&data_word(0x0D080180,0x0E05060F,0x0A0B0C02,0x04070309);
|
||||
&data_word(0x0F0B0780,0x01040A06,0x02050809,0x030D0E0C);
|
||||
|
||||
$k_s0F=-0x10; # s0F
|
||||
&data_word(0x0F0F0F0F,0x0F0F0F0F,0x0F0F0F0F,0x0F0F0F0F);
|
||||
|
||||
$k_ipt=0x00; # input transform (lo, hi)
|
||||
&data_word(0x5A2A7000,0xC2B2E898,0x52227808,0xCABAE090);
|
||||
&data_word(0x317C4D00,0x4C01307D,0xB0FDCC81,0xCD80B1FC);
|
||||
|
||||
$k_sb1=0x20; # sb1u, sb1t
|
||||
&data_word(0xCB503E00,0xB19BE18F,0x142AF544,0xA5DF7A6E);
|
||||
&data_word(0xFAE22300,0x3618D415,0x0D2ED9EF,0x3BF7CCC1);
|
||||
$k_sb2=0x40; # sb2u, sb2t
|
||||
&data_word(0x0B712400,0xE27A93C6,0xBC982FCD,0x5EB7E955);
|
||||
&data_word(0x0AE12900,0x69EB8840,0xAB82234A,0xC2A163C8);
|
||||
$k_sbo=0x60; # sbou, sbot
|
||||
&data_word(0x6FBDC700,0xD0D26D17,0xC502A878,0x15AABF7A);
|
||||
&data_word(0x5FBB6A00,0xCFE474A5,0x412B35FA,0x8E1E90D1);
|
||||
|
||||
$k_mc_forward=0x80; # mc_forward
|
||||
&data_word(0x00030201,0x04070605,0x080B0A09,0x0C0F0E0D);
|
||||
&data_word(0x04070605,0x080B0A09,0x0C0F0E0D,0x00030201);
|
||||
&data_word(0x080B0A09,0x0C0F0E0D,0x00030201,0x04070605);
|
||||
&data_word(0x0C0F0E0D,0x00030201,0x04070605,0x080B0A09);
|
||||
|
||||
$k_mc_backward=0xc0; # mc_backward
|
||||
&data_word(0x02010003,0x06050407,0x0A09080B,0x0E0D0C0F);
|
||||
&data_word(0x0E0D0C0F,0x02010003,0x06050407,0x0A09080B);
|
||||
&data_word(0x0A09080B,0x0E0D0C0F,0x02010003,0x06050407);
|
||||
&data_word(0x06050407,0x0A09080B,0x0E0D0C0F,0x02010003);
|
||||
|
||||
$k_sr=0x100; # sr
|
||||
&data_word(0x03020100,0x07060504,0x0B0A0908,0x0F0E0D0C);
|
||||
&data_word(0x0F0A0500,0x030E0904,0x07020D08,0x0B06010C);
|
||||
&data_word(0x0B020900,0x0F060D04,0x030A0108,0x070E050C);
|
||||
&data_word(0x070A0D00,0x0B0E0104,0x0F020508,0x0306090C);
|
||||
|
||||
$k_rcon=0x140; # rcon
|
||||
&data_word(0xAF9DEEB6,0x1F8391B9,0x4D7C7D81,0x702A9808);
|
||||
|
||||
$k_s63=0x150; # s63: all equal to 0x63 transformed
|
||||
&data_word(0x5B5B5B5B,0x5B5B5B5B,0x5B5B5B5B,0x5B5B5B5B);
|
||||
|
||||
$k_opt=0x160; # output transform
|
||||
&data_word(0xD6B66000,0xFF9F4929,0xDEBE6808,0xF7974121);
|
||||
&data_word(0x50BCEC00,0x01EDBD51,0xB05C0CE0,0xE10D5DB1);
|
||||
|
||||
$k_deskew=0x180; # deskew tables: inverts the sbox's "skew"
|
||||
&data_word(0x47A4E300,0x07E4A340,0x5DBEF91A,0x1DFEB95A);
|
||||
&data_word(0x83EA6900,0x5F36B5DC,0xF49D1E77,0x2841C2AB);
|
||||
##
|
||||
## Decryption stuff
|
||||
## Key schedule constants
|
||||
##
|
||||
$k_dksd=0x1a0; # decryption key schedule: invskew x*D
|
||||
&data_word(0xA3E44700,0xFEB91A5D,0x5A1DBEF9,0x0740E3A4);
|
||||
&data_word(0xB5368300,0x41C277F4,0xAB289D1E,0x5FDC69EA);
|
||||
$k_dksb=0x1c0; # decryption key schedule: invskew x*B
|
||||
&data_word(0x8550D500,0x9A4FCA1F,0x1CC94C99,0x03D65386);
|
||||
&data_word(0xB6FC4A00,0x115BEDA7,0x7E3482C8,0xD993256F);
|
||||
$k_dkse=0x1e0; # decryption key schedule: invskew x*E + 0x63
|
||||
&data_word(0x1FC9D600,0xD5031CCA,0x994F5086,0x53859A4C);
|
||||
&data_word(0x4FDC7BE8,0xA2319605,0x20B31487,0xCD5EF96A);
|
||||
$k_dks9=0x200; # decryption key schedule: invskew x*9
|
||||
&data_word(0x7ED9A700,0xB6116FC8,0x82255BFC,0x4AED9334);
|
||||
&data_word(0x27143300,0x45765162,0xE9DAFDCE,0x8BB89FAC);
|
||||
|
||||
##
|
||||
## Decryption stuff
|
||||
## Round function constants
|
||||
##
|
||||
$k_dipt=0x220; # decryption input transform
|
||||
&data_word(0x0B545F00,0x0F505B04,0x114E451A,0x154A411E);
|
||||
&data_word(0x60056500,0x86E383E6,0xF491F194,0x12771772);
|
||||
|
||||
$k_dsb9=0x240; # decryption sbox output *9*u, *9*t
|
||||
&data_word(0x9A86D600,0x851C0353,0x4F994CC9,0xCAD51F50);
|
||||
&data_word(0xECD74900,0xC03B1789,0xB2FBA565,0x725E2C9E);
|
||||
$k_dsbd=0x260; # decryption sbox output *D*u, *D*t
|
||||
&data_word(0xE6B1A200,0x7D57CCDF,0x882A4439,0xF56E9B13);
|
||||
&data_word(0x24C6CB00,0x3CE2FAF7,0x15DEEFD3,0x2931180D);
|
||||
$k_dsbb=0x280; # decryption sbox output *B*u, *B*t
|
||||
&data_word(0x96B44200,0xD0226492,0xB0F2D404,0x602646F6);
|
||||
&data_word(0xCD596700,0xC19498A6,0x3255AA6B,0xF3FF0C3E);
|
||||
$k_dsbe=0x2a0; # decryption sbox output *E*u, *E*t
|
||||
&data_word(0x26D4D000,0x46F29296,0x64B4F6B0,0x22426004);
|
||||
&data_word(0xFFAAC100,0x0C55A6CD,0x98593E32,0x9467F36B);
|
||||
$k_dsbo=0x2c0; # decryption sbox final output
|
||||
&data_word(0x7EF94000,0x1387EA53,0xD4943E2D,0xC7AA6DB9);
|
||||
&data_word(0x93441D00,0x12D7560F,0xD8C58E9C,0xCA4B8159);
|
||||
&asciz ("Vector Permutation AES for x86/SSSE3, Mike Hamburg (Stanford University)");
|
||||
&align (64);
|
||||
|
||||
&function_begin_B("_vpaes_preheat");
|
||||
&add ($const,&DWP(0,"esp"));
|
||||
&movdqa ("xmm7",&QWP($k_inv,$const));
|
||||
&movdqa ("xmm6",&QWP($k_s0F,$const));
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_preheat");
|
||||
|
||||
##
|
||||
## _aes_encrypt_core
|
||||
##
|
||||
## AES-encrypt %xmm0.
|
||||
##
|
||||
## Inputs:
|
||||
## %xmm0 = input
|
||||
## %xmm6-%xmm7 as in _vpaes_preheat
|
||||
## (%edx) = scheduled keys
|
||||
##
|
||||
## Output in %xmm0
|
||||
## Clobbers %xmm1-%xmm5, %eax, %ebx, %ecx, %edx
|
||||
##
|
||||
##
|
||||
&function_begin_B("_vpaes_encrypt_core");
|
||||
&mov ($magic,16);
|
||||
&mov ($round,&DWP(240,$key));
|
||||
&movdqa ("xmm1","xmm6")
|
||||
&movdqa ("xmm2",&QWP($k_ipt,$const));
|
||||
&pandn ("xmm1","xmm0");
|
||||
&pand ("xmm0","xmm6");
|
||||
&movdqu ("xmm5",&QWP(0,$key));
|
||||
&pshufb ("xmm2","xmm0");
|
||||
&movdqa ("xmm0",&QWP($k_ipt+16,$const));
|
||||
&pxor ("xmm2","xmm5");
|
||||
&psrld ("xmm1",4);
|
||||
&add ($key,16);
|
||||
&pshufb ("xmm0","xmm1");
|
||||
&lea ($base,&DWP($k_mc_backward,$const));
|
||||
&pxor ("xmm0","xmm2");
|
||||
&jmp (&label("enc_entry"));
|
||||
|
||||
|
||||
&set_label("enc_loop",16);
|
||||
# middle of middle round
|
||||
&movdqa ("xmm4",&QWP($k_sb1,$const)); # 4 : sb1u
|
||||
&movdqa ("xmm0",&QWP($k_sb1+16,$const));# 0 : sb1t
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sb1u
|
||||
&pshufb ("xmm0","xmm3"); # 0 = sb1t
|
||||
&pxor ("xmm4","xmm5"); # 4 = sb1u + k
|
||||
&movdqa ("xmm5",&QWP($k_sb2,$const)); # 4 : sb2u
|
||||
&pxor ("xmm0","xmm4"); # 0 = A
|
||||
&movdqa ("xmm1",&QWP(-0x40,$base,$magic));# .Lk_mc_forward[]
|
||||
&pshufb ("xmm5","xmm2"); # 4 = sb2u
|
||||
&movdqa ("xmm2",&QWP($k_sb2+16,$const));# 2 : sb2t
|
||||
&movdqa ("xmm4",&QWP(0,$base,$magic)); # .Lk_mc_backward[]
|
||||
&pshufb ("xmm2","xmm3"); # 2 = sb2t
|
||||
&movdqa ("xmm3","xmm0"); # 3 = A
|
||||
&pxor ("xmm2","xmm5"); # 2 = 2A
|
||||
&pshufb ("xmm0","xmm1"); # 0 = B
|
||||
&add ($key,16); # next key
|
||||
&pxor ("xmm0","xmm2"); # 0 = 2A+B
|
||||
&pshufb ("xmm3","xmm4"); # 3 = D
|
||||
&add ($magic,16); # next mc
|
||||
&pxor ("xmm3","xmm0"); # 3 = 2A+B+D
|
||||
&pshufb ("xmm0","xmm1"); # 0 = 2B+C
|
||||
&and ($magic,0x30); # ... mod 4
|
||||
&sub ($round,1); # nr--
|
||||
&pxor ("xmm0","xmm3"); # 0 = 2A+3B+C+D
|
||||
|
||||
&set_label("enc_entry");
|
||||
# top of round
|
||||
&movdqa ("xmm1","xmm6"); # 1 : i
|
||||
&movdqa ("xmm5",&QWP($k_inv+16,$const));# 2 : a/k
|
||||
&pandn ("xmm1","xmm0"); # 1 = i<<4
|
||||
&psrld ("xmm1",4); # 1 = i
|
||||
&pand ("xmm0","xmm6"); # 0 = k
|
||||
&pshufb ("xmm5","xmm0"); # 2 = a/k
|
||||
&movdqa ("xmm3","xmm7"); # 3 : 1/i
|
||||
&pxor ("xmm0","xmm1"); # 0 = j
|
||||
&pshufb ("xmm3","xmm1"); # 3 = 1/i
|
||||
&movdqa ("xmm4","xmm7"); # 4 : 1/j
|
||||
&pxor ("xmm3","xmm5"); # 3 = iak = 1/i + a/k
|
||||
&pshufb ("xmm4","xmm0"); # 4 = 1/j
|
||||
&movdqa ("xmm2","xmm7"); # 2 : 1/iak
|
||||
&pxor ("xmm4","xmm5"); # 4 = jak = 1/j + a/k
|
||||
&pshufb ("xmm2","xmm3"); # 2 = 1/iak
|
||||
&movdqa ("xmm3","xmm7"); # 3 : 1/jak
|
||||
&pxor ("xmm2","xmm0"); # 2 = io
|
||||
&pshufb ("xmm3","xmm4"); # 3 = 1/jak
|
||||
&movdqu ("xmm5",&QWP(0,$key));
|
||||
&pxor ("xmm3","xmm1"); # 3 = jo
|
||||
&jnz (&label("enc_loop"));
|
||||
|
||||
# middle of last round
|
||||
&movdqa ("xmm4",&QWP($k_sbo,$const)); # 3 : sbou .Lk_sbo
|
||||
&movdqa ("xmm0",&QWP($k_sbo+16,$const));# 3 : sbot .Lk_sbo+16
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sbou
|
||||
&pxor ("xmm4","xmm5"); # 4 = sb1u + k
|
||||
&pshufb ("xmm0","xmm3"); # 0 = sb1t
|
||||
&movdqa ("xmm1",&QWP(0x40,$base,$magic));# .Lk_sr[]
|
||||
&pxor ("xmm0","xmm4"); # 0 = A
|
||||
&pshufb ("xmm0","xmm1");
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_encrypt_core");
|
||||
|
||||
##
|
||||
## Decryption core
|
||||
##
|
||||
## Same API as encryption core.
|
||||
##
|
||||
&function_begin_B("_vpaes_decrypt_core");
|
||||
&lea ($base,&DWP($k_dsbd,$const));
|
||||
&mov ($round,&DWP(240,$key));
|
||||
&movdqa ("xmm1","xmm6");
|
||||
&movdqa ("xmm2",&QWP($k_dipt-$k_dsbd,$base));
|
||||
&pandn ("xmm1","xmm0");
|
||||
&mov ($magic,$round);
|
||||
&psrld ("xmm1",4)
|
||||
&movdqu ("xmm5",&QWP(0,$key));
|
||||
&shl ($magic,4);
|
||||
&pand ("xmm0","xmm6");
|
||||
&pshufb ("xmm2","xmm0");
|
||||
&movdqa ("xmm0",&QWP($k_dipt-$k_dsbd+16,$base));
|
||||
&xor ($magic,0x30);
|
||||
&pshufb ("xmm0","xmm1");
|
||||
&and ($magic,0x30);
|
||||
&pxor ("xmm2","xmm5");
|
||||
&movdqa ("xmm5",&QWP($k_mc_forward+48,$const));
|
||||
&pxor ("xmm0","xmm2");
|
||||
&add ($key,16);
|
||||
&lea ($magic,&DWP($k_sr-$k_dsbd,$base,$magic));
|
||||
&jmp (&label("dec_entry"));
|
||||
|
||||
&set_label("dec_loop",16);
|
||||
##
|
||||
## Inverse mix columns
|
||||
##
|
||||
&movdqa ("xmm4",&QWP(-0x20,$base)); # 4 : sb9u
|
||||
&movdqa ("xmm1",&QWP(-0x10,$base)); # 0 : sb9t
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sb9u
|
||||
&pshufb ("xmm1","xmm3"); # 0 = sb9t
|
||||
&pxor ("xmm0","xmm4");
|
||||
&movdqa ("xmm4",&QWP(0,$base)); # 4 : sbdu
|
||||
&pxor ("xmm0","xmm1"); # 0 = ch
|
||||
&movdqa ("xmm1",&QWP(0x10,$base)); # 0 : sbdt
|
||||
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sbdu
|
||||
&pshufb ("xmm0","xmm5"); # MC ch
|
||||
&pshufb ("xmm1","xmm3"); # 0 = sbdt
|
||||
&pxor ("xmm0","xmm4"); # 4 = ch
|
||||
&movdqa ("xmm4",&QWP(0x20,$base)); # 4 : sbbu
|
||||
&pxor ("xmm0","xmm1"); # 0 = ch
|
||||
&movdqa ("xmm1",&QWP(0x30,$base)); # 0 : sbbt
|
||||
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sbbu
|
||||
&pshufb ("xmm0","xmm5"); # MC ch
|
||||
&pshufb ("xmm1","xmm3"); # 0 = sbbt
|
||||
&pxor ("xmm0","xmm4"); # 4 = ch
|
||||
&movdqa ("xmm4",&QWP(0x40,$base)); # 4 : sbeu
|
||||
&pxor ("xmm0","xmm1"); # 0 = ch
|
||||
&movdqa ("xmm1",&QWP(0x50,$base)); # 0 : sbet
|
||||
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sbeu
|
||||
&pshufb ("xmm0","xmm5"); # MC ch
|
||||
&pshufb ("xmm1","xmm3"); # 0 = sbet
|
||||
&pxor ("xmm0","xmm4"); # 4 = ch
|
||||
&add ($key,16); # next round key
|
||||
&palignr("xmm5","xmm5",12);
|
||||
&pxor ("xmm0","xmm1"); # 0 = ch
|
||||
&sub ($round,1); # nr--
|
||||
|
||||
&set_label("dec_entry");
|
||||
# top of round
|
||||
&movdqa ("xmm1","xmm6"); # 1 : i
|
||||
&movdqa ("xmm2",&QWP($k_inv+16,$const));# 2 : a/k
|
||||
&pandn ("xmm1","xmm0"); # 1 = i<<4
|
||||
&pand ("xmm0","xmm6"); # 0 = k
|
||||
&psrld ("xmm1",4); # 1 = i
|
||||
&pshufb ("xmm2","xmm0"); # 2 = a/k
|
||||
&movdqa ("xmm3","xmm7"); # 3 : 1/i
|
||||
&pxor ("xmm0","xmm1"); # 0 = j
|
||||
&pshufb ("xmm3","xmm1"); # 3 = 1/i
|
||||
&movdqa ("xmm4","xmm7"); # 4 : 1/j
|
||||
&pxor ("xmm3","xmm2"); # 3 = iak = 1/i + a/k
|
||||
&pshufb ("xmm4","xmm0"); # 4 = 1/j
|
||||
&pxor ("xmm4","xmm2"); # 4 = jak = 1/j + a/k
|
||||
&movdqa ("xmm2","xmm7"); # 2 : 1/iak
|
||||
&pshufb ("xmm2","xmm3"); # 2 = 1/iak
|
||||
&movdqa ("xmm3","xmm7"); # 3 : 1/jak
|
||||
&pxor ("xmm2","xmm0"); # 2 = io
|
||||
&pshufb ("xmm3","xmm4"); # 3 = 1/jak
|
||||
&movdqu ("xmm0",&QWP(0,$key));
|
||||
&pxor ("xmm3","xmm1"); # 3 = jo
|
||||
&jnz (&label("dec_loop"));
|
||||
|
||||
# middle of last round
|
||||
&movdqa ("xmm4",&QWP(0x60,$base)); # 3 : sbou
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sbou
|
||||
&pxor ("xmm4","xmm0"); # 4 = sb1u + k
|
||||
&movdqa ("xmm0",&QWP(0x70,$base)); # 0 : sbot
|
||||
&movdqa ("xmm2",&QWP(0,$magic));
|
||||
&pshufb ("xmm0","xmm3"); # 0 = sb1t
|
||||
&pxor ("xmm0","xmm4"); # 0 = A
|
||||
&pshufb ("xmm0","xmm2");
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_decrypt_core");
|
||||
|
||||
########################################################
|
||||
## ##
|
||||
## AES key schedule ##
|
||||
## ##
|
||||
########################################################
|
||||
&function_begin_B("_vpaes_schedule_core");
|
||||
&add ($const,&DWP(0,"esp"));
|
||||
&movdqu ("xmm0",&QWP(0,$inp)); # load key (unaligned)
|
||||
&movdqa ("xmm2",&QWP($k_rcon,$const)); # load rcon
|
||||
|
||||
# input transform
|
||||
&movdqa ("xmm3","xmm0");
|
||||
&lea ($base,&DWP($k_ipt,$const));
|
||||
&movdqa (&QWP(4,"esp"),"xmm2"); # xmm8
|
||||
&call ("_vpaes_schedule_transform");
|
||||
&movdqa ("xmm7","xmm0");
|
||||
|
||||
&test ($out,$out);
|
||||
&jnz (&label("schedule_am_decrypting"));
|
||||
|
||||
# encrypting, output zeroth round key after transform
|
||||
&movdqu (&QWP(0,$key),"xmm0");
|
||||
&jmp (&label("schedule_go"));
|
||||
|
||||
&set_label("schedule_am_decrypting");
|
||||
# decrypting, output zeroth round key after shiftrows
|
||||
&movdqa ("xmm1",&QWP($k_sr,$const,$magic));
|
||||
&pshufb ("xmm3","xmm1");
|
||||
&movdqu (&QWP(0,$key),"xmm3");
|
||||
&xor ($magic,0x30);
|
||||
|
||||
&set_label("schedule_go");
|
||||
&cmp ($round,192);
|
||||
&ja (&label("schedule_256"));
|
||||
&je (&label("schedule_192"));
|
||||
# 128: fall though
|
||||
|
||||
##
|
||||
## .schedule_128
|
||||
##
|
||||
## 128-bit specific part of key schedule.
|
||||
##
|
||||
## This schedule is really simple, because all its parts
|
||||
## are accomplished by the subroutines.
|
||||
##
|
||||
&set_label("schedule_128");
|
||||
&mov ($round,10);
|
||||
|
||||
&set_label("loop_schedule_128");
|
||||
&call ("_vpaes_schedule_round");
|
||||
&dec ($round);
|
||||
&jz (&label("schedule_mangle_last"));
|
||||
&call ("_vpaes_schedule_mangle"); # write output
|
||||
&jmp (&label("loop_schedule_128"));
|
||||
|
||||
##
|
||||
## .aes_schedule_192
|
||||
##
|
||||
## 192-bit specific part of key schedule.
|
||||
##
|
||||
## The main body of this schedule is the same as the 128-bit
|
||||
## schedule, but with more smearing. The long, high side is
|
||||
## stored in %xmm7 as before, and the short, low side is in
|
||||
## the high bits of %xmm6.
|
||||
##
|
||||
## This schedule is somewhat nastier, however, because each
|
||||
## round produces 192 bits of key material, or 1.5 round keys.
|
||||
## Therefore, on each cycle we do 2 rounds and produce 3 round
|
||||
## keys.
|
||||
##
|
||||
&set_label("schedule_192",16);
|
||||
&movdqu ("xmm0",&QWP(8,$inp)); # load key part 2 (very unaligned)
|
||||
&call ("_vpaes_schedule_transform"); # input transform
|
||||
&movdqa ("xmm6","xmm0"); # save short part
|
||||
&pxor ("xmm4","xmm4"); # clear 4
|
||||
&movhlps("xmm6","xmm4"); # clobber low side with zeros
|
||||
&mov ($round,4);
|
||||
|
||||
&set_label("loop_schedule_192");
|
||||
&call ("_vpaes_schedule_round");
|
||||
&palignr("xmm0","xmm6",8);
|
||||
&call ("_vpaes_schedule_mangle"); # save key n
|
||||
&call ("_vpaes_schedule_192_smear");
|
||||
&call ("_vpaes_schedule_mangle"); # save key n+1
|
||||
&call ("_vpaes_schedule_round");
|
||||
&dec ($round);
|
||||
&jz (&label("schedule_mangle_last"));
|
||||
&call ("_vpaes_schedule_mangle"); # save key n+2
|
||||
&call ("_vpaes_schedule_192_smear");
|
||||
&jmp (&label("loop_schedule_192"));
|
||||
|
||||
##
|
||||
## .aes_schedule_256
|
||||
##
|
||||
## 256-bit specific part of key schedule.
|
||||
##
|
||||
## The structure here is very similar to the 128-bit
|
||||
## schedule, but with an additional "low side" in
|
||||
## %xmm6. The low side's rounds are the same as the
|
||||
## high side's, except no rcon and no rotation.
|
||||
##
|
||||
&set_label("schedule_256",16);
|
||||
&movdqu ("xmm0",&QWP(16,$inp)); # load key part 2 (unaligned)
|
||||
&call ("_vpaes_schedule_transform"); # input transform
|
||||
&mov ($round,7);
|
||||
|
||||
&set_label("loop_schedule_256");
|
||||
&call ("_vpaes_schedule_mangle"); # output low result
|
||||
&movdqa ("xmm6","xmm0"); # save cur_lo in xmm6
|
||||
|
||||
# high round
|
||||
&call ("_vpaes_schedule_round");
|
||||
&dec ($round);
|
||||
&jz (&label("schedule_mangle_last"));
|
||||
&call ("_vpaes_schedule_mangle");
|
||||
|
||||
# low round. swap xmm7 and xmm6
|
||||
&pshufd ("xmm0","xmm0",0xFF);
|
||||
&movdqa (&QWP(20,"esp"),"xmm7");
|
||||
&movdqa ("xmm7","xmm6");
|
||||
&call ("_vpaes_schedule_low_round");
|
||||
&movdqa ("xmm7",&QWP(20,"esp"));
|
||||
|
||||
&jmp (&label("loop_schedule_256"));
|
||||
|
||||
##
|
||||
## .aes_schedule_mangle_last
|
||||
##
|
||||
## Mangler for last round of key schedule
|
||||
## Mangles %xmm0
|
||||
## when encrypting, outputs out(%xmm0) ^ 63
|
||||
## when decrypting, outputs unskew(%xmm0)
|
||||
##
|
||||
## Always called right before return... jumps to cleanup and exits
|
||||
##
|
||||
&set_label("schedule_mangle_last",16);
|
||||
# schedule last round key from xmm0
|
||||
&lea ($base,&DWP($k_deskew,$const));
|
||||
&test ($out,$out);
|
||||
&jnz (&label("schedule_mangle_last_dec"));
|
||||
|
||||
# encrypting
|
||||
&movdqa ("xmm1",&QWP($k_sr,$const,$magic));
|
||||
&pshufb ("xmm0","xmm1"); # output permute
|
||||
&lea ($base,&DWP($k_opt,$const)); # prepare to output transform
|
||||
&add ($key,32);
|
||||
|
||||
&set_label("schedule_mangle_last_dec");
|
||||
&add ($key,-16);
|
||||
&pxor ("xmm0",&QWP($k_s63,$const));
|
||||
&call ("_vpaes_schedule_transform"); # output transform
|
||||
&movdqu (&QWP(0,$key),"xmm0"); # save last key
|
||||
|
||||
# cleanup
|
||||
&pxor ("xmm0","xmm0");
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm2","xmm2");
|
||||
&pxor ("xmm3","xmm3");
|
||||
&pxor ("xmm4","xmm4");
|
||||
&pxor ("xmm5","xmm5");
|
||||
&pxor ("xmm6","xmm6");
|
||||
&pxor ("xmm7","xmm7");
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_schedule_core");
|
||||
|
||||
##
|
||||
## .aes_schedule_192_smear
|
||||
##
|
||||
## Smear the short, low side in the 192-bit key schedule.
|
||||
##
|
||||
## Inputs:
|
||||
## %xmm7: high side, b a x y
|
||||
## %xmm6: low side, d c 0 0
|
||||
## %xmm13: 0
|
||||
##
|
||||
## Outputs:
|
||||
## %xmm6: b+c+d b+c 0 0
|
||||
## %xmm0: b+c+d b+c b a
|
||||
##
|
||||
&function_begin_B("_vpaes_schedule_192_smear");
|
||||
&pshufd ("xmm1","xmm6",0x80); # d c 0 0 -> c 0 0 0
|
||||
&pshufd ("xmm0","xmm7",0xFE); # b a _ _ -> b b b a
|
||||
&pxor ("xmm6","xmm1"); # -> c+d c 0 0
|
||||
&pxor ("xmm1","xmm1");
|
||||
&pxor ("xmm6","xmm0"); # -> b+c+d b+c b a
|
||||
&movdqa ("xmm0","xmm6");
|
||||
&movhlps("xmm6","xmm1"); # clobber low side with zeros
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_schedule_192_smear");
|
||||
|
||||
##
|
||||
## .aes_schedule_round
|
||||
##
|
||||
## Runs one main round of the key schedule on %xmm0, %xmm7
|
||||
##
|
||||
## Specifically, runs subbytes on the high dword of %xmm0
|
||||
## then rotates it by one byte and xors into the low dword of
|
||||
## %xmm7.
|
||||
##
|
||||
## Adds rcon from low byte of %xmm8, then rotates %xmm8 for
|
||||
## next rcon.
|
||||
##
|
||||
## Smears the dwords of %xmm7 by xoring the low into the
|
||||
## second low, result into third, result into highest.
|
||||
##
|
||||
## Returns results in %xmm7 = %xmm0.
|
||||
## Clobbers %xmm1-%xmm5.
|
||||
##
|
||||
&function_begin_B("_vpaes_schedule_round");
|
||||
# extract rcon from xmm8
|
||||
&movdqa ("xmm2",&QWP(8,"esp")); # xmm8
|
||||
&pxor ("xmm1","xmm1");
|
||||
&palignr("xmm1","xmm2",15);
|
||||
&palignr("xmm2","xmm2",15);
|
||||
&pxor ("xmm7","xmm1");
|
||||
|
||||
# rotate
|
||||
&pshufd ("xmm0","xmm0",0xFF);
|
||||
&palignr("xmm0","xmm0",1);
|
||||
|
||||
# fall through...
|
||||
&movdqa (&QWP(8,"esp"),"xmm2"); # xmm8
|
||||
|
||||
# low round: same as high round, but no rotation and no rcon.
|
||||
&set_label("_vpaes_schedule_low_round");
|
||||
# smear xmm7
|
||||
&movdqa ("xmm1","xmm7");
|
||||
&pslldq ("xmm7",4);
|
||||
&pxor ("xmm7","xmm1");
|
||||
&movdqa ("xmm1","xmm7");
|
||||
&pslldq ("xmm7",8);
|
||||
&pxor ("xmm7","xmm1");
|
||||
&pxor ("xmm7",&QWP($k_s63,$const));
|
||||
|
||||
# subbyte
|
||||
&movdqa ("xmm4",&QWP($k_s0F,$const));
|
||||
&movdqa ("xmm5",&QWP($k_inv,$const)); # 4 : 1/j
|
||||
&movdqa ("xmm1","xmm4");
|
||||
&pandn ("xmm1","xmm0");
|
||||
&psrld ("xmm1",4); # 1 = i
|
||||
&pand ("xmm0","xmm4"); # 0 = k
|
||||
&movdqa ("xmm2",&QWP($k_inv+16,$const));# 2 : a/k
|
||||
&pshufb ("xmm2","xmm0"); # 2 = a/k
|
||||
&pxor ("xmm0","xmm1"); # 0 = j
|
||||
&movdqa ("xmm3","xmm5"); # 3 : 1/i
|
||||
&pshufb ("xmm3","xmm1"); # 3 = 1/i
|
||||
&pxor ("xmm3","xmm2"); # 3 = iak = 1/i + a/k
|
||||
&movdqa ("xmm4","xmm5"); # 4 : 1/j
|
||||
&pshufb ("xmm4","xmm0"); # 4 = 1/j
|
||||
&pxor ("xmm4","xmm2"); # 4 = jak = 1/j + a/k
|
||||
&movdqa ("xmm2","xmm5"); # 2 : 1/iak
|
||||
&pshufb ("xmm2","xmm3"); # 2 = 1/iak
|
||||
&pxor ("xmm2","xmm0"); # 2 = io
|
||||
&movdqa ("xmm3","xmm5"); # 3 : 1/jak
|
||||
&pshufb ("xmm3","xmm4"); # 3 = 1/jak
|
||||
&pxor ("xmm3","xmm1"); # 3 = jo
|
||||
&movdqa ("xmm4",&QWP($k_sb1,$const)); # 4 : sbou
|
||||
&pshufb ("xmm4","xmm2"); # 4 = sbou
|
||||
&movdqa ("xmm0",&QWP($k_sb1+16,$const));# 0 : sbot
|
||||
&pshufb ("xmm0","xmm3"); # 0 = sb1t
|
||||
&pxor ("xmm0","xmm4"); # 0 = sbox output
|
||||
|
||||
# add in smeared stuff
|
||||
&pxor ("xmm0","xmm7");
|
||||
&movdqa ("xmm7","xmm0");
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_schedule_round");
|
||||
|
||||
##
|
||||
## .aes_schedule_transform
|
||||
##
|
||||
## Linear-transform %xmm0 according to tables at (%ebx)
|
||||
##
|
||||
## Output in %xmm0
|
||||
## Clobbers %xmm1, %xmm2
|
||||
##
|
||||
&function_begin_B("_vpaes_schedule_transform");
|
||||
&movdqa ("xmm2",&QWP($k_s0F,$const));
|
||||
&movdqa ("xmm1","xmm2");
|
||||
&pandn ("xmm1","xmm0");
|
||||
&psrld ("xmm1",4);
|
||||
&pand ("xmm0","xmm2");
|
||||
&movdqa ("xmm2",&QWP(0,$base));
|
||||
&pshufb ("xmm2","xmm0");
|
||||
&movdqa ("xmm0",&QWP(16,$base));
|
||||
&pshufb ("xmm0","xmm1");
|
||||
&pxor ("xmm0","xmm2");
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_schedule_transform");
|
||||
|
||||
##
|
||||
## .aes_schedule_mangle
|
||||
##
|
||||
## Mangle xmm0 from (basis-transformed) standard version
|
||||
## to our version.
|
||||
##
|
||||
## On encrypt,
|
||||
## xor with 0x63
|
||||
## multiply by circulant 0,1,1,1
|
||||
## apply shiftrows transform
|
||||
##
|
||||
## On decrypt,
|
||||
## xor with 0x63
|
||||
## multiply by "inverse mixcolumns" circulant E,B,D,9
|
||||
## deskew
|
||||
## apply shiftrows transform
|
||||
##
|
||||
##
|
||||
## Writes out to (%edx), and increments or decrements it
|
||||
## Keeps track of round number mod 4 in %ecx
|
||||
## Preserves xmm0
|
||||
## Clobbers xmm1-xmm5
|
||||
##
|
||||
&function_begin_B("_vpaes_schedule_mangle");
|
||||
&movdqa ("xmm4","xmm0"); # save xmm0 for later
|
||||
&movdqa ("xmm5",&QWP($k_mc_forward,$const));
|
||||
&test ($out,$out);
|
||||
&jnz (&label("schedule_mangle_dec"));
|
||||
|
||||
# encrypting
|
||||
&add ($key,16);
|
||||
&pxor ("xmm4",&QWP($k_s63,$const));
|
||||
&pshufb ("xmm4","xmm5");
|
||||
&movdqa ("xmm3","xmm4");
|
||||
&pshufb ("xmm4","xmm5");
|
||||
&pxor ("xmm3","xmm4");
|
||||
&pshufb ("xmm4","xmm5");
|
||||
&pxor ("xmm3","xmm4");
|
||||
|
||||
&jmp (&label("schedule_mangle_both"));
|
||||
|
||||
&set_label("schedule_mangle_dec",16);
|
||||
# inverse mix columns
|
||||
&movdqa ("xmm2",&QWP($k_s0F,$const));
|
||||
&lea ($inp,&DWP($k_dksd,$const));
|
||||
&movdqa ("xmm1","xmm2");
|
||||
&pandn ("xmm1","xmm4");
|
||||
&psrld ("xmm1",4); # 1 = hi
|
||||
&pand ("xmm4","xmm2"); # 4 = lo
|
||||
|
||||
&movdqa ("xmm2",&QWP(0,$inp));
|
||||
&pshufb ("xmm2","xmm4");
|
||||
&movdqa ("xmm3",&QWP(0x10,$inp));
|
||||
&pshufb ("xmm3","xmm1");
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pshufb ("xmm3","xmm5");
|
||||
|
||||
&movdqa ("xmm2",&QWP(0x20,$inp));
|
||||
&pshufb ("xmm2","xmm4");
|
||||
&pxor ("xmm2","xmm3");
|
||||
&movdqa ("xmm3",&QWP(0x30,$inp));
|
||||
&pshufb ("xmm3","xmm1");
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pshufb ("xmm3","xmm5");
|
||||
|
||||
&movdqa ("xmm2",&QWP(0x40,$inp));
|
||||
&pshufb ("xmm2","xmm4");
|
||||
&pxor ("xmm2","xmm3");
|
||||
&movdqa ("xmm3",&QWP(0x50,$inp));
|
||||
&pshufb ("xmm3","xmm1");
|
||||
&pxor ("xmm3","xmm2");
|
||||
&pshufb ("xmm3","xmm5");
|
||||
|
||||
&movdqa ("xmm2",&QWP(0x60,$inp));
|
||||
&pshufb ("xmm2","xmm4");
|
||||
&pxor ("xmm2","xmm3");
|
||||
&movdqa ("xmm3",&QWP(0x70,$inp));
|
||||
&pshufb ("xmm3","xmm1");
|
||||
&pxor ("xmm3","xmm2");
|
||||
|
||||
&add ($key,-16);
|
||||
|
||||
&set_label("schedule_mangle_both");
|
||||
&movdqa ("xmm1",&QWP($k_sr,$const,$magic));
|
||||
&pshufb ("xmm3","xmm1");
|
||||
&add ($magic,-16);
|
||||
&and ($magic,0x30);
|
||||
&movdqu (&QWP(0,$key),"xmm3");
|
||||
&ret ();
|
||||
&function_end_B("_vpaes_schedule_mangle");
|
||||
|
||||
#
|
||||
# Interface to OpenSSL
|
||||
#
|
||||
&function_begin("${PREFIX}_set_encrypt_key");
|
||||
&mov ($inp,&wparam(0)); # inp
|
||||
&lea ($base,&DWP(-56,"esp"));
|
||||
&mov ($round,&wparam(1)); # bits
|
||||
&and ($base,-16);
|
||||
&mov ($key,&wparam(2)); # key
|
||||
&xchg ($base,"esp"); # alloca
|
||||
&mov (&DWP(48,"esp"),$base);
|
||||
|
||||
&mov ($base,$round);
|
||||
&shr ($base,5);
|
||||
&add ($base,5);
|
||||
&mov (&DWP(240,$key),$base); # AES_KEY->rounds = nbits/32+5;
|
||||
&mov ($magic,0x30);
|
||||
&mov ($out,0);
|
||||
|
||||
&lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
|
||||
&call ("_vpaes_schedule_core");
|
||||
&set_label("pic_point");
|
||||
|
||||
&mov ("esp",&DWP(48,"esp"));
|
||||
&xor ("eax","eax");
|
||||
&function_end("${PREFIX}_set_encrypt_key");
|
||||
|
||||
&function_begin("${PREFIX}_set_decrypt_key");
|
||||
&mov ($inp,&wparam(0)); # inp
|
||||
&lea ($base,&DWP(-56,"esp"));
|
||||
&mov ($round,&wparam(1)); # bits
|
||||
&and ($base,-16);
|
||||
&mov ($key,&wparam(2)); # key
|
||||
&xchg ($base,"esp"); # alloca
|
||||
&mov (&DWP(48,"esp"),$base);
|
||||
|
||||
&mov ($base,$round);
|
||||
&shr ($base,5);
|
||||
&add ($base,5);
|
||||
&mov (&DWP(240,$key),$base); # AES_KEY->rounds = nbits/32+5;
|
||||
&shl ($base,4);
|
||||
&lea ($key,&DWP(16,$key,$base));
|
||||
|
||||
&mov ($out,1);
|
||||
&mov ($magic,$round);
|
||||
&shr ($magic,1);
|
||||
&and ($magic,32);
|
||||
&xor ($magic,32); # nbist==192?0:32;
|
||||
|
||||
&lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
|
||||
&call ("_vpaes_schedule_core");
|
||||
&set_label("pic_point");
|
||||
|
||||
&mov ("esp",&DWP(48,"esp"));
|
||||
&xor ("eax","eax");
|
||||
&function_end("${PREFIX}_set_decrypt_key");
|
||||
|
||||
&function_begin("${PREFIX}_encrypt");
|
||||
&lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
|
||||
&call ("_vpaes_preheat");
|
||||
&set_label("pic_point");
|
||||
&mov ($inp,&wparam(0)); # inp
|
||||
&lea ($base,&DWP(-56,"esp"));
|
||||
&mov ($out,&wparam(1)); # out
|
||||
&and ($base,-16);
|
||||
&mov ($key,&wparam(2)); # key
|
||||
&xchg ($base,"esp"); # alloca
|
||||
&mov (&DWP(48,"esp"),$base);
|
||||
|
||||
&movdqu ("xmm0",&QWP(0,$inp));
|
||||
&call ("_vpaes_encrypt_core");
|
||||
&movdqu (&QWP(0,$out),"xmm0");
|
||||
|
||||
&mov ("esp",&DWP(48,"esp"));
|
||||
&function_end("${PREFIX}_encrypt");
|
||||
|
||||
&function_begin("${PREFIX}_decrypt");
|
||||
&lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
|
||||
&call ("_vpaes_preheat");
|
||||
&set_label("pic_point");
|
||||
&mov ($inp,&wparam(0)); # inp
|
||||
&lea ($base,&DWP(-56,"esp"));
|
||||
&mov ($out,&wparam(1)); # out
|
||||
&and ($base,-16);
|
||||
&mov ($key,&wparam(2)); # key
|
||||
&xchg ($base,"esp"); # alloca
|
||||
&mov (&DWP(48,"esp"),$base);
|
||||
|
||||
&movdqu ("xmm0",&QWP(0,$inp));
|
||||
&call ("_vpaes_decrypt_core");
|
||||
&movdqu (&QWP(0,$out),"xmm0");
|
||||
|
||||
&mov ("esp",&DWP(48,"esp"));
|
||||
&function_end("${PREFIX}_decrypt");
|
||||
|
||||
&function_begin("${PREFIX}_cbc_encrypt");
|
||||
&mov ($inp,&wparam(0)); # inp
|
||||
&mov ($out,&wparam(1)); # out
|
||||
&mov ($round,&wparam(2)); # len
|
||||
&mov ($key,&wparam(3)); # key
|
||||
&sub ($round,16);
|
||||
&jc (&label("cbc_abort"));
|
||||
&lea ($base,&DWP(-56,"esp"));
|
||||
&mov ($const,&wparam(4)); # ivp
|
||||
&and ($base,-16);
|
||||
&mov ($magic,&wparam(5)); # enc
|
||||
&xchg ($base,"esp"); # alloca
|
||||
&movdqu ("xmm1",&QWP(0,$const)); # load IV
|
||||
&sub ($out,$inp);
|
||||
&mov (&DWP(48,"esp"),$base);
|
||||
|
||||
&mov (&DWP(0,"esp"),$out); # save out
|
||||
&mov (&DWP(4,"esp"),$key) # save key
|
||||
&mov (&DWP(8,"esp"),$const); # save ivp
|
||||
&mov ($out,$round); # $out works as $len
|
||||
|
||||
&lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
|
||||
&call ("_vpaes_preheat");
|
||||
&set_label("pic_point");
|
||||
&cmp ($magic,0);
|
||||
&je (&label("cbc_dec_loop"));
|
||||
&jmp (&label("cbc_enc_loop"));
|
||||
|
||||
&set_label("cbc_enc_loop",16);
|
||||
&movdqu ("xmm0",&QWP(0,$inp)); # load input
|
||||
&pxor ("xmm0","xmm1"); # inp^=iv
|
||||
&call ("_vpaes_encrypt_core");
|
||||
&mov ($base,&DWP(0,"esp")); # restore out
|
||||
&mov ($key,&DWP(4,"esp")); # restore key
|
||||
&movdqa ("xmm1","xmm0");
|
||||
&movdqu (&QWP(0,$base,$inp),"xmm0"); # write output
|
||||
&lea ($inp,&DWP(16,$inp));
|
||||
&sub ($out,16);
|
||||
&jnc (&label("cbc_enc_loop"));
|
||||
&jmp (&label("cbc_done"));
|
||||
|
||||
&set_label("cbc_dec_loop",16);
|
||||
&movdqu ("xmm0",&QWP(0,$inp)); # load input
|
||||
&movdqa (&QWP(16,"esp"),"xmm1"); # save IV
|
||||
&movdqa (&QWP(32,"esp"),"xmm0"); # save future IV
|
||||
&call ("_vpaes_decrypt_core");
|
||||
&mov ($base,&DWP(0,"esp")); # restore out
|
||||
&mov ($key,&DWP(4,"esp")); # restore key
|
||||
&pxor ("xmm0",&QWP(16,"esp")); # out^=iv
|
||||
&movdqa ("xmm1",&QWP(32,"esp")); # load next IV
|
||||
&movdqu (&QWP(0,$base,$inp),"xmm0"); # write output
|
||||
&lea ($inp,&DWP(16,$inp));
|
||||
&sub ($out,16);
|
||||
&jnc (&label("cbc_dec_loop"));
|
||||
|
||||
&set_label("cbc_done");
|
||||
&mov ($base,&DWP(8,"esp")); # restore ivp
|
||||
&mov ("esp",&DWP(48,"esp"));
|
||||
&movdqu (&QWP(0,$base),"xmm1"); # write IV
|
||||
&set_label("cbc_abort");
|
||||
&function_end("${PREFIX}_cbc_encrypt");
|
||||
|
||||
&asm_finish();
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +0,0 @@
|
||||
#include "arm_arch.h"
|
||||
|
||||
.text
|
||||
.arch armv8-a+crypto
|
||||
|
||||
.align 5
|
||||
.global _armv7_neon_probe
|
||||
.type _armv7_neon_probe,%function
|
||||
_armv7_neon_probe:
|
||||
orr v15.16b, v15.16b, v15.16b
|
||||
ret
|
||||
.size _armv7_neon_probe,.-_armv7_neon_probe
|
||||
|
||||
.global _armv7_tick
|
||||
.type _armv7_tick,%function
|
||||
_armv7_tick:
|
||||
mrs x0, CNTVCT_EL0
|
||||
ret
|
||||
.size _armv7_tick,.-_armv7_tick
|
||||
|
||||
.global _armv8_aes_probe
|
||||
.type _armv8_aes_probe,%function
|
||||
_armv8_aes_probe:
|
||||
aese v0.16b, v0.16b
|
||||
ret
|
||||
.size _armv8_aes_probe,.-_armv8_aes_probe
|
||||
|
||||
.global _armv8_sha1_probe
|
||||
.type _armv8_sha1_probe,%function
|
||||
_armv8_sha1_probe:
|
||||
sha1h s0, s0
|
||||
ret
|
||||
.size _armv8_sha1_probe,.-_armv8_sha1_probe
|
||||
|
||||
.global _armv8_sha256_probe
|
||||
.type _armv8_sha256_probe,%function
|
||||
_armv8_sha256_probe:
|
||||
sha256su0 v0.4s, v0.4s
|
||||
ret
|
||||
.size _armv8_sha256_probe,.-_armv8_sha256_probe
|
||||
.global _armv8_pmull_probe
|
||||
.type _armv8_pmull_probe,%function
|
||||
_armv8_pmull_probe:
|
||||
pmull v0.1q, v0.1d, v0.1d
|
||||
ret
|
||||
.size _armv8_pmull_probe,.-_armv8_pmull_probe
|
||||
@@ -1,78 +0,0 @@
|
||||
#ifndef __ARM_ARCH_H__
|
||||
# define __ARM_ARCH_H__
|
||||
|
||||
# if !defined(__ARM_ARCH__)
|
||||
# if defined(__CC_ARM)
|
||||
# define __ARM_ARCH__ __TARGET_ARCH_ARM
|
||||
# if defined(__BIG_ENDIAN)
|
||||
# define __ARMEB__
|
||||
# else
|
||||
# define __ARMEL__
|
||||
# endif
|
||||
# elif defined(__GNUC__)
|
||||
# if defined(__aarch64__)
|
||||
# define __ARM_ARCH__ 8
|
||||
# if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
|
||||
# define __ARMEB__
|
||||
# else
|
||||
# define __ARMEL__
|
||||
# endif
|
||||
/*
|
||||
* Why doesn't gcc define __ARM_ARCH__? Instead it defines
|
||||
* bunch of below macros. See all_architectires[] table in
|
||||
* gcc/config/arm/arm.c. On a side note it defines
|
||||
* __ARMEL__/__ARMEB__ for little-/big-endian.
|
||||
*/
|
||||
# elif defined(__ARM_ARCH)
|
||||
# define __ARM_ARCH__ __ARM_ARCH
|
||||
# elif defined(__ARM_ARCH_8A__)
|
||||
# define __ARM_ARCH__ 8
|
||||
# elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
|
||||
defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \
|
||||
defined(__ARM_ARCH_7EM__)
|
||||
# define __ARM_ARCH__ 7
|
||||
# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
|
||||
defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \
|
||||
defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \
|
||||
defined(__ARM_ARCH_6T2__)
|
||||
# define __ARM_ARCH__ 6
|
||||
# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
|
||||
defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \
|
||||
defined(__ARM_ARCH_5TEJ__)
|
||||
# define __ARM_ARCH__ 5
|
||||
# elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
|
||||
# define __ARM_ARCH__ 4
|
||||
# else
|
||||
# error "unsupported ARM architecture"
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef OPENSSL_FIPSCANISTER
|
||||
# include <openssl/fipssyms.h>
|
||||
# endif
|
||||
|
||||
# if !defined(__ARM_MAX_ARCH__)
|
||||
# define __ARM_MAX_ARCH__ __ARM_ARCH__
|
||||
# endif
|
||||
|
||||
# if __ARM_MAX_ARCH__<__ARM_ARCH__
|
||||
# error "__ARM_MAX_ARCH__ can't be less than __ARM_ARCH__"
|
||||
# elif __ARM_MAX_ARCH__!=__ARM_ARCH__
|
||||
# if __ARM_ARCH__<7 && __ARM_MAX_ARCH__>=7 && defined(__ARMEB__)
|
||||
# error "can't build universal big-endian binary"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if !__ASSEMBLER__
|
||||
extern unsigned int OPENSSL_armcap_P;
|
||||
# endif
|
||||
|
||||
# define ARMV7_NEON (1<<0)
|
||||
# define ARMV7_TICK (1<<1)
|
||||
# define ARMV8_AES (1<<2)
|
||||
# define ARMV8_SHA1 (1<<3)
|
||||
# define ARMV8_SHA256 (1<<4)
|
||||
# define ARMV8_PMULL (1<<5)
|
||||
|
||||
#endif
|
||||
164
crypto/armcap.c
164
crypto/armcap.c
@@ -1,164 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <crypto.h>
|
||||
|
||||
#include "arm_arch.h"
|
||||
|
||||
unsigned int OPENSSL_armcap_P = 0;
|
||||
|
||||
#if __ARM_MAX_ARCH__<7
|
||||
void OPENSSL_cpuid_setup(void)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned long OPENSSL_rdtsc(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static sigset_t all_masked;
|
||||
|
||||
static sigjmp_buf ill_jmp;
|
||||
static void ill_handler(int sig)
|
||||
{
|
||||
siglongjmp(ill_jmp, sig);
|
||||
}
|
||||
|
||||
/*
|
||||
* Following subroutines could have been inlined, but it's not all
|
||||
* ARM compilers support inline assembler...
|
||||
*/
|
||||
void _armv7_neon_probe(void);
|
||||
void _armv8_aes_probe(void);
|
||||
void _armv8_sha1_probe(void);
|
||||
void _armv8_sha256_probe(void);
|
||||
void _armv8_pmull_probe(void);
|
||||
unsigned long _armv7_tick(void);
|
||||
|
||||
unsigned long OPENSSL_rdtsc(void)
|
||||
{
|
||||
if (OPENSSL_armcap_P & ARMV7_TICK)
|
||||
return _armv7_tick();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use a weak reference to getauxval() so we can use it if it is available but
|
||||
* don't break the build if it is not.
|
||||
*/
|
||||
# if defined(__GNUC__) && __GNUC__>=2
|
||||
void OPENSSL_cpuid_setup(void) __attribute__ ((constructor));
|
||||
extern unsigned long getauxval(unsigned long type) __attribute__ ((weak));
|
||||
# else
|
||||
static unsigned long (*getauxval) (unsigned long) = NULL;
|
||||
# endif
|
||||
|
||||
/*
|
||||
* ARM puts the the feature bits for Crypto Extensions in AT_HWCAP2, whereas
|
||||
* AArch64 used AT_HWCAP.
|
||||
*/
|
||||
# if defined(__arm__) || defined (__arm)
|
||||
# define HWCAP 16
|
||||
/* AT_HWCAP */
|
||||
# define HWCAP_NEON (1 << 12)
|
||||
|
||||
# define HWCAP_CE 26
|
||||
/* AT_HWCAP2 */
|
||||
# define HWCAP_CE_AES (1 << 0)
|
||||
# define HWCAP_CE_PMULL (1 << 1)
|
||||
# define HWCAP_CE_SHA1 (1 << 2)
|
||||
# define HWCAP_CE_SHA256 (1 << 3)
|
||||
# elif defined(__aarch64__)
|
||||
# define HWCAP 16
|
||||
/* AT_HWCAP */
|
||||
# define HWCAP_NEON (1 << 1)
|
||||
|
||||
# define HWCAP_CE HWCAP
|
||||
# define HWCAP_CE_AES (1 << 3)
|
||||
# define HWCAP_CE_PMULL (1 << 4)
|
||||
# define HWCAP_CE_SHA1 (1 << 5)
|
||||
# define HWCAP_CE_SHA256 (1 << 6)
|
||||
# endif
|
||||
|
||||
void OPENSSL_cpuid_setup(void)
|
||||
{
|
||||
char *e;
|
||||
struct sigaction ill_oact, ill_act;
|
||||
sigset_t oset;
|
||||
static int trigger = 0;
|
||||
|
||||
if (trigger)
|
||||
return;
|
||||
trigger = 1;
|
||||
|
||||
if ((e = getenv("OPENSSL_armcap"))) {
|
||||
OPENSSL_armcap_P = (unsigned int)strtoul(e, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
sigfillset(&all_masked);
|
||||
sigdelset(&all_masked, SIGILL);
|
||||
sigdelset(&all_masked, SIGTRAP);
|
||||
sigdelset(&all_masked, SIGFPE);
|
||||
sigdelset(&all_masked, SIGBUS);
|
||||
sigdelset(&all_masked, SIGSEGV);
|
||||
|
||||
OPENSSL_armcap_P = 0;
|
||||
|
||||
memset(&ill_act, 0, sizeof(ill_act));
|
||||
ill_act.sa_handler = ill_handler;
|
||||
ill_act.sa_mask = all_masked;
|
||||
|
||||
sigprocmask(SIG_SETMASK, &ill_act.sa_mask, &oset);
|
||||
sigaction(SIGILL, &ill_act, &ill_oact);
|
||||
|
||||
if (getauxval != NULL) {
|
||||
if (getauxval(HWCAP) & HWCAP_NEON) {
|
||||
unsigned long hwcap = getauxval(HWCAP_CE);
|
||||
|
||||
OPENSSL_armcap_P |= ARMV7_NEON;
|
||||
|
||||
if (hwcap & HWCAP_CE_AES)
|
||||
OPENSSL_armcap_P |= ARMV8_AES;
|
||||
|
||||
if (hwcap & HWCAP_CE_PMULL)
|
||||
OPENSSL_armcap_P |= ARMV8_PMULL;
|
||||
|
||||
if (hwcap & HWCAP_CE_SHA1)
|
||||
OPENSSL_armcap_P |= ARMV8_SHA1;
|
||||
|
||||
if (hwcap & HWCAP_CE_SHA256)
|
||||
OPENSSL_armcap_P |= ARMV8_SHA256;
|
||||
}
|
||||
} else if (sigsetjmp(ill_jmp, 1) == 0) {
|
||||
_armv7_neon_probe();
|
||||
OPENSSL_armcap_P |= ARMV7_NEON;
|
||||
if (sigsetjmp(ill_jmp, 1) == 0) {
|
||||
_armv8_pmull_probe();
|
||||
OPENSSL_armcap_P |= ARMV8_PMULL | ARMV8_AES;
|
||||
} else if (sigsetjmp(ill_jmp, 1) == 0) {
|
||||
_armv8_aes_probe();
|
||||
OPENSSL_armcap_P |= ARMV8_AES;
|
||||
}
|
||||
if (sigsetjmp(ill_jmp, 1) == 0) {
|
||||
_armv8_sha1_probe();
|
||||
OPENSSL_armcap_P |= ARMV8_SHA1;
|
||||
}
|
||||
if (sigsetjmp(ill_jmp, 1) == 0) {
|
||||
_armv8_sha256_probe();
|
||||
OPENSSL_armcap_P |= ARMV8_SHA256;
|
||||
}
|
||||
}
|
||||
if (sigsetjmp(ill_jmp, 1) == 0) {
|
||||
_armv7_tick();
|
||||
OPENSSL_armcap_P |= ARMV7_TICK;
|
||||
}
|
||||
|
||||
sigaction(SIGILL, &ill_oact, NULL);
|
||||
sigprocmask(SIG_SETMASK, &oset, NULL);
|
||||
}
|
||||
#endif
|
||||
@@ -1,209 +0,0 @@
|
||||
#include "arm_arch.h"
|
||||
|
||||
.text
|
||||
.code 32
|
||||
|
||||
.align 5
|
||||
.global OPENSSL_atomic_add
|
||||
.type OPENSSL_atomic_add,%function
|
||||
OPENSSL_atomic_add:
|
||||
#if __ARM_ARCH__>=6
|
||||
.Ladd: ldrex r2,[r0]
|
||||
add r3,r2,r1
|
||||
strex r2,r3,[r0]
|
||||
cmp r2,#0
|
||||
bne .Ladd
|
||||
mov r0,r3
|
||||
bx lr
|
||||
#else
|
||||
stmdb sp!,{r4-r6,lr}
|
||||
ldr r2,.Lspinlock
|
||||
adr r3,.Lspinlock
|
||||
mov r4,r0
|
||||
mov r5,r1
|
||||
add r6,r3,r2 @ &spinlock
|
||||
b .+8
|
||||
.Lspin: bl sched_yield
|
||||
mov r0,#-1
|
||||
swp r0,r0,[r6]
|
||||
cmp r0,#0
|
||||
bne .Lspin
|
||||
|
||||
ldr r2,[r4]
|
||||
add r2,r2,r5
|
||||
str r2,[r4]
|
||||
str r0,[r6] @ release spinlock
|
||||
ldmia sp!,{r4-r6,lr}
|
||||
tst lr,#1
|
||||
moveq pc,lr
|
||||
.word 0xe12fff1e @ bx lr
|
||||
#endif
|
||||
.size OPENSSL_atomic_add,.-OPENSSL_atomic_add
|
||||
|
||||
.global OPENSSL_cleanse
|
||||
.type OPENSSL_cleanse,%function
|
||||
OPENSSL_cleanse:
|
||||
eor ip,ip,ip
|
||||
cmp r1,#7
|
||||
subhs r1,r1,#4
|
||||
bhs .Lot
|
||||
cmp r1,#0
|
||||
beq .Lcleanse_done
|
||||
.Little:
|
||||
strb ip,[r0],#1
|
||||
subs r1,r1,#1
|
||||
bhi .Little
|
||||
b .Lcleanse_done
|
||||
|
||||
.Lot: tst r0,#3
|
||||
beq .Laligned
|
||||
strb ip,[r0],#1
|
||||
sub r1,r1,#1
|
||||
b .Lot
|
||||
.Laligned:
|
||||
str ip,[r0],#4
|
||||
subs r1,r1,#4
|
||||
bhs .Laligned
|
||||
adds r1,r1,#4
|
||||
bne .Little
|
||||
.Lcleanse_done:
|
||||
#if __ARM_ARCH__>=5
|
||||
bx lr
|
||||
#else
|
||||
tst lr,#1
|
||||
moveq pc,lr
|
||||
.word 0xe12fff1e @ bx lr
|
||||
#endif
|
||||
.size OPENSSL_cleanse,.-OPENSSL_cleanse
|
||||
|
||||
#if __ARM_MAX_ARCH__>=7
|
||||
.arch armv7-a
|
||||
.fpu neon
|
||||
|
||||
.align 5
|
||||
.global _armv7_neon_probe
|
||||
.type _armv7_neon_probe,%function
|
||||
_armv7_neon_probe:
|
||||
vorr q0,q0,q0
|
||||
bx lr
|
||||
.size _armv7_neon_probe,.-_armv7_neon_probe
|
||||
|
||||
.global _armv7_tick
|
||||
.type _armv7_tick,%function
|
||||
_armv7_tick:
|
||||
mrrc p15,1,r0,r1,c14 @ CNTVCT
|
||||
bx lr
|
||||
.size _armv7_tick,.-_armv7_tick
|
||||
|
||||
.global _armv8_aes_probe
|
||||
.type _armv8_aes_probe,%function
|
||||
_armv8_aes_probe:
|
||||
.byte 0x00,0x03,0xb0,0xf3 @ aese.8 q0,q0
|
||||
bx lr
|
||||
.size _armv8_aes_probe,.-_armv8_aes_probe
|
||||
|
||||
.global _armv8_sha1_probe
|
||||
.type _armv8_sha1_probe,%function
|
||||
_armv8_sha1_probe:
|
||||
.byte 0x40,0x0c,0x00,0xf2 @ sha1c.32 q0,q0,q0
|
||||
bx lr
|
||||
.size _armv8_sha1_probe,.-_armv8_sha1_probe
|
||||
|
||||
.global _armv8_sha256_probe
|
||||
.type _armv8_sha256_probe,%function
|
||||
_armv8_sha256_probe:
|
||||
.byte 0x40,0x0c,0x00,0xf3 @ sha256h.32 q0,q0,q0
|
||||
bx lr
|
||||
.size _armv8_sha256_probe,.-_armv8_sha256_probe
|
||||
.global _armv8_pmull_probe
|
||||
.type _armv8_pmull_probe,%function
|
||||
_armv8_pmull_probe:
|
||||
.byte 0x00,0x0e,0xa0,0xf2 @ vmull.p64 q0,d0,d0
|
||||
bx lr
|
||||
.size _armv8_pmull_probe,.-_armv8_pmull_probe
|
||||
#endif
|
||||
|
||||
.global OPENSSL_wipe_cpu
|
||||
.type OPENSSL_wipe_cpu,%function
|
||||
OPENSSL_wipe_cpu:
|
||||
#if __ARM_MAX_ARCH__>=7
|
||||
ldr r0,.LOPENSSL_armcap
|
||||
adr r1,.LOPENSSL_armcap
|
||||
ldr r0,[r1,r0]
|
||||
#endif
|
||||
eor r2,r2,r2
|
||||
eor r3,r3,r3
|
||||
eor ip,ip,ip
|
||||
#if __ARM_MAX_ARCH__>=7
|
||||
tst r0,#1
|
||||
beq .Lwipe_done
|
||||
veor q0, q0, q0
|
||||
veor q1, q1, q1
|
||||
veor q2, q2, q2
|
||||
veor q3, q3, q3
|
||||
veor q8, q8, q8
|
||||
veor q9, q9, q9
|
||||
veor q10, q10, q10
|
||||
veor q11, q11, q11
|
||||
veor q12, q12, q12
|
||||
veor q13, q13, q13
|
||||
veor q14, q14, q14
|
||||
veor q15, q15, q15
|
||||
.Lwipe_done:
|
||||
#endif
|
||||
mov r0,sp
|
||||
#if __ARM_ARCH__>=5
|
||||
bx lr
|
||||
#else
|
||||
tst lr,#1
|
||||
moveq pc,lr
|
||||
.word 0xe12fff1e @ bx lr
|
||||
#endif
|
||||
.size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
|
||||
|
||||
.global OPENSSL_instrument_bus
|
||||
.type OPENSSL_instrument_bus,%function
|
||||
OPENSSL_instrument_bus:
|
||||
eor r0,r0,r0
|
||||
#if __ARM_ARCH__>=5
|
||||
bx lr
|
||||
#else
|
||||
tst lr,#1
|
||||
moveq pc,lr
|
||||
.word 0xe12fff1e @ bx lr
|
||||
#endif
|
||||
.size OPENSSL_instrument_bus,.-OPENSSL_instrument_bus
|
||||
|
||||
.global OPENSSL_instrument_bus2
|
||||
.type OPENSSL_instrument_bus2,%function
|
||||
OPENSSL_instrument_bus2:
|
||||
eor r0,r0,r0
|
||||
#if __ARM_ARCH__>=5
|
||||
bx lr
|
||||
#else
|
||||
tst lr,#1
|
||||
moveq pc,lr
|
||||
.word 0xe12fff1e @ bx lr
|
||||
#endif
|
||||
.size OPENSSL_instrument_bus2,.-OPENSSL_instrument_bus2
|
||||
|
||||
.align 5
|
||||
#if __ARM_MAX_ARCH__>=7
|
||||
.LOPENSSL_armcap:
|
||||
.word OPENSSL_armcap_P-.LOPENSSL_armcap
|
||||
#endif
|
||||
#if __ARM_ARCH__>=6
|
||||
.align 5
|
||||
#else
|
||||
.Lspinlock:
|
||||
.word atomic_add_spinlock-.Lspinlock
|
||||
.align 5
|
||||
|
||||
.data
|
||||
.align 2
|
||||
atomic_add_spinlock:
|
||||
.word 0
|
||||
#endif
|
||||
|
||||
.comm OPENSSL_armcap_P,4,4
|
||||
.hidden OPENSSL_armcap_P
|
||||
@@ -93,6 +93,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
@@ -174,7 +176,7 @@ a_gentm.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
a_gentm.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_gentm.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
a_gentm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
a_gentm.o: ../cryptlib.h ../o_time.h a_gentm.c asn1_locl.h
|
||||
a_gentm.o: ../cryptlib.h ../o_time.h a_gentm.c
|
||||
a_i2d_fp.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
a_i2d_fp.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
a_i2d_fp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
@@ -275,7 +277,6 @@ a_time.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
||||
a_time.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
a_time.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
a_time.o: ../../include/openssl/symhacks.h ../cryptlib.h ../o_time.h a_time.c
|
||||
a_time.o: asn1_locl.h
|
||||
a_type.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
a_type.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
|
||||
a_type.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
@@ -292,7 +293,7 @@ a_utctm.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
a_utctm.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
|
||||
a_utctm.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
|
||||
a_utctm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
|
||||
a_utctm.o: ../cryptlib.h ../o_time.h a_utctm.c asn1_locl.h
|
||||
a_utctm.o: ../cryptlib.h ../o_time.h a_utctm.c
|
||||
a_utf8.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
a_utf8.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
||||
a_utf8.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
||||
@@ -640,7 +641,7 @@ t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
|
||||
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
|
||||
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
|
||||
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
|
||||
t_x509.o: ../cryptlib.h asn1_locl.h t_x509.c
|
||||
t_x509.o: ../cryptlib.h t_x509.c
|
||||
t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
|
||||
t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
|
||||
@@ -86,8 +86,7 @@ int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
|
||||
p = str;
|
||||
i2d(data, &p);
|
||||
|
||||
if (!EVP_Digest(str, i, md, len, type, NULL))
|
||||
return 0;
|
||||
EVP_Digest(str, i, md, len, type, NULL);
|
||||
OPENSSL_free(str);
|
||||
return (1);
|
||||
}
|
||||
@@ -104,8 +103,7 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
|
||||
if (!str)
|
||||
return (0);
|
||||
|
||||
if (!EVP_Digest(str, i, md, len, type, NULL))
|
||||
return 0;
|
||||
EVP_Digest(str, i, md, len, type, NULL);
|
||||
OPENSSL_free(str);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
#include "cryptlib.h"
|
||||
#include "o_time.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include "asn1_locl.h"
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -118,7 +117,7 @@ ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,
|
||||
|
||||
#endif
|
||||
|
||||
int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
|
||||
int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
|
||||
{
|
||||
static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 };
|
||||
static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 };
|
||||
@@ -140,8 +139,6 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
|
||||
for (i = 0; i < 7; i++) {
|
||||
if ((i == 6) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) {
|
||||
i++;
|
||||
if (tm)
|
||||
tm->tm_sec = 0;
|
||||
break;
|
||||
}
|
||||
if ((a[o] < '0') || (a[o] > '9'))
|
||||
@@ -158,31 +155,6 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
|
||||
|
||||
if ((n < min[i]) || (n > max[i]))
|
||||
goto err;
|
||||
if (tm) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
tm->tm_year = n * 100 - 1900;
|
||||
break;
|
||||
case 1:
|
||||
tm->tm_year += n;
|
||||
break;
|
||||
case 2:
|
||||
tm->tm_mon = n - 1;
|
||||
break;
|
||||
case 3:
|
||||
tm->tm_mday = n;
|
||||
break;
|
||||
case 4:
|
||||
tm->tm_hour = n;
|
||||
break;
|
||||
case 5:
|
||||
tm->tm_min = n;
|
||||
break;
|
||||
case 6:
|
||||
tm->tm_sec = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Optional fractional seconds: decimal point followed by one or more
|
||||
@@ -202,7 +174,6 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
|
||||
if (a[o] == 'Z')
|
||||
o++;
|
||||
else if ((a[o] == '+') || (a[o] == '-')) {
|
||||
int offsign = a[o] == '-' ? -1 : 1, offset = 0;
|
||||
o++;
|
||||
if (o + 4 > l)
|
||||
goto err;
|
||||
@@ -216,17 +187,9 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
|
||||
n = (n * 10) + a[o] - '0';
|
||||
if ((n < min[i]) || (n > max[i]))
|
||||
goto err;
|
||||
if (tm) {
|
||||
if (i == 7)
|
||||
offset = n * 3600;
|
||||
else if (i == 8)
|
||||
offset += n * 60;
|
||||
}
|
||||
o++;
|
||||
}
|
||||
if (offset && !OPENSSL_gmtime_adj(tm, 0, offset * offsign))
|
||||
return 0;
|
||||
} else if (a[o]) {
|
||||
} else {
|
||||
/* Missing time zone information. */
|
||||
goto err;
|
||||
}
|
||||
@@ -235,11 +198,6 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *d)
|
||||
{
|
||||
return asn1_generalizedtime_to_tm(NULL, d);
|
||||
}
|
||||
|
||||
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
|
||||
{
|
||||
ASN1_GENERALIZEDTIME t;
|
||||
|
||||
@@ -124,6 +124,8 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
|
||||
else {
|
||||
ret = a->length;
|
||||
i = a->data[0];
|
||||
if (ret == 1 && i == 0)
|
||||
neg = 0;
|
||||
if (!neg && (i > 127)) {
|
||||
pad = 1;
|
||||
pb = 0;
|
||||
@@ -162,7 +164,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
|
||||
p += a->length - 1;
|
||||
i = a->length;
|
||||
/* Copy zeros to destination as long as source is zero */
|
||||
while (!*n) {
|
||||
while (!*n && i > 1) {
|
||||
*(p--) = 0;
|
||||
n--;
|
||||
i--;
|
||||
@@ -419,7 +421,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
|
||||
ASN1err(ASN1_F_BN_TO_ASN1_INTEGER, ERR_R_NESTED_ASN1_ERROR);
|
||||
goto err;
|
||||
}
|
||||
if (BN_is_negative(bn))
|
||||
if (BN_is_negative(bn) && !BN_is_zero(bn))
|
||||
ret->type = V_ASN1_NEG_INTEGER;
|
||||
else
|
||||
ret->type = V_ASN1_INTEGER;
|
||||
|
||||
@@ -182,10 +182,10 @@ int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
p = buf_in;
|
||||
|
||||
i2d(data, &p);
|
||||
if (!EVP_SignInit_ex(&ctx, type, NULL)
|
||||
|| !EVP_SignUpdate(&ctx, (unsigned char *)buf_in, inl)
|
||||
|| !EVP_SignFinal(&ctx, (unsigned char *)buf_out,
|
||||
(unsigned int *)&outl, pkey)) {
|
||||
EVP_SignInit_ex(&ctx, type, NULL);
|
||||
EVP_SignUpdate(&ctx, (unsigned char *)buf_in, inl);
|
||||
if (!EVP_SignFinal(&ctx, (unsigned char *)buf_out,
|
||||
(unsigned int *)&outl, pkey)) {
|
||||
outl = 0;
|
||||
ASN1err(ASN1_F_ASN1_SIGN, ERR_R_EVP_LIB);
|
||||
goto err;
|
||||
@@ -221,89 +221,58 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1,
|
||||
EVP_PKEY *pkey, const EVP_MD *type)
|
||||
{
|
||||
EVP_MD_CTX ctx;
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
if (!EVP_DigestSignInit(&ctx, NULL, type, NULL, pkey)) {
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
return 0;
|
||||
}
|
||||
return ASN1_item_sign_ctx(it, algor1, algor2, signature, asn, &ctx);
|
||||
}
|
||||
|
||||
int ASN1_item_sign_ctx(const ASN1_ITEM *it,
|
||||
X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx)
|
||||
{
|
||||
const EVP_MD *type;
|
||||
EVP_PKEY *pkey;
|
||||
unsigned char *buf_in = NULL, *buf_out = NULL;
|
||||
size_t inl = 0, outl = 0, outll = 0;
|
||||
int inl = 0, outl = 0, outll = 0;
|
||||
int signid, paramtype;
|
||||
int rv;
|
||||
|
||||
type = EVP_MD_CTX_md(ctx);
|
||||
pkey = EVP_PKEY_CTX_get0_pkey(ctx->pctx);
|
||||
if (type == NULL) {
|
||||
int def_nid;
|
||||
if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0)
|
||||
type = EVP_get_digestbynid(def_nid);
|
||||
}
|
||||
|
||||
if (!type || !pkey) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_CONTEXT_NOT_INITIALISED);
|
||||
if (type == NULL) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN, ASN1_R_NO_DEFAULT_DIGEST);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pkey->ameth->item_sign) {
|
||||
rv = pkey->ameth->item_sign(ctx, it, asn, algor1, algor2, signature);
|
||||
if (rv == 1)
|
||||
outl = signature->length;
|
||||
/*-
|
||||
* Return value meanings:
|
||||
* <=0: error.
|
||||
* 1: method does everything.
|
||||
* 2: carry on as normal.
|
||||
* 3: ASN1 method sets algorithm identifiers: just sign.
|
||||
*/
|
||||
if (rv <= 0)
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_EVP_LIB);
|
||||
if (rv <= 1)
|
||||
goto err;
|
||||
if (type->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) {
|
||||
if (!pkey->ameth ||
|
||||
!OBJ_find_sigid_by_algs(&signid, EVP_MD_nid(type),
|
||||
pkey->ameth->pkey_id)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN,
|
||||
ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
rv = 2;
|
||||
signid = type->pkey_type;
|
||||
|
||||
if (rv == 2) {
|
||||
if (type->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) {
|
||||
if (!pkey->ameth ||
|
||||
!OBJ_find_sigid_by_algs(&signid,
|
||||
EVP_MD_nid(type),
|
||||
pkey->ameth->pkey_id)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX,
|
||||
ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
signid = type->pkey_type;
|
||||
if (pkey->ameth->pkey_flags & ASN1_PKEY_SIGPARAM_NULL)
|
||||
paramtype = V_ASN1_NULL;
|
||||
else
|
||||
paramtype = V_ASN1_UNDEF;
|
||||
|
||||
if (pkey->ameth->pkey_flags & ASN1_PKEY_SIGPARAM_NULL)
|
||||
paramtype = V_ASN1_NULL;
|
||||
else
|
||||
paramtype = V_ASN1_UNDEF;
|
||||
|
||||
if (algor1)
|
||||
X509_ALGOR_set0(algor1, OBJ_nid2obj(signid), paramtype, NULL);
|
||||
if (algor2)
|
||||
X509_ALGOR_set0(algor2, OBJ_nid2obj(signid), paramtype, NULL);
|
||||
|
||||
}
|
||||
if (algor1)
|
||||
X509_ALGOR_set0(algor1, OBJ_nid2obj(signid), paramtype, NULL);
|
||||
if (algor2)
|
||||
X509_ALGOR_set0(algor2, OBJ_nid2obj(signid), paramtype, NULL);
|
||||
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
inl = ASN1_item_i2d(asn, &buf_in, it);
|
||||
outll = outl = EVP_PKEY_size(pkey);
|
||||
buf_out = OPENSSL_malloc((unsigned int)outl);
|
||||
buf_out = (unsigned char *)OPENSSL_malloc((unsigned int)outl);
|
||||
if ((buf_in == NULL) || (buf_out == NULL)) {
|
||||
outl = 0;
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_MALLOC_FAILURE);
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!EVP_DigestSignUpdate(ctx, buf_in, inl)
|
||||
|| !EVP_DigestSignFinal(ctx, buf_out, &outl)) {
|
||||
EVP_SignInit_ex(&ctx, type, NULL);
|
||||
EVP_SignUpdate(&ctx, (unsigned char *)buf_in, inl);
|
||||
if (!EVP_SignFinal(&ctx, (unsigned char *)buf_out,
|
||||
(unsigned int *)&outl, pkey)) {
|
||||
outl = 0;
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_EVP_LIB);
|
||||
ASN1err(ASN1_F_ASN1_ITEM_SIGN, ERR_R_EVP_LIB);
|
||||
goto err;
|
||||
}
|
||||
if (signature->data != NULL)
|
||||
@@ -318,7 +287,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
|
||||
signature->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07);
|
||||
signature->flags |= ASN1_STRING_FLAG_BITS_LEFT;
|
||||
err:
|
||||
EVP_MD_CTX_cleanup(ctx);
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
if (buf_in != NULL) {
|
||||
OPENSSL_cleanse((char *)buf_in, (unsigned int)inl);
|
||||
OPENSSL_free(buf_in);
|
||||
|
||||
@@ -638,7 +638,6 @@ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
|
||||
mbflag |= MBSTRING_FLAG;
|
||||
stmp.data = NULL;
|
||||
stmp.length = 0;
|
||||
stmp.flags = 0;
|
||||
ret =
|
||||
ASN1_mbstring_copy(&str, in->data, in->length, mbflag,
|
||||
B_ASN1_UTF8STRING);
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
#include "cryptlib.h"
|
||||
#include "o_time.h"
|
||||
#include <openssl/asn1t.h>
|
||||
#include "asn1_locl.h"
|
||||
|
||||
IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME)
|
||||
|
||||
@@ -197,32 +196,3 @@ int ASN1_TIME_set_string(ASN1_TIME *s, const char *str)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *t)
|
||||
{
|
||||
if (t == NULL) {
|
||||
time_t now_t;
|
||||
time(&now_t);
|
||||
if (OPENSSL_gmtime(&now_t, tm))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (t->type == V_ASN1_UTCTIME)
|
||||
return asn1_utctime_to_tm(tm, t);
|
||||
else if (t->type == V_ASN1_GENERALIZEDTIME)
|
||||
return asn1_generalizedtime_to_tm(tm, t);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ASN1_TIME_diff(int *pday, int *psec,
|
||||
const ASN1_TIME *from, const ASN1_TIME *to)
|
||||
{
|
||||
struct tm tm_from, tm_to;
|
||||
if (!asn1_time_to_tm(&tm_from, from))
|
||||
return 0;
|
||||
if (!asn1_time_to_tm(&tm_to, to))
|
||||
return 0;
|
||||
return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,9 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
|
||||
case V_ASN1_OBJECT:
|
||||
result = OBJ_cmp(a->value.object, b->value.object);
|
||||
break;
|
||||
case V_ASN1_BOOLEAN:
|
||||
result = a->value.boolean - b->value.boolean;
|
||||
break;
|
||||
case V_ASN1_NULL:
|
||||
result = 0; /* They do not have content. */
|
||||
break;
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
#include "cryptlib.h"
|
||||
#include "o_time.h"
|
||||
#include <openssl/asn1.h>
|
||||
#include "asn1_locl.h"
|
||||
|
||||
#if 0
|
||||
int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
|
||||
@@ -110,7 +109,7 @@ ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp,
|
||||
|
||||
#endif
|
||||
|
||||
int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d)
|
||||
int ASN1_UTCTIME_check(ASN1_UTCTIME *d)
|
||||
{
|
||||
static const int min[8] = { 0, 1, 1, 0, 0, 0, 0, 0 };
|
||||
static const int max[8] = { 99, 12, 31, 23, 59, 59, 12, 59 };
|
||||
@@ -128,8 +127,6 @@ int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d)
|
||||
for (i = 0; i < 6; i++) {
|
||||
if ((i == 5) && ((a[o] == 'Z') || (a[o] == '+') || (a[o] == '-'))) {
|
||||
i++;
|
||||
if (tm)
|
||||
tm->tm_sec = 0;
|
||||
break;
|
||||
}
|
||||
if ((a[o] < '0') || (a[o] > '9'))
|
||||
@@ -146,33 +143,10 @@ int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d)
|
||||
|
||||
if ((n < min[i]) || (n > max[i]))
|
||||
goto err;
|
||||
if (tm) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
tm->tm_year = n < 50 ? n + 100 : n;
|
||||
break;
|
||||
case 1:
|
||||
tm->tm_mon = n - 1;
|
||||
break;
|
||||
case 2:
|
||||
tm->tm_mday = n;
|
||||
break;
|
||||
case 3:
|
||||
tm->tm_hour = n;
|
||||
break;
|
||||
case 4:
|
||||
tm->tm_min = n;
|
||||
break;
|
||||
case 5:
|
||||
tm->tm_sec = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (a[o] == 'Z')
|
||||
o++;
|
||||
else if ((a[o] == '+') || (a[o] == '-')) {
|
||||
int offsign = a[o] == '-' ? -1 : 1, offset = 0;
|
||||
o++;
|
||||
if (o + 4 > l)
|
||||
goto err;
|
||||
@@ -186,25 +160,12 @@ int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d)
|
||||
n = (n * 10) + a[o] - '0';
|
||||
if ((n < min[i]) || (n > max[i]))
|
||||
goto err;
|
||||
if (tm) {
|
||||
if (i == 6)
|
||||
offset = n * 3600;
|
||||
else if (i == 7)
|
||||
offset += n * 60;
|
||||
}
|
||||
o++;
|
||||
}
|
||||
if (offset && !OPENSSL_gmtime_adj(tm, 0, offset * offsign))
|
||||
return 0;
|
||||
}
|
||||
return o == l;
|
||||
return (o == l);
|
||||
err:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ASN1_UTCTIME_check(const ASN1_UTCTIME *d)
|
||||
{
|
||||
return asn1_utctime_to_tm(NULL, d);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str)
|
||||
@@ -288,26 +249,38 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
|
||||
|
||||
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
|
||||
{
|
||||
struct tm stm, ttm;
|
||||
int day, sec;
|
||||
struct tm *tm;
|
||||
struct tm data;
|
||||
int offset;
|
||||
int year;
|
||||
|
||||
if (!asn1_utctime_to_tm(&stm, s))
|
||||
return -2;
|
||||
#define g2(p) (((p)[0]-'0')*10+(p)[1]-'0')
|
||||
|
||||
if (!OPENSSL_gmtime(&t, &ttm))
|
||||
return -2;
|
||||
if (s->data[12] == 'Z')
|
||||
offset = 0;
|
||||
else {
|
||||
offset = g2(s->data + 13) * 60 + g2(s->data + 15);
|
||||
if (s->data[12] == '-')
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
if (!OPENSSL_gmtime_diff(&day, &sec, &stm, &ttm))
|
||||
return -2;
|
||||
t -= offset * 60; /* FIXME: may overflow in extreme cases */
|
||||
|
||||
tm = OPENSSL_gmtime(&t, &data);
|
||||
|
||||
#define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
|
||||
year = g2(s->data);
|
||||
if (year < 50)
|
||||
year += 100;
|
||||
return_cmp(year, tm->tm_year);
|
||||
return_cmp(g2(s->data + 2) - 1, tm->tm_mon);
|
||||
return_cmp(g2(s->data + 4), tm->tm_mday);
|
||||
return_cmp(g2(s->data + 6), tm->tm_hour);
|
||||
return_cmp(g2(s->data + 8), tm->tm_min);
|
||||
return_cmp(g2(s->data + 10), tm->tm_sec);
|
||||
#undef g2
|
||||
#undef return_cmp
|
||||
|
||||
if (day > 0)
|
||||
return 1;
|
||||
if (day < 0)
|
||||
return -1;
|
||||
if (sec > 0)
|
||||
return 1;
|
||||
if (sec < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,12 +104,8 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
|
||||
p = buf_in;
|
||||
|
||||
i2d(data, &p);
|
||||
if (!EVP_VerifyInit_ex(&ctx, type, NULL)
|
||||
|| !EVP_VerifyUpdate(&ctx, (unsigned char *)buf_in, inl)) {
|
||||
ASN1err(ASN1_F_ASN1_VERIFY, ERR_R_EVP_LIB);
|
||||
ret = 0;
|
||||
goto err;
|
||||
}
|
||||
EVP_VerifyInit_ex(&ctx, type, NULL);
|
||||
EVP_VerifyUpdate(&ctx, (unsigned char *)buf_in, inl);
|
||||
|
||||
OPENSSL_cleanse(buf_in, (unsigned int)inl);
|
||||
OPENSSL_free(buf_in);
|
||||
@@ -137,6 +133,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
|
||||
ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey)
|
||||
{
|
||||
EVP_MD_CTX ctx;
|
||||
const EVP_MD *type = NULL;
|
||||
unsigned char *buf_in = NULL;
|
||||
int ret = -1, inl;
|
||||
|
||||
@@ -159,42 +156,23 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM);
|
||||
goto err;
|
||||
}
|
||||
if (mdnid == NID_undef) {
|
||||
if (!pkey->ameth || !pkey->ameth->item_verify) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY,
|
||||
ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM);
|
||||
goto err;
|
||||
}
|
||||
ret = pkey->ameth->item_verify(&ctx, it, asn, a, signature, pkey);
|
||||
/*
|
||||
* Return value of 2 means carry on, anything else means we exit
|
||||
* straight away: either a fatal error of the underlying verification
|
||||
* routine handles all verification.
|
||||
*/
|
||||
if (ret != 2)
|
||||
goto err;
|
||||
ret = -1;
|
||||
} else {
|
||||
const EVP_MD *type;
|
||||
type = EVP_get_digestbynid(mdnid);
|
||||
if (type == NULL) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY,
|
||||
ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
|
||||
goto err;
|
||||
}
|
||||
type = EVP_get_digestbynid(mdnid);
|
||||
if (type == NULL) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY,
|
||||
ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Check public key OID matches public key type */
|
||||
if (EVP_PKEY_type(pknid) != pkey->ameth->pkey_id) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ASN1_R_WRONG_PUBLIC_KEY_TYPE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!EVP_DigestVerifyInit(&ctx, NULL, type, NULL, pkey)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_EVP_LIB);
|
||||
ret = 0;
|
||||
goto err;
|
||||
}
|
||||
/* Check public key OID matches public key type */
|
||||
if (EVP_PKEY_type(pknid) != pkey->ameth->pkey_id) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ASN1_R_WRONG_PUBLIC_KEY_TYPE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!EVP_VerifyInit_ex(&ctx, type, NULL)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_EVP_LIB);
|
||||
ret = 0;
|
||||
goto err;
|
||||
}
|
||||
|
||||
inl = ASN1_item_i2d(asn, &buf_in, it);
|
||||
@@ -204,17 +182,13 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!EVP_DigestVerifyUpdate(&ctx, buf_in, inl)) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_EVP_LIB);
|
||||
ret = 0;
|
||||
goto err;
|
||||
}
|
||||
EVP_VerifyUpdate(&ctx, (unsigned char *)buf_in, inl);
|
||||
|
||||
OPENSSL_cleanse(buf_in, (unsigned int)inl);
|
||||
OPENSSL_free(buf_in);
|
||||
|
||||
if (EVP_DigestVerifyFinal(&ctx, signature->data,
|
||||
(size_t)signature->length) <= 0) {
|
||||
if (EVP_VerifyFinal(&ctx, (unsigned char *)signature->data,
|
||||
(unsigned int)signature->length, pkey) <= 0) {
|
||||
ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_EVP_LIB);
|
||||
ret = 0;
|
||||
goto err;
|
||||
|
||||
@@ -68,10 +68,8 @@
|
||||
extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[];
|
||||
extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[];
|
||||
extern const EVP_PKEY_ASN1_METHOD dh_asn1_meth;
|
||||
extern const EVP_PKEY_ASN1_METHOD dhx_asn1_meth;
|
||||
extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth;
|
||||
extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth;
|
||||
extern const EVP_PKEY_ASN1_METHOD cmac_asn1_meth;
|
||||
|
||||
/* Keep this sorted in type order !! */
|
||||
static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
|
||||
@@ -92,11 +90,7 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
|
||||
#ifndef OPENSSL_NO_EC
|
||||
&eckey_asn1_meth,
|
||||
#endif
|
||||
&hmac_asn1_meth,
|
||||
&cmac_asn1_meth,
|
||||
#ifndef OPENSSL_NO_DH
|
||||
&dhx_asn1_meth
|
||||
#endif
|
||||
&hmac_asn1_meth
|
||||
};
|
||||
|
||||
typedef int sk_cmp_fn_type(const char *const *a, const char *const *b);
|
||||
@@ -290,8 +284,6 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
|
||||
if (!ameth)
|
||||
return NULL;
|
||||
|
||||
memset(ameth, 0, sizeof(EVP_PKEY_ASN1_METHOD));
|
||||
|
||||
ameth->pkey_id = id;
|
||||
ameth->pkey_base_id = id;
|
||||
ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
|
||||
@@ -322,9 +314,6 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
|
||||
ameth->old_priv_encode = 0;
|
||||
ameth->old_priv_decode = 0;
|
||||
|
||||
ameth->item_verify = 0;
|
||||
ameth->item_sign = 0;
|
||||
|
||||
ameth->pkey_size = 0;
|
||||
ameth->pkey_bits = 0;
|
||||
|
||||
@@ -376,9 +365,6 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
|
||||
dst->pkey_free = src->pkey_free;
|
||||
dst->pkey_ctrl = src->pkey_ctrl;
|
||||
|
||||
dst->item_sign = src->item_sign;
|
||||
dst->item_verify = src->item_verify;
|
||||
|
||||
}
|
||||
|
||||
void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
|
||||
|
||||
@@ -207,13 +207,13 @@ typedef struct asn1_const_ctx_st {
|
||||
# define ASN1_OBJECT_FLAG_CRITICAL 0x02/* critical x509v3 object id */
|
||||
# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
|
||||
# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08/* internal use */
|
||||
struct asn1_object_st {
|
||||
typedef struct asn1_object_st {
|
||||
const char *sn, *ln;
|
||||
int nid;
|
||||
int length;
|
||||
const unsigned char *data; /* data remains const after init */
|
||||
int flags; /* Should we free this one */
|
||||
};
|
||||
} ASN1_OBJECT;
|
||||
|
||||
# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
|
||||
/*
|
||||
@@ -236,7 +236,7 @@ struct asn1_object_st {
|
||||
*/
|
||||
# define ASN1_STRING_FLAG_MSTRING 0x040
|
||||
/* This is the base type that holds just about everything :-) */
|
||||
struct asn1_string_st {
|
||||
typedef struct asn1_string_st {
|
||||
int length;
|
||||
int type;
|
||||
unsigned char *data;
|
||||
@@ -246,7 +246,7 @@ struct asn1_string_st {
|
||||
* non-zero 'unused bits' value, it will be handled correctly
|
||||
*/
|
||||
long flags;
|
||||
};
|
||||
} ASN1_STRING;
|
||||
|
||||
/*
|
||||
* ASN1_ENCODING structure: this is used to save the received encoding of an
|
||||
@@ -294,6 +294,7 @@ DECLARE_STACK_OF(ASN1_STRING_TABLE)
|
||||
* Declarations for template structures: for full definitions see asn1t.h
|
||||
*/
|
||||
typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
|
||||
typedef struct ASN1_ITEM_st ASN1_ITEM;
|
||||
typedef struct ASN1_TLC_st ASN1_TLC;
|
||||
/* This is just an opaque pointer */
|
||||
typedef struct ASN1_VALUE_st ASN1_VALUE;
|
||||
@@ -795,6 +796,7 @@ DECLARE_ASN1_SET_OF(ASN1_OBJECT)
|
||||
|
||||
ASN1_STRING *ASN1_STRING_new(void);
|
||||
void ASN1_STRING_free(ASN1_STRING *a);
|
||||
void ASN1_STRING_clear_free(ASN1_STRING *a);
|
||||
int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
|
||||
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
|
||||
ASN1_STRING *ASN1_STRING_type_new(int type);
|
||||
@@ -842,7 +844,7 @@ int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
|
||||
|
||||
int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
|
||||
int ASN1_UTCTIME_check(ASN1_UTCTIME *a);
|
||||
ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
|
||||
ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
|
||||
int offset_day, long offset_sec);
|
||||
@@ -852,15 +854,13 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
|
||||
time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
|
||||
# endif
|
||||
|
||||
int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
|
||||
int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
time_t t);
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
|
||||
time_t t, int offset_day,
|
||||
long offset_sec);
|
||||
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
|
||||
int ASN1_TIME_diff(int *pday, int *psec,
|
||||
const ASN1_TIME *from, const ASN1_TIME *to);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
|
||||
ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);
|
||||
@@ -1205,7 +1205,6 @@ void ERR_load_ASN1_strings(void);
|
||||
# define ASN1_F_ASN1_ITEM_I2D_FP 193
|
||||
# define ASN1_F_ASN1_ITEM_PACK 198
|
||||
# define ASN1_F_ASN1_ITEM_SIGN 195
|
||||
# define ASN1_F_ASN1_ITEM_SIGN_CTX 220
|
||||
# define ASN1_F_ASN1_ITEM_UNPACK 199
|
||||
# define ASN1_F_ASN1_ITEM_VERIFY 197
|
||||
# define ASN1_F_ASN1_MBSTRING_NCOPY 122
|
||||
@@ -1278,7 +1277,6 @@ void ERR_load_ASN1_strings(void);
|
||||
# define ASN1_F_PKCS5_PBE2_SET_IV 167
|
||||
# define ASN1_F_PKCS5_PBE_SET 202
|
||||
# define ASN1_F_PKCS5_PBE_SET0_ALGOR 215
|
||||
# define ASN1_F_PKCS5_PBKDF2_SET 219
|
||||
# define ASN1_F_SMIME_READ_ASN1 212
|
||||
# define ASN1_F_SMIME_TEXT 213
|
||||
# define ASN1_F_X509_CINF_NEW 168
|
||||
@@ -1304,7 +1302,6 @@ void ERR_load_ASN1_strings(void);
|
||||
# define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
|
||||
# define ASN1_R_BUFFER_TOO_SMALL 107
|
||||
# define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
|
||||
# define ASN1_R_CONTEXT_NOT_INITIALISED 217
|
||||
# define ASN1_R_DATA_IS_WRONG 109
|
||||
# define ASN1_R_DECODE_ERROR 110
|
||||
# define ASN1_R_DECODING_ERROR 111
|
||||
|
||||
@@ -107,7 +107,6 @@ static ERR_STRING_DATA ASN1_str_functs[] = {
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_FP), "ASN1_item_i2d_fp"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_PACK), "ASN1_item_pack"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_SIGN), "ASN1_item_sign"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_SIGN_CTX), "ASN1_item_sign_ctx"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_UNPACK), "ASN1_item_unpack"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_ITEM_VERIFY), "ASN1_item_verify"},
|
||||
{ERR_FUNC(ASN1_F_ASN1_MBSTRING_NCOPY), "ASN1_mbstring_ncopy"},
|
||||
@@ -181,7 +180,6 @@ static ERR_STRING_DATA ASN1_str_functs[] = {
|
||||
{ERR_FUNC(ASN1_F_PKCS5_PBE2_SET_IV), "PKCS5_pbe2_set_iv"},
|
||||
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET), "PKCS5_pbe_set"},
|
||||
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET0_ALGOR), "PKCS5_pbe_set0_algor"},
|
||||
{ERR_FUNC(ASN1_F_PKCS5_PBKDF2_SET), "PKCS5_pbkdf2_set"},
|
||||
{ERR_FUNC(ASN1_F_SMIME_READ_ASN1), "SMIME_read_ASN1"},
|
||||
{ERR_FUNC(ASN1_F_SMIME_TEXT), "SMIME_text"},
|
||||
{ERR_FUNC(ASN1_F_X509_CINF_NEW), "X509_CINF_NEW"},
|
||||
@@ -211,7 +209,6 @@ static ERR_STRING_DATA ASN1_str_reasons[] = {
|
||||
{ERR_REASON(ASN1_R_BUFFER_TOO_SMALL), "buffer too small"},
|
||||
{ERR_REASON(ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),
|
||||
"cipher has no object identifier"},
|
||||
{ERR_REASON(ASN1_R_CONTEXT_NOT_INITIALISED), "context not initialised"},
|
||||
{ERR_REASON(ASN1_R_DATA_IS_WRONG), "data is wrong"},
|
||||
{ERR_REASON(ASN1_R_DECODE_ERROR), "decode error"},
|
||||
{ERR_REASON(ASN1_R_DECODING_ERROR), "decoding error"},
|
||||
|
||||
@@ -74,6 +74,8 @@
|
||||
#define ASN1_GEN_STR(str,val) {str, sizeof(str) - 1, val}
|
||||
|
||||
#define ASN1_FLAG_EXP_MAX 20
|
||||
/* Maximum number of nested sequences */
|
||||
#define ASN1_GEN_SEQ_MAX_DEPTH 50
|
||||
|
||||
/* Input formats */
|
||||
|
||||
@@ -110,13 +112,16 @@ typedef struct {
|
||||
int exp_count;
|
||||
} tag_exp_arg;
|
||||
|
||||
static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
|
||||
int *perr);
|
||||
static int bitstr_cb(const char *elem, int len, void *bitstr);
|
||||
static int asn1_cb(const char *elem, int len, void *bitstr);
|
||||
static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class,
|
||||
int exp_constructed, int exp_pad, int imp_ok);
|
||||
static int parse_tagging(const char *vstart, int vlen, int *ptag,
|
||||
int *pclass);
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf);
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
|
||||
int depth, int *perr);
|
||||
static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype);
|
||||
static int asn1_str2tag(const char *tagstr, int len);
|
||||
|
||||
@@ -132,6 +137,16 @@ ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf)
|
||||
}
|
||||
|
||||
ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
|
||||
{
|
||||
int err = 0;
|
||||
ASN1_TYPE *ret = generate_v3(str, cnf, 0, &err);
|
||||
if (err)
|
||||
ASN1err(ASN1_F_ASN1_GENERATE_V3, err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
|
||||
int *perr)
|
||||
{
|
||||
ASN1_TYPE *ret;
|
||||
tag_exp_arg asn1_tags;
|
||||
@@ -152,17 +167,22 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
|
||||
asn1_tags.imp_class = -1;
|
||||
asn1_tags.format = ASN1_GEN_FORMAT_ASCII;
|
||||
asn1_tags.exp_count = 0;
|
||||
if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0)
|
||||
if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0) {
|
||||
*perr = ASN1_R_UNKNOWN_TAG;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((asn1_tags.utype == V_ASN1_SEQUENCE)
|
||||
|| (asn1_tags.utype == V_ASN1_SET)) {
|
||||
if (!cnf) {
|
||||
ASN1err(ASN1_F_ASN1_GENERATE_V3,
|
||||
ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG);
|
||||
*perr = ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG;
|
||||
return NULL;
|
||||
}
|
||||
ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf);
|
||||
if (depth >= ASN1_GEN_SEQ_MAX_DEPTH) {
|
||||
*perr = ASN1_R_ILLEGAL_NESTED_TAGGING;
|
||||
return NULL;
|
||||
}
|
||||
ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf, depth, perr);
|
||||
} else
|
||||
ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype);
|
||||
|
||||
@@ -279,6 +299,9 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
|
||||
|
||||
int tmp_tag, tmp_class;
|
||||
|
||||
if (elem == NULL)
|
||||
return -1;
|
||||
|
||||
for (i = 0, p = elem; i < len; p++, i++) {
|
||||
/* Look for the ':' in name value pairs */
|
||||
if (*p == ':') {
|
||||
@@ -428,7 +451,8 @@ static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass)
|
||||
|
||||
/* Handle multiple types: SET and SEQUENCE */
|
||||
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
|
||||
static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
|
||||
int depth, int *perr)
|
||||
{
|
||||
ASN1_TYPE *ret = NULL;
|
||||
STACK_OF(ASN1_TYPE) *sk = NULL;
|
||||
@@ -447,7 +471,8 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
|
||||
goto bad;
|
||||
for (i = 0; i < sk_CONF_VALUE_num(sect); i++) {
|
||||
ASN1_TYPE *typ =
|
||||
ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);
|
||||
generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf,
|
||||
depth + 1, perr);
|
||||
if (!typ)
|
||||
goto bad;
|
||||
if (!sk_ASN1_TYPE_push(sk, typ))
|
||||
|
||||
@@ -430,6 +430,13 @@ void ASN1_STRING_free(ASN1_STRING *a)
|
||||
OPENSSL_free(a);
|
||||
}
|
||||
|
||||
void ASN1_STRING_clear_free(ASN1_STRING *a)
|
||||
{
|
||||
if (a && a->data && !(a->flags & ASN1_STRING_FLAG_NDEF))
|
||||
OPENSSL_cleanse(a->data, a->length);
|
||||
ASN1_STRING_free(a);
|
||||
}
|
||||
|
||||
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -59,9 +59,6 @@
|
||||
|
||||
/* Internal ASN1 structures and functions: not for application use */
|
||||
|
||||
int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d);
|
||||
int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d);
|
||||
|
||||
/* ASN1 print context structure */
|
||||
|
||||
struct asn1_pctx_st {
|
||||
@@ -99,21 +96,12 @@ struct evp_pkey_asn1_method_st {
|
||||
int (*param_cmp) (const EVP_PKEY *a, const EVP_PKEY *b);
|
||||
int (*param_print) (BIO *out, const EVP_PKEY *pkey, int indent,
|
||||
ASN1_PCTX *pctx);
|
||||
int (*sig_print) (BIO *out,
|
||||
const X509_ALGOR *sigalg, const ASN1_STRING *sig,
|
||||
int indent, ASN1_PCTX *pctx);
|
||||
void (*pkey_free) (EVP_PKEY *pkey);
|
||||
int (*pkey_ctrl) (EVP_PKEY *pkey, int op, long arg1, void *arg2);
|
||||
/* Legacy functions for old PEM */
|
||||
int (*old_priv_decode) (EVP_PKEY *pkey,
|
||||
const unsigned char **pder, int derlen);
|
||||
int (*old_priv_encode) (const EVP_PKEY *pkey, unsigned char **pder);
|
||||
/* Custom ASN1 signature verification */
|
||||
int (*item_verify) (EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
|
||||
X509_ALGOR *a, ASN1_BIT_STRING *sig, EVP_PKEY *pkey);
|
||||
int (*item_sign) (EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
|
||||
X509_ALGOR *alg1, X509_ALGOR *alg2,
|
||||
ASN1_BIT_STRING *sig);
|
||||
} /* EVP_PKEY_ASN1_METHOD */ ;
|
||||
|
||||
/*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user