remove old files
This commit is contained in:
5
externals/mbedtls/ChangeLog.d/drbg-mutex.txt
vendored
5
externals/mbedtls/ChangeLog.d/drbg-mutex.txt
vendored
@@ -1,5 +0,0 @@
|
||||
Bugfix
|
||||
* Fix a resource leak in CTR_DRBG and HMAC_DRBG when MBEDTLS_THREADING_C
|
||||
is enabled, on platforms where initializing a mutex allocates resources.
|
||||
This was a regression introduced in the previous release. Reported in
|
||||
#4017, #4045 and #4071.
|
7
externals/mbedtls/ChangeLog.d/issue4093.txt
vendored
7
externals/mbedtls/ChangeLog.d/issue4093.txt
vendored
@@ -1,7 +0,0 @@
|
||||
Security
|
||||
* Fix an errorneous estimation for an internal buffer in
|
||||
mbedtls_pk_write_key_pem(). If MBEDTLS_MPI_MAX_SIZE is set to an odd
|
||||
value the function might fail to write a private RSA keys of the largest
|
||||
supported size.
|
||||
Found by Daniel Otte, reported in #4093 and fixed in #4094,
|
||||
backported in #4100.
|
@@ -1,7 +0,0 @@
|
||||
Security
|
||||
* Fix a buffer overflow in mbedtls_mpi_sub_abs() when calculating
|
||||
|A| - |B| where |B| is larger than |A| and has more limbs (so the
|
||||
function should return MBEDTLS_ERR_MPI_NEGATIVE_VALUE). Only
|
||||
applications calling mbedtls_mpi_sub_abs() directly are affected:
|
||||
all calls inside the library were safe since this function is
|
||||
only called with |A| >= |B|. Reported by Guido Vranken in #4042.
|
@@ -1,4 +0,0 @@
|
||||
Security
|
||||
* Fix a stack buffer overflow with mbedtls_net_poll() and
|
||||
mbedtls_net_recv_timeout() when given a file descriptor that is
|
||||
beyond FD_SETSIZE. Reported by FigBug in #4169.
|
13
externals/mbedtls/ChangeLog.d/rsa-mutex.txt
vendored
13
externals/mbedtls/ChangeLog.d/rsa-mutex.txt
vendored
@@ -1,13 +0,0 @@
|
||||
Bugfix
|
||||
* Ensure that calling mbedtls_rsa_free() or mbedtls_entropy_free()
|
||||
twice is safe. This happens for RSA when some Mbed TLS library functions
|
||||
fail. Such a double-free was not safe when MBEDTLS_THREADING_C was
|
||||
enabled on platforms where freeing a mutex twice is not safe.
|
||||
* Fix a resource leak in a bad-arguments case of mbedtls_rsa_gen_key()
|
||||
when MBEDTLS_THREADING_C is enabled on platforms where initializing
|
||||
a mutex allocates resources.
|
||||
|
||||
Default behavior changes
|
||||
* In mbedtls_rsa_context objects, the ver field was formerly documented
|
||||
as always 0. It is now reserved for internal purposes and may take
|
||||
different values.
|
@@ -1,2 +0,0 @@
|
||||
Bugfix
|
||||
* Fix an incorrect error code if an RSA private operation glitched.
|
44
externals/mbedtls/circle.yml
vendored
44
externals/mbedtls/circle.yml
vendored
@@ -1,44 +0,0 @@
|
||||
# Purpose:
|
||||
# - To test and prove that a new commit in the mbed TLS repository builds
|
||||
# and integrates with mbed-os properly.
|
||||
# AND
|
||||
# - To test and prove that the current development head of mbed TLS builds
|
||||
# and integrates with the current mbed-os master branch.
|
||||
#
|
||||
# The script fetches all the prerequisites and builds the mbed TLS 'tls-client'
|
||||
# example. This script is triggered by every commit and once each night and the
|
||||
# exact behaviour depends on how it was triggered:
|
||||
# - If it is a nightly build then it builds the mbed TLS development head with
|
||||
# mbed-os master.
|
||||
# - If it was triggered by the commit, then it builds the example with mbed TLS
|
||||
# at that commit and mbed-os at the commit pointed by mbed-os.lib in the
|
||||
# example repository.
|
||||
|
||||
test:
|
||||
override:
|
||||
- cd ../mbed-os-example-tls/tls-client/ && mbed compile -m K64F -t GCC_ARM -c
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
# Install gcc-arm
|
||||
- cd .. && wget "https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2"
|
||||
- cd .. && tar -xvjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
|
||||
- ln -s ../gcc-arm-none-eabi-4_9-2015q3/bin/* ../bin/
|
||||
# Install mbed-cli
|
||||
- cd ../ && git clone https://github.com/ARMmbed/mbed-cli.git
|
||||
- cd ../mbed-cli && sudo -H pip install -e .
|
||||
# Get the sample application
|
||||
- cd ../ && git clone git@github.com:ARMmbed/mbed-os-example-tls.git
|
||||
# Get mbed-os
|
||||
- cd ../mbed-os-example-tls/tls-client && mbed deploy
|
||||
# Update mbed-os to master only if it is a nightly build
|
||||
- >
|
||||
if [ -n "${RUN_NIGHTLY_BUILD}" ]; then
|
||||
cd ../mbed-os-example-tls/tls-client/mbed-os/ && mbed update master;
|
||||
fi
|
||||
# Import mbedtls current revision
|
||||
- ln -s ../../../../../../../mbedtls/ ../mbed-os-example-tls/tls-client/mbed-os/features/mbedtls/importer/TARGET_IGNORE/mbedtls
|
||||
- cd ../mbed-os-example-tls/tls-client/mbed-os/features/mbedtls/importer/ && make
|
||||
override:
|
||||
# Install the missing python packages
|
||||
- cd ../mbed-os-example-tls/tls-client/mbed-os/ && sudo -H pip install -r requirements.txt
|
495
externals/mbedtls/programs/aes/aescrypt2.c
vendored
495
externals/mbedtls/programs/aes/aescrypt2.c
vendored
@@ -1,495 +0,0 @@
|
||||
/*
|
||||
* AES-256 file encryption program
|
||||
*
|
||||
* Copyright The Mbed TLS Contributors
|
||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||
*
|
||||
* This file is provided under the Apache License 2.0, or the
|
||||
* GNU General Public License v2.0 or later.
|
||||
*
|
||||
* **********
|
||||
* Apache License 2.0:
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* **********
|
||||
*
|
||||
* **********
|
||||
* GNU General Public License v2.0 or later:
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* 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.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* **********
|
||||
*/
|
||||
|
||||
/* Enable definition of fileno() even when compiling with -std=c99. Must be
|
||||
* set before config.h, which pulls in glibc's features.h indirectly.
|
||||
* Harmless on other platforms. */
|
||||
#define _POSIX_C_SOURCE 1
|
||||
|
||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||
#include "mbedtls/config.h"
|
||||
#else
|
||||
#include MBEDTLS_CONFIG_FILE
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
#include "mbedtls/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define mbedtls_fprintf fprintf
|
||||
#define mbedtls_printf printf
|
||||
#define mbedtls_exit exit
|
||||
#define MBEDTLS_EXIT_SUCCESS EXIT_SUCCESS
|
||||
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
|
||||
#endif /* MBEDTLS_PLATFORM_C */
|
||||
|
||||
#include "mbedtls/aes.h"
|
||||
#include "mbedtls/md.h"
|
||||
#include "mbedtls/platform_util.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#if !defined(_WIN32_WCE)
|
||||
#include <io.h>
|
||||
#endif
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define MODE_ENCRYPT 0
|
||||
#define MODE_DECRYPT 1
|
||||
|
||||
#define USAGE \
|
||||
"\n aescrypt2 <mode> <input filename> <output filename> <key>\n" \
|
||||
"\n <mode>: 0 = encrypt, 1 = decrypt\n" \
|
||||
"\n example: aescrypt2 0 file file.aes hex:E76B2413958B00E193\n" \
|
||||
"\n"
|
||||
|
||||
#if !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_SHA256_C) || \
|
||||
!defined(MBEDTLS_FS_IO) || !defined(MBEDTLS_MD_C)
|
||||
int main( void )
|
||||
{
|
||||
mbedtls_printf("MBEDTLS_AES_C and/or MBEDTLS_SHA256_C "
|
||||
"and/or MBEDTLS_FS_IO and/or MBEDTLS_MD_C "
|
||||
"not defined.\n");
|
||||
mbedtls_exit( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
int ret = 0;
|
||||
int exit_code = MBEDTLS_EXIT_FAILURE;
|
||||
|
||||
unsigned int i, n;
|
||||
int mode, lastn;
|
||||
size_t keylen;
|
||||
FILE *fkey, *fin = NULL, *fout = NULL;
|
||||
|
||||
char *p;
|
||||
|
||||
unsigned char IV[16];
|
||||
unsigned char tmp[16];
|
||||
unsigned char key[512];
|
||||
unsigned char digest[32];
|
||||
unsigned char buffer[1024];
|
||||
unsigned char diff;
|
||||
|
||||
mbedtls_aes_context aes_ctx;
|
||||
mbedtls_md_context_t sha_ctx;
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
long filesize, offset;
|
||||
#elif defined(_WIN32)
|
||||
LARGE_INTEGER li_size;
|
||||
__int64 filesize, offset;
|
||||
#else
|
||||
off_t filesize, offset;
|
||||
#endif
|
||||
|
||||
mbedtls_aes_init( &aes_ctx );
|
||||
mbedtls_md_init( &sha_ctx );
|
||||
|
||||
ret = mbedtls_md_setup( &sha_ctx, mbedtls_md_info_from_type( MBEDTLS_MD_SHA256 ), 1 );
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " ! mbedtls_md_setup() returned -0x%04x\n", -ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the command-line arguments.
|
||||
*/
|
||||
if( argc != 5 )
|
||||
{
|
||||
mbedtls_printf( USAGE );
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf( "\n Press Enter to exit this program.\n" );
|
||||
fflush( stdout ); getchar();
|
||||
#endif
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mode = atoi( argv[1] );
|
||||
memset( IV, 0, sizeof( IV ) );
|
||||
memset( key, 0, sizeof( key ) );
|
||||
memset( digest, 0, sizeof( digest ) );
|
||||
memset( buffer, 0, sizeof( buffer ) );
|
||||
|
||||
if( mode != MODE_ENCRYPT && mode != MODE_DECRYPT )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "invalide operation mode\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( strcmp( argv[2], argv[3] ) == 0 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "input and output filenames must differ\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( ( fin = fopen( argv[2], "rb" ) ) == NULL )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fopen(%s,rb) failed\n", argv[2] );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( ( fout = fopen( argv[3], "wb+" ) ) == NULL )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fopen(%s,wb+) failed\n", argv[3] );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the secret key from file or command line
|
||||
*/
|
||||
if( ( fkey = fopen( argv[4], "rb" ) ) != NULL )
|
||||
{
|
||||
keylen = fread( key, 1, sizeof( key ), fkey );
|
||||
fclose( fkey );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( memcmp( argv[4], "hex:", 4 ) == 0 )
|
||||
{
|
||||
p = &argv[4][4];
|
||||
keylen = 0;
|
||||
|
||||
while( sscanf( p, "%02X", &n ) > 0 &&
|
||||
keylen < (int) sizeof( key ) )
|
||||
{
|
||||
key[keylen++] = (unsigned char) n;
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
keylen = strlen( argv[4] );
|
||||
|
||||
if( keylen > (int) sizeof( key ) )
|
||||
keylen = (int) sizeof( key );
|
||||
|
||||
memcpy( key, argv[4], keylen );
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
filesize = fseek( fin, 0L, SEEK_END );
|
||||
#else
|
||||
#if defined(_WIN32)
|
||||
/*
|
||||
* Support large files (> 2Gb) on Win32
|
||||
*/
|
||||
li_size.QuadPart = 0;
|
||||
li_size.LowPart =
|
||||
SetFilePointer( (HANDLE) _get_osfhandle( _fileno( fin ) ),
|
||||
li_size.LowPart, &li_size.HighPart, FILE_END );
|
||||
|
||||
if( li_size.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "SetFilePointer(0,FILE_END) failed\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
filesize = li_size.QuadPart;
|
||||
#else
|
||||
if( ( filesize = lseek( fileno( fin ), 0, SEEK_END ) ) < 0 )
|
||||
{
|
||||
perror( "lseek" );
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if( fseek( fin, 0, SEEK_SET ) < 0 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fseek(0,SEEK_SET) failed\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( mode == MODE_ENCRYPT )
|
||||
{
|
||||
/*
|
||||
* Generate the initialization vector as:
|
||||
* IV = SHA-256( filesize || filename )[0..15]
|
||||
*/
|
||||
for( i = 0; i < 8; i++ )
|
||||
buffer[i] = (unsigned char)( filesize >> ( i << 3 ) );
|
||||
|
||||
p = argv[2];
|
||||
|
||||
mbedtls_md_starts( &sha_ctx );
|
||||
mbedtls_md_update( &sha_ctx, buffer, 8 );
|
||||
mbedtls_md_update( &sha_ctx, (unsigned char *) p, strlen( p ) );
|
||||
mbedtls_md_finish( &sha_ctx, digest );
|
||||
|
||||
memcpy( IV, digest, 16 );
|
||||
|
||||
/*
|
||||
* The last four bits in the IV are actually used
|
||||
* to store the file size modulo the AES block size.
|
||||
*/
|
||||
lastn = (int)( filesize & 0x0F );
|
||||
|
||||
IV[15] = (unsigned char)
|
||||
( ( IV[15] & 0xF0 ) | lastn );
|
||||
|
||||
/*
|
||||
* Append the IV at the beginning of the output.
|
||||
*/
|
||||
if( fwrite( IV, 1, 16, fout ) != 16 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", 16 );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash the IV and the secret key together 8192 times
|
||||
* using the result to setup the AES context and HMAC.
|
||||
*/
|
||||
memset( digest, 0, 32 );
|
||||
memcpy( digest, IV, 16 );
|
||||
|
||||
for( i = 0; i < 8192; i++ )
|
||||
{
|
||||
mbedtls_md_starts( &sha_ctx );
|
||||
mbedtls_md_update( &sha_ctx, digest, 32 );
|
||||
mbedtls_md_update( &sha_ctx, key, keylen );
|
||||
mbedtls_md_finish( &sha_ctx, digest );
|
||||
}
|
||||
|
||||
mbedtls_aes_setkey_enc( &aes_ctx, digest, 256 );
|
||||
mbedtls_md_hmac_starts( &sha_ctx, digest, 32 );
|
||||
|
||||
/*
|
||||
* Encrypt and write the ciphertext.
|
||||
*/
|
||||
for( offset = 0; offset < filesize; offset += 16 )
|
||||
{
|
||||
n = ( filesize - offset > 16 ) ? 16 : (int)
|
||||
( filesize - offset );
|
||||
|
||||
if( fread( buffer, 1, n, fin ) != (size_t) n )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fread(%d bytes) failed\n", n );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
buffer[i] = (unsigned char)( buffer[i] ^ IV[i] );
|
||||
|
||||
mbedtls_aes_crypt_ecb( &aes_ctx, MBEDTLS_AES_ENCRYPT, buffer, buffer );
|
||||
mbedtls_md_hmac_update( &sha_ctx, buffer, 16 );
|
||||
|
||||
if( fwrite( buffer, 1, 16, fout ) != 16 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", 16 );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memcpy( IV, buffer, 16 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally write the HMAC.
|
||||
*/
|
||||
mbedtls_md_hmac_finish( &sha_ctx, digest );
|
||||
|
||||
if( fwrite( digest, 1, 32, fout ) != 32 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", 16 );
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if( mode == MODE_DECRYPT )
|
||||
{
|
||||
/*
|
||||
* The encrypted file must be structured as follows:
|
||||
*
|
||||
* 00 .. 15 Initialization Vector
|
||||
* 16 .. 31 AES Encrypted Block #1
|
||||
* ..
|
||||
* N*16 .. (N+1)*16 - 1 AES Encrypted Block #N
|
||||
* (N+1)*16 .. (N+1)*16 + 32 HMAC-SHA-256(ciphertext)
|
||||
*/
|
||||
if( filesize < 48 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "File too short to be encrypted.\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( ( filesize & 0x0F ) != 0 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "File size not a multiple of 16.\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Subtract the IV + HMAC length.
|
||||
*/
|
||||
filesize -= ( 16 + 32 );
|
||||
|
||||
/*
|
||||
* Read the IV and original filesize modulo 16.
|
||||
*/
|
||||
if( fread( buffer, 1, 16, fin ) != 16 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fread(%d bytes) failed\n", 16 );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memcpy( IV, buffer, 16 );
|
||||
lastn = IV[15] & 0x0F;
|
||||
|
||||
/*
|
||||
* Hash the IV and the secret key together 8192 times
|
||||
* using the result to setup the AES context and HMAC.
|
||||
*/
|
||||
memset( digest, 0, 32 );
|
||||
memcpy( digest, IV, 16 );
|
||||
|
||||
for( i = 0; i < 8192; i++ )
|
||||
{
|
||||
mbedtls_md_starts( &sha_ctx );
|
||||
mbedtls_md_update( &sha_ctx, digest, 32 );
|
||||
mbedtls_md_update( &sha_ctx, key, keylen );
|
||||
mbedtls_md_finish( &sha_ctx, digest );
|
||||
}
|
||||
|
||||
mbedtls_aes_setkey_dec( &aes_ctx, digest, 256 );
|
||||
mbedtls_md_hmac_starts( &sha_ctx, digest, 32 );
|
||||
|
||||
/*
|
||||
* Decrypt and write the plaintext.
|
||||
*/
|
||||
for( offset = 0; offset < filesize; offset += 16 )
|
||||
{
|
||||
if( fread( buffer, 1, 16, fin ) != 16 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fread(%d bytes) failed\n", 16 );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memcpy( tmp, buffer, 16 );
|
||||
|
||||
mbedtls_md_hmac_update( &sha_ctx, buffer, 16 );
|
||||
mbedtls_aes_crypt_ecb( &aes_ctx, MBEDTLS_AES_DECRYPT, buffer, buffer );
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
buffer[i] = (unsigned char)( buffer[i] ^ IV[i] );
|
||||
|
||||
memcpy( IV, tmp, 16 );
|
||||
|
||||
n = ( lastn > 0 && offset == filesize - 16 )
|
||||
? lastn : 16;
|
||||
|
||||
if( fwrite( buffer, 1, n, fout ) != (size_t) n )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fwrite(%d bytes) failed\n", n );
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify the message authentication code.
|
||||
*/
|
||||
mbedtls_md_hmac_finish( &sha_ctx, digest );
|
||||
|
||||
if( fread( buffer, 1, 32, fin ) != 32 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "fread(%d bytes) failed\n", 32 );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Use constant-time buffer comparison */
|
||||
diff = 0;
|
||||
for( i = 0; i < 32; i++ )
|
||||
diff |= digest[i] ^ buffer[i];
|
||||
|
||||
if( diff != 0 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "HMAC check failed: wrong key, "
|
||||
"or file corrupted.\n" );
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
exit_code = MBEDTLS_EXIT_SUCCESS;
|
||||
|
||||
exit:
|
||||
if( fin )
|
||||
fclose( fin );
|
||||
if( fout )
|
||||
fclose( fout );
|
||||
|
||||
/* Zeroize all command line arguments to also cover
|
||||
the case when the user has missed or reordered some,
|
||||
in which case the key might not be in argv[4]. */
|
||||
for( i = 0; i < (unsigned int) argc; i++ )
|
||||
mbedtls_platform_zeroize( argv[i], strlen( argv[i] ) );
|
||||
|
||||
mbedtls_platform_zeroize( IV, sizeof( IV ) );
|
||||
mbedtls_platform_zeroize( key, sizeof( key ) );
|
||||
mbedtls_platform_zeroize( tmp, sizeof( tmp ) );
|
||||
mbedtls_platform_zeroize( buffer, sizeof( buffer ) );
|
||||
mbedtls_platform_zeroize( digest, sizeof( digest ) );
|
||||
|
||||
mbedtls_aes_free( &aes_ctx );
|
||||
mbedtls_md_free( &sha_ctx );
|
||||
|
||||
mbedtls_exit( exit_code );
|
||||
}
|
||||
#endif /* MBEDTLS_AES_C && MBEDTLS_SHA256_C && MBEDTLS_FS_IO */
|
263
externals/mbedtls/programs/test/ssl_cert_test.c
vendored
263
externals/mbedtls/programs/test/ssl_cert_test.c
vendored
@@ -1,263 +0,0 @@
|
||||
/*
|
||||
* SSL certificate functionality tests
|
||||
*
|
||||
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* 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.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This file is part of mbed TLS (https://tls.mbed.org)
|
||||
*/
|
||||
|
||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||
#include "mbedtls/config.h"
|
||||
#else
|
||||
#include MBEDTLS_CONFIG_FILE
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
#include "mbedtls/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define mbedtls_snprintf snprintf
|
||||
#define mbedtls_printf printf
|
||||
#define MBEDTLS_EXIT_SUCCESS EXIT_SUCCESS
|
||||
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
|
||||
#endif /* MBEDTLS_PLATFORM_C */
|
||||
|
||||
#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_X509_CRT_PARSE_C) && \
|
||||
defined(MBEDTLS_FS_IO) && defined(MBEDTLS_X509_CRL_PARSE_C)
|
||||
#include "mbedtls/certs.h"
|
||||
#include "mbedtls/x509_crt.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#define MAX_CLIENT_CERTS 8
|
||||
|
||||
#if !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
|
||||
!defined(MBEDTLS_FS_IO) || !defined(MBEDTLS_X509_CRL_PARSE_C)
|
||||
int main( void )
|
||||
{
|
||||
mbedtls_printf("MBEDTLS_RSA_C and/or MBEDTLS_X509_CRT_PARSE_C "
|
||||
"MBEDTLS_FS_IO and/or MBEDTLS_X509_CRL_PARSE_C "
|
||||
"not defined.\n");
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
const char *client_certificates[MAX_CLIENT_CERTS] =
|
||||
{
|
||||
"client1.crt",
|
||||
"client2.crt",
|
||||
"server1.crt",
|
||||
"server2.crt",
|
||||
"cert_sha224.crt",
|
||||
"cert_sha256.crt",
|
||||
"cert_sha384.crt",
|
||||
"cert_sha512.crt"
|
||||
};
|
||||
|
||||
const char *client_private_keys[MAX_CLIENT_CERTS] =
|
||||
{
|
||||
"client1.key",
|
||||
"client2.key",
|
||||
"server1.key",
|
||||
"server2.key",
|
||||
"cert_digest.key",
|
||||
"cert_digest.key",
|
||||
"cert_digest.key",
|
||||
"cert_digest.key"
|
||||
};
|
||||
|
||||
int main( void )
|
||||
{
|
||||
int ret = 1, i;
|
||||
int exit_code = MBEDTLS_EXIT_FAILURE;
|
||||
mbedtls_x509_crt cacert;
|
||||
mbedtls_x509_crl crl;
|
||||
char buf[10240];
|
||||
|
||||
mbedtls_x509_crt_init( &cacert );
|
||||
mbedtls_x509_crl_init( &crl );
|
||||
|
||||
/*
|
||||
* 1.1. Load the trusted CA
|
||||
*/
|
||||
mbedtls_printf( "\n . Loading the CA root certificate ..." );
|
||||
fflush( stdout );
|
||||
|
||||
/*
|
||||
* Alternatively, you may load the CA certificates from a .pem or
|
||||
* .crt file by calling mbedtls_x509_crt_parse_file( &cacert, "myca.crt" ).
|
||||
*/
|
||||
ret = mbedtls_x509_crt_parse_file( &cacert, "ssl/test-ca/test-ca.crt" );
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_x509_crt_parse_file returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_printf( " ok\n" );
|
||||
|
||||
mbedtls_x509_crt_info( buf, 1024, "CRT: ", &cacert );
|
||||
mbedtls_printf("%s\n", buf );
|
||||
|
||||
/*
|
||||
* 1.2. Load the CRL
|
||||
*/
|
||||
mbedtls_printf( " . Loading the CRL ..." );
|
||||
fflush( stdout );
|
||||
|
||||
ret = mbedtls_x509_crl_parse_file( &crl, "ssl/test-ca/crl.pem" );
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_x509_crl_parse_file returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_printf( " ok\n" );
|
||||
|
||||
mbedtls_x509_crl_info( buf, 1024, "CRL: ", &crl );
|
||||
mbedtls_printf("%s\n", buf );
|
||||
|
||||
for( i = 0; i < MAX_CLIENT_CERTS; i++ )
|
||||
{
|
||||
/*
|
||||
* 1.3. Load own certificate
|
||||
*/
|
||||
char name[512];
|
||||
uint32_t flags;
|
||||
mbedtls_x509_crt clicert;
|
||||
mbedtls_pk_context pk;
|
||||
|
||||
mbedtls_x509_crt_init( &clicert );
|
||||
mbedtls_pk_init( &pk );
|
||||
|
||||
mbedtls_snprintf(name, 512, "ssl/test-ca/%s", client_certificates[i]);
|
||||
|
||||
mbedtls_printf( " . Loading the client certificate %s...", name );
|
||||
fflush( stdout );
|
||||
|
||||
ret = mbedtls_x509_crt_parse_file( &clicert, name );
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_x509_crt_parse_file returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_printf( " ok\n" );
|
||||
|
||||
/*
|
||||
* 1.4. Verify certificate validity with CA certificate
|
||||
*/
|
||||
mbedtls_printf( " . Verify the client certificate with CA certificate..." );
|
||||
fflush( stdout );
|
||||
|
||||
ret = mbedtls_x509_crt_verify( &clicert, &cacert, &crl, NULL, &flags, NULL,
|
||||
NULL );
|
||||
if( ret != 0 )
|
||||
{
|
||||
if( ret == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED )
|
||||
{
|
||||
char vrfy_buf[512];
|
||||
|
||||
mbedtls_printf( " failed\n" );
|
||||
mbedtls_x509_crt_verify_info( vrfy_buf, sizeof( vrfy_buf ), " ! ", flags );
|
||||
mbedtls_printf( "%s\n", vrfy_buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_x509_crt_verify returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
mbedtls_printf( " ok\n" );
|
||||
|
||||
/*
|
||||
* 1.5. Load own private key
|
||||
*/
|
||||
mbedtls_snprintf(name, 512, "ssl/test-ca/%s", client_private_keys[i]);
|
||||
|
||||
mbedtls_printf( " . Loading the client private key %s...", name );
|
||||
fflush( stdout );
|
||||
|
||||
ret = mbedtls_pk_parse_keyfile( &pk, name, NULL );
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_pk_parse_keyfile returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_printf( " ok\n" );
|
||||
|
||||
/*
|
||||
* 1.6. Verify certificate validity with private key
|
||||
*/
|
||||
mbedtls_printf( " . Verify the client certificate with private key..." );
|
||||
fflush( stdout );
|
||||
|
||||
|
||||
/* EC NOT IMPLEMENTED YET */
|
||||
if( ! mbedtls_pk_can_do( &clicert.pk, MBEDTLS_PK_RSA ) )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! certificate's key is not RSA\n\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = mbedtls_mpi_cmp_mpi(&mbedtls_pk_rsa( pk )->N, &mbedtls_pk_rsa( clicert.pk )->N);
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_mpi_cmp_mpi for N returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = mbedtls_mpi_cmp_mpi(&mbedtls_pk_rsa( pk )->E, &mbedtls_pk_rsa( clicert.pk )->E);
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_mpi_cmp_mpi for E returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = mbedtls_rsa_check_privkey( mbedtls_pk_rsa( pk ) );
|
||||
if( ret != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_rsa_check_privkey returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbedtls_printf( " ok\n" );
|
||||
|
||||
mbedtls_x509_crt_free( &clicert );
|
||||
mbedtls_pk_free( &pk );
|
||||
}
|
||||
|
||||
exit_code = MBEDTLS_EXIT_SUCCESS;
|
||||
|
||||
exit:
|
||||
mbedtls_x509_crt_free( &cacert );
|
||||
mbedtls_x509_crl_free( &crl );
|
||||
|
||||
#if defined(_WIN32)
|
||||
mbedtls_printf( " + Press Enter to exit this program.\n" );
|
||||
fflush( stdout ); getchar();
|
||||
#endif
|
||||
|
||||
return( exit_code );
|
||||
}
|
||||
#endif /* MBEDTLS_RSA_C && MBEDTLS_X509_CRT_PARSE_C && MBEDTLS_FS_IO &&
|
||||
MBEDTLS_X509_CRL_PARSE_C */
|
223
externals/mbedtls/tests/scripts/check-files.py
vendored
223
externals/mbedtls/tests/scripts/check-files.py
vendored
@@ -1,223 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
This file is part of Mbed TLS (https://tls.mbed.org)
|
||||
|
||||
Copyright (c) 2018, Arm Limited, All Rights Reserved
|
||||
|
||||
Purpose
|
||||
|
||||
This script checks the current state of the source code for minor issues,
|
||||
including incorrect file permissions, presence of tabs, non-Unix line endings,
|
||||
trailing whitespace, presence of UTF-8 BOM, and TODO comments.
|
||||
Note: requires python 3, must be run from Mbed TLS root.
|
||||
"""
|
||||
|
||||
import os
|
||||
import argparse
|
||||
import logging
|
||||
import codecs
|
||||
import sys
|
||||
|
||||
|
||||
class IssueTracker(object):
|
||||
"""Base class for issue tracking. Issues should inherit from this and
|
||||
overwrite either issue_with_line if they check the file line by line, or
|
||||
overwrite check_file_for_issue if they check the file as a whole."""
|
||||
|
||||
def __init__(self):
|
||||
self.heading = ""
|
||||
self.files_exemptions = []
|
||||
self.files_with_issues = {}
|
||||
|
||||
def should_check_file(self, filepath):
|
||||
for files_exemption in self.files_exemptions:
|
||||
if filepath.endswith(files_exemption):
|
||||
return False
|
||||
return True
|
||||
|
||||
def issue_with_line(self, line):
|
||||
raise NotImplementedError
|
||||
|
||||
def check_file_for_issue(self, filepath):
|
||||
with open(filepath, "rb") as f:
|
||||
for i, line in enumerate(iter(f.readline, b"")):
|
||||
self.check_file_line(filepath, line, i + 1)
|
||||
|
||||
def check_file_line(self, filepath, line, line_number):
|
||||
if self.issue_with_line(line):
|
||||
if filepath not in self.files_with_issues.keys():
|
||||
self.files_with_issues[filepath] = []
|
||||
self.files_with_issues[filepath].append(line_number)
|
||||
|
||||
def output_file_issues(self, logger):
|
||||
if self.files_with_issues.values():
|
||||
logger.info(self.heading)
|
||||
for filename, lines in sorted(self.files_with_issues.items()):
|
||||
if lines:
|
||||
logger.info("{}: {}".format(
|
||||
filename, ", ".join(str(x) for x in lines)
|
||||
))
|
||||
else:
|
||||
logger.info(filename)
|
||||
logger.info("")
|
||||
|
||||
|
||||
class PermissionIssueTracker(IssueTracker):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.heading = "Incorrect permissions:"
|
||||
|
||||
def check_file_for_issue(self, filepath):
|
||||
if not (os.access(filepath, os.X_OK) ==
|
||||
filepath.endswith((".sh", ".pl", ".py"))):
|
||||
self.files_with_issues[filepath] = None
|
||||
|
||||
|
||||
class EndOfFileNewlineIssueTracker(IssueTracker):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.heading = "Missing newline at end of file:"
|
||||
|
||||
def check_file_for_issue(self, filepath):
|
||||
with open(filepath, "rb") as f:
|
||||
if not f.read().endswith(b"\n"):
|
||||
self.files_with_issues[filepath] = None
|
||||
|
||||
|
||||
class Utf8BomIssueTracker(IssueTracker):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.heading = "UTF-8 BOM present:"
|
||||
|
||||
def check_file_for_issue(self, filepath):
|
||||
with open(filepath, "rb") as f:
|
||||
if f.read().startswith(codecs.BOM_UTF8):
|
||||
self.files_with_issues[filepath] = None
|
||||
|
||||
|
||||
class LineEndingIssueTracker(IssueTracker):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.heading = "Non Unix line endings:"
|
||||
|
||||
def issue_with_line(self, line):
|
||||
return b"\r" in line
|
||||
|
||||
|
||||
class TrailingWhitespaceIssueTracker(IssueTracker):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.heading = "Trailing whitespace:"
|
||||
self.files_exemptions = [".md"]
|
||||
|
||||
def issue_with_line(self, line):
|
||||
return line.rstrip(b"\r\n") != line.rstrip()
|
||||
|
||||
|
||||
class TabIssueTracker(IssueTracker):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.heading = "Tabs present:"
|
||||
self.files_exemptions = [
|
||||
"Makefile", "generate_visualc_files.pl"
|
||||
]
|
||||
|
||||
def issue_with_line(self, line):
|
||||
return b"\t" in line
|
||||
|
||||
|
||||
class TodoIssueTracker(IssueTracker):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.heading = "TODO present:"
|
||||
self.files_exemptions = [
|
||||
__file__, "benchmark.c", "pull_request_template.md"
|
||||
]
|
||||
|
||||
def issue_with_line(self, line):
|
||||
return b"todo" in line.lower()
|
||||
|
||||
|
||||
class IntegrityChecker(object):
|
||||
|
||||
def __init__(self, log_file):
|
||||
self.check_repo_path()
|
||||
self.logger = None
|
||||
self.setup_logger(log_file)
|
||||
self.files_to_check = (
|
||||
".c", ".h", ".sh", ".pl", ".py", ".md", ".function", ".data",
|
||||
"Makefile", "CMakeLists.txt", "ChangeLog"
|
||||
)
|
||||
self.issues_to_check = [
|
||||
PermissionIssueTracker(),
|
||||
EndOfFileNewlineIssueTracker(),
|
||||
Utf8BomIssueTracker(),
|
||||
LineEndingIssueTracker(),
|
||||
TrailingWhitespaceIssueTracker(),
|
||||
TabIssueTracker(),
|
||||
TodoIssueTracker(),
|
||||
]
|
||||
|
||||
def check_repo_path(self):
|
||||
if not all(os.path.isdir(d) for d in ["include", "library", "tests"]):
|
||||
raise Exception("Must be run from Mbed TLS root")
|
||||
|
||||
def setup_logger(self, log_file, level=logging.INFO):
|
||||
self.logger = logging.getLogger()
|
||||
self.logger.setLevel(level)
|
||||
if log_file:
|
||||
handler = logging.FileHandler(log_file)
|
||||
self.logger.addHandler(handler)
|
||||
else:
|
||||
console = logging.StreamHandler()
|
||||
self.logger.addHandler(console)
|
||||
|
||||
def check_files(self):
|
||||
for root, dirs, files in sorted(os.walk(".")):
|
||||
for filename in sorted(files):
|
||||
filepath = os.path.join(root, filename)
|
||||
if (os.path.join("yotta", "module") in filepath or
|
||||
not filepath.endswith(self.files_to_check)):
|
||||
continue
|
||||
for issue_to_check in self.issues_to_check:
|
||||
if issue_to_check.should_check_file(filepath):
|
||||
issue_to_check.check_file_for_issue(filepath)
|
||||
|
||||
def output_issues(self):
|
||||
integrity_return_code = 0
|
||||
for issue_to_check in self.issues_to_check:
|
||||
if issue_to_check.files_with_issues:
|
||||
integrity_return_code = 1
|
||||
issue_to_check.output_file_issues(self.logger)
|
||||
return integrity_return_code
|
||||
|
||||
|
||||
def run_main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description=(
|
||||
"This script checks the current state of the source code for "
|
||||
"minor issues, including incorrect file permissions, "
|
||||
"presence of tabs, non-Unix line endings, trailing whitespace, "
|
||||
"presence of UTF-8 BOM, and TODO comments. "
|
||||
"Note: requires python 3, must be run from Mbed TLS root."
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l", "--log_file", type=str, help="path to optional output log",
|
||||
)
|
||||
check_args = parser.parse_args()
|
||||
integrity_check = IntegrityChecker(check_args.log_file)
|
||||
integrity_check.check_files()
|
||||
return_code = integrity_check.output_issues()
|
||||
sys.exit(return_code)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_main()
|
411
externals/mbedtls/tests/scripts/generate_code.pl
vendored
411
externals/mbedtls/tests/scripts/generate_code.pl
vendored
@@ -1,411 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# generate_code.pl
|
||||
#
|
||||
# This file is part of mbed TLS (https://tls.mbed.org)
|
||||
#
|
||||
# Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
|
||||
#
|
||||
# Purpose
|
||||
#
|
||||
# Generates the test suite code given inputs of the test suite directory that
|
||||
# contain the test suites, and the test suite file names for the test code and
|
||||
# test data.
|
||||
#
|
||||
# Usage: generate_code.pl <suite dir> <code file> <data file> [main code file]
|
||||
#
|
||||
# Structure of files
|
||||
#
|
||||
# - main code file - 'main_test.function'
|
||||
# Template file that contains the main() function for the test suite,
|
||||
# test dispatch code as well as support functions. It contains the
|
||||
# following symbols which are substituted by this script during
|
||||
# processing:
|
||||
# TESTCASE_FILENAME
|
||||
# TESTCODE_FILENAME
|
||||
# SUITE_PRE_DEP
|
||||
# MAPPING_CODE
|
||||
# FUNCTION CODE
|
||||
# SUITE_POST_DEP
|
||||
# DEP_CHECK_CODE
|
||||
# DISPATCH_FUNCTION
|
||||
# !LINE_NO!
|
||||
#
|
||||
# - common helper code file - 'helpers.function'
|
||||
# Common helper functions
|
||||
#
|
||||
# - test suite code file - file name in the form 'test_suite_xxx.function'
|
||||
# Code file that contains the actual test cases. The file contains a
|
||||
# series of code sequences delimited by the following:
|
||||
# BEGIN_HEADER / END_HEADER - list of headers files
|
||||
# BEGIN_SUITE_HELPERS / END_SUITE_HELPERS - helper functions common to
|
||||
# the test suite
|
||||
# BEGIN_CASE / END_CASE - the test cases in the test suite. Each test
|
||||
# case contains at least one function that is used to create the
|
||||
# dispatch code.
|
||||
#
|
||||
# - test data file - file name in the form 'test_suite_xxxx.data'
|
||||
# The test case parameters to to be used in execution of the test. The
|
||||
# file name is used to replace the symbol 'TESTCASE_FILENAME' in the main
|
||||
# code file above.
|
||||
#
|
||||
# A test data file consists of a sequence of paragraphs separated by
|
||||
# a single empty line. Line breaks may be in Unix (LF) or Windows (CRLF)
|
||||
# format. Lines starting with the character '#' are ignored
|
||||
# (the parser behaves as if they were not present).
|
||||
#
|
||||
# Each paragraph describes one test case and must consist of: (1) one
|
||||
# line which is the test case name; (2) an optional line starting with
|
||||
# the 11-character prefix "depends_on:"; (3) a line containing the test
|
||||
# function to execute and its parameters.
|
||||
#
|
||||
# A depends_on: line consists of a list of compile-time options
|
||||
# separated by the character ':', with no whitespace. The test case
|
||||
# is executed only if this compilation option is enabled in config.h.
|
||||
#
|
||||
# The last line of each paragraph contains a test function name and
|
||||
# a list of parameters separated by the character ':'. Running the
|
||||
# test case calls this function with the specified parameters. Each
|
||||
# parameter may either be an integer written in decimal or hexadecimal,
|
||||
# or a string surrounded by double quotes which may not contain the
|
||||
# ':' character.
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
my $suite_dir = shift or die "Missing suite directory";
|
||||
my $suite_name = shift or die "Missing suite name";
|
||||
my $data_name = shift or die "Missing data name";
|
||||
my $test_main_file = do { my $arg = shift; defined($arg) ? $arg : $suite_dir."/main_test.function" };
|
||||
my $test_file = $data_name.".c";
|
||||
my $test_common_helper_file = $suite_dir."/helpers.function";
|
||||
my $test_case_file = $suite_dir."/".$suite_name.".function";
|
||||
my $test_case_data = $suite_dir."/".$data_name.".data";
|
||||
|
||||
my $line_separator = $/;
|
||||
undef $/;
|
||||
|
||||
|
||||
#
|
||||
# Open and read in the input files
|
||||
#
|
||||
|
||||
open(TEST_HELPERS, "$test_common_helper_file") or die "Opening test helpers
|
||||
'$test_common_helper_file': $!";
|
||||
my $test_common_helpers = <TEST_HELPERS>;
|
||||
close(TEST_HELPERS);
|
||||
|
||||
open(TEST_MAIN, "$test_main_file") or die "Opening test main '$test_main_file': $!";
|
||||
my @test_main_lines = split/^/, <TEST_MAIN>;
|
||||
my $test_main;
|
||||
my $index = 2;
|
||||
for my $line (@test_main_lines) {
|
||||
$line =~ s/!LINE_NO!/$index/;
|
||||
$test_main = $test_main.$line;
|
||||
$index++;
|
||||
}
|
||||
close(TEST_MAIN);
|
||||
|
||||
open(TEST_CASES, "$test_case_file") or die "Opening test cases '$test_case_file': $!";
|
||||
my @test_cases_lines = split/^/, <TEST_CASES>;
|
||||
my $test_cases;
|
||||
my $index = 2;
|
||||
for my $line (@test_cases_lines) {
|
||||
if ($line =~ /^\/\* BEGIN_SUITE_HELPERS .*\*\//)
|
||||
{
|
||||
$line = $line."#line $index \"$test_case_file\"\n";
|
||||
}
|
||||
|
||||
if ($line =~ /^\/\* BEGIN_CASE .*\*\//)
|
||||
{
|
||||
$line = $line."#line $index \"$test_case_file\"\n";
|
||||
}
|
||||
|
||||
$line =~ s/!LINE_NO!/$index/;
|
||||
|
||||
$test_cases = $test_cases.$line;
|
||||
$index++;
|
||||
}
|
||||
|
||||
close(TEST_CASES);
|
||||
|
||||
open(TEST_DATA, "$test_case_data") or die "Opening test data '$test_case_data': $!";
|
||||
my $test_data = <TEST_DATA>;
|
||||
close(TEST_DATA);
|
||||
|
||||
|
||||
#
|
||||
# Find the headers, dependencies, and suites in the test cases file
|
||||
#
|
||||
|
||||
my ( $suite_header ) = $test_cases =~ /\/\* BEGIN_HEADER \*\/\n(.*?)\n\/\* END_HEADER \*\//s;
|
||||
my ( $suite_defines ) = $test_cases =~ /\/\* BEGIN_DEPENDENCIES\n \* (.*?)\n \* END_DEPENDENCIES/s;
|
||||
my ( $suite_helpers ) = $test_cases =~ /\/\* BEGIN_SUITE_HELPERS \*\/\n(.*?)\n\/\* END_SUITE_HELPERS \*\//s;
|
||||
|
||||
my $requirements;
|
||||
if ($suite_defines =~ /^depends_on:/)
|
||||
{
|
||||
( $requirements ) = $suite_defines =~ /^depends_on:(.*)$/;
|
||||
}
|
||||
|
||||
my @var_req_arr = split(/:/, $requirements);
|
||||
my $suite_pre_code;
|
||||
my $suite_post_code;
|
||||
my $dispatch_code;
|
||||
my $mapping_code;
|
||||
my %mapping_values;
|
||||
|
||||
while (@var_req_arr)
|
||||
{
|
||||
my $req = shift @var_req_arr;
|
||||
$req =~ s/(!?)(.*)/$1defined($2)/;
|
||||
|
||||
$suite_pre_code .= "#if $req\n";
|
||||
$suite_post_code .= "#endif /* $req */\n";
|
||||
}
|
||||
|
||||
$/ = $line_separator;
|
||||
|
||||
open(TEST_FILE, ">$test_file") or die "Opening destination file '$test_file': $!";
|
||||
print TEST_FILE << "END";
|
||||
/*
|
||||
* *** THIS FILE HAS BEEN MACHINE GENERATED ***
|
||||
*
|
||||
* This file has been machine generated using the script: $0
|
||||
*
|
||||
* Test file : $test_file
|
||||
*
|
||||
* The following files were used to create this file.
|
||||
*
|
||||
* Main code file : $test_main_file
|
||||
* Helper file : $test_common_helper_file
|
||||
* Test suite file : $test_case_file
|
||||
* Test suite data : $test_case_data
|
||||
*
|
||||
*
|
||||
* This file is part of mbed TLS (https://tls.mbed.org)
|
||||
*/
|
||||
|
||||
#if !defined(MBEDTLS_CONFIG_FILE)
|
||||
#include <mbedtls/config.h>
|
||||
#else
|
||||
#include MBEDTLS_CONFIG_FILE
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Common helper code */
|
||||
|
||||
$test_common_helpers
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Test Suite Code */
|
||||
|
||||
$suite_pre_code
|
||||
$suite_header
|
||||
$suite_helpers
|
||||
$suite_post_code
|
||||
|
||||
END
|
||||
|
||||
$test_main =~ s/SUITE_PRE_DEP/$suite_pre_code/;
|
||||
$test_main =~ s/SUITE_POST_DEP/$suite_post_code/;
|
||||
|
||||
while($test_cases =~ /\/\* BEGIN_CASE *([\w:]*) \*\/\n(.*?)\n\/\* END_CASE \*\//msg)
|
||||
{
|
||||
my $function_deps = $1;
|
||||
my $function_decl = $2;
|
||||
|
||||
# Sanity checks of function
|
||||
if ($function_decl !~ /^#line\s*.*\nvoid /)
|
||||
{
|
||||
die "Test function does not have 'void' as return type.\n" .
|
||||
"Function declaration:\n" .
|
||||
$function_decl;
|
||||
}
|
||||
if ($function_decl !~ /^(#line\s*.*)\nvoid (\w+)\(\s*(.*?)\s*\)\s*{(.*)}/ms)
|
||||
{
|
||||
die "Function declaration not in expected format\n";
|
||||
}
|
||||
my $line_directive = $1;
|
||||
my $function_name = $2;
|
||||
my $function_params = $3;
|
||||
my $function_pre_code;
|
||||
my $function_post_code;
|
||||
my $param_defs;
|
||||
my $param_checks;
|
||||
my @dispatch_params;
|
||||
my @var_def_arr = split(/,\s*/, $function_params);
|
||||
my $i = 1;
|
||||
my $mapping_regex = "".$function_name;
|
||||
my $mapping_count = 0;
|
||||
|
||||
$function_decl =~ s/(^#line\s*.*)\nvoid /$1\nvoid test_suite_/;
|
||||
|
||||
# Add exit label if not present
|
||||
if ($function_decl !~ /^exit:$/m)
|
||||
{
|
||||
$function_decl =~ s/}\s*$/\nexit:\n return;\n}/;
|
||||
}
|
||||
|
||||
if ($function_deps =~ /^depends_on:/)
|
||||
{
|
||||
( $function_deps ) = $function_deps =~ /^depends_on:(.*)$/;
|
||||
}
|
||||
|
||||
foreach my $req (split(/:/, $function_deps))
|
||||
{
|
||||
$function_pre_code .= "#ifdef $req\n";
|
||||
$function_post_code .= "#endif /* $req */\n";
|
||||
}
|
||||
|
||||
foreach my $def (@var_def_arr)
|
||||
{
|
||||
# Handle the different parameter types
|
||||
if( substr($def, 0, 4) eq "int " )
|
||||
{
|
||||
$param_defs .= " int param$i;\n";
|
||||
$param_checks .= " if( verify_int( params[$i], ¶m$i ) != 0 ) return( DISPATCH_INVALID_TEST_DATA );\n";
|
||||
push @dispatch_params, "param$i";
|
||||
|
||||
$mapping_regex .= ":([\\d\\w |\\+\\-\\(\\)]+)";
|
||||
$mapping_count++;
|
||||
}
|
||||
elsif( substr($def, 0, 6) eq "char *" )
|
||||
{
|
||||
$param_defs .= " char *param$i = params[$i];\n";
|
||||
$param_checks .= " if( verify_string( ¶m$i ) != 0 ) return( DISPATCH_INVALID_TEST_DATA );\n";
|
||||
push @dispatch_params, "param$i";
|
||||
$mapping_regex .= ":(?:\\\\.|[^:\n])+";
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Parameter declaration not of supported type (int, char *)\n";
|
||||
}
|
||||
$i++;
|
||||
|
||||
}
|
||||
|
||||
# Find non-integer values we should map for this function
|
||||
if( $mapping_count)
|
||||
{
|
||||
my @res = $test_data =~ /^$mapping_regex/msg;
|
||||
foreach my $value (@res)
|
||||
{
|
||||
next unless ($value !~ /^\d+$/);
|
||||
if ( $mapping_values{$value} ) {
|
||||
${ $mapping_values{$value} }{$function_pre_code} = 1;
|
||||
} else {
|
||||
$mapping_values{$value} = { $function_pre_code => 1 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $call_params = join ", ", @dispatch_params;
|
||||
my $param_count = @var_def_arr + 1;
|
||||
$dispatch_code .= << "END";
|
||||
if( strcmp( params[0], "$function_name" ) == 0 )
|
||||
{
|
||||
$function_pre_code
|
||||
$param_defs
|
||||
if( cnt != $param_count )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "\\nIncorrect argument count (%d != %d)\\n", cnt, $param_count );
|
||||
return( DISPATCH_INVALID_TEST_DATA );
|
||||
}
|
||||
|
||||
$param_checks
|
||||
test_suite_$function_name( $call_params );
|
||||
return ( DISPATCH_TEST_SUCCESS );
|
||||
$function_post_code
|
||||
return ( DISPATCH_UNSUPPORTED_SUITE );
|
||||
}
|
||||
else
|
||||
END
|
||||
|
||||
my $function_code = $function_pre_code . $function_decl . "\n" .
|
||||
$function_post_code;
|
||||
$test_main =~ s/FUNCTION_CODE/$function_code\nFUNCTION_CODE/;
|
||||
}
|
||||
|
||||
# Find specific case dependencies that we should be able to check
|
||||
# and make check code
|
||||
my $dep_check_code;
|
||||
|
||||
my @res = $test_data =~ /^depends_on:([!:\w]+)/msg;
|
||||
my %case_deps;
|
||||
foreach my $deps (@res)
|
||||
{
|
||||
foreach my $dep (split(/:/, $deps))
|
||||
{
|
||||
$case_deps{$dep} = 1;
|
||||
}
|
||||
}
|
||||
while( my ($key, $value) = each(%case_deps) )
|
||||
{
|
||||
if( substr($key, 0, 1) eq "!" )
|
||||
{
|
||||
my $key = substr($key, 1);
|
||||
$dep_check_code .= << "END";
|
||||
if( strcmp( str, "!$key" ) == 0 )
|
||||
{
|
||||
#if !defined($key)
|
||||
return( DEPENDENCY_SUPPORTED );
|
||||
#else
|
||||
return( DEPENDENCY_NOT_SUPPORTED );
|
||||
#endif
|
||||
}
|
||||
END
|
||||
}
|
||||
else
|
||||
{
|
||||
$dep_check_code .= << "END";
|
||||
if( strcmp( str, "$key" ) == 0 )
|
||||
{
|
||||
#if defined($key)
|
||||
return( DEPENDENCY_SUPPORTED );
|
||||
#else
|
||||
return( DEPENDENCY_NOT_SUPPORTED );
|
||||
#endif
|
||||
}
|
||||
END
|
||||
}
|
||||
}
|
||||
|
||||
# Make mapping code
|
||||
while( my ($key, $value) = each(%mapping_values) )
|
||||
{
|
||||
my $key_mapping_code = << "END";
|
||||
if( strcmp( str, "$key" ) == 0 )
|
||||
{
|
||||
*value = ( $key );
|
||||
return( KEY_VALUE_MAPPING_FOUND );
|
||||
}
|
||||
END
|
||||
|
||||
# handle depenencies, unless used at least one without depends
|
||||
if ($value->{""}) {
|
||||
$mapping_code .= $key_mapping_code;
|
||||
next;
|
||||
}
|
||||
for my $ifdef ( keys %$value ) {
|
||||
(my $endif = $ifdef) =~ s!ifdef!endif //!g;
|
||||
$mapping_code .= $ifdef . $key_mapping_code . $endif;
|
||||
}
|
||||
}
|
||||
|
||||
$dispatch_code =~ s/^(.+)/ $1/mg;
|
||||
|
||||
$test_main =~ s/TESTCASE_FILENAME/$test_case_data/g;
|
||||
$test_main =~ s/TESTCODE_FILENAME/$test_case_file/g;
|
||||
$test_main =~ s/FUNCTION_CODE//;
|
||||
$test_main =~ s/DEP_CHECK_CODE/$dep_check_code/;
|
||||
$test_main =~ s/DISPATCH_FUNCTION/$dispatch_code/;
|
||||
$test_main =~ s/MAPPING_CODE/$mapping_code/;
|
||||
|
||||
print TEST_FILE << "END";
|
||||
$test_main
|
||||
END
|
||||
|
||||
close(TEST_FILE);
|
61
externals/mbedtls/tests/scripts/yotta-build.sh
vendored
61
externals/mbedtls/tests/scripts/yotta-build.sh
vendored
@@ -1,61 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# yotta-build.sh
|
||||
#
|
||||
# This file is part of mbed TLS (https://tls.mbed.org)
|
||||
#
|
||||
# Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
|
||||
#
|
||||
# Purpose
|
||||
#
|
||||
# To run test builds of the yotta module for all supported targets.
|
||||
|
||||
set -eu
|
||||
|
||||
check_tools()
|
||||
{
|
||||
for TOOL in "$@"; do
|
||||
if ! `hash "$TOOL" >/dev/null 2>&1`; then
|
||||
echo "$TOOL not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
yotta_build()
|
||||
{
|
||||
TARGET=$1
|
||||
|
||||
echo; echo "*** $TARGET (release) ***"
|
||||
yt -t $TARGET build
|
||||
|
||||
echo; echo "*** $TARGET (debug) ***"
|
||||
yt -t $TARGET build -d
|
||||
}
|
||||
|
||||
# Make sure the tools we need are available.
|
||||
check_tools "arm-none-eabi-gcc" "armcc" "yotta"
|
||||
|
||||
yotta/create-module.sh
|
||||
cd yotta/module
|
||||
yt update || true # needs network
|
||||
|
||||
if uname -a | grep 'Linux.*x86' >/dev/null; then
|
||||
yotta_build x86-linux-native
|
||||
fi
|
||||
if uname -a | grep 'Darwin.*x86' >/dev/null; then
|
||||
yotta_build x86-osx-native
|
||||
fi
|
||||
|
||||
# armcc build tests.
|
||||
yotta_build frdm-k64f-armcc
|
||||
#yotta_build nordic-nrf51822-16k-armcc
|
||||
|
||||
# arm-none-eabi-gcc build tests.
|
||||
yotta_build frdm-k64f-gcc
|
||||
#yotta_build st-nucleo-f401re-gcc # dirent
|
||||
#yotta_build stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
|
||||
#yotta_build nordic-nrf51822-16k-gcc # fails in minar-platform
|
||||
#yotta_build bbc-microbit-classic-gcc # fails in minar-platform
|
||||
#yotta_build st-stm32f439zi-gcc # fails in mbed-hal-st-stm32f4
|
||||
#yotta_build st-stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
|
173
externals/mbedtls/visualc/VS2010/aescrypt2.vcxproj
vendored
173
externals/mbedtls/visualc/VS2010/aescrypt2.vcxproj
vendored
@@ -1,173 +0,0 @@
|
||||
<?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>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\programs\aes\aescrypt2.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="mbedTLS.vcxproj">
|
||||
<Project>{46cf2d25-6a36-4189-b59c-e4815388e554}</Project>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7A851DBD-7D57-E8F4-85E5-CCA72AEA7DF8}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>aescrypt2</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</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 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>
|
||||
<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 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>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>%(AdditionalDependencies);</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -1,174 +0,0 @@
|
||||
<?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>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\programs\test\ssl_cert_test.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="mbedTLS.vcxproj">
|
||||
<Project>{46cf2d25-6a36-4189-b59c-e4815388e554}</Project>
|
||||
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{3FE0C0E1-D9BA-6A26-380C-F293E543B914}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>ssl_cert_test</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</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 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>
|
||||
<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 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>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(TargetName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>%(AdditionalDependencies);</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
Reference in New Issue
Block a user