|
BSL v1.1.1 - 39.g9f43410
AMMOS Bundle Protocol Security Library (BSL)
|
#include "key_registry.h"#include "bsl/front/TextUtil.h"#include "bsl/dynamic/CBOR.h"#include "bsl/cose_sc/CoseMsg.h"#include <jansson.h>#include <m-string.h>#include <fcntl.h>#include <sys/mman.h>#include <sys/stat.h>#include <unistd.h>
Include dependency graph for key_registry.c:Functions | |
| int | mock_bpa_key_registry_init_jwk (int fd) |
| static int | mock_bpa_key_registry_cosekey_decode (QCBORDecodeContext *dec, const void *obj) |
Decode a COSE_KeySet array. | |
| int | mock_bpa_key_registry_init_cosekey (int infd) |
| int | mock_bpa_key_registry_init (const char *file_path) |
| Initialize keys. | |
| int | mock_bpa_rfc9173_bcb_cek (unsigned char *buf, int len) |
| Custom RNG function for BCB testing. | |
|
static |
Decode a COSE_KeySet array.
Matches BSL_CBOR_Decode_f signature.
References BSL_Crypto_AddRegistryKey(), BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Data_InitView(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_LOG_DEBUG, BSL_LOG_ERR, BSL_LOG_WARNING, BSL_SUCCESS, BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_COSEMSG_KEY_PARAM_BASEIV, BSLX_COSEMSG_KEY_PARAM_KID, BSLX_COSEMSG_KEY_PARAM_KTY, keyhandle, and BSL_Data_t::len.
Referenced by mock_bpa_key_registry_init_cosekey().
| int mock_bpa_key_registry_init | ( | const char * | file_path | ) |
Initialize keys.
| [in] | file_path | path to JSON file with JWKs or CBOR file with COSE_KeySet |
References BSL_ERR_ARG_INVALID, BSL_ERR_DECODING, BSL_LOG_ERR, BSL_LOG_INFO, BSL_SUCCESS, mock_bpa_key_registry_init_cosekey(), and mock_bpa_key_registry_init_jwk().
Referenced by main().
| int mock_bpa_key_registry_init_cosekey | ( | int | infd | ) |
| infd | The file descriptor to read from. |
References BSL_CBOR_Decode(), BSL_Data_InitView(), BSL_ERR_DECODING, BSL_LOG_ERR, and mock_bpa_key_registry_cosekey_decode().
Referenced by LLVMFuzzerTestOneInput(), and mock_bpa_key_registry_init().
| int mock_bpa_key_registry_init_jwk | ( | int | infd | ) |
| infd | The file descriptor to read from. |
References BSL_Crypto_AddRegistryKey(), BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_LOG_DEBUG, BSL_LOG_ERR, BSL_LOG_INFO, BSL_SUCCESS, BSL_TextUtil_Base64_Decode(), keyhandle, BSL_Data_t::len, and BSL_Data_t::ptr.
Referenced by LLVMFuzzerTestOneInput(), and mock_bpa_key_registry_init().
| int mock_bpa_rfc9173_bcb_cek | ( | unsigned char * | buf, |
| int | len | ||
| ) |
Custom RNG function for BCB testing.
Referenced by main().