mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge branch 'mbedtls-2.28-restricted' into backport_key_agreement_buffer_protection
Signed-off-by: tom-daubney-arm <74920390+tom-daubney-arm@users.noreply.github.com>
This commit is contained in:
@ -150,8 +150,12 @@ class PSAWrapperGenerator(c_wrapper_generator.Base):
|
||||
_buffer_name: Optional[str]) -> bool:
|
||||
"""Whether the specified buffer argument to a PSA function should be copied.
|
||||
"""
|
||||
# Proof-of-concept: just instrument one function for now
|
||||
if function_name == 'psa_cipher_encrypt':
|
||||
#pylint: disable=too-many-return-statements
|
||||
if function_name.startswith('psa_aead'):
|
||||
return True
|
||||
if function_name in {'psa_cipher_encrypt', 'psa_cipher_decrypt',
|
||||
'psa_cipher_update', 'psa_cipher_finish',
|
||||
'psa_cipher_generate_iv', 'psa_cipher_set_iv'}:
|
||||
return True
|
||||
if function_name in ('psa_key_derivation_output_bytes',
|
||||
'psa_key_derivation_input_bytes'):
|
||||
@ -174,6 +178,17 @@ class PSAWrapperGenerator(c_wrapper_generator.Base):
|
||||
if function_name in ('psa_key_derivation_key_agreement',
|
||||
'psa_raw_key_agreement'):
|
||||
return True
|
||||
if function_name == 'psa_generate_random':
|
||||
return True
|
||||
if function_name in ('psa_mac_update',
|
||||
'psa_mac_sign_finish',
|
||||
'psa_mac_verify_finish',
|
||||
'psa_mac_compute',
|
||||
'psa_mac_verify'):
|
||||
return True
|
||||
if function_name in ('psa_asymmetric_encrypt',
|
||||
'psa_asymmetric_decrypt'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _write_function_call(self, out: typing_util.Writable,
|
||||
|
Reference in New Issue
Block a user