include $(TOPDIR)/rules.mk
PKG_NAME:=iotivity
-PKG_VERSION:=1.0.0
+PKG_VERSION:=1.1.0
PKG_RELEASE=1
PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
-PKG_SOURCE_URL:=https://downloads.iotivity.org/${PKG_VERSION}/ \
- http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
-PKG_MD5SUM:=4bcbabffc1734c664bbdf8fedfa60543
+PKG_SOURCE_URL:=http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
+PKG_MD5SUM:=98f8d5b0304c357520c4343d983491e2
PKG_USE_MIPS16:=0
-PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@lantiq.com>
+PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@intel.com>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE.md
$(if $(CONFIG_PACKAGE_iotivity),liboctbstack) \
$(if $(CONFIG_PACKAGE_iotivity-cpp),liboc) \
$(if $(CONFIG_PACKAGE_iotivity-things-manager-lib),libTGMSDK) \
- $(if $(CONFIG_PACKAGE_iotivity-oic-middle),samples) \
+ $(if $(CONFIG_PACKAGE_iotivity-oic-middle),examples) \
$(if $(CONFIG_PACKAGE_iotivity-things-manager),ConServerApp ConClientApp BootstrapServerApp) \
$(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
$(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
--- a/resource/SConscript
+++ b/resource/SConscript
-@@ -71,7 +71,7 @@ if target_os == 'linux':
+@@ -75,7 +75,7 @@ if target_os == 'linux':
SConscript('csdk/stack/samples/linux/secure/SConscript')
# Build C/C++ unit tests
elif target_os == 'darwin':
env.Command('../../out/darwin/iotivity-csdk.framework',None,src_dir + '/tools/darwin/mkfwk_osx.sh')
+--- a/resource/csdk/security/provisioning/ck_manager/SConscript
++++ b/resource/csdk/security/provisioning/ck_manager/SConscript
+@@ -47,4 +47,4 @@ x509_env.AppendUnique(LIBS = ['Base64'])
+ x509_env.AppendUnique(LIBS = ['Json'])
+
+ SConscript('sample/SConscript')
+-SConscript('unittest/SConscript')
++# SConscript('unittest/SConscript')
--- a/service/resource-encapsulation/SConscript
+++ b/service/resource-encapsulation/SConscript
@@ -113,10 +113,10 @@ SConscript('examples/SConscript')
\ No newline at end of file
--- a/service/things-manager/SConscript
+++ b/service/things-manager/SConscript
-@@ -71,6 +71,6 @@ SConscript('sampleapp/SConscript')
+@@ -75,6 +75,6 @@ SConscript('sampleapp/SConscript')
######################################################################
# Build UnitTests Things Manager
################################################ ######################
+# if target_os == 'linux':
+# SConscript('unittests/SConscript')
+--- a/service/resource-hosting/SConscript
++++ b/service/resource-hosting/SConscript
+@@ -94,8 +94,8 @@ resourcehosting_env.UserInstallTargetHea
+ 'service/resource-hosting', 'Hosting.h')
+
+ # Go to build Unit test
+-if target_os == 'linux':
+- SConscript('unittest/SConscript')
++# if target_os == 'linux':
++# SConscript('unittest/SConscript')
+
+ # Go to build sample apps
+ SConscript('SampleApp/SConscript')
+--- a/service/easy-setup/mediator/csdk/SConscript
++++ b/service/easy-setup/mediator/csdk/SConscript
+@@ -124,8 +124,8 @@ if target_os == 'linux':
+ ######################################################################
+ #Build UnitTestcases for Mediator[CSDK]
+ ################################################ ######################
+-if target_os == 'linux':
+- SConscript('unittests/SConscript')
++# if target_os == 'linux':
++# SConscript('unittests/SConscript')
+
+
+
+--- a/service/easy-setup/mediator/richsdk/SConscript
++++ b/service/easy-setup/mediator/richsdk/SConscript
+@@ -138,6 +138,6 @@ if target_os == 'linux':
+ ######################################################################
+ #Build UnitTestcases for Mediator[RichSDK]
+ ################################################ ######################
+-if target_os == 'linux':
+- SConscript('unittests/SConscript')
++# if target_os == 'linux':
++# SConscript('unittests/SConscript')
+
+--- a/service/resource-container/SConscript
++++ b/service/resource-container/SConscript
+@@ -209,8 +209,8 @@ lib_env = conf2.Finish()
+ ######################################################################
+ # build resource container unit tests
+ ######################################################################
+-if target_os == 'linux':
+- SConscript('unittests/SConscript')
++# if target_os == 'linux':
++# SConscript('unittests/SConscript')
+
+ ######################################################################
+ # Build Container Sample
+--- a/plugins/SConscript
++++ b/plugins/SConscript
+@@ -35,7 +35,7 @@ if target_os not in ['android', 'arduino
+
+ SConscript(os.path.join('src', 'SConscript'))
+
+- SConscript(os.path.join('unittests', 'SConscript'))
++# SConscript(os.path.join('unittests', 'SConscript'))
+
+ if build_sample == 'ON':
+ if target_os in ['linux']:
+--- a/service/scene-manager/SConscript
++++ b/service/scene-manager/SConscript
+@@ -101,8 +101,8 @@ scenemanager_env.UserInstallTargetHeader
+ scenemanager_env.UserInstallTargetHeader('include/RemoteSceneAction.h', 'service/scene-manager', 'RemoteSceneAction.h')
+
+ # Go to build Unit test
+-if target_os == 'linux':
+- SConscript('unittests/SConscript')
++# if target_os == 'linux':
++# SConscript('unittests/SConscript')
+
+ # Go to build sample apps
+-SConscript('sampleapp/SConscript')
++# SConscript('sampleapp/SConscript')
+--- a/service/resource-encapsulation/src/common/SConscript
++++ b/service/resource-encapsulation/src/common/SConscript
+@@ -122,9 +122,9 @@ if target_os == 'linux':
+ 'expiryTimer/unittests/ExpiryTimerTest.cpp'
+ ]
+
+- rcs_common_test = rcs_common_test_env.Program('rcs_common_test', rcs_common_test_src)
+- Alias("rcs_common_test", rcs_common_test)
+- env.AppendTarget('rcs_common_test')
++# rcs_common_test = rcs_common_test_env.Program('rcs_common_test', rcs_common_test_src)
++# Alias("rcs_common_test", rcs_common_test)
++# env.AppendTarget('rcs_common_test')
+
+ if env.get('TEST') == '1':
+ from tools.scons.RunTest import *
+--- a/service/resource-encapsulation/src/serverBuilder/SConscript
++++ b/service/resource-encapsulation/src/serverBuilder/SConscript
+@@ -110,9 +110,9 @@ if target_os == 'linux':
+
+ server_builder_test_src = env.Glob('unittests/*.cpp')
+
+- server_builder_test = server_builder_test_env.Program('rcs_server_test', server_builder_test_src)
+- Alias("rcs_server_test", server_builder_test)
+- env.AppendTarget('rcs_server_test')
++# server_builder_test = server_builder_test_env.Program('rcs_server_test', server_builder_test_src)
++# Alias("rcs_server_test", server_builder_test)
++# env.AppendTarget('rcs_server_test')
+
+ if env.get('TEST') == '1':
+ from tools.scons.RunTest import *
--- a/service/third_party_libs.scons
+++ b/service/third_party_libs.scons
-@@ -49,14 +49,6 @@ if target_os in ['linux', 'tizen']:
+@@ -49,14 +49,6 @@ if target_os in ['linux']:
conf = Configure(lib_env)
--- a/build_common/SConscript
+++ b/build_common/SConscript
-@@ -137,6 +137,26 @@ tc_set_msg = '''
+@@ -151,6 +151,26 @@ tc_set_msg = '''
* cause inexplicable errors. *
*******************************************************************************
'''
+++ /dev/null
-From d647872aee4871e286ddedf4931792086f5b4565 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
-Date: Mon, 26 Oct 2015 14:32:39 +0100
-Subject: [PATCH] libcoap: remove fix build error on big endian systems
-
-In the big endian case an additional typedef is added in a wrong
-position in TinyDTLS. This breaks compiling this code on big endian
-systems.
-
-Change-Id: Iad854aba112ddb23bf490b064ec6fbf5d01ce6b6
-Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
----
- resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.h
-+++ b/resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.h
-@@ -194,7 +194,7 @@ typedef enum
- #ifdef WORDS_BIGENDIAN
- typedef union
- {
-- typedef struct
-+ struct
- {
- unsigned int version:2; /* protocol version */
- unsigned int type:2; /* type flag */
+++ /dev/null
-From 9510445c5002b0e3502d2ac09723e1b2ddd03704 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
-Date: Mon, 26 Oct 2015 14:39:55 +0100
-Subject: [PATCH] tinydtls: use types from inittype.h, fix musl libc
-
-The SHA2 code currently uses u_int32_t and similar types without
-defining them. This type is not defined by the POSIX standard, but many
-libc implementations have it as a non standard extension. In the musl
-libc it is not implemented and I am getting a compile error when using
-u_int32_t, I should use uint32_t, which is done when
-SHA2_USE_INTTYPES_H is set.
-
-This fixes build with musl libs used in OpenWrt.
-
-Change-Id: I485435ddb8b1a2359caedd335ab54f91ca5e3f3e
-Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
----
- extlibs/tinydtls/SConscript | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/extlibs/tinydtls/SConscript
-+++ b/extlibs/tinydtls/SConscript
-@@ -68,7 +68,7 @@ if not env.get('RELEASE'):
- else:
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
-
--env.AppendUnique(CPPDEFINES = ['DTLSV12', 'WITH_SHA256', 'DTLS_CHECK_CONTENTTYPE'])
-+env.AppendUnique(CPPDEFINES = ['DTLSV12', 'WITH_SHA256', 'DTLS_CHECK_CONTENTTYPE', 'SHA2_USE_INTTYPES_H'])
-
-
- libtinydtls = env.StaticLibrary('libtinydtls', env.get('TINYDTLS_SRC'), OBJPREFIX='libtinydtls_')
+++ /dev/null
-From 75a19e9059e671442abe40908ba80c2da614118d Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Mon, 26 Oct 2015 22:42:40 +0100
-Subject: [PATCH] connectivity: fix getnameinfo() call for musl libc
-
-The musl libc and also the libc from net/freebsd are currently checking
-if the size of the sockaddr given to getnameinfo() matches the size for
-this family and it fails when giving sizeof(struct sockaddr_storage).
-This patch fixes this problem by making the caller also provide the
-size of the struct sockaddr_storage.
-
-I am currently trying to get a fix for this problem into musl libc, but
-IoTivity should still fix this.
-
-This also fixes a wrong error message.
-
-Change-Id: Ie9b89523b5ba20e536c03e3ad85c65bd5ff2ba53
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
----
- resource/csdk/connectivity/inc/caadapterutils.h | 12 ++++++++----
- .../csdk/connectivity/src/adapter_util/caadapternetdtls.c | 10 +++++-----
- resource/csdk/connectivity/src/adapter_util/caadapterutils.c | 9 +++++----
- resource/csdk/connectivity/src/ip_adapter/caipserver.c | 2 +-
- resource/csdk/connectivity/src/tcp_adapter/catcpserver.c | 2 +-
- 5 files changed, 20 insertions(+), 15 deletions(-)
-
---- a/resource/csdk/connectivity/inc/caadapterutils.h
-+++ b/resource/csdk/connectivity/inc/caadapterutils.h
-@@ -212,13 +212,16 @@ void CAClearNetInterfaceInfoList(u_array
- */
- void CAClearServerInfoList(u_arraylist_t *serverInfoList);
-
-+#ifndef WITH_ARDUINO
- /**
- * Convert address from binary to string.
-- * @param[in] ipaddr IP address info.
-- * @param[out] host address string (must be CA_IPADDR_SIZE).
-- * @param[out] port host order port number.
-+ * @param[in] sockAddr IP address info.
-+ * @param[in] sockAddrLen size of sockAddr.
-+ * @param[out] host address string (must be CA_IPADDR_SIZE).
-+ * @param[out] port host order port number.
- */
--void CAConvertAddrToName(const struct sockaddr_storage *sockaddr, char *host, uint16_t *port);
-+void CAConvertAddrToName(const struct sockaddr_storage *sockAddr, socklen_t sockAddrLen,
-+ char *host, uint16_t *port);
-
- /**
- * Convert address from string to binary.
-@@ -227,6 +230,7 @@ void CAConvertAddrToName(const struct so
- * @param[out] ipaddr IP address info.
- */
- void CAConvertNameToAddr(const char *host, uint16_t port, struct sockaddr_storage *sockaddr);
-+#endif /* WITH_ARDUINO */
-
- #ifdef __ANDROID__
- /**
---- a/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c
-+++ b/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c
-@@ -417,7 +417,7 @@ static int32_t CAReadDecryptedPayload(dt
- ((addrInfo->addr.st.ss_family == AF_INET) ? CA_IPV4 : CA_IPV6) | CA_SECURE, .port = 0 },
- .identity =
- { 0 } };
-- CAConvertAddrToName(&(addrInfo->addr.st), sep.endpoint.addr, &sep.endpoint.port);
-+ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, sep.endpoint.addr, &sep.endpoint.port);
-
- if (NULL == g_caDtlsContext)
- {
-@@ -468,7 +468,7 @@ static int32_t CASendSecureData(dtls_con
-
- CAEndpoint_t endpoint = {.adapter = CA_DEFAULT_ADAPTER};
-
-- CAConvertAddrToName(&(addrInfo->addr.st), endpoint.addr, &endpoint.port);
-+ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, endpoint.addr, &endpoint.port);
- endpoint.flags = addrInfo->addr.st.ss_family == AF_INET ? CA_IPV4 : CA_IPV6;
- endpoint.flags |= CA_SECURE;
- endpoint.adapter = CA_ADAPTER_IP;
-@@ -515,7 +515,7 @@ static int32_t CAHandleSecureEvent(dtls_
- stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session;
- char peerAddr[MAX_ADDR_STR_SIZE_CA] = { 0 };
- uint16_t port = 0;
-- CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, &port);
-+ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, peerAddr, &port);
- CARemovePeerFromPeerInfoList(peerAddr, port);
- }
-
-@@ -553,7 +553,7 @@ static int32_t CAGetPskCredentials(dtls_
- stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session;
- char peerAddr[MAX_ADDR_STR_SIZE_CA] = { 0 };
- uint16_t port = 0;
-- CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, &port);
-+ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, peerAddr, &port);
-
- if(CA_STATUS_OK != CAAddIdToPeerInfoList(peerAddr, port, desc, descLen) )
- {
-@@ -933,7 +933,7 @@ static int CAVerifyCertificate(struct dt
- stCADtlsAddrInfo_t *addrInfo = (stCADtlsAddrInfo_t *)session;
- char peerAddr[MAX_ADDR_STR_SIZE_CA] = { 0 };
- uint16_t port = 0;
-- CAConvertAddrToName(&(addrInfo->addr.st), peerAddr, &port);
-+ CAConvertAddrToName(&(addrInfo->addr.st), addrInfo->size, peerAddr, &port);
-
- CAResult_t result = CAAddIdToPeerInfoList(peerAddr, port,
- crtChain[0].subject.data + DER_SUBJECT_HEADER_LEN + 2, crtChain[0].subject.data[DER_SUBJECT_HEADER_LEN + 1]);
---- a/resource/csdk/connectivity/src/adapter_util/caadapterutils.c
-+++ b/resource/csdk/connectivity/src/adapter_util/caadapterutils.c
-@@ -122,14 +122,15 @@ CAResult_t CAParseIPv4AddressInternal(co
- * These two conversion functions return void because errors can't happen
- * (because of NI_NUMERIC), and there's nothing to do if they do happen.
- */
--void CAConvertAddrToName(const struct sockaddr_storage *sockAddr, char *host, uint16_t *port)
-+void CAConvertAddrToName(const struct sockaddr_storage *sockAddr, socklen_t sockAddrLen,
-+ char *host, uint16_t *port)
- {
- VERIFY_NON_NULL_VOID(sockAddr, CA_ADAPTER_UTILS_TAG, "sockAddr is null");
- VERIFY_NON_NULL_VOID(host, CA_ADAPTER_UTILS_TAG, "host is null");
- VERIFY_NON_NULL_VOID(port, CA_ADAPTER_UTILS_TAG, "port is null");
-
- int r = getnameinfo((struct sockaddr *)sockAddr,
-- sizeof (struct sockaddr_storage),
-+ sockAddrLen,
- host, MAX_ADDR_STR_SIZE_CA,
- NULL, 0,
- NI_NUMERICHOST|NI_NUMERICSERV);
-@@ -138,12 +139,12 @@ void CAConvertAddrToName(const struct so
- if (EAI_SYSTEM == r)
- {
- OIC_LOG_V(ERROR, CA_ADAPTER_UTILS_TAG,
-- "getaddrinfo failed: errno %s", strerror(errno));
-+ "getnameinfo failed: errno %s", strerror(errno));
- }
- else
- {
- OIC_LOG_V(ERROR, CA_ADAPTER_UTILS_TAG,
-- "getaddrinfo failed: %s", gai_strerror(r));
-+ "getnameinfo failed: %s", gai_strerror(r));
- }
- return;
- }
---- a/resource/csdk/connectivity/src/ip_adapter/caipserver.c
-+++ b/resource/csdk/connectivity/src/ip_adapter/caipserver.c
-@@ -299,7 +299,7 @@ static CAResult_t CAReceiveMessage(int f
- }
- }
-
-- CAConvertAddrToName(&srcAddr, sep.endpoint.addr, &sep.endpoint.port);
-+ CAConvertAddrToName(&srcAddr, msg.msg_namelen, sep.endpoint.addr, &sep.endpoint.port);
-
- if (flags & CA_SECURE)
- {
---- a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c
-+++ b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c
-@@ -478,7 +478,7 @@ static void CAAcceptHandler(void *data)
- }
- svritem->u4tcp.fd = sockfd;
-
-- CAConvertAddrToName((struct sockaddr_storage *)&clientaddr,
-+ CAConvertAddrToName((struct sockaddr_storage *)&clientaddr, clientlen,
- (char *) &svritem->addr, &svritem->u4tcp.port);
-
- ca_mutex_lock(g_mutexObjectList);
+++ b/build_common/linux/SConscript
@@ -24,20 +24,3 @@ env.AppendUnique(LINKFLAGS = ['-ldl', '-
- # Set arch flags
+ # Set arch flags that match best TARGET_ARCH variable
target_arch = env.get('TARGET_ARCH')
-if target_arch in ['x86']:
- env.AppendUnique(CCFLAGS = ['-m32'])
-elif target_arch in ['x86_64']:
- env.AppendUnique(CCFLAGS = ['-m64'])
- env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch in ['arm'] or target_arch.find('v5') > 0:
+- env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
-elif target_arch.find('v7a-hard') > 0:
- env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
- env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
- env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
-elif target_arch.find('arm64') >= 0:
- env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
--else:
-- env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
--- a/resource/csdk/connectivity/build/linux/SConscript
+++ b/resource/csdk/connectivity/build/linux/SConscript
@@ -22,20 +22,3 @@ env.AppendUnique(LINKFLAGS = ['-ldl', '-
--- a/service/resource-container/SConscript
+++ b/service/resource-container/SConscript
-@@ -176,35 +176,21 @@ if target_os in ['linux', 'tizen', 'andr
+@@ -175,36 +175,22 @@ if target_os in ['linux', 'tizen', 'andr
# build hue sample bundle
######################################################################
-
- HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
- hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
+- hue_resource_bundle_env.UserInstallTargetLib(HueBundle, 'libHueBundle')
-lib_env = conf2.Finish()
+hue_resource_bundle_env = resource_container_env.Clone()
+hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+
+HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
+hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
++hue_resource_bundle_env.UserInstallTargetLib(HueBundle, 'libHueBundle')
######################################################################
# build resource container unit tests
--- /dev/null
+From 4488170af944163b62051b2afee60386a9973c72 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke.mehrtens@intel.com>
+Date: Thu, 31 Mar 2016 10:23:48 +0200
+Subject: [PATCH] remove building of provisioning service
+
+The provisioning service is not used in this build and depends on boost_thread
+which would add an additional unused dependency.
+
+Change-Id: Ic7edab3ae96d77339ea0f48fc76ab2534c49b6ba
+Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
+---
+ resource/src/SConscript | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/resource/src/SConscript
++++ b/resource/src/SConscript
+@@ -116,5 +116,5 @@ oclib_env.UserInstallTargetHeader(header
+ oclib_env.UserInstallTargetHeader(header_dir + 'CAManager.h', 'resource', 'CAManager.h')
+
+ # Add Provisioning library
+-if target_os in ['linux', 'android', 'tizen'] and env.get('SECURED') == '1':
+- SConscript('../provisioning/SConscript')
++# if target_os in ['linux', 'android', 'tizen'] and env.get('SECURED') == '1':
++# SConscript('../provisioning/SConscript')
--- /dev/null
+From 8a1a5562904c1bbdb2bcb332c0a74482d7cdea15 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
+Date: Wed, 11 Nov 2015 18:10:03 +0100
+Subject: [PATCH 5/5] resource-encapsulation: deactivate test covergae
+
+Change-Id: I9c9b5853ee1521f5963c73c3025b1c0f10393a96
+Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
+---
+ .../resource-encapsulation/src/common/SConscript | 4 ----
+ .../src/serverBuilder/SConscript | 4 ----
+ 2 files changed, 8 deletions(-)
+
+--- a/service/resource-encapsulation/src/common/SConscript
++++ b/service/resource-encapsulation/src/common/SConscript
+@@ -66,10 +66,6 @@ if target_os == 'android':
+
+ rcs_common_env.AppendUnique(LIBS = ['dl', 'oc'])
+
+-if not release:
+- rcs_common_env.AppendUnique(CXXFLAGS = ['--coverage'])
+- rcs_common_env.PrependUnique(LIBS = ['gcov'])
+-
+ ######################################################################
+ # Source files and Targets
+ ######################################################################
+--- a/service/resource-encapsulation/src/serverBuilder/SConscript
++++ b/service/resource-encapsulation/src/serverBuilder/SConscript
+@@ -67,10 +67,6 @@ server_builder_env.AppendUnique(LIBS = [
+ if env.get('LOGGING'):
+ server_builder_env.AppendUnique(LIBS = ['octbstack'])
+
+-if not release:
+- server_builder_env.AppendUnique(CXXFLAGS = ['--coverage'])
+- server_builder_env.PrependUnique(LIBS = ['gcov'])
+-
+ ######################################################################
+ # Source files and Targets
+ ######################################################################
--- /dev/null
+From b1c29c35cba3eb39af18fb8db0ec676e3d658b1d Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke.mehrtens@intel.com>
+Date: Fri, 17 Jun 2016 17:38:35 +0200
+Subject: [PATCH] security: fix reading of permission attribute from
+ configuration
+
+Casting the pointer to the permission attribute from uint16_t to uint64_t
+causes problems on MIPS Big Endian systems and probably othrs as well.
+When the calling method interprets it as uint64_t not the value is
+converted but the pointer is interpreted as it would point to a 64 bit
+integer, but it is only a 16 bit wide integer. On MIPS BE permission was
+always 0 independent of which value between 0 and 32 the permission
+attribute had, this was probably written to some padding area or into
+some other member of the struct.
+
+This patch fixes the memory corruption and makes the code work for me with
+a MIPS BE CPU.
+
+Change-Id: Ifa843e69980ad4309b1e3076b8e2c98c03324352
+Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
+---
+ resource/csdk/security/src/aclresource.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/resource/csdk/security/src/aclresource.c
++++ b/resource/csdk/security/src/aclresource.c
+@@ -602,8 +602,11 @@ OicSecAcl_t* CBORPayloadToAcl(const uint
+ // Permissions -- Mandatory
+ if (strcmp(name, OIC_JSON_PERMISSION_NAME) == 0)
+ {
+- cborFindResult = cbor_value_get_uint64(&aclMap, (uint64_t *) &acl->permission);
++ uint64_t tmp64;
++
++ cborFindResult = cbor_value_get_uint64(&aclMap, &tmp64);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding a PERM Value.");
++ acl->permission = tmp64;
+ }
+
+ // Period -- Not mandatory
--- /dev/null
+From f182119e571a1b520b4e5ef4ee5e5b5cd243b931 Mon Sep 17 00:00:00 2001
+From: Chul Lee <chuls.lee@samsung.com>
+Date: Wed, 22 Jun 2016 12:40:21 +0900
+Subject: [PATCH] Remove the endianness dependency in cbor conversion.
+
+A similar bug reported from https://gerrit.iotivity.org/gerrit/#/c/8755/
+
+Change-Id: I631bab77f7486f1f45eaff96c67d39606e37c6b6
+Signed-off-by: Chul Lee <chuls.lee@samsung.com>
+Reviewed-on: https://gerrit.iotivity.org/gerrit/8829
+Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
+Reviewed-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
+Reviewed-by: Randeep Singh <randeep.s@samsung.com>
+(cherry picked from commit 24474a8d2555229efb425b6cb63e19b3279ba810)
+Reviewed-on: https://gerrit.iotivity.org/gerrit/9053
+---
+ resource/csdk/security/src/credresource.c | 8 ++++++--
+ resource/csdk/security/src/pconfresource.c | 5 +++--
+ resource/csdk/stack/src/ocpayloadparse.c | 8 ++++++--
+ 3 files changed, 15 insertions(+), 6 deletions(-)
+
+--- a/resource/csdk/security/src/credresource.c
++++ b/resource/csdk/security/src/credresource.c
+@@ -435,8 +435,10 @@ OCStackResult CBORPayloadToCred(const ui
+ //credid
+ if (strcmp(name, OIC_JSON_CREDID_NAME) == 0)
+ {
+- cborFindResult = cbor_value_get_uint64(&credMap, (uint64_t *) &cred->credId);
++ uint64_t credId = 0;
++ cborFindResult = cbor_value_get_uint64(&credMap, &credId);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CredId.");
++ cred->credId = (uint16_t)credId;
+ }
+ // subjectid
+ if (strcmp(name, OIC_JSON_SUBJECTID_NAME) == 0)
+@@ -451,8 +453,10 @@ OCStackResult CBORPayloadToCred(const ui
+ // credtype
+ if (strcmp(name, OIC_JSON_CREDTYPE_NAME) == 0)
+ {
+- cborFindResult = cbor_value_get_uint64(&credMap, (uint64_t *) &cred->credType);
++ uint64_t credType = 0;
++ cborFindResult = cbor_value_get_uint64(&credMap, &credType);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CredType.");
++ cred->credType = (OicSecCredType_t)credType;
+ }
+ // privatedata
+ if (strcmp(name, OIC_JSON_PRIVATEDATA_NAME) == 0)
+--- a/resource/csdk/security/src/pconfresource.c
++++ b/resource/csdk/security/src/pconfresource.c
+@@ -642,8 +642,9 @@ OCStackResult CBORPayloadToPconf(const u
+ // Permissions -- Mandatory
+ if (strcmp(name, OIC_JSON_PERMISSION_NAME) == 0)
+ {
+- cborFindResult = cbor_value_get_uint64(&pdAclMap,
+- (uint64_t *) &pdacl->permission);
++ uint64_t permission = 0;
++ cborFindResult = cbor_value_get_uint64(&pdAclMap, &permission);
++ pdacl->permission = (uint16_t)permission;
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to get value");
+ }
+
+--- a/resource/csdk/stack/src/ocpayloadparse.c
++++ b/resource/csdk/stack/src/ocpayloadparse.c
+@@ -1169,17 +1169,21 @@ static OCStackResult OCParsePresencePayl
+ if (cbor_value_is_map(rootValue))
+ {
+ CborValue curVal;
++ uint64_t temp = 0;
+
+ // Sequence Number
+ CborError err = cbor_value_map_find_value(rootValue, OC_RSRVD_NONCE, &curVal);
+ VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding nonce tag");
+- err = cbor_value_get_uint64(&curVal, (uint64_t *)&payload->sequenceNumber);
++ err = cbor_value_get_uint64(&curVal, &temp);
++ payload->sequenceNumber = (uint32_t)temp;
+ VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding nonce value");
+
+ // Max Age
+ err = cbor_value_map_find_value(rootValue, OC_RSRVD_TTL, &curVal);
+ VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding ttl tag");
+- err = cbor_value_get_uint64(&curVal, (uint64_t *)&payload->maxAge);
++ temp = 0;
++ err = cbor_value_get_uint64(&curVal, &temp);
++ payload->maxAge = (uint32_t)temp;
+ VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding ttl value");
+
+ // Trigger
--- /dev/null
+From 7c99ef8bfa024f11452311c36329eeeeece4fd74 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke.mehrtens@intel.com>
+Date: Wed, 22 Jun 2016 11:41:43 +0200
+Subject: [PATCH] Fix memory corruption when reading inetgers from cbor
+
+When the cbor_value_get_*() function is called with a pointer to some int, it
+should have the correct size. When we cast it to something else it is treated
+as a pointer to an uint64_t in the function for example and them 64 bits gets
+written to memory even with the real type is only 32 bit long. When the real
+type is only 32 bit long some other memory gets overwritten. On Big endian
+systems the least significant bits are cut of so in most cases 0 is read.
+
+With this patch a value cast is used and the value is converted to the other size.
+
+This is the same as in commit 0d64c7c95a5c11a9fb5201e729fd8c75da210c80
+"security: fix reading of permission attribute from configuration"
+
+Change-Id: If5965491241e25ebf60a22dc45d37d74a33cb02f
+Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
+---
+ resource/csdk/security/src/pconfresource.c | 5 ++++-
+ resource/csdk/stack/src/ocpayloadparse.c | 19 +++++++++++++++----
+ 2 files changed, 19 insertions(+), 5 deletions(-)
+
+--- a/resource/csdk/security/src/pconfresource.c
++++ b/resource/csdk/security/src/pconfresource.c
+@@ -507,8 +507,11 @@ OCStackResult CBORPayloadToPconf(const u
+
+ while (cbor_value_is_valid(&prm))
+ {
+- cborFindResult = cbor_value_get_int(&prm, (int *)&pconf->prm[i++]);
++ int prm_val;
++
++ cborFindResult = cbor_value_get_int(&prm, &prm_val);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to get value");
++ pconf->prm[i++] = (OicSecPrm_t)prm_val;
+ cborFindResult = cbor_value_advance(&prm);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to advance value");
+ }
+--- a/resource/csdk/stack/src/ocpayloadparse.c
++++ b/resource/csdk/stack/src/ocpayloadparse.c
+@@ -287,6 +287,8 @@ static OCStackResult OCParseDiscoveryPay
+
+ while (cbor_value_is_map(&resourceMap))
+ {
++ int bitmap;
++
+ resource = (OCResourcePayload *)OICCalloc(1, sizeof(OCResourcePayload));
+ VERIFY_PARAM_NON_NULL(TAG, resource, "Failed allocating resource payload");
+
+@@ -319,8 +321,9 @@ static OCStackResult OCParseDiscoveryPay
+ // Bitmap
+ err = cbor_value_map_find_value(&policyMap, OC_RSRVD_BITMAP, &curVal);
+ VERIFY_CBOR_SUCCESS(TAG, err, "to find bitmap tag");
+- err = cbor_value_get_int(&curVal, (int *)&resource->bitmap);
++ err = cbor_value_get_int(&curVal, &bitmap);
+ VERIFY_CBOR_SUCCESS(TAG, err, "to find bitmap value");
++ resource->bitmap = (uint8_t)bitmap;
+
+ // Secure Flag
+ err = cbor_value_map_find_value(&policyMap, OC_RSRVD_SECURE, &curVal);
+@@ -336,8 +339,11 @@ static OCStackResult OCParseDiscoveryPay
+ VERIFY_CBOR_SUCCESS(TAG, err, "to find port tag");
+ if (cbor_value_is_valid(&curVal))
+ {
+- err = cbor_value_get_int(&curVal, (int *)&resource->port);
++ int port;
++
++ err = cbor_value_get_int(&curVal, &port);
+ VERIFY_CBOR_SUCCESS(TAG, err, "to find port value");
++ resource->port = (uint16_t)port;
+ }
+
+ err = cbor_value_advance(&resourceMap);
+@@ -1170,6 +1176,7 @@ static OCStackResult OCParsePresencePayl
+ {
+ CborValue curVal;
+ uint64_t temp = 0;
++ uint8_t trigger;
+
+ // Sequence Number
+ CborError err = cbor_value_map_find_value(rootValue, OC_RSRVD_NONCE, &curVal);
+@@ -1189,8 +1196,9 @@ static OCStackResult OCParsePresencePayl
+ // Trigger
+ err = cbor_value_map_find_value(rootValue, OC_RSRVD_TRIGGER, &curVal);
+ VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding trigger tag");
+- err = cbor_value_get_simple_type(&curVal, (uint8_t *)&payload->trigger);
++ err = cbor_value_get_simple_type(&curVal, &trigger);
+ VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding trigger value");
++ payload->trigger = (OCPresenceTrigger)trigger;
+
+ // Resource type name
+ err = cbor_value_map_find_value(rootValue, OC_RSRVD_RESOURCE_TYPE, &curVal);
--- /dev/null
+From e093390b2839f6039a6ff94ed4942fa45c53a418 Mon Sep 17 00:00:00 2001
+From: Philippe Coval <philippe.coval@osg.samsung.com>
+Date: Tue, 26 Apr 2016 15:28:17 +0200
+Subject: [PATCH] [Resource-container] Backported init fix to 1.1-rel
+
+[Resource-container] Fix member var initialization
+
+Incorrect type was used causing build error.
+
+Origin: 6a10062f1fe64ca75ac6d34541bbd295ef052dcb
+Author: Inga Stotland <inga.stotland@intel.com>
+Change-Id: I701096c3b6512546847cf4e120430f690e920453
+Signed-off-by: Inga Stotland <inga.stotland@intel.com>
+Reviewed-on: https://gerrit.iotivity.org/gerrit/7759
+Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
+Reviewed-by: George Nash <george.nash@intel.com>
+Reviewed-by: Markus Jung <markus.jung85@gmail.com>
+Reviewed-by: Uze Choi <uzchoi@samsung.com>
+Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
+Reviewed-on: https://gerrit.iotivity.org/gerrit/7929
+---
+ service/resource-container/src/BundleInfoInternal.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/service/resource-container/src/BundleInfoInternal.cpp
++++ b/service/resource-container/src/BundleInfoInternal.cpp
+@@ -32,8 +32,8 @@ namespace OIC
+ m_resourceCreator = nullptr;
+ m_resourceDestroyer = nullptr;
+ m_bundleHandle = nullptr;
+- m_so_bundle = nullptr;
+
++ m_so_bundle = false;
+ m_loaded = false;
+ m_activated = false;
+ m_java_bundle = false;
--- a/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript
+++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript
-@@ -31,7 +31,7 @@ this_build_dir = os.path.join(root_build
+@@ -73,7 +73,7 @@ env.AppendUnique(
# The Linux BLE adapter implementation uses GDBus to make D-Bus based
# method calls to BlueZ. Pull in the necessary dependencies.
--- a/resource/csdk/security/provisioning/SConscript
+++ b/resource/csdk/security/provisioning/SConscript
-@@ -73,7 +73,7 @@ provisioning_env.AppendUnique(LIBS = ['t
+@@ -76,8 +76,8 @@ provisioning_env.AppendUnique(LIBS = ['t
if env.get('DTLS_WITH_X509') == '1':
- provisioning_env.AppendUnique(LIBS = ['CKManger'])
+ provisioning_env.AppendUnique(LIBS = ['CKManager', 'asn1'])
--provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
-+# provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
+-if target_os != 'android':
+- provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
++# if target_os != 'android':
++# provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
- if target_os == 'android':
- provisioning_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
+ if target_os == 'tizen':
+ provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')