platform/core/security/cynara.git
4 years agoCategorize unit tests for DescriptionListRequest in ProtocolAdmin 28/238728/7
Zofia Abramowska [Thu, 16 Jul 2020 13:56:23 +0000 (15:56 +0200)]
Categorize unit tests for DescriptionListRequest in ProtocolAdmin

Categorize into positive/negative test cases.

Change-Id: I0a1c0b6b9e53ff31d3000d6994cd665df0d6905c

4 years agoRedo unit tests for AdminCheckResponse in ProtocolAdmin 27/238727/7
Zofia Abramowska [Thu, 16 Jul 2020 13:52:47 +0000 (15:52 +0200)]
Redo unit tests for AdminCheckResponse in ProtocolAdmin

* squash positive test cases
* add invalid protocol test case

Change-Id: I2a3e46e2df2942e091aa0620345c91c4e7d10bbb

4 years agoRedo unit tests for AdminCheckRequest in ProtocolAdmin 26/238726/6
Zofia Abramowska [Thu, 16 Jul 2020 13:20:14 +0000 (15:20 +0200)]
Redo unit tests for AdminCheckRequest in ProtocolAdmin

* squash positive test cases
* add invalid protocol test cases

Change-Id: Icfbceb6ba42d3ebf96855caf7a44482058fbb883

4 years agoCategorize BucketRecordCorruptedException unit tests 25/238725/6
Zofia Abramowska [Thu, 16 Jul 2020 13:06:55 +0000 (15:06 +0200)]
Categorize BucketRecordCorruptedException unit tests

Categorize into positive/negative test cases.

Change-Id: If2dc7634bfe8eed65265685fb2e7f9407423e252

4 years agoAdd unit tests for CancelResponse in ProtocolClient 25/238625/6
Zofia Abramowska [Wed, 15 Jul 2020 16:43:22 +0000 (18:43 +0200)]
Add unit tests for CancelResponse in ProtocolClient

Change-Id: If34ce28977fdf13e26a7d89c7a11cd9ce20a287a

4 years agoAdd unit tests for CheckResponse in ProtocolClient 24/238624/6
Zofia Abramowska [Wed, 15 Jul 2020 16:34:25 +0000 (18:34 +0200)]
Add unit tests for CheckResponse in ProtocolClient

Change-Id: Ibfb00e00db21ca10ba18c6fdcfa5b76fd64ea4f1

4 years agoAdd unit tests for MonitorEntryPutRequest in ProtocolClient 23/238623/6
Zofia Abramowska [Wed, 15 Jul 2020 16:03:31 +0000 (18:03 +0200)]
Add unit tests for MonitorEntryPutRequest in ProtocolClient

Change-Id: Idb17089a5061fb81fdd2b842c7366f2dbf6821c1

4 years agoRemove unused code 22/238622/6
Zofia Abramowska [Wed, 15 Jul 2020 15:12:28 +0000 (17:12 +0200)]
Remove unused code

Change-Id: Ifc6230cc0fdd4044a8967cf619a6e29585ca6228

4 years agoAdd tests for ProtocolSerialization 11/238411/7
Zofia Abramowska [Tue, 30 Jun 2020 15:38:37 +0000 (17:38 +0200)]
Add tests for ProtocolSerialization

Change-Id: I9afce8b2635e81c3ffaae45804c1d4b93251b314

4 years agoAdd unit tests MonitorEntriesPutRequest in ProtocolClient 10/238410/7
Zofia Abramowska [Tue, 30 Jun 2020 14:57:57 +0000 (16:57 +0200)]
Add unit tests MonitorEntriesPutRequest in ProtocolClient

Change-Id: Iab7265f104716cb3607e1b5dd10bb0d3ea53a9f6

4 years agoMove protocol serialization/deserialization to one place 81/235781/9
Zofia Abramowska [Tue, 9 Jun 2020 17:15:33 +0000 (19:15 +0200)]
Move protocol serialization/deserialization to one place

Move serialization and deserialization of common types to
ProtocolSerialization and ProtocolDeserialization respectively.
This eliminates code redundancy, reduces the possibility of
wrong order of serialization/deserialization and moves protocol
size limits checks to one place.
Currently max container size is 4096. As there is no valid case
when cynara can be passed a 4096-long container, this limit will
be applied, where it hasn't been before, except for
ProtocolMonitorGet, which utilizes different buffer size - 65535.

Change-Id: Id7469015712204b3be8a1aed255dcbfa91975be3

4 years agoEnsure that MonitorCache capacity is of permissible size 80/235780/8
Zofia Abramowska [Tue, 9 Jun 2020 13:01:44 +0000 (15:01 +0200)]
Ensure that MonitorCache capacity is of permissible size

When MonitorCache is flushed its whole content is sent to
Cynara service in one batch. Cynara service should not accept
vectors bigger than CYNARA_MAX_VECTOR_SIZE. Currently this is true,
but this commit adds a compile-time assertion for this limit,
so it won't be changed without realization of the consequences.

Change-Id: I5ae28882ea4c50a7455d2d0d3a7ff76d7ec7a38a

4 years agoAdd unit tests for SimpleCheckRequest in ProtocolClient 72/235672/10
Zofia Abramowska [Mon, 8 Jun 2020 16:55:24 +0000 (18:55 +0200)]
Add unit tests for SimpleCheckRequest in ProtocolClient

Change-Id: Ia797842b01e843f3273d3c436f6d3b38b857cf92

4 years agoAdd negative unit tests for ProtocolClient 71/235571/9
Zofia Abramowska [Fri, 5 Jun 2020 14:49:46 +0000 (16:49 +0200)]
Add negative unit tests for ProtocolClient

Add unit tests for:
* requests and responses not implemented in ProtocolClient
* requests and responses with wrong OpCode
* requests and responses with unfinished frame

Change-Id: I3334a887b6aacac4d4924285da401fec41d7b89f

4 years agoAdd unit tests for CheckRequest in ProtocolClient 57/235457/10
Zofia Abramowska [Thu, 4 Jun 2020 15:51:53 +0000 (17:51 +0200)]
Add unit tests for CheckRequest in ProtocolClient

Change-Id: I7dec5ab1ae3c78a4c01f00cfd72eb1eb9e2efd1e

4 years agoAdd unit tests for CancelRequest in ProtocolClient 56/235456/10
Zofia Abramowska [Thu, 4 Jun 2020 15:17:44 +0000 (17:17 +0200)]
Add unit tests for CancelRequest in ProtocolClient

Change-Id: I6644438151faf09eb4aacf5c53e299048c1714fc

4 years agoAdd unit tests for AgentRegisterResponse in ProtocolAgent 70/235570/9
Zofia Abramowska [Fri, 5 Jun 2020 11:25:56 +0000 (13:25 +0200)]
Add unit tests for AgentRegisterResponse in ProtocolAgent

Change-Id: Idbdef1ab3315dc4e3238e7fc57f334acdc7583e3

4 years agoAdd unit tests for AgentActionResponse in ProtocolAgent 69/235569/9
Zofia Abramowska [Fri, 5 Jun 2020 11:01:47 +0000 (13:01 +0200)]
Add unit tests for AgentActionResponse in ProtocolAgent

Change-Id: I88d7ffa5851727d0b0f7905258a40697399bfdfd

4 years agoAdd unit tests for AgentRegisterRequest in ProtocolAgent 55/235455/10
Zofia Abramowska [Thu, 4 Jun 2020 13:46:05 +0000 (15:46 +0200)]
Add unit tests for AgentRegisterRequest in ProtocolAgent

Change-Id: I66741df415ced3f8cae240b49aaf276c9097d952

4 years agoAdd unit tests for AgentActionRequest in ProtocolAgent 54/235454/10
Zofia Abramowska [Thu, 4 Jun 2020 12:18:41 +0000 (14:18 +0200)]
Add unit tests for AgentActionRequest in ProtocolAgent

Change-Id: If94172c87fa6fc6cac6f93ce17edf38e31e2c69f

4 years agoRelease 0.16.0 11/240111/4 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.114835 accepted/tizen/6.0/unified/hotfix/20201103.003504 accepted/tizen/unified/20200805.122456 submit/tizen/20200804.112206 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 tizen_6.0.m2_release
Zofia Abramowska [Mon, 3 Aug 2020 15:36:10 +0000 (17:36 +0200)]
Release 0.16.0

* Remove logs ifdef from spec files
* Revert "Partially remove libdlog dependency"

Change-Id: Id0e4774c9c50bdce31b161e9d9f9d010e859fdf4

4 years agoRemove logs ifdef from spec files 23/240123/2
Zofia Abramowska [Mon, 3 Aug 2020 15:34:36 +0000 (17:34 +0200)]
Remove logs ifdef from spec files

Logs backend choice became more complicated, than simple Tizen
version check. This ifdef is no longer accurate and needed.

Change-Id: Ic62497af4753bbd53253a7bf1ec13ff30575d389

4 years agoRevert "Partially remove libdlog dependency" 10/240110/2
Zofia Abramowska [Mon, 3 Aug 2020 10:46:54 +0000 (12:46 +0200)]
Revert "Partially remove libdlog dependency"

This reverts commit 426f9b677c0b6b000ad369e5086726cbdb94e3a1.

Change-Id: I55eedc3b0ea2e9a6772d452c018e3d58b905ebdc

4 years agoRelease 0.15.0 30/239930/2 submit/tizen/20200731.123052
Zofia Abramowska [Fri, 31 Jul 2020 12:21:29 +0000 (14:21 +0200)]
Release 0.15.0

* Dual license cynara under Apache 2.0 or MIT
* Partially remove libdlog dependency
* Add unit tests and redo existing ones to categorize
  them into positive/negative test cases
* Minor fixes and refactoring for new unit tests

Change-Id: Ic49ea50bf625bc222bdb8c3d4633a554c7aacd05

4 years agoDual license cynara under Apache 2.0 or MIT 48/238948/13
Krzysztof Jackiewicz [Mon, 20 Jul 2020 17:20:04 +0000 (19:20 +0200)]
Dual license cynara under Apache 2.0 or MIT

Add licenses to devel packages.

Unify the copyright and license notice formatting.

Change-Id: I0cbd7f9d2fca963737cc2a7df4f9c9bf4c29a9a6

4 years agoPartially remove libdlog dependency 26/239926/1
Krzysztof Jackiewicz [Wed, 29 Jul 2020 08:54:59 +0000 (10:54 +0200)]
Partially remove libdlog dependency

Switch to journal logging by default in all modules except cynara service.
This is to avoid libdlog dependency in client libraries.

Only cynara service may depend on libdlog and use it by providing a logging
callback to libcynara-commons.

Minor fixes and refactoring.

Change-Id: I15cf8dae915bd5863db79d27cad539cd7103ea34

4 years agoChange compare() not implemented assertion to compile time 99/237999/3
Konrad Lipinski [Tue, 7 Jul 2020 08:28:05 +0000 (10:28 +0200)]
Change compare() not implemented assertion to compile time

Change-Id: I2c79edb3cd5d962784490139a996e14638fa33fb

4 years agoAdd negative unit tests for ProtocolAgent 53/235453/9
Zofia Abramowska [Wed, 3 Jun 2020 12:48:36 +0000 (14:48 +0200)]
Add negative unit tests for ProtocolAgent

Add unit tests for:
* requests and responses not implemented in ProtocolAgent
* requests and responses with wrong OpCode
* requests and responses with unfinished frame

Change-Id: Ibb3882764fc58d307c4f9ff49d75a116512a9c35

4 years agoAdd negative unit tests for ProtocolAdmin 12/234912/11
Zofia Abramowska [Fri, 29 May 2020 15:55:52 +0000 (17:55 +0200)]
Add negative unit tests for ProtocolAdmin

Add unit tests for:
* requests and responses which are not implemented in ProtocolAdmin
* requests and responses with wrong opcode
* requests and responses with unfinished frame

Change-Id: Ifa0fa83b6caeaa32315c2abf14ef231005bfe573

4 years agoSanitize test data collection 02/235202/7
Zofia Abramowska [Tue, 2 Jun 2020 14:41:10 +0000 (16:41 +0200)]
Sanitize test data collection

* add template generation for numeric data
* remove redundant static specifier

Change-Id: I6f64988d98c633e55d027bb5c9f5bf0b8b2597a0

4 years agoAdd unit tests for CodeResponse with ProtocolAdmin 11/234911/6
Zofia Abramowska [Fri, 29 May 2020 14:23:28 +0000 (16:23 +0200)]
Add unit tests for CodeResponse with ProtocolAdmin

Change-Id: I3aad98d36969b27908cca5a1833531808b0cb6bc

4 years agoAdd SetPoliciesRequest unit tests 88/234788/5
Zofia Abramowska [Thu, 28 May 2020 16:17:05 +0000 (18:17 +0200)]
Add SetPoliciesRequest unit tests

Change-Id: Ia4c6d8c9a48650ac472adc613c1c70707e71285b

4 years agoAdd RemoveBucketRequest unit tests 87/234787/5
Zofia Abramowska [Thu, 28 May 2020 16:16:50 +0000 (18:16 +0200)]
Add RemoveBucketRequest unit tests

Change-Id: I2b0653f614d516f1b701cde904d8fc81c2a4bb7c

4 years agoAdd InsertOrUpdateBucketRequest unit tests 86/234786/5
Zofia Abramowska [Thu, 28 May 2020 16:16:27 +0000 (18:16 +0200)]
Add InsertOrUpdateBucketRequest unit tests

Change-Id: I5c5eae53ee460a12fe0215a08d1fd02434e888eb

4 years agoAdd tryCatch and exceptions messages tests 47/234647/6
Zofia Abramowska [Mon, 25 May 2020 16:29:38 +0000 (18:29 +0200)]
Add tryCatch and exceptions messages tests

Change-Id: I1d82762ca73e491821336b069570ac961e38c8a8

4 years agoAdd parameters information to exceptions messages 48/234648/5
Zofia Abramowska [Wed, 27 May 2020 15:48:17 +0000 (17:48 +0200)]
Add parameters information to exceptions messages

Fix UnknownPolicyTypeException and BucketNotExistsException

Change-Id: I3e4ef71e9050781d48d9537cf44111d1727bc37e

4 years agoLet tryCatch be used in multiple translation units 46/234346/7
Zofia Abramowska [Mon, 25 May 2020 16:45:47 +0000 (18:45 +0200)]
Let tryCatch be used in multiple translation units

Move tryCatch() implementation to separate source file.

Change-Id: Ia4614a032a022765c386144e76c58c2eec6ab6b6

4 years agoAdd safeStrError function unit tests 44/234344/8
Zofia Abramowska [Mon, 25 May 2020 14:17:41 +0000 (16:17 +0200)]
Add safeStrError function unit tests

Change-Id: I4f54c082fe854b07d63a7a89cb4f0c13b224427d

4 years agoAdd BinaryQueue unit tests 39/234239/9
Zofia Abramowska [Fri, 22 May 2020 16:07:25 +0000 (18:07 +0200)]
Add BinaryQueue unit tests

* add unit tests
* name test cases so they contain positive/negative information

Change-Id: I085c416bcc8fdd1cda1eeaed6778306f24ce5f52

4 years agoFix parameter checking in BinaryQueue 38/234238/8
Zofia Abramowska [Fri, 22 May 2020 10:13:58 +0000 (12:13 +0200)]
Fix parameter checking in BinaryQueue

* check raw pointers for nullptr
* check for empty buckets in all methods
* don't perform redundant checks in Bucket class

Change-Id: Ia5607df736460881aea5e8b1020ab6c5391b22d4

4 years agoAdd MonitorCache unit tests 99/234099/8
Zofia Abramowska [Thu, 21 May 2020 15:08:06 +0000 (17:08 +0200)]
Add MonitorCache unit tests

* add unit tests
* rename test cases to contain positive/negative information

Change-Id: I663957de5d25b646da4bab33f4f8de3f554243f1

4 years agoAdd SequenceContainer unit tests 58/233958/10
Zofia Abramowska [Wed, 20 May 2020 16:32:44 +0000 (18:32 +0200)]
Add SequenceContainer unit tests

* add new tests
* rename test cases to contain positive/negative information

Change-Id: I892fb8fa3c74075ec12d9f340c8e78443063f879

4 years agoAdd ChecksumGenerator unit tests 60/233860/7
Zofia Abramowska [Tue, 19 May 2020 15:13:25 +0000 (17:13 +0200)]
Add ChecksumGenerator unit tests

* add new tests
* rename test cases to contain positive/negative information

Change-Id: Iade6d49990e68a3e3d2549b95f558695ba0d29b7

4 years agoFix options handling in ChecksumGenerator 59/233859/8
Zofia Abramowska [Tue, 19 May 2020 15:05:10 +0000 (17:05 +0200)]
Fix options handling in ChecksumGenerator

* do not output checksum when wrong algorithm option is passed
* do not fail on run() when help option is passed
* do not throw on constructor when wrong option is passed

Change-Id: Iaebd7eeb8b6dae0e3a6f7f51bce8554528973d88

4 years agoFix paths for cynara-db-migration and its tests 58/233858/5
Zofia Abramowska [Mon, 18 May 2020 15:31:14 +0000 (17:31 +0200)]
Fix paths for cynara-db-migration and its tests

Change-Id: Ie43a4f2842c0436594409e51b5499ec30e2d3edb

4 years agoHandle gmock without pkgconfig 42/233442/5
Zofia Abramowska [Mon, 11 May 2020 15:58:24 +0000 (17:58 +0200)]
Handle gmock without pkgconfig

Googletest and googlemock do not provide libraries on
typical Linux distributions. They need to be built from sources,
preferably during project build.

Change-Id: I2f56ee8bf71f155a577fbbd2d6d72d0d350016b0

4 years agoFix fallthrough issue in switch 41/233441/5
Zofia Abramowska [Wed, 13 May 2020 14:57:54 +0000 (16:57 +0200)]
Fix fallthrough issue in switch

Change-Id: Ie61c176abeec3c1bd9c1ad3076ff018ed5419d24

4 years agoFix unused capture in lambdas 40/233440/5
Zofia Abramowska [Mon, 11 May 2020 16:12:54 +0000 (18:12 +0200)]
Fix unused capture in lambdas

Fix unused capture in lambdas for unused variables and const
integers.

Change-Id: I3ed6564c522f8db936c96c3209462fa83ffc9ce9

4 years agoFix no virtual destructor issue in EmergencyBackup 39/233439/5
Zofia Abramowska [Mon, 11 May 2020 16:10:47 +0000 (18:10 +0200)]
Fix no virtual destructor issue in EmergencyBackup

Change-Id: Ic9453ec1af892c57029f8cbfa48848e84bf00e09

4 years agoAdd libsystemd build requirements when journal is used 60/236960/2
Zofia Abramowska [Tue, 16 Jun 2020 16:13:40 +0000 (18:13 +0200)]
Add libsystemd build requirements when journal is used

Change-Id: If141aaf2511601fe08b46fb0b5b84be1447417f5

4 years agoBump C++ version support 38/233438/5
Zofia Abramowska [Mon, 11 May 2020 16:09:05 +0000 (18:09 +0200)]
Bump C++ version support

Check for compiler support of C++17 standard. If it is not
supported, then compilation fails.

Change-Id: Ie0a250678bae218e883c84acf101e0060daaf210

4 years agoAdd flags and rpm for coverage profiling 37/233437/5
Zofia Abramowska [Wed, 6 May 2020 14:38:57 +0000 (16:38 +0200)]
Add flags and rpm for coverage profiling

Add compiler flags for code coverage profiling and
an rpm containing gcov objects generated during build time.

Change-Id: Iaf527a5acf7a87aa54bedc383d20dad8d8ae170f

5 years agoRelease 0.14.26 80/222480/1 accepted/tizen/unified/20200116.103400 submit/tizen/20200115.092504
Tomasz Swierczek [Wed, 15 Jan 2020 09:21:00 +0000 (10:21 +0100)]
Release 0.14.26

* Add gcc 9 fixes

Change-Id: I692bebc5980f02f414524e75f3a418889dfe167d

5 years agoAdd gcc 9 fixes 79/222479/1
Tomasz Swierczek [Wed, 15 Jan 2020 09:09:47 +0000 (10:09 +0100)]
Add gcc 9 fixes

Change-Id: I5765699111d94d209a08002696d1d0906d917211

5 years agoRelease 0.14.25 accepted/tizen/unified/20200113.130709 submit/tizen/20200109.083715
Tomasz Swierczek [Thu, 9 Jan 2020 08:36:45 +0000 (09:36 +0100)]
Release 0.14.25

* Fix build for gcc 9
* Other EmergencyBackup implementation
* Adjust EmergencyBackup to tests
* Dont modify actual admin offline storage to validate DB
* Fix ownership of tests files

Change-Id: I5c61a4d31cb854059685a842d8880d187750867a

5 years agoFix build for gcc 9 97/221897/2
Tomasz Swierczek [Wed, 8 Jan 2020 07:04:52 +0000 (08:04 +0100)]
Fix build for gcc 9

Change-Id: Id6f85a9b853e043fe00b5ae8525888481a4bab14

5 years agoOther EmergencyBackup implementation 92/215292/1
Zofia Grzelewska [Thu, 3 Oct 2019 16:51:13 +0000 (18:51 +0200)]
Other EmergencyBackup implementation

Change-Id: I438f545d8fcf5c115c88ba069d80c73810f8a9db

5 years agoAdjust EmergencyBackup to tests 86/213886/1
Zofia Grzelewska [Wed, 11 Sep 2019 12:28:56 +0000 (14:28 +0200)]
Adjust EmergencyBackup to tests

* Change EmergencyBackup namespace to class to allow testing
* Pass EmergencyBackup to InMemoryStorageBackend as parameter
  and make it optional
* Add unit tests for both cases - when EmergencyBackup is used
  and not

Change-Id: Ibc8e2ac5b20b9769597e45ce87cb1a8cdd4bfbe0

5 years agoDont modify actual admin offline storage to validate DB 85/213885/1
Zofia Grzelewska [Wed, 11 Sep 2019 12:34:42 +0000 (14:34 +0200)]
Dont modify actual admin offline storage to validate DB

Change-Id: I88f0d0d2ce1d607b7cfab6e95dcf6631faef449a

5 years agoFix ownership of tests files 84/213884/1
Zofia Grzelewska [Tue, 10 Sep 2019 15:25:44 +0000 (17:25 +0200)]
Fix ownership of tests files

Change-Id: I15c451862413b291f0cf00e6788dd8dc04c13c5f

5 years agoRelease 0.14.24 37/213137/1 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.022513 accepted/tizen/5.5/unified/mobile/hotfix/20201027.090319 accepted/tizen/unified/20190902.220733 submit/tizen/20190830.163605 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 tizen_5.5.m2_release
Zofia Grzelewska [Fri, 30 Aug 2019 16:19:11 +0000 (18:19 +0200)]
Release 0.14.24

* Add emergency backup for handling Cynara Db corruption
* Fix umask in Cynara service
* Change the config value of the "NoNewPrivileges=" ("true" -> "yes")

Change-Id: I74af0a8fe7adaae98ede770502223bc13262b750

5 years agoAdd emergency backup for handling Cynara Db corruption 67/211567/18
Alicja Kluczek [Fri, 26 Jul 2019 11:33:54 +0000 (13:33 +0200)]
Add emergency backup for handling Cynara Db corruption

Add emergency backup creation to admin API and cyad functionality.
This should be used during image creation to backup Cynada database.
Above functionality works *ONLY* in off-line mode.

Add mechanism to Cynara which replaces original database with backup
database after corruption detection. If there is integrity problem after
loading backup, cynara enters emergency mode.

After loading backup, flag file {$STATE_PATH}/db-recovered
is created containing timestamp of when corruption was detected and
backup was loaded.

Change-Id: I80924279145a3913f91f66ea133e690ce9b50a37

5 years agoFix umask in Cynara service 62/212962/1
Zofia Grzelewska [Wed, 28 Aug 2019 16:11:11 +0000 (18:11 +0200)]
Fix umask in Cynara service

Cynara service file resulted in Cynara creating updated
database files with 666 permissions. This commit changes
umask to 022.

Change-Id: I05976653d83ebe3abb7ae97483e816f6c372e3f8

5 years agoChange the config value of the "NoNewPrivileges=" ("true" -> "yes") 44/208544/1
INSUN PYO [Wed, 26 Jun 2019 01:07:47 +0000 (10:07 +0900)]
Change the config value of the "NoNewPrivileges=" ("true" -> "yes")

Change-Id: Ibb71a895d8ff9fed0f25f60e192eedcd6f0a402a

5 years agoRelease 0.14.23 86/208486/1 submit/tizen/20190625.054257
Tomasz Swierczek [Tue, 25 Jun 2019 04:49:51 +0000 (06:49 +0200)]
Release 0.14.23

* Remove unnecessary settings on cynara.target

Change-Id: Iec9178831b10ba1d82dbd87f737717d72a803b2e

5 years agoRemove unnecessary settings on cynara.target 51/204851/2
INSUN PYO [Mon, 29 Apr 2019 00:17:25 +0000 (09:17 +0900)]
Remove unnecessary settings on cynara.target

Change-Id: I66a80e2966be2aaf6872e162dbc9fea77c7bdfa9

6 years agoRelease 0.14.22 57/199457/1 accepted/tizen/unified/20190220.012548 submit/tizen/20190212.053303
Tomasz Swierczek [Mon, 11 Feb 2019 11:46:55 +0000 (12:46 +0100)]
Release 0.14.22

* Add release script
* Add strerror_r wrapper implementation

Change-Id: Iabeee79815cea8b9f2eca6b2f2228479d26b1530

6 years agoAdd release script 94/198994/2
Zofia Grzelewska [Tue, 29 Jan 2019 14:56:05 +0000 (15:56 +0100)]
Add release script

Add script helping in creating release commit:
* update version in all CMakeLists.txt files
* update version in all *.spec files
* update changelog
* generate commit message

Change-Id: Idc86879ed1ab64414f5a4f3b9855f013aeb55bed

6 years agoAdd strerror_r wrapper implementation 93/198993/2
Zofia Grzelewska [Mon, 28 Jan 2019 14:10:13 +0000 (15:10 +0100)]
Add strerror_r wrapper implementation

strerror function cannot be used inside client libararies.
This commit provides a convenient C++ wrapper of strerror_r
and applies it in all files linked with client libraries.

Change-Id: I2defc2fbb76cdca8a63a8b23b581b953d2803679

6 years agoRelease 0.14.21 82/197782/2 accepted/tizen/4.0/unified/20190122.043816 accepted/tizen/5.0/unified/20190118.055637 accepted/tizen/unified/20190117.151842 submit/tizen/20190116.132537 submit/tizen/20190117.004239 submit/tizen_4.0/20190117.080559 submit/tizen_5.0/20190116.132634
Tomasz Swierczek [Wed, 16 Jan 2019 13:00:45 +0000 (14:00 +0100)]
Release 0.14.21

* Fix cynara unit tests
* Fix issues from static analysis
* Add cynara sd-bus helper

Change-Id: I47c3bd5f35bb461965b1adad5e13601af3a18a14

6 years agoAdd exception handling in cynara_session_from_pid 72/197772/4
Tomasz Swierczek [Wed, 16 Jan 2019 07:59:14 +0000 (08:59 +0100)]
Add exception handling in cynara_session_from_pid

Change-Id: I4ad3a32100376e5790c08c5f400086bf031fb9fe

6 years agoFix test CynaraAdminPolicies.addOne 62/197562/2
Pawel Kowalski [Thu, 10 Jan 2019 12:20:45 +0000 (13:20 +0100)]
Fix test CynaraAdminPolicies.addOne

Remove unnecessary freeing of cynara admin policy fixed the test.
Freeing is performed using the unique pointer policyPtr and manual
freeing is no longer needed.

Change-Id: Ib649ee1878f00f476b383ad116e4a28809c8755c

6 years agoFix warnings found in static analysis 85/194285/4
Zofia Grzelewska [Mon, 26 Nov 2018 13:33:28 +0000 (14:33 +0100)]
Fix warnings found in static analysis

* remove octal constants - any integer constant beginning
with a '0' (zero) is treated as octal. Because of this,
it is possible for a zero-prefixed constant that is intended
to be a decimal number to be incorrectly entered as an octal number,
contrary to developer expectations (from c++test)
* remove unnecessary default constructors

Change-Id: Ie1ef6c27ea51fa6ea70f73e467fca922bd5be445

6 years agoAdd cynara sd-bus helper 10/189910/12
Monika Zielinska [Mon, 5 Nov 2018 12:17:38 +0000 (13:17 +0100)]
Add cynara sd-bus helper

* Added cynara_sd_bus_get_(client,user,pid) credential fetching API
  supporting sd-bus library
* API uses SD_BUS_CREDS_SELINUX_CONTEXT option for fetching Smack label
  as there is currently no other secure way

Change-Id: I36b771be3a5ba764467e36154fd520b3f0b3e2fc

6 years agoRelease 0.14.20 27/192127/3 accepted/tizen/5.0/unified/20181115.151528 accepted/tizen/unified/20181031.154000 submit/tizen/20181030.102005 submit/tizen_4.0/20181030.102029 submit/tizen_5.0/20181114.053118
Piotr Sawicki [Tue, 30 Oct 2018 09:36:46 +0000 (10:36 +0100)]
Release 0.14.20

* Fix SVACE defect in cyad test
* Increase backlog for listening sockets

Change-Id: Ibc9ec113b6e2bffe58419da5005485cf010212cf

6 years agoFix SVACE defect in cyad test 20/190020/5
Pawel Kowalski [Wed, 26 Sep 2018 10:57:10 +0000 (12:57 +0200)]
Fix SVACE defect in cyad test

* Add throwing bad_alloc() exception when allocating descriptions fails

Change-Id: Iecf17609cb6099efc76da4ea24b428f71d561430

6 years agoIncrease backlog for listening sockets 73/191473/2
Piotr Sawicki [Wed, 17 Oct 2018 09:28:22 +0000 (11:28 +0200)]
Increase backlog for listening sockets

When systemd's socket activaction is utilized, the default backlog
parameter passed to the listen() function is set to SOMAXCONN,
which is equal to 128. In distributions where systemd is not used
for socket activation, the default Cynara's UNIX socket
implementation sets the backlog value to 5.
Moreover, there are services which don't keep a connection open for
multiple Cynara's checks. They create one connection per one request.
All this may lead to rare overflow of an internal connection queue.
This manifests itself as the -EAGAIN error returned by connect().

To mitigate the issue, the backlog parameter has been set
to SOMAXCONN, which is a default value used by systemd.

Change-Id: Ia67d48155cbe442c208bac65a42cfc2923442bb0

6 years agoRelease 0.14.19 28/188128/1 accepted/tizen/5.0/unified/20181102.021310 accepted/tizen/unified/20180903.065020 submit/tizen/20180831.135753 submit/tizen_5.0/20181101.000004
Tomasz Swierczek [Fri, 31 Aug 2018 12:42:33 +0000 (14:42 +0200)]
Release 0.14.19

* Change dlog function to support serial console

Change-Id: I636368c6c7afe807dd2e8832b644027ff242f6ec

6 years agoChange dlog function to support serial console 43/187243/2
Kidong Kim [Tue, 21 Aug 2018 07:22:38 +0000 (16:22 +0900)]
Change dlog function to support serial console

Change-Id: I20f8e22e7cfa0bfc745cbba8ca46e7b3a80eea1c

6 years agoRelease 0.14.18 35/186435/1 accepted/tizen/4.0/unified/20180904.002710 accepted/tizen/unified/20180810.132633 submit/tizen/20180809.133453 submit/tizen_4.0/20180830.115035
Tomasz Swierczek [Thu, 9 Aug 2018 11:50:40 +0000 (13:50 +0200)]
Release 0.14.18

* Improve DB management - better error handling
* Verify db saving to files on policy change

Change-Id: I3ce7e53e40444b3d1b3f361d375b6ba52acc19e6

6 years agoVerify file read errors during database loading 51/185951/4
Lukasz Wojciechowski [Thu, 2 Aug 2018 18:48:35 +0000 (20:48 +0200)]
Verify file read errors during database loading

Verify if there are no IO errors during database loading from files.

Change-Id: I49ac887bae05f47b2b75dd6dc6489fc4d54562fb
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
6 years agoVerify database saving to files 50/185950/3
Lukasz Wojciechowski [Thu, 2 Aug 2018 17:56:32 +0000 (19:56 +0200)]
Verify database saving to files

There was a critical error in Cynara, that might cause loss of data stored
in the database. During the saving of the backup database, there was
no verification if writing data to files succeded. Only creation of files
was verified.

In case of no storage space on a device, empty files were created,
but no data was written into them.

This patch raises a DatabaseWriteException, which is propagated to higher
layers of Cynara or Cyad in offline mode and blocks changes in both
database and the in-memory structures. Also the proper error code
is returned to an admin process requesting a change in the database
or to a command line client in cyad's offline mode.

Change-Id: I9db6aeebc485f595f5eef1cdc8090830ae33949c
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
6 years agoHandle file errors in Cyad's bulk file policy set 49/185949/2
Lukasz Wojciechowski [Thu, 2 Aug 2018 15:58:42 +0000 (17:58 +0200)]
Handle file errors in Cyad's bulk file policy set

There was no error handling in case of the missing file passed to set policies
command in a bulk mode. Both, the missing file and the io operations' errors
were ignored.

This patch raises and handles a FileNotFound exception in CommandDispatcher.

Additionally the bulk file format accepts now empty lines, which allows
a logical division of policies in the file thus increasing readability.

All changes are covered by unit tests in commands_dispatcher.cpp

Change-Id: I27ccb97ffef6c07a6d0685ad4f2be73266ed8f2b
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
7 years agoRelease 0.14.17 38/174038/6 accepted/tizen/4.0/unified/20180328.140011 accepted/tizen/unified/20180330.060552 submit/tizen/20180327.142405 submit/tizen_4.0/20180327.142515
Tomasz Swierczek [Tue, 27 Mar 2018 12:44:18 +0000 (14:44 +0200)]
Release 0.14.17

Choose logging mechanism differently for Tizen 4.0 and earlier (syslog)
and Tizen 5.0 (dlog).
Fix minor issues in changelog and rpm summaries.

Change-Id: I48c048d5948115b217b770fcce3c4ada628abdf0

7 years agoUse syslog as a default logging mechanism in cmake 84/173884/2
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:36:10 +0000 (19:36 +0200)]
Use syslog as a default logging mechanism in cmake

Using FATAL_ERROR in case of undefined LOG_TYPE introduced in
"Change spec/cmake logging definitions - one cmake variable" patch
breaks backward compatibility of build recipies for non-Tizen systems.
As it changes default behaviour in case of undefined LOG_TYPE causing
build failure.

This commit reverts this behaviour. Undefined LOG_TYPE on cmake level
will trigger usage of syslog again.

This patch affects only non-Tizen distributions as Tizen uses .spec files,
which always define log type.

Change-Id: I034a0d614c0732c7c602b245eace26c42c59cfe1
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
7 years agoFix typo in changelog 83/173883/1
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:28:50 +0000 (19:28 +0200)]
Fix typo in changelog

Change-Id: I27e7928f5bb11dbd61b743df387c780ddda93ae8
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
7 years agoFix main rpm packages summaries 82/173882/1
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:22:32 +0000 (19:22 +0200)]
Fix main rpm packages summaries

Change-Id: Ic0ec04a4fc0743d712762b4fcd968328a6932926
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
7 years agoChoose log_type depending on Tizen version 81/173881/1
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:03:19 +0000 (19:03 +0200)]
Choose log_type depending on Tizen version

Tizen 5.0 requires logging to dlog, while older versions of Tizen (4.0, 3.0)
use syslog mechanism.
Logging mechanism is choosen depending on Tizen major version.

Change-Id: I5771605f4416ca5cd87a8a9f7b6ad6495aefa224
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
7 years agoRelease 0.14.16 62/173762/1 accepted/tizen/unified/20180329.125133 submit/tizen/20180323.192228
Tomasz Swierczek [Fri, 23 Mar 2018 19:00:36 +0000 (20:00 +0100)]
Release 0.14.16

Fix logging in cynara-plugins

Change-Id: I6269b3911fd9045010424993e4af69ad295d1b11

7 years agoFix logging in cynara-plugins 61/173761/2
Tomasz Swierczek [Fri, 23 Mar 2018 18:21:10 +0000 (19:21 +0100)]
Fix logging in cynara-plugins

Cynara plugins include log.h in its interface, making log.h header
visible to external modules that implement plugins. Such change
was introduced to Cynara when log.h implemented only one kind of logger (journal).

Today, this file can alternatively compile to use syslog, journal or dlog,
depending on definitions passed from spec/cmake. This causes external modules
to rely on Cynara's internal macros, not defined in their cmake files.

This commit returns back "feature" of log.h to compile to syslog usage
as it was prior 0.14.15 release, in order to fix external module build breaks,
introduced by commit 632d8296266547f2291e03149e54fbc399bd9de8.

Ideally, this problem requires more changes - changing logging in dependent
modules not to use Cynara's loging definitions from log.h & removing log.h from API.

However, Since Cynara is an open source project and may be used outside Tizen, this change is
introduced first - modifying API should be done with careful consideration for external users.

Change-Id: I99c80ceb636fd9797b2419eb87b81171351b95f3

7 years agoRelease 0.14.15 30/173430/7 submit/tizen/20180323.154828
Tomasz Swierczek [Wed, 21 Mar 2018 09:58:41 +0000 (10:58 +0100)]
Release 0.14.15

Changed spec/cmake logging definitions - one cmake variable
Added dlog as default logging option
Changed PIE handling (PIC for libs, PIE for executables)

Change-Id: I42464174e81856e0cf2e1bcd050592291ee1eb0b

7 years agoChange spec/cmake logging definitions - one cmake variable 16/173616/6
Tomasz Swierczek [Thu, 22 Mar 2018 10:43:30 +0000 (11:43 +0100)]
Change spec/cmake logging definitions - one cmake variable

Previous independent CMAKE definitions for each logging backend
were changed to one variable defining type of backend

Change-Id: I7b85123948f856fd5100931bb924555e589048d3

7 years agoAdd dlog as Tizen-platform specific (& default) logging option 08/172708/10
Tomasz Swierczek [Wed, 14 Mar 2018 11:42:43 +0000 (12:42 +0100)]
Add dlog as Tizen-platform specific (& default) logging option

Change-Id: Ie2cf9e45c958785cd9891929afcac8ea6cb93920

7 years agopackaging: make shared libs with PIC, executables with PIE 63/173063/4
Tomasz Swierczek [Thu, 22 Mar 2018 16:01:40 +0000 (17:01 +0100)]
packaging: make shared libs with PIC, executables with PIE

CXXFLAGS/LDFLAGS defined in spec file caused everything compile with PIE;
ASAN requires shared libs to be with PIC

Change-Id: I315128fa7dff344b60602b3d6e5b7a889d39f45e

7 years agoRelease 0.14.14 20/168320/1 accepted/tizen/4.0/unified/20180131.050351 accepted/tizen/unified/20180126.145133 submit/tizen/20180125.164602 submit/tizen_4.0/20180125.164627
Zofia Grzelewska [Thu, 25 Jan 2018 15:48:45 +0000 (16:48 +0100)]
Release 0.14.14

Added hardening options to all build artifacts

Change-Id: I406dd89d541912dc6ec1f28fd23f2ba0e2839eb9

7 years agoAdded hardening options to all build artifacts 38/167738/1 accepted/tizen/unified/20180123.061121 submit/tizen/20180119.112109
Tomasz Swierczek [Fri, 12 Jan 2018 11:41:10 +0000 (12:41 +0100)]
Added hardening options to all build artifacts
* added PIE
* added RELO

Change-Id: Ie4ee57c987352103fd3a31e59dd3485a181545a4

7 years agoRelease 0.14.13 89/150789/1 accepted/tizen/4.0/unified/20170920.081727 accepted/tizen/unified/20170922.194232 submit/tizen/20170919.093121 submit/tizen_4.0/20170918.152308 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m2_release
Zofia Abramowska [Mon, 18 Sep 2017 14:04:10 +0000 (16:04 +0200)]
Release 0.14.13

Fix SVACE defects :
* Create explicit instantiation of StorageSerializer

Change-Id: I936187f3c452e487d5b0dca004c96e309527671f

7 years agoCreate explicit instantiation of StorageSerializer 44/150444/2
Zofia Abramowska [Fri, 15 Sep 2017 15:07:30 +0000 (17:07 +0200)]
Create explicit instantiation of StorageSerializer

Change-Id: Iec4e24e0d9e73ecc95b7698f6a027d033a060144

7 years agoRelease 0.14.12 55/143355/1 accepted/tizen/4.0/unified/20170829.020213 accepted/tizen/unified/20170810.172048 submit/tizen/20170809.105839 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004
Zofia Abramowska [Wed, 9 Aug 2017 10:18:25 +0000 (12:18 +0200)]
Release 0.14.12

* Fix unreachable code
* Enforce PIE globally through main CMakeLists

Change-Id: I7684b905a5817a28548375aa39f780e02ca78454

7 years agoFix unreachable code 95/142895/2
Zofia Abramowska [Mon, 7 Aug 2017 11:46:48 +0000 (13:46 +0200)]
Fix unreachable code

Log was printed after throwing an exception. This commit moves
it before throw.

Change-Id: Idb840c166052c96b013733c7cf2cb14a935a38e0