From 01545a046af2333cea7bfdb7064b0f2477307c1f Mon Sep 17 00:00:00 2001 From: Vitalii Irkha Date: Thu, 31 Oct 2019 13:29:02 +0200 Subject: [PATCH] Fix OTM issue during DTLS handshake Revert all secure resources after DTLS handshake error https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/592/commits/ba8ed7dda2f9516ed446a65b877f26a506567491 (cherry-picked from ba8ed7dda2f9516ed446a65b877f26a506567491) Change-Id: I3a94587fe5a31f5c6f889c74cbbb4ea0a293fbf6 Signed-off-by: Vitalii Irkha Signed-off-by: Sudipto Bal --- resource/csdk/security/src/srmutility.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resource/csdk/security/src/srmutility.c b/resource/csdk/security/src/srmutility.c index 1b8cd21..950e6bb 100644 --- a/resource/csdk/security/src/srmutility.c +++ b/resource/csdk/security/src/srmutility.c @@ -320,9 +320,8 @@ static void DTLSHandshakeServerCB(const CAEndpoint_t *endpoint, const CAErrorInf if (CA_STATUS_OK != info->result) { OIC_LOG(ERROR, TAG, "Failed to establish a secure session with owner device."); - OIC_LOG(ERROR, TAG, "Doxm/Pstat resource will be reverted to init state."); - RestoreDoxmToInitState(); - RestorePstatToInitState(); + ResetSecureResourceInPS(); + OIC_LOG(INFO, TAG, "Secure Resources reverted."); InvokeOtmEventHandler(endpoint->addr, endpoint->port, NULL, OIC_OTM_ERROR); } } -- 2.7.4