BSL v0.0.0 - 0.geda3e66
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 BSL_SUCCESS.

Referenced by BSLP_QueryPolicy().

◆ 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.

Referenced by 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.

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

Referenced by BSL_SecCtx_ExecutePolicyActionSet().

◆ 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

Referenced by 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)

Initialize a new security action set.

Parameters
[in,out]selfThis pre-allocated action set

Referenced by BSLP_QueryPolicy().

◆ 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  )

Returns size of the struct, helpful for dynamic allocation.

Returns
Size of the struct