iotivity.git
2 years agoUpdate vagrant config to ubuntu 16.04LTS 81/23081/7
Mats Wichmann [Thu, 2 Nov 2017 19:27:37 +0000 (13:27 -0600)]
Update vagrant config to ubuntu 16.04LTS

Provisions the current Ubuntu LTS release with a usable iotivity
build environment.

Also adds commented-out options to provision the other two
current (non-LTS) Ubuntu releases, 17.04 and 17.10

Change-Id: Ia5cda2e77d00de65367a57c1faaf226558a5e7b6
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years agosecurity: Publish doxmresource.h as experimental 93/21193/10
Philippe Coval [Thu, 14 Jul 2016 22:45:28 +0000 (07:45 +0900)]
security: Publish doxmresource.h as experimental

It was needed by tizen's IoT con, this is replacing downstream patch
that install internal security headers:

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>
Origin: https://review.tizen.org/gerrit/#/c/80131/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2 years agobuild: Install headers to iotivity namespace 37/8137/13
Philippe Coval [Fri, 21 Jul 2017 11:52:38 +0000 (13:52 +0200)]
build: Install headers to iotivity namespace

Introducing "iotivity" namespace for headers,
to avoid potential clash in /usr/include on Linux systems.

Developers should rely on pkg-config to look for headers locations,
or/and use "#include <iotivity/*>" in application sources.

Packagers can still symlink to legacy path if needed,
to ensure a smooth transition (See upcoming Tizen/Yocto changes).

For more details please check chapter:

https://wiki.iotivity.org/build#install

Bug: https://jira.iotivity.org/browse/IOT-524
Change-Id: I40533ad76037dc9376724d4e4397e2246d801013
Origin: https://gerrit.iotivity.org/gerrit/#/c/8137/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2 years ago[IOT-2837] Enable IoTivity build on Raspbery pi 99/22999/2
Rami Alshafi [Mon, 23 Oct 2017 22:53:01 +0000 (15:53 -0700)]
[IOT-2837] Enable IoTivity build on Raspbery pi

cherry-pick from 1.3-rel

The default arch for the raspberry pi board is either armv6l or
armv7l depending on board hardware version. Neither of them are
included in the valid values for the TARGET_ARCH build option.
The current workaround is to pass TARGET_ARCH=arm to the build
command. This change will enable the default arch.

Change-Id: I7f07734f5e06d79d13275254fb01f924227e229a
Signed-off-by: Rami Alshafi <ralshafi@vprime.com>
(cherry picked from commit 7ee4eee534723dad6b8ee32e5770b6a6c02a779a)

2 years agoUpdate security .dat files 19/22919/3
Mats Wichmann [Thu, 19 Oct 2017 19:14:51 +0000 (13:14 -0600)]
Update security .dat files

After recent changes to either the json2cbor tool or to the source
security files, the checked-in .dat files no longer match what
is being generated. Check in the ones that show changes.

Change-Id: I78a1e3032057261630f54b8dc608863c1b6dc216
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years agoChanges to support Python 3 87/22787/16
Mats Wichmann [Wed, 11 Oct 2017 16:30:22 +0000 (10:30 -0600)]
Changes to support Python 3

SCons 3 works with Python 3.x.  Try to eliminate places where the
scons scripts don't work with Py3.  The most "interesting" one is that
subprocess calls to run an external system command do not return a
string, so if we need to do "if substring in string" type queries on
the subprocess return, we need to call a decoder method to turn it into
a string. SCons provides SCons.Util.to_String for this purpose.

Also on strings, there is no longer a 'string_escape' encoder, Py3
strings are unicode so 'unicode_escape' is available. This is handled
with a try block.

Another change is in lambda usage: Python 3 abolished tuple argument
unpacking, and since lambdas only take a single argument usages which
look like multiple arguments (but are actually a tuple), this has an
effect in a couple of places.  The 2to3 tool suggested the changes here.

The local imports in build_common/iotivityconfig were changed to use
the relative-import syntax (a preceding dot). This has been around for
a long time, so causes no problem for Python 2 (in since 2.4).

Python 3 eliminates the cmp method, so the call to sort the help
message by argument name generated a syntax error.  It turns out
the sort named argument can also take a boolean value (undocumented;
scons3 docs will fix that for next release), so instead set sort=True.

Change-Id: I0582e99a83f6ca5246dc566727c0b04b5ed4199b
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years agobuild: variant-dir fix in IPCA 27/22727/4
Mats Wichmann [Fri, 6 Oct 2017 22:23:29 +0000 (16:23 -0600)]
build: variant-dir fix in IPCA

One more place turned up where build happens in src dir instead of
in variant dir, which impacts parallel builds of different flavors.
It seems that placing a source file from another part of the
project into the source list defeats the variant dir.  This proposal
takes it out and linked to the library it appears in instead.

Change-Id: I73283fb854fd899e5609017f2bb8a52fc8c00675
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years agoMerge "Merge branch '1.3-rel' (9cff398) into 'master'"
Ashok Babu Channa [Wed, 25 Oct 2017 05:24:53 +0000 (05:24 +0000)]
Merge "Merge branch '1.3-rel'  (9cff398) into 'master'"

2 years agoMerge branch '1.3-rel' (9cff398) into 'master' 37/22837/3
George Nash [Fri, 13 Oct 2017 22:13:09 +0000 (15:13 -0700)]
Merge branch '1.3-rel'  (9cff398) into 'master'

Relates-to:
https://gerrit.iotivity.org/gerrit/22743/
https://gerrit.iotivity.org/gerrit/22231/
https://gerrit.iotivity.org/gerrit/22621/
https://gerrit.iotivity.org/gerrit/22785/
https://gerrit.iotivity.org/gerrit/22703/
https://gerrit.iotivity.org/gerrit/22739/
https://gerrit.iotivity.org/gerrit/22793/
https://gerrit.iotivity.org/gerrit/22719/
https://gerrit.iotivity.org/gerrit/22777/
https://gerrit.iotivity.org/gerrit/22599/
https://gerrit.iotivity.org/gerrit/22329/
https://gerrit.iotivity.org/gerrit/22789/
https://gerrit.iotivity.org/gerrit/22741/
https://gerrit.iotivity.org/gerrit/22715/
https://gerrit.iotivity.org/gerrit/21945/
https://gerrit.iotivity.org/gerrit/22737/
https://gerrit.iotivity.org/gerrit/22725/
https://gerrit.iotivity.org/gerrit/22327/

Conflicts:
  resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
  resource/csdk/security/src/pstatresource.c
  resource/csdk/stack/src/ocobserve.c
  resource/include/StringConstants.h
  resource/unittests/OCExceptionTest.cpp
  service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp
  service/resource-container/unittests/SConscript

Bug: https://jira.iotivity.org/browse/IOT-2453
Change-Id: I8a378b98876e916a3940fc707f3bfad1afcbf9c6
Signed-off-by: George Nash <george.nash@intel.com>
2 years agoMerge "Merge branch '1.3-rel' (3040a9e)"
Ashok Babu Channa [Fri, 20 Oct 2017 21:24:04 +0000 (21:24 +0000)]
Merge "Merge branch '1.3-rel' (3040a9e)"

2 years agoLet Linux build upstream libcoap again 79/22679/4
Mats Wichmann [Tue, 3 Oct 2017 20:39:24 +0000 (14:39 -0600)]
Let Linux build upstream libcoap again

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

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

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

Change-Id: I5cab20eeeb10ccefe74d403dd204b33b39ed9a26
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years agoFix read through uninit in forked libcoap 03/22303/2
Mats Wichmann [Fri, 1 Sep 2017 16:42:23 +0000 (10:42 -0600)]
Fix read through uninit in forked libcoap

In the forked libcoap, in coap_new_context, a context type
is allocated, then if no address was passed, tries to free
it back up and quits.  This makes no sense: if we know we
can't proceed without listen_addr, check for that up front,
before allocations.  In the existing code, coap_free_context(c)
would cause the fields of c to be used during the freeing
process, but they've never been set up.

Coverity:
5. uninit_use_in_call: Using uninitialized value c->resources when calling coap_free_context.
6. uninit_use_in_call: Using uninitialized value c->sendqueue when calling coap_free_context.
7. uninit_use_in_call: Using uninitialized value c->recvqueue when calling coap_free_context.
CID 1379688: Uninitialized pointer read (UNINIT)
8. uninit_use_in_call: Using uninitialized value c->sockfd when calling coap_free_context.

Upstream doesn't look like this at all any more, so there's
really nothing to upstream on this one.

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

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

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

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

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

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

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

sampleserver_randompin and sampleserver_preconfpin MOT fix

Change-Id: Iadb02e4370604c33b8070ea45f2d8a42ecfafae1
https://jira.iotivity.org/browse/IOT-2709
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
2 years 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>
2 years ago[IOT-2494] SVR DB Editor : Clean codes 41/22541/4
Sangjoon Je [Thu, 21 Sep 2017 06:20:02 +0000 (15:20 +0900)]
[IOT-2494] SVR DB Editor : Clean codes

Fix typo, memleak
Remove unnecessary codes.

New Feature: https://jira.iotivity.org/browse/IOT-2494
Change-Id: Id557fdd058a4c8ca16d2f3ab1c03f644a0af38ec
Signed-off-by: Sangjoon Je <sangjoon.je@samsung.com>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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)

2 years 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)

2 years agoMerge branch '1.3-rel' (3040a9e) 23/22723/3
George Nash [Fri, 6 Oct 2017 18:36:47 +0000 (11:36 -0700)]
Merge branch '1.3-rel' (3040a9e)

Relate-to:
https://gerrit.iotivity.org/gerrit/22689/
https://gerrit.iotivity.org/gerrit/22385/
https://gerrit.iotivity.org/gerrit/22665/
https://gerrit.iotivity.org/gerrit/22529/
https://gerrit.iotivity.org/gerrit/22535/
https://gerrit.iotivity.org/gerrit/22403/
https://gerrit.iotivity.org/gerrit/21939/
https://gerrit.iotivity.org/gerrit/22671/
https://gerrit.iotivity.org/gerrit/22393/
https://gerrit.iotivity.org/gerrit/22597/
https://gerrit.iotivity.org/gerrit/22473/

Conflicts:
  auto_build.py
  resource/csdk/connectivity/src/camessagehandler.c
  resource/csdk/stack/src/ocobserve.c
  resource/csdk/stack/src/ocstack.c
  resource/provisioning/unittests/SConscript

Bug: https://jira.iotivity.org/browse/IOT-2453
Change-Id: I7db07ad3da8305aac3bf5d958b2ea3889b1106e7
Signed-off-by: George Nash <george.nash@intel.com>
2 years 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>
2 years agoOne more scons 3.0 print change 81/22781/1
Mats Wichmann [Wed, 11 Oct 2017 13:38:54 +0000 (07:38 -0600)]
One more scons 3.0 print change

Looks like this snuck back in after previous round of changes

Change-Id: I0fb02991ea713006758b90a3bfebfdc99916f435
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years 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)

2 years 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>
2 years agoPrepare for scons3: change prints and more 35/22635/5
Mats Wichmann [Thu, 28 Sep 2017 12:51:47 +0000 (06:51 -0600)]
Prepare for scons3: change prints and more

A previous change updated all the scons scripts:

https://gerrit.iotivity.org/gerrit/#/c/22525/

This change picks up the semi-external scripts that are called
by the build, and thus are run in the scons context and need updating.

Print statements are surrounded with parens so they look like function
calls.  This is an scons3 syntax requirement even if still using Python 2.

The old exception format "except FooErr, err" is no longer supported
in Python 3; since the Python 3 format "except FooErr as err" has been
available since Python 2.6, there is no problem switching these and it
makes sense to remove one way things could fail if Py3 is used.

A few comparisons which used <> are changed to the preferred != form.

Reformatted Builder call without changing it, and added a comment in the
forked version to help explain why there are two copies of UnpackAll.py.

With these changes, a full build completes successfully using scons3.0.

Change-Id: Ia8df28d12c6504d6466dcf793779535d1ad3aa8b
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years 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>
2 years 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>
2 years 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>
2 years 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)

2 years 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)

2 years 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>
2 years 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

2 years 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)

2 years agorapidjson: Remove patch from copied scriptlet 91/22691/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>
2 years agogtest: Update path in prep.sh 93/22693/4
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>
(cherry picked from commit ab453302955899902b76918fa7b44a4134e1ccec)
Origin: https://gerrit.iotivity.org/gerrit/#/c/22671/

2 years 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>
2 years agoprovisioning: Relocate Valgrind filename to topdir 53/22053/16
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
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2 years 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)

2 years 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>
2 years 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>
2 years 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>
2 years ago[IOT-2447] Support Multiple Ownership 67/22167/10
Oleksii Beketov [Thu, 21 Sep 2017 13:37:46 +0000 (16:37 +0300)]
[IOT-2447] Support Multiple Ownership

Enable MOT

[Philippe Coval]

Ported from 1.3-rel to master

Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Change-Id: I4cfd4e456d5ae53596cffb6648f1a1d265ed6868
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21577
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Aleksey Volkov <a.volkov@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
2 years agobuilds: stop defeating Variant dir Part 1/3 89/21889/19
Mats Wichmann [Fri, 11 Aug 2017 22:10:14 +0000 (16:10 -0600)]
builds: stop defeating Variant dir Part 1/3

In various places in the build scripts, steps are taken which defeat the
intent of using a variant dir: a distinct tree where building takes place.
Mostly this works as expected, but in places where the scripts call
Python facilities directly to figure paths out, scons does not have
the ability to "know" the paths and do the internal substitutions if
VariantDir is in effect.

There is a bug report (IOT-645) which claims this "build in the source
dir" behavior inhibits multiple builds of different targets at the same
time on one machine/instance, although that bug is focused on extlibs
which is its own story, builds there are only initiated by scons passing
control to some other builder (make, etc.) so harder to solve.

Part one of this patch series is fixing resource/csdk/connectivity.

The main type of thing which causes the issue is:

    src_dir = os.path.abspath(os.curdir)

This absolute path (which scons has no ability to adjust to use the
variant dir) is typically joined with source file names in subdirectories
when the builder will not be invoked in that directory. Replacing that
model, source files are now added as File objects (instead of simple
path strings), which leaves scons in full knowlege of the file and how
to find it. It's possible a plain filename string would be good enough;
scons is aware of the location it's in when running a given script.

A challenge was in the resource/csdk/connectivity/src/*adapter build
scripts: these invoke a target-specific subsidiary script to add source
files particular to the target (tizen, android, etc.) - but not all
possible build tergets have a script for each adapter.  So the scripts
checked for the script using os.path.exists() using an absolute path as
noted above, as it must since the Python module does not know scons path
tools, but then when calling it using the same path, the context is wrong
and the added sources and thus their derived object dependencies were
relative to the source tree, not the the variant dir. Again using a File
object, it is possible to extract both a regular (variant-adjustable)
path and a srcdir-relative path, the latter used for the check by
os.path.exists.

With this change, of the original 81 non-extlibs and non-libcoap builds
not happening in variant dir, there are only four remaining (though note
counts are build-dependent and this only refers to Linux x86_64 with the
options I used). Those four will be the subject of part 2/3.  (Part 3/3
is already merged to master and fixed the ones coming from bridging/):

Preparing target resource/c_common/oic_malloc/src/oic_malloc.o...
Preparing target resource/csdk/logger/src/logger.o...
Preparing target resource/c_common/oic_string/src/oic_string.o...
Preparing target resource/src/OCRepresentation.o...

While working on this, a few missed list-assignment reformattings were
snuck in, these should clearly be seen to be zero-impact.

Additionally, in a few places when a comparison is done against a list
which will be used as if it were immutable, like:

    if foo in ['linux', 'tizen']:

it was actually changed to be immutable, i.e. [] changed to tuple ().

Some old debugging prints announcing when a script is being scanned were
also dropped.

This change is independent of the others in the series.

Bug: https://jira.iotivity.org/browse/IOT-645
Change-Id: I54ba8c6613bcfefb6dba64687e9f1a0e72327a41
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years 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)

2 years 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)

2 years agoFix build problem with connectivity_abstraction 39/22539/3
Mats Wichmann [Wed, 20 Sep 2017 20:35:02 +0000 (14:35 -0600)]
Fix build problem with connectivity_abstraction

A linux system started failing builds making the provisioning unit test.
This file links with libconnectivity_abstraction_internal.  However,
other libraries in the link line require libconnectivity_abstraction, so
the linker decides it's an error for it not to be listed on the link line.

Fix: flip the library requested to the public libconnectivity_abstraction,
except for Windows where only the internal one is available.
It's done this way in two other build scripts; it's possible it
should be done in the others that don't although this is the
only one causing a build fail in this instance.  (candidates:
resource/csdk/security/provisioning/unittest/SConscript.
resource/csdk/security/unittest/SConscript,
resource/csdk/stack/test/SConscript, resource/unittests/SConscript)

Change-Id: I7b86d9eafa708e0b59a504d1c240d641134c5e48
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years agoMerge "Merge remote branch '1.3-rel'(38203e6)"
Ashok Babu Channa [Thu, 5 Oct 2017 05:26:09 +0000 (05:26 +0000)]
Merge "Merge remote branch '1.3-rel'(38203e6)"

2 years 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)

2 years agoMerge "Merge remote branch '1.3-rel' (80e11aa)"
Randeep Singh [Thu, 5 Oct 2017 03:43:23 +0000 (03:43 +0000)]
Merge "Merge remote branch '1.3-rel' (80e11aa)"

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years ago[IOT-1977] Removal of dead code in ocstack 63/18563/22
Harish Kumara M [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: Poovizhi <poovizhi.a@samsung.com>
Signed-off-by: Harry <h.marappa@samsung.com>
2 years 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>
2 years 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>
2 years 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>
2 years 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

2 years agobuilds: stop defeating variant dir 4/4 09/22609/2
Mats Wichmann [Tue, 26 Sep 2017 16:28:26 +0000 (10:28 -0600)]
builds: stop defeating variant dir 4/4

There were only three, but here is one more simple one.

Avoids these two being built:
service/easy-setup/mediator/richsdk/unittests/ESMediatorTest.o
service/easy-setup/mediator/richsdk/unittests/ESMediatorTest.gcno

instead they appear in the Variant dir (out).

Change-Id: If9d69db6a3e664d543c9a39644c3cbfba86a6630
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years agoMerge remote branch '1.3-rel'(38203e6) 47/22647/2
George Nash [Fri, 29 Sep 2017 21:06:27 +0000 (14:06 -0700)]
Merge remote branch '1.3-rel'(38203e6)

Relate-to:
https://gerrit.iotivity.org/gerrit/22591/
https://gerrit.iotivity.org/gerrit/22515/
https://gerrit.iotivity.org/gerrit/22585/
https://gerrit.iotivity.org/gerrit/22627/
https://gerrit.iotivity.org/gerrit/22399/
https://gerrit.iotivity.org/gerrit/22579/
https://gerrit.iotivity.org/gerrit/22563/
https://gerrit.iotivity.org/gerrit/21327/
https://gerrit.iotivity.org/gerrit/22571/
https://gerrit.iotivity.org/gerrit/22555/
https://gerrit.iotivity.org/gerrit/22611/
https://gerrit.iotivity.org/gerrit/22595/
https://gerrit.iotivity.org/gerrit/22409/
https://gerrit.iotivity.org/gerrit/22557/

Conflicts:
  resource/third_party_libs.scons
  service/easy-setup/enrollee/unittests/ESEnrolleeTest.cpp
  service/notification/SConscript
  service/notification/cpp-wrapper/consumer/SConscript
  service/notification/cpp-wrapper/examples/linux/SConscript
  service/notification/cpp-wrapper/provider/SConscript
  service/notification/examples/linux/SConscript
  service/third_party_libs.scons

Bug: https://jira.iotivity.org/browse/IOT-2453
Change-Id: Ie1f359fb1793bc9d746d21fab5865b98e0b5c48d
Signed-off-by: George Nash <george.nash@intel.com>
2 years agoMerge remote branch '1.3-rel' (80e11aa) 81/22581/3
George Nash [Fri, 29 Sep 2017 20:11:08 +0000 (13:11 -0700)]
Merge remote branch '1.3-rel' (80e11aa)

Relate-to:
https://gerrit.iotivity.org/gerrit/22139
https://gerrit.iotivity.org/gerrit/22281
https://gerrit.iotivity.org/gerrit/22277
https://gerrit.iotivity.org/gerrit/21615
https://gerrit.iotivity.org/gerrit/22537
https://gerrit.iotivity.org/gerrit/22517
https://gerrit.iotivity.org/gerrit/21449
https://gerrit.iotivity.org/gerrit/21781
https://gerrit.iotivity.org/gerrit/22507
https://gerrit.iotivity.org/gerrit/22521
https://gerrit.iotivity.org/gerrit/22499
https://gerrit.iotivity.org/gerrit/22223
https://gerrit.iotivity.org/gerrit/22437
https://gerrit.iotivity.org/gerrit/21489
https://gerrit.iotivity.org/gerrit/22353
https://gerrit.iotivity.org/gerrit/22455
https://gerrit.iotivity.org/gerrit/22363
https://gerrit.iotivity.org/gerrit/22483
https://gerrit.iotivity.org/gerrit/22429
https://gerrit.iotivity.org/gerrit/22469
https://gerrit.iotivity.org/gerrit/22011
https://gerrit.iotivity.org/gerrit/22007
https://gerrit.iotivity.org/gerrit/22407
https://gerrit.iotivity.org/gerrit/21837
https://gerrit.iotivity.org/gerrit/22299
https://gerrit.iotivity.org/gerrit/5473
https://gerrit.iotivity.org/gerrit/5441

Conflicts:
    resource/csdk/security/src/pconfresource.c
    resource/csdk/stack/samples/linux/secure/SConscript
    resource/csdk/stack/src/ocserverrequest.c
    resource/examples/SConscript
    resource/examples/oic_svr_db_client.dat
    resource/examples/oic_svr_db_server.dat
    resource/provisioning/unittests/OCProvisioningTest.cpp

Bug: https://jira.iotivity.org/browse/IOT-2453
Change-Id: I07efb0d1bd6c46ad2e413d1df106e37247206c46
Signed-off-by: George Nash <george.nash@intel.com>
2 years 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>
2 years 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>
2 years 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>
2 years 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)

2 years 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>
2 years 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>
2 years ago[IOT-2494] SVR DB Editor : Add cred edit features 57/22357/9
Sangjoon Je [Wed, 6 Sep 2017 01:09:22 +0000 (10:09 +0900)]
[IOT-2494] SVR DB Editor : Add cred edit features

Add Cred add symmetric key pair
Add Cred modification

TrustCA cert is saved in cred->publicdata
instead of optional data.
(see https://gerrit.iotivity.org/gerrit/#/c/21983/)

New Feature: https://jira.iotivity.org/browse/IOT-2494
Signed-off-by: Sangjoon Je <sangjoon.je@samsung.com>
Change-Id: I487786c432c7d51ead84d08fca0326d34b10e27a

2 years 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/

2 years 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>
2 years 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)

2 years agoPrepare for scons3: change prints and others 25/22525/5
Mats Wichmann [Tue, 19 Sep 2017 23:41:18 +0000 (17:41 -0600)]
Prepare for scons3: change prints and others

In preparation for scons3, recently released, modify remaining print
statements by surrounding them with parens so they look like function
calls. That takes care of the scons3 syntax requirement.

The remaining instances of the sequence "print FOO; Exit(1)" were
changed to "msg = FOO; Exit(msg)" - this helps with the change by
not even using the print statement, and by giving the message to
the output function, it is sent to the error stream rather than
the output stream.

Calls to dictionary keys() and values() are now wrapped in list(),
on Python 3 these return special objects, not the expected list.
That's harmless to Python 2 usage.

The old exception format "except FooErr, err" is no longer supported;
since the Python 3 format "except FooErr as err" has been available
since Python 2.6, there is no problem switching these.

Some instances of using the commands module in extlibs changes to use
subprocess module. Change is transparent.

A couple of instances of filter(lambda ...)) were changes to
a python list comprehension, this is considered preferred for
Python 3 (change was suggested by a conversion tool)

Note on print() change:

  When running with Python2, the print statement is still used. That
  has a bit of an impact: print(a) is just prints the argument, but
  print(a, b, c) is interpreted as printing a tuple (a, b, c), so we
  could see:

  >>> print "This", "is", "a", "test"
  This is a test
  >>> print("This", "is", "a", "test")
  ('This', 'is', 'a', 'test')

  The second is not pretty.  You can make Python2 code use the function
  instead of the statement:

  >>> from __future__ import print_function
  >>> print("This", "is", "a", "test")
  This is a test

  but that's a pain, so the small number of existing prints which
  used a comma as argument separators were updated to use addition,
  so now we're concatenating a string to produce one arg instead
  of supplying multiple "arguments" that would be misinterpreted
  as a tuple in print().  It's fine to add the import statement
  if it's needed.

Change-Id: Idac00e1389b79ee65da4a2eb6ef3246551b66843
Signed-off-by: Mats Wichmann <mats@linux.com>
2 years 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>
2 years 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)

2 years 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>
2 years agoFix build error: WITH_MQ 11/22511/2
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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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)

2 years agoIOT-2539 remove parentheses and empty-body warning 61/22561/3
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>
2 years 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)

2 years 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>
2 years 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)

2 years 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)

2 years agoMerge "Merge branch '1.3-rel' (5c831e6)"
Nathan Heldt-Sheller [Fri, 22 Sep 2017 20:57:23 +0000 (20:57 +0000)]
Merge "Merge branch '1.3-rel' (5c831e6)"

2 years agobuild: Support other archs for coverify report 73/22373/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>