uNetworking / uNetworking/uSockets

WOLFSSL build is broken

Open
#111 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
1.5k
Forks
307
PR merge metrics
No merged PRs in 30d

Description

Just reporting WOLFSSL is broken on 0.5.0 as well.

LOG:

cc -march=native -O2 -pipe -fno-plt -ftree-vectorize -DLIBUS_USE_WOLFSSL -I/usr/local/include -std=c11 -Isrc -flto -O3 -c src/.c src/eventing/.c src/crypto/*.c
In file included from /usr/include/wolfssl/ssl.h:33,
from src/crypto/wolfssl.c:26:
/usr/include/wolfssl/wolfcrypt/settings.h:2060:14: warning: #warning "For timing resistance / side-channel attack prevention consider using harden options" [-Wcpp]
2060 | #warning "For timing resistance / side-channel attack prevention consider using harden options"
| ^~~~~~~
src/crypto/wolfssl.c: In function ‘ssl_on_end’:
src/crypto/wolfssl.c:116:12: warning: implicit declaration of function ‘us_internal_ssl_socket_close’; did you mean ‘us_internal_ssl_socket_write’? [-Wimplicit-function-declaration]
116 | return us_internal_ssl_socket_close(s);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| us_internal_ssl_socket_write
src/crypto/wolfssl.c:116:12: warning: returning ‘int’ from a function with return type ‘struct us_internal_ssl_socket_t *’ makes pointer from integer without a cast [-Wint-conversion]
116 | return us_internal_ssl_socket_close(s);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c: In function ‘ssl_on_data’:
src/crypto/wolfssl.c:142:20: warning: returning ‘int’ from a function with return type ‘struct us_internal_ssl_socket_t *’ makes pointer from integer without a cast [-Wint-conversion]
142 | return us_internal_ssl_socket_close(s);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c:177:24: warning: returning ‘int’ from a function with return type ‘struct us_internal_ssl_socket_t *’ makes pointer from integer without a cast [-Wint-conversion]
177 | return us_internal_ssl_socket_close(s);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c:183:28: warning: returning ‘int’ from a function with return type ‘struct us_internal_ssl_socket_t *’ makes pointer from integer without a cast [-Wint-conversion]
183 | return us_internal_ssl_socket_close(s);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c:238:11: warning: assignment to ‘struct us_internal_ssl_socket_t *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
238 | s = us_internal_ssl_socket_close(s);
| ^
src/crypto/wolfssl.c: At top level:
src/crypto/wolfssl.c:435:6: error: conflicting types for ‘us_internal_ssl_socket_context_on_close’
435 | void us_internal_ssl_socket_context_on_close(struct us_internal_ssl_socket_context_t *context, struct us_internal_ssl_socket_t *(*on_close)(struct us_internal_ssl_socket_t *s)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/crypto/wolfssl.c:21:
src/internal/internal.h:137:6: note: previous declaration of ‘us_internal_ssl_socket_context_on_close’ was here
137 | void us_internal_ssl_socket_context_on_close(struct us_internal_ssl_socket_context_t *context,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c: In function ‘us_internal_ssl_socket_context_on_close’:
src/crypto/wolfssl.c:436:75: warning: passing argument 3 of ‘us_socket_context_on_close’ from incompatible pointer type [-Wincompatible-pointer-types]
436 | context_on_close(0, (struct us_socket_context_t *) context, (struct us_socket_t ()(struct us_socket_t )) ssl_on_close);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct us_socket_t * (
)(struct us_socket_t *)

In file included from src/crypto/wolfssl.c:20:
src/libusockets.h:104:27: note: expected ‘struct us_socket_t * (*)(struct us_socket_t *, int, void )’ but argument is of type ‘struct us_socket_t * ()(struct us_socket_t *)’
104 | struct us_socket_t *(*on_close)(struct us_socket_t *s, int code, void *reason));
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c: At top level:
src/crypto/wolfssl.c:560:34: error: conflicting types for ‘us_internal_ssl_socket_close’
560 | struct us_internal_ssl_socket_t *us_internal_ssl_socket_close(struct us_internal_ssl_socket_t *s) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c:116:12: note: previous implicit declaration of ‘us_internal_ssl_socket_close’ was here
116 | return us_internal_ssl_socket_close(s);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/crypto/wolfssl.c: In function ‘us_internal_ssl_socket_close’:
src/crypto/wolfssl.c:561:48: error: too few arguments to function ‘us_socket_close’
561 | return (struct us_internal_ssl_socket_t *) us_socket_close(0, (struct us_socket_t *) s);
| ^~~~~~~~~~~~~~~
In file included from src/crypto/wolfssl.c:20:
src/libusockets.h:227:34: note: declared here
227 | WIN32_EXPORT struct us_socket_t *us_socket_close(int ssl, struct us_socket_t *s, int code, void *reason);
| ^~~~~~~~~~~~~~~
make: *** [Makefile:41: default] Error 1
==> ERROR: A failure occurred in build().
Aborting...

Tyvm for you awesome work

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing wolfSSL build and compare the declarations in src/internal/internal.h and src/libusockets.h with the implementations and callbacks in src/crypto/wolfssl.c. Confirm the fix by rebuilding with -DLIBUS_USE_WOLFSSL and verify that the reported conflicting types, implicit declaration, and us_socket_close argument errors are gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.