mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									21e1ac205e
								
							
						
					
					
						commit
						53585eeb17
					
				@ -105,6 +105,7 @@ Removals
 | 
				
			|||||||
     (use generic functions from md.h)
 | 
					     (use generic functions from md.h)
 | 
				
			||||||
   * Removed mbedtls_timing_msleep(). Use mbedtls_net_usleep() or a custom
 | 
					   * Removed mbedtls_timing_msleep(). Use mbedtls_net_usleep() or a custom
 | 
				
			||||||
     waiting function.
 | 
					     waiting function.
 | 
				
			||||||
 | 
					   * Removed test DHM parameters from the test certs module.
 | 
				
			||||||
   * Removed the PBKDF2 module (use PKCS5).
 | 
					   * Removed the PBKDF2 module (use PKCS5).
 | 
				
			||||||
   * Removed POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()).
 | 
					   * Removed POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()).
 | 
				
			||||||
   * Removed compat-1.2.h (helper for migrating from 1.2 to 1.3).
 | 
					   * Removed compat-1.2.h (helper for migrating from 1.2 to 1.3).
 | 
				
			||||||
 | 
				
			|||||||
@ -93,11 +93,6 @@ extern const char   mbedtls_test_cli_key_rsa[];
 | 
				
			|||||||
extern const size_t mbedtls_test_cli_key_rsa_len;
 | 
					extern const size_t mbedtls_test_cli_key_rsa_len;
 | 
				
			||||||
#endif
 | 
					#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
 | 
					#ifdef __cplusplus
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
@ -291,16 +291,6 @@ const size_t mbedtls_test_cli_key_rsa_len = sizeof( mbedtls_test_cli_key_rsa );
 | 
				
			|||||||
#define TEST_CA_CRT_RSA
 | 
					#define TEST_CA_CRT_RSA
 | 
				
			||||||
#endif /* MBEDTLS_RSA_C */
 | 
					#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)
 | 
					#if defined(MBEDTLS_PEM_PARSE_C)
 | 
				
			||||||
/* Concatenation of all available CA certificates */
 | 
					/* Concatenation of all available CA certificates */
 | 
				
			||||||
const char mbedtls_test_cas_pem[] = TEST_CA_CRT_RSA TEST_CA_CRT_EC;
 | 
					const char mbedtls_test_cas_pem[] = TEST_CA_CRT_RSA TEST_CA_CRT_EC;
 | 
				
			||||||
 | 
				
			|||||||
@ -578,14 +578,20 @@ int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if defined(MBEDTLS_SELF_TEST)
 | 
					#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
 | 
					 * Checkup routine
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
int mbedtls_dhm_self_test( int verbose )
 | 
					int mbedtls_dhm_self_test( int verbose )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if defined(MBEDTLS_CERTS_C)
 | 
					 | 
				
			||||||
    int ret;
 | 
					    int ret;
 | 
				
			||||||
    mbedtls_dhm_context dhm;
 | 
					    mbedtls_dhm_context dhm;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -594,8 +600,9 @@ int mbedtls_dhm_self_test( int verbose )
 | 
				
			|||||||
    if( verbose != 0 )
 | 
					    if( verbose != 0 )
 | 
				
			||||||
        mbedtls_printf( "  DHM parameter load: " );
 | 
					        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,
 | 
				
			||||||
                               mbedtls_test_dhm_params_len ) ) != 0 )
 | 
					                    (const unsigned char *) mbedtls_test_dhm_params,
 | 
				
			||||||
 | 
					                    mbedtls_test_dhm_params_len ) ) != 0 )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if( verbose != 0 )
 | 
					        if( verbose != 0 )
 | 
				
			||||||
            mbedtls_printf( "failed\n" );
 | 
					            mbedtls_printf( "failed\n" );
 | 
				
			||||||
@ -611,12 +618,6 @@ exit:
 | 
				
			|||||||
    mbedtls_dhm_free( &dhm );
 | 
					    mbedtls_dhm_free( &dhm );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return( ret );
 | 
					    return( ret );
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
    if( verbose != 0 )
 | 
					 | 
				
			||||||
        mbedtls_printf( "  DHM parameter load: skipped\n" );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return( 0 );
 | 
					 | 
				
			||||||
#endif /* MBEDTLS_CERTS_C */
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* MBEDTLS_SELF_TEST */
 | 
					#endif /* MBEDTLS_SELF_TEST */
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user