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

Fix EVP_Digest{Sign,Verify}Final() and EVP_Digest{Sign,Verify}() for provider only keys #10806

Conversation

levitte
Copy link
Member

@levitte levitte commented Jan 10, 2020

For provider only keys where the initialization didn't catch, we may
end up crashing because the legacy code path didn't check that it had
support carefully enough. This only happens if the caller didn't
check if initialization worked or not.

For the one-shot case, it's very simply handling the case where the
key has no legacy implementation an fall back to the standard
init+update+final mechanism.

…provider only keys

For provider only keys where the initialization didn't catch, we may
end up crashing because the legacy code path didn't check that it had
support carefully enough.  This only happens if the caller didn't
check if initialization worked or not.

For the one-shot case, it's very simply handling the case where the
key has no legacy implementation an fall back to the standard
init+update+final mechanism.
@levitte levitte added branch: master Merge to master branch approval: review pending This pull request needs review by a committer labels Jan 10, 2020
@levitte
Copy link
Member Author

levitte commented Jan 10, 2020

This fixes more test crashes for #10797

crypto/evp/m_sigver.c Outdated Show resolved Hide resolved
crypto/evp/m_sigver.c Show resolved Hide resolved
…}() for provider only keys

While at it, EVP_DigestSignFinal() and EVP_DigestVerifyFinal() got a
slight code cleanup.
@levitte
Copy link
Member Author

levitte commented Jan 13, 2020

Travis failure not relevant

@levitte
Copy link
Member Author

levitte commented Jan 13, 2020

Final review, anyone?

@mattcaswell mattcaswell added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Jan 13, 2020
@levitte
Copy link
Member Author

levitte commented Jan 14, 2020

Merged.

8f020c3 Fix EVP_Digest{Sign,Verify}Final() and EVP_Digest{Sign,Verify}() for provider only keys

@levitte levitte closed this Jan 14, 2020
openssl-machine pushed a commit that referenced this pull request Jan 14, 2020
…provider only keys

For provider only keys where the initialization didn't catch, we may
end up crashing because the legacy code path didn't check that it had
support carefully enough.  This only happens if the caller didn't
check if initialization worked or not.

For the one-shot case, it's very simply handling the case where the
key has no legacy implementation an fall back to the standard
init+update+final mechanism.

While at it, EVP_DigestSignFinal() and EVP_DigestVerifyFinal() got a
slight code cleanup.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #10806)
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 branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants