iotivity.git
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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)

19 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)

19 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>
19 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)

19 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>
19 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>
19 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>
19 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>
19 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)

19 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)

19 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>
19 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

19 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)

19 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>
19 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)

19 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>
19 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>
19 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>
19 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)

19 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)

19 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)

19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 months agoIOT-2618 remove href prop in introspection res 73/22473/3
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

19 months agoRe-enable 32-bit builds on linux 91/22591/6
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>
19 months ago[IOT-2483, 2529] Incorrect IPv6 addr in endpoints 15/22515/2 1.3.1-RC2
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>
19 months ago[IOT-IOT-2739] Simulator plugin crash 85/22585/4
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>
19 months agoSimulator:Fix for static analyzer reported issues 01/21501/6
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)

19 months ago[IOT-2745][Java][1.3.1-RC1] Static Analysis fix. 27/22627/2
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>
19 months ago[IOT-2638] Remove Deprecated API 99/22399/2
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>
19 months agobuild: Use global RPATH value 55/22355/6
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/

19 months ago[IOT-2752] Update invalid cert chain handling 79/22579/3
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>
19 months agoresource-directory: Check links before free 27/22127/5
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)

19 months agoRename macro VERIFY_CBOR_SUCCESS 63/22563/2
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>
19 months ago[IOT-2539] Remove maybe-uninitialized warning 83/22083/5
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)

19 months agonotification: Removing redundant configuration 27/21327/12
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>
19 months agoFix build error: WITH_MQ 09/22509/3
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>
19 months agoCorrect wrong settings on format. 71/22571/3
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>
19 months ago[IOT-2724] ES Mediator Android Sample Crash. 55/22555/5
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>
19 months ago[IOT-2748] Fix OCProvisionSymmetricRoleCredentials 11/22611/2
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>
19 months ago[IOT-2756] Handle empty cert chain in role entry 95/22595/2
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>
19 months agoUpdate IoTivity version to 1.3.1 09/22409/3
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>
19 months agonotification: Fix wrong NULL affectation 27/22027/2
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)

19 months agoEasySetup:Fix for static analyzer reported issues 19/21519/11
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)

19 months ago[IOT-2729] Update role resource and certhelpers 57/22557/2
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>
19 months agocsdk: Avoid to overlap memcheck files for UT 67/22067/10
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)

19 months agoIPCA: Install libipca dir to libdir 77/22077/2
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)

19 months agoIPCA: Convert JSON file to UNIX format 39/22139/2
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>
19 months agoTransform OC_EH_OK into 2.02 for DELETE. 81/22281/3
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>
19 months agoList child resource eps instead of parent. 77/22277/6
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>
19 months agoStack sample client fix 15/21615/3
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>
19 months agoprovisioning: Use .tmp suffix for test file 57/22057/10
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)

19 months ago[IOT-2539] clean switch warning 11/22211/2
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)

19 months agoservice: clean up compiler warning 21/22221/2
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)

19 months agoIOT-2539 Cleanup unused-parameter warning 95/22195/2
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)

19 months ago[IOT-2539] remove the -Wcpp warning from octimer.c 87/22187/2
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)

19 months agoIOT-2678 Change Java back to dynamic linking 37/22537/4
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>
19 months agoSvrdbeditor print certs 17/22517/2
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>
19 months ago[IOT-2306] Remove Direct Pairing 49/21449/18
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>
19 months ago[IOT-2475] Remove direct pairing from Java layer 81/21781/9
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>
19 months agoiOS build fix 07/22507/2
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>
19 months ago[IOT-2737] Fix build warning in routing layer. 27/22527/2
Senthil Kumar G S [Fri, 18 Aug 2017 13:07:11 +0000 (18:37 +0530)]
[IOT-2737] Fix build warning in routing layer.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Also add persistent storage to overload security dat file.

Make example working again using:

  ./simpleserver 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Anyway, this behavior should be refactored in next releases.

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

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

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

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