BSL v1.1.1 - 19.g31939de
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
SecOutcome.c File Reference
#include <BPSecLib_Private.h>
#include "AbsSecBlock.h"
#include "SecOutcome.h"
+ Include dependency graph for SecOutcome.c:

Functions

size_t BSL_SecOutcome_Sizeof (void)
 Returns the size of the BSL_SecOutcome_s structure.
 
void BSL_SecOutcome_Init (BSL_SecOutcome_t *self, const BSL_SecOper_t *sec_oper)
 Populate a pre-allocated security outcome struct.
 
void BSL_SecOutcome_Deinit (BSL_SecOutcome_t *self)
 Release any resources owned by this security outcome.
 
bool BSL_SecOutcome_IsConsistent (const BSL_SecOutcome_t *self)
 Return true if internal invariants hold.
 
BSL_IdValPair_t * BSL_SecOutcome_AppendResult (BSL_SecOutcome_t *self)
 Append a Security Result to this outcome.
 
size_t BSL_SecOutcome_CountResults (const BSL_SecOutcome_t *self)
 Get the number of results.
 
const BSL_IdValPair_t * BSL_SecOutcome_GetResultAtIndex (const BSL_SecOutcome_t *self, size_t index)
 Get the result at index i.
 
size_t BSL_SecOutcome_CountParams (const BSL_SecOutcome_t *self)
 Returns number of parameters in this outcome.
 
const BSL_IdValPair_t * BSL_SecOutcome_GetParamAt (const BSL_SecOutcome_t *self, size_t index)
 Get the security parameter from the security outcome at the provided index.
 
BSL_IdValPair_t * BSL_SecOutcome_AppendParam (BSL_SecOutcome_t *self)
 Append a Security Parameter to this outcome.
 

Function Documentation

◆ BSL_SecOutcome_AppendParam()

BSL_IdValPair_t * BSL_SecOutcome_AppendParam ( BSL_SecOutcome_t *  self)

Append a Security Parameter to this outcome.

Parameters
[in,out]selfNon-NULL pointer to this security outcome.
Returns
Non-NULL pointer to the initialized security parameter.

References ASSERT_PRECONDITION, and BSL_SecOutcome_IsConsistent().

Referenced by BSLX_BCB_Execute(), and BSLX_BIB_Execute().

◆ BSL_SecOutcome_AppendResult()

BSL_IdValPair_t * BSL_SecOutcome_AppendResult ( BSL_SecOutcome_t *  self)

Append a Security Result to this outcome.

Parameters
[in,out]selfNon-NULL pointer to this security outcome.
Returns
Non-NULL pointer to security result just appended.

References ASSERT_PRECONDITION, and BSL_SecOutcome_IsConsistent().

Referenced by BSLX_BCB_Execute(), and BSLX_BIB_Execute().

◆ BSL_SecOutcome_CountParams()

size_t BSL_SecOutcome_CountParams ( const BSL_SecOutcome_t *  self)

Returns number of parameters in this outcome.

Parameters
[in]selfThis outcome
Returns
Number of parameters

References ASSERT_PRECONDITION, and BSL_SecOutcome_IsConsistent().

Referenced by test_sec_source_keywrap().

◆ BSL_SecOutcome_CountResults()

size_t BSL_SecOutcome_CountResults ( const BSL_SecOutcome_t *  self)

Get the number of results.

Parameters
[in]selfthis sec outcome
Returns
number of results in sec outcome

References ASSERT_PRECONDITION, and BSL_SecOutcome_IsConsistent().

Referenced by test_RFC9173_AppendixA_Example1_BIB_Source(), test_RFC9173_AppendixA_Example2_BCB_Acceptor(), test_RFC9173_AppendixA_Example2_BCB_Source(), and test_sec_source_keywrap().

◆ BSL_SecOutcome_Deinit()

void BSL_SecOutcome_Deinit ( BSL_SecOutcome_t *  self)

◆ BSL_SecOutcome_GetParamAt()

const BSL_IdValPair_t * BSL_SecOutcome_GetParamAt ( const BSL_SecOutcome_t *  self,
size_t  index 
)

Get the security parameter from the security outcome at the provided index.

Parameters
[in]selfsecurity outcome
[in]indexindex to retrieve security parameter from
Returns
Security parameter

References ASSERT_PRECONDITION, and BSL_SecOutcome_IsConsistent().

Referenced by test_sec_source_keywrap().

◆ BSL_SecOutcome_GetResultAtIndex()

const BSL_IdValPair_t * BSL_SecOutcome_GetResultAtIndex ( const BSL_SecOutcome_t *  self,
size_t  index 
)

Get the result at index i.

Panics if i is out of range.

Parameters
[in]selfThis outcome
[in]indexIndex in the list to retrieve
Returns
Sec Result at index

References ASSERT_PRECONDITION, and BSL_SecOutcome_IsConsistent().

Referenced by test_RFC9173_AppendixA_Example1_BIB_Source(), test_RFC9173_AppendixA_Example2_BCB_Source(), and test_sec_source_keywrap().

◆ BSL_SecOutcome_Init()

void BSL_SecOutcome_Init ( BSL_SecOutcome_t *  self,
const BSL_SecOper_t *  sec_oper 
)

Populate a pre-allocated security outcome struct.

Parameters
[in,out]selfNon-Null pointer to this security outcome.
[in]sec_operSecurity operation containing the necessary info.

References ASSERT_ARG_NONNULL, ASSERT_POSTCONDITION, ASSERT_PRECONDITION, BSL_SecOper_IsConsistent(), and BSL_SecOutcome_IsConsistent().

Referenced by BSL_SecCtx_ExecutePolicyActionSet(), test_RFC9173_AppendixA_Example1_BIB_Source(), test_RFC9173_AppendixA_Example2_BCB_Acceptor(), test_RFC9173_AppendixA_Example2_BCB_Source(), test_sec_accept_keyunwrap(), and test_sec_source_keywrap().

◆ BSL_SecOutcome_IsConsistent()

bool BSL_SecOutcome_IsConsistent ( const BSL_SecOutcome_t *  self)

◆ BSL_SecOutcome_Sizeof()