36 CHK_ARG_NONNULL(self);
38 CHK_ARG_EXPR(value.
ptr != NULL);
39 CHK_ARG_EXPR(value.
len > 0);
40 CHK_ARG_EXPR(value.
len <
sizeof(self->
_bytes) - 1);
42 memset(self, 0,
sizeof(*self));
53 CHK_ARG_NONNULL(self);
55 memset(self, 0,
sizeof(*self));
65 CHK_ARG_NONNULL(self);
71 ASSERT_ARG_NONNULL(self);
79 CHK_ARG_NONNULL(result);
94 CHK_AS_BOOL(self != NULL);
@ BSL_SECPARAM_TYPE_INT_STARTINDEX
Do not use. Indicates start index of internal param ids.
@ BSL_SECPARAM_TYPE_BYTESTR
Indicates the value type is a byte string.
@ BSL_SECPARAM_TYPE_INT64
Indicates value type is an unsigned integer.
@ BSL_SECPARAM_TYPE_UNKNOWN
Inidcates parsed value not of expected type.
struct BSL_SecParam_s BSL_SecParam_t
Represents a security parameter in an ASB as defined in RFC9172.
@ BSL_SUCCESS
Placeholder for non-error code.
int BSL_SecParam_IsInt64(const BSL_SecParam_t *self)
Returns true when the value type is an integer.
int BSL_SecParam_GetAsBytestr(const BSL_SecParam_t *self, BSL_Data_t *result)
Retrieve bytestring value of result when security parameter type is 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.
int BSL_SecParam_InitBytestr(BSL_SecParam_t *self, uint64_t param_id, BSL_Data_t value)
Initialize as a parameter containing a bytestring.
uint64_t BSL_SecParam_GetId(const BSL_SecParam_t *self)
Get parameter ID of this param.
size_t BSL_SecParam_Sizeof(void)
Return size of BSL_SecParam_t struct type.
bool BSL_SecParam_IsParamIDOutput(uint64_t param_id)
Indicates true when this parameter is NOT an implementation-specific security paramter.
uint64_t BSL_SecParam_GetAsUInt64(const BSL_SecParam_t *self)
Retrieve integer value of result when this result type is integer.
bool BSL_SecParam_IsConsistent(const BSL_SecParam_t *self)
Return true if invariant conditions pass.
Defines the RFC 9172 Security Parameter of the Abstract Security Block.
int BSL_Data_InitView(BSL_Data_t *data, size_t len, const BSL_DataPtr_t src)
Initialize a data struct as an overlay on optional external data.
Heap data storage and views.
size_t len
Size of the data buffer.
BSL_DataPtr_t ptr
Pointer to the front of the buffer.
uint8_t _bytes[BSL_DEFAULT_BYTESTR_LEN+1]
Private. When a bytestring, this field is set, with the _bytelen set accordingly.
enum BSL_SecParam_Types_e _type
Private. Indicates whether this is an integer or bytestring.
uint64_t param_id
Parameter ID.
uint64_t _uint_value
Private. When an integer, this field is populated with the correct value.