BSL v0.0.0 - 0.geda3e66
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
SecResult.c File Reference

Implementation of a RFC9172 Result. More...

#include "SecResult.h"
+ Include dependency graph for SecResult.c:

Functions

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 result.
 
bool BSL_SecResult_IsConsistent (const BSL_SecResult_t *self)
 Return true when internal invariant checks pass.
 
size_t BSL_SecResult_Sizeof (void)
 Returns size in bytes of BSL_SecResult_s.
 

Detailed Description

Implementation of a RFC9172 Result.

Function Documentation

◆ BSL_SecResult_Init()

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

Parameters
[in,out]selfNon-NULL pointer to allocated result.
[in]result_idResult ID of corresponding result bytestring, meaning dependent on security context.
[in]context_idID of security context.
[in]target_block_numTarget of the given security result, included here for convenience.
[in]contentRead-only view to data containing the bytes of the security result, which is copied out of here.
Returns
0 on success, negative on error

References BSL_SecResult_IsConsistent(), BSL_SUCCESS, BSL_Data_t::len, and BSL_Data_t::ptr.

Referenced by BSL_AbsSecBlock_DecodeFromCBOR().

◆ BSL_SecResult_IsConsistent()

bool BSL_SecResult_IsConsistent ( const BSL_SecResult_t *  self)

Return true when internal invariant checks pass.

Parameters
selfThis security result

Referenced by BSL_SecOutcome_AppendResult(), and BSL_SecResult_Init().