From 46382926884e8f52d545c276453b2a7a4857c8c6 Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 5 Mar 2021 17:18:41 +0100 Subject: properly add sha3 verification (mga#28466) --- en/downloads/get/index.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'en/downloads') diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php index 846cb5f32..1c9b93f23 100644 --- a/en/downloads/get/index.php +++ b/en/downloads/get/index.php @@ -253,14 +253,21 @@ if(isset($product['obsolete'])) {

array('md5sum', _r('md5 hash of the contents of the iso image')), + 'sha1' => array('sha1sum', _r('sha1 512 bit hash')), + 'sha512'=> array('sha512sum', _r('sha2 512 bit hash')), + 'sha3' => array('sha3-512sum', _r('sha3 512 bit hash')) +); $sum_links = array(); $chksm_cmd = ''; $sig_links = array(); -foreach ($checksums as $checksum) { +foreach (array_keys($checksum_specifics) as $checksum) { if (isset($product[$checksum])) { - $sum_links[] = "" . basename($download) . '.' . $checksum .''; - $chksm_cmd .= '$ ' . $checksum . 'sum -c ' . basename($download) . '.' . $checksum . ' # ' . _r('You need both iso and checksum file in the same folder'); + $each_checksum = "" . basename($download) . '.' . $checksum . ' (' . $checksum_specifics[$checksum][1] . ')'; + $sum_links[] = $each_checksum; + $chksm_cmd .= '$ ' . $checksum_specifics[$checksum][0] . ' -c ' . basename($download) . '.' . $checksum . ' # ' . _r('You need both iso and checksum file in the same folder'); $chksm_cmd .= "\n" . basename($download) . ": " . _r("OK") . " \n" . PHP_EOL; if (isset($product["$checksum.gpg"])) { $sig_links[] = "" . basename($download) . ".$checksum.gpg"; -- cgit v1.2.1