Commit 407a0da1 authored by Paul Bakker's avatar Paul Bakker
Browse files

Moved __cplusplus extern statement to include struct definitions as well.

parent c5a79cca
......@@ -48,6 +48,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief AES context structure
*/
......@@ -59,10 +63,6 @@ typedef struct
}
aes_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief AES key schedule (encryption)
*
......
......@@ -35,6 +35,10 @@
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief ARC4 context structure
*/
......@@ -46,10 +50,6 @@ typedef struct
}
arc4_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief ARC4 key schedule
*
......
......@@ -3,7 +3,7 @@
*
* \brief Generic ASN.1 parsing
*
* Copyright (C) 2006-2011, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......
......@@ -3,7 +3,7 @@
*
* \brief ASN.1 buffer writing functionality
*
* Copyright (C) 2006-2012, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -31,6 +31,10 @@
#define ASN1_CHK_ADD(g, f) if( ( ret = f ) < 0 ) return( ret ); else g += ret
#ifdef __cplusplus
extern "C" {
#endif
int asn1_write_len( unsigned char **p, unsigned char *start, size_t len );
int asn1_write_tag( unsigned char **p, unsigned char *start, unsigned char tag );
#if defined(POLARSSL_BIGNUM_C)
......@@ -45,4 +49,8 @@ int asn1_write_printable_string( unsigned char **p, unsigned char *start,
int asn1_write_ia5_string( unsigned char **p, unsigned char *start,
char *text );
#ifdef __cplusplus
}
#endif
#endif /* POLARSSL_ASN1_WRITE_H */
......@@ -158,6 +158,10 @@ typedef uint32_t t_udbl;
#endif /* POLARSSL_HAVE_INT16 */
#endif /* POLARSSL_HAVE_INT8 */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MPI structure
*/
......@@ -169,10 +173,6 @@ typedef struct
}
mpi;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Initialize one MPI
*
......
......@@ -52,6 +52,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Blowfish context structure
*/
......@@ -62,10 +66,6 @@ typedef struct
}
blowfish_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Blowfish key schedule
*
......
......@@ -48,6 +48,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief CAMELLIA context structure
*/
......@@ -58,10 +62,6 @@ typedef struct
}
camellia_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief CAMELLIA key schedule (encryption)
*
......
......@@ -46,6 +46,10 @@
#define POLARSSL_ERR_CIPHER_INVALID_PADDING -0x6200 /**< Input data contains invalid padding and is rejected. */
#define POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED -0x6280 /**< Decryption of block requires a full block. */
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
POLARSSL_CIPHER_ID_NONE = 0,
POLARSSL_CIPHER_ID_NULL,
......@@ -207,10 +211,6 @@ typedef struct {
void *cipher_ctx;
} cipher_context_t;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Returns the list of ciphers supported by the generic cipher module.
*
......
......@@ -49,6 +49,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief DES context structure
*/
......@@ -69,10 +73,6 @@ typedef struct
}
des3_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Set key parity on the given key to odd.
*
......
......@@ -3,7 +3,7 @@
*
* \brief Diffie-Hellman-Merkle key exchange
*
* Copyright (C) 2006-2010, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -130,6 +130,10 @@
"EDFE72FE9B6AA4BD7B5A0F1C71CFFF4C19C418E1F6EC0179"\
"81BC087F2A7065B384B890D3191F2BFA"
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief DHM context structure
*/
......@@ -146,10 +150,6 @@ typedef struct
}
dhm_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Parse the ServerKeyExchange parameters
*
......
......@@ -29,6 +29,10 @@
#include "polarssl/ecp.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief ECDH context structure
*/
......@@ -43,10 +47,6 @@ typedef struct
}
ecdh_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Generate a public key
*
......
......@@ -36,6 +36,10 @@
#define POLARSSL_ERR_ECP_BUFFER_TOO_SMALL -0x4F80 /**< The buffer is too small to write to. */
#define POLARSSL_ERR_ECP_GENERIC -0x4F00 /**< Generic ECP error */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief ECP point structure (jacobian coordinates)
*
......@@ -134,11 +138,6 @@ ecp_group;
*/
#define POLARSSL_ECP_TLS_NAMED_CURVE 3 /**< ECCurveType's named_curve */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Initialize a point (as zero)
*/
......
......@@ -3,7 +3,7 @@
*
* \brief Galois/Counter mode for AES
*
* Copyright (C) 2006-2012, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -42,6 +42,10 @@ typedef UINT64 uint64_t;
#define POLARSSL_ERR_GCM_AUTH_FAILED -0x0012 /**< Authenticated decryption failed. */
#define POLARSSL_ERR_GCM_BAD_INPUT -0x0014 /**< Bad input parameters to function. */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief GCM context structure
*/
......@@ -58,10 +62,6 @@ typedef struct {
}
gcm_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief GCM initialization (encryption)
*
......
......@@ -3,7 +3,7 @@
*
* \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion
*
* Copyright (C) 2006-2010, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -31,6 +31,10 @@
#define COLLECT_SIZE 1024
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief HAVEGE state structure
*/
......@@ -42,10 +46,6 @@ typedef struct
}
havege_state;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief HAVEGE initialization
*
......
......@@ -5,7 +5,7 @@
*
* \author Adriaan de Jong <dejong@fox-it.com>
*
* Copyright (C) 2006-2011, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -44,6 +44,10 @@
#define POLARSSL_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */
#define POLARSSL_ERR_MD_FILE_IO_ERROR -0x5200 /**< Opening or reading of file failed. */
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
POLARSSL_MD_NONE=0,
POLARSSL_MD_MD2,
......@@ -131,10 +135,6 @@ typedef struct {
NULL, /* md_ctx */ \
}
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Returns the list of digests supported by the generic digest module.
*
......
......@@ -37,6 +37,10 @@
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MD2 context structure
*/
......@@ -52,10 +56,6 @@ typedef struct
}
md2_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MD2 context setup
*
......
......@@ -44,6 +44,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MD4 context structure
*/
......@@ -58,10 +62,6 @@ typedef struct
}
md4_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MD4 context setup
*
......
......@@ -44,6 +44,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MD5 context structure
*/
......@@ -58,10 +62,6 @@ typedef struct
}
md5_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MD5 context setup
*
......
......@@ -46,6 +46,10 @@
#define POLARSSL_ERR_PEM_BAD_INPUT_DATA -0x1480 /**< Bad input parameters to function. */
/* \} name */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief PEM context structure
*/
......@@ -57,10 +61,6 @@ typedef struct
}
pem_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief PEM context setup
*
......
......@@ -5,7 +5,7 @@
*
* \author Adriaan de Jong <dejong@fox-it.com>
*
* Copyright (C) 2006-2011, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -45,6 +45,10 @@
#endif /* __ARMCC_VERSION */
#endif /*_MSC_VER */
#ifdef __cplusplus
extern "C" {
#endif
/**
* Context for PKCS #11 private keys.
*/
......@@ -156,6 +160,10 @@ static inline size_t ssl_pkcs11_key_len( void *ctx )
return ( (pkcs11_context *) ctx )->len;
}
#ifdef __cplusplus
}
#endif
#endif /* POLARSSL_PKCS11_C */
#endif /* POLARSSL_PKCS11_H */
......@@ -3,7 +3,7 @@
*
* \brief The RSA public-key cryptosystem
*
* Copyright (C) 2006-2010, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -59,6 +59,10 @@
#define RSA_SIGN 1
#define RSA_CRYPT 2
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief RSA context structure
*/
......@@ -90,10 +94,6 @@ typedef struct
}
rsa_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Initialize an RSA context
*
......
......@@ -44,6 +44,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-1 context structure
*/
......@@ -58,10 +62,6 @@ typedef struct
}
sha1_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-1 context setup
*
......
......@@ -44,6 +44,10 @@ typedef UINT32 uint32_t;
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-256 context structure
*/
......@@ -59,10 +63,6 @@ typedef struct
}
sha2_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-256 context setup
*
......
......@@ -45,6 +45,10 @@
// Regular implementation
//
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-512 context structure
*/
......@@ -60,10 +64,6 @@ typedef struct
}
sha4_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-512 context setup
*
......
......@@ -254,6 +254,10 @@
#define POLARSSL_PREMASTER_SIZE POLARSSL_MPI_MAX_SIZE
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Generic function pointers for allowing external RSA private key
* implementations.
......@@ -547,10 +551,6 @@ struct _ssl_context
char peer_verify_data[36]; /*!< previous handshake verify data */
};
#ifdef __cplusplus
extern "C" {
#endif
#if defined(POLARSSL_SSL_HW_RECORD_ACCEL)
#define SSL_CHANNEL_OUTBOUND 0
......
......@@ -3,7 +3,7 @@
*
* \brief Portable interface to the CPU cycle counter
*
* Copyright (C) 2006-2010, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -27,6 +27,10 @@
#ifndef POLARSSL_TIMING_H
#define POLARSSL_TIMING_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief timer structure
*/
......@@ -35,10 +39,6 @@ struct hr_time
unsigned char opaque[32];
};
#ifdef __cplusplus
extern "C" {
#endif
extern volatile int alarmed;
/**
......
......@@ -3,7 +3,7 @@
*
* \brief Run-time version information
*
* Copyright (C) 2006-2012, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
......@@ -52,6 +52,10 @@
#if defined(POLARSSL_VERSION_C)
#ifdef __cplusplus
extern "C" {
#endif
/**
* Get the version number.