mirror of
https://github.com/brunoos/luasec.git
synced 2025-07-17 22:39:49 +02:00
Compare commits
5 Commits
luasec-0.6
...
luasec-dev
Author | SHA1 | Date | |
---|---|---|---|
47cc914e69 | |||
90d4f2d95c | |||
172d324243 | |||
6cc8e951d4 | |||
d36e156fac |
@ -1,3 +1,11 @@
|
|||||||
|
--------------------------------------------------------------------------------
|
||||||
|
LuaSec 0.5.1
|
||||||
|
------------
|
||||||
|
- Check if SSLv3 protocol is available.
|
||||||
|
- Fix push_asn1_string().
|
||||||
|
- Update samples to use 'sslv23' and 'tlsv1_2'.
|
||||||
|
- Update MACOSX_VERSION to 10.11 on Makefile.
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
LuaSec 0.5
|
LuaSec 0.5
|
||||||
------------
|
------------
|
||||||
|
4
INSTALL
4
INSTALL
@ -1,9 +1,9 @@
|
|||||||
LuaSec 0.5
|
LuaSec 0.5.1
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* OpenSSL options:
|
* OpenSSL options:
|
||||||
|
|
||||||
By default, LuaSec 0.5 includes options for OpenSSL 1.0.1e.
|
By default, LuaSec 0.5.1 includes options for OpenSSL 1.0.1e.
|
||||||
|
|
||||||
If you need to generate the options for a different version of OpenSSL:
|
If you need to generate the options for a different version of OpenSSL:
|
||||||
|
|
||||||
|
4
LICENSE
4
LICENSE
@ -1,5 +1,5 @@
|
|||||||
LuaSec 0.5 license
|
LuaSec 0.5.1 license
|
||||||
Copyright (C) 2006-2013 Bruno Silvestre, UFG
|
Copyright (C) 2006-2015 Bruno Silvestre, UFG
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
4
Makefile
4
Makefile
@ -1,4 +1,4 @@
|
|||||||
# Inform the location to intall the modules
|
# Inform the location to install the modules
|
||||||
LUAPATH ?= /usr/share/lua/5.1
|
LUAPATH ?= /usr/share/lua/5.1
|
||||||
LUACPATH ?= /usr/lib/lua/5.1
|
LUACPATH ?= /usr/lib/lua/5.1
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ INCDIR = -I. $(INC_PATH)
|
|||||||
LIBDIR = -L./luasocket $(LIB_PATH)
|
LIBDIR = -L./luasocket $(LIB_PATH)
|
||||||
|
|
||||||
# For Mac OS X: set the system version
|
# For Mac OS X: set the system version
|
||||||
MACOSX_VERSION=10.4
|
MACOSX_VERSION?=10.11
|
||||||
|
|
||||||
#----------------------
|
#----------------------
|
||||||
# Do not edit this part
|
# Do not edit this part
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
LuaSec 0.5.1
|
||||||
|
============
|
||||||
|
- Check if SSLv3 protocol is available.
|
||||||
|
- Fix push_asn1_string().
|
||||||
|
- Update samples to use 'sslv23' and 'tlsv1_2'.
|
||||||
|
- Update MACOSX_VERSION to 10.11 on Makefile.
|
||||||
|
|
||||||
LuaSec 0.5
|
LuaSec 0.5
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
@ -7,12 +7,12 @@ local util = require("util")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local conn = socket.tcp()
|
local conn = socket.tcp()
|
||||||
|
@ -7,12 +7,12 @@ local util = require("util")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local ctx = assert(ssl.newcontext(params))
|
local ctx = assert(ssl.newcontext(params))
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local peer = socket.tcp()
|
local peer = socket.tcp()
|
||||||
|
@ -31,12 +31,12 @@ end
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
dhparam = dhparam_cb,
|
dhparam = dhparam_cb,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local peer = socket.tcp()
|
local peer = socket.tcp()
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
--
|
--
|
||||||
curve = "secp384r1",
|
curve = "secp384r1",
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
--
|
--
|
||||||
curve = "secp384r1",
|
curve = "secp384r1",
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local peer = socket.tcp()
|
local peer = socket.tcp()
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local pass = "foobar"
|
local pass = "foobar"
|
||||||
local cfg = {
|
local cfg = {
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
mode = "client",
|
mode = "client",
|
||||||
key = "key.pem",
|
key = "key.pem",
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- [[ SSL context
|
-- [[ SSL context
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- [[ SSL context
|
-- [[ SSL context
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local peer = socket.tcp()
|
local peer = socket.tcp()
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../../certs/clientBkey.pem",
|
key = "../../certs/clientBkey.pem",
|
||||||
certificate = "../../certs/clientB.pem",
|
certificate = "../../certs/clientB.pem",
|
||||||
cafile = "../../certs/rootB.pem",
|
cafile = "../../certs/rootB.pem",
|
||||||
verify = {"none"},
|
verify = "none",
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local peer = socket.tcp()
|
local peer = socket.tcp()
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../../certs/serverAkey.pem",
|
key = "../../certs/serverAkey.pem",
|
||||||
certificate = "../../certs/serverA.pem",
|
certificate = "../../certs/serverA.pem",
|
||||||
cafile = "../../certs/rootA.pem",
|
cafile = "../../certs/rootA.pem",
|
||||||
verify = {"none"},
|
verify = "none",
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- [[ SSL context
|
-- [[ SSL context
|
||||||
|
@ -6,13 +6,13 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../../certs/clientBkey.pem",
|
key = "../../certs/clientBkey.pem",
|
||||||
certificate = "../../certs/clientB.pem",
|
certificate = "../../certs/clientB.pem",
|
||||||
cafile = "../../certs/rootB.pem",
|
cafile = "../../certs/rootB.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all", ,
|
||||||
verifyext = {"lsec_continue"},
|
verifyext = "lsec_continue",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- [[ SSL context
|
-- [[ SSL context
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../../certs/serverAkey.pem",
|
key = "../../certs/serverAkey.pem",
|
||||||
certificate = "../../certs/serverA.pem",
|
certificate = "../../certs/serverA.pem",
|
||||||
cafile = "../../certs/rootA.pem",
|
cafile = "../../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
verifyext = {"lsec_continue", "crl_check", "crl_check_chain"},
|
verifyext = {"lsec_continue", "crl_check", "crl_check_chain"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../../certs/clientAkey.pem",
|
key = "../../certs/clientAkey.pem",
|
||||||
certificate = "../../certs/clientA.pem",
|
certificate = "../../certs/clientA.pem",
|
||||||
cafile = "../../certs/rootA.pem",
|
cafile = "../../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local peer = socket.tcp()
|
local peer = socket.tcp()
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../../certs/serverAkey.pem",
|
key = "../../certs/serverAkey.pem",
|
||||||
certificate = "../../certs/serverA.pem",
|
certificate = "../../certs/serverA.pem",
|
||||||
cafile = "../../certs/rootA.pem",
|
cafile = "../../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,13 +6,13 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "tlsv1",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/serverBkey.pem",
|
key = "../certs/serverBkey.pem",
|
||||||
certificate = "../certs/serverB.pem",
|
certificate = "../certs/serverB.pem",
|
||||||
cafile = "../certs/rootB.pem",
|
cafile = "../certs/rootB.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
verifyext = {"lsec_continue", "lsec_ignore_purpose"},
|
verifyext = {"lsec_continue", "lsec_ignore_purpose"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local ctx = assert(ssl.newcontext(params))
|
local ctx = assert(ssl.newcontext(params))
|
||||||
|
@ -6,13 +6,13 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "tlsv1",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
verifyext = {"lsec_continue", "lsec_ignore_purpose"},
|
verifyext = {"lsec_continue", "lsec_ignore_purpose"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Wait until socket is ready (for reading or writing)
|
-- Wait until socket is ready (for reading or writing)
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- [[ SSL context
|
-- [[ SSL context
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- [[ SSL context
|
-- [[ SSL context
|
||||||
|
@ -6,12 +6,12 @@ local ssl = require("ssl")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "client",
|
mode = "client",
|
||||||
protocol = "sslv3",
|
protocol = "tlsv1_2",
|
||||||
key = "../certs/clientAkey.pem",
|
key = "../certs/clientAkey.pem",
|
||||||
certificate = "../certs/clientA.pem",
|
certificate = "../certs/clientA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
local function wait(peer, err)
|
local function wait(peer, err)
|
||||||
|
@ -8,12 +8,12 @@ print("Use Ctrl+S and Ctrl+Q to suspend and resume the server.")
|
|||||||
|
|
||||||
local params = {
|
local params = {
|
||||||
mode = "server",
|
mode = "server",
|
||||||
protocol = "sslv3",
|
protocol = "sslv23",
|
||||||
key = "../certs/serverAkey.pem",
|
key = "../certs/serverAkey.pem",
|
||||||
certificate = "../certs/serverA.pem",
|
certificate = "../certs/serverA.pem",
|
||||||
cafile = "../certs/rootA.pem",
|
cafile = "../certs/rootA.pem",
|
||||||
verify = {"peer", "fail_if_no_peer_cert"},
|
verify = {"peer", "fail_if_no_peer_cert"},
|
||||||
options = {"all", "no_sslv2"},
|
options = "all",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre
|
* Copyright (C) 2006-2015 Bruno Silvestre
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
* Copyright (C) 2014-2015 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
||||||
* Matthew Wild.
|
* Matthew Wild.
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre.
|
* Copyright (C) 2006-2015 Bruno Silvestre.
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -35,6 +35,10 @@ typedef const SSL_METHOD LSEC_SSL_METHOD;
|
|||||||
typedef SSL_METHOD LSEC_SSL_METHOD;
|
typedef SSL_METHOD LSEC_SSL_METHOD;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||||
|
#define SSLv23_method() TLS_method()
|
||||||
|
#endif
|
||||||
|
|
||||||
/*--------------------------- Auxiliary Functions ----------------------------*/
|
/*--------------------------- Auxiliary Functions ----------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +70,9 @@ static int set_option_flag(const char *opt, unsigned long *flag)
|
|||||||
static LSEC_SSL_METHOD* str2method(const char *method)
|
static LSEC_SSL_METHOD* str2method(const char *method)
|
||||||
{
|
{
|
||||||
if (!strcmp(method, "sslv23")) return SSLv23_method();
|
if (!strcmp(method, "sslv23")) return SSLv23_method();
|
||||||
|
#ifndef OPENSSL_NO_SSL3
|
||||||
if (!strcmp(method, "sslv3")) return SSLv3_method();
|
if (!strcmp(method, "sslv3")) return SSLv3_method();
|
||||||
|
#endif
|
||||||
if (!strcmp(method, "tlsv1")) return TLSv1_method();
|
if (!strcmp(method, "tlsv1")) return TLSv1_method();
|
||||||
#if (OPENSSL_VERSION_NUMBER >= 0x1000100fL)
|
#if (OPENSSL_VERSION_NUMBER >= 0x1000100fL)
|
||||||
if (!strcmp(method, "tlsv1_1")) return TLSv1_1_method();
|
if (!strcmp(method, "tlsv1_1")) return TLSv1_1_method();
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#define LSEC_CONTEXT_H
|
#define LSEC_CONTEXT_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre
|
* Copyright (C) 2006-2015 Bruno Silvestre
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
4
src/ec.h
4
src/ec.h
@ -1,6 +1,6 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre
|
* Copyright (C) 2006-2015 Bruno Silvestre
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
-- LuaSec 0.5
|
-- LuaSec 0.5.1
|
||||||
-- Copyright (C) 2009-2014 PUC-Rio
|
-- Copyright (C) 2009-2015 PUC-Rio
|
||||||
--
|
--
|
||||||
-- Author: Pablo Musa
|
-- Author: Pablo Musa
|
||||||
-- Author: Tomas Guisasola
|
-- Author: Tomas Guisasola
|
||||||
@ -22,8 +22,8 @@ local getmetatable = getmetatable
|
|||||||
|
|
||||||
module("ssl.https")
|
module("ssl.https")
|
||||||
|
|
||||||
_VERSION = "0.5"
|
_VERSION = "0.5.1"
|
||||||
_COPYRIGHT = "LuaSec 0.5 - Copyright (C) 2009-2014 PUC-Rio"
|
_COPYRIGHT = "LuaSec 0.5.1 - Copyright (C) 2009-2015 PUC-Rio"
|
||||||
|
|
||||||
-- Default settings
|
-- Default settings
|
||||||
PORT = 443
|
PORT = 443
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#define LSEC_OPTIONS_H
|
#define LSEC_OPTIONS_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre
|
* Copyright (C) 2006-2015 Bruno Silvestre
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ local function generate(options, version)
|
|||||||
#define LSEC_OPTIONS_H
|
#define LSEC_OPTIONS_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre
|
* Copyright (C) 2006-2015 Bruno Silvestre
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
* Copyright (C) 2014-2015 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
||||||
* Matthew Wild.
|
* Matthew Wild.
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre.
|
* Copyright (C) 2006-2014 Bruno Silvestre.
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
@ -655,7 +655,7 @@ static int meth_info(lua_State *L)
|
|||||||
|
|
||||||
static int meth_copyright(lua_State *L)
|
static int meth_copyright(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushstring(L, "LuaSec 0.5 - Copyright (C) 2006-2011 Bruno Silvestre"
|
lua_pushstring(L, "LuaSec 0.5.1 - Copyright (C) 2006-2015 Bruno Silvestre"
|
||||||
#if defined(WITH_LUASOCKET)
|
#if defined(WITH_LUASOCKET)
|
||||||
"\nLuaSocket 3.0-RC1 - Copyright (C) 2004-2013 Diego Nehab"
|
"\nLuaSocket 3.0-RC1 - Copyright (C) 2004-2013 Diego Nehab"
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#define LSEC_SSL_H
|
#define LSEC_SSL_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
* Copyright (C) 2006-2014 Bruno Silvestre
|
* Copyright (C) 2006-2015 Bruno Silvestre
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
-- LuaSec 0.5
|
-- LuaSec 0.5.1
|
||||||
-- Copyright (C) 2006-2014 Bruno Silvestre
|
-- Copyright (C) 2006-2015 Bruno Silvestre
|
||||||
--
|
--
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ local x509 = require("ssl.x509")
|
|||||||
|
|
||||||
module("ssl", package.seeall)
|
module("ssl", package.seeall)
|
||||||
|
|
||||||
_VERSION = "0.5.PR"
|
_VERSION = "0.5.1"
|
||||||
_COPYRIGHT = core.copyright()
|
_COPYRIGHT = core.copyright()
|
||||||
|
|
||||||
-- Export
|
-- Export
|
||||||
|
14
src/x509.c
14
src/x509.c
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Kim Alvefur, Paul Aurich, Tobias Markmann
|
* Copyright (C) 2014-2015 Kim Alvefur, Paul Aurich, Tobias Markmann
|
||||||
* Matthew Wild, Bruno Silvestre.
|
* Matthew Wild, Bruno Silvestre.
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -86,10 +86,12 @@ static void push_asn1_objname(lua_State* L, ASN1_OBJECT *object, int no_name)
|
|||||||
*/
|
*/
|
||||||
static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode)
|
static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode)
|
||||||
{
|
{
|
||||||
size_t len;
|
int len;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
if (!string)
|
if (!string) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (encode) {
|
switch (encode) {
|
||||||
case LSEC_AI5_STRING:
|
case LSEC_AI5_STRING:
|
||||||
lua_pushlstring(L, (char*)ASN1_STRING_data(string),
|
lua_pushlstring(L, (char*)ASN1_STRING_data(string),
|
||||||
@ -101,6 +103,8 @@ static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode)
|
|||||||
lua_pushlstring(L, (char*)data, len);
|
lua_pushlstring(L, (char*)data, len);
|
||||||
OPENSSL_free(data);
|
OPENSSL_free(data);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.5
|
* LuaSec 0.5.1
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Kim Alvefur, Paul Aurich, Tobias Markmann
|
* Copyright (C) 2014-2015 Kim Alvefur, Paul Aurich, Tobias Markmann
|
||||||
* Matthew Wild, Bruno Silvestre.
|
* Matthew Wild, Bruno Silvestre.
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user