eclipse-threadx / netxduo

Eclipse ThreadX - NetXDuo is an advanced, industrial-grade TCP/IP network stack designed specifically for deeply embedded real-time and IoT applications
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/netx-duo/index.md
MIT License
247 stars 140 forks source link

nx_secure_tls_server_state variable should not be removed if using TLS1.3 #38

Closed ReKawashima closed 3 years ago

ReKawashima commented 3 years ago

In NetX Secure TLS 1.3, I think nx_secure_tls_server_state variable is necessary in TLS Client mode to save the state of server. But, if disabled server function by NX_SECURE_TLS_SERVER_DISABLED macro to reduce code and data usage, this variable is removed. So, we get build error "NX_SECURE_TLS_SESSION' has no member named 'nx_secure_tls_server_state".

I think nx_secure_tls_server_state variable should not be removed if using TLS1.3.

I suggest the following change.

Incorrect #ifndef NX_SECURE_TLS_SERVER_DISABLED
    / The state of the server handshake if this is a server socket. /
    NX_SECURE_TLS_SERVER_STATE nx_secure_tls_server_state;
#endif
(See https://github.com/azure-rtos/netxduo/blob/master/nx_secure/inc/nx_secure_tls.h#L1206)
Correct #if !defined(NX_SECURE_TLS_SERVER_DISABLED) || (NX_SECURE_TLS_TLS_1_3_ENABLED)
    / The state of the server handshake if this is a server socket. /
    NX_SECURE_TLS_SERVER_STATE nx_secure_tls_server_state;
#endif
TiejunMS commented 3 years ago

Thanks @ReKawashima ! We will fix it in the next release.

TiejunMS commented 3 years ago

@ReKawashima , I'm sorry to let you know that the fix is not in the 6.1.8 release. We are working on it right now and will be included in 6.1.9 release.

ReKawashima commented 3 years ago

@TiejunMS -san, Thank you for information. I'll check the fix after v6.1.9 release. Closing this ticket. Thanks.