|
BSL v1.0.0 - 16.g9d98179
AMMOS Bundle Protocol Security Library (BSL)
|
#include <unity.h>#include <BPSecLib_Public.h>#include <CryptoInterface.h>#include <backend/SecurityActionSet.h>#include <backend/SecurityResultSet.h>#include <policy_provider/SamplePolicyProvider.h>#include <security_context/rfc9173.h>#include <mock_bpa/agent.h>#include <mock_bpa/log.h>#include "bsl_test_utils.h"
Include dependency graph for test_DynamicMemCbs.c:Functions | |
| static void * | malloc_test (size_t size) |
| static void * | realloc_test (void *ptr, size_t size) |
| static void * | calloc_test (size_t nmemb, size_t size) |
| static void | free_test (void *ptr) |
| void | suiteSetUp (void) |
| int | suiteTearDown (int failures) |
| void | _setUp (void) |
| void | _tearDown (void) |
| void | test_dyn_mem_cbs_BSL_32 (void) |
Variables | |
| static int | malloc_cnt = 0 |
| static int | realloc_cnt = 0 |
| static int | calloc_cnt = 0 |
| static int | free_cnt = 0 |
| static BSL_SecParam_t | param_aes_variant_128 |
| static BSL_SecParam_t | param_use_wrap_key |
| static BSL_SecParam_t | param_test_bcb_key_correct |
| static BSL_TestContext_t | LocalTestCtx = { 0 } |
| static BSL_SecurityActionSet_t | action_set = { 0 } |
| void _setUp | ( | void | ) |
Register the policy provider with some rules
Register the Security Context
References action_set, BSL_TestContext_t::bsl, BSL_API_InitLib(), BSL_API_RegisterPolicyProvider(), BSL_BLOCK_TYPE_BIB, BSL_BLOCK_TYPE_PAYLOAD, BSL_calloc(), BSL_CryptoInit(), BSL_POLICYACTION_DROP_BLOCK, BSL_POLICYLOCATION_CLOUT, BSL_SAMPLE_PP_ID, BSL_SECBLOCKTYPE_BCB, BSL_SecParam_Init(), BSL_SecParam_InitInt64(), BSL_SecParam_InitTextstr(), BSL_SECPARAM_TYPE_KEY_ID, BSL_SECPARAM_USE_KEY_WRAP, BSL_SECROLE_SOURCE, BSL_TestUtils_GetEidPatternFromText(), BSL_TestUtils_SetupDefaultSecurityContext(), BSLP_Deinit(), BSLP_FinalizePolicy(), BSLP_PolicyPredicate_Init(), BSLP_PolicyRule_CopyParam(), BSLP_PolicyRule_Init(), BSLP_QueryPolicy(), LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, mock_bpa_ctr_init(), param_aes_variant_128, param_test_bcb_key_correct, param_use_wrap_key, BSLP_PolicyProvider_t::pp_id, BSLP_PolicyProvider_t::predicate_count, BSLP_PolicyProvider_t::predicates, RFC9173_BCB_AES_VARIANT_A128GCM, RFC9173_BCB_SECPARAM_AESVARIANT, RFC9173_EXAMPLE_A2_KEY, BSLP_PolicyProvider_t::rule_count, BSLP_PolicyProvider_t::rules, and TEST_ASSERT_EQUAL().
Referenced by test_dyn_mem_cbs_BSL_32().
| void _tearDown | ( | void | ) |
References action_set, BSL_TestContext_t::bsl, BSL_API_DeinitLib(), BSL_CryptoDeinit(), BSL_SecParam_Deinit(), BSL_SecurityActionSet_Deinit(), LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, mock_bpa_ctr_deinit(), param_aes_variant_128, param_test_bcb_key_correct, param_use_wrap_key, and TEST_ASSERT_EQUAL().
Referenced by test_dyn_mem_cbs_BSL_32().
|
static |
References calloc_cnt.
Referenced by suiteSetUp().
|
static |
References free_cnt.
Referenced by suiteSetUp().
|
static |
References malloc_cnt.
Referenced by suiteSetUp().
|
static |
References realloc_cnt.
Referenced by suiteSetUp().
| void suiteSetUp | ( | void | ) |
| int suiteTearDown | ( | int | failures | ) |
References BSL_HostDescriptors_Clear(), and mock_bpa_LogClose().
| void test_dyn_mem_cbs_BSL_32 | ( | void | ) |
References _setUp(), _tearDown(), action_set, BSL_PrimaryBlock_t::block_count, BSL_TestContext_t::bsl, BSL_API_ApplySecurity(), BSL_API_QuerySecurity(), BSL_BundleCtx_GetBlockMetadata(), BSL_BundleCtx_GetBundleMetadata(), BSL_LOG_INFO, BSL_POLICYLOCATION_CLOUT, BSL_PrimaryBlock_deinit(), BSL_SECOP_CONCLUSION_SUCCESS, BSL_SecOper_GetConclusion(), BSL_SecurityAction_CountSecOpers(), BSL_SecurityAction_GetSecOperAtIndex(), BSL_SecurityActionSet_CountActions(), BSL_SecurityActionSet_CountOperations(), BSL_SecurityActionSet_GetActionAtIndex(), BSL_TestUtils_LoadBundleFromCBOR(), BSL_TestUtils_ModifyEIDs(), mock_bpa_ctr_t::bundle_ref, calloc_cnt, RFC9173_TestVectors_AppendixA1::cbor_bundle_bib, free_cnt, LocalTestCtx, malloc_cnt, BSL_TestContext_t::mock_bpa_ctr, realloc_cnt, TEST_ASSERT_EQUAL(), and BSL_CanonicalBlock_t::type_code.
|
static |
Referenced by _setUp(), _tearDown(), BSL_SecCtx_ExecutePolicyActionSet(), BSL_SecCtx_ValidatePolicyActionSet(), BSL_TestUtils_InitMallocBIBActionSet(), test_dyn_mem_cbs_BSL_32(), test_MultiplePolicyProviders(), test_PolicyProvider_Inspect_RFC9173_BIB(), test_PolicyProvider_InspectEmptyRuleset(), and test_PolicyProvider_InspectSingleBIBRuleset().
|
static |
Referenced by calloc_test(), and test_dyn_mem_cbs_BSL_32().
|
static |
Referenced by free_test(), and test_dyn_mem_cbs_BSL_32().
|
static |
Referenced by _setUp(), _tearDown(), and test_dyn_mem_cbs_BSL_32().
|
static |
Referenced by malloc_test(), and test_dyn_mem_cbs_BSL_32().
|
static |
Referenced by _setUp(), and _tearDown().
|
static |
Referenced by _setUp(), and _tearDown().
|
static |
Referenced by _setUp(), and _tearDown().
|
static |
Referenced by realloc_test(), and test_dyn_mem_cbs_BSL_32().