mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Avoid in-out length in dhm_calc_secret()
This commit is contained in:
@ -344,14 +344,14 @@ cleanup:
|
||||
* Derive and export the shared secret (G^Y)^X mod P
|
||||
*/
|
||||
int mbedtls_dhm_calc_secret( mbedtls_dhm_context *ctx,
|
||||
unsigned char *output, size_t *olen,
|
||||
unsigned char *output, size_t output_size, size_t *olen,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng )
|
||||
{
|
||||
int ret;
|
||||
mbedtls_mpi GYb;
|
||||
|
||||
if( ctx == NULL || *olen < ctx->len )
|
||||
if( ctx == NULL || output_size < ctx->len )
|
||||
return( MBEDTLS_ERR_DHM_BAD_INPUT_DATA );
|
||||
|
||||
if( ( ret = dhm_check_range( &ctx->GY, &ctx->P ) ) != 0 )
|
||||
|
Reference in New Issue
Block a user