Pull all shared request/response structs in RPC layer out to single definitions
This commit is contained in:
parent
08ac100788
commit
798e56c012
|
|
@ -58,30 +58,77 @@ const (
|
||||||
MethodAlreadyDeniedCSR = "AlreadyDeniedCSR" // SA
|
MethodAlreadyDeniedCSR = "AlreadyDeniedCSR" // SA
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegistrationAuthorityClient / Server
|
// Request structs
|
||||||
// -> NewAuthorization
|
|
||||||
// -> NewCertificate
|
|
||||||
// -> UpdateAuthorization
|
|
||||||
// -> RevokeCertificate
|
|
||||||
// -> OnValidationUpdate
|
|
||||||
type registrationRequest struct {
|
type registrationRequest struct {
|
||||||
Reg core.Registration
|
Reg core.Registration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type getRegistrationRequest struct {
|
||||||
|
ID int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type updateRegistrationRequest struct {
|
||||||
|
Base, Update core.Registration
|
||||||
|
}
|
||||||
|
|
||||||
type authorizationRequest struct {
|
type authorizationRequest struct {
|
||||||
Authz core.Authorization
|
Authz core.Authorization
|
||||||
RegID int64
|
RegID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type updateAuthorizationRequest struct {
|
||||||
|
Authz core.Authorization
|
||||||
|
Index int
|
||||||
|
Response core.Challenge
|
||||||
|
}
|
||||||
|
|
||||||
type certificateRequest struct {
|
type certificateRequest struct {
|
||||||
Req core.CertificateRequest
|
Req core.CertificateRequest
|
||||||
RegID int64
|
RegID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type issueCertificateRequest struct {
|
||||||
|
Bytes []byte
|
||||||
|
RegID int64
|
||||||
|
EarliestExpiry time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
type addCertificateRequest struct {
|
||||||
|
Bytes []byte
|
||||||
|
RegID int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type revokeCertificateRequest struct {
|
||||||
|
Serial string
|
||||||
|
ReasonCode int
|
||||||
|
}
|
||||||
|
|
||||||
|
type markCertificateRevokedRequest struct {
|
||||||
|
Serial string
|
||||||
|
OCSPResponse []byte
|
||||||
|
ReasonCode int
|
||||||
|
}
|
||||||
|
|
||||||
type caaRequest struct {
|
type caaRequest struct {
|
||||||
Ident core.AcmeIdentifier
|
Ident core.AcmeIdentifier
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type validationRequest struct {
|
||||||
|
Authz core.Authorization
|
||||||
|
Index int
|
||||||
|
}
|
||||||
|
|
||||||
|
type alreadyDeniedCSRReq struct {
|
||||||
|
Names []string
|
||||||
|
}
|
||||||
|
|
||||||
|
// Response structs
|
||||||
|
type caaResponse struct {
|
||||||
|
Present bool
|
||||||
|
Valid bool
|
||||||
|
Err error
|
||||||
|
}
|
||||||
|
|
||||||
func improperMessage(method string, err error, obj interface{}) {
|
func improperMessage(method string, err error, obj interface{}) {
|
||||||
log := blog.GetAuditLogger()
|
log := blog.GetAuditLogger()
|
||||||
log.Audit(fmt.Sprintf("Improper message. method: %s err: %s data: %+v", method, err, obj))
|
log.Audit(fmt.Sprintf("Improper message. method: %s err: %s data: %+v", method, err, obj))
|
||||||
|
|
@ -164,17 +211,15 @@ func NewRegistrationAuthorityServer(rpc RPCServer, impl core.RegistrationAuthori
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.Handle(MethodUpdateRegistration, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodUpdateRegistration, func(req []byte) (response []byte, err error) {
|
||||||
var request struct {
|
var urReq updateRegistrationRequest
|
||||||
Base, Update core.Registration
|
err = json.Unmarshal(req, &urReq)
|
||||||
}
|
|
||||||
err = json.Unmarshal(req, &request)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
improperMessage(MethodUpdateRegistration, err, req)
|
improperMessage(MethodUpdateRegistration, err, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
reg, err := impl.UpdateRegistration(request.Base, request.Update)
|
reg, err := impl.UpdateRegistration(urReq.Base, urReq.Update)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -189,19 +234,15 @@ func NewRegistrationAuthorityServer(rpc RPCServer, impl core.RegistrationAuthori
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.Handle(MethodUpdateAuthorization, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodUpdateAuthorization, func(req []byte) (response []byte, err error) {
|
||||||
var authz struct {
|
var uaReq updateAuthorizationRequest
|
||||||
Authz core.Authorization
|
err = json.Unmarshal(req, &uaReq)
|
||||||
Index int
|
|
||||||
Response core.Challenge
|
|
||||||
}
|
|
||||||
err = json.Unmarshal(req, &authz)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
improperMessage(MethodUpdateAuthorization, err, req)
|
improperMessage(MethodUpdateAuthorization, err, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
newAuthz, err := impl.UpdateAuthorization(authz.Authz, authz.Index, authz.Response)
|
newAuthz, err := impl.UpdateAuthorization(uaReq.Authz, uaReq.Index, uaReq.Response)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -297,11 +338,11 @@ func (rac RegistrationAuthorityClient) NewCertificate(cr core.CertificateRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rac RegistrationAuthorityClient) UpdateRegistration(base core.Registration, update core.Registration) (newReg core.Registration, err error) {
|
func (rac RegistrationAuthorityClient) UpdateRegistration(base core.Registration, update core.Registration) (newReg core.Registration, err error) {
|
||||||
var toSend struct{ Base, Update core.Registration }
|
var urReq updateRegistrationRequest
|
||||||
toSend.Base = base
|
urReq.Base = base
|
||||||
toSend.Update = update
|
urReq.Update = update
|
||||||
|
|
||||||
data, err := json.Marshal(toSend)
|
data, err := json.Marshal(urReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -316,16 +357,12 @@ func (rac RegistrationAuthorityClient) UpdateRegistration(base core.Registration
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rac RegistrationAuthorityClient) UpdateAuthorization(authz core.Authorization, index int, response core.Challenge) (newAuthz core.Authorization, err error) {
|
func (rac RegistrationAuthorityClient) UpdateAuthorization(authz core.Authorization, index int, response core.Challenge) (newAuthz core.Authorization, err error) {
|
||||||
var toSend struct {
|
var uaReq updateAuthorizationRequest
|
||||||
Authz core.Authorization
|
uaReq.Authz = authz
|
||||||
Index int
|
uaReq.Index = index
|
||||||
Response core.Challenge
|
uaReq.Response = response
|
||||||
}
|
|
||||||
toSend.Authz = authz
|
|
||||||
toSend.Index = index
|
|
||||||
toSend.Response = response
|
|
||||||
|
|
||||||
data, err := json.Marshal(toSend)
|
data, err := json.Marshal(uaReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -358,10 +395,7 @@ func (rac RegistrationAuthorityClient) OnValidationUpdate(authz core.Authorizati
|
||||||
// -> UpdateValidations
|
// -> UpdateValidations
|
||||||
func NewValidationAuthorityServer(rpc RPCServer, impl core.ValidationAuthority) (err error) {
|
func NewValidationAuthorityServer(rpc RPCServer, impl core.ValidationAuthority) (err error) {
|
||||||
rpc.Handle(MethodUpdateValidations, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodUpdateValidations, func(req []byte) (response []byte, err error) {
|
||||||
var vaReq struct {
|
var vaReq validationRequest
|
||||||
Authz core.Authorization
|
|
||||||
Index int
|
|
||||||
}
|
|
||||||
if err = json.Unmarshal(req, &vaReq); err != nil {
|
if err = json.Unmarshal(req, &vaReq); err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
improperMessage(MethodUpdateValidations, err, req)
|
improperMessage(MethodUpdateValidations, err, req)
|
||||||
|
|
@ -385,11 +419,7 @@ func NewValidationAuthorityServer(rpc RPCServer, impl core.ValidationAuthority)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var caaResp struct {
|
var caaResp caaResponse
|
||||||
Present bool
|
|
||||||
Valid bool
|
|
||||||
Err error
|
|
||||||
}
|
|
||||||
caaResp.Present = present
|
caaResp.Present = present
|
||||||
caaResp.Valid = valid
|
caaResp.Valid = valid
|
||||||
caaResp.Err = err
|
caaResp.Err = err
|
||||||
|
|
@ -415,10 +445,7 @@ func NewValidationAuthorityClient(client RPCClient) (vac ValidationAuthorityClie
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vac ValidationAuthorityClient) UpdateValidations(authz core.Authorization, index int) error {
|
func (vac ValidationAuthorityClient) UpdateValidations(authz core.Authorization, index int) error {
|
||||||
var vaReq struct {
|
var vaReq validationRequest
|
||||||
Authz core.Authorization
|
|
||||||
Index int
|
|
||||||
}
|
|
||||||
vaReq.Authz = authz
|
vaReq.Authz = authz
|
||||||
vaReq.Index = index
|
vaReq.Index = index
|
||||||
data, err := json.Marshal(vaReq)
|
data, err := json.Marshal(vaReq)
|
||||||
|
|
@ -443,11 +470,7 @@ func (vac ValidationAuthorityClient) CheckCAARecords(ident core.AcmeIdentifier)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var caaResp struct {
|
var caaResp caaResponse
|
||||||
Present bool
|
|
||||||
Valid bool
|
|
||||||
Err error
|
|
||||||
}
|
|
||||||
|
|
||||||
err = json.Unmarshal(jsonResp, &caaResp)
|
err = json.Unmarshal(jsonResp, &caaResp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -462,11 +485,7 @@ func (vac ValidationAuthorityClient) CheckCAARecords(ident core.AcmeIdentifier)
|
||||||
// -> IssueCertificate
|
// -> IssueCertificate
|
||||||
func NewCertificateAuthorityServer(rpc RPCServer, impl core.CertificateAuthority) (err error) {
|
func NewCertificateAuthorityServer(rpc RPCServer, impl core.CertificateAuthority) (err error) {
|
||||||
rpc.Handle(MethodIssueCertificate, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodIssueCertificate, func(req []byte) (response []byte, err error) {
|
||||||
var icReq struct {
|
var icReq issueCertificateRequest
|
||||||
Bytes []byte
|
|
||||||
RegID int64
|
|
||||||
EarliestExpiry time.Time
|
|
||||||
}
|
|
||||||
err = json.Unmarshal(req, &icReq)
|
err = json.Unmarshal(req, &icReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
|
|
@ -497,10 +516,7 @@ func NewCertificateAuthorityServer(rpc RPCServer, impl core.CertificateAuthority
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.Handle(MethodRevokeCertificate, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodRevokeCertificate, func(req []byte) (response []byte, err error) {
|
||||||
var revokeReq struct {
|
var revokeReq revokeCertificateRequest
|
||||||
Serial string
|
|
||||||
ReasonCode int
|
|
||||||
}
|
|
||||||
err = json.Unmarshal(req, &revokeReq)
|
err = json.Unmarshal(req, &revokeReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
|
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
|
||||||
|
|
@ -542,11 +558,7 @@ func NewCertificateAuthorityClient(client RPCClient) (cac CertificateAuthorityCl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cac CertificateAuthorityClient) IssueCertificate(csr x509.CertificateRequest, regID int64, earliestExpiry time.Time) (cert core.Certificate, err error) {
|
func (cac CertificateAuthorityClient) IssueCertificate(csr x509.CertificateRequest, regID int64, earliestExpiry time.Time) (cert core.Certificate, err error) {
|
||||||
var icReq struct {
|
var icReq issueCertificateRequest
|
||||||
Bytes []byte
|
|
||||||
RegID int64
|
|
||||||
EarliestExpiry time.Time
|
|
||||||
}
|
|
||||||
icReq.Bytes = csr.Raw
|
icReq.Bytes = csr.Raw
|
||||||
icReq.RegID = regID
|
icReq.RegID = regID
|
||||||
data, err := json.Marshal(icReq)
|
data, err := json.Marshal(icReq)
|
||||||
|
|
@ -564,10 +576,7 @@ func (cac CertificateAuthorityClient) IssueCertificate(csr x509.CertificateReque
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cac CertificateAuthorityClient) RevokeCertificate(serial string, reasonCode int) (err error) {
|
func (cac CertificateAuthorityClient) RevokeCertificate(serial string, reasonCode int) (err error) {
|
||||||
var revokeReq struct {
|
var revokeReq revokeCertificateRequest
|
||||||
Serial string
|
|
||||||
ReasonCode int
|
|
||||||
}
|
|
||||||
revokeReq.Serial = serial
|
revokeReq.Serial = serial
|
||||||
revokeReq.ReasonCode = reasonCode
|
revokeReq.ReasonCode = reasonCode
|
||||||
|
|
||||||
|
|
@ -615,17 +624,15 @@ func NewStorageAuthorityServer(rpc RPCServer, impl core.StorageAuthority) error
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.Handle(MethodGetRegistration, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodGetRegistration, func(req []byte) (response []byte, err error) {
|
||||||
var intReq struct {
|
var grReq getRegistrationRequest
|
||||||
ID int64
|
err = json.Unmarshal(req, &grReq)
|
||||||
}
|
|
||||||
err = json.Unmarshal(req, &intReq)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
improperMessage(MethodGetRegistration, err, req)
|
improperMessage(MethodGetRegistration, err, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
reg, err := impl.GetRegistration(intReq.ID)
|
reg, err := impl.GetRegistration(grReq.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -677,18 +684,15 @@ func NewStorageAuthorityServer(rpc RPCServer, impl core.StorageAuthority) error
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.Handle(MethodAddCertificate, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodAddCertificate, func(req []byte) (response []byte, err error) {
|
||||||
var icReq struct {
|
var acReq addCertificateRequest
|
||||||
Bytes []byte
|
err = json.Unmarshal(req, &acReq)
|
||||||
RegID int64
|
|
||||||
}
|
|
||||||
err = json.Unmarshal(req, &icReq)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
improperMessage(MethodAddCertificate, err, req)
|
improperMessage(MethodAddCertificate, err, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
id, err := impl.AddCertificate(icReq.Bytes, icReq.RegID)
|
id, err := impl.AddCertificate(acReq.Bytes, acReq.RegID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -797,35 +801,29 @@ func NewStorageAuthorityServer(rpc RPCServer, impl core.StorageAuthority) error
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.Handle(MethodMarkCertificateRevoked, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodMarkCertificateRevoked, func(req []byte) (response []byte, err error) {
|
||||||
var revokeReq struct {
|
var mcrReq markCertificateRevokedRequest
|
||||||
Serial string
|
|
||||||
OCSPResponse []byte
|
|
||||||
ReasonCode int
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = json.Unmarshal(req, &revokeReq); err != nil {
|
if err = json.Unmarshal(req, &mcrReq); err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
improperMessage(MethodMarkCertificateRevoked, err, req)
|
improperMessage(MethodMarkCertificateRevoked, err, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = impl.MarkCertificateRevoked(revokeReq.Serial, revokeReq.OCSPResponse, revokeReq.ReasonCode)
|
err = impl.MarkCertificateRevoked(mcrReq.Serial, mcrReq.OCSPResponse, mcrReq.ReasonCode)
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
|
|
||||||
rpc.Handle(MethodAlreadyDeniedCSR, func(req []byte) (response []byte, err error) {
|
rpc.Handle(MethodAlreadyDeniedCSR, func(req []byte) (response []byte, err error) {
|
||||||
var csrReq struct {
|
var adcReq alreadyDeniedCSRReq
|
||||||
Names []string
|
|
||||||
}
|
|
||||||
|
|
||||||
err = json.Unmarshal(req, &csrReq)
|
err = json.Unmarshal(req, &adcReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
// AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64
|
||||||
improperMessage(MethodAlreadyDeniedCSR, err, req)
|
improperMessage(MethodAlreadyDeniedCSR, err, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
exists, err := impl.AlreadyDeniedCSR(csrReq.Names)
|
exists, err := impl.AlreadyDeniedCSR(adcReq.Names)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -851,12 +849,10 @@ func NewStorageAuthorityClient(client RPCClient) (sac StorageAuthorityClient, er
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cac StorageAuthorityClient) GetRegistration(id int64) (reg core.Registration, err error) {
|
func (cac StorageAuthorityClient) GetRegistration(id int64) (reg core.Registration, err error) {
|
||||||
var intReq struct {
|
var grReq getRegistrationRequest
|
||||||
ID int64
|
grReq.ID = id
|
||||||
}
|
|
||||||
intReq.ID = id
|
|
||||||
|
|
||||||
data, err := json.Marshal(intReq)
|
data, err := json.Marshal(grReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -916,17 +912,13 @@ func (cac StorageAuthorityClient) GetCertificateStatus(id string) (status core.C
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cac StorageAuthorityClient) MarkCertificateRevoked(serial string, ocspResponse []byte, reasonCode int) (err error) {
|
func (cac StorageAuthorityClient) MarkCertificateRevoked(serial string, ocspResponse []byte, reasonCode int) (err error) {
|
||||||
var revokeReq struct {
|
var mcrReq markCertificateRevokedRequest
|
||||||
Serial string
|
|
||||||
OCSPResponse []byte
|
|
||||||
ReasonCode int
|
|
||||||
}
|
|
||||||
|
|
||||||
revokeReq.Serial = serial
|
mcrReq.Serial = serial
|
||||||
revokeReq.OCSPResponse = ocspResponse
|
mcrReq.OCSPResponse = ocspResponse
|
||||||
revokeReq.ReasonCode = reasonCode
|
mcrReq.ReasonCode = reasonCode
|
||||||
|
|
||||||
data, err := json.Marshal(revokeReq)
|
data, err := json.Marshal(mcrReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -1001,13 +993,10 @@ func (cac StorageAuthorityClient) FinalizeAuthorization(authz core.Authorization
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cac StorageAuthorityClient) AddCertificate(cert []byte, regID int64) (id string, err error) {
|
func (cac StorageAuthorityClient) AddCertificate(cert []byte, regID int64) (id string, err error) {
|
||||||
var icReq struct {
|
var acReq addCertificateRequest
|
||||||
Bytes []byte
|
acReq.Bytes = cert
|
||||||
RegID int64
|
acReq.RegID = regID
|
||||||
}
|
data, err := json.Marshal(acReq)
|
||||||
icReq.Bytes = cert
|
|
||||||
icReq.RegID = regID
|
|
||||||
data, err := json.Marshal(icReq)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -1021,12 +1010,10 @@ func (cac StorageAuthorityClient) AddCertificate(cert []byte, regID int64) (id s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cac StorageAuthorityClient) AlreadyDeniedCSR(names []string) (exists bool, err error) {
|
func (cac StorageAuthorityClient) AlreadyDeniedCSR(names []string) (exists bool, err error) {
|
||||||
var sliceReq struct {
|
var adcReq alreadyDeniedCSRReq
|
||||||
Names []string
|
adcReq.Names = names
|
||||||
}
|
|
||||||
sliceReq.Names = names
|
|
||||||
|
|
||||||
data, err := json.Marshal(sliceReq)
|
data, err := json.Marshal(adcReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue