BSL v0.0.0 - 0.geda3e66
AMMOS Bundle Protocol Security Library (BSL)
|
Specific low-level tests of the Default Security Context. More...
#include <stdlib.h>
#include <stdio.h>
#include <unity.h>
#include <BPSecLib_Private.h>
#include <mock_bpa/MockBPA.h>
#include <CryptoInterface.h>
#include <backend/PublicInterfaceImpl.h>
#include <security_context/DefaultSecContext.h>
#include <security_context/DefaultSecContext_Private.h>
#include <security_context/rfc9173.h>
#include "bsl_test_utils.h"
Functions | |
void | suiteSetUp (void) |
int | suiteTearDown (int failures) |
void | setUp (void) |
void | tearDown (void) |
void | test_RFC9173_AppendixA_Example1_BIB_Source (void) |
Purpose: Exercise BIB applying security to a target payload block. | |
void | test_RFC9173_AppendixA_Example2_BCB_Source (void) |
Purpose: Exercise BCB applying security to a target payload block. | |
void | test_RFC9173_AppendixA_Example2_BCB_Acceptor (void) |
Variables | |
static BSL_TestContext_t | LocalTestCtx |
Specific low-level tests of the Default Security Context.
Notes:
void test_RFC9173_AppendixA_Example1_BIB_Source | ( | void | ) |
Purpose: Exercise BIB applying security to a target payload block.
Steps:
Notes:
Confirm running BIB as source executes without error
Confirm it produced only 1 result
Confirm the context and result result is the right ID (Defined in RFC)
Confirm the actual HMAC signature matches what is in the RFC
References BSL_CALLOC, BSL_Crypto_SetRngGenerator(), BSL_FREE, BSL_SecOper_Deinit(), BSL_SECROLE_SOURCE, BSL_SUCCESS, and mock_bpa_ctr_t::bundle_ref.
void test_RFC9173_AppendixA_Example2_BCB_Acceptor | ( | void | ) |
Confirm that BCB executes with SUCCESS
Confirm that running as ACCEPTOR consumes result.
Confirm that the target block is decrypted correctly.
References BSL_BundleCtx_GetBlockMetadata(), BSL_CALLOC, BSL_FREE, BSL_Log_DumpAsHexString(), BSL_LOG_INFO, BSL_SecOper_Deinit(), BSL_SECROLE_ACCEPTOR, BSL_SUCCESS, BSL_CanonicalBlock_t::btsd, BSL_CanonicalBlock_t::btsd_len, and mock_bpa_ctr_t::bundle_ref.
void test_RFC9173_AppendixA_Example2_BCB_Source | ( | void | ) |
Purpose: Exercise BCB applying security to a target payload block.
Steps:
Notes:
References BSL_BundleCtx_GetBlockMetadata(), BSL_CALLOC, BSL_Crypto_SetRngGenerator(), BSL_FREE, BSL_Log_DumpAsHexString(), BSL_LOG_INFO, BSL_SecOper_Deinit(), BSL_SECROLE_SOURCE, BSL_SUCCESS, BSL_CanonicalBlock_t::btsd, BSL_CanonicalBlock_t::btsd_len, mock_bpa_ctr_t::bundle_ref, and RFC9173_BCB_RESULTID_AUTHTAG.