1
10
13
14
20
21
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
85
86
87
88
89
90
91
92
93
94
95
96
101
102
107
108
109
110
111
112
113
114
115
116
117
...
...
...
#define NX_SECURE_SOURCE_CODE
#include "nx_secure_dtls.h"
#if !defined(NX_SECURE_TLS_CLIENT_DISABLED) && defined(NX_SECURE_ENABLE_DTLS)...
...
UINT _nx_secure_dtls_process_helloverifyrequest(NX_SECURE_DTLS_SESSION *dtls_session,
UCHAR *packet_buffer, UINT message_length)
{
UINT length;
/* ... */
length = 0;
length += 2;
dtls_session -> nx_secure_dtls_cookie_length = packet_buffer[length];
length += 1;
if (dtls_session -> nx_secure_dtls_cookie_length > NX_SECURE_DTLS_MAX_COOKIE_LENGTH)
{
dtls_session -> nx_secure_dtls_cookie_length = 0;
return(NX_SECURE_TLS_INCORRECT_MESSAGE_LENGTH);
}if (dtls_session -> nx_secure_dtls_cookie_length > NX_SECURE_DTLS_MAX_COOKIE_LENGTH) { ... }
if ((3u + dtls_session -> nx_secure_dtls_cookie_length) > message_length)
{
dtls_session -> nx_secure_dtls_cookie_length = 0;
return(NX_SECURE_TLS_INCORRECT_MESSAGE_LENGTH);
}if ((3u + dtls_session -> nx_secure_dtls_cookie_length) > message_length) { ... }
dtls_session -> nx_secure_dtls_client_cookie_ptr = &packet_buffer[length];
dtls_session -> nx_secure_dtls_tls_session.nx_secure_tls_client_state = NX_SECURE_TLS_CLIENT_STATE_HELLO_VERIFY;
return(NX_SECURE_TLS_SUCCESS);
}_nx_secure_dtls_process_helloverifyrequest (NX_SECURE_DTLS_SESSION *dtls_session, UCHAR *packet_buffer, UINT message_length) { ... }
/* ... */#endif