platform/upstream/iotivity.git
4 years agoAdd missing compile secure option in CXXFLAGS 41/217441/1 accepted/tizen/unified/20191112.125129 submit/tizen/20191112.082050
DoHyun Pyun [Mon, 11 Nov 2019 04:43:33 +0000 (13:43 +0900)]
Add missing compile secure option in CXXFLAGS

Change-Id: I1f162580ca001bd83532c459e78ae1fd3473f2fb
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoUpdate snapshot_history.txt 01/216601/3 accepted/tizen/unified/20191101.042101 submit/tizen/20191031.021857
Sudipto [Tue, 29 Oct 2019 08:01:40 +0000 (13:31 +0530)]
Update snapshot_history.txt

Change-Id: I855c4a7941f0e690df1e8caacbfa36dae37e7e02
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoSet socket family for IPv4 00/216600/3
Senthil Kumar G S [Thu, 24 Oct 2019 07:11:00 +0000 (12:41 +0530)]
Set socket family for IPv4

Patch for [CONPRO-1509] https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/588 has a bug
due to which the following error comes in Tizen Platform.

"01-01 11:43:56.060+0900 E/OIC_CA_TCP_SERVER_1023(P 2022, T 2031): catcpserver.c:
CATCPCreateSocket(1029) > bind socket failed: Address family not supported by protocol"

Reason: Address family is not set.

This patch fixes the issue.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/992729fd6eab4f1b57280f6502ce09d460ace39c
(cherry-picked from 992729fd6eab4f1b57280f6502ce09d460ace39c)

Change-Id: I98edd8c18ec8183bd2208d587599bf9ae294db12
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoTCP Socket Bind API 99/216599/3
Kush [Mon, 14 Oct 2019 15:32:34 +0000 (21:02 +0530)]
TCP Socket Bind API

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/593
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/588/commits/1f7cb27e719bfd876fd0ff900747eeb3d7210d46
(cherry-picked from 1f7cb27e719bfd876fd0ff900747eeb3d7210d46)

Change-Id: I48954a2caa59d95464a29a257c67b38325b64d12
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoBuild fix for visual display files 98/216598/3
samanway [Mon, 21 Oct 2019 13:28:09 +0000 (18:58 +0530)]
Build fix for visual display files

- There was an undefined LOG TAG used in Caleclient_vd.c file
- Replaced that with another predefined TAG

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/591/commits/87dc9af44ba4e3cbf7ae87dcb5bb29434a6c672d
(cherry-picked from 87dc9af44ba4e3cbf7ae87dcb5bb29434a6c672d)

Change-Id: Ic4b5c7de3b92309d925261058bb6abe93ddce3f6
Signed-off-by: samanway-dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoNew APIs to configure TCP Socket Keep-Alive. 97/216597/3
Senthil Kumar G S [Mon, 14 Oct 2019 06:46:30 +0000 (12:16 +0530)]
New APIs to configure TCP Socket Keep-Alive.

Added new APIs to enable TCP keep alive, set and unset configuration parameters.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/587/commits/731061249edabbf05b9e8cb4a35f7dfe41009183
(cherry-picked from 731061249edabbf05b9e8cb4a35f7dfe41009183)

Change-Id: Id63c1796832dcea842e0b059c977a38d307e27a5
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoFix for SVACE Issues 96/216596/3
Sudipto [Tue, 29 Oct 2019 07:48:31 +0000 (13:18 +0530)]
Fix for SVACE Issues

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/580/commits/ba60a95ac03fc844ec9ff22558624982d865f4f0
(cherry-picked from ba60a95ac03fc844ec9ff22558624982d865f4f0)

Change-Id: Iddefe17f317f724831aca9f7d943cee0133cbcc8
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoCrash in Select 95/216595/2
sourav bhuwalka [Mon, 14 Oct 2019 16:27:56 +0000 (21:57 +0530)]
Crash in Select

Fixing bug in counter of CAPollReturned in case of shutdownFds socket
for ipserver and also introducing sleep between each subsequent
poll system call whenever the system remains idle.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/583/commits/817a3e30d2c7f2fa6064cdfd13fc8a9294a5d956
(cherry-picked from 817a3e30d2c7f2fa6064cdfd13fc8a9294a5d956)

Change-Id: I4b6e96334fdb0c06fee2c4ce3099df9bf04ebaf3
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoRemove the white space in caleadapter.c 55/215655/1
DoHyun Pyun [Mon, 14 Oct 2019 04:18:39 +0000 (13:18 +0900)]
Remove the white space in caleadapter.c

Change-Id: I8739accdfe8f6e481847a2ed2019a237c4120aad
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoRemove the white space in snapshot_history.txt 54/215654/1
DoHyun Pyun [Mon, 14 Oct 2019 04:18:10 +0000 (13:18 +0900)]
Remove the white space in snapshot_history.txt

Change-Id: I109b611ded748feb30f5d3f2b37f9695e6fecdb7
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoCONPRO-1467: Improve Reset 35/215635/1 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.011923 accepted/tizen/5.5/unified/mobile/hotfix/20201027.074315 accepted/tizen/unified/20191015.011920 submit/tizen/20191014.014400 submit/tizen_5.5/20191031.000007 submit/tizen_5.5_mobile_hotfix/20201026.185107 tizen_5.5.m2_release
Oleksii Beketov [Mon, 5 Aug 2019 10:55:24 +0000 (13:55 +0300)]
CONPRO-1467: Improve Reset

Enable complete SVR DB reset on OTM error.
Recently, only pstat and doxm resources has been reset.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/552
(cherry-picked from 8c20c75f22a5e81c9c7814eaf18e5f7c73aca7b6)

Change-Id: I18a7a2accd82c51a57e14cd65b91431d5b5b84eb
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoCrash in select 34/215634/1
sourav bhuwalka [Wed, 9 Oct 2019 17:19:09 +0000 (22:49 +0530)]
Crash in select

When the system remains idle i.e. there is no exchange of data then
poll would be called repeatedly very fast.some of the fields/parameters
inside poll are not getting set/reset by kernel on calling repeatedly.
So applying a sleep whenever poll gets timed out.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/585
(cherry-picked from 4cc2d76d5835a4ccb9d7a7569376e8d0938db264)

Change-Id: I33dca282cdc9406d543b8f887bb8a5f576b7f4b3
Signed-off-by: sourav bhuwalka <s.bhuwalka@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMerge "Enable GATT server indication for Tizen Speaker" into tizen
Pyun DoHyun [Mon, 14 Oct 2019 01:15:09 +0000 (01:15 +0000)]
Merge "Enable GATT server indication for Tizen Speaker" into tizen

4 years agoFix for SVACE defects 33/215633/1
samanway [Wed, 25 Sep 2019 14:26:12 +0000 (19:56 +0530)]
Fix for SVACE defects

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/581
(cherry-picked from 0c9a4bdc0e7a2bfd4bbd2168366281b8741c2e29)

Change-Id: Ia5554e93f8b913f10053bf4a09bb3b1bd7dbb8ce
Signed-off-by: samanway-dey <samanway,dey@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoCrash at CADestroyDataSet() 32/215632/1
sourav bhuwalka [Thu, 26 Sep 2019 18:10:08 +0000 (23:40 +0530)]
Crash at CADestroyDataSet()

Setting info->token to NULL after free to avoid double free

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/582
(cherry-picked from 3fb0338b52b04ee58f12bb46f27ef20cf12c2d47)

Change-Id: If6268f9ebb9965b84809c54d38b3b3826cf51830
Signed-off-by: sourav bhuwalka <s.bhuwalka@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMove CASetSecureEndpointUuid APIs 31/215631/1
Jaehong Jo [Wed, 18 Sep 2019 08:08:55 +0000 (17:08 +0900)]
Move CASetSecureEndpointUuid APIs

Since this API is used externally,
moved it to the cautil header instead of the security header.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/577
(cherry-picked from 991775c94943140fd72ee564f142aee55df058ac)

Change-Id: I5d3221dcdb69d720fbd77bcbda878c2b20cba9dc
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoEnable GATT server indication for Tizen Speaker 95/213895/6
Anupam Roy [Thu, 19 Sep 2019 01:24:11 +0000 (10:24 +0900)]
Enable GATT server indication for Tizen Speaker

Change-Id: I7511f1ab1d2b010e0caf353ee51ef8eea67e244c
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
4 years agoupdated snapshot_history.txt 62/214862/1
himanshu [Fri, 27 Sep 2019 07:03:11 +0000 (12:33 +0530)]
updated snapshot_history.txt

Change-Id: I52cad3afcfa36dbd1f8ab5f2ffbe116229a4873a
Signed-off-by: himanshu <h.himanshu@samsung.com>
4 years agoFix for destroying gatt client in case of error. 61/214861/1
Kush [Thu, 19 Sep 2019 08:39:01 +0000 (14:09 +0530)]
Fix for destroying gatt client in case of error.

Client Handle was not destroyed.
Because of that from second time onwards client handle was not getting created.
MTU size was set to default and bt buffer overflow error was coming.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/578/commits/e51cc0061628ab0fb7710ed3a5c3df08b61e2d5a
(cherry-picked from e51cc0061628ab0fb7710ed3a5c3df08b61e2d5a)

Change-Id: I65e5092c8b9c230b4394dd6239706b5f2d28fd36
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: himanshu <h.himanshu@samsung.com>
4 years agoRemove a dependency of the deprecated wifi API 19/214819/1 accepted/tizen/unified/20190929.221425 submit/tizen/20190927.051042
DoHyun Pyun [Thu, 26 Sep 2019 22:34:50 +0000 (07:34 +0900)]
Remove a dependency of the deprecated wifi API

Wifi API deprecated, and wifi manager API is used in Tizen.
So remove the dependency and replace APIs to wifi manager.

Change-Id: I12930bd63c80d2c2570a2461d4f393ee1ae8b66c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoMerge "Updated snapshot_history.txt" into tizen accepted/tizen/unified/20190924.062108 submit/tizen/20190923.064511
Pyun DoHyun [Mon, 23 Sep 2019 06:04:21 +0000 (06:04 +0000)]
Merge "Updated snapshot_history.txt" into tizen

4 years agoMerge "[CONPRO-1483] Implementation of API for setting scanfilter UUIDs" into tizen
Pyun DoHyun [Mon, 23 Sep 2019 06:04:14 +0000 (06:04 +0000)]
Merge "[CONPRO-1483] Implementation of API for setting scanfilter UUIDs" into tizen

4 years agoMerge "Enabling build of simpleclientblescan application" into tizen
Pyun DoHyun [Mon, 23 Sep 2019 06:04:09 +0000 (06:04 +0000)]
Merge "Enabling build of simpleclientblescan application" into tizen

4 years agoMerge "SimpleClient Android Application change for BLE" into tizen
Pyun DoHyun [Mon, 23 Sep 2019 06:04:02 +0000 (06:04 +0000)]
Merge "SimpleClient Android Application change for BLE" into tizen

4 years agoMerge "Adding Retry logic for LUX disconnection issue" into tizen
Pyun DoHyun [Mon, 23 Sep 2019 06:03:56 +0000 (06:03 +0000)]
Merge "Adding Retry logic for LUX disconnection issue" into tizen

4 years agoMerge "[CONPRO-1471]Adding logic for caching MTU in tizen LE Server" into tizen
Pyun DoHyun [Mon, 23 Sep 2019 06:03:49 +0000 (06:03 +0000)]
Merge "[CONPRO-1471]Adding logic for caching MTU in tizen LE Server" into tizen

4 years agoMerge "Memory leak fixes" into tizen
Pyun DoHyun [Mon, 23 Sep 2019 06:03:42 +0000 (06:03 +0000)]
Merge "Memory leak fixes" into tizen

4 years agoUpdated snapshot_history.txt 85/214385/1
Sudipto [Fri, 20 Sep 2019 17:43:27 +0000 (23:13 +0530)]
Updated snapshot_history.txt

Change-Id: I74821c7fb5c5b33d0a08752d5f7b4ca1593dd0b9
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoEnabling build of simpleclientblescan application 83/214383/1
samanway [Tue, 17 Sep 2019 06:20:50 +0000 (11:50 +0530)]
Enabling build of simpleclientblescan application

A new android application "simpleclientblescan" was added recently
in commit 6d7c44e1c073d74ff117a456007156214b310f1c - The new app is
for android BLE client side, which enables BLE scan in app, and it will
show other devices around - User can select one from the list of devices
shown by app, app will connect to it - In this commit enabling the build
of the application

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/576/commits/7aa9c33abad299afed842f192dad6ef1e5d8dbac
(cherry-picked from 7aa9c33abad299afed842f192dad6ef1e5d8dbac)

Change-Id: Iad103f1397efb0c59693cad19fa597c0a725f65b
Signed-off-by: samanway-dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoSimpleClient Android Application change for BLE 82/214382/1
samanway [Tue, 3 Sep 2019 08:01:03 +0000 (13:31 +0530)]
SimpleClient Android Application change for BLE

This patch is to provide BLE scanning functionality in Android BLE client side.

- First application will start BLE scan for nearby devices.
- Then app will provide list of BLE devices which are advertising.
- Then user will select a device and app will internally connect to it.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/563/commits/6d7c44e1c073d74ff117a456007156214b310f1c
(cherry-picked from 6d7c44e1c073d74ff117a456007156214b310f1c)

Change-Id: I6efd7762ddb33c1e3dee2f2c225c8231d4381b93
Signed-off-by: samanway-dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoAdding Retry logic for LUX disconnection issue 81/214381/1
Samanway Dey [Mon, 1 Jul 2019 14:10:17 +0000 (19:40 +0530)]
Adding Retry logic for LUX disconnection issue

 -Added retry logic for LUX disconnection issue
 -There is a mutex unlock placed under wrong nested block,
which will be corrected in a separate commit

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/530/commits/25ef240cc9978fa5945a26e72a8e763c436960db
(cherry-picked from 25ef240cc9978fa5945a26e72a8e763c436960db)

Change-Id: If2ff7023db999d4bf160501014af5ec559f5bd8d
Signed-off-by: Samanway Dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoMemory leak fixes 79/214379/1
Vitalii Irkha [Mon, 16 Sep 2019 10:44:38 +0000 (13:44 +0300)]
Memory leak fixes

Memory leak fixes in sec. res. provider

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/e7985fedfadaa0fc1371c8a0fc376c9d85fafaac
(cherry-picked from e7985fedfadaa0fc1371c8a0fc376c9d85fafaac)

Change-Id: Iabb45f6c26ed1559314922e31871c0077522fb85
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoChanges in spec file for WITH_PROCESS_EVENT flag 16/214016/1 accepted/tizen/unified/20190918.010311 submit/tizen/20190917.081538
DoHyun Pyun [Tue, 17 Sep 2019 07:24:42 +0000 (16:24 +0900)]
Changes in spec file for WITH_PROCESS_EVENT flag

Apply the change into packaging/iotivity.spec

Change-Id: I4dbe93f535c2f6a725af363b291df25f73db33dd
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agombedTLS CVE fix 00/214000/1
Oleksii Beketov [Fri, 31 May 2019 12:14:05 +0000 (15:14 +0300)]
mbedTLS CVE fix

Added mitigations for CVE-2018-0497,
CVE-2018-0498, CVE-2018-0488, CVE-2018-0487

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/518
(cherry-picked from ac312d7f123f8a0c0992577efd3a2d55c73e93cd)

Change-Id: I8b0bd22bc5c5888e0cded89d6445d4c6e6ca1850
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoUpdate snapshot_history.txt 94/213994/1
Sudipto [Tue, 17 Sep 2019 06:34:07 +0000 (12:04 +0530)]
Update snapshot_history.txt

Change-Id: Ifd8bfc18448df8eb7348a41fdc92b3cd88bf1edc
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoSvace memory leak fixes 91/213991/1
Vitalii Irkha [Tue, 10 Sep 2019 16:05:52 +0000 (19:05 +0300)]
Svace memory leak fixes

Fix memory leaks

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/12fafe1b6a94b3a7032bae5745143c246f79129f
(cherry-picked from 12fafe1b6a94b3a7032bae5745143c246f79129f)

Change-Id: I2015af65b4c865377db746e232842b4d52df1545
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoMemleak fix 90/213990/1
Oleksii Beketov [Tue, 10 Sep 2019 12:11:00 +0000 (15:11 +0300)]
Memleak fix

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/9ea7c80e82baee3f896d31f31397e8d6b92afa25
(cherry-picked from 9ea7c80e82baee3f896d31f31397e8d6b92afa25)

Change-Id: Id194ae5ee25c1fb48c4a177836dec2a138d0869f
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoDelete client callback for error response. 89/213989/1
Senthil Kumar G S [Mon, 9 Sep 2019 12:36:31 +0000 (18:06 +0530)]
Delete client callback for error response.

After invoking application's callback from HandleCAErrorResponse(),
client callback is not removed from client callback list ('cbList').
This patch removes it.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/2aed3ca47526d7cb49e779ce3d4bab925738ed40
(cherry-picked from 2aed3ca47526d7cb49e779ce3d4bab925738ed40)

Change-Id: I4e1732a3b47ba2879e02ad91577bb21264c764ae
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years ago[CONPRO-1471]Adding logic for caching MTU in tizen LE Server 80/214380/1
Kush [Tue, 10 Sep 2019 16:52:41 +0000 (22:22 +0530)]
[CONPRO-1471]Adding logic for caching MTU in tizen LE Server

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/573/commits/6e689edd472e098a873b64549006d026e597c667
(cherry-picked from 6e689edd472e098a873b64549006d026e597c667)

Change-Id: I8a7f8a5eee882894ac27cd98f501fe49345931ca
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoFix for android build failure. 88/213988/1
Senthil Kumar G S [Fri, 6 Sep 2019 12:51:37 +0000 (18:21 +0530)]
Fix for android build failure.

Background:
Recently, an API was added to retrieve the some internal values in TCP socket.
This requirement was from VD and hence it was verified on Tizen platform.
PR(merged): https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/537

There is a build issue on android because <ifaddrs.h> which is used in the above patch
is not available in android-21.

Solution:
Made the corresponding API to be available only for Tizen platform.

Change-Id: Idd64911aee0f817353c3376127f53a5ac8efe650
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agosvace fixes 87/213987/1
Aleksey Volkov [Thu, 5 Sep 2019 17:22:22 +0000 (20:22 +0300)]
svace fixes

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/dfdaf037df98fbd0c8b659fccdfe0384bb466547
(cherry-picked from dfdaf037df98fbd0c8b659fccdfe0384bb466547)

Change-Id: Ic0361d29c7bc8f0aa4708ec103728e968b430a42
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoSvace issues fixed 86/213986/1
Iurii Metelytsia [Fri, 6 Sep 2019 10:40:34 +0000 (13:40 +0300)]
Svace issues fixed

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/8a9bc2e8d74f6dffab3719120c45f0f7725c1b85
(cherry-picked from 8a9bc2e8d74f6dffab3719120c45f0f7725c1b85)

Change-Id: Ib535052b5b934db1e16064b0e923994c7b3f7b68
Signed-off-by: Iurii Metelytsia <i.metelytsia@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoSome svace issues fixed 85/213985/1
Iurii Metelytsia [Thu, 5 Sep 2019 17:31:27 +0000 (20:31 +0300)]
Some svace issues fixed

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/215d4911bf4858bba1c8a5719cbe8516df6e7158
(cherry-picked from 215d4911bf4858bba1c8a5719cbe8516df6e7158)

Change-Id: I2e32b5b381de1c063dff9ef924a690e1113b2478
Signed-off-by: Iurii Metelytsia <i.metelytsia@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoChanges in spec file for WITH_PROCESS_EVENT flag 84/213984/1
Kush [Tue, 3 Sep 2019 16:32:38 +0000 (22:02 +0530)]
Changes in spec file for WITH_PROCESS_EVENT flag

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/3a2766a06675f675761f8f04340a48b3e541ec0b
(cherry-picked from 3a2766a06675f675761f8f04340a48b3e541ec0b)

Change-Id: Icbd20289b1fdea7da1c8074775702c09ab865e1f
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoObservation without caching. 83/213983/1
Senthil Kumar G S [Fri, 26 Jul 2019 13:15:21 +0000 (18:45 +0530)]
Observation without caching.

Added support to receive all observe notifications.

Background:-
RE ignores the observe notification if there is no change in the representation.
This patch introduces a default argument in"RCSRemoteResourceObject::startCaching" to let users
decide whether all notifications need to be reported or not.

API Usage:
startCaching(std::move(cb), CacheMode::OBSERVE_ONLY, CacheReport::REPORT_ALL);

Note: Existing functionalities/usages are not affected.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/378/commits/8be52525d302ef933fda2ca4032fbd716b40582b
(cherry-picked from 8be52525d302ef933fda2ca4032fbd716b40582b)

Change-Id: Ib96e91da07edcdeb9bcedd4cf733f7966bd83e50
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoImplementation of Filtered Scan for BLE android client 82/213982/1
samanway-dey [Wed, 19 Dec 2018 14:30:25 +0000 (20:00 +0530)]
Implementation of Filtered Scan for BLE android client

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/550/commits/122fb3ee9a1ad66d5bbeeeeb6410f9f10e1977a6
(cherry-picked from 122fb3ee9a1ad66d5bbeeeeb6410f9f10e1977a6)

Change-Id: I537661ef606540fd36a8c352330ef831b96ed732
Signed-off-by: samanway-dey <samanway-dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years ago[CONPRO-1483] Implementation of API for setting scanfilter UUIDs 84/214384/1
samanway [Tue, 3 Sep 2019 15:54:59 +0000 (21:24 +0530)]
[CONPRO-1483] Implementation of API for setting scanfilter UUIDs

- Currently, IoTivity sets the custom UUIDs to set scanfilters for Android BLE client by hard coding UUIDs
- This patch implements CASetLEScanUuid API to set the UUIDs to add more scanfilters

Change-Id: I167bb7b7b24589e88d4b7c8120cea9b72a5918b1
Signed-off-by: samanway-dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoUpdate snapshot info 15/213115/1
Sudipto [Fri, 30 Aug 2019 09:48:09 +0000 (15:18 +0530)]
Update snapshot info

Change-Id: Ia1e559e398090e88087e394cf031aca4c60969ce
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoReplace select with poll. 14/213114/1
SOURAV BHUWALKA [Thu, 22 Aug 2019 08:07:31 +0000 (13:37 +0530)]
Replace select with poll.

1. select has a limitation of 1024 file descriptors to be monitored.
2. Calling select() or FD_* macros with invalid file descriptor could
result in stack corruption.
3. Currently we don't validate the file descriptors which are passed to it.
Even if we add logic to validate, we cannot recreate the underlying socket
with file descriptor lesser than 1024.

Stack corruption:-
fd_set is an array of bits, of FD_SETSIZE elements.
A variable of fd_set is created in the stack segment.
FD_SET macro apparently doesn’t know about the FD_SETSIZE value,
so even if you pass a FD greater than 1024,
it will actually set to “1” the corresponding bit in the fd_set array of bits,
which actually is OUTSIDE the array. Thus, corrupting the stack.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/560/commits/842a27d1c6be3397687d7788d113f872308de2bc
(cherry-picked from 842a27d1c6be3397687d7788d113f872308de2bc)

Reference:
https://sigquit.wordpress.com/2009/12/24/stack-corruption-improper-use-of-fd_set/

Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Change-Id: Ie8f7e0b90c9a458ee82f247132c45ff82f2a37ae
Co-authored-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoUpdate snapshot history 19/212719/1
Sudipto [Mon, 26 Aug 2019 08:08:00 +0000 (13:38 +0530)]
Update snapshot history

Change-Id: I3d51e155908cb8f0449d05ac55ad6d55cbaf9a9a
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoCONPRO-1481 crash while fuzzing with nmap 18/212718/1
Vitalii Irkha [Thu, 22 Aug 2019 13:20:34 +0000 (16:20 +0300)]
CONPRO-1481 crash while fuzzing with nmap

Check dataLen before read data from TLS connection

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/7cc9764f1b6698759f76bbfa35d9d497e22b13f9
(cherry-picked from 7cc9764f1b6698759f76bbfa35d9d497e22b13f9)

Change-Id: I33e010519573155725e5f1986b60bdcacfa3db2b
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years ago[CONPRO-1476] Fix memory leak in TCP server. 17/212717/1
Senthil Kumar G S [Wed, 14 Aug 2019 14:31:06 +0000 (20:01 +0530)]
[CONPRO-1476] Fix memory leak in TCP server.

On starting TCP server, CAReceiveHandler thread is created but it is not destroyed when it is stopped.
Though the thread stops asynchronously, its handle which is stored in the thread pool is not removed and destroyed during stop
which causes memory leak to persist till stack termination.

Note: Cherry-picked the patch from https://github.sec.samsung.net/SES/SmartThingsThing/commit/c1d8cf83510f988fb4f8bf0e6b72cb18f618d4ec
Reviewed & Verified on current 1.2-rel codebase.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/ced355b7c49a76966fe4961ef93f53e470543c76
(cherry-picked from ced355b7c49a76966fe4961ef93f53e470543c76)

Change-Id: I8eeff40b22b57cc75717f8df3e34d1fbb1388c12
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years ago[CONPRO-1473] Fix for build error [-Werror=implicit-function-declaration] 16/212716/1
Senthil Kumar G S [Tue, 13 Aug 2019 09:56:19 +0000 (15:26 +0530)]
[CONPRO-1473] Fix for build error [-Werror=implicit-function-declaration]

Cherry-picked code changes from
https://github.sec.samsung.net/SES/SmartThingsThing/commit/cb59d751fc93d9715a514d85c33ee41969f43886

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/6473747735b2339c92ce01ff58d7c0b9dcad343e
(cherry-picked from 6473747735b2339c92ce01ff58d7c0b9dcad343e)

Change-Id: Idb186e07ece03a6a13f44830be125bd7ce16a51a
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoCONPRO-1475: memleak fix 15/212715/1
Oleksii Beketov [Tue, 13 Aug 2019 09:52:27 +0000 (12:52 +0300)]
CONPRO-1475: memleak fix

Fixed memleak in doxmresource.c

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/b8379bcdab3842962e3708f15902753f9e653576
(cherry-picked from b8379bcdab3842962e3708f15902753f9e653576)

Change-Id: I31544579f61eb309d19bc0e7e324472a5b0d4355
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoQR Code Random Pin CB 14/212714/1
Oleksii Beketov [Tue, 6 Aug 2019 10:49:33 +0000 (13:49 +0300)]
QR Code Random Pin CB

Added an API to set preconfigured PIN code

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/553/commits/d5ebdbfdb3287aea754fc6a637ba771d6485004f
(cherry-picked from d5ebdbfdb3287aea754fc6a637ba771d6485004f)

Change-Id: I0d1ccdf352ddabe9bb57c59a15c9a5ac8eb6f189
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoMap the error code of CAGenerateToken() to OCStackResult. 13/212713/1
Senthil Kumar G S [Mon, 15 Jul 2019 12:37:54 +0000 (18:07 +0530)]
Map the error code of CAGenerateToken() to OCStackResult.

CAGenerateToken could fail for memory overflow or invalid token parameters.
Currently, from OCDoRequest(), we return OC_STACK_ERROR for all failure cases.

This commit maps the error code to OCStackResult.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/a7e9837b18e33dd536af97f5c9ad35417b9457b8
(cherry-picked from a7e9837b18e33dd536af97f5c9ad35417b9457b8)

Change-Id: Ib26555a13eba9e7d925b0eb1db13b4fc12f74c6f
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoMake NS Consumer message handler thread as joinable thread. 41/212241/1
Senthil Kumar G S [Thu, 8 Aug 2019 15:09:23 +0000 (20:39 +0530)]
Make NS Consumer message handler thread as joinable thread.

Background:
Currently, NS Consumer message handler thread is a detached thread.
When stopping NS Consumer, we have to destroy thread handle and other resources of message handler thread.
We cannot destroy if message handler thread is running.
So before we destroy, we need to wait for the message handler thread to terminate.
pthread_join() is called internally. As it is on a detached thread, it is useless and it could result in undefined behavior.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/93e66a00acc08ce0c7a3fb217bfb2cc92f2a6c15
(cherry-picked from 93e66a00acc08ce0c7a3fb217bfb2cc92f2a6c15)

Change-Id: I43113a1d6ac0dcbba15a6b12032d71c5369e8b3b
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoMerge "Update snapshot history" into tizen accepted/tizen/unified/20190816.112424 accepted/tizen/unified/20190819.112113 submit/tizen/20190814.040402 submit/tizen/20190819.064537
Pyun DoHyun [Mon, 12 Aug 2019 00:11:23 +0000 (00:11 +0000)]
Merge "Update snapshot history" into tizen

4 years agoMerge "Handle race condition and mutex issues." into tizen
Pyun DoHyun [Mon, 12 Aug 2019 00:11:17 +0000 (00:11 +0000)]
Merge "Handle race condition and mutex issues." into tizen

4 years agoUpdate snapshot history 84/211884/1
Sudipto [Fri, 9 Aug 2019 13:56:56 +0000 (19:26 +0530)]
Update snapshot history

Change-Id: I0c82b1cf489e0552444daff419d9c0b952dec738
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoHandle race condition and mutex issues. 82/211882/1
Senthil Kumar G S [Thu, 8 Aug 2019 09:38:07 +0000 (15:08 +0530)]
Handle race condition and mutex issues.

NSStopConsumer() results in crash at NSDestroyQueue().
As per the crash log, after consumer message handler thread (NSConsumerMsgHandleThreadFunc) comes to an end,
there seems to be a race condition between the thread which called NSStopConsumer() and another thread which calls NSConsumerMsgPushThreadFunc().
Both threads try to access the message queue. One enqueues and another dequeues which could result in undefined behaviour.
Handled it by checking the running status of message handler thread before enqueuing request.

Another issue in with improper access of "g_create_mutex" in NSThread.c.
There is a chance that NSThreadInit could initialize the same mutex multiple times.
And NSDestroyThreadHandle unlocks the mutex without locking it. (NSThreadInit & NSDestroyThreadHandle are called
from several threads and the way they access the mutex could result in undefined behavior).
As the usage and the main intention of the mutex is not clear, removed it.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/554/commits/93e66a00acc08ce0c7a3fb217bfb2cc92f2a6c15
(cherry-picked from 93e66a00acc08ce0c7a3fb217bfb2cc92f2a6c15)

Change-Id: Iaa11c9b9b0088d4626cc92f85bbb55fb69f417af
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoThrow exception for errors in EnrolleeSecurity::performOwnershipTransfer() 72/211872/2
Senthil Kumar G S [Tue, 30 Jul 2019 10:40:46 +0000 (16:10 +0530)]
Throw exception for errors in EnrolleeSecurity::performOwnershipTransfer()

Current:
Returning ES_ERROR for all error cases doesn't let the caller know what went wrong,

Proposed:
Throw ESPlatformException with the actual OCStackResult for all error cases.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/551/commits/d7bf5d91b812d1cd3a62ab7d51e33d8101cf27a7
(cherry-picked from d7bf5d91b812d1cd3a62ab7d51e33d8101cf27a7)

Change-Id: I4b8f39a4dc749f2393908a02df68df251fded24c
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoMutex Unlock Corrected 71/211871/2
Samanway Dey [Thu, 11 Jul 2019 12:25:01 +0000 (17:55 +0530)]
Mutex Unlock Corrected

 - For tizen BLE caleclient.c file, in function CALEAdapterScanResultCb(),
g_LEServerListMutex was placed in a wrong nested block, as a result even if
g_LEServerListMutex was not locked in some case, ittas being unlocked following
crash in IoTivity stack.
 - Hence, corrected it

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/538/commits/4e49610943156f45e6b0e7c2a0a9783ba5c2b94b
(cherry-picked from 4e49610943156f45e6b0e7c2a0a9783ba5c2b94b)

Change-Id: I9d76583346029f46ef7ad7ded4c850ca1feb4b06
Signed-off-by: Samanway Dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoAdding fix for Sonarqube major issues for IoTivity 1.2-rel 70/211870/2
samanway [Tue, 23 Jul 2019 12:05:15 +0000 (17:35 +0530)]
Adding fix for Sonarqube major issues for IoTivity 1.2-rel

     - Fixed Invalid number of character ')'s in caleadapter.c
     - Fixed Possible null pointer dereference in ccmessagehandler.c
     - Fixed double memory free condition JniNotificationConsumer.cpp
     - Fixed double memory free condition JniNotificationProvider.cpp

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/548/commits/222bbb7e84830c5a2ecc17332df1c60f2bcf3a71
(cherry-picked from 222bbb7e84830c5a2ecc17332df1c60f2bcf3a71)

Change-Id: I724ee387dfc932c0614b7e19bb289b85d0254106
Signed-off by: samanway <samanway@samanway.sa.corp.samsungelectronics.net>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
4 years agoCA API to retrieve the some internal values in TCP socket 25/211025/2
Amit Singh [Tue, 16 Jul 2019 14:59:13 +0000 (20:29 +0530)]
CA API to retrieve the some internal values in TCP socket

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/537/commits/cebbe139c44e3001a7a4ad4a09a80ceb2478ecbd
(cherry-picked from cebbe139c44e3001a7a4ad4a09a80ceb2478ecbd)

Change-Id: Ibb9139afc3e2da1b88288c1f6a14c8676b23adbf
Signed-off-by: Amit Singh <amit.s.r@samsung.com>
Signed-off-by: Kush Agrawal <kush.agrawal@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoUpdated snapshot(2018-07-25) 23/211023/2
Sudipto Bal [Fri, 26 Jul 2019 16:32:29 +0000 (22:02 +0530)]
Updated snapshot(2018-07-25)

Change-Id: I35dc6e4f15eebc6543b3bf3f12e26c79700d776b
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoBuild support to generate gcov code coverage. 22/211022/2
Senthil Kumar G S [Wed, 24 Jul 2019 10:09:33 +0000 (15:39 +0530)]
Build support to generate gcov code coverage.

Build flag: COVERAGE_CHECKS
Supported mode: debug
Platform: linux

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/549/commits/7dc3dab0cb819a91a7bf56d31e39677b8ec5c640
(cherry-picked from 7dc3dab0cb819a91a7bf56d31e39677b8ec5c640)

Change-Id: I32e16780891f1e97b91a4c0f9589ef8f56c4a048
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoReturn accurate error codes for error cases. 21/211021/3
Senthil Kumar G S [Wed, 17 Jul 2019 07:33:32 +0000 (13:03 +0530)]
Return accurate error codes for error cases.

1. Returning CA_MEMORY_ALLOC_FAILED instead of CA_STATUS_FAILED.
2. If request doesn't contain RequestURI/Proxy URI, then return OC_STACK_INVALID_URI.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/545/commits/a2e9bce4cc70b63f9a82cce82970167126794e9a
(cherry-picked from ac207215d4c4550ad89c9b72ab81b859a83a0c2b)

Change-Id: Ib5f2b05dbc621ee8cc70ae9760a70b44a8c476f8
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoCrash in OCCreateResource 20/211020/2
Kush [Tue, 16 Jul 2019 11:38:45 +0000 (17:08 +0530)]
Crash in OCCreateResource

Added check for uri before strncmp

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/544/commits/ba1c2fd49c1fd4f519c64943656a5329cf36b0bd
(cherry-picked from ba1c2fd49c1fd4f519c64943656a5329cf36b0bd)

Change-Id: Ieddc1809174a1360a1bb82a6aeec580cb34e4755
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoFixed build issue with SECURED=0 option 19/211019/2
Vitalii Irkha [Tue, 16 Jul 2019 10:00:53 +0000 (13:00 +0300)]
Fixed build issue with SECURED=0 option

Moved common APIs from secure definition section

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/543/commits/4612b9818aa6b21a8dc1e07b1b1522d69b1206e0
(cherry-picked from 4612b9818aa6b21a8dc1e07b1b1522d69b1206e0)

Change-Id: I47418a8488c774bb343a845d828f6a56999a20d7
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoInit pstat->sm to NULL 18/211018/2
Aleksey Volkov [Tue, 16 Jul 2019 06:52:30 +0000 (09:52 +0300)]
Init pstat->sm to NULL

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/542/commits/732215dde47f1ed69461f874707b38c98b518d08
(cherry-picked from 732215dde47f1ed69461f874707b38c98b518d08)

Change-Id: I6efcc7a268fa9027ac1b080ce865ef7cd4020372
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoAdd gPstat null check 17/211017/2
Aleksey Volkov [Fri, 12 Jul 2019 11:14:35 +0000 (14:14 +0300)]
Add gPstat null check

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/541/commits/d070ff1e409154409db8bcb7528c0cb9fc7ed636
(cherry-picked from d070ff1e409154409db8bcb7528c0cb9fc7ed636)

Change-Id: I1c0a5295ebc2962132933335cfb33b578b3cad55
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years ago[CONPRO-1454]:[VD][DF190528-00531] Crash 16/211016/2
sourav bhuwalka [Wed, 3 Jul 2019 08:59:18 +0000 (14:29 +0530)]
[CONPRO-1454]:[VD][DF190528-00531] Crash

resHandle is being freed twice once in DeleteClientCB and once
in OICFree(resHandle) in OCDoRequest in exit condition.
So freeing resHandle only if clientCB is NULL

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/532/commits/b63e8200da46aa3e5505288bcf284568798a6069
(cherry-picked from b63e8200da46aa3e5505288bcf284568798a6069)

Change-Id: I486cfb9038524292be6d311302719e36fce5aaa4
Signed-off-by: sourav bhuwalka <s.bhuwalka@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoOCRemoveDeviceWithUuid doesn't change owned device 15/211015/1
Vitalii Irkha [Fri, 12 Jul 2019 11:23:07 +0000 (14:23 +0300)]
OCRemoveDeviceWithUuid doesn't change owned device

API should call SRPResetDevice() inside

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/539/commits/1211889827f00390219402eef5576b85347b6750
(cherry-picked from 1211889827f00390219402eef5576b85347b6750)

Change-Id: If1dc94edcc340b49506a8c580324756708de4091
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoUse GATT server's get mtu size API instead of GATT client API 29/210029/2
DoHyun Pyun [Mon, 17 Jun 2019 09:20:47 +0000 (18:20 +0900)]
Use GATT server's get mtu size API instead of GATT client API

GATT server's get mtu size API is added on Tizen 5.5 public.
So we also add Tizen BLE 5.5 build option for the compatibility.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/524/commits/6b31a4840ddceaeb699293dff833353d39901675
(cherry-picked from 6b31a4840ddceaeb699293dff833353d39901675)

Change-Id: I96137ae7382d189460edc7427f4f2d6add212817
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoRFNOP right reset 28/209928/2
Vitalii Irkha [Mon, 1 Jul 2019 10:02:21 +0000 (13:02 +0300)]
RFNOP right reset

Reset ACL, Cred, Doxm, Pstat in case of validation failed.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/528/commits/ae296ce2cccb6e14fe39575b62690b44b56c0d56
(cherry-picked from ae296ce2cccb6e14fe39575b62690b44b56c0d56)

Change-Id: I9f3d6f02e5b4d2c6c8b18c53ee25c535e9af2d62
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoCheck devID for owned device 27/209927/1
Vitalii Irkha [Mon, 1 Jul 2019 10:33:19 +0000 (13:33 +0300)]
Check devID for owned device

devID should be the same for owned device.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/529/commits/3b966521b2c0ced20bacce722b741f998ad0391b
(cherry picked from 3b966521b2c0ced20bacce722b741f998ad0391b)

Change-Id: Icd13121c99faf0cfde92667a5d5fcaf902e0f205
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoTracking OTM state on client side 26/209926/1
Vitalii Irkha [Tue, 2 Jul 2019 16:12:27 +0000 (19:12 +0300)]
Tracking OTM state on client side

Tracking OTM state in DB, to allow only one client start OTM.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/531/commits/8d05749742ede4553ab9829fe747fc376672c274
(cherry picked from 8d05749742ede4553ab9829fe747fc376672c274)

Change-Id: Ic8d02209d8de41c5b6f9029daa2d55cd20661e67
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoMerge "Remove unused openssl-devel dependency" into tizen
Pyun DoHyun [Thu, 4 Jul 2019 23:19:49 +0000 (23:19 +0000)]
Merge "Remove unused openssl-devel dependency" into tizen

4 years agoRemove unused openssl-devel dependency 06/209306/1
Dariusz Michaluk [Thu, 4 Jul 2019 15:06:24 +0000 (17:06 +0200)]
Remove unused openssl-devel dependency

Change-Id: I721f5579439f1a77482130bdc2e98f65113ecb1b

4 years agoUpdate Snapshot(2019-06-27) 09/208909/1 accepted/tizen/unified/20190702.114916 submit/tizen/20190702.012330
DoHyun Pyun [Mon, 1 Jul 2019 07:30:27 +0000 (16:30 +0900)]
Update Snapshot(2019-06-27)

Change-Id: If755f04ec28c5c003897bd3e4bdaf460995bcce9
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoPutting check guard if thread already destroyed 92/208892/1
Kush [Thu, 27 Jun 2019 16:33:31 +0000 (22:03 +0530)]
Putting check guard if thread already destroyed

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/527/commits/ead7a6d1d2220a5ccbed468dc71c212fc784151e
(cherry picked from ead7a6d1d2220a5ccbed468dc71c212fc784151e)

Change-Id: Id229f4f85ba9b06bfca84f5991d245584cfdfa48
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoValidate device state for RFNOP 91/208891/1
Vitalii Irkha [Thu, 27 Jun 2019 13:18:35 +0000 (16:18 +0300)]
Validate device state for RFNOP

Added more conditions before device set state to RFNOP

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/526/commits/09d560036053995d8bd1dee875d696e8d1eb3701
(cherry picked from 09d560036053995d8bd1dee875d696e8d1eb3701)

Change-Id: I9fccbd932a1f4e56af692300e3121b39358f88c6
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoAdd CASetSecureEndpointUuid APIs 90/208890/1
Jaehong Jo [Tue, 11 Jun 2019 09:03:59 +0000 (18:03 +0900)]
Add CASetSecureEndpointUuid APIs

In the tls connection, the subject name in the certificate is set to uuid.
So need this api to set the identity with doxm or device uuid.
Give the endpoint and uuid, it finds the peer and sets identity to uuid.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/522/commits/cb5bfdca63fd5919005e69988363f0d951aa75d9
(cherry picked from cb5bfdca63fd5919005e69988363f0d951aa75d9)

Change-Id: I61b701e2fb95b2af61894431ece9c164e68f9c9e
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
4 years agoSet the queue handle to null before stop & destroy. (#525) 45/208345/1 accepted/tizen/unified/20190626.040955 submit/tizen/20190625.065348 submit/tizen/20190625.235330
senthil.gs@samsung.com [Thu, 20 Jun 2019 14:02:45 +0000 (19:32 +0530)]
Set the queue handle to null before stop & destroy. (#525)

g_sendQueueHandle is set to NULL to prevent new requests from being enqueued.
It avoids a race condition which could occur when adding elements to QueueingThread if it's already stopped.

Race condition scenario:-
Background:-
-> If a thread has called CAQueueingThreadStop(), it signals the condition variable
to wake up the CAQueueingThreadBaseRoutine.

-> After signaling, it waits on the same condition variable
to wait for the completion of CAQueueingThreadBaseRoutine.

-> CAQueueingThreadBaseRoutine will finish its current task and signals the condition variable.

-> CAQueueingThreadStop should wake up upon signal and return back to caller.

Issue:-
-> CAQueueingThreadAddData also signals the condition variable which can wake up the thread that called CAQueueingThreadStop.
-> CAQueueingThreadStop returns back to caller assuming that the CAQueueingThreadBaseRoutine has stopped. But it could still be running.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/525
(cherry picked from eb98e19b49ab4d4475449f99f3a4a53607dbea01)

Change-Id: I5b22c034b30b00fc1ae7f08c37c278c29910345c
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years ago[CONPRO-1429] 100% CPU usage by iotivity stack 44/208344/1
sourav bhuwalka [Mon, 3 Jun 2019 07:16:47 +0000 (12:46 +0530)]
[CONPRO-1429] 100% CPU usage by iotivity stack

Here before the max number of observers was 255 and when more
than 255 observers were there an infinite loop was running.
Increasing the number of observers and changing the logic so
that infinite loop should not be run when observer count reaches
max number of observers.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/3f9cb8af60cd5ed929ed876d95e82f2650309f9c
(cherry picked from 3f9cb8af60cd5ed929ed876d95e82f2650309f9c)

Change-Id: Ib0bb86817d2dbf8c2d5f5806cb49ffa2e002cd21
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoFixing crash in ocrandom.c (#516) 43/208343/1
samanway.dey@samsung.com [Tue, 11 Jun 2019 18:32:40 +0000 (00:02 +0530)]
Fixing crash in ocrandom.c (#516)

* Fixing crash in ocrandom.c

-In function OCFillRandomMem() in ocrandom.c, location array was filled by incrementing the pointer. As a result,
the base pointer was pointing out the last byte of memory chunk instead of pointing the beginning of the array.

Signed-off-by: Samanway Dey <samanway.dey@samsung.com>
* Update ocrandom.c

Iterating till i > 1 for random swaps.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/516
(cherry picked from 643d922896dfeaf5f3d829009bd1d5b09654d93b)

Change-Id: I8031d4cf5cc22c682ff5c0df607c78e276923bcf
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoFix Build Error in cloudCommon.c 42/208342/1
Jaehyun Cho [Thu, 23 May 2019 08:09:03 +0000 (17:09 +0900)]
Fix Build Error in cloudCommon.c

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/2ce4b758f6b751d564b25a8d9cc29ef1d36983f3
(cherry picked from 2ce4b758f6b751d564b25a8d9cc29ef1d36983f3)

Change-Id: I2e5642555a1f50e27fea73d939c05104c95a81e0
Signed-off-by: Jaehyun Cho <jaehyun3.cho@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoFixing crash in OCFillRandomMem (#512) 41/208341/1
samanway.dey@samsung.com [Thu, 23 May 2019 11:18:06 +0000 (16:48 +0530)]
Fixing crash in OCFillRandomMem (#512)

- In commit ca4adaec79350756d58b124af22bece9c3ad186d there was
  a bug which causes crash in IoTivity, fixed that

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/c5711fd40dfbcaa3e47a6ac06ab08efd84ca66f2
(cherry picked from ca4adaec79350756d58b124af22bece9c3ad186d)

Change-Id: I65d5e1ce3cd2a51ca9d0dd60b10158c9c97bbef7
Signed-off-by: Samanway Dey <samanway.dey@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoAdding more randomised token generation logic 40/208340/1
Samanway Dey [Mon, 20 May 2019 14:18:38 +0000 (19:48 +0530)]
Adding more randomised token generation logic

- Added shuffling logic by each byte after generating token

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/c5711fd40dfbcaa3e47a6ac06ab08efd84ca66f2
(cherry picked from c5711fd40dfbcaa3e47a6ac06ab08efd84ca66f2)

Change-Id: I941397f2a5b6452299c9e80649d0de0efc4cdd7a
Signed-off-by: Samanway Dey <samanway.dey@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoFix for server request with duplicate token issue 39/208339/1
Samanway Dey [Mon, 20 May 2019 14:12:29 +0000 (19:42 +0530)]
Fix for server request with duplicate token issue

- Adding return statement so that server doesn't process a request
  if another one with same token already exists in serverRequestList

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/c5711fd40dfbcaa3e47a6ac06ab08efd84ca66f2
(cherry picked from c5711fd40dfbcaa3e47a6ac06ab08efd84ca66f2)

Change-Id: Iee2618576c4bbce9904251276848b493c731b9bc
Signed-off-by: Samanway Dey <samanway.dey@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years ago[CONPRO-1442] Fix crash in cpp wrapper. 38/208338/1
Jaehyun Cho [Mon, 20 May 2019 05:38:04 +0000 (14:38 +0900)]
[CONPRO-1442] Fix crash in cpp wrapper.

When application is run with Both mode, in InProcClientWrapper start
logic for making procession thread is not executed. But, when stop
application, thread join processing and event free logic is executed
regardless mode. So I moved that logic into mode check statement. This
can make that logic is executed only mode is client.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/b5c0bd60cef0c305dfb07239cbfbd3529a39afec
(cherry picked from b5c0bd60cef0c305dfb07239cbfbd3529a39afec)

Change-Id: I713f0019051f4970d6122e458186795fd070112e
Signed-off-by: Jaehyun Cho <jaehyun3.cho@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years ago[CONPRO-1398] Adjust server request handling 37/208337/1
Robert Chudek [Tue, 12 Feb 2019 11:03:44 +0000 (12:03 +0100)]
[CONPRO-1398] Adjust server request handling

[Model] IoTivity
[BinType] AP
[Customer] IoT-Core

[Issue#] CONPRO-1398
[Request] Robert Chudek / r.chudek
[Occurrence Version] n/a

[Problem] IoT-Core needs some additional server request handling.
[Cause & Measure] n/a
[Checking Method] n/a

[Team] IoT Connection
[Developer] Robert Chudek / r.chudek
[Solution company] Samsung
[Change Type] adjustment

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/735a165c3239cfc5e0b01cd2ef1b5843321d3edb
(cherry picked from 735a165c3239cfc5e0b01cd2ef1b5843321d3edb)

Change-Id: If183e682dd165c64830d71f70d74eb15a5bb82ab
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoRemove securevirtualresourcetypes.h from ocpayload 36/208336/1
Jaehyun Cho [Thu, 9 May 2019 05:14:18 +0000 (14:14 +0900)]
Remove securevirtualresourcetypes.h from ocpayload

OicSecKey_t is used to set/get Payload data. ocpyalod.h do not
need to use securevirtualresourcetypes.h file directly. that header
is moved to implement file and removed from ocpayload header.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/546fc54a4fea6ffb1b52d5dbbf88e2b784bebc2b
(cherry picked from 546fc54a4fea6ffb1b52d5dbbf88e2b784bebc2b)

Change-Id: I520f507624e99d5b0a3ea131f09c6d6f91dddc61
Signed-off-by: Jaehyun Cho <jaehyun3.cho@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoFix build error on gcc version 7.x 35/208335/1
Daedong Park [Thu, 18 Apr 2019 01:11:39 +0000 (10:11 +0900)]
Fix build error on gcc version 7.x

- Add missing standard library header
- Rebuild google test 1.7.0

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/5434c42da3c3d0deec5104aa022fce51e86660f1
(cherry picked from 5434c42da3c3d0deec5104aa022fce51e86660f1)

Change-Id: Ia416aedec5c338088066b75667cec80f745969dc
Signed-off-by: Daedong Park <daedong.park@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years ago[CONPRO-1430] BlockWiseTransfer Error 34/208334/1
kush.agrawal [Wed, 17 Apr 2019 10:12:37 +0000 (19:12 +0900)]
[CONPRO-1430] BlockWiseTransfer Error

Issue : If packet is already received , then it was giving error.

Fix : Skip processing packet if it was received once. So after receving packet which was already received earlier, it will still wait for next packet.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/9974e6582da652f59b474e37027a46737efbac71
(cherry picked from 9974e6582da652f59b474e37027a46737efbac71)

Change-Id: I20889dc55a58665bc5507d1e2e2e39bb72f65b91
Signed-off-by: kush.agrawal <kush.agrawal@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoFixed acl update issues 33/208333/1
Jaehong Jo [Mon, 29 Apr 2019 11:26:17 +0000 (20:26 +0900)]
Fixed acl update issues

When update aclresource then if using payload
with not fixed lenght of rt list, occur error.
And if an empty rel is received,
it will be updated to the garbage value.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/35dc2c8878f87c7f9d4313102c1676cf13480d8e
(cherry picked from 35dc2c8878f87c7f9d4313102c1676cf13480d8e)

Change-Id: I1ecd9eb2e23c1c2c2e3a752585b73b62d3b24247
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoDisable Tizen 40 option for VD release 06/208206/1 accepted/tizen/unified/20190624.075159 submit/tizen/20190620.045214
DoHyun Pyun [Thu, 20 Jun 2019 01:07:34 +0000 (10:07 +0900)]
Disable Tizen 40 option for VD release

Because the gatt client destroy API has an issue, we can't pass the
Easy Setup senario using Tizen 40 option. We will add Tizen 50 option
with new GATT server MTU get API, and enable Tizen 50 option.

Change-Id: I26cc574e4448a6fa5001bfc5b62e3b7202853c7b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoModify Tizen BLE 3.0 / 4.0 build option 48/206148/1
DoHyun Pyun [Thu, 9 May 2019 04:35:39 +0000 (13:35 +0900)]
Modify Tizen BLE 3.0 / 4.0 build option

tizen4 flag was defined in the code, but it was not used.
So tizen BLE CA layer is using internal APIs. This patchset
modifies build options and disable internal API usage.

Change-Id: I283085e4525207c4df2cd40b683e6f67b3aa6662
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoRevert "Avoid adding elements to QueueingThread if it's already stopped." 04/205204/1 accepted/tizen/unified/20190507.111910 submit/tizen/20190506.232846
DoHyun Pyun [Tue, 30 Apr 2019 07:02:19 +0000 (16:02 +0900)]
Revert "Avoid adding elements to QueueingThread if it's already stopped."

This reverts commit c04ac05a42d644464490feecf905cfd4aaf64b76.

Change-Id: I2c81a9641a58522671d8807465f1ec5a2f91dd51