Compare commits
1456 Commits
v5.6.6-sta
...
v5.7.2-sta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00e42151ca | ||
|
|
c8aa0fa351 | ||
|
|
203f65a636 | ||
|
|
595e71d7f4 | ||
|
|
e35e713c4a | ||
|
|
780fd98f40 | ||
|
|
c8a9bdbe15 | ||
|
|
88af1a2932 | ||
|
|
d8757a51b3 | ||
|
|
fee9788bb0 | ||
|
|
b948f6797c | ||
|
|
de20bb7ba9 | ||
|
|
d5016d451f | ||
|
|
7ef424b193 | ||
|
|
f8eb0c3776 | ||
|
|
f42fb587a5 | ||
|
|
d4cf93c2cf | ||
|
|
c880fcf822 | ||
|
|
25d52dde3f | ||
|
|
50a7243486 | ||
|
|
fbdb064a4b | ||
|
|
ac52660d5b | ||
|
|
8946e3fb4b | ||
|
|
053170613a | ||
|
|
5ca9b2f8a4 | ||
|
|
44a5e1a398 | ||
|
|
e6fbe25398 | ||
|
|
1fd9f2af91 | ||
|
|
387f36657c | ||
|
|
3e58cfd864 | ||
|
|
fe932b893c | ||
|
|
1c23d2222c | ||
|
|
f7f3ba9c76 | ||
|
|
ba1eedb46b | ||
|
|
d7b0aa92cb | ||
|
|
6409b68b21 | ||
|
|
4ff0af79c7 | ||
|
|
a490d4fdf7 | ||
|
|
5aca239714 | ||
|
|
804f25d76b | ||
|
|
9222cb1304 | ||
|
|
b5206e8504 | ||
|
|
7814e4c264 | ||
|
|
dabfad9f6c | ||
|
|
32066373c2 | ||
|
|
bbf3bb4bf4 | ||
|
|
1e3f623ff3 | ||
|
|
45442db047 | ||
|
|
7dfef18cf4 | ||
|
|
98a5a4c201 | ||
|
|
7faf0dccc7 | ||
|
|
2fd7a2e4ae | ||
|
|
80d4f71eb9 | ||
|
|
4913289ce5 | ||
|
|
864a9d0598 | ||
|
|
2a86ca43f8 | ||
|
|
4dc52484f6 | ||
|
|
85552d0fc8 | ||
|
|
107cc82a06 | ||
|
|
c047e55b92 | ||
|
|
91cad98d67 | ||
|
|
5420c1a081 | ||
|
|
7691bb6a2a | ||
|
|
97adb4be6e | ||
|
|
f66e5a52bd | ||
|
|
6dd43caae9 | ||
|
|
4d56cc1790 | ||
|
|
ae0d40b119 | ||
|
|
4d43dbf83b | ||
|
|
474b8a0673 | ||
|
|
3d7583e743 | ||
|
|
72b6074b93 | ||
|
|
6d0dc7f2e7 | ||
|
|
22abd37408 | ||
|
|
38335f4947 | ||
|
|
263eb6c60f | ||
|
|
f466453d61 | ||
|
|
8bba660f9c | ||
|
|
aa61f98955 | ||
|
|
394948ce94 | ||
|
|
5793f626ac | ||
|
|
b7394274ae | ||
|
|
be68ba4850 | ||
|
|
773451a5dc | ||
|
|
7cd610bc45 | ||
|
|
0900e00ee7 | ||
|
|
75475ae624 | ||
|
|
f1b1483c63 | ||
|
|
a094831e1a | ||
|
|
2312cb4563 | ||
|
|
59c7abf635 | ||
|
|
b4e15d028c | ||
|
|
0cf5421e5a | ||
|
|
7405ea8162 | ||
|
|
c9d83babe0 | ||
|
|
23f796c0b4 | ||
|
|
871dc9c19b | ||
|
|
a1645d684a | ||
|
|
f00e5247bb | ||
|
|
e72db4a306 | ||
|
|
aea32e37a9 | ||
|
|
25b72497d8 | ||
|
|
0303a828ec | ||
|
|
3eda3436d1 | ||
|
|
610af43d03 | ||
|
|
94e031e905 | ||
|
|
8734f1251d | ||
|
|
ac5b81edd1 | ||
|
|
30eb558d58 | ||
|
|
e8c3a7dfce | ||
|
|
1ef9a8fe7c | ||
|
|
8ee01ebaf2 | ||
|
|
63f666a599 | ||
|
|
d545253df7 | ||
|
|
118d2cc8cc | ||
|
|
75d06cd6f3 | ||
|
|
32ca92bd97 | ||
|
|
38c7327660 | ||
|
|
3e3a00dafd | ||
|
|
24291b4147 | ||
|
|
2b0d724a4d | ||
|
|
71be6524f7 | ||
|
|
6f4aa54f5b | ||
|
|
9175355c81 | ||
|
|
d4a90e8a71 | ||
|
|
5efa82a239 | ||
|
|
95cd9c81c8 | ||
|
|
f6f83a20ed | ||
|
|
684fef2429 | ||
|
|
eef20ceb51 | ||
|
|
0cd3bd7ad3 | ||
|
|
1eea3720e3 | ||
|
|
f863513f37 | ||
|
|
187dbd9974 | ||
|
|
c91d306531 | ||
|
|
fbd69f9b48 | ||
|
|
2f379ed322 | ||
|
|
8d77df15ef | ||
|
|
a141041d13 | ||
|
|
87114faa94 | ||
|
|
f3c93a7b57 | ||
|
|
7018f464ee | ||
|
|
8aaf5670f4 | ||
|
|
2c69e4a56b | ||
|
|
5df57207ac | ||
|
|
38089f11cd | ||
|
|
a4ee5af1ed | ||
|
|
a120b83dac | ||
|
|
512b468dbb | ||
|
|
98d2ca1d42 | ||
|
|
3d70fb1d50 | ||
|
|
385a097646 | ||
|
|
fce14ffddb | ||
|
|
88527a3d6e | ||
|
|
8ca8827b58 | ||
|
|
20911f254b | ||
|
|
ae9291f4d3 | ||
|
|
897d55f060 | ||
|
|
d2f4cc9e28 | ||
|
|
b0d0a1afe8 | ||
|
|
372f57e528 | ||
|
|
211742bfe0 | ||
|
|
9f9a82e469 | ||
|
|
845e2f752c | ||
|
|
b7d32d0609 | ||
|
|
d49308e64a | ||
|
|
ac459e3cec | ||
|
|
30dbf7c047 | ||
|
|
202b0a15b4 | ||
|
|
b9e5c0252d | ||
|
|
1b907d05ed | ||
|
|
b3e8f0ad24 | ||
|
|
1753d524d7 | ||
|
|
f7bc78cad0 | ||
|
|
ebca3376ef | ||
|
|
e960a00650 | ||
|
|
fda8b4f64f | ||
|
|
6a29dfc6fb | ||
|
|
8c47e8d6f2 | ||
|
|
d7d8d14e95 | ||
|
|
1c51465584 | ||
|
|
d09f955e6c | ||
|
|
c82230324e | ||
|
|
3d33c78e9d | ||
|
|
467b3cb561 | ||
|
|
ac5cabaac9 | ||
|
|
5a1ac2742c | ||
|
|
71db561c96 | ||
|
|
ef925b8b30 | ||
|
|
68f52cb49a | ||
|
|
3de358ef06 | ||
|
|
d80f05bf77 | ||
|
|
7cc0ac14c4 | ||
|
|
690d8f7f89 | ||
|
|
f3061359d8 | ||
|
|
60ccaf379d | ||
|
|
29df90197e | ||
|
|
b69482ffac | ||
|
|
7ce9ebde15 | ||
|
|
fbb2737c2a | ||
|
|
acd604db3d | ||
|
|
5132a17fab | ||
|
|
b7d0c257e6 | ||
|
|
162dffb463 | ||
|
|
1f75d0e1d7 | ||
|
|
92bbd651b6 | ||
|
|
0de974c3a7 | ||
|
|
d20ac2ce42 | ||
|
|
70d317ec79 | ||
|
|
589353f346 | ||
|
|
18526152fe | ||
|
|
8d63fb5fe5 | ||
|
|
592a4522e1 | ||
|
|
453e2fadc1 | ||
|
|
f3b61487e5 | ||
|
|
b3e795c4a5 | ||
|
|
72243300bf | ||
|
|
ea02fea3ef | ||
|
|
2ab709c89a | ||
|
|
6cb97a7262 | ||
|
|
f231c7be03 | ||
|
|
119d2a5da1 | ||
|
|
55837fa254 | ||
|
|
70fc5c97fb | ||
|
|
7adf0fde8c | ||
|
|
983610ed68 | ||
|
|
5d0b7e0d18 | ||
|
|
0397d90713 | ||
|
|
ede8cde8a7 | ||
|
|
e428c2833b | ||
|
|
2c644eb38a | ||
|
|
04430f55ca | ||
|
|
df44face56 | ||
|
|
eb8f26926d | ||
|
|
514fdfcd43 | ||
|
|
78b056c1b0 | ||
|
|
8763b127d9 | ||
|
|
b2e7707f18 | ||
|
|
c04c7685b1 | ||
|
|
305a754de3 | ||
|
|
d07d4fb8ac | ||
|
|
1f684e62d6 | ||
|
|
c325de993d | ||
|
|
a2e26fb36e | ||
|
|
b4910c4615 | ||
|
|
cfbadc8b07 | ||
|
|
3d374239a1 | ||
|
|
43f4ba91da | ||
|
|
0c0069331b | ||
|
|
4140a05fe4 | ||
|
|
e8e6eaeb4d | ||
|
|
b1146becfd | ||
|
|
6f567b58bc | ||
|
|
15ac366bf9 | ||
|
|
3975af88cf | ||
|
|
bc2b184c98 | ||
|
|
26284e2e5d | ||
|
|
533aa48b14 | ||
|
|
2445fe844a | ||
|
|
4d2ce1131a | ||
|
|
2caee1c7c5 | ||
|
|
ff7626419e | ||
|
|
01a1685159 | ||
|
|
5657d88ddb | ||
|
|
d3a6b71f5f | ||
|
|
40562a0cb3 | ||
|
|
0789ecb808 | ||
|
|
447f73c25e | ||
|
|
4b77d4caa1 | ||
|
|
fc8a509b06 | ||
|
|
f646cbcecb | ||
|
|
7fadd4ed9f | ||
|
|
bb57c1de94 | ||
|
|
af3828b2b7 | ||
|
|
ecef3c214c | ||
|
|
ebdc8b9a32 | ||
|
|
1310c97a22 | ||
|
|
66a5d8cc8a | ||
|
|
107c10d795 | ||
|
|
61fea768b3 | ||
|
|
41cbbfe3ab | ||
|
|
34ca03770f | ||
|
|
52f1caf699 | ||
|
|
095609107d | ||
|
|
23bfb01e54 | ||
|
|
174456437e | ||
|
|
f13a82610c | ||
|
|
a17677c946 | ||
|
|
473de5796c | ||
|
|
284dea43fe | ||
|
|
e620b47e1a | ||
|
|
a4544ce2eb | ||
|
|
af537a6ae3 | ||
|
|
3e9f656ac3 | ||
|
|
0b7f293691 | ||
|
|
cf61df129c | ||
|
|
9673b3f218 | ||
|
|
b00ae2ac69 | ||
|
|
511c403631 | ||
|
|
6cca3a0d92 | ||
|
|
288fe430f5 | ||
|
|
18d80864b9 | ||
|
|
8d41e68d1f | ||
|
|
5306a85465 | ||
|
|
200f309e0e | ||
|
|
021b573027 | ||
|
|
8de00d7651 | ||
|
|
911f21ed36 | ||
|
|
a5154b22f1 | ||
|
|
063e48014a | ||
|
|
9b058ec3a2 | ||
|
|
3b5517692e | ||
|
|
51f19f42c6 | ||
|
|
76e7d8627f | ||
|
|
30eb26bd79 | ||
|
|
3f96d14b32 | ||
|
|
12a5cb45fb | ||
|
|
078fb66b29 | ||
|
|
b8838dca44 | ||
|
|
3670bfb9ae | ||
|
|
d28dd602e5 | ||
|
|
b98e4e0093 | ||
|
|
e05dbd531e | ||
|
|
688ae60cd9 | ||
|
|
ff6e6848de | ||
|
|
40db521f8b | ||
|
|
9a58301ab1 | ||
|
|
023f604213 | ||
|
|
82642c1ee1 | ||
|
|
8a7e3ba52e | ||
|
|
5c497c62e7 | ||
|
|
f2492da6a4 | ||
|
|
14068fb7f3 | ||
|
|
159981f442 | ||
|
|
110f4ec737 | ||
|
|
24f581fe13 | ||
|
|
fe5cc9589b | ||
|
|
1a000ef94c | ||
|
|
52b6c361f9 | ||
|
|
cb0048dbb1 | ||
|
|
425dd1986b | ||
|
|
fe9882769e | ||
|
|
32c5acca22 | ||
|
|
314afc9e10 | ||
|
|
ba5cc9bdaf | ||
|
|
c5ce984966 | ||
|
|
caaa9feb64 | ||
|
|
603b5d1795 | ||
|
|
87b71c429a | ||
|
|
ed321cd640 | ||
|
|
543a746ddc | ||
|
|
84032fa24c | ||
|
|
43b2c80862 | ||
|
|
095906f37a | ||
|
|
7d4e601902 | ||
|
|
a22956d881 | ||
|
|
c6db51b8a0 | ||
|
|
fc172e9abd | ||
|
|
0987bf4c1a | ||
|
|
5a0594d257 | ||
|
|
b8aec63e14 | ||
|
|
d0e73783f1 | ||
|
|
5c6218696b | ||
|
|
22af731dd9 | ||
|
|
8f1029f86d | ||
|
|
2d5e8402e8 | ||
|
|
15af87af8f | ||
|
|
16b39e8374 | ||
|
|
391431c7d8 | ||
|
|
54bf7fd5d9 | ||
|
|
a40dcd3cb3 | ||
|
|
568ec43213 | ||
|
|
95095f5bc4 | ||
|
|
e823da99ae | ||
|
|
9fa838881c | ||
|
|
7782f8eed2 | ||
|
|
c0015cbda6 | ||
|
|
219a338107 | ||
|
|
b866bf6b3d | ||
|
|
6d0f611ab5 | ||
|
|
a8dd736b1e | ||
|
|
e4f20aff8b | ||
|
|
040e0c956a | ||
|
|
dd55542949 | ||
|
|
0aa8e2eee7 | ||
|
|
439d81e0c9 | ||
|
|
74c0d9b9f6 | ||
|
|
f744043db1 | ||
|
|
5f46809988 | ||
|
|
76aba42bfa | ||
|
|
c07f73b1c7 | ||
|
|
12b9367598 | ||
|
|
d9a236ba1e | ||
|
|
fcb5c362f9 | ||
|
|
d9f7629296 | ||
|
|
79595a3602 | ||
|
|
712ff0a58d | ||
|
|
21204244c5 | ||
|
|
55ea3301b2 | ||
|
|
fe7f92c2f1 | ||
|
|
c0e372005b | ||
|
|
931ca9524a | ||
|
|
7f1af2feb3 | ||
|
|
503bbbec8f | ||
|
|
db38351919 | ||
|
|
ca47d492d4 | ||
|
|
abd1e367a5 | ||
|
|
1d1800a3bd | ||
|
|
51f814e6b7 | ||
|
|
1e2fb8f244 | ||
|
|
42feca7028 | ||
|
|
412447ac41 | ||
|
|
287323ab4c | ||
|
|
8ba96e6881 | ||
|
|
76527c3eaa | ||
|
|
0eb11ff466 | ||
|
|
b83d8f0cf6 | ||
|
|
35ef7f4093 | ||
|
|
4e5a98e65d | ||
|
|
fa08e2cb62 | ||
|
|
6719909f4e | ||
|
|
7047991cda | ||
|
|
a9511e118a | ||
|
|
a365d38762 | ||
|
|
82d9a7bbae | ||
|
|
673c5993a7 | ||
|
|
766c3b5ad8 | ||
|
|
49e9c06679 | ||
|
|
fd4db1497f | ||
|
|
ac7aea9674 | ||
|
|
4481f9b626 | ||
|
|
9166c1aa1c | ||
|
|
b156a51e82 | ||
|
|
9aeef1d857 | ||
|
|
2f24b35ab1 | ||
|
|
de0a492499 | ||
|
|
c73e4333bf | ||
|
|
9c4c9234b1 | ||
|
|
d522feb1cd | ||
|
|
958b5ac465 | ||
|
|
eb24bce93f | ||
|
|
b25a4f1082 | ||
|
|
1024d7a809 | ||
|
|
92806a61c0 | ||
|
|
1469aab109 | ||
|
|
4331bc092b | ||
|
|
2fe366cc74 | ||
|
|
8392748cda | ||
|
|
4f1f7b3a4d | ||
|
|
643f472cfb | ||
|
|
f874d8753d | ||
|
|
9e06524c6f | ||
|
|
3ad5ec4e0a | ||
|
|
70d7b6e48b | ||
|
|
676dfb7edb | ||
|
|
b63f308812 | ||
|
|
36754683d6 | ||
|
|
6d1416d006 | ||
|
|
28bd4ebeea | ||
|
|
7526f527d1 | ||
|
|
a1797f0d0d | ||
|
|
a59a3d109f | ||
|
|
12768cdf57 | ||
|
|
bf92797cbc | ||
|
|
0bf69e240a | ||
|
|
702b6c25d5 | ||
|
|
692a7d55ff | ||
|
|
affd0a318e | ||
|
|
0e2bb28ff3 | ||
|
|
1ee315bbab | ||
|
|
e1274013d8 | ||
|
|
fe5e5955bd | ||
|
|
1c4479867e | ||
|
|
a950e90215 | ||
|
|
8ee7c36bb1 | ||
|
|
b7eca574bb | ||
|
|
f24ebdde25 | ||
|
|
009ea6640b | ||
|
|
f4275d53c4 | ||
|
|
6b79e5380d | ||
|
|
44ec470df0 | ||
|
|
7cce5684e6 | ||
|
|
29f7578a61 | ||
|
|
e5a0c0d5bf | ||
|
|
4b81a99f91 | ||
|
|
1be10fddba | ||
|
|
4eab5267f1 | ||
|
|
56129bd160 | ||
|
|
a9164293c2 | ||
|
|
568fda0e8b | ||
|
|
d39ab765f6 | ||
|
|
81c22128e3 | ||
|
|
0d996f4e5f | ||
|
|
1faa70c128 | ||
|
|
9ac6bdd438 | ||
|
|
c5773f5f26 | ||
|
|
f73a9f0d4f | ||
|
|
239706615c | ||
|
|
d68f3cf63c | ||
|
|
98a19f9fdd | ||
|
|
de3d1a488d | ||
|
|
add7428d1c | ||
|
|
b87b521044 | ||
|
|
cb689104d1 | ||
|
|
2335eb6bc6 | ||
|
|
2ed2da0a8f | ||
|
|
b62e8c1467 | ||
|
|
ab03324dc7 | ||
|
|
611a1642a1 | ||
|
|
f7e1e370a0 | ||
|
|
10b31cc481 | ||
|
|
af928faca7 | ||
|
|
d53abc2e37 | ||
|
|
ac17616873 | ||
|
|
5a784c818d | ||
|
|
76b302381b | ||
|
|
5ceb992035 | ||
|
|
bc8664164b | ||
|
|
2508c9e1f4 | ||
|
|
d6291522b9 | ||
|
|
0f06faf3d4 | ||
|
|
8f9c8a1203 | ||
|
|
df425b306f | ||
|
|
86c120a3f0 | ||
|
|
16ec3e52b7 | ||
|
|
433f3ae0b9 | ||
|
|
a987e76677 | ||
|
|
6b47ebd66a | ||
|
|
020bcd0043 | ||
|
|
66f72a258f | ||
|
|
77a7297c42 | ||
|
|
06798ab8bf | ||
|
|
52861cbdbf | ||
|
|
95e9806e9e | ||
|
|
97110700b2 | ||
|
|
33817747c4 | ||
|
|
14ce8ce198 | ||
|
|
b0c991eeb2 | ||
|
|
589bdba256 | ||
|
|
77a6481d65 | ||
|
|
d7361b3677 | ||
|
|
8d8f4d4e1e | ||
|
|
cbd490d1d7 | ||
|
|
550d9ad9a4 | ||
|
|
7ed5e0b3ba | ||
|
|
2ffb5cc16c | ||
|
|
4e6a34504d | ||
|
|
95abc1074b | ||
|
|
7bc73d351f | ||
|
|
7206508329 | ||
|
|
e90c6bcd24 | ||
|
|
195bbcc315 | ||
|
|
081731be8b | ||
|
|
4ddba7ac8a | ||
|
|
e47f1d4190 | ||
|
|
b88803cbb3 | ||
|
|
d22991bb03 | ||
|
|
0c1d583ab4 | ||
|
|
51b85ee1e3 | ||
|
|
75b178f666 | ||
|
|
b61a6baf2b | ||
|
|
ba89e0786d | ||
|
|
678038a077 | ||
|
|
5905f9289d | ||
|
|
866468ec2c | ||
|
|
a25644c379 | ||
|
|
7f6f824594 | ||
|
|
c3131b3234 | ||
|
|
3afa420c31 | ||
|
|
1ddc552828 | ||
|
|
e45686cce9 | ||
|
|
840d1e9fac | ||
|
|
fa30d3ae0b | ||
|
|
aab97fe9e2 | ||
|
|
db6b1388ce | ||
|
|
4594151588 | ||
|
|
72d49964b9 | ||
|
|
2a125ad304 | ||
|
|
76e478ad8d | ||
|
|
5aa39a6397 | ||
|
|
256d81795a | ||
|
|
6be55269db | ||
|
|
f6ae432be1 | ||
|
|
216925a946 | ||
|
|
eaa5edb65b | ||
|
|
529b6a1eb9 | ||
|
|
f18633a000 | ||
|
|
d4b265e84c | ||
|
|
6b1e6e3ef9 | ||
|
|
07de40e4bd | ||
|
|
980e26da63 | ||
|
|
0d86137317 | ||
|
|
068a3b5e99 | ||
|
|
5cc05956d5 | ||
|
|
bb4c2cbad6 | ||
|
|
5af0b1e83b | ||
|
|
b90035d7b0 | ||
|
|
13f83045a4 | ||
|
|
aa1f253a8a | ||
|
|
41eaa8466d | ||
|
|
e96a65a93d | ||
|
|
bd9a27a39b | ||
|
|
393bf4a8e2 | ||
|
|
7260cc124c | ||
|
|
885497ba5a | ||
|
|
0566584191 | ||
|
|
326fd87b4f | ||
|
|
3f8e33369c | ||
|
|
4184b0e4f3 | ||
|
|
65649b63d1 | ||
|
|
4cc27fa58b | ||
|
|
2496cc0c21 | ||
|
|
d23994862c | ||
|
|
c1f23cc505 | ||
|
|
21058820fb | ||
|
|
2328270222 | ||
|
|
49952a97d7 | ||
|
|
e1bd4dd1ec | ||
|
|
e41454004e | ||
|
|
442d3f30cc | ||
|
|
185f35287e | ||
|
|
59290cd066 | ||
|
|
963e14a1fe | ||
|
|
8e8e9bd0eb | ||
|
|
460991a6f0 | ||
|
|
c8e51112c3 | ||
|
|
5ee0e34d89 | ||
|
|
54022b146b | ||
|
|
7881f4e04c | ||
|
|
e22ae7a1f8 | ||
|
|
039fd26baf | ||
|
|
9ac918c0d4 | ||
|
|
2fb70b260b | ||
|
|
7485e9935d | ||
|
|
c62faa048c | ||
|
|
d61fec5af9 | ||
|
|
7644d792b6 | ||
|
|
e862c85db4 | ||
|
|
565058370f | ||
|
|
329650fb4c | ||
|
|
24eed7de34 | ||
|
|
e36df36f84 | ||
|
|
6e49aa7543 | ||
|
|
c26f4041c6 | ||
|
|
7f19be05bd | ||
|
|
9d7913508b | ||
|
|
4a1df83b6f | ||
|
|
80d21f10c6 | ||
|
|
690671d447 | ||
|
|
094ddb62c2 | ||
|
|
a75c2befb5 | ||
|
|
bc00c95fe5 | ||
|
|
5d9154e8c6 | ||
|
|
c3d9fb61a8 | ||
|
|
eb125851cd | ||
|
|
3a89c452b3 | ||
|
|
0b5c83f589 | ||
|
|
7a0bcb05fb | ||
|
|
15a0ae4244 | ||
|
|
7481644842 | ||
|
|
2168b154b6 | ||
|
|
b17ad46b30 | ||
|
|
44e8f392ae | ||
|
|
5bb22d8343 | ||
|
|
e1b66ca62d | ||
|
|
cfe645ca70 | ||
|
|
eeadb2a7f3 | ||
|
|
0a4eb1fbc7 | ||
|
|
eafa425019 | ||
|
|
78670f5098 | ||
|
|
4b1edc78bb | ||
|
|
acc6ff84d8 | ||
|
|
9bc0e31a32 | ||
|
|
e835517633 | ||
|
|
69be7a7c54 | ||
|
|
a63ff277ed | ||
|
|
39e2405e2f | ||
|
|
5f9ed54aaa | ||
|
|
c7f852fbbd | ||
|
|
9242f611b2 | ||
|
|
7b22681287 | ||
|
|
0264a518e1 | ||
|
|
28480ec0ea | ||
|
|
85f3fb9d07 | ||
|
|
d2b9a365f2 | ||
|
|
97d560d9af | ||
|
|
7a7af18887 | ||
|
|
85326da7fc | ||
|
|
fe671f72e1 | ||
|
|
ef153101b7 | ||
|
|
9666e4d7e4 | ||
|
|
e48f06bd53 | ||
|
|
a1cf316630 | ||
|
|
295033441c | ||
|
|
38dc4f299c | ||
|
|
0bd5967093 | ||
|
|
08b42b7c93 | ||
|
|
dab6726e58 | ||
|
|
436efb0078 | ||
|
|
41f31f4635 | ||
|
|
58167a2ebb | ||
|
|
6e3a9d5447 | ||
|
|
c2e60d523f | ||
|
|
593cb77e51 | ||
|
|
804cf1c3b7 | ||
|
|
b184cdf7b5 | ||
|
|
c1dbbcc81e | ||
|
|
c590fe514f | ||
|
|
3df11e7eab | ||
|
|
fac834c80a | ||
|
|
d0edb3d0a9 | ||
|
|
855175da47 | ||
|
|
9f55dba2f2 | ||
|
|
b2f594e84b | ||
|
|
03ed52bd81 | ||
|
|
1f61ed3536 | ||
|
|
73a85af9b9 | ||
|
|
52a593c883 | ||
|
|
8e9810e87e | ||
|
|
9b92aea245 | ||
|
|
281c2a431e | ||
|
|
6e0a90190f | ||
|
|
be74cb7d94 | ||
|
|
1cb34a8bed | ||
|
|
3742c4dd57 | ||
|
|
3113e6c855 | ||
|
|
7d0ce39408 | ||
|
|
77bbb35830 | ||
|
|
85765b1a57 | ||
|
|
6ae99485a1 | ||
|
|
5e85adee0f | ||
|
|
8b656d5a5f | ||
|
|
73e5303718 | ||
|
|
29a41d5ff9 | ||
|
|
b1261f5471 | ||
|
|
954005af9a | ||
|
|
ff09f418c0 | ||
|
|
264dcd4e15 | ||
|
|
4a8443f0e4 | ||
|
|
8b3fbe47e6 | ||
|
|
36b47d1374 | ||
|
|
b48b5c47f4 | ||
|
|
2aae5eb0f5 | ||
|
|
55fc9c09e4 | ||
|
|
455f1a6875 | ||
|
|
a8415a7926 | ||
|
|
b8d31b042f | ||
|
|
71e83cdd19 | ||
|
|
0d83d0d199 | ||
|
|
e45867bbc3 | ||
|
|
a3413ad009 | ||
|
|
ef2a636610 | ||
|
|
afeb3f5358 | ||
|
|
d40700b93d | ||
|
|
84e5ccece5 | ||
|
|
8485f88688 | ||
|
|
2e63ae750d | ||
|
|
8092104396 | ||
|
|
b7d88e0852 | ||
|
|
84f5b4e5bf | ||
|
|
829d028d98 | ||
|
|
4df091ae2a | ||
|
|
81f5ac7f6c | ||
|
|
dd79ca5d96 | ||
|
|
144ffdc713 | ||
|
|
4a069ee5c1 | ||
|
|
707e60aa79 | ||
|
|
d96e5ec589 | ||
|
|
d1efccd259 | ||
|
|
a518f493b5 | ||
|
|
7d66cc46ff | ||
|
|
2ba12a89df | ||
|
|
cf2f58bfdf | ||
|
|
3908bc34ed | ||
|
|
d0802335a8 | ||
|
|
97e731f27b | ||
|
|
cdf2504612 | ||
|
|
9d56484d33 | ||
|
|
5cab707d8e | ||
|
|
9542843874 | ||
|
|
ae2a92e449 | ||
|
|
42f7be20c8 | ||
|
|
63547d954a | ||
|
|
be72849d48 | ||
|
|
6c029badcc | ||
|
|
747755b3c4 | ||
|
|
0c22f1f048 | ||
|
|
8b587b563c | ||
|
|
8511b2dc6b | ||
|
|
79abae8c3d | ||
|
|
57603823e3 | ||
|
|
f6a24efe23 | ||
|
|
9bfab33726 | ||
|
|
d7c6d7af44 | ||
|
|
c768f76d5a | ||
|
|
75da69911c | ||
|
|
983616afa0 | ||
|
|
04ebc966d0 | ||
|
|
d4f5825fd2 | ||
|
|
ed4f052215 | ||
|
|
b334750bf2 | ||
|
|
598a3bfdcd | ||
|
|
b65e42bf4d | ||
|
|
e072677379 | ||
|
|
790129ee71 | ||
|
|
092dba4593 | ||
|
|
10d210ce26 | ||
|
|
2d532dd6b8 | ||
|
|
6524fbb43f | ||
|
|
3a3a7c2a67 | ||
|
|
6a4d4bf6f1 | ||
|
|
8f599defe0 | ||
|
|
2f3495f286 | ||
|
|
e4b7857e43 | ||
|
|
136eaae4f1 | ||
|
|
da6a11d1d1 | ||
|
|
78b8ea3646 | ||
|
|
d930825a92 | ||
|
|
d8e9e90f9d | ||
|
|
03d7eac9c4 | ||
|
|
5c486cb7a6 | ||
|
|
a0f3933881 | ||
|
|
038be95a4a | ||
|
|
3f3dd4743a | ||
|
|
1caed2139b | ||
|
|
7e8c0156fe | ||
|
|
5b3772c5d2 | ||
|
|
83dc3dfac1 | ||
|
|
58462840c1 | ||
|
|
f2e6f49721 | ||
|
|
7c0423eb65 | ||
|
|
7a283edd68 | ||
|
|
5bffbdb20c | ||
|
|
4cb176ffff | ||
|
|
6cc32e90b0 | ||
|
|
254eb23443 | ||
|
|
04db5baaa1 | ||
|
|
6272465c44 | ||
|
|
f63501f035 | ||
|
|
30189e5766 | ||
|
|
71e52487bf | ||
|
|
76ac4fa7e3 | ||
|
|
9cd614fcac | ||
|
|
4f51183b45 | ||
|
|
305f87561d | ||
|
|
fb784a2ac9 | ||
|
|
0bd8775eae | ||
|
|
d9d3f9a4f4 | ||
|
|
716870cbc2 | ||
|
|
42a0cb23ac | ||
|
|
2f17b756b2 | ||
|
|
98c912c3a0 | ||
|
|
0f6670a437 | ||
|
|
ad74fb79ac | ||
|
|
e8e3e9db43 | ||
|
|
f9b26d8c06 | ||
|
|
708fd6003f | ||
|
|
2d7f9d1874 | ||
|
|
28a88d1c7c | ||
|
|
0a03940f5a | ||
|
|
01ae240fe8 | ||
|
|
22766578fc | ||
|
|
bf9775831f | ||
|
|
91ab6cafe0 | ||
|
|
d4b1995a2c | ||
|
|
0abb381497 | ||
|
|
d867405ffb | ||
|
|
4d4f4e3f30 | ||
|
|
8970ff4c34 | ||
|
|
85601311a2 | ||
|
|
b8bebd6196 | ||
|
|
e20ddc35b0 | ||
|
|
e80deece82 | ||
|
|
e5914effab | ||
|
|
5884f75cbe | ||
|
|
3129e29a19 | ||
|
|
6462986bf2 | ||
|
|
5e45bb4d25 | ||
|
|
face8b6e43 | ||
|
|
9bddddb952 | ||
|
|
489a79ad8b | ||
|
|
228544c31e | ||
|
|
1926e045f3 | ||
|
|
790e39ec03 | ||
|
|
a14edf3614 | ||
|
|
d51bef3d43 | ||
|
|
b9619c3f0b | ||
|
|
50b1044c2f | ||
|
|
4751af9b89 | ||
|
|
42091b8970 | ||
|
|
74d7696e69 | ||
|
|
ffb43d0150 | ||
|
|
69bc5c1c19 | ||
|
|
03e306a98f | ||
|
|
85c22abe4e | ||
|
|
737fa53636 | ||
|
|
dd6db025e3 | ||
|
|
36e67af0f8 | ||
|
|
d6b4b27cd1 | ||
|
|
44f3e4a3b7 | ||
|
|
635d326812 | ||
|
|
be233fc805 | ||
|
|
638d0b1a9f | ||
|
|
84c42f4a4e | ||
|
|
763c4a074c | ||
|
|
d71776aced | ||
|
|
abd7449f27 | ||
|
|
5106cb16e2 | ||
|
|
99dd8a333d | ||
|
|
924887b468 | ||
|
|
3728cd3dc5 | ||
|
|
5a5648a6ac | ||
|
|
ab8f5f71a0 | ||
|
|
2f43cc1c7b | ||
|
|
8d1714a307 | ||
|
|
81c5cf794c | ||
|
|
d1b16f2c7b | ||
|
|
8684caa304 | ||
|
|
e3fc43c3d6 | ||
|
|
25efe6b66a | ||
|
|
a0befd396f | ||
|
|
b7b6752e2e | ||
|
|
36eec68571 | ||
|
|
5dff8aa417 | ||
|
|
8fd8548142 | ||
|
|
88370d8c3e | ||
|
|
3fd6af0cd2 | ||
|
|
3ba5dd3e6d | ||
|
|
bebfb120d7 | ||
|
|
25b2c664f4 | ||
|
|
40681226aa | ||
|
|
448378ce90 | ||
|
|
924c0fd911 | ||
|
|
6f65d6749a | ||
|
|
c8bc74b232 | ||
|
|
9057e8120d | ||
|
|
9f240bb34c | ||
|
|
ff14aa20a6 | ||
|
|
5c3b929d90 | ||
|
|
1e054b9613 | ||
|
|
d2fd937075 | ||
|
|
ce52a68c3d | ||
|
|
084338dde7 | ||
|
|
5dba7d3975 | ||
|
|
bd20640e58 | ||
|
|
5d418d67b0 | ||
|
|
0e15a2e83a | ||
|
|
0c40fb5c5f | ||
|
|
9fadcb2edc | ||
|
|
8298019a85 | ||
|
|
83cddc76ce | ||
|
|
b5633f9cea | ||
|
|
11303ab796 | ||
|
|
56f3c93272 | ||
|
|
082397adda | ||
|
|
b17db818ce | ||
|
|
98f8329bf2 | ||
|
|
8fcb007301 | ||
|
|
5daf5fff86 | ||
|
|
28e8228744 | ||
|
|
c24b187a88 | ||
|
|
a07d92d3d3 | ||
|
|
c568e3c092 | ||
|
|
77a77a9a9d | ||
|
|
38d5eec445 | ||
|
|
faea635ee2 | ||
|
|
6c8df33191 | ||
|
|
f011012d8e | ||
|
|
b7c36fa603 | ||
|
|
e40eb3c774 | ||
|
|
a0a9680325 | ||
|
|
39ad67607e | ||
|
|
21b82a20d5 | ||
|
|
ea9dfecc79 | ||
|
|
5408118582 | ||
|
|
321a72c906 | ||
|
|
d057f10d58 | ||
|
|
86b663d67e | ||
|
|
11c9035a62 | ||
|
|
ee39a8f17f | ||
|
|
39002d82b4 | ||
|
|
61749a0171 | ||
|
|
30366a9c03 | ||
|
|
ee3aff1258 | ||
|
|
717a32808f | ||
|
|
089e57371f | ||
|
|
b42a8b6c5d | ||
|
|
d81a08a03b | ||
|
|
2708062d39 | ||
|
|
f05e47bc09 | ||
|
|
66f419bd18 | ||
|
|
88f07773d2 | ||
|
|
7fbb209684 | ||
|
|
efda4b5435 | ||
|
|
a59080a858 | ||
|
|
cf733c306c | ||
|
|
4a167e9834 | ||
|
|
b1edb08119 | ||
|
|
4270f8cda3 | ||
|
|
7c836c8371 | ||
|
|
86966f62c7 | ||
|
|
065bfb0172 | ||
|
|
897a8419c1 | ||
|
|
90b28b5cef | ||
|
|
05138154a9 | ||
|
|
95eb17944c | ||
|
|
fbf1b783da | ||
|
|
c32d9c826c | ||
|
|
52f003f5fc | ||
|
|
67d4019058 | ||
|
|
d1e62b3ff2 | ||
|
|
03f9b210d7 | ||
|
|
032a0405e4 | ||
|
|
b3c276bf0b | ||
|
|
dfbde4514b | ||
|
|
90baf1aadc | ||
|
|
c24add5da9 | ||
|
|
9addb3e45d | ||
|
|
1768b03ecd | ||
|
|
403fcc5a4b | ||
|
|
b53cc0e98c | ||
|
|
8a6c6ebfd5 | ||
|
|
6500444b26 | ||
|
|
daf43cd04f | ||
|
|
af31fbc840 | ||
|
|
e64a26d6ae | ||
|
|
3c6651e1e2 | ||
|
|
26c5c6f93c | ||
|
|
55421a11b9 | ||
|
|
c5a5acd26f | ||
|
|
34b4066d2f | ||
|
|
eeda0caeb9 | ||
|
|
9eac8cb41f | ||
|
|
2044d6b7dd | ||
|
|
10740abf9b | ||
|
|
0775baa2e1 | ||
|
|
a77c6d1fa0 | ||
|
|
1a5064cf8c | ||
|
|
2f6cd765f1 | ||
|
|
aa444c1b2c | ||
|
|
2364b699ff | ||
|
|
06469a43bc | ||
|
|
4055b0d832 | ||
|
|
cd0301fc66 | ||
|
|
8a68e6aaa1 | ||
|
|
6f281d7e72 | ||
|
|
162d4dc483 | ||
|
|
f1afa7eaff | ||
|
|
9e4887bcf4 | ||
|
|
e74d3e126e | ||
|
|
2ee47eac4d | ||
|
|
3ad836ab47 | ||
|
|
d027b305ab | ||
|
|
88e7d47930 | ||
|
|
5aa06c26ff | ||
|
|
00c3f5be2e | ||
|
|
fd2b80ec22 | ||
|
|
09de233fc0 | ||
|
|
aa19d8221e | ||
|
|
4caef93346 | ||
|
|
73a6935386 | ||
|
|
af2b2dddb4 | ||
|
|
757fcbcc25 | ||
|
|
565a4e6773 | ||
|
|
8d894fb01b | ||
|
|
7f18338322 | ||
|
|
52f4dcd7aa | ||
|
|
e4ea2651a3 | ||
|
|
af620513f1 | ||
|
|
815c290293 | ||
|
|
3676dc02a6 | ||
|
|
44e0ee1ecd | ||
|
|
92b8196059 | ||
|
|
469760e186 | ||
|
|
44de6dfdd3 | ||
|
|
98e328dafc | ||
|
|
6537c7163c | ||
|
|
72d8acf5aa | ||
|
|
d34b254247 | ||
|
|
f0a162c265 | ||
|
|
c8f3a8f14b | ||
|
|
4cc960787f | ||
|
|
71fd4782c0 | ||
|
|
585f0f1956 | ||
|
|
b87f544af6 | ||
|
|
152c8565b9 | ||
|
|
d39cf1e499 | ||
|
|
6dc6d58c04 | ||
|
|
375415d042 | ||
|
|
c119826e75 | ||
|
|
3b6a7691c5 | ||
|
|
6f88ed0901 | ||
|
|
c8d0bb0bd8 | ||
|
|
e28d6a7b71 | ||
|
|
94680991a9 | ||
|
|
68fb183fa6 | ||
|
|
9b7decada0 | ||
|
|
2ebc897e31 | ||
|
|
2b9e9955c3 | ||
|
|
f031d034df | ||
|
|
c17fb7498b | ||
|
|
06f04def1b | ||
|
|
7b0fefbceb | ||
|
|
e923d4c151 | ||
|
|
83ae7245b0 | ||
|
|
9a08296fa0 | ||
|
|
d5142d8553 | ||
|
|
9f0aa38120 | ||
|
|
2e970f53c5 | ||
|
|
13021708d4 | ||
|
|
c1931f78de | ||
|
|
63fe12efe3 | ||
|
|
bd32dfd282 | ||
|
|
d34cf39206 | ||
|
|
6146485d2a | ||
|
|
91681f378f | ||
|
|
e4b1e54235 | ||
|
|
bf29066d70 | ||
|
|
340e22a6e4 | ||
|
|
d0fd0a287b | ||
|
|
f5670082b6 | ||
|
|
16c74a31b2 | ||
|
|
16b40b2f75 | ||
|
|
14830d0e09 | ||
|
|
de0d1ea1e7 | ||
|
|
7365c3c6ba | ||
|
|
5b5f0ff32c | ||
|
|
9147a7254b | ||
|
|
24c30d90e7 | ||
|
|
e078e74011 | ||
|
|
271462128d | ||
|
|
7e142583c6 | ||
|
|
dec4caa98f | ||
|
|
91e1fe4496 | ||
|
|
538ade105c | ||
|
|
fff4effe31 | ||
|
|
10b5c375ef | ||
|
|
8853096290 | ||
|
|
c69442375b | ||
|
|
735fbc7cee | ||
|
|
4244fe9ff4 | ||
|
|
bdc0b80ddb | ||
|
|
4d842f094e | ||
|
|
86b1aae218 | ||
|
|
d36bd47a27 | ||
|
|
48e40b8d8e | ||
|
|
8665295573 | ||
|
|
1356e079f1 | ||
|
|
2b33079d50 | ||
|
|
9060da42a6 | ||
|
|
9ea52c3a51 | ||
|
|
5c421d0207 | ||
|
|
9b697a5315 | ||
|
|
54b562f501 | ||
|
|
8bddeb10c7 | ||
|
|
83169f91e9 | ||
|
|
3a280e8295 | ||
|
|
ca726e97f8 | ||
|
|
d111d7da1b | ||
|
|
851f059023 | ||
|
|
4ed197d487 | ||
|
|
866992151b | ||
|
|
7823acbbde | ||
|
|
13e427433c | ||
|
|
7592559fd3 | ||
|
|
d1e0b37467 | ||
|
|
6230c29194 | ||
|
|
31bfac43ea | ||
|
|
32aecf4c35 | ||
|
|
5b5d6481de | ||
|
|
188a69e649 | ||
|
|
be90fe073e | ||
|
|
7ebb8cd007 | ||
|
|
d3b0a26b3b | ||
|
|
c8b0aac144 | ||
|
|
10645de648 | ||
|
|
791c9e7aba | ||
|
|
63f7298be2 | ||
|
|
ed4b87eb37 | ||
|
|
5fbadbb215 | ||
|
|
8d0dc7a568 | ||
|
|
bf23357c8c | ||
|
|
c843064681 | ||
|
|
75762d44b6 | ||
|
|
ee0e25de5f | ||
|
|
335c51987e | ||
|
|
f9bf96d9ba | ||
|
|
1fda249468 | ||
|
|
f48eb638da | ||
|
|
3064d725b9 | ||
|
|
dfc10741a5 | ||
|
|
65902308e8 | ||
|
|
75bd1af110 | ||
|
|
9e47703402 | ||
|
|
e1ee5e4421 | ||
|
|
f228a85cee | ||
|
|
7ddf20851d | ||
|
|
48b99b0f10 | ||
|
|
492490f7e6 | ||
|
|
f7507f14cb | ||
|
|
3d3c07944e | ||
|
|
67bbe1e1bb | ||
|
|
11e8a89f67 | ||
|
|
6261108d49 | ||
|
|
de91add3d9 | ||
|
|
920abd8b46 | ||
|
|
de4a6f9e00 | ||
|
|
154841a083 | ||
|
|
a6326bd80a | ||
|
|
60de159707 | ||
|
|
13591dcae8 | ||
|
|
856c9a9a7f | ||
|
|
1fc67183a5 | ||
|
|
4585c6d508 | ||
|
|
957fc7460c | ||
|
|
8ae031a5ed | ||
|
|
82d94dab68 | ||
|
|
a0415ce855 | ||
|
|
b1e5d0f9bb | ||
|
|
947528ee16 | ||
|
|
39c74a9bf8 | ||
|
|
ec60f91b4a | ||
|
|
1f4cf4188d | ||
|
|
6e559ed015 | ||
|
|
fe87f16114 | ||
|
|
3db58af4f8 | ||
|
|
72e34a829a | ||
|
|
db3873ff40 | ||
|
|
5b3ba8f4bb | ||
|
|
6dab75368d | ||
|
|
ac6181d7ae | ||
|
|
578735e06c | ||
|
|
a13d107db4 | ||
|
|
4c7f038149 | ||
|
|
4971b9a567 | ||
|
|
4f1d777090 | ||
|
|
a5961907b0 | ||
|
|
7305583f72 | ||
|
|
199a5476ec | ||
|
|
999f84518c | ||
|
|
00f4afb5ea | ||
|
|
478c0633e7 | ||
|
|
fa87e227b4 | ||
|
|
3cbffd33b1 | ||
|
|
1574de1008 | ||
|
|
938698ec6b | ||
|
|
78f7454043 | ||
|
|
3b20f49544 | ||
|
|
92d7815b5c | ||
|
|
916c22e021 | ||
|
|
3d62896137 | ||
|
|
dcc946575b | ||
|
|
b0de0a1c95 | ||
|
|
920aaebed7 | ||
|
|
eb1fff3ad3 | ||
|
|
f2a76a0630 | ||
|
|
5c75ca539e | ||
|
|
0c150d2391 | ||
|
|
12dafec3aa | ||
|
|
2617669302 | ||
|
|
ccbb726859 | ||
|
|
fc7143a8f4 | ||
|
|
d2d653cfdc | ||
|
|
b0d64b419d | ||
|
|
2edd18c49d | ||
|
|
d043333bee | ||
|
|
37fbb4fbae | ||
|
|
76550465bd | ||
|
|
111f584d99 | ||
|
|
a4affd9431 | ||
|
|
92ab2eaca3 | ||
|
|
6b8280f663 | ||
|
|
a3a7012c81 | ||
|
|
f1e833005b | ||
|
|
9aa99c0c9a | ||
|
|
66f04958e3 | ||
|
|
dbc209d8ea | ||
|
|
7069a1805a | ||
|
|
2c162ffb97 | ||
|
|
726e7026cb | ||
|
|
1288d71132 | ||
|
|
f6ef146149 | ||
|
|
afd0e5af4e | ||
|
|
b8b847bbcf | ||
|
|
67700a1d70 | ||
|
|
e438131a3b | ||
|
|
ac81d9d29c | ||
|
|
9be390250d | ||
|
|
8a45f43eb0 | ||
|
|
ec96fcdbae | ||
|
|
68ea31c52a | ||
|
|
4d259da60a | ||
|
|
8e6d151403 | ||
|
|
9d56de200e | ||
|
|
b66a108e97 | ||
|
|
41ea1109ec | ||
|
|
4f8fd98d0d | ||
|
|
41b70b8386 | ||
|
|
d5d279454b | ||
|
|
5ef6ed56dc | ||
|
|
81aa495b51 | ||
|
|
64667a5595 | ||
|
|
03f32b623f | ||
|
|
0b167faa56 | ||
|
|
d1a3646d5c | ||
|
|
b2888a9467 | ||
|
|
cbc8e98876 | ||
|
|
b2f971555e | ||
|
|
089468fbf1 | ||
|
|
11029127df | ||
|
|
1af3502204 | ||
|
|
746ffac84a | ||
|
|
b140f93b17 | ||
|
|
cdc46a7ddb | ||
|
|
79272b5861 | ||
|
|
7a77d64d56 | ||
|
|
a51c8d54d2 | ||
|
|
5fc32a1124 | ||
|
|
114d11a8d8 | ||
|
|
b38e20a721 | ||
|
|
d4272bb48d | ||
|
|
abbf9f2b77 | ||
|
|
b5015df35f | ||
|
|
5fc71161e9 | ||
|
|
49d258f01a | ||
|
|
9137ed671e | ||
|
|
909b437571 | ||
|
|
e63c50b1f3 | ||
|
|
8c6de41eb9 | ||
|
|
5e8fca420e | ||
|
|
535d507c16 | ||
|
|
340aed5498 | ||
|
|
d9751aa103 | ||
|
|
06d7b14af1 | ||
|
|
a2cfa35dc1 | ||
|
|
06a32d3437 | ||
|
|
f3761ed28e | ||
|
|
cae231b557 | ||
|
|
cd07e32b13 | ||
|
|
5631bc9b2d | ||
|
|
d722276c50 | ||
|
|
0ebf82474a | ||
|
|
08aa39f538 | ||
|
|
9c36bb9073 | ||
|
|
d58acef895 | ||
|
|
74f0625c89 | ||
|
|
d5d476a3a1 | ||
|
|
8026aa44c8 | ||
|
|
9e28d5010c | ||
|
|
f84fa8dd8d | ||
|
|
77818d9c54 | ||
|
|
7f53bcc4d0 | ||
|
|
9e468a900b | ||
|
|
a8c94cf22b | ||
|
|
32f3f7daab | ||
|
|
bda44eda4a | ||
|
|
3fbbc7c1bb | ||
|
|
0e1573accc | ||
|
|
14c812cdb7 | ||
|
|
5bdcfaa5d0 | ||
|
|
9db20774d8 | ||
|
|
b37716f5ce | ||
|
|
245c87fe8f | ||
|
|
e1435e96d2 | ||
|
|
3f10496757 | ||
|
|
bcfaf0372c | ||
|
|
52db533d9b | ||
|
|
100c2ecd6a | ||
|
|
7e60b029c2 | ||
|
|
e5d8ce9983 | ||
|
|
d164a6c543 | ||
|
|
b206e074fc | ||
|
|
f5c3fcfec4 | ||
|
|
c404df78b1 | ||
|
|
f00c5eb95d | ||
|
|
461cf9ea71 | ||
|
|
e175004f85 | ||
|
|
3901fa6a96 | ||
|
|
f8dbc7f15c | ||
|
|
567243d257 | ||
|
|
c8188eaabd | ||
|
|
6de275111b | ||
|
|
faeae02030 | ||
|
|
b17ec3b4bc | ||
|
|
44b18de704 | ||
|
|
e3346fe3c4 | ||
|
|
46bf30ca77 | ||
|
|
457188f55e | ||
|
|
1c4d7285d3 | ||
|
|
fc3977fc77 | ||
|
|
e641c6b738 | ||
|
|
cca6cc0495 | ||
|
|
c37edb09f7 | ||
|
|
837452b1ca | ||
|
|
be8000d5f7 | ||
|
|
0d057099af | ||
|
|
65ba8bd6ba | ||
|
|
3a798e148b | ||
|
|
b86dfffdbe | ||
|
|
157753defe | ||
|
|
4b21cf3efc | ||
|
|
b8392ef659 | ||
|
|
e68facd889 | ||
|
|
8a32e7f3f9 | ||
|
|
a97ee9d220 | ||
|
|
d9ac8b5422 | ||
|
|
daf1d1728f | ||
|
|
e65e9f11c7 | ||
|
|
59cdd5c70f | ||
|
|
f77f7c70d3 | ||
|
|
f5ff72aa56 | ||
|
|
b5592c4571 | ||
|
|
00c9625ab8 | ||
|
|
a5a2b3752d | ||
|
|
0d212d8055 | ||
|
|
5b3aaf8bbd | ||
|
|
9311a961a0 | ||
|
|
86f9171050 | ||
|
|
a5464a9b51 | ||
|
|
805c2d4487 | ||
|
|
00f196d497 | ||
|
|
f2d573f01f | ||
|
|
77e8a66ca3 | ||
|
|
12192b7683 | ||
|
|
f45ffd8802 | ||
|
|
9e974027a8 | ||
|
|
41d4f4a972 | ||
|
|
fb5eab8f79 | ||
|
|
2001d1c74b | ||
|
|
07a5566c52 | ||
|
|
90748b5f61 | ||
|
|
8b203719d3 | ||
|
|
d5e83310b6 | ||
|
|
205403ebb2 | ||
|
|
da644c7be3 | ||
|
|
8a89470422 | ||
|
|
0780fd9719 | ||
|
|
85c40b1728 | ||
|
|
ec86a86096 | ||
|
|
755c385b1f | ||
|
|
d31e2c3581 | ||
|
|
4b771a9b28 | ||
|
|
8b048bc246 | ||
|
|
0bc244962a | ||
|
|
058ffad657 | ||
|
|
8e44018baa | ||
|
|
68cfaa76fc | ||
|
|
b002c330c0 | ||
|
|
df954568be | ||
|
|
842a60465a | ||
|
|
d17955f2d0 | ||
|
|
944c7e175b | ||
|
|
fca2f14f48 | ||
|
|
7adddc5fb8 | ||
|
|
703cfded28 | ||
|
|
b7a28cc704 |
40
.cyignore
Normal file
40
.cyignore
Normal file
@@ -0,0 +1,40 @@
|
||||
# wolfSSL folders
|
||||
$(SEARCH_wolfssl)/IDE
|
||||
$(SEARCH_wolfssl)/examples
|
||||
$(SEARCH_wolfssl)/linuxkm
|
||||
$(SEARCH_wolfssl)/mcapi
|
||||
$(SEARCH_wolfssl)/mplabx
|
||||
$(SEARCH_wolfssl)/mqx
|
||||
$(SEARCH_wolfssl)/tirtos
|
||||
$(SEARCH_wolfssl)/tests
|
||||
$(SEARCH_wolfssl)/testsuite
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/autosar
|
||||
$(SEARCH_wolfssl)/zephyr
|
||||
|
||||
# wolfSSL files
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/aes_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/aes_xts_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/aes_gcm_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/aes_gcm_x86_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/chacha_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/fe_x25519_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/poly1305_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/sha256_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/sha512_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/sha3_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/sm3_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/sp_x86_64_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/sp_sm2_x86_64_asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/wc_kyber_asm.S
|
||||
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-aes-asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-curve25519.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-curve25519.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-sha3-asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-sha512-asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-aes-asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-curve25519.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-sha256-asm.S
|
||||
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-sha512-asm.S
|
||||
13
.github/workflows/async.yml
vendored
13
.github/workflows/async.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Async Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
make_check:
|
||||
@@ -18,7 +27,7 @@ jobs:
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 6
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout wolfSSL
|
||||
|
||||
- name: Test wolfSSL async
|
||||
|
||||
19
.github/workflows/curl.yml
vendored
19
.github/workflows/curl.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: curl Test
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -18,11 +27,11 @@ jobs:
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-curl
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
test_curl:
|
||||
name: ${{ matrix.curl_ref }}
|
||||
@@ -38,11 +47,11 @@ jobs:
|
||||
- name: Install test dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install nghttp2
|
||||
sudo apt-get install nghttp2 libpsl5 libpsl-dev
|
||||
sudo pip install impacket
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-curl
|
||||
path: build-dir
|
||||
|
||||
91
.github/workflows/cyrus-sasl.yml
vendored
Normal file
91
.github/workflows/cyrus-sasl.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
name: cyrus-sasl Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-all
|
||||
install: true
|
||||
# Don't run tests as this config is tested in many other places
|
||||
check: false
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-sasl
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
sasl_check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# List of releases to test
|
||||
ref: [ 2.1.28 ]
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Don't prompt for anything
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update
|
||||
sudo apt-get install krb5-kdc krb5-otp libkrb5-dev \
|
||||
libsocket-wrapper libnss-wrapper krb5-admin-server libdb5.3-dev
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-sasl
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Checkout sasl
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: cyrusimap/cyrus-sasl
|
||||
ref: cyrus-sasl-${{ matrix.ref }}
|
||||
path: sasl
|
||||
|
||||
- name: Build cyrus-sasl
|
||||
working-directory: sasl
|
||||
run: |
|
||||
patch -p1 < $GITHUB_WORKSPACE/osp/cyrus-sasl/${{ matrix.ref }}/${{ matrix.ref }}.patch
|
||||
autoreconf -ivf
|
||||
./configure --with-openssl=no --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-dblib=berkeley --disable-shared
|
||||
# Need to run 'make' twice with '--disable-shared' for some reason
|
||||
make -j || make -j
|
||||
|
||||
- name: Run testsuite
|
||||
working-directory: sasl
|
||||
run: |
|
||||
make -j -C utils testsuite saslpasswd2
|
||||
$GITHUB_WORKSPACE/osp/cyrus-sasl/${{ matrix.ref }}/run-tests.sh
|
||||
@@ -1,7 +1,16 @@
|
||||
name: HaProxy Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
haproxy_check:
|
||||
@@ -21,7 +30,7 @@ jobs:
|
||||
install: true
|
||||
|
||||
- name: Checkout VTest
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: vtest/VTest
|
||||
path: VTest
|
||||
@@ -32,7 +41,7 @@ jobs:
|
||||
run: make FLAGS='-O2 -s -Wall'
|
||||
|
||||
- name: Checkout HaProxy
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: haproxy/haproxy
|
||||
path: haproxy
|
||||
@@ -1,7 +1,16 @@
|
||||
name: hostap and wpa-supplicant Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -40,11 +49,11 @@ jobs:
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.build_id }}
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
# Build wpa_supplicant with wolfSSL and hostapd with OpenSSL and interop.
|
||||
hostap_test:
|
||||
@@ -62,7 +71,7 @@ jobs:
|
||||
config: [
|
||||
{
|
||||
hostap_ref: hostap_2_10,
|
||||
hostap_cherry_pick: 5679ec5c3dda25a0547a5f66407fd9b0b55fd04a,
|
||||
hostap_cherry_pick: 36fcbb1a4ee4aa604f15079eae2ffa4fe7f44680,
|
||||
remove_teap: true,
|
||||
# TLS 1.3 does not work for this version
|
||||
build_id: hostap-build1,
|
||||
@@ -70,7 +79,7 @@ jobs:
|
||||
# Test the dpp patch
|
||||
{
|
||||
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
|
||||
hostap_cherry_pick: 5679ec5c3dda25a0547a5f66407fd9b0b55fd04a,
|
||||
hostap_cherry_pick: 36fcbb1a4ee4aa604f15079eae2ffa4fe7f44680,
|
||||
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
|
||||
build_id: hostap-build2
|
||||
},
|
||||
@@ -113,7 +122,7 @@ jobs:
|
||||
echo Our job run ID is $SHA_SUM
|
||||
|
||||
- name: Checkout wolfSSL
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: wolfssl
|
||||
|
||||
@@ -140,7 +149,7 @@ jobs:
|
||||
echo "hostap_debug_flags=-d" >> $GITHUB_ENV
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.config.build_id }}
|
||||
path: build-dir
|
||||
@@ -170,7 +179,7 @@ jobs:
|
||||
sudo rmmod mac80211_hwsim
|
||||
|
||||
- name: Checkout hostap
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: julek-wolfssl/hostap-mirror
|
||||
path: hostap
|
||||
@@ -185,7 +194,7 @@ jobs:
|
||||
|
||||
- if: ${{ matrix.config.osp_ref }}
|
||||
name: Checkout OSP
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
@@ -275,7 +284,7 @@ jobs:
|
||||
|
||||
- name: Upload failure logs
|
||||
if: ${{ failure() && steps.testing.outcome == 'failure' }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: hostap-logs-${{ env.our_job_run_id }}
|
||||
path: hostap/tests/hwsim/logs.zip
|
||||
17
.github/workflows/docker-Espressif.yml
vendored
17
.github/workflows/docker-Espressif.yml
vendored
@@ -1,6 +1,15 @@
|
||||
name: Espressif examples tests
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
espressif_latest:
|
||||
@@ -11,7 +20,7 @@ jobs:
|
||||
container:
|
||||
image: espressif/idf:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Initialize Espressif IDE and build examples
|
||||
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
|
||||
espressif_v4_4:
|
||||
@@ -20,7 +29,7 @@ jobs:
|
||||
container:
|
||||
image: espressif/idf:release-v4.4
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Initialize Espressif IDE and build examples
|
||||
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
|
||||
espressif_v5_0:
|
||||
@@ -29,6 +38,6 @@ jobs:
|
||||
container:
|
||||
image: espressif/idf:release-v5.0
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Initialize Espressif IDE and build examples
|
||||
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
|
||||
|
||||
27
.github/workflows/docker-OpenWrt.yml
vendored
27
.github/workflows/docker-OpenWrt.yml
vendored
@@ -2,8 +2,17 @@
|
||||
# there aren't any compatibility issues. Take a look at Docker/OpenWrt/README.md
|
||||
name: OpenWrt test
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_library:
|
||||
@@ -16,15 +25,15 @@ jobs:
|
||||
steps:
|
||||
- name: Install required tools
|
||||
run: apk add argp-standalone asciidoc bash bc binutils bzip2 cdrkit coreutils diffutils elfutils-dev findutils flex musl-fts-dev g++ gawk gcc gettext git grep intltool libxslt linux-headers make musl-libintl musl-obstack-dev ncurses-dev openssl-dev patch perl python3-dev rsync tar unzip util-linux wget zlib-dev autoconf automake libtool
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Compile libwolfssl.so
|
||||
run: ./autogen.sh && ./configure --enable-all && make
|
||||
- name: Upload libwolfssl.so
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openwrt-libwolfssl.so
|
||||
path: src/.libs/libwolfssl.so
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
compile_container:
|
||||
name: Compile container
|
||||
runs-on: ubuntu-latest
|
||||
@@ -34,16 +43,16 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
release: [ "22.03-SNAPSHOT", "21.02-SNAPSHOT" ] # some other versions: 21.02.0 21.02.5 22.03.0 22.03.3 snapshot
|
||||
release: [ "22.03.6", "21.02.7" ] # some other versions: 21.02.0 21.02.5 22.03.0 22.03.3 snapshot
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: openwrt-libwolfssl.so
|
||||
path: Docker/OpenWrt/.
|
||||
- name: Build but dont push
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: Docker/OpenWrt
|
||||
platforms: linux/amd64
|
||||
|
||||
101
.github/workflows/grpc.yml
vendored
Normal file
101
.github/workflows/grpc.yml
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
name: grpc Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-all 'CPPFLAGS=-DWOLFSSL_RSA_KEY_CHECK -DHAVE_EX_DATA_CLEANUP_HOOKS'
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-grpc
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
grpc_check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- ref: v1.60.0
|
||||
tests: >-
|
||||
bad_ssl_alpn_test bad_ssl_cert_test client_ssl_test
|
||||
crl_ssl_transport_security_test server_ssl_test
|
||||
ssl_transport_security_test ssl_transport_security_utils_test
|
||||
test_core_security_ssl_credentials_test test_cpp_end2end_ssl_credentials_test
|
||||
h2_ssl_cert_test h2_ssl_session_reuse_test
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 30
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Confirm IPv4 and IPv6 support
|
||||
run: |
|
||||
ip addr list lo | grep 'inet '
|
||||
ip addr list lo | grep 'inet6 '
|
||||
|
||||
- name: Install prereqs
|
||||
run:
|
||||
sudo apt-get install build-essential autoconf libtool pkg-config cmake clang libc++-dev
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-grpc
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Checkout grpc
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: grpc/grpc
|
||||
path: grpc
|
||||
ref: ${{ matrix.ref }}
|
||||
|
||||
- name: Build grpc
|
||||
working-directory: ./grpc
|
||||
run: |
|
||||
patch -p1 < ../osp/grpc/grpc-${{ matrix.ref }}.patch
|
||||
git submodule update --init
|
||||
mkdir cmake/build
|
||||
cd cmake/build
|
||||
cmake -DgRPC_BUILD_TESTS=ON -DgRPC_SSL_PROVIDER=wolfssl \
|
||||
-DWOLFSSL_INSTALL_DIR=$GITHUB_WORKSPACE/build-dir ../..
|
||||
make -j $(nproc) ${{ matrix.tests }}
|
||||
|
||||
- name: Run grpc tests
|
||||
working-directory: ./grpc
|
||||
run: |
|
||||
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
|
||||
./tools/run_tests/start_port_server.py
|
||||
for t in ${{ matrix.tests }} ; do
|
||||
./cmake/build/$t
|
||||
done
|
||||
21
.github/workflows/hitch.yml
vendored
21
.github/workflows/hitch.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: hitch Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -19,11 +28,11 @@ jobs:
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-hitch
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
hitch_check:
|
||||
strategy:
|
||||
@@ -41,13 +50,13 @@ jobs:
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-hitch
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
@@ -59,7 +68,7 @@ jobs:
|
||||
sudo apt-get install -y libev-dev libssl-dev automake python3-docutils flex bison pkg-config make
|
||||
|
||||
- name: Checkout hitch
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: varnish/hitch
|
||||
ref: 1.7.3
|
||||
|
||||
122
.github/workflows/hostap-files/configs/07c9f183ea744ac04585fb6dd10220c75a5e2e74/hostapd.config
vendored
Normal file
122
.github/workflows/hostap-files/configs/07c9f183ea744ac04585fb6dd10220c75a5e2e74/hostapd.config
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
#CC=ccache gcc
|
||||
|
||||
CONFIG_DRIVER_NONE=y
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
CONFIG_RSN_PREAUTH=y
|
||||
|
||||
#CONFIG_TLS=internal
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
#CONFIG_TLS=openssl
|
||||
CONFIG_TLS=wolfssl
|
||||
|
||||
CONFIG_EAP=y
|
||||
CONFIG_ERP=y
|
||||
CONFIG_EAP_MD5=y
|
||||
CONFIG_EAP_TLS=y
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
CONFIG_EAP_PEAP=y
|
||||
CONFIG_EAP_GTC=y
|
||||
CONFIG_EAP_TTLS=y
|
||||
CONFIG_EAP_SIM=y
|
||||
CONFIG_EAP_AKA=y
|
||||
CONFIG_EAP_AKA_PRIME=y
|
||||
CONFIG_EAP_GPSK=y
|
||||
CONFIG_EAP_GPSK_SHA256=y
|
||||
CONFIG_EAP_SAKE=y
|
||||
CONFIG_EAP_PAX=y
|
||||
CONFIG_EAP_PSK=y
|
||||
CONFIG_EAP_VENDOR_TEST=y
|
||||
CONFIG_EAP_FAST=y
|
||||
CONFIG_EAP_TEAP=y
|
||||
CONFIG_EAP_IKEV2=y
|
||||
CONFIG_EAP_TNC=y
|
||||
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
|
||||
LIBS += -rdynamic
|
||||
CONFIG_EAP_UNAUTH_TLS=y
|
||||
ifeq ($(CONFIG_TLS), openssl)
|
||||
CONFIG_EAP_PWD=y
|
||||
endif
|
||||
ifeq ($(CONFIG_TLS), wolfssl)
|
||||
CONFIG_EAP_PWD=y
|
||||
endif
|
||||
CONFIG_EAP_EKE=y
|
||||
CONFIG_PKCS12=y
|
||||
CONFIG_RADIUS_SERVER=y
|
||||
CONFIG_IPV6=y
|
||||
CONFIG_TLSV11=y
|
||||
CONFIG_TLSV12=y
|
||||
|
||||
CONFIG_FULL_DYNAMIC_VLAN=y
|
||||
CONFIG_VLAN_NETLINK=y
|
||||
CONFIG_LIBNL32=y
|
||||
CONFIG_LIBNL3_ROUTE=y
|
||||
CONFIG_IEEE80211R=y
|
||||
CONFIG_IEEE80211AC=y
|
||||
CONFIG_IEEE80211AX=y
|
||||
|
||||
CONFIG_OCV=y
|
||||
|
||||
CONFIG_WPS=y
|
||||
CONFIG_WPS_UPNP=y
|
||||
CONFIG_WPS_NFC=y
|
||||
#CONFIG_WPS_STRICT=y
|
||||
CONFIG_WPA_TRACE=y
|
||||
CONFIG_WPA_TRACE_BFD=y
|
||||
|
||||
CONFIG_P2P_MANAGER=y
|
||||
CONFIG_DEBUG_FILE=y
|
||||
CONFIG_DEBUG_LINUX_TRACING=y
|
||||
CONFIG_WPA_CLI_EDIT=y
|
||||
CONFIG_ACS=y
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
CONFIG_WNM=y
|
||||
CONFIG_INTERWORKING=y
|
||||
CONFIG_HS20=y
|
||||
CONFIG_SQLITE=y
|
||||
CONFIG_SAE=y
|
||||
CONFIG_SAE_PK=y
|
||||
CFLAGS += -DALL_DH_GROUPS
|
||||
|
||||
CONFIG_FST=y
|
||||
CONFIG_FST_TEST=y
|
||||
|
||||
CONFIG_TESTING_OPTIONS=y
|
||||
CFLAGS += -DCONFIG_RADIUS_TEST
|
||||
CONFIG_MODULE_TESTS=y
|
||||
|
||||
CONFIG_SUITEB=y
|
||||
CONFIG_SUITEB192=y
|
||||
|
||||
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
|
||||
# This can be used as a more efficient memory error detector than valgrind
|
||||
# (though, with still some CPU and memory cost, so VM cases will need more
|
||||
# memory allocated for the guest).
|
||||
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
|
||||
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
|
||||
#LIBS_h += -fsanitize=address -fno-omit-frame-pointer -g
|
||||
#LIBS_n += -fsanitize=address -fno-omit-frame-pointer -g
|
||||
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
|
||||
|
||||
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
|
||||
# following lines.
|
||||
#CFLAGS += -Wno-format-nonliteral
|
||||
#CFLAGS += -fsanitize=undefined
|
||||
##CFLAGS += -fno-sanitize-recover
|
||||
#LIBS += -fsanitize=undefined
|
||||
##LIBS += -fno-sanitize-recover
|
||||
#LIBS_h += -fsanitize=undefined
|
||||
#LIBS_n += -fsanitize=undefined
|
||||
#LIBS_c += -fsanitize=undefined
|
||||
CONFIG_MBO=y
|
||||
|
||||
CONFIG_TAXONOMY=y
|
||||
CONFIG_FILS=y
|
||||
CONFIG_FILS_SK_PFS=y
|
||||
CONFIG_OWE=y
|
||||
CONFIG_DPP=y
|
||||
CONFIG_DPP2=y
|
||||
CONFIG_WEP=y
|
||||
CONFIG_PASN=y
|
||||
CONFIG_AIRTIME_POLICY=y
|
||||
CONFIG_IEEE80211BE=y
|
||||
1677
.github/workflows/hostap-files/configs/07c9f183ea744ac04585fb6dd10220c75a5e2e74/tests
vendored
Normal file
1677
.github/workflows/hostap-files/configs/07c9f183ea744ac04585fb6dd10220c75a5e2e74/tests
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,164 @@
|
||||
#CC=ccache gcc
|
||||
|
||||
#CONFIG_TLS=openssl
|
||||
CONFIG_TLS=wolfssl
|
||||
#CONFIG_TLS=internal
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
CONFIG_ERP=y
|
||||
CONFIG_EAP_MD5=y
|
||||
CONFIG_MSCHAPV2=y
|
||||
CONFIG_EAP_TLS=y
|
||||
CONFIG_EAP_PEAP=y
|
||||
CONFIG_EAP_TTLS=y
|
||||
CONFIG_EAP_GTC=y
|
||||
CONFIG_EAP_OTP=y
|
||||
CONFIG_EAP_PSK=y
|
||||
CONFIG_EAP_PAX=y
|
||||
CONFIG_EAP_LEAP=y
|
||||
CONFIG_EAP_SIM=y
|
||||
CONFIG_EAP_AKA=y
|
||||
CONFIG_EAP_AKA_PRIME=y
|
||||
CONFIG_EAP_VENDOR_TEST=y
|
||||
CONFIG_EAP_TLV=y
|
||||
CONFIG_EAP_SAKE=y
|
||||
CONFIG_EAP_GPSK=y
|
||||
CONFIG_EAP_GPSK_SHA256=y
|
||||
CONFIG_EAP_EKE=y
|
||||
CONFIG_EAP_TNC=y
|
||||
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
|
||||
LIBS += -rdynamic
|
||||
CONFIG_EAP_FAST=y
|
||||
CONFIG_EAP_TEAP=y
|
||||
CONFIG_EAP_IKEV2=y
|
||||
|
||||
ifeq ($(CONFIG_TLS), openssl)
|
||||
CONFIG_EAP_PWD=y
|
||||
endif
|
||||
ifeq ($(CONFIG_TLS), wolfssl)
|
||||
CONFIG_EAP_PWD=y
|
||||
endif
|
||||
|
||||
CONFIG_USIM_SIMULATOR=y
|
||||
CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
#CONFIG_PCSC=y
|
||||
CONFIG_IPV6=y
|
||||
CONFIG_DRIVER_NONE=y
|
||||
CONFIG_PKCS12=y
|
||||
CONFIG_CTRL_IFACE=unix
|
||||
|
||||
CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
CONFIG_OCSP=y
|
||||
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
CONFIG_IEEE80211R=y
|
||||
CONFIG_IEEE80211AC=y
|
||||
CONFIG_IEEE80211AX=y
|
||||
|
||||
CONFIG_OCV=y
|
||||
|
||||
CONFIG_DEBUG_FILE=y
|
||||
|
||||
CONFIG_WPS=y
|
||||
#CONFIG_WPS_STRICT=y
|
||||
CONFIG_WPS_UPNP=y
|
||||
CONFIG_WPS_NFC=y
|
||||
CONFIG_WPS_ER=y
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
CFLAGS += -I/usr/include/libnl3
|
||||
CONFIG_LIBNL32=y
|
||||
|
||||
CONFIG_IBSS_RSN=y
|
||||
|
||||
CONFIG_AP=y
|
||||
CONFIG_MESH=y
|
||||
CONFIG_P2P=y
|
||||
CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
CONFIG_ACS=y
|
||||
|
||||
CONFIG_BGSCAN_SIMPLE=y
|
||||
CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
CONFIG_WPA_TRACE=y
|
||||
CONFIG_WPA_TRACE_BFD=y
|
||||
|
||||
CONFIG_TDLS=y
|
||||
CONFIG_TDLS_TESTING=y
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
CONFIG_TLSV11=y
|
||||
CONFIG_TLSV12=y
|
||||
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
CONFIG_HE_OVERRIDES=y
|
||||
|
||||
CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
CONFIG_INTERWORKING=y
|
||||
CONFIG_HS20=y
|
||||
|
||||
CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
CONFIG_EXT_PASSWORD_TEST=y
|
||||
CONFIG_EXT_PASSWORD_FILE=y
|
||||
|
||||
CONFIG_EAP_UNAUTH_TLS=y
|
||||
|
||||
CONFIG_SAE=y
|
||||
CONFIG_SAE_PK=y
|
||||
CFLAGS += -DALL_DH_GROUPS
|
||||
|
||||
CONFIG_WNM=y
|
||||
|
||||
CONFIG_FST=y
|
||||
CONFIG_FST_TEST=y
|
||||
|
||||
CONFIG_TESTING_OPTIONS=y
|
||||
CONFIG_MODULE_TESTS=y
|
||||
|
||||
CONFIG_SUITEB=y
|
||||
CONFIG_SUITEB192=y
|
||||
|
||||
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
|
||||
# This can be used as a more efficient memory error detector than valgrind
|
||||
# (though, with still some CPU and memory cost, so VM cases will need more
|
||||
# memory allocated for the guest).
|
||||
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
|
||||
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
|
||||
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
|
||||
#LIBS_p += -fsanitize=address -fno-omit-frame-pointer -g
|
||||
|
||||
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
|
||||
# following lines.
|
||||
#CFLAGS += -Wno-format-nonliteral
|
||||
#CFLAGS += -fsanitize=undefined
|
||||
##CFLAGS += -fno-sanitize-recover
|
||||
#LIBS += -fsanitize=undefined
|
||||
##LIBS += -fno-sanitize-recover
|
||||
#LIBS_c += -fsanitize=undefined
|
||||
#LIBS_p += -fsanitize=undefined
|
||||
CONFIG_MBO=y
|
||||
CONFIG_FILS=y
|
||||
CONFIG_FILS_SK_PFS=y
|
||||
CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
CONFIG_OWE=y
|
||||
CONFIG_DPP=y
|
||||
CONFIG_DPP2=y
|
||||
CONFIG_WEP=y
|
||||
CONFIG_PASN=y
|
||||
@@ -191,13 +191,7 @@ ap_wpa2_psk_supp_proto_no_gtk_in_group_msg
|
||||
ap_wpa2_psk_supp_proto_too_long_gtk_in_group_msg
|
||||
ap_wpa2_psk_supp_proto_too_long_gtk_kde
|
||||
ap_wpa2_psk_supp_proto_gtk_not_encrypted
|
||||
ap_wpa2_psk_supp_proto_no_igtk
|
||||
ap_wpa2_psk_supp_proto_igtk_ok
|
||||
ap_wpa2_psk_supp_proto_igtk_keyid_swap
|
||||
ap_wpa2_psk_supp_proto_igtk_keyid_too_large
|
||||
ap_wpa2_psk_supp_proto_igtk_keyid_unexpected
|
||||
ap_wpa2_psk_wep
|
||||
ap_wpa2_psk_ifdown
|
||||
ap_wpa2_psk_drop_first_msg_4
|
||||
ap_wpa2_psk_disable_enable
|
||||
ap_wpa2_psk_incorrect_passphrase
|
||||
@@ -210,10 +204,7 @@ ap_wpa2_disable_eapol_retry
|
||||
ap_wpa2_disable_eapol_retry_group
|
||||
ap_wpa2_psk_mic_0
|
||||
ap_wpa2_psk_local_error
|
||||
ap_wpa2_psk_inject_assoc
|
||||
ap_wpa2_psk_no_control_port
|
||||
ap_wpa2_psk_ap_control_port
|
||||
ap_wpa2_psk_ap_control_port_disabled
|
||||
ap_wpa2_psk_rsne_mismatch_ap
|
||||
ap_wpa2_psk_rsne_mismatch_ap2
|
||||
ap_wpa2_psk_rsne_mismatch_ap3
|
||||
@@ -253,10 +244,8 @@ ap_wpa2_eap_aka_sql
|
||||
ap_wpa2_eap_aka_config
|
||||
ap_wpa2_eap_aka_ext
|
||||
ap_wpa2_eap_aka_ext_auth_fail
|
||||
ap_wpa2_eap_aka_prime
|
||||
ap_wpa2_eap_aka_prime_imsi_identity
|
||||
ap_wpa2_eap_aka_prime_imsi_privacy_key
|
||||
ap_wpa2_eap_aka_prime_sql
|
||||
ap_wpa2_eap_aka_prime_ext_auth_fail
|
||||
ap_wpa2_eap_aka_prime_ext
|
||||
ap_wpa2_eap_ttls_pap
|
||||
@@ -416,19 +405,6 @@ ap_wpa2_radius_server_get_id
|
||||
ap_wpa2_eap_tls_tod
|
||||
ap_wpa2_eap_tls_tod_tofu
|
||||
ap_wpa2_eap_sake_no_control_port
|
||||
ap_wpa2_tdls
|
||||
ap_wpa2_tdls_concurrent_init
|
||||
ap_wpa2_tdls_concurrent_init2
|
||||
ap_wpa2_tdls_decline_resp
|
||||
ap_wpa2_tdls_long_lifetime
|
||||
ap_wpa2_tdls_long_frame
|
||||
ap_wpa2_tdls_reneg
|
||||
ap_wpa2_tdls_wrong_lifetime_resp
|
||||
ap_wpa2_tdls_diff_rsnie
|
||||
ap_wpa2_tdls_wrong_tpk_m2_mic
|
||||
ap_wpa2_tdls_wrong_tpk_m3_mic
|
||||
ap_wpa2_tdls_double_tpk_m2
|
||||
ap_wpa2_tdls_responder_teardown
|
||||
dpp_network_intro_version
|
||||
dpp_network_intro_version_change
|
||||
dpp_network_intro_version_missing_req
|
||||
@@ -459,12 +435,9 @@ dpp_qr_code_curves
|
||||
dpp_qr_code_curves_brainpool
|
||||
dpp_qr_code_unsupported_curve
|
||||
dpp_qr_code_keygen_fail
|
||||
dpp_qr_code_curve_select
|
||||
dpp_qr_code_auth_broadcast
|
||||
dpp_configurator_enrollee
|
||||
dpp_configurator_enrollee_prime256v1
|
||||
dpp_configurator_enrollee_secp384r1
|
||||
dpp_configurator_enrollee_secp521r1
|
||||
dpp_configurator_enrollee_brainpoolP256r1
|
||||
dpp_configurator_enrollee_brainpoolP384r1
|
||||
dpp_configurator_enrollee_brainpoolP512r1
|
||||
@@ -477,7 +450,6 @@ dpp_qr_code_curve_brainpoolP384r1
|
||||
dpp_qr_code_curve_brainpoolP512r1
|
||||
dpp_qr_code_set_key
|
||||
dpp_qr_code_auth_mutual
|
||||
dpp_qr_code_auth_mutual2
|
||||
dpp_qr_code_auth_mutual_p_256
|
||||
dpp_qr_code_auth_mutual_p_384
|
||||
dpp_qr_code_auth_mutual_p_521
|
||||
@@ -514,13 +486,11 @@ dpp_config_no_signed_connector
|
||||
dpp_config_unexpected_signed_connector_char
|
||||
dpp_config_root_not_an_object
|
||||
dpp_config_no_wi_fi_tech
|
||||
dpp_config_unsupported_wi_fi_tech
|
||||
dpp_config_no_discovery
|
||||
dpp_config_no_discovery_ssid
|
||||
dpp_config_too_long_discovery_ssid
|
||||
dpp_config_no_cred
|
||||
dpp_config_no_cred_akm
|
||||
dpp_config_unsupported_cred_akm
|
||||
dpp_config_error_legacy_no_pass
|
||||
dpp_config_error_legacy_too_long_pass
|
||||
dpp_config_error_legacy_psk_with_sae
|
||||
@@ -531,13 +501,10 @@ dpp_config_connector_error_ext_sign
|
||||
dpp_config_connector_error_too_short_timestamp
|
||||
dpp_config_connector_error_invalid_timestamp
|
||||
dpp_config_connector_error_invalid_timestamp_date
|
||||
dpp_config_connector_error_invalid_time_zone
|
||||
dpp_config_connector_error_invalid_time_zone_2
|
||||
dpp_config_connector_error_expired_1
|
||||
dpp_config_connector_error_expired_2
|
||||
dpp_config_connector_error_expired_3
|
||||
dpp_config_connector_error_expired_4
|
||||
dpp_config_connector_error_expired_5
|
||||
dpp_config_connector_error_expired_6
|
||||
dpp_config_connector_error_no_groups
|
||||
dpp_config_connector_error_empty_groups
|
||||
@@ -565,13 +532,6 @@ dpp_ap_config_p256_bp256
|
||||
dpp_ap_config_bp256_p256
|
||||
dpp_ap_config_p521_bp512
|
||||
dpp_ap_config_reconfig_configurator
|
||||
dpp_auto_connect_1
|
||||
dpp_auto_connect_2
|
||||
dpp_auto_connect_2_connect_cmd
|
||||
dpp_auto_connect_2_sta_ver1
|
||||
dpp_auto_connect_2_ap_ver1
|
||||
dpp_auto_connect_2_ver1
|
||||
dpp_auto_connect_2_conf_ver1
|
||||
dpp_auto_connect_legacy
|
||||
dpp_auto_connect_legacy_ssid_charset
|
||||
dpp_auto_connect_legacy_sae_1
|
||||
@@ -580,13 +540,6 @@ dpp_auto_connect_legacy_psk_sae_1
|
||||
dpp_auto_connect_legacy_psk_sae_2
|
||||
dpp_auto_connect_legacy_psk_sae_3
|
||||
dpp_auto_connect_legacy_pmf_required
|
||||
dpp_qr_code_auth_responder_configurator
|
||||
dpp_qr_code_auth_responder_configurator_group_id
|
||||
dpp_qr_code_auth_enrollee_init_netrole
|
||||
dpp_qr_code_hostapd_init
|
||||
dpp_qr_code_hostapd_init_offchannel
|
||||
dpp_qr_code_hostapd_init_offchannel_neg_freq
|
||||
dpp_qr_code_hostapd_ignore_mismatch
|
||||
dpp_test_vector_p_256
|
||||
dpp_test_vector_p_256_b
|
||||
dpp_test_vector_p_521
|
||||
@@ -603,7 +556,6 @@ dpp_pkex_no_identifier
|
||||
dpp_pkex_identifier_mismatch
|
||||
dpp_pkex_identifier_mismatch2
|
||||
dpp_pkex_identifier_mismatch3
|
||||
dpp_pkex_5ghz
|
||||
dpp_pkex_test_vector
|
||||
dpp_pkex_code_mismatch
|
||||
dpp_pkex_code_mismatch_limit
|
||||
@@ -625,7 +577,6 @@ dpp_pkex_hostapd_errors
|
||||
dpp_pkex_nak_curve_change
|
||||
dpp_pkex_nak_curve_change2
|
||||
dpp_hostapd_configurator
|
||||
dpp_hostapd_configurator_enrollee_v1
|
||||
dpp_hostapd_configurator_responder
|
||||
dpp_hostapd_configurator_fragmentation
|
||||
dpp_hostapd_enrollee_fragmentation
|
||||
@@ -650,7 +601,6 @@ dpp_proto_stop_at_pkex_cr_req
|
||||
dpp_proto_stop_at_pkex_cr_resp
|
||||
dpp_proto_network_introduction
|
||||
dpp_hostapd_auth_conf_timeout
|
||||
dpp_hostapd_auth_resp_retries
|
||||
dpp_tcp
|
||||
dpp_tcp_port
|
||||
dpp_tcp_mutual
|
||||
@@ -702,6 +652,5 @@ dpp_qr_code_config_event_initiator_failure
|
||||
dpp_qr_code_config_event_initiator_no_response
|
||||
dpp_qr_code_config_event_initiator_both
|
||||
dpp_tcp_qr_code_config_event_initiator
|
||||
dpp_qr_code_config_event_responder
|
||||
dpp_discard_public_action
|
||||
|
||||
|
||||
47
.github/workflows/hostap-files/configs/hostap_2_10/extra.patch
vendored
Normal file
47
.github/workflows/hostap-files/configs/hostap_2_10/extra.patch
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
From a53a6a67dc121b45d611318e2a37815cc209839c Mon Sep 17 00:00:00 2001
|
||||
From: Juliusz Sosinowicz <juliusz@wolfssl.com>
|
||||
Date: Fri, 19 Apr 2024 16:41:38 +0200
|
||||
Subject: [PATCH] Fixes for running tests under UML
|
||||
|
||||
- Apply commit ID fix from more recent commit
|
||||
- priv_sz and pub_sz are checked and fail on UML. Probably because stack is zeroed out.
|
||||
---
|
||||
src/crypto/crypto_wolfssl.c | 2 +-
|
||||
tests/hwsim/run-all.sh | 8 +++++++-
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
|
||||
index 00ecf61352..a57fa50697 100644
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -785,7 +785,7 @@ int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey,
|
||||
int ret = -1;
|
||||
WC_RNG rng;
|
||||
DhKey *dh = NULL;
|
||||
- word32 priv_sz, pub_sz;
|
||||
+ word32 priv_sz = prime_len, pub_sz = prime_len;
|
||||
|
||||
if (TEST_FAIL())
|
||||
return -1;
|
||||
diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh
|
||||
index ee48cd0581..75c3a58b52 100755
|
||||
--- a/tests/hwsim/run-all.sh
|
||||
+++ b/tests/hwsim/run-all.sh
|
||||
@@ -15,7 +15,13 @@ export LOGDIR
|
||||
if [ -z "$DBFILE" ]; then
|
||||
DB=""
|
||||
else
|
||||
- DB="-S $DBFILE --commit $(git rev-parse HEAD)"
|
||||
+ DB="-S $DBFILE"
|
||||
+ if [ -z "$COMMITID" ]; then
|
||||
+ COMMITID="$(git rev-parse HEAD)"
|
||||
+ fi
|
||||
+ if [ -n "$COMMITID" ]; then
|
||||
+ DB="$DB --commit $COMMITID"
|
||||
+ fi
|
||||
if [ -n "$BUILD" ]; then
|
||||
DB="$DB -b $BUILD"
|
||||
fi
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -163,7 +163,6 @@ ap_wpa2_disable_eapol_retry_group
|
||||
ap_wpa2_psk_mic_0
|
||||
ap_wpa2_psk_local_error
|
||||
ap_wpa2_psk_inject_assoc
|
||||
ap_wpa2_psk_no_control_port
|
||||
ap_wpa2_psk_ap_control_port
|
||||
ap_wpa2_psk_ap_control_port_disabled
|
||||
ap_wpa2_psk_rsne_mismatch_ap
|
||||
@@ -269,16 +268,3 @@ ap_wpa2_eap_psk_mac_addr_change
|
||||
ap_wpa2_eap_server_get_id
|
||||
ap_wpa2_radius_server_get_id
|
||||
ap_wpa2_eap_sake_no_control_port
|
||||
ap_wpa2_tdls
|
||||
ap_wpa2_tdls_concurrent_init
|
||||
ap_wpa2_tdls_concurrent_init2
|
||||
ap_wpa2_tdls_decline_resp
|
||||
ap_wpa2_tdls_long_lifetime
|
||||
ap_wpa2_tdls_long_frame
|
||||
ap_wpa2_tdls_reneg
|
||||
ap_wpa2_tdls_wrong_lifetime_resp
|
||||
ap_wpa2_tdls_diff_rsnie
|
||||
ap_wpa2_tdls_wrong_tpk_m2_mic
|
||||
ap_wpa2_tdls_wrong_tpk_m3_mic
|
||||
ap_wpa2_tdls_double_tpk_m2
|
||||
ap_wpa2_tdls_responder_teardown
|
||||
|
||||
313
.github/workflows/hostap-vm.yml
vendored
Normal file
313
.github/workflows/hostap-vm.yml
vendored
Normal file
@@ -0,0 +1,313 @@
|
||||
name: hostap and wpa-supplicant Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
env:
|
||||
LINUX_REF: v6.6
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- build_id: hostap-vm-build1
|
||||
wolf_extra_config: --disable-tls13
|
||||
- build_id: hostap-vm-build2
|
||||
wolf_extra_config: >-
|
||||
--enable-wpas-dpp --enable-brainpool --with-eccminsz=192
|
||||
--enable-tlsv10 --enable-oldtls
|
||||
name: Build wolfSSL
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
# No way to view the full strategy in the browser (really weird)
|
||||
- name: Print strategy
|
||||
run: |
|
||||
cat <<EOF
|
||||
${{ toJSON(matrix) }}
|
||||
EOF
|
||||
|
||||
- if: ${{ runner.debug }}
|
||||
name: Enable wolfSSL debug logging
|
||||
run: |
|
||||
echo "wolf_debug_flags=--enable-debug" >> $GITHUB_ENV
|
||||
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: >-
|
||||
--enable-wpas CPPFLAGS=-DWOLFSSL_STATIC_RSA
|
||||
${{ env.wolf_debug_flags }} ${{ matrix.wolf_extra_config }}
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.build_id }}
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
build_uml_linux:
|
||||
name: Build UML (UserMode Linux)
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checking if we have kernel in cache
|
||||
uses: actions/cache@v4
|
||||
id: cache
|
||||
with:
|
||||
path: linux/linux
|
||||
key: ${{ env.LINUX_REF }}
|
||||
lookup-only: true
|
||||
|
||||
- name: Checkout hostap
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: julek-wolfssl/hostap-mirror
|
||||
path: hostap
|
||||
|
||||
- name: Checkout linux
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: torvalds/linux
|
||||
path: linux
|
||||
|
||||
- name: Compile linux
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cp hostap/tests/hwsim/vm/kernel-config.uml linux/.config
|
||||
cd linux
|
||||
yes "" | ARCH=um make -j $(nproc)
|
||||
|
||||
hostap_test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# should hostapd be compiled with wolfssl
|
||||
hostapd: [true, false]
|
||||
# should wpa_supplicant be compiled with wolfssl
|
||||
wpa_supplicant: [true, false]
|
||||
# Fix the versions of hostap and osp to not break testing when a new
|
||||
# patch is added in to osp. Tests are read from the corresponding
|
||||
# configs/hostap_ref/tests file.
|
||||
config: [
|
||||
{
|
||||
hostap_ref: hostap_2_10,
|
||||
remove_teap: true,
|
||||
# TLS 1.3 does not work for this version
|
||||
build_id: hostap-vm-build1,
|
||||
},
|
||||
# Test the dpp patch
|
||||
{
|
||||
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
|
||||
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
|
||||
build_id: hostap-vm-build2
|
||||
},
|
||||
{
|
||||
hostap_ref: 07c9f183ea744ac04585fb6dd10220c75a5e2e74,
|
||||
osp_ref: e1876fbbf298ee442bc7ab8561331ebc7de17528,
|
||||
build_id: hostap-vm-build2
|
||||
},
|
||||
]
|
||||
exclude:
|
||||
# don't test openssl on both sides
|
||||
- hostapd: false
|
||||
wpa_supplicant: false
|
||||
# no hostapd support for dpp yet
|
||||
- hostapd: true
|
||||
config: {
|
||||
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
|
||||
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
|
||||
build_id: hostap-vm-build2
|
||||
}
|
||||
name: hwsim test
|
||||
# For openssl 1.1
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 45
|
||||
needs: [build_wolfssl, build_uml_linux]
|
||||
steps:
|
||||
- name: Checking if we have kernel in cache
|
||||
uses: actions/cache/restore@v4
|
||||
id: cache
|
||||
with:
|
||||
path: linux/linux
|
||||
key: ${{ env.LINUX_REF }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: show file structure
|
||||
run: tree
|
||||
|
||||
# No way to view the full strategy in the browser (really weird)
|
||||
- name: Print strategy
|
||||
run: |
|
||||
cat <<EOF
|
||||
${{ toJSON(matrix) }}
|
||||
EOF
|
||||
|
||||
- name: Print computed job run ID
|
||||
run: |
|
||||
SHA_SUM=$(sha256sum << 'END_OF_HEREDOC' | cut -d " " -f 1
|
||||
${{ toJSON(github) }}
|
||||
END_OF_HEREDOC
|
||||
)
|
||||
echo "our_job_run_id=$SHA_SUM" >> $GITHUB_ENV
|
||||
echo Our job run ID is $SHA_SUM
|
||||
|
||||
- name: Checkout wolfSSL
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: wolfssl
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.config.build_id }}
|
||||
path: build-dir
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Don't prompt for anything
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update
|
||||
# hostap dependencies
|
||||
sudo apt-get install -y libpcap0.8 libpcap-dev curl libcurl4-openssl-dev \
|
||||
libnl-3-dev binutils-dev libssl-dev libiberty-dev libnl-genl-3-dev \
|
||||
libnl-route-3-dev libdbus-1-dev bridge-utils tshark
|
||||
sudo pip3 install pycryptodome
|
||||
|
||||
- name: Checkout hostap
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: julek-wolfssl/hostap-mirror
|
||||
path: hostap
|
||||
ref: ${{ matrix.config.hostap_ref }}
|
||||
|
||||
- name: Update certs
|
||||
working-directory: hostap/tests/hwsim/auth_serv
|
||||
run: ./update.sh
|
||||
|
||||
- if: ${{ matrix.config.osp_ref }}
|
||||
name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
ref: ${{ matrix.config.osp_ref }}
|
||||
|
||||
- if: ${{ matrix.config.osp_ref }}
|
||||
name: Apply patch files
|
||||
working-directory: hostap
|
||||
run: |
|
||||
for f in $GITHUB_WORKSPACE/osp/hostap-patches/pending/*
|
||||
do
|
||||
patch -p1 < $f
|
||||
done
|
||||
|
||||
- name: Apply extra patches
|
||||
working-directory: hostap
|
||||
run: |
|
||||
FILE=$GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/extra.patch
|
||||
if [ -f "$FILE" ]; then
|
||||
patch -p1 < $FILE
|
||||
fi
|
||||
|
||||
- if: ${{ matrix.hostapd }}
|
||||
name: Setup hostapd config file
|
||||
run: |
|
||||
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/hostapd.config \
|
||||
hostap/hostapd/.config
|
||||
cat <<EOF >> hostap/hostapd/.config
|
||||
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
|
||||
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
|
||||
EOF
|
||||
|
||||
- if: ${{ matrix.wpa_supplicant }}
|
||||
name: Setup wpa_supplicant config file
|
||||
run: |
|
||||
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/wpa_supplicant.config \
|
||||
hostap/wpa_supplicant/.config
|
||||
cat <<EOF >> hostap/wpa_supplicant/.config
|
||||
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
|
||||
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
|
||||
EOF
|
||||
|
||||
- name: Build hostap and wpa_supplicant
|
||||
working-directory: hostap/tests/hwsim/
|
||||
run: ./build.sh
|
||||
|
||||
- if: ${{ matrix.hostapd }}
|
||||
name: Confirm hostapd linking with wolfSSL
|
||||
run: ldd hostap/hostapd/hostapd | grep wolfssl
|
||||
|
||||
- if: ${{ matrix.wpa_supplicant }}
|
||||
name: Confirm wpa_supplicant linking with wolfSSL
|
||||
run: ldd hostap/wpa_supplicant/wpa_supplicant | grep wolfssl
|
||||
|
||||
- if: ${{ matrix.config.remove_teap }}
|
||||
name: Remove EAP-TEAP from test configuration
|
||||
working-directory: hostap/tests/hwsim/auth_serv
|
||||
run: |
|
||||
sed -e 's/"erp-teap@example.com"\tTEAP//' -i eap_user.conf
|
||||
sed -e 's/"erp-teap@example.com"\tMSCHAPV2\t"password"\t\[2\]//' -i eap_user.conf
|
||||
sed -e 's/"TEAP"\t\tTEAP//' -i eap_user.conf
|
||||
sed -e 's/TEAP,//' -i eap_user.conf
|
||||
|
||||
- if: ${{ runner.debug }}
|
||||
name: Enable hostap debug logging
|
||||
run: |
|
||||
echo "hostap_debug_flags=--debug" >> $GITHUB_ENV
|
||||
|
||||
- name: Run tests
|
||||
id: testing
|
||||
working-directory: hostap/tests/hwsim/
|
||||
run: |
|
||||
cat <<EOF >> vm/vm-config
|
||||
KERNELDIR=$GITHUB_WORKSPACE/linux
|
||||
KVMARGS="-cpu host"
|
||||
EOF
|
||||
# Run tests in increments of 200 to not stall out the parallel-vm script
|
||||
while mapfile -t -n 200 ary && ((${#ary[@]})); do
|
||||
TESTS=$(printf '%s\n' "${ary[@]}" | tr '\n' ' ')
|
||||
HWSIM_RES=0 # Not set when command succeeds
|
||||
./vm/parallel-vm.py ${{ env.hostap_debug_flags }} --nocurses $(nproc) $TESTS || HWSIM_RES=$?
|
||||
if [ "$HWSIM_RES" -ne "0" ]; then
|
||||
# Let's re-run the failing tests. We gather the failed tests from the log file.
|
||||
FAILED_TESTS=$(grep 'failed tests' /tmp/hwsim-test-logs/*-parallel.log | sed 's/failed tests: //' | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
|
||||
printf 'failed tests: %s\n' "$FAILED_TESTS"
|
||||
./vm/parallel-vm.py ${{ env.hostap_debug_flags }} --nocurses $(nproc) $FAILED_TESTS
|
||||
fi
|
||||
rm -r /tmp/hwsim-test-logs
|
||||
done < $GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/tests
|
||||
|
||||
# The logs are quite big. It hasn't been useful so far so let's not waste
|
||||
# precious gh space.
|
||||
#- name: zip logs
|
||||
# if: ${{ failure() && steps.testing.outcome == 'failure' }}
|
||||
# working-directory: hostap/tests/hwsim/
|
||||
# run: |
|
||||
# rm /tmp/hwsim-test-logs/latest
|
||||
# zip -9 -r logs.zip /tmp/hwsim-test-logs
|
||||
#
|
||||
#- name: Upload failure logs
|
||||
# if: ${{ failure() && steps.testing.outcome == 'failure' }}
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: hostap-logs-${{ env.our_job_run_id }}
|
||||
# path: hostap/tests/hwsim/logs.zip
|
||||
# retention-days: 5
|
||||
77
.github/workflows/ipmitool.yml
vendored
Normal file
77
.github/workflows/ipmitool.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
name: ipmitool Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-all
|
||||
install: true
|
||||
# Don't run tests as this config is tested in many other places
|
||||
check: false
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-ipmitool
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
build_ipmitool:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
git_ref: [ c3939dac2c060651361fc71516806f9ab8c38901 ]
|
||||
name: ${{ matrix.git_ref }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-ipmitool
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Build ipmitool
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
repository: ipmitool/ipmitool
|
||||
ref: ${{ matrix.git_ref }}
|
||||
path: ipmitool
|
||||
patch-file: $GITHUB_WORKSPACE/osp/ipmitool/*-${{ matrix.git_ref }}.patch
|
||||
configure: --with-wolfssl=$GITHUB_WORKSPACE/build-dir
|
||||
# No checks included and not running since it depends on hardware
|
||||
check: false
|
||||
|
||||
- name: Confirm built with wolfSSL
|
||||
working-directory: ipmitool
|
||||
run: |
|
||||
ldd src/ipmitool | grep wolfssl
|
||||
ldd src/ipmievd | grep wolfssl
|
||||
|
||||
85
.github/workflows/jwt-cpp.yml
vendored
Normal file
85
.github/workflows/jwt-cpp.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: jwt-cpp Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-all
|
||||
install: true
|
||||
# Don't run tests as this config is tested in many other places
|
||||
check: false
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-jwt-cpp
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
build_pam-ipmi:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ref: [ 0.6.0 ]
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Don't prompt for anything
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update
|
||||
sudo apt-get install libgtest-dev
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-jwt-cpp
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Checkout jwt-cpp
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: Thalhammer/jwt-cpp
|
||||
path: jwt-cpp
|
||||
ref: v${{ matrix.ref }}
|
||||
|
||||
- name: Build pam-ipmi
|
||||
working-directory: jwt-cpp
|
||||
run: |
|
||||
patch -p1 < ../osp/jwt-cpp/${{ matrix.ref }}.patch
|
||||
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig \
|
||||
cmake -B build -DJWT_SSL_LIBRARY:STRING=wolfSSL -DJWT_BUILD_TESTS=ON .
|
||||
make -j -C build
|
||||
ldd ./build/tests/jwt-cpp-test | grep wolfssl
|
||||
|
||||
- name: Run jwt-cpp tests
|
||||
working-directory: jwt-cpp
|
||||
run: ./build/tests/jwt-cpp-test
|
||||
31
.github/workflows/krb5.yml
vendored
31
.github/workflows/krb5.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Kerberos 5 Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -11,19 +20,23 @@ jobs:
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: workaround high-entropy ASLR
|
||||
# not needed after either an update to llvm or runner is done
|
||||
run: sudo sysctl vm.mmap_rnd_bits=28
|
||||
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-krb CFLAGS='-fsanitize=address'
|
||||
configure: --enable-krb CC='gcc -fsanitize=address'
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-krb5
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
krb5_check:
|
||||
strategy:
|
||||
@@ -38,19 +51,19 @@ jobs:
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-krb5
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Checkout krb5
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: krb5/krb5
|
||||
ref: krb5-${{ matrix.ref }}-final
|
||||
@@ -61,6 +74,10 @@ jobs:
|
||||
run: |
|
||||
patch -p1 < $GITHUB_WORKSPACE/osp/krb5/Patch-for-Kerberos-5-${{ matrix.ref }}.patch
|
||||
|
||||
- name: workaround high-entropy ASLR
|
||||
# not needed after either an update to llvm or runner is done
|
||||
run: sudo sysctl vm.mmap_rnd_bits=28
|
||||
|
||||
- name: Build krb5
|
||||
working-directory: ./krb5/src
|
||||
run: |
|
||||
|
||||
67
.github/workflows/libssh2.yml
vendored
Normal file
67
.github/workflows/libssh2.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
name: libssh2 Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-all
|
||||
check: false # config is already tested in many other PRB's
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-libssh2
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
libssh2_check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# List of releases to test
|
||||
ref: [ 1.11.0 ]
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 8
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-libssh2
|
||||
path: build-dir
|
||||
|
||||
- name: Build and test libssh2
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
repository: libssh2/libssh2
|
||||
ref: libssh2-${{ matrix.ref }}
|
||||
path: libssh2
|
||||
configure: --with-crypto=wolfssl --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
|
||||
check: true
|
||||
|
||||
- name: Confirm libssh2 built with wolfSSL
|
||||
working-directory: ./libssh2
|
||||
run: ldd src/.libs/libssh2.so | grep wolfssl
|
||||
79
.github/workflows/libvncserver.yml
vendored
Normal file
79
.github/workflows/libvncserver.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
name: libvncserver Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-all
|
||||
install: true
|
||||
# Don't run tests as this config is tested in many other places
|
||||
check: false
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-libvncserver
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
build_libvncserver:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ref: [ 0.9.13 ]
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-libvncserver
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Checkout libvncserver
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: LibVNC/libvncserver
|
||||
path: libvncserver
|
||||
ref: LibVNCServer-${{ matrix.ref }}
|
||||
|
||||
- name: Build libvncserver
|
||||
working-directory: libvncserver
|
||||
run: |
|
||||
patch -p1 < ../osp/libvncserver/${{ matrix.ref }}.patch
|
||||
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig \
|
||||
cmake -B build -DWITH_GNUTLS=OFF -DWITH_OPENSSL=OFF -DWITH_GCRYPT=OFF -DWITH_WOLFSSL=ON .
|
||||
make -j -C build VERBOSE=1
|
||||
ldd build/libvncclient.so | grep wolfssl
|
||||
ldd build/libvncserver.so | grep wolfssl
|
||||
|
||||
- name: Run libvncserver tests
|
||||
working-directory: libvncserver
|
||||
run: make -C build test
|
||||
47
.github/workflows/main.yml
vendored
47
.github/workflows/main.yml
vendored
@@ -1,47 +0,0 @@
|
||||
name: CI
|
||||
concurrency:
|
||||
group: ${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
jobs:
|
||||
espressif:
|
||||
uses: ./.github/workflows/docker-Espressif.yml
|
||||
multi-compiler:
|
||||
uses: ./.github/workflows/multi-compiler.yml
|
||||
multi-arch:
|
||||
uses: ./.github/workflows/multi-arch.yml
|
||||
openwrt:
|
||||
uses: ./.github/workflows/docker-OpenWrt.yml
|
||||
os-check:
|
||||
uses: ./.github/workflows/os-check.yml
|
||||
async:
|
||||
uses: ./.github/workflows/async.yml
|
||||
stunnel:
|
||||
uses: ./.github/workflows/stunnel.yml
|
||||
openvpn:
|
||||
uses: ./.github/workflows/openvpn.yml
|
||||
hostap:
|
||||
uses: ./.github/workflows/hostap.yml
|
||||
nginx:
|
||||
uses: ./.github/workflows/nginx.yml
|
||||
zephyr:
|
||||
uses: ./.github/workflows/zephyr.yml
|
||||
hitch:
|
||||
uses: ./.github/workflows/hitch.yml
|
||||
curl:
|
||||
uses: ./.github/workflows/curl.yml
|
||||
krb5:
|
||||
uses: ./.github/workflows/krb5.yml
|
||||
packaging:
|
||||
uses: ./.github/workflows/packaging.yml
|
||||
memcached:
|
||||
uses: ./.github/workflows/memcached.yml
|
||||
# TODO: Currently this test fails. Enable it once it becomes passing.
|
||||
# haproxy:
|
||||
# uses: ./.github/workflows/haproxy.yml
|
||||
21
.github/workflows/memcached.yml
vendored
21
.github/workflows/memcached.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: memcached Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -20,11 +29,11 @@ jobs:
|
||||
run: cp wolfssl/.github/workflows/memcached.sh build-dir/bin
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-memcached
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
memcached_check:
|
||||
strategy:
|
||||
@@ -38,13 +47,13 @@ jobs:
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-memcached
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
@@ -56,7 +65,7 @@ jobs:
|
||||
sudo apt-get install -y libevent-dev libevent-2.1-7 automake pkg-config make libio-socket-ssl-perl
|
||||
|
||||
- name: Checkout memcached
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: memcached/memcached
|
||||
ref: 1.6.22
|
||||
|
||||
13
.github/workflows/multi-arch.yml
vendored
13
.github/workflows/multi-arch.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Multiple architectures
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
my_matrix:
|
||||
@@ -35,7 +44,7 @@ jobs:
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y crossbuild-essential-${{ matrix.ARCH }} qemu-user
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
env:
|
||||
CC: ${{ matrix.CC }}
|
||||
|
||||
13
.github/workflows/multi-compiler.yml
vendored
13
.github/workflows/multi-compiler.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Multiple compilers and versions
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
my_matrix:
|
||||
@@ -41,7 +50,7 @@ jobs:
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
env:
|
||||
CC: ${{ matrix.CC }}
|
||||
|
||||
77
.github/workflows/net-snmp.yml
vendored
Normal file
77
.github/workflows/net-snmp.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
name: net-snmp Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-net-snmp
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-net-snmp
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
net-snmp_check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# List of releases to test
|
||||
include:
|
||||
- ref: 5.9.3
|
||||
test_opts: -e 'agentxperl'
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-net-snmp
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Build net-snmp
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
repository: net-snmp/net-snmp
|
||||
ref: v${{ matrix.ref }}
|
||||
path: net-snmp
|
||||
patch-file: $GITHUB_WORKSPACE/osp/net-snmp/${{ matrix.ref }}.patch
|
||||
configure: --disable-shared --with-wolfssl=$GITHUB_WORKSPACE/build-dir
|
||||
check: false
|
||||
|
||||
- name: Run net-snmp tests
|
||||
working-directory: net-snmp
|
||||
run: |
|
||||
autoconf --version | grep -P '2\.\d\d' -o > dist/autoconf-version
|
||||
make -j test TESTOPTS="${{ matrix.test_opts }}"
|
||||
29
.github/workflows/nginx.yml
vendored
29
.github/workflows/nginx.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: nginx Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -25,11 +34,11 @@ jobs:
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-nginx
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
nginx_check:
|
||||
strategy:
|
||||
@@ -99,7 +108,7 @@ jobs:
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-nginx
|
||||
path: build-dir
|
||||
@@ -109,13 +118,13 @@ jobs:
|
||||
sudo cpan -iT Proc::Find Net::SSLeay IO::Socket::SSL
|
||||
|
||||
- name: Checkout wolfssl-nginx
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/wolfssl-nginx
|
||||
path: wolfssl-nginx
|
||||
|
||||
- name: Checkout nginx
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: nginx/nginx
|
||||
path: nginx
|
||||
@@ -131,7 +140,7 @@ jobs:
|
||||
run: patch -p1 < ../wolfssl-nginx/nginx-${{ matrix.ref }}-wolfssl-debug.patch
|
||||
|
||||
- name: Checkout nginx-tests
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: nginx/nginx-tests
|
||||
path: nginx-tests
|
||||
@@ -174,6 +183,10 @@ jobs:
|
||||
run: |
|
||||
echo "nginx_c_flags=-O0" >> $GITHUB_ENV
|
||||
|
||||
- name: workaround high-entropy ASLR
|
||||
# not needed after either an update to llvm or runner is done
|
||||
run: sudo sysctl vm.mmap_rnd_bits=28
|
||||
|
||||
- name: Build nginx with sanitizer
|
||||
working-directory: nginx
|
||||
run: |
|
||||
@@ -203,4 +216,4 @@ jobs:
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
|
||||
TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_BINARY=../nginx/objs/nginx \
|
||||
prove ${{ matrix.sanitize-ok }}
|
||||
|
||||
|
||||
|
||||
43
.github/workflows/no-malloc.yml
vendored
Normal file
43
.github/workflows/no-malloc.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: No Malloc Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
make_check:
|
||||
strategy:
|
||||
matrix:
|
||||
config: [
|
||||
# Add new configs here
|
||||
'--enable-rsa --enable-keygen --disable-dh CFLAGS="-DWOLFSSL_NO_MALLOC"',
|
||||
]
|
||||
name: make check
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 6
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout wolfSSL
|
||||
|
||||
- name: Test wolfSSL
|
||||
run: |
|
||||
./autogen.sh
|
||||
./configure ${{ matrix.config }}
|
||||
make
|
||||
./wolfcrypt/test/testwolfcrypt
|
||||
|
||||
- name: Print errors
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
if [ -f test-suite.log ] ; then
|
||||
cat test-suite.log
|
||||
fi
|
||||
37
.github/workflows/ocsp.yml
vendored
Normal file
37
.github/workflows/ocsp.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: OCSP Test
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
ocsp_stapling:
|
||||
name: ocsp stapling
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout wolfSSL
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build wolfSSL
|
||||
run: autoreconf -ivf && ./configure --enable-ocsp --enable-ocspstapling && make
|
||||
|
||||
- name: Start OCSP responder 1
|
||||
run: openssl ocsp -port 22221 -ndays 1000 -index certs/ocsp/index-intermediate1-ca-issued-certs.txt -rsigner certs/ocsp/ocsp-responder-cert.pem -rkey certs/ocsp/ocsp-responder-key.pem -CA certs/ocsp/intermediate1-ca-cert.pem &
|
||||
|
||||
- name: Start OCSP responder 2
|
||||
run: openssl ocsp -port 22220 -ndays 1000 -index certs/ocsp/index-ca-and-intermediate-cas.txt -rsigner certs/ocsp/ocsp-responder-cert.pem -rkey certs/ocsp/ocsp-responder-key.pem -CA certs/ocsp/root-ca-cert.pem &
|
||||
|
||||
- name: Start TLS server
|
||||
run: ./examples/server/server -p 11111 -c ./certs/ocsp/server1-cert.pem -k ./certs/ocsp/server1-key.pem -d &
|
||||
|
||||
- name: Test Look Up
|
||||
run: ./examples/client/client -A ./certs/ocsp/root-ca-cert.pem -o
|
||||
77
.github/workflows/openssh.yml
vendored
Normal file
77
.github/workflows/openssh.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
name: openssh Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: >-
|
||||
--enable-openssh --enable-dsa --with-max-rsa-bits=8192
|
||||
--enable-intelasm --enable-sp-asm
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-openssh
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
openssh_check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- git_ref: 'V_9_6_P1'
|
||||
osp_ver: '9.6'
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-openssh
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Build and test openssh
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
repository: openssh/openssh-portable
|
||||
ref: ${{ matrix.git_ref }}
|
||||
path: openssh
|
||||
patch-file: $GITHUB_WORKSPACE/osp/openssh-patches/openssh-${{ matrix.osp_ver }}.patch
|
||||
configure: --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-rpath=-Wl,-rpath=
|
||||
check: false
|
||||
|
||||
# make tests take >20 minutes. Consider limiting?
|
||||
- name: Run tests
|
||||
working-directory: ./openssh
|
||||
run: |
|
||||
# Run all the tests except (t-exec) as it takes too long
|
||||
make file-tests interop-tests extra-tests unit
|
||||
27
.github/workflows/openvpn.yml
vendored
27
.github/workflows/openvpn.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: OpenVPN Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -19,26 +28,26 @@ jobs:
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-openvpn
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
openvpn_check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# List of refs to test
|
||||
ref: [ master, release/2.6, v2.6.0 ]
|
||||
ref: [ release/2.6, v2.6.0, master ]
|
||||
name: ${{ matrix.ref }}
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 6
|
||||
timeout-minutes: 10
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-openvpn
|
||||
path: build-dir
|
||||
@@ -50,10 +59,14 @@ jobs:
|
||||
linux-libc-dev man2html libcmocka-dev python3-docutils \
|
||||
libtool automake autoconf libnl-genl-3-dev libnl-genl-3-200
|
||||
|
||||
- name: workaround high-entropy ASLR
|
||||
# not needed after either an update to llvm or runner is done
|
||||
run: sudo sysctl vm.mmap_rnd_bits=28
|
||||
|
||||
- if: ${{ matrix.ref != 'master' }}
|
||||
name: Build and test openvpn with fsanitize
|
||||
run: |
|
||||
echo 'extra_c_flags=CFLAGS="-fsanitize=address -fno-omit-frame-pointer -O2"' >> $GITHUB_ENV
|
||||
echo 'extra_c_flags=CC="gcc -fsanitize=address" CFLAGS="-fno-omit-frame-pointer -O2"' >> $GITHUB_ENV
|
||||
|
||||
- name: Build and test openvpn
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
|
||||
19
.github/workflows/os-check.yml
vendored
19
.github/workflows/os-check.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Ubuntu-Macos-Windows Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
make_check:
|
||||
@@ -67,6 +76,8 @@ jobs:
|
||||
'examples/configs/user_settings_min_ecc.h',
|
||||
'examples/configs/user_settings_wolfboot_keytools.h',
|
||||
'examples/configs/user_settings_wolftpm.h',
|
||||
'examples/configs/user_settings_wolfssh.h',
|
||||
'examples/configs/user_settings_tls12.h',
|
||||
]
|
||||
name: make user_setting.h (testwolfcrypt only)
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -94,7 +105,7 @@ jobs:
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 14
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- if: ${{ matrix.os == 'macos-latest' }}
|
||||
run: brew install automake libtool
|
||||
- run: ./autogen.sh
|
||||
@@ -121,10 +132,10 @@ jobs:
|
||||
BUILD_CONFIGURATION: Release
|
||||
BUILD_PLATFORM: x64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Restore NuGet packages
|
||||
working-directory: ${{env.GITHUB_WORKSPACE}}
|
||||
|
||||
13
.github/workflows/packaging.yml
vendored
13
.github/workflows/packaging.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Packaging Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -11,7 +20,7 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checkout wolfSSL
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure wolfSSL
|
||||
run: |
|
||||
|
||||
86
.github/workflows/pam-ipmi.yml
vendored
Normal file
86
.github/workflows/pam-ipmi.yml
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
name: pam-ipmi Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
# Just to keep it the same as the testing target
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-all
|
||||
install: true
|
||||
# Don't run tests as this config is tested in many other places
|
||||
check: false
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-pam-ipmi
|
||||
path: build-dir
|
||||
retention-days: 5
|
||||
|
||||
build_pam-ipmi:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
git_ref: [ e4b13e6725abb178f62ee897fe1c0e81b06a9431 ]
|
||||
name: ${{ matrix.git_ref }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Don't prompt for anything
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
sudo apt-get update
|
||||
sudo apt-get install libpam-dev ninja-build
|
||||
sudo pip3 install meson
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-pam-ipmi
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Checkout pam-ipmi
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: openbmc/pam-ipmi
|
||||
path: pam-ipmi
|
||||
ref: ${{ matrix.git_ref }}
|
||||
|
||||
- name: Build pam-ipmi
|
||||
working-directory: pam-ipmi
|
||||
run: |
|
||||
patch -p1 < ../osp/pam-ipmi/*-${{ matrix.git_ref }}.patch
|
||||
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig meson setup build
|
||||
ninja -C build
|
||||
|
||||
- name: Confirm built with wolfSSL
|
||||
working-directory: pam-ipmi
|
||||
run: |
|
||||
ldd ./build/src/pam_ipmisave/pam_ipmisave.so | grep wolfssl
|
||||
76
.github/workflows/socat.yml
vendored
Normal file
76
.github/workflows/socat.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
name: socat Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 4
|
||||
steps:
|
||||
- name: Build wolfSSL
|
||||
uses: wolfSSL/actions-build-autotools-project@v1
|
||||
with:
|
||||
path: wolfssl
|
||||
configure: --enable-maxfragment --enable-opensslall --enable-opensslextra --enable-dtls --enable-oldtls --enable-tlsv10 --enable-ipv6 'CPPFLAGS=-DWOLFSSL_NO_DTLS_SIZE_CHECK -DOPENSSL_COMPATIBLE_DEFAULTS'
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-socat
|
||||
path: build-dir
|
||||
retention-days: 3
|
||||
|
||||
|
||||
socat_check:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 30
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Install prereqs
|
||||
run:
|
||||
sudo apt-get install build-essential autoconf libtool pkg-config clang libc++-dev
|
||||
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-socat
|
||||
path: build-dir
|
||||
|
||||
- name: Download socat
|
||||
run: curl -O http://www.dest-unreach.org/socat/download/socat-1.8.0.0.tar.gz && tar xvf socat-1.8.0.0.tar.gz
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
- name: Build socat
|
||||
working-directory: ./socat-1.8.0.0
|
||||
run: |
|
||||
patch -p1 < ../osp/socat/1.8.0.0/socat-1.8.0.0.patch
|
||||
autoreconf -vfi
|
||||
./configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir
|
||||
make
|
||||
|
||||
- name: Run socat tests
|
||||
working-directory: ./socat-1.8.0.0
|
||||
run: |
|
||||
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
|
||||
export SHELL=/bin/bash
|
||||
SOCAT=$GITHUB_WORKSPACE/socat-1.8.0.0/socat ./test.sh -t 0.5 --expect-fail 146,216,309,310,386,399,402,459,460,467,468,478,492,528,530
|
||||
19
.github/workflows/stunnel.yml
vendored
19
.github/workflows/stunnel.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: stunnel Tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
@@ -19,11 +28,11 @@ jobs:
|
||||
install: true
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolf-install-stunnel
|
||||
path: build-dir
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
|
||||
stunnel_check:
|
||||
strategy:
|
||||
@@ -38,13 +47,13 @@ jobs:
|
||||
needs: build_wolfssl
|
||||
steps:
|
||||
- name: Download lib
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolf-install-stunnel
|
||||
path: build-dir
|
||||
|
||||
- name: Checkout OSP
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/osp
|
||||
path: osp
|
||||
|
||||
42
.github/workflows/zephyr.yml
vendored
42
.github/workflows/zephyr.yml
vendored
@@ -1,7 +1,16 @@
|
||||
name: Zephyr tests
|
||||
|
||||
# START OF COMMON SECTION
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# END OF COMMON SECTION
|
||||
|
||||
jobs:
|
||||
run_test:
|
||||
@@ -14,9 +23,11 @@ jobs:
|
||||
zephyr-sdk: 0.16.1
|
||||
- zephyr-ref: v3.5.0
|
||||
zephyr-sdk: 0.16.3
|
||||
- zephyr-ref: v2.7.4
|
||||
zephyr-sdk: 0.16.3
|
||||
runs-on: ubuntu-latest
|
||||
# This should be a safe limit for the tests to run.
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 25
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@@ -64,30 +75,43 @@ jobs:
|
||||
|
||||
- name: Install zephyr SDK
|
||||
run: |
|
||||
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ matrix.config.zephyr-sdk }}/zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64.tar.xz
|
||||
tar xf zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64.tar.xz
|
||||
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ matrix.config.zephyr-sdk }}/zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
|
||||
tar xf zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
|
||||
cd zephyr-sdk-${{ matrix.config.zephyr-sdk }}
|
||||
./setup.sh -h -c
|
||||
./setup.sh -h -c -t x86_64-zephyr-elf
|
||||
|
||||
- name: Fix options for 2.7.4
|
||||
if: ${{ matrix.config.zephyr-ref == 'v2.7.4' }}
|
||||
working-directory: zephyr/modules/crypto/wolfssl
|
||||
run: |
|
||||
sed -i -e 's/CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE/CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE/g' $(find -name prj.conf)
|
||||
|
||||
- name: Run wolfssl test
|
||||
id: wolfssl-test
|
||||
working-directory: zephyr
|
||||
run: |
|
||||
./zephyr/scripts/twister --testsuite-root modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test -vvv
|
||||
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test -vvv
|
||||
rm -rf zephyr/twister-out
|
||||
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test_no_malloc -vvv
|
||||
rm -rf zephyr/twister-out
|
||||
|
||||
- name: Run wolfssl TLS sock test
|
||||
# Results in a page fault that I can't trace
|
||||
if: ${{ matrix.config.zephyr-ref != 'v2.7.4' }}
|
||||
id: wolfssl-tls-sock
|
||||
working-directory: zephyr
|
||||
run: |
|
||||
./zephyr/scripts/twister --testsuite-root modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock -vvv
|
||||
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock -vvv
|
||||
rm -rf zephyr/twister-out
|
||||
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock_no_malloc -vvv
|
||||
rm -rf zephyr/twister-out
|
||||
|
||||
- name: Run wolfssl TLS thread test
|
||||
if: ${{ matrix.config.zephyr-ref != 'v2.7.4' }}
|
||||
id: wolfssl-tls-thread
|
||||
working-directory: zephyr
|
||||
run: |
|
||||
./zephyr/scripts/twister --testsuite-root modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_thread/sample.crypto.wolfssl_tls_thread -vvv
|
||||
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_thread/sample.crypto.wolfssl_tls_thread -vvv
|
||||
rm -rf zephyr/twister-out
|
||||
|
||||
- name: Zip failure logs
|
||||
@@ -97,7 +121,7 @@ jobs:
|
||||
|
||||
- name: Upload failure logs
|
||||
if: ${{ failure() && (steps.wolfssl-test.outcome == 'failure' || steps.wolfssl-tls-sock.outcome == 'failure' || steps.wolfssl-tls-thread.outcome == 'failure') }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: zephyr-client-test-logs
|
||||
path: logs.zip
|
||||
|
||||
48
.gitignore
vendored
48
.gitignore
vendored
@@ -82,16 +82,19 @@ snifftest
|
||||
output
|
||||
mcapi/test
|
||||
testsuite/testsuite
|
||||
tests/unit
|
||||
testsuite/testsuite.test
|
||||
testsuite/*.der
|
||||
testsuite/*.pem
|
||||
testsuite/*.raw
|
||||
testsuite/*.obj
|
||||
testsuite/*.pdb
|
||||
testsuite/*.idb
|
||||
tests/unit
|
||||
tests/unit.test
|
||||
tests/bio_write_test.txt
|
||||
tests/test-log-dump-to-file.txt
|
||||
tests/cert_cache.tmp
|
||||
test-write-dhparams.pem
|
||||
testsuite/*.der
|
||||
testsuite/*.pem
|
||||
testsuite/*.raw
|
||||
cert.der
|
||||
cert.pem
|
||||
certecc.der
|
||||
@@ -286,23 +289,6 @@ mqx/wolfcrypt_benchmark/.settings
|
||||
mqx/wolfcrypt_benchmark/.cwGeneratedFileSetLog
|
||||
mqx/wolfcrypt_benchmark/SaAnalysispointsManager.apconfig
|
||||
|
||||
# User Crypto example build
|
||||
wolfcrypt/user-crypto/aclocal.m4
|
||||
wolfcrypt/user-crypto/config.guess
|
||||
wolfcrypt/user-crypto/autom4te.cache
|
||||
wolfcrypt/user-crypto/config.log
|
||||
wolfcrypt/user-crypto/config.status
|
||||
wolfcrypt/user-crypto/config.sub
|
||||
wolfcrypt/user-crypto/depcomp
|
||||
wolfcrypt/user-crypto/install-sh
|
||||
wolfcrypt/user-crypto/libtool
|
||||
wolfcrypt/user-crypto/ltmain.sh
|
||||
wolfcrypt/user-crypto/m4
|
||||
wolfcrypt/user-crypto/missing
|
||||
wolfcrypt/user-crypto/Makefile.in
|
||||
wolfcrypt/user-crypto/lib/libusercrypto.*
|
||||
*.hzs
|
||||
|
||||
# wolfSSL CSharp wrapper
|
||||
wrapper/CSharp/x64/
|
||||
|
||||
@@ -339,6 +325,10 @@ wolfcrypt/src/port/intel/qat_test
|
||||
# Arduino Generated Files
|
||||
/IDE/ARDUINO/wolfSSL
|
||||
scripts/memtest.txt
|
||||
/IDE/ARDUINO/Arduino_README_prepend.md.tmp
|
||||
/IDE/ARDUINO/library.properties.tmp
|
||||
/IDE/ARDUINO/library.properties.tmp.backup
|
||||
/IDE/ARDUINO/PREPENDED_README.md
|
||||
|
||||
# Doxygen generated files
|
||||
doc/doxygen_warnings
|
||||
@@ -415,7 +405,7 @@ XXX-fips-test
|
||||
# Generated user_settings_asm.h.
|
||||
user_settings_asm.h
|
||||
|
||||
# VisualGD
|
||||
# VisualGDB
|
||||
**/.visualgdb
|
||||
|
||||
# Espressif sdk config default should be saved in sdkconfig.defaults
|
||||
@@ -423,6 +413,12 @@ user_settings_asm.h
|
||||
/IDE/Espressif/**/sdkconfig
|
||||
/IDE/Espressif/**/sdkconfig.old
|
||||
|
||||
# MPLAB
|
||||
/IDE/MPLABX16/wolfssl.X/dist/default/
|
||||
/IDE/MPLABX16/wolfssl.X/.generated_files
|
||||
/IDE/MPLABX16/wolfcrypt_test.X/dist/default/
|
||||
/IDE/MPLABX16/wolfcrypt_test.X/.generated_files
|
||||
|
||||
# auto-created CMake backups
|
||||
**/CMakeLists.txt.old
|
||||
|
||||
@@ -437,3 +433,11 @@ MagicCrypto
|
||||
debian/changelog
|
||||
debian/control
|
||||
*.deb
|
||||
|
||||
# PlatformIO
|
||||
/**/.pio
|
||||
/**/.vscode/.browse.c_cpp.db*
|
||||
/**/.vscode/c_cpp_properties.json
|
||||
/**/.vscode/launch.json
|
||||
/**/.vscode/ipch
|
||||
/**/sdkconfig.esp32dev
|
||||
|
||||
429
CMakeLists.txt
429
CMakeLists.txt
@@ -1,6 +1,6 @@
|
||||
# CMakeList.txt
|
||||
# CMakeLists.txt
|
||||
#
|
||||
# Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
# Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
#
|
||||
@@ -21,6 +21,12 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.22")
|
||||
message(STATUS "This project recommends using CMake version 3.22 or higher. You are using ${CMAKE_VERSION}.")
|
||||
else()
|
||||
cmake_policy(SET CMP0128 NEW)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
message(FATAL_ERROR "In-source builds are not allowed.\
|
||||
Run cmake from a separate directory from where CMakeLists.txt lives.\
|
||||
@@ -28,7 +34,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
You must delete them, or cmake will refuse to work.")
|
||||
endif()
|
||||
|
||||
project(wolfssl VERSION 5.6.6 LANGUAGES C ASM)
|
||||
project(wolfssl VERSION 5.7.2 LANGUAGES C ASM)
|
||||
|
||||
# Set WOLFSSL_ROOT if not already defined
|
||||
if ("${WOLFSSL_ROOT}" STREQUAL "")
|
||||
@@ -42,16 +48,19 @@ else()
|
||||
endif()
|
||||
|
||||
# shared library versioning
|
||||
# increment if interfaces have been added, removed or changed
|
||||
set(LIBTOOL_CURRENT 42)
|
||||
# increment if source code has changed set to zero if current is incremented
|
||||
set(LIBTOOL_REVISION 0)
|
||||
# increment if interfaces have been added set to zero if interfaces have been
|
||||
# removed or changed
|
||||
set(LIBTOOL_AGE 0)
|
||||
# increment if interfaces have been removed or changed
|
||||
set(WOLFSSL_LIBRARY_VERSION_FIRST 42)
|
||||
|
||||
math(EXPR LIBTOOL_SO_VERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}")
|
||||
set(LIBTOOL_FULL_VERSION ${LIBTOOL_SO_VERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION})
|
||||
# increment if interfaces have been added
|
||||
# set to zero if WOLFSSL_LIBRARY_VERSION_FIRST is incremented
|
||||
set(WOLFSSL_LIBRARY_VERSION_SECOND 2)
|
||||
|
||||
# increment if source code has changed
|
||||
# set to zero if WOLFSSL_LIBRARY_VERSION_FIRST is incremented or
|
||||
# WOLFSSL_LIBRARY_VERSION_SECOND is incremented
|
||||
set(WOLFSSL_LIBRARY_VERSION_THIRD 0)
|
||||
|
||||
set(LIBTOOL_FULL_VERSION ${WOLFSSL_LIBRARY_VERSION_FIRST}.${WOLFSSL_LIBRARY_VERSION_SECOND}.${WOLFSSL_LIBRARY_VERSION_THIRD})
|
||||
|
||||
set(WOLFSSL_DEFINITIONS)
|
||||
set(WOLFSSL_LINK_LIBS)
|
||||
@@ -130,9 +139,15 @@ if(HAVE___UINT128_T)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE___UINT128_T")
|
||||
endif()
|
||||
|
||||
include(TestBigEndian)
|
||||
|
||||
test_big_endian(WORDS_BIGENDIAN)
|
||||
if(CMAKE_VERSION VERSION_LESS "3.20")
|
||||
# TestBigEndian was deprecated in 3.20
|
||||
include(TestBigEndian)
|
||||
test_big_endian(IS_BIG_ENDIAN)
|
||||
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
|
||||
if(IS_BIG_ENDIAN)
|
||||
set(CMAKE_C_BYTE_ORDER "BIG_ENDIAN")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Thread local storage
|
||||
include(CheckCSourceCompiles)
|
||||
@@ -215,6 +230,8 @@ if(WOLFSSL_REPRODUCIBLE_BUILD)
|
||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
|
||||
endif()
|
||||
|
||||
add_option("WOLFSSL_INSTALL" "Create install target for WolfSSL project" "yes" "yes;no")
|
||||
|
||||
# Support for forcing 32-bit mode
|
||||
# TODO: detect platform from other options
|
||||
add_option("WOLFSSL_32BIT"
|
||||
@@ -267,6 +284,8 @@ if(NOT WOLFSSL_SINGLE_THREADED)
|
||||
"-DHAVE_PTHREAD"
|
||||
"-D_POSIX_THREADS")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DSINGLE_THREADED")
|
||||
endif()
|
||||
|
||||
# DTLS-SRTP
|
||||
@@ -420,7 +439,7 @@ add_option(WOLFSSL_ALPN
|
||||
"no" "yes;no")
|
||||
|
||||
if(WOLFSSL_ALPN)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_ALPN" "-DHAVE_TLS_EXTENSIONS")
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_ALPN" "-DHAVE_TLS_EXTENSIONS")
|
||||
endif()
|
||||
|
||||
# altcertchains
|
||||
@@ -519,6 +538,15 @@ if (WOLFSSL_OPENSSLALL)
|
||||
"-DWOLFSSL_ERROR_CODE_OPENSSL" "-DWOLFSSL_CERT_NAME_ALL")
|
||||
endif()
|
||||
|
||||
add_option(WOLFSSL_NO_STUB
|
||||
"Removes OpenSSL compatibility stub functions (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
if (WOLFSSL_NO_STUB)
|
||||
list(APPEND WOLFSSL_DEFINITIONS
|
||||
"-DNO_WOLFSSL_STUB")
|
||||
endif()
|
||||
|
||||
# TODO: - IPv6 test apps
|
||||
|
||||
set(WOLFSSL_SLOW_MATH "yes")
|
||||
@@ -528,16 +556,89 @@ add_option(WOLFSSL_OQS
|
||||
"Enable integration with the OQS (Open Quantum Safe) liboqs library (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
if (WOLFSSL_OQS)
|
||||
find_package(OQS)
|
||||
# Kyber
|
||||
add_option(WOLFSSL_KYBER
|
||||
"Enable the wolfSSL PQ Kyber library (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
if (OQS_FOUND)
|
||||
list(APPEND WOLFSSL_LINK_LIBS ${OQS_LIBRARY})
|
||||
list(APPEND WOLFSSL_INCLUDE_DIRS ${OQS_INCLUDE_DIR})
|
||||
set(HAVE_LIBOQS 1)
|
||||
list(APPEND WOLFSSL_DEFINITIONS
|
||||
"-DHAVE_TLS_EXTENSIONS"
|
||||
"-DHAVE_LIBOQS")
|
||||
# Experimental features
|
||||
add_option(WOLFSSL_EXPERIMENTAL
|
||||
"Enable experimental features (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
message(STATUS "Looking for WOLFSSL_EXPERIMENTAL")
|
||||
if (WOLFSSL_EXPERIMENTAL)
|
||||
message(STATUS "Looking for WOLFSSL_EXPERIMENTAL - found")
|
||||
|
||||
# We've enabled the experimental environment, but let's
|
||||
# check if any experimental features are also enabled:
|
||||
set(WOLFSSL_FOUND_EXPERIMENTAL_FEATURE 0)
|
||||
|
||||
set_wolfssl_definitions("WOLFSSL_EXPERIMENTAL_SETTINGS" RESUlT)
|
||||
|
||||
# Checking for experimental feature: OQS
|
||||
message(STATUS "Looking for WOLFSSL_OQS")
|
||||
if (WOLFSSL_OQS)
|
||||
set(WOLFSSL_FOUND_EXPERIMENTAL_FEATURE 1)
|
||||
message(STATUS "Looking for WOLFSSL_OQS - found")
|
||||
|
||||
message(STATUS "Checking OQS")
|
||||
find_package(OQS)
|
||||
if (OQS_FOUND)
|
||||
message(STATUS "Checking OQS - found")
|
||||
list(APPEND WOLFSSL_LINK_LIBS ${OQS_LIBRARY})
|
||||
list(APPEND WOLFSSL_INCLUDE_DIRS ${OQS_INCLUDE_DIR})
|
||||
|
||||
set_wolfssl_definitions("HAVE_LIBOQS" RESUlT)
|
||||
set_wolfssl_definitions("HAVE_TLS_EXTENSIONS" RESUlT)
|
||||
set_wolfssl_definitions("OPENSSL_EXTRA" RESUlT)
|
||||
|
||||
else()
|
||||
message(STATUS "Checking OQS - not found")
|
||||
message(STATUS "WARNING: WOLFSSL_OQS enabled but not found: OQS_LIBRARY=${OQS_LIBRARY}, OQS_INCLUDE_DIR=${OQS_INCLUDE_DIR} ")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Looking for WOLFSSL_OQS - not found")
|
||||
endif()
|
||||
|
||||
# Checking for experimental feature: Kyber
|
||||
message(STATUS "Looking for WOLFSSL_KYBER")
|
||||
if (WOLFSSL_KYBER)
|
||||
set(WOLFSSL_FOUND_EXPERIMENTAL_FEATURE 1)
|
||||
|
||||
message(STATUS "Automatically set related requirements for Kyber:")
|
||||
set_wolfssl_definitions("WOLFSSL_HAVE_KYBER" RESUlT)
|
||||
set_wolfssl_definitions("WOLFSSL_WC_KYBER" RESUlT)
|
||||
set_wolfssl_definitions("WOLFSSL_SHA3" RESUlT)
|
||||
set_wolfssl_definitions("WOLFSSL_SHAKE128" RESUlT)
|
||||
set_wolfssl_definitions("WOLFSSL_SHAKE256" RESUlT)
|
||||
message(STATUS "Looking for WOLFSSL_KYBER - found")
|
||||
else()
|
||||
message(STATUS "Looking for WOLFSSL_KYBER - not found")
|
||||
endif()
|
||||
|
||||
# Other experimental feature detection can be added here...
|
||||
|
||||
# Were any experimental features found? Display a message.
|
||||
if(WOLFSSL_FOUND_EXPERIMENTAL_FEATURE)
|
||||
message(STATUS "WOLFSSL_EXPERIMENTAL enabled, experimental features enabled.")
|
||||
else()
|
||||
message(STATUS "Warning: WOLFSSL_EXPERIMENTAL enabled, but no experimental features enabled.")
|
||||
endif()
|
||||
|
||||
# Sanity checks
|
||||
if(WOLFSSL_OQS AND WOLFSSL_KYBER)
|
||||
message(FATAL_ERROR "Error: cannot enable both WOLFSSL_OQS and WOLFSSL_KYBER at the same time.")
|
||||
endif()
|
||||
|
||||
else()
|
||||
# Experimental mode not enabled, but were any experimental features enabled? Error out if so:
|
||||
message(STATUS "Looking for WOLFSSL_EXPERIMENTAL - not found")
|
||||
if (WOLFSSL_OQS)
|
||||
message(FATAL_ERROR "Error: WOLFSSL_OQS requires WOLFSSL_EXPERIMENTAL at this time.")
|
||||
endif()
|
||||
if(WOLFSSL_KYBER)
|
||||
message(FATAL_ERROR "Error: WOLFSSL_KYBER requires WOLFSSL_EXPERIMENTAL at this time.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -554,6 +655,9 @@ endif()
|
||||
# - Atomic user record layer
|
||||
# - Public key callbacks
|
||||
# - Microchip/Atmel CryptoAuthLib
|
||||
# - XMSS
|
||||
# - LMS
|
||||
# - dual-certs
|
||||
|
||||
# AES-CBC
|
||||
add_option("WOLFSSL_AESCBC"
|
||||
@@ -574,7 +678,7 @@ if(WOLFSSL_LEAN_PSK OR (WOLFSSL_LEAN_TLS AND NOT WOLFSSL_TLS13))
|
||||
override_cache(WOLFSSL_AESGCM "no")
|
||||
endif()
|
||||
|
||||
if(WOLFSSL_AESGCM AND NOT WORDS_BIGENDIAN)
|
||||
if(WOLFSSL_AESGCM AND CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
|
||||
override_cache(WOLFSSL_AESGCM "4bit")
|
||||
endif()
|
||||
|
||||
@@ -1205,6 +1309,14 @@ if(WOLFSSL_OPENSSH OR
|
||||
override_cache(WOLFSSL_DES3 "yes")
|
||||
endif()
|
||||
|
||||
# DES3 TLS Suites
|
||||
set(WOLFSSL_DES3_TLS_SUITES_STRING "Enable DES3 TLS cipher suites (default: disabled)")
|
||||
add_option("WOLFSSL_DES3_TLS_SUITES" ${WOLFSSL_DES3_TLS_SUITES_STRING} "no" "yes;no")
|
||||
|
||||
if(NOT WOLFSSL_DES3_TLS_SUITES)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DNO_DES3_TLS_SUITES")
|
||||
endif()
|
||||
|
||||
# ARC4
|
||||
set(WOLFSSL_ARC4_HELP_STRING "Enable ARC4 (default: disabled)")
|
||||
add_option("WOLFSSL_ARC4" ${WOLFSSL_ARC4_HELP_STRING} "no" "yes;no")
|
||||
@@ -1432,6 +1544,15 @@ add_option(WOLFSSL_SNI ${WOLFSSL_SNI_HELP_STRING} ${SNI_DEFAULT} "yes;no")
|
||||
set(WOLFSSL_TLSX_HELP_STRING "Enable all TLS Extensions (default: disabled)")
|
||||
add_option(WOLFSSL_TLSX ${WOLFSSL_TLSX_HELP_STRING} "no" "yes;no")
|
||||
|
||||
add_option(WOLFSSL_EX_DATA
|
||||
"Enable app data (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
if (WOLFSSL_EX_DATA)
|
||||
list(APPEND WOLFSSL_DEFINITIONS
|
||||
"-DHAVE_EX_DATA")
|
||||
endif()
|
||||
|
||||
# Supported elliptic curves extensions
|
||||
add_option("WOLFSSL_SUPPORTED_CURVES"
|
||||
"Enable Supported Elliptic Curves (default: enabled)"
|
||||
@@ -1662,17 +1783,14 @@ if(WOLFSSL_FAST_MATH)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DUSE_FAST_MATH")
|
||||
set(WOLFSSL_SLOWMATH "no")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64")
|
||||
# Have settings.h set FP_MAX_BITS higher if user didn't set directly
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_X86_64_BUILD")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# TODO: - Fast huge math
|
||||
|
||||
# Set processor-specific build macros
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64")
|
||||
set(WOLFSSL_X86_64_BUILD ON)
|
||||
add_option("WOLFSSL_X86_64_BUILD_ASM" "Build ASM files" "yes" "yes;no")
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_X86_64_BUILD")
|
||||
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64|arm64")
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_AARCH64_BUILD")
|
||||
@@ -1753,13 +1871,15 @@ else()
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DWC_NO_ASYNC_THREADING")
|
||||
endif()
|
||||
|
||||
# TODO: - cryptodev
|
||||
# - Session export
|
||||
# TODO: - Session export
|
||||
|
||||
add_option("WOLFSSL_CRYPTOCB"
|
||||
"Enable crypto callbacks (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
add_option("WOLFSSL_PKCALLBACKS"
|
||||
"Enable public key callbacks (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
add_option("WOLFSSL_OLD_NAMES"
|
||||
"Keep backwards compat with old names (default: enabled)"
|
||||
@@ -1960,6 +2080,11 @@ if(WOLFSSL_CRYPTOCB)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DWOLF_CRYPTO_CB")
|
||||
endif()
|
||||
|
||||
# Public Key Callbacks
|
||||
if(WOLFSSL_PKCALLBACKS)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_PK_CALLBACKS")
|
||||
endif()
|
||||
|
||||
if(WOLFSSL_OCSPSTAPLING)
|
||||
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_CERTIFICATE_STATUS_REQUEST" "-DHAVE_TLS_EXTENSIONS")
|
||||
override_cache(WOLFSSL_OCSP "yes")
|
||||
@@ -2075,7 +2200,7 @@ endif()
|
||||
# Suppress some warnings about separate compilation, inlining
|
||||
add_definitions("-DWOLFSSL_IGNORE_FILE_WARN")
|
||||
# Generate user options header
|
||||
message("Generating user options header...")
|
||||
message(STATUS "Generating user options header...")
|
||||
if (${CMAKE_DISABLE_SOURCE_CHANGES})
|
||||
set(WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT "${CMAKE_DISABLE_SOURCE_CHANGES}")
|
||||
else()
|
||||
@@ -2091,34 +2216,46 @@ else()
|
||||
endif()
|
||||
set(OPTION_FILE "${WOLFSSL_OUTPUT_BASE}/wolfssl/options.h")
|
||||
|
||||
# sccache
|
||||
add_option("ENABLE_SCCACHE"
|
||||
"Enable sccache (default: disabled)"
|
||||
"no" "yes;no")
|
||||
|
||||
if (ENABLE_SCCACHE AND (NOT WOLFSSL_SCCACHE_ALREADY_SET_FLAG))
|
||||
find_program(SCCACHE sccache REQUIRED)
|
||||
if(SCCACHE)
|
||||
message(STATUS "Enable sccache")
|
||||
|
||||
if(CMAKE_C_COMPILER_LAUNCHER)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_C_COMPILER_LAUNCHER}" "${SCCACHE}")
|
||||
else()
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${SCCACHE}")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_CXX_COMPILER_LAUNCHER}" "${SCCACHE}")
|
||||
else()
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE}")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
endif()
|
||||
endif()
|
||||
set(WOLFSSL_SCCACHE_ALREADY_SET_FLAG ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
file(REMOVE ${OPTION_FILE})
|
||||
|
||||
file(APPEND ${OPTION_FILE} "/* wolfssl options.h\n")
|
||||
file(APPEND ${OPTION_FILE} " * generated from configure options\n")
|
||||
file(APPEND ${OPTION_FILE} " *\n")
|
||||
file(APPEND ${OPTION_FILE} " * Copyright (C) 2006-2023 wolfSSL Inc.\n")
|
||||
file(APPEND ${OPTION_FILE} " *\n")
|
||||
file(APPEND ${OPTION_FILE} " * This file is part of wolfSSL. (formerly known as CyaSSL)\n")
|
||||
file(APPEND ${OPTION_FILE} " *\n")
|
||||
file(APPEND ${OPTION_FILE} " */\n\n")
|
||||
file(APPEND ${OPTION_FILE} "#ifndef WOLFSSL_OPTIONS_H\n")
|
||||
file(APPEND ${OPTION_FILE} "#define WOLFSSL_OPTIONS_H\n\n\n")
|
||||
file(APPEND ${OPTION_FILE} "#ifdef __cplusplus\n")
|
||||
file(APPEND ${OPTION_FILE} "extern \"C\" {\n")
|
||||
file(APPEND ${OPTION_FILE} "#endif\n\n")
|
||||
|
||||
add_to_options_file("${WOLFSSL_DEFINITIONS}" "${OPTION_FILE}")
|
||||
# CMAKE_C_FLAGS is just a string of space-separated flags to pass to the C
|
||||
# compiler. We need to replace those spaces with semicolons in order to treat it
|
||||
# as a CMake list.
|
||||
string(REPLACE " " ";" CMAKE_C_FLAGS_LIST "${CMAKE_C_FLAGS}")
|
||||
add_to_options_file("${CMAKE_C_FLAGS_LIST}" "${OPTION_FILE}")
|
||||
|
||||
file(APPEND ${OPTION_FILE} "\n#ifdef __cplusplus\n")
|
||||
file(APPEND ${OPTION_FILE} "}\n")
|
||||
file(APPEND ${OPTION_FILE} "#endif\n\n\n")
|
||||
file(APPEND ${OPTION_FILE} "#endif /* WOLFSSL_OPTIONS_H */\n\n")
|
||||
|
||||
####################################################
|
||||
# Library Target
|
||||
####################################################
|
||||
@@ -2196,9 +2333,23 @@ if(WOLFSSL_ARIA)
|
||||
message(STATUS "ARIA Check: WOLFSSL_LINK_LIBS = ${WOLFSSL_LINK_LIBS}")
|
||||
endif()
|
||||
|
||||
foreach(DEF IN LISTS WOLFSSL_DEFINITIONS)
|
||||
string(REGEX MATCH "^(-D)?([^=]+)(=(.*))?$" DEF_MATCH ${DEF})
|
||||
if (DEFINED CMAKE_MATCH_4)
|
||||
set(${CMAKE_MATCH_2} ${CMAKE_MATCH_4})
|
||||
# message("set(${CMAKE_MATCH_2} ${CMAKE_MATCH_4})")
|
||||
else()
|
||||
set(${CMAKE_MATCH_2} 1)
|
||||
# message("set(${CMAKE_MATCH_2} 1)")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# If new build options are added please update the cmake/options.h.in
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/options.h.in ${OPTION_FILE})
|
||||
|
||||
set_target_properties(wolfssl
|
||||
PROPERTIES
|
||||
SOVERSION ${LIBTOOL_SO_VERSION}
|
||||
SOVERSION ${WOLFSSL_LIBRARY_VERSION_FIRST}
|
||||
VERSION ${LIBTOOL_FULL_VERSION}
|
||||
)
|
||||
|
||||
@@ -2294,7 +2445,7 @@ if(WOLFSSL_EXAMPLES)
|
||||
PROPERTY RUNTIME_OUTPUT_DIRECTORY
|
||||
${WOLFSSL_OUTPUT_BASE}/examples/echoserver)
|
||||
|
||||
if(NOT WIN32)
|
||||
if(NOT WIN32 AND NOT WOLFSSL_SINGLE_THREADED)
|
||||
# Build TLS benchmark example
|
||||
add_executable(tls_bench
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/benchmark/tls_bench.c)
|
||||
@@ -2516,82 +2667,96 @@ list(JOIN HEADER_EXCLUDE "|" EXCLUDED_HEADERS_REGEX)
|
||||
string(PREPEND EXCLUDED_HEADERS_REGEX "(")
|
||||
string(APPEND EXCLUDED_HEADERS_REGEX ")")
|
||||
|
||||
set(INSTALLED_EXAMPLES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/echoserver/echoserver.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-server.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-client-dtls.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-client.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-server-dtls.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/echoclient/echoclient.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/server/server.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/benchmark/tls_bench.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/client/client.c)
|
||||
if(WOLFSSL_INSTALL)
|
||||
|
||||
# Install the library
|
||||
install(TARGETS wolfssl
|
||||
EXPORT wolfssl-targets
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
# Install the headers
|
||||
install(DIRECTORY ${WOLFSSL_OUTPUT_BASE}/wolfssl/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wolfssl
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
REGEX ${EXCLUDED_HEADERS_REGEX} EXCLUDE)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wolfssl
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
REGEX ${EXCLUDED_HEADERS_REGEX} EXCLUDE)
|
||||
set(INSTALLED_EXAMPLES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/echoserver/echoserver.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-server.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-client-dtls.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-client.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/sctp/sctp-server-dtls.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/echoclient/echoclient.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/server/server.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/benchmark/tls_bench.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/examples/client/client.c)
|
||||
|
||||
# Install the examples
|
||||
install(FILES ${INSTALLED_EXAMPLES}
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}/example)
|
||||
# Install README.txt and taoCert.txt
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/doc/README.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/certs/taoCert.txt
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
# Install the export set
|
||||
install(EXPORT wolfssl-targets
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl
|
||||
FILE wolfssl-targets.cmake
|
||||
NAMESPACE wolfssl::)
|
||||
|
||||
# TODO: Distro build + rules for what to include in the distro.
|
||||
# See various include.am files.
|
||||
# Install the library
|
||||
install(TARGETS wolfssl
|
||||
EXPORT wolfssl-targets
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
# Install the headers
|
||||
install(DIRECTORY ${WOLFSSL_OUTPUT_BASE}/wolfssl/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wolfssl
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
REGEX ${EXCLUDED_HEADERS_REGEX} EXCLUDE)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wolfssl
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
REGEX ${EXCLUDED_HEADERS_REGEX} EXCLUDE)
|
||||
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "\${exec_prefix}/lib")
|
||||
set(includedir "\${prefix}/include")
|
||||
set(VERSION ${PROJECT_VERSION})
|
||||
# Install the examples
|
||||
install(FILES ${INSTALLED_EXAMPLES}
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}/example)
|
||||
# Install README.txt and taoCert.txt
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/doc/README.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/certs/taoCert.txt
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
# Install the export set
|
||||
install(EXPORT wolfssl-targets
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl
|
||||
FILE wolfssl-targets.cmake
|
||||
NAMESPACE wolfssl::)
|
||||
|
||||
configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
# TODO: Distro build + rules for what to include in the distro.
|
||||
# See various include.am files.
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config.cmake"
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl"
|
||||
NO_SET_AND_CHECK_MACRO
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
||||
)
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix "\${prefix}")
|
||||
set(libdir "\${exec_prefix}/lib")
|
||||
set(includedir "\${prefix}/include")
|
||||
set(VERSION ${PROJECT_VERSION})
|
||||
|
||||
export(EXPORT wolfssl-targets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/wolfssl-targets.cmake"
|
||||
NAMESPACE wolfssl::
|
||||
)
|
||||
# Setting libm in Libs.private of wolfssl.pc.
|
||||
# See "Link Libraries" in above about `m` insertion to LINK_LIBRARIES
|
||||
get_target_property(_wolfssl_dep_libs wolfssl LINK_LIBRARIES)
|
||||
list(FIND _wolfssl_dep_libs m _dep_libm)
|
||||
if ("${_dep_libm}" GREATER -1)
|
||||
set(LIBM -lm)
|
||||
else()
|
||||
set(LIBM)
|
||||
endif()
|
||||
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config-version.cmake"
|
||||
VERSION "${wolfssl_VERSION_MAJOR}.${wolfssl_VERSION_MINOR}"
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
configure_file(support/wolfssl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/support/wolfssl.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config-version.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl
|
||||
)
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config.cmake"
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl"
|
||||
NO_SET_AND_CHECK_MACRO
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
||||
)
|
||||
|
||||
export(EXPORT wolfssl-targets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/wolfssl-targets.cmake"
|
||||
NAMESPACE wolfssl::
|
||||
)
|
||||
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config-version.cmake"
|
||||
VERSION "${wolfssl_VERSION_MAJOR}.${wolfssl_VERSION_MINOR}"
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wolfssl-config-version.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wolfssl
|
||||
)
|
||||
endif()
|
||||
|
||||
201
ChangeLog.md
201
ChangeLog.md
@@ -1,3 +1,204 @@
|
||||
# wolfSSL Release 5.7.2 (July 08, 2024)
|
||||
|
||||
Release 5.7.2 has been developed according to wolfSSL's development and QA
|
||||
process (see link below) and successfully passed the quality criteria.
|
||||
https://www.wolfssl.com/about/wolfssl-software-development-process-quality-assurance
|
||||
|
||||
NOTE: * --enable-heapmath is being deprecated and will be removed by end of 2024
|
||||
|
||||
## Vulnerabilities
|
||||
* [Medium] CVE-2024-1544
|
||||
Potential ECDSA nonce side channel attack in versions of wolfSSL before 5.6.6 with wc_ecc_sign_hash calls. Generating the ECDSA nonce k samples a random number r and then truncates this randomness with a modular reduction mod n where n is the order of the elliptic curve. Analyzing the division through a control-flow revealing side-channel reveals a bias in the most significant bits of k. Depending on the curve this is either a negligible bias or a significant bias large enough to reconstruct k with lattice reduction methods. Thanks to Luca Wilke, Florian Sieck and Thomas Eisenbarth (University of Lübeck) for reporting the vulnerability. Details will appear in the proceedings of CCS 24.
|
||||
Fixed https://github.com/wolfSSL/wolfssl/pull/7020
|
||||
|
||||
|
||||
* [Medium] CVE-2024-5288
|
||||
A private key blinding operation, enabled by defining the macro WOLFSSL_BLIND_PRIVATE_KEY, was added to mitigate a potential row hammer attack on ECC operations. If performing ECC private key operations in an environment where a malicious user could gain fine control over the device and perform row hammer style attacks it is recommended to update the version of wolfSSL used and to build with WOLFSSL_BLIND_PRIVATE_KEY defined. Thanks to Kemal Derya, M. Caner Tol, Berk Sunar for the report (Vernam Applied Cryptography and Cybersecurity Lab at Worcester Polytechnic Institute)
|
||||
Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7416
|
||||
|
||||
|
||||
* [Low] When parsing a provided maliciously crafted certificate directly using wolfSSL API, outside of a TLS connection, a certificate with an excessively large number of extensions could lead to a potential DoS. There are existing sanity checks during a TLS handshake with wolfSSL which mitigate this issue. Thanks to Bing Shi for the report.
|
||||
Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7597
|
||||
|
||||
* [Low] CVE-2024-5991
|
||||
In the function MatchDomainName(), input param str is treated as a NULL terminated string despite being user provided and unchecked. Specifically, the Openssl compatibility function X509_check_host() takes in a pointer and length to check against, with no requirements that it be NULL terminated. While calling without a NULL terminated string is very uncommon, it is still technically allowed. If a caller was attempting to do a name check on a non*NULL terminated buffer, the code would read beyond the bounds of the input array until it found a NULL terminator.
|
||||
Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7604
|
||||
|
||||
* [Medium] CVE-2024-5814
|
||||
A malicious TLS1.2 server can force a TLS1.3 client with downgrade capability to use a ciphersuite that it did not agree to and achieve a successful connection. This is because, aside from the extensions, the client was skipping fully parsing the server hello when downgrading from TLS 1.3.
|
||||
Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7619
|
||||
|
||||
* [Medium] OCSP stapling version 2 response verification bypass issue when a crafted response of length 0 is received. Found with internal testing.
|
||||
Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7702
|
||||
|
||||
* [Medium] OCSP stapling version 2 revocation bypass with a retry of a TLS connection attempt. A revoked CA certificate could incorrectly be loaded into the trusted signers list and used in a repeat connection attempt. Found with internal testing.
|
||||
Fixed in github pull request https://github.com/wolfSSL/wolfssl/pull/7702
|
||||
|
||||
|
||||
## New Feature Additions
|
||||
* Added Dilithium/ML-DSA: Implementation of ML-DSA-44/65/87 (PR 7622)
|
||||
* AES RISC-V 64-bit ASM: ECB/CBC/CTR/GCM/CCM (PR 7569)
|
||||
* Added CUDA support for AES encryption (PR 7436)
|
||||
* Added support for gRPC (PR 7445)
|
||||
* Added function wc_RsaPrivateKeyDecodeRaw to import raw RSA private keys (PR 7608)
|
||||
* Added crypto callback for SHA-3 (PR 7670)
|
||||
* Support for Infineon Modus Toolbox with wolfSSL (PR 7369)
|
||||
* Allow user to send a user_canceled alert by calling wolfSSL_SendUserCanceled (PR 7590)
|
||||
* C# wrapper SNI support added (PR 7610)
|
||||
* Quantum-safe algorithm support added to the Linux kernel module (PR 7574)
|
||||
* Support for NIST 800-56C Option 1 KDF, using the macro WC_KDF_NIST_SP_800_56C added (PR 7589)
|
||||
* AES-XTS streaming mode added, along with hardware acceleration and kernel module use (PR 7522, 7560, 7424)
|
||||
* PlatformIO FreeRTOS with ESP build and addition of benchmark and test example applications (PR 7528, 7413, 7559, 7542)
|
||||
|
||||
|
||||
## Enhancements and Optimizations
|
||||
* Expanded STM32 AES hardware acceleration support for use with STM32H5 (PR 7578)
|
||||
* Adjusted wc_xmss and wc_lms settings to support use with wolfBoot (PR 7393)
|
||||
* Added the --enable-rpk option to autotools build for using raw public key support (PR 7379)
|
||||
* SHA-3 Thumb2, ARM32 assembly implementation added (PR 7667)
|
||||
* Improvements to RSA padding to expose Pad/Unpad APIs (PR 7612)
|
||||
* Updates and API additions for supporting socat version 1.8.0.0 (PR 7594)
|
||||
* cmake build improvements, expanding build options with SINGLE_THREADED and post-quantum algorithms, adjusting the generation of options.h file and using “yes;no” boolean instead of strings (PR 7611, 7546, 7479, 7480, 7380)
|
||||
* Improvements for Renesas RZ support (PR 7474)
|
||||
* Improvements to dual algorithm certificates for post-quantum keys (PR 7286)
|
||||
* Added wolfSSL_SessionIsSetup so the user can check if a session ticket has been sent by the server (PR 7430)
|
||||
* hostap updates: Implement PACs for EAP-FAST and filter cipher list on TLS version change (PR 7446)
|
||||
* Changed subject name comparison to match different upper and lower cases (PR 7420)
|
||||
* Support for DTLS 1.3 downgrade when using PSK (PR 7367)
|
||||
* Update to static memory build for more generic memory pools used (PR 7418)
|
||||
* Improved performance of Kyber C implementation (PR 7654)
|
||||
* Support for ECC_CACHE_CURVE with no malloc (PR 7490)
|
||||
* Added the configure option --enable-debug-trace-errcodes (macro WOLFSSL_DEBUG_TRACE_ERROR_CODES) which enables more debug tracking of error code values (PR 7634)
|
||||
* Enhanced wc_MakeRsaKey and wc_RsaKeyToDer to work with WOLFSSL_NO_MALLOC (PR 7362)
|
||||
* Improvements to assembly implementations of ChaCha20 and Poly1305 ASM for use with MSVC (PR 7319)
|
||||
* Cortex-M inline assembly labels with unique number appended (PR 7649)
|
||||
* Added secret logging callback to TLS <= 1.2, enabled with the macro HAVE_SECRET_CALLBACK (PR 7372)
|
||||
* Made wc_RNG_DRBG_Reseed() a public wolfCrypt API (PR 7386)
|
||||
* Enabled DES3 support without the DES3 ciphers. To re-enable DES3 cipher suites, use the configure flag --enable-des3-tls-suites (PR 7315)
|
||||
* Added stubs required for latest nginx (1.25.5) (PR 7449)
|
||||
* Added option for using a custom salt with the function wc_ecc_ctx_set_own_salt (PR 7552)
|
||||
* Added PQ files for Windows (PR 7419)
|
||||
* Enhancements to static memory feature, adding the option for a global heap hint (PR 7478) and build options for a lean or debug setting, enabled with --enable-staticmemory=small or --enable-staticmemory=debug (PR 7597)
|
||||
* Updated --enable-jni to define SESSION_CERTS for wolfJSSE (PR 7557)
|
||||
* Exposed DTLS in Ada wrapper and updated examples (PR 7397)
|
||||
* Added additional minimum TLS extension size sanity checks (PR 7602)
|
||||
* ESP improvements: updating the examples and libraries, updates for Apple HomeKit SHA/SRP, and fix for endianness with SHA512 software fallback (PR 7607, 7392, 7505, 7535)
|
||||
* Made the wc_CheckCertSigPubKey API publicly available with the define of the macro WOLFSSL_SMALL_CERT_VERIFY (PR 7599)
|
||||
* Added an alpha/preview of additional FIPS 140-3 full submission, bringing additional algorithms such as SRTP-KDF, AES-XTS, GCM streaming, AES-CFB, ED25519, and ED448 into the FIPS module boundary (PR 7295)
|
||||
* XCODE support for v5.2.3 of the FIPS module (PR 7140)
|
||||
* Expanded OpenSSL compatibility layer and added EC_POINT_hex2point (PR 7191)
|
||||
|
||||
## Fixes
|
||||
* Fixed the NXP MMCAU HW acceleration for SHA-256 (PR 7389)
|
||||
* Fixed AES-CFB1 encrypt/decrypt on size (8*x-1) bits (PR 7431)
|
||||
* Fixed use of %rip with SHA-256 x64 assembly (PR 7409)
|
||||
* Fixed OCSP response message build for DTLS (PR 7671)
|
||||
* Handled edge case in wc_ecc_mulmod() with zero (PR 7532)
|
||||
* Fixed RPK (Raw Public Key) to follow certificate use correctly (PR 7375)
|
||||
* Added sanity check on record header with QUIC use (PR 7638)
|
||||
* Added sanity check for empty directory strings in X.509 when parsing (PR 7669)
|
||||
* Added sanity check on non-conforming serial number of 0 in certificates being parsed (PR 7625)
|
||||
* Fixed wolfSSL_CTX_set1_sigalgs_list() to make the TLS connection conform to the selected sig hash algorithm (PR 7693)
|
||||
* Various fixes for dual algorithm certificates including small stack use and support for Certificate Signing Requests (PR 7577)
|
||||
* Added sanity check for critical policy extension when wolfSSL is built without policy extension support enabled (PR 7388)
|
||||
* Added sanity check that the ed25519 signature is smaller than the order (PR 7513)
|
||||
* Fixed Segger emNet to handle non-blocking want read/want write (PR 7581)
|
||||
|
||||
|
||||
# wolfSSL Release 5.7.0 (Mar 20, 2024)
|
||||
|
||||
Release 5.7.0 has been developed according to wolfSSL's development and QA
|
||||
process (see link below) and successfully passed the quality criteria.
|
||||
https://www.wolfssl.com/about/wolfssl-software-development-process-quality-assurance
|
||||
|
||||
NOTE: * --enable-heapmath is being deprecated and will be removed by end of 2024
|
||||
|
||||
NOTE: In future releases, --enable-des3 (which is disabled by default) will be insufficient in itself to enable DES3 in TLS cipher suites. A new option, --enable-des3-tls-suites, will need to be supplied in addition. This option should only be used in backward compatibility scenarios, as it is inherently insecure.
|
||||
|
||||
NOTE: This release switches the default ASN.1 parser to the new ASN template code. If the original ASN.1 code is preferred define `WOLFSSL_ASN_ORIGINAL` to use it. See PR #7199.
|
||||
|
||||
|
||||
## Vulnerabilities
|
||||
* [High] CVE-2024-0901 Potential denial of service and out of bounds read. Affects TLS 1.3 on the server side when accepting a connection from a malicious TLS 1.3 client. If using TLS 1.3 on the server side it is recommended to update the version of wolfSSL used. Fixed in this GitHub pull request https://github.com/wolfSSL/wolfssl/pull/7099
|
||||
|
||||
|
||||
* [Med] CVE-2024-1545 Fault Injection vulnerability in RsaPrivateDecryption function that potentially allows an attacker that has access to the same system with a victims process to perform a Rowhammer fault injection. Thanks to Junkai Liang, Zhi Zhang, Xin Zhang, Qingni Shen for the report (Peking University, The University of Western Australia)."
|
||||
Fixed in this GitHub pull request https://github.com/wolfSSL/wolfssl/pull/7167
|
||||
|
||||
|
||||
* [Med] Fault injection attack with EdDSA signature operations. This affects ed25519 sign operations where the system could be susceptible to Rowhammer attacks. Thanks to Junkai Liang, Zhi Zhang, Xin Zhang, Qingni Shen for the report (Peking University, The University of Western Australia).
|
||||
Fixed in this GitHub pull request https://github.com/wolfSSL/wolfssl/pull/7212
|
||||
|
||||
|
||||
## New Feature Additions
|
||||
|
||||
* Added --enable-experimental configure flag to gate out features that are currently experimental. Now liboqs, kyber, lms, xmss, and dual-alg-certs require the --enable-experimental flag.
|
||||
|
||||
### POST QUANTUM SUPPORT ADDITIONS
|
||||
* Experimental framework for using wolfSSL’s XMSS implementation (PR 7161)
|
||||
* Experimental framework for using wolfSSL’s LMS implementation (PR 7283)
|
||||
* Experimental wolfSSL Kyber implementation and assembly optimizations, enabled with --enable-experimental --enable-kyber (PR 7318)
|
||||
* Experimental support for post quantum dual key/signature certificates. A few known issues and sanitizer checks are in progress with this feature. Enabled with the configure flags --enable-experimental --enable-dual-alg-certs (PR 7112)
|
||||
* CryptoCb support for PQC algorithms (PR 7110)
|
||||
|
||||
### OTHER FEATURE ADDITIONS
|
||||
* The Linux kernel module now supports registration of AES-GCM, AES-XTS, AES-CBC, and AES-CFB with the kernel cryptosystem through the new --enable-linuxkm-lkcapi-register option, enabling automatic use of wolfCrypt implementations by the dm-crypt/luks and ESP subsystems. In particular, wolfCrypt AES-XTS with –enable-aesni is faster than the native kernel implementation.
|
||||
* CryptoCb hook to one-shot CMAC functions (PR 7059)
|
||||
* BER content streaming support for PKCS7_VerifySignedData and sign/encrypt operations (PR 6961 & 7184)
|
||||
* IoT-Safe SHA-384 and SHA-512 support (PR 7176)
|
||||
* I/O callbacks for content and output with PKCS7 bundle sign/encrypt to reduce peak memory usage (PR 7272)
|
||||
* Microchip PIC24 support and example project (PR 7151)
|
||||
* AutoSAR shim layer for RNG, SHA256, and AES (PR 7296)
|
||||
* wolfSSL_CertManagerUnloadIntermediateCerts API to clear intermediate certs added to certificate store (PR 7245)
|
||||
* Implement SSL_get_peer_signature_nid and SSL_get_peer_signature_type_nid (PR 7236)
|
||||
|
||||
|
||||
## Enhancements and Optimizations
|
||||
|
||||
* Remove obsolete user-crypto functionality and Intel IPP support (PR 7097)
|
||||
* Support for RSA-PSS signatures with CRL use (PR 7119)
|
||||
* Enhancement for AES-GCM use with Xilsecure on Microblaze (PR 7051)
|
||||
* Support for crypto cb only build with ECC and NXP CAAM (PR 7269)
|
||||
* Improve liboqs integration adding locking and init/cleanup functions (PR 7026)
|
||||
* Prevent memory access before clientSession->serverRow and clientSession->serverIdx are sanitized (PR 7096)
|
||||
* Enhancements to reproducible build (PR 7267)
|
||||
* Update Arduino example TLS Client/Server and improve support for ESP32 (PR 7304 & 7177)
|
||||
* XC32 compiler version 4.x compatibility (PR 7128)
|
||||
* Porting for build on PlayStation 3 and 4 (PR 7072)
|
||||
* Improvements for Espressif use; SHA HW/SW selection and use on ESP32-C2/ESP8684, wolfSSL_NewThread() type, component cmake fix, and update TLS client example for ESP8266 (PR 7081, 7173, 7077, 7148, 7240)
|
||||
* Allow crypto callbacks with SHA-1 HW (PR 7087)
|
||||
* Update OpenSSH port to version 9.6p1(PR 7203)
|
||||
* ARM Thumb2 enhancements, AES-GCM support for GCM_SMALL, alignment fix on key, fix for ASM clobber list (PR 7291,7301,7221)
|
||||
* Expand heap hint support for static memory build with more x509 functions (PR 7136)
|
||||
* Improving ARMv8 ChaCha20 ASM (alignment) (PR 7182)
|
||||
* Unknown extension callback wolfSSL_CertManagerSetUnknownExtCallback added to CertManager (PR 7194)
|
||||
* Implement wc_rng_new_ex for use with devID’s with crypto callback (PR 7271)
|
||||
* Allow reading 0-RTT data after writing 0.5-RTT data (PR 7102)
|
||||
* Send alert on bad PSK binder error (PR 7235)
|
||||
* Enhancements to CMake build files for use with cross compiling (PR 7188)
|
||||
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fix for checking result of MAC verify when no AAD is used with AES-GCM and Xilinx Xilsecure (PR 7051)
|
||||
* Fix for Aria sign use (PR 7082)
|
||||
* Fix for invalid `dh_ffdhe_test` test case using Intel QuickAssist (PR 7085)
|
||||
* Fixes for TI AES and SHA on TM4C with HW acceleration and add full AES GCM and CCM support with TLS (PR 7018)
|
||||
* Fixes for STM32 PKA use with ECC (PR 7098)
|
||||
* Fixes for TLS 1.3 with crypto callbacks to offload KDF / HMAC operation (PR 7070)
|
||||
* Fix include path for FSP 3.5 on Renesas RA6M4 (PR 7101)
|
||||
* Siphash x64 asm fix for use with older compilers (PR 7299)
|
||||
* Fix for SGX build with SP (PR 7308)
|
||||
* Fix to Make it mandatory that the cookie is sent back in new ClientHello when seen in a HelloRetryRequest with (PR 7190)
|
||||
* Fix for wrap around behavior with BIO pairs (PR 7169)
|
||||
* OCSP fixes for parsing of response correctly when there was a revocation reason and returning correct error value with date checks (PR 7241 & 7255)
|
||||
* Fix build with `NO_STDIO_FILESYSTEM` and improve checks for `XGETENV` (PR 7150)
|
||||
* Fix for DTLS sequence number and cookie when downgrading DTLS version (PR 7214)
|
||||
* Fix for write_dup use with chacha-poly cipher suites (PR 7206)
|
||||
* Fix for multiple handshake messages in one record failing with OUT_OF_ORDER_E when downgrading from TLS 1.3 to TLS 1.2 (PR 7141)
|
||||
* Fix for AES ECB build with Thumb and alignment (PR 7094)
|
||||
* Fix for negotiate handshake until the end in wolfSSL_read/wolfSSL_write if hitting an edge case with want read/write (PR 7237)
|
||||
|
||||
# wolfSSL Release 5.6.6 (Dec 19, 2023)
|
||||
|
||||
Release 5.6.6 has been developed according to wolfSSL's development and QA
|
||||
|
||||
@@ -3,11 +3,14 @@ FROM $DOCKER_BASE_IMAGE
|
||||
|
||||
USER root
|
||||
|
||||
# Set timezone to UTC
|
||||
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
|
||||
|
||||
ARG DEPS_WOLFSSL="build-essential autoconf libtool clang clang-tools zlib1g-dev libuv1-dev libpam0g-dev valgrind git linux-headers-generic gcc-multilib g++-multilib libpcap-dev bubblewrap gdb iputils-ping lldb bsdmainutils netcat binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu"
|
||||
ARG DEPS_LIBOQS="astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind git"
|
||||
ARG DEPS_UDP_PROXY="wget libevent-dev"
|
||||
ARG DEPS_TESTS="abi-dumper libcurl4-openssl-dev tcpdump"
|
||||
ARG DEPS_TOOLS="ccache"
|
||||
ARG DEPS_TESTS="abi-dumper libcurl4-openssl-dev tcpdump libpsl-dev python3-pandas python3-tabulate libnl-genl-3-dev libcap-ng-dev"
|
||||
ARG DEPS_TOOLS="ccache clang-tidy maven"
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \
|
||||
&& apt install -y ${DEPS_WOLFSSL} ${DEPS_LIBOQS} ${DEPS_UDP_PROXY} ${DEPS_TESTS} ${DEPS_TOOLS} \
|
||||
&& apt clean -y && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -3,7 +3,7 @@ FROM $DOCKER_BASE_IMAGE
|
||||
|
||||
USER root
|
||||
|
||||
ARG DEPS_TESTING="gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu"
|
||||
ARG DEPS_TESTING="gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gcc-powerpc64-linux-gnu gcc-arm-none-eabi"
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update \
|
||||
&& apt install -y ${DEPS_TESTING} \
|
||||
&& apt clean -y && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
29
Docker/yocto/Dockerfile
Normal file
29
Docker/yocto/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM ubuntu
|
||||
|
||||
# Set timezone to UTC
|
||||
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev python3-subunit mesa-common-dev zstd liblz4-tool file locales libacl1 vim && apt clean -y && rm -rf /var/lib/apt/lists/*
|
||||
RUN locale-gen en_US.UTF-8
|
||||
|
||||
# Add in non-root user
|
||||
ENV UID_OF_DOCKERUSER 1000
|
||||
RUN useradd -m -s /bin/bash -g users -u ${UID_OF_DOCKERUSER} dockerUser
|
||||
RUN chown -R dockerUser:users /home/dockerUser && chown dockerUser:users /opt
|
||||
|
||||
USER dockerUser
|
||||
|
||||
RUN cd /opt && git clone git://git.yoctoproject.org/poky
|
||||
WORKDIR /opt/poky
|
||||
|
||||
ARG YOCTO_VERSION=kirkstone
|
||||
RUN git checkout -t origin/${YOCTO_VERSION} -b ${YOCTO_VERSION} && git pull
|
||||
|
||||
# This arg is to be able to force a rebuild starting from this line
|
||||
ARG DUMMY=date
|
||||
RUN DUMMY=${DUMMY} git clone --single-branch --branch=master https://github.com/wolfssl/meta-wolfssl.git && \
|
||||
/bin/bash -c "source oe-init-build-env" && \
|
||||
echo 'IMAGE_INSTALL:append = " wolfssl wolfclu wolfssh wolfmqtt wolftpm wolfclu "' >> /opt/poky/build/conf/local.conf && \
|
||||
sed -i '/\/opt\/poky\/meta-poky \\/a \\t/opt/poky/meta-wolfssl \\' /opt/poky/build/conf/bblayers.conf
|
||||
|
||||
RUN /bin/bash -c "source oe-init-build-env && bitbake core-image-minimal"
|
||||
27
Docker/yocto/buildAndPush.sh
Executable file
27
Docker/yocto/buildAndPush.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Assume we're in wolfssl/Docker/yocto
|
||||
WOLFSSL_DIR=$(builtin cd ${BASH_SOURCE%/*}/../..; pwd)
|
||||
|
||||
DOCKER_BUILD_OPTIONS="$1"
|
||||
if [ "${DOCKER_BASE_IMAGE}" != "" ]; then
|
||||
DOCKER_BUILD_OPTIONS+=" --build-arg DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}"
|
||||
fi
|
||||
|
||||
NUM_FAILURES=0
|
||||
|
||||
CUR_DATE=$(date -u +%F)
|
||||
for ver in kirkstone langdale scarthgap; do
|
||||
echo "Building wolfssl/yocto:${ver}-${CUR_DATE} as ${DOCKER_BUILD_OPTIONS}"
|
||||
docker build -t wolfssl/yocto:${ver}-${CUR_DATE} --build-arg YOCTO_VERSION=${ver} --build-arg BUILD_DATE=${CUR_DATE} -f Dockerfile "${WOLFSSL_DIR}/Docker/yocto" && \
|
||||
docker tag wolfssl/yocto:${ver}-${CUR_DATE} wolfssl/yocto:${ver}-latest
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Pushing containers to DockerHub"
|
||||
docker push wolfssl/yocto:${ver}-${CUR_DATE} && docker push wolfssl/yocto:${ver}-latest
|
||||
else
|
||||
echo "Warning: Build wolfssl/yocto:${ver} failed. Continuing"
|
||||
((NUM_FAILURES++))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Script completed in $SECONDS seconds. Had $NUM_FAILURES failures."
|
||||
13
IDE/ARDUINO/Arduino_README_prepend.md
Normal file
13
IDE/ARDUINO/Arduino_README_prepend.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Arduino wolfSSL Library
|
||||
|
||||
This library is restructured from [wolfSSL](https://github.com/wolfSSL/wolfssl/) Release ${WOLFSSL_VERSION} for the Arduino platform.
|
||||
|
||||
The Official wolfSSL Arduino Library is found in [The Library Manager index](http://downloads.arduino.cc/libraries/library_index.json).
|
||||
|
||||
See the [Arduino-wolfSSL logs](https://downloads.arduino.cc/libraries/logs/github.com/wolfSSL/Arduino-wolfSSL/).
|
||||
|
||||
## Arduino Releases
|
||||
|
||||
The first Official wolfSSL Arduino Library is `5.6.6-Arduino.1`: a slightly modified, post [release 5.6.6](https://github.com/wolfSSL/wolfssl/releases/tag/v5.6.6-stable) version update.
|
||||
|
||||
See other [wolfSSL releases versions](https://github.com/wolfSSL/wolfssl/releases). The `./wolfssl-arduino.sh INSTALL` [script](https://github.com/wolfSSL/wolfssl/tree/master/IDE/ARDUINO) can be used to install specific GitHub versions as needed.
|
||||
@@ -1,30 +1,89 @@
|
||||
### wolfSSL with Arduino
|
||||
# wolfSSL with Arduino
|
||||
|
||||
##### Reformatting wolfSSL as a compatible Arduino Library
|
||||
This is a shell script that will re-organize the wolfSSL library to be
|
||||
compatible with Arduino projects that use Arduino IDE 1.5.0 or newer.
|
||||
The Arduino IDE requires a library's source files to be in the library's root
|
||||
directory with a header file in the name of the library. This script moves all
|
||||
src/ files to the `IDE/ARDUINO/wolfSSL/src` directory and creates a stub header
|
||||
file called `wolfssl.h` inside that directory.
|
||||
See the [example sketches](./sketches/README.md):
|
||||
|
||||
Step 1: To configure wolfSSL with Arduino, enter the following from within the
|
||||
wolfssl/IDE/ARDUINO directory:
|
||||
- [sketches/wolfssl_server](./sketches/wolfssl_server/README.md)
|
||||
- [sketches/wolfssl_client](./sketches/wolfssl_client/README.md)
|
||||
|
||||
`./wolfssl-arduino.sh`
|
||||
When publishing a new version to the Arduino Registry, be sure to edit `WOLFSSL_VERSION_ARUINO_SUFFIX` in the `wolfssl-arduino.sh` script.
|
||||
|
||||
Step 2: Copy the directory wolfSSL that was just created to:
|
||||
`~/Documents/Arduino/libraries/` directory so the Arduino IDE can find it.
|
||||
## Boards
|
||||
|
||||
Step 3: Edit `<arduino-libraries>/wolfSSL/src/user_settings.h`
|
||||
Many of the supported boards are natively built-in to the [Arduino IDE Board Manager](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-board-manager/)
|
||||
and by adding [additional cores](https://docs.arduino.cc/learn/starting-guide/cores/) as needed.
|
||||
|
||||
STM32 Support can be added by including this link in the "Additional Boards Managers URLs" field
|
||||
from [stm32duino/Arduino_Core_STM32](https://github.com/stm32duino/Arduino_Core_STM32?tab=readme-ov-file#getting-started) .
|
||||
|
||||
```
|
||||
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
|
||||
```
|
||||
|
||||
## Using wolfSSL from the Arduino IDE
|
||||
|
||||
The Official wolfSSL: https://github.com/wolfSSL/arduino-wolfSSL See [PR #1](https://github.com/wolfSSL/Arduino-wolfSSL/pull/1).
|
||||
|
||||
This option will allow wolfSSL to be installed directly using the native Arduino tools.
|
||||
|
||||
## Manually Reformatting wolfSSL as a Compatible Arduino Library
|
||||
|
||||
Use [this](./wolfssl-arduino.sh) shell script that will re-organize the wolfSSL library to be
|
||||
compatible with [Arduino Library Specification](https://arduino.github.io/arduino-cli/0.35/library-specification/)
|
||||
for projects that use Arduino IDE 1.5.0 or newer.
|
||||
|
||||
The Arduino IDE requires a library's source files to be in the library's root directory with a
|
||||
header file in the name of the library. This script moves all `src/` files to the `IDE/ARDUINO/wolfSSL/src`
|
||||
directory and creates a stub header file called `wolfssl.h` inside that directory.
|
||||
|
||||
### Step 1:
|
||||
|
||||
To configure wolfSSL with Arduino, enter ONE of the following 4 commands
|
||||
from within the `wolfssl/IDE/ARDUINO` directory:
|
||||
|
||||
1. `./wolfssl-arduino.sh`
|
||||
- Creates an Arduino Library directory structure in the local `wolfSSL` directory of `IDE/ARDUINO`.
|
||||
- You can add your own `user_settings.h`, or copy/rename the [default](../../examples/configs/user_settings_arduino.h).
|
||||
|
||||
2. `./wolfssl-arduino.sh INSTALL` (The most common option)
|
||||
- Creates an Arduino Library in the local `wolfSSL` directory
|
||||
- Moves that directory to the Arduino library directory:
|
||||
- `$HOME/Arduino/libraries` for most bash environments
|
||||
- `/mnt/c/Users/$USER/Documents/Arduino/libraries` (for WSL)
|
||||
- Adds the [default](../../examples/configs/user_settings_arduino.h) as `user_settings.h`.
|
||||
- The wolfSSL library is now available from the Arduino IDE.
|
||||
|
||||
3. `./wolfssl-arduino.sh INSTALL /path/to/repository` (Used to update [arduino-wolfSSL](https://github.com/wolfSSL/arduino-wolfSSL))
|
||||
- Creates an Arduino Library in `wolfSSL` directory
|
||||
- Copies that directory contents to the specified `/path/to/repository`
|
||||
- Adds the [default](../../examples/configs/user_settings_arduino.h) as `user_settings.h`.
|
||||
|
||||
4. `./wolfssl-arduino.sh INSTALL /path/to/any/other/directory`
|
||||
- Creates an Arduino Library in `wolfSSL` directory
|
||||
- Copies that directory contents to the specified `/path/to/any/other/directory`
|
||||
|
||||
### Step 2:
|
||||
|
||||
Edit `<arduino-libraries>/wolfSSL/src/user_settings.h`
|
||||
If building for Intel Galileo platform add: `#define INTEL_GALILEO`.
|
||||
Add any other custom settings, for a good start see the examples in wolfssl root
|
||||
"/examples/configs/user_settings_*.h"
|
||||
Add any other custom settings. For a good start see the examples in wolfssl root
|
||||
"[/examples/configs/user_settings_*.h](https://github.com/wolfssl/wolfssl/tree/master/examples/configs)"
|
||||
|
||||
Step 4: If you experience any issues with custom user_settings.h see the wolfssl
|
||||
### Step 3:
|
||||
|
||||
If you experience any issues with custom `user_settings.h` see the wolfssl
|
||||
porting guide here for more assistance: https://www.wolfssl.com/docs/porting-guide/
|
||||
|
||||
Step 5: If you still have any issues contact support@wolfssl.com for more help.
|
||||
If you have any issues contact support@wolfssl.com for help.
|
||||
|
||||
# Including wolfSSL in Arduino Libraries (for Arduino version 2.0 or greater)
|
||||
|
||||
1. In the Arduino IDE:
|
||||
|
||||
The wolfSSL library should automatically be detected when found in the `libraries`
|
||||
directory.
|
||||
|
||||
- In `Sketch -> Include Library` choose wolfSSL for new sketches.
|
||||
|
||||
|
||||
##### Including wolfSSL in Arduino Libraries (for Arduino version 1.6.6)
|
||||
|
||||
@@ -33,6 +92,90 @@ Step 5: If you still have any issues contact support@wolfssl.com for more help.
|
||||
`IDE/ARDUNIO/wolfSSL` folder.
|
||||
- In `Sketch -> Include Library` choose wolfSSL.
|
||||
|
||||
2. Open an example Arduino sketch for wolfSSL:
|
||||
- wolfSSL Client INO sketch: `sketches/wolfssl_client/wolfssl_client.ino`
|
||||
- wolfSSL Server INO sketch: `sketches/wolfssl_server/wolfssl_server.ino`
|
||||
##### wolfSSL Examples
|
||||
|
||||
Open an example Arduino sketch for wolfSSL:
|
||||
|
||||
- wolfSSL [Client INO sketch](./sketches/wolfssl_client/README.md): `sketches/wolfssl_client/wolfssl_client.ino`
|
||||
|
||||
- wolfSSL [Server INO sketch](./sketches/wolfssl_server/README.md): `sketches/wolfssl_server/wolfssl_server.ino`
|
||||
|
||||
#### Script Examples
|
||||
|
||||
Refresh the local Windows Arduino wolfSSL library from GitHub repository directory using WSL:
|
||||
|
||||
Don't forget to edit `WOLFSSL_VERSION_ARUINO_SUFFIX`!
|
||||
|
||||
```bash
|
||||
# Change to the wolfSSL Arduino IDE directory
|
||||
cd /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO
|
||||
|
||||
# remove current Arduino wolfSSL library
|
||||
rm -rf /mnt/c/Users/$USER/Documents/Arduino/libraries/wolfssl
|
||||
|
||||
# Install wolfSSL as an Arduino library
|
||||
./wolfssl-arduino.sh INSTALL
|
||||
```
|
||||
|
||||
Publish wolfSSL from WSL to a `Arduino-wolfSSL-$USER` repository.
|
||||
|
||||
```bash
|
||||
cd /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO
|
||||
rm -rf /mnt/c/Users/$USER/Documents/Arduino/libraries/wolfSSL
|
||||
rm -rf /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO/wolfSSL
|
||||
./wolfssl-arduino.sh INSTALL /mnt/c/workspace/Arduino-wolfSSL-$USER/
|
||||
```
|
||||
|
||||
Publish wolfSSL from WSL to default Windows local library.
|
||||
|
||||
```bash
|
||||
cd /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO
|
||||
rm -rf /mnt/c/Users/$USER/Documents/Arduino/libraries/wolfSSL
|
||||
rm -rf /mnt/c/workspace/wolfssl-arduino/IDE/ARDUINO/wolfSSL
|
||||
./wolfssl-arduino.sh INSTALL
|
||||
```
|
||||
|
||||
Test the TLS server by running a local command-line client.
|
||||
|
||||
```bash
|
||||
cd /mnt/c/workspace/wolfssl-$USER
|
||||
./examples/client/client -h 192.168.1.43 -p 11111 -v 3
|
||||
```
|
||||
|
||||
Build wolfSSL to include wolfSSH support to an alternate development directory.
|
||||
|
||||
```bash
|
||||
cd /mnt/c/workspace/wolfssl-$USER
|
||||
./configure --prefix=/mnt/c/workspace/wolfssh-$USER/wolfssl_install --enable-ssh
|
||||
make
|
||||
make install
|
||||
|
||||
```
|
||||
|
||||
Build wolfSSH with wolfSSL not installed to default directory.
|
||||
|
||||
```bash
|
||||
cd /mnt/c/workspace/wolfssh-$USER
|
||||
./configure --with-wolfssl=/mnt/c/workspace/wolfssh-$USER/wolfssl_install
|
||||
make
|
||||
./examples/client/client -u jill -h 192.168.1.34 -p 22222 -P upthehill
|
||||
```
|
||||
|
||||
Test the current wolfSSL.
|
||||
|
||||
```bash
|
||||
cd /mnt/c/workspace/wolfssl-arduino
|
||||
git status
|
||||
./autogen.sh
|
||||
./configure --enable-all
|
||||
make clean
|
||||
make && make test
|
||||
```
|
||||
|
||||
Build and run `testwolfcrypt`.
|
||||
|
||||
```bash
|
||||
./autogen.sh
|
||||
./configure --enable-all
|
||||
make clean && make && ./wolfcrypt/test/testwolfcrypt
|
||||
```
|
||||
|
||||
@@ -3,6 +3,15 @@
|
||||
# All paths should be given relative to the root
|
||||
|
||||
EXTRA_DIST+= IDE/ARDUINO/README.md
|
||||
EXTRA_DIST+= IDE/ARDUINO/Arduino_README_prepend.md
|
||||
EXTRA_DIST+= IDE/ARDUINO/keywords.txt
|
||||
EXTRA_DIST+= IDE/ARDUINO/library.properties.template
|
||||
EXTRA_DIST+= IDE/ARDUINO/sketches/README.md
|
||||
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_client/README.md
|
||||
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_client/wolfssl_client.ino
|
||||
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_server/README.md
|
||||
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_server/wolfssl_server.ino
|
||||
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_version/README.md
|
||||
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_version/wolfssl_version.ino
|
||||
EXTRA_DIST+= IDE/ARDUINO/wolfssl.h
|
||||
EXTRA_DIST+= IDE/ARDUINO/wolfssl-arduino.sh
|
||||
|
||||
21
IDE/ARDUINO/keywords.txt
Normal file
21
IDE/ARDUINO/keywords.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# Syntax Coloring Map For wolfSSL
|
||||
# See https://arduino.github.io/arduino-cli/0.35/library-specification/#keywords
|
||||
#
|
||||
# Be sure to use tabs, not spaces. This might help:
|
||||
# tr ' ' '\t' < keywords1.txt > keywords.txt
|
||||
|
||||
#=============================================
|
||||
# Datatypes (KEYWORD1)
|
||||
#=============================================
|
||||
|
||||
|
||||
#=============================================
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#=============================================
|
||||
wolfSSL_SetIORecv KEYWORD1
|
||||
|
||||
#=============================================
|
||||
# Instances (KEYWORD2)
|
||||
#=============================================
|
||||
ctx KEYWORD2
|
||||
|
||||
9
IDE/ARDUINO/library.properties.template
Normal file
9
IDE/ARDUINO/library.properties.template
Normal file
@@ -0,0 +1,9 @@
|
||||
name=wolfssl
|
||||
version=${WOLFSSL_VERSION}${WOLFSSL_VERSION_ARUINO_SUFFIX}
|
||||
author=wolfSSL Inc.
|
||||
maintainer=wolfSSL inc <support@wolfssl.com>
|
||||
sentence=A lightweight SSL/TLS library written in ANSI C and targeted for embedded, RTOS, and resource-constrained environments.
|
||||
paragraph=Manual: https://www.wolfssl.com/documentation/manuals/wolfssl/index.html.
|
||||
category=Communication
|
||||
url=https://www.wolfssl.com/
|
||||
architectures=*
|
||||
12
IDE/ARDUINO/sketches/README.md
Normal file
12
IDE/ARDUINO/sketches/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# wolfSSL Arduino Examples
|
||||
|
||||
There are currently two example Arduino sketches:
|
||||
|
||||
* [wolfssl_client](./wolfssl_client/README.md): Basic TLS listening client.
|
||||
* [wolfssl_server](./wolfssl_server/README.md): Basic TLS server.
|
||||
|
||||
Examples have been most recently confirmed operational on the
|
||||
[Arduino IDE](https://www.arduino.cc/en/software) 2.2.1.
|
||||
|
||||
For examples on other platforms, see the [IDE directory](https://github.com/wolfssl/wolfssl/tree/master/IDE).
|
||||
Additional examples can be found on [wolfSSL/wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/).
|
||||
22
IDE/ARDUINO/sketches/wolfssl_client/README.md
Normal file
22
IDE/ARDUINO/sketches/wolfssl_client/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Arduino Basic TLS Listening Client
|
||||
|
||||
Open the [wolfssl_client.ino](./wolfssl_client.ino) file in the Arduino IDE.
|
||||
|
||||
Other IDE products are also supported, such as:
|
||||
|
||||
- [PlatformIO in VS Code](https://docs.platformio.org/en/latest/frameworks/arduino.html)
|
||||
- [VisualGDB](https://visualgdb.com/tutorials/arduino/)
|
||||
- [VisualMicro](https://www.visualmicro.com/)
|
||||
|
||||
For examples on other platforms, see the [IDE directory](https://github.com/wolfssl/wolfssl/tree/master/IDE).
|
||||
Additional examples can be found on [wolfSSL/wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/).
|
||||
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
When encountering odd errors such as `undefined reference to ``_impure_ptr'`, try cleaning the Arduino
|
||||
cache directories. For Windows, that's typically in:
|
||||
|
||||
```text
|
||||
C:\Users\%USERNAME%\AppData\Local\Temp\arduino\sketches
|
||||
```
|
||||
@@ -20,157 +20,875 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
This was original tested with Intel Galileo acting as the Client, with a
|
||||
laptop acting as a server using the server example provided in examples/server.
|
||||
Legacy Ardunio v1.86 was used to compile and program the Galileo
|
||||
Tested with:
|
||||
|
||||
1) Intel Galileo acting as the Client, with a laptop acting as a server using
|
||||
the server example provided in examples/server.
|
||||
Legacy Arduino v1.86 was used to compile and program the Galileo
|
||||
|
||||
2) Espressif ESP32 WiFi
|
||||
|
||||
3) Arduino Due, Nano33 IoT, Nano RP-2040
|
||||
*/
|
||||
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
/*
|
||||
* Note to code editors: the Arduino client and server examples are edited in
|
||||
* parallel for side-by-side comparison between examples.
|
||||
*/
|
||||
|
||||
/* If you have a private include, define it here, otherwise edit WiFi params */
|
||||
#define MY_PRIVATE_CONFIG "/workspace/my_private_config.h"
|
||||
|
||||
/* set REPEAT_CONNECTION to a non-zero value to continually run the example. */
|
||||
#define REPEAT_CONNECTION 0
|
||||
|
||||
/* Edit this with your other TLS host server address to connect to: */
|
||||
#define WOLFSSL_TLS_SERVER_HOST "192.168.1.39"
|
||||
|
||||
/* wolfssl TLS examples communicate on port 11111 */
|
||||
#define WOLFSSL_PORT 11111
|
||||
|
||||
/* Choose a monitor serial baud rate: 9600, 14400, 19200, 57600, 74880, etc. */
|
||||
#define SERIAL_BAUD 115200
|
||||
|
||||
/* We'll wait up to 2000 milliseconds to properly shut down connection */
|
||||
#define SHUTDOWN_DELAY_MS 2000
|
||||
|
||||
/* Number of times to retry connection. */
|
||||
#define RECONNECT_ATTEMPTS 20
|
||||
|
||||
/* Optional stress test. Define to consume memory until exhausted: */
|
||||
/* #define MEMORY_STRESS_TEST */
|
||||
|
||||
/* Choose client or server example, not both. */
|
||||
#define WOLFSSL_CLIENT_EXAMPLE
|
||||
/* #define WOLFSSL_SERVER_EXAMPLE */
|
||||
|
||||
#if defined(MY_PRIVATE_CONFIG)
|
||||
/* the /workspace directory may contain a private config
|
||||
* excluded from GitHub with items such as WiFi passwords */
|
||||
#include MY_PRIVATE_CONFIG
|
||||
static const char* ssid PROGMEM = MY_ARDUINO_WIFI_SSID;
|
||||
static const char* password PROGMEM = MY_ARDUINO_WIFI_PASSWORD;
|
||||
#else
|
||||
/* when using WiFi capable boards: */
|
||||
static const char* ssid PROGMEM = "your_SSID";
|
||||
static const char* password PROGMEM = "your_PASSWORD";
|
||||
#endif
|
||||
|
||||
#define BROADCAST_ADDRESS "255.255.255.255"
|
||||
|
||||
/* There's an optional 3rd party NTPClient library by Fabrice Weinberg.
|
||||
* If it is installed, uncomment define USE_NTP_LIB here: */
|
||||
/* #define USE_NTP_LIB */
|
||||
#ifdef USE_NTP_LIB
|
||||
#include <NTPClient.h>
|
||||
#endif
|
||||
|
||||
#include <wolfssl.h>
|
||||
/* Important: make sure settings.h appears before any other wolfSSL headers */
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
/* Reminder: settings.h includes user_settings.h
|
||||
* For ALL project wolfSSL settings, see:
|
||||
* [your path]/Arduino\libraries\wolfSSL\src\user_settings.h */
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <Ethernet.h>
|
||||
#include <wolfssl/certs_test.h>
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
|
||||
/* Define DEBUG_WOLFSSL in user_settings.h for more verbose logging. */
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
#define PROGRESS_DOT F("")
|
||||
#else
|
||||
#define PROGRESS_DOT F(".")
|
||||
#endif
|
||||
|
||||
const char host[] = "192.168.1.148"; /* server to connect to */
|
||||
const int port = 11111; /* port on server to connect to */
|
||||
/* Convert a macro to a string */
|
||||
#define xstr(x) str(x)
|
||||
#define str(x) #x
|
||||
|
||||
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
|
||||
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
|
||||
int reconnect = 10;
|
||||
/* optional board-specific networking includes */
|
||||
#if defined(ESP32)
|
||||
#define USING_WIFI
|
||||
#include <WiFi.h>
|
||||
#include <WiFiUdp.h>
|
||||
#ifdef USE_NTP_LIB
|
||||
WiFiUDP ntpUDP;
|
||||
#endif
|
||||
/* Ensure the F() flash macro is defined */
|
||||
#ifndef F
|
||||
#define F
|
||||
#endif
|
||||
WiFiClient client;
|
||||
|
||||
EthernetClient client;
|
||||
#elif defined(ESP8266)
|
||||
#define USING_WIFI
|
||||
#include <ESP8266WiFi.h>
|
||||
WiFiClient client;
|
||||
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
#elif defined(ARDUINO_SAM_DUE)
|
||||
#include <SPI.h>
|
||||
/* There's no WiFi/Ethernet on the Due. Requires Ethernet Shield.
|
||||
/* Needs "Ethernet by Various" library to be installed. Tested with V2.0.2 */
|
||||
#include <Ethernet.h>
|
||||
EthernetClient client;
|
||||
|
||||
void setup() {
|
||||
WOLFSSL_METHOD* method;
|
||||
/* Initialize Return Code */
|
||||
int rc;
|
||||
Serial.begin(9600);
|
||||
/* Delay need to ensure connection to server */
|
||||
delay(4000);
|
||||
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
|
||||
#define USING_WIFI
|
||||
#include <SPI.h>
|
||||
#include <WiFiNINA.h> /* Needs Arduino WiFiNINA library installed manually */
|
||||
WiFiClient client;
|
||||
|
||||
method = wolfTLSv1_2_client_method();
|
||||
if (method == NULL) {
|
||||
Serial.println("unable to get method");
|
||||
return;
|
||||
#elif defined(ARDUINO_ARCH_RP2040)
|
||||
#define USING_WIFI
|
||||
#include <SPI.h>
|
||||
#include <WiFiNINA.h>
|
||||
WiFiClient client;
|
||||
|
||||
#elif defined(USING_WIFI)
|
||||
#define USING_WIFI
|
||||
#include <WiFi.h>
|
||||
#include <WiFiUdp.h>
|
||||
#ifdef USE_NTP_LIB
|
||||
WiFiUDP ntpUDP;
|
||||
#endif
|
||||
WiFiClient client;
|
||||
|
||||
/* TODO
|
||||
#elif defined(OTHER_BOARD)
|
||||
*/
|
||||
#else
|
||||
#define USING_WIFI
|
||||
WiFiClient client;
|
||||
|
||||
#endif
|
||||
|
||||
/* Only for syntax highlighters to show interesting options enabled: */
|
||||
#if defined(HAVE_SNI) \
|
||||
|| defined(HAVE_MAX_FRAGMENT) \
|
||||
|| defined(HAVE_TRUSTED_CA) \
|
||||
|| defined(HAVE_TRUNCATED_HMAC) \
|
||||
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
|
||||
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) \
|
||||
|| defined(HAVE_SUPPORTED_CURVES) \
|
||||
|| defined(HAVE_ALPN) \
|
||||
|| defined(HAVE_SESSION_TICKET) \
|
||||
|| defined(HAVE_SECURE_RENEGOTIATION) \
|
||||
|| defined(HAVE_SERVER_RENEGOTIATION_INFO)
|
||||
#endif
|
||||
|
||||
static const char host[] PROGMEM = WOLFSSL_TLS_SERVER_HOST; /* server to connect to */
|
||||
static const int port PROGMEM = WOLFSSL_PORT; /* port on server to connect to */
|
||||
|
||||
static WOLFSSL_CTX* ctx = NULL;
|
||||
static WOLFSSL* ssl = NULL;
|
||||
static char* wc_error_message = (char*)malloc(80 + 1);
|
||||
static char errBuf[80];
|
||||
|
||||
#if defined(MEMORY_STRESS_TEST)
|
||||
#define MEMORY_STRESS_ITERATIONS 100
|
||||
#define MEMORY_STRESS_BLOCK_SIZE 1024
|
||||
#define MEMORY_STRESS_INITIAL (4*1024)
|
||||
static char* memory_stress[MEMORY_STRESS_ITERATIONS]; /* typically 1K per item */
|
||||
static int mem_ctr = 0;
|
||||
#endif
|
||||
|
||||
static int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
|
||||
static int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
|
||||
static int reconnect = RECONNECT_ATTEMPTS;
|
||||
static int lng_index PROGMEM = 0; /* 0 = English */
|
||||
|
||||
#if defined(__arm__)
|
||||
#include <malloc.h>
|
||||
extern char _end;
|
||||
extern "C" char *sbrk(int i);
|
||||
static char *ramstart=(char *)0x20070000;
|
||||
static char *ramend=(char *)0x20088000;
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* fail_wait - in case of unrecoverable error */
|
||||
/*****************************************************************************/
|
||||
int fail_wait(void) {
|
||||
show_memory();
|
||||
|
||||
Serial.println(F("Failed. Halt."));
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
ctx = wolfSSL_CTX_new(method);
|
||||
if (ctx == NULL) {
|
||||
Serial.println("unable to get ctx");
|
||||
return;
|
||||
}
|
||||
/* initialize wolfSSL using callback functions */
|
||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, 0);
|
||||
rc = wolfSSL_CTX_load_verify_buffer(ctx, ca_cert_der_2048,\
|
||||
sizeof_ca_cert_der_2048,\
|
||||
WOLFSSL_FILETYPE_ASN1);
|
||||
Serial.print("\n\n Return code of load_verify is:");
|
||||
Serial.println(rc);
|
||||
Serial.println("");
|
||||
rc = wolfSSL_CTX_use_certificate_buffer(ctx, client_cert_der_2048,\
|
||||
sizeof_client_cert_der_2048,\
|
||||
WOLFSSL_FILETYPE_ASN1);
|
||||
Serial.print("\n\n Return code of use_certificate_buffer is:");
|
||||
Serial.println(rc);
|
||||
Serial.println("");
|
||||
rc = wolfSSL_CTX_use_PrivateKey_buffer(ctx, client_key_der_2048,\
|
||||
sizeof_client_key_der_2048,\
|
||||
WOLFSSL_FILETYPE_ASN1);
|
||||
Serial.print("\n\n Return code of use_PrivateKey_buffer is:");
|
||||
Serial.println(rc);
|
||||
Serial.println("");
|
||||
wolfSSL_SetIOSend(ctx, EthernetSend);
|
||||
wolfSSL_SetIORecv(ctx, EthernetReceive);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx) {
|
||||
/*****************************************************************************/
|
||||
/* show_memory() to optionally view during debugging. */
|
||||
/*****************************************************************************/
|
||||
int show_memory(void)
|
||||
{
|
||||
#if defined(__arm__)
|
||||
struct mallinfo mi = mallinfo();
|
||||
|
||||
char *heapend=sbrk(0);
|
||||
register char * stack_ptr asm("sp");
|
||||
#if defined(DEBUG_WOLFSSL_VERBOSE)
|
||||
Serial.print(" arena=");
|
||||
Serial.println(mi.arena);
|
||||
Serial.print(" ordblks=");
|
||||
Serial.println(mi.ordblks);
|
||||
Serial.print(" uordblks=");
|
||||
Serial.println(mi.uordblks);
|
||||
Serial.print(" fordblks=");
|
||||
Serial.println(mi.fordblks);
|
||||
Serial.print(" keepcost=");
|
||||
Serial.println(mi.keepcost);
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG_WOLFSSL) || defined(MEMORY_STRESS_TEST)
|
||||
Serial.print("Estimated free memory: ");
|
||||
Serial.print(stack_ptr - heapend + mi.fordblks);
|
||||
Serial.println(F(" bytes"));
|
||||
#endif
|
||||
|
||||
#if (0)
|
||||
/* Experimental: not supported on all devices: */
|
||||
Serial.print("RAM Start %lx\n", (unsigned long)ramstart);
|
||||
Serial.print("Data/Bss end %lx\n", (unsigned long)&_end);
|
||||
Serial.print("Heap End %lx\n", (unsigned long)heapend);
|
||||
Serial.print("Stack Ptr %lx\n",(unsigned long)stack_ptr);
|
||||
Serial.print("RAM End %lx\n", (unsigned long)ramend);
|
||||
|
||||
Serial.print("Heap RAM Used: ",mi.uordblks);
|
||||
Serial.print("Program RAM Used ",&_end - ramstart);
|
||||
Serial.print("Stack RAM Used ",ramend - stack_ptr);
|
||||
|
||||
Serial.print("Estimated Free RAM: %d\n\n",stack_ptr - heapend + mi.fordblks);
|
||||
#endif
|
||||
#else
|
||||
Serial.println(F("show_memory() not implemented for this platform"));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* EthernetSend() to send a message string. */
|
||||
/*****************************************************************************/
|
||||
int EthernetSend(WOLFSSL* ssl, char* message, int sz, void* ctx) {
|
||||
int sent = 0;
|
||||
sent = client.write((byte*)msg, sz);
|
||||
(void)ssl;
|
||||
(void)ctx;
|
||||
|
||||
sent = client.write((byte*)message, sz);
|
||||
return sent;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* EthernetReceive() to receive a reply string. */
|
||||
/*****************************************************************************/
|
||||
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx) {
|
||||
int ret = 0;
|
||||
(void)ssl;
|
||||
(void)ctx;
|
||||
|
||||
while (client.available() > 0 && ret < sz) {
|
||||
reply[ret++] = client.read();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void loop() {
|
||||
int err = 0;
|
||||
int input = 0;
|
||||
int total_input = 0;
|
||||
char msg[32] = "hello wolfssl!";
|
||||
int msgSz = (int)strlen(msg);
|
||||
char errBuf[80];
|
||||
char reply[80];
|
||||
const char* cipherName;
|
||||
if (reconnect) {
|
||||
reconnect--;
|
||||
if (client.connect(host, port)) {
|
||||
Serial.print("Connected to ");
|
||||
Serial.println(host);
|
||||
ssl = wolfSSL_new(ctx);
|
||||
if (ssl == NULL) {
|
||||
Serial.println("Unable to allocate SSL object");
|
||||
return;
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_hardware() */
|
||||
/*****************************************************************************/
|
||||
int setup_hardware(void) {
|
||||
int ret = 0;
|
||||
|
||||
#if defined(ARDUINO_SAMD_NANO_33_IOT)
|
||||
Serial.println(F("Detected known tested and working Arduino Nano 33 IoT"));
|
||||
#elif defined(ARDUINO_ARCH_RP2040)
|
||||
Serial.println(F("Detected known tested and working Arduino RP-2040"));
|
||||
#elif defined(__arm__) && defined(ID_TRNG) && defined(TRNG)
|
||||
/* need to manually turn on random number generator on Arduino Due, etc. */
|
||||
pmc_enable_periph_clk(ID_TRNG);
|
||||
trng_enable(TRNG);
|
||||
Serial.println(F("Enabled ARM TRNG"));
|
||||
#endif
|
||||
|
||||
show_memory();
|
||||
randomSeed(analogRead(0));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_datetime() */
|
||||
/* The device needs to have a valid date within the valid range of certs. */
|
||||
/*****************************************************************************/
|
||||
int setup_datetime(void) {
|
||||
int ret = 0;
|
||||
int ntp_tries = 20;
|
||||
|
||||
/* we need a date in the range of cert expiration */
|
||||
#ifdef USE_NTP_LIB
|
||||
#if defined(ESP32)
|
||||
NTPClient timeClient(ntpUDP, "pool.ntp.org");
|
||||
|
||||
timeClient.begin();
|
||||
timeClient.update();
|
||||
delay(1000);
|
||||
while (!timeClient.isTimeSet() && (ntp_tries > 0)) {
|
||||
timeClient.forceUpdate();
|
||||
Serial.println(F("Waiting for NTP update"));
|
||||
delay(2000);
|
||||
ntp_tries--;
|
||||
}
|
||||
if (ntp_tries <= 0) {
|
||||
Serial.println(F("Warning: gave up waiting on NTP"));
|
||||
}
|
||||
Serial.println(timeClient.getFormattedTime());
|
||||
Serial.println(timeClient.getEpochTime());
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ESP32)
|
||||
/* see esp32-hal-time.c */
|
||||
ntp_tries = 5;
|
||||
/* Replace "pool.ntp.org" with your preferred NTP server */
|
||||
configTime(0, 0, "pool.ntp.org");
|
||||
|
||||
/* Wait for time to be set */
|
||||
while ((time(nullptr) <= 100000) && ntp_tries > 0) {
|
||||
Serial.println(F("Waiting for time to be set..."));
|
||||
delay(2000);
|
||||
ntp_tries--;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
} /* setup_datetime */
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_network() */
|
||||
/*****************************************************************************/
|
||||
int setup_network(void) {
|
||||
int ret = 0;
|
||||
|
||||
#if defined(USING_WIFI)
|
||||
int status = WL_IDLE_STATUS;
|
||||
|
||||
/* The ESP8266 & ESP32 support both AP and STA. We'll use STA: */
|
||||
#if defined(ESP8266) || defined(ESP32)
|
||||
WiFi.mode(WIFI_STA);
|
||||
#else
|
||||
String fv;
|
||||
if (WiFi.status() == WL_NO_MODULE) {
|
||||
Serial.println("Communication with WiFi module failed!");
|
||||
/* don't continue if no network */
|
||||
while (true) ;
|
||||
}
|
||||
|
||||
fv = WiFi.firmwareVersion();
|
||||
if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
|
||||
Serial.println("Please upgrade the firmware");
|
||||
}
|
||||
#endif
|
||||
|
||||
Serial.print(F("Connecting to WiFi "));
|
||||
Serial.print(ssid);
|
||||
status = WiFi.begin(ssid, password);
|
||||
while (status != WL_CONNECTED) {
|
||||
delay(1000);
|
||||
Serial.print(F("."));
|
||||
Serial.print(status);
|
||||
status = WiFi.status();
|
||||
}
|
||||
|
||||
Serial.println(F(" Connected!"));
|
||||
#else
|
||||
/* Newer Ethernet shields have a
|
||||
* MAC address printed on a sticker on the shield */
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
IPAddress ip(192, 168, 1, 42);
|
||||
IPAddress myDns(192, 168, 1, 1);
|
||||
Ethernet.init(10); /* Most Arduino shields */
|
||||
/* Ethernet.init(5); * MKR ETH Shield */
|
||||
/* Ethernet.init(0); * Teensy 2.0 */
|
||||
/* Ethernet.init(20); * Teensy++ 2.0 */
|
||||
/* Ethernet.init(15); * ESP8266 with Adafruit FeatherWing Ethernet */
|
||||
/* Ethernet.init(33); * ESP32 with Adafruit FeatherWing Ethernet */
|
||||
Serial.println(F("Initialize Ethernet with DHCP:"));
|
||||
if (Ethernet.begin(mac) == 0) {
|
||||
Serial.println(F("Failed to configure Ethernet using DHCP"));
|
||||
/* Check for Ethernet hardware present */
|
||||
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
|
||||
Serial.println(F("Ethernet shield was not found."));
|
||||
while (true) {
|
||||
delay(1); /* do nothing */
|
||||
}
|
||||
err = wolfSSL_connect(ssl);
|
||||
if (err != WOLFSSL_SUCCESS) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print("TLS Connect Error: ");
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
Serial.print("SSL version is ");
|
||||
Serial.println(wolfSSL_get_version(ssl));
|
||||
cipherName = wolfSSL_get_cipher(ssl);
|
||||
Serial.print("SSL cipher suite is ");
|
||||
Serial.println(cipherName);
|
||||
if ((wolfSSL_write(ssl, msg, msgSz)) == msgSz) {
|
||||
Serial.print("Server response: ");
|
||||
/* wait for data */
|
||||
while (!client.available()) {}
|
||||
/* read data */
|
||||
while (wolfSSL_pending(ssl)) {
|
||||
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
total_input += input;
|
||||
if (input < 0) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print("TLS Read Error: ");
|
||||
Serial.println(errBuf);
|
||||
break;
|
||||
}
|
||||
else if (input > 0) {
|
||||
reply[input] = '\0';
|
||||
Serial.print(reply);
|
||||
}
|
||||
else {
|
||||
Serial.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print("TLS Write Error: ");
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
wolfSSL_shutdown(ssl);
|
||||
wolfSSL_free(ssl);
|
||||
client.stop();
|
||||
Serial.println("Connection complete.");
|
||||
reconnect = 0;
|
||||
}
|
||||
if (Ethernet.linkStatus() == LinkOFF) {
|
||||
Serial.println(F("Ethernet cable is not connected."));
|
||||
}
|
||||
/* try to configure using IP address instead of DHCP : */
|
||||
Ethernet.begin(mac, ip, myDns);
|
||||
}
|
||||
else {
|
||||
Serial.print(F(" DHCP assigned IP "));
|
||||
Serial.println(Ethernet.localIP());
|
||||
}
|
||||
/* We'll assume the Ethernet connection is ready to go. */
|
||||
#endif
|
||||
|
||||
Serial.println(F("********************************************************"));
|
||||
Serial.print(F(" wolfSSL Example Client IP = "));
|
||||
#if defined(USING_WIFI)
|
||||
Serial.println(WiFi.localIP());
|
||||
#else
|
||||
Serial.println(Ethernet.localIP());
|
||||
#endif
|
||||
Serial.print(F(" Configured Server Host to connect to: "));
|
||||
Serial.println(host);
|
||||
Serial.println(F("********************************************************"));
|
||||
Serial.println(F("Setup network complete."));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_wolfssl() */
|
||||
/*****************************************************************************/
|
||||
int setup_wolfssl(void) {
|
||||
int ret = 0;
|
||||
WOLFSSL_METHOD* method;
|
||||
|
||||
/* Show a revision of wolfssl user_settings.h file in use when available: */
|
||||
#if defined(WOLFSSL_USER_SETTINGS_ID)
|
||||
Serial.print(F("WOLFSSL_USER_SETTINGS_ID: "));
|
||||
Serial.println(F(WOLFSSL_USER_SETTINGS_ID));
|
||||
#else
|
||||
Serial.println(F("No WOLFSSL_USER_SETTINGS_ID found."));
|
||||
#endif
|
||||
|
||||
#if defined(NO_WOLFSSL_SERVER)
|
||||
Serial.println(F("wolfSSL server code disabled to save space."));
|
||||
#endif
|
||||
#if defined(NO_WOLFSSL_CLIENT)
|
||||
Serial.println(F("wolfSSL client code disabled to save space."));
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
wolfSSL_Debugging_ON();
|
||||
Serial.println(F("wolfSSL Debugging is On!"));
|
||||
#else
|
||||
Serial.println(F("wolfSSL Debugging is Off! (enable with DEBUG_WOLFSSL)"));
|
||||
#endif
|
||||
|
||||
/* See ssl.c for TLS cache settings. Larger cache = use more RAM. */
|
||||
#if defined(NO_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS NO_SESSION_CACHE"));
|
||||
#elif defined(MICRO_SESSION_CACHEx)
|
||||
Serial.println(F("wolfSSL TLS MICRO_SESSION_CACHE"));
|
||||
#elif defined(SMALL_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS SMALL_SESSION_CACHE"));
|
||||
#elif defined(MEDIUM_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS MEDIUM_SESSION_CACHE"));
|
||||
#elif defined(BIG_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS BIG_SESSION_CACHE"));
|
||||
#elif defined(HUGE_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
|
||||
#elif defined(HUGE_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
|
||||
#else
|
||||
Serial.println(F("WARNING: Unknown or no TLS session cache setting."));
|
||||
/* See wolfssl/src/ssl.c for amount of memory used.
|
||||
* It is best on embedded devices to choose a TLS session cache size. */
|
||||
#endif
|
||||
|
||||
ret = wolfSSL_Init();
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
Serial.println("Successfully called wolfSSL_Init");
|
||||
}
|
||||
else {
|
||||
Serial.println("ERROR: wolfSSL_Init failed");
|
||||
}
|
||||
|
||||
/* See companion server example with wolfSSLv23_server_method here.
|
||||
* method = wolfSSLv23_client_method()); SSL 3.0 - TLS 1.3.
|
||||
* method = wolfTLSv1_2_client_method(); only TLS 1.2
|
||||
* method = wolfTLSv1_3_client_method(); only TLS 1.3
|
||||
*
|
||||
* see Arduino\libraries\wolfssl\src\user_settings.h */
|
||||
|
||||
Serial.println("Here we go!");
|
||||
|
||||
method = wolfSSLv23_client_method();
|
||||
if (method == NULL) {
|
||||
Serial.println(F("unable to get wolfssl client method"));
|
||||
fail_wait();
|
||||
}
|
||||
ctx = wolfSSL_CTX_new(method);
|
||||
if (ctx == NULL) {
|
||||
Serial.println(F("unable to get ctx"));
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_certificates() */
|
||||
/*****************************************************************************/
|
||||
int setup_certificates(void) {
|
||||
int ret = 0;
|
||||
|
||||
Serial.println(F("Initializing certificates..."));
|
||||
show_memory();
|
||||
|
||||
/* Use built-in validation, No verification callback function: */
|
||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, 0);
|
||||
|
||||
/* Certificate */
|
||||
Serial.println("Initializing certificates...");
|
||||
ret = wolfSSL_CTX_use_certificate_buffer(ctx,
|
||||
CTX_CLIENT_CERT,
|
||||
CTX_CLIENT_CERT_SIZE,
|
||||
CTX_CLIENT_CERT_TYPE);
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
Serial.print("Success: use certificate: ");
|
||||
Serial.println(xstr(CTX_SERVER_CERT));
|
||||
}
|
||||
else {
|
||||
Serial.println(F("Error: wolfSSL_CTX_use_certificate_buffer failed: "));
|
||||
wc_ErrorString(ret, wc_error_message);
|
||||
Serial.println(wc_error_message);
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
/* Setup private client key */
|
||||
ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
|
||||
CTX_CLIENT_KEY,
|
||||
CTX_CLIENT_KEY_SIZE,
|
||||
CTX_CLIENT_KEY_TYPE);
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
Serial.print("Success: use private key buffer: ");
|
||||
Serial.println(xstr(CTX_SERVER_KEY));
|
||||
}
|
||||
else {
|
||||
Serial.println(F("Error: wolfSSL_CTX_use_PrivateKey_buffer failed: "));
|
||||
wc_ErrorString(ret, wc_error_message);
|
||||
Serial.println(wc_error_message);
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
ret = wolfSSL_CTX_load_verify_buffer(ctx,
|
||||
CTX_CA_CERT,
|
||||
CTX_CA_CERT_SIZE,
|
||||
CTX_CA_CERT_TYPE);
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
Serial.println(F("Success: load_verify CTX_CA_CERT"));
|
||||
}
|
||||
else {
|
||||
Serial.println(F("Error: wolfSSL_CTX_load_verify_buffer failed: "));
|
||||
wc_ErrorString(ret, wc_error_message);
|
||||
Serial.println(wc_error_message);
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return ret;
|
||||
} /* Arduino setup */
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup() */
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void setup(void) {
|
||||
int i = 0;
|
||||
Serial.begin(SERIAL_BAUD);
|
||||
while (!Serial && (i < 10)) {
|
||||
/* wait for serial port to connect. Needed for native USB port only */
|
||||
delay(1000);
|
||||
i++;
|
||||
}
|
||||
Serial.println(F(""));
|
||||
Serial.println(F(""));
|
||||
Serial.println(F("wolfSSL TLS Client Example Startup."));
|
||||
|
||||
/* define DEBUG_WOLFSSL in wolfSSL user_settings.h for diagnostics */
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
wolfSSL_Debugging_ON();
|
||||
#endif
|
||||
|
||||
/* Optionally pre-allocate a large block of memory for testing */
|
||||
#if defined(MEMORY_STRESS_TEST)
|
||||
Serial.println(F("WARNING: Memory Stress Test Active!"));
|
||||
Serial.print(F("Allocating extra memory: "));
|
||||
Serial.print(MEMORY_STRESS_INITIAL);
|
||||
Serial.println(F(" bytes..."));
|
||||
memory_stress[mem_ctr] = (char*)malloc(MEMORY_STRESS_INITIAL);
|
||||
show_memory();
|
||||
#endif
|
||||
|
||||
setup_hardware();
|
||||
|
||||
setup_network();
|
||||
|
||||
setup_datetime();
|
||||
|
||||
setup_wolfssl();
|
||||
|
||||
setup_certificates();
|
||||
|
||||
/* Initialize wolfSSL using callback functions. */
|
||||
wolfSSL_SetIOSend(ctx, EthernetSend);
|
||||
wolfSSL_SetIORecv(ctx, EthernetReceive);
|
||||
|
||||
Serial.println(F("Completed Arduino setup!"));
|
||||
/* See companion wolfssl_server.ino code; server begins listening here
|
||||
* https://github.com/wolfSSL/wolfssl/tree/master/IDE/ARDUINO/sketches/wolfssl_server
|
||||
* Any other server will work. See also:
|
||||
* https://github.com/wolfSSL/wolfssl/tree/master/examples/client
|
||||
*/
|
||||
/* See companion wolfssl_server.ino code */
|
||||
return;
|
||||
} /* Arduino setup */
|
||||
|
||||
/*****************************************************************************/
|
||||
/* wolfSSL error_check() */
|
||||
/*****************************************************************************/
|
||||
int error_check(int this_ret, bool halt_on_error,
|
||||
const __FlashStringHelper* message) {
|
||||
int ret = 0;
|
||||
if (this_ret == WOLFSSL_SUCCESS) {
|
||||
Serial.print(F("Success: "));
|
||||
Serial.println(message);
|
||||
}
|
||||
else {
|
||||
Serial.print(F("ERROR: return = "));
|
||||
Serial.print(this_ret);
|
||||
Serial.print(F(": "));
|
||||
Serial.println(message);
|
||||
Serial.println(wc_GetErrorString(this_ret));
|
||||
if (halt_on_error) {
|
||||
fail_wait();
|
||||
}
|
||||
}
|
||||
show_memory();
|
||||
|
||||
return ret;
|
||||
} /* error_check */
|
||||
|
||||
/*****************************************************************************/
|
||||
/* wolfSSL error_check_ssl */
|
||||
/* Parameters: */
|
||||
/* ssl is the current WOLFSSL object pointer */
|
||||
/* halt_on_error set to true to suspend operations for critical error */
|
||||
/* message is expected to be a memory-efficient F("") macro string */
|
||||
/*****************************************************************************/
|
||||
int error_check_ssl(WOLFSSL* ssl, int this_ret, bool halt_on_error,
|
||||
const __FlashStringHelper* message) {
|
||||
int err = 0;
|
||||
|
||||
if (ssl == NULL) {
|
||||
Serial.println(F("ssl is Null; Unable to allocate SSL object?"));
|
||||
#ifndef DEBUG_WOLFSSL
|
||||
Serial.println(F("Define DEBUG_WOLFSSL in user_settings.h for more."));
|
||||
#else
|
||||
Serial.println(F("See wolfssl/wolfcrypt/error-crypt.h for codes."));
|
||||
#endif
|
||||
Serial.print(F("ERROR: "));
|
||||
Serial.println(message);
|
||||
show_memory();
|
||||
if (halt_on_error) {
|
||||
fail_wait();
|
||||
}
|
||||
}
|
||||
else {
|
||||
err = wolfSSL_get_error(ssl, this_ret);
|
||||
if (err == WOLFSSL_SUCCESS) {
|
||||
Serial.print(F("Success m: "));
|
||||
Serial.println(message);
|
||||
}
|
||||
else {
|
||||
Serial.println("Trying to reconnect...");
|
||||
if (err < 0) {
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print(F("WOLFSSL Error: "));
|
||||
Serial.print(err);
|
||||
Serial.print(F("; "));
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
else {
|
||||
Serial.println(F("Success: ssl object."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/* Arduino loop() */
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void loop() {
|
||||
char reply[80];
|
||||
char msg[32] = "hello wolfssl!";
|
||||
const char* cipherName;
|
||||
int retry_shutdown = SHUTDOWN_DELAY_MS; /* max try, once per millisecond */
|
||||
int total_input = 0;
|
||||
int msgSz = 0;
|
||||
int input = 0;
|
||||
int ret = 0;
|
||||
int err = 0;
|
||||
msgSz = (int)strlen(msg);
|
||||
Serial.println(F(""));
|
||||
Serial.println(F("Starting Arduino loop() ..."));
|
||||
|
||||
if (reconnect) {
|
||||
reconnect--;
|
||||
/* WiFi client returns true if connection succeeds, false if not. */
|
||||
/* Wired client returns int (1,-1,-2,-3,-4) for connection status. */
|
||||
Serial.print(F("Connecting to "));
|
||||
Serial.print(host);
|
||||
Serial.print(F(":"));
|
||||
Serial.println(port);
|
||||
/* can also use: IPAddress server(192,168,1,37); */
|
||||
Serial.println(F("Here we go..."));
|
||||
ret = client.connect(host, port);
|
||||
Serial.println(F("Ok, checking..."));
|
||||
if (ret > 0) {
|
||||
Serial.println(F("Connected!"));
|
||||
|
||||
/* initialize wolfSSL */
|
||||
ret = wolfSSL_Init();
|
||||
error_check(ret, false, F("calling wolfSSL_Init") );
|
||||
|
||||
/* create secure connection object. see setup for ctx certs. */
|
||||
Serial.println(F("Calling ssl = wolfSSL_new(ctx)"));
|
||||
ssl = wolfSSL_new(ctx);
|
||||
error_check_ssl(ssl, 0, true, F("Create WOLFSSL object from ctx"));
|
||||
|
||||
Serial.print(F("Connecting to wolfSSL TLS Secure Server..."));
|
||||
do {
|
||||
err = 0; /* reset error */
|
||||
Serial.println(F("wolfSSL_connect ..."));
|
||||
ret = wolfSSL_connect(ssl);
|
||||
Serial.print("wolfSSL_connect return result =");
|
||||
Serial.println(ret);
|
||||
if ((ret != WOLFSSL_SUCCESS) && (ret != WC_PENDING_E)) {
|
||||
Serial.println(F("Failed connection, checking error."));
|
||||
err = error_check_ssl(ssl, ret, true,
|
||||
F("Create WOLFSSL object from ctx"));
|
||||
Serial.print("err =");
|
||||
Serial.println(err);
|
||||
}
|
||||
else {
|
||||
Serial.print(PROGRESS_DOT);
|
||||
}
|
||||
} while (err == WC_PENDING_E);
|
||||
|
||||
Serial.println();
|
||||
Serial.println(F("Connected!"));
|
||||
Serial.print(F("SSL version is "));
|
||||
Serial.println(wolfSSL_get_version(ssl));
|
||||
|
||||
cipherName = wolfSSL_get_cipher(ssl);
|
||||
Serial.print(F("SSL cipher suite is "));
|
||||
Serial.println(cipherName);
|
||||
|
||||
/* see test.h
|
||||
* TODO: test.h needs a little bit of Arduino work for these:
|
||||
showPeerEx(ssl, lng_index);
|
||||
showPeerPEM(ssl);
|
||||
*/
|
||||
|
||||
Serial.print(F("Sending secure message to server: "));
|
||||
Serial.println(msg);
|
||||
ret = wolfSSL_write(ssl, msg, msgSz);
|
||||
if (ret == msgSz) {
|
||||
Serial.print(F("Waiting for Server response..."));
|
||||
|
||||
while (!client.available()) {
|
||||
/* wait for data */
|
||||
delay(1); /* 1 ms delay */
|
||||
}
|
||||
|
||||
Serial.print(F("Reading response.."));
|
||||
/* read data */
|
||||
do {
|
||||
ret = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
if (ret < 0) {
|
||||
error_check_ssl(ssl, ret, false,
|
||||
F("during TLS Read"));
|
||||
}
|
||||
else {
|
||||
Serial.print(PROGRESS_DOT);
|
||||
}
|
||||
} while (err == WC_PENDING_E);
|
||||
Serial.println();
|
||||
|
||||
Serial.println();
|
||||
Serial.println(reply); /* typically: I hear you fa shizzle! */
|
||||
Serial.println();
|
||||
|
||||
} /* wolfSSL_write message size matched */
|
||||
else {
|
||||
error_check_ssl(ssl, ret, false,
|
||||
F("during TLS Write"));
|
||||
} /* any wolfSSL_write message size mismatch is an error */
|
||||
|
||||
Serial.print(F("Shutting down.."));
|
||||
do {
|
||||
delay(1);
|
||||
Serial.print(PROGRESS_DOT);
|
||||
retry_shutdown--;
|
||||
ret = wolfSSL_shutdown(ssl);
|
||||
} while ( (ret == WOLFSSL_SHUTDOWN_NOT_DONE)
|
||||
&& (retry_shutdown > 0)
|
||||
); /* There may be pending data, so wait until done. */
|
||||
Serial.println();
|
||||
|
||||
if (retry_shutdown <= 0) {
|
||||
/* if wolfSSL_free is called before properly shutting down the
|
||||
* ssl object, undesired results may occur. */
|
||||
Serial.println(F("Warning! Shutdown did not properly complete."));
|
||||
}
|
||||
|
||||
wolfSSL_free(ssl);
|
||||
client.stop();
|
||||
Serial.println(F("Connection complete."));
|
||||
if (REPEAT_CONNECTION) {
|
||||
reconnect = RECONNECT_ATTEMPTS;
|
||||
}
|
||||
else {
|
||||
reconnect = 0;
|
||||
}
|
||||
} /* client.connect(host, port) */
|
||||
else {
|
||||
Serial.println(F("Problem sending message. Trying to reconnect..."));
|
||||
}
|
||||
}
|
||||
delay(1000);
|
||||
}
|
||||
if ((reconnect > 0) && (REPEAT_CONNECTION)) {
|
||||
Serial.println(F("Arduino loop repeating..."));
|
||||
Serial.println();
|
||||
}
|
||||
else {
|
||||
printf("wow");
|
||||
Serial.println(F("Done!"));
|
||||
while(1) {
|
||||
/* wait forever */
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(MEMORY_STRESS_TEST)
|
||||
if (mem_ctr < MEMORY_STRESS_ITERATIONS) {
|
||||
/* reminder: mem_ctr == 0 is MEMORY_STRESS_INITIAL allocation */
|
||||
mem_ctr++;
|
||||
Serial.print(F("Memory stress increment: "));
|
||||
Serial.print(mem_ctr);
|
||||
Serial.print(F(". Allocating addition memory (bytes): "));
|
||||
Serial.println(MEMORY_STRESS_BLOCK_SIZE);
|
||||
memory_stress[mem_ctr] = (char*)malloc(MEMORY_STRESS_BLOCK_SIZE);
|
||||
show_memory();
|
||||
}
|
||||
#endif
|
||||
} /* Arduino loop repeats */
|
||||
|
||||
134
IDE/ARDUINO/sketches/wolfssl_server/README.md
Normal file
134
IDE/ARDUINO/sketches/wolfssl_server/README.md
Normal file
@@ -0,0 +1,134 @@
|
||||
# Arduino Basic TLS Server
|
||||
|
||||
Open the [wolfssl_server.ino](./wolfssl_server.ino) file in the Arduino IDE.
|
||||
|
||||
Other IDE products are also supported, such as:
|
||||
|
||||
- [PlatformIO in VS Code](https://docs.platformio.org/en/latest/frameworks/arduino.html)
|
||||
- [VisualGDB](https://visualgdb.com/tutorials/arduino/)
|
||||
- [VisualMicro](https://www.visualmicro.com/)
|
||||
|
||||
For examples on other platforms, see the [IDE directory](https://github.com/wolfssl/wolfssl/tree/master/IDE).
|
||||
Additional examples can be found on [wolfSSL/wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/).
|
||||
|
||||
## Connect with an Arduino Sketch
|
||||
|
||||
See the companion [Arduino Sketch Client](../wolfssl_client/wolfssl_client.ino).
|
||||
|
||||
## Connect with Linux Client
|
||||
|
||||
See also the [wolfSSL Example TLS Client](https://github.com/wolfSSL/wolfssl/tree/master/examples/client)
|
||||
and [wolfSSL Example TLS Server](https://github.com/wolfSSL/wolfssl/tree/master/examples/server).
|
||||
|
||||
Assuming a listening [Arduino Sketch Server](./wolfssl_server.ino) at `192.168.1.38` on port `11111`,
|
||||
connect with the `client` executable:
|
||||
|
||||
```
|
||||
./examples/client/client -h 192.168.1.38 -p 11111 -v 3
|
||||
```
|
||||
|
||||
## wolfSSL Error -308 wolfSSL_connect error state on socket
|
||||
|
||||
When using a wired Ethernet connection, and this error is encountered, simply
|
||||
press the reset button or power cycle the Arduino before making a connection.
|
||||
|
||||
Here's one possible script to test the server from a command-line client:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
echo "client log " > client_log.txt
|
||||
counter=1
|
||||
THIS_ERR=0
|
||||
while [ $THIS_ERR -eq 0 ]; do
|
||||
./examples/client/client -h 192.168.1.38 -p 11111 -v 3 >> client_log.txt
|
||||
|
||||
THIS_ERR=$?
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Iteration $counter"
|
||||
echo "Iteration $counter" >> client_log.txt
|
||||
((counter++))
|
||||
done
|
||||
```
|
||||
|
||||
Output expected from the `client` command:
|
||||
|
||||
```
|
||||
$ ./examples/client/client -h 192.168.1.38 -p 11111 -v 3
|
||||
Alternate cert chain used
|
||||
issuer : /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||
subject: /C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Support/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||
altname = example.com
|
||||
altname = 127.0.0.1
|
||||
serial number:01
|
||||
SSL version is TLSv1.2
|
||||
SSL cipher suite is ECDHE-RSA-AES128-GCM-SHA256
|
||||
SSL curve name is SECP256R1
|
||||
---
|
||||
Server certificate
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIE6DCCA9CgAwIBAgIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMx
|
||||
EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh
|
||||
d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
|
||||
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMjMxMjEz
|
||||
MjIxOTI4WhcNMjYwOTA4MjIxOTI4WjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
|
||||
B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wxEDAO
|
||||
BgNVBAsMB1N1cHBvcnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
|
||||
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
|
||||
ADCCAQoCggEBAMCVCOFXQfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hn
|
||||
f/5cnFF194rKB+c1L4/hvXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/X
|
||||
GQ0lT+FjY1GLC2Q/rUO4pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bM
|
||||
QLRpo0YzaYduxLsXpvPo3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq
|
||||
0KGWSrzh1Bpbx6DAwWN4D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ
|
||||
6dgIvDMgs1gip6rrxOHmYYPF0pbf2dBPrdcCAwEAAaOCAUUwggFBMB0GA1UdDgQW
|
||||
BBSzETLJkpiE4sn40DtuA0LKHw6OPDCB1AYDVR0jBIHMMIHJgBQnjmcRdMMmHT/t
|
||||
M2OzpNgdMOXo1aGBmqSBlzCBlDELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB01vbnRh
|
||||
bmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3RoMRMwEQYDVQQL
|
||||
DApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG
|
||||
9w0BCQEWEGluZm9Ad29sZnNzbC5jb22CFDNEGqhsAez2YPJwUQpM0RT6vOlEMAwG
|
||||
A1UdEwQFMAMBAf8wHAYDVR0RBBUwE4ILZXhhbXBsZS5jb22HBH8AAAEwHQYDVR0l
|
||||
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQBK/7nl
|
||||
hZvaU2Z/ByK/thnqQuukEQdi/zlfMzc6hyZxPROyyrhkOHuKmUgOpaRrsZlu4EZR
|
||||
vRlSrbymfip6fCOnzNteQ31rBMi33ZWt8JGAWcUZkSYnkbhIHOtVtqp9pDjxA7xs
|
||||
i6qU1jwFepbFBvEmFC51+93lNbMBLLOtYlohmgi+Vvz5okKHhuWpxZnPrhS+4LkI
|
||||
JA0dXNYU4UyfQLOp6S1Si0y/rEQxZ8GNBoXsD+SZ10t7IQZm1OT1nf+O8IY5WB2k
|
||||
W+Jj73zJGIeoAiUQPoco+fXvR56lgAgRkGj+0aOoUbk3/9XKfId/a7wsEsjFhYv8
|
||||
DMa5hrjJBMNRN9JP
|
||||
-----END CERTIFICATE-----
|
||||
Session timeout set to 500 seconds
|
||||
Client Random : 56A0BB9647B064D3F20947032B74B31FDB4C93DBAC9460BA8AEA213A2B2DD4A8
|
||||
SSL-Session:
|
||||
Protocol : TLSv1.2
|
||||
Cipher : TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
|
||||
Session-ID: 3255404E997FA9C27ECB4F1A20A70E722E4AA504B63A945FC175434D1907EC31
|
||||
Session-ID-ctx:
|
||||
Master-Key: 67F22168BBADD678643BBA76B398277270C29788AC18FD05B57F6B715F49A7BCEEF75BEAF7FE266B0CC058534AF76C1F
|
||||
TLS session ticket: NONE
|
||||
Start Time: 1705533296
|
||||
Timeout : 500 (sec)
|
||||
Extended master secret: no
|
||||
I hear you fa shizzle!
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
When encountering odd errors such as `undefined reference to ``_impure_ptr'`, such as this:
|
||||
|
||||
```text
|
||||
c:/users/gojimmypi/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\gojimmypi\AppData\Local\Temp\arduino\sketches\EAB8D79A02D1ECF107884802D893914E\libraries\wolfSSL\wolfcrypt\src\logging.c.o:(.literal.wolfssl_log+0x8): undefined reference to `_impure_ptr'
|
||||
collect2.exe: error: ld returned 1 exit status
|
||||
|
||||
exit status 1
|
||||
|
||||
Compilation error: exit status 1
|
||||
```
|
||||
|
||||
Try cleaning the Arduino cache directories. For Windows, that's typically in:
|
||||
|
||||
```text
|
||||
C:\Users\%USERNAME%\AppData\Local\Temp\arduino\sketches
|
||||
```
|
||||
|
||||
Remove all other boards from other serial ports, leaving one the one being programmed.
|
||||
@@ -19,161 +19,820 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
Tested with:
|
||||
|
||||
#include <wolfssl.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <Ethernet.h>
|
||||
1) Intel Galileo acting as the Client, with a laptop acting as a server using
|
||||
the server example provided in examples/server.
|
||||
Legacy Arduino v1.86 was used to compile and program the Galileo
|
||||
|
||||
#define USE_CERT_BUFFERS_256
|
||||
#include <wolfssl/certs_test.h>
|
||||
2) Espressif ESP32 WiFi
|
||||
|
||||
#ifdef NO_WOLFSSL_SERVER
|
||||
#error Please undefine NO_WOLFSSL_SERVER for this example
|
||||
3) Arduino Due, Nano33 IoT, Nano RP-2040
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note to code editors: the Arduino client and server examples are edited in
|
||||
* parallel for side-by-side comparison between examples.
|
||||
*/
|
||||
|
||||
/* If you have a private include, define it here, otherwise edit WiFi params */
|
||||
#define MY_PRIVATE_CONFIG "/workspace/my_private_config.h"
|
||||
|
||||
/* set REPEAT_CONNECTION to a non-zero value to continually run the example. */
|
||||
#define REPEAT_CONNECTION 1
|
||||
|
||||
/* Edit this with your other TLS host server address to connect to: */
|
||||
/* #define WOLFSSL_TLS_SERVER_HOST "192.168.1.34" */
|
||||
|
||||
/* wolfssl TLS examples communicate on port 11111 */
|
||||
#define WOLFSSL_PORT 11111
|
||||
|
||||
/* Choose a monitor serial baud rate: 9600, 14400, 19200, 57600, 74880, etc. */
|
||||
#define SERIAL_BAUD 115200
|
||||
|
||||
/* We'll wait up to 2000 milliseconds to properly shut down connection */
|
||||
#define SHUTDOWN_DELAY_MS 2000
|
||||
|
||||
/* Number of times to retry connection. */
|
||||
#define RECONNECT_ATTEMPTS 20
|
||||
|
||||
/* Optional stress test. Define to consume memory until exhausted: */
|
||||
/* #define MEMORY_STRESS_TEST */
|
||||
|
||||
/* Choose client or server example, not both. */
|
||||
/* #define WOLFSSL_CLIENT_EXAMPLE */
|
||||
#define WOLFSSL_SERVER_EXAMPLE
|
||||
|
||||
#if defined(MY_PRIVATE_CONFIG)
|
||||
/* the /workspace directory may contain a private config
|
||||
* excluded from GitHub with items such as WiFi passwords */
|
||||
#include MY_PRIVATE_CONFIG
|
||||
static const char* ssid PROGMEM = MY_ARDUINO_WIFI_SSID;
|
||||
static const char* password PROGMEM = MY_ARDUINO_WIFI_PASSWORD;
|
||||
#else
|
||||
/* when using WiFi capable boards: */
|
||||
static const char* ssid PROGMEM = "your_SSID";
|
||||
static const char* password PROGMEM = "your_PASSWORD";
|
||||
#endif
|
||||
|
||||
const int port = 11111; /* port to listen on */
|
||||
#define BROADCAST_ADDRESS "255.255.255.255"
|
||||
|
||||
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
|
||||
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
|
||||
/* There's an optional 3rd party NTPClient library by Fabrice Weinberg.
|
||||
* If it is installed, uncomment define USE_NTP_LIB here: */
|
||||
/* #define USE_NTP_LIB */
|
||||
#ifdef USE_NTP_LIB
|
||||
#include <NTPClient.h>
|
||||
#endif
|
||||
|
||||
EthernetServer server(port);
|
||||
EthernetClient client;
|
||||
#include <wolfssl.h>
|
||||
/* Important: make sure settings.h appears before any other wolfSSL headers */
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
/* Reminder: settings.h includes user_settings.h
|
||||
* For ALL project wolfSSL settings, see:
|
||||
* [your path]/Arduino\libraries\wolfSSL\src\user_settings.h */
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <wolfssl/certs_test.h>
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
/* Define DEBUG_WOLFSSL in user_settings.h for more verbose logging. */
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
#define PROGRESS_DOT F("")
|
||||
#else
|
||||
#define PROGRESS_DOT F(".")
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
int err;
|
||||
WOLFSSL_METHOD* method;
|
||||
/* Convert a macro to a string */
|
||||
#define xstr(x) str(x)
|
||||
#define str(x) #x
|
||||
|
||||
Serial.begin(9600);
|
||||
/* optional board-specific networking includes */
|
||||
#if defined(ESP32)
|
||||
#define USING_WIFI
|
||||
#include <WiFi.h>
|
||||
#include <WiFiUdp.h>
|
||||
#ifdef USE_NTP_LIB
|
||||
WiFiUDP ntpUDP;
|
||||
#endif
|
||||
/* Ensure the F() flash macro is defined */
|
||||
#ifndef F
|
||||
#define F
|
||||
#endif
|
||||
WiFiClient client;
|
||||
WiFiServer server(WOLFSSL_PORT);
|
||||
#elif defined(ESP8266)
|
||||
#define USING_WIFI
|
||||
#include <ESP8266WiFi.h>
|
||||
WiFiClient client;
|
||||
WiFiServer server(WOLFSSL_PORT);
|
||||
#elif defined(ARDUINO_SAM_DUE)
|
||||
#include <SPI.h>
|
||||
/* There's no WiFi/Ethernet on the Due. Requires Ethernet Shield.
|
||||
/* Needs "Ethernet by Various" library to be installed. Tested with V2.0.2 */
|
||||
#include <Ethernet.h>
|
||||
EthernetClient client;
|
||||
EthernetClient server(WOLFSSL_PORT);
|
||||
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
|
||||
#define USING_WIFI
|
||||
#include <SPI.h>
|
||||
#include <WiFiNINA.h> /* Needs Arduino WiFiNINA library installed manually */
|
||||
WiFiClient client;
|
||||
WiFiServer server(WOLFSSL_PORT);
|
||||
#elif defined(ARDUINO_ARCH_RP2040)
|
||||
#define USING_WIFI
|
||||
#include <SPI.h>
|
||||
#include <WiFiNINA.h>
|
||||
WiFiClient client;
|
||||
WiFiServer server(WOLFSSL_PORT);
|
||||
#elif defined(USING_WIFI)
|
||||
#define USING_WIFI
|
||||
#include <WiFi.h>
|
||||
#include <WiFiUdp.h>
|
||||
#ifdef USE_NTP_LIB
|
||||
WiFiUDP ntpUDP;
|
||||
#endif
|
||||
WiFiClient client;
|
||||
WiFiServer server(WOLFSSL_PORT);
|
||||
/* TODO
|
||||
#elif defined(OTHER_BOARD)
|
||||
*/
|
||||
#else
|
||||
#define USING_WIFI
|
||||
WiFiClient client;
|
||||
WiFiServer server(WOLFSSL_PORT);
|
||||
#endif
|
||||
|
||||
method = wolfTLSv1_2_server_method();
|
||||
if (method == NULL) {
|
||||
Serial.println("unable to get method");
|
||||
return;
|
||||
}
|
||||
ctx = wolfSSL_CTX_new(method);
|
||||
if (ctx == NULL) {
|
||||
Serial.println("unable to get ctx");
|
||||
return;
|
||||
}
|
||||
/* Only for syntax highlighters to show interesting options enabled: */
|
||||
#if defined(HAVE_SNI) \
|
||||
|| defined(HAVE_MAX_FRAGMENT) \
|
||||
|| defined(HAVE_TRUSTED_CA) \
|
||||
|| defined(HAVE_TRUNCATED_HMAC) \
|
||||
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
|
||||
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) \
|
||||
|| defined(HAVE_SUPPORTED_CURVES) \
|
||||
|| defined(HAVE_ALPN) \
|
||||
|| defined(HAVE_SESSION_TICKET) \
|
||||
|| defined(HAVE_SECURE_RENEGOTIATION) \
|
||||
|| defined(HAVE_SERVER_RENEGOTIATION_INFO)
|
||||
#endif
|
||||
|
||||
/* initialize wolfSSL using callback functions */
|
||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
wolfSSL_SetIOSend(ctx, EthernetSend);
|
||||
wolfSSL_SetIORecv(ctx, EthernetReceive);
|
||||
|
||||
/* setup the private key and certificate */
|
||||
err = wolfSSL_CTX_use_PrivateKey_buffer(ctx, ecc_key_der_256,
|
||||
sizeof_ecc_key_der_256, WOLFSSL_FILETYPE_ASN1);
|
||||
if (err != WOLFSSL_SUCCESS) {
|
||||
Serial.println("error setting key");
|
||||
return;
|
||||
}
|
||||
err = wolfSSL_CTX_use_certificate_buffer(ctx, serv_ecc_der_256,
|
||||
sizeof_serv_ecc_der_256, WOLFSSL_FILETYPE_ASN1);
|
||||
if (err != WOLFSSL_SUCCESS) {
|
||||
Serial.println("error setting certificate");
|
||||
return;
|
||||
}
|
||||
/* we expect our IP address from DHCP */
|
||||
|
||||
/* Start the server */
|
||||
server.begin();
|
||||
|
||||
return;
|
||||
static WOLFSSL_CTX* ctx = NULL;
|
||||
static WOLFSSL* ssl = NULL;
|
||||
static char* wc_error_message = (char*)malloc(80 + 1);
|
||||
static char errBuf[80];
|
||||
|
||||
#if defined(MEMORY_STRESS_TEST)
|
||||
#define MEMORY_STRESS_ITERATIONS 100
|
||||
#define MEMORY_STRESS_BLOCK_SIZE 1024
|
||||
#define MEMORY_STRESS_INITIAL (4*1024)
|
||||
static char* memory_stress[MEMORY_STRESS_ITERATIONS]; /* typically 1K per item */
|
||||
static int mem_ctr = 0;
|
||||
#endif
|
||||
|
||||
static int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
|
||||
static int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
|
||||
static int reconnect = RECONNECT_ATTEMPTS;
|
||||
static int lng_index PROGMEM = 0; /* 0 = English */
|
||||
|
||||
#if defined(__arm__)
|
||||
#include <malloc.h>
|
||||
extern char _end;
|
||||
extern "C" char *sbrk(int i);
|
||||
static char *ramstart=(char *)0x20070000;
|
||||
static char *ramend=(char *)0x20088000;
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* fail_wait - in case of unrecoverable error */
|
||||
/*****************************************************************************/
|
||||
int fail_wait(void) {
|
||||
show_memory();
|
||||
|
||||
Serial.println(F("Failed. Halt."));
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx) {
|
||||
int sent = 0;
|
||||
/*****************************************************************************/
|
||||
/* show_memory() to optionally view during debugging. */
|
||||
/*****************************************************************************/
|
||||
int show_memory(void)
|
||||
{
|
||||
#if defined(__arm__)
|
||||
struct mallinfo mi = mallinfo();
|
||||
|
||||
sent = client.write((byte*)msg, sz);
|
||||
char *heapend=sbrk(0);
|
||||
register char * stack_ptr asm("sp");
|
||||
#if defined(DEBUG_WOLFSSL_VERBOSE)
|
||||
Serial.print(" arena=");
|
||||
Serial.println(mi.arena);
|
||||
Serial.print(" ordblks=");
|
||||
Serial.println(mi.ordblks);
|
||||
Serial.print(" uordblks=");
|
||||
Serial.println(mi.uordblks);
|
||||
Serial.print(" fordblks=");
|
||||
Serial.println(mi.fordblks);
|
||||
Serial.print(" keepcost=");
|
||||
Serial.println(mi.keepcost);
|
||||
#endif
|
||||
|
||||
return sent;
|
||||
#if defined(DEBUG_WOLFSSL) || defined(MEMORY_STRESS_TEST)
|
||||
Serial.print("Estimated free memory: ");
|
||||
Serial.print(stack_ptr - heapend + mi.fordblks);
|
||||
Serial.println(F(" bytes"));
|
||||
#endif
|
||||
|
||||
#if (0)
|
||||
/* Experimental: not supported on all devices: */
|
||||
Serial.print("RAM Start %lx\n", (unsigned long)ramstart);
|
||||
Serial.print("Data/Bss end %lx\n", (unsigned long)&_end);
|
||||
Serial.print("Heap End %lx\n", (unsigned long)heapend);
|
||||
Serial.print("Stack Ptr %lx\n",(unsigned long)stack_ptr);
|
||||
Serial.print("RAM End %lx\n", (unsigned long)ramend);
|
||||
|
||||
Serial.print("Heap RAM Used: ",mi.uordblks);
|
||||
Serial.print("Program RAM Used ",&_end - ramstart);
|
||||
Serial.print("Stack RAM Used ",ramend - stack_ptr);
|
||||
|
||||
Serial.print("Estimated Free RAM: %d\n\n",stack_ptr - heapend + mi.fordblks);
|
||||
#endif
|
||||
#else
|
||||
Serial.println(F("show_memory() not implemented for this platform"));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* EthernetSend() to send a message string. */
|
||||
/*****************************************************************************/
|
||||
int EthernetSend(WOLFSSL* ssl, char* message, int sz, void* ctx) {
|
||||
int sent = 0;
|
||||
(void)ssl;
|
||||
(void)ctx;
|
||||
|
||||
sent = client.write((byte*)message, sz);
|
||||
return sent;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* EthernetReceive() to receive a reply string. */
|
||||
/*****************************************************************************/
|
||||
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx) {
|
||||
int ret = 0;
|
||||
int ret = 0;
|
||||
(void)ssl;
|
||||
(void)ctx;
|
||||
|
||||
while (client.available() > 0 && ret < sz) {
|
||||
reply[ret++] = client.read();
|
||||
}
|
||||
|
||||
return ret;
|
||||
while (client.available() > 0 && ret < sz) {
|
||||
reply[ret++] = client.read();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void loop() {
|
||||
int err = 0;
|
||||
int input = 0;
|
||||
char errBuf[80];
|
||||
char reply[80];
|
||||
int replySz = 0;
|
||||
const char* cipherName;
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_hardware() */
|
||||
/*****************************************************************************/
|
||||
int setup_hardware(void) {
|
||||
int ret = 0;
|
||||
|
||||
/* Listen for incoming client requests. */
|
||||
client = server.available();
|
||||
if (!client) {
|
||||
#if defined(ARDUINO_SAMD_NANO_33_IOT)
|
||||
Serial.println(F("Detected known tested and working Arduino Nano 33 IoT"));
|
||||
#elif defined(ARDUINO_ARCH_RP2040)
|
||||
Serial.println(F("Detected known tested and working Arduino RP-2040"));
|
||||
#elif defined(__arm__) && defined(ID_TRNG) && defined(TRNG)
|
||||
/* need to manually turn on random number generator on Arduino Due, etc. */
|
||||
pmc_enable_periph_clk(ID_TRNG);
|
||||
trng_enable(TRNG);
|
||||
Serial.println(F("Enabled ARM TRNG"));
|
||||
#endif
|
||||
|
||||
show_memory();
|
||||
randomSeed(analogRead(0));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_datetime() */
|
||||
/* The device needs to have a valid date within the valid range of certs. */
|
||||
/*****************************************************************************/
|
||||
int setup_datetime(void) {
|
||||
int ret = 0;
|
||||
int ntp_tries = 20;
|
||||
|
||||
/* we need a date in the range of cert expiration */
|
||||
#ifdef USE_NTP_LIB
|
||||
#if defined(ESP32)
|
||||
NTPClient timeClient(ntpUDP, "pool.ntp.org");
|
||||
|
||||
timeClient.begin();
|
||||
timeClient.update();
|
||||
delay(1000);
|
||||
while (!timeClient.isTimeSet() && (ntp_tries > 0)) {
|
||||
timeClient.forceUpdate();
|
||||
Serial.println(F("Waiting for NTP update"));
|
||||
delay(2000);
|
||||
ntp_tries--;
|
||||
}
|
||||
if (ntp_tries <= 0) {
|
||||
Serial.println(F("Warning: gave up waiting on NTP"));
|
||||
}
|
||||
Serial.println(timeClient.getFormattedTime());
|
||||
Serial.println(timeClient.getEpochTime());
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ESP32)
|
||||
/* see esp32-hal-time.c */
|
||||
ntp_tries = 5;
|
||||
/* Replace "pool.ntp.org" with your preferred NTP server */
|
||||
configTime(0, 0, "pool.ntp.org");
|
||||
|
||||
/* Wait for time to be set */
|
||||
while ((time(nullptr) <= 100000) && ntp_tries > 0) {
|
||||
Serial.println(F("Waiting for time to be set..."));
|
||||
delay(2000);
|
||||
ntp_tries--;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
} /* setup_datetime */
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_network() */
|
||||
/*****************************************************************************/
|
||||
int setup_network(void) {
|
||||
int ret = 0;
|
||||
|
||||
#if defined(USING_WIFI)
|
||||
int status = WL_IDLE_STATUS;
|
||||
|
||||
/* The ESP8266 & ESP32 support both AP and STA. We'll use STA: */
|
||||
#if defined(ESP8266) || defined(ESP32)
|
||||
WiFi.mode(WIFI_STA);
|
||||
#else
|
||||
String fv;
|
||||
if (WiFi.status() == WL_NO_MODULE) {
|
||||
Serial.println("Communication with WiFi module failed!");
|
||||
/* don't continue if no network */
|
||||
while (true) ;
|
||||
}
|
||||
|
||||
fv = WiFi.firmwareVersion();
|
||||
if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
|
||||
Serial.println("Please upgrade the firmware");
|
||||
}
|
||||
#endif
|
||||
|
||||
Serial.print(F("Connecting to WiFi "));
|
||||
Serial.print(ssid);
|
||||
status = WiFi.begin(ssid, password);
|
||||
while (status != WL_CONNECTED) {
|
||||
delay(1000);
|
||||
Serial.print(F("."));
|
||||
Serial.print(status);
|
||||
status = WiFi.status();
|
||||
}
|
||||
|
||||
Serial.println(F(" Connected!"));
|
||||
#else
|
||||
/* Newer Ethernet shields have a
|
||||
* MAC address printed on a sticker on the shield */
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
IPAddress ip(192, 168, 1, 42);
|
||||
IPAddress myDns(192, 168, 1, 1);
|
||||
Ethernet.init(10); /* Most Arduino shields */
|
||||
/* Ethernet.init(5); * MKR ETH Shield */
|
||||
/* Ethernet.init(0); * Teensy 2.0 */
|
||||
/* Ethernet.init(20); * Teensy++ 2.0 */
|
||||
/* Ethernet.init(15); * ESP8266 with Adafruit FeatherWing Ethernet */
|
||||
/* Ethernet.init(33); * ESP32 with Adafruit FeatherWing Ethernet */
|
||||
Serial.println(F("Initialize Ethernet with DHCP:"));
|
||||
if (Ethernet.begin(mac) == 0) {
|
||||
Serial.println(F("Failed to configure Ethernet using DHCP"));
|
||||
/* Check for Ethernet hardware present */
|
||||
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
|
||||
Serial.println(F("Ethernet shield was not found."));
|
||||
while (true) {
|
||||
delay(1); /* do nothing */
|
||||
}
|
||||
}
|
||||
if (Ethernet.linkStatus() == LinkOFF) {
|
||||
Serial.println(F("Ethernet cable is not connected."));
|
||||
}
|
||||
/* try to configure using IP address instead of DHCP : */
|
||||
Ethernet.begin(mac, ip, myDns);
|
||||
}
|
||||
else {
|
||||
Serial.print(F(" DHCP assigned IP "));
|
||||
Serial.println(Ethernet.localIP());
|
||||
}
|
||||
/* We'll assume the Ethernet connection is ready to go. */
|
||||
#endif
|
||||
|
||||
Serial.println(F("********************************************************"));
|
||||
Serial.print(F(" wolfSSL Example Server IP = "));
|
||||
#if defined(USING_WIFI)
|
||||
Serial.println(WiFi.localIP());
|
||||
#else
|
||||
Serial.println(Ethernet.localIP());
|
||||
#endif
|
||||
/* In server mode, there's no host definition. */
|
||||
/* See companion example: wolfssl_client.ino */
|
||||
Serial.println(F("********************************************************"));
|
||||
Serial.println(F("Setup network complete."));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_wolfssl() */
|
||||
/*****************************************************************************/
|
||||
int setup_wolfssl(void) {
|
||||
int ret = 0;
|
||||
WOLFSSL_METHOD* method;
|
||||
|
||||
/* Show a revision of wolfssl user_settings.h file in use when available: */
|
||||
#if defined(WOLFSSL_USER_SETTINGS_ID)
|
||||
Serial.print(F("WOLFSSL_USER_SETTINGS_ID: "));
|
||||
Serial.println(F(WOLFSSL_USER_SETTINGS_ID));
|
||||
#else
|
||||
Serial.println(F("No WOLFSSL_USER_SETTINGS_ID found."));
|
||||
#endif
|
||||
|
||||
#if defined(NO_WOLFSSL_SERVER)
|
||||
Serial.println(F("wolfSSL server code disabled to save space."));
|
||||
#endif
|
||||
#if defined(NO_WOLFSSL_CLIENT)
|
||||
Serial.println(F("wolfSSL client code disabled to save space."));
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
wolfSSL_Debugging_ON();
|
||||
Serial.println(F("wolfSSL Debugging is On!"));
|
||||
#else
|
||||
Serial.println(F("wolfSSL Debugging is Off! (enable with DEBUG_WOLFSSL)"));
|
||||
#endif
|
||||
|
||||
/* See ssl.c for TLS cache settings. Larger cache = use more RAM. */
|
||||
#if defined(NO_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS NO_SESSION_CACHE"));
|
||||
#elif defined(MICRO_SESSION_CACHEx)
|
||||
Serial.println(F("wolfSSL TLS MICRO_SESSION_CACHE"));
|
||||
#elif defined(SMALL_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS SMALL_SESSION_CACHE"));
|
||||
#elif defined(MEDIUM_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS MEDIUM_SESSION_CACHE"));
|
||||
#elif defined(BIG_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS BIG_SESSION_CACHE"));
|
||||
#elif defined(HUGE_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
|
||||
#elif defined(HUGE_SESSION_CACHE)
|
||||
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
|
||||
#else
|
||||
Serial.println(F("WARNING: Unknown or no TLS session cache setting."));
|
||||
/* See wolfssl/src/ssl.c for amount of memory used.
|
||||
* It is best on embedded devices to choose a TLS session cache size. */
|
||||
#endif
|
||||
|
||||
ret = wolfSSL_Init();
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
Serial.println("Successfully called wolfSSL_Init");
|
||||
}
|
||||
else {
|
||||
Serial.println("ERROR: wolfSSL_Init failed");
|
||||
}
|
||||
|
||||
/* See companion server example with wolfSSLv23_server_method here.
|
||||
* method = wolfSSLv23_client_method()); SSL 3.0 - TLS 1.3.
|
||||
* method = wolfTLSv1_2_client_method(); only TLS 1.2
|
||||
* method = wolfTLSv1_3_client_method(); only TLS 1.3
|
||||
*
|
||||
* see Arduino\libraries\wolfssl\src\user_settings.h */
|
||||
|
||||
Serial.println("Here we go!");
|
||||
|
||||
method = wolfSSLv23_server_method();
|
||||
if (method == NULL) {
|
||||
Serial.println(F("unable to get wolfssl server method"));
|
||||
fail_wait();
|
||||
}
|
||||
ctx = wolfSSL_CTX_new(method);
|
||||
if (ctx == NULL) {
|
||||
Serial.println(F("unable to get ctx"));
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup_certificates() */
|
||||
/*****************************************************************************/
|
||||
int setup_certificates(void) {
|
||||
int ret = 0;
|
||||
|
||||
Serial.println(F("Initializing certificates..."));
|
||||
show_memory();
|
||||
|
||||
/* Use built-in validation, No verification callback function: */
|
||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
|
||||
/* Certificate */
|
||||
Serial.println("Initializing certificates...");
|
||||
ret = wolfSSL_CTX_use_certificate_buffer(ctx,
|
||||
CTX_SERVER_CERT,
|
||||
CTX_SERVER_CERT_SIZE,
|
||||
CTX_CA_CERT_TYPE);
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
Serial.print("Success: use certificate: ");
|
||||
Serial.println(xstr(CTX_SERVER_CERT));
|
||||
}
|
||||
else {
|
||||
Serial.print("Error: wolfSSL_CTX_use_certificate_buffer failed: ");
|
||||
wc_ErrorString(ret, wc_error_message);
|
||||
Serial.println(wc_error_message);
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
/* Setup private server key */
|
||||
ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
|
||||
CTX_SERVER_KEY,
|
||||
CTX_SERVER_KEY_SIZE,
|
||||
CTX_SERVER_KEY_TYPE);
|
||||
if (ret == WOLFSSL_SUCCESS) {
|
||||
Serial.print("Success: use private key buffer: ");
|
||||
Serial.println(xstr(CTX_SERVER_KEY));
|
||||
}
|
||||
else {
|
||||
Serial.print("Error: wolfSSL_CTX_use_PrivateKey_buffer failed: ");
|
||||
wc_ErrorString(ret, wc_error_message);
|
||||
Serial.println(wc_error_message);
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
return ret;
|
||||
} /* Arduino setup */
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/* Arduino setup() */
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void setup(void) {
|
||||
int i = 0;
|
||||
Serial.begin(SERIAL_BAUD);
|
||||
while (!Serial && (i < 10)) {
|
||||
/* wait for serial port to connect. Needed for native USB port only */
|
||||
delay(1000);
|
||||
i++;
|
||||
}
|
||||
|
||||
Serial.println(F(""));
|
||||
Serial.println(F(""));
|
||||
Serial.println(F("wolfSSL TLS Server Example Startup."));
|
||||
|
||||
/* define DEBUG_WOLFSSL in wolfSSL user_settings.h for diagnostics */
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
wolfSSL_Debugging_ON();
|
||||
#endif
|
||||
|
||||
/* Optionally pre-allocate a large block of memory for testing */
|
||||
#if defined(MEMORY_STRESS_TEST)
|
||||
Serial.println(F("WARNING: Memory Stress Test Active!"));
|
||||
Serial.print(F("Allocating extra memory: "));
|
||||
Serial.print(MEMORY_STRESS_INITIAL);
|
||||
Serial.println(F(" bytes..."));
|
||||
memory_stress[mem_ctr] = (char*)malloc(MEMORY_STRESS_INITIAL);
|
||||
show_memory();
|
||||
#endif
|
||||
|
||||
setup_hardware();
|
||||
|
||||
setup_network();
|
||||
|
||||
setup_datetime();
|
||||
|
||||
setup_wolfssl();
|
||||
|
||||
setup_certificates();
|
||||
|
||||
/* Initialize wolfSSL using callback functions. */
|
||||
wolfSSL_SetIOSend(ctx, EthernetSend);
|
||||
wolfSSL_SetIORecv(ctx, EthernetReceive);
|
||||
|
||||
#if defined THIS_USER_SETTINGS_VERSION
|
||||
Serial.print(F("This user_settings.h version:"))
|
||||
Serial.println(THIS_USER_SETTINGS_VERSION)
|
||||
#endif
|
||||
|
||||
/* Start the server
|
||||
* See https://www.arduino.cc/reference/en/libraries/ethernet/server.begin/
|
||||
*/
|
||||
|
||||
Serial.println(F("Completed Arduino setup()"));
|
||||
|
||||
server.begin();
|
||||
Serial.println("Begin Server... (waiting for remote client to connect)");
|
||||
|
||||
/* See companion wolfssl_client.ino code */
|
||||
return;
|
||||
}
|
||||
} /* Arduino setup */
|
||||
|
||||
if (client.connected()) {
|
||||
/*****************************************************************************/
|
||||
/* wolfSSL error_check() */
|
||||
/*****************************************************************************/
|
||||
int error_check(int this_ret, bool halt_on_error,
|
||||
const __FlashStringHelper* message) {
|
||||
int ret = 0;
|
||||
if (this_ret == WOLFSSL_SUCCESS) {
|
||||
Serial.print(F("Success: "));
|
||||
Serial.println(message);
|
||||
}
|
||||
else {
|
||||
Serial.print(F("ERROR: return = "));
|
||||
Serial.print(this_ret);
|
||||
Serial.print(F(": "));
|
||||
Serial.println(message);
|
||||
Serial.println(wc_GetErrorString(this_ret));
|
||||
if (halt_on_error) {
|
||||
fail_wait();
|
||||
}
|
||||
}
|
||||
show_memory();
|
||||
|
||||
Serial.println("Client connected");
|
||||
return ret;
|
||||
} /* error_check */
|
||||
|
||||
/*****************************************************************************/
|
||||
/* wolfSSL error_check_ssl */
|
||||
/* Parameters: */
|
||||
/* ssl is the current WOLFSSL object pointer */
|
||||
/* halt_on_error set to true to suspend operations for critical error */
|
||||
/* message is expected to be a memory-efficient F("") macro string */
|
||||
/*****************************************************************************/
|
||||
int error_check_ssl(WOLFSSL* ssl, int this_ret, bool halt_on_error,
|
||||
const __FlashStringHelper* message) {
|
||||
int err = 0;
|
||||
|
||||
ssl = wolfSSL_new(ctx);
|
||||
if (ssl == NULL) {
|
||||
Serial.println("Unable to allocate SSL object");
|
||||
return;
|
||||
Serial.println(F("ssl is Null; Unable to allocate SSL object?"));
|
||||
#ifndef DEBUG_WOLFSSL
|
||||
Serial.println(F("Define DEBUG_WOLFSSL in user_settings.h for more."));
|
||||
#else
|
||||
Serial.println(F("See wolfssl/wolfcrypt/error-crypt.h for codes."));
|
||||
#endif
|
||||
Serial.print(F("ERROR: "));
|
||||
Serial.println(message);
|
||||
show_memory();
|
||||
if (halt_on_error) {
|
||||
fail_wait();
|
||||
}
|
||||
}
|
||||
else {
|
||||
err = wolfSSL_get_error(ssl, this_ret);
|
||||
if (err == WOLFSSL_SUCCESS) {
|
||||
Serial.print(F("Success m: "));
|
||||
Serial.println(message);
|
||||
}
|
||||
else {
|
||||
if (err < 0) {
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print(F("WOLFSSL Error: "));
|
||||
Serial.print(err);
|
||||
Serial.print(F("; "));
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
else {
|
||||
Serial.println(F("Success: ssl object."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err = wolfSSL_accept(ssl);
|
||||
if (err != WOLFSSL_SUCCESS) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print("TLS Accept Error: ");
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
|
||||
Serial.print("SSL version is ");
|
||||
Serial.println(wolfSSL_get_version(ssl));
|
||||
|
||||
cipherName = wolfSSL_get_cipher(ssl);
|
||||
Serial.print("SSL cipher suite is ");
|
||||
Serial.println(cipherName);
|
||||
|
||||
Serial.print("Server Read: ");
|
||||
/* wait for data */
|
||||
while (!client.available()) {}
|
||||
/* read data */
|
||||
while (wolfSSL_pending(ssl)) {
|
||||
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
if (input < 0) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print("TLS Read Error: ");
|
||||
Serial.println(errBuf);
|
||||
break;
|
||||
} else if (input > 0) {
|
||||
replySz = input;
|
||||
reply[input] = '\0';
|
||||
Serial.print(reply);
|
||||
} else {
|
||||
Serial.println();
|
||||
}
|
||||
}
|
||||
|
||||
/* echo data */
|
||||
if ((wolfSSL_write(ssl, reply, replySz)) != replySz) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(err, errBuf);
|
||||
Serial.print("TLS Write Error: ");
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
|
||||
wolfSSL_shutdown(ssl);
|
||||
wolfSSL_free(ssl);
|
||||
}
|
||||
|
||||
client.stop();
|
||||
Serial.println("Connection complete");
|
||||
return err;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/* Arduino loop() */
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void loop() {
|
||||
char errBuf[80] = "(no error";
|
||||
char reply[80] = "(no reply)";
|
||||
const char msg[] = "I hear you fa shizzle!";
|
||||
const char* cipherName;
|
||||
int input = 0;
|
||||
int replySz = 0;
|
||||
int retry_shutdown = SHUTDOWN_DELAY_MS; /* max try, once per millisecond */
|
||||
int ret = 0;
|
||||
IPAddress broadcast_address(255, 255, 255, 255);
|
||||
|
||||
/* Listen for incoming client requests. */
|
||||
client = server.available();
|
||||
if (client) {
|
||||
Serial.println("Have Client");
|
||||
while (!client.connected()) {
|
||||
/* wait for the client to actually connect */
|
||||
delay(10);
|
||||
}
|
||||
Serial.print("Client connected from remote IP: ");
|
||||
Serial.println(client.remoteIP());
|
||||
|
||||
ssl = wolfSSL_new(ctx);
|
||||
if (ssl == NULL) {
|
||||
Serial.println("Unable to allocate SSL object");
|
||||
fail_wait();
|
||||
}
|
||||
|
||||
ret = wolfSSL_accept(ssl);
|
||||
if (ret != WOLFSSL_SUCCESS) {
|
||||
ret = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(ret, errBuf);
|
||||
Serial.print("TLS Accept Error: ");
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
|
||||
cipherName = wolfSSL_get_cipher(ssl);
|
||||
Serial.print("SSL cipher suite is ");
|
||||
Serial.println(cipherName);
|
||||
|
||||
Serial.print("Server Read: ");
|
||||
while (!client.available()) {
|
||||
/* wait for data */
|
||||
}
|
||||
|
||||
/* read data */
|
||||
while (wolfSSL_pending(ssl)) {
|
||||
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
|
||||
if (input < 0) {
|
||||
ret = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(ret, errBuf);
|
||||
Serial.print("TLS Read Error: ");
|
||||
Serial.println(errBuf);
|
||||
break;
|
||||
}
|
||||
else if (input > 0) {
|
||||
replySz = input;
|
||||
reply[input] = '\0';
|
||||
Serial.print(reply);
|
||||
}
|
||||
else {
|
||||
Serial.println("<end of reply, input == 0>");
|
||||
}
|
||||
}
|
||||
|
||||
/* Write our message into reply buffer to send */
|
||||
memset(reply, 0, sizeof(reply));
|
||||
memcpy(reply, msg, sizeof(msg));
|
||||
replySz = strnlen(reply, sizeof(reply));
|
||||
|
||||
Serial.println("Sending reply...");
|
||||
if ((wolfSSL_write(ssl, reply, replySz)) != replySz) {
|
||||
ret = wolfSSL_get_error(ssl, 0);
|
||||
wolfSSL_ERR_error_string(ret, errBuf);
|
||||
Serial.print("TLS Write Error: ");
|
||||
Serial.println(errBuf);
|
||||
}
|
||||
else {
|
||||
Serial.println("Reply sent!");
|
||||
}
|
||||
|
||||
Serial.println("Shutdown!");
|
||||
do {
|
||||
delay(1);
|
||||
retry_shutdown--;
|
||||
ret = wolfSSL_shutdown(ssl);
|
||||
} while ((ret == WOLFSSL_SHUTDOWN_NOT_DONE) && (retry_shutdown > 0));
|
||||
|
||||
if (retry_shutdown <= 0) {
|
||||
/* if wolfSSL_free is called before properly shutting down the
|
||||
* ssl object, undesired results may occur. */
|
||||
Serial.println("Warning! Shutdown did not properly complete.");
|
||||
}
|
||||
|
||||
wolfSSL_free(ssl);
|
||||
Serial.println("Connection complete.");
|
||||
if (REPEAT_CONNECTION) {
|
||||
Serial.println();
|
||||
Serial.println("Waiting for next connection.");
|
||||
}
|
||||
else {
|
||||
client.stop();
|
||||
Serial.println("Done!");
|
||||
while (1) {
|
||||
/* wait forever if not repeating */
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Serial.println("Client not connected. Trying again..."); */
|
||||
}
|
||||
|
||||
delay(100);
|
||||
} /* Arduino loop repeats */
|
||||
|
||||
3
IDE/ARDUINO/sketches/wolfssl_version/README.md
Normal file
3
IDE/ARDUINO/sketches/wolfssl_version/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Arduino Basic Hello World
|
||||
|
||||
This example simply compiles in wolfSSL and shows the current version number.
|
||||
24
IDE/ARDUINO/sketches/wolfssl_version/wolfssl_version.ino
Normal file
24
IDE/ARDUINO/sketches/wolfssl_version/wolfssl_version.ino
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <Arduino.h>
|
||||
#include <wolfssl.h>
|
||||
#include <wolfssl/version.h>
|
||||
|
||||
/* Choose a monitor serial baud rate: 9600, 14400, 19200, 57600, 74880, etc. */
|
||||
#define SERIAL_BAUD 115200
|
||||
|
||||
/* Arduino setup */
|
||||
void setup() {
|
||||
Serial.begin(SERIAL_BAUD);
|
||||
while (!Serial) {
|
||||
/* wait for serial port to connect. Needed for native USB port only */
|
||||
}
|
||||
Serial.println(F(""));
|
||||
Serial.println(F(""));
|
||||
Serial.println(F("wolfSSL setup complete!"));
|
||||
}
|
||||
|
||||
/* Arduino main application loop. */
|
||||
void loop() {
|
||||
Serial.print("wolfSSL Version: ");
|
||||
Serial.println(LIBWOLFSSL_VERSION_STRING);
|
||||
delay(60000);
|
||||
}
|
||||
@@ -2,19 +2,124 @@
|
||||
|
||||
# this script will reformat the wolfSSL source code to be compatible with
|
||||
# an Arduino project
|
||||
# run as bash ./wolfssl-arduino.sh
|
||||
# run as bash ./wolfssl-arduino.sh [INSTALL] [path]
|
||||
#
|
||||
# ./wolfssl-arduino.sh
|
||||
# The default is to install to a local wolfSSL directory (`ROOT_DIR`).
|
||||
# If successfully built, and the INSTALL option is used, tis directory
|
||||
# is then moved to the target.
|
||||
#
|
||||
# ./wolfssl-arduino.sh INSTALL
|
||||
# Creates a local wolfSSL directory and then moves it to the ARDUINO_ROOT
|
||||
#
|
||||
# ./wolfssl-arduino.sh INSTALL /mnt/c/workspace/Arduino-wolfSSL-$USER
|
||||
# Updates the Arduino-wolfSSL fork for $USER to refresh versions.
|
||||
#
|
||||
# To ensure a pristine build, the directory must not exist.
|
||||
#
|
||||
# Reminder there's typically no $USER for GitHub actions, but:
|
||||
# ROOT_DIR="/mnt/c/Users/$USER/Documents/Arduino/libraries"
|
||||
#
|
||||
# The company name is "wolfSSL Inc."; There’s a space, no comma, and a period after "Inc."
|
||||
# The Arduino library name is "wolfssl" (all lower case)
|
||||
# The Arduino library directory name is "wolfssl" (all lower case)
|
||||
# The Arduino library include file is "wolfssl.h" (all lower case)
|
||||
# The Published wolfSSL Arduino Registry is at https://github.com/wolfSSL/Arduino-wolfSSL.git
|
||||
# See https://downloads.arduino.cc/libraries/logs/github.com/wolfSSL/Arduino-wolfSSL/
|
||||
ROOT_DIR="/wolfssl"
|
||||
|
||||
# The Arduino Version will initially have a suffix appended during fine tuning stage.
|
||||
WOLFSSL_VERSION_ARUINO_SUFFIX="-Arduino.3"
|
||||
|
||||
# For verbose copy, set CP_CMD="-v", otherwise clear it: CP_CMD="cp"
|
||||
# Do not set to empty string, as copy will fail with this: CP_CMD=""
|
||||
# CP_CMD="cp -v "
|
||||
CP_CMD="cp "
|
||||
|
||||
# Specify the executable shell checker you want to use:
|
||||
MY_SHELLCHECK="shellcheck"
|
||||
|
||||
# There are special circumstances to publish to GitHub repository.
|
||||
# Typically: https://github.com/wolfSSL/Arduino-wolfSSL
|
||||
#
|
||||
# Unlike a local Arduino library that requires a clean directory,
|
||||
# we'll allow extra files, overwrites, etc.
|
||||
#
|
||||
# Note in all cases, the local IDE/ARDUINO/wolfssl must be empty.
|
||||
THIS_INSTALL_IS_GITHUB="false"
|
||||
|
||||
# Check if the executable is available in the PATH
|
||||
if command -v "$MY_SHELLCHECK" >/dev/null 2>&1; then
|
||||
# Run your command here
|
||||
shellcheck "$0" || exit 1
|
||||
else
|
||||
echo "$MY_SHELLCHECK is not installed. Please install it if changes to this script have been made."
|
||||
fi
|
||||
|
||||
if ! [ "$CP_CMD" = "cp " ]; then
|
||||
if [ "$CP_CMD" = "cp -v" ]; then
|
||||
echo "Copy verbose mode"
|
||||
else
|
||||
echo "ERROR: Copy mode not supported: $CP_CMD"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check environment
|
||||
if [ -n "$WSL_DISTRO_NAME" ]; then
|
||||
# we found a non-blank WSL environment distro name
|
||||
current_path="$(pwd)"
|
||||
pattern="/mnt/?"
|
||||
if echo "$current_path" | grep -Eq "^$pattern"; then
|
||||
# if we are in WSL and shared Windows file system, 'ln' does not work.
|
||||
ARDUINO_ROOT="/mnt/c/Users/$USER/Documents/Arduino/libraries"
|
||||
else
|
||||
ARDUINO_ROOT="$HOME/Arduino/libraries"
|
||||
fi
|
||||
fi
|
||||
echo "The Arduino library root is: $ARDUINO_ROOT"
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
THIS_OPERATION="$1"
|
||||
if [ "$THIS_OPERATION" = "INSTALL" ]; then
|
||||
THIS_INSTALL_DIR=$2
|
||||
|
||||
echo "Install is active."
|
||||
|
||||
if [ "$THIS_INSTALL_DIR" = "" ]; then
|
||||
if [ -d "$ARDUINO_ROOT$ROOT_DIR" ]; then
|
||||
echo "Error: the installation directory already exists: $ARDUINO_ROOT$ROOT_DIR"
|
||||
echo "A new directory needs to be created to ensure there are no stray files"
|
||||
echo "Please delete or move the directory and try again."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Installing to $THIS_INSTALL_DIR"
|
||||
if [ -d "$THIS_INSTALL_DIR/.git" ];then
|
||||
echo "Target is a GitHub repository."
|
||||
THIS_INSTALL_IS_GITHUB="true"
|
||||
else
|
||||
echo "Target is NOT a GitHub repository."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Error: not a valid operation: $THIS_OPERATION"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
ROOT_DIR="/wolfSSL"
|
||||
ROOT_SRC_DIR="${ROOT_DIR}/src"
|
||||
EXAMPLES_DIR="${ROOT_DIR}/examples"
|
||||
WOLFSSL_SRC="${ROOT_SRC_DIR}/src"
|
||||
WOLFSSL_HEADERS="${ROOT_SRC_DIR}/wolfssl"
|
||||
WOLFCRYPT_ROOT="${ROOT_SRC_DIR}/wolfcrypt"
|
||||
WOLFCRYPT_SRC="${WOLFCRYPT_ROOT}/src"
|
||||
WOLFCRYPT_HEADERS="${WOLFSSL_HEADERS}/wolfcrypt"
|
||||
OPENSSL_DIR="${WOLFSSL_HEADERS}/openssl"
|
||||
WOLFSSL_VERSION="5.6.4"
|
||||
|
||||
# TOP indicates the file directory comes from the top level of the wolfssl repo
|
||||
|
||||
# TOP indicates the file directory for top level of the wolfssl repository.
|
||||
TOP_DIR="../.."
|
||||
WOLFSSL_SRC_TOP="${TOP_DIR}/src"
|
||||
WOLFSSL_HEADERS_TOP="${TOP_DIR}/wolfssl"
|
||||
@@ -24,122 +129,196 @@ WOLFCRYPT_HEADERS_TOP="${WOLFSSL_HEADERS_TOP}/wolfcrypt"
|
||||
OPENSSL_DIR_TOP="${WOLFSSL_HEADERS_TOP}/openssl"
|
||||
|
||||
|
||||
# TODO: Parse version number
|
||||
WOLFSSL_VERSION=$(grep -i "LIBWOLFSSL_VERSION_STRING" ${TOP_DIR}/wolfssl/version.h | cut -d '"' -f 2)
|
||||
if [ "$WOLFSSL_VERSION" = "" ]; then
|
||||
echo "ERROR: Could not find wolfSSL Version in ${TOP_DIR}/wolfssl/version.h"
|
||||
exit 1
|
||||
else
|
||||
echo "Found wolfSSL version $WOLFSSL_VERSION"
|
||||
echo "# WOLFSSL_VERSION_ARUINO_SUFFIX $WOLFSSL_VERSION_ARUINO_SUFFIX"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
THIS_DIR=${PWD##*/}
|
||||
|
||||
DIR=${PWD##*/}
|
||||
|
||||
if [ "$DIR" = "ARDUINO" ]; then
|
||||
if [ ! -d ".${ROOT_DIR}" ]; then
|
||||
mkdir .${ROOT_DIR}
|
||||
if [ "$THIS_DIR" = "ARDUINO" ]; then
|
||||
# mkdir ./wolfssl
|
||||
if [ -d ".${ROOT_DIR}" ]; then
|
||||
echo "ERROR: $(realpath ".${ROOT_DIR}") is not empty"
|
||||
exit 1
|
||||
else
|
||||
echo "Step 01: mkdir .${ROOT_DIR}"
|
||||
mkdir ."${ROOT_DIR}"
|
||||
fi
|
||||
|
||||
# mkdir ./wolfssl/src
|
||||
if [ ! -d ".${ROOT_SRC_DIR}" ]; then
|
||||
mkdir .${ROOT_SRC_DIR}
|
||||
echo "Step 02: mkdir .${ROOT_SRC_DIR}"
|
||||
mkdir ."${ROOT_SRC_DIR}"
|
||||
fi
|
||||
|
||||
# mkdir ./wolfssl/src/wolfssl
|
||||
if [ ! -d ".${WOLFSSL_HEADERS}" ]; then
|
||||
mkdir .${WOLFSSL_HEADERS}
|
||||
echo "Step 03: mkdir .${WOLFSSL_HEADERS}"
|
||||
mkdir ."${WOLFSSL_HEADERS}"
|
||||
fi
|
||||
|
||||
cp ${WOLFSSL_HEADERS_TOP}/*.h .${WOLFSSL_HEADERS}
|
||||
# cp ../../wolfssl/*.h ./wolfssl/src/wolfssl
|
||||
echo "Step 04: cp ${WOLFSSL_HEADERS_TOP}/*.h .${WOLFSSL_HEADERS}"
|
||||
$CP_CMD "${WOLFSSL_HEADERS_TOP}"/*.h ."${WOLFSSL_HEADERS}"
|
||||
if [ ! -d ".${WOLFCRYPT_HEADERS}" ]; then
|
||||
mkdir .${WOLFCRYPT_HEADERS}
|
||||
# mkdir ./wolfssl/src/wolfssl/wolfcrypt
|
||||
echo "Step 05: mkdir .${WOLFCRYPT_HEADERS}"
|
||||
mkdir ."${WOLFCRYPT_HEADERS}"
|
||||
mkdir ."${WOLFCRYPT_HEADERS}/port"
|
||||
mkdir ."${WOLFCRYPT_HEADERS}/port/atmel"
|
||||
mkdir ."${WOLFCRYPT_HEADERS}/port/Espressif"
|
||||
fi
|
||||
cp ${WOLFCRYPT_HEADERS_TOP}/*.h .${WOLFCRYPT_HEADERS}
|
||||
|
||||
# cp ../../wolfssl/wolfcrypt/*.h ./wolfssl/src/wolfssl/wolfcrypt
|
||||
echo "Step 06: cp ${WOLFCRYPT_HEADERS_TOP}/*.h .${WOLFCRYPT_HEADERS}"
|
||||
$CP_CMD "${WOLFCRYPT_HEADERS_TOP}"/*.h ."${WOLFCRYPT_HEADERS}" || exit 1
|
||||
$CP_CMD "${WOLFCRYPT_HEADERS_TOP}"/port/atmel/*.h ."${WOLFCRYPT_HEADERS}/port/atmel" || exit 1
|
||||
$CP_CMD "${WOLFCRYPT_HEADERS_TOP}"/port/Espressif/*.h ."${WOLFCRYPT_HEADERS}/port/Espressif" || exit 1
|
||||
|
||||
# Add in source files to wolfcrypt/src
|
||||
if [ ! -d ".${WOLFCRYPT_ROOT}" ]; then
|
||||
mkdir .${WOLFCRYPT_ROOT}
|
||||
# mkdir ./wolfssl/src/wolfcrypt
|
||||
echo "Step 07: mkdir .${WOLFCRYPT_ROOT}"
|
||||
mkdir ."${WOLFCRYPT_ROOT}"
|
||||
fi
|
||||
|
||||
# mkdir ./wolfssl/src/wolfcrypt/src
|
||||
if [ ! -d ".${WOLFCRYPT_SRC}" ]; then
|
||||
mkdir .${WOLFCRYPT_SRC}
|
||||
echo "Step 08: mkdir .${WOLFCRYPT_SRC}"
|
||||
mkdir ."${WOLFCRYPT_SRC}"
|
||||
mkdir ."${WOLFCRYPT_SRC}"/port
|
||||
mkdir ."${WOLFCRYPT_SRC}"/port/atmel
|
||||
mkdir ."${WOLFCRYPT_SRC}"/port/Espressif
|
||||
fi
|
||||
cp ${WOLFCRYPT_SRC_TOP}/*.c .${WOLFCRYPT_SRC}
|
||||
|
||||
|
||||
# cp ../../wolfcrypt/src/*.c ./wolfssl/src/wolfcrypt/src
|
||||
echo "Step 09: cp ${WOLFCRYPT_SRC_TOP}/*.c .${WOLFCRYPT_SRC}"
|
||||
$CP_CMD -r "${WOLFCRYPT_SRC_TOP}"/*.c ."${WOLFCRYPT_SRC}" || exit 1
|
||||
$CP_CMD -r "${WOLFCRYPT_SRC_TOP}"/port/atmel/*.c ."${WOLFCRYPT_SRC}"/port/atmel || exit 1
|
||||
$CP_CMD -r "${WOLFCRYPT_SRC_TOP}"/port/Espressif/*.c ."${WOLFCRYPT_SRC}"/port/Espressif || exit 1
|
||||
|
||||
# Add in source files to top level src folders
|
||||
if [ ! -d ".${WOLFSSL_SRC}" ]; then
|
||||
mkdir .${WOLFSSL_SRC}
|
||||
# mkdir ./wolfssl/src/src
|
||||
echo "Step 10: mkdir .${WOLFSSL_SRC}"
|
||||
mkdir ."${WOLFSSL_SRC}"
|
||||
fi
|
||||
cp ${WOLFSSL_SRC_TOP}/*.c .${WOLFSSL_SRC}
|
||||
$CP_CMD "${WOLFSSL_SRC_TOP}"/*.c ."${WOLFSSL_SRC}" || exit 1
|
||||
# put bio and evp as includes
|
||||
cp .${WOLFSSL_SRC}/bio.c .${WOLFSSL_HEADERS}
|
||||
cp .${WOLFCRYPT_SRC}/evp.c .${WOLFSSL_HEADERS}
|
||||
$CP_CMD ."${WOLFSSL_SRC}"/bio.c ."${WOLFSSL_HEADERS}" || exit 1
|
||||
$CP_CMD ."${WOLFCRYPT_SRC}"/evp.c ."${WOLFSSL_HEADERS}" || exit 1
|
||||
|
||||
# make a copy of evp.c and bio.c for ssl.c to include inline
|
||||
cp .${WOLFSSL_HEADERS}/evp.c .${WOLFCRYPT_SRC}/evp.c
|
||||
cp .${WOLFSSL_HEADERS}/bio.c .${WOLFCRYPT_SRC}/bio.c
|
||||
|
||||
$CP_CMD ."${WOLFSSL_HEADERS}"/evp.c ."${WOLFCRYPT_SRC}"/evp.c || exit 1
|
||||
$CP_CMD ."${WOLFSSL_HEADERS}"/bio.c ."${WOLFCRYPT_SRC}"/bio.c || exit 1
|
||||
|
||||
# copy openssl compatibility headers to their appropriate location
|
||||
if [ ! -d ".${OPENSSL_DIR}" ]; then
|
||||
mkdir .${OPENSSL_DIR}
|
||||
mkdir ."${OPENSSL_DIR}"
|
||||
fi
|
||||
cp ${OPENSSL_DIR_TOP}/* .${OPENSSL_DIR}
|
||||
$CP_CMD "${OPENSSL_DIR_TOP}"/* ."${OPENSSL_DIR}" || exit 1
|
||||
|
||||
# Finally, copy the Arduino-specific wolfssl library files into place: [lib]/src
|
||||
$CP_CMD ./wolfssl.h ".${ROOT_SRC_DIR}"/wolfssl.h
|
||||
|
||||
cat > .${ROOT_SRC_DIR}/wolfssl.h <<EOF
|
||||
/* Generated wolfSSL header file for Arduino */
|
||||
#include <user_settings.h>
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
EOF
|
||||
echo "Copy examples...."
|
||||
# Copy examples
|
||||
mkdir -p ".${ROOT_SRC_DIR}"/examples
|
||||
|
||||
echo "Copy wolfssl_client example...."
|
||||
mkdir -p ".${EXAMPLES_DIR}"/wolfssl_client
|
||||
$CP_CMD ./sketches/wolfssl_client/wolfssl_client.ino ".${EXAMPLES_DIR}"/wolfssl_client/wolfssl_client.ino || exit 1
|
||||
$CP_CMD ./sketches/wolfssl_client/README.md ".${EXAMPLES_DIR}"/wolfssl_client/README.md || exit 1
|
||||
|
||||
# Creates user_settings file if one does not exist
|
||||
if [ ! -f ".${ROOT_SRC_DIR}/user_settings.h" ]; then
|
||||
cat > .${ROOT_SRC_DIR}/user_settings.h <<EOF
|
||||
/* Generated wolfSSL user_settings.h file for Arduino */
|
||||
#ifndef ARDUINO_USER_SETTINGS_H
|
||||
#define ARDUINO_USER_SETTINGS_H
|
||||
|
||||
/* Platform */
|
||||
#define WOLFSSL_ARDUINO
|
||||
|
||||
/* Math library (remove this to use normal math)*/
|
||||
#define USE_FAST_MATH
|
||||
#define TFM_NO_ASM
|
||||
#define NO_ASN_TIME
|
||||
|
||||
/* When using Intel Galileo Uncomment the line below */
|
||||
/* #define INTEL_GALILEO */
|
||||
|
||||
/* RNG DEFAULT !!FOR TESTING ONLY!! */
|
||||
/* comment out the error below to get started w/ bad entropy source
|
||||
* This will need fixed before distribution but is OK to test with */
|
||||
#error "needs solved, see: https://www.wolfssl.com/docs/porting-guide/"
|
||||
#define WOLFSSL_GENSEED_FORTEST
|
||||
|
||||
#endif /* ARDUINO_USER_SETTINGS_H */
|
||||
EOF
|
||||
fi
|
||||
|
||||
cp .${WOLFCRYPT_HEADERS}/settings.h .${WOLFCRYPT_HEADERS}/settings.h.bak
|
||||
cat > .${WOLFCRYPT_HEADERS}/settings.h <<EOF
|
||||
/*wolfSSL Generated ARDUINO settings */
|
||||
#ifndef WOLFSSL_USER_SETTINGS
|
||||
#define WOLFSSL_USER_SETTINGS
|
||||
#endif /* WOLFSSL_USER_SETTINGS */
|
||||
/*wolfSSL Generated ARDUINO settings: END */
|
||||
|
||||
EOF
|
||||
cat .${WOLFCRYPT_HEADERS}/settings.h.bak >> .${WOLFCRYPT_HEADERS}/settings.h
|
||||
|
||||
#Creating library.properties file based off of:
|
||||
#https://arduino.github.io/arduino-cli/0.35/library-specification/#libraryproperties-file-format
|
||||
|
||||
cat > .${ROOT_DIR}/library.properties <<EOF
|
||||
name=wolfSSL
|
||||
version=${WOLFSSL_VERSION}
|
||||
author=wolfSSL inc
|
||||
maintainer=wolfSSL inc <support@wolfssl.com>
|
||||
sentence=A lightweight SSL/TLS library written in ANSI C and targeted for embedded, RTOS, and resource-constrained environments.
|
||||
paragraph=Manual: https://www.wolfssl.com/documentation/manuals/wolfssl/index.html.
|
||||
category=Communication
|
||||
url=https://www.wolfssl.com/
|
||||
architectures=*
|
||||
|
||||
EOF
|
||||
echo "Copy wolfssl_server example...."
|
||||
mkdir -p .${EXAMPLES_DIR}/wolfssl_server
|
||||
$CP_CMD ./sketches/wolfssl_server/wolfssl_server.ino ".${EXAMPLES_DIR}"/wolfssl_server/wolfssl_server.ino || exit 1
|
||||
$CP_CMD ./sketches/wolfssl_server/README.md ".${EXAMPLES_DIR}"/wolfssl_server/README.md || exit 1
|
||||
|
||||
echo "Copy wolfssl_server example...."
|
||||
mkdir -p .${EXAMPLES_DIR}/wolfssl_version
|
||||
$CP_CMD ./sketches/wolfssl_version/wolfssl_version.ino ".${EXAMPLES_DIR}"/wolfssl_version/wolfssl_version.ino || exit 1
|
||||
$CP_CMD ./sketches/wolfssl_version/README.md ".${EXAMPLES_DIR}"/wolfssl_version/README.md || exit 1
|
||||
else
|
||||
echo "ERROR: You must be in the IDE/ARDUINO directory to run this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# At this point, the library is complete, but we need some additional files.
|
||||
#
|
||||
# optional diagnostics:
|
||||
# echo ".${ROOT_DIR}"
|
||||
# echo "${TOP_DIR}"
|
||||
# echo "cp ${TOP_DIR}/README.md .${ROOT_DIR}/"
|
||||
|
||||
# Replace the `${WOLFSSL_VERSION}` text in Arduino_README_prepend.md,
|
||||
# saving it to a .tmp file. Prepend that file to the wolfSSL README.md
|
||||
# file as PREPENDED_README.md, then copy that to the publish directory
|
||||
# as an Arduino-specific README.md file.
|
||||
VERSION_PLACEHOLDER="\${WOLFSSL_VERSION}"
|
||||
ARDUINO_VERSION_SUFFIX_PLACEHOLDER="\${WOLFSSL_VERSION_ARUINO_SUFFIX}"
|
||||
PREPEND_FILE="Arduino_README_prepend.md"
|
||||
PROPERTIES_FILE_TEMPLATE="library.properties.template"
|
||||
sed s/"$VERSION_PLACEHOLDER"/"$WOLFSSL_VERSION"/ "$PREPEND_FILE" > "$PREPEND_FILE.tmp"
|
||||
cat "$PREPEND_FILE.tmp" ${TOP_DIR}/README.md > PREPENDED_README.md
|
||||
|
||||
# Here we'll insert the wolfSSL version into the `library.properties.tmp` file, along with an Arduino version suffix.
|
||||
# The result should be something like version=5.6.6.Arduino.1 (for the 1st incremental version on top of 5.6.6)
|
||||
sed s/"$VERSION_PLACEHOLDER"/"$WOLFSSL_VERSION"/ "$PROPERTIES_FILE_TEMPLATE" > "library.properties.tmp"
|
||||
sed -i.backup s/"$ARDUINO_VERSION_SUFFIX_PLACEHOLDER"/"$WOLFSSL_VERSION_ARUINO_SUFFIX"/ "library.properties.tmp"
|
||||
|
||||
# cat library.properties.tmp
|
||||
# echo "${WOLFSSL_VERSION_ARUINO_SUFFIX}"
|
||||
|
||||
echo "Step 11: Final root file copy"
|
||||
$CP_CMD PREPENDED_README.md ."${ROOT_DIR}"/README.md || exit 1
|
||||
$CP_CMD library.properties.tmp ."${ROOT_DIR}"/library.properties || exit 1
|
||||
$CP_CMD "${TOP_DIR}"/"LICENSING" ."${ROOT_DIR}"/ || exit 1
|
||||
$CP_CMD "${TOP_DIR}"/"README" ."${ROOT_DIR}"/ || exit 1
|
||||
$CP_CMD "${TOP_DIR}"/"COPYING" ."${ROOT_DIR}"/ || exit 1
|
||||
$CP_CMD "${TOP_DIR}"/"ChangeLog.md" ."${ROOT_DIR}"/ || exit 1
|
||||
$CP_CMD "${TOP_DIR}"/".editorconfig" ."${ROOT_DIR}"/ || exit 1
|
||||
$CP_CMD "${TOP_DIR}"/".gitignore" ."${ROOT_DIR}"/ || exit 1
|
||||
|
||||
$CP_CMD "keywords.txt" ."${ROOT_DIR}"/ || exit 1
|
||||
|
||||
|
||||
echo "Step 12: Workspace to publish:"
|
||||
echo ""
|
||||
head -n 3 PREPENDED_README.md
|
||||
echo ""
|
||||
ls ./wolfssl -al
|
||||
echo ""
|
||||
|
||||
# Optionally install to a separate directory.
|
||||
# Note we should have exited above if a problem was encountered,
|
||||
# as we'll never want to install a bad library.
|
||||
if [ "$THIS_OPERATION" = "INSTALL" ]; then
|
||||
if [ "$THIS_INSTALL_IS_GITHUB" = "true" ]; then
|
||||
echo "Installing to GitHub directory: $THIS_INSTALL_DIR"
|
||||
cp -r ."$ROOT_DIR"/* "$THIS_INSTALL_DIR" || exit 1
|
||||
else
|
||||
echo "Config:"
|
||||
echo "cp ../../examples/configs/user_settings_arduino.h ".${ROOT_SRC_DIR}"/user_settings.h"
|
||||
# Nearly an ordinary copy, but we remove any lines with ">>" (typically edit with caution warning in comments)
|
||||
grep -v '>>' ../../examples/configs/user_settings_arduino.h > ".${ROOT_SRC_DIR}"/user_settings.h || exit 1
|
||||
|
||||
# Show the user_settings.h revision string:
|
||||
grep "WOLFSSL_USER_SETTINGS_ID" ."${ROOT_SRC_DIR}/user_settings.h"
|
||||
echo ""
|
||||
|
||||
echo "Install:"
|
||||
echo "mv .$ROOT_DIR $ARDUINO_ROOT"
|
||||
mv ."$ROOT_DIR" "$ARDUINO_ROOT" || exit 1
|
||||
|
||||
echo "Arduino wolfSSL Version: $WOLFSSL_VERSION$WOLFSSL_VERSION_ARUINO_SUFFIX"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Done!"
|
||||
|
||||
39
IDE/ARDUINO/wolfssl.h
Normal file
39
IDE/ARDUINO/wolfssl.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* wolfssl.h
|
||||
*
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
/* Edit with caution. This is an Arduino-library specific header for wolfSSL */
|
||||
|
||||
#ifndef WOLFSSL_USER_SETTINGS
|
||||
#define WOLFSSL_USER_SETTINGS
|
||||
#endif
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
/* wolfSSL user_settings.h must be included from settings.h */
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
|
||||
int wolfSSL_Arduino_Serial_Print(const char *const s)
|
||||
{
|
||||
/* See wolfssl/wolfcrypt/logging.c */
|
||||
Serial.println(F(s));
|
||||
return 0;
|
||||
};
|
||||
@@ -240,9 +240,9 @@
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_operations.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fe_x25519_128.i</name>
|
||||
<name>wolfcrypt/src/fe_x25519_128.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_x25519_128.i</locationURI>
|
||||
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_x25519_128.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>wolfcrypt/src/fp_mont_small.i</name>
|
||||
|
||||
@@ -40,7 +40,7 @@ The folder hierarchy is the same as the wolfSSL folders with an exception of the
|
||||
|
||||
4. Right click on each folders, add or link all the source code in the corresponding folder in wolfSSL.
|
||||
|
||||
5. Remove non-C platform dependent files from your build. At the moment, only aes_asm.asm, aes_gcm_asm.asm and aes_asm.s must be removed from your wolfssl/wolfcrypt/src folder.
|
||||
5. Remove non-C platform dependent files from your build. At the moment, only aes_asm.asm, aes_gcm_asm.asm, aes_xts_asm.asm and aes_asm.s must be removed from your wolfssl/wolfcrypt/src folder.
|
||||
|
||||
6. In your C/C++ compiler preprocessor settings, add the wolfSSL directories to your include paths.
|
||||
Here's an example of the paths that must be added.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# ESP-IDF Port
|
||||
|
||||
These Espressif examples have been created and tested with the latest stable release branch of
|
||||
[ESP-IDF V5.1](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32/get-started/index.html).
|
||||
The prior version 4.4 ESP-IDF is still supported, however version 5.1 or greater is recommended.
|
||||
[ESP-IDF V5.2](https://docs.espressif.com/projects/esp-idf/en/release-v5.2/esp32/get-started/index.html).
|
||||
The prior version 4.4 ESP-IDF is still supported, however version 5.2 or greater is recommended.
|
||||
Espressif has [a list of all ESP-IDF versions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html).
|
||||
|
||||
See the latest [Espressif Migration Guides](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/index.html).
|
||||
@@ -44,6 +44,28 @@ default configuration items in the wolfssl `settings.h`. With the latest version
|
||||
wolfSSL, some of these defaults can be disabled with `NO_ESPIDF_DEFAULT` and customized
|
||||
in your project `user_settings.h` as desired.
|
||||
|
||||
The `user_settings.h` include file should not be explicitly included in an project source files. Be
|
||||
sure to include `settings.h` (which pulls in `user_settings.h`) before any other wolfSSL include files.
|
||||
|
||||
A new project should also include a compiler option suc as `CFLAGS +=-DWOLFSSL_USER_SETTINGS"` to ensure
|
||||
the `user_settings.h` is included properly. See the [template example](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/examples/template/main/main.c).
|
||||
|
||||
```
|
||||
#ifdef WOLFSSL_USER_SETTINGS
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#ifndef WOLFSSL_ESPIDF
|
||||
#warning "Problem with wolfSSL user_settings."
|
||||
#warning "Check components/wolfssl/include"
|
||||
#endif
|
||||
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
|
||||
#else
|
||||
/* Define WOLFSSL_USER_SETTINGS project wide for settings.h to include */
|
||||
/* wolfSSL user settings in ./components/wolfssl/include/user_settings.h */
|
||||
#error "Missing WOLFSSL_USER_SETTINGS in CMakeLists or Makefile:\
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS"
|
||||
#endif
|
||||
```
|
||||
|
||||
See the respective project directory:
|
||||
|
||||
`[project-dir]/components/wolfssl/user_settings.h`
|
||||
@@ -116,7 +138,7 @@ See the specific examples for additional details.
|
||||
|
||||
## Setup for Linux (wolfSSL local copy)
|
||||
|
||||
This is a legacy method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
|
||||
This is an alternate method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
|
||||
|
||||
1. Run `setup.sh` at _/path/to_`/wolfssl/IDE/Espressif/ESP-IDF/` to deploy files into ESP-IDF tree
|
||||
2. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/`
|
||||
@@ -124,7 +146,7 @@ This is a legacy method for installation. It is recommended to use the new `CMak
|
||||
|
||||
## Setup for Windows
|
||||
|
||||
This is a legacy method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
|
||||
This is an alternate method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
|
||||
|
||||
1. Run ESP-IDF Command Prompt (cmd.exe) or Run ESP-IDF PowerShell Environment
|
||||
2. Run `setup_win.bat` at `.\IDE\Espressif\ESP-IDF\`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wolfcrypt/test/test_paths.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -10,9 +10,9 @@ These are the core examples for wolfSSL:
|
||||
|
||||
- [Test](./wolfssl_test/README.md)
|
||||
|
||||
- [TLS Client](./wolfssl_client/README.md)
|
||||
- [TLS Client](./wolfssl_client/README.md). See also [CLI Client](https://github.com/wolfSSL/wolfssl/tree/master/examples/client) and [more TLS examples](https://github.com/wolfSSL/wolfssl-examples/tree/master/tls).
|
||||
|
||||
- [TLS Server](./wolfssl_server/README.md)
|
||||
- [TLS Server](./wolfssl_server/README.md). See also [CLI Server](https://github.com/wolfSSL/wolfssl/tree/master/examples/server)
|
||||
|
||||
## Other Espressif wolfSSL Examples
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ToolchainID>
|
||||
<ID>com.visualgdb.xtensa-esp32-elf</ID>
|
||||
<Version>
|
||||
<GCC>12.2.0</GCC>
|
||||
<GCC>13.2.0</GCC>
|
||||
<GDB>12.1</GDB>
|
||||
<Revision>1</Revision>
|
||||
</Version>
|
||||
@@ -67,8 +67,8 @@
|
||||
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
|
||||
<ESPIDFExtension>
|
||||
<IDFCheckout>
|
||||
<Version>release/v5.1</Version>
|
||||
<Subdirectory>esp-idf/v5.1</Subdirectory>
|
||||
<Version>release/v5.2</Version>
|
||||
<Subdirectory>esp-idf/v5.2</Subdirectory>
|
||||
<Type>ESPIDF</Type>
|
||||
</IDFCheckout>
|
||||
<COMPort>COM37</COMPort>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
# Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
@@ -45,6 +45,11 @@ else()
|
||||
endif()
|
||||
message(STATUS "THIS_USER = ${THIS_USER}")
|
||||
|
||||
if( "$ENV{IDF_PATH}" STREQUAL "" )
|
||||
message(FATAL_ERROR "IDF_PATH Environment variable not set!")
|
||||
else()
|
||||
string(REPLACE "\\" "/" THIS_IDF_PATH "$ENV{IDF_PATH}")
|
||||
endif()
|
||||
|
||||
# COMPONENT_NAME = wolfssl
|
||||
# The component name is the directory name. "No feature to change this".
|
||||
@@ -82,8 +87,10 @@ function(FIND_WOLFSSL_DIRECTORY OUTPUT_FOUND_WOLFSSL_DIRECTORY)
|
||||
else()
|
||||
get_filename_component(CURRENT_SEARCH_DIR "$ENV{WOLFSSL_ROOT}" ABSOLUTE)
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR}" FOUND_WOLFSSL)
|
||||
if("${FOUND_WOLFSSL}")
|
||||
message(STATUS "Found WOLFSSL_ROOT via Environment Variable:")
|
||||
if( FOUND_WOLFSSL )
|
||||
message(STATUS "Found WOLFSSL_ROOT via Environment Variable: ${CURRENT_SEARCH_DIR}")
|
||||
set(${OUTPUT_FOUND_WOLFSSL_DIRECTORY} ${CURRENT_SEARCH_DIR} PARENT_SCOPE)
|
||||
return()
|
||||
else()
|
||||
message(FATAL_ERROR "WOLFSSL_ROOT Environment Variable defined, but path not found:")
|
||||
message(STATUS "$ENV{WOLFSSL_ROOT}")
|
||||
@@ -156,8 +163,8 @@ if(CMAKE_BUILD_EARLY_EXPANSION)
|
||||
idf_component_register(
|
||||
REQUIRES "${COMPONENT_REQUIRES}"
|
||||
PRIV_REQUIRES # esp_hw_support
|
||||
esp_timer
|
||||
driver # this will typically only be needed for wolfSSL benchmark
|
||||
# esp_timer
|
||||
# driver # this will typically only be needed for wolfSSL benchmark
|
||||
)
|
||||
|
||||
else()
|
||||
@@ -361,6 +368,10 @@ else()
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/\""
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/\""
|
||||
"\"${RTOS_IDF_PATH}/\""
|
||||
# wolfSSL release after v5.7 includes WiFi, time, and mem/debug helpers
|
||||
"${THIS_IDF_PATH}/components/esp_event/include"
|
||||
"${THIS_IDF_PATH}/components/esp_netif/include"
|
||||
"${THIS_IDF_PATH}/components/esp_wifi/include"
|
||||
)
|
||||
|
||||
|
||||
@@ -382,7 +393,10 @@ else()
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_bn.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_certman.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_crypto.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_load.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_misc.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_p7p12.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_sess.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/x509.c\""
|
||||
"\"${WOLFSSL_ROOT}/src/x509_str.c\""
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/evp.c\""
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -19,12 +19,22 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
/* This user_settings.h is for Espressif ESP-IDF */
|
||||
#include <sdkconfig.h>
|
||||
/* This user_settings.h is for Espressif ESP-IDF
|
||||
*
|
||||
* Standardized wolfSSL Espressif ESP32 + ESP8266 user_settings.h V5.7.0-1
|
||||
*
|
||||
* Do not include any wolfssl headers here
|
||||
*
|
||||
* When editing this file:
|
||||
* ensure wolfssl_test and wolfssl_benchmark settings match.
|
||||
*/
|
||||
|
||||
/* The Espressif project config file. See also sdkconfig.defaults */
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/* The Espressif sdkconfig will have chipset info.
|
||||
**
|
||||
** Possible values:
|
||||
** Some possible values:
|
||||
**
|
||||
** CONFIG_IDF_TARGET_ESP32
|
||||
** CONFIG_IDF_TARGET_ESP32S2
|
||||
@@ -36,18 +46,54 @@
|
||||
#undef WOLFSSL_ESPIDF
|
||||
#define WOLFSSL_ESPIDF
|
||||
|
||||
/* We don't use WiFi, so don't compile in the esp-sdk-lib WiFi helpers: */
|
||||
#define NO_ESP_SDK_WIFI
|
||||
|
||||
/* Experimental Kyber */
|
||||
#if 0
|
||||
/* Kyber typically needs a minimum 10K stack */
|
||||
#define WOLFSSL_EXPERIMENTAL_SETTINGS
|
||||
#define WOLFSSL_HAVE_KYBER
|
||||
#define WOLFSSL_WC_KYBER
|
||||
#define WOLFSSL_SHA3
|
||||
#endif
|
||||
|
||||
/*
|
||||
* choose ONE of these Espressif chips to define:
|
||||
* ONE of these Espressif chip families will be detected from sdkconfig:
|
||||
*
|
||||
* WOLFSSL_ESP32
|
||||
* WOLFSSL_ESPWROOM32SE
|
||||
* WOLFSSL_ESP8266
|
||||
*/
|
||||
#undef WOLFSSL_ESPWROOM32SE
|
||||
#undef WOLFSSL_ESP8266
|
||||
#undef WOLFSSL_ESP32
|
||||
/* See below for chipset detection from sdkconfig.h */
|
||||
|
||||
/* when you want to use SINGLE THREAD. Note Default ESP-IDF is FreeRTOS */
|
||||
/* #define SINGLE_THREADED */
|
||||
|
||||
/* SMALL_SESSION_CACHE saves a lot of RAM for ClientCache and SessionCache.
|
||||
* Memory requirement is about 5KB, otherwise 20K is needed when not specified.
|
||||
* If extra small footprint is needed, try MICRO_SESSION_CACHE (< 1K)
|
||||
* When really desperate or no TLS used, try NO_SESSION_CACHE. */
|
||||
#define NO_SESSION_CACHE
|
||||
|
||||
/* Small Stack uses more heap. */
|
||||
#define WOLFSSL_SMALL_STACK
|
||||
|
||||
/* Full debugging turned off, but show malloc failure detail */
|
||||
/* #define DEBUG_WOLFSSL */
|
||||
#define DEBUG_WOLFSSL_MALLOC
|
||||
|
||||
/* See test.c that sets cert buffers; we'll set them here: */
|
||||
#define USE_CERT_BUFFERS_256
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
/* RSA_LOW_MEM: Half as much memory but twice as slow. */
|
||||
#define RSA_LOW_MEM
|
||||
|
||||
|
||||
|
||||
#define WOLFSSL_ESP32
|
||||
|
||||
/* optionally turn off SHA512/224 SHA512/256 */
|
||||
/* #define WOLFSSL_NOSHA512_224 */
|
||||
@@ -61,7 +107,6 @@
|
||||
/* #define NO_OLD_TLS */
|
||||
|
||||
#define BENCH_EMBEDDED
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
/* TLS 1.3 */
|
||||
#define WOLFSSL_TLS13
|
||||
@@ -79,7 +124,9 @@
|
||||
|
||||
#define HAVE_AESGCM
|
||||
|
||||
#define WOLFSSL_RIPEMD
|
||||
/* Optional RIPEMD: RACE Integrity Primitives Evaluation Message Digest */
|
||||
/* #define WOLFSSL_RIPEMD */
|
||||
|
||||
/* when you want to use SHA224 */
|
||||
#define WOLFSSL_SHA224
|
||||
|
||||
@@ -92,22 +139,31 @@
|
||||
/* when you want to use SHA3 */
|
||||
#define WOLFSSL_SHA3
|
||||
|
||||
/* Reminder: ED25519 requires SHA512 */
|
||||
/* ED25519 requires SHA512 */
|
||||
#define HAVE_ED25519
|
||||
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
/* Some features not enabled for ESP8266: */
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP32C2)
|
||||
/* TODO determine low memory configuration for ECC. */
|
||||
#else
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
#endif
|
||||
|
||||
#define HAVE_ED25519
|
||||
|
||||
/* Optional OPENSSL compatibility */
|
||||
#define OPENSSL_EXTRA
|
||||
/* when you want to use pkcs7 */
|
||||
|
||||
/* #Optional HAVE_PKCS7 */
|
||||
/* #define HAVE_PKCS7 */
|
||||
|
||||
#define HAVE_PKCS7
|
||||
|
||||
#if defined(HAVE_PKCS7)
|
||||
/* HAVE_PKCS7 may enable HAVE_PBKDF2 see settings.h */
|
||||
#define NO_PBKDF2
|
||||
|
||||
#define HAVE_AES_KEYWRAP
|
||||
#define HAVE_X963_KDF
|
||||
#define WOLFSSL_AES_DIRECT
|
||||
@@ -127,27 +183,11 @@
|
||||
/* #define CUSTOM_SLOT_ALLOCATION */
|
||||
#endif
|
||||
|
||||
/* RSA primitive specific definition */
|
||||
#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE)
|
||||
/* Define USE_FAST_MATH and SMALL_STACK */
|
||||
#define ESP32_USE_RSA_PRIMITIVE
|
||||
/* WC_NO_CACHE_RESISTANT: slower but more secure */
|
||||
/* #define WC_NO_CACHE_RESISTANT */
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
|
||||
/* NOTE HW unreliable for small values! */
|
||||
/* threshold for performance adjustment for HW primitive use */
|
||||
/* X bits of G^X mod P greater than */
|
||||
#undef ESP_RSA_EXPT_XBITS
|
||||
#define ESP_RSA_EXPT_XBITS 32
|
||||
|
||||
/* X and Y of X * Y mod P greater than */
|
||||
#undef ESP_RSA_MULM_BITS
|
||||
#define ESP_RSA_MULM_BITS 16
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define RSA_LOW_MEM
|
||||
/* TFM_TIMING_RESISTANT: slower but more secure */
|
||||
/* #define TFM_TIMING_RESISTANT */
|
||||
|
||||
/* #define WOLFSSL_ATECC508A_DEBUG */
|
||||
|
||||
@@ -159,9 +199,10 @@
|
||||
|
||||
|
||||
/* adjust wait-timeout count if you see timeout in RSA HW acceleration */
|
||||
#define ESP_RSA_TIMEOUT_CNT 0x249F00
|
||||
#define ESP_RSA_TIMEOUT_CNT 0x349F00
|
||||
|
||||
#define HASH_SIZE_LIMIT /* for test.c */
|
||||
/* hash limit for test.c */
|
||||
#define HASH_SIZE_LIMIT
|
||||
|
||||
/* USE_FAST_MATH is default */
|
||||
#define USE_FAST_MATH
|
||||
@@ -170,6 +211,7 @@
|
||||
/* #undef USE_FAST_MATH */
|
||||
/* #define SP_MATH */
|
||||
/* #define WOLFSSL_SP_MATH_ALL */
|
||||
/* #define WOLFSSL_SP_RISCV32 */
|
||||
|
||||
/***** Use Integer Heap Math *****/
|
||||
/* #undef USE_FAST_MATH */
|
||||
@@ -205,7 +247,7 @@
|
||||
#undef WOLFSSL_SYS_CA_CERTS
|
||||
*/
|
||||
|
||||
/*
|
||||
/* command-line options
|
||||
--enable-keygen
|
||||
--enable-certgen
|
||||
--enable-certreq
|
||||
@@ -213,10 +255,14 @@
|
||||
--enable-asn-template
|
||||
*/
|
||||
|
||||
/* Default is HW enabled unless turned off.
|
||||
** Uncomment these lines to force SW instead of HW acceleration */
|
||||
|
||||
/* Chipset detection from sdkconfig.h
|
||||
* Default is HW enabled unless turned off.
|
||||
* Uncomment lines to force SW instead of HW acceleration */
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
#define WOLFSSL_ESP32
|
||||
/* Alternatively, if there's an ECC Secure Element present: */
|
||||
/* #define WOLFSSL_ESPWROOM32SE */
|
||||
|
||||
/* wolfSSL HW Acceleration supported on ESP32. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -234,6 +280,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-S2. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -246,6 +293,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32S2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-S3. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -259,6 +307,7 @@
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C2) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP8684)
|
||||
#define WOLFSSL_ESP32
|
||||
/* ESP8684 is essentially ESP32-C2 chip + flash embedded together in a
|
||||
* single QFN 4x4 mm package. Out of released documentation, Technical
|
||||
* Reference Manual as well as ESP-IDF Programming Guide is applicable
|
||||
@@ -284,6 +333,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-C3. Uncomment to disable: */
|
||||
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
@@ -301,6 +351,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C3 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-C6. Uncomment to disable: */
|
||||
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
@@ -317,6 +368,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C6 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL Hardware Acceleration not yet implemented */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
@@ -325,21 +377,63 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32H2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
/* TODO: Revisit ESP8266 */
|
||||
#define WOLFSSL_ESP8266
|
||||
|
||||
/* There's no hardware encryption on the ESP8266 */
|
||||
/* Consider using the ESP32-C2/C3/C6
|
||||
* See https://www.espressif.com/en/products/socs/esp32-c2 */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI
|
||||
/***** END CONFIG_IDF_TARGET_ESP266 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP8684)
|
||||
/* There's no Hardware Acceleration available on ESP8684 */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI
|
||||
/***** END CONFIG_IDF_TARGET_ESP8684 *****/
|
||||
|
||||
#else
|
||||
/* Anything else encountered, disable HW accleration */
|
||||
#warning "Unexpected CONFIG_IDF_TARGET_NN value"
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI
|
||||
#endif /* CONFIG_IDF_TARGET Check */
|
||||
|
||||
/* RSA primitive specific definition, listed AFTER the Chipset detection */
|
||||
#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE)
|
||||
/* Consider USE_FAST_MATH and SMALL_STACK */
|
||||
|
||||
#ifndef NO_RSA
|
||||
#define ESP32_USE_RSA_PRIMITIVE
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
#ifdef CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
#if CONFIG_ESP_MAIN_TASK_STACK_SIZE < 10500
|
||||
#warning "RSA may be difficult with less than 10KB Stack "/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* NOTE HW unreliable for small values! */
|
||||
/* threshold for performance adjustment for HW primitive use */
|
||||
/* X bits of G^X mod P greater than */
|
||||
#undef ESP_RSA_EXPT_XBITS
|
||||
#define ESP_RSA_EXPT_XBITS 32
|
||||
|
||||
/* X and Y of X * Y mod P greater than */
|
||||
#undef ESP_RSA_MULM_BITS
|
||||
#define ESP_RSA_MULM_BITS 16
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Debug options:
|
||||
See wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h for details on debug options
|
||||
|
||||
#define ESP_VERIFY_MEMBLOCK
|
||||
#define DEBUG_WOLFSSL
|
||||
@@ -353,14 +447,26 @@
|
||||
#define WOLFSSL_ESP32_HW_LOCK_DEBUG
|
||||
#define WOLFSSL_DEBUG_ESP_RSA_MULM_BITS
|
||||
#define ESP_DISABLE_HW_TASK_LOCK
|
||||
|
||||
See wolfcrypt/benchmark/benchmark.c for debug and other settings:
|
||||
|
||||
Turn on benchmark timing debugging (CPU Cycles, RTOS ticks, etc)
|
||||
#define DEBUG_WOLFSSL_BENCHMARK_TIMING
|
||||
|
||||
Turn on timer debugging (used when CPU cycles not available)
|
||||
#define WOLFSSL_BENCHMARK_TIMER_DEBUG
|
||||
*/
|
||||
|
||||
#define WOLFSSL_ESPIDF_ERROR_PAUSE /* Pause in a loop rather than exit. */
|
||||
/* Pause in a loop rather than exit. */
|
||||
#define WOLFSSL_ESPIDF_ERROR_PAUSE
|
||||
|
||||
#define WOLFSSL_HW_METRICS
|
||||
|
||||
/* #define HASH_SIZE_LIMIT */ /* for test.c */
|
||||
/* for test.c */
|
||||
/* #define HASH_SIZE_LIMIT */
|
||||
|
||||
/* #define NO_HW_MATH_TEST */ /* Optionall turn off HW math checks */
|
||||
/* Optionally turn off HW math checks */
|
||||
/* #define NO_HW_MATH_TEST */
|
||||
|
||||
/* Optionally include alternate HW test library: alt_hw_test.h */
|
||||
/* When enabling, the ./components/wolfssl/CMakeLists.txt file
|
||||
@@ -383,8 +489,8 @@
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */
|
||||
|
||||
|
||||
#define WOLFSSL_PUBLIC_MP /* used by benchmark */
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
/* used by benchmark: */
|
||||
#define WOLFSSL_PUBLIC_MP
|
||||
|
||||
/* when turning on ECC508 / ECC608 support
|
||||
#define WOLFSSL_ESPWROOM32SE
|
||||
@@ -393,12 +499,75 @@
|
||||
#define ATCA_WOLFSSL
|
||||
*/
|
||||
|
||||
/* optional SM4 Ciphers. See https://github.com/wolfSSL/wolfsm
|
||||
/***************************** Certificate Macros *****************************
|
||||
*
|
||||
* The section below defines macros used in typically all of the wolfSSL
|
||||
* examples such as the client and server for certs stored in header files.
|
||||
*
|
||||
* There are various certificate examples in this header file:
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/certs_test.h
|
||||
*
|
||||
* To use the sets of macros below, define *one* of these:
|
||||
*
|
||||
* USE_CERT_BUFFERS_1024 - ECC 1024 bit encoded ASN1
|
||||
* USE_CERT_BUFFERS_2048 - RSA 2048 bit encoded ASN1
|
||||
* WOLFSSL_SM[2,3,4] - SM Ciphers
|
||||
*
|
||||
* For example: define USE_CERT_BUFFERS_2048 to use CA Certs used in this
|
||||
* wolfSSL function for the `ca_cert_der_2048` buffer, size and types:
|
||||
*
|
||||
* ret = wolfSSL_CTX_load_verify_buffer(ctx,
|
||||
* CTX_CA_CERT,
|
||||
* CTX_CA_CERT_SIZE,
|
||||
* CTX_CA_CERT_TYPE);
|
||||
*
|
||||
* See https://www.wolfssl.com/documentation/manuals/wolfssl/group__CertsKeys.html#function-wolfssl_ctx_load_verify_buffer
|
||||
*
|
||||
* In this case the CTX_CA_CERT will be defined as `ca_cert_der_2048` as
|
||||
* defined here: https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/certs_test.h
|
||||
*
|
||||
* The CTX_CA_CERT_SIZE and CTX_CA_CERT_TYPE are similarly used to reference
|
||||
* array size and cert type respectively.
|
||||
*
|
||||
* Similarly for loading the private client key:
|
||||
*
|
||||
* ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
|
||||
* CTX_CLIENT_KEY,
|
||||
* CTX_CLIENT_KEY_SIZE,
|
||||
* CTX_CLIENT_KEY_TYPE);
|
||||
*
|
||||
* see https://www.wolfssl.com/documentation/manuals/wolfssl/group__CertsKeys.html#function-wolfssl_ctx_use_privatekey_buffer
|
||||
*
|
||||
* Similarly, the other macros are for server certificates and keys:
|
||||
* `CTX_SERVER_CERT` and `CTX_SERVER_KEY` are available.
|
||||
*
|
||||
* The certificate and key names are typically `static const unsigned char`
|
||||
* arrays. The [NAME]_size are typically `sizeof([array name])`, and the types
|
||||
* are the known wolfSSL encoding type integers (e.g. WOLFSSL_FILETYPE_PEM).
|
||||
*
|
||||
* See `SSL_FILETYPE_[name]` in
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/ssl.h
|
||||
*
|
||||
* See Abstract Syntax Notation One (ASN.1) in:
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/wolfcrypt/asn.h
|
||||
*
|
||||
* Optional SM4 Ciphers:
|
||||
*
|
||||
* Although the SM ciphers are shown here, the `certs_test_sm.h` may not yet
|
||||
* be available. See:
|
||||
* https://github.com/wolfSSL/wolfssl/pull/6825
|
||||
* https://github.com/wolfSSL/wolfsm
|
||||
*
|
||||
* Uncomment these 3 macros to enable the SM Ciphers and use the macros below.
|
||||
*/
|
||||
|
||||
/*
|
||||
#define WOLFSSL_SM2
|
||||
#define WOLFSSL_SM3
|
||||
#define WOLFSSL_SM4
|
||||
*/
|
||||
|
||||
/* Conditional macros used in wolfSSL TLS client and server examples */
|
||||
#if defined(WOLFSSL_SM2) || defined(WOLFSSL_SM3) || defined(WOLFSSL_SM4)
|
||||
#include <wolfssl/certs_test_sm.h>
|
||||
#define CTX_CA_CERT root_sm2
|
||||
@@ -414,15 +583,49 @@
|
||||
#undef WOLFSSL_BASE16
|
||||
#define WOLFSSL_BASE16
|
||||
#else
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#define USE_CERT_BUFFERS_256
|
||||
#define CTX_CA_CERT ca_cert_der_2048
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_CERT server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_2048
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_2048
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#endif
|
||||
#if defined(USE_CERT_BUFFERS_2048)
|
||||
/* Be sure to include in app when using example certs: */
|
||||
/* #include <wolfssl/certs_test.h> */
|
||||
#define CTX_CA_CERT ca_cert_der_2048
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_SERVER_CERT server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_2048
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_2048
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_CLIENT_CERT client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_KEY client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#elif defined(USE_CERT_BUFFERS_1024)
|
||||
/* Be sure to include in app when using example certs: */
|
||||
/* #include <wolfssl/certs_test.h> */
|
||||
#define CTX_CA_CERT ca_cert_der_1024
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_1024
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_CLIENT_CERT client_cert_der_1024
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_cert_der_1024
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_KEY client_key_der_1024
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_key_der_1024
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_SERVER_CERT server_cert_der_1024
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_1024
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_1024
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_1024
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#else
|
||||
/* Optionally define custom cert arrays, sizes, and types here */
|
||||
#error "Must define USE_CERT_BUFFERS_2048 or USE_CERT_BUFFERS_1024"
|
||||
#endif
|
||||
#endif /* Conditional key and cert constant names */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* template main.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* main.c
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -22,8 +22,23 @@
|
||||
/* Espressif */
|
||||
#include <esp_log.h>
|
||||
|
||||
/* wolfSSL */
|
||||
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
|
||||
/* wolfSSL */
|
||||
/* Always include wolfcrypt/settings.h before any other wolfSSL file. */
|
||||
/* Reminder: settings.h pulls in user_settings.h; don't include it here. */
|
||||
#ifdef WOLFSSL_USER_SETTINGS
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#ifndef WOLFSSL_ESPIDF
|
||||
#warning "Problem with wolfSSL user_settings."
|
||||
#warning "Check components/wolfssl/include"
|
||||
#endif
|
||||
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
|
||||
#else
|
||||
/* Define WOLFSSL_USER_SETTINGS project wide for settings.h to include */
|
||||
/* wolfSSL user settings in ./components/wolfssl/include/user_settings.h */
|
||||
#error "Missing WOLFSSL_USER_SETTINGS in CMakeLists or Makefile:\
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS"
|
||||
#endif
|
||||
|
||||
|
||||
/* project */
|
||||
#include "main.h"
|
||||
@@ -32,18 +47,32 @@ static const char* const TAG = "My Project";
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
#ifdef WOLFSSL_ESPIDF_VERBOSE_EXIT_MESSAGE
|
||||
int ret = 0;
|
||||
#endif
|
||||
ESP_LOGI(TAG, "Hello wolfSSL!");
|
||||
|
||||
#ifdef HAVE_VERSION_EXTENDED_INFO
|
||||
esp_ShowExtendedSystemInfo();
|
||||
ret = esp_ShowExtendedSystemInfo();
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_HW_METRICS) && defined(WOLFSSL_HAS_METRICS)
|
||||
esp_hw_show_metrics();
|
||||
ret += esp_hw_show_metrics();
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_ESPIDF_VERBOSE_EXIT_MESSAGE
|
||||
if (ret == 0) {
|
||||
ESP_LOGI(TAG, WOLFSSL_ESPIDF_VERBOSE_EXIT_MESSAGE("Success!", ret));
|
||||
}
|
||||
else {
|
||||
ESP_LOGE(TAG, WOLFSSL_ESPIDF_VERBOSE_EXIT_MESSAGE("Failed!", ret));
|
||||
}
|
||||
#elif defined(WOLFSSL_ESPIDF_EXIT_MESSAGE)
|
||||
ESP_LOGI(TAG, WOLFSSL_ESPIDF_EXIT_MESSAGE);
|
||||
#else
|
||||
ESP_LOGI(TAG, "\n\nDone!"
|
||||
"If running from idf.py monitor, press twice: Ctrl+]\n\n"
|
||||
"WOLFSSL_COMPLETE\n" /* exit keyword for wolfssl_monitor.py */
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
add_compile_options(-DWOLFSSL_ESP_NO_WATCHDOG=1)
|
||||
# The wolfSSL CMake file should be able to find the source code.
|
||||
# Otherwise, assign an environment variable or set it here:
|
||||
#
|
||||
@@ -21,13 +22,20 @@ cmake_minimum_required(VERSION 3.16)
|
||||
#
|
||||
|
||||
# Optionally specify a location for wolfSSL component source code
|
||||
# set(WOLFSSL_ROOT "c:/test/blogtest/wolfssl" )
|
||||
# set(WOLFSSL_ROOT "c:/mydir/wolfssl" )
|
||||
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
|
||||
# set (PROTOCOL_EXAMPLES_DIR $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
#
|
||||
#if (EXISTS "${PROTOCOL_EXAMPLES_DIR}")
|
||||
# message("Found PROTOCOL_EXAMPLES_DIR=${PROTOCOL_EXAMPLES_DIR}")
|
||||
# set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFOUND_PROTOCOL_EXAMPLES_DIR")
|
||||
#else()
|
||||
# message("NOT FOUND: PROTOCOL_EXAMPLES_DIR=${PROTOCOL_EXAMPLES_DIR}")
|
||||
#endif()
|
||||
|
||||
# Not only is a project-level "set(COMPONENTS" not needed here, this will cause
|
||||
# an unintuitive error about Unknown CMake command "esptool_py_flash_project_args".
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
set(COMPONENTS
|
||||
main
|
||||
wolfssl
|
||||
) # set components
|
||||
|
||||
project(wolfssl_benchmark)
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
# project subdirectory.
|
||||
#
|
||||
|
||||
PROJECT_NAME := wolfssl_benchmark
|
||||
|
||||
CFLAGS += -DWOLFSSL_USER_SETTINGS
|
||||
# Some of the tests are CPU intenstive, so we'll force the watchdog timer off.
|
||||
# There's an espressif NO_WATCHDOG; we don't use it, as it is reset by sdkconfig.
|
||||
EXTRA_CFLAGS += -DWOLFSSL_ESP_NO_WATCHDOG
|
||||
|
||||
PROJECT_NAME := wolfssl_benchmark
|
||||
include $(IDF_PATH)/make/project.mk
|
||||
|
||||
|
||||
@@ -19,6 +19,13 @@ other local port to `COM20` as needed:
|
||||
change port com20=com23
|
||||
```
|
||||
|
||||
## Bulk Testing
|
||||
|
||||
If you have a test jig with multiple ESP32 devices and you'd like to run this wolfcrypt benchmark on all of them, check out
|
||||
the `testAll.sh` and `testMonitor.sh` scripts in the [../wolfssl_test](../wolfssl_test/README.md) directory. Copy those
|
||||
bash script files to this project. See the `esp32[NN]_PORT` and `esp32[NN]_PUTTY` settings in `testMonitor.sh` that will
|
||||
be machine-specific.
|
||||
|
||||
## VisualGDB
|
||||
|
||||
Open the VisualGDB Visual Studio Project file in the VisualGDB directory and click the "Start" button.
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
<ToolchainID>
|
||||
<ID>com.visualgdb.xtensa-esp32-elf</ID>
|
||||
<Version>
|
||||
<GCC>11.2.0</GCC>
|
||||
<GDB>9.2.90</GDB>
|
||||
<Revision>2</Revision>
|
||||
<GCC>13.2.0</GCC>
|
||||
<GDB>12.1</GDB>
|
||||
<Revision>1</Revision>
|
||||
</Version>
|
||||
</ToolchainID>
|
||||
<RelativeSourceDirectory>..</RelativeSourceDirectory>
|
||||
@@ -67,8 +67,8 @@
|
||||
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
|
||||
<ESPIDFExtension>
|
||||
<IDFCheckout>
|
||||
<Version>release/v5.0</Version>
|
||||
<Subdirectory>esp-idf/v5.0</Subdirectory>
|
||||
<Version>release/v5.2</Version>
|
||||
<Subdirectory>esp-idf/v5.2</Subdirectory>
|
||||
<Type>ESPIDF</Type>
|
||||
</IDFCheckout>
|
||||
<COMPort>COM20</COMPort>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
# Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
@@ -19,16 +19,95 @@
|
||||
#
|
||||
# cmake for wolfssl Espressif projects
|
||||
#
|
||||
# Version 5.6.0.011 for detect test/benchmark
|
||||
# Version 5.7.0 template update + THIS_IDF_PATH
|
||||
#
|
||||
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(VERBOSE_COMPONENT_MESSAGES 1)
|
||||
|
||||
# The scope of this CMAKE_C_FLAGS is just this component:
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
|
||||
|
||||
set(CMAKE_CURRENT_SOURCE_DIR ".")
|
||||
set(COMPONENT_REQUIRES lwip) # we typically don't need lwip directly in wolfssl component
|
||||
set(WOLFSSL_ROOT "$ENV{WOLFSSL_ROOT}" )
|
||||
# set(COMPONENT_REQUIRES lwip) # we typically don't need lwip directly in wolfssl component
|
||||
|
||||
# Optionally set your source to wolfSSL in your project CMakeLists.txt like this:
|
||||
# set(WOLFSSL_ROOT "c:/test/my_wolfssl" )
|
||||
|
||||
if ( "${WOLFSSL_ROOT}" STREQUAL "")
|
||||
set(WOLFSSL_ROOT "$ENV{WOLFSSL_ROOT}" )
|
||||
endif()
|
||||
|
||||
if( "$ENV{IDF_PATH}" STREQUAL "" )
|
||||
message(FATAL_ERROR "IDF_PATH Environment variable not set!")
|
||||
else()
|
||||
string(REPLACE "\\" "/" THIS_IDF_PATH "$ENV{IDF_PATH}")
|
||||
endif()
|
||||
|
||||
# Optional compiler definitions to help with system name detection (typically printed by app diagnostics)
|
||||
if(VERBOSE_COMPONENT_MESSAGES)
|
||||
if(WIN32)
|
||||
# Windows-specific configuration here
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_CMAKE_SYSTEM_NAME_WINDOWS")
|
||||
message("Detected Windows")
|
||||
endif()
|
||||
if(CMAKE_HOST_UNIX)
|
||||
message("Detected UNIX")
|
||||
endif()
|
||||
if(APPLE)
|
||||
message("Detected APPLE")
|
||||
endif()
|
||||
if(CMAKE_HOST_UNIX AND (NOT APPLE) AND EXISTS "/proc/sys/fs/binfmt_misc/WSLInterop")
|
||||
# Windows-specific configuration here
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_CMAKE_SYSTEM_NAME_WSL")
|
||||
message("Detected WSL")
|
||||
endif()
|
||||
if(CMAKE_HOST_UNIX AND (NOT APPLE) AND (NOT WIN32))
|
||||
# Windows-specific configuration here
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_CMAKE_SYSTEM_NAME_LINUX")
|
||||
message("Detected Linux")
|
||||
endif()
|
||||
if(APPLE)
|
||||
# Windows-specific configuration here
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_CMAKE_SYSTEM_NAME_APPLE")
|
||||
message("Detected Apple")
|
||||
endif()
|
||||
endif() # End optional WOLFSSL_CMAKE_SYSTEM_NAME
|
||||
|
||||
message(STATUS "CONFIG_TARGET_PLATFORM = ${CONFIG_TARGET_PLATFORM}")
|
||||
|
||||
# Check that there are not conflicting wolfSSL components
|
||||
# The ESP Registry Component will be in ./managed_components/wolfssl__wolfssl
|
||||
# The local component wolfSSL directory will be in ./components/wolfssl
|
||||
if( EXISTS "${CMAKE_HOME_DIRECTORY}/managed_components/wolfssl__wolfssl" AND EXISTS "${CMAKE_HOME_DIRECTORY}/components/wolfssl" )
|
||||
# These exclude statements don't seem to be honored by the $ENV{IDF_PATH}/tools/cmake/project.cmake'
|
||||
# add_subdirectory("${CMAKE_HOME_DIRECTORY}/managed_components/wolfssl__wolfssl" EXCLUDE_FROM_ALL)
|
||||
# add_subdirectory("${CMAKE_HOME_DIRECTORY}/managed_components/wolfssl__wolfssl/include" EXCLUDE_FROM_ALL)
|
||||
# So we'll error out and let the user decide how to proceed:
|
||||
message(WARNING "\nFound wolfSSL components in\n"
|
||||
"./managed_components/wolfssl__wolfssl\n"
|
||||
"and\n"
|
||||
"./components/wolfssl\n"
|
||||
"in project directory: \n"
|
||||
"${CMAKE_HOME_DIRECTORY}")
|
||||
message(FATAL_ERROR "\nPlease use either the ESP Registry Managed Component or the wolfSSL component directory but not both.\n"
|
||||
"If removing the ./managed_components/wolfssl__wolfssl directory, remember to also remove "
|
||||
"or rename the idf_component.yml file typically found in ./main/")
|
||||
else()
|
||||
message(STATUS "No conflicting wolfSSL components found.")
|
||||
endif()
|
||||
|
||||
|
||||
# Don't include lwip requirement for benchmark and test apps.
|
||||
if( ("${CMAKE_PROJECT_NAME}" STREQUAL "wolfssl_benchmark") OR ("${CMAKE_PROJECT_NAME}" STREQUAL "wolfssl_test") )
|
||||
message(STATUS "Not including lwip for ${CMAKE_PROJECT_NAME}")
|
||||
else()
|
||||
# benchmark and test do not need wifi, everything else probably does:
|
||||
set(COMPONENT_REQUIRES lwip) # we typically don't need lwip directly in wolfssl component
|
||||
endif()
|
||||
|
||||
# find the user name to search for possible "wolfssl-username"
|
||||
message(STATUS "USERNAME = $ENV{USERNAME}")
|
||||
@@ -45,6 +124,11 @@ else()
|
||||
endif()
|
||||
message(STATUS "THIS_USER = ${THIS_USER}")
|
||||
|
||||
if( "$ENV{IDF_PATH}" STREQUAL "" )
|
||||
message(FATAL_ERROR "IDF_PATH Environment variable not set!")
|
||||
else()
|
||||
string(REPLACE "\\" "/" THIS_IDF_PATH "$ENV{IDF_PATH}")
|
||||
endif()
|
||||
|
||||
# COMPONENT_NAME = wolfssl
|
||||
# The component name is the directory name. "No feature to change this".
|
||||
@@ -71,25 +155,41 @@ function(IS_WOLFSSL_SOURCE DIRECTORY_PARAMETER RESULT)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# *********************************************************************************************
|
||||
# function: FIND_WOLFSSL_DIRECTORY
|
||||
# parameter: OUTPUT_FOUND_WOLFSSL_DIRECTORY contains root of source code, otherwise blank
|
||||
#
|
||||
# Example usage:
|
||||
# FIND_WOLFSSL_DIRECTORY(WOLFSSL_ROOT)
|
||||
# *********************************************************************************************
|
||||
function(FIND_WOLFSSL_DIRECTORY OUTPUT_FOUND_WOLFSSL_DIRECTORY)
|
||||
message(STATUS "Starting FIND_WOLFSSL_DIRECTORY")
|
||||
set(CURRENT_SEARCH_DIR "$ENV{WOLFSSL_ROOT}")
|
||||
if( "${CURRENT_SEARCH_DIR}" STREQUAL "" )
|
||||
message(STATUS "The WOLFSSL_ROOT environment variable is not set. Searching...")
|
||||
else()
|
||||
get_filename_component(CURRENT_SEARCH_DIR "$ENV{WOLFSSL_ROOT}" ABSOLUTE)
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR}" FOUND_WOLFSSL)
|
||||
if("${FOUND_WOLFSSL}")
|
||||
message(STATUS "Found WOLFSSL_ROOT via Environment Variable:")
|
||||
message(STATUS "Starting FIND_WOLFSSL_DIRECTORY: ${${OUTPUT_FOUND_WOLFSSL_DIRECTORY}}")
|
||||
|
||||
if ( "${${OUTPUT_FOUND_WOLFSSL_DIRECTORY}}" STREQUAL "" )
|
||||
set(CURRENT_SEARCH_DIR "$ENV{WOLFSSL_ROOT}")
|
||||
if( "${CURRENT_SEARCH_DIR}" STREQUAL "" )
|
||||
message(STATUS "The WOLFSSL_ROOT environment variable is not set. Searching...")
|
||||
else()
|
||||
message(FATAL_ERROR "WOLFSSL_ROOT Environment Variable defined, but path not found:")
|
||||
message(STATUS "$ENV{WOLFSSL_ROOT}")
|
||||
get_filename_component(CURRENT_SEARCH_DIR "$ENV{WOLFSSL_ROOT}" ABSOLUTE)
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR}" FOUND_WOLFSSL)
|
||||
if( FOUND_WOLFSSL )
|
||||
message(STATUS "Found WOLFSSL_ROOT via Environment Variable:")
|
||||
else()
|
||||
message(FATAL_ERROR "WOLFSSL_ROOT Environment Variable defined, but path not found:")
|
||||
message(STATUS "$ENV{WOLFSSL_ROOT}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
get_filename_component(CURRENT_SEARCH_DIR "${${OUTPUT_FOUND_WOLFSSL_DIRECTORY}}" ABSOLUTE)
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR}" FOUND_WOLFSSL)
|
||||
if( FOUND_WOLFSSL )
|
||||
message(STATUS "Found WOLFSSL_ROOT via prior specification.")
|
||||
else()
|
||||
message(FATAL_ERROR "WOLFSSL_ROOT Variable defined, but path not found: ${${OUTPUT_FOUND_WOLFSSL_DIRECTORY}}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# we'll start in the CMAKE_CURRENT_SOURCE_DIR, typically [something]/projectname/components/wolfssl
|
||||
message(STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
get_filename_component(CURRENT_SEARCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
|
||||
@@ -107,16 +207,47 @@ function(FIND_WOLFSSL_DIRECTORY OUTPUT_FOUND_WOLFSSL_DIRECTORY)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Maintain CURRENT_SEARCH_DIR, but check various suffixes with CURRENT_SEARCH_DIR_ALT
|
||||
if( THIS_USER )
|
||||
# Check for "wolfssl-[username]" subdirectory as we recurse up the directory tree
|
||||
set(CURRENT_SEARCH_DIR_ALT ${CURRENT_SEARCH_DIR}/wolfssl-${THIS_USER})
|
||||
message(STATUS "Looking in ${CURRENT_SEARCH_DIR}")
|
||||
message(STATUS "Looking in ${CURRENT_SEARCH_DIR_ALT}")
|
||||
|
||||
#if(EXISTS ${CURRENT_SEARCH_DIR_ALT} AND IS_DIRECTORY ${CURRENT_SEARCH_DIR_ALT} AND EXISTS "${CURRENT_SEARCH_DIR_ALT}/wolfcrypt/src")
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR_ALT}" FOUND_WOLFSSL )
|
||||
if ( FOUND_WOLFSSL )
|
||||
message(STATUS "Found wolfssl in user-suffix CURRENT_SEARCH_DIR_ALT = ${CURRENT_SEARCH_DIR_ALT}")
|
||||
set(${OUTPUT_FOUND_WOLFSSL_DIRECTORY} ${CURRENT_SEARCH_DIR_ALT} PARENT_SCOPE)
|
||||
message(STATUS "Found wolfssl in user-suffix CURRENT_SEARCH_DIR_ALT = ${CURRENT_SEARCH_DIR_ALT}")
|
||||
set(CURRENT_SEARCH_DIR "${CURRENT_SEARCH_DIR_ALT}")
|
||||
set(${OUTPUT_FOUND_WOLFSSL_DIRECTORY} ${CURRENT_SEARCH_DIR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( FOUND_WOLFSSL )
|
||||
# if we already found the source, skip attempt of "wolfssl-master"
|
||||
else()
|
||||
set(CURRENT_SEARCH_DIR_ALT ${CURRENT_SEARCH_DIR}/wolfssl-master)
|
||||
message(STATUS "Looking in ${CURRENT_SEARCH_DIR_ALT}")
|
||||
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR_ALT}" FOUND_WOLFSSL )
|
||||
if ( FOUND_WOLFSSL )
|
||||
message(STATUS "Found wolfssl in master-suffix CURRENT_SEARCH_DIR_ALT = ${CURRENT_SEARCH_DIR_ALT}")
|
||||
set(CURRENT_SEARCH_DIR "${CURRENT_SEARCH_DIR_ALT}")
|
||||
set(${OUTPUT_FOUND_WOLFSSL_DIRECTORY} ${CURRENT_SEARCH_DIR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( FOUND_WOLFSSL )
|
||||
# if we already found the source, skip attempt of "wolfssl"
|
||||
else()
|
||||
set(CURRENT_SEARCH_DIR_ALT ${CURRENT_SEARCH_DIR}/wolfssl)
|
||||
message(STATUS "Looking in ${CURRENT_SEARCH_DIR_ALT}")
|
||||
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR_ALT}" FOUND_WOLFSSL )
|
||||
if ( FOUND_WOLFSSL )
|
||||
message(STATUS "Found wolfssl in CURRENT_SEARCH_DIR_ALT = ${CURRENT_SEARCH_DIR_ALT}")
|
||||
set(CURRENT_SEARCH_DIR "${CURRENT_SEARCH_DIR_ALT}")
|
||||
set(${OUTPUT_FOUND_WOLFSSL_DIRECTORY} ${CURRENT_SEARCH_DIR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
@@ -136,7 +267,8 @@ function(FIND_WOLFSSL_DIRECTORY OUTPUT_FOUND_WOLFSSL_DIRECTORY)
|
||||
get_filename_component(CURRENT_SEARCH_DIR "${CURRENT_SEARCH_DIR}" DIRECTORY)
|
||||
message(STATUS "Next CURRENT_SEARCH_DIR = ${CURRENT_SEARCH_DIR}")
|
||||
if( "${PRIOR_SEARCH_DIR}" STREQUAL "${CURRENT_SEARCH_DIR}" )
|
||||
# when the search directory is empty, we'll give up
|
||||
# When the parent is current directory, cannot go any further. We didn't find wolfssl.
|
||||
# When the search directory is empty, we'll give up.
|
||||
set(CURRENT_SEARCH_DIR "")
|
||||
endif()
|
||||
endwhile()
|
||||
@@ -147,17 +279,47 @@ endfunction()
|
||||
|
||||
|
||||
# Example usage:
|
||||
#
|
||||
# Simply find the WOLFSSL_DIRECTORY by searching parent directories:
|
||||
# FIND_WOLFSSL_DIRECTORY(WOLFSSL_ROOT)
|
||||
#
|
||||
|
||||
message(STATUS "CONFIG_TARGET_PLATFORM = ${CONFIG_TARGET_PLATFORM}")
|
||||
|
||||
if (0)
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
list (SORT _variableNames)
|
||||
message(STATUS "")
|
||||
message(STATUS "ALL VARIABLES BEGIN")
|
||||
message(STATUS "")
|
||||
foreach (_variableName ${_variableNames})
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
endforeach()
|
||||
message(STATUS "")
|
||||
message(STATUS "ALL VARIABLES END")
|
||||
message(STATUS "")
|
||||
endif()
|
||||
|
||||
if ( ("${CONFIG_TARGET_PLATFORM}" STREQUAL "esp8266") OR ("${IDF_TARGET}" STREQUAL "esp8266") )
|
||||
# There's no esp_timer, no driver components for the ESP8266
|
||||
message(STATUS "Early expansion EXCLUDES esp_timer: ${THIS_INCLUDE_TIMER}")
|
||||
message(STATUS "Early expansion EXCLUDES driver: ${THIS_INCLUDE_DRIVER}")
|
||||
set(THIS_INCLUDE_TIMER "")
|
||||
set(THIS_INCLUDE_DRIVER "")
|
||||
else()
|
||||
message(STATUS "Early expansion includes esp_timer: ${THIS_INCLUDE_TIMER}")
|
||||
message(STATUS "Early expansion includes driver: ${THIS_INCLUDE_DRIVER}")
|
||||
set(THIS_INCLUDE_TIMER "esp_timer")
|
||||
set(THIS_INCLUDE_DRIVER "driver")
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_EARLY_EXPANSION)
|
||||
message(STATUS "wolfssl component CMAKE_BUILD_EARLY_EXPANSION:")
|
||||
idf_component_register(
|
||||
REQUIRES "${COMPONENT_REQUIRES}"
|
||||
PRIV_REQUIRES # esp_hw_support
|
||||
esp_timer
|
||||
driver # this will typically only be needed for wolfSSL benchmark
|
||||
${THIS_INCLUDE_TIMER}
|
||||
${THIS_INCLUDE_DRIVER} # this will typically only be needed for wolfSSL benchmark
|
||||
)
|
||||
|
||||
else()
|
||||
@@ -169,24 +331,52 @@ else()
|
||||
# search for wolfSSL
|
||||
FIND_WOLFSSL_DIRECTORY(WOLFSSL_ROOT)
|
||||
if(WOLFSSL_ROOT)
|
||||
message(STATUS "NEW Found wolfssl directory at: ${WOLFSSL_ROOT}")
|
||||
IS_WOLFSSL_SOURCE("${WOLFSSL_ROOT}" FOUND_WOLFSSL)
|
||||
if(FOUND_WOLFSSL)
|
||||
message(STATUS "Found WOLFSSL_ROOT via CMake specification.")
|
||||
else()
|
||||
# WOLFSSL_ROOT Path specified in CMakeLists.txt is not a valid path
|
||||
message(FATAL_ERROR "WOLFSSL_ROOT CMake Variable defined, but path not found: ${WOLFSSL_ROOT}\n"
|
||||
"Try correcting WOLFSSL_ROOT in your project CMakeFile.txt or setting environment variable.")
|
||||
# Abort CMake after fatal error.
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "NEW wolfssl directory not found.")
|
||||
message(STATUS "Searching for wolfSL source code...")
|
||||
FIND_WOLFSSL_DIRECTORY(WOLFSSL_ROOT)
|
||||
endif()
|
||||
|
||||
|
||||
if(WOLFSSL_ROOT)
|
||||
message(STATUS "Confirmed wolfssl directory at: ${WOLFSSL_ROOT}")
|
||||
else()
|
||||
message(STATUS "Failed: wolfssl directory not found.")
|
||||
# Abort. We need wolfssl _somewhere_.
|
||||
message(FATAL_ERROR "Could not find wolfssl in ${WOLFSSL_ROOT}.\n"
|
||||
"Try setting WOLFSSL_ROOT environment variable or git clone.")
|
||||
message(FATAL_ERROR "Could not find wolfssl in any parent directory named wolfssl-${THIS_USER}, wolfssl-master, or wolfssl.\n"
|
||||
"Try setting WOLFSSL_ROOT environment variable, cmake variable in project, copy source, or use managed components.")
|
||||
# Abort CMake after fatal error.
|
||||
endif()
|
||||
|
||||
set(INCLUDE_PATH ${WOLFSSL_ROOT})
|
||||
|
||||
set(WOLFSSL_EXTRA_PROJECT_DIR "${WOLFSSL_ROOT}/src/")
|
||||
|
||||
if( ${CMAKE_PROJECT_NAME} STREQUAL "wolfssl_benchmark" )
|
||||
set(WOLFSSL_EXTRA_PROJECT_DIR "${WOLFSSL_ROOT}/wolfcrypt/benchmark")
|
||||
endif()
|
||||
# During regression tests, optionally copy source locally and use: set(USE_LOCAL_TEST_BENCH 1)
|
||||
set(USE_LOCAL_TEST_BENCH 0)
|
||||
if(NOT USE_LOCAL_TEST_BENCH)
|
||||
if( "${CMAKE_PROJECT_NAME}" STREQUAL "hello-world" )
|
||||
message(STATUS "Include ${WOLFSSL_ROOT}/wolfcrypt/benchmark")
|
||||
set(WOLFSSL_EXTRA_PROJECT_DIR "${WOLFSSL_ROOT}/wolfcrypt/benchmark")
|
||||
endif()
|
||||
|
||||
if( ${CMAKE_PROJECT_NAME} STREQUAL "wolfssl_test" )
|
||||
set(WOLFSSL_EXTRA_PROJECT_DIR "${WOLFSSL_ROOT}/wolfcrypt/test")
|
||||
if( "${CMAKE_PROJECT_NAME}" STREQUAL "wolfssl_benchmark" )
|
||||
message(STATUS "Include ${WOLFSSL_ROOT}/wolfcrypt/benchmark")
|
||||
set(WOLFSSL_EXTRA_PROJECT_DIR "${WOLFSSL_ROOT}/wolfcrypt/benchmark")
|
||||
endif()
|
||||
|
||||
if( "${CMAKE_PROJECT_NAME}" STREQUAL "wolfssl_test" )
|
||||
message(STATUS "Include ${WOLFSSL_ROOT}/wolfcrypt/test")
|
||||
set(WOLFSSL_EXTRA_PROJECT_DIR "${WOLFSSL_ROOT}/wolfcrypt/test")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(COMPONENT_SRCDIRS "\"${WOLFSSL_ROOT}/src/\""
|
||||
@@ -198,16 +388,19 @@ else()
|
||||
|
||||
message(STATUS "This COMPONENT_SRCDIRS = ${COMPONENT_SRCDIRS}")
|
||||
|
||||
# wolfSSL user_settings.h is in the local project.
|
||||
set(WOLFSSL_PROJECT_DIR "${CMAKE_HOME_DIRECTORY}/components/wolfssl")
|
||||
add_definitions(-DWOLFSSL_USER_SETTINGS_DIR="${WOLFSSL_PROJECT_DIR}/include/user_settings.h")
|
||||
# add_definitions(-DWOLFSSL_USER_SETTINGS_DIR="${WOLFSSL_PROJECT_DIR}/include/user_settings.h")
|
||||
|
||||
string(REPLACE "/" "//" STR_WOLFSSL_PROJECT_DIR "${WOLFSSL_PROJECT_DIR}")
|
||||
add_definitions(-DWOLFSSL_USER_SETTINGS_DIR="${STR_WOLFSSL_PROJECT_DIR}//include//user_settings.h")
|
||||
|
||||
# Espressif may take several passes through this makefile. Check to see if we found IDF
|
||||
string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "" WOLFSSL_FOUND_IDF)
|
||||
|
||||
# get a list of all wolfcrypt assembly files; we'll exclude them as they don't target Xtensa
|
||||
file(GLOB EXCLUDE_ASM *.S)
|
||||
file(GLOB_RECURSE EXCLUDE_ASM ${CMAKE_SOURCE_DIR} "${WOLFSSL_ROOT}/wolfcrypt/src/*.S")
|
||||
file(GLOB EXCLUDE_ASM ${CMAKE_SOURCE_DIR} "${WOLFSSL_ROOT}/wolfcrypt/src/*.S")
|
||||
|
||||
message(STATUS "IDF_PATH = $ENV{IDF_PATH}")
|
||||
message(STATUS "PROJECT_SOURCE_DIR = ${PROJECT_SOURCE_DIR}")
|
||||
@@ -230,11 +423,13 @@ else()
|
||||
message(STATUS "Remove either the local project component: ${WOLFSSL_PROJECT_DIR} ")
|
||||
message(STATUS "or the Espressif shared component installed at: $ENV{IDF_PATH}/components/wolfssl/ ")
|
||||
message(STATUS "")
|
||||
message(FATAL_ERROR "Please use wolfSSL in either local project or Espressif components, but not both.")
|
||||
message(STATUS "")
|
||||
message(STATUS "**************************************************************************************")
|
||||
message(STATUS "")
|
||||
|
||||
message(FATAL_ERROR "Please use wolfSSL in either local project or Espressif components, but not both.")
|
||||
# Abort CMake after fatal error.
|
||||
|
||||
# Optional: if you change the above FATAL_ERROR to STATUS you can warn at runtime with this macro definition:
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_MULTI_INSTALL_WARNING")
|
||||
|
||||
@@ -284,6 +479,7 @@ else()
|
||||
message(FATAL_ERROR "Found stray wolfSSL user_settings.h in "
|
||||
"${WOLFSSL_ROOT}/include/user_settings.h "
|
||||
" (please move it to ${WOLFSSL_PROJECT_DIR}/include/user_settings.h )")
|
||||
# Abort CMake after fatal error.
|
||||
else()
|
||||
# we won't overwrite an existing user settings file, just note that we already have one:
|
||||
if( EXISTS "${WOLFSSL_PROJECT_DIR}/include/user_settings.h" )
|
||||
@@ -353,17 +549,22 @@ else()
|
||||
message(STATUS "Could not find RTOS path")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
message(STATUS "THIS_IDF_PATH = $THIS_IDF_PATH")
|
||||
# wolfSSL-specific include directories
|
||||
set(COMPONENT_ADD_INCLUDEDIRS
|
||||
"./include" # this is the location of wolfssl user_settings.h
|
||||
"\"${WOLFSSL_ROOT}/\""
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/\""
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/\""
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/port/Espressif\""
|
||||
"\"${RTOS_IDF_PATH}/\""
|
||||
# wolfSSL release after v5.7 includes WiFi, time, and mem/debug helpers
|
||||
"${THIS_IDF_PATH}/components/esp_event/include"
|
||||
"${THIS_IDF_PATH}/components/esp_netif/include"
|
||||
"${THIS_IDF_PATH}/components/esp_wifi/include"
|
||||
)
|
||||
|
||||
|
||||
# Optionally include cryptoauthlib if present
|
||||
if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib)
|
||||
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib")
|
||||
endif()
|
||||
@@ -372,7 +573,7 @@ else()
|
||||
list(APPEND COMPONENT_ADD_INCLUDEDIRS "\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/\"")
|
||||
|
||||
|
||||
|
||||
# Some files are known to be included elsewhere, or not used for Espressif
|
||||
set(COMPONENT_SRCEXCLUDE
|
||||
"\"${WOLFSSL_ROOT}/src/bio.c\""
|
||||
"\"${WOLFSSL_ROOT}/src/conf.c\""
|
||||
@@ -382,9 +583,14 @@ else()
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_bn.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_certman.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_crypto.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_load.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_misc.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_p7p12.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_sess.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/x509.c\""
|
||||
"\"${WOLFSSL_ROOT}/src/x509_str.c\""
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/ext_kyber.c\"" # external non-wolfssl Kyber disabled by default
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/ext_kyber.h\"" # external non-wolfssl Kyber disabled by default
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/evp.c\""
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/misc.c\""
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/sp_sm2_arm32.c\""
|
||||
@@ -421,17 +627,34 @@ else()
|
||||
INCLUDE_DIRS "${COMPONENT_ADD_INCLUDEDIRS}"
|
||||
REQUIRES "${COMPONENT_REQUIRES}"
|
||||
EXCLUDE_SRCS "${COMPONENT_SRCEXCLUDE}"
|
||||
PRIV_REQUIRES esp_timer driver # this will typically only be needed for wolfSSL benchmark
|
||||
PRIV_REQUIRES
|
||||
"${THIS_INCLUDE_TIMER}"
|
||||
"${THIS_INCLUDE_DRIVER}" # this will typically only be needed for wolfSSL benchmark
|
||||
)
|
||||
# some optional diagnostics
|
||||
if (1)
|
||||
|
||||
# Some optional diagnostics. Verbose ones are truncated.
|
||||
if (VERBOSE_COMPONENT_MESSAGES)
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
list (SORT _variableNames)
|
||||
message(STATUS "")
|
||||
message(STATUS "ALL VARIABLES BEGIN")
|
||||
message(STATUS "")
|
||||
foreach (_variableName ${_variableNames})
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
if ( ("${_variableName}" STREQUAL "bootloader_binary_files")
|
||||
OR ("${_variableName}" STREQUAL "Component paths")
|
||||
OR ("${_variableName}" STREQUAL "component_targets")
|
||||
OR ("${_variableName}" STREQUAL "__COMPONENT_TARGETS")
|
||||
OR ("${_variableName}" STREQUAL "CONFIGS_LIST")
|
||||
OR ("${_variableName}" STREQUAL "__CONFIG_VARIABLES")
|
||||
OR ("${_variableName}" STREQUAL "val")
|
||||
OR ("${_variableName}" MATCHES "^__idf_")
|
||||
)
|
||||
# Truncate the displayed value:
|
||||
string(SUBSTRING "${${_variableName}}" 0 70 truncatedValue)
|
||||
message(STATUS "${_variableName} = ${truncatedValue} ... (truncated)")
|
||||
else()
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
endif()
|
||||
endforeach()
|
||||
message(STATUS "")
|
||||
message(STATUS "ALL VARIABLES END")
|
||||
@@ -518,6 +741,8 @@ if(NOT CMAKE_BUILD_EARLY_EXPANSION)
|
||||
execute_process(WORKING_DIRECTORY ${WOLFSSL_ROOT} COMMAND ${git_cmd} "show" "--no-patch" "--no-notes" "--pretty=\'\%cd\'" OUTPUT_VARIABLE TMP_OUT RESULT_VARIABLE TMP_RES )
|
||||
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_GIT_HASH_DATE "${TMP_OUT}" "${TMP_RES}")
|
||||
|
||||
LIBWOLFSSL_SAVE_INFO(LIBWOLFSSL_VERSION_WOLFSSL_ROOT "${WOLFSSL_ROOT}" "${TMP_RES}")
|
||||
|
||||
message(STATUS "************************************************************************************************")
|
||||
message(STATUS "wolfssl component config complete!")
|
||||
message(STATUS "************************************************************************************************")
|
||||
|
||||
@@ -1,40 +1,240 @@
|
||||
#
|
||||
# Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
# wolfSSL is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# wolfSSL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
#
|
||||
#
|
||||
# Component Makefile
|
||||
#
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS := . ./include
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/components/freertos/include/freertos"
|
||||
# COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/soc/esp32s3/include/soc"
|
||||
|
||||
COMPONENT_SRCDIRS := src wolfcrypt/src
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
|
||||
COMPONENT_SRCDIRS += wolfcrypt/benchmark
|
||||
COMPONENT_SRCDIRS += wolfcrypt/test
|
||||
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
||||
|
||||
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJEXCLUDE += src/bio.o
|
||||
#
|
||||
# Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
# wolfSSL is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# wolfSSL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
#
|
||||
|
||||
#
|
||||
# Component Makefile
|
||||
#
|
||||
#
|
||||
# The Espressif Managed Components are only for newer versions of the ESP-IDF
|
||||
# Typically only for ESP32[-x] targets and only for ESP-IDF v4.3 or later:
|
||||
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html
|
||||
# https://components.espressif.com/
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# make flash
|
||||
#
|
||||
# make flash ESPPORT=/dev/ttyS55
|
||||
#
|
||||
# make flash ESPBAUD=9600
|
||||
#
|
||||
# make monitor ESPPORT=COM1
|
||||
#
|
||||
# make monitor ESPPORT=/dev/ttyS55 MONITORBAUD=115200
|
||||
#
|
||||
# export ESPPORT=/dev/ttyS55
|
||||
#
|
||||
# https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/index.html
|
||||
#
|
||||
|
||||
# Although the project should define WOLFSSL_USER_SETTINGS, we'll also
|
||||
# define it here:
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
||||
|
||||
# In the wolfSSL GitHub examples for Espressif,
|
||||
# the root is 7 directories up from here:
|
||||
WOLFSSL_ROOT := ../../../../../../../
|
||||
|
||||
# NOTE: The wolfSSL include diretory (e.g. user_settings.h) is
|
||||
# located HERE in THIS project, and *not* in the wolfSSL root.
|
||||
COMPONENT_ADD_INCLUDEDIRS := .
|
||||
COMPONENT_ADD_INCLUDEDIRS += include
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT).
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)wolfssl
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)wolfssl/wolfcrypt
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)wolfssl/wolfcrypt/port/Espressif
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)wolfcrypt/benchmark
|
||||
# COMPONENT_ADD_INCLUDEDIRS += $ENV(IDF_PATH)/components/freertos/include/freertos
|
||||
# COMPONENT_ADD_INCLUDEDIRS += "$ENV(IDF_PATH)/soc/esp32s3/include/soc"
|
||||
|
||||
|
||||
# WOLFSSL_ROOT := ""
|
||||
COMPONENT_SRCDIRS := $(WOLFSSL_ROOT)src
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/src/port/atmel
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/benchmark
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/test
|
||||
COMPONENT_SRCDIRS += include
|
||||
|
||||
COMPONENT_OBJEXCLUDE := $(WOLFSSL_ROOT)wolfcrypt/src/aes_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)wolfcrypt/src/evp.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)wolfcrypt/src/sha512_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)wolfcrypt/src/fe_x25519_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)wolfcrypt/src/aes_gcm_x86_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)src/bio.o
|
||||
|
||||
|
||||
##
|
||||
## wolfSSL
|
||||
##
|
||||
COMPONENT_OBJS := $(WOLFSSL_ROOT)src/bio.o
|
||||
# COMPONENT_OBJS += src/conf.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/crl.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/dtls.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/dtls13.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/internal.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/keys.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/ocsp.o
|
||||
# COMPONENT_OBJS += src/pk.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/quic.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/sniffer.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/ssl.o
|
||||
# COMPONENT_OBJS += src/ssl_asn1.o
|
||||
# COMPONENT_OBJS += src/ssl_bn.o
|
||||
# COMPONENT_OBJS += src/ssl_certman.o
|
||||
# COMPONENT_OBJS += src/ssl_crypto.o
|
||||
# COMPONENT_OBJS += src/ssl_misc.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/tls.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/tls13.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)src/wolfio.o
|
||||
# COMPONENT_OBJS += src/x509.o
|
||||
# COMPONENT_OBJS += src/x509_str.o
|
||||
|
||||
##
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/arc4.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/asm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/asn.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/async.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/blake2b.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/blake2s.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/camellia.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/chacha.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/chacha20_poly1305.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/cmac.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/coding.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/compress.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/cpuid.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/cryptocb.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/curve25519.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/curve448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/des3.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/dh.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/dilithium.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/dsa.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ecc.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/eccsi.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ecc_fp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ed25519.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ed448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/error.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/evp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ext_kyber.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ext_lms.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ext_xmss.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/falcon.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/fe_448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/fe_low_mem.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/fe_operations.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/fips.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/fips_test.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ge_448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ge_low_mem.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ge_operations.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/hash.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/hmac.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/hpke.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/integer.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/kdf.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/logging.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/md2.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/md4.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/md5.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/memory.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/pkcs12.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/pkcs7.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/poly1305.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/pwdbased.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/random.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/rc2.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ripemd.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/rsa.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sakke.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/selftest.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sha.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sha256.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sha3.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sha512.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/signature.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/siphash.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sm2.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sm3.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sm4.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sphincs.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_arm32.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_arm64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_armthumb.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_c32.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_c64.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_cortexm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_dsp32.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_int.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_sm2_arm32.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_sm2_arm64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_sm2_armthumb.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_sm2_c32.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_sm2_c64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_sm2_cortexm.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_sm2_x86_64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/sp_x86_64.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/srp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/tfm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_dsp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_encrypt.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_kyber.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_kyber_poly.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_lms.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_pkcs11.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_port.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wc_xmss.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wolfcrypt_first.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wolfcrypt_last.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wolfevent.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/wolfmath.o
|
||||
|
||||
##
|
||||
## Espressif
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif/esp32_aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif/esp32_mp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif/esp32_sha.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif/esp32_util.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif/esp_sdk_mem_lib.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif/esp_sdk_time_lib.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/port/Espressif/esp_sdk_wifi_lib.o
|
||||
|
||||
##
|
||||
## wolfcrypt benchmark (optional)
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/benchmark/benchmark.o
|
||||
|
||||
##
|
||||
## wolfcrypt test (optional)
|
||||
##
|
||||
## COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/test/test.o
|
||||
|
||||
##
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/src
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -19,12 +19,22 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
/* This user_settings.h is for Espressif ESP-IDF */
|
||||
#include <sdkconfig.h>
|
||||
/* This user_settings.h is for Espressif ESP-IDF
|
||||
*
|
||||
* Standardized wolfSSL Espressif ESP32 + ESP8266 user_settings.h V5.7.0-1
|
||||
*
|
||||
* Do not include any wolfssl headers here
|
||||
*
|
||||
* When editing this file:
|
||||
* ensure wolfssl_test and wolfssl_benchmark settings match.
|
||||
*/
|
||||
|
||||
/* The Espressif project config file. See also sdkconfig.defaults */
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/* The Espressif sdkconfig will have chipset info.
|
||||
**
|
||||
** Possible values:
|
||||
** Some possible values:
|
||||
**
|
||||
** CONFIG_IDF_TARGET_ESP32
|
||||
** CONFIG_IDF_TARGET_ESP32S2
|
||||
@@ -36,18 +46,175 @@
|
||||
#undef WOLFSSL_ESPIDF
|
||||
#define WOLFSSL_ESPIDF
|
||||
|
||||
/* We don't use WiFi, so don't compile in the esp-sdk-lib WiFi helpers: */
|
||||
#define NO_ESP_SDK_WIFI
|
||||
|
||||
/* Experimental Kyber */
|
||||
#if 0
|
||||
/* Kyber typically needs a minimum 10K stack */
|
||||
#define WOLFSSL_EXPERIMENTAL_SETTINGS
|
||||
#define WOLFSSL_HAVE_KYBER
|
||||
#define WOLFSSL_WC_KYBER
|
||||
#define WOLFSSL_SHA3
|
||||
#endif
|
||||
|
||||
/*
|
||||
* choose ONE of these Espressif chips to define:
|
||||
* ONE of these Espressif chip families will be detected from sdkconfig:
|
||||
*
|
||||
* WOLFSSL_ESP32
|
||||
* WOLFSSL_ESPWROOM32SE
|
||||
* WOLFSSL_ESP8266
|
||||
*/
|
||||
#undef WOLFSSL_ESPWROOM32SE
|
||||
#undef WOLFSSL_ESP8266
|
||||
#undef WOLFSSL_ESP32
|
||||
/* See below for chipset detection from sdkconfig.h */
|
||||
|
||||
#define WOLFSSL_ESP32
|
||||
/* when you want to use SINGLE THREAD. Note Default ESP-IDF is FreeRTOS */
|
||||
/* #define SINGLE_THREADED */
|
||||
|
||||
/* SMALL_SESSION_CACHE saves a lot of RAM for ClientCache and SessionCache.
|
||||
* Memory requirement is about 5KB, otherwise 20K is needed when not specified.
|
||||
* If extra small footprint is needed, try MICRO_SESSION_CACHE (< 1K)
|
||||
* When really desperate or no TLS used, try NO_SESSION_CACHE. */
|
||||
#define NO_SESSION_CACHE
|
||||
|
||||
/* Small Stack uses more heap. */
|
||||
#define WOLFSSL_SMALL_STACK
|
||||
|
||||
/* Full debugging turned off, but show malloc failure detail */
|
||||
/* #define DEBUG_WOLFSSL */
|
||||
#define DEBUG_WOLFSSL_MALLOC
|
||||
|
||||
/* See test.c that sets cert buffers; we'll set them here: */
|
||||
#define USE_CERT_BUFFERS_256
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
/* RSA_LOW_MEM: Half as much memory but twice as slow. */
|
||||
#define RSA_LOW_MEM
|
||||
|
||||
/* Uncommon settings for testing only */
|
||||
#define TEST_ESPIDF_ALL_WOLFSSL
|
||||
#ifdef TEST_ESPIDF_ALL_WOLFSSL
|
||||
#define WOLFSSL_MD2
|
||||
#define HAVE_BLAKE2
|
||||
#define HAVE_BLAKE2B
|
||||
#define HAVE_BLAKE2S
|
||||
|
||||
#define WC_RC2
|
||||
#define WOLFSSL_ALLOW_RC4
|
||||
|
||||
#define HAVE_POLY1305
|
||||
|
||||
#define WOLFSSL_AES_128
|
||||
#define WOLFSSL_AES_OFB
|
||||
#define WOLFSSL_AES_CFB
|
||||
#define WOLFSSL_AES_XTS
|
||||
|
||||
/* #define WC_SRTP_KDF */
|
||||
/* TODO Causes failure with Espressif AES HW Enabled */
|
||||
/* #define HAVE_AES_ECB */
|
||||
/* #define HAVE_AESCCM */
|
||||
/* TODO sanity check when missing HAVE_AES_ECB */
|
||||
#define WOLFSSL_WOLFSSH
|
||||
|
||||
#define HAVE_AESGCM
|
||||
#define WOLFSSL_AES_COUNTER
|
||||
|
||||
#define HAVE_FFDHE
|
||||
#define HAVE_FFDHE_2048
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
/* TODO Full size SRP is disabled on the ESP8266 at this time.
|
||||
* Low memory issue? */
|
||||
#define WOLFCRYPT_HAVE_SRP
|
||||
/* MIN_FFDHE_FP_MAX_BITS = (MIN_FFDHE_BITS * 2); see settings.h */
|
||||
#define FP_MAX_BITS MIN_FFDHE_FP_MAX_BITS
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP32S2) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
/* TODO: SRP Not enabled, known to fail on this target
|
||||
* See https://github.com/wolfSSL/wolfssl/issues/7210 */
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
/* SRP Known to be working on this target::*/
|
||||
#define WOLFCRYPT_HAVE_SRP
|
||||
#define FP_MAX_BITS (8192 * 2)
|
||||
#else
|
||||
/* For everything else, give a try and see if SRP working: */
|
||||
#define WOLFCRYPT_HAVE_SRP
|
||||
#define FP_MAX_BITS (8192 * 2)
|
||||
#endif
|
||||
|
||||
#define HAVE_DH
|
||||
|
||||
/* TODO: there may be a problem with HAVE_CAMELLIA with HW AES disabled.
|
||||
* Do not define NO_WOLFSSL_ESP32_CRYPT_AES when enabled: */
|
||||
/* #define HAVE_CAMELLIA */
|
||||
|
||||
/* DSA requires old SHA */
|
||||
#define HAVE_DSA
|
||||
|
||||
/* Needs SHA512 ? */
|
||||
#define HAVE_HPKE
|
||||
|
||||
/* Not for Espressif? */
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C2) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP8684) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP32H2) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
#undef HAVE_ECC
|
||||
#undef HAVE_ECC_CDH
|
||||
#undef HAVE_CURVE25519
|
||||
|
||||
/* TODO does CHACHA also need alignment? Failing on ESP8266
|
||||
* See SHA256 __attribute__((aligned(4))); and WC_SHA256_ALIGN */
|
||||
#ifdef HAVE_CHACHA
|
||||
#error "HAVE_CHACHA not supported on ESP8266"
|
||||
#endif
|
||||
#ifdef HAVE_XCHACHA
|
||||
#error "HAVE_XCHACHA not supported on ESP8266"
|
||||
#endif
|
||||
#else
|
||||
#define HAVE_XCHACHA
|
||||
#define HAVE_CHACHA
|
||||
/* TODO Not enabled at this time, needs further testing:
|
||||
* #define WC_SRTP_KDF
|
||||
* #define HAVE_COMP_KEY
|
||||
* #define WOLFSSL_HAVE_XMSS
|
||||
*/
|
||||
#endif
|
||||
/* TODO AES-EAX not working on this platform */
|
||||
|
||||
/* Optionally disable DH
|
||||
* #undef HAVE_DH
|
||||
* #undef HAVE_FFDHE
|
||||
*/
|
||||
|
||||
/* ECC_SHAMIR out of memory on ESP32-C2 during ECC */
|
||||
#ifndef HAVE_ECC
|
||||
#define ECC_SHAMIR
|
||||
#endif
|
||||
#else
|
||||
#define WOLFSSL_AES_EAX
|
||||
|
||||
#define ECC_SHAMIR
|
||||
#endif
|
||||
|
||||
/* Only for WOLFSSL_IMX6_CAAM / WOLFSSL_QNX_CAAM ? */
|
||||
/* #define WOLFSSL_CAAM */
|
||||
/* #define WOLFSSL_CAAM_BLOB */
|
||||
|
||||
#define WOLFSSL_AES_SIV
|
||||
#define WOLFSSL_CMAC
|
||||
|
||||
#define WOLFSSL_CERT_PIV
|
||||
|
||||
/* HAVE_SCRYPT may turn on HAVE_PBKDF2 see settings.h */
|
||||
/* #define HAVE_SCRYPT */
|
||||
#define SCRYPT_TEST_ALL
|
||||
#define HAVE_X963_KDF
|
||||
#endif
|
||||
|
||||
/* optionally turn off SHA512/224 SHA512/256 */
|
||||
/* #define WOLFSSL_NOSHA512_224 */
|
||||
@@ -61,7 +228,6 @@
|
||||
/* #define NO_OLD_TLS */
|
||||
|
||||
#define BENCH_EMBEDDED
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
/* TLS 1.3 */
|
||||
#define WOLFSSL_TLS13
|
||||
@@ -79,7 +245,9 @@
|
||||
|
||||
#define HAVE_AESGCM
|
||||
|
||||
#define WOLFSSL_RIPEMD
|
||||
/* Optional RIPEMD: RACE Integrity Primitives Evaluation Message Digest */
|
||||
/* #define WOLFSSL_RIPEMD */
|
||||
|
||||
/* when you want to use SHA224 */
|
||||
#define WOLFSSL_SHA224
|
||||
|
||||
@@ -95,24 +263,34 @@
|
||||
/* ED25519 requires SHA512 */
|
||||
#define HAVE_ED25519
|
||||
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
/* Some features not enabled for ESP8266: */
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP32C2)
|
||||
/* TODO determine low memory configuration for ECC. */
|
||||
#else
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
#endif
|
||||
|
||||
#define HAVE_ED25519
|
||||
|
||||
/* Optional OPENSSL compatibility */
|
||||
#define OPENSSL_EXTRA
|
||||
/* when you want to use pkcs7 */
|
||||
/* #define HAVE_PKCS7 */
|
||||
|
||||
/* #Optional HAVE_PKCS7 */
|
||||
#define HAVE_PKCS7
|
||||
|
||||
#if defined(HAVE_PKCS7)
|
||||
/* HAVE_PKCS7 may enable HAVE_PBKDF2 see settings.h */
|
||||
#define NO_PBKDF2
|
||||
|
||||
#define HAVE_AES_KEYWRAP
|
||||
#define HAVE_X963_KDF
|
||||
#define WOLFSSL_AES_DIRECT
|
||||
#endif
|
||||
|
||||
/* when you want to use aes counter mode */
|
||||
/* when you want to use AES counter mode */
|
||||
/* #define WOLFSSL_AES_DIRECT */
|
||||
/* #define WOLFSSL_AES_COUNTER */
|
||||
|
||||
@@ -126,27 +304,11 @@
|
||||
/* #define CUSTOM_SLOT_ALLOCATION */
|
||||
#endif
|
||||
|
||||
/* rsa primitive specific definition */
|
||||
#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE)
|
||||
/* Define USE_FAST_MATH and SMALL_STACK */
|
||||
#define ESP32_USE_RSA_PRIMITIVE
|
||||
/* WC_NO_CACHE_RESISTANT: slower but more secure */
|
||||
/* #define WC_NO_CACHE_RESISTANT */
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
|
||||
/* NOTE HW unreliable for small values! */
|
||||
/* threshold for performance adjustment for HW primitive use */
|
||||
/* X bits of G^X mod P greater than */
|
||||
#undef ESP_RSA_EXPT_XBITS
|
||||
#define ESP_RSA_EXPT_XBITS 32
|
||||
|
||||
/* X and Y of X * Y mod P greater than */
|
||||
#undef ESP_RSA_MULM_BITS
|
||||
#define ESP_RSA_MULM_BITS 16
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define RSA_LOW_MEM
|
||||
/* TFM_TIMING_RESISTANT: slower but more secure */
|
||||
/* #define TFM_TIMING_RESISTANT */
|
||||
|
||||
/* #define WOLFSSL_ATECC508A_DEBUG */
|
||||
|
||||
@@ -206,7 +368,7 @@
|
||||
#undef WOLFSSL_SYS_CA_CERTS
|
||||
*/
|
||||
|
||||
/*
|
||||
/* command-line options
|
||||
--enable-keygen
|
||||
--enable-certgen
|
||||
--enable-certreq
|
||||
@@ -214,10 +376,14 @@
|
||||
--enable-asn-template
|
||||
*/
|
||||
|
||||
/* Default is HW enabled unless turned off.
|
||||
** Uncomment these lines to force SW instead of HW acceleration */
|
||||
|
||||
/* Chipset detection from sdkconfig.h
|
||||
* Default is HW enabled unless turned off.
|
||||
* Uncomment lines to force SW instead of HW acceleration */
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
#define WOLFSSL_ESP32
|
||||
/* Alternatively, if there's an ECC Secure Element present: */
|
||||
/* #define WOLFSSL_ESPWROOM32SE */
|
||||
|
||||
/* wolfSSL HW Acceleration supported on ESP32. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -235,6 +401,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-S2. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -247,6 +414,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32S2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-S3. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -260,6 +428,7 @@
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C2) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP8684)
|
||||
#define WOLFSSL_ESP32
|
||||
/* ESP8684 is essentially ESP32-C2 chip + flash embedded together in a
|
||||
* single QFN 4x4 mm package. Out of released documentation, Technical
|
||||
* Reference Manual as well as ESP-IDF Programming Guide is applicable
|
||||
@@ -285,6 +454,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-C3. Uncomment to disable: */
|
||||
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
@@ -302,6 +472,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C3 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-C6. Uncomment to disable: */
|
||||
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
@@ -318,6 +489,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C6 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL Hardware Acceleration not yet implemented */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
@@ -326,7 +498,11 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32H2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
/* TODO: Revisit ESP8266 */
|
||||
#define WOLFSSL_ESP8266
|
||||
|
||||
/* There's no hardware encryption on the ESP8266 */
|
||||
/* Consider using the ESP32-C2/C3/C6
|
||||
* See https://www.espressif.com/en/products/socs/esp32-c2 */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
@@ -343,13 +519,42 @@
|
||||
|
||||
#else
|
||||
/* Anything else encountered, disable HW accleration */
|
||||
#warning "Unexpected CONFIG_IDF_TARGET_NN value"
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI
|
||||
#endif /* CONFIG_IDF_TARGET Check */
|
||||
|
||||
/* RSA primitive specific definition, listed AFTER the Chipset detection */
|
||||
#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE)
|
||||
/* Consider USE_FAST_MATH and SMALL_STACK */
|
||||
|
||||
#ifndef NO_RSA
|
||||
#define ESP32_USE_RSA_PRIMITIVE
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
#ifdef CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
#if CONFIG_ESP_MAIN_TASK_STACK_SIZE < 10500
|
||||
#warning "RSA may be difficult with less than 10KB Stack "/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* NOTE HW unreliable for small values! */
|
||||
/* threshold for performance adjustment for HW primitive use */
|
||||
/* X bits of G^X mod P greater than */
|
||||
#undef ESP_RSA_EXPT_XBITS
|
||||
#define ESP_RSA_EXPT_XBITS 32
|
||||
|
||||
/* X and Y of X * Y mod P greater than */
|
||||
#undef ESP_RSA_MULM_BITS
|
||||
#define ESP_RSA_MULM_BITS 16
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Debug options:
|
||||
See wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h for details on debug options
|
||||
|
||||
#define ESP_VERIFY_MEMBLOCK
|
||||
#define DEBUG_WOLFSSL
|
||||
@@ -363,6 +568,14 @@
|
||||
#define WOLFSSL_ESP32_HW_LOCK_DEBUG
|
||||
#define WOLFSSL_DEBUG_ESP_RSA_MULM_BITS
|
||||
#define ESP_DISABLE_HW_TASK_LOCK
|
||||
|
||||
See wolfcrypt/benchmark/benchmark.c for debug and other settings:
|
||||
|
||||
Turn on benchmark timing debugging (CPU Cycles, RTOS ticks, etc)
|
||||
#define DEBUG_WOLFSSL_BENCHMARK_TIMING
|
||||
|
||||
Turn on timer debugging (used when CPU cycles not available)
|
||||
#define WOLFSSL_BENCHMARK_TIMER_DEBUG
|
||||
*/
|
||||
|
||||
/* Pause in a loop rather than exit. */
|
||||
@@ -396,8 +609,9 @@
|
||||
** [Z = X * Y mod M] in esp_mp_mulmod() */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */
|
||||
|
||||
#define WOLFSSL_PUBLIC_MP /* used by benchmark */
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
/* used by benchmark: */
|
||||
#define WOLFSSL_PUBLIC_MP
|
||||
|
||||
/* when turning on ECC508 / ECC608 support
|
||||
#define WOLFSSL_ESPWROOM32SE
|
||||
@@ -406,12 +620,75 @@
|
||||
#define ATCA_WOLFSSL
|
||||
*/
|
||||
|
||||
/* optional SM4 Ciphers. See https://github.com/wolfSSL/wolfsm
|
||||
/***************************** Certificate Macros *****************************
|
||||
*
|
||||
* The section below defines macros used in typically all of the wolfSSL
|
||||
* examples such as the client and server for certs stored in header files.
|
||||
*
|
||||
* There are various certificate examples in this header file:
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/certs_test.h
|
||||
*
|
||||
* To use the sets of macros below, define *one* of these:
|
||||
*
|
||||
* USE_CERT_BUFFERS_1024 - ECC 1024 bit encoded ASN1
|
||||
* USE_CERT_BUFFERS_2048 - RSA 2048 bit encoded ASN1
|
||||
* WOLFSSL_SM[2,3,4] - SM Ciphers
|
||||
*
|
||||
* For example: define USE_CERT_BUFFERS_2048 to use CA Certs used in this
|
||||
* wolfSSL function for the `ca_cert_der_2048` buffer, size and types:
|
||||
*
|
||||
* ret = wolfSSL_CTX_load_verify_buffer(ctx,
|
||||
* CTX_CA_CERT,
|
||||
* CTX_CA_CERT_SIZE,
|
||||
* CTX_CA_CERT_TYPE);
|
||||
*
|
||||
* See https://www.wolfssl.com/documentation/manuals/wolfssl/group__CertsKeys.html#function-wolfssl_ctx_load_verify_buffer
|
||||
*
|
||||
* In this case the CTX_CA_CERT will be defined as `ca_cert_der_2048` as
|
||||
* defined here: https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/certs_test.h
|
||||
*
|
||||
* The CTX_CA_CERT_SIZE and CTX_CA_CERT_TYPE are similarly used to reference
|
||||
* array size and cert type respectively.
|
||||
*
|
||||
* Similarly for loading the private client key:
|
||||
*
|
||||
* ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
|
||||
* CTX_CLIENT_KEY,
|
||||
* CTX_CLIENT_KEY_SIZE,
|
||||
* CTX_CLIENT_KEY_TYPE);
|
||||
*
|
||||
* see https://www.wolfssl.com/documentation/manuals/wolfssl/group__CertsKeys.html#function-wolfssl_ctx_use_privatekey_buffer
|
||||
*
|
||||
* Similarly, the other macros are for server certificates and keys:
|
||||
* `CTX_SERVER_CERT` and `CTX_SERVER_KEY` are available.
|
||||
*
|
||||
* The certificate and key names are typically `static const unsigned char`
|
||||
* arrays. The [NAME]_size are typically `sizeof([array name])`, and the types
|
||||
* are the known wolfSSL encoding type integers (e.g. WOLFSSL_FILETYPE_PEM).
|
||||
*
|
||||
* See `SSL_FILETYPE_[name]` in
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/ssl.h
|
||||
*
|
||||
* See Abstract Syntax Notation One (ASN.1) in:
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/wolfcrypt/asn.h
|
||||
*
|
||||
* Optional SM4 Ciphers:
|
||||
*
|
||||
* Although the SM ciphers are shown here, the `certs_test_sm.h` may not yet
|
||||
* be available. See:
|
||||
* https://github.com/wolfSSL/wolfssl/pull/6825
|
||||
* https://github.com/wolfSSL/wolfsm
|
||||
*
|
||||
* Uncomment these 3 macros to enable the SM Ciphers and use the macros below.
|
||||
*/
|
||||
|
||||
/*
|
||||
#define WOLFSSL_SM2
|
||||
#define WOLFSSL_SM3
|
||||
#define WOLFSSL_SM4
|
||||
*/
|
||||
|
||||
/* Conditional macros used in wolfSSL TLS client and server examples */
|
||||
#if defined(WOLFSSL_SM2) || defined(WOLFSSL_SM3) || defined(WOLFSSL_SM4)
|
||||
#include <wolfssl/certs_test_sm.h>
|
||||
#define CTX_CA_CERT root_sm2
|
||||
@@ -427,24 +704,49 @@
|
||||
#undef WOLFSSL_BASE16
|
||||
#define WOLFSSL_BASE16
|
||||
#else
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#define USE_CERT_BUFFERS_256
|
||||
#define CTX_CA_CERT ca_cert_der_2048
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_CERT server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_2048
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_2048
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#endif
|
||||
#if defined(USE_CERT_BUFFERS_2048)
|
||||
/* Be sure to include in app when using example certs: */
|
||||
/* #include <wolfssl/certs_test.h> */
|
||||
#define CTX_CA_CERT ca_cert_der_2048
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
/* See settings.h for some of the possible hardening options:
|
||||
*
|
||||
* #define NO_ESPIDF_DEFAULT
|
||||
* #define WC_NO_CACHE_RESISTANT
|
||||
* #define WC_AES_BITSLICED
|
||||
* #define HAVE_AES_ECB
|
||||
* #define HAVE_AES_DIRECT
|
||||
*/
|
||||
#define CTX_SERVER_CERT server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_2048
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_2048
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_CLIENT_CERT client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_KEY client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#elif defined(USE_CERT_BUFFERS_1024)
|
||||
/* Be sure to include in app when using example certs: */
|
||||
/* #include <wolfssl/certs_test.h> */
|
||||
#define CTX_CA_CERT ca_cert_der_1024
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_1024
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_CLIENT_CERT client_cert_der_1024
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_cert_der_1024
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_KEY client_key_der_1024
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_key_der_1024
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_SERVER_CERT server_cert_der_1024
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_1024
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_1024
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_1024
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#else
|
||||
/* Optionally define custom cert arrays, sizes, and types here */
|
||||
#error "Must define USE_CERT_BUFFERS_2048 or USE_CERT_BUFFERS_1024"
|
||||
#endif
|
||||
#endif /* Conditional key and cert constant names */
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#
|
||||
# This Makefile can be left empty. By default, it will take the sources in the
|
||||
# src/ directory, compile them and link them into lib(subdirectory_name).a
|
||||
# in the build directory. This behaviour is entirely configurable,
|
||||
# in the build directory. This behavior is entirely configurable,
|
||||
# please read the ESP-IDF documents if you need to do this.
|
||||
#
|
||||
# (Uses default behavior of compiling all source files in directory, adding 'include' to include path.)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* benchmark main.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* benchmark main.c
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -20,25 +20,44 @@
|
||||
*/
|
||||
|
||||
/* ESP-IDF */
|
||||
#include <esp_log.h>
|
||||
#include "sdkconfig.h"
|
||||
#include <esp_log.h>
|
||||
|
||||
/* wolfSSL */
|
||||
/* The wolfSSL user_settings.h file is automatically included by the settings.h
|
||||
* file and should never be explicitly included in any other source files.
|
||||
* The settings.h should also be listed above wolfssl library include files. */
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <user_settings.h>
|
||||
#include <wolfssl/version.h>
|
||||
#include "wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h"
|
||||
#include <wolfssl/wolfcrypt/port/Espressif/esp-sdk-lib.h>
|
||||
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
|
||||
#ifndef WOLFSSL_ESPIDF
|
||||
#warning "Problem with wolfSSL user_settings."
|
||||
#warning "Check components/wolfssl/include"
|
||||
#error "Problem with wolfSSL user_settings. " \
|
||||
"Check components/wolfssl/include " \
|
||||
"and confirm WOLFSSL_USER_SETTINGS is defined, " \
|
||||
"typically in the component CMakeLists.txt"
|
||||
#endif
|
||||
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
#include <wolfcrypt/benchmark/benchmark.h>
|
||||
|
||||
/* Hardware; include after other libraries,
|
||||
* particularly after freeRTOS from settings.h */
|
||||
#include <driver/uart.h>
|
||||
|
||||
/* set to 0 for one benchmark,
|
||||
** set to 1 for continous benchmark loop */
|
||||
#define BENCHMARK_LOOP 1
|
||||
** set to 1 for continuous benchmark loop */
|
||||
#define BENCHMARK_LOOP 0
|
||||
|
||||
#define THIS_MONITOR_UART_RX_BUFFER_SIZE 200
|
||||
|
||||
#ifdef CONFIG_ESP8266_XTAL_FREQ_26
|
||||
/* 26MHz crystal: 74880 bps */
|
||||
#define THIS_MONITOR_UART_BAUD_DATE 74880
|
||||
#else
|
||||
/* 40MHz crystal: 115200 bps */
|
||||
#define THIS_MONITOR_UART_BAUD_DATE 115200
|
||||
#endif
|
||||
|
||||
/* check BENCH_ARGV in sdkconfig to determine need to set WOLFSSL_BENCH_ARGV */
|
||||
#ifdef CONFIG_BENCH_ARGV
|
||||
@@ -129,6 +148,7 @@ void my_atmel_free(int slotId)
|
||||
/* the following are needed by benchmark.c with args */
|
||||
#ifdef WOLFSSL_BENCH_ARGV
|
||||
char* __argv[WOLFSSL_BENCH_ARGV_MAX_ARGUMENTS];
|
||||
#define ARG_BUFF_SIZE 16
|
||||
|
||||
int construct_argv()
|
||||
{
|
||||
@@ -137,7 +157,7 @@ int construct_argv()
|
||||
int len = 0;
|
||||
char *_argv; /* buffer for copying the string */
|
||||
char *ch; /* char pointer to trace the string */
|
||||
char buff[16] = { 0 }; /* buffer for a argument copy */
|
||||
char buff[ARG_BUFF_SIZE] = { 0 }; /* buffer for a argument copy */
|
||||
|
||||
ESP_LOGI(TAG, "construct_argv arg:%s\n", CONFIG_BENCH_ARGV);
|
||||
len = strlen(CONFIG_BENCH_ARGV);
|
||||
@@ -170,7 +190,7 @@ int construct_argv()
|
||||
memset(buff, 0, sizeof(buff));
|
||||
/* copy each args into buffer */
|
||||
i = 0;
|
||||
while ((*ch != ' ') && (*ch != '\0') && (i < 16)) {
|
||||
while ((*ch != ' ') && (*ch != '\0') && (i <= ARG_BUFF_SIZE)) {
|
||||
buff[i] = *ch;
|
||||
++i;
|
||||
++ch;
|
||||
@@ -193,17 +213,43 @@ int construct_argv()
|
||||
void app_main(void)
|
||||
{
|
||||
int stack_start = 0;
|
||||
ESP_LOGI(TAG, "---------------- wolfSSL Benchmark Example ------------");
|
||||
|
||||
uart_config_t uart_config = {
|
||||
.baud_rate = THIS_MONITOR_UART_BAUD_DATE,
|
||||
.data_bits = UART_DATA_8_BITS,
|
||||
.parity = UART_PARITY_DISABLE,
|
||||
.stop_bits = UART_STOP_BITS_1,
|
||||
};
|
||||
esp_err_t ret = 0;
|
||||
stack_start = esp_sdk_stack_pointer();
|
||||
|
||||
/* uart_set_pin(UART_NUM_0, TX_PIN, RX_PIN,
|
||||
* UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); */
|
||||
|
||||
/* Some targets may need to have UART speed set, such as ESP8266 */
|
||||
ESP_LOGI(TAG, "UART init");
|
||||
uart_param_config(UART_NUM_0, &uart_config);
|
||||
uart_driver_install(UART_NUM_0,
|
||||
THIS_MONITOR_UART_RX_BUFFER_SIZE, 0, 0, NULL, 0);
|
||||
|
||||
ESP_LOGI(TAG, "---------------- wolfSSL Benchmark Example -------------");
|
||||
ESP_LOGI(TAG, "--------------------------------------------------------");
|
||||
ESP_LOGI(TAG, "--------------------------------------------------------");
|
||||
ESP_LOGI(TAG, "---------------------- BEGIN MAIN ----------------------");
|
||||
ESP_LOGI(TAG, "--------------------------------------------------------");
|
||||
ESP_LOGI(TAG, "--------------------------------------------------------");
|
||||
ESP_LOGI(TAG, "Stack Start: 0x%x", stack_start);
|
||||
|
||||
#ifdef HAVE_VERSION_EXTENDED_INFO
|
||||
#ifdef WOLFSSL_ESP_NO_WATCHDOG
|
||||
ESP_LOGW(TAG, "Found WOLFSSL_ESP_NO_WATCHDOG, disabling...");
|
||||
esp_DisableWatchdog();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_VERSION_EXTENDED_INFO) && defined(WOLFSSL_HAS_METRICS)
|
||||
esp_ShowExtendedSystemInfo();
|
||||
#endif
|
||||
|
||||
/* all platforms: stack high water mark check */
|
||||
ESP_LOGI(TAG, "app_main CONFIG_BENCH_ARGV = %s", WOLFSSL_BENCH_ARGV);
|
||||
|
||||
/* when using atecc608a on esp32-wroom-32se */
|
||||
@@ -232,11 +278,11 @@ void app_main(void)
|
||||
do {
|
||||
ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL));
|
||||
|
||||
wolf_benchmark_task();
|
||||
wolf_benchmark_task(); /* TODO capture return value! */
|
||||
ESP_LOGI(TAG, "Stack used: %d\n",
|
||||
stack_start - uxTaskGetStackHighWaterMark(NULL));
|
||||
|
||||
#ifdef WOLFSSL_HW_METRICS_DISABLED/* Remove _DISABLED upon #6990 Merge */
|
||||
#if defined(WOLFSSL_HW_METRICS) && defined(WOLFSSL_HAS_METRICS)
|
||||
esp_hw_show_metrics();
|
||||
#endif
|
||||
} while (BENCHMARK_LOOP);
|
||||
@@ -249,8 +295,34 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL));
|
||||
#endif
|
||||
|
||||
/* note wolfCrypt_Cleanup() should always be called when finished.
|
||||
** This is called at the end of wolf_test_task();
|
||||
*/
|
||||
|
||||
#if defined(DEBUG_WOLFSSL) && defined(WOLFSSL_ESP32_CRYPT_RSA_PRI)
|
||||
esp_hw_show_mp_metrics();
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_uxTaskGetStackHighWaterMark
|
||||
ESP_LOGI(TAG, "Stack HWM: %d", uxTaskGetStackHighWaterMark(NULL));
|
||||
|
||||
ESP_LOGI(TAG, "Stack used: %d", CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
- (uxTaskGetStackHighWaterMark(NULL)));
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_ESPIDF_VERBOSE_EXIT_MESSAGE
|
||||
if (ret == 0) {
|
||||
ESP_LOGI(TAG, WOLFSSL_ESPIDF_VERBOSE_EXIT_MESSAGE("Success!", ret));
|
||||
}
|
||||
else {
|
||||
ESP_LOGE(TAG, WOLFSSL_ESPIDF_VERBOSE_EXIT_MESSAGE("Failed!", ret));
|
||||
}
|
||||
#elif defined(WOLFSSL_ESPIDF_EXIT_MESSAGE)
|
||||
ESP_LOGI(TAG, WOLFSSL_ESPIDF_EXIT_MESSAGE);
|
||||
#else
|
||||
ESP_LOGI(TAG, "\n\nDone!\n\n"
|
||||
"If running from idf.py monitor, press twice: Ctrl+]");
|
||||
#endif
|
||||
|
||||
/* after the test, we'll just wait */
|
||||
while (1) {
|
||||
|
||||
@@ -1,34 +1,87 @@
|
||||
# Note that during the build process, settings from sdkconfig.defaults will not override those already in sdkconfig.
|
||||
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#custom-sdkconfig-defaults
|
||||
CONFIG_BENCH_ARGV="-lng 0"
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
|
||||
#
|
||||
# Default main stack size
|
||||
# Default main stack size. See user_settings.h
|
||||
#
|
||||
# This is typically way bigger than needed for stack size. See user_settings.h
|
||||
#
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=55500
|
||||
# For wolfSSL SMALL_STACK, 3072 bytes should be sufficient for benchmark app.
|
||||
# When using RSA, assign at least 10500 bytes, otherwise 5500 usually works for others
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=10500
|
||||
|
||||
# Legacy stack size for older ESP-IDF versions
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=55500
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=10500
|
||||
|
||||
#
|
||||
# Benchmark must not have CONFIG_NEWLIB_NANO_FORMAT enabled
|
||||
CONFIG_NEWLIB_NANO_FORMAT=n
|
||||
#
|
||||
# Watchdog Timers
|
||||
#
|
||||
# We don't want to have the watchdog timeout during tests
|
||||
# We don't want to have the watchdog timeout during tests & benchmarks
|
||||
#
|
||||
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=n
|
||||
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=n
|
||||
# Panic & Watchdog
|
||||
CONFIG_ESP_INT_WDT_TIMEOUT_MS=10000
|
||||
CONFIG_ESP_TASK_WDT_EN=n
|
||||
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
|
||||
CONFIG_ESP_INT_WDT=n
|
||||
|
||||
# ESP8266 WDT
|
||||
# CONFIG_ESP_PANIC_PRINT_REBOOT is not set
|
||||
CONFIG_ESP_PANIC_PRINT_REBOOT=n
|
||||
CONFIG_ESP_PANIC_PRINT_HALT=y
|
||||
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS is not set
|
||||
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=n
|
||||
|
||||
# ESP8266 Memory
|
||||
CONFIG_FREERTOS_GLOBAL_DATA_LINK_IRAM=y
|
||||
CONFIG_HEAP_DISABLE_IRAM=y
|
||||
|
||||
# Performance
|
||||
# CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||
|
||||
# Set max COU frequency (falls back as needed for lower maximum)
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
|
||||
# FreeRTOS ticks at 1ms interval
|
||||
CONFIG_FREERTOS_UNICORE=y
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
|
||||
#
|
||||
# Compiler options
|
||||
#
|
||||
CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
|
||||
# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_PERF is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_NONE is not set
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
|
||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
|
||||
CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
|
||||
# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set
|
||||
CONFIG_COMPILER_HIDE_PATHS_MACROS=y
|
||||
# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
|
||||
# CONFIG_COMPILER_CXX_RTTI is not set
|
||||
# CONFIG_COMPILER_STACK_CHECK_MODE_NONE is not set
|
||||
CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y
|
||||
# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set
|
||||
# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
|
||||
CONFIG_COMPILER_STACK_CHECK=y
|
||||
# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
|
||||
# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set
|
||||
# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set
|
||||
# CONFIG_COMPILER_DUMP_RTL_FILES is not set
|
||||
# end of Compiler options
|
||||
|
||||
# We don't know that the min is actually v2,
|
||||
# but this is the earliest tested.
|
||||
CONFIG_ESP32C3_REV_MIN_2=y
|
||||
|
||||
#
|
||||
# Partition Table
|
||||
|
||||
@@ -1,12 +1,134 @@
|
||||
# ESP8266 Project Makefile for wolfssl_client
|
||||
#
|
||||
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
|
||||
# project subdirectory.
|
||||
# Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
# wolfSSL is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# wolfSSL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
#
|
||||
|
||||
#
|
||||
# This is a project Makefile.
|
||||
# It is assumed the directory this Makefile resides in is a
|
||||
# project subdirectory containing an entire project.
|
||||
#
|
||||
# Optional private config headers. Define environment variables
|
||||
# to include various default header files that are typically
|
||||
# not in a git path, and thus excluded from being checked in.
|
||||
#
|
||||
# Environment Variable Name | Header file name included
|
||||
# ---------------------------------- | ---------------------------------------
|
||||
# MY_PRIVATE_CONFIG (files detected / selected in header)
|
||||
# USE_MY_PRIVATE_WSL_CONFIG /mnt/c/workspace/my_private_config.h
|
||||
# USE_MY_PRIVATE_MAC_CONFIG ~/Documents/my_private_config.h
|
||||
# USE_MY_PRIVATE_LINUX_CONFIG ~/workspace/my_private_config.h
|
||||
# USE_MY_PRIVATE_WINDOWS_CONFIG /workspace/my_private_config.h
|
||||
#
|
||||
#
|
||||
PROJECT_NAME := wolfssl_client
|
||||
|
||||
MY_PRIVATE_CONFIG ?= n
|
||||
USE_MY_PRIVATE_WSL_CONFIG ?= n
|
||||
USE_MY_PRIVATE_MAC_CONFIG ?= n
|
||||
USE_MY_PRIVATE_LINUX_CONFIG ?= n
|
||||
USE_MY_PRIVATE_WINDOWS_CONFIG ?= n
|
||||
|
||||
# Calling shell causes unintuitive error in Windows:
|
||||
# OS := $(shell uname -s)
|
||||
#
|
||||
# But OS, or MY_PRIVATE_CONFIG should already be defined:
|
||||
$(info ************* wolfssl_client *************)
|
||||
|
||||
ifeq ($(MY_PRIVATE_CONFIG),y)
|
||||
CFLAGS += -DMY_PRIVATE_CONFIG
|
||||
$(info Enabled MY_PRIVATE_CONFIG")
|
||||
endif
|
||||
|
||||
# Check for Windows environment variable: USE_MY_PRIVATE_WINDOWS_CONFIG
|
||||
ifeq ($(USE_MY_PRIVATE_WINDOWS_CONFIG),y)
|
||||
# This hard coded MY_CONFIG_FILE value must match that in the header file.
|
||||
MY_CONFIG_FILE := /workspace/my_private_config.h
|
||||
ifeq ($(wildcard $(MY_CONFIG_FILE)),)
|
||||
$(info File does not exist: $(MY_CONFIG_FILE))
|
||||
else
|
||||
CFLAGS += -DUSE_MY_PRIVATE_WINDOWS_CONFIG
|
||||
$(info Using private config file for: Windows)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Check for WSL environment variable: USE_MY_PRIVATE_WSL_CONFIG
|
||||
ifeq ($(USE_MY_PRIVATE_WSL_CONFIG),y)
|
||||
# This hard coded MY_CONFIG_FILE value must match that in the header file.
|
||||
MY_CONFIG_FILE := /mnt/c/workspace/my_private_config.h
|
||||
ifeq ($(wildcard $(MY_CONFIG_FILE)),)
|
||||
$(info File does not exist: $(MY_CONFIG_FILE))
|
||||
else
|
||||
CFLAGS += -DUSE_MY_PRIVATE_WSL_CONFIG
|
||||
$(info Using private config file for: WSL)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Check for Linux environment variable: USE_MY_PRIVATE_LINUX_CONFIG
|
||||
ifeq ($(USE_MY_PRIVATE_LINUX_CONFIG),y)
|
||||
# This hard coded MY_CONFIG_FILE value must match that in the header file.
|
||||
MY_CONFIG_FILE := ~/workspace/my_private_config.h
|
||||
ifeq ($(wildcard $(MY_CONFIG_FILE)),)
|
||||
$(info File does not exist: $(MY_CONFIG_FILE))
|
||||
else
|
||||
CFLAGS += -DUSE_MY_PRIVATE_LINUX_CONFIG
|
||||
$(info Using private config file for: Linux)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Check for Mac environment variable: USE_MY_PRIVATE_MAC_CONFIG
|
||||
ifeq ($(USE_MY_PRIVATE_MAC_CONFIG),y)
|
||||
# This hard coded MY_CONFIG_FILE value must match that in the header file.
|
||||
MY_CONFIG_FILE := ~/Documents/my_private_config.h
|
||||
ifeq ($(wildcard $(MY_CONFIG_FILE)),)
|
||||
$(info File does not exist: $(MY_CONFIG_FILE))
|
||||
else
|
||||
CFLAGS += -DUSE_MY_PRIVATE_MAC_CONFIG
|
||||
$(info Using private config file for: Mac)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(OS),MY_PRIVATE_CONFIG)
|
||||
CFLAGS += -DMY_PRIVATE_CONFIG="$(MY_PRIVATE_CONFIG)"
|
||||
else
|
||||
ifeq ($(OS),Linux)
|
||||
CFLAGS += -DOS_LINUX
|
||||
endif
|
||||
ifeq ($(OS),Windows_NT)
|
||||
CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_WINDOWS
|
||||
endif
|
||||
ifeq ($(OS),Darwin)
|
||||
CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_APPLE
|
||||
endif
|
||||
ifneq (,$(findstring MINGW,$(OS)))
|
||||
CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_MINGW
|
||||
endif
|
||||
ifneq (,$(findstring CYGWIN,$(OS)))
|
||||
CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_CYGWIN
|
||||
endif
|
||||
endif
|
||||
|
||||
# It is essential that the build process sees the WOLFSSL_USER_SETTINGS
|
||||
CFLAGS += -DWOLFSSL_USER_SETTINGS
|
||||
# if there isn't the directory, please disable the line below.
|
||||
|
||||
# if directory not available, please disable the line below.
|
||||
EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
|
||||
|
||||
# The Standard Espressif IDF include:
|
||||
include $(IDF_PATH)/make/project.mk
|
||||
|
||||
@@ -8,12 +8,50 @@ When using the CLI, see the [example parameters](/IDE/Espressif/ESP-IDF/examples
|
||||
For general information on [wolfSSL examples for Espressif](../README.md), see the
|
||||
[README](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md) file.
|
||||
|
||||
## VisualGDB
|
||||
## Quick Start
|
||||
|
||||
Use the [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html)
|
||||
for ESP32 or [RTOS SDK](https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/index.html)
|
||||
for the ESP8266.
|
||||
|
||||
Run `menuconfig` utility (`idf.py menuconfig` for ESP32 or `make menuconfig` for the ESP8266)
|
||||
and set the various parameters for the target device, along with local WiFi settings:
|
||||
|
||||
* Target Host: `CONFIG_WOLFSSL_TARGET_HOST` (The IP address of a listening server)
|
||||
* Target Port: `CONFIG_WOLFSSL_TARGET_PORT` (Typically `11111`)
|
||||
* Example WiFi SSID: `CONFIG_EXAMPLE_WIFI_SSID` (The WiFi that you want to connect to)
|
||||
* Example WiFi Password: `CONFIG_EXAMPLE_WIFI_PASSWORD` (The WiFi password)
|
||||
|
||||
The latest examples use makefiles that do not require local file copy installation of wolfSSL.
|
||||
|
||||
Build and flash the software to see the example in action.
|
||||
|
||||
## Quick Start with VisualGDB
|
||||
|
||||
There are optional [VisualGDB](https://visualgdb.com/tutorials/esp8266/) project files in the
|
||||
[VisualGDB](./VisualGDB) project subdirectory, and an ESP8266 project file in the project directory,
|
||||
called `wolfssl_client_ESP8266.vgdbproj`.
|
||||
|
||||
Open the VisualGDB Visual Studio Project file in the VisualGDB directory and click the "Start" button.
|
||||
No wolfSSL setup is needed. You may need to adjust your specific COM port. The default is `COM20`.
|
||||
No wolfSSL setup is needed. You may need to adjust your specific COM port. The default is `COM19`.
|
||||
|
||||
## ESP-IDF Commandline
|
||||
## Troubleshooting
|
||||
|
||||
Weird results, odd messages, unexpected compiler errors? Manually delete the build directory and
|
||||
any locally generated files (`sdkconfig`, `sdkconfig-debug`, etc.) and start over.
|
||||
|
||||
The `build` directory is typically located in the root of the project directory: `[project]/build`.
|
||||
|
||||
|
||||
Difficulty flashing:
|
||||
|
||||
* Ensure the target device has a robust, stable, clean power supply.
|
||||
* Check that quality USB cables are being used.
|
||||
* Try lowering the flash baud rate in the `menuconfig`. The 115200 is typically reliable.
|
||||
* Review board specifications: some require manual boot mode via on-board buttons.
|
||||
* See [Espressif ESP Frequently Asked Questions](https://docs.espressif.com/projects/esp-faq/en/latest/esp-faq-en-master.pdf)
|
||||
|
||||
## ESP-IDF Commandline v5.x
|
||||
|
||||
|
||||
1. `idf.py menuconfig` to config the project
|
||||
@@ -38,9 +76,83 @@ When you want to test the wolfSSL client
|
||||
|
||||
e.g. Launch ./examples/server/server -v 4 -b -i -d
|
||||
|
||||
|
||||
## VisualGDB for ESP8266
|
||||
|
||||
Reminder that we build with `make` and not `cmake` in VisualGDB.
|
||||
|
||||
Build files will be created in `[project directory]\build`
|
||||
|
||||
## ESP-IDF make Commandline (version 3.5 or earlier for the ESP8266)
|
||||
|
||||
```
|
||||
export IDF_PATH=~/esp/ESP8266_RTOS_SDK
|
||||
|
||||
```
|
||||
|
||||
|
||||
## ESP-IDF CMake Commandline (version 3.5 or earlier for the ESP8266)
|
||||
|
||||
Build files will be created in `[project directory]\build\debug`
|
||||
|
||||
```
|
||||
# Set your path to RTOS SDK, shown here for default from WSL with VisualGDB
|
||||
WRK_IDF_PATH=/mnt/c/SysGCC/esp8266/rtos-sdk/v3.4
|
||||
# or
|
||||
WRK_IDF_PATH=~/esp/ESP8266_RTOS_SDK
|
||||
|
||||
# Setup the environment
|
||||
. $WRK_IDF_PATH/export.sh
|
||||
|
||||
# install as needed / prompted
|
||||
/mnt/c/SysGCC/esp8266/rtos-sdk/v3.4/install.sh
|
||||
|
||||
# Fetch wolfssl from GitHub if needed:
|
||||
cd /workspace
|
||||
git clone https://github.com/wolfSSL/wolfssl.git
|
||||
|
||||
# change directory to wolfssl client example.
|
||||
cd wolfssl/IDE/Espressif/ESP-IDF/examples/wolfssl_client
|
||||
|
||||
# or for example, WSL with C:\workspace as home for git clones:
|
||||
# cd /mnt/c/workspace/wolfssl-$USER/IDE/Espressif/ESP-IDF/examples/wolfssl_client
|
||||
|
||||
# adjust settings as desired
|
||||
idf.py menuconfig
|
||||
|
||||
|
||||
idf.py build flash -p /dev/ttyS70 -b 115200
|
||||
idf.py monitor -p /dev/ttyS70 -b 74880
|
||||
```
|
||||
|
||||
## SM Ciphers
|
||||
|
||||
#### Working Linux Client to ESP32 Server
|
||||
(TODO coming soon)
|
||||
See https://github.com/wolfSSL/wolfsm
|
||||
|
||||
#### Working Linux Client to ESP32 Server Example:
|
||||
|
||||
```
|
||||
./examples/client/client -h 192.168.1.37 -p 11111 -v 3
|
||||
```
|
||||
|
||||
```text
|
||||
-c <file> Certificate file, default ./certs/client-cert.pem
|
||||
-k <file> Key file, default ./certs/client-key.pem
|
||||
-A <file> Certificate Authority file, default ./certs/ca-cert.pem
|
||||
```
|
||||
|
||||
Example client, with default certs explicitly given:
|
||||
|
||||
```bash
|
||||
./examples/client/client -h 192.168.1.37 -p 11111 -v 3 -c ./certs/client-cert.pem -k ./certs/client-key.pem -A ./certs/ca-cert.pem
|
||||
```
|
||||
|
||||
Example client, with RSA 1024 certs explicitly given:
|
||||
|
||||
```
|
||||
./examples/client/client -h 192.168.1.37 -p 11111 -v 3 -c ./certs/1024/client-cert.pem -k ./certs/1024/client-key.pem -A ./certs/1024/ca-cert.pem
|
||||
```
|
||||
|
||||
Command:
|
||||
|
||||
@@ -48,7 +160,6 @@ Command:
|
||||
cd /mnt/c/workspace/wolfssl-$USER/IDE/Espressif/ESP-IDF/examples/wolfssl_server
|
||||
. /mnt/c/SysGCC/esp32/esp-idf/v5.1/export.sh
|
||||
idf.py flash -p /dev/ttyS19 -b 115200 monitor
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
@@ -74,5 +185,33 @@ I hear you fa shizzle!
|
||||
./examples/server/server -v 3 -l ECDHE-ECDSA-SM4-CBC-SM3 -c ./certs/sm2/server-sm2.pem -k ./certs/sm2/server-sm2-priv.pem -A ./certs/sm2/client-sm2.pem -V
|
||||
```
|
||||
|
||||
See the README.md file in the upper level 'examples' directory for [more information about examples](../README.md).
|
||||
|
||||
#### Linux Client using Kyber to ESP32 Server
|
||||
|
||||
```
|
||||
# Ensure build with Kyber enabled:
|
||||
# ./configure --enable-kyber=all --enable-experimental && make
|
||||
|
||||
./examples/client/client -h 192.168.1.38 -v 4 -l TLS_AES_128_GCM_SHA256 --pqc KYBER_LEVEL5
|
||||
```
|
||||
|
||||
#### ESP32 Client to WSL Linux Server
|
||||
|
||||
In Windows Powershell, (elevated permissions) forward the port _after_ starting the listening server:
|
||||
|
||||
```bash
|
||||
netsh interface portproxy add v4tov4 listenport=11111 listenaddress=0.0.0.0 connectport=11111 connectaddress=127.0.0.1
|
||||
```
|
||||
|
||||
After the server exits, remove the port proxy forward:
|
||||
|
||||
```bash
|
||||
netsh interface portproxy delete v4tov4 listenport=11111 listenaddress=0.0.0.0
|
||||
```
|
||||
|
||||
For additional information, see [Accessing network applications with WSL](https://learn.microsoft.com/en-us/windows/wsl/networking).
|
||||
|
||||
|
||||
## Additional Information
|
||||
|
||||
See the README.md file in the upper level 'examples' directory for [more information about examples](../README.md).
|
||||
|
||||
@@ -18,6 +18,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "include", "include", "{5326
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A51226B3-88A7-4463-B443-0E321C4A3D53}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
..\..\..\..\..\..\wolfssl\wolfcrypt\error-crypt.h = ..\..\..\..\..\..\wolfssl\wolfcrypt\error-crypt.h
|
||||
..\..\..\..\..\..\wolfssl\error-ssl.h = ..\..\..\..\..\..\wolfssl\error-ssl.h
|
||||
..\main\Kconfig.projbuild = ..\main\Kconfig.projbuild
|
||||
..\build\VisualGDB\Debug\esp-idf\esp_system\ld\memory.ld = ..\build\VisualGDB\Debug\esp-idf\esp_system\ld\memory.ld
|
||||
..\..\..\..\..\..\..\my_private_config.h = ..\..\..\..\..\..\..\my_private_config.h
|
||||
..\partitions_singleapp_large.csv = ..\partitions_singleapp_large.csv
|
||||
..\README.md = ..\README.md
|
||||
@@ -25,6 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
..\build\VisualGDB\Debug\config\sdkconfig.cmake = ..\build\VisualGDB\Debug\config\sdkconfig.cmake
|
||||
..\sdkconfig.defaults = ..\sdkconfig.defaults
|
||||
..\build\VisualGDB\Debug\config\sdkconfig.h = ..\build\VisualGDB\Debug\config\sdkconfig.h
|
||||
..\build\VisualGDB\Debug\esp-idf\esp_system\ld\sections.ld = ..\build\VisualGDB\Debug\esp-idf\esp_system\ld\sections.ld
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ToolchainID>
|
||||
<ID>com.visualgdb.xtensa-esp32-elf</ID>
|
||||
<Version>
|
||||
<GCC>12.2.0</GCC>
|
||||
<GCC>13.2.0</GCC>
|
||||
<GDB>12.1</GDB>
|
||||
<Revision>1</Revision>
|
||||
</Version>
|
||||
@@ -67,8 +67,8 @@
|
||||
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
|
||||
<ESPIDFExtension>
|
||||
<IDFCheckout>
|
||||
<Version>release/v5.1</Version>
|
||||
<Subdirectory>esp-idf/v5.1</Subdirectory>
|
||||
<Version>release/v5.2</Version>
|
||||
<Subdirectory>esp-idf/v5.2</Subdirectory>
|
||||
<Type>ESPIDF</Type>
|
||||
</IDFCheckout>
|
||||
<COMPort>COM19</COMPort>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
# Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
@@ -45,6 +45,11 @@ else()
|
||||
endif()
|
||||
message(STATUS "THIS_USER = ${THIS_USER}")
|
||||
|
||||
if( "$ENV{IDF_PATH}" STREQUAL "" )
|
||||
message(FATAL_ERROR "IDF_PATH Environment variable not set!")
|
||||
else()
|
||||
string(REPLACE "\\" "/" THIS_IDF_PATH "$ENV{IDF_PATH}")
|
||||
endif()
|
||||
|
||||
# COMPONENT_NAME = wolfssl
|
||||
# The component name is the directory name. "No feature to change this".
|
||||
@@ -82,8 +87,10 @@ function(FIND_WOLFSSL_DIRECTORY OUTPUT_FOUND_WOLFSSL_DIRECTORY)
|
||||
else()
|
||||
get_filename_component(CURRENT_SEARCH_DIR "$ENV{WOLFSSL_ROOT}" ABSOLUTE)
|
||||
IS_WOLFSSL_SOURCE("${CURRENT_SEARCH_DIR}" FOUND_WOLFSSL)
|
||||
if("${FOUND_WOLFSSL}")
|
||||
message(STATUS "Found WOLFSSL_ROOT via Environment Variable:")
|
||||
if( FOUND_WOLFSSL )
|
||||
message(STATUS "Found WOLFSSL_ROOT via Environment Variable: ${CURRENT_SEARCH_DIR}")
|
||||
set(${OUTPUT_FOUND_WOLFSSL_DIRECTORY} ${CURRENT_SEARCH_DIR} PARENT_SCOPE)
|
||||
return()
|
||||
else()
|
||||
message(FATAL_ERROR "WOLFSSL_ROOT Environment Variable defined, but path not found:")
|
||||
message(STATUS "$ENV{WOLFSSL_ROOT}")
|
||||
@@ -156,8 +163,8 @@ if(CMAKE_BUILD_EARLY_EXPANSION)
|
||||
idf_component_register(
|
||||
REQUIRES "${COMPONENT_REQUIRES}"
|
||||
PRIV_REQUIRES # esp_hw_support
|
||||
esp_timer
|
||||
driver # this will typically only be needed for wolfSSL benchmark
|
||||
# esp_timer
|
||||
# driver # this will typically only be needed for wolfSSL benchmark
|
||||
)
|
||||
|
||||
else()
|
||||
@@ -361,6 +368,10 @@ else()
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/\""
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/\""
|
||||
"\"${RTOS_IDF_PATH}/\""
|
||||
# wolfSSL release after v5.7 includes WiFi, time, and mem/debug helpers
|
||||
${THIS_IDF_PATH}/components/esp_event/include
|
||||
${THIS_IDF_PATH}/components/esp_netif/include
|
||||
${THIS_IDF_PATH}/components/esp_wifi/include
|
||||
)
|
||||
|
||||
|
||||
@@ -372,7 +383,7 @@ else()
|
||||
list(APPEND COMPONENT_ADD_INCLUDEDIRS "\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/\"")
|
||||
|
||||
|
||||
|
||||
# Some files are known to be included elsewhere, or not used for Espressif
|
||||
set(COMPONENT_SRCEXCLUDE
|
||||
"\"${WOLFSSL_ROOT}/src/bio.c\""
|
||||
"\"${WOLFSSL_ROOT}/src/conf.c\""
|
||||
@@ -382,9 +393,14 @@ else()
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_bn.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_certman.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_crypto.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_load.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_misc.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_p7p12.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/ssl_sess.c\"" # included by ssl.c
|
||||
"\"${WOLFSSL_ROOT}/src/x509.c\""
|
||||
"\"${WOLFSSL_ROOT}/src/x509_str.c\""
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/ext_kyber.c\"" # external Kyber disabled by default
|
||||
"\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/ext_kyber.h\"" # external Kyber disabled by default
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/evp.c\""
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/misc.c\""
|
||||
"\"${WOLFSSL_ROOT}/wolfcrypt/src/sp_sm2_arm32.c\""
|
||||
|
||||
@@ -1,40 +1,250 @@
|
||||
#
|
||||
# Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
# wolfSSL is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# wolfSSL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
#
|
||||
#
|
||||
# Component Makefile
|
||||
#
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS := . ./include
|
||||
|
||||
COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/components/freertos/include/freertos"
|
||||
# COMPONENT_ADD_INCLUDEDIRS += "$ENV{IDF_PATH}/soc/esp32s3/include/soc"
|
||||
|
||||
COMPONENT_SRCDIRS := src wolfcrypt/src
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
|
||||
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
|
||||
COMPONENT_SRCDIRS += wolfcrypt/benchmark
|
||||
COMPONENT_SRCDIRS += wolfcrypt/test
|
||||
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
||||
|
||||
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
|
||||
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJEXCLUDE += src/bio.o
|
||||
#
|
||||
# Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
#
|
||||
# This file is part of wolfSSL.
|
||||
#
|
||||
# wolfSSL is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# wolfSSL is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
#
|
||||
|
||||
#
|
||||
# Component Makefile
|
||||
#
|
||||
#
|
||||
# The Espressif Managed Components are only for newer versions of the ESP-IDF
|
||||
# Typically only for ESP32[-x] targets and only for ESP-IDF v4.3 or later:
|
||||
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html
|
||||
# https://components.espressif.com/
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# make flash
|
||||
#
|
||||
# make flash ESPPORT=/dev/ttyS55
|
||||
#
|
||||
# make flash ESPBAUD=9600
|
||||
#
|
||||
# make monitor ESPPORT=COM1
|
||||
#
|
||||
# make monitor ESPPORT=/dev/ttyS55 MONITORBAUD=115200
|
||||
#
|
||||
# export ESPPORT=/dev/ttyS55
|
||||
#
|
||||
# https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/index.html
|
||||
#
|
||||
|
||||
# Although the project should define WOLFSSL_USER_SETTINGS, we'll also
|
||||
# define it here:
|
||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
||||
|
||||
# NOTICE: the WOLFSSL_ROOT setting MUST be relative!
|
||||
# See https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/api-guides/build-system.html?highlight=must+relative#optional-component-specific-variables
|
||||
# In the wolfSSL GitHub examples for Espressif:
|
||||
# https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples
|
||||
# When this wolfssl component.mk makefile is in [project]/components/wolfssl
|
||||
# The root is 7 directories up from here:
|
||||
WOLFSSL_ROOT := ../../../../../../..
|
||||
|
||||
# NOTE: The wolfSSL include directory (e.g. user_settings.h) is
|
||||
# located HERE in THIS project, and *not* in the wolfSSL root.
|
||||
COMPONENT_ADD_INCLUDEDIRS := .
|
||||
COMPONENT_ADD_INCLUDEDIRS += include
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/.
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt/port/Espressif
|
||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)wolfssl/wolfcrypt/port/Espressif
|
||||
# COMPONENT_ADD_INCLUDEDIRS += $ENV(IDF_PATH)/components/freertos/include/freertos
|
||||
# COMPONENT_ADD_INCLUDEDIRS += "$ENV(IDF_PATH)/soc/esp32s3/include/soc"
|
||||
|
||||
# wolfSSL
|
||||
COMPONENT_SRCDIRS := $(WOLFSSL_ROOT)/src
|
||||
|
||||
# wolfcrypt
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/src
|
||||
|
||||
# Espressif
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/atmel
|
||||
|
||||
COMPONENT_OBJEXCLUDE := $(WOLFSSL_ROOT)/wolfcrypt/src/aes_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/evp.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/sha512_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_x25519_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/aes_gcm_x86_asm.o
|
||||
COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/src/bio.o
|
||||
|
||||
|
||||
##
|
||||
## wolfSSL
|
||||
##
|
||||
COMPONENT_OBJS := $(WOLFSSL_ROOT)/src/bio.o
|
||||
# COMPONENT_OBJS += src/conf.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/crl.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/dtls.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/dtls13.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/internal.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/keys.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/ocsp.o
|
||||
# COMPONENT_OBJS += src/pk.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/quic.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/sniffer.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/ssl.o
|
||||
# COMPONENT_OBJS += src/ssl_asn1.o
|
||||
# COMPONENT_OBJS += src/ssl_bn.o
|
||||
# COMPONENT_OBJS += src/ssl_certman.o
|
||||
# COMPONENT_OBJS += src/ssl_crypto.o
|
||||
# COMPONENT_OBJS += src/ssl_misc.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/tls.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/tls13.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/wolfio.o
|
||||
# COMPONENT_OBJS += src/x509.o
|
||||
# COMPONENT_OBJS += src/x509_str.o
|
||||
|
||||
##
|
||||
## wolfcrypt
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2b.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2s.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/camellia.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/chacha.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/chacha20_poly1305.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/cmac.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/coding.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/compress.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/cpuid.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/cryptocb.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/curve25519.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/curve448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/des3.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/dh.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/dilithium.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/dsa.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ecc.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/eccsi.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ecc_fp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ed25519.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ed448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/error.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/evp.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ext_kyber.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_lms.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_xmss.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/falcon.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_low_mem.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_operations.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fips.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fips_test.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ge_448.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ge_low_mem.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ge_operations.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/hash.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/hmac.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/hpke.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/integer.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/kdf.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/logging.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/md2.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/md4.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/md5.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/memory.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/misc.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/pkcs12.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/pkcs7.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/poly1305.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/pwdbased.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/random.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/rc2.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ripemd.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/rsa.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sakke.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/selftest.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha256.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha3.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha512.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/signature.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/siphash.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sm2.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sm3.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sm4.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sphincs.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_arm32.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_arm64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_armthumb.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_c32.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_c64.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_cortexm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_dsp32.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_int.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_arm32.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_arm64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_armthumb.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_c32.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_c64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_cortexm.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_x86_64.o
|
||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_x86_64.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/srp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/tfm.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_dsp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_encrypt.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_kyber.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_kyber_poly.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_lms.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_pkcs11.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_port.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_xmss.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_first.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_last.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfevent.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfmath.o
|
||||
|
||||
##
|
||||
## Espressif
|
||||
##
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_aes.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_mp.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_sha.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_util.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp_sdk_mem_lib.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp_sdk_time_lib.o
|
||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp_sdk_wifi_lib.o
|
||||
|
||||
##
|
||||
## wolfcrypt benchmark (optional)
|
||||
##
|
||||
## COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/benchmark/benchmark.o
|
||||
## COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/benchmark
|
||||
## COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfcrypt/benchmark
|
||||
|
||||
|
||||
##
|
||||
## wolfcrypt test (optional)
|
||||
##
|
||||
## COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/test/test.o
|
||||
## COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/test
|
||||
|
||||
##
|
||||
## wolfcrypt
|
||||
##
|
||||
# COMPONENT_PRIV_INCLUDEDIRS += $(PROJECT_PATH)/components/wolfssl/include
|
||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/src
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -19,12 +19,37 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
/* Standardized wolfSSL Espressif ESP32 + ESP8266 user_settings.h V5.6.6-01 */
|
||||
|
||||
/* This user_settings.h is for Espressif ESP-IDF */
|
||||
#include <sdkconfig.h>
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/* #define DEBUG_WOLFSSL */
|
||||
/* #define DEBUG_WOLFSSL_VERBOSE */
|
||||
|
||||
/* Experimental Kyber */
|
||||
#if 0
|
||||
#define WOLFSSL_EXPERIMENTAL_SETTINGS
|
||||
#define WOLFSSL_HAVE_KYBER
|
||||
#define WOLFSSL_WC_KYBER
|
||||
#define WOLFSSL_SHA3
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
/* With limited RAM, we'll disable some of the Kyber sizes: */
|
||||
#define WOLFSSL_NO_KYBER1024
|
||||
#define WOLFSSL_NO_KYBER768
|
||||
#define NO_SESSION_CACHE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Pick a cert buffer size: */
|
||||
/* #define USE_CERT_BUFFERS_2048 */
|
||||
/* #define USE_CERT_BUFFERS_1024 */
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
/* The Espressif sdkconfig will have chipset info.
|
||||
**
|
||||
** Possible values:
|
||||
** Some possible values:
|
||||
**
|
||||
** CONFIG_IDF_TARGET_ESP32
|
||||
** CONFIG_IDF_TARGET_ESP32S2
|
||||
@@ -36,18 +61,34 @@
|
||||
#undef WOLFSSL_ESPIDF
|
||||
#define WOLFSSL_ESPIDF
|
||||
|
||||
/* We don't use WiFi helpers yet, so don't compile in the esp-sdk-lib WiFi */
|
||||
#define NO_ESP_SDK_WIFI
|
||||
|
||||
/*
|
||||
* choose ONE of these Espressif chips to define:
|
||||
* ONE of these Espressif chipsets should be defined:
|
||||
*
|
||||
* WOLFSSL_ESP32
|
||||
* WOLFSSL_ESPWROOM32SE
|
||||
* WOLFSSL_ESP8266
|
||||
*
|
||||
* following ifdef detection only for syntax highlighting:
|
||||
*/
|
||||
#undef WOLFSSL_ESPWROOM32SE
|
||||
#undef WOLFSSL_ESP8266
|
||||
#undef WOLFSSL_ESP32
|
||||
#ifdef WOLFSSL_ESPWROOM32SE
|
||||
#undef WOLFSSL_ESPWROOM32SE
|
||||
#endif
|
||||
#ifdef WOLFSSL_ESP8266
|
||||
#undef WOLFSSL_ESP8266
|
||||
#endif
|
||||
#ifdef WOLFSSL_ESP32
|
||||
#undef WOLFSSL_ESP32
|
||||
#endif
|
||||
/* See below for chipset detection from sdkconfig.h */
|
||||
|
||||
#define WOLFSSL_ESP32
|
||||
/* Small session cache saves a lot of RAM for ClientCache and SessionCache.
|
||||
* Memory requirement is about 5KB, otherwise 20K is needed when not specified.
|
||||
* If extra small footprint is needed, try MICRO_SESSION_CACHE (< 1K)
|
||||
* When really desperate, try NO_SESSION_CACHE. */
|
||||
#define MICRO_SESSION_CACHE
|
||||
|
||||
/* optionally turn off SHA512/224 SHA512/256 */
|
||||
/* #define WOLFSSL_NOSHA512_224 */
|
||||
@@ -61,7 +102,10 @@
|
||||
/* #define NO_OLD_TLS */
|
||||
|
||||
#define BENCH_EMBEDDED
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
|
||||
#define WOLFSSL_SMALL_STACK
|
||||
#define HAVE_ECC
|
||||
#define RSA_LOW_MEM
|
||||
|
||||
/* TLS 1.3 */
|
||||
#define WOLFSSL_TLS13
|
||||
@@ -79,39 +123,45 @@
|
||||
|
||||
#define HAVE_AESGCM
|
||||
|
||||
#define WOLFSSL_RIPEMD
|
||||
/* Optional RIPEMD: RACE Integrity Primitives Evaluation Message Digest */
|
||||
/* #define WOLFSSL_RIPEMD */
|
||||
|
||||
/* when you want to use SHA224 */
|
||||
#define WOLFSSL_SHA224
|
||||
|
||||
/* when you want to use SHA384 */
|
||||
#define WOLFSSL_SHA384
|
||||
|
||||
/* when you want to use SHA512 */
|
||||
#define WOLFSSL_SHA512
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
/* Some known low-memory devices have features not enabled by default. */
|
||||
#else
|
||||
/* when you want to use SHA512 */
|
||||
#define WOLFSSL_SHA512
|
||||
|
||||
/* when you want to use SHA3 */
|
||||
#define WOLFSSL_SHA3
|
||||
/* when you want to use SHA3 */
|
||||
#define WOLFSSL_SHA3
|
||||
|
||||
#define HAVE_ED25519 /* ED25519 requires SHA512 */
|
||||
/* ED25519 requires SHA512 */
|
||||
#define HAVE_ED25519
|
||||
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
#define HAVE_ED25519
|
||||
#define HAVE_ECC
|
||||
#define HAVE_CURVE25519
|
||||
#define CURVE25519_SMALL
|
||||
#define HAVE_ED25519
|
||||
#endif
|
||||
|
||||
/* Optional OpenSSL compatibility */
|
||||
/* #define OPENSSL_EXTRA */
|
||||
|
||||
#define OPENSSL_EXTRA
|
||||
/* when you want to use pkcs7 */
|
||||
/* #define HAVE_PKCS7 */
|
||||
|
||||
#define HAVE_PKCS7
|
||||
|
||||
#if defined(HAVE_PKCS7)
|
||||
#define HAVE_AES_KEYWRAP
|
||||
#define HAVE_X963_KDF
|
||||
#define WOLFSSL_AES_DIRECT
|
||||
#endif
|
||||
|
||||
/* when you want to use aes counter mode */
|
||||
/* when you want to use AES counter mode */
|
||||
/* #define WOLFSSL_AES_DIRECT */
|
||||
/* #define WOLFSSL_AES_COUNTER */
|
||||
|
||||
@@ -125,7 +175,7 @@
|
||||
/* #define CUSTOM_SLOT_ALLOCATION */
|
||||
#endif
|
||||
|
||||
/* rsa primitive specific definition */
|
||||
/* RSA primitive specific definition */
|
||||
#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE)
|
||||
/* Define USE_FAST_MATH and SMALL_STACK */
|
||||
#define ESP32_USE_RSA_PRIMITIVE
|
||||
@@ -145,8 +195,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define RSA_LOW_MEM
|
||||
|
||||
/* #define WOLFSSL_ATECC508A_DEBUG */
|
||||
|
||||
/* date/time */
|
||||
@@ -173,14 +221,12 @@
|
||||
/* #undef USE_FAST_MATH */
|
||||
/* #define USE_INTEGER_HEAP_MATH */
|
||||
|
||||
|
||||
#define WOLFSSL_SMALL_STACK
|
||||
|
||||
|
||||
#define HAVE_VERSION_EXTENDED_INFO
|
||||
/* #define HAVE_WC_INTROSPECTION */
|
||||
|
||||
#define HAVE_SESSION_TICKET
|
||||
#ifndef NO_SESSION_CACHE
|
||||
#define HAVE_SESSION_TICKET
|
||||
#endif
|
||||
|
||||
/* #define HAVE_HASHDRBG */
|
||||
|
||||
@@ -190,7 +236,6 @@
|
||||
#define WOLFSSL_CERT_EXT
|
||||
#define WOLFSSL_SYS_CA_CERTS
|
||||
|
||||
|
||||
#define WOLFSSL_CERT_TEXT
|
||||
|
||||
#define WOLFSSL_ASN_TEMPLATE
|
||||
@@ -203,7 +248,7 @@
|
||||
#undef WOLFSSL_SYS_CA_CERTS
|
||||
*/
|
||||
|
||||
/*
|
||||
/* command-line options
|
||||
--enable-keygen
|
||||
--enable-certgen
|
||||
--enable-certreq
|
||||
@@ -211,10 +256,11 @@
|
||||
--enable-asn-template
|
||||
*/
|
||||
|
||||
/* Default is HW enabled unless turned off.
|
||||
** Uncomment these lines to force SW instead of HW acceleration */
|
||||
|
||||
/* Chipset detection from sdkconfig.h
|
||||
* Default is HW enabled unless turned off.
|
||||
* Uncomment lines to force SW instead of HW acceleration */
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -232,6 +278,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-S2. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -244,6 +291,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32S2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-S3. Uncomment to disable: */
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_HASH */
|
||||
@@ -257,6 +305,7 @@
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C2) || \
|
||||
defined(CONFIG_IDF_TARGET_ESP8684)
|
||||
#define WOLFSSL_ESP32
|
||||
/* ESP8684 is essentially ESP32-C2 chip + flash embedded together in a
|
||||
* single QFN 4x4 mm package. Out of released documentation, Technical
|
||||
* Reference Manual as well as ESP-IDF Programming Guide is applicable
|
||||
@@ -282,6 +331,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-C3. Uncomment to disable: */
|
||||
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
@@ -299,6 +349,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C3 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL HW Acceleration supported on ESP32-C6. Uncomment to disable: */
|
||||
|
||||
/* #define NO_ESP32_CRYPT */
|
||||
@@ -315,6 +366,7 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32C6 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
#define WOLFSSL_ESP32
|
||||
/* wolfSSL Hardware Acceleration not yet implemented */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
@@ -323,15 +375,28 @@
|
||||
/***** END CONFIG_IDF_TARGET_ESP32H2 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
/* TODO: Revisit ESP8266 */
|
||||
#define WOLFSSL_ESP8266
|
||||
|
||||
/* There's no hardware encryption on the ESP8266 */
|
||||
/* Consider using the ESP32-C2/C3/C6
|
||||
* See https://www.espressif.com/en/products/socs/esp32-c2 */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI
|
||||
/***** END CONFIG_IDF_TARGET_ESP266 *****/
|
||||
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP8684)
|
||||
/* There's no Hardware Acceleration available on ESP8684 */
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI
|
||||
/***** END CONFIG_IDF_TARGET_ESP8684 *****/
|
||||
|
||||
#else
|
||||
/* Anything else encountered, disable HW accleration */
|
||||
#warning "Unexpected CONFIG_IDF_TARGET_NN value"
|
||||
#define NO_ESP32_CRYPT
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_HASH
|
||||
#define NO_WOLFSSL_ESP32_CRYPT_AES
|
||||
@@ -339,6 +404,7 @@
|
||||
#endif /* CONFIG_IDF_TARGET Check */
|
||||
|
||||
/* Debug options:
|
||||
See wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h for details on debug options
|
||||
|
||||
#define ESP_VERIFY_MEMBLOCK
|
||||
#define DEBUG_WOLFSSL
|
||||
@@ -359,7 +425,7 @@
|
||||
|
||||
/* #define HASH_SIZE_LIMIT */ /* for test.c */
|
||||
|
||||
/* #define NO_HW_MATH_TEST */ /* Optionall turn off HW math checks */
|
||||
/* #define NO_HW_MATH_TEST */ /* Optionally turn off HW math checks */
|
||||
|
||||
/* Optionally include alternate HW test library: alt_hw_test.h */
|
||||
/* When enabling, the ./components/wolfssl/CMakeLists.txt file
|
||||
@@ -382,8 +448,8 @@
|
||||
/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */
|
||||
|
||||
|
||||
#define WOLFSSL_PUBLIC_MP /* used by benchmark */
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
/* used by benchmark: */
|
||||
#define WOLFSSL_PUBLIC_MP
|
||||
|
||||
/* when turning on ECC508 / ECC608 support
|
||||
#define WOLFSSL_ESPWROOM32SE
|
||||
@@ -392,12 +458,75 @@
|
||||
#define ATCA_WOLFSSL
|
||||
*/
|
||||
|
||||
/* optional SM4 Ciphers. See https://github.com/wolfSSL/wolfsm
|
||||
/***************************** Certificate Macros *****************************
|
||||
*
|
||||
* The section below defines macros used in typically all of the wolfSSL
|
||||
* examples such as the client and server for certs stored in header files.
|
||||
*
|
||||
* There are various certificate examples in this header file:
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/certs_test.h
|
||||
*
|
||||
* To use the sets of macros below, define *one* of these:
|
||||
*
|
||||
* USE_CERT_BUFFERS_1024 - ECC 1024 bit encoded ASN1
|
||||
* USE_CERT_BUFFERS_2048 - RSA 2048 bit encoded ASN1
|
||||
* WOLFSSL_SM[2,3,4] - SM Ciphers
|
||||
*
|
||||
* For example: define USE_CERT_BUFFERS_2048 to use CA Certs used in this
|
||||
* wolfSSL function for the `ca_cert_der_2048` buffer, size and types:
|
||||
*
|
||||
* ret = wolfSSL_CTX_load_verify_buffer(ctx,
|
||||
* CTX_CA_CERT,
|
||||
* CTX_CA_CERT_SIZE,
|
||||
* CTX_CA_CERT_TYPE);
|
||||
*
|
||||
* See https://www.wolfssl.com/documentation/manuals/wolfssl/group__CertsKeys.html#function-wolfssl_ctx_load_verify_buffer
|
||||
*
|
||||
* In this case the CTX_CA_CERT will be defined as `ca_cert_der_2048` as
|
||||
* defined here: https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/certs_test.h
|
||||
*
|
||||
* The CTX_CA_CERT_SIZE and CTX_CA_CERT_TYPE are similarly used to reference
|
||||
* array size and cert type respectively.
|
||||
*
|
||||
* Similarly for loading the private client key:
|
||||
*
|
||||
* ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
|
||||
* CTX_CLIENT_KEY,
|
||||
* CTX_CLIENT_KEY_SIZE,
|
||||
* CTX_CLIENT_KEY_TYPE);
|
||||
*
|
||||
* see https://www.wolfssl.com/documentation/manuals/wolfssl/group__CertsKeys.html#function-wolfssl_ctx_use_privatekey_buffer
|
||||
*
|
||||
* Similarly, the other macros are for server certificates and keys:
|
||||
* `CTX_SERVER_CERT` and `CTX_SERVER_KEY` are available.
|
||||
*
|
||||
* The certificate and key names are typically `static const unsigned char`
|
||||
* arrays. The [NAME]_size are typically `sizeof([array name])`, and the types
|
||||
* are the known wolfSSL encoding type integers (e.g. WOLFSSL_FILETYPE_PEM).
|
||||
*
|
||||
* See `SSL_FILETYPE_[name]` in
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/ssl.h
|
||||
*
|
||||
* See Abstract Syntax Notation One (ASN.1) in:
|
||||
* https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/wolfcrypt/asn.h
|
||||
*
|
||||
* Optional SM4 Ciphers:
|
||||
*
|
||||
* Although the SM ciphers are shown here, the `certs_test_sm.h` may not yet
|
||||
* be available. See:
|
||||
* https://github.com/wolfSSL/wolfssl/pull/6825
|
||||
* https://github.com/wolfSSL/wolfsm
|
||||
*
|
||||
* Uncomment these 3 macros to enable the SM Ciphers and use the macros below.
|
||||
*/
|
||||
|
||||
/*
|
||||
#define WOLFSSL_SM2
|
||||
#define WOLFSSL_SM3
|
||||
#define WOLFSSL_SM4
|
||||
*/
|
||||
|
||||
/* Conditional macros used in wolfSSL TLS client and server examples */
|
||||
#if defined(WOLFSSL_SM2) || defined(WOLFSSL_SM3) || defined(WOLFSSL_SM4)
|
||||
#include <wolfssl/certs_test_sm.h>
|
||||
#define CTX_CA_CERT root_sm2
|
||||
@@ -413,15 +542,45 @@
|
||||
#undef WOLFSSL_BASE16
|
||||
#define WOLFSSL_BASE16
|
||||
#else
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#define USE_CERT_BUFFERS_256
|
||||
#define CTX_CA_CERT ca_cert_der_2048
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_CERT server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_2048
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_2048
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#endif
|
||||
#if defined(USE_CERT_BUFFERS_2048)
|
||||
#define CTX_CA_CERT ca_cert_der_2048
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_SERVER_CERT server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_2048
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_2048
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_2048
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_CLIENT_CERT client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_KEY client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#elif defined(USE_CERT_BUFFERS_1024)
|
||||
#define CTX_CA_CERT ca_cert_der_1024
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_1024
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_CLIENT_CERT client_cert_der_1024
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_cert_der_1024
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_KEY client_key_der_1024
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_key_der_1024
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
|
||||
#define CTX_SERVER_CERT server_cert_der_1024
|
||||
#define CTX_SERVER_CERT_SIZE sizeof_server_cert_der_1024
|
||||
#define CTX_SERVER_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_SERVER_KEY server_key_der_1024
|
||||
#define CTX_SERVER_KEY_SIZE sizeof_server_key_der_1024
|
||||
#define CTX_SERVER_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#else
|
||||
/* Optionally define custom cert arrays, sizes, and types here */
|
||||
#error "Must define USE_CERT_BUFFERS_2048 or USE_CERT_BUFFERS_1024"
|
||||
#endif
|
||||
#endif /* Conditional key and cert constant names */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* client-tls.c
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -18,7 +18,6 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
#include "client-tls.h"
|
||||
|
||||
/* Espressif FreeRTOS */
|
||||
@@ -28,15 +27,24 @@
|
||||
#include <freertos/event_groups.h>
|
||||
#endif
|
||||
|
||||
/* Espressif */
|
||||
#include <esp_log.h>
|
||||
|
||||
/* socket includes */
|
||||
#include <lwip/netdb.h>
|
||||
#include <lwip/sockets.h>
|
||||
|
||||
/* wolfSSL */
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include "user_settings.h"
|
||||
#include <wolfssl/ssl.h>
|
||||
|
||||
#if defined(WOLFSSL_WC_KYBER)
|
||||
#include <wolfssl/wolfcrypt/kyber.h>
|
||||
#include <wolfssl/wolfcrypt/wc_kyber.h>
|
||||
#endif
|
||||
#if defined(USE_CERT_BUFFERS_2048) || defined(USE_CERT_BUFFERS_1024)
|
||||
#include <wolfssl/certs_test.h>
|
||||
#endif
|
||||
#ifdef WOLFSSL_TRACK_MEMORY
|
||||
#include <wolfssl/wolfcrypt/mem_track.h>
|
||||
#endif
|
||||
@@ -50,30 +58,6 @@
|
||||
#define DEFAULT_MAX_DHKEY_BITS 2048
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_SM2) || defined(WOLFSSL_SM3) || defined(WOLFSSL_SM4)
|
||||
#include <wolfssl/certs_test_sm.h>
|
||||
#define CTX_CA_CERT root_sm2
|
||||
#define CTX_CA_CERT_SIZE sizeof_root_sm2
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_PEM
|
||||
#define CTX_CLIENT_CERT client_sm2
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_sm2
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_PEM
|
||||
#define CTX_CLIENT_KEY client_sm2_priv
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_sm2_priv
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_PEM
|
||||
#else
|
||||
#include <wolfssl/certs_test.h>
|
||||
#define CTX_CA_CERT ca_cert_der_2048
|
||||
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
|
||||
#define CTX_CA_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_CERT client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_SIZE sizeof_client_cert_der_2048
|
||||
#define CTX_CLIENT_CERT_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#define CTX_CLIENT_KEY client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_SIZE sizeof_client_key_der_2048
|
||||
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1
|
||||
#endif
|
||||
|
||||
/* Project */
|
||||
#include "wifi_connect.h"
|
||||
#include "time_helper.h"
|
||||
@@ -87,7 +71,7 @@
|
||||
* -h 192.168.1.128 -v 4 -l TLS13-SM4-CCM-SM3 -c ./certs/sm2/client-sm2.pem -k ./certs/sm2/client-sm2-priv.pem -A ./certs/sm2/root-sm2.pem -C
|
||||
*
|
||||
**/
|
||||
static const char* const TAG = "tls_client";
|
||||
#define TAG "client-tls"
|
||||
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
int stack_start = -1;
|
||||
@@ -203,18 +187,23 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
struct hostent *hp;
|
||||
struct ip4_addr *ip4_addr;
|
||||
int ret_i; /* interim return values */
|
||||
int err; /* interim return values */
|
||||
int sockfd;
|
||||
int doPeerCheck;
|
||||
int sendGet;
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
int this_heap = 0;
|
||||
#endif
|
||||
#ifndef NO_DH
|
||||
int minDhKeyBits = DEFAULT_MIN_DHKEY_BITS;
|
||||
#endif
|
||||
size_t len;
|
||||
|
||||
/* declare wolfSSL objects */
|
||||
WOLFSSL_CTX* ctx;
|
||||
WOLFSSL* ssl;
|
||||
|
||||
size_t len;
|
||||
|
||||
wolfSSL_Debugging_ON();
|
||||
WOLFSSL_ENTER(TLS_SMP_CLIENT_TASK_NAME);
|
||||
|
||||
@@ -264,29 +253,29 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
*
|
||||
* reference code for SM Ciphers:
|
||||
*
|
||||
#if defined(HAVE_AESGCM) && !defined(NO_DH)
|
||||
#ifdef WOLFSSL_TLS13
|
||||
defaultCipherList = "TLS13-AES128-GCM-SHA256"
|
||||
#ifndef WOLFSSL_NO_TLS12
|
||||
":DHE-PSK-AES128-GCM-SHA256"
|
||||
#endif
|
||||
;
|
||||
#else
|
||||
defaultCipherList = "DHE-PSK-AES128-GCM-SHA256";
|
||||
#if defined(HAVE_AESGCM) && !defined(NO_DH)
|
||||
#ifdef WOLFSSL_TLS13
|
||||
defaultCipherList = "TLS13-AES128-GCM-SHA256"
|
||||
#ifndef WOLFSSL_NO_TLS12
|
||||
":DHE-PSK-AES128-GCM-SHA256"
|
||||
#endif
|
||||
#elif defined(HAVE_AESGCM) && defined(WOLFSSL_TLS13)
|
||||
defaultCipherList = "TLS13-AES128-GCM-SHA256:PSK-AES128-GCM-SHA256"
|
||||
#ifndef WOLFSSL_NO_TLS12
|
||||
":PSK-AES128-GCM-SHA256"
|
||||
#endif
|
||||
;
|
||||
#elif defined(HAVE_NULL_CIPHER)
|
||||
defaultCipherList = "PSK-NULL-SHA256";
|
||||
#elif !defined(NO_AES_CBC)
|
||||
defaultCipherList = "PSK-AES128-CBC-SHA256";
|
||||
;
|
||||
#else
|
||||
defaultCipherList = "PSK-AES128-GCM-SHA256";
|
||||
defaultCipherList = "DHE-PSK-AES128-GCM-SHA256";
|
||||
#endif
|
||||
#elif defined(HAVE_AESGCM) && defined(WOLFSSL_TLS13)
|
||||
defaultCipherList = "TLS13-AES128-GCM-SHA256:PSK-AES128-GCM-SHA256"
|
||||
#ifndef WOLFSSL_NO_TLS12
|
||||
":PSK-AES128-GCM-SHA256"
|
||||
#endif
|
||||
;
|
||||
#elif defined(HAVE_NULL_CIPHER)
|
||||
defaultCipherList = "PSK-NULL-SHA256";
|
||||
#elif !defined(NO_AES_CBC)
|
||||
defaultCipherList = "PSK-AES128-CBC-SHA256";
|
||||
#else
|
||||
defaultCipherList = "PSK-AES128-GCM-SHA256";
|
||||
#endif
|
||||
*/
|
||||
|
||||
ret = wolfSSL_CTX_set_cipher_list(ctx, WOLFSSL_ESP32_CIPHER_SUITE);
|
||||
@@ -294,22 +283,22 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
ESP_LOGI(TAG, "Set cipher list: %s\n", WOLFSSL_ESP32_CIPHER_SUITE);
|
||||
}
|
||||
else {
|
||||
ESP_LOGE(TAG, "ERROR: failed to set cipher list: %s\n", WOLFSSL_ESP32_CIPHER_SUITE);
|
||||
ESP_LOGE(TAG, "ERROR: failed to set cipher list: %s\n",
|
||||
WOLFSSL_ESP32_CIPHER_SUITE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
ShowCiphers(NULL);
|
||||
ESP_LOGI(TAG,
|
||||
"Stack used: %d\n",
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
- uxTaskGetStackHighWaterMark(NULL));
|
||||
ESP_LOGI(TAG, "Stack used: %d\n",
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
- uxTaskGetStackHighWaterMark(NULL));
|
||||
#endif
|
||||
|
||||
/* see user_settings PROJECT_DH for HAVE_DH and HAVE_FFDHE_2048 */
|
||||
#ifndef NO_DH
|
||||
ret = wolfSSL_CTX_SetMinDhKey_Sz(ctx, (word16)minDhKeyBits);
|
||||
if (ret != SSL_SUCCESS) {
|
||||
if (ret != WOLFSSL_SUCCESS) {
|
||||
ESP_LOGE(TAG, "Error setting minimum DH key size");
|
||||
}
|
||||
#endif
|
||||
@@ -327,23 +316,28 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
CTX_CLIENT_CERT,
|
||||
CTX_CLIENT_CERT_SIZE,
|
||||
CTX_CLIENT_CERT_TYPE);
|
||||
if (ret_i != SSL_SUCCESS) {
|
||||
ESP_LOGE(TAG, "ERROR: failed to load chain %d, please check the file.\n", ret_i);
|
||||
if (ret_i != WOLFSSL_SUCCESS) {
|
||||
ESP_LOGE(TAG, "ERROR: failed to load our cert chain %d, "
|
||||
"please check the file.", ret_i);
|
||||
}
|
||||
|
||||
/* Load client certificates into WOLFSSL_CTX */
|
||||
WOLFSSL_MSG("Loading...cert");
|
||||
ret_i = wolfSSL_CTX_load_verify_buffer(ctx,
|
||||
/* Load client certificates into WOLFSSL_CTX */
|
||||
WOLFSSL_MSG("Loading... CA cert");
|
||||
ret_i = wolfSSL_CTX_load_verify_buffer(ctx,
|
||||
CTX_CA_CERT,
|
||||
CTX_CA_CERT_SIZE,
|
||||
CTX_CA_CERT_TYPE);
|
||||
if (ret_i != WOLFSSL_SUCCESS) {
|
||||
ESP_LOGE(TAG, "ERROR: failed to load CA cert %d, "
|
||||
"please check the file.\n", ret_i) ;
|
||||
}
|
||||
|
||||
WOLFSSL_MSG("Loading... our key");
|
||||
ret_i = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
|
||||
CTX_CLIENT_KEY,
|
||||
CTX_CLIENT_KEY_SIZE,
|
||||
CTX_CLIENT_KEY_TYPE);
|
||||
if(ret_i != SSL_SUCCESS) {
|
||||
wolfSSL_CTX_free(ctx) ; ctx = NULL ;
|
||||
if (ret_i != WOLFSSL_SUCCESS) {
|
||||
ESP_LOGE(TAG, "ERROR: failed to load key %d, "
|
||||
"please check the file.\n", ret_i) ;
|
||||
}
|
||||
@@ -373,11 +367,10 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
|
||||
/* Connect to the server */
|
||||
sprintf(buff,
|
||||
"Connecting to server....%s(port:%d)",
|
||||
"Connecting to server....%s (port:%d)",
|
||||
TLS_SMP_TARGET_HOST,
|
||||
TLS_SMP_DEFAULT_PORT);
|
||||
WOLFSSL_MSG(buff);
|
||||
printf("%s\n", buff);
|
||||
ESP_LOGI(TAG, "%s\n", buff);
|
||||
|
||||
if ((ret_i = connect(sockfd,
|
||||
(struct sockaddr *)&servAddr,
|
||||
@@ -385,6 +378,10 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
ESP_LOGE(TAG, "ERROR: failed to connect ret=%d\n", ret_i);
|
||||
}
|
||||
|
||||
#if defined(WOLFSSL_EXPERIMENTAL_SETTINGS)
|
||||
ESP_LOGW(TAG, "WOLFSSL_EXPERIMENTAL_SETTINGS is enabled");
|
||||
#endif
|
||||
|
||||
WOLFSSL_MSG("Create a WOLFSSL object");
|
||||
/* Create a WOLFSSL object */
|
||||
if ((ssl = wolfSSL_new(ctx)) == NULL) {
|
||||
@@ -394,6 +391,36 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
ESP_LOGI(TAG, "\nCreated WOLFSSL object:");
|
||||
ShowCiphers(ssl);
|
||||
this_heap = esp_get_free_heap_size();
|
||||
ESP_LOGI(TAG, "tls_smp_client_task heap @ %p = %d",
|
||||
&this_heap, this_heap);
|
||||
#endif
|
||||
#if defined(WOLFSSL_HAVE_KYBER)
|
||||
#if defined(WOLFSSL_KYBER1024)
|
||||
ESP_LOGI(TAG, "WOLFSSL_HAVE_KYBER is enabled, setting key share: "
|
||||
"WOLFSSL_P256_KYBER_LEVEL5");
|
||||
ret_i = wolfSSL_UseKeyShare(ssl, WOLFSSL_P521_KYBER_LEVEL5);
|
||||
#elif defined(WOLFSSL_KYBER768)
|
||||
ESP_LOGI(TAG, "WOLFSSL_HAVE_KYBER is enabled, setting key share: "
|
||||
"WOLFSSL_P256_KYBER_LEVEL3");
|
||||
ret_i = wolfSSL_UseKeyShare(ssl, WOLFSSL_P256_KYBER_LEVEL3);
|
||||
#elif defined(WOLFSSL_KYBER512)
|
||||
/* This will typically be a low memory situation, such as ESP8266 */
|
||||
ESP_LOGI(TAG, "WOLFSSL_HAVE_KYBER is enabled, setting key share: "
|
||||
"WOLFSSL_P256_KYBER_LEVEL1");
|
||||
ret_i = wolfSSL_UseKeyShare(ssl, WOLFSSL_P256_KYBER_LEVEL1);
|
||||
#else
|
||||
ESP_LOGW(TAG, "WOLFSSL_HAVE_KYBER enabled but no key size available.");
|
||||
ret_i = ESP_FAIL;
|
||||
#endif
|
||||
if (ret_i == WOLFSSL_SUCCESS) {
|
||||
ESP_LOGI(TAG, "UseKeyShare Kyber success");
|
||||
}
|
||||
else {
|
||||
ESP_LOGE(TAG, "UseKeyShare Kyber failed");
|
||||
}
|
||||
#else
|
||||
ESP_LOGI(TAG, "WOLFSSL_HAVE_KYBER is not enabled");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -418,54 +445,110 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args)
|
||||
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
this_heap = esp_get_free_heap_size();
|
||||
ESP_LOGI(TAG, "tls_smp_client_task heap(2) @ %p = %d",
|
||||
&this_heap, this_heap);
|
||||
#endif
|
||||
/* Attach wolfSSL to the socket */
|
||||
wolfSSL_set_fd(ssl, sockfd);
|
||||
ret_i = wolfSSL_set_fd(ssl, sockfd);
|
||||
if (ret_i == WOLFSSL_SUCCESS) {
|
||||
ESP_LOGI(TAG, "wolfSSL_set_fd success");
|
||||
}
|
||||
else {
|
||||
ESP_LOGE(TAG, "ERROR: failed wolfSSL_set_fd. Error: %d\n", ret_i);
|
||||
}
|
||||
|
||||
WOLFSSL_MSG("Connect to wolfSSL on the server side");
|
||||
/* Connect to wolfSSL on the server side */
|
||||
if (wolfSSL_connect(ssl) == SSL_SUCCESS) {
|
||||
ESP_LOGI(TAG, "Connect to wolfSSL server...");
|
||||
ret_i = wolfSSL_connect(ssl);
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
this_heap = esp_get_free_heap_size();
|
||||
ESP_LOGI(TAG, "tls_smp_client_task heap(3) @ %p = %d",
|
||||
&this_heap, this_heap);
|
||||
#endif
|
||||
if (ret_i == WOLFSSL_SUCCESS) {
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
ShowCiphers(ssl);
|
||||
#endif
|
||||
ESP_LOGI(TAG, "Connect success! Sending message...");
|
||||
/* Get a message for the server from stdin */
|
||||
WOLFSSL_MSG("Message for server: ");
|
||||
memset(buff, 0, sizeof(buff));
|
||||
|
||||
if (sendGet) {
|
||||
printf("SSL connect ok, sending GET...\n");
|
||||
len = XSTRLEN(sndMsg);
|
||||
strncpy(buff, sndMsg, len);
|
||||
buff[len] = '\0';
|
||||
}
|
||||
else {
|
||||
sprintf(buff, "message from esp32 tls client\n");
|
||||
sprintf(buff, "Hello from Espressif wolfSSL TLS client!\n");
|
||||
len = strnlen(buff, sizeof(buff));
|
||||
}
|
||||
buff[len] = '\0';
|
||||
ESP_LOGI(TAG, "SSL connect ok, sending message:\n\n%s\n", buff);
|
||||
|
||||
/* Send the message to the server */
|
||||
if (wolfSSL_write(ssl, buff, len) != len) {
|
||||
do {
|
||||
err = 0; /* reset error */
|
||||
ret_i = wolfSSL_write(ssl, buff, len);
|
||||
if (ret_i <= 0) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
}
|
||||
} while (err == WOLFSSL_ERROR_WANT_WRITE ||
|
||||
err == WOLFSSL_ERROR_WANT_READ);
|
||||
|
||||
if (ret_i != len) {
|
||||
ESP_LOGE(TAG, "ERROR: failed to write\n");
|
||||
}
|
||||
else {
|
||||
ESP_LOGI(TAG, "Message sent! Awaiting response...");
|
||||
}
|
||||
|
||||
/* Read the server data into our buff array */
|
||||
memset(buff, 0, sizeof(buff));
|
||||
if (wolfSSL_read(ssl, buff, sizeof(buff) - 1) == -1) {
|
||||
|
||||
do {
|
||||
err = 0; /* reset error */
|
||||
ret_i =wolfSSL_read(ssl, buff, sizeof(buff));
|
||||
if (ret_i <= 0) {
|
||||
err = wolfSSL_get_error(ssl, 0);
|
||||
}
|
||||
} while ((err == WOLFSSL_ERROR_WANT_READ) ||
|
||||
(err == WOLFSSL_ERROR_WANT_WRITE) );
|
||||
|
||||
if (ret_i < 0) {
|
||||
ESP_LOGE(TAG, "ERROR: failed to read\n");
|
||||
}
|
||||
|
||||
/* Print to stdout any data the server sends */
|
||||
printf("Server: ");
|
||||
printf("%s\n", buff);
|
||||
/* Show any data the server sends */
|
||||
ESP_LOGI(TAG, "Server response: \n\n%s\n", buff);
|
||||
|
||||
ret_i = wolfSSL_shutdown(ssl);
|
||||
while (ret_i == WOLFSSL_SHUTDOWN_NOT_DONE) {
|
||||
ret_i = wolfSSL_shutdown(ssl); /* bidirectional shutdown */
|
||||
if (ret_i == WOLFSSL_SUCCESS) {
|
||||
ESP_LOGI(TAG, "Bidirectional shutdown complete\n");
|
||||
break;
|
||||
}
|
||||
else if (ret_i != WOLFSSL_SHUTDOWN_NOT_DONE) {
|
||||
ESP_LOGE(TAG, "Bidirectional shutdown failed\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ret_i != WOLFSSL_SUCCESS) {
|
||||
ESP_LOGE(TAG, "Bidirectional shutdown failed\n");
|
||||
}
|
||||
|
||||
} /* wolfSSL_connect(ssl) == WOLFSSL_SUCCESS) */
|
||||
else {
|
||||
ESP_LOGE(TAG, "ERROR: failed to connect to wolfSSL\n");
|
||||
ESP_LOGE(TAG, "ERROR: failed to connect to wolfSSL. "
|
||||
"Error: %d\n", ret_i);
|
||||
}
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
ShowCiphers(ssl);
|
||||
#endif
|
||||
|
||||
/* Cleanup and return */
|
||||
wolfSSL_free(ssl); /* Free the wolfSSL object */
|
||||
ESP_LOGI(TAG, "Cleanup and exit");
|
||||
wolfSSL_free(ssl); /* Release the wolfSSL object memory */
|
||||
wolfSSL_CTX_free(ctx); /* Free the wolfSSL context object */
|
||||
wolfSSL_Cleanup(); /* Cleanup the wolfSSL environment */
|
||||
close(sockfd); /* Close the connection to the server */
|
||||
@@ -487,16 +570,29 @@ WOLFSSL_ESP_TASK tls_smp_client_init(void* args)
|
||||
#else
|
||||
xTaskHandle _handle;
|
||||
#endif
|
||||
/* http://esp32.info/docs/esp_idf/html/dd/d3c/group__xTaskCreate.html */
|
||||
/* See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos_idf.html#functions */
|
||||
if (TLS_SMP_CLIENT_TASK_BYTES < (6 * 1024)) {
|
||||
/* Observed approximately 6KB limit for the RTOS task stack size.
|
||||
* Reminder parameter is bytes, not words as with generic FreeRTOS. */
|
||||
ESP_LOGW(TAG, "Warning: TLS_SMP_CLIENT_TASK_BYTES < 6KB");
|
||||
}
|
||||
#ifndef WOLFSSL_SMALL_STACK
|
||||
ESP_LOGW(TAG, "WARNING: WOLFSSL_SMALL_STACK is not defined. Consider "
|
||||
"defining that to reduce embedded memory usage.");
|
||||
#endif
|
||||
|
||||
/* Note that despite vanilla FreeRTOS using WORDS for a parameter,
|
||||
* Espressif uses BYTES for the task stack size here.
|
||||
* See https://docs.espressif.com/projects/esp-idf/en/v4.3/esp32/api-reference/system/freertos.html */
|
||||
ret = xTaskCreate(tls_smp_client_task,
|
||||
TLS_SMP_CLIENT_TASK_NAME,
|
||||
TLS_SMP_CLIENT_TASK_WORDS,
|
||||
TLS_SMP_CLIENT_TASK_BYTES,
|
||||
NULL,
|
||||
TLS_SMP_CLIENT_TASK_PRIORITY,
|
||||
&_handle);
|
||||
|
||||
if (ret != pdPASS) {
|
||||
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_CLIENT_TASK_NAME);
|
||||
ESP_LOGI(TAG, "Create thread %s failed.", TLS_SMP_CLIENT_TASK_NAME);
|
||||
}
|
||||
return TLS_SMP_CLIENT_TASK_RET;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#
|
||||
# Main component makefile.
|
||||
#
|
||||
# This Makefile can be left empty. By default, it will take the sources in the
|
||||
# src/ directory, compile them and link them into lib(subdirectory_name).a
|
||||
# in the build directory. This behaviour is entirely configurable,
|
||||
# This Makefile can be left empty. By default, it will take the sources in the
|
||||
# src/ directory, compile them and link them into lib(subdirectory_name).a
|
||||
# in the build directory. This behavior is entirely configurable,
|
||||
# please read the ESP-IDF documents if you need to do this.
|
||||
#
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* server-tls.h
|
||||
/* client-tls.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -18,18 +18,20 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
#ifndef _SERVER_TLS_
|
||||
#define _SERVER_TLS_
|
||||
#ifndef _CLIENT_TLS_H_
|
||||
#define _CLIENT_TLS_H_
|
||||
|
||||
/* Local project, auto-generated configuration */
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/* See main/Kconfig.projbuild for default configuration settings */
|
||||
#ifdef CONFIG_WOLFSSL_TARGET_HOST
|
||||
#define TLS_SMP_TARGET_HOST CONFIG_WOLFSSL_TARGET_HOST
|
||||
#define TLS_SMP_TARGET_HOST "192.168.1.36"
|
||||
#else
|
||||
#define TLS_SMP_TARGET_HOST "192.168.1.38"
|
||||
#define TLS_SMP_TARGET_HOST "192.168.1.41"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WOLFSSL_TARGET_PORT
|
||||
@@ -39,13 +41,34 @@
|
||||
#endif
|
||||
|
||||
#define TLS_SMP_CLIENT_TASK_NAME "tls_client_example"
|
||||
#define TLS_SMP_CLIENT_TASK_WORDS 22240
|
||||
|
||||
/* Reminder: Vanilla FreeRTOS is words, Espressif is bytes. */
|
||||
#if defined(WOLFSSL_ESP8266)
|
||||
#if defined(WOLFSSL_HAVE_KYBER)
|
||||
/* Minimum ESP8266 stack size = 10K with Kyber.
|
||||
* Note there's a maximum not far away as Kyber needs heap
|
||||
* and the total DRAM is typically only 80KB total. */
|
||||
#define TLS_SMP_CLIENT_TASK_BYTES (11 * 1024)
|
||||
#else
|
||||
/* Minimum ESP8266 stack size = 6K without Kyber */
|
||||
#define TLS_SMP_CLIENT_TASK_BYTES (6 * 1024)
|
||||
#endif
|
||||
#else
|
||||
#if defined(WOLFSSL_HAVE_KYBER)
|
||||
/* Minimum ESP32 stack size = 12K with Kyber enabled. */
|
||||
#define TLS_SMP_CLIENT_TASK_BYTES (12 * 1024)
|
||||
#else
|
||||
/* Minimum ESP32 stack size = 8K without Kyber */
|
||||
#define TLS_SMP_CLIENT_TASK_BYTES (8 * 1024)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define TLS_SMP_CLIENT_TASK_PRIORITY 8
|
||||
|
||||
#if defined(SINGLE_THREADED)
|
||||
#define WOLFSSL_ESP_TASK int
|
||||
#else
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#define WOLFSSL_ESP_TASK void
|
||||
#endif
|
||||
|
||||
@@ -68,4 +91,5 @@ WOLFSSL_ESP_TASK tls_smp_client_task(void* args);
|
||||
#else
|
||||
WOLFSSL_ESP_TASK tls_smp_client_init(void* args);
|
||||
#endif
|
||||
|
||||
#endif /* _SERVER_TLS_ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* template main.h
|
||||
/* wolfssl_client main.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
/* time_helper.h
|
||||
*
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -20,8 +21,8 @@
|
||||
|
||||
/* common Espressif time_helper v5.6.3.001 */
|
||||
|
||||
#ifndef _TIME_HELPER_H
|
||||
#define _TIME_HELPER_H
|
||||
#ifndef _TIME_HELPER_H_
|
||||
#define _TIME_HELPER_H_
|
||||
|
||||
/* ESP-IDF uses a 64-bit signed integer to represent time_t starting from release v5.0
|
||||
* See: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system_time.html#year-2036-and-2038-overflow-issues
|
||||
@@ -32,13 +33,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* a function to show the current data and time */
|
||||
int esp_show_current_datetime();
|
||||
int esp_show_current_datetime(void);
|
||||
|
||||
/* worst case, if GitHub time not available, used fixed time */
|
||||
int set_fixed_default_time(void);
|
||||
|
||||
/* set time from string (e.g. GitHub commit time) */
|
||||
int set_time_from_string(char* time_buffer);
|
||||
int set_time_from_string(const char* time_buffer);
|
||||
|
||||
/* set time from NTP servers,
|
||||
* also initially calls set_fixed_default_time or set_time_from_string */
|
||||
@@ -51,4 +52,4 @@ int set_time_wait_for_ntp(void);
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _TIME_HELPER_H */
|
||||
#endif /* #ifndef _TIME_HELPER_H_ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wifi_connect.h
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -21,9 +21,6 @@
|
||||
#ifndef _WIFI_CONNECT_H_
|
||||
#define _WIFI_CONNECT_H_
|
||||
|
||||
#include <esp_idf_version.h>
|
||||
#include <esp_log.h>
|
||||
|
||||
/* ESP lwip */
|
||||
#define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY
|
||||
|
||||
@@ -48,19 +45,54 @@
|
||||
* file my_private_config.h should be excluded from git updates */
|
||||
/* #define USE_MY_PRIVATE_CONFIG */
|
||||
|
||||
#ifdef USE_MY_PRIVATE_CONFIG
|
||||
/* Note that IntelliSense may not work properly in the next section for the
|
||||
* Espressif SDK 3.4 on the ESP8266. Macros should still be defined.
|
||||
* See the project-level Makefile. Example found in:
|
||||
* https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples/template
|
||||
*
|
||||
* The USE_MY_PRIVATE_[OS]_CONFIG is typically an environment variable that
|
||||
* triggers the make (not cmake) to add compiler defines.
|
||||
*/
|
||||
#if defined(USE_MY_PRIVATE_WINDOWS_CONFIG)
|
||||
#include "/workspace/my_private_config.h"
|
||||
#elif defined(USE_MY_PRIVATE_WSL_CONFIG)
|
||||
#include "/mnt/c/workspace/my_private_config.h"
|
||||
#elif defined(USE_MY_PRIVATE_LINUX_CONFIG)
|
||||
#include "~/workspace/my_private_config.h"
|
||||
#elif defined(USE_MY_PRIVATE_MAC_CONFIG)
|
||||
#include "~/Documents/my_private_config.h"
|
||||
#elif defined(USE_MY_PRIVATE_CONFIG)
|
||||
/* This section works best with cmake & non-environment variable setting */
|
||||
#if defined(WOLFSSL_CMAKE_SYSTEM_NAME_WINDOWS)
|
||||
#define WOLFSSL_CMAKE
|
||||
#include "/workspace/my_private_config.h"
|
||||
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_WINDOWS)
|
||||
#define WOLFSSL_MAKE
|
||||
#include "/workspace/my_private_config.h"
|
||||
#elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_WSL)
|
||||
#define WOLFSSL_CMAKE
|
||||
#include "/mnt/c/workspace/my_private_config.h"
|
||||
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_WSL)
|
||||
#define WOLFSSL_MAKE
|
||||
#include "/mnt/c/workspace/my_private_config.h"
|
||||
#elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_LINUX)
|
||||
#define WOLFSSL_CMAKE
|
||||
#include "~/workspace/my_private_config.h"
|
||||
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_LINUX)
|
||||
#define WOLFSSL_MAKE
|
||||
#include "~/workspace/my_private_config.h"
|
||||
#elif defined(WOLFSSL_CMAKE_SYSTEM_NAME_APPLE)
|
||||
#include "~/Documents/my_private_config.h"
|
||||
#elif defined(WOLFSSL_MAKE_SYSTEM_NAME_APPLE)
|
||||
#define WOLFSSL_MAKE
|
||||
#include "~/Documents/my_private_config.h"
|
||||
#elif defined(OS_WINDOWS)
|
||||
#include "/workspace/my_private_config.h"
|
||||
#else
|
||||
#warning "did not detect environment. using ~/my_private_config.h"
|
||||
#include "~/my_private_config.h"
|
||||
#endif
|
||||
/* Edit as needed for your private config: */
|
||||
#warning "default private config using /workspace/my_private_config.h"
|
||||
#include "/workspace/my_private_config.h"
|
||||
#endif
|
||||
#else
|
||||
|
||||
/*
|
||||
@@ -70,14 +102,22 @@
|
||||
** If you'd rather not, just change the below entries to strings with
|
||||
** the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid"
|
||||
*/
|
||||
#ifdef CONFIG_ESP_WIFI_SSID
|
||||
#if defined(CONFIG_ESP_WIFI_SSID)
|
||||
/* tyically from ESP32 with ESP-IDF v4 ot v5 */
|
||||
#define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID
|
||||
#elif defined(CONFIG_EXAMPLE_WIFI_SSID)
|
||||
/* tyically from ESP8266 rtos-sdk/v3.4 */
|
||||
#define EXAMPLE_ESP_WIFI_SSID CONFIG_EXAMPLE_WIFI_SSID
|
||||
#else
|
||||
#define EXAMPLE_ESP_WIFI_SSID "MYSSID_WIFI_CONNECT"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_PASSWORD
|
||||
#if defined(CONFIG_ESP_WIFI_PASSWORD)
|
||||
/* tyically from ESP32 with ESP-IDF v4 or v5 */
|
||||
#define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD
|
||||
#elif defined(CONFIG_EXAMPLE_WIFI_SSID)
|
||||
/* tyically from ESP8266 rtos-sdk/v3.4 */
|
||||
#define EXAMPLE_ESP_WIFI_PASS CONFIG_EXAMPLE_WIFI_PASSWORD
|
||||
#else
|
||||
#define EXAMPLE_ESP_WIFI_PASS "MYPASSWORD_WIFI_CONNECT"
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* main.c
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -27,8 +27,9 @@
|
||||
#include <esp_event.h>
|
||||
|
||||
/* wolfSSL */
|
||||
/* Always include wolfcrypt/settings.h before any other wolfSSL file. */
|
||||
/* Reminder: settings.h pulls in user_settings.h; don't include it here */
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <user_settings.h>
|
||||
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
|
||||
#ifndef WOLFSSL_ESPIDF
|
||||
#warning "Problem with wolfSSL user_settings."
|
||||
@@ -44,13 +45,17 @@
|
||||
* For wired ethernet, see:
|
||||
* https://github.com/wolfSSL/wolfssl-examples/tree/master/ESP32/TLS13-ENC28J60-client */
|
||||
#include "wifi_connect.h"
|
||||
/*
|
||||
* Note ModBus TCP cannot be disabled on ESP8266 tos-sdk/v3.4
|
||||
* See https://github.com/espressif/esp-modbus/issues/2
|
||||
*/
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_TRACK_MEMORY
|
||||
#include <wolfssl/wolfcrypt/mem_track.h>
|
||||
#endif
|
||||
|
||||
static const char* const TAG = "TLS Client";
|
||||
static const char* TAG = "main";
|
||||
|
||||
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
|
||||
&& defined(WOLFSSL_ATECC508A)
|
||||
@@ -115,10 +120,11 @@ void my_atmel_free(int slotId)
|
||||
#endif /* CUSTOM_SLOT_ALLOCATION */
|
||||
#endif /* WOLFSSL_ESPWROOM32SE && HAVE_PK_CALLBACK && WOLFSSL_ATECC508A */
|
||||
|
||||
/* for FreeRTOS */
|
||||
/* Entry for FreeRTOS */
|
||||
void app_main(void)
|
||||
{
|
||||
int stack_start = 0;
|
||||
int this_heap = 0;
|
||||
esp_err_t ret = 0;
|
||||
ESP_LOGI(TAG, "---------------- wolfSSL TLS Client Example ------------");
|
||||
ESP_LOGI(TAG, "--------------------------------------------------------");
|
||||
@@ -126,26 +132,42 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "---------------------- BEGIN MAIN ----------------------");
|
||||
ESP_LOGI(TAG, "--------------------------------------------------------");
|
||||
ESP_LOGI(TAG, "--------------------------------------------------------");
|
||||
#ifdef ESP_SDK_MEM_LIB_VERSION
|
||||
sdk_init_meminfo();
|
||||
#endif
|
||||
#ifdef ESP_TASK_MAIN_STACK
|
||||
ESP_LOGI(TAG, "ESP_TASK_MAIN_STACK: %d", ESP_TASK_MAIN_STACK);
|
||||
#endif
|
||||
#ifdef TASK_EXTRA_STACK_SIZE
|
||||
ESP_LOGI(TAG, "TASK_EXTRA_STACK_SIZE: %d", TASK_EXTRA_STACK_SIZE);
|
||||
#endif
|
||||
#ifdef INCLUDE_uxTaskGetStackHighWaterMark
|
||||
|
||||
#ifdef SINGLE_THREADED
|
||||
ESP_LOGI(TAG, "Single threaded");
|
||||
#else
|
||||
ESP_LOGI(TAG, "CONFIG_ESP_MAIN_TASK_STACK_SIZE = %d bytes (%d words)",
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE,
|
||||
(int)(CONFIG_ESP_MAIN_TASK_STACK_SIZE / sizeof(void*)));
|
||||
(int)(CONFIG_ESP_MAIN_TASK_STACK_SIZE / sizeof(void*)));
|
||||
|
||||
/* Returns the high water mark of the stack associated with xTask. That is,
|
||||
* the minimum free stack space there has been (in bytes not words, unlike
|
||||
* vanilla FreeRTOS) since the task started. The smaller the returned
|
||||
* number the closer the task has come to overflowing its stack.
|
||||
* see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos_idf.html
|
||||
*/
|
||||
stack_start = uxTaskGetStackHighWaterMark(NULL);
|
||||
ESP_LOGI(TAG, "Stack Start HWM: %d bytes", stack_start);
|
||||
#endif
|
||||
#ifdef INCLUDE_uxTaskGetStackHighWaterMark
|
||||
{
|
||||
/* Returns the high water mark of the stack associated with xTask. That is,
|
||||
* the minimum free stack space there has been (in bytes not words, unlike
|
||||
* vanilla FreeRTOS) since the task started. The smaller the returned
|
||||
* number the closer the task has come to overflowing its stack.
|
||||
* see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos_idf.html
|
||||
*/
|
||||
stack_start = uxTaskGetStackHighWaterMark(NULL);
|
||||
#ifdef ESP_SDK_MEM_LIB_VERSION
|
||||
{
|
||||
sdk_var_whereis("stack_start", &stack_start);
|
||||
}
|
||||
#endif
|
||||
|
||||
ESP_LOGI(TAG, "Stack Start HWM: %d bytes", stack_start);
|
||||
}
|
||||
#endif /* INCLUDE_uxTaskGetStackHighWaterMark */
|
||||
#endif /* SINGLE_THREADED */
|
||||
|
||||
#ifdef HAVE_VERSION_EXTENDED_INFO
|
||||
esp_ShowExtendedSystemInfo();
|
||||
@@ -184,11 +206,23 @@ void app_main(void)
|
||||
|
||||
/* Initialize NVS */
|
||||
ret = nvs_flash_init();
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
|
||||
ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
{
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES) {
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
/* Non-ESP8266 initialization is slightly different */
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
|
||||
ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
}
|
||||
#endif /* else not CONFIG_IDF_TARGET_ESP8266 */
|
||||
ESP_ERROR_CHECK(ret);
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
@@ -203,8 +237,8 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "Trying WiFi again...");
|
||||
ret = wifi_init_sta();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif /* else not CONFIG_IDF_TARGET_ESP32H2 */
|
||||
#endif /* else FOUND_PROTOCOL_EXAMPLES_DIR not found */
|
||||
|
||||
/* Once we are connected to the network, start & wait for NTP time */
|
||||
ret = set_time_wait_for_ntp();
|
||||
@@ -216,14 +250,6 @@ void app_main(void)
|
||||
esp_show_current_datetime();
|
||||
}
|
||||
|
||||
/* HWM is maximum amount of stack space that has been unused, in bytes
|
||||
* not words (unlike vanilla freeRTOS). */
|
||||
ESP_LOGI(TAG, "Initial Stack Used (before wolfSSL Server): %d bytes",
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
- (uxTaskGetStackHighWaterMark(NULL))
|
||||
);
|
||||
ESP_LOGI(TAG, "Starting TLS Client task ...\n");
|
||||
|
||||
#if defined(SINGLE_THREADED)
|
||||
/* just call the task */
|
||||
tls_smp_client_task((void*)NULL);
|
||||
@@ -232,6 +258,18 @@ void app_main(void)
|
||||
/* start a thread with the task */
|
||||
args[0].loops = 10;
|
||||
args[0].port = 11111;
|
||||
|
||||
/* HWM is maximum amount of stack space that has been unused, in bytes
|
||||
* not words (unlike vanilla freeRTOS). */
|
||||
this_heap = esp_get_free_heap_size();
|
||||
ESP_LOGI(TAG, "Initial Stack Used (before wolfSSL Server): %d bytes",
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
- (uxTaskGetStackHighWaterMark(NULL))
|
||||
);
|
||||
ESP_LOGI(TAG, "Starting TLS Client task ...\n");
|
||||
|
||||
ESP_LOGI(TAG, "main tls_smp_client_init heap @ %p = %d",
|
||||
&this_heap, this_heap);
|
||||
tls_smp_client_init(args);
|
||||
/* optional additional client threads
|
||||
tls_smp_client_init(args);
|
||||
@@ -244,24 +282,24 @@ void app_main(void)
|
||||
*/
|
||||
#endif
|
||||
|
||||
/* Done */
|
||||
#ifdef SINGLE_THREADED
|
||||
ESP_LOGV(TAG, "\n\nDone!\n\n");
|
||||
while (1);
|
||||
#else
|
||||
ESP_LOGV(TAG, "\n\nvTaskDelete...\n\n");
|
||||
vTaskDelete(NULL);
|
||||
/* done */
|
||||
while (1) {
|
||||
ESP_LOGV(TAG, "\n\nLoop...\n\n");
|
||||
#ifdef INCLUDE_uxTaskGetStackHighWaterMark
|
||||
#ifdef INCLUDE_uxTaskGetStackHighWaterMark
|
||||
ESP_LOGI(TAG, "Stack HWM: %d", uxTaskGetStackHighWaterMark(NULL));
|
||||
|
||||
ESP_LOGI(TAG, "Stack used: %d", CONFIG_ESP_MAIN_TASK_STACK_SIZE
|
||||
- (uxTaskGetStackHighWaterMark(NULL) ));
|
||||
#endif
|
||||
|
||||
#if defined(SINGLE_THREADED)
|
||||
ESP_LOGV(TAG, "\n\nDone!\n\n");
|
||||
while (1);
|
||||
#else
|
||||
#endif
|
||||
vTaskDelay(60000);
|
||||
#endif
|
||||
} /* done whle */
|
||||
} /* done while */
|
||||
#endif /* else not SINGLE_THREADED */
|
||||
|
||||
} /* app_main */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* time_helper.c
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -19,12 +19,14 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
/* common Espressif time_helper v5.6.3.002 */
|
||||
#include "esp_idf_version.h"
|
||||
/* See https://tf.nist.gov/tf-cgi/servers.cgi */
|
||||
|
||||
/* common Espressif time_helper v5.6.6.001 */
|
||||
#include "sdkconfig.h"
|
||||
#include "time_helper.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <esp_idf_version.h>
|
||||
|
||||
#if defined(ESP_IDF_VERSION_MAJOR) && defined(ESP_IDF_VERSION_MINOR)
|
||||
#if (ESP_IDF_VERSION_MAJOR == 5) && (ESP_IDF_VERSION_MINOR >= 1)
|
||||
@@ -36,25 +38,24 @@
|
||||
#include <esp_sntp.h>
|
||||
#endif
|
||||
#else
|
||||
/* TODO Consider pre IDF v5? */
|
||||
/* TODO Consider non ESP-IDF environments */
|
||||
#endif
|
||||
|
||||
/* ESP-IDF uses a 64-bit signed integer to represent time_t starting from release v5.0
|
||||
* See: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system_time.html#year-2036-and-2038-overflow-issues
|
||||
*/
|
||||
const static char* TAG = "time_helper";
|
||||
|
||||
/* see https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html */
|
||||
#ifndef TIME_ZONE
|
||||
/*
|
||||
* PST represents Pacific Standard Time.
|
||||
* +8 specifies the offset from UTC (Coordinated Universal Time), indicating
|
||||
* that Pacific Time is UTC-8 during standard time.
|
||||
* PDT represents Pacific Daylight Time.
|
||||
* M3.2.0 indicates that Daylight Saving Time (DST) starts on the
|
||||
* second (2) Sunday (0) of March (3).
|
||||
* M11.1.0 indicates that DST ends on the first (1) Sunday (0) of November (11)
|
||||
*/
|
||||
/*
|
||||
* PST represents Pacific Standard Time.
|
||||
* +8 specifies the offset from UTC (Coordinated Universal Time), indicating
|
||||
* that Pacific Time is UTC-8 during standard time.
|
||||
* PDT represents Pacific Daylight Time.
|
||||
* M3.2.0 indicates that Daylight Saving Time (DST) starts on the
|
||||
* second (2) Sunday (0) of March (3).
|
||||
* M11.1.0 indicates that DST ends on the first (1) Sunday (0) of November (11)
|
||||
*/
|
||||
#define TIME_ZONE "PST+8PDT,M3.2.0,M11.1.0"
|
||||
#endif /* not defined: TIME_ZONE, so we are setting our own */
|
||||
|
||||
@@ -87,11 +88,13 @@ const static char* TAG = "time_helper";
|
||||
|
||||
char* ntpServerList[NTP_SERVER_COUNT] = NTP_SERVER_LIST;
|
||||
|
||||
const static char* TAG = "time_helper";
|
||||
|
||||
/* our NTP server list is global info */
|
||||
extern char* ntpServerList[NTP_SERVER_COUNT];
|
||||
|
||||
/* Show the current date and time */
|
||||
int esp_show_current_datetime()
|
||||
int esp_show_current_datetime(void)
|
||||
{
|
||||
time_t now;
|
||||
char strftime_buf[64];
|
||||
@@ -104,7 +107,7 @@ int esp_show_current_datetime()
|
||||
localtime_r(&now, &timeinfo);
|
||||
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
|
||||
ESP_LOGI(TAG, "The current date/time is: %s", strftime_buf);
|
||||
return 0;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
/* the worst-case scenario is a hard-coded date/time */
|
||||
@@ -113,9 +116,9 @@ int set_fixed_default_time(void)
|
||||
/* ideally, we'd like to set time from network,
|
||||
* but let's set a default time, just in case */
|
||||
struct tm timeinfo = {
|
||||
.tm_year = 2023 - 1900,
|
||||
.tm_mon = 10,
|
||||
.tm_mday = 02,
|
||||
.tm_year = 2024 - 1900,
|
||||
.tm_mon = 3,
|
||||
.tm_mday = 01,
|
||||
.tm_hour = 13,
|
||||
.tm_min = 01,
|
||||
.tm_sec = 05
|
||||
@@ -130,7 +133,38 @@ int set_fixed_default_time(void)
|
||||
ESP_LOGI(TAG, "Adjusting time from fixed value");
|
||||
now = (struct timeval){ .tv_sec = interim_time };
|
||||
ret = settimeofday(&now, NULL);
|
||||
ESP_LOGI(TAG, "settimeofday result = %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* probably_valid_time_string(s)
|
||||
*
|
||||
* some sanity checks on time string before calling sscanf()
|
||||
*
|
||||
* returns 0 == ESP_OK == Success if str is likely a valid time.
|
||||
* -1 == ESP_FAIL otherwise
|
||||
*/
|
||||
int probably_valid_time_string(const char* str)
|
||||
{
|
||||
int ret = ESP_OK;
|
||||
size_t length = 0;
|
||||
size_t spaces = 0;
|
||||
size_t colons = 0;
|
||||
|
||||
while (str[length] != '\0') {
|
||||
if (str[length] == ' ') {
|
||||
spaces++;
|
||||
}
|
||||
if (str[length] == ':') {
|
||||
colons++;
|
||||
}
|
||||
length++;
|
||||
}
|
||||
|
||||
if ((length > 32) || (spaces < 4) || (spaces > 5) || (colons > 2)) {
|
||||
ret = ESP_FAIL;
|
||||
ESP_LOGE(TAG, "ERROR, failed time sanity check: %s", str);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -138,60 +172,67 @@ int set_fixed_default_time(void)
|
||||
*
|
||||
* returns 0 = success if able to set the time from the provided string
|
||||
* error for any other value, typically -1 */
|
||||
int set_time_from_string(char* time_buffer)
|
||||
int set_time_from_string(const char* time_buffer)
|
||||
{
|
||||
/* expecting github default formatting: 'Thu Aug 31 12:41:45 2023 -0700' */
|
||||
char offset[28]; /* large arrays, just in case there's still bad data */
|
||||
char day_str[28];
|
||||
char month_str[28];
|
||||
const char *format = "%3s %3s %d %d:%d:%d %d %s";
|
||||
struct tm this_timeinfo;
|
||||
struct timeval now;
|
||||
time_t interim_time;
|
||||
char offset[6]; /* expecting trailing single quote, not used */
|
||||
char day_str[4];
|
||||
char month_str[4];
|
||||
int day, year, hour, minute, second;
|
||||
int quote_offset = 0;
|
||||
int ret = 0;
|
||||
|
||||
/* we are expecting the string to be encapsulated in single quotes */
|
||||
if (*time_buffer == 0x27) {
|
||||
quote_offset = 1;
|
||||
}
|
||||
|
||||
ret = sscanf(time_buffer + quote_offset,
|
||||
format,
|
||||
day_str, month_str,
|
||||
&day, &hour, &minute, &second, &year, &offset);
|
||||
|
||||
if (ret == 8) {
|
||||
/* we found a match for all componets */
|
||||
|
||||
const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
if (strcmp(month_str, months[i]) == 0) {
|
||||
this_timeinfo.tm_mon = i;
|
||||
break;
|
||||
}
|
||||
/* perform some basic sanity checkes */
|
||||
ret = probably_valid_time_string(time_buffer);
|
||||
if (ret == ESP_OK) {
|
||||
/* we are expecting the string to be encapsulated in single quotes */
|
||||
if (*time_buffer == 0x27) {
|
||||
quote_offset = 1;
|
||||
}
|
||||
|
||||
this_timeinfo.tm_mday = day;
|
||||
this_timeinfo.tm_hour = hour;
|
||||
this_timeinfo.tm_min = minute;
|
||||
this_timeinfo.tm_sec = second;
|
||||
this_timeinfo.tm_year = year - 1900; /* Number of years since 1900 */
|
||||
ret = sscanf(time_buffer + quote_offset,
|
||||
format,
|
||||
day_str, month_str,
|
||||
&day, &hour, &minute, &second, &year, &offset);
|
||||
|
||||
interim_time = mktime(&this_timeinfo);
|
||||
now = (struct timeval){ .tv_sec = interim_time };
|
||||
ret = settimeofday(&now, NULL);
|
||||
ESP_LOGI(TAG, "Time updated to %s", time_buffer);
|
||||
}
|
||||
else {
|
||||
ESP_LOGE(TAG, "Failed to convert \"%s\" to a tm date.", time_buffer);
|
||||
ESP_LOGI(TAG, "Trying fixed date that was hard-coded.");
|
||||
set_fixed_default_time();
|
||||
ret = -1;
|
||||
if (ret == 8) {
|
||||
/* we found a match for all componets */
|
||||
|
||||
const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
if (strcmp(month_str, months[i]) == 0) {
|
||||
this_timeinfo.tm_mon = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this_timeinfo.tm_mday = day;
|
||||
this_timeinfo.tm_hour = hour;
|
||||
this_timeinfo.tm_min = minute;
|
||||
this_timeinfo.tm_sec = second;
|
||||
this_timeinfo.tm_year = year - 1900; /* Years since 1900 */
|
||||
|
||||
interim_time = mktime(&this_timeinfo);
|
||||
now = (struct timeval){ .tv_sec = interim_time };
|
||||
ret = settimeofday(&now, NULL);
|
||||
ESP_LOGI(TAG, "Time updated to %s", time_buffer);
|
||||
}
|
||||
else {
|
||||
ESP_LOGE(TAG, "Failed to convert \"%s\" to a tm date.",
|
||||
time_buffer);
|
||||
ESP_LOGI(TAG, "Trying fixed date that was hard-coded....");
|
||||
set_fixed_default_time();
|
||||
ret = ESP_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -224,14 +265,16 @@ int set_time(void)
|
||||
|
||||
#ifdef LIBWOLFSSL_VERSION_GIT_HASH_DATE
|
||||
/* initialy set a default approximate time from recent git commit */
|
||||
ESP_LOGI(TAG, "Found git hash date, attempting to set system date.");
|
||||
set_time_from_string(LIBWOLFSSL_VERSION_GIT_HASH_DATE);
|
||||
ESP_LOGI(TAG, "Found git hash date, attempting to set system date: %s",
|
||||
LIBWOLFSSL_VERSION_GIT_HASH_DATE);
|
||||
set_time_from_string(LIBWOLFSSL_VERSION_GIT_HASH_DATE"\0");
|
||||
esp_show_current_datetime();
|
||||
|
||||
ret = -4;
|
||||
#else
|
||||
/* otherwise set a fixed time that was hard coded */
|
||||
set_fixed_default_time();
|
||||
esp_show_current_datetime();
|
||||
ret = -3;
|
||||
#endif
|
||||
|
||||
@@ -262,6 +305,7 @@ int set_time(void)
|
||||
}
|
||||
ESP_LOGI(TAG, "%s", thisServer);
|
||||
sntp_setservername(i, thisServer);
|
||||
ret = ESP_OK;
|
||||
}
|
||||
#ifdef HAS_ESP_NETIF_SNTP
|
||||
ret = esp_netif_sntp_init(&config);
|
||||
@@ -289,6 +333,9 @@ int set_time(void)
|
||||
ESP_LOGW(TAG, "No sntp time servers found.");
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
esp_show_current_datetime();
|
||||
ESP_LOGI(TAG, "time helper existing with result = %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -303,6 +350,8 @@ int set_time_wait_for_ntp(void)
|
||||
ret = esp_netif_sntp_start();
|
||||
|
||||
ret = esp_netif_sntp_sync_wait(500 / portTICK_PERIOD_MS);
|
||||
#else
|
||||
ESP_LOGW(TAG, "HAS_ESP_NETIF_SNTP not defined");
|
||||
#endif /* HAS_ESP_NETIF_SNTP */
|
||||
esp_show_current_datetime();
|
||||
|
||||
@@ -322,7 +371,7 @@ int set_time_wait_for_ntp(void)
|
||||
#endif
|
||||
|
||||
if (ret == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Successfuly set time via NTP servers.");
|
||||
ESP_LOGI(TAG, "Successfully set time via NTP servers.");
|
||||
}
|
||||
else {
|
||||
ESP_LOGW(TAG, "Warning: Failed to set time with NTP: "
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* wifi_connect.c
|
||||
*
|
||||
* Copyright (C) 2006-2023 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2024 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
@@ -18,17 +18,20 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
#include "wifi_connect.h"
|
||||
#include "wifi_connect.h"
|
||||
|
||||
/* FreeRTOS */
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <freertos/event_groups.h>
|
||||
#include <esp_wifi.h>
|
||||
|
||||
/* Espressif */
|
||||
#include <esp_log.h>
|
||||
#include <esp_idf_version.h>
|
||||
#include <esp_wifi.h>
|
||||
|
||||
/* wolfSSL */
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include "user_settings.h"
|
||||
#include <wolfssl/version.h>
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
#ifndef WOLFSSL_ESPIDF
|
||||
@@ -36,7 +39,12 @@
|
||||
#warning "Check components/wolfssl/include"
|
||||
#endif
|
||||
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
/* When there's too little heap, WiFi quietly refuses to connect */
|
||||
#define WIFI_LOW_HEAP_WARNING 21132
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
#elif ESP_IDF_VERSION_MAJOR >= 5
|
||||
/* example path set in cmake file */
|
||||
#elif ESP_IDF_VERSION_MAJOR >= 4
|
||||
#include "protocol_examples_common.h"
|
||||
#else
|
||||
@@ -44,7 +52,9 @@
|
||||
static EventGroupHandle_t wifi_event_group;
|
||||
#endif
|
||||
|
||||
#if defined(ESP_IDF_VERSION_MAJOR) && defined(ESP_IDF_VERSION_MINOR)
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
|
||||
#elif defined(ESP_IDF_VERSION_MAJOR) && defined(ESP_IDF_VERSION_MINOR)
|
||||
#if ESP_IDF_VERSION_MAJOR >= 4
|
||||
/* likely using examples, see wifi_connect.h */
|
||||
#else
|
||||
@@ -64,7 +74,114 @@
|
||||
/* breadcrumb prefix for logging */
|
||||
const static char *TAG = "wifi_connect";
|
||||
|
||||
#if ESP_IDF_VERSION_MAJOR < 4
|
||||
#if defined(CONFIG_IDF_TARGET_ESP8266)
|
||||
#ifndef CONFIG_ESP_MAX_STA_CONN
|
||||
#define CONFIG_ESP_MAX_STA_CONN 4
|
||||
#endif
|
||||
#define EXAMPLE_MAX_STA_CONN CONFIG_ESP_MAX_STA_CONN
|
||||
|
||||
#define WIFI_CONNECTED_BIT BIT0
|
||||
#define WIFI_FAIL_BIT BIT1
|
||||
#ifndef CONFIG_ESP_MAXIMUM_RETRY
|
||||
#define CONFIG_ESP_MAXIMUM_RETRY 5
|
||||
#endif
|
||||
/* FreeRTOS event group to signal when we are connected*/
|
||||
static EventGroupHandle_t s_wifi_event_group;
|
||||
static int s_retry_num = 0;
|
||||
|
||||
#define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY
|
||||
static void event_handler(void* arg, esp_event_base_t event_base,
|
||||
int32_t event_id, void* event_data)
|
||||
{
|
||||
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
|
||||
esp_wifi_connect();
|
||||
} else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
|
||||
if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) {
|
||||
esp_wifi_connect();
|
||||
s_retry_num++;
|
||||
ESP_LOGI(TAG, "retry to connect to the AP");
|
||||
} else {
|
||||
xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
|
||||
}
|
||||
ESP_LOGI(TAG,"connect to the AP fail");
|
||||
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
|
||||
ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
|
||||
ESP_LOGI(TAG, "got ip:%s",
|
||||
ip4addr_ntoa(&event->ip_info.ip));
|
||||
s_retry_num = 0;
|
||||
xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
int wifi_init_sta(void)
|
||||
{
|
||||
word32 this_heap;
|
||||
|
||||
s_wifi_event_group = xEventGroupCreate();
|
||||
|
||||
tcpip_adapter_init();
|
||||
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
|
||||
|
||||
ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL));
|
||||
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, NULL));
|
||||
|
||||
wifi_config_t wifi_config = {
|
||||
.sta = {
|
||||
.ssid = EXAMPLE_ESP_WIFI_SSID,
|
||||
.password = EXAMPLE_ESP_WIFI_PASS
|
||||
},
|
||||
};
|
||||
|
||||
/* Setting a password implies station will connect to all security modes including WEP/WPA.
|
||||
* However these modes are deprecated and not advisable to be used. Incase your Access point
|
||||
* doesn't support WPA2, these mode can be enabled by commenting below line */
|
||||
|
||||
if (strlen((char *)wifi_config.sta.password)) {
|
||||
wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK;
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
|
||||
ESP_ERROR_CHECK(esp_wifi_start() );
|
||||
|
||||
ESP_LOGI(TAG, "wifi_init_sta finished. Connecting...");
|
||||
this_heap = esp_get_free_heap_size();
|
||||
ESP_LOGI(TAG, "this heap = %d", this_heap);
|
||||
if (this_heap < WIFI_LOW_HEAP_WARNING) {
|
||||
ESP_LOGW(TAG, "Warning: WiFi low heap: %d", WIFI_LOW_HEAP_WARNING);
|
||||
}
|
||||
/* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum
|
||||
* number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */
|
||||
EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group,
|
||||
WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,
|
||||
pdFALSE,
|
||||
pdFALSE,
|
||||
portMAX_DELAY);
|
||||
|
||||
ESP_LOGI(TAG, "xEventGroupWaitBits finished.");
|
||||
/* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually
|
||||
* happened. */
|
||||
if (bits & WIFI_CONNECTED_BIT) {
|
||||
ESP_LOGI(TAG, "connected to ap SSID:%s",
|
||||
EXAMPLE_ESP_WIFI_SSID);
|
||||
} else if (bits & WIFI_FAIL_BIT) {
|
||||
ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s",
|
||||
EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);
|
||||
} else {
|
||||
ESP_LOGE(TAG, "UNEXPECTED EVENT");
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler));
|
||||
ESP_ERROR_CHECK(esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler));
|
||||
vEventGroupDelete(s_wifi_event_group);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#elif ESP_IDF_VERSION_MAJOR < 4
|
||||
/* event handler for wifi events */
|
||||
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
|
||||
{
|
||||
@@ -270,7 +387,8 @@ int wifi_init_sta(void)
|
||||
|
||||
int wifi_show_ip(void)
|
||||
{
|
||||
/* ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); */
|
||||
return 0;
|
||||
/* TODO Causes panic: ESP_LOGI(TAG, "got ip:" IPSTR,
|
||||
* IP2STR(&event->ip_info.ip)); */
|
||||
return ESP_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,25 +1,92 @@
|
||||
# sdkconfig.defaults for ESP8266 + ESP32
|
||||
# Note that during the build process, settings from sdkconfig.defaults will not override those already in sdkconfig.
|
||||
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#custom-sdkconfig-defaults
|
||||
CONFIG_BENCH_ARGV="-lng 0"
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
|
||||
#
|
||||
# Default main stack size
|
||||
# Default main stack size. See user_settings.h
|
||||
#
|
||||
# This is typically way bigger than needed for stack size. See user_settings.h
|
||||
#
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=55500
|
||||
# For wolfSSL SMALL_STACK, 3072 bytes should be sufficient for benchmark app.
|
||||
# When using RSA, assign at least 10500 bytes, otherwise 5500 usually works for others
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=10500
|
||||
|
||||
# Legacy stack size for older ESP-IDF versions
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=55500
|
||||
CONFIG_MAIN_TASK_STACK_SIZE=10500
|
||||
|
||||
#
|
||||
# Benchmark must not have CONFIG_NEWLIB_NANO_FORMAT enabled
|
||||
CONFIG_NEWLIB_NANO_FORMAT=n
|
||||
#
|
||||
# Watchdog Timers
|
||||
#
|
||||
# We don't want to have the watchdog timeout during tests & benchmarks
|
||||
#
|
||||
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=n
|
||||
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=n
|
||||
# Panic & Watchdog
|
||||
CONFIG_ESP_INT_WDT_TIMEOUT_MS=10000
|
||||
CONFIG_ESP_TASK_WDT_EN=n
|
||||
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
|
||||
CONFIG_ESP_INT_WDT=n
|
||||
|
||||
# ESP8266 Watchdog:
|
||||
CONFIG_TASK_WDT=n
|
||||
CONFIG_TASK_WDT_PANIC=n
|
||||
|
||||
# ESP8266 WDT
|
||||
# CONFIG_ESP_PANIC_PRINT_REBOOT is not set
|
||||
CONFIG_ESP_PANIC_PRINT_REBOOT=n
|
||||
CONFIG_ESP_PANIC_PRINT_HALT=y
|
||||
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS is not set
|
||||
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=n
|
||||
|
||||
# ESP8266 Memory
|
||||
CONFIG_FREERTOS_GLOBAL_DATA_LINK_IRAM=y
|
||||
CONFIG_HEAP_DISABLE_IRAM=y
|
||||
|
||||
# Performance
|
||||
# CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||
|
||||
# Set max COU frequency (falls back as needed for lower maximum)
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
|
||||
# FreeRTOS ticks at 1ms interval
|
||||
CONFIG_FREERTOS_UNICORE=y
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
|
||||
#
|
||||
# Compiler options
|
||||
#
|
||||
CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
|
||||
# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_PERF is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_NONE is not set
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
|
||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set
|
||||
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
|
||||
CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
|
||||
# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set
|
||||
CONFIG_COMPILER_HIDE_PATHS_MACROS=y
|
||||
# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
|
||||
# CONFIG_COMPILER_CXX_RTTI is not set
|
||||
# CONFIG_COMPILER_STACK_CHECK_MODE_NONE is not set
|
||||
CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y
|
||||
# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set
|
||||
# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
|
||||
CONFIG_COMPILER_STACK_CHECK=y
|
||||
# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
|
||||
# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set
|
||||
# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set
|
||||
# CONFIG_COMPILER_DUMP_RTL_FILES is not set
|
||||
# end of Compiler options
|
||||
|
||||
# We don't know that the min is actually v2,
|
||||
# but this is the earliest tested.
|
||||
CONFIG_ESP32C3_REV_MIN_2=y
|
||||
|
||||
#
|
||||
# Partition Table
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
<?xml version="1.0"?>
|
||||
<VisualGDBProjectSettings2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Project xsi:type="com.visualgdb.project.external.esp-idf">
|
||||
<CustomSourceDirectories>
|
||||
<Directories />
|
||||
<PathStyle>Unknown</PathStyle>
|
||||
</CustomSourceDirectories>
|
||||
<AutoProgramSPIFFSPartition>true</AutoProgramSPIFFSPartition>
|
||||
<ProjectModeSettings>
|
||||
<ProjectGUID>c9687472-a434-43a7-9026-7914f425b9b4</ProjectGUID>
|
||||
<GroupSourcesByTypes>true</GroupSourcesByTypes>
|
||||
<GroupSourcesByPaths>true</GroupSourcesByPaths>
|
||||
<HeaderScanMode>SourceDirs</HeaderScanMode>
|
||||
</ProjectModeSettings>
|
||||
</Project>
|
||||
<Build xsi:type="com.visualgdb.build.external.esp-idf">
|
||||
<BuildLogMode xsi:nil="true" />
|
||||
<ToolchainID>
|
||||
<ID>com.visualgdb.xtensa-lx106-elf</ID>
|
||||
<Version>
|
||||
<GCC>8.4.0</GCC>
|
||||
<GDB>8.1</GDB>
|
||||
<Revision>1</Revision>
|
||||
</Version>
|
||||
</ToolchainID>
|
||||
<IDFCheckout>
|
||||
<Version>release/v3.4</Version>
|
||||
<Subdirectory>rtos-sdk/v3.4</Subdirectory>
|
||||
<Type>RTOS_SDK</Type>
|
||||
</IDFCheckout>
|
||||
<BuildThreadCount>0</BuildThreadCount>
|
||||
</Build>
|
||||
<CustomBuild>
|
||||
<PreSyncActions />
|
||||
<PreBuildActions />
|
||||
<PostBuildActions />
|
||||
<PreCleanActions />
|
||||
<PostCleanActions />
|
||||
</CustomBuild>
|
||||
<CustomDebug>
|
||||
<PreDebugActions />
|
||||
<PostDebugActions />
|
||||
<DebugStopActions />
|
||||
<BreakMode>Default</BreakMode>
|
||||
<CustomBreakCommand>
|
||||
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
|
||||
<RemoteHost>
|
||||
<HostName>BuildMachine</HostName>
|
||||
<Transport>BuiltinShortcut</Transport>
|
||||
</RemoteHost>
|
||||
<BackgroundMode xsi:nil="true" />
|
||||
</CustomBreakCommand>
|
||||
</CustomDebug>
|
||||
<DeviceTerminalSettings>
|
||||
<Connection xsi:type="com.sysprogs.terminal.connection.serial">
|
||||
<ComPortName>COM80</ComPortName>
|
||||
<AdvancedSettings>
|
||||
<BaudRate>74880</BaudRate>
|
||||
<DataBits>8</DataBits>
|
||||
<Parity>None</Parity>
|
||||
<StopBits>One</StopBits>
|
||||
<FlowControl>None</FlowControl>
|
||||
</AdvancedSettings>
|
||||
</Connection>
|
||||
<LastConnectionTime>0</LastConnectionTime>
|
||||
<EchoTypedCharacters>false</EchoTypedCharacters>
|
||||
<ClearContentsWhenReconnecting>true</ClearContentsWhenReconnecting>
|
||||
<ReconnectAutomatically>false</ReconnectAutomatically>
|
||||
<DisplayMode>ASCII</DisplayMode>
|
||||
<Colors>
|
||||
<Background>
|
||||
<Alpha>255</Alpha>
|
||||
<Red>0</Red>
|
||||
<Green>0</Green>
|
||||
<Blue>0</Blue>
|
||||
</Background>
|
||||
<Disconnected>
|
||||
<Alpha>255</Alpha>
|
||||
<Red>169</Red>
|
||||
<Green>169</Green>
|
||||
<Blue>169</Blue>
|
||||
</Disconnected>
|
||||
<Text>
|
||||
<Alpha>255</Alpha>
|
||||
<Red>211</Red>
|
||||
<Green>211</Green>
|
||||
<Blue>211</Blue>
|
||||
</Text>
|
||||
<Echo>
|
||||
<Alpha>255</Alpha>
|
||||
<Red>144</Red>
|
||||
<Green>238</Green>
|
||||
<Blue>144</Blue>
|
||||
</Echo>
|
||||
<Inactive>
|
||||
<Alpha>255</Alpha>
|
||||
<Red>169</Red>
|
||||
<Green>169</Green>
|
||||
<Blue>169</Blue>
|
||||
</Inactive>
|
||||
</Colors>
|
||||
<HexSettings>
|
||||
<MaximumBytesPerLine>16</MaximumBytesPerLine>
|
||||
<ShowTextView>true</ShowTextView>
|
||||
<BreaksAroundEcho>true</BreaksAroundEcho>
|
||||
<AutoSend>true</AutoSend>
|
||||
<SendAsHex>true</SendAsHex>
|
||||
<TimeoutForAutoBreak>0</TimeoutForAutoBreak>
|
||||
</HexSettings>
|
||||
<LineEnding>LF</LineEnding>
|
||||
<TreatLFAsCRLF>false</TreatLFAsCRLF>
|
||||
<KeepOpenAfterExit>false</KeepOpenAfterExit>
|
||||
<ShowAfterProgramming>false</ShowAfterProgramming>
|
||||
</DeviceTerminalSettings>
|
||||
<CustomShortcuts>
|
||||
<Shortcuts />
|
||||
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
|
||||
</CustomShortcuts>
|
||||
<UserDefinedVariables />
|
||||
<ImportedPropertySheets />
|
||||
<CodeSense>
|
||||
<Enabled>True</Enabled>
|
||||
<ExtraSettings>
|
||||
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
|
||||
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
|
||||
<DiscoverySettings>
|
||||
<Mode>Enabled</Mode>
|
||||
<SearchInProjectDir>true</SearchInProjectDir>
|
||||
<SearchInSourceDirs>true</SearchInSourceDirs>
|
||||
<SearchInIncludeSubdirs>true</SearchInIncludeSubdirs>
|
||||
</DiscoverySettings>
|
||||
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
|
||||
<FormattingEngine xsi:nil="true" />
|
||||
</ExtraSettings>
|
||||
<CodeAnalyzerSettings>
|
||||
<Enabled>false</Enabled>
|
||||
<SelectedAnalyzers>
|
||||
<string>apiModeling.google.GTest</string>
|
||||
<string>core.builtin.BuiltinFunctions</string>
|
||||
<string>core.builtin.NoReturnFunctions</string>
|
||||
<string>core.CallAndMessage</string>
|
||||
<string>core.DivideZero</string>
|
||||
<string>core.DynamicTypePropagation</string>
|
||||
<string>core.NonnilStringConstants</string>
|
||||
<string>core.NonNullParamChecker</string>
|
||||
<string>core.NullDereference</string>
|
||||
<string>core.StackAddressEscape</string>
|
||||
<string>core.UndefinedBinaryOperatorResult</string>
|
||||
<string>core.uninitialized.ArraySubscript</string>
|
||||
<string>core.uninitialized.Assign</string>
|
||||
<string>core.uninitialized.Branch</string>
|
||||
<string>core.uninitialized.CapturedBlockVariable</string>
|
||||
<string>core.uninitialized.UndefReturn</string>
|
||||
<string>core.VLASize</string>
|
||||
<string>cplusplus.NewDelete</string>
|
||||
<string>cplusplus.NewDeleteLeaks</string>
|
||||
<string>cplusplus.SelfAssignment</string>
|
||||
<string>deadcode.DeadStores</string>
|
||||
<string>nullability.NullPassedToNonnull</string>
|
||||
<string>nullability.NullReturnedFromNonnull</string>
|
||||
<string>security.insecureAPI.getpw</string>
|
||||
<string>security.insecureAPI.gets</string>
|
||||
<string>security.insecureAPI.mkstemp</string>
|
||||
<string>security.insecureAPI.mktemp</string>
|
||||
<string>security.insecureAPI.UncheckedReturn</string>
|
||||
<string>security.insecureAPI.vfork</string>
|
||||
<string>unix.API</string>
|
||||
<string>unix.cstring.BadSizeArg</string>
|
||||
<string>unix.cstring.NullArg</string>
|
||||
<string>unix.Malloc</string>
|
||||
<string>unix.MallocSizeof</string>
|
||||
<string>unix.MismatchedDeallocator</string>
|
||||
<string>unix.StdCLibraryFunctions</string>
|
||||
<string>unix.Vfork</string>
|
||||
</SelectedAnalyzers>
|
||||
<ExtraArguments>
|
||||
<string>-analyzer-store=region</string>
|
||||
<string>-analyzer-opt-analyze-nested-blocks</string>
|
||||
<string>-analyzer-eagerly-assume</string>
|
||||
</ExtraArguments>
|
||||
</CodeAnalyzerSettings>
|
||||
</CodeSense>
|
||||
<Configurations>
|
||||
<VisualGDBConfiguration>
|
||||
<Name>Debug</Name>
|
||||
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.extension">
|
||||
<OutputSubdirectory>build/Debug</OutputSubdirectory>
|
||||
<SDKConfigFile>sdkconfig-debug</SDKConfigFile>
|
||||
<EnableVerboseBuild>false</EnableVerboseBuild>
|
||||
</BuildSettingsExtension>
|
||||
</VisualGDBConfiguration>
|
||||
<VisualGDBConfiguration>
|
||||
<Name>Release</Name>
|
||||
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.esp-idf.extension">
|
||||
<OutputSubdirectory>build/Release</OutputSubdirectory>
|
||||
<SDKConfigFile>sdkconfig-release</SDKConfigFile>
|
||||
<EnableVerboseBuild>false</EnableVerboseBuild>
|
||||
</BuildSettingsExtension>
|
||||
</VisualGDBConfiguration>
|
||||
</Configurations>
|
||||
<ProgramArgumentsSuggestions />
|
||||
<Debug xsi:type="com.visualgdb.debug.embedded">
|
||||
<AdditionalStartupCommands>
|
||||
<GDBPreStartupCommands />
|
||||
<GDBStartupCommands />
|
||||
<GDBFinalizationCommands />
|
||||
</AdditionalStartupCommands>
|
||||
<AdditionalGDBSettings>
|
||||
<Features>
|
||||
<DisableAutoDetection>false</DisableAutoDetection>
|
||||
<UseFrameParameter>false</UseFrameParameter>
|
||||
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
|
||||
<ListLocalsSupported>false</ListLocalsSupported>
|
||||
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
|
||||
<ThreadInfoSupported>false</ThreadInfoSupported>
|
||||
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
|
||||
<SupportTargetCommand>false</SupportTargetCommand>
|
||||
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
|
||||
</Features>
|
||||
<EnableSmartStepping>false</EnableSmartStepping>
|
||||
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
|
||||
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
|
||||
<UseAppleExtensions>false</UseAppleExtensions>
|
||||
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
|
||||
<MakeLogFile>false</MakeLogFile>
|
||||
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
|
||||
<UseRelativePathsOnly>false</UseRelativePathsOnly>
|
||||
<ExitAction>None</ExitAction>
|
||||
<DisableDisassembly>false</DisableDisassembly>
|
||||
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
|
||||
<StepIntoNewInstanceEntry />
|
||||
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
|
||||
<DisableSignals>false</DisableSignals>
|
||||
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
|
||||
<AsyncModeSupportsBreakpoints>true</AsyncModeSupportsBreakpoints>
|
||||
<TemporaryBreakConsolidationTimeout>0</TemporaryBreakConsolidationTimeout>
|
||||
<EnableNonStopMode>false</EnableNonStopMode>
|
||||
<MaxBreakpointLimit>0</MaxBreakpointLimit>
|
||||
<EnableVerboseMode>true</EnableVerboseMode>
|
||||
<EnablePrettyPrinters>false</EnablePrettyPrinters>
|
||||
</AdditionalGDBSettings>
|
||||
<DebugMethod>
|
||||
<ID>openocd</ID>
|
||||
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp8266">
|
||||
<CommandLine>-f interface/ftdi/tigard.cfg -f target/esp8266.cfg</CommandLine>
|
||||
<ExtraParameters>
|
||||
<Frequency xsi:nil="true" />
|
||||
<BoostedFrequency xsi:nil="true" />
|
||||
<ConnectUnderReset>false</ConnectUnderReset>
|
||||
</ExtraParameters>
|
||||
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
|
||||
<ProgramMode>Enabled</ProgramMode>
|
||||
<StartupCommands>
|
||||
<string>set remotetimeout 60</string>
|
||||
<string>target remote :$$SYS:GDB_PORT$$</string>
|
||||
<string>mon reset halt</string>
|
||||
<string>load</string>
|
||||
<string>mon xtensa_no_interrupts_during_steps on</string>
|
||||
<string>mon esp8266_autofeed_watchdog on</string>
|
||||
</StartupCommands>
|
||||
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
|
||||
<PreferredGDBPort>0</PreferredGDBPort>
|
||||
<PreferredTelnetPort>0</PreferredTelnetPort>
|
||||
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
|
||||
<SelectedCoreIndex xsi:nil="true" />
|
||||
<SuggestionLogicRevision>0</SuggestionLogicRevision>
|
||||
<ResetMode>Soft</ResetMode>
|
||||
<ProgramSectorSize>4096</ProgramSectorSize>
|
||||
<EraseSectorSize>4096</EraseSectorSize>
|
||||
<FLASHSettings>
|
||||
<Size>size4M</Size>
|
||||
<Frequency>freq40M</Frequency>
|
||||
<Mode>QIO</Mode>
|
||||
</FLASHSettings>
|
||||
</Configuration>
|
||||
</DebugMethod>
|
||||
<AutoDetectRTOS>true</AutoDetectRTOS>
|
||||
<SemihostingSupport>Disabled</SemihostingSupport>
|
||||
<SemihostingPollingDelay>0</SemihostingPollingDelay>
|
||||
<StepIntoEntryPoint>false</StepIntoEntryPoint>
|
||||
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
|
||||
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
|
||||
<StopAtEntryPoint>false</StopAtEntryPoint>
|
||||
<EnableVirtualHalts>false</EnableVirtualHalts>
|
||||
<DynamicAnalysisSettings />
|
||||
<EndOfStackSymbol>_estack</EndOfStackSymbol>
|
||||
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
|
||||
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
|
||||
<UnusedStackFillPattern xsi:nil="true" />
|
||||
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
|
||||
</Debug>
|
||||
</VisualGDBProjectSettings2>
|
||||
@@ -68,6 +68,19 @@ Linux Server
|
||||
./examples/server/server -v 4 -l TLS13-SM4-CCM-SM3 -c ./certs/sm2/server-sm2.pem -k ./certs/sm2/server-sm2-priv.pem -A ./certs/sm2/client-sm2.pem -V
|
||||
```
|
||||
|
||||
#### ESP32 Client to WSL Linux Server
|
||||
|
||||
In Windows Powershell, (elevated permissions) forward the port _after_ starting the listening server:
|
||||
|
||||
```bash
|
||||
netsh interface portproxy add v4tov4 listenport=11111 listenaddress=0.0.0.0 connectport=11111 connectaddress=127.0.0.1
|
||||
```
|
||||
|
||||
After the server exits, remove the port proxy forward:
|
||||
|
||||
```bash
|
||||
netsh interface portproxy delete v4tov4 listenport=11111 listenaddress=0.0.0.0
|
||||
```
|
||||
|
||||
Cipers to consider
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ToolchainID>
|
||||
<ID>com.visualgdb.xtensa-esp32-elf</ID>
|
||||
<Version>
|
||||
<GCC>12.2.0</GCC>
|
||||
<GCC>13.2.0</GCC>
|
||||
<GDB>12.1</GDB>
|
||||
<Revision>1</Revision>
|
||||
</Version>
|
||||
@@ -67,8 +67,8 @@
|
||||
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
|
||||
<ESPIDFExtension>
|
||||
<IDFCheckout>
|
||||
<Version>release/v5.1</Version>
|
||||
<Subdirectory>esp-idf/v5.1</Subdirectory>
|
||||
<Version>release/v5.2</Version>
|
||||
<Subdirectory>esp-idf/v5.2</Subdirectory>
|
||||
<Type>ESPIDF</Type>
|
||||
</IDFCheckout>
|
||||
<COMPort>COM19</COMPort>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user