8 Commits

Author SHA1 Message Date
989ee5f993 Add compatibility flat to OpenSSL 1.1.1 version
Avoid deprecated messages until the code is fully compliant with version 3.x
2025-07-10 12:05:16 -03:00
fa16e04293 Fix: use luaL_register instead of luaL_openlib 2025-07-10 10:33:50 -03:00
4c06287052 Release LuaSec 1.3.2 2023-08-31 17:09:53 -03:00
5f4799d8cf reset block timeout at send or receive
Addressing #159 and #160
2023-08-31 10:51:50 -03:00
5787d51bb8 Merge pull request #197 from Zash/errno-bug-again
Expand workaround for zero errno to OpenSSL 3.0.x
2023-07-12 21:41:40 -03:00
a2b211f847 Expand workaround for zero errno to OpenSSL 3.0.x
Encountered the bug in #172 after upgrading to OpenSSL 3.0.9, so it
appears to still be present.

Occurs when writing to a connection that has been closed by the remote.
2023-07-05 13:21:49 +02:00
769ac528e2 Merge pull request #196 from barracuda156/darwin
usocket.c: place EAI_OVERFLOW inside macro, unbreak build on <10.7
2023-05-09 10:25:21 -03:00
0f0e07eb41 usocket.c: place EAI_OVERFLOW inside macro, unbreak build on <10.7 2023-04-09 20:20:36 +08:00
24 changed files with 48 additions and 40 deletions

View File

@ -1,3 +1,12 @@
--------------------------------------------------------------------------------
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
---------------

View File

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

View File

@ -1,4 +1,4 @@
LuaSec 1.3.1 license
LuaSec 1.3.2 license
Copyright (C) 2006-2023 Bruno Silvestre, UFG
Permission is hereby granted, free of charge, to any person obtaining

View File

@ -6,7 +6,7 @@ LUACPATH ?= /usr/lib/lua/5.1
# Comment this lines if you will link with non-internal LuaSocket's help files
# and edit INCDIR and LIBDIR properly.
EXTRA = luasocket
DEFS = -DWITH_LUASOCKET
DEFS = -DWITH_LUASOCKET -DOPENSSL_API_COMPAT=0x10101000L
# Edit the lines below to inform new path, if necessary.
# Path below points to internal LuaSocket's help files.

View File

@ -1,4 +1,4 @@
LuaSec 1.3.1
LuaSec 1.3.2
===============
LuaSec depends on OpenSSL, and integrates with LuaSocket to make it
easy to add secure connections to any Lua applications or scripts.

View File

@ -1,8 +1,8 @@
package = "LuaSec"
version = "1.3.1-1"
version = "1.3.2-1"
source = {
url = "git+https://github.com/brunoos/luasec",
tag = "v1.3.1",
tag = "v1.3.2",
}
description = {
summary = "A binding for OpenSSL library to provide TLS/SSL communication over LuaSocket.",
@ -46,7 +46,7 @@ build = {
modules = {
ssl = {
defines = {
"WITH_LUASOCKET", "LUASOCKET_DEBUG",
"WITH_LUASOCKET", "LUASOCKET_DEBUG", "OPENSSL_API_COMPAT=0x10101000L"
},
incdirs = {
"$(OPENSSL_INCDIR)", "src/", "src/luasocket",
@ -80,7 +80,8 @@ build = {
defines = {
"WIN32", "NDEBUG", "_WINDOWS", "_USRDLL", "LSEC_EXPORTS", "BUFFER_DEBUG", "LSEC_API=__declspec(dllexport)",
"WITH_LUASOCKET", "LUASOCKET_DEBUG",
"LUASEC_INET_NTOP", "WINVER=0x0501", "_WIN32_WINNT=0x0501", "NTDDI_VERSION=0x05010300"
"LUASEC_INET_NTOP", "WINVER=0x0501", "_WIN32_WINNT=0x0501", "NTDDI_VERSION=0x05010300",
"OPENSSL_API_COMPAT=0x10101000L"
},
libdirs = {
"$(OPENSSL_LIBDIR)",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -146,7 +146,7 @@ int timeout_open(lua_State *L) {
#if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE)
luaL_setfuncs(L, func, 0);
#else
luaL_openlib(L, NULL, func, 0);
luaL_register(L, NULL, func);
#endif
return 0;
}

View File

@ -426,7 +426,9 @@ const char *socket_gaistrerror(int err) {
case EAI_MEMORY: return "memory allocation failure";
case EAI_NONAME:
return "host or service not provided, or not known";
#ifdef EAI_OVERFLOW
case EAI_OVERFLOW: return "argument buffer overflow";
#endif
#ifdef EAI_PROTOCOL
case EAI_PROTOCOL: return "resolved protocol is unknown";
#endif

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
* LuaSec 1.3.1
* LuaSec 1.3.2
*
* Copyright (C) 2014-2023 Kim Alvefur, Paul Aurich, Tobias Markmann, Matthew Wild
* Copyright (C) 2006-2023 Bruno Silvestre
@ -47,8 +47,8 @@ static int lsec_socket_error()
#if defined(WIN32)
return WSAGetLastError();
#else
#if defined(LSEC_OPENSSL_1_1_1)
// Bug in OpenSSL 1.1.1
#if defined(LSEC_OPENSSL_ERRNO_BUG)
// Bug in OpenSSL
if (errno == 0)
return LSEC_IO_SSL;
#endif
@ -947,7 +947,7 @@ static int meth_getalpn(lua_State *L)
static int meth_copyright(lua_State *L)
{
lua_pushstring(L, "LuaSec 1.3.1 - Copyright (C) 2006-2023 Bruno Silvestre, UFG"
lua_pushstring(L, "LuaSec 1.3.2 - Copyright (C) 2006-2023 Bruno Silvestre, UFG"
#if defined(WITH_LUASOCKET)
"\nLuaSocket 3.0-RC1 - Copyright (C) 2004-2013 Diego Nehab"
#endif

View File

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

View File

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

View File

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

View File

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