iotivity.git
2 years ago[IOT-2737] Fix build warning in routing layer. 27/22527/2
Senthil Kumar G S [Fri, 18 Aug 2017 13:07:11 +0000 (18:37 +0530)]
[IOT-2737] Fix build warning in routing layer.

Warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing].

Change-Id: I19a851e0bf16e4b46ba6b7ed1167cb50c4502f18
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Origin: https://gerrit.iotivity.org/gerrit/#/c/22003/

2 years ago[IOT-2718] Update Roles resource 21/22521/1
Alex Kelley [Mon, 18 Sep 2017 20:33:21 +0000 (13:33 -0700)]
[IOT-2718] Update Roles resource

1. Update RolesToCBORPayload to handle large role certificate chains
that require allocating more memory.
2. Update GetEndpointRoles to fix AV when adding multiples roles to the
list of roles to return.

Change-Id: I08de68eb0b2757bd17eb9ffe4e304ee378165266
Signed-off-by: Alex Kelley <alexke@microsoft.com>
2 years ago[IOT-2617] Enable Anon Ciphersuite after RESET 99/22499/2
Nathan Heldt-Sheller [Fri, 15 Sep 2017 23:25:06 +0000 (16:25 -0700)]
[IOT-2617] Enable Anon Ciphersuite after RESET

The Anon Ciphersuite should be enabled after RESET if the Device
by default has the oxmsel == JUSTWORKS, so that a Client isn't
required to re-select the JUSTWORKS OTM in order to enable the
suite.

Change-Id: I6ab06b958959b1cad5e04f0bc63e90c8c4202785
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
2 years agoprovisioning: Fixed memory leak 23/22223/7
George Nash [Mon, 28 Aug 2017 23:25:21 +0000 (16:25 -0700)]
provisioning: Fixed memory leak

Fixed memory leak found using valgrind. The memory
leak was due to the provisionInit function calling
sqlite3_open_v2 without calling sqlite3_close

There was not provisionClose method in the C++ so it was
added to the OCSecure class. To do this OCClosePM was
also added to that the code could be used in Windows.

The provisioningClose call was added to all of the samples
that are currently calling provisioningInit(dbfile)

While updating the some of the android samples the
tab depth was cleaned.

Note the unit tests are not following one of the most
basic rules of unit testing. Tests should be isolated
and independent. When the cleanup code was added to the
unit tests it broke tests that run later. Each individual
unit test should be able to run independent of all the
other unit tests order should not matter. This commit
does a little to break the dependency tests have on other
tests, but it did not fix it completely. Many tests rely
on the DB being left in a state by another test as well as
passing test state to global variables that hold information
outside the individual test.

Change-Id: Id2c05ecc611516a5cf892ae70bb4e0cd0c115752
Signed-off-by: George Nash <george.nash@intel.com>
2 years agotizen: Remove RPATH info on install 97/22097/4
Philippe Coval [Fri, 11 Aug 2017 14:44:28 +0000 (16:44 +0200)]
tizen: Remove RPATH info on install

Libraries will be install to regular system path (/usr/lib),
so RPATH info is no more relevent.

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I7492b772ab5b2a43f5d493c9334202617b7f0282
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21877
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
(cherry picked from commit f0950b65d934fca41c4252dd198480696f61eb2b)

2 years agoIOT-2539 Fix write-strings warning 93/22193/3
George Nash [Fri, 4 Aug 2017 18:57:02 +0000 (11:57 -0700)]
IOT-2539 Fix write-strings warning

The write-strings warning comes from assigning
the a const string to a char* that is not const.
From everything I see in this example the string
is not changed so simply using const_cast will
remove the warning.

If these values are always expected to be constant
we may want to consider changing the strutures
to hold const char * not char *. Without further
investigation I did not feel safe making that
change.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ib9053a1041b72b1fd05329999efc7a7ff28aab94
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21753
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit ff88390c2889d3e20bdbdcf73e10ada7584ab8e8)

2 years agoIOT-2539 Fix return-type warning 79/22179/2
George Nash [Wed, 2 Aug 2017 22:59:06 +0000 (15:59 -0700)]
IOT-2539 Fix return-type warning

The _worker function expects a void * return type
only functions with return type of void do not have
to have a return.

Since the return value does not appear to be used
simply return NULL.

Change-Id: I3cee6f7a491320d21b1d70f9a8df0f7b4538087b
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21737
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit 9a55ebdaefd544b37c7534b479ceff33ccc9f123)

2 years ago[IOT-2539] clean implicit-function-declaration 89/22189/2
George Nash [Mon, 31 Jul 2017 16:55:14 +0000 (09:55 -0700)]
[IOT-2539] clean implicit-function-declaration

The pdu.c file was producing an implicit-function-declaration
warning for the ntohs() function. The ntohs function is part
of the arpa/inet.h header.  This is conditionally included
based on the HAVE_ARPA_INET_H macro. The HAVE_ARPA_INET_H
macro is defined in the iotivity_config.h header. So
iotivity_config.h must be included in pdu.c to properly detect
the macro.

It looks like some systems may supply the ntohs() function
without arpa/inet.h. So it is unclear if the call to the
function its self needs some added macros.

Change-Id: I7e19d65e1371d46b35d70a5ecdf06fb0b73152ff
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21683
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 9b704e02253b181f88c00aad98083bfeb55328ae)

2 years ago[IOT-2268] cleanup unused-local-typedefs warning 13/22213/2
George Nash [Tue, 25 Jul 2017 16:38:19 +0000 (09:38 -0700)]
[IOT-2268] cleanup unused-local-typedefs warning

The definition used for the OC_STATIC_ASSERT created
an unused typedef with an array of an invalid size
if the assert condition was not met. This resulted
in an unused-local-typedef warning every time
OC_STATIC_ASSERT was used even if it did not cause
a static assert.

The macro was updated to create an enum of 1/condition
if the condition is false this will create a compiler
warning because 1/0 is an invalid value. Its supprisingly
difficult to find a macro that will satisfy C, and C++
for most standard compilers. With out producing a warning.

Also when possible the __COUNTER__ macro is used to create
the unique identifier for the OC_STATIC_ASSERT this
addresses the problem of using the static ASSERT on the
same line. This would have been an issue with the original
way the code was written.

Bug: https://jira.iotivity.org/browse/IOT-2268
Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I4a9cc8d61702eacaddfd1ae5679126af02208f5e
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21619
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit db426b113862fddd2241029dd8f7ee4bed01e39a)

2 years agoIOT-2539 Fixed incompatible-pointer-types warning 05/22205/3
George Nash [Tue, 15 Aug 2017 19:50:20 +0000 (12:50 -0700)]
IOT-2539 Fixed incompatible-pointer-types warning

The function GetResourceFromHandle was returning a PIResource**. When
the actual code was inspected it was returning a PIResourceBase** that
was being cast to a PIResource**. That value was then used as a
PIResource**. The only reason this code worked is because the way C
lays out structs in memory is sequential Since the first element of the
PIResoruceBase is a PIResource treating the the PIResourceBase like
a PIResource worked only by virtue of the memory layout rules for C
structs.

Later in the zigbee_wapper.c it relies again on the memory layout
rules for structs to assign PIResource** to a PIResource_Zigbee**.

This relies too much on internal knowledge of memory layout and is
a potential management problem. The code tied 3 structs together
based on there memory layout.

To fix the issue. The GetResourceFromHandle now returns PIResourceBase**
which was the actual type returned. In the cleanup code the pointer
is change from PIResource* to PIResourceBase*. Now when the value is
passed into the DeleteResource function it no longer generates the
incompatible-pointer-types warning.

In zigbee_wrapper.c we no longer cast the PIResource_Zigbee* to
PIResource* we now pass in the part of the PIResource_Zigbee that is
actually the PIResourceBase.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I6b147a52c522d036d016e2cd15e2900e6fc06249
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21927
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit 25898d822bea23ec7f19b6858026de493031c70e)

2 years agoUse path in persistent storage open callback. 25/22425/3
Todd Malsbary [Mon, 11 Sep 2017 23:22:36 +0000 (16:22 -0700)]
Use path in persistent storage open callback.

Bug: https://jira.iotivity.org/browse/IOT-2196
Change-Id: Ia72de1fd70d5b7b665e56661e53c5b97c51c375e
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
2 years ago[Easy Setup] Memory leak fix 87/22487/2
Abhishek Pandey [Fri, 15 Sep 2017 13:00:29 +0000 (18:30 +0530)]
[Easy Setup] Memory leak fix

JIRA IOT-2721: https://jira.iotivity.org/browse/IOT-2721

Change-Id: Ie9309fc6830b5473e8b7482b798d59bb2aed2e13
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
2 years agojava: Fix doxygen mistakes in doc 65/22365/4
Philippe Coval [Fri, 25 Aug 2017 07:50:53 +0000 (09:50 +0200)]
java: Fix doxygen mistakes in doc

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I7ca840a000fcd22366123c87a0f5b086806be9ec
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2 years ago[IOT-2419] Update the samples to run with security 37/22437/4
George Nash [Tue, 12 Sep 2017 22:37:54 +0000 (15:37 -0700)]
[IOT-2419] Update the samples to run with security

This uses the same acl files that were introduced in
https://gerrit.iotivity.org/gerrit/#/c/21489/
The simple server was updated to default to a secure interface.

Tested by running against each other and the C++
simpleserver simpleclient samples.

Bug: https://jira.iotivity.org/browse/IOT-2419
Change-Id: I623fc40759a6382568de572cedf9aa8f52fbfbe9
Signed-off-by: George Nash <george.nash@intel.com>
2 years agosecurity: Example support SVR ACL v2 and fix PS 89/21489/9
Philippe Coval [Tue, 29 Aug 2017 15:11:59 +0000 (17:11 +0200)]
security: Example support SVR ACL v2 and fix PS

Update json file to support ACL from CSDK, inspired by:
resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.json
resource/csdk/stack/samples/linux/secure/oic_svr_db_server.json

Also add persistent storage to overload security dat file.

Make example working again using:

  ./simpleserver 2

  ./simpleclient
  Observe registration action is successful
  OBSERVE RESULT:
        SequenceNumber: 0
        state: true
        power: 55
        name: John's light

Note those .dat files were generated from master branch
using json2cbor tool automatically,
1.3-rel does not have the scanner generator yet.

Bug: https://jira.iotivity.org/browse/IOT-2443
Change-Id: Id457fedd74bf7540c2a223e4ab079076af1f2134
Origin: https://gerrit.iotivity.org/gerrit/#/c/21487/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2 years agobuild: Preserve target_os change 53/22353/4
Philippe Coval [Wed, 6 Sep 2017 17:10:05 +0000 (19:10 +0200)]
build: Preserve target_os change

Yocto sets target_os variable to 'linux', we want to keep it.

help_vars.Update(env) from 03f23f37 is introducing a regression.

Bug: https://jira.iotivity.org/browse/IOT-2651
Change-Id: I688a1a613691a5005bb3c019202466b85d725a4c
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2 years ago[IOT-2678] Adding Null check to fix crash 55/22455/2 1.3.1-RC1
Sushil Yadav [Thu, 14 Sep 2017 11:42:48 +0000 (17:12 +0530)]
[IOT-2678] Adding Null check to fix crash

Change-Id: I360d5ffbe468f16e40a1f1f3171edd1c0d23e94d
Signed-off-by: Sushil Yadav <sushil.ky@samsung.com>
2 years ago[IOT-2686][Android] Discovery fails for BT/LE 63/22363/3
Veeraj Khokale [Thu, 7 Sep 2017 09:06:40 +0000 (14:36 +0530)]
[IOT-2686][Android] Discovery fails for BT/LE

OCCopyResource() should not return NULL if creating
the endpoint payload list returns NULL.

Change-Id: I069dbfc0530c2b6560a55e650bc993beef120714
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
2 years agoMerge branch easysetup into 'origin/1.3-rel'. 83/22483/2
Abhishek Pandey [Fri, 15 Sep 2017 06:23:00 +0000 (11:53 +0530)]
Merge branch easysetup into 'origin/1.3-rel'.

Change-Id: I2cf5e7a25ab985f2b2e7b613ef0cb8af7dd3a851
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
2 years ago[Easy Setup] Adding logs for OTM failure reason 29/22429/6
Abhishek Pandey [Tue, 12 Sep 2017 07:10:32 +0000 (12:40 +0530)]
[Easy Setup] Adding logs for OTM failure reason

IOT-2703: https://jira.iotivity.org/browse/IOT-2703
[Easy Setup] Adding Ownership transfer failure reason logs

- Mapped failure due to Timeout to ESResult::ES_COMMUNICATION_ERROR.
- Added error logs for developers to know failure reason.
- Optimized for loop with a break when matching resource is found.

Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
Change-Id: I0e1e0fce5834acc625347198497a9e420b54909c

2 years agoEasySetup:Applied "href" and "rep" to POST request 69/22469/3
Abhishek Pandey [Thu, 14 Sep 2017 16:35:07 +0000 (22:05 +0530)]
EasySetup:Applied "href" and "rep" to POST request

IOT-2713: https://jira.iotivity.org/browse/IOT-2713

- Applied "href" and "rep" to POST request using oic.if.b (batch interface).
- Updated the handling for provision wifi & cloud properties
- Verified Enrollee & Mediator on Linux with sample apps.
- Linux Unit tests verified locally.
- Also fixed on build warning in easysetup_x.c (sample app).

Change-Id: I5e5d7c495d45dd8eb41ca5bcce2af8e18fd53c71
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
2 years ago[IOT-2709] MOT fail fix 47/22447/2
Aleksey Volkov [Wed, 13 Sep 2017 14:08:50 +0000 (17:08 +0300)]
[IOT-2709] MOT fail fix

This change revert some lines from
https://gerrit.iotivity.org/gerrit/22153

This is workaround to keep compatibility with other modules
 which use credentials with rownerId inside.

Anyway, this behavior should be refactored in next releases.

Change-Id: Ib338ba1e41366c40f878743080d9271446d95fff
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
2 years ago[IOT-2539] clean unused-variable warning 03/22203/3
George Nash [Tue, 1 Aug 2017 18:59:36 +0000 (11:59 -0700)]
[IOT-2539] clean unused-variable warning

The global variable are not being used because the code that
uses them was blocked out using #if 0 till IOT-2106 is fixed.

The variables have also been blocked out same as the code
that was using the variables.

Bug: https://jira.iotivity.org/browse/IOT-2539
Bug: https://jira.iotivity.org/browse/IOT-2106
Change-Id: I6f6289c3a34a83e69a2ac7918086d3752e7fd93e
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21705
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit dca9520b255d9bb19a0406b4bd730e4120c81a96)

2 years ago[IOT-2630]Add acl default behavior 13/22013/7
Oleksandr Dmytrenko [Mon, 21 Aug 2017 08:58:49 +0000 (11:58 +0300)]
[IOT-2630]Add acl default behavior

In case not found in acl request,
make acl2 request

Change-Id: Ic1cb8006ea0218601b9a64b71d65623bb920a67b
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 years agodi is not a mandatory DELETE query parameter. 79/22279/2
Todd Malsbary [Wed, 30 Aug 2017 21:03:42 +0000 (14:03 -0700)]
di is not a mandatory DELETE query parameter.

Bug: https://jira.iotivity.org/browse/IOT-2659
Change-Id: If9e6c94f0e5896ef6ae129775166078da402d9b5
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
2 years agoSecurity error notification engine 23/20323/26
saurabh.s9 [Fri, 1 Sep 2017 05:40:59 +0000 (11:10 +0530)]
Security error notification engine

Purpose:
Errors happens during OCDoResource calls should be returned to app layer

Previously, session errors (handshake failed) didn't returned properly to app layer
and this cause side effects (CA retransmission works in cases when it should not)

Current state:
1. Source code builds ok
2. Secure stack samples (UDP/TCP) works well (both positive/negative cases)
3. Provisioning (OTM, 20th menu item) works well for following:
   a. justworks    positive UDP/TCP, negative UDP case
   b. mfg          positive UDP/TCP, negative UDP case
   c. mv_justworks positive UDP/TCP, negative UDP case
   d. randompin    positive UDP/TCP, negative UDP case
4. OTM in provisioning via TCP - negative case - should work properly after fix IOT-2454

How to test:
1. Positive case - just test samples (f.e secure stack samples) & provisioning with all servers
2. Negative case - add following code which artificially breaks handshake (to ca_adapter_net_ssl.c)
   if (peer->ssl.state == MBEDTLS_SSL_CERTIFICATE_REQUEST)
   {
       ret = MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR;
   }
   And again test all samples and provisioning with all servers.
   As result - you should see an error returned to app immidiately (without timeouts, etc)
   and there should be no CA retransmission attempts (UDP case)

Change-Id: Ia1fe1c7c58f9e40040a0be5e7e83abbc66f80bfe
Signed-off-by: Andrii Shtompel <a.shtompel@samsung.com>
Signed-off-by: saurabh.s9 <saurabh.s9@samsung.com>
2 years ago[IOT-2628][EasySetup]Add new prop. swat,swet 45/22445/1
Ankur Bansal [Sun, 20 Aug 2017 09:28:59 +0000 (14:58 +0530)]
[IOT-2628][EasySetup]Add new prop. swat,swet

Add new mandatory properties to oic.r.wificonf
- swat: Enrollee's supported Wi-Fi Authentication Types
- swet: Enrollee's supported Wi-Fi Encryption Types
- Update Enrollee sample apps (Linux and Tizen).

Note: This impacts Easy Setup Enrollee API "ESSetDeviceProperty".

Change-Id: Ic765671dfbe3a4e1c8a857ef6ae1d3dcb9ba783e
Signed-off-by: Ankur Bansal <ankur.b1@samsung.com>
2 years ago[IOT-2628][EasySetup]Update WifiConf prop. types 07/22307/6
Ankur Bansal [Mon, 14 Aug 2017 09:18:24 +0000 (14:48 +0530)]
[IOT-2628][EasySetup]Update WifiConf prop. types

- Change properties from integer to string enums: swmt, swf, wat, wet
- Change supported frequencies from single value to array.
- Create type converters for enum to string and string to enum.
- Remove EOF marker in enum WIFI_MODE.
- Update Enrollee sample apps (Linux and Tizen).
- Cleanup some unused code in easysetup.c.
- Fixed unit test cases for Enrollee and Mediator.

Note: This impacts Easy Setup Enrollee API "ESSetDeviceProperty".

Thanks-To: Abhishek Pandey <abhi.siso@samsung.com>
Change-Id: Iea8191616cea89a0273e0f5486bd259735e914fa
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
Signed-off-by: Ankur Bansal <ankur.b1@samsung.com>
2 years agoMerge "[IOT-2339] Add NULL check before variable access." into 1.3-rel
Ashok Babu Channa [Tue, 12 Sep 2017 14:25:06 +0000 (14:25 +0000)]
Merge "[IOT-2339] Add NULL check before variable access." into 1.3-rel

2 years agoMerge "[IOT-2361] Perform NULL check before dereference." into 1.3-rel
Ashok Babu Channa [Tue, 12 Sep 2017 14:24:53 +0000 (14:24 +0000)]
Merge "[IOT-2361] Perform NULL check before dereference." into 1.3-rel

2 years agoMerge "[IOT-2634]Color log level" into 1.3-rel
Randeep Singh [Tue, 12 Sep 2017 11:50:26 +0000 (11:50 +0000)]
Merge "[IOT-2634]Color log level" into 1.3-rel

2 years agoMerge "[IOT-2641] /cred resource rownerid fix" into 1.3-rel
Randeep Singh [Tue, 12 Sep 2017 09:41:40 +0000 (09:41 +0000)]
Merge "[IOT-2641] /cred resource rownerid fix" into 1.3-rel

2 years agoMerge branch 'origin/1.3-rel' into easysetup 31/22431/1
Abhishek Pandey [Tue, 12 Sep 2017 08:29:47 +0000 (13:59 +0530)]
Merge branch 'origin/1.3-rel' into easysetup

Change-Id: Ifb56e84a7c38b8f376e7fd5272d7095ae562bf46
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
2 years agoMerge "[IOT-2065] CloudAcl code conditionally compiled" into 1.3-rel
Randeep Singh [Tue, 12 Sep 2017 04:37:02 +0000 (04:37 +0000)]
Merge "[IOT-2065] CloudAcl code conditionally compiled" into 1.3-rel

2 years agoMerge "IOT-2539 removed unused code from subownerclient.c" into 1.3-rel
Randeep Singh [Tue, 12 Sep 2017 04:34:48 +0000 (04:34 +0000)]
Merge "IOT-2539 removed unused code from subownerclient.c" into 1.3-rel

2 years agoMerge "resource-encapsulation: Fix test's output filename" into 1.3-rel
Mats Wichmann [Mon, 11 Sep 2017 21:46:46 +0000 (21:46 +0000)]
Merge "resource-encapsulation: Fix test's output filename" into 1.3-rel

2 years agoMerge "provisioning: Support older python for tests" into 1.3-rel
Mats Wichmann [Mon, 11 Sep 2017 18:14:21 +0000 (18:14 +0000)]
Merge "provisioning: Support older python for tests" into 1.3-rel

2 years agoMerge "[IOT-2696] Allow chain of certs in public data" into 1.3-rel
Nathan Heldt-Sheller [Mon, 11 Sep 2017 16:35:17 +0000 (16:35 +0000)]
Merge "[IOT-2696] Allow chain of certs in public data" into 1.3-rel

2 years agoMerge "[IOT-2511] Get OCResourceHandle from resource" into 1.3-rel
Ziran Sun [Mon, 11 Sep 2017 10:29:23 +0000 (10:29 +0000)]
Merge "[IOT-2511] Get OCResourceHandle from resource" into 1.3-rel

2 years agoMerge "security: Add roles cert null terminator" into 1.3-rel
Randeep Singh [Mon, 11 Sep 2017 10:16:41 +0000 (10:16 +0000)]
Merge "security: Add roles cert null terminator" into 1.3-rel

2 years agoMerge "IOT-2539 Remove missing-field-initializers warning" into 1.3-rel
Randeep Singh [Mon, 11 Sep 2017 10:02:51 +0000 (10:02 +0000)]
Merge "IOT-2539 Remove missing-field-initializers warning" into 1.3-rel

2 years agoMerge "IOT-2539 Removed unused-function" into 1.3-rel
Randeep Singh [Mon, 11 Sep 2017 09:59:59 +0000 (09:59 +0000)]
Merge "IOT-2539 Removed unused-function" into 1.3-rel

2 years ago[IOT-2511] Get OCResourceHandle from resource 19/22319/3
Martin Roesch [Mon, 17 Jul 2017 11:07:05 +0000 (13:07 +0200)]
[IOT-2511] Get OCResourceHandle from resource

Implement getResourceHandle() method in RCSResourceObject
to allow the resource to be published to a RD.

Change-Id: I3ea2a162ef1fa9f3beeb65e62a34d571300b8c2e
Signed-off-by: Martin Roesch <martin.roesch@kistler.com>
2 years agoES Mediator update to align with OCF 1.3 Spec 07/22407/2
Abhishek Pandey [Sat, 9 Sep 2017 13:29:12 +0000 (18:59 +0530)]
ES Mediator update to align with OCF 1.3 Spec

- Updated mediator logic based on version checking API from OCResource class.
- Get Configuration Response parsing updated as per spec version.
- provisionProperties updated as per spec version

Change-Id: Iad208bbeb08e3dbdb749bf6d280c5e60231164a2
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
2 years agoMerge "IOT-2539 remove unused function warning" into 1.3-rel
Randeep Singh [Mon, 11 Sep 2017 04:37:31 +0000 (04:37 +0000)]
Merge "IOT-2539 remove unused function warning" into 1.3-rel

2 years agoMerge "[IOT-2539] Clean implicit-function warning" into 1.3-rel
Randeep Singh [Mon, 11 Sep 2017 04:36:31 +0000 (04:36 +0000)]
Merge "[IOT-2539] Clean implicit-function warning" into 1.3-rel

2 years agoMerge "[IOT-2539] Clean sign-compare warnings" into 1.3-rel
Randeep Singh [Mon, 11 Sep 2017 04:02:51 +0000 (04:02 +0000)]
Merge "[IOT-2539] Clean sign-compare warnings" into 1.3-rel

2 years agoMerge "Improve .gitignore slightly" into 1.3-rel
Mats Wichmann [Sun, 10 Sep 2017 15:51:52 +0000 (15:51 +0000)]
Merge "Improve .gitignore slightly" into 1.3-rel

2 years agoMerge "tools: Add exec permissions on scripts" into 1.3-rel
Mats Wichmann [Sun, 10 Sep 2017 15:45:08 +0000 (15:45 +0000)]
Merge "tools: Add exec permissions on scripts" into 1.3-rel

2 years agoMerge "ignore: Temporary files with .tmp suffix" into 1.3-rel
Mats Wichmann [Sun, 10 Sep 2017 15:44:53 +0000 (15:44 +0000)]
Merge "ignore: Temporary files with .tmp suffix" into 1.3-rel

2 years agoMerge "Add getServerHeaderOption API in OCResource." into easysetup
Ashok Babu Channa [Sat, 9 Sep 2017 12:33:18 +0000 (12:33 +0000)]
Merge "Add getServerHeaderOption API in OCResource." into easysetup

2 years agobuild: warnings as errors in jni code 19/22219/2
George Nash [Fri, 21 Jul 2017 19:46:44 +0000 (12:46 -0700)]
build: warnings as errors in jni code

All build warnings have been cleaned from the
Java JNI code to make sure it continues to build
without warnings we are treating all warnings
as errors.

Change-Id: I05e7d75b81bed25b5f62ba353ff41ea28bca620a
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21579
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit de6a8023a209bfa316d329fa9b790310bde6ad81)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22219
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
2 years ago[IOT-2539] Removed unused-param warning 15/22215/3
George Nash [Thu, 27 Jul 2017 00:17:02 +0000 (17:17 -0700)]
[IOT-2539] Removed unused-param warning

Now that -Werror is turned on for JNI code the error
must be fixed to build. This was missed earlyer
because it is only build when WITH_CLOUD=1 is in the
scons options which is not a default build option.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I7790cba1baa140c3059f0a91b66882425ed5a6cb
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21645
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit db7b6d26c941525c0e8428f70864905997861c90)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22215

2 years agoresource-encapsulation: Fix test's output filename 23/22023/9
Philippe Coval [Fri, 18 Aug 2017 12:38:37 +0000 (14:38 +0200)]
resource-encapsulation: Fix test's output filename

Align to other .memcheck suffixes for valgrind

Bug: https://jira.iotivity.org/browse/IOT-2599
Change-Id: Id51f1b3168226b83710a2047f4256cce7bf6f129
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21993
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
(cherry picked from commit 7f5c93862a43c2234b43df93d94fa532eb75ee32)

2 years ago[IOT-2696] Allow chain of certs in public data 01/22401/1
Alex Kelley [Thu, 7 Sep 2017 00:31:34 +0000 (17:31 -0700)]
[IOT-2696] Allow chain of certs in public data

Previously we expected the leaf certificate to be present in public data
and the chain of intermediate CAs to be present in optional data. After
discussion it was agreed to update IoTivity to expect the entire chain
of certificates to be present in public data.

Change-Id: Ib4a53b31451205da4b06c41404b5088568844825
Signed-off-by: Alex Kelley <alexke@microsoft.com>
2 years agoMinor change: Correct wrong use of variable. 15/22315/3
Ziran Sun [Mon, 4 Sep 2017 14:50:48 +0000 (15:50 +0100)]
Minor change: Correct wrong use of variable.

Change-Id: I39c531cbca0e27291a091c09907975e950c90cde
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22315
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
2 years ago[IOT-2539] Fix format= warining 81/22181/2
George Nash [Tue, 1 Aug 2017 17:18:56 +0000 (10:18 -0700)]
[IOT-2539] Fix format= warining

The sscanf was using %lu flag that is a long unsigned int
while passing in a uint32_t value which is an unsigned int

This changes the flag from %lu to %u to clean the format
warning.

Change-Id: Iba1d10e2b2403fa5adb94650764ee04c290c951b
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21701
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit a86f7d8c1d6d4516b021a76c7bfd59b16ce3f027)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22181
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years ago[IOT-2515] File descriptor leak 99/21899/8
Veeraj Khokale [Mon, 14 Aug 2017 10:11:08 +0000 (15:41 +0530)]
[IOT-2515] File descriptor leak

Repeatedly calling OCInit2() followed by OCStop() causes
the process to run out of file descriptors. To fix this
the following changes are made to IP adapter:

1. Close the ip global socket FDs before reinitializing them.
2. Close the shutdownFds[0] FD when receive thread is stopped.

Change-Id: I1e0f336cd3d6de2297aa3421b47c8b8d810f82fb
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21899
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-by: koushik girijala <g.koushik@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
2 years ago[IOT-2065] CloudAcl code conditionally compiled 91/22391/2
akk0rd [Fri, 8 Sep 2017 09:07:11 +0000 (12:07 +0300)]
[IOT-2065] CloudAcl code conditionally compiled

CloudAcl code should be conditionally compiled out by default

Change-Id: I10da20f5e192073a8ed6228dbc0601e0da42a7af
Signed-off-by: akk0rd <v.riznyk@samsung.com>
2 years ago[IOT-2112] No unit tests 15/21915/11
akk0rd [Tue, 15 Aug 2017 09:30:39 +0000 (12:30 +0300)]
[IOT-2112] No unit tests

No unit tests for CASelectCipherSuite/OCSelectCipherSuite

Change-Id: I71a75b172d65bd15ff2e511d5190f1441275f46d
Signed-off-by: akk0rd <v.riznyk@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21915
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years ago[IOT-2675] Fix occlient sample app crash 31/22331/6
koushik.girijala [Wed, 6 Sep 2017 09:27:23 +0000 (14:57 +0530)]
[IOT-2675] Fix occlient sample app crash

NULL check added

Change-Id: I36ccb505024c036921c906efaf9443892ac7d5ba
Signed-off-by: koushik.girijala <g.koushik@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22331
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Veeraj Khokale <veeraj.sk@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
2 years agoAccessing server version info at client callback. 41/22341/3
Abhishek Pandey [Thu, 3 Aug 2017 15:47:06 +0000 (16:47 +0100)]
Accessing server version info at client callback.

Change-Id: I526a15ce50599782d45f8b0e50b5c4ae2d292b88
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21743
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 20c3d3edea8915cc847aba108ac4280d79d7d37c)

2 years agogeneric-java: remove unbuilt samples 77/22377/2
George Nash [Thu, 7 Sep 2017 19:34:22 +0000 (12:34 -0700)]
generic-java: remove unbuilt samples

All of the Android samples were copied over to the
generic-java samples folder but only 3 of the samples
were actually updated so they would build and run.
Till there is time to actually work through the
samples and make sure they build and run they
should be removed so they are not referenced by
developers.

Change-Id: I64ef0f2d5d10e3aa66f85f4f34b9e0cd29d94542
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22377
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
2 years ago[IOT-2689] Fix to compile WITH_MQ flags. 79/22379/2
Larry Sachs [Thu, 7 Sep 2017 21:10:09 +0000 (14:10 -0700)]
[IOT-2689] Fix to compile WITH_MQ flags.

Change-Id: Ib2d933bfa2ed2a499a792086b3182123d63fd70e
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22379
Reviewed-by: George Nash <george.nash@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
2 years ago[IOT-2641] /cred resource rownerid fix 53/22153/11
Aleksey Volkov [Mon, 28 Aug 2017 05:50:32 +0000 (08:50 +0300)]
[IOT-2641] /cred resource rownerid fix

This changes includes some refactoring of credential resource design:
 each credential structure instance has own rowner id value
 and it was changed to common rowner value.

IOT-2641 depends on it.

Tested with CT1.7.9.3 and 1.7.9.1, 1.7.4.1

json2cbor and svrdbeditor sources should be fixed accordingly by their owners

Change-Id: I50afae10ac9f702c86d321dcf758525968f7bc31
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
2 years ago[IOT-2539] Fix -Wparentheses warning in ocstack. 01/22201/2
George Nash [Tue, 25 Jul 2017 22:40:53 +0000 (15:40 -0700)]
[IOT-2539] Fix -Wparentheses warning in ocstack.

The parentheses warning suggest parentheses around
'&&' within '||'. This makes interpreting the boolean
logic clear for humans. Less chance the compiler will
interpret code different than the developer.

The logic was complicated enough that the longer lines
were pulled out into there own individual boolean flags,
then the flags are used in the if statment.

This makes reading the if statment clearer. The parentheses
were modified so the code would no longer report the error.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I297ac10d8e0c78d49d41920d17df5b086dbe64ad
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21625
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 68e08b8494f9f6405e471776b44791c6ef74cee3)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22201
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years ago[IOT-2539] Clean sign-compare warning 09/22209/3
George Nash [Mon, 31 Jul 2017 21:04:09 +0000 (14:04 -0700)]
[IOT-2539] Clean sign-compare warning

Use type casting to prevent the sign-compare warning
from occertutility.c code.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ief40445dbb6445de246e9004aa42f4892a431d74
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21687
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit f3bd98df774da69d6d2b0b869bacea3f2c693e71)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22209
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
2 years ago[IOT-2107] refactoing 73/22173/8
Oleksandr Dmytrenko [Mon, 28 Aug 2017 15:34:50 +0000 (18:34 +0300)]
[IOT-2107] refactoing

Doxm post request handler refactoring

Change-Id: Idac8efba843e9f31b6dddca759f9c4160008e27b
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22173
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Aleksey Volkov <a.volkov@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years agoFix memory access error 17/21917/2
Mats Wichmann [Tue, 15 Aug 2017 14:44:26 +0000 (08:44 -0600)]
Fix memory access error

off-by-one in allocating memory for a string: was no space
for the null terminator since strlen() was used to compute size.

Change-Id: Ic7b836416f2a5319f2906be504fec09de29182dc
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21917
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years ago[IOT-2361] Perform NULL check before dereference. 61/22361/1
Senthil Kumar G S [Wed, 30 Aug 2017 15:30:40 +0000 (21:00 +0530)]
[IOT-2361] Perform NULL check before dereference.

Moved NULL checking macro invocation for pointer variable
before it gets dereferenced.

Change-Id: I303e56ae1e856991f44373e06c5adc156515107a
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22273
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Harish Marappa <h.marappa@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 578ba07661d943e42762745daaeeaea89fc9604e)

2 years ago[IOT-2339] Add NULL check before variable access. 59/22359/1
Senthil Kumar G S [Wed, 30 Aug 2017 15:01:02 +0000 (20:31 +0530)]
[IOT-2339] Add NULL check before variable access.

Added null check for 'sendData->remoteEndpoint' before the members
of remoteEndpoint gets accessed.

Change-Id: Ic4fc56087bcf9f72233f823ab5aaf0c39ec34afa
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22271
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Harish Marappa <h.marappa@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 1a32ec0a6bf0a691e4abc830d12f5a366aa03321)

2 years ago[IOT-2598][EasySetup]Handle oic.if.rw,oic.if.r 65/22265/6
Ankur Bansal [Sun, 6 Aug 2017 14:52:20 +0000 (20:22 +0530)]
[IOT-2598][EasySetup]Handle oic.if.rw,oic.if.r

Add handling for "oic.if.rw" for wificonf, coapcloudconf.
Add handling for "oic.if.r" for devconf.
Slightly refactor ProcessGetRequest to move out common part.
Update CheckEhRequestPayload to check for all supported interfaces in
generic manner.
Update "if" property of response of resources. (This is still work in
progress for response of EasySetup Resource, will be updated in a
separate commit).

Change-Id: I501a6ba3aff8e84c253f962d383782b2c6f49206
Signed-off-by: Ankur Bansal <ankur.b1@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22265
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
2 years ago[IOT-2631] Increase message buffer size 91/22291/2
Alex Kelley [Fri, 1 Sep 2017 00:24:36 +0000 (17:24 -0700)]
[IOT-2631] Increase message buffer size

Increase the size of the receive message buffer in CAReceiveMessage.

Change-Id: I4793631d88a99bb1e60c6a286b0edfcc2b2be837
Signed-off-by: Alex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22291
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
Reviewed-by: Aleksey Volkov <a.volkov@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years ago[IOT-2653] Update sample .dat and .json files 57/22257/5
Oleksii Beketov [Tue, 5 Sep 2017 12:37:03 +0000 (15:37 +0300)]
[IOT-2653] Update sample .dat and .json files

1. oic_svr_db_client.dat and oic_svr_db_server_mfg.dat
   corrupted certificates fixed
2. changed mfgcert cred field type from optionaldata to
   publicdata to meet changes provided with #21929
3. json files changed to unix format

Change-Id: Id08d7b426d28bae2ffebc89e8861f73181e0cdb0
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22257
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years agobuild: prevent unused-parameter warning 17/22217/2
George Nash [Thu, 13 Jul 2017 19:44:40 +0000 (12:44 -0700)]
build: prevent unused-parameter warning

the connectivity bt_le_adapter has auto generates files
  - bluez-glue.c
  - object_manager-glue.c

The files are included when building the connectivity_abstraction
library. This error is only disabled when bt_le_adapter is being
built. We don't want to hide the unused-parameter warning. This
is the simplest way to hide the warning without large changes
in the build.

Change-Id: Ieca1412ab744b7fccf408a80f66ef0add1a91fa6
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21429
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit e7ea0fdccf6187a19abfb3f7ac650d8852437d13)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22217
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
2 years agoIOT-2539 fix int-conversion warning 85/22185/2
George Nash [Wed, 2 Aug 2017 23:17:56 +0000 (16:17 -0700)]
IOT-2539 fix int-conversion warning

On linux pthread_t is not a pointer type so
assigning it as NULL is an error. pthread_t should be
assigned using the functions like pthread_create which
is already done.

Change-Id: I55559a3ed3d4de82dd4863b1ee6e0ce11dd1726b
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21739
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit 2dc503e6569871651fe19f430bfd59a301102dc6)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22185

2 years agosecurity: Add roles cert null terminator 25/22125/3
Dan Mihai [Fri, 25 Aug 2017 07:10:21 +0000 (00:10 -0700)]
security: Add roles cert null terminator

mbedtls_x509_crt_parse requires null string terminator to determine
the cert format.

This patch allows CT1.7.8.5 to make progress. This test case still
fails later, because CTT posts an entire chain to /roles, and
IoTivity expects just one Role cert. This failure is still being
investigated.

Change-Id: I769cb104e43e4dc8d18b05dfb3851e5f4921fd00
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Bug: https://jira.iotivity.org/browse/IOT-2648

2 years agoAdd getServerHeaderOption API in OCResource. 49/22349/1
Ziran Sun [Fri, 1 Sep 2017 10:35:57 +0000 (11:35 +0100)]
Add getServerHeaderOption API in OCResource.

Client requests to accessing headoptions, especially for
server version information. This patch adds a new API in
OCResource to access header Options from server response.

BUG: https://jira.iotivity.org/browse/IOT-2667
Change-Id: Ie18d3396666f778e0758ef0e4609274e53226cf1
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22299
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 3c83c81cf200156a13179c80ccc419ca4957ebf7)

2 years agotizen: Add support for Tizen:4:Unified (armv7l) 89/22289/4
Philippe Coval [Wed, 19 Jul 2017 13:05:48 +0000 (15:05 +0200)]
tizen: Add support for Tizen:4:Unified (armv7l)

To use for ARM:
gbsarch=armv7l gbsprofile=tizen_4_0_unified_armv7l ./gbsbuild.sh

Other arch might come later, if needed.

Change-Id: I81414e75c7d52f8f00d8cdaa8ca6e9a2ab60d2a3
Bug: https://jira.iotivity.org/browse/IOT-2397
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21617
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Youngman Jung <yman.jung@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
(cherry picked from commit 387bd249a0537e6a39d8cfb59dd3bd7a186cf7d2)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22289

2 years agoAdd getServerHeaderOption API in OCResource. 99/22299/3
Ziran Sun [Fri, 1 Sep 2017 10:35:57 +0000 (11:35 +0100)]
Add getServerHeaderOption API in OCResource.

Client requests to accessing headoptions, especially for
server version information. This patch adds a new API in
OCResource to access header Options from server response.

BUG: https://jira.iotivity.org/browse/IOT-2667
Change-Id: Ie18d3396666f778e0758ef0e4609274e53226cf1
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22299
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
2 years agoAccessing server version info at client callback. 43/21743/8
Ziran Sun [Thu, 3 Aug 2017 15:47:06 +0000 (16:47 +0100)]
Accessing server version info at client callback.

Change-Id: I526a15ce50599782d45f8b0e50b5c4ae2d292b88
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21743
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
2 years ago[IOT-2634]Color log level 15/22015/4
Oleksandr Dmytrenko [Mon, 21 Aug 2017 14:36:48 +0000 (17:36 +0300)]
[IOT-2634]Color log level

Set color debug level by level

Change-Id: Ic7725160106b5bbb626c72c78fbcdaad9a0cb19a
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 years ago[IOT-2658][IOT-2443] fix unowned discovery fail 93/22293/8
uzchoi [Fri, 1 Sep 2017 04:07:16 +0000 (13:07 +0900)]
[IOT-2658][IOT-2443] fix unowned discovery fail

During the merge https://gerrit.iotivity.org/gerrit/#/c/21371/,
existing code was excluded for unowned device discovery on secured
build. This fix adds the original fix into the appropriate position.
This issue is also in https://jira.iotivity.org/browse/IOT-2658

Change-Id: I189e4e420bbafff01710a11d298bee61c23cef03
Signed-off-by: uzchoi <uzchoi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22293
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
2 years ago[IOT-2617] Enable JW OTM without Update to oxmsel. 25/22025/5
Nathan Heldt-Sheller [Tue, 22 Aug 2017 22:36:33 +0000 (15:36 -0700)]
[IOT-2617] Enable JW OTM without Update to oxmsel.

With this change, IoTivity will enable the Anon DH suite, and register
the handshake callback, at Init() time (if selected in /doxm), rather
than requiring an Update to /doxm.oxmsel to do so.

Change-Id: I7e2985fdb1ed8328a1293aaaafe010bdcd3e975a
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22025
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mushfiqul Islam <i.mushfiq@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years ago[IOT-2387][IOT-2479] Fix RESET behavior 13/21913/5
Nathan Heldt-Sheller [Tue, 15 Aug 2017 08:02:28 +0000 (01:02 -0700)]
[IOT-2387][IOT-2479] Fix RESET behavior

This fixes the Device Onboarding State logic, but still omits the
ResetSecureResources() call because it's causing a crash.

That issue is being tracked separately in IOT-2633, and can
be fixed in a separate patch.

Change-Id: Iebeafc1cfb34a9c009ec4d59e4c74838838c950d
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21913
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mushfiqul Islam <i.mushfiq@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years ago[IOT-2444] Add constant for MAX_SEQUENCE_NUMBER 75/22175/3
Larry Sachs [Mon, 28 Aug 2017 20:25:50 +0000 (13:25 -0700)]
[IOT-2444] Add constant for MAX_SEQUENCE_NUMBER

Added a constant for MAX_SEQUENCE_NUMBER and updated
sample client apps to use the value when checking for
deregister completion.

Change-Id: Ie24c6ce33f10291fe45e2ca8eda27c997dd332a6
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22175
Reviewed-by: George Nash <george.nash@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ondrej Tomcik <ondrej.tomcik@kistler.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
2 years agoMerge branch '1.3-rel' into 'easysetup' 09/22309/2
Ankur Bansal [Mon, 4 Sep 2017 06:04:20 +0000 (11:34 +0530)]
Merge branch '1.3-rel' into 'easysetup'

Sync easysetup with 1.3-rel

Change-Id: I24050a9db2d5daec21d4b925130a2a8abd346553
Signed-off-by: Ankur Bansal <ankur.b1@samsung.com>
2 years ago[Bug2615] Remove di from GET /oic/rd 81/21981/2
Habib Virji [Thu, 17 Aug 2017 18:49:01 +0000 (19:49 +0100)]
[Bug2615] Remove di from GET /oic/rd

di property to remove GET /oic/rd

Change-Id: I659fe1fbff8c38e453bdf98605d8765c1fffaf00
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21981
Reviewed-by: Todd Malsbary <todd.malsbary@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
2 years agoIOT-2539 Cleanup warnings from subownerclient.cpp 77/22177/2
George Nash [Fri, 4 Aug 2017 21:01:52 +0000 (14:01 -0700)]
IOT-2539 Cleanup  warnings from subownerclient.cpp

Used the OC_UNUSED macro for unused parameters in callback
functions.

Deleted unused variables.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I5b1ad8bb52622217fc3a4ab11ff18b3e8f1376d9
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21757
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 7d7389be01703751816bc0b21f21ac6bd18fc711)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22177

2 years agoFix darwin SDK detection logic (IOT-1862) 75/21475/3
Mats Wichmann [Sat, 4 Mar 2017 15:06:34 +0000 (08:06 -0700)]
Fix darwin SDK detection logic (IOT-1862)

Also a small refactor in the ios sconscript

The logic parses text from querying xcodebuild to find the latest sdk
version supported by the host, but it seems the content of this text has
changed over time, so we have to recognize a couple of tags for the Mac.

The original version had a flaw: the script can be called with
SYS_VERSION set to indicate a minimum version, but then it checks if an
SDK path with that version is installed, which might not be the case.
e.g.: SYS_VERSION=10.10, but the only installed SDK is for 10.12.
Calling with "-mmacosx-version-min=10.10" is fine, but checking if
.../Platforms/MacOSX.platform/Developer/SDKS/MacOSX/x86_64/10.10 exists
as a condition is not.  This has been adjusted by checking if a requested
version exists in the list of detected versions, and bumping the requested
version up to a found one, unless the found ones are actually lowere
than the requested.  It still seems awfully convoluted, but at least
works now on a 10.12 system without breaking the build in use for
IoTivity Jenkins.

Change-Id: I0e19893de52393789d23dcecc8d167d2236d4674
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21475
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
2 years agoRemove RT in RD publish unittest. 31/22131/2
Ziran Sun [Fri, 25 Aug 2017 09:01:48 +0000 (10:01 +0100)]
Remove RT in RD publish unittest.

Remove rt referece of oic.wk.rdpub in RD unitests to be inline with spec.

Change-Id: I0ed49dcca1634617fd4b21280c7a7e14833989ca
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22131
Reviewed-by: Todd Malsbary <todd.malsbary@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
2 years ago[IOT-2430] Change OCLinksPayloadValueCreate API 73/21673/10
uzchoi [Sun, 30 Jul 2017 08:32:56 +0000 (17:32 +0900)]
[IOT-2430] Change OCLinksPayloadValueCreate API

OCLinksPayloadiValue returned PayloadValue which requies memory
release when we only takes array member as property of payload.
Instead of PayloadValue, PayloadArray is returned from this API.
Considering the CPP API, this return type will work better.
API name has been changed into OCLinksPayloadArrayCreate also.

According to the API change, code used this API also changed
excluding redundant memory allocation.

Previously result is passed by parameter as pointer with bool
return, but result is passsed as return value to align the style
of other IoTivity Create type APIs.

Change-Id: I4ed976f29cef8105ac002021d970ef61d00ae7cd
Signed-off-by: uzchoi <uzchoi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21673
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
2 years agoIOT-2539 removed unused code from subownerclient.c 33/22233/3
George Nash [Fri, 4 Aug 2017 20:07:20 +0000 (13:07 -0700)]
IOT-2539 removed unused code from subownerclient.c

The subowner client contained several functions and
variables that were unused. Unused code is not
maintained and should be removed.

selectTwoDiffNum is an unused function
printUuidList is an unused function
updateDoxmForMOTCB is an unused function
g_unown_cnt is an unused variable
SUPPORTED_PRMS is an unused const varaible

provisionCred is unused but unlike the other unused
code it was referenced in some commented out code
in main.  For that reason the provisionCred code
was not just removed. Instead a macro was used to
block out the code from the compiler. The code can
be enabled by changing PROVISION_CRED_SUPPORTED macro
to 1.

Change-Id: Ia89d1ebd4cfeff7e8771147d309ba7155f97818c
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21755
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 469c53b32c791a7cc8405ff1fcb340fd511d5880)

2 years agoImprove android building 31/21631/13
Mats Wichmann [Mon, 10 Jul 2017 13:38:27 +0000 (07:38 -0600)]
Improve android building

build_common/SConscript:
    - ANDROID_NDK, ANDROID_HOME, ANDROID_GRADLE option variables
    setup moved to end.  A visit if needed to respective SConscripts
    will cause the default path to be computed, this path is
    then supplied to the variable setup.  The comment in the later
    section will describe more.
build_common/android/SConscript:
    - option var setup not heeded here. Just call ndk, gradle, sdk
    SConscript if path not already set.
    - API_VER is set at top, idea is to have one place to change
    to experiment with new verisons.
    - all three paths are printed from one "print", this can easily
    be disabled if not wanted.
build_common/linux/SConscript,
build_common/windows/SConscript:
    - just pick up gradle info from SConscript, no need for the
    option var setup.
extlibs/android/gradle/SConscript:
    - clean up; version is now set in a single variable
extlibs/android/ndk/SConscript:
    - clean up; version is now set in a single variable
    - adds Mac support - untested, but why not: sdk script does it
extlibs/android/sdk/SConscript:
    - clean up; version is now set in a single variable

Change-Id: I7e4355493808eddce6899fe657657e56c339ae5d
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21631
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
2 years ago[IOT-1925] ACE provisioning should fail 95/21895/7
akk0rd [Fri, 11 Aug 2017 17:52:59 +0000 (20:52 +0300)]
[IOT-1925] ACE provisioning should fail

ACE provisioning should fail if interface length is 0

Change-Id: Ibe09302d6769eff90403fd130b5f88195ac32cac
Signed-off-by: akk0rd <v.riznyk@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21895
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years agoignore: Temporary files with .tmp suffix 83/22283/1
Philippe Coval [Fri, 18 Aug 2017 12:35:58 +0000 (14:35 +0200)]
ignore: Temporary files with .tmp suffix

Bug: https://jira.iotivity.org/browse/IOT-2599
Change-Id: I6845ecece8fd6c5d1725bafb25991d25b91e4f45
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21997
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 20b65e4505ed0d175244a03da636d1d6b30ef5d0)

2 years agoraxmpp: Add scriptlet to clone before scons 57/22157/2
Philippe Coval [Wed, 19 Jul 2017 09:34:09 +0000 (11:34 +0200)]
raxmpp: Add scriptlet to clone before scons

Bug: https://jira.iotivity.org/browse/IOT-1760
Change-Id: Ibb074c1387826af783c2a8d18c3f12bfc34834c3
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21535
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 90cde5ba9927d19d0c1826500f3ada41e2693d2f)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22157
Reviewed-by: Mats Wichmann <mats@linux.com>
2 years agoyaml: Add scriptlet to clone before scons 79/22079/2
Philippe Coval [Tue, 25 Jul 2017 16:13:18 +0000 (18:13 +0200)]
yaml: Add scriptlet to clone before scons

Bug: https://jira.iotivity.org/browse/IOT-1760
Change-Id: Ief605d40b83d437df4049d18af7188eaea0ecbcb
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21623
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 286bc151acf0e8f2b67932d0fca2405cc859375e)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22079
Reviewed-by: Mats Wichmann <mats@linux.com>
2 years agolibstrophe: Add scriptlet to clone before scons 85/22085/3
Philippe Coval [Wed, 19 Jul 2017 09:34:09 +0000 (11:34 +0200)]
libstrophe: Add scriptlet to clone before scons

Bug: https://jira.iotivity.org/browse/IOT-1760
Change-Id: Iac4a2df91c81bc65af6742378bda2b67e66dc0cf
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21531
Reviewed-by: George Nash <george.nash@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit e1ad56040295161e2c21e48f8326631e4492e084)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22085
Reviewed-by: Mats Wichmann <mats@linux.com>
2 years agosecurity: Fix warnings in srmtestcommon 27/21827/2
George Nash [Tue, 23 May 2017 21:41:54 +0000 (14:41 -0700)]
security: Fix warnings in srmtestcommon

Fixed missing-field-initializers compiler warnings from srmtestcommon

This initializes all of the fields in the CborValue and CborParser
structs.

Change-Id: I8bc6ec584cd94d9882fed0cc30cd4a2892b4ade3
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20339
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
(cherry picked from commit e1fb8f8e906e99db480259b16dbe2fe41cbb04f6)
Reviewed-on: https://gerrit.iotivity.org/gerrit/21827
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>