Skip to content

Wrong MD5 hash generated for containers / federations #5461

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

Open
ChristosTsiotsias opened this issue Mar 14, 2025 · 1 comment
Open

Wrong MD5 hash generated for containers / federations #5461

ChristosTsiotsias opened this issue Mar 14, 2025 · 1 comment
Assignees
Labels

Comments

@ChristosTsiotsias
Copy link
Contributor

ChristosTsiotsias commented Mar 14, 2025

Description

The MD5 hashes generated in revision/files/original/info endpoints seem to be wrong.

Also the latest revision Id has to be returned in federation stats endpoint for it to be used from the plugin

Steps to replicate

  • Upload one file in a container and get its hash
  • Upload a second file in a container and get its hash

Current Behaviour

  • The two hashes are the same

Expected Behaviour

  • The two hashes should be different
@ChristosTsiotsias
Copy link
Contributor Author

ChristosTsiotsias commented Mar 14, 2025

const file = await FilesManager.getFile(teamspace, collection, filename); 
const newHash = CryptoJs.MD5(file).toString();

in \src\v5\services\filesManager.js seems to be wrong

instead we could do


const file = await FilesManager.getFile(teamspace, collection, filename);
const wordArray = CryptoJs.lib.WordArray.create(file);
const newHash = CryptoJs.MD5(wordArray).toString();

@ChristosTsiotsias ChristosTsiotsias self-assigned this Apr 10, 2025
ChristosTsiotsias added a commit that referenced this issue Apr 10, 2025
ChristosTsiotsias added a commit that referenced this issue Apr 10, 2025
ChristosTsiotsias added a commit that referenced this issue Apr 11, 2025
ChristosTsiotsias added a commit that referenced this issue Apr 11, 2025
ChristosTsiotsias added a commit that referenced this issue Apr 11, 2025
ChristosTsiotsias added a commit that referenced this issue Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant