Skip to content

pem-rfc7468: Handle non-standard line sizes when decoding #176

@kjvalencik

Description

@kjvalencik

RFC 7468 states that parsers may handle other line sizes.

OpenSSH encoded private keys use a line-length of 70, but are otherwise compliant with RFC 7468. Supporting non-standard line sizes would allow pem-rfc7468 to read these keys.

Unfortunately, handling non-standard sizes is likely to cause a performance regression for a couple of reasons:

  • Need to scan for newlines instead of splitting at exact points
  • Need to handle partial data because 70 (or other values) may not be an exact base64 chunk

For those reasons, I propose additional decoder methods that are less strict.

  • decode_less_strict
  • decode_vec_less_strict

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions