Commit Graph

7687 Commits

Author SHA1 Message Date
mohammad1603
4b26850a15 fix tests according to the code changes in error value 2018-09-05 12:41:51 +03:00
mohammad1603
60a64d079a remove unnecessary argument to the psa_aead_unpadded_locate_tag function 2018-09-05 12:41:51 +03:00
mohammad1603
15223a8b89 write the tag directly on the ciphertext buffer. 2018-09-05 12:41:51 +03:00
mohammad1603
4fc744f8af change the check of block size for all supported algorithms 2018-09-05 12:41:51 +03:00
mohammad1603
0f21465175 use mbedtls_cipher_info_from_psa to get cipher ID 2018-09-05 12:41:51 +03:00
mohammad1603
f58aa6ade6 use memset instead of mbedtils_zeroize 2018-09-05 12:41:51 +03:00
mohammad1603
554faad260 return NOT_SUPPORTED instead of INVLID_ARGUMENT 2018-09-05 12:41:51 +03:00
mohammad1603
95893f834d remove usless cast 2018-09-05 12:41:51 +03:00
mohammad1603
f08a550e68 set output length to zero to cover output length in error case 2018-09-05 12:41:51 +03:00
mohammad1603
f4f0d612ba change mbedtls_cipher_info_from_psa to provide cipher_id also 2018-09-05 12:41:51 +03:00
mohammad1603
22898ba0bd remove duplicated definition 2018-09-05 12:41:51 +03:00
mohammad1603
9375f8403a fix code offsets after rebase 2018-09-05 12:41:51 +03:00
Gilles Peskine
ee652a344c Fix psa_aead_decrypt to read the tag at the end of the ciphertext 2018-09-05 12:41:51 +03:00
Gilles Peskine
36a74b71a0 Fix Doxygen comments to pass clang -Wdocumentation 2018-09-05 12:41:51 +03:00
Gilles Peskine
1e7d8f1b09 Document AEAD functions
Write documentation for psa_aead_encrypt and psa_aead_decrypt. Define
macros PSA_AEAD_ENCRYPT_OUTPUT_SIZE and PSA_AEAD_DECRYPT_OUTPUT_SIZE
(untested).
2018-09-05 12:41:51 +03:00
Gilles Peskine
a40d77477d Whitespace fixes
Changed indentation to match Mbed TLS style. Wrapped some lines to 80 columns.
2018-09-05 12:41:51 +03:00
mohammad1603
20399393a5 add psa_crypto to test suites 2018-09-05 12:41:49 +03:00
mohammad1603
e797945ea9 initialize length variables and process decrypt only when encrypts passes 2018-09-05 12:38:18 +03:00
mohammad1603
39574652ae add else for not supported algorithm 2018-09-05 12:38:18 +03:00
mohammad1603
9b07132591 remove compilation warnings 2018-09-05 12:38:18 +03:00
mohammad1603
f07db2e919 Add more test scenario for GCM and failure cases 2018-09-05 12:38:18 +03:00
mohammad1603
5c8845f563 return invalid argument for unsupported algorithms 2018-09-05 12:38:18 +03:00
mohammad1603
d973472a37 Fix loop index and output size parameter value 2018-09-05 12:38:18 +03:00
mohammad1603
e58e68458e fix condition over key type 2018-09-05 12:38:18 +03:00
mohammad1603
17638efc46 remove unused variable 2018-09-05 12:38:18 +03:00
mohammad1603
bdd892aef5 Add test scenario 2018-09-05 12:38:18 +03:00
mohammad1603
dad36fa855 add Key and Algorithm validation 2018-09-05 12:38:18 +03:00
mohammad1603
a7e6df76ea Validation fixes for key_type 2018-09-05 12:38:18 +03:00
mohammad1603
091e73b22b Fix usage of TEST_ASSERT
Add missing == PSA_SUCCESS in TEST_ASSERT usage
2018-09-05 12:38:18 +03:00
mohammad1603
4f5eb7cb54 Fill the the output buffer with zero data in case of failure 2018-09-05 12:38:18 +03:00
mohammad1603
6bbd8c75dc Remove unnecessary cast
Remove unnecessary cast
2018-09-05 12:38:18 +03:00
mohammad1603
db6247315f Parameters validation fixes
Fix key_type validation test and no need to ask for place for tag in decryption
2018-09-05 12:38:18 +03:00
mohammad1603
9112693930 aead test scenario 2018-09-05 12:38:18 +03:00
mohammad1603
579d359007 remove psa_aead_encrypt_setup from header file
remove psa_aead_encrypt_setup from header file
2018-09-05 12:38:18 +03:00
mohammad1603
ce5cba9a6a unify the concatenation of the tag and update output length 2018-09-05 12:38:18 +03:00
mohammad1603
9e5a515aa8 Fix parameter validation 2018-09-05 12:38:18 +03:00
mohammad1603
47ddf3d544 Concatenate the tag to the output buffer
Concatenate the tag to the output buffer.
2018-09-05 12:38:18 +03:00
mohammad1603
5955c98779 Initial implementation of the AEAD decrypt/encrypt APIs
Initial implementation for the AEAD APIs, missing the following:
* Concatenation of the tag to the output buffer.
* Updated documentation of the new functions.
* argument validations
* tests
2018-09-05 12:38:18 +03:00
mohammad1603
39ee871d3f Change AEAD APIs to integrated AEAD APIs.
Change AEAD APIs to integrated AEAD APIs, this will allow t support CCM and
GCM algorithms.
2018-09-05 12:38:17 +03:00
Gilles Peskine
02607e425f Merge pull request #29 from ARMmbed/psa-wrapper-apis-ecdsa-feature-psa
ECDSA APIs implementation
2018-09-05 12:10:47 +03:00
itayzafrir
7b30f8b0c9 Added handling for MBEDTLS_ERR_ECP_XXX error codes
Added handling for MBEDTLS_ERR_ECP_XXX error codes
2018-09-05 12:10:47 +03:00
itayzafrir
5c7533923a ECDSA sign and verify implementation and tests
ECDSA sign and verify implementation and tests
2018-09-05 12:10:47 +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