Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find modern replacement for LuaCrypto: luaossl ? #33

Open
vschiavoni opened this issue May 29, 2015 · 0 comments
Open

Find modern replacement for LuaCrypto: luaossl ? #33

vschiavoni opened this issue May 29, 2015 · 0 comments

Comments

@vschiavoni
Copy link
Member

The LuaCrypto project seems to be abandoned since two years without newer releases or updates since.
The compilation of the Splay-related modules outputs tons of warnings, especially on OS X, that can eventually break the compatibility.

There is a viable alternative to it:
https://github.com/wahern/luaossl

We use LuaCrypto's methods in 4 places:

  • install_check.lua:require"crypto"
    • easy to fix : just change to require"openssl"
  • modules/splay/restricted_io.lua:local crypto = require"crypto"
    • we use the crypto.evp module to compute MD5 hashes in various places within this module.
  • modules/splay/urpc.lua:local crypto = require"crypto"
    • we use the following code to compute the base key of each outgoing message:
base_key = crypto.evp.new("sha1"):digest(math.random()..tostring(seed))

again using the crypto.evp module;

  • splayd.lua:crypto = require"crypto"
    • we use it to compute SHA1 digests of strings to generate per-job filesystems

We also use LuaSec to establish secure connections between the controller and the splay daemons:

if SSL and status then
        -- TLS/SSL client parameters
        local params = {
                mode = "client",
                protocol = "sslv3",
                verify = "none",
                options = "all",
                -- Optional if luasec 0.21+
                key = "key.pem",
                certificate = "client.pem",
        }
        so, err = ssl.wrap(so, params)
        if not so then
                print("Error creating SSL socket:", err)
                os.exit()
        end
        status, err = so:dohandshake()
end

We need to check if luaoss can solve both problems at once, by letting us import only 1 library and use a modern library at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant