|
1 | 1 | local deps = { |
2 | | - { name = "luv", mod = "luv" }, |
3 | | - { name = "lsqlite3", mod = "lsqlite3" }, |
4 | | - { name = "cjson", mod = "cjson.safe" }, |
5 | | - { name = "luaossl", mod = "openssl" }, |
6 | | - { name = "sodium", mod = "sodium" }, |
| 2 | + { name = "luv", mods = { "luv" } }, |
| 3 | + { name = "lsqlite3", mods = { "lsqlite3" } }, |
| 4 | + { name = "cjson", mods = { "cjson.safe", "cjson" } }, |
| 5 | + { name = "luaossl", mods = { "openssl" } }, |
| 6 | + { name = "sodium", mods = { "sodium", "luasodium" } }, |
7 | 7 | } |
8 | 8 |
|
9 | 9 | local function require_any(label, modules) |
|
20 | 20 |
|
21 | 21 | -- core deps |
22 | 22 | for _, d in ipairs(deps) do |
23 | | - if not require_any(d.name, { d.mod }) then os.exit(1) end |
| 23 | + if not require_any(d.name, d.mods) then os.exit(1) end |
24 | 24 | end |
25 | 25 |
|
26 | 26 | -- Ed25519 signer: allow either ed25519 rock or sodium providing crypto_sign_* API |
27 | | -local ed25519_ok = require_any("ed25519", { "ed25519", "sodium" }) |
| 27 | +local ed25519_ok = require_any("ed25519", { "ed25519", "sodium", "luasodium" }) |
28 | 28 | if not ed25519_ok then os.exit(1) end |
29 | 29 |
|
30 | 30 | -- Fail-closed if signatures required and no sodium available (used for ed25519) |
|
0 commit comments