Skip to content

Commit

Permalink
Only include psa_pake_setup() and friends if some PAKE algorithms are…
Browse files Browse the repository at this point in the history
… required

Signed-off-by: Tom Cosgrove <[email protected]>
  • Loading branch information
tom-cosgrove-arm committed May 12, 2023
1 parent 1d046fa commit 6d62fac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.d/add-psa_want_alg_some_pake.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Features
* Don't include the PSA dispatch functions for PAKEs (psa_pake_setup() etc)
if no PAKE algorithms are requested
4 changes: 4 additions & 0 deletions include/mbedtls/config_psa.h
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,10 @@ extern "C" {

#endif /* MBEDTLS_PSA_CRYPTO_CONFIG */

#if defined(PSA_WANT_ALG_JPAKE)
#define PSA_WANT_ALG_SOME_PAKE 1
#endif

/* These features are always enabled. */
#define PSA_WANT_KEY_TYPE_DERIVE 1
#define PSA_WANT_KEY_TYPE_PASSWORD 1
Expand Down
2 changes: 2 additions & 0 deletions library/psa_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -7384,6 +7384,7 @@ psa_status_t psa_crypto_driver_pake_get_cipher_suite(
return PSA_SUCCESS;
}

#if defined(PSA_WANT_ALG_SOME_PAKE)
psa_status_t psa_pake_setup(
psa_pake_operation_t *operation,
const psa_pake_cipher_suite_t *cipher_suite)
Expand Down Expand Up @@ -8100,5 +8101,6 @@ psa_status_t psa_pake_abort(

return status;
}
#endif /* PSA_WANT_ALG_SOME_PAKE */

#endif /* MBEDTLS_PSA_CRYPTO_C */

0 comments on commit 6d62fac

Please sign in to comment.