Fixes from review and added REAMEs and setup.sh

Add README.md and setup.sh.
Add READMEs with license information.
This commit is contained in:
Sean Parkinson
2019-02-19 09:21:10 +10:00
parent 5e1eee091a
commit e3997558a9
9 changed files with 118 additions and 5 deletions

41
IDE/zephyr/README.md Normal file
View File

@@ -0,0 +1,41 @@
Zephyr Project Port
===================
## Overview
This port is for Zephyr Project available [here](https://www.zephyrproject.org/).
It provides the following zephyr code.
- zephyr/ext/lib/crypto/wolfssl
- wolfssl library
- zephyr/samples/crypto/wolfssl_test
- wolfcrypt unit test application
- zephyr/samples/crypto/wolfssl_tls_sock
- socket based sample of TLS
- zephyr/samples/crypto/wolfssl_tls_thread
- socket based sample of TLS using threads
## How to setup
### delopy wolfssl source to mynewt project
Specify the path of the mynewt project and execute `wolfssl/IDE/mynewt/setup.sh`.
```bash
./IDE/zephyr/setup.sh /path/to/zephyrproject
```
This script will deploy wolfssl's library code and samples as described in the Overview to the zephyr project.
## build & test
build and execute wolfssl_test
```
cd [zephyrproject]/zephyr/samples/crypto/wolfssl_test
mkdir build && cd build
cmake -GNinja -DBOARD=qemu_x86 ..
ninja
ninja run
```

View File

@@ -0,0 +1,12 @@
wolfSSL (formerly known as CyaSSL) and wolfCrypt are either licensed for use
under the GPLv2 or a standard commercial license. For our users who cannot use
wolfSSL under GPLv2, a commercial license to wolfSSL and wolfCrypt is available.
Please contact wolfSSL Inc. directly at:
Email: licensing@wolfssl.com
Phone: +1 425 245-8247
More information can be found on the wolfSSL website at www.wolfssl.com.

22
IDE/zephyr/setup.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
# Check for zephyr directory on command line
if [ $# -ne 1 ]; then
echo "Usage: $0 'zephyr project root directory path'" 1>&2
exit 1
fi
ZEPHYR_DIR=$1
# Check zephyr directory exists
if [ ! -d $ZEPHR_DIR ]; then
echo "Zephyr project directory does not exist: $ZEPHYR_DIR"
exit 1
fi
cd `dirname $0`
(cd lib; ./install_lib.sh $ZEPHYR_DIR)
(cd wolfssl_test; ./install_test.sh $ZEPHYR_DIR)
(cd wolfssl_tls_sock; ./install_sample.sh $ZEPHYR_DIR)
(cd wolfssl_tls_thread; ./install_sample.sh $ZEPHYR_DIR)

View File

@@ -0,0 +1,12 @@
wolfSSL (formerly known as CyaSSL) and wolfCrypt are either licensed for use
under the GPLv2 or a standard commercial license. For our users who cannot use
wolfSSL under GPLv2, a commercial license to wolfSSL and wolfCrypt is available.
Please contact wolfSSL Inc. directly at:
Email: licensing@wolfssl.com
Phone: +1 425 245-8247
More information can be found on the wolfSSL website at www.wolfssl.com.

View File

@@ -0,0 +1,12 @@
wolfSSL (formerly known as CyaSSL) and wolfCrypt are either licensed for use
under the GPLv2 or a standard commercial license. For our users who cannot use
wolfSSL under GPLv2, a commercial license to wolfSSL and wolfCrypt is available.
Please contact wolfSSL Inc. directly at:
Email: licensing@wolfssl.com
Phone: +1 425 245-8247
More information can be found on the wolfSSL website at www.wolfssl.com.

View File

@@ -0,0 +1,12 @@
wolfSSL (formerly known as CyaSSL) and wolfCrypt are either licensed for use
under the GPLv2 or a standard commercial license. For our users who cannot use
wolfSSL under GPLv2, a commercial license to wolfSSL and wolfCrypt is available.
Please contact wolfSSL Inc. directly at:
Email: licensing@wolfssl.com
Phone: +1 425 245-8247
More information can be found on the wolfSSL website at www.wolfssl.com.

View File

@@ -238,9 +238,9 @@ int EmbedSend(WOLFSSL* ssl, char *buf, int sz, void *ctx)
int sd = *(int*)ctx;
int sent;
#ifdef MAX_SEND_SZ
if (sz > MAX_SEND_SZ)
sz = MAX_SEND_SZ;
#ifdef WOLFSSL_MAX_SEND_SZ
if (sz > WOLFSSL_MAX_SEND_SZ)
sz = WOLFSSL_MAX_SEND_SZ;
#endif
sent = wolfIO_Send(sd, buf, sz, ssl->wflags);

View File

@@ -489,7 +489,7 @@ XFILE z_fs_open(const char* filename, const char* perm)
{
XFILE file;
file = XMALLOC(sizeof(file), NULL, DYNAMIC_TYPE_FILE);
file = XMALLOC(sizeof(*file), NULL, DYNAMIC_TYPE_FILE);
if (file != NULL) {
if (fs_open(file, filename) != 0) {
XFREE(file);

View File

@@ -260,7 +260,9 @@
#define SEND_FUNCTION NU_Send
#define RECV_FUNCTION NU_Recv
#elif defined(WOLFSSL_ZEPHYR)
#define MAX_SEND_SZ 256
#ifndef WOLFSSL_MAX_SEND_SZ
#define WOLFSSL_MAX_SEND_SZ 256
#endif
#define SEND_FUNCTION send
#define RECV_FUNCTION recv