-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add support for x509 certificates in DSSE #50
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ Name | Type | Required | Authenticated | |
SERIALIZED_BODY | bytes | Yes | Yes | ||
PAYLOAD_TYPE | string | Yes | Yes | ||
KEYID | string | No | No | ||
CERTIFICATE | string | No | No | ||
|
||
* SERIALIZED_BODY: Arbitrary byte sequence to be signed. | ||
|
||
|
@@ -52,6 +53,12 @@ KEYID | string | No | No | |
decisions; it may only be used to narrow the selection of possible keys to | ||
try. | ||
|
||
* CERTIFICATE: Optional, unauthenticated PEM encoded X.509 certificate chain for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Should we also allow ASN.1 encoding in the protocol? I can see why we'd want to specify PEM in the JSON envelope because that would need base64 encoding otherwise, but a different envelope format (say CBOR or protobuf) might want a binary format encoding of the certificate. |
||
the key used to sign the message. As with Sign(), details on the trusted root | ||
certificates are agreed upon out-of-band by the signer and verifier. This | ||
ensures the necessary information to verify the signature remains alongside | ||
the metadata. | ||
|
||
Functions: | ||
|
||
* PAE() is the "Pre-Authentication Encoding", where parameters `type` and | ||
|
@@ -77,25 +84,27 @@ Functions: | |
Out of band: | ||
|
||
- Agree on a PAYLOAD_TYPE and cryptographic details, optionally including | ||
KEYID. | ||
KEYID and trusted root certificates and constraints. | ||
|
||
To sign: | ||
|
||
- Serialize the message according to PAYLOAD_TYPE. Call the result | ||
SERIALIZED_BODY. | ||
- Sign PAE(UTF8(PAYLOAD_TYPE), SERIALIZED_BODY). Call the result SIGNATURE. | ||
- Optionally, compute a KEYID. | ||
- Encode and transmit SERIALIZED_BODY, PAYLOAD_TYPE, SIGNATURE, and KEYID, | ||
preferably using the recommended [JSON envelope](envelope.md). | ||
- Encode and transmit SERIALIZED_BODY, PAYLOAD_TYPE, SIGNATURE, CERTIFICATE, | ||
and KEYID, preferably using the recommended [JSON envelope](envelope.md). | ||
|
||
asraa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
To verify: | ||
|
||
- Receive and decode SERIALIZED_BODY, PAYLOAD_TYPE, SIGNATURE, and KEYID, such | ||
as from the recommended [JSON envelope](envelope.md). Reject if decoding | ||
fails. | ||
- Receive and decode SERIALIZED_BODY, PAYLOAD_TYPE, SIGNATURE, KEYID, and | ||
CERTIFICATE such as from the recommended [JSON envelope](envelope.md). | ||
Reject if decoding fails. | ||
- Optionally, filter acceptable public keys by KEYID. | ||
- Verify SIGNATURE against PAE(UTF8(PAYLOAD_TYPE), SERIALIZED_BODY). Reject if | ||
the verification fails. | ||
- Verify SIGNATURE against PAE(UTF8(PAYLOAD_TYPE), SERIALIZED_BODY) using | ||
the predefined roots of trust and constraints optionally CERTIFICATE. If | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: remove "constraints" same on line 132 below |
||
CERTIFICATE is specified, it MUST be verified against a trusted root | ||
certificate. Reject if the verification fails. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "trusted root certificate and path validation" or similar same on line 134 below |
||
- Reject if PAYLOAD_TYPE is not a supported type. | ||
- Parse SERIALIZED_BODY according to PAYLOAD_TYPE. Reject if the parsing | ||
fails. | ||
asraa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -119,8 +128,10 @@ To verify a `(t, n)`-ENVELOPE: | |
Reject if decoding fails. | ||
- For each (SIGNATURE, KEYID) in SIGNATURES, | ||
- Optionally, filter acceptable public keys by KEYID. | ||
- Verify SIGNATURE against PAE(UTF8(PAYLOAD_TYPE), SERIALIZED_BODY). Skip | ||
over if the verification fails. | ||
- Verify SIGNATURE against PAE(UTF8(PAYLOAD_TYPE), SERIALIZED_BODY) using | ||
the predefined roots of trust and constraints optionally CERTIFICATE. If | ||
CERTIFICATE is specified, it MUST be verified against a trusted root | ||
certificate. Reject if the verification fails. | ||
- Add the accepted public key to the set ACCEPTED_KEYS. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: ACCEPTED_KEYS is no longer correct. What should this be instead? |
||
- Break if the cardinality of ACCEPTED_KEYS is greater or equal to `t`. | ||
- Reject if the cardinality of ACCEPTED_KEYS is less than `t`. | ||
|
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.
nits: