David Horstmann
7175d71328
Remove unnecessary setting of status variable
...
The status is guaranteed to be PSA_SUCCESS at these points, so setting
them is redundant.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-09 18:20:05 +00:00
David Horstmann
c75639daa0
Add copying to PAKE input and output
...
Add buffer copying to:
* psa_pake_input()
* psa_pake_output()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-01-24 15:42:11 +00:00
David Horstmann
4f534ae9c2
Add copying in PAKE set peer and user functions
...
Add copying to:
* psa_pake_set_user()
* psa_pake_set_peer()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-01-24 15:42:11 +00:00
Janos Follath
890c74447d
Merge pull request #1123 from yanesca/fix-marvin-attack
...
Fix for the Marvin attack
2024-01-10 12:16:57 +00:00
Janos Follath
d83dc85a10
RSA: improve readability
...
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-12-27 10:44:36 +00:00
Janos Follath
c762521e73
RSA: remove unneeded temporaries
...
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-12-27 10:33:00 +00:00
Janos Follath
dad6d66661
RSA: document Montgomery trick in unblind
...
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-12-27 10:22:59 +00:00
David Horstmann
62a56d966d
Tweak the behaviour of copy handling macros
...
Specifically:
* Move the creation of the pointer to the copied buffer into the
DECLARE() macro, to solve warnings about potentially skipping
initialization.
* Reorder the arguments of the FREE() macro - having a different order
made it confusing, so keep the order the same throughout.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-14 18:16:02 +00:00
David Horstmann
36df4b24d4
Redesign local copy handling macros
...
* Separate initialization from allocation.
* Rewrite description of macros to fit the new interface.
* Use a longer name to store the local copy objects, to reduce the risk
of shadowing.
* Use different names for the original and the copy. Append the suffix
'_external' to the original argument and use the previous name
for the copy.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-14 16:09:00 +00:00
David Horstmann
5a945f584e
Put local output status in scope
...
This means that a unique name is no longer needed.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-13 14:09:08 +00:00
David Horstmann
d57c0731c9
Remove spaces around token-pasting macro operator
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-13 14:03:40 +00:00
David Horstmann
bf4ec79085
Make return statuses unique in FREE_LOCAL_OUTPUT()
...
Previously the return from psa_crypto_local_output_free() had a fixed
name, which meant that multiple outputs would cause redefinitions of the
same variable.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
3e72db4f51
Improve FREE_LOCAL_INPUT() and FREE_LOCAL_OUTPUT()
...
* Set swapped pointers to NULL when the buffers are freed.
* Change example name <buffer> to <input> and <output> to reduce
confusion.
* Document assumptions of FREE_LOCAL_ macros.
* Add comment on error case in FREE_LOCAL_OUTPUT(), explaining why it's
okay to mask the existing status code.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
00d7a04b82
Add more information to comment on test hooks
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
d596862418
Remove unnecessary include directory from CMake
...
Since psa_crypto.c does not include tests/include/test/memory.h, we do
not need the tests/include include path.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
513101b00f
Add MBEDTLS_PSA_COPY_CALLER_BUFFERS config option
...
This allows us to entirely remove copying code, where the convenience
macros are used for copying.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
e9a88ab0d5
Use macros to manage buffer copies
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
e138dce329
Change to use test-hook-based approach
...
Since we are applying hooks transparently to all tests, we cannot setup
and teardown test hooks in the tests. Instead we must do this in the
test wrappers which are used to pre-poison and unpoison memory.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
c6977b4899
Copy input and output in psa_cipher_encrypt()
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
372b8bb6c5
Add memory poisoning hooks
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
Janos Follath
f7f88d6443
Fix style
...
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-12-08 08:41:08 +00:00
Janos Follath
8209ff335e
Make local function static
...
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-12-08 08:41:08 +00:00
Gilles Peskine
0457559323
Merge remote-tracking branch 'development' into development-restricted
2023-11-29 19:21:19 +01:00
Janos Follath
c6f1637f8c
Merge pull request #8534 from paul-elliott-arm/fix_mutex_abstraction
...
Make mutex abstraction and tests thread safe
2023-11-29 13:26:23 +00:00
Dave Rodgman
fb96d800ab
Merge pull request #8569 from yuhaoth/pr/fix-warning-on-arm64-gcc-5.4
...
fix build warning with arm64 gcc 5.4
2023-11-29 11:52:18 +00:00
Jerry Yu
92787e42c4
fix wrong gcc version check
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-29 16:30:38 +08:00
Jerry Yu
e743aa74b5
add non-gcc arm_neon support
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-29 15:54:32 +08:00
Jerry Yu
71fada10e5
Guards neon path
...
Old GCC(<7.3) reports warning in NEON path
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-29 10:38:07 +08:00
Jerry Yu
5b96b81980
Revert "fix build warning with arm64 gcc 5.4"
...
This reverts commit da3c206ebde6c29904fb46a61ec7534f90c0d08e.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-29 10:25:00 +08:00
Manuel Pégourié-Gonnard
294f5d7ea9
Merge pull request #8540 from valeriosetti/issue8060
...
[G2] Make CCM and GCM work with the new block_cipher module
2023-11-28 08:18:45 +00:00
Jerry Yu
da3c206ebd
fix build warning with arm64 gcc 5.4
...
GCC 5.4 reports below warning on Arm64
```
warning: 'vst1q_u8' is static but used in inline function 'mbedtls_xor' which is not static
```
This inline function miss `static`, others have the keyword
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-28 14:28:03 +08:00
Dave Rodgman
4e9d5aa2ba
Merge pull request #8515 from mschulz-at-hilscher/fixes/pragma-error-gcc452
...
Fix compiler error on gcc 4.5.2.
2023-11-27 11:28:30 +00:00
Dave Rodgman
9fbac381e6
Merge pull request #8326 from daverodgman/aesce-thumb2
...
Support hw-accelerated AES on Thumb and Arm
2023-11-27 09:58:58 +00:00
Dave Rodgman
c94f8f1163
Merge pull request #8551 from daverodgman/sign-conversion-part1
...
Sign conversion part 1
2023-11-24 15:12:00 +00:00
Dave Rodgman
a3b80386d9
Merge remote-tracking branch 'origin/development' into sign-conversion-part1
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-24 11:27:18 +00:00
Dave Rodgman
c7cc83cc44
Merge pull request #1119 from davidhorstmann-arm/psa-buffer-copy-fn
...
Implement buffer copying functions for PSA crypto
2023-11-24 10:46:38 +00:00
Janos Follath
905409abe2
Merge pull request #8500 from Ryan-Everett-arm/8409-make-empty-key-slots-explicit
...
Make empty key slots explicit
2023-11-24 08:52:01 +00:00
Paul Elliott
8c6d332c44
Fix comment typos
...
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-11-23 18:53:13 +00:00
Dave Rodgman
8cd4bc4ac2
Merge pull request #8124 from yanrayw/support_cipher_encrypt_only
...
Support the negative option MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
2023-11-23 17:43:00 +00:00
Ryan Everett
2a0d4e2995
Revert "Refactor psa_load_persistent_key_into_slot
to remove bad goto
"
...
This reverts commit d69f4017fbf949ab3aceca178b034b73e6e43dbc.
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2023-11-23 16:34:35 +00:00
Dave Rodgman
c44042ddbc
Merge pull request #7905 from lpy4105/issue/misc-improvement
...
misc improvements
2023-11-23 16:20:58 +00:00
Ryan Everett
d69f4017fb
Refactor psa_load_persistent_key_into_slot
to remove bad goto
...
Merges the two calls to `psa_copy_key_material_into_slot.
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2023-11-23 16:20:45 +00:00
David Horstmann
a575a5a26a
Improve description of psa_crypto_input_copy_alloc
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-23 15:59:30 +00:00
David Horstmann
9db14486da
Use initializers in alloc functions
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-23 15:50:37 +00:00
David Horstmann
31003ffa46
Add casts to local input / output initializers
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-11-23 15:45:29 +00:00
Yanray Wang
690ee81533
Merge remote-tracking branch 'origin/development' into support_cipher_encrypt_only
2023-11-23 10:31:26 +08:00
Gilles Peskine
3f5e1e81b2
Merge pull request #8440 from yuhaoth/pr/fix-missing-pre_shared_key-ext-sent-mask
...
Fix missing pre shared key ext sent mask
2023-11-22 16:40:12 +00:00
Dave Rodgman
e467d62042
Add casts for NEON
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-21 17:09:46 +00:00
Dave Rodgman
c37ad4432b
misc type fixes in ssl
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-21 17:09:46 +00:00
Dave Rodgman
df4d42106a
Use standard byte conversion fns in lms
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-21 17:09:46 +00:00