diff --git a/platforms/common/px4_sw_crypto/stub_keystore/keystore_backend_definitions.h b/platforms/common/px4_sw_crypto/stub_keystore/keystore_backend_definitions.h index c3a3f05406..3e990cd71f 100644 --- a/platforms/common/px4_sw_crypto/stub_keystore/keystore_backend_definitions.h +++ b/platforms/common/px4_sw_crypto/stub_keystore/keystore_backend_definitions.h @@ -37,6 +37,5 @@ typedef struct { int handle; } keystore_session_handle_t; -/* For the stub_keystore the handle is not used at the moment, so it is always valid */ - -inline bool keystore_session_handle_valid(keystore_session_handle_t handle) {return handle.handle > 0;} +static inline void keystore_session_handle_init(keystore_session_handle_t *handle) {handle->handle = 0;} +static inline bool keystore_session_handle_valid(keystore_session_handle_t handle) {return handle.handle > 0;} diff --git a/platforms/common/px4_sw_crypto/sw_crypto/crypto_backend_definitions.h b/platforms/common/px4_sw_crypto/sw_crypto/crypto_backend_definitions.h index 36219e04f4..052962aa44 100644 --- a/platforms/common/px4_sw_crypto/sw_crypto/crypto_backend_definitions.h +++ b/platforms/common/px4_sw_crypto/sw_crypto/crypto_backend_definitions.h @@ -43,4 +43,5 @@ typedef struct { keystore_session_handle_t keystore_handle; } crypto_session_handle_t; +static inline void crypto_session_handle_init(crypto_session_handle_t *handle) {handle->handle = 0;} static inline bool crypto_session_handle_valid(crypto_session_handle_t handle) {return handle.handle > 0;}