mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-20 10:08:33 -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
|
@ -0,0 +1,15 @@
|
|||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
#
|
||||
|
||||
EXTRA_DIST += \
|
||||
mqx/ctaocrypt_test/.cproject \
|
||||
mqx/ctaocrypt_test/.project \
|
||||
mqx/ctaocrypt_test/ReferencedRSESystems.xml \
|
||||
mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE_U-MultiLink.launch \
|
||||
mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE_U-MultiLink.launch
|
||||
|
||||
EXTRA_DIST += \
|
||||
mqx/ctaocrypt_test/Sources/main.c \
|
||||
mqx/ctaocrypt_test/Sources/main.h
|
||||
|
103
FreeRTOS-Plus/Source/CyaSSL/mqx/ctaocrypt_test/Sources/main.c
Normal file
103
FreeRTOS-Plus/Source/CyaSSL/mqx/ctaocrypt_test/Sources/main.c
Normal file
|
@ -0,0 +1,103 @@
|
|||
/* main.c */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
/* SD card open/close utility functions */
|
||||
#include "util.h"
|
||||
|
||||
#if !BSPCFG_ENABLE_IO_SUBSYSTEM
|
||||
#error This application requires BSPCFG_ENABLE_IO_SUBSYSTEM defined \
|
||||
non-zero in user_config.h. Please recompile BSP with this option.
|
||||
#endif
|
||||
|
||||
#ifndef BSP_DEFAULT_IO_CHANNEL_DEFINED
|
||||
#error This application requires BSP_DEFAULT_IO_CHANNEL to be not NULL. \
|
||||
Please set corresponding BSPCFG_ENABLE_TTYx to non-zero in \
|
||||
user_config.h and recompile BSP with this option.
|
||||
#endif
|
||||
|
||||
|
||||
TASK_TEMPLATE_STRUCT MQX_template_list[] =
|
||||
{
|
||||
/* Task number, Entry point, Stack, Pri, String, Auto? */
|
||||
{MAIN_TASK, Main_task, 20000, 9, "main", MQX_AUTO_START_TASK},
|
||||
{0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
|
||||
/*TASK*-----------------------------------------------------
|
||||
*
|
||||
* Task Name : Main_task
|
||||
* Comments :
|
||||
* This task opens the SD card device and runs the
|
||||
* CTaoCrypt test functions located in test.c.
|
||||
*
|
||||
*END*-----------------------------------------------------*/
|
||||
|
||||
#if defined BSP_SDCARD_ESDHC_CHANNEL
|
||||
#if ! BSPCFG_ENABLE_ESDHC
|
||||
#error This application requires BSPCFG_ENABLE_ESDHC defined \
|
||||
non-zero in user_config.h. Please recompile libraries with \
|
||||
this option.
|
||||
#endif
|
||||
|
||||
#elif defined BSP_SDCARD_SDHC_CHANNEL
|
||||
#if ! BSPCFG_ENABLE_SDHC
|
||||
#error This application requires BSPCFG_ENABLE_SDHC defined \
|
||||
non-zero in user_config.h. Please recompile libraries with \
|
||||
this option.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (BSP_SDCARD_SPI_CHANNEL)
|
||||
#define SDCARD_COM_CHANNEL BSP_SDCARD_SPI_CHANNEL
|
||||
#elif defined (BSP_SDCARD_ESDHC_CHANNEL)
|
||||
#define SDCARD_COM_CHANNEL BSP_SDCARD_ESDHC_CHANNEL
|
||||
#elif defined (BSP_SDCARD_SDHC_CHANNEL)
|
||||
#define SDCARD_COM_CHANNEL BSP_SDCARD_SDHC_CHANNEL
|
||||
#else
|
||||
#error "SDCARD low level communication device not defined!"
|
||||
#endif
|
||||
|
||||
/* func_args from test.h */
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
} func_args;
|
||||
|
||||
void Main_task(uint_32 initial_data)
|
||||
{
|
||||
int ret = 0;
|
||||
func_args args;
|
||||
_mqx_int error_code, bytes;
|
||||
_mqx_uint sz;
|
||||
char filesystem_name[] = "a:";
|
||||
char partman_name[] = "pm:";
|
||||
MQX_FILE_PTR com_handle, sdcard_handle, filesystem_handle, partman_handle;
|
||||
MQX_FILE_PTR cert_file = NULL;
|
||||
const char* fileName = "a:\certs\\client-key.der";
|
||||
|
||||
ret = sdcard_open(&com_handle, &sdcard_handle, &partman_handle,
|
||||
&filesystem_handle, partman_name, filesystem_name);
|
||||
|
||||
if (ret != 0) {
|
||||
printf("error: sdcard_open(), ret = %d\n", ret);
|
||||
_mqx_exit(1);
|
||||
}
|
||||
printf("SD card installed to %s\n", filesystem_name);
|
||||
|
||||
ctaocrypt_test(&args);
|
||||
|
||||
ret = sdcard_close(&sdcard_handle, &partman_handle,
|
||||
&filesystem_handle, partman_name, filesystem_name);
|
||||
|
||||
if (ret != 0) {
|
||||
printf("error: sdcard_close(), ret = %d\n", ret);
|
||||
_mqx_exit(1);
|
||||
}
|
||||
printf("SD card uninstalled.\n");
|
||||
|
||||
_mqx_exit(0);
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -0,0 +1,21 @@
|
|||
/* main.h */
|
||||
|
||||
#ifndef __main_h_
|
||||
#define __main_h_
|
||||
|
||||
#include <mqx.h>
|
||||
#include <bsp.h>
|
||||
|
||||
#include <mfs.h>
|
||||
#include <fio.h>
|
||||
#include <sdcard.h>
|
||||
#include <sdcard_spi.h>
|
||||
#include <spi.h>
|
||||
#include <part_mgr.h>
|
||||
|
||||
#define MAIN_TASK 1
|
||||
|
||||
extern void Main_task(uint_32);
|
||||
|
||||
#endif /* __main_h_ */
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue