From ee7db9cb6d0746ce36e71cc2d32ef5c302b675ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 31 Aug 2015 11:32:03 +0200 Subject: [PATCH] Fix hash buffer size in pkey programs backport from 102a620 --- programs/pkey/dh_client.c | 2 +- programs/pkey/dh_server.c | 2 +- programs/pkey/pk_sign.c | 2 +- programs/pkey/pk_verify.c | 2 +- programs/pkey/rsa_sign.c | 2 +- programs/pkey/rsa_sign_pss.c | 2 +- programs/pkey/rsa_verify.c | 2 +- programs/pkey/rsa_verify_pss.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/programs/pkey/dh_client.c b/programs/pkey/dh_client.c index a5a137a66..ea63ce7f0 100644 --- a/programs/pkey/dh_client.c +++ b/programs/pkey/dh_client.c @@ -75,7 +75,7 @@ int main( void ) unsigned char *p, *end; unsigned char buf[2048]; - unsigned char hash[20]; + unsigned char hash[32]; const char *pers = "dh_client"; entropy_context entropy; diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c index 0ac91a437..cc75ee82f 100644 --- a/programs/pkey/dh_server.c +++ b/programs/pkey/dh_server.c @@ -75,7 +75,7 @@ int main( void ) int client_fd = -1; unsigned char buf[2048]; - unsigned char hash[20]; + unsigned char hash[32]; unsigned char buf2[2]; const char *pers = "dh_server"; diff --git a/programs/pkey/pk_sign.c b/programs/pkey/pk_sign.c index 7ccc70b6d..142349472 100644 --- a/programs/pkey/pk_sign.c +++ b/programs/pkey/pk_sign.c @@ -74,7 +74,7 @@ int main( int argc, char *argv[] ) pk_context pk; entropy_context entropy; ctr_drbg_context ctr_drbg; - unsigned char hash[20]; + unsigned char hash[32]; unsigned char buf[POLARSSL_MPI_MAX_SIZE]; char filename[512]; const char *pers = "pk_sign"; diff --git a/programs/pkey/pk_verify.c b/programs/pkey/pk_verify.c index 3afa34a35..1623708a4 100644 --- a/programs/pkey/pk_verify.c +++ b/programs/pkey/pk_verify.c @@ -68,7 +68,7 @@ int main( int argc, char *argv[] ) int ret = 1; size_t i; pk_context pk; - unsigned char hash[20]; + unsigned char hash[32]; unsigned char buf[POLARSSL_MPI_MAX_SIZE]; char filename[512]; diff --git a/programs/pkey/rsa_sign.c b/programs/pkey/rsa_sign.c index 63ef822ea..14b87ab7d 100644 --- a/programs/pkey/rsa_sign.c +++ b/programs/pkey/rsa_sign.c @@ -58,7 +58,7 @@ int main( int argc, char *argv[] ) int ret; size_t i; rsa_context rsa; - unsigned char hash[20]; + unsigned char hash[32]; unsigned char buf[POLARSSL_MPI_MAX_SIZE]; char filename[512]; diff --git a/programs/pkey/rsa_sign_pss.c b/programs/pkey/rsa_sign_pss.c index 7c0c7ca88..e0dbcbc6e 100644 --- a/programs/pkey/rsa_sign_pss.c +++ b/programs/pkey/rsa_sign_pss.c @@ -74,7 +74,7 @@ int main( int argc, char *argv[] ) pk_context pk; entropy_context entropy; ctr_drbg_context ctr_drbg; - unsigned char hash[20]; + unsigned char hash[32]; unsigned char buf[POLARSSL_MPI_MAX_SIZE]; char filename[512]; const char *pers = "rsa_sign_pss"; diff --git a/programs/pkey/rsa_verify.c b/programs/pkey/rsa_verify.c index 022ef337c..cb4256343 100644 --- a/programs/pkey/rsa_verify.c +++ b/programs/pkey/rsa_verify.c @@ -57,7 +57,7 @@ int main( int argc, char *argv[] ) int ret, c; size_t i; rsa_context rsa; - unsigned char hash[20]; + unsigned char hash[32]; unsigned char buf[POLARSSL_MPI_MAX_SIZE]; char filename[512]; diff --git a/programs/pkey/rsa_verify_pss.c b/programs/pkey/rsa_verify_pss.c index 217b7137f..3e732155d 100644 --- a/programs/pkey/rsa_verify_pss.c +++ b/programs/pkey/rsa_verify_pss.c @@ -69,7 +69,7 @@ int main( int argc, char *argv[] ) int ret = 1; size_t i; pk_context pk; - unsigned char hash[20]; + unsigned char hash[32]; unsigned char buf[POLARSSL_MPI_MAX_SIZE]; char filename[512];