1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

- Fixed a whole bunch of dependencies on defines between files, examples and tests

This commit is contained in:
Paul Bakker
2011-05-26 13:16:06 +00:00
parent 2c0994e973
commit 5690efccc4
66 changed files with 1408 additions and 701 deletions

View File

@ -2033,6 +2033,7 @@ int mpi_self_test( int verbose )
if( verbose != 0 )
printf( "passed\n" );
#if defined(POLARSSL_GENPRIME)
MPI_CHK( mpi_inv_mod( &X, &A, &N ) );
MPI_CHK( mpi_read_string( &U, 16,
@ -2053,6 +2054,7 @@ int mpi_self_test( int verbose )
if( verbose != 0 )
printf( "passed\n" );
#endif
if( verbose != 0 )
printf( " MPI test #5 (simple gcd): " );

View File

@ -1095,10 +1095,12 @@ int rsa_self_test( int verbose )
{
size_t len;
rsa_context rsa;
unsigned char sha1sum[20];
unsigned char rsa_plaintext[PT_LEN];
unsigned char rsa_decrypted[PT_LEN];
unsigned char rsa_ciphertext[KEY_LEN];
#if defined(POLARSSL_SHA1_C)
unsigned char sha1sum[20];
#endif
rsa_init( &rsa, RSA_PKCS_V15, 0 );
@ -1159,6 +1161,7 @@ int rsa_self_test( int verbose )
return( 1 );
}
#if defined(POLARSSL_SHA1_C)
if( verbose != 0 )
printf( "passed\n PKCS#1 data sign : " );
@ -1187,6 +1190,7 @@ int rsa_self_test( int verbose )
if( verbose != 0 )
printf( "passed\n\n" );
#endif /* POLARSSL_SHA1_C */
rsa_free( &rsa );

View File

@ -322,12 +322,14 @@ static int ssl_parse_server_hello( ssl_context *ssl )
static int ssl_parse_server_key_exchange( ssl_context *ssl )
{
#if defined(POLARSSL_DHM_C)
int ret;
size_t n;
unsigned char *p, *end;
unsigned char hash[36];
md5_context md5;
sha1_context sha1;
#endif
SSL_DEBUG_MSG( 2, ( "=> parse server key exchange" ) );

View File

@ -527,11 +527,13 @@ static int ssl_write_certificate_request( ssl_context *ssl )
static int ssl_write_server_key_exchange( ssl_context *ssl )
{
#if defined(POLARSSL_DHM_C)
int ret;
size_t n, rsa_key_len = 0;
unsigned char hash[36];
md5_context md5;
sha1_context sha1;
#endif
SSL_DEBUG_MSG( 2, ( "=> write server key exchange" ) );

View File

@ -1124,11 +1124,12 @@ static int x509_get_sig_alg( const x509_buf *sig_oid, int *sig_alg )
int x509parse_crt( x509_cert *chain, const unsigned char *buf, size_t buflen )
{
int ret;
size_t len, use_len;
size_t len;
unsigned char *p, *end;
x509_cert *crt;
#if defined(POLARSSL_PEM_C)
pem_context pem;
size_t use_len;
#endif
crt = chain;
@ -1461,10 +1462,11 @@ int x509parse_crt( x509_cert *chain, const unsigned char *buf, size_t buflen )
int x509parse_crl( x509_crl *chain, const unsigned char *buf, size_t buflen )
{
int ret;
size_t len, use_len;
size_t len;
unsigned char *p, *end;
x509_crl *crl;
#if defined(POLARSSL_PEM_C)
size_t use_len;
pem_context pem;
#endif
@ -1893,6 +1895,8 @@ int x509parse_key( rsa_context *rsa, const unsigned char *key, size_t keylen,
p = ( ret == 0 ) ? pem.buf : (unsigned char *) key;
#else
((void) pwd);
((void) pwdlen);
p = (unsigned char *) key;
#endif
end = p + keylen;
@ -3033,14 +3037,16 @@ void x509_crl_free( x509_crl *crl )
*/
int x509_self_test( int verbose )
{
#if defined(POLARSSL_MD5_C)
#if defined(POLARSSL_CERTS_C) && defined(POLARSSL_MD5_C)
int ret;
int flags;
size_t i, j;
x509_cert cacert;
x509_cert clicert;
rsa_context rsa;
#if defined(POLARSSL_DHM_C)
dhm_context dhm;
#endif
if( verbose != 0 )
printf( " X.509 certificate load: " );
@ -3100,6 +3106,7 @@ int x509_self_test( int verbose )
return( ret );
}
#if defined(POLARSSL_DHM_C)
if( verbose != 0 )
printf( "passed\n X.509 DHM parameter load: " );
@ -3116,11 +3123,14 @@ int x509_self_test( int verbose )
if( verbose != 0 )
printf( "passed\n\n" );
#endif
x509_free( &cacert );
x509_free( &clicert );
rsa_free( &rsa );
#if defined(POLARSSL_DHM_C)
dhm_free( &dhm );
#endif
return( 0 );
#else