Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Generated files for same chunk differ in binary #148

Closed
christian-kirschnick opened this issue May 17, 2020 · 7 comments
Closed

Generated files for same chunk differ in binary #148

christian-kirschnick opened this issue May 17, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@christian-kirschnick
Copy link
Member

christian-kirschnick commented May 17, 2020

After running the testdata profile twice, I noticed that the same file for the same chunk differs on byte level, although the file size is identical. This should not happen, as it will cause problems on CDN.

For the index file, it looks like missing sorting is causing the problem, one example:

[23,18,21,22,19,20]

@christian-kirschnick christian-kirschnick added the bug Something isn't working label May 17, 2020
@pithumke
Copy link
Member

Bug probably introduced through #96 when changing most List<...>'s to Collection<...>'s. DiagnosisKeyService now returns a sorted List, so to fix this bug, we probably just need to change the code back to using List<...>'s.

@johanneseschrig
Copy link
Member

Logic has changed, not relevant anymore

@pithumke
Copy link
Member

How is this issue not relevant anymore? IMHO, generated files for the same chunk still shouldn't differ in binary.

@christian-kirschnick
Copy link
Member Author

Since the generation code has changed a lot & Timon and me are working on #203, we will have an eye on this as well. I will reopen this, in case #203 will not fix it.

@christian-kirschnick
Copy link
Member Author

Re-opening, still valid.

@christian-kirschnick
Copy link
Member Author

Changed to sorted list for the TEK Exports:
https://github.com/corona-warn-app/cwa-server/compare/issues/148-binary-diff

Then ran the assembly process twice and picked the 20 hour package for current day.

Unfortunately,
colordiff -y <(xxd 20) <(xxd 20_2)

Still shows some diffs.

@UnchartedBull
Copy link
Contributor

Managed to convince the ZIP Library to create byte-identical archives. The payload signing creates different bytes for the same chunk each time though. Having the signing algorithm create the same bytes for the same chunk would be a security risk, so we can't create byte-identical archives for the same chunk.

@christian-kirschnick christian-kirschnick modified the milestones: RTC, Future Release Jun 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants