iotivity.git
20 months ago[IOT-2827] Fix For OCProvisionACL Bug 29/22929/2
imtiaz.h [Fri, 20 Oct 2017 06:00:00 +0000 (12:00 +0600)]
[IOT-2827] Fix For OCProvisionACL Bug

1. for selectedDeviceInfo = NULL api returns OC_STACK_INVALID_PARAM

Change-Id: Idb316438a76d70fcc7a91a2e119aadd0c771bde7
Signed-off-by: imtiaz.h <imtiaz.h@samsung.com>
20 months ago[IOT-2833]Sync java ESResult with C++ one. 65/22965/1 1.3.1-RC4
Harry [Mon, 23 Oct 2017 12:23:03 +0000 (17:53 +0530)]
[IOT-2833]Sync java ESResult with C++ one.

Java ESResult is not in sync with C++ SDK ESResult
enum values.

Change-Id: I0ab0e1ba88858fc8c511a56d046d40c1708760cd
Signed-off-by: Harry <h.marappa@samsung.com>
20 months ago[IOT-2806] patch 22855 overwritten mistakenly 49/22949/3
Nathan Heldt-Sheller [Fri, 20 Oct 2017 23:54:15 +0000 (16:54 -0700)]
[IOT-2806] patch 22855 overwritten mistakenly

A recent patch over-wrote the fix to 2806 (patch 22855)
so this is just a re-creation of 22855.  However gerrit
can't figure out how to re-apply 22855, and I don't know how to
force it, so I'm just creating a new patch.

Change-Id: I5c4b67a3cdfa1f9a4368fc8f7b24203da1644524
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
20 months agoIOT-2539 clean unused-result warnings 23/22923/3
George Nash [Thu, 19 Oct 2017 20:35:05 +0000 (13:35 -0700)]
IOT-2539 clean unused-result warnings

the -Werror=unused-result is due to not checking the return
value when using scanf. This error is specific to certan
versions of the compiler and may not occure on all systems.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ifcaa05f7f7df69da84bd3a514ad3f29a63955b02
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoSync CACloneResponseInfo with CAResponseResult_t. 81/22881/2
Todd Malsbary [Tue, 17 Oct 2017 21:21:50 +0000 (14:21 -0700)]
Sync CACloneResponseInfo with CAResponseResult_t.

Bug: https://jira.iotivity.org/browse/IOT-2819
Change-Id: I43631fe750b529b6e90dd625c160717c854a2100
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
20 months agoresource: Enable OCRepresentationSubscript test 25/21825/11
Ziran Sun [Tue, 23 Aug 2016 15:05:50 +0000 (16:05 +0100)]
resource: Enable OCRepresentationSubscript test

Retest OCRepresentationSubscript.Boolean unit test.

Change-Id: Ibe291d4b0f6371235ba7397b186a87ef8939beab
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10811
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit fa632fb35a6670da9ffd4cdfd1bc2da5592cd629)

20 months agoIOT-2539 Fix warnings in routing code 35/22935/2
George Nash [Fri, 20 Oct 2017 20:04:01 +0000 (13:04 -0700)]
IOT-2539 Fix warnings in routing code

Fixed -Werror=unused-const-variable= found in
routingtablemanager.c the USECS_PER_SEC was not
used anywhere and was removed.

Fixed -Werror=format= found in routingmanager.c
current time is a uint64 from inttypes.h
%llu is long long unsigned.

C99 spec suggests the type long long int should
be at least 64 bits but may be more.  On some
platfroms it might be 128-bits. In printf %lld
could be interpreted as 64-bits or 128-bits which
could result in undefined behavior.

The PRIu64 macro from inttypes will always be interpreted
as 64-bits by printf.

Change-Id: Iaf45d5a8382c4af8f3db973700db1d90b4472cc1
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoIOT-2539 clean unused-function in caleadapter.c 33/22933/1
George Nash [Fri, 20 Oct 2017 19:46:07 +0000 (12:46 -0700)]
IOT-2539 clean unused-function in caleadapter.c

The static functions:
  CAInitLEServerQueue
  CAInitLEServerReceiverQueue
  CAInitLEServerSenderQueue
  CALEServerDataReceiverHandler
  CALEServerSendDataThread

Are all only called if both ROUTING_GATWAY and
SINGLE_THREAD are not defined. When the are not
called gcc will produce the -Werror=unused-function
warning.

Rather than spatering the macros all over the file
I moved all of the functions into a single block

The code in the functions are not modified.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ic15e4e91028b87fb8d2680f2e64c724d1fae25cc
Signed-off-by: George Nash <george.nash@intel.com>
20 months ago[IOT-2821] implicit access for DOXS, AMS and CMS 21/22921/4
Nathan Heldt-Sheller [Thu, 19 Oct 2017 20:23:07 +0000 (13:23 -0700)]
[IOT-2821] implicit access for DOXS, AMS and CMS

There are a few cases of missing implicit access that are
added by this patch:
1) DOXS has access to all SVRs
2) AMS and CMS have access to /pstat

Change-Id: I7eebc86c88b392dc2a6447c64f3a216afee70b19
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
20 months agoRelocate rd-mode-dependent functions in .def files 05/21505/8
Gabriel Schulhof [Tue, 11 Jul 2017 20:52:25 +0000 (23:52 +0300)]
Relocate rd-mode-dependent functions in .def files

OCBindResourceInsToResource and OCGetResourceIns are only defined if
RD_MODE is either "client" or "server", but not if it is "none". Thus,
octbstack_product.def must not include those functions.

Bug: https://jira.iotivity.org/browse/IOT-2500
Change-Id: I88bbf033006e82d1655d39d7f3127a1e40a1d4e7
Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21395
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit f4fb7430a9b9a6601b80634d96b8a08fed42802b)

20 months agoIOT-2539 clean unused-function in caleadapter.c 83/22883/4
George Nash [Tue, 17 Oct 2017 21:25:20 +0000 (14:25 -0700)]
IOT-2539 clean unused-function in caleadapter.c

The CAInitLEServerQueues functions was moved
moved within the ifndef SINGLE_THREAD macros
since that is the only time the function is
used.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ic942b096eb5bffd2ac17b613afebbfa947a158b7
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoFix typo causing build break for TARBZ 25/22925/2
Dan Mihai [Thu, 19 Oct 2017 20:39:48 +0000 (13:39 -0700)]
Fix typo causing build break for TARBZ

Change-Id: I91e0210a03683041600ff26e3fd09b5bde19123d
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
20 months ago[IOT-2726][IOT-2107] doxm POST handler fix 19/22619/19
Oleksandr Dmytrenko [Wed, 27 Sep 2017 11:59:06 +0000 (14:59 +0300)]
[IOT-2726][IOT-2107] doxm POST handler fix

Fixed doxm POST handler modifies values without request from OBT

Change-Id: I4631063002ebf830160b772f55c9a9f139b78dbc
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
20 months agoIOT-2539 clean unused-function in credresource.c 79/22879/3
George Nash [Tue, 17 Oct 2017 21:14:53 +0000 (14:14 -0700)]
IOT-2539 clean unused-function in credresource.c

When built with build option SECURED=0 some functions
are no longer used due to preprocessor macros.

The functions WithinBounds and IsEmptyCred were moved
within the
if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
macro

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I9c0e3fa57dee5531bd9661216f2b5160fb002f33
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoIOT-2443 Fix simpleserver acls for non-secure 15/22915/2
George Nash [Wed, 18 Oct 2017 22:47:29 +0000 (15:47 -0700)]
IOT-2443 Fix simpleserver acls for non-secure

Fix the simplerserver acls so the non-secure run
option will also work as well as the secure option.

Bug: https://jira.iotivity.org/browse/IOT-2443
Change-Id: I27b8aaf3db0ece5ad08a16d451cecb26fe8cd3a7
Signed-off-by: George Nash <george.nash@intel.com>
20 months ago[IOT-2820] make /pstat.dos.p read-only 95/22895/3
Nathan Heldt-Sheller [Wed, 18 Oct 2017 05:59:59 +0000 (22:59 -0700)]
[IOT-2820] make /pstat.dos.p read-only

The Parameter "p" in the /pstat "dos" Property is meant
to be read-only in every Device Onboarding State.  This
fixes the Update handler to treat "p" as read-only.  It
also fixes the pstat->CBOR marshaling code to provide the
option to omit "p". And it updates the provisioningclient
code to omit "p" from Updates to /pstat.

Change-Id: I25a92bd33e5476d7d5896021e42102762deb6c31
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
20 months agoWindows: Avoid using NULL event handle 05/22905/2
Dan Mihai [Wed, 18 Oct 2017 15:36:50 +0000 (08:36 -0700)]
Windows: Avoid using NULL event handle

Avoid using NULL event handle during catests.

Change-Id: I7e7d2ef95e8141082f7694735f20a77d773b42b4
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
20 months agoIOT-2539 Fix -Wmissing-field-initializers 91/22891/2
George Nash [Tue, 17 Oct 2017 22:57:15 +0000 (15:57 -0700)]
IOT-2539 Fix -Wmissing-field-initializers

Fix the missing-field-initializers warning in the
simulator code. OCDeviceInfo contains four
values not two.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ifab39f7a5eb054eeb301cece2123e9cc6d19011c
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoresource-directory: free unusued endpoints 69/22069/10
Philippe Coval [Tue, 22 Aug 2017 08:56:42 +0000 (10:56 +0200)]
resource-directory: free unusued endpoints

Fix ~2Kb MLK in rd_client.c:

  2,208 bytes in 1 blocks are definitely lost in loss record 1,056 of 1,061

  oic_malloc.c:102: OICCalloc
  cainterfacecontroller.c:643: CAGetNetworkInfo
  canetworkconfigurator.c:297: CAGetNetworkInformationInternal
  caconnectivitymanager.c:298: CAGetNetworkInformation
  rd_client.c:266: RDPublishPayloadCreate
  rd_client.c:383: OCRDPublishWithDeviceId
  rd_client.c:139: OCRDPublish
  rdtests.cpp:253: RDTests_RDPublishMultipleResources_Test::TestBody()

It was detected in:
https://gerrit.iotivity.org/gerrit/#/c/22005/

Bug: https://jira.iotivity.org/browse/IOT-1684
Change-Id: I5c59f998a5b1f616fbcde27d3a215694c5bd0422
Origin: https://gerrit.iotivity.org/gerrit/#/c/22051/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22051
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 3a7fb5418f8276d80bf8d83ba2db1c0dd6cfb665)

20 months agoDelete client callback with OCCancel. 93/22093/7
Jaehong Jo [Tue, 23 May 2017 05:44:50 +0000 (14:44 +0900)]
Delete client callback with OCCancel.

Change-Id: I3bde95b535fcbfd3290a7b9ae0610c3e9333be7a
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20299
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 94429e77972ccabbbaed53a850d4de27fa56de9c)

20 months agoIOT-2539 Clean -Wunused-parameter simulator 89/22889/2
George Nash [Tue, 17 Oct 2017 22:22:54 +0000 (15:22 -0700)]
IOT-2539 Clean -Wunused-parameter simulator

Remove the unused-parameter warning from the simulator code

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Id1c3757e41443ae53126ac1ef1117e387f564327
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoIOT-2539 Fix -Wswitch simulator 93/22893/2
George Nash [Tue, 17 Oct 2017 23:20:04 +0000 (16:20 -0700)]
IOT-2539 Fix -Wswitch simulator

Fixed the switch warning in the simulator code.

In the request_model_builder the other posible values
for the switch are not expected if they occure print
an error and exit assert. Just in case it is a release
build an empty string is returned.

In simulatory_utils the un-handled case statments were
added to the switch.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Iebb79bd22410727c65c33ed73ec8704a1b8a33a4
Signed-off-by: George Nash <george.nash@intel.com>
20 months ago[IOT-2789]Fix for NS sample crash 99/22899/3
abitha.s [Wed, 18 Oct 2017 09:02:47 +0000 (14:32 +0530)]
[IOT-2789]Fix for NS sample crash

Change-Id: I4aa2f68b36b70946c0bcee0e9da04feef596ea85
Signed-off-by: abitha.s <abitha.s@samsung.com>
20 months agocsdk: Update OCByteStringCopy documentation 79/22779/2
Philippe Coval [Mon, 2 Oct 2017 16:20:56 +0000 (18:20 +0200)]
csdk: Update OCByteStringCopy documentation

Bug: https://jira.iotivity.org/browse/IOT-2450
Change-Id: Ie747f5512d12f782a3331c8eaf00984a63605b85
Origin: https://gerrit.iotivity.org/gerrit/#/c/22695/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months agoresource-container: Enable -Wnoexcept for g++ only 61/22061/5
Philippe Coval [Thu, 20 Jul 2017 12:10:12 +0000 (14:10 +0200)]
resource-container: Enable -Wnoexcept for g++ only

As not supported on clang-3.5

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I7bb4f53a0a0e2eba56e670f87ac163a211173fb6
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21561
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 99bfbb05a96d13baf3df4bf19cfde58eef87aefe)

20 months agoresource-encapsulation: boost as lib header 19/21819/15
Philippe Coval [Wed, 17 May 2017 14:26:23 +0000 (16:26 +0200)]
resource-encapsulation: boost as lib header

This change is harmless and done to test build process

Bug: https://jira.iotivity.org/browse/IOT-2279
Change-Id: Ia8889790f19d6e02a0fc5c2d857ac19e717e2ec4
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19987
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
(cherry picked from commit 68649b7a1709bb25ffe8cba4779d92bdeee9a7ae)

20 months agoresource-encapsulation: Workaround test for clang 57/22657/2
Philippe Coval [Thu, 30 Mar 2017 12:30:19 +0000 (14:30 +0200)]
resource-encapsulation: Workaround test for clang

Bypass the part which is crashing clang-3.5, and use reference

Change-Id: I8578509cb642be5d8dbaf1d5fbcdd944377b0fc8
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
20 months ago[IOT-2810][IS]Static analysis coding style issues 03/22903/4
Harry [Wed, 18 Oct 2017 15:28:46 +0000 (20:58 +0530)]
[IOT-2810][IS]Static analysis coding style issues

Changes are mostly related to indentation, adding curly
braces to single line conditional blocks.

Change-Id: I4fcade68805dc3c1a6970a34683e519708a609f7
Signed-off-by: Harry <h.marappa@samsung.com>
20 months ago[IOT-2810][ES]Static analysis coding style issues 67/22867/3
Harry [Tue, 17 Oct 2017 12:53:19 +0000 (18:23 +0530)]
[IOT-2810][ES]Static analysis coding style issues

Changes are mostly related to indentation, catching
exception by reference-to-const.

Change-Id: I3aa27b58f507551ed2ed677c4b2c89b151b87bf3
Signed-off-by: Harry <h.marappa@samsung.com>
20 months agoEnable just the appropriate OTM 75/22875/2
Dan Mihai [Tue, 17 Oct 2017 18:30:30 +0000 (11:30 -0700)]
Enable just the appropriate OTM

Don't enable Just Works for the Random PIN sample, etc.

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

20 months agoIOT-2824 Remove doxygen warnings 13/22913/1
George Nash [Wed, 18 Oct 2017 21:12:18 +0000 (14:12 -0700)]
IOT-2824 Remove doxygen warnings

Remove doxygen warnings reproted from pkix_interface.h

Bug: https://jira.iotivity.org/browse/IOT-2824
Change-Id: I6640a1fc4037e34fd3fbb60d5c737d1f111c4548
Signed-off-by: George Nash <george.nash@intel.com>
20 months agoIOT-2539 Fix format warning 73/22873/2
George Nash [Tue, 17 Oct 2017 17:38:16 +0000 (10:38 -0700)]
IOT-2539 Fix format warning

C99 spec suggests the type long long int should
be at least 64 bits but may be more.  On some
platfroms it might be 128-bits. In printf %lld
could be interpreted as 64-bits or 128-bits

To fix this the PRId64 macro from inttypes can
be used.

Bug: https://jira.iotivity.org/browse/IOT-2539
Bug: https://jira.iotivity.org/browse/IOT-2817
Change-Id: Ie25ea50630f97b4dde866d8042af1567b18522d9
Signed-off-by: George Nash <george.nash@intel.com>
21 months agoEnable self link in collections 47/22747/8
Abhishek Pandey [Thu, 12 Oct 2017 13:18:40 +0000 (18:48 +0530)]
Enable self link in collections

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

- Enabled support for self link in collections.
- API OCLinksPayloadArrayCreate() modified to allow self links.
- New parameter (bool) in the API now allows to have a self link with
  "rel":["self", "item"], in links array as per OCF Core Spec.

Change-Id: I1f2e02dd33c993dc4b28fbc447b8d286c1f7f804
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
21 months ago[EasySetup] Fix links in baseline & ll response 29/22629/10
Ankur Bansal [Thu, 14 Sep 2017 05:35:10 +0000 (11:05 +0530)]
[EasySetup] Fix links in baseline & ll response

Update oic.r.easysetup baseline and link list response to correctly fill
links property.
Use OCLinksPayloadArrayCreate API to create the links payload for batch
& link list interface. OCLinksPayloadArrayCreate API internally takes
care of creating the most part of payload based on the properties of the
resource. This will replace the logic of creating each property of links
payload for each of the easy setup resources from the code.
In link list interface response, add handling for both OCF & OIC
response (for backward compatibility).

Bug:https://jira.iotivity.org/browse/IOT-2711

Change-Id: I46ca2e2d635cb78e8c7fc7c5ef95d9e16327abb9
Signed-off-by: Ankur Bansal <ankur.b1@samsung.com>
(cherry picked from commit 787a73bd227c69e313145ec978ee96769fa31112)

21 months ago[IOT-2710][IOT-2806] fix /pstat Update handler 55/22855/3
Nathan Heldt-Sheller [Tue, 17 Oct 2017 03:34:26 +0000 (20:34 -0700)]
[IOT-2710][IOT-2806] fix /pstat Update handler

The way CBOR->/pstat binary is written, the Properties in the
current gPstat are added to the binary representation even if
the CBOR payload doesn't contain that Property. This may be ok
in most cases since it means that (if a Property is omitted)
the gPstat value won't be changed from whatever it is.
But this also means that if /pstat.dos.s is Updated,
the /pstat.dos.s Property Update must be done after all other
Properties, so that if a /pstat.dos.s update changes other
/pstat Properties, the new values aren't subsequently overwritten.

Change-Id: I07369355ec3141c40b5178cae41ba02e5e7813fc
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
21 months agofix logging incorrectly labeled ERROR 57/22857/2
Nathan Heldt-Sheller [Tue, 17 Oct 2017 05:06:25 +0000 (22:06 -0700)]
fix logging incorrectly labeled ERROR

Fix a few log messages that are incorrectly logged as ERROR type.

Change-Id: I417b148840fbc6c6df641b0101fdfc3233f8b511
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
21 months agoChange OCGetContentFormat into public API 75/21675/4
uzchoi [Mon, 31 Jul 2017 07:45:08 +0000 (16:45 +0900)]
Change OCGetContentFormat into public API

OCIsOCFConentFormat API was internal API to provide bool return
according to media content format(cbor, vnd.ocf+cbor).
However, it can be used to app developer when they handle the
collection resource request with linked-list interface due to
backward compatibility requirement.
This change make the bool return into type enum value on
OCPayloadFormat and Accept version.
Corresponding code is also changed.

Change-Id: I6c780d9ad9e4b68da4b5d431ff294931bcde787e
Signed-off-by: uzchoi <uzchoi@samsung.com>
21 months agoIOT-2539 Targeted ignore of type-limits warning 33/22833/5
George Nash [Fri, 13 Oct 2017 20:03:39 +0000 (13:03 -0700)]
IOT-2539 Targeted ignore of type-limits warning

This will turn of the type-limits warning in very
targeted area in the code. The code is checking
that the user passed in value is within limits.

Although it is very unlikely to be outsite the
expected values it is possible. Tthis selectivly
shuts off the warning for the two functions the
warning is found in.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Id5da64534c05dffd479d911112d5569305c36d48
Signed-off-by: George Nash <george.nash@intel.com>
21 months ago[IOT-2786] ignore wrong ACE version in ACL 21/22721/2
Nathan Heldt-Sheller [Fri, 6 Oct 2017 20:59:16 +0000 (13:59 -0700)]
[IOT-2786] ignore wrong ACE version in ACL

The current parsing code will accept a v1 ACE in a V2 /acl payload
and vice versa.  It should at least ignore and skip the wrong-version
ACE.

Change-Id: I9cb3fc84671afe25a730484e4fb2904a0d3c5c95
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
21 months ago[IOT-2806] improve pstat->tm logging 13/22813/2
Nathan Heldt-Sheller [Fri, 13 Oct 2017 01:43:35 +0000 (18:43 -0700)]
[IOT-2806] improve pstat->tm logging

Please cherry-pick this patch and re-run TC.

Change-Id: Ic4cfd419bc11c76545e9e385993f4ae71c4bd52e
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
21 months ago[IOT-2746][IS] Static analysis warning fix. 23/22823/2
Harry [Fri, 13 Oct 2017 14:31:20 +0000 (20:01 +0530)]
[IOT-2746][IS] Static analysis warning fix.

Fixed all the static analyzer reported issues in
Simulator native code.

Change-Id: I04c6008c36bb5880bfabee9753433804d43a46bf
Signed-off-by: Harry <h.marappa@samsung.com>
21 months agoIOT-2539 Fix return-type warning 49/22849/2
George Nash [Mon, 16 Oct 2017 17:16:16 +0000 (10:16 -0700)]
IOT-2539 Fix return-type warning

This fixes moved the return value out of the if statment so
the result of the operation will be returned even if
ehRequest->query is null.

Bug: https://jira.iotivity.org/browse/IOT-2539
Bug: https://jira.iotivity.org/browse/IOT-2714
Change-Id: I018776e8800aa51ed9a49a55554949fb869b9495
Signed-off-by: George Nash <george.nash@intel.com>
21 months agoIOT-2539 Remove conversion-null warnings 35/22835/2
George Nash [Fri, 13 Oct 2017 20:40:28 +0000 (13:40 -0700)]
IOT-2539 Remove conversion-null warnings

For some reason using EXPECT_EQ or ASSERT_EQ
converts boolean values to char* which results in
the conversion-null warnings.

Places where EXPECT_EQ or ASSERT_EQ were using a
boolean result for the value was replaced with
ASSERT_TRUE, ASSERT_FALSE, EXPECT_TRUE or
EXPECT_FALSE as needed.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I9604b6a7f64545e468430cfdb597eaf18e444580
Signed-off-by: George Nash <george.nash@intel.com>
21 months ago[IOT-2745] Static Analysis fix. 21/22821/2
Jay Sharma [Fri, 13 Oct 2017 12:01:28 +0000 (17:31 +0530)]
[IOT-2745] Static Analysis fix.

Java static analysis fix for resource-encapsulation:.
1. Updated exception handling for logging.
2. Updated sample applications and unit test cases.

Bug: https://jira.iotivity.org/browse/IOT-2745
Change-Id: I1aeb1b8b2b3338515cbc9733ef8fa032fd6f068e
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
21 months ago[IOT-2745][Simulator] Static Analysis issues fix. 25/22825/2
Senthil Kumar G S [Fri, 13 Oct 2017 14:37:53 +0000 (20:07 +0530)]
[IOT-2745][Simulator] Static Analysis issues fix.

1. Added log in exception catch blocks.
2. Merged conditional blocks and removed unnecessary conditions.
3. Incorporated proper usage of access specifiers such as final and static.

Change-Id: I78be7b865a30c1f8e746ed62213fb576d11505f8
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
21 months ago[IOT-2745]Static Analysis fixes for Java NS. 17/22817/3
abitha.s [Fri, 13 Oct 2017 09:18:13 +0000 (14:48 +0530)]
[IOT-2745]Static Analysis  fixes for Java NS.

Change-Id: Ibb2a3e429702a0968a9aacc9ccce2c962a8db36b
Signed-off-by: abitha.s <abitha.s@samsung.com>
21 months ago[IOT-2808]Static Analysis warning fixes for NS. 15/22815/6
abitha.s [Fri, 13 Oct 2017 05:40:32 +0000 (11:10 +0530)]
[IOT-2808]Static Analysis warning fixes for NS.

1. Indentation fixes.
2. Uninitialized variable fixes

Change-Id: Iea41f46fcd1540cf8ef3985a030fa7b07e399681
Signed-off-by: abitha.s <abitha.s@samsung.com>
21 months ago[IOT-2808]Static Analysis warning fixes for SM. 99/22799/2
abitha.s [Thu, 12 Oct 2017 10:43:48 +0000 (16:13 +0530)]
[IOT-2808]Static Analysis warning fixes for SM.

1. Indentation fixes.
2. Uninitialized variable fixes

Change-Id: Icfeb1b998be90411e6f1c16d37f79ef0a47f699c
Signed-off-by: abitha.s <abitha.s@samsung.com>
21 months agoIOT-2539 Cleanup -Wformat= warnings 07/22807/2
George Nash [Mon, 7 Aug 2017 20:40:28 +0000 (13:40 -0700)]
IOT-2539 Cleanup -Wformat= warnings

The -Wformat= warning is given when the conversion specifier
in a printf or scanf command does not match the value actually
passed in.

In this commit all of the issues are found in LOG functions.
If type passed in was a variable size parameter like a pointer or
size_t. The the PRIuPTR value from the inttypes.h
header is used. For ssize_t variables the PRIdPTR was used.

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

21 months ago[IOT-2726] /cred resource rownerid fix 87/22587/8
Aleksey Volkov [Fri, 13 Oct 2017 14:30:33 +0000 (17:30 +0300)]
[IOT-2726] /cred resource rownerid fix

Fixing usage rownerid.

Change-Id: I89f65d4f5ab404d2766fa179c26948439c16a686
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
21 months ago[IOT-2633] Add NULL check for reset profile 45/22845/2
Jongmin Choi [Mon, 16 Oct 2017 07:31:09 +0000 (16:31 +0900)]
[IOT-2633] Add NULL check for reset profile

Add NULL check for reset profile

Change-Id: Ic767c5af6c65dad64f355ab9bbfed8ad054d919b
Signed-off-by: Jongmin Choi <jminl.choi@samsung.com>
21 months agoC++ example for getting server version info. 19/21919/19
Ziran Sun [Tue, 15 Aug 2017 15:03:56 +0000 (16:03 +0100)]
C++ example for getting server version info.

Change-Id: I10eeedfbd1f4ec4231c2611ed8b496997faa13f7
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
21 months agoprovisioning: Close database in tests 99/22099/13
Philippe Coval [Thu, 24 Aug 2017 10:11:29 +0000 (12:11 +0200)]
provisioning: Close database in tests

Bug: https://jira.iotivity.org/browse/IOT-2599
Change-Id: Ie49d06287bc6fb3b0ac75c0271af3861c729d436
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22075
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
(cherry picked from commit 043d580965d448da6d15710cf6b0cc7b4c18e4f8)

21 months ago[IOT-2494] SVR DB Editor : Add doxm edit features 69/22169/4
Sangjoon Je [Wed, 9 Aug 2017 08:23:09 +0000 (17:23 +0900)]
[IOT-2494] SVR DB Editor : Add doxm edit features

Add doxm add, remove, modify
Apply InputUuid allow empty input or zero input from user

New Feature: https://jira.iotivity.org/browse/IOT-2494
Change-Id: I9c5dc06bdbc29c5ba7e0a8e0a6e898e162e7959d
Signed-off-by: Sangjoon Je <sangjoon.je@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21831
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Jongmin Choi <jminl.choi@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 04875c73a33254c4f40cb61cc035583b9671ff63)

21 months ago[IOT-2803] Remove all roles if credid is zero 27/22827/2
Alex Kelley [Fri, 13 Oct 2017 16:59:46 +0000 (09:59 -0700)]
[IOT-2803] Remove all roles if credid is zero

Change-Id: I6905b2c836d61d05b20a47b43c9ce777c2af0f61
Signed-off-by: Alex Kelley <alexke@microsoft.com>
21 months ago[IOT-2746][ES] Static analysis warning fix. 19/22819/2
Harry [Fri, 13 Oct 2017 10:54:11 +0000 (16:24 +0530)]
[IOT-2746][ES] Static analysis warning fix.

Fixed all the static analyzer reported issues in
ES native code.

Change-Id: Ida916ed651fcdf4f02f3549ce987511ca8d5eaa0
Signed-off-by: Harry <h.marappa@samsung.com>
21 months ago[IOT-2811][ES] Fix mediator android app crash. 41/22841/2
Senthil Kumar G S [Sat, 14 Oct 2017 13:11:53 +0000 (18:41 +0530)]
[IOT-2811][ES] Fix mediator android app crash.

Reason for crash:-
OcProvisioning.provisionClose() should be called only
when iotivity stack is built with security. But mediator android
app invoked it without checking whether the stack is built with security.

Change-Id: Ic2af9d649a4dce79d2bfd9daebc2c80b7dfaa2eb
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
21 months agoLet Linux build upstream libcoap again 99/22699/2
Mats Wichmann [Tue, 3 Oct 2017 20:39:24 +0000 (14:39 -0600)]
Let Linux build upstream libcoap again

Cherry pick from master

Two problems:
(1) in a debug build, Linux builds with gcov options. Linux options
(build_common/linux/SConscript) add --coverage to build, -lgcov to link.
However before the two places that do configure checks for functions start
doing so, they clone an environment with LIBS cleared.  Thus when built
in debug mode, all of the links of the generated configure test programs
-lgcov is missing and the binaries don't link, so the tests report
fail. Fix is to add --coverage to link instead, that implies adding the
library at link time, but is not affected by the clearing of the LIBS var.

(2) upstream libcoap was depending on ipv6 features that only are included
if __GNU_SOURCE is defined, change the define from __DEFAULT_SOURCE to
__GNU_SOURCE only for the coap build environment.

This is like Bug IOT-2334 but since that one reports a windows problem
and thus can't be gcov related, it's not a direct linkage.

Change-Id: I5cab20eeeb10ccefe74d403dd204b33b39ed9a26
Signed-off-by: Mats Wichmann <mats@linux.com>
21 months agoIOT-2539 ignore warnings for older compilers 43/22743/11
George Nash [Thu, 27 Jul 2017 01:03:54 +0000 (18:03 -0700)]
IOT-2539 ignore warnings for older compilers

Ignore 'missing-field-initializers' warning  if gcc version
is older than 5.0. This is due to a bug in how older
versions of gcc handles C++11 code.
see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750

Ignore 'missing-braces' waring if gcc version is older
than 5.0 this is also due to a bug in how older versions
of gcc handles C++11 code.
see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25137

This is in preperation to enable the -Werror build flag.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ia098c273bdbcda485fd02d73941207f502ed861a
Signed-off-by: George Nash <george.nash@intel.com>
21 months ago[IOT-2632] Callback to check peer's CN 31/22231/20 1.3.1-RC3
Oleksii Beketov [Thu, 12 Oct 2017 10:33:15 +0000 (13:33 +0300)]
[IOT-2632] Callback to check peer's CN

Added callback to check peer's certificate Common Name field.

Change-Id: Idb316438a76d70fcc7a91a2e119aadd0c771bde6
Signed-off-by: akk0rd <v.riznyk@samsung.com>
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
21 months ago[IOT-2709] MOT fix 21/22621/8
Oleksii Beketov [Thu, 12 Oct 2017 11:19:55 +0000 (14:19 +0300)]
[IOT-2709] MOT fix

sampleserver_randompin and sampleserver_preconfpin MOT fix

Change-Id: Iadb02e4370604c33b8070ea45f2d8a42ecfafae1
https://jira.iotivity.org/browse/IOT-2709
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
21 months ago[IOT-2714][ES] Adding Error Codes as per OCF 1.3. 85/22785/3
Senthil Kumar G S [Fri, 13 Oct 2017 09:29:45 +0000 (14:59 +0530)]
[IOT-2714][ES] Adding Error Codes as per OCF 1.3.

i) Added error codes to represent invalid auth type and enc type.
ii) Added logic to send OC_EH_BAD_REQUEST(400) without payload
if POST request comes to "/WiFiConfResURI" or "/EasySetupResURI"
with invalid auth type or enc type.

Also updated the comments for existing error codes.

Change-Id: I246af9a777f1aba1f18474ded74e38c4a5ed9b2c
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
21 months ago[Easy Setup] Handling POST on batch with null URI 03/22703/4
Abhishek Pandey [Fri, 6 Oct 2017 04:37:05 +0000 (10:07 +0530)]
[Easy Setup] Handling POST on batch with null URI

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

Change-Id: I1e2a1b7d4edb4971be616a2563227e1bc55a80d9
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
21 months agoresource-encapsulation: use OICFree for query 97/22297/4
Philippe Coval [Fri, 25 Aug 2017 08:24:35 +0000 (10:24 +0200)]
resource-encapsulation: use OICFree for query

Track memory allocations using oic_malloc, oic_string.

This will suppress valgrind warning about using delete on C string,
previously, ocEntityHandlerRequest.query was allocated using C strdup,
so free should be used not C++ delete[].

Conflicts:
service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp

Bug: https://jira.iotivity.org/browse/IOT-2267
Origin: https://gerrit.iotivity.org/gerrit/#/c/22129
Change-Id: I86a3a3dfee8492656ee89de5913617369bf1fbb3
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22129
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
21 months agoIOT-2539 Clean unused code warnnings 39/22739/4
George Nash [Mon, 9 Oct 2017 21:48:05 +0000 (14:48 -0700)]
IOT-2539 Clean unused code warnnings

credresource.c:
Removed the [-Wunused-const-variable=] warning
The CRED_EMPTY_ROOT_MAP_SIZE was used in the past but is no longer
referenced anywhere in the code.

provisioningclient.c:
Removed the [-Wunused-const-variable=] warning
The SUPPORTED_PRMS array was used in the past but is no longer
referenced anywhere in the code.

ocserver.cpp
Removed the [-Wunused-variable] warning
Looking at the logs a instance that gDeviceUUID was used could not
be found at any point in time.

stacktest.cpp:
Removed the [-Wunused-variable] warnings
Variables peer, pinNumber, and pmSel were only used in Direct Pairing
related unit tests which were removed as part of IOT-2306.

provisioningclient.cpp:
Removed the [-Wunused-function] warning
The InputPdACL function was only used by the Direct Pairing code
that was removed as part of IOT-2306.

Bug: https://jira.iotivity.org/browse/IOT-2539
Bug: https://jira.iotivity.org/browse/IOT-2306
Change-Id: I80f52619a04ee7eafc83b79b886c1121f61a6ba1
Signed-off-by: George Nash <george.nash@intel.com>
21 months ago[IOT-2806] RESET clears all bits 93/22793/2
Nathan Heldt-Sheller [Thu, 12 Oct 2017 05:32:14 +0000 (22:32 -0700)]
[IOT-2806] RESET clears all bits

The RESET state should clear all the cm and tm bits before
setting the two lsbs (RESET and TAKE_OWNER bits) to 0b01 for
cm and 0b10 for tm.

Change-Id: I2b602153ea806d51bb1367514463ac590d4353db
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
21 months agoCheck for required properties in POST request. 19/22719/3
Todd Malsbary [Fri, 6 Oct 2017 18:11:19 +0000 (11:11 -0700)]
Check for required properties in POST request.

Bug: https://jira.iotivity.org/browse/IOT-2784
Change-Id: I0f7ff269693e50dee3c2ad870febdddcd5c69d8e
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
21 months ago[IOT-2710] improve pstat logging 77/22777/2
Nathan Heldt-Sheller [Wed, 11 Oct 2017 05:25:45 +0000 (22:25 -0700)]
[IOT-2710] improve pstat logging

Help debug issue where CTT Updates /pstat.dos = SRESET and
tm is not being correctly set by IUT.

Change-Id: I2b598b21e3dd30c27b165ff7cdd033727d5b0858
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
21 months ago[IOT-2764] Fix issue in GetObserverUsingId() 99/22599/5
Sushil Yadav [Tue, 26 Sep 2017 05:40:35 +0000 (11:10 +0530)]
[IOT-2764] Fix issue in GetObserverUsingId()

The GetObserverUsingId() function should not assumes that observeId > 0.
For presenceResource the observeId = 0 when it is added as observer in
OCStartPresence() calls AddObserver() for presenceResource.

Bug: https://jira.iotivity.org/browse/IOT-2764
Change-Id: I6dceba0e2e8415c8e9d6b42339f30612b626cb0b
Signed-off-by: Sushil Yadav <sushil.ky@samsung.com>
21 months ago[IOT-2741] Static Analysis warning fixes. 29/22329/7
arya.k [Wed, 6 Sep 2017 05:10:24 +0000 (10:40 +0530)]
[IOT-2741] Static Analysis warning fixes.

Indentation fixes.

Change-Id: I44a6d21a70fba9d8bdb40972c93d78a778c2ee41
Signed-off-by: arya.k <arya.kumar@samsung.com>
21 months ago[IOT-2801] Allow /cred change 89/22789/3
Aleksey Volkov [Wed, 11 Oct 2017 17:10:18 +0000 (20:10 +0300)]
[IOT-2801] Allow /cred change

This patch allows /cred updates originating from internal stack.

Change-Id: If9dec4776770d96f740118b4dc2ef595c9433e8b
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
21 months agorapidjson: Remove patch from copied scriptlet 35/22735/2
Philippe Coval [Thu, 5 Oct 2017 09:43:23 +0000 (11:43 +0200)]
rapidjson: Remove patch from copied scriptlet

Change-Id: I13331bffd125faddcc053b70f4a01d718282d4bb
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit ce6ab8b19d14e570fedf51ac73a37981e7ee4a6e)

21 months agocoap-http-proxy: cast size_t type in test 81/22081/5
Philippe Coval [Thu, 20 Jul 2017 11:17:59 +0000 (13:17 +0200)]
coap-http-proxy: cast size_t type in test

Suppress a warning using clang-3.5

  CoAPHttpUnitTest.cpp:277:60: error: \
  non-constant-expression cannot be narrowed from \
  type 'unsigned long' to 'uint16_t' (aka 'unsigned short') \
  in initializer list [-Wc++11-narrowing]

Change-Id: I8c740970a536a3bbc0d3d6d16cd4fe1dc81df6be
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21563
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit a7468c261b3f59090ad49d09c690be45b94c8f9c)

21 months agoIOT-2539 Clean switch compiler warning 41/22741/4
George Nash [Mon, 9 Oct 2017 22:44:14 +0000 (15:44 -0700)]
IOT-2539 Clean switch compiler warning

Remove the [-Wswitch] warning
OC_STACK_CONTINUE_OPERATION and OC_STACK_SERVICE_UNAVAILABLE
were not in the Swtich in OCException and were added.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Idcd4e325f666a5b38a468f22f598336622cd951f
Signed-off-by: George Nash <george.nash@intel.com>
21 months agoplugins: Avoid unsupported empty structs 59/22059/5
Philippe Coval [Tue, 28 Mar 2017 08:23:26 +0000 (10:23 +0200)]
plugins: Avoid unsupported empty structs

Observed issue on clang-3.5:
  plugins/include/plugintypes.h:52:9: \
  error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]

It might help MSC compiler too

Change-Id: Ib7cea3d37001ba1256478c1895972d519353feb2
Credit-to: Pawel Winogrodzki <pawelwi@microsoft.com>
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18251
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
(cherry picked from commit 9a779130a2e3c7fe21f981646efe6beaaf7ed9f5)

21 months agoFix OTM 15/22715/5
Oleksii Beketov [Fri, 6 Oct 2017 13:13:58 +0000 (16:13 +0300)]
Fix OTM

Set DOS state RF_OTM before OTM start and RF_NOP after finish.

Change-Id: Iafa4315f034cf9e0e09b7d2663131fd26c06ff54
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
21 months agoservice: Removing redundant env configuration 45/21945/7
Pawel Winogrodzki [Tue, 15 Aug 2017 21:40:29 +0000 (14:40 -0700)]
service: Removing redundant env configuration

Moving global environment configuration common for all
platforms into build_common/SConscript and removing repeated
lines from service/*.

Bug: https://jira.iotivity.org/browse/IOT-1583
Change-Id: I9af112e943a9b31792ec40191efc6e248871532b
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
21 months agoIOT-2795 Android context for PlatformConfig 37/22737/2
George Nash [Mon, 9 Oct 2017 18:40:31 +0000 (11:40 -0700)]
IOT-2795 Android context for PlatformConfig

PlatformConfig on android should set context and activity
when the PlatformConfig was added to support introspection
the context and activity were missed due to developing and
testing using generic java code.

Bug: https://jira.iotivity.org/browse/IOT-2795
Bug: https://jira.iotivity.org/browse/IOT-2773
Change-Id: I208bde482977d88d750a2628691be81683f261bd
Signed-off-by: George Nash <george.nash@intel.com>
21 months agoIOT-2796 prevent sprintf writing past array 25/22725/3
George Nash [Fri, 6 Oct 2017 21:46:49 +0000 (14:46 -0700)]
IOT-2796 prevent sprintf writing past array

tmp is not large enough to hold the two characters
appended to it and the terminating null character.

To make room for the terminating null character the
arrays were increased in size by 1.

Bug: https://jira.iotivity.org/browse/IOT-2796
Change-Id: I53683401a581cef89c8d32088b47d87448140ca2
Signed-off-by: George Nash <george.nash@intel.com>
21 months agosecurity: Add tinycbor include path 61/22661/3
Philippe Coval [Fri, 18 Aug 2017 18:27:13 +0000 (20:27 +0200)]
security: Add tinycbor include path

Problem was observed using: scons install
(without scons building step)

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I863f496d9a76ac3b5a7b69476aa76bdee66213ec
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit 510dadf84e7866182136b58ef4e0f43801927f3b)

21 months agomodify repositories for tizen 2.4 mobile 11/21611/7
Youngman [Wed, 19 Jul 2017 05:11:54 +0000 (14:11 +0900)]
modify repositories for tizen 2.4 mobile

currently, 2.4-base repository is for release,
while 2.4-mobile repository is for snapshot.
(mismatch between both repositories)
Both repositories shall be for release.

Change-Id: I94c6eaaba9fba56ca81f56d7973ec4c3f847626a
Signed-off-by: Youngman <yman.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21523
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit d10a6a50ad786e102c08bf36720648f9f404e0ea)

21 months agoTransate OC_EH codes as documented. 27/22327/2
Todd Malsbary [Tue, 5 Sep 2017 19:03:17 +0000 (12:03 -0700)]
Transate OC_EH codes as documented.

The octypes.h header file defines what over-the-air codes should
result from the given OC_EH codes returned by an entity handler.  This
patch makes the code match the documentation.

Bug: https://jira.iotivity.org/browse/IOT-2685
Change-Id: I2a069310aff6557d1e1b11404099befe442bb159
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
21 months agoconnectivity: Check on g_errorHandler pointer 91/22091/8
Veeraj Khokale [Mon, 29 May 2017 11:55:08 +0000 (17:25 +0530)]
connectivity: Check on g_errorHandler pointer

[IOT-2346] Accessing 'g_errorHandler' without NULL check

Add null checks before accessing
g_errorHandler in le adapter.

Change-Id: I9285ca29f91e99eefb0f8db23ccc7e31dca7e702
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20465
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 515372a4f92c7e620c8b246819618f8bfeb04c37)
Bug: https://jira.iotivity.org/browse/IOT-2346

21 months agobridging: Avoid to include unistd.h if unsupported 21/21821/7
Philippe Coval [Mon, 15 May 2017 15:27:03 +0000 (17:27 +0200)]
bridging: Avoid to include unistd.h if unsupported

Change-Id: I4732cfda0a7aea527d4ab012695e476428b3dec1
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21207
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 101a28c3e7644a073c6bd8a7b561ec1ac83a28f9)

21 months agoIOT-2773 Add Introspection to Java 89/22689/3
George Nash [Wed, 4 Oct 2017 23:36:35 +0000 (16:36 -0700)]
IOT-2773 Add Introspection to Java

This adds the ability to register the introspection file
to java applications.

The client_open callback function is miss named as
JniOcSecurity. This should probably be renamed
JniOcPersistantStorage or something similar.

The class was not renamed to avoid causing an
unforseen bug due to name change.

Bug: https://jira.iotivity.org/browse/IOT-2773
Change-Id: Ifd19ee4c4bfa91e6596d64976008b8d471e4f87a
Signed-off-by: George Nash <george.nash@intel.com>
21 months agoignore: Ignore pulled wksxmppxep module 85/22685/2
Philippe Coval [Thu, 17 Aug 2017 11:56:36 +0000 (13:56 +0200)]
ignore: Ignore pulled wksxmppxep module

Bug: https://jira.iotivity.org/browse/IOT-2599
Change-Id: I75a76a4a77af492a04e1e503ec3fb643b6f5ab05
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22149
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
(cherry picked from commit 519bae0918f3c05f72915792a3ab47ab680eabb8)

21 months agoprovisioning: Relocate Valgrind filename to topdir 69/22669/2
Philippe Coval [Tue, 22 Aug 2017 14:01:10 +0000 (16:01 +0200)]
provisioning: Relocate Valgrind filename to topdir

Align file to executable's name.

Note for future it would make sense put them in variant dir
or outdir at least to compare with different configuration.

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: Ia2c3443f44c80136d930e1ffd5600d57a8aadaad
Origin: https://gerrit.iotivity.org/gerrit/#/c/22053/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
21 months ago[IOT-2741] Static analysis warning fixes set-2. 85/22385/8
arya.k [Mon, 18 Sep 2017 04:37:35 +0000 (10:07 +0530)]
[IOT-2741] Static analysis warning fixes set-2.

1. Assign default values
2. Remove constants from decision making statements.
3. Add return by values.
4. Remove duplicate lines.
5. Indentations.

Change-Id: I8b3ba896bf72600bc9ee4fcbdc844506bdabf38f
Signed-off-by: arya.k <arya.kumar@samsung.com>
21 months ago[IOT-1977] Removal of dead code in ocstack 87/22687/2
Harry [Mon, 24 Apr 2017 12:16:29 +0000 (17:46 +0530)]
[IOT-1977] Removal of dead code in ocstack

Change-Id: Iafabb0b25d141bb8486d759d1c96a8046af58968
Signed-off-by: Harry <h.marappa@samsung.com>
21 months agobuild: Support other archs for coverify report 63/22663/2
Philippe Coval [Thu, 7 Sep 2017 17:40:10 +0000 (19:40 +0200)]
build: Support other archs for coverify report

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I36626c2180a0fc5e4ce8b77b22a5f9776aa62ea8
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit 10aefe01381d264cb8c3593b8172dacba547f7aa)

21 months agoIOT-2539 remove parentheses and empty-body warning 15/22615/2
George Nash [Thu, 21 Sep 2017 21:23:18 +0000 (14:23 -0700)]
IOT-2539 remove parentheses and empty-body warning

In this case the if statment was not even needed
and was removed.

Removing the if statment cleaned both the parentheses
and empty-body warning.

Change-Id: Ia06fd44f070a66984a71db85d256dc76e61a9bc8
Signed-off-by: George Nash <george.nash@intel.com>
(cherry picked from commit 7e59508a8a3f90fdfe3a1c4762e9005519f9a4e9)

21 months agoMinor resource leaks in security test for valgrind 51/22451/2
Mats Wichmann [Thu, 7 Sep 2017 14:29:03 +0000 (08:29 -0600)]
Minor resource leaks in security test for valgrind

(this is a cherry pick of a change in master)

These two valgrind reports are quieted (last line of each trace is
the file where the fix was made)

2 bytes in 1 blocks are definitely lost in loss record 1 of 270
   at 0x4C2EB6B: malloc (vg_replace_malloc.c:299)
   by 0x5B3576: OICMalloc (oic_malloc.c:82)
   by 0x5B363B: OICRealloc (oic_malloc.c:113)
   by 0x522520: GetDerCrl (crlresource.c:839)
   by 0x4721E1: CRLResourceTest_GetDerCrl_Test::TestBody() (crlresourcetest.cpp:90)

2,048 bytes in 1 blocks are definitely lost in loss record 268 of 270
   at 0x4C30A1E: calloc (vg_replace_malloc.c:711)
   by 0x5B35EC: OICCalloc (oic_malloc.c:102)
   by 0x4F0245: CredToCBORPayload (credresource.c:695)
   by 0x448AE9: CredResourceTest_CredToCBORPayloadNULL_Test::TestBody() (credentialresource.cpp:221)

Change-Id: I5ecfbc68103a62ec69513edb4cb68bb5d9297392
Signed-off-by: Mats Wichmann <mats@linux.com>
(cherry picked from commit 8f1c432a9ca6074295ab65ddff3a80d44eb6dfae)

21 months ago[IOT-2726] /cred fix for CT1.7.8.11 65/22665/4
Aleksey Volkov [Tue, 3 Oct 2017 10:35:25 +0000 (13:35 +0300)]
[IOT-2726] /cred fix for CT1.7.8.11

This patch fixes `4.00 Bad Request` error on
/oic/sec/cred CON UPDATE request in CT1.7.8.11

This adds an additional check of the incoming credential
subjectid for OwnerPSK generation. Before, credresource
tried to generate owner psk for any subjectid in case if
doxm->owner value already saved, but doxm->owned flag
not yet set in true.
This led to an error at the POST handler return.

Change-Id: If2b683ee417bb058f954734ff0c1b64e145c9a6b
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
21 months ago[IOT-2726] Add pstat.dos check in AddCredential 29/22529/2
Aleksey Volkov [Wed, 20 Sep 2017 13:33:27 +0000 (16:33 +0300)]
[IOT-2726] Add pstat.dos check in AddCredential

This change adds /pstat.dos state check to protect credentials modifications in read-only states.

Change-Id: I9a3402e458db8c5fa62a5a0fa0e08c1dd432ceaf
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
21 months agoMfg crash 35/22535/6
Vadym Riznyk [Wed, 20 Sep 2017 18:02:29 +0000 (21:02 +0300)]
Mfg crash

1. Added generations certificates for mfg
2. deleted compilations warning

Change-Id: Idfca6974f2436a06d2d5d7676b8b11396cf1803b
Signed-off-by: Vadym Riznyk <v.riznyk@samsung.com>
21 months agobuild: Drop pretty option to support older gcovr 03/22403/3
Philippe Coval [Thu, 7 Sep 2017 17:40:21 +0000 (19:40 +0200)]
build: Drop pretty option to support older gcovr

If using gcovr 2.4 (r2774) just use --xml for reporting
on Ubuntu 14.04

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: Ib9c55ff2efcc90105305b3dcf7af8698a8e022a9
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
21 months agoeasy-setup: Removing redundant test configuration 39/21939/6
Pawel Winogrodzki [Tue, 15 Aug 2017 19:15:11 +0000 (12:15 -0700)]
easy-setup: Removing redundant test configuration

Moving global environment configuration common for all
platforms into build_common/SConscript and removing repeated
lines from service/easy-setup/*.

Bug: https://jira.iotivity.org/browse/IOT-1583

Change-Id: I578d7147ca731ec83599a260510fdcbc9b308ddd
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
21 months agogtest: Update path in prep.sh 71/22671/2
Philippe Coval [Tue, 3 Oct 2017 12:22:22 +0000 (14:22 +0200)]
gtest: Update path in prep.sh

It was not updated when it was relocated to new upstream

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: I4b8c2d4e6f398fc5941bff55ac3ab74b376e5e7a
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
21 months ago[IOT-2680] Remove WITH_RA option from code script 93/22393/5
koushik.girijala [Fri, 8 Sep 2017 12:23:20 +0000 (17:53 +0530)]
[IOT-2680] Remove WITH_RA option from code script

as RA related build option is not valid anymore

Change-Id: I9b197b258c575e0f00c443bee5d28c09e1876bb4
Signed-off-by: koushik.girijala <g.koushik@samsung.com>
21 months agoDo not ignore return value of request callback. 97/22597/4
Todd Malsbary [Mon, 25 Sep 2017 21:13:50 +0000 (14:13 -0700)]
Do not ignore return value of request callback.

Bug: https://jira.iotivity.org/browse/IOT-2757
Change-Id: I6a3056db8fce56ac615729de9c8e4747c83446bc
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>