BSL v1.0.0 - 16.g9d98179
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
SecurityActionSet.c File Reference

Implementation of construct holding details of security operations for a bundle. More...

+ 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.
 
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)
 
const BSL_SecurityAction_t * BSL_SecurityActionSet_GetActionAtIndex (const BSL_SecurityActionSet_t *self, size_t index)
 Returns the Security Operation at the given index.
 
size_t BSL_SecurityActionSet_CountErrors (const BSL_SecurityActionSet_t *self)
 Returns count of failures after processing this action set.
 

Detailed Description

Implementation of construct holding details of security operations for a bundle.

Function Documentation

◆ BSL_SecurityActionSet_AppendAction()

int BSL_SecurityActionSet_AppendAction ( BSL_SecurityActionSet_t *  self,
const BSL_SecurityAction_t *  action 
)

Append a security operation to the security action set.

Parameters
[in,out]selfThis security action set.
[in]actionAction to include.
Returns
0 on success, negative on error

References ASSERT_ARG_NONNULL, BSL_SecurityAction_CountSecOpers(), 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(), and test_RFC9173_AppendixA_Example4_Source().

◆ BSL_SecurityActionSet_CountActions()

size_t BSL_SecurityActionSet_CountActions ( const BSL_SecurityActionSet_t *  self)

Count number of security operations present in this policy action set.

Parameters
[in]selfThis action set.
Returns
Number of actions, 0 indicates no policy matched.

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().

◆ BSL_SecurityActionSet_CountErrors()

size_t BSL_SecurityActionSet_CountErrors ( const BSL_SecurityActionSet_t *  self)

Returns count of failures after processing this action set.

Parameters
[in]selfPointer to this security action set.
Returns
Count of errors.

References ASSERT_ARG_NONNULL.

Referenced by BSLP_QueryPolicy().

◆ BSL_SecurityActionSet_CountOperations()

size_t BSL_SecurityActionSet_CountOperations ( const BSL_SecurityActionSet_t *  self)
Returns
the total number of operations within each of the actions of
Parameters
selfaction set

References ASSERT_ARG_NONNULL.

Referenced by test_BSL_32(), TEST_CASE(), and test_dyn_mem_cbs_BSL_32().

◆ BSL_SecurityActionSet_Deinit()

◆ BSL_SecurityActionSet_GetActionAtIndex()

const BSL_SecurityAction_t * BSL_SecurityActionSet_GetActionAtIndex ( const BSL_SecurityActionSet_t *  self,
size_t  index 
)

Returns the Security Operation at the given index.

Parameters
[in]selfThis action set
[in]indexindex
Returns
pointer to action at given index, asserting false if not in bound

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().

◆ BSL_SecurityActionSet_Init()

void BSL_SecurityActionSet_Init ( BSL_SecurityActionSet_t *  self)

◆ BSL_SecurityActionSet_IsConsistent()

bool BSL_SecurityActionSet_IsConsistent ( const BSL_SecurityActionSet_t *  self)

Return true if internal sanity and consistency checks pass.

Parameters
[in]selfThis action set.
Returns
true if action set is consistent

Referenced by BSL_SecCtx_ExecutePolicyActionSet(), and BSLP_QueryPolicy().

◆ BSL_SecurityActionSet_Sizeof()

size_t BSL_SecurityActionSet_Sizeof ( void  )