|
BSL v1.1.1 - 88.g2613f3a
AMMOS Bundle Protocol Security Library (BSL)
|
Implementation of construct holding details of security operations for a bundle. More...
#include "SecurityActionSet.h"
Include dependency graph for SecurityActionSet.c:Functions | |
| bool | BSL_SecurityActionSet_IsConsistent (const BSL_SecurityActionSet_t *self) |
| Return true if internal sanity and consistency checks pass. | |
| size_t | BSL_SecurityActionSet_Sizeof (void) |
| Returns size of the struct, helpful for dynamic allocation. | |
| void | BSL_SecurityActionSet_Init (BSL_SecurityActionSet_t *self) |
| Initialize a new security action set. | |
| void | BSL_SecurityActionSet_Deinit (BSL_SecurityActionSet_t *self) |
| Zeroize, clear, and release itself and any owned resources. | |
| void | BSL_SecurityActionSet_SetImmediate (BSL_SecurityActionSet_t *self, BSL_PolicyAction_e immediate, BSL_ReasonCode_t reason) |
| Set a specific immediate action to take after querying the policy. | |
| int | BSL_SecurityActionSet_AppendAction (BSL_SecurityActionSet_t *self, const BSL_SecurityAction_t *action) |
| Append a security operation to the security action set. | |
| size_t | BSL_SecurityActionSet_CountActions (const BSL_SecurityActionSet_t *self) |
| Count number of security operations present in this policy action set. | |
| size_t | BSL_SecurityActionSet_CountOperations (const BSL_SecurityActionSet_t *self) |
| size_t | BSL_SecurityActionSet_CountInvalidActions (const BSL_SecurityActionSet_t *self) |
| const BSL_SecurityAction_t * | BSL_SecurityActionSet_GetActionAtIndex (const BSL_SecurityActionSet_t *self, size_t index) |
| Returns the Security Operation at the given index. | |
Implementation of construct holding details of security operations for a bundle.
| int BSL_SecurityActionSet_AppendAction | ( | BSL_SecurityActionSet_t * | self, |
| const BSL_SecurityAction_t * | action | ||
| ) |
Append a security operation to the security action set.
| [in,out] | self | This security action set. |
| [in] | action | Action to include. |
References ASSERT_ARG_NONNULL, and BSL_SUCCESS.
Referenced by BSL_TestUtils_InitMallocBIBActionSet(), BSLP_QueryPolicy(), test_RFC9173_AppendixA_Example3_Acceptor(), test_RFC9173_AppendixA_Example3_Source(), test_RFC9173_AppendixA_Example4_Acceptor(), test_RFC9173_AppendixA_Example4_Source(), and test_SecurityContext_ValidatePolicyActionSet_UsesRegisteredValidator().
| size_t BSL_SecurityActionSet_CountActions | ( | const BSL_SecurityActionSet_t * | self | ) |
Count number of security operations present in this policy action set.
| [in] | self | This action set. |
References ASSERT_ARG_NONNULL.
Referenced by BSL_PolicyRegistry_FinalizeActions(), BSL_PolicyRegistry_InspectActions(), BSLP_FinalizePolicy(), test_BSL_32(), TEST_CASE(), test_dyn_mem_cbs_BSL_32(), test_MultiplePolicyProviders(), test_PolicyProvider_InspectEmptyRuleset(), and test_PolicyProvider_InspectSingleBIBRuleset().
| size_t BSL_SecurityActionSet_CountInvalidActions | ( | const BSL_SecurityActionSet_t * | self | ) |
| self | action set |
References ASSERT_ARG_NONNULL, and BSL_ACTION_VALIDATION_FAILURE.
Referenced by test_SecurityContext_ValidatePolicyActionSet_UsesRegisteredValidator().
| size_t BSL_SecurityActionSet_CountOperations | ( | const BSL_SecurityActionSet_t * | self | ) |
| self | action set |
References ASSERT_ARG_NONNULL, and BSL_SecurityAction_CountSecOpers().
Referenced by BSL_TestUutils_QueryEmptyPolicy(), test_BSL_32(), TEST_CASE(), and test_dyn_mem_cbs_BSL_32().
| void BSL_SecurityActionSet_Deinit | ( | BSL_SecurityActionSet_t * | self | ) |
Zeroize, clear, and release itself and any owned resources.
| [in,out] | self | This action set. |
References ASSERT_ARG_NONNULL.
Referenced by _tearDown(), BSL_TestUutils_QueryEmptyPolicy(), MockBPA_Agent_process(), tearDown(), test_MultiplePolicyProviders(), test_PolicyProvider_Inspect_RFC9173_BIB(), test_PolicyProvider_InspectEmptyRuleset(), test_PolicyProvider_InspectSingleBIBRuleset(), test_RFC9173_AppendixA_Example3_Acceptor(), test_RFC9173_AppendixA_Example3_Source(), test_RFC9173_AppendixA_Example4_Acceptor(), test_RFC9173_AppendixA_Example4_Source(), test_SecurityContext_BIB_Acceptor(), test_SecurityContext_BIB_Source(), test_SecurityContext_BIB_Verifier(), test_SecurityContext_BIB_Verifier_Failure(), and test_SecurityContext_ValidatePolicyActionSet_UsesRegisteredValidator().
| const BSL_SecurityAction_t * BSL_SecurityActionSet_GetActionAtIndex | ( | const BSL_SecurityActionSet_t * | self, |
| size_t | index | ||
| ) |
Returns the Security Operation at the given index.
| [in] | self | This action set |
| [in] | index | index |
References ASSERT_ARG_NONNULL.
Referenced by BSLP_FinalizePolicy(), n_test_BSL_6(), test_BSL_32(), TEST_CASE(), test_dyn_mem_cbs_BSL_32(), test_MultiplePolicyProviders(), test_PolicyProvider_Inspect_RFC9173_BIB(), test_PolicyProvider_InspectEmptyRuleset(), test_PolicyProvider_InspectSingleBIBRuleset(), and test_SecurityContext_BIB_Verifier_Failure().
| void BSL_SecurityActionSet_Init | ( | BSL_SecurityActionSet_t * | self | ) |
Initialize a new security action set.
| [in,out] | self | This pre-allocated action set |
References ASSERT_ARG_NONNULL, BSL_POLICYACTION_NOTHING, and BSL_REASONCODE_NO_ADDITIONAL_INFO.
Referenced by _setUp(), BSL_TestUtils_InitMallocBIBActionSet(), BSL_TestUutils_QueryEmptyPolicy(), MockBPA_Agent_process(), setUp(), test_MultiplePolicyProviders(), test_PolicyProvider_Inspect_RFC9173_BIB(), test_PolicyProvider_InspectEmptyRuleset(), test_PolicyProvider_InspectSingleBIBRuleset(), test_RFC9173_AppendixA_Example3_Acceptor(), test_RFC9173_AppendixA_Example3_Source(), test_RFC9173_AppendixA_Example4_Acceptor(), test_RFC9173_AppendixA_Example4_Source(), and test_SecurityContext_ValidatePolicyActionSet_UsesRegisteredValidator().
| bool BSL_SecurityActionSet_IsConsistent | ( | const BSL_SecurityActionSet_t * | self | ) |
Return true if internal sanity and consistency checks pass.
| [in] | self | This action set. |
Referenced by BSL_SecCtx_ExecutePolicyActionSet(), and BSLP_QueryPolicy().
| void BSL_SecurityActionSet_SetImmediate | ( | BSL_SecurityActionSet_t * | self, |
| BSL_PolicyAction_e | immediate, | ||
| BSL_ReasonCode_t | reason | ||
| ) |
Set a specific immediate action to take after querying the policy.
This allows a policy provider to determine that a bundle is invalid and delete it without attempting any security operations.
| [in] | self | The action set to modify. |
| immediate | The immediate action to take. This must be one of BSL_POLICYACTION_NOTHING (the default) or BSL_POLICYACTION_DROP_BUNDLE. | |
| reason | When the action is to delete a bundle, provide a deletion reason. |
References ASSERT_ARG_NONNULL, BSL_LOG_ERR, BSL_POLICYACTION_DROP_BLOCK, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYACTION_NOTHING, and BSL_POLICYACTION_UNDEFINED.
Referenced by BSLP_QueryPolicy().
| size_t BSL_SecurityActionSet_Sizeof | ( | void | ) |
Returns size of the struct, helpful for dynamic allocation.
Referenced by BSL_TestUutils_QueryEmptyPolicy(), MockBPA_Agent_process(), test_RFC9173_AppendixA_Example3_Acceptor(), test_RFC9173_AppendixA_Example3_Source(), test_RFC9173_AppendixA_Example4_Acceptor(), and test_RFC9173_AppendixA_Example4_Source().