> On May 14, 2021, at 1:22 AM, John Mattsson 
> <[email protected]> wrote:
> 
> > I'm I'm pretty sure it is incorrect CDDL
> I don't know why you think this was incorrect CDDL. RFC 8610 even has the 
> following example [+(left: uint, right: uint)] (but this does not matter as I 
> think we have already taken the decision to use arrays).
> 
> > It would not be possible to decode correctly.
>  
> I don’t think that was true. That would only be true if you cannot determine 
> the number of elements from c509CertificateType (but this does not matter as 
> I think we have already taken the decision to use arrays).
>  

Yes, you are right, as long as the number of items is fixed, you can count and 
successfully decode (didn’t think of counting like that).

You’d have to be aware of this every time you designed a CBOR protocol that 
uses CBORCertificate

For example, you couldn’t count for this protocol, but it works fine if 
CBORCertificate is an array.

   [ 
       * cert : CBORCertificate
       * vector : int
   ]

I still think everyone’s life will be easier if CBORCertificate defined as an 
array so it works as expected for CBOR-based protocols and you unwrap the array 
to save the byte in non-CBOR protocols.

LL
_______________________________________________
COSE mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/cose

Reply via email to