iotivity.git
18 months ago[IOT-3041] return OC_STACK_OK when pDev2=NULL 51/24551/2
v.riznyk [Tue, 3 Apr 2018 15:37:05 +0000 (18:37 +0300)]
[IOT-3041] return OC_STACK_OK when pDev2=NULL

The checking pDev2 was added to OCProvisionCredentials.

Change-Id: Ic289559c68250a1436fab64bcbd5dfb26d7eb4c8
Signed-off-by: v.riznyk <v.riznyk@samsung.com>
18 months ago[IOT-2052] Update to support OCF 1.0 73/24273/14
v.riznyk [Wed, 7 Mar 2018 11:53:48 +0000 (13:53 +0200)]
[IOT-2052] Update to support OCF 1.0

Update Cred recource with adding partial generating CBOR.

Change-Id: I25dcf3d020da09c67d0769eee8659d85253b4f5d
Signed-off-by: v.riznyk <v.riznyk@samsung.com>
18 months agoFix two more problems building with Python3 09/24609/3
Mats Wichmann [Sat, 7 Apr 2018 23:46:27 +0000 (17:46 -0600)]
Fix two more problems building with Python3

The boost script used string.replace() which is no longer
supported; problem did not turn up until trying a build on Windows

The security - provisioning - unittest script had a Windows
stanza for killing running server processes before launching a
new one. It printed the process id it was going to kill in a way
that caused an AttributError exception - this was a conversion
error from when print statement was changed to print function,
again the code path had not been hit. At the same time a second
exception ocurred because when the first exception took place the
script attempted to us the message attribute of the exception for
printing, but not all exceptions have such an attribute. Change
to just print the string representation of the exception, which
is more reliable.

Additionally, in the libcoap script, the term 'string' is used
which while not broken since the script never imports the string
module, is unnecessarily ambiguous. Use the Python recommended
disambiguation of adding a trailing underscore on an identifier
which might match one used by Python.

Change-Id: I635796a6442caacb6988e21dbe46938f860e333f
Signed-off-by: Mats Wichmann <mats@linux.com>
18 months agoMemory leak in security spresource 15/24615/3
Mats Wichmann [Mon, 9 Apr 2018 15:52:53 +0000 (09:52 -0600)]
Memory leak in security spresource

In TestEncodeDecode, a profile is allocated and filled;
it is unwound but not deallocated, leading to valgrind
memory leak report like this:

32 bytes in 1 blocks are definitely lost in loss record 130 of 271

The freeing change eliminates nine such reports, one for
each call to the function.

Change-Id: I8b1223f7b832d4fafac4d7225ea2544fc348a7a4
Signed-off-by: Mats Wichmann <mats@linux.com>
18 months agoUse `URI` all caps in documentation 59/24559/2
George Nash [Tue, 3 Apr 2018 19:00:18 +0000 (12:00 -0700)]
Use `URI` all caps in documentation

URI is all caps when used in documentation

Fixed instances where param document parameters
[in], [out] and [in,out] were used incorrectly.

A few other minor documentation issues cleaned up.

Change-Id: Ic9db0c22a667d371fd1ca00c60b5bbceba6a3c77
Signed-off-by: George Nash <george.nash@intel.com>
18 months agoresource-container: Install unit tests 79/24479/4
Philippe Coval [Fri, 23 Mar 2018 10:44:03 +0000 (11:44 +0100)]
resource-container: Install unit tests

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I1b88b500f18445ea145c24a8e52ea07c6b11c521
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agoFix issues found using static code analysis 89/24589/3
George Nash [Thu, 5 Apr 2018 18:32:14 +0000 (11:32 -0700)]
Fix issues found using static code analysis

Fixed possible issue that the for loop could be
accessing element outside the array. Replaced the
variables holding the size of the array with a
compile time calculation. Removed separate member varaible
use to track the size of the resource type array and
the resource interface array.

Changed the initialization of m_dimmingLightServer from
C++11 initializer list style to C++98 initializer style
due to this causing build failure on gcc/g++ v4.8.4.
Issue reported by Abhishek Pandey

Change-Id: I553e661dbd2e6fa3fe38d8694d88273c5b309c58
Signed-off-by: George Nash <george.nash@intel.com>
18 months agoscene-manager: Install unit tests 85/24485/3
Philippe Coval [Fri, 23 Mar 2018 10:45:37 +0000 (11:45 +0100)]
scene-manager: Install unit tests

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I9db429a928d6fb5084948a7122c2a4f0151829bd
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agoresource: Install unit tests 83/24483/6
Philippe Coval [Fri, 23 Mar 2018 10:45:14 +0000 (11:45 +0100)]
resource: Install unit tests

logger tests are renamed to more meaningful names,
note that yocto used different names (logger_test_c/cpp),
I aligned to upstream's sources.

Bug: https://jira.iotivity.org/browse/IOT-524
Origin: https://gerrit.iotivity.org/gerrit/#/c/24483/
Change-Id: Ib5eabdece4414801cd08d27671bb759d27914174
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agocsdk: Install unit tests 81/24481/4
Philippe Coval [Fri, 23 Mar 2018 10:44:47 +0000 (11:44 +0100)]
csdk: Install unit tests

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: Ie1e99e3c06d1723730d81621e78a941df1b031f9
Origin: https://gerrit.iotivity.org/gerrit/#/c/24481/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months ago1.2 support 73/23873/8
Oleksandr Dmytrenko [Fri, 24 Nov 2017 12:24:17 +0000 (14:24 +0200)]
1.2 support

old version servers support

Change-Id: I2f7d54c0ff6b4a372b82c4e99263af4df2c98a4e
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
(cherry picked from commit cf3012285f8eff116acc3d8971a293e12af38f8d)
Origin: https://gerrit.iotivity.org/gerrit/#/c/23445/

18 months agoIOT-3045 Fix return type of getResourceHandleAtUri 75/24575/3
George Nash [Wed, 4 Apr 2018 19:27:47 +0000 (12:27 -0700)]
IOT-3045 Fix return type of getResourceHandleAtUri

OcPlatfrom.getResourceAtUri should return null
when a resource is not found at the specified
URI. The class JniOcResourceHandle returned
a non-null value even when a null resourceHandle
was passed into the function. The assumption
when the code was originally created was that
it would return null. This assumption was incorrect.

This was tested by modifying simpleserver sample
Modifications not included as part of this commit.

Bug: https://jira.iotivity.org/browse/IOT-3045
Change-Id: I3e923dca3415e9e0ec473b1dd4ff4619538f325b
Signed-off-by: George Nash <george.nash@intel.com>
18 months agoconnectivity: Declare strict void function 69/23969/10
Philippe Coval [Mon, 22 Jan 2018 09:06:39 +0000 (10:06 +0100)]
connectivity: Declare strict void function

Declare void functions as strict prototype

If built along -Wstrict-prototypes it will raise and error,
this is the case on TizenRT.

More patches to come to enable this flag by default.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I71c37805b5fb60b4d8e1c78845194979fb18f9af
Origin: https://gerrit.iotivity.org/gerrit/#/c/23969/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agosecurity: Declare strict void function 71/23971/6
Philippe Coval [Mon, 22 Jan 2018 09:09:35 +0000 (10:09 +0100)]
security: Declare strict void function

Declare void functions as strict prototype

If built along -Wstrict-prototypes it will raise and error,
this is the case on TizenRT.

More patches to come to enable this flag by default.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I8597f301bb7f2fbe11b4dc46f1eab8620a714da4
Origin: https://gerrit.iotivity.org/gerrit/#/c/23971/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agoeasy-setup: Install unit tests 77/24477/4
Philippe Coval [Fri, 23 Mar 2018 11:09:32 +0000 (12:09 +0100)]
easy-setup: Install unit tests

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I36ec02bc79d41c8cc3627c51a6eecc6e5f322b17
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agotinycbor version bump 31/24531/2
Mats Wichmann [Sun, 1 Apr 2018 21:37:40 +0000 (15:37 -0600)]
tinycbor version bump

bugfix release: upstream is now on 0.5.1 - one fix is for a bug that an
iotivity user actually ran into, so it is a fix we want to pick up.

Bug: https://jira.iotivity.org/browse/IOT-3019
Change-Id: I0be712b375e16047161f5416fd2c61f94c676db3
Signed-off-by: Mats Wichmann <mats@linux.com>
18 months agoSample implementation of ocf_light 63/24263/24
George Nash [Fri, 9 Feb 2018 22:57:25 +0000 (14:57 -0800)]
Sample implementation of ocf_light

This sample borrows a lot of code from the server
sample generated from the DeviceBuilder project
https://github.com/openconnectivityfoundation/DeviceBuilder

Eventhough this borrows a lot of code from the
DeviceBuilder project it has been modified to make
it more useful as an example separating the code into
smaller classes and adding helper classes.

This code has been run against the OCF CTT. See the
README.md file for more information about the CTT
results.

Change-Id: If0ae5e3527517bb722648a614fbd96f13ad01144
Signed-off-by: George Nash <george.nash@intel.com>
18 months agofix cloud unitialized pointer dereference 23/24523/1
Mats Wichmann [Thu, 29 Mar 2018 18:45:20 +0000 (12:45 -0600)]
fix cloud unitialized pointer dereference

Change-Id: I869aa695160203ebb1d0cb0701c3d43f55278c41
Signed-off-by: Mats Wichmann <mats@linux.com>
18 months ago[IOT-2928][IOT-3017][IOT-3022] 27/24427/19
Oleksii Beketov [Wed, 28 Mar 2018 14:57:05 +0000 (17:57 +0300)]
[IOT-2928][IOT-3017][IOT-3022]

The cloud provisioning:
1. sid add
2. get cloud status request add
3. Remove 'accesstoken' from coapcloudconf resource response

Change-Id: I5f5c1aa7ae414f02f6d1c288258084cacfdd1ed0
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
18 months agobuild: Align yocto to linux 57/24457/5
Philippe Coval [Thu, 22 Mar 2018 19:58:20 +0000 (20:58 +0100)]
build: Align yocto to linux

Until next refactoring it's safe to keep yocto aligned to linux,
at least only on this file, because OS is set to linux at bottom line.

Problem was observed when build using:

  EXTRA_OESCONS += " TARGET_TRANRSPORT=IP"
  EXTRA_OESCONS += " WITH_CLOUD=True"
  EXTRA_OESCONS += " WITH_TCP=True"
  EXTRA_OESCONS += " WITH_MQ=PUB,SUB"

Change-Id: I2bd6d9e32c9819d6cd485dc9d7691e213f33f2a1
Origin: https://gerrit.iotivity.org/gerrit/#/c/24457/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agoAlign license file 45/24045/4
Mats Wichmann [Tue, 30 Jan 2018 19:02:13 +0000 (12:02 -0700)]
Align license file

Minor:
The current LICENSE.md file is modified from the Apache original.
The modification is mostly incorrect (the change made is
intended for other source files, as described in the Appendix
in the original, not for the license file itself).  Restored the
pristine original.

Main problem addressed: github mirror misidentifies the license
of the project, since the first few lines do not match the
known text of the Apache 2.0 license.

Change-Id: Ia994002384bf93fa999ac634bc6d4c711b5c9d60
Signed-off-by: Mats Wichmann <mats@linux.com>
18 months agosecurity: Declare strict void function 27/24127/2
Philippe Coval [Fri, 9 Feb 2018 10:09:06 +0000 (11:09 +0100)]
security:  Declare strict void function

Declare void functions as strict prototype
If built along -Wstrict-prototypes it will raise and error,
this is the case on TizenRT.

More patches to come to enable this flag by default.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I126edf8d9f74bbe679617a84b2e964a546422709
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agoFix build warnings in credresource.c 95/24495/2
George Nash [Tue, 27 Mar 2018 19:33:46 +0000 (12:33 -0700)]
Fix build warnings in credresource.c

Fixed downcastig warning from size_t to int.

Fixed unused parameter warnings.

Change-Id: Ieb9139d79995bb09ce4afedcfe35b2293759f879
Signed-off-by: George Nash <george.nash@intel.com>
18 months agoAdjust provisioning unit test 93/24493/1
Mats Wichmann [Tue, 27 Mar 2018 18:20:38 +0000 (12:20 -0600)]
Adjust provisioning unit test

A test of registerDisplayPinCallback passes a null callback
argument, and a valid callback handler pointer argument,
but checks the resolt for OC_STACK_INVALID_PARAM (which
would be the case if the handler pointer was null) instead
of OC_STACK_INVALID_CALLBACK.

Change-Id: I9d5e529cc1e0da580f8cc853d6692ff8efb31b93
Signed-off-by: Mats Wichmann <mats@linux.com>
18 months agoca ssl adapter msgs 13/24413/4
Oleksandr Dmytrenko [Fri, 16 Mar 2018 08:58:13 +0000 (10:58 +0200)]
ca ssl adapter msgs

Print ca ssl adapter messages

Change-Id: I8f044e368caf75dc0212fad4edffd6c8c5c14ca2
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
18 months agoCertificate Logging Improvement 73/24473/2
Oleksii Beketov [Mon, 26 Mar 2018 12:29:35 +0000 (15:29 +0300)]
Certificate Logging Improvement

Allow to log the cert entirely

Change-Id: I69cdef6f49323dda8c0d24df8b8f702f86847664
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
18 months agoUpdate sampleserver_justworks .json and .dat 23/24423/3
Nathan Heldt-Sheller [Mon, 19 Mar 2018 11:10:28 +0000 (04:10 -0700)]
Update sampleserver_justworks .json and .dat

This is the first of the applications to recieve an update to
the /acl2 .json to utilize the new "resources" wildcards.

This change (adding the two "+" and "-" entries in /acl2) should probably
be propagated to most sample applications, to give a consistent
example for vendors assessing IoTivity samples, but it is
not required for correction function.  The exception is an app
that is using the "*" wildcard to grant access to DCRs (e.g. the
SVRs) which will no longer work (but shouldn't have been done
anyway!)

Change-Id: I66e06432dead4ec90c17091352d2c19cab753bcf
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
18 months agostatic analysis: unintitialized struct 97/24197/8
Mats Wichmann [Sat, 17 Feb 2018 00:23:50 +0000 (17:23 -0700)]
static analysis: unintitialized struct

A couple of instances in this file do not initialize a struct,
while the majority do so using memset. Aligned so this source file
does things consistently. Two of these (lines 709 and 748 in the
original source) are causing Coverity static checker complaints
("uninitialized scalar variable") because the struct is assigned -
even though the member in question is never actually accessed.

Note according to my understanding, for c++ code, it is considered
better to use object initialization, although if the data is
only POD (Plain Old Data), the result does come out the same.
Thus, instead of:

    CAInfo_t responseData;
    memset(&responseData, 0, sizeof(CAInfo_t));

it is suggested to use:

    CAInfo_t responseData {};

we could adjust that in a separate change if people agree.

It should not actually be necessary to pre-fill the whole struct
with zeroes since the fields that matter get values in the tests
before use anyway. However the problem with CAInfo_t is that
someone thought it was a sensible idea to have a conditional
field in an important (public API) struct in cacommon.h:

typedef struct
{
    CAMessageType_t type;       /**< Qos for the request */
.#ifdef ROUTING_GATEWAY
    bool skipRetransmission;    /**< Will not attempt retransmission even if type is CONFIRM.
                                     Required for packet forwarding */
.#endif
    uint16_t messageId;
    ...
} CAInfo_t;

which means every valid use of CAInfo_t has to have the same #ifdef
ROUTING_GATEWAY bracketing to deal with this optional member. This
is absolutely horrid in a public API and should never happen -
it means the API is different if you use different compile flags.

Change-Id: If178c7d245142e166fa33447cd00946cff4a56fc
Signed-off-by: Mats Wichmann <mats@linux.com>
18 months agoplugins: Install unit tests 69/24469/2
Philippe Coval [Fri, 23 Mar 2018 10:44:23 +0000 (11:44 +0100)]
plugins: Install unit tests

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: Ic4eca5d07e3a9e8c5fb7b2201a483b659a020d76
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
18 months agoSecurity Profile Resource Implementation 37/24337/12
Steven Saunders [Tue, 6 Mar 2018 23:18:21 +0000 (16:18 -0700)]
Security Profile Resource Implementation

Change-Id: I6aab60b562272f0c4f34233d89c2b8884677c42a
Signed-off-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
18 months agobuild: Enable proxy for linux_full 53/24353/4
Philippe Coval [Tue, 7 Nov 2017 14:20:52 +0000 (15:20 +0100)]
build: Enable proxy for linux_full

Bug: https://jira.iotivity.org/browse/IOT-2241
Change-Id: Id580b4f484be8263ea95375a7a7c62551688b8c5
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Origin: https://gerrit.iotivity.org/gerrit/#/c/24353/

18 months agoCertificate Logging. 33/24033/4
Steven Saunders [Mon, 29 Jan 2018 18:07:29 +0000 (11:07 -0700)]
Certificate Logging.

Ignore VSCode files in .gitignore.

Change-Id: I6278498245915df370937c69d4835fc8ce980c69
Signed-off-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
18 months agoAnnotate deprecated functions with macro 87/24387/6
George Nash [Tue, 13 Mar 2018 22:57:46 +0000 (15:57 -0700)]
Annotate deprecated functions with macro

If a function was already marked as deprecated using
the @derecated doxygen annotation the OC_DEPRECATED_MSG
macro was added to generate compiler warnings when a
deprecated function was used.

The date the function was deprecated was obtained by
using git blame to find when the @deprecated tag
was added to the function documentation. The date the
tag was added was used in the macro.

Three instances of the function registerDeviceInfo
are marked as deprecated but the macro was not added
due to inheritance and mock objects implementing
their own version of the registerDeviceInfo. Caused
difficulty adding the macro to them without breaking
the build.

An attempt was made to clean up any remaining usages
of deprecated functions that were not part of unit tests.
It is possible that one or more instances of the
'registerDeviceInfo' function was missed.

Java is still using deprecated functions:
IOT-3011 and IOT-3012 to address the fact that Java is
still using deprecated functions.

Change-Id: I39b1af690b99d52f2e0d026e4c27b908e2f6c052
Signed-off-by: George Nash <george.nash@intel.com>
18 months ago[IOT-2052] Update to support OCF 1.0 85/24385/3
v.riznyk [Tue, 13 Mar 2018 16:13:58 +0000 (18:13 +0200)]
[IOT-2052] Update to support OCF 1.0

Update Acl recource with adding partial generating CBOR.

Change-Id: I03853040433e091ecb99daa559e12cd37496b7ad
Signed-off-by: v.riznyk <v.riznyk@samsung.com>
19 months agoSupport Signaling Message for CoAP over TCP 57/24357/14 1.4.0-RC1
Harry [Tue, 6 Mar 2018 17:43:34 +0000 (23:13 +0530)]
Support Signaling Message for CoAP over TCP

Implement signalling messages as per COAP over TCP
spec in RFC 8323

Change-Id: I25baf80c4b4380d1f9f9a8f81281f371927f7ed1
Signed-off-by: Sushil Yadav <sushil.ky@samsung.com>
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Signed-off-by: Harry <h.marappa@samsung.com>
19 months agoDrop arduino support: SINGLE_THREAD 69/23869/4
Mats Wichmann [Wed, 3 Jan 2018 13:26:33 +0000 (06:26 -0700)]
Drop arduino support: SINGLE_THREAD

After dropping the other iotivity arduino support, the
SINGLE_THREAD usage which was only for the ardunio platform
(not capable of multi-threaded) remains.  Since arduino is
gone, this may be no longer needed.

This change is a followon to https://gerrit.iotivity.org/gerrit/23723
for separate consideration.

Change-Id: Ie72873ba4ba90c10e9d8a41d638b0f7de3f76945
Signed-off-by: Mats Wichmann <mats@linux.com>
19 months agoresource: Declare strict void function 61/23861/8
Philippe Coval [Mon, 13 Nov 2017 14:59:14 +0000 (15:59 +0100)]
resource: Declare strict void function

Declare void functions as strict prototype

If built along -Wstrict-prototypes it will raise and error,
this is the case on TizenRT.

More patches to come to enable this flag by default.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I742ca3720209eec1f58382abdaff88ae08006a0e
Origin: https://gerrit.iotivity.org/gerrit/#/c/23861/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months ago[IOT-2928] Account/Tokens 71/24271/25
Oleksii Beketov [Fri, 16 Mar 2018 16:37:05 +0000 (18:37 +0200)]
[IOT-2928] Account/Tokens

The new cloud provisioning(CR1698v24)

Change-Id: I31873dc510455bc36905a35ea4f629dfdec33fd6
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
19 months agoEasy Setup CoAPCloudConf Resource Update 89/24389/9
Abhishek Pandey [Wed, 14 Mar 2018 13:14:22 +0000 (18:44 +0530)]
Easy Setup CoAPCloudConf Resource Update

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

In the upcoming version of OCF Spec, there are some changes in
definition of CoAPCloudConf Resource (oic.r.coapcloudconf). This patch
is for aligning the same with IoTivity implementation.

Following changes are done in this patch:

1) [Enrollee] Removed setting of Access Token Type (att) in GET
Response Payload.
2) [Enrollee] Removed reading of Access Token Type (att) from POST
Request Payload and passing a default value of "Bearer" to application.
3) [Enrollee] Removed Auth code Property from Enrollee. (this shouldn't
cause any harm).
4) [Mediator] Deprecated Getter and Setter APIs for Auth Code and
Access Token Type from Mediator

Change-Id: I6997b9e1b13cb9cd8bf95777e9984e4a749c87dd
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
19 months agoIOT-3010 Add OCPlatform::getResourceHandleAtUri 81/24381/5
George Nash [Mon, 12 Mar 2018 22:26:26 +0000 (15:26 -0700)]
IOT-3010 Add OCPlatform::getResourceHandleAtUri

This makes is possible to do things like get
the resource at `/oic/d` when to add the device
type.

This helps developers to avoid mixing C and C++
code in their projects.

Updated Cpp samples and unit test code to use
the new function.

Bug: https://jira.iotivity.org/browse/IOT-3010
Change-Id: I781081a5889807cea59ca5b569561da5d7d748e4
Signed-off-by: George Nash <george.nash@intel.com>
19 months agobuild: Check memory.h presence 91/23191/11
Philippe Coval [Tue, 14 Nov 2017 08:01:10 +0000 (09:01 +0100)]
build: Check memory.h presence

Some systems like TizenRT are not providing this header

Bug: https://jira.iotivity.org/browse/IOT-694
Change-Id: I46b118113241c921d7502f640900d2d7537957d9
Origin: https://gerrit.iotivity.org/gerrit/#/c/23191/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months ago[IOT-3007] Delete for /acl and /cred 59/24359/3
Nathan Heldt-Sheller [Thu, 8 Mar 2018 21:23:39 +0000 (13:23 -0800)]
[IOT-3007] Delete for /acl and /cred

Delete should be disallowed in RESET and RFNOP, just like Update is.

This is documented in CR 1805; see JIRA 3007 for details.

Change-Id: Ice108d3efa696b14e23e0e184784f0c17eacc524
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
19 months agoresource-encapsulation: Sync JSON and CBOR files 51/21851/10
Philippe Coval [Thu, 16 Nov 2017 16:52:20 +0000 (17:52 +0100)]
resource-encapsulation: Sync JSON and CBOR files

To avoid local changes on build,
let's commit the updated .dat files (using json2cbor)

Reminder, It's developer duty to commit those files on each changes on json source or any change that produce a different result

This way we're not leaving inconsistent binary files in tree.

JSON file was not modified because it is already in UNIX format

Note: those files may need to be updated to support current ACL
(and committed by security team, check status of json and dat files)

Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: If35e21b531cc84a6e17a3edcae56bd35d33a8048
Origin: https://gerrit.iotivity.org/gerrit/#/c/21851/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months ago[IOT-2931] additional ACE2 Resource wildcards 39/24339/3
Nathan Heldt-Sheller [Wed, 7 Mar 2018 08:27:03 +0000 (00:27 -0800)]
[IOT-2931] additional ACE2 Resource wildcards

Resource wildcards (*, + and -) are redefined in Bangkok to narrow
scope and reduce the number of Resources to which they apply.  New def'ns
are:
"+" All discoverable NCRs which expose at least one Secure Endpoint
"-" All discoverable NCRs which expose at least one Unsecure Endpoint
"*" All NCRs

Change-Id: Ia5b145cd366c71aea3c4a8716930638430aea711
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
19 months ago[IOT-2930] Device Config Resources 87/24287/5
Nathan Heldt-Sheller [Mon, 5 Mar 2018 21:51:43 +0000 (13:51 -0800)]
[IOT-2930] Device Config Resources

Adds functions to determine if a request is for a DCR; denies
requests for NCRs outside of RFNOP.

Note: the SRMIsSecurityVirtualResourceURI() function is not new, but
moved from secureresourcemanager.h to srmutility.h as it is used in
more than one SRM source file now.

Change-Id: I98c707fc6dcf46e903f6adf1c0485d4484f7a1a9
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
19 months agoresource-encapsulation: Install examples 79/23679/5
Philippe Coval [Thu, 7 Dec 2017 13:14:27 +0000 (14:14 +0100)]
resource-encapsulation: Install examples

Yocto manually installed then,
so let's rely on scons from now on.

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: Id4a3825bfdf29e2cfddaf15c17451c86c332d2c1
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agoOne more certprofile unit test 81/24281/3
Steven Saunders [Mon, 5 Mar 2018 17:29:33 +0000 (10:29 -0700)]
One more certprofile unit test

Change-Id: I0b55256c48fac998018a4a9089630d8b03e03482
Signed-off-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
19 months agoMerge "Merge branch '1.3-rel' (0c441f6)"
C.J. Collier [Wed, 7 Mar 2018 21:05:43 +0000 (21:05 +0000)]
Merge "Merge branch '1.3-rel' (0c441f6)"

19 months agoMerge branch '1.3-rel' (0c441f6) 45/24345/1
Philippe Coval [Wed, 7 Mar 2018 09:46:07 +0000 (10:46 +0100)]
Merge branch '1.3-rel' (0c441f6)

Change-Id: I0c441f6d94474bd18ba8b950d1d94f2523c9f36e
Bug: https://jira.iotivity.org/browse/IOT-2453
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agonotification: Sync JSON and CBOR files 35/24335/1
Philippe Coval [Tue, 6 Mar 2018 11:51:48 +0000 (12:51 +0100)]
notification: Sync JSON and CBOR files

File is updated after running test.

To avoid local changes on build,
let's commit the updated .dat files (using json2cbor),

Reminding, It's developer dutty to commit those files on each changes
on json source or any change that produce a different result.
This way we're not leaving inconsistant binary files in tree.

JSON file was not modified because it is already in UNIX format

Note: those files may need to be updated to support current ACL
(and commited by security team, check status of json and dat files)

Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: I874c14c46c229ff9d0aee56000bd9c4f68786090
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agoexamples: Sync JSON and CBOR files 27/24327/3
Philippe Coval [Tue, 6 Mar 2018 11:51:48 +0000 (12:51 +0100)]
examples: Sync JSON and CBOR files

File is updated after running test.

To avoid local changes on build,
let's commit the updated .dat files (using json2cbor),

Reminding, It's developer dutty to commit those files on each changes
on json source or any change that produce a different result.
This way we're not leaving inconsistant binary files in tree.

JSON file was not modified because it is already in UNIX format

Note: those files may need to be updated to support current ACL
(and commited by security team, check status of json and dat files)

Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: If8212a54393b74110e6804847b8acaac4c2dce7c
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agoIPCA: Sync JSON and CBOR files 01/22001/12
Philippe Coval [Fri, 18 Aug 2017 12:02:40 +0000 (14:02 +0200)]
IPCA: Sync JSON and CBOR files

File is updated after running test.

To avoid local changes on build,
let's commit the updated .dat files (using json2cbor),

Reminding, It's developer dutty to commit those files on each changes
on json source or any change that produce a different result.
This way we're not leaving inconsistant binary files in tree.

JSON file was not modified because it is already in UNIX format

Note: those files may need to be updated to support current ACL
(and commited by security team, check status of json and dat files)

Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: I6570f84ea66652b3cbab7d5182e23cb4d087dbff
Origin: https://gerrit.iotivity.org/gerrit/#/c/22001/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agocoap-http-proxy: Sync JSON and CBOR files 19/24319/2
Philippe Coval [Tue, 6 Mar 2018 11:51:48 +0000 (12:51 +0100)]
coap-http-proxy: Sync JSON and CBOR files

File is updated after running test.

To avoid local changes on build,
let's commit the updated .dat files (using json2cbor),

Reminding, It's developer dutty to commit those files on each changes
on json source or any change that produce a different result.
This way we're not leaving inconsistant binary files in tree.

JSON file was not modified because it is already in UNIX format

Note: those files may need to be updated to support current ACL
(and commited by security team, check status of json and dat files)

Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: I07a7482eab8eef04c26604e0113020d5c62603a1
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agocsdk: Sync JSON and CBOR files 15/24315/2
Philippe Coval [Tue, 6 Mar 2018 11:51:47 +0000 (12:51 +0100)]
csdk: Sync JSON and CBOR files

File is updated after running test.

To avoid local changes on build,
let's commit the updated .dat files (using json2cbor),

Reminding, It's developer dutty to commit those files on each changes
on json source or any change that produce a different result.
This way we're not leaving inconsistant binary files in tree.

JSON file was not modified because it is already in UNIX format

Note: those files may need to be updated to support current ACL
(and commited by security team, check status of json and dat files)

Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: I5ef7105eacf52f3c0e5b79fc1a3da77c987ec601
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months ago[IOT-2019] Add missing mutex include. 35/24235/5
Martin Roesch [Tue, 27 Feb 2018 12:31:07 +0000 (13:31 +0100)]
[IOT-2019] Add missing mutex include.

When compiling IoTivity with WITH_CLOUD=true WITH_MQ=PUB,SUB
the aircon_controlee example fails to compile:
In file included from cloud/samples/client/airconditioner/aircon_controlee.cpp:12:0:
resource/csdk/resource-directory/include/RDClient.h:49:21: error: 'recursive_mutex' is not a member of 'std'
     std::shared_ptr<std::recursive_mutex> _csdkLock;

Including the mutex header fixes the issue.

Change-Id: I1aa4a7fcc5b66ea05382dc3a821598abf5a91c0b
Signed-off-by: Martin Roesch <martin.roesch@kistler.com>
19 months agoprovisioning: Include system headers 73/22073/27
Philippe Coval [Thu, 24 Aug 2017 09:56:01 +0000 (11:56 +0200)]
provisioning: Include system headers

This change is just to test infra, can be merged anytime.

Bug: https://jira.iotivity.org/browse/IOT-2279
Change-Id: I2e0e6d80edec94d6cd8050ce42656d8aa86482db
Origin: https://gerrit.iotivity.org/gerrit/#/c/22073/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agoGen/Check certs against Bangkok requirements 77/24077/13
Steven Saunders [Fri, 2 Feb 2018 21:50:23 +0000 (14:50 -0700)]
Gen/Check certs against Bangkok requirements

Change-Id: I3ee0fb005c6c9ce91a0e4c16454b6856c508616f
Signed-off-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
19 months agotinycbor: Update repo url to supported one 53/253/7
Philippe Coval [Sun, 18 Feb 2018 14:29:38 +0000 (15:29 +0100)]
tinycbor: Update repo url to supported one

01org is deprecated

Change-Id: Ief6f9239fa5e7ef383e6c5d432b99187a6ab70f1
Bug: https://jira.iotivity.org/browse/IOT-2279
Origin: https://gerrit.iotivity.org/gerrit/#/c/253/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months agoSupport VS2017 for Building UWP 29/23629/4
Ibrahim Esmat [Fri, 17 Nov 2017 07:00:21 +0000 (23:00 -0800)]
Support VS2017 for Building UWP

Add support for building iotivity UWP with Visual Studio 2017

Change-Id: Ic10d427cc2f5b8fea19905de6c647e40e4f24384
Signed-off-by: Ibrahim Esmat <iesmat@microsoft.com>
19 months agoRevert "Sample implementation of ocf_light" 53/24253/2
George Nash [Wed, 28 Feb 2018 23:19:17 +0000 (15:19 -0800)]
Revert "Sample implementation of ocf_light"

The sample code was not ready to be merged. Needs more improvment before it should be merged.

This reverts commit 138b472a3429e539bf00936e7a16eaad050dda35.

Change-Id: I34f955d4b70a5d4a97e723adb842b78aa4b93e21
Signed-off-by: George Nash <george.nash@intel.com>
19 months ago[IOT-3001]Fix rownerId in PostOwnerCredential 39/24239/3
Aleksey Volkov [Wed, 28 Feb 2018 12:58:08 +0000 (14:58 +0200)]
[IOT-3001]Fix rownerId in PostOwnerCredential

Fix rownerId value in PostOwnerCredential request

Change-Id: I8a18fa99d19709f5ca260fc4ff68b3497e110687
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
19 months agoMerge "Merge branch '1.3-rel' (df031b0)"
C.J. Collier [Thu, 1 Mar 2018 16:02:38 +0000 (16:02 +0000)]
Merge "Merge branch '1.3-rel' (df031b0)"

19 months agoSample implementation of ocf_light 75/23375/18
George Nash [Fri, 9 Feb 2018 22:57:25 +0000 (14:57 -0800)]
Sample implementation of ocf_light

This sample borrows a lot of code from the server
sample generated from the DeviceBuilder project
https://github.com/openconnectivityfoundation/DeviceBuilder

Change-Id: I4fa40119fb8fdc1594905491fa362ae33a7cc7fc
Signed-off-by: George Nash <george.nash@intel.com>
19 months ago[IOT-2762] CreateEndpoint err in secured mode 19/24219/2
uzchoi [Mon, 5 Feb 2018 08:31:58 +0000 (17:31 +0900)]
[IOT-2762] CreateEndpoint err in secured mode

In case of server process and client process exist in a same machine,
ifindex of CAEndpoint_t is different from the ifindex of Request DevAddr
because the ifindex of request DevAddr indicate local loopback in
secured mode while CAEndpoint_t shows physical interface.
This error can be fixed by checking whether the sender is from loopback.
However, some machine shows wrong print in if_indextoname() such as
eth0 instead of lo.
For this reason, I removed the comparison of ifindex. For more exact
check, we can put IP address is from my machine but looks inefficient.

Change-Id: Ic67fd2b4609df5779cb2775f632dca79b2bc7232
Signed-off-by: uzchoi <uzchoi@samsung.com>
19 months agoMLK: Clean 5 stack unittest valgrind leak reports 29/22729/20
Mats Wichmann [Sat, 7 Oct 2017 14:47:32 +0000 (08:47 -0600)]
MLK: Clean 5 stack unittest valgrind leak reports

These are in the test code only.

1/2. The test TEST(LinksPayloadArray, BuildCollectionLinksPayloadArray)
has multiple allocations that are not freed.

  736 bytes in 1 blocks are definitely lost in loss record 962 of 988
  alloc ~3019:  CAGetNetworkInformation(&info, &size);
  added OICFree(info); at function end

  184 bytes in 1 blocks are definitely lost in loss record 922 of 988
  allocated ~3015: OCDevAddr* devAddr = (OCDevAddr*)OICCalloc(1, sizeof(OCDevAddr));
  added OICFree(devAddr); at function end

3. Still in TEST(LinksPayloadArray, BuildCollectionLinksPayloadArray),
  134 bytes in 4 blocks are definitely lost in loss record 901 of 988
  alloc ~3125:   ASSERT_TRUE(OCRepPayloadGetPropString(epsMap[k], OC_RSRVD_ENDPOINT, &outUri));
  outUri is allocated, tested, not freed.

  Added an OICFree at the end of the loop

4/5. two calls to OCRepPayloadGetPropObject happen in a pair of loops;
freeing is outside the loops which means that iterations other than
the last have their allocation lost, not freed.

  252 (48 direct, 204 indirect) bytes in 1 blocks are definitely lost in loss record 929 of 988
  115 (48 direct, 67 indirect) bytes in 1 blocks are definitely lost in loss record 892 of 988

Note for reviewers: some other leak reports for this
unittest were traced to flaws in the stack code, and
were split off into separate commits as a result, since
"approve change to stack" might be quite different than
"approve change to unittest".  See:
https://gerrit.iotivity.org/gerrit/23847
https://gerrit.iotivity.org/gerrit/23849

With the items in this change and the two referenced change,
the 12 "definitely lost" leak reports for the stack
unittest are reduced to two.

Change-Id: I6f1c74eedc6e9be40173bde8c1f321e84dbc83f0
Signed-off-by: Mats Wichmann <mats@linux.com>
19 months ago[IOT-2965] SaveTrustCertChain update 55/23955/2
Oleksii Beketov [Thu, 18 Jan 2018 15:27:43 +0000 (17:27 +0200)]
[IOT-2965] SaveTrustCertChain update

SRPSaveTrustCertChain switched to save root certificate
from optional data to public data.

Change-Id: Ic3584eb41c85d636065c3e78e2cc45aa21fce960
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
19 months agonotification: Declare strict void function 65/23865/5
Philippe Coval [Mon, 13 Nov 2017 15:53:52 +0000 (16:53 +0100)]
notification: Declare strict void function

Declare void functions as strict prototype

If built along -Wstrict-prototypes it will raise and error,
this is the case on TizenRT.

More patches to come to enable this flag by default.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I7740d360a34dc114cf205fdf3a366ea1537c6f9f
Origin: https://gerrit.iotivity.org/gerrit/#/c/23865/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
19 months ago[IOT-2972] Extend linux error-on-warn to C++ 35/24035/7
George Nash [Tue, 6 Feb 2018 23:18:12 +0000 (15:18 -0800)]
[IOT-2972] Extend linux error-on-warn to C++

-Werror, which causes warnings to be treated as errors,
is set in Linux build in CFLAGS, which applies only to
C builds. This moves the -Werror to CCFLAGS so it applies
to both C and C++.

This also fixes build warnings in C++ code a the same time.

OICMiddle/Server.cpp [-Werror=int-in-bool-context]
The logic `&&` was used when `&` should have been used in
the if statment

OCResource.cpp [-Werror=int-in-bool-context]
An enum constant was in a bool context. This was using
different logic if security was enabled vs. when it was
not enabled. The code was changed to use preprocessor
macros instead of the value of OC_SECURED in an if statment.

NSProvider.h and NSProvider.cpp: [-Werror=deprecated]
Throw expresions have been deprecated since C++11. They
were replaced with `nothrow`.

See: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3051.html

Since IoTivity's C++ implementation must support C++11
no effort has been made to keep the code backwards compatible
with compilers that do not support the `nothrow` keyword.

CoapHttpParser.c: [-Werror]
This is generated from the Curl code.
When the `CURLINFO_PRIVATE` option is used with the
`curl_easy_getinfo` function the expected argument type is `char **`.
The documentation says it is used like a `void **` but for historic
reasons a `char **` is expected.

To fix the warning a simple type cast is used.

Change-Id: Ia24e1c6df01d39923cbfb6705d0dc0af7d4f3870
Signed-off-by: George Nash <george.nash@intel.com>
19 months agoMerge branch '1.3-rel' (df031b0) 33/24133/5
Philippe Coval [Mon, 12 Feb 2018 08:29:38 +0000 (09:29 +0100)]
Merge branch '1.3-rel' (df031b0)

Relate-to:
https://gerrit.iotivity.org/gerrit/#/q/If8eb4fd34191da7144f39b9e6d1870209d17c9ca

Change-Id: Idf031b02c00bfd1a780243c07bec9cbfbc22fe0c
Bug: https://jira.iotivity.org/browse/IOT-2453
Origin: https://gerrit.iotivity.org/gerrit/#/c/24133/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agoignore: Generated .dat files from tests 63/22963/5
Philippe Coval [Fri, 18 Aug 2017 12:24:10 +0000 (14:24 +0200)]
ignore: Generated .dat files from tests

Tests are run from toplevel's dir
and some .dat files are created from them,
and should not be commited,
while those along json files (not in project dir)
should be on changes, and they won't be ignored by this change.

Bug: https://jira.iotivity.org/browse/IOT-2599
Change-Id: I6c0cdde527889390661c14d0dc98dcced702c73d
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21995
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit c6bbeacab3d224ff94c9f98dd30d61214780e7b8)

20 months agoFixed unused-param warning in JNI code 43/24143/1
George Nash [Tue, 13 Feb 2018 20:57:44 +0000 (12:57 -0800)]
Fixed unused-param warning in JNI code

Change-Id: I234863733168d6246f899f89c5a7a2b881844347
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoUse cdn instead of download.tizen.org 39/24139/1
C.J. Collier [Tue, 13 Feb 2018 16:38:14 +0000 (16:38 +0000)]
Use cdn instead of download.tizen.org

builds are failing due to connection reset by peer.  Making use of a
distributed package source could fix this.

Change-Id: Id9411eb2c87c4301d360341cb0bf61b1d7fe9002
Signed-off-by: C.J. Collier <cjcollier@linuxfoundation.org>
20 months agotizen: Install configuration settings in package 95/23495/4
Philippe Coval [Wed, 22 Nov 2017 01:13:11 +0000 (02:13 +0100)]
tizen: Install configuration settings in package

To track versions config options (SCONSFLAGS)
are shared into dev package.

Also introduce EXTRA_RPM_SCONSFLAGS that could be used outside (ie: rpmbuild)

It will be helpful for ARTIK7 support on fedora-24

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I15a3dcc3d3f74078e561143804562c750d9c4660
Origin: https://github.com/TizenTeam/iotivity/tree/sandbox/pcoval/on/master/fedora
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/23393/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agoiOS: Fix to build iOS Iotivity 1.3-Rel branch 45/23945/7
Yogisha Poojary [Fri, 12 Jan 2018 10:18:08 +0000 (05:18 -0500)]
iOS: Fix to build iOS Iotivity 1.3-Rel branch

Bug: https://jira.iotivity.org/browse/IOT-1897 https://jira.iotivity.org/browse/IOT-2570

Change-Id: If8eb4fd34191da7144f39b9e6d1870209d17c9ca
Signed-off-by: Yogisha Poojary <yogisha.poojary@lnttechservices.com>
20 months ago[IOT-2961] save doxm section 05/24005/5
Oleksandr Dmytrenko [Tue, 9 Jan 2018 15:38:13 +0000 (17:38 +0200)]
[IOT-2961] save doxm section

add json2cbor save doxm section

Change-Id: I2578ebd8162978b489833edc7e6159b30cb851ec
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
(cherry picked from commit 2a46516cf905d3931862b252db84e0d727c9b2ce)
Origin: https://gerrit.iotivity.org/gerrit/#/c/23903/

20 months agoTrap error testing Java version 99/24099/2
Mats Wichmann [Tue, 23 Jan 2018 20:08:24 +0000 (13:08 -0700)]
Trap error testing Java version

In case user is not pointing to correct JAVA_HOME,
the java version check will error out without being
very descriptive.  Catch the error and print a
message.

Change-Id: Ie78bc0882d8f1f1436352c8c1e26307ce2cad731
Signed-off-by: Mats Wichmann <mats@linux.com>
(cherry picked from commit 954bec4b65398540ab6fac43d2ebae98cdc2d6e0)

20 months agotinycbor: Update to v0.5.0 49/24049/2
Philippe Coval [Wed, 31 Jan 2018 10:46:40 +0000 (11:46 +0100)]
tinycbor: Update to v0.5.0

Bug: https://jira.iotivity.org/browse/IOT-1600
Origin: https://gerrit.iotivity.org/gerrit/#/c/24049/
Change-Id: If890fb0afd9362b090a2623b3b8b91f9f2e30af7
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agotinycbor: Update to v0.4.2 23/18423/14
Philippe Coval [Thu, 16 Nov 2017 20:16:45 +0000 (21:16 +0100)]
tinycbor: Update to v0.4.2

Expect regressions if applied directly to 1.3.1-RC5

Change-Id: I8637f086795c36b5b049db84f2cb1cf34bbdb1ec
Origin: https://gerrit.iotivity.org/gerrit/#/c/18423/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agoMerge "Merge branch '1.3-rel'"
Phil Coval [Thu, 8 Feb 2018 13:05:37 +0000 (13:05 +0000)]
Merge "Merge branch '1.3-rel'"

20 months agoDrop use of two deprecated defines 53/23953/2
Mats Wichmann [Mon, 15 Jan 2018 15:08:15 +0000 (08:08 -0700)]
Drop use of two deprecated defines

Per the header ocstackconfig.h, two defines are
deprecated with replacement. Change the single file
which still uses the old names.  The header comment:

/**
 * Maximum length of the Manufacturer name supported by the server
 * for manufacturer name.
 * @deprecated use MAX_PLATFORM_NAME_LENGTH instead.
 */

/**
 * Maximum length of the URL to the Manufacturer details supported by
 * the server.
 * @deprecated use MAX_PLATFORM_URL_LENGTH instead.
 */

Change-Id: I40ae198120de175750447996ebd43bed9ec25fa8
Signed-off-by: Mats Wichmann <mats@linux.com>
20 months agotizen: Guess system arch 89/23689/3
Philippe Coval [Tue, 28 Nov 2017 20:40:19 +0000 (21:40 +0100)]
tizen: Guess system arch

There is no reason to hardcode this,
when It can be guessed at build time.

Even %_arch is not reliable, for instance Fedora-24 on ARTIK7
defines %_arch as "arm".

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I545ba2b5128291951e47f7e98a2932af994187f6
Origin: https://github.com/TizenTeam/iotivity/tree/sandbox/pcoval/on/master/fedora
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/23497/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agoFix memory leak in transportEndpointsPayload 49/23849/3
Mats Wichmann [Sat, 30 Dec 2017 18:34:13 +0000 (11:34 -0700)]
Fix memory leak in transportEndpointsPayload

The internal function transportEndpointsPayload in occollection.c
creates endpoint strings and copies them into a payload.
However, the memory holding the generated string allocated by
OCCreateEndpointString is not freed after the payload copy is
made, and each time through the loop the pointer that refers to
this memory, createdEPStr, goes out of scope so the memory leaks.

valgrind of the stack unittests detected this with the
following leak report:

  264 bytes in 4 blocks are definitely lost in loss record 937 of 988

If traced back, this is triggered in the test for
BuildCollectionLinksPayloadArray, where inside a loop, the
function is called twice;

    linksRepPayloadArray = BuildCollectionLinksPayloadArray("/a/kitchen", false,
    devAddr, false, &arraySize);

    linksRepPayloadArray = BuildCollectionLinksPayloadArray("/a/kitchen", true, devAddr, false,
         &arraySize);

BuildCollectionLinksPayloadArray (not public API) calls
translateEndpointsPayload as described above.

Fix: add OICFree to the stanza where an endpoint string is created
and added with OCRepPayloadSetPropString.

Bug: https://jira.iotivity.org/browse/IOT-2951
Change-Id: Ie1fcbf6dc01479f01134bdb0ace09fa974df80c8
Signed-off-by: Mats Wichmann <mats@linux.com>
20 months agoFix resource attribute cleanup function 47/23847/3
Mats Wichmann [Sat, 30 Dec 2017 18:16:45 +0000 (11:16 -0700)]
Fix resource attribute cleanup function

The internal cleanup function OCDeleteResourceAttributes does not
properly account for two of attribute names, which indicate the
matching value will be an OCStringLL, instead freeing them as if
they were strings.  This leads to a memory leak. valgrind on the
stack unittests was showing four side effects of these:

0x4     3 bytes in 1 blocks are definitely lost in loss record 3 of 988
0x5     3 bytes in 1 blocks are definitely lost in loss record 4 of 988
0x259   75 (16 direct, 59 indirect) bytes in 1 blocks are definitely lost in loss record 600 of 988
0x268   76 (16 direct, 60 indirect) bytes in 1 blocks are definitely lost in loss record 615 of 988

If you trace these back in the report they are attributable to
exactly the two tests which use the unhandled cases:

    OCStringLL *ld = NULL;
    OCResourcePayloadAddStringLL(&ld, "en");
    OCResourcePayloadAddStringLL(&ld, "Description");
    OCResourcePayloadAddStringLL(&ld, "de");
    OCResourcePayloadAddStringLL(&ld, "Beschriebung");
    EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_DESCRIPTION, ld));

and

    OCStringLL *dmn = NULL;
    OCResourcePayloadAddStringLL(&dmn, "en");
    OCResourcePayloadAddStringLL(&dmn, "Manufacturer");
    OCResourcePayloadAddStringLL(&dmn, "de");
    OCResourcePayloadAddStringLL(&dmn, "Hersteller");
    EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_MFG_NAME, dmn));

The fix is simply to detect these two cases and free them the
proper way.

Bug: https://jira.iotivity.org/browse/IOT-2950
Change-Id: Idf95552035fdbc725a3b7919bb1036e8885e66cd
Signed-off-by: Mats Wichmann <mats@linux.com>
20 months agobuild: Install security tools 99/23499/14
Philippe Coval [Tue, 28 Nov 2017 12:13:54 +0000 (13:13 +0100)]
build: Install security tools

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: Idb2b2da72104f91d4a1257f571abdea4ca10d88a
Origin: https://github.com/TizenTeam/iotivity/tree/sandbox/pcoval/on/master/fedora
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agoMerge branch '1.3-rel' 31/24031/3
Philippe Coval [Tue, 6 Feb 2018 11:47:22 +0000 (12:47 +0100)]
Merge branch '1.3-rel'

Arduino files are explicitly removed again

Origin: https://gerrit.iotivity.org/gerrit/#/c/24031/
Change-Id: I0f0508779102ae17bbb739849a029044afaa7923
Bug: https://jira.iotivity.org/browse/IOT-2453
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agoFix issues dealing with OOM checking in CBOR 03/24003/3
Thiago Macieira [Fri, 26 Jan 2018 07:44:37 +0000 (23:44 -0800)]
Fix issues dealing with OOM checking in CBOR

Since we're doing err |=, the correct way to check for OOM is with &.

TinyCBOR 0.5 is capable of reporting if you added too many or too few
elements to a container. So don't skip adding one: always add them all,
so we can get the actual size you need.

Change-Id: I56b444f9d6274221a3b7fffd150d4c8e2cb6618a
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
20 months agoplugins: Declare strict void function 63/23863/6
Philippe Coval [Mon, 13 Nov 2017 16:16:32 +0000 (17:16 +0100)]
plugins: Declare strict void function

Declare void functions as strict prototype

If built along -Wstrict-prototypes it will raise and error,
this is the case on TizenRT.

More patches to come to enable this flag by default.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I2e4c75799119b3c47eb66c457c109589b5071967
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agotizen: Add dependency to boost for devel package 89/23489/8
Philippe Coval [Tue, 28 Nov 2017 10:43:00 +0000 (11:43 +0100)]
tizen: Add dependency to boost for devel package

Bug: https://jira.iotivity.org/browse/IOT-2541
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: Ia37aade9f23db37bb7e86a81e8639d2b6e0300cd
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit b5d0182daf8be1a808abd7073df71c836fd51d0f)

20 months agoClean build warnings 65/23965/3
George Nash [Fri, 19 Jan 2018 23:30:31 +0000 (15:30 -0800)]
Clean build warnings

This cleans new build warnings discovered when building
iotivity with GCC 7.2.1

-Werror=format-truncation
Fixed in json2cbor that was a result of incorrect buffer size in snprintf

-Werror=implicit-fallthrough
With the addition of the [[fallthrough]] keyword in C++17 GCC now detects
fallthrough locations. The fallthrough error can be hidden by adding
the comment "fall through" to the case that is falling though.

-Werror=pragmas and -Werror=attributes
are from the external tinyCbor code. We Ignore build warnings from extern
libraries. We may fix the warnings by working witht he external project
but it should not block any work in IoTivity.

Change-Id: I86c9fb42b987858c66698fe48e4c2a405769b004
Signed-off-by: George Nash <george.nash@intel.com>
20 months agobuild: Add all BuildRequires for fedora 69/23369/5
Philippe Coval [Sun, 19 Nov 2017 01:45:23 +0000 (02:45 +0100)]
build: Add all BuildRequires for fedora

This was needed for ARTIK7 on fedora-24

Change-Id: Ice95627b6afdf19f16c1e9277015f63938d2c132
Bug: https://jira.iotivity.org/browse/IOT-524
Origin: https://gerrit.iotivity.org/gerrit/#/c/23373/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit 5bf81a0cb5afd31d4e589c37c713da03cfc1a74d)

20 months ago[IOT-2961] save doxm section 03/23903/5
Oleksandr Dmytrenko [Tue, 9 Jan 2018 15:38:13 +0000 (17:38 +0200)]
[IOT-2961] save doxm section

add json2cbor save doxm section

Change-Id: I2578ebd8162978b489833edc7e6159b30cb851ec
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
20 months agocoap-http-proxy: Declare strict void function 01/23701/5
Philippe Coval [Tue, 14 Nov 2017 11:04:34 +0000 (12:04 +0100)]
coap-http-proxy: Declare strict void function

Declare void functions as strict prototype

If built along -Wstrict-prototypes it will raise and error,
this is the case on TizenRT.

More patches to come to enable this flag by default.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I175b1790afcd01ea614da707bd51881ed4556a8d
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agotizen: Fix typo on chrpath 05/23305/4
Philippe Coval [Thu, 16 Nov 2017 18:42:19 +0000 (19:42 +0100)]
tizen: Fix typo on chrpath

Could be done in scons install too

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I60f4684d17d260e1917fe5840b4eda626c196056
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit df6ca6d52b87dcdae701151a8531479c30c79f5f)
Origin: https://gerrit.iotivity.org/gerrit/#/c/23301/

20 months agocoap-http-proxy: Build shared lib also on linux 43/23243/9
Philippe Coval [Wed, 15 Nov 2017 17:57:55 +0000 (18:57 +0100)]
coap-http-proxy: Build shared lib also on linux

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: Ie7196851c3e623f383e6727b5cbd1c29cf1ae6ac
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agobuild: Install Extra Files for samples tests etc 71/23471/10
Philippe Coval [Wed, 22 Nov 2017 19:23:27 +0000 (20:23 +0100)]
build: Install Extra Files for samples tests etc

Working tests will be sorted out in later changes,
for now hierarchy is kept.

libcoap is installed as static lib used by com-oic-es-sample.

This was needed for ARTIK7 on Fedora-24

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: Idca20f1ddd00fbaf8c980e959a041397887f123b
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/23471/
Origin: https://github.com/TizenTeam/iotivity/tree/sandbox/pcoval/on/master/fedora
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agorpm: Also support OS without manifest 67/23367/11
Philippe Coval [Sun, 19 Nov 2017 01:08:19 +0000 (02:08 +0100)]
rpm: Also support OS without manifest

This was needed for ARTIK7 on fedora-24

Change-Id: I9a5081fe78299ca57dd2fbfa4efb70b051e4ad28
Bug: https://jira.iotivity.org/browse/IOT-524
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit 924f632d0af575193899b872ecddfd0459a8f49a)
Origin: https://gerrit.iotivity.org/gerrit/#/c/23371/3

20 months agoTrap error testing Java version 83/23983/2
Mats Wichmann [Tue, 23 Jan 2018 20:08:24 +0000 (13:08 -0700)]
Trap error testing Java version

In case user is not pointing to correct JAVA_HOME,
the java version check will error out without being
very descriptive.  Catch the error and print a
message.

Change-Id: Ie78bc0882d8f1f1436352c8c1e26307ce2cad731
Signed-off-by: Mats Wichmann <mats@linux.com>
20 months agoSquash gcc7 warnings (-> fails) 91/23991/3
Mats Wichmann [Thu, 25 Jan 2018 15:41:05 +0000 (08:41 -0700)]
Squash gcc7 warnings (-> fails)

base64 stuff in iotivity is deprecated, but while it is
only deprecated, not removed, the unit tests should
continue to exist and run.  Thus, the one test source file
should not fail the build due to emitting warnings over
the use of deprecated features.  The pragma works only
for gcc, so protect it from other compilers.

Change-Id: Id5d375c7d0bb601d87134f701d0da9e363c9fd76
Signed-off-by: Mats Wichmann <mats@linux.com>
20 months ago[IOT-2702] provisioningclient selective OTM 75/23875/3
Oleksandr Dmytrenko [Tue, 12 Sep 2017 10:38:46 +0000 (13:38 +0300)]
[IOT-2702] provisioningclient selective OTM

Added provisioningclient menu 21 with selective OTM

Change-Id: Ibda9f863b83c299f240c6a753f8c2ed5c4f533a8
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
20 months agoMerge "Merge branch '1.3-rel' (1484a56)"
C.J. Collier [Fri, 26 Jan 2018 20:01:00 +0000 (20:01 +0000)]
Merge "Merge branch '1.3-rel' (1484a56)"