BSL v1.0.0 - 16.g9d98179
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
BIB_HMAC_SHA2.c File Reference

Header for the implementation of an example default security context (RFC 9173). More...

#include <qcbor/qcbor_encode.h>
#include <qcbor/qcbor_spiffy_decode.h>
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
#include <BPSecLib_Private.h>
#include <CryptoInterface.h>
#include "DefaultSecContext.h"
#include "DefaultSecContext_Private.h"
#include "rfc9173.h"
+ Include dependency graph for BIB_HMAC_SHA2.c:

Functions

bool BSLX_BIB_Validate (BSL_LibCtx_t *lib, const BSL_BundleRef_t *bundle, const BSL_SecOper_t *sec_oper)
 
bool BSLX_BCB_Validate (BSL_LibCtx_t *lib, const BSL_BundleRef_t *bundle, const BSL_SecOper_t *sec_oper)
 
static ssize_t map_rfc9173_sha_variant_to_crypto (size_t rfc9173_sha_variant)
 Provides the mapping from the security-context-specific ID defined in RFC9173 to the local ID of the SHA variant used by the crypto engine (OpenSSL).
 
int BSLX_BIB_InitFromSecOper (BSLX_BIB_t *self, const BSL_BundleRef_t *bundle, const BSL_SecOper_t *sec_oper)
 Populate the BIB parameters convenience struct from the security operation struct.
 
void BSLX_BIB_Deinit (BSLX_BIB_t *self)
 
int BSLX_BIB_GenIPPT (const BSLX_BIB_t *self, BSL_Data_t *ippt_space)
 Computes the Integrity-Protected Plaintext (IPPT) according to Section 3.7 of RFC 9173 [4].
 
int BSLX_BIB_GenHMAC (BSLX_BIB_t *self, const BSL_Data_t *ippt_data)
 Performs the actual HMAC over the given IPPT, placing the result in hmac_result.
 
int BSLX_BIB_Execute (BSL_LibCtx_t *lib, BSL_BundleRef_t *bundle, const BSL_SecOper_t *sec_oper, BSL_SecOutcome_t *sec_outcome)
 

Detailed Description

Header for the implementation of an example default security context (RFC 9173).

Note the prefix "xdefsc" means "Example Default Security Context".

Function Documentation

◆ BSLX_BCB_Validate()

bool BSLX_BCB_Validate ( BSL_LibCtx_t *  lib,
const BSL_BundleRef_t bundle,
const BSL_SecOper_t *  sec_oper 
)

◆ BSLX_BIB_Deinit()

◆ BSLX_BIB_Execute()

◆ BSLX_BIB_GenHMAC()

int BSLX_BIB_GenHMAC ( BSLX_BIB_t self,
const BSL_Data_t ippt_data 
)

◆ BSLX_BIB_GenIPPT()

int BSLX_BIB_GenIPPT ( const BSLX_BIB_t self,
BSL_Data_t ippt_space 
)

◆ BSLX_BIB_InitFromSecOper()

◆ BSLX_BIB_Validate()

bool BSLX_BIB_Validate ( BSL_LibCtx_t *  lib,
const BSL_BundleRef_t bundle,
const BSL_SecOper_t *  sec_oper 
)

◆ map_rfc9173_sha_variant_to_crypto()

static ssize_t map_rfc9173_sha_variant_to_crypto ( size_t  rfc9173_sha_variant)
static

Provides the mapping from the security-context-specific ID defined in RFC9173 to the local ID of the SHA variant used by the crypto engine (OpenSSL).

References BSL_CRYPTO_SHA_256, BSL_CRYPTO_SHA_384, BSL_CRYPTO_SHA_512, BSL_ERR_PROPERTY_CHECK_FAILED, BSL_LOG_DEBUG, BSL_LOG_ERR, RFC9173_BIB_SHA_HMAC256, RFC9173_BIB_SHA_HMAC384, and RFC9173_BIB_SHA_HMAC512.

Referenced by BSLX_BIB_InitFromSecOper().