BSL v0.0.0 - 0.geda3e66
AMMOS Bundle Protocol Security Library (BSL)
|
Defines a security operation. More...
Functions | |
size_t | BSL_SecOper_Sizeof (void) |
void | BSL_SecOper_Init (BSL_SecOper_t *self) |
Initialize a newly allocated structure. | |
void | BSL_SecOper_InitSet (BSL_SecOper_t *self, const BSL_SecOper_t *src) |
Initialize from a copy. | |
void | BSL_SecOper_Deinit (BSL_SecOper_t *self) |
Empty and release any resources used internally by this structure. | |
void | BSL_SecOper_Set (BSL_SecOper_t *self, const BSL_SecOper_t *src) |
Set from a copy. | |
void | BSL_SecOper_Populate (BSL_SecOper_t *self, uint64_t context_id, uint64_t target_block_num, uint64_t sec_block_num, BSL_SecBlockType_e sec_type, BSL_SecRole_e sec_role, BSL_PolicyAction_e failure_code) |
Populate an initialized Security Operation with the given values. | |
size_t | BSL_SecOper_CountParams (const BSL_SecOper_t *self) |
Get the count of parameters contained within this security operation. | |
bool | BSL_SecOper_IsConsistent (const BSL_SecOper_t *self) |
Returns true if internal consistency and sanity checks pass. | |
void | BSL_SecOper_AppendParam (BSL_SecOper_t *self, const BSL_SecParam_t *param) |
Add the given security parameter to this list of parameters. | |
uint64_t | BSL_SecOper_GetSecurityBlockNum (const BSL_SecOper_t *self) |
Get the block number of the security block containing this sec operation. | |
uint64_t | BSL_SecOper_GetTargetBlockNum (const BSL_SecOper_t *self) |
Get the block number of the target block covered by this security operation. | |
const BSL_SecParam_t * | BSL_SecOper_GetParamAt (const BSL_SecOper_t *self, size_t index) |
Returns a pointer to the Security Parameter at a given index in the list of all parameters. | |
bool | BSL_SecOper_IsRoleSource (const BSL_SecOper_t *self) |
Return true if this security operation's role is SOURCE. | |
bool | BSL_SecOper_IsRoleAcceptor (const BSL_SecOper_t *self) |
Return true if this security operation's role is Acceptor. | |
bool | BSL_SecOper_IsRoleVerifier (const BSL_SecOper_t *self) |
Return true if this security operation's role is Verifier. | |
bool | BSL_SecOper_IsBIB (const BSL_SecOper_t *self) |
Return true if this security operation is BIB. | |
BSL_SecOper_ConclusionState_e | BSL_SecOper_GetConclusion (const BSL_SecOper_t *self) |
Retrieve the conclusion state of a security operation. | |
void | BSL_SecOper_SetConclusion (BSL_SecOper_t *self, BSL_SecOper_ConclusionState_e new_conclusion) |
Set the security operation conclusion state. | |
Defines a security operation.
void BSL_SecOper_AppendParam | ( | BSL_SecOper_t * | self, |
const BSL_SecParam_t * | param | ||
) |
Add the given security parameter to this list of parameters.
[in,out] | self | This security operation |
[in] | param | Security parameter to include. |
References BSL_SecOper_IsConsistent(), and BSL_SecParam_IsConsistent().
Referenced by BSLP_PolicyRule_EvaluateAsSecOper().
size_t BSL_SecOper_CountParams | ( | const BSL_SecOper_t * | self | ) |
Get the count of parameters contained within this security operation.
self | This security operation. |
References BSL_SecOper_IsConsistent().
Referenced by BSLX_BIB_InitFromSecOper(), and test_PolicyProvider_Inspect_RFC9173_BIB().
void BSL_SecOper_Deinit | ( | BSL_SecOper_t * | self | ) |
Empty and release any resources used internally by this structure.
Certain backend implementations may create dynamic data structures that may need to be cleaned up, so it is essential to call this under all circumstances.
[in,out] | self | Non-NULL pointer to this security operation |
References BSL_SecOper_IsConsistent().
Referenced by test_RFC9173_AppendixA_Example1_BIB_Source(), test_RFC9173_AppendixA_Example2_BCB_Acceptor(), and test_RFC9173_AppendixA_Example2_BCB_Source().
BSL_SecOper_ConclusionState_e BSL_SecOper_GetConclusion | ( | const BSL_SecOper_t * | self | ) |
Retrieve the conclusion state of a security operation.
[in] | self | The security operation |
References BSL_SecOper_IsConsistent().
Referenced by BSL_API_ApplySecurity().
const BSL_SecParam_t * BSL_SecOper_GetParamAt | ( | const BSL_SecOper_t * | self, |
size_t | index | ||
) |
Returns a pointer to the Security Parameter at a given index in the list of all parameters.
[in] | self | This security operation |
[in] | index | Index of security parameter list to retrieve from |
References BSL_SecOper_IsConsistent().
Referenced by BSLX_BIB_InitFromSecOper().
uint64_t BSL_SecOper_GetSecurityBlockNum | ( | const BSL_SecOper_t * | self | ) |
Get the block number of the security block containing this sec operation.
[in] | self | This security operation |
References BSL_SecOper_IsConsistent().
Referenced by BSLP_QueryPolicy().
uint64_t BSL_SecOper_GetTargetBlockNum | ( | const BSL_SecOper_t * | self | ) |
Get the block number of the target block covered by this security operation.
[in] | self | This security operation |
References BSL_SecOper_IsConsistent().
Referenced by BSLP_QueryPolicy().
void BSL_SecOper_Init | ( | BSL_SecOper_t * | self | ) |
Initialize a newly allocated structure.
[in,out] | self | Non-NULL pointer to this security operation |
References BSL_SecOper_IsConsistent().
Referenced by BSLP_QueryPolicy(), and test_SamplePolicyProvider_WildcardPolicyRuleVerifiesBIB().
void BSL_SecOper_InitSet | ( | BSL_SecOper_t * | self, |
const BSL_SecOper_t * | src | ||
) |
Initialize from a copy.
[in,out] | self | Non-NULL pointer to this security operation |
[in] | src | Non-NULL pointer to this source to copy from. |
References BSL_SecOper_IsConsistent().
bool BSL_SecOper_IsBIB | ( | const BSL_SecOper_t * | self | ) |
Return true if this security operation is BIB.
[in] | self | This security operation |
References BSL_SECBLOCKTYPE_BIB, and BSL_SecOper_IsConsistent().
Referenced by BSL_SecCtx_ExecutePolicyActionSet(), BSLP_QueryPolicy(), and test_SamplePolicyProvider_WildcardPolicyRuleVerifiesBIB().
bool BSL_SecOper_IsConsistent | ( | const BSL_SecOper_t * | self | ) |
Returns true if internal consistency and sanity checks pass.
[in] | self | This security operation |
References BSL_SECBLOCKTYPE_BCB, BSL_SECBLOCKTYPE_BIB, BSL_SECOP_CONCLUSION_FAILURE, BSL_SECOP_CONCLUSION_PENDING, BSL_SECROLE_ACCEPTOR, BSL_SECROLE_SOURCE, and BSL_SECROLE_VERIFIER.
Referenced by BSL_SecOper_AppendParam(), BSL_SecOper_CountParams(), BSL_SecOper_Deinit(), BSL_SecOper_GetConclusion(), BSL_SecOper_GetParamAt(), BSL_SecOper_GetSecurityBlockNum(), BSL_SecOper_GetTargetBlockNum(), BSL_SecOper_Init(), BSL_SecOper_InitSet(), BSL_SecOper_IsBIB(), BSL_SecOper_IsRoleAcceptor(), BSL_SecOper_IsRoleSource(), BSL_SecOper_IsRoleVerifier(), BSL_SecOper_Populate(), BSL_SecOper_Set(), BSL_SecOper_SetConclusion(), and BSL_SecOutcome_Init().
bool BSL_SecOper_IsRoleAcceptor | ( | const BSL_SecOper_t * | self | ) |
Return true if this security operation's role is Acceptor.
[in] | self | This Security Operation |
References BSL_SecOper_IsConsistent(), and BSL_SECROLE_ACCEPTOR.
bool BSL_SecOper_IsRoleSource | ( | const BSL_SecOper_t * | self | ) |
Return true if this security operation's role is SOURCE.
[in] | self | This Security Operation |
References BSL_SecOper_IsConsistent(), and BSL_SECROLE_SOURCE.
Referenced by BSL_SecCtx_ExecutePolicyActionSet(), and BSLP_QueryPolicy().
bool BSL_SecOper_IsRoleVerifier | ( | const BSL_SecOper_t * | self | ) |
Return true if this security operation's role is Verifier.
[in] | self | This Security Operation |
References BSL_SecOper_IsConsistent(), and BSL_SECROLE_VERIFIER.
void BSL_SecOper_Populate | ( | BSL_SecOper_t * | self, |
uint64_t | context_id, | ||
uint64_t | target_block_num, | ||
uint64_t | sec_block_num, | ||
BSL_SecBlockType_e | sec_type, | ||
BSL_SecRole_e | sec_role, | ||
BSL_PolicyAction_e | failure_code | ||
) |
Populate an initialized Security Operation with the given values.
[in,out] | self | Non-NULL pointer to this security operation. |
[in] | context_id | ID of the security context |
[in] | target_block_num | Block ID of security target block |
[in] | sec_block_num | Block ID of security block. |
[in] | sec_type | Member of BSL_SecBlockType_e enum indicating BIB or BCB |
[in] | sec_role | Member of BSL_SecRole_e enum indicating role. |
References BSL_SECOP_CONCLUSION_PENDING, and BSL_SecOper_IsConsistent().
Referenced by BSLP_PolicyRule_EvaluateAsSecOper().
void BSL_SecOper_Set | ( | BSL_SecOper_t * | self, |
const BSL_SecOper_t * | src | ||
) |
Set from a copy.
[in,out] | self | Non-NULL pointer to this security operation |
[in] | src | Non-NULL pointer to this source to copy from. |
References BSL_SecOper_IsConsistent().
void BSL_SecOper_SetConclusion | ( | BSL_SecOper_t * | self, |
BSL_SecOper_ConclusionState_e | new_conclusion | ||
) |
Set the security operation conclusion state.
[in,out] | self | security operation to change conclusion state of |
[in] | new_conclusion | new conclusion to set to |
References BSL_SecOper_IsConsistent().
Referenced by BSL_SecCtx_ExecutePolicyActionSet(), and BSLP_QueryPolicy().