[webauthn] CDDL for attStmtType is confusing

jcjones has just created a new issue for https://github.com/w3c/webauthn:

== CDDL for attStmtType is confusing ==
When implementing the [CBOR-encoded Attestation Object](https://w3c.github.io/webauthn/#generating-an-attestation-object), the `attStmtTemplate` defines `attStmt` to be `bytes`:

```
attObj = {
            authData: bytes,
            $$attStmtType
         }

attStmtTemplate = (
                      fmt: text,
                      attStmt: bytes
                  )

; Every attestation statement format must have the above fields
attStmtTemplate .within $$attStmtType
```

However, all of the definitions of the `attStmtType` actually override the `attStmt` to be some other type, namely a **map**. E.g.:

```
  $$attStmtType //= (
                        fmt: "fido-u2f",
                        attStmt: u2fStmtFormat
                    )
  u2fStmtFormat = {
                      x5c: [ attestnCert: bytes, * (caCert: bytes) ],
                      sig: bytes
                  }
```

Defining it at the top-level as **bytes** is confusing, then. It's probably better to define the top-level as a blank map, so that it's clear what the type repeatedly is.

Please view or discuss this issue at https://github.com/w3c/webauthn/issues/577 using your GitHub account

Received on Tuesday, 19 September 2017 23:25:59 UTC