From f6473efcc2091767a99de390f17322d0904208bd Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Mon, 4 Jan 2016 23:59:19 -0800 Subject: [PATCH] delete ca.RevokeCertificate Also, delete the unused core.CertificateAuthorityDatabase while we're here. Fixes #1319 --- ca/certificate-authority.go | 6 ------ cmd/ocsp-updater/main_test.go | 4 ---- core/interfaces.go | 8 -------- rpc/rpc-wrappers.go | 31 ------------------------------- 4 files changed, 49 deletions(-) diff --git a/ca/certificate-authority.go b/ca/certificate-authority.go index 82a863c62..96694aa62 100644 --- a/ca/certificate-authority.go +++ b/ca/certificate-authority.go @@ -218,12 +218,6 @@ func (ca *CertificateAuthorityImpl) GenerateOCSP(xferObj core.OCSPSigningRequest return ocspResponse, err } -// RevokeCertificate revokes the trust of the Cert referred to by the provided Serial. -func (ca *CertificateAuthorityImpl) RevokeCertificate(serial string, reasonCode core.RevocationCode) (err error) { - err = ca.SA.MarkCertificateRevoked(serial, reasonCode) - return err -} - // IssueCertificate attempts to convert a CSR into a signed Certificate, while // enforcing all policies. Names (domains) in the CertificateRequest will be // lowercased before storage. diff --git a/cmd/ocsp-updater/main_test.go b/cmd/ocsp-updater/main_test.go index a0273c82c..c4fac742b 100644 --- a/cmd/ocsp-updater/main_test.go +++ b/cmd/ocsp-updater/main_test.go @@ -29,10 +29,6 @@ func (ca *mockCA) GenerateOCSP(xferObj core.OCSPSigningRequest) (ocsp []byte, er return } -func (ca *mockCA) RevokeCertificate(serial string, reasonCode core.RevocationCode) (err error) { - return -} - type mockPub struct { sa core.StorageAuthority } diff --git a/core/interfaces.go b/core/interfaces.go index b46d21fb1..90b360664 100644 --- a/core/interfaces.go +++ b/core/interfaces.go @@ -12,7 +12,6 @@ import ( "time" jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/letsencrypt/go-jose" - gorp "github.com/letsencrypt/boulder/Godeps/_workspace/src/gopkg.in/gorp.v1" ) // A WebFrontEnd object supplies methods that can be hooked into @@ -83,7 +82,6 @@ type RegistrationAuthority interface { type CertificateAuthority interface { // [RegistrationAuthority] IssueCertificate(x509.CertificateRequest, int64) (Certificate, error) - RevokeCertificate(string, RevocationCode) error GenerateOCSP(OCSPSigningRequest) ([]byte, error) } @@ -133,12 +131,6 @@ type StorageAuthority interface { StorageAdder } -// CertificateAuthorityDatabase represents an atomic sequence source -type CertificateAuthorityDatabase interface { - IncrementAndGetSerial(*gorp.Transaction) (int64, error) - Begin() (*gorp.Transaction, error) -} - // Publisher defines the public interface for the Boulder Publisher type Publisher interface { SubmitToCT([]byte) error diff --git a/rpc/rpc-wrappers.go b/rpc/rpc-wrappers.go index 69134f013..8b1dbbb43 100644 --- a/rpc/rpc-wrappers.go +++ b/rpc/rpc-wrappers.go @@ -42,7 +42,6 @@ const ( MethodNewCertificate = "NewCertificate" // RA MethodUpdateRegistration = "UpdateRegistration" // RA, SA MethodUpdateAuthorization = "UpdateAuthorization" // RA - MethodRevokeCertificate = "RevokeCertificate" // CA MethodRevokeCertificateWithReg = "RevokeCertificateWithReg" // RA MethodAdministrativelyRevokeCertificate = "AdministrativelyRevokeCertificate" // RA MethodOnValidationUpdate = "OnValidationUpdate" // RA @@ -704,19 +703,6 @@ func NewCertificateAuthorityServer(rpc Server, impl core.CertificateAuthority) ( return }) - rpc.Handle(MethodRevokeCertificate, func(req []byte) (response []byte, err error) { - var revokeReq revokeCertificateRequest - err = json.Unmarshal(req, &revokeReq) - if err != nil { - // AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3 - errorCondition(MethodRevokeCertificate, err, req) - return - } - - err = impl.RevokeCertificate(revokeReq.Serial, revokeReq.ReasonCode) - return - }) - rpc.Handle(MethodGenerateOCSP, func(req []byte) (response []byte, err error) { var xferObj core.OCSPSigningRequest err = json.Unmarshal(req, &xferObj) @@ -767,23 +753,6 @@ func (cac CertificateAuthorityClient) IssueCertificate(csr x509.CertificateReque return } -// RevokeCertificate sends a request to revoke a certificate -func (cac CertificateAuthorityClient) RevokeCertificate(serial string, reasonCode core.RevocationCode) (err error) { - var revokeReq revokeCertificateRequest - revokeReq.Serial = serial - revokeReq.ReasonCode = reasonCode - - data, err := json.Marshal(revokeReq) - if err != nil { - // AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3 - errorCondition(MethodRevokeCertificate, err, revokeReq) - return - } - - _, err = cac.rpc.DispatchSync(MethodRevokeCertificate, data) - return -} - // GenerateOCSP sends a request to generate an OCSP response func (cac CertificateAuthorityClient) GenerateOCSP(signRequest core.OCSPSigningRequest) (resp []byte, err error) { data, err := json.Marshal(signRequest)