Open aljones15 opened 3 years ago
Are we still using hs2019 as the alg?
No, but we need one for ed25519... let's create one called ed25519-2021
-- we'll have to lobby to get this added to the official specification.
What happens if I have multiple signatures in Signature-Input & one of them throws before verification?
By default, if one signature fails, the call to verify should fail. We may want to provide an option where you get back a list of all signatures that succeeded/failed.
Do I return the request with say 2/3 signatures filled?
Always design security systems to fail closed by default. So, by default, you say the signature verification for what was passed in failed. If we provide details in the error code/response, we should state which signatures failed and for what reason like: "unknown signature suite", "unknown keyid", "could not dereference keyid", etc.
What happens if I have multiple signatures in Signature & only one of them fails verification?
Fail closed. If one signature fails, the verification function should return false.
No, but we need one for ed25519... let's create one called ed25519-2021 -- we'll have to lobby to get this added to the official specification.
It looks like ed25519
was added to the latest version of the draft as an official enumeration.
By default, if one signature fails, the call to verify should fail. We may want to provide an option where you get back a list of all signatures that succeeded/failed.
I don't think this captures the specification intention of multiple signature support. I think that the invoker should specify the signature identifier they are wishing to inspect. If you inspect the example in the latest draft, you can see the proxy need to override the authority. This would cause the proxied request to no longer have the context to validate sig1
.
Latest Spec for Signing HTTP Messages Issue Tracker for Spec
Implementation:
Add
structured-headers
(see issue above) all examples in this issue use structured-field-valuesapi.parseRequest
:("sig1=(\"host\")"
{sig1: Item {value: [[Item]]}}
@request-target
created
as a unix time stamp"sig1=(\"host\" \"host\");created=1"
{sig1: Item {value: [[Item], [Item]], params: {created: 1}}}
keyid
keyid
is now optional (we can throw at another layer such as zvap-verify or invoke.)key
sf param in content identifiers"sig1=(\"foo\";key=a)"
[ Item { value: 'foo', params: { key: Symbol(a) } } ]
key
parse the corresponding header field value as a dictionaryprefix
sf param in content identifierssig1=(\"foo\";prefix=1)"
[ Item { value: 'foo', params: { prefix: 1 } } ]
prefix
parse the corresponding header field value as a list{signingString: 'bar', signature: 'foo', signatureInput: {}}
coveredContent
¶ms
params
is an object ex:{created: 12354532, expires: 9999999}
coveredContent
is an array.coveredContent
can be astring
or{value: 'foo', params: {prefix: 1}}
sig1
from input constructssig1
in the Signature header.\\n
at the end of each valueRemove
Authorization
headersoptions.authorizationHeaderName
fromapi.parseRequest
Change
keyid
is always lowercasealg
instead ofalgorithm
@signature-parameters
Remains
created
andexpires
do not change (unix time stamp integer)x-date
validateDateRange
api.parseRequest
Optional These 2 address a previous issue while solving issues related to where we validate key type via
alg
:alg
param to check the key type in the sign functionsalg
Questions
hs2019
as thealg
?@signature-params
still need to be in(parenthesis)
?@request-target
has an@
at the beginning, should I use@created
for the created sig param?created
as a param of a signature input: do I just include it in the signature string?Signature-Input: sig1=("@request-target" "host" "date" "cache-control" \ "x-empty-header" "x-example");created=1618884475;\ keyid="test-key-rsa-pss"
created
is not in the covered content list, but is defined as a sf parameter of sig1created
in the signing string here, but not sure.created
is included in the@signature-params
part of the signing string creation@signature-params
Signature-Input
& one of them throws before verification?Signature
& only one of them fails verification?Tests
@request-target
examples from the specSignature-Input
&Signature
headers overAuthorization
header