Skip to content
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

sockets_tls: missing sendmsg #20431

Closed
mrfuchs opened this issue Nov 7, 2019 · 0 comments · Fixed by #20586
Closed

sockets_tls: missing sendmsg #20431

mrfuchs opened this issue Nov 7, 2019 · 0 comments · Fixed by #20586
Assignees
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@mrfuchs
Copy link
Contributor

mrfuchs commented Nov 7, 2019

The current MQTT and WebSocket implementations allow setting up secure websocket connections. However, as sockets_tls.c does not provide a sendmsg implementation, the communication will fail once websocket_prepare_and_send() is being called.

static const struct socket_op_vtable tls_sock_fd_op_vtable = {
.fd_vtable = {
.read = tls_sock_read_vmeth,
.write = tls_sock_write_vmeth,
.ioctl = tls_sock_ioctl_vmeth,
},
.bind = tls_sock_bind_vmeth,
.connect = tls_sock_connect_vmeth,
.listen = tls_sock_listen_vmeth,
.accept = tls_sock_accept_vmeth,
.sendto = tls_sock_sendto_vmeth,
.recvfrom = tls_sock_recvfrom_vmeth,
.getsockopt = tls_sock_getsockopt_vmeth,
.setsockopt = tls_sock_setsockopt_vmeth,
};

return sendmsg(ctx->real_sock, &msg,
timeout == K_NO_WAIT ? MSG_DONTWAIT : 0);

@mrfuchs mrfuchs added the bug The issue is a bug, or the PR is fixing a bug label Nov 7, 2019
mrfuchs added a commit to mrfuchs/zephyr that referenced this issue Nov 11, 2019
Add an implementation for `sendmsg`, so secure sockets can be used
together with the WebSocket module to implement secure WebSockets
("wss").

Fixes zephyrproject-rtos#20431

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
@dleach02 dleach02 added has-pr priority: medium Medium impact/importance bug labels Nov 12, 2019
nashif pushed a commit that referenced this issue Nov 27, 2019
Add an implementation for `sendmsg`, so secure sockets can be used
together with the WebSocket module to implement secure WebSockets
("wss").

Fixes #20431

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants