summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-08-31 23:01:19 +0300
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-08-31 23:01:19 +0300
commit852e261ece0b5989b96aa12e671c90fa6e661186 (patch)
tree307e93f2fdccec34195488547313d8ea6ce1fd2f /lib
parentec9c26524059c22ee4eb5f26c1d09e6e7ef005cd (diff)
downloadgnutls-852e261ece0b5989b96aa12e671c90fa6e661186.tar.gz
simplified pad calculation
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_cipher.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c
index bc3af51f8b..db09a1b427 100644
--- a/lib/gnutls_cipher.c
+++ b/lib/gnutls_cipher.c
@@ -310,7 +310,7 @@ compressed_to_ciphertext (gnutls_session_t session,
content_type_t type,
record_parameters_st * params)
{
- uint8_t pad = target_size - compressed->size;
+ uint8_t pad;
int length, ret;
uint8_t preamble[MAX_PREAMBLE_SIZE];
int preamble_size;
@@ -349,12 +349,15 @@ compressed_to_ciphertext (gnutls_session_t session,
if (ret < 0)
return gnutls_assert_val(ret);
+ pad = target_size - compressed->size;
+
length =
calc_enc_length_block (session, ver, compressed->size, tag_size, &pad,
auth_cipher, blocksize);
}
else
{
+ pad = 0;
length =
calc_enc_length_stream (session, compressed->size, tag_size,
auth_cipher);