test: fix self-talk pkey offload test for openssl-3.0-fips #5175
+45
−14
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.
Release Summary:
Resolved issues:
related to #4993
Description of changes:
Fix the last failing test.
The pkey offload test is using legacy methods to perform the offloaded signing operation. That doesn't work when built with openssl-3.0-fips.
The problem is a little trickier than just substituting the proper signing methods, because the proper signing methods require an un-digested hash state. Our offloaded signing operation only provides the digest bytes. We COULD theoretically refactor the signing logic to provide a method usable with digest bytes-- it looks like that's what the legacy signing methods did. But that led to messy, harder to follow code in the legacy signing methods, and I don't want to repeat that mistake in the new signing methods.
Instead, I'm solving the problem in a less direct way. The hash state does exist on the pkey operation, it's just not surfaced by the public APIs. So I rewrote the test signing operation to use that hash state (and verify it matches the actual input).
Call-outs:
I'll add openssl-3.0-fips to other builds and delete the special openssl-3.0-fips build in a separate PR. This PR just fixes the test.
Testing:
This is a test.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.