Skip to content

Commit a679d41

Browse files
authored
Remove GetRevocationStatus dead code (#8884)
This gRPC method has no callers, as it was only used for OCSP.
1 parent 6e73287 commit a679d41

6 files changed

Lines changed: 693 additions & 921 deletions

File tree

mocks/sa.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ func (sa *StorageAuthorityReadOnly) GetCertificateStatus(_ context.Context, req
199199
return nil, errors.New("no cert status")
200200
}
201201

202-
// GetRevocationStatus is a mock
203-
func (sa *StorageAuthorityReadOnly) GetRevocationStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.RevocationStatus, error) {
204-
return nil, nil
205-
}
206-
207202
// SerialsForIncident is a mock
208203
func (sa *StorageAuthorityReadOnly) SerialsForIncident(ctx context.Context, _ *sapb.SerialsForIncidentRequest, _ ...grpc.CallOption) (sapb.StorageAuthorityReadOnly_SerialsForIncidentClient, error) {
209204
return &ServerStreamClient[sapb.IncidentSerial]{}, nil

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)