summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-09 23:48:29 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-09 23:48:29 +0100
commitcfea38b5482c21fe6ddffaddc59a0040f80bd578 (patch)
tree2bab2037d363a4b1225cd3d69834a796c91d34f0 /lib
parentf3d17dbbbc94e32dda87b7eaea833773c7eedab6 (diff)
downloadgnutls-cfea38b5482c21fe6ddffaddc59a0040f80bd578.tar.gz
added sanity for parameters in _gnutls_pkcs1_rsa_decrypt().
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_pk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c
index 337204b2ea..43d1893dcf 100644
--- a/lib/gnutls_pk.c
+++ b/lib/gnutls_pk.c
@@ -216,6 +216,9 @@ _gnutls_pkcs1_rsa_decrypt (gnutls_datum_t * plaintext,
size_t esize, mod_bits;
gnutls_pk_params_st pk_params;
+ if (params_len > GNUTLS_MAX_PK_PARAMS)
+ return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
+
for (i = 0; i < params_len; i++)
pk_params.params[i] = params[i];
pk_params.params_nr = params_len;