File tree Expand file tree Collapse file tree 3 files changed +30
-8
lines changed Expand file tree Collapse file tree 3 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright 2020 Contributors to the Parsec project.
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
+ // This file is needed to provide linkable versions of certain
5
+ // PSA Crypto functions that may be declared static inline.
6
+ // See: https://github.com/ARMmbed/mbedtls/issues/3230
7
+
4
8
#include "shim.h"
5
9
10
+ size_t
11
+ shim_get_key_bits (const psa_key_attributes_t * attributes )
12
+ {
13
+ return psa_get_key_bits (attributes );
14
+ }
15
+
16
+ psa_key_type_t
17
+ shim_get_key_type (const psa_key_attributes_t * attributes )
18
+ {
19
+ return psa_get_key_type (attributes );
20
+ }
21
+
6
22
psa_key_attributes_t
7
23
shim_key_attributes_init (void )
8
24
{
Original file line number Diff line number Diff line change @@ -143,6 +143,12 @@ const psa_key_usage_t shim_PSA_KEY_USAGE_SIGN = PSA_KEY_USAGE_SIGN;
143
143
const psa_key_usage_t shim_PSA_KEY_USAGE_VERIFY = PSA_KEY_USAGE_VERIFY ;
144
144
const psa_key_usage_t shim_PSA_KEY_USAGE_DERIVE = PSA_KEY_USAGE_DERIVE ;
145
145
146
+ size_t
147
+ shim_get_key_bits (const psa_key_attributes_t * attributes );
148
+
149
+ psa_key_type_t
150
+ shim_get_key_type (const psa_key_attributes_t * attributes );
151
+
146
152
psa_key_attributes_t
147
153
shim_key_attributes_init (void );
148
154
Original file line number Diff line number Diff line change @@ -229,14 +229,6 @@ pub fn psa_get_key_attributes(
229
229
) )
230
230
}
231
231
232
- pub fn psa_get_key_bits ( attributes : & psa_key_attributes_t ) -> usize {
233
- wrap_any ! ( ( * attributes) . x. core. bits as usize )
234
- }
235
-
236
- pub fn psa_get_key_type ( attributes : & psa_key_attributes_t ) -> psa_key_type_t {
237
- wrap_any ! ( ( * attributes) . x. core. type_)
238
- }
239
-
240
232
pub fn psa_import_key (
241
233
attributes : * const psa_key_attributes_t ,
242
234
data : * const u8 ,
@@ -263,6 +255,14 @@ pub fn psa_reset_key_attributes(attributes: *mut psa_key_attributes_t) {
263
255
264
256
// Wrapped shims:
265
257
258
+ pub fn psa_get_key_bits ( attributes : & psa_key_attributes_t ) -> usize {
259
+ wrap_any ! ( psa_crypto_binding:: shim_get_key_bits( & attributes. x) )
260
+ }
261
+
262
+ pub fn psa_get_key_type ( attributes : & psa_key_attributes_t ) -> psa_key_type_t {
263
+ wrap_any ! ( psa_crypto_binding:: shim_get_key_type( & attributes. x) )
264
+ }
265
+
266
266
pub fn psa_key_attributes_init ( ) -> psa_key_attributes_t {
267
267
let attr = wrap_any ! ( psa_crypto_binding:: shim_key_attributes_init( ) ) ;
268
268
psa_key_attributes_t { x : attr }
You can’t perform that action at this time.
0 commit comments