Skip to content

Commit 30197ca

Browse files
authored
Revert "SA: Stop supporting OCSP status NotReady" (#8429)
Reverts #8395 The reverted change needed to land one release behind #8394. Unfortunately, the first release which contained 8394 also contained a bug, and had to be rolled back. The next release would contain both 8394 and 8395, which would lead to availability issues during a deploy when non-updated CA instances try to communicate with updated SA instances. Revert 8395 so that the next release can contain only 8394. This change will be followed by a re-land of 8395, after 8394 has been fully and successfully deployed. Part of #8343
1 parent 9365990 commit 30197ca

File tree

9 files changed

+925
-767
lines changed

9 files changed

+925
-767
lines changed

ca/ca_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ func (m *mockSA) GetLintPrecertificate(ctx context.Context, req *sapb.Serial, _
135135
return nil, berrors.NotFoundError("cannot find the precert")
136136
}
137137

138+
func (m *mockSA) SetCertificateStatusReady(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*emptypb.Empty, error) {
139+
return &emptypb.Empty{}, nil
140+
}
141+
138142
var ctx = context.Background()
139143

140144
func setup(t *testing.T) *testCtx {

core/objects.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,16 @@ type OCSPStatus string
7676
const (
7777
OCSPStatusGood = OCSPStatus("good")
7878
OCSPStatusRevoked = OCSPStatus("revoked")
79+
// Not a real OCSP status. This is a placeholder we write before the
80+
// actual precertificate is issued, to ensure we never return "good" before
81+
// issuance succeeds, for BR compliance reasons.
82+
OCSPStatusNotReady = OCSPStatus("wait")
7983
)
8084

8185
var OCSPStatusToInt = map[OCSPStatus]int{
82-
OCSPStatusGood: ocsp.Good,
83-
OCSPStatusRevoked: ocsp.Revoked,
86+
OCSPStatusGood: ocsp.Good,
87+
OCSPStatusRevoked: ocsp.Revoked,
88+
OCSPStatusNotReady: -1,
8489
}
8590

8691
// DNSPrefix is attached to DNS names in DNS challenges

docs/ISSUANCE-CYCLE.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,44 @@ At a high level:
88
2. Recheck CAA for hostnames that need it.
99
3. Allocate and store a serial number.
1010
4. Select a certificate profile.
11-
5. Generate and store linting precertificate.
12-
6. Sign, log (and don't store) precertificate.
11+
5. Generate and store linting certificate, set status to "wait" (precommit).
12+
6. Sign, log (and don't store) precertificate, set status to "good".
1313
7. Submit precertificate to CT.
1414
8. Generate linting final certificate. Not logged or stored.
1515
9. Sign, log, and store final certificate.
1616

1717
Revocation can happen at any time after (5), whether or not step (6) was successful. We do things this way so that even in the event of a power failure or error storing data, we have a record of what we planned to sign (the tbsCertificate bytes of the linting certificate).
1818

19-
Note that to avoid needing a migration, we chose to store the linting certificate from (5) in the "precertificates" table, which is now a bit of a misnomer.
19+
Note that to avoid needing a migration, we chose to store the linting certificate from (5)in the "precertificates" table, which is now a bit of a misnomer.
20+
21+
# OCSP Status state machine:
22+
23+
wait -> good -> revoked
24+
\
25+
-> revoked
26+
27+
Serial numbers with a "wait" status recorded have not been submitted to CT,
28+
because issuing the precertificate is a prerequisite to setting the status to
29+
"good". And because they haven't been submitted to CT, they also haven't been
30+
turned into a final certificate, nor have they been returned to a user.
31+
32+
OCSP requests for serial numbers in "wait" status will return 500, but we expect
33+
not to serve any 500s in practice because these serial numbers never wind up in
34+
users' hands. Serial numbers in "wait" status are not added to CRLs.
35+
36+
Note that "serial numbers never wind up in users' hands" does not relieve us of
37+
any compliance duties. Our duties start from the moment of signing a
38+
precertificate with trusted key material.
39+
40+
Since serial numbers in "wait" status _may_ have had a precertificate signed,
41+
We need the ability to set revocation status for them. For instance if the public key
42+
we planned to sign for turns out to be weak or compromised, we would want to serve
43+
a revoked status for that serial. However since they also _may not_ have had a
44+
Precertificate signed, we also can't serve an OCSP "good" status. That's why we
45+
serve 500. A 500 is appropriate because the only way a serial number can have "wait"
46+
status for any significant amount of time is if there was an internal error of some
47+
sort: an error during or before signing, or an error storing a record of the
48+
signing success in the database.
49+
50+
For clarity, "wait" is not an RFC 6960 status, but is an internal placeholder
51+
value specific to Boulder.

mocks/sa.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
"github.com/go-jose/go-jose/v4"
1313
"github.com/jmhodges/clock"
1414
"google.golang.org/grpc"
15+
"google.golang.org/grpc/codes"
16+
"google.golang.org/grpc/status"
1517
"google.golang.org/protobuf/types/known/emptypb"
1618
"google.golang.org/protobuf/types/known/timestamppb"
1719

@@ -211,6 +213,10 @@ func (sa *StorageAuthorityReadOnly) GetCertificateStatus(_ context.Context, req
211213
return nil, errors.New("no cert status")
212214
}
213215

216+
func (sa *StorageAuthorityReadOnly) SetCertificateStatusReady(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*emptypb.Empty, error) {
217+
return nil, status.Error(codes.Unimplemented, "unimplemented mock")
218+
}
219+
214220
// GetRevocationStatus is a mock
215221
func (sa *StorageAuthorityReadOnly) GetRevocationStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.RevocationStatus, error) {
216222
return nil, nil

0 commit comments

Comments
 (0)