diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-11-29 10:15:54 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-11-29 10:15:57 +0100 |
commit | 474a1d01855d93131010e87e144035fb8394f6de (patch) | |
tree | 3f037e6e2c3fac588f3339dc3755090787773611 | |
parent | 81b8e1c0b23ea3f82bd336341f84b6be15a467a6 (diff) | |
download | gnutls-474a1d01855d93131010e87e144035fb8394f6de.tar.gz |
pkcs12: fixed the calculation of p_size
Include the trailing zero into the size calculation.
-rw-r--r-- | lib/x509/pkcs12_encr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/x509/pkcs12_encr.c b/lib/x509/pkcs12_encr.c index d8fd49f822..f925fd8cbc 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 = (((2*pwlen) / 64) * 64) + 64; + p_size = (((2*(pwlen+1)) / 64) * 64) + 64; if (p_size > sizeof(buf_i) - 64) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); |