> > > Section 7.2.
> > > I've had several implementers trying to use JWS in the JSON serialization
> > > ask why
> > > it was necessary to include a "signatures" array in cases where there's
> > > only one
> > > signer. It seems like this is going to be a major barrier to deployment
> > > and re-
> > > use, so I would propose including the following text:
> > >
> > > """
> > > In cases where the JWS has been signed by only a single signer, the
> > > "signatures"
> > > array will contain a single object. In such cases, the elements of the
> > > single
> > > "signatures" object MAY be included at the top level of the JWS object.
> > > A JSON-
> > > formatted JWS that contains a "signatures" field MUST NOT contain a
> > > "protected", "header", or "signature" field, and vice versa.
> > > """
> > >
> > > This may also require some other changes where "signatures" is relied on,
> > > e.g.,
> > > in Section 9 of the JWE spec.
> > This was previously proposed (I believe during the Denver interim meeting)
> > and rejected by the working group because it complicates both producers and
> > parsers by introducing an unnecessary special case. Currently, by design,
> > whether there are single or multiple signatures, the same syntax is used.
> > Your proposal would use a different syntax in the single signature case
> > than in the multiple signature case. This is likely to result in
> > implementation bugs and inconsistencies.
> >
> > This assertion of complexity is bogus. Have you implemented this syntax,
> > or can you point me to someone who has, and has had problems? I have
> > implemented it and I'm asking for the simpler syntax. I've gotten the same
> > request from others, for JWE.
>
> I'm not saying that anything is insurmountable. I'm saying that having two
> equivalent syntaxes in the JSON Serialization for the same thing is going to
> make it more likely that some implementations won't correctly support both of
> them. For those following along, those two syntaxes would be:
>
> {
> "payload":"<payload contents>",
> "signatures":[
> {"protected":"<integrity-protected header 1 contents>",
> "header":<non-integrity-protected header 1 contents>,
> "signature":"<signature 1 contents>"}]
> }
>
> and
>
> {
> "payload":"<payload contents>",
> "protected":"<integrity-protected header 1 contents>",
> "header":<non-integrity-protected header 1 contents>,
> "signature":"<signature 1 contents>"
> }
>
> It's worth noting that the multi-signer case reduces to the single-signer
> case, e.g.:
>
> <script>
> var JWS = get_jws();
> if ("signatures" in JWS) {
> // i = index of a signature we'll use
> JWS.protected = JWS.signatures[i].protected
> JWS.header = JWS.signatures[i].header
> JWS.signature = JWS.signatures[i].signature
> } else if (! ("signature" in JWS) && (("protected" in JWS) || ("header" in
> JWS))) {
> throw "malformed JWS";
> }
> var result = validate_single_signer_jws(JWS)
> </script>
> Or copy "payload" up into each signature object. Or iterate through
> signatures and see which ones work. Either way, you're going to build this
> with a "verify single signature" primitive.
>
> Is your motivating use case a profile of the JSON Serialization in which
> multiple signatures aren't used or supported, and so for which the array
> notation would always be superfluous syntax? Are you concerned that if this
> profile becomes the predominant use case, that some/many implementations
> wouldn't implement the more general multi-signature syntax (or would
> implement it incorrectly, since it would normally not ever be used or tested)?
>
> If you look at existing uses for signed objects (such as they are),
> single-signer is by far the dominant use case, so requiring the multiple
> signer notation is would almost always be superfluous syntax.
> I'm not all that concerned about support for multi-sig. If implementations
> care about it, it will get built. And because of the way this has been
> designed, it's easy to build once you've got the single-signer version (see
> above).
>
>
> I'd love to hear others in the working group chime in on this topic...
There appears to be working group support for this position and the related
position for JWE. I'm writing to let you know that, unless I hear objections
from the working group in the next few days, I will plan to accept this
suggestion and incorporate it into the -36 drafts.
-- Mike
_______________________________________________
jose mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/jose