|
BSL v1.0.0 - 16.g9d98179
AMMOS Bundle Protocol Security Library (BSL)
|
Exercises the Policy Provider front-end interface(*) More...
#include <inttypes.h>#include <unity.h>#include <BPSecLib_Private.h>#include <BPSecLib_Public.h>#include <mock_bpa/MockBPA.h>#include <policy_provider/SamplePolicyProvider.h>#include "bsl_test_utils.h"
Include dependency graph for test_BackendPolicyProvider.c:Functions | |
| void | suiteSetUp (void) |
| int | suiteTearDown (int failures) |
| void | setUp (void) |
| void | tearDown (void) |
| void | test_PolicyProvider_InspectEmptyRuleset (void) |
| Purpose: Query an empty ruleset produces no responses. | |
| void | test_PolicyProvider_InspectSingleBIBRuleset (void) |
| Purpose: Match a wildcard predicate to produce an Action to verify BIB (but no parameters). | |
| void | test_PolicyProvider_Inspect_RFC9173_BIB (void) |
| : Purpose: Match a wildcard rule to verify BIB for all bundles and produce an action with specific parameters. | |
| void | test_MultiplePolicyProviders (void) |
| 2 PPs: First has role to source BIB over primary, second has role to source BIB over payloads Assert actions have correct pp_ids | |
Variables | |
| static BSL_TestContext_t | LocalTestCtx |
Exercises the Policy Provider front-end interface(*)
Notes:
| void setUp | ( | void | ) |
| void suiteSetUp | ( | void | ) |
| int suiteTearDown | ( | int | failures | ) |
References BSL_HostDescriptors_Clear(), and mock_bpa_LogClose().
| void tearDown | ( | void | ) |
| void test_MultiplePolicyProviders | ( | void | ) |
2 PPs: First has role to source BIB over primary, second has role to source BIB over payloads Assert actions have correct pp_ids
References action_set, BSL_TestContext_t::bsl, BSL_API_RegisterPolicyProvider(), BSL_BLOCK_TYPE_PAYLOAD, BSL_BLOCK_TYPE_PRIMARY, BSL_calloc(), BSL_free(), BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYLOCATION_APPIN, BSL_PolicyRegistry_FinalizeActions(), BSL_PolicyRegistry_InspectActions(), BSL_SAMPLE_PP_ID, BSL_SAMPLE_PP_ID_2, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_SOURCE, BSL_SecurityAction_CountSecOpers(), BSL_SecurityAction_GetSecOperAtIndex(), BSL_SecurityActionSet_CountActions(), BSL_SecurityActionSet_Deinit(), BSL_SecurityActionSet_GetActionAtIndex(), BSL_TestUtils_GetEidPatternFromText(), BSL_TestUtils_GetRFC9173_A1Params(), BSL_TestUtils_LoadBundleFromCBOR(), BSL_TestUtils_MallocEmptyPolicyResponse(), BSLP_Deinit(), BSLP_FinalizePolicy(), BSLP_PolicyPredicate_Init(), BSLP_PolicyRule_Init(), BSLP_PolicyRule_MoveParam(), BSLP_QueryPolicy(), mock_bpa_ctr_t::bundle_ref, RFC9173_TestVectors_AppendixA1::cbor_bundle_original, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSLP_PolicyProvider_t::pp_id, BSLP_PolicyProvider_t::predicate_count, BSLP_PolicyProvider_t::predicates, RFC9173_EXAMPLE_A1_KEY, BSLP_PolicyProvider_t::rule_count, BSLP_PolicyProvider_t::rules, RFC9173_A1_Params::scope_flags, RFC9173_A1_Params::sha_variant, TEST_ASSERT_EQUAL(), and RFC9173_A1_Params::test_key_id.
| void test_PolicyProvider_Inspect_RFC9173_BIB | ( | void | ) |
: Purpose: Match a wildcard rule to verify BIB for all bundles and produce an action with specific parameters.
References action_set, BSL_TestContext_t::bsl, BSL_BLOCK_TYPE_PAYLOAD, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYLOCATION_APPIN, BSL_PolicyRegistry_InspectActions(), BSL_SAMPLE_PP_ID, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_CountParams(), BSL_SECROLE_VERIFIER, BSL_SecurityAction_CountSecOpers(), BSL_SecurityAction_GetSecOperAtIndex(), BSL_SecurityActionSet_Deinit(), BSL_SecurityActionSet_GetActionAtIndex(), BSL_TestUtils_GetEidPatternFromText(), BSL_TestUtils_GetRFC9173_A1Params(), BSL_TestUtils_LoadBundleFromCBOR(), BSLP_PolicyPredicate_Init(), BSLP_PolicyRule_Init(), BSLP_PolicyRule_MoveParam(), mock_bpa_ctr_t::bundle_ref, RFC9173_TestVectors_AppendixA1::cbor_bundle_bib, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSLP_PolicyProvider_t::predicate_count, BSLP_PolicyProvider_t::predicates, RFC9173_EXAMPLE_A1_KEY, BSLP_PolicyProvider_t::rule_count, BSLP_PolicyProvider_t::rules, RFC9173_A1_Params::scope_flags, RFC9173_A1_Params::sha_variant, TEST_ASSERT_EQUAL(), and RFC9173_A1_Params::test_key_id.
| void test_PolicyProvider_InspectEmptyRuleset | ( | void | ) |
Purpose: Query an empty ruleset produces no responses.
References action_set, BSL_TestContext_t::bsl, BSL_POLICYLOCATION_APPIN, BSL_PolicyRegistry_InspectActions(), BSL_SAMPLE_PP_ID, BSL_SecurityAction_CountSecOpers(), BSL_SecurityActionSet_CountActions(), BSL_SecurityActionSet_Deinit(), BSL_SecurityActionSet_GetActionAtIndex(), BSL_TestUtils_LoadBundleFromCBOR(), mock_bpa_ctr_t::bundle_ref, RFC9173_TestVectors_AppendixA1::cbor_bundle_bib, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, and TEST_ASSERT_EQUAL().
| void test_PolicyProvider_InspectSingleBIBRuleset | ( | void | ) |
Purpose: Match a wildcard predicate to produce an Action to verify BIB (but no parameters).
Notes:
References action_set, BSL_TestContext_t::bsl, BSL_BLOCK_TYPE_PAYLOAD, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYLOCATION_APPIN, BSL_PolicyRegistry_InspectActions(), BSL_SAMPLE_PP_ID, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_VERIFIER, BSL_SecurityAction_CountSecOpers(), BSL_SecurityActionSet_CountActions(), BSL_SecurityActionSet_Deinit(), BSL_SecurityActionSet_GetActionAtIndex(), BSL_TestUtils_GetEidPatternFromText(), BSL_TestUtils_LoadBundleFromCBOR(), BSLP_PolicyPredicate_Init(), BSLP_PolicyRule_Init(), mock_bpa_ctr_t::bundle_ref, RFC9173_TestVectors_AppendixA1::cbor_bundle_bib, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSLP_PolicyProvider_t::predicate_count, BSLP_PolicyProvider_t::predicates, BSLP_PolicyProvider_t::rule_count, BSLP_PolicyProvider_t::rules, and TEST_ASSERT_EQUAL().
|
static |