summaryrefslogtreecommitdiff
path: root/legacy/eet
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-06-27 00:37:05 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-06-27 00:37:05 +0000
commit04a81e3c6f89e54b3c89c3956bf4c1ee7b0efa89 (patch)
tree23d8edde2e43ad6d1d6e618eee90e15623f37956 /legacy/eet
parent28d9f92ef24a0d059470da7f1ef64be9542637d4 (diff)
eet: fix crash when cyphering hyge amount of data.
Patch by Leandro Sansilva. SVN revision: 72906
Diffstat (limited to 'legacy/eet')
-rw-r--r--legacy/eet/AUTHORS1
-rw-r--r--legacy/eet/ChangeLog4
-rw-r--r--legacy/eet/NEWS1
-rw-r--r--legacy/eet/src/lib/eet_cipher.c8
4 files changed, 12 insertions, 2 deletions
diff --git a/legacy/eet/AUTHORS b/legacy/eet/AUTHORS
index c0d3edde7f..868fdea272 100644
--- a/legacy/eet/AUTHORS
+++ b/legacy/eet/AUTHORS
@@ -13,3 +13,4 @@ Adam Simpkins <adam@adamsimpkins.net>
13Mike Blumenkrantz <michael.blumenkrantz@gmail.com> 13Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
14Lionel Orry <lionel.orry@gmail.com> 14Lionel Orry <lionel.orry@gmail.com>
15Jérôme Pinot <ngc891@gmail.com> 15Jérôme Pinot <ngc891@gmail.com>
16Leandro Sansilva
diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog
index c862049930..aac09e2bd9 100644
--- a/legacy/eet/ChangeLog
+++ b/legacy/eet/ChangeLog
@@ -598,3 +598,7 @@
5982012-05-30 Cedric Bail 5982012-05-30 Cedric Bail
599 599
600 * Check that gnutls and openssl don't return below zero size during decipher. 600 * Check that gnutls and openssl don't return below zero size during decipher.
601
6022012-06-27 Leandro Sansilva
603
604 * Fix crash when cyphering huge amount of data.
diff --git a/legacy/eet/NEWS b/legacy/eet/NEWS
index f7da97e26e..9506fadf66 100644
--- a/legacy/eet/NEWS
+++ b/legacy/eet/NEWS
@@ -7,6 +7,7 @@ Fixes:
7 * Force destruction of all pending file when shuting down eet. 7 * Force destruction of all pending file when shuting down eet.
8 * Make eet_dictionary thread safe. 8 * Make eet_dictionary thread safe.
9 * Check that gnutls and openssl don't return below zero size during decipher. 9 * Check that gnutls and openssl don't return below zero size during decipher.
10 * Fix crash when cyphering huge amount of data.
10 11
11Eet 1.6.0 12Eet 1.6.0
12 13
diff --git a/legacy/eet/src/lib/eet_cipher.c b/legacy/eet/src/lib/eet_cipher.c
index 9441d8c562..5bd9f25d0b 100644
--- a/legacy/eet/src/lib/eet_cipher.c
+++ b/legacy/eet/src/lib/eet_cipher.c
@@ -968,7 +968,7 @@ eet_cipher(const void *data,
968# else /* ifdef HAVE_GNUTLS */ 968# else /* ifdef HAVE_GNUTLS */
969 /* Openssl declarations*/ 969 /* Openssl declarations*/
970 EVP_CIPHER_CTX ctx; 970 EVP_CIPHER_CTX ctx;
971 unsigned int *buffer; 971 unsigned int *buffer = NULL;
972 int tmp_len; 972 int tmp_len;
973# endif /* ifdef HAVE_GNUTLS */ 973# endif /* ifdef HAVE_GNUTLS */
974 974
@@ -1043,7 +1043,8 @@ eet_cipher(const void *data,
1043 /* Gcrypt close the cipher */ 1043 /* Gcrypt close the cipher */
1044 gcry_cipher_close(cipher); 1044 gcry_cipher_close(cipher);
1045# else /* ifdef HAVE_GNUTLS */ 1045# else /* ifdef HAVE_GNUTLS */
1046 buffer = alloca(crypted_length); 1046 buffer = malloc(crypted_length);
1047 if (!buffer) goto on_error;
1047 *buffer = tmp; 1048 *buffer = tmp;
1048 1049
1049 memcpy(buffer + 1, data, size); 1050 memcpy(buffer + 1, data, size);
@@ -1071,6 +1072,7 @@ eet_cipher(const void *data,
1071 goto on_error; 1072 goto on_error;
1072 1073
1073 EVP_CIPHER_CTX_cleanup(&ctx); 1074 EVP_CIPHER_CTX_cleanup(&ctx);
1075 free(buffer);
1074# endif /* ifdef HAVE_GNUTLS */ 1076# endif /* ifdef HAVE_GNUTLS */
1075 1077
1076 /* Set return values */ 1078 /* Set return values */
@@ -1098,6 +1100,8 @@ on_error:
1098 if (opened) 1100 if (opened)
1099 EVP_CIPHER_CTX_cleanup(&ctx); 1101 EVP_CIPHER_CTX_cleanup(&ctx);
1100 1102
1103 free(buffer);
1104
1101# endif /* ifdef HAVE_GNUTLS */ 1105# endif /* ifdef HAVE_GNUTLS */
1102 /* General error */ 1106 /* General error */
1103 free(ret); 1107 free(ret);