platform/core/security/cynara.git
9 years agoAdd PolicyBucketId validation 31/28431/10
Pawel Wieczorek [Mon, 6 Oct 2014 17:08:25 +0000 (19:08 +0200)]
Add PolicyBucketId validation

This patch introduces mechanism for checking whether new PolicyBucketId
contains forbidden characters. Now only alphanumeric characters, hyphen
and underscore can be used in PolicyBucketId. InvalidBucketIdException
is thrown and OPERATION_NOT_ALLOWED error code is returned otherwise.

Change-Id: I48b6e14d20cb62adc17560929055553df0ce1077

9 years agoRemove PolicyBucket() constructor 82/28382/8
Pawel Wieczorek [Mon, 6 Oct 2014 10:45:25 +0000 (12:45 +0200)]
Remove PolicyBucket() constructor

In some cases using parameterless constructor of PolicyBucket can
result in uninitialized PolicyBucket id. Complete removal of this
constructor guarantees inablity to create bucket with no id.

Change-Id: Id67d7f257697078ef0d4518161ade473a983cf6b

9 years agoAdd cynara_creds_get_[client|user]_method UT 19/29219/4
Radoslaw Bartosiak [Wed, 22 Oct 2014 20:52:50 +0000 (22:52 +0200)]
Add cynara_creds_get_[client|user]_method UT

Adding unit tests for functions used in implementation of
cynara_creds_get_[client|user]_methods

Change-Id: I3cb7b9fb03e09769dbb68fd595994cbe13956483
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
9 years agoImplement cynara_creds_get_[client|user]_method 06/27306/19
Radoslaw Bartosiak [Wed, 10 Sep 2014 13:04:17 +0000 (15:04 +0200)]
Implement cynara_creds_get_[client|user]_method

The functions enable obtaining system default identification method
for [process|user] by reading a configuration file (default
/etc/cynara/creds.conf).

Change-Id: I662a7681abbaa130a3d628352a13ff950a7affd3
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
9 years agoAdd creds configuration 36/27236/12
Radoslaw Bartosiak [Mon, 8 Sep 2014 11:45:22 +0000 (13:45 +0200)]
Add creds configuration

Configuration is used by cynara_creds_get_[client|user]_method to
provide default values of [client|user] feature used in
cynara-creds.

Change-Id: I9a8b8e0bb009817414b9755523a60edb3d0386d0
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
9 years agoAdjust admin API policy type codes 71/27971/5
Lukasz Wojciechowski [Tue, 23 Sep 2014 15:50:27 +0000 (17:50 +0200)]
Adjust admin API policy type codes

External admin API policy types should match inner cynara values
used in storage and protocols. That would make plugins work easier
and allows correct work of cynara_admin_check function.

New header cynara-policy-types.h is provided by libcynara-common.
It defines policy type values and is included by external admin API.
Predefined policies variables use same values for initialization.

Change-Id: If1b158dcd5abbe9ee3af692e706a2d2e886f8631

9 years agoRemove unnecessary dependencies to Cynara 84/29184/1
Jacek Bukarewicz [Wed, 22 Oct 2014 09:06:04 +0000 (11:06 +0200)]
Remove unnecessary dependencies to Cynara

Change-Id: I02c00332c20083639b862231b507545103613051

9 years agoAdd new libcynara-admin return code 18/28018/4
Pawel Wieczorek [Wed, 24 Sep 2014 10:11:12 +0000 (12:11 +0200)]
Add new libcynara-admin return code

Added code is:
        CYNARA_ADMIN_API_OPERATION_FAILED

It is used to indicate failures during saving database to storage. This
patch also adds handling such situations.

Change-Id: I35b7d3334def8e688a180ddec6861c0f3bdd70d6

9 years agoFix creation of bucket in InMemoryStorageBackend 58/27958/5
Aleksander Zdyb [Tue, 14 Oct 2014 07:59:49 +0000 (09:59 +0200)]
Fix creation of bucket in InMemoryStorageBackend

This prevents creation of bucket without properly
initialized id.

Change-Id: Ib5374e15a0172e48ca5413987df256f19595fe91

9 years agoFix comment in cynara-async api header 09/28709/2
Marcin Niesluchowski [Tue, 14 Oct 2014 11:36:08 +0000 (13:36 +0200)]
Fix comment in cynara-async api header

Change-Id: Id195797893866f5aca48b1120c04e2d2ebb69813

9 years agoSet build_type default value in a different way 41/28741/3
Jacek Bukarewicz [Wed, 15 Oct 2014 08:21:00 +0000 (10:21 +0200)]
Set build_type default value in a different way

Apparently gbs couldn't parse previous construct properly and installed
debug libraries regardless of build_type.

Change-Id: I84c6456efc692da9f1bec94b071d8107a540f3d8
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
9 years agoUse TryCatch() for exception catching in admin library 82/28782/2
Lukasz Wojciechowski [Thu, 16 Oct 2014 06:25:04 +0000 (08:25 +0200)]
Use TryCatch() for exception catching in admin library

Change-Id: I01d0b075c7d9cb5d94cadfe2c1dc5da7bd326027

9 years agoMove TryCatch from client-common to common library 19/28719/4
Lukasz Wojciechowski [Tue, 14 Oct 2014 12:45:27 +0000 (14:45 +0200)]
Move TryCatch from client-common to common library

TryCatch can be used also in admin libraries,
so it belongs to common library now.

Change-Id: Ibdd9c1576b9b34195555c2d9b43e72b57a83a201

9 years agoRename cynara-client-error.h to cynara-error.h 18/28718/4
Lukasz Wojciechowski [Tue, 14 Oct 2014 12:37:07 +0000 (14:37 +0200)]
Rename cynara-client-error.h to cynara-error.h

Apply new name to all files.

Change-Id: I9e4590a40e11ba5a33442707207635bb0d75a278

9 years agoUse client error codes in admin libraries 17/28717/4
Lukasz Wojciechowski [Tue, 14 Oct 2014 12:09:00 +0000 (14:09 +0200)]
Use client error codes in admin libraries

We need to have one unified set of error codes. Client
error codes have been adjusted to serve admin errors
too. Then client error codes were used in admin
libraries keeping following mapping:
CYNARA_ADMIN_API_SUCCESS
   -> CYNARA_API_SUCCESS
CYNARA_ADMIN_API_OUT_OF_MEMORY
   -> CYNARA_API_OUT_OF_MEMORY
CYNARA_ADMIN_API_INVALID_PARAM
   -> CYNARA_API_INVALID_PARAM
CYNARA_ADMIN_API_SERVICE_NOT_AVAILABLE
   -> CYNARA_API_SERVICE_NOT_AVAILABLE
CYNARA_ADMIN_API_UNEXPECTED_CLIENT_ERROR
   -> CYNARA_API_UNKNOWN_ERROR
CYNARA_ADMIN_API_OPERATION_NOT_ALLOWED
   -> CYNARA_API_OPERATION_NOT_ALLOWED
CYNARA_ADMIN_API_BUCKET_NOT_FOUND
   -> CYNARA_API_BUCKET_NOT_FOUND

Remove not needed anymore old admin error codes file:
src/include/cynara-admin-error.h

Change-Id: Ice8990a2b354bd489c67c2a004344a5c60fc15ee

9 years agoRemove "noexcept" keyword from PolicyBucket 16/28716/3
Lukasz Wojciechowski [Tue, 14 Oct 2014 09:13:25 +0000 (11:13 +0200)]
Remove "noexcept" keyword from PolicyBucket

Change-Id: I0b00841efadb7584e854a04286758caf90e400cc

9 years agoClean up exception classes 15/28715/4
Lukasz Wojciechowski [Tue, 14 Oct 2014 07:21:41 +0000 (09:21 +0200)]
Clean up exception classes

Some minor clean-ups in exceptions classes:
* remove "noexcept" keyword from exception classes;
* catch exceptions in Exception::what();
* correcting comments;
* adding missing virtual keyword;
* rearranging public and private sections.

Change-Id: I99c382838adb22429a7ea8ac35974c988b3d3f33

9 years agoRemove "noexcept" keyword from admin's Logic class 14/28714/3
Lukasz Wojciechowski [Tue, 14 Oct 2014 06:47:31 +0000 (08:47 +0200)]
Remove "noexcept" keyword from admin's Logic class

We don't want cause application termination.
All exceptions should be caught and handled.

Change-Id: Ic245fb42a8b8fa7a7d83665ce95c4acb89c5b964

9 years agoAdd PluginErrorException 52/28452/8
Zofia Abramowska [Tue, 7 Oct 2014 12:46:47 +0000 (14:46 +0200)]
Add PluginErrorException

Add exception class for plugin processing error.

Change-Id: I26090bd3a54bdbc4767fd05735b5b06fae523b2f

9 years agoAdd PluginManager 45/27845/13
Zofia Abramowska [Fri, 19 Sep 2014 14:42:02 +0000 (16:42 +0200)]
Add PluginManager

Add cynara service manager for loading and managing dynamic loaded
plugins supporting custom policy types.

Change-Id: I94c3bfa4842a6a8d0a078ac910aba5e54db7b468

9 years agoAdd cynara external plugins 64/27464/13
Zofia Abramowska [Thu, 18 Sep 2014 16:37:40 +0000 (18:37 +0200)]
Add cynara external plugins

Add interface for creating external cynara plugin to enable custom
policy types support.

Change-Id: I43bd31a3e48f9667964107dd243f2286e7ffae8a

9 years agoSplit PolicyResult declaration and definition 66/27766/11
Zofia Abramowska [Thu, 18 Sep 2014 15:33:53 +0000 (17:33 +0200)]
Split PolicyResult declaration and definition

PolicyResult header will be included in package for external plugin
implementations.

Change-Id: Ic5224af395b9fd86f57138566295961e80ee8f12

9 years agoFix cache update method 98/27598/11
Zofia Abramowska [Tue, 16 Sep 2014 10:53:09 +0000 (12:53 +0200)]
Fix cache update method

Support update with existing entry.

Change-Id: I0a242c9580ae0a521fddb8bf4fc4c2b8be3507c0

9 years agoRedo client plugins 51/27451/11
Zofia Abramowska [Fri, 12 Sep 2014 13:45:36 +0000 (15:45 +0200)]
Redo client plugins

Let plugin make decision based on last and current client session.
Plugin can change PluginResult.

Change-Id: Ia985feaf1d60a8c1ebf858ba0d4e0d6f2cc6fa40

9 years agoImproving creation of user 'cynara' 89/28389/4
José Bollo [Mon, 6 Oct 2014 15:31:59 +0000 (17:31 +0200)]
Improving creation of user 'cynara'

To improve the creation of the user cynara, the
home directory is now set to /var/lib/empty,
the shell is set to /sbin/nologin, the main group
is set to cynara.

Change-Id: I4582caa9f9a61cd8c52d0a6718f504903cdee479
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
9 years agoImplement cynara_async_cancel_request() 60/28060/15
Marcin Niesluchowski [Wed, 24 Sep 2014 12:14:07 +0000 (14:14 +0200)]
Implement cynara_async_cancel_request()

Change-Id: I028d6a2941dc68359590263cda9e5bff2b839317

9 years agoAdd creating, sending and receiving check requests 85/28285/7
Marcin Niesluchowski [Thu, 18 Sep 2014 09:32:15 +0000 (11:32 +0200)]
Add creating, sending and receiving check requests

cynara_async_create_request() and cynara_async_process() functions work
according to the API header excluding possibility to cancel request.

Change-Id: I9818be674d58da5bd431a08b7faf47dfe0157289

9 years agoImplement cynara_async_check_cache() 42/27742/20
Marcin Niesluchowski [Thu, 18 Sep 2014 12:41:01 +0000 (14:41 +0200)]
Implement cynara_async_check_cache()

Change-Id: I1930cdf448dcfdf800d0d5c322ff100baf5a4987

9 years agoAdd connection check 62/27262/28
Marcin Niesluchowski [Mon, 15 Sep 2014 09:54:48 +0000 (11:54 +0200)]
Add connection check

cynara_async_check_cache should return CYNARA_API_CACHE_MISS if
disconnected.
cynara_async_create_request and cynara_async_cancel_request should try
reconnecting if disconnected and return CYNARA_API_SERVICE_NOT_AVAILABLE
on failure.
As cynara_async is connecting asynchronously, it could take connection
in progress state which is resolved in cynara_async_process and treated
as connected in other functions. As this state exists after reconnecting,
there should be no cache entries. cynara_async_process should complete
connecting if needed by waiting for write event. If connection fails in
cynara_async_process, then CYNARA_API_SERVICE_NOT_AVAILABLE should be
returned.

Change-Id: I2920f4dbd0bde3e7be74096db33f4ff465bc5028

9 years agoAdd asynchronous socket 24/27524/28
Marcin Niesluchowski [Mon, 15 Sep 2014 09:42:42 +0000 (11:42 +0200)]
Add asynchronous socket

Change-Id: I1ca062fee144b8244fba88ae3155096df043c61e

9 years agoMove socket paths to common library 20/27520/11
Marcin Niesluchowski [Mon, 15 Sep 2014 09:17:34 +0000 (11:17 +0200)]
Move socket paths to common library

Change-Id: I4b5bf9c2bc47aca6f87bb89942a09b2a8ae6e251

9 years agoAdd async api stub implementation 30/27230/12
Marcin Niesluchowski [Thu, 4 Sep 2014 13:50:32 +0000 (15:50 +0200)]
Add async api stub implementation

Below are listed asynchronous API functions with its value
returned for valid params and enough memory (stub version).
- cynara_async_initialize     CYNARA_API_SUCCESS
- cynara_finish
- cynara_async_cache_check    CYNARA_API_CACHE_MISS
- cynara_async_create_request CYNARA_API_MAX_PENDING_REQUESTS
- cynara_async_process        CYNARA_API_SUCCESS
- cynara_async_cancel_request CYNARA_API_SUCCESS

Change-Id: Ic10d04adc5e7d45fa643a1e817db2670c05790cf

9 years agoAdd function for catching all client exceptions 60/28560/3
Marcin Niesluchowski [Thu, 9 Oct 2014 14:37:56 +0000 (16:37 +0200)]
Add function for catching all client exceptions

Change-Id: Ia70b4ee257aa279a26862f3d412f81dfdcae3309

9 years agoAdd asynchronous API header 26/26426/11
Zofia Abramowska [Wed, 8 Oct 2014 15:16:18 +0000 (17:16 +0200)]
Add asynchronous API header

Add simple API which provide means to:
- ask cynara if <client, user> has permission to <privilege>
  using cynara_async_check() for cache check
- create request for <client, user> having permission to <privilege>
  to be sent using cynara_async_create_request()
- send requests and receive responses using cynara_async_process()
- cancel created request using cynara_async_cancel_request()
- inform user about available response and status changes of cynara
  socket through callbacks
This is an asynchronus API, so all I/O operations inside are
non-blocking.

Change-Id: Id6d53eae7587c11288d44bb2dd7980ec039e7ca0

9 years agoChange client API error codes 17/28517/1
Zofia Abramowska [Wed, 8 Oct 2014 15:14:01 +0000 (17:14 +0200)]
Change client API error codes

Add CYNARA_API_ACCESS_ALLOWED to be returned instead of CYNARA_API_SUCCESS
from cynara check call.
Renumber client API error codes - now CYNARA_API_ACCESS_DENIED is treated
as answer, not as error.

Change-Id: I3d64afdc3cc241de8515be507858304efd729da6

9 years agoRemoving home directory creation for user cynara 55/28355/2
José Bollo [Fri, 3 Oct 2014 12:00:06 +0000 (14:00 +0200)]
Removing home directory creation for user cynara

Cynara should not create a home directory.
If it must, specific options have to be providen
that explicitely should set the home directory
not in /home and should use a specific skeleton.

Change-Id: I296a5856fbae399944b41babf5ebb89a1f0f93eb
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
9 years agoReplace @file commands for Doxygen compatibility 37/27837/5
Pawel Wieczorek [Mon, 15 Sep 2014 14:49:19 +0000 (16:49 +0200)]
Replace @file commands for Doxygen compatibility

Not all filenames are unique for the whole project. This affects
Doxygen, as it ignores repeated @file descriptions. Patch replaces
Doxygen @file commands with full relative path to the source file.

Change-Id: Iabcdf59e9bf6fae3137598e6013f0a552e82acba

9 years agoReplace old Aleksander Zdyb's email address 11/27511/3
Pawel Wieczorek [Mon, 15 Sep 2014 08:38:17 +0000 (10:38 +0200)]
Replace old Aleksander Zdyb's email address

Change-Id: I39dd94fe49039cdafeedbd1098ae72247b3f1fbd

9 years agoAdd extra asterisk to file description comments 06/27506/3
Pawel Wieczorek [Mon, 15 Sep 2014 07:53:14 +0000 (09:53 +0200)]
Add extra asterisk to file description comments

File description comment blocks lacked an extra asterisk for JavaDoc
style. This affected Doxygen as it couldn't process these documentation
comments. Patch does not affect license comment blocks.

Change-Id: Ic0222b821b242b5d318c7cefce1865952ba6ccb5

9 years agoReplace @file description different than filename 12/27412/2
Pawel Wieczorek [Fri, 12 Sep 2014 09:33:35 +0000 (11:33 +0200)]
Replace @file description different than filename

Not all @file descriptions matched corresponding filenames. This
affects Doxygen, as it ignores such documentation comments. Patch
fixes these Doxygen @file commands.

Change-Id: I047ea1bde6c13ff2dd6ec90ea61abb2faaf7aaac

9 years agoExtract storage code into libcynara-storage 33/27533/5
Aleksander Zdyb [Wed, 17 Sep 2014 06:22:20 +0000 (08:22 +0200)]
Extract storage code into libcynara-storage

libcynara-storage is an extrenal library containing
C++ symbols used in cynara itself as well as
in upcomming libcynara-offline-admin.

Change-Id: I56ce83339ec3bc1b17cc54e3ba5f3863316117fe

9 years agoIntroduce cynara-offline-admin API 13/27513/7
Aleksander Zdyb [Mon, 15 Sep 2014 09:01:08 +0000 (11:01 +0200)]
Introduce cynara-offline-admin API

cynara-offline-admin is a special administrative API,
which allows to alter Cynara's database directly
on filesystem.

Change-Id: I47365889f2afc05ee8a40aeee5bd3bb1de22dccd

9 years agoImplement AdminCheck in admin library logic layer 56/27556/5
Lukasz Wojciechowski [Tue, 16 Sep 2014 05:42:52 +0000 (07:42 +0200)]
Implement AdminCheck in admin library logic layer

Change-Id: I3b404514dbccd1829c2850b0f0f1b2dfe15d8ea9

9 years agoImplement AdminCheck in service's logic layer 55/27555/5
Lukasz Wojciechowski [Mon, 15 Sep 2014 19:59:31 +0000 (21:59 +0200)]
Implement AdminCheck in service's logic layer

Change-Id: Ia4adbbb8403af6341dc4451bd2440d86a72177d8

9 years agoImplement AdminCheck serialization in AdminProtocol 54/27554/5
Lukasz Wojciechowski [Mon, 15 Sep 2014 19:47:12 +0000 (21:47 +0200)]
Implement AdminCheck serialization in AdminProtocol

Change-Id: I6f52d98f21bcec0fc3db7db4d3ba83fb05153b76

9 years agoSplit OpCheckPolicy into request and response codes 53/27553/5
Lukasz Wojciechowski [Mon, 15 Sep 2014 19:39:45 +0000 (21:39 +0200)]
Split OpCheckPolicy into request and response codes

Improve log formatting and casting arguments.

Change-Id: I16f279b7fca61108f1627c9de2996dba84165ba6

9 years agoAdd AdminCheckRequest class 52/27552/5
Lukasz Wojciechowski [Mon, 15 Sep 2014 18:33:39 +0000 (20:33 +0200)]
Add AdminCheckRequest class

Change-Id: I7be5c10c6905a0c4f561731a40288095c6a5e4d4

9 years agoAdd adminCheck() method prototype in admin Logic 51/27551/5
Lukasz Wojciechowski [Mon, 15 Sep 2014 17:16:17 +0000 (19:16 +0200)]
Add adminCheck() method prototype in admin Logic

Implement external API using newly added method.

Change-Id: If086d8e33caaec87da5cbb2c25e6dd4163c01048

9 years agoAdd admin_check() prototype 50/27550/4
Lukasz Wojciechowski [Mon, 15 Sep 2014 14:39:37 +0000 (16:39 +0200)]
Add admin_check() prototype

Change-Id: I650cf0748479ec1646d20cd2b767e26905770116

9 years agoMove some definitions outside of cynara-admin.h 12/27512/6
Aleksander Zdyb [Wed, 17 Sep 2014 06:20:44 +0000 (08:20 +0200)]
Move some definitions outside of cynara-admin.h

The consts and structs will be used by both cynara-admin
and upcomming cynara-offline-admin APIs.

Change-Id: I05e320e54ff9c6a16521318560de059c6928cbea

9 years agoRemove instruction & stack pointers from backtrace 69/27469/2
Adam Malinowski [Fri, 12 Sep 2014 19:29:30 +0000 (21:29 +0200)]
Remove instruction & stack pointers from backtrace

These pointers don't provide useful information but consumes
a lot of space in backtrace lines.

Change-Id: I063485334ad619d8bed6d617e5fb96673f3ce938

9 years agoAdd source info to backtrace 58/27358/2
Adam Malinowski [Thu, 11 Sep 2014 09:10:01 +0000 (11:10 +0200)]
Add source info to backtrace

This patch recovers putting source code information in backtrace.
Previous solution was based on binutils but its license is not
acceptable. This patch uses elfutils library licensed under LGPL3.

Change-Id: I1df0a54ac0702f08d876728b535fd0e172efca17

9 years agoFix startup with half-populated db 52/26552/5
Aleksander Zdyb [Tue, 26 Aug 2014 08:41:33 +0000 (10:41 +0200)]
Fix startup with half-populated db

In some cases, Cynara could start with half-populated database.
As this is potential security issue, we now make sure, that in case
of any error, Cynara will start with empty database and return DENY
for every request.

There are added tests revealing these potential issues.
Some test cases depend on specific state of Cynara's policy database
directory. These are now provided in cynara-tests package and placed
in /usr/share/cynara/tests/ during installation.
Test execution does not affect real database -- it uses above tests
path only, accessible by non-root users as well.

Signed-off-by: Aleksander Zdyb <a.zdyb@partner.samsung.com>
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
Change-Id: Ia943f77a2a0c85f394c40dd10333a73df4d0c96a

9 years agoAdd missing 'struct' keyword in cynara-admin.h 57/27357/2
Jacek Bukarewicz [Thu, 11 Sep 2014 13:37:41 +0000 (15:37 +0200)]
Add missing 'struct' keyword in cynara-admin.h

Change-Id: I48405d368fb8a95a86d6c94df5c50a490869f1e4

9 years agoSupport NONE policy in admin API 01/26301/4
Aleksander Zdyb [Wed, 20 Aug 2014 09:24:44 +0000 (11:24 +0200)]
Support NONE policy in admin API

Change-Id: I8a54f020f2d69f9c0ad71773b8d32b09f6519b9e

9 years agoSupport NONE policy in storage 00/26300/4
Aleksander Zdyb [Wed, 20 Aug 2014 06:30:23 +0000 (08:30 +0200)]
Support NONE policy in storage

Change-Id: I80d28fee394c5e461bccf102b0d6f7b4ab243174

9 years agoAdd start point in Storage::checkPolicy() 45/26145/4
Aleksander Zdyb [Mon, 18 Aug 2014 11:05:58 +0000 (13:05 +0200)]
Add start point in Storage::checkPolicy()

Storage::checkPolicy() now accepts id of bucket to start
search with. Additional parameter (recursive) indicates,
if search should go down into encountered buckets.

Change-Id: I23ff8e044fc9ff0198183c335ffe845e75efe08b

9 years agoRelease 0.3.0 82/27182/2 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi tizen_3.0.2014.q3_common tizen_3.0.m14.3_ivi accepted/tizen/common/20140905.175100 accepted/tizen/ivi/20140911.203535 submit/tizen/20140905.155121 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.3_ivi_release v0.3.0
Lukasz Wojciechowski [Fri, 5 Sep 2014 14:56:04 +0000 (16:56 +0200)]
Release 0.3.0

Change-Id: I5e2b5d39b1a14dca7575dcfd8812087f401dc82a

9 years agoAdd changelog for keeping release history 81/27181/2
Lukasz Wojciechowski [Fri, 5 Sep 2014 14:31:43 +0000 (16:31 +0200)]
Add changelog for keeping release history

Changelog filled with historical data.

Change-Id: Idf35e1024d19ac2e66699b2aea6555a5a37ae323

9 years agobuild: allow conditional building of cynara-tests, turn it on in spec 45/27045/3
Rafal Krypa [Wed, 3 Sep 2014 14:04:26 +0000 (16:04 +0200)]
build: allow conditional building of cynara-tests, turn it on in spec

Change cmake to build cynara-tests only when enabled and enable it in spec
file. This will enable cynara build outside of Tizen (without tests).
Current setup for cynara-tests build depends on Tizen-specific packaging of
gmock package. This dependency cannot be met outside of Tizen, which would
break the whole build.
It is not easy to apply a proper fix to have cynara-tests built outside of
Tizen. Gmock is not meant to be used as dependency in such way.
Most certainly we will have to handle gmock dependency differently in
upstream and in Tizen.

Change-Id: Id9fc8142979d1a2061c1c72c610520479d9e61a2
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobuild: unbreak out-of-tree build of pkgconfig files 46/27046/3
Rafal Krypa [Wed, 3 Sep 2014 14:22:45 +0000 (16:22 +0200)]
build: unbreak out-of-tree build of pkgconfig files

Fix regression introduced recently in 21175a33. "Make install" fails on
pkgconfig files when building out-of-tree.

Change-Id: Ib544993ae4daa784ca93d9e115eeba9830957ecc
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobuild: configure default installation directories in cmake 44/27044/2
Rafal Krypa [Wed, 3 Sep 2014 14:05:03 +0000 (16:05 +0200)]
build: configure default installation directories in cmake

Set the default installation paths in main CMakeLists.txt. On Tizen these
settings will be overridden by variables passed to cmake by rpmbuild.
But having them defined makes the standalone build possible, outside of
Tizen.

Change-Id: Idf84ff5a5e15fd99912b53e0970198d031bbbee5
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoFix creds dependencies 99/27099/2
Zofia Abramowska [Thu, 4 Sep 2014 13:16:42 +0000 (15:16 +0200)]
Fix creds dependencies

Change-Id: I3d5dd7bdfad9a58b99e754d5acb9dcb20a18b0e8

9 years agoAdd documentation to cynara-creds-commons.h 10/27110/4
Radoslaw Bartosiak [Thu, 4 Sep 2014 13:59:50 +0000 (15:59 +0200)]
Add documentation to cynara-creds-commons.h

Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
Change-Id: I717b1cc988c5fc6780d42774c75a4596a522c3e2

9 years agoSynchronize RPM and pkg-config versions 60/26760/6
Jacek Bukarewicz [Thu, 28 Aug 2014 12:21:47 +0000 (14:21 +0200)]
Synchronize RPM and pkg-config versions

This change also introduces CYNARA_VERSION cmake variable which will need
to be kept in sync with rpm package version.
We cannot rely on passing version from RPM spec since we want to be able
to build Cynara independently of the Tizen build system.

Change-Id: I1bdd3a603a486d386f261e8330a9635923945569
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
9 years agoImplement cynara-creds-dbus library 88/26988/6
Aleksander Zdyb [Thu, 4 Sep 2014 13:31:31 +0000 (15:31 +0200)]
Implement cynara-creds-dbus library

Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
Signed-off-by: Aleksander Zdyb <a.zdyb@partner.samsung.com>
Change-Id: Iccf9cb0acb1016746d8af7a4ee85714e74f4664e

9 years agoAdd mockuped versions of default credential methods helpers 90/26890/6
Radoslaw Bartosiak [Sun, 31 Aug 2014 19:01:33 +0000 (21:01 +0200)]
Add mockuped versions of default credential methods helpers

Change-Id: I762a435b4a2fcf81239e7d91b454cd8c785095cb

9 years agoPrepare libcynara-creds-dbus for implementation 89/26889/6
Radoslaw Bartosiak [Wed, 3 Sep 2014 19:48:25 +0000 (21:48 +0200)]
Prepare libcynara-creds-dbus for implementation

Change-Id: Ibdecf8790b7d296e35c063c52202a4a672ad9e9a

9 years agoImplement cynara-creds-socket library 88/26888/6
Radoslaw Bartosiak [Wed, 3 Sep 2014 19:13:03 +0000 (21:13 +0200)]
Implement cynara-creds-socket library

Change-Id: Ifa27c49c3361547c75d50aa7cbf72e4bd3648201

9 years agoAdd enums for credentials acquire methods 87/26887/5
Radoslaw Bartosiak [Wed, 3 Sep 2014 19:23:56 +0000 (21:23 +0200)]
Add enums for credentials acquire methods

Change-Id: I5719a7622a78ae6d1ca86a7dcce986c69abb3e23

9 years agoAdd new error codes needed by credential helpers 86/26886/5
Radoslaw Bartosiak [Sun, 31 Aug 2014 08:22:44 +0000 (10:22 +0200)]
Add new error codes needed by credential helpers

Added codes are:
    CYNARA_API_METHOD_NOT_SUPPORTED
    CYNARA_API_UNKNOWN_ERROR

Change-Id: I604ce30b37bdfe4ecba637bcf423e6fea0b2610c

9 years agoImplement cynara-session library 81/26881/7
Radoslaw Bartosiak [Wed, 3 Sep 2014 19:13:03 +0000 (21:13 +0200)]
Implement cynara-session library

Change-Id: I929408dc59db5f4ab115567fd4839258bd086418

9 years agoAdd credential and session helper libraries 35/26035/14
Radoslaw Bartosiak [Thu, 14 Aug 2014 11:53:16 +0000 (13:53 +0200)]
Add credential and session helper libraries

This change introduces libraries with following functionalities:
a) simple session id generation
b) user_id and client_id retrieval

This patch adds libraries to build and packaging files.
There is no code yet - libraries are empty.

Change-Id: I4c5c8b75eb5ea4867ba111d936bacbcd41fc5098

9 years agoFix inclusion of libunwind when not building for debug 35/26935/3
Rafal Krypa [Mon, 1 Sep 2014 16:49:40 +0000 (18:49 +0200)]
Fix inclusion of libunwind when not building for debug

Conditional inclusion of libunwind.h didn't properly depend on definition
of BUILD_TYPE_DEBUG. But only debug build checks for libunwind dependency.

Change-Id: I2158d09ae2880e9869246d75049aa1f23b8c4bcc
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobuild: clean up settings of compiler flags 34/26934/4
Rafal Krypa [Tue, 2 Sep 2014 08:48:12 +0000 (10:48 +0200)]
build: clean up settings of compiler flags

Compiler flags are set in main CMakeLists.txt. This part of the file looks
like a template inherited from other projects and requires some clean up:
- drop C flags, there are no C source files.
- move fortify flags to spec, they are specific to Tizen build system.
- use Cmake built-in features for detection of compiler support for C++11

Change-Id: I40cb76934334c31d7ac59328eed217e08902b187
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobuild: drop unused definition of API_VERSION 33/26933/3
Rafal Krypa [Mon, 1 Sep 2014 16:31:04 +0000 (18:31 +0200)]
build: drop unused definition of API_VERSION

This is probably copied from some template, but never used.

Change-Id: I455bb316b65121ff9ed509884d40c0c14668efce
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobuild: drop D_GNU_SOURCE flag, refactor symbol visibility setting 32/26932/4
Rafal Krypa [Wed, 3 Sep 2014 12:03:02 +0000 (14:03 +0200)]
build: drop D_GNU_SOURCE flag, refactor symbol visibility setting

Cynara code doesn't use GNU specific features. There is no need to define
_GNU_SOURCE.
Also set -fvisibility=hidden by default for all targets and change it only
where needed (for building common library).

Change-Id: Ie8f46522866b4f475c09b4e6e57f824defed0e5c
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobuild: install systemd files under CMAKE_INSTALL_PREFIX 31/26931/2
Rafal Krypa [Mon, 1 Sep 2014 16:38:08 +0000 (18:38 +0200)]
build: install systemd files under CMAKE_INSTALL_PREFIX

Don't use absolute path for installation of systemd config files.

Change-Id: If796cad7a0fdcd32d8179a0de7bc0958f173e35b
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobuild: rename ambiguous "build" directory to "pkgconfig" 30/26930/4
Rafal Krypa [Mon, 1 Sep 2014 16:34:17 +0000 (18:34 +0200)]
build: rename ambiguous "build" directory to "pkgconfig"

Directory supporting generation of package config files was named "build"
for no good reason. It was inherited from security-server code base.

Change-Id: I17bba90c9de09b2637b50d7d60b436170f3631df
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoRemove -fPIC flag 80/26880/4
Lukasz Wojciechowski [Sun, 31 Aug 2014 01:34:13 +0000 (03:34 +0200)]
Remove -fPIC flag

Explicit definition of this flag in not needed. They are added
by default when sources are used to create SHARED librray in cmake.

Change-Id: I9027835a932b7f46941a5007ddfcce08f85fb38d

9 years agoRemove not needed %defattr from cynara.spec 79/26879/4
Lukasz Wojciechowski [Sat, 30 Aug 2014 21:33:51 +0000 (23:33 +0200)]
Remove not needed %defattr from cynara.spec

Change-Id: I96fcb30e5e9a498b69505361150e7b0ffdbebb62

9 years agoAdd missing Requires for pre, post and postun scripts in spec 78/26878/4
Lukasz Wojciechowski [Sat, 30 Aug 2014 21:22:11 +0000 (23:22 +0200)]
Add missing Requires for pre, post and postun scripts in spec

And remove unneeded calls to ldconfig in %post and %postun sections
of main package as there is no library installed there.

Change-Id: I642f9cb073d8dd9b6569d43175a45a40ef51e1bb

9 years agoMove cynara package to the floor domain 12/26912/2
Jacek Bukarewicz [Mon, 1 Sep 2014 09:03:43 +0000 (11:03 +0200)]
Move cynara package to the floor domain

This makes cynara conform to the three domain security model according
to which program files, libraries and static data associated with the system
are given the _ (floor) label.

Change-Id: I4279fbe23f37917835257191aaccaef127606788

9 years agoAdd error include in API headers 16/26916/2
Zofia Abramowska [Mon, 1 Sep 2014 10:03:21 +0000 (12:03 +0200)]
Add error include in API headers

Change-Id: Id907a8fc93585b55b1115ae43054639d1a9088fe

9 years agoCreate additional packages for commons 90/26690/3
Zofia Abramowska [Wed, 27 Aug 2014 17:02:55 +0000 (19:02 +0200)]
Create additional packages for commons

Change-Id: Idd62a30326e6f238ac885e13a8bc267fc4a8fe24

9 years agoMove Cache to client commons library 90/26590/10
Zofia Abramowska [Tue, 26 Aug 2014 11:27:31 +0000 (13:27 +0200)]
Move Cache to client commons library

Change-Id: Ia47e434063b7a1f6d079a29e0076ab0c2392832f

9 years agoAdd ClientSession type 76/26576/6
Zofia Abramowska [Tue, 26 Aug 2014 11:17:40 +0000 (13:17 +0200)]
Add ClientSession type

Change-Id: Ia62dac02a652c2f252708ed05320eb66ea5506b1

9 years agoPrepare Cache for async API 13/26513/4
Zofia Abramowska [Mon, 25 Aug 2014 14:52:33 +0000 (16:52 +0200)]
Prepare Cache for async API

Change-Id: I4f2eba2db4a0f35efaa6fa00a924e582211a1e45

9 years agoAdd additional error code CYNARA_API_CACHE_MISS 78/26578/2
Zofia Abramowska [Tue, 26 Aug 2014 12:08:18 +0000 (14:08 +0200)]
Add additional error code CYNARA_API_CACHE_MISS

Change-Id: I2f128b28b19956409f0251f725a28a0e8ace2e7d

9 years agoMove error codes to different files 77/26577/2
Zofia Abramowska [Tue, 26 Aug 2014 09:33:31 +0000 (11:33 +0200)]
Move error codes to different files

Change-Id: Ice6a05d3ef76efed19780e3ce785ff7491519a36

9 years agoRevert "Add asynchronous client api" 36/26236/2
Zofia Abramowska [Tue, 19 Aug 2014 13:09:08 +0000 (06:09 -0700)]
Revert "Add asynchronous client api"

This reverts commit ab73c19c44d7f4e6f4a25ba1243ce08af11c84c0.

Change-Id: I8e231284f65d306488aa487c7297e53f3a580c5d

9 years agoRevert "Use <stdint.h> instead of <cstdint> in async client header" 37/26237/2
Zofia Abramowska [Tue, 19 Aug 2014 13:11:55 +0000 (06:11 -0700)]
Revert "Use <stdint.h> instead of <cstdint> in async client header"

This reverts commit 1b06a8e259d044ae3f6fe0782e754f125eab4e03.

Change-Id: Ib9efb3ad1d3961da72af0d39b98dfd4b3771ca6a

9 years agoAdd performance tests for PolicyBucket 00/25900/4
Aleksander Zdyb [Mon, 18 Aug 2014 09:40:46 +0000 (11:40 +0200)]
Add performance tests for PolicyBucket

Change-Id: I3b7f88a7964552664f0a1d1b1a56916ac0726249

9 years agoAdd custom TestEventListener 99/25899/3
Aleksander Zdyb [Thu, 14 Aug 2014 05:13:23 +0000 (07:13 +0200)]
Add custom TestEventListener

This is needed to show custom properties of test cases
(like for example time elapsed in benchmarks).

Change-Id: Id54c709125c07ceb4d3b387f76047706361d05b3

9 years agoUse <stdint.h> instead of <cstdint> in async client header 96/25896/2
Jacek Bukarewicz [Tue, 12 Aug 2014 09:10:10 +0000 (11:10 +0200)]
Use <stdint.h> instead of <cstdint> in async client header

<cstdint> cannot be used since cynara-client-async.h is a C header
which can be included by C projects like dbus.

Change-Id: Ife9f75ff594457d67831b487d85f8034bd556b05
Signed-off-by: Jacek Bukarewicz <j.bukarewicz@samsung.com>
9 years agoAdd asynchronous client api 16/25416/15
Marcin Niesluchowski [Thu, 31 Jul 2014 15:55:36 +0000 (17:55 +0200)]
Add asynchronous client api

Change-Id: I76f4374a96a09f53dd4154a8049c42683fb39bf7

9 years agoChange Cache to be based on std::unordered_map 05/25705/1
Zofia Abramowska [Fri, 8 Aug 2014 12:22:29 +0000 (14:22 +0200)]
Change Cache to be based on std::unordered_map

Change-Id: Iaadc74c426d9d6e7851a55b69556463b53aa31e6

9 years agoRelease version 0.2.2 04/25704/1 accepted/tizen/common/20140811.080200 submit/tizen/20140808.121920 submit/tizen_ivi/20140808.121920 submit/tizen_ivi/20140813.000000 submit/tizen_ivi/20140818.000000 submit/tizen_ivi/20140818.000001 submit/tizen_ivi/20140818.000002 submit/tizen_ivi/20140820.000000 submit/tizen_ivi/20140822.000000 submit/tizen_ivi/20140825.000000 v0.2.2
Zofia Abramowska [Fri, 8 Aug 2014 12:16:54 +0000 (14:16 +0200)]
Release version 0.2.2

Change-Id: I33c53395cb9af581dd1c1ed3ac37c36b4f874435

9 years agoMerge cynara and cynara-tests spec files 02/25302/3
Zofia Abramowska [Fri, 1 Aug 2014 13:20:52 +0000 (15:20 +0200)]
Merge cynara and cynara-tests spec files

Change-Id: I254584d5ef8a5e546be8bec4eb9e9629199306bc

9 years agoRelease version 0.2.1 41/25541/1 accepted/tizen/common/20140807.104614 accepted/tizen/ivi/20140807.192216 submit/tizen/20140807.091345 submit/tizen_ivi/20140807.091345 v0.2.1
Lukasz Wojciechowski [Wed, 6 Aug 2014 19:18:47 +0000 (21:18 +0200)]
Release version 0.2.1

Change-Id: Ibae38957b9c8e359b351ce888358e7554af1b8ee