Skip to content

Support serializing SymCrypt hash objects #278

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

Merged
merged 11 commits into from
May 27, 2025
Merged

Support serializing SymCrypt hash objects #278

merged 11 commits into from
May 27, 2025

Conversation

qmuntal
Copy link
Collaborator

@qmuntal qmuntal commented May 15, 2025

OpenSSL does not currently support resumable hashing, where an in-progress hash operation's state is saved, and can be loaded later to finish the hash.

We do support serializing the hash state of the built-in OpenSSL providers, given that we can get a pointer to it and also we know it's memory layout. That doesn't work for other providers, though.

The SymCrypt provider is adding some custom parameters that allows getting and setting the internal hash object state. See microsoft/SymCrypt-OpenSSL#117.

This PR uses those new parameters to implement the hash serialization methods when using the SymCrypt provider.

For microsoft/go#1671.

@qmuntal qmuntal marked this pull request as ready for review May 22, 2025 08:43
Copy link
Collaborator

@dagood dagood left a comment

Choose a reason for hiding this comment

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

LGTM, just doc/style nits. I like the factoring, was fairly straightforward to follow along.

@qmuntal qmuntal merged commit 6200bfa into v2 May 27, 2025
98 of 100 checks passed
@qmuntal qmuntal deleted the symcrypthashenc branch May 27, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants