Commit d901d178 authored by Manuel Pégourié-Gonnard's avatar Manuel Pégourié-Gonnard
Browse files

Merge branch 'development' into dtls

* development: (100 commits)
  Update Changelog for the mem-measure branch
  Fix issues introduced when rebasing
  Fix compile error in memory_buffer_alloc_selftest
  Code cosmetics
  Add curve25519 to ecc-heap.sh
  Add curve25519 to the benchmark program
  Fix compile issue when buffer_alloc not available
  New script ecc-heap.sh
  Fix unused variable issue in some configs
  Rm usunused member in private struct
  Add heap usage for PK in benchmark
  Use memory_buffer_alloc() in benchmark if available
  Only define mode_func if mode is enabled (CBC etc)
  PKCS8 encrypted key depend on PKCS5 or PKCS12
  Disable SRV_C for client measurement
  Output stack+heap usage with massif
  Enable NIST_OPTIM by default for config-suite-b
  Refactor memory.sh
  Adapt memory.sh to config-suite-b
  Adapt mini-client for config-suite-b.h
  ...

Conflicts:
	ChangeLog
	include/polarssl/net.h
	library/Makefile
	library/error.c
	library/ssl_tls.c
	programs/Makefile
	programs/ssl/ssl_client2.c
	programs/ssl/ssl_server2.c
	tests/Makefile
parents 82cf0a1f ad350ed7
......@@ -7,6 +7,9 @@ Coverage
*.gcno
*.gcda
# generated by scripts/memory.sh
massif-*
# MSVC files generated by CMake:
/*.sln
/*.vcxproj
......
......@@ -3,7 +3,7 @@ compiler:
- clang
- gcc
before_install: sudo apt-get update
install: sudo apt-get install gnutls-bin valgrind perl
install: sudo apt-get install valgrind perl
script:
- cmake -D CMAKE_BUILD_TYPE:String="Check" .
- make
......
......@@ -10,6 +10,39 @@ API Changes
* ssl_set_bio() now requires that p_send == p_recv.
* ssl_set_bio() is deprecated in favor of ssl_set_bio_timeout().
= mbed TLS 1.3 branch
Security
Features
* Add support for overriding snprintf() (except on Windows) and exit() in
the platform layer.
* Add an option to use macros instead of function pointers in the platform
layer (helps get rid of unwanted references).
* Improved Makefiles for Windows targets by fixing library targets and making
cross-compilation easier (thanks to Alon Bar-Lev).
* The benchmark program also prints heap usage for public-key primitives
if POLARSSL_MEMORY_BUFFER_ALLOC_C and POLARSSL_MEMORY_DEBUG are defined.
* New script ecc-heap.sh helps measuring the impact of ECC parameters on
speed and RAM (heap only for now) usage.
* New script memory.sh helps measuring the ROM and RAM requirements of two
reduced configurations (PSK-CCM and NSA suite B).
Bugfix
* Fix hardclock() (only used in the benchmarking program) with some
versions of mingw64 (found by kxjhlele).
* Fix warnings from mingw64 in timing.c (found by kxjklele).
* Fix potential unintended sign extension in asn1_get_len() on 64-bit
platforms.
Changes
* Move from SHA-1 to SHA-256 in example programs using signatures
(suggested by Thorsten Mühlfelder).
* Remove some unneeded inclusions of header files from the standard library
"minimize" others (eg use stddef.h if only size_t is needed).
* Change #include lines in test files to use double quotes instead of angle
brackets for uniformity with the rest of the code.
* Remove dependency on sscanf() in X.509 parsing modules.
= mbed TLS 1.3.10 released 2015-02-09
Security
......
......@@ -35,6 +35,8 @@ In order to run the tests, enter::
make check
In order to build for a Windows platform, you should use WINDOWS_BUILD=1 if the target is Windows but the build environment is Unix-like (eg when cross-compiling, or compiling from an MSYS shell), and WINDOWS=1 if the build environment is a Windows shell.
Depending on your platform, you might run into some issues. Please check the Makefiles in *library/*, *programs/* and *tests/* for options to manually add or remove for specific platforms. You can also check `the mbed TLS Knowledge Base <https://polarssl.org/kb>`_ for articles on your platform or issue.
In case you find that you need to do something else as well, please let us know what, so we can add it to the KB.
......@@ -59,7 +61,7 @@ There are many different build modes available within the CMake buildsystem. Mos
- ASan.
This instruments the code with AddressSanitizer to check for memory errors.
(This includes LeakSanitizer, with recent version of gcc and clang.)
(With recent version of clang, this mode also intruments the code with
(With recent version of clang, this mode also instruments the code with
UndefinedSanitizer to check for undefined behaviour.)
- ASanDbg.
Same as ASan but slower, with debug information and better stack traces.
......@@ -70,7 +72,7 @@ There are many different build modes available within the CMake buildsystem. Mos
Same as ASan but slower, with debug information, better stack traces and
origin tracking.
- Check.
This activates the compiler warnings that depend on optimisation and treats
This activates the compiler warnings that depend on optimization and treats
all warnings as errors.
Switching build modes in CMake is simple. For debug mode, enter at the command line:
......@@ -103,7 +105,7 @@ Tests
mbed TLS includes an elaborate test suite in *tests/* that initially requires Perl to generate the tests files (e.g. *test_suite_mpi.c*). These files are generates from a **function file** (e.g. *suites/test_suite_mpi.function*) and a **data file** (e.g. *suites/test_suite_mpi.data*). The **function file** contains the template for each test function. The **data file** contains the test cases, specified as parameters that should be pushed into a template function.
For machines with a Unix shell and OpenSSL (and optionnally GnuTLS) installed, additional test scripts are available:
For machines with a Unix shell and OpenSSL (and optionally GnuTLS) installed, additional test scripts are available:
- *tests/ssl-opt.sh* runs integration tests for various TLS options (renegotiation, resumption, etc.) and tests interoperability of these options with other implementations.
- *tests/compat.sh* tests interoperability of every ciphersuite with other implementations.
......
......@@ -68,8 +68,8 @@
#define POLARSSL_ECP_WINDOW_SIZE 2
#define POLARSSL_ECP_FIXED_POINT_OPTIM 0
/* Uncomment for a significant speed benefit at the expense of some ROM */
//#define POLARSSL_ECP_NIST_OPTIM
/* Significant speed benefit at the expense of some ROM */
#define POLARSSL_ECP_NIST_OPTIM
/*
* You should adjust this to the exact number of sources you're using: default
......
Makefile
*.sln
*.vcxproj
polarssl/check_config
......@@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
......
......@@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#if !defined(POLARSSL_ARC4_ALT)
// Regular implementation
......
......@@ -30,12 +30,12 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <stddef.h>
#if defined(POLARSSL_BIGNUM_C)
#include "bignum.h"
#endif
#include <string.h>
/**
* \addtogroup asn1_module
* \{
......
......@@ -24,7 +24,7 @@
#ifndef POLARSSL_BASE64_H
#define POLARSSL_BASE64_H
#include <string.h>
#include <stddef.h>
#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */
#define POLARSSL_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */
......
......@@ -24,14 +24,14 @@
#ifndef POLARSSL_BIGNUM_H
#define POLARSSL_BIGNUM_H
#include <string.h>
#if !defined(POLARSSL_CONFIG_FILE)
#include "config.h"
#else
#include POLARSSL_CONFIG_FILE
#endif
#include <stddef.h>
#if defined(POLARSSL_FS_IO)
#include <stdio.h>
#endif
......
......@@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
......
......@@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
......
......@@ -145,13 +145,13 @@
#endif
#if defined(POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED) && \
( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) || \
!defined(POLARSSL_PKCS1_V15) )
#error "POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
#endif
#if defined(POLARSSL_KEY_EXCHANGE_RSA_ENABLED) && \
( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) ||\
( !defined(POLARSSL_RSA_C) || !defined(POLARSSL_X509_CRT_PARSE_C) || \
!defined(POLARSSL_PKCS1_V15) )
#error "POLARSSL_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
#endif
......@@ -198,6 +198,136 @@
#error "POLARSSL_PKCS11_C defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_EXIT_ALT) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_EXIT_ALT defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_EXIT_MACRO) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_EXIT_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_EXIT) ||\
defined(POLARSSL_PLATFORM_EXIT_ALT) )
#error "POLARSSL_PLATFORM_EXIT_MACRO and POLARSSL_PLATFORM_STD_EXIT/POLARSSL_PLATFORM_EXIT_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_FPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_FPRINTF_MACRO) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_FPRINTF_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_FPRINTF) ||\
defined(POLARSSL_PLATFORM_FPRINTF_ALT) )
#error "POLARSSL_PLATFORM_FPRINTF_MACRO and POLARSSL_PLATFORM_STD_FPRINTF/POLARSSL_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_FREE_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) )
#error "POLARSSL_PLATFORM_FREE_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_FREE_MACRO) &&\
defined(POLARSSL_PLATFORM_STD_FREE)
#error "POLARSSL_PLATFORM_FREE_MACRO and POLARSSL_PLATFORM_STD_FREE cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_FREE_MACRO) && !defined(POLARSSL_PLATFORM_MALLOC_MACRO)
#error "POLARSSL_PLATFORM_MALLOC_MACRO must be defined if POLARSSL_PLATFORM_FREE_MACRO is"
#endif
#if defined(POLARSSL_PLATFORM_MALLOC_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) )
#error "POLARSSL_PLATFORM_MALLOC_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_MALLOC_MACRO) &&\
defined(POLARSSL_PLATFORM_STD_MALLOC)
#error "POLARSSL_PLATFORM_MALLOC_MACRO and POLARSSL_PLATFORM_STD_MALLOC cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_MALLOC_MACRO) && !defined(POLARSSL_PLATFORM_FREE_MACRO)
#error "POLARSSL_PLATFORM_FREE_MACRO must be defined if POLARSSL_PLATFORM_MALLOC_MACRO is"
#endif
#if defined(POLARSSL_PLATFORM_MEMORY) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_MEMORY defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_PRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_PRINTF_MACRO) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_PRINTF_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_PRINTF) ||\
defined(POLARSSL_PLATFORM_PRINTF_ALT) )
#error "POLARSSL_PLATFORM_PRINTF_MACRO and POLARSSL_PLATFORM_STD_PRINTF/POLARSSL_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_SNPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_SNPRINTF_ALT) && ( defined(_WIN32)\
&& !defined(EFIX64) && !defined(EFI32) )
#error "POLARSSL_PLATFORM_SNPRINTF_ALT defined but not available on Windows"
#endif
#if defined(POLARSSL_PLATFORM_SNPRINTF_MACRO) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_SNPRINTF_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_SNPRINTF) ||\
defined(POLARSSL_PLATFORM_SNPRINTF_ALT) )
#error "POLARSSL_PLATFORM_SNPRINTF_MACRO and POLARSSL_PLATFORM_STD_SNPRINTF/POLARSSL_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_STD_MEM_HDR) &&\
!defined(POLARSSL_PLATFORM_NO_STD_FUNCTIONS)
#error "POLARSSL_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_STD_MALLOC) && !defined(POLARSSL_PLATFORM_MEMORY)
#error "POLARSSL_PLATFORM_STD_MALLOC defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_STD_MALLOC) && !defined(POLARSSL_PLATFORM_MEMORY)
#error "POLARSSL_PLATFORM_STD_MALLOC defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_STD_FREE) && !defined(POLARSSL_PLATFORM_MEMORY)
#error "POLARSSL_PLATFORM_STD_FREE defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_STD_EXIT) &&\
!defined(POLARSSL_PLATFORM_EXIT_ALT)
#error "POLARSSL_PLATFORM_STD_EXIT defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_STD_FPRINTF) &&\
!defined(POLARSSL_PLATFORM_FPRINTF_ALT)
#error "POLARSSL_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_STD_PRINTF) &&\
!defined(POLARSSL_PLATFORM_PRINTF_ALT)
#error "POLARSSL_PLATFORM_STD_PRINTF defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_STD_SNPRINTF) &&\
!defined(POLARSSL_PLATFORM_SNPRINTF_ALT)
#error "POLARSSL_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
#endif
#if defined(POLARSSL_RSA_C) && ( !defined(POLARSSL_BIGNUM_C) || \
!defined(POLARSSL_OID_C) )
#error "POLARSSL_RSA_C defined, but not all prerequisites"
......
......@@ -33,6 +33,8 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <stddef.h>
#if defined(POLARSSL_GCM_C) || defined(POLARSSL_CCM_C)
#define POLARSSL_CIPHER_MODE_AEAD
#endif
......@@ -41,7 +43,9 @@
#define POLARSSL_CIPHER_MODE_WITH_PADDING
#endif
#include <string.h>
#if defined(POLARSSL_ARC4_C)
#define POLARSSL_CIPHER_MODE_STREAM
#endif
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
......@@ -182,24 +186,32 @@ typedef struct {
int (*ecb_func)( void *ctx, operation_t mode,
const unsigned char *input, unsigned char *output );
#if defined(POLARSSL_CIPHER_MODE_CBC)
/** Encrypt using CBC */
int (*cbc_func)( void *ctx, operation_t mode, size_t length,
unsigned char *iv, const unsigned char *input,
unsigned char *output );
#endif
#if defined(POLARSSL_CIPHER_MODE_CFB)
/** Encrypt using CFB (Full length) */
int (*cfb_func)( void *ctx, operation_t mode, size_t length, size_t *iv_off,
unsigned char *iv, const unsigned char *input,
unsigned char *output );
#endif
#if defined(POLARSSL_CIPHER_MODE_CTR)
/** Encrypt using CTR */
int (*ctr_func)( void *ctx, size_t length, size_t *nc_off,
unsigned char *nonce_counter, unsigned char *stream_block,
const unsigned char *input, unsigned char *output );
#endif
#if defined(POLARSSL_CIPHER_MODE_STREAM)
/** Encrypt using STREAM */
int (*stream_func)( void *ctx, size_t length,
const unsigned char *input, unsigned char *output );
#endif
/** Set key for encryption purposes */
int (*setkey_enc_func)( void *ctx, const unsigned char *key,
......@@ -262,9 +274,11 @@ typedef struct {
/** Operation that the context's key has been initialised for */
operation_t operation;
#if defined(POLARSSL_CIPHER_MODE_WITH_PADDING)
/** Padding functions to use, if relevant for cipher mode */
void (*add_padding)( unsigned char *output, size_t olen, size_t data_len );
int (*get_padding)( unsigned char *input, size_t ilen, size_t *data_len );
#endif
/** Buffer for data that hasn't been encrypted yet */
unsigned char unprocessed_data[POLARSSL_MAX_BLOCK_LENGTH];
......
......@@ -31,6 +31,7 @@
#else
#include POLARSSL_CONFIG_FILE
#endif
#include "cipher.h"
#ifdef __cplusplus
......
......@@ -120,8 +120,14 @@
* This allows different allocators (self-implemented or provided) to be
* provided to the platform abstraction layer.
*
* Enabling POLARSSL_PLATFORM_MEMORY will provide "platform_set_malloc_free()"
* to allow you to set an alternative malloc() and free() function pointer.
* Enabling POLARSSL_PLATFORM_MEMORY without the
* POLARSSL_PLATFORM_{FREE,MALLOC}_MACROs will provide
* "platform_set_malloc_free()" allowing you to set an alternative malloc() and
* free() function pointer at runtime.
*
* Enabling POLARSSL_PLATFORM_MEMORY and specifying
* POLARSSL_PLATFORM_{MALLOC,FREE}_MACROs will allow you to specify the
* alternate function at compile time.
*
* Requires: POLARSSL_PLATFORM_C
*
......@@ -138,7 +144,8 @@
* This makes sure there are no linking errors on platforms that do not support
* these functions. You will HAVE to provide alternatives, either at runtime
* via the platform_set_xxx() functions or at compile time by setting
* the POLARSSL_PLATFORM_STD_XXX defines.
* the POLARSSL_PLATFORM_STD_XXX defines, or enabling a
* POLARSSL_PLATFORM_XXX_MACRO.
*
* Requires: POLARSSL_PLATFORM_C
*
......@@ -159,11 +166,19 @@
*
* All these define require POLARSSL_PLATFORM_C to be defined!
*
* WARNING: POLARSSL_PLATFORM_SNPRINTF_ALT is not available on Windows
* for compatibility reasons.
*
* WARNING: POLARSSL_PLATFORM_XXX_ALT cannot be defined at the same time as
* POLARSSL_PLATFORM_XXX_MACRO!
*
* Uncomment a macro to enable alternate implementation of specific base
* platform function
*/
//#define POLARSSL_PLATFORM_PRINTF_ALT
//#define POLARSSL_PLATFORM_EXIT_ALT
//#define POLARSSL_PLATFORM_FPRINTF_ALT
//#define POLARSSL_PLATFORM_PRINTF_ALT
//#define POLARSSL_PLATFORM_SNPRINTF_ALT
/* \} name SECTION: System support */
/**
......@@ -1957,7 +1972,11 @@
* \def POLARSSL_PLATFORM_C
*
* Enable the platform abstraction layer that allows you to re-assign
* functions like malloc(), free(), printf(), fprintf()
* functions like malloc(), free(), snprintf(), printf(), fprintf(), exit()
*
* Enabling POLARSSL_PLATFORM_C enables to use of POLARSSL_PLATFORM_XXX_ALT
* or POLARSSL_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
* above to be specified at runtime or compile time respectively.
*
* Module: library/platform.c
* Caller: Most other .c files
......@@ -2314,11 +2333,22 @@
//#define POLARSSL_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
/* Platform options */
//#define POLARSSL_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if POLARSSL_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
//#define POLARSSL_PLATFORM_STD_MALLOC malloc /**< Default allocator to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_MEM_HDR <stdlib.h> /**< Header to include if POLARSSL_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */
//#define POLARSSL_PLATFORM_STD_MALLOC malloc /**< Default allocator to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
/* To Use Function Macros POLARSSL_PLATFORM_C must be enabled */
/* POLARSSL_PLATFORM_XXX_MACRO and POLARSSL_PLATFORM_XXX_ALT cannot both be defined */
//#define POLARSSL_PLATFORM_MALLOC_MACRO malloc /**< Default allocator macro to use, can be undefined */
//#define POLARSSL_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
//#define POLARSSL_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
//#define POLARSSL_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
//#define POLARSSL_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
//#define POLARSSL_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
/* SSL Cache options */
//#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
......
......@@ -24,8 +24,6 @@
#ifndef POLARSSL_CTR_DRBG_H
#define POLARSSL_CTR_DRBG_H
#include <string.h>
#include "aes.h"
#define POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034 /**< The entropy source failed. */
......
......@@ -29,7 +29,9 @@
#else
#include POLARSSL_CONFIG_FILE
#endif
#include "ssl.h"
#if defined(POLARSSL_ECP_C)
#include "ecp.h"
#endif
......
......@@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
......
......@@ -24,14 +24,14 @@
#ifndef POLARSSL_ENTROPY_H
#define POLARSSL_ENTROPY_H
#include <string.h>
#if !defined(POLARSSL_CONFIG_FILE)
#include "config.h"
#else
#include POLARSSL_CONFIG_FILE
#endif
#include <stddef.h>
#if defined(POLARSSL_SHA512_C) && !defined(POLARSSL_ENTROPY_FORCE_SHA256)
#include "sha512.h"
#define POLARSSL_ENTROPY_SHA512_ACCUMULATOR
......
......@@ -24,14 +24,14 @@
#ifndef POLARSSL_ENTROPY_POLL_H
#define POLARSSL_ENTROPY_POLL_H
#include <string.h>
#if !defined(POLARSSL_CONFIG_FILE)
#include "config.h"
#else
#include POLARSSL_CONFIG_FILE
#endif
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
......
......@@ -24,7 +24,7 @@
#ifndef POLARSSL_ERROR_H
#define POLARSSL_ERROR_H
#include <string.h>
#include <stddef.h>
/**
* Error code layout.
......
......@@ -24,7 +24,7 @@
#ifndef POLARSSL_HAVEGE_H
#define POLARSSL_HAVEGE_H
#include <string.h>
#include <stddef.h>
#define COLLECT_SIZE 1024
......
......@@ -26,7 +26,7 @@
#ifndef POLARSSL_MD_H
#define POLARSSL_MD_H
#include <string.h>
#include <stddef.h>
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
......
......@@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>