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

[Bug]: step cli has problems parsing certificate if there is any extra data appended to the file #1149

Closed
sshipway opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels
bug needs triage Waiting for discussion / prioritization by team
Milestone

Comments

@sshipway
Copy link

sshipway commented Apr 8, 2024

Steps to Reproduce

  • Issue a valid certificate using smallstep the usual way
  • Use step certificate needs-renewal to verify cert file is OK
  • Append a new text line to the end of the file (e.g. "\n foo \n").
  • Use step certificate needs-renewal on the file again, which should return the same but instead throws an error.

Your Environment

  • OS - linux centos 7
  • step CLI Version - Smallstep CLI/0.26.0 (linux/amd64) Release Date: 2024-03-29T02:25:03Z

Expected Behavior

The certificate should parse the same regardless of any additional data on the end of the file, and should correctly respond the same in both cases

Actual Behavior

When there is extra data after the certificate, there is an error:

error decoding PEM: file 'filename.crt' contains unexpected data

Note that openssl x509 has no problem parsing the file and resturning the correct response, even with the extra data

Additional Context

We are using an application that requires a DHPARAMS section to be appended to the certificate in the file. After adding this, step cli is no longer able to properly read the file for testing expiry, renewing, etc.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@sshipway sshipway added bug needs triage Waiting for discussion / prioritization by team labels Apr 8, 2024
@dopey
Copy link
Contributor

dopey commented Apr 23, 2024

This should be resolved in our latest release, v0.26.1. Please let us know if you see any issues.

Cheers 🍻

@dopey dopey closed this as completed Apr 23, 2024
@hslatman hslatman added this to the v0.26.2 milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

3 participants