Add functions for initializing empty crypto backend handles

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen 2021-07-16 10:19:53 +03:00 committed by Beat Küng
parent 9290ea974e
commit aa61bc4942
2 changed files with 3 additions and 3 deletions

View File

@ -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;}

View File

@ -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;}