34#ifndef BSL_BPSECLIB_PRIVATE_H_
35#define BSL_BPSECLIB_PRIVATE_H_
86#if defined(__GNUC__) || defined(__clang__)
87#define _U_ __attribute__((unused))
88#elif defined(_MSC_VER)
89#define _U_ __pragma(warning(suppress : 4100 4189))
108#define UNLIKELY(expr) __builtin_expect(!!(expr), 0)
109#define LIKELY(expr) __builtin_expect(!!(expr), 1)
111#define UNLIKELY(expr) (expr)
112#define LIKELY(expr) (expr)
123#define CHKRET(cond, val) \
129#define CHKVOID(cond) CHKRET(cond, )
131#define CHKNULL(cond) CHKRET(cond, NULL)
133#define CHKFALSE(cond) CHKRET(cond, false)
135#define CHKERR1(cond) CHKRET(cond, 1)
141#define CHKERRVAL(value) CHKRET(!(value), (value))
190void BSL_LogEvent(
int severity,
const char *filename,
int lineno,
const char *funcname,
const char *format, ...);
197#define BSL_LOG_CRIT(...) BSL_LogEvent(LOG_CRIT, __FILE__, __LINE__, __func__, __VA_ARGS__)
199#define BSL_LOG_ERR(...) BSL_LogEvent(LOG_ERR, __FILE__, __LINE__, __func__, __VA_ARGS__)
201#define BSL_LOG_WARNING(...) BSL_LogEvent(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
203#define BSL_LOG_INFO(...) BSL_LogEvent(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)
205#define BSL_LOG_DEBUG(...) BSL_LogEvent(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__)
211#define CHK_TEMPL(expr, msg, return_code) \
216 BSL_LOG_ERR("" msg " (" #expr ") ... [errcode=" #return_code "]"); \
218 return return_code; \
223#define CHK_AS_BOOL(expr) CHK_TEMPL(expr, "Failed Property Check: Failed to satisfy", BSL_ERR_ARG_INVALID)
225#define CHK_ARG_EXPR(expr) \
226 CHK_TEMPL(expr, "Illegal Argument: Argument expression check failed to satisfy", BSL_ERR_ARG_INVALID)
228#define CHK_ARG_NONNULL(var) \
229 CHK_TEMPL((var) != NULL, "Illegal Argument: Argument null check failed to satisfy", BSL_ERR_ARG_NULL)
231#define CHK_PRECONDITION(expr) CHK_TEMPL(expr, "Precondition Failed: Did not satisfy", BSL_ERR_FAILURE);
233#define CHK_PROPERTY(expr) CHK_TEMPL(expr, "Property Failed: Did not satisfy", BSL_ERR_FAILURE);
235#define CHK_POSTCONDITION(expr) CHK_TEMPL(expr, "Postcondition Failed: Did not satisfy", BSL_ERR_FAILURE);
237#define ASSERT_TEMPL(expr, msg) \
242 BSL_LOG_ERR("" msg " (" #expr ")"); \
248#define ASSERT_ARG_EXPR(expr) ASSERT_TEMPL(expr, "Panic: Argument expression check failed to satisfy")
250#define ASSERT_ARG_NONNULL(var) ASSERT_TEMPL((var) != NULL, "Panic: Null Argument check failed to satisfy")
252#define ASSERT_PROPERTY(expr) ASSERT_TEMPL(expr, "Panic: Property check failed to satisfy")
254#define ASSERT_PRECONDITION(expr) ASSERT_TEMPL(expr, "Panic: Precondition failed to satisfy")
256#define ASSERT_POSTCONDITION(expr) ASSERT_TEMPL(expr, "Panic: Precondition failed to satisfy")
279#define BSL_DATA_INIT_NULL { .owned = false, .ptr = NULL, .len = 0 }
390#define BSL_HOSTEID_INIT_INVALID { .handle = NULL }
437#define BSL_HOSTEID_INIT_INVALID { .handle = NULL }
533 uint64_t block_ids_array[array_count],
size_t *result_count);
572#define BSL_DEFAULT_BYTESTR_LEN (128)
583#define BSL_SECROLE_ISVALID(role_value) (((role_value) >= BSL_SECROLE_SOURCE) && ((role_value) <= BSL_SECROLE_ACCEPTOR))
596#define BSL_SecBlockType_IsSecBlock(block_id) \
597 (((block_id) >= BSL_SECBLOCKTYPE_BIB) && ((block_id) <= BSL_SECBLOCKTYPE_BCB))
650 BSL_SECPARAM_TYPE_AUTH_TAG,
652 BSL_SECPARAM_TYPE_IV,
733size_t BSL_SecOper_Sizeof(
void);
void BSL_SecOutcome_AppendParam(BSL_SecOutcome_t *self, const BSL_SecParam_t *param)
Append a Security Parameter to this outcome.
bool BSL_SecOper_IsRoleVerifier(const BSL_SecOper_t *self)
Return true if this security operation's role is Verifier.
int BSL_SecParam_IsInt64(const BSL_SecParam_t *self)
Returns true when the value type is an integer.
struct BSL_Data_s BSL_Data_t
Heap data storage and views.
const BSL_SecOper_t * BSL_SecurityActionSet_GetSecOperAtIndex(const BSL_SecurityActionSet_t *self, size_t index)
Returns the Security Operation at the given index.
int BSL_SecResult_Init(BSL_SecResult_t *self, uint64_t result_id, uint64_t context_id, uint64_t target_block_num, BSL_Data_t content)
Populate a pre-allocated SecResult.
int BSL_Data_Resize(BSL_Data_t *data, size_t len)
Resize the data, copying if necessary.
int BSL_SecParam_GetAsBytestr(const BSL_SecParam_t *self, BSL_Data_t *result)
Retrieve bytestring value of result when security parameter type is bytestring.
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.
int BSL_SecParam_InitInt64(BSL_SecParam_t *self, uint64_t param_id, uint64_t value)
Initialize as a parameter containing an integer as a value.
uint64_t BSL_SecOper_GetSecurityBlockNum(const BSL_SecOper_t *self)
Get the block number of the security block containing this sec operation.
bool(* BSL_SecCtx_Validate_f)(BSL_LibCtx_t *lib, const BSL_BundleRef_t *bundle, const BSL_SecOper_t *sec_oper)
Signature for Security Context validator for a sec OP.
int BSL_SecurityActionSet_AppendSecOper(BSL_SecurityActionSet_t *self, const BSL_SecOper_t *sec_oper)
Append a security operation to the security action set.
bool BSL_SecurityResponseSet_IsConsistent(const BSL_SecurityResponseSet_t *self)
Return true if internal consistency checks pass.
bool BSL_SecOper_IsBIB(const BSL_SecOper_t *self)
Return true if this security operation is BIB.
const BSL_SecResult_t * BSL_SecOutcome_GetResultAtIndex(const BSL_SecOutcome_t *self, size_t index)
Get the result at index i.
bool BSL_AbsSecBlock_ContainsTarget(const BSL_AbsSecBlock_t *self, uint64_t target_block_num)
Returns true if a given ASB contains the given block number as a security target.
int BSL_SecurityActionSet_GetErrCode(const BSL_SecurityActionSet_t *self)
Get the error code after querying (inspecting) policy actions.
BSL_SecParam_InternalIds
Defines supplementary Security Paramter type used internally by this implementation for testing or ad...
@ BSL_SECPARAM_TYPE_INT_USE_WRAPPED_KEY
This must be explicitly set, and set to 0, to avoid generating a wrapped key.
@ BSL_SECPARAM_TYPE_INT_KEY_ID
Used to pass in a key id found in the key registry.
@ BSL_SECPARAM_TYPE_INT_STARTINDEX
Do not use. Indicates start index of internal param ids.
@ BSL_SECPARAM_TYPE_INT_ENDINDEX
Do not use. Indicates final index of internal param ids.
@ BSL_SECPARAM_TYPE_INT_FIXED_KEY
Used by tests to pass in a specific key bytestring.
int BSL_PolicyRegistry_InspectActions(const BSL_LibCtx_t *bsl, BSL_SecurityActionSet_t *output_action_set, const BSL_BundleRef_t *bundle, BSL_PolicyLocation_e location)
Queries the policy provider for any security operations to take on the bundle.
void BSL_Data_InitMove(BSL_Data_t *data, BSL_Data_t *src)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int BSL_SeqWriter_Put(BSL_SeqWriter_t *obj, const uint8_t *buf, size_t *bufsize)
Iterate a sequential writer.
void BSL_AbsSecBlock_Deinit(BSL_AbsSecBlock_t *self)
Deinitializes and clears this ASB, clearing and releasing any owned memory.
bool BSL_SecOutcome_IsConsistent(const BSL_SecOutcome_t *self)
Return true if internal invariants hold.
uint8_t * BSL_DataPtr_t
Data pointer for BSL_Data_t.
void BSL_AbsSecBlock_AddResult(BSL_AbsSecBlock_t *self, const BSL_SecResult_t *result)
Add a security result to this security block (does NOT copy)
BSL_BundleBlockTypeCode_e
Block types using IANA-assigned code points from .
@ BSL_BLOCK_TYPE_PRIMARY
Primary block ID (a special case)
@ BSL_BLOCK_TYPE_BCB
Block Confidentiality .
@ BSL_BLOCK_TYPE_BIB
Block Integrity .
@ BSL_BLOCK_TYPE_PAYLOAD
Payload block.
int BSL_SecParam_InitBytestr(BSL_SecParam_t *self, uint64_t param_id, BSL_Data_t value)
Initialize as a parameter containing a bytestring.
size_t BSL_SecurityActionSet_Sizeof(void)
Returns size of the struct, helpful for dynamic allocation.
int BSL_BundleCtx_CreateBlock(BSL_BundleRef_t *bundle, uint64_t block_type_code, uint64_t *block_num)
Request the creation of a new block of a given type in the bundle.
int BSL_Host_GetSecSrcEID(BSL_HostEID_t *eid)
Get the local EID used when this node is a security source.
BSL_BundleASBFlag_e
Flags of the Abstract Security Block .
@ BSL_ASB_FLAG_PARAMS
Flag set when parameters are present.
void BSL_SecurityResponseSet_Deinit(BSL_SecurityResponseSet_t *self)
Zeroize itself and release any owned resources.
size_t BSL_SecurityResponseSet_Sizeof(void)
Returns size of this struct type.
void BSL_SecOutcome_Init(BSL_SecOutcome_t *self, const BSL_SecOper_t *sec_oper, size_t allocation_size)
Populate a pre-allocated security outcome struct.
BSL_PolicyAction_e
Codes indicating the fate of a block if a security operation over it fails.
@ BSL_POLICYACTION_UNDEFINED
Placeholder for zero - should never occur.
@ BSL_POLICYACTION_DROP_BUNDLE
Drop the entire bundle.
@ BSL_POLICYACTION_NOTHING
Do nothing, keep the block even if it fails.
@ BSL_POLICYACTION_DROP_BLOCK
Drop on the target block.
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.
bool BSL_SecurityActionSet_IsConsistent(const BSL_SecurityActionSet_t *self)
Return true if internal sanity and consistency checks pass.
int BSL_Data_AppendFrom(BSL_Data_t *data, size_t len, BSL_DataConstPtr_t src)
Append an initialized data struct with a given size.
uint64_t BSL_SecParam_GetId(const BSL_SecParam_t *self)
Get parameter ID of this param.
int BSL_Data_Deinit(BSL_Data_t *data)
De-initialize a data struct, freeing if necessary.
int BSL_HostEID_DecodeFromCBOR(BSL_HostEID_t *eid, void *decoder)
Load an EID from CBOR.
uint64_t BSL_SecOper_GetTargetBlockNum(const BSL_SecOper_t *self)
Get the block number of the target block covered by this security operation.
int BSL_BundleCtx_GetBlockIds(const BSL_BundleRef_t *bundle, size_t array_count, uint64_t block_ids_array[array_count], size_t *result_count)
Returns an array in which each element contains the id of the corresponding block....
struct BSL_AbsSecBlock_s BSL_AbsSecBlock_t
Forward declaration of BSL_AbsSecBlock_t.
int BSL_Data_InitView(BSL_Data_t *data, size_t len, BSL_DataPtr_t src)
Initialize a data struct as an overlay on optional external data.
int BSL_SeqWriter_Deinit(BSL_SeqWriter_t *obj)
Release resources from a sequential writer.
size_t BSL_SecOutcome_CountParams(const BSL_SecOutcome_t *self)
Returns number of parameters in this outcome.
const uint8_t * BSL_DataConstPtr_t
Pointer to constant data for BSL_Data_t.
void BSL_SecOutcome_Deinit(BSL_SecOutcome_t *self)
Release any resources owned by this security outcome.
size_t BSL_SecOutcome_Sizeof(void)
Returns the size of the BSL_SecOutcome_t structure.
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_SecParam_Sizeof(void)
Return size of BSL_SecParam_t struct type.
int BSL_HostEID_EncodeToCBOR(const BSL_HostEID_t *eid, void *user_data)
Encode a EID into a CBOR sequence.
size_t BSL_SecOper_CountParams(const BSL_SecOper_t *self)
Get the count of parameters contained within this security operation.
uint8_t * BSL_Log_DumpAsHexString(uint8_t *dstbuf, size_t dstlen, const uint8_t *srcbuf, size_t srclen)
Helper function to print the ASCII encoding of a given bytestream to a given target buffer.
int BSL_SeqReader_Get(BSL_SeqReader_t *obj, uint8_t *buf, size_t *bufsize)
Iterate a sequential reader.
int BSL_BundleCtx_GetBlockMetadata(const BSL_BundleRef_t *bundle, uint64_t block_num, BSL_CanonicalBlock_t *result_block)
Returns information about the bundle Canonical block.
void(* BSL_PolicyDeinit_f)(void *user_data)
Callback interface for policy provider to shut down and release any resources.
void BSL_SecurityResponseSet_Init(BSL_SecurityResponseSet_t *self, size_t noperations, size_t nfailed)
Initialize with the given count of operations and nailures.
void BSL_LogEvent(int severity, const char *filename, int lineno, const char *funcname, const char *format,...)
Log an event.
bool BSL_HostEIDPattern_IsMatch(const BSL_HostEIDPattern_t *pat, const BSL_HostEID_t *eid)
Determine if an EID Pattern matches a specific EID.
void BSL_HostEIDPattern_Deinit(BSL_HostEIDPattern_t *pat)
De-initialize an abstract EID Pattern.
int BSL_Data_InitBuffer(BSL_Data_t *data, size_t bytelen)
Initialize with an owned buffer of size bytelen.
bool BSL_SecResult_IsConsistent(const BSL_SecResult_t *self)
Return true when internal invariant checks pass.
void BSL_SecOper_Deinit(BSL_SecOper_t *self)
Empty and release any resources used internally by this structure.
bool BSL_SecOutcome_IsInAbsSecBlock(const BSL_SecOutcome_t *self, const BSL_AbsSecBlock_t *abs_sec_block)
Returns true if this (the parameters and results) is contained within the given ASK.
void BSL_AbsSecBlock_AddTarget(BSL_AbsSecBlock_t *self, uint64_t target_block_id)
Adds a given block ID as a security target covered by this ASB.
bool BSL_SecParam_IsParamIDOutput(uint64_t param_id)
Indicates true when this parameter is NOT an implementation-specific security paramter.
uint64_t BSL_SecParam_GetAsUInt64(const BSL_SecParam_t *self)
Retrieve integer value of result when this result type is integer.
int BSL_AbsSecBlock_StripResults(BSL_AbsSecBlock_t *self, uint64_t target_block_num)
Remove security parameters and results found in outcome from this ASB.
BSL_SecParam_Types_e
Security parameters defined in RFC9172 may be unsigned integers or bytestrings.
@ BSL_SECPARAM_TYPE_BYTESTR
Indicates the value type is a byte string.
@ BSL_SECPARAM_TYPE_INT64
Indicates value type is an unsigned integer.
@ BSL_SECPARAM_TYPE_UNKNOWN
Inidcates parsed value not of expected type.
int BSL_HostEID_Init(BSL_HostEID_t *eid)
Initialize an abstract EID.
void BSL_SecurityActionSet_IncrError(BSL_SecurityActionSet_t *self)
Increment a security failure for this action set.
int BSL_HostEIDPattern_Init(BSL_HostEIDPattern_t *pat)
Initialize an abstract EID Pattern.
BSL_BundleCtrlFlag_e
Bundle processing control flags.
@ BSL_BUNDLE_IS_FRAGMENT
Set if this bundle is a fragment.
void BSL_AbsSecBlock_Init(BSL_AbsSecBlock_t *self, uint64_t sec_context_id, BSL_HostEID_t source_eid)
Populate a pre-allocated Absract Security Block.
int BSL_HostEID_DecodeFromText(BSL_HostEID_t *eid, const char *text)
Decode an EID from its text form.
size_t BSL_SecurityActionSet_CountErrors(const BSL_SecurityActionSet_t *self)
Returns count of failures after processing this action set.
void BSL_AbsSecBlock_InitEmpty(BSL_AbsSecBlock_t *self)
Initialize a pre-allocated ASB with no contents.
int BSL_AbsSecBlock_DecodeFromCBOR(BSL_AbsSecBlock_t *self, BSL_Data_t encoded_cbor)
Decodes and populates this ASB from a CBOR string.
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_AbsSecBlock_IsEmpty(const BSL_AbsSecBlock_t *self)
Returns true if this ASB contains nothing (i.e., no tarets, params and results)
size_t BSL_SecurityResponseSet_CountResponses(const BSL_SecurityResponseSet_t *self)
Return number of responses (operations acted upon)
int BSL_Data_CopyFrom(BSL_Data_t *data, size_t len, BSL_DataConstPtr_t src)
Set an initialized data struct to a given size.
size_t BSL_AbsSecBlock_Sizeof(void)
Returns the size of the AbsSecBlock struct in bytes.
size_t BSL_SecResult_Sizeof(void)
Returns size in bytes of BSL_SecResult_t.
bool BSL_SecParam_IsConsistent(const BSL_SecParam_t *self)
Return true if invariant conditions pass.
int BSL_HostEIDPattern_DecodeFromText(BSL_HostEIDPattern_t *pat, const char *text)
Decode an EID Pattern from its text form.
int BSL_AbsSecBlock_EncodeToCBOR(const BSL_AbsSecBlock_t *self, BSL_Data_t allocated_target)
Encodes this ASB into a CBOR string into the space pre-allocated indicated by the argument.
bool BSL_SecCtx_ValidatePolicyActionSet(BSL_LibCtx_t *lib, const BSL_BundleRef_t *bundle, const BSL_SecurityActionSet_t *action_set)
bool BSL_SecOper_IsRoleSource(const BSL_SecOper_t *self)
Return true if this security operation's role is SOURCE.
int BSL_SecCtx_ExecutePolicyActionSet(BSL_LibCtx_t *lib, BSL_SecurityResponseSet_t *output_response, BSL_BundleRef_t *bundle, const BSL_SecurityActionSet_t *action_set)
Call the underying security context to perform the given action.
int(* BSL_PolicyInspect_f)(const void *user_data, BSL_SecurityActionSet_t *output_action_set, const BSL_BundleRef_t *bundle, BSL_PolicyLocation_e location)
Callback interface to query policy provider to populate the action set.
void BSL_SecurityActionSet_Deinit(BSL_SecurityActionSet_t *self)
Zeroize, clear, and release itself and any owned resources.
bool BSL_SecOper_IsConsistent(const BSL_SecOper_t *self)
Returns true if internal consistency and sanity checks pass.
int BSL_BundleCtx_ReallocBTSD(BSL_BundleRef_t *bundle, uint64_t block_num, size_t bytesize)
Requests the re-allocation of a block's BTSD, useful for BCB.
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.
int(* BSL_SecCtx_Execute_f)(BSL_LibCtx_t *lib, const BSL_BundleRef_t *bundle, const BSL_SecOper_t *sec_oper, BSL_SecOutcome_t *sec_outcome)
Signature for Security Context executor for a sec OP.
bool BSL_SecOper_IsRoleAccepter(const BSL_SecOper_t *self)
Return true if this security operation's role is Acceptor.
void BSL_SecOutcome_AppendResult(BSL_SecOutcome_t *self, const BSL_SecResult_t *sec_result)
Append a Security Result to this outcome.
int BSL_Data_Init(BSL_Data_t *data)
Initialize an empty data struct.
void BSL_SecurityActionSet_Init(BSL_SecurityActionSet_t *self)
Initialize a new security action set.
void BSL_AbsSecBlock_AddParam(BSL_AbsSecBlock_t *self, const BSL_SecParam_t *param)
Add a security parameter to this security block (does NOT copy)
void BSL_openlog(void)
Opens the event log.
int BSL_SeqReader_Deinit(BSL_SeqReader_t *obj)
Release resources from a sequential reader.
int BSL_BundleCtx_RemoveBlock(BSL_BundleRef_t *bundle, uint64_t block_num)
Requests the removal of a block from a bundle.
size_t BSL_SecOutcome_CountResults(const BSL_SecOutcome_t *self)
Get the number of results.
bool BSL_AbsSecBlock_IsConsistent(const BSL_AbsSecBlock_t *self)
Checks internal consistency and sanity of this structure.
void BSL_closelog(void)
Closes the event log.
int BSL_BundleCtx_GetBundleMetadata(const BSL_BundleRef_t *bundle, BSL_PrimaryBlock_t *result_primary_block)
Calls the host interface to get a bundle primary block information.abort.
size_t BSL_SecurityActionSet_CountSecOpers(const BSL_SecurityActionSet_t *self)
Count number of security operations present in this policy action set.
BSL_ErrCodes_e
Catalog of error code.
@ BSL_ERR_PROPERTY_CHECK_FAILED
The BSL of a structure within it is not in a valid state.
@ BSL_ERR_NOT_IMPLEMENTED
Requested functionality not yet implemented.
@ BSL_ERR_SECURITY_CONTEXT_PARTIAL_FAIL
General code where at least some security operations failed.
@ BSL_ERR_ENCODING
CBOR encoding failure.
@ BSL_ERR_SECURITY_CONTEXT_FAILED
Security Context errors start at 200.
@ BSL_ERR_INSUFFICIENT_SPACE
Insufficient space to complete.
@ BSL_ERR_DECODING
CBOR decoding failure.
@ BSL_ERR_ARG_INVALID
Function argument does not satisfy a given predicate.
@ BSL_ERR_SECURITY_OPERATION_FAILED
Security operation failed (e.g., BIB did not have enough parameters)
@ BSL_ERR_NOT_FOUND
Requested value not found for key.
@ BSL_ERR_POLICY_FAILED
Policy Errors start at 100.
@ BSL_ERR_ARG_NULL
Function pointer argument is NULL.
@ BSL_SUCCESS
Placeholder for non-error code.
@ BSL_ERR_SECURITY_CONTEXT_VALIDATION_FAILED
Indicates an HMAC signature did not match.
@ BSL_ERR_HOST_CALLBACK_FAILED
Callback to the host BPA returned a non-zero code.
@ BSL_ERR_BUNDLE_OPERATION_FAILED
Bundle manipulation failed (add/remove or change BTSD)
@ BSL_ERR_FAILURE
Uncategorized failed (prefer to avoid)
void BSL_HostEID_Deinit(BSL_HostEID_t *eid)
De-initialize an abstract EID.
void BSL_AbsSecBlock_Print(const BSL_AbsSecBlock_t *self)
Prints to LOG INFO.
struct BSL_BundleTimestamp_s BSL_BundleTimestamp_t
Creation Timestamp Defined in Section 4.2.7 of RFC 9171 .
Single entry-point include file for all of the "Public" BPSec Lib (BSL) frontend API.
BSL_PolicyLocation_e
Indicates where in the lifecycle of the BPA the bundle is querying for security policy.
Reference to a Bundle owned and stored in the host BPA.
Creation Timestamp Defined in Section 4.2.7 of RFC 9171 .
uint64_t seq_num
Creation timestamp sequence number.
uint64_t bundle_creation_time
Creation timestamp DTN creation time.
Structure containing parsed Canonical Block fields.
Heap data storage and views.
size_t len
Size of the data buffer.
BSL_DataPtr_t ptr
Pointer to the front of the buffer.
bool owned
True if this data is a copy.
Reference to a EID pattern owned and stored in the BPA.
Opaque pointer to BPA-specific Endpoint ID storage.
Concrete definition of library context.
Descriptor of opaque data and callbacks for Policy Provider.
BSL_PolicyInspect_f query_fn
Function pointer to query policy.
BSL_PolicyDeinit_f deinit_fn
Function to deinit the policy provider at termination of BPA.
Contains Bundle Primary Block fields and metadata.
Security Context descriptor (interface)
BSL_SecCtx_Execute_f execute
Callback to execute a sec op within a given bundle.
void * user_data
User data pointer for callbacks.
BSL_SecCtx_Validate_f validate
Callback to validate a sec op within a given bundle.
uint64_t context_id
Security context ID.
uint64_t target_block_num
Bundle's block ID over which the security operation is applied.
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.
const BSL_SecOper_t * sec_oper
Non-NULL pointer to Security Operation that provided the input.
uint64_t param_id
Parameter ID.
uint64_t target_block_num
Target block id, put in here for convenience.
uint64_t result_id
Result ID, which is context depdendent, based on security context.
uint64_t context_id
Context ID, put in here for convenience.
Contains the populated security operations for this bundle.
Contains the results and outcomes after performing the security operations.
Definition of a simple flat buffer iterator.
Definition of a simple flat buffer iterator.