30size_t BSL_SecOper_Sizeof(
void)
38 ASSERT_ARG_NONNULL(self);
40 memset(self, 0,
sizeof(*self));
41 BSLB_SecParamList_init(self->_param_list);
46 self->_service_type = sec_type;
47 self->
_role = sec_role;
55 BSLB_SecParamList_clear(self->_param_list);
56 memset(self, 0,
sizeof(*self));
63 return BSLB_SecParamList_size(self->_param_list);
69 CHK_AS_BOOL(self != NULL);
76 CHK_AS_BOOL(BSLB_SecParamList_size(self->_param_list) < 1000);
86 BSLB_SecParamList_push_back(self->_param_list, *param);
108 ASSERT_PRECONDITION(index < BSLB_SecParamList_size(self->_param_list));
110 return BSLB_SecParamList_cget(self->_param_list, index);
115 ASSERT_PRECONDITION(self != NULL);
121 ASSERT_PRECONDITION(self != NULL);
127 ASSERT_PRECONDITION(self != NULL);
BSL_SecBlockType_e
RFC 9172-specified block type codes for BIB and BCB.
@ BSL_SECBLOCKTYPE_BIB
RFC9172 code for BIB.
@ BSL_SECBLOCKTYPE_BCB
RFC9172 code for BCB.
BSL_PolicyAction_e
Codes indicating the fate of a block if a security operation over it fails.
struct BSL_SecOper_s BSL_SecOper_t
Represents a Security Operation produced by a policy provider to inform the security context.
BSL_SecRole_e
Security role of an operation.
@ BSL_SECROLE_SOURCE
Source producing the security result.
@ BSL_SECROLE_ACCEPTOR
Check and then remove the security result if correct.
@ BSL_SECROLE_VERIFIER
Only check the security result.
uint64_t BSL_SecOper_GetSecurityBlockNum(const BSL_SecOper_t *self)
Get the block number of the security block containing this sec operation.
bool BSL_SecOper_IsBIB(const BSL_SecOper_t *self)
Return true if this security operation is BIB.
void BSL_SecOper_Init(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 a pre-allocated Security Operation with the given values.
uint64_t BSL_SecOper_GetTargetBlockNum(const BSL_SecOper_t *self)
Get the block number of the target block covered by this 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.
size_t BSL_SecOper_CountParams(const BSL_SecOper_t *self)
Get the count of parameters contained within this security operation.
void BSL_SecOper_Deinit(BSL_SecOper_t *self)
Empty and release any resources used internally by this structure.
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 paramters.
bool BSL_SecOper_IsRoleSource(const BSL_SecOper_t *self)
Return true if this security operation's role is SOURCE.
bool BSL_SecOper_IsConsistent(const BSL_SecOper_t *self)
Returns true if internal consistency and sanity checks pass.
bool BSL_SecOper_IsRoleAccepter(const BSL_SecOper_t *self)
Return true if this security operation's role is Acceptor.
Defines a security operation.
bool BSL_SecParam_IsConsistent(const BSL_SecParam_t *self)
Return true if invariant conditions pass.
Defines the RFC 9172 Security Parameter of the Abstract Security Block.
uint64_t context_id
Security context ID.
uint64_t target_block_num
Bundle's block ID over which the security operation is applied.
BSL_SecRole_e _role
Private enumeration indicating the role (e.g., acceptor vs verifier)
uint64_t sec_block_num
Bundle's block ID which contains the security parameters and results for this operation.
BSL_PolicyAction_e failure_code
Code for handing what to do to the block or bundle if security processing fails.