summaryrefslogtreecommitdiff
path: root/nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c
diff options
context:
space:
mode:
authorScott Larson <[email protected]>2020-07-13 13:31:50 -0700
committerScott Larson <[email protected]>2020-07-13 13:31:50 -0700
commitb71efef0391ae1ed7837af0a2292a3b1f848aafb (patch)
tree2b9720b2a4f13069c44967c84c7168ed5d0be459 /nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c
parent101ae22d1e6e4d458aa6d400f4e419593dd4b7dd (diff)
updated to 6.0.1 and added additional processors/toolchainsv6.0.1_rel
Diffstat (limited to 'nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c')
-rw-r--r--nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c b/nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c
index 710b517f..22aea4a7 100644
--- a/nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c
+++ b/nx_secure/src/nx_secure_dtls_process_helloverifyrequest.c
@@ -30,7 +30,7 @@
/* FUNCTION RELEASE */
/* */
/* _nx_secure_dtls_process_helloverifyrequest PORTABLE C */
-/* 6.0 */
+/* 6.0.1 */
/* AUTHOR */
/* */
/* Timothy Stapko, Microsoft Corporation */
@@ -62,6 +62,9 @@
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Timothy Stapko Initial Version 6.0 */
+/* 06-30-2020 Timothy Stapko Modified comment(s), improved */
+/* buffer length verification, */
+/* resulting in version 6.0.1 */
/* */
/**************************************************************************/
UINT _nx_secure_dtls_process_helloverifyrequest(NX_SECURE_DTLS_SESSION *dtls_session,
@@ -69,7 +72,6 @@ UINT _nx_secure_dtls_process_helloverifyrequest(NX_SECURE_DTLS_SESSION *dtls_ses
{
UINT length;
- NX_PARAMETER_NOT_USED(message_length);
/* Parse the HelloVerifyRequest message.
* Structure:
@@ -92,8 +94,13 @@ UINT length;
return(NX_SECURE_TLS_INCORRECT_MESSAGE_LENGTH);
}
+ if ((3u + dtls_session -> nx_secure_dtls_cookie_length) > message_length)
+ {
+ return(NX_SECURE_TLS_INCORRECT_MESSAGE_LENGTH);
+ }
+
/* Save off the cookie. */
- NX_SECURE_MEMCPY(dtls_session -> nx_secure_dtls_cookie, &packet_buffer[length], dtls_session -> nx_secure_dtls_cookie_length);
+ NX_SECURE_MEMCPY(dtls_session -> nx_secure_dtls_cookie, &packet_buffer[length], dtls_session -> nx_secure_dtls_cookie_length);
/* Set our state to indicate we sucessfully parsed the HelloVerifyRequest. */
dtls_session -> nx_secure_dtls_tls_session.nx_secure_tls_client_state = NX_SECURE_TLS_CLIENT_STATE_HELLO_VERIFY;