Ask Your Question
0

Checksum Fedora 24

asked 2016-07-04 14:00:38 -0500

Herb gravatar image

I downloaded the Fedora 24 iso from the getfedora web site & the checksum key associated with this download. I am using a Windows 10 machine for this purpose.

The following is from my checksum analysis (I could not upload the text file, so some of the formatting here is a little off). The instructions (except for filenames) were taken directly from Web instruction page. This was my latest attempt. I have tried this with Fedora 23 & 24 (with the associated checksum files). I downloaded 23 two & 24 three times. I am wondering why the expected checksum comes up with sha256. Could the downloaded files be corrupt due to my slow internet connection (each iso download takes around 5 hours)? Is there a problem with the checksum file? Is this supposed to yield sha256? That seems odd; I expected a long string. Thanks, Herb

Mode LastWriteTime Length Name

---- ------------- ------ ----

-a---- 7/4/2016 3:08 AM 1541406720 Fedora-Workstation-Live-x86_64-24-1.2.iso

-a---- 7/3/2016 8:30 PM 1129 Fedora24CHECKSUM

-a---- 7/3/2016 6:30 PM 1859 Instructions.txt

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> $image = "Fedora-Workstation-Live-x86_64-24-1.2.iso"

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> $checksum_file = "Fedora24CHECKSUM"

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> $sha256 = New-Object -TypeName System.Security.Cryptography.sha256CryptoServiceProvider

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> $expected_checksum = ((Get-Content $checksum_file | Select-String -Pattern $image) -split " ")[0].ToLower()

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> $download_checksum = [System.BitConverter]::ToString($sha256.ComputeHash([System.IO.File]::ReadAllBytes("$PWD\$image"))).ToLower() -replace '-', ''

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> if ( $download_checksum -eq "$expected_checksum" ) {

 echo "Checksum test passed!"
 } else {
 echo "Checksum test failed."

}

Checksum test failed.

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> echo "Download Checksum: $download_checksum" Download Checksum: 8e12d7ba1fcf3328b8514d627788ee0146c0eef75a5e27f0674ee1fe4f1feaf6

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> echo "Expected Checksum: $expected_checksum" Expected Checksum: sha256

PS C:\Users\Herb\Documents\Computers\Downloads\Fedora24> if ( $download_checksum -eq "$expected_checksum" ) {

echo "Checksum test passed!"
} else {
echo "Checksum test failed."

}

Checksum test failed.


Checksum file:


-----BEGIN PGP SIGNED MESSAGE-----

Hash: SHA256

SHA256 (Fedora-Workstation-netinst-x86_64-24-1.2.iso) = 1d0aaa3dadba90bbac211729c406072dd91f67c04315effb50fd8d9e0aa8f6c0

SHA256 (Fedora-Workstation-Live-x86_64-24-1.2.iso) = 8e12d7ba1fcf3328b8514d627788ee0146c0eef75a5e27f0674ee1fe4f1feaf6

-----BEGIN PGP SIGNATURE-----

Version: GnuPG v1

iQIcBAEBCAAGBQJXY07bAAoJEHO96YOBtGUhf70P/2US3CO/mUNdV/9Aido/F4bt MdTEwCKh580k6OcDcgFu4R1pWUwNxVoJ00zQu5+5pElp6OfSj2TiSxDCpw74nxbz X5dUvldPQJZcfhEVY1n029g8/eDs4jDbUjYp+KslwXGG06k80nqX8knE54hcdgfQ TmAYrK+BWlAVGHS4grT83yoo2zWycz4akFU732Rg+z0PtII6SQbtzjdsxfkvbR62 kMFslnbTEm5uHeUVY9dt8mps/73XfR5eT6TzCnbSXwO0FWygVHht7w3Nr0Bvtg/W G33DOSSSqB6WJ49pGr45EeCBuYtUMieDYrh7mKq2VSm7ysvBbguWhBMQYwwNVJX8 PvdNYr+lk2Ep03hwbcam+RcTgsDp+hA4bKzCxhgCZmu0oCMDCJ1mB/E1/LfV9yvi oxqJDpXog+V1QQr1pvATpQ0yLV0VZ9YYJihPZ5wjO7GUeDNCOS/WKFb/s9wfjIkJ E4dOIrJ51sk4fcOERybpM01kqd5Rcuyxqz0iyU2Ww2crM8eDAQfTz1TH4WWQyahT qOKQU4Rn6NAqmhK5wRd/A0ZcF24DOmPWYbUYH3R7LqCj5tv4nAcD2ul8ee6/7q7Y WrD8ubHI9fn8GPEmH84kgRGrGI3KRR9yg3TWQJA9p9QY4HHd8Z98+ngLCG5dNgJK 4wbQihL69PedQ96+EIKd

=zsba

-----END PGP SIGNATURE-----

edit retag flag offensive close merge delete

Comments

Ah, seems that format of checksum changed, command for getting expected checkum should be updated, could you report issue to bugzilla? buzilla

component: install-guide

mkovarik gravatar imagemkovarik ( 2016-07-04 14:38:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-07-05 16:27:18 -0500

Herb gravatar image

As suggested by mkovarik, I logged on to Bugzilla & found that this is a oft repeated bug.

The first two lines of code, below, need to be modified for the file names on your system. The following solution worked on Windows 10 (though Ansgar had not explicitly tested it on that platform - Bug 1175759):

Ansgar Wiechers 2016-02-04 18:14:05 EST

The 2 GB limit mentioned by tlhackque@yahoo.com is a limitation of the [IO.File]::ReadAllBytes() method, not of PowerShell. And that method shouldn't be used in the first place, because it would read the entire file into memory. Read the file as a stream to prevent memory exhaustion.

The PowerShell code below should work on any Windows version that meets the following requirements:

  • Windows XP SP3 or newer
  • PowerShell v2 or newer
  • .NET Framework 3.5 or newer

Tested on Windows XP SP3, Windows 7 SP1, Windows Server 2008 R2 and Windows Server 2012.

$image = 'Fedora-Server-DVD-x86_64-21.iso' $checksum_file = 'Fedora-Server-21-x86_64-CHECKSUM'

$sha256 = New-Object Security.Cryptography.SHA256Managed

$stream = (Get-Item "$PWD\$image").OpenRead()

$download_checksum = [BitConverter]::ToString($sha256.ComputeHash($stream)).ToLower() -replace '-' $stream.Close()

$expected_checksum = ((Get-Content $checksum_file) -match [regex]::Escape($image) -split ' += +')[1].ToLower()

echo "Download Checksum: $download_checksum"

echo "Expected Checksum: $expected_checksum"

if ( $download_checksum -eq $expected_checksum ) {

echo "Checksum test passed!"

} else {

echo "Checksum test failed."

}

If you must, you can squeeze the calculation of $download_checksum in a single line like this:

$download_checksum = [BitConverter]::ToString((New-Object Security.Cryptography.SHA256Managed).ComputeHash((Get-Item "$PWD\$image").OpenRead())).ToLower() -replace '-'

edit flag offensive delete link more

Comments

My experience with Fedora-29 verification follows quite the same paths as described in this discussion.

I'm now trying to verify my download of Fedora-29-netinst-iso file on Windows 8.1 machine. First, I followed the instructions found under Fedora 29 documentation: verification in Windows PowerShell. When echoing $expected_checksum, "#" is displayed. Then, after having found this discussion, I followed the procedure described above. And when echoing, $expected_checksum shows "sha256 (fedora-workstation-netinst-i386-29-1.2.iso)". In my understanding, $download_checksum has a reasonable value.

KariL gravatar imageKariL ( 2018-12-30 13:10:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-07-04 14:00:38 -0500

Seen: 989 times

Last updated: Jul 05 '16