boulder/sa
Jacob Hoffman-Andrews 1c7e0fd1d8
Store linting certificate instead of precertificate (#6807)
In order to get rid of the orphan queue, we want to make sure that
before we sign a precertificate, we have enough data in the database
that we can fulfill our revocation-checking obligations even if storing
that precertificate in the database fails. That means:

- We should have a row in the certificateStatus table for the serial.
- But we should not serve "good" for that serial until we are positive
the precertificate was issued (BRs 4.9.10).
- We should have a record in the live DB of the proposed certificate's
public key, so the bad-key-revoker can mark it revoked.
- We should have a record in the live DB of the proposed certificate's
names, so it can be revoked if we are required to revoke based on names.

The SA.AddPrecertificate method already achieves these goals for
precertificates by writing to the various metadata tables. This PR
repurposes the SA.AddPrecertificate method to write "proposed
precertificates" instead.

We already create a linting certificate before the precertificate, and
that linting certificate is identical to the precertificate that will be
issued except for the private key used to sign it (and the AKID). So for
instance it contains the right pubkey and SANs, and the Issuer name is
the same as the Issuer name that will be used. So we'll use the linting
certificate as the "proposed precertificate" and store it to the DB,
along with appropriate metadata.

In the new code path, rather than writing "good" for the new
certificateStatus row, we write a new, fake OCSP status string "wait".
This will cause us to return internalServerError to OCSP requests for
that serial (but we won't get such requests because the serial has not
yet been published). After we finish precertificate issuance, we update
the status to "good" with SA.SetCertificateStatusReady.

Part of #6665
2023-04-26 13:54:24 -07:00
..
db Clean up database schema (#6832) 2023-04-21 10:37:05 -07:00
db-next Give orderToAuthz2 an auto-increment ID column (#6835) 2023-04-24 14:59:18 -07:00
db-users Remove ocsp-updater from Boulder (#6769) 2023-03-31 14:39:04 -07:00
proto Store linting certificate instead of precertificate (#6807) 2023-04-26 13:54:24 -07:00
satest Remove sa-wrappers.go (#5663) 2021-09-27 13:25:41 -07:00
testdata Support writing OCSP to Redis on revocation (#6012) 2022-04-01 13:59:56 -06:00
database.go SA: Check MariaDB system variables at startup (#6791) 2023-04-18 11:02:33 -04:00
database_test.go SA: Check MariaDB system variables at startup (#6791) 2023-04-18 11:02:33 -04:00
ip_range_test.go Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
metrics.go Don't panic on duplicate db metrics (#6247) 2022-07-23 11:11:15 -07:00
migrations.sh test: Support multiple database schemas (#6344) 2022-09-07 14:59:08 -07:00
model.go Deprecate ROCSPStage6 feature flag (#6770) 2023-04-04 15:41:51 -07:00
model_test.go Unify how we do streaming database selects (#6176) 2022-06-24 14:31:46 -07:00
rate_limits.go Create new StorageAuthorityReadOnly gRPC service (#6483) 2022-11-09 11:09:12 -08:00
rate_limits_test.go RA: Return retry-after when Certificates per Registered Domain is exceeded (#6470) 2022-11-01 11:33:19 -07:00
sa.go Store linting certificate instead of precertificate (#6807) 2023-04-26 13:54:24 -07:00
sa_test.go Deprecate ROCSPStage7 flag (#6804) 2023-04-12 17:03:06 -07:00
saro.go Give orderToAuthz2 an auto-increment ID column (#6835) 2023-04-24 14:59:18 -07:00
sysvars.go SA: Check MariaDB system variables at startup (#6791) 2023-04-18 11:02:33 -04:00
sysvars_test.go SA: Check MariaDB system variables at startup (#6791) 2023-04-18 11:02:33 -04:00
test-cert.der Store a DB of issued names. 2015-09-28 19:37:50 -07:00
test-cert2.der Implement rate limiting by domain name. 2015-10-04 21:04:26 -07:00
type-converter.go dependencies: Replace square/go-jose.v2 with go-jose/go-jose.v2 (#6598) 2023-01-24 12:08:30 -05:00
type-converter_test.go dependencies: Replace square/go-jose.v2 with go-jose/go-jose.v2 (#6598) 2023-01-24 12:08:30 -05:00
www.eff.org.der Add initial certificate status in SA. 2015-04-23 19:52:34 -07:00