Fix build fails with non ECDSA / restartable builds

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
Paul Elliott 2023-02-07 11:21:10 +00:00
parent 6f60037589
commit 1243f93cca
2 changed files with 11 additions and 2 deletions

View file

@ -3575,13 +3575,14 @@ psa_status_t mbedtls_psa_sign_hash_complete(
size_t *signature_length)
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
mbedtls_mpi r;
mbedtls_mpi s;
#if (defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA)) && \
defined(MBEDTLS_ECP_RESTARTABLE)
mbedtls_mpi r;
mbedtls_mpi s;
if (signature_size < 2 * operation->coordinate_bytes) {
return PSA_ERROR_BUFFER_TOO_SMALL;
}
@ -3790,6 +3791,7 @@ psa_status_t mbedtls_psa_verify_hash_start(
(void) signature;
(void) signature_length;
(void) status;
(void) coordinate_bytes;
return PSA_ERROR_NOT_SUPPORTED;
#endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) ||

View file

@ -1220,6 +1220,10 @@ typedef enum {
INJECT_ANTICIPATE_KEY_DERIVATION_2,
} ecjpake_injected_failure_t;
#if (defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA)) && \
defined(MBEDTLS_ECP_RESTARTABLE)
static void interruptible_signverify_get_minmax_completes(uint32_t max_ops,
psa_status_t expected_status,
size_t *min_completes,
@ -1244,6 +1248,9 @@ static void interruptible_signverify_get_minmax_completes(uint32_t max_ops,
*max_completes = 1;
}
}
#endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) ||
* defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) &&
* defined( MBEDTLS_ECP_RESTARTABLE ) */
/* END_HEADER */