-
Notifications
You must be signed in to change notification settings - Fork 191
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
NTLS允许设置security level和proto version #310
base: master
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
ping @InfoHunter @dongbeiouba
@wa5i 你需要aprrove,不然现在处于是requested changes状态 |
* Session tickets are disabled. | ||
*/ | ||
if (nid == NTLS_VERSION) { | ||
return level > 3 ? 0 : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我理解level >= 3返回0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于NTLS国密协议,level >3返回0; level<=3是适合的,所以返回1. 因为level 3要求ECC密钥至少256位,而国密SSL证书的sm2采用256位密码长度,加密强度等同于3072位RSA证书,所以NTLS1.1满足SSL安全等级level 3的要求。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前的TLCP 1.1并不支持前项安全。
@dongbeiouba 请再review一下 |
* Session tickets are disabled. | ||
*/ | ||
if (nid == NTLS_VERSION) { | ||
return level > 3 ? 0 : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前的TLCP 1.1并不支持前项安全。
请 @dongbeiouba 大佬确认 |
确认啥?还是没有修改。 如果方便的话,也可以进钉钉群,直接聊更高效一些。 |
NTLSv1.1协议中的ECDHE-SM2-SM4-CBC-SM3支持前向安全,不用修改? |
return 0; | ||
|
||
/*- | ||
* NTLS v1.1 not suitable for above level 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
就把这一行注释留下就行,其他没必要,删除吧
只是个人想法,能不能对 TLS 和 NTLS 分别设置呢? 比如一个server,同时支持国际 TLS 和 NTLS。当使用 TLS 时,我希望使用 TLS 1.2+, NTLS 使用 NTLS 1.1 (目前应该完全不能设置 SSL_CTX_set_min_proto_version / SSL_CTX_set_max_proto_version,后续会报 unsupported protocol 错误 SSL_CTX_set_min_proto_version(ctx, TLS1_1_VERSION);
SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION);
// 然后 NTLS 使用单独的配置
SSL_CTX_set_min_proto_version_ntls(ctx, NTLS1_1_VERSION);
SSL_CTX_set_max_proto_version_ntls(ctx, NTLS1_1_VERSION); |
NTLS允许设置security level和proto version
SSL_CTX_set_security_level(ctx, 2);
SSL_CTX_set_min_proto_version(ctx, NTLS1_1_VERSION);
SSL_CTX_set_max_proto_version(ctx, NTLS1_1_VERSION);