BSL v1.1.1 - 19.g31939de
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
DefaultScUtils.h File Reference
#include <m-string.h>
#include <backend/PublicInterfaceImpl.h>
#include <backend/SecOperation.h>
#include <backend/IdValPair.h>
#include <backend/SecurityActionSet.h>
#include <mock_bpa/ctr.h>
#include "TestUtils.h"
+ Include dependency graph for DefaultScUtils.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  BIBTestContext
 
struct  BCBTestContext
 
struct  RFC9173_TestVectors_AppendixA1
 Hard-coded single struct with fields populated from test vector in Appendix A1 for BIB. More...
 
struct  RFC9173_TestVectorsA2
 
struct  RFC9173_TestVectors_A4_Modified
 
struct  RFC9173_A1_Params
 
struct  RFC9173_AppendixA2_BCB
 

Macros

#define RFC9173_EXAMPLE_A1_KEY   "9100"
 Key ID for the Appendix A1 key in OpenSSL.
 
#define RFC9173_EXAMPLE_A2_KEY   "9102"
 Key ID for the Appendix A2 key in OpenSSL.
 
#define RFC9173_EXAMPLE_A3_KEY   "9103"
 Key ID for the Appendix A3 key in OpenSSL.
 
#define RFC9173_EXAMPLE_A4_BCB_KEY   "9104"
 Key ID for the Appendix A4 key in OpenSSL.
 
#define BSL_SAMPLE_PP_ID   1
 Sample policy provider ID.
 
#define BSL_SAMPLE_PP_ID_2   2
 

Functions

void BIBTestContext_Init (BIBTestContext *obj)
 
void BIBTestContext_Deinit (BIBTestContext *obj)
 
void BSL_TestUtils_InitBIB_AppendixA1 (BIBTestContext *context, BSL_SecRole_e role, const char *key_id)
 
void BCBTestContext_Init (BCBTestContext *obj)
 
void BCBTestContext_Deinit (BCBTestContext *obj)
 
void BSL_TestUtils_InitBCB_Appendix2 (BCBTestContext *context, BSL_SecRole_e role)
 
RFC9173_A1_Params BSL_TestUtils_GetRFC9173_A1Params (const char *key_id)
 
RFC9173_A1_Params BSL_TestUtils_GetRFC9173_A2Params (const char *key_id)
 
BSL_SecurityActionSet_t * BSL_TestUtils_InitMallocBIBActionSet (BIBTestContext *bib_context)
 
BSL_SecurityResponseSet_t * BSL_TestUtils_MallocEmptyPolicyResponse (void)
 
void BSL_TestUtils_SetupDefaultSecurityContext (BSL_LibCtx_t *bsl_lib)
 
int rfc9173_byte_gen_fn_a1 (unsigned char *buf, int len)
 
int rfc9173_byte_gen_fn_a2_kek (unsigned char *buf, int len)
 
int rfc9173_byte_gen_fn_a2_cek (unsigned char *buf, int len)
 
int rfc9173_byte_gen_fn_a4 (unsigned char *buf, int len)
 

Variables

static const uint8_t ApxA2_InitVec [] = { 0x54, 0x77, 0x65, 0x6c, 0x76, 0x65, 0x31, 0x32, 0x31, 0x32, 0x31, 0x32 }
 
static const uint8_t ApxA2_AuthTag []
 
static const uint8_t ApxA2_KeyEncKey []
 
static const uint8_t ApxA2_ContentEncKey []
 
static const uint8_t ApxA2_Ciphertext []
 
static const uint8_t ApxA2_WrappedKey []
 
static const uint8_t ApxA2_PayloadData []
 
const struct RFC9173_TestVectors_AppendixA1 RFC9173_TestVectors_AppendixA1
 
const struct RFC9173_TestVectorsA2 RFC9173_TestVectors_AppendixA2
 
const struct RFC9173_TestVectors_A4_Modified RFC9173_TestVectors_AppendixA4
 

Macro Definition Documentation

◆ BSL_SAMPLE_PP_ID

#define BSL_SAMPLE_PP_ID   1

Sample policy provider ID.

◆ BSL_SAMPLE_PP_ID_2

#define BSL_SAMPLE_PP_ID_2   2

◆ RFC9173_EXAMPLE_A1_KEY

#define RFC9173_EXAMPLE_A1_KEY   "9100"

Key ID for the Appendix A1 key in OpenSSL.

◆ RFC9173_EXAMPLE_A2_KEY

#define RFC9173_EXAMPLE_A2_KEY   "9102"

Key ID for the Appendix A2 key in OpenSSL.

◆ RFC9173_EXAMPLE_A3_KEY

#define RFC9173_EXAMPLE_A3_KEY   "9103"

Key ID for the Appendix A3 key in OpenSSL.

◆ RFC9173_EXAMPLE_A4_BCB_KEY

#define RFC9173_EXAMPLE_A4_BCB_KEY   "9104"

Key ID for the Appendix A4 key in OpenSSL.

Function Documentation

◆ BCBTestContext_Deinit()

◆ BCBTestContext_Init()

◆ BIBTestContext_Deinit()

◆ BIBTestContext_Init()

◆ BSL_TestUtils_GetRFC9173_A1Params()

◆ BSL_TestUtils_GetRFC9173_A2Params()

RFC9173_A1_Params BSL_TestUtils_GetRFC9173_A2Params ( const char *  key_id)

◆ BSL_TestUtils_InitBCB_Appendix2()

◆ BSL_TestUtils_InitBIB_AppendixA1()

◆ BSL_TestUtils_InitMallocBIBActionSet()

◆ BSL_TestUtils_MallocEmptyPolicyResponse()

◆ BSL_TestUtils_SetupDefaultSecurityContext()

◆ rfc9173_byte_gen_fn_a1()

int rfc9173_byte_gen_fn_a1 ( unsigned char *  buf,
int  len 
)

◆ rfc9173_byte_gen_fn_a2_cek()

int rfc9173_byte_gen_fn_a2_cek ( unsigned char *  buf,
int  len 
)

◆ rfc9173_byte_gen_fn_a2_kek()

int rfc9173_byte_gen_fn_a2_kek ( unsigned char *  buf,
int  len 
)

References buf.

◆ rfc9173_byte_gen_fn_a4()

int rfc9173_byte_gen_fn_a4 ( unsigned char *  buf,
int  len 
)

Variable Documentation

◆ ApxA2_AuthTag

const uint8_t ApxA2_AuthTag[]
static
Initial value:
= { 0xef, 0xa4, 0xb5, 0xac, 0x01, 0x08, 0xe3, 0x81,
0x6c, 0x56, 0x06, 0x47, 0x98, 0x01, 0xbc, 0x04 }

Referenced by test_RFC9173_AppendixA_Example2_BCB_Source().

◆ ApxA2_Ciphertext

const uint8_t ApxA2_Ciphertext[]
static
Initial value:
= { 0x3a, 0x09, 0xc1, 0xe6, 0x3f, 0xe2, 0x3a, 0x7f, 0x66, 0xa5, 0x9c, 0x73,
0x03, 0x83, 0x72, 0x41, 0xe0, 0x70, 0xb0, 0x26, 0x19, 0xfc, 0x59, 0xc5,
0x21, 0x4a, 0x22, 0xf0, 0x8c, 0xd7, 0x07, 0x95, 0xe7, 0x3e, 0x9a }

Referenced by test_RFC9173_AppendixA_Example2_BCB_Source().

◆ ApxA2_ContentEncKey

const uint8_t ApxA2_ContentEncKey[]
static
Initial value:
= { 0x71, 0x77, 0x65, 0x72, 0x74, 0x79, 0x75, 0x69,
0x6f, 0x70, 0x61, 0x73, 0x64, 0x66, 0x67, 0x68 }

◆ ApxA2_InitVec

const uint8_t ApxA2_InitVec[] = { 0x54, 0x77, 0x65, 0x6c, 0x76, 0x65, 0x31, 0x32, 0x31, 0x32, 0x31, 0x32 }
static

Referenced by setUp().

◆ ApxA2_KeyEncKey

const uint8_t ApxA2_KeyEncKey[]
static
Initial value:
= { 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70 }

◆ ApxA2_PayloadData

const uint8_t ApxA2_PayloadData[]
static
Initial value:
= { 0x52, 0x65, 0x61, 0x64, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x6e,
0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x33, 0x32, 0x2d, 0x62,
0x79, 0x74, 0x65, 0x20, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64 }

Referenced by test_RFC9173_AppendixA_Example2_BCB_Acceptor().

◆ ApxA2_WrappedKey

const uint8_t ApxA2_WrappedKey[]
static
Initial value:
= { 0x69, 0xc4, 0x11, 0x27, 0x6f, 0xec, 0xdd, 0xc4, 0x78, 0x0d, 0xf4, 0x2c,
0x8a, 0x2a, 0xf8, 0x92, 0x96, 0xfa, 0xbf, 0x34, 0xd7, 0xfa, 0xe7, 0x00 }

Referenced by setUp().

◆ RFC9173_TestVectors_AppendixA1

◆ RFC9173_TestVectors_AppendixA2

const struct RFC9173_TestVectorsA2 RFC9173_TestVectors_AppendixA2

◆ RFC9173_TestVectors_AppendixA4

const struct RFC9173_TestVectors_A4_Modified RFC9173_TestVectors_AppendixA4