PBS-49 feature: move SHA-256 digest into opensslpp::digest_context - #192
Merged
Merged
Conversation
| class digest_context { | ||
| public: | ||
| digest_context() noexcept = default; | ||
| explicit digest_context(digest_code_type code); |
Collaborator
There was a problem hiding this comment.
May be similarly to cipher_context make the constructor accept
const std::string &digest_name and get rid of digest_code_type completely?
https://perconadev.atlassian.net/browse/PBS-49 Problem: The caching_sha2_password authenticator was the only translation unit in the PBS tree that still included OpenSSL headers directly and drove EVP_MD_CTX by hand. Every other cryptographic primitive already lives in the shared opensslpp module (cipher_context, crypto_rng, core_error). PBS-49 tracks pulling the remaining raw calls behind that same wrapper. Solution: Introduce opensslpp::digest_context, a minimal RAII wrapper around EVP_MD_CTX that exposes exactly the operations the plugin needs: select a digest by digest_code_type (only sha256 today), update() with a std::string_view of input, and finalize() to a std::string of raw digest bytes. A static one-shot calculate() mirrors PS opensslpp's free-standing calculate_digest. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kamil-holubicki
force-pushed
the
PBS-49
branch
from
September 24, 2026 08:43
043e913 to
c5556bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://perconadev.atlassian.net/browse/PBS-49
Problem:
The caching_sha2_password authenticator was the only translation unit in the PBS tree that still included OpenSSL headers directly and drove EVP_MD_CTX by hand. Every other cryptographic primitive already lives in the shared opensslpp module (cipher_context, crypto_rng, core_error). PBS-49 tracks pulling the remaining raw calls behind that same wrapper.
Solution:
Introduce opensslpp::digest_context, a minimal RAII wrapper around EVP_MD_CTX that exposes exactly the operations the plugin needs: select a digest by digest_code_type (only sha256 today), update() with a std::string_view of input, and finalize() to a std::string of raw digest bytes. A static one-shot calculate() mirrors PS opensslpp's free-standing calculate_digest.