Commit Graph

12 Commits

Author SHA1 Message Date
Victor Rodriguez
eb8496e874
Commence refactoring to decouple revocation code from main PKI backend (#27417)
* Rename crlConfig to CrlConfig.

Rename defaultCrlConfig to DefaultCrlConfig.

* Move CrlConfig and DefaultCrlConfig to new package pki/revocation.

* Rename revocationInfo to RevocationInfo.

* Move RevocationInfo to pki/revocation.

* Add StorageContext interface to PKI's revocation package.

* Add CrlBuilderType interface to pki_backend package.

The purpose of the interface is to make it possible to gradually move (refactor)
CrlBuilder to the revocation package.

* Move CrlConfig and DefaultCrlConfig to package pki_backend.

* Make StorageContext.CrlBuilder() return a CrlBuilderType.

Add methods SetLastDeltaRebuildCheckTime() and ShouldInvalidate() to
CrlBuilderType.

* Move fetchIssuerMapForRevocationChecking to PKI's revocation package.

* Run make fmt.
2024-06-10 16:41:47 +00:00
Steven Clark
cbf6dc2c4f
PKI refactoring to start breaking apart monolith into sub-packages (#24406)
* PKI refactoring to start breaking apart monolith into sub-packages

 - This was broken down by commit within enterprise for ease of review
   but would be too difficult to bring back individual commits back
   to the CE repository. (they would be squashed anyways)
 - This change was created by exporting a patch of the enterprise PR
   and applying it to CE repository

* Fix TestBackend_OID_SANs to not be rely on map ordering
2023-12-07 09:22:53 -05:00
Steven Clark
53040690a2
PKI: Do not set NextUpdate OCSP field when ocsp_expiry is 0 (#24192)
* Do not set NextUpdate OCSP field when ocsp_expiry is 0

* Add cl
2023-11-20 10:32:05 -05:00
hashicorp-copywrite[bot]
0b12cdcfd1
[COMPLIANCE] License changes (#22290)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License.

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUS-1.1

* Fix test that expected exact offset on hcl file

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Sarah Thompson <sthompson@hashicorp.com>
Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
2023-08-10 18:14:03 -07:00
Violet Hynes
3a46ecc389
Replace all remaining time.ParseDurations with parseutil.ParseDurationSeconds (#21357)
* Replace all time.ParseDurations with testutil.ParseDurationSeconds

* Changelog

* Import formatting

* Import formatting

* Import formatting

* Import formatting

* Semgrep rule that runs as part of CI
2023-06-20 14:37:46 -04:00
Steven Clark
042dd57811
Supporting PR for Enterprise ACME PR cluster tests (#21275)
* Supporting PR for Enterprise ACME PR cluster tests

 - Some changes within the OSS test helpers to help in the ACME Enterprise test cases.

* Don't rename existing helper method to make oss/ent merge easier
2023-06-15 21:12:49 +00:00
Steven Clark
c1d83da9b3
Skip OcspHigherLevel test failures if we trigger redirection bug (#20461)
- We have a known issue that is difficult to address in released versions of Vault that OCSP GET requests can contain consecutive / characters which the Golang HTTP mux will force a redirection.
  - Instead of failing various PRs and runs with this known issue, check to see if we are about to trigger it and if so skip the test. We have already at this point tested the POST version of the API.
2023-05-02 14:44:09 +00:00
Alexander Scheel
249c472b5b
Remove extraneous certificate from OCSP response (#20201)
* Remove extraneous certificate from OCSP response

Since the issuer used to sign the certificate also signs the OCSP
response, no additional information is added by sending the issuer again
in the certs field of the BasicOCSPResponse structure. Removing it saves
bytes and avoids confusing Go-based OCSP verifiers which cannot handle
the cert issuer being duplicated in the certs field.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add changelog entry

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-17 16:40:26 +00:00
Hamid Ghaf
e55c18ed12
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00
AnPucel
4ecb18b262
PKI Responses Part 4 (#18612) 2023-03-14 15:00:37 -07:00
Steven Clark
05e742b4ee
Revert URL encoding OCSP GET fix #18938 (#19037)
- This fix was incorrect as now the tests and program are double
   URL encoding the OCSP GET requests, so the base64 + characters
   when using Vault proper are becoming space characters.
2023-02-08 11:24:26 -05:00
Steven Clark
b5f04147cb
Apply URL encoding/unencoding to OCSP Get requests (#18938)
* Apply URL encoding/unencoding to OCSP Get requests

 - Missed this during development and sadly the unit tests were written
   at a level that did not expose this issue originally, there are
   certain combinations of issuer cert + serial that lead to base64
   data containing a '/' which will lead to the OCSP handler not getting
   the full parameter.
 - Do as the spec says, this should be treated as url-encoded data.

* Add cl

* Add higher level PKI OCSP GET/POST tests

* Rename PKI ocsp files to path_ocsp to follow naming conventions

* make fmt
2023-02-01 11:03:43 -05:00