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

Format certificates properly (rfc7468) with a trailing new line (#10411) #10556

Merged
merged 3 commits into from
Jul 6, 2021

Conversation

dhiaayachi
Copy link
Collaborator

this is a manual cherry-pick of #10411

* trim carriage return from certificates when inserting rootCA in the inMemDB

* format rootCA properly when returning the CA on the connect CA endpoint

* Fix linter warnings

* Fix providers to trim certs before returning it

* trim newlines on write when possible

* add changelog

* make sure all provider return a trailing newline after the root and intermediate certs

* Fix endpoint to return trailing new line

* Fix failing test with vault provider

* make test more robust

* make sure all provider return a trailing newline after the leaf certs

* Check for suffix before removing newline and use function

* Add comment to consul provider

* Update change log

Co-authored-by: R.B. Boyer <[email protected]>

* fix typo

* simplify code callflow

Co-authored-by: R.B. Boyer <[email protected]>

* extract requireNewLine as shared func

* remove dependency to testify in testing file

* remove extra newline in vault provider

* Add cert newline fix to envoy xds

* remove new line from mock provider

* Remove adding a new line from provider and fix it when the cert is read

* Add a comment to explain the fix

* Add missing for leaf certs

* fix missing new line

* fix missing new line in leaf certs

* remove extra new line in test

* updage changelog

Co-authored-by: Daniel Nephin <[email protected]>

* fix in vault provider and when reading cache (RPC call)

* fix AWS provider

* fix failing test in the provider

* remove comments and empty lines

* add check for empty cert in test

* fix linter warnings

* add new line for leaf and private key

* use string concat instead of Sprintf

* fix new lines for leaf signing

* preallocate slice and remove append

* Add new line to `SignIntermediate` and `CrossSignCA`

Co-authored-by: R.B. Boyer <[email protected]>
Co-authored-by: Daniel Nephin <[email protected]>
@vercel
Copy link

vercel bot commented Jul 6, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

consul – ./website

🔍 Inspect: https://vercel.com/hashicorp/consul/97nyZVNC3Lc6AiSWirNxv9XvVWUZ
✅ Preview: Failed

[Deployment for b59b4a8 failed]

consul-ui-staging – ./ui

🔍 Inspect: https://vercel.com/hashicorp/consul-ui-staging/BYJHFNwvrDV4sYX8ZAfZx6hzLnMo
✅ Preview: Failed

[Deployment for b59b4a8 failed]

@dhiaayachi dhiaayachi requested a review from a team July 6, 2021 13:30
@dhiaayachi dhiaayachi merged commit e9a4aa8 into release/1.8.x Jul 6, 2021
@dhiaayachi dhiaayachi deleted the port-ca-new-line-1.8.x branch July 6, 2021 16:40
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