aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-05-21 08:48:09 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-05-21 08:48:09 -0500
commit6e6ac23ad11bc1932b34d3013b39fc858a16a53e (patch)
treef1ad52f1b16825543a2f516d6e2e4e7e55d6ad9b /cryptography
parent055f9601e84cae2c8c5998fbbbf4cbabfb646272 (diff)
downloadcryptography-6e6ac23ad11bc1932b34d3013b39fc858a16a53e.tar.gz
cryptography-6e6ac23ad11bc1932b34d3013b39fc858a16a53e.tar.bz2
cryptography-6e6ac23ad11bc1932b34d3013b39fc858a16a53e.zip
allocate only 16 bytes
cffi allocates 17 bytes (one for trailing null), but that isn't used by this function so we don't need to allocate it.
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index d7110f81..7b0e50d3 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -862,7 +862,7 @@ class _AESCTRCipherContext(object):
)
assert res == 0
self._ecount = self._backend._ffi.new("char[]", 16)
- self._nonce = self._backend._ffi.new("char[]", mode.nonce)
+ self._nonce = self._backend._ffi.new("char[16]", mode.nonce)
self._num = self._backend._ffi.new("unsigned int *", 0)
def update(self, data):