From db8915287e183e642254565f9058ace93aabcf8a Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Tue, 16 Jan 2024 13:32:31 +0000 Subject: [PATCH] programs_dh_client/server: Changed mdlen type to unsigned integer. Signed-off-by: Minos Galanakis --- programs/pkey/dh_client.c | 5 +++-- programs/pkey/dh_server.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/programs/pkey/dh_client.c b/programs/pkey/dh_client.c index 1b5ba407e9..e8469141aa 100644 --- a/programs/pkey/dh_client.c +++ b/programs/pkey/dh_client.c @@ -59,7 +59,8 @@ int main(void) int ret = 1; int exit_code = MBEDTLS_EXIT_FAILURE; - size_t n, buflen, mdlen; + unsigned int mdlen; + size_t n, buflen; mbedtls_net_context server_fd; unsigned char *p, *end; @@ -186,7 +187,7 @@ int main(void) goto exit; } - mdlen = mbedtls_md_get_size(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256)); + mdlen = (unsigned int) mbedtls_md_get_size(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256)); if (mdlen == 0) { mbedtls_printf(" failed\n ! Invalid digest type\n\n"); goto exit; diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c index 11c28fb516..c08b0dc396 100644 --- a/programs/pkey/dh_server.c +++ b/programs/pkey/dh_server.c @@ -51,7 +51,8 @@ int main(void) int ret = 1; int exit_code = MBEDTLS_EXIT_FAILURE; - size_t n, buflen, mdlen; + unsigned int mdlen; + size_t n, buflen; mbedtls_net_context listen_fd, client_fd; unsigned char buf[2048]; @@ -185,7 +186,7 @@ int main(void) * 5. Sign the parameters and send them */ - mdlen = mbedtls_md_get_size(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256)); + mdlen = (unsigned int) mbedtls_md_get_size(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256)); if (mdlen == 0) { mbedtls_printf(" failed\n ! Invalid digest type\n\n"); goto exit;