cleanup library and some basic tests. Includes, add guards to includes

This commit is contained in:
Rich Evans 2015-02-06 13:43:58 +00:00
parent e83ac1d7d1
commit 00ab47026b
100 changed files with 284 additions and 192 deletions

View file

@ -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>

View file

@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#if !defined(POLARSSL_ARC4_ALT)
// Regular implementation

View file

@ -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
* \{

View file

@ -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. */

View file

@ -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

View file

@ -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>

View file

@ -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>

View file

@ -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,8 +43,6 @@
#define POLARSSL_CIPHER_MODE_WITH_PADDING
#endif
#include <string.h>
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else

View file

@ -31,6 +31,7 @@
#else
#include POLARSSL_CONFIG_FILE
#endif
#include "cipher.h"
#ifdef __cplusplus

View file

@ -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. */

View file

@ -29,7 +29,9 @@
#else
#include POLARSSL_CONFIG_FILE
#endif
#include "ssl.h"
#if defined(POLARSSL_ECP_C)
#include "ecp.h"
#endif

View file

@ -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>

View file

@ -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

View file

@ -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

View file

@ -24,7 +24,7 @@
#ifndef POLARSSL_ERROR_H
#define POLARSSL_ERROR_H
#include <string.h>
#include <stddef.h>
/**
* Error code layout.

View file

@ -24,7 +24,7 @@
#ifndef POLARSSL_HAVEGE_H
#define POLARSSL_HAVEGE_H
#include <string.h>
#include <stddef.h>
#define COLLECT_SIZE 1024

View file

@ -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

View file

@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#define POLARSSL_ERR_MD2_FILE_IO_ERROR -0x0070 /**< Read/write error in file. */

View file

@ -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>

View file

@ -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>

View file

@ -31,6 +31,7 @@
#else
#include POLARSSL_CONFIG_FILE
#endif
#include "md.h"
#ifdef __cplusplus

View file

@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <stdlib.h>
#include <stddef.h>
/**
* \name SECTION: Module settings

View file

@ -24,7 +24,7 @@
#ifndef POLARSSL_NET_H
#define POLARSSL_NET_H
#include <string.h>
#include <stddef.h>
#define POLARSSL_ERR_NET_UNKNOWN_HOST -0x0056 /**< Failed to get an IP address for the given hostname. */
#define POLARSSL_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */

View file

@ -24,14 +24,17 @@
#ifndef POLARSSL_OID_H
#define POLARSSL_OID_H
#include <string.h>
#if !defined(POLARSSL_CONFIG_FILE)
#include "config.h"
#else
#include POLARSSL_CONFIG_FILE
#endif
#include "asn1.h"
#include "pk.h"
#include <stddef.h>
#if defined(POLARSSL_CIPHER_C)
#include "cipher.h"
#endif

View file

@ -42,7 +42,6 @@ typedef INT32 int32_t;
#include <inttypes.h>
#endif
#define PADLOCK_RNG 0x000C
#define PADLOCK_ACE 0x00C0
#define PADLOCK_PHE 0x0C00

View file

@ -27,10 +27,10 @@
#ifndef POLARSSL_PBKDF2_H
#define POLARSSL_PBKDF2_H
#include <string.h>
#include "md.h"
#include <stddef.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;

View file

@ -24,7 +24,7 @@
#ifndef POLARSSL_PEM_H
#define POLARSSL_PEM_H
#include <string.h>
#include <stddef.h>
/**
* \name PEM Error codes

View file

@ -24,12 +24,12 @@
#ifndef POLARSSL_PKCS12_H
#define POLARSSL_PKCS12_H
#include <string.h>
#include "md.h"
#include "cipher.h"
#include "asn1.h"
#include <stddef.h>
#define POLARSSL_ERR_PKCS12_BAD_INPUT_DATA -0x1F80 /**< Bad input parameters to function. */
#define POLARSSL_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00 /**< Feature not available, e.g. unsupported encryption scheme. */
#define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80 /**< PBE ASN.1 data not as expected. */

View file

@ -26,11 +26,11 @@
#ifndef POLARSSL_PKCS5_H
#define POLARSSL_PKCS5_H
#include <string.h>
#include "asn1.h"
#include "md.h"
#include <stddef.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;

View file

@ -35,8 +35,6 @@
#define POLARSSL_PLATFORM_MEMORY
#endif
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -50,6 +48,7 @@ extern "C" {
*/
#if !defined(POLARSSL_PLATFORM_NO_STD_FUNCTIONS)
#include <stdio.h>
#include <stdlib.h>
#if !defined(POLARSSL_PLATFORM_STD_PRINTF)
#define POLARSSL_PLATFORM_STD_PRINTF printf /**< Default printf to use */
@ -88,10 +87,10 @@ extern void (*polarssl_free)( void *ptr );
*/
int platform_set_malloc_free( void * (*malloc_func)( size_t ),
void (*free_func)( void * ) );
#else /* POLARSSL_PLATFORM_ENTROPY */
#else /* !POLARSSL_PLATFORM_MEMORY */
#define polarssl_malloc malloc
#define polarssl_free free
#endif /* POLARSSL_PLATFORM_ENTROPY */
#endif /* POLARSSL_PLATFORM_MEMORY */
/*
* The function pointers for printf

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -30,7 +30,7 @@
#include POLARSSL_CONFIG_FILE
#endif
#include <string.h>
#include <stddef.h>
#if defined(_MSC_VER) || defined(__WATCOMC__)
#define UL64(x) x##ui64

View file

@ -31,7 +31,6 @@
#endif
#include "x509.h"
#include "x509_crl.h"
/**

View file

@ -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>