aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-12-07 12:21:24 +1000
committeronefang2019-12-07 12:21:24 +1000
commiteb240003e7521deba975960e7620c1ad213e4c48 (patch)
tree9c4f382a9c6210ecde381cc69647d604f1175497
parentTweakage of how Packages are checked. (diff)
downloadapt-panopticon-eb240003e7521deba975960e7620c1ad213e4c48.zip
apt-panopticon-eb240003e7521deba975960e7620c1ad213e4c48.tar.gz
apt-panopticon-eb240003e7521deba975960e7620c1ad213e4c48.tar.bz2
apt-panopticon-eb240003e7521deba975960e7620c1ad213e4c48.tar.xz
MD5sums are deprecated in favour of sha256, so don't bother with them anymore.
-rwxr-xr-xapt-panopticon.lua10
1 files 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)
692 for l in io.lines('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages') do 692 for l in io.lines('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages') do
693 if "Package: " == l:sub(1, 9) then 693 if "Package: " == l:sub(1, 9) then
694 if 0 ~= #pp then 694 if 0 ~= #pp then
695 for i = 1, 6 do 695 for i = 1, 5 do
696 if nil == pp[i] then print(host .. " " .. r .. " " .. dir .. " " .. i) else Pp:write(pp[i] .. " | ") end 696 if nil == pp[i] then print(host .. " " .. r .. " " .. dir .. " " .. i) else Pp:write(pp[i] .. " | ") end
697 end 697 end
698 Pp:write("\n") 698 Pp:write("\n")
@@ -705,10 +705,8 @@ local postDownload = function(host, r, k)
705 pp[3] = l:sub(11, -1) 705 pp[3] = l:sub(11, -1)
706 elseif "Size: " == l:sub(1, 6) then 706 elseif "Size: " == l:sub(1, 6) then
707 pp[4] = l:sub(7, -1) 707 pp[4] = l:sub(7, -1)
708 elseif "MD5sum: " == l:sub(1, 8) then
709 pp[5] = l:sub(9, -1)
710 elseif "SHA256: " == l:sub(1, 8) then 708 elseif "SHA256: " == l:sub(1, 8) then
711 pp[6] = l:sub(9, -1) 709 pp[5] = l:sub(9, -1)
712 end 710 end
713 end 711 end
714 Pp:close() 712 Pp:close()
@@ -1034,7 +1032,7 @@ if 0 < #arg then
1034 local nfile, e = io.open('results/NEW_Packages_' .. n .. '.test.txt', "r") 1032 local nfile, e = io.open('results/NEW_Packages_' .. n .. '.test.txt', "r")
1035 if nil == nfile then W("opening results/NEW_Packages_" .. n .. ".test.txt file - " .. e) else 1033 if nil == nfile then W("opening results/NEW_Packages_" .. n .. ".test.txt file - " .. e) else
1036 for l in nfile:lines() do 1034 for l in nfile:lines() do
1037 local v, p, sz, m, sha = l:match(' | (.+) | (pool/.+%.deb) | (%d.+) | (%x.+) | (%x.+) |') 1035 local v, p, sz, sha = l:match(' | (.+) | (pool/.+%.deb) | (%d.+) | (%x.+) |')
1038 if nil ~= p then 1036 if nil ~= p then
1039 if checkFile('results/' .. pu.host .. "/merged/" .. p) then 1037 if checkFile('results/' .. pu.host .. "/merged/" .. p) then
1040 local status, fsz = execute('ls -l results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 5-5') 1038 local status, fsz = execute('ls -l results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 5-5')
@@ -1043,8 +1041,6 @@ if 0 < #arg then
1043 E('Package size mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host) 1041 E('Package size mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host)
1044 print('|' .. sz .. '~=' .. fsz:sub(2, -2) .. '|') 1042 print('|' .. sz .. '~=' .. fsz:sub(2, -2) .. '|')
1045 else 1043 else
1046 local status, fm = execute('md5sum results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 1')
1047 if m ~= fm:sub(2, -2) then E('Package MD5 sum mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host) end
1048 local status, fsha = execute('sha256sum results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 1') 1044 local status, fsha = execute('sha256sum results/' .. pu.host .. "/merged/" .. p .. ' | cut -d " " -f 1')
1049 if sha ~= fsha:sub(2, -2) then E('Package SHA256 sum mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host) end 1045 if sha ~= fsha:sub(2, -2) then E('Package SHA256 sum mismatch - results/' .. pu.host .. "/merged/" .. p, 'http', 'Integrity', pu.host) end
1050-- TODO - maybe check the PGP key, though packages are mostly not signed. 1046-- TODO - maybe check the PGP key, though packages are mostly not signed.