blob: 0aefb00825036524f7250ee368dcf112aada9bae [file] [log] [blame]
Gilles Peskinea899a722019-06-24 14:06:43 +02001/*
2 * PSA crypto support for secure element drivers
3 */
Bence Szépkúti86974652020-06-15 11:59:37 +02004/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02005 * Copyright The Mbed TLS Contributors
Gilles Peskinea899a722019-06-24 14:06:43 +02006 * SPDX-License-Identifier: Apache-2.0
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
9 * not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
Gilles Peskinea899a722019-06-24 14:06:43 +020019 */
20
Gilles Peskinedb09ef62020-06-03 01:43:33 +020021#include "common.h"
Gilles Peskinea899a722019-06-24 14:06:43 +020022
Gilles Peskinea8ade162019-06-26 11:24:49 +020023#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
Gilles Peskinea899a722019-06-24 14:06:43 +020024
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020025# include <assert.h>
26# include <stdint.h>
27# include <string.h>
Gilles Peskined0890212019-06-24 14:34:43 +020028
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020029# include "psa/crypto_se_driver.h"
Gilles Peskine5243a202019-07-12 23:38:19 +020030
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020031# include "psa_crypto_se.h"
Gilles Peskinea899a722019-06-24 14:06:43 +020032
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020033# if defined(MBEDTLS_PSA_ITS_FILE_C)
34# include "psa_crypto_its.h"
35# else /* Native ITS implementation */
36# include "psa/error.h"
37# include "psa/internal_trusted_storage.h"
38# endif
Gilles Peskine8b96cad2019-07-23 17:38:08 +020039
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020040# include "mbedtls/platform.h"
41# if !defined(MBEDTLS_PLATFORM_C)
42# define mbedtls_calloc calloc
43# define mbedtls_free free
44# endif
Gilles Peskine5243a202019-07-12 23:38:19 +020045
Gilles Peskinef989dbe2019-06-26 18:18:12 +020046/****************************************************************/
47/* Driver lookup */
48/****************************************************************/
49
Gilles Peskine5243a202019-07-12 23:38:19 +020050/* This structure is identical to psa_drv_se_context_t declared in
51 * `crypto_se_driver.h`, except that some parts are writable here
52 * (non-const, or pointer to non-const). */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020053typedef struct {
Gilles Peskine5243a202019-07-12 23:38:19 +020054 void *persistent_data;
55 size_t persistent_data_size;
56 uintptr_t transient_data;
57} psa_drv_se_internal_context_t;
58
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020059struct psa_se_drv_table_entry_s {
Gilles Peskine2b04f462020-05-10 00:44:04 +020060 psa_key_location_t location;
Gilles Peskinea899a722019-06-24 14:06:43 +020061 const psa_drv_se_t *methods;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020062 union {
Gilles Peskine5243a202019-07-12 23:38:19 +020063 psa_drv_se_internal_context_t internal;
64 psa_drv_se_context_t context;
Gilles Peskine1a75d0c2020-04-14 19:33:25 +020065 } u;
Gilles Peskine01fd8752020-04-14 19:31:52 +020066};
Gilles Peskinea899a722019-06-24 14:06:43 +020067
Gilles Peskinef989dbe2019-06-26 18:18:12 +020068static psa_se_drv_table_entry_t driver_table[PSA_MAX_SE_DRIVERS];
69
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020070psa_se_drv_table_entry_t *psa_get_se_driver_entry(psa_key_lifetime_t lifetime)
Gilles Peskinef989dbe2019-06-26 18:18:12 +020071{
72 size_t i;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020073 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(lifetime);
Gilles Peskine2b04f462020-05-10 00:44:04 +020074 /* In the driver table, location=0 means an entry that isn't used.
75 * No driver has a location of 0 because it's a reserved value
76 * (which designates transparent keys). Make sure we never return
77 * a driver entry for location 0. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020078 if (location == 0)
79 return NULL;
80 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
81 if (driver_table[i].location == location)
82 return &driver_table[i];
Gilles Peskinef989dbe2019-06-26 18:18:12 +020083 }
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020084 return NULL;
Gilles Peskinef989dbe2019-06-26 18:18:12 +020085}
86
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020087const psa_drv_se_t *
88psa_get_se_driver_methods(const psa_se_drv_table_entry_t *driver)
Gilles Peskinef989dbe2019-06-26 18:18:12 +020089{
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020090 return driver->methods;
Gilles Peskinef989dbe2019-06-26 18:18:12 +020091}
92
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020093psa_drv_se_context_t *
94psa_get_se_driver_context(psa_se_drv_table_entry_t *driver)
Gilles Peskinef989dbe2019-06-26 18:18:12 +020095{
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020096 return &driver->u.context;
Gilles Peskinef989dbe2019-06-26 18:18:12 +020097}
98
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020099int psa_get_se_driver(psa_key_lifetime_t lifetime,
100 const psa_drv_se_t **p_methods,
101 psa_drv_se_context_t **p_drv_context)
Gilles Peskine5243a202019-07-12 23:38:19 +0200102{
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200103 psa_se_drv_table_entry_t *driver = psa_get_se_driver_entry(lifetime);
104 if (p_methods != NULL)
105 *p_methods = (driver ? driver->methods : NULL);
106 if (p_drv_context != NULL)
107 *p_drv_context = (driver ? &driver->u.context : NULL);
108 return driver != NULL;
Gilles Peskine5243a202019-07-12 23:38:19 +0200109}
110
Gilles Peskine5243a202019-07-12 23:38:19 +0200111/****************************************************************/
112/* Persistent data management */
113/****************************************************************/
114
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200115static psa_status_t
116psa_get_se_driver_its_file_uid(const psa_se_drv_table_entry_t *driver,
117 psa_storage_uid_t *uid)
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200118{
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200119 if (driver->location > PSA_MAX_SE_LOCATION)
120 return PSA_ERROR_NOT_SUPPORTED;
Gilles Peskine573bbc12019-07-23 19:59:23 +0200121
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200122# if SIZE_MAX > UINT32_MAX
Gilles Peskine573bbc12019-07-23 19:59:23 +0200123 /* ITS file sizes are limited to 32 bits. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200124 if (driver->u.internal.persistent_data_size > UINT32_MAX)
125 return PSA_ERROR_NOT_SUPPORTED;
126# endif
Gilles Peskine573bbc12019-07-23 19:59:23 +0200127
Gilles Peskine75c126b2019-07-24 15:56:01 +0200128 /* See the documentation of PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE. */
Gilles Peskine2b04f462020-05-10 00:44:04 +0200129 *uid = PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE + driver->location;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200130 return PSA_SUCCESS;
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200131}
132
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200133psa_status_t psa_load_se_persistent_data(const psa_se_drv_table_entry_t *driver)
Gilles Peskine5243a202019-07-12 23:38:19 +0200134{
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200135 psa_status_t status;
136 psa_storage_uid_t uid;
Gilles Peskine8b663892019-07-31 17:57:57 +0200137 size_t length;
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200138
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200139 status = psa_get_se_driver_its_file_uid(driver, &uid);
140 if (status != PSA_SUCCESS)
141 return status;
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200142
Gilles Peskine8b663892019-07-31 17:57:57 +0200143 /* Read the amount of persistent data that the driver requests.
144 * If the data in storage is larger, it is truncated. If the data
145 * in storage is smaller, silently keep what is already at the end
146 * of the output buffer. */
Gilles Peskine75c126b2019-07-24 15:56:01 +0200147 /* psa_get_se_driver_its_file_uid ensures that the size_t
148 * persistent_data_size is in range, but compilers don't know that,
149 * so cast to reassure them. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200150 return (psa_its_get(uid, 0,
151 (uint32_t)driver->u.internal.persistent_data_size,
152 driver->u.internal.persistent_data, &length));
Gilles Peskine5243a202019-07-12 23:38:19 +0200153}
154
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200155psa_status_t psa_save_se_persistent_data(const psa_se_drv_table_entry_t *driver)
Gilles Peskine5243a202019-07-12 23:38:19 +0200156{
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200157 psa_status_t status;
158 psa_storage_uid_t uid;
159
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200160 status = psa_get_se_driver_its_file_uid(driver, &uid);
161 if (status != PSA_SUCCESS)
162 return status;
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200163
Gilles Peskine75c126b2019-07-24 15:56:01 +0200164 /* psa_get_se_driver_its_file_uid ensures that the size_t
165 * persistent_data_size is in range, but compilers don't know that,
166 * so cast to reassure them. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200167 return (psa_its_set(uid, (uint32_t)driver->u.internal.persistent_data_size,
168 driver->u.internal.persistent_data, 0));
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200169}
170
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200171psa_status_t psa_destroy_se_persistent_data(psa_key_location_t location)
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200172{
173 psa_storage_uid_t uid;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200174 if (location > PSA_MAX_SE_LOCATION)
175 return PSA_ERROR_NOT_SUPPORTED;
Gilles Peskine2b04f462020-05-10 00:44:04 +0200176 uid = PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE + location;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200177 return psa_its_remove(uid);
Gilles Peskine5243a202019-07-12 23:38:19 +0200178}
Gilles Peskinef989dbe2019-06-26 18:18:12 +0200179
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200180psa_status_t psa_find_se_slot_for_key(const psa_key_attributes_t *attributes,
181 psa_key_creation_method_t method,
182 psa_se_drv_table_entry_t *driver,
183 psa_key_slot_number_t *slot_number)
Gilles Peskinecbaff462019-07-12 23:46:04 +0200184{
185 psa_status_t status;
Gilles Peskine2b04f462020-05-10 00:44:04 +0200186 psa_key_location_t key_location =
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200187 PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
Gilles Peskinecbaff462019-07-12 23:46:04 +0200188
Gilles Peskine2b04f462020-05-10 00:44:04 +0200189 /* If the location is wrong, it's a bug in the library. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200190 if (driver->location != key_location)
191 return PSA_ERROR_CORRUPTION_DETECTED;
Gilles Peskinecbaff462019-07-12 23:46:04 +0200192
193 /* If the driver doesn't support key creation in any way, give up now. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200194 if (driver->methods->key_management == NULL)
195 return PSA_ERROR_NOT_SUPPORTED;
Gilles Peskinecbaff462019-07-12 23:46:04 +0200196
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200197 if (psa_get_key_slot_number(attributes, slot_number) == PSA_SUCCESS) {
Gilles Peskine46d94392019-08-05 14:55:50 +0200198 /* The application wants to use a specific slot. Allow it if
199 * the driver supports it. On a system with isolation,
200 * the crypto service must check that the application is
201 * permitted to request this slot. */
202 psa_drv_se_validate_slot_number_t p_validate_slot_number =
203 driver->methods->key_management->p_validate_slot_number;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200204 if (p_validate_slot_number == NULL)
205 return PSA_ERROR_NOT_SUPPORTED;
206 status = p_validate_slot_number(&driver->u.context,
207 driver->u.internal.persistent_data,
208 attributes, method, *slot_number);
209 } else if (method == PSA_KEY_CREATION_REGISTER) {
Gilles Peskine3efcebb2019-10-01 14:18:35 +0200210 /* The application didn't specify a slot number. This doesn't
211 * make sense when registering a slot. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200212 return PSA_ERROR_INVALID_ARGUMENT;
213 } else {
Gilles Peskine46d94392019-08-05 14:55:50 +0200214 /* The application didn't tell us which slot to use. Let the driver
215 * choose. This is the normal case. */
216 psa_drv_se_allocate_key_t p_allocate =
217 driver->methods->key_management->p_allocate;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200218 if (p_allocate == NULL)
219 return PSA_ERROR_NOT_SUPPORTED;
220 status = p_allocate(&driver->u.context,
221 driver->u.internal.persistent_data, attributes,
222 method, slot_number);
Gilles Peskine46d94392019-08-05 14:55:50 +0200223 }
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200224 return status;
Gilles Peskinecbaff462019-07-12 23:46:04 +0200225}
226
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200227psa_status_t psa_destroy_se_key(psa_se_drv_table_entry_t *driver,
228 psa_key_slot_number_t slot_number)
Gilles Peskine354f7672019-07-12 23:46:38 +0200229{
230 psa_status_t status;
231 psa_status_t storage_status;
Gilles Peskine340b1272019-07-25 14:13:24 +0200232 /* Normally a missing method would mean that the action is not
233 * supported. But psa_destroy_key() is not supposed to return
234 * PSA_ERROR_NOT_SUPPORTED: if you can create a key, you should
235 * be able to destroy it. The only use case for a driver that
236 * does not have a way to destroy keys at all is if the keys are
237 * locked in a read-only state: we can use the keys but not
238 * destroy them. Hence, if the driver doesn't support destroying
239 * keys, it's really a lack of permission. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200240 if (driver->methods->key_management == NULL ||
241 driver->methods->key_management->p_destroy == NULL)
242 return PSA_ERROR_NOT_PERMITTED;
Gilles Peskine354f7672019-07-12 23:46:38 +0200243 status = driver->methods->key_management->p_destroy(
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200244 &driver->u.context, driver->u.internal.persistent_data, slot_number);
245 storage_status = psa_save_se_persistent_data(driver);
246 return status == PSA_SUCCESS ? storage_status : status;
Gilles Peskine354f7672019-07-12 23:46:38 +0200247}
248
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200249psa_status_t psa_init_all_se_drivers(void)
Gilles Peskined9348f22019-10-01 15:22:29 +0200250{
251 size_t i;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200252 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
Gilles Peskined9348f22019-10-01 15:22:29 +0200253 psa_se_drv_table_entry_t *driver = &driver_table[i];
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200254 if (driver->location == 0)
Gilles Peskined9348f22019-10-01 15:22:29 +0200255 continue; /* skipping unused entry */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200256 const psa_drv_se_t *methods = psa_get_se_driver_methods(driver);
257 if (methods->p_init != NULL) {
Gilles Peskined9348f22019-10-01 15:22:29 +0200258 psa_status_t status = methods->p_init(
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200259 &driver->u.context, driver->u.internal.persistent_data,
260 driver->location);
261 if (status != PSA_SUCCESS)
262 return status;
263 status = psa_save_se_persistent_data(driver);
264 if (status != PSA_SUCCESS)
265 return status;
Gilles Peskined9348f22019-10-01 15:22:29 +0200266 }
267 }
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200268 return PSA_SUCCESS;
Gilles Peskined9348f22019-10-01 15:22:29 +0200269}
270
Gilles Peskinef989dbe2019-06-26 18:18:12 +0200271/****************************************************************/
272/* Driver registration */
273/****************************************************************/
Gilles Peskinea899a722019-06-24 14:06:43 +0200274
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200275psa_status_t psa_register_se_driver(psa_key_location_t location,
276 const psa_drv_se_t *methods)
Gilles Peskinea899a722019-06-24 14:06:43 +0200277{
278 size_t i;
Gilles Peskine5243a202019-07-12 23:38:19 +0200279 psa_status_t status;
Gilles Peskinea899a722019-06-24 14:06:43 +0200280
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200281 if (methods->hal_version != PSA_DRV_SE_HAL_VERSION)
282 return PSA_ERROR_NOT_SUPPORTED;
283 /* Driver table entries are 0-initialized. 0 is not a valid driver
284 * location because it means a transparent key. */
285# if defined(static_assert)
286 static_assert(PSA_KEY_LOCATION_LOCAL_STORAGE == 0,
287 "Secure element support requires 0 to mean a local key");
288# endif
289 if (location == PSA_KEY_LOCATION_LOCAL_STORAGE)
290 return PSA_ERROR_INVALID_ARGUMENT;
291 if (location > PSA_MAX_SE_LOCATION)
292 return PSA_ERROR_NOT_SUPPORTED;
Gilles Peskinea899a722019-06-24 14:06:43 +0200293
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200294 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
295 if (driver_table[i].location == 0)
Gilles Peskinea899a722019-06-24 14:06:43 +0200296 break;
Gilles Peskine2b04f462020-05-10 00:44:04 +0200297 /* Check that location isn't already in use up to the first free
Gilles Peskinea899a722019-06-24 14:06:43 +0200298 * entry. Since entries are created in order and never deleted,
299 * there can't be a used entry after the first free entry. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200300 if (driver_table[i].location == location)
301 return PSA_ERROR_ALREADY_EXISTS;
Gilles Peskinea899a722019-06-24 14:06:43 +0200302 }
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200303 if (i == PSA_MAX_SE_DRIVERS)
304 return PSA_ERROR_INSUFFICIENT_MEMORY;
Gilles Peskinea899a722019-06-24 14:06:43 +0200305
Gilles Peskine2b04f462020-05-10 00:44:04 +0200306 driver_table[i].location = location;
Gilles Peskinea899a722019-06-24 14:06:43 +0200307 driver_table[i].methods = methods;
Gilles Peskine1a75d0c2020-04-14 19:33:25 +0200308 driver_table[i].u.internal.persistent_data_size =
Gilles Peskined5536d82019-10-01 16:55:29 +0200309 methods->persistent_data_size;
Gilles Peskine5243a202019-07-12 23:38:19 +0200310
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200311 if (methods->persistent_data_size != 0) {
Gilles Peskine1a75d0c2020-04-14 19:33:25 +0200312 driver_table[i].u.internal.persistent_data =
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200313 mbedtls_calloc(1, methods->persistent_data_size);
314 if (driver_table[i].u.internal.persistent_data == NULL) {
Gilles Peskine5243a202019-07-12 23:38:19 +0200315 status = PSA_ERROR_INSUFFICIENT_MEMORY;
316 goto error;
317 }
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200318 /* Load the driver's persistent data. On first use, the persistent
319 * data does not exist in storage, and is initialized to
320 * all-bits-zero by the calloc call just above. */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200321 status = psa_load_se_persistent_data(&driver_table[i]);
322 if (status != PSA_SUCCESS && status != PSA_ERROR_DOES_NOT_EXIST)
Gilles Peskine5243a202019-07-12 23:38:19 +0200323 goto error;
324 }
Gilles Peskine5243a202019-07-12 23:38:19 +0200325
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200326 return PSA_SUCCESS;
Gilles Peskine5243a202019-07-12 23:38:19 +0200327
328error:
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200329 memset(&driver_table[i], 0, sizeof(driver_table[i]));
330 return status;
Gilles Peskinea899a722019-06-24 14:06:43 +0200331}
332
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200333void psa_unregister_all_se_drivers(void)
Gilles Peskined0890212019-06-24 14:34:43 +0200334{
Gilles Peskine5243a202019-07-12 23:38:19 +0200335 size_t i;
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200336 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
337 if (driver_table[i].u.internal.persistent_data != NULL)
338 mbedtls_free(driver_table[i].u.internal.persistent_data);
Gilles Peskine5243a202019-07-12 23:38:19 +0200339 }
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +0200340 memset(driver_table, 0, sizeof(driver_table));
Gilles Peskined0890212019-06-24 14:34:43 +0200341}
342
Gilles Peskinef989dbe2019-06-26 18:18:12 +0200343/****************************************************************/
344/* The end */
345/****************************************************************/
346
Gilles Peskinea8ade162019-06-26 11:24:49 +0200347#endif /* MBEDTLS_PSA_CRYPTO_SE_C */