Compare commits

..

1 Commits

21 changed files with 36 additions and 41 deletions

View File

@ -1,12 +1,3 @@
--------------------------------------------------------------------------------
LuaSec 1.3.2
---------------
This version includes:
* Fix: place EAI_OVERFLOW inside macro, unbreak build on <10.7 (Sergey Fedorov)
* Fix: Expand workaround for zero errno to OpenSSL 3.0.x (Kim Alvefur)
* Fix: reset block timeout at send or receive (MartinDahlberg)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
LuaSec 1.3.1 LuaSec 1.3.1
--------------- ---------------

View File

@ -1,4 +1,4 @@
LuaSec 1.3.2 LuaSec 1.3.1
------------ ------------
* OpenSSL options: * OpenSSL options:

View File

@ -1,4 +1,4 @@
LuaSec 1.3.2 license LuaSec 1.3.1 license
Copyright (C) 2006-2023 Bruno Silvestre, UFG Copyright (C) 2006-2023 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

View File

@ -1,4 +1,4 @@
LuaSec 1.3.2 LuaSec 1.3.1
=============== ===============
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.

View File

@ -1,8 +1,8 @@
package = "LuaSec" package = "LuaSec"
version = "1.3.2-1" version = "1.3.1-1"
source = { source = {
url = "git+https://github.com/brunoos/luasec", url = "git+https://github.com/brunoos/luasec",
tag = "v1.3.2", tag = "v1.3.1",
} }
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.",

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *
@ -48,8 +48,8 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#if !defined(LIBRESSL_VERSION_NUMBER) && ((OPENSSL_VERSION_NUMBER & 0xFFFFF000L) == 0x10101000L || (OPENSSL_VERSION_NUMBER & 0xFFFFF000L) == 0x30000000L) #if !defined(LIBRESSL_VERSION_NUMBER) && ((OPENSSL_VERSION_NUMBER & 0xFFFFF000L) == 0x10101000L)
#define LSEC_OPENSSL_ERRNO_BUG #define LSEC_OPENSSL_1_1_1
#endif #endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild * Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre

View File

@ -2,7 +2,7 @@
#define LSEC_CONTEXT_H #define LSEC_CONTEXT_H
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -1,5 +1,5 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
-- LuaSec 1.3.2 -- LuaSec 1.3.1
-- --
-- Copyright (C) 2009-2023 PUC-Rio -- Copyright (C) 2009-2023 PUC-Rio
-- --
@ -19,8 +19,8 @@ local try = socket.try
-- Module -- Module
-- --
local _M = { local _M = {
_VERSION = "1.3.2", _VERSION = "1.3.1",
_COPYRIGHT = "LuaSec 1.3.2 - Copyright (C) 2009-2023 PUC-Rio", _COPYRIGHT = "LuaSec 1.3.1 - Copyright (C) 2009-2023 PUC-Rio",
PORT = 443, PORT = 443,
TIMEOUT = 60 TIMEOUT = 60
} }

View File

@ -78,7 +78,9 @@ int buffer_meth_send(lua_State *L, p_buffer buf) {
const char *data = luaL_checklstring(L, 2, &size); const char *data = luaL_checklstring(L, 2, &size);
long start = (long) luaL_optnumber(L, 3, 1); long start = (long) luaL_optnumber(L, 3, 1);
long end = (long) luaL_optnumber(L, 4, -1); long end = (long) luaL_optnumber(L, 4, -1);
timeout_markstart(buf->tm); #ifdef LUASOCKET_DEBUG
p_timeout tm = timeout_markstart(buf->tm);
#endif
if (start < 0) start = (long) (size+start+1); if (start < 0) start = (long) (size+start+1);
if (end < 0) end = (long) (size+end+1); if (end < 0) end = (long) (size+end+1);
if (start < 1) start = (long) 1; if (start < 1) start = (long) 1;
@ -96,7 +98,7 @@ int buffer_meth_send(lua_State *L, p_buffer buf) {
} }
#ifdef LUASOCKET_DEBUG #ifdef LUASOCKET_DEBUG
/* push time elapsed during operation as the last return value */ /* push time elapsed during operation as the last return value */
lua_pushnumber(L, timeout_gettime() - timeout_getstart(buf->tm)); lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));
#endif #endif
return lua_gettop(L) - top; return lua_gettop(L) - top;
} }
@ -115,7 +117,9 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) {
top = 3; top = 3;
} }
part = luaL_optlstring(L, 3, "", &size); part = luaL_optlstring(L, 3, "", &size);
timeout_markstart(buf->tm); #ifdef LUASOCKET_DEBUG
p_timeout tm = timeout_markstart(buf->tm);
#endif
/* initialize buffer with optional extra prefix /* initialize buffer with optional extra prefix
* (useful for concatenating previous partial results) */ * (useful for concatenating previous partial results) */
luaL_buffinit(L, &b); luaL_buffinit(L, &b);
@ -151,7 +155,7 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) {
} }
#ifdef LUASOCKET_DEBUG #ifdef LUASOCKET_DEBUG
/* push time elapsed during operation as the last return value */ /* push time elapsed during operation as the last return value */
lua_pushnumber(L, timeout_gettime() - timeout_getstart(buf->tm)); lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));
#endif #endif
return lua_gettop(L) - top; return lua_gettop(L) - top;
} }

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -2,7 +2,7 @@
#define LSEC_OPTIONS_H #define LSEC_OPTIONS_H
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -18,7 +18,7 @@ end
local function generate(options, version) local function generate(options, version)
print([[ print([[
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild * Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
@ -47,8 +47,8 @@ static int lsec_socket_error()
#if defined(WIN32) #if defined(WIN32)
return WSAGetLastError(); return WSAGetLastError();
#else #else
#if defined(LSEC_OPENSSL_ERRNO_BUG) #if defined(LSEC_OPENSSL_1_1_1)
// Bug in OpenSSL // Bug in OpenSSL 1.1.1
if (errno == 0) if (errno == 0)
return LSEC_IO_SSL; return LSEC_IO_SSL;
#endif #endif
@ -951,7 +951,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.3.2 - Copyright (C) 2006-2023 Bruno Silvestre, UFG" lua_pushstring(L, "LuaSec 1.3.1 - Copyright (C) 2006-2023 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

View File

@ -2,7 +2,7 @@
#define LSEC_SSL_H #define LSEC_SSL_H
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2006-2023 Bruno Silvestre * Copyright (C) 2006-2023 Bruno Silvestre
* *

View File

@ -1,5 +1,5 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- LuaSec 1.3.2 -- LuaSec 1.3.1
-- --
-- Copyright (C) 2006-2023 Bruno Silvestre -- Copyright (C) 2006-2023 Bruno Silvestre
-- --
@ -302,7 +302,7 @@ core.setmethod("info", info)
-- --
local _M = { local _M = {
_VERSION = "1.3.2", _VERSION = "1.3.1",
_COPYRIGHT = core.copyright(), _COPYRIGHT = core.copyright(),
config = config, config = config,
loadcertificate = x509.load, loadcertificate = x509.load,

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild * Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild
* Copyright (C) 2014-2023 Bruno Silvestre * Copyright (C) 2014-2023 Bruno Silvestre

View File

@ -1,5 +1,5 @@
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
* LuaSec 1.3.2 * LuaSec 1.3.1
* *
* Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild * Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild
* Copyright (C) 2013-2023 Bruno Silvestre * Copyright (C) 2013-2023 Bruno Silvestre