aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Stapleton <alex@ly.st>2014-05-02 13:21:28 +0100
committerAlex Stapleton <alex@ly.st>2014-05-02 13:22:31 +0100
commita66f96cd34fe33864066b632f696f025a4fe4b90 (patch)
treec480b3648f80ee99f1493cde3c3b86d2e6ce1e36
parentd80ff2d3a6a443e5aea217d6bc3d356dab2b99b4 (diff)
downloadcryptography-a66f96cd34fe33864066b632f696f025a4fe4b90.tar.gz
cryptography-a66f96cd34fe33864066b632f696f025a4fe4b90.tar.bz2
cryptography-a66f96cd34fe33864066b632f696f025a4fe4b90.zip
Make sure the signature is truncated properly
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index 729f1471..e00be92f 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -1419,8 +1419,9 @@ class _DSASignatureContext(object):
0, data_to_sign, len(data_to_sign), sig_buf,
buflen, self._dsa_cdata)
assert res == 1
+ assert buflen[0]
- return self._backend._ffi.buffer(sig_buf)[:]
+ return self._backend._ffi.buffer(sig_buf)[:buflen[0]]
@utils.register_interface(interfaces.CMACContext)