w3c-ccg / vc-barcodes

Securing optical barcodes using Verifiable Credentials.
https://w3c-ccg.github.io/vc-barcodes/
5 stars 2 forks source link

A few errors in the Example 11 #13

Closed timothee-haudebourg closed 2 months ago

timothee-haudebourg commented 2 months ago

I've spotted what I believe to be a few errors in the PDF-417 payload showed in Example 11.

  1. There is a missing trailing space in the file type (should be ANSI), as mentioned in #12
  2. The DL subfile length seems wrong: it is set to 0267 where I find a value of 0234.
  3. The ZZ offset is wrong (probably because of 2.): it is set to 0308 (41 + 267) where I find a value of 0275 (41 + 275)
  4. The ZZ subfile lenght seems wrong: 0162 instead of 0202. This one can be easily decomposed as 202 = 2 (ZZ) + 3 + (ZZA) + 196 (base64-encoded CBOR-LD VC) + 1 (segment terminator)

Here is what I think is the correct payload:

@\n\x1e\rANSI 000000090002DL00410234ZZ02750202DLDAQF987654321\nDCSSMITH\nDDEN\nDACJOHN\nDDFN\nDADNONE\nDDGN\nDCAC\nDCBNONE\nDCDNONE\nDBD01012024\nDBB04191988\nDBA04192030\nDBC1\nDAU069 IN\nDAYBRO\nDAG123 MAIN ST\nDAIANYVILLE\nDAJUTO\nDAKF87P20000  \nDCFUTODOCDISCRIM\nDCGUTO\nDAW158\nDCK1234567890\nDDAN\rZZZZA2QZkpgGDGYAAGYABGYACGJ2CGHYYpBi4oxicGKYYzhiyGNAa5ZIggRi6ohicGKAYqER1ggAgGL4YqhjApRicGGwY1gQY4BjmGOJYQXq3wuVrSeLM5iGEziaBjhWosXMWRAG107uT_9bSteuPasCXFQKuPdSdF-xmUoFkA0yRJoW4ERvATNyewT263ZHMGOQYrA==\r

However it is possible I misunderstood something in AAMVA's PDF-417 data encoding.

wes-smith commented 2 months ago

@timothee-haudebourg Thanks for the thorough analysis! Updated barcodes with the correct header information will be in shortly.

msporny commented 2 months ago

PR #14 has been merged, closing.