From: Nikos Mavrogiannopoulos Date: Fri, 6 Jan 2012 18:49:24 +0000 (+0100) Subject: provide less timing information when decoding packets. Patch by Nadhem Alfardan. X-Git-Tag: gnutls_3_0_11~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35e26ca63c6da01db460d93e9c4bf86cd668534c;p=thirdparty%2Fgnutls.git provide less timing information when decoding packets. Patch by Nadhem Alfardan. --- diff --git a/NEWS b/NEWS index 58b6a818dd..49372ad56d 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,15 @@ GnuTLS NEWS -- History of user-visible changes. -*- outline -*- Copyright (C) 2000-2011 Free Software Foundation, Inc. See the end for copying conditions. +* Version 3.0.11 (unreleased) + +** libgnutls: Provide less timing information when decoding +TLS/DTLS record packets. Patch by Nadhem Alfardan. + +** API and ABI modifications: +No changes since last version. + + * Version 3.0.10 (released 2012-01-04) ** gnutls-cli/serv: Set don't fragment bit in DTLS sessions diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c index f04182189b..e593cfe919 100644 --- a/lib/gnutls_cipher.c +++ b/lib/gnutls_cipher.c @@ -560,7 +560,12 @@ ciphertext_to_compressed (gnutls_session_t session, } if (length < 0) - length = 0; + { + /* Setting a proper length to prevent timing differences in + * processing of records with invalid encryption. + */ + length = ciphertext.size - tag_size; + } /* Pass the type, version, length and compressed through * MAC.