|
BSL v1.0.0 - 16.g9d98179
AMMOS Bundle Protocol Security Library (BSL)
|
Implementation of the host BPA and its callback functions. More...
#include <stdarg.h>#include <pthread.h>#include <sys/time.h>#include <BPSecLib_Private.h>#include "UtilDefs_SeqReadWrite.h"
Include dependency graph for HostInterface.c:Functions | |
| int | BSL_HostDescriptors_Set (BSL_HostDescriptors_t desc) |
| Set the BPA descriptor (callbacks) for this process. | |
| int | BSL_BundleCtx_GetBundleMetadata (const BSL_BundleRef_t *bundle, BSL_PrimaryBlock_t *result_primary_block) |
| Calls the host interface to get a bundle primary block information.abort. | |
| int | BSL_BundleCtx_GetBlockMetadata (const BSL_BundleRef_t *bundle, uint64_t block_num, BSL_CanonicalBlock_t *result_block) |
| Returns information about the bundle Canonical block. | |
| int | BSL_BundleCtx_CreateBlock (BSL_BundleRef_t *bundle, uint64_t block_type_code, uint64_t *block_num) |
| Request the creation of a new block of a given type in the bundle. | |
| int | BSL_BundleCtx_RemoveBlock (BSL_BundleRef_t *bundle, uint64_t block_num) |
| Requests the removal of a block from a bundle. | |
| int | BSL_BundleCtx_DeleteBundle (BSL_BundleRef_t *bundle, BSL_ReasonCode_t reason_code) |
| Requests dropping of bundle. | |
| int | BSL_BundleCtx_ReallocBTSD (BSL_BundleRef_t *bundle, uint64_t block_num, size_t bytesize) |
| Requests the re-allocation of a block's BTSD, useful for BCB. | |
| BSL_SeqReader_t * | BSL_BundleCtx_ReadBTSD (const BSL_BundleRef_t *bundle, uint64_t block_num) |
| BSL_SeqWriter_t * | BSL_BundleCtx_WriteBTSD (BSL_BundleRef_t *bundle, uint64_t block_num, size_t btsd_len) |
| void | BSL_HostDescriptors_Get (BSL_HostDescriptors_t *desc) |
| Copy the BPA descriptor for this process. | |
| void | BSL_HostDescriptors_Clear (void) |
| Reset the host descriptors to their default, unusable state. | |
| void | BSL_HostEID_Init (BSL_HostEID_t *eid) |
| Initialize an abstract EID. | |
| void | BSL_HostEID_Deinit (BSL_HostEID_t *eid) |
| De-initialize an abstract EID. | |
| int | BSL_Host_GetSecSrcEID (BSL_HostEID_t *eid) |
| Get the local EID used when this node is a security source. | |
| int | BSL_HostEID_EncodeToCBOR (const BSL_HostEID_t *eid, BSL_Data_t *encoded_bytes) |
| Encode a EID into CBOR. | |
| int | BSL_HostEID_DecodeFromCBOR (const BSL_Data_t *encoded_bytes, BSL_HostEID_t *eid) |
| Decode an EID from CBOR. | |
| int | BSL_HostEID_DecodeFromText (BSL_HostEID_t *eid, const char *text) |
| Decode an EID from its text form. | |
| int | BSL_HostEIDPattern_Init (BSL_HostEIDPattern_t *pat) |
| Initialize an abstract EID Pattern. | |
| void | BSL_HostEIDPattern_Deinit (BSL_HostEIDPattern_t *pat) |
| De-initialize an abstract EID Pattern. | |
| int | BSL_HostEIDPattern_DecodeFromText (BSL_HostEIDPattern_t *pat, const char *text) |
| Decode an EID Pattern from its text form. | |
| bool | BSL_HostEIDPattern_IsMatch (const BSL_HostEIDPattern_t *pat, const BSL_HostEID_t *eid) |
| Determine if an EID Pattern matches a specific EID. | |
| bool | BSL_LogIsEnabledFor (int severity) |
| Determine if a particular severity is being logged. | |
| void | BSL_LogEvent (int severity, const char *filename, int lineno, const char *funcname, const char *format,...) |
| Log an event. | |
| void * | BSL_malloc (size_t size) |
| Dynamic memory allocation. | |
| void * | BSL_realloc (void *ptr, size_t size) |
| Dynamic memory reallocation. | |
| void * | BSL_calloc (size_t nmemb, size_t size) |
| Contiguous dynamic memory allocation. | |
| void | BSL_free (void *ptr) |
| Free dynamically allocated memory. | |
Variables | |
| static BSL_HostDescriptors_t | HostDescriptorTable = { .dyn_mem_desc = BSL_DynMemHostDescriptors_DEFAULT } |
| Initialized to library default. | |
| static const char * | log_sev_names [] |
Implementation of the host BPA and its callback functions.
| int BSL_BundleCtx_CreateBlock | ( | BSL_BundleRef_t * | bundle, |
| uint64_t | block_type_code, | ||
| uint64_t * | block_num | ||
| ) |
Request the creation of a new block of a given type in the bundle.
| [in] | bundle | Context bundle |
| [in] | block_type_code | The type of block to be created (e.g, 1 means payload) |
| [out] | block_num | Pointer to integer containing the number of the block just created.abort |
References BSL_HostDescriptors_t::block_create_fn, BSL_ERR_HOST_CALLBACK_FAILED, BSL_SUCCESS, CHK_ARG_EXPR, CHK_ARG_NONNULL, CHK_PRECONDITION, and HostDescriptorTable.
Referenced by BSL_ExecBCBSource(), and BSL_ExecBIBSource().
| int BSL_BundleCtx_DeleteBundle | ( | BSL_BundleRef_t * | bundle, |
| BSL_ReasonCode_t | reason_code | ||
| ) |
Requests dropping of bundle.
| [in] | bundle | Context bundle |
| [in] | reason_code | reason code indicating reason for bundle deletion |
References BSL_ERR_HOST_CALLBACK_FAILED, BSL_SUCCESS, BSL_HostDescriptors_t::bundle_delete_fn, CHK_ARG_NONNULL, CHK_PRECONDITION, and HostDescriptorTable.
Referenced by BSLP_PolicyProvider_HandleFailures().
| int BSL_BundleCtx_GetBlockMetadata | ( | const BSL_BundleRef_t * | bundle, |
| uint64_t | block_num, | ||
| BSL_CanonicalBlock_t * | result_block | ||
| ) |
Returns information about the bundle Canonical block.
| [in] | bundle | Context bundle |
| [in] | block_num | The number of the bundle canonical block we seek information on |
| [out] | result_block | Pointer to allocated memory which contains the results of the query. |
References BSL_HostDescriptors_t::block_metadata_fn, BSL_ERR_HOST_CALLBACK_FAILED, BSL_SUCCESS, CHK_ARG_EXPR, CHK_ARG_NONNULL, CHK_PRECONDITION, and HostDescriptorTable.
Referenced by BSL_API_QuerySecurity(), BSL_ExecBCBAcceptor(), BSL_ExecBCBSource(), BSL_ExecBIBAccept(), BSL_ExecBIBSource(), BSLX_BCB_Execute(), BSLX_BCB_GetParams(), BSLX_BCB_Init(), BSLX_BIB_Execute(), get_target_block_id(), n_test_BSL_6(), test_BSL_32(), TEST_CASE(), test_dyn_mem_cbs_BSL_32(), and test_RFC9173_AppendixA_Example4_Acceptor().
| int BSL_BundleCtx_GetBundleMetadata | ( | const BSL_BundleRef_t * | bundle, |
| BSL_PrimaryBlock_t * | result_primary_block | ||
| ) |
Calls the host interface to get a bundle primary block information.abort.
| [in] | bundle | Bundle context |
| [out] | result_primary_block | Non-null pointer to result which gets populated on a zero return code. |
References BSL_ERR_HOST_CALLBACK_FAILED, BSL_SUCCESS, BSL_HostDescriptors_t::bundle_metadata_fn, CHK_ARG_NONNULL, CHK_PRECONDITION, and HostDescriptorTable.
Referenced by BSL_API_QuerySecurity(), BSL_TestUtils_ModifyEIDs(), BSLP_PolicyRule_EvaluateAsSecOper(), BSLP_QueryPolicy(), BSLX_BCB_Init(), BSLX_BIB_Execute(), get_target_block_id(), n_test_BSL_6(), test_BSL_32(), TEST_CASE(), test_dyn_mem_cbs_BSL_32(), test_RFC9173_AppendixA_Example3_Acceptor(), test_RFC9173_AppendixA_Example3_Source(), test_RFC9173_AppendixA_Example4_Acceptor(), and test_RFC9173_AppendixA_Example4_Source().
| BSL_SeqReader_t * BSL_BundleCtx_ReadBTSD | ( | const BSL_BundleRef_t * | bundle, |
| uint64_t | block_num | ||
| ) |
References BSL_HostDescriptors_t::block_read_btsd_fn, and HostDescriptorTable.
Referenced by BSL_API_QuerySecurity(), BSL_ExecBCBAcceptor(), BSL_ExecBIBAccept(), BSLX_BCB_Decrypt(), BSLX_BCB_Encrypt(), and BSLX_BIB_GenIPPT().
| int BSL_BundleCtx_ReallocBTSD | ( | BSL_BundleRef_t * | bundle, |
| uint64_t | block_num, | ||
| size_t | bytesize | ||
| ) |
Requests the re-allocation of a block's BTSD, useful for BCB.
memcpy().| [in] | bundle | Context bundle |
| [in] | block_num | Number of block requesting re-allocated of BTSD |
| [in] | bytesize | Size of new BTSD |
References BSL_HostDescriptors_t::block_realloc_btsd_fn, BSL_HostDescriptors_t::block_remove_fn, BSL_ERR_HOST_CALLBACK_FAILED, BSL_SUCCESS, CHK_ARG_EXPR, CHK_ARG_NONNULL, CHK_PRECONDITION, and HostDescriptorTable.
| int BSL_BundleCtx_RemoveBlock | ( | BSL_BundleRef_t * | bundle, |
| uint64_t | block_num | ||
| ) |
Requests the removal of a block from a bundle.
| [in] | bundle | Context bundle |
| [in] | block_num | Block number to be removed |
References BSL_HostDescriptors_t::block_remove_fn, BSL_ERR_HOST_CALLBACK_FAILED, BSL_SUCCESS, CHK_ARG_EXPR, CHK_ARG_NONNULL, CHK_PRECONDITION, and HostDescriptorTable.
Referenced by BSL_ExecBCBAcceptor(), BSL_ExecBIBAccept(), and BSLP_PolicyProvider_HandleFailures().
| BSL_SeqWriter_t * BSL_BundleCtx_WriteBTSD | ( | BSL_BundleRef_t * | bundle, |
| uint64_t | block_num, | ||
| size_t | btsd_len | ||
| ) |
References BSL_HostDescriptors_t::block_write_btsd_fn, and HostDescriptorTable.
Referenced by BSLX_BCB_Decrypt(), BSLX_BCB_Encrypt(), and Encode_ASB().
| void * BSL_calloc | ( | size_t | nmemb, |
| size_t | size | ||
| ) |
Contiguous dynamic memory allocation.
| nmemb | number of members to allocate |
| size | size of each member |
References BSL_DynMemHostDescriptors_t::calloc_cb, BSL_HostDescriptors_t::dyn_mem_desc, and HostDescriptorTable.
Referenced by _setUp(), BSL_API_QuerySecurity(), BSL_SecCtx_ExecutePolicyActionSet(), BSL_TestUtils_FlatReader(), BSL_TestUtils_FlatWriter(), BSL_TestUtils_InitMallocBIBActionSet(), BSL_TestUtils_MallocEmptyPolicyResponse(), BSLP_QueryPolicy(), BSLX_BCB_Execute(), BSLX_BIB_Execute(), mock_bpa_ctr_init(), mock_bpa_policy_params_init(), MockBPA_Agent_Init(), MockBPA_Agent_process(), MockBPA_GetBundleMetadata(), MockBPA_ReadBTSD(), MockBPA_ReallocBTSD(), MockBPA_WriteBTSD(), setUp(), test_bsl_mock_encode_bundle(), TEST_CASE(), test_MultiplePolicyProviders(), test_RFC9173_AppendixA_Example1_BIB_Source(), test_RFC9173_AppendixA_Example2_BCB_Acceptor(), test_RFC9173_AppendixA_Example2_BCB_Source(), test_RFC9173_AppendixA_Example3_Acceptor(), test_RFC9173_AppendixA_Example3_Source(), test_RFC9173_AppendixA_Example4_Acceptor(), test_RFC9173_AppendixA_Example4_Source(), test_sec_accept_keyunwrap(), test_sec_source_keywrap(), and TestASBDecodeEncodeClosure().
| void BSL_free | ( | void * | ptr | ) |
Free dynamically allocated memory.
| ptr | pointer to memory to free |
References BSL_HostDescriptors_t::dyn_mem_desc, BSL_DynMemHostDescriptors_t::free_cb, and HostDescriptorTable.
Referenced by BSL_API_QuerySecurity(), BSL_Crypto_ClearGeneratedKeyHandle(), BSL_Crypto_UnwrapKey(), bsl_data_int_free(), bsl_mock_decode_canonical(), BSL_PrimaryBlock_deinit(), BSL_SecCtx_ExecutePolicyActionSet(), BSL_SeqReader_Destroy(), BSL_SeqWriter_Destroy(), BSL_TestUtils_InitMallocBIBActionSet(), BSL_TestUtils_ReadBTSD_Deinit(), BSL_TestUtils_WriteBTSD_Deinit(), BSLP_Deinit(), BSLP_PolicyRule_Deinit(), BSLP_QueryPolicy(), BSLX_BCB_Execute(), BSLX_BIB_Execute(), LLVMFuzzerTestOneInput(), mock_bpa_ctr_deinit(), mock_bpa_eidpat_deinit(), mock_bpa_policy_params_deinit(), MockBPA_Agent_Deinit(), MockBPA_Agent_process(), MockBPA_Bundle_Deinit(), MockBPA_EID_Deinit(), MockBPA_ReadBTSD(), MockBPA_ReadBTSD_Deinit(), MockBPA_RemoveBlock(), MockBPA_WriteBTSD(), MockBPA_WriteBTSD_Deinit(), tearDown(), test_bsl_mock_encode_canonical(), TEST_CASE(), test_decrypt(), test_encrypt(), test_MultiplePolicyProviders(), test_RFC9173_AppendixA_Example1_BIB_Source(), test_RFC9173_AppendixA_Example2_BCB_Acceptor(), test_RFC9173_AppendixA_Example2_BCB_Source(), test_RFC9173_AppendixA_Example3_Acceptor(), test_RFC9173_AppendixA_Example3_Source(), test_RFC9173_AppendixA_Example4_Acceptor(), test_RFC9173_AppendixA_Example4_Source(), test_sec_accept_keyunwrap(), test_sec_source_keywrap(), test_SecurityContext_BIB_Acceptor(), test_SecurityContext_BIB_Source(), test_SecurityContext_BIB_Verifier(), test_SecurityContext_BIB_Verifier_Failure(), test_SeqWriter_flat(), and TestASBDecodeEncodeClosure().
| int BSL_Host_GetSecSrcEID | ( | BSL_HostEID_t * | eid | ) |
Get the local EID used when this node is a security source.
| [out] | eid | The EID to write into. This must already be initialized. |
References CHK_ARG_NONNULL, CHK_PRECONDITION, BSL_HostDescriptors_t::get_sec_src_eid_fn, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by BSL_ExecBCBSource(), and BSL_ExecBIBSource().
| void BSL_HostDescriptors_Clear | ( | void | ) |
Reset the host descriptors to their default, unusable state.
References HostDescriptorTable.
Referenced by main(), and suiteTearDown().
| void BSL_HostDescriptors_Get | ( | BSL_HostDescriptors_t * | desc | ) |
Copy the BPA descriptor for this process.
| [out] | desc | The descriptor to copy into. |
References ASSERT_ARG_NONNULL, and HostDescriptorTable.
| int BSL_HostDescriptors_Set | ( | BSL_HostDescriptors_t | desc | ) |
Set the BPA descriptor (callbacks) for this process.
| desc | The descriptor to use for future BPA functions. |
References BSL_HostDescriptors_t::block_create_fn, BSL_HostDescriptors_t::block_metadata_fn, BSL_HostDescriptors_t::block_realloc_btsd_fn, BSL_HostDescriptors_t::block_remove_fn, BSL_DynMemHostDescriptors_DEFAULT, BSL_ERR_ARG_NULL, BSL_SUCCESS, BSL_HostDescriptors_t::bundle_metadata_fn, BSL_DynMemHostDescriptors_t::calloc_cb, CHK_PRECONDITION, BSL_HostDescriptors_t::dyn_mem_desc, BSL_HostDescriptors_t::eid_deinit, BSL_HostDescriptors_t::eid_from_cbor, BSL_HostDescriptors_t::eid_from_text, BSL_HostDescriptors_t::eid_init, BSL_HostDescriptors_t::eidpat_deinit, BSL_HostDescriptors_t::eidpat_from_text, BSL_HostDescriptors_t::eidpat_init, BSL_HostDescriptors_t::eidpat_match, BSL_DynMemHostDescriptors_t::free_cb, BSL_HostDescriptors_t::get_sec_src_eid_fn, HostDescriptorTable, BSL_DynMemHostDescriptors_t::malloc_cb, and BSL_DynMemHostDescriptors_t::realloc_cb.
Referenced by LLVMFuzzerInitialize(), main(), and suiteSetUp().
| int BSL_HostEID_DecodeFromCBOR | ( | const BSL_Data_t * | encoded_bytes, |
| BSL_HostEID_t * | eid | ||
| ) |
Decode an EID from CBOR.
| [in] | encoded_bytes | CBOR encoded bytes |
| [in,out] | eid | The value to decode into |
References CHK_ARG_NONNULL, CHK_PRECONDITION, BSL_HostDescriptors_t::eid_from_cbor, BSL_HostEID_t::handle, and HostDescriptorTable.
Referenced by BSL_AbsSecBlock_DecodeFromCBOR(), and LLVMFuzzerTestOneInput().
| int BSL_HostEID_DecodeFromText | ( | BSL_HostEID_t * | eid, |
| const char * | text | ||
| ) |
Decode an EID from its text form.
| [out] | eid | The EID to write into. This must already be initialized. |
| [in] | text | The text to read from, which must be non-null. |
References CHK_ARG_NONNULL, CHK_PRECONDITION, BSL_HostDescriptors_t::eid_from_text, BSL_HostEID_t::handle, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by LLVMFuzzerTestOneInput(), main(), test_BSL_HostEID_DecodeFromText_invalid(), test_BSL_HostEID_DecodeFromText_ipn(), test_BSL_HostEID_DecodeFromText_valid(), test_BSL_HostEIDPattern_IsMatch(), test_bsl_mock_encode_bundle(), and TEST_CASE().
| void BSL_HostEID_Deinit | ( | BSL_HostEID_t * | eid | ) |
De-initialize an abstract EID.
| [in,out] | eid | The object to de-initialize. |
References ASSERT_ARG_NONNULL, ASSERT_PRECONDITION, BSL_HostDescriptors_t::eid_deinit, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by BSL_AbsSecBlock_Deinit(), LLVMFuzzerTestOneInput(), main(), MockBPA_Bundle_Deinit(), test_BSL_HostEID_DecodeFromText_invalid(), test_BSL_HostEID_DecodeFromText_ipn(), test_BSL_HostEID_DecodeFromText_valid(), test_BSL_HostEIDPattern_IsMatch(), test_bsl_loopback_eid(), and TEST_CASE().
| int BSL_HostEID_EncodeToCBOR | ( | const BSL_HostEID_t * | eid, |
| BSL_Data_t * | encoded_bytes | ||
| ) |
Encode a EID into CBOR.
| [in] | eid | The value to encode |
| [in,out] | encoded_bytes | CBOR encoded bytes |
References CHK_ARG_NONNULL, BSL_HostDescriptors_t::eid_to_cbor, and HostDescriptorTable.
Referenced by BSL_AbsSecBlock_EncodeToCBOR(), bsl_mock_encode_eid_from_ctx(), and LLVMFuzzerTestOneInput().
| void BSL_HostEID_Init | ( | BSL_HostEID_t * | eid | ) |
Initialize an abstract EID.
| [out] | eid | The object to initialize. |
References ASSERT_ARG_NONNULL, ASSERT_PRECONDITION, BSL_HostDescriptors_t::eid_init, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by BSL_AbsSecBlock_DecodeFromCBOR(), BSL_ExecBCBSource(), BSL_ExecBIBSource(), LLVMFuzzerTestOneInput(), main(), test_BSL_HostEID_DecodeFromText_invalid(), test_BSL_HostEID_DecodeFromText_ipn(), test_BSL_HostEID_DecodeFromText_valid(), test_BSL_HostEIDPattern_IsMatch(), test_bsl_loopback_eid(), test_bsl_mock_encode_bundle(), and TEST_CASE().
| int BSL_HostEIDPattern_DecodeFromText | ( | BSL_HostEIDPattern_t * | pat, |
| const char * | text | ||
| ) |
Decode an EID Pattern from its text form.
| [out] | pat | The pattern to write into. This must already be initialized. |
| [in] | text | The text to read from, which must be non-null. |
References CHK_ARG_NONNULL, CHK_PRECONDITION, BSL_HostDescriptors_t::eidpat_from_text, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by BSL_TestUtils_GetEidPatternFromText(), LLVMFuzzerTestOneInput(), mock_bpa_util_get_eid_pattern_from_text(), test_BSL_HostEIDPattern_DecodeFromText_invalid(), test_BSL_HostEIDPattern_DecodeFromText_valid(), test_BSL_HostEIDPattern_IsMatch(), and TEST_CASE().
| void BSL_HostEIDPattern_Deinit | ( | BSL_HostEIDPattern_t * | pat | ) |
De-initialize an abstract EID Pattern.
| [in,out] | pat | The object to de-initialize. |
References ASSERT_ARG_NONNULL, BSL_HostDescriptors_t::eidpat_deinit, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by BSLP_PolicyPredicate_Deinit(), LLVMFuzzerTestOneInput(), test_BSL_HostEIDPattern_DecodeFromText_invalid(), test_BSL_HostEIDPattern_DecodeFromText_valid(), test_BSL_HostEIDPattern_IsMatch(), and TEST_CASE().
| int BSL_HostEIDPattern_Init | ( | BSL_HostEIDPattern_t * | pat | ) |
Initialize an abstract EID Pattern.
| [out] | pat | The object to initialize. |
References CHK_ARG_NONNULL, CHK_PRECONDITION, BSL_HostDescriptors_t::eidpat_init, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by BSL_TestUtils_GetEidPatternFromText(), LLVMFuzzerTestOneInput(), mock_bpa_util_get_eid_pattern_from_text(), test_BSL_HostEIDPattern_DecodeFromText_invalid(), test_BSL_HostEIDPattern_DecodeFromText_valid(), test_BSL_HostEIDPattern_IsMatch(), and TEST_CASE().
| bool BSL_HostEIDPattern_IsMatch | ( | const BSL_HostEIDPattern_t * | pat, |
| const BSL_HostEID_t * | eid | ||
| ) |
Determine if an EID Pattern matches a specific EID.
| [in] | pat | The pattern to compare. |
| [in] | eid | The EID to compare. |
References ASSERT_ARG_NONNULL, ASSERT_PRECONDITION, BSL_HostDescriptors_t::eidpat_match, HostDescriptorTable, and BSL_HostDescriptors_t::user_data.
Referenced by BSLP_PolicyPredicate_IsMatch(), and test_BSL_HostEIDPattern_IsMatch().
| void BSL_LogEvent | ( | int | severity, |
| const char * | filename, | ||
| int | lineno, | ||
| const char * | funcname, | ||
| const char * | format, | ||
| ... | |||
| ) |
Log an event.
| severity | The severity from a subset of the POSIX syslog values. | |
| [in] | filename | The originating file name, which may include directory parts. |
| [in] | lineno | The originating file line number. |
| [in] | funcname | The originating function name. |
| [in] | format | The log message format string. |
| ... | Values for the format string. |
References BSL_LogIsEnabledFor(), HostDescriptorTable, BSL_HostDescriptors_t::log_event, and log_sev_names.
| bool BSL_LogIsEnabledFor | ( | int | severity | ) |
Determine if a particular severity is being logged.
This function is multi-thread safe.
| severity | The severity from a subset of the POSIX syslog values. |
References HostDescriptorTable, and BSL_HostDescriptors_t::log_is_enabled_for.
Referenced by BSL_LogEvent().
| void * BSL_malloc | ( | size_t | size | ) |
Dynamic memory allocation.
| size | size of allocation |
References BSL_HostDescriptors_t::dyn_mem_desc, HostDescriptorTable, and BSL_DynMemHostDescriptors_t::malloc_cb.
Referenced by BSL_Crypto_GenKey(), BSL_Crypto_UnwrapKey(), BSL_Crypto_WrapKey(), BSL_Data_InitBuffer(), bsl_mock_decode_canonical(), BSL_TestUtils_FlatReader(), BSL_TestUtils_FlatWriter(), BSLP_PolicyRule_Init(), LLVMFuzzerTestOneInput(), mock_bpa_eidpat_init(), MockBPA_EID_Init(), setUp(), and test_bsl_mock_encode_canonical().
| void * BSL_realloc | ( | void * | ptr, |
| size_t | size | ||
| ) |
Dynamic memory reallocation.
| ptr | existing dynamic memory pointer |
| size | new allocation size |
References BSL_HostDescriptors_t::dyn_mem_desc, HostDescriptorTable, and BSL_DynMemHostDescriptors_t::realloc_cb.
Referenced by BSL_Data_Resize(), and MockBPA_ReallocBTSD().
|
static |
Initialized to library default.
Referenced by BSL_BundleCtx_CreateBlock(), BSL_BundleCtx_DeleteBundle(), BSL_BundleCtx_GetBlockMetadata(), BSL_BundleCtx_GetBundleMetadata(), BSL_BundleCtx_ReadBTSD(), BSL_BundleCtx_ReallocBTSD(), BSL_BundleCtx_RemoveBlock(), BSL_BundleCtx_WriteBTSD(), BSL_calloc(), BSL_free(), BSL_Host_GetSecSrcEID(), BSL_HostDescriptors_Clear(), BSL_HostDescriptors_Get(), BSL_HostDescriptors_Set(), BSL_HostEID_DecodeFromCBOR(), BSL_HostEID_DecodeFromText(), BSL_HostEID_Deinit(), BSL_HostEID_EncodeToCBOR(), BSL_HostEID_Init(), BSL_HostEIDPattern_DecodeFromText(), BSL_HostEIDPattern_Deinit(), BSL_HostEIDPattern_Init(), BSL_HostEIDPattern_IsMatch(), BSL_LogEvent(), BSL_LogIsEnabledFor(), BSL_malloc(), and BSL_realloc().
|
static |
Referenced by BSL_LogEvent().