platform/core/security/yaca.git
8 years agoAdd custom tag length support in CCM 45/77945/27
Krzysztof Jackiewicz [Tue, 12 Jul 2016 11:05:17 +0000 (13:05 +0200)]
Add custom tag length support in CCM

Change-Id: Iff8432d47b371ded3e95927fd90c5800be038597

8 years agoCheck BCM in property handlers. Use EVP_Cipher* where possible. 40/77940/18
Krzysztof Jackiewicz [Mon, 11 Jul 2016 15:00:57 +0000 (17:00 +0200)]
Check BCM in property handlers. Use EVP_Cipher* where possible.

Change-Id: I8dfd918aa3ea4aa6f55fa973ff6cdba88955f60e

8 years agoChange module names and add line feeds in some API descriptions 33/80633/1
Dongsun Lee [Tue, 19 Jul 2016 07:45:40 +0000 (16:45 +0900)]
Change module names and add line feeds in some API descriptions

Change-Id: Ib0b6630226bc250c189dbe0498d17ffe2b2d86cc
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
8 years agoClear the memory before freeing a symmetric key 63/79963/2
Krzysztof Jackiewicz [Wed, 13 Jul 2016 15:10:21 +0000 (17:10 +0200)]
Clear the memory before freeing a symmetric key

Change-Id: Iaffaf927709dfcfb831d7973d87d5a2ee5194bf0

8 years agoAdded manifest file to label library to floor 51/80251/2
Dongsun Lee [Fri, 15 Jul 2016 11:11:48 +0000 (20:11 +0900)]
Added manifest file to label library to floor

- Currently, libyaca.so.0 is labelled as "System",
  so applications cannot access on it.

Change-Id: I9c3db2708388508572c5e3d7bd920f4128a9f53f
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
8 years agoFIX: Unhandled OpenSSL error, when using invalid imported key
Mateusz Forc [Thu, 14 Jul 2016 10:26:40 +0000 (12:26 +0200)]
FIX: Unhandled OpenSSL error, when using invalid imported key

Change-Id: I5982553ae96bd9cde491bc9ccf79ff643303cb25

8 years agoFix: RC4 doesn't support block cipher modes
Dariusz Michaluk [Thu, 14 Jul 2016 08:48:11 +0000 (10:48 +0200)]
Fix: RC4 doesn't support block cipher modes

Change-Id: Iab022f1791712e0670a02ab2262e03fc0b79c365

8 years agoFix formatting in yaca_debug_translate_error 35/79935/1
Lukasz Pawelczyk [Wed, 13 Jul 2016 12:32:04 +0000 (14:32 +0200)]
Fix formatting in yaca_debug_translate_error

Change-Id: I125b51f447e74a79b0134192400bbc5af386419b

8 years agoConvert CRLF to LF in doc/ directory 66/79466/4
Lukasz Pawelczyk [Mon, 11 Jul 2016 11:27:10 +0000 (13:27 +0200)]
Convert CRLF to LF in doc/ directory

Change-Id: I299418907c312731706a7d30e73fbbe679202ecc

8 years agoVarious fixes in Doxygen comments 65/79465/3
Lukasz Pawelczyk [Mon, 11 Jul 2016 11:09:21 +0000 (13:09 +0200)]
Various fixes in Doxygen comments

- don't include source/example directories, they only cause confusion.
- don't add empty doxygen comment before a regular one. Move those
  comments to @file.
- minor changes in the doc/ directory.

Change-Id: Ie1e5e8b01cacc6a74c7201cd2652b0752091e455

8 years agoAdd nullptr check and return invalid param 46/79146/12
Mateusz Forc [Fri, 8 Jul 2016 10:38:21 +0000 (12:38 +0200)]
Add nullptr check and return invalid param

Add nullptr check for *iv_bit_len in yaca_encrypt_get_iv_bit_length().

Change return from YACA_ERROR_INTERNAL to YACA_INVALID_PARAMETER
in encrypt_get_algorithm for invalid param case

Change-Id: I804ca0af5d733aec2097566411e54b224391df5b

8 years agoerror fix in API description doxygen 68/77168/13
Dongsun Lee [Wed, 29 Jun 2016 02:48:06 +0000 (11:48 +0900)]
error fix in API description doxygen

- fix typos(mangement, createing, verifing)
- too short description(Context, key)
- the third person singular should be used in @brief
- remove unnecessary blanks and unexpected capital
- fix wrong description(If @a *memory is -> If @a memory is)

Change-Id: I9185ad0aca7ea8bac460fbc7e6bf406ac66870af
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
8 years agoadd @addtogroup 06/72606/12
sangsu [Wed, 1 Jun 2016 22:27:46 +0000 (07:27 +0900)]
add @addtogroup

Change-Id: I7bf0f7a94540d46edf5a7953d55d6a13f385946b
Signed-off-by: sangsu <sangsu.choi@samsung.com>
8 years agoACR:add doc document headers 05/72605/10
sangsu [Wed, 1 Jun 2016 22:21:24 +0000 (07:21 +0900)]
ACR:add doc document headers

Change-Id: Iafad752ca1980993c706434f34e136f44ffe3a91
Signed-off-by: sangsu <sangsu.choi@samsung.com>
8 years agoUpdate GCM/CCM examples 25/77925/12
Krzysztof Jackiewicz [Fri, 1 Jul 2016 13:44:57 +0000 (15:44 +0200)]
Update GCM/CCM examples

Use nonstandard tag. Fix formatting. Add missing cleanup.

Change-Id: Iec6f358ff3d05ae17ab072a72ef95401c777eb5a

8 years agoSpecify property type for tag lengths 14/77914/12
Krzysztof Jackiewicz [Tue, 5 Jul 2016 07:24:23 +0000 (09:24 +0200)]
Specify property type for tag lengths

Change-Id: I3fa756c74bd0797d070913020fd0f38588fe7403

8 years agoAllow NULL input/output only in CCM mode. 86/78986/2
Dariusz Michaluk [Thu, 7 Jul 2016 14:27:30 +0000 (16:27 +0200)]
Allow NULL input/output only in CCM mode.

Change-Id: I0758a1f2d8fa7accf8517aec6c93f79cf5f369d5

8 years agoMerge "Adjust naming convention to API." into tizen
Krzysztof Jackiewicz [Fri, 8 Jul 2016 13:45:00 +0000 (06:45 -0700)]
Merge "Adjust naming convention to API." into tizen

8 years agoAdjust naming convention to API. 01/76301/16
Krzysztof Jackiewicz [Tue, 5 Jul 2016 07:20:41 +0000 (09:20 +0200)]
Adjust naming convention to API.

Change-Id: I096c1df2007832e52bc797de88df3dd8c46e67aa

8 years agoChange ERROR_NONE to 0 where we don't check yaca function 63/78963/1
Lukasz Pawelczyk [Thu, 7 Jul 2016 12:33:25 +0000 (14:33 +0200)]
Change ERROR_NONE to 0 where we don't check yaca function

Change-Id: Id1e4a26365610e1e26d1f95b67834e2ad1d0e4df

8 years agoAdd a comment describing padding usage 87/78487/3
Lukasz Pawelczyk [Tue, 5 Jul 2016 16:49:22 +0000 (18:49 +0200)]
Add a comment describing padding usage

Change-Id: I915d829086b10a1718f5499f56dfc604a8e5e525

8 years agoMake yaca_cleanup return void 22/78922/1
Krzysztof Jackiewicz [Thu, 7 Jul 2016 10:36:38 +0000 (12:36 +0200)]
Make yaca_cleanup return void

Change-Id: I325703541385d064f9f3ba36fc9aeebb1e0e7bde

8 years agoAllow NULL value_len in yaca_context_get_property(). Fix documentation. 01/77701/4
Krzysztof Jackiewicz [Thu, 30 Jun 2016 13:10:17 +0000 (15:10 +0200)]
Allow NULL value_len in yaca_context_get_property(). Fix documentation.

In cases where a property is a single object of a known type theres no point in
passing value_len to yaca_context_get_property().

The documentation related to property getting/setting has been updated.

Change-Id: Idf908e87b87b5fe5239f651fe8546a7bd5a89850

8 years agoKey copying function 00/77700/4
Krzysztof Jackiewicz [Thu, 30 Jun 2016 10:25:09 +0000 (12:25 +0200)]
Key copying function

Change-Id: I372b7fd9c01f4eb104fc953c7995fa63dba0cba6

8 years agoUse size_t for PBKDF2 iterations param 14/78414/3
Lukasz Pawelczyk [Tue, 5 Jul 2016 11:08:10 +0000 (13:08 +0200)]
Use size_t for PBKDF2 iterations param

Also fix salt invalid param check.

Change-Id: Ib756041545a3aa606f9f44dc256a0ad70824ba3b

8 years agoMake it possible to import DER based X509 certificates 50/77950/4
Lukasz Pawelczyk [Fri, 1 Jul 2016 17:35:58 +0000 (19:35 +0200)]
Make it possible to import DER based X509 certificates

Change-Id: I86442c8faa6244d2d71ed1e0396464c580844166

8 years agoReworked password handling for import/export 48/77948/6
Lukasz Pawelczyk [Thu, 30 Jun 2016 14:32:22 +0000 (16:32 +0200)]
Reworked password handling for import/export

- Always use callback.
- Return INVALID_PASSWORD for combinations that do support password,
  it was not required for import but was given in params.
- Return INVALID_PARAM for combinations that do not support password
  while it was given in params. For both, import and export.
- PKCS8 always requires a password.
- Added few special cases to differentiate INV_PARAM and INV_PASSWORD.

Change-Id: I171e89125600151e33178eadc3df6b6004987f3c

8 years agoChanged return type to void 28/78228/3
Mateusz Forc [Mon, 4 Jul 2016 14:54:19 +0000 (16:54 +0200)]
Changed return type to void

Changed yaca_free, yaca_key_destroy, yaca_context_destroy ret type:
int->void and respectievely doxygen comments

Change-Id: Idfe8e1a17574c66990d81e95c3caed3799595b3f

8 years agoMissing const in write_file() 49/77949/1
Lukasz Pawelczyk [Fri, 1 Jul 2016 16:41:25 +0000 (18:41 +0200)]
Missing const in write_file()

Change-Id: I31ee04a3643fb85627e533807d6780a86f24447c

8 years agoHandle invalid params properly for simple sign/verify/cmac/hmac 60/77360/3
Lukasz Pawelczyk [Wed, 29 Jun 2016 11:43:09 +0000 (13:43 +0200)]
Handle invalid params properly for simple sign/verify/cmac/hmac

Change-Id: I86f0c4d3d1e7766b064fdba3822432569db1283c

8 years agoDrop reusability of digest context 24/77024/2
Lukasz Pawelczyk [Tue, 28 Jun 2016 09:33:57 +0000 (11:33 +0200)]
Drop reusability of digest context

Adding reusability to sign/encrypt contexts proved to be too difficult
and prone to errors for the feature to be worth altogether.

Change-Id: I5aaf1db54c482950cb00079e488433c35b5e1b1b

8 years agoEnforce NULL data for empty digest input 52/76352/1
Krzysztof Jackiewicz [Thu, 23 Jun 2016 12:15:36 +0000 (14:15 +0200)]
Enforce NULL data for empty digest input

Change-Id: I7fbd82b9aea2c9c2b712d72e09ac014d2dcf6a2f

8 years agoMake sure there are no OpenSSL errors logged for key_import() autodetect 20/75820/2
Lukasz Pawelczyk [Tue, 21 Jun 2016 13:57:21 +0000 (15:57 +0200)]
Make sure there are no OpenSSL errors logged for key_import() autodetect

Change-Id: I850db9d0316bbd5883797195c8358e6aef91297c

8 years agoUpdate digest API description 13/75813/2
Krzysztof Jackiewicz [Tue, 21 Jun 2016 13:14:13 +0000 (15:14 +0200)]
Update digest API description

-Add empty message digest remark
-Add context reuse remark

Change-Id: I255dc403f3f82d4359e56e632607b4d93e811b2f

8 years agoAllow empty input for yaca_simple_caclulate_digest 22/75822/2
Krzysztof Jackiewicz [Tue, 21 Jun 2016 14:18:41 +0000 (16:18 +0200)]
Allow empty input for yaca_simple_caclulate_digest

Change-Id: Ibaed61aec9e5370c4521139629a9ac108a6aa3ca

8 years agoACR: Modify remarks related to pointer/handle cleanup 28/75128/3
Krzysztof Jackiewicz [Fri, 17 Jun 2016 10:48:23 +0000 (12:48 +0200)]
ACR: Modify remarks related to pointer/handle cleanup

Change-Id: Id2e9136a8d896ff8036a9aa5096b617454b5c609

8 years agoMake digest context reusable after finish 46/75046/2
Krzysztof Jackiewicz [Thu, 16 Jun 2016 10:41:02 +0000 (12:41 +0200)]
Make digest context reusable after finish

Change-Id: Iecb125820264470a25fe42e0449c991d7ad3c5bc

8 years agoFor get_output_length in digest and sign require input_len == 0 54/75054/3
Lukasz Pawelczyk [Thu, 16 Jun 2016 10:55:25 +0000 (12:55 +0200)]
For get_output_length in digest and sign require input_len == 0

Change-Id: If195121b6c56fcd91c6d88d469d213b13b88dcc9

8 years agoDo not segfault on contexts without get_output_length (e.g. verify) 20/75020/2
Lukasz Pawelczyk [Thu, 16 Jun 2016 09:46:08 +0000 (11:46 +0200)]
Do not segfault on contexts without get_output_length (e.g. verify)

Change-Id: I0541f8f685b5d02370e67cabf3ea89f5794f0ee5

8 years agoMake sure output length argument is not NULL 21/74821/1
Krzysztof Jackiewicz [Wed, 15 Jun 2016 15:32:31 +0000 (17:32 +0200)]
Make sure output length argument is not NULL

Change-Id: I2ed584063314213efba934b282f603ce49f69899

8 years agoACR: Describe yaca_key_bit_length_e values 91/74691/1
Krzysztof Jackiewicz [Wed, 15 Jun 2016 08:18:12 +0000 (10:18 +0200)]
ACR: Describe yaca_key_bit_length_e values

Change-Id: Id51e3f99f9ece8279c338896d66020687ec4fb65

8 years agoMake sure library errors are not treated as fatal 19/74419/3
Krzysztof Jackiewicz [Mon, 13 Jun 2016 14:29:43 +0000 (16:29 +0200)]
Make sure library errors are not treated as fatal

Openssl defines a bit flag ERR_R_FATAL = 64 which may be used with common error
reasons (ERR_R_...). However, it's possible that library specific error reasons
(>99) have the bit set as well. ERR_FATAL_ERROR macro doesn't check it. Check
added.

Change-Id: I92b8b1011d0d22b84ec7e43f53bc60431cfe17fd

8 years agoUpdate error translation function 92/74292/3
Krzysztof Jackiewicz [Mon, 13 Jun 2016 13:16:34 +0000 (15:16 +0200)]
Update error translation function

Use macro for error translation. Don't return NULL. Update usage in
error_dump().

Change-Id: I4e6368732a89f5710c2354e704dd073512a6b2f1

8 years agoACR: Initialize and cleanup per thread. 08/73708/7
Krzysztof Jackiewicz [Thu, 9 Jun 2016 08:16:03 +0000 (10:16 +0200)]
ACR: Initialize and cleanup per thread.

yaca_initialize() and yaca_cleanup() should be called once per each thread that
uses yaca.

Change-Id: I098b7562712193aa5e1eb9475b106255c664de62

8 years agoACR: Update documentation. 54/74054/4
Dariusz Michaluk [Fri, 10 Jun 2016 12:58:52 +0000 (14:58 +0200)]
ACR: Update documentation.

Change-Id: I971dcdc742373385c11e9e908b561ac0caf8702f

8 years agoAdd more usage examples of seal/open. 35/73835/4
Dariusz Michaluk [Thu, 9 Jun 2016 15:07:37 +0000 (17:07 +0200)]
Add more usage examples of seal/open.

Change-Id: Icd89007c56fa6775c381874df4dd08fa1c5ba1e2

8 years agoMerge encrypt/decrypt and seal/open common code. 34/73834/5
Dariusz Michaluk [Thu, 9 Jun 2016 15:03:50 +0000 (17:03 +0200)]
Merge encrypt/decrypt and seal/open common code.

Change-Id: Ic9f1b7a527ce111f099459ee66eb4032d462c40e

8 years agoSilently export error translation function 02/74202/1
Krzysztof Jackiewicz [Mon, 13 Jun 2016 07:27:56 +0000 (09:27 +0200)]
Silently export error translation function

Change-Id: I4cc7e8b2219b8c30f8a2895c91e2a2e5338232d5

8 years agoACR: Cleanup TODO's and descriptions in API headers. 58/73558/4
Dariusz Michaluk [Wed, 8 Jun 2016 12:50:16 +0000 (14:50 +0200)]
ACR: Cleanup TODO's and descriptions in API headers.

Change-Id: I48fd3df7fa2a530dab80a7037e4a4d6087b7e949

8 years agoUse ERROR_HANDLE() to check for invalid passwords 84/73584/3
Lukasz Pawelczyk [Wed, 8 Jun 2016 16:03:32 +0000 (18:03 +0200)]
Use ERROR_HANDLE() to check for invalid passwords

Change-Id: I3d0449474e5b9240dedb7fe784a507541e705c2a

8 years agoCheck for known errors first 83/73583/2
Lukasz Pawelczyk [Wed, 8 Jun 2016 16:02:22 +0000 (18:02 +0200)]
Check for known errors first

Known errors can be marked as fatal at the same time, but we still want
to know a specific error code in such case. Check for them first. If
they are not specific, only then check for generic fatal codes.

Change-Id: I16ddcb201fdbb91daf1ef61590d949d7be847927

8 years agoACR: Seal/open sym_key_bits parameter should be size_t. 24/73524/3
Dariusz Michaluk [Wed, 8 Jun 2016 11:03:39 +0000 (13:03 +0200)]
ACR: Seal/open sym_key_bits parameter should be size_t.

Change-Id: I18de46fcd5991cc0e18f8e292c3d95e72c3a611c

8 years agoUpdate readme.txt after API changes. 12/73512/6
Dariusz Michaluk [Wed, 8 Jun 2016 09:58:03 +0000 (11:58 +0200)]
Update readme.txt after API changes.

Change-Id: Icc18e8370c02e8d9aba507924b4f39bf45dad7f7

8 years agoRemove no-unused-parameter compilation flag. Fix some errors. 02/73502/6
Dariusz Michaluk [Wed, 8 Jun 2016 09:18:18 +0000 (11:18 +0200)]
Remove no-unused-parameter compilation flag. Fix some errors.

Change-Id: Ic091bff6f4936608cfb6d9a32b20e93fc59849b8

8 years agoUse C89 style for comments. 99/73499/7
Dariusz Michaluk [Wed, 8 Jun 2016 09:05:59 +0000 (11:05 +0200)]
Use C89 style for comments.

Minor codestyle and comments cleanup.

Change-Id: I014b52d96ddc10ba9186ac0bd692b112ba10aefe

8 years agoACR: extend parameter names a little in specific cases 18/73518/2
Lukasz Pawelczyk [Wed, 8 Jun 2016 10:44:59 +0000 (12:44 +0200)]
ACR: extend parameter names a little in specific cases

Change-Id: I8cbad0e2dce8552fb72e901a5b139ec727083bba

8 years agoACR: Consistency for the get_output_length() function 40/73340/3
Lukasz Pawelczyk [Tue, 7 Jun 2016 15:39:53 +0000 (17:39 +0200)]
ACR: Consistency for the get_output_length() function

Removed the macros, get_output_length function renamed to include
"context". Documentation updated.

Change-Id: I6f8857b25e43dfb80a258bdb857097a79e443889

8 years agoACR: fixes for function and enumeration names/values 18/73118/6
Lukasz Pawelczyk [Mon, 6 Jun 2016 14:11:16 +0000 (16:11 +0200)]
ACR: fixes for function and enumeration names/values

This commit extends the names of functions, enumeration and enumeration
values to be longer, more descriptive and not use abbreviation.

Function parameters will be covered in a separate commit.

Change-Id: I4d08291fb667a5740320a23dbe0c24f656405a2c

8 years agoFix comment placement 04/73304/1
Lukasz Pawelczyk [Tue, 7 Jun 2016 11:15:38 +0000 (13:15 +0200)]
Fix comment placement

Change-Id: I559f16f3e845e3cad4ca8f12c4bbcb952f90d071

8 years agoSmart tabs and comments consistency 16/73116/1
Lukasz Pawelczyk [Mon, 6 Jun 2016 14:14:10 +0000 (16:14 +0200)]
Smart tabs and comments consistency

Change-Id: I83da9ab1b9f40da3471fb3aec1805131d03c28ba

8 years agoMake sure yaca_*alloc() is not called with 0 size 06/73006/3
Krzysztof Jackiewicz [Fri, 3 Jun 2016 12:45:49 +0000 (14:45 +0200)]
Make sure yaca_*alloc() is not called with 0 size

- Add asserts
- Don't install static locks if CRYPTO_num_locks == 0
- Treat 0 output length as YACA_ERROR_INTERNAL:
  - If client provided a 0-length key we should detect it in yaca_sign_*init()
    and prevent him from using it. If it has 0 length in
    get_sign_output_length() it's an internal error.

Change-Id: I5d2d4063c568f76a25ee616b40c99abd5cc4dfa9

8 years agoACR: Each paragraph needs a separate @remarks command 92/72992/3
Krzysztof Jackiewicz [Fri, 3 Jun 2016 11:24:32 +0000 (13:24 +0200)]
ACR: Each paragraph needs a separate @remarks command

Change-Id: I05ee6ceef9db355a8e6fc01f1b9c801518a7f343

8 years agoSimplify memory allocation in read_file 91/72991/2
Krzysztof Jackiewicz [Fri, 3 Jun 2016 11:14:56 +0000 (13:14 +0200)]
Simplify memory allocation in read_file

Change-Id: Ia3cc7dd2d04fb4279ec3cc60c5858f84ace20daa

8 years agoACR: Return error codes from all API functions 89/72989/4
Krzysztof Jackiewicz [Fri, 3 Jun 2016 11:06:47 +0000 (13:06 +0200)]
ACR: Return error codes from all API functions

According to HQ Tizen API development Team all API functions must return error
codes. Code adjusted.

Change-Id: Ie6e80480cad0cf32094e78898575fa6c4af91a5e

8 years agoACR: Apply changes from API review part 1 70/72770/5
Krzysztof Jackiewicz [Thu, 2 Jun 2016 07:29:49 +0000 (09:29 +0200)]
ACR: Apply changes from API review part 1

- "bogus" -> "incorrect"
- Add missing @see entries for mentioned functions
- "recomend" -> "recommend"
- Remove EC key type from documentation

Change-Id: I311ccb00a099c5c156c97b5821782a57c14e2c98

8 years agoACR: Apply changes from API review part 2 03/72803/5
Dariusz Michaluk [Thu, 2 Jun 2016 11:26:40 +0000 (13:26 +0200)]
ACR: Apply changes from API review part 2

Change-Id: I13a1a8e49eef233bf748ea0c871e872f67708ea5

8 years agoACR: Fix notation for pointer variables. 73/72773/3
Dariusz Michaluk [Thu, 2 Jun 2016 10:26:03 +0000 (12:26 +0200)]
ACR: Fix notation for pointer variables.

Change-Id: I6060a5a0d632ad3d647059cd08efce65fed57f30

8 years agoFix seal/open, ECB mode does not use an IV. 80/72580/7
Dariusz Michaluk [Wed, 1 Jun 2016 14:19:43 +0000 (16:19 +0200)]
Fix seal/open, ECB mode does not use an IV.

Change-Id: I953bf874f2bb760d129e90dac3246c9f24e0c5ec

8 years agoError handling refactoring. 53/72553/8
Dariusz Michaluk [Wed, 1 Jun 2016 10:00:24 +0000 (12:00 +0200)]
Error handling refactoring.

Multiple goto labels replaced with single 'free' label.

Change-Id: I4936f2ef178c9b6fbf58a38beda7d21a700232a9

8 years agoFix key generation error handling 48/72348/4
Krzysztof Jackiewicz [Tue, 31 May 2016 13:18:06 +0000 (15:18 +0200)]
Fix key generation error handling

- Check allowed RSA/DSA key lengths
- Translate known openssl errors
- Fix SIZE_MAX checks
- Update doxygen

Change-Id: If230518bb4a4d490cffde61fb2930ee7200fa083

8 years agoAdd common error handling function 87/72587/3
Krzysztof Jackiewicz [Wed, 1 Jun 2016 15:02:22 +0000 (17:02 +0200)]
Add common error handling function

The function tries to convert openssl errors to yaca ones. If it succeeds it
removes the remaining errors from the queue. Otherwise it dumps them. It should
be called after each openssl failure.

Change-Id: I88c557e8d42f9ea70d5a8b25f2bd3181534e4ff8

8 years agoSimplify yaca_key_gen() a little 85/72585/3
Lukasz Pawelczyk [Wed, 1 Jun 2016 15:04:13 +0000 (17:04 +0200)]
Simplify yaca_key_gen() a little

Change-Id: Ie755fb94ca9519681904df81049e984b0abe0827

8 years agoDon't clear errors after error strings initialization 86/72586/1
Krzysztof Jackiewicz [Wed, 1 Jun 2016 15:01:08 +0000 (17:01 +0200)]
Don't clear errors after error strings initialization

Change-Id: Idc58cbd7e83916ba5298d366a8be1bffbe2761c2

8 years agoACR: Remove unimplemented features 65/72565/1
Krzysztof Jackiewicz [Wed, 1 Jun 2016 12:27:51 +0000 (14:27 +0200)]
ACR: Remove unimplemented features

Remove elliptic curves, ECDH and DH.

Change-Id: Ib61efb39e07cfe81a27f265a76103b7347397e8c

8 years agoFix unix modes (dirs 755, files 644) 39/72539/2
Lukasz Pawelczyk [Wed, 1 Jun 2016 10:41:18 +0000 (12:41 +0200)]
Fix unix modes (dirs 755, files 644)

Change-Id: I12bd0ac68a613ef4641ca3d7b535eedd3a596c98

8 years agoMake sure we have enough entropy on start, bail if we don't 85/72385/4
Lukasz Pawelczyk [Tue, 31 May 2016 16:31:54 +0000 (18:31 +0200)]
Make sure we have enough entropy on start, bail if we don't

Change-Id: I4095c95aac3644db62bec902320cd10f59322e3f

8 years agoMore readable error codes in dump (strings or hex) 84/72384/2
Lukasz Pawelczyk [Tue, 31 May 2016 15:22:09 +0000 (17:22 +0200)]
More readable error codes in dump (strings or hex)

Change-Id: I89be3a82842f5586ee552a5fa9b2d7be9d49e38c

8 years agoPassword example extended to include PKCS8 58/72358/2
Lukasz Pawelczyk [Tue, 31 May 2016 13:06:36 +0000 (15:06 +0200)]
Password example extended to include PKCS8

Change-Id: I507ae76e16bfcc2a276e8d681e5a511da623daa4

8 years agoyaca_key_import() support for PKCS8 57/72357/2
Lukasz Pawelczyk [Tue, 31 May 2016 12:43:26 +0000 (14:43 +0200)]
yaca_key_import() support for PKCS8

Change-Id: I96c07efd6a86f61522871179d29e38abf6fe60ef

8 years agoyaca_key_export() support for PKCS8 56/72356/2
Lukasz Pawelczyk [Tue, 31 May 2016 12:25:47 +0000 (14:25 +0200)]
yaca_key_export() support for PKCS8

Change-Id: I8933caec09ccdcbaea19a197d04cbf136cfd6e4e

8 years agoACR: Fix code formatting. 94/72294/3
Dariusz Michaluk [Tue, 31 May 2016 09:45:06 +0000 (11:45 +0200)]
ACR: Fix code formatting.

Change-Id: I139f83922a3a1407b2188fb7025637834aa414a8

8 years agoACR: Minor fixes in documentation 97/72297/1
Krzysztof Jackiewicz [Tue, 31 May 2016 09:58:40 +0000 (11:58 +0200)]
ACR: Minor fixes in documentation

Change-Id: I5359ecb036ef7174e2232954f8aca95ec4d2f335

8 years agoACR: Succesful -> Successful 85/72285/2
Krzysztof Jackiewicz [Tue, 31 May 2016 09:31:52 +0000 (11:31 +0200)]
ACR: Succesful -> Successful

Change-Id: I6859b868fd2a62d12215e7071c3e8c3bae5897b4

8 years agoACR: yaca_types.h doxygen fixes 08/72108/1
Dariusz Michaluk [Mon, 30 May 2016 14:36:44 +0000 (16:36 +0200)]
ACR: yaca_types.h doxygen fixes

Change-Id: If9e7de66bfe29861a90bd68369b5f671534a64ec

8 years agoACR: yaca_simple.h doxygen fixes 01/72101/2
Lukasz Pawelczyk [Mon, 30 May 2016 12:43:16 +0000 (14:43 +0200)]
ACR: yaca_simple.h doxygen fixes

Change-Id: I0fd4c1d626275ae690b0a25e022687583f838445

8 years agoACR: yaca_sign.h doxygen fixes 00/72100/2
Lukasz Pawelczyk [Mon, 30 May 2016 12:39:33 +0000 (14:39 +0200)]
ACR: yaca_sign.h doxygen fixes

Change-Id: I1570a1201b59ced862e3ce580f7563420eca5eab

8 years agoACR: change the ordering of key related functions (out last) 32/71932/3
Lukasz Pawelczyk [Fri, 27 May 2016 15:15:53 +0000 (17:15 +0200)]
ACR: change the ordering of key related functions (out last)

Change-Id: I4a2df099c1dc594dd0fc08aa7146110ba723c861

8 years agoACR: yaca_key.h doxygen fixes 31/71931/3
Lukasz Pawelczyk [Fri, 27 May 2016 14:08:33 +0000 (16:08 +0200)]
ACR: yaca_key.h doxygen fixes

@return statements cleaned up
Added @retval statements
Removed dot at the end of some statements

Change-Id: If0495e03f6bf0fc24341f217c94dbbf68550a72e

8 years agoACR: remove key derive dh/kea 30/71930/2
Lukasz Pawelczyk [Fri, 27 May 2016 12:07:02 +0000 (14:07 +0200)]
ACR: remove key derive dh/kea

Change-Id: I0008dd2179597bb54e4ca3e8da8a0bb862d4fce9

8 years agoACR: yaca_error.h doxygen fixes 03/72103/2
Dariusz Michaluk [Mon, 30 May 2016 13:16:38 +0000 (15:16 +0200)]
ACR: yaca_error.h doxygen fixes

Change-Id: I2555c31e6890d2d184c2bc1e454f18271f26db6b

8 years agoACR: yaca_crypto.h doxygen fixes 99/72099/3
Dariusz Michaluk [Mon, 30 May 2016 12:32:44 +0000 (14:32 +0200)]
ACR: yaca_crypto.h doxygen fixes

Change-Id: I421e3095f70efe3264461fbd364d813eb999d93e

8 years agoACR: yaca_digest.h doxygen fixes 78/72078/2
Dariusz Michaluk [Mon, 30 May 2016 11:27:44 +0000 (13:27 +0200)]
ACR: yaca_digest.h doxygen fixes

Change-Id: Ia6f8d263b7c31b22fe7d97c4bedd3754b3ae00dc

8 years agoACR: yaca_encrypt.h doxygen fixes 62/72062/2
Dariusz Michaluk [Mon, 30 May 2016 10:53:53 +0000 (12:53 +0200)]
ACR: yaca_encrypt.h doxygen fixes

Change-Id: Id2603e9f858894eafc19e850909685d9801a5081

8 years agoACR: yaca_seal.h doxygen fixes 52/72052/2
Dariusz Michaluk [Mon, 30 May 2016 10:16:17 +0000 (12:16 +0200)]
ACR: yaca_seal.h doxygen fixes

Change-Id: Ia0956240a40fb5a4ac39a1cdee1aeaa93699c578

8 years agoDo not enumerate all related modules with only one @see tag. 11/71911/3
Dariusz Michaluk [Fri, 27 May 2016 12:34:51 +0000 (14:34 +0200)]
Do not enumerate all related modules with only one @see tag.

Change-Id: I5b7e3856794f099e7f2f65dde3e67bc35a81625a

8 years agoModify error codes according to ACR 22/71922/4
Krzysztof Jackiewicz [Fri, 27 May 2016 13:28:34 +0000 (15:28 +0200)]
Modify error codes according to ACR

Change-Id: I9e41174c1a38811dd3d5d85b66513bd271cfdd0b

8 years agoReplace YACA_ERROR_TOO_BIG_ARGUMENT with YACA_ERROR_INVALID_ARGUMENT 25/71925/3
Krzysztof Jackiewicz [Fri, 27 May 2016 13:47:45 +0000 (15:47 +0200)]
Replace YACA_ERROR_TOO_BIG_ARGUMENT with YACA_ERROR_INVALID_ARGUMENT

Change-Id: Iadf4d6a6044e6bc68389897f369064ec61ca309f

8 years agoRemove not implemented Skipjack algorithm. 23/71923/2
Dariusz Michaluk [Fri, 27 May 2016 13:37:13 +0000 (15:37 +0200)]
Remove not implemented Skipjack algorithm.

Change-Id: Ibc5a55bef78165344f839113361aa252749deacf

8 years agoRemove YACA_ERROR_NOT_IMPLEMENTED 21/71921/2
Dariusz Michaluk [Fri, 27 May 2016 13:27:46 +0000 (15:27 +0200)]
Remove YACA_ERROR_NOT_IMPLEMENTED

Change-Id: If8361e25c012984d3ebfaf7ae03df5964140f230

8 years agoAdd yaca_error_e typedef. 04/71904/2
Dariusz Michaluk [Fri, 27 May 2016 11:45:33 +0000 (13:45 +0200)]
Add yaca_error_e typedef.

Change-Id: I5bf5e9ad7cc91df53cbb437044d31dd8a7e1efad