Commit 9af723ce authored by Paul Bakker's avatar Paul Bakker
Browse files

Fix formatting: remove trailing spaces, #endif with comments (> 10 lines)

parent 525f8755
......@@ -39,15 +39,15 @@
#include <string.h>
/**
/**
* \addtogroup asn1_module
* \{
* \{
*/
/**
* \name ASN1 Error codes
* These error codes are OR'ed to X509 error codes for
* higher error granularity.
* higher error granularity.
* ASN1 is a standard to specify data structures.
* \{
*/
......@@ -274,7 +274,7 @@ int asn1_get_sequence_of( unsigned char **p,
int asn1_get_mpi( unsigned char **p,
const unsigned char *end,
mpi *X );
#endif
#endif /* POLARSSL_BIGNUM_C */
/**
* \brief Retrieve an AlgorithmIdentifier ASN.1 sequence.
......
......@@ -85,7 +85,7 @@ int asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
* \return the length written or a negative error code
*/
int asn1_write_mpi( unsigned char **p, unsigned char *start, mpi *X );
#endif
#endif /* POLARSSL_BIGNUM_C */
/**
* \brief Write a NULL tag (ASN1_NULL) with zero data in ASN.1 format
......
......@@ -51,7 +51,7 @@ typedef UINT32 uint32_t;
typedef UINT64 uint64_t;
#else
#include <inttypes.h>
#endif
#endif /* _MSC_VER && !EFIX64 && !EFI32 */
#define POLARSSL_ERR_MPI_FILE_IO_ERROR -0x0002 /**< An error occurred while reading from or writing to a file. */
#define POLARSSL_ERR_MPI_BAD_INPUT_DATA -0x0004 /**< Bad input parameters to function. */
......@@ -644,7 +644,7 @@ int mpi_mod_int( t_uint *r, const mpi *A, t_sint b );
/**
* \brief Sliding-window exponentiation: X = A^E mod N
*
* \param X Destination MPI
* \param X Destination MPI
* \param A Left-hand MPI
* \param E Exponent MPI
* \param N Modular MPI
......
......@@ -329,7 +329,7 @@
);
#else
#else /* __MACH__ && __APPLE__ */
#define MULADDC_INIT \
asm( \
......@@ -369,7 +369,7 @@
: "r3", "r4", "r5", "r6", "r7", "r8", "r9" \
);
#endif
#endif /* __MACH__ && __APPLE__ */
#else /* PPC32 */
......@@ -413,7 +413,7 @@
: "r3", "r4", "r5", "r6", "r7", "r8", "r9" \
);
#else
#else /* __MACH__ && __APPLE__ */
#define MULADDC_INIT \
asm( \
......@@ -453,7 +453,7 @@
: "r3", "r4", "r5", "r6", "r7", "r8", "r9" \
);
#endif
#endif /* __MACH__ && __APPLE__ */
#endif /* PPC32 */
#endif /* PPC64 */
......
......@@ -72,7 +72,7 @@ camellia_context;
* \param ctx CAMELLIA context to be initialized
* \param key encryption key
* \param keysize must be 128, 192 or 256
*
*
* \return 0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH
*/
int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
......@@ -83,7 +83,7 @@ int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, unsign
* \param ctx CAMELLIA context to be initialized
* \param key decryption key
* \param keysize must be 128, 192 or 256
*
*
* \return 0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH
*/
int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
......@@ -95,7 +95,7 @@ int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, unsign
* \param mode CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT
* \param input 16-byte input block
* \param output 16-byte output block
*
*
* \return 0 if successful
*/
int camellia_crypt_ecb( camellia_context *ctx,
......@@ -115,7 +115,7 @@ int camellia_crypt_ecb( camellia_context *ctx,
* \param iv initialization vector (updated after use)
* \param input buffer holding the input data
* \param output buffer holding the output data
*
*
* \return 0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH
*/
int camellia_crypt_cbc( camellia_context *ctx,
......
/**
* \file cipher.h
*
*
* \brief Generic cipher wrapper.
*
* \author Adriaan de Jong <dejong@fox-it.com>
......
/**
* \file cipher_wrap.h
*
*
* \brief Cipher wrappers.
*
* \author Adriaan de Jong <dejong@fox-it.com>
......
......@@ -171,7 +171,7 @@ static inline int sha4_self_test( int verbose ) {
#warning "rsa_pkcs1_verify() prototype changed. Manual change required if used"
#warning "rsa_pkcs1_decrypt() prototype changed. Manual change required if used"
#endif
#endif
#endif /* POLARSSL_RSA_C */
#if defined(POLARSSL_DHM_C)
#if defined(SHOW_PROTOTYPE_CHANGE_WARNINGS)
......
......@@ -108,7 +108,7 @@ ctr_drbg_context;
/**
* \brief CTR_DRBG initialization
*
*
* Note: Personalization data can be provided in addition to the more generic
* entropy source to make this instantiation as unique as possible.
*
......@@ -163,7 +163,7 @@ void ctr_drbg_set_reseed_interval( ctr_drbg_context *ctx,
/**
* \brief CTR_DRBG reseeding (extracts data from entropy source)
*
*
* \param ctx CTR_DRBG context
* \param additional Additional data to add to state (Can be NULL)
* \param len Length of additional data
......@@ -245,7 +245,7 @@ int ctr_drbg_write_seed_file( ctr_drbg_context *ctx, const char *path );
* POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG
*/
int ctr_drbg_update_seed_file( ctr_drbg_context *ctx, const char *path );
#endif
#endif /* POLARSSL_FS_IO */
/**
* \brief Checkup routine
......
......@@ -81,7 +81,7 @@
debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt );
#endif
#else
#else /* POLARSSL_DEBUG_C */
#define SSL_DEBUG_MSG( level, args ) do { } while( 0 )
#define SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
......@@ -90,7 +90,7 @@
#define SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
#define SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
#endif
#endif /* POLARSSL_DEBUG_C */
#ifdef __cplusplus
extern "C" {
......
......@@ -285,4 +285,4 @@ int dhm_self_test( int verbose );
}
#endif
#endif
#endif /* dhm.h */
......@@ -212,4 +212,4 @@ int ecdh_self_test( int verbose );
}
#endif
#endif
#endif /* ecdh.h */
......@@ -90,7 +90,7 @@ int ecdsa_sign( ecp_group *grp, mpi *r, mpi *s,
int ecdsa_sign_det( ecp_group *grp, mpi *r, mpi *s,
const mpi *d, const unsigned char *buf, size_t blen,
md_type_t md_alg );
#endif
#endif /* POLARSSL_ECDSA_DETERMINISTIC */
/**
* \brief Verify ECDSA signature of a previously hashed message
......@@ -163,7 +163,7 @@ int ecdsa_write_signature_det( ecdsa_context *ctx,
const unsigned char *hash, size_t hlen,
unsigned char *sig, size_t *slen,
md_type_t md_alg );
#endif
#endif /* POLARSSL_ECDSA_DETERMINISTIC */
/**
* \brief Read and verify an ECDSA signature
......@@ -233,4 +233,4 @@ int ecdsa_self_test( int verbose );
}
#endif
#endif
#endif /* ecdsa.h */
......@@ -648,4 +648,4 @@ int ecp_self_test( int verbose );
}
#endif
#endif
#endif /* ecp.h */
......@@ -191,7 +191,7 @@ int entropy_func( void *data, unsigned char *output, size_t len );
/**
* \brief Add data to the accumulator manually
* (Thread-safe if POLARSSL_THREADING_C is enabled)
*
*
* \param ctx Entropy context
* \param data Data to add
* \param len Length of data
......@@ -227,7 +227,7 @@ int entropy_write_seed_file( entropy_context *ctx, const char *path );
* POLARSSL_ERR_ENTROPY_SOURCE_FAILED
*/
int entropy_update_seed_file( entropy_context *ctx, const char *path );
#endif
#endif /* POLARSSL_FS_IO */
#ifdef __cplusplus
}
......
......@@ -265,7 +265,7 @@ int hmac_drbg_write_seed_file( hmac_drbg_context *ctx, const char *path );
* POLARSSL_ERR_HMAC_DRBG_INPUT_TOO_BIG
*/
int hmac_drbg_update_seed_file( hmac_drbg_context *ctx, const char *path );
#endif
#endif /* POLARSSL_FS_IO */
#if defined(POLARSSL_SELF_TEST)
......
/**
* \file md.h
*
*
* \brief Generic message digest wrapper
*
* \author Adriaan de Jong <dejong@fox-it.com>
......
/**
* \file md_wrap.h
*
*
* \brief Message digest wrappers.
*
* \author Adriaan de Jong <dejong@fox-it.com>
......
......@@ -98,7 +98,7 @@ inline rsa_context* d2i_RSA_PUBKEY( void *ignore, unsigned char **bufptr,
memset( rsa, 0, sizeof( rsa_context ) );
if( ( len == 94 &&
if( ( len == 94 &&
mpi_read_binary( &rsa->N, &buffer[ 25], 64 ) == 0 &&
mpi_read_binary( &rsa->E, &buffer[ 91], 3 ) == 0 ) ||
( len == 162 &&
......
......@@ -148,7 +148,7 @@ static inline int ssl_pkcs11_decrypt( void *ctx, int mode, size_t *olen,
output_max_len );
}
static inline int ssl_pkcs11_sign( void *ctx,
static inline int ssl_pkcs11_sign( void *ctx,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
int mode, md_type_t md_alg, unsigned int hashlen,
const unsigned char *hash, unsigned char *sig )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment