Bug 1266693

Summary: 3.3.1 Verifying checksums on Windows systems not correct
Product: [Retired] Fedora Documentation Reporter: fran_hermida
Component: install-guideAssignee: Petr Bokoc <pbokoc>
Status: CLOSED DUPLICATE QA Contact: Fedora Docs QA <docs-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: develCC: fran_hermida, me, pbokoc, toby, zach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-02 14:31:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description fran_hermida 2015-09-26 15:40:43 UTC
Description of problem:
Powershell command for getting expected checksum not correct:

$expected_checksum = ((Get-Content $checksum_file | Select-String -Pattern $image) -split " ")[0].ToLower()

Should be:

$expected_checksum = ((Get-Content $checksum_file | Select-String -Pattern $image) -split " ")[3].ToLower()

since checksum file content is:

SHA256 (Fedora-Live-Workstation-x86_64-22-3.iso) = 615abfc89709a46a078dd1d39638019aa66f62b0ff8325334f1af100551bb6cf

Comment 1 Toby Ovod-Everett 2015-11-09 04:32:42 UTC
In addition, the code in the documentation does not work on files larger than 2 GB (plus it reads the entire file into memory).  http://stackoverflow.com/questions/10521061/how-to-get-an-md5-checksum-in-powershell#comment22577307_10521162 (it should be davor's comment) suggests another approach that will stream the data through the checksum.

Substituting that logic into the approach in the documentation, one gets:

$download_checksum = [System.BitConverter]::ToString($sha256.ComputeHash([System.IO.File]::Open("$PWD\$image", [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read))) -replace '-', ''

Also, if anyone does update the documentation, they might as well update the filenames to 23!

Comment 2 Pete Travis 2016-02-02 14:31:00 UTC

*** This bug has been marked as a duplicate of bug 1175759 ***