commit 755c0b590030b69c3e42244a3c46b6936d6ae999
parent 7b573007cd8be18dc7ce792cd3f03f6201592743
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Wed, 21 Jun 2017 16:20:20 +0200
Improve password_decrypt_gnutls() to handle encrypted strings of any length.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/password.c b/src/password.c
@@ -481,10 +481,10 @@ gchar *password_decrypt_gnutls(const gchar *password,
return NULL;
}
- buf = malloc(BUFSIZE + blocklen);
- memset(buf, 0, BUFSIZE + blocklen);
+ buf = malloc(len + blocklen);
+ memset(buf, 0, len + blocklen);
ret = gnutls_cipher_decrypt2(handle, tmp, len,
- buf, BUFSIZE + blocklen);
+ buf, len + blocklen);
if (ret < 0) {
debug_print("Decryption failed: %s\n", gnutls_strerror(ret));
g_free(key.data);