Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constrain CBOR encoding to not use tags on components #142

Merged
merged 4 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TestVectors/addSignedSDBase.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"created": "2023-08-15T23:36:38Z",
"verificationMethod": "did:key:zUC7DerdEmfZ8f4pFajXgGwJoMkV1ofMTmEG5UoNvnWiPiLuGKNeqgRpLH2TV4Xe5mJ2cXV76gRN7LFQwapF1VFu6x2yrr5ci1mXqC1WNUrnHnLgvfZfMH7h6xP6qsf9EKRQrPQ#zUC7DerdEmfZ8f4pFajXgGwJoMkV1ofMTmEG5UoNvnWiPiLuGKNeqgRpLH2TV4Xe5mJ2cXV76gRN7LFQwapF1VFu6x2yrr5ci1mXqC1WNUrnHnLgvfZfMH7h6xP6qsf9EKRQrPQ",
"proofPurpose": "assertionMethod",
"proofValue": "u2V0ChdhAWFCGu4Bjdo1LcI-aZYIe5v5Caz1Pb-XCxcml-AyqVz_Ywgy98Xgm_k4aYkBwul8gHZICoPzrVYQuqeYacqeqBIkUN_w19que-L-OwwBMxGyUWNhAWEA6W78l002QsYw1zSNXvmpvQjAelPyeUvd-k7dzxWFL31Vd4F-JiBfjEwG6wYfQw_8rA-LL20rbTVaMF96WH5oY2EBYYKTvGvo9pXVJbxIrm3i4wkdhUxqKCTIGrnxFuAdZwWi6T3omD5wzZ7bAGbRneEEQSxBmXtvnC6Pr59nPv_v3HrAW9wq_uxYzF_NyaX3GPv0h_FV2T2OSao8C6uoyWiqIj9hAWCAAESIzRFVmd4iZqrvM3e7_ABEiM0RVZneImaq7zN3u_4VnL2lzc3VlcngdL2NyZWRlbnRpYWxTdWJqZWN0L3NhaWxOdW1iZXJ4Gi9jcmVkZW50aWFsU3ViamVjdC9zYWlscy8xeCAvY3JlZGVudGlhbFN1YmplY3QvYm9hcmRzLzAveWVhcngaL2NyZWRlbnRpYWxTdWJqZWN0L3NhaWxzLzI"
"proofValue": "u2V0ChVhQhruAY3aNS3CPmmWCHub-Qms9T2_lwsXJpfgMqlc_2MIMvfF4Jv5OGmJAcLpfIB2SAqD861WELqnmGnKnqgSJFDf8Nfarnvi_jsMATMRslFhYQDpbvyXTTZCxjDXNI1e-am9CMB6U_J5S936Tt3PFYUvfVV3gX4mIF-MTAbrBh9DD_ysD4svbSttNVowX3pYfmhhYYKTvGvo9pXVJbxIrm3i4wkdhUxqKCTIGrnxFuAdZwWi6T3omD5wzZ7bAGbRneEEQSxBmXtvnC6Pr59nPv_v3HrAW9wq_uxYzF_NyaX3GPv0h_FV2T2OSao8C6uoyWiqIj1ggABEiM0RVZneImaq7zN3u_wARIjNEVWZ3iJmqu8zd7v-FZy9pc3N1ZXJ4HS9jcmVkZW50aWFsU3ViamVjdC9zYWlsTnVtYmVyeBovY3JlZGVudGlhbFN1YmplY3Qvc2FpbHMvMXggL2NyZWRlbnRpYWxTdWJqZWN0L2JvYXJkcy8wL3llYXJ4Gi9jcmVkZW50aWFsU3ViamVjdC9zYWlscy8y"
}
}
2 changes: 1 addition & 1 deletion TestVectors/derivedRevealDocument.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"created": "2023-08-15T23:36:38Z",
"verificationMethod": "did:key:zUC7DerdEmfZ8f4pFajXgGwJoMkV1ofMTmEG5UoNvnWiPiLuGKNeqgRpLH2TV4Xe5mJ2cXV76gRN7LFQwapF1VFu6x2yrr5ci1mXqC1WNUrnHnLgvfZfMH7h6xP6qsf9EKRQrPQ#zUC7DerdEmfZ8f4pFajXgGwJoMkV1ofMTmEG5UoNvnWiPiLuGKNeqgRpLH2TV4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6d1Xs9OtCqjur_W5IuyPpEIHwjQ0lm0ApaD0BwlN4vjxhIToJd1C4zio8CRUGGlR0BbPOWH0dgpkmn60pEDUJs-UwZ_e2B46dxmpREhkq7eNmLm2sWHbZRf0Fhj-ySbD8oC4Qq1FzZQ72ZeksPqcuq6lPyoYM1sY5U45RVvjLw7TSIvehH4N7uedrpU1YwbSsg07zOKPbS_ZFtGIhU8iX9HclX0Dk_MeRk0iuW_kDKp98CHbkemZmyp8XhnOsekG4ZEgNjoTGZVzS8OGGbe3EZ1kKK6dsKMtB89VYLgdztzeRS4NT_qTfkYoCKqWqkvSQ8LPC7fSk1VOLjQeqJTDxGIY-ZU7qqsacLAIFCcJClME72nIcc7hhC7zn5wMNFxDdUUhzGlAmx0HR2p4Gk9MrkNCbtYqOSilaMvsn9lSgPDHFbmw6-xqj8vokD1CV8x_ouV-BebxECM-WcT867GoGQJpvFIapnZkjvv2ydNPgT2-qm_MWzposT14bxtsDFZMyO6YAAgEEAgMDBwQGBQCOAAECBQYICQoODxAREhOGAwQFCAkKRBEzd6o"
}
}
24 changes: 13 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -571,19 +571,20 @@ <h4>serializeBaseProofValue</h4>
header bytes `0xd9`, `0x5d`, and `0x02`.
</li>
<li>
Initialize `components` to an array with five elements containing the values of:
`bbsSignature`, `bbsHeader`, `publicKey`, `hmacKey`, and `mandatoryPointers`.
Initialize |components| to an array with five elements containing the values of:
|bbsSignature|, |bbsHeader|, |publicKey|, |hmacKey|, and |mandatoryPointers|.
</li>
<li>
CBOR-encode `components` and append it to `proofValue`.
CBOR-encode |components| per [[RFC8949]] where CBOR tagging MUST NOT be used on
any of the |components|. Append the produced encoded value to |proofValue|.
</li>
<li>
Initialize `baseProof` to a string with the multibase-base64url-no-pad-encoding
Initialize |baseProof| to a string with the multibase-base64url-no-pad-encoding
of `proofValue`. That is, return a string starting with "`u`" and ending with the
base64url-no-pad-encoded value of `proofValue`.
base64url-no-pad-encoded value of |proofValue|.
</li>
<li>
Return `baseProof` as <em>base proof</em>.
Return |baseProof| as <em>base proof</em>.
</li>
</ol>

Expand Down Expand Up @@ -848,16 +849,17 @@ <h4>serializeDerivedProofValue</h4>
proof header bytes `0xd9`, `0x5d`, and `0x03`.
</li>
<li>
Initialize `components` to an array with five elements containing the values of
`bbsProof`, `compressedLabelMap`, `mandatoryIndexes`, `selectiveIndexes`, and
`presentationHeader`.
Initialize |components| to an array with five elements containing the values of
|bbsProof|, |compressedLabelMap|, |mandatoryIndexes|, |selectiveIndexes|, and
|presentationHeader|.
</li>
<li>
CBOR-encode `components` and append it to `proofValue`.
CBOR-encode |components| per [[RFC8949]] where CBOR tagging MUST NOT be used on
any of the |components|. Append the produced encoded value to |proofValue|.
</li>
<li>
Return the <em>derived proof</em> as a string with the
multibase-base64url-no-pad-encoding of `proofValue`. That is, return a string
multibase-base64url-no-pad-encoding of |proofValue|. That is, return a string
starting with "`u`" and ending with the base64url-no-pad-encoded value of
`proofValue`.
</li>
Expand Down
Loading