summaryrefslogtreecommitdiff
path: root/lib/cipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cipher.c')
-rw-r--r--lib/cipher.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/cipher.c b/lib/cipher.c
index 287f2e8c8a..8e7bd8227d 100644
--- a/lib/cipher.c
+++ b/lib/cipher.c
@@ -747,8 +747,12 @@ ciphertext_to_compressed(gnutls_session_t session,
* because there is a timing channel in that memory access (in certain CPUs).
*/
#ifdef ENABLE_SSL3
- if (ver->id != GNUTLS_SSL3)
+ if (ver->id == GNUTLS_SSL3) {
+ if (pad >= blocksize)
+ pad_failed = 1;
+ } else
#endif
+ {
for (i = 2; i <= MIN(256, ciphertext->size); i++) {
tmp_pad_failed |=
(compressed->
@@ -756,6 +760,7 @@ ciphertext_to_compressed(gnutls_session_t session,
pad_failed |=
((i <= (1 + pad)) & (tmp_pad_failed));
}
+ }
if (unlikely
(pad_failed != 0