Commit ba4a9efc authored by Jongmin Choi's avatar Jongmin Choi Committed by Randeep

Fix ownership transfer issues

Fix issues related to ownership transfer
- Port change after failed ownership transfer

Patch #1: initial upload
Patch #2: build error fix

Change-Id: Ia6df0e7b862f73fab166ccb2c8ceee6c348b8189
Signed-off-by: default avatarJongmin Choi <jminl.choi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16371Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarJoonghwan Lee <jh05.lee@samsung.com>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
(cherry picked from commit 75bd7cd6)
Reviewed-on: https://gerrit.iotivity.org/gerrit/16417Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
parent 6d854975
......@@ -235,21 +235,22 @@ if (0 != (ret) && MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY != (int) (ret) &&
MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL != (int) (ret)) \
{ \
OIC_LOG_V(ERROR, NET_SSL_TAG, "%s: -0x%x", (str), -(ret)); \
if ((int) MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE != (int) (ret)) \
if ((int) MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE != (int) (ret) && \
(int) MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO != (int) (ret)) \
{ \
mbedtls_ssl_send_alert_message(&(peer)->ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL, (msg)); \
} \
SSL_RES((peer), CA_DTLS_AUTHENTICATION_FAILURE); \
RemovePeerFromList(&(peer)->sep.endpoint); \
if (mutex) \
{ \
oc_mutex_unlock(g_sslContextMutex); \
} \
SSL_RES((peer), CA_DTLS_AUTHENTICATION_FAILURE); \
OIC_LOG_V(DEBUG, NET_SSL_TAG, "Out %s", __func__); \
if (-1 != error) \
{ \
return (error); \
} \
} \
}
/**@def CONF_SSL(clientConf, serverConf, fn, ...)
*
......@@ -1841,7 +1842,6 @@ CAResult_t CAdecryptSsl(const CASecureEndpoint_t *sep, uint8_t *data, uint32_t d
if (MBEDTLS_SSL_HANDSHAKE_OVER == peer->ssl.state)
{
SSL_RES(peer, CA_STATUS_OK);
if (MBEDTLS_SSL_IS_CLIENT == peer->ssl.conf->endpoint)
{
SendCacheMessages(peer);
......
......@@ -463,9 +463,9 @@ static void SetResult(OTMContext_t* otmCtx, const OCStackResult res)
{
OIC_LOG(WARNING, TAG, "Internal error in PDMDeleteDevice");
}
CAEndpoint_t* endpoint = (CAEndpoint_t *)&otmCtx->selectedDeviceInfo->endpoint;
endpoint->port = otmCtx->selectedDeviceInfo->securePort;
if (CA_STATUS_OK != CAcloseSslConnection(endpoint))
CAEndpoint_t endpoint;
memcpy(&endpoint, &(otmCtx->selectedDeviceInfo->endpoint), sizeof(CAEndpoint_t));
if (CA_STATUS_OK != CAcloseSslConnection(&endpoint))
{
OIC_LOG(WARNING, TAG, "Failed to close Secure session");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment