Skip to content

Preserve CRLF line endings in PEM corruptions#780

Merged
EffortlessSteven merged 1 commit into
mainfrom
codex/build-edge-case-tests-and-refactor-code-gylnnc
May 17, 2026
Merged

Preserve CRLF line endings in PEM corruptions#780
EffortlessSteven merged 1 commit into
mainfrom
codex/build-edge-case-tests-and-refactor-code-gylnnc

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Motivation

  • PEM corruption helpers normalized all outputs to LF which broke expectations for inputs using CRLF line endings; deterministic negative fixtures must preserve input line separators.
  • Add focused edge-case coverage so injected corruptions and header/footer replacements behave consistently for CRLF and LF inputs.

Description

  • Refactor PEM corruption assembly to be separator-aware by adding line_separator, join_lines, and push_line helpers and using them in replace_first_line, replace_last_line, inject_bad_base64_line, and inject_blank_line in crates/uselesskey-core/src/srp/negative/pem.rs.
  • Update early-return behavior for short inputs to append the correct separator rather than hardcoding \n.
  • Add unit tests that assert CRLF-preservation for header replacement, bad-base64 injection, blank-line injection, and short malformed PEM inputs.
  • Keep existing LF-based behavior intact for backwards compatibility and test stability.

Testing

  • Ran cargo test -p uselesskey-core srp::negative::pem and the PEM-focused test suite passed (all tests OK).
  • Ran cargo test -p uselesskey-core and core crate tests passed with no failures.
  • Ran cargo xtask lint-fix --check (formatting and clippy) which completed successfully.

Codex Task

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 44 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d2ad9c5a-cfc9-4c57-a365-8d76f78c2083

📥 Commits

Reviewing files that changed from the base of the PR and between 9756a7d and d4ff989.

📒 Files selected for processing (1)
  • crates/uselesskey-core/src/srp/negative/pem.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/build-edge-case-tests-and-refactor-code-gylnnc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven EffortlessSteven merged commit a87e2d4 into main May 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant