From 0be82f20a96f0dc259fb6dea137a516bb4b53d27 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Wed, 3 Oct 2012 20:36:33 +0000 Subject: [PATCH] - Updated rsa_pkcs1_verify() and rsa_pkcs1_sign() to use appropriate buffer size for max MPIs --- library/rsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/rsa.c b/library/rsa.c index 2dcb130cb5..191bfe8687 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -496,7 +496,7 @@ int rsa_pkcs1_decrypt( rsa_context *ctx, size_t ilen; unsigned char *p; unsigned char bt; - unsigned char buf[1024]; + unsigned char buf[POLARSSL_MPI_MAX_SIZE]; #if defined(POLARSSL_PKCS1_V21) unsigned char lhash[POLARSSL_MD_MAX_SIZE]; unsigned int hlen; @@ -862,7 +862,7 @@ int rsa_pkcs1_verify( rsa_context *ctx, int ret; size_t len, siglen; unsigned char *p, c; - unsigned char buf[1024]; + unsigned char buf[POLARSSL_MPI_MAX_SIZE]; #if defined(POLARSSL_PKCS1_V21) unsigned char result[POLARSSL_MD_MAX_SIZE]; unsigned char zeros[8];