rework app registry - trust tweaks

This commit is contained in:
kepler155c@gmail.com
2017-05-19 19:00:23 -04:00
parent fbe2c9e909
commit 8ecfea1524
33 changed files with 282 additions and 68 deletions

View File

@@ -69,6 +69,30 @@ function os.getSecretKey()
return config.secretKey
end
function os.getPublicKey()
local exchange = {
base = 11,
primeMod = 625210769
}
local function modexp(base, exponent, modulo)
local remainder = base
for i = 1, exponent-1 do
remainder = remainder * remainder
if remainder >= modulo then
remainder = remainder % modulo
end
end
return remainder
end
local secretKey = os.getSecretKey()
return modexp(exchange.base, secretKey, exchange.primeMod)
end
function os.updatePassword(password)
Config.load('os', config)
config.password = password
@@ -127,6 +151,8 @@ function os.getVersion()
return version or 1.7
end
-- move completely into overview
-- just post event from appstore
function os.registerApp(entry)
local apps = { }
Config.load('apps', apps)