mirror of
https://github.com/brunoos/luasec.git
synced 2025-04-20 15:36:46 +02:00
Compare commits
4 Commits
master
...
luasec-0.8
Author | SHA1 | Date | |
---|---|---|---|
|
a0f31bd9cb | ||
|
63c6a9578e | ||
|
20db8ae168 | ||
|
dcd385e615 |
14
CHANGELOG
14
CHANGELOG
@ -1,3 +1,17 @@
|
|||||||
|
--------------------------------------------------------------------------------
|
||||||
|
LuaSec 0.8.2
|
||||||
|
---------------
|
||||||
|
This version includes:
|
||||||
|
|
||||||
|
* Fix unexported 'ssl.config' table
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
LuaSec 0.8.1
|
||||||
|
---------------
|
||||||
|
This version includes:
|
||||||
|
|
||||||
|
* Fix another memory leak when get certficate extensions
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
LuaSec 0.8
|
LuaSec 0.8
|
||||||
---------------
|
---------------
|
||||||
|
6
INSTALL
6
INSTALL
@ -1,14 +1,14 @@
|
|||||||
LuaSec 0.8
|
LuaSec 0.8.2
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* OpenSSL options:
|
* OpenSSL options:
|
||||||
|
|
||||||
By default, LuaSec 0.8 includes options for OpenSSL 1.1.0g.
|
By default, this version includes options for OpenSSL 1.1.1.
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
$ cd src
|
$ cd src
|
||||||
$ lua options.lua -g /usr/include/openssl/ssl.h > options.h
|
$ lua options.lua -g /usr/include/openssl/ssl.h > options.c
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
LuaSec 0.8 license
|
LuaSec 0.8.2 license
|
||||||
Copyright (C) 2006-2019 Bruno Silvestre, UFG
|
Copyright (C) 2006-2019 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
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
LuaSec 0.8
|
LuaSec 0.8.2
|
||||||
===============
|
===============
|
||||||
LuaSec depends on OpenSSL, and integrates with LuaSocket to make it
|
LuaSec depends on OpenSSL, and integrates with LuaSocket to make it
|
||||||
easy to add secure connections to any Lua applications or scripts.
|
easy to add secure connections to any Lua applications or scripts.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package = "LuaSec"
|
package = "LuaSec"
|
||||||
version = "0.8-1"
|
version = "0.8.2-1"
|
||||||
source = {
|
source = {
|
||||||
url = "https://github.com/brunoos/luasec/archive/luasec-0.8.tar.gz",
|
url = "https://github.com/brunoos/luasec/archive/luasec-0.8.2.tar.gz",
|
||||||
dir = "luasec-luasec-0.8"
|
dir = "luasec-luasec-0.8.2"
|
||||||
}
|
}
|
||||||
description = {
|
description = {
|
||||||
summary = "A binding for OpenSSL library to provide TLS/SSL communication over LuaSocket.",
|
summary = "A binding for OpenSSL library to provide TLS/SSL communication over LuaSocket.",
|
||||||
@ -58,7 +58,7 @@ build = {
|
|||||||
"ssl", "crypto"
|
"ssl", "crypto"
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
"src/config.c", "src/ec.c",
|
"src/options.c", "src/config.c", "src/ec.c",
|
||||||
"src/x509.c", "src/context.c", "src/ssl.c",
|
"src/x509.c", "src/context.c", "src/ssl.c",
|
||||||
"src/luasocket/buffer.c", "src/luasocket/io.c",
|
"src/luasocket/buffer.c", "src/luasocket/io.c",
|
||||||
"src/luasocket/timeout.c", "src/luasocket/usocket.c"
|
"src/luasocket/timeout.c", "src/luasocket/usocket.c"
|
||||||
@ -93,7 +93,7 @@ build = {
|
|||||||
"$(OPENSSL_INCDIR)", "src/", "src/luasocket"
|
"$(OPENSSL_INCDIR)", "src/", "src/luasocket"
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
"src/config.c", "src/ec.c",
|
"src/options.c", "src/config.c", "src/ec.c",
|
||||||
"src/x509.c", "src/context.c", "src/ssl.c",
|
"src/x509.c", "src/context.c", "src/ssl.c",
|
||||||
"src/luasocket/buffer.c", "src/luasocket/io.c",
|
"src/luasocket/buffer.c", "src/luasocket/io.c",
|
||||||
"src/luasocket/timeout.c", "src/luasocket/wsocket.c"
|
"src/luasocket/timeout.c", "src/luasocket/wsocket.c"
|
@ -107,6 +107,7 @@
|
|||||||
<ClCompile Include="src\luasocket\io.c" />
|
<ClCompile Include="src\luasocket\io.c" />
|
||||||
<ClCompile Include="src\luasocket\timeout.c" />
|
<ClCompile Include="src\luasocket\timeout.c" />
|
||||||
<ClCompile Include="src\luasocket\wsocket.c" />
|
<ClCompile Include="src\luasocket\wsocket.c" />
|
||||||
|
<ClCompile Include="src\options.c" />
|
||||||
<ClCompile Include="src\ssl.c" />
|
<ClCompile Include="src\ssl.c" />
|
||||||
<ClCompile Include="src\x509.c" />
|
<ClCompile Include="src\x509.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -2,6 +2,7 @@ CMOD=ssl.so
|
|||||||
LMOD=ssl.lua
|
LMOD=ssl.lua
|
||||||
|
|
||||||
OBJS= \
|
OBJS= \
|
||||||
|
options.o \
|
||||||
x509.o \
|
x509.o \
|
||||||
context.o \
|
context.o \
|
||||||
ssl.o \
|
ssl.o \
|
||||||
@ -57,6 +58,7 @@ clean:
|
|||||||
cd luasocket && $(MAKE) clean
|
cd luasocket && $(MAKE) clean
|
||||||
rm -f $(OBJS) $(CMOD)
|
rm -f $(OBJS) $(CMOD)
|
||||||
|
|
||||||
|
options.o: options.c options.h
|
||||||
ec.o: ec.c ec.h
|
ec.o: ec.c ec.h
|
||||||
x509.o: x509.c x509.h compat.h
|
x509.o: x509.c x509.h compat.h
|
||||||
context.o: context.c context.h ec.h compat.h
|
context.o: context.c context.h ec.h compat.h
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2019 Bruno Silvestre
|
* Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2019 Bruno Silvestre.
|
* Copyright (C) 2006-2019 Bruno Silvestre.
|
||||||
*
|
*
|
||||||
@ -14,14 +14,14 @@
|
|||||||
*/
|
*/
|
||||||
LSEC_API int luaopen_ssl_config(lua_State *L)
|
LSEC_API int luaopen_ssl_config(lua_State *L)
|
||||||
{
|
{
|
||||||
ssl_option_t *opt;
|
lsec_ssl_option_t *opt;
|
||||||
|
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
lua_pushstring(L, "options");
|
lua_pushstring(L, "options");
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
for (opt = ssl_options; opt->name; opt++) {
|
for (opt = lsec_get_ssl_options(); opt->name; opt++) {
|
||||||
lua_pushstring(L, opt->name);
|
lua_pushstring(L, opt->name);
|
||||||
lua_pushboolean(L, 1);
|
lua_pushboolean(L, 1);
|
||||||
lua_rawset(L, -3);
|
lua_rawset(L, -3);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
||||||
* Matthew Wild.
|
* Matthew Wild.
|
||||||
@ -49,8 +49,8 @@ static p_context testctx(lua_State *L, int idx)
|
|||||||
*/
|
*/
|
||||||
static int set_option_flag(const char *opt, unsigned long *flag)
|
static int set_option_flag(const char *opt, unsigned long *flag)
|
||||||
{
|
{
|
||||||
ssl_option_t *p;
|
lsec_ssl_option_t *p;
|
||||||
for (p = ssl_options; p->name; p++) {
|
for (p = lsec_get_ssl_options(); p->name; p++) {
|
||||||
if (!strcmp(opt, p->name)) {
|
if (!strcmp(opt, p->name)) {
|
||||||
*flag |= p->code;
|
*flag |= p->code;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define LSEC_CONTEXT_H
|
#define LSEC_CONTEXT_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2019 Bruno Silvestre
|
* Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
2
src/ec.h
2
src/ec.h
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2019 Bruno Silvestre
|
* Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
-- LuaSec 0.8
|
-- LuaSec 0.8.2
|
||||||
-- Copyright (C) 2009-2019 PUC-Rio
|
-- Copyright (C) 2009-2019 PUC-Rio
|
||||||
--
|
--
|
||||||
-- Author: Pablo Musa
|
-- Author: Pablo Musa
|
||||||
@ -18,8 +18,8 @@ local try = socket.try
|
|||||||
-- Module
|
-- Module
|
||||||
--
|
--
|
||||||
local _M = {
|
local _M = {
|
||||||
_VERSION = "0.8",
|
_VERSION = "0.8.2",
|
||||||
_COPYRIGHT = "LuaSec 0.8 - Copyright (C) 2009-2019 PUC-Rio",
|
_COPYRIGHT = "LuaSec 0.8.2 - Copyright (C) 2009-2019 PUC-Rio",
|
||||||
PORT = 443,
|
PORT = 443,
|
||||||
TIMEOUT = 60
|
TIMEOUT = 60
|
||||||
}
|
}
|
||||||
|
167
src/options.c
Normal file
167
src/options.c
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
/*--------------------------------------------------------------------------
|
||||||
|
* LuaSec 0.8.2
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
|
*
|
||||||
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
|
/* If you need to generate these options again, see options.lua */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
OpenSSL version: OpenSSL 1.1.1
|
||||||
|
*/
|
||||||
|
|
||||||
|
static lsec_ssl_option_t ssl_options[] = {
|
||||||
|
#if defined(SSL_OP_ALL)
|
||||||
|
{"all", SSL_OP_ALL},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_ALLOW_NO_DHE_KEX)
|
||||||
|
{"allow_no_dhe_kex", SSL_OP_ALLOW_NO_DHE_KEX},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)
|
||||||
|
{"allow_unsafe_legacy_renegotiation", SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_CIPHER_SERVER_PREFERENCE)
|
||||||
|
{"cipher_server_preference", SSL_OP_CIPHER_SERVER_PREFERENCE},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_CISCO_ANYCONNECT)
|
||||||
|
{"cisco_anyconnect", SSL_OP_CISCO_ANYCONNECT},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_COOKIE_EXCHANGE)
|
||||||
|
{"cookie_exchange", SSL_OP_COOKIE_EXCHANGE},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_CRYPTOPRO_TLSEXT_BUG)
|
||||||
|
{"cryptopro_tlsext_bug", SSL_OP_CRYPTOPRO_TLSEXT_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)
|
||||||
|
{"dont_insert_empty_fragments", SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_ENABLE_MIDDLEBOX_COMPAT)
|
||||||
|
{"enable_middlebox_compat", SSL_OP_ENABLE_MIDDLEBOX_COMPAT},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_EPHEMERAL_RSA)
|
||||||
|
{"ephemeral_rsa", SSL_OP_EPHEMERAL_RSA},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_LEGACY_SERVER_CONNECT)
|
||||||
|
{"legacy_server_connect", SSL_OP_LEGACY_SERVER_CONNECT},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER)
|
||||||
|
{"microsoft_big_sslv3_buffer", SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_MICROSOFT_SESS_ID_BUG)
|
||||||
|
{"microsoft_sess_id_bug", SSL_OP_MICROSOFT_SESS_ID_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_MSIE_SSLV2_RSA_PADDING)
|
||||||
|
{"msie_sslv2_rsa_padding", SSL_OP_MSIE_SSLV2_RSA_PADDING},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NETSCAPE_CA_DN_BUG)
|
||||||
|
{"netscape_ca_dn_bug", SSL_OP_NETSCAPE_CA_DN_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NETSCAPE_CHALLENGE_BUG)
|
||||||
|
{"netscape_challenge_bug", SSL_OP_NETSCAPE_CHALLENGE_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG)
|
||||||
|
{"netscape_demo_cipher_change_bug", SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG)
|
||||||
|
{"netscape_reuse_cipher_change_bug", SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_ANTI_REPLAY)
|
||||||
|
{"no_anti_replay", SSL_OP_NO_ANTI_REPLAY},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_COMPRESSION)
|
||||||
|
{"no_compression", SSL_OP_NO_COMPRESSION},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_DTLS_MASK)
|
||||||
|
{"no_dtls_mask", SSL_OP_NO_DTLS_MASK},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_DTLSv1)
|
||||||
|
{"no_dtlsv1", SSL_OP_NO_DTLSv1},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_DTLSv1_2)
|
||||||
|
{"no_dtlsv1_2", SSL_OP_NO_DTLSv1_2},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_ENCRYPT_THEN_MAC)
|
||||||
|
{"no_encrypt_then_mac", SSL_OP_NO_ENCRYPT_THEN_MAC},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_QUERY_MTU)
|
||||||
|
{"no_query_mtu", SSL_OP_NO_QUERY_MTU},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_RENEGOTIATION)
|
||||||
|
{"no_renegotiation", SSL_OP_NO_RENEGOTIATION},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION)
|
||||||
|
{"no_session_resumption_on_renegotiation", SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_SSL_MASK)
|
||||||
|
{"no_ssl_mask", SSL_OP_NO_SSL_MASK},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_SSLv2)
|
||||||
|
{"no_sslv2", SSL_OP_NO_SSLv2},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_SSLv3)
|
||||||
|
{"no_sslv3", SSL_OP_NO_SSLv3},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_TICKET)
|
||||||
|
{"no_ticket", SSL_OP_NO_TICKET},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_TLSv1)
|
||||||
|
{"no_tlsv1", SSL_OP_NO_TLSv1},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_TLSv1_1)
|
||||||
|
{"no_tlsv1_1", SSL_OP_NO_TLSv1_1},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_TLSv1_2)
|
||||||
|
{"no_tlsv1_2", SSL_OP_NO_TLSv1_2},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_TLSv1_3)
|
||||||
|
{"no_tlsv1_3", SSL_OP_NO_TLSv1_3},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_PKCS1_CHECK_1)
|
||||||
|
{"pkcs1_check_1", SSL_OP_PKCS1_CHECK_1},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_PKCS1_CHECK_2)
|
||||||
|
{"pkcs1_check_2", SSL_OP_PKCS1_CHECK_2},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_PRIORITIZE_CHACHA)
|
||||||
|
{"prioritize_chacha", SSL_OP_PRIORITIZE_CHACHA},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_SAFARI_ECDHE_ECDSA_BUG)
|
||||||
|
{"safari_ecdhe_ecdsa_bug", SSL_OP_SAFARI_ECDHE_ECDSA_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_SINGLE_DH_USE)
|
||||||
|
{"single_dh_use", SSL_OP_SINGLE_DH_USE},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_SINGLE_ECDH_USE)
|
||||||
|
{"single_ecdh_use", SSL_OP_SINGLE_ECDH_USE},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_SSLEAY_080_CLIENT_DH_BUG)
|
||||||
|
{"ssleay_080_client_dh_bug", SSL_OP_SSLEAY_080_CLIENT_DH_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG)
|
||||||
|
{"sslref2_reuse_cert_type_bug", SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_TLSEXT_PADDING)
|
||||||
|
{"tlsext_padding", SSL_OP_TLSEXT_PADDING},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_TLS_BLOCK_PADDING_BUG)
|
||||||
|
{"tls_block_padding_bug", SSL_OP_TLS_BLOCK_PADDING_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_TLS_D5_BUG)
|
||||||
|
{"tls_d5_bug", SSL_OP_TLS_D5_BUG},
|
||||||
|
#endif
|
||||||
|
#if defined(SSL_OP_TLS_ROLLBACK_BUG)
|
||||||
|
{"tls_rollback_bug", SSL_OP_TLS_ROLLBACK_BUG},
|
||||||
|
#endif
|
||||||
|
{NULL, 0L}
|
||||||
|
};
|
||||||
|
|
||||||
|
LSEC_API lsec_ssl_option_t* lsec_get_ssl_options() {
|
||||||
|
return ssl_options;
|
||||||
|
}
|
||||||
|
|
161
src/options.h
161
src/options.h
@ -2,170 +2,21 @@
|
|||||||
#define LSEC_OPTIONS_H
|
#define LSEC_OPTIONS_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2019 Bruno Silvestre
|
* Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include <openssl/ssl.h>
|
#include "compat.h"
|
||||||
|
|
||||||
/* If you need to generate these options again, see options.lua */
|
struct lsec_ssl_option_s {
|
||||||
|
|
||||||
/*
|
|
||||||
OpenSSL version: OpenSSL 1.1.1b
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct ssl_option_s {
|
|
||||||
const char *name;
|
const char *name;
|
||||||
unsigned long code;
|
unsigned long code;
|
||||||
};
|
};
|
||||||
typedef struct ssl_option_s ssl_option_t;
|
|
||||||
|
|
||||||
static ssl_option_t ssl_options[] = {
|
typedef struct lsec_ssl_option_s lsec_ssl_option_t;
|
||||||
#if defined(SSL_OP_ALL)
|
|
||||||
{"all", SSL_OP_ALL},
|
LSEC_API lsec_ssl_option_t* lsec_get_ssl_options();
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_ALLOW_NO_DHE_KEX)
|
|
||||||
{"allow_no_dhe_kex", SSL_OP_ALLOW_NO_DHE_KEX},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)
|
|
||||||
{"allow_unsafe_legacy_renegotiation", SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_CIPHER_SERVER_PREFERENCE)
|
|
||||||
{"cipher_server_preference", SSL_OP_CIPHER_SERVER_PREFERENCE},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_CISCO_ANYCONNECT)
|
|
||||||
{"cisco_anyconnect", SSL_OP_CISCO_ANYCONNECT},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_COOKIE_EXCHANGE)
|
|
||||||
{"cookie_exchange", SSL_OP_COOKIE_EXCHANGE},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_CRYPTOPRO_TLSEXT_BUG)
|
|
||||||
{"cryptopro_tlsext_bug", SSL_OP_CRYPTOPRO_TLSEXT_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)
|
|
||||||
{"dont_insert_empty_fragments", SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_ENABLE_MIDDLEBOX_COMPAT)
|
|
||||||
{"enable_middlebox_compat", SSL_OP_ENABLE_MIDDLEBOX_COMPAT},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_EPHEMERAL_RSA)
|
|
||||||
{"ephemeral_rsa", SSL_OP_EPHEMERAL_RSA},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_LEGACY_SERVER_CONNECT)
|
|
||||||
{"legacy_server_connect", SSL_OP_LEGACY_SERVER_CONNECT},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER)
|
|
||||||
{"microsoft_big_sslv3_buffer", SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_MICROSOFT_SESS_ID_BUG)
|
|
||||||
{"microsoft_sess_id_bug", SSL_OP_MICROSOFT_SESS_ID_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_MSIE_SSLV2_RSA_PADDING)
|
|
||||||
{"msie_sslv2_rsa_padding", SSL_OP_MSIE_SSLV2_RSA_PADDING},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NETSCAPE_CA_DN_BUG)
|
|
||||||
{"netscape_ca_dn_bug", SSL_OP_NETSCAPE_CA_DN_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NETSCAPE_CHALLENGE_BUG)
|
|
||||||
{"netscape_challenge_bug", SSL_OP_NETSCAPE_CHALLENGE_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG)
|
|
||||||
{"netscape_demo_cipher_change_bug", SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG)
|
|
||||||
{"netscape_reuse_cipher_change_bug", SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_ANTI_REPLAY)
|
|
||||||
{"no_anti_replay", SSL_OP_NO_ANTI_REPLAY},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_COMPRESSION)
|
|
||||||
{"no_compression", SSL_OP_NO_COMPRESSION},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_DTLS_MASK)
|
|
||||||
{"no_dtls_mask", SSL_OP_NO_DTLS_MASK},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_DTLSv1)
|
|
||||||
{"no_dtlsv1", SSL_OP_NO_DTLSv1},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_DTLSv1_2)
|
|
||||||
{"no_dtlsv1_2", SSL_OP_NO_DTLSv1_2},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_ENCRYPT_THEN_MAC)
|
|
||||||
{"no_encrypt_then_mac", SSL_OP_NO_ENCRYPT_THEN_MAC},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_QUERY_MTU)
|
|
||||||
{"no_query_mtu", SSL_OP_NO_QUERY_MTU},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_RENEGOTIATION)
|
|
||||||
{"no_renegotiation", SSL_OP_NO_RENEGOTIATION},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION)
|
|
||||||
{"no_session_resumption_on_renegotiation", SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_SSL_MASK)
|
|
||||||
{"no_ssl_mask", SSL_OP_NO_SSL_MASK},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_SSLv2)
|
|
||||||
{"no_sslv2", SSL_OP_NO_SSLv2},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_SSLv3)
|
|
||||||
{"no_sslv3", SSL_OP_NO_SSLv3},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_TICKET)
|
|
||||||
{"no_ticket", SSL_OP_NO_TICKET},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_TLSv1)
|
|
||||||
{"no_tlsv1", SSL_OP_NO_TLSv1},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_TLSv1_1)
|
|
||||||
{"no_tlsv1_1", SSL_OP_NO_TLSv1_1},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_TLSv1_2)
|
|
||||||
{"no_tlsv1_2", SSL_OP_NO_TLSv1_2},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_NO_TLSv1_3)
|
|
||||||
{"no_tlsv1_3", SSL_OP_NO_TLSv1_3},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_PKCS1_CHECK_1)
|
|
||||||
{"pkcs1_check_1", SSL_OP_PKCS1_CHECK_1},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_PKCS1_CHECK_2)
|
|
||||||
{"pkcs1_check_2", SSL_OP_PKCS1_CHECK_2},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_PRIORITIZE_CHACHA)
|
|
||||||
{"prioritize_chacha", SSL_OP_PRIORITIZE_CHACHA},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_SAFARI_ECDHE_ECDSA_BUG)
|
|
||||||
{"safari_ecdhe_ecdsa_bug", SSL_OP_SAFARI_ECDHE_ECDSA_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_SINGLE_DH_USE)
|
|
||||||
{"single_dh_use", SSL_OP_SINGLE_DH_USE},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_SINGLE_ECDH_USE)
|
|
||||||
{"single_ecdh_use", SSL_OP_SINGLE_ECDH_USE},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_SSLEAY_080_CLIENT_DH_BUG)
|
|
||||||
{"ssleay_080_client_dh_bug", SSL_OP_SSLEAY_080_CLIENT_DH_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG)
|
|
||||||
{"sslref2_reuse_cert_type_bug", SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_TLSEXT_PADDING)
|
|
||||||
{"tlsext_padding", SSL_OP_TLSEXT_PADDING},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_TLS_BLOCK_PADDING_BUG)
|
|
||||||
{"tls_block_padding_bug", SSL_OP_TLS_BLOCK_PADDING_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_TLS_D5_BUG)
|
|
||||||
{"tls_d5_bug", SSL_OP_TLS_D5_BUG},
|
|
||||||
#endif
|
|
||||||
#if defined(SSL_OP_TLS_ROLLBACK_BUG)
|
|
||||||
{"tls_rollback_bug", SSL_OP_TLS_ROLLBACK_BUG},
|
|
||||||
#endif
|
|
||||||
{NULL, 0L}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
local function usage()
|
local function usage()
|
||||||
print("Usage:")
|
print("Usage:")
|
||||||
print("* Generate options of your system:")
|
print("* Generate options of your system:")
|
||||||
print(" lua options.lua -g /path/to/ssl.h [version] > options.h")
|
print(" lua options.lua -g /path/to/ssl.h [version] > options.c")
|
||||||
print("* Examples:")
|
print("* Examples:")
|
||||||
print(" lua options.lua -g /usr/include/openssl/ssl.h > options.h\n")
|
print(" lua options.lua -g /usr/include/openssl/ssl.h > options.c\n")
|
||||||
print(" lua options.lua -g /usr/include/openssl/ssl.h \"OpenSSL 1.0.1 14\" > options.h\n")
|
print(" lua options.lua -g /usr/include/openssl/ssl.h \"OpenSSL 1.0.1 14\" > options.c\n")
|
||||||
|
|
||||||
print("* List options of your system:")
|
print("* List options of your system:")
|
||||||
print(" lua options.lua -l /path/to/ssl.h\n")
|
print(" lua options.lua -l /path/to/ssl.h\n")
|
||||||
@ -17,11 +17,8 @@ end
|
|||||||
|
|
||||||
local function generate(options, version)
|
local function generate(options, version)
|
||||||
print([[
|
print([[
|
||||||
#ifndef LSEC_OPTIONS_H
|
|
||||||
#define LSEC_OPTIONS_H
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2019 Bruno Silvestre
|
* Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
*
|
*
|
||||||
@ -29,22 +26,19 @@ local function generate(options, version)
|
|||||||
|
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
/* If you need to generate these options again, see options.lua */
|
/* If you need to generate these options again, see options.lua */
|
||||||
|
|
||||||
]])
|
]])
|
||||||
|
|
||||||
printf([[
|
printf([[
|
||||||
/*
|
/*
|
||||||
OpenSSL version: %s
|
OpenSSL version: %s
|
||||||
*/
|
*/
|
||||||
]], version)
|
]], version)
|
||||||
print([[
|
|
||||||
struct ssl_option_s {
|
|
||||||
const char *name;
|
|
||||||
unsigned long code;
|
|
||||||
};
|
|
||||||
typedef struct ssl_option_s ssl_option_t;
|
|
||||||
]])
|
|
||||||
|
|
||||||
print([[static ssl_option_t ssl_options[] = {]])
|
print([[static lsec_ssl_option_t ssl_options[] = {]])
|
||||||
|
|
||||||
for k, option in ipairs(options) do
|
for k, option in ipairs(options) do
|
||||||
local name = string.lower(string.sub(option, 8))
|
local name = string.lower(string.sub(option, 8))
|
||||||
@ -56,7 +50,9 @@ typedef struct ssl_option_s ssl_option_t;
|
|||||||
print([[
|
print([[
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
LSEC_API lsec_ssl_option_t* lsec_get_ssl_options() {
|
||||||
|
return ssl_options;
|
||||||
|
}
|
||||||
]])
|
]])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
||||||
* Matthew Wild.
|
* Matthew Wild.
|
||||||
@ -818,7 +818,7 @@ static int meth_getalpn(lua_State *L)
|
|||||||
|
|
||||||
static int meth_copyright(lua_State *L)
|
static int meth_copyright(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushstring(L, "LuaSec 0.8 - Copyright (C) 2006-2019 Bruno Silvestre, UFG"
|
lua_pushstring(L, "LuaSec 0.8.2 - Copyright (C) 2006-2019 Bruno Silvestre, UFG"
|
||||||
#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,7 +2,7 @@
|
|||||||
#define LSEC_SSL_H
|
#define LSEC_SSL_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2019 Bruno Silvestre
|
* Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
-- LuaSec 0.8
|
-- LuaSec 0.8.2
|
||||||
--
|
--
|
||||||
-- Copyright (C) 2006-2019 Bruno Silvestre
|
-- Copyright (C) 2006-2019 Bruno Silvestre
|
||||||
--
|
--
|
||||||
@ -267,8 +267,9 @@ core.setmethod("info", info)
|
|||||||
--
|
--
|
||||||
|
|
||||||
local _M = {
|
local _M = {
|
||||||
_VERSION = "0.8",
|
_VERSION = "0.8.2",
|
||||||
_COPYRIGHT = core.copyright(),
|
_COPYRIGHT = core.copyright(),
|
||||||
|
config = config,
|
||||||
loadcertificate = x509.load,
|
loadcertificate = x509.load,
|
||||||
newcontext = newcontext,
|
newcontext = newcontext,
|
||||||
wrap = wrap,
|
wrap = wrap,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann
|
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann
|
||||||
* Matthew Wild, Bruno Silvestre.
|
* Matthew Wild, Bruno Silvestre.
|
||||||
@ -371,6 +371,7 @@ int meth_extensions(lua_State* L)
|
|||||||
/* not supported */
|
/* not supported */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
GENERAL_NAME_free(general_name);
|
||||||
}
|
}
|
||||||
sk_GENERAL_NAME_free(values);
|
sk_GENERAL_NAME_free(values);
|
||||||
lua_pop(L, 1); /* ret[oid] */
|
lua_pop(L, 1); /* ret[oid] */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 0.8
|
* LuaSec 0.8.2
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann
|
* Copyright (C) 2014-2019 Kim Alvefur, Paul Aurich, Tobias Markmann
|
||||||
* Matthew Wild, Bruno Silvestre.
|
* Matthew Wild, Bruno Silvestre.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user