Commit Graph

7680 Commits

Author SHA1 Message Date
Moran Peker
5eb6e9ed60 PSA_ALG_CBC_BASE -> SA_ALG_CBC_BASE | PSA_ALG_BLOCK_CIPHER_PAD_NONE 2018-09-05 12:14:29 +03:00
Gilles Peskine
89d789c9bc Refactor some argument checks for readability
No intended behavior change.
2018-09-05 12:14:29 +03:00
Gilles Peskine
7e9288520f Wrap lines to 80 columns 2018-09-05 12:14:29 +03:00
Gilles Peskine
e553c65cc3 Fix indentation and horizontal whitespace
Only whitespace changes in this commit.
2018-09-05 12:14:29 +03:00
Gilles Peskine
d8100245d8 Remove cipher_test_positive, duplicated as cipher_test_encrypt
cipher_test_positive was never compiled due to a syntax error in the
BEGIN_CASE magic comment. It has now been duplicated as
cipher_test_encrypt. Remove the copy that was never compiled.
2018-09-05 12:14:29 +03:00
Moran Peker
7691fb7b6b add new test scenario (cipher_test_encrypt_multipart) 2018-09-05 12:14:29 +03:00
Moran Peker
3520c2c4f7 unset iv_required to 0 (psa_encrypt_set_iv)and block_size (psa_cipher_setup) 2018-09-05 12:14:29 +03:00
Moran Peker
395db875e6 adjust indentation per Mbed TLS standards 2018-09-05 12:14:29 +03:00
Moran Peker
ae382791fb add missing psa_cipher_abort( operation ) 2018-09-05 12:14:28 +03:00
Moran Peker
70531163a9 fix compilation error - missing if 2018-09-05 12:14:28 +03:00
Moran Peker
96cc00a857 add missing tests function 2018-09-05 12:14:28 +03:00
Moran Peker
f55e804e07 adjust indentation per Mbed TLS standards 2018-09-05 12:14:28 +03:00
Moran Peker
a28258c594 adjust indentation per Mbed TLS standards 2018-09-05 12:14:28 +03:00
Moran Peker
2cab25aacf fix conditions in psa_cipher_finish function 2018-09-05 12:14:28 +03:00
Moran Peker
dc38ebc068 delete decrypt checks + fix memcpy& return value 2018-09-05 12:14:28 +03:00
Moran Peker
ad9d82cc0e add iv_required field to psa_cipher_operation_s and fix relevant functions 2018-09-05 12:14:28 +03:00
Moran Peker
71f19ae6f8 add missing call to psa_cipher_abort in cipher_setup func + iv_length check in cipher_set_iv func 2018-09-05 12:14:28 +03:00
Moran Peker
406008ab4c add missing check on output_size in psa_cipher_update func 2018-09-05 12:14:28 +03:00
Moran Peker
bed71a2b17 fix missing check on output_size in psa_cipher_finish func 2018-09-05 12:14:28 +03:00
Moran Peker
0071b873a3 add missing parameter output_size on psa_cipher_finish 2018-09-05 12:14:28 +03:00
Moran Peker
4c80d8331a adjust indentation per Mbed TLS standards 2018-09-05 12:14:28 +03:00
mohammad1603
b152d4d8b6 add test scenarios to decrypt and encrypt input and compare with given output 2018-09-05 12:14:28 +03:00
mohammad1603
89e0f468bf style 2018-09-05 12:14:28 +03:00
Moran Peker
41deec4494 partly pr fix 2018-09-05 12:14:28 +03:00
Moran Peker
e1210dcac3 remove unused parameter in psa_cipher_finish. 2018-09-05 12:14:28 +03:00
Moran Peker
3205a6592b tests fix 2018-09-05 12:14:28 +03:00
mohammad1603
16864af80b fix static function name 2018-09-05 12:14:28 +03:00
mohammad1603
8481e74ecc CR fixes
more fixes

Compilation fixes

Compilation fixes for PSA crypto code and tests
2018-09-05 12:14:28 +03:00
mohammad1603
efb0107fbe CR fix, remove exposing ECB 2018-09-05 12:14:27 +03:00
mohammad1603
990a18c2f0 add ecb to cipher algorithms 2018-09-05 12:14:27 +03:00
mohammad1603
cdd3be9cfb Add psa_crypto test suite to Cmake
Add psa_crypto test suite to Cmake
2018-09-05 12:14:26 +03:00
mohammad1603
e6b67a1e78 Fix parameters in test suite
Fix test function signature in test suite
2018-09-05 12:13:23 +03:00
mohammad1603
d7d7ba5749 add positive test scenarios 2018-09-05 12:13:23 +03:00
mohammad1603
8275961178 warnings fixes 2018-09-05 12:13:23 +03:00
mohammad1603
503973bdf3 initial implementation for PSA symmetric APIs - missing tests and documentations 2018-09-05 12:13:23 +03:00
Gilles Peskine
a0655c3501 Merge remote-tracking branch 'psa/pr/13' into feature-psa
Conflicts:
	library/psa_crypto.c
	tests/suites/test_suite_psa_crypto.data
	tests/suites/test_suite_psa_crypto.function

All the conflicts are concurrent additions where the order doesn't
matter. I put the code from feature-psa (key policy) before the code
from PR #13 (key lifetime).
2018-09-05 12:10:43 +03:00
Gilles Peskine
f0c9dd37d2 Added possible error codes for lifetime functions 2018-09-05 12:01:38 +03:00
Gilles Peskine
9bb53d7aff Fix copypasta in lifetime function descriptions 2018-09-05 12:01:38 +03:00
Gilles Peskine
8ca560293b Whitespace fixes 2018-09-05 12:01:37 +03:00
mohammad1603
a7d245a4a2 Fix return error values description
Fix return PSA_ERROR_INVALID_ARGUMENT description for psa_set_key_lifetime()
and psa_get_key_lifetime()
2018-09-05 12:01:37 +03:00
mohammad1603
ea0500936e Change behavior of psa_get_key_lifetime()
psa_get_key_lifetime() behavior changed regarding empty slots, now
it return the lifetime of and empty slots. Documentation in header
file updated accordingly.
2018-09-05 12:01:37 +03:00
mohammad1603
1c34545cfe Remove usage of PSA_KEY_LIFETIME_NONE
Remove usage of PSA_KEY_LIFETIME_NONE, initiate all key slot to
PSA_KEY_LIFETIME_VOLATILE ini psa_crypto_init()
2018-09-05 12:01:37 +03:00
mohammad1603
5d7ec2033d fix key lifetime set implementation , tests accordingly 2018-09-05 12:01:37 +03:00
mohammad1603
ba178511f4 Remove unused and duplicated erros, fix documentation and tests
Remove unused and duplicated erros, fix documentation and tests
2018-09-05 12:01:37 +03:00
mohammad1603
060ad8ac34 Compilation and tests fixes 2018-09-05 12:01:37 +03:00
mohammad1603
804cd71bf8 initial key lifetime implementation and tests 2018-09-05 12:01:37 +03:00
Gilles Peskine
c63b6ba754 Merge remote-tracking branch 'psa/pr/14' into feature-psa
Conflict resolution:

* `tests/suites/test_suite_psa_crypto.data`: in the new tests from PR #14,
  rename `PSA_ALG_RSA_PKCS1V15_RAW` to `PSA_ALG_RSA_PKCS1V15_SIGN_RAW` as
  was done in PR #15 in the other branch.
2018-09-05 12:01:34 +03:00
Gilles Peskine
47c1bc0458 Correct some return codes 2018-09-05 11:53:26 +03:00
Gilles Peskine
8d2abd6f72 Merge remote-tracking branch 'psa/pr/15' into feature-psa 2018-09-05 11:53:26 +03:00
mohammad1603
38a622b68b Function psa_get_key_policy() now return policy value for empty slots
Function psa_get_key_policy() now return policy value for empty slots
2018-09-05 11:53:26 +03:00