Remove test DHM params from certs.c

certs.c belongs to the X.509 library, while DHM belongs to the crypto lib.
This commit is contained in:
Manuel Pégourié-Gonnard 2015-06-25 08:52:25 +02:00
parent 21e1ac205e
commit 53585eeb17
4 changed files with 12 additions and 25 deletions

View file

@ -105,6 +105,7 @@ Removals
(use generic functions from md.h)
* Removed mbedtls_timing_msleep(). Use mbedtls_net_usleep() or a custom
waiting function.
* Removed test DHM parameters from the test certs module.
* Removed the PBKDF2 module (use PKCS5).
* Removed POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()).
* Removed compat-1.2.h (helper for migrating from 1.2 to 1.3).

View file

@ -93,11 +93,6 @@ extern const char mbedtls_test_cli_key_rsa[];
extern const size_t mbedtls_test_cli_key_rsa_len;
#endif
#if defined(MBEDTLS_DHM_C)
extern const char mbedtls_test_dhm_params[];
extern const size_t mbedtls_test_dhm_params_len;
#endif
#ifdef __cplusplus
}
#endif

View file

@ -291,16 +291,6 @@ const size_t mbedtls_test_cli_key_rsa_len = sizeof( mbedtls_test_cli_key_rsa );
#define TEST_CA_CRT_RSA
#endif /* MBEDTLS_RSA_C */
#if defined(MBEDTLS_DHM_C)
const char mbedtls_test_dhm_params[] =
"-----BEGIN DH PARAMETERS-----\r\n"
"MIGHAoGBAJ419DBEOgmQTzo5qXl5fQcN9TN455wkOL7052HzxxRVMyhYmwQcgJvh\r\n"
"1sa18fyfR9OiVEMYglOpkqVoGLN7qd5aQNNi5W7/C+VBdHTBJcGZJyyP5B3qcz32\r\n"
"9mLJKudlVudV0Qxk5qUJaPZ/xupz0NyoVpviuiBOI1gNi8ovSXWzAgEC\r\n"
"-----END DH PARAMETERS-----\r\n";
const size_t mbedtls_test_dhm_params_len = sizeof( mbedtls_test_dhm_params );
#endif
#if defined(MBEDTLS_PEM_PARSE_C)
/* Concatenation of all available CA certificates */
const char mbedtls_test_cas_pem[] = TEST_CA_CRT_RSA TEST_CA_CRT_EC;

View file

@ -578,14 +578,20 @@ int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path )
#if defined(MBEDTLS_SELF_TEST)
#include "mbedtls/certs.h"
static const char mbedtls_test_dhm_params[] =
"-----BEGIN DH PARAMETERS-----\r\n"
"MIGHAoGBAJ419DBEOgmQTzo5qXl5fQcN9TN455wkOL7052HzxxRVMyhYmwQcgJvh\r\n"
"1sa18fyfR9OiVEMYglOpkqVoGLN7qd5aQNNi5W7/C+VBdHTBJcGZJyyP5B3qcz32\r\n"
"9mLJKudlVudV0Qxk5qUJaPZ/xupz0NyoVpviuiBOI1gNi8ovSXWzAgEC\r\n"
"-----END DH PARAMETERS-----\r\n";
static const size_t mbedtls_test_dhm_params_len = sizeof( mbedtls_test_dhm_params );
/*
* Checkup routine
*/
int mbedtls_dhm_self_test( int verbose )
{
#if defined(MBEDTLS_CERTS_C)
int ret;
mbedtls_dhm_context dhm;
@ -594,7 +600,8 @@ int mbedtls_dhm_self_test( int verbose )
if( verbose != 0 )
mbedtls_printf( " DHM parameter load: " );
if( ( ret = mbedtls_dhm_parse_dhm( &dhm, (const unsigned char *) mbedtls_test_dhm_params,
if( ( ret = mbedtls_dhm_parse_dhm( &dhm,
(const unsigned char *) mbedtls_test_dhm_params,
mbedtls_test_dhm_params_len ) ) != 0 )
{
if( verbose != 0 )
@ -611,12 +618,6 @@ exit:
mbedtls_dhm_free( &dhm );
return( ret );
#else
if( verbose != 0 )
mbedtls_printf( " DHM parameter load: skipped\n" );
return( 0 );
#endif /* MBEDTLS_CERTS_C */
}
#endif /* MBEDTLS_SELF_TEST */