From ab8b71a3b607e3115dbfa812cc3a25cc08187628 Mon Sep 17 00:00:00 2001 From: Dan Mihai Date: Mon, 1 May 2017 17:25:39 -0700 Subject: [PATCH] [IOT-2121] [IOT-2116] Fix CTT "message mac does not match" Test case CT1.7.2.1-2 from CTT v1.5.6 fails with "message mac does not match": - After CTT successfully posted the owner credential - While trying to establish a new DTLS session, using the new credential Change-Id: I282632d1071c76afba629081d6853d376c347473 Signed-off-by: Dan Mihai Reviewed-on: https://gerrit.iotivity.org/gerrit/19515 Reviewed-by: Kevin Kane Reviewed-by: Nathan Heldt-Sheller Tested-by: Nathan Heldt-Sheller --- resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c index 4657182..5e1cd3d 100644 --- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c +++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c @@ -2403,7 +2403,7 @@ static int pHash (const unsigned char *key, size_t keyLen, CHECK_MBEDTLS_RET(mbedtls_md_hmac_starts, &hmacP, key, keyLen); - while (len + dLen < bufLen) + while (len + dLen <= bufLen) { CHECK_MBEDTLS_RET(mbedtls_md_hmac_reset, &hmacP); CHECK_MBEDTLS_RET(mbedtls_md_hmac_starts, &hmacP, key, keyLen); -- 2.7.4