Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v16] fix: tolerate mismatched key PEM headers #46727

Merged
merged 1 commit into from
Sep 18, 2024

Commits on Sep 18, 2024

  1. [v16] fix: tolerate mismatched key PEM headers

    Backport #46725 to branch/v16
    
    Issue #43381 introduced a regression where we now fail to parse PKCS8
    encoded RSA private keys within an "RSA PRIVATE KEY" PEM block in
    some cases.
    This format is somewhat non-standard, usually PKCS8 data should be in a
    "PRIVATE KEY" PEM block. However, certain versions of OpenSSL and
    possibly even Teleport in specific cases have generated private keys in
    this format.
    
    This commit updates ParsePrivateKey and ParsePublicKey to be more
    tolerant of PKCS8, PKCS1, or PKIX key data no matter which PEM header is
    used.
    
    changelog: fixed regression in private key parser to handle mismatched PEM headers
    nklaassen committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    0f5a531 View commit details
    Browse the repository at this point in the history