-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order for Mbed TLS to use the PSA Crypto API, definitions of `MBEDTLS_SVC_KEY_ID_INIT`, `mbedtls_svc_key_id_t` and `mbedtls_svc_key_id_is_null()` need to be present but are not provided by the PSA headers from TF-M. To solve this issue, this commit copies those definitions from Mbed TLS's original `psa/crypto_types.h` and `psa/crypto_values.h` into a separate `mbedtls_svc_key_id.h` for TF-M PSA.
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...RE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/include/mbedtls_svc_key_id.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* \file mbedtls_svc_key_id.h | ||
* | ||
* Excerpted from Mbed TLS for internal use by Mbed TLS's PSK key exchange to | ||
* interface with generic PSA Crypto implementations. | ||
* | ||
*/ | ||
/* | ||
* Copyright The Mbed TLS Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef MBEDTLS_SVC_KEY_ID_H | ||
#define MBEDTLS_SVC_KEY_ID_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef psa_key_id_t mbedtls_svc_key_id_t; | ||
|
||
#define MBEDTLS_SVC_KEY_ID_INIT ( (psa_key_id_t)0 ) | ||
|
||
/** Check whether a key identifier is null. | ||
* | ||
* \param key Key identifier. | ||
* | ||
* \return Non-zero if the key identifier is null, zero otherwise. | ||
*/ | ||
static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key ) | ||
{ | ||
return( key == 0 ); | ||
} | ||
|
||
/**@}*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* MBEDTLS_SVC_KEY_ID_H */ |
53 changes: 53 additions & 0 deletions
53
...TURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/include/mbedtls_svc_key_id.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* \file mbedtls_svc_key_id.h | ||
* | ||
* Excerpted from Mbed TLS for internal use by Mbed TLS's PSK key exchange to | ||
* interface with generic PSA Crypto implementations. | ||
* | ||
*/ | ||
/* | ||
* Copyright The Mbed TLS Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef MBEDTLS_SVC_KEY_ID_H | ||
#define MBEDTLS_SVC_KEY_ID_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef psa_key_id_t mbedtls_svc_key_id_t; | ||
|
||
#define MBEDTLS_SVC_KEY_ID_INIT ( (psa_key_id_t)0 ) | ||
|
||
/** Check whether a key identifier is null. | ||
* | ||
* \param key Key identifier. | ||
* | ||
* \return Non-zero if the key identifier is null, zero otherwise. | ||
*/ | ||
static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key ) | ||
{ | ||
return( key == 0 ); | ||
} | ||
|
||
/**@}*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* MBEDTLS_SVC_KEY_ID_H */ |