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

为何Not supporting multiplethreading? #5

Open
ygm521 opened this issue May 21, 2019 · 7 comments
Open

为何Not supporting multiplethreading? #5

ygm521 opened this issue May 21, 2019 · 7 comments

Comments

@ygm521
Copy link

ygm521 commented May 21, 2019

No description provided.

@ygm521
Copy link
Author

ygm521 commented May 21, 2019

是因为下面?还有哪些有影响?这个是当时写代码方便还是考虑到nginx一次没有发送完毕下次接着从全局变量中继续发送剩余的?谢谢
u8 a_tls_tmp_record_buf[16384];
u8 a_tls_tmp_msg_buf[16384];
u8 a_tls_tmp_ciphertext_buf[16384];
u8 a_tls_tmp_msg_read_buf[16384];
u8 am_cnt[16384] = {0};

@ygm521
Copy link
Author

ygm521 commented May 22, 2019

@mrpre a_tls_get_finished_prf 中哪里体现了使用对称密钥加密的?

@mrpre
Copy link
Owner

mrpre commented May 22, 2019

使用较多全局变量,故不支持多线程(后续可改为每线程变量)。
a_tls_get_finished_prf 没有使用对称秘钥加密,但是计算时使用了主秘钥。

@ygm521
Copy link
Author

ygm521 commented May 22, 2019

@mrpre 想把你的代码移植到nginx的http模块中,如何切入麻烦指点下,谢谢!

@mrpre
Copy link
Owner

mrpre commented May 22, 2019

@ygm521 你可以先通过stream模块进行ssl卸载,然后转发的本地的http服务。
之所以这里使用 stream 承载 atls,完全是因为 当初尝试使用http模块支持atls,发现对nginx core改动量非常大,不合适。你可以 在ngx_http_init_connection 中 将rev->handler = ngx_http_ssl_handshake;替换为其他的handshake。

@ygm521
Copy link
Author

ygm521 commented May 22, 2019

@mrpre 我公司同事使用改造的openssl,nginx改动较少,等有时间我研究研究下,不过openssl是参考gmssl移植的国密算法。

@mrpre
Copy link
Owner

mrpre commented May 22, 2019

@ygm521 改造openssl当然是最合理的方法,因为Nginx本身就是基于OpenSSL实现SSL的,增加国密只需要增加几个指令以及其他适配的修改即可。

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