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

sslbox mbedtls support #179

Open
dongdan002 opened this issue Sep 12, 2023 · 5 comments
Open

sslbox mbedtls support #179

dongdan002 opened this issue Sep 12, 2023 · 5 comments

Comments

@dongdan002
Copy link
Contributor

dongdan002 commented Sep 12, 2023

Since the company's other projects use mbedtls, and most are embedded devices, openssl is a bit large.

I modified the toolkit project myself to use mbedtls, and the process can run through, it works under the main function, but it will crash with memory out of bounds when put into qt or other projects.

And it didn't crash in the code.

I don't know if the author has tried to support the mbedtls version, or if anyone has integrated it, you can contribute. I can also upload my incomplete version later.

由于公司其他项目用的是mbedtls,且多是嵌入式设备,openssl有点大。
自己在toolkit工程里改造了一下,使用mbedtls,可以跑通流程,main函数下可以的,但是放到qt或者其他工程里会有内存越界的崩溃。
又没有蹦在代码里。

不知道作者有没有尝试支持mbedtls的版本,或者大家有没有集成过的,可以贡献一下。后边我也可以把我这个不完整的版本传上来

TRANS_BY_GITHUB_AI_ASSISTANT

@dongdan002
Copy link
Contributor Author

dongdan002 commented Sep 12, 2023

The difficulty of using mbedtls is that it does not use the internal net_socket. Data sending and receiving rely on the toolkit's socketclient, and ssl only performs handshakes.

mbedtls_ssl_set_bio( &ssl, 0, custom_net_send, custom_net_recv, NULL );

Custom sending: custom_net_send calls the toolkit's socket to send.
Custom receiving: custom_net_recv puts the socket data received by the toolkit into a cache, and custom_net_recv reads from the cache.

使用mbedtls的难点是不使用内部的net_socket。数据的收发依赖toolkit的socketclient, ssl只做握手。

mbedtls_ssl_set_bio( &ssl, 0, custom_net_send, custom_net_recv, NULL );

自定义发送:custom_net_send 回调给toolkit 的socket去发送
自定义接收:custom_net_recv tookit recv 的socket数据线放到一个缓存里,custom_net_recv 去缓存里读。

TRANS_BY_GITHUB_AI_ASSISTANT

@dongdan002
Copy link
Contributor Author

dongdan002 commented Sep 12, 2023

@mtdxc Have you done this before with Xiaogong? Can you give me some advice?
SSLBox.cpp.log
SSLBox.h.log

@mtdxc 夏工之前有做过吗,可以给点建议吗?
SSLBox.cpp.log
SSLBox.h.log

TRANS_BY_GITHUB_AI_ASSISTANT

@xia-chu
Copy link
Member

xia-chu commented Sep 12, 2023

I haven't done any development adaptation for mbedtls, but can OpenSSL also be compiled with pruning?

没做过 mbedtls的开发适配 不过openssl是不是也可以裁剪编译?

TRANS_BY_GITHUB_AI_ASSISTANT

@dongdan002
Copy link
Contributor Author

dongdan002 commented Sep 12, 2023

Okay, thank you very much. I haven't looked into cropping yet, mainly because the company's embedded and mobile ends use mbedtls and we don't want to add more libraries. The current logic can barely run, but it will crash. I'll look into it further.

好的,非常感谢。裁剪这个还没有研究过,主要是公司嵌入式和移动端用了mbedtls 不想再加库了。现在的逻辑勉强可以跑通,但是会崩溃。我再研究下。

TRANS_BY_GITHUB_AI_ASSISTANT

@xia-chu
Copy link
Member

xia-chu commented Sep 12, 2023

好的,非常感谢。裁剪这个还没有研究过,主要是公司嵌入式和移动端用了mbedtls 不想再加库了。现在的逻辑勉强可以跑通,但是会崩溃。我再研究下。

General systems will have OpenSSL in memory, otherwise the SSH server cannot run.

好的,非常感谢。裁剪这个还没有研究过,主要是公司嵌入式和移动端用了mbedtls 不想再加库了。现在的逻辑勉强可以跑通,但是会崩溃。我再研究下。

一般的系统都会内存openssl的 否则ssh sever没法运行

TRANS_BY_GITHUB_AI_ASSISTANT

@alexliyu7352 alexliyu7352 changed the title sslbox mbedtls 支持 sslbox mbedtls support Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants