|
BSL v1.1.1 - 39.g9f43410
AMMOS Bundle Protocol Security Library (BSL)
|
Specific low-level tests of the COSE Context. More...
#include "TestUtils.h"#include <bsl/BPSecLib_Private.h>#include <bsl/crypto/CryptoInterface.h>#include <bsl/dynamic/PublicInterfaceImpl.h>#include <bsl/cose_sc/CoseContext.h>#include <bsl/cose_sc/CoseMsg.h>#include <bsl/mock_bpa/MockBPA.h>#include <stdio.h>#include <stdlib.h>#include <unity.h>
Include dependency graph for test_CoseContext.c:Variables | |
| static BSL_TestContext_t | LocalTestCtx |
| static const char * | exA_nosec |
| Common input bundle from Appendix A. | |
| static const char * | exA_1_kid = "ExampleA.1" |
| Key ID for Example A.1. | |
| static const char * | exA_1_sk |
| Symmetric key for Example A.1. | |
| static const char * | exA_1_mac0 |
| Result bundle for Example A.1. | |
| static const char * | ccsds_mac_nosec |
| Common input bundle for CCSDS/ESA. | |
| static const char * | ccsds_mac_kid = "ExampleA.5" |
| static const char * | ccsds_mac_sk = "0e8a982b921d1086241798032fedc1f883eab72e4e43bb2d11cfae38ad7a972e" |
| Symmetric key for test. | |
| static const char * | ccsds_mac_bib |
| Result bundle for test. | |
| static const char * | exA_4_kid = "ExampleA.4" |
| static const char * | exA_4_sk |
| Symmetric key for Example A.4. | |
| static const char * | exA_4_biv = "6f3093eba5d85143c3dc0000" |
| Base IV for Example A.4. | |
| static const char * | exA_4_enc0 |
| Result bundle for Example A.4 with different BCB block flags. | |
| static const char * | exA_5_kid = "ExampleA.5" |
| static const char * | exA_5_sk = "0e8a982b921d1086241798032fedc1f883eab72e4e43bb2d11cfae38ad7a972e" |
| Symmetric key for Example A.5. | |
| static const char * | exA_5_enc |
| Result bundle for Example A.5 with different BCB block flags. | |
| static const char * | exA_6_kid = "ExampleA.6" |
| static const char * | exA_6_sk = "6c4e5271e211e0c8329ab8f363097f16516a459f12a4060cf0164968fdccbd63" |
| Symmetric key for Example A.6. | |
| static const char * | exA_6_enc |
| Result bundle for Example A.6 with different BCB block flags. | |
Specific low-level tests of the COSE Context.
Notes:
| enum OptMismatch_e |
|
static |
References BSL_Data_Deinit(), BSL_Data_Init(), BSL_TestUtils_DecodeBase16_cstr(), BSL_Data_t::len, BSL_Data_t::ptr, and TEST_ASSERT_EQUAL().
Referenced by test_CCSDS_Example_Mac_Source().
|
static |
References BSL_Data_Deinit(), BSL_Data_Init(), BSL_TestUtils_DecodeBase16_cstr(), BSL_Data_t::len, BSL_Data_t::ptr, and TEST_ASSERT_EQUAL().
Referenced by test_AppendixA_Example5_BCB_Source().
|
static |
References BSL_Data_Deinit(), BSL_Data_Init(), BSL_TestUtils_DecodeBase16_cstr(), BSL_Data_t::len, BSL_Data_t::ptr, and TEST_ASSERT_EQUAL().
Referenced by test_AppendixA_Example6_BCB_Source().
|
static |
valid starting point
References BSL_DATA_INIT_VIEW_CSTR, BSL_IdValPair_Deinit(), BSL_IdValPair_Init(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_SecOper_AppendOption(), BSLX_COSEMSG_ALG_HMAC_SHA_384_384, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, and keyid.
Referenced by test_CoseSc_InvalidOptions_Source().
| void setUp | ( | void | ) |
References BSL_CryptoInit(), BSL_TestContext_Init(), LocalTestCtx, and TEST_ASSERT_EQUAL().
| void suiteSetUp | ( | void | ) |
| int suiteTearDown | ( | int | failures | ) |
References BSL_HostDescriptors_Clear(), and mock_bpa_LogClose().
| void tearDown | ( | void | ) |
References BSL_CryptoDeinit(), BSL_TestContext_Deinit(), LocalTestCtx, and TEST_ASSERT_EQUAL().
| void test_AppendixA_Example1_BIB_Source | ( | void | ) |
Purpose: Exercise BIB applying security to a target payload block.
Steps:
References BSL_TestContext_t::bsl, BSL_CBOR_Decode(), BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_ExecBIBSource(), BSL_IdValPair_Deinit(), BSL_IdValPair_GetAsBytestr(), BSL_IdValPair_GetId(), BSL_IdValPair_Init(), BSL_IdValPair_IsBytestr(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_AppendOption(), BSL_SecOper_CountResults(), BSL_SecOper_Deinit(), BSL_SecOper_FindResult(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_SOURCE, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_HMAC_SHA_384_384, BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_CoseMsg_Mac0_Decode(), BSLX_CoseMsg_Mac0_Deinit(), BSLX_CoseMsg_Mac0_Init(), BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_COSESC_RESULT_COSE_MAC0, BSLX_CoseSc_Validate(), mock_bpa_ctr_t::bundle_ref, mock_bpa_ctr_t::encoded, exA_1_kid, exA_1_mac0, exA_1_sk, exA_nosec, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_AppendixA_Example1_BIB_VerifyAccept | ( | BSL_SecRole_e | role, |
| int | mismatch | ||
| ) |
References MockBPA_Bundle_t::blocks_num, BSL_TestContext_t::bsl, BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_Data_InitView(), BSL_ERR_SECURITY_OPERATION_FAILED, BSL_ExecBIBVerifierAcceptor(), BSL_IdValPair_Deinit(), BSL_IdValPair_Init(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_AppendOption(), BSL_SecOper_Deinit(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_HMAC_SHA_256_256, BSLX_COSEMSG_ALG_HMAC_SHA_384_384, BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ALG, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_CoseSc_Validate(), MockBPA_CanonicalBlock_t::btsd, MockBPA_CanonicalBlock_t::btsd_len, mock_bpa_ctr_t::bundle, mock_bpa_ctr_t::bundle_ref, MockBPA_PrimaryBlock_t::encoded, mock_bpa_ctr_t::encoded, exA_1_kid, exA_1_mac0, exA_1_sk, exA_nosec, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, OPT_MISMATCH_BAD_KEY_ID, OPT_MISMATCH_KEY_ALG, OPT_MISMATCH_MODIFY_BLK_0, OPT_MISMATCH_MODIFY_BLK_1, OPT_MISMATCH_MODIFY_BLK_3, OPT_MISMATCH_NO_AAD_SCOPE, OPT_MISMATCH_NONE, OPT_MISMATCH_TGT_ALG, MockBPA_Bundle_t::primary_block, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_AppendixA_Example4_BCB_Source | ( | void | ) |
References BSL_TestContext_t::bsl, BSL_CBOR_Decode(), BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_ExecBCBSource(), BSL_IdValPair_Deinit(), BSL_IdValPair_GetAsBytestr(), BSL_IdValPair_GetId(), BSL_IdValPair_Init(), BSL_IdValPair_IsBytestr(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BCB, BSL_SecOper_AppendOption(), BSL_SecOper_CountResults(), BSL_SecOper_Deinit(), BSL_SecOper_FindResult(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_SOURCE, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_GCM_256, BSLX_CoseMsg_Encrypt0_Decode(), BSLX_CoseMsg_Encrypt0_Deinit(), BSLX_CoseMsg_Encrypt0_Init(), BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_COSEMSG_KEY_PARAM_BASEIV, BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_IV_COUNTER_OFFSET, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_COSESC_RESULT_COSE_ENCRYPT0, BSLX_CoseSc_Validate(), mock_bpa_ctr_t::bundle_ref, mock_bpa_ctr_t::encoded, exA_4_biv, exA_4_enc0, exA_4_kid, exA_4_sk, exA_nosec, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_AppendixA_Example4_BCB_VerifyAccept | ( | BSL_SecRole_e | role, |
| int | mismatch | ||
| ) |
References MockBPA_Bundle_t::blocks_num, BSL_TestContext_t::bsl, BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_Data_InitView(), BSL_ERR_SECURITY_OPERATION_FAILED, BSL_ExecBCBVerifierAcceptor(), BSL_IdValPair_Deinit(), BSL_IdValPair_Init(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BCB, BSL_SecOper_AppendOption(), BSL_SecOper_Deinit(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_GCM_128, BSLX_COSEMSG_ALG_AES_GCM_256, BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_COSEMSG_KEY_PARAM_BASEIV, BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ALG, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_CoseSc_Validate(), MockBPA_CanonicalBlock_t::btsd, MockBPA_CanonicalBlock_t::btsd_len, mock_bpa_ctr_t::bundle, mock_bpa_ctr_t::bundle_ref, MockBPA_PrimaryBlock_t::encoded, mock_bpa_ctr_t::encoded, exA_4_biv, exA_4_enc0, exA_4_kid, exA_4_sk, exA_nosec, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, OPT_MISMATCH_BAD_KEY_ID, OPT_MISMATCH_KEY_ALG, OPT_MISMATCH_MODIFY_BLK_0, OPT_MISMATCH_MODIFY_BLK_1, OPT_MISMATCH_MODIFY_BLK_3, OPT_MISMATCH_NO_AAD_SCOPE, OPT_MISMATCH_NONE, OPT_MISMATCH_TGT_ALG, MockBPA_Bundle_t::primary_block, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_AppendixA_Example5_BCB_Source | ( | void | ) |
References BSL_TestContext_t::bsl, BSL_CBOR_Decode(), BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Crypto_SetRngGenerator(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_ExecBCBSource(), BSL_IdValPair_Deinit(), BSL_IdValPair_GetAsBytestr(), BSL_IdValPair_GetId(), BSL_IdValPair_Init(), BSL_IdValPair_IsBytestr(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BCB, BSL_SecOper_AppendOption(), BSL_SecOper_CountResults(), BSL_SecOper_Deinit(), BSL_SecOper_FindResult(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_SOURCE, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_GCM_256, BSLX_COSEMSG_ALG_AES_KW_256, BSLX_CoseMsg_Encrypt_Decode(), BSLX_CoseMsg_Encrypt_Deinit(), BSLX_CoseMsg_Encrypt_Init(), BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_COSESC_RESULT_COSE_ENCRYPT, BSLX_CoseSc_Validate(), mock_bpa_ctr_t::bundle_ref, cose_exA_5_rng(), mock_bpa_ctr_t::encoded, exA_5_enc, exA_5_kid, exA_5_sk, exA_nosec, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_AppendixA_Example5_BCB_VerifyAccept | ( | BSL_SecRole_e | role, |
| int | mismatch | ||
| ) |
References MockBPA_Bundle_t::blocks_num, BSL_TestContext_t::bsl, BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_Data_InitView(), BSL_ERR_SECURITY_OPERATION_FAILED, BSL_ExecBCBVerifierAcceptor(), BSL_IdValPair_Deinit(), BSL_IdValPair_Init(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BCB, BSL_SecOper_AppendOption(), BSL_SecOper_Deinit(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_GCM_128, BSLX_COSEMSG_ALG_AES_GCM_256, BSLX_COSEMSG_ALG_AES_KW_128, BSLX_COSEMSG_ALG_AES_KW_256, BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ALG, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_CoseSc_Validate(), MockBPA_CanonicalBlock_t::btsd, MockBPA_CanonicalBlock_t::btsd_len, mock_bpa_ctr_t::bundle, mock_bpa_ctr_t::bundle_ref, MockBPA_PrimaryBlock_t::encoded, mock_bpa_ctr_t::encoded, exA_5_enc, exA_5_kid, exA_5_sk, exA_nosec, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, OPT_MISMATCH_BAD_KEY_ID, OPT_MISMATCH_KEY_ALG, OPT_MISMATCH_MODIFY_BLK_0, OPT_MISMATCH_MODIFY_BLK_1, OPT_MISMATCH_MODIFY_BLK_3, OPT_MISMATCH_NO_AAD_SCOPE, OPT_MISMATCH_NONE, OPT_MISMATCH_TGT_ALG, MockBPA_Bundle_t::primary_block, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_AppendixA_Example6_BCB_Source | ( | void | ) |
References BSL_TestContext_t::bsl, BSL_CBOR_Decode(), BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Crypto_SetRngGenerator(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_ExecBCBSource(), BSL_IdValPair_Deinit(), BSL_IdValPair_GetAsBytestr(), BSL_IdValPair_GetId(), BSL_IdValPair_Init(), BSL_IdValPair_IsBytestr(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BCB, BSL_SecOper_AppendOption(), BSL_SecOper_CountResults(), BSL_SecOper_Deinit(), BSL_SecOper_FindResult(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_SOURCE, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_GCM_256, BSLX_COSEMSG_ALG_DIRECT_HKDF_SHA_512, BSLX_CoseMsg_Encrypt_Decode(), BSLX_CoseMsg_Encrypt_Deinit(), BSLX_CoseMsg_Encrypt_Init(), BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_SALT_LENGTH, BSLX_COSESC_OPTION_TGT_ALG, BSLX_COSESC_RESULT_COSE_ENCRYPT, BSLX_CoseSc_Validate(), mock_bpa_ctr_t::bundle_ref, cose_exA_6_rng(), mock_bpa_ctr_t::encoded, exA_6_enc, exA_6_kid, exA_6_sk, exA_nosec, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_CCSDS_Example_Mac_Source | ( | void | ) |
References BSL_TestContext_t::bsl, BSL_CBOR_Decode(), BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Crypto_SetRngGenerator(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_ExecBIBSource(), BSL_IdValPair_Deinit(), BSL_IdValPair_GetAsBytestr(), BSL_IdValPair_GetId(), BSL_IdValPair_Init(), BSL_IdValPair_IsBytestr(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_AppendOption(), BSL_SecOper_CountResults(), BSL_SecOper_Deinit(), BSL_SecOper_FindResult(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_SOURCE, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_KW_256, BSLX_COSEMSG_ALG_HMAC_SHA_384_384, BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_CoseMsg_Mac_Decode(), BSLX_CoseMsg_Mac_Deinit(), BSLX_CoseMsg_Mac_Init(), BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_COSESC_RESULT_COSE_MAC, BSLX_CoseSc_Validate(), mock_bpa_ctr_t::bundle_ref, ccsds_mac_bib, ccsds_mac_kid, ccsds_mac_nosec, ccsds_mac_rng(), ccsds_mac_sk, mock_bpa_ctr_t::encoded, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_CCSDS_Example_Mac_VerifyAccept | ( | BSL_SecRole_e | role, |
| int | mismatch | ||
| ) |
References MockBPA_Bundle_t::blocks_num, BSL_TestContext_t::bsl, BSL_CBOR_Encode_Twopass(), BSL_Crypto_AddRegistryKey(), BSL_Crypto_GetKeyStatistics(), BSL_CRYPTO_KEYSTATS_BYTES_PROCESSED, BSL_CRYPTO_KEYSTATS_TIMES_USED, BSL_Crypto_LoadKey(), BSL_Crypto_ReleaseKeyHandle(), BSL_Crypto_SetKeyParameter(), BSL_Data_Deinit(), BSL_Data_Init(), BSL_DATA_INIT_VIEW_CSTR, BSL_Data_InitView(), BSL_ERR_SECURITY_OPERATION_FAILED, BSL_ExecBCBVerifierAcceptor(), BSL_IdValPair_Deinit(), BSL_IdValPair_Init(), BSL_IdValPair_SetBytestr(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_AppendOption(), BSL_SecOper_Deinit(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_EncodeBundleToCBOR(), BSL_TestUtils_IsB16StrEqualTo(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_KW_128, BSLX_COSEMSG_ALG_AES_KW_256, BSLX_COSEMSG_ALG_HMAC_SHA_256_256, BSLX_COSEMSG_ALG_HMAC_SHA_384_384, BSLX_COSEMSG_KEY_PARAM_ALG, BSLX_CoseSc_AadScope_Encode(), BSLX_COSESC_CTX_ID, BSLX_CoseSc_Execute(), BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_KEY_ALG, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_CoseSc_Validate(), MockBPA_CanonicalBlock_t::btsd, MockBPA_CanonicalBlock_t::btsd_len, mock_bpa_ctr_t::bundle, mock_bpa_ctr_t::bundle_ref, ccsds_mac_bib, ccsds_mac_kid, ccsds_mac_nosec, ccsds_mac_sk, MockBPA_PrimaryBlock_t::encoded, mock_bpa_ctr_t::encoded, keyhandle, keyid, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, OPT_MISMATCH_BAD_KEY_ID, OPT_MISMATCH_KEY_ALG, OPT_MISMATCH_MODIFY_BLK_0, OPT_MISMATCH_MODIFY_BLK_1, OPT_MISMATCH_MODIFY_BLK_3, OPT_MISMATCH_NO_AAD_SCOPE, OPT_MISMATCH_NONE, OPT_MISMATCH_TGT_ALG, MockBPA_Bundle_t::primary_block, BSL_Data_t::ptr, BSL_Crypto_KeyStats_t::stats, TEST_ASSERT_EQUAL(), TEST_ASSERT_EQUAL_INT_MESSAGE(), and TEST_ASSERT_TRUE().
| void test_CoseSc_InvalidOptions_Source | ( | void | ) |
References BSL_TestContext_t::bsl, BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_Deinit(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_SOURCE, BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSESC_CTX_ID, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_CoseSc_Validate(), mock_bpa_ctr_t::bundle_ref, exA_nosec, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, set_CoseSc_InvalidOptions_Source_baseline(), TEST_ASSERT_EQUAL(), and TEST_ASSERT_TRUE().
| void test_CoseSc_InvalidOptions_Verifier | ( | void | ) |
References BSL_TestContext_t::bsl, BSL_Data_Deinit(), BSL_Data_Init(), BSL_IdValPair_Deinit(), BSL_IdValPair_Init(), BSL_IdValPair_SetInt64(), BSL_IdValPair_SetRaw(), BSL_IdValPair_SetTextstr(), BSL_POLICYACTION_DROP_BUNDLE, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_AppendOption(), BSL_SecOper_Deinit(), BSL_SecOper_Init(), BSL_SecOper_Populate(), BSL_SECROLE_VERIFIER, BSL_TestUtils_DecodeBase16_cstr(), BSL_TestUtils_LoadBundleFromCBOR(), BSLX_COSEMSG_ALG_AES_GCM_256, BSLX_COSESC_CTX_ID, BSLX_COSESC_OPTION_AAD_SCOPE, BSLX_COSESC_OPTION_IV_COUNTER_OFFSET, BSLX_COSESC_OPTION_KEY_ALG, BSLX_COSESC_OPTION_KEY_ID, BSLX_COSESC_OPTION_TGT_ALG, BSLX_CoseSc_Validate(), mock_bpa_ctr_t::bundle_ref, exA_nosec, BSL_Data_t::len, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSL_Data_t::ptr, TEST_ASSERT_EQUAL(), and TEST_ASSERT_TRUE().
|
static |
Result bundle for test.
Referenced by test_CCSDS_Example_Mac_Source(), and test_CCSDS_Example_Mac_VerifyAccept().
|
static |
Referenced by test_CCSDS_Example_Mac_Source(), and test_CCSDS_Example_Mac_VerifyAccept().
|
static |
Common input bundle for CCSDS/ESA.
Referenced by test_CCSDS_Example_Mac_Source(), and test_CCSDS_Example_Mac_VerifyAccept().
|
static |
Symmetric key for test.
Referenced by test_CCSDS_Example_Mac_Source(), and test_CCSDS_Example_Mac_VerifyAccept().
|
static |
Key ID for Example A.1.
Referenced by test_AppendixA_Example1_BIB_Source(), and test_AppendixA_Example1_BIB_VerifyAccept().
|
static |
Result bundle for Example A.1.
Referenced by test_AppendixA_Example1_BIB_Source(), and test_AppendixA_Example1_BIB_VerifyAccept().
|
static |
Symmetric key for Example A.1.
Referenced by test_AppendixA_Example1_BIB_Source(), and test_AppendixA_Example1_BIB_VerifyAccept().
|
static |
Base IV for Example A.4.
Referenced by test_AppendixA_Example4_BCB_Source(), and test_AppendixA_Example4_BCB_VerifyAccept().
|
static |
Result bundle for Example A.4 with different BCB block flags.
Referenced by test_AppendixA_Example4_BCB_Source(), and test_AppendixA_Example4_BCB_VerifyAccept().
|
static |
Referenced by test_AppendixA_Example4_BCB_Source(), and test_AppendixA_Example4_BCB_VerifyAccept().
|
static |
Symmetric key for Example A.4.
Referenced by test_AppendixA_Example4_BCB_Source(), and test_AppendixA_Example4_BCB_VerifyAccept().
|
static |
Result bundle for Example A.5 with different BCB block flags.
Referenced by test_AppendixA_Example5_BCB_Source(), and test_AppendixA_Example5_BCB_VerifyAccept().
|
static |
Referenced by test_AppendixA_Example5_BCB_Source(), and test_AppendixA_Example5_BCB_VerifyAccept().
|
static |
Symmetric key for Example A.5.
Referenced by test_AppendixA_Example5_BCB_Source(), and test_AppendixA_Example5_BCB_VerifyAccept().
|
static |
Result bundle for Example A.6 with different BCB block flags.
Referenced by test_AppendixA_Example6_BCB_Source().
|
static |
Referenced by test_AppendixA_Example6_BCB_Source().
|
static |
Symmetric key for Example A.6.
Referenced by test_AppendixA_Example6_BCB_Source().
|
static |
Common input bundle from Appendix A.
Referenced by test_AppendixA_Example1_BIB_Source(), test_AppendixA_Example1_BIB_VerifyAccept(), test_AppendixA_Example4_BCB_Source(), test_AppendixA_Example4_BCB_VerifyAccept(), test_AppendixA_Example5_BCB_Source(), test_AppendixA_Example5_BCB_VerifyAccept(), test_AppendixA_Example6_BCB_Source(), test_CoseSc_InvalidOptions_Source(), and test_CoseSc_InvalidOptions_Verifier().
|
static |
Referenced by setUp(), tearDown(), test_AppendixA_Example1_BIB_Source(), test_AppendixA_Example1_BIB_VerifyAccept(), test_AppendixA_Example4_BCB_Source(), test_AppendixA_Example4_BCB_VerifyAccept(), test_AppendixA_Example5_BCB_Source(), test_AppendixA_Example5_BCB_VerifyAccept(), test_AppendixA_Example6_BCB_Source(), test_CCSDS_Example_Mac_Source(), test_CCSDS_Example_Mac_VerifyAccept(), test_CoseSc_InvalidOptions_Source(), and test_CoseSc_InvalidOptions_Verifier().