fix: remove OSSL_LIB_CTX per-call overhead in rsa_crypt()#83
Conversation
|
Seems fine but I seem to recall adding this for a reason. I wonder if there was a version issue. |
|
Good question — I dug into the git history to understand the original intent. The Two things suggest it was scaffolding rather than intentional design:
The change unifies both paths to |
|
@Koan-Bot rebase |
Rebase: fix: remove OSSL_LIB_CTX per-call overhead in rsa_crypt()Branch Diff: 1 file changed, 1 insertion(+), 9 deletions(-) Review feedback was analyzed and applied. Actions
Automated by Kōan |
8bd1297 to
cb047ce
Compare
When a PR branch lives on a fork (origin) but targets an upstream repo, plain `git rebase upstream/main` replays every commit since the fork diverged — not just the PR's own commits. This caused PRs to balloon from 1 commit to 50+ after rebase (e.g. cpan-authors/Crypt-OpenSSL-RSA#83). Fix: use `git rebase --onto target/base fork/base` when the branch was fetched from a different remote than the rebase target. This limits the replay to only commits between fork/base and HEAD (the actual PR commits). Changes: - _checkout_pr_branch now returns the remote it fetched from - _rebase_with_conflict_resolution accepts branch_remote and uses --onto - _rebase_onto_target (claude_step.py) gets the same --onto logic - pr_review.py passes branch_remote="origin" to _rebase_onto_target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@atoomic there seems to be an issue here with the rebase |
|
@Koan-Bot rebase |
On OpenSSL 3.x, rsa_crypt() created a new OSSL_LIB_CTX on every encrypt/decrypt call, but only used it for the public key path. Private key operations already used EVP_PKEY_CTX_new() with the default (NULL) context. Replace both paths with a single EVP_PKEY_CTX_new_from_pkey(NULL, ...) call, eliminating the per-call OSSL_LIB_CTX_new()/free() overhead. The default library context is appropriate here — no custom providers or property queries are needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rebase: fix: remove OSSL_LIB_CTX per-call overhead in rsa_crypt()Branch Diff: 1 file changed, 1 insertion(+), 9 deletions(-) Review feedback was analyzed and applied. Actions
Automated by Kōan |
cb047ce to
85fce04
Compare
Rebase: fix: remove OSSL_LIB_CTX per-call overhead in rsa_crypt()Branch Review feedback was analyzed and applied. Actions
Automated by Kōan |
What
Remove unnecessary
OSSL_LIB_CTX_new()/OSSL_LIB_CTX_free()calls on every encrypt/decrypt operation on OpenSSL 3.x.Why
rsa_crypt()created a new library context per call for public key operations, while private key operations already used the default (NULL) context. There's no reason for a custom context here — no custom providers or property queries are involved. The per-call allocation adds overhead (provider initialization) with zero benefit.How
Replaced the asymmetric public/private code paths with a single
EVP_PKEY_CTX_new_from_pkey(NULL, key, NULL)call for both. TheNULLfirst argument uses OpenSSL's default library context, matching what private key operations were already doing.-9 lines, +1 line.
Testing
Full test suite passes (281 tests) on Perl 5.42.0 / OpenSSL 3.6.1 (macOS).
🤖 Generated with Claude Code
Quality Report
Changes: 1 file changed, 1 insertion(+), 9 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline