Subject: [Teep] Size of NONCE in QueryRequest

From: Akira Tsukamoto <[email-masked]>
Date: Fri, 3 Apr 2020 17:35:42 +0900

Hi all,

I would like to ask expertise in the mailing list.

The QueryRequest has member of NONCE in representation of bstr
in teep protocol draft.

 From the feedback from the virtual hackathon last week in Japan,
I prefer using bstr less as possible and use number representation
in int or uint since it reduces the size of the teep message and
int/uint are more programing language friendly.

Then I came across how large the integer could be to hold nonce
in the member field.

Currently it is:

QueryRequest = {
...
      TOKEN : bstr,
...
      ? NONCE : bstr,
...
}

and would like to suggest

QueryRequest = {
...
      TOKEN => uint .size 4,
...
      ? NONCE => uint .size 4,
...
}

but not sure the unsigned 32bit is large enough or not.
The max of unsigned 32bit, 0x ff ff ff ff, is 4,294,967,295.
And do we expect negative numbers here, if not would like to use uint instead of int?

Any comments are welcome,

Akira

---

From: Russ Housley <[email-masked]>
Date: Fri, 3 Apr 2020 09:57:40 -0400

What is the NONCE supposed to do here? If it is replay protection, 4 bytes is not enough.  For example, OCSP uses up to 32 bytes.

Russ

> On Apr 3, 2020, at 4:35 AM, Akira Tsukamoto <[email-masked]> wrote:
> 
> Hi all,
> 
> ....
> ....
> ....
> ....
> ....
> ....

---

From: "Nancy Cam-Winget (ncamwing)" <[email-masked]>
Date: Fri, 3 Apr 2020 15:01:06 +0000

Hi Russ and Akira,
Yes the Nonce is for replay...in TEEP there was consensus to use RATs claims.  That said, the Nonce claim in RATS is a minimum 8bytes with a max of 64.  I agree that 4 is not enough....but what is the appropriate size for TEEP?  Perhaps 16?

	Nancy

On 4/3/20, 6:57 AM, "TEEP on behalf of Russ Housley" <[email-masked] on behalf of [email-masked]> wrote:

    Russ

    > Any comments are welcome,
    
    _______________________________________________
    TEEP mailing list
    [email-masked]
    https://www.ietf.org/mailman/listinfo/teep

---

From: Dave Thaler <[email-masked]>
Date: Sat, 4 Apr 2020 02:26:45 +0000

In my implementation I am currently using a UUID, which is 16 bytes.

Dave

-----Original Message-----
From: TEEP <[email-masked]> On Behalf Of Nancy Cam-Winget (ncamwing)
Sent: Friday, April 3, 2020 8:01 AM
To: Russ Housley <[email-masked]>; Akira Tsukamoto <[email-masked]>
Cc: [email-masked]
Subject: Re: [Teep] Size of NONCE in QueryRequest

Hi Russ and Akira,

	Nancy

    
    Russ

    _______________________________________________
    TEEP mailing list
    [email-masked]
    https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fteep&amp;data=02%7C01%7Cdthaler%40microsoft.com%7C33af635830f14492854308d7d7dfddcc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637215228833571038&amp;sdata=Axf5kugh6CD39EMisZQDCOKhPz8UwKwJYY7%2Fulw99bc%3D&amp;reserved=0

_______________________________________________
TEEP mailing list
[email-masked]
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fteep&amp;data=02%7C01%7Cdthaler%40microsoft.com%7C33af635830f14492854308d7d7dfddcc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637215228833571038&amp;sdata=Axf5kugh6CD39EMisZQDCOKhPz8UwKwJYY7%2Fulw99bc%3D&amp;reserved=0

---

From: Akira Tsukamoto <[email-masked]>
Date: Sat, 4 Apr 2020 11:30:51 +0900

Hi Russ, Nancy and Hannes,

Thanks for your comments.

I would like to use the same representative of NONCE in TEEP as EAT which
is `bstr .size (8..64)` , minimum 8 bytes, max 64 bytes, as Hannes mentioned
instead or int or uint which I mentioned earlier.

The int/uint could have only up to 8 bytes maximum.
While bstr could have variable length.

8 bytes in decimal max: 18446744073709551615
uint .size 8 in hex is: 1B FF FF FF FF FF FF FF FF
bstr .size 8 in hex is: 58 08 FF FF FF FF FF FF FF FF

The uint representation is only one byte smaller while bstr could go up to

64 bytes in decimal max:
13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095

uint .size 64 <- not possible
bstr .size 64 in hex is:
58 40
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF

Using the same type of NONCE in TEEP and RATS would make the implementation
easier and having less chance of having bug.

Now I have concrete idea of NONCE representation, thanks,

-Akira

On 4/4/2020 12:01 AM, Nancy Cam-Winget (ncamwing) wrote:
>      https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fteep&amp;data=02%7C01%7Cakira.tsukamoto%40aist.go.jp%7Cc51e52e8276d4717dc4408d7d7dfd8c8%7C18a7fec8652f409b8369272d9ce80620%7C0%7C0%7C637215228724902874&amp;sdata=Z26DiQp%2BxGFGWia508C3mzbemgri3pDyxrHlaLxrePg%3D&amp;reserved=0
>      
>

---

From: Mingliang Pei <[email-masked]>
Date: Sat, 4 Apr 2020 11:17:52 -0700

>> Using the same type of NONCE in TEEP and RATS would make the
implementation easier and having less chance of having bug.

A compelling argument for me to take this approach. Concur on this change.
Thanks,

Ming

On Fri, Apr 3, 2020 at 7:31 PM Akira Tsukamoto <[email-masked]>
wrote:

> > Yes the Nonce is for replay...in TEEP there was consensus to use RATs
> claims.  That said, the Nonce claim in RATS is a minimum 8bytes with a max
> of 64.  I agree that 4 is not enough....but what is the appropriate size
> for TEEP?  Perhaps 16?
> >
> >       Nancy
> >
> > On 4/3/20, 6:57 AM, "TEEP on behalf of Russ Housley" <
> [email-masked] on behalf of [email-masked]> wrote:
> >
> >      What is the NONCE supposed to do here? If it is replay protection,
> 4 bytes is not enough.  For example, OCSP uses up to 32 bytes.
> >
> >      Russ
> >
> >
> https://clicktime.symantec.com/3B9CV59AdeoPLksjdX1hMLm7Vc?u=https%3A%2F%2Fjpn01.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fwww.ietf.org%252Fmailman%252Flistinfo%252Fteep%26data%3D02%257C01%257Cakira.tsukamoto%2540aist.go.jp%257Cc51e52e8276d4717dc4408d7d7dfd8c8%257C18a7fec8652f409b8369272d9ce80620%257C0%257C0%257C637215228724902874%26sdata%3DZ26DiQp%252BxGFGWia508C3mzbemgri3pDyxrHlaLxrePg%253D%26reserved%3D0
> >
> >
>
> https://clicktime.symantec.com/32Hq3e1YQd8YgMJFEtDoneQ7Vc?u=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fteep
>