mirror of
https://github.com/brunoos/luasec.git
synced 2025-07-17 14:29:47 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
d9215ee00f | |||
03e03140cd | |||
8b3b2318d2 | |||
2c248947df | |||
f22b3ea609 | |||
c9539bca86 | |||
afb2d44b0e | |||
f9afada3d1 | |||
371abcf718 |
@ -1,3 +1,11 @@
|
|||||||
|
--------------------------------------------------------------------------------
|
||||||
|
LuaSec 1.2.0
|
||||||
|
---------------
|
||||||
|
This version includes:
|
||||||
|
|
||||||
|
* Add key material export method
|
||||||
|
* Backguard compat for openssl on providers, like LTS linuxes
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
LuaSec 1.1.0
|
LuaSec 1.1.0
|
||||||
---------------
|
---------------
|
||||||
|
2
INSTALL
2
INSTALL
@ -1,4 +1,4 @@
|
|||||||
LuaSec 1.1.0
|
LuaSec 1.2.0
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* OpenSSL options:
|
* OpenSSL options:
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
LuaSec 1.1.0 license
|
LuaSec 1.2.0 license
|
||||||
Copyright (C) 2006-2022 Bruno Silvestre, UFG
|
Copyright (C) 2006-2022 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 1.1.0
|
LuaSec 1.2.0
|
||||||
===============
|
===============
|
||||||
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 = "1.1.0-1"
|
version = "1.2.0-1"
|
||||||
source = {
|
source = {
|
||||||
url = "git+https://github.com/brunoos/luasec",
|
url = "git+https://github.com/brunoos/luasec",
|
||||||
tag = "v1.1.0",
|
tag = "v1.2.0",
|
||||||
}
|
}
|
||||||
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.",
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre
|
* Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre.
|
* Copyright (C) 2006-2022 Bruno Silvestre.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
||||||
* Matthew Wild.
|
* Matthew Wild.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define LSEC_CONTEXT_H
|
#define LSEC_CONTEXT_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre
|
* Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
2
src/ec.h
2
src/ec.h
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre
|
* Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
-- LuaSec 1.1.0
|
-- LuaSec 1.2.0
|
||||||
-- Copyright (C) 2009-2022 PUC-Rio
|
-- Copyright (C) 2009-2022 PUC-Rio
|
||||||
--
|
--
|
||||||
-- Author: Pablo Musa
|
-- Author: Pablo Musa
|
||||||
@ -18,8 +18,8 @@ local try = socket.try
|
|||||||
-- Module
|
-- Module
|
||||||
--
|
--
|
||||||
local _M = {
|
local _M = {
|
||||||
_VERSION = "1.1.0",
|
_VERSION = "1.2.0",
|
||||||
_COPYRIGHT = "LuaSec 1.1.0 - Copyright (C) 2009-2022 PUC-Rio",
|
_COPYRIGHT = "LuaSec 1.2.0 - Copyright (C) 2009-2022 PUC-Rio",
|
||||||
PORT = 443,
|
PORT = 443,
|
||||||
TIMEOUT = 60
|
TIMEOUT = 60
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre
|
* Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define LSEC_OPTIONS_H
|
#define LSEC_OPTIONS_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre
|
* Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -18,7 +18,7 @@ end
|
|||||||
local function generate(options, version)
|
local function generate(options, version)
|
||||||
print([[
|
print([[
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre
|
* Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
40
src/ssl.c
40
src/ssl.c
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann,
|
||||||
* Matthew Wild.
|
* Matthew Wild.
|
||||||
@ -671,6 +671,41 @@ static int meth_getpeerfinished(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get some shared keying material
|
||||||
|
*/
|
||||||
|
static int meth_exportkeyingmaterial(lua_State *L)
|
||||||
|
{
|
||||||
|
p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection");
|
||||||
|
|
||||||
|
if(ssl->state != LSEC_STATE_CONNECTED) {
|
||||||
|
lua_pushnil(L);
|
||||||
|
lua_pushstring(L, "closed");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t llen = 0;
|
||||||
|
size_t contextlen = 0;
|
||||||
|
const unsigned char *context = NULL;
|
||||||
|
const char *label = (const char*)luaL_checklstring(L, 2, &llen);
|
||||||
|
size_t olen = (size_t)luaL_checkinteger(L, 3);
|
||||||
|
|
||||||
|
if (!lua_isnoneornil(L, 4))
|
||||||
|
context = (const unsigned char*)luaL_checklstring(L, 4, &contextlen);
|
||||||
|
|
||||||
|
/* Temporary buffer memory-managed by Lua itself */
|
||||||
|
unsigned char *out = (unsigned char*)lua_newuserdata(L, olen);
|
||||||
|
|
||||||
|
if(SSL_export_keying_material(ssl->ssl, out, olen, label, llen, context, contextlen, context != NULL) != 1) {
|
||||||
|
lua_pushnil(L);
|
||||||
|
lua_pushstring(L, "error exporting keying material");
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
lua_pushlstring(L, (char*)out, olen);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object information -- tostring metamethod
|
* Object information -- tostring metamethod
|
||||||
*/
|
*/
|
||||||
@ -826,7 +861,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 1.1.0 - Copyright (C) 2006-2022 Bruno Silvestre, UFG"
|
lua_pushstring(L, "LuaSec 1.2.0 - Copyright (C) 2006-2022 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
|
||||||
@ -876,6 +911,7 @@ static luaL_Reg methods[] = {
|
|||||||
{"getpeerchain", meth_getpeerchain},
|
{"getpeerchain", meth_getpeerchain},
|
||||||
{"getpeerverification", meth_getpeerverification},
|
{"getpeerverification", meth_getpeerverification},
|
||||||
{"getpeerfinished", meth_getpeerfinished},
|
{"getpeerfinished", meth_getpeerfinished},
|
||||||
|
{"exportkeyingmaterial",meth_exportkeyingmaterial},
|
||||||
{"getsniname", meth_getsniname},
|
{"getsniname", meth_getsniname},
|
||||||
{"getstats", meth_getstats},
|
{"getstats", meth_getstats},
|
||||||
{"setstats", meth_setstats},
|
{"setstats", meth_setstats},
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define LSEC_SSL_H
|
#define LSEC_SSL_H
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 Bruno Silvestre
|
* Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
-- LuaSec 1.1.0
|
-- LuaSec 1.2.0
|
||||||
--
|
--
|
||||||
-- Copyright (C) 2006-2022 Bruno Silvestre
|
-- Copyright (C) 2006-2022 Bruno Silvestre
|
||||||
--
|
--
|
||||||
@ -275,7 +275,7 @@ core.setmethod("info", info)
|
|||||||
--
|
--
|
||||||
|
|
||||||
local _M = {
|
local _M = {
|
||||||
_VERSION = "1.1.0",
|
_VERSION = "1.2.0",
|
||||||
_COPYRIGHT = core.copyright(),
|
_COPYRIGHT = core.copyright(),
|
||||||
config = config,
|
config = config,
|
||||||
loadcertificate = x509.load,
|
loadcertificate = x509.load,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann
|
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann
|
||||||
* Matthew Wild, Bruno Silvestre.
|
* Matthew Wild, Bruno Silvestre.
|
||||||
@ -655,6 +655,7 @@ static int meth_set_encode(lua_State* L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
|
||||||
/**
|
/**
|
||||||
* Get signature name.
|
* Get signature name.
|
||||||
*/
|
*/
|
||||||
@ -669,6 +670,7 @@ static int meth_get_signature_name(lua_State* L)
|
|||||||
lua_pushstring(L, name);
|
lua_pushstring(L, name);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -698,7 +700,9 @@ static luaL_Reg methods[] = {
|
|||||||
{"digest", meth_digest},
|
{"digest", meth_digest},
|
||||||
{"setencode", meth_set_encode},
|
{"setencode", meth_set_encode},
|
||||||
{"extensions", meth_extensions},
|
{"extensions", meth_extensions},
|
||||||
|
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
|
||||||
{"getsignaturename", meth_get_signature_name},
|
{"getsignaturename", meth_get_signature_name},
|
||||||
|
#endif
|
||||||
{"issuer", meth_issuer},
|
{"issuer", meth_issuer},
|
||||||
{"notbefore", meth_notbefore},
|
{"notbefore", meth_notbefore},
|
||||||
{"notafter", meth_notafter},
|
{"notafter", meth_notafter},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* LuaSec 1.1.0
|
* LuaSec 1.2.0
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann
|
* Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann
|
||||||
* Matthew Wild, Bruno Silvestre.
|
* Matthew Wild, Bruno Silvestre.
|
||||||
|
Reference in New Issue
Block a user