Fix hash buffer size in pkey programs

This commit is contained in:
Manuel Pégourié-Gonnard 2015-08-27 21:51:44 +02:00
parent d224ff1f63
commit 102a620c9a
8 changed files with 8 additions and 8 deletions

View File

@ -75,7 +75,7 @@ int main( void )
unsigned char *p, *end; unsigned char *p, *end;
unsigned char buf[2048]; unsigned char buf[2048];
unsigned char hash[20]; unsigned char hash[32];
const char *pers = "dh_client"; const char *pers = "dh_client";
mbedtls_entropy_context entropy; mbedtls_entropy_context entropy;

View File

@ -74,7 +74,7 @@ int main( void )
mbedtls_net_context listen_fd, client_fd; mbedtls_net_context listen_fd, client_fd;
unsigned char buf[2048]; unsigned char buf[2048];
unsigned char hash[20]; unsigned char hash[32];
unsigned char buf2[2]; unsigned char buf2[2];
const char *pers = "dh_server"; const char *pers = "dh_server";

View File

@ -64,7 +64,7 @@ int main( int argc, char *argv[] )
mbedtls_pk_context pk; mbedtls_pk_context pk;
mbedtls_entropy_context entropy; mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg; mbedtls_ctr_drbg_context ctr_drbg;
unsigned char hash[20]; unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
char filename[512]; char filename[512];
const char *pers = "mbedtls_pk_sign"; const char *pers = "mbedtls_pk_sign";

View File

@ -59,7 +59,7 @@ int main( int argc, char *argv[] )
int ret = 1; int ret = 1;
size_t i; size_t i;
mbedtls_pk_context pk; mbedtls_pk_context pk;
unsigned char hash[20]; unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
char filename[512]; char filename[512];

View File

@ -59,7 +59,7 @@ int main( int argc, char *argv[] )
int ret; int ret;
size_t i; size_t i;
mbedtls_rsa_context rsa; mbedtls_rsa_context rsa;
unsigned char hash[20]; unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
char filename[512]; char filename[512];

View File

@ -65,7 +65,7 @@ int main( int argc, char *argv[] )
mbedtls_pk_context pk; mbedtls_pk_context pk;
mbedtls_entropy_context entropy; mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg; mbedtls_ctr_drbg_context ctr_drbg;
unsigned char hash[20]; unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
char filename[512]; char filename[512];
const char *pers = "rsa_sign_pss"; const char *pers = "rsa_sign_pss";

View File

@ -58,7 +58,7 @@ int main( int argc, char *argv[] )
int ret, c; int ret, c;
size_t i; size_t i;
mbedtls_rsa_context rsa; mbedtls_rsa_context rsa;
unsigned char hash[20]; unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
char filename[512]; char filename[512];

View File

@ -63,7 +63,7 @@ int main( int argc, char *argv[] )
int ret = 1; int ret = 1;
size_t i; size_t i;
mbedtls_pk_context pk; mbedtls_pk_context pk;
unsigned char hash[20]; unsigned char hash[32];
unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
char filename[512]; char filename[512];