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

fix: tolerate mismatched key PEM headers #46725

Merged
merged 2 commits into from
Sep 18, 2024

Commits on Sep 18, 2024

  1. fix: tolerate mismatched key PEM headers

    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.
    
    Fixes #46710
    
    changelog: fixed regression in private key parser to handle mismatched PEM headers
    nklaassen committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    e9ae469 View commit details
    Browse the repository at this point in the history
  2. fix typo in comment

    Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
    nklaassen and espadolini authored Sep 18, 2024
    Configuration menu
    Copy the full SHA
    1abbe60 View commit details
    Browse the repository at this point in the history