iotivity.git
3 days ago[IOT-3293] Proper PSK hint for random pin 12/29612/4 master 2.0.1.1 2.0.1.1-RC0
Aleksey Volkov [Wed, 17 Jul 2019 10:47:21 +0000 (13:47 +0300)]
[IOT-3293] Proper PSK hint for random pin

Use device uuid as psk hint for the random pin
otm TLS session

Change-Id: I02daa8b7cacdac46c6ce5b9d59f6d0932a2b5e15
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
3 days ago[IOT-3286] IoTivity may hang on exit 53/29553/6
Iurii Metelytsia [Thu, 13 Jun 2019 11:10:39 +0000 (14:10 +0300)]
[IOT-3286] IoTivity may hang on exit

1. Reference counter has been added to ssl adapter.
2. Waiting for ReceiveThread when the caipserver is stopped added.

Signed-off-by: Iurii Metelytsia <i.metelytsia@samsung.com>
Change-Id: I3ccf95ff1c851fe0d3e70f75ed00fdb1fce7bf82

10 days agoocstack: handler check 70/29570/2
Oleksandr Dmytrenko [Wed, 26 Jun 2019 10:52:42 +0000 (13:52 +0300)]
ocstack: handler check

Check ehResponseHandler in serverRequest before call

Change-Id: I575ca777bbe13f50c15ff5fb9c58cb5730eee584
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
11 days agoBad hello on TLS closure 81/29581/2
Oleksii Beketov [Wed, 10 Jul 2019 13:40:50 +0000 (16:40 +0300)]
Bad hello on TLS closure

Prevent treating reciprocal close_notify alert
as an error after TSL connection closure.

Change-Id: I22bc91a2f3c3e9bc13438588ca17b5944fcdc48f
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
12 days agoReciprocal close_notify 78/29578/2
Oleksii Beketov [Tue, 9 Jul 2019 13:17:28 +0000 (16:17 +0300)]
Reciprocal close_notify

Added mutual close_notify alert respond on receiving
close_notify alert according to RFC5246 p. 7.2.1.

Change-Id: I984db86939fc575e02e964a849cf5f7b9e7265c9
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
3 weeks agoThe provisioning unittest 69/29569/1
Oleksandr Dmytrenko [Wed, 26 Jun 2019 10:38:20 +0000 (13:38 +0300)]
The provisioning unittest

deviceonboardingstate tests added

Change-Id: Idd2f65bfab3909ac139d5e24855cc0e57ddbfe4c
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
3 weeks agothe security provisioning unittests 17/27917/49
Oleksandr Dmytrenko [Wed, 6 Feb 2019 16:10:10 +0000 (18:10 +0200)]
the security provisioning unittests

the security provisioning unittests
coverage up t0 75

Change-Id: Idd98ddf4c61de900842c4c7e9567c1ed527dc59a
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
3 weeks agothe security unit tests 92/29492/35
Oleksandr Dmytrenko [Tue, 14 May 2019 12:28:49 +0000 (15:28 +0300)]
the security unit tests

the security unit tests with coverage more 75%

Change-Id: Ia84e693fc00e2e7da9ce83cd845fced011fc8d43
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 weeks agocloud build fix: crosses initialialization 62/29562/1
Oleksandr Dmytrenko [Tue, 18 Jun 2019 09:07:05 +0000 (12:07 +0300)]
cloud build fix: crosses initialialization

crosses initializations in cloud fix

Change-Id: Id0ed5f31aa192ad385be4cb039f82f3b5be308a2
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
5 weeks agoRevert "Merge branch 'feat-owned-readonly'" 59/29559/2
Nathan Heldt-Sheller [Sat, 15 Jun 2019 00:40:11 +0000 (00:40 +0000)]
Revert "Merge branch 'feat-owned-readonly'"

This reverts commit eea3fc82b0199f1a7cc642b7aa70157afed6cda6.

We decided to keep IoTivity compatible with v2.0.1.  This
change is for v2.0.2 and the feature can be 3-pillar aligned using the branch.

Change-Id: Ifcd62c91fc28730bfd5011992782352d7636a641
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
7 weeks agoMerge "Merge branch 'feat-owned-readonly'"
Nathan Heldt-Sheller [Sat, 1 Jun 2019 15:58:03 +0000 (15:58 +0000)]
Merge "Merge branch 'feat-owned-readonly'"

8 weeks agoFix null pointer dereference 23/29523/1
Vitalii Irkha [Fri, 24 May 2019 09:23:11 +0000 (12:23 +0300)]
Fix null pointer dereference

Added input data check for verifyIdentity() API

Change-Id: Ic4fca882dacf5f9d5eccfde9e94c16ee7fe74df5
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
8 weeks agoMerge branch 'feat-owned-readonly' 17/29517/1
Aleksey Volkov [Wed, 22 May 2019 12:16:52 +0000 (15:16 +0300)]
Merge branch 'feat-owned-readonly'

Change-Id: I9fe501950cd78571ed690336d146df8bb5aa6e79
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
2 months agoUse 2.1 version for RO doxm.owned 16/29516/2 feat-owned-readonly
Aleksey Volkov [Tue, 21 May 2019 15:26:08 +0000 (18:26 +0300)]
Use 2.1 version for RO doxm.owned

Change-Id: I8845a2551a18b54ccd064333c1fe867e95ebfb94
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
2 months agowindows build fix 12/29512/5
Oleksandr Dmytrenko [Mon, 20 May 2019 14:23:55 +0000 (17:23 +0300)]
windows build fix

windows build fix

Change-Id: I455130b66d0d1a5ddaf5342726463039e233348c
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 months agoc++ warns as error fixed 91/29491/11
Oleksandr Dmytrenko [Tue, 14 May 2019 07:04:12 +0000 (10:04 +0300)]
c++ warns as error fixed

c++ warns as error fixed

Change-Id: I836560ef338ba385c4ef814963e683dd41d1c500
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 months agostrncat usage fix 01/29501/3
Oleksandr Dmytrenko [Wed, 15 May 2019 06:21:15 +0000 (09:21 +0300)]
strncat usage fix

error: 'strncat' specified bound 1 equals source length

Change-Id: I7e58c93ba17a760b7434c25024c858ae0f634079
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 months agoStatic analyzer issues fixed 86/29486/2
Iurii Metelytsia [Wed, 8 May 2019 11:15:38 +0000 (14:15 +0300)]
Static analyzer issues fixed

Change-Id: I175dd965aa0c4d85dd37d5d9b4ece9b4360ff05a
Signed-off-by: Iurii Metelytsia <i.metelytsia@samsung.com>
2 months agowrong conversion fix 00/29500/1
Oleksandr Dmytrenko [Wed, 15 May 2019 06:18:37 +0000 (09:18 +0300)]
wrong conversion fix

error: invalid conversion from 'int64_t {aka long int}' to 'CborError'

Change-Id: Ifbc8e51104fe5af0904b74a927179347e2207073
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 months agotizen: Intial packaging of googletest-1.7.0 35/23135/18
Philippe Coval [Fri, 10 Nov 2017 16:42:06 +0000 (17:42 +0100)]
tizen: Intial packaging of googletest-1.7.0

Formerly know as gtest,

Change-Id: If95d302cbfd47ba3d63c6acbd008d6b01d0a3ec3
Bug-IoTivity: https://jira.iotivity.org/browse/IOT-2241
Bug-Tizen: https://bugs.tizen.org/browse/SO-1063
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2 months agombedtls error and verify info logging 60/29460/1
Oleksandr Dmytrenko [Thu, 25 Apr 2019 07:40:19 +0000 (10:40 +0300)]
mbedtls error and verify info logging

Added macroses for:
1) mbedtls error logging
2) verify info logging

Change-Id: I9ee474ff8b2ec3ab40dded3af6d208c780d4d3d4
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 months agoFIX static analyzer issue 55/29455/2
i.metelytsia [Tue, 23 Apr 2019 11:09:10 +0000 (14:09 +0300)]
FIX static analyzer issue

    - roleresource.c : sscanf function call has been replaced with strtol

Change-Id: I890548b946a8d27026a85ebd3bbad610d5b39a32
Signed-off-by: i.metelytsia <i.metelytsia@samsung.com>
2 months agoocpayloadparse fixed 39/29439/4
Oleksandr Dmytrenko [Tue, 16 Apr 2019 08:15:52 +0000 (11:15 +0300)]
ocpayloadparse fixed

1)error: ISO C++ forbids converting a string constant to 'char*'
2)_POSIX_C_SOURCE redefined(/usr/include/features.h:
        this is the location of the previous definition)

Change-Id: I69edcddf46766cb948deb7c169f2ac727656055f
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
2 months ago[IOT-3261] force content version to 1.0.0 42/29442/4
Nathan Heldt-Sheller [Tue, 16 Apr 2019 22:31:31 +0000 (15:31 -0700)]
[IOT-3261] force content version to 1.0.0

IoTivity should never send Content-Format-Version or
Content-Format-Accept-Version higher than 1.0.0 (per
Specification 2.0.1).  This change forces the outgoing
values to be at most 1.0.0, regardless of what is in
the request header.

Change-Id: I9153993bb8200bb828202c9716dede609fcd5048
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
3 months agoFIX for static analyzer tool issues 91/29391/4
i.metelytsia [Mon, 8 Apr 2019 15:38:55 +0000 (18:38 +0300)]
FIX for static analyzer tool issues

Change-Id: I750d0401e0425b92c7a2004e858cf5c09734186f
Signed-off-by: i.metelytsia <i.metelytsia@samsung.com>
3 months agounused crl api 37/29437/2
Oleksandr Dmytrenko [Tue, 16 Apr 2019 07:29:25 +0000 (10:29 +0300)]
unused crl api

unused crl api

Change-Id: Ie0ac82f1aed69a1a4aab325f8d11e6f3d124278e
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
3 months agonull reference check in parseInvitePayload 38/29438/2
Oleksandr Dmytrenko [Tue, 16 Apr 2019 07:30:45 +0000 (10:30 +0300)]
null reference check in parseInvitePayload

null reference check in parseInvitePayload

Change-Id: Ibf9377c97678c2eb5def6029e9c742a6f663de4a
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
3 months agosecurity provisioning cloud c++ fixs 66/29366/4
Oleksandr Dmytrenko [Tue, 2 Apr 2019 11:31:43 +0000 (14:31 +0300)]
security provisioning cloud c++ fixs

security provisioning cloud c++ fixs

Change-Id: I56f5a67f8f471d935e69cec0527abd7a6a59f686
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
3 months agocloud: Update jackson to fix vulnerabities 53/29353/2
Philippe Coval [Tue, 26 Mar 2019 09:56:43 +0000 (10:56 +0100)]
cloud: Update jackson to fix vulnerabities

Change-Id: I6e9035b4f3ac7aa8659ef113b3a5c64d3f08951b
Relate-to: https://nvd.nist.gov/vuln/detail/CVE-2018-12022
Signed-off-by: Philippe Coval <p.coval@samsung.com>
3 months agobuild: Update version to 2.0.1 52/29352/2
Philippe Coval [Tue, 26 Mar 2019 09:53:44 +0000 (10:53 +0100)]
build: Update version to 2.0.1

Change-Id: I2d8948a0d27c177bee8f5ebaf39e120c2e750757
Signed-off-by: Philippe Coval <p.coval@samsung.com>
3 months agocc1plus: all warnings being treated as errors fix 55/29355/7
Oleksandr Dmytrenko [Thu, 28 Mar 2019 07:44:47 +0000 (09:44 +0200)]
cc1plus: all warnings being treated as errors fix

1) error: missing initializer for member OicSecKey::len
2) ISO C++ forbids converting a string constant to 'char*'
3) _POSIX_C_SOURCE redefined

Change-Id: Ib74fd60f124d58213afc9855b71c38ba6d00503c
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
3 months agocloud provisioning config cb return fix 68/29368/1
Oleksandr Dmytrenko [Wed, 3 Apr 2019 07:09:36 +0000 (10:09 +0300)]
cloud provisioning config cb return fix

cloud provisioning config cb return fix

Change-Id: I59b7fbfb0511ab788494e7ea4cd3790c0a13aecf
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
3 months ago[IOT-3280] Save doxm.owned when changing 57/29357/2
Aleksey Volkov [Thu, 28 Mar 2019 16:35:08 +0000 (18:35 +0200)]
[IOT-3280] Save doxm.owned when changing

Save doxm.owned flag to the persistet storage
when it changing at the state transition.

Change-Id: I870a2a166322efe2fec97c421d8f9c638f67234b
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
3 months ago[IOT-3280] Fix doxm.owned checking 50/29350/1
Aleksey Volkov [Mon, 25 Mar 2019 13:18:08 +0000 (15:18 +0200)]
[IOT-3280] Fix doxm.owned checking

Do not check doxm.owned flag for direct
transition to the NOP state

Change-Id: I5ec1144b2703aa88cc07eeed6e3d14fa5c6a8173
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
4 months agoChange Access Token Max Value 30/29330/5
Jaehong Jo [Tue, 12 Mar 2019 10:39:07 +0000 (19:39 +0900)]
Change Access Token Max Value

The access token can have a long value.
So length changed from the existing 64 to 1024.

Change-Id: Id03b4c86d78cdfa1108fee5c6029f286704894c4
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
4 months agoUpdated Doxfiles 43/29343/2
Nathan Heldt-Sheller [Tue, 19 Mar 2019 16:19:42 +0000 (09:19 -0700)]
Updated Doxfiles

Two Doxyfiles were updated with changed project number '2.0.1':
resource/docs/c-doc/Doxyfile
resource/docs/cpp-doc/Doxyfile

Change-Id: I47469d39358cb83a290d34cc3532813fcbb68e49
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
4 months ago[IOT-3271] additional policyengine logging 32/29332/2
Nathan Heldt-Sheller [Thu, 14 Mar 2019 04:53:02 +0000 (21:53 -0700)]
[IOT-3271] additional policyengine logging

Added logging to policyengine and removed a corner-case match leftover
from pre-OCF-1.3 wildcard definitions.

Change-Id: I89df91f81ac28d82ad7bf84ab1895d6cb4b75cd5
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
4 months agocredresource fix 11/29311/9
Oleksandr Dmytrenko [Thu, 28 Feb 2019 14:33:32 +0000 (16:33 +0200)]
credresource fix

1) pointer check in CheckSubjectOfCertificate
2) check pointer len before free in FreeCred
3) poniter check & cross init in CmpCredId
4) double call fix in DeInitCredResource
5) new CopyCred
6) return buffer convertion in case calloc
7) CheckSubjectOfCertificate: label 'exit' defined but not used

Change-Id: Ic6b5cfb948505b079f37a6c0b2f2047b25ab5d89
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months ago[IOT-3249] Add oic.wk.mnt to DCR list 28/29328/2 2.0.1-RC0
Oleksandr Andrieiev [Wed, 19 Dec 2018 02:15:52 +0000 (11:15 +0900)]
[IOT-3249] Add oic.wk.mnt to DCR list

Change-Id: I050e6d137782574c5be40f6cb28081738cafe6dd
Signed-off-by: Oleksandr Andrieiev <o.andrieiev@samsung.com>
(cherry picked from commit 17c9e750dd8966bd31aa4ca05f31538e28581f01)

4 months agofix for gcc version 4 and 5 15/29315/2
Oleksandr Dmytrenko [Fri, 1 Mar 2019 12:03:52 +0000 (14:03 +0200)]
fix for gcc version 4 and 5

fix for gcc version 4 and 5

Change-Id: I0d7d020b191c8238e256821a47db0a073649c460
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months agostatic_assert macro fix 14/29314/2
Oleksandr Dmytrenko [Fri, 1 Mar 2019 11:59:42 +0000 (13:59 +0200)]
static_assert macro fix

for gcc 4 that macro does not working

Change-Id: I8761605963ae016a83db3df00378f93c4e971753
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months agopointer check before dereferensing 09/29309/4
Oleksandr Dmytrenko [Thu, 28 Feb 2019 13:43:33 +0000 (15:43 +0200)]
pointer check before dereferensing

targetId check in PMDeleteFromUUIDList before derefensing

Change-Id: I1b1dae4091c5058d018c5cb472d6db2503fecb40
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months agoponter check in secureresourceprovider 10/29310/2
Oleksandr Dmytrenko [Thu, 28 Feb 2019 14:19:05 +0000 (16:19 +0200)]
ponter check in secureresourceprovider

1) removed double check in ProvisionCredentialDosCB1
2) pointer check in registerResultForUnlinkDevices
3) pointer check in SRPGetCredResourceCB

Change-Id: I7227d62034734b5c5207d7e59d69be6de87d4bde
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months agomemory leaks fix 20/29320/3
Oleksandr Dmytrenko [Wed, 6 Mar 2019 16:08:06 +0000 (18:08 +0200)]
memory leaks fix

==29556== 68 (64 direct, 4 indirect) bytes in 1 blocks are definitely lost in loss record 291 of 568
==29556==    at 0x4837B85: calloc (vg_replace_malloc.c:752)
==29556==    by 0x36FE93: OICCalloc (oic_malloc.c:102)
==29556==    by 0x2DB355: CBORPayloadToPstatBin (pstatresource.c:450)
==29556==    by 0x2DB160: CBORPayloadToPstat (pstatresource.c:418)
==29556==    by 0x232EA7: ListMethodsHandler (ownershiptransfermanager.c:1073)

Change-Id: I882b145c0ccf86dfce3736fc24e3c3949a3f00ee
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months agocrosses initialization fix 07/29307/3
Oleksandr Dmytrenko [Thu, 28 Feb 2019 13:29:17 +0000 (15:29 +0200)]
crosses initialization fix

crosses initialization of OCCallbackData(cbData) fix

Change-Id: I13987d9919059f43b9d69865cf3679d28fe896b9
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months agocrosses initialization fix 08/29308/2
Oleksandr Dmytrenko [Thu, 28 Feb 2019 13:38:33 +0000 (15:38 +0200)]
crosses initialization fix

crosses initialization CborValue csrRootMap fix

Change-Id: I7a648d5f88b4e6e8b1ac72437af9e7f65c867403
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
4 months agoInitial version of atomic measurement. 17/29317/1
Herve Jourdain [Wed, 19 Dec 2018 07:45:55 +0000 (15:45 +0800)]
Initial version of atomic measurement.

Implementation of atomic measurements in iotivity, including C, C++ and Java/Android APIs.

Change-Id: Idda2f9f39c98b7307de756774186bbd7fddf434d
Signed-off-by: Herve Jourdain <herve.jourdain@beechwoods.com>
(cherry picked from commit e7aa9277995159e287b9739ae5184ec9b6ccae1a)

4 months ago[IOT-3260] Delete roles at the TLS disconnect 32/27932/8
Aleksey Volkov [Thu, 14 Feb 2019 16:08:34 +0000 (18:08 +0200)]
[IOT-3260] Delete roles at the TLS disconnect

Delete all role credentials at the TLS session closure

Change-Id: Ie51722647d31cc0be9650b1cb2586274519cbe00
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
4 months ago[IOT-3260] SSL close callback 21/27921/7
Oleksii Beketov [Thu, 14 Feb 2019 15:52:31 +0000 (17:52 +0200)]
[IOT-3260] SSL close callback

Added callback to return peer's UUID
on SSL connection closure

Change-Id: Ib31250c639b9c2633e1459f0d555424ca429fb26
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
4 months agoIOT-3266 Demote notification-cpp examples 82/29282/2
Mats Wichmann [Tue, 19 Feb 2019 22:12:50 +0000 (15:12 -0700)]
IOT-3266 Demote notification-cpp examples

Change-Id: I29221ed448cd4da877486bdfd04ddfdbaae4b4d8
Signed-off-by: Mats Wichmann <mats@linux.com>
4 months agoPDMClose and createDb change 14/27914/11
Oleksandr Dmytrenko [Wed, 6 Feb 2019 13:09:36 +0000 (15:09 +0200)]
PDMClose and createDb change

removed check the database pointer in PDMClose and createDb

Change-Id: I1c23276769410a79ec35148c189ea5f5dcce6fe4
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
5 months agojava unsecured build set SECURED=0 01/27901/2
Mats Wichmann [Wed, 30 Jan 2019 17:03:33 +0000 (10:03 -0700)]
java unsecured build set SECURED=0

The current autobuild (CI) for java (linux_unsecured_with_java target)
does not set SECURED=0, probably a holdover from when the default was
an unsecured build. Add SECURED=0 to make sure the Jenkins builds
are testing this combination.

Change-Id: I2db1851c2f9b78a7ffba4474a72c74e5766699d8
Signed-off-by: Mats Wichmann <mats@linux.com>
5 months agocheck pstat in PostProvisioningStatus 19/27919/2
Oleksandr Dmytrenko [Fri, 8 Feb 2019 11:51:10 +0000 (13:51 +0200)]
check pstat in PostProvisioningStatus

check pstat is null before referencing in PostProvisioningStatus

Change-Id: I57c9f5088ceb762930056879c6db16b2b80e9530
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
5 months ago[Easy Setup] Reject UPDATE on not allowed property 88/27788/4
Abhishek Pandey [Fri, 21 Dec 2018 09:06:57 +0000 (14:36 +0530)]
[Easy Setup] Reject UPDATE on not allowed property

[IOT-3231] https://jira.iotivity.org/browse/IOT-3231
Easy Setup Resource does not reject an UPDATE request to add a new Link

Currently only criteria to reject POST on EasySetup Resource
(/EasySetupResURI) is to check if properties are read-only. However,
the POST request may contain additional properties "href", "rep"
representing a link to be added in collection or any other unsupported
properties. Even though these properties are not updated, success
response is sent to client which is not appropriate and is flagged as
CTT failure.

This patch changes the validation logic on /EasySetupResURI for POST
on baseline interface to allow the POST only if payload contains
the writable property "cn". Update to any other property is rejected.

Change-Id: I33f6e7eda33481fa2137341f93b607a837ff5a87
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
5 months ago[Easy Setup] Check required properties for UPDATE 93/27793/3
Abhishek Pandey [Mon, 24 Dec 2018 10:05:14 +0000 (15:35 +0530)]
[Easy Setup] Check required properties for UPDATE

[IOT-3252]
https://jira.iotivity.org/browse/IOT-3252

Per the WiFiConf Schema, for an UPDATE request:
 "required":["tnn", "wat", "wet"]

This means that all three of these Properties must be in every
UPDATE request. If they are not there, the Device is supposed
to reject the request with a 4.xx error. However, IoTivity
responds with a 2.04 Changed response instead currently.

This patch fixes above issue by checking the POST request
for required properties (tnn, wat, wet). If any of these
are not included in POST request, it will be rejected.

Change-Id: I00f02c93cd273a02706c85c5d236584d45d6ca77
Signed-off-by: Abhishek Pandey <abhi.siso@samsung.com>
5 months agoUnittests extend coverage 18/27918/2
Vitalii Irkha [Thu, 7 Feb 2019 15:16:17 +0000 (17:16 +0200)]
Unittests extend coverage

Added certhelper coverage

Change-Id: I6b1a0882b0ba239f22b0eeded57d8c554944c3f0
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
5 months agonull checks in ocprovisioningmanager 16/27916/4
Oleksandr Dmytrenko [Wed, 6 Feb 2019 16:06:25 +0000 (18:06 +0200)]
null checks in ocprovisioningmanager

Check null before reference

Change-Id: I489b8d3ecb44e6bc9b4999ef1b47bd6b9dbf4362
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
5 months ago[IOT-3259] Copy corresponding priv key 04/27904/5
Aleksey Volkov [Thu, 31 Jan 2019 10:14:33 +0000 (12:14 +0200)]
[IOT-3259] Copy corresponding priv key

Search for the corresponding private key among
the ASYMMETRIC_KEY type credentials and copy it
to the appropriate SIGNED_ASYMMETRIC_KEY type
credential

Change-Id: I7b2f595671261708dc0a0769cd8ccb72de0918be
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
5 months ago[IOT-3256] uuid with no prefix 00/27900/9
Oleksii Beketov [Wed, 6 Feb 2019 14:50:06 +0000 (16:50 +0200)]
[IOT-3256] uuid with no prefix

If CN has no "uuid:" or "userid:" prefix, treat whole CN as uuid

Change-Id: I3e90f2a65f3a82c861c28284ca32fd95e9a4cd23
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Bug: https://jira.iotivity.org/browse/IOT-3256

5 months agoUnittests increase coverage 70/27870/8
Vitalii Irkha [Mon, 21 Jan 2019 09:28:11 +0000 (11:28 +0200)]
Unittests increase coverage

Increase coverage

Change-Id: I838b726e26cf0e54fa67cfd383ed350d4b72fc94
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
5 months ago[IOT-3256] Change log level 06/27906/3
Aleksey Volkov [Thu, 31 Jan 2019 15:30:47 +0000 (17:30 +0200)]
[IOT-3256] Change log level

Switch log level from ERROR to DEBUG
in the IsEmptyCred() implementation
due to misinterpretationq

Change-Id: I7124299fcc210c0531c28c0cceb31070cbd601a4
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
5 months agoFix missing initializer in PinOxmData 08/27908/3
Vitalii Irkha [Fri, 1 Feb 2019 09:24:47 +0000 (11:24 +0200)]
Fix missing initializer in PinOxmData

Added initializer for newDevice member

Change-Id: I71b300b6def75fb282fccdcdc7b55a020b91c976
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
5 months agoBuild fix if flags SECURED=0 WITH_CLOUD=1 used 96/27896/5
Vitalii Irkha [Tue, 29 Jan 2019 10:38:33 +0000 (12:38 +0200)]
Build fix if flags SECURED=0 WITH_CLOUD=1 used

Fixed dependencies to cloud library

Change-Id: Idee7ee12f1d3c8bef5cb1b0fa8a599d36320484e
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
5 months agoprovisioning database manager fix 95/27895/3
Oleksandr Dmytrenko [Tue, 29 Jan 2019 10:31:17 +0000 (12:31 +0200)]
provisioning database manager fix

check global the database pointer(p_db) before usage to avoid memory leaks

Change-Id: I55ccf40eb0fa6b32a2467cca7f713bca8b704191
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
5 months agoFix OCResourceResponseTest warning 85/27485/5
Mats Wichmann [Fri, 16 Nov 2018 17:13:51 +0000 (10:13 -0700)]
Fix OCResourceResponseTest warning

gcc8.1 is fussier about getting strncpy right, as it gripes on this line:

    strncpy(request.query, query, sizeof(query));

It issues this warning:

resource/unittests/OCResourceResponseTest.cpp:83:39: warning: argument to 'sizeof' in 'char* strncpy(char*, const char*, size_t)' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]

Stack code uses OICStrcpy for safer string copying, but without
fiddling further with dependencies, that function is not available
in this scope, so kept the strncpy but changed the the length
to be based on the destination.

Qualify the two strings with const while we're at it.

Change-Id: I7ed0010a6daeda6f6db4337b9a0babc5e0dce968
Signed-off-by: Mats Wichmann <mats@linux.com>
5 months agoSubjectuuid wildcard fix 92/27892/3
Aleksey Volkov [Mon, 28 Jan 2019 14:17:26 +0000 (16:17 +0200)]
Subjectuuid wildcard fix

subjectuuid field of credential entry is changing in case of it has
'*' or zeroid value and credential type is 'SIGNED_ASYMMETRIC_KEY'.

For the trustca credusage this cause a verification error.

Change-Id: I889d9e982b5be5fea1d872eebb83734288cde3e6
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
5 months agoShow how to make examples non-default 49/27849/3
Mats Wichmann [Thu, 10 Jan 2019 16:46:09 +0000 (09:46 -0700)]
Show how to make examples non-default

A scheme is introduced which allows separating targets indended to
be built by default from ones not intended to be built by default.
One example is converted to show how it works.

Since this makes use of added methods (extending scons' own API),
took the opportunity to properly document these, and added a
documentation file in a new doc subdirectory to make it easier
for developers to find out about these methods.

Also added a debug scheme, which makes it more clear where to
put tracing statements in between the two passes of scons -
the script is invoked at the very end of the scan pass, before
the build pass begins but when everything should be defined.

Change-Id: I0a636fa34c18ace23720f22bfdd8511afa611ddb
Signed-off-by: Mats Wichmann <mats@linux.com>
5 months agosome errors fix 74/27874/5
Oleksandr Dmytrenko [Tue, 22 Jan 2019 13:42:28 +0000 (15:42 +0200)]
some errors fix

crosses initialization and invalid conversion errors fix

Change-Id: I55cce4178f14eb1a7e5b45704650696d18b9ddec
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
5 months agocrach fix in GetOwnCert 73/27873/2
Oleksandr Dmytrenko [Tue, 22 Jan 2019 13:26:04 +0000 (15:26 +0200)]
crach fix in GetOwnCert

crach fix in GetOwnCert, in debug mode in case null chain

Change-Id: I2c394a1953b8b20015c53607325b5181750bf564
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
5 months ago[IOT-3255] OCF profile CA cert check 71/27871/1
Oleksii Beketov [Mon, 21 Jan 2019 13:29:22 +0000 (15:29 +0200)]
[IOT-3255] OCF profile CA cert check

CA root cert check added to OCF profile chain validation

Change-Id: I4b33d8487f2064cb019dbd25df922b835098a4fc
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Bug: https://jira.iotivity.org/browse/IOT-3255

6 months agoTERM must be set in the environment for gradle. 35/27735/3
Herve Jourdain [Tue, 15 Jan 2019 20:14:26 +0000 (04:14 +0800)]
TERM must be set in the environment for gradle.

Otherwise, Android build fails complaining TERM is not set.

Change-Id: Ibf92b2eca73c71c249d313614ab0ae611ea4f524
Signed-off-by: Herve Jourdain <herve.jourdain@beechwoods.com>
6 months ago[IOT-3245] Update Security OIDs with extra .0 54/27854/3
Jeremy Rover [Fri, 11 Jan 2019 01:23:44 +0000 (17:23 -0800)]
[IOT-3245] Update Security OIDs with extra .0

Change-Id: Ib032c9b2b35b2ef3c23bb9a9cedba46e5aacd4da
Signed-off-by: Jeremy Rover <jeremy.rover@intel.com>
Bug: https://jira.iotivity.org/browse/IOT-3245

6 months agoFixed Android OcPlatform.Shutdown() does not work. 82/27782/2
Herve Jourdain [Thu, 20 Dec 2018 03:31:02 +0000 (11:31 +0800)]
Fixed Android OcPlatform.Shutdown() does not work.

Android OcPlatform.Shutdown() API does not work properly, because in
the case of Android, start() is called twice: once by the Android
Configure API, which is normal and needed, and once by the constructor
for OcPlatform_impl()!
This last one is due to the fact that useLegacyCleanup is still set
to true in the PlatformConfig used by Android, which is one of the
2 non-deprecated ones.
Comments say that the flag is set to false by default, unless a
legacy constructor is used. But this is obviously not a legacy
constructor, and the flag was erroneously set to true...
With this fix, Android OcPlatform.Shutdown() works as expected.

Change-Id: I3db4c37ff17c9f16ea927093c8aa2806e1cabb90
Signed-off-by: Herve Jourdain <herve.jourdain@beechwoods.com>
6 months ago[IOT-3150] Remove doxm.owned from OT 47/27847/3
Aleksey Volkov [Thu, 10 Jan 2019 07:23:37 +0000 (09:23 +0200)]
[IOT-3150] Remove doxm.owned from OT

Don't change doxm.owned flag at the
ownership transfer process from the
client side.
BZ 2692

Change-Id: Ia26a44d757a675697f5714d939e6c33145958344
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
6 months ago[IOT-3150] Set doxm.owned as read-only 80/27780/3
Aleksey Volkov [Wed, 19 Dec 2018 16:19:43 +0000 (18:19 +0200)]
[IOT-3150] Set doxm.owned as read-only

BZ 2692 - "owned" of "/oic/sec/doxm"
should be set by Device itself

- Set access mode to Read-Only
- Set value to TRUE, when the device switches to RFPRO, RFNOP
- Set value to FALSE, when the device switches to RESET, RFOTM

Change-Id: I0dd9112150fb2f20e4bdda90d56c9352ccdac0d8
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
6 months agoMerge test folder of test branch 98/27798/2
Mushfiqul Islam Antu [Thu, 27 Dec 2018 06:41:57 +0000 (12:41 +0600)]
Merge test folder of test branch

This patch enables all test activities and commits to be
maintained from master branch, instead of test branch.

Change-Id: I2d9123dbd605f0e91eb6d91282057de8735b20a7
Signed-off-by: Mushfiqul Islam Antu <i.mushfiq@samsung.com>
7 months ago[IOT-3121] Fix rts values of Collection Resource 37/27637/1 feat-linkupdate-and-collection-access-control
Mushfiqul Islam Antu [Fri, 30 Nov 2018 09:13:51 +0000 (15:13 +0600)]
[IOT-3121] Fix rts values of Collection Resource

For baseline response of collection, value of rt & rts
are same for current implementation, which is wrong.
rts should reflect the resource types of the chlidren
of the collection.

Change-Id: Ib4e768c7401247dc9dd4917ff5a611396e8e07a2
Signed-off-by: Mushfiqul Islam Antu <i.mushfiq@samsung.com>
7 months agoIOT-3244 configurable JMX_HOSTNAME 33/27633/1
Peter Rafaj [Mon, 3 Dec 2018 08:39:14 +0000 (09:39 +0100)]
IOT-3244 configurable JMX_HOSTNAME

Change-Id: I707c2db52492f7585aed307f3a47c6e14824c0b3
Signed-off-by: Peter Rafaj <peter.rafaj@kistler.com>
7 months agoMerge branch 'iotivity-cloud' reverify 85/27585/2 feat-bridging-zigbee
Ondrej [Tue, 27 Nov 2018 06:36:10 +0000 (07:36 +0100)]
Merge branch 'iotivity-cloud' reverify

Change-Id: Iacf81170fac09e4f7e9b7f6f4f51eb0182db1ce3
Signed-off-by: Ondrej Tomcik <ondrej.tomcik@kistler.com>
7 months ago IOT-3234 fix discovery request creating 55/27555/2 iotivity-cloud
Peter Rafaj [Mon, 12 Nov 2018 15:22:03 +0000 (16:22 +0100)]
 IOT-3234 fix discovery request creating

Change-Id: I1a2c2ce90555fa8c7049d0986ac8806c29013f48
Signed-off-by: Peter Rafaj <peter.rafaj@kistler.com>
7 months agoIOT-3234 Add support for new sec URI in AS 53/27553/1
Peter Rafaj [Fri, 23 Nov 2018 11:57:46 +0000 (12:57 +0100)]
IOT-3234 Add support for new sec URI in AS

Change-Id: I1a851e83c2570c736be2b3c7a2172337f8520271
Signed-off-by: Peter Rafaj <peter.rafaj@kistler.com>
8 months ago[IOT-3229] Reset mbedtls verify callback 99/27499/1
Aleksey Volkov [Tue, 20 Nov 2018 08:22:36 +0000 (10:22 +0200)]
[IOT-3229] Reset mbedtls verify callback

Reset X509 verify callback in the global
mbedtls context in case if the identity
callback isn't set.

Change-Id: Ib1abfa00753b971d4eda85cfc18ebcc3a7b0707d
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
8 months ago[IOT-3055]Fixed Handle collection resource payload 99/27299/14
koushik.girijala [Mon, 22 Oct 2018 10:01:16 +0000 (15:31 +0530)]
[IOT-3055]Fixed Handle collection resource payload

Fixed Handle collection resource payload for all interfaces
And also fixed batch interface for normal respources

Change-Id: I35c11597f2f55d1e3d40317209fe127cdd076d46
Signed-off-by: koushik.girijala <g.koushik@samsung.com>
8 months agowebos: Avoid unused parameter warning 83/26983/4
Yi-Soo An [Thu, 20 Sep 2018 03:29:36 +0000 (12:29 +0900)]
webos: Avoid unused parameter warning

To avoid unused parameter warning at compile-time,
cast the parameter to void type.

Change-Id: I4559b6ad06dc6ccfd304561015d9a184108dea11
Signed-off-by: Yi-Soo An <yisooan@gmail.com>
8 months ago[IOT-1947][IOT-2761][IOT-3228] Rm PEM/DER convert 83/22983/19
Oleksii Beketov [Mon, 5 Nov 2018 13:21:23 +0000 (15:21 +0200)]
[IOT-1947][IOT-2761][IOT-3228] Rm PEM/DER convert

PEM/DER casting removed, allowing  mbedtls to manage
certificate conversion by itself. Credresource loads
certificates that could be either PEM or DER encoded
to a linked list instead of pushing them to a buffer.

Change-Id: I200f9ef8798b20bf894b8ef2cf85e42e13749f38
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
8 months ago[IOT-3219] Prevent Iotivity crash at OTM 19/27319/3
Aleksey Volkov [Wed, 24 Oct 2018 12:10:12 +0000 (15:10 +0300)]
[IOT-3219] Prevent Iotivity crash at OTM

Change-Id: Ia3436b8ea9da299084b770c4cd048f626a5d7d5a
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
8 months ago[IOT-3219][IOT-3220] Restore default handlers 35/27335/2
Aleksey Volkov [Mon, 29 Oct 2018 14:48:59 +0000 (16:48 +0200)]
[IOT-3219][IOT-3220] Restore default handlers

Restore default TLS handlers immediatelly after PSK generation
in case of MFG OTM

Change-Id: Idfce0bf8e2b6741d0a64a8f0143e2eb955e7167e
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
8 months ago[IOT-3220] Restore callbacks at reset 03/27303/2
Aleksey Volkov [Mon, 22 Oct 2018 13:35:49 +0000 (16:35 +0300)]
[IOT-3220] Restore callbacks at reset

- Restore pkix, psk, identity callbacks at internal reset
- Revert [IOT-3140] related changes, since all callbacks now
  restored in SRMInitSecureResources for both reset cases

Change-Id: Ibc859c8ee26ae9f914859e27d5ea2b2491f03bf6
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
8 months ago[IOT-3216] Fix /SP resource section write to PS 79/27379/2
Aleksey Volkov [Fri, 2 Nov 2018 14:32:44 +0000 (16:32 +0200)]
[IOT-3216] Fix /SP resource section write to PS

Fixed `copy-paste` typo due to which SP resource write was skipped ..

Change-Id: I1756a41f93a82b57a02d1c0641995fcf36fe5fa3
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
8 months ago[IOT-3224] Remove RO params from the request 51/27351/4
Aleksey Volkov [Wed, 31 Oct 2018 13:58:36 +0000 (15:58 +0200)]
[IOT-3224] Remove RO params from the request

cm, isop fields removed from POST request
to the /pstat resource at OTM time

Change-Id: Ife3771fb5676a495df96e21d08d8bf20aa9364f5
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
8 months agocloud: Update dependency 51/27251/3
Philippe Coval [Tue, 16 Oct 2018 21:36:52 +0000 (23:36 +0200)]
cloud: Update dependency

Fix vulnerabilities

Change-Id: I3f772edb78369d7583b86c060d59cb787ec905b0
Forwarded: https://gerrit.iotivity.org/gerrit/#/c/27251
Signed-off-by: Philippe Coval <p.coval@samsung.com>
8 months agoIOT-3227 update unit test for rd,ci,as services 49/27349/1
Peter Rafaj [Wed, 31 Oct 2018 13:18:29 +0000 (14:18 +0100)]
IOT-3227 update unit test for rd,ci,as services

Change-Id: Ibc8afa347c5291b4560c98c14196c97a9bccc30d
Signed-off-by: Peter Rafaj <peter.rafaj@kistler.com>
8 months agoFix for connecting to TCP IPv6 socket 97/27297/6
koushik.girijala [Mon, 22 Oct 2018 07:57:16 +0000 (13:27 +0530)]
Fix for connecting to TCP IPv6 socket

Change-Id: I87700d134585a6088e21e5f33d5049ffd62f4fa8
Signed-off-by: koushik.girijala <g.koushik@samsung.com>
8 months ago[IOT-3006] add WES and CNC Resources to DCRs 59/27259/4
Nathan Heldt-Sheller [Wed, 17 Oct 2018 12:05:19 +0000 (05:05 -0700)]
[IOT-3006] add WES and CNC Resources to DCRs

The WES and CNC Resources should be in the list of
Device Configuration Resources.

Change-Id: I889f68cf87ee0b074ff341262a0de037af8a15fa
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
8 months agoadd optional cert extensions 85/27285/7
Steven Saunders [Tue, 2 Oct 2018 17:52:33 +0000 (11:52 -0600)]
add optional cert extensions

Change-Id: I11ee97610c01f464dba896e600c71831629650bc
Signed-off-by: Steven Saunders <s.saunders-contractor@cablelabs.com>
8 months agoSeparate non-core tizen builds for Jenkins 93/27293/1
Mats Wichmann [Sun, 21 Oct 2018 15:06:09 +0000 (09:06 -0600)]
Separate non-core tizen builds for Jenkins

The continuous integration system for IoTivity builds the targets
tizen_secured and tizen_unsecured as defined in auto_build.py.  These two
not only do a full build of tizen, but also several extra builds of
samples as defined in the build_tizen function.  This change separates the
extra builds into separate targets so a developer can still easily
call them, but they will not be part of the required CI build on
every change submitted to gerrit.

Change-Id: I1c8846e74afb2eb18532baa64543e320ef045ba9
Signed-off-by: Mats Wichmann <mats@linux.com>
9 months ago[IOT-3203] keyUsage digitalSignature bit 61/27261/1
Nathan Heldt-Sheller [Wed, 17 Oct 2018 12:26:49 +0000 (05:26 -0700)]
[IOT-3203] keyUsage digitalSignature bit

Per CR 2611, CA and SubCA Certificates may (or may not) include
the keyUsage "digitalSignature" bit.  This change removes that
bit from the list of disallowed bits.

Change-Id: Ib70b838518bf2375be7b4ade9b5ab9d98cb397e9
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
9 months agoIOT-3215 Update RD PRESENCE_TABLE 43/27243/1
Peter Rafaj [Tue, 18 Sep 2018 13:13:24 +0000 (15:13 +0200)]
IOT-3215 Update RD PRESENCE_TABLE

Change-Id: I30577905978c91cbb2e2f223f0ea1cbb1ce12a0e
Signed-off-by: Peter Rafaj <peter.rafaj@kistler.com>
9 months agoIOT-3214 rd mongo query optimalisation - reverify 37/27237/2
Peter Rafaj [Fri, 7 Sep 2018 12:06:33 +0000 (14:06 +0200)]
IOT-3214 rd mongo query optimalisation - reverify

Change-Id: I5f30ae3625463bf3bc6760c80447b481e6f1d4e2
Signed-off-by: Peter Rafaj <peter.rafaj@kistler.com>
9 months agoIOT-3213 Handle reset code properly 35/27235/1
Ondrej [Wed, 5 Sep 2018 08:39:53 +0000 (10:39 +0200)]
IOT-3213 Handle reset code properly

Change-Id: I728588ab5852da4cefa7a8a5b565875522d6ccc4
Signed-off-by: Peter Rafaj <peter.rafaj@kistler.com>