+http://suprem.sec.samsung.net/jira/browse/CONPRO-1142
+
+commit_info_2017-11-23.txt
+
+commit_id: 2cca3e2b4d8aad38e38cfa8c8081c0891d82f264
+----------------------------------------------------------------------------------------------------------------------------------
http://suprem.sec.samsung.net/jira/browse/CONPRO-1131
commit_info_2017-11-14.txt
#define TAG "OIC_CA_LE_SERVER"
/**
- * Initial buffer size for Gatt Server.
- */
-#define CA_LE_INITIAL_BUF_SIZE 512
-
-/**
* The handle of the OIC server.
*/
static bt_gatt_server_h g_gattServer = NULL;
// For Read Characteristics.
ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charReadUUID, charReadValue,
- CA_LE_INITIAL_BUF_SIZE, true);
+ sizeof(charReadValue), true);
if (CA_STATUS_OK != ret)
{
OIC_LOG_V(ERROR, TAG, "CAAddNewCharacteristicsToGattServer failed[%d]", ret);
ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charWriteUUID, charWriteValue,
- CA_LE_INITIAL_BUF_SIZE, false); // For Write Characteristics.
+ sizeof(charWriteValue), false); // For Write Characteristics.
if (CA_STATUS_OK != ret )
{
OIC_LOG_V(ERROR, TAG, "CAAddNewCharacteristicsToGattServer failed[%d]", ret);
*/
//#define TAG "OIC_CA_LE_SERVER_MCD"
#define TAG BLE_SERVER_MCD_TAG
-/**
- * Initial buffer size for Gatt Server.
- */
-#define CA_LE_INITIAL_BUF_SIZE 512
/**
* The handle of the OIC server.
// For Read Characteristics.
ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charReadUUID, charReadValue,
- CA_LE_INITIAL_BUF_SIZE, true);
+ sizeof(charReadValue), true);
if (CA_STATUS_OK != ret)
{
OIC_LOG_V(ERROR, TAG, "CAAddNewCharacteristicsToGattServer failed[%d]", ret);
ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charWriteUUID, charWriteValue,
- CA_LE_INITIAL_BUF_SIZE, false); // For Write Characteristics.
+ sizeof(charWriteValue), false); // For Write Characteristics.
if (CA_STATUS_OK != ret )
{
OIC_LOG_V(ERROR, TAG, "CAAddNewCharacteristicsToGattServer failed[%d]", ret);
* Logging tag for module name
*/
#define TAG "OIC_CA_LE_SERVER_VD"
-/**
- * Initial buffer size for Gatt Server.
- */
-#define CA_LE_INITIAL_BUF_SIZE 512
/**
* The handle of the OIC server.
// For Read Characteristics.
ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charReadUUID, charReadValue,
- CA_LE_INITIAL_BUF_SIZE, true);
+ sizeof(charReadValue), true);
if (CA_STATUS_OK != ret)
{
OIC_LOG_V(ERROR, TAG, "CAAddNewCharacteristicsToGattServer failed[%d]", ret);
ret = CAAddNewCharacteristicsToGattServer(g_gattSvcPath, charWriteUUID, charWriteValue,
- CA_LE_INITIAL_BUF_SIZE, false); // For Write Characteristics.
+ sizeof(charWriteValue), false); // For Write Characteristics.
if (CA_STATUS_OK != ret )
{
OIC_LOG_V(ERROR, TAG, "CAAddNewCharacteristicsToGattServer failed[%d]", ret);
goto exit;
}
- if (CADropSecondMessage(&caglobals.ca.requestHistory, endpoint, reqInfo->info.messageId,
+ if ((reqInfo->info.type != CA_MSG_CONFIRM) &&
+ CADropSecondMessage(&caglobals.ca.requestHistory, endpoint, reqInfo->info.messageId,
reqInfo->info.token, reqInfo->info.tokenLength))
{
OIC_LOG(INFO, TAG, "Second Request with same Token, Drop it");
{
OIC_LOG(ERROR, TAG, "Failed to disconnect TCP session");
}
+
+ CASearchAndDeleteTCPSession(&svritem->sep.endpoint);
+ return;
}
}
return;
}
+ OIC_LOG_V(INFO, TAG, "Cert Buf Length: %lu", *crtBufLen);
+ OIC_LOG(INFO, TAG, "[Cert Buf] : ");
+ OIC_LOG_BUFFER(INFO, TAG, crtBuf, *crtBufLen);
+
mbedtls_x509_crt deviceCert;
int ret = 0;
{
OIC_LOG_V(INFO, TAG, "In %s", __func__);
- if (NULL == getHwKeyContext || NULL == freeHwKeyContext
- || NULL == getOwnCertCb || NULL == setupPkContextCb)
+ if (NULL == getHwKeyContext && NULL == freeHwKeyContext
+ && NULL == getOwnCertCb && NULL == setupPkContextCb)
+ {
+ OIC_LOG(INFO, TAG, "Unregistering callbacks");
+ }
+ else if (NULL == getHwKeyContext || NULL == freeHwKeyContext
+ || NULL == getOwnCertCb || NULL == setupPkContextCb)
{
OIC_LOG(ERROR, TAG, "NULL Passed");
OIC_LOG(ERROR, TAG, "Callback function parameters can not be null");
gHwPkixCtx.getOwnCertCb = getOwnCertCb;
gHwPkixCtx.setupPkContextCb = setupPkContextCb;
- if (gHwPkixCtx.hwKeyCtx)
+ if (gHwPkixCtx.hwKeyCtx && NULL != freeHwKeyContext)
{
gHwPkixCtx.freeHwKeyContext(gHwPkixCtx.hwKeyCtx);
}