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

Save and restore the Windows error around TlsGetValue. #6349

Conversation

davidben
Copy link
Contributor

This is a cherry-pick of #6316 to master, with the test rewritten for the older conventions.

Checklist
  • tests are added or updated

TlsGetValue clears the last error even on success, so that callers may
distinguish it successfully returning NULL or failing. This error-mangling
behavior interferes with the caller's use of GetLastError. In particular
SSL_get_error queries the error queue to determine whether the caller should
look at the OS's errors. To avoid destroying state, save and restore the
Windows error.

Fixes openssl#6299.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from openssl#6316)

(cherry picked from commit 2de108d)
@richsalz richsalz added approval: done This pull request has the required number of approvals 1.1.0 labels May 24, 2018
levitte pushed a commit that referenced this pull request May 24, 2018
TlsGetValue clears the last error even on success, so that callers may
distinguish it successfully returning NULL or failing. This error-mangling
behavior interferes with the caller's use of GetLastError. In particular
SSL_get_error queries the error queue to determine whether the caller should
look at the OS's errors. To avoid destroying state, save and restore the
Windows error.

Fixes #6299.

Reviewed-by: Rich Salz <rsalz@openssl.org>

(cherry picked from commit 2de108d)

(Merged from #6349)
@davidben davidben closed this May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants