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

Add support for evaluating certificate files in DER format #862

Closed
atc0005 opened this issue Jun 1, 2024 · 0 comments · Fixed by #974
Closed

Add support for evaluating certificate files in DER format #862

atc0005 opened this issue Jun 1, 2024 · 0 comments · Fixed by #974
Assignees
Labels
app/lscert documentation Improvements or additions to documentation enhancement New feature or request plugin/check_cert
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jun 1, 2024

Overview

The goal is to seamlessly support input files of either PEM (existing support) or DER format without requiring any additional flags/settings.

References

@atc0005 atc0005 added app/lscert documentation Improvements or additions to documentation enhancement New feature or request plugin/check_cert labels Jun 1, 2024
@atc0005 atc0005 added this to the Next Release milestone Jun 1, 2024
@atc0005 atc0005 self-assigned this Jun 1, 2024
@atc0005 atc0005 modified the milestones: v0.17.3, v0.18.0 Jun 6, 2024
@atc0005 atc0005 modified the milestones: v0.18.0, Future, Next Next Release Sep 25, 2024
@atc0005 atc0005 pinned this issue Sep 25, 2024
atc0005 added a commit that referenced this issue Sep 27, 2024
CHANGES

- `internal/textutils` package
  - add EOL constants
  - add "normalize" functions
  - `NormalizeNewlines`
  - `StripBlankLines`
  - `StripBlankAndNormalize`
- `internal/certs` package
  - add new sentinel errors
    - `ErrUnsupportedFileFormat`
    - `ErrEmptyCertificateFile`
    - `ErrPEMParseFailureMalformedCertificate`
    - `ErrPEMParseFailureEmptyCertificateBlock`
  - add (24) new PEM block type contants
    - e.g., `PEMBlockTypeCRTBegin`
  - update `GetCertsFromFile` function to act as an entry point for
    loading certificates from a given file for all supported formats
    instead of being dedicated strictly to PEM formatted certificate
    files
    - continue to support importing (text) PEM encoded format
    - add support for importing binary DER encoded format
    - detect common unsupported PEM encoded file formats so that we
      can list the given file as being of a specific unsupported file
      format
  - refactor bulk of PEM handling logic originally contained in
    `GetCertsFromFile` to separate functions
    - `GetCertsFromPEMFile`
    - `ParsePEMCertificates`

REFERENCES

refs GH-862
atc0005 added a commit that referenced this issue Sep 27, 2024
CHANGES

- update README file to list additional supported cert
  file input format
- `internal/textutils` package
  - add EOL constants
  - add "normalize" functions
  - `NormalizeNewlines`
  - `StripBlankLines`
  - `StripBlankAndNormalize`
- `internal/certs` package
  - add new sentinel errors
    - `ErrUnsupportedFileFormat`
    - `ErrEmptyCertificateFile`
    - `ErrPEMParseFailureMalformedCertificate`
    - `ErrPEMParseFailureEmptyCertificateBlock`
  - add (24) new PEM block type contants
    - e.g., `PEMBlockTypeCRTBegin`
  - update `GetCertsFromFile` function to act as an entry point for
    loading certificates from a given file for all supported formats
    instead of being dedicated strictly to PEM formatted certificate
    files
    - continue to support importing (text) PEM encoded format
    - add support for importing binary DER encoded format
    - detect common unsupported PEM encoded file formats so that we
      can list the given file as being of a specific unsupported file
      format
  - refactor bulk of PEM handling logic originally contained in
    `GetCertsFromFile` to separate functions
    - `GetCertsFromPEMFile`
    - `ParsePEMCertificates`

REFERENCES

refs GH-862
@atc0005 atc0005 unpinned this issue Oct 4, 2024
atc0005 added a commit that referenced this issue Oct 4, 2024
CHANGES

- update README file to list additional supported cert
  file input format
- `internal/textutils` package
  - add EOL constants
  - add "normalize" functions
  - `NormalizeNewlines`
  - `StripBlankLines`
  - `StripBlankAndNormalize`
- `internal/certs` package
  - add new sentinel errors
    - `ErrUnsupportedFileFormat`
    - `ErrEmptyCertificateFile`
    - `ErrPEMParseFailureMalformedCertificate`
    - `ErrPEMParseFailureEmptyCertificateBlock`
  - add (24) new PEM block type contants
    - e.g., `PEMBlockTypeCRTBegin`
  - update `GetCertsFromFile` function to act as an entry point for
    loading certificates from a given file for all supported formats
    instead of being dedicated strictly to PEM formatted certificate
    files
    - continue to support importing (text) PEM encoded format
    - add support for importing binary DER encoded format
    - detect common unsupported PEM encoded file formats so that we
      can list the given file as being of a specific unsupported file
      format
  - refactor bulk of PEM handling logic originally contained in
    `GetCertsFromFile` to separate functions
    - `GetCertsFromPEMFile`
    - `ParsePEMCertificates`

REFERENCES

refs GH-862
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/lscert documentation Improvements or additions to documentation enhancement New feature or request plugin/check_cert
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant