Merge branch '1.3-rel' (f7bfd4a) 71/22471/2
authorGeorge Nash <george.nash@intel.com>
Thu, 14 Sep 2017 18:10:15 +0000 (11:10 -0700)
committerGeorge Nash <george.nash@intel.com>
Thu, 14 Sep 2017 18:10:15 +0000 (11:10 -0700)
Relate-to:
https://gerrit.iotivity.org/gerrit/21973
https://gerrit.iotivity.org/gerrit/20987
https://gerrit.iotivity.org/gerrit/22021
https://gerrit.iotivity.org/gerrit/21991
https://gerrit.iotivity.org/gerrit/21871
https://gerrit.iotivity.org/gerrit/22017
https://gerrit.iotivity.org/gerrit/21577
https://gerrit.iotivity.org/gerrit/21987
https://gerrit.iotivity.org/gerrit/21985
https://gerrit.iotivity.org/gerrit/21603
https://gerrit.iotivity.org/gerrit/21711
https://gerrit.iotivity.org/gerrit/21843
https://gerrit.iotivity.org/gerrit/21925
https://gerrit.iotivity.org/gerrit/21983
https://gerrit.iotivity.org/gerrit/21937
https://gerrit.iotivity.org/gerrit/21935
https://gerrit.iotivity.org/gerrit/21933
https://gerrit.iotivity.org/gerrit/21931
https://gerrit.iotivity.org/gerrit/21929
https://gerrit.iotivity.org/gerrit/21923
https://gerrit.iotivity.org/gerrit/21921
https://gerrit.iotivity.org/gerrit/21901
https://gerrit.iotivity.org/gerrit/21965
https://gerrit.iotivity.org/gerrit/21959
https://gerrit.iotivity.org/gerrit/21887

Bug: https://jira.iotivity.org/browse/IOT-2453
Change-Id: I9eb36b18e1f9715b5e059b69de9e452f9e1c4334
Signed-off-by: George Nash <george.nash@intel.com>
24 files changed:
1  2 
.gitignore
build_common/linux/SConscript
resource/csdk/include/octypes.h
resource/csdk/resource-directory/src/internal/rd_database.c
resource/csdk/resource-directory/src/rd_client.c
resource/csdk/resource-directory/src/rd_server.c
resource/csdk/security/provisioning/sample/provisioningclient.c
resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c
resource/csdk/security/provisioning/src/ocprovisioningmanager.c
resource/csdk/security/provisioning/src/pmutility.c
resource/csdk/security/provisioning/src/secureresourceprovider.c
resource/csdk/security/src/credresource.c
resource/csdk/security/src/crlresource.c
resource/csdk/security/src/doxmresource.c
resource/csdk/stack/include/internal/ocstackinternal.h
resource/csdk/stack/include/ocpayload.h
resource/csdk/stack/src/occollection.c
resource/csdk/stack/src/ocpayload.c
resource/csdk/stack/src/ocresource.c
resource/csdk/stack/src/ocstack.c
resource/csdk/stack/src/oicresourcedirectory.c
resource/csdk/stack/test/stacktests.cpp
service/notification/unittest/oic_svr_db_ns.dat
service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp

diff --cc .gitignore
@@@ -88,39 -98,38 +88,43 @@@ out
  platform
  iotivity.pc
  tmp/
 +*.tmp
 +*.tmp.*
 +/*.dat
 +
 +# Ignore GCov generated files
 +*.gcda
 +*.gcno
  
+ # Ignore GCov generated files
+ *.gcda
+ *.gcno
  # Ignore downloaded dependencies
 -extlibs/libcoap/libcoap
 -extlibs/gtest/gtest-*
 -extlibs/hippomocks-master/
 -extlibs/hippomocks/hippomocks/
 -extlibs/master.zip
 -extlibs/cereal/cereal
 -extlibs/cereal
 -extlibs/android/gradle/gradle-2.2.1
 -extlibs/android/ndk/android-ndk-r10d
 -extlibs/android/sdk/android-sdk_r24.2
 -extlibs/android/sdk/android-sdk-linux
 -extlibs/android/sdk/android-sdk-macosx
 -extlibs/android/sdk/android-sdk-windows
 -extlibs/boost/*
 -extlibs/tinycbor/tinycbor
  *.tgz
  *.zip
 -extlibs/arduino/arduino-1.5.8
 -build_common/arduino/extlibs/arduino/arduino-1.5.8
 -extlibs/tinydtls/dtls-client
 -extlibs/tinydtls/dtls-server
 +*.bin
 +extlibs/android/gradle/gradle-*
 +extlibs/android/ndk/android-ndk-*
 +extlibs/android/sdk/android-sdk-*
 +extlibs/arduino/arduino-*
  extlibs/bluez/bluez
 +extlibs/boost/boost_*
 +extlibs/cereal/cereal
 +extlibs/gtest/googletest-*
 +extlibs/hippomocks/hippomocks
 +extlibs/hippomocks-master
 +extlibs/libcoap/libcoap
 +extlibs/libstrophe/libstrophe
  extlibs/mbedtls/mbedtls
 +extlibs/rapidjson/rapidjson
  extlibs/raxmpp/raxmpp
 +extlibs/sqlite3/sqlite3*
 +extlibs/tinycbor/tinycbor
 +extlibs/tinydtls/dtls-client
 +extlibs/tinydtls/dtls-server
 +extlibs/wksxmppxep/*/
  extlibs/yaml/yaml
 -extlibs/rapidjson/rapidjson
  
  # Ignore editor (e.g. Emacs) backup and autosave files
  *~
Simple merge
Simple merge
  #include <assert.h>
  #include <stdlib.h>
  #include <string.h>
 -#include "payload_logging.h"
 +#include "experimental/payload_logging.h"
+ #ifdef HAVE_ARPA_INET_H
+ #include <arpa/inet.h>
+ #endif
+ #ifdef HAVE_WS2TCPIP_H
+ #include <ws2tcpip.h>
+ #endif
+ #ifdef HAVE_IN6ADDR_H
+ #include <in6addr.h>
+ #endif
  #include "ocpayload.h"
  #include "octypes.h"
  #include "oic_string.h"
@@@ -58,7 -58,8 +58,8 @@@
  #include "otmcontextlist.h"
  #include "ocstackinternal.h"
  #include "mbedtls/ssl_ciphersuites.h"
 -#include "ocrandom.h"
 +#include "experimental/ocrandom.h"
+ #include "secureresourceprovider.h"
  
  #define TAG "OIC_MULTIPLE_OTM"
  
@@@ -502,14 -651,14 +651,14 @@@ exit
   * API for Sub Owner
   **********************************************************************/
  
- static OCStackResult StartMultipleOwnershipTransfer(OTMContext_tmotCtx,
-                                                     OCProvisionDev_t* selectedDevice);
+ static OCStackResult StartMultipleOwnershipTransfer(OTMContext_t *motCtx,
+         OCProvisionDev_t *selectedDevice);
  
 -static bool IsComplete(OTMContext_t *otmCtx)
 +static bool IsComplete(OTMContext_totmCtx)
  {
-     for(size_t i = 0; i < otmCtx->ctxResultArraySize; i++)
+     for (size_t i = 0; i < otmCtx->ctxResultArraySize; i++)
      {
-         if(OC_STACK_CONTINUE == otmCtx->ctxResultArray[i].res)
+         if (OC_STACK_CONTINUE == otmCtx->ctxResultArray[i].res)
          {
              return false;
          }
@@@ -764,34 -925,36 +925,37 @@@ exit
   * @return  OC_STACK_DELETE_TRANSACTION to delete the transaction
   *          and  OC_STACK_KEEP_TRANSACTION to keep it.
   */
- static OCStackApplicationResult SubOwnerCredentialHandler(void *ctx, OCDoHandle UNUSED,
-                                 OCClientResponse *clientResponse)
+ static OCStackApplicationResult SubOwnerCredentialHandler(void *ctx, OCDoHandle handle,
+         OCClientResponse *clientResponse)
  {
+     OIC_LOG(DEBUG, TAG, "IN SubOwnerCredentialHandler");
+     OC_UNUSED(handle);
      VERIFY_NOT_NULL(TAG, clientResponse, WARNING);
      VERIFY_NOT_NULL(TAG, ctx, WARNING);
+     VERIFY_NOT_NULL(TAG, ((Data_t *)ctx)->ctx, ERROR);
  
-     OIC_LOG(DEBUG, TAG, "IN SubOwnerCredentialHandler");
-     (void)UNUSED;
-     OTMContext_t* motCtx = (OTMContext_t*)ctx;
+     OTMContext_t *motCtx = (OTMContext_t *)(((Data_t *)ctx)->ctx); //ctx;
  
-     if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
+     if (OC_STACK_RESOURCE_CHANGED == clientResponse->result)
      {
-         if(motCtx && motCtx->selectedDeviceInfo)
+         if (motCtx && motCtx->selectedDeviceInfo)
          {
              //Close the temporal secure session to verify the owner credential
 -            CAEndpoint_t *endpoint = (CAEndpoint_t *)&motCtx->selectedDeviceInfo->endpoint;
 -            endpoint->port = motCtx->selectedDeviceInfo->securePort;
 -            CAResult_t caResult = CAcloseSslSession(endpoint);
 +            CAEndpoint_t endpoint = {.adapter = CA_DEFAULT_ADAPTER};
 +            CopyDevAddrToEndpoint(&motCtx->selectedDeviceInfo->endpoint, &endpoint);
 +            endpoint.port = motCtx->selectedDeviceInfo->securePort;
 +            CAResult_t caResult = CAcloseSslSession(&endpoint);
-             if(CA_STATUS_OK != caResult)
+             if (CA_STATUS_OK != caResult)
              {
                  OIC_LOG(ERROR, TAG, "Failed to close DTLS session");
                  SetMOTResult(motCtx, OC_STACK_ERROR);
                  return OC_STACK_DELETE_TRANSACTION;
              }
  
 -            caResult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, endpoint->adapter);
 +            caResult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, endpoint.adapter);
-             if(CA_STATUS_OK != caResult)
+             if (CA_STATUS_OK != caResult)
              {
                  OIC_LOG(ERROR, TAG, "Failed to select TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256");
                  SetMOTResult(motCtx, OC_STACK_ERROR);
@@@ -32,8 -33,8 +33,8 @@@
  #include "ocstackinternal.h"
  #include "oicgroup.h"
  #include "oic_string.h"
 -#include "payload_logging.h"
 +#include "experimental/payload_logging.h"
+ #include "cainterface.h"
  #define TAG "OIC_RI_COLLECTION"
  
  static bool AddRTSBaslinePayload(OCRepPayload **linkArray, int size, OCRepPayload **colPayload)
@@@ -184,7 -204,8 +203,8 @@@ exit
      {
          ehResult = (ret == OC_STACK_NO_RESOURCE) ? OC_EH_RESOURCE_NOT_FOUND : OC_EH_ERROR;
      }
 -    ret = SendResponse(colPayload, ehRequest, collResource, ehResult);
 +    ret = SendResponse(colPayload, ehRequest, ehResult);
+     OIC_LOG_V(INFO, TAG, "Send Response result from HandleLinkedListInterface = %d", (int)ret);
      OIC_LOG_PAYLOAD(DEBUG, (OCPayload *)colPayload);
      OCRepPayloadDestroy(colPayload);
      return ret;
Simple merge
Simple merge
Simple merge