Resolve "QR Code Data Signing & Verification flow"
Closes #9 (closed)
Merge request reports
Activity
added DevInProgress label
125 name: attachment.name, 126 size: attachment.size, 127 }; 128 }); 129 130 const dataForHashing = { 131 statusId: emailData.statusId, 132 sender: emailData.sender, 133 subject: emailData.subject, 134 date: emailData.date, 135 recipients: emailData.recipients, 136 attachments, 137 }; 138 139 const promises = Object.values(dataForHashing).map(async (value) => { 140 const base64 = Buffer.from(JSON.stringify(value)).toString("base64"); I have a concern regarding the
JSON.stringify
of the objects. I am not sure that it will preserve the ordering of the keys. Meaning that in one case you may have"{ name: "...", size: "...", url: "..." }
and in another ordering of keys might be different, and hence validation will fail.I guess it make sense do some object normalization beforehand. Sort keys alphabetically, for example. Or extract values.
Edited by Igor Markinchanged this line in version 2 of the diff
By Zdravko Iliev on 2020-11-25T16:06:25 (imported from GitLab project)
126 size: attachment.size, 127 }; 128 }); 129 130 const dataForHashing = { 131 statusId: emailData.statusId, 132 sender: emailData.sender, 133 subject: emailData.subject, 134 date: emailData.date, 135 recipients: emailData.recipients, 136 attachments, 137 }; 138 139 const promises = Object.values(dataForHashing).map(async (value) => { 140 const base64 = Buffer.from(JSON.stringify(value)).toString("base64"); 141 return CryptoService.SHA256(base64); Please, just pass strings here, not base64.
Currently,
CryptoService.SHA256
expects utf-8 encoded strings, and passing base64 might not be good.Edited by Igor Markinchanged this line in version 2 of the diff
By Zdravko Iliev on 2020-11-25T16:06:25 (imported from GitLab project)
added 1 commit
- f3a268e7 - stringify object prop sort
By Zdravko Iliev on 2020-11-25T16:06:26 (imported from GitLab project)
added 1 commit
- dc7a94b0 - build
By Zdravko Iliev on 2020-11-26T07:37:49 (imported from GitLab project)
added 1 commit
- 5da6112d - add arraybuffer to base64 before sorting
By Zdravko Iliev on 2020-11-26T08:49:29 (imported from GitLab project)
added 1 commit
- e0e87d69 - build
By Zdravko Iliev on 2020-11-26T08:50:07 (imported from GitLab project)
added 1 commit
- 77672477 - add sha256 to result
By Zdravko Iliev on 2020-11-26T11:49:44 (imported from GitLab project)
added 1 commit
- b4d106b7 - update status proto to last version
By Zdravko Iliev on 2020-11-27T10:54:54 (imported from GitLab project)
added 1 commit
- 1aa8cf78 - add qrcode
By Zdravko Iliev on 2020-11-27T12:02:25 (imported from GitLab project)
added 1 commit
- 86575444 - remove date from hashing values
By Zdravko Iliev on 2020-12-02T08:53:36 (imported from GitLab project)
added 1 commit
- 47e3d877 - Add check for email attachments
By Sasha Ilieva on 2020-12-02T14:19:22 (imported from GitLab project)
added 1 commit
- d640f44c - Define attachments as empty array
By Sasha Ilieva on 2020-12-02T14:44:10 (imported from GitLab project)
added ReadyForQA label and removed DevInProgress label
added ReadyForMergeInMaster label and removed ReadyForQA label
added 20 commits
-
d640f44c...0f47ddb7 - 8 commits from branch
master
- f29c2cbf - remove plain and html fingerprit from qrcode proto
- 11bae20d - add compute,sign and verify qr code
- 93c9490f - stringify object prop sort
- 757e41dc - build
- 8db290ee - add arraybuffer to base64 before sorting
- 8d04f057 - build
- 17555400 - add sha256 to result
- 369dda57 - update status proto to last version
- b98d7e1b - add qrcode
- 85599572 - remove date from hashing values
- b60b76c5 - Add check for email attachments
- 18e35e8c - Define attachments as empty array
By Zdravko Iliev on 2020-12-03T14:37:22 (imported from GitLab project)
Toggle commit list-
d640f44c...0f47ddb7 - 8 commits from branch
added 1 commit
- 3b5f5cf7 - add build
By Zdravko Iliev on 2020-12-03T14:40:07 (imported from GitLab project)
added 1 commit
- 773cca63 - remove package-lock
By Zdravko Iliev on 2020-12-03T14:42:39 (imported from GitLab project)