BSL v0.0.0
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 <BPSecLib_Private.h>
#include "AbsSecBlock.h"
#include "PublicInterfaceImpl.h"
#include "SecOperation.h"
#include "SecurityResultSet.h"
+ Include dependency graph for SecurityContext.c:

Go to the source code of this file.

Functions

static int BSL_ExecBIBSource (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper, BSL_SecOutcome_t *outcome)
 
static int BSL_ExecBIBAccept (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper, BSL_SecOutcome_t *outcome)
 
static int BSL_ExecBCBAcceptor (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper, BSL_SecOutcome_t *outcome)
 
static int BSL_ExecBCBSource (BSL_SecCtx_Execute_f sec_context_fn, BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, BSL_SecOper_t *sec_oper, BSL_SecOutcome_t *outcome)
 
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.
 
bool BSL_SecCtx_ValidatePolicyActionSet (BSL_LibCtx_t *lib, const BSL_BundleRef_t *bundle, const BSL_SecurityActionSet_t *action_set)
 

Detailed Description

Implementation of functions to interact with the security context.

Todo:

Enable checking (not just using a stub returning True.)

Complete implementation for BCB acceptor.

Definition in file SecurityContext.c.

Function Documentation

◆ BSL_ExecBCBAcceptor()

static int BSL_ExecBCBAcceptor ( BSL_SecCtx_Execute_f  sec_context_fn,
BSL_LibCtx_t lib,
BSL_BundleRef_t bundle,
BSL_SecOper_t sec_oper,
BSL_SecOutcome_t outcome 
)
static

Definition at line 250 of file SecurityContext.c.

◆ BSL_ExecBCBSource()

static int BSL_ExecBCBSource ( BSL_SecCtx_Execute_f  sec_context_fn,
BSL_LibCtx_t lib,
BSL_BundleRef_t bundle,
BSL_SecOper_t sec_oper,
BSL_SecOutcome_t outcome 
)
static

Definition at line 363 of file SecurityContext.c.

◆ BSL_ExecBIBAccept()

static int BSL_ExecBIBAccept ( BSL_SecCtx_Execute_f  sec_context_fn,
BSL_LibCtx_t lib,
BSL_BundleRef_t bundle,
BSL_SecOper_t sec_oper,
BSL_SecOutcome_t outcome 
)
static

Definition at line 138 of file SecurityContext.c.

◆ BSL_ExecBIBSource()

static int BSL_ExecBIBSource ( BSL_SecCtx_Execute_f  sec_context_fn,
BSL_LibCtx_t lib,
BSL_BundleRef_t bundle,
BSL_SecOper_t sec_oper,
BSL_SecOutcome_t outcome 
)
static

Definition at line 37 of file SecurityContext.c.

◆ BSL_SecCtx_ExecutePolicyActionSet()

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.

Parameters
[in]libThis BSL context
[out]output_responsePointer to allocated, zeroed memory into which the response is populated
[in,out]bundlePointer to bundle, which may be modified.
[in]action_setAction containing all params and operations.

Notes:

  • It should evaluate every security operation, even if earlier ones failed.
  • The outcome can indicate in the policy action response how exactly it fared (pass, fail, etc)
  • BCB will be a special case, since it actively manipulates the BTSD

Definition at line 473 of file SecurityContext.c.

References BSL_ERR_SECURITY_CONTEXT_PARTIAL_FAIL, BSL_LOG_ERR, BSL_SecOper_IsBIB(), BSL_SecOper_IsRoleSource(), BSL_SecurityActionSet_CountSecOpers(), BSL_SecurityActionSet_GetSecOperAtIndex(), BSL_SecurityActionSet_IsConsistent(), BSL_SecurityResponseSet_Init(), BSL_SUCCESS, BSL_SecOper_s::context_id, BSL_SecCtxDesc_s::execute, and BSL_SecurityResponseSet_s::results.

Referenced by BSL_API_ApplySecurity().

◆ BSL_SecCtx_ValidatePolicyActionSet()

bool BSL_SecCtx_ValidatePolicyActionSet ( BSL_LibCtx_t lib,
const BSL_BundleRef_t bundle,
const BSL_SecurityActionSet_t action_set 
)
Todo:
Doxygen

Definition at line 540 of file SecurityContext.c.

Referenced by BSL_API_QuerySecurity().