Fix sess_hits counter on the server #1974
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.
Issues:
Addresses
CryptoAlg-2700
Description of changes:
While debugging the Ruby tests using an external session cache for TLS 1.2, there was an issue found where we were bumping up the
SSL_CTX_sess_hits
counter even when there wasn't a session found in the cache. We bumpsess_hits
in three places, due to it's broader implied meaning in OpenSSL. @WillChilds-Klein has an older commit with a nice description of the counter: 4b18065Apparently session could be a nullptr, which means a session wasn't found. In the original code, this meant that we would be updating the cache hit counter regardless of a session being found or not. This should only be updated when a session was found. Changing it to check for an existing pointer in session fixes this.
Call-outs:
N/A
Testing:
New check inserted in an external session cache check.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.