fix: thread-safe digest buffer in get_message_digest()#1
Draft
Koan-Bot wants to merge 71 commits into
Draft
Conversation
Modernize CI pipeline
- opened: pull request is created - synchronize: commit(s) pushed to the pull request - reopened: closed pull request is reopened - edited: title, body, or the base branch of the PR is modified - ready_for_review: pull request is taken out from draft mode
AutoLoader serves no purpose for this module and adds complexity.
Fix issue when libz is not linked on AIX
Fixes cpan-authors#50 - Correct openssl version may not be found
Streamline openssl3 changes
Disable PKCS#1 v1.5 padding
Don't ignore the set padding return code
sha1 is problematic especially since RedHat disabled it's usage
Also add t/padding.t that attempts to test the paddingi combinations more thoroughly or possible more clearly?
Clarify the padding and fix some missing frees for openssl objects
Add blurb about JWTs for padding changes
Change the default hash mode to sha256
As it is not supported any more and thus apt-get is failing See also: https://www.debian.org/releases/buster/
It will send PRs when newer versions of github actions are released.
And protect them using if-statements
Remove debian:buster from the CI
Add dependabot
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…b_actions/actions/checkout-6 Bump actions/checkout from 4 to 6
Separate the apt-get and the yum steps in the CI
- META_MERGE resources: http:// → https:// (license, homepage, repository)
- META_MERGE build_requires: 'Test' → 'Test::More' (all tests use Test::More)
- .gitignore: remove duplicate *.gcov and *.gcno entries
- CI: add debian:trixie to OpenSSL matrix (3.4.x coverage)
- CI: simplify apt-get condition with startsWith('debian:')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chore: fix META URLs, gitignore dupes, build_requires, add trixie CI
EVP_PKEY_CTX allocated by EVP_PKEY_CTX_new_from_pkey() was never freed, leaking memory on every check_key() call. Also add a NULL check on the context allocation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…k-key-ctx-leak fix: check_key() EVP_PKEY_CTX leak on OpenSSL 3.x
Don't include whrlpool.h if whirlpool is disabled
The static buffer `unsigned char m[EVP_MAX_MD_SIZE]` at file scope meant all calls shared the same memory — a data race in threaded Perl (ithread or multiplicity builds). Change the function to accept a caller-provided buffer instead. Each call site now declares its own stack-local `digest_buf[EVP_MAX_MD_SIZE]`, eliminating the shared mutable state without any heap allocation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What
Replace the static buffer in
get_message_digest()with caller-provided stack buffers.Why
static unsigned char m[EVP_MAX_MD_SIZE]is shared across all calls — a data racein threaded Perl builds (ithreads / multiplicity). Two concurrent
sign()orverify()calls would silently corrupt each other's digest.
How
Changed
get_message_digest()to accept anunsigned char* mdparameter instead ofowning a static buffer. Each caller (
sign(),verify()) now declares its owndigest_buf[EVP_MAX_MD_SIZE]on the stack — zero shared state, zero heap allocation.Testing
make test— 281 tests pass on Perl 5.42.0 / OpenSSL 3.6.1 (macOS).🤖 Generated with Claude Code