platform/upstream/iotivity.git
6 years agombedtls: Update to mbedtls-2.4.2 sandbox/pcoval/on/next/tizen
Philippe Coval [Fri, 23 Jun 2017 09:08:18 +0000 (11:08 +0200)]
mbedtls: Update to mbedtls-2.4.2

Change-Id: If9ab557027cefcd0c255778bb7a69d549b45106a
Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Origin: https://github.com/tizenteam/iotivity
Forewarded: https://gerrit.iotivity.org/gerrit/#/c/14677/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agorapidjson: Import 1.0.2
Philippe Coval [Fri, 24 Feb 2017 20:48:50 +0000 (21:48 +0100)]
rapidjson: Import 1.0.2

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: Ia3ba542040218839fd5625e4a4f1ea73de3d1856
Origin: https://github.com/tizenteam/iotivity
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/14677/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agombedtls: Update to mbedtls-2.4.0
Philippe Coval [Tue, 22 Nov 2016 10:21:52 +0000 (11:21 +0100)]
mbedtls: Update to mbedtls-2.4.0

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: I29c0d7c6b0d1bb50b82e9bcbeba38cfe1daa9857
Origin: https://review.tizen.org/gerrit/#/c/102815/
Forewarded: https://gerrit.iotivity.org/gerrit/#/c/14677/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agombedtls: Import mbedtls-2.3.0
Philippe Coval [Thu, 1 Sep 2016 19:51:02 +0000 (21:51 +0200)]
mbedtls: Import mbedtls-2.3.0

It is strongly recommended to rely on scons instead,
 if not possible, this change workaround this.

For more details about building IoTivity please check:

https://wiki.iotivity.org/build

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: I97e8f34408dde1c95bd0587cb74834df966d2463
Origin: https://review.tizen.org/gerrit/#/c/102814/
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/12423/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agotinycbor: Update import to v0.4
Philippe Coval [Thu, 17 Nov 2016 10:21:00 +0000 (11:21 +0100)]
tinycbor: Update import to v0.4

git "module" was converted to patch this way:

  git clone https://github.com/01org/tinycbor.git -b v0.4 extlibs/tinycbor/tinycbor
  rm -rf extlibs/tinycbor/tinycbor/.git
  git add -f  extlibs/tinycbor/tinycbor/
  git commit -sm 'tinycbor: Update import to v0.4' extlibs/tinycbor/tinycbor/

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: I5492732be93e2b0fdf5e1c3eabcdc949b420e4fb
Origin: https://review.tizen.org/gerrit/#/c/102813/
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/14679/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agotinycbor: Update to v0.3.2
Philippe Coval [Thu, 1 Sep 2016 15:11:20 +0000 (17:11 +0200)]
tinycbor: Update to v0.3.2

Needed for IoTivity 1.2.0 and later

It is strongly recommended to rely on scons instead,
 if not possible, this change workaround this.

For more details about building IoTivity please check:

https://wiki.iotivity.org/build

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: I9b33b8dd7a97b48b6fd3157b1ef25dadb79f11e2
Origin: https://review.tizen.org/gerrit/#/c/102812/
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/21185/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agotinycbor: Import v0.2.1
Philippe Coval [Thu, 1 Sep 2016 10:04:08 +0000 (12:04 +0200)]
tinycbor: Import v0.2.1

Needed for Iotivity-1.1.1 and lower

It is strongly recommended to rely on scons instead,
 if not possible, this change workaround this.

For more details about building IoTivity please check:

https://wiki.iotivity.org/build

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Change-Id: I0a622b8c7c47cfc4ea7afd8a3cf82720a50618bd
Origin: https://review.tizen.org/gerrit/#/c/102811/
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/12703/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agohippomocks: Import v5.0
Philippe Coval [Wed, 19 Apr 2017 12:14:21 +0000 (14:14 +0200)]
hippomocks: Import v5.0

Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Origin: https://github.com/tizenteam/iotivity
Change-Id: Ia2dad37ba2ccd7df3dadd7b2cebaccd22bb90666
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/19457/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agogtest: Import googletest-release-1.7.0
Philippe Coval [Fri, 10 Mar 2017 17:27:03 +0000 (18:27 +0100)]
gtest: Import googletest-release-1.7.0

Change-Id: Ide6d88f6247c654347c539e4a594465f9e0994d3
Bug: https://jira.iotivity.org/browse/IOT-820
Bug-Tizen: https://bugs.tizen.org/jira/browse/TINF-861
Origin: https://github.com/tizenteam/iotivity
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/21183/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agotizen: Enable TCP
Philippe Coval [Tue, 4 Oct 2016 08:37:48 +0000 (10:37 +0200)]
tizen: Enable TCP

Change-Id: I56b8abcea1a3397f546ef0b8edc42711ff62b9d8
Origin: https://review.tizen.org/gerrit/#/c/102818/
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/14655/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agotizen: Ship more security headers if enabled
Philippe Coval [Thu, 14 Jul 2016 22:45:28 +0000 (07:45 +0900)]
tizen: Ship more security headers if enabled

[youngman]
- Add header files related to security

[Philippe Coval]
- If built with security on, ships all headers or none
- To be used by iotcon
- Only ship them if usable (with security flag on)

Change-Id: I9c8edccddec5626119cb3adb39959437ab350413
Signed-off-by: youngman <yman.jung@samsung.com>
Credit-to: youngman <yman.jung@samsung.com>
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/21037/
Origin: https://review.tizen.org/gerrit/#/c/80131/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years ago[IOT-2632] Callback to check peer's CN
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>
6 years ago[IOT-2709] MOT fix
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>
6 years ago[IOT-2714][ES] Adding Error Codes as per OCF 1.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>
6 years ago[Easy Setup] Handling POST on batch with null URI
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>
6 years agoresource-encapsulation: use OICFree for query
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>
6 years agoIOT-2539 Clean unused code warnnings
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>
6 years ago[IOT-2806] RESET clears all bits
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>
6 years agoCheck for required properties in POST request.
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>
6 years ago[IOT-2710] improve pstat logging
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>
6 years ago[IOT-2764] Fix issue in GetObserverUsingId()
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>
6 years ago[IOT-2741] Static Analysis warning fixes.
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>
6 years ago[IOT-2801] Allow /cred change
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>
6 years agorapidjson: Remove patch from copied scriptlet
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)

6 years agocoap-http-proxy: cast size_t type in test
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)

6 years agoIOT-2539 Clean switch compiler warning
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>
6 years agoplugins: Avoid unsupported empty structs
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)

6 years agoFix OTM
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>
6 years agoservice: Removing redundant env configuration
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>
6 years agoIOT-2795 Android context for PlatformConfig
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>
6 years agoIOT-2796 prevent sprintf writing past array
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>
6 years agosecurity: Add tinycbor include path
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)

6 years agomodify repositories for tizen 2.4 mobile
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)

6 years agoTransate OC_EH codes as documented.
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>
6 years agoconnectivity: Check on g_errorHandler pointer
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

6 years agobridging: Avoid to include unistd.h if unsupported
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)

6 years agoIOT-2773 Add Introspection to Java
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>
6 years agoignore: Ignore pulled wksxmppxep module
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)

6 years agoprovisioning: Relocate Valgrind filename to topdir
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>
6 years ago[IOT-2741] Static analysis warning fixes set-2.
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>
6 years ago[IOT-1977] Removal of dead code in ocstack
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>
6 years agobuild: Support other archs for coverify report
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)

6 years agoIOT-2539 remove parentheses and empty-body warning
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)

6 years agoMinor resource leaks in security test for valgrind
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)

6 years ago[IOT-2726] /cred fix for CT1.7.8.11
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>
6 years ago[IOT-2726] Add pstat.dos check in AddCredential
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>
6 years agoMfg crash
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>
6 years agobuild: Drop pretty option to support older gcovr
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>
6 years agoeasy-setup: Removing redundant test configuration
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>
6 years agogtest: Update path in prep.sh
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>
6 years ago[IOT-2680] Remove WITH_RA option from code script
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>
6 years agoDo not ignore return value of request callback.
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>
6 years agoIOT-2618 remove href prop in introspection res
Srikrishna Gurugubelli [Thu, 14 Sep 2017 18:10:44 +0000 (11:10 -0700)]
IOT-2618 remove href prop in introspection res

Also made rt and if properties conditional based on whether the query
interface was baseline or not.

Signed-off-by: Srikrishna Gurugubelli <srikguru@microsoft.com>
Change-Id: I620d422ebc4442a34fa9de8623221de6f341a342
Bug: https://jira.iotivity.org/browse/IOT-2618

6 years agoRe-enable 32-bit builds on linux
Mats Wichmann [Mon, 25 Sep 2017 14:25:16 +0000 (08:25 -0600)]
Re-enable 32-bit builds on linux

During various rework of build scripts, a trick which let
32-bit linux builds proceed was lost.  The build wants to
call the 32-bit x86 build 'x86', but Python's platform.machine()
returns a more specific value (as obtained from the operating
system): 'i586' or 'i686'.

Fix from Geoffroy VanCutsem remaps the calculation of a default
value for TARGET_ARCH from platform.machine() to 'x86'.

Also taught {resource,service}/third_party_libs.scons that
in this scenario, cross building is not taking place.

Note this scenario is not built by Jenkins, so will depend
on affected developers affirming this works.

Bug: https://jira.iotivity.org/browse/IOT-2755
Change-Id: Ieb77a8734a9d17091c396fc8f1bc90e1a3bedb16
Signed-off-by: Mats Wichmann <mats@linux.com>
6 years ago[IOT-2483, 2529] Incorrect IPv6 addr in endpoints
Veeraj Khokale [Tue, 19 Sep 2017 05:59:14 +0000 (11:29 +0530)]
[IOT-2483, 2529] Incorrect IPv6 addr in endpoints

As per RFC 6874, the zone id of the ipv6 address
in a URI should be preceded by %25 and not just %.
Make this change while creating the ipv6 endpoint
payload.

Change-Id: I2e3ec53b16212d374c7ab2ecf6bfd5700c4e62ce
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
6 years ago[IOT-IOT-2739] Simulator plugin crash
Harry [Mon, 25 Sep 2017 07:06:30 +0000 (12:36 +0530)]
[IOT-IOT-2739] Simulator plugin crash

Simulator server plugin crashed due to heap corruption.
Observe option being added for cancel observe response
where space for observe option will not be allocated in case
of observe cancel.

Change-Id: I29aa321e37070e490b7c3c3ec5d09c34be977cc6
Signed-off-by: Harry <h.marappa@samsung.com>
6 years agoSimulator:Fix for static analyzer reported issues
Harry [Tue, 4 Jul 2017 16:33:18 +0000 (22:03 +0530)]
Simulator:Fix for static analyzer reported issues

1. Removal of unused variables.
2. Using Map.empty() than Map.size() for optimization.
3. New API simulator_remote_resource::observe added to accept
   query parameters.

Change-Id: I3e8a4ebf3d03694f4f075a5345f1343d9ea453f8
Signed-off-by: Harry <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21237
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Senthil Kumar G S <senthil.gs@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 543d59f964c8b16db34897a4440b74fb9b83a2f3)

6 years ago[IOT-2745][Java][1.3.1-RC1] Static Analysis fix.
Senthil Kumar G S [Wed, 27 Sep 2017 14:54:34 +0000 (20:24 +0530)]
[IOT-2745][Java][1.3.1-RC1] Static Analysis fix.

Java static analysis fix for easy-setup module.
1. Removed unused imports.
2. Updated log to include error info.
3. Avoided multiple statements in single line.
4. Removed unused methods/code.
5. Proper order of java modifiers, etc.

Change-Id: Ida08e2084246aca7c5f1528bb2efe4c57682c85c
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
6 years ago[IOT-2638] Remove Deprecated API
akk0rd [Fri, 8 Sep 2017 15:00:42 +0000 (18:00 +0300)]
[IOT-2638] Remove Deprecated API

MOTSendPostDoxmCB is using a deprecated function OCDoResource

Change-Id: Ibeb8f5a57011f832765a7994194d1da98e572d09
Signed-off-by: akk0rd <v.riznyk@samsung.com>
6 years agobuild: Use global RPATH value
Philippe Coval [Fri, 21 Jul 2017 11:52:38 +0000 (13:52 +0200)]
build: Use global RPATH value

Also introduce ORIGIN for crosscompiler.

RPATH can be convenient to avoid developer to deal with environment variables
(LD_LIBRARY_PATH or PATH on windows), as we're using them for now.

In longer term, this can be replaced by relative pathes,
once the installation process is fixed
(at least on systems supporting ORIGIN).

It was tested on yocto poky master.

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

6 years ago[IOT-2752] Update invalid cert chain handling
Alex Kelley [Fri, 22 Sep 2017 00:05:54 +0000 (17:05 -0700)]
[IOT-2752] Update invalid cert chain handling

Update the handling of an invalid cert chain so that we move to the
next chain before cleaning up the invalid chain.

Change-Id: I95e4e410a9bca81a698f2c074cfca18b203e5133
Signed-off-by: Alex Kelley <alexke@microsoft.com>
6 years agoresource-directory: Check links before free
Philippe Coval [Thu, 24 Aug 2017 14:23:51 +0000 (16:23 +0200)]
resource-directory: Check links before free

In case if pointer has not been assigned

This is also suppressing a valgrind warning
when running test resource/csdk/stack/test/stacktests:

  2,208 bytes in 1 blocks \
  are possibly lost in loss record 0 if 0

Bug: https://jira.iotivity.org/browse/IOT-2645
Change-Id: Ifd44172a1f7755ec253748f6f02fbfd1dcacdd39
Origin: https://gerrit.iotivity.org/gerrit/#/c/22107/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22107
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 2c926be5e04dd982316c05c461c9a95fd0beae9a)

6 years agoRename macro VERIFY_CBOR_SUCCESS
Steven Saunders [Thu, 21 Sep 2017 23:43:32 +0000 (17:43 -0600)]
Rename macro VERIFY_CBOR_SUCCESS

to VERIFY_CBOR_SUCCESS_OR_OUT_OF_MEMORY

Change-Id: I5ee8795a21d8d84708737f83957fe260cf1234d2
Signed-off-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
6 years ago[IOT-2539] Remove maybe-uninitialized warning
George Nash [Tue, 1 Aug 2017 18:21:09 +0000 (11:21 -0700)]
[IOT-2539] Remove maybe-uninitialized warning

The compiler was indicating that the request.len and
request.bytes maybe used uninitialized. Best I can
tell the OCByteString is initilaized in the GenerateCSR
function. The compiler can not tell that it is
initilaized so it is zero initialized at creation.

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

6 years agonotification: Removing redundant configuration
Pawel Winogrodzki [Fri, 28 Apr 2017 04:21:50 +0000 (21:21 -0700)]
notification: Removing redundant configuration

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

Bug: https://jira.iotivity.org/browse/IOT-1583
Change-Id: I696f93a0fde5fcbe7ed8f3509b4de1747825d5fd
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
6 years agoFix build error: WITH_MQ
Ziran Sun [Mon, 18 Sep 2017 15:12:30 +0000 (16:12 +0100)]
Fix build error: WITH_MQ

Bug: https://jira.iotivity.org/browse/IOT-2719
Change-Id: If4249e5cf198fcb1dad4969d2cb7b141adb687b4
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
6 years agoCorrect wrong settings on format.
Ziran Sun [Fri, 22 Sep 2017 11:36:30 +0000 (12:36 +0100)]
Correct wrong settings on format.

Bug: https://jira.iotivity.org/browse/IOT-2667
Change-Id: Icde3607a38559598d91902c57d159b6784fecea1
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
6 years ago[IOT-2724] ES Mediator Android Sample Crash.
Senthil Kumar G S [Thu, 21 Sep 2017 16:32:13 +0000 (22:02 +0530)]
[IOT-2724] ES Mediator Android Sample Crash.

Updated JNI file to add iotivity stack version in EnrolleeConfig representation.
Updated sample to parse wifi modes and frequencies based on the version.

Change-Id: I1580823bdf3309369eb747dca4d3ce1bc3087158
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
6 years ago[IOT-2748] Fix OCProvisionSymmetricRoleCredentials
Alex Kelley [Mon, 25 Sep 2017 22:54:10 +0000 (15:54 -0700)]
[IOT-2748] Fix OCProvisionSymmetricRoleCredentials

This chanage updates OCProvisionSymmetricRoleCredentials to use internal
APIs that change the DOS state before and after updating credentials.

Change-Id: I351ee00c9a1a182d8ffe41f73c5eaf4eda4dfb52
Signed-off-by: Alex Kelley <alexke@microsoft.com>
6 years ago[IOT-2756] Handle empty cert chain in role entry
Alex Kelley [Fri, 22 Sep 2017 21:36:11 +0000 (14:36 -0700)]
[IOT-2756] Handle empty cert chain in role entry

Update HandleDeleteRequest to return OC_EH_RESOURCE_DELETED when the role
entry does not contain any cert chains.

Change-Id: Id393a67da10c4f18f8fb69ed15de7782bdac9c70
Signed-off-by: Alex Kelley <alexke@microsoft.com>
6 years agoUpdate IoTivity version to 1.3.1
Philippe Coval [Fri, 8 Sep 2017 17:22:15 +0000 (19:22 +0200)]
Update IoTivity version to 1.3.1

Change-Id: Idf208ace8c533da9d7587cd1a56aeca81edee9d2
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agonotification: Fix wrong NULL affectation
Philippe Coval [Thu, 20 Jul 2017 11:17:59 +0000 (13:17 +0200)]
notification: Fix wrong NULL affectation

To numbers or pthread type

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

6 years agoEasySetup:Fix for static analyzer reported issues
Harry [Tue, 4 Jul 2017 13:07:48 +0000 (18:37 +0530)]
EasySetup:Fix for static analyzer reported issues

Removal of never used methods and catching exceptions by reference.

Change-Id: I10d3c83ce5b14174b6f82a49897738c98a461af7
Signed-off-by: Harry <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21233
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Senthil Kumar G S <senthil.gs@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit e450d10699a504c90cb37fba3e9a551d93278e25)

6 years ago[IOT-2729] Update role resource and certhelpers
Alex Kelley [Tue, 19 Sep 2017 19:30:36 +0000 (12:30 -0700)]
[IOT-2729] Update role resource and certhelpers

1. Update OCInternalVerifyRoleCertificate to add the issuer as the
   authority if the role certificate IoTivity received does not
   contain an authority in the subject alternative name.
2. Update GetEndpointRoles to check for OC_STACK_NO_RESOURCE and
   OC_STACK_INVALID_PARAM so it can fall back to symmetric key role
   handling when the connection is not secured with a certificate.

Change-Id: Ieba2bfbbf5edfb32d74c24b5f668a8ee9d530354
Signed-off-by: Alex Kelley <alexke@microsoft.com>
6 years agocsdk: Avoid to overlap memcheck files for UT
Philippe Coval [Wed, 23 Aug 2017 15:03:35 +0000 (17:03 +0200)]
csdk: Avoid to overlap memcheck files for UT

From now on, it's better to align executable name

Relate-to:
https://gerrit.iotivity.org/gerrit/17373

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I8c8fd9ee68b01dfcc62d8a250c26649a82ba116e
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22029
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
(cherry picked from commit 52da664568c4071151dfb6bcf506163ebaba2957)

6 years agoIPCA: Install libipca dir to libdir
Philippe Coval [Mon, 7 Aug 2017 07:08:33 +0000 (09:08 +0200)]
IPCA: Install libipca dir to libdir

It needs to be install to variant dir along other libs then
dependency libs will be also be found using RPATH.

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

6 years agoIPCA: Convert JSON file to UNIX format
Philippe Coval [Fri, 18 Aug 2017 12:02:40 +0000 (14:02 +0200)]
IPCA: Convert JSON file to UNIX format

Bug: https://jira.iotivity.org/browse/IOT-1745
Change-Id: I4e95cda451f0ec2ba3f0363de748fe68c15869a4
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
6 years agoTransform OC_EH_OK into 2.02 for DELETE.
Todd Malsbary [Wed, 30 Aug 2017 21:24:27 +0000 (14:24 -0700)]
Transform OC_EH_OK into 2.02 for DELETE.

Currently OC_EH_OK is turned into 2.04 for POST or PUT.  This change
does the equivalent for DELETE.

Bug: https://jira.iotivity.org/browse/IOT-2660
Change-Id: I3b64d9c3a9471cdff25160ffab96928e0512fc33
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
6 years agoList child resource eps instead of parent.
Todd Malsbary [Wed, 30 Aug 2017 19:10:37 +0000 (12:10 -0700)]
List child resource eps instead of parent.

Bug: https://jira.iotivity.org/browse/IOT-2658
Change-Id: I90917f5fd965fd0e811326d3674cb751e5ac989e
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
6 years agoStack sample client fix
Oleksandr Dmytrenko [Tue, 25 Jul 2017 11:09:52 +0000 (14:09 +0300)]
Stack sample client fix

Stack sample client support old servers

Change-Id: Id9fffc3b9e73c68820b99e5fd197d742d0b19418
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
6 years agoprovisioning: Use .tmp suffix for test file
Philippe Coval [Fri, 18 Aug 2017 12:36:45 +0000 (14:36 +0200)]
provisioning: Use .tmp suffix for test file

We can use .tmp suffix for generated files to be ignored in git repo

Bug: https://jira.iotivity.org/browse/IOT-2599
Change-Id: I70d109e590784777a0ce2a87fa7451676bad20e8
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21999
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit a8abd0026c9fc8c8e6679202168f79c6206eff72)

6 years ago[IOT-2539] clean switch warning
George Nash [Mon, 31 Jul 2017 20:00:55 +0000 (13:00 -0700)]
[IOT-2539] clean switch warning

The file deviceonboardingstate.c produced a warning:
enumeration value 'DOS_STATE_COUNT' not handled in switch

This is a result of adding the the DOS_STATE_COUNT as an
enum value. This is a common programming pattern but will
result in the -Wswitch warning if the enum values are
used in a case statement without a default state.

There are multiple ways to handle this warning.
- add an empty case for the unhandled count state
- add a default case to the switch statement
- move the count out of the enum

For this fix the unhandled count state was added
to the switch statment with an assert if that case
is ever encountered.

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

6 years agoservice: clean up compiler warning
George Nash [Fri, 14 Jul 2017 20:36:08 +0000 (13:36 -0700)]
service: clean up compiler warning

Clean up the implicit-function-declaration warning in
CoapHttpHandler.c. The compiler is not finding the
OCParsePayload function so it is interpreting it as a
function that takes 4 parameters and returns an int.
This is a result of how old C compilers handle
implicit-functions.

The fact that OCParsePayload was used incorrectly was hidden
it should have 5 parameters not 4.  The code now includes the
internal header ocpayloadcbor.h and fixes the call to
OCParsePayload.

Change-Id: I894e3d423617c15c1ce2cf35825637984d1babd8
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21459
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit 35bcc24dde8e62832360092fa4da44b60e24305f)

6 years agoIOT-2539 Cleanup unused-parameter warning
George Nash [Mon, 7 Aug 2017 21:40:26 +0000 (14:40 -0700)]
IOT-2539 Cleanup unused-parameter warning

This is a set of code that will sometimes have a warning
depending on what is defined. To prevent the
unused-parameter warning the parameters are cast to void.
A empty operation that will be compiled out but prevents
the warning.

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

6 years ago[IOT-2539] remove the -Wcpp warning from octimer.c
George Nash [Thu, 27 Jul 2017 17:49:05 +0000 (10:49 -0700)]
[IOT-2539] remove the -Wcpp warning from octimer.c

This warning comes from teh glibc library. The library
has a # warning in the code if _BSD_SOURCE or _SVID_SOURCE
are defined in the code. The code that was enabled using
the two macros has been depricated. The new _DEFAULT_SOURCE
macro should be used to enable the features that were
enabled by the old macros.

If you need to build with old and newer versions of glibc
the glibc release notes recomend using both the old and
new macros.
see: https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I000d3bbfe4fdc473066d8c50862070c8b49788ca
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21655
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit 97bc6dcae86b4d97953a66abee12ad09acb02d00)

6 years agoIOT-2678 Change Java back to dynamic linking
George Nash [Wed, 20 Sep 2017 19:32:12 +0000 (12:32 -0700)]
IOT-2678 Change Java back to dynamic linking

Java was changed to use static linking for most of
the libraries. This was done to enable building Java
on Windows which does not contain the same dynamic
libraries as are avalible to Linux and Android.

See IOT-2405

Unfortanatly this change caused an issue in the Android
serivces. It caused multiple instances of the IoTivity
stack to be included in different libraries used by
the Android services.

This reverts the key elements of IOT-2405 without
reverting the entier change.

Relates-to: https://gerrit.iotivity.org/gerrit/21061

This is being done till we can figure out how to
enable the build on windows so it does not cause
multiple copies of the oc stack.

Windows java will no longer build if this commit
is accepted. However, Android is considered a
higher priority OS when it comes to the Java
language.

Bug: https://jira.iotivity.org/browse/IOT-2678
Bug: https://jira.iotivity.org/browse/IOT-2405
Change-Id: I54e9e65b00a199151395542d9e4629cef4efe516
Signed-off-by: George Nash <george.nash@intel.com>
6 years agoSvrdbeditor print certs
Oleksii Beketov [Tue, 19 Sep 2017 11:37:33 +0000 (14:37 +0300)]
Svrdbeditor print certs

Add print certificates

Change-Id: I92092c96ed467877bad8517c02d2d936b25f038b
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
6 years ago[IOT-2306] Remove Direct Pairing
v.riznyk [Fri, 14 Jul 2017 08:51:47 +0000 (11:51 +0300)]
[IOT-2306] Remove Direct Pairing

Remove direct pairing and pconfresource

Change-Id: Ia71db37f0c2ecbf2d7a62a8363c0949ada7e0f9e
Signed-off-by: v.riznyk <v.riznyk@samsung.com>
6 years ago[IOT-2475] Remove direct pairing from Java layer
saurabh.s9 [Tue, 8 Aug 2017 09:59:34 +0000 (15:29 +0530)]
[IOT-2475] Remove direct pairing from Java layer

Removed build failure issue for android
Change-Id: I3519cf8a8efff806f9a53aebc608150acc7d4427
Signed-off-by: saurabh.s9 <saurabh.s9@samsung.com>
6 years agoiOS build fix
Mats Wichmann [Mon, 18 Sep 2017 10:18:41 +0000 (04:18 -0600)]
iOS build fix

recent change dropped some characters which broke iOS build (which is
not tested by Jenkins), restoring them here.

Change-Id: Ic44e6239f11094ccebf9eb891805d28bf02aeee7
Signed-off-by: Mats Wichmann <mats@linux.com>
6 years ago[IOT-2737] Fix build warning in routing layer.
Senthil Kumar G S [Fri, 18 Aug 2017 13:07:11 +0000 (18:37 +0530)]
[IOT-2737] Fix build warning in routing layer.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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