From 0058f4c4cba7850018ac82d2db79983bc400439c Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 5 Mar 2026 10:59:26 +0100 Subject: [PATCH] psasim serialize: Support a few more standard C types Signed-off-by: Gilles Peskine --- psasim/src/psa_sim_serialise.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/psasim/src/psa_sim_serialise.pl b/psasim/src/psa_sim_serialise.pl index 3d40d9f58..c3f5c0e53 100755 --- a/psasim/src/psa_sim_serialise.pl +++ b/psasim/src/psa_sim_serialise.pl @@ -35,8 +35,9 @@ die($usage) unless $which eq "c" || $which eq "h"; # deserialisation functions written manually (like those for the "buffer" type # are). # -my @types = qw(unsigned-int int size_t +my @types = qw(unsigned unsigned-int int unsigned-long long size_t uint16_t uint32_t uint64_t + int16_t int32_t int64_t buffer psa_custom_key_parameters_t psa_status_t psa_algorithm_t psa_key_derivation_step_t @@ -56,11 +57,13 @@ my @types = qw(unsigned-int int size_t grep(s/-/ /g, @types); -# IS-A: Some data types are typedef'd; we serialise them as the other type +# IS-A: Some data types are typedef'd or synonyms; we serialise them as +# the other type. my %isa = ( - "psa_status_t" => "int", - "psa_algorithm_t" => "unsigned int", + "psa_status_t" => "int32_t", + "psa_algorithm_t" => "uint32_t", "psa_key_derivation_step_t" => "uint16_t", + "unsigned" => "unsigned int", ); # Compile-time guards for some types: the type $type is defined only