diff options
author | Alex Stapleton <alex@ly.st> | 2014-05-02 13:21:28 +0100 |
---|---|---|
committer | Alex Stapleton <alex@ly.st> | 2014-05-02 13:22:31 +0100 |
commit | a66f96cd34fe33864066b632f696f025a4fe4b90 (patch) | |
tree | c480b3648f80ee99f1493cde3c3b86d2e6ce1e36 | |
parent | d80ff2d3a6a443e5aea217d6bc3d356dab2b99b4 (diff) | |
download | cryptography-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.py | 3 |
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) |