mbedtls_dhm_get_value parameter order: context first, output last
mbedtls_dhm_get_value can be seen as either a copy function or a getter
function. Given the name and the semantics, it's more of a getter, even if
it "gets" by doing a copy. Therefore, put the context first, and the
selector next, leaving the output for last.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index bef6864..560597d 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -3871,10 +3871,10 @@
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
- if( ( ret = mbedtls_dhm_get_value( &conf->dhm_P, dhm_ctx,
- MBEDTLS_DHM_PARAM_P ) ) != 0 ||
- ( ret = mbedtls_dhm_get_value( &conf->dhm_G, dhm_ctx,
- MBEDTLS_DHM_PARAM_G ) ) != 0 )
+ if( ( ret = mbedtls_dhm_get_value( dhm_ctx, MBEDTLS_DHM_PARAM_P,
+ &conf->dhm_P ) ) != 0 ||
+ ( ret = mbedtls_dhm_get_value( dhm_ctx, MBEDTLS_DHM_PARAM_G,
+ &conf->dhm_G ) ) != 0 )
{
mbedtls_mpi_free( &conf->dhm_P );
mbedtls_mpi_free( &conf->dhm_G );