mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-05 14:09:15 +01:00
cleanup programs
Clean up the contents of programs, add more guards to includes, move all defines to the top of the top of files, remove some unused includes
This commit is contained in:
parent
3cfb34564f
commit
18b78c7498
48 changed files with 801 additions and 603 deletions
|
|
@ -29,12 +29,14 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_AES_C) && defined(POLARSSL_DHM_C) &&\
|
||||
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_NET_C) &&\
|
||||
defined(POLARSSL_RSA_C) && defined(POLARSSL_SHA256_C) &&\
|
||||
defined(POLARSSL_FS_IO) && defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/net.h"
|
||||
#include "polarssl/aes.h"
|
||||
#include "polarssl/dhm.h"
|
||||
|
|
@ -43,6 +45,10 @@
|
|||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#define SERVER_NAME "localhost"
|
||||
#define SERVER_PORT 11999
|
||||
|
||||
|
|
|
|||
|
|
@ -29,16 +29,21 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_ENTROPY_C) &&\
|
||||
defined(POLARSSL_FS_IO) && defined(POLARSSL_CTR_DRBG_C) &&\
|
||||
defined(POLARSSL_GENPRIME)
|
||||
#include "polarssl/bignum.h"
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Note: G = 4 is always a quadratic residue mod P,
|
||||
* so it is a generator of order Q (with P = 2*Q+1).
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_AES_C) && defined(POLARSSL_DHM_C) &&\
|
||||
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_NET_C) &&\
|
||||
defined(POLARSSL_RSA_C) && defined(POLARSSL_SHA256_C) &&\
|
||||
defined(POLARSSL_FS_IO) && defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/net.h"
|
||||
#include "polarssl/aes.h"
|
||||
#include "polarssl/dhm.h"
|
||||
|
|
@ -43,6 +45,10 @@
|
|||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#define SERVER_PORT 11999
|
||||
#define PLAINTEXT "==Hello there!=="
|
||||
|
||||
|
|
|
|||
|
|
@ -29,15 +29,18 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_ECDSA_C) &&\
|
||||
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
#include "polarssl/ecdsa.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Uncomment to show key and signature details
|
||||
|
|
@ -65,7 +68,6 @@ int main( int argc, char *argv[] )
|
|||
return( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
#if defined(VERBOSE)
|
||||
static void dump_buf( const char *title, unsigned char *buf, size_t len )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,17 +29,12 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if !defined(_WIN32) && defined(POLARSSL_FS_IO)
|
||||
#include <unistd.h>
|
||||
#endif /* !_WIN32 && POLARSSL_FS_IO */
|
||||
|
||||
#if defined(POLARSSL_PK_WRITE_C) && defined(POLARSSL_FS_IO) &&\
|
||||
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/pk.h"
|
||||
#include "polarssl/ecdsa.h"
|
||||
|
|
@ -48,49 +43,12 @@
|
|||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#if !defined(POLARSSL_PK_WRITE_C) || !defined(POLARSSL_FS_IO) || \
|
||||
!defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
((void) argc);
|
||||
((void) argv);
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
polarssl_printf( "POLARSSL_PK_WRITE_C and/or POLARSSL_FS_IO and/or "
|
||||
"POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C "
|
||||
"not defined.\n" );
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
#define FORMAT_PEM 0
|
||||
#define FORMAT_DER 1
|
||||
|
||||
#define DFL_TYPE POLARSSL_PK_RSA
|
||||
#define DFL_RSA_KEYSIZE 4096
|
||||
#define DFL_FILENAME "keyfile.key"
|
||||
#define DFL_FORMAT FORMAT_PEM
|
||||
#define DFL_USE_DEV_RANDOM 0
|
||||
|
||||
#if defined(POLARSSL_ECP_C)
|
||||
#define DFL_EC_CURVE ecp_curve_list()->grp_id
|
||||
#else
|
||||
#define DFL_EC_CURVE 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* global options
|
||||
*/
|
||||
struct options
|
||||
{
|
||||
int type; /* the type of key to generate */
|
||||
int rsa_keysize; /* length of key in bits */
|
||||
int ec_curve; /* curve identifier for EC keys */
|
||||
const char *filename; /* filename of the key file */
|
||||
int format; /* the output format to use */
|
||||
int use_dev_random; /* use /dev/random as entropy source */
|
||||
} opt;
|
||||
|
||||
#if !defined(_WIN32) && defined(POLARSSL_FS_IO)
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
|
||||
#define DEV_RANDOM_THRESHOLD 32
|
||||
|
||||
|
|
@ -127,8 +85,68 @@ int dev_random_entropy_poll( void *data, unsigned char *output,
|
|||
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* !_WIN32 */
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_ECP_C)
|
||||
#define DFL_EC_CURVE ecp_curve_list()->grp_id
|
||||
#else
|
||||
#define DFL_EC_CURVE 0
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && defined(POLARSSL_FS_IO)
|
||||
#define USAGE_DEV_RANDOM \
|
||||
" use_dev_random=0|1 default: 0\n"
|
||||
#else
|
||||
#define USAGE_DEV_RANDOM ""
|
||||
#endif /* !_WIN32 && POLARSSL_FS_IO */
|
||||
|
||||
#define FORMAT_PEM 0
|
||||
#define FORMAT_DER 1
|
||||
|
||||
#define DFL_TYPE POLARSSL_PK_RSA
|
||||
#define DFL_RSA_KEYSIZE 4096
|
||||
#define DFL_FILENAME "keyfile.key"
|
||||
#define DFL_FORMAT FORMAT_PEM
|
||||
#define DFL_USE_DEV_RANDOM 0
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: gen_key param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" type=rsa|ec default: rsa\n" \
|
||||
" rsa_keysize=%%d default: 4096\n" \
|
||||
" ec_curve=%%s see below\n" \
|
||||
" filename=%%s default: keyfile.key\n" \
|
||||
" format=pem|der default: pem\n" \
|
||||
USAGE_DEV_RANDOM \
|
||||
"\n"
|
||||
|
||||
#if !defined(POLARSSL_PK_WRITE_C) || !defined(POLARSSL_FS_IO) || \
|
||||
!defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_CTR_DRBG_C)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
((void) argc);
|
||||
((void) argv);
|
||||
|
||||
polarssl_printf( "POLARSSL_PK_WRITE_C and/or POLARSSL_FS_IO and/or "
|
||||
"POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C "
|
||||
"not defined.\n" );
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* global options
|
||||
*/
|
||||
struct options
|
||||
{
|
||||
int type; /* the type of key to generate */
|
||||
int rsa_keysize; /* length of key in bits */
|
||||
int ec_curve; /* curve identifier for EC keys */
|
||||
const char *filename; /* filename of the key file */
|
||||
int format; /* the output format to use */
|
||||
int use_dev_random; /* use /dev/random as entropy source */
|
||||
} opt;
|
||||
|
||||
static int write_private_key( pk_context *key, const char *output_file )
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -168,24 +186,6 @@ static int write_private_key( pk_context *key, const char *output_file )
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) && defined(POLARSSL_FS_IO)
|
||||
#define USAGE_DEV_RANDOM \
|
||||
" use_dev_random=0|1 default: 0\n"
|
||||
#else
|
||||
#define USAGE_DEV_RANDOM ""
|
||||
#endif /* !_WIN32 && POLARSSL_FS_IO */
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: gen_key param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" type=rsa|ec default: rsa\n" \
|
||||
" rsa_keysize=%%d default: 4096\n" \
|
||||
" ec_curve=%%s see below\n" \
|
||||
" filename=%%s default: keyfile.key\n" \
|
||||
" format=pem|der default: pem\n" \
|
||||
USAGE_DEV_RANDOM \
|
||||
"\n"
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
|||
|
|
@ -29,17 +29,39 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) &&\
|
||||
defined(POLARSSL_PK_PARSE_C) && defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/rsa.h"
|
||||
#include "polarssl/x509.h"
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#define MODE_NONE 0
|
||||
#define MODE_PRIVATE 1
|
||||
#define MODE_PUBLIC 2
|
||||
|
||||
#define DFL_MODE MODE_NONE
|
||||
#define DFL_FILENAME "keyfile.key"
|
||||
#define DFL_PASSWORD ""
|
||||
#define DFL_PASSWORD_FILE ""
|
||||
#define DFL_DEBUG_LEVEL 0
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: key_app param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" mode=private|public default: none\n" \
|
||||
" filename=%%s default: keyfile.key\n" \
|
||||
" password=%%s default: \"\"\n" \
|
||||
" password_file=%%s default: \"\"\n" \
|
||||
"\n"
|
||||
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || \
|
||||
!defined(POLARSSL_PK_PARSE_C) || !defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
|
|
@ -52,17 +74,6 @@ int main( int argc, char *argv[] )
|
|||
return( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
#define MODE_NONE 0
|
||||
#define MODE_PRIVATE 1
|
||||
#define MODE_PUBLIC 2
|
||||
|
||||
#define DFL_MODE MODE_NONE
|
||||
#define DFL_FILENAME "keyfile.key"
|
||||
#define DFL_PASSWORD ""
|
||||
#define DFL_PASSWORD_FILE ""
|
||||
#define DFL_DEBUG_LEVEL 0
|
||||
|
||||
/*
|
||||
* global options
|
||||
*/
|
||||
|
|
@ -74,15 +85,6 @@ struct options
|
|||
const char *password_file; /* password_file for the private key */
|
||||
} opt;
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: key_app param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" mode=private|public default: none\n" \
|
||||
" filename=%%s default: keyfile.key\n" \
|
||||
" password=%%s default: \"\"\n" \
|
||||
" password_file=%%s default: \"\"\n" \
|
||||
"\n"
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
|||
|
|
@ -29,27 +29,41 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_PK_WRITE_C) && defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/pk.h"
|
||||
#include "polarssl/error.h"
|
||||
|
||||
#if !defined(POLARSSL_PK_WRITE_C) || !defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
((void) argc);
|
||||
((void) argv);
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
polarssl_printf( "POLARSSL_PK_WRITE_C and/or POLARSSL_FS_IO not defined.\n" );
|
||||
return( 0 );
|
||||
}
|
||||
#if defined(POLARSSL_PEM_WRITE_C)
|
||||
#define USAGE_OUT \
|
||||
" output_file=%%s default: keyfile.pem\n" \
|
||||
" output_format=pem|der default: pem\n"
|
||||
#else
|
||||
#define USAGE_OUT \
|
||||
" output_file=%%s default: keyfile.der\n" \
|
||||
" output_format=der default: der\n"
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PEM_WRITE_C)
|
||||
#define DFL_OUTPUT_FILENAME "keyfile.pem"
|
||||
#define DFL_OUTPUT_FORMAT OUTPUT_FORMAT_PEM
|
||||
#else
|
||||
#define DFL_OUTPUT_FILENAME "keyfile.der"
|
||||
#define DFL_OUTPUT_FORMAT OUTPUT_FORMAT_DER
|
||||
#endif
|
||||
|
||||
#define DFL_MODE MODE_NONE
|
||||
#define DFL_FILENAME "keyfile.key"
|
||||
#define DFL_DEBUG_LEVEL 0
|
||||
#define DFL_OUTPUT_MODE OUTPUT_MODE_NONE
|
||||
|
||||
#define MODE_NONE 0
|
||||
#define MODE_PRIVATE 1
|
||||
|
|
@ -62,18 +76,25 @@ int main( int argc, char *argv[] )
|
|||
#define OUTPUT_FORMAT_PEM 0
|
||||
#define OUTPUT_FORMAT_DER 1
|
||||
|
||||
#define DFL_MODE MODE_NONE
|
||||
#define DFL_FILENAME "keyfile.key"
|
||||
#define DFL_DEBUG_LEVEL 0
|
||||
#define DFL_OUTPUT_MODE OUTPUT_MODE_NONE
|
||||
#if defined(POLARSSL_PEM_WRITE_C)
|
||||
#define DFL_OUTPUT_FILENAME "keyfile.pem"
|
||||
#define DFL_OUTPUT_FORMAT OUTPUT_FORMAT_PEM
|
||||
#else
|
||||
#define DFL_OUTPUT_FILENAME "keyfile.der"
|
||||
#define DFL_OUTPUT_FORMAT OUTPUT_FORMAT_DER
|
||||
#endif
|
||||
#define USAGE \
|
||||
"\n usage: key_app param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" mode=private|public default: none\n" \
|
||||
" filename=%%s default: keyfile.key\n" \
|
||||
" output_mode=private|public default: none\n" \
|
||||
USAGE_OUT \
|
||||
"\n"
|
||||
|
||||
#if !defined(POLARSSL_PK_WRITE_C) || !defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
((void) argc);
|
||||
((void) argv);
|
||||
|
||||
polarssl_printf( "POLARSSL_PK_WRITE_C and/or POLARSSL_FS_IO not defined.\n" );
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* global options
|
||||
*/
|
||||
|
|
@ -170,25 +191,6 @@ static int write_private_key( pk_context *key, const char *output_file )
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_PEM_WRITE_C)
|
||||
#define USAGE_OUT \
|
||||
" output_file=%%s default: keyfile.pem\n" \
|
||||
" output_format=pem|der default: pem\n"
|
||||
#else
|
||||
#define USAGE_OUT \
|
||||
" output_file=%%s default: keyfile.der\n" \
|
||||
" output_format=der default: der\n"
|
||||
#endif
|
||||
|
||||
#define USAGE \
|
||||
"\n usage: key_app param=<>...\n" \
|
||||
"\n acceptable parameters:\n" \
|
||||
" mode=private|public default: none\n" \
|
||||
" filename=%%s default: keyfile.key\n" \
|
||||
" output_mode=private|public default: none\n" \
|
||||
USAGE_OUT \
|
||||
"\n"
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
|||
|
|
@ -29,13 +29,16 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/bignum.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,17 +29,23 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_PK_PARSE_C) &&\
|
||||
defined(POLARSSL_FS_IO) && defined(POLARSSL_ENTROPY_C) &&\
|
||||
defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/pk.h"
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_PK_PARSE_C) || \
|
||||
!defined(POLARSSL_FS_IO) || !defined(POLARSSL_ENTROPY_C) || \
|
||||
!defined(POLARSSL_CTR_DRBG_C)
|
||||
|
|
|
|||
|
|
@ -29,18 +29,23 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#define polarssl_printf printf
|
||||
#include <stdio.h>
|
||||
#define polarssl_fprintf fprintf
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_PK_PARSE_C) &&\
|
||||
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_FS_IO) &&\
|
||||
defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/pk.h"
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_PK_PARSE_C) || \
|
||||
!defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_FS_IO) || \
|
||||
!defined(POLARSSL_CTR_DRBG_C)
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_ENTROPY_C) &&\
|
||||
defined(POLARSSL_SHA256_C) &&\
|
||||
defined(POLARSSL_PK_PARSE_C) && defined(POLARSSL_FS_IO) &&\
|
||||
defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
|
@ -42,6 +44,10 @@
|
|||
#include "polarssl/pk.h"
|
||||
#include "polarssl/sha1.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER && !defined snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,17 +29,22 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) &&\
|
||||
defined(POLARSSL_SHA256_C) && defined(POLARSSL_PK_PARSE_C) &&\
|
||||
defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/md.h"
|
||||
#include "polarssl/pk.h"
|
||||
#include "polarssl/sha1.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER && !defined snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,16 +29,21 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) &&\
|
||||
defined(POLARSSL_FS_IO) && defined(POLARSSL_ENTROPY_C) &&\
|
||||
defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/rsa.h"
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \
|
||||
!defined(POLARSSL_FS_IO) || !defined(POLARSSL_ENTROPY_C) || \
|
||||
!defined(POLARSSL_CTR_DRBG_C)
|
||||
|
|
|
|||
|
|
@ -29,17 +29,22 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#define polarssl_printf printf
|
||||
#include <stdio.h>
|
||||
#define polarssl_fprintf fprintf
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) &&\
|
||||
defined(POLARSSL_ENTROPY_C) && defined(POLARSSL_FS_IO) &&\
|
||||
defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/rsa.h"
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \
|
||||
!defined(POLARSSL_ENTROPY_C) || !defined(POLARSSL_FS_IO) || \
|
||||
!defined(POLARSSL_CTR_DRBG_C)
|
||||
|
|
|
|||
|
|
@ -29,17 +29,22 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_ENTROPY_C) &&\
|
||||
defined(POLARSSL_RSA_C) && defined(POLARSSL_GENPRIME) &&\
|
||||
defined(POLARSSL_FS_IO) && defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
#include "polarssl/bignum.h"
|
||||
#include "polarssl/x509.h"
|
||||
#include "polarssl/rsa.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#define KEY_SIZE 1024
|
||||
#define EXPONENT 65537
|
||||
|
|
|
|||
|
|
@ -29,16 +29,20 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#define polarssl_printf printf
|
||||
#include <stdio.h>
|
||||
#define polarssl_fprintf fprintf
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) &&\
|
||||
defined(POLARSSL_SHA256_C) && defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/rsa.h"
|
||||
#include "polarssl/sha1.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \
|
||||
!defined(POLARSSL_SHA256_C) || !defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_ENTROPY_C) &&\
|
||||
defined(POLARSSL_RSA_C) && defined(POLARSSL_SHA256_C) &&\
|
||||
defined(POLARSSL_PK_PARSE_C) && defined(POLARSSL_FS_IO) &&\
|
||||
defined(POLARSSL_CTR_DRBG_C)
|
||||
#include "polarssl/entropy.h"
|
||||
#include "polarssl/ctr_drbg.h"
|
||||
#include "polarssl/md.h"
|
||||
|
|
@ -42,6 +44,10 @@
|
|||
#include "polarssl/sha1.h"
|
||||
#include "polarssl/x509.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER && !defined snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,15 +29,19 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) &&\
|
||||
defined(POLARSSL_SHA256_C) && defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/rsa.h"
|
||||
#include "polarssl/sha1.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) || \
|
||||
!defined(POLARSSL_SHA256_C) || !defined(POLARSSL_FS_IO)
|
||||
int main( int argc, char *argv[] )
|
||||
|
|
|
|||
|
|
@ -29,18 +29,23 @@
|
|||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define polarssl_printf printf
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_BIGNUM_C) && defined(POLARSSL_RSA_C) &&\
|
||||
defined(POLARSSL_SHA256_C) && defined(POLARSSL_PK_PARSE_C) &&\
|
||||
defined(POLARSSL_FS_IO)
|
||||
#include "polarssl/md.h"
|
||||
#include "polarssl/pem.h"
|
||||
#include "polarssl/pk.h"
|
||||
#include "polarssl/sha1.h"
|
||||
#include "polarssl/x509.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER && !defined snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue