Update snapshot(2017-11-23) 31/161531/1 accepted/tizen/unified/20171124.064710 submit/tizen/20171124.015816
authorHongkuk, Son <hongkuk.son@samsung.com>
Fri, 24 Nov 2017 01:49:14 +0000 (10:49 +0900)
committerHongkuk, Son <hongkuk.son@samsung.com>
Fri, 24 Nov 2017 01:49:36 +0000 (10:49 +0900)
Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com>
Change-Id: I4daa62ca37c2ef8e0a739f63a258022ccdc354d8

packaging/snapshot_history.txt
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_mcd.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c
resource/csdk/connectivity/src/camessagehandler.c
resource/csdk/connectivity/src/tcp_adapter/catcpserver.c
resource/csdk/security/src/pkix_interface.c

index 9b727a7..51607b8 100755 (executable)
@@ -1,3 +1,9 @@
+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
index 09f36d4..4b16e70 100644 (file)
 #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;
@@ -209,7 +204,7 @@ CAResult_t CAStartLEGattServer()
 
     // 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);
@@ -223,7 +218,7 @@ CAResult_t CAStartLEGattServer()
 
 
     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);
index a7273e7..6913289 100644 (file)
  */
 //#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.
@@ -278,7 +274,7 @@ CAResult_t CAStartLEGattServer()
 
     // 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);
@@ -292,7 +288,7 @@ CAResult_t CAStartLEGattServer()
 
 
     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);
index ef3654b..ab1f153 100755 (executable)
  * 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.
@@ -228,7 +224,7 @@ CAResult_t CAStartLEGattServer()
 
     // 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);
@@ -242,7 +238,7 @@ CAResult_t CAStartLEGattServer()
 
 
     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);
index bb9d829..394a728 100755 (executable)
@@ -201,7 +201,8 @@ static CAData_t* CAGenerateHandlerData(const CAEndpoint_t *endpoint,
             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");
index 2d7df00..78b43bb 100644 (file)
@@ -616,6 +616,9 @@ static void CAReceiveMessage(int fd)
         {
             OIC_LOG(ERROR, TAG, "Failed to disconnect TCP session");
         }
+
+        CASearchAndDeleteTCPSession(&svritem->sep.endpoint);
+        return;
     }
 }
 
index dc807d3..5b1dc61 100644 (file)
@@ -106,6 +106,10 @@ void CheckInvalidDERSignature(uint8_t *crtBuf, size_t *crtBufLen)
         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;
 
@@ -431,8 +435,13 @@ int SetHwPkixCallbacks(GetHwKeyContext getHwKeyContext,
 {
     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");
@@ -444,7 +453,7 @@ int SetHwPkixCallbacks(GetHwKeyContext getHwKeyContext,
     gHwPkixCtx.getOwnCertCb = getOwnCertCb;
     gHwPkixCtx.setupPkContextCb = setupPkContextCb;
 
-    if (gHwPkixCtx.hwKeyCtx)
+    if (gHwPkixCtx.hwKeyCtx && NULL != freeHwKeyContext)
     {
         gHwPkixCtx.freeHwKeyContext(gHwPkixCtx.hwKeyCtx);
     }