Skip to content

Commit 36e94ee

Browse files
committed
LuaSec 0.2
1 parent 0bae6de commit 36e94ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4757
-0
lines changed

INSTALL

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
LuaSec 0.2
2+
-----------
3+
4+
* On Linux, BSD, and Mac OS X:
5+
6+
- Edit 'Makefile'
7+
* Inform the path to install the modules.
8+
* If Lua or OpenSSL are not in the default path, set the
9+
variables INCDIR and LIBDIR.
10+
* For Mac OS X, set the variable MACOSX_VERSION.
11+
12+
- Use 'make <platform>' to compile
13+
* Platforms: linux, bsd, or macosx
14+
15+
- Use 'make install' to install the modules.
16+
17+
* On Windows:
18+
19+
- Use the Visual C++ project to compile the library.
20+
21+
- Copy the 'ssl.lua' file to some place in your LUA_PATH.
22+
23+
- Copy the 'ssl.dll' file to some place in your LUA_CPATH.

LICENSE

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
LuaSec 0.2 license
2+
Copyright (C) 2006-2007 Bruno Silvestre
3+
4+
Permission is hereby granted, free of charge, to any person obtaining
5+
a copy of this software and associated documentation files (the
6+
"Software"), to deal in the Software without restriction, including
7+
without limitation the rights to use, copy, modify, merge, publish,
8+
distribute, sublicense, and/or sell copies of the Software, and to
9+
permit persons to whom the Software is furnished to do so, subject to
10+
the following conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
----------------------------------------------------------------------------
24+
25+
LuaSocket 2.0.2 license
26+
Copyright � 2004-2007 Diego Nehab
27+
28+
Permission is hereby granted, free of charge, to any person obtaining a
29+
copy of this software and associated documentation files (the "Software"),
30+
to deal in the Software without restriction, including without limitation
31+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
32+
and/or sell copies of the Software, and to permit persons to whom the
33+
Software is furnished to do so, subject to the following conditions:
34+
35+
The above copyright notice and this permission notice shall be included in
36+
all copies or substantial portions of the Software.
37+
38+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
44+
DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Inform the location to intall the modules
2+
LUAPATH=/usr/local/share/lua/5.1
3+
CPATH=/usr/local/lib/lua/5.1
4+
5+
# Edit the lines below to inform new path, if necessary
6+
#
7+
#INCDIR=-I/usr/local/lua-5.1/include -I/usr/local/openssl-0.9.8/include
8+
#LIBDIR=-L/usr/local/openssl-0.9.8/lib -R/usr/local/openssl-0.9.8/lib
9+
10+
# For Mac OS X: set the system version
11+
MACOSX_VERSION=10.4
12+
13+
DEFS=-DBUFFER_DEBUG
14+
15+
#----------------------
16+
# Do not edit this part
17+
18+
.PHONY: all clean install none linux bsd macosx
19+
20+
all: none
21+
22+
none:
23+
@echo "Usage: $(MAKE) <platform>"
24+
@echo " * linux"
25+
@echo " * bsd"
26+
@echo " * macosx"
27+
28+
install:
29+
@cd src ; $(MAKE) CPATH="$(CPATH)" LUAPATH="$(LUAPATH)" install
30+
31+
linux:
32+
@echo "---------------------"
33+
@echo "** Build for Linux **"
34+
@echo "---------------------"
35+
@cd src ; $(MAKE) INCDIR="$(INCDIR)" LIBDIR="$(LIBDIR)" DEFS="$(DEFS)" $@
36+
37+
bsd:
38+
@echo "-------------------"
39+
@echo "** Build for BSD **"
40+
@echo "-------------------"
41+
@cd src ; $(MAKE) INCDIR="$(INCDIR)" LIBDIR="$(LIBDIR)" DEFS="$(DEFS)" $@
42+
43+
macosx:
44+
@echo "------------------------------"
45+
@echo "** Build for Mac OS X $(MACOSX_VERSION) **"
46+
@echo "------------------------------"
47+
@cd src ; $(MAKE) INCDIR="$(INCDIR)" LIBDIR="$(LIBDIR)" DEFS="$(DEFS)" MACVER="$(MACOSX_VERSION)" $@
48+
49+
clean:
50+
@cd src ; $(MAKE) clean

luasec.ncb

1.2 MB
Binary file not shown.

luasec.sln

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Microsoft Visual Studio Solution File, Format Version 8.00
2+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luasec", "luasec.vcproj", "{A629932F-8819-4C0B-8835-CBF1FEED6376}"
3+
ProjectSection(ProjectDependencies) = postProject
4+
EndProjectSection
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfiguration) = preSolution
8+
Debug = Debug
9+
Release = Release
10+
EndGlobalSection
11+
GlobalSection(ProjectConfiguration) = postSolution
12+
{A629932F-8819-4C0B-8835-CBF1FEED6376}.Debug.ActiveCfg = Debug|Win32
13+
{A629932F-8819-4C0B-8835-CBF1FEED6376}.Debug.Build.0 = Debug|Win32
14+
{A629932F-8819-4C0B-8835-CBF1FEED6376}.Release.ActiveCfg = Release|Win32
15+
{A629932F-8819-4C0B-8835-CBF1FEED6376}.Release.Build.0 = Release|Win32
16+
EndGlobalSection
17+
GlobalSection(ExtensibilityGlobals) = postSolution
18+
EndGlobalSection
19+
GlobalSection(ExtensibilityAddIns) = postSolution
20+
EndGlobalSection
21+
EndGlobal

luasec.suo

9.5 KB
Binary file not shown.

luasec.vcproj

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<?xml version="1.0" encoding="Windows-1252"?>
2+
<VisualStudioProject
3+
ProjectType="Visual C++"
4+
Version="7.10"
5+
Name="luasec"
6+
ProjectGUID="{A629932F-8819-4C0B-8835-CBF1FEED6376}"
7+
Keyword="Win32Proj">
8+
<Platforms>
9+
<Platform
10+
Name="Win32"/>
11+
</Platforms>
12+
<Configurations>
13+
<Configuration
14+
Name="Debug|Win32"
15+
OutputDirectory="Debug"
16+
IntermediateDirectory="Debug"
17+
ConfigurationType="2"
18+
CharacterSet="2">
19+
<Tool
20+
Name="VCCLCompilerTool"
21+
Optimization="0"
22+
AdditionalIncludeDirectories="C:\devel\openssl\include;&quot;C:\devel\lua-5.1-md\include&quot;"
23+
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASEC_EXPORTS"
24+
MinimalRebuild="TRUE"
25+
BasicRuntimeChecks="3"
26+
RuntimeLibrary="3"
27+
UsePrecompiledHeader="0"
28+
WarningLevel="3"
29+
Detect64BitPortabilityProblems="TRUE"
30+
DebugInformationFormat="4"/>
31+
<Tool
32+
Name="VCCustomBuildTool"/>
33+
<Tool
34+
Name="VCLinkerTool"
35+
AdditionalDependencies="libeay32MD.lib ssleay32MD.lib lua5.1.lib"
36+
OutputFile="$(OutDir)/ssl.dll"
37+
LinkIncremental="2"
38+
AdditionalLibraryDirectories="C:\devel\openssl\lib\VC;&quot;C:\devel\lua-5.1-md\lib&quot;"
39+
GenerateDebugInformation="TRUE"
40+
ProgramDatabaseFile="$(OutDir)/luasec.pdb"
41+
SubSystem="2"
42+
ImportLibrary="$(OutDir)/ssl.lib"
43+
TargetMachine="1"/>
44+
<Tool
45+
Name="VCMIDLTool"/>
46+
<Tool
47+
Name="VCPostBuildEventTool"/>
48+
<Tool
49+
Name="VCPreBuildEventTool"/>
50+
<Tool
51+
Name="VCPreLinkEventTool"/>
52+
<Tool
53+
Name="VCResourceCompilerTool"/>
54+
<Tool
55+
Name="VCWebServiceProxyGeneratorTool"/>
56+
<Tool
57+
Name="VCXMLDataGeneratorTool"/>
58+
<Tool
59+
Name="VCWebDeploymentTool"/>
60+
<Tool
61+
Name="VCManagedWrapperGeneratorTool"/>
62+
<Tool
63+
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
64+
</Configuration>
65+
<Configuration
66+
Name="Release|Win32"
67+
OutputDirectory="Release"
68+
IntermediateDirectory="Release"
69+
ConfigurationType="2"
70+
CharacterSet="2">
71+
<Tool
72+
Name="VCCLCompilerTool"
73+
AdditionalIncludeDirectories="C:\devel\openssl\include;&quot;C:\devel\lua-5.1-md\include&quot;"
74+
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASEC_EXPORTS;BUFFER_DEBUG;LUASEC_API=__declspec(dllexport)"
75+
RuntimeLibrary="2"
76+
UsePrecompiledHeader="0"
77+
WarningLevel="3"
78+
Detect64BitPortabilityProblems="TRUE"
79+
DebugInformationFormat="3"/>
80+
<Tool
81+
Name="VCCustomBuildTool"/>
82+
<Tool
83+
Name="VCLinkerTool"
84+
AdditionalDependencies="ws2_32.lib libeay32MD.lib ssleay32MD.lib lua5.1.lib"
85+
OutputFile="$(OutDir)/ssl.dll"
86+
LinkIncremental="1"
87+
AdditionalLibraryDirectories="C:\devel\openssl\lib\VC;&quot;C:\devel\lua-5.1-md\lib&quot;"
88+
GenerateDebugInformation="TRUE"
89+
SubSystem="2"
90+
OptimizeReferences="2"
91+
EnableCOMDATFolding="2"
92+
ImportLibrary="$(OutDir)/ssl.lib"
93+
TargetMachine="1"/>
94+
<Tool
95+
Name="VCMIDLTool"/>
96+
<Tool
97+
Name="VCPostBuildEventTool"/>
98+
<Tool
99+
Name="VCPreBuildEventTool"/>
100+
<Tool
101+
Name="VCPreLinkEventTool"/>
102+
<Tool
103+
Name="VCResourceCompilerTool"/>
104+
<Tool
105+
Name="VCWebServiceProxyGeneratorTool"/>
106+
<Tool
107+
Name="VCXMLDataGeneratorTool"/>
108+
<Tool
109+
Name="VCWebDeploymentTool"/>
110+
<Tool
111+
Name="VCManagedWrapperGeneratorTool"/>
112+
<Tool
113+
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
114+
</Configuration>
115+
</Configurations>
116+
<References>
117+
</References>
118+
<Files>
119+
<Filter
120+
Name="Source Files"
121+
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
122+
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
123+
<File
124+
RelativePath=".\src\buffer.c">
125+
</File>
126+
<File
127+
RelativePath=".\src\context.c">
128+
</File>
129+
<File
130+
RelativePath=".\src\io.c">
131+
</File>
132+
<File
133+
RelativePath=".\src\ssl.c">
134+
</File>
135+
<File
136+
RelativePath=".\src\timeout.c">
137+
</File>
138+
<File
139+
RelativePath=".\src\wsocket.c">
140+
</File>
141+
</Filter>
142+
<Filter
143+
Name="Header Files"
144+
Filter="h;hpp;hxx;hm;inl;inc;xsd"
145+
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
146+
<File
147+
RelativePath=".\src\buffer.h">
148+
</File>
149+
<File
150+
RelativePath=".\src\context.h">
151+
</File>
152+
<File
153+
RelativePath=".\src\io.h">
154+
</File>
155+
<File
156+
RelativePath=".\src\socket.h">
157+
</File>
158+
<File
159+
RelativePath=".\src\ssl.h">
160+
</File>
161+
<File
162+
RelativePath=".\src\timeout.h">
163+
</File>
164+
<File
165+
RelativePath=".\src\wsocket.h">
166+
</File>
167+
</Filter>
168+
<Filter
169+
Name="Resource Files"
170+
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
171+
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
172+
</Filter>
173+
</Files>
174+
<Globals>
175+
</Globals>
176+
</VisualStudioProject>

samples/README

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
In all examples, the SSL/TLS layer can be disable just commenting the
2+
wrap section. In this case, the examples work with normal TCP
3+
communication.
4+
5+
Directories:
6+
------------
7+
* certs
8+
It contains a set of certificates used in the examples. You can use
9+
the scrits to recreate them if necessary (due to certificates
10+
expiration date, for example). First, generate the Root CA 'A' and
11+
'B', then the servers and clients.
12+
13+
* oneshot
14+
A simple connection example.
15+
16+
* loop
17+
Test successive connections between the server and the client
18+
(to check memory leak).
19+
20+
* loop-gc
21+
Same of above, but the connection is not explicit closed, the gabage
22+
collector is encharge of it.
23+
24+
* wantread
25+
Test timeout in handshake() and receive().
26+
27+
* wantwrite
28+
Test timeout in send().
29+
30+
* want
31+
Test want().

0 commit comments

Comments
 (0)