Implement: rsa_crypt no longer needs public/private arguement#166
Closed
Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Closed
Implement: rsa_crypt no longer needs public/private arguement#166Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Conversation
Extract plaintext length validation from rsa_crypt() into a dedicated static check_max_message_length() function. Call it only from encrypt() and private_encrypt() — not from decrypt/public_decrypt where the input is already-sized ciphertext. Use get_digest_length(p_rsa->hashMode) for OAEP max-length formula (RFC 8017 §7.1.1: mLen ≤ k − 2·hLen − 2) instead of the hardcoded 42 that assumed SHA-1. Works on all OpenSSL versions without allocation. Remove the now-redundant `public` parameter from rsa_crypt(). Use sv_len() instead of SvCUR() at call sites to ensure the SV is stringified. Use STRLEN for from_length parameter type. Update tests to compute OAEP overhead from actual hash size. Co-Authored-By: Claude <noreply@anthropic.com>
Member
|
Closing #165 implements |
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.
Summary
Implements #165
Closes #165
Generated by Kōan /implement
Quality Report
Changes: 5 files changed, 71 insertions(+), 43 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline