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

bmap file integrity #50

Open
Razaloc opened this issue Nov 23, 2022 · 1 comment · May be fixed by #59
Open

bmap file integrity #50

Razaloc opened this issue Nov 23, 2022 · 1 comment · May be fixed by #59
Labels

Comments

@Razaloc
Copy link
Contributor

Razaloc commented Nov 23, 2022

Bmaptools checks the integrity of the bmap file before starting to copy.

Bmap-rs has the value bmap_file_checksum inside the Bmap struct but still does not check it. This is possible because there is a #[allow(dead_code)] flag in place.

@Razaloc
Copy link
Contributor Author

Razaloc commented Nov 23, 2022

On top of this, the bmap file can be signed using OpenPGP (gpg) and bmaptools
automatically verifies the signature if it is present.

Edit: We are not that interested in this signature feature.

Razaloc added a commit that referenced this issue Dec 1, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
@Razaloc Razaloc linked a pull request Dec 1, 2022 that will close this issue
Razaloc added a commit that referenced this issue Dec 1, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 1, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 1, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 1, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 2, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 2, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 2, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 2, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 5, 2022
Checks if the bmap hash is correct for the current bmap file.
Bmap file checksum is calculated having that field as all 0s.
In order to calculate the checksum we need to set the field in the file
as all "0" before applying Sha256.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 12, 2022
Before using a Bmap file checks if its checksum is correct for the
current bmap file.
Bmap checksum is the application of Sha256 to the file data. When the
bmap file is created, the value of the checksum has to be zero (all ASCII
"0" symbols). Once calculated, zeros are replaced by the checksum, notice
this modifies the file itself.
In order to calculate the checksum before using it and compare it with
the original, we need to set the field as all "0" before applying Sha256.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 15, 2022
Before using a Bmap file checks if its checksum is correct for the
current bmap file.
Bmap checksum is the application of Sha256 to the file data. When the
bmap file is created, the value of the checksum has to be zero (all ASCII
"0" symbols). Once calculated, zeros are replaced by the checksum, notice
this modifies the file itself.
In order to calculate the checksum before using it and compare it with
the original, we need to set the field as all "0" before applying Sha256.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Dec 16, 2022
Before using a Bmap file checks if its checksum is correct for the
current bmap file.
Bmap checksum is the application of Sha256 to the file data. When the
bmap file is created, the value of the checksum has to be zero (all ASCII
"0" symbols). Once calculated, zeros are replaced by the checksum, notice
this modifies the file itself.
In order to calculate the checksum before using it and compare it with
the original, we need to set the field as all "0" before applying Sha256.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Jan 9, 2023
Before using a Bmap file checks if its checksum is correct for the
current bmap file.
Bmap checksum is the application of Sha256 to the file data. When the
bmap file is created, the value of the checksum has to be zero (all ASCII
"0" symbols). Once calculated, zeros are replaced by the checksum, notice
this modifies the file itself.
In order to calculate the checksum before using it and compare it with
the original, we need to set the field as all "0" before applying Sha256.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Jan 13, 2023
Before using a Bmap file checks if its checksum is correct for the
current bmap file.
Bmap checksum is the application of Sha256 to the file data. When the
bmap file is created, the value of the checksum has to be zero (all ASCII
"0" symbols). Once calculated, zeros are replaced by the checksum, notice
this modifies the file itself.
In order to calculate the checksum before using it and compare it with
the original, we need to set the field as all "0" before applying Sha256.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Razaloc added a commit that referenced this issue Jan 19, 2023
Before using a Bmap file checks if its checksum is correct for the
current bmap file.
Bmap checksum is the application of Sha256 to the file data. When the
bmap file is created, the value of the checksum has to be zero (all ASCII
"0" symbols). Once calculated, zeros are replaced by the checksum, notice
this modifies the file itself.
In order to calculate the checksum before using it and compare it with
the original, we need to set the field as all "0" before applying Sha256.

Closes: #50

Signed-off-by: Rafael Garcia Ruiz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant