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 支持 #179

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

sslbox mbedtls 支持 #179

dongdan002 opened this issue Sep 12, 2023 · 5 comments

Comments

@dongdan002
Copy link
Contributor

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

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

@dongdan002
Copy link
Contributor Author

使用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 去缓存里读。

@dongdan002
Copy link
Contributor Author

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

@xia-chu
Copy link
Member

xia-chu commented Sep 12, 2023

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

@dongdan002
Copy link
Contributor Author

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

@xia-chu
Copy link
Member

xia-chu commented Sep 12, 2023

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

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

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

No branches or pull requests

2 participants