Avoid in-out length in dhm_calc_secret()
diff --git a/library/dhm.c b/library/dhm.c
index 6b4e29f..979fd07 100644
--- a/library/dhm.c
+++ b/library/dhm.c
@@ -344,14 +344,14 @@
* 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 )