Skip to content

Conversation

@tarcieri
Copy link
Member

Adds the following new functions:

  • detect_base64_line_width: a toplevel free function similar to decode_label which outputs an autodetected line width for a given input PEM byte slice.
  • Decoder::new_detect_wrap: an alternative to Decoder::new_wrapped which attempts to autodetect the Base64 line width in order to flexibly handle inputs wrapped at any size.

For an initial implementation, empty space between the pre-encapsulation boundary and the start of the Base64 is not handled.

Adds the following new functions:

- `detect_base64_line_width`: a toplevel free function similar to
  `decode_label` which outputs an autodetected line width for a given
  input PEM byte slice.
- `Decoder::new_detect_wrap`: an alternative to `Decoder::new_wrapped`
  which attempts to autodetect the Base64 line width in order to
  flexibly handle inputs wrapped at any size.

For an initial implementation, empty space between the pre-encapsulation
boundary and the start of the Base64 is not handled.
@tarcieri tarcieri merged commit a2f59e9 into master Jul 28, 2024
@tarcieri tarcieri deleted the pem-rfc7468/add-detect_base64_line_width branch July 28, 2024 18:41
tarcieri added a commit to RustCrypto/SSH that referenced this pull request Jul 28, 2024
Uses the line width detection support added to `pem-rfc7468` in
RustCrypto/formats#1464 to automatically detect the input line width and
parse PEM documents accordingly, which allows support for a wider range
of SSH keys which don't use the default 70 chars of line wrapping.

Closes #195
tarcieri added a commit to RustCrypto/SSH that referenced this pull request Jul 28, 2024
Uses the line width detection support added to `pem-rfc7468` in
RustCrypto/formats#1464 to automatically detect the input line width and
parse PEM documents accordingly, which allows support for a wider range
of SSH keys which don't use the default 70 chars of line wrapping.

Fixes #195
tarcieri added a commit to RustCrypto/SSH that referenced this pull request Jul 28, 2024
Uses the line width detection support added to `pem-rfc7468` in
RustCrypto/formats#1464 to automatically detect the input line width and
parse PEM documents accordingly, which allows support for a wider range
of SSH keys which don't use the default 70 chars of line wrapping.

Fixes #195
scv35 added a commit to scv35/SSH that referenced this pull request Jul 4, 2025
Uses the line width detection support added to `pem-rfc7468` in
RustCrypto/formats#1464 to automatically detect the input line width and
parse PEM documents accordingly, which allows support for a wider range
of SSH keys which don't use the default 70 chars of line wrapping.

Fixes #195
@tarcieri tarcieri mentioned this pull request Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants