summaryrefslogtreecommitdiff
path: root/src/manager/client
AgeCommit message (Collapse)AuthorFilesLines
2016-04-18Coding style applied according to style checkersubmit/tizen/20160418.104308accepted/tizen/wearable/20160418.235737accepted/tizen/tv/20160418.235750accepted/tizen/mobile/20160418.235742accepted/tizen/ivi/20160418.235747accepted/tizen/common/20160418.142113Kyungwook Tak6-1257/+1417
Checker/Guide in http://10.113.136.204/confluence/pages/viewpage.action?pageId=44567756 Change-Id: Ie1c934dcc898b72a68b7a56d43eea4a3298b509c Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
2016-03-15Remove useless CKMC error -> CKM error converterKyungwook Tak1-63/+0
Change-Id: Ia8fcfd5424d2886ffcc535220b301c1bb9ea8078 Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
2016-03-04Fix unsafe buffer usageKyungwook Tak1-1/+1
- sprintf - strcpy Change-Id: I85716d6daabc149526146dfe375874a7057550a2 Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
2016-01-05Fix file permissions.Bartlomiej Grzelewski1-0/+0
Change-Id: I8aa70dd580c192d7ec5d2b28ebbcb3d1ee0193a3
2015-12-22Apply coding rulesangwan.kwon7-119/+126
covered Tizen C++ coding rule list - [R06] : Do not unnecessarily use braces where a single statement will do. - Exception: if one branch of a conditional statement is a single statement, use braces in both branches. - [M08] : Keywords have following space rules - Put a space after (most) keywords - example: if, switch, case, for, do, while - Do not put a space after function like keywords - example: sizeof, typeof, alignof, __attribute__ - [M09] : Operators have following space rules - Put a space around(on each side of) most binary and ternary operators - Example : = + -< > * / % | & ^ <= >= == != ? : - Do not put a space after unary operators - Example: & * + -~ ! - Unary "++" and unary "--" are allowed no space on one side - Do not put a space around the "." and "->" structure member operators. - Do not put a space after cast operator - [M10] : Seperators have following space rules - Put a space after closing brace when it has anything on the line. - Exception : comma after closing brace '},‘ - Put a space after comma - Do not put space inside parenthesis '(', ')‘ - Do not put space before open square bracket '[‘ and inside square bracket '[', ']‘ - [M12] : Functions have the opening brace at the beginning of the next line. - [M13] : The open brace last on the line. The closing brace is empty on a line of its own - Exception : else, whileshould follow close brace '}’ - [M14] : Open braces for enum, union and structgo on the same line Change-Id: I6e59513ba121a25222e6e626792b3e115ebec1d3 Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
2015-11-19Fix bug found by KlocworkKrzysztof Jackiewicz1-3/+3
[Problem] The command received from encryption service is deserialized into a variable hiding function argument of the same name. Also the received command was ignored. [Solution] Check if received command is equal to requested one. [Verification] Run ckm-tests --group=CKM_ENCRYPTION_DECRYPTION Change-Id: I16e14dbc8497a9b6ea11d93c8c0a48071562d684
2015-11-13try-catch enclosed to be exception safe of CAPIKyungwook Tak1-4/+2
Change-Id: I8c88402c6ed8f73bb1e5510389fec2aa07cfd48c Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
2015-10-28Protocol refactoring.Bartlomiej Grzelewski3-16/+14
Introduce CryptoAlgorithm in internal socket protocol. Change-Id: I70000a05e0a47d2b12af9b11324adf67da0f5e22
2015-09-23API refactoring.Bartlomiej Grzelewski3-45/+281
CKM::Manager uses private implementation pattern. Remove most of virtual methods from CKM::Manager. Change-Id: I171083a6f81716dc78155242989dd97528079554
2015-09-19Fix support of new error code: CKM_API_ERROR_NOT_SUPPORT.Bartlomiej Grzelewski1-0/+1
Change-Id: I59545191904fce8ee9258861a5a579308ae05216
2015-08-19Replace read/write with send/recv.Bartlomiej Grzelewski1-6/+8
New implementation does not require to mask SIGPIPE signal in client. Change-Id: Ic2a920b56ed9a6e3dc6627fa026857f31d5c1630
2015-07-28Openssl: add thread support and fix initializationKrzysztof Jackiewicz1-1/+1
[Problem] Openssl is used in multiple threads without proper thread support. Openssl initialization is scattered across several threads/files. [Solution] Lock and thread id callbacks registered. Openssl initialization refactored and fixed. [Verification] Run ckm-tests --output=text & ckm-tests-internal Change-Id: Iff26af6a0afd67001155aac040949bfde9cc6d31
2015-07-07Fix segfault in getCertificateChainKrzysztof Jackiewicz1-0/+6
[Problem] When getCertificateChain is called with empty certificate a segfault occurs in client. [Solution] Add param check in client. [Verification] Run ckm-tests --regexp=T13122_get_chain_empty_cert && ckm-tests --regexp=T13121_get_chain_no_cert Change-Id: I4f29ab1ca95166de261ef9120897ac85ac80c722
2015-07-03Fix parameter validation in ocspKrzysztof Jackiewicz1-0/+4
[Problem] It's possible to pass invalid certificate chains to ocsp that will cause segfault. [Solution] Add argument check [Verification] Run ckm-tests --regexp=ocsp_check Change-Id: I267054f81780149a0512532a016c3f7caf30e900
2015-06-26Add encryption serviceKrzysztof Jackiewicz2-36/+26
[Feature] Encryption/decryption implementation [Solution] Encryption service added [Verification] Run test: ckm-tests --group=CKM_ENCRYPTION_DECRYPTION Change-Id: I3ff79b06eabb6957ef2bbbe9a5bf7e5e2a995a21
2015-06-10Update parameter list APIKrzysztof Jackiewicz1-6/+6
[Problem] Param name range check is needed. Support for param overwriting is needed. Getters in CAPI are needed. IV param has to be added manually. [Solution] Add predefined range for possible ParamName values. Add ParamName value check. Support param overwriting. Add CAPI param getters. IV param is not generated in ckmc_generate_params. [Verification] Run ckm-tests --group=CKM_ALGO_PARAMS and ckm-tests-internal -t SERIALIZATION_TEST All should pass. Change-Id: I72a2c603d7a8f60bab5cb0c18fdc3866a28c7a82
2015-06-10AES: add generation, save, get support.Maciej J. Karpiuk1-5/+36
[Verification] a copule of AES tests added along other key types tests: https://review.tizen.org/gerrit/#/c/38195/ Change-Id: If6508811f874d438551a9d528b17d5719adc8ed0
2015-06-09AES key creation APIKrzysztof Jackiewicz2-0/+14
[Issue#] N/A [Feature] API allowing creation of AES key in key-manager database [Problem] N/A [Cause] N/A [Solution] N/A [Verification] Successfull compilation. Run tests. Change-Id: I3ec358ce4a58afb657afaf110ca81bacea7dcd10
2015-06-08Key generation uses CryptoAlgorithm object provided by the client.Maciej J. Karpiuk1-6/+9
Protocol changed: single command to generate all types of asymetric keys. Change-Id: Iafe2b593c3945ff0e3fcc31241faea3a542aca65
2015-06-08Implement encryption/decryption APIKrzysztof Jackiewicz2-1/+89
[Feature] Implementation of encryption/decryption service. [Solution] API implemented [Verification] Run ckm-tests --group=CKM_ENCRYPTION_DECRYPTION (TED_0040_encrypt_no_output_buffer passes, all other tests fail with CKMC_ERROR_SOCKET) Change-Id: Ib0ce85f031e92660713ae4f320a4fd3981a43ffc
2015-05-15Move Token from CKM::Crypto to CKM namespace.Bartlomiej Grzelewski2-2/+1
Token is used in database and crypto module. It should not be hidden in CKM::Crypto namespace. Change-Id: I6d000c05deda8f0027ce3afbdeb3bd0a793f0f78
2015-02-17Add support for password in Manager::getPCKS12 function.Bartlomiej Grzelewski2-2/+9
In function savePKCS12 user may specify passwords to protect data. Function getPKCS12 wasn't support passwords so it was not possible to extract PKCS12 secured with this functionality. Change-Id: I542873b817a2bff1064b2b56254d14fb632d8bdf
2015-02-17Common logging setup for client and serviceKrzysztof Jackiewicz1-5/+2
[Issue#] N/A [Feature/Bug] N/A [Problem] Client may use different logging method than service. [Cause] Service reads environment flags from config file. Client doesn't [Solution] Make the client read that file too and setup log system properly. [Verification] Make changes to /etc/sysconfig/central-key-manager file and see if both service and client uses the same logging setup (provider and log level) File format is the following: " CKM_LOG_PROVIDER=<provider> CKM_LOG_LEVEL=<level> " where: <provider> is one of JOURNALD, DLOG, CONSOLE <level> is <0..5>, 0 means not logs at all, 1 means errors only, 5 means all Change-Id: I1662fe636f9987778345f8a02afa6fb77f7f1fe0
2015-02-17Libraries reorganized to limit the number of exported symbolsKrzysztof Jackiewicz1-1/+1
[Issue#] N/A [Feature/Bug] N/A [Problem] Too much exported symbols [Cause] Some of the code don't have to be exported or is used by a single binary. [Solution] Unnecessary exports removed. Part of libkey-manager-common code moved to client library or key-manager binary [Verification] Compile key-manager and security-tests. Display the number of exported symbols before and after with: nm -g <library>.so | wc -l Change-Id: Iccb053af2523368d353693247e505a794e783318
2015-02-17Symbol visibility changed from default to hidden.kyungwook tak1-2/+0
Change-Id: I9b4b7e8af5ff62cd8c063a0ce45a899f166566d7 Signed-off-by: kyungwook tak <k.tak@samsung.com>
2015-02-17DB related classes moved into CKM::DB namespace.Maciej J. Karpiuk3-26/+26
Change-Id: Ifbf70ffe6865793394d46ea6443f27a0062fe02d
2015-02-17Fix LogSystemSingleton issueKrzysztof Jackiewicz1-3/+0
[Issue#] N/A [Feature/Bug] N/A [Problem] Logs from key-manager-common not visible [Cause] 2 instances of LogSystemSingleton were created in key-manager binary (log.cpp and key-manager-main.cpp) [Solution] Excessive LogSystemSingleton definition removed. [Verification] Compile & install ckm & tests. Run dlogutil and see if all logs are visible (CKM-CLIENT and CKM including logs from key-manager-common library) Change-Id: Idf508facc33318030db90633afa581d5cf012747
2015-02-17Replace error codes with exceptions in FileSystem module.Bartlomiej Grzelewski1-0/+3
Change-Id: Id099e6a3cb5b6db69dedc19c781db4d85f7518a9
2015-02-17Remove deprecated C++ API for certificate chainsKrzysztof Jackiewicz2-37/+0
[Issue#] N/A [Feature/Bug] N/A [Problem] Old C++ certificate chain API is no longer necessary [Cause] N/A [Solution] API removed [Verification] Successfull tests compilation Change-Id: I588a99d1d211607dcd70290b9b0610b4732d8ef0
2015-02-17New certificate chain APIKrzysztof Jackiewicz2-58/+122
[Issue#] N/A [Feature/Bug] N/A [Problem] N/A [Cause] N/A [Solution] API that allows contol of trusted/untrusted certificates used in chain creation. [Verification] Run certificate tests Change-Id: I390d5889ee9221b3a5ffb5c3d3d501b10e3640d4
2015-02-17CAPI cleanup: control "owner" removal, set_permission replaces allow_access.Maciej J. Karpiuk3-13/+9
Change-Id: If56f8336d8782fffe5e4982ac5a86d7b59dc2682
2015-02-17Add PKCS12 support.Maciej J. Karpiuk2-28/+109
Change-Id: I389c56611fed80cf27bbbfa279b1c17e55572b14
2015-02-17DBDataType refactoring.Bartlomiej Grzelewski2-5/+15
Change-Id: I080034c971ae5d8f75747d2091fb34ca0a7c78fa
2015-02-17C++ API change: common method for removing Alias.Maciej J. Karpiuk2-23/+4
No need to deliver separate methods to remove keys, certs or data. Item is unambiguosly identified by <name, label> pair. Change-Id: Ice2c418d66fd4f4b776ac752d8d5c6a779ad3b5a
2015-02-17OpenSSL initialization is done by anyone who uses OpenSSL first.Maciej J. Karpiuk2-18/+2
This resolves issue when CKM::PKCS12::create() is called before client is initialized. Client was initializing the OpenSSL so parsing PKCS12 was failing due to uninitialized OpenSSL. Change-Id: I809af1f622ce7c0f4764172c2143773629c88b67
2015-02-17Service denies attempt to add data using different label.Maciej J. Karpiuk2-4/+14
The same applies to attempt to modify another label's permissions. Change-Id: Ib167de4b4ccb59271f2dcfdbf7ce049f3d3dc819
2015-02-17Use AliasSupport in SaveDatakyungwook tak1-1/+3
Change-Id: I449e49aea2b52a9595d9e1ba8afcf47af3a7d69f Signed-off-by: kyungwook tak <k.tak@samsung.com>
2015-02-17DBCrypto access control re-factor: access control moved into additional layer.Maciej J. Karpiuk3-66/+13
Change-Id: I3ea1ce1a858b69c4a5a7365dffa1344b64aab0b6
2015-02-17Housekeeping: KLOC warnings removed.Maciej J. Karpiuk1-2/+2
Change-Id: I36a972fd2e9dbd7f4e5fc11647badaf0173a425d
2015-02-17Minor re-factoring: boost::vector replaced with std::vector.Maciej J. Karpiuk1-0/+2
<vector> header cleanup. Change-Id: I8408a4943f22e5fb18a08c40e9e0b5f9c938b34c
2015-02-17Divide alias into name & label in getCertificateChain: code re-factor.Maciej J. Karpiuk1-1/+7
Change-Id: I373a87f9421dac3b5e43e8c835d99944676822b1
2015-02-17Refactoring ServiceConnection.Bartlomiej Grzelewski2-37/+36
* Remove private inheritence from SockRAII * Rename Connect to prepareConnection and change logic. Change-Id: I791e3ec2791c155a7da17a3e1d45218de8351b39
2015-02-17Refactoring SockRAIIBartlomiej Grzelewski2-108/+83
Change-Id: Ib264bb049ed52d644f2d5873dabcd7be532738a3
2015-02-17Modify the setting value of POLL_TIMEOUTyuseok1-1/+1
Change-Id: I6c9da2626c5b7af518bad6baba4e9c7c51adb192 Signed-off-by: yuseok <yuseok@samsung.com>
2015-02-17C++ API re-factored: establish and keep socket connection to the service.Maciej J. Karpiuk5-268/+301
C API still does create and destroy socket per each API call. Change-Id: I99f90da5dca8e7ddc615b7d39d8a0a26055984d6
2015-02-17Split alias at server side into pair name and label.Maciej J. Karpiuk5-18/+83
Change-Id: I5cbe62ee49042449127218a95f82db9b59105a73
2015-02-17CC mode logic updatedKrzysztof Jackiewicz1-7/+2
[Issue#] N/A [Feature/Bug] N/A [Problem] CC mode was not checked during key-manager startup. CC mode was passed via API [Cause] N/A [Solution] CC mode checked during key-manager startup. CC mode is being read by key-manager. [Verification] Run ckm-tests --group=CKM_CC_MODE Change-Id: I5b861c53301893773559eca10722604fa24bd6ec
2015-02-17Revert "Alias is not unique user-wide: (alias, label) pair is unique now."Bartlomiej Grzelewski3-65/+4
This reverts commit 44333f4dcbcc9e295cde3a2846ffb70c0732b622. Change-Id: I9aa9fde63082ce395cb54590f74d9e554d992139
2015-02-17Alias is not unique user-wide: (alias, label) pair is unique now.Maciej J. Karpiuk3-4/+65
Client can address items using label::alias syntax. Change-Id: Ib9429e652e8a73d2d6c62a4164d54229e85cf7d5
2015-02-17Replace some functions with thread safe version.Bartlomiej Grzelewski1-8/+9
Change-Id: I749eaea647c39d7b25125ed72feb5ee22ddc38dd