-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cert renewal: Add request struct for v2 #3548
Cert renewal: Add request struct for v2 #3548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 11 of 14 files at r1.
Reviewable status: 11 of 14 files reviewed, 3 unresolved discussions (waiting on @lukedirtwalker and @oncilla)
go/cert_srv/internal/reissuance/request.go, line 37 at r2 (raw file):
// BaseRequest is the base information of the reissuance request. type BaseRequest struct {
In current PKI they call this CertificationRequestInfo
https://tools.ietf.org/html/rfc2986
what about calling this field just Info?
go/cert_srv/internal/reissuance/request.go, line 44 at r2 (raw file):
// Request is the reissuance request. type Request struct {
IMO, this should be structured according to the general serialization syntax https://tools.ietf.org/html/rfc7515#section-7.2.1
I.e.
type Signed struct {
Request EncodedRequest
Protected EncodedProtected
Signature []byte
}
type EncodedRequest string
type EncodedProtected string
type Request struct {
Encoded EncodedInfo `json:"payload"`
POPs []POP `json:"signatures"`
}
type Info struct {
cert.Base
Issuer addr.IA
RequestTime util.UnixTime
}
type POP struct {
Protected EncodedPOP `json:"protected"`
Signature scrypto.JWSignature // I will add in my PR
}
go/lib/ctrl/cert_mgmt/chain_iss_req.go, line 26 at r1 (raw file):
type ChainIssReq struct { RawCert common.RawBytes `capnp:"cert"`
make this a []byte
1f9f642
to
fe335ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 7 of 14 files reviewed, 3 unresolved discussions (waiting on @oncilla)
go/cert_srv/internal/reissuance/request.go, line 37 at r2 (raw file):
Previously, Oncilla wrote…
In current PKI they call this
CertificationRequestInfo
https://tools.ietf.org/html/rfc2986
what about calling this field just Info?
Done. Called it RequestInfo
go/cert_srv/internal/reissuance/request.go, line 44 at r2 (raw file):
Previously, Oncilla wrote…
IMO, this should be structured according to the general serialization syntax https://tools.ietf.org/html/rfc7515#section-7.2.1
I.e.
type Signed struct { Request EncodedRequest Protected EncodedProtected Signature []byte } type EncodedRequest string type EncodedProtected string type Request struct { Encoded EncodedInfo `json:"payload"` POPs []POP `json:"signatures"` } type Info struct { cert.Base Issuer addr.IA RequestTime util.UnixTime } type POP struct { Protected EncodedPOP `json:"protected"` Signature scrypto.JWSignature // I will add in my PR }
Done.
go/lib/ctrl/cert_mgmt/chain_iss_req.go, line 26 at r1 (raw file):
Previously, Oncilla wrote…
make this a
[]byte
What should the string method do then? Optimally it would parse the new request and print it, but that's not possible because it is in an internal package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 14 files at r1, 6 of 6 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lukedirtwalker)
go/lib/ctrl/cert_mgmt/chain_iss_req.go, line 26 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
What should the string method do then? Optimally it would parse the new request and print it, but that's not possible because it is in an internal package.
just do fmt.Sprintf("%x", c.RawCert)
probably.
Using common.RawBytes just for the string method is not great.
(On that note, RawCert is not a good name anymore, since it is more than that now.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lukedirtwalker)
go/lib/ctrl/cert_mgmt/chain_iss_req.go, line 26 at r1 (raw file):
Previously, Oncilla wrote…
just do
fmt.Sprintf("%x", c.RawCert)
probably.
Using common.RawBytes just for the string method is not great.(On that note, RawCert is not a good name anymore, since it is more than that now.)
Thinking about it further, I think the RequestInfo should live in the go/lib/scrypto/cert/v2/renewal
package.
As we discussed, we might want to build a tool to send requests independent of the CS.
fe335ce
to
911ba52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @oncilla)
go/lib/ctrl/cert_mgmt/chain_iss_req.go, line 26 at r1 (raw file):
Previously, Oncilla wrote…
Thinking about it further, I think the RequestInfo should live in the
go/lib/scrypto/cert/v2/renewal
package.As we discussed, we might want to build a tool to send requests independent of the CS.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r4.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved
0534d5f
to
c761dd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r5.
Reviewable status: complete! all files reviewed, all discussions resolved
Add the structure for the version 2 certificate renewal requests.
Fixes #3478
This change is