|
25 | 25 | #include <inttypes.h>
|
26 | 26 | #include "entropy.h"
|
27 | 27 | #include "entropy_poll.h"
|
| 28 | +#include "mbedtls/version.h" |
28 | 29 |
|
29 | 30 | #if defined(MBEDTLS_PLATFORM_C)
|
30 | 31 | #include "mbedtls/platform.h"
|
|
46 | 47 | } \
|
47 | 48 | } while (0)
|
48 | 49 |
|
49 |
| -#if !defined(MBEDTLS_PSA_CRYPTO_C) |
| 50 | +#if !defined(MBEDTLS_PSA_CRYPTO_C) || (MBEDTLS_VERSION_NUMBER < 0x02130000) |
50 | 51 | int main(void)
|
51 | 52 | {
|
52 |
| - mbedtls_printf("Not all of the required options are defined:\n" |
53 |
| - " - MBEDTLS_PSA_CRYPTO_C\n"); |
| 53 | + mbedtls_printf("Not all of the requirements are met:\n" |
| 54 | + " - MBEDTLS_PSA_CRYPTO_C\n" |
| 55 | + " - PSA Crypto API v1.0b3\n"); |
54 | 56 | return 0;
|
55 | 57 | }
|
56 | 58 | #else
|
@@ -81,7 +83,7 @@ static psa_status_t check_initial_attestation_get_token()
|
81 | 83 | ASSERT_STATUS(status, PSA_SUCCESS);
|
82 | 84 | status = psa_attestation_inject_key(NULL,
|
83 | 85 | 0,
|
84 |
| - PSA_KEY_TYPE_ECC_KEYPAIR(PSA_ECC_CURVE_SECP256R1), |
| 86 | + PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_CURVE_SECP256R1), |
85 | 87 | exported,
|
86 | 88 | sizeof(exported),
|
87 | 89 | &exported_length);
|
@@ -119,12 +121,11 @@ static void attestation_example(void)
|
119 | 121 |
|
120 | 122 | int main(void)
|
121 | 123 | {
|
122 |
| - const psa_key_id_t key_id = PSA_ATTESTATION_PRIVATE_KEY_ID; |
123 |
| - psa_key_handle_t handle = 0; |
| 124 | + psa_key_handle_t handle; |
124 | 125 |
|
125 | 126 | attestation_example();
|
126 | 127 |
|
127 |
| - psa_open_key(PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle); |
| 128 | + psa_open_key(PSA_ATTESTATION_PRIVATE_KEY_ID, &handle); |
128 | 129 | psa_destroy_key(handle);
|
129 | 130 | mbedtls_psa_crypto_free();
|
130 | 131 | return 0;
|
|
0 commit comments