From eb240003e7521deba975960e7620c1ad213e4c48 Mon Sep 17 00:00:00 2001 From: onefang Date: Sat, 7 Dec 2019 12:21:24 +1000 Subject: MD5sums are deprecated in favour of sha256, so don't bother with them anymore. --- apt-panopticon.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index de6f271..db500e7 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -692,7 +692,7 @@ local postDownload = function(host, r, k) for l in io.lines('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages') do if "Package: " == l:sub(1, 9) then if 0 ~= #pp then - for i = 1, 6 do + for i = 1, 5 do if nil == pp[i] then print(host .. " " .. r .. " " .. dir .. " " .. i) else Pp:write(pp[i] .. " | ") end end Pp:write("\n") @@ -705,10 +705,8 @@ local postDownload = function(host, r, k) pp[3] = l:sub(11, -1) elseif "Size: " == l:sub(1, 6) then pp[4] = l:sub(7, -1) - elseif "MD5sum: " == l:sub(1, 8) then - pp[5] = l:sub(9, -1) elseif "SHA256: " == l:sub(1, 8) then - pp[6] = l:sub(9, -1) + pp[5] = l:sub(9, -1) end end Pp:close() @@ -1034,7 +1032,7 @@ if 0 < #arg then local nfile, e = io.open('results/NEW_Packages_' .. n .. '.test.txt', "r") if nil == nfile then W("opening results/NEW_Packages_" .. n .. ".test.txt file - " .. e) else for l in nfile:lines() do - local v, p, sz, m, sha = l:match(' | (.+) | (pool/.+%.deb) | (%d.+) | (%x.+) | (%x.+) |') + local v, p, sz, sha = l:match(' | (.+) | (pool/.+%.deb) | (%d.+) | (%x.+) |') if nil ~= p then if checkFile('results/' .. pu.host .. "/merged/" .. p) then local status, fsz = execute('ls -l results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 5-5') @@ -1043,8 +1041,6 @@ if 0 < #arg then E('Package size mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host) print('|' .. sz .. '~=' .. fsz:sub(2, -2) .. '|') else - local status, fm = execute('md5sum results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 1') - if m ~= fm:sub(2, -2) then E('Package MD5 sum mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host) end local status, fsha = execute('sha256sum results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 1') if sha ~= fsha:sub(2, -2) then E('Package SHA256 sum mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host) end -- TODO - maybe check the PGP key, though packages are mostly not signed. -- cgit v1.1