mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Update CyaSSL to latest version.
This commit is contained in:
parent
5fcd270398
commit
3d007d0b4b
445 changed files with 162375 additions and 26182 deletions
|
@ -42,7 +42,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../"
|
||||
PreprocessorDefinitions="CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS"
|
||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -118,7 +118,7 @@
|
|||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="../"
|
||||
PreprocessorDefinitions="CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS"
|
||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
|
|
181
FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSniffer.vcxproj
Normal file
181
FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSniffer.vcxproj
Normal file
|
@ -0,0 +1,181 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}</ProjectGuid>
|
||||
<RootNamespace>sslSniffer</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>11.0.61030.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\sniffer.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\sniffer.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\cyassl\sniffer_error.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\cyassl.vcxproj">
|
||||
<Project>{73973223-5ee8-41ca-8e88-1d60e89a237b}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -2,11 +2,13 @@
|
|||
# included from Top Level Makefile.am
|
||||
# All paths should be given relative to the root
|
||||
|
||||
if BUILD_SNIFFTEST
|
||||
noinst_PROGRAMS += sslSniffer/sslSnifferTest/snifftest
|
||||
sslSniffer_sslSnifferTest_snifftest_SOURCES = sslSniffer/sslSnifferTest/snifftest.c
|
||||
if BUILD_SNIFFER
|
||||
sslSniffer_sslSnifferTest_snifftest_LDADD = src/libcyassl.la -lpcap
|
||||
sslSniffer_sslSnifferTest_snifftest_DEPENDENCIES = src/libcyassl.la
|
||||
endif
|
||||
EXTRA_DIST += sslSniffer/sslSniffer.vcproj
|
||||
EXTRA_DIST += sslSniffer/sslSniffer.vcxproj
|
||||
EXTRA_DIST += sslSniffer/sslSnifferTest/sslSniffTest.vcproj
|
||||
DISTCLEANFILES+= sslSniffer/sslSnifferTest/.libs/snifftest
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* snifftest.c
|
||||
*
|
||||
* Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
|
||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
*
|
||||
|
@ -16,13 +16,15 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define CYASSL_SNIFFER
|
||||
#endif
|
||||
|
@ -32,7 +34,7 @@
|
|||
/* blank build */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
int main()
|
||||
int main(void)
|
||||
{
|
||||
printf("do ./configure --enable-sniffer to enable build support\n");
|
||||
return EXIT_SUCCESS;
|
||||
|
@ -67,26 +69,35 @@ enum {
|
|||
};
|
||||
|
||||
|
||||
pcap_t* pcap = 0;
|
||||
pcap_if_t *alldevs;
|
||||
pcap_t* pcap = NULL;
|
||||
pcap_if_t* alldevs = NULL;
|
||||
|
||||
|
||||
static void FreeAll(void)
|
||||
{
|
||||
if (pcap)
|
||||
pcap_close(pcap);
|
||||
if (alldevs)
|
||||
pcap_freealldevs(alldevs);
|
||||
#ifndef _WIN32
|
||||
ssl_FreeSniffer();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sig_handler(const int sig)
|
||||
{
|
||||
printf("SIGINT handled = %d.\n", sig);
|
||||
if (pcap)
|
||||
pcap_close(pcap);
|
||||
pcap_freealldevs(alldevs);
|
||||
#ifndef _WIN32
|
||||
ssl_FreeSniffer();
|
||||
#endif
|
||||
exit(EXIT_SUCCESS);
|
||||
FreeAll();
|
||||
if (sig)
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
static void err_sys(const char* msg)
|
||||
{
|
||||
fprintf(stderr, "%s\n", msg);
|
||||
exit(EXIT_FAILURE);
|
||||
if (msg)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -110,7 +121,7 @@ static char* iptos(unsigned int addr)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
int inum;
|
||||
int port;
|
||||
int saveFile = 0;
|
||||
|
@ -149,7 +160,9 @@ int main(int argc, char** argv)
|
|||
" installed correctly and you have sufficient permissions");
|
||||
|
||||
printf("Enter the interface number (1-%d): ", i);
|
||||
scanf("%d", &inum);
|
||||
ret = scanf("%d", &inum);
|
||||
if (ret != 1)
|
||||
printf("scanf port failed\n");
|
||||
|
||||
if (inum < 1 || inum > i)
|
||||
err_sys("Interface number out of range");
|
||||
|
@ -196,7 +209,9 @@ int main(int argc, char** argv)
|
|||
if (ret != 0) printf("pcap_activate failed %s\n", pcap_geterr(pcap));
|
||||
|
||||
printf("Enter the port to scan: ");
|
||||
scanf("%d", &port);
|
||||
ret = scanf("%d", &port);
|
||||
if (ret != 1)
|
||||
printf("scanf port failed\n");
|
||||
|
||||
SNPRINTF(filter, sizeof(filter), "tcp and port %d", port);
|
||||
|
||||
|
@ -208,6 +223,9 @@ int main(int argc, char** argv)
|
|||
|
||||
ret = ssl_SetPrivateKey(server, port, "../../certs/server-key.pem",
|
||||
FILETYPE_PEM, NULL, err);
|
||||
if (ret != 0) {
|
||||
printf("Please run directly from sslSniffer/sslSnifferTest dir\n");
|
||||
}
|
||||
}
|
||||
else if (argc >= 3) {
|
||||
saveFile = 1;
|
||||
|
@ -217,6 +235,7 @@ int main(int argc, char** argv)
|
|||
ret = -1;
|
||||
}
|
||||
else {
|
||||
const char* passwd = NULL;
|
||||
/* defaults for server and port */
|
||||
port = 443;
|
||||
server = "127.0.0.1";
|
||||
|
@ -227,14 +246,17 @@ int main(int argc, char** argv)
|
|||
if (argc >= 5)
|
||||
port = atoi(argv[4]);
|
||||
|
||||
if (argc >= 6)
|
||||
passwd = argv[5];
|
||||
|
||||
ret = ssl_SetPrivateKey(server, port, argv[2],
|
||||
FILETYPE_PEM, NULL, err);
|
||||
FILETYPE_PEM, passwd, err);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* usage error */
|
||||
printf(
|
||||
"usage: ./snifftest or ./snifftest dump pemKey [server] [port]\n");
|
||||
printf( "usage: ./snifftest or ./snifftest dump pemKey"
|
||||
" [server] [port] [password]\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
@ -245,11 +267,13 @@ int main(int argc, char** argv)
|
|||
frame = NULL_IF_FRAME_LEN;
|
||||
|
||||
while (1) {
|
||||
static int packetNumber = 0;
|
||||
struct pcap_pkthdr header;
|
||||
const unsigned char* packet = pcap_next(pcap, &header);
|
||||
packetNumber++;
|
||||
if (packet) {
|
||||
|
||||
byte data[65535];
|
||||
byte data[65535+16384]; /* may have a partial 16k record cached */
|
||||
|
||||
if (header.caplen > 40) { /* min ip(20) + min tcp(20) */
|
||||
packet += frame;
|
||||
|
@ -263,12 +287,13 @@ int main(int argc, char** argv)
|
|||
printf("ssl_Decode ret = %d, %s\n", ret, err);
|
||||
if (ret > 0) {
|
||||
data[ret] = 0;
|
||||
printf("SSL App Data:%s\n", data);
|
||||
printf("SSL App Data(%d:%d):%s\n", packetNumber, ret, data);
|
||||
}
|
||||
}
|
||||
else if (saveFile)
|
||||
break; /* we're done reading file */
|
||||
}
|
||||
FreeAll();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../../WpdPack/Include;../../include"
|
||||
AdditionalIncludeDirectories="../../../WpdPack/Include;../.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
|
@ -117,7 +117,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="../../../WpdPack/Include;../../include"
|
||||
AdditionalIncludeDirectories="../../../WpdPack/Include;../.."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue