|
BSL v1.0.0 - 4.g1b6a605
AMMOS Bundle Protocol Security Library (BSL)
|
Implementation of a RFC9172 Parameter. More...
#include "SecParam.h"
Include dependency graph for SecParam.c:Functions | |
| size_t | BSL_SecParam_Sizeof (void) |
| Return size of BSL_SecParam_s struct type. | |
| void | BSL_SecParam_Init (BSL_SecParam_t *self) |
| Initialize to a default empty state. | |
| void | BSL_SecParam_InitSet (BSL_SecParam_t *self, const BSL_SecParam_t *src) |
| Initialize to a copy of another value. | |
| void | BSL_SecParam_Deinit (BSL_SecParam_t *self) |
| De-initialize a parameter. | |
| void | BSL_SecParam_Set (BSL_SecParam_t *self, const BSL_SecParam_t *src) |
| Overwrite with a copy of another value. | |
| int | BSL_SecParam_InitTextstr (BSL_SecParam_t *self, uint64_t param_id, const char *value) |
| Initialize as a parameter containing a byte string with a null-terminated text value. | |
| int | BSL_SecParam_InitBytestr (BSL_SecParam_t *self, uint64_t param_id, BSL_Data_t value) |
| Initialize as a parameter containing a bytestring. | |
| int | BSL_SecParam_InitInt64 (BSL_SecParam_t *self, uint64_t param_id, uint64_t value) |
| Initialize as a parameter containing an integer as a value. | |
| bool | BSL_SecParam_IsInt64 (const BSL_SecParam_t *self) |
| Returns true when the value type is an integer. | |
| uint64_t | BSL_SecParam_GetAsUInt64 (const BSL_SecParam_t *self) |
| Retrieve integer value of result when this result type is integer. | |
| bool | BSL_SecParam_IsBytestr (const BSL_SecParam_t *self) |
| Returns true when the value type is a byte string. | |
| int | BSL_SecParam_GetAsBytestr (const BSL_SecParam_t *self, BSL_Data_t *out) |
| Retrieve byte string value of a parameter. | |
| int | BSL_SecParam_GetAsTextstr (const BSL_SecParam_t *self, const char **out) |
| Retrieve bytestring value of result when security parameter type is bytestring. | |
| uint64_t | BSL_SecParam_GetId (const BSL_SecParam_t *self) |
| Get parameter ID of this param. | |
| bool | BSL_SecParam_IsConsistent (const BSL_SecParam_t *self) |
| Return true if invariant conditions pass. | |
| bool | BSL_SecParam_IsParamIDOutput (uint64_t param_id) |
| Indicates true when this parameter is NOT an implementation-specific security parameter. | |
Implementation of a RFC9172 Parameter.
| void BSL_SecParam_Deinit | ( | BSL_SecParam_t * | self | ) |
De-initialize a parameter.
| [in,out] | self | The object to deinitialize. |
Referenced by BSL_AbsSecBlock_DecodeFromCBOR(), and test_SecurityContext_BIB_Verifier_Failure().
| int BSL_SecParam_GetAsBytestr | ( | const BSL_SecParam_t * | self, |
| BSL_Data_t * | out | ||
| ) |
Retrieve byte string value of a parameter.
| [in] | self | This Security Parameter |
| [out] | out | Pointer to data struct which will be made a view onto this parameter value. |
References BSL_Data_InitView(), BSL_SecParam_IsConsistent(), and BSL_SECPARAM_TYPE_BYTESTR.
Referenced by BSL_AbsSecBlock_EncodeToCBOR(), and BSLX_BIB_InitFromSecOper().
| int BSL_SecParam_GetAsTextstr | ( | const BSL_SecParam_t * | self, |
| const char ** | out | ||
| ) |
Retrieve bytestring value of result when security parameter type is bytestring.
| [in] | self | This Security Parameter |
| [in,out] | out | Pointer to data struct which will be made a view onto this parameter value. |
References BSL_SecParam_IsConsistent(), BSL_SECPARAM_TYPE_TEXTSTR, and BSL_SUCCESS.
Referenced by BSLX_BIB_InitFromSecOper().
| uint64_t BSL_SecParam_GetAsUInt64 | ( | const BSL_SecParam_t * | self | ) |
Retrieve integer value of result when this result type is integer.
| [in] | self | This Security Parameter |
References BSL_SECPARAM_TYPE_INT64.
Referenced by BSL_AbsSecBlock_EncodeToCBOR(), and BSLX_BIB_InitFromSecOper().
| uint64_t BSL_SecParam_GetId | ( | const BSL_SecParam_t * | self | ) |
Get parameter ID of this param.
| [in] | self | This BPSec Param type |
References BSL_SecParam_IsConsistent().
Referenced by BSL_AbsSecBlock_EncodeToCBOR(), BSLX_BIB_InitFromSecOper(), and test_SecurityContext_BIB_Verifier_Failure().
| void BSL_SecParam_Init | ( | BSL_SecParam_t * | self | ) |
Initialize to a default empty state.
| [out] | self | The object to initialize. |
Referenced by BSL_SecParam_InitSet().
| int BSL_SecParam_InitBytestr | ( | BSL_SecParam_t * | self, |
| uint64_t | param_id, | ||
| BSL_Data_t | value | ||
| ) |
Initialize as a parameter containing a bytestring.
| [in,out] | self | This Security Parameter |
| [in] | param_id | ID of the parameter |
| [in] | value | View of bytes, which get copied into this Security Parameter. |
References BSL_SECPARAM_TYPE_BYTESTR, BSL_SUCCESS, BSL_Data_t::len, and BSL_Data_t::ptr.
Referenced by BSL_AbsSecBlock_DecodeFromCBOR().
| int BSL_SecParam_InitInt64 | ( | BSL_SecParam_t * | self, |
| uint64_t | param_id, | ||
| uint64_t | value | ||
| ) |
Initialize as a parameter containing an integer as a value.
| [in,out] | self | This Security Parameter |
| [in] | param_id | ID of the parameter |
| [in] | value | View of bytes, which get copied into this Security Parameter. |
References BSL_SECPARAM_TYPE_INT64, and BSL_SUCCESS.
Referenced by BSL_AbsSecBlock_DecodeFromCBOR(), and mock_bpa_register_policy_from_json().
| void BSL_SecParam_InitSet | ( | BSL_SecParam_t * | self, |
| const BSL_SecParam_t * | src | ||
| ) |
Initialize to a copy of another value.
| [out] | self | The object to initialize. |
| [in] | src | The source of the copy. |
References BSL_SecParam_Init(), and BSL_SecParam_Set().
| int BSL_SecParam_InitTextstr | ( | BSL_SecParam_t * | self, |
| uint64_t | param_id, | ||
| const char * | value | ||
| ) |
Initialize as a parameter containing a byte string with a null-terminated text value.
| [in,out] | self | This Security Parameter |
| [in] | param_id | ID of the parameter |
| [in] | value | text string of the parameter, copied into self |
References BSL_SECPARAM_TYPE_TEXTSTR, and BSL_SUCCESS.
Referenced by mock_bpa_register_policy_from_json(), and test_SecurityContext_BIB_Verifier_Failure().
| bool BSL_SecParam_IsBytestr | ( | const BSL_SecParam_t * | self | ) |
Returns true when the value type is a byte string.
| [in] | self | This Security Parameter |
References BSL_SECPARAM_TYPE_BYTESTR.
Referenced by BSL_AbsSecBlock_EncodeToCBOR(), and BSL_AbsSecBlock_Print().
| bool BSL_SecParam_IsConsistent | ( | const BSL_SecParam_t * | self | ) |
Return true if invariant conditions pass.
| [in] | self | This security parameter |
References BSL_SECPARAM_TYPE_INT64, BSL_SECPARAM_TYPE_TEXTSTR, and BSL_SECPARAM_TYPE_UNKNOWN.
Referenced by BSL_SecOper_AppendParam(), BSL_SecOutcome_AppendParam(), BSL_SecParam_GetAsBytestr(), BSL_SecParam_GetAsTextstr(), BSL_SecParam_GetId(), BSLP_PolicyRule_CopyParam(), and BSLP_PolicyRule_MoveParam().
| bool BSL_SecParam_IsInt64 | ( | const BSL_SecParam_t * | self | ) |
Returns true when the value type is an integer.
| [in] | self | This Security Parameter |
References BSL_SECPARAM_TYPE_INT64.
Referenced by BSL_AbsSecBlock_EncodeToCBOR(), BSL_AbsSecBlock_Print(), and BSLX_BIB_InitFromSecOper().
| bool BSL_SecParam_IsParamIDOutput | ( | uint64_t | param_id | ) |
Indicates true when this parameter is NOT an implementation-specific security parameter.
| param_id | ID of the parameter |
References BSL_SECPARAM_TYPE_INT_STARTINDEX.
| void BSL_SecParam_Set | ( | BSL_SecParam_t * | self, |
| const BSL_SecParam_t * | src | ||
| ) |
Overwrite with a copy of another value.
| [in,out] | self | The object to overwrite. |
| [in] | src | The source of the copy. |
Referenced by BSL_SecParam_InitSet().