-
Notifications
You must be signed in to change notification settings - Fork 2.1k
wolfSSL pkg addition with examples #7348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Update README.md Update README.md Update README.md Update README.md Update README.md Update main.c Update doc.txt
c1b8529
to
5d92980
Compare
Just tried it, but all examples fail to compile with Once this is fixed,
Compiler version used: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 |
Thanks @MichelRottleuthner for feedback. Initially tested on Mac OS (10.12.5, Sierra) w/ Apple LLVM version 8.1.0 (clang-802.0.42) Compiler. Will work on resolving the noted issues for Ubuntu 16.04.4 w/ gcc v 5.4.0 Warmest Regards, Kaleb |
I have pushed fixes for the old-style function defs here: wolfSSL/wolfssl#1029 Thanks again for your time and review. The reason for the seg faults were the default stack sizes set for the application on Ubuntu. Bumping default stack size to 24.5k (edit >) when exercising maximum functionality via the testing applications (<end edit) seems sufficient in my testing. I tested the following: 60K - Pass I did not optimize further after that (edit>) in the test apps. I made no adjustments to the stack sizes in the client/server applications as they appeared to work fine out-of-the-box on NATIVE platform (<end edit). Warm Regards, Kaleb |
pkg/wolfssl/Makefile
Outdated
PKG_NAME=wolfssl | ||
PKG_URL=https://github.com/wolfssl/wolfssl.git | ||
#PKG_VERSION=a79f9c93c98f1af4e6b2c70abe8208bab8919944 | ||
PKG_VERSION=f7cd8a0f15774f8fdb686c13008ec48601b64b28 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update once PR to address old-style function defs is merged into wolfSSL master:
wolfSSL/wolfssl#1029
Thanks for your quick fix! Is there anything that can be done to further decrease memory usage of the test Applications to allow testing on very constrained devices? |
pkg/wolfssl/Makefile
Outdated
export RIOT_CFLAGS = ${CFLAGS} ${INCLUDES} | ||
|
||
all: git-download | ||
mkdir $(PKG_BUILDDIR)/../../../native/wolfssl/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following lines shouldn't be set to native
statically and use $(BOARD)
instead to allow building for other platforms.
Yes of course. I can work on a more optimized build this coming week. What would be an "Ideal footprint" in your mind?
Thanks I'll begin testing this on Monday! Warm Regards, Kaleb |
RIOT/pkg/wolfssl/Makefile now references merged PR with old-style function def fixes here: wolfSSL/wolfssl@cc4ca6a Adjusted default stack size to work for both MAC OS X (Sierra) and Ubuntu 16.04, increased from 26.25k (Ubuntu) to 35K (For MAC). Clang on mac results in less optimized binary and requires more stack. Have a feeling this may be a never ending battle adjusting the stack on a per-device basis. SOLUTION: have it work for Native on both Mac and Linux, document stack reqs for the default examples and let developers adjust as needed for target board. |
Hi Michel, got busy there and now able to return to testing the suggestion. When changing Makefile from
How to best handle this issue in the RIOT makefile system? Regards, Kaleb |
When you replace |
Perfect, thank you for clarifying!
|
The outdated diff resulted in confusion on my end. Apologies. Fix is in. Still have it on my list to do an "optimized" build, do you have a recommended target footprint (compiled size) and stack use in mind for this "optimized build"?
|
I don't actually have a specific number in mind. I just asked out of interest because RIOT supports multiple platforms that have way smaller RAM than what is used as stack size in the wolfssl tests. Of course not all of them are realistic targets e.g. Arduino Uno seems to be out of reach with it's 2k RAM ;) ...I'd just be interested in "how tiny is possible" to support as many RIOT platforms as possible. |
I have not yet had a chance to build for any of the other platforms but it is definitely on my TODO list!
Cool. I will do two additional examples we have a "Lean-TLS" build that I will setup an example for and also a "Lean-PSK" build that is even smaller. I'll try to get examples of each up here soon. Should I do those examples in this same PR or open a separate PR for those? Regards, KH |
I wouldn't mind having those examples added to this PR, as it would allow to possibly find more bugs and make the build of wolfssl more stable. Also its easier for testing in this stage. Another thing to consider is that some of the examples (e.g. the crypto test) may be better placed under tests/. I'd really like to hear other peoples opinions on this. |
Hi Michel, The end of the year here has picked up in activity quite a bit. Could we schedule this for review as is with the requested changes already implemented? The "Optimized" example is still on our TO-DO list but I am not sure we will have time to implement it before RIOT SUMMIT 2017. The wolfSSL team is eager to see this initial kick-off merged for the relationship between wolfSSL and RIOT.
|
For me the optimized example is not really important and I think that can be done later. What is important: it should be possible to build and run the examples/tests at least for the hardware plattforms that have sufficient memory. If this package only works with native it doesn't make sence to add it. The last time I tried I couldn't build for any board without running into various errors. Unfortunately I won't have much time in the next weeks so it would be nice if someone else can join. @tobhe I know you are eager to use wolfSSL on RIOT ;) @PeterKietzmann we talked about this recently, do you have someone in mind who would like to help here? |
@MichelRottleuthner: I am indeed eager to use this, but I also don't have much time at the moment.
Other boards than native fail with:
I would recommend replacing those with riot api functions before merging. Also, i would consider moving the test and benchmark from |
Hi @MichelRottleuthner and @tobhe, I got busy there for a few weeks but will be back on this in the coming week. We're eager to get this PR in before the RIOT Summit 2017. I can make the change to move test and benchmark to "test" directory and adjust the defines to exclude threading support. In reality though there is no magic build for every platform. This is to get people access to the library to begin using it but they will need to adjust some of the settings depending on the platform. We have a porting guide for this purpose on our website here: https://wolfssl.com/wolfSSL/Docs-wolfssl-porting-guide.html Regards,
|
@kaleb-himes how to proceed with this? |
this needs work, but should stay on release schedule -> postpone |
Sorry for the delay, yes this needs work but I agree would like to keep it on release schedule -> postpone. As the full time support guy here at wolfSSL I have been extremely busy without time to dedicate to testing and implementing support for specific target devices. I would like to add support for at least an Atmel (Now microchip) and one or two other devices before we target a merge. |
Quick question (since IRC is pretty dead on the weekends) wolfcrypt_test/bin/native/wolfssl/wolfcrypt/src
Update makefile line from
|
Hi @kaleb-himes, (IIRC) on native the object file does not contain external shared libraries it depends on, but for samr21-xpro the target is cross-compiled, hence the object file contains all external library function. You should compare the binaries sizes the linker reports at the end of Maybe @gebart and @kaspar030 can also give some more info and reasoning on this? |
Hi @smlng, Even if I compile that file on a Mac osx with full debug symbols the largest I can get sha256 to compile is 21k. I still think there is something else going on here to result in a file 87k large. Any thoughts?
Also this is just the example I went with. I also have files on Mac OS X and the native build that should only be compiling to 7k or 8k and on the samd21-xpro build they are as large as 68k. This does not fit with the explanation above as these even smaller c sources files have no OS level dependencies. Building those same files in Atmel Studio the sizes are comparable to the sizes I see on the native builds. Only when building with RIOT-OS for the samd21-xpro do they become very bloated. |
@kaleb-himes did you look into where the bytes are located? Useful tools include size, objdump and nm |
Thank you so much for the suggestions! The major factor apparently contributing to the bloat are listed below, I've included line numbers for reference and I am attaching the result of running
Apparently that is not the correct flag to be using for disabling debugging. Could you tell me how to turn off debugging?
|
The debugging sections are only symbol definitions for gdb, they are not copied to the actual device ROM. Use
|
@kaleb-himes how is it going? I'd really like to move forward with this. |
That would be great! Thank you for providing a clear path forward and goal, it makes it much easier for me to allocate / dedicate the time to it. I'll see if I can free up some room in my schedule this week to start working on putting together a DTLS example that will work and test it on two separate devices!
|
Apologies my other obligations have delayed any updates. One of my colleagues will be attending RIOT Summit 2018 in September @danielinux. I have sent him your comments and added him as a collaborator on this PR! Many thanks for your patience as we have many tasks competing for priorities RIOT OS is right at the top of our list for open source efforts and we very much look forward to continued efforts between wolfSSL and the RIOT Community!
|
Hi all, Thanks! |
@danielinux so we can close this PR? do you mind updating https://www.wolfssl.com/wolfssl-riot-os-examples/ to the latest PR? i've started there and ended up in #9894 |
yes please
We will take care of it. Thanks |
closing in favour of #10308 |
This PR will introduce wolfSSL as a pkg and contains 4 examples.
Example one is a benchmark example that will measure the wolfCrypt library algorithm performance
Example two is a crypto test that ensures the wolfCrypt library is performing as expected on the device
Example three and four are a client/server example that run on 127.0.0.1 port 11111 by default and display a successful SSL/TLS connection when run from two separate terminals. Ideally either of these may be modified to use custom IP and port for testing on non-native devices and to use the available TCP/IP stack.
For any feedback/concerns/questions feel free to post on this PR or contact me directly kaleb@wolfssl.com