summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-11-28 11:47:40 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-11-28 11:50:23 +0100
commit3979cbcb425b4088c822b0a75c78f5f1eef32291 (patch)
tree642d482c4ac975c9a86d3425093926b6efca7d9c
parent702c5a7790d05d54158360eb426f6d82caaf1ea6 (diff)
downloadgnutls-3979cbcb425b4088c822b0a75c78f5f1eef32291.tar.gz
pkcs12: fixed the calculation of p_size
That affects passwords which exceed 32 characters.
-rw-r--r--lib/x509/pkcs12_encr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/x509/pkcs12_encr.c b/lib/x509/pkcs12_encr.c
index 85cd3f228f..d8fd49f822 100644
--- a/lib/x509/pkcs12_encr.c
+++ b/lib/x509/pkcs12_encr.c
@@ -105,7 +105,7 @@ _gnutls_pkcs12_string_to_key(const mac_entry_st * me,
}
/* Store salt and password in BUF_I */
- p_size = ((pwlen / 64) * 64) + 64;
+ p_size = (((2*pwlen) / 64) * 64) + 64;
if (p_size > sizeof(buf_i) - 64)
return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);