BSL v1.1.1 - 39.g9f43410
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
SecurityContext.c File Reference

Implementation of functions to interact with the security context. More...

#include "AbsSecBlock.h"
#include "CBOR.h"
#include "PublicInterfaceImpl.h"
#include "SecOperation.h"
#include "SecurityActionSet.h"
#include "bsl/BPSecLib_Private.h"
+ Include dependency graph for SecurityContext.c:

Functions

static int Encode_ASB (BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, uint64_t blk_num, const BSL_AbsSecBlock_t *asb)
 
static int BSL_ExecAnySource_Pre (BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper, BSL_AbsSecBlock_t *asb)
 Common handling of needed ASB content before an operation.
 
static int BSL_ExecAnySource_Post (BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper, BSL_AbsSecBlock_t *asb)
 Common handling of informing new ASB content after an operation.
 
int BSL_ExecBIBSource (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper)
 Internal function to execute an operation as source.
 
static int BSL_ExecAnyVerifierAcceptor_Pre (BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper, BSL_AbsSecBlock_t *asb)
 Common handling of binding to existing ASB content from an operation.
 
int BSL_ExecBIBVerifierAcceptor (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper)
 Internal function to execute an operation as verifier or acceptor.
 
int BSL_ExecBCBVerifierAcceptor (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper)
 Internal function to execute an operation as verifier or acceptor.
 
int BSL_ExecBCBSource (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper)
 Internal function to execute an operation as source.
 
int BSL_SecCtx_ExecutePolicyActionSet (BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, const BSL_SecurityActionSet_t *action_set)
 Call the underlying security context to perform the given action set.
 
int BSL_SecCtx_ValidatePolicyActionSet (BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, const BSL_SecurityActionSet_t *action_set)
 Call the underlying security context to validate the given action set.
 

Detailed Description

Implementation of functions to interact with the security context.

Function Documentation

◆ BSL_ExecAnySource_Post()

static int BSL_ExecAnySource_Post ( BSL_LibCtx_t *  lib,
BSL_BundleRef_t bundle,
BSL_SecOper_t *  sec_oper,
BSL_AbsSecBlock_t *  asb 
)
static

◆ BSL_ExecAnySource_Pre()

static int BSL_ExecAnySource_Pre ( BSL_LibCtx_t *  lib,
BSL_BundleRef_t bundle,
BSL_SecOper_t *  sec_oper,
BSL_AbsSecBlock_t *  asb 
)
static

Common handling of needed ASB content before an operation.

References BSL_ERR_HOST_CALLBACK_FAILED, BSL_Host_GetSecSrcEID(), BSL_LOG_ERR, and BSL_SUCCESS.

Referenced by BSL_ExecBCBSource(), and BSL_ExecBIBSource().

◆ BSL_ExecAnyVerifierAcceptor_Pre()

◆ BSL_ExecBCBSource()

int BSL_ExecBCBSource ( BSL_SecCtx_Execute_f  sec_context_fn,
BSL_LibCtx_t *  lib,
BSL_BundleRef_t bundle,
BSL_SecOper_t *  sec_oper 
)

◆ BSL_ExecBCBVerifierAcceptor()

◆ BSL_ExecBIBSource()

◆ BSL_ExecBIBVerifierAcceptor()

◆ BSL_SecCtx_ExecutePolicyActionSet()

int BSL_SecCtx_ExecutePolicyActionSet ( BSL_LibCtx_t *  lib,
BSL_BundleRef_t bundle,
const BSL_SecurityActionSet_t *  action_set 
)

◆ BSL_SecCtx_ValidatePolicyActionSet()

int BSL_SecCtx_ValidatePolicyActionSet ( BSL_LibCtx_t *  lib,
BSL_BundleRef_t bundle,
const BSL_SecurityActionSet_t *  action_set 
)

Call the underlying security context to validate the given action set.

Parameters
[in]libThis BSL context
[in]bundlePointer to bundle
[in]action_setAction containing all params and operations.
Returns
0 on success, negative on failure.

References action_set, BSL_LOG_ERR, BSL_LOG_WARNING, BSL_SUCCESS, and CHK_ARG_NONNULL.

Referenced by BSL_API_QuerySecurity(), and test_SecurityContext_ValidatePolicyActionSet_UsesRegisteredValidator().

◆ Encode_ASB()