Sets the global s2n_errno
to error
and returns with an S2N_RESULT_ERROR
Ensures the condition
is true
, otherwise the function will RESULT_BAIL
with error
Ensures the condition
is true
, otherwise the function will RESULT_BAIL
with error
NOTE: The condition will only be checked when the code is compiled in debug mode. In release mode, the check is removed.
Ensures s2n_result_is_ok(result)
, otherwise the function will RESULT_BAIL
with error
This can be useful for overriding the global s2n_errno
Ensures a
is greater than or equal to b
, otherwise the function will RESULT_BAIL
with a S2N_ERR_SAFETY
error
Ensures a
is less than or equal to b
, otherwise the function will RESULT_BAIL
with a S2N_ERR_SAFETY
error
Ensures a
is greater than b
, otherwise the function will RESULT_BAIL
with a S2N_ERR_SAFETY
error
Ensures a
is less than b
, otherwise the function will RESULT_BAIL
with a S2N_ERR_SAFETY
error
Ensures a
is equal to b
, otherwise the function will RESULT_BAIL
with a S2N_ERR_SAFETY
error
Ensures a
is not equal to b
, otherwise the function will RESULT_BAIL
with a S2N_ERR_SAFETY
error
Ensures min <= n <= max
, otherwise the function will RESULT_BAIL
with S2N_ERR_SAFETY
Ensures min < n < max
, otherwise the function will RESULT_BAIL
with S2N_ERR_SAFETY
Ensures x
is a readable reference, otherwise the function will RESULT_BAIL
with S2N_ERR_NULL
Ensures x
is a mutable reference, otherwise the function will RESULT_BAIL
with S2N_ERR_NULL
Ensures the result
is S2N_RESULT_OK
, otherwise the function will return an error signal
RESULT_PRECONDITION
should be used at the beginning of a function to make assertions about
the provided arguments. By default, it is functionally equivalent to RESULT_GUARD(result)
but can be altered by a testing environment to provide additional guarantees.
Ensures the result
is S2N_RESULT_OK
, otherwise the function will return an error signal
NOTE: The condition will only be checked when the code is compiled in debug mode. In release mode, the check is removed.
RESULT_POSTCONDITION
should be used at the end of a function to make assertions about
the resulting state. In debug mode, it is functionally equivalent to RESULT_GUARD(result)
.
In production builds, it becomes a no-op. This can also be altered by a testing environment
to provide additional guarantees.
Performs a safer memcpy.
The following checks are performed:
destination
is non-nullsource
is non-null
Callers will still need to ensure the following:
- The size of the data pointed to by both the
destination
andsource
parameters, shall be at leastlen
bytes.
Performs a safer memset
The following checks are performed:
destination
is non-null
Callers will still need to ensure the following:
- The size of the data pointed to by the
destination
parameter shall be at leastlen
bytes.
Ensures s2n_result_is_ok(result)
, otherwise the function will return S2N_RESULT_ERROR
Ensures result == _OSSL_SUCCESS
, otherwise the function will RESULT_BAIL
with error
Ensures (result) > S2N_FAILURE
, otherwise the function will return S2N_RESULT_ERROR
Ensures (result) != NULL
, otherwise the function will return S2N_RESULT_ERROR
Does not set s2n_errno to S2N_ERR_NULL, so is NOT a direct replacement for RESULT_ENSURE_REF.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Sets the global s2n_errno
to error
and returns with an S2N_FAILURE
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the condition
is true
, otherwise the function will POSIX_BAIL
with error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the condition
is true
, otherwise the function will POSIX_BAIL
with error
NOTE: The condition will only be checked when the code is compiled in debug mode. In release mode, the check is removed.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures (result) > S2N_FAILURE
, otherwise the function will POSIX_BAIL
with error
This can be useful for overriding the global s2n_errno
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is greater than or equal to b
, otherwise the function will POSIX_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is less than or equal to b
, otherwise the function will POSIX_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is greater than b
, otherwise the function will POSIX_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is less than b
, otherwise the function will POSIX_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is equal to b
, otherwise the function will POSIX_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is not equal to b
, otherwise the function will POSIX_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures min <= n <= max
, otherwise the function will POSIX_BAIL
with S2N_ERR_SAFETY
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures min < n < max
, otherwise the function will POSIX_BAIL
with S2N_ERR_SAFETY
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures x
is a readable reference, otherwise the function will POSIX_BAIL
with S2N_ERR_NULL
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures x
is a mutable reference, otherwise the function will POSIX_BAIL
with S2N_ERR_NULL
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the result
is S2N_RESULT_OK
, otherwise the function will return an error signal
POSIX_PRECONDITION
should be used at the beginning of a function to make assertions about
the provided arguments. By default, it is functionally equivalent to POSIX_GUARD_RESULT(result)
but can be altered by a testing environment to provide additional guarantees.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the result
is S2N_RESULT_OK
, otherwise the function will return an error signal
NOTE: The condition will only be checked when the code is compiled in debug mode. In release mode, the check is removed.
POSIX_POSTCONDITION
should be used at the end of a function to make assertions about
the resulting state. In debug mode, it is functionally equivalent to POSIX_GUARD_RESULT(result)
.
In production builds, it becomes a no-op. This can also be altered by a testing environment
to provide additional guarantees.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Performs a safer memcpy.
The following checks are performed:
destination
is non-nullsource
is non-null
Callers will still need to ensure the following:
- The size of the data pointed to by both the
destination
andsource
parameters, shall be at leastlen
bytes.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Performs a safer memset
The following checks are performed:
destination
is non-null
Callers will still need to ensure the following:
- The size of the data pointed to by the
destination
parameter shall be at leastlen
bytes.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures (result) > S2N_FAILURE
, otherwise the function will return S2N_FAILURE
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures result == _OSSL_SUCCESS
, otherwise the function will POSIX_BAIL
with error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures s2n_result_is_ok(result)
, otherwise the function will return S2N_FAILURE
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures (result) != NULL
, otherwise the function will return S2N_FAILURE
Does not set s2n_errno to S2N_ERR_NULL, so is NOT a direct replacement for POSIX_ENSURE_REF.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Sets the global s2n_errno
to error
and returns with an NULL
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the condition
is true
, otherwise the function will PTR_BAIL
with error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the condition
is true
, otherwise the function will PTR_BAIL
with error
NOTE: The condition will only be checked when the code is compiled in debug mode. In release mode, the check is removed.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures (result) != NULL
, otherwise the function will PTR_BAIL
with error
This can be useful for overriding the global s2n_errno
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is greater than or equal to b
, otherwise the function will PTR_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is less than or equal to b
, otherwise the function will PTR_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is greater than b
, otherwise the function will PTR_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is less than b
, otherwise the function will PTR_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is equal to b
, otherwise the function will PTR_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures a
is not equal to b
, otherwise the function will PTR_BAIL
with a S2N_ERR_SAFETY
error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures min <= n <= max
, otherwise the function will PTR_BAIL
with S2N_ERR_SAFETY
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures min < n < max
, otherwise the function will PTR_BAIL
with S2N_ERR_SAFETY
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures x
is a readable reference, otherwise the function will PTR_BAIL
with S2N_ERR_NULL
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures x
is a mutable reference, otherwise the function will PTR_BAIL
with S2N_ERR_NULL
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the result
is S2N_RESULT_OK
, otherwise the function will return an error signal
PTR_PRECONDITION
should be used at the beginning of a function to make assertions about
the provided arguments. By default, it is functionally equivalent to PTR_GUARD_RESULT(result)
but can be altered by a testing environment to provide additional guarantees.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures the result
is S2N_RESULT_OK
, otherwise the function will return an error signal
NOTE: The condition will only be checked when the code is compiled in debug mode. In release mode, the check is removed.
PTR_POSTCONDITION
should be used at the end of a function to make assertions about
the resulting state. In debug mode, it is functionally equivalent to PTR_GUARD_RESULT(result)
.
In production builds, it becomes a no-op. This can also be altered by a testing environment
to provide additional guarantees.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Performs a safer memcpy.
The following checks are performed:
destination
is non-nullsource
is non-null
Callers will still need to ensure the following:
- The size of the data pointed to by both the
destination
andsource
parameters, shall be at leastlen
bytes.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Performs a safer memset
The following checks are performed:
destination
is non-null
Callers will still need to ensure the following:
- The size of the data pointed to by the
destination
parameter shall be at leastlen
bytes.
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures (result) != NULL
, otherwise the function will return NULL
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures result == _OSSL_SUCCESS
, otherwise the function will PTR_BAIL
with error
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures s2n_result_is_ok(result)
, otherwise the function will return NULL
DEPRECATED: all methods (except those in s2n.h) should return s2n_result.
Ensures (result) > S2N_FAILURE
, otherwise the function will return NULL