return NULL;
}
-static CAResult_t CAAddIdToPeerInfoList(const char *peerAddr, uint32_t port,
+static CAResult_t CAAddIdToPeerInfoList(const char *peerAddr, uint16_t port,
const unsigned char *id, uint16_t id_length, CATransportFlags_t flag)
{
if(NULL == peerAddr
g_caDtlsContext->peerInfoList = NULL;
}
-static void CARemovePeerFromPeerInfoList(const char * addr, uint32_t port)
+static void CARemovePeerFromPeerInfoList(const char * addr, uint16_t port)
{
if (NULL == addr || 0 >= port)
{
OIC_LOG(INFO, NET_DTLS_TAG, "Peer closing connection");
stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session;
- char *peerAddr = NULL;
- uint32_t port = 0;
- CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, port);
+ char peerAddr[MAX_ADDR_STR_SIZE_CA] = {0};
+ uint16_t port = 0;
+ CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, &port);
CARemovePeerFromPeerInfoList(peerAddr, port);
}
// data structure when handshake completes. Therefore, currently this is a
// workaround to cache remote end-point identity when tinyDTLS asks for PSK.
stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session;
- char *peerAddress = NULL;
- uint32_t port = 0;
- CAConvertAddrToName(&(addrInfo->addr.st), peerAddress, port);
+ char peerAddress[MAX_ADDR_STR_SIZE_CA] = {0};
+ uint16_t port = 0;
+ CAConvertAddrToName(&(addrInfo->addr.st), peerAddress, &port);
CATransportFlags_t flag =
addrInfo->addr.st.ss_family == AF_INET ? CA_IPV4 : CA_IPV6;