mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 20:48:19 +00:00
- Fixed to support 4096 bit DHM params as well
This commit is contained in:
parent
98fe5eaf47
commit
520ea911f6
2 changed files with 5 additions and 5 deletions
|
@ -68,7 +68,7 @@ int main( int argc, char *argv[] )
|
|||
int server_fd = -1;
|
||||
|
||||
unsigned char *p, *end;
|
||||
unsigned char buf[1024];
|
||||
unsigned char buf[2048];
|
||||
unsigned char hash[20];
|
||||
char *pers = "dh_client";
|
||||
|
||||
|
@ -179,7 +179,7 @@ int main( int argc, char *argv[] )
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if( dhm.len < 64 || dhm.len > 256 )
|
||||
if( dhm.len < 64 || dhm.len > 512 )
|
||||
{
|
||||
ret = 1;
|
||||
printf( " failed\n ! Invalid DHM modulus size\n\n" );
|
||||
|
@ -218,7 +218,7 @@ int main( int argc, char *argv[] )
|
|||
fflush( stdout );
|
||||
|
||||
n = dhm.len;
|
||||
if( ( ret = dhm_make_public( &dhm, 256, buf, n,
|
||||
if( ( ret = dhm_make_public( &dhm, dhm.len, buf, n,
|
||||
ctr_drbg_random, &ctr_drbg ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n ! dhm_make_public returned %d\n\n", ret );
|
||||
|
|
|
@ -68,7 +68,7 @@ int main( int argc, char *argv[] )
|
|||
int listen_fd = -1;
|
||||
int client_fd = -1;
|
||||
|
||||
unsigned char buf[1024];
|
||||
unsigned char buf[2048];
|
||||
unsigned char hash[20];
|
||||
unsigned char buf2[2];
|
||||
char *pers = "dh_server";
|
||||
|
@ -181,7 +181,7 @@ int main( int argc, char *argv[] )
|
|||
|
||||
memset( buf, 0, sizeof( buf ) );
|
||||
|
||||
if( ( ret = dhm_make_params( &dhm, 256, buf, &n,
|
||||
if( ( ret = dhm_make_params( &dhm, mpi_size( &dhm.P ), buf, &n,
|
||||
ctr_drbg_random, &ctr_drbg ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n ! dhm_make_params returned %d\n\n", ret );
|
||||
|
|
Loading…
Reference in a new issue