|
BSL v1.1.1 - 50.g42e5d9b
AMMOS Bundle Protocol Security Library (BSL)
|
Provider of a key store via the crypto API BSL_KeyStore_Descriptors_t. More...
#include "KeyStore.h"#include <bsl/dynamic/Variant.h>#include <m-bstring.h>#include <m-dict.h>#include <m-shared-ptr.h>
Include dependency graph for KeyStore.c:Data Structures | |
| struct | BSL_CryptoKey_t |
| Struct to hold private key information. More... | |
Macros | |
| #define | M_OPL_BSL_CryptoKey_t() M_OPEXTEND(M_POD_OPLIST, INIT(API_2(BSL_CryptoKey_Init)), INIT_SET(0), SET(0), CLEAR(API_2(BSL_CryptoKey_Deinit))) |
| M*LIB OPLIST for BSL_CryptoKey_t. | |
Variables | |
| static BSL_CryptoKeyDict_t | StaticKeyRegistry |
| Crypto key registry. | |
| static pthread_mutex_t | StaticCryptoMutex = PTHREAD_MUTEX_INITIALIZER |
Provider of a key store via the crypto API BSL_KeyStore_Descriptors_t.
| #define M_OPL_BSL_CryptoKey_t | ( | ) | M_OPEXTEND(M_POD_OPLIST, INIT(API_2(BSL_CryptoKey_Init)), INIT_SET(0), SET(0), CLEAR(API_2(BSL_CryptoKey_Deinit))) |
M*LIB OPLIST for BSL_CryptoKey_t.
|
static |
|
static |
|
static |
Referenced by MockBPA_KeyStore_Descriptors().
| 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().
|
static |
References BSL_ERR_NOT_FOUND, BSL_SUCCESS, CHK_ARG_NONNULL, keyid, StaticCryptoMutex, and StaticKeyRegistry.
Referenced by MockBPA_KeyStore_Descriptors().
|
static |
References ASSERT_ARG_NONNULL, BSL_Data_InitView(), BSL_SUCCESS, BSL_Data_t::len, BSL_Data_t::ptr, and BSL_CryptoKey_t::raw.
Referenced by MockBPA_KeyStore_Descriptors().
|
static |
References BSL_CryptoKey_t::params.
Referenced by MockBPA_KeyStore_Descriptors().
|
static |
References BSL_SUCCESS, CHK_ARG_NONNULL, BSL_CryptoKey_t::stats, and BSL_CryptoKey_t::stats_mutex.
Referenced by MockBPA_KeyStore_Descriptors().
| 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().
|
static |
References ASSERT_ARG_NONNULL, and BSL_SUCCESS.
Referenced by MockBPA_KeyStore_Descriptors().
|
static |
Referenced by MockBPA_KeyStore_Descriptors().
| 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().
|
static |
References ASSERT_ARG_NONNULL, BSL_Data_CopyFrom(), BSL_Data_t::len, BSL_Data_t::ptr, and BSL_CryptoKey_t::raw.
Referenced by MockBPA_KeyStore_Descriptors().
| 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().
|
static |
|
static |
|
static |
Crypto key registry.
Referenced by MockBPA_KeyStore_AddKey(), MockBPA_KeyStore_Deinit(), MockBPA_KeyStore_FindKey(), MockBPA_KeyStore_Init(), and MockBPA_KeyStore_RemoveKey().