setup_psa_key_derivation(): add optional salt parameter

Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 7804cb7..9f1cefd 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -4715,6 +4715,7 @@
                                               psa_algorithm_t alg,
                                               const unsigned char* seed, size_t seed_length,
                                               const unsigned char* label, size_t label_length,
+                                              const unsigned char* salt, size_t salt_length,
                                               size_t capacity )
 {
     psa_status_t status;
@@ -4731,6 +4732,15 @@
         if( status != PSA_SUCCESS )
             return( status );
 
+        if ( salt != NULL )
+        {
+            status = psa_key_derivation_input_bytes( derivation,
+                                                    PSA_KEY_DERIVATION_INPUT_SALT,
+                                                    salt, salt_length );
+            if( status != PSA_SUCCESS )
+                return( status );
+        }
+
         if( mbedtls_svc_key_id_is_null( key ) )
         {
             status = psa_key_derivation_input_bytes(
@@ -4804,6 +4814,7 @@
                                        random, rlen,
                                        (unsigned char const *) label,
                                        (size_t) strlen( label ),
+                                       NULL, 0,
                                        dlen );
     if( status != PSA_SUCCESS )
     {