mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Update WolfSSL library to the latest version.
This commit is contained in:
parent
8af1ad9bac
commit
5a6242fbd0
443 changed files with 70230 additions and 45414 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,15 @@
|
|||
/* hash.c has unit tests
|
||||
*
|
||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -23,17 +23,17 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <cyassl/ctaocrypt/md4.h>
|
||||
#include <cyassl/ctaocrypt/md5.h>
|
||||
#include <cyassl/ctaocrypt/sha.h>
|
||||
#include <cyassl/ctaocrypt/sha256.h>
|
||||
#include <cyassl/ctaocrypt/sha512.h>
|
||||
#include <cyassl/ctaocrypt/ripemd.h>
|
||||
#include <cyassl/ctaocrypt/hmac.h>
|
||||
#include <wolfssl/wolfcrypt/md4.h>
|
||||
#include <wolfssl/wolfcrypt/md5.h>
|
||||
#include <wolfssl/wolfcrypt/sha.h>
|
||||
#include <wolfssl/wolfcrypt/sha256.h>
|
||||
#include <wolfssl/wolfcrypt/sha512.h>
|
||||
#include <wolfssl/wolfcrypt/ripemd.h>
|
||||
#include <wolfssl/wolfcrypt/hmac.h>
|
||||
|
||||
#include <tests/unit.h>
|
||||
|
||||
|
@ -94,7 +94,7 @@ int HashTest(void)
|
|||
printf( " SHA-256 test passed!\n");
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
#ifdef WOLFSSL_SHA512
|
||||
if ( (ret = sha512_test()) ) {
|
||||
printf( " SHA-512 test failed!\n");
|
||||
return ret;
|
||||
|
@ -102,7 +102,7 @@ int HashTest(void)
|
|||
printf( " SHA-512 test passed!\n");
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
if ( (ret = sha384_test()) ) {
|
||||
printf( " SHA-384 test failed!\n");
|
||||
return ret;
|
||||
|
@ -110,7 +110,7 @@ int HashTest(void)
|
|||
printf( " SHA-384 test passed!\n");
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_RIPEMD
|
||||
#ifdef WOLFSSL_RIPEMD
|
||||
if ( (ret = ripemd_test()) ) {
|
||||
printf( " RIPEMD test failed!\n");
|
||||
return ret;
|
||||
|
@ -127,10 +127,12 @@ int HashTest(void)
|
|||
printf( " HMAC-MD5 test passed!\n");
|
||||
#endif
|
||||
|
||||
#ifndef NO_SHA
|
||||
if ( (ret = hmac_sha_test()) )
|
||||
printf( " HMAC-SHA test failed!\n");
|
||||
else
|
||||
printf( " HMAC-SHA test passed!\n");
|
||||
#endif
|
||||
|
||||
#ifndef NO_SHA256
|
||||
if ( (ret = hmac_sha256_test()) )
|
||||
|
@ -139,7 +141,7 @@ int HashTest(void)
|
|||
printf( " HMAC-SHA256 test passed!\n");
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
if ( (ret = hmac_sha384_test()) )
|
||||
printf( " HMAC-SHA384 test failed!\n");
|
||||
else
|
||||
|
@ -215,11 +217,11 @@ int md4_test(void)
|
|||
test_md4[5] = f;
|
||||
test_md4[6] = g;
|
||||
|
||||
InitMd4(&md4);
|
||||
wc_InitMd4(&md4);
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
Md4Update(&md4, (byte*)test_md4[i].input, (word32)test_md4[i].inLen);
|
||||
Md4Final(&md4, hash);
|
||||
wc_Md4Update(&md4, (byte*)test_md4[i].input, (word32)test_md4[i].inLen);
|
||||
wc_Md4Final(&md4, hash);
|
||||
|
||||
if (memcmp(hash, test_md4[i].output, MD4_DIGEST_SIZE) != 0)
|
||||
return -205 - i;
|
||||
|
@ -279,11 +281,11 @@ int md5_test(void)
|
|||
test_md5[3] = d;
|
||||
test_md5[4] = e;
|
||||
|
||||
InitMd5(&md5);
|
||||
wc_InitMd5(&md5);
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
Md5Update(&md5, (byte*)test_md5[i].input, (word32)test_md5[i].inLen);
|
||||
Md5Final(&md5, hash);
|
||||
wc_Md5Update(&md5, (byte*)test_md5[i].input, (word32)test_md5[i].inLen);
|
||||
wc_Md5Final(&md5, hash);
|
||||
|
||||
if (memcmp(hash, test_md5[i].output, MD5_DIGEST_SIZE) != 0)
|
||||
return -5 - i;
|
||||
|
@ -337,13 +339,13 @@ int sha_test(void)
|
|||
test_sha[2] = c;
|
||||
test_sha[3] = d;
|
||||
|
||||
ret = InitSha(&sha);
|
||||
ret = wc_InitSha(&sha);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
ShaUpdate(&sha, (byte*)test_sha[i].input, (word32)test_sha[i].inLen);
|
||||
ShaFinal(&sha, hash);
|
||||
wc_ShaUpdate(&sha, (byte*)test_sha[i].input, (word32)test_sha[i].inLen);
|
||||
wc_ShaFinal(&sha, hash);
|
||||
|
||||
if (memcmp(hash, test_sha[i].output, SHA_DIGEST_SIZE) != 0)
|
||||
return -10 - i;
|
||||
|
@ -381,16 +383,16 @@ int sha256_test(void)
|
|||
test_sha[0] = a;
|
||||
test_sha[1] = b;
|
||||
|
||||
ret = InitSha256(&sha);
|
||||
ret = wc_InitSha256(&sha);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
ret = Sha256Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
|
||||
ret = wc_Sha256Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
ret = Sha256Final(&sha, hash);
|
||||
ret = wc_Sha256Final(&sha, hash);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
|
@ -402,7 +404,7 @@ int sha256_test(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
#ifdef WOLFSSL_SHA512
|
||||
int sha512_test(void)
|
||||
{
|
||||
Sha512 sha;
|
||||
|
@ -435,16 +437,16 @@ int sha512_test(void)
|
|||
test_sha[0] = a;
|
||||
test_sha[1] = b;
|
||||
|
||||
ret = InitSha512(&sha);
|
||||
ret = wc_InitSha512(&sha);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
ret = Sha512Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
|
||||
ret = wc_Sha512Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
ret = Sha512Final(&sha, hash);
|
||||
ret = wc_Sha512Final(&sha, hash);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
|
@ -456,7 +458,7 @@ int sha512_test(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
int sha384_test()
|
||||
{
|
||||
Sha384 sha;
|
||||
|
@ -487,16 +489,16 @@ int sha384_test()
|
|||
test_sha[0] = a;
|
||||
test_sha[1] = b;
|
||||
|
||||
ret = InitSha384(&sha);
|
||||
ret = wc_InitSha384(&sha);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
ret = Sha384Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
|
||||
ret = wc_Sha384Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
ret = Sha384Final(&sha, hash);
|
||||
ret = wc_Sha384Final(&sha, hash);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
|
@ -508,7 +510,7 @@ int sha384_test()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_RIPEMD
|
||||
#ifdef WOLFSSL_RIPEMD
|
||||
int ripemd_test(void)
|
||||
{
|
||||
RipeMd ripemd;
|
||||
|
@ -548,12 +550,12 @@ int ripemd_test(void)
|
|||
test_ripemd[2] = c;
|
||||
test_ripemd[3] = d;
|
||||
|
||||
InitRipeMd(&ripemd);
|
||||
wc_InitRipeMd(&ripemd);
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
RipeMdUpdate(&ripemd, (byte*)test_ripemd[i].input,
|
||||
wc_RipeMdUpdate(&ripemd, (byte*)test_ripemd[i].input,
|
||||
(word32)test_ripemd[i].inLen);
|
||||
RipeMdFinal(&ripemd, hash);
|
||||
wc_RipeMdFinal(&ripemd, hash);
|
||||
|
||||
if (memcmp(hash, test_ripemd[i].output, RIPEMD_DIGEST_SIZE) != 0)
|
||||
return -10 - i;
|
||||
|
@ -561,7 +563,7 @@ int ripemd_test(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CYASSL_RIPEMD */
|
||||
#endif /* WOLFSSL_RIPEMD */
|
||||
|
||||
#if !defined(NO_HMAC) && !defined(NO_MD5)
|
||||
int hmac_md5_test(void)
|
||||
|
@ -612,14 +614,14 @@ int hmac_md5_test(void)
|
|||
if (i == 1)
|
||||
continue; /* fips not allowed */
|
||||
#endif
|
||||
ret = HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
ret = wc_HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
if (ret != 0)
|
||||
return -4014;
|
||||
ret = HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
ret = wc_HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
(word32)test_hmac[i].inLen);
|
||||
if (ret != 0)
|
||||
return -4015;
|
||||
ret = HmacFinal(&hmac, hash);
|
||||
ret = wc_HmacFinal(&hmac, hash);
|
||||
if (ret != 0)
|
||||
return -4016;
|
||||
|
||||
|
@ -631,7 +633,7 @@ int hmac_md5_test(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_HMAC
|
||||
#if !defined(NO_HMAC) && !defined(NO_SHA)
|
||||
int hmac_sha_test(void)
|
||||
{
|
||||
Hmac hmac;
|
||||
|
@ -682,14 +684,14 @@ int hmac_sha_test(void)
|
|||
if (i == 1)
|
||||
continue; /* fips not allowed */
|
||||
#endif
|
||||
ret = HmacSetKey(&hmac, SHA, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
ret = wc_HmacSetKey(&hmac, SHA, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
if (ret != 0)
|
||||
return -4017;
|
||||
ret = HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
ret = wc_HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
(word32)test_hmac[i].inLen);
|
||||
if (ret != 0)
|
||||
return -4018;
|
||||
ret = HmacFinal(&hmac, hash);
|
||||
ret = wc_HmacFinal(&hmac, hash);
|
||||
if (ret != 0)
|
||||
return -4019;
|
||||
|
||||
|
@ -755,14 +757,14 @@ int hmac_sha256_test(void)
|
|||
if (i == 1)
|
||||
continue; /* fips not allowed */
|
||||
#endif
|
||||
ret = HmacSetKey(&hmac,SHA256, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
ret = wc_HmacSetKey(&hmac,SHA256, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
if (ret != 0)
|
||||
return -4020;
|
||||
ret = HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
ret = wc_HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
(word32)test_hmac[i].inLen);
|
||||
if (ret != 0)
|
||||
return -4021;
|
||||
ret = HmacFinal(&hmac, hash);
|
||||
ret = wc_HmacFinal(&hmac, hash);
|
||||
if (ret != 0)
|
||||
return -4022;
|
||||
|
||||
|
@ -775,7 +777,7 @@ int hmac_sha256_test(void)
|
|||
#endif
|
||||
|
||||
|
||||
#if !defined(NO_HMAC) && defined(CYASSL_SHA384)
|
||||
#if !defined(NO_HMAC) && defined(WOLFSSL_SHA384)
|
||||
int hmac_sha384_test(void)
|
||||
{
|
||||
Hmac hmac;
|
||||
|
@ -832,14 +834,14 @@ int hmac_sha384_test(void)
|
|||
if (i == 1)
|
||||
continue; /* fips not allowed */
|
||||
#endif
|
||||
ret = HmacSetKey(&hmac,SHA384, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
ret = wc_HmacSetKey(&hmac,SHA384, (byte*)keys[i], (word32)strlen(keys[i]));
|
||||
if (ret != 0)
|
||||
return -4023;
|
||||
ret = HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
ret = wc_HmacUpdate(&hmac, (byte*)test_hmac[i].input,
|
||||
(word32)test_hmac[i].inLen);
|
||||
if (ret != 0)
|
||||
return -4024;
|
||||
ret = HmacFinal(&hmac, hash);
|
||||
ret = wc_HmacFinal(&hmac, hash);
|
||||
if (ret != 0)
|
||||
return -4025;
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ tests_unit_test_SOURCES = \
|
|||
examples/client/client.c \
|
||||
examples/server/server.c
|
||||
tests_unit_test_CFLAGS = -DNO_MAIN_DRIVER $(AM_CFLAGS)
|
||||
tests_unit_test_LDADD = src/libcyassl.la
|
||||
tests_unit_test_DEPENDENCIES = src/libcyassl.la
|
||||
tests_unit_test_LDADD = src/libwolfssl.la
|
||||
tests_unit_test_DEPENDENCIES = src/libwolfssl.la
|
||||
endif
|
||||
EXTRA_DIST += tests/unit.h
|
||||
EXTRA_DIST += tests/test.conf \
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
/* suites.c
|
||||
*
|
||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of CyaSSL.
|
||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
*
|
||||
* CyaSSL is free software; you can redistribute it and/or modify
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* CyaSSL is distributed in the hope that it will be useful,
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
@ -23,12 +23,12 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cyassl/ssl.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <tests/unit.h>
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
|||
#include "examples/server/server.h"
|
||||
|
||||
|
||||
static CYASSL_CTX* cipherSuiteCtx = NULL;
|
||||
static WOLFSSL_CTX* cipherSuiteCtx = NULL;
|
||||
static char nonblockFlag[] = "-N";
|
||||
static char noVerifyFlag[] = "-d";
|
||||
static char portFlag[] = "-p";
|
||||
|
@ -109,7 +109,7 @@ static int IsValidCipherSuite(const char* line, char* suite)
|
|||
}
|
||||
|
||||
if (found) {
|
||||
if (CyaSSL_CTX_set_cipher_list(cipherSuiteCtx, suite) == SSL_SUCCESS)
|
||||
if (wolfSSL_CTX_set_cipher_list(cipherSuiteCtx, suite) == SSL_SUCCESS)
|
||||
valid = 1;
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,17 @@ static int execute_test_case(int svr_argc, char** svr_argv,
|
|||
int cli_argc, char** cli_argv,
|
||||
int addNoVerify, int addNonBlocking)
|
||||
{
|
||||
#ifdef WOLFSSL_TIRTOS
|
||||
func_args cliArgs = {0};
|
||||
func_args svrArgs = {0};
|
||||
cliArgs.argc = cli_argc;
|
||||
cliArgs.argv = cli_argv;
|
||||
svrArgs.argc = svr_argc;
|
||||
svrArgs.argv = svr_argv;
|
||||
#else
|
||||
func_args cliArgs = {cli_argc, cli_argv, 0, NULL, NULL};
|
||||
func_args svrArgs = {svr_argc, svr_argv, 0, NULL, NULL};
|
||||
#endif
|
||||
|
||||
tcp_ready ready;
|
||||
THREAD_TYPE serverThread;
|
||||
|
@ -183,7 +192,7 @@ static int execute_test_case(int svr_argc, char** svr_argv,
|
|||
strcat(commandLine, flagSep);
|
||||
}
|
||||
}
|
||||
#ifndef USE_WINDOWS_API
|
||||
#if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_TIRTOS)
|
||||
/* add port 0 */
|
||||
if (svr_argc + 2 > MAX_ARGS)
|
||||
printf("cannot add the magic port number flag to server\n");
|
||||
|
@ -222,11 +231,15 @@ static int execute_test_case(int svr_argc, char** svr_argv,
|
|||
|
||||
InitTcpReady(&ready);
|
||||
|
||||
#ifdef WOLFSSL_TIRTOS
|
||||
fdOpenSession(Task_self());
|
||||
#endif
|
||||
|
||||
/* start server */
|
||||
svrArgs.signal = &ready;
|
||||
start_thread(server_test, &svrArgs, &serverThread);
|
||||
wait_tcp_ready(&svrArgs);
|
||||
#ifndef USE_WINDOWS_API
|
||||
#if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_TIRTOS)
|
||||
if (ready.port != 0)
|
||||
{
|
||||
if (cli_argc + 2 > MAX_ARGS)
|
||||
|
@ -255,6 +268,9 @@ static int execute_test_case(int svr_argc, char** svr_argv,
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
#ifdef WOLFSSL_TIRTOS
|
||||
fdCloseSession(Task_self());
|
||||
#endif
|
||||
FreeTcpReady(&ready);
|
||||
|
||||
return 0;
|
||||
|
@ -412,7 +428,7 @@ int SuiteTest(void)
|
|||
|
||||
(void)test_harness;
|
||||
|
||||
cipherSuiteCtx = CyaSSL_CTX_new(CyaTLSv1_2_client_method());
|
||||
cipherSuiteCtx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
|
||||
if (cipherSuiteCtx == NULL) {
|
||||
printf("can't get cipher suite ctx\n");
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -430,7 +446,7 @@ int SuiteTest(void)
|
|||
/* any extra cases will need another argument */
|
||||
args.argc = 2;
|
||||
|
||||
#ifdef CYASSL_DTLS
|
||||
#ifdef WOLFSSL_DTLS
|
||||
/* add dtls extra suites */
|
||||
strcpy(argv0[1], "tests/test-dtls.conf");
|
||||
printf("starting dtls extra cipher suite tests\n");
|
||||
|
@ -443,7 +459,8 @@ int SuiteTest(void)
|
|||
|
||||
printf(" End Cipher Suite Tests\n");
|
||||
|
||||
CyaSSL_CTX_free(cipherSuiteCtx);
|
||||
wolfSSL_CTX_free(cipherSuiteCtx);
|
||||
wolfSSL_Cleanup();
|
||||
|
||||
return args.return_code;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,69 @@
|
|||
# server DTLSv1 DHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 2
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client DTLSv1 DHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 2
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server DTLSv1 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 2
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client DTLSv1 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 2
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server DTLSv1 ECDHE-EDCSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 2
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-c ./certs/server-ecc.pem
|
||||
-k ./certs/ecc-key.pem
|
||||
|
||||
# client DTLSv1 ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 2
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-A ./certs/server-ecc.pem
|
||||
|
||||
# server DTLSv1.2 DHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 3
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client DTLSv1.2 DHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 3
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server DTLSv1.2 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 3
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client DTLSv1.2 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 3
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server DTLSv1.2 ECDHE-EDCSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 3
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-c ./certs/server-ecc.pem
|
||||
-k ./certs/ecc-key.pem
|
||||
|
||||
# client DTLSv1.2 ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-u
|
||||
-v 3
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-A ./certs/server-ecc.pem
|
||||
|
||||
# server DTLSv1 RC4-SHA
|
||||
-u
|
||||
-v 2
|
||||
|
@ -816,3 +882,27 @@
|
|||
-l ECDHE-ECDSA-AES256-CCM-8
|
||||
-A ./certs/server-ecc.pem
|
||||
|
||||
# server DTLSv1.2 ADH-AES128-SHA
|
||||
-u
|
||||
-a
|
||||
-v 3
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# client DTLSv1.2 ADH-AES128-SHA
|
||||
-u
|
||||
-a
|
||||
-v 3
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# server DTLSv1.0 ADH-AES128-SHA
|
||||
-u
|
||||
-a
|
||||
-v 2
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# client DTLSv1.0 ADH-AES128-SHA
|
||||
-u
|
||||
-a
|
||||
-v 2
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
|
|
|
@ -1,3 +1,84 @@
|
|||
# server TLSv1 DHE-RSA-CHACHA20-POLY1305
|
||||
-v 1
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client TLSv1 DHE-RSA-CHACHA20-POLY1305
|
||||
-v 1
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server TLSv1 ECDHE-EDCSA-CHACHA20-POLY1305
|
||||
-v 1
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-c ./certs/server-ecc.pem
|
||||
-k ./certs/ecc-key.pem
|
||||
|
||||
# client TLSv1 ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-v 1
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-A ./certs/server-ecc.pem
|
||||
|
||||
# server TLSv1 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-v 1
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client TLSv1 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-v 1
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server TLSv1.1 DHE-RSA-CHACHA20-POLY1305
|
||||
-v 2
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client TLSv1.1 DHE-RSA-CHACHA20-POLY1305
|
||||
-v 2
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server TLSv1.1 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-v 2
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client TLSv1.1 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-v 2
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server TLSv1.1 ECDHE-EDCSA-CHACHA20-POLY1305
|
||||
-v 2
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-c ./certs/server-ecc.pem
|
||||
-k ./certs/ecc-key.pem
|
||||
|
||||
# client TLSv1.1 ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-v 2
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-A ./certs/server-ecc.pem
|
||||
|
||||
# server TLSv1.2 DHE-RSA-CHACHA20-POLY1305
|
||||
-v 3
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client TLSv1.2 DHE-RSA-CHACHA20-POLY1305
|
||||
-v 3
|
||||
-l DHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server TLSv1.2 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-v 3
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# client TLSv1.2 ECDHE-RSA-CHACHA20-POLY1305
|
||||
-v 3
|
||||
-l ECDHE-RSA-CHACHA20-POLY1305
|
||||
|
||||
# server TLSv1.2 ECDHE-EDCSA-CHACHA20-POLY1305
|
||||
-v 3
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-c ./certs/server-ecc.pem
|
||||
-k ./certs/ecc-key.pem
|
||||
|
||||
# client TLSv1.2 ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-v 3
|
||||
-l ECDHE-ECDSA-CHACHA20-POLY1305
|
||||
-A ./certs/server-ecc.pem
|
||||
|
||||
# server SSLv3 RC4-SHA
|
||||
-v 0
|
||||
-l RC4-SHA
|
||||
|
@ -1922,3 +2003,33 @@
|
|||
-v 3
|
||||
-l DHE-PSK-AES256-CCM
|
||||
|
||||
# server TLSv1.2 ADH-AES128-SHA
|
||||
-a
|
||||
-v 3
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# client TLSv1.2 ADH-AES128-SHA
|
||||
-a
|
||||
-v 3
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# server TLSv1.1 ADH-AES128-SHA
|
||||
-a
|
||||
-v 2
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# client TLSv1.1 ADH-AES128-SHA
|
||||
-a
|
||||
-v 2
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# server TLSv1.0 ADH-AES128-SHA
|
||||
-a
|
||||
-v 1
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
# client TLSv1.0 ADH-AES128-SHA
|
||||
-a
|
||||
-v 1
|
||||
-l ADH-AES128-SHA
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/* unit.c unit tests driver */
|
||||
|
||||
/* Name change compatibility layer no longer need to be included here */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <tests/unit.h>
|
||||
|
@ -11,9 +14,16 @@
|
|||
|
||||
int myoptind = 0;
|
||||
char* myoptarg = NULL;
|
||||
int unit_test(int argc, char** argv);
|
||||
|
||||
|
||||
#ifndef NO_TESTSUITE_MAIN_DRIVER
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return unit_test(argc, argv);
|
||||
}
|
||||
#endif
|
||||
|
||||
int unit_test(int argc, char** argv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -27,15 +37,14 @@ int main(int argc, char** argv)
|
|||
err_sys("Cavium OpenNitroxDevice failed");
|
||||
#endif /* HAVE_CAVIUM */
|
||||
|
||||
#ifndef WOLFSSL_TIRTOS
|
||||
if (CurrentDir("tests") || CurrentDir("_build"))
|
||||
ChangeDirBack(1);
|
||||
else if (CurrentDir("Debug") || CurrentDir("Release"))
|
||||
ChangeDirBack(3);
|
||||
#endif
|
||||
|
||||
if ( (ret = ApiTest()) != 0) {
|
||||
printf("api test failed with %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
ApiTest();
|
||||
|
||||
if ( (ret = HashTest()) != 0){
|
||||
printf("hash test failed with %d\n", ret);
|
||||
|
@ -85,6 +94,17 @@ void start_thread(THREAD_FUNC fun, func_args* args, THREAD_TYPE* thread)
|
|||
#elif defined(_POSIX_THREADS) && !defined(__MINGW32__)
|
||||
pthread_create(thread, 0, fun, args);
|
||||
return;
|
||||
#elif defined (WOLFSSL_TIRTOS)
|
||||
/* Initialize the defaults and set the parameters. */
|
||||
Task_Params taskParams;
|
||||
Task_Params_init(&taskParams);
|
||||
taskParams.arg0 = (UArg)args;
|
||||
taskParams.stackSize = 65535;
|
||||
*thread = Task_create((Task_FuncPtr)fun, &taskParams, NULL);
|
||||
if (*thread == NULL) {
|
||||
printf("Failed to create new Task\n");
|
||||
}
|
||||
Task_yield();
|
||||
#else
|
||||
*thread = (THREAD_TYPE)_beginthreadex(0, 0, fun, args, 0, 0);
|
||||
#endif
|
||||
|
@ -97,6 +117,14 @@ void join_thread(THREAD_TYPE thread)
|
|||
(void)thread;
|
||||
#elif defined(_POSIX_THREADS) && !defined(__MINGW32__)
|
||||
pthread_join(thread, 0);
|
||||
#elif defined (WOLFSSL_TIRTOS)
|
||||
while(1) {
|
||||
if (Task_getMode(thread) == Task_Mode_TERMINATED) {
|
||||
Task_sleep(5);
|
||||
break;
|
||||
}
|
||||
Task_yield();
|
||||
}
|
||||
#else
|
||||
int res = WaitForSingleObject((HANDLE)thread, INFINITE);
|
||||
assert(res == WAIT_OBJECT_0);
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
#ifndef CyaSSL_UNIT_H
|
||||
#define CyaSSL_UNIT_H
|
||||
|
||||
#include <cyassl/test.h> /* thread and tcp stuff */
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <wolfssl/test.h> /* thread and tcp stuff */
|
||||
|
||||
#define Fail(description, result) do { \
|
||||
printf("\nERROR - %s line %d failed with:", __FILE__, __LINE__); \
|
||||
|
@ -55,7 +56,7 @@
|
|||
#define AssertStrLE(x, y) AssertStr(x, y, <=, >)
|
||||
|
||||
|
||||
int ApiTest(void);
|
||||
void ApiTest(void);
|
||||
int SuiteTest(void);
|
||||
int HashTest(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue