Eliminate testing of secure string library code
Test project is no longer needed, since the associated library is now scheduled for removal. Change-Id: I843018e647c4bdc82c785ae21dbfa9de608c0d50 Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
parent
4994fadc9d
commit
4b105f459d
7 changed files with 0 additions and 231 deletions
|
@ -1,6 +0,0 @@
|
|||
BSP ?= generic_pc
|
||||
VPFILE = prj.vpf
|
||||
KERNEL_TYPE = micro
|
||||
CONF_FILE = prj_$(ARCH).conf
|
||||
|
||||
include ${TIMO_BASE}/Makefile.inc
|
|
@ -1,36 +0,0 @@
|
|||
Title: test_secure_string_api
|
||||
|
||||
Desription:
|
||||
|
||||
This test verifies that the microkernel secure string APIs operate as expected.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Building and Running Project:
|
||||
|
||||
This microkernel project outputs to the console. It can be built and executed
|
||||
on QEMU as follows:
|
||||
|
||||
make pristine
|
||||
make microkernel.qemu
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Sample Output:
|
||||
|
||||
**** Invalid string operation! ****
|
||||
Current context ID = 0x0010583c
|
||||
Faulting instruction address = 0xdeaddead
|
||||
Fatal task error! Aborting task.
|
||||
**** Invalid string operation! ****
|
||||
Current context ID = 0x0010563c
|
||||
Faulting instruction address = 0xdeaddead
|
||||
Fatal task error! Aborting task.
|
||||
As expected, test task 1 did not continue operating
|
||||
after calling memcpy_s with incorrect parameters
|
||||
As expected, test task 2 did not continue operating
|
||||
after calling strcpy_s with incorrect parameters
|
||||
===================================================================
|
||||
PASS - MainTask.
|
||||
===================================================================
|
||||
VXMICRO PROJECT EXECUTION SUCCESSFUL
|
|
@ -1,17 +0,0 @@
|
|||
% Application : test secure string API
|
||||
|
||||
% Warning: Saving a VxMicro project file (.vpf) with the
|
||||
% VxMicro Project Manager (VPM) tool will result in any
|
||||
% manually entered comments being removed, along with
|
||||
% any format changes being undone.
|
||||
|
||||
% TASK NAME PRIO ENTRY STACK GROUPS
|
||||
% ===================================================
|
||||
TASK tStartTask 5 MainTask 512 [EXE]
|
||||
TASK tTask1 5 MemcpyTask 512 [EXE]
|
||||
TASK tTask2 5 StrcpyTask 512 [EXE]
|
||||
|
||||
% SEMA NAME
|
||||
% ==========
|
||||
SEMA SEMA1
|
||||
SEMA SEMA2
|
|
@ -1,8 +0,0 @@
|
|||
CONFIG_ENHANCED_SECURITY=y
|
||||
CONFIG_CUSTOM_SECURITY=y
|
||||
CONFIG_STACK_CANARIES=n
|
||||
|
||||
# Let stack canaries use non-random number generator.
|
||||
# This option is NOT to be used in production code.
|
||||
CONFIG_DRV_RANDOM=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
|
@ -1,4 +0,0 @@
|
|||
# Let stack canaries use non-random number generator.
|
||||
# This option is NOT to be used in production code.
|
||||
CONFIG_DRV_RANDOM=y
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
|
@ -1,158 +0,0 @@
|
|||
/* secure.c - test microkernel secure API under VxMicro */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1) Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2) Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3) Neither the name of Wind River Systems nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
This modules tests the following secure routines:
|
||||
strcpy_s, strlen_s, k_memcpy_s
|
||||
*/
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <vxmicro.h>
|
||||
#include <tc_util.h>
|
||||
#include <string_s.h>
|
||||
|
||||
/* timeout to wait for the task to start */
|
||||
#define WAIT_TOUT (sys_clock_ticks_per_sec)
|
||||
|
||||
/* default buffer size */
|
||||
#define BUFSIZE 10
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MainTask - the main test task
|
||||
*
|
||||
* Starts testing tasks and checks their statuses
|
||||
*
|
||||
* RETURNS: N/A
|
||||
*/
|
||||
|
||||
void MainTask(void)
|
||||
{
|
||||
int result;
|
||||
/* wait for the first task to start */
|
||||
result = task_sem_take_wait_timeout(SEMA1, WAIT_TOUT);
|
||||
if (result != RC_OK) {
|
||||
TC_ERROR("Test task 1 did not start properly\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* now we check the first task to perform the test and die */
|
||||
result = task_sem_take_wait_timeout(SEMA1, WAIT_TOUT);
|
||||
if (result == RC_TIME) {
|
||||
TC_PRINT("As expected, test task 1 did not continue operating\n");
|
||||
TC_PRINT("after calling memcpy_s with incorrect parameters\n");
|
||||
} else {
|
||||
TC_ERROR("Test task 1 unexpectedly continued\n"
|
||||
"after calling memcpy_s with incorrect parameters\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* wait for the second task to start */
|
||||
result = task_sem_take_wait_timeout(SEMA2, WAIT_TOUT);
|
||||
if (result != RC_OK) {
|
||||
TC_ERROR("Test task 2 did not start properly\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* now we check the second task to perform the test and die */
|
||||
result = task_sem_take_wait_timeout(SEMA2, WAIT_TOUT);
|
||||
if (result == RC_TIME) {
|
||||
TC_PRINT("As expected, test task 2 did not continue operating\n");
|
||||
TC_PRINT("after calling strcpy_s with incorrect parameters\n");
|
||||
} else {
|
||||
TC_ERROR("Test task 2 unexpectedly continued\n"
|
||||
"after calling memcpy_s with incorrect parameters\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
TC_END_RESULT(TC_PASS);
|
||||
TC_END_REPORT(TC_PASS);
|
||||
return;
|
||||
|
||||
fail:
|
||||
TC_END_RESULT(TC_FAIL);
|
||||
TC_END_REPORT(TC_FAIL);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MemcpyTask - k_memcpy_s test task
|
||||
*
|
||||
* Task tests k_memcpy_s function
|
||||
*
|
||||
* RETURNS: N/A
|
||||
*/
|
||||
void MemcpyTask(void)
|
||||
{
|
||||
uint8_t buf1[BUFSIZE];
|
||||
uint8_t buf2[BUFSIZE + 1];
|
||||
|
||||
/* do correct memory copy */
|
||||
k_memcpy_s(buf2, sizeof(buf2), buf1, sizeof(buf1));
|
||||
task_sem_give(SEMA1);
|
||||
task_yield();
|
||||
|
||||
/* do incorrect memory copy */
|
||||
k_memcpy_s(buf1, sizeof(buf1), buf2, sizeof(buf2));
|
||||
task_sem_give(SEMA1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* StrcpyTask - strcpy_s test task
|
||||
*
|
||||
* Task tests strcpy_s function
|
||||
*
|
||||
* RETURNS: N/A
|
||||
*/
|
||||
void StrcpyTask(void)
|
||||
{
|
||||
char buf1[BUFSIZE];
|
||||
char buf2[BUFSIZE] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', 0 };
|
||||
|
||||
/* do correct string copy */
|
||||
strcpy_s(buf1, sizeof(buf1), buf2);
|
||||
task_sem_give(SEMA2);
|
||||
task_yield();
|
||||
|
||||
/*
|
||||
* Make the string not \0 terminated as a result
|
||||
* strcpy_s has to make an error
|
||||
*/
|
||||
buf2[BUFSIZE - 1] = '0';
|
||||
|
||||
/* do incorrect string copy */
|
||||
strcpy_s(buf1, sizeof(buf1), buf2);
|
||||
task_sem_give(SEMA2);
|
||||
}
|
|
@ -117,7 +117,6 @@ microkernel/test/test_map <uq> ti_lm3s6965! fsl_frdm_k64f \n\
|
|||
microkernel/test/test_pool <uq> ti_lm3s6965! fsl_frdm_k64f \n\
|
||||
microkernel/test/test_mutex <uq> ti_lm3s6965! fsl_frdm_k64f \n\
|
||||
microkernel/test/test_rand32 <uq> ti_lm3s6965! fsl_frdm_k64f \n\
|
||||
microkernel/test/test_secure_string_api <u> ti_lm3s6965! fsl_frdm_k64f \n\
|
||||
microkernel/test/test_sema <uq> ti_lm3s6965! fsl_frdm_k64f \n\
|
||||
microkernel/test/test_sprintf <u> ti_lm3s6965! fsl_frdm_k64f \n\
|
||||
microkernel/test/test_task <uq> ti_lm3s6965! fsl_frdm_k64f \n\
|
||||
|
@ -135,7 +134,6 @@ microkernel/test/test_pipe <uq> minuteia! pentium4! atom quark \n\
|
|||
microkernel/test/test_pool <uq> minuteia! pentium4! atom quark \n\
|
||||
microkernel/test/test_mutex <uq> minuteia! pentium4! atom quark \n\
|
||||
microkernel/test/test_rand32 <uq> minuteia! pentium4! atom quark \n\
|
||||
microkernel/test/test_secure_string_api <u> pentium4! minuteia! atom quark \n\
|
||||
microkernel/test/test_sema <uq> pentium4! minuteia! atom quark \n\
|
||||
microkernel/test/test_sprintf <u> pentium4! minuteia! atom quark \n\
|
||||
microkernel/test/test_static_idt <uq> pentium4! minuteia! atom quark \n\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue