Skip to content

Commit 64164ec

Browse files
committed
Merge remote-tracking branch 'origin/main' into mattm-new-format-2
2 parents 3fca054 + ea0a215 commit 64164ec

File tree

206 files changed

+9886
-715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+9886
-715
lines changed

cmd/boulder-wfe2/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,6 @@ func main() {
380380
wfe.DirectoryWebsite = c.WFE.DirectoryWebsite
381381
wfe.LegacyKeyIDPrefix = c.WFE.LegacyKeyIDPrefix
382382

383-
logger.Infof("WFE using key policy: %#v", kp)
384-
385383
if c.WFE.ListenAddress == "" {
386384
cmd.Fail("HTTP listen address is not configured")
387385
}

core/objects.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ var OCSPStatusToInt = map[OCSPStatus]int{
8888
OCSPStatusNotReady: -1,
8989
}
9090

91+
const (
92+
RevocationStatusGood int64 = 0
93+
RevocationStatusRevoked int64 = 1
94+
)
95+
9196
// DNSPrefix is attached to DNS names in DNS challenges
9297
const DNSPrefix = "_acme-challenge"
9398

go.mod

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module github.com/letsencrypt/boulder
33
go 1.25.0
44

55
require (
6-
github.com/aws/aws-sdk-go-v2 v1.36.5
7-
github.com/aws/aws-sdk-go-v2/config v1.29.17
8-
github.com/aws/aws-sdk-go-v2/service/s3 v1.83.0
9-
github.com/aws/smithy-go v1.22.4
6+
github.com/aws/aws-sdk-go-v2 v1.38.1
7+
github.com/aws/aws-sdk-go-v2/config v1.31.2
8+
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.1
9+
github.com/aws/smithy-go v1.22.5
1010
github.com/eggsampler/acme/v3 v3.6.2
1111
github.com/go-jose/go-jose/v4 v4.1.2
1212
github.com/go-logr/stdr v1.2.2
@@ -49,20 +49,20 @@ require (
4949

5050
require (
5151
filippo.io/edwards25519 v1.1.0 // indirect
52-
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 // indirect
53-
github.com/aws/aws-sdk-go-v2/credentials v1.17.70 // indirect
54-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 // indirect
55-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 // indirect
56-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 // indirect
52+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 // indirect
53+
github.com/aws/aws-sdk-go-v2/credentials v1.18.6 // indirect
54+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.4 // indirect
55+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.4 // indirect
56+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.4 // indirect
5757
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
58-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 // indirect
59-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect
60-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 // indirect
61-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 // indirect
62-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 // indirect
63-
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 // indirect
64-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 // indirect
65-
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0 // indirect
58+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.4 // indirect
59+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 // indirect
60+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.4 // indirect
61+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.4 // indirect
62+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.4 // indirect
63+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.2 // indirect
64+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.33.2 // indirect
65+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.0 // indirect
6666
github.com/beorn7/perks v1.0.1 // indirect
6767
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
6868
github.com/cespare/xxhash/v2 v2.3.0 // indirect

go.sum

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,42 @@ github.com/a8m/expect v1.0.0/go.mod h1:4IwSCMumY49ScypDnjNbYEjgVeqy1/U2cEs3Lat96
77
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
88
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
99
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
10-
github.com/aws/aws-sdk-go-v2 v1.36.5 h1:0OF9RiEMEdDdZEMqF9MRjevyxAQcf6gY+E7vwBILFj0=
11-
github.com/aws/aws-sdk-go-v2 v1.36.5/go.mod h1:EYrzvCCN9CMUTa5+6lf6MM4tq3Zjp8UhSGR/cBsjai0=
12-
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 h1:12SpdwU8Djs+YGklkinSSlcrPyj3H4VifVsKf78KbwA=
13-
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11/go.mod h1:dd+Lkp6YmMryke+qxW/VnKyhMBDTYP41Q2Bb+6gNZgY=
14-
github.com/aws/aws-sdk-go-v2/config v1.29.17 h1:jSuiQ5jEe4SAMH6lLRMY9OVC+TqJLP5655pBGjmnjr0=
15-
github.com/aws/aws-sdk-go-v2/config v1.29.17/go.mod h1:9P4wwACpbeXs9Pm9w1QTh6BwWwJjwYvJ1iCt5QbCXh8=
16-
github.com/aws/aws-sdk-go-v2/credentials v1.17.70 h1:ONnH5CM16RTXRkS8Z1qg7/s2eDOhHhaXVd72mmyv4/0=
17-
github.com/aws/aws-sdk-go-v2/credentials v1.17.70/go.mod h1:M+lWhhmomVGgtuPOhO85u4pEa3SmssPTdcYpP/5J/xc=
18-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 h1:KAXP9JSHO1vKGCr5f4O6WmlVKLFFXgWYAGoJosorxzU=
19-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32/go.mod h1:h4Sg6FQdexC1yYG9RDnOvLbW1a/P986++/Y/a+GyEM8=
20-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 h1:SsytQyTMHMDPspp+spo7XwXTP44aJZZAC7fBV2C5+5s=
21-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36/go.mod h1:Q1lnJArKRXkenyog6+Y+zr7WDpk4e6XlR6gs20bbeNo=
22-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 h1:i2vNHQiXUvKhs3quBR6aqlgJaiaexz/aNvdCktW/kAM=
23-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36/go.mod h1:UdyGa7Q91id/sdyHPwth+043HhmP6yP9MBHgbZM0xo8=
10+
github.com/aws/aws-sdk-go-v2 v1.38.1 h1:j7sc33amE74Rz0M/PoCpsZQ6OunLqys/m5antM0J+Z8=
11+
github.com/aws/aws-sdk-go-v2 v1.38.1/go.mod h1:9Q0OoGQoboYIAJyslFyF1f5K1Ryddop8gqMhWx/n4Wg=
12+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 h1:6GMWV6CNpA/6fbFHnoAjrv4+LGfyTqZz2LtCHnspgDg=
13+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0/go.mod h1:/mXlTIVG9jbxkqDnr5UQNQxW1HRYxeGklkM9vAFeabg=
14+
github.com/aws/aws-sdk-go-v2/config v1.31.2 h1:NOaSZpVGEH2Np/c1toSeW0jooNl+9ALmsUTZ8YvkJR0=
15+
github.com/aws/aws-sdk-go-v2/config v1.31.2/go.mod h1:17ft42Yb2lF6OigqSYiDAiUcX4RIkEMY6XxEMJsrAes=
16+
github.com/aws/aws-sdk-go-v2/credentials v1.18.6 h1:AmmvNEYrru7sYNJnp3pf57lGbiarX4T9qU/6AZ9SucU=
17+
github.com/aws/aws-sdk-go-v2/credentials v1.18.6/go.mod h1:/jdQkh1iVPa01xndfECInp1v1Wnp70v3K4MvtlLGVEc=
18+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.4 h1:lpdMwTzmuDLkgW7086jE94HweHCqG+uOJwHf3LZs7T0=
19+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.4/go.mod h1:9xzb8/SV62W6gHQGC/8rrvgNXU6ZoYM3sAIJCIrXJxY=
20+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.4 h1:IdCLsiiIj5YJ3AFevsewURCPV+YWUlOW8JiPhoAy8vg=
21+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.4/go.mod h1:l4bdfCD7XyyZA9BolKBo1eLqgaJxl0/x91PL4Yqe0ao=
22+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.4 h1:j7vjtr1YIssWQOMeOWRbh3z8g2oY/xPjnZH2gLY4sGw=
23+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.4/go.mod h1:yDmJgqOiH4EA8Hndnv4KwAo8jCGTSnM5ASG1nBI+toA=
2424
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
2525
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
26-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 h1:GMYy2EOWfzdP3wfVAGXBNKY5vK4K8vMET4sYOYltmqs=
27-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36/go.mod h1:gDhdAV6wL3PmPqBhiPbnlS447GoWs8HTTOYef9/9Inw=
28-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 h1:CXV68E2dNqhuynZJPB80bhPQwAKqBWVer887figW6Jc=
29-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4/go.mod h1:/xFi9KtvBXP97ppCz1TAEvU1Uf66qvid89rbem3wCzQ=
30-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 h1:nAP2GYbfh8dd2zGZqFRSMlq+/F6cMPBUuCsGAMkN074=
31-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4/go.mod h1:LT10DsiGjLWh4GbjInf9LQejkYEhBgBCjLG5+lvk4EE=
32-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 h1:t0E6FzREdtCsiLIoLCWsYliNsRBgyGD/MCK571qk4MI=
33-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17/go.mod h1:ygpklyoaypuyDvOM5ujWGrYWpAK3h7ugnmKCU/76Ys4=
34-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 h1:qcLWgdhq45sDM9na4cvXax9dyLitn8EYBRl8Ak4XtG4=
35-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17/go.mod h1:M+jkjBFZ2J6DJrjMv2+vkBbuht6kxJYtJiwoVgX4p4U=
36-
github.com/aws/aws-sdk-go-v2/service/s3 v1.83.0 h1:5Y75q0RPQoAbieyOuGLhjV9P3txvYgXv2lg0UwJOfmE=
37-
github.com/aws/aws-sdk-go-v2/service/s3 v1.83.0/go.mod h1:kUklwasNoCn5YpyAqC/97r6dzTA1SRKJfKq16SXeoDU=
38-
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 h1:AIRJ3lfb2w/1/8wOOSqYb9fUKGwQbtysJ2H1MofRUPg=
39-
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5/go.mod h1:b7SiVprpU+iGazDUqvRSLf5XmCdn+JtT1on7uNL6Ipc=
40-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 h1:BpOxT3yhLwSJ77qIY3DoHAQjZsc4HEGfMCE4NGy3uFg=
41-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3/go.mod h1:vq/GQR1gOFLquZMSrxUK/cpvKCNVYibNyJ1m7JrU88E=
42-
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0 h1:NFOJ/NXEGV4Rq//71Hs1jC/NvPs1ezajK+yQmkwnPV0=
43-
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0/go.mod h1:7ph2tGpfQvwzgistp2+zga9f+bCjlQJPkPUmMgDSD7w=
44-
github.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw=
45-
github.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
26+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.4 h1:BE/MNQ86yzTINrfxPPFS86QCBNQeLKY2A0KhDh47+wI=
27+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.4/go.mod h1:SPBBhkJxjcrzJBc+qY85e83MQ2q3qdra8fghhkkyrJg=
28+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0 h1:6+lZi2JeGKtCraAj1rpoZfKqnQ9SptseRZioejfUOLM=
29+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.0/go.mod h1:eb3gfbVIxIoGgJsi9pGne19dhCBpK6opTYpQqAmdy44=
30+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.4 h1:Beh9oVgtQnBgR4sKKzkUBRQpf1GnL4wt0l4s8h2VCJ0=
31+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.4/go.mod h1:b17At0o8inygF+c6FOD3rNyYZufPw62o9XJbSfQPgbo=
32+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.4 h1:ueB2Te0NacDMnaC+68za9jLwkjzxGWm0KB5HTUHjLTI=
33+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.4/go.mod h1:nLEfLnVMmLvyIG58/6gsSA03F1voKGaCfHV7+lR8S7s=
34+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.4 h1:HVSeukL40rHclNcUqVcBwE1YoZhOkoLeBfhUqR3tjIU=
35+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.4/go.mod h1:DnbBOv4FlIXHj2/xmrUQYtawRFC9L9ZmQPz+DBc6X5I=
36+
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.1 h1:2n6Pd67eJwAb/5KCX62/8RTU0aFAAW7V5XIGSghiHrw=
37+
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.1/go.mod h1:w5PC+6GHLkvMJKasYGVloB3TduOtROEMqm15HSuIbw4=
38+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.2 h1:ve9dYBB8CfJGTFqcQ3ZLAAb/KXWgYlgu/2R2TZL2Ko0=
39+
github.com/aws/aws-sdk-go-v2/service/sso v1.28.2/go.mod h1:n9bTZFZcBa9hGGqVz3i/a6+NG0zmZgtkB9qVVFDqPA8=
40+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.33.2 h1:pd9G9HQaM6UZAZh19pYOkpKSQkyQQ9ftnl/LttQOcGI=
41+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.33.2/go.mod h1:eknndR9rU8UpE/OmFpqU78V1EcXPKFTTm5l/buZYgvM=
42+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.0 h1:iV1Ko4Em/lkJIsoKyGfc0nQySi+v0Udxr6Igq+y9JZc=
43+
github.com/aws/aws-sdk-go-v2/service/sts v1.38.0/go.mod h1:bEPcjW7IbolPfK67G1nilqWyoxYMSPrDiIQ3RdIdKgo=
44+
github.com/aws/smithy-go v1.22.5 h1:P9ATCXPMb2mPjYBgueqJNCA5S9UfktsW0tTxi+a7eqw=
45+
github.com/aws/smithy-go v1.22.5/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
4646
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
4747
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
4848
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=

mocks/sa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func (sa *StorageAuthorityReadOnly) SetCertificateStatusReady(ctx context.Contex
219219

220220
// GetRevocationStatus is a mock
221221
func (sa *StorageAuthorityReadOnly) GetRevocationStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.RevocationStatus, error) {
222-
return nil, nil
222+
return nil, errors.New("no revocation status")
223223
}
224224

225225
// SerialsForIncident is a mock

ra/ra.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,12 +1683,12 @@ func (ra *RegistrationAuthorityImpl) revokeCertificate(ctx context.Context, cert
16831683
// certificates that were previously revoked for a reason other than
16841684
// keyCompromise, and which are now being updated to keyCompromise instead.
16851685
func (ra *RegistrationAuthorityImpl) updateRevocationForKeyCompromise(ctx context.Context, serialString string, issuerID issuance.NameID) error {
1686-
status, err := ra.SA.GetCertificateStatus(ctx, &sapb.Serial{Serial: serialString})
1686+
status, err := ra.SA.GetRevocationStatus(ctx, &sapb.Serial{Serial: serialString})
16871687
if err != nil {
16881688
return berrors.NotFoundError("unable to confirm that serial %q was ever issued: %s", serialString, err)
16891689
}
16901690

1691-
if status.Status != string(core.OCSPStatusRevoked) {
1691+
if status.Status != core.RevocationStatusRevoked {
16921692
// Internal server error, because we shouldn't be in the function at all
16931693
// unless the cert was already revoked.
16941694
return fmt.Errorf("unable to re-revoke serial %q which is not currently revoked", serialString)

ra/ra_test.go

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,20 +3511,20 @@ type mockSARevocation struct {
35113511
sapb.StorageAuthorityClient
35123512

35133513
known map[string]*x509.Certificate
3514-
revoked map[string]*corepb.CertificateStatus
3514+
revoked map[string]*sapb.RevocationStatus
35153515
blocked []*sapb.AddBlockedKeyRequest
35163516
}
35173517

35183518
func newMockSARevocation(known *x509.Certificate) *mockSARevocation {
35193519
return &mockSARevocation{
35203520
known: map[string]*x509.Certificate{core.SerialToString(known.SerialNumber): known},
3521-
revoked: make(map[string]*corepb.CertificateStatus),
3521+
revoked: make(map[string]*sapb.RevocationStatus),
35223522
blocked: make([]*sapb.AddBlockedKeyRequest, 0),
35233523
}
35243524
}
35253525

35263526
func (msar *mockSARevocation) reset() {
3527-
msar.revoked = make(map[string]*corepb.CertificateStatus)
3527+
msar.revoked = make(map[string]*sapb.RevocationStatus)
35283528
msar.blocked = make([]*sapb.AddBlockedKeyRequest, 0)
35293529
}
35303530

@@ -3552,14 +3552,13 @@ func (msar *mockSARevocation) GetLintPrecertificate(_ context.Context, req *sapb
35523552
return nil, berrors.UnknownSerialError()
35533553
}
35543554

3555-
func (msar *mockSARevocation) GetCertificateStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*corepb.CertificateStatus, error) {
3555+
func (msar *mockSARevocation) GetRevocationStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.RevocationStatus, error) {
35563556
if status, present := msar.revoked[req.Serial]; present {
35573557
return status, nil
35583558
}
3559-
if cert, present := msar.known[req.Serial]; present {
3560-
return &corepb.CertificateStatus{
3561-
Serial: core.SerialToString(cert.SerialNumber),
3562-
IssuerID: int64(issuance.IssuerNameID(cert)),
3559+
if _, present := msar.known[req.Serial]; present {
3560+
return &sapb.RevocationStatus{
3561+
Status: core.RevocationStatusGood,
35633562
}, nil
35643563
}
35653564
return nil, berrors.UnknownSerialError()
@@ -3598,14 +3597,12 @@ func (msar *mockSARevocation) RevokeCertificate(_ context.Context, req *sapb.Rev
35983597
if _, present := msar.revoked[req.Serial]; present {
35993598
return nil, berrors.AlreadyRevokedError("already revoked")
36003599
}
3601-
cert, present := msar.known[req.Serial]
3600+
_, present := msar.known[req.Serial]
36023601
if !present {
36033602
return nil, berrors.UnknownSerialError()
36043603
}
3605-
msar.revoked[req.Serial] = &corepb.CertificateStatus{
3606-
Serial: req.Serial,
3607-
IssuerID: int64(issuance.IssuerNameID(cert)),
3608-
Status: string(core.OCSPStatusRevoked),
3604+
msar.revoked[req.Serial] = &sapb.RevocationStatus{
3605+
Status: core.RevocationStatusRevoked,
36093606
RevokedReason: req.Reason,
36103607
}
36113608
return &emptypb.Empty{}, nil
@@ -3772,7 +3769,7 @@ func TestRevokeCertByKey(t *testing.T) {
37723769

37733770
// Reset and have the Subscriber revoke for a different reason.
37743771
// Then re-revoking using the key should work.
3775-
mockSA.revoked = make(map[string]*corepb.CertificateStatus)
3772+
mockSA.revoked = make(map[string]*sapb.RevocationStatus)
37763773
_, err = ra.RevokeCertByApplicant(context.Background(), &rapb.RevokeCertByApplicantRequest{
37773774
Cert: cert.Raw,
37783775
Code: int64(revocation.Unspecified),

sa/model.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -161,41 +161,6 @@ func SelectCertificateStatus(ctx context.Context, s db.OneSelector, serial strin
161161
return model.toPb(), err
162162
}
163163

164-
// RevocationStatusModel represents a small subset of the columns in the
165-
// certificateStatus table, used to determine the authoritative revocation
166-
// status of a certificate.
167-
type RevocationStatusModel struct {
168-
Status core.OCSPStatus `db:"status"`
169-
RevokedDate time.Time `db:"revokedDate"`
170-
RevokedReason revocation.Reason `db:"revokedReason"`
171-
}
172-
173-
// SelectRevocationStatus returns the authoritative revocation information for
174-
// the certificate with the given serial.
175-
func SelectRevocationStatus(ctx context.Context, s db.OneSelector, serial string) (*sapb.RevocationStatus, error) {
176-
var model RevocationStatusModel
177-
err := s.SelectOne(
178-
ctx,
179-
&model,
180-
"SELECT status, revokedDate, revokedReason FROM certificateStatus WHERE serial = ? LIMIT 1",
181-
serial,
182-
)
183-
if err != nil {
184-
return nil, err
185-
}
186-
187-
statusInt, ok := core.OCSPStatusToInt[model.Status]
188-
if !ok {
189-
return nil, fmt.Errorf("got unrecognized status %q", model.Status)
190-
}
191-
192-
return &sapb.RevocationStatus{
193-
Status: int64(statusInt),
194-
RevokedDate: timestamppb.New(model.RevokedDate),
195-
RevokedReason: int64(model.RevokedReason),
196-
}, nil
197-
}
198-
199164
var mediumBlobSize = int(math.Pow(2, 24))
200165

201166
type issuedNameModel struct {

0 commit comments

Comments
 (0)