Skip to content

Error in decodeMdocIssuerSigned() while decoding data encoded by @auth0/mdl #310

@DibbsZA

Description

@DibbsZA

It seems there is some incompatibility between the Sphereon cbor encode/decoder and other libraries out there.

The scenario:
I am generating a sample mdoc credential using @auth0/mdl library.
It can be successfully decoded with the same library (eg Auth0 mdl debugger https://www.mdl.me/ ) or on another site https://cbor.zone/ by Authlete, Inc.

But that credential is not decodable using the Sphereon decodeMdocIssuerSigned() method from @sphereon/ssi-types@0.32.

Going the other direction, the credential data created by Sphereon functions IS readable by Auth0 and cbor.zone.

It results in this error:

MDOC generating fails: Key (label: issuerAuth, type: CDDL(format='tstr', majorType=UNICODE_STRING, info=null, aliasFor=[])) not found in cbor map
Stack trace:
	IllegalArgumentException: Key (label: issuerAuth, type: CDDL(format='tstr', majorType=UNICODE_STRING, info=null, aliasFor=[])) not found in cbor map
	at StringLabel.protoOf.required (C:\One37\Source2\one37id-bcjs-project\node_modules\sphereon-kmp-mdoc-core\sphereon-kmp-cbor\src\commonMain\kotlin\com\sphereon\cbor\CoseLabel.kt:32:19)
	at Static_12.protoOf.fromCborItem (C:\One37\Source2\one37id-bcjs-project\node_modules\sphereon-kmp-mdoc-core\build\src\commonMain\kotlin\com\sphereon\mdoc\data\device\IssuerSigned.kt:369:42)
	at Static_12.protoOf.cborDecode (C:\One37\Source2\one37id-bcjs-project\node_modules\sphereon-kmp-mdoc-core\build\src\commonMain\kotlin\com\sphereon\mdoc\data\device\IssuerSigned.kt:374:64)
	at decodeMdocIssuerSigned (C:\One37\Source2\one37id-bcjs-project\node_modules\.pnpm\@sphereon+ssi-types@0.32.0\node_modules\@sphereon\ssi-types\src\types\mso_mdoc.ts:125:66)

Here is an example in two formats.
base64Url

uQADZ3ZlcnNpb25jMS4waWRvY3VtZW50c4GiZ2RvY1R5cGV1b3JnLmlzby4xODAxMy41LjEubURMbGlzc3VlclNpZ25lZLkAAmpuYW1lU3BhY2VzoXFteS50ZXN0Lm5hbWVzcGFjZYHYGFhZpGhkaWdlc3R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pZGl0eUluZm-5AARmc2lnbmVkwHQyMDI1LTAyLTA3VDExOjE3OjIwWml2YWxpZEZyb23AdDIwMjUtMDItMDdUMTE6MTc6MjBaanZhbGlkVW50aWzAdDIwMjYtMDItMDdUMTE6MTc6MjBabmV4cGVjdGVkVXBkYXRl91hAnt9d_GnswtDy2J1mkvndYQFr4n0EcBGavGmWYHATbajG9IOiMyc9fvDjAVGO79eu3hyQ27LSRiyGa2P2JhLU42ZzdGF0dXMA

Hex

b900036776657273696f6e63312e3069646f63756d656e747381a267646f6354797065756f72672e69736f2e31383031332e352e312e6d444c6c6973737565725369676e6564b900026a6e616d65537061636573a1716d792e746573742e6e616d65737061636581d8185859a46864696765737449440071656c656d656e744964656e746966696572636167656c656c656d656e7456616c7565181d6672616e646f6d58205f29ac7016122cf78983eb52bb5676ca1bda3ac0144bfcabceab3cf9c1ca3b336a697373756572417574688443a10126a204582b523347553263746c445a425a42557337303573436b4a67646e4f38344f444a4d3751615446414d3259623018218159018b308201873082012da003020102020101300a06082a8648ce3d040302304d314b3009060355040613025553300f060355040a13084c6f63616c205043302d060355040313266169726564616c652d70726563696f75732d6561676c652e6e67726f6b2d667265652e617070301e170d3234313233313030303030305a170d3236313233313030303030305a304d314b3009060355040613025553300f060355040a13084c6f63616c205043302d060355040313266169726564616c652d70726563696f75732d6561676c652e6e67726f6b2d667265652e6170703059301306072a8648ce3d020106082a8648ce3d03010703420004cf8fc65a60d311569df5b5db17373593ad57f79c1e32f0c5b49a7e8be6b010f2cd84fdfec12ca79c476cc568af4d98ee8e6588f89ed2d87a1bae9487f3503ead300a06082a8648ce3d0403020348003045022000fbcc2cf944d819e52fd64b4808911581a55c9f3e48c3067893b48828bd88e802210087d8c1673b41b92e48a6da819a725749a6cc4c9c7888abd63c6e8ce832b2542c590174d81859016fb900066776657273696f6e63312e306f646967657374416c676f726974686d675348412d3235366c76616c756544696765737473a1716d792e746573742e6e616d657370616365a1005820d0a0b8bbe1db39467258094e1c18be64b8c0a74470ed8953d38379e70e53d9606d6465766963654b6579496e666fb90001696465766963654b6579a5032601022001215820386b581bf86fe68994da8dae5b2a0b1c97a50a47f25b50b977da8ebb92172aef2258201d584812b5db5deb5d2a3b78d0898fe22e449f6620da6911d6638c2dbef4a32367646f6354797065756f72672e69736f2e31383031332e352e312e6d444c6c76616c6964697479496e666fb90004667369676e6564c074323032352d30322d30375431313a31373a32305a6976616c696446726f6dc074323032352d30322d30375431313a31373a32305a6a76616c6964556e74696cc074323032362d30322d30375431313a31373a32305a6e6578706563746564557064617465f758409edf5dfc69ecc2d0f2d89d6692f9dd61016be27d0470119abc69966070136da8c6f483a233273d7ef0e301518eefd7aede1c90dbb2d2462c866b63f62612d4e36673746174757300

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions