|
BSL v1.1.1 - 50.g42e5d9b
AMMOS Bundle Protocol Security Library (BSL)
|
Declaration of functions to load and manipulate the Mock BPA key store separate from the API used by the crypto library. More...
Include dependency graph for KeyStore.h:
This graph shows which files directly or indirectly include this file:Functions | |
| BSL_KeyStore_Descriptors_t | MockBPA_KeyStore_Descriptors (void) |
| Get key store descriptors for the process. | |
| void | MockBPA_KeyStore_Init (void) |
| Initialize the key storage and register it with BSL_KeyStore_Init(). | |
| void | MockBPA_KeyStore_Deinit (void) |
| De-register with BSL_KeyStore_Deinit() and clear all key storage. | |
| int | MockBPA_KeyStore_RemoveKey (const BSL_Data_t *keyid) |
| Erase key entry from crypto library registry, if present. | |
| int | MockBPA_KeyStore_AddKey (const BSL_Data_t *keyid, BSL_Crypto_KeyHandle_t handle) |
| Add a new key to the crypto key registry. | |
| BSL_Variant_t * | MockBPA_KeyStore_SetKeyParameter (BSL_Crypto_KeyHandle_t handle, int64_t param_id) |
| Add a context-specific parameter to a known key. | |
Declaration of functions to load and manipulate the Mock BPA key store separate from the API used by the crypto library.
| int MockBPA_KeyStore_AddKey | ( | const BSL_Data_t * | keyid, |
| BSL_Crypto_KeyHandle_t | handle | ||
| ) |
Add a new key to the crypto key registry.
| [in] | keyid | key ID that crypto functions will use to access key |
| [out] | handle | Key handle to add to the registry. Once the key is added it should be treated as read-only for thread-safety purposes. When handle is output, the handle must be released with BSL_Crypto_ReleaseKeyHandle() when it is done being used. |
References ASSERT_ARG_NONNULL, CHK_ARG_NONNULL, keyid, StaticCryptoMutex, and StaticKeyRegistry.
Referenced by BSL_Crypto_AddRegistryKeyName(), MockBPA_KeyStore_Descriptors(), test_AppendixA_Example1_BIB_Source(), test_AppendixA_Example1_BIB_VerifyAccept(), test_AppendixA_Example4_BCB_Source(), test_AppendixA_Example4_BCB_VerifyAccept(), test_AppendixA_Example5_BCB_Source(), test_AppendixA_Example5_BCB_VerifyAccept(), test_AppendixA_Example6_BCB_Source(), test_CCSDS_Example_Mac_Source(), test_CCSDS_Example_Mac_VerifyAccept(), and test_key_stats().
| void MockBPA_KeyStore_Deinit | ( | void | ) |
De-register with BSL_KeyStore_Deinit() and clear all key storage.
References BSL_KeyStore_Deinit(), StaticCryptoMutex, and StaticKeyRegistry.
Referenced by _tearDown(), LLVMFuzzerTestOneInput(), main(), and tearDown().
| BSL_KeyStore_Descriptors_t MockBPA_KeyStore_Descriptors | ( | void | ) |
Get key store descriptors for the process.
References MockBPA_KeyStore_Acquire(), MockBPA_KeyStore_AddKey(), MockBPA_KeyStore_FindKey(), MockBPA_KeyStore_GetKeymat(), MockBPA_KeyStore_GetKeyParameter(), MockBPA_KeyStore_GetStats(), MockBPA_KeyStore_New(), MockBPA_KeyStore_Release(), MockBPA_KeyStore_SetKeymat(), MockBPA_KeyStore_SetKeyParameter(), MockBPA_KeyStore_UpdateStats(), and BSL_KeyStore_Descriptors_t::new_key.
Referenced by MockBPA_KeyStore_Init().
| void MockBPA_KeyStore_Init | ( | void | ) |
Initialize the key storage and register it with BSL_KeyStore_Init().
References BSL_KeyStore_Init(), MockBPA_KeyStore_Descriptors(), StaticCryptoMutex, and StaticKeyRegistry.
Referenced by _setUp(), LLVMFuzzerTestOneInput(), main(), and setUp().
| int MockBPA_KeyStore_RemoveKey | ( | const BSL_Data_t * | keyid | ) |
Erase key entry from crypto library registry, if present.
| [in] | keyid | key ID of key to remove. |
References ASSERT_ARG_NONNULL, BSL_SUCCESS, keyid, StaticCryptoMutex, and StaticKeyRegistry.
Referenced by MockBPA_KeyStore_RemoveKeyName().
| BSL_Variant_t * MockBPA_KeyStore_SetKeyParameter | ( | BSL_Crypto_KeyHandle_t | handle, |
| int64_t | param_id | ||
| ) |
Add a context-specific parameter to a known key.
| [in] | handle | The key ID to update. |
| [in] | param_id | The parameter to access. If the parameter does not already exist it will be created. |
References ASSERT_ARG_NONNULL, and BSL_CryptoKey_t::params.
Referenced by MockBPA_KeyStore_Descriptors(), test_AppendixA_Example1_BIB_Source(), test_AppendixA_Example1_BIB_VerifyAccept(), test_AppendixA_Example4_BCB_Source(), test_AppendixA_Example4_BCB_VerifyAccept(), test_AppendixA_Example5_BCB_Source(), test_AppendixA_Example5_BCB_VerifyAccept(), test_AppendixA_Example6_BCB_Source(), test_CCSDS_Example_Mac_Source(), and test_CCSDS_Example_Mac_VerifyAccept().