Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

deps/luacrypto: add a crypto library

luacrypto can provide all of the primitives to create an API identical
to node's crypto classes along with some x509 primitives that we are
using in virgo.

Initial commit. A wrapper that matches the nodejs API is coming soon.
  • Loading branch information...
commit 0bee6f21951ce38142fb73ae8f8040b17c382935 1 parent 34ba9f1
Brandon Philips authored
View
3  .gitmodules
@@ -16,3 +16,6 @@
[submodule "deps/openssl"]
path = deps/openssl
url = https://github.com/luvit/openssl.git
+[submodule "deps/luacrypto"]
+ path = deps/luacrypto
+ url = http://github.com/racker/luacrypto
1  deps/luacrypto
@@ -0,0 +1 @@
+Subproject commit 90539d70d0fc6d6286966a708a76307e2ae73fc4
View
38 deps/luacrypto.gyp
@@ -0,0 +1,38 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'luacrypto',
+ 'type': '<(library)',
+ 'dependencies': [
+ 'openssl/openssl.gyp:openssl',
+ 'luajit.gyp:*',
+ ],
+ 'sources': [
+ 'luacrypto/src/lcrypto.c',
+ ],
+ 'include_dirs': [
+ 'luacrypto/src',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ 'luacrypto/src',
+ ]
+ },
+ 'conditions': [
+ ['OS == "linux"', {
+ 'libraries': ['-ldl'],
+ }],
+ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
+ 'cflags': [ '--std=c89' ],
+ 'defines': [ '_GNU_SOURCE' ]
+ }],
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_C_LANGUAGE_STANDARD': 'c89',
+ }
+ }],
+ ],
+ }
+ ],
+}
+
View
4 luvit.gyp
@@ -9,7 +9,8 @@
'deps/yajl.gyp:yajl',
'deps/yajl.gyp:copy_headers',
'deps/uv/uv.gyp:uv',
- 'deps/zlib/zlib.gyp:zlib'
+ 'deps/zlib/zlib.gyp:zlib',
+ 'deps/luacrypto.gyp:luacrypto',
],
'export_dependent_settings': [
'deps/http-parser/http_parser.gyp:http_parser',
@@ -17,6 +18,7 @@
'deps/luajit.gyp:libluajit',
'deps/yajl.gyp:yajl',
'deps/uv/uv.gyp:uv',
+ 'deps/luacrypto.gyp:luacrypto',
],
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
View
4 src/luvit_init.c
@@ -32,6 +32,7 @@
#include "luv_dns.h"
#ifdef USE_OPENSSL
#include "luv_tls.h"
+#include "lcrypto.h"
#endif
#include "luv_zlib.h"
#include "luv_portability.h"
@@ -170,6 +171,9 @@ int luvit_init(lua_State *L, uv_loop_t* loop, int argc, char *argv[])
/* Register tls */
lua_pushcfunction(L, luaopen_tls);
lua_setfield(L, -2, "_tls");
+ /* Register tls */
+ lua_pushcfunction(L, luaopen_crypto);
+ lua_setfield(L, -2, "_crypto");
#endif
/* Register yajl */
lua_pushcfunction(L, luaopen_yajl);
View
18 tests/ca/README
@@ -0,0 +1,18 @@
+Testing x509 certs for luacrypto
+
+# Make the CA cert
+openssl genrsa -des3 -out ca.key 4096
+openssl req -new -x509 -days 365 -key ca.key -out ca.crt
+
+# Make server cert and signing request
+openssl genrsa -des3 -out server.key 4096
+openssl req -new -key server.key -out server.csr
+
+# Sign the server csr and generate a crt
+openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
+
+# Output unencrypted server key
+openssl rsa -in server.key -out server.key.insecure
+
+# Output "raw" public key from server crt
+openssl x509 -pubkey -noout -in server.crt > server.pub
View
21 tests/ca/broken/README
@@ -0,0 +1,21 @@
+## Testing x509 certs for luvit
+
+# Make the CA cert
+openssl genrsa -out ca.key 4096
+openssl req -new -x509 -days 365 -key ca.key -out ca.crt
+
+# Make server cert and signing request
+openssl genrsa -out server.key 4096
+openssl req -new -key server.key -out server.csr
+
+# Sign the server csr and generate a crt
+openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
+
+# Output unencrypted server key
+openssl rsa -in server.key -out server.key.insecure
+
+# Output "raw" public key from server crt
+openssl x509 -pubkey -noout -in server.crt > server.pub
+
+# Sign the public key with the key (just for testing signatures)
+openssl dgst -sign server.key.insecure -sha256 server.pub > server.pub.sig
View
33 tests/ca/broken/ca.crt
@@ -0,0 +1,33 @@
+-----BEGIN CERTIFICATE-----
+MIIFtTCCA52gAwIBAgIJANfWYo0ePBBqMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQwHhcNMTIwMzE1MjMxMzMwWhcNMTMwMzE1MjMxMzMwWjBF
+MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50
+ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
+CgKCAgEAyzBV/DH0PWmPxdnr3BTogxPYKVJQ4OQjiiALRRtYPjvQYKPWWsbt4Zlw
+kfYsc6ihIKUL1tGEnjD6YDTtTwWH7DXeq0mWebFr3kQg/ssoTM5oHN9VglwPMRnx
+7qqbBG0/LO/K2Go/UMFGmWHiRYRWcOYegq6DXJpj1sRJz8o3uk4Fxz/xr1sjng1l
+EfAfE4segFLRhmXy1e6Ooy2U5WcpDeKGrD1O01DKsYdR+RavcgkmFYfZ5rdtaKrE
+wpYLylJNmOAkss7w5tOyEEDLoZHtkRFX5Ss38wuU2h9Li8P9vhyL4Ylzcuy/pBXW
+MA89D8bBXjR3G4Hk7qX7gqlI9GdRXtPqnRpgEy/vw/+6aJVfNJtLIRdabSr3vStL
+rhF1y4ocr8OJdNjHGp8tssc9I0LhhItT7bWgjQLHTRezVXV5kzpggAlDCQc48bdc
+aYjBoLuu8jH9mgGCnPtrJMyV+T96rV5V4XJieA9k4IQ3nWJk1Nslqm5S/FSQbM32
++ineL0ZlT/x8qXNnL3FHQ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dKVMZZ2/p4vo5mgjq/54KZR8/5pnbjNZhW
+ZgVxQvpKvzbDCMYlraK6O7yX0ftE0076TQqK0v91ceue1evZE/BaYZsM+mVF9PiL
+SrrkhwCMfusp1N2pS5K24z29a/MvBbKpTB0jFVgijbfKKD+0/e3OlSJJxGhflTBU
+93xHXuYK5/FbgDEYURGwsbsUqOTIpsekzqS3Q0FgcpolB3phDb5D8HaUfvnScEup
+fplMZDU5rZl3281z3+abV4oArD+X9mnIiKWSt5AKoYoiQtynPPEGQoWcQSi02kfz
+ny88TPQpaiJ4g03JoxLCkH2R12uETazKqPYJIqhZ0pfYnEDVoE1luIfa5b47fAWd
+v7gmanoJn6NziDmJD0rVu131y4+bbRgd/2aPsVBhpP8qrbvc6GbLp4JvmwSfYEg9
+EcO9hYCe1CVUTVwvH0mNhYSQtknvnOWOj8nGPcScBJVXl7Dt74WgmWGzuWya8fzs
+DvfNYR414sCH+SNdMRv1tFsdFTguqSE=
+-----END CERTIFICATE REQUEST-----
View
54 tests/ca/server.key
@@ -0,0 +1,54 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,6EBAB18EB50B0A06
+
+AvgdAHuOBXl/miVfDitR8kmmMEervaHr+8kAUO/fGnd1QVAFfI1dGrB3wx0XWoFs
+RePw3ydehMq56PLCUOZOdVYeMVVJf8dXqfdwRGj+40mlYtJ0Y+6pef/WlYUDT2kq
+VWsH6IU3J0K5cLu3lg4kRAraQGHXjPn+4m1cTZNKHT2V39E2JO8L5IfGQxOvfd2i
+ueZJb8h3zH9PgHPoETsy9iO3ndyeYVhcxNbG31vPDulL8XXyG0yCmbjji4Yh5mN4
+faqClQ0/rc9T1PMBN8HsQk+fQ61/qHS3rJV28ZZCUueUdJJzsNIOWfZ2W53aXxAP
+fvdGG6uOJAXuVDeBc/JGFyDsperC95YRplo83v4tk1TTVOy5nwqWCj4q2Hm+BRXE
+w8csH4lE4YfdmI9h/WqwjzQ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RzYXWZsh1Jq2TCvTiw+1Irm1m9Ltuv+W85hvhLuB1AY3runMLQN0eQ0gvjbk
+cKCKtpoKy4rHtVTiy+8hzL1zaWYu3Bny7BgPiKciiMbo7TkDzWVX0hIfjcgJAzVo
+gLC1/TVEQkoImomAvzPGXQpbLlX843juVeBCSwdkBAjjlMoJyGcv6wfO91tkG8PW
+xUjPQQcJCr8/VSoK10jdUjrQocb3u+ud27n/6eQZOpvwsbn5q3mr2+zUIon/9k8D
+bgPEhk6nrCq5rN6A7eCcdwMCAwEAAQ==
+-----END PUBLIC KEY-----
View
BIN  tests/ca/server.pub.sig
Binary file not shown
View
69 tests/test-crypto.lua
@@ -0,0 +1,69 @@
+local crypto = require('_crypto')
+local fs = require('fs')
+local path = require('path')
+
+local message1 = 'This message '
+local message2 = 'will be signed'
+local message = message1 .. message2
+
+local ca_path = path.join(__dirname, 'ca')
+local RSA_PUBLIC_KEY = fs.readFileSync(path.join(ca_path, 'server.pub'))
+local RSA_PRIV_KEY = fs.readFileSync(path.join(ca_path, 'server.key.insecure'))
+local kpriv = crypto.pkey.from_pem(RSA_PRIV_KEY, true)
+local kpub = crypto.pkey.from_pem(RSA_PUBLIC_KEY)
+
+-- TODO: FIX the private key output is wrong in luvit,
+-- it was fine in virgo
+--assert(kpriv:to_pem(true) == RSA_PRIV_KEY)
+assert(kpub:to_pem() == RSA_PUBLIC_KEY)
+
+-- Test digests
+
+local hash = 'da0fd2505f0fc498649d6cf9abc7513be179b3295bb1838091723b457febe96a'
+
+local d = crypto.digest.new("sha256")
+d:update(message1)
+d:update(message2)
+local ret = d:final()
+assert(hash == ret)
+
+d:reset(d)
+d:update(message1)
+ret = d:final()
+assert(hash ~= ret)
+
+-- Test Signing
+sig = crypto.sign('sha256', message, kpriv)
+
+local v = crypto.verify.new('sha256')
+v:update(message1)
+v:update(message2)
+local verified = v:final(sig, kpub)
+assert(verified)
+local sig = crypto.sign('sha256', message, kpriv)
+
+-- Test streaming verification
+local v = crypto.verify.new('sha256')
+v:update(message1)
+v:update(message2)
+local verified = v:final(sig, kpub)
+assert(verified)
+
+local nv = crypto.verify.new('sha256')
+nv:update(message1)
+nv:update(message2 .. 'x')
+local nverified = nv:final(sig, kpub)
+assert(not nverified)
+
+-- Test full buffer verify
+verified = crypto.verify('sha256', message, sig, kpub)
+assert(verified)
+
+nverified = crypto.verify('sha256', message..'x', sig, kpub)
+assert(not nverified)
+
+-- Test bogus RSA
+local bogus = crypto.pkey.from_pem(1)
+assert(bogus == nil)
+
+
View
89 tests/test-x509.lua
@@ -0,0 +1,89 @@
+local crypto = require('_crypto')
+local fs = require('fs')
+local path = require('path')
+
+local ca_path = path.join(__dirname, 'ca')
+local ca_cert = fs.readFileSync(path.join(ca_path, 'ca.crt'))
+local cert_to_verify = fs.readFileSync(path.join(ca_path, 'server.crt'))
+
+local bad_cert = [[-----BEGIN CERTIFICATE-----
+MIIFxTCCA60CAQEwDQYJKoZIhvcNAQEFBQAwgaIxCzAJBgNVBAYTAlVTMRMwEQYD
+VQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMQ4wDAYDVQQK
+EwVWaXJnbzEQMA4GA1UECxMHSGFja2VyczEYMBYGA1UEAxMPQnJhbmRvbiBQaGls
+aXBzMSowKAYJKoZIhvcNAQkBFhticmFuZG9uLnBoaWxpcHNAZXhhbXBsZS5jb20w
+HhcNMTIwMTI2MjIwMjI0WhcNMjIwMTIzMjIwMjI0WjCBrTELMAkGA1UEBhMCVVMx
+EzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xGjAY
+BgNVBAoTEVZpcmdvIFRlc3QgU2lnbmVyMQ8wDQYDVQQLEwZIYWNrZXIxGDAWBgNV
+BAMTD0JyYW5kb24gUGhpbGlwczEqMCgGCSqGSIb3DQEJARYbYnJhbmRvbi5waGls
+aXBzQGV4YW1wbGUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC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C0LNlUNmoADegUwyYcQ4246ayfqcnJxacQXIpWylF/
+mGHQcR4AmVYsr26UkDYXcwb7BDxH0eb3w5s7X0hwtFzd8jwx3Vagdf4fafm4Vahz
+XDiDXVMTZqyncIBu4/8PFfgqgLra/MhHODbLamndPMeHAn0zNXk5HEkiNRhHymSe
+oTKkB4Ol10/kEWvOswU/LS69w7HDFgJAnnEi2+XCTHMim8kDcbhoGr3rlL1cT7yL
+B3P11S3lepH+PFTFfU19IlrDGfXDxlKNWR9XNVqtQw/qnN+T7XZFW2tuDiMecCYj
+64Qm7mwOJZDp1eFU0GiTuF7r7ZMBWTDDe98eOFOOiUZ3m+m43SGVb+U=
+-----END CERTIFICATE-----]]
+
+-- test_x509_verify
+ca = assert(crypto.x509_ca())
+
+assert(ca.add_pem)
+assert(ca:add_pem(ca_cert))
+assert(ca:add_pem("FOBAR") == nil)
+
+assert(ca:verify_pem(cert_to_verify))
+assert(ca:verify_pem(bad_cert) == false)
+
+local ca_path = path.join(__dirname, 'ca')
+local ca_cert = fs.readFileSync(path.join(ca_path, "ca.crt"))
+local cert_to_verify = fs.readFileSync(path.join(ca_path, "server.crt"))
+local signature = fs.readFileSync(path.join(ca_path, "server.pub.sig"))
+local message = fs.readFileSync(path.join(ca_path, "server.pub"))
+
+-- Verify the CA signed the server key
+local ca, err = assert(crypto.x509_ca())
+ca:add_pem(ca_cert)
+assert(ca:verify_pem(cert_to_verify) == true)
+
+local x509 = crypto.x509_cert()
+x509:from_pem(cert_to_verify)
+
+local kpub = x509:pubkey()
+
+-- test_x509_sig_fails_on_bad_message
+
+-- Test streaming verification fails on bad message
+v = crypto.verify.new('sha256')
+v:update(message .. 'x')
+verified = v:final(signature, kpub)
+assert(not verified)
+
+-- test_x509_sig_fails_on_bad_sig
+-- Test streaming verification fails on bad sig
+v = crypto.verify.new('sha256')
+v:update(message)
+verified = v:final(signature .. 'x', kpub)
+assert(not verified)
+
+-- test_x509_sig_verify_works
+-- Test streaming verification
+v = crypto.verify.new('sha256')
+v:update(message)
+verified = v:final(signature, kpub)
+assert(verified)
Please sign in to comment.
Something went wrong with that request. Please try again.