forked from I2P_Developers/i2p.www
propagate from branch 'i2p.www' (head fcd7d836b79ef46ef8fe9c5b8071d245efd54e29)
to branch 'i2p.www.revamp' (head e09d39855896e1387e30b596c8b0d71b202bf20b)
This commit is contained in:
@@ -1,24 +1,77 @@
|
||||
<code>
|
||||
<pre>
|
||||
function intersection(a,b)
|
||||
local s={}
|
||||
local t={}
|
||||
for k,v in pairs(a) do s[v.name] = 1 end
|
||||
for k,v in pairs(b) do if s[v] ~= nil then table.insert(t,v) end end
|
||||
return t
|
||||
end
|
||||
-- This implements a list of trusted signers.
|
||||
-- It is used on checkout and update.
|
||||
-- It is not used for repo sync/push/pull.
|
||||
-- If you do not include this function in ~/.monotone/monotonerc, the
|
||||
-- default is to trust everybody, which is probably a bad thing
|
||||
-- in an anonymous network.
|
||||
-- Update the list below to reflect the signers YOU trust.
|
||||
--
|
||||
-- ref: http://www.monotone.ca/docs/Trust-Evaluation-Hooks.html
|
||||
-- Modified to use key identities instead of key names, since
|
||||
-- monotone allows duplicate key names, so any key-name-based
|
||||
-- trust system is insecure.
|
||||
|
||||
--
|
||||
-- Modified from intersection() to use key identities instead of key names, since
|
||||
-- monotone allows duplicate key names.
|
||||
--
|
||||
-- a: table of ID structures (see above)
|
||||
-- b: table of hex IDs
|
||||
--
|
||||
function keyintersection(a,b)
|
||||
local s={}
|
||||
local t={}
|
||||
for k,v in pairs(a) do s[v.id] = 1 end
|
||||
for k,v in pairs(b) do if s[v] ~= nil then table.insert(t,v) end end
|
||||
return t
|
||||
end
|
||||
|
||||
--
|
||||
-- from mtn source project.hh and lua_hooks.cc:
|
||||
-- signers is a table of integers (starting with 1) to the following ID structure:
|
||||
-- struct ID
|
||||
-- {
|
||||
-- id: (key_id in key_identity_info) hex of revision id hash;
|
||||
-- given_name: (given_name in key_identity_info) // name given when creating the key
|
||||
-- name: (official_name in key_identity_info) // name returned by hooks or (once implented) policy
|
||||
-- };
|
||||
-- id: hex of revision id hash;
|
||||
-- name: cert_name
|
||||
-- val: cert_value
|
||||
--
|
||||
function get_revision_cert_trust(signers, id, name, val)
|
||||
local trusted_signers = { "complication@mail.i2p", "zzz@mail.i2p", "dev@welterde.de",
|
||||
"Oldaris@mail.i2p", "sponge@mail.i2p", "dream@mail.i2p", "mathiasdm@mail.i2p",
|
||||
"mkvore-commit@mail.i2p", "z3d@mail.i2p", "cervantes@mail.i2p", "BlubMail@mail.i2p",
|
||||
"walking@mail.i2p", "neutron@mail.i2p", "HungryHobo@mail.i2p", "russiansponsor@mail.i2p",
|
||||
"echelon@mail.i2p", "forget@mail.i2p", "privateer@mail.i2p", "duck@mail.i2p",
|
||||
"m1xxy@mail.i2p", "hiddenz@mail.i2p", "dev@robertfoss.se", "hamada@mail.i2p",
|
||||
"magma@mail.i2p", "kytv@mail.i2p", "str4d@mail.i2p", "meeh@mail.i2p",
|
||||
"zab@mail.i2p"
|
||||
local trusted_signers = {
|
||||
"5bc185cfd680eb512fdb9626b9fb4298e136215e", -- BlubMail@mail.i2p
|
||||
"f6706ac205e6b5d7a7e3ea4244ab0ef497f0a099", -- cervantes@mail.i2p
|
||||
"690f278ff6c6157cbaf23b0d602b6d6dcf368313", -- complication@mail.i2p
|
||||
"eb4ac08d5ddbb2bd73889f86c1211424025a6f07", -- dev@robertfoss.se
|
||||
"aae785027c240ebbb0a883fd8ebcf8d6ecee4104", -- dev@welterde.de
|
||||
"4ebaace9973913416af92ee8d0fb93d64753df4c", -- dream@mail.i2p
|
||||
"7e498ae94c9c322404adfc61b16bed388095906b", -- duck@mail.i2p
|
||||
"56c0064a8638fe180ed2f2726d6e2e404c788d3d", -- echelon@mail.i2p
|
||||
"0e4e7ebebafbdf4cdacc45a47ba155b1215d8e8b", -- forget@mail.i2p
|
||||
"f332b3d3b11b2efdae220cea75b9d5ba9ec3b52d", -- hamada@mail.i2p
|
||||
"e246444b4fe69ba599e13403c4ab931066de902f", -- hiddenz@mail.i2p
|
||||
"a61146ee69ddb9fcf3b82b19a62b8114b60d367e", -- HungryHobo@mail.i2p
|
||||
"4844b1fd45f5a68744fa28d2f3e3b61a3cf83b95", -- kytv@mail.i2p
|
||||
"c9b970f5e8917eada663d4c6b22096617021c95c", -- m1xxy@mail.i2p
|
||||
"3be64909d6ab7c3d7afe16f20f24e672708b576b", -- magma@mail.i2p
|
||||
"2977a6f4e11819a3f928783175caadc0071fc4de", -- mathiasdm@mail.i2p
|
||||
"de9d196e8057e1629178edbfa1ed754c648d7340", -- meeh@mail.i2p
|
||||
"2a0bba98558d7a9d7e4b1bd807789601252c0024", -- mkvore-commit@mail.i2p
|
||||
"6ade4b7a9a6425194f482ab351950e4230dbbc85", -- neutron@mail.i2p
|
||||
"bc74b49fd8a20513b2745a3d13414b7e9818dd18", -- Oldaris@mail.i2p
|
||||
"3fb8d1ee1e82981a8076ddbcbf4d18f372b8bba7", -- privateer@mail.i2p
|
||||
"e3815f0c985663182534fbd7d6a2bf93204a0bd0", -- russiansponsor@mail.i2p
|
||||
"1092773c40f5813b9179d52a8ab7b499b9554da3", -- sponge@mail.i2p
|
||||
"01265f0c817b24548478341fb75e672720a78b21", -- str4d@mail.i2p
|
||||
"38fe2aa37e1eb9a300a2061ef153265c48031c6b", -- walking@mail.i2p
|
||||
"a0eb78d437efad120dd9edcd776a327ec2c2adde", -- zab@mail.i2p
|
||||
"896e399990704373125f782ae2ee19b6611ac612" -- zzz@mail.i2p
|
||||
}
|
||||
local t = intersection(signers, trusted_signers)
|
||||
local t = keyintersection(signers, trusted_signers)
|
||||
if t == nil then return false end
|
||||
if table.getn(t) >= 1 then return true end
|
||||
return false
|
||||
|
Reference in New Issue
Block a user