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

Support TLS1.3 and ShangMi Ciphersuites. #35

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

ZBCccc
Copy link
Contributor

@ZBCccc ZBCccc commented Oct 10, 2024

  • Refactoring and Code Cleanup: Improved code readability by renaming variables to follow Go naming conventions and adding comments for clarity.

  • TLSv1.3 Support: Added constructors and tests for TLSv1.3 connections, including specific cipher suite configurations.

  • ShangMi Ciphersuit Support: Added tests for ShangMi Ciphersuit with TLS1.3.

  • Testing Enhancements: Introduced new tests for various SSL/TLS scenarios, including full-duplex renegotiation and handling a large number of connections.

  • Version Handling: Updated SSL version constants and methods to support TLSv1.3, and added functionality to set minimum and maximum protocol versions.

  • Example Updates: Modified example server and client to support dynamic TLS version selection via command-line arguments.

if err != nil {
log.Println(err)
return nil, err
}

err = ctx.SetCipherList("ECC-SM2-SM4-CBC-SM3")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

密码套件设置应该来自于命令行参数,这里为啥设置成ECC-SM2-SM4-CBC-SM3,对于TLS协议不生效

@ZBCccc ZBCccc changed the title Support tls1.3 and ShangMi cipher suit. Support tls1.3 and ShangMi cipher suite. Oct 10, 2024
@ZBCccc ZBCccc changed the title Support tls1.3 and ShangMi cipher suite. Support TLS1.3 and ShangMi Ciphersuites. Oct 10, 2024
if signCertFile != "" {
signCertPEM, err := os.ReadFile(signCertFile)
if err != nil {
if cipherSuites == "TLS_SM4_GCM_SM3" || cipherSuites == "TLS_SM4_CCM_SM3" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该根据协议版本来判断,而不是密码套件,TLS 1.3中不止TLS_SM4_GCM_SM3和TLS_SM4_CCM_SM3这2个密码套件,如果协议版本号大于等于TLS 1.3,使用SetCipherSuites(),否则使用SetCipherList()。

if err != nil {
log.Println(err)
return nil, err
}

if cipherSuites == "TLS_SM4_GCM_SM3" || cipherSuites == "TLS_SM4_CCM_SM3" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Member

@dongbeiouba dongbeiouba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dongbeiouba dongbeiouba merged commit f7742f8 into Tongsuo-Project:main Oct 11, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants