Backport 2.28: ssl_cache: misc improvements #8280
Merged
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.
This is a backport of the bug fix in #7298: functions in the
ssl_cache
module were returning 1 on many error conditions, unlike the rest of the library where errors are conveyed by an error code that's always negative.There was significant refactoring in the
ssl_cache
module in 3.x, so cherry-picking the commits led to significant conflicts, and instead I mostly re-did the same changes:error.c
needs to be updated.return 1
orret = 1
and changed to what seemed like sensible values.mbedtls_ssl_cache_get
andmbedtls_ssl_cache_set
are concerned, there's nombedtls_ssl_cache_remove
.PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")
ssl_cache
module is not tested (it's used in SSL tests, but they don't really test error conditions) ← RISK!