[修改] 增加freeRTOS
1. 版本FreeRTOSv202212.01,命名为kernel;
This commit is contained in:
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{19f0ff1a-3368-491a-9932-a2f089508f51}</ProjectGuid>
|
||||
<RootNamespace>corePKCS11</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\</PublicIncludeDirectories>
|
||||
<AllProjectIncludesArePublic>true</AllProjectIncludesArePublic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\</PublicIncludeDirectories>
|
||||
<AllProjectIncludesArePublic>true</AllProjectIncludesArePublic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\</PublicIncludeDirectories>
|
||||
<AllProjectIncludesArePublic>true</AllProjectIncludesArePublic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PublicIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\</PublicIncludeDirectories>
|
||||
<AllProjectIncludesArePublic>true</AllProjectIncludesArePublic>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\Source\corePKCS11\source\include;..\..\Source\corePKCS11\source\portable\os;..\..\Source\corePKCS11\source\portable\os\freertos_winsim;..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils;..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FreeRTOS-Kernel\FreeRTOS-Kernel.vcxproj">
|
||||
<Project>{72c209c4-49a4-4942-a201-44706c9d77ec}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Logging\Logging.vcxproj">
|
||||
<Project>{be362ac0-b10b-4276-b84e-6304652ba228}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MbedTLS\MbedTLS.vcxproj">
|
||||
<Project>{e1016f3e-94e9-4864-9fd8-1d7c1fefbfd7}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\core_pkcs11.c" />
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\core_pki_utils.c" />
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils\mbedtls_utils.c" />
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\portable\mbedtls\core_pkcs11_mbedtls.c" />
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\portable\os\core_pkcs11_pal_utils.c" />
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\portable\os\freertos_winsim\core_pkcs11_pal.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils\mbedtls_utils.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\pkcs11.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\pkcs11f.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\pkcs11t.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pkcs11.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pkcs11_config_defaults.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pkcs11_pal.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pki_utils.h" />
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\portable\os\core_pkcs11_pal_utils.h" />
|
||||
<ClInclude Include="core_pkcs11_config.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="pkcs11_api">
|
||||
<UniqueIdentifier>{87f448f0-826d-4964-8c17-2dafde7cdc17}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="corePKCS11">
|
||||
<UniqueIdentifier>{f837be63-52d6-4f7a-b057-323ad9c20295}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="corePKCS11\include">
|
||||
<UniqueIdentifier>{a67eb7ab-543a-475e-88ea-d2543002780c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\core_pkcs11.c">
|
||||
<Filter>corePKCS11</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\portable\mbedtls\core_pkcs11_mbedtls.c">
|
||||
<Filter>corePKCS11</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\core_pki_utils.c">
|
||||
<Filter>corePKCS11</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils\mbedtls_utils.c">
|
||||
<Filter>corePKCS11</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\portable\os\core_pkcs11_pal_utils.c">
|
||||
<Filter>corePKCS11</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Source\corePKCS11\source\portable\os\freertos_winsim\core_pkcs11_pal.c">
|
||||
<Filter>corePKCS11</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\pkcs11t.h">
|
||||
<Filter>pkcs11_api</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\pkcs11.h">
|
||||
<Filter>pkcs11_api</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\pkcs11\pkcs11f.h">
|
||||
<Filter>pkcs11_api</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pkcs11.h">
|
||||
<Filter>corePKCS11\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pkcs11_config_defaults.h">
|
||||
<Filter>corePKCS11\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pkcs11_pal.h">
|
||||
<Filter>corePKCS11\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\portable\os\core_pkcs11_pal_utils.h">
|
||||
<Filter>corePKCS11\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\include\core_pki_utils.h">
|
||||
<Filter>corePKCS11\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Source\corePKCS11\source\dependency\3rdparty\mbedtls_utils\mbedtls_utils.h">
|
||||
<Filter>corePKCS11\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core_pkcs11_config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -0,0 +1,212 @@
|
||||
/*
|
||||
* FreeRTOS V202212.01
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file core_pkcs11_config.h
|
||||
* @brief PCKS#11 config options.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CORE_PKCS11_CONFIG_H_
|
||||
#define _CORE_PKCS11_CONFIG_H_
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
/**************************************************/
|
||||
/******* DO NOT CHANGE the following order ********/
|
||||
/**************************************************/
|
||||
|
||||
/* Include logging header files and define logging macros in the following order:
|
||||
* 1. Include the header file "logging_levels.h".
|
||||
* 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on
|
||||
* the logging configuration for PKCS #11.
|
||||
* 3. Include the header file "logging_stack.h", if logging is enabled for PKCS #11.
|
||||
*/
|
||||
|
||||
#include "logging_levels.h"
|
||||
|
||||
/* Logging configuration for the PKCS #11 library. */
|
||||
#ifndef LIBRARY_LOG_NAME
|
||||
#define LIBRARY_LOG_NAME "PKCS11"
|
||||
#endif
|
||||
|
||||
#ifndef LIBRARY_LOG_LEVEL
|
||||
#define LIBRARY_LOG_LEVEL LOG_ERROR
|
||||
#endif
|
||||
|
||||
/* Prototype for the function used to print to console on Windows simulator
|
||||
* of FreeRTOS.
|
||||
* The function prints to the console before the network is connected;
|
||||
* then a UDP port after the network has connected. */
|
||||
extern void vLoggingPrintf( const char * pcFormatString,
|
||||
... );
|
||||
|
||||
|
||||
/* Map the SdkLog macro to the logging function to enable logging
|
||||
* on Windows simulator. */
|
||||
#ifndef SdkLog
|
||||
#define SdkLog( message ) vLoggingPrintf message
|
||||
#endif
|
||||
|
||||
#include "logging_stack.h"
|
||||
|
||||
/************ End of logging configuration ****************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @brief Malloc API used by core_pkcs11.h
|
||||
*/
|
||||
#define PKCS11_MALLOC pvPortMalloc
|
||||
|
||||
/**
|
||||
* @brief Free API used by core_pkcs11.h
|
||||
*/
|
||||
#define PKCS11_FREE vPortFree
|
||||
|
||||
/**
|
||||
* @brief PKCS #11 default user PIN.
|
||||
*
|
||||
* The PKCS #11 standard specifies the presence of a user PIN. That feature is
|
||||
* sensible for applications that have an interactive user interface and memory
|
||||
* protections. However, since typical microcontroller applications lack one or
|
||||
* both of those, the user PIN is assumed to be used herein for interoperability
|
||||
* purposes only, and not as a security feature.
|
||||
*
|
||||
* Note: Do not cast this to a pointer! The library calls sizeof to get the length
|
||||
* of this string.
|
||||
*/
|
||||
#define configPKCS11_DEFAULT_USER_PIN "0000"
|
||||
|
||||
/**
|
||||
* @brief Maximum length (in characters) for a PKCS #11 CKA_LABEL
|
||||
* attribute.
|
||||
*/
|
||||
#define pkcs11configMAX_LABEL_LENGTH 32UL
|
||||
|
||||
/**
|
||||
* @brief Maximum number of token objects that can be stored
|
||||
* by the PKCS #11 module.
|
||||
*/
|
||||
#define pkcs11configMAX_NUM_OBJECTS 6UL
|
||||
|
||||
/**
|
||||
* @brief Maximum number of sessions that can be stored
|
||||
* by the PKCS #11 module.
|
||||
*/
|
||||
#define pkcs11configMAX_SESSIONS 10UL
|
||||
|
||||
/**
|
||||
* @brief Set to 1 if a PAL destroy object is implemented.
|
||||
*
|
||||
* If set to 0, no PAL destroy object is implemented, and this functionality
|
||||
* is implemented in the common PKCS #11 layer.
|
||||
*/
|
||||
#define pkcs11configPAL_DESTROY_SUPPORTED 1
|
||||
|
||||
/**
|
||||
* @brief Set to 1 if OTA image verification via PKCS #11 module is supported.
|
||||
*
|
||||
* If set to 0, OTA code signing certificate is built in via
|
||||
* aws_ota_codesigner_certificate.h.
|
||||
*/
|
||||
#define pkcs11configOTA_SUPPORTED 1
|
||||
|
||||
/**
|
||||
* @brief Set to 1 if PAL supports storage for JITP certificate,
|
||||
* code verify certificate, and trusted server root certificate.
|
||||
*
|
||||
* If set to 0, PAL does not support storage mechanism for these, and
|
||||
* they are accessed via headers compiled into the code.
|
||||
*/
|
||||
#define pkcs11configJITP_CODEVERIFY_ROOT_CERT_SUPPORTED 1
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for the object to be used for HMAC operations.
|
||||
*/
|
||||
#define pkcs11configLABEL_HMAC_KEY "HMAC Key"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for the object to be used for CMAC operations.
|
||||
*/
|
||||
#define pkcs11configLABEL_CMAC_KEY "CMAC Key"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for device private key.
|
||||
*
|
||||
* Private key for connection to AWS IoT endpoint. The corresponding
|
||||
* public key should be registered with the AWS IoT endpoint.
|
||||
*/
|
||||
#define pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS "Device Priv TLS Key"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for device public key.
|
||||
*
|
||||
* The public key corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS.
|
||||
*/
|
||||
#define pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS "Device Pub TLS Key"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for the device certificate.
|
||||
*
|
||||
* Device certificate corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS.
|
||||
*/
|
||||
#define pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS "Device Cert"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for the object to be used for code verification.
|
||||
*
|
||||
* Used by over-the-air update code to verify an incoming signed image.
|
||||
*/
|
||||
#define pkcs11configLABEL_CODE_VERIFICATION_KEY "Code Verify Key"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for the claim certificate for Fleet Provisioning.
|
||||
*/
|
||||
#define pkcs11configLABEL_CLAIM_CERTIFICATE "Claim Cert"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for the claim private key for Fleet Provisioning.
|
||||
*/
|
||||
#define pkcs11configLABEL_CLAIM_PRIVATE_KEY "Claim Key"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for Just-In-Time-Provisioning.
|
||||
*
|
||||
* The certificate corresponding to the issuer of the device certificate
|
||||
* (pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS) when using the JITR or
|
||||
* JITP flow.
|
||||
*/
|
||||
#define pkcs11configLABEL_JITP_CERTIFICATE "JITP Cert"
|
||||
|
||||
/**
|
||||
* @brief The PKCS #11 label for the AWS Trusted Root Certificate.
|
||||
*
|
||||
* @see aws_default_root_certificates.h
|
||||
*/
|
||||
#define pkcs11configLABEL_ROOT_CERTIFICATE "Root Cert"
|
||||
|
||||
#endif /* _CORE_PKCS11_CONFIG_H_ */
|
||||
Reference in New Issue
Block a user