Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use a non-resumable session if it is returned from the cache #18810

Closed
wants to merge 4 commits into from

Conversation

mattcaswell
Copy link
Member

We were incorrectly handling the case where the server side cache
returns a non-resumable session. We ended up attempting to use the session
for resumption but setting the session id to 0 length. This will cause the
client to fail (typically with an unexpected message alert).

Fixes #18690

@mattcaswell mattcaswell added branch: master Merge to master branch approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member branch: 3.0 Merge to openssl-3.0 branch labels Jul 15, 2022
test/sslapitest.c Outdated Show resolved Hide resolved
test/sslapitest.c Outdated Show resolved Hide resolved
@vdukhovni
Copy link

vdukhovni commented Jul 15, 2022

This avoids the interoperability issue, but leaves a high probably of needless resumption failures when sessions are marked non_resumable for no legitimate reason. I strongly feel that cache overflow MUST NOT set the non_resumable flag. Such mutation of sessions is unsafe and unwise.

Please strongly consider updating the overflow code path to not do this in this PR.

I also strongly feel that the expiration time order is a mistake, but fixing that would be a separate PR.

@t8m t8m added the triaged: bug The issue/pr is/fixes a bug label Jul 27, 2022
Test sessions behave as we expect even in the case that an overflow
occurs when adding a new session into the session cache.
We were incorrectly handling the case where the server side cache
returns a non-resumable session. We ended up attempting to use the session
for resumption but setting the session id to 0 length. This will cause the
client to fail (typically with an unexpected message alert).

Fixes openssl#18690
@mattcaswell
Copy link
Member Author

I've addressed the feedback from @t8m above and rebased this to resolve a conflict with master.

I strongly feel that cache overflow MUST NOT set the non_resumable flag

I do agree that changing this flag on sessions in the cache is unwise. However it is not quite clear to me what the implications of making this change are (in particular in a stable branch....and this PR is intended to be cherry-picked to 3.0). I think that particular issue is a lot less pressing given #18905. Therefore I do not agree that this needs to be dealt with in this PR. It is holding it up unnecessarily.

Ping for review.

@t8m
Copy link
Member

t8m commented Aug 18, 2022

CI is probably relevant.

@openssl-machine
Copy link
Collaborator

This PR is in a state where it requires action by @openssl/otc but the last update was 30 days ago

Copy link

@vdukhovni vdukhovni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdukhovni
Copy link

Is this likely to land?

@openssl openssl deleted a comment Oct 8, 2022
@paulidale paulidale removed the approval: review pending This pull request needs review by a committer label Oct 10, 2022
@t8m
Copy link
Member

t8m commented Oct 10, 2022

@mattcaswell please fix the CI failure

@t8m
Copy link
Member

t8m commented Oct 10, 2022

Is this likely to land?

If you mean to the release on Tuesday then no, I do not think it should go there. Unfortunately this PR needs work to fix the CI and according to our release policy we should already freeze the git repo before the release.

@t8m t8m added the branch: 3.1 Merge to openssl-3.1 label Oct 24, 2022
@t8m t8m removed the approval: otc review pending This pull request needs review by an OTC member label Nov 10, 2022
@t8m
Copy link
Member

t8m commented Nov 10, 2022

Ping for the CI failure fix.

@t8m
Copy link
Member

t8m commented Apr 14, 2023

ping @mattcaswell

@t8m t8m added the branch: 3.2 Merge to openssl-3.2 label Oct 26, 2023
@wbl
Copy link
Contributor

wbl commented Mar 13, 2024

This PR is a year and a quarter old and solves an issue that we've encountered. We are going to have to pull in these patches manually. Is there some reason it hasn't been merged yet?

@mattcaswell
Copy link
Member Author

I actually think this is the wrong fix. Co-incidentally I've been looking at this again recently. Updated fix coming soon.

@wbl
Copy link
Contributor

wbl commented Mar 13, 2024

Let me know if there's anything we can do to help test it and get it out.

@mattcaswell
Copy link
Member Author

Closing this in favour of #24042, #24043 and #24044. Those PRs include and extend the commits from this PR.

@mattcaswell mattcaswell closed this Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 branch: 3.2 Merge to openssl-3.2 triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal - Unexpected Message returned with OpenSSL 3.0
6 participants