@@ -911,9 +911,6 @@ static void ssl_handshake_params_init(mbedtls_ssl_handshake_params *handshake)
911
911
912
912
handshake -> update_checksum = ssl_update_checksum_start ;
913
913
914
- #if defined(MBEDTLS_DHM_C )
915
- mbedtls_dhm_init (& handshake -> dhm_ctx );
916
- #endif
917
914
#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED )
918
915
handshake -> psa_pake_ctx = psa_pake_operation_init ();
919
916
handshake -> psa_pake_password = MBEDTLS_SVC_KEY_ID_INIT ;
@@ -2431,57 +2428,6 @@ psa_status_t mbedtls_ssl_cipher_to_psa(mbedtls_cipher_type_t mbedtls_cipher_type
2431
2428
return PSA_SUCCESS ;
2432
2429
}
2433
2430
2434
- #if defined(MBEDTLS_DHM_C ) && defined(MBEDTLS_SSL_SRV_C )
2435
- int mbedtls_ssl_conf_dh_param_bin (mbedtls_ssl_config * conf ,
2436
- const unsigned char * dhm_P , size_t P_len ,
2437
- const unsigned char * dhm_G , size_t G_len )
2438
- {
2439
- int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED ;
2440
-
2441
- mbedtls_mpi_free (& conf -> dhm_P );
2442
- mbedtls_mpi_free (& conf -> dhm_G );
2443
-
2444
- if ((ret = mbedtls_mpi_read_binary (& conf -> dhm_P , dhm_P , P_len )) != 0 ||
2445
- (ret = mbedtls_mpi_read_binary (& conf -> dhm_G , dhm_G , G_len )) != 0 ) {
2446
- mbedtls_mpi_free (& conf -> dhm_P );
2447
- mbedtls_mpi_free (& conf -> dhm_G );
2448
- return ret ;
2449
- }
2450
-
2451
- return 0 ;
2452
- }
2453
-
2454
- int mbedtls_ssl_conf_dh_param_ctx (mbedtls_ssl_config * conf , mbedtls_dhm_context * dhm_ctx )
2455
- {
2456
- int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED ;
2457
-
2458
- mbedtls_mpi_free (& conf -> dhm_P );
2459
- mbedtls_mpi_free (& conf -> dhm_G );
2460
-
2461
- if ((ret = mbedtls_dhm_get_value (dhm_ctx , MBEDTLS_DHM_PARAM_P ,
2462
- & conf -> dhm_P )) != 0 ||
2463
- (ret = mbedtls_dhm_get_value (dhm_ctx , MBEDTLS_DHM_PARAM_G ,
2464
- & conf -> dhm_G )) != 0 ) {
2465
- mbedtls_mpi_free (& conf -> dhm_P );
2466
- mbedtls_mpi_free (& conf -> dhm_G );
2467
- return ret ;
2468
- }
2469
-
2470
- return 0 ;
2471
- }
2472
- #endif /* MBEDTLS_DHM_C && MBEDTLS_SSL_SRV_C */
2473
-
2474
- #if defined(MBEDTLS_DHM_C ) && defined(MBEDTLS_SSL_CLI_C )
2475
- /*
2476
- * Set the minimum length for Diffie-Hellman parameters
2477
- */
2478
- void mbedtls_ssl_conf_dhm_min_bitlen (mbedtls_ssl_config * conf ,
2479
- unsigned int bitlen )
2480
- {
2481
- conf -> dhm_min_bitlen = bitlen ;
2482
- }
2483
- #endif /* MBEDTLS_DHM_C && MBEDTLS_SSL_CLI_C */
2484
-
2485
2431
#if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED )
2486
2432
#if !defined(MBEDTLS_DEPRECATED_REMOVED ) && defined(MBEDTLS_SSL_PROTO_TLS1_2 )
2487
2433
/*
@@ -4537,10 +4483,6 @@ void mbedtls_ssl_handshake_free(mbedtls_ssl_context *ssl)
4537
4483
psa_hash_abort (& handshake -> fin_sha384_psa );
4538
4484
#endif
4539
4485
4540
- #if defined(MBEDTLS_DHM_C )
4541
- mbedtls_dhm_free (& handshake -> dhm_ctx );
4542
- #endif
4543
-
4544
4486
#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED )
4545
4487
psa_pake_abort (& handshake -> psa_pake_ctx );
4546
4488
/*
@@ -5551,10 +5493,6 @@ static int ssl_check_no_sig_alg_duplication(const uint16_t *sig_algs)
5551
5493
int mbedtls_ssl_config_defaults (mbedtls_ssl_config * conf ,
5552
5494
int endpoint , int transport , int preset )
5553
5495
{
5554
- #if defined(MBEDTLS_DHM_C ) && defined(MBEDTLS_SSL_SRV_C )
5555
- int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED ;
5556
- #endif
5557
-
5558
5496
#if defined(MBEDTLS_DEBUG_C ) && defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED )
5559
5497
if (ssl_check_no_sig_alg_duplication (ssl_preset_suiteb_sig_algs )) {
5560
5498
mbedtls_printf ("ssl_preset_suiteb_sig_algs has duplicated entries\n" );
@@ -5629,21 +5567,6 @@ int mbedtls_ssl_config_defaults(mbedtls_ssl_config *conf,
5629
5567
memset (conf -> renego_period + 2 , 0xFF , 6 );
5630
5568
#endif
5631
5569
5632
- #if defined(MBEDTLS_DHM_C ) && defined(MBEDTLS_SSL_SRV_C )
5633
- if (endpoint == MBEDTLS_SSL_IS_SERVER ) {
5634
- const unsigned char dhm_p [] =
5635
- MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN ;
5636
- const unsigned char dhm_g [] =
5637
- MBEDTLS_DHM_RFC3526_MODP_2048_G_BIN ;
5638
-
5639
- if ((ret = mbedtls_ssl_conf_dh_param_bin (conf ,
5640
- dhm_p , sizeof (dhm_p ),
5641
- dhm_g , sizeof (dhm_g ))) != 0 ) {
5642
- return ret ;
5643
- }
5644
- }
5645
- #endif
5646
-
5647
5570
#if defined(MBEDTLS_SSL_PROTO_TLS1_3 )
5648
5571
5649
5572
#if defined(MBEDTLS_SSL_EARLY_DATA )
@@ -5733,10 +5656,6 @@ int mbedtls_ssl_config_defaults(mbedtls_ssl_config *conf,
5733
5656
#endif /* MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED */
5734
5657
5735
5658
conf -> group_list = ssl_preset_default_groups ;
5736
-
5737
- #if defined(MBEDTLS_DHM_C ) && defined(MBEDTLS_SSL_CLI_C )
5738
- conf -> dhm_min_bitlen = 1024 ;
5739
- #endif
5740
5659
}
5741
5660
5742
5661
return 0 ;
@@ -5751,11 +5670,6 @@ void mbedtls_ssl_config_free(mbedtls_ssl_config *conf)
5751
5670
return ;
5752
5671
}
5753
5672
5754
- #if defined(MBEDTLS_DHM_C )
5755
- mbedtls_mpi_free (& conf -> dhm_P );
5756
- mbedtls_mpi_free (& conf -> dhm_G );
5757
- #endif
5758
-
5759
5673
#if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED )
5760
5674
if (!mbedtls_svc_key_id_is_null (conf -> psk_opaque )) {
5761
5675
conf -> psk_opaque = MBEDTLS_SVC_KEY_ID_INIT ;
0 commit comments