mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-01 09:10:03 +00:00
Abstractify example in design exploration
Since this is just an example, remove specific-sounding references to mbedtls_psa_core_poison_memory() and replace with more abstract and generic-sounding memory_poison_hook() and memory_unpoison_hook(). Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
3f2dcdd142
commit
1c3b227065
@ -301,14 +301,14 @@ In the library, the code that does the copying temporarily unpoisons the memory
|
||||
```c
|
||||
static void copy_to_user(void *copy_buffer, void *const input_buffer, size_t length) {
|
||||
#if defined(MBEDTLS_TEST_HOOKS)
|
||||
if (mbedtls_psa_core_poison_memory != NULL) {
|
||||
mbedtls_psa_core_poison_memory(copy_buffer, length, 0);
|
||||
if (memory_poison_hook != NULL) {
|
||||
memory_poison_hook(copy_buffer, length);
|
||||
}
|
||||
#endif
|
||||
memcpy(copy_buffer, input_buffer, length);
|
||||
#if defined(MBEDTLS_TEST_HOOKS)
|
||||
if (mbedtls_psa_core_poison_memory != NULL) {
|
||||
mbedtls_psa_core_poison_memory(copy_buffer, length, 1);
|
||||
if (memory_unpoison_hook != NULL) {
|
||||
memory_unpoison_hook(copy_buffer, length);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user