Skip to content

Added example for RIOT-OS using lwIP POSIX sockets#252

Merged
dgarske merged 2 commits intowolfSSL:masterfrom
danielinux:riot-os-posix-lwip
May 11, 2021
Merged

Added example for RIOT-OS using lwIP POSIX sockets#252
dgarske merged 2 commits intowolfSSL:masterfrom
danielinux:riot-os-posix-lwip

Conversation

@danielinux
Copy link
Copy Markdown
Member

No description provided.

wolfSSL_Init();

/* Create and initialize WOLFSSL_CTX */
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would TLS 1.3 work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLS1.3 can be switched on by adding USEMODULE+=wolfssl_tls13 to the makefile.

TLS1.3 in RIOT depends on sock_tls, I've submitted a PR to remove this forced dependency and make TLS1.3 available for POSIX/lwIP sockets.

RIOT-OS/RIOT#16266

Copy link
Copy Markdown
Member

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job! Just a few minor notes (as we discussed).

Comment thread riot-os-posix-lwip/Makefile Outdated
APPLICATION = posix-tls

# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../RIOT
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be easier out of the box experience using RIOTBASE ?= $(CURDIR)/../../RIOT. That allows wolfssl-examples and RIOT to be side by side.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, fixed. Thanks!


### Run the server
```bash
$ make all RIOTBASE=/path/to/riot-os; PORT=tap1 make term
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had issue on Ubuntu. Needed to install sudo apt-get install gcc-multilib.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the PORT=tap1 make term I needed to add sudo. Got:

RIOT TLS testing implementation
/home/davidgarske/GitHub/wolfssl-examples/riot-os-posix-lwip/bin/native/posix-tls.elf: ioctl TUNSETIFF: Operation not permitted
/home/davidgarske/GitHub/wolfssl-examples/riot-os-posix-lwip/bin/native/posix-tls.elf: probably the tap interface (tap1) does not exist or is already in use
make: *** [/home/davidgarske/GitHub/wolfssl-examples/riot-os-posix-lwip/../../RIOT/Makefile.include:749: term] Error 1

Otherwise chmod /dev/net/tune as you said.. Might be good to add note.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added info about pre-requisites and tuntap usage to the README.md.

Comment thread riot-os-posix-lwip/README.md Outdated
### Run the server
```bash
$ make all RIOTBASE=/path/to/riot-os; PORT=tap1 make term
> ip
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No "ip" command for me? Just "ifconfig", which shows:

> ifconfig
ifconfig
lo_01:
ET_00:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed confusing section from README (valid only with LWIP_IPV6 configuration)

@dgarske dgarske merged commit 099ec3b into wolfSSL:master May 11, 2021
yota22721 pushed a commit to yota22721/wolfssl-examples that referenced this pull request Jan 25, 2025
Added example for RIOT-OS using lwIP POSIX sockets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants