summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LICENSE2
-rw-r--r--aconf/model/aaa.lua12
-rw-r--r--aconf/persistence/util.lua4
-rwxr-xr-xinstall-deps.sh6
4 files changed, 15 insertions, 9 deletions
diff --git a/LICENSE b/LICENSE
index 1b1366f..495807a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2012-2017 Kaarle Ritvanen
+Copyright (c) 2012-2018 Kaarle Ritvanen
All rights reserved.
diff --git a/aconf/model/aaa.lua b/aconf/model/aaa.lua
index 982e5b3..e65b678 100644
--- a/aconf/model/aaa.lua
+++ b/aconf/model/aaa.lua
@@ -1,13 +1,14 @@
--[[
-Copyright (c) 2012-2016 Kaarle Ritvanen
+Copyright (c) 2012-2018 Kaarle Ritvanen
See LICENSE file for license details
--]]
local M = require('aconf.model')
local node = require('aconf.model.node')
local object = require('aconf.object')
+local map = require('aconf.util').map
-local digest = require('crypto').digest
+local digest = require('openssl.digest')
local conf_addr = '/json'..require('posix').getcwd()..'/config'
@@ -18,7 +19,12 @@ Role.permissions = M.Set{type=M.Reference{scope='../../../permissions'}}
local function hash_password(algorithm, salt, password)
- return algorithm..'$'..salt..'$'..digest(algorithm, salt..password)
+ return algorithm..'$'..salt..'$'..table.concat(
+ map(
+ function(b) return ('%02x'):format(b) end,
+ {string.byte(digest.new(algorithm):final(salt..password), 1, -1)}
+ )
+ )
end
local hash_pattern = '^(%w+)%$(%w+)%$%x+$'
diff --git a/aconf/persistence/util.lua b/aconf/persistence/util.lua
index d233b1d..792bdc8 100644
--- a/aconf/persistence/util.lua
+++ b/aconf/persistence/util.lua
@@ -1,5 +1,5 @@
--[[
-Copyright (c) 2012-2014 Kaarle Ritvanen
+Copyright (c) 2012-2018 Kaarle Ritvanen
See LICENSE file for license details
--]]
@@ -13,7 +13,7 @@ end
function M.read_file(path)
local file = M.open_file(path)
- local data = file:read('*all')
+ local data = file:read('a')
file:close()
return data
end
diff --git a/install-deps.sh b/install-deps.sh
index 589a5c3..5e95e5c 100755
--- a/install-deps.sh
+++ b/install-deps.sh
@@ -1,10 +1,10 @@
#!/bin/sh
-# Copyright (c) 2012-2015 Kaarle Ritvanen
+# Copyright (c) 2012-2018 Kaarle Ritvanen
# See LICENSE file for license details
-PACKAGES="lua5.2-augeas lua5.2-b64 lua5.2-cjson lua5.2-crypto lua5.2-file-magic
- lua5.2-openrc lua5.2-posix lua5.2-stringy uwsgi uwsgi-lua"
+PACKAGES="lua5.3-augeas lua5.3-b64 lua5.3-cjson lua5.3-file-magic lua5.3-openrc
+ lua5.3-ossl lua5.3-posix lua5.3-stringy uwsgi uwsgi-lua"
[ "$1" = -d ] && PACKAGES="$PACKAGES bash curl ldoc"