refactor: switch s2n_blob to use S2N_RESULT #4448
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolved issues:
chips away at #2425
Description of changes:
This PR switches
s2n_blob
methods to uses2n_result
.There are 5 manual changes
utils/s2n_blob.c
: switch all implementations to uses2n_result
with the appropriate guard changesutils/s2n_blob.h
: switch the header to match the implementationtls/s2n_async_pkey.c:141
: There was a manual comparison withS2N_SUCCESS
, switched to uses2n_result_is_error
utils/s2n_mem.c:s2n_free(305)
: the return type is stored, so the type of that variable had to be changedutils/s2n_mem.c:s2n_free_or_wipe(333)
: the return type is stored, so the type of that variable had to be change.All other changes were made with the following
sed
commands.Call-outs:
Draft note: It would be lovely to make this a completely automated PR, but I don't see an easy way to do that and keep things compiling.☹️
Testing:
All existing tests should pass.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.